

























@@ -19,7 +19,9 @@ import {
1919isBundledManifestOwner,
2020passesManifestOwnerBasePolicy,
2121} from "./manifest-owner-policy.js";
22-import { loadPluginManifestRegistry, type PluginManifestRecord } from "./manifest-registry.js";
22+import { loadPluginManifestRegistryForInstalledIndex } from "./manifest-registry-installed.js";
23+import type { PluginManifestRecord } from "./manifest-registry.js";
24+import { loadPluginRegistrySnapshot } from "./plugin-registry.js";
23252426const IGNORED_CHANNEL_CONFIG_KEYS = new Set(["defaults", "modelByChannel"]);
2527@@ -340,6 +342,27 @@ function listDisabledChannelIdsForConfig(config: OpenClawConfig): string[] {
340342.filter((channelId): channelId is string => Boolean(channelId));
341343}
342344345+function loadInstalledChannelManifestRecords(params: {
346+config: OpenClawConfig;
347+workspaceDir?: string;
348+env: NodeJS.ProcessEnv;
349+cache?: boolean;
350+}): readonly PluginManifestRecord[] {
351+const index = loadPluginRegistrySnapshot({
352+config: params.config,
353+workspaceDir: params.workspaceDir,
354+env: params.env,
355+cache: params.cache,
356+});
357+return loadPluginManifestRegistryForInstalledIndex({
358+ index,
359+config: params.config,
360+workspaceDir: params.workspaceDir,
361+env: params.env,
362+includeDisabled: true,
363+}).plugins;
364+}
365+343366export function resolveConfiguredChannelPresencePolicy(params: {
344367config: OpenClawConfig;
345368activationSourceConfig?: OpenClawConfig;
@@ -355,12 +378,12 @@ export function resolveConfiguredChannelPresencePolicy(params: {
355378resolveAgentWorkspaceDir(params.config, resolveDefaultAgentId(params.config));
356379const records =
357380params.manifestRecords ??
358-loadPluginManifestRegistry({
381+loadInstalledChannelManifestRecords({
359382config: params.config,
360383 workspaceDir,
361384 env,
362385cache: params.cache,
363-}).plugins;
386+});
364387365388const disabledChannelIds = new Set(listDisabledChannelIdsForConfig(params.config));
366389const entrySources = new Map<string, Set<ConfiguredChannelPresenceSource>>();
@@ -471,17 +494,20 @@ function resolveScopedChannelOwnerPluginIds(params: {
471494workspaceDir?: string;
472495env: NodeJS.ProcessEnv;
473496cache?: boolean;
497+manifestRecords?: readonly PluginManifestRecord[];
474498}): string[] {
475499const channelIds = normalizeChannelIds(params.channelIds);
476500if (channelIds.length === 0) {
477501return [];
478502}
479-const registry = loadPluginManifestRegistry({
480-config: params.config,
481-workspaceDir: params.workspaceDir,
482-env: params.env,
483-cache: params.cache,
484-});
503+const records =
504+params.manifestRecords ??
505+loadInstalledChannelManifestRecords({
506+config: params.config,
507+workspaceDir: params.workspaceDir,
508+env: params.env,
509+cache: params.cache,
510+});
485511const trustConfig = params.activationSourceConfig ?? params.config;
486512const normalizedConfig = normalizePluginsConfig(trustConfig.plugins);
487513const candidateIds = dedupeSortedPluginIds(
@@ -495,14 +521,15 @@ function resolveScopedChannelOwnerPluginIds(params: {
495521workspaceDir: params.workspaceDir,
496522env: params.env,
497523cache: params.cache,
524+manifestRecords: records,
498525});
499526}),
500527);
501528if (candidateIds.length === 0) {
502529return [];
503530}
504531const candidateIdSet = new Set(candidateIds);
505-return registry.plugins
532+return records
506533.filter((plugin) => {
507534if (!candidateIdSet.has(plugin.id)) {
508535return false;
@@ -525,6 +552,7 @@ export function resolveDiscoverableScopedChannelPluginIds(params: {
525552workspaceDir?: string;
526553env: NodeJS.ProcessEnv;
527554cache?: boolean;
555+manifestRecords?: readonly PluginManifestRecord[];
528556}): string[] {
529557return resolveScopedChannelOwnerPluginIds(params);
530558}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。