























@@ -158,6 +158,12 @@ export type PluginManifestRegistry = {
158158diagnostics: PluginDiagnostic[];
159159};
160160161+export type BundledChannelConfigCollector = (params: {
162+pluginDir: string;
163+manifest: PluginManifest;
164+packageManifest?: OpenClawPackageManifest;
165+}) => Record<string, PluginManifestChannelConfig> | undefined;
166+161167const registryCache = pluginManifestRegistryCache as Map<
162168string,
163169{ expiresAt: number; registry: PluginManifestRegistry }
@@ -293,9 +299,18 @@ function buildRecord(params: {
293299manifestPath: string;
294300schemaCacheKey?: string;
295301configSchema?: Record<string, unknown>;
302+bundledChannelConfigCollector?: BundledChannelConfigCollector;
296303}): PluginManifestRecord {
304+const manifestChannelConfigs =
305+params.candidate.origin === "bundled" && params.bundledChannelConfigCollector
306+ ? params.bundledChannelConfigCollector({
307+pluginDir: params.candidate.packageDir ?? params.candidate.rootDir,
308+manifest: params.manifest,
309+packageManifest: params.candidate.packageManifest,
310+})
311+ : params.manifest.channelConfigs;
297312const channelConfigs = mergePackageChannelMetaIntoChannelConfigs({
298-channelConfigs: params.manifest.channelConfigs,
313+channelConfigs: manifestChannelConfigs,
299314packageChannel: params.candidate.packageManifest?.channel,
300315});
301316const packageChannelCommands = normalizePackageChannelCommands(
@@ -542,14 +557,18 @@ export function loadPluginManifestRegistry(
542557candidates?: PluginCandidate[];
543558diagnostics?: PluginDiagnostic[];
544559installRecords?: Record<string, PluginInstallRecord>;
560+bundledChannelConfigCollector?: BundledChannelConfigCollector;
545561} = {},
546562): PluginManifestRegistry {
547563const config = params.config ?? {};
548564const normalized = normalizePluginsConfigWithResolver(config.plugins);
549565const env = params.env ?? process.env;
550566const cacheKey = buildCacheKey({ workspaceDir: params.workspaceDir, plugins: normalized, env });
551567const cacheEnabled =
552-params.cache !== false && !params.installRecords && shouldUseManifestCache(env);
568+params.cache !== false &&
569+!params.installRecords &&
570+!params.bundledChannelConfigCollector &&
571+shouldUseManifestCache(env);
553572if (cacheEnabled) {
554573const cached = registryCache.get(cacheKey);
555574if (cached && cached.expiresAt > Date.now()) {
@@ -659,6 +678,9 @@ export function loadPluginManifestRegistry(
659678manifestPath: manifestRes.manifestPath,
660679 schemaCacheKey,
661680 configSchema,
681+ ...(params.bundledChannelConfigCollector
682+ ? { bundledChannelConfigCollector: params.bundledChannelConfigCollector }
683+ : {}),
662684});
663685664686const existing = seenIds.get(manifest.id);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。