Plugins: share runtime registry resolution

This commit is contained in:
Gustavo Madeira Santana
2026-03-28 00:18:50 -04:00
parent f811ce5052
commit ee7f5825c8
11 changed files with 96 additions and 80 deletions

View File

@@ -4,7 +4,7 @@ import {
withBundledPluginEnablementCompat,
withBundledPluginVitestCompat,
} from "./bundled-compat.js";
import { getCompatibleActivePluginRegistry, loadOpenClawPlugins } from "./loader.js";
import { resolveRuntimePluginRegistry } from "./loader.js";
import { loadPluginManifestRegistry } from "./manifest-registry.js";
import type { PluginRegistry } from "./registry.js";
@@ -73,10 +73,7 @@ export function resolvePluginCapabilityProviders<K extends CapabilityProviderReg
: {
config: resolveCapabilityProviderConfig({ key: params.key, cfg: params.cfg }),
};
const registry =
(loadOptions ? getCompatibleActivePluginRegistry(loadOptions) : undefined) ??
(loadOptions ? loadOpenClawPlugins(loadOptions) : undefined) ??
getCompatibleActivePluginRegistry();
const registry = resolveRuntimePluginRegistry(loadOptions);
return (registry?.[params.key] ?? []).map(
(entry) => entry.provider,
) as CapabilityProviderForKey<K>[];