|
1 | 1 | import type { OpenClawConfig } from "../../config/types.openclaw.js"; |
2 | 2 | import { isBlockedObjectKey } from "../../infra/prototype-keys.js"; |
| 3 | +import { isInstalledPluginEnabled } from "../../plugins/installed-plugin-index.js"; |
| 4 | +import { loadPluginManifestRegistryForInstalledIndex } from "../../plugins/manifest-registry-installed.js"; |
3 | 5 | import type { PluginManifestRecord } from "../../plugins/manifest-registry.js"; |
4 | | -import { |
5 | | -isPluginEnabled, |
6 | | -loadPluginManifestRegistryForPluginRegistry, |
7 | | -} from "../../plugins/plugin-registry.js"; |
| 6 | +import { loadPluginRegistrySnapshot } from "../../plugins/plugin-registry.js"; |
8 | 7 | import { normalizeOptionalString } from "../../shared/string-coerce.js"; |
9 | 8 | import type { ChannelPlugin } from "./types.plugin.js"; |
10 | 9 | |
@@ -66,11 +65,17 @@ export function resolveReadOnlyChannelCommandDefaults(
|
66 | 65 | if (!normalizedChannelId || !isSafeManifestChannelId(normalizedChannelId)) { |
67 | 66 | return undefined; |
68 | 67 | } |
69 | | -const registry = loadPluginManifestRegistryForPluginRegistry({ |
| 68 | +const index = loadPluginRegistrySnapshot({ |
70 | 69 | config: options.config, |
71 | 70 | stateDir: options.stateDir, |
72 | 71 | workspaceDir: options.workspaceDir, |
73 | 72 | env: options.env ?? process.env, |
| 73 | +}); |
| 74 | +const registry = loadPluginManifestRegistryForInstalledIndex({ |
| 75 | + index, |
| 76 | +config: options.config, |
| 77 | +workspaceDir: options.workspaceDir, |
| 78 | +env: options.env ?? process.env, |
74 | 79 | includeDisabled: true, |
75 | 80 | }); |
76 | 81 | for (const record of registry.plugins) { |
@@ -83,15 +88,7 @@ export function resolveReadOnlyChannelCommandDefaults(
|
83 | 88 | ) { |
84 | 89 | continue; |
85 | 90 | } |
86 | | -if ( |
87 | | -!isPluginEnabled({ |
88 | | -pluginId: record.id, |
89 | | -config: options.config, |
90 | | -stateDir: options.stateDir, |
91 | | -workspaceDir: options.workspaceDir, |
92 | | -env: options.env ?? process.env, |
93 | | -}) |
94 | | -) { |
| 91 | +if (!isInstalledPluginEnabled(index, record.id, options.config)) { |
95 | 92 | continue; |
96 | 93 | } |
97 | 94 | const channelConfigValue = record.channelConfigs |
|