
























@@ -23,7 +23,6 @@ import { hasKind } from "./slots.js";
23232424export const INSTALLED_PLUGIN_INDEX_VERSION = 1;
2525export const INSTALLED_PLUGIN_INDEX_MIGRATION_VERSION = 1;
26-export const INSTALLED_PLUGIN_CONTRIBUTION_METADATA_VERSION = 1;
2726export const INSTALLED_PLUGIN_INDEX_WARNING =
2827"DO NOT EDIT. This file is generated by OpenClaw from plugin manifests, install records, and config policy. Use `openclaw plugins registry --refresh`, `openclaw plugins install/update/uninstall`, or `openclaw plugins enable/disable` instead.";
2928@@ -75,11 +74,6 @@ export type InstalledPluginPackageChannelInfo = Pick<
75747675export type InstalledPluginIndexRecord = {
7776pluginId: string;
78-contributionMetadataVersion?: typeof INSTALLED_PLUGIN_CONTRIBUTION_METADATA_VERSION;
79-name?: string;
80-description?: string;
81-manifestVersion?: string;
82-legacyPluginIds?: readonly string[];
8377packageName?: string;
8478packageVersion?: string;
8579/**
@@ -99,16 +93,6 @@ export type InstalledPluginIndexRecord = {
9993manifestHash: string;
10094format?: PluginManifestRecord["format"];
10195bundleFormat?: PluginManifestRecord["bundleFormat"];
102-bundleCapabilities?: readonly string[];
103-kind?: PluginManifestRecord["kind"];
104-channels?: readonly string[];
105-providers?: readonly string[];
106-cliBackends?: readonly string[];
107-setupProviders?: readonly string[];
108-channelConfigs?: readonly string[];
109-modelCatalogProviders?: readonly string[];
110-commandAliases?: readonly string[];
111-contractKeys?: readonly string[];
11296source?: string;
11397setupSource?: string;
11498packageJson?: {
@@ -225,18 +209,6 @@ function buildStartupInfo(record: PluginManifestRecord): InstalledPluginStartupI
225209};
226210}
227211228-function collectContractKeys(record: PluginManifestRecord): readonly string[] | undefined {
229-const contracts = record.contracts;
230-if (!contracts) {
231-return undefined;
232-}
233-return normalizeStringList(
234-Object.entries(contracts).flatMap(([key, value]) =>
235-Array.isArray(value) && value.length > 0 ? [key] : [],
236-),
237-);
238-}
239-240212function collectCompatCodes(record: PluginManifestRecord): readonly PluginCompatCode[] {
241213const codes: PluginCompatCode[] = [];
242214if (record.providerAuthEnvVars && Object.keys(record.providerAuthEnvVars).length > 0) {
@@ -335,10 +307,6 @@ function normalizeStringListField(value: unknown): readonly string[] | undefined
335307return normalized.length > 0 ? normalized : undefined;
336308}
337309338-function normalizeStringList(values: readonly string[] | undefined): readonly string[] | undefined {
339-return normalizeStringListField(values);
340-}
341-342310function normalizePackageChannel(
343311channel: PluginPackageChannel | undefined,
344312): InstalledPluginPackageChannelInfo | undefined {
@@ -608,7 +576,6 @@ function buildInstalledPluginIndex(
608576}).enabled;
609577const indexRecord: InstalledPluginIndexRecord = {
610578pluginId: record.id,
611-contributionMetadataVersion: INSTALLED_PLUGIN_CONTRIBUTION_METADATA_VERSION,
612579manifestPath: record.manifestPath,
613580 manifestHash,
614581source: record.source,
@@ -618,70 +585,12 @@ function buildInstalledPluginIndex(
618585startup: buildStartupInfo(record),
619586compat: collectCompatCodes(record),
620587};
621-if (record.name) {
622-indexRecord.name = record.name;
623-}
624-if (record.description) {
625-indexRecord.description = record.description;
626-}
627-if (record.version) {
628-indexRecord.manifestVersion = record.version;
629-}
630-const legacyPluginIds = normalizeStringList(record.legacyPluginIds);
631-if (legacyPluginIds) {
632-indexRecord.legacyPluginIds = legacyPluginIds;
633-}
634588if (record.format && record.format !== "openclaw") {
635589indexRecord.format = record.format;
636590}
637591if (record.bundleFormat) {
638592indexRecord.bundleFormat = record.bundleFormat;
639593}
640-if (record.bundleCapabilities?.length) {
641-indexRecord.bundleCapabilities = normalizeStringList(record.bundleCapabilities);
642-}
643-if (record.kind) {
644-indexRecord.kind = record.kind;
645-}
646-const channels = normalizeStringList(record.channels);
647-if (channels) {
648-indexRecord.channels = channels;
649-}
650-const providers = normalizeStringList(record.providers);
651-if (providers) {
652-indexRecord.providers = providers;
653-}
654-const cliBackends = normalizeStringList([
655- ...record.cliBackends,
656- ...(record.setup?.cliBackends ?? []),
657-]);
658-if (cliBackends) {
659-indexRecord.cliBackends = cliBackends;
660-}
661-const setupProviders = normalizeStringList(
662-record.setup?.providers?.map((provider) => provider.id),
663-);
664-if (setupProviders) {
665-indexRecord.setupProviders = setupProviders;
666-}
667-const channelConfigs = normalizeStringList(Object.keys(record.channelConfigs ?? {}));
668-if (channelConfigs) {
669-indexRecord.channelConfigs = channelConfigs;
670-}
671-const modelCatalogProviders = normalizeStringList(
672-Object.keys(record.modelCatalog?.providers ?? {}),
673-);
674-if (modelCatalogProviders) {
675-indexRecord.modelCatalogProviders = modelCatalogProviders;
676-}
677-const commandAliases = normalizeStringList(record.commandAliases?.map((alias) => alias.name));
678-if (commandAliases) {
679-indexRecord.commandAliases = commandAliases;
680-}
681-const contractKeys = collectContractKeys(record);
682-if (contractKeys) {
683-indexRecord.contractKeys = contractKeys;
684-}
685594if (record.enabledByDefault === true) {
686595indexRecord.enabledByDefault = true;
687596}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。