@@ -44,50 +44,6 @@ const commandSecretTargetsModuleLoader = createLazyImportLoader(
4444 ( ) => import ( "../cli/command-secret-targets.js" ) ,
4545) ;
4646
47- function loadStatusScanDepsRuntimeModule ( ) {
48- return statusScanDepsRuntimeModuleLoader . load ( ) ;
49- }
50-
51- function loadStatusAgentLocalModule ( ) {
52- return statusAgentLocalModuleLoader . load ( ) ;
53- }
54-
55- function loadStatusUpdateModule ( ) {
56- return statusUpdateModuleLoader . load ( ) ;
57- }
58-
59- function loadStatusScanRuntimeModule ( ) {
60- return statusScanRuntimeModuleLoader . load ( ) ;
61- }
62-
63- function loadGatewayCallModule ( ) {
64- return gatewayCallModuleLoader . load ( ) ;
65- }
66-
67- function loadStatusSummaryModule ( ) {
68- return statusSummaryModuleLoader . load ( ) ;
69- }
70-
71- function loadChannelPluginIdsModule ( ) {
72- return channelPluginIdsModuleLoader . load ( ) ;
73- }
74-
75- function loadConfigModule ( ) {
76- return configModuleLoader . load ( ) ;
77- }
78-
79- function loadControlUiLinksModule ( ) {
80- return controlUiLinksModuleLoader . load ( ) ;
81- }
82-
83- function loadCommandConfigResolutionModule ( ) {
84- return commandConfigResolutionModuleLoader . load ( ) ;
85- }
86-
87- function loadCommandSecretTargetsModule ( ) {
88- return commandSecretTargetsModuleLoader . load ( ) ;
89- }
90-
9147async function resolveStatusChannelsStatus ( params : {
9248 cfg : OpenClawConfig ;
9349 gatewayReachable : boolean ;
@@ -99,7 +55,7 @@ async function resolveStatusChannelsStatus(params: {
9955 // Avoid a second gateway call after probe failure; channel tables can still summarize local config.
10056 return null ;
10157 }
102- const { callGateway } = await loadGatewayCallModule ( ) ;
58+ const { callGateway } = await gatewayCallModuleLoader . load ( ) ;
10359 return await callGateway ( {
10460 config : params . cfg ,
10561 method : "channels.status" ,
@@ -193,17 +149,17 @@ export async function collectStatusScanOverview(params: {
193149 commandName : params . commandName ,
194150 allowMissingConfigFastPath : params . allowMissingConfigFastPath ,
195151 readConfigSnapshot : async ( ) =>
196- ( await loadConfigModule ( ) ) . readBestEffortConfigSnapshot ( {
152+ ( await configModuleLoader . load ( ) ) . readBestEffortConfigSnapshot ( {
197153 observe : false ,
198154 skipPluginValidation : params . skipConfigPluginValidation ,
199155 } ) ,
200156 resolveConfig : async ( loadedConfig ) =>
201157 await (
202- await loadCommandConfigResolutionModule ( )
158+ await commandConfigResolutionModuleLoader . load ( )
203159 ) . resolveCommandConfigWithSecrets ( {
204160 config : loadedConfig ,
205161 commandName : params . commandName ,
206- targetIds : ( await loadCommandSecretTargetsModule ( ) ) . getStatusCommandSecretTargetIds (
162+ targetIds : ( await commandSecretTargetsModuleLoader . load ( ) ) . getStatusCommandSecretTargetIds (
207163 loadedConfig ,
208164 process . env ,
209165 { includeChannelTargets : params . includeChannelSecretTargets } ,
@@ -215,7 +171,7 @@ export async function collectStatusScanOverview(params: {
215171 params . progress ?. tick ( ) ;
216172 const hasConfiguredChannels = params . resolveHasConfiguredChannels
217173 ? await params . resolveHasConfiguredChannels ( cfg , sourceConfig )
218- : await loadChannelPluginIdsModule ( ) . then ( ( { hasConfiguredChannelsForReadOnlyScope } ) =>
174+ : await channelPluginIdsModuleLoader . load ( ) . then ( ( { hasConfiguredChannelsForReadOnlyScope } ) =>
219175 hasConfiguredChannelsForReadOnlyScope ( {
220176 config : cfg ,
221177 activationSourceConfig : sourceConfig ,
@@ -239,18 +195,18 @@ export async function collectStatusScanOverview(params: {
239195 includeLocalStatusRpcFallback : params . includeLocalStatusRpcFallback ,
240196 gatewayProbeTimeoutMs,
241197 getTailnetHostname : async ( runner ) => {
242- return await loadStatusScanDepsRuntimeModule ( ) . then ( ( { getTailnetHostname } ) =>
243- getTailnetHostname ( runner ) ,
244- ) ;
198+ return await statusScanDepsRuntimeModuleLoader
199+ . load ( )
200+ . then ( ( { getTailnetHostname } ) => getTailnetHostname ( runner ) ) ;
245201 } ,
246202 getUpdateCheckResult : async ( updateParams ) =>
247- await loadStatusUpdateModule ( ) . then ( ( { getUpdateCheckResult } ) =>
248- getUpdateCheckResult ( updateParams ) ,
249- ) ,
203+ await statusUpdateModuleLoader
204+ . load ( )
205+ . then ( ( { getUpdateCheckResult } ) => getUpdateCheckResult ( updateParams ) ) ,
250206 getAgentLocalStatuses : async ( bootstrapCfg ) =>
251- await loadStatusAgentLocalModule ( ) . then ( ( { getAgentLocalStatuses } ) =>
252- getAgentLocalStatuses ( bootstrapCfg ) ,
253- ) ,
207+ await statusAgentLocalModuleLoader
208+ . load ( )
209+ . then ( ( { getAgentLocalStatuses } ) => getAgentLocalStatuses ( bootstrapCfg ) ) ,
254210 } ) ;
255211
256212 if ( params . labels ?. checkingTailscale ) {
@@ -280,9 +236,9 @@ export async function collectStatusScanOverview(params: {
280236 const tailscaleHttpsUrl = await bootstrap . resolveTailscaleHttpsUrl ( ) ;
281237 const advertisedControlUiLinks =
282238 params . includeAdvertisedControlUiLinks === true && cfg . gateway ?. controlUi ?. enabled !== false
283- ? await loadControlUiLinksModule ( ) . then ( async ( { resolveAdvertisedControlUiLinks } ) =>
239+ ? await controlUiLinksModuleLoader . load ( ) . then ( async ( { resolveAdvertisedControlUiLinks } ) =>
284240 resolveAdvertisedControlUiLinks ( {
285- port : ( await loadConfigModule ( ) ) . resolveGatewayPort ( cfg ) ,
241+ port : ( await configModuleLoader . load ( ) ) . resolveGatewayPort ( cfg ) ,
286242 bind : cfg . gateway ?. bind ,
287243 customBindHost : cfg . gateway ?. customBindHost ,
288244 basePath : cfg . gateway ?. controlUi ?. basePath ,
@@ -309,7 +265,9 @@ export async function collectStatusScanOverview(params: {
309265 params . progress ?. tick ( ) ;
310266 // Runtime channel helpers stay lazy because JSON fast paths can skip channel data entirely.
311267 const { collectChannelStatusIssues, buildChannelsTable } =
312- await loadStatusScanRuntimeModule ( ) . then ( ( { statusScanRuntime } ) => statusScanRuntime ) ;
268+ await statusScanRuntimeModuleLoader
269+ . load ( )
270+ . then ( ( { statusScanRuntime } ) => statusScanRuntime ) ;
313271 const channelIssuesLocal = channelsStatusLocal
314272 ? collectChannelStatusIssues ( channelsStatusLocal )
315273 : [ ] ;
@@ -367,7 +325,7 @@ export async function resolveStatusSummaryFromOverview(params: {
367325 if ( params . overview . skipColdStartNetworkChecks ) {
368326 return buildColdStartStatusSummary ( ) ;
369327 }
370- return await loadStatusSummaryModule ( ) . then ( ( { getStatusSummary } ) =>
328+ return await statusSummaryModuleLoader . load ( ) . then ( ( { getStatusSummary } ) =>
371329 getStatusSummary ( {
372330 config : params . overview . cfg ,
373331 sourceConfig : params . overview . sourceConfig ,
0 commit comments