@wujie-shell/core 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/wujie-shell.mjs +10 -30
- package/dist/bin/wujie-shell.mjs +1 -1
- package/dist/src/agents/bundled-agent-skills.mjs +1 -1
- package/dist/src/agents/bundled-agents.mjs +1 -1
- package/dist/src/agents/codex-home.mjs +1 -0
- package/dist/src/agents/runtime-config.mjs +1 -1
- package/dist/src/chat/media-archive.mjs +1 -1
- package/dist/src/chat/queue.mjs +1 -1
- package/dist/src/common/cron-session-key.mjs +1 -1
- package/dist/src/common/diagnostics.mjs +1 -1
- package/dist/src/common/logging.mjs +1 -1
- package/dist/src/common/runtime-logger.mjs +1 -1
- package/dist/src/common/sqlite-paths.mjs +1 -1
- package/dist/src/common/user-events.mjs +1 -1
- package/dist/src/common/utils.mjs +1 -1
- package/dist/src/config/controller.mjs +1 -1
- package/dist/src/connectors/config-utils.mjs +1 -1
- package/dist/src/connectors/constants.mjs +1 -1
- package/dist/src/connectors/controller.mjs +1 -1
- package/dist/src/connectors/kdocs-cli.mjs +1 -1
- package/dist/src/connectors/lark-cli.mjs +1 -1
- package/dist/src/electron/instance-identity.mjs +1 -0
- package/dist/src/electron/main.mjs +1 -1
- package/dist/src/electron/preload.mjs +1 -1
- package/dist/src/electron/protocol-url-state.mjs +1 -1
- package/dist/src/events/domain-event-journal.mjs +1 -1
- package/dist/src/files/generated-files-store.mjs +1 -1
- package/dist/src/files/handlers.mjs +1 -1
- package/dist/src/gateway/chat-delta.mjs +1 -1
- package/dist/src/gateway/controller.mjs +1 -1
- package/dist/src/gateway/request-id-title-events.mjs +1 -1
- package/dist/src/gateway/ws-client.mjs +1 -1
- package/dist/src/index.mjs +1 -1
- package/dist/src/log-reporting/handlers.mjs +1 -1
- package/dist/src/log-reporting/report-logs.mjs +1 -1
- package/dist/src/models/handlers.mjs +1 -1
- package/dist/src/preferences/store.mjs +1 -1
- package/dist/src/request-id/handlers.mjs +1 -1
- package/dist/src/request-id/runtime-bridge.mjs +1 -1
- package/dist/src/request-id/session-store.mjs +1 -1
- package/dist/src/request-id/title.mjs +1 -1
- package/dist/src/review/controller.mjs +1 -0
- package/dist/src/runtime/cron-missed-run-policy.mjs +1 -1
- package/dist/src/runtime/index.mjs +1 -1
- package/dist/src/runtime/patch-channel-plugin-runtime.mjs +1 -1
- package/dist/src/runtime/patch-chat-attachment-base64.mjs +1 -1
- package/dist/src/runtime/patch-chat-history-mixed-tool-content.mjs +1 -1
- package/dist/src/runtime/patch-codex-isolated-auth.mjs +1 -0
- package/dist/src/runtime/patch-provider-request-id-header.mjs +1 -1
- package/dist/src/runtime/patch-qqbot-outbound-session-route.mjs +1 -1
- package/dist/src/runtime/patch-request-id-title-runtime.mjs +1 -1
- package/dist/src/runtime/patch-session-store-sqlite.mjs +1 -1
- package/dist/src/runtime/patch-weixin-outbound-session-route.mjs +1 -1
- package/dist/src/runtime/plugin-sync.mjs +1 -1
- package/dist/src/sessions/agent-sessions-map-store.mjs +1 -1
- package/dist/src/sessions/runtime-bridge.mjs +1 -1
- package/dist/src/sessions/session-data-service.mjs +1 -1
- package/dist/src/sessions/session-runtime-state-service.mjs +1 -1
- package/dist/src/sessions/session-runtime-state.mjs +1 -1
- package/dist/src/sessions/session-sqlite-store.mjs +1 -1
- package/dist/src/skills/import.mjs +1 -1
- package/dist/src/skills/market.mjs +1 -1
- package/dist/src/terminal/manager.mjs +1 -1
- package/dist/src/updates/controller.mjs +1 -1
- package/dist/src/updates/loader.mjs +1 -1
- package/package.json +7 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x4cb8b3=_0x5af4;(function(_0x2bfd7c,_0x12c27b){const _0x488749=_0x5af4,_0x3ee2e7=_0x2bfd7c();while(!![]){try{const _0x4fb003=-parseInt(_0x488749(0x17d))/0x1*(parseInt(_0x488749(0x3df))/0x2)+parseInt(_0x488749(0x176))/0x3*(-parseInt(_0x488749(0x162))/0x4)+parseInt(_0x488749(0x2b2))/0x5+-parseInt(_0x488749(0x1c6))/0x6*(-parseInt(_0x488749(0x387))/0x7)+parseInt(_0x488749(0x1f3))/0x8+-parseInt(_0x488749(0x1f7))/0x9*(parseInt(_0x488749(0x178))/0xa)+parseInt(_0x488749(0x3f6))/0xb;if(_0x4fb003===_0x12c27b)break;else _0x3ee2e7['push'](_0x3ee2e7['shift']());}catch(_0x100270){_0x3ee2e7['push'](_0x3ee2e7['shift']());}}}(_0x8027,0x8c265));import{existsSync}from'node:fs';import{createWriteStream}from'node:fs';import{chmod,cp,mkdir,readFile,readdir,rename,rm,stat,symlink,writeFile}from'node:fs/promises';import{basename,delimiter,dirname,join,extname,parse,relative,resolve}from'node:path';import{fileURLToPath,pathToFileURL}from'node:url';import{spawn}from'node:child_process';function _0x5af4(_0x2fa1aa,_0x56bb24){_0x2fa1aa=_0x2fa1aa-0x15a;const _0x8027f1=_0x8027();let _0x5af406=_0x8027f1[_0x2fa1aa];return _0x5af406;}import{get}from'node:https';import{pipeline}from'node:stream/promises';import{getConfigPaths}from'@wujie-shell/config';import{copyDirFresh,getPackageMetadata,readJson,readPluginManifest,toRuntimeRelative,writeJson}from'../common/utils.mjs';import{createRuntimeLogger,summarizeRuntimeManifest,summarizeShellConfig}from'../common/runtime-logger.mjs';import{hasConfiguredKdocsSkill,installKdocsCliBinary}from'../connectors/kdocs-cli.mjs';import{installRuntimeLarkCliPackage,resolveRuntimeLarkCliCommand}from'../connectors/lark-cli.mjs';import{patchMixedToolContentFromSource}from'./patch-chat-history-mixed-tool-content.mjs';import{patchChatAttachmentBase64FromSource}from'./patch-chat-attachment-base64.mjs';import{patchChannelPluginRuntimeFromSource}from'./patch-channel-plugin-runtime.mjs';import{patchProviderRequestIdHeaderFromSource}from'./patch-provider-request-id-header.mjs';import{patchSessionStoreLoadFromSource,patchSessionStoreWriteFromSource}from'./patch-session-store-sqlite.mjs';import{patchQQBotOutboundFallbackFromSource,patchQQBotOutboundSessionRouteFromSource}from'./patch-qqbot-outbound-session-route.mjs';import{patchWeixinOutboundFallbackFromSource,patchWeixinOutboundSessionRouteFromSource}from'./patch-weixin-outbound-session-route.mjs';import{patchRequestIdTitleRuntimeFromSource}from'./patch-request-id-title-runtime.mjs';const RUNTIME_DIR=_0x4cb8b3(0x3b0)+'time',MANIFEST_NAME=_0x4cb8b3(0x3ee)+_0x4cb8b3(0x28d)+_0x4cb8b3(0x3a8),NPM_INSTALL_TIMEOUT_MS=0xf*0x3c*0x3e8;export function resolveRuntimeRoot(_0x2403ce){if(process.env.WUJIE_SHELL_RUNTIME_ROOT)return resolve(process.env.WUJIE_SHELL_RUNTIME_ROOT);return resolve(_0x2403ce,RUNTIME_DIR);}export function resolveManifestPath(_0x9fac78){return join(_0x9fac78,MANIFEST_NAME);}async function loadProductRuntime(_0x28ee56,_0x43e21a){const _0x21b08e=_0x4cb8b3,_0x2d8f37=[join(_0x28ee56,'shell-ru'+_0x21b08e(0x1dc),_0x21b08e(0x261)+'s'),join(_0x43e21a,'shell-ru'+_0x21b08e(0x1dc),_0x21b08e(0x261)+'s')];for(const _0x213a80 of _0x2d8f37){if(!existsSync(_0x213a80))continue;return await import(pathToFileURL(_0x213a80)[_0x21b08e(0x32b)]+_0x21b08e(0x298)+Date[_0x21b08e(0x366)]());}return{};}export async function prepareRuntime(_0x14639c,{syncOnly:syncOnly=![],pruneForPackaging:pruneForPackaging=![]}={}){const _0x11afd5=_0x4cb8b3,_0x1331bc=resolveRuntimeRoot(_0x14639c[_0x11afd5(0x25e)+_0x11afd5(0x32a)]),_0x5e987b=createRuntimeLogger(getConfigPaths(_0x14639c),_0x11afd5(0x36f)),_0x2cf544=Date[_0x11afd5(0x366)]();_0x5e987b?.['importan'+'t']?.('prepare\x20'+_0x11afd5(0x3e2)+_0x11afd5(0x16f),{'syncOnly':syncOnly,'runtimeRoot':_0x1331bc,'shellConfig':summarizeShellConfig(_0x14639c)});try{const _0x37ab0d=await ensureRuntimeBase(_0x14639c,_0x1331bc,{'runtimeLogger':_0x5e987b,'syncOnly':syncOnly});_0x5e987b?.['importan'+'t']?.(_0x11afd5(0x3e2)+_0x11afd5(0x28d)+_0x11afd5(0x23a),{'manifestPath':resolveManifestPath(_0x1331bc),'manifest':summarizeRuntimeManifest(_0x37ab0d)}),validateRuntimeNodeVersion(_0x37ab0d,_0x14639c),_0x5e987b?.[_0x11afd5(0x1b3)+'t']?.(_0x11afd5(0x3e2)+_0x11afd5(0x1d4)+_0x11afd5(0x1bf)+_0x11afd5(0x3f8),{'nodeVersion':_0x37ab0d[_0x11afd5(0x1d1)+'ion']});if(syncOnly)validateRuntimeOpenClawVersion(_0x37ab0d,_0x14639c),_0x5e987b?.[_0x11afd5(0x1b3)+'t']?.(_0x11afd5(0x3e2)+'openclaw'+'\x20version'+_0x11afd5(0x2c8)+'ed',{'openclawVersion':_0x37ab0d[_0x11afd5(0x33d)+'Version']});else{if(_0x37ab0d[_0x11afd5(0x33d)+_0x11afd5(0x2ee)]!==_0x14639c['openclaw'][_0x11afd5(0x33d)+_0x11afd5(0x2ee)]){const _0x467763=await loadRuntimeInfo(_0x14639c['projectR'+_0x11afd5(0x32a)]);_0x5e987b?.[_0x11afd5(0x1b3)+'t']?.('openclaw'+_0x11afd5(0x33c)+'\x20install'+'\x20started',{'fromVersion':_0x37ab0d[_0x11afd5(0x33d)+_0x11afd5(0x2ee)]||'unknown','toVersion':_0x14639c['openclaw']['openclaw'+_0x11afd5(0x2ee)]}),await installOpenClawPackage(_0x467763,_0x14639c['openclaw'][_0x11afd5(0x33d)+_0x11afd5(0x2ee)]),_0x37ab0d[_0x11afd5(0x33d)+_0x11afd5(0x2ee)]=_0x14639c['openclaw']['openclaw'+_0x11afd5(0x2ee)],_0x5e987b?.[_0x11afd5(0x1b3)+'t']?.(_0x11afd5(0x33d)+_0x11afd5(0x33c)+_0x11afd5(0x250)+_0x11afd5(0x22e)+'ed',{'openclawVersion':_0x37ab0d[_0x11afd5(0x33d)+_0x11afd5(0x2ee)]});}}_0x37ab0d[_0x11afd5(0x37c)+'dAt']=new Date()['toISOStr'+_0x11afd5(0x196)](),_0x37ab0d['nodeVers'+_0x11afd5(0x35f)]=_0x14639c['openclaw'][_0x11afd5(0x1d1)+_0x11afd5(0x35f)],_0x37ab0d['product']={'appId':_0x14639c[_0x11afd5(0x1ae)],'productName':_0x14639c[_0x11afd5(0x222)+_0x11afd5(0x38f)],'dataDirName':_0x14639c[_0x11afd5(0x34a)+_0x11afd5(0x38f)]},await patchChatHistoryMixedToolContentBug(_0x1331bc,_0x37ab0d,{'runtimeLogger':_0x5e987b}),await patchChatAttachmentBase64Runtime(_0x1331bc,_0x37ab0d,{'runtimeLogger':_0x5e987b}),await patchProviderRequestIdHeader(_0x1331bc,_0x37ab0d,{'runtimeLogger':_0x5e987b}),await patchChannelPluginRuntimeBug(_0x1331bc,_0x37ab0d,{'runtimeLogger':_0x5e987b}),await patchWeixinOutboundFallbackRuntime(_0x1331bc,_0x37ab0d,{'runtimeLogger':_0x5e987b}),await patchQQBotOutboundFallbackRuntime(_0x1331bc,_0x37ab0d,{'runtimeLogger':_0x5e987b});const _0x405711=await loadProductRuntime(_0x14639c[_0x11afd5(0x25e)+_0x11afd5(0x32a)],_0x1331bc);if(typeof _0x405711[_0x11afd5(0x1b9)+_0x11afd5(0x1c9)+_0x11afd5(0x1dc)]===_0x11afd5(0x2b8)){const _0x56b405=createRuntimeInfoFromManifest(_0x1331bc,_0x37ab0d);await _0x405711[_0x11afd5(0x1b9)+'roductRu'+_0x11afd5(0x1dc)]({'shellConfig':_0x14639c,'runtime':_0x56b405,'runtimeLogger':_0x5e987b,'syncOnly':syncOnly}),_0x5e987b?.[_0x11afd5(0x1b3)+'t']?.(_0x11afd5(0x2d2)+_0x11afd5(0x3e2)+_0x11afd5(0x1de)+_0x11afd5(0x1e8));}await patchSessionStoreSqliteRuntime(_0x1331bc,_0x37ab0d,{'runtimeLogger':_0x5e987b}),await patchRequestIdTitleRuntime(_0x1331bc,_0x37ab0d,{'runtimeLogger':_0x5e987b});!syncOnly&&(await installRuntimeLarkCliPackage(createRuntimeInfoFromManifest(_0x1331bc,_0x37ab0d),{'runtimeLogger':_0x5e987b,'createRuntimeEnv':createRuntimeEnv}),_0x5e987b?.[_0x11afd5(0x1b3)+'t']?.('lark-cli'+_0x11afd5(0x260)+_0x11afd5(0x33c)+'\x20synced'),await hasConfiguredKdocsSkill(_0x14639c)?(await installKdocsCliBinary(_0x14639c,createRuntimeInfoFromManifest(_0x1331bc,_0x37ab0d),{'runtimeLogger':_0x5e987b,'syncOnly':syncOnly}),_0x5e987b?.[_0x11afd5(0x1b3)+'t']?.('connecto'+_0x11afd5(0x36d)+_0x11afd5(0x1b1)+_0x11afd5(0x286))):_0x5e987b?.[_0x11afd5(0x189)]('connecto'+_0x11afd5(0x36d)+_0x11afd5(0x1b1)+_0x11afd5(0x1cf)+_0x11afd5(0x2f0)+'kill\x20not'+_0x11afd5(0x254)+_0x11afd5(0x397)));const _0x1403fe=Array[_0x11afd5(0x1a6)](_0x37ab0d[_0x11afd5(0x2c9)])?_0x37ab0d[_0x11afd5(0x2c9)][_0x11afd5(0x23b)]:0x0;return await syncManifestPluginScope(_0x14639c,_0x1331bc,_0x37ab0d),_0x5e987b?.['importan'+'t']?.(_0x11afd5(0x3e2)+'plugin\x20s'+_0x11afd5(0x177)+_0x11afd5(0x287),{'beforePluginCount':_0x1403fe,'afterPluginCount':Array[_0x11afd5(0x1a6)](_0x37ab0d['plugins'])?_0x37ab0d[_0x11afd5(0x2c9)][_0x11afd5(0x23b)]:0x0,'pluginSpecCount':Array[_0x11afd5(0x1a6)](_0x37ab0d[_0x11afd5(0x294)+'ecs'])?_0x37ab0d['pluginSp'+_0x11afd5(0x37e)]['length']:0x0}),await syncConfiguredNpmPlugins(_0x14639c,_0x1331bc,_0x37ab0d,{'runtimeLogger':_0x5e987b,'syncOnly':syncOnly}),_0x5e987b?.['importan'+'t']?.(_0x11afd5(0x27f)+_0x11afd5(0x351)+_0x11afd5(0x3fa)+_0x11afd5(0x2da),{'pluginSpecCount':_0x14639c[_0x11afd5(0x33d)]['pluginSp'+_0x11afd5(0x37e)][_0x11afd5(0x23b)],'pluginCount':Array[_0x11afd5(0x1a6)](_0x37ab0d[_0x11afd5(0x2c9)])?_0x37ab0d[_0x11afd5(0x2c9)][_0x11afd5(0x23b)]:0x0}),await patchWeixinOutboundSessionRoute(_0x1331bc,_0x37ab0d,{'runtimeLogger':_0x5e987b}),await patchQQBotOutboundSessionRoute(_0x1331bc,_0x37ab0d,{'runtimeLogger':_0x5e987b}),await syncProductPlugins(_0x14639c,_0x1331bc,_0x37ab0d,{'runtimeLogger':_0x5e987b}),_0x5e987b?.[_0x11afd5(0x1b3)+'t']?.('product\x20'+_0x11afd5(0x195)+_0x11afd5(0x286),{'localPluginCount':_0x14639c[_0x11afd5(0x33d)][_0x11afd5(0x264)+'LocalPlu'+'ginPaths'][_0x11afd5(0x23b)],'pluginCount':Array['isArray'](_0x37ab0d['plugins'])?_0x37ab0d[_0x11afd5(0x2c9)][_0x11afd5(0x23b)]:0x0}),await syncProductAgents(_0x14639c,_0x1331bc,_0x37ab0d),_0x5e987b?.['importan'+'t']?.('product\x20'+_0x11afd5(0x215)+_0x11afd5(0x2da),{'sources':_0x14639c[_0x11afd5(0x33d)][_0x11afd5(0x264)+_0x11afd5(0x39d)+_0x11afd5(0x15c)],'entryCount':_0x37ab0d[_0x11afd5(0x3a4)]?.[_0x11afd5(0x3ca)+'nt'],'installPath':_0x37ab0d[_0x11afd5(0x3a4)]?.[_0x11afd5(0x1c1)+_0x11afd5(0x362)]}),await syncProductSkills(_0x14639c,_0x1331bc,_0x37ab0d),_0x5e987b?.[_0x11afd5(0x1b3)+'t']?.('product\x20'+_0x11afd5(0x25a)+_0x11afd5(0x2da),{'sources':_0x14639c[_0x11afd5(0x33d)]['resolved'+'LocalSki'+_0x11afd5(0x221)],'entryCount':_0x37ab0d['skills']?.[_0x11afd5(0x3ca)+'nt'],'installPath':_0x37ab0d[_0x11afd5(0x389)]?.[_0x11afd5(0x1c1)+_0x11afd5(0x362)]}),await syncRuntimeWrapper(_0x14639c,_0x1331bc,_0x37ab0d),_0x5e987b?.[_0x11afd5(0x1b3)+'t']?.(_0x11afd5(0x3e2)+_0x11afd5(0x3de)+_0x11afd5(0x286),{'wujieclawBin':_0x37ab0d[_0x11afd5(0x393)+_0x11afd5(0x3b6)]}),await prunePackagedRuntimeCaches(_0x1331bc,_0x5e987b),pruneForPackaging&&await prunePackagedRuntimePayload(_0x1331bc,_0x37ab0d,_0x5e987b),await writeJson(resolveManifestPath(_0x1331bc),_0x37ab0d),_0x5e987b?.[_0x11afd5(0x1b3)+'t']?.(_0x11afd5(0x3e2)+_0x11afd5(0x28d)+_0x11afd5(0x386),{'manifestPath':resolveManifestPath(_0x1331bc),'manifest':summarizeRuntimeManifest(_0x37ab0d),'durationMs':Date[_0x11afd5(0x366)]()-_0x2cf544}),await _0x5e987b?.[_0x11afd5(0x327)](),_0x37ab0d;}catch(_0x15268d){_0x5e987b?.[_0x11afd5(0x371)](_0x11afd5(0x2c1)+_0x11afd5(0x3e2)+_0x11afd5(0x2f7),{'syncOnly':syncOnly,'runtimeRoot':_0x1331bc,'durationMs':Date['now']()-_0x2cf544,'error':_0x15268d}),await _0x5e987b?.[_0x11afd5(0x327)]();throw _0x15268d;}}async function prunePackagedRuntimeCaches(_0xc4e44a,_0x29df80){const _0x48ea32=_0x4cb8b3,_0x3838dd=[join(_0xc4e44a,'.cache'),join(_0xc4e44a,_0x48ea32(0x19f),_0x48ea32(0x37f)+'e'),join(_0xc4e44a,_0x48ea32(0x38b)+'time-bac'+_0x48ea32(0x1bc)),join(_0xc4e44a,_0x48ea32(0x3db)+'nloads-b'+_0x48ea32(0x347))];for(const _0x1936f4 of _0x3838dd){if(!existsSync(_0x1936f4))continue;await rm(_0x1936f4,{'recursive':!![],'force':!![]}),_0x29df80?.['info']('pruned\x20r'+'untime\x20c'+'ache\x20bef'+_0x48ea32(0x3ba)+'aging',{'cachePath':_0x1936f4});}}async function prunePackagedRuntimePayload(_0x3d97e0,_0x29eb2e,_0x18e138){const _0x3f05db=_0x4cb8b3,_0x4095fe=createRuntimeInfoFromManifest(_0x3d97e0,_0x29eb2e),_0x4c466f=[join(_0x3d97e0,process['platform']===_0x3f05db(0x242)?'node/nod'+_0x3f05db(0x198)+_0x3f05db(0x200):_0x3f05db(0x408)+_0x3f05db(0x1ed)+'dules/np'+'m'),join(_0x4095fe[_0x3f05db(0x33d)+_0x3f05db(0x1ad)+'ir'],_0x3f05db(0x2b3)+'ules')],_0x2142c5=join(_0x4095fe['openclaw'+_0x3f05db(0x1ad)+'ir'],'dist',_0x3f05db(0x1fc)+'ns');if(existsSync(_0x2142c5))for(const _0x547a78 of await readdir(_0x2142c5,{'withFileTypes':!![]})){_0x547a78[_0x3f05db(0x2dd)+'ory']()&&_0x4c466f[_0x3f05db(0x211)](join(_0x2142c5,_0x547a78[_0x3f05db(0x388)],_0x3f05db(0x2b3)+_0x3f05db(0x2ae)));}const _0x4b9556={'files':0x0,'directories':0x0,'bytes':0x0};for(const _0x575064 of _0x4c466f){await pruneRuntimeDependencyTree(_0x575064,_0x4b9556);}await pruneOpenClawDocs(_0x4095fe[_0x3f05db(0x33d)+_0x3f05db(0x1ad)+'ir'],_0x4b9556),_0x18e138?.['info'](_0x3f05db(0x32f)+'untime\x20p'+_0x3f05db(0x39b)+'efore\x20pa'+'ckaging',_0x4b9556);}async function pruneOpenClawDocs(_0x7b879,_0x2e758b){const _0x33427b=_0x4cb8b3,_0x5a853f=join(_0x7b879,_0x33427b(0x192));if(!existsSync(_0x5a853f))return;for(const _0x5ddfbf of await readdir(_0x5a853f,{'withFileTypes':!![]})){if(_0x5ddfbf['name']===_0x33427b(0x333)+'e')continue;await removePrunedPath(join(_0x5a853f,_0x5ddfbf[_0x33427b(0x388)]),_0x2e758b);}}async function pruneRuntimeDependencyTree(_0x5cd447,_0x1b1dde){const _0x149015=_0x4cb8b3;if(!existsSync(_0x5cd447))return;for(const _0xe246a8 of await readdir(_0x5cd447,{'withFileTypes':!![]})){const _0x2aca78=join(_0x5cd447,_0xe246a8[_0x149015(0x388)]);if(_0xe246a8[_0x149015(0x2dd)+_0x149015(0x273)]()){if(shouldPruneRuntimeDirectory(_0x5cd447,_0xe246a8[_0x149015(0x388)])){await removePrunedPath(_0x2aca78,_0x1b1dde);continue;}await pruneRuntimeDependencyTree(_0x2aca78,_0x1b1dde);continue;}_0xe246a8['isFile']()&&shouldPruneRuntimeFile(_0xe246a8[_0x149015(0x388)])&&await removePrunedPath(_0x2aca78,_0x1b1dde);}}function shouldPruneRuntimeDirectory(_0x20052c,_0x4c713a){const _0x4a658a=_0x4cb8b3;if(_0x4c713a==='@types')return!![];if(new Set([_0x4a658a(0x216),_0x4a658a(0x192),_0x4a658a(0x315)])['has'](_0x4c713a))return existsSync(join(_0x20052c,'package.'+'json'));return new Set(['__tests_'+'_',_0x4a658a(0x306),_0x4a658a(0x15a),_0x4a658a(0x39c),_0x4a658a(0x2f6)])['has'](_0x4c713a);}function shouldPruneRuntimeFile(_0x319855){const _0x3122df=_0x4cb8b3;if(_0x319855===_0x3122df(0x187)+_0x3122df(0x19c)+'n'||_0x319855['endsWith'](_0x3122df(0x3fc)))return!![];return new Set([_0x3122df(0x3b1),_0x3122df(0x230),'.markdow'+'n'])['has'](extname(_0x319855)[_0x3122df(0x350)+'ase']());}async function removePrunedPath(_0x3bb0aa,_0x468ec7){const _0x66a3e3=_0x4cb8b3;if(!existsSync(_0x3bb0aa))return;const _0xc75baa=await getPathSize(_0x3bb0aa),_0x1262ae=await stat(_0x3bb0aa);await rm(_0x3bb0aa,{'recursive':!![],'force':!![]}),_0x468ec7[_0x66a3e3(0x3fb)]+=_0xc75baa;if(_0x1262ae[_0x66a3e3(0x2dd)+_0x66a3e3(0x273)]())_0x468ec7[_0x66a3e3(0x21a)+_0x66a3e3(0x238)]+=0x1;else _0x468ec7['files']+=0x1;}async function getPathSize(_0x32b681){const _0x2c78a2=_0x4cb8b3,_0x6cd6b9=await stat(_0x32b681);if(!_0x6cd6b9[_0x2c78a2(0x2dd)+'ory']())return _0x6cd6b9[_0x2c78a2(0x265)];let _0x56c0f9=0x0;for(const _0x58cb3d of await readdir(_0x32b681,{'withFileTypes':!![]})){_0x56c0f9+=await getPathSize(join(_0x32b681,_0x58cb3d[_0x2c78a2(0x388)]));}return _0x56c0f9;}async function syncRuntimeWrapper(_0x1d64af,_0x4fab08,_0x170232){const _0x5910f5=_0x4cb8b3,_0xd05443=_0x1d64af[_0x5910f5(0x33d)]?.['configFi'+_0x5910f5(0x3e3)]??_0x5910f5(0x3d6)+_0x5910f5(0x1a8),_0x5de707=join(_0x4fab08,'bin',_0x5910f5(0x393)+'w'),_0x20157f=join(_0x4fab08,'bin',_0x5910f5(0x393)+_0x5910f5(0x31f)),_0x445c5d=normalizeRuntimeRelativePath(relative(dirname(_0x5de707),resolve(_0x4fab08,_0x170232[_0x5910f5(0x2cd)+_0x5910f5(0x1d7)]))),_0x48019c=normalizeRuntimeRelativePath(relative(dirname(_0x5de707),resolve(_0x4fab08,_0x170232['openclaw'+_0x5910f5(0x15e)]))),_0xdd3f28='$HOME/'+_0x1d64af[_0x5910f5(0x34a)+_0x5910f5(0x38f)],_0x1e0c4e=_0x5910f5(0x36b)+_0x5910f5(0x343)+_0x1d64af[_0x5910f5(0x34a)+'ame'];await mkdir(dirname(_0x5de707),{'recursive':!![]});const _0x3c1dcb=fileURLToPath(new URL(_0x5910f5(0x28a)+_0x5910f5(0x171)+'ie-logo.'+'mjs',import.meta.url)),_0x20f1f5=join(_0x4fab08,'bin',_0x5910f5(0x29f)+_0x5910f5(0x1e4));await cp(_0x3c1dcb,_0x20f1f5),await writeFile(_0x5de707,[_0x5910f5(0x359)+'h',_0x5910f5(0x31c)+_0x5910f5(0x364)+_0x5910f5(0x3f9)+'OPENCLAW'+_0x5910f5(0x164)+_0xdd3f28+'}\x22',_0x5910f5(0x31c)+'PENCLAW_'+_0x5910f5(0x22a)+'R=\x22${OPE'+_0x5910f5(0x1ca)+_0x5910f5(0x2df)+'-'+_0xdd3f28+'}\x22',_0x5910f5(0x31c)+_0x5910f5(0x364)+'CONFIG_F'+'ILE_NAME'+_0x5910f5(0x233)+_0x5910f5(0x1f9)+_0x5910f5(0x2d1)+_0x5910f5(0x235)+_0xd05443+'}\x22',_0x5910f5(0x31c)+_0x5910f5(0x364)+_0x5910f5(0x31a)+_0x5910f5(0x29a)+_0x5910f5(0x364)+_0x5910f5(0x31a)+_0x5910f5(0x2ec)+_0xdd3f28+'/'+_0xd05443+'}\x22',_0x5910f5(0x208)+'IR=$(CDP'+_0x5910f5(0x372)+_0x5910f5(0x2a7)+_0x5910f5(0x3dd)+'\x20\x22$0\x22)\x22\x20'+_0x5910f5(0x326),_0x5910f5(0x169)+'1\x20]\x20&&\x20['+_0x5910f5(0x354)+_0x5910f5(0x26c)+_0x5910f5(0x338)+_0x5910f5(0x194),'\x20\x20\x22$SCRI'+_0x5910f5(0x296)+_0x445c5d+(_0x5910f5(0x2e9)+_0x5910f5(0x1a5)+_0x5910f5(0x165)+'o.mjs\x22\x202'+_0x5910f5(0x3b7)+'ll\x20||\x20tr'+'ue'),'fi',_0x5910f5(0x276)+'CRIPT_DI'+'R/'+_0x445c5d+(_0x5910f5(0x2e9)+'PT_DIR/')+_0x48019c+_0x5910f5(0x20b),''][_0x5910f5(0x186)]('\x0a'),_0x5910f5(0x3a2)),await chmod(_0x5de707,0x1ed),await writeFile(_0x20157f,[_0x5910f5(0x209)+'f','if\x20\x22%OPE'+_0x5910f5(0x394)+_0x5910f5(0x374)+_0x5910f5(0x185)+_0x5910f5(0x305)+'OME='+_0x1e0c4e+'\x22',_0x5910f5(0x28e)+_0x5910f5(0x1ca)+_0x5910f5(0x300)+_0x5910f5(0x299)+'t\x20\x22OPENC'+'LAW_STAT'+_0x5910f5(0x1a4)+_0x1e0c4e+'\x22',_0x5910f5(0x28e)+_0x5910f5(0x3c2)+_0x5910f5(0x367)+_0x5910f5(0x2d3)+_0x5910f5(0x16c)+_0x5910f5(0x1c5)+'AW_CONFI'+'G_FILE_N'+_0x5910f5(0x179)+_0xd05443+'\x22',_0x5910f5(0x28e)+_0x5910f5(0x3c2)+'NFIG_PAT'+'H%\x22==\x22\x22\x20'+_0x5910f5(0x399)+_0x5910f5(0x3c2)+_0x5910f5(0x307)+'H='+_0x1e0c4e+'\x5c'+_0xd05443+'\x22',_0x5910f5(0x1f2)+_0x5910f5(0x34e)+_0x5910f5(0x2b6),_0x5910f5(0x284)+_0x5910f5(0x312)+toWindowsPath(_0x445c5d)+(_0x5910f5(0x33a)+_0x5910f5(0x278))+toWindowsPath(_0x48019c)+_0x5910f5(0x30b),'']['join']('\x0d\x0a'),_0x5910f5(0x3a2)),_0x170232[_0x5910f5(0x393)+_0x5910f5(0x3b6)]=toRuntimeRelative(_0x4fab08,process[_0x5910f5(0x313)]===_0x5910f5(0x242)?_0x20157f:_0x5de707);}async function patchChatHistoryMixedToolContentBug(_0x1b1c5e,_0x1d5d8a,_0x95a60a={}){const _0x395afb=_0x4cb8b3,_0xde3f8=resolve(_0x1b1c5e,_0x1d5d8a[_0x395afb(0x33d)+_0x395afb(0x1ad)+'ir']),_0x208633=join(_0xde3f8,_0x395afb(0x384));let _0x3c6645=[];try{_0x3c6645=await readdir(_0x208633,{'withFileTypes':!![]});}catch{_0x95a60a['runtimeL'+'ogger']?.[_0x395afb(0x3e1)]?.(_0x395afb(0x3ed)+_0x395afb(0x3b2)+'ed-tool\x20'+_0x395afb(0x2d9)+_0x395afb(0x1ff)+'ist\x20not\x20'+_0x395afb(0x3d3),{'distDir':_0x208633,'openclawVersion':_0x1d5d8a['openclaw'+'Version']});return;}const _0xe6265=_0x3c6645[_0x395afb(0x249)](_0x26df20=>_0x26df20[_0x395afb(0x218)]()&&(_0x26df20[_0x395afb(0x388)][_0x395afb(0x2e0)+'th'](_0x395afb(0x356)+_0x395afb(0x1d5)+'jection-')||_0x26df20['name'][_0x395afb(0x2e0)+'th'](_0x395afb(0x392)+_0x395afb(0x23e)+'pt-path-'))&&_0x26df20['name'][_0x395afb(0x334)](_0x395afb(0x297)))[_0x395afb(0x3d4)](_0x5c330f=>join(_0x208633,_0x5c330f[_0x395afb(0x388)]));if(_0xe6265[_0x395afb(0x23b)]===0x0){_0x95a60a[_0x395afb(0x2de)+'ogger']?.[_0x395afb(0x3e1)]?.(_0x395afb(0x3ed)+_0x395afb(0x3b2)+_0x395afb(0x25c)+_0x395afb(0x2d9)+_0x395afb(0x35d)+_0x395afb(0x2f1)+_0x395afb(0x3d3),{'openclawVersion':_0x1d5d8a[_0x395afb(0x33d)+'Version']});return;}for(const _0x117508 of _0xe6265){const _0x51e929=await readFile(_0x117508,_0x395afb(0x3a2)),_0x4cd95b=patchMixedToolContentFromSource(_0x51e929);if(!_0x4cd95b['patched']){if(_0x4cd95b[_0x395afb(0x3cf)]===_0x395afb(0x34d)+'patched'){_0x95a60a[_0x395afb(0x2de)+_0x395afb(0x304)]?.[_0x395afb(0x189)]?.(_0x395afb(0x3ed)+_0x395afb(0x3b2)+_0x395afb(0x25c)+_0x395afb(0x1b7)+_0x395afb(0x403)+_0x395afb(0x369),{'openclawVersion':_0x1d5d8a[_0x395afb(0x33d)+_0x395afb(0x2ee)],'filePath':_0x117508});return;}continue;}await writeFile(_0x117508,_0x4cd95b['source'],_0x395afb(0x3a2)),_0x95a60a[_0x395afb(0x2de)+_0x395afb(0x304)]?.['info']?.(_0x395afb(0x3ed)+'tory\x20mix'+_0x395afb(0x25c)+_0x395afb(0x3e8)+_0x395afb(0x369),{'openclawVersion':_0x1d5d8a['openclaw'+_0x395afb(0x2ee)],'filePath':_0x117508,'note':_0x395afb(0x271)+_0x395afb(0x220)+'ibility\x20'+_0x395afb(0x1da)+_0x395afb(0x303)+_0x395afb(0x336)+'6\x20mixed\x20'+_0x395afb(0x1c4)+_0x395afb(0x30e)+_0x395afb(0x161)+_0x395afb(0x16b)+_0x395afb(0x292)+_0x395afb(0x282)+_0x395afb(0x253)+'re\x20upgra'+'des.'});return;}_0x95a60a[_0x395afb(0x2de)+_0x395afb(0x304)]?.['warn']?.(_0x395afb(0x3ed)+_0x395afb(0x3b2)+_0x395afb(0x25c)+_0x395afb(0x2d9)+_0x395afb(0x35d)+_0x395afb(0x18b)+_0x395afb(0x1cb)+'d',{'openclawVersion':_0x1d5d8a['openclaw'+_0x395afb(0x2ee)]});}async function patchChatAttachmentBase64Runtime(_0x2285e6,_0x52e07f,_0x58672={}){const _0x3e5953=_0x4cb8b3,_0x2c8107=resolve(_0x2285e6,_0x52e07f[_0x3e5953(0x33d)+_0x3e5953(0x1ad)+'ir']),_0x18b600=join(_0x2c8107,_0x3e5953(0x384));let _0x5655d8=[];try{_0x5655d8=await readdir(_0x18b600,{'withFileTypes':!![]});}catch{_0x58672[_0x3e5953(0x2de)+_0x3e5953(0x304)]?.['warn']?.(_0x3e5953(0x283)+_0x3e5953(0x2f9)+_0x3e5953(0x3b3)+'atch\x20ski'+'pped;\x20di'+'st\x20not\x20f'+_0x3e5953(0x29c),{'distDir':_0x18b600,'openclawVersion':_0x52e07f[_0x3e5953(0x33d)+_0x3e5953(0x2ee)]});return;}const _0xa50cf8=_0x5655d8[_0x3e5953(0x249)](_0x46f92a=>_0x46f92a['isFile']()&&_0x46f92a[_0x3e5953(0x388)]['startsWi'+'th'](_0x3e5953(0x35b)+_0x3e5953(0x170)+_0x3e5953(0x197))&&_0x46f92a[_0x3e5953(0x388)]['endsWith'](_0x3e5953(0x297)))[_0x3e5953(0x3d4)](_0x4e03b2=>join(_0x18b600,_0x4e03b2[_0x3e5953(0x388)]));if(_0xa50cf8[_0x3e5953(0x23b)]===0x0){_0x58672[_0x3e5953(0x2de)+_0x3e5953(0x304)]?.[_0x3e5953(0x3e1)]?.(_0x3e5953(0x283)+_0x3e5953(0x2f9)+'base64\x20p'+_0x3e5953(0x2c3)+_0x3e5953(0x377)+'le\x20not\x20f'+'ound',{'openclawVersion':_0x52e07f[_0x3e5953(0x33d)+_0x3e5953(0x2ee)]});return;}for(const _0x56dcef of _0xa50cf8){const _0x2d91ed=await readFile(_0x56dcef,_0x3e5953(0x3a2)),_0x1a5c50=patchChatAttachmentBase64FromSource(_0x2d91ed);if(!_0x1a5c50[_0x3e5953(0x3b8)]){if(_0x1a5c50[_0x3e5953(0x3cf)]===_0x3e5953(0x34d)+_0x3e5953(0x3b8)){_0x58672[_0x3e5953(0x2de)+_0x3e5953(0x304)]?.[_0x3e5953(0x189)]?.(_0x3e5953(0x283)+_0x3e5953(0x2f9)+_0x3e5953(0x3b3)+_0x3e5953(0x3d7)+_0x3e5953(0x365)+_0x3e5953(0x1fe),{'openclawVersion':_0x52e07f[_0x3e5953(0x33d)+_0x3e5953(0x2ee)],'filePath':_0x56dcef});return;}continue;}await writeFile(_0x56dcef,_0x1a5c50['source'],_0x3e5953(0x3a2)),_0x58672[_0x3e5953(0x2de)+'ogger']?.[_0x3e5953(0x189)]?.(_0x3e5953(0x283)+_0x3e5953(0x2f9)+'base64\x20p'+_0x3e5953(0x259)+'lied',{'openclawVersion':_0x52e07f[_0x3e5953(0x33d)+_0x3e5953(0x2ee)],'filePath':_0x56dcef,'note':_0x3e5953(0x271)+'y\x20compat'+_0x3e5953(0x2c5)+_0x3e5953(0x1da)+_0x3e5953(0x303)+_0x3e5953(0x336)+_0x3e5953(0x1df)+'end\x20atta'+_0x3e5953(0x322)+_0x3e5953(0x1c0)+_0x3e5953(0x293)+_0x3e5953(0x2aa)+_0x3e5953(0x1e5)+_0x3e5953(0x27a)+_0x3e5953(0x316)+_0x3e5953(0x331)+_0x3e5953(0x1c7)});return;}_0x58672['runtimeL'+_0x3e5953(0x304)]?.[_0x3e5953(0x3e1)]?.('chat\x20att'+_0x3e5953(0x2f9)+_0x3e5953(0x3b3)+_0x3e5953(0x2c3)+'pped;\x20fu'+'nction\x20n'+_0x3e5953(0x2af),{'openclawVersion':_0x52e07f[_0x3e5953(0x33d)+_0x3e5953(0x2ee)]});}async function patchProviderRequestIdHeader(_0x43a3b0,_0x2a867a,_0xe197b9={}){const _0x30c3f4=_0x4cb8b3,_0x33c9c9=resolve(_0x43a3b0,_0x2a867a['openclaw'+_0x30c3f4(0x1ad)+'ir']),_0x598fcb=join(_0x33c9c9,_0x30c3f4(0x384));let _0x46c3fc=[];try{_0x46c3fc=await readdir(_0x598fcb,{'withFileTypes':!![]});}catch{_0xe197b9[_0x30c3f4(0x2de)+_0x30c3f4(0x304)]?.[_0x30c3f4(0x3e1)]?.(_0x30c3f4(0x3d5)+_0x30c3f4(0x1d6)+_0x30c3f4(0x1a9)+'er\x20patch'+_0x30c3f4(0x25b)+_0x30c3f4(0x19e)+_0x30c3f4(0x2af),{'distDir':_0x598fcb,'openclawVersion':_0x2a867a['openclaw'+_0x30c3f4(0x2ee)]});return;}const _0x33c576=_0x46c3fc[_0x30c3f4(0x249)](_0x574538=>_0x574538[_0x30c3f4(0x218)]()&&_0x574538[_0x30c3f4(0x388)][_0x30c3f4(0x334)]('.js'))[_0x30c3f4(0x3d4)](_0x59ad9c=>join(_0x598fcb,_0x59ad9c['name']));let _0x51e18e=0x0,_0x1c5dac=0x0;for(const _0x4298ab of _0x33c576){const _0x458c7d=await readFile(_0x4298ab,_0x30c3f4(0x3a2)),_0x3d5eda=patchProviderRequestIdHeaderFromSource(_0x458c7d);if(_0x3d5eda[_0x30c3f4(0x3b8)]){await writeFile(_0x4298ab,_0x3d5eda['source'],_0x30c3f4(0x3a2)),_0x51e18e+=0x1,_0xe197b9[_0x30c3f4(0x2de)+'ogger']?.['info']?.(_0x30c3f4(0x3d5)+_0x30c3f4(0x1d6)+_0x30c3f4(0x1a9)+_0x30c3f4(0x1e9)+'\x20applied',{'openclawVersion':_0x2a867a[_0x30c3f4(0x33d)+_0x30c3f4(0x2ee)],'filePath':_0x4298ab});continue;}if(_0x3d5eda[_0x30c3f4(0x3cf)]===_0x30c3f4(0x34d)+'patched')_0x1c5dac+=0x1;}if(_0x51e18e>0x0){_0xe197b9[_0x30c3f4(0x2de)+_0x30c3f4(0x304)]?.[_0x30c3f4(0x189)]?.(_0x30c3f4(0x3d5)+_0x30c3f4(0x1d6)+_0x30c3f4(0x1a9)+_0x30c3f4(0x1e9)+_0x30c3f4(0x37b),{'openclawVersion':_0x2a867a[_0x30c3f4(0x33d)+_0x30c3f4(0x2ee)],'patchedCount':_0x51e18e,'alreadyPatchedCount':_0x1c5dac});return;}if(_0x1c5dac>0x0){_0xe197b9[_0x30c3f4(0x2de)+_0x30c3f4(0x304)]?.[_0x30c3f4(0x189)]?.(_0x30c3f4(0x3d5)+_0x30c3f4(0x1d6)+_0x30c3f4(0x1a9)+_0x30c3f4(0x1e9)+_0x30c3f4(0x2dc)+_0x30c3f4(0x2a9),{'openclawVersion':_0x2a867a[_0x30c3f4(0x33d)+_0x30c3f4(0x2ee)],'alreadyPatchedCount':_0x1c5dac});return;}_0xe197b9[_0x30c3f4(0x2de)+_0x30c3f4(0x304)]?.[_0x30c3f4(0x3e1)]?.(_0x30c3f4(0x3d5)+_0x30c3f4(0x1d6)+'-id\x20head'+_0x30c3f4(0x1e9)+'\x20skipped'+';\x20provid'+_0x30c3f4(0x31b)+_0x30c3f4(0x240)+'\x20not\x20fou'+'nd',{'openclawVersion':_0x2a867a[_0x30c3f4(0x33d)+_0x30c3f4(0x2ee)]});}async function patchChannelPluginRuntimeBug(_0x1def14,_0x5e6ff3,_0x1725b1={}){const _0x34f80f=_0x4cb8b3,_0x5e6091=resolve(_0x1def14,_0x5e6ff3[_0x34f80f(0x33d)+_0x34f80f(0x1ad)+'ir']),_0x345e0c=join(_0x5e6091,'dist');let _0xa8649=[];try{_0xa8649=await readdir(_0x345e0c,{'withFileTypes':!![]});}catch{_0x1725b1[_0x34f80f(0x2de)+_0x34f80f(0x304)]?.[_0x34f80f(0x3e1)]?.(_0x34f80f(0x2a1)+_0x34f80f(0x2e5)+_0x34f80f(0x3d1)+_0x34f80f(0x2c3)+_0x34f80f(0x180)+_0x34f80f(0x213)+'ound',{'distDir':_0x345e0c,'openclawVersion':_0x5e6ff3[_0x34f80f(0x33d)+'Version']});return;}const _0x50f3f2=_0xa8649[_0x34f80f(0x249)](_0x3e8c0f=>_0x3e8c0f['isFile']()&&_0x3e8c0f[_0x34f80f(0x388)]['startsWi'+'th'](_0x34f80f(0x1fb))&&_0x3e8c0f[_0x34f80f(0x388)][_0x34f80f(0x334)]('.js'))[_0x34f80f(0x3d4)](_0x379b42=>join(_0x345e0c,_0x379b42[_0x34f80f(0x388)])),_0x476119=await resolveRuntimeChannelImportPath(_0x345e0c,_0xa8649);if(_0x50f3f2[_0x34f80f(0x23b)]===0x0){_0x1725b1['runtimeL'+_0x34f80f(0x304)]?.[_0x34f80f(0x3e1)]?.(_0x34f80f(0x2a1)+'plugin\x20r'+_0x34f80f(0x3d1)+_0x34f80f(0x2c3)+_0x34f80f(0x2cb)+_0x34f80f(0x31d)+_0x34f80f(0x39e),{'openclawVersion':_0x5e6ff3[_0x34f80f(0x33d)+_0x34f80f(0x2ee)]});return;}if(!_0x476119){_0x1725b1['runtimeL'+'ogger']?.[_0x34f80f(0x3e1)]?.(_0x34f80f(0x2a1)+_0x34f80f(0x2e5)+_0x34f80f(0x3d1)+'atch\x20ski'+_0x34f80f(0x318)+_0x34f80f(0x344)+'annel\x20en'+_0x34f80f(0x2a5)+_0x34f80f(0x3d3),{'openclawVersion':_0x5e6ff3['openclaw'+'Version'],'distDir':_0x345e0c});return;}for(const _0xeb5e03 of _0x50f3f2){const _0xe3e834=await readFile(_0xeb5e03,_0x34f80f(0x3a2)),_0x4f29f9=patchChannelPluginRuntimeFromSource(_0xe3e834,{'runtimeChannelImportPath':_0x476119});if(!_0x4f29f9[_0x34f80f(0x3b8)]){if(_0x4f29f9[_0x34f80f(0x3cf)]==='already-'+_0x34f80f(0x3b8)){_0x1725b1[_0x34f80f(0x2de)+_0x34f80f(0x304)]?.[_0x34f80f(0x189)]?.('channel\x20'+_0x34f80f(0x2e5)+'untime\x20p'+_0x34f80f(0x3d7)+_0x34f80f(0x365)+_0x34f80f(0x1fe),{'openclawVersion':_0x5e6ff3[_0x34f80f(0x33d)+_0x34f80f(0x2ee)],'filePath':_0xeb5e03});return;}continue;}await writeFile(_0xeb5e03,_0x4f29f9['source'],_0x34f80f(0x3a2)),_0x1725b1[_0x34f80f(0x2de)+_0x34f80f(0x304)]?.['info']?.(_0x34f80f(0x2a1)+_0x34f80f(0x2e5)+'untime\x20p'+'atch\x20app'+_0x34f80f(0x1fe),{'openclawVersion':_0x5e6ff3['openclaw'+_0x34f80f(0x2ee)],'filePath':_0xeb5e03,'note':_0x34f80f(0x271)+_0x34f80f(0x220)+_0x34f80f(0x2c5)+_0x34f80f(0x1da)+_0x34f80f(0x303)+_0x34f80f(0x336)+'6.6\x20chan'+'nel\x20plug'+_0x34f80f(0x2a8)+_0x34f80f(0x2ca)+_0x34f80f(0x191)+'el.inbou'+_0x34f80f(0x3c5)+_0x34f80f(0x329)+_0x34f80f(0x2d4)+_0x34f80f(0x21b)+_0x34f80f(0x36c)+_0x34f80f(0x3e7)+_0x34f80f(0x3a3)});return;}_0x1725b1[_0x34f80f(0x2de)+_0x34f80f(0x304)]?.['warn']?.(_0x34f80f(0x2a1)+_0x34f80f(0x2e5)+_0x34f80f(0x3d1)+_0x34f80f(0x2c3)+'pped;\x20ru'+_0x34f80f(0x2a0)+_0x34f80f(0x1f1)+_0x34f80f(0x2af),{'openclawVersion':_0x5e6ff3[_0x34f80f(0x33d)+_0x34f80f(0x2ee)]});}async function patchSessionStoreSqliteRuntime(_0x3e7108,_0x1f854b,_0x5d85ac={}){const _0x1b75df=_0x4cb8b3,_0x232196=resolve(_0x3e7108,_0x1f854b[_0x1b75df(0x33d)+_0x1b75df(0x1ad)+'ir']),_0x158163=join(_0x232196,_0x1b75df(0x384)),_0xdbbaff=_0x1b75df(0x36a)+_0x1b75df(0x348)+_0x1b75df(0x379)+_0x1b75df(0x252)+_0x1b75df(0x337)+'dge.mjs',_0x5e3c86=join(_0x3e7108,_0x1b75df(0x32e)+_0x1b75df(0x1dc),_0x1b75df(0x1f0),_0x1b75df(0x3ee)+_0x1b75df(0x30c)+'js'),_0x1143f2=(await readdir(_0x158163,{'withFileTypes':!![]})[_0x1b75df(0x258)](()=>[]))['filter'](_0x3a6771=>_0x3a6771[_0x1b75df(0x218)]()&&_0x3a6771[_0x1b75df(0x388)][_0x1b75df(0x2e0)+'th'](_0x1b75df(0x20a)+'ad-')&&_0x3a6771[_0x1b75df(0x388)]['endsWith'](_0x1b75df(0x297)))[_0x1b75df(0x3d4)](_0x554c18=>join(_0x158163,_0x554c18[_0x1b75df(0x388)])),_0x56ecb4=(await readdir(_0x158163,{'withFileTypes':!![]})[_0x1b75df(0x258)](()=>[]))[_0x1b75df(0x249)](_0x2ac9f1=>_0x2ac9f1[_0x1b75df(0x218)]()&&_0x2ac9f1['name'][_0x1b75df(0x2e0)+'th'](_0x1b75df(0x2ce))&&!_0x2ac9f1[_0x1b75df(0x388)][_0x1b75df(0x2e0)+'th']('store-lo'+'ad-')&&_0x2ac9f1['name'][_0x1b75df(0x334)](_0x1b75df(0x297)))[_0x1b75df(0x3d4)](_0x5009d0=>join(_0x158163,_0x5009d0[_0x1b75df(0x388)]));if(!existsSync(_0x5e3c86)){_0x5d85ac['runtimeL'+'ogger']?.['info']?.(_0x1b75df(0x2ad)+_0x1b75df(0x214)+_0x1b75df(0x172)+_0x1b75df(0x1bd)+_0x1b75df(0x3d0)+'ge\x20not\x20a'+_0x1b75df(0x26e),{'bridgePath':_0x5e3c86,'openclawVersion':_0x1f854b[_0x1b75df(0x33d)+_0x1b75df(0x2ee)]});return;}for(const _0xca253e of _0x1143f2){const _0x59082c=await readFile(_0xca253e,'utf8'),_0x1c41a0=patchSessionStoreLoadFromSource(_0x59082c,{'bridgeImportPath':_0xdbbaff});if(!_0x1c41a0[_0x1b75df(0x3b8)]){if(_0x1c41a0[_0x1b75df(0x3cf)]==='already-'+'patched'){_0x5d85ac['runtimeL'+_0x1b75df(0x304)]?.[_0x1b75df(0x189)]?.(_0x1b75df(0x2ad)+_0x1b75df(0x1a7)+_0x1b75df(0x3c7)+_0x1b75df(0x2dc)+'\x20applied',{'filePath':_0xca253e,'openclawVersion':_0x1f854b['openclaw'+_0x1b75df(0x2ee)]});break;}continue;}await writeFile(_0xca253e,_0x1c41a0[_0x1b75df(0x267)],_0x1b75df(0x3a2)),_0x5d85ac[_0x1b75df(0x2de)+_0x1b75df(0x304)]?.[_0x1b75df(0x189)]?.('session\x20'+_0x1b75df(0x1a7)+'ad\x20patch'+'\x20applied',{'filePath':_0xca253e,'openclawVersion':_0x1f854b[_0x1b75df(0x33d)+_0x1b75df(0x2ee)]});break;}for(const _0x2e39f9 of _0x56ecb4){const _0x4a9959=await readFile(_0x2e39f9,_0x1b75df(0x3a2)),_0x4b1c3f=patchSessionStoreWriteFromSource(_0x4a9959,{'bridgeImportPath':_0xdbbaff});if(!_0x4b1c3f[_0x1b75df(0x3b8)]){if(_0x4b1c3f[_0x1b75df(0x3cf)]===_0x1b75df(0x34d)+'patched'){_0x5d85ac[_0x1b75df(0x2de)+'ogger']?.[_0x1b75df(0x189)]?.('session\x20'+_0x1b75df(0x2bc)+_0x1b75df(0x231)+_0x1b75df(0x24d)+_0x1b75df(0x25d)+'d',{'filePath':_0x2e39f9,'openclawVersion':_0x1f854b[_0x1b75df(0x33d)+_0x1b75df(0x2ee)]});break;}continue;}await writeFile(_0x2e39f9,_0x4b1c3f[_0x1b75df(0x267)],'utf8'),_0x5d85ac[_0x1b75df(0x2de)+_0x1b75df(0x304)]?.[_0x1b75df(0x189)]?.(_0x1b75df(0x2ad)+'store\x20wr'+_0x1b75df(0x231)+_0x1b75df(0x289)+'d',{'filePath':_0x2e39f9,'openclawVersion':_0x1f854b[_0x1b75df(0x33d)+_0x1b75df(0x2ee)]});break;}}async function patchWeixinOutboundSessionRoute(_0x357ace,_0x4367e9,_0x221ed2={}){const _0x50d08f=_0x4cb8b3,_0x93aad7=join(_0x357ace,_0x50d08f(0x33d),'dist','extensio'+'ns',_0x50d08f(0x33d)+'-weixin',_0x50d08f(0x384),_0x50d08f(0x212),_0x50d08f(0x3ce)+'js');if(!existsSync(_0x93aad7)){_0x221ed2['runtimeL'+_0x50d08f(0x304)]?.[_0x50d08f(0x189)]?.('weixin\x20o'+_0x50d08f(0x34f)+'session\x20'+'route\x20pa'+'tch\x20skip'+'ped;\x20plu'+_0x50d08f(0x3f0)+_0x50d08f(0x3ae)+'d',{'openclawVersion':_0x4367e9[_0x50d08f(0x33d)+_0x50d08f(0x2ee)],'filePath':_0x93aad7});return;}const _0x3fc45b=await readFile(_0x93aad7,'utf8'),_0x20a943=patchWeixinOutboundSessionRouteFromSource(_0x3fc45b);if(!_0x20a943[_0x50d08f(0x3b8)]){if(_0x20a943[_0x50d08f(0x3cf)]===_0x50d08f(0x34d)+'patched'){_0x221ed2[_0x50d08f(0x2de)+_0x50d08f(0x304)]?.['info']?.(_0x50d08f(0x3f5)+_0x50d08f(0x34f)+_0x50d08f(0x2ad)+_0x50d08f(0x22d)+_0x50d08f(0x2db)+_0x50d08f(0x2ff)+_0x50d08f(0x268),{'openclawVersion':_0x4367e9[_0x50d08f(0x33d)+'Version'],'filePath':_0x93aad7});return;}_0x221ed2['runtimeL'+_0x50d08f(0x304)]?.[_0x50d08f(0x3e1)]?.(_0x50d08f(0x3f5)+_0x50d08f(0x34f)+_0x50d08f(0x2ad)+'route\x20pa'+_0x50d08f(0x280)+_0x50d08f(0x20d)+_0x50d08f(0x204)+_0x50d08f(0x3a9)+'ound',{'openclawVersion':_0x4367e9['openclaw'+_0x50d08f(0x2ee)],'filePath':_0x93aad7,'reason':_0x20a943['reason']});return;}await writeFile(_0x93aad7,_0x20a943[_0x50d08f(0x267)],_0x50d08f(0x3a2)),_0x221ed2['runtimeL'+_0x50d08f(0x304)]?.['info']?.(_0x50d08f(0x3f5)+'utbound\x20'+_0x50d08f(0x2ad)+_0x50d08f(0x22d)+_0x50d08f(0x360)+_0x50d08f(0x268),{'openclawVersion':_0x4367e9['openclaw'+_0x50d08f(0x2ee)],'filePath':_0x93aad7,'note':_0x50d08f(0x271)+'y\x20compat'+'ibility\x20'+'patch\x20fo'+'r\x20@tence'+_0x50d08f(0x1aa)+_0x50d08f(0x193)+_0x50d08f(0x38e)+_0x50d08f(0x288)+_0x50d08f(0x30f)+_0x50d08f(0x29d)+_0x50d08f(0x291)+'g\x20indexe'+_0x50d08f(0x2b0)+_0x50d08f(0x314)+_0x50d08f(0x2a6)+'ify\x20upst'+_0x50d08f(0x282)+_0x50d08f(0x253)+_0x50d08f(0x237)+_0x50d08f(0x27d)});}async function patchWeixinOutboundFallbackRuntime(_0x434e16,_0x7621c2,_0x2f33c8={}){const _0x163b63=_0x4cb8b3,_0x3dcb5c=resolve(_0x434e16,_0x7621c2['openclaw'+'WorkingD'+'ir']),_0x60abc3=join(_0x3dcb5c,_0x163b63(0x384)),_0xd086d8=(await readdir(_0x60abc3,{'withFileTypes':!![]})[_0x163b63(0x258)](()=>[]))['filter'](_0x23c2bb=>_0x23c2bb['isFile']()&&_0x23c2bb['name'][_0x163b63(0x2e0)+'th']('outbound'+_0x163b63(0x383)+'-')&&_0x23c2bb[_0x163b63(0x388)]['endsWith'](_0x163b63(0x297)))[_0x163b63(0x3d4)](_0x5622c3=>join(_0x60abc3,_0x5622c3[_0x163b63(0x388)]));if(_0xd086d8[_0x163b63(0x23b)]===0x0){_0x2f33c8['runtimeL'+'ogger']?.[_0x163b63(0x3e1)]?.(_0x163b63(0x3f5)+_0x163b63(0x34f)+'fallback'+_0x163b63(0x27e)+_0x163b63(0x20e)+_0x163b63(0x24f)+_0x163b63(0x260)+_0x163b63(0x21c)+'nd',{'openclawVersion':_0x7621c2[_0x163b63(0x33d)+'Version'],'distDir':_0x60abc3});return;}for(const _0x22bc85 of _0xd086d8){const _0x57f008=await readFile(_0x22bc85,_0x163b63(0x3a2)),_0x321093=patchWeixinOutboundFallbackFromSource(_0x57f008);if(!_0x321093[_0x163b63(0x3b8)]){if(_0x321093[_0x163b63(0x3cf)]===_0x163b63(0x34d)+_0x163b63(0x3b8)){_0x2f33c8[_0x163b63(0x2de)+_0x163b63(0x304)]?.['info']?.(_0x163b63(0x3f5)+_0x163b63(0x34f)+'fallback'+'\x20patch\x20a'+_0x163b63(0x1e2)+_0x163b63(0x309),{'openclawVersion':_0x7621c2['openclaw'+'Version'],'filePath':_0x22bc85});return;}continue;}await writeFile(_0x22bc85,_0x321093[_0x163b63(0x267)],_0x163b63(0x3a2)),_0x2f33c8[_0x163b63(0x2de)+'ogger']?.['info']?.(_0x163b63(0x3f5)+'utbound\x20'+_0x163b63(0x2eb)+_0x163b63(0x373)+'pplied',{'openclawVersion':_0x7621c2[_0x163b63(0x33d)+_0x163b63(0x2ee)],'filePath':_0x22bc85,'note':_0x163b63(0x271)+'y\x20compat'+_0x163b63(0x2c5)+'patch\x20fo'+_0x163b63(0x236)+_0x163b63(0x3f4)+_0x163b63(0x160)+_0x163b63(0x1e7)+_0x163b63(0x3c4)+'d\x20mirror'+_0x163b63(0x199)+_0x163b63(0x3ff)+'ions\x20whe'+_0x163b63(0x3b5)+_0x163b63(0x1ea)+_0x163b63(0x290)+_0x163b63(0x2fc)});return;}_0x2f33c8[_0x163b63(0x2de)+_0x163b63(0x304)]?.['warn']?.('weixin\x20o'+_0x163b63(0x34f)+_0x163b63(0x2eb)+'\x20patch\x20s'+_0x163b63(0x20e)+_0x163b63(0x321)+_0x163b63(0x404)+_0x163b63(0x2af),{'openclawVersion':_0x7621c2[_0x163b63(0x33d)+'Version']});}async function patchRequestIdTitleRuntime(_0x28aef2,_0x72217e,_0x5d6c7f={}){const _0x436056=_0x4cb8b3,_0x216cff=resolve(_0x28aef2,_0x72217e[_0x436056(0x33d)+'WorkingD'+'ir']),_0x3e47a0=join(_0x216cff,_0x436056(0x384)),_0xa745c4=_0x436056(0x36a)+_0x436056(0x348)+_0x436056(0x1af)+_0x436056(0x281)+_0x436056(0x30a)+_0x436056(0x390)+'s',_0x152870=join(_0x28aef2,'shell-ru'+_0x436056(0x1dc),_0x436056(0x3f3)+'id','runtime-'+_0x436056(0x30c)+'js');if(!existsSync(_0x152870)){_0x5d6c7f[_0x436056(0x2de)+_0x436056(0x304)]?.[_0x436056(0x189)]?.('request-'+_0x436056(0x1c8)+'\x20runtime'+'\x20patch\x20s'+_0x436056(0x20e)+_0x436056(0x1ab)+_0x436056(0x39f)+'able',{'bridgePath':_0x152870,'openclawVersion':_0x72217e['openclaw'+'Version']});return;}const _0x858ee4=(await readdir(_0x3e47a0,{'withFileTypes':!![]})[_0x436056(0x258)](()=>[]))[_0x436056(0x249)](_0x5a835f=>_0x5a835f[_0x436056(0x218)]()&&_0x5a835f[_0x436056(0x388)][_0x436056(0x2e0)+'th']('loader-')&&_0x5a835f['name'][_0x436056(0x334)](_0x436056(0x297)))[_0x436056(0x3d4)](_0x479678=>join(_0x3e47a0,_0x479678[_0x436056(0x388)]));for(const _0x55c78e of _0x858ee4){const _0x380b47=await readFile(_0x55c78e,_0x436056(0x3a2)),_0x233bf5=patchRequestIdTitleRuntimeFromSource(_0x380b47,{'bridgeImportPath':_0xa745c4});if(!_0x233bf5[_0x436056(0x3b8)]){if(_0x233bf5[_0x436056(0x3cf)]===_0x436056(0x34d)+_0x436056(0x3b8)){_0x5d6c7f[_0x436056(0x2de)+_0x436056(0x304)]?.[_0x436056(0x189)]?.(_0x436056(0x3f3)+'id\x20title'+_0x436056(0x260)+_0x436056(0x373)+_0x436056(0x1e2)+_0x436056(0x309),{'filePath':_0x55c78e,'openclawVersion':_0x72217e[_0x436056(0x33d)+'Version']});break;}continue;}await writeFile(_0x55c78e,_0x233bf5['source'],'utf8'),_0x5d6c7f['runtimeL'+'ogger']?.['info']?.(_0x436056(0x3f3)+_0x436056(0x1c8)+_0x436056(0x260)+_0x436056(0x373)+_0x436056(0x309),{'filePath':_0x55c78e,'openclawVersion':_0x72217e[_0x436056(0x33d)+_0x436056(0x2ee)]});break;}}async function patchQQBotOutboundFallbackRuntime(_0x2fa67c,_0x5a14e6,_0x4cd616={}){const _0xd74049=_0x4cb8b3,_0xfbd43c=resolve(_0x2fa67c,_0x5a14e6[_0xd74049(0x33d)+_0xd74049(0x1ad)+'ir']),_0x4b9e6a=join(_0xfbd43c,_0xd74049(0x384)),_0x36223d=(await readdir(_0x4b9e6a,{'withFileTypes':!![]})[_0xd74049(0x258)](()=>[]))[_0xd74049(0x249)](_0x739cac=>_0x739cac['isFile']()&&_0x739cac[_0xd74049(0x388)]['startsWi'+'th']('outbound'+'-session'+'-')&&_0x739cac[_0xd74049(0x388)][_0xd74049(0x334)]('.js'))['map'](_0x5ac56e=>join(_0x4b9e6a,_0x5ac56e[_0xd74049(0x388)]));if(_0x36223d[_0xd74049(0x23b)]===0x0){_0x4cd616[_0xd74049(0x2de)+_0xd74049(0x304)]?.['warn']?.(_0xd74049(0x3fd)+'tbound\x20f'+_0xd74049(0x2cf)+'patch\x20sk'+_0xd74049(0x3da)+_0xd74049(0x34f)+_0xd74049(0x3e2)+_0xd74049(0x1cb)+'d',{'openclawVersion':_0x5a14e6[_0xd74049(0x33d)+_0xd74049(0x2ee)],'distDir':_0x4b9e6a});return;}for(const _0x800b8 of _0x36223d){const _0x34ff33=await readFile(_0x800b8,_0xd74049(0x3a2)),_0x4a2686=patchQQBotOutboundFallbackFromSource(_0x34ff33);if(!_0x4a2686[_0xd74049(0x3b8)]){if(_0x4a2686[_0xd74049(0x3cf)]===_0xd74049(0x34d)+_0xd74049(0x3b8)){_0x4cd616['runtimeL'+_0xd74049(0x304)]?.[_0xd74049(0x189)]?.('qqbot\x20ou'+'tbound\x20f'+'allback\x20'+_0xd74049(0x1b7)+_0xd74049(0x403)+_0xd74049(0x369),{'openclawVersion':_0x5a14e6[_0xd74049(0x33d)+_0xd74049(0x2ee)],'filePath':_0x800b8});return;}continue;}await writeFile(_0x800b8,_0x4a2686[_0xd74049(0x267)],_0xd74049(0x3a2)),_0x4cd616[_0xd74049(0x2de)+_0xd74049(0x304)]?.['info']?.(_0xd74049(0x3fd)+_0xd74049(0x1f8)+_0xd74049(0x2cf)+_0xd74049(0x3e8)+_0xd74049(0x369),{'openclawVersion':_0x5a14e6[_0xd74049(0x33d)+'Version'],'filePath':_0x800b8,'note':_0xd74049(0x271)+_0xd74049(0x220)+_0xd74049(0x2c5)+'patch\x20fo'+'rcing\x20QQ'+_0xd74049(0x243)+'outbound'+_0xd74049(0x409)+_0xd74049(0x3e4)+_0xd74049(0x188)+_0xd74049(0x376)+_0xd74049(0x15f)+_0xd74049(0x269)+'n\x20the\x20pe'+_0xd74049(0x182)});return;}_0x4cd616[_0xd74049(0x2de)+_0xd74049(0x304)]?.[_0xd74049(0x3e1)]?.('qqbot\x20ou'+_0xd74049(0x1f8)+_0xd74049(0x2cf)+'patch\x20sk'+_0xd74049(0x3e6)+_0xd74049(0x358)+_0xd74049(0x1b4)+_0xd74049(0x2a3),{'openclawVersion':_0x5a14e6[_0xd74049(0x33d)+_0xd74049(0x2ee)]});}async function patchQQBotOutboundSessionRoute(_0x9b42c2,_0x46271c,_0x5b9a76={}){const _0x34fb35=_0x4cb8b3,_0x30003b=join(_0x9b42c2,'openclaw',_0x34fb35(0x384),'extensio'+'ns',_0x34fb35(0x18d),_0x34fb35(0x384));if(!existsSync(_0x30003b)){_0x5b9a76[_0x34fb35(0x2de)+_0x34fb35(0x304)]?.[_0x34fb35(0x189)]?.(_0x34fb35(0x3fd)+_0x34fb35(0x23f)+_0x34fb35(0x3c1)+'oute\x20pat'+'ch\x20skipp'+'ed;\x20plug'+_0x34fb35(0x3a6)+_0x34fb35(0x332),{'openclawVersion':_0x46271c[_0x34fb35(0x33d)+_0x34fb35(0x2ee)],'distDir':_0x30003b});return;}const _0x2f8009=(await readdir(_0x30003b,{'withFileTypes':!![]})[_0x34fb35(0x258)](()=>[]))[_0x34fb35(0x249)](_0x5a5067=>_0x5a5067[_0x34fb35(0x218)]()&&_0x5a5067['name'][_0x34fb35(0x334)](_0x34fb35(0x297)))[_0x34fb35(0x3d4)](_0x2c8f31=>join(_0x30003b,_0x2c8f31['name']));for(const _0x285bff of _0x2f8009){const _0x211429=await readFile(_0x285bff,_0x34fb35(0x3a2)),_0x2f4c50=patchQQBotOutboundSessionRouteFromSource(_0x211429);if(!_0x2f4c50['patched']){if(_0x2f4c50[_0x34fb35(0x3cf)]===_0x34fb35(0x34d)+_0x34fb35(0x3b8)){_0x5b9a76[_0x34fb35(0x2de)+'ogger']?.[_0x34fb35(0x189)]?.('qqbot\x20ou'+'tbound\x20s'+_0x34fb35(0x3c1)+_0x34fb35(0x381)+_0x34fb35(0x3bf)+'dy\x20appli'+'ed',{'openclawVersion':_0x46271c[_0x34fb35(0x33d)+'Version'],'filePath':_0x285bff});return;}continue;}await writeFile(_0x285bff,_0x2f4c50[_0x34fb35(0x267)],_0x34fb35(0x3a2)),_0x5b9a76['runtimeL'+_0x34fb35(0x304)]?.['info']?.(_0x34fb35(0x3fd)+_0x34fb35(0x23f)+_0x34fb35(0x3c1)+_0x34fb35(0x381)+'ch\x20appli'+'ed',{'openclawVersion':_0x46271c[_0x34fb35(0x33d)+_0x34fb35(0x2ee)],'filePath':_0x285bff,'note':_0x34fb35(0x271)+'y\x20compat'+_0x34fb35(0x2c5)+'patch\x20fo'+_0x34fb35(0x339)+_0x34fb35(0x263)+_0x34fb35(0x3cc)+_0x34fb35(0x239)+'elivery\x20'+_0x34fb35(0x311)+_0x34fb35(0x2fd)+_0x34fb35(0x219)+'th\x20c2c\x20i'+_0x34fb35(0x227)+_0x34fb35(0x173)+'r\x20id.'});return;}_0x5b9a76[_0x34fb35(0x2de)+_0x34fb35(0x304)]?.[_0x34fb35(0x3e1)]?.(_0x34fb35(0x3fd)+_0x34fb35(0x23f)+_0x34fb35(0x3c1)+_0x34fb35(0x381)+_0x34fb35(0x1bd)+_0x34fb35(0x26a)+_0x34fb35(0x33f)+'e\x20not\x20fo'+_0x34fb35(0x2b7),{'openclawVersion':_0x46271c['openclaw'+_0x34fb35(0x2ee)],'distDir':_0x30003b});}async function resolveRuntimeChannelImportPath(_0x58a980,_0x45ec67){const _0x3b2524=_0x4cb8b3,_0x4348e9=_0x45ec67['filter'](_0x48e256=>_0x48e256[_0x3b2524(0x218)]()&&_0x48e256[_0x3b2524(0x388)][_0x3b2524(0x2e0)+'th']('runtime-'+_0x3b2524(0x2be))&&_0x48e256[_0x3b2524(0x388)][_0x3b2524(0x334)](_0x3b2524(0x297))&&!_0x48e256[_0x3b2524(0x388)][_0x3b2524(0x2e0)+'th'](_0x3b2524(0x3ee)+_0x3b2524(0x2be)+_0x3b2524(0x23c)))[_0x3b2524(0x3d4)](_0x548ed7=>_0x548ed7['name'])[_0x3b2524(0x2c6)]();for(const _0x4386d0 of _0x4348e9){const _0x4ae119=await readFile(join(_0x58a980,_0x4386d0),_0x3b2524(0x3a2));if(_0x4ae119[_0x3b2524(0x2e7)](_0x3b2524(0x295)+_0x3b2524(0x3c0)+_0x3b2524(0x2d7)))return'./'+_0x4386d0;}return null;}function normalizeRuntimeRelativePath(_0x44886a){const _0x2287b8=_0x4cb8b3;return _0x44886a[_0x2287b8(0x3aa)+'ll']('\x5c','/');}function toWindowsPath(_0x4c8c4a){const _0x339d70=_0x4cb8b3;return _0x4c8c4a[_0x339d70(0x3aa)+'ll']('/','\x5c');}function validateRuntimeNodeVersion(_0x57f547,_0xb1a946){const _0x2f5d35=_0x4cb8b3;if(_0x57f547[_0x2f5d35(0x1d1)+_0x2f5d35(0x35f)]===_0xb1a946[_0x2f5d35(0x33d)][_0x2f5d35(0x1d1)+_0x2f5d35(0x35f)])return;throw new Error(_0x2f5d35(0x3e2)+_0x2f5d35(0x1d1)+_0x2f5d35(0x3d8)+_0x2f5d35(0x246)+_0x2f5d35(0x232)+(_0x57f547['nodeVers'+'ion']||'unknown')+(_0x2f5d35(0x2b4)+_0x2f5d35(0x24e))+_0xb1a946[_0x2f5d35(0x33d)]['nodeVers'+_0x2f5d35(0x35f)]+'.\x20'+(_0x2f5d35(0x167)+_0x2f5d35(0x229)+_0x2f5d35(0x2d0)+_0x2f5d35(0x2e6)+_0x2f5d35(0x1b5)+_0x2f5d35(0x260)+_0x2f5d35(0x205)+_0x2f5d35(0x1a2)+_0x2f5d35(0x2d6)+'\x20configu'+_0x2f5d35(0x28c)+'\x20version'+'.'));}function validateRuntimeOpenClawVersion(_0x4b24dc,_0x39929c){const _0x25050a=_0x4cb8b3;if(_0x4b24dc[_0x25050a(0x33d)+_0x25050a(0x2ee)]===_0x39929c[_0x25050a(0x33d)]['openclaw'+_0x25050a(0x2ee)])return;throw new Error(_0x25050a(0x3e2)+_0x25050a(0x33d)+_0x25050a(0x395)+'mismatch'+_0x25050a(0x21f)+_0x25050a(0x3e0)+(_0x4b24dc[_0x25050a(0x33d)+_0x25050a(0x2ee)]||_0x25050a(0x1fa))+(_0x25050a(0x2b4)+_0x25050a(0x24e))+_0x39929c[_0x25050a(0x33d)][_0x25050a(0x33d)+_0x25050a(0x2ee)]+'.\x20'+(_0x25050a(0x167)+_0x25050a(0x229)+'\x20prepare'+'\x22\x20so\x20the'+_0x25050a(0x260)+_0x25050a(0x1b8)+_0x25050a(0x3a7)+_0x25050a(0x254)+_0x25050a(0x223)+'Claw\x20ver'+_0x25050a(0x16a)));}function parseNpmPackJson(_0x33c923){const _0x512266=_0x4cb8b3,_0x233ba1=_0x33c923['trim'](),_0x42739b=_0x233ba1['indexOf']('[');if(_0x42739b<0x0)throw new Error(_0x512266(0x406)+_0x512266(0x24a)+_0x512266(0x38d)+_0x512266(0x28b)+_0x233ba1['slice'](0x0,0x1f4));const _0x2b3d86=JSON[_0x512266(0x202)](_0x233ba1[_0x512266(0x1ac)](_0x42739b)),_0x1a00ee=Array['isArray'](_0x2b3d86)?_0x2b3d86[0x0]:_0x2b3d86;if(!_0x1a00ee||typeof _0x1a00ee!==_0x512266(0x38c))throw new Error(_0x512266(0x406)+_0x512266(0x1d8)+_0x512266(0x3fe)+_0x512266(0x1d2)+_0x512266(0x245)+_0x233ba1[_0x512266(0x1ac)](0x0,0x1f4));return _0x1a00ee;}function normalizePackedTarballFilename(_0x4a8561){const _0x5a82e6=_0x4cb8b3;return _0x4a8561[_0x5a82e6(0x37d)](/^@/,'')[_0x5a82e6(0x3aa)+'ll']('/','-')[_0x5a82e6(0x3aa)+'ll']('\x5c','-');}async function runProcess(_0x280112,_0x2bec00,_0x191424={}){const _0x5dffe6=_0x4cb8b3,_0xea5a63=_0x191424[_0x5dffe6(0x30d)]||[_0x280112,..._0x2bec00]['join']('\x20'),_0x398c42=_0x191424[_0x5dffe6(0x3ea)+'s']??NPM_INSTALL_TIMEOUT_MS,_0x22b0db=spawn(_0x280112,_0x2bec00,{'cwd':_0x191424[_0x5dffe6(0x175)],'env':_0x191424[_0x5dffe6(0x323)],'stdio':['ignore',_0x5dffe6(0x2bf),_0x5dffe6(0x2bf)]});return await new Promise((_0x3c7865,_0x3f5103)=>{const _0x42dbfb=_0x5dffe6;let _0x4070dc='',_0x3bbd01='',_0x43e4c8=![];const _0x2bc30a=setTimeout(()=>{const _0xe25e78=_0x5af4;if(_0x43e4c8)return;_0x43e4c8=!![],_0x22b0db[_0xe25e78(0x15b)](_0xe25e78(0x241)),_0x3f5103(new Error(_0xea5a63+('\x20timed\x20o'+_0xe25e78(0x217)+'\x20')+_0x398c42+'ms'));},_0x398c42);_0x22b0db[_0x42dbfb(0x33e)]['on']('data',_0x3d9d21=>{const _0x3a9e73=_0x42dbfb;_0x4070dc+=_0x3d9d21[_0x3a9e73(0x29e)]();}),_0x22b0db[_0x42dbfb(0x29b)]['on'](_0x42dbfb(0x2ba),_0xa0d916=>{const _0x4c0a81=_0x42dbfb;_0x3bbd01+=_0xa0d916[_0x4c0a81(0x29e)]();}),_0x22b0db['on'](_0x42dbfb(0x371),_0x38754a=>{if(_0x43e4c8)return;_0x43e4c8=!![],clearTimeout(_0x2bc30a),_0x3f5103(_0x38754a);}),_0x22b0db['on'](_0x42dbfb(0x21e),(_0x1ef9e6,_0x364671)=>{const _0x45083b=_0x42dbfb;if(_0x43e4c8)return;_0x43e4c8=!![],clearTimeout(_0x2bc30a);if(_0x1ef9e6===0x0){_0x3c7865({'stdout':_0x4070dc,'stderr':_0x3bbd01});return;}_0x3f5103(new Error(_0xea5a63+(_0x45083b(0x1b6)+_0x45083b(0x355)+'e=')+(_0x1ef9e6??_0x45083b(0x378))+_0x45083b(0x2f4)+(_0x364671??_0x45083b(0x378))+'\x0a'+(''+(_0x3bbd01||_0x4070dc))['trim']()));});});}async function installOpenClawPackage(_0x3f09f9,_0x1c1090){const _0x4b8d11=_0x4cb8b3,_0x52b660=join(_0x3f09f9[_0x4b8d11(0x1c2)+'oot'],_0x4b8d11(0x2d5)),_0x24744b=join(_0x3f09f9[_0x4b8d11(0x1c2)+_0x4b8d11(0x32a)],_0x4b8d11(0x1f4)+_0x4b8d11(0x317)+'t');await mkdir(_0x52b660,{'recursive':!![]}),await removePathWithRetries(_0x24744b),await mkdir(_0x24744b,{'recursive':!![]});const _0x134f50=await createRuntimeEnv(_0x3f09f9),_0x474120=_0x4b8d11(0x33d)+'@'+_0x1c1090;console[_0x4b8d11(0x335)](_0x4b8d11(0x206)+'hell:run'+_0x4b8d11(0x302)+_0x4b8d11(0x3a0)+'\x20'+_0x474120);const _0x4b2baa=await runProcess(_0x3f09f9['nodeExec'+'utable'],[_0x3f09f9[_0x4b8d11(0x2f2)],_0x4b8d11(0x310),_0x474120,_0x4b8d11(0x274)],{'cwd':_0x52b660,'env':_0x134f50,'label':_0x4b8d11(0x406)+'\x20'+_0x474120}),_0x286e39=parseNpmPackJson(_0x4b2baa[_0x4b8d11(0x33e)]);if(_0x286e39[_0x4b8d11(0x3f2)]!==_0x1c1090)throw new Error(_0x4b8d11(0x19d)+_0x4b8d11(0x251)+'law\x20'+_0x1c1090+(_0x4b8d11(0x3c8)+'d\x20to\x20')+_0x286e39[_0x4b8d11(0x3f2)]);const _0xf96be3=resolve(_0x52b660,_0x286e39[_0x4b8d11(0x3ef)]);if(!existsSync(_0xf96be3))throw new Error(_0x4b8d11(0x406)+_0x4b8d11(0x24a)+_0x4b8d11(0x405)+_0x4b8d11(0x2c2)+'\x20'+_0xf96be3);await runProcess(_0x4b8d11(0x2b9),[_0x4b8d11(0x22f),_0xf96be3,'-C',_0x24744b],{'label':_0x4b8d11(0x2ea)+_0x286e39[_0x4b8d11(0x3ef)]}),await removePathWithRetries(_0x3f09f9['openclaw'+_0x4b8d11(0x1ad)+'ir']),await rename(join(_0x24744b,'package'),_0x3f09f9[_0x4b8d11(0x33d)+_0x4b8d11(0x1ad)+'ir']),await removePathWithRetries(_0x24744b),await runProcess(_0x3f09f9[_0x4b8d11(0x2cd)+_0x4b8d11(0x1d7)],[_0x3f09f9['npmCli'],_0x4b8d11(0x285),_0x4b8d11(0x398)+'ev',_0x4b8d11(0x324)+'eer',_0x4b8d11(0x22b)+'it','--no-fun'+'d',_0x4b8d11(0x1b2)+'-peer-de'+'ps'],{'cwd':_0x3f09f9[_0x4b8d11(0x33d)+'WorkingD'+'ir'],'env':_0x134f50,'label':'npm\x20inst'+_0x4b8d11(0x361)+_0x474120+('\x20runtime'+_0x4b8d11(0x401)+_0x4b8d11(0x2f3))});if(!existsSync(_0x3f09f9['openclaw'+_0x4b8d11(0x15e)]))throw new Error(_0x4b8d11(0x256)+'\x20bin\x20was'+_0x4b8d11(0x21c)+_0x4b8d11(0x3ac)+_0x4b8d11(0x250)+':\x20'+_0x3f09f9[_0x4b8d11(0x33d)+_0x4b8d11(0x15e)]);}async function ensureRuntimeBase(_0x3e2564,_0x3c9fcf,_0x46c4da={}){const _0x51c3ac=_0x4cb8b3;await mkdir(_0x3c9fcf,{'recursive':!![]});let _0x32102f=await readRuntimeManifest(_0x3c9fcf);const _0x424965=_0x3e2564[_0x51c3ac(0x33d)]['nodeVers'+_0x51c3ac(0x35f)],_0x12264f=_0x3e2564[_0x51c3ac(0x33d)][_0x51c3ac(0x33d)+_0x51c3ac(0x2ee)],_0x1cf5d8=existsSync(resolveManifestPath(_0x3c9fcf)),_0xbb94ed=runtimeHasRequiredPaths(_0x3c9fcf,_0x32102f),_0x54d57b=_0x32102f[_0x51c3ac(0x1d1)+_0x51c3ac(0x35f)]===_0x424965;!_0x1cf5d8||!_0xbb94ed||!_0x54d57b?(_0x46c4da[_0x51c3ac(0x2de)+'ogger']?.[_0x51c3ac(0x1b3)+'t']?.(_0x51c3ac(0x3e2)+_0x51c3ac(0x2b1)+_0x51c3ac(0x2cc)+'ed',{'runtimeRoot':_0x3c9fcf,'reason':!_0x1cf5d8?'missing\x20'+_0x51c3ac(0x28d):!_0xbb94ed?_0x51c3ac(0x275)+_0x51c3ac(0x3cb)+_0x51c3ac(0x260)+_0x51c3ac(0x400):'node\x20ver'+'sion\x20mis'+_0x51c3ac(0x308),'syncOnly':_0x46c4da[_0x51c3ac(0x1db)]}),_0x32102f=await buildRuntimeBase(_0x3e2564,_0x3c9fcf,_0x32102f),_0x46c4da[_0x51c3ac(0x2de)+_0x51c3ac(0x304)]?.[_0x51c3ac(0x1b3)+'t']?.(_0x51c3ac(0x3e2)+_0x51c3ac(0x2b1)+_0x51c3ac(0x2e4)+_0x51c3ac(0x262),{'manifest':summarizeRuntimeManifest(_0x32102f)})):_0x46c4da[_0x51c3ac(0x2de)+_0x51c3ac(0x304)]?.[_0x51c3ac(0x1b3)+'t']?.('runtime\x20'+'base\x20alr'+_0x51c3ac(0x3a5)+_0x51c3ac(0x15d),{'manifest':summarizeRuntimeManifest(_0x32102f)});if(!existsSync(resolve(_0x3c9fcf,_0x32102f[_0x51c3ac(0x33d)+'Bin']))){const _0x297665=createRuntimeInfoFromManifest(_0x3c9fcf,_0x32102f,{'allowMissingOpenClaw':!![]});await installOpenClawPackage(_0x297665,_0x12264f),_0x32102f[_0x51c3ac(0x33d)+'Version']=_0x12264f;}return _0x32102f;}function runtimeHasRequiredPaths(_0x1fbd29,_0x17c40c){const _0x53f2c0=_0x4cb8b3;return['nodeExec'+'utable',_0x53f2c0(0x2f2),_0x53f2c0(0x33d)+_0x53f2c0(0x1ad)+'ir',_0x53f2c0(0x33d)+'Bin'][_0x53f2c0(0x1ec)](_0x1185ac=>typeof _0x17c40c[_0x1185ac]===_0x53f2c0(0x226)&&_0x17c40c[_0x1185ac][_0x53f2c0(0x396)]())&&[_0x53f2c0(0x2cd)+_0x53f2c0(0x1d7),_0x53f2c0(0x2f2)][_0x53f2c0(0x1ec)](_0x59a7e=>existsSync(resolve(_0x1fbd29,_0x17c40c[_0x59a7e])));}async function buildRuntimeBase(_0x5c511b,_0x3aeaa9,_0x2f8d99={}){const _0x540ad3=_0x4cb8b3,_0x16f232=join(_0x3aeaa9,_0x540ad3(0x39a));await ensureRuntimeNode(_0x5c511b,_0x16f232);const _0x328f03=process[_0x540ad3(0x313)]===_0x540ad3(0x242)?_0x540ad3(0x210)+'e.exe':_0x540ad3(0x1e0)+'/node',_0xfa2c6d=process[_0x540ad3(0x313)]==='win32'?_0x540ad3(0x210)+_0x540ad3(0x198)+_0x540ad3(0x1fd)+_0x540ad3(0x1be)+'i.js':_0x540ad3(0x408)+_0x540ad3(0x1ed)+_0x540ad3(0x20f)+_0x540ad3(0x19a)+'m-cli.js',_0xc96b27={..._0x2f8d99,'generatedAt':new Date()[_0x540ad3(0x174)+_0x540ad3(0x196)](),'nodeVersion':_0x5c511b[_0x540ad3(0x33d)][_0x540ad3(0x1d1)+'ion'],'openclawVersion':_0x2f8d99[_0x540ad3(0x33d)+'Version']||'','platform':process['platform'],'arch':process['arch'],'nodeExecutable':_0x328f03,'npmCli':_0xfa2c6d,'openclawWorkingDir':'openclaw','openclawBin':_0x540ad3(0x33d)+'/opencla'+'w.mjs'};return await writeJson(resolveManifestPath(_0x3aeaa9),_0xc96b27),_0xc96b27;}async function removePathWithRetries(_0x320300){await rm(_0x320300,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96});}async function ensureRuntimeNode(_0x228222,_0x3f3c73){const _0x588437=_0x4cb8b3,_0x1b4067=_0x228222[_0x588437(0x33d)][_0x588437(0x1d1)+_0x588437(0x35f)],_0x402d37=process[_0x588437(0x313)]===_0x588437(0x242)?join(_0x3f3c73,_0x588437(0x1ee)):join(_0x3f3c73,_0x588437(0x407),'node'),_0x5f0437=process['platform']==='win32'?join(_0x3f3c73,_0x588437(0x2b3)+'ules',_0x588437(0x1e3),_0x588437(0x407),_0x588437(0x1e6)+'js'):join(_0x3f3c73,_0x588437(0x2bb),_0x588437(0x2b3)+_0x588437(0x2ae),'npm',_0x588437(0x407),_0x588437(0x1e6)+'js');if(existsSync(_0x402d37)&&existsSync(_0x5f0437)&&await getNodeVersion(_0x402d37)===_0x1b4067)return;await removePathWithRetries(_0x3f3c73);if(process[_0x588437(0x34b)][_0x588437(0x39a)]===_0x1b4067){await linkCurrentNodeRuntime(_0x3f3c73);return;}await downloadNodeRuntime(_0x1b4067,_0x3f3c73);}async function getNodeVersion(_0x25bd84){const _0x39123e=_0x4cb8b3;try{const _0x3b6f4e=await runProcess(_0x25bd84,['-p',_0x39123e(0x375)+_0x39123e(0x34b)+_0x39123e(0x3f1)],{'label':_0x25bd84+'\x20version','timeoutMs':0x7530});return _0x3b6f4e[_0x39123e(0x33e)][_0x39123e(0x396)]();}catch{return'';}}async function linkCurrentNodeRuntime(_0x1828d4){const _0x32d18f=_0x4cb8b3,_0x5185cc=process[_0x32d18f(0x1dd)],_0x1741b8=resolve(dirname(_0x5185cc),'..'),_0x3edc63=process[_0x32d18f(0x313)]===_0x32d18f(0x242)?resolve(_0x1741b8,_0x32d18f(0x2b3)+_0x32d18f(0x1d0)):resolve(_0x1741b8,_0x32d18f(0x3b9)+_0x32d18f(0x3c9)+_0x32d18f(0x279)),_0x3202e1=process[_0x32d18f(0x313)]===_0x32d18f(0x242)?join(_0x1828d4,_0x32d18f(0x1ee)):join(_0x1828d4,_0x32d18f(0x407),_0x32d18f(0x39a)),_0x402749=process[_0x32d18f(0x313)]==='win32'?join(_0x1828d4,_0x32d18f(0x2b3)+'ules','npm'):join(_0x1828d4,_0x32d18f(0x2bb),_0x32d18f(0x2b3)+_0x32d18f(0x2ae),_0x32d18f(0x1e3));await mkdir(dirname(_0x3202e1),{'recursive':!![]}),await mkdir(dirname(_0x402749),{'recursive':!![]}),await symlink(_0x5185cc,_0x3202e1),existsSync(_0x3edc63)?await symlink(_0x3edc63,_0x402749):await symlink(await resolveNpmRoot(),_0x402749);}async function resolveNpmRoot(){const _0x487bfc=_0x4cb8b3,_0x58438d=await runProcess('npm',['root','-g'],{'label':_0x487bfc(0x3eb)+_0x487bfc(0x301),'timeoutMs':0x7530}),_0x23624c=process[_0x487bfc(0x313)]===_0x487bfc(0x242)?_0x58438d[_0x487bfc(0x33e)]['trim']():join(_0x58438d[_0x487bfc(0x33e)][_0x487bfc(0x396)](),_0x487bfc(0x1e3));if(!existsSync(join(_0x23624c,_0x487bfc(0x407),'npm-cli.'+'js')))throw new Error(_0x487bfc(0x406)+_0x487bfc(0x201)+_0x487bfc(0x1cb)+'d\x20for\x20lo'+'cal\x20runt'+_0x487bfc(0x2fe)+_0x487bfc(0x3af)+_0x23624c);return _0x23624c;}async function resolveExtractedNodeRoot(_0x47631b,_0x5bee68){const _0x4b7a6d=_0x4cb8b3,_0x38813a=join(_0x47631b,_0x5bee68);if(existsSync(_0x38813a))return _0x38813a;const _0x104038=await readdir(_0x47631b,{'withFileTypes':!![]}),_0x3a7b07=_0x104038[_0x4b7a6d(0x249)](_0x3828cc=>_0x3828cc[_0x4b7a6d(0x2dd)+'ory']());if(_0x3a7b07[_0x4b7a6d(0x23b)]===0x1)return join(_0x47631b,_0x3a7b07[0x0][_0x4b7a6d(0x388)]);const _0x50d84d=process[_0x4b7a6d(0x313)]===_0x4b7a6d(0x242)?join(_0x47631b,_0x4b7a6d(0x1ee)):join(_0x47631b,_0x4b7a6d(0x407),'node');if(existsSync(_0x50d84d))return _0x47631b;const _0xb14b3c=await findNodeRuntimeRoot(_0x47631b);if(_0xb14b3c)return _0xb14b3c;const _0x58dbec=_0x104038[_0x4b7a6d(0x3d4)](_0x2244d6=>_0x2244d6[_0x4b7a6d(0x388)])['join'](',\x20');throw new Error(_0x4b7a6d(0x1f5)+'d\x20Node\x20r'+_0x4b7a6d(0x341)+_0x4b7a6d(0x257)+'not\x20foun'+_0x4b7a6d(0x3ec)+_0x5bee68+_0x4b7a6d(0x166)+_0x47631b+('.\x20Top-le'+'vel\x20entr'+'ies:\x20')+(_0x58dbec||_0x4b7a6d(0x203)));}function resolveNodeExtractRoot(_0xb607a8,_0x530deb,_0x1b68c7){const _0x200f23=_0x4cb8b3;if(process[_0x200f23(0x313)]!=='win32')return join(_0xb607a8,_0x530deb+(_0x200f23(0x35c)+'-')+process[_0x200f23(0x27c)]+'-'+Date[_0x200f23(0x366)]()+'-'+_0x1b68c7);const _0x52a875=/^[A-Za-z]:[\\/]/[_0x200f23(0x24c)](_0xb607a8),_0x3056ed=parse(_0xb607a8),_0x2523b8=_0x52a875?_0x52a875[0x0][_0x200f23(0x1ac)](0x0,0x2)+'\x5c':_0x3056ed[_0x200f23(0x247)]&&_0x3056ed[_0x200f23(0x247)]!=='/'?_0x3056ed[_0x200f23(0x247)]:_0xb607a8,_0x1baa3c=_0x2523b8['replace'](/[\\/]+$/,'');return _0x1baa3c+'\x5cwjrt-'+process[_0x200f23(0x27c)]+'-'+Date[_0x200f23(0x366)]()+'-'+_0x1b68c7;}async function findNodeRuntimeRoot(_0x398911){const _0x169c87=_0x4cb8b3,_0x24995d=[_0x398911],_0x4659cd=new Set();while(_0x24995d[_0x169c87(0x23b)]>0x0){const _0x1baabf=_0x24995d[_0x169c87(0x1f6)]();if(!_0x1baabf||_0x4659cd[_0x169c87(0x3e5)](_0x1baabf))continue;_0x4659cd[_0x169c87(0x3ad)](_0x1baabf);const _0x5490b0=process[_0x169c87(0x313)]===_0x169c87(0x242)?join(_0x1baabf,_0x169c87(0x1ee)):join(_0x1baabf,_0x169c87(0x407),'node'),_0x40607=process['platform']==='win32'?join(_0x1baabf,_0x169c87(0x2b3)+_0x169c87(0x2ae),'npm',_0x169c87(0x407),_0x169c87(0x1e6)+'js'):join(_0x1baabf,_0x169c87(0x2bb),_0x169c87(0x2b3)+_0x169c87(0x2ae),_0x169c87(0x1e3),_0x169c87(0x407),_0x169c87(0x1e6)+'js');if(existsSync(_0x5490b0)&&existsSync(_0x40607))return _0x1baabf;const _0x3861c9=await readdir(_0x1baabf,{'withFileTypes':!![]});for(const _0x4a6f5d of _0x3861c9){_0x4a6f5d[_0x169c87(0x2dd)+_0x169c87(0x273)]()&&_0x24995d['push'](join(_0x1baabf,_0x4a6f5d[_0x169c87(0x388)]));}}return'';}async function downloadNodeRuntime(_0x138e4d,_0x28891b){const _0x17cb61=_0x4cb8b3,_0x7eeb5=process[_0x17cb61(0x313)]===_0x17cb61(0x242)?_0x17cb61(0x21d):process['platform'],_0x45f384=process['arch']==='x64'?_0x17cb61(0x33b):process[_0x17cb61(0x1ef)]===_0x17cb61(0x35a)?_0x17cb61(0x35a):process[_0x17cb61(0x1ef)],_0x245cb1=process[_0x17cb61(0x313)]==='win32'?_0x17cb61(0x1ba):_0x17cb61(0x325),_0x3fe249='node-v'+_0x138e4d+'-'+_0x7eeb5+'-'+_0x45f384,_0x59c692=_0x3fe249+'.'+_0x245cb1,_0x3bdc58=join(dirname(_0x28891b),_0x17cb61(0x2d5)),_0x46348e=join(_0x3bdc58,_0x59c692),_0x1b91e0=_0x17cb61(0x16d)+_0x17cb61(0x37a)+'rg/dist/'+'v'+_0x138e4d+'/'+_0x59c692;await mkdir(_0x3bdc58,{'recursive':!![]});const _0x42cbc2=resolveNodeExtractRoot(_0x3bdc58,_0x3fe249,0x1);!existsSync(_0x46348e)&&(console['log']('[wujie-s'+_0x17cb61(0x340)+_0x17cb61(0x26f)+_0x17cb61(0x1d3)+'g\x20'+_0x1b91e0),await downloadFile(_0x1b91e0,_0x46348e));await rm(_0x42cbc2,{'recursive':!![],'force':!![]}),await mkdir(_0x42cbc2,{'recursive':!![]});process[_0x17cb61(0x313)]===_0x17cb61(0x242)?await extractZipArchive(_0x46348e,_0x42cbc2,_0x59c692):await runProcess(_0x17cb61(0x2b9),[_0x17cb61(0x2e2),_0x46348e,'-C',_0x42cbc2],{'label':_0x17cb61(0x2ea)+_0x59c692});const _0x4bd8de=await resolveExtractedNodeRoot(_0x42cbc2,_0x3fe249);await mkdir(dirname(_0x28891b),{'recursive':!![]}),await rename(_0x4bd8de,_0x28891b),_0x4bd8de!==_0x42cbc2&&await rm(_0x42cbc2,{'recursive':!![],'force':!![]});}async function extractZipArchive(_0x4f35b9,_0x556d2e,_0x23fe55){const _0xb5f1e=_0x4cb8b3;await runProcess('powershe'+_0xb5f1e(0x183),[_0xb5f1e(0x248)+'le',_0xb5f1e(0x32c)+_0xb5f1e(0x3ab),_0xb5f1e(0x190),'-Command','Expand-A'+_0xb5f1e(0x17e)+_0xb5f1e(0x2c4)+_0xb5f1e(0x2f8)+_0xb5f1e(0x1c3)+_0xb5f1e(0x1e1)+_0xb5f1e(0x1cd)+'stinatio'+_0xb5f1e(0x352)+_0xb5f1e(0x3be)+_0xb5f1e(0x272)+_0xb5f1e(0x18a)+'OOT\x20-For'+'ce'],{'env':{...process.env,'WUJIE_SHELL_ARCHIVE':_0x4f35b9,'WUJIE_SHELL_EXTRACT_ROOT':_0x556d2e},'label':_0xb5f1e(0x2ea)+_0x23fe55});}function _0x8027(){const _0x36fce9=['synced','ced','n\x20outbou','h\x20applie','../../as','JSON:\x20','red\x20Node','manifest','if\x20\x22%OPE',';\x20run\x20wu','\x20is\x20unav','ors\x20bein','ify\x20upst','ack\x20over','pluginSp','createRu','PT_DIR/','.js','?t=','\x22==\x22\x22\x20se','ATH=\x22${O','stderr','ound','ery\x20mirr','toString','wujie-lo','ntime\x20re','channel\x20','time-too','t\x20found','l\x20prepar','try\x20not\x20','ons;\x20ver','--\x20\x22$(di','in\x20runti','\x20applied','flow;\x20ve','allowMis','agentSco','session\x20','ules','ot\x20found','d\x20as\x20gro','base\x20bui','864720BCCBpH','node_mod',',\x20shell.','fix\x20comp','%~dp0\x22','und','function','tar','data','lib','store\x20wr','Invalid\x20','channel-','pipe','LocalSki','prepare\x20','tarball:','atch\x20ski','LiteralP','ibility\x20','sort','plugin\x20s','\x20validat','plugins','me\x20missi','pped;\x20lo','ld\x20start','nodeExec','store-','allback\x20','\x20prepare','FIG_FILE','product\x20','E_NAME%\x22','fy\x20upstr','.cache','with\x20the','nnel','configPa','patch\x20sk','ynced','tch\x20alre','\x20already','isDirect','runtimeL','ATE_DIR:','startsWi','\x20and\x20','-xJf','claw-run','ld\x20compl','plugin\x20r','\x22\x20so\x20the','includes','y:\x20','\x22\x20\x22$SCRI','extract\x20','fallback','ATH:-','values','Version','devDepen','\x20kdocs\x20s','ile\x20not\x20','npmCli','ncies','\x20signal=','led','tests','failed','ath\x20$env','achment\x20','e\x20plugin','\x20doctor\x20','ailable.','being\x20in','ime\x20buil','ady\x20appl','ATE_DIR%','\x20-g','time]\x20in','r\x20OpenCl','ogger','ENCLAW_H','example','NFIG_PAT','match','pplied','untime-b','\x22\x20%*','bridge.m','label','tory\x20pro','nd\x20deliv','pack','mirrors\x20','_DIR%','platform','up\x20sessi','man','x\x20on\x20fut','w-extrac','pped;\x20ru','-peer-de','CONFIG_P','er\x20respo','export\x20O','ader\x20not','npm\x20plug','w.cmd','Name','resolver','chment\x20b','env','--omit=p','tar.xz','&&\x20pwd)','flush','npm\x20inst','rs;\x20veri','oot','href','-Executi','empty\x20pl','shell-ru','pruned\x20r','statusCo','ure\x20upgr','nstalled','referenc','endsWith','log','aw\x202026.','time-bri','OGO\x22\x20];\x20','r\x20@openc','\x22\x20\x22%SCRI','x64','\x20package','openclaw','stdout','nel\x20shap','hell:run','untime\x20r','download','FILE%\x5c','ntime\x20ch','local:','all\x20loca','ackup','ell-runt','leted','dataDirN','versions','fix\x20mark','already-','IPT_DIR=','utbound\x20','toLowerC','ed\x20npm\x20p','nPath\x20$e','time]\x20fe','\x20-z\x20\x22$WU','with\x20cod','chat-dis','\x20id\x20from','esolver\x20','#!/bin/s','arm64','attachme','-extract','ipped;\x20f','ent','ion','tch\x20appl','all\x20','ath','dencies','PENCLAW_','eady\x20app','now','NFIG_FIL','npm-glob','plied','../../sh','%USERPRO','on\x20futur','r\x20runtim','cies','runtime','lled','error','ATH=\x20cd\x20','\x20patch\x20a','ME%\x22==\x22\x22','process.','ons\x20with','pped;\x20fi','null','ime/sess','nodejs.o','\x20summary','generate','replace','ecs','npm-cach','Dependen','oute\x20pat','find','-session','dist','ugin\x20dep','\x20written','385mnnrLl','name','skills','enclaw\x20d','aipc-run','object','\x20return\x20','aw-weixi','ame','ridge.mj','Spec','session-','wujiecla','NCLAW_HO','Version\x20','trim','red','--omit=d','set\x20\x22OPE','node','ayload\x20b','test','LocalAge','\x20found','ot\x20avail','stalling','_shared','utf8','es.','agents','eady\x20cur','in\x20not\x20i','tall\x20the','.json','pe\x20not\x20f','replaceA','onPolicy','nd\x20after','add','installe','d:\x20','.tmp/run','.map','tory\x20mix','base64\x20p','indexOf','n\x20plugin','wBin','>/dev/nu','patched','lib/node','ore\x20pack','ginPaths','Unable\x20t','local\x20pl','nv:WUJIE','ch\x20alrea','ntimeCha','ession\x20r','NCLAW_CO','Claw','\x20outboun','nd\x20helpe','headers','ad\x20patch','\x20resolve','_modules','entryCou','required','t\x20c2c\x20ou','eer','channel.','reason','ed;\x20brid','untime\x20p','shasum','found','map','provider','wujieai.','atch\x20alr','ion\x20mism','all\x20plug','ipped;\x20o','aipc-dow','keys','rname\x20--','wrapper\x20','2hYIWbD','st=','warn','runtime\x20','leName','\x20to\x20dire','has','ipped;\x20r','e\x20upgrad','patch\x20ap','pluginId','timeoutM','npm\x20root','d\x20for\x20','chat\x20his','runtime-','filename','gin\x20not\x20','.node','version','request-','enclaw-w','weixin\x20o','7727390OHlvpb','ugin\x20spe','idated','HOME=\x22${','lugins\x20s','bytes','.d.ts','qqbot\x20ou','d\x20an\x20inv','ect\x20sess','\x20paths','\x20depende','path','ready\x20ap','\x20shape\x20n','\x20create\x20','npm\x20pack','bin','node/lib','\x20mirrors','examples','kill','ntPaths','rent','Bin','out\x20c2c\x20','eixin\x20@i','jection\x20','40732DwkTqT','local','_HOME:-','ujie-log','\x20in\x20','Run\x20\x22wuj','singOpen','if\x20[\x20-t\x20','sion.','bug;\x20ver','==\x22\x22\x20set','https://','fix\x20alre','started','nt-norma','sets/wuj','lite\x20pat','rect\x20pee','toISOStr','cwd','291ONbnvy','cope\x20syn','710cRjeyi','AME=','resume','--fix','skill','116611nAeRMV','rchive\x20-','st\x20be\x20a\x20','pped;\x20di','endencie','er\x20id.','ll.exe','tching\x20p','\x20set\x20\x22OP','join','package-','ct\x20sessi','info','XTRACT_R','unction\x20','product','qqbot','split','\x20local\x20p','Bypass','ng\x20chann','docs','n/opencl','then','plugins\x20','ing','lize-','e_module','s\x20to\x20dir','m/bin/np','\x22\x20from\x20','lock.jso','Configur',';\x20dist\x20n','.tools','agent','und:\x20','rebuilt\x20','location','E_DIR=','PT_DIR/w','isArray','store\x20lo','json','-id\x20head','nt-weixi','bridge\x20n','slice','WorkingD','appId','ime/requ','jie-shel','e\x20tools\x20','--legacy','importan','shape\x20no','\x20product','\x20failed\x20','patch\x20al','\x20can\x20ins','prepareP','zip','octor\x20--','kup','ch\x20skipp','n/npm-cl','sion\x20val','ase64\x20st','installP','runtimeR',':WUJIE_S','tool\x20his','\x20\x22OPENCL','85398EPnehu','ades.','id\x20title','roductRu','NCLAW_ST','not\x20foun','tateDir','HIVE\x20-De','.npmmirr','skipped;','ules/npm','nodeVers','alid\x20pay','wnloadin','node\x20ver','play-pro','\x20request','utable','\x20returne','Duplicat','patch\x20fo','syncOnly','ntime','execPath','tools\x20sy','6\x20chat.s','node/bin','HELL_ARC','lready\x20a','npm','go.mjs','rify\x20ups','npm-cli.','m.wechat','nced','er\x20patch','\x20routing','dataDir','every','/node_mo','node.exe','arch','sessions','solver\x20n','set\x20\x22SCR','3960680wikkin','.opencla','Extracte','shift','60201bzCFUL','tbound\x20f','CLAW_CON','unknown','loader-','extensio','s/npm/bi','lied','ipped;\x20d','s/npm','age\x20was\x20','parse','(empty)','nnel\x20sha','\x20can\x20be\x20','[wujie-s','in\x20insta','SCRIPT_D','@echo\x20of','store-lo','\x22\x20\x22$@\x22','o\x20resolv','ped;\x20cha','kipped;\x20','dules/np','node/nod','push','src','st\x20not\x20f','store\x20sq','agents\x20s','doc','ut\x20after','isFile','dexed\x20wi','director','eam\x20fix\x20','\x20not\x20fou','win','close',':\x20manife','y\x20compat','llPaths','productN','red\x20Open','ted','package.','string','n\x20the\x20di','-doctor.','ie-shell','STATE_DI','--no-aud','pec:\x20','route\x20pa','\x20complet','-xzf','.md','ite\x20patc','nifest=','=\x22${OPEN','or.com','_NAME:-','rcing\x20op','re\x20upgra','ies','tbound\x20d','\x20loaded','length','state-','LocalPlu','transcri','tbound\x20s','nse\x20hook','SIGTERM','win32','Bot\x20c2c\x20','dependen','load:\x20','atch:\x20ma','root','-NoProfi','filter','\x20did\x20not','ing\x20\x22','exec','h\x20alread','config=','outbound','\x20install','ed\x20OpenC','ions/run','\x20on\x20futu','\x20configu','runtimeS','OpenClaw','oot\x20was\x20','catch','atch\x20app','skills\x20s','\x20skipped','ed-tool\x20','y\x20applie','projectR','fix\x20star','\x20runtime','index.mj','eted','law/qqbo','resolved','size','optional','source','ied','prefix\x20i','ed;\x20chan','scripts','JIE_NO_L','.plugin-','vailable','time]\x20do','s\x20not\x20fo','Temporar','_SHELL_E','ory','--json','missing\x20','exec\x20\x22$S','\x20timed\x20o','PT_DIR%','/npm','tream\x20fi','pendenci','pid','des.','\x20patch\x20s','configur','tch\x20skip','est-id/r','ream\x20fix','chat\x20att','\x22%SCRIPT','install'];_0x8027=function(){return _0x36fce9;};return _0x8027();}async function downloadFile(_0x5dbe34,_0x5a66d9){await mkdir(dirname(_0x5a66d9),{'recursive':!![]});const _0x3701ba=await new Promise((_0x3f16bb,_0x3779f6)=>{const _0x55fc54=_0x5af4;get(_0x5dbe34,_0x11c550=>{const _0x6ca26=_0x5af4;if(_0x11c550['statusCo'+'de']>=0x12c&&_0x11c550['statusCo'+'de']<0x190&&_0x11c550['headers'][_0x6ca26(0x1a3)]){_0x11c550[_0x6ca26(0x17a)](),downloadFile(new URL(_0x11c550[_0x6ca26(0x3c6)]['location'],_0x5dbe34)[_0x6ca26(0x32b)],_0x5a66d9)['then'](()=>_0x3f16bb(null))[_0x6ca26(0x258)](_0x3779f6);return;}if(_0x11c550[_0x6ca26(0x330)+'de']!==0xc8){_0x11c550[_0x6ca26(0x17a)](),_0x3779f6(new Error(_0x6ca26(0x342)+'\x20failed\x20'+_0x11c550[_0x6ca26(0x330)+'de']+':\x20'+_0x5dbe34));return;}_0x3f16bb(_0x11c550);})['on'](_0x55fc54(0x371),_0x3779f6);});_0x3701ba&&await pipeline(_0x3701ba,createWriteStream(_0x5a66d9));}export async function ensureOpenClawDoctorFixed(_0x9dff7a,_0x49f642={}){const _0x4eddfb=_0x4cb8b3,_0x50bd4d=await loadRuntimeInfo(_0x9dff7a['projectR'+_0x4eddfb(0x32a)]),_0x3fa20d=getConfigPaths(_0x9dff7a),_0x5a6160=join(_0x3fa20d[_0x4eddfb(0x255)+_0x4eddfb(0x1cc)],_0x4eddfb(0x33d)+_0x4eddfb(0x228)+'json'),_0x3bd0d1=await readJson(_0x5a6160,{});if(_0x3bd0d1['openclaw'+_0x4eddfb(0x2ee)]===_0x50bd4d[_0x4eddfb(0x33d)+'Version'])return _0x49f642['runtimeL'+_0x4eddfb(0x304)]?.[_0x4eddfb(0x189)]('openclaw'+_0x4eddfb(0x2fb)+_0x4eddfb(0x16e)+'ady\x20curr'+_0x4eddfb(0x35e),{'openclawVersion':_0x50bd4d[_0x4eddfb(0x33d)+_0x4eddfb(0x2ee)],'markerPath':_0x5a6160}),{'ran':![],'openclawVersion':_0x50bd4d[_0x4eddfb(0x33d)+_0x4eddfb(0x2ee)],'markerPath':_0x5a6160};return await runOpenClawDoctorFix(_0x9dff7a,_0x50bd4d,{'fromVersion':_0x3bd0d1[_0x4eddfb(0x33d)+_0x4eddfb(0x2ee)]||_0x4eddfb(0x1fa),'toVersion':_0x50bd4d[_0x4eddfb(0x33d)+_0x4eddfb(0x2ee)],'markerPath':_0x5a6160,'runtimeLogger':_0x49f642['runtimeL'+_0x4eddfb(0x304)]}),{'ran':!![],'openclawVersion':_0x50bd4d[_0x4eddfb(0x33d)+_0x4eddfb(0x2ee)],'markerPath':_0x5a6160};}async function runOpenClawDoctorFix(_0x494b10,_0x553eb6,{fromVersion:_0x1d6308,toVersion:_0x373d05,markerPath:markerPath='',runtimeLogger:_0x517062}={}){const _0x5aaff1=_0x4cb8b3;_0x517062?.[_0x5aaff1(0x1b3)+'t']?.('openclaw'+'\x20doctor\x20'+_0x5aaff1(0x25f)+_0x5aaff1(0x224),{'fromVersion':_0x1d6308,'toVersion':_0x373d05});const _0x4ef135=await createRuntimeEnv(_0x553eb6,{'OPENCLAW_HOME':_0x494b10[_0x5aaff1(0x1eb)],'OPENCLAW_STATE_DIR':_0x494b10[_0x5aaff1(0x1eb)],'OPENCLAW_CONFIG_PATH':getConfigPaths(_0x494b10)[_0x5aaff1(0x2d8)+'th']});console[_0x5aaff1(0x335)](_0x5aaff1(0x206)+'hell:run'+'time]\x20ru'+'nning\x20op'+_0x5aaff1(0x38a)+_0x5aaff1(0x1bb)+'fix');const _0x31907e=await runProcess(_0x553eb6[_0x5aaff1(0x2cd)+_0x5aaff1(0x1d7)],[_0x553eb6['openclaw'+_0x5aaff1(0x15e)],'doctor','--fix'],{'cwd':_0x553eb6[_0x5aaff1(0x33d)+_0x5aaff1(0x1ad)+'ir'],'env':_0x4ef135,'label':_0x5aaff1(0x33d)+_0x5aaff1(0x2fb)+_0x5aaff1(0x17b),'timeoutMs':0x1d4c0});_0x517062?.[_0x5aaff1(0x1b3)+'t']?.(_0x5aaff1(0x33d)+'\x20doctor\x20'+_0x5aaff1(0x2b5)+_0x5aaff1(0x349),{'fromVersion':_0x1d6308,'toVersion':_0x373d05,'stdout':_0x31907e[_0x5aaff1(0x33e)][_0x5aaff1(0x396)]()[_0x5aaff1(0x1ac)](-0xfa0),'stderr':_0x31907e['stderr'][_0x5aaff1(0x396)]()[_0x5aaff1(0x1ac)](-0xfa0)}),markerPath&&(await writeJson(markerPath,{'openclawVersion':_0x553eb6[_0x5aaff1(0x33d)+_0x5aaff1(0x2ee)],'fixedAt':new Date()[_0x5aaff1(0x174)+'ing']()}),_0x517062?.[_0x5aaff1(0x1b3)+'t']?.('openclaw'+_0x5aaff1(0x2fb)+_0x5aaff1(0x34c)+'er\x20writt'+'en',{'markerPath':markerPath,'openclawVersion':_0x553eb6['openclaw'+_0x5aaff1(0x2ee)]}));}export async function readRuntimeManifest(_0x157de4){return await readJson(resolveManifestPath(_0x157de4),{});}export async function loadRuntimeInfo(_0x7c8391){const _0x4ca235=resolveRuntimeRoot(_0x7c8391),_0x237007=await readRuntimeManifest(_0x4ca235);return createRuntimeInfoFromManifest(_0x4ca235,_0x237007);}function createRuntimeInfoFromManifest(_0x314d11,_0x3ad895,_0x2c8ed1={}){const _0x175ffc=_0x4cb8b3;for(const _0x558a85 of[_0x175ffc(0x2cd)+_0x175ffc(0x1d7),_0x175ffc(0x2f2),_0x175ffc(0x33d)+'WorkingD'+'ir',_0x175ffc(0x33d)+_0x175ffc(0x15e)]){if(typeof _0x3ad895[_0x558a85]!==_0x175ffc(0x226)||!_0x3ad895[_0x558a85][_0x175ffc(0x396)]())throw new Error('runtime\x20'+'manifest'+'\x20is\x20miss'+_0x175ffc(0x24b)+_0x558a85+'\x22\x20at\x20'+resolveManifestPath(_0x314d11)+(_0x175ffc(0x28f)+_0x175ffc(0x1b0)+_0x175ffc(0x2a4)+'e'));}const _0x3100b2=resolve(_0x314d11,_0x3ad895[_0x175ffc(0x2cd)+'utable']),_0x171e81=resolve(_0x314d11,_0x3ad895[_0x175ffc(0x2f2)]),_0xf53cdf=resolve(_0x314d11,_0x3ad895[_0x175ffc(0x33d)+_0x175ffc(0x1ad)+'ir']),_0x31593e=resolve(_0x314d11,_0x3ad895[_0x175ffc(0x33d)+_0x175ffc(0x15e)]),_0x3117e8=Array[_0x175ffc(0x1a6)](_0x3ad895[_0x175ffc(0x2c9)])?_0x3ad895['plugins'][_0x175ffc(0x3d4)](_0x21b23f=>({..._0x21b23f,'installPath':resolve(_0x314d11,_0x21b23f[_0x175ffc(0x1c1)+_0x175ffc(0x362)])})):[],_0x5d1018=_0x2c8ed1[_0x175ffc(0x2ab)+_0x175ffc(0x168)+_0x175ffc(0x3c3)]?[_0x3100b2,_0x171e81]:[_0x3100b2,_0x171e81,_0xf53cdf,_0x31593e];for(const _0x930f76 of _0x5d1018){if(!existsSync(_0x930f76))throw new Error(_0x175ffc(0x3e2)+_0x175ffc(0x275)+'path:\x20'+_0x930f76);}return{'runtimeRoot':_0x314d11,'manifest':_0x3ad895,'openclawVersion':_0x3ad895[_0x175ffc(0x33d)+_0x175ffc(0x2ee)]||_0x175ffc(0x1fa),'nodeExecutable':_0x3100b2,'npmCli':_0x171e81,'openclawWorkingDir':_0xf53cdf,'openclawBin':_0x31593e,'plugins':_0x3117e8};}export async function spawnClaw(_0x48edb4,_0x447579=[],_0x278c66={}){const _0x1194b1=_0x4cb8b3,_0x4bfd19=await loadRuntimeInfo(_0x48edb4),_0x4702d4=await createRuntimeEnv(_0x4bfd19,_0x278c66[_0x1194b1(0x323)]??{});return spawn(_0x4bfd19[_0x1194b1(0x2cd)+_0x1194b1(0x1d7)],[_0x4bfd19[_0x1194b1(0x33d)+'Bin'],..._0x447579],{'cwd':_0x4bfd19[_0x1194b1(0x33d)+'WorkingD'+'ir'],'stdio':'pipe',..._0x278c66,'env':_0x4702d4});}export async function runClawOnce(_0x1addb4,_0x1a85a3=[],_0x1e3b91=0x15f90){const _0x1bcd74=await spawnClaw(_0x1addb4,_0x1a85a3);return await new Promise((_0x4a4075,_0x1596b2)=>{const _0x4867dc=_0x5af4;let _0xdbe743='',_0x57411b='',_0xf3a92c=![];const _0x513d3f=setTimeout(()=>{const _0x34fb5c=_0x5af4;if(_0xf3a92c)return;_0xf3a92c=!![],_0x1bcd74[_0x34fb5c(0x15b)](_0x34fb5c(0x241)),_0x1596b2(new Error(_0x34fb5c(0x33d)+_0x34fb5c(0x277)+_0x34fb5c(0x217)+'\x20'+_0x1e3b91+'ms'));},_0x1e3b91);_0x1bcd74[_0x4867dc(0x33e)]['on'](_0x4867dc(0x2ba),_0x10a152=>{const _0x50c97f=_0x4867dc;_0xdbe743+=_0x10a152[_0x50c97f(0x29e)]();}),_0x1bcd74[_0x4867dc(0x29b)]['on'](_0x4867dc(0x2ba),_0x12ab14=>{_0x57411b+=_0x12ab14['toString']();}),_0x1bcd74['on'](_0x4867dc(0x371),_0x1915a5=>{if(_0xf3a92c)return;_0xf3a92c=!![],clearTimeout(_0x513d3f),_0x1596b2(_0x1915a5);}),_0x1bcd74['on'](_0x4867dc(0x21e),(_0x1935a9,_0x38774a)=>{if(_0xf3a92c)return;_0xf3a92c=!![],clearTimeout(_0x513d3f),_0x4a4075({'code':_0x1935a9,'signal':_0x38774a,'stdout':_0xdbe743,'stderr':_0x57411b});});});}export{resolveRuntimeLarkCliCommand};function resolvePackageNameFromNpmSpec(_0x194709){const _0x1a8384=_0x4cb8b3,_0x285543=_0x194709[_0x1a8384(0x396)]()[_0x1a8384(0x37d)](/^npm:/,'');if(!_0x285543)throw new Error('Invalid\x20'+_0x1a8384(0x32d)+_0x1a8384(0x3f7)+'c');if(_0x285543[_0x1a8384(0x2e0)+'th']('@')){const _0x21b48a=_0x285543['indexOf']('/');if(_0x21b48a===-0x1)throw new Error(_0x1a8384(0x2bd)+'scoped\x20s'+_0x1a8384(0x22c)+_0x194709);const _0x3c9794=_0x285543[_0x1a8384(0x3b4)]('@',_0x21b48a+0x1);return _0x3c9794===-0x1?_0x285543:_0x285543[_0x1a8384(0x1ac)](0x0,_0x3c9794);}const _0x50b7f5=_0x285543[_0x1a8384(0x3b4)]('@');return _0x50b7f5===-0x1?_0x285543:_0x285543[_0x1a8384(0x1ac)](0x0,_0x50b7f5);}async function createRuntimeEnv(_0x10bf8d,_0x79b044={}){const _0x538715=_0x4cb8b3,_0x317ee8=process.env.OPENCLAW_STATE_DIR||'',_0x411791=process.env.NPM_CONFIG_REGISTRY||_0x538715(0x16d)+'registry'+_0x538715(0x1ce)+_0x538715(0x234),_0x3dbe43=_0x317ee8?join(_0x317ee8,_0x538715(0x2e3)+_0x538715(0x2a2)+'ls'):join(_0x10bf8d[_0x538715(0x1c2)+'oot'],_0x538715(0x19f)),_0x49aed0=join(_0x3dbe43,_0x538715(0x368)+'al'),_0xaa0b11=join(_0x3dbe43,_0x538715(0x37f)+'e'),_0x14f245=join(_0x49aed0,_0x538715(0x407));await mkdir(_0x14f245,{'recursive':!![]}),await mkdir(_0xaa0b11,{'recursive':!![]});const _0x257a85=[_0x14f245,dirname(_0x10bf8d[_0x538715(0x2cd)+_0x538715(0x1d7)]),process.env.PATH||''];return{...process.env,..._0x79b044,'PATH':_0x257a85[_0x538715(0x249)](Boolean)[_0x538715(0x186)](delimiter),'npm_config_prefix':_0x49aed0,'NPM_CONFIG_PREFIX':_0x49aed0,'npm_config_cache':_0xaa0b11,'NPM_CONFIG_CACHE':_0xaa0b11,'NPM_CONFIG_REGISTRY':_0x411791,'npm_execpath':_0x10bf8d['npmCli'],'npm_node_execpath':_0x10bf8d[_0x538715(0x2cd)+_0x538715(0x1d7)],'OPENCLAW_RUNTIME_NPM_PREFIX':_0x49aed0,'OPENCLAW_RUNTIME_NPM_BIN':_0x14f245};}export async function getRuntimeSpawnContext(_0x5ce8f2,_0x1a5495={}){const _0x268f9f=_0x4cb8b3,_0x516645=await loadRuntimeInfo(_0x5ce8f2),_0x24462b=await createRuntimeEnv(_0x516645,_0x1a5495);return{'cwd':_0x516645[_0x268f9f(0x33d)+_0x268f9f(0x1ad)+'ir'],'env':_0x24462b,'runtime':_0x516645};}function resolvePluginDirNameFromSpec(_0x17ab10){const _0x36e4c4=_0x4cb8b3,_0x3888dd=resolvePackageNameFromNpmSpec(_0x17ab10),_0x36c030=_0x3888dd['split']('/')[_0x36e4c4(0x249)](Boolean),_0x7036cb=_0x36c030['at'](-0x1)??'';if(!_0x7036cb)throw new Error(_0x36e4c4(0x2bd)+_0x36e4c4(0x2c7)+_0x36e4c4(0x22c)+_0x17ab10);return _0x7036cb;}async function resolvePluginIdFromPackageDir(_0x411586,_0x50ff6e){const _0x23d93f=_0x4cb8b3,_0x2b34d8=await readJson(join(_0x411586,_0x23d93f(0x225)+_0x23d93f(0x1a8)),{}),_0x59a939=await readPluginManifest(_0x411586),_0x55fda2=[_0x59a939?.['id'],_0x59a939?.[_0x23d93f(0x3e9)],_0x59a939?.[_0x23d93f(0x388)],_0x2b34d8?.[_0x23d93f(0x33d)]?.['id'],_0x2b34d8?.[_0x23d93f(0x33d)+'Id'],_0x50ff6e],_0x155531=_0x55fda2[_0x23d93f(0x382)](_0x925522=>typeof _0x925522==='string'&&_0x925522[_0x23d93f(0x396)]());if(!_0x155531)throw new Error(_0x23d93f(0x3bc)+_0x23d93f(0x20c)+_0x23d93f(0x2fa)+_0x23d93f(0x357)+'\x20'+_0x411586);return _0x155531[_0x23d93f(0x396)]();}function pluginSpecMatches(_0x2bf9e9,_0x186d50){const _0x258aae=_0x4cb8b3,_0x5cf0cb=_0x186d50[_0x258aae(0x396)](),_0xe40be4=resolvePackageNameFromNpmSpec(_0x5cf0cb);return[_0x2bf9e9['spec'],_0x2bf9e9[_0x258aae(0x264)+_0x258aae(0x391)],_0x2bf9e9[_0x258aae(0x264)+_0x258aae(0x320)]]['some'](_0x22a93b=>_0x22a93b===_0x5cf0cb||_0x22a93b===_0xe40be4);}async function installPluginFromNpmSpec(_0x1340d2,_0x1859cf,_0x2bb3e7={}){const _0x149425=_0x4cb8b3,_0x17ac19=_0x1340d2['trim']()['replace'](/^npm:/,''),_0x3ddab9=resolvePluginDirNameFromSpec(_0x17ac19),_0xbd374e=join(_0x1859cf[_0x149425(0x33d)+_0x149425(0x1ad)+'ir'],_0x149425(0x384),_0x149425(0x1fc)+'ns'),_0x2317aa=join(_0xbd374e,_0x3ddab9),_0x483f74=join(_0x1859cf['runtimeR'+_0x149425(0x32a)],_0x149425(0x26d)+'extract-'+process[_0x149425(0x27c)]+'-'+Date[_0x149425(0x366)]()),_0x3cb7b6=await createRuntimeEnv(_0x1859cf),_0xc6cd54=new Date()[_0x149425(0x174)+_0x149425(0x196)](),_0x30c83c=join(_0x1859cf[_0x149425(0x1c2)+_0x149425(0x32a)],_0x149425(0x2d5));await mkdir(_0x30c83c,{'recursive':!![]}),await rm(_0x483f74,{'recursive':!![],'force':!![]}),await rm(_0x2317aa,{'recursive':!![],'force':!![]}),await mkdir(_0x483f74,{'recursive':!![]}),await mkdir(_0xbd374e,{'recursive':!![]}),console['log']('[wujie-s'+'hell:run'+_0x149425(0x353)+_0x149425(0x184)+'lugin\x20'+_0x17ac19);const _0x438d43=await runProcess(_0x1859cf['nodeExec'+'utable'],[_0x1859cf[_0x149425(0x2f2)],_0x149425(0x310),_0x17ac19,_0x149425(0x274)],{'cwd':_0x30c83c,'env':_0x3cb7b6,'label':_0x149425(0x406)+'\x20'+_0x17ac19}),_0x21657b=parseNpmPackJson(_0x438d43[_0x149425(0x33e)]),_0x9c674c=normalizePackedTarballFilename(_0x21657b[_0x149425(0x3ef)]),_0x2e0143=join(_0x30c83c,_0x9c674c);if(!existsSync(_0x2e0143))throw new Error(_0x149425(0x406)+_0x149425(0x24a)+_0x149425(0x405)+_0x149425(0x2c2)+'\x20'+_0x2e0143);await runProcess(_0x149425(0x2b9),['-xzf',_0x2e0143,'-C',_0x483f74],{'label':'extract\x20'+_0x9c674c}),await rename(join(_0x483f74,'package'),_0x2317aa),await rm(_0x483f74,{'recursive':!![],'force':!![]});const _0x2c41ec=join(_0x2317aa,'package.'+_0x149425(0x1a8)),_0x31250c=await readJson(_0x2c41ec,{});(_0x31250c['devDepen'+_0x149425(0x363)]||_0x31250c['scripts'])&&(delete _0x31250c[_0x149425(0x2ef)+_0x149425(0x363)],delete _0x31250c[_0x149425(0x26b)],await writeJson(_0x2c41ec,_0x31250c));await runProcess(_0x1859cf[_0x149425(0x2cd)+'utable'],[_0x1859cf[_0x149425(0x2f2)],'install',_0x149425(0x398)+'ev','--omit=p'+_0x149425(0x3cd),'--no-aud'+'it','--no-fun'+'d',_0x149425(0x1b2)+_0x149425(0x319)+'ps'],{'cwd':_0x2317aa,'env':_0x3cb7b6,'label':_0x149425(0x328)+_0x149425(0x3d9)+'in\x20'+_0x17ac19});const _0x584b98=new Date()['toISOStr'+_0x149425(0x196)](),_0x35ea74=await resolvePluginIdFromPackageDir(_0x2317aa,_0x21657b[_0x149425(0x388)]);return _0x2bb3e7[_0x149425(0x2de)+'ogger']?.[_0x149425(0x189)](_0x149425(0x31e)+_0x149425(0x207)+_0x149425(0x370),{'spec':_0x17ac19,'pluginId':_0x35ea74,'installPath':_0x2317aa}),{'pluginId':_0x35ea74,'source':_0x149425(0x1e3),'spec':_0x17ac19,'installPath':toRuntimeRelative(_0x1859cf[_0x149425(0x1c2)+_0x149425(0x32a)],_0x2317aa),'version':_0x21657b[_0x149425(0x3f2)],'resolvedName':_0x21657b['name'],'resolvedVersion':_0x21657b[_0x149425(0x3f2)],'resolvedSpec':_0x21657b[_0x149425(0x388)]+'@'+_0x21657b[_0x149425(0x3f2)],'integrity':typeof _0x21657b['integrit'+'y']===_0x149425(0x226)?_0x21657b['integrit'+'y']:'','shasum':typeof _0x21657b[_0x149425(0x3d2)]==='string'?_0x21657b[_0x149425(0x3d2)]:'','resolvedAt':_0xc6cd54,'installedAt':_0x584b98};}async function syncConfiguredNpmPlugins(_0x52ffe6,_0xb82933,_0x221d3c,_0x454360={}){const _0x5098ad=_0x4cb8b3;if(_0x454360[_0x5098ad(0x1db)])return;const _0x5e2272=createRuntimeInfoFromManifest(_0xb82933,_0x221d3c),_0x39a655=Array[_0x5098ad(0x1a6)](_0x221d3c[_0x5098ad(0x2c9)])?_0x221d3c[_0x5098ad(0x2c9)]:[],_0x3618e8=[];for(const _0x1eee0c of _0x52ffe6['openclaw'][_0x5098ad(0x294)+_0x5098ad(0x37e)]){const _0x56f84a=_0x39a655[_0x5098ad(0x382)](_0x2d27c1=>_0x2d27c1?.[_0x5098ad(0x267)]===_0x5098ad(0x1e3)&&pluginSpecMatches(_0x2d27c1,_0x1eee0c)&&typeof _0x2d27c1[_0x5098ad(0x1c1)+_0x5098ad(0x362)]===_0x5098ad(0x226)&&existsSync(resolve(_0xb82933,_0x2d27c1['installP'+_0x5098ad(0x362)])));if(_0x56f84a){_0x3618e8[_0x5098ad(0x211)](_0x56f84a);continue;}_0x3618e8[_0x5098ad(0x211)](await installPluginFromNpmSpec(_0x1eee0c,_0x5e2272,_0x454360));}const _0x8408d9=new Set(_0x52ffe6[_0x5098ad(0x33d)][_0x5098ad(0x294)+_0x5098ad(0x37e)]['map'](resolvePackageNameFromNpmSpec)),_0x3b7103=_0x39a655[_0x5098ad(0x249)](_0xee7b72=>_0xee7b72?.['source']!==_0x5098ad(0x1e3)||!_0x8408d9[_0x5098ad(0x3e5)](resolvePackageNameFromNpmSpec(_0xee7b72['resolved'+_0x5098ad(0x320)]||_0xee7b72['spec']||'')));_0x221d3c[_0x5098ad(0x2c9)]=[..._0x3b7103,..._0x3618e8];}function hasRuntimeDependencies(_0x511137){const _0x4bf358=_0x4cb8b3,_0x27ffca=_0x511137?.[_0x4bf358(0x244)+'cies']&&typeof _0x511137[_0x4bf358(0x244)+_0x4bf358(0x36e)]===_0x4bf358(0x38c)?Object['keys'](_0x511137[_0x4bf358(0x244)+_0x4bf358(0x36e)]):[],_0x183293=_0x511137?.[_0x4bf358(0x266)+_0x4bf358(0x380)+_0x4bf358(0x36e)]&&typeof _0x511137[_0x4bf358(0x266)+_0x4bf358(0x380)+_0x4bf358(0x36e)]===_0x4bf358(0x38c)?Object[_0x4bf358(0x3dc)](_0x511137['optional'+_0x4bf358(0x380)+_0x4bf358(0x36e)]):[];return _0x27ffca[_0x4bf358(0x23b)]>0x0||_0x183293[_0x4bf358(0x23b)]>0x0;}async function installLocalPluginRuntimeDependencies(_0x5eb99c,_0x81396c,_0x4e3c29){const _0x982704=_0x4cb8b3,_0x56af84=join(_0x5eb99c,'package.'+_0x982704(0x1a8)),_0x587339=await readJson(_0x56af84,{});(_0x587339[_0x982704(0x2ef)+'dencies']||_0x587339[_0x982704(0x26b)])&&(delete _0x587339[_0x982704(0x2ef)+_0x982704(0x363)],delete _0x587339[_0x982704(0x26b)],await writeJson(_0x56af84,_0x587339));if(!hasRuntimeDependencies(_0x587339))return;const _0x1fa555=await createRuntimeEnv(_0x81396c);console['log']('[wujie-s'+'hell:run'+_0x982704(0x302)+'stalling'+_0x982704(0x18f)+'lugin\x20de'+_0x982704(0x27b)+'es\x20'+_0x5eb99c),await runProcess(_0x81396c['nodeExec'+'utable'],[_0x81396c[_0x982704(0x2f2)],'install',_0x982704(0x398)+'ev',_0x982704(0x324)+_0x982704(0x3cd),'--no-aud'+'it','--no-fun'+'d',_0x982704(0x1b2)+_0x982704(0x319)+'ps'],{'cwd':_0x5eb99c,'env':_0x1fa555,'label':_0x982704(0x328)+_0x982704(0x346)+'l\x20plugin'+'\x20'+_0x5eb99c}),_0x4e3c29[_0x982704(0x2de)+_0x982704(0x304)]?.['info'](_0x982704(0x3bd)+_0x982704(0x385)+_0x982704(0x181)+'s\x20instal'+_0x982704(0x2f5),{'installPath':_0x5eb99c});}async function syncSharedPluginModules(_0x49c4df,_0xc8bd02){const _0x550a20=_0x4cb8b3,_0x5a4617=new Set();for(const _0x54fdef of _0x49c4df){const _0x1e7134=join(dirname(_0x54fdef),_0x550a20(0x3a1));if(existsSync(_0x1e7134))_0x5a4617[_0x550a20(0x3ad)](_0x1e7134);}for(const _0x326a8e of _0x5a4617){await copyDirFresh(_0x326a8e,join(_0xc8bd02,_0x550a20(0x3a1)));}}async function syncProductPlugins(_0x5336f2,_0x5119e4,_0x164c3e,_0x3511ba={}){const _0x1205af=_0x4cb8b3,_0x54119b=join(_0x5119e4,_0x1205af(0x33d),_0x1205af(0x384),_0x1205af(0x1fc)+'ns'),_0x56adca=createRuntimeInfoFromManifest(_0x5119e4,_0x164c3e),_0x54f741=[];await syncSharedPluginModules(_0x5336f2[_0x1205af(0x33d)][_0x1205af(0x264)+_0x1205af(0x23d)+_0x1205af(0x3bb)],_0x54119b);for(const _0x597fbe of _0x5336f2[_0x1205af(0x33d)][_0x1205af(0x264)+_0x1205af(0x23d)+_0x1205af(0x3bb)]){const _0x42952a=await getPackageMetadata(_0x597fbe),_0x5e9664=await readPluginManifest(_0x597fbe),_0x200434=join(_0x54119b,_0x42952a[_0x1205af(0x3e9)]);await copyDirFresh(_0x597fbe,_0x200434),await installLocalPluginRuntimeDependencies(_0x200434,_0x56adca,_0x3511ba),_0x54f741['push']({'pluginId':_0x42952a['pluginId'],'source':'local','spec':_0x1205af(0x345)+_0x597fbe,'installPath':toRuntimeRelative(_0x5119e4,_0x200434),'version':_0x42952a['version'],'resolvedName':_0x42952a[_0x1205af(0x388)],'resolvedVersion':_0x42952a['version'],'resolvedSpec':_0x1205af(0x345)+_0x597fbe,'integrity':'','shasum':'','resolvedAt':new Date()[_0x1205af(0x174)+'ing'](),'installedAt':new Date()[_0x1205af(0x174)+_0x1205af(0x196)](),'agentScope':_0x5e9664[_0x1205af(0x2ac)+'pe'],'skills':_0x5e9664['skills']});}const _0x87448e=new Set(_0x54f741['map'](_0x2065b2=>_0x2065b2[_0x1205af(0x3e9)])),_0x1d3e80=Array['isArray'](_0x164c3e[_0x1205af(0x2c9)])?_0x164c3e[_0x1205af(0x2c9)][_0x1205af(0x249)](_0x2b38ce=>!_0x87448e['has'](_0x2b38ce[_0x1205af(0x3e9)])):[];_0x164c3e['plugins']=[..._0x1d3e80,..._0x54f741];}async function syncManifestPluginScope(_0x17f71d,_0xd56829,_0x2bfd1b){const _0x318a8e=_0x4cb8b3,_0x1ba42c=join(_0xd56829,'openclaw',_0x318a8e(0x384),'extensio'+'ns'),_0x3fc3d1=new Set(_0x17f71d[_0x318a8e(0x33d)]['pluginSp'+_0x318a8e(0x37e)]??[]),_0x4e1045=new Set([..._0x3fc3d1][_0x318a8e(0x3d4)](_0x491298=>_0x491298['replace'](/^npm:/,''))['map'](_0x44a652=>{const _0x4ffa3d=_0x318a8e;if(_0x44a652['startsWi'+'th']('@')){const _0x5c721a=_0x44a652[_0x4ffa3d(0x18e)]('@');return _0x5c721a[_0x4ffa3d(0x23b)]>=0x3?'@'+_0x5c721a[0x1]:_0x44a652;}return _0x44a652[_0x4ffa3d(0x18e)]('@')[0x0];})[_0x318a8e(0x249)](Boolean)),_0x598ed4=new Set();for(const _0x44618f of _0x17f71d[_0x318a8e(0x33d)]['resolved'+_0x318a8e(0x23d)+_0x318a8e(0x3bb)]){const _0x4a0f7e=await getPackageMetadata(_0x44618f);if(_0x4a0f7e[_0x318a8e(0x3e9)])_0x598ed4['add'](_0x4a0f7e[_0x318a8e(0x3e9)]);}const _0x4dd3f4=Array[_0x318a8e(0x1a6)](_0x2bfd1b[_0x318a8e(0x2c9)])?_0x2bfd1b[_0x318a8e(0x2c9)]:[];_0x2bfd1b[_0x318a8e(0x294)+'ecs']=[..._0x17f71d[_0x318a8e(0x33d)][_0x318a8e(0x294)+_0x318a8e(0x37e)],..._0x17f71d[_0x318a8e(0x33d)][_0x318a8e(0x264)+_0x318a8e(0x23d)+_0x318a8e(0x3bb)][_0x318a8e(0x3d4)](_0x4a5073=>_0x318a8e(0x345)+_0x4a5073)],_0x2bfd1b[_0x318a8e(0x2c9)]=_0x4dd3f4['filter'](_0x45cb04=>{const _0x1e2d69=_0x318a8e;if(!_0x45cb04||typeof _0x45cb04!==_0x1e2d69(0x38c))return![];if(_0x45cb04[_0x1e2d69(0x267)]===_0x1e2d69(0x163))return _0x598ed4['has'](_0x45cb04[_0x1e2d69(0x3e9)]);if(_0x45cb04[_0x1e2d69(0x267)]==='npm')return _0x3fc3d1[_0x1e2d69(0x3e5)](_0x45cb04['spec'])||_0x3fc3d1[_0x1e2d69(0x3e5)](_0x45cb04[_0x1e2d69(0x264)+_0x1e2d69(0x391)])||_0x4e1045['has'](_0x45cb04[_0x1e2d69(0x264)+_0x1e2d69(0x320)]);return![];});const _0x2e790a=new Set(_0x2bfd1b['plugins'][_0x318a8e(0x3d4)](_0x26c2cc=>_0x26c2cc[_0x318a8e(0x3e9)]));for(const _0x51ab1e of _0x4dd3f4){if(!_0x51ab1e[_0x318a8e(0x3e9)]||_0x2e790a['has'](_0x51ab1e['pluginId']))continue;const _0x6cfdb4=typeof _0x51ab1e[_0x318a8e(0x1c1)+_0x318a8e(0x362)]==='string'&&_0x51ab1e[_0x318a8e(0x1c1)+'ath'][_0x318a8e(0x396)]()?resolve(_0xd56829,_0x51ab1e[_0x318a8e(0x1c1)+_0x318a8e(0x362)]):join(_0x1ba42c,_0x51ab1e[_0x318a8e(0x3e9)]),_0x3cec21=relative(_0x1ba42c,_0x6cfdb4);if(_0x3cec21[_0x318a8e(0x2e0)+'th']('..')||_0x3cec21==='')continue;await rm(_0x6cfdb4,{'recursive':!![],'force':!![]});}}async function collectCapabilityEntries(_0x16ea8d,_0x4a085b){const _0x364f57=_0x4cb8b3,_0x16099f=new Map();for(const _0x39b30e of _0x16ea8d){let _0x2faead;try{_0x2faead=await stat(_0x39b30e);}catch{throw new Error(_0x4a085b+('\x20path\x20wa'+_0x364f57(0x270)+_0x364f57(0x1a1))+_0x39b30e);}if(!_0x2faead[_0x364f57(0x2dd)+_0x364f57(0x273)]())throw new Error(_0x4a085b+('\x20path\x20mu'+_0x364f57(0x17f)+_0x364f57(0x21a)+_0x364f57(0x2e8))+_0x39b30e);const _0x13f5db={'name':basename(_0x39b30e),'path':_0x39b30e},_0x38a6ed=_0x16099f['get'](_0x13f5db[_0x364f57(0x388)]);if(_0x38a6ed)throw new Error(_0x364f57(0x1d9)+'e\x20'+_0x4a085b+'\x20entry\x20\x22'+_0x13f5db[_0x364f57(0x388)]+_0x364f57(0x19b)+_0x38a6ed['path']+_0x364f57(0x2e1)+_0x13f5db['path']);_0x16099f['set'](_0x13f5db[_0x364f57(0x388)],_0x13f5db);}return[..._0x16099f[_0x364f57(0x2ed)]()];}async function syncProductCapabilityDirs(_0x3fb958,_0x409cea,_0x1eeb53){const _0x508c81=_0x4cb8b3,_0x29bc68=await collectCapabilityEntries(_0x3fb958,_0x1eeb53);await rm(_0x409cea,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await mkdir(_0x409cea,{'recursive':!![]});for(const _0x4366d2 of _0x29bc68){await cp(_0x4366d2[_0x508c81(0x402)],join(_0x409cea,_0x4366d2[_0x508c81(0x388)]),{'recursive':!![]});}return _0x29bc68[_0x508c81(0x23b)];}export const __test__={'collectCapabilityEntries':collectCapabilityEntries,'prunePackagedRuntimePayload':prunePackagedRuntimePayload,'syncProductCapabilityDirs':syncProductCapabilityDirs,'resolveNodeExtractRoot':resolveNodeExtractRoot};async function syncProductAgents(_0x249256,_0x106dbd,_0x3a0dd1){const _0x33d7bd=_0x4cb8b3,_0x6b95d2=join(_0x106dbd,_0x33d7bd(0x33d),_0x33d7bd(0x3a4)),_0x3c4a07=await syncProductCapabilityDirs(_0x249256[_0x33d7bd(0x33d)][_0x33d7bd(0x264)+'LocalAge'+'ntPaths'],_0x6b95d2,_0x33d7bd(0x1a0));_0x3a0dd1[_0x33d7bd(0x3a4)]={'source':_0x33d7bd(0x18c),'installPath':toRuntimeRelative(_0x106dbd,_0x6b95d2),'localPaths':_0x249256[_0x33d7bd(0x33d)]['resolved'+'LocalAge'+_0x33d7bd(0x15c)],'entryCount':_0x3c4a07};}async function syncProductSkills(_0x12a3a9,_0x146ea0,_0x3be411){const _0x19445c=_0x4cb8b3,_0xa732d7=join(_0x146ea0,_0x19445c(0x33d),_0x19445c(0x389)),_0x3d133f=await syncProductCapabilityDirs(_0x12a3a9[_0x19445c(0x33d)]['resolved'+_0x19445c(0x2c0)+_0x19445c(0x221)],_0xa732d7,_0x19445c(0x17c));_0x3be411[_0x19445c(0x389)]={'source':_0x19445c(0x18c),'installPath':toRuntimeRelative(_0x146ea0,_0xa732d7),'localPaths':_0x12a3a9['openclaw'][_0x19445c(0x264)+_0x19445c(0x2c0)+_0x19445c(0x221)],'entryCount':_0x3d133f};}
|
|
1
|
+
const _0x31e6db=_0x3914;(function(_0x4ab917,_0x386a73){const _0x4c64e1=_0x3914,_0x3f2df2=_0x4ab917();while(!![]){try{const _0x15d87f=parseInt(_0x4c64e1(0x1ba))/0x1*(-parseInt(_0x4c64e1(0x1a3))/0x2)+parseInt(_0x4c64e1(0xab))/0x3*(-parseInt(_0x4c64e1(0x119))/0x4)+parseInt(_0x4c64e1(0x16a))/0x5*(-parseInt(_0x4c64e1(0x1f8))/0x6)+-parseInt(_0x4c64e1(0xbf))/0x7*(-parseInt(_0x4c64e1(0x143))/0x8)+parseInt(_0x4c64e1(0x1e8))/0x9+parseInt(_0x4c64e1(0x258))/0xa*(-parseInt(_0x4c64e1(0x1f6))/0xb)+parseInt(_0x4c64e1(0x30a))/0xc*(parseInt(_0x4c64e1(0x1cb))/0xd);if(_0x15d87f===_0x386a73)break;else _0x3f2df2['push'](_0x3f2df2['shift']());}catch(_0x99354b){_0x3f2df2['push'](_0x3f2df2['shift']());}}}(_0x5a9f,0x7aa3c));import{existsSync}from'node:fs';import{createWriteStream}from'node:fs';import{chmod,cp,mkdir,readFile,readdir,rename,rm,stat,symlink,writeFile}from'node:fs/promises';import{basename,delimiter,dirname,join,extname,parse,relative,resolve}from'node:path';import{fileURLToPath,pathToFileURL}from'node:url';import{spawn}from'node:child_process';import{get}from'node:https';import{pipeline}from'node:stream/promises';import{getConfigPaths}from'@wujie-shell/config';import{copyDirFresh,getPackageMetadata,readJson,readPluginManifest,toRuntimeRelative,writeJson}from'../common/utils.mjs';import{createRuntimeLogger,summarizeRuntimeManifest,summarizeShellConfig}from'../common/runtime-logger.mjs';import{hasConfiguredKdocsSkill,installKdocsCliBinary}from'../connectors/kdocs-cli.mjs';import{installRuntimeLarkCliPackage,resolveRuntimeLarkCliCommand}from'../connectors/lark-cli.mjs';import{patchMixedToolContentFromSource}from'./patch-chat-history-mixed-tool-content.mjs';import{patchChatAttachmentBase64FromSource}from'./patch-chat-attachment-base64.mjs';import{patchChannelPluginRuntimeFromSource}from'./patch-channel-plugin-runtime.mjs';import{patchProviderRequestIdHeaderFromSource}from'./patch-provider-request-id-header.mjs';import{patchCodexIsolatedAuthFromSource}from'./patch-codex-isolated-auth.mjs';import{patchSessionStoreLoadFromSource,patchSessionStoreWriteFromSource}from'./patch-session-store-sqlite.mjs';import{patchQQBotOutboundFallbackFromSource,patchQQBotOutboundSessionRouteFromSource}from'./patch-qqbot-outbound-session-route.mjs';import{patchWeixinOutboundFallbackFromSource,patchWeixinOutboundSessionRouteFromSource}from'./patch-weixin-outbound-session-route.mjs';import{patchRequestIdTitleRuntimeFromSource}from'./patch-request-id-title-runtime.mjs';const RUNTIME_DIR=_0x31e6db(0x21d)+_0x31e6db(0x1dc),MANIFEST_NAME='runtime-'+'manifest'+_0x31e6db(0x120),NPM_INSTALL_TIMEOUT_MS=0xf*0x3c*0x3e8;export function resolveRuntimeRoot(_0x12c8c8){if(process.env.WUJIE_SHELL_RUNTIME_ROOT)return resolve(process.env.WUJIE_SHELL_RUNTIME_ROOT);return resolve(_0x12c8c8,RUNTIME_DIR);}export function resolveManifestPath(_0x256d3c){return join(_0x256d3c,MANIFEST_NAME);}async function loadProductRuntime(_0x410347,_0x3a2d55){const _0x535deb=_0x31e6db,_0x13129f=[join(_0x410347,_0x535deb(0x22e)+'ntime',_0x535deb(0x328)+'s'),join(_0x3a2d55,_0x535deb(0x22e)+'ntime',_0x535deb(0x328)+'s')];for(const _0x1f1cea of _0x13129f){if(!existsSync(_0x1f1cea))continue;return await import(pathToFileURL(_0x1f1cea)[_0x535deb(0xe6)]+_0x535deb(0xb3)+Date[_0x535deb(0x32a)]());}return{};}export async function prepareRuntime(_0x4d98c7,{syncOnly:syncOnly=![],pruneForPackaging:pruneForPackaging=![]}={}){const _0x3e0eea=_0x31e6db,_0x3d65c2=resolveRuntimeRoot(_0x4d98c7[_0x3e0eea(0x18c)+_0x3e0eea(0xa4)]),_0xc9c5e4=createRuntimeLogger(getConfigPaths(_0x4d98c7),'runtime'),_0x17789c=Date[_0x3e0eea(0x32a)]();_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.(_0x3e0eea(0x2a9)+_0x3e0eea(0x20e)+_0x3e0eea(0x259),{'syncOnly':syncOnly,'runtimeRoot':_0x3d65c2,'shellConfig':summarizeShellConfig(_0x4d98c7)});try{const _0x3f3b02=await ensureRuntimeBase(_0x4d98c7,_0x3d65c2,{'runtimeLogger':_0xc9c5e4,'syncOnly':syncOnly});_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.(_0x3e0eea(0x20e)+_0x3e0eea(0x2b3)+_0x3e0eea(0x149),{'manifestPath':resolveManifestPath(_0x3d65c2),'manifest':summarizeRuntimeManifest(_0x3f3b02)}),validateRuntimeNodeVersion(_0x3f3b02,_0x4d98c7),_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.(_0x3e0eea(0x20e)+_0x3e0eea(0xe9)+_0x3e0eea(0x2e3)+_0x3e0eea(0x18d),{'nodeVersion':_0x3f3b02[_0x3e0eea(0x22f)+_0x3e0eea(0x26d)]});if(syncOnly)validateRuntimeOpenClawVersion(_0x3f3b02,_0x4d98c7),_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.(_0x3e0eea(0x20e)+_0x3e0eea(0x2f4)+_0x3e0eea(0xb6)+_0x3e0eea(0x203)+'ed',{'openclawVersion':_0x3f3b02[_0x3e0eea(0x2f4)+_0x3e0eea(0x99)]});else{if(_0x3f3b02[_0x3e0eea(0x2f4)+_0x3e0eea(0x99)]!==_0x4d98c7[_0x3e0eea(0x2f4)]['openclaw'+_0x3e0eea(0x99)]){const _0x162f30=await loadRuntimeInfo(_0x4d98c7[_0x3e0eea(0x18c)+_0x3e0eea(0xa4)]);_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.(_0x3e0eea(0x2f4)+'\x20package'+'\x20install'+_0x3e0eea(0x255),{'fromVersion':_0x3f3b02[_0x3e0eea(0x2f4)+_0x3e0eea(0x99)]||'unknown','toVersion':_0x4d98c7[_0x3e0eea(0x2f4)][_0x3e0eea(0x2f4)+_0x3e0eea(0x99)]}),await installOpenClawPackage(_0x162f30,_0x4d98c7['openclaw'][_0x3e0eea(0x2f4)+_0x3e0eea(0x99)]),_0x3f3b02[_0x3e0eea(0x2f4)+_0x3e0eea(0x99)]=_0x4d98c7[_0x3e0eea(0x2f4)][_0x3e0eea(0x2f4)+_0x3e0eea(0x99)],_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.(_0x3e0eea(0x2f4)+_0x3e0eea(0x80)+'\x20install'+_0x3e0eea(0x107)+'ed',{'openclawVersion':_0x3f3b02[_0x3e0eea(0x2f4)+_0x3e0eea(0x99)]});}}_0x3f3b02[_0x3e0eea(0x176)+_0x3e0eea(0x82)]=new Date()['toISOStr'+_0x3e0eea(0x15b)](),_0x3f3b02[_0x3e0eea(0x22f)+_0x3e0eea(0x26d)]=_0x4d98c7[_0x3e0eea(0x2f4)][_0x3e0eea(0x22f)+_0x3e0eea(0x26d)],_0x3f3b02['product']={'appId':_0x4d98c7[_0x3e0eea(0x1c9)],'productName':_0x4d98c7[_0x3e0eea(0x1fe)+_0x3e0eea(0x333)],'dataDirName':_0x4d98c7[_0x3e0eea(0x2fc)+_0x3e0eea(0x333)]},await patchChatHistoryMixedToolContentBug(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),await patchChatAttachmentBase64Runtime(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),await patchProviderRequestIdHeader(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),await patchCodexIsolatedAuthRuntime(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),await patchChannelPluginRuntimeBug(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),await patchWeixinOutboundFallbackRuntime(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),await patchQQBotOutboundFallbackRuntime(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4});const _0x12f8de=await loadProductRuntime(_0x4d98c7[_0x3e0eea(0x18c)+_0x3e0eea(0xa4)],_0x3d65c2);if(typeof _0x12f8de['prepareP'+_0x3e0eea(0x32d)+_0x3e0eea(0x254)]===_0x3e0eea(0x12d)){const _0x28fcb5=createRuntimeInfoFromManifest(_0x3d65c2,_0x3f3b02);await _0x12f8de[_0x3e0eea(0x249)+_0x3e0eea(0x32d)+_0x3e0eea(0x254)]({'shellConfig':_0x4d98c7,'runtime':_0x28fcb5,'runtimeLogger':_0xc9c5e4,'syncOnly':syncOnly}),_0xc9c5e4?.['importan'+'t']?.(_0x3e0eea(0x2ee)+'runtime\x20'+'tools\x20sy'+_0x3e0eea(0x123));}await patchSessionStoreSqliteRuntime(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),await patchRequestIdTitleRuntime(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4});!syncOnly&&(await installRuntimeLarkCliPackage(createRuntimeInfoFromManifest(_0x3d65c2,_0x3f3b02),{'runtimeLogger':_0xc9c5e4,'createRuntimeEnv':createRuntimeEnv}),_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.(_0x3e0eea(0x1b4)+_0x3e0eea(0x216)+_0x3e0eea(0x80)+_0x3e0eea(0x1b0)),await hasConfiguredKdocsSkill(_0x4d98c7)?(await installKdocsCliBinary(_0x4d98c7,createRuntimeInfoFromManifest(_0x3d65c2,_0x3f3b02),{'runtimeLogger':_0xc9c5e4,'syncOnly':syncOnly}),_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.(_0x3e0eea(0xbe)+'r\x20runtim'+_0x3e0eea(0x209)+_0x3e0eea(0x183))):_0xc9c5e4?.[_0x3e0eea(0x2da)](_0x3e0eea(0xbe)+_0x3e0eea(0x218)+'e\x20tools\x20'+_0x3e0eea(0x26c)+_0x3e0eea(0x11d)+_0x3e0eea(0x1d8)+_0x3e0eea(0x292)+_0x3e0eea(0x2fe)));const _0x2418b3=Array[_0x3e0eea(0x1e3)](_0x3f3b02[_0x3e0eea(0xec)])?_0x3f3b02['plugins'][_0x3e0eea(0x118)]:0x0;return await syncManifestPluginScope(_0x4d98c7,_0x3d65c2,_0x3f3b02),_0xc9c5e4?.['importan'+'t']?.('runtime\x20'+'plugin\x20s'+_0x3e0eea(0x157)+_0x3e0eea(0xc6),{'beforePluginCount':_0x2418b3,'afterPluginCount':Array['isArray'](_0x3f3b02['plugins'])?_0x3f3b02[_0x3e0eea(0xec)][_0x3e0eea(0x118)]:0x0,'pluginSpecCount':Array[_0x3e0eea(0x1e3)](_0x3f3b02[_0x3e0eea(0x27b)+_0x3e0eea(0x2ff)])?_0x3f3b02[_0x3e0eea(0x27b)+_0x3e0eea(0x2ff)][_0x3e0eea(0x118)]:0x0}),await syncConfiguredNpmPlugins(_0x4d98c7,_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4,'syncOnly':syncOnly}),_0xc9c5e4?.['importan'+'t']?.(_0x3e0eea(0x25e)+_0x3e0eea(0x2d6)+_0x3e0eea(0x137)+_0x3e0eea(0x232),{'pluginSpecCount':_0x4d98c7[_0x3e0eea(0x2f4)][_0x3e0eea(0x27b)+'ecs'][_0x3e0eea(0x118)],'pluginCount':Array['isArray'](_0x3f3b02[_0x3e0eea(0xec)])?_0x3f3b02[_0x3e0eea(0xec)][_0x3e0eea(0x118)]:0x0}),await patchWeixinOutboundSessionRoute(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),await patchQQBotOutboundSessionRoute(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),await syncProductPlugins(_0x4d98c7,_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.(_0x3e0eea(0x2ee)+_0x3e0eea(0x20d)+_0x3e0eea(0x183),{'localPluginCount':_0x4d98c7[_0x3e0eea(0x2f4)][_0x3e0eea(0x33b)+_0x3e0eea(0x84)+_0x3e0eea(0x138)]['length'],'pluginCount':Array[_0x3e0eea(0x1e3)](_0x3f3b02[_0x3e0eea(0xec)])?_0x3f3b02[_0x3e0eea(0xec)][_0x3e0eea(0x118)]:0x0}),await syncProductAgents(_0x4d98c7,_0x3d65c2,_0x3f3b02),_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.('product\x20'+_0x3e0eea(0x2e2)+_0x3e0eea(0x232),{'sources':_0x4d98c7[_0x3e0eea(0x2f4)][_0x3e0eea(0x33b)+'LocalAge'+_0x3e0eea(0xd6)],'entryCount':_0x3f3b02['agents']?.['entryCou'+'nt'],'installPath':_0x3f3b02[_0x3e0eea(0x23f)]?.['installP'+_0x3e0eea(0x2ae)]}),await syncProductSkills(_0x4d98c7,_0x3d65c2,_0x3f3b02),_0xc9c5e4?.['importan'+'t']?.(_0x3e0eea(0x2ee)+_0x3e0eea(0x2aa)+'ynced',{'sources':_0x4d98c7['openclaw']['resolved'+_0x3e0eea(0xd2)+_0x3e0eea(0x1a4)],'entryCount':_0x3f3b02[_0x3e0eea(0x1fd)]?.[_0x3e0eea(0x246)+'nt'],'installPath':_0x3f3b02[_0x3e0eea(0x1fd)]?.[_0x3e0eea(0x207)+_0x3e0eea(0x2ae)]}),await syncRuntimeWrapper(_0x4d98c7,_0x3d65c2,_0x3f3b02),_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.('runtime\x20'+'wrapper\x20'+_0x3e0eea(0x183),{'wujieclawBin':_0x3f3b02[_0x3e0eea(0xda)+_0x3e0eea(0x158)]}),await prunePackagedRuntimeCaches(_0x3d65c2,_0xc9c5e4),pruneForPackaging&&await prunePackagedRuntimePayload(_0x3d65c2,_0x3f3b02,_0xc9c5e4),await writeJson(resolveManifestPath(_0x3d65c2),_0x3f3b02),_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.('runtime\x20'+_0x3e0eea(0x2b3)+'\x20written',{'manifestPath':resolveManifestPath(_0x3d65c2),'manifest':summarizeRuntimeManifest(_0x3f3b02),'durationMs':Date[_0x3e0eea(0x32a)]()-_0x17789c}),await _0xc9c5e4?.['flush'](),_0x3f3b02;}catch(_0x490aaf){_0xc9c5e4?.['error'](_0x3e0eea(0x2a9)+_0x3e0eea(0x20e)+'failed',{'syncOnly':syncOnly,'runtimeRoot':_0x3d65c2,'durationMs':Date['now']()-_0x17789c,'error':_0x490aaf}),await _0xc9c5e4?.[_0x3e0eea(0x108)]();throw _0x490aaf;}}async function prunePackagedRuntimeCaches(_0x1eefc8,_0x219bde){const _0x4b49e2=_0x31e6db,_0x4c644b=[join(_0x1eefc8,_0x4b49e2(0x163)),join(_0x1eefc8,_0x4b49e2(0x164),_0x4b49e2(0x277)+'e'),join(_0x1eefc8,_0x4b49e2(0x177)+_0x4b49e2(0x309)+_0x4b49e2(0x171)),join(_0x1eefc8,_0x4b49e2(0x150)+_0x4b49e2(0x1ae)+_0x4b49e2(0xee))];for(const _0x50e4bd of _0x4c644b){if(!existsSync(_0x50e4bd))continue;await rm(_0x50e4bd,{'recursive':!![],'force':!![]}),_0x219bde?.[_0x4b49e2(0x2da)](_0x4b49e2(0x12b)+_0x4b49e2(0x1f9)+_0x4b49e2(0x264)+_0x4b49e2(0x2bf)+'aging',{'cachePath':_0x50e4bd});}}async function prunePackagedRuntimePayload(_0x4c3cf6,_0x536093,_0x356d60){const _0x4fe24f=_0x31e6db,_0x215b61=createRuntimeInfoFromManifest(_0x4c3cf6,_0x536093),_0x5623c5=[join(_0x4c3cf6,process['platform']===_0x4fe24f(0x21a)?_0x4fe24f(0x278)+_0x4fe24f(0x307)+_0x4fe24f(0xa3):_0x4fe24f(0xa7)+_0x4fe24f(0x1af)+_0x4fe24f(0x161)+'m'),join(_0x215b61[_0x4fe24f(0x2f4)+_0x4fe24f(0x294)+'ir'],_0x4fe24f(0xcf)+'ules')],_0x5860eb=join(_0x215b61['openclaw'+_0x4fe24f(0x294)+'ir'],_0x4fe24f(0xc7),'extensio'+'ns');if(existsSync(_0x5860eb))for(const _0x4fbc2a of await readdir(_0x5860eb,{'withFileTypes':!![]})){_0x4fbc2a[_0x4fe24f(0xe0)+'ory']()&&_0x5623c5['push'](join(_0x5860eb,_0x4fbc2a[_0x4fe24f(0x22a)],'node_mod'+_0x4fe24f(0x2af)));}const _0x86261d={'files':0x0,'directories':0x0,'bytes':0x0};for(const _0xd65e0a of _0x5623c5){await pruneRuntimeDependencyTree(_0xd65e0a,_0x86261d);}await pruneOpenClawDocs(_0x215b61['openclaw'+_0x4fe24f(0x294)+'ir'],_0x86261d),_0x356d60?.[_0x4fe24f(0x2da)]('pruned\x20r'+'untime\x20p'+_0x4fe24f(0x140)+_0x4fe24f(0x331)+'ckaging',_0x86261d);}async function pruneOpenClawDocs(_0x31be73,_0xd7c3f4){const _0x37d6fd=_0x31e6db,_0x2c484c=join(_0x31be73,_0x37d6fd(0x238));if(!existsSync(_0x2c484c))return;for(const _0x128836 of await readdir(_0x2c484c,{'withFileTypes':!![]})){if(_0x128836[_0x37d6fd(0x22a)]===_0x37d6fd(0x250)+'e')continue;await removePrunedPath(join(_0x2c484c,_0x128836['name']),_0xd7c3f4);}}async function pruneRuntimeDependencyTree(_0x520d63,_0x554e60){const _0x349269=_0x31e6db;if(!existsSync(_0x520d63))return;for(const _0x548d40 of await readdir(_0x520d63,{'withFileTypes':!![]})){const _0x4f99a0=join(_0x520d63,_0x548d40['name']);if(_0x548d40[_0x349269(0xe0)+'ory']()){if(shouldPruneRuntimeDirectory(_0x520d63,_0x548d40[_0x349269(0x22a)])){await removePrunedPath(_0x4f99a0,_0x554e60);continue;}await pruneRuntimeDependencyTree(_0x4f99a0,_0x554e60);continue;}_0x548d40[_0x349269(0x2e7)]()&&shouldPruneRuntimeFile(_0x548d40[_0x349269(0x22a)])&&await removePrunedPath(_0x4f99a0,_0x554e60);}}function shouldPruneRuntimeDirectory(_0x1f7fd9,_0x3f7c9e){const _0x53cd40=_0x31e6db;if(_0x3f7c9e==='@types')return!![];if(new Set([_0x53cd40(0x257),_0x53cd40(0x238),_0x53cd40(0x275)])[_0x53cd40(0x15f)](_0x3f7c9e))return existsSync(join(_0x1f7fd9,_0x53cd40(0x2b2)+'json'));return new Set([_0x53cd40(0x27e)+'_',_0x53cd40(0x1de),'examples',_0x53cd40(0x174),_0x53cd40(0x142)])[_0x53cd40(0x15f)](_0x3f7c9e);}function shouldPruneRuntimeFile(_0x409247){const _0xf38941=_0x31e6db;if(_0x409247==='package-'+_0xf38941(0x136)+'n'||_0x409247[_0xf38941(0x10c)](_0xf38941(0x17c)))return!![];return new Set(['.map','.md',_0xf38941(0x1d2)+'n'])[_0xf38941(0x15f)](extname(_0x409247)['toLowerC'+_0xf38941(0x284)]());}async function removePrunedPath(_0x39a621,_0x54e405){const _0x118382=_0x31e6db;if(!existsSync(_0x39a621))return;const _0x4df8a4=await getPathSize(_0x39a621),_0x10a051=await stat(_0x39a621);await rm(_0x39a621,{'recursive':!![],'force':!![]}),_0x54e405[_0x118382(0x1b7)]+=_0x4df8a4;if(_0x10a051[_0x118382(0xe0)+'ory']())_0x54e405[_0x118382(0xc9)+_0x118382(0x1c2)]+=0x1;else _0x54e405['files']+=0x1;}async function getPathSize(_0x3c04f6){const _0x3d14a2=_0x31e6db,_0x47bd6d=await stat(_0x3c04f6);if(!_0x47bd6d[_0x3d14a2(0xe0)+_0x3d14a2(0x306)]())return _0x47bd6d[_0x3d14a2(0x312)];let _0x450991=0x0;for(const _0x162043 of await readdir(_0x3c04f6,{'withFileTypes':!![]})){_0x450991+=await getPathSize(join(_0x3c04f6,_0x162043[_0x3d14a2(0x22a)]));}return _0x450991;}async function syncRuntimeWrapper(_0x4cd861,_0x100774,_0x3bacab){const _0x1390af=_0x31e6db,_0x4b1421=_0x4cd861[_0x1390af(0x2f4)]?.[_0x1390af(0xc8)+_0x1390af(0x2ca)]??_0x1390af(0x114)+_0x1390af(0x2e4),_0x583a62=join(_0x100774,_0x1390af(0x1a1),'wujiecla'+'w'),_0x5a2d18=join(_0x100774,_0x1390af(0x1a1),_0x1390af(0xda)+_0x1390af(0x8d)),_0x27c12a=normalizeRuntimeRelativePath(relative(dirname(_0x583a62),resolve(_0x100774,_0x3bacab[_0x1390af(0x288)+_0x1390af(0x32e)]))),_0x7baf18=normalizeRuntimeRelativePath(relative(dirname(_0x583a62),resolve(_0x100774,_0x3bacab[_0x1390af(0x2f4)+_0x1390af(0xa6)]))),_0x44f2c6='$HOME/'+_0x4cd861[_0x1390af(0x2fc)+_0x1390af(0x333)],_0x445aea='%USERPRO'+'FILE%\x5c'+_0x4cd861['dataDirN'+_0x1390af(0x333)];await mkdir(dirname(_0x583a62),{'recursive':!![]});const _0x59bcb3=fileURLToPath(new URL(_0x1390af(0xdc)+_0x1390af(0x27d)+'ie-logo.'+_0x1390af(0x1ee),import.meta.url)),_0x349ea3=join(_0x100774,_0x1390af(0x1a1),_0x1390af(0x124)+_0x1390af(0x2f2));await cp(_0x59bcb3,_0x349ea3),await writeFile(_0x583a62,[_0x1390af(0x13d)+'h','export\x20O'+_0x1390af(0x91)+_0x1390af(0x321)+_0x1390af(0x92)+_0x1390af(0x248)+_0x44f2c6+'}\x22',_0x1390af(0x196)+_0x1390af(0x91)+_0x1390af(0x2dc)+_0x1390af(0x1cd)+_0x1390af(0x29c)+_0x1390af(0x199)+'-'+_0x44f2c6+'}\x22','export\x20O'+_0x1390af(0x91)+_0x1390af(0x2be)+_0x1390af(0x1df)+'=\x22${OPEN'+_0x1390af(0x112)+'FIG_FILE'+_0x1390af(0x12f)+_0x4b1421+'}\x22',_0x1390af(0x196)+'PENCLAW_'+_0x1390af(0x9d)+_0x1390af(0x135)+'PENCLAW_'+'CONFIG_P'+_0x1390af(0x334)+_0x44f2c6+'/'+_0x4b1421+'}\x22','SCRIPT_D'+_0x1390af(0x95)+_0x1390af(0x15d)+_0x1390af(0x1b6)+'rname\x20--'+_0x1390af(0x1e0)+_0x1390af(0x2de),_0x1390af(0x18a)+_0x1390af(0xfa)+_0x1390af(0x1e2)+'R/'+_0x27c12a+'\x22','if\x20[\x20-t\x20'+_0x1390af(0xcb)+_0x1390af(0xc5)+'JIE_NO_L'+'OGO\x22\x20];\x20'+_0x1390af(0x113),_0x1390af(0x134)+'IME_NODE'+_0x1390af(0x253)+_0x1390af(0x2ed)+_0x1390af(0x317)+_0x1390af(0x146)+_0x1390af(0x175)+'ll\x20||\x20tr'+'ue','fi','exec\x20\x22$R'+_0x1390af(0xf0)+_0x1390af(0xad)+_0x1390af(0x1e2)+'R/'+_0x7baf18+_0x1390af(0xd3),''][_0x1390af(0x89)]('\x0a'),'utf8'),await chmod(_0x583a62,0x1ed),await writeFile(_0x5a2d18,[_0x1390af(0x12e)+'f',_0x1390af(0x190)+_0x1390af(0x24a)+_0x1390af(0x21e)+_0x1390af(0x2a6)+_0x1390af(0xa1)+_0x1390af(0x327)+_0x445aea+'\x22',_0x1390af(0x190)+_0x1390af(0x29c)+'ATE_DIR%'+_0x1390af(0x1db)+'t\x20\x22OPENC'+_0x1390af(0x19d)+'E_DIR='+_0x445aea+'\x22',_0x1390af(0x190)+'NCLAW_CO'+_0x1390af(0x20b)+_0x1390af(0x298)+_0x1390af(0x1be)+_0x1390af(0x222)+_0x1390af(0x225)+_0x1390af(0xdb)+_0x1390af(0x1b9)+_0x4b1421+'\x22','if\x20\x22%OPE'+_0x1390af(0x31c)+_0x1390af(0x329)+_0x1390af(0x301)+_0x1390af(0x1c5)+'NCLAW_CO'+'NFIG_PAT'+'H='+_0x445aea+'\x5c'+_0x4b1421+'\x22',_0x1390af(0x239)+_0x1390af(0x2d3)+'%~dp0\x22','set\x20\x22RUN'+_0x1390af(0x1d6)+'E=%SCRIP'+_0x1390af(0x2a7)+toWindowsPath(_0x27c12a)+'\x22','\x22%RUNTIM'+'E_NODE%\x22'+_0x1390af(0xd4)+'T_DIR%'+toWindowsPath(_0x7baf18)+_0x1390af(0x2bd),''][_0x1390af(0x89)]('\x0d\x0a'),'utf8'),_0x3bacab[_0x1390af(0xda)+_0x1390af(0x158)]=toRuntimeRelative(_0x100774,process[_0x1390af(0x2fa)]===_0x1390af(0x21a)?_0x5a2d18:_0x583a62);}async function patchChatHistoryMixedToolContentBug(_0x10f03b,_0x20b539,_0x25fafa={}){const _0x482379=_0x31e6db,_0x475346=resolve(_0x10f03b,_0x20b539[_0x482379(0x2f4)+_0x482379(0x294)+'ir']),_0x6d7441=join(_0x475346,_0x482379(0xc7));let _0x3fa49a=[];try{_0x3fa49a=await readdir(_0x6d7441,{'withFileTypes':!![]});}catch{_0x25fafa[_0x482379(0xf8)+'ogger']?.[_0x482379(0x7f)]?.(_0x482379(0x17d)+'tory\x20mix'+_0x482379(0x162)+'patch\x20sk'+_0x482379(0x2b9)+'ist\x20not\x20'+_0x482379(0xb0),{'distDir':_0x6d7441,'openclawVersion':_0x20b539[_0x482379(0x2f4)+_0x482379(0x99)]});return;}const _0x236e9e=_0x3fa49a[_0x482379(0x132)](_0x12f9f2=>_0x12f9f2[_0x482379(0x2e7)]()&&(_0x12f9f2[_0x482379(0x22a)][_0x482379(0x28d)+'th']('chat-dis'+_0x482379(0xae)+_0x482379(0xcc))||_0x12f9f2['name'][_0x482379(0x28d)+'th'](_0x482379(0x206)+_0x482379(0x2d8)+'pt-path-'))&&_0x12f9f2[_0x482379(0x22a)][_0x482379(0x10c)](_0x482379(0x1a7)))['map'](_0x4e70fc=>join(_0x6d7441,_0x4e70fc[_0x482379(0x22a)]));if(_0x236e9e[_0x482379(0x118)]===0x0){_0x25fafa[_0x482379(0xf8)+_0x482379(0x318)]?.[_0x482379(0x7f)]?.('chat\x20his'+'tory\x20mix'+_0x482379(0x162)+_0x482379(0x1ef)+_0x482379(0x25d)+_0x482379(0x189)+_0x482379(0xb0),{'openclawVersion':_0x20b539[_0x482379(0x2f4)+_0x482379(0x99)]});return;}for(const _0x270c37 of _0x236e9e){const _0x283964=await readFile(_0x270c37,_0x482379(0x1b8)),_0x15064e=patchMixedToolContentFromSource(_0x283964);if(!_0x15064e[_0x482379(0x1d5)]){if(_0x15064e[_0x482379(0x15c)]===_0x482379(0x111)+_0x482379(0x1d5)){_0x25fafa[_0x482379(0xf8)+_0x482379(0x318)]?.[_0x482379(0x2da)]?.(_0x482379(0x17d)+_0x482379(0x2df)+_0x482379(0x162)+_0x482379(0x2a5)+'ready\x20ap'+'plied',{'openclawVersion':_0x20b539[_0x482379(0x2f4)+'Version'],'filePath':_0x270c37});return;}continue;}await writeFile(_0x270c37,_0x15064e['source'],'utf8'),_0x25fafa[_0x482379(0xf8)+'ogger']?.[_0x482379(0x2da)]?.(_0x482379(0x17d)+_0x482379(0x2df)+'ed-tool\x20'+_0x482379(0x290)+_0x482379(0x1f0),{'openclawVersion':_0x20b539[_0x482379(0x2f4)+_0x482379(0x99)],'filePath':_0x270c37,'note':_0x482379(0xed)+'y\x20compat'+_0x482379(0x1a9)+_0x482379(0x127)+_0x482379(0x2ab)+_0x482379(0x287)+_0x482379(0x2f8)+'tool\x20his'+_0x482379(0x22b)+_0x482379(0x200)+_0x482379(0x30b)+_0x482379(0x325)+'ream\x20fix'+_0x482379(0x194)+'re\x20upgra'+_0x482379(0x268)});return;}_0x25fafa[_0x482379(0xf8)+_0x482379(0x318)]?.[_0x482379(0x7f)]?.(_0x482379(0x17d)+_0x482379(0x2df)+_0x482379(0x162)+_0x482379(0x1ef)+'ipped;\x20f'+_0x482379(0x1b2)+_0x482379(0xf2)+'d',{'openclawVersion':_0x20b539[_0x482379(0x2f4)+_0x482379(0x99)]});}async function patchChatAttachmentBase64Runtime(_0x208606,_0x563445,_0x5c36e7={}){const _0xb0fc7b=_0x31e6db,_0x3f6aa8=resolve(_0x208606,_0x563445[_0xb0fc7b(0x2f4)+'WorkingD'+'ir']),_0x22730d=join(_0x3f6aa8,_0xb0fc7b(0xc7));let _0x2d6645=[];try{_0x2d6645=await readdir(_0x22730d,{'withFileTypes':!![]});}catch{_0x5c36e7[_0xb0fc7b(0xf8)+_0xb0fc7b(0x318)]?.['warn']?.(_0xb0fc7b(0x1a0)+'achment\x20'+_0xb0fc7b(0x242)+_0xb0fc7b(0x98)+_0xb0fc7b(0x2ef)+_0xb0fc7b(0x131)+_0xb0fc7b(0x2d7),{'distDir':_0x22730d,'openclawVersion':_0x563445[_0xb0fc7b(0x2f4)+_0xb0fc7b(0x99)]});return;}const _0x39bb4e=_0x2d6645[_0xb0fc7b(0x132)](_0x2ceb3c=>_0x2ceb3c[_0xb0fc7b(0x2e7)]()&&_0x2ceb3c[_0xb0fc7b(0x22a)][_0xb0fc7b(0x28d)+'th']('attachme'+_0xb0fc7b(0x19f)+_0xb0fc7b(0x18f))&&_0x2ceb3c[_0xb0fc7b(0x22a)][_0xb0fc7b(0x10c)]('.js'))[_0xb0fc7b(0x1e7)](_0x4ff9c5=>join(_0x22730d,_0x4ff9c5['name']));if(_0x39bb4e['length']===0x0){_0x5c36e7[_0xb0fc7b(0xf8)+'ogger']?.['warn']?.('chat\x20att'+'achment\x20'+'base64\x20p'+'atch\x20ski'+'pped;\x20fi'+_0xb0fc7b(0x26f)+_0xb0fc7b(0x2d7),{'openclawVersion':_0x563445['openclaw'+_0xb0fc7b(0x99)]});return;}for(const _0x1d1fa6 of _0x39bb4e){const _0x5bd375=await readFile(_0x1d1fa6,_0xb0fc7b(0x1b8)),_0x10ab88=patchChatAttachmentBase64FromSource(_0x5bd375);if(!_0x10ab88[_0xb0fc7b(0x1d5)]){if(_0x10ab88[_0xb0fc7b(0x15c)]==='already-'+_0xb0fc7b(0x1d5)){_0x5c36e7[_0xb0fc7b(0xf8)+'ogger']?.[_0xb0fc7b(0x2da)]?.(_0xb0fc7b(0x1a0)+_0xb0fc7b(0x304)+'base64\x20p'+_0xb0fc7b(0x210)+_0xb0fc7b(0x2b1)+_0xb0fc7b(0x10f),{'openclawVersion':_0x563445[_0xb0fc7b(0x2f4)+'Version'],'filePath':_0x1d1fa6});return;}continue;}await writeFile(_0x1d1fa6,_0x10ab88[_0xb0fc7b(0x215)],_0xb0fc7b(0x1b8)),_0x5c36e7[_0xb0fc7b(0xf8)+'ogger']?.[_0xb0fc7b(0x2da)]?.('chat\x20att'+_0xb0fc7b(0x304)+_0xb0fc7b(0x242)+_0xb0fc7b(0x18e)+_0xb0fc7b(0x10f),{'openclawVersion':_0x563445[_0xb0fc7b(0x2f4)+_0xb0fc7b(0x99)],'filePath':_0x1d1fa6,'note':_0xb0fc7b(0xed)+_0xb0fc7b(0xd7)+_0xb0fc7b(0x1a9)+'patch\x20fo'+_0xb0fc7b(0x2ab)+_0xb0fc7b(0x287)+'6\x20chat.s'+'end\x20atta'+'chment\x20b'+_0xb0fc7b(0x2fb)+_0xb0fc7b(0x11a)+_0xb0fc7b(0x2e0)+_0xb0fc7b(0xf1)+_0xb0fc7b(0x23a)+_0xb0fc7b(0x1f1)+_0xb0fc7b(0xb2)+_0xb0fc7b(0x15a)});return;}_0x5c36e7[_0xb0fc7b(0xf8)+_0xb0fc7b(0x318)]?.[_0xb0fc7b(0x7f)]?.(_0xb0fc7b(0x1a0)+'achment\x20'+_0xb0fc7b(0x242)+'atch\x20ski'+_0xb0fc7b(0xca)+_0xb0fc7b(0x25a)+_0xb0fc7b(0x33d),{'openclawVersion':_0x563445[_0xb0fc7b(0x2f4)+_0xb0fc7b(0x99)]});}async function patchProviderRequestIdHeader(_0x57f5ca,_0x27df86,_0xcba21e={}){const _0x3cde88=_0x31e6db,_0x1751c9=resolve(_0x57f5ca,_0x27df86[_0x3cde88(0x2f4)+_0x3cde88(0x294)+'ir']),_0x4ea96f=join(_0x1751c9,_0x3cde88(0xc7));let _0x34cac9=[];try{_0x34cac9=await readdir(_0x4ea96f,{'withFileTypes':!![]});}catch{_0xcba21e[_0x3cde88(0xf8)+'ogger']?.['warn']?.(_0x3cde88(0x1ec)+_0x3cde88(0x221)+'-id\x20head'+'er\x20patch'+_0x3cde88(0x2ad)+_0x3cde88(0x2ac)+'ot\x20found',{'distDir':_0x4ea96f,'openclawVersion':_0x27df86[_0x3cde88(0x2f4)+_0x3cde88(0x99)]});return;}const _0x5dd11f=_0x34cac9['filter'](_0x507b8a=>_0x507b8a[_0x3cde88(0x2e7)]()&&_0x507b8a[_0x3cde88(0x22a)][_0x3cde88(0x10c)]('.js'))['map'](_0x476780=>join(_0x4ea96f,_0x476780[_0x3cde88(0x22a)]));let _0x294342=0x0,_0x52aea3=0x0;for(const _0x1f8bbb of _0x5dd11f){const _0x2e40ab=await readFile(_0x1f8bbb,'utf8'),_0x5d09e1=patchProviderRequestIdHeaderFromSource(_0x2e40ab);if(_0x5d09e1[_0x3cde88(0x1d5)]){await writeFile(_0x1f8bbb,_0x5d09e1['source'],'utf8'),_0x294342+=0x1,_0xcba21e[_0x3cde88(0xf8)+_0x3cde88(0x318)]?.[_0x3cde88(0x2da)]?.(_0x3cde88(0x1ec)+_0x3cde88(0x221)+_0x3cde88(0x2bb)+'er\x20patch'+_0x3cde88(0x8e),{'openclawVersion':_0x27df86[_0x3cde88(0x2f4)+'Version'],'filePath':_0x1f8bbb});continue;}if(_0x5d09e1['reason']===_0x3cde88(0x111)+_0x3cde88(0x1d5))_0x52aea3+=0x1;}if(_0x294342>0x0){_0xcba21e[_0x3cde88(0xf8)+'ogger']?.['info']?.(_0x3cde88(0x1ec)+'\x20request'+'-id\x20head'+_0x3cde88(0x2c2)+_0x3cde88(0x30e),{'openclawVersion':_0x27df86[_0x3cde88(0x2f4)+_0x3cde88(0x99)],'patchedCount':_0x294342,'alreadyPatchedCount':_0x52aea3});return;}if(_0x52aea3>0x0){_0xcba21e['runtimeL'+_0x3cde88(0x318)]?.[_0x3cde88(0x2da)]?.(_0x3cde88(0x1ec)+_0x3cde88(0x221)+_0x3cde88(0x2bb)+_0x3cde88(0x2c2)+'\x20already'+_0x3cde88(0x8e),{'openclawVersion':_0x27df86['openclaw'+'Version'],'alreadyPatchedCount':_0x52aea3});return;}_0xcba21e[_0x3cde88(0xf8)+_0x3cde88(0x318)]?.[_0x3cde88(0x7f)]?.('provider'+'\x20request'+_0x3cde88(0x2bb)+'er\x20patch'+_0x3cde88(0x2ad)+';\x20provid'+_0x3cde88(0xb9)+_0x3cde88(0xf5)+_0x3cde88(0x2cc)+'nd',{'openclawVersion':_0x27df86[_0x3cde88(0x2f4)+_0x3cde88(0x99)]});}async function patchCodexIsolatedAuthRuntime(_0x18dd45,_0x30caf7,_0x3e7e96={}){const _0x40bfcc=_0x31e6db,_0x2c7a69=resolve(_0x18dd45,_0x30caf7['openclaw'+'WorkingD'+'ir']),_0x1d569c=[join(_0x2c7a69,_0x40bfcc(0xc7)),join(_0x2c7a69,_0x40bfcc(0xc7),'extensio'+'ns',_0x40bfcc(0x1a5),_0x40bfcc(0xc7))],_0x30edb9=[];for(const _0x3433c0 of _0x1d569c){const _0x171b00=await readdir(_0x3433c0,{'withFileTypes':!![]})[_0x40bfcc(0x24e)](()=>[]);for(const _0x243e14 of _0x171b00){_0x243e14[_0x40bfcc(0x2e7)]()&&_0x243e14[_0x40bfcc(0x22a)]['startsWi'+'th'](_0x40bfcc(0x97)+_0x40bfcc(0x10e))&&_0x243e14[_0x40bfcc(0x22a)][_0x40bfcc(0x10c)](_0x40bfcc(0x1a7))&&_0x30edb9[_0x40bfcc(0xdf)](join(_0x3433c0,_0x243e14['name']));}}let _0x3a21b8=0x0,_0x39225d=0x0;for(const _0x342792 of _0x30edb9){const _0x115783=await readFile(_0x342792,_0x40bfcc(0x1b8)),_0x2b0702=patchCodexIsolatedAuthFromSource(_0x115783);if(_0x2b0702[_0x40bfcc(0x1d5)]){await writeFile(_0x342792,_0x2b0702[_0x40bfcc(0x215)],_0x40bfcc(0x1b8)),_0x3a21b8+=0x1,_0x3e7e96[_0x40bfcc(0xf8)+_0x40bfcc(0x318)]?.['info']?.(_0x40bfcc(0x29a)+'olated\x20a'+_0x40bfcc(0x213)+'h\x20applie'+'d',{'openclawVersion':_0x30caf7[_0x40bfcc(0x2f4)+_0x40bfcc(0x99)],'filePath':_0x342792});continue;}if(_0x2b0702[_0x40bfcc(0x15c)]===_0x40bfcc(0x111)+_0x40bfcc(0x1d5))_0x39225d+=0x1;}if(_0x3a21b8>0x0||_0x39225d>0x0){_0x3e7e96['runtimeL'+'ogger']?.[_0x40bfcc(0x2da)]?.('codex\x20is'+'olated\x20a'+_0x40bfcc(0x213)+_0x40bfcc(0x85)+'y',{'openclawVersion':_0x30caf7[_0x40bfcc(0x2f4)+_0x40bfcc(0x99)],'patchedCount':_0x3a21b8,'alreadyPatchedCount':_0x39225d});return;}_0x3e7e96[_0x40bfcc(0xf8)+'ogger']?.[_0x40bfcc(0x7f)]?.('codex\x20is'+_0x40bfcc(0x2ba)+_0x40bfcc(0x213)+'h\x20skippe'+'d;\x20share'+'d\x20client'+_0x40bfcc(0x1cf)+_0x40bfcc(0x2c7)+'found',{'openclawVersion':_0x30caf7['openclaw'+_0x40bfcc(0x99)],'candidateFiles':_0x30edb9});}async function patchChannelPluginRuntimeBug(_0x16a273,_0x4708e0,_0x13cb6e={}){const _0x54794c=_0x31e6db,_0x19526a=resolve(_0x16a273,_0x4708e0[_0x54794c(0x2f4)+_0x54794c(0x294)+'ir']),_0x5c37db=join(_0x19526a,'dist');let _0x34d01a=[];try{_0x34d01a=await readdir(_0x5c37db,{'withFileTypes':!![]});}catch{_0x13cb6e[_0x54794c(0xf8)+'ogger']?.[_0x54794c(0x7f)]?.('channel\x20'+_0x54794c(0x2db)+_0x54794c(0x1a2)+_0x54794c(0x98)+_0x54794c(0x2ef)+_0x54794c(0x131)+_0x54794c(0x2d7),{'distDir':_0x5c37db,'openclawVersion':_0x4708e0[_0x54794c(0x2f4)+_0x54794c(0x99)]});return;}const _0xb27737=_0x34d01a[_0x54794c(0x132)](_0x392e2d=>_0x392e2d[_0x54794c(0x2e7)]()&&_0x392e2d['name'][_0x54794c(0x28d)+'th'](_0x54794c(0xfc))&&_0x392e2d[_0x54794c(0x22a)][_0x54794c(0x10c)](_0x54794c(0x1a7)))[_0x54794c(0x1e7)](_0x136ce5=>join(_0x5c37db,_0x136ce5[_0x54794c(0x22a)])),_0x5a0266=await resolveRuntimeChannelImportPath(_0x5c37db,_0x34d01a);if(_0xb27737[_0x54794c(0x118)]===0x0){_0x13cb6e[_0x54794c(0xf8)+_0x54794c(0x318)]?.['warn']?.(_0x54794c(0xfe)+'plugin\x20r'+'untime\x20p'+_0x54794c(0x98)+'pped;\x20lo'+_0x54794c(0xba)+_0x54794c(0x1b5),{'openclawVersion':_0x4708e0[_0x54794c(0x2f4)+'Version']});return;}if(!_0x5a0266){_0x13cb6e[_0x54794c(0xf8)+_0x54794c(0x318)]?.[_0x54794c(0x7f)]?.(_0x54794c(0xfe)+'plugin\x20r'+_0x54794c(0x1a2)+_0x54794c(0x98)+_0x54794c(0x2c6)+_0x54794c(0x1fb)+'annel\x20en'+_0x54794c(0x241)+_0x54794c(0xb0),{'openclawVersion':_0x4708e0['openclaw'+_0x54794c(0x99)],'distDir':_0x5c37db});return;}for(const _0x1d84f0 of _0xb27737){const _0x3ab6ab=await readFile(_0x1d84f0,_0x54794c(0x1b8)),_0x239c2f=patchChannelPluginRuntimeFromSource(_0x3ab6ab,{'runtimeChannelImportPath':_0x5a0266});if(!_0x239c2f[_0x54794c(0x1d5)]){if(_0x239c2f[_0x54794c(0x15c)]===_0x54794c(0x111)+_0x54794c(0x1d5)){_0x13cb6e[_0x54794c(0xf8)+_0x54794c(0x318)]?.['info']?.('channel\x20'+'plugin\x20r'+_0x54794c(0x1a2)+_0x54794c(0x210)+_0x54794c(0x2b1)+_0x54794c(0x10f),{'openclawVersion':_0x4708e0['openclaw'+_0x54794c(0x99)],'filePath':_0x1d84f0});return;}continue;}await writeFile(_0x1d84f0,_0x239c2f['source'],_0x54794c(0x1b8)),_0x13cb6e[_0x54794c(0xf8)+'ogger']?.[_0x54794c(0x2da)]?.(_0x54794c(0xfe)+_0x54794c(0x2db)+'untime\x20p'+_0x54794c(0x18e)+_0x54794c(0x10f),{'openclawVersion':_0x4708e0[_0x54794c(0x2f4)+'Version'],'filePath':_0x1d84f0,'note':_0x54794c(0xed)+_0x54794c(0xd7)+_0x54794c(0x1a9)+_0x54794c(0x127)+_0x54794c(0x2ab)+_0x54794c(0x287)+_0x54794c(0xfb)+_0x54794c(0x155)+'in\x20runti'+_0x54794c(0x12a)+'ng\x20chann'+_0x54794c(0xde)+'nd\x20helpe'+_0x54794c(0x32f)+'fy\x20upstr'+_0x54794c(0x313)+_0x54794c(0x2cd)+_0x54794c(0x20c)+_0x54794c(0x28b)});return;}_0x13cb6e[_0x54794c(0xf8)+_0x54794c(0x318)]?.[_0x54794c(0x7f)]?.(_0x54794c(0xfe)+'plugin\x20r'+_0x54794c(0x1a2)+_0x54794c(0x98)+_0x54794c(0x2c6)+'ntime\x20re'+'solver\x20n'+_0x54794c(0x33d),{'openclawVersion':_0x4708e0[_0x54794c(0x2f4)+_0x54794c(0x99)]});}async function patchSessionStoreSqliteRuntime(_0x4a963a,_0x1e3c0c,_0x1d6074={}){const _0x2d23c4=_0x31e6db,_0xa0862b=resolve(_0x4a963a,_0x1e3c0c[_0x2d23c4(0x2f4)+'WorkingD'+'ir']),_0x5d52da=join(_0xa0862b,_0x2d23c4(0xc7)),_0xe22a78=_0x2d23c4(0x237)+'ell-runt'+_0x2d23c4(0x14a)+_0x2d23c4(0xaa)+'time-bri'+_0x2d23c4(0x28c),_0x22e36e=join(_0x4a963a,_0x2d23c4(0x22e)+_0x2d23c4(0x254),_0x2d23c4(0x240),_0x2d23c4(0x219)+'bridge.m'+'js'),_0x22f68a=(await readdir(_0x5d52da,{'withFileTypes':!![]})[_0x2d23c4(0x24e)](()=>[]))['filter'](_0x5d9930=>_0x5d9930[_0x2d23c4(0x2e7)]()&&_0x5d9930[_0x2d23c4(0x22a)]['startsWi'+'th'](_0x2d23c4(0x25f)+_0x2d23c4(0x227))&&_0x5d9930[_0x2d23c4(0x22a)][_0x2d23c4(0x10c)](_0x2d23c4(0x1a7)))['map'](_0x434c0f=>join(_0x5d52da,_0x434c0f[_0x2d23c4(0x22a)])),_0x5476d9=(await readdir(_0x5d52da,{'withFileTypes':!![]})[_0x2d23c4(0x24e)](()=>[]))['filter'](_0x4c853f=>_0x4c853f[_0x2d23c4(0x2e7)]()&&_0x4c853f[_0x2d23c4(0x22a)][_0x2d23c4(0x28d)+'th']('store-')&&!_0x4c853f[_0x2d23c4(0x22a)][_0x2d23c4(0x28d)+'th'](_0x2d23c4(0x25f)+_0x2d23c4(0x227))&&_0x4c853f['name'][_0x2d23c4(0x10c)]('.js'))['map'](_0x3a2ce1=>join(_0x5d52da,_0x3a2ce1[_0x2d23c4(0x22a)]));if(!existsSync(_0x22e36e)){_0x1d6074['runtimeL'+_0x2d23c4(0x318)]?.['info']?.(_0x2d23c4(0x2e6)+_0x2d23c4(0x23c)+_0x2d23c4(0x21c)+_0x2d23c4(0x160)+_0x2d23c4(0xfd)+_0x2d23c4(0x9e)+_0x2d23c4(0x2c9),{'bridgePath':_0x22e36e,'openclawVersion':_0x1e3c0c[_0x2d23c4(0x2f4)+_0x2d23c4(0x99)]});return;}for(const _0x3adf51 of _0x22f68a){const _0x5d94c7=await readFile(_0x3adf51,_0x2d23c4(0x1b8)),_0x25f368=patchSessionStoreLoadFromSource(_0x5d94c7,{'bridgeImportPath':_0xe22a78});if(!_0x25f368[_0x2d23c4(0x1d5)]){if(_0x25f368['reason']==='already-'+_0x2d23c4(0x1d5)){_0x1d6074[_0x2d23c4(0xf8)+'ogger']?.[_0x2d23c4(0x2da)]?.(_0x2d23c4(0x2e6)+_0x2d23c4(0xc4)+_0x2d23c4(0x33c)+_0x2d23c4(0x13e)+_0x2d23c4(0x8e),{'filePath':_0x3adf51,'openclawVersion':_0x1e3c0c['openclaw'+'Version']});break;}continue;}await writeFile(_0x3adf51,_0x25f368[_0x2d23c4(0x215)],_0x2d23c4(0x1b8)),_0x1d6074[_0x2d23c4(0xf8)+_0x2d23c4(0x318)]?.['info']?.('session\x20'+_0x2d23c4(0xc4)+_0x2d23c4(0x33c)+_0x2d23c4(0x8e),{'filePath':_0x3adf51,'openclawVersion':_0x1e3c0c[_0x2d23c4(0x2f4)+_0x2d23c4(0x99)]});break;}for(const _0x142d0d of _0x5476d9){const _0x5b37fe=await readFile(_0x142d0d,_0x2d23c4(0x1b8)),_0x25d2a8=patchSessionStoreWriteFromSource(_0x5b37fe,{'bridgeImportPath':_0xe22a78});if(!_0x25d2a8[_0x2d23c4(0x1d5)]){if(_0x25d2a8[_0x2d23c4(0x15c)]===_0x2d23c4(0x111)+_0x2d23c4(0x1d5)){_0x1d6074[_0x2d23c4(0xf8)+_0x2d23c4(0x318)]?.[_0x2d23c4(0x2da)]?.('session\x20'+_0x2d23c4(0x26a)+'ite\x20patc'+_0x2d23c4(0x19e)+_0x2d23c4(0x2e1)+'d',{'filePath':_0x142d0d,'openclawVersion':_0x1e3c0c[_0x2d23c4(0x2f4)+_0x2d23c4(0x99)]});break;}continue;}await writeFile(_0x142d0d,_0x25d2a8[_0x2d23c4(0x215)],_0x2d23c4(0x1b8)),_0x1d6074[_0x2d23c4(0xf8)+_0x2d23c4(0x318)]?.[_0x2d23c4(0x2da)]?.(_0x2d23c4(0x2e6)+_0x2d23c4(0x26a)+_0x2d23c4(0xb7)+_0x2d23c4(0x9c)+'d',{'filePath':_0x142d0d,'openclawVersion':_0x1e3c0c[_0x2d23c4(0x2f4)+_0x2d23c4(0x99)]});break;}}async function patchWeixinOutboundSessionRoute(_0x2c6c07,_0x5d4444,_0x14226f={}){const _0x25ea51=_0x31e6db,_0x57521f=join(_0x2c6c07,_0x25ea51(0x2f4),_0x25ea51(0xc7),'extensio'+'ns',_0x25ea51(0x2f4)+_0x25ea51(0x18b),_0x25ea51(0xc7),'src',_0x25ea51(0xf9)+'js');if(!existsSync(_0x57521f)){_0x14226f['runtimeL'+_0x25ea51(0x318)]?.[_0x25ea51(0x2da)]?.(_0x25ea51(0x81)+_0x25ea51(0x2b0)+_0x25ea51(0x2e6)+'route\x20pa'+'tch\x20skip'+_0x25ea51(0x339)+'gin\x20not\x20'+_0x25ea51(0x169)+'d',{'openclawVersion':_0x5d4444[_0x25ea51(0x2f4)+_0x25ea51(0x99)],'filePath':_0x57521f});return;}const _0x59f65a=await readFile(_0x57521f,_0x25ea51(0x1b8)),_0x29d047=patchWeixinOutboundSessionRouteFromSource(_0x59f65a);if(!_0x29d047[_0x25ea51(0x1d5)]){if(_0x29d047[_0x25ea51(0x15c)]===_0x25ea51(0x111)+_0x25ea51(0x1d5)){_0x14226f['runtimeL'+_0x25ea51(0x318)]?.[_0x25ea51(0x2da)]?.(_0x25ea51(0x81)+_0x25ea51(0x2b0)+_0x25ea51(0x2e6)+_0x25ea51(0x1ab)+_0x25ea51(0xc3)+_0x25ea51(0x2d2)+'ied',{'openclawVersion':_0x5d4444['openclaw'+_0x25ea51(0x99)],'filePath':_0x57521f});return;}_0x14226f[_0x25ea51(0xf8)+_0x25ea51(0x318)]?.[_0x25ea51(0x7f)]?.('weixin\x20o'+_0x25ea51(0x2b0)+_0x25ea51(0x2e6)+_0x25ea51(0x1ab)+_0x25ea51(0x202)+'ped;\x20cha'+'nnel\x20sha'+'pe\x20not\x20f'+'ound',{'openclawVersion':_0x5d4444[_0x25ea51(0x2f4)+_0x25ea51(0x99)],'filePath':_0x57521f,'reason':_0x29d047[_0x25ea51(0x15c)]});return;}await writeFile(_0x57521f,_0x29d047[_0x25ea51(0x215)],_0x25ea51(0x1b8)),_0x14226f[_0x25ea51(0xf8)+'ogger']?.['info']?.(_0x25ea51(0x81)+_0x25ea51(0x2b0)+_0x25ea51(0x2e6)+_0x25ea51(0x1ab)+_0x25ea51(0x323)+_0x25ea51(0x83),{'openclawVersion':_0x5d4444['openclaw'+_0x25ea51(0x99)],'filePath':_0x57521f,'note':_0x25ea51(0xed)+'y\x20compat'+_0x25ea51(0x1a9)+'patch\x20fo'+_0x25ea51(0x104)+'nt-weixi'+'n/opencl'+'aw-weixi'+_0x25ea51(0x245)+_0x25ea51(0x265)+'ery\x20mirr'+_0x25ea51(0x121)+_0x25ea51(0x115)+'d\x20as\x20gro'+_0x25ea51(0x8a)+_0x25ea51(0x223)+_0x25ea51(0x325)+_0x25ea51(0x191)+_0x25ea51(0x194)+'re\x20upgra'+_0x25ea51(0x268)});}async function patchWeixinOutboundFallbackRuntime(_0x4e3368,_0x5e077e,_0x2f3a7d={}){const _0x2b75c7=_0x31e6db,_0x4c7567=resolve(_0x4e3368,_0x5e077e['openclaw'+'WorkingD'+'ir']),_0x2b1f90=join(_0x4c7567,'dist'),_0x3805cf=(await readdir(_0x2b1f90,{'withFileTypes':!![]})[_0x2b75c7(0x24e)](()=>[]))[_0x2b75c7(0x132)](_0x1f1d84=>_0x1f1d84[_0x2b75c7(0x2e7)]()&&_0x1f1d84[_0x2b75c7(0x22a)][_0x2b75c7(0x28d)+'th'](_0x2b75c7(0x28a)+_0x2b75c7(0x10b)+'-')&&_0x1f1d84[_0x2b75c7(0x22a)][_0x2b75c7(0x10c)](_0x2b75c7(0x1a7)))[_0x2b75c7(0x1e7)](_0x1cdd82=>join(_0x2b1f90,_0x1cdd82[_0x2b75c7(0x22a)]));if(_0x3805cf['length']===0x0){_0x2f3a7d['runtimeL'+_0x2b75c7(0x318)]?.[_0x2b75c7(0x7f)]?.('weixin\x20o'+'utbound\x20'+_0x2b75c7(0x198)+_0x2b75c7(0x33a)+_0x2b75c7(0x2f0)+_0x2b75c7(0x28a)+_0x2b75c7(0x216)+_0x2b75c7(0x2cc)+'nd',{'openclawVersion':_0x5e077e[_0x2b75c7(0x2f4)+'Version'],'distDir':_0x2b1f90});return;}for(const _0x5b6b06 of _0x3805cf){const _0x564bbb=await readFile(_0x5b6b06,_0x2b75c7(0x1b8)),_0x536454=patchWeixinOutboundFallbackFromSource(_0x564bbb);if(!_0x536454[_0x2b75c7(0x1d5)]){if(_0x536454['reason']==='already-'+_0x2b75c7(0x1d5)){_0x2f3a7d['runtimeL'+_0x2b75c7(0x318)]?.[_0x2b75c7(0x2da)]?.(_0x2b75c7(0x81)+_0x2b75c7(0x2b0)+_0x2b75c7(0x198)+_0x2b75c7(0x1bc)+_0x2b75c7(0x16e)+_0x2b75c7(0x122),{'openclawVersion':_0x5e077e[_0x2b75c7(0x2f4)+_0x2b75c7(0x99)],'filePath':_0x5b6b06});return;}continue;}await writeFile(_0x5b6b06,_0x536454['source'],'utf8'),_0x2f3a7d[_0x2b75c7(0xf8)+_0x2b75c7(0x318)]?.['info']?.(_0x2b75c7(0x81)+'utbound\x20'+_0x2b75c7(0x198)+_0x2b75c7(0x1bc)+'pplied',{'openclawVersion':_0x5e077e['openclaw'+_0x2b75c7(0x99)],'filePath':_0x5b6b06,'note':_0x2b75c7(0xed)+_0x2b75c7(0xd7)+_0x2b75c7(0x1a9)+_0x2b75c7(0x127)+'rcing\x20op'+_0x2b75c7(0x2b6)+_0x2b75c7(0x1d9)+_0x2b75c7(0x195)+_0x2b75c7(0x87)+_0x2b75c7(0xbc)+_0x2b75c7(0x2d0)+_0x2b75c7(0x247)+_0x2b75c7(0x181)+_0x2b75c7(0x279)+_0x2b75c7(0xa0)+_0x2b75c7(0x11e)+_0x2b75c7(0x105)});return;}_0x2f3a7d[_0x2b75c7(0xf8)+'ogger']?.[_0x2b75c7(0x7f)]?.(_0x2b75c7(0x81)+'utbound\x20'+_0x2b75c7(0x198)+_0x2b75c7(0x33a)+_0x2b75c7(0x2f0)+_0x2b75c7(0x2f1)+'\x20shape\x20n'+_0x2b75c7(0x33d),{'openclawVersion':_0x5e077e[_0x2b75c7(0x2f4)+_0x2b75c7(0x99)]});}function _0x5a9f(){const _0x3752a6=['Name','vailable','leName','load:\x20','\x20not\x20fou','on\x20futur','n\x20the\x20di','eady\x20cur','s\x20to\x20dir','syncOnly','ady\x20appl','IPT_DIR=','required','Run\x20\x22wuj','ed\x20npm\x20p','ound','transcri','path:\x20','info','plugin\x20r','STATE_DI','ready\x20ap','&&\x20pwd)','tory\x20mix','flow;\x20ve','y\x20applie','agents\x20s','sion\x20val','json','\x20paths','session\x20','isFile','add',':\x20manife','led','out\x20c2c\x20','TRY','PT_DIR/w','product\x20','pped;\x20di','kipped;\x20','resolver','go.mjs','optional','openclaw','\x20doctor\x20','rg/dist/','--omit=p','6\x20mixed\x20','Duplicat','platform','ase64\x20st','dataDirN','_SHELL_E','red','ecs','e\x20not\x20fo','H%\x22==\x22\x22\x20','/node','package','achment\x20','extensio','ory','e_module','leted','time-bac','13384464hrApPz','bug;\x20ver','Extracte','JSON:\x20','\x20summary','extract\x20','\x20create\x20','npm','size','eam\x20fix\x20','some','string','--json','ujie-log','ogger','createRu','--legacy','[wujie-s','NCLAW_CO','download','und','integrit','zip','HOME=\x22${','rchive\x20-','tch\x20appl','time-too','ify\x20upst','allowMis','OME=','index.mj','NFIG_PAT','now','--no-aud','npm\x20pack','roductRu','utable','rs;\x20veri','time]\x20do','efore\x20pa','lugin\x20','ame','ATH:-','install','\x22\x20at\x20','bridge\x20n','lugin\x20de','ped;\x20plu','\x20patch\x20s','resolved','ad\x20patch','ot\x20found','allback\x20','warn','\x20package','weixin\x20o','dAt','ied','LocalPlu','h\x20summar','keys','\x20outboun','npm\x20plug','join','up\x20sessi','age\x20was\x20','OOT\x20-For','w.cmd','\x20applied','toString','untime-b','PENCLAW_','OPENCLAW','/opencla','vel\x20entr','IR=$(CDP','--fix','shared-c','atch\x20ski','Version','e\x20plugin','tching\x20p','h\x20applie','CONFIG_P','ge\x20not\x20a','ted','\x20routing','ENCLAW_H','.plugin-','s/npm','oot','octor\x20--','Bin','node/lib','s\x20instal','toISOStr','ions/run','114WqvWvZ','missing\x20','ODE\x22\x20\x22$S','play-pro','indexOf','found','red\x20Node','ure\x20upgr','?t=','registry','extract-','\x20version','ite\x20patc','sion\x20mis','er\x20respo','ader\x20not','split','d\x20mirror','lib','connecto','38801vYzznj','doctor','\x20return\x20','LocalAge','tch\x20alre','store\x20lo','\x20-z\x20\x22$WU','ced','dist','configFi','director','pped;\x20fu','1\x20]\x20&&\x20[','jection-','scoped\x20s','est-id/r','node_mod','agent','qqbot\x20ou','LocalSki','\x22\x20\x22$@\x22','\x20\x22%SCRIP','object','ntPaths','y\x20compat','config=','powershe','wujiecla','G_FILE_N','../../as','pack','el.inbou','push','isDirect',',\x20shell.','pluginId','local\x20pl','dataDir','fix\x20mark','href','XTRACT_R','-Command','node\x20ver','HIVE\x20-De','tall\x20the','plugins','Temporar','ackup','tar','UNTIME_N','rify\x20ups','not\x20foun','npm\x20inst','_STATE_D','nse\x20hook','ath\x20$env','tbound\x20d','runtimeL','channel.','NODE=\x22$S','6.6\x20chan','loader-','ed;\x20brid','channel\x20','NPM_CONF','\x20timed\x20o','-peer-de','ion\x20mism','ing\x20\x22','r\x20@tence','ailable.','cal\x20runt','\x20complet','flush','time]\x20in','\x20failed\x20','-session','endsWith','being\x20in','lient-','lied','\x20can\x20ins','already-','CLAW_CON','then','wujieai.','g\x20indexe','nnel','\x20depende','length','24292CuJfkN','ack\x20over','dy\x20appli','m-cli.js','\x20kdocs\x20s','\x20is\x20unav','unknown','.json','ors\x20bein','pplied','nced','wujie-lo','s/npm/bi','replaceA','patch\x20fo','pipe','law\x20','me\x20missi','pruned\x20r','tarball:','function','@echo\x20of','_NAME:-','env','st\x20not\x20f','filter','/npm','\x20\x20\x22$RUNT','ATH=\x22${O','lock.jso','lugins\x20s','ginPaths','Bot\x20c2c\x20','d\x20an\x20inv','with\x20the','-Executi','#!/bin/s','\x20already','https://','ayload\x20b','tar.xz','tests','8bywZnV','log','statusCo','o.mjs\x22\x202','-doctor.','request-','\x20loaded','ime/sess','eted','d\x20to\x20','\x20path\x20wa','law/qqbo','Invalid\x20','aipc-dow','npm\x20root','\x20resolve','\x20prepare','npmCli','nel\x20plug','product','cope\x20syn','wBin','path','ades.','ing','reason','ATH=\x20cd\x20','onPolicy','has','ch\x20skipp','dules/np','ed-tool\x20','.cache','.tools','local','npm-glob','und:\x20','\x22\x20so\x20the','installe','4981260ScVqod','null','arm64','node','lready\x20a','Expand-A','eer','kup','Dependen','devDepen','test','>/dev/nu','generate','aipc-run','_shared','shift','Claw','\x20can\x20be\x20','.d.ts','chat\x20his','HELL_ARC','ignore','-xzf','ions\x20whe','th\x20c2c\x20i','synced','t\x20c2c\x20ou','tbound\x20s','ut\x20after','match','headers','ile\x20not\x20','RUNTIME_','-weixin','projectR','idated','atch\x20app','lize-','if\x20\x22%OPE','ream\x20fix','rcing\x20QQ','spec','\x20on\x20futu','m.wechat','export\x20O','node/bin','fallback','ATE_DIR:','all\x20loca','all\x20plug','i.js','LAW_STAT','h\x20alread','nt-norma','chat\x20att','bin','untime\x20p','104DOeeSb','llPaths','codex','x64','.js','runtimeR','ibility\x20','empty\x20pl','route\x20pa','ugin\x20dep','stinatio','nloads-b','/node_mo','\x20synced','data','unction\x20','-xJf','lark-cli','\x20found','--\x20\x22$(di','bytes','utf8','AME=','14640CppkkE','ncies','\x20patch\x20a','configPa','==\x22\x22\x20set','agentSco','d\x20for\x20lo','ch\x20appli','ies','ed;\x20plug','hell:run','set\x20\x22OPE','tbound\x20f','ules/npm','esolver\x20','appId','able','26CdBnId','ady\x20curr','R=\x22${OPE','base\x20alr','\x20auth\x20sh','nd\x20after','location','.markdow','resume','ugin\x20spe','patched','TIME_NOD','alid\x20pay','kill\x20not','eixin\x20@i','w.mjs','\x22==\x22\x22\x20se','time','scripts','example','ILE_NAME','\x20\x22$0\x22)\x22\x20','kill','CRIPT_DI','isArray','_modules','\x20bin\x20was','ime\x20buil','map','7348023fYGzTA','pid','shasum','fix','provider','shape\x20no','mjs','patch\x20sk','plied','x\x20on\x20fut','nv:WUJIE','pec:\x20','\x20and\x20','red\x20Open','1545764xqdeCV','base\x20bui','6ULWScV','untime\x20c','importan','ntime\x20ch','error','skills','productN','ch\x20alrea','jection\x20','\x20id\x20from','tch\x20skip','\x20validat','label','every','session-','installP','timeoutM','e\x20tools\x20','rebuilt\x20','NFIG_FIL','e\x20upgrad','plugins\x20','runtime\x20','er\x20id.','atch\x20alr','wnloadin','\x20to\x20dire','uth\x20patc','slice','source','\x20runtime','prefix\x20i','r\x20runtim','runtime-','win32','filename','lite\x20pat','.tmp/run','ME%\x22==\x22\x22','npm-cli.','mirrors\x20','\x20request','\x20\x22OPENCL','ons;\x20ver','--no-fun','AW_CONFI','r\x20@openc','ad-','y:\x20','\x20mirrors','name','tory\x20pro','claw-run','-extract','shell-ru','nodeVers','(empty)','exec','ynced','SIGTERM','ipped;\x20o','ed;\x20chan','execPath','../../sh','docs','set\x20\x22SCR','tream\x20fi','ession\x20r','store\x20sq','arch','d\x20Node\x20r','agents','sessions','try\x20not\x20','base64\x20p','ll.exe','get','n\x20outbou','entryCou','ect\x20sess','_HOME:-','prepareP','NCLAW_HO','Bypass','l\x20plugin','nPath\x20$e','catch','d:\x20','referenc','runtimeS','channel-','\x22\x20\x22$SCRI','ntime','\x20started','OpenClaw','doc','40ydJIdu','started','nction\x20n','id\x20title','stdout','ipped;\x20f','configur','store-lo','lib/node','node.exe','dencies','e.exe','ache\x20bef','nd\x20deliv','includes','ridge.mj','des.','in\x20','store\x20wr','-NoProfi','skipped;','ion','find','le\x20not\x20f','ld\x20compl','dexed\x20wi','close','ime/requ','version','man','in\x20not\x20i','npm-cach','node/nod','n\x20plugin','versions','pluginSp','es\x20','sets/wuj','__tests_','local:','all\x20','st\x20be\x20a\x20','nstalled','skill','ase','lled','stderr','aw\x202026.','nodeExec','\x5cwjrt-','outbound','es.','dge.mjs','startsWi','replace','m/bin/np','patch\x20ap','singOpen','\x20configu','trim','WorkingD','\x20install','\x20did\x20not','\x20entry\x20\x22','E_NAME%\x22','d\x20for\x20','codex\x20is','win','NCLAW_ST','n\x20the\x20pe','LiteralP','o\x20resolv','--omit=d','jie-shel','values','cies','dependen','patch\x20al','\x20set\x20\x22OP','T_DIR%','PATH','prepare\x20','skills\x20s','r\x20OpenCl',';\x20dist\x20n','\x20skipped','ath','ules','utbound\x20','eady\x20app','package.','manifest','root','.npmmirr','enclaw-w',';\x20run\x20wu','in\x20insta','ipped;\x20d','olated\x20a','-id\x20head','ed\x20OpenC','\x22\x20%*','CONFIG_F','ore\x20pack','time]\x20ru','oute\x20pat','er\x20patch','rect\x20pee','\x20-g','ipped;\x20r','pped;\x20ru','ape\x20not\x20'];_0x5a9f=function(){return _0x3752a6;};return _0x5a9f();}async function patchRequestIdTitleRuntime(_0x47a64d,_0x46b23a,_0x1aaa8c={}){const _0x4b22e6=_0x31e6db,_0x5771ce=resolve(_0x47a64d,_0x46b23a[_0x4b22e6(0x2f4)+'WorkingD'+'ir']),_0x466e44=join(_0x5771ce,_0x4b22e6(0xc7)),_0x5ee310=_0x4b22e6(0x237)+'ell-runt'+_0x4b22e6(0x273)+_0x4b22e6(0xce)+_0x4b22e6(0x90)+_0x4b22e6(0x267)+'s',_0x3ea7c9=join(_0x47a64d,_0x4b22e6(0x22e)+_0x4b22e6(0x254),_0x4b22e6(0x148)+'id',_0x4b22e6(0x219)+'bridge.m'+'js');if(!existsSync(_0x3ea7c9)){_0x1aaa8c[_0x4b22e6(0xf8)+_0x4b22e6(0x318)]?.['info']?.(_0x4b22e6(0x148)+'id\x20title'+_0x4b22e6(0x216)+_0x4b22e6(0x33a)+_0x4b22e6(0x2f0)+_0x4b22e6(0x337)+'ot\x20avail'+_0x4b22e6(0x1ca),{'bridgePath':_0x3ea7c9,'openclawVersion':_0x46b23a['openclaw'+_0x4b22e6(0x99)]});return;}const _0x281ddc=(await readdir(_0x466e44,{'withFileTypes':!![]})['catch'](()=>[]))['filter'](_0x1d6c6d=>_0x1d6c6d[_0x4b22e6(0x2e7)]()&&_0x1d6c6d[_0x4b22e6(0x22a)][_0x4b22e6(0x28d)+'th']('loader-')&&_0x1d6c6d[_0x4b22e6(0x22a)][_0x4b22e6(0x10c)](_0x4b22e6(0x1a7)))[_0x4b22e6(0x1e7)](_0x37903e=>join(_0x466e44,_0x37903e[_0x4b22e6(0x22a)]));for(const _0x248c89 of _0x281ddc){const _0x5da0ed=await readFile(_0x248c89,_0x4b22e6(0x1b8)),_0xcb2980=patchRequestIdTitleRuntimeFromSource(_0x5da0ed,{'bridgeImportPath':_0x5ee310});if(!_0xcb2980[_0x4b22e6(0x1d5)]){if(_0xcb2980[_0x4b22e6(0x15c)]==='already-'+_0x4b22e6(0x1d5)){_0x1aaa8c[_0x4b22e6(0xf8)+'ogger']?.[_0x4b22e6(0x2da)]?.('request-'+_0x4b22e6(0x25b)+_0x4b22e6(0x216)+_0x4b22e6(0x1bc)+_0x4b22e6(0x16e)+'pplied',{'filePath':_0x248c89,'openclawVersion':_0x46b23a[_0x4b22e6(0x2f4)+'Version']});break;}continue;}await writeFile(_0x248c89,_0xcb2980[_0x4b22e6(0x215)],_0x4b22e6(0x1b8)),_0x1aaa8c[_0x4b22e6(0xf8)+_0x4b22e6(0x318)]?.[_0x4b22e6(0x2da)]?.('request-'+_0x4b22e6(0x25b)+'\x20runtime'+_0x4b22e6(0x1bc)+_0x4b22e6(0x122),{'filePath':_0x248c89,'openclawVersion':_0x46b23a[_0x4b22e6(0x2f4)+_0x4b22e6(0x99)]});break;}}async function patchQQBotOutboundFallbackRuntime(_0x5ce16e,_0x1bb7e2,_0x1e2e0c={}){const _0x275e6a=_0x31e6db,_0x1b90cf=resolve(_0x5ce16e,_0x1bb7e2['openclaw'+_0x275e6a(0x294)+'ir']),_0x1696bd=join(_0x1b90cf,'dist'),_0x33b863=(await readdir(_0x1696bd,{'withFileTypes':!![]})[_0x275e6a(0x24e)](()=>[]))[_0x275e6a(0x132)](_0x5033ff=>_0x5033ff[_0x275e6a(0x2e7)]()&&_0x5033ff[_0x275e6a(0x22a)][_0x275e6a(0x28d)+'th'](_0x275e6a(0x28a)+_0x275e6a(0x10b)+'-')&&_0x5033ff[_0x275e6a(0x22a)][_0x275e6a(0x10c)](_0x275e6a(0x1a7)))['map'](_0x4f9a8e=>join(_0x1696bd,_0x4f9a8e[_0x275e6a(0x22a)]));if(_0x33b863['length']===0x0){_0x1e2e0c[_0x275e6a(0xf8)+_0x275e6a(0x318)]?.[_0x275e6a(0x7f)]?.(_0x275e6a(0xd1)+_0x275e6a(0x1c6)+_0x275e6a(0x33e)+_0x275e6a(0x1ef)+_0x275e6a(0x234)+'utbound\x20'+_0x275e6a(0x20e)+_0x275e6a(0xf2)+'d',{'openclawVersion':_0x1bb7e2[_0x275e6a(0x2f4)+_0x275e6a(0x99)],'distDir':_0x1696bd});return;}for(const _0x31d5f1 of _0x33b863){const _0x1299e1=await readFile(_0x31d5f1,_0x275e6a(0x1b8)),_0x129bb4=patchQQBotOutboundFallbackFromSource(_0x1299e1);if(!_0x129bb4[_0x275e6a(0x1d5)]){if(_0x129bb4[_0x275e6a(0x15c)]===_0x275e6a(0x111)+_0x275e6a(0x1d5)){_0x1e2e0c['runtimeL'+_0x275e6a(0x318)]?.[_0x275e6a(0x2da)]?.('qqbot\x20ou'+'tbound\x20f'+_0x275e6a(0x33e)+'patch\x20al'+_0x275e6a(0x2dd)+_0x275e6a(0x1f0),{'openclawVersion':_0x1bb7e2[_0x275e6a(0x2f4)+_0x275e6a(0x99)],'filePath':_0x31d5f1});return;}continue;}await writeFile(_0x31d5f1,_0x129bb4['source'],'utf8'),_0x1e2e0c['runtimeL'+_0x275e6a(0x318)]?.[_0x275e6a(0x2da)]?.(_0x275e6a(0xd1)+'tbound\x20f'+_0x275e6a(0x33e)+_0x275e6a(0x290)+'plied',{'openclawVersion':_0x1bb7e2['openclaw'+_0x275e6a(0x99)],'filePath':_0x31d5f1,'note':_0x275e6a(0xed)+_0x275e6a(0xd7)+'ibility\x20'+_0x275e6a(0x127)+_0x275e6a(0x192)+_0x275e6a(0x139)+_0x275e6a(0x28a)+_0x275e6a(0x229)+_0x275e6a(0x212)+'ct\x20sessi'+'ons\x20with'+_0x275e6a(0x2eb)+_0x275e6a(0x217)+_0x275e6a(0x29d)+_0x275e6a(0x20f)});return;}_0x1e2e0c['runtimeL'+_0x275e6a(0x318)]?.[_0x275e6a(0x7f)]?.(_0x275e6a(0xd1)+'tbound\x20f'+'allback\x20'+_0x275e6a(0x1ef)+_0x275e6a(0x2c5)+_0x275e6a(0x1c8)+_0x275e6a(0x1ed)+'t\x20found',{'openclawVersion':_0x1bb7e2['openclaw'+_0x275e6a(0x99)]});}async function patchQQBotOutboundSessionRoute(_0x2129d2,_0x100c07,_0x402ab8={}){const _0x4c1824=_0x31e6db,_0x54e858=join(_0x2129d2,_0x4c1824(0x2f4),_0x4c1824(0xc7),_0x4c1824(0x305)+'ns','qqbot',_0x4c1824(0xc7));if(!existsSync(_0x54e858)){_0x402ab8['runtimeL'+_0x4c1824(0x318)]?.['info']?.(_0x4c1824(0xd1)+'tbound\x20s'+_0x4c1824(0x23b)+'oute\x20pat'+_0x4c1824(0x160)+_0x4c1824(0x1c3)+_0x4c1824(0x276)+_0x4c1824(0x282),{'openclawVersion':_0x100c07[_0x4c1824(0x2f4)+'Version'],'distDir':_0x54e858});return;}const _0x38673f=(await readdir(_0x54e858,{'withFileTypes':!![]})[_0x4c1824(0x24e)](()=>[]))['filter'](_0x48b10a=>_0x48b10a[_0x4c1824(0x2e7)]()&&_0x48b10a[_0x4c1824(0x22a)]['endsWith']('.js'))[_0x4c1824(0x1e7)](_0x22c077=>join(_0x54e858,_0x22c077[_0x4c1824(0x22a)]));for(const _0x1bf2fd of _0x38673f){const _0x51860c=await readFile(_0x1bf2fd,'utf8'),_0x767e97=patchQQBotOutboundSessionRouteFromSource(_0x51860c);if(!_0x767e97[_0x4c1824(0x1d5)]){if(_0x767e97[_0x4c1824(0x15c)]==='already-'+_0x4c1824(0x1d5)){_0x402ab8['runtimeL'+_0x4c1824(0x318)]?.['info']?.(_0x4c1824(0xd1)+'tbound\x20s'+_0x4c1824(0x23b)+_0x4c1824(0x2c1)+_0x4c1824(0x1ff)+_0x4c1824(0x11b)+'ed',{'openclawVersion':_0x100c07[_0x4c1824(0x2f4)+'Version'],'filePath':_0x1bf2fd});return;}continue;}await writeFile(_0x1bf2fd,_0x767e97[_0x4c1824(0x215)],_0x4c1824(0x1b8)),_0x402ab8[_0x4c1824(0xf8)+_0x4c1824(0x318)]?.[_0x4c1824(0x2da)]?.(_0x4c1824(0xd1)+'tbound\x20s'+_0x4c1824(0x23b)+_0x4c1824(0x2c1)+_0x4c1824(0x1c1)+'ed',{'openclawVersion':_0x100c07[_0x4c1824(0x2f4)+_0x4c1824(0x99)],'filePath':_0x1bf2fd,'note':_0x4c1824(0xed)+_0x4c1824(0xd7)+_0x4c1824(0x1a9)+_0x4c1824(0x127)+_0x4c1824(0x226)+_0x4c1824(0x14e)+_0x4c1824(0x184)+_0x4c1824(0xf7)+'elivery\x20'+_0x4c1824(0x220)+_0x4c1824(0x10d)+_0x4c1824(0x271)+_0x4c1824(0x182)+_0x4c1824(0x2ce)+_0x4c1824(0x2c3)+'r\x20id.'});return;}_0x402ab8[_0x4c1824(0xf8)+_0x4c1824(0x318)]?.['warn']?.('qqbot\x20ou'+_0x4c1824(0x185)+_0x4c1824(0x23b)+_0x4c1824(0x2c1)+_0x4c1824(0x160)+_0x4c1824(0x235)+'nel\x20shap'+_0x4c1824(0x300)+_0x4c1824(0x31e),{'openclawVersion':_0x100c07[_0x4c1824(0x2f4)+_0x4c1824(0x99)],'distDir':_0x54e858});}async function resolveRuntimeChannelImportPath(_0x29f3e6,_0x6a2840){const _0x4f9d4d=_0x31e6db,_0x57eda4=_0x6a2840[_0x4f9d4d(0x132)](_0x7ab536=>_0x7ab536[_0x4f9d4d(0x2e7)]()&&_0x7ab536[_0x4f9d4d(0x22a)][_0x4f9d4d(0x28d)+'th'](_0x4f9d4d(0x219)+_0x4f9d4d(0x252))&&_0x7ab536[_0x4f9d4d(0x22a)][_0x4f9d4d(0x10c)]('.js')&&!_0x7ab536[_0x4f9d4d(0x22a)]['startsWi'+'th']('runtime-'+_0x4f9d4d(0x252)+'state-'))[_0x4f9d4d(0x1e7)](_0x289cec=>_0x289cec[_0x4f9d4d(0x22a)])['sort']();for(const _0x51764e of _0x57eda4){const _0x1c93b3=await readFile(join(_0x29f3e6,_0x51764e),_0x4f9d4d(0x1b8));if(_0x1c93b3[_0x4f9d4d(0x266)](_0x4f9d4d(0x319)+'ntimeCha'+_0x4f9d4d(0x116)))return'./'+_0x51764e;}return null;}function normalizeRuntimeRelativePath(_0x3e4211){const _0x22a5fe=_0x31e6db;return _0x3e4211[_0x22a5fe(0x126)+'ll']('\x5c','/');}function toWindowsPath(_0x510ee7){return _0x510ee7['replaceA'+'ll']('/','\x5c');}function validateRuntimeNodeVersion(_0x2da79e,_0x34ff30){const _0x45ac3d=_0x31e6db;if(_0x2da79e[_0x45ac3d(0x22f)+_0x45ac3d(0x26d)]===_0x34ff30[_0x45ac3d(0x2f4)][_0x45ac3d(0x22f)+_0x45ac3d(0x26d)])return;throw new Error('runtime\x20'+_0x45ac3d(0x22f)+_0x45ac3d(0x102)+'atch:\x20ma'+'nifest='+(_0x2da79e['nodeVers'+'ion']||'unknown')+(_0x45ac3d(0xe1)+_0x45ac3d(0xd8))+_0x34ff30['openclaw'][_0x45ac3d(0x22f)+_0x45ac3d(0x26d)]+'.\x20'+('Run\x20\x22wuj'+'ie-shell'+'\x20prepare'+_0x45ac3d(0x168)+'\x20product'+_0x45ac3d(0x216)+_0x45ac3d(0x17b)+_0x45ac3d(0x20a)+_0x45ac3d(0x13b)+_0x45ac3d(0x292)+_0x45ac3d(0xb1)+_0x45ac3d(0xb6)+'.'));}function validateRuntimeOpenClawVersion(_0x294230,_0x520ab4){const _0x4f925c=_0x31e6db;if(_0x294230[_0x4f925c(0x2f4)+_0x4f925c(0x99)]===_0x520ab4[_0x4f925c(0x2f4)]['openclaw'+'Version'])return;throw new Error(_0x4f925c(0x20e)+'openclaw'+'Version\x20'+'mismatch'+_0x4f925c(0x2e9)+'st='+(_0x294230[_0x4f925c(0x2f4)+_0x4f925c(0x99)]||_0x4f925c(0x11f))+(',\x20shell.'+'config=')+_0x520ab4[_0x4f925c(0x2f4)][_0x4f925c(0x2f4)+_0x4f925c(0x99)]+'.\x20'+(_0x4f925c(0x2d5)+'ie-shell'+_0x4f925c(0x153)+_0x4f925c(0x168)+'\x20runtime'+_0x4f925c(0x110)+_0x4f925c(0xeb)+_0x4f925c(0x292)+_0x4f925c(0x1f5)+'Claw\x20ver'+'sion.'));}function parseNpmPackJson(_0x2894c7){const _0x26c1f0=_0x31e6db,_0x1ee806=_0x2894c7[_0x26c1f0(0x293)](),_0x3ac103=_0x1ee806[_0x26c1f0(0xaf)]('[');if(_0x3ac103<0x0)throw new Error(_0x26c1f0(0x32c)+_0x26c1f0(0x296)+_0x26c1f0(0xc1)+_0x26c1f0(0x30d)+_0x1ee806[_0x26c1f0(0x214)](0x0,0x1f4));const _0x41bd2e=JSON['parse'](_0x1ee806[_0x26c1f0(0x214)](_0x3ac103)),_0x43a965=Array[_0x26c1f0(0x1e3)](_0x41bd2e)?_0x41bd2e[0x0]:_0x41bd2e;if(!_0x43a965||typeof _0x43a965!==_0x26c1f0(0xd5))throw new Error('npm\x20pack'+'\x20returne'+_0x26c1f0(0x13a)+_0x26c1f0(0x1d7)+_0x26c1f0(0x2cb)+_0x1ee806[_0x26c1f0(0x214)](0x0,0x1f4));return _0x43a965;}function normalizePackedTarballFilename(_0xc04141){const _0x35b76d=_0x31e6db;return _0xc04141['replace'](/^@/,'')[_0x35b76d(0x126)+'ll']('/','-')[_0x35b76d(0x126)+'ll']('\x5c','-');}function _0x3914(_0x35481d,_0xf78ef0){_0x35481d=_0x35481d-0x7f;const _0x5a9f63=_0x5a9f();let _0x391488=_0x5a9f63[_0x35481d];return _0x391488;}async function runProcess(_0x3b2fea,_0x16360d,_0x15e4d1={}){const _0x1db66e=_0x31e6db,_0x396162=_0x15e4d1[_0x1db66e(0x204)]||[_0x3b2fea,..._0x16360d][_0x1db66e(0x89)]('\x20'),_0x49a5fd=_0x15e4d1[_0x1db66e(0x208)+'s']??NPM_INSTALL_TIMEOUT_MS,_0x5e6cff=spawn(_0x3b2fea,_0x16360d,{'cwd':_0x15e4d1['cwd'],'env':_0x15e4d1[_0x1db66e(0x130)],'stdio':[_0x1db66e(0x17f),'pipe',_0x1db66e(0x128)]});return await new Promise((_0x137643,_0x390690)=>{const _0x51aa94=_0x1db66e;let _0x2fd07e='',_0x59ca4e='',_0x5d9350=![];const _0x517436=setTimeout(()=>{const _0x647185=_0x3914;if(_0x5d9350)return;_0x5d9350=!![],_0x5e6cff[_0x647185(0x1e1)]('SIGTERM'),_0x390690(new Error(_0x396162+(_0x647185(0x100)+_0x647185(0x186)+'\x20')+_0x49a5fd+'ms'));},_0x49a5fd);_0x5e6cff[_0x51aa94(0x25c)]['on']('data',_0x48b2f4=>{const _0x369fc2=_0x51aa94;_0x2fd07e+=_0x48b2f4[_0x369fc2(0x8f)]();}),_0x5e6cff['stderr']['on']('data',_0x4aa0d9=>{_0x59ca4e+=_0x4aa0d9['toString']();}),_0x5e6cff['on'](_0x51aa94(0x1fc),_0x509954=>{if(_0x5d9350)return;_0x5d9350=!![],clearTimeout(_0x517436),_0x390690(_0x509954);}),_0x5e6cff['on'](_0x51aa94(0x272),(_0x586639,_0x22e4b6)=>{const _0x45e64c=_0x51aa94;if(_0x5d9350)return;_0x5d9350=!![],clearTimeout(_0x517436);if(_0x586639===0x0){_0x137643({'stdout':_0x2fd07e,'stderr':_0x59ca4e});return;}_0x390690(new Error(_0x396162+(_0x45e64c(0x10a)+'with\x20cod'+'e=')+(_0x586639??_0x45e64c(0x16b))+'\x20signal='+(_0x22e4b6??_0x45e64c(0x16b))+'\x0a'+(''+(_0x59ca4e||_0x2fd07e))[_0x45e64c(0x293)]()));});});}async function installOpenClawPackage(_0x8b33bc,_0x3a3f99){const _0x17a2bb=_0x31e6db,_0x4e0de6=join(_0x8b33bc[_0x17a2bb(0x1a8)+'oot'],_0x17a2bb(0x163)),_0x5c7cd9=join(_0x8b33bc[_0x17a2bb(0x1a8)+_0x17a2bb(0xa4)],'.opencla'+'w-extrac'+'t');await mkdir(_0x4e0de6,{'recursive':!![]}),await removePathWithRetries(_0x5c7cd9),await mkdir(_0x5c7cd9,{'recursive':!![]});const _0x27edab=await createRuntimeEnv(_0x8b33bc),_0x964e1e=_0x17a2bb(0x2f4)+'@'+_0x3a3f99;console[_0x17a2bb(0x144)]('[wujie-s'+_0x17a2bb(0x1c4)+'time]\x20in'+'stalling'+'\x20'+_0x964e1e);const _0x2ef49f=await runProcess(_0x8b33bc[_0x17a2bb(0x288)+_0x17a2bb(0x32e)],[_0x8b33bc[_0x17a2bb(0x154)],_0x17a2bb(0xdd),_0x964e1e,_0x17a2bb(0x316)],{'cwd':_0x4e0de6,'env':_0x27edab,'label':_0x17a2bb(0x32c)+'\x20'+_0x964e1e}),_0x55a1fe=parseNpmPackJson(_0x2ef49f[_0x17a2bb(0x25c)]);if(_0x55a1fe[_0x17a2bb(0x274)]!==_0x3a3f99)throw new Error('Configur'+_0x17a2bb(0x2bc)+_0x17a2bb(0x129)+_0x3a3f99+(_0x17a2bb(0x152)+_0x17a2bb(0x14c))+_0x55a1fe[_0x17a2bb(0x274)]);const _0xfb5ccc=resolve(_0x4e0de6,_0x55a1fe['filename']);if(!existsSync(_0xfb5ccc))throw new Error(_0x17a2bb(0x32c)+'\x20did\x20not'+_0x17a2bb(0x310)+'tarball:'+'\x20'+_0xfb5ccc);await runProcess(_0x17a2bb(0xef),[_0x17a2bb(0x180),_0xfb5ccc,'-C',_0x5c7cd9],{'label':_0x17a2bb(0x30f)+_0x55a1fe[_0x17a2bb(0x21b)]}),await removePathWithRetries(_0x8b33bc[_0x17a2bb(0x2f4)+'WorkingD'+'ir']),await rename(join(_0x5c7cd9,_0x17a2bb(0x303)),_0x8b33bc[_0x17a2bb(0x2f4)+_0x17a2bb(0x294)+'ir']),await removePathWithRetries(_0x5c7cd9),await runProcess(_0x8b33bc[_0x17a2bb(0x288)+'utable'],[_0x8b33bc[_0x17a2bb(0x154)],'install',_0x17a2bb(0x2a0)+'ev','--omit=p'+_0x17a2bb(0x170),_0x17a2bb(0x32b)+'it','--no-fun'+'d','--legacy'+'-peer-de'+'ps'],{'cwd':_0x8b33bc[_0x17a2bb(0x2f4)+_0x17a2bb(0x294)+'ir'],'env':_0x27edab,'label':_0x17a2bb(0xf3)+_0x17a2bb(0x280)+_0x964e1e+(_0x17a2bb(0x216)+_0x17a2bb(0x117)+_0x17a2bb(0x1bb))});if(!existsSync(_0x8b33bc[_0x17a2bb(0x2f4)+'Bin']))throw new Error(_0x17a2bb(0x256)+_0x17a2bb(0x1e5)+_0x17a2bb(0x2cc)+_0x17a2bb(0x1d0)+_0x17a2bb(0x295)+':\x20'+_0x8b33bc['openclaw'+'Bin']);}async function ensureRuntimeBase(_0x23e678,_0x2c4194,_0x11e850={}){const _0x1196bf=_0x31e6db;await mkdir(_0x2c4194,{'recursive':!![]});let _0x15415b=await readRuntimeManifest(_0x2c4194);const _0x4e3bd4=_0x23e678[_0x1196bf(0x2f4)][_0x1196bf(0x22f)+'ion'],_0x51c7b8=_0x23e678['openclaw'][_0x1196bf(0x2f4)+_0x1196bf(0x99)],_0x30a01f=existsSync(resolveManifestPath(_0x2c4194)),_0x2e3c1c=runtimeHasRequiredPaths(_0x2c4194,_0x15415b),_0x4e5d8a=_0x15415b[_0x1196bf(0x22f)+_0x1196bf(0x26d)]===_0x4e3bd4;!_0x30a01f||!_0x2e3c1c||!_0x4e5d8a?(_0x11e850[_0x1196bf(0xf8)+'ogger']?.['importan'+'t']?.('runtime\x20'+_0x1196bf(0x1f7)+'ld\x20start'+'ed',{'runtimeRoot':_0x2c4194,'reason':!_0x30a01f?_0x1196bf(0xac)+_0x1196bf(0x2b3):!_0x2e3c1c?_0x1196bf(0xac)+_0x1196bf(0x2d4)+_0x1196bf(0x216)+_0x1196bf(0x2e5):_0x1196bf(0xe9)+_0x1196bf(0xb8)+_0x1196bf(0x187),'syncOnly':_0x11e850[_0x1196bf(0x2d1)]}),_0x15415b=await buildRuntimeBase(_0x23e678,_0x2c4194,_0x15415b),_0x11e850[_0x1196bf(0xf8)+_0x1196bf(0x318)]?.[_0x1196bf(0x1fa)+'t']?.(_0x1196bf(0x20e)+_0x1196bf(0x1f7)+_0x1196bf(0x270)+_0x1196bf(0x14b),{'manifest':summarizeRuntimeManifest(_0x15415b)})):_0x11e850[_0x1196bf(0xf8)+'ogger']?.[_0x1196bf(0x1fa)+'t']?.(_0x1196bf(0x20e)+_0x1196bf(0x1ce)+_0x1196bf(0x2cf)+'rent',{'manifest':summarizeRuntimeManifest(_0x15415b)});if(!existsSync(resolve(_0x2c4194,_0x15415b[_0x1196bf(0x2f4)+_0x1196bf(0xa6)]))){const _0x50d21e=createRuntimeInfoFromManifest(_0x2c4194,_0x15415b,{'allowMissingOpenClaw':!![]});await installOpenClawPackage(_0x50d21e,_0x51c7b8),_0x15415b[_0x1196bf(0x2f4)+_0x1196bf(0x99)]=_0x51c7b8;}return _0x15415b;}function runtimeHasRequiredPaths(_0x48351b,_0x440976){const _0x2ce889=_0x31e6db;return['nodeExec'+_0x2ce889(0x32e),'npmCli','openclaw'+_0x2ce889(0x294)+'ir',_0x2ce889(0x2f4)+_0x2ce889(0xa6)][_0x2ce889(0x205)](_0x45252e=>typeof _0x440976[_0x45252e]===_0x2ce889(0x315)&&_0x440976[_0x45252e]['trim']())&&[_0x2ce889(0x288)+_0x2ce889(0x32e),_0x2ce889(0x154)][_0x2ce889(0x205)](_0x335b3e=>existsSync(resolve(_0x48351b,_0x440976[_0x335b3e])));}async function buildRuntimeBase(_0x4e07ed,_0x332faa,_0x3d14d7={}){const _0x533839=_0x31e6db,_0x3d592a=join(_0x332faa,_0x533839(0x16d));await ensureRuntimeNode(_0x4e07ed,_0x3d592a);const _0x57c2b9=process[_0x533839(0x2fa)]===_0x533839(0x21a)?_0x533839(0x278)+_0x533839(0x263):_0x533839(0x197)+_0x533839(0x302),_0x5ded57=process[_0x533839(0x2fa)]===_0x533839(0x21a)?_0x533839(0x278)+_0x533839(0x307)+_0x533839(0x125)+'n/npm-cl'+_0x533839(0x19c):_0x533839(0xa7)+_0x533839(0x1af)+_0x533839(0x161)+_0x533839(0x28f)+_0x533839(0x11c),_0x5c621f={..._0x3d14d7,'generatedAt':new Date()[_0x533839(0xa9)+_0x533839(0x15b)](),'nodeVersion':_0x4e07ed[_0x533839(0x2f4)][_0x533839(0x22f)+_0x533839(0x26d)],'openclawVersion':_0x3d14d7[_0x533839(0x2f4)+_0x533839(0x99)]||'','platform':process[_0x533839(0x2fa)],'arch':process['arch'],'nodeExecutable':_0x57c2b9,'npmCli':_0x5ded57,'openclawWorkingDir':_0x533839(0x2f4),'openclawBin':_0x533839(0x2f4)+_0x533839(0x93)+_0x533839(0x1da)};return await writeJson(resolveManifestPath(_0x332faa),_0x5c621f),_0x5c621f;}async function removePathWithRetries(_0x3d0bfb){await rm(_0x3d0bfb,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96});}async function ensureRuntimeNode(_0x355f8a,_0x1bb142){const _0xa758b6=_0x31e6db,_0xb8f568=_0x355f8a[_0xa758b6(0x2f4)][_0xa758b6(0x22f)+_0xa758b6(0x26d)],_0x2407ce=process[_0xa758b6(0x2fa)]===_0xa758b6(0x21a)?join(_0x1bb142,_0xa758b6(0x261)):join(_0x1bb142,_0xa758b6(0x1a1),_0xa758b6(0x16d)),_0x5dbbbe=process[_0xa758b6(0x2fa)]===_0xa758b6(0x21a)?join(_0x1bb142,'node_mod'+_0xa758b6(0x2af),'npm','bin',_0xa758b6(0x21f)+'js'):join(_0x1bb142,_0xa758b6(0xbd),_0xa758b6(0xcf)+_0xa758b6(0x2af),_0xa758b6(0x311),_0xa758b6(0x1a1),'npm-cli.'+'js');if(existsSync(_0x2407ce)&&existsSync(_0x5dbbbe)&&await getNodeVersion(_0x2407ce)===_0xb8f568)return;await removePathWithRetries(_0x1bb142);if(process[_0xa758b6(0x27a)][_0xa758b6(0x16d)]===_0xb8f568){await linkCurrentNodeRuntime(_0x1bb142);return;}await downloadNodeRuntime(_0xb8f568,_0x1bb142);}async function getNodeVersion(_0x567264){const _0x4e717c=_0x31e6db;try{const _0x365349=await runProcess(_0x567264,['-p','process.'+_0x4e717c(0x27a)+'.node'],{'label':_0x567264+_0x4e717c(0xb6),'timeoutMs':0x7530});return _0x365349[_0x4e717c(0x25c)]['trim']();}catch{return'';}}async function linkCurrentNodeRuntime(_0x4fdb28){const _0x5c63fa=_0x31e6db,_0x583002=process[_0x5c63fa(0x236)],_0x5bb805=resolve(dirname(_0x583002),'..'),_0x2c20d1=process['platform']===_0x5c63fa(0x21a)?resolve(_0x5bb805,'node_mod'+_0x5c63fa(0x1c7)):resolve(_0x5bb805,_0x5c63fa(0x260)+_0x5c63fa(0x1e4)+_0x5c63fa(0x133)),_0x25e57b=process[_0x5c63fa(0x2fa)]===_0x5c63fa(0x21a)?join(_0x4fdb28,_0x5c63fa(0x261)):join(_0x4fdb28,'bin',_0x5c63fa(0x16d)),_0x577445=process['platform']==='win32'?join(_0x4fdb28,_0x5c63fa(0xcf)+_0x5c63fa(0x2af),_0x5c63fa(0x311)):join(_0x4fdb28,'lib',_0x5c63fa(0xcf)+'ules',_0x5c63fa(0x311));await mkdir(dirname(_0x25e57b),{'recursive':!![]}),await mkdir(dirname(_0x577445),{'recursive':!![]}),await symlink(_0x583002,_0x25e57b),existsSync(_0x2c20d1)?await symlink(_0x2c20d1,_0x577445):await symlink(await resolveNpmRoot(),_0x577445);}async function resolveNpmRoot(){const _0x52c646=_0x31e6db,_0xcc2dab=await runProcess('npm',[_0x52c646(0x2b4),'-g'],{'label':_0x52c646(0x151)+_0x52c646(0x2c4),'timeoutMs':0x7530}),_0x27b336=process[_0x52c646(0x2fa)]===_0x52c646(0x21a)?_0xcc2dab[_0x52c646(0x25c)][_0x52c646(0x293)]():join(_0xcc2dab[_0x52c646(0x25c)][_0x52c646(0x293)](),'npm');if(!existsSync(join(_0x27b336,_0x52c646(0x1a1),_0x52c646(0x21f)+'js')))throw new Error(_0x52c646(0x32c)+_0x52c646(0x8b)+_0x52c646(0xf2)+_0x52c646(0x1c0)+_0x52c646(0x106)+_0x52c646(0x1e6)+_0x52c646(0x24f)+_0x27b336);return _0x27b336;}async function resolveExtractedNodeRoot(_0x3224c2,_0x3b93cc){const _0x30a5ec=_0x31e6db,_0x273bb5=join(_0x3224c2,_0x3b93cc);if(existsSync(_0x273bb5))return _0x273bb5;const _0x3a5ecc=await readdir(_0x3224c2,{'withFileTypes':!![]}),_0x564f41=_0x3a5ecc[_0x30a5ec(0x132)](_0x5ba69a=>_0x5ba69a[_0x30a5ec(0xe0)+_0x30a5ec(0x306)]());if(_0x564f41[_0x30a5ec(0x118)]===0x1)return join(_0x3224c2,_0x564f41[0x0]['name']);const _0x2edacc=process['platform']==='win32'?join(_0x3224c2,_0x30a5ec(0x261)):join(_0x3224c2,_0x30a5ec(0x1a1),_0x30a5ec(0x16d));if(existsSync(_0x2edacc))return _0x3224c2;const _0x42b5d2=await findNodeRuntimeRoot(_0x3224c2);if(_0x42b5d2)return _0x42b5d2;const _0x5820d2=_0x3a5ecc[_0x30a5ec(0x1e7)](_0x2b873b=>_0x2b873b['name'])[_0x30a5ec(0x89)](',\x20');throw new Error(_0x30a5ec(0x30c)+_0x30a5ec(0x23e)+'untime\x20r'+'oot\x20was\x20'+_0x30a5ec(0xf2)+_0x30a5ec(0x299)+_0x3b93cc+'\x20in\x20'+_0x3224c2+('.\x20Top-le'+_0x30a5ec(0x94)+'ies:\x20')+(_0x5820d2||_0x30a5ec(0x230)));}function resolveNodeExtractRoot(_0x1b33bc,_0x23f7b2,_0x1a242d){const _0x457be5=_0x31e6db;if(process[_0x457be5(0x2fa)]!==_0x457be5(0x21a))return join(_0x1b33bc,_0x23f7b2+(_0x457be5(0x22d)+'-')+process[_0x457be5(0x1e9)]+'-'+Date[_0x457be5(0x32a)]()+'-'+_0x1a242d);const _0x2f33b3=/^[A-Za-z]:[\\/]/[_0x457be5(0x231)](_0x1b33bc),_0x30b2c3=parse(_0x1b33bc),_0x42c4c0=_0x2f33b3?_0x2f33b3[0x0][_0x457be5(0x214)](0x0,0x2)+'\x5c':_0x30b2c3[_0x457be5(0x2b4)]&&_0x30b2c3[_0x457be5(0x2b4)]!=='/'?_0x30b2c3[_0x457be5(0x2b4)]:_0x1b33bc,_0x48efb5=_0x42c4c0['replace'](/[\\/]+$/,'');return _0x48efb5+_0x457be5(0x289)+process[_0x457be5(0x1e9)]+'-'+Date[_0x457be5(0x32a)]()+'-'+_0x1a242d;}async function findNodeRuntimeRoot(_0x444bd7){const _0x231fe5=_0x31e6db,_0x2ce1a7=[_0x444bd7],_0x3059ca=new Set();while(_0x2ce1a7[_0x231fe5(0x118)]>0x0){const _0x250726=_0x2ce1a7[_0x231fe5(0x179)]();if(!_0x250726||_0x3059ca['has'](_0x250726))continue;_0x3059ca[_0x231fe5(0x2e8)](_0x250726);const _0x541f20=process[_0x231fe5(0x2fa)]===_0x231fe5(0x21a)?join(_0x250726,'node.exe'):join(_0x250726,_0x231fe5(0x1a1),_0x231fe5(0x16d)),_0x26583a=process[_0x231fe5(0x2fa)]===_0x231fe5(0x21a)?join(_0x250726,'node_mod'+_0x231fe5(0x2af),'npm',_0x231fe5(0x1a1),'npm-cli.'+'js'):join(_0x250726,_0x231fe5(0xbd),_0x231fe5(0xcf)+_0x231fe5(0x2af),_0x231fe5(0x311),_0x231fe5(0x1a1),'npm-cli.'+'js');if(existsSync(_0x541f20)&&existsSync(_0x26583a))return _0x250726;const _0x4f5813=await readdir(_0x250726,{'withFileTypes':!![]});for(const _0x194578 of _0x4f5813){_0x194578[_0x231fe5(0xe0)+_0x231fe5(0x306)]()&&_0x2ce1a7[_0x231fe5(0xdf)](join(_0x250726,_0x194578[_0x231fe5(0x22a)]));}}return'';}async function downloadNodeRuntime(_0x2ab881,_0x26ba0b){const _0x91d796=_0x31e6db,_0x8b262b=process['platform']===_0x91d796(0x21a)?_0x91d796(0x29b):process['platform'],_0x3635b0=process[_0x91d796(0x23d)]===_0x91d796(0x1a6)?_0x91d796(0x1a6):process[_0x91d796(0x23d)]===_0x91d796(0x16c)?'arm64':process[_0x91d796(0x23d)],_0xde3569=process[_0x91d796(0x2fa)]===_0x91d796(0x21a)?_0x91d796(0x320):_0x91d796(0x141),_0xbcf0e2='node-v'+_0x2ab881+'-'+_0x8b262b+'-'+_0x3635b0,_0x53b4d1=_0xbcf0e2+'.'+_0xde3569,_0x5883e1=join(dirname(_0x26ba0b),'.cache'),_0x340abe=join(_0x5883e1,_0x53b4d1),_0x4a6adb=_0x91d796(0x13f)+'nodejs.o'+_0x91d796(0x2f6)+'v'+_0x2ab881+'/'+_0x53b4d1;await mkdir(_0x5883e1,{'recursive':!![]});const _0x453b6a=resolveNodeExtractRoot(_0x5883e1,_0xbcf0e2,0x1);!existsSync(_0x340abe)&&(console[_0x91d796(0x144)](_0x91d796(0x31b)+'hell:run'+_0x91d796(0x330)+_0x91d796(0x211)+'g\x20'+_0x4a6adb),await downloadFile(_0x4a6adb,_0x340abe));await rm(_0x453b6a,{'recursive':!![],'force':!![]}),await mkdir(_0x453b6a,{'recursive':!![]});process[_0x91d796(0x2fa)]===_0x91d796(0x21a)?await extractZipArchive(_0x340abe,_0x453b6a,_0x53b4d1):await runProcess(_0x91d796(0xef),[_0x91d796(0x1b3),_0x340abe,'-C',_0x453b6a],{'label':'extract\x20'+_0x53b4d1});const _0x4153fd=await resolveExtractedNodeRoot(_0x453b6a,_0xbcf0e2);await mkdir(dirname(_0x26ba0b),{'recursive':!![]}),await rename(_0x4153fd,_0x26ba0b),_0x4153fd!==_0x453b6a&&await rm(_0x453b6a,{'recursive':!![],'force':!![]});}async function extractZipArchive(_0x1915e3,_0x51eb7c,_0x49be85){const _0x69a79c=_0x31e6db;await runProcess(_0x69a79c(0xd9)+_0x69a79c(0x243),[_0x69a79c(0x26b)+'le',_0x69a79c(0x13c)+_0x69a79c(0x15e),_0x69a79c(0x24b),_0x69a79c(0xe8),_0x69a79c(0x16f)+_0x69a79c(0x322)+_0x69a79c(0x29e)+_0x69a79c(0xf6)+':WUJIE_S'+_0x69a79c(0x17e)+_0x69a79c(0xea)+_0x69a79c(0x1ad)+_0x69a79c(0x24d)+_0x69a79c(0x1f2)+_0x69a79c(0x2fd)+_0x69a79c(0xe7)+_0x69a79c(0x8c)+'ce'],{'env':{...process.env,'WUJIE_SHELL_ARCHIVE':_0x1915e3,'WUJIE_SHELL_EXTRACT_ROOT':_0x51eb7c},'label':_0x69a79c(0x30f)+_0x49be85});}async function downloadFile(_0x336162,_0x1eb3ac){await mkdir(dirname(_0x1eb3ac),{'recursive':!![]});const _0xa0183a=await new Promise((_0x486847,_0x109b84)=>{const _0x51e788=_0x3914;get(_0x336162,_0xe4b40b=>{const _0x1b0179=_0x3914;if(_0xe4b40b['statusCo'+'de']>=0x12c&&_0xe4b40b[_0x1b0179(0x145)+'de']<0x190&&_0xe4b40b[_0x1b0179(0x188)][_0x1b0179(0x1d1)]){_0xe4b40b['resume'](),downloadFile(new URL(_0xe4b40b['headers'][_0x1b0179(0x1d1)],_0x336162)[_0x1b0179(0xe6)],_0x1eb3ac)[_0x1b0179(0x113)](()=>_0x486847(null))['catch'](_0x109b84);return;}if(_0xe4b40b[_0x1b0179(0x145)+'de']!==0xc8){_0xe4b40b[_0x1b0179(0x1d3)](),_0x109b84(new Error(_0x1b0179(0x31d)+_0x1b0179(0x10a)+_0xe4b40b[_0x1b0179(0x145)+'de']+':\x20'+_0x336162));return;}_0x486847(_0xe4b40b);})['on'](_0x51e788(0x1fc),_0x109b84);});_0xa0183a&&await pipeline(_0xa0183a,createWriteStream(_0x1eb3ac));}export async function ensureOpenClawDoctorFixed(_0x456be2,_0x41f8e1={}){const _0xaf2b46=_0x31e6db,_0x3c3aeb=await loadRuntimeInfo(_0x456be2[_0xaf2b46(0x18c)+_0xaf2b46(0xa4)]),_0x2759ab=getConfigPaths(_0x456be2),_0x24d41f=join(_0x2759ab[_0xaf2b46(0x251)+'tateDir'],'openclaw'+_0xaf2b46(0x147)+'json'),_0x25933a=await readJson(_0x24d41f,{});if(_0x25933a[_0xaf2b46(0x2f4)+'Version']===_0x3c3aeb[_0xaf2b46(0x2f4)+_0xaf2b46(0x99)])return _0x41f8e1[_0xaf2b46(0xf8)+_0xaf2b46(0x318)]?.['info'](_0xaf2b46(0x2f4)+_0xaf2b46(0x2f5)+'fix\x20alre'+_0xaf2b46(0x1cc)+'ent',{'openclawVersion':_0x3c3aeb[_0xaf2b46(0x2f4)+_0xaf2b46(0x99)],'markerPath':_0x24d41f}),{'ran':![],'openclawVersion':_0x3c3aeb['openclaw'+_0xaf2b46(0x99)],'markerPath':_0x24d41f};return await runOpenClawDoctorFix(_0x456be2,_0x3c3aeb,{'fromVersion':_0x25933a[_0xaf2b46(0x2f4)+_0xaf2b46(0x99)]||_0xaf2b46(0x11f),'toVersion':_0x3c3aeb[_0xaf2b46(0x2f4)+_0xaf2b46(0x99)],'markerPath':_0x24d41f,'runtimeLogger':_0x41f8e1[_0xaf2b46(0xf8)+_0xaf2b46(0x318)]}),{'ran':!![],'openclawVersion':_0x3c3aeb['openclaw'+'Version'],'markerPath':_0x24d41f};}async function runOpenClawDoctorFix(_0x3cc147,_0x19731d,{fromVersion:_0x5a7340,toVersion:_0x17729b,markerPath:markerPath='',runtimeLogger:_0x52f82a}={}){const _0x3297e0=_0x31e6db;_0x52f82a?.[_0x3297e0(0x1fa)+'t']?.(_0x3297e0(0x2f4)+_0x3297e0(0x2f5)+'fix\x20star'+_0x3297e0(0x9f),{'fromVersion':_0x5a7340,'toVersion':_0x17729b});const _0x4f4073=await createRuntimeEnv(_0x19731d,{'OPENCLAW_HOME':_0x3cc147[_0x3297e0(0xe4)],'OPENCLAW_STATE_DIR':_0x3cc147[_0x3297e0(0xe4)],'OPENCLAW_CONFIG_PATH':getConfigPaths(_0x3cc147)[_0x3297e0(0x1bd)+'th']});console['log'](_0x3297e0(0x31b)+'hell:run'+_0x3297e0(0x2c0)+'nning\x20op'+'enclaw\x20d'+_0x3297e0(0xa5)+_0x3297e0(0x1eb));const _0x35afa9=await runProcess(_0x19731d[_0x3297e0(0x288)+'utable'],[_0x19731d[_0x3297e0(0x2f4)+_0x3297e0(0xa6)],_0x3297e0(0xc0),_0x3297e0(0x96)],{'cwd':_0x19731d[_0x3297e0(0x2f4)+_0x3297e0(0x294)+'ir'],'env':_0x4f4073,'label':'openclaw'+_0x3297e0(0x2f5)+'--fix','timeoutMs':0x1d4c0});_0x52f82a?.[_0x3297e0(0x1fa)+'t']?.('openclaw'+_0x3297e0(0x2f5)+'fix\x20comp'+_0x3297e0(0x308),{'fromVersion':_0x5a7340,'toVersion':_0x17729b,'stdout':_0x35afa9[_0x3297e0(0x25c)][_0x3297e0(0x293)]()[_0x3297e0(0x214)](-0xfa0),'stderr':_0x35afa9[_0x3297e0(0x286)][_0x3297e0(0x293)]()['slice'](-0xfa0)}),markerPath&&(await writeJson(markerPath,{'openclawVersion':_0x19731d[_0x3297e0(0x2f4)+_0x3297e0(0x99)],'fixedAt':new Date()[_0x3297e0(0xa9)+'ing']()}),_0x52f82a?.[_0x3297e0(0x1fa)+'t']?.('openclaw'+'\x20doctor\x20'+_0x3297e0(0xe5)+'er\x20writt'+'en',{'markerPath':markerPath,'openclawVersion':_0x19731d[_0x3297e0(0x2f4)+_0x3297e0(0x99)]}));}export async function readRuntimeManifest(_0x71e737){return await readJson(resolveManifestPath(_0x71e737),{});}export async function loadRuntimeInfo(_0x3303e4){const _0x1e54e7=resolveRuntimeRoot(_0x3303e4),_0x32e41e=await readRuntimeManifest(_0x1e54e7);return createRuntimeInfoFromManifest(_0x1e54e7,_0x32e41e);}function createRuntimeInfoFromManifest(_0x5a5cd4,_0x1b4bc5,_0x3928c8={}){const _0x159273=_0x31e6db;for(const _0xee72df of[_0x159273(0x288)+_0x159273(0x32e),_0x159273(0x154),'openclaw'+_0x159273(0x294)+'ir',_0x159273(0x2f4)+'Bin']){if(typeof _0x1b4bc5[_0xee72df]!==_0x159273(0x315)||!_0x1b4bc5[_0xee72df][_0x159273(0x293)]())throw new Error(_0x159273(0x20e)+_0x159273(0x2b3)+'\x20is\x20miss'+_0x159273(0x103)+_0xee72df+_0x159273(0x336)+resolveManifestPath(_0x5a5cd4)+(_0x159273(0x2b7)+_0x159273(0x2a1)+'l\x20prepar'+'e'));}const _0x5596b3=resolve(_0x5a5cd4,_0x1b4bc5[_0x159273(0x288)+_0x159273(0x32e)]),_0x125ae4=resolve(_0x5a5cd4,_0x1b4bc5['npmCli']),_0x44ddee=resolve(_0x5a5cd4,_0x1b4bc5['openclaw'+_0x159273(0x294)+'ir']),_0x4becaf=resolve(_0x5a5cd4,_0x1b4bc5['openclaw'+_0x159273(0xa6)]),_0x5dee21=Array[_0x159273(0x1e3)](_0x1b4bc5[_0x159273(0xec)])?_0x1b4bc5['plugins'][_0x159273(0x1e7)](_0x3f62d4=>({..._0x3f62d4,'installPath':resolve(_0x5a5cd4,_0x3f62d4[_0x159273(0x207)+_0x159273(0x2ae)])})):[],_0x2893c6=_0x3928c8[_0x159273(0x326)+_0x159273(0x291)+_0x159273(0x17a)]?[_0x5596b3,_0x125ae4]:[_0x5596b3,_0x125ae4,_0x44ddee,_0x4becaf];for(const _0x17f581 of _0x2893c6){if(!existsSync(_0x17f581))throw new Error(_0x159273(0x20e)+_0x159273(0xac)+_0x159273(0x2d9)+_0x17f581);}return{'runtimeRoot':_0x5a5cd4,'manifest':_0x1b4bc5,'openclawVersion':_0x1b4bc5[_0x159273(0x2f4)+'Version']||_0x159273(0x11f),'nodeExecutable':_0x5596b3,'npmCli':_0x125ae4,'openclawWorkingDir':_0x44ddee,'openclawBin':_0x4becaf,'plugins':_0x5dee21};}export async function spawnClaw(_0x44314a,_0x186681=[],_0x47eead={}){const _0x4242bd=_0x31e6db,_0x2ed6e3=await loadRuntimeInfo(_0x44314a),_0x3b7ca0=await createRuntimeEnv(_0x2ed6e3,_0x47eead[_0x4242bd(0x130)]??{});return spawn(_0x2ed6e3[_0x4242bd(0x288)+'utable'],[_0x2ed6e3[_0x4242bd(0x2f4)+_0x4242bd(0xa6)],..._0x186681],{'cwd':_0x2ed6e3[_0x4242bd(0x2f4)+_0x4242bd(0x294)+'ir'],'stdio':'pipe',..._0x47eead,'env':_0x3b7ca0});}export async function runClawOnce(_0x50c1c3,_0x32bcf0=[],_0x6b64e=0x15f90){const _0x53e655=await spawnClaw(_0x50c1c3,_0x32bcf0);return await new Promise((_0x1e35ac,_0x44c3c1)=>{const _0x52d02c=_0x3914;let _0x1b8892='',_0x3f615d='',_0x104717=![];const _0x9fe60a=setTimeout(()=>{const _0x43b336=_0x3914;if(_0x104717)return;_0x104717=!![],_0x53e655[_0x43b336(0x1e1)](_0x43b336(0x233)),_0x44c3c1(new Error(_0x43b336(0x2f4)+_0x43b336(0x100)+_0x43b336(0x186)+'\x20'+_0x6b64e+'ms'));},_0x6b64e);_0x53e655['stdout']['on'](_0x52d02c(0x1b1),_0xbdbc07=>{_0x1b8892+=_0xbdbc07['toString']();}),_0x53e655[_0x52d02c(0x286)]['on'](_0x52d02c(0x1b1),_0x8fbe89=>{const _0xf9f270=_0x52d02c;_0x3f615d+=_0x8fbe89[_0xf9f270(0x8f)]();}),_0x53e655['on']('error',_0x30551f=>{if(_0x104717)return;_0x104717=!![],clearTimeout(_0x9fe60a),_0x44c3c1(_0x30551f);}),_0x53e655['on']('close',(_0x502647,_0x4a7a90)=>{if(_0x104717)return;_0x104717=!![],clearTimeout(_0x9fe60a),_0x1e35ac({'code':_0x502647,'signal':_0x4a7a90,'stdout':_0x1b8892,'stderr':_0x3f615d});});});}export{resolveRuntimeLarkCliCommand};function resolvePackageNameFromNpmSpec(_0x578ff5){const _0x4fd009=_0x31e6db,_0x251f1f=_0x578ff5['trim']()[_0x4fd009(0x28e)](/^npm:/,'');if(!_0x251f1f)throw new Error(_0x4fd009(0x14f)+_0x4fd009(0x1aa)+_0x4fd009(0x1d4)+'c');if(_0x251f1f[_0x4fd009(0x28d)+'th']('@')){const _0x44615c=_0x251f1f[_0x4fd009(0xaf)]('/');if(_0x44615c===-0x1)throw new Error(_0x4fd009(0x14f)+_0x4fd009(0xcd)+_0x4fd009(0x1f3)+_0x578ff5);const _0x3c3483=_0x251f1f[_0x4fd009(0xaf)]('@',_0x44615c+0x1);return _0x3c3483===-0x1?_0x251f1f:_0x251f1f['slice'](0x0,_0x3c3483);}const _0x272a3a=_0x251f1f[_0x4fd009(0xaf)]('@');return _0x272a3a===-0x1?_0x251f1f:_0x251f1f[_0x4fd009(0x214)](0x0,_0x272a3a);}async function createRuntimeEnv(_0x5c8ff4,_0x559aa7={}){const _0xb5b578=_0x31e6db,_0x5e009a={...process.env,..._0x559aa7},_0x4cbad2=_0x5e009a['OPENCLAW'+_0xb5b578(0xf4)+'IR']||'',_0x284bd0=_0x5e009a[_0xb5b578(0xff)+'IG_REGIS'+_0xb5b578(0x2ec)]||_0xb5b578(0x13f)+_0xb5b578(0xb4)+_0xb5b578(0x2b5)+'or.com',_0x25d628=_0x4cbad2?join(_0x4cbad2,_0xb5b578(0x22c)+_0xb5b578(0x324)+'ls'):join(_0x5c8ff4[_0xb5b578(0x1a8)+'oot'],'.tools'),_0x50f21b=join(_0x25d628,_0xb5b578(0x166)+'al'),_0x520fd9=join(_0x25d628,_0xb5b578(0x277)+'e'),_0x4dd8ac=join(_0x50f21b,_0xb5b578(0x1a1));await mkdir(_0x4dd8ac,{'recursive':!![]}),await mkdir(_0x520fd9,{'recursive':!![]});const _0x27969a=[_0x4dd8ac,dirname(_0x5c8ff4['nodeExec'+'utable']),_0x5e009a[_0xb5b578(0x2a8)]||''];return{..._0x5e009a,'PATH':_0x27969a['filter'](Boolean)[_0xb5b578(0x89)](delimiter),'npm_config_prefix':_0x50f21b,'NPM_CONFIG_PREFIX':_0x50f21b,'npm_config_cache':_0x520fd9,'NPM_CONFIG_CACHE':_0x520fd9,'NPM_CONFIG_REGISTRY':_0x284bd0,'npm_execpath':_0x5c8ff4[_0xb5b578(0x154)],'npm_node_execpath':_0x5c8ff4['nodeExec'+_0xb5b578(0x32e)],'OPENCLAW_RUNTIME_NPM_PREFIX':_0x50f21b,'OPENCLAW_RUNTIME_NPM_BIN':_0x4dd8ac};}export async function getRuntimeSpawnContext(_0x28b9fa,_0x37d4ff={}){const _0x371793=_0x31e6db,_0x29e99e=await loadRuntimeInfo(_0x28b9fa),_0x2cd43d=await createRuntimeEnv(_0x29e99e,_0x37d4ff);return{'cwd':_0x29e99e[_0x371793(0x2f4)+_0x371793(0x294)+'ir'],'env':_0x2cd43d,'runtime':_0x29e99e};}function resolvePluginDirNameFromSpec(_0x9363c2){const _0x2e5d89=_0x31e6db,_0x41a601=resolvePackageNameFromNpmSpec(_0x9363c2),_0x36ec88=_0x41a601[_0x2e5d89(0xbb)]('/')[_0x2e5d89(0x132)](Boolean),_0x4baad4=_0x36ec88['at'](-0x1)??'';if(!_0x4baad4)throw new Error(_0x2e5d89(0x14f)+'plugin\x20s'+_0x2e5d89(0x1f3)+_0x9363c2);return _0x4baad4;}async function resolvePluginIdFromPackageDir(_0x466719,_0x3c1db4){const _0x150167=_0x31e6db,_0x434111=await readJson(join(_0x466719,_0x150167(0x2b2)+_0x150167(0x2e4)),{}),_0x5cbd66=await readPluginManifest(_0x466719),_0x5a0009=[_0x5cbd66?.['id'],_0x5cbd66?.['pluginId'],_0x5cbd66?.[_0x150167(0x22a)],_0x434111?.[_0x150167(0x2f4)]?.['id'],_0x434111?.[_0x150167(0x2f4)+'Id'],_0x3c1db4],_0x37d0f3=_0x5a0009[_0x150167(0x26e)](_0x900f2f=>typeof _0x900f2f===_0x150167(0x315)&&_0x900f2f['trim']());if(!_0x37d0f3)throw new Error('Unable\x20t'+_0x150167(0x29f)+_0x150167(0x9a)+_0x150167(0x201)+'\x20'+_0x466719);return _0x37d0f3['trim']();}function pluginSpecMatches(_0xeda02b,_0x522b98){const _0x824fe4=_0x31e6db,_0xcd656f=_0x522b98['trim'](),_0x433cce=resolvePackageNameFromNpmSpec(_0xcd656f);return[_0xeda02b[_0x824fe4(0x193)],_0xeda02b[_0x824fe4(0x33b)+'Spec'],_0xeda02b[_0x824fe4(0x33b)+'Name']][_0x824fe4(0x314)](_0x4e0cd8=>_0x4e0cd8===_0xcd656f||_0x4e0cd8===_0x433cce);}async function installPluginFromNpmSpec(_0x2630d7,_0x4fb5ee,_0x5653ff={}){const _0x18791c=_0x31e6db,_0x47633b=_0x2630d7['trim']()['replace'](/^npm:/,''),_0xec3d70=resolvePluginDirNameFromSpec(_0x47633b),_0x378351=join(_0x4fb5ee['openclaw'+'WorkingD'+'ir'],'dist',_0x18791c(0x305)+'ns'),_0x2f013f=join(_0x378351,_0xec3d70),_0x2b1273=join(_0x4fb5ee['runtimeR'+_0x18791c(0xa4)],_0x18791c(0xa2)+_0x18791c(0xb5)+process[_0x18791c(0x1e9)]+'-'+Date[_0x18791c(0x32a)]()),_0x593edf=await createRuntimeEnv(_0x4fb5ee),_0x2d98ef=new Date()[_0x18791c(0xa9)+_0x18791c(0x15b)](),_0x504b79=join(_0x4fb5ee[_0x18791c(0x1a8)+_0x18791c(0xa4)],_0x18791c(0x163));await mkdir(_0x504b79,{'recursive':!![]}),await rm(_0x2b1273,{'recursive':!![],'force':!![]}),await rm(_0x2f013f,{'recursive':!![],'force':!![]}),await mkdir(_0x2b1273,{'recursive':!![]}),await mkdir(_0x378351,{'recursive':!![]}),console[_0x18791c(0x144)](_0x18791c(0x31b)+_0x18791c(0x1c4)+'time]\x20fe'+_0x18791c(0x9b)+_0x18791c(0x332)+_0x47633b);const _0x1cde5d=await runProcess(_0x4fb5ee[_0x18791c(0x288)+'utable'],[_0x4fb5ee[_0x18791c(0x154)],'pack',_0x47633b,_0x18791c(0x316)],{'cwd':_0x504b79,'env':_0x593edf,'label':_0x18791c(0x32c)+'\x20'+_0x47633b}),_0x4ae003=parseNpmPackJson(_0x1cde5d[_0x18791c(0x25c)]),_0xd421d4=normalizePackedTarballFilename(_0x4ae003[_0x18791c(0x21b)]),_0x52d16e=join(_0x504b79,_0xd421d4);if(!existsSync(_0x52d16e))throw new Error('npm\x20pack'+'\x20did\x20not'+_0x18791c(0x310)+_0x18791c(0x12c)+'\x20'+_0x52d16e);await runProcess('tar',['-xzf',_0x52d16e,'-C',_0x2b1273],{'label':_0x18791c(0x30f)+_0xd421d4}),await rename(join(_0x2b1273,_0x18791c(0x303)),_0x2f013f),await rm(_0x2b1273,{'recursive':!![],'force':!![]});const _0x1d37a7=join(_0x2f013f,_0x18791c(0x2b2)+_0x18791c(0x2e4)),_0x4c2f62=await readJson(_0x1d37a7,{});(_0x4c2f62[_0x18791c(0x173)+_0x18791c(0x262)]||_0x4c2f62[_0x18791c(0x1dd)])&&(delete _0x4c2f62[_0x18791c(0x173)+_0x18791c(0x262)],delete _0x4c2f62[_0x18791c(0x1dd)],await writeJson(_0x1d37a7,_0x4c2f62));await runProcess(_0x4fb5ee['nodeExec'+_0x18791c(0x32e)],[_0x4fb5ee[_0x18791c(0x154)],_0x18791c(0x335),'--omit=d'+'ev','--omit=p'+_0x18791c(0x170),_0x18791c(0x32b)+'it',_0x18791c(0x224)+'d','--legacy'+_0x18791c(0x101)+'ps'],{'cwd':_0x2f013f,'env':_0x593edf,'label':_0x18791c(0xf3)+_0x18791c(0x19b)+_0x18791c(0x269)+_0x47633b});const _0x196b28=new Date()[_0x18791c(0xa9)+_0x18791c(0x15b)](),_0xbb20d4=await resolvePluginIdFromPackageDir(_0x2f013f,_0x4ae003[_0x18791c(0x22a)]);return _0x5653ff[_0x18791c(0xf8)+_0x18791c(0x318)]?.['info'](_0x18791c(0x88)+_0x18791c(0x2b8)+_0x18791c(0x285),{'spec':_0x47633b,'pluginId':_0xbb20d4,'installPath':_0x2f013f}),{'pluginId':_0xbb20d4,'source':_0x18791c(0x311),'spec':_0x47633b,'installPath':toRuntimeRelative(_0x4fb5ee[_0x18791c(0x1a8)+_0x18791c(0xa4)],_0x2f013f),'version':_0x4ae003['version'],'resolvedName':_0x4ae003['name'],'resolvedVersion':_0x4ae003['version'],'resolvedSpec':_0x4ae003[_0x18791c(0x22a)]+'@'+_0x4ae003[_0x18791c(0x274)],'integrity':typeof _0x4ae003[_0x18791c(0x31f)+'y']==='string'?_0x4ae003[_0x18791c(0x31f)+'y']:'','shasum':typeof _0x4ae003['shasum']==='string'?_0x4ae003[_0x18791c(0x1ea)]:'','resolvedAt':_0x2d98ef,'installedAt':_0x196b28};}async function syncConfiguredNpmPlugins(_0x1c1a44,_0x2ae580,_0x42c9e6,_0x2b401e={}){const _0x1c3b2c=_0x31e6db;if(_0x2b401e[_0x1c3b2c(0x2d1)])return;const _0x168c10=createRuntimeInfoFromManifest(_0x2ae580,_0x42c9e6),_0x4f5143=Array[_0x1c3b2c(0x1e3)](_0x42c9e6['plugins'])?_0x42c9e6[_0x1c3b2c(0xec)]:[],_0x4f6890=[];for(const _0x2c8799 of _0x1c1a44[_0x1c3b2c(0x2f4)]['pluginSp'+_0x1c3b2c(0x2ff)]){const _0x2d7a46=_0x4f5143[_0x1c3b2c(0x26e)](_0x52180e=>_0x52180e?.[_0x1c3b2c(0x215)]===_0x1c3b2c(0x311)&&pluginSpecMatches(_0x52180e,_0x2c8799)&&typeof _0x52180e[_0x1c3b2c(0x207)+_0x1c3b2c(0x2ae)]===_0x1c3b2c(0x315)&&existsSync(resolve(_0x2ae580,_0x52180e[_0x1c3b2c(0x207)+_0x1c3b2c(0x2ae)])));if(_0x2d7a46){_0x4f6890[_0x1c3b2c(0xdf)](_0x2d7a46);continue;}_0x4f6890[_0x1c3b2c(0xdf)](await installPluginFromNpmSpec(_0x2c8799,_0x168c10,_0x2b401e));}const _0xa23c8d=new Set(_0x1c1a44[_0x1c3b2c(0x2f4)][_0x1c3b2c(0x27b)+'ecs'][_0x1c3b2c(0x1e7)](resolvePackageNameFromNpmSpec)),_0x4e3384=_0x4f5143[_0x1c3b2c(0x132)](_0x2f4dea=>_0x2f4dea?.[_0x1c3b2c(0x215)]!==_0x1c3b2c(0x311)||!_0xa23c8d[_0x1c3b2c(0x15f)](resolvePackageNameFromNpmSpec(_0x2f4dea[_0x1c3b2c(0x33b)+_0x1c3b2c(0x2c8)]||_0x2f4dea[_0x1c3b2c(0x193)]||'')));_0x42c9e6[_0x1c3b2c(0xec)]=[..._0x4e3384,..._0x4f6890];}function hasRuntimeDependencies(_0x1f7b5b){const _0x260d65=_0x31e6db,_0x18405e=_0x1f7b5b?.[_0x260d65(0x2a4)+'cies']&&typeof _0x1f7b5b[_0x260d65(0x2a4)+_0x260d65(0x2a3)]===_0x260d65(0xd5)?Object[_0x260d65(0x86)](_0x1f7b5b[_0x260d65(0x2a4)+_0x260d65(0x2a3)]):[],_0x5e9058=_0x1f7b5b?.[_0x260d65(0x2f3)+_0x260d65(0x172)+_0x260d65(0x2a3)]&&typeof _0x1f7b5b['optional'+_0x260d65(0x172)+_0x260d65(0x2a3)]===_0x260d65(0xd5)?Object[_0x260d65(0x86)](_0x1f7b5b[_0x260d65(0x2f3)+_0x260d65(0x172)+'cies']):[];return _0x18405e[_0x260d65(0x118)]>0x0||_0x5e9058['length']>0x0;}async function installLocalPluginRuntimeDependencies(_0x38ba02,_0x124c12,_0x26f298){const _0x489b2a=_0x31e6db,_0x5af5ad=join(_0x38ba02,'package.'+_0x489b2a(0x2e4)),_0x2fab5a=await readJson(_0x5af5ad,{});(_0x2fab5a[_0x489b2a(0x173)+_0x489b2a(0x262)]||_0x2fab5a[_0x489b2a(0x1dd)])&&(delete _0x2fab5a[_0x489b2a(0x173)+_0x489b2a(0x262)],delete _0x2fab5a[_0x489b2a(0x1dd)],await writeJson(_0x5af5ad,_0x2fab5a));if(!hasRuntimeDependencies(_0x2fab5a))return;const _0xd29526=await createRuntimeEnv(_0x124c12);console[_0x489b2a(0x144)](_0x489b2a(0x31b)+_0x489b2a(0x1c4)+_0x489b2a(0x109)+'stalling'+'\x20local\x20p'+_0x489b2a(0x338)+'pendenci'+_0x489b2a(0x27c)+_0x38ba02),await runProcess(_0x124c12['nodeExec'+_0x489b2a(0x32e)],[_0x124c12[_0x489b2a(0x154)],_0x489b2a(0x335),_0x489b2a(0x2a0)+'ev',_0x489b2a(0x2f7)+_0x489b2a(0x170),_0x489b2a(0x32b)+'it',_0x489b2a(0x224)+'d',_0x489b2a(0x31a)+_0x489b2a(0x101)+'ps'],{'cwd':_0x38ba02,'env':_0xd29526,'label':_0x489b2a(0xf3)+_0x489b2a(0x19a)+_0x489b2a(0x24c)+'\x20'+_0x38ba02}),_0x26f298[_0x489b2a(0xf8)+_0x489b2a(0x318)]?.[_0x489b2a(0x2da)](_0x489b2a(0xe3)+_0x489b2a(0x1ac)+'endencie'+_0x489b2a(0xa8)+_0x489b2a(0x2ea),{'installPath':_0x38ba02});}async function syncSharedPluginModules(_0x355b15,_0x28e0fb){const _0x3d59e4=_0x31e6db,_0x4479fb=new Set();for(const _0x26ac77 of _0x355b15){const _0x4c5e47=join(dirname(_0x26ac77),_0x3d59e4(0x178));if(existsSync(_0x4c5e47))_0x4479fb[_0x3d59e4(0x2e8)](_0x4c5e47);}for(const _0x517a58 of _0x4479fb){await copyDirFresh(_0x517a58,join(_0x28e0fb,_0x3d59e4(0x178)));}}async function syncProductPlugins(_0x1d15b4,_0x47aaba,_0x31217,_0x578d4c={}){const _0x405725=_0x31e6db,_0x4fce25=join(_0x47aaba,_0x405725(0x2f4),_0x405725(0xc7),_0x405725(0x305)+'ns'),_0x2d0898=createRuntimeInfoFromManifest(_0x47aaba,_0x31217),_0x43da8f=[];await syncSharedPluginModules(_0x1d15b4[_0x405725(0x2f4)][_0x405725(0x33b)+_0x405725(0x84)+_0x405725(0x138)],_0x4fce25);for(const _0x22a913 of _0x1d15b4['openclaw']['resolved'+_0x405725(0x84)+'ginPaths']){const _0x555a3c=await getPackageMetadata(_0x22a913),_0x53cb84=await readPluginManifest(_0x22a913),_0x1f8dd2=join(_0x4fce25,_0x555a3c[_0x405725(0xe2)]);await copyDirFresh(_0x22a913,_0x1f8dd2),await installLocalPluginRuntimeDependencies(_0x1f8dd2,_0x2d0898,_0x578d4c),_0x43da8f['push']({'pluginId':_0x555a3c[_0x405725(0xe2)],'source':_0x405725(0x165),'spec':_0x405725(0x27f)+_0x22a913,'installPath':toRuntimeRelative(_0x47aaba,_0x1f8dd2),'version':_0x555a3c['version'],'resolvedName':_0x555a3c[_0x405725(0x22a)],'resolvedVersion':_0x555a3c[_0x405725(0x274)],'resolvedSpec':'local:'+_0x22a913,'integrity':'','shasum':'','resolvedAt':new Date()[_0x405725(0xa9)+_0x405725(0x15b)](),'installedAt':new Date()[_0x405725(0xa9)+_0x405725(0x15b)](),'agentScope':_0x53cb84[_0x405725(0x1bf)+'pe'],'skills':_0x53cb84[_0x405725(0x1fd)]});}const _0x1789ca=new Set(_0x43da8f[_0x405725(0x1e7)](_0x5b16d7=>_0x5b16d7['pluginId'])),_0x1e0bd4=Array[_0x405725(0x1e3)](_0x31217[_0x405725(0xec)])?_0x31217['plugins'][_0x405725(0x132)](_0x29ce13=>!_0x1789ca[_0x405725(0x15f)](_0x29ce13[_0x405725(0xe2)])):[];_0x31217[_0x405725(0xec)]=[..._0x1e0bd4,..._0x43da8f];}async function syncManifestPluginScope(_0x1d88b3,_0x247e82,_0x3db35c){const _0x5a3385=_0x31e6db,_0x4cf295=join(_0x247e82,_0x5a3385(0x2f4),'dist','extensio'+'ns'),_0x18043d=new Set(_0x1d88b3['openclaw'][_0x5a3385(0x27b)+_0x5a3385(0x2ff)]??[]),_0x181895=new Set([..._0x18043d]['map'](_0x2440d0=>_0x2440d0[_0x5a3385(0x28e)](/^npm:/,''))['map'](_0x12ecf2=>{const _0x334a18=_0x5a3385;if(_0x12ecf2[_0x334a18(0x28d)+'th']('@')){const _0x2f85dd=_0x12ecf2[_0x334a18(0xbb)]('@');return _0x2f85dd[_0x334a18(0x118)]>=0x3?'@'+_0x2f85dd[0x1]:_0x12ecf2;}return _0x12ecf2[_0x334a18(0xbb)]('@')[0x0];})['filter'](Boolean)),_0x5ee075=new Set();for(const _0x120527 of _0x1d88b3[_0x5a3385(0x2f4)]['resolved'+_0x5a3385(0x84)+_0x5a3385(0x138)]){const _0x22628b=await getPackageMetadata(_0x120527);if(_0x22628b[_0x5a3385(0xe2)])_0x5ee075['add'](_0x22628b[_0x5a3385(0xe2)]);}const _0x4e72cc=Array[_0x5a3385(0x1e3)](_0x3db35c[_0x5a3385(0xec)])?_0x3db35c[_0x5a3385(0xec)]:[];_0x3db35c[_0x5a3385(0x27b)+_0x5a3385(0x2ff)]=[..._0x1d88b3[_0x5a3385(0x2f4)][_0x5a3385(0x27b)+_0x5a3385(0x2ff)],..._0x1d88b3['openclaw'][_0x5a3385(0x33b)+'LocalPlu'+'ginPaths'][_0x5a3385(0x1e7)](_0x5155e2=>_0x5a3385(0x27f)+_0x5155e2)],_0x3db35c[_0x5a3385(0xec)]=_0x4e72cc[_0x5a3385(0x132)](_0x39bc37=>{const _0xf1c5a9=_0x5a3385;if(!_0x39bc37||typeof _0x39bc37!==_0xf1c5a9(0xd5))return![];if(_0x39bc37[_0xf1c5a9(0x215)]===_0xf1c5a9(0x165))return _0x5ee075[_0xf1c5a9(0x15f)](_0x39bc37[_0xf1c5a9(0xe2)]);if(_0x39bc37['source']===_0xf1c5a9(0x311))return _0x18043d['has'](_0x39bc37[_0xf1c5a9(0x193)])||_0x18043d[_0xf1c5a9(0x15f)](_0x39bc37[_0xf1c5a9(0x33b)+'Spec'])||_0x181895[_0xf1c5a9(0x15f)](_0x39bc37[_0xf1c5a9(0x33b)+'Name']);return![];});const _0x1213ea=new Set(_0x3db35c[_0x5a3385(0xec)]['map'](_0x27a7d2=>_0x27a7d2['pluginId']));for(const _0xf0f3bb of _0x4e72cc){if(!_0xf0f3bb['pluginId']||_0x1213ea['has'](_0xf0f3bb[_0x5a3385(0xe2)]))continue;const _0x5c9c5b=typeof _0xf0f3bb['installP'+'ath']===_0x5a3385(0x315)&&_0xf0f3bb[_0x5a3385(0x207)+_0x5a3385(0x2ae)][_0x5a3385(0x293)]()?resolve(_0x247e82,_0xf0f3bb[_0x5a3385(0x207)+_0x5a3385(0x2ae)]):join(_0x4cf295,_0xf0f3bb['pluginId']),_0x17e041=relative(_0x4cf295,_0x5c9c5b);if(_0x17e041[_0x5a3385(0x28d)+'th']('..')||_0x17e041==='')continue;await rm(_0x5c9c5b,{'recursive':!![],'force':!![]});}}async function collectCapabilityEntries(_0x5a1248,_0x14a2ad){const _0x571a42=_0x31e6db,_0x5623f5=new Map();for(const _0x5cbba9 of _0x5a1248){let _0x1d0c27;try{_0x1d0c27=await stat(_0x5cbba9);}catch{throw new Error(_0x14a2ad+(_0x571a42(0x14d)+'s\x20not\x20fo'+_0x571a42(0x167))+_0x5cbba9);}if(!_0x1d0c27[_0x571a42(0xe0)+'ory']())throw new Error(_0x14a2ad+('\x20path\x20mu'+_0x571a42(0x281)+'director'+_0x571a42(0x228))+_0x5cbba9);const _0x4a962d={'name':basename(_0x5cbba9),'path':_0x5cbba9},_0x447556=_0x5623f5[_0x571a42(0x244)](_0x4a962d['name']);if(_0x447556)throw new Error(_0x571a42(0x2f9)+'e\x20'+_0x14a2ad+_0x571a42(0x297)+_0x4a962d['name']+'\x22\x20from\x20'+_0x447556[_0x571a42(0x159)]+_0x571a42(0x1f4)+_0x4a962d[_0x571a42(0x159)]);_0x5623f5['set'](_0x4a962d[_0x571a42(0x22a)],_0x4a962d);}return[..._0x5623f5[_0x571a42(0x2a2)]()];}async function syncProductCapabilityDirs(_0x3e7b50,_0x17b361,_0x4b9c27){const _0x2d0e60=_0x31e6db,_0x181c4d=await collectCapabilityEntries(_0x3e7b50,_0x4b9c27);await rm(_0x17b361,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await mkdir(_0x17b361,{'recursive':!![]});for(const _0x1a8e04 of _0x181c4d){await cp(_0x1a8e04['path'],join(_0x17b361,_0x1a8e04[_0x2d0e60(0x22a)]),{'recursive':!![]});}return _0x181c4d[_0x2d0e60(0x118)];}export const __test__={'collectCapabilityEntries':collectCapabilityEntries,'prunePackagedRuntimePayload':prunePackagedRuntimePayload,'syncProductCapabilityDirs':syncProductCapabilityDirs,'resolveNodeExtractRoot':resolveNodeExtractRoot};async function syncProductAgents(_0x51a1a4,_0x1d7500,_0x4d1cdc){const _0xd230b5=_0x31e6db,_0x2ab384=join(_0x1d7500,'openclaw','agents'),_0x5b55bf=await syncProductCapabilityDirs(_0x51a1a4[_0xd230b5(0x2f4)][_0xd230b5(0x33b)+_0xd230b5(0xc2)+_0xd230b5(0xd6)],_0x2ab384,_0xd230b5(0xd0));_0x4d1cdc['agents']={'source':_0xd230b5(0x156),'installPath':toRuntimeRelative(_0x1d7500,_0x2ab384),'localPaths':_0x51a1a4[_0xd230b5(0x2f4)][_0xd230b5(0x33b)+'LocalAge'+_0xd230b5(0xd6)],'entryCount':_0x5b55bf};}async function syncProductSkills(_0x2d39f4,_0x1c2b28,_0x3f7cf7){const _0x33bf28=_0x31e6db,_0x886de=join(_0x1c2b28,_0x33bf28(0x2f4),'skills'),_0x575718=await syncProductCapabilityDirs(_0x2d39f4[_0x33bf28(0x2f4)][_0x33bf28(0x33b)+'LocalSki'+_0x33bf28(0x1a4)],_0x886de,_0x33bf28(0x283));_0x3f7cf7[_0x33bf28(0x1fd)]={'source':_0x33bf28(0x156),'installPath':toRuntimeRelative(_0x1c2b28,_0x886de),'localPaths':_0x2d39f4[_0x33bf28(0x2f4)][_0x33bf28(0x33b)+_0x33bf28(0xd2)+_0x33bf28(0x1a4)],'entryCount':_0x575718};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x5dd97b,_0x16e91b){const _0x25c3b9=_0x30c2,_0x2eb245=_0x5dd97b();while(!![]){try{const _0x427e9c=parseInt(_0x25c3b9(0x1f0))/0x1*(parseInt(_0x25c3b9(0x25a))/0x2)+-parseInt(_0x25c3b9(0x25f))/0x3*(parseInt(_0x25c3b9(0x1dc))/0x4)+parseInt(_0x25c3b9(0x236))/0x5*(-parseInt(_0x25c3b9(0x238))/0x6)+parseInt(_0x25c3b9(0x1ed))/0x7*(-parseInt(_0x25c3b9(0x202))/0x8)+-parseInt(_0x25c3b9(0x24e))/0x9*(-parseInt(_0x25c3b9(0x1ff))/0xa)+-parseInt(_0x25c3b9(0x20e))/0xb*(-parseInt(_0x25c3b9(0x1bd))/0xc)+parseInt(_0x25c3b9(0x1c2))/0xd*(-parseInt(_0x25c3b9(0x25e))/0xe);if(_0x427e9c===_0x16e91b)break;else _0x2eb245['push'](_0x2eb245['shift']());}catch(_0x1a22ca){_0x2eb245['push'](_0x2eb245['shift']());}}}(_0xb443,0xaae6a));export function patchChannelPluginRuntimeFromSource(_0x3928b4,_0x417558={}){const _0x5939fd=_0x30c2,_0x9869a3=_0x417558[_0x5939fd(0x1c3)+'hannelIm'+_0x5939fd(0x1fd)];if(!_0x9869a3)return{'patched':![],'reason':_0x5939fd(0x1fb)+_0x5939fd(0x1e1)+'import-n'+_0x5939fd(0x1dd)+_0x5939fd(0x1c4)};if(_0x3928b4[_0x5939fd(0x229)]('wujieCre'+'ateRunti'+_0x5939fd(0x205)+'l')){if(_0x3928b4['includes']('turn:\x20ex'+'istingCh'+'annel.tu'+'rn\x20??')&&hasRuntimeChannelImport(_0x3928b4,_0x9869a3))return{'patched':![],'reason':_0x5939fd(0x24b)+_0x5939fd(0x240)};return patchExistingChannelPluginRuntimeFromSource(_0x3928b4,{'runtimeChannelImportPath':_0x9869a3});}if(_0x3928b4[_0x5939fd(0x229)](_0x5939fd(0x1c9)+_0x5939fd(0x1e0)+_0x5939fd(0x230)+'se'))return patchExistingChannelPluginRuntimeFromSource(_0x3928b4,{'runtimeChannelImportPath':_0x9869a3});const _0x395c3f=_0x5939fd(0x23c)+_0x5939fd(0x1f7)+_0x5939fd(0x242)+'null;\x0a\x09\x09'+'const\x20re'+'solveRun'+_0x5939fd(0x216)+')\x20=>\x20{\x0a\x09'+'\x09\x09resolv'+_0x5939fd(0x1cf)+_0x5939fd(0x20d)+_0x5939fd(0x1f4)+_0x5939fd(0x22b)+_0x5939fd(0x225)+_0x5939fd(0x22d)+'ns.runti'+_0x5939fd(0x1d5)+'s);\x0a\x09\x09\x09r'+'eturn\x20re'+_0x5939fd(0x1f7)+_0x5939fd(0x259)+_0x5939fd(0x1b6);if(!_0x3928b4['includes'](_0x395c3f))return{'patched':![],'reason':_0x5939fd(0x21e)+'d'};const _0xba32ae=_0x5939fd(0x218)+_0x5939fd(0x207)+_0x5939fd(0x245)+_0x5939fd(0x221)+_0x5939fd(0x1be)+';';if(!_0x3928b4[_0x5939fd(0x229)](_0xba32ae))return{'patched':![],'reason':_0x5939fd(0x1d3)+_0x5939fd(0x228)};const _0x5ce6db='\x09\x09let\x20re'+_0x5939fd(0x1f7)+_0x5939fd(0x242)+_0x5939fd(0x1c1)+'const\x20en'+_0x5939fd(0x25b)+_0x5939fd(0x21d)+_0x5939fd(0x1ca)+_0x5939fd(0x226)+_0x5939fd(0x246)+'e)\x20=>\x20{\x0a'+_0x5939fd(0x209)+'runtime\x20'+_0x5939fd(0x24c)+_0x5939fd(0x21b)+_0x5939fd(0x24f)+_0x5939fd(0x253)+'return\x20r'+_0x5939fd(0x1b8)+_0x5939fd(0x22f)+_0x5939fd(0x1d1)+_0x5939fd(0x1c8)+'turn?.ru'+'n\x20&&\x20run'+_0x5939fd(0x1fa)+'nnel?.in'+_0x5939fd(0x1eb)+'un)\x20retu'+_0x5939fd(0x235)+_0x5939fd(0x239)+_0x5939fd(0x23d)+_0x5939fd(0x1e0)+'ime\x20=\x20wu'+_0x5939fd(0x1cd)+_0x5939fd(0x247)+_0x5939fd(0x250)+_0x5939fd(0x211)+_0x5939fd(0x217)+_0x5939fd(0x20c)+_0x5939fd(0x1bc)+'ntime.ch'+_0x5939fd(0x254)+_0x5939fd(0x1f3)+_0x5939fd(0x1d4)+_0x5939fd(0x22e)+_0x5939fd(0x1e4)+_0x5939fd(0x1f2)+_0x5939fd(0x1d1)+'hannel\x20:'+_0x5939fd(0x1d8)+_0x5939fd(0x1d4)+'channel\x20'+_0x5939fd(0x1d9)+_0x5939fd(0x22c)+'elRuntim'+_0x5939fd(0x1d0)+_0x5939fd(0x201)+_0x5939fd(0x233)+_0x5939fd(0x23e)+'untimeCo'+'ntexts:\x20'+_0x5939fd(0x248)+_0x5939fd(0x1ec)+'runtimeC'+'ontexts\x20'+_0x5939fd(0x1bb)+_0x5939fd(0x224)+_0x5939fd(0x1e5)+_0x5939fd(0x1e2)+_0x5939fd(0x1ef)+'nbound:\x20'+_0x5939fd(0x248)+_0x5939fd(0x1ec)+_0x5939fd(0x1e8)+_0x5939fd(0x1bb)+'elRuntim'+_0x5939fd(0x256)+_0x5939fd(0x204)+_0x5939fd(0x22a)+'stingCha'+_0x5939fd(0x232)+'n\x20??\x20exi'+_0x5939fd(0x1e7)+'nnel.inb'+'ound\x20??\x20'+_0x5939fd(0x1e9)+'untime.t'+_0x5939fd(0x1de)+_0x5939fd(0x1da)+_0x5939fd(0x1ba)+'bound,\x0a\x09'+'\x09\x09\x09reply'+':\x20existi'+_0x5939fd(0x233)+_0x5939fd(0x1ce)+_0x5939fd(0x1bb)+_0x5939fd(0x224)+'e.reply,'+_0x5939fd(0x23f)+'sion:\x20ex'+_0x5939fd(0x1d6)+_0x5939fd(0x222)+'ssion\x20??'+'\x20channel'+_0x5939fd(0x252)+'session\x0a'+_0x5939fd(0x23a)+_0x5939fd(0x251)+_0x5939fd(0x1d2)+'\x0a\x09\x09};\x0a\x09\x09'+_0x5939fd(0x1f1)+_0x5939fd(0x1f5)+_0x5939fd(0x216)+')\x20=>\x20{\x0a\x09'+_0x5939fd(0x215)+_0x5939fd(0x1cf)+_0x5939fd(0x25d)+_0x5939fd(0x25b)+'eChannel'+'RuntimeH'+_0x5939fd(0x1bf)+_0x5939fd(0x1b7)+_0x5939fd(0x223)+_0x5939fd(0x1fe)+_0x5939fd(0x231)+('ons.runt'+'imeOptio'+'ns));\x0a\x09\x09'+_0x5939fd(0x251)+_0x5939fd(0x258)+'Runtime;'+_0x5939fd(0x243));return{'patched':!![],'source':_0x3928b4[_0x5939fd(0x21c)](_0xba32ae,_0xba32ae+'\x0a'+createRuntimeChannelImport(_0x9869a3))[_0x5939fd(0x21c)](_0x395c3f,_0x5ce6db)};}function patchExistingChannelPluginRuntimeFromSource(_0x4cada7,_0x31eaa6){const _0x3ac47b=_0x30c2,{runtimeChannelImportPath:_0x14e30c}=_0x31eaa6,_0x358408=_0x3ac47b(0x218)+_0x3ac47b(0x207)+_0x3ac47b(0x245)+_0x3ac47b(0x221)+':crypto\x22'+';';if(!_0x4cada7[_0x3ac47b(0x229)](_0x358408))return{'patched':![],'reason':_0x3ac47b(0x1d3)+_0x3ac47b(0x228)};const _0x29e1c7=_0x3ac47b(0x23c)+_0x3ac47b(0x1f7)+_0x3ac47b(0x242)+_0x3ac47b(0x255),_0x368f93=_0x3ac47b(0x21f)+_0x3ac47b(0x1cc)+_0x3ac47b(0x1cb)+_0x3ac47b(0x1ee)+_0x3ac47b(0x210)+_0x3ac47b(0x237)+'ZY_RUNTI'+_0x3ac47b(0x1c7)+_0x3ac47b(0x25c)+_0x3ac47b(0x1e6),_0xc5fae5=_0x4cada7[_0x3ac47b(0x1f6)](_0x29e1c7),_0x3aabfe=_0x4cada7[_0x3ac47b(0x1f6)](_0x368f93,_0xc5fae5);if(_0xc5fae5===-0x1||_0x3aabfe===-0x1)return{'patched':![],'reason':'not-foun'+'d'};const _0x2389e9=_0x3ac47b(0x23c)+_0x3ac47b(0x1f7)+_0x3ac47b(0x242)+_0x3ac47b(0x1c1)+_0x3ac47b(0x1f9)+_0x3ac47b(0x25b)+_0x3ac47b(0x21d)+_0x3ac47b(0x1ca)+_0x3ac47b(0x226)+'\x20(runtim'+_0x3ac47b(0x21a)+'\x09\x09\x09if\x20(!'+_0x3ac47b(0x200)+_0x3ac47b(0x24c)+'f\x20runtim'+_0x3ac47b(0x24f)+_0x3ac47b(0x253)+_0x3ac47b(0x244)+_0x3ac47b(0x1b8)+_0x3ac47b(0x22f)+'untime.c'+_0x3ac47b(0x1c8)+_0x3ac47b(0x234)+_0x3ac47b(0x1c6)+_0x3ac47b(0x1fa)+'nnel?.in'+'bound?.r'+_0x3ac47b(0x208)+'rn\x20runti'+_0x3ac47b(0x239)+_0x3ac47b(0x23d)+'nnelRunt'+_0x3ac47b(0x212)+_0x3ac47b(0x1cd)+'eRuntime'+_0x3ac47b(0x250)+');\x0a\x09\x09\x09co'+_0x3ac47b(0x217)+'tingChan'+_0x3ac47b(0x1bc)+_0x3ac47b(0x1f8)+_0x3ac47b(0x254)+_0x3ac47b(0x1f3)+'runtime.'+'channel\x20'+_0x3ac47b(0x1e4)+_0x3ac47b(0x1f2)+_0x3ac47b(0x1d1)+_0x3ac47b(0x20a)+_0x3ac47b(0x1d8)+_0x3ac47b(0x1d4)+'channel\x20'+_0x3ac47b(0x1d9)+_0x3ac47b(0x22c)+_0x3ac47b(0x224)+_0x3ac47b(0x1d0)+'..existi'+_0x3ac47b(0x233)+_0x3ac47b(0x23e)+_0x3ac47b(0x257)+_0x3ac47b(0x203)+_0x3ac47b(0x248)+'Channel.'+_0x3ac47b(0x1c3)+'ontexts\x20'+_0x3ac47b(0x1bb)+'elRuntim'+_0x3ac47b(0x1e5)+_0x3ac47b(0x1e2)+_0x3ac47b(0x1ef)+'nbound:\x20'+'existing'+_0x3ac47b(0x1ec)+_0x3ac47b(0x1e8)+_0x3ac47b(0x1bb)+'elRuntim'+_0x3ac47b(0x256)+_0x3ac47b(0x204)+_0x3ac47b(0x22a)+_0x3ac47b(0x1e7)+_0x3ac47b(0x232)+_0x3ac47b(0x1b9)+_0x3ac47b(0x1e7)+'nnel.inb'+_0x3ac47b(0x1fc)+_0x3ac47b(0x1e9)+_0x3ac47b(0x20b)+_0x3ac47b(0x1de)+_0x3ac47b(0x1da)+_0x3ac47b(0x1ba)+_0x3ac47b(0x206)+_0x3ac47b(0x214)+_0x3ac47b(0x220)+'ngChanne'+_0x3ac47b(0x1ce)+_0x3ac47b(0x1bb)+_0x3ac47b(0x224)+_0x3ac47b(0x1df)+'\x0a\x09\x09\x09\x09ses'+'sion:\x20ex'+_0x3ac47b(0x1d6)+_0x3ac47b(0x222)+_0x3ac47b(0x1c0)+_0x3ac47b(0x227)+_0x3ac47b(0x252)+'session\x0a'+_0x3ac47b(0x23a)+'\x09return\x20'+_0x3ac47b(0x1d2)+'\x0a\x09\x09};\x0a\x09\x09'+_0x3ac47b(0x1f1)+'solveRun'+_0x3ac47b(0x216)+_0x3ac47b(0x1d7)+'\x09\x09resolv'+'edRuntim'+_0x3ac47b(0x25d)+_0x3ac47b(0x25b)+_0x3ac47b(0x21d)+'RuntimeH'+'elpers(r'+_0x3ac47b(0x1b7)+_0x3ac47b(0x223)+_0x3ac47b(0x1fe)+_0x3ac47b(0x231)+(_0x3ac47b(0x24a)+_0x3ac47b(0x219)+_0x3ac47b(0x1c5)+_0x3ac47b(0x251)+_0x3ac47b(0x258)+_0x3ac47b(0x1b5)+_0x3ac47b(0x213)),_0x2ab3c6=_0x4cada7[_0x3ac47b(0x249)](0x0,_0xc5fae5)+_0x2389e9+_0x4cada7[_0x3ac47b(0x249)](_0x3aabfe);return{'patched':!![],'source':ensureRuntimeChannelImport(_0x2ab3c6,{'importMarker':_0x358408,'runtimeChannelImportPath':_0x14e30c})};}function createRuntimeChannelImport(_0x1205fb){const _0x2cdc83=_0x30c2;return _0x2cdc83(0x218)+_0x2cdc83(0x24d)+'untimeCh'+_0x2cdc83(0x1ea)+_0x2cdc83(0x1e3)+_0x2cdc83(0x20f)+_0x2cdc83(0x1db)+_0x2cdc83(0x241)+'m\x20\x22'+_0x1205fb+'\x22;';}function _0xb443(){const _0x26c4dc=['ntime.ch','const\x20en','time.cha','runtime-','ound\x20??\x20','portPath','inRuntim','80ssDCtX','runtime\x20','..existi','1016NIbFRj','ntexts:\x20','d,\x0a\x09\x09\x09\x09t','meChanne','bound,\x0a\x09','\x20createH','un)\x20retu','\x09\x09\x09if\x20(!','hannel\x20:','untime.t','tingChan','e\x20??=\x20re','407wKazaG','eateRunt','Set\x20=\x20ne',');\x0a\x09\x09\x09co','ime\x20=\x20wu','\x0a\x09\x09};\x0a','\x09\x09\x09reply','\x09\x09resolv','time\x20=\x20(','nst\x20exis','import\x20{','imeOptio','e)\x20=>\x20{\x0a','f\x20runtim','replace','eChannel','not-foun','\x09\x09const\x20',':\x20existi','om\x20\x22node','annel.se','eatePlug','elRuntim','nRuntime','elpers\x20=','\x20channel','ot-found','includes','urn:\x20exi','atePlugi','...chann','()(optio','channel\x20','\x09\x09\x09if\x20(r','imePromi','e()(opti','nnel.tur','ngChanne','turn?.ru','rn\x20runti','684720LugNjV','w\x20Set(LA','24yyZMlr','me;\x0a\x09\x09\x09c','\x09\x09\x09};\x0a\x09\x09','test','\x09\x09let\x20re','onst\x20cha','l,\x0a\x09\x09\x09\x09r','\x0a\x09\x09\x09\x09ses','patched','el\x20}\x20fro','ntime\x20=\x20','\x0a\x09\x09};','return\x20r','ash\x20}\x20fr','\x20(runtim','eRuntime','existing','slice','ons.runt','already-','||\x20typeo','\x20createR','1464669kgQhce','e\x20!==\x20\x22o','Channel(','\x09return\x20','Runtime.','bject\x22)\x20','annel\x20&&','null;','e.inboun','untimeCo','resolved','ntime;\x0a\x09','916202cxzQKr','sureWuji','CTION_KE','e\x20??=\x20en','42QnewIN','7116wvvKiA','Runtime;','\x09};','esolveCr','untime;\x0a','n\x20??\x20exi','ntime.in','??\x20chann','nel\x20=\x20ru','216924dsBwWw',':crypto\x22','elpers(r','ssion\x20??','null;\x0a\x09\x09','7439991VrHIaq','runtimeC','ded','ns));\x0a\x09\x09','n\x20&&\x20run','ME_REFLE','hannel?.','wujieCha','RuntimeH','imeRefle','lazyRunt','jieCreat','l.reply\x20','edRuntim','e,\x0a\x09\x09\x09\x09.','untime.c','runtime;','import-n','runtime.','meOption','istingCh',')\x20=>\x20{\x0a\x09','\x20{};\x0a\x09\x09\x09','=\x20{\x0a\x09\x09\x09\x09','hannelRu','imeChann','532JWtlmK','ot-provi','urn\x20??\x20c','e.reply,','nnelRunt','channel-','eContext','\x20wujieCr','===\x20\x22obj','e.runtim','YS);','stingCha','inbound\x20','channelR','annel\x20as','bound?.r','Channel.','3577QvQnCd','ctionKey','s,\x0a\x09\x09\x09\x09i','3BuioVh','const\x20re','ect\x22\x20?\x20r','\x20typeof\x20','solveCre','solveRun','indexOf','solvedRu'];_0xb443=function(){return _0x26c4dc;};return _0xb443();}function hasRuntimeChannelImport(_0x4469c7,_0x33f26a){const _0x32b7f8=_0x30c2;return _0x4469c7[_0x32b7f8(0x229)](createRuntimeChannelImport(_0x33f26a));}function _0x30c2(_0x3d9da4,_0x5cdc8d){_0x3d9da4=_0x3d9da4-0x1b5;const _0xb443d2=_0xb443();let _0x30c253=_0xb443d2[_0x3d9da4];return _0x30c253;}function ensureRuntimeChannelImport(_0x571210,{importMarker:_0x482d31,runtimeChannelImportPath:_0x404ce9}){const _0x3faf77=_0x30c2,_0x36e90a=createRuntimeChannelImport(_0x404ce9),_0x30d9c3=/import \{ createRuntimeChannel as wujieCreateRuntimeChannel \} from "\.\/runtime-channel-[^"]+\.js";\n?/;if(_0x30d9c3[_0x3faf77(0x23b)](_0x571210))return _0x571210[_0x3faf77(0x21c)](_0x30d9c3,_0x36e90a+'\x0a');return _0x571210[_0x3faf77(0x21c)](_0x482d31,_0x482d31+'\x0a'+_0x36e90a);}
|
|
1
|
+
(function(_0x35ec98,_0x2cbdfa){const _0x55e56c=_0x2fe5,_0x1a101d=_0x35ec98();while(!![]){try{const _0x1dad4c=parseInt(_0x55e56c(0x28c))/0x1+parseInt(_0x55e56c(0x220))/0x2*(parseInt(_0x55e56c(0x282))/0x3)+-parseInt(_0x55e56c(0x1f2))/0x4+-parseInt(_0x55e56c(0x228))/0x5*(-parseInt(_0x55e56c(0x28b))/0x6)+parseInt(_0x55e56c(0x287))/0x7+-parseInt(_0x55e56c(0x245))/0x8*(-parseInt(_0x55e56c(0x27e))/0x9)+-parseInt(_0x55e56c(0x274))/0xa;if(_0x1dad4c===_0x2cbdfa)break;else _0x1a101d['push'](_0x1a101d['shift']());}catch(_0x317f09){_0x1a101d['push'](_0x1a101d['shift']());}}}(_0x5638,0x9e668));export function patchChannelPluginRuntimeFromSource(_0x1af087,_0x44e52a={}){const _0x354928=_0x2fe5,_0xa80516=_0x44e52a['runtimeC'+_0x354928(0x208)+'portPath'];if(!_0xa80516)return{'patched':![],'reason':'runtime-'+_0x354928(0x1ec)+_0x354928(0x244)+_0x354928(0x20a)+'ded'};if(_0x1af087[_0x354928(0x26a)](_0x354928(0x24e)+_0x354928(0x258)+'meChanne'+'l')){if(_0x1af087['includes'](_0x354928(0x23e)+'istingCh'+_0x354928(0x22d)+'rn\x20??')&&hasRuntimeChannelImport(_0x1af087,_0xa80516))return{'patched':![],'reason':'already-'+_0x354928(0x276)};return patchExistingChannelPluginRuntimeFromSource(_0x1af087,{'runtimeChannelImportPath':_0xa80516});}if(_0x1af087[_0x354928(0x26a)]('wujieCha'+_0x354928(0x26e)+_0x354928(0x237)+'se'))return patchExistingChannelPluginRuntimeFromSource(_0x1af087,{'runtimeChannelImportPath':_0xa80516});const _0x3881f9=_0x354928(0x259)+_0x354928(0x25c)+_0x354928(0x288)+_0x354928(0x22b)+_0x354928(0x267)+_0x354928(0x1f3)+_0x354928(0x1fb)+_0x354928(0x227)+'\x09\x09resolv'+'edRuntim'+_0x354928(0x241)+_0x354928(0x23a)+_0x354928(0x260)+_0x354928(0x273)+_0x354928(0x221)+_0x354928(0x257)+_0x354928(0x262)+_0x354928(0x207)+'eturn\x20re'+_0x354928(0x25c)+_0x354928(0x278)+_0x354928(0x224);if(!_0x1af087[_0x354928(0x26a)](_0x3881f9))return{'patched':![],'reason':'not-foun'+'d'};const _0x429089=_0x354928(0x20b)+_0x354928(0x206)+_0x354928(0x277)+_0x354928(0x240)+_0x354928(0x264)+';';if(!_0x1af087[_0x354928(0x26a)](_0x429089))return{'patched':![],'reason':_0x354928(0x244)+'ot-found'};const _0x4691e0=_0x354928(0x259)+_0x354928(0x25c)+_0x354928(0x288)+_0x354928(0x22b)+_0x354928(0x27b)+_0x354928(0x1fc)+'eChannel'+_0x354928(0x1fd)+_0x354928(0x23b)+_0x354928(0x24c)+'e)\x20=>\x20{\x0a'+'\x09\x09\x09if\x20(!'+_0x354928(0x286)+'||\x20typeo'+'f\x20runtim'+_0x354928(0x25e)+'bject\x22)\x20'+'return\x20r'+_0x354928(0x22a)+_0x354928(0x219)+_0x354928(0x1f4)+_0x354928(0x21c)+_0x354928(0x243)+'n\x20&&\x20run'+_0x354928(0x24a)+_0x354928(0x1f6)+_0x354928(0x1fe)+_0x354928(0x239)+_0x354928(0x231)+_0x354928(0x25f)+_0x354928(0x201)+_0x354928(0x26e)+_0x354928(0x223)+_0x354928(0x236)+_0x354928(0x232)+_0x354928(0x253)+');\x0a\x09\x09\x09co'+'nst\x20exis'+_0x354928(0x275)+_0x354928(0x238)+_0x354928(0x268)+_0x354928(0x247)+_0x354928(0x27f)+'runtime.'+_0x354928(0x24f)+_0x354928(0x21b)+_0x354928(0x1f5)+_0x354928(0x1f4)+_0x354928(0x24d)+'\x20{};\x0a\x09\x09\x09'+'runtime.'+_0x354928(0x24f)+'=\x20{\x0a\x09\x09\x09\x09'+_0x354928(0x20d)+_0x354928(0x255)+_0x354928(0x28a)+_0x354928(0x26c)+_0x354928(0x283)+_0x354928(0x1ed)+_0x354928(0x1ee)+_0x354928(0x215)+_0x354928(0x211)+'Channel.'+_0x354928(0x20f)+_0x354928(0x28d)+_0x354928(0x225)+_0x354928(0x255)+'e.runtim'+'eContext'+_0x354928(0x266)+_0x354928(0x212)+_0x354928(0x211)+'Channel.'+_0x354928(0x285)+_0x354928(0x225)+_0x354928(0x255)+'e.inboun'+_0x354928(0x203)+_0x354928(0x234)+_0x354928(0x24b)+_0x354928(0x270)+_0x354928(0x235)+'stingCha'+_0x354928(0x254)+'ound\x20??\x20'+_0x354928(0x249)+'untime.t'+_0x354928(0x20c)+_0x354928(0x204)+_0x354928(0x226)+_0x354928(0x265)+_0x354928(0x261)+_0x354928(0x22c)+_0x354928(0x283)+_0x354928(0x23d)+_0x354928(0x225)+_0x354928(0x255)+_0x354928(0x25b)+_0x354928(0x289)+_0x354928(0x21f)+_0x354928(0x279)+_0x354928(0x1ff)+_0x354928(0x248)+_0x354928(0x26d)+_0x354928(0x246)+_0x354928(0x284)+_0x354928(0x217)+_0x354928(0x20e)+_0x354928(0x213)+_0x354928(0x251)+_0x354928(0x267)+_0x354928(0x1f3)+_0x354928(0x1fb)+_0x354928(0x227)+_0x354928(0x1fa)+'edRuntim'+_0x354928(0x281)+_0x354928(0x1fc)+_0x354928(0x218)+_0x354928(0x1fd)+_0x354928(0x26b)+_0x354928(0x1eb)+_0x354928(0x1f9)+'inRuntim'+_0x354928(0x230)+(_0x354928(0x1ea)+_0x354928(0x250)+_0x354928(0x25d)+'\x09return\x20'+_0x354928(0x256)+'Runtime;'+'\x0a\x09\x09};');return{'patched':!![],'source':_0x1af087['replace'](_0x429089,_0x429089+'\x0a'+createRuntimeChannelImport(_0xa80516))[_0x354928(0x21e)](_0x3881f9,_0x4691e0)};}function patchExistingChannelPluginRuntimeFromSource(_0x216d68,_0x51943a){const _0x5a0b99=_0x2fe5,{runtimeChannelImportPath:_0x521964}=_0x51943a,_0x4ab883=_0x5a0b99(0x20b)+_0x5a0b99(0x206)+_0x5a0b99(0x277)+_0x5a0b99(0x240)+_0x5a0b99(0x264)+';';if(!_0x216d68[_0x5a0b99(0x26a)](_0x4ab883))return{'patched':![],'reason':_0x5a0b99(0x244)+_0x5a0b99(0x216)};const _0x7d2c7e='\x09\x09let\x20re'+_0x5a0b99(0x25c)+_0x5a0b99(0x288)+'null;',_0x341d77=_0x5a0b99(0x22f)+_0x5a0b99(0x1f7)+_0x5a0b99(0x1f8)+_0x5a0b99(0x210)+_0x5a0b99(0x27a)+_0x5a0b99(0x21a)+'ZY_RUNTI'+'ME_REFLE'+_0x5a0b99(0x1f1)+'YS);',_0x1fc864=_0x216d68[_0x5a0b99(0x28e)](_0x7d2c7e),_0x17cb4a=_0x216d68[_0x5a0b99(0x28e)](_0x341d77,_0x1fc864);if(_0x1fc864===-0x1||_0x17cb4a===-0x1)return{'patched':![],'reason':_0x5a0b99(0x280)+'d'};const _0x3af4c3=_0x5a0b99(0x259)+'solvedRu'+_0x5a0b99(0x288)+_0x5a0b99(0x22b)+_0x5a0b99(0x27b)+_0x5a0b99(0x1fc)+_0x5a0b99(0x218)+'RuntimeH'+_0x5a0b99(0x23b)+'\x20(runtim'+_0x5a0b99(0x272)+_0x5a0b99(0x1ef)+'runtime\x20'+_0x5a0b99(0x21d)+_0x5a0b99(0x229)+'e\x20!==\x20\x22o'+'bject\x22)\x20'+_0x5a0b99(0x200)+_0x5a0b99(0x22a)+_0x5a0b99(0x219)+_0x5a0b99(0x1f4)+'hannel?.'+_0x5a0b99(0x243)+'n\x20&&\x20run'+_0x5a0b99(0x24a)+'nnel?.in'+_0x5a0b99(0x1fe)+_0x5a0b99(0x239)+_0x5a0b99(0x231)+_0x5a0b99(0x25f)+_0x5a0b99(0x201)+'nnelRunt'+_0x5a0b99(0x223)+_0x5a0b99(0x236)+_0x5a0b99(0x232)+_0x5a0b99(0x253)+_0x5a0b99(0x269)+_0x5a0b99(0x252)+_0x5a0b99(0x275)+_0x5a0b99(0x238)+_0x5a0b99(0x268)+'annel\x20&&'+_0x5a0b99(0x27f)+_0x5a0b99(0x214)+_0x5a0b99(0x24f)+_0x5a0b99(0x21b)+_0x5a0b99(0x1f5)+_0x5a0b99(0x1f4)+_0x5a0b99(0x24d)+'\x20{};\x0a\x09\x09\x09'+_0x5a0b99(0x214)+'channel\x20'+_0x5a0b99(0x26f)+_0x5a0b99(0x20d)+_0x5a0b99(0x255)+_0x5a0b99(0x28a)+_0x5a0b99(0x26c)+_0x5a0b99(0x283)+'l,\x0a\x09\x09\x09\x09r'+_0x5a0b99(0x1ee)+_0x5a0b99(0x215)+_0x5a0b99(0x211)+_0x5a0b99(0x263)+'runtimeC'+'ontexts\x20'+_0x5a0b99(0x225)+_0x5a0b99(0x255)+'e.runtim'+_0x5a0b99(0x202)+_0x5a0b99(0x266)+_0x5a0b99(0x212)+_0x5a0b99(0x211)+_0x5a0b99(0x263)+'inbound\x20'+_0x5a0b99(0x225)+'elRuntim'+_0x5a0b99(0x205)+_0x5a0b99(0x203)+'urn:\x20exi'+_0x5a0b99(0x24b)+_0x5a0b99(0x270)+'n\x20??\x20exi'+'stingCha'+_0x5a0b99(0x254)+_0x5a0b99(0x271)+_0x5a0b99(0x249)+_0x5a0b99(0x22e)+'urn\x20??\x20c'+_0x5a0b99(0x204)+_0x5a0b99(0x226)+_0x5a0b99(0x265)+'\x09\x09\x09reply'+_0x5a0b99(0x22c)+_0x5a0b99(0x283)+_0x5a0b99(0x23d)+_0x5a0b99(0x225)+_0x5a0b99(0x255)+_0x5a0b99(0x25b)+_0x5a0b99(0x289)+_0x5a0b99(0x21f)+_0x5a0b99(0x279)+_0x5a0b99(0x1ff)+_0x5a0b99(0x248)+'\x20channel'+_0x5a0b99(0x246)+_0x5a0b99(0x284)+_0x5a0b99(0x217)+_0x5a0b99(0x20e)+_0x5a0b99(0x213)+_0x5a0b99(0x251)+_0x5a0b99(0x267)+'solveRun'+_0x5a0b99(0x1fb)+_0x5a0b99(0x227)+'\x09\x09resolv'+_0x5a0b99(0x25a)+'e\x20??=\x20en'+'sureWuji'+_0x5a0b99(0x218)+_0x5a0b99(0x1fd)+_0x5a0b99(0x26b)+_0x5a0b99(0x1eb)+_0x5a0b99(0x1f9)+_0x5a0b99(0x27d)+_0x5a0b99(0x230)+('ons.runt'+_0x5a0b99(0x250)+_0x5a0b99(0x25d)+_0x5a0b99(0x20e)+_0x5a0b99(0x256)+_0x5a0b99(0x242)+_0x5a0b99(0x209)),_0xa6c178=_0x216d68[_0x5a0b99(0x222)](0x0,_0x1fc864)+_0x3af4c3+_0x216d68[_0x5a0b99(0x222)](_0x17cb4a);return{'patched':!![],'source':ensureRuntimeChannelImport(_0xa6c178,{'importMarker':_0x4ab883,'runtimeChannelImportPath':_0x521964})};}function _0x2fe5(_0x1de88b,_0x150fdd){_0x1de88b=_0x1de88b-0x1ea;const _0x5638d0=_0x5638();let _0x2fe525=_0x5638d0[_0x1de88b];return _0x2fe525;}function createRuntimeChannelImport(_0x515c12){const _0x2975cf=_0x2fe5;return'import\x20{'+'\x20createR'+'untimeCh'+_0x2975cf(0x1f0)+'\x20wujieCr'+_0x2975cf(0x23f)+'imeChann'+_0x2975cf(0x23c)+_0x2975cf(0x27c)+_0x515c12+'\x22;';}function hasRuntimeChannelImport(_0x219cdf,_0x2fe4e6){const _0x14704e=_0x2fe5;return _0x219cdf[_0x14704e(0x26a)](createRuntimeChannelImport(_0x2fe4e6));}function ensureRuntimeChannelImport(_0x15423d,{importMarker:_0x3d814a,runtimeChannelImportPath:_0xd1f5a0}){const _0x52908a=_0x2fe5,_0x5babdf=createRuntimeChannelImport(_0xd1f5a0),_0x44408d=/import \{ createRuntimeChannel as wujieCreateRuntimeChannel \} from "\.\/runtime-channel-[^"]+\.js";\n?/;if(_0x44408d[_0x52908a(0x233)](_0x15423d))return _0x15423d[_0x52908a(0x21e)](_0x44408d,_0x5babdf+'\x0a');return _0x15423d[_0x52908a(0x21e)](_0x3d814a,_0x3d814a+'\x0a'+_0x5babdf);}function _0x5638(){const _0x364af8=['indexOf','ons.runt','esolveCr','channel-','l,\x0a\x09\x09\x09\x09r','untimeCo','\x09\x09\x09if\x20(!','annel\x20as','CTION_KE','3115128SjzDaX','solveRun','untime.c','ect\x22\x20?\x20r','nnel?.in','lazyRunt','imeRefle','eatePlug','\x09\x09resolv','time\x20=\x20(','sureWuji','RuntimeH','bound?.r','annel.se','return\x20r','onst\x20cha','eContext','d,\x0a\x09\x09\x09\x09t','hannelRu','e.inboun','\x20createH','s);\x0a\x09\x09\x09r','hannelIm','\x0a\x09\x09};\x0a','ot-provi','import\x20{','urn\x20??\x20c','...chann','\x09return\x20','runtimeC','ctionKey','existing','nbound:\x20','runtime;','runtime.','ntexts:\x20','ot-found','\x09\x09\x09};\x0a\x09\x09','eChannel','\x09\x09\x09if\x20(r','w\x20Set(LA','===\x20\x22obj','hannel?.','||\x20typeo','replace','sion:\x20ex','2nfgZJW','()(optio','slice','ime\x20=\x20wu','\x09};','??\x20chann','ntime.in',')\x20=>\x20{\x0a\x09','5355jbXsXF','f\x20runtim','untime;\x0a','null;\x0a\x09\x09',':\x20existi','annel.tu','untime.t','\x09\x09const\x20','e()(opti','rn\x20runti','eRuntime','test','urn:\x20exi','n\x20??\x20exi','jieCreat','imePromi','nel\x20=\x20ru','un)\x20retu','solveCre','elpers\x20=','el\x20}\x20fro','l.reply\x20','turn:\x20ex','eateRunt','om\x20\x22node','e\x20??=\x20re','Runtime;','turn?.ru','import-n','3088952RvfVzb','Runtime.','annel\x20&&','ssion\x20??','channelR','time.cha','stingCha','\x20(runtim','hannel\x20:','wujieCre','channel\x20','imeOptio','\x0a\x09\x09};\x0a\x09\x09','nst\x20exis','Channel(','nnel.inb','elRuntim','resolved','ns.runti','ateRunti','\x09\x09let\x20re','edRuntim','e.reply,','solvedRu','ns));\x0a\x09\x09','e\x20!==\x20\x22o','me;\x0a\x09\x09\x09c','atePlugi','\x09\x09\x09reply','meOption','Channel.',':crypto\x22','bound,\x0a\x09','s,\x0a\x09\x09\x09\x09i','const\x20re','ntime.ch',');\x0a\x09\x09\x09co','includes','elpers(r','..existi','\x20channel','nnelRunt','=\x20{\x0a\x09\x09\x09\x09','nnel.tur','ound\x20??\x20','e)\x20=>\x20{\x0a','nRuntime','26382590zIrMfr','tingChan','patched','ash\x20}\x20fr','ntime;\x0a\x09','istingCh','Set\x20=\x20ne','const\x20en','m\x20\x22','inRuntim','18PVXKkD','\x20typeof\x20','not-foun','e\x20??=\x20en','3429339eKjrwO','ngChanne','session\x0a','inbound\x20','runtime\x20','235788GFjLrR','ntime\x20=\x20','\x0a\x09\x09\x09\x09ses','e,\x0a\x09\x09\x09\x09.','5826ZnnzLT','1076873sldTuo','ontexts\x20'];_0x5638=function(){return _0x364af8;};return _0x5638();}
|