@@ -60,6 +60,7 @@ type WebProviderRuntimeContext = {
6060 config : PluginLoadOptions [ "config" ] ;
6161 activationSourceConfig ?: PluginLoadOptions [ "config" ] ;
6262 autoEnabledReasons : Record < string , string [ ] > ;
63+ loadPluginIds ?: string [ ] ;
6364 onlyPluginIds ?: string [ ] ;
6465} ;
6566
@@ -69,13 +70,18 @@ function resolveWebProviderRuntimeContext<TEntry>(
6970) : WebProviderRuntimeContext {
7071 const env = params . env ?? process . env ;
7172 const workspaceDir = params . workspaceDir ?? getActivePluginRegistryWorkspaceDir ( ) ;
73+ const shouldFilterProviders =
74+ params . config !== undefined ||
75+ params . onlyPluginIds !== undefined ||
76+ params . origin !== undefined ||
77+ params . bundledAllowlistCompat === true ;
7278 const { config, activationSourceConfig, autoEnabledReasons } =
7379 deps . resolveBundledResolutionConfig ( {
7480 ...params ,
7581 workspaceDir,
7682 env,
7783 } ) ;
78- const onlyPluginIds = normalizePluginIdScope (
84+ const candidatePluginIds = normalizePluginIdScope (
7985 deps . resolveCandidatePluginIds ( {
8086 config,
8187 workspaceDir,
@@ -84,11 +90,13 @@ function resolveWebProviderRuntimeContext<TEntry>(
8490 origin : params . origin ,
8591 } ) ,
8692 ) ;
93+ const onlyPluginIds = shouldFilterProviders ? candidatePluginIds : undefined ;
8794 return {
8895 activationSourceConfig,
8996 autoEnabledReasons,
9097 config,
9198 env,
99+ loadPluginIds : candidatePluginIds ,
92100 onlyPluginIds,
93101 workspaceDir,
94102 } ;
@@ -110,8 +118,8 @@ function resolveWebProviderLoadOptions(
110118 {
111119 cache : params . cache ?? true ,
112120 activate : params . activate ?? false ,
113- ...( hasExplicitPluginIdScope ( context . onlyPluginIds )
114- ? { onlyPluginIds : context . onlyPluginIds }
121+ ...( hasExplicitPluginIdScope ( context . loadPluginIds )
122+ ? { onlyPluginIds : context . loadPluginIds }
115123 : { } ) ,
116124 } ,
117125 ) ;
@@ -176,7 +184,7 @@ export function resolvePluginWebProviders<TEntry>(
176184 env : context . env ,
177185 loadOptions,
178186 workspaceDir : context . workspaceDir ,
179- requiredPluginIds : context . onlyPluginIds ,
187+ requiredPluginIds : context . loadPluginIds ,
180188 } ) ;
181189 if ( compatible ) {
182190 return deps . mapRegistryProviders ( {
@@ -192,7 +200,11 @@ export function resolvePluginWebProviders<TEntry>(
192200 if ( hasExplicitEmptyScope ) {
193201 return [ ] ;
194202 }
195- return [ ] ;
203+ const registry = loadOpenClawPlugins ( loadOptions ) ;
204+ return deps . mapRegistryProviders ( {
205+ registry,
206+ onlyPluginIds : context . onlyPluginIds ,
207+ } ) ;
196208}
197209
198210export function resolveRuntimeWebProviders < TEntry > (
0 commit comments