@wujie-shell/core 1.0.5 → 1.0.7

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.
Files changed (66) hide show
  1. package/bin/wujie-shell.mjs +10 -30
  2. package/dist/bin/wujie-shell.mjs +1 -1
  3. package/dist/src/agents/bundled-agent-skills.mjs +1 -1
  4. package/dist/src/agents/bundled-agents.mjs +1 -1
  5. package/dist/src/agents/codex-home.mjs +1 -0
  6. package/dist/src/agents/runtime-config.mjs +1 -1
  7. package/dist/src/chat/media-archive.mjs +1 -1
  8. package/dist/src/chat/queue.mjs +1 -1
  9. package/dist/src/common/cron-session-key.mjs +1 -1
  10. package/dist/src/common/diagnostics.mjs +1 -1
  11. package/dist/src/common/logging.mjs +1 -1
  12. package/dist/src/common/runtime-logger.mjs +1 -1
  13. package/dist/src/common/sqlite-paths.mjs +1 -1
  14. package/dist/src/common/user-events.mjs +1 -1
  15. package/dist/src/common/utils.mjs +1 -1
  16. package/dist/src/config/controller.mjs +1 -1
  17. package/dist/src/connectors/config-utils.mjs +1 -1
  18. package/dist/src/connectors/constants.mjs +1 -1
  19. package/dist/src/connectors/controller.mjs +1 -1
  20. package/dist/src/connectors/kdocs-cli.mjs +1 -1
  21. package/dist/src/connectors/lark-cli.mjs +1 -1
  22. package/dist/src/electron/instance-identity.mjs +1 -0
  23. package/dist/src/electron/main.mjs +1 -1
  24. package/dist/src/electron/preload.mjs +1 -1
  25. package/dist/src/electron/protocol-url-state.mjs +1 -1
  26. package/dist/src/events/domain-event-journal.mjs +1 -1
  27. package/dist/src/files/generated-files-store.mjs +1 -1
  28. package/dist/src/files/handlers.mjs +1 -1
  29. package/dist/src/gateway/chat-delta.mjs +1 -1
  30. package/dist/src/gateway/controller.mjs +1 -1
  31. package/dist/src/gateway/request-id-title-events.mjs +1 -1
  32. package/dist/src/gateway/ws-client.mjs +1 -1
  33. package/dist/src/index.mjs +1 -1
  34. package/dist/src/log-reporting/handlers.mjs +1 -1
  35. package/dist/src/log-reporting/report-logs.mjs +1 -1
  36. package/dist/src/models/handlers.mjs +1 -1
  37. package/dist/src/preferences/store.mjs +1 -1
  38. package/dist/src/request-id/handlers.mjs +1 -1
  39. package/dist/src/request-id/runtime-bridge.mjs +1 -1
  40. package/dist/src/request-id/session-store.mjs +1 -1
  41. package/dist/src/request-id/title.mjs +1 -1
  42. package/dist/src/review/controller.mjs +1 -0
  43. package/dist/src/runtime/cron-missed-run-policy.mjs +1 -1
  44. package/dist/src/runtime/index.mjs +1 -1
  45. package/dist/src/runtime/patch-channel-plugin-runtime.mjs +1 -1
  46. package/dist/src/runtime/patch-chat-attachment-base64.mjs +1 -1
  47. package/dist/src/runtime/patch-chat-history-mixed-tool-content.mjs +1 -1
  48. package/dist/src/runtime/patch-codex-isolated-auth.mjs +1 -0
  49. package/dist/src/runtime/patch-provider-request-id-header.mjs +1 -1
  50. package/dist/src/runtime/patch-qqbot-outbound-session-route.mjs +1 -1
  51. package/dist/src/runtime/patch-request-id-title-runtime.mjs +1 -1
  52. package/dist/src/runtime/patch-session-store-sqlite.mjs +1 -1
  53. package/dist/src/runtime/patch-weixin-outbound-session-route.mjs +1 -1
  54. package/dist/src/runtime/plugin-sync.mjs +1 -1
  55. package/dist/src/sessions/agent-sessions-map-store.mjs +1 -1
  56. package/dist/src/sessions/runtime-bridge.mjs +1 -1
  57. package/dist/src/sessions/session-data-service.mjs +1 -1
  58. package/dist/src/sessions/session-runtime-state-service.mjs +1 -1
  59. package/dist/src/sessions/session-runtime-state.mjs +1 -1
  60. package/dist/src/sessions/session-sqlite-store.mjs +1 -1
  61. package/dist/src/skills/import.mjs +1 -1
  62. package/dist/src/skills/market.mjs +1 -1
  63. package/dist/src/terminal/manager.mjs +1 -1
  64. package/dist/src/updates/controller.mjs +1 -1
  65. package/dist/src/updates/loader.mjs +1 -1
  66. 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 _0x39af49=_0x3b5b;(function(_0x5d284e,_0x2000d1){const _0x1a3f52=_0x3b5b,_0x2aff41=_0x5d284e();while(!![]){try{const _0x40cf60=parseInt(_0x1a3f52(0x24e))/0x1*(parseInt(_0x1a3f52(0x3e2))/0x2)+-parseInt(_0x1a3f52(0x265))/0x3*(parseInt(_0x1a3f52(0x477))/0x4)+parseInt(_0x1a3f52(0x23b))/0x5*(-parseInt(_0x1a3f52(0x322))/0x6)+-parseInt(_0x1a3f52(0x206))/0x7*(-parseInt(_0x1a3f52(0x3aa))/0x8)+parseInt(_0x1a3f52(0x2fe))/0x9+parseInt(_0x1a3f52(0x44c))/0xa*(-parseInt(_0x1a3f52(0x318))/0xb)+parseInt(_0x1a3f52(0x2c0))/0xc*(parseInt(_0x1a3f52(0x3d6))/0xd);if(_0x40cf60===_0x2000d1)break;else _0x2aff41['push'](_0x2aff41['shift']());}catch(_0x28f923){_0x2aff41['push'](_0x2aff41['shift']());}}}(_0x8478,0xd50c0));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='.tmp/run'+_0x39af49(0x382),MANIFEST_NAME=_0x39af49(0x338)+_0x39af49(0x41a)+_0x39af49(0x334),NPM_INSTALL_TIMEOUT_MS=0xf*0x3c*0x3e8;export function resolveRuntimeRoot(_0x18d575){if(process.env.WUJIE_SHELL_RUNTIME_ROOT)return resolve(process.env.WUJIE_SHELL_RUNTIME_ROOT);return resolve(_0x18d575,RUNTIME_DIR);}export function resolveManifestPath(_0xa941b3){return join(_0xa941b3,MANIFEST_NAME);}async function loadProductRuntime(_0x30d8f7,_0x55839f){const _0x25e02b=_0x39af49,_0x4977a6=[join(_0x30d8f7,_0x25e02b(0x295)+_0x25e02b(0x2c9),_0x25e02b(0x1fc)+'s'),join(_0x55839f,_0x25e02b(0x295)+_0x25e02b(0x2c9),_0x25e02b(0x1fc)+'s')];for(const _0xc076dd of _0x4977a6){if(!existsSync(_0xc076dd))continue;return await import(pathToFileURL(_0xc076dd)['href']+_0x25e02b(0x356)+Date['now']());}return{};}export async function prepareRuntime(_0x13425c,{syncOnly:syncOnly=![],pruneForPackaging:pruneForPackaging=![]}={}){const _0x3e6384=_0x39af49,_0x22ae72=resolveRuntimeRoot(_0x13425c[_0x3e6384(0x2be)+'oot']),_0xb958a8=createRuntimeLogger(getConfigPaths(_0x13425c),_0x3e6384(0x31b)),_0x52efbd=Date[_0x3e6384(0x3b5)]();_0xb958a8?.[_0x3e6384(0x220)+'t']?.(_0x3e6384(0x2e5)+_0x3e6384(0x45a)+_0x3e6384(0x457),{'syncOnly':syncOnly,'runtimeRoot':_0x22ae72,'shellConfig':summarizeShellConfig(_0x13425c)});try{const _0x4c3a3a=await ensureRuntimeBase(_0x13425c,_0x22ae72,{'runtimeLogger':_0xb958a8,'syncOnly':syncOnly});_0xb958a8?.[_0x3e6384(0x220)+'t']?.(_0x3e6384(0x45a)+_0x3e6384(0x41a)+_0x3e6384(0x418),{'manifestPath':resolveManifestPath(_0x22ae72),'manifest':summarizeRuntimeManifest(_0x4c3a3a)}),validateRuntimeNodeVersion(_0x4c3a3a,_0x13425c),_0xb958a8?.[_0x3e6384(0x220)+'t']?.(_0x3e6384(0x45a)+_0x3e6384(0x46a)+'sion\x20val'+_0x3e6384(0x1d8),{'nodeVersion':_0x4c3a3a['nodeVers'+_0x3e6384(0x216)]});if(syncOnly)validateRuntimeOpenClawVersion(_0x4c3a3a,_0x13425c),_0xb958a8?.[_0x3e6384(0x220)+'t']?.(_0x3e6384(0x45a)+_0x3e6384(0x2bc)+'\x20version'+_0x3e6384(0x3d1)+'ed',{'openclawVersion':_0x4c3a3a[_0x3e6384(0x2bc)+_0x3e6384(0x448)]});else{if(_0x4c3a3a[_0x3e6384(0x2bc)+'Version']!==_0x13425c[_0x3e6384(0x2bc)][_0x3e6384(0x2bc)+_0x3e6384(0x448)]){const _0x59dec0=await loadRuntimeInfo(_0x13425c[_0x3e6384(0x2be)+_0x3e6384(0x40a)]);_0xb958a8?.[_0x3e6384(0x220)+'t']?.('openclaw'+_0x3e6384(0x465)+_0x3e6384(0x260)+'\x20started',{'fromVersion':_0x4c3a3a[_0x3e6384(0x2bc)+'Version']||_0x3e6384(0x2cb),'toVersion':_0x13425c[_0x3e6384(0x2bc)]['openclaw'+_0x3e6384(0x448)]}),await installOpenClawPackage(_0x59dec0,_0x13425c[_0x3e6384(0x2bc)][_0x3e6384(0x2bc)+_0x3e6384(0x448)]),_0x4c3a3a['openclaw'+_0x3e6384(0x448)]=_0x13425c[_0x3e6384(0x2bc)]['openclaw'+'Version'],_0xb958a8?.['importan'+'t']?.(_0x3e6384(0x2bc)+_0x3e6384(0x465)+_0x3e6384(0x260)+_0x3e6384(0x373)+'ed',{'openclawVersion':_0x4c3a3a['openclaw'+_0x3e6384(0x448)]});}}_0x4c3a3a[_0x3e6384(0x378)+'dAt']=new Date()[_0x3e6384(0x21a)+_0x3e6384(0x1f3)](),_0x4c3a3a[_0x3e6384(0x3a5)+_0x3e6384(0x216)]=_0x13425c[_0x3e6384(0x2bc)][_0x3e6384(0x3a5)+_0x3e6384(0x216)],_0x4c3a3a[_0x3e6384(0x47a)]={'appId':_0x13425c['appId'],'productName':_0x13425c['productN'+_0x3e6384(0x3d0)],'dataDirName':_0x13425c[_0x3e6384(0x3cd)+_0x3e6384(0x3d0)]},await patchChatHistoryMixedToolContentBug(_0x22ae72,_0x4c3a3a,{'runtimeLogger':_0xb958a8}),await patchChatAttachmentBase64Runtime(_0x22ae72,_0x4c3a3a,{'runtimeLogger':_0xb958a8}),await patchProviderRequestIdHeader(_0x22ae72,_0x4c3a3a,{'runtimeLogger':_0xb958a8}),await patchCodexIsolatedAuthRuntime(_0x22ae72,_0x4c3a3a,{'runtimeLogger':_0xb958a8}),await patchChannelPluginRuntimeBug(_0x22ae72,_0x4c3a3a,{'runtimeLogger':_0xb958a8}),await patchWeixinOutboundFallbackRuntime(_0x22ae72,_0x4c3a3a,{'runtimeLogger':_0xb958a8}),await patchQQBotOutboundFallbackRuntime(_0x22ae72,_0x4c3a3a,{'runtimeLogger':_0xb958a8});const _0xd633fe=await loadProductRuntime(_0x13425c[_0x3e6384(0x2be)+_0x3e6384(0x40a)],_0x22ae72);if(typeof _0xd633fe[_0x3e6384(0x3f5)+_0x3e6384(0x39f)+_0x3e6384(0x2c9)]===_0x3e6384(0x2da)){const _0x17fa65=createRuntimeInfoFromManifest(_0x22ae72,_0x4c3a3a);await _0xd633fe[_0x3e6384(0x3f5)+_0x3e6384(0x39f)+_0x3e6384(0x2c9)]({'shellConfig':_0x13425c,'runtime':_0x17fa65,'runtimeLogger':_0xb958a8,'syncOnly':syncOnly}),_0xb958a8?.[_0x3e6384(0x220)+'t']?.('product\x20'+_0x3e6384(0x45a)+'tools\x20sy'+'nced');}await patchSessionStoreSqliteRuntime(_0x22ae72,_0x4c3a3a,{'runtimeLogger':_0xb958a8}),await patchRequestIdTitleRuntime(_0x22ae72,_0x4c3a3a,{'runtimeLogger':_0xb958a8});!syncOnly&&(await installRuntimeLarkCliPackage(createRuntimeInfoFromManifest(_0x22ae72,_0x4c3a3a),{'runtimeLogger':_0xb958a8,'createRuntimeEnv':createRuntimeEnv}),_0xb958a8?.[_0x3e6384(0x220)+'t']?.('lark-cli'+_0x3e6384(0x48b)+'\x20package'+_0x3e6384(0x2c6)),await hasConfiguredKdocsSkill(_0x13425c)?(await installKdocsCliBinary(_0x13425c,createRuntimeInfoFromManifest(_0x22ae72,_0x4c3a3a),{'runtimeLogger':_0xb958a8,'syncOnly':syncOnly}),_0xb958a8?.[_0x3e6384(0x220)+'t']?.(_0x3e6384(0x280)+_0x3e6384(0x396)+_0x3e6384(0x298)+_0x3e6384(0x2e8))):_0xb958a8?.[_0x3e6384(0x434)](_0x3e6384(0x280)+_0x3e6384(0x396)+_0x3e6384(0x298)+_0x3e6384(0x335)+_0x3e6384(0x2b7)+_0x3e6384(0x290)+'\x20configu'+_0x3e6384(0x357)));const _0x4c799f=Array['isArray'](_0x4c3a3a[_0x3e6384(0x20d)])?_0x4c3a3a['plugins'][_0x3e6384(0x2d0)]:0x0;return await syncManifestPluginScope(_0x13425c,_0x22ae72,_0x4c3a3a),_0xb958a8?.[_0x3e6384(0x220)+'t']?.(_0x3e6384(0x45a)+_0x3e6384(0x45c)+'cope\x20syn'+_0x3e6384(0x460),{'beforePluginCount':_0x4c799f,'afterPluginCount':Array[_0x3e6384(0x430)](_0x4c3a3a[_0x3e6384(0x20d)])?_0x4c3a3a[_0x3e6384(0x20d)][_0x3e6384(0x2d0)]:0x0,'pluginSpecCount':Array[_0x3e6384(0x430)](_0x4c3a3a[_0x3e6384(0x2f9)+_0x3e6384(0x42c)])?_0x4c3a3a[_0x3e6384(0x2f9)+_0x3e6384(0x42c)][_0x3e6384(0x2d0)]:0x0}),await syncConfiguredNpmPlugins(_0x13425c,_0x22ae72,_0x4c3a3a,{'runtimeLogger':_0xb958a8,'syncOnly':syncOnly}),_0xb958a8?.[_0x3e6384(0x220)+'t']?.('configur'+'ed\x20npm\x20p'+_0x3e6384(0x276)+_0x3e6384(0x2a4),{'pluginSpecCount':_0x13425c[_0x3e6384(0x2bc)][_0x3e6384(0x2f9)+_0x3e6384(0x42c)][_0x3e6384(0x2d0)],'pluginCount':Array[_0x3e6384(0x430)](_0x4c3a3a[_0x3e6384(0x20d)])?_0x4c3a3a[_0x3e6384(0x20d)]['length']:0x0}),await patchWeixinOutboundSessionRoute(_0x22ae72,_0x4c3a3a,{'runtimeLogger':_0xb958a8}),await patchQQBotOutboundSessionRoute(_0x22ae72,_0x4c3a3a,{'runtimeLogger':_0xb958a8}),await syncProductPlugins(_0x13425c,_0x22ae72,_0x4c3a3a,{'runtimeLogger':_0xb958a8}),_0xb958a8?.[_0x3e6384(0x220)+'t']?.(_0x3e6384(0x3d3)+_0x3e6384(0x403)+'synced',{'localPluginCount':_0x13425c[_0x3e6384(0x2bc)][_0x3e6384(0x27c)+_0x3e6384(0x327)+_0x3e6384(0x313)][_0x3e6384(0x2d0)],'pluginCount':Array[_0x3e6384(0x430)](_0x4c3a3a[_0x3e6384(0x20d)])?_0x4c3a3a[_0x3e6384(0x20d)][_0x3e6384(0x2d0)]:0x0}),await syncProductAgents(_0x13425c,_0x22ae72,_0x4c3a3a),_0xb958a8?.[_0x3e6384(0x220)+'t']?.('product\x20'+_0x3e6384(0x446)+'ynced',{'sources':_0x13425c[_0x3e6384(0x2bc)][_0x3e6384(0x27c)+_0x3e6384(0x32f)+_0x3e6384(0x45d)],'entryCount':_0x4c3a3a[_0x3e6384(0x310)]?.[_0x3e6384(0x44b)+'nt'],'installPath':_0x4c3a3a[_0x3e6384(0x310)]?.[_0x3e6384(0x1e5)+'ath']}),await syncProductSkills(_0x13425c,_0x22ae72,_0x4c3a3a),_0xb958a8?.['importan'+'t']?.(_0x3e6384(0x3d3)+'skills\x20s'+_0x3e6384(0x2a4),{'sources':_0x13425c['openclaw']['resolved'+_0x3e6384(0x331)+_0x3e6384(0x2f5)],'entryCount':_0x4c3a3a['skills']?.[_0x3e6384(0x44b)+'nt'],'installPath':_0x4c3a3a[_0x3e6384(0x219)]?.[_0x3e6384(0x1e5)+'ath']}),await syncRuntimeWrapper(_0x13425c,_0x22ae72,_0x4c3a3a),_0xb958a8?.[_0x3e6384(0x220)+'t']?.(_0x3e6384(0x45a)+_0x3e6384(0x3bc)+'synced',{'wujieclawBin':_0x4c3a3a[_0x3e6384(0x3dd)+_0x3e6384(0x468)]}),await prunePackagedRuntimeCaches(_0x22ae72,_0xb958a8),pruneForPackaging&&await prunePackagedRuntimePayload(_0x22ae72,_0x4c3a3a,_0xb958a8),await writeJson(resolveManifestPath(_0x22ae72),_0x4c3a3a),_0xb958a8?.[_0x3e6384(0x220)+'t']?.('runtime\x20'+_0x3e6384(0x41a)+_0x3e6384(0x3b9),{'manifestPath':resolveManifestPath(_0x22ae72),'manifest':summarizeRuntimeManifest(_0x4c3a3a),'durationMs':Date['now']()-_0x52efbd}),await _0xb958a8?.['flush'](),_0x4c3a3a;}catch(_0x2253d1){_0xb958a8?.[_0x3e6384(0x36c)](_0x3e6384(0x2e5)+_0x3e6384(0x45a)+_0x3e6384(0x3ad),{'syncOnly':syncOnly,'runtimeRoot':_0x22ae72,'durationMs':Date[_0x3e6384(0x3b5)]()-_0x52efbd,'error':_0x2253d1}),await _0xb958a8?.[_0x3e6384(0x376)]();throw _0x2253d1;}}async function prunePackagedRuntimeCaches(_0x569ace,_0x218b9c){const _0x932256=_0x39af49,_0x3d71ec=[join(_0x569ace,'.cache'),join(_0x569ace,_0x932256(0x453),'npm-cach'+'e'),join(_0x569ace,_0x932256(0x3f1)+_0x932256(0x436)+_0x932256(0x1e4)),join(_0x569ace,_0x932256(0x324)+_0x932256(0x466)+_0x932256(0x282))];for(const _0x44c3b3 of _0x3d71ec){if(!existsSync(_0x44c3b3))continue;await rm(_0x44c3b3,{'recursive':!![],'force':!![]}),_0x218b9c?.[_0x932256(0x434)](_0x932256(0x422)+_0x932256(0x1f0)+_0x932256(0x23e)+_0x932256(0x235)+_0x932256(0x286),{'cachePath':_0x44c3b3});}}async function prunePackagedRuntimePayload(_0x5e7f19,_0x2aab53,_0x17a86e){const _0xccb624=_0x39af49,_0x24c286=createRuntimeInfoFromManifest(_0x5e7f19,_0x2aab53),_0x322dc7=[join(_0x5e7f19,process[_0xccb624(0x26f)]===_0xccb624(0x2b9)?'node/nod'+_0xccb624(0x3f9)+_0xccb624(0x35d):_0xccb624(0x2df)+_0xccb624(0x2b8)+_0xccb624(0x36a)+'m'),join(_0x24c286[_0xccb624(0x2bc)+_0xccb624(0x3a1)+'ir'],_0xccb624(0x249)+_0xccb624(0x2bf))],_0xfdf757=join(_0x24c286['openclaw'+_0xccb624(0x3a1)+'ir'],_0xccb624(0x3b8),_0xccb624(0x410)+'ns');if(existsSync(_0xfdf757))for(const _0x90cf6e of await readdir(_0xfdf757,{'withFileTypes':!![]})){_0x90cf6e[_0xccb624(0x1f6)+_0xccb624(0x226)]()&&_0x322dc7[_0xccb624(0x222)](join(_0xfdf757,_0x90cf6e[_0xccb624(0x271)],'node_mod'+_0xccb624(0x2bf)));}const _0x227cfb={'files':0x0,'directories':0x0,'bytes':0x0};for(const _0x43c272 of _0x322dc7){await pruneRuntimeDependencyTree(_0x43c272,_0x227cfb);}await pruneOpenClawDocs(_0x24c286[_0xccb624(0x2bc)+_0xccb624(0x3a1)+'ir'],_0x227cfb),_0x17a86e?.['info'](_0xccb624(0x422)+'untime\x20p'+_0xccb624(0x336)+_0xccb624(0x425)+_0xccb624(0x371),_0x227cfb);}async function pruneOpenClawDocs(_0x2012c3,_0x8909d5){const _0x5f2a3a=_0x39af49,_0x3dab6d=join(_0x2012c3,_0x5f2a3a(0x2fc));if(!existsSync(_0x3dab6d))return;for(const _0x14e0b0 of await readdir(_0x3dab6d,{'withFileTypes':!![]})){if(_0x14e0b0['name']==='referenc'+'e')continue;await removePrunedPath(join(_0x3dab6d,_0x14e0b0['name']),_0x8909d5);}}async function pruneRuntimeDependencyTree(_0x5bb679,_0x4a7fb5){const _0xa10ace=_0x39af49;if(!existsSync(_0x5bb679))return;for(const _0x1caf26 of await readdir(_0x5bb679,{'withFileTypes':!![]})){const _0x257d52=join(_0x5bb679,_0x1caf26[_0xa10ace(0x271)]);if(_0x1caf26[_0xa10ace(0x1f6)+_0xa10ace(0x226)]()){if(shouldPruneRuntimeDirectory(_0x5bb679,_0x1caf26[_0xa10ace(0x271)])){await removePrunedPath(_0x257d52,_0x4a7fb5);continue;}await pruneRuntimeDependencyTree(_0x257d52,_0x4a7fb5);continue;}_0x1caf26[_0xa10ace(0x386)]()&&shouldPruneRuntimeFile(_0x1caf26[_0xa10ace(0x271)])&&await removePrunedPath(_0x257d52,_0x4a7fb5);}}function shouldPruneRuntimeDirectory(_0x1c002f,_0x18c485){const _0x5eb768=_0x39af49;if(_0x18c485===_0x5eb768(0x211))return!![];if(new Set(['doc',_0x5eb768(0x2fc),_0x5eb768(0x34b)])[_0x5eb768(0x399)](_0x18c485))return existsSync(join(_0x1c002f,_0x5eb768(0x37c)+_0x5eb768(0x3a6)));return new Set([_0x5eb768(0x24f)+'_',_0x5eb768(0x3e3),_0x5eb768(0x405),'test','tests'])[_0x5eb768(0x399)](_0x18c485);}function shouldPruneRuntimeFile(_0x4f1298){const _0x1707c8=_0x39af49;if(_0x4f1298==='package-'+_0x1707c8(0x39e)+'n'||_0x4f1298[_0x1707c8(0x252)]('.d.ts'))return!![];return new Set(['.map',_0x1707c8(0x257),'.markdow'+'n'])[_0x1707c8(0x399)](extname(_0x4f1298)['toLowerC'+'ase']());}async function removePrunedPath(_0x3c89f9,_0x23727e){const _0x24943b=_0x39af49;if(!existsSync(_0x3c89f9))return;const _0x2d08e5=await getPathSize(_0x3c89f9),_0x1485da=await stat(_0x3c89f9);await rm(_0x3c89f9,{'recursive':!![],'force':!![]}),_0x23727e[_0x24943b(0x3f7)]+=_0x2d08e5;if(_0x1485da[_0x24943b(0x1f6)+_0x24943b(0x226)]())_0x23727e['director'+'ies']+=0x1;else _0x23727e[_0x24943b(0x39b)]+=0x1;}async function getPathSize(_0x16e67e){const _0x42bc71=_0x39af49,_0x35d0e3=await stat(_0x16e67e);if(!_0x35d0e3[_0x42bc71(0x1f6)+_0x42bc71(0x226)]())return _0x35d0e3[_0x42bc71(0x472)];let _0x4ed1f6=0x0;for(const _0x408ccc of await readdir(_0x16e67e,{'withFileTypes':!![]})){_0x4ed1f6+=await getPathSize(join(_0x16e67e,_0x408ccc[_0x42bc71(0x271)]));}return _0x4ed1f6;}async function syncRuntimeWrapper(_0x19640d,_0x4037fe,_0xc6803a){const _0x18e27d=_0x39af49,_0x1c9352=_0x19640d[_0x18e27d(0x2bc)]?.['configFi'+_0x18e27d(0x3eb)]??_0x18e27d(0x2bd)+_0x18e27d(0x3a6),_0x245d9d=join(_0x4037fe,_0x18e27d(0x306),_0x18e27d(0x3dd)+'w'),_0x25d34f=join(_0x4037fe,_0x18e27d(0x306),_0x18e27d(0x3dd)+'w.cmd'),_0x1d51f8=normalizeRuntimeRelativePath(relative(dirname(_0x245d9d),resolve(_0x4037fe,_0xc6803a[_0x18e27d(0x308)+_0x18e27d(0x2d7)]))),_0x491371=normalizeRuntimeRelativePath(relative(dirname(_0x245d9d),resolve(_0x4037fe,_0xc6803a[_0x18e27d(0x2bc)+_0x18e27d(0x36e)]))),_0x2ffa95=_0x18e27d(0x3ef)+_0x19640d[_0x18e27d(0x3cd)+_0x18e27d(0x3d0)],_0x268d5e=_0x18e27d(0x47d)+_0x18e27d(0x29a)+_0x19640d[_0x18e27d(0x3cd)+_0x18e27d(0x3d0)];await mkdir(dirname(_0x245d9d),{'recursive':!![]});const _0x240db2=fileURLToPath(new URL(_0x18e27d(0x311)+_0x18e27d(0x3e9)+_0x18e27d(0x482)+_0x18e27d(0x230),import.meta.url)),_0x426cd4=join(_0x4037fe,'bin',_0x18e27d(0x486)+'go.mjs');await cp(_0x240db2,_0x426cd4),await writeFile(_0x245d9d,['#!/bin/s'+'h',_0x18e27d(0x414)+_0x18e27d(0x31c)+_0x18e27d(0x3a0)+'OPENCLAW'+_0x18e27d(0x408)+_0x2ffa95+'}\x22',_0x18e27d(0x414)+_0x18e27d(0x31c)+'STATE_DI'+_0x18e27d(0x24c)+_0x18e27d(0x417)+_0x18e27d(0x26c)+'-'+_0x2ffa95+'}\x22','export\x20O'+'PENCLAW_'+_0x18e27d(0x2a7)+_0x18e27d(0x236)+_0x18e27d(0x473)+_0x18e27d(0x43c)+_0x18e27d(0x2e2)+_0x18e27d(0x2b5)+_0x1c9352+'}\x22',_0x18e27d(0x414)+_0x18e27d(0x31c)+_0x18e27d(0x349)+_0x18e27d(0x40b)+'PENCLAW_'+_0x18e27d(0x349)+_0x18e27d(0x25c)+_0x2ffa95+'/'+_0x1c9352+'}\x22',_0x18e27d(0x3c1)+'IR=$(CDP'+_0x18e27d(0x3c0)+_0x18e27d(0x283)+'rname\x20--'+'\x20\x22$0\x22)\x22\x20'+'&&\x20pwd)','RUNTIME_'+_0x18e27d(0x445)+_0x18e27d(0x312)+'R/'+_0x1d51f8+'\x22','if\x20[\x20-t\x20'+_0x18e27d(0x210)+_0x18e27d(0x3df)+_0x18e27d(0x45f)+_0x18e27d(0x27d)+'then','\x20\x20\x22$RUNT'+_0x18e27d(0x23d)+_0x18e27d(0x2f6)+_0x18e27d(0x2d2)+_0x18e27d(0x329)+_0x18e27d(0x279)+_0x18e27d(0x481)+_0x18e27d(0x273)+'ue','fi',_0x18e27d(0x208)+'UNTIME_N'+_0x18e27d(0x38d)+_0x18e27d(0x312)+'R/'+_0x491371+'\x22\x20\x22$@\x22',''][_0x18e27d(0x23f)]('\x0a'),_0x18e27d(0x26e)),await chmod(_0x245d9d,0x1ed),await writeFile(_0x25d34f,[_0x18e27d(0x3ee)+'f','if\x20\x22%OPE'+'NCLAW_HO'+'ME%\x22==\x22\x22'+_0x18e27d(0x368)+'ENCLAW_H'+_0x18e27d(0x21d)+_0x268d5e+'\x22','if\x20\x22%OPE'+_0x18e27d(0x417)+_0x18e27d(0x366)+_0x18e27d(0x447)+_0x18e27d(0x1f8)+_0x18e27d(0x2fa)+_0x18e27d(0x1e6)+_0x268d5e+'\x22',_0x18e27d(0x294)+_0x18e27d(0x1eb)+_0x18e27d(0x22d)+_0x18e27d(0x364)+'==\x22\x22\x20set'+_0x18e27d(0x455)+_0x18e27d(0x2ef)+_0x18e27d(0x2a3)+_0x18e27d(0x293)+_0x1c9352+'\x22',_0x18e27d(0x294)+_0x18e27d(0x1eb)+_0x18e27d(0x400)+'H%\x22==\x22\x22\x20'+'set\x20\x22OPE'+_0x18e27d(0x1eb)+_0x18e27d(0x400)+'H='+_0x268d5e+'\x5c'+_0x1c9352+'\x22',_0x18e27d(0x3f4)+_0x18e27d(0x3f2)+'%~dp0\x22',_0x18e27d(0x25f)+'TIME_NOD'+_0x18e27d(0x309)+'T_DIR%'+toWindowsPath(_0x1d51f8)+'\x22','\x22%RUNTIM'+_0x18e27d(0x2f0)+_0x18e27d(0x2dd)+_0x18e27d(0x3f8)+toWindowsPath(_0x491371)+'\x22\x20%*',''][_0x18e27d(0x23f)]('\x0d\x0a'),_0x18e27d(0x26e)),_0xc6803a['wujiecla'+_0x18e27d(0x468)]=toRuntimeRelative(_0x4037fe,process[_0x18e27d(0x26f)]===_0x18e27d(0x2b9)?_0x25d34f:_0x245d9d);}async function patchChatHistoryMixedToolContentBug(_0x47c750,_0x45918e,_0x44eeeb={}){const _0x4abd8f=_0x39af49,_0x243cf1=resolve(_0x47c750,_0x45918e[_0x4abd8f(0x2bc)+_0x4abd8f(0x3a1)+'ir']),_0x4432ac=join(_0x243cf1,_0x4abd8f(0x3b8));let _0x424aaa=[];try{_0x424aaa=await readdir(_0x4432ac,{'withFileTypes':!![]});}catch{_0x44eeeb[_0x4abd8f(0x44a)+'ogger']?.[_0x4abd8f(0x3fd)]?.(_0x4abd8f(0x25d)+_0x4abd8f(0x3c9)+_0x4abd8f(0x28d)+'patch\x20sk'+'ipped;\x20d'+_0x4abd8f(0x1db)+_0x4abd8f(0x3c2),{'distDir':_0x4432ac,'openclawVersion':_0x45918e[_0x4abd8f(0x2bc)+_0x4abd8f(0x448)]});return;}const _0x3b37b9=_0x424aaa[_0x4abd8f(0x37a)](_0x3b15fd=>_0x3b15fd[_0x4abd8f(0x386)]()&&(_0x3b15fd[_0x4abd8f(0x271)][_0x4abd8f(0x433)+'th'](_0x4abd8f(0x483)+_0x4abd8f(0x289)+'jection-')||_0x3b15fd[_0x4abd8f(0x271)][_0x4abd8f(0x433)+'th'](_0x4abd8f(0x22a)+'transcri'+_0x4abd8f(0x392)))&&_0x3b15fd[_0x4abd8f(0x271)][_0x4abd8f(0x252)]('.js'))[_0x4abd8f(0x342)](_0x5dd439=>join(_0x4432ac,_0x5dd439[_0x4abd8f(0x271)]));if(_0x3b37b9[_0x4abd8f(0x2d0)]===0x0){_0x44eeeb[_0x4abd8f(0x44a)+_0x4abd8f(0x2bb)]?.[_0x4abd8f(0x3fd)]?.('chat\x20his'+_0x4abd8f(0x3c9)+_0x4abd8f(0x28d)+_0x4abd8f(0x393)+_0x4abd8f(0x2ad)+_0x4abd8f(0x381)+_0x4abd8f(0x3c2),{'openclawVersion':_0x45918e['openclaw'+'Version']});return;}for(const _0x2611ef of _0x3b37b9){const _0x33a979=await readFile(_0x2611ef,_0x4abd8f(0x26e)),_0x4e51cd=patchMixedToolContentFromSource(_0x33a979);if(!_0x4e51cd[_0x4abd8f(0x37e)]){if(_0x4e51cd[_0x4abd8f(0x245)]===_0x4abd8f(0x454)+_0x4abd8f(0x37e)){_0x44eeeb[_0x4abd8f(0x44a)+_0x4abd8f(0x2bb)]?.[_0x4abd8f(0x434)]?.(_0x4abd8f(0x25d)+_0x4abd8f(0x3c9)+_0x4abd8f(0x28d)+_0x4abd8f(0x2b0)+_0x4abd8f(0x2f1)+_0x4abd8f(0x22c),{'openclawVersion':_0x45918e[_0x4abd8f(0x2bc)+_0x4abd8f(0x448)],'filePath':_0x2611ef});return;}continue;}await writeFile(_0x2611ef,_0x4e51cd[_0x4abd8f(0x369)],_0x4abd8f(0x26e)),_0x44eeeb['runtimeL'+_0x4abd8f(0x2bb)]?.[_0x4abd8f(0x434)]?.(_0x4abd8f(0x25d)+_0x4abd8f(0x3c9)+_0x4abd8f(0x28d)+_0x4abd8f(0x46c)+'plied',{'openclawVersion':_0x45918e['openclaw'+_0x4abd8f(0x448)],'filePath':_0x2611ef,'note':_0x4abd8f(0x35e)+_0x4abd8f(0x38a)+'ibility\x20'+'patch\x20fo'+_0x4abd8f(0x415)+_0x4abd8f(0x2ae)+_0x4abd8f(0x248)+_0x4abd8f(0x247)+'tory\x20pro'+_0x4abd8f(0x268)+_0x4abd8f(0x30e)+_0x4abd8f(0x1f4)+_0x4abd8f(0x287)+_0x4abd8f(0x44d)+_0x4abd8f(0x3ab)+_0x4abd8f(0x3e0)});return;}_0x44eeeb[_0x4abd8f(0x44a)+_0x4abd8f(0x2bb)]?.[_0x4abd8f(0x3fd)]?.(_0x4abd8f(0x25d)+_0x4abd8f(0x3c9)+_0x4abd8f(0x28d)+_0x4abd8f(0x393)+'ipped;\x20f'+_0x4abd8f(0x3a4)+_0x4abd8f(0x2ed)+'d',{'openclawVersion':_0x45918e[_0x4abd8f(0x2bc)+_0x4abd8f(0x448)]});}async function patchChatAttachmentBase64Runtime(_0x430f48,_0x1288f3,_0x61a20b={}){const _0x5c70b8=_0x39af49,_0x2eb509=resolve(_0x430f48,_0x1288f3[_0x5c70b8(0x2bc)+_0x5c70b8(0x3a1)+'ir']),_0x54de0c=join(_0x2eb509,_0x5c70b8(0x3b8));let _0x37005b=[];try{_0x37005b=await readdir(_0x54de0c,{'withFileTypes':!![]});}catch{_0x61a20b[_0x5c70b8(0x44a)+_0x5c70b8(0x2bb)]?.['warn']?.('chat\x20att'+_0x5c70b8(0x20b)+_0x5c70b8(0x3d5)+_0x5c70b8(0x20e)+_0x5c70b8(0x301)+_0x5c70b8(0x246)+'ound',{'distDir':_0x54de0c,'openclawVersion':_0x1288f3['openclaw'+'Version']});return;}const _0x2eb0d6=_0x37005b[_0x5c70b8(0x37a)](_0x1c913e=>_0x1c913e[_0x5c70b8(0x386)]()&&_0x1c913e['name'][_0x5c70b8(0x433)+'th']('attachme'+'nt-norma'+'lize-')&&_0x1c913e[_0x5c70b8(0x271)][_0x5c70b8(0x252)]('.js'))[_0x5c70b8(0x342)](_0xa43979=>join(_0x54de0c,_0xa43979[_0x5c70b8(0x271)]));if(_0x2eb0d6[_0x5c70b8(0x2d0)]===0x0){_0x61a20b[_0x5c70b8(0x44a)+'ogger']?.['warn']?.(_0x5c70b8(0x2e9)+_0x5c70b8(0x20b)+'base64\x20p'+_0x5c70b8(0x20e)+_0x5c70b8(0x47c)+_0x5c70b8(0x221)+_0x5c70b8(0x231),{'openclawVersion':_0x1288f3[_0x5c70b8(0x2bc)+'Version']});return;}for(const _0x439e47 of _0x2eb0d6){const _0x2f86c3=await readFile(_0x439e47,_0x5c70b8(0x26e)),_0x4280d1=patchChatAttachmentBase64FromSource(_0x2f86c3);if(!_0x4280d1['patched']){if(_0x4280d1[_0x5c70b8(0x245)]===_0x5c70b8(0x454)+_0x5c70b8(0x37e)){_0x61a20b[_0x5c70b8(0x44a)+'ogger']?.['info']?.(_0x5c70b8(0x2e9)+_0x5c70b8(0x20b)+'base64\x20p'+_0x5c70b8(0x2fb)+_0x5c70b8(0x1e1)+_0x5c70b8(0x340),{'openclawVersion':_0x1288f3[_0x5c70b8(0x2bc)+_0x5c70b8(0x448)],'filePath':_0x439e47});return;}continue;}await writeFile(_0x439e47,_0x4280d1[_0x5c70b8(0x369)],_0x5c70b8(0x26e)),_0x61a20b['runtimeL'+'ogger']?.[_0x5c70b8(0x434)]?.(_0x5c70b8(0x2e9)+_0x5c70b8(0x20b)+_0x5c70b8(0x3d5)+_0x5c70b8(0x1e7)+'lied',{'openclawVersion':_0x1288f3[_0x5c70b8(0x2bc)+_0x5c70b8(0x448)],'filePath':_0x439e47,'note':'Temporar'+_0x5c70b8(0x38a)+_0x5c70b8(0x3c6)+_0x5c70b8(0x3bd)+_0x5c70b8(0x415)+_0x5c70b8(0x2ae)+_0x5c70b8(0x2ca)+'end\x20atta'+_0x5c70b8(0x3af)+'ase64\x20st'+'ack\x20over'+_0x5c70b8(0x34e)+_0x5c70b8(0x262)+_0x5c70b8(0x288)+_0x5c70b8(0x3d8)+'ure\x20upgr'+'ades.'});return;}_0x61a20b[_0x5c70b8(0x44a)+'ogger']?.[_0x5c70b8(0x3fd)]?.(_0x5c70b8(0x2e9)+_0x5c70b8(0x20b)+_0x5c70b8(0x3d5)+_0x5c70b8(0x20e)+'pped;\x20fu'+'nction\x20n'+_0x5c70b8(0x46e),{'openclawVersion':_0x1288f3[_0x5c70b8(0x2bc)+_0x5c70b8(0x448)]});}async function patchProviderRequestIdHeader(_0xd1a783,_0x47f622,_0x49ecfa={}){const _0xc06d3e=_0x39af49,_0x53e162=resolve(_0xd1a783,_0x47f622[_0xc06d3e(0x2bc)+_0xc06d3e(0x3a1)+'ir']),_0xaf2e9a=join(_0x53e162,_0xc06d3e(0x3b8));let _0x5248e1=[];try{_0x5248e1=await readdir(_0xaf2e9a,{'withFileTypes':!![]});}catch{_0x49ecfa[_0xc06d3e(0x44a)+'ogger']?.[_0xc06d3e(0x3fd)]?.(_0xc06d3e(0x214)+_0xc06d3e(0x1fe)+_0xc06d3e(0x241)+_0xc06d3e(0x389)+_0xc06d3e(0x2cd)+_0xc06d3e(0x237)+_0xc06d3e(0x46e),{'distDir':_0xaf2e9a,'openclawVersion':_0x47f622[_0xc06d3e(0x2bc)+_0xc06d3e(0x448)]});return;}const _0x52b391=_0x5248e1['filter'](_0x3ada7c=>_0x3ada7c['isFile']()&&_0x3ada7c[_0xc06d3e(0x271)]['endsWith'](_0xc06d3e(0x36d)))[_0xc06d3e(0x342)](_0x170bb5=>join(_0xaf2e9a,_0x170bb5['name']));let _0x351d06=0x0,_0x35d45d=0x0;for(const _0x360cf0 of _0x52b391){const _0x33708c=await readFile(_0x360cf0,_0xc06d3e(0x26e)),_0x59d6d8=patchProviderRequestIdHeaderFromSource(_0x33708c);if(_0x59d6d8[_0xc06d3e(0x37e)]){await writeFile(_0x360cf0,_0x59d6d8[_0xc06d3e(0x369)],_0xc06d3e(0x26e)),_0x351d06+=0x1,_0x49ecfa[_0xc06d3e(0x44a)+_0xc06d3e(0x2bb)]?.['info']?.('provider'+_0xc06d3e(0x1fe)+_0xc06d3e(0x241)+_0xc06d3e(0x389)+_0xc06d3e(0x29f),{'openclawVersion':_0x47f622[_0xc06d3e(0x2bc)+_0xc06d3e(0x448)],'filePath':_0x360cf0});continue;}if(_0x59d6d8[_0xc06d3e(0x245)]==='already-'+_0xc06d3e(0x37e))_0x35d45d+=0x1;}if(_0x351d06>0x0){_0x49ecfa[_0xc06d3e(0x44a)+'ogger']?.['info']?.('provider'+'\x20request'+_0xc06d3e(0x241)+_0xc06d3e(0x389)+_0xc06d3e(0x3c8),{'openclawVersion':_0x47f622['openclaw'+_0xc06d3e(0x448)],'patchedCount':_0x351d06,'alreadyPatchedCount':_0x35d45d});return;}if(_0x35d45d>0x0){_0x49ecfa[_0xc06d3e(0x44a)+'ogger']?.[_0xc06d3e(0x434)]?.(_0xc06d3e(0x214)+_0xc06d3e(0x1fe)+_0xc06d3e(0x241)+_0xc06d3e(0x389)+_0xc06d3e(0x353)+'\x20applied',{'openclawVersion':_0x47f622[_0xc06d3e(0x2bc)+_0xc06d3e(0x448)],'alreadyPatchedCount':_0x35d45d});return;}_0x49ecfa[_0xc06d3e(0x44a)+_0xc06d3e(0x2bb)]?.[_0xc06d3e(0x3fd)]?.(_0xc06d3e(0x214)+'\x20request'+_0xc06d3e(0x241)+_0xc06d3e(0x389)+_0xc06d3e(0x2cd)+';\x20provid'+_0xc06d3e(0x3de)+_0xc06d3e(0x412)+_0xc06d3e(0x34c)+'nd',{'openclawVersion':_0x47f622[_0xc06d3e(0x2bc)+_0xc06d3e(0x448)]});}async function patchCodexIsolatedAuthRuntime(_0x4fdb93,_0x90ca1f,_0x5ad6f0={}){const _0x3f4cf9=_0x39af49,_0x6d427e=resolve(_0x4fdb93,_0x90ca1f[_0x3f4cf9(0x2bc)+_0x3f4cf9(0x3a1)+'ir']),_0x1af1c8=[join(_0x6d427e,_0x3f4cf9(0x3b8)),join(_0x6d427e,_0x3f4cf9(0x3b8),_0x3f4cf9(0x410)+'ns','codex',_0x3f4cf9(0x3b8))],_0x239328=[];for(const _0x1722fe of _0x1af1c8){const _0x44a4a3=await readdir(_0x1722fe,{'withFileTypes':!![]})['catch'](()=>[]);for(const _0x570da2 of _0x44a4a3){_0x570da2[_0x3f4cf9(0x386)]()&&_0x570da2[_0x3f4cf9(0x271)][_0x3f4cf9(0x433)+'th'](_0x3f4cf9(0x419)+_0x3f4cf9(0x439))&&_0x570da2[_0x3f4cf9(0x271)]['endsWith'](_0x3f4cf9(0x36d))&&_0x239328[_0x3f4cf9(0x222)](join(_0x1722fe,_0x570da2['name']));}}let _0x2dd9f7=0x0,_0x3f01ae=0x0;for(const _0x10d3ac of _0x239328){const _0x44858a=await readFile(_0x10d3ac,'utf8'),_0x36b58e=patchCodexIsolatedAuthFromSource(_0x44858a);if(_0x36b58e[_0x3f4cf9(0x37e)]){await writeFile(_0x10d3ac,_0x36b58e[_0x3f4cf9(0x369)],_0x3f4cf9(0x26e)),_0x2dd9f7+=0x1,_0x5ad6f0[_0x3f4cf9(0x44a)+_0x3f4cf9(0x2bb)]?.[_0x3f4cf9(0x434)]?.(_0x3f4cf9(0x204)+_0x3f4cf9(0x48a)+_0x3f4cf9(0x20c)+_0x3f4cf9(0x32e)+'d',{'openclawVersion':_0x90ca1f['openclaw'+'Version'],'filePath':_0x10d3ac});continue;}if(_0x36b58e[_0x3f4cf9(0x245)]===_0x3f4cf9(0x454)+_0x3f4cf9(0x37e))_0x3f01ae+=0x1;}if(_0x2dd9f7>0x0||_0x3f01ae>0x0){_0x5ad6f0[_0x3f4cf9(0x44a)+_0x3f4cf9(0x2bb)]?.[_0x3f4cf9(0x434)]?.(_0x3f4cf9(0x204)+_0x3f4cf9(0x48a)+_0x3f4cf9(0x20c)+_0x3f4cf9(0x3f0)+'y',{'openclawVersion':_0x90ca1f[_0x3f4cf9(0x2bc)+_0x3f4cf9(0x448)],'patchedCount':_0x2dd9f7,'alreadyPatchedCount':_0x3f01ae});return;}_0x5ad6f0[_0x3f4cf9(0x44a)+_0x3f4cf9(0x2bb)]?.[_0x3f4cf9(0x3fd)]?.(_0x3f4cf9(0x204)+_0x3f4cf9(0x48a)+'uth\x20patc'+_0x3f4cf9(0x1ff)+'d;\x20share'+'d\x20client'+_0x3f4cf9(0x3a3)+_0x3f4cf9(0x29e)+'found',{'openclawVersion':_0x90ca1f[_0x3f4cf9(0x2bc)+_0x3f4cf9(0x448)],'candidateFiles':_0x239328});}async function patchChannelPluginRuntimeBug(_0xc4307f,_0x3f31ca,_0x1211d0={}){const _0xb384bd=_0x39af49,_0x8a4ca=resolve(_0xc4307f,_0x3f31ca[_0xb384bd(0x2bc)+'WorkingD'+'ir']),_0x3ae6ba=join(_0x8a4ca,_0xb384bd(0x3b8));let _0x3b59b5=[];try{_0x3b59b5=await readdir(_0x3ae6ba,{'withFileTypes':!![]});}catch{_0x1211d0[_0xb384bd(0x44a)+_0xb384bd(0x2bb)]?.[_0xb384bd(0x3fd)]?.(_0xb384bd(0x30f)+_0xb384bd(0x227)+'untime\x20p'+'atch\x20ski'+'pped;\x20di'+_0xb384bd(0x246)+'ound',{'distDir':_0x3ae6ba,'openclawVersion':_0x3f31ca[_0xb384bd(0x2bc)+_0xb384bd(0x448)]});return;}const _0x1cffb0=_0x3b59b5[_0xb384bd(0x37a)](_0x40de8a=>_0x40de8a[_0xb384bd(0x386)]()&&_0x40de8a['name'][_0xb384bd(0x433)+'th'](_0xb384bd(0x443))&&_0x40de8a[_0xb384bd(0x271)][_0xb384bd(0x252)](_0xb384bd(0x36d)))[_0xb384bd(0x342)](_0x5f5556=>join(_0x3ae6ba,_0x5f5556['name'])),_0x419f1c=await resolveRuntimeChannelImportPath(_0x3ae6ba,_0x3b59b5);if(_0x1cffb0[_0xb384bd(0x2d0)]===0x0){_0x1211d0[_0xb384bd(0x44a)+_0xb384bd(0x2bb)]?.[_0xb384bd(0x3fd)]?.(_0xb384bd(0x30f)+'plugin\x20r'+_0xb384bd(0x337)+_0xb384bd(0x20e)+_0xb384bd(0x3d7)+'ader\x20not'+_0xb384bd(0x3b2),{'openclawVersion':_0x3f31ca[_0xb384bd(0x2bc)+_0xb384bd(0x448)]});return;}if(!_0x419f1c){_0x1211d0[_0xb384bd(0x44a)+'ogger']?.[_0xb384bd(0x3fd)]?.(_0xb384bd(0x30f)+_0xb384bd(0x227)+_0xb384bd(0x337)+_0xb384bd(0x20e)+_0xb384bd(0x2d3)+_0xb384bd(0x459)+_0xb384bd(0x3ba)+_0xb384bd(0x3f6)+_0xb384bd(0x3c2),{'openclawVersion':_0x3f31ca[_0xb384bd(0x2bc)+_0xb384bd(0x448)],'distDir':_0x3ae6ba});return;}for(const _0x418fc9 of _0x1cffb0){const _0x5a63c1=await readFile(_0x418fc9,_0xb384bd(0x26e)),_0x14bbc9=patchChannelPluginRuntimeFromSource(_0x5a63c1,{'runtimeChannelImportPath':_0x419f1c});if(!_0x14bbc9[_0xb384bd(0x37e)]){if(_0x14bbc9[_0xb384bd(0x245)]==='already-'+'patched'){_0x1211d0[_0xb384bd(0x44a)+'ogger']?.[_0xb384bd(0x434)]?.(_0xb384bd(0x30f)+_0xb384bd(0x227)+_0xb384bd(0x337)+_0xb384bd(0x2fb)+_0xb384bd(0x1e1)+_0xb384bd(0x340),{'openclawVersion':_0x3f31ca[_0xb384bd(0x2bc)+_0xb384bd(0x448)],'filePath':_0x418fc9});return;}continue;}await writeFile(_0x418fc9,_0x14bbc9[_0xb384bd(0x369)],_0xb384bd(0x26e)),_0x1211d0[_0xb384bd(0x44a)+_0xb384bd(0x2bb)]?.[_0xb384bd(0x434)]?.(_0xb384bd(0x30f)+_0xb384bd(0x227)+_0xb384bd(0x337)+_0xb384bd(0x1e7)+_0xb384bd(0x340),{'openclawVersion':_0x3f31ca['openclaw'+_0xb384bd(0x448)],'filePath':_0x418fc9,'note':_0xb384bd(0x35e)+_0xb384bd(0x38a)+_0xb384bd(0x3c6)+_0xb384bd(0x3bd)+_0xb384bd(0x415)+'aw\x202026.'+_0xb384bd(0x240)+_0xb384bd(0x218)+_0xb384bd(0x269)+_0xb384bd(0x2ac)+'ng\x20chann'+_0xb384bd(0x250)+_0xb384bd(0x300)+_0xb384bd(0x380)+_0xb384bd(0x47f)+_0xb384bd(0x41c)+_0xb384bd(0x352)+_0xb384bd(0x41d)+_0xb384bd(0x3be)});return;}_0x1211d0['runtimeL'+_0xb384bd(0x2bb)]?.[_0xb384bd(0x3fd)]?.(_0xb384bd(0x30f)+_0xb384bd(0x227)+'untime\x20p'+_0xb384bd(0x20e)+_0xb384bd(0x2d3)+_0xb384bd(0x1ef)+_0xb384bd(0x2f7)+_0xb384bd(0x46e),{'openclawVersion':_0x3f31ca[_0xb384bd(0x2bc)+_0xb384bd(0x448)]});}async function patchSessionStoreSqliteRuntime(_0x276686,_0x43555d,_0x2a26e0={}){const _0x2d1e8c=_0x39af49,_0x4621d3=resolve(_0x276686,_0x43555d[_0x2d1e8c(0x2bc)+_0x2d1e8c(0x3a1)+'ir']),_0xd48407=join(_0x4621d3,'dist'),_0x404dac=_0x2d1e8c(0x2db)+_0x2d1e8c(0x1e9)+'ime/sess'+_0x2d1e8c(0x2aa)+_0x2d1e8c(0x29b)+_0x2d1e8c(0x2de),_0x4a5705=join(_0x276686,_0x2d1e8c(0x295)+_0x2d1e8c(0x2c9),_0x2d1e8c(0x29c),_0x2d1e8c(0x338)+_0x2d1e8c(0x2a1)+'js'),_0x23fcdb=(await readdir(_0xd48407,{'withFileTypes':!![]})['catch'](()=>[]))[_0x2d1e8c(0x37a)](_0x11f917=>_0x11f917['isFile']()&&_0x11f917['name'][_0x2d1e8c(0x433)+'th'](_0x2d1e8c(0x21b)+_0x2d1e8c(0x28a))&&_0x11f917[_0x2d1e8c(0x271)][_0x2d1e8c(0x252)](_0x2d1e8c(0x36d)))['map'](_0x354ba1=>join(_0xd48407,_0x354ba1['name'])),_0x3f6cc2=(await readdir(_0xd48407,{'withFileTypes':!![]})[_0x2d1e8c(0x394)](()=>[]))[_0x2d1e8c(0x37a)](_0x54ed70=>_0x54ed70[_0x2d1e8c(0x386)]()&&_0x54ed70[_0x2d1e8c(0x271)][_0x2d1e8c(0x433)+'th'](_0x2d1e8c(0x28e))&&!_0x54ed70[_0x2d1e8c(0x271)][_0x2d1e8c(0x433)+'th'](_0x2d1e8c(0x21b)+'ad-')&&_0x54ed70['name'][_0x2d1e8c(0x252)](_0x2d1e8c(0x36d)))['map'](_0x259d3a=>join(_0xd48407,_0x259d3a[_0x2d1e8c(0x271)]));if(!existsSync(_0x4a5705)){_0x2a26e0[_0x2d1e8c(0x44a)+'ogger']?.['info']?.(_0x2d1e8c(0x32a)+_0x2d1e8c(0x37f)+_0x2d1e8c(0x2b6)+_0x2d1e8c(0x487)+_0x2d1e8c(0x43e)+_0x2d1e8c(0x437)+_0x2d1e8c(0x2a5),{'bridgePath':_0x4a5705,'openclawVersion':_0x43555d[_0x2d1e8c(0x2bc)+'Version']});return;}for(const _0x5cd170 of _0x23fcdb){const _0x349fe7=await readFile(_0x5cd170,'utf8'),_0x4b9cc5=patchSessionStoreLoadFromSource(_0x349fe7,{'bridgeImportPath':_0x404dac});if(!_0x4b9cc5['patched']){if(_0x4b9cc5[_0x2d1e8c(0x245)]===_0x2d1e8c(0x454)+_0x2d1e8c(0x37e)){_0x2a26e0[_0x2d1e8c(0x44a)+_0x2d1e8c(0x2bb)]?.[_0x2d1e8c(0x434)]?.(_0x2d1e8c(0x32a)+'store\x20lo'+_0x2d1e8c(0x452)+_0x2d1e8c(0x353)+_0x2d1e8c(0x29f),{'filePath':_0x5cd170,'openclawVersion':_0x43555d[_0x2d1e8c(0x2bc)+_0x2d1e8c(0x448)]});break;}continue;}await writeFile(_0x5cd170,_0x4b9cc5[_0x2d1e8c(0x369)],'utf8'),_0x2a26e0[_0x2d1e8c(0x44a)+_0x2d1e8c(0x2bb)]?.[_0x2d1e8c(0x434)]?.(_0x2d1e8c(0x32a)+_0x2d1e8c(0x2b2)+_0x2d1e8c(0x452)+_0x2d1e8c(0x29f),{'filePath':_0x5cd170,'openclawVersion':_0x43555d['openclaw'+_0x2d1e8c(0x448)]});break;}for(const _0x4a626b of _0x3f6cc2){const _0x2bb8e9=await readFile(_0x4a626b,_0x2d1e8c(0x26e)),_0x398ba2=patchSessionStoreWriteFromSource(_0x2bb8e9,{'bridgeImportPath':_0x404dac});if(!_0x398ba2[_0x2d1e8c(0x37e)]){if(_0x398ba2[_0x2d1e8c(0x245)]===_0x2d1e8c(0x454)+_0x2d1e8c(0x37e)){_0x2a26e0[_0x2d1e8c(0x44a)+_0x2d1e8c(0x2bb)]?.[_0x2d1e8c(0x434)]?.(_0x2d1e8c(0x32a)+_0x2d1e8c(0x26d)+_0x2d1e8c(0x347)+_0x2d1e8c(0x421)+'y\x20applie'+'d',{'filePath':_0x4a626b,'openclawVersion':_0x43555d[_0x2d1e8c(0x2bc)+'Version']});break;}continue;}await writeFile(_0x4a626b,_0x398ba2['source'],'utf8'),_0x2a26e0[_0x2d1e8c(0x44a)+_0x2d1e8c(0x2bb)]?.[_0x2d1e8c(0x434)]?.('session\x20'+'store\x20wr'+_0x2d1e8c(0x347)+_0x2d1e8c(0x32e)+'d',{'filePath':_0x4a626b,'openclawVersion':_0x43555d['openclaw'+_0x2d1e8c(0x448)]});break;}}async function patchWeixinOutboundSessionRoute(_0x83d108,_0x5d2ea2,_0x2ef26e={}){const _0x247ad0=_0x39af49,_0x3f44a5=join(_0x83d108,'openclaw',_0x247ad0(0x3b8),_0x247ad0(0x410)+'ns',_0x247ad0(0x2bc)+_0x247ad0(0x428),_0x247ad0(0x3b8),'src',_0x247ad0(0x37d)+'js');if(!existsSync(_0x3f44a5)){_0x2ef26e[_0x247ad0(0x44a)+_0x247ad0(0x2bb)]?.[_0x247ad0(0x434)]?.(_0x247ad0(0x2d9)+_0x247ad0(0x319)+'session\x20'+_0x247ad0(0x1dd)+_0x247ad0(0x43a)+_0x247ad0(0x467)+_0x247ad0(0x3bf)+_0x247ad0(0x285)+'d',{'openclawVersion':_0x5d2ea2[_0x247ad0(0x2bc)+_0x247ad0(0x448)],'filePath':_0x3f44a5});return;}const _0x2d3390=await readFile(_0x3f44a5,_0x247ad0(0x26e)),_0x39f94c=patchWeixinOutboundSessionRouteFromSource(_0x2d3390);if(!_0x39f94c[_0x247ad0(0x37e)]){if(_0x39f94c['reason']===_0x247ad0(0x454)+'patched'){_0x2ef26e[_0x247ad0(0x44a)+_0x247ad0(0x2bb)]?.[_0x247ad0(0x434)]?.(_0x247ad0(0x2d9)+_0x247ad0(0x319)+'session\x20'+_0x247ad0(0x1dd)+_0x247ad0(0x426)+'ady\x20appl'+_0x247ad0(0x35f),{'openclawVersion':_0x5d2ea2[_0x247ad0(0x2bc)+_0x247ad0(0x448)],'filePath':_0x3f44a5});return;}_0x2ef26e[_0x247ad0(0x44a)+_0x247ad0(0x2bb)]?.['warn']?.(_0x247ad0(0x2d9)+_0x247ad0(0x319)+_0x247ad0(0x32a)+_0x247ad0(0x1dd)+_0x247ad0(0x43a)+_0x247ad0(0x3ac)+_0x247ad0(0x28f)+_0x247ad0(0x32c)+_0x247ad0(0x231),{'openclawVersion':_0x5d2ea2[_0x247ad0(0x2bc)+'Version'],'filePath':_0x3f44a5,'reason':_0x39f94c[_0x247ad0(0x245)]});return;}await writeFile(_0x3f44a5,_0x39f94c[_0x247ad0(0x369)],'utf8'),_0x2ef26e['runtimeL'+_0x247ad0(0x2bb)]?.[_0x247ad0(0x434)]?.(_0x247ad0(0x2d9)+_0x247ad0(0x319)+_0x247ad0(0x32a)+_0x247ad0(0x1dd)+'tch\x20appl'+_0x247ad0(0x35f),{'openclawVersion':_0x5d2ea2[_0x247ad0(0x2bc)+_0x247ad0(0x448)],'filePath':_0x3f44a5,'note':_0x247ad0(0x35e)+'y\x20compat'+_0x247ad0(0x3c6)+_0x247ad0(0x3bd)+'r\x20@tence'+_0x247ad0(0x328)+_0x247ad0(0x3a2)+_0x247ad0(0x24d)+_0x247ad0(0x395)+_0x247ad0(0x3ea)+_0x247ad0(0x3fa)+_0x247ad0(0x3a8)+_0x247ad0(0x223)+'d\x20as\x20gro'+_0x247ad0(0x440)+'ons;\x20ver'+_0x247ad0(0x1f4)+_0x247ad0(0x287)+'\x20on\x20futu'+'re\x20upgra'+_0x247ad0(0x3e0)});}async function patchWeixinOutboundFallbackRuntime(_0x362afb,_0x344b2e,_0x385bd5={}){const _0x485dbd=_0x39af49,_0x56f25a=resolve(_0x362afb,_0x344b2e['openclaw'+_0x485dbd(0x3a1)+'ir']),_0xc5732e=join(_0x56f25a,'dist'),_0x3f9fc9=(await readdir(_0xc5732e,{'withFileTypes':!![]})[_0x485dbd(0x394)](()=>[]))[_0x485dbd(0x37a)](_0x25bb10=>_0x25bb10[_0x485dbd(0x386)]()&&_0x25bb10['name']['startsWi'+'th'](_0x485dbd(0x372)+_0x485dbd(0x441)+'-')&&_0x25bb10[_0x485dbd(0x271)][_0x485dbd(0x252)](_0x485dbd(0x36d)))[_0x485dbd(0x342)](_0x122516=>join(_0xc5732e,_0x122516['name']));if(_0x3f9fc9[_0x485dbd(0x2d0)]===0x0){_0x385bd5['runtimeL'+_0x485dbd(0x2bb)]?.[_0x485dbd(0x3fd)]?.(_0x485dbd(0x2d9)+_0x485dbd(0x319)+'fallback'+'\x20patch\x20s'+_0x485dbd(0x416)+_0x485dbd(0x372)+_0x485dbd(0x48b)+_0x485dbd(0x34c)+'nd',{'openclawVersion':_0x344b2e[_0x485dbd(0x2bc)+_0x485dbd(0x448)],'distDir':_0xc5732e});return;}for(const _0x3ceef4 of _0x3f9fc9){const _0x262634=await readFile(_0x3ceef4,_0x485dbd(0x26e)),_0x2b9cc1=patchWeixinOutboundFallbackFromSource(_0x262634);if(!_0x2b9cc1[_0x485dbd(0x37e)]){if(_0x2b9cc1['reason']==='already-'+_0x485dbd(0x37e)){_0x385bd5[_0x485dbd(0x44a)+_0x485dbd(0x2bb)]?.[_0x485dbd(0x434)]?.(_0x485dbd(0x2d9)+_0x485dbd(0x319)+_0x485dbd(0x304)+_0x485dbd(0x28b)+'lready\x20a'+_0x485dbd(0x411),{'openclawVersion':_0x344b2e['openclaw'+'Version'],'filePath':_0x3ceef4});return;}continue;}await writeFile(_0x3ceef4,_0x2b9cc1['source'],_0x485dbd(0x26e)),_0x385bd5['runtimeL'+_0x485dbd(0x2bb)]?.[_0x485dbd(0x434)]?.(_0x485dbd(0x2d9)+'utbound\x20'+_0x485dbd(0x304)+_0x485dbd(0x28b)+_0x485dbd(0x411),{'openclawVersion':_0x344b2e[_0x485dbd(0x2bc)+_0x485dbd(0x448)],'filePath':_0x3ceef4,'note':_0x485dbd(0x35e)+'y\x20compat'+_0x485dbd(0x3c6)+'patch\x20fo'+'rcing\x20op'+_0x485dbd(0x3ca)+'eixin\x20@i'+_0x485dbd(0x3cb)+_0x485dbd(0x25a)+_0x485dbd(0x435)+_0x485dbd(0x281)+_0x485dbd(0x409)+_0x485dbd(0x291)+_0x485dbd(0x28c)+'\x20routing'+_0x485dbd(0x47e)+_0x485dbd(0x3b7)});return;}_0x385bd5[_0x485dbd(0x44a)+_0x485dbd(0x2bb)]?.[_0x485dbd(0x3fd)]?.(_0x485dbd(0x2d9)+'utbound\x20'+_0x485dbd(0x304)+'\x20patch\x20s'+_0x485dbd(0x416)+_0x485dbd(0x3da)+_0x485dbd(0x225)+_0x485dbd(0x46e),{'openclawVersion':_0x344b2e[_0x485dbd(0x2bc)+_0x485dbd(0x448)]});}async function patchRequestIdTitleRuntime(_0x2622df,_0x1171b8,_0x3e5cc9={}){const _0xe81334=_0x39af49,_0x13fcf5=resolve(_0x2622df,_0x1171b8[_0xe81334(0x2bc)+'WorkingD'+'ir']),_0x21ff07=join(_0x13fcf5,_0xe81334(0x3b8)),_0x1c8a50=_0xe81334(0x2db)+_0xe81334(0x1e9)+_0xe81334(0x2a0)+_0xe81334(0x26a)+_0xe81334(0x2cf)+'ridge.mj'+'s',_0x226b28=join(_0x2622df,'shell-ru'+_0xe81334(0x2c9),_0xe81334(0x244)+'id','runtime-'+'bridge.m'+'js');if(!existsSync(_0x226b28)){_0x3e5cc9[_0xe81334(0x44a)+_0xe81334(0x2bb)]?.[_0xe81334(0x434)]?.('request-'+'id\x20title'+'\x20runtime'+'\x20patch\x20s'+_0xe81334(0x416)+_0xe81334(0x200)+_0xe81334(0x2fd)+'able',{'bridgePath':_0x226b28,'openclawVersion':_0x1171b8[_0xe81334(0x2bc)+_0xe81334(0x448)]});return;}const _0x484870=(await readdir(_0x21ff07,{'withFileTypes':!![]})[_0xe81334(0x394)](()=>[]))[_0xe81334(0x37a)](_0x204dba=>_0x204dba[_0xe81334(0x386)]()&&_0x204dba[_0xe81334(0x271)]['startsWi'+'th'](_0xe81334(0x443))&&_0x204dba[_0xe81334(0x271)]['endsWith'](_0xe81334(0x36d)))['map'](_0x493286=>join(_0x21ff07,_0x493286[_0xe81334(0x271)]));for(const _0x590437 of _0x484870){const _0x5562f5=await readFile(_0x590437,'utf8'),_0x3ac102=patchRequestIdTitleRuntimeFromSource(_0x5562f5,{'bridgeImportPath':_0x1c8a50});if(!_0x3ac102['patched']){if(_0x3ac102['reason']==='already-'+_0xe81334(0x37e)){_0x3e5cc9['runtimeL'+_0xe81334(0x2bb)]?.['info']?.(_0xe81334(0x244)+_0xe81334(0x30b)+_0xe81334(0x48b)+_0xe81334(0x28b)+_0xe81334(0x299)+'pplied',{'filePath':_0x590437,'openclawVersion':_0x1171b8[_0xe81334(0x2bc)+_0xe81334(0x448)]});break;}continue;}await writeFile(_0x590437,_0x3ac102[_0xe81334(0x369)],_0xe81334(0x26e)),_0x3e5cc9['runtimeL'+_0xe81334(0x2bb)]?.[_0xe81334(0x434)]?.(_0xe81334(0x244)+_0xe81334(0x30b)+'\x20runtime'+'\x20patch\x20a'+_0xe81334(0x411),{'filePath':_0x590437,'openclawVersion':_0x1171b8[_0xe81334(0x2bc)+_0xe81334(0x448)]});break;}}async function patchQQBotOutboundFallbackRuntime(_0x4f3194,_0x58a2a6,_0x50b9a7={}){const _0xcb69d6=_0x39af49,_0xaa9ef0=resolve(_0x4f3194,_0x58a2a6[_0xcb69d6(0x2bc)+_0xcb69d6(0x3a1)+'ir']),_0x2230e6=join(_0xaa9ef0,_0xcb69d6(0x3b8)),_0x104fcd=(await readdir(_0x2230e6,{'withFileTypes':!![]})[_0xcb69d6(0x394)](()=>[]))[_0xcb69d6(0x37a)](_0x6d11b5=>_0x6d11b5['isFile']()&&_0x6d11b5['name']['startsWi'+'th'](_0xcb69d6(0x372)+'-session'+'-')&&_0x6d11b5[_0xcb69d6(0x271)][_0xcb69d6(0x252)](_0xcb69d6(0x36d)))[_0xcb69d6(0x342)](_0xf2913=>join(_0x2230e6,_0xf2913['name']));if(_0x104fcd[_0xcb69d6(0x2d0)]===0x0){_0x50b9a7[_0xcb69d6(0x44a)+'ogger']?.[_0xcb69d6(0x3fd)]?.(_0xcb69d6(0x485)+'tbound\x20f'+'allback\x20'+'patch\x20sk'+_0xcb69d6(0x361)+_0xcb69d6(0x319)+_0xcb69d6(0x45a)+'not\x20foun'+'d',{'openclawVersion':_0x58a2a6['openclaw'+_0xcb69d6(0x448)],'distDir':_0x2230e6});return;}for(const _0x4f9b29 of _0x104fcd){const _0x30c663=await readFile(_0x4f9b29,'utf8'),_0x481a9a=patchQQBotOutboundFallbackFromSource(_0x30c663);if(!_0x481a9a[_0xcb69d6(0x37e)]){if(_0x481a9a['reason']===_0xcb69d6(0x454)+_0xcb69d6(0x37e)){_0x50b9a7[_0xcb69d6(0x44a)+_0xcb69d6(0x2bb)]?.[_0xcb69d6(0x434)]?.('qqbot\x20ou'+'tbound\x20f'+_0xcb69d6(0x469)+_0xcb69d6(0x2b0)+_0xcb69d6(0x2f1)+_0xcb69d6(0x22c),{'openclawVersion':_0x58a2a6[_0xcb69d6(0x2bc)+_0xcb69d6(0x448)],'filePath':_0x4f9b29});return;}continue;}await writeFile(_0x4f9b29,_0x481a9a[_0xcb69d6(0x369)],_0xcb69d6(0x26e)),_0x50b9a7[_0xcb69d6(0x44a)+_0xcb69d6(0x2bb)]?.[_0xcb69d6(0x434)]?.(_0xcb69d6(0x485)+_0xcb69d6(0x475)+'allback\x20'+_0xcb69d6(0x46c)+'plied',{'openclawVersion':_0x58a2a6[_0xcb69d6(0x2bc)+_0xcb69d6(0x448)],'filePath':_0x4f9b29,'note':_0xcb69d6(0x35e)+_0xcb69d6(0x38a)+_0xcb69d6(0x3c6)+_0xcb69d6(0x3bd)+_0xcb69d6(0x242)+_0xcb69d6(0x2ab)+_0xcb69d6(0x372)+_0xcb69d6(0x1f2)+_0xcb69d6(0x38f)+_0xcb69d6(0x35c)+_0xcb69d6(0x315)+_0xcb69d6(0x325)+_0xcb69d6(0x302)+'n\x20the\x20pe'+_0xcb69d6(0x33a)});return;}_0x50b9a7[_0xcb69d6(0x44a)+_0xcb69d6(0x2bb)]?.[_0xcb69d6(0x3fd)]?.(_0xcb69d6(0x485)+_0xcb69d6(0x475)+_0xcb69d6(0x469)+'patch\x20sk'+_0xcb69d6(0x34f)+_0xcb69d6(0x388)+_0xcb69d6(0x33f)+'t\x20found',{'openclawVersion':_0x58a2a6[_0xcb69d6(0x2bc)+'Version']});}async function patchQQBotOutboundSessionRoute(_0x4b9acf,_0x46c59f,_0x52af60={}){const _0x20d125=_0x39af49,_0x17f12f=join(_0x4b9acf,'openclaw','dist',_0x20d125(0x410)+'ns',_0x20d125(0x25e),_0x20d125(0x3b8));if(!existsSync(_0x17f12f)){_0x52af60[_0x20d125(0x44a)+_0x20d125(0x2bb)]?.[_0x20d125(0x434)]?.('qqbot\x20ou'+'tbound\x20s'+_0x20d125(0x31a)+'oute\x20pat'+_0x20d125(0x487)+_0x20d125(0x2c3)+_0x20d125(0x207)+_0x20d125(0x326),{'openclawVersion':_0x46c59f['openclaw'+_0x20d125(0x448)],'distDir':_0x17f12f});return;}const _0x4d269c=(await readdir(_0x17f12f,{'withFileTypes':!![]})[_0x20d125(0x394)](()=>[]))[_0x20d125(0x37a)](_0x34681f=>_0x34681f[_0x20d125(0x386)]()&&_0x34681f[_0x20d125(0x271)]['endsWith'](_0x20d125(0x36d)))[_0x20d125(0x342)](_0x25f1fd=>join(_0x17f12f,_0x25f1fd[_0x20d125(0x271)]));for(const _0x1f89c4 of _0x4d269c){const _0x513fce=await readFile(_0x1f89c4,_0x20d125(0x26e)),_0x38151c=patchQQBotOutboundSessionRouteFromSource(_0x513fce);if(!_0x38151c[_0x20d125(0x37e)]){if(_0x38151c['reason']==='already-'+_0x20d125(0x37e)){_0x52af60['runtimeL'+'ogger']?.[_0x20d125(0x434)]?.(_0x20d125(0x485)+_0x20d125(0x423)+_0x20d125(0x31a)+'oute\x20pat'+_0x20d125(0x21c)+_0x20d125(0x2a8)+'ed',{'openclawVersion':_0x46c59f['openclaw'+_0x20d125(0x448)],'filePath':_0x1f89c4});return;}continue;}await writeFile(_0x1f89c4,_0x38151c[_0x20d125(0x369)],_0x20d125(0x26e)),_0x52af60['runtimeL'+_0x20d125(0x2bb)]?.[_0x20d125(0x434)]?.('qqbot\x20ou'+_0x20d125(0x423)+_0x20d125(0x31a)+'oute\x20pat'+_0x20d125(0x297)+'ed',{'openclawVersion':_0x46c59f['openclaw'+_0x20d125(0x448)],'filePath':_0x1f89c4,'note':_0x20d125(0x35e)+'y\x20compat'+_0x20d125(0x3c6)+_0x20d125(0x3bd)+_0x20d125(0x27e)+_0x20d125(0x2ec)+_0x20d125(0x255)+'tbound\x20d'+'elivery\x20'+_0x20d125(0x432)+'being\x20in'+_0x20d125(0x480)+_0x20d125(0x332)+_0x20d125(0x3b4)+_0x20d125(0x3ff)+'r\x20id.'});return;}_0x52af60[_0x20d125(0x44a)+_0x20d125(0x2bb)]?.[_0x20d125(0x3fd)]?.(_0x20d125(0x485)+_0x20d125(0x423)+_0x20d125(0x31a)+_0x20d125(0x3a7)+_0x20d125(0x487)+'ed;\x20chan'+_0x20d125(0x1df)+'e\x20not\x20fo'+'und',{'openclawVersion':_0x46c59f['openclaw'+_0x20d125(0x448)],'distDir':_0x17f12f});}async function resolveRuntimeChannelImportPath(_0x27984b,_0x4f1b17){const _0x1ee9d1=_0x39af49,_0x594ab1=_0x4f1b17[_0x1ee9d1(0x37a)](_0x2208d3=>_0x2208d3['isFile']()&&_0x2208d3[_0x1ee9d1(0x271)][_0x1ee9d1(0x433)+'th'](_0x1ee9d1(0x338)+_0x1ee9d1(0x239))&&_0x2208d3[_0x1ee9d1(0x271)][_0x1ee9d1(0x252)](_0x1ee9d1(0x36d))&&!_0x2208d3[_0x1ee9d1(0x271)][_0x1ee9d1(0x433)+'th'](_0x1ee9d1(0x338)+_0x1ee9d1(0x239)+_0x1ee9d1(0x46f)))[_0x1ee9d1(0x342)](_0x3130af=>_0x3130af['name'])[_0x1ee9d1(0x3ec)]();for(const _0x39993f of _0x594ab1){const _0x3b5ff4=await readFile(join(_0x27984b,_0x39993f),'utf8');if(_0x3b5ff4[_0x1ee9d1(0x2d8)](_0x1ee9d1(0x3c5)+_0x1ee9d1(0x278)+_0x1ee9d1(0x3ce)))return'./'+_0x39993f;}return null;}function normalizeRuntimeRelativePath(_0x4ec1ce){const _0x25e452=_0x39af49;return _0x4ec1ce[_0x25e452(0x464)+'ll']('\x5c','/');}function toWindowsPath(_0x2bc548){const _0x50bb3c=_0x39af49;return _0x2bc548[_0x50bb3c(0x464)+'ll']('/','\x5c');}function validateRuntimeNodeVersion(_0x1adb91,_0x45b8e5){const _0x21ddc2=_0x39af49;if(_0x1adb91[_0x21ddc2(0x3a5)+_0x21ddc2(0x216)]===_0x45b8e5[_0x21ddc2(0x2bc)]['nodeVers'+_0x21ddc2(0x216)])return;throw new Error('runtime\x20'+_0x21ddc2(0x3a5)+_0x21ddc2(0x316)+_0x21ddc2(0x3b3)+_0x21ddc2(0x346)+(_0x1adb91[_0x21ddc2(0x3a5)+_0x21ddc2(0x216)]||'unknown')+(_0x21ddc2(0x27a)+'config=')+_0x45b8e5[_0x21ddc2(0x2bc)][_0x21ddc2(0x3a5)+_0x21ddc2(0x216)]+'.\x20'+('Run\x20\x22wuj'+_0x21ddc2(0x461)+_0x21ddc2(0x46d)+'\x22\x20so\x20the'+'\x20product'+_0x21ddc2(0x48b)+_0x21ddc2(0x2a9)+_0x21ddc2(0x323)+_0x21ddc2(0x462)+'\x20configu'+_0x21ddc2(0x355)+_0x21ddc2(0x384)+'.'));}function validateRuntimeOpenClawVersion(_0x276174,_0x51a7fe){const _0x2c5516=_0x39af49;if(_0x276174[_0x2c5516(0x2bc)+'Version']===_0x51a7fe['openclaw'][_0x2c5516(0x2bc)+'Version'])return;throw new Error('runtime\x20'+_0x2c5516(0x2bc)+_0x2c5516(0x3e7)+_0x2c5516(0x39a)+_0x2c5516(0x379)+_0x2c5516(0x3e1)+(_0x276174[_0x2c5516(0x2bc)+'Version']||_0x2c5516(0x2cb))+(_0x2c5516(0x27a)+_0x2c5516(0x2f8))+_0x51a7fe[_0x2c5516(0x2bc)][_0x2c5516(0x2bc)+'Version']+'.\x20'+(_0x2c5516(0x438)+_0x2c5516(0x461)+_0x2c5516(0x46d)+'\x22\x20so\x20the'+_0x2c5516(0x48b)+'\x20can\x20ins'+_0x2c5516(0x321)+_0x2c5516(0x3cf)+_0x2c5516(0x36f)+_0x2c5516(0x3c7)+'sion.'));}function _0x3b5b(_0x33c627,_0x4656b2){_0x33c627=_0x33c627-0x1d7;const _0x8478f9=_0x8478();let _0x3b5b0b=_0x8478f9[_0x33c627];return _0x3b5b0b;}function parseNpmPackJson(_0x410400){const _0x320571=_0x39af49,_0x54c07a=_0x410400[_0x320571(0x1f1)](),_0x5df50f=_0x54c07a[_0x320571(0x259)]('[');if(_0x5df50f<0x0)throw new Error(_0x320571(0x2e7)+_0x320571(0x35b)+'\x20return\x20'+_0x320571(0x47b)+_0x54c07a[_0x320571(0x243)](0x0,0x1f4));const _0x1837b6=JSON[_0x320571(0x413)](_0x54c07a[_0x320571(0x243)](_0x5df50f)),_0x2420ff=Array[_0x320571(0x430)](_0x1837b6)?_0x1837b6[0x0]:_0x1837b6;if(!_0x2420ff||typeof _0x2420ff!==_0x320571(0x1e0))throw new Error(_0x320571(0x2e7)+_0x320571(0x476)+'d\x20an\x20inv'+'alid\x20pay'+_0x320571(0x1de)+_0x54c07a[_0x320571(0x243)](0x0,0x1f4));return _0x2420ff;}function normalizePackedTarballFilename(_0x4d02b9){const _0x29d25c=_0x39af49;return _0x4d02b9[_0x29d25c(0x2ff)](/^@/,'')['replaceA'+'ll']('/','-')['replaceA'+'ll']('\x5c','-');}async function runProcess(_0x5abdf1,_0x518ed5,_0x11e355={}){const _0x3d5214=_0x39af49,_0x3b0199=_0x11e355[_0x3d5214(0x23a)]||[_0x5abdf1,..._0x518ed5][_0x3d5214(0x23f)]('\x20'),_0x1b0eec=_0x11e355[_0x3d5214(0x202)+'s']??NPM_INSTALL_TIMEOUT_MS,_0x2c62e9=spawn(_0x5abdf1,_0x518ed5,{'cwd':_0x11e355['cwd'],'env':_0x11e355[_0x3d5214(0x263)],'stdio':[_0x3d5214(0x3d9),_0x3d5214(0x20f),_0x3d5214(0x20f)]});return await new Promise((_0x38471a,_0x56dacd)=>{const _0x2bbe9d=_0x3d5214;let _0x627aad='',_0x239c64='',_0x13dae9=![];const _0x278df2=setTimeout(()=>{const _0x5de460=_0x3b5b;if(_0x13dae9)return;_0x13dae9=!![],_0x2c62e9['kill'](_0x5de460(0x1fb)),_0x56dacd(new Error(_0x3b0199+(_0x5de460(0x402)+'ut\x20after'+'\x20')+_0x1b0eec+'ms'));},_0x1b0eec);_0x2c62e9['stdout']['on']('data',_0x2ef01c=>{const _0x517751=_0x3b5b;_0x627aad+=_0x2ef01c[_0x517751(0x232)]();}),_0x2c62e9[_0x2bbe9d(0x359)]['on'](_0x2bbe9d(0x212),_0x417089=>{const _0x375a7f=_0x2bbe9d;_0x239c64+=_0x417089[_0x375a7f(0x232)]();}),_0x2c62e9['on'](_0x2bbe9d(0x36c),_0x3c931=>{if(_0x13dae9)return;_0x13dae9=!![],clearTimeout(_0x278df2),_0x56dacd(_0x3c931);}),_0x2c62e9['on']('close',(_0xe97c90,_0x290b8a)=>{const _0x4f7ebd=_0x2bbe9d;if(_0x13dae9)return;_0x13dae9=!![],clearTimeout(_0x278df2);if(_0xe97c90===0x0){_0x38471a({'stdout':_0x627aad,'stderr':_0x239c64});return;}_0x56dacd(new Error(_0x3b0199+('\x20failed\x20'+_0x4f7ebd(0x3d4)+'e=')+(_0xe97c90??_0x4f7ebd(0x33b))+_0x4f7ebd(0x339)+(_0x290b8a??_0x4f7ebd(0x33b))+'\x0a'+(''+(_0x239c64||_0x627aad))[_0x4f7ebd(0x1f1)]()));});});}async function installOpenClawPackage(_0x5c81d6,_0x2c74a5){const _0x29e0cf=_0x39af49,_0x2cfc04=join(_0x5c81d6[_0x29e0cf(0x2ba)+_0x29e0cf(0x40a)],'.cache'),_0x131b6f=join(_0x5c81d6[_0x29e0cf(0x2ba)+_0x29e0cf(0x40a)],_0x29e0cf(0x256)+_0x29e0cf(0x270)+'t');await mkdir(_0x2cfc04,{'recursive':!![]}),await removePathWithRetries(_0x131b6f),await mkdir(_0x131b6f,{'recursive':!![]});const _0x2398d4=await createRuntimeEnv(_0x5c81d6),_0x2413c1=_0x29e0cf(0x2bc)+'@'+_0x2c74a5;console[_0x29e0cf(0x37b)](_0x29e0cf(0x2d1)+_0x29e0cf(0x444)+_0x29e0cf(0x3d2)+_0x29e0cf(0x251)+'\x20'+_0x2413c1);const _0x9739e9=await runProcess(_0x5c81d6[_0x29e0cf(0x308)+'utable'],[_0x5c81d6[_0x29e0cf(0x2c4)],_0x29e0cf(0x420),_0x2413c1,'--json'],{'cwd':_0x2cfc04,'env':_0x2398d4,'label':_0x29e0cf(0x2e7)+'\x20'+_0x2413c1}),_0x57be93=parseNpmPackJson(_0x9739e9[_0x29e0cf(0x424)]);if(_0x57be93[_0x29e0cf(0x344)]!==_0x2c74a5)throw new Error('Configur'+_0x29e0cf(0x33d)+_0x29e0cf(0x32d)+_0x2c74a5+('\x20resolve'+_0x29e0cf(0x348))+_0x57be93[_0x29e0cf(0x344)]);const _0xf4aef0=resolve(_0x2cfc04,_0x57be93[_0x29e0cf(0x1e8)]);if(!existsSync(_0xf4aef0))throw new Error('npm\x20pack'+_0x29e0cf(0x35b)+_0x29e0cf(0x345)+_0x29e0cf(0x471)+'\x20'+_0xf4aef0);await runProcess(_0x29e0cf(0x456),[_0x29e0cf(0x3cc),_0xf4aef0,'-C',_0x131b6f],{'label':'extract\x20'+_0x57be93[_0x29e0cf(0x1e8)]}),await removePathWithRetries(_0x5c81d6[_0x29e0cf(0x2bc)+_0x29e0cf(0x3a1)+'ir']),await rename(join(_0x131b6f,_0x29e0cf(0x258)),_0x5c81d6['openclaw'+_0x29e0cf(0x3a1)+'ir']),await removePathWithRetries(_0x131b6f),await runProcess(_0x5c81d6[_0x29e0cf(0x308)+_0x29e0cf(0x2d7)],[_0x5c81d6[_0x29e0cf(0x2c4)],_0x29e0cf(0x330),_0x29e0cf(0x38b)+'ev',_0x29e0cf(0x42f)+_0x29e0cf(0x3fe),'--no-aud'+'it',_0x29e0cf(0x24b)+'d',_0x29e0cf(0x30c)+_0x29e0cf(0x404)+'ps'],{'cwd':_0x5c81d6['openclaw'+_0x29e0cf(0x3a1)+'ir'],'env':_0x2398d4,'label':_0x29e0cf(0x20a)+'all\x20'+_0x2413c1+(_0x29e0cf(0x48b)+_0x29e0cf(0x40f)+'ncies')});if(!existsSync(_0x5c81d6[_0x29e0cf(0x2bc)+_0x29e0cf(0x36e)]))throw new Error(_0x29e0cf(0x43b)+_0x29e0cf(0x398)+_0x29e0cf(0x34c)+'nd\x20after'+'\x20install'+':\x20'+_0x5c81d6[_0x29e0cf(0x2bc)+_0x29e0cf(0x36e)]);}async function ensureRuntimeBase(_0x47207e,_0x53fc39,_0x21cee2={}){const _0x5b368e=_0x39af49;await mkdir(_0x53fc39,{'recursive':!![]});let _0x5246ba=await readRuntimeManifest(_0x53fc39);const _0xda8c13=_0x47207e[_0x5b368e(0x2bc)]['nodeVers'+_0x5b368e(0x216)],_0x567278=_0x47207e[_0x5b368e(0x2bc)][_0x5b368e(0x2bc)+'Version'],_0x68abf2=existsSync(resolveManifestPath(_0x53fc39)),_0x47c816=runtimeHasRequiredPaths(_0x53fc39,_0x5246ba),_0x2a2c99=_0x5246ba[_0x5b368e(0x3a5)+_0x5b368e(0x216)]===_0xda8c13;!_0x68abf2||!_0x47c816||!_0x2a2c99?(_0x21cee2[_0x5b368e(0x44a)+_0x5b368e(0x2bb)]?.[_0x5b368e(0x220)+'t']?.(_0x5b368e(0x45a)+_0x5b368e(0x228)+_0x5b368e(0x2b4)+'ed',{'runtimeRoot':_0x53fc39,'reason':!_0x68abf2?_0x5b368e(0x43d)+_0x5b368e(0x41a):!_0x47c816?_0x5b368e(0x43d)+_0x5b368e(0x3f3)+_0x5b368e(0x48b)+_0x5b368e(0x317):_0x5b368e(0x46a)+_0x5b368e(0x484)+'match','syncOnly':_0x21cee2[_0x5b368e(0x3e4)]}),_0x5246ba=await buildRuntimeBase(_0x47207e,_0x53fc39,_0x5246ba),_0x21cee2['runtimeL'+_0x5b368e(0x2bb)]?.[_0x5b368e(0x220)+'t']?.('runtime\x20'+_0x5b368e(0x228)+'ld\x20compl'+'eted',{'manifest':summarizeRuntimeManifest(_0x5246ba)})):_0x21cee2[_0x5b368e(0x44a)+_0x5b368e(0x2bb)]?.[_0x5b368e(0x220)+'t']?.(_0x5b368e(0x45a)+_0x5b368e(0x1ec)+_0x5b368e(0x2c8)+_0x5b368e(0x387),{'manifest':summarizeRuntimeManifest(_0x5246ba)});if(!existsSync(resolve(_0x53fc39,_0x5246ba[_0x5b368e(0x2bc)+_0x5b368e(0x36e)]))){const _0x26c264=createRuntimeInfoFromManifest(_0x53fc39,_0x5246ba,{'allowMissingOpenClaw':!![]});await installOpenClawPackage(_0x26c264,_0x567278),_0x5246ba[_0x5b368e(0x2bc)+_0x5b368e(0x448)]=_0x567278;}return _0x5246ba;}function runtimeHasRequiredPaths(_0x4abb7b,_0x13268b){const _0x17f55d=_0x39af49;return[_0x17f55d(0x308)+_0x17f55d(0x2d7),_0x17f55d(0x2c4),_0x17f55d(0x2bc)+_0x17f55d(0x3a1)+'ir',_0x17f55d(0x2bc)+_0x17f55d(0x36e)][_0x17f55d(0x358)](_0x27d83d=>typeof _0x13268b[_0x27d83d]===_0x17f55d(0x23c)&&_0x13268b[_0x27d83d]['trim']())&&[_0x17f55d(0x308)+'utable','npmCli'][_0x17f55d(0x358)](_0x3c60b2=>existsSync(resolve(_0x4abb7b,_0x13268b[_0x3c60b2])));}async function buildRuntimeBase(_0x6bcfc6,_0x56a56d,_0x5daf38={}){const _0x372f17=_0x39af49,_0x17e168=join(_0x56a56d,_0x372f17(0x375));await ensureRuntimeNode(_0x6bcfc6,_0x17e168);const _0x27fe3b=process[_0x372f17(0x26f)]===_0x372f17(0x2b9)?_0x372f17(0x284)+_0x372f17(0x233):'node/bin'+_0x372f17(0x46b),_0x24ff8a=process[_0x372f17(0x26f)]===_0x372f17(0x2b9)?_0x372f17(0x284)+_0x372f17(0x3f9)+_0x372f17(0x350)+'n/npm-cl'+_0x372f17(0x40d):_0x372f17(0x2df)+'/node_mo'+_0x372f17(0x36a)+_0x372f17(0x1e3)+_0x372f17(0x3fb),_0x489806={..._0x5daf38,'generatedAt':new Date()['toISOStr'+'ing'](),'nodeVersion':_0x6bcfc6[_0x372f17(0x2bc)][_0x372f17(0x3a5)+_0x372f17(0x216)],'openclawVersion':_0x5daf38['openclaw'+_0x372f17(0x448)]||'','platform':process[_0x372f17(0x26f)],'arch':process['arch'],'nodeExecutable':_0x27fe3b,'npmCli':_0x24ff8a,'openclawWorkingDir':_0x372f17(0x2bc),'openclawBin':_0x372f17(0x2bc)+_0x372f17(0x43f)+_0x372f17(0x264)};return await writeJson(resolveManifestPath(_0x56a56d),_0x489806),_0x489806;}async function removePathWithRetries(_0x54d26a){await rm(_0x54d26a,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96});}function _0x8478(){const _0x2e2e7d=['dy\x20appli','\x20can\x20be\x20','ions/run','Bot\x20c2c\x20','me\x20missi','ipped;\x20f','aw\x202026.','d\x20for\x20','patch\x20al','Expand-A','store\x20lo','octor\x20--','ld\x20start','_NAME:-','lite\x20pat','\x20kdocs\x20s','/node_mo','win32','runtimeR','ogger','openclaw','wujieai.','projectR','ules','15678924ddlKar','runtimeS','Spec','ed;\x20plug','npmCli','root','\x20synced','tar.xz','eady\x20cur','ntime','6\x20chat.s','unknown','skill','\x20skipped','win','untime-b','length','[wujie-s','PT_DIR/w','pped;\x20ru','rg/dist/','headers','some','utable','includes','weixin\x20o','function','../../sh','optional','\x20\x22%SCRIP','dge.mjs','node/lib','d:\x20','Name','FIG_FILE','doctor','fix\x20alre','prepare\x20','fix\x20comp','npm\x20pack','synced','chat\x20att','registry','extract\x20','law/qqbo','not\x20foun','then','AW_CONFI','E_NODE%\x22','ready\x20ap','wnloadin','fix','claw-run','llPaths','\x22\x20\x22$SCRI','solver\x20n','config=','pluginSp','LAW_STAT','atch\x20alr','docs','ot\x20avail','3465306bVvKDO','replace','nd\x20helpe','pped;\x20di','prefix\x20i','lib','fallback','dataDir','bin','download','nodeExec','E=%SCRIP','\x5cwjrt-','id\x20title','--legacy','ut\x20after','bug;\x20ver','channel\x20','agents','../../as','CRIPT_DI','ginPaths','st\x20be\x20a\x20','ons\x20with','ion\x20mism','\x20paths','11IwIEGH','utbound\x20','ession\x20r','runtime','PENCLAW_','devDepen','values','kill','\x20failed\x20','tall\x20the','66DgFpSz','rebuilt\x20','aipc-dow','out\x20c2c\x20','nstalled','LocalPlu','nt-weixi','ujie-log','session\x20','\x20entry\x20\x22','pe\x20not\x20f','law\x20','h\x20applie','LocalAge','install','LocalSki','th\x20c2c\x20i','Dependen','.json','skipped;','ayload\x20b','untime\x20p','runtime-','\x20signal=','er\x20id.','null','fix\x20star','ed\x20OpenC','NPM_CONF','shape\x20no','lied','_shared','map','\x20local\x20p','version','\x20create\x20','nifest=','ite\x20patc','d\x20to\x20','CONFIG_P','add','man','\x20not\x20fou','-doctor.','flow;\x20ve','ipped;\x20r','s/npm/bi','npm','on\x20futur','\x20already','time-too','red\x20Node','?t=','red','every','stderr','\x20doctor\x20','\x20did\x20not','ct\x20sessi','s/npm','Temporar','ied','pid','ipped;\x20o','all\x20plug','.cache','E_NAME%\x22','er\x20writt','ATE_DIR%',';\x20run\x20wu','\x20set\x20\x22OP','source','dules/np','onPolicy','error','.js','Bin','red\x20Open','nv:WUJIE','ckaging','outbound','\x20complet','(empty)','node','flush','integrit','generate',':\x20manife','filter','log','package.','channel.','patched','store\x20sq','rs;\x20veri','ile\x20not\x20','time','e\x20plugin','\x20version','.npmmirr','isFile','rent','esolver\x20','er\x20patch','y\x20compat','--omit=d','exec','ODE\x22\x20\x22$S','untime\x20r','\x20to\x20dire','stinatio','PATH','pt-path-','patch\x20sk','catch','n\x20outbou','r\x20runtim','in\x20','\x20bin\x20was','has','mismatch','files','time]\x20fe','ules/npm','lock.jso','roductRu','HOME=\x22${','WorkingD','n/opencl','\x20auth\x20sh','unction\x20','nodeVers','json','oute\x20pat','ors\x20bein','path:\x20','8Pphvsm','re\x20upgra','ped;\x20cha','failed','arm64','chment\x20b','y:\x20','ime\x20buil','\x20found','atch:\x20ma','n\x20the\x20di','now','nodejs.o','ailable.','dist','\x20written','annel\x20en','pendenci','wrapper\x20','patch\x20fo','es.','gin\x20not\x20','ATH=\x20cd\x20','SCRIPT_D','found','node.exe','ies:\x20','createRu','ibility\x20','Claw\x20ver','\x20summary','tory\x20mix','enclaw-w','m.wechat','-xzf','dataDirN','nnel','\x20configu','ame','\x20validat','time]\x20in','product\x20','with\x20cod','base64\x20p','13wPMmGD','pped;\x20lo','x\x20on\x20fut','ignore','resolver','agentSco','npm-cli.','wujiecla','er\x20respo','\x20-z\x20\x22$WU','des.','st=','2joCVdM','example','syncOnly','tching\x20p','empty\x20pl','Version\x20','x64','sets/wuj','nd\x20deliv','leName','sort','keys','@echo\x20of','$HOME/','h\x20summar','aipc-run','IPT_DIR=','required','set\x20\x22SCR','prepareP','try\x20not\x20','bytes','T_DIR%','e_module','ery\x20mirr','m-cli.js','.\x20Top-le','warn','eer','rect\x20pee','NFIG_PAT','cies','\x20timed\x20o','plugins\x20','-peer-de','examples','nPath\x20$e','ugin\x20spe','_HOME:-','ect\x20sess','oot','ATH=\x22${O','zip','i.js','shift','\x20depende','extensio','pplied','nse\x20hook','parse','export\x20O','r\x20OpenCl','kipped;\x20','NCLAW_ST','\x20loaded','shared-c','manifest','https://','eam\x20fix\x20','e\x20upgrad','or.com','-NoProfi','pack','h\x20alread','pruned\x20r','tbound\x20s','stdout','efore\x20pa','tch\x20alre','/npm','-weixin','enclaw\x20d','IG_REGIS','Unable\x20t','ecs','HIVE\x20-De','--json','--omit=p','isArray','\x20in\x20','mirrors\x20','startsWi','info','d\x20mirror','time-bac','ge\x20not\x20a','Run\x20\x22wuj','lient-','tch\x20skip','OpenClaw','CLAW_CON','missing\x20','ed;\x20brid','/opencla','up\x20sessi','-session','vel\x20entr','loader-','hell:run','NODE=\x22$S','agents\x20s','\x22==\x22\x22\x20se','Version','versions','runtimeL','entryCou','8075740lNKNyy','\x20on\x20futu','\x20-g','_SHELL_E','Claw','scripts','ad\x20patch','.tools','already-','\x20\x22OPENCL','tar','started','cal\x20runt','ntime\x20ch','runtime\x20','LiteralP','plugin\x20s','ntPaths','lugin\x20de','JIE_NO_L','ced','ie-shell','with\x20the','configPa','replaceA','\x20package','nloads-b','ped;\x20plu','wBin','allback\x20','node\x20ver','/node','patch\x20ap','\x20prepare','ot\x20found','state-','_modules','tarball:','size','=\x22${OPEN','d\x20for\x20lo','tbound\x20f','\x20returne','113264JWHVEU','spec','.plugin-','product','JSON:\x20','pped;\x20fi','%USERPRO','\x20is\x20unav','fy\x20upstr','dexed\x20wi','>/dev/nu','ie-logo.','chat-dis','sion\x20mis','qqbot\x20ou','wujie-lo','ch\x20skipp','shasum','OPENCLAW','olated\x20a','\x20runtime','fix\x20mark','all\x20loca','idated','statusCo','s\x20not\x20fo','ist\x20not\x20','resume','route\x20pa','load:\x20','nel\x20shap','object','eady\x20app','\x22\x20from\x20','m/bin/np','kup','installP','E_DIR=','atch\x20app','filename','ell-runt','location','NCLAW_CO','base\x20alr','TRY','close','ntime\x20re','untime\x20c','trim','\x20mirrors','ing','ify\x20upst','pec:\x20','isDirect','find','t\x20\x22OPENC','local','dencies','SIGTERM','index.mj','rchive\x20-','\x20request','h\x20skippe','bridge\x20n','--no-aud','timeoutM','split','codex\x20is','Duplicat','8023589YMeaeB','in\x20not\x20i','exec\x20\x22$R','tateDir','npm\x20inst','achment\x20','uth\x20patc','plugins','atch\x20ski','pipe','1\x20]\x20&&\x20[','@types','data','ath','provider','npm\x20root','ion','d\x20Node\x20r','nel\x20plug','skills','toISOStr','store-lo','ch\x20alrea','OME=','allowMis','Invalid\x20','importan','le\x20not\x20f','push','g\x20indexe','execPath','\x20shape\x20n','ory','plugin\x20r','base\x20bui','\x20path\x20wa','session-','local\x20pl','plied','NFIG_FIL','process.','path','mjs','ound','toString','e.exe','extract-','ore\x20pack','ILE_NAME',';\x20dist\x20n','ady\x20curr','channel-','label','374495AjcshB','string','IME_NODE','ache\x20bef','join','6.6\x20chan','-id\x20head','rcing\x20QQ','slice','request-','reason','st\x20not\x20f','tool\x20his','6\x20mixed\x20','node_mod','singOpen','--no-fun','R=\x22${OPE','aw-weixi','1053749rOoqwh','__tests_','el.inbou','stalling','endsWith','pluginId','npm-glob','t\x20c2c\x20ou','.opencla','.md','package','indexOf','\x20outboun','lugin\x20','ATH:-','chat\x20his','qqbot','set\x20\x22RUN','\x20install','-Command','rify\x20ups','env','w.mjs','147vkfpwB','in\x20insta','local:','jection\x20','in\x20runti','est-id/r','href','ATE_DIR:','store\x20wr','utf8','platform','w-extrac','name','\x20path\x20mu','ll\x20||\x20tr','dependen','scoped\x20s','lugins\x20s','age\x20was\x20','ntimeCha','o.mjs\x22\x202',',\x20shell.','jie-shel','resolved','OGO\x22\x20];\x20','r\x20@openc','\x20is\x20miss','connecto','s\x20to\x20dir','ackup','--\x20\x22$(di','node/nod','installe','aging','ream\x20fix','tream\x20fi','play-pro','ad-','\x20patch\x20a','n\x20plugin','ed-tool\x20','store-','nnel\x20sha','kill\x20not','ions\x20whe','ted','AME=','if\x20\x22%OPE','shell-ru','agent','ch\x20appli','e\x20tools\x20','lready\x20a','FILE%\x5c','time-bri','sessions','arch','ape\x20not\x20','\x20applied','ime/requ','bridge.m','\x20and\x20','G_FILE_N','ynced','vailable','\x22\x20at\x20','CONFIG_F'];_0x8478=function(){return _0x2e2e7d;};return _0x8478();}async function ensureRuntimeNode(_0x23a033,_0x57c579){const _0x513149=_0x39af49,_0x318ba0=_0x23a033[_0x513149(0x2bc)]['nodeVers'+_0x513149(0x216)],_0x7a5828=process[_0x513149(0x26f)]===_0x513149(0x2b9)?join(_0x57c579,_0x513149(0x3c3)):join(_0x57c579,'bin',_0x513149(0x375)),_0x58b594=process[_0x513149(0x26f)]===_0x513149(0x2b9)?join(_0x57c579,_0x513149(0x249)+_0x513149(0x2bf),_0x513149(0x351),'bin','npm-cli.'+'js'):join(_0x57c579,_0x513149(0x303),'node_mod'+_0x513149(0x2bf),_0x513149(0x351),'bin',_0x513149(0x3dc)+'js');if(existsSync(_0x7a5828)&&existsSync(_0x58b594)&&await getNodeVersion(_0x7a5828)===_0x318ba0)return;await removePathWithRetries(_0x57c579);if(process[_0x513149(0x449)]['node']===_0x318ba0){await linkCurrentNodeRuntime(_0x57c579);return;}await downloadNodeRuntime(_0x318ba0,_0x57c579);}async function getNodeVersion(_0x3376aa){const _0x3b2f04=_0x39af49;try{const _0x3e015a=await runProcess(_0x3376aa,['-p',_0x3b2f04(0x22e)+_0x3b2f04(0x449)+'.node'],{'label':_0x3376aa+'\x20version','timeoutMs':0x7530});return _0x3e015a['stdout'][_0x3b2f04(0x1f1)]();}catch{return'';}}async function linkCurrentNodeRuntime(_0x39a041){const _0x5ef1a3=_0x39af49,_0x4bf687=process[_0x5ef1a3(0x224)],_0x242824=resolve(dirname(_0x4bf687),'..'),_0x5bc6c4=process[_0x5ef1a3(0x26f)]===_0x5ef1a3(0x2b9)?resolve(_0x242824,_0x5ef1a3(0x249)+_0x5ef1a3(0x39d)):resolve(_0x242824,'lib/node'+_0x5ef1a3(0x470)+_0x5ef1a3(0x427)),_0x2b36d1=process[_0x5ef1a3(0x26f)]===_0x5ef1a3(0x2b9)?join(_0x39a041,_0x5ef1a3(0x3c3)):join(_0x39a041,_0x5ef1a3(0x306),_0x5ef1a3(0x375)),_0x324e92=process[_0x5ef1a3(0x26f)]===_0x5ef1a3(0x2b9)?join(_0x39a041,_0x5ef1a3(0x249)+'ules','npm'):join(_0x39a041,_0x5ef1a3(0x303),_0x5ef1a3(0x249)+_0x5ef1a3(0x2bf),_0x5ef1a3(0x351));await mkdir(dirname(_0x2b36d1),{'recursive':!![]}),await mkdir(dirname(_0x324e92),{'recursive':!![]}),await symlink(_0x4bf687,_0x2b36d1),existsSync(_0x5bc6c4)?await symlink(_0x5bc6c4,_0x324e92):await symlink(await resolveNpmRoot(),_0x324e92);}async function resolveNpmRoot(){const _0x3c97e3=_0x39af49,_0x82aa90=await runProcess(_0x3c97e3(0x351),[_0x3c97e3(0x2c5),'-g'],{'label':_0x3c97e3(0x215)+_0x3c97e3(0x44e),'timeoutMs':0x7530}),_0x5b363e=process['platform']===_0x3c97e3(0x2b9)?_0x82aa90[_0x3c97e3(0x424)][_0x3c97e3(0x1f1)]():join(_0x82aa90[_0x3c97e3(0x424)][_0x3c97e3(0x1f1)](),'npm');if(!existsSync(join(_0x5b363e,_0x3c97e3(0x306),'npm-cli.'+'js')))throw new Error(_0x3c97e3(0x2e7)+_0x3c97e3(0x277)+_0x3c97e3(0x2ed)+_0x3c97e3(0x474)+_0x3c97e3(0x458)+_0x3c97e3(0x3b1)+_0x3c97e3(0x2e0)+_0x5b363e);return _0x5b363e;}async function resolveExtractedNodeRoot(_0x4cddb6,_0x3bc0a6){const _0x271cf2=_0x39af49,_0x246937=join(_0x4cddb6,_0x3bc0a6);if(existsSync(_0x246937))return _0x246937;const _0x389781=await readdir(_0x4cddb6,{'withFileTypes':!![]}),_0x15690a=_0x389781[_0x271cf2(0x37a)](_0x4027a0=>_0x4027a0[_0x271cf2(0x1f6)+_0x271cf2(0x226)]());if(_0x15690a[_0x271cf2(0x2d0)]===0x1)return join(_0x4cddb6,_0x15690a[0x0]['name']);const _0x281a65=process[_0x271cf2(0x26f)]==='win32'?join(_0x4cddb6,_0x271cf2(0x3c3)):join(_0x4cddb6,_0x271cf2(0x306),_0x271cf2(0x375));if(existsSync(_0x281a65))return _0x4cddb6;const _0x4806b4=await findNodeRuntimeRoot(_0x4cddb6);if(_0x4806b4)return _0x4806b4;const _0x467218=_0x389781['map'](_0x35d749=>_0x35d749['name'])[_0x271cf2(0x23f)](',\x20');throw new Error('Extracte'+_0x271cf2(0x217)+_0x271cf2(0x38e)+'oot\x20was\x20'+_0x271cf2(0x2ed)+_0x271cf2(0x2af)+_0x3bc0a6+_0x271cf2(0x431)+_0x4cddb6+(_0x271cf2(0x3fc)+_0x271cf2(0x442)+_0x271cf2(0x3c4))+(_0x467218||_0x271cf2(0x374)));}function resolveNodeExtractRoot(_0x239d51,_0x2f97be,_0x262b52){const _0x47ad26=_0x39af49;if(process[_0x47ad26(0x26f)]!==_0x47ad26(0x2b9))return join(_0x239d51,_0x2f97be+('-extract'+'-')+process[_0x47ad26(0x360)]+'-'+Date[_0x47ad26(0x3b5)]()+'-'+_0x262b52);const _0x3bfa61=/^[A-Za-z]:[\\/]/[_0x47ad26(0x38c)](_0x239d51),_0x184c35=parse(_0x239d51),_0x174b95=_0x3bfa61?_0x3bfa61[0x0][_0x47ad26(0x243)](0x0,0x2)+'\x5c':_0x184c35['root']&&_0x184c35['root']!=='/'?_0x184c35[_0x47ad26(0x2c5)]:_0x239d51,_0x2246cd=_0x174b95[_0x47ad26(0x2ff)](/[\\/]+$/,'');return _0x2246cd+_0x47ad26(0x30a)+process[_0x47ad26(0x360)]+'-'+Date[_0x47ad26(0x3b5)]()+'-'+_0x262b52;}async function findNodeRuntimeRoot(_0x1f4113){const _0x2489ec=_0x39af49,_0xd425b3=[_0x1f4113],_0xde8b09=new Set();while(_0xd425b3['length']>0x0){const _0x4ad70a=_0xd425b3[_0x2489ec(0x40e)]();if(!_0x4ad70a||_0xde8b09[_0x2489ec(0x399)](_0x4ad70a))continue;_0xde8b09[_0x2489ec(0x34a)](_0x4ad70a);const _0xb70948=process[_0x2489ec(0x26f)]==='win32'?join(_0x4ad70a,_0x2489ec(0x3c3)):join(_0x4ad70a,'bin',_0x2489ec(0x375)),_0x1348f0=process[_0x2489ec(0x26f)]===_0x2489ec(0x2b9)?join(_0x4ad70a,_0x2489ec(0x249)+_0x2489ec(0x2bf),_0x2489ec(0x351),_0x2489ec(0x306),'npm-cli.'+'js'):join(_0x4ad70a,'lib',_0x2489ec(0x249)+_0x2489ec(0x2bf),'npm',_0x2489ec(0x306),_0x2489ec(0x3dc)+'js');if(existsSync(_0xb70948)&&existsSync(_0x1348f0))return _0x4ad70a;const _0x3690dd=await readdir(_0x4ad70a,{'withFileTypes':!![]});for(const _0x215afb of _0x3690dd){_0x215afb[_0x2489ec(0x1f6)+_0x2489ec(0x226)]()&&_0xd425b3[_0x2489ec(0x222)](join(_0x4ad70a,_0x215afb['name']));}}return'';}async function downloadNodeRuntime(_0x3b34a6,_0x13d767){const _0x12b25d=_0x39af49,_0x4e44d3=process[_0x12b25d(0x26f)]===_0x12b25d(0x2b9)?_0x12b25d(0x2ce):process[_0x12b25d(0x26f)],_0x3773d5=process['arch']===_0x12b25d(0x3e8)?'x64':process['arch']==='arm64'?_0x12b25d(0x3ae):process[_0x12b25d(0x29d)],_0x439d6c=process[_0x12b25d(0x26f)]==='win32'?_0x12b25d(0x40c):_0x12b25d(0x2c7),_0x960875='node-v'+_0x3b34a6+'-'+_0x4e44d3+'-'+_0x3773d5,_0x4f372a=_0x960875+'.'+_0x439d6c,_0x29ce5c=join(dirname(_0x13d767),'.cache'),_0x50e7d5=join(_0x29ce5c,_0x4f372a),_0x16669b=_0x12b25d(0x41b)+_0x12b25d(0x3b6)+_0x12b25d(0x2d4)+'v'+_0x3b34a6+'/'+_0x4f372a;await mkdir(_0x29ce5c,{'recursive':!![]});const _0x23da37=resolveNodeExtractRoot(_0x29ce5c,_0x960875,0x1);!existsSync(_0x50e7d5)&&(console[_0x12b25d(0x37b)](_0x12b25d(0x2d1)+_0x12b25d(0x444)+'time]\x20do'+_0x12b25d(0x2f2)+'g\x20'+_0x16669b),await downloadFile(_0x16669b,_0x50e7d5));await rm(_0x23da37,{'recursive':!![],'force':!![]}),await mkdir(_0x23da37,{'recursive':!![]});process['platform']===_0x12b25d(0x2b9)?await extractZipArchive(_0x50e7d5,_0x23da37,_0x4f372a):await runProcess(_0x12b25d(0x456),['-xJf',_0x50e7d5,'-C',_0x23da37],{'label':'extract\x20'+_0x4f372a});const _0x463940=await resolveExtractedNodeRoot(_0x23da37,_0x960875);await mkdir(dirname(_0x13d767),{'recursive':!![]}),await rename(_0x463940,_0x13d767),_0x463940!==_0x23da37&&await rm(_0x23da37,{'recursive':!![],'force':!![]});}async function extractZipArchive(_0x440967,_0x5125f5,_0xf1bda){const _0x384aea=_0x39af49;await runProcess('powershe'+'ll.exe',[_0x384aea(0x41f)+'le','-Executi'+_0x384aea(0x36b),'Bypass',_0x384aea(0x261),_0x384aea(0x2b1)+_0x384aea(0x1fd)+_0x384aea(0x45b)+'ath\x20$env'+':WUJIE_S'+'HELL_ARC'+_0x384aea(0x42d)+_0x384aea(0x390)+_0x384aea(0x406)+_0x384aea(0x370)+_0x384aea(0x44f)+'XTRACT_R'+'OOT\x20-For'+'ce'],{'env':{...process.env,'WUJIE_SHELL_ARCHIVE':_0x440967,'WUJIE_SHELL_EXTRACT_ROOT':_0x5125f5},'label':_0x384aea(0x2eb)+_0xf1bda});}async function downloadFile(_0x3b5a2f,_0x3f78c1){await mkdir(dirname(_0x3f78c1),{'recursive':!![]});const _0x5dc954=await new Promise((_0x5b35d4,_0x2ed384)=>{const _0x58733e=_0x3b5b;get(_0x3b5a2f,_0x15ea09=>{const _0x38fdae=_0x3b5b;if(_0x15ea09[_0x38fdae(0x1d9)+'de']>=0x12c&&_0x15ea09[_0x38fdae(0x1d9)+'de']<0x190&&_0x15ea09[_0x38fdae(0x2d5)][_0x38fdae(0x1ea)]){_0x15ea09[_0x38fdae(0x1dc)](),downloadFile(new URL(_0x15ea09['headers']['location'],_0x3b5a2f)[_0x38fdae(0x26b)],_0x3f78c1)[_0x38fdae(0x2ee)](()=>_0x5b35d4(null))[_0x38fdae(0x394)](_0x2ed384);return;}if(_0x15ea09[_0x38fdae(0x1d9)+'de']!==0xc8){_0x15ea09[_0x38fdae(0x1dc)](),_0x2ed384(new Error(_0x38fdae(0x307)+_0x38fdae(0x320)+_0x15ea09[_0x38fdae(0x1d9)+'de']+':\x20'+_0x3b5a2f));return;}_0x5b35d4(_0x15ea09);})['on'](_0x58733e(0x36c),_0x2ed384);});_0x5dc954&&await pipeline(_0x5dc954,createWriteStream(_0x3f78c1));}export async function ensureOpenClawDoctorFixed(_0x21b06c,_0x96a9df={}){const _0x570c11=_0x39af49,_0x690e77=await loadRuntimeInfo(_0x21b06c['projectR'+'oot']),_0x300353=getConfigPaths(_0x21b06c),_0x387bda=join(_0x300353[_0x570c11(0x2c1)+_0x570c11(0x209)],_0x570c11(0x2bc)+_0x570c11(0x34d)+'json'),_0x398282=await readJson(_0x387bda,{});if(_0x398282[_0x570c11(0x2bc)+'Version']===_0x690e77['openclaw'+_0x570c11(0x448)])return _0x96a9df['runtimeL'+_0x570c11(0x2bb)]?.['info'](_0x570c11(0x2bc)+'\x20doctor\x20'+_0x570c11(0x2e4)+_0x570c11(0x238)+'ent',{'openclawVersion':_0x690e77[_0x570c11(0x2bc)+_0x570c11(0x448)],'markerPath':_0x387bda}),{'ran':![],'openclawVersion':_0x690e77['openclaw'+_0x570c11(0x448)],'markerPath':_0x387bda};return await runOpenClawDoctorFix(_0x21b06c,_0x690e77,{'fromVersion':_0x398282['openclaw'+_0x570c11(0x448)]||'unknown','toVersion':_0x690e77[_0x570c11(0x2bc)+'Version'],'markerPath':_0x387bda,'runtimeLogger':_0x96a9df[_0x570c11(0x44a)+'ogger']}),{'ran':!![],'openclawVersion':_0x690e77[_0x570c11(0x2bc)+_0x570c11(0x448)],'markerPath':_0x387bda};}async function runOpenClawDoctorFix(_0x26af73,_0x34cecb,{fromVersion:_0x56aa07,toVersion:_0xa6f884,markerPath:markerPath='',runtimeLogger:_0x670370}={}){const _0x46cf44=_0x39af49;_0x670370?.['importan'+'t']?.(_0x46cf44(0x2bc)+_0x46cf44(0x35a)+_0x46cf44(0x33c)+_0x46cf44(0x292),{'fromVersion':_0x56aa07,'toVersion':_0xa6f884});const _0x124136=await createRuntimeEnv(_0x34cecb,{'OPENCLAW_HOME':_0x26af73[_0x46cf44(0x305)],'OPENCLAW_STATE_DIR':_0x26af73[_0x46cf44(0x305)],'OPENCLAW_CONFIG_PATH':getConfigPaths(_0x26af73)[_0x46cf44(0x463)+'th']});console[_0x46cf44(0x37b)](_0x46cf44(0x2d1)+_0x46cf44(0x444)+'time]\x20ru'+'nning\x20op'+_0x46cf44(0x429)+_0x46cf44(0x2b3)+_0x46cf44(0x2f3));const _0x16d499=await runProcess(_0x34cecb[_0x46cf44(0x308)+'utable'],[_0x34cecb['openclaw'+_0x46cf44(0x36e)],_0x46cf44(0x2e3),'--fix'],{'cwd':_0x34cecb['openclaw'+_0x46cf44(0x3a1)+'ir'],'env':_0x124136,'label':'openclaw'+'\x20doctor\x20'+'--fix','timeoutMs':0x1d4c0});_0x670370?.[_0x46cf44(0x220)+'t']?.(_0x46cf44(0x2bc)+_0x46cf44(0x35a)+_0x46cf44(0x2e6)+'leted',{'fromVersion':_0x56aa07,'toVersion':_0xa6f884,'stdout':_0x16d499['stdout'][_0x46cf44(0x1f1)]()[_0x46cf44(0x243)](-0xfa0),'stderr':_0x16d499[_0x46cf44(0x359)][_0x46cf44(0x1f1)]()[_0x46cf44(0x243)](-0xfa0)}),markerPath&&(await writeJson(markerPath,{'openclawVersion':_0x34cecb[_0x46cf44(0x2bc)+_0x46cf44(0x448)],'fixedAt':new Date()[_0x46cf44(0x21a)+'ing']()}),_0x670370?.[_0x46cf44(0x220)+'t']?.(_0x46cf44(0x2bc)+_0x46cf44(0x35a)+_0x46cf44(0x48c)+_0x46cf44(0x365)+'en',{'markerPath':markerPath,'openclawVersion':_0x34cecb[_0x46cf44(0x2bc)+_0x46cf44(0x448)]}));}export async function readRuntimeManifest(_0x1670ed){return await readJson(resolveManifestPath(_0x1670ed),{});}export async function loadRuntimeInfo(_0x3186e1){const _0x315dc4=resolveRuntimeRoot(_0x3186e1),_0x2cdcd5=await readRuntimeManifest(_0x315dc4);return createRuntimeInfoFromManifest(_0x315dc4,_0x2cdcd5);}function createRuntimeInfoFromManifest(_0x3f7705,_0x5af29f,_0xa88f6b={}){const _0x133db2=_0x39af49;for(const _0x469693 of[_0x133db2(0x308)+'utable',_0x133db2(0x2c4),'openclaw'+_0x133db2(0x3a1)+'ir',_0x133db2(0x2bc)+_0x133db2(0x36e)]){if(typeof _0x5af29f[_0x469693]!=='string'||!_0x5af29f[_0x469693][_0x133db2(0x1f1)]())throw new Error(_0x133db2(0x45a)+_0x133db2(0x41a)+_0x133db2(0x27f)+'ing\x20\x22'+_0x469693+_0x133db2(0x2a6)+resolveManifestPath(_0x3f7705)+(_0x133db2(0x367)+_0x133db2(0x27b)+'l\x20prepar'+'e'));}const _0x42c16f=resolve(_0x3f7705,_0x5af29f['nodeExec'+_0x133db2(0x2d7)]),_0x5a078c=resolve(_0x3f7705,_0x5af29f['npmCli']),_0x58540d=resolve(_0x3f7705,_0x5af29f[_0x133db2(0x2bc)+'WorkingD'+'ir']),_0x313d4f=resolve(_0x3f7705,_0x5af29f['openclaw'+'Bin']),_0x38a29e=Array[_0x133db2(0x430)](_0x5af29f[_0x133db2(0x20d)])?_0x5af29f[_0x133db2(0x20d)][_0x133db2(0x342)](_0x2178a4=>({..._0x2178a4,'installPath':resolve(_0x3f7705,_0x2178a4['installP'+_0x133db2(0x213)])})):[],_0x445ae2=_0xa88f6b[_0x133db2(0x21e)+_0x133db2(0x24a)+_0x133db2(0x450)]?[_0x42c16f,_0x5a078c]:[_0x42c16f,_0x5a078c,_0x58540d,_0x313d4f];for(const _0x592ea7 of _0x445ae2){if(!existsSync(_0x592ea7))throw new Error(_0x133db2(0x45a)+_0x133db2(0x43d)+_0x133db2(0x3a9)+_0x592ea7);}return{'runtimeRoot':_0x3f7705,'manifest':_0x5af29f,'openclawVersion':_0x5af29f[_0x133db2(0x2bc)+_0x133db2(0x448)]||_0x133db2(0x2cb),'nodeExecutable':_0x42c16f,'npmCli':_0x5a078c,'openclawWorkingDir':_0x58540d,'openclawBin':_0x313d4f,'plugins':_0x38a29e};}export async function spawnClaw(_0x4852bc,_0xe121fd=[],_0x23e653={}){const _0x1d4db0=_0x39af49,_0x206109=await loadRuntimeInfo(_0x4852bc),_0x3063f2=await createRuntimeEnv(_0x206109,_0x23e653[_0x1d4db0(0x263)]??{});return spawn(_0x206109[_0x1d4db0(0x308)+_0x1d4db0(0x2d7)],[_0x206109['openclaw'+_0x1d4db0(0x36e)],..._0xe121fd],{'cwd':_0x206109['openclaw'+_0x1d4db0(0x3a1)+'ir'],'stdio':_0x1d4db0(0x20f),..._0x23e653,'env':_0x3063f2});}export async function runClawOnce(_0x1e37fc,_0x39581c=[],_0x5211a4=0x15f90){const _0x170f74=await spawnClaw(_0x1e37fc,_0x39581c);return await new Promise((_0xff6cff,_0x38157e)=>{const _0x44d6d1=_0x3b5b;let _0xc88f76='',_0x282170='',_0x1ea725=![];const _0x1a063b=setTimeout(()=>{const _0x4a6d10=_0x3b5b;if(_0x1ea725)return;_0x1ea725=!![],_0x170f74[_0x4a6d10(0x31f)](_0x4a6d10(0x1fb)),_0x38157e(new Error(_0x4a6d10(0x2bc)+_0x4a6d10(0x402)+_0x4a6d10(0x30d)+'\x20'+_0x5211a4+'ms'));},_0x5211a4);_0x170f74[_0x44d6d1(0x424)]['on'](_0x44d6d1(0x212),_0x2641b6=>{_0xc88f76+=_0x2641b6['toString']();}),_0x170f74[_0x44d6d1(0x359)]['on'](_0x44d6d1(0x212),_0x859cb1=>{const _0x163cf1=_0x44d6d1;_0x282170+=_0x859cb1[_0x163cf1(0x232)]();}),_0x170f74['on'](_0x44d6d1(0x36c),_0x5268e4=>{if(_0x1ea725)return;_0x1ea725=!![],clearTimeout(_0x1a063b),_0x38157e(_0x5268e4);}),_0x170f74['on'](_0x44d6d1(0x1ee),(_0x3a6930,_0x54076a)=>{if(_0x1ea725)return;_0x1ea725=!![],clearTimeout(_0x1a063b),_0xff6cff({'code':_0x3a6930,'signal':_0x54076a,'stdout':_0xc88f76,'stderr':_0x282170});});});}export{resolveRuntimeLarkCliCommand};function resolvePackageNameFromNpmSpec(_0x2c7ea4){const _0x46221f=_0x39af49,_0x36db33=_0x2c7ea4[_0x46221f(0x1f1)]()[_0x46221f(0x2ff)](/^npm:/,'');if(!_0x36db33)throw new Error(_0x46221f(0x21f)+_0x46221f(0x3e6)+_0x46221f(0x407)+'c');if(_0x36db33[_0x46221f(0x433)+'th']('@')){const _0x209a2e=_0x36db33['indexOf']('/');if(_0x209a2e===-0x1)throw new Error(_0x46221f(0x21f)+_0x46221f(0x275)+'pec:\x20'+_0x2c7ea4);const _0x17a1a7=_0x36db33['indexOf']('@',_0x209a2e+0x1);return _0x17a1a7===-0x1?_0x36db33:_0x36db33['slice'](0x0,_0x17a1a7);}const _0x3462ee=_0x36db33[_0x46221f(0x259)]('@');return _0x3462ee===-0x1?_0x36db33:_0x36db33[_0x46221f(0x243)](0x0,_0x3462ee);}async function createRuntimeEnv(_0x4d076d,_0x4f51ab={}){const _0x54fcd0=_0x39af49,_0x52852a={...process.env,..._0x4f51ab},_0x27edd0=_0x52852a[_0x54fcd0(0x489)+'_STATE_D'+'IR']||'',_0x21808d=_0x52852a[_0x54fcd0(0x33e)+_0x54fcd0(0x42a)+_0x54fcd0(0x1ed)]||_0x54fcd0(0x41b)+_0x54fcd0(0x2ea)+_0x54fcd0(0x385)+_0x54fcd0(0x41e),_0x326f09=_0x27edd0?join(_0x27edd0,_0x54fcd0(0x2f4)+_0x54fcd0(0x354)+'ls'):join(_0x4d076d['runtimeR'+_0x54fcd0(0x40a)],'.tools'),_0x3f3cb7=join(_0x326f09,_0x54fcd0(0x254)+'al'),_0x10b1ad=join(_0x326f09,'npm-cach'+'e'),_0x1ebac2=join(_0x3f3cb7,_0x54fcd0(0x306));await mkdir(_0x1ebac2,{'recursive':!![]}),await mkdir(_0x10b1ad,{'recursive':!![]});const _0x3f2422=[_0x1ebac2,dirname(_0x4d076d['nodeExec'+_0x54fcd0(0x2d7)]),_0x52852a[_0x54fcd0(0x391)]||''];return{..._0x52852a,'PATH':_0x3f2422[_0x54fcd0(0x37a)](Boolean)['join'](delimiter),'npm_config_prefix':_0x3f3cb7,'NPM_CONFIG_PREFIX':_0x3f3cb7,'npm_config_cache':_0x10b1ad,'NPM_CONFIG_CACHE':_0x10b1ad,'NPM_CONFIG_REGISTRY':_0x21808d,'npm_execpath':_0x4d076d[_0x54fcd0(0x2c4)],'npm_node_execpath':_0x4d076d[_0x54fcd0(0x308)+'utable'],'OPENCLAW_RUNTIME_NPM_PREFIX':_0x3f3cb7,'OPENCLAW_RUNTIME_NPM_BIN':_0x1ebac2};}export async function getRuntimeSpawnContext(_0x32cc6d,_0x40b612={}){const _0x501fdd=_0x39af49,_0x3d85fe=await loadRuntimeInfo(_0x32cc6d),_0xa107d0=await createRuntimeEnv(_0x3d85fe,_0x40b612);return{'cwd':_0x3d85fe[_0x501fdd(0x2bc)+_0x501fdd(0x3a1)+'ir'],'env':_0xa107d0,'runtime':_0x3d85fe};}function resolvePluginDirNameFromSpec(_0x8664c2){const _0x50f7f0=_0x39af49,_0x337399=resolvePackageNameFromNpmSpec(_0x8664c2),_0x4df1f5=_0x337399[_0x50f7f0(0x203)]('/')[_0x50f7f0(0x37a)](Boolean),_0x406c65=_0x4df1f5['at'](-0x1)??'';if(!_0x406c65)throw new Error('Invalid\x20'+_0x50f7f0(0x45c)+_0x50f7f0(0x1f5)+_0x8664c2);return _0x406c65;}async function resolvePluginIdFromPackageDir(_0x1ba4ca,_0x28146d){const _0x367771=_0x39af49,_0x362da0=await readJson(join(_0x1ba4ca,_0x367771(0x37c)+_0x367771(0x3a6)),{}),_0x5efcad=await readPluginManifest(_0x1ba4ca),_0x1452c7=[_0x5efcad?.['id'],_0x5efcad?.[_0x367771(0x253)],_0x5efcad?.[_0x367771(0x271)],_0x362da0?.[_0x367771(0x2bc)]?.['id'],_0x362da0?.['openclaw'+'Id'],_0x28146d],_0x25db91=_0x1452c7['find'](_0x3a6da0=>typeof _0x3a6da0===_0x367771(0x23c)&&_0x3a6da0[_0x367771(0x1f1)]());if(!_0x25db91)throw new Error(_0x367771(0x42b)+'o\x20resolv'+_0x367771(0x383)+'\x20id\x20from'+'\x20'+_0x1ba4ca);return _0x25db91[_0x367771(0x1f1)]();}function pluginSpecMatches(_0x26d531,_0xf8319){const _0x312903=_0x39af49,_0x21d6c7=_0xf8319[_0x312903(0x1f1)](),_0x1e3687=resolvePackageNameFromNpmSpec(_0x21d6c7);return[_0x26d531[_0x312903(0x478)],_0x26d531[_0x312903(0x27c)+'Spec'],_0x26d531['resolved'+_0x312903(0x2e1)]][_0x312903(0x2d6)](_0x37cf3b=>_0x37cf3b===_0x21d6c7||_0x37cf3b===_0x1e3687);}async function installPluginFromNpmSpec(_0x8a7eee,_0x5e6fcf,_0x56b401={}){const _0xb776eb=_0x39af49,_0x4c60f2=_0x8a7eee[_0xb776eb(0x1f1)]()[_0xb776eb(0x2ff)](/^npm:/,''),_0x68116d=resolvePluginDirNameFromSpec(_0x4c60f2),_0x2096d6=join(_0x5e6fcf[_0xb776eb(0x2bc)+_0xb776eb(0x3a1)+'ir'],_0xb776eb(0x3b8),_0xb776eb(0x410)+'ns'),_0x339fca=join(_0x2096d6,_0x68116d),_0x2f4ebc=join(_0x5e6fcf[_0xb776eb(0x2ba)+_0xb776eb(0x40a)],_0xb776eb(0x479)+_0xb776eb(0x234)+process[_0xb776eb(0x360)]+'-'+Date[_0xb776eb(0x3b5)]()),_0xfe6bff=await createRuntimeEnv(_0x5e6fcf),_0x468f43=new Date()[_0xb776eb(0x21a)+_0xb776eb(0x1f3)](),_0x5e7887=join(_0x5e6fcf[_0xb776eb(0x2ba)+_0xb776eb(0x40a)],_0xb776eb(0x363));await mkdir(_0x5e7887,{'recursive':!![]}),await rm(_0x2f4ebc,{'recursive':!![],'force':!![]}),await rm(_0x339fca,{'recursive':!![],'force':!![]}),await mkdir(_0x2f4ebc,{'recursive':!![]}),await mkdir(_0x2096d6,{'recursive':!![]}),console['log'](_0xb776eb(0x2d1)+_0xb776eb(0x444)+_0xb776eb(0x39c)+_0xb776eb(0x3e5)+_0xb776eb(0x25b)+_0x4c60f2);const _0x45fa4d=await runProcess(_0x5e6fcf[_0xb776eb(0x308)+_0xb776eb(0x2d7)],[_0x5e6fcf['npmCli'],_0xb776eb(0x420),_0x4c60f2,_0xb776eb(0x42e)],{'cwd':_0x5e7887,'env':_0xfe6bff,'label':'npm\x20pack'+'\x20'+_0x4c60f2}),_0x27dd61=parseNpmPackJson(_0x45fa4d[_0xb776eb(0x424)]),_0xbec9e6=normalizePackedTarballFilename(_0x27dd61[_0xb776eb(0x1e8)]),_0x37fe9e=join(_0x5e7887,_0xbec9e6);if(!existsSync(_0x37fe9e))throw new Error(_0xb776eb(0x2e7)+'\x20did\x20not'+_0xb776eb(0x345)+_0xb776eb(0x471)+'\x20'+_0x37fe9e);await runProcess(_0xb776eb(0x456),[_0xb776eb(0x3cc),_0x37fe9e,'-C',_0x2f4ebc],{'label':_0xb776eb(0x2eb)+_0xbec9e6}),await rename(join(_0x2f4ebc,_0xb776eb(0x258)),_0x339fca),await rm(_0x2f4ebc,{'recursive':!![],'force':!![]});const _0xd215e8=join(_0x339fca,_0xb776eb(0x37c)+_0xb776eb(0x3a6)),_0xe3044=await readJson(_0xd215e8,{});(_0xe3044[_0xb776eb(0x31d)+'dencies']||_0xe3044[_0xb776eb(0x451)])&&(delete _0xe3044[_0xb776eb(0x31d)+_0xb776eb(0x1fa)],delete _0xe3044[_0xb776eb(0x451)],await writeJson(_0xd215e8,_0xe3044));await runProcess(_0x5e6fcf[_0xb776eb(0x308)+_0xb776eb(0x2d7)],[_0x5e6fcf['npmCli'],_0xb776eb(0x330),_0xb776eb(0x38b)+'ev',_0xb776eb(0x42f)+_0xb776eb(0x3fe),'--no-aud'+'it',_0xb776eb(0x24b)+'d','--legacy'+_0xb776eb(0x404)+'ps'],{'cwd':_0x339fca,'env':_0xfe6bff,'label':_0xb776eb(0x20a)+_0xb776eb(0x362)+_0xb776eb(0x397)+_0x4c60f2});const _0x17e5f3=new Date()['toISOStr'+_0xb776eb(0x1f3)](),_0x30dd4f=await resolvePluginIdFromPackageDir(_0x339fca,_0x27dd61[_0xb776eb(0x271)]);return _0x56b401[_0xb776eb(0x44a)+_0xb776eb(0x2bb)]?.[_0xb776eb(0x434)]('npm\x20plug'+_0xb776eb(0x266)+'lled',{'spec':_0x4c60f2,'pluginId':_0x30dd4f,'installPath':_0x339fca}),{'pluginId':_0x30dd4f,'source':_0xb776eb(0x351),'spec':_0x4c60f2,'installPath':toRuntimeRelative(_0x5e6fcf['runtimeR'+_0xb776eb(0x40a)],_0x339fca),'version':_0x27dd61['version'],'resolvedName':_0x27dd61['name'],'resolvedVersion':_0x27dd61[_0xb776eb(0x344)],'resolvedSpec':_0x27dd61[_0xb776eb(0x271)]+'@'+_0x27dd61['version'],'integrity':typeof _0x27dd61[_0xb776eb(0x377)+'y']==='string'?_0x27dd61[_0xb776eb(0x377)+'y']:'','shasum':typeof _0x27dd61[_0xb776eb(0x488)]===_0xb776eb(0x23c)?_0x27dd61['shasum']:'','resolvedAt':_0x468f43,'installedAt':_0x17e5f3};}async function syncConfiguredNpmPlugins(_0x2f3fe5,_0x4a801d,_0xe3ab9e,_0x22cd90={}){const _0x3ed0d2=_0x39af49;if(_0x22cd90[_0x3ed0d2(0x3e4)])return;const _0xab76bc=createRuntimeInfoFromManifest(_0x4a801d,_0xe3ab9e),_0x2ab7c8=Array[_0x3ed0d2(0x430)](_0xe3ab9e[_0x3ed0d2(0x20d)])?_0xe3ab9e[_0x3ed0d2(0x20d)]:[],_0x1c1df7=[];for(const _0x3b1aa2 of _0x2f3fe5[_0x3ed0d2(0x2bc)]['pluginSp'+_0x3ed0d2(0x42c)]){const _0x3cb4a2=_0x2ab7c8[_0x3ed0d2(0x1f7)](_0x530e71=>_0x530e71?.[_0x3ed0d2(0x369)]==='npm'&&pluginSpecMatches(_0x530e71,_0x3b1aa2)&&typeof _0x530e71[_0x3ed0d2(0x1e5)+_0x3ed0d2(0x213)]===_0x3ed0d2(0x23c)&&existsSync(resolve(_0x4a801d,_0x530e71[_0x3ed0d2(0x1e5)+_0x3ed0d2(0x213)])));if(_0x3cb4a2){_0x1c1df7['push'](_0x3cb4a2);continue;}_0x1c1df7[_0x3ed0d2(0x222)](await installPluginFromNpmSpec(_0x3b1aa2,_0xab76bc,_0x22cd90));}const _0xb1b8cb=new Set(_0x2f3fe5[_0x3ed0d2(0x2bc)][_0x3ed0d2(0x2f9)+_0x3ed0d2(0x42c)][_0x3ed0d2(0x342)](resolvePackageNameFromNpmSpec)),_0x416d78=_0x2ab7c8[_0x3ed0d2(0x37a)](_0x4c6633=>_0x4c6633?.[_0x3ed0d2(0x369)]!==_0x3ed0d2(0x351)||!_0xb1b8cb[_0x3ed0d2(0x399)](resolvePackageNameFromNpmSpec(_0x4c6633[_0x3ed0d2(0x27c)+_0x3ed0d2(0x2e1)]||_0x4c6633[_0x3ed0d2(0x478)]||'')));_0xe3ab9e[_0x3ed0d2(0x20d)]=[..._0x416d78,..._0x1c1df7];}function hasRuntimeDependencies(_0x144587){const _0x54f632=_0x39af49,_0x418d98=_0x144587?.[_0x54f632(0x274)+_0x54f632(0x401)]&&typeof _0x144587[_0x54f632(0x274)+'cies']==='object'?Object['keys'](_0x144587[_0x54f632(0x274)+'cies']):[],_0xe34063=_0x144587?.[_0x54f632(0x2dc)+_0x54f632(0x333)+_0x54f632(0x401)]&&typeof _0x144587[_0x54f632(0x2dc)+_0x54f632(0x333)+_0x54f632(0x401)]===_0x54f632(0x1e0)?Object[_0x54f632(0x3ed)](_0x144587['optional'+_0x54f632(0x333)+_0x54f632(0x401)]):[];return _0x418d98[_0x54f632(0x2d0)]>0x0||_0xe34063['length']>0x0;}async function installLocalPluginRuntimeDependencies(_0x173142,_0x3b8385,_0x255d92){const _0x121637=_0x39af49,_0x44f025=join(_0x173142,_0x121637(0x37c)+_0x121637(0x3a6)),_0x1330c6=await readJson(_0x44f025,{});(_0x1330c6['devDepen'+_0x121637(0x1fa)]||_0x1330c6['scripts'])&&(delete _0x1330c6[_0x121637(0x31d)+_0x121637(0x1fa)],delete _0x1330c6[_0x121637(0x451)],await writeJson(_0x44f025,_0x1330c6));if(!hasRuntimeDependencies(_0x1330c6))return;const _0x4b9968=await createRuntimeEnv(_0x3b8385);console['log']('[wujie-s'+_0x121637(0x444)+_0x121637(0x3d2)+_0x121637(0x251)+_0x121637(0x343)+_0x121637(0x45e)+_0x121637(0x3bb)+'es\x20'+_0x173142),await runProcess(_0x3b8385[_0x121637(0x308)+_0x121637(0x2d7)],[_0x3b8385[_0x121637(0x2c4)],_0x121637(0x330),_0x121637(0x38b)+'ev',_0x121637(0x42f)+_0x121637(0x3fe),_0x121637(0x201)+'it',_0x121637(0x24b)+'d','--legacy'+_0x121637(0x404)+'ps'],{'cwd':_0x173142,'env':_0x4b9968,'label':_0x121637(0x20a)+_0x121637(0x1d7)+'l\x20plugin'+'\x20'+_0x173142}),_0x255d92[_0x121637(0x44a)+'ogger']?.[_0x121637(0x434)](_0x121637(0x22b)+'ugin\x20dep'+'endencie'+'s\x20instal'+'led',{'installPath':_0x173142});}async function syncSharedPluginModules(_0x225b99,_0x4f44e5){const _0x21f6a7=_0x39af49,_0x5a024c=new Set();for(const _0x2d4a49 of _0x225b99){const _0x270793=join(dirname(_0x2d4a49),_0x21f6a7(0x341));if(existsSync(_0x270793))_0x5a024c[_0x21f6a7(0x34a)](_0x270793);}for(const _0x278d39 of _0x5a024c){await copyDirFresh(_0x278d39,join(_0x4f44e5,_0x21f6a7(0x341)));}}async function syncProductPlugins(_0x2be7fc,_0x37a9bb,_0x2340f1,_0x29d27f={}){const _0x353f74=_0x39af49,_0x2e248d=join(_0x37a9bb,'openclaw','dist',_0x353f74(0x410)+'ns'),_0x264b9e=createRuntimeInfoFromManifest(_0x37a9bb,_0x2340f1),_0x17821d=[];await syncSharedPluginModules(_0x2be7fc[_0x353f74(0x2bc)][_0x353f74(0x27c)+_0x353f74(0x327)+'ginPaths'],_0x2e248d);for(const _0xfabbe9 of _0x2be7fc[_0x353f74(0x2bc)]['resolved'+_0x353f74(0x327)+_0x353f74(0x313)]){const _0x450c8c=await getPackageMetadata(_0xfabbe9),_0x1db5e3=await readPluginManifest(_0xfabbe9),_0x123eb8=join(_0x2e248d,_0x450c8c[_0x353f74(0x253)]);await copyDirFresh(_0xfabbe9,_0x123eb8),await installLocalPluginRuntimeDependencies(_0x123eb8,_0x264b9e,_0x29d27f),_0x17821d[_0x353f74(0x222)]({'pluginId':_0x450c8c[_0x353f74(0x253)],'source':_0x353f74(0x1f9),'spec':_0x353f74(0x267)+_0xfabbe9,'installPath':toRuntimeRelative(_0x37a9bb,_0x123eb8),'version':_0x450c8c[_0x353f74(0x344)],'resolvedName':_0x450c8c['name'],'resolvedVersion':_0x450c8c['version'],'resolvedSpec':'local:'+_0xfabbe9,'integrity':'','shasum':'','resolvedAt':new Date()[_0x353f74(0x21a)+_0x353f74(0x1f3)](),'installedAt':new Date()[_0x353f74(0x21a)+_0x353f74(0x1f3)](),'agentScope':_0x1db5e3[_0x353f74(0x3db)+'pe'],'skills':_0x1db5e3[_0x353f74(0x219)]});}const _0x4a31c0=new Set(_0x17821d[_0x353f74(0x342)](_0x96de83=>_0x96de83[_0x353f74(0x253)])),_0x20379d=Array[_0x353f74(0x430)](_0x2340f1[_0x353f74(0x20d)])?_0x2340f1[_0x353f74(0x20d)][_0x353f74(0x37a)](_0x2f683b=>!_0x4a31c0[_0x353f74(0x399)](_0x2f683b[_0x353f74(0x253)])):[];_0x2340f1[_0x353f74(0x20d)]=[..._0x20379d,..._0x17821d];}async function syncManifestPluginScope(_0x8bdbdc,_0x5d0e30,_0x49af2a){const _0x43adcc=_0x39af49,_0x20ee84=join(_0x5d0e30,_0x43adcc(0x2bc),_0x43adcc(0x3b8),_0x43adcc(0x410)+'ns'),_0x3ca393=new Set(_0x8bdbdc[_0x43adcc(0x2bc)][_0x43adcc(0x2f9)+'ecs']??[]),_0x5953d8=new Set([..._0x3ca393][_0x43adcc(0x342)](_0x3037ef=>_0x3037ef[_0x43adcc(0x2ff)](/^npm:/,''))[_0x43adcc(0x342)](_0x1e6c7b=>{const _0x12f1e9=_0x43adcc;if(_0x1e6c7b[_0x12f1e9(0x433)+'th']('@')){const _0x417cfd=_0x1e6c7b[_0x12f1e9(0x203)]('@');return _0x417cfd['length']>=0x3?'@'+_0x417cfd[0x1]:_0x1e6c7b;}return _0x1e6c7b[_0x12f1e9(0x203)]('@')[0x0];})[_0x43adcc(0x37a)](Boolean)),_0x4a8940=new Set();for(const _0xa2a753 of _0x8bdbdc['openclaw']['resolved'+_0x43adcc(0x327)+_0x43adcc(0x313)]){const _0x4ab82c=await getPackageMetadata(_0xa2a753);if(_0x4ab82c[_0x43adcc(0x253)])_0x4a8940['add'](_0x4ab82c[_0x43adcc(0x253)]);}const _0x1b29b0=Array['isArray'](_0x49af2a[_0x43adcc(0x20d)])?_0x49af2a[_0x43adcc(0x20d)]:[];_0x49af2a[_0x43adcc(0x2f9)+'ecs']=[..._0x8bdbdc[_0x43adcc(0x2bc)][_0x43adcc(0x2f9)+_0x43adcc(0x42c)],..._0x8bdbdc['openclaw']['resolved'+'LocalPlu'+_0x43adcc(0x313)]['map'](_0x573d43=>_0x43adcc(0x267)+_0x573d43)],_0x49af2a[_0x43adcc(0x20d)]=_0x1b29b0[_0x43adcc(0x37a)](_0x27144c=>{const _0x3e3a75=_0x43adcc;if(!_0x27144c||typeof _0x27144c!==_0x3e3a75(0x1e0))return![];if(_0x27144c[_0x3e3a75(0x369)]===_0x3e3a75(0x1f9))return _0x4a8940[_0x3e3a75(0x399)](_0x27144c[_0x3e3a75(0x253)]);if(_0x27144c[_0x3e3a75(0x369)]===_0x3e3a75(0x351))return _0x3ca393[_0x3e3a75(0x399)](_0x27144c[_0x3e3a75(0x478)])||_0x3ca393['has'](_0x27144c[_0x3e3a75(0x27c)+_0x3e3a75(0x2c2)])||_0x5953d8[_0x3e3a75(0x399)](_0x27144c[_0x3e3a75(0x27c)+'Name']);return![];});const _0x21a720=new Set(_0x49af2a[_0x43adcc(0x20d)]['map'](_0x5d6f9a=>_0x5d6f9a[_0x43adcc(0x253)]));for(const _0x26580e of _0x1b29b0){if(!_0x26580e[_0x43adcc(0x253)]||_0x21a720['has'](_0x26580e[_0x43adcc(0x253)]))continue;const _0x40aa48=typeof _0x26580e[_0x43adcc(0x1e5)+'ath']===_0x43adcc(0x23c)&&_0x26580e[_0x43adcc(0x1e5)+_0x43adcc(0x213)]['trim']()?resolve(_0x5d0e30,_0x26580e[_0x43adcc(0x1e5)+_0x43adcc(0x213)]):join(_0x20ee84,_0x26580e['pluginId']),_0x39985a=relative(_0x20ee84,_0x40aa48);if(_0x39985a[_0x43adcc(0x433)+'th']('..')||_0x39985a==='')continue;await rm(_0x40aa48,{'recursive':!![],'force':!![]});}}async function collectCapabilityEntries(_0x35374e,_0x4cf119){const _0x3da9a6=_0x39af49,_0x4b147b=new Map();for(const _0x201a39 of _0x35374e){let _0xf4e689;try{_0xf4e689=await stat(_0x201a39);}catch{throw new Error(_0x4cf119+(_0x3da9a6(0x229)+_0x3da9a6(0x1da)+'und:\x20')+_0x201a39);}if(!_0xf4e689[_0x3da9a6(0x1f6)+'ory']())throw new Error(_0x4cf119+(_0x3da9a6(0x272)+_0x3da9a6(0x314)+'director'+_0x3da9a6(0x3b0))+_0x201a39);const _0x24bd7c={'name':basename(_0x201a39),'path':_0x201a39},_0x52d6d5=_0x4b147b['get'](_0x24bd7c[_0x3da9a6(0x271)]);if(_0x52d6d5)throw new Error(_0x3da9a6(0x205)+'e\x20'+_0x4cf119+_0x3da9a6(0x32b)+_0x24bd7c['name']+_0x3da9a6(0x1e2)+_0x52d6d5[_0x3da9a6(0x22f)]+_0x3da9a6(0x2a2)+_0x24bd7c[_0x3da9a6(0x22f)]);_0x4b147b['set'](_0x24bd7c['name'],_0x24bd7c);}return[..._0x4b147b[_0x3da9a6(0x31e)]()];}async function syncProductCapabilityDirs(_0x5d885d,_0x793da5,_0x532fff){const _0x27e39b=_0x39af49,_0x5c9bfd=await collectCapabilityEntries(_0x5d885d,_0x532fff);await rm(_0x793da5,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await mkdir(_0x793da5,{'recursive':!![]});for(const _0x1b8209 of _0x5c9bfd){await cp(_0x1b8209['path'],join(_0x793da5,_0x1b8209[_0x27e39b(0x271)]),{'recursive':!![]});}return _0x5c9bfd[_0x27e39b(0x2d0)];}export const __test__={'collectCapabilityEntries':collectCapabilityEntries,'prunePackagedRuntimePayload':prunePackagedRuntimePayload,'syncProductCapabilityDirs':syncProductCapabilityDirs,'resolveNodeExtractRoot':resolveNodeExtractRoot};async function syncProductAgents(_0x4a9a49,_0x532b6a,_0x2d1663){const _0x5ce184=_0x39af49,_0x3ff97e=join(_0x532b6a,_0x5ce184(0x2bc),_0x5ce184(0x310)),_0x2bbcf4=await syncProductCapabilityDirs(_0x4a9a49[_0x5ce184(0x2bc)]['resolved'+'LocalAge'+_0x5ce184(0x45d)],_0x3ff97e,_0x5ce184(0x296));_0x2d1663[_0x5ce184(0x310)]={'source':_0x5ce184(0x47a),'installPath':toRuntimeRelative(_0x532b6a,_0x3ff97e),'localPaths':_0x4a9a49[_0x5ce184(0x2bc)]['resolved'+_0x5ce184(0x32f)+_0x5ce184(0x45d)],'entryCount':_0x2bbcf4};}async function syncProductSkills(_0x4da826,_0x3eb85e,_0x5092da){const _0x318a7f=_0x39af49,_0x4f81ed=join(_0x3eb85e,_0x318a7f(0x2bc),_0x318a7f(0x219)),_0x1e39c6=await syncProductCapabilityDirs(_0x4da826[_0x318a7f(0x2bc)][_0x318a7f(0x27c)+'LocalSki'+'llPaths'],_0x4f81ed,_0x318a7f(0x2cc));_0x5092da['skills']={'source':'product','installPath':toRuntimeRelative(_0x3eb85e,_0x4f81ed),'localPaths':_0x4da826[_0x318a7f(0x2bc)][_0x318a7f(0x27c)+'LocalSki'+_0x318a7f(0x2f5)],'entryCount':_0x1e39c6};}
@@ -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(_0x2809a1,_0xce519c){const _0x457937=_0x172f,_0x88c7f0=_0x2809a1();while(!![]){try{const _0x55a99f=parseInt(_0x457937(0x242))/0x1+parseInt(_0x457937(0x208))/0x2+parseInt(_0x457937(0x1ef))/0x3*(-parseInt(_0x457937(0x230))/0x4)+parseInt(_0x457937(0x214))/0x5+-parseInt(_0x457937(0x243))/0x6+-parseInt(_0x457937(0x215))/0x7*(-parseInt(_0x457937(0x1f1))/0x8)+parseInt(_0x457937(0x1fc))/0x9*(-parseInt(_0x457937(0x1f5))/0xa);if(_0x55a99f===_0xce519c)break;else _0x88c7f0['push'](_0x88c7f0['shift']());}catch(_0x34cc35){_0x88c7f0['push'](_0x88c7f0['shift']());}}}(_0xa7a2,0xdfa94));export function patchChannelPluginRuntimeFromSource(_0x3aeb8c,_0x54e0cd={}){const _0x409c5f=_0x172f,_0x113d00=_0x54e0cd[_0x409c5f(0x22e)+'hannelIm'+_0x409c5f(0x254)];if(!_0x113d00)return{'patched':![],'reason':_0x409c5f(0x263)+_0x409c5f(0x252)+_0x409c5f(0x229)+_0x409c5f(0x261)+'ded'};if(_0x3aeb8c[_0x409c5f(0x21f)](_0x409c5f(0x26b)+_0x409c5f(0x1fd)+_0x409c5f(0x23c)+'l')){if(_0x3aeb8c[_0x409c5f(0x21f)]('turn:\x20ex'+_0x409c5f(0x24c)+_0x409c5f(0x271)+_0x409c5f(0x1f8))&&hasRuntimeChannelImport(_0x3aeb8c,_0x113d00))return{'patched':![],'reason':_0x409c5f(0x22f)+_0x409c5f(0x27c)};return patchExistingChannelPluginRuntimeFromSource(_0x3aeb8c,{'runtimeChannelImportPath':_0x113d00});}if(_0x3aeb8c['includes'](_0x409c5f(0x245)+'nnelRunt'+_0x409c5f(0x269)+'se'))return patchExistingChannelPluginRuntimeFromSource(_0x3aeb8c,{'runtimeChannelImportPath':_0x113d00});const _0x4c86fa=_0x409c5f(0x274)+_0x409c5f(0x26f)+_0x409c5f(0x283)+_0x409c5f(0x262)+'const\x20re'+'solveRun'+'time\x20=\x20('+_0x409c5f(0x267)+_0x409c5f(0x20c)+_0x409c5f(0x26e)+'e\x20??=\x20re'+_0x409c5f(0x22d)+_0x409c5f(0x24e)+_0x409c5f(0x23a)+_0x409c5f(0x246)+_0x409c5f(0x24f)+_0x409c5f(0x284)+'s);\x0a\x09\x09\x09r'+_0x409c5f(0x280)+'solvedRu'+'ntime;\x0a\x09'+_0x409c5f(0x253);if(!_0x3aeb8c[_0x409c5f(0x21f)](_0x4c86fa))return{'patched':![],'reason':'not-foun'+'d'};const _0x1858d3=_0x409c5f(0x23e)+_0x409c5f(0x258)+_0x409c5f(0x206)+_0x409c5f(0x218)+_0x409c5f(0x281)+';';if(!_0x3aeb8c[_0x409c5f(0x21f)](_0x1858d3))return{'patched':![],'reason':'import-n'+'ot-found'};const _0x339e42=_0x409c5f(0x274)+_0x409c5f(0x26f)+_0x409c5f(0x283)+_0x409c5f(0x262)+_0x409c5f(0x232)+_0x409c5f(0x223)+_0x409c5f(0x270)+_0x409c5f(0x260)+_0x409c5f(0x289)+_0x409c5f(0x259)+'e)\x20=>\x20{\x0a'+_0x409c5f(0x1f9)+'runtime\x20'+'||\x20typeo'+_0x409c5f(0x225)+_0x409c5f(0x27d)+_0x409c5f(0x23f)+_0x409c5f(0x231)+_0x409c5f(0x27e)+_0x409c5f(0x23d)+_0x409c5f(0x241)+'hannel?.'+_0x409c5f(0x201)+_0x409c5f(0x25b)+_0x409c5f(0x240)+_0x409c5f(0x285)+'bound?.r'+_0x409c5f(0x244)+_0x409c5f(0x207)+_0x409c5f(0x1ee)+_0x409c5f(0x236)+_0x409c5f(0x26d)+'ime\x20=\x20wu'+_0x409c5f(0x24d)+_0x409c5f(0x227)+_0x409c5f(0x1fa)+');\x0a\x09\x09\x09co'+_0x409c5f(0x22c)+_0x409c5f(0x205)+_0x409c5f(0x249)+_0x409c5f(0x273)+_0x409c5f(0x21e)+'\x20typeof\x20'+_0x409c5f(0x250)+_0x409c5f(0x266)+_0x409c5f(0x1ed)+_0x409c5f(0x257)+'untime.c'+_0x409c5f(0x286)+'\x20{};\x0a\x09\x09\x09'+'runtime.'+_0x409c5f(0x266)+_0x409c5f(0x210)+_0x409c5f(0x226)+_0x409c5f(0x251)+_0x409c5f(0x21b)+_0x409c5f(0x28e)+_0x409c5f(0x228)+_0x409c5f(0x278)+_0x409c5f(0x222)+_0x409c5f(0x20e)+_0x409c5f(0x277)+_0x409c5f(0x213)+_0x409c5f(0x22e)+_0x409c5f(0x224)+_0x409c5f(0x23b)+'elRuntim'+_0x409c5f(0x1ff)+_0x409c5f(0x1f3)+_0x409c5f(0x1fb)+'nbound:\x20'+_0x409c5f(0x277)+_0x409c5f(0x213)+_0x409c5f(0x25d)+'??\x20chann'+'elRuntim'+_0x409c5f(0x28d)+_0x409c5f(0x203)+_0x409c5f(0x25e)+'stingCha'+_0x409c5f(0x211)+_0x409c5f(0x200)+_0x409c5f(0x1eb)+_0x409c5f(0x282)+'ound\x20??\x20'+'channelR'+_0x409c5f(0x212)+_0x409c5f(0x21a)+_0x409c5f(0x219)+'ntime.in'+'bound,\x0a\x09'+'\x09\x09\x09reply'+_0x409c5f(0x26a)+_0x409c5f(0x228)+_0x409c5f(0x20f)+_0x409c5f(0x23b)+_0x409c5f(0x251)+_0x409c5f(0x265)+_0x409c5f(0x209)+_0x409c5f(0x276)+_0x409c5f(0x24c)+'annel.se'+_0x409c5f(0x264)+_0x409c5f(0x221)+_0x409c5f(0x268)+'session\x0a'+_0x409c5f(0x275)+_0x409c5f(0x233)+_0x409c5f(0x22a)+_0x409c5f(0x20a)+_0x409c5f(0x24a)+'solveRun'+_0x409c5f(0x28c)+_0x409c5f(0x267)+_0x409c5f(0x20c)+_0x409c5f(0x26e)+_0x409c5f(0x220)+_0x409c5f(0x223)+_0x409c5f(0x270)+_0x409c5f(0x260)+_0x409c5f(0x256)+_0x409c5f(0x287)+'eatePlug'+_0x409c5f(0x27b)+_0x409c5f(0x25f)+(_0x409c5f(0x1f6)+'imeOptio'+'ns));\x0a\x09\x09'+_0x409c5f(0x233)+_0x409c5f(0x238)+_0x409c5f(0x248)+'\x0a\x09\x09};');return{'patched':!![],'source':_0x3aeb8c['replace'](_0x1858d3,_0x1858d3+'\x0a'+createRuntimeChannelImport(_0x113d00))[_0x409c5f(0x1e8)](_0x4c86fa,_0x339e42)};}function _0xa7a2(){const _0x292809=['s,\x0a\x09\x09\x09\x09i','12560904fCaIuv','ateRunti','\x20typeof\x20','e.runtim','n\x20??\x20exi','turn?.ru','eateRunt','d,\x0a\x09\x09\x09\x09t','ound\x20??\x20','tingChan','ash\x20}\x20fr','rn\x20runti','746258AGqCEw','\x0a\x09\x09\x09\x09ses','\x0a\x09\x09};\x0a\x09\x09','annel\x20as','\x09\x09resolv','ctionKey','ntexts:\x20','l.reply\x20','=\x20{\x0a\x09\x09\x09\x09','nnel.tur','untime.t','Channel.','7143340tKTwul','395633HCXnLc','CTION_KE','untimeCh','om\x20\x22node','hannelRu','urn\x20??\x20c','e,\x0a\x09\x09\x09\x09.','YS);','annel.se','annel\x20&&','includes','e\x20??=\x20en','\x20channel','untimeCo','sureWuji','ontexts\x20','f\x20runtim','...chann','eRuntime','ngChanne','import-n','runtime;','m\x20\x22','nst\x20exis','solveCre','runtimeC','already-','694888tnAMUn','return\x20r','const\x20en','\x09return\x20','imeChann','||\x20typeo','onst\x20cha','bound?.r','resolved','nbound:\x20','nRuntime','??\x20chann','meChanne','\x09\x09\x09if\x20(r','import\x20{','bject\x22)\x20','time.cha','untime.c','1741655PtDZhm','6951006PzhtGK','un)\x20retu','wujieCha','()(optio','Set\x20=\x20ne','Runtime;','nel\x20=\x20ru','const\x20re','\x20{};\x0a\x09\x09\x09','istingCh','jieCreat','atePlugi','ns.runti','runtime.','elRuntim','channel-','\x09};','portPath','\x09\x09const\x20','elpers(r','ect\x22\x20?\x20r','\x20createH','\x20(runtim','ZY_RUNTI','n\x20&&\x20run','hannel?.','inbound\x20','urn:\x20exi','e()(opti','RuntimeH','ot-provi','null;\x0a\x09\x09','runtime-','ssion\x20??','e.reply,','channel\x20',')\x20=>\x20{\x0a\x09','Runtime.','imePromi',':\x20existi','wujieCre','lazyRunt','nnelRunt','edRuntim','solvedRu','eChannel','annel.tu','ntime.in','ntime.ch','\x09\x09let\x20re','\x09\x09\x09};\x0a\x09\x09','sion:\x20ex','existing','l,\x0a\x09\x09\x09\x09r','el\x20}\x20fro','null;','inRuntim','patched','e\x20!==\x20\x22o','untime;\x0a','runtime\x20','eturn\x20re',':crypto\x22','nnel.inb','ntime\x20=\x20','meOption','nnel?.in','hannel\x20:','esolveCr',');\x0a\x09\x09\x09co','elpers\x20=','\x0a\x09\x09};\x0a','channelR','time\x20=\x20(','e.inboun','..existi','replace','indexOf','e)\x20=>\x20{\x0a','stingCha','\x09\x09\x09reply','===\x20\x22obj','me;\x0a\x09\x09\x09c','12jqwHuJ','ns));\x0a\x09\x09','88JNwdaK','not-foun','eContext','\x20createR','10wzURue','ons.runt','ot-found','rn\x20??','\x09\x09\x09if\x20(!','Channel('];_0xa7a2=function(){return _0x292809;};return _0xa7a2();}function patchExistingChannelPluginRuntimeFromSource(_0x2040d6,_0x485e27){const _0x11421f=_0x172f,{runtimeChannelImportPath:_0x1aec24}=_0x485e27,_0x3ad912=_0x11421f(0x23e)+_0x11421f(0x258)+_0x11421f(0x206)+_0x11421f(0x218)+_0x11421f(0x281)+';';if(!_0x2040d6[_0x11421f(0x21f)](_0x3ad912))return{'patched':![],'reason':_0x11421f(0x229)+_0x11421f(0x1f7)};const _0x33966a=_0x11421f(0x274)+'solvedRu'+_0x11421f(0x283)+_0x11421f(0x27a),_0x39232c=_0x11421f(0x255)+_0x11421f(0x26c)+'imeRefle'+_0x11421f(0x20d)+_0x11421f(0x247)+'w\x20Set(LA'+_0x11421f(0x25a)+'ME_REFLE'+_0x11421f(0x216)+_0x11421f(0x21c),_0x45ef32=_0x2040d6['indexOf'](_0x33966a),_0x23f67d=_0x2040d6[_0x11421f(0x1e9)](_0x39232c,_0x45ef32);if(_0x45ef32===-0x1||_0x23f67d===-0x1)return{'patched':![],'reason':_0x11421f(0x1f2)+'d'};const _0x108434='\x09\x09let\x20re'+_0x11421f(0x26f)+_0x11421f(0x283)+_0x11421f(0x262)+_0x11421f(0x232)+_0x11421f(0x223)+'eChannel'+_0x11421f(0x260)+_0x11421f(0x289)+_0x11421f(0x259)+_0x11421f(0x1ea)+'\x09\x09\x09if\x20(!'+_0x11421f(0x27f)+_0x11421f(0x235)+_0x11421f(0x225)+'e\x20!==\x20\x22o'+_0x11421f(0x23f)+'return\x20r'+_0x11421f(0x27e)+_0x11421f(0x23d)+_0x11421f(0x241)+_0x11421f(0x25c)+_0x11421f(0x201)+'n\x20&&\x20run'+_0x11421f(0x240)+_0x11421f(0x285)+_0x11421f(0x237)+'un)\x20retu'+_0x11421f(0x207)+_0x11421f(0x1ee)+'onst\x20cha'+_0x11421f(0x26d)+'ime\x20=\x20wu'+_0x11421f(0x24d)+_0x11421f(0x227)+_0x11421f(0x1fa)+_0x11421f(0x288)+'nst\x20exis'+_0x11421f(0x205)+_0x11421f(0x249)+_0x11421f(0x273)+_0x11421f(0x21e)+_0x11421f(0x1fe)+_0x11421f(0x250)+_0x11421f(0x266)+_0x11421f(0x1ed)+_0x11421f(0x257)+'untime.c'+_0x11421f(0x286)+_0x11421f(0x24b)+_0x11421f(0x250)+_0x11421f(0x266)+_0x11421f(0x210)+'...chann'+_0x11421f(0x251)+'e,\x0a\x09\x09\x09\x09.'+_0x11421f(0x28e)+_0x11421f(0x228)+'l,\x0a\x09\x09\x09\x09r'+_0x11421f(0x222)+_0x11421f(0x20e)+_0x11421f(0x277)+'Channel.'+_0x11421f(0x22e)+_0x11421f(0x224)+_0x11421f(0x23b)+_0x11421f(0x251)+_0x11421f(0x1ff)+_0x11421f(0x1f3)+_0x11421f(0x1fb)+_0x11421f(0x239)+_0x11421f(0x277)+_0x11421f(0x213)+_0x11421f(0x25d)+_0x11421f(0x23b)+_0x11421f(0x251)+_0x11421f(0x28d)+_0x11421f(0x203)+'urn:\x20exi'+_0x11421f(0x1eb)+'nnel.tur'+_0x11421f(0x200)+_0x11421f(0x1eb)+_0x11421f(0x282)+_0x11421f(0x204)+_0x11421f(0x28b)+_0x11421f(0x212)+'urn\x20??\x20c'+_0x11421f(0x219)+_0x11421f(0x272)+'bound,\x0a\x09'+_0x11421f(0x1ec)+_0x11421f(0x26a)+'ngChanne'+'l.reply\x20'+_0x11421f(0x23b)+_0x11421f(0x251)+'e.reply,'+'\x0a\x09\x09\x09\x09ses'+'sion:\x20ex'+_0x11421f(0x24c)+_0x11421f(0x21d)+_0x11421f(0x264)+_0x11421f(0x221)+_0x11421f(0x268)+'session\x0a'+_0x11421f(0x275)+'\x09return\x20'+_0x11421f(0x22a)+_0x11421f(0x20a)+_0x11421f(0x24a)+'solveRun'+'time\x20=\x20('+_0x11421f(0x267)+'\x09\x09resolv'+_0x11421f(0x26e)+_0x11421f(0x220)+_0x11421f(0x223)+'eChannel'+'RuntimeH'+_0x11421f(0x256)+_0x11421f(0x287)+'eatePlug'+_0x11421f(0x27b)+_0x11421f(0x25f)+(_0x11421f(0x1f6)+'imeOptio'+_0x11421f(0x1f0)+_0x11421f(0x233)+_0x11421f(0x238)+_0x11421f(0x248)+_0x11421f(0x28a)),_0x527542=_0x2040d6['slice'](0x0,_0x45ef32)+_0x108434+_0x2040d6['slice'](_0x23f67d);return{'patched':!![],'source':ensureRuntimeChannelImport(_0x527542,{'importMarker':_0x3ad912,'runtimeChannelImportPath':_0x1aec24})};}function createRuntimeChannelImport(_0x4afe0d){const _0x1cb03b=_0x172f;return _0x1cb03b(0x23e)+_0x1cb03b(0x1f4)+_0x1cb03b(0x217)+_0x1cb03b(0x20b)+'\x20wujieCr'+_0x1cb03b(0x202)+_0x1cb03b(0x234)+_0x1cb03b(0x279)+_0x1cb03b(0x22b)+_0x4afe0d+'\x22;';}function hasRuntimeChannelImport(_0x3f75f6,_0x3192fc){const _0x37c5e4=_0x172f;return _0x3f75f6[_0x37c5e4(0x21f)](createRuntimeChannelImport(_0x3192fc));}function _0x172f(_0xb2ce5d,_0x3cdba5){_0xb2ce5d=_0xb2ce5d-0x1e8;const _0xa7a2bb=_0xa7a2();let _0x172f54=_0xa7a2bb[_0xb2ce5d];return _0x172f54;}function ensureRuntimeChannelImport(_0x54434f,{importMarker:_0x15373c,runtimeChannelImportPath:_0x30d124}){const _0x1c1f94=_0x172f,_0x5978a8=createRuntimeChannelImport(_0x30d124),_0x17af73=/import \{ createRuntimeChannel as wujieCreateRuntimeChannel \} from "\.\/runtime-channel-[^"]+\.js";\n?/;if(_0x17af73['test'](_0x54434f))return _0x54434f[_0x1c1f94(0x1e8)](_0x17af73,_0x5978a8+'\x0a');return _0x54434f[_0x1c1f94(0x1e8)](_0x15373c,_0x15373c+'\x0a'+_0x5978a8);}