File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88} from "./bundled-compat.js" ;
99import { resolveBundledPluginRepoEntryPath } from "./bundled-plugin-metadata.js" ;
1010import { createCapturedPluginRegistration } from "./captured-registration.js" ;
11- import { discoverOpenClawPlugins } from "./discovery.js" ;
11+ import { discoverOpenClawPlugins , type PluginDiscoveryResult } from "./discovery.js" ;
1212import type { PluginLoadOptions } from "./loader.js" ;
1313import { loadPluginManifestRegistry } from "./manifest-registry.js" ;
1414import { unwrapDefaultModuleExport } from "./module-export.js" ;
@@ -196,6 +196,7 @@ export function loadBundledCapabilityRuntimeRegistry(params: {
196196 pluginIds : readonly string [ ] ;
197197 env ?: PluginLoadOptions [ "env" ] ;
198198 pluginSdkResolution ?: PluginSdkResolutionPreference ;
199+ discovery ?: PluginDiscoveryResult ;
199200} ) {
200201 const env = params . env ?? process . env ;
201202 const pluginIds = new Set ( params . pluginIds ) ;
@@ -232,9 +233,7 @@ export function loadBundledCapabilityRuntimeRegistry(params: {
232233 } ) ;
233234 } ;
234235
235- const discovery = discoverOpenClawPlugins ( {
236- env,
237- } ) ;
236+ const discovery = params . discovery ?? discoverOpenClawPlugins ( { env } ) ;
238237 const manifestRegistry = loadPluginManifestRegistry ( {
239238 config : buildBundledCapabilityRuntimeConfig ( params . pluginIds , env ) ,
240239 env,
Original file line number Diff line number Diff line change 11import { normalizeOptionalString } from "../shared/string-coerce.js" ;
2- import { discoverOpenClawPlugins } from "./discovery.js" ;
2+ import { discoverOpenClawPlugins , type PluginDiscoveryResult } from "./discovery.js" ;
33import { loadPluginManifest } from "./manifest.js" ;
44
55export type BundledPluginSource = {
@@ -38,11 +38,11 @@ export function resolveBundledPluginSources(params: {
3838 workspaceDir ?: string ;
3939 /** Use an explicit env when bundled roots should resolve independently from process.env. */
4040 env ?: NodeJS . ProcessEnv ;
41+ discovery ?: PluginDiscoveryResult ;
4142} ) : Map < string , BundledPluginSource > {
42- const discovery = discoverOpenClawPlugins ( {
43- workspaceDir : params . workspaceDir ,
44- env : params . env ,
45- } ) ;
43+ const discovery =
44+ params . discovery ??
45+ discoverOpenClawPlugins ( { workspaceDir : params . workspaceDir , env : params . env } ) ;
4646 const bundled = new Map < string , BundledPluginSource > ( ) ;
4747
4848 for ( const candidate of discovery . candidates ) {
Original file line number Diff line number Diff line change 11import type { PluginInstallRecord } from "../config/types.plugins.js" ;
2- import { discoverOpenClawPlugins } from "./discovery.js" ;
2+ import { discoverOpenClawPlugins , type PluginDiscoveryResult } from "./discovery.js" ;
33import { shouldRejectHardlinkedPluginFiles } from "./hardlink-policy.js" ;
44import { loadInstalledPluginIndexInstallRecordsSync } from "./installed-plugin-index-record-reader.js" ;
55import {
@@ -31,14 +31,18 @@ export function listChannelCatalogEntries(
3131 * Bundled-only callers skip the load to avoid the disk read.
3232 */
3333 installRecords ?: Record < string , PluginInstallRecord > ;
34+ discovery ?: PluginDiscoveryResult ;
3435 } = { } ,
3536) : PluginChannelCatalogEntry [ ] {
3637 const installRecords = resolveInstallRecords ( params ) ;
37- return discoverOpenClawPlugins ( {
38- workspaceDir : params . workspaceDir ,
39- env : params . env ,
40- ...( installRecords && Object . keys ( installRecords ) . length > 0 ? { installRecords } : { } ) ,
41- } ) . candidates . flatMap ( ( candidate ) => {
38+ const discovery =
39+ params . discovery ??
40+ discoverOpenClawPlugins ( {
41+ workspaceDir : params . workspaceDir ,
42+ env : params . env ,
43+ ...( installRecords && Object . keys ( installRecords ) . length > 0 ? { installRecords } : { } ) ,
44+ } ) ;
45+ return discovery . candidates . flatMap ( ( candidate ) => {
4246 if ( params . origin && candidate . origin !== params . origin ) {
4347 return [ ] ;
4448 }
Original file line number Diff line number Diff line change 11import { normalizeProviderId } from "../../agents/provider-id.js" ;
22import { normalizeLowercaseStringOrEmpty } from "../../shared/string-coerce.js" ;
33import { loadBundledCapabilityRuntimeRegistry } from "../bundled-capability-runtime.js" ;
4+ import { discoverOpenClawPlugins } from "../discovery.js" ;
45import { loadPluginManifestRegistry } from "../manifest-registry.js" ;
56import { resolveManifestContractPluginIds } from "../plugin-registry.js" ;
67import { resolveBundledExplicitProviderContractsFromPublicArtifacts } from "../provider-contract-public-artifacts.js" ;
@@ -255,12 +256,14 @@ function loadScopedCapabilityRuntimeRegistryEntries<T>(params: {
255256 plugin : BundledCapabilityRuntimeRegistry [ "plugins" ] [ number ] ,
256257 ) => readonly string [ ] ;
257258} ) : T [ ] {
259+ const discovery = discoverOpenClawPlugins ( { } ) ;
258260 let lastFailure : Error | undefined ;
259261
260262 for ( let attempt = 0 ; attempt < 2 ; attempt += 1 ) {
261263 const registry = loadBundledCapabilityRuntimeRegistry ( {
262264 pluginIds : [ params . pluginId ] ,
263265 pluginSdkResolution : "dist" ,
266+ discovery,
264267 } ) ;
265268 const entries = params . loadEntries ( registry ) ;
266269 if ( entries . length > 0 ) {
You can’t perform that action at this time.
0 commit comments