test(plugins): fast-path bundled setup web providers

This commit is contained in:
Vincent Koc
2026-04-17 13:30:55 -07:00
parent c0b8250f4f
commit afdbf48914
6 changed files with 44 additions and 25 deletions

View File

@@ -67,6 +67,13 @@ type ResolveWebProviderRuntimeDeps<TEntry> = {
registry: PluginRegistry;
onlyPluginIds?: readonly string[];
}) => TEntry[];
resolveBundledPublicArtifactProviders?: (params: {
config?: PluginLoadOptions["config"];
workspaceDir?: string;
env?: PluginLoadOptions["env"];
bundledAllowlistCompat?: boolean;
onlyPluginIds?: readonly string[];
}) => TEntry[] | null;
};
export function createWebProviderSnapshotCache<TEntry>(): WebProviderSnapshotCache<TEntry> {
@@ -132,6 +139,18 @@ export function resolvePluginWebProviders<TEntry>(
if (pluginIds.length === 0) {
return [];
}
if (params.activate !== true) {
const bundledArtifactProviders = deps.resolveBundledPublicArtifactProviders?.({
config: params.config,
workspaceDir,
env,
bundledAllowlistCompat: params.bundledAllowlistCompat,
onlyPluginIds: pluginIds,
});
if (bundledArtifactProviders) {
return bundledArtifactProviders;
}
}
const registry = loadOpenClawPlugins(
buildPluginRuntimeLoadOptionsFromValues(
{