






















@@ -4,7 +4,7 @@ import {
44withBundledPluginEnablementCompat,
55withBundledPluginVitestCompat,
66} from "./bundled-compat.js";
7-import { resolveRuntimePluginRegistry } from "./loader.js";
7+import { resolveRuntimePluginRegistry, type PluginLoadOptions } from "./loader.js";
88import { loadPluginManifestRegistryForPluginRegistry } from "./plugin-registry.js";
99import type { PluginRegistry } from "./registry-types.js";
1010@@ -85,6 +85,22 @@ function resolveCapabilityProviderConfig(params: {
8585});
8686}
878788+function createCapabilityProviderFallbackLoadOptions(params: {
89+compatConfig?: OpenClawConfig;
90+pluginIds: string[];
91+installBundledRuntimeDeps?: boolean;
92+}): PluginLoadOptions {
93+const loadOptions: PluginLoadOptions = {
94+ ...(params.compatConfig === undefined ? {} : { config: params.compatConfig }),
95+onlyPluginIds: params.pluginIds,
96+activate: false,
97+};
98+if (params.installBundledRuntimeDeps === false) {
99+loadOptions.installBundledRuntimeDeps = false;
100+}
101+return loadOptions;
102+}
103+88104function findProviderById<K extends CapabilityProviderRegistryKey>(
89105entries: PluginRegistry[K],
90106providerId: string,
@@ -203,6 +219,7 @@ export function resolvePluginCapabilityProvider<K extends CapabilityProviderRegi
203219key: K;
204220providerId: string;
205221cfg?: OpenClawConfig;
222+installBundledRuntimeDeps?: boolean;
206223}): CapabilityProviderForKey<K> | undefined {
207224const activeRegistry = resolveRuntimePluginRegistry();
208225const activeProvider = findProviderById(activeRegistry?.[params.key] ?? [], params.providerId);
@@ -224,22 +241,19 @@ export function resolvePluginCapabilityProvider<K extends CapabilityProviderRegi
224241cfg: params.cfg,
225242 pluginIds,
226243});
227-const loadOptions =
228-compatConfig === undefined
229- ? { onlyPluginIds: pluginIds, activate: false, installBundledRuntimeDeps: false }
230- : {
231-config: compatConfig,
232-onlyPluginIds: pluginIds,
233-activate: false,
234-installBundledRuntimeDeps: false,
235-};
244+const loadOptions = createCapabilityProviderFallbackLoadOptions({
245+ compatConfig,
246+ pluginIds,
247+installBundledRuntimeDeps: params.installBundledRuntimeDeps,
248+});
236249const registry = resolveRuntimePluginRegistry(loadOptions);
237250return findProviderById(registry?.[params.key] ?? [], params.providerId);
238251}
239252240253export function resolvePluginCapabilityProviders<K extends CapabilityProviderRegistryKey>(params: {
241254key: K;
242255cfg?: OpenClawConfig;
256+installBundledRuntimeDeps?: boolean;
243257}): CapabilityProviderForKey<K>[] {
244258const activeRegistry = resolveRuntimePluginRegistry();
245259const activeProviders = activeRegistry?.[params.key] ?? [];
@@ -272,15 +286,11 @@ export function resolvePluginCapabilityProviders<K extends CapabilityProviderReg
272286cfg: params.cfg,
273287 pluginIds,
274288});
275-const loadOptions =
276-compatConfig === undefined
277- ? { onlyPluginIds: pluginIds, activate: false, installBundledRuntimeDeps: false }
278- : {
279-config: compatConfig,
280-onlyPluginIds: pluginIds,
281-activate: false,
282-installBundledRuntimeDeps: false,
283-};
289+const loadOptions = createCapabilityProviderFallbackLoadOptions({
290+ compatConfig,
291+ pluginIds,
292+installBundledRuntimeDeps: params.installBundledRuntimeDeps,
293+});
284294const registry = resolveRuntimePluginRegistry(loadOptions);
285295const loadedProviders = registry?.[params.key] ?? [];
286296if (params.key !== "memoryEmbeddingProviders") {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。