@wujie-shell/core 1.0.6 → 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.
- package/dist/bin/wujie-shell.mjs +1 -1
- package/dist/src/agents/bundled-agent-skills.mjs +1 -1
- package/dist/src/agents/bundled-agents.mjs +1 -1
- package/dist/src/agents/codex-home.mjs +1 -1
- package/dist/src/agents/runtime-config.mjs +1 -1
- package/dist/src/chat/media-archive.mjs +1 -1
- package/dist/src/chat/queue.mjs +1 -1
- package/dist/src/common/cron-session-key.mjs +1 -1
- package/dist/src/common/diagnostics.mjs +1 -1
- package/dist/src/common/logging.mjs +1 -1
- package/dist/src/common/runtime-logger.mjs +1 -1
- package/dist/src/common/sqlite-paths.mjs +1 -1
- package/dist/src/common/user-events.mjs +1 -1
- package/dist/src/common/utils.mjs +1 -1
- package/dist/src/config/controller.mjs +1 -1
- package/dist/src/connectors/config-utils.mjs +1 -1
- package/dist/src/connectors/constants.mjs +1 -1
- package/dist/src/connectors/controller.mjs +1 -1
- package/dist/src/connectors/kdocs-cli.mjs +1 -1
- package/dist/src/connectors/lark-cli.mjs +1 -1
- package/dist/src/electron/instance-identity.mjs +1 -1
- package/dist/src/electron/main.mjs +1 -1
- package/dist/src/electron/preload.mjs +1 -1
- package/dist/src/electron/protocol-url-state.mjs +1 -1
- package/dist/src/events/domain-event-journal.mjs +1 -1
- package/dist/src/files/generated-files-store.mjs +1 -1
- package/dist/src/files/handlers.mjs +1 -1
- package/dist/src/gateway/chat-delta.mjs +1 -1
- package/dist/src/gateway/controller.mjs +1 -1
- package/dist/src/gateway/request-id-title-events.mjs +1 -1
- package/dist/src/gateway/ws-client.mjs +1 -1
- package/dist/src/index.mjs +1 -1
- package/dist/src/log-reporting/handlers.mjs +1 -1
- package/dist/src/log-reporting/report-logs.mjs +1 -1
- package/dist/src/models/handlers.mjs +1 -1
- package/dist/src/preferences/store.mjs +1 -1
- package/dist/src/request-id/handlers.mjs +1 -1
- package/dist/src/request-id/runtime-bridge.mjs +1 -1
- package/dist/src/request-id/session-store.mjs +1 -1
- package/dist/src/request-id/title.mjs +1 -1
- package/dist/src/review/controller.mjs +1 -1
- package/dist/src/runtime/cron-missed-run-policy.mjs +1 -1
- package/dist/src/runtime/index.mjs +1 -1
- package/dist/src/runtime/patch-channel-plugin-runtime.mjs +1 -1
- package/dist/src/runtime/patch-chat-attachment-base64.mjs +1 -1
- package/dist/src/runtime/patch-chat-history-mixed-tool-content.mjs +1 -1
- package/dist/src/runtime/patch-codex-isolated-auth.mjs +1 -1
- package/dist/src/runtime/patch-provider-request-id-header.mjs +1 -1
- package/dist/src/runtime/patch-qqbot-outbound-session-route.mjs +1 -1
- package/dist/src/runtime/patch-request-id-title-runtime.mjs +1 -1
- package/dist/src/runtime/patch-session-store-sqlite.mjs +1 -1
- package/dist/src/runtime/patch-weixin-outbound-session-route.mjs +1 -1
- package/dist/src/runtime/plugin-sync.mjs +1 -1
- package/dist/src/sessions/agent-sessions-map-store.mjs +1 -1
- package/dist/src/sessions/runtime-bridge.mjs +1 -1
- package/dist/src/sessions/session-data-service.mjs +1 -1
- package/dist/src/sessions/session-runtime-state-service.mjs +1 -1
- package/dist/src/sessions/session-runtime-state.mjs +1 -1
- package/dist/src/sessions/session-sqlite-store.mjs +1 -1
- package/dist/src/skills/import.mjs +1 -1
- package/dist/src/skills/market.mjs +1 -1
- package/dist/src/terminal/manager.mjs +1 -1
- package/dist/src/updates/controller.mjs +1 -1
- package/dist/src/updates/loader.mjs +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x31e6db=_0x3914;(function(_0x4ab917,_0x386a73){const _0x4c64e1=_0x3914,_0x3f2df2=_0x4ab917();while(!![]){try{const _0x15d87f=parseInt(_0x4c64e1(0x1ba))/0x1*(-parseInt(_0x4c64e1(0x1a3))/0x2)+parseInt(_0x4c64e1(0xab))/0x3*(-parseInt(_0x4c64e1(0x119))/0x4)+parseInt(_0x4c64e1(0x16a))/0x5*(-parseInt(_0x4c64e1(0x1f8))/0x6)+-parseInt(_0x4c64e1(0xbf))/0x7*(-parseInt(_0x4c64e1(0x143))/0x8)+parseInt(_0x4c64e1(0x1e8))/0x9+parseInt(_0x4c64e1(0x258))/0xa*(-parseInt(_0x4c64e1(0x1f6))/0xb)+parseInt(_0x4c64e1(0x30a))/0xc*(parseInt(_0x4c64e1(0x1cb))/0xd);if(_0x15d87f===_0x386a73)break;else _0x3f2df2['push'](_0x3f2df2['shift']());}catch(_0x99354b){_0x3f2df2['push'](_0x3f2df2['shift']());}}}(_0x5a9f,0x7aa3c));import{existsSync}from'node:fs';import{createWriteStream}from'node:fs';import{chmod,cp,mkdir,readFile,readdir,rename,rm,stat,symlink,writeFile}from'node:fs/promises';import{basename,delimiter,dirname,join,extname,parse,relative,resolve}from'node:path';import{fileURLToPath,pathToFileURL}from'node:url';import{spawn}from'node:child_process';import{get}from'node:https';import{pipeline}from'node:stream/promises';import{getConfigPaths}from'@wujie-shell/config';import{copyDirFresh,getPackageMetadata,readJson,readPluginManifest,toRuntimeRelative,writeJson}from'../common/utils.mjs';import{createRuntimeLogger,summarizeRuntimeManifest,summarizeShellConfig}from'../common/runtime-logger.mjs';import{hasConfiguredKdocsSkill,installKdocsCliBinary}from'../connectors/kdocs-cli.mjs';import{installRuntimeLarkCliPackage,resolveRuntimeLarkCliCommand}from'../connectors/lark-cli.mjs';import{patchMixedToolContentFromSource}from'./patch-chat-history-mixed-tool-content.mjs';import{patchChatAttachmentBase64FromSource}from'./patch-chat-attachment-base64.mjs';import{patchChannelPluginRuntimeFromSource}from'./patch-channel-plugin-runtime.mjs';import{patchProviderRequestIdHeaderFromSource}from'./patch-provider-request-id-header.mjs';import{patchCodexIsolatedAuthFromSource}from'./patch-codex-isolated-auth.mjs';import{patchSessionStoreLoadFromSource,patchSessionStoreWriteFromSource}from'./patch-session-store-sqlite.mjs';import{patchQQBotOutboundFallbackFromSource,patchQQBotOutboundSessionRouteFromSource}from'./patch-qqbot-outbound-session-route.mjs';import{patchWeixinOutboundFallbackFromSource,patchWeixinOutboundSessionRouteFromSource}from'./patch-weixin-outbound-session-route.mjs';import{patchRequestIdTitleRuntimeFromSource}from'./patch-request-id-title-runtime.mjs';const RUNTIME_DIR=_0x31e6db(0x21d)+_0x31e6db(0x1dc),MANIFEST_NAME='runtime-'+'manifest'+_0x31e6db(0x120),NPM_INSTALL_TIMEOUT_MS=0xf*0x3c*0x3e8;export function resolveRuntimeRoot(_0x12c8c8){if(process.env.WUJIE_SHELL_RUNTIME_ROOT)return resolve(process.env.WUJIE_SHELL_RUNTIME_ROOT);return resolve(_0x12c8c8,RUNTIME_DIR);}export function resolveManifestPath(_0x256d3c){return join(_0x256d3c,MANIFEST_NAME);}async function loadProductRuntime(_0x410347,_0x3a2d55){const _0x535deb=_0x31e6db,_0x13129f=[join(_0x410347,_0x535deb(0x22e)+'ntime',_0x535deb(0x328)+'s'),join(_0x3a2d55,_0x535deb(0x22e)+'ntime',_0x535deb(0x328)+'s')];for(const _0x1f1cea of _0x13129f){if(!existsSync(_0x1f1cea))continue;return await import(pathToFileURL(_0x1f1cea)[_0x535deb(0xe6)]+_0x535deb(0xb3)+Date[_0x535deb(0x32a)]());}return{};}export async function prepareRuntime(_0x4d98c7,{syncOnly:syncOnly=![],pruneForPackaging:pruneForPackaging=![]}={}){const _0x3e0eea=_0x31e6db,_0x3d65c2=resolveRuntimeRoot(_0x4d98c7[_0x3e0eea(0x18c)+_0x3e0eea(0xa4)]),_0xc9c5e4=createRuntimeLogger(getConfigPaths(_0x4d98c7),'runtime'),_0x17789c=Date[_0x3e0eea(0x32a)]();_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.(_0x3e0eea(0x2a9)+_0x3e0eea(0x20e)+_0x3e0eea(0x259),{'syncOnly':syncOnly,'runtimeRoot':_0x3d65c2,'shellConfig':summarizeShellConfig(_0x4d98c7)});try{const _0x3f3b02=await ensureRuntimeBase(_0x4d98c7,_0x3d65c2,{'runtimeLogger':_0xc9c5e4,'syncOnly':syncOnly});_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.(_0x3e0eea(0x20e)+_0x3e0eea(0x2b3)+_0x3e0eea(0x149),{'manifestPath':resolveManifestPath(_0x3d65c2),'manifest':summarizeRuntimeManifest(_0x3f3b02)}),validateRuntimeNodeVersion(_0x3f3b02,_0x4d98c7),_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.(_0x3e0eea(0x20e)+_0x3e0eea(0xe9)+_0x3e0eea(0x2e3)+_0x3e0eea(0x18d),{'nodeVersion':_0x3f3b02[_0x3e0eea(0x22f)+_0x3e0eea(0x26d)]});if(syncOnly)validateRuntimeOpenClawVersion(_0x3f3b02,_0x4d98c7),_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.(_0x3e0eea(0x20e)+_0x3e0eea(0x2f4)+_0x3e0eea(0xb6)+_0x3e0eea(0x203)+'ed',{'openclawVersion':_0x3f3b02[_0x3e0eea(0x2f4)+_0x3e0eea(0x99)]});else{if(_0x3f3b02[_0x3e0eea(0x2f4)+_0x3e0eea(0x99)]!==_0x4d98c7[_0x3e0eea(0x2f4)]['openclaw'+_0x3e0eea(0x99)]){const _0x162f30=await loadRuntimeInfo(_0x4d98c7[_0x3e0eea(0x18c)+_0x3e0eea(0xa4)]);_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.(_0x3e0eea(0x2f4)+'\x20package'+'\x20install'+_0x3e0eea(0x255),{'fromVersion':_0x3f3b02[_0x3e0eea(0x2f4)+_0x3e0eea(0x99)]||'unknown','toVersion':_0x4d98c7[_0x3e0eea(0x2f4)][_0x3e0eea(0x2f4)+_0x3e0eea(0x99)]}),await installOpenClawPackage(_0x162f30,_0x4d98c7['openclaw'][_0x3e0eea(0x2f4)+_0x3e0eea(0x99)]),_0x3f3b02[_0x3e0eea(0x2f4)+_0x3e0eea(0x99)]=_0x4d98c7[_0x3e0eea(0x2f4)][_0x3e0eea(0x2f4)+_0x3e0eea(0x99)],_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.(_0x3e0eea(0x2f4)+_0x3e0eea(0x80)+'\x20install'+_0x3e0eea(0x107)+'ed',{'openclawVersion':_0x3f3b02[_0x3e0eea(0x2f4)+_0x3e0eea(0x99)]});}}_0x3f3b02[_0x3e0eea(0x176)+_0x3e0eea(0x82)]=new Date()['toISOStr'+_0x3e0eea(0x15b)](),_0x3f3b02[_0x3e0eea(0x22f)+_0x3e0eea(0x26d)]=_0x4d98c7[_0x3e0eea(0x2f4)][_0x3e0eea(0x22f)+_0x3e0eea(0x26d)],_0x3f3b02['product']={'appId':_0x4d98c7[_0x3e0eea(0x1c9)],'productName':_0x4d98c7[_0x3e0eea(0x1fe)+_0x3e0eea(0x333)],'dataDirName':_0x4d98c7[_0x3e0eea(0x2fc)+_0x3e0eea(0x333)]},await patchChatHistoryMixedToolContentBug(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),await patchChatAttachmentBase64Runtime(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),await patchProviderRequestIdHeader(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),await patchCodexIsolatedAuthRuntime(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),await patchChannelPluginRuntimeBug(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),await patchWeixinOutboundFallbackRuntime(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),await patchQQBotOutboundFallbackRuntime(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4});const _0x12f8de=await loadProductRuntime(_0x4d98c7[_0x3e0eea(0x18c)+_0x3e0eea(0xa4)],_0x3d65c2);if(typeof _0x12f8de['prepareP'+_0x3e0eea(0x32d)+_0x3e0eea(0x254)]===_0x3e0eea(0x12d)){const _0x28fcb5=createRuntimeInfoFromManifest(_0x3d65c2,_0x3f3b02);await _0x12f8de[_0x3e0eea(0x249)+_0x3e0eea(0x32d)+_0x3e0eea(0x254)]({'shellConfig':_0x4d98c7,'runtime':_0x28fcb5,'runtimeLogger':_0xc9c5e4,'syncOnly':syncOnly}),_0xc9c5e4?.['importan'+'t']?.(_0x3e0eea(0x2ee)+'runtime\x20'+'tools\x20sy'+_0x3e0eea(0x123));}await patchSessionStoreSqliteRuntime(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),await patchRequestIdTitleRuntime(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4});!syncOnly&&(await installRuntimeLarkCliPackage(createRuntimeInfoFromManifest(_0x3d65c2,_0x3f3b02),{'runtimeLogger':_0xc9c5e4,'createRuntimeEnv':createRuntimeEnv}),_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.(_0x3e0eea(0x1b4)+_0x3e0eea(0x216)+_0x3e0eea(0x80)+_0x3e0eea(0x1b0)),await hasConfiguredKdocsSkill(_0x4d98c7)?(await installKdocsCliBinary(_0x4d98c7,createRuntimeInfoFromManifest(_0x3d65c2,_0x3f3b02),{'runtimeLogger':_0xc9c5e4,'syncOnly':syncOnly}),_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.(_0x3e0eea(0xbe)+'r\x20runtim'+_0x3e0eea(0x209)+_0x3e0eea(0x183))):_0xc9c5e4?.[_0x3e0eea(0x2da)](_0x3e0eea(0xbe)+_0x3e0eea(0x218)+'e\x20tools\x20'+_0x3e0eea(0x26c)+_0x3e0eea(0x11d)+_0x3e0eea(0x1d8)+_0x3e0eea(0x292)+_0x3e0eea(0x2fe)));const _0x2418b3=Array[_0x3e0eea(0x1e3)](_0x3f3b02[_0x3e0eea(0xec)])?_0x3f3b02['plugins'][_0x3e0eea(0x118)]:0x0;return await syncManifestPluginScope(_0x4d98c7,_0x3d65c2,_0x3f3b02),_0xc9c5e4?.['importan'+'t']?.('runtime\x20'+'plugin\x20s'+_0x3e0eea(0x157)+_0x3e0eea(0xc6),{'beforePluginCount':_0x2418b3,'afterPluginCount':Array['isArray'](_0x3f3b02['plugins'])?_0x3f3b02[_0x3e0eea(0xec)][_0x3e0eea(0x118)]:0x0,'pluginSpecCount':Array[_0x3e0eea(0x1e3)](_0x3f3b02[_0x3e0eea(0x27b)+_0x3e0eea(0x2ff)])?_0x3f3b02[_0x3e0eea(0x27b)+_0x3e0eea(0x2ff)][_0x3e0eea(0x118)]:0x0}),await syncConfiguredNpmPlugins(_0x4d98c7,_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4,'syncOnly':syncOnly}),_0xc9c5e4?.['importan'+'t']?.(_0x3e0eea(0x25e)+_0x3e0eea(0x2d6)+_0x3e0eea(0x137)+_0x3e0eea(0x232),{'pluginSpecCount':_0x4d98c7[_0x3e0eea(0x2f4)][_0x3e0eea(0x27b)+'ecs'][_0x3e0eea(0x118)],'pluginCount':Array['isArray'](_0x3f3b02[_0x3e0eea(0xec)])?_0x3f3b02[_0x3e0eea(0xec)][_0x3e0eea(0x118)]:0x0}),await patchWeixinOutboundSessionRoute(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),await patchQQBotOutboundSessionRoute(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),await syncProductPlugins(_0x4d98c7,_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.(_0x3e0eea(0x2ee)+_0x3e0eea(0x20d)+_0x3e0eea(0x183),{'localPluginCount':_0x4d98c7[_0x3e0eea(0x2f4)][_0x3e0eea(0x33b)+_0x3e0eea(0x84)+_0x3e0eea(0x138)]['length'],'pluginCount':Array[_0x3e0eea(0x1e3)](_0x3f3b02[_0x3e0eea(0xec)])?_0x3f3b02[_0x3e0eea(0xec)][_0x3e0eea(0x118)]:0x0}),await syncProductAgents(_0x4d98c7,_0x3d65c2,_0x3f3b02),_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.('product\x20'+_0x3e0eea(0x2e2)+_0x3e0eea(0x232),{'sources':_0x4d98c7[_0x3e0eea(0x2f4)][_0x3e0eea(0x33b)+'LocalAge'+_0x3e0eea(0xd6)],'entryCount':_0x3f3b02['agents']?.['entryCou'+'nt'],'installPath':_0x3f3b02[_0x3e0eea(0x23f)]?.['installP'+_0x3e0eea(0x2ae)]}),await syncProductSkills(_0x4d98c7,_0x3d65c2,_0x3f3b02),_0xc9c5e4?.['importan'+'t']?.(_0x3e0eea(0x2ee)+_0x3e0eea(0x2aa)+'ynced',{'sources':_0x4d98c7['openclaw']['resolved'+_0x3e0eea(0xd2)+_0x3e0eea(0x1a4)],'entryCount':_0x3f3b02[_0x3e0eea(0x1fd)]?.[_0x3e0eea(0x246)+'nt'],'installPath':_0x3f3b02[_0x3e0eea(0x1fd)]?.[_0x3e0eea(0x207)+_0x3e0eea(0x2ae)]}),await syncRuntimeWrapper(_0x4d98c7,_0x3d65c2,_0x3f3b02),_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.('runtime\x20'+'wrapper\x20'+_0x3e0eea(0x183),{'wujieclawBin':_0x3f3b02[_0x3e0eea(0xda)+_0x3e0eea(0x158)]}),await prunePackagedRuntimeCaches(_0x3d65c2,_0xc9c5e4),pruneForPackaging&&await prunePackagedRuntimePayload(_0x3d65c2,_0x3f3b02,_0xc9c5e4),await writeJson(resolveManifestPath(_0x3d65c2),_0x3f3b02),_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.('runtime\x20'+_0x3e0eea(0x2b3)+'\x20written',{'manifestPath':resolveManifestPath(_0x3d65c2),'manifest':summarizeRuntimeManifest(_0x3f3b02),'durationMs':Date[_0x3e0eea(0x32a)]()-_0x17789c}),await _0xc9c5e4?.['flush'](),_0x3f3b02;}catch(_0x490aaf){_0xc9c5e4?.['error'](_0x3e0eea(0x2a9)+_0x3e0eea(0x20e)+'failed',{'syncOnly':syncOnly,'runtimeRoot':_0x3d65c2,'durationMs':Date['now']()-_0x17789c,'error':_0x490aaf}),await _0xc9c5e4?.[_0x3e0eea(0x108)]();throw _0x490aaf;}}async function prunePackagedRuntimeCaches(_0x1eefc8,_0x219bde){const _0x4b49e2=_0x31e6db,_0x4c644b=[join(_0x1eefc8,_0x4b49e2(0x163)),join(_0x1eefc8,_0x4b49e2(0x164),_0x4b49e2(0x277)+'e'),join(_0x1eefc8,_0x4b49e2(0x177)+_0x4b49e2(0x309)+_0x4b49e2(0x171)),join(_0x1eefc8,_0x4b49e2(0x150)+_0x4b49e2(0x1ae)+_0x4b49e2(0xee))];for(const _0x50e4bd of _0x4c644b){if(!existsSync(_0x50e4bd))continue;await rm(_0x50e4bd,{'recursive':!![],'force':!![]}),_0x219bde?.[_0x4b49e2(0x2da)](_0x4b49e2(0x12b)+_0x4b49e2(0x1f9)+_0x4b49e2(0x264)+_0x4b49e2(0x2bf)+'aging',{'cachePath':_0x50e4bd});}}async function prunePackagedRuntimePayload(_0x4c3cf6,_0x536093,_0x356d60){const _0x4fe24f=_0x31e6db,_0x215b61=createRuntimeInfoFromManifest(_0x4c3cf6,_0x536093),_0x5623c5=[join(_0x4c3cf6,process['platform']===_0x4fe24f(0x21a)?_0x4fe24f(0x278)+_0x4fe24f(0x307)+_0x4fe24f(0xa3):_0x4fe24f(0xa7)+_0x4fe24f(0x1af)+_0x4fe24f(0x161)+'m'),join(_0x215b61[_0x4fe24f(0x2f4)+_0x4fe24f(0x294)+'ir'],_0x4fe24f(0xcf)+'ules')],_0x5860eb=join(_0x215b61['openclaw'+_0x4fe24f(0x294)+'ir'],_0x4fe24f(0xc7),'extensio'+'ns');if(existsSync(_0x5860eb))for(const _0x4fbc2a of await readdir(_0x5860eb,{'withFileTypes':!![]})){_0x4fbc2a[_0x4fe24f(0xe0)+'ory']()&&_0x5623c5['push'](join(_0x5860eb,_0x4fbc2a[_0x4fe24f(0x22a)],'node_mod'+_0x4fe24f(0x2af)));}const _0x86261d={'files':0x0,'directories':0x0,'bytes':0x0};for(const _0xd65e0a of _0x5623c5){await pruneRuntimeDependencyTree(_0xd65e0a,_0x86261d);}await pruneOpenClawDocs(_0x215b61['openclaw'+_0x4fe24f(0x294)+'ir'],_0x86261d),_0x356d60?.[_0x4fe24f(0x2da)]('pruned\x20r'+'untime\x20p'+_0x4fe24f(0x140)+_0x4fe24f(0x331)+'ckaging',_0x86261d);}async function pruneOpenClawDocs(_0x31be73,_0xd7c3f4){const _0x37d6fd=_0x31e6db,_0x2c484c=join(_0x31be73,_0x37d6fd(0x238));if(!existsSync(_0x2c484c))return;for(const _0x128836 of await readdir(_0x2c484c,{'withFileTypes':!![]})){if(_0x128836[_0x37d6fd(0x22a)]===_0x37d6fd(0x250)+'e')continue;await removePrunedPath(join(_0x2c484c,_0x128836['name']),_0xd7c3f4);}}async function pruneRuntimeDependencyTree(_0x520d63,_0x554e60){const _0x349269=_0x31e6db;if(!existsSync(_0x520d63))return;for(const _0x548d40 of await readdir(_0x520d63,{'withFileTypes':!![]})){const _0x4f99a0=join(_0x520d63,_0x548d40['name']);if(_0x548d40[_0x349269(0xe0)+'ory']()){if(shouldPruneRuntimeDirectory(_0x520d63,_0x548d40[_0x349269(0x22a)])){await removePrunedPath(_0x4f99a0,_0x554e60);continue;}await pruneRuntimeDependencyTree(_0x4f99a0,_0x554e60);continue;}_0x548d40[_0x349269(0x2e7)]()&&shouldPruneRuntimeFile(_0x548d40[_0x349269(0x22a)])&&await removePrunedPath(_0x4f99a0,_0x554e60);}}function shouldPruneRuntimeDirectory(_0x1f7fd9,_0x3f7c9e){const _0x53cd40=_0x31e6db;if(_0x3f7c9e==='@types')return!![];if(new Set([_0x53cd40(0x257),_0x53cd40(0x238),_0x53cd40(0x275)])[_0x53cd40(0x15f)](_0x3f7c9e))return existsSync(join(_0x1f7fd9,_0x53cd40(0x2b2)+'json'));return new Set([_0x53cd40(0x27e)+'_',_0x53cd40(0x1de),'examples',_0x53cd40(0x174),_0x53cd40(0x142)])[_0x53cd40(0x15f)](_0x3f7c9e);}function shouldPruneRuntimeFile(_0x409247){const _0xf38941=_0x31e6db;if(_0x409247==='package-'+_0xf38941(0x136)+'n'||_0x409247[_0xf38941(0x10c)](_0xf38941(0x17c)))return!![];return new Set(['.map','.md',_0xf38941(0x1d2)+'n'])[_0xf38941(0x15f)](extname(_0x409247)['toLowerC'+_0xf38941(0x284)]());}async function removePrunedPath(_0x39a621,_0x54e405){const _0x118382=_0x31e6db;if(!existsSync(_0x39a621))return;const _0x4df8a4=await getPathSize(_0x39a621),_0x10a051=await stat(_0x39a621);await rm(_0x39a621,{'recursive':!![],'force':!![]}),_0x54e405[_0x118382(0x1b7)]+=_0x4df8a4;if(_0x10a051[_0x118382(0xe0)+'ory']())_0x54e405[_0x118382(0xc9)+_0x118382(0x1c2)]+=0x1;else _0x54e405['files']+=0x1;}async function getPathSize(_0x3c04f6){const _0x3d14a2=_0x31e6db,_0x47bd6d=await stat(_0x3c04f6);if(!_0x47bd6d[_0x3d14a2(0xe0)+_0x3d14a2(0x306)]())return _0x47bd6d[_0x3d14a2(0x312)];let _0x450991=0x0;for(const _0x162043 of await readdir(_0x3c04f6,{'withFileTypes':!![]})){_0x450991+=await getPathSize(join(_0x3c04f6,_0x162043[_0x3d14a2(0x22a)]));}return _0x450991;}async function syncRuntimeWrapper(_0x4cd861,_0x100774,_0x3bacab){const _0x1390af=_0x31e6db,_0x4b1421=_0x4cd861[_0x1390af(0x2f4)]?.[_0x1390af(0xc8)+_0x1390af(0x2ca)]??_0x1390af(0x114)+_0x1390af(0x2e4),_0x583a62=join(_0x100774,_0x1390af(0x1a1),'wujiecla'+'w'),_0x5a2d18=join(_0x100774,_0x1390af(0x1a1),_0x1390af(0xda)+_0x1390af(0x8d)),_0x27c12a=normalizeRuntimeRelativePath(relative(dirname(_0x583a62),resolve(_0x100774,_0x3bacab[_0x1390af(0x288)+_0x1390af(0x32e)]))),_0x7baf18=normalizeRuntimeRelativePath(relative(dirname(_0x583a62),resolve(_0x100774,_0x3bacab[_0x1390af(0x2f4)+_0x1390af(0xa6)]))),_0x44f2c6='$HOME/'+_0x4cd861[_0x1390af(0x2fc)+_0x1390af(0x333)],_0x445aea='%USERPRO'+'FILE%\x5c'+_0x4cd861['dataDirN'+_0x1390af(0x333)];await mkdir(dirname(_0x583a62),{'recursive':!![]});const _0x59bcb3=fileURLToPath(new URL(_0x1390af(0xdc)+_0x1390af(0x27d)+'ie-logo.'+_0x1390af(0x1ee),import.meta.url)),_0x349ea3=join(_0x100774,_0x1390af(0x1a1),_0x1390af(0x124)+_0x1390af(0x2f2));await cp(_0x59bcb3,_0x349ea3),await writeFile(_0x583a62,[_0x1390af(0x13d)+'h','export\x20O'+_0x1390af(0x91)+_0x1390af(0x321)+_0x1390af(0x92)+_0x1390af(0x248)+_0x44f2c6+'}\x22',_0x1390af(0x196)+_0x1390af(0x91)+_0x1390af(0x2dc)+_0x1390af(0x1cd)+_0x1390af(0x29c)+_0x1390af(0x199)+'-'+_0x44f2c6+'}\x22','export\x20O'+_0x1390af(0x91)+_0x1390af(0x2be)+_0x1390af(0x1df)+'=\x22${OPEN'+_0x1390af(0x112)+'FIG_FILE'+_0x1390af(0x12f)+_0x4b1421+'}\x22',_0x1390af(0x196)+'PENCLAW_'+_0x1390af(0x9d)+_0x1390af(0x135)+'PENCLAW_'+'CONFIG_P'+_0x1390af(0x334)+_0x44f2c6+'/'+_0x4b1421+'}\x22','SCRIPT_D'+_0x1390af(0x95)+_0x1390af(0x15d)+_0x1390af(0x1b6)+'rname\x20--'+_0x1390af(0x1e0)+_0x1390af(0x2de),_0x1390af(0x18a)+_0x1390af(0xfa)+_0x1390af(0x1e2)+'R/'+_0x27c12a+'\x22','if\x20[\x20-t\x20'+_0x1390af(0xcb)+_0x1390af(0xc5)+'JIE_NO_L'+'OGO\x22\x20];\x20'+_0x1390af(0x113),_0x1390af(0x134)+'IME_NODE'+_0x1390af(0x253)+_0x1390af(0x2ed)+_0x1390af(0x317)+_0x1390af(0x146)+_0x1390af(0x175)+'ll\x20||\x20tr'+'ue','fi','exec\x20\x22$R'+_0x1390af(0xf0)+_0x1390af(0xad)+_0x1390af(0x1e2)+'R/'+_0x7baf18+_0x1390af(0xd3),''][_0x1390af(0x89)]('\x0a'),'utf8'),await chmod(_0x583a62,0x1ed),await writeFile(_0x5a2d18,[_0x1390af(0x12e)+'f',_0x1390af(0x190)+_0x1390af(0x24a)+_0x1390af(0x21e)+_0x1390af(0x2a6)+_0x1390af(0xa1)+_0x1390af(0x327)+_0x445aea+'\x22',_0x1390af(0x190)+_0x1390af(0x29c)+'ATE_DIR%'+_0x1390af(0x1db)+'t\x20\x22OPENC'+_0x1390af(0x19d)+'E_DIR='+_0x445aea+'\x22',_0x1390af(0x190)+'NCLAW_CO'+_0x1390af(0x20b)+_0x1390af(0x298)+_0x1390af(0x1be)+_0x1390af(0x222)+_0x1390af(0x225)+_0x1390af(0xdb)+_0x1390af(0x1b9)+_0x4b1421+'\x22','if\x20\x22%OPE'+_0x1390af(0x31c)+_0x1390af(0x329)+_0x1390af(0x301)+_0x1390af(0x1c5)+'NCLAW_CO'+'NFIG_PAT'+'H='+_0x445aea+'\x5c'+_0x4b1421+'\x22',_0x1390af(0x239)+_0x1390af(0x2d3)+'%~dp0\x22','set\x20\x22RUN'+_0x1390af(0x1d6)+'E=%SCRIP'+_0x1390af(0x2a7)+toWindowsPath(_0x27c12a)+'\x22','\x22%RUNTIM'+'E_NODE%\x22'+_0x1390af(0xd4)+'T_DIR%'+toWindowsPath(_0x7baf18)+_0x1390af(0x2bd),''][_0x1390af(0x89)]('\x0d\x0a'),'utf8'),_0x3bacab[_0x1390af(0xda)+_0x1390af(0x158)]=toRuntimeRelative(_0x100774,process[_0x1390af(0x2fa)]===_0x1390af(0x21a)?_0x5a2d18:_0x583a62);}async function patchChatHistoryMixedToolContentBug(_0x10f03b,_0x20b539,_0x25fafa={}){const _0x482379=_0x31e6db,_0x475346=resolve(_0x10f03b,_0x20b539[_0x482379(0x2f4)+_0x482379(0x294)+'ir']),_0x6d7441=join(_0x475346,_0x482379(0xc7));let _0x3fa49a=[];try{_0x3fa49a=await readdir(_0x6d7441,{'withFileTypes':!![]});}catch{_0x25fafa[_0x482379(0xf8)+'ogger']?.[_0x482379(0x7f)]?.(_0x482379(0x17d)+'tory\x20mix'+_0x482379(0x162)+'patch\x20sk'+_0x482379(0x2b9)+'ist\x20not\x20'+_0x482379(0xb0),{'distDir':_0x6d7441,'openclawVersion':_0x20b539[_0x482379(0x2f4)+_0x482379(0x99)]});return;}const _0x236e9e=_0x3fa49a[_0x482379(0x132)](_0x12f9f2=>_0x12f9f2[_0x482379(0x2e7)]()&&(_0x12f9f2[_0x482379(0x22a)][_0x482379(0x28d)+'th']('chat-dis'+_0x482379(0xae)+_0x482379(0xcc))||_0x12f9f2['name'][_0x482379(0x28d)+'th'](_0x482379(0x206)+_0x482379(0x2d8)+'pt-path-'))&&_0x12f9f2[_0x482379(0x22a)][_0x482379(0x10c)](_0x482379(0x1a7)))['map'](_0x4e70fc=>join(_0x6d7441,_0x4e70fc[_0x482379(0x22a)]));if(_0x236e9e[_0x482379(0x118)]===0x0){_0x25fafa[_0x482379(0xf8)+_0x482379(0x318)]?.[_0x482379(0x7f)]?.('chat\x20his'+'tory\x20mix'+_0x482379(0x162)+_0x482379(0x1ef)+_0x482379(0x25d)+_0x482379(0x189)+_0x482379(0xb0),{'openclawVersion':_0x20b539[_0x482379(0x2f4)+_0x482379(0x99)]});return;}for(const _0x270c37 of _0x236e9e){const _0x283964=await readFile(_0x270c37,_0x482379(0x1b8)),_0x15064e=patchMixedToolContentFromSource(_0x283964);if(!_0x15064e[_0x482379(0x1d5)]){if(_0x15064e[_0x482379(0x15c)]===_0x482379(0x111)+_0x482379(0x1d5)){_0x25fafa[_0x482379(0xf8)+_0x482379(0x318)]?.[_0x482379(0x2da)]?.(_0x482379(0x17d)+_0x482379(0x2df)+_0x482379(0x162)+_0x482379(0x2a5)+'ready\x20ap'+'plied',{'openclawVersion':_0x20b539[_0x482379(0x2f4)+'Version'],'filePath':_0x270c37});return;}continue;}await writeFile(_0x270c37,_0x15064e['source'],'utf8'),_0x25fafa[_0x482379(0xf8)+'ogger']?.[_0x482379(0x2da)]?.(_0x482379(0x17d)+_0x482379(0x2df)+'ed-tool\x20'+_0x482379(0x290)+_0x482379(0x1f0),{'openclawVersion':_0x20b539[_0x482379(0x2f4)+_0x482379(0x99)],'filePath':_0x270c37,'note':_0x482379(0xed)+'y\x20compat'+_0x482379(0x1a9)+_0x482379(0x127)+_0x482379(0x2ab)+_0x482379(0x287)+_0x482379(0x2f8)+'tool\x20his'+_0x482379(0x22b)+_0x482379(0x200)+_0x482379(0x30b)+_0x482379(0x325)+'ream\x20fix'+_0x482379(0x194)+'re\x20upgra'+_0x482379(0x268)});return;}_0x25fafa[_0x482379(0xf8)+_0x482379(0x318)]?.[_0x482379(0x7f)]?.(_0x482379(0x17d)+_0x482379(0x2df)+_0x482379(0x162)+_0x482379(0x1ef)+'ipped;\x20f'+_0x482379(0x1b2)+_0x482379(0xf2)+'d',{'openclawVersion':_0x20b539[_0x482379(0x2f4)+_0x482379(0x99)]});}async function patchChatAttachmentBase64Runtime(_0x208606,_0x563445,_0x5c36e7={}){const _0xb0fc7b=_0x31e6db,_0x3f6aa8=resolve(_0x208606,_0x563445[_0xb0fc7b(0x2f4)+'WorkingD'+'ir']),_0x22730d=join(_0x3f6aa8,_0xb0fc7b(0xc7));let _0x2d6645=[];try{_0x2d6645=await readdir(_0x22730d,{'withFileTypes':!![]});}catch{_0x5c36e7[_0xb0fc7b(0xf8)+_0xb0fc7b(0x318)]?.['warn']?.(_0xb0fc7b(0x1a0)+'achment\x20'+_0xb0fc7b(0x242)+_0xb0fc7b(0x98)+_0xb0fc7b(0x2ef)+_0xb0fc7b(0x131)+_0xb0fc7b(0x2d7),{'distDir':_0x22730d,'openclawVersion':_0x563445[_0xb0fc7b(0x2f4)+_0xb0fc7b(0x99)]});return;}const _0x39bb4e=_0x2d6645[_0xb0fc7b(0x132)](_0x2ceb3c=>_0x2ceb3c[_0xb0fc7b(0x2e7)]()&&_0x2ceb3c[_0xb0fc7b(0x22a)][_0xb0fc7b(0x28d)+'th']('attachme'+_0xb0fc7b(0x19f)+_0xb0fc7b(0x18f))&&_0x2ceb3c[_0xb0fc7b(0x22a)][_0xb0fc7b(0x10c)]('.js'))[_0xb0fc7b(0x1e7)](_0x4ff9c5=>join(_0x22730d,_0x4ff9c5['name']));if(_0x39bb4e['length']===0x0){_0x5c36e7[_0xb0fc7b(0xf8)+'ogger']?.['warn']?.('chat\x20att'+'achment\x20'+'base64\x20p'+'atch\x20ski'+'pped;\x20fi'+_0xb0fc7b(0x26f)+_0xb0fc7b(0x2d7),{'openclawVersion':_0x563445['openclaw'+_0xb0fc7b(0x99)]});return;}for(const _0x1d1fa6 of _0x39bb4e){const _0x5bd375=await readFile(_0x1d1fa6,_0xb0fc7b(0x1b8)),_0x10ab88=patchChatAttachmentBase64FromSource(_0x5bd375);if(!_0x10ab88[_0xb0fc7b(0x1d5)]){if(_0x10ab88[_0xb0fc7b(0x15c)]==='already-'+_0xb0fc7b(0x1d5)){_0x5c36e7[_0xb0fc7b(0xf8)+'ogger']?.[_0xb0fc7b(0x2da)]?.(_0xb0fc7b(0x1a0)+_0xb0fc7b(0x304)+'base64\x20p'+_0xb0fc7b(0x210)+_0xb0fc7b(0x2b1)+_0xb0fc7b(0x10f),{'openclawVersion':_0x563445[_0xb0fc7b(0x2f4)+'Version'],'filePath':_0x1d1fa6});return;}continue;}await writeFile(_0x1d1fa6,_0x10ab88[_0xb0fc7b(0x215)],_0xb0fc7b(0x1b8)),_0x5c36e7[_0xb0fc7b(0xf8)+'ogger']?.[_0xb0fc7b(0x2da)]?.('chat\x20att'+_0xb0fc7b(0x304)+_0xb0fc7b(0x242)+_0xb0fc7b(0x18e)+_0xb0fc7b(0x10f),{'openclawVersion':_0x563445[_0xb0fc7b(0x2f4)+_0xb0fc7b(0x99)],'filePath':_0x1d1fa6,'note':_0xb0fc7b(0xed)+_0xb0fc7b(0xd7)+_0xb0fc7b(0x1a9)+'patch\x20fo'+_0xb0fc7b(0x2ab)+_0xb0fc7b(0x287)+'6\x20chat.s'+'end\x20atta'+'chment\x20b'+_0xb0fc7b(0x2fb)+_0xb0fc7b(0x11a)+_0xb0fc7b(0x2e0)+_0xb0fc7b(0xf1)+_0xb0fc7b(0x23a)+_0xb0fc7b(0x1f1)+_0xb0fc7b(0xb2)+_0xb0fc7b(0x15a)});return;}_0x5c36e7[_0xb0fc7b(0xf8)+_0xb0fc7b(0x318)]?.[_0xb0fc7b(0x7f)]?.(_0xb0fc7b(0x1a0)+'achment\x20'+_0xb0fc7b(0x242)+'atch\x20ski'+_0xb0fc7b(0xca)+_0xb0fc7b(0x25a)+_0xb0fc7b(0x33d),{'openclawVersion':_0x563445[_0xb0fc7b(0x2f4)+_0xb0fc7b(0x99)]});}async function patchProviderRequestIdHeader(_0x57f5ca,_0x27df86,_0xcba21e={}){const _0x3cde88=_0x31e6db,_0x1751c9=resolve(_0x57f5ca,_0x27df86[_0x3cde88(0x2f4)+_0x3cde88(0x294)+'ir']),_0x4ea96f=join(_0x1751c9,_0x3cde88(0xc7));let _0x34cac9=[];try{_0x34cac9=await readdir(_0x4ea96f,{'withFileTypes':!![]});}catch{_0xcba21e[_0x3cde88(0xf8)+'ogger']?.['warn']?.(_0x3cde88(0x1ec)+_0x3cde88(0x221)+'-id\x20head'+'er\x20patch'+_0x3cde88(0x2ad)+_0x3cde88(0x2ac)+'ot\x20found',{'distDir':_0x4ea96f,'openclawVersion':_0x27df86[_0x3cde88(0x2f4)+_0x3cde88(0x99)]});return;}const _0x5dd11f=_0x34cac9['filter'](_0x507b8a=>_0x507b8a[_0x3cde88(0x2e7)]()&&_0x507b8a[_0x3cde88(0x22a)][_0x3cde88(0x10c)]('.js'))['map'](_0x476780=>join(_0x4ea96f,_0x476780[_0x3cde88(0x22a)]));let _0x294342=0x0,_0x52aea3=0x0;for(const _0x1f8bbb of _0x5dd11f){const _0x2e40ab=await readFile(_0x1f8bbb,'utf8'),_0x5d09e1=patchProviderRequestIdHeaderFromSource(_0x2e40ab);if(_0x5d09e1[_0x3cde88(0x1d5)]){await writeFile(_0x1f8bbb,_0x5d09e1['source'],'utf8'),_0x294342+=0x1,_0xcba21e[_0x3cde88(0xf8)+_0x3cde88(0x318)]?.[_0x3cde88(0x2da)]?.(_0x3cde88(0x1ec)+_0x3cde88(0x221)+_0x3cde88(0x2bb)+'er\x20patch'+_0x3cde88(0x8e),{'openclawVersion':_0x27df86[_0x3cde88(0x2f4)+'Version'],'filePath':_0x1f8bbb});continue;}if(_0x5d09e1['reason']===_0x3cde88(0x111)+_0x3cde88(0x1d5))_0x52aea3+=0x1;}if(_0x294342>0x0){_0xcba21e[_0x3cde88(0xf8)+'ogger']?.['info']?.(_0x3cde88(0x1ec)+'\x20request'+'-id\x20head'+_0x3cde88(0x2c2)+_0x3cde88(0x30e),{'openclawVersion':_0x27df86[_0x3cde88(0x2f4)+_0x3cde88(0x99)],'patchedCount':_0x294342,'alreadyPatchedCount':_0x52aea3});return;}if(_0x52aea3>0x0){_0xcba21e['runtimeL'+_0x3cde88(0x318)]?.[_0x3cde88(0x2da)]?.(_0x3cde88(0x1ec)+_0x3cde88(0x221)+_0x3cde88(0x2bb)+_0x3cde88(0x2c2)+'\x20already'+_0x3cde88(0x8e),{'openclawVersion':_0x27df86['openclaw'+'Version'],'alreadyPatchedCount':_0x52aea3});return;}_0xcba21e[_0x3cde88(0xf8)+_0x3cde88(0x318)]?.[_0x3cde88(0x7f)]?.('provider'+'\x20request'+_0x3cde88(0x2bb)+'er\x20patch'+_0x3cde88(0x2ad)+';\x20provid'+_0x3cde88(0xb9)+_0x3cde88(0xf5)+_0x3cde88(0x2cc)+'nd',{'openclawVersion':_0x27df86[_0x3cde88(0x2f4)+_0x3cde88(0x99)]});}async function patchCodexIsolatedAuthRuntime(_0x18dd45,_0x30caf7,_0x3e7e96={}){const _0x40bfcc=_0x31e6db,_0x2c7a69=resolve(_0x18dd45,_0x30caf7['openclaw'+'WorkingD'+'ir']),_0x1d569c=[join(_0x2c7a69,_0x40bfcc(0xc7)),join(_0x2c7a69,_0x40bfcc(0xc7),'extensio'+'ns',_0x40bfcc(0x1a5),_0x40bfcc(0xc7))],_0x30edb9=[];for(const _0x3433c0 of _0x1d569c){const _0x171b00=await readdir(_0x3433c0,{'withFileTypes':!![]})[_0x40bfcc(0x24e)](()=>[]);for(const _0x243e14 of _0x171b00){_0x243e14[_0x40bfcc(0x2e7)]()&&_0x243e14[_0x40bfcc(0x22a)]['startsWi'+'th'](_0x40bfcc(0x97)+_0x40bfcc(0x10e))&&_0x243e14[_0x40bfcc(0x22a)][_0x40bfcc(0x10c)](_0x40bfcc(0x1a7))&&_0x30edb9[_0x40bfcc(0xdf)](join(_0x3433c0,_0x243e14['name']));}}let _0x3a21b8=0x0,_0x39225d=0x0;for(const _0x342792 of _0x30edb9){const _0x115783=await readFile(_0x342792,_0x40bfcc(0x1b8)),_0x2b0702=patchCodexIsolatedAuthFromSource(_0x115783);if(_0x2b0702[_0x40bfcc(0x1d5)]){await writeFile(_0x342792,_0x2b0702[_0x40bfcc(0x215)],_0x40bfcc(0x1b8)),_0x3a21b8+=0x1,_0x3e7e96[_0x40bfcc(0xf8)+_0x40bfcc(0x318)]?.['info']?.(_0x40bfcc(0x29a)+'olated\x20a'+_0x40bfcc(0x213)+'h\x20applie'+'d',{'openclawVersion':_0x30caf7[_0x40bfcc(0x2f4)+_0x40bfcc(0x99)],'filePath':_0x342792});continue;}if(_0x2b0702[_0x40bfcc(0x15c)]===_0x40bfcc(0x111)+_0x40bfcc(0x1d5))_0x39225d+=0x1;}if(_0x3a21b8>0x0||_0x39225d>0x0){_0x3e7e96['runtimeL'+'ogger']?.[_0x40bfcc(0x2da)]?.('codex\x20is'+'olated\x20a'+_0x40bfcc(0x213)+_0x40bfcc(0x85)+'y',{'openclawVersion':_0x30caf7[_0x40bfcc(0x2f4)+_0x40bfcc(0x99)],'patchedCount':_0x3a21b8,'alreadyPatchedCount':_0x39225d});return;}_0x3e7e96[_0x40bfcc(0xf8)+'ogger']?.[_0x40bfcc(0x7f)]?.('codex\x20is'+_0x40bfcc(0x2ba)+_0x40bfcc(0x213)+'h\x20skippe'+'d;\x20share'+'d\x20client'+_0x40bfcc(0x1cf)+_0x40bfcc(0x2c7)+'found',{'openclawVersion':_0x30caf7['openclaw'+_0x40bfcc(0x99)],'candidateFiles':_0x30edb9});}async function patchChannelPluginRuntimeBug(_0x16a273,_0x4708e0,_0x13cb6e={}){const _0x54794c=_0x31e6db,_0x19526a=resolve(_0x16a273,_0x4708e0[_0x54794c(0x2f4)+_0x54794c(0x294)+'ir']),_0x5c37db=join(_0x19526a,'dist');let _0x34d01a=[];try{_0x34d01a=await readdir(_0x5c37db,{'withFileTypes':!![]});}catch{_0x13cb6e[_0x54794c(0xf8)+'ogger']?.[_0x54794c(0x7f)]?.('channel\x20'+_0x54794c(0x2db)+_0x54794c(0x1a2)+_0x54794c(0x98)+_0x54794c(0x2ef)+_0x54794c(0x131)+_0x54794c(0x2d7),{'distDir':_0x5c37db,'openclawVersion':_0x4708e0[_0x54794c(0x2f4)+_0x54794c(0x99)]});return;}const _0xb27737=_0x34d01a[_0x54794c(0x132)](_0x392e2d=>_0x392e2d[_0x54794c(0x2e7)]()&&_0x392e2d['name'][_0x54794c(0x28d)+'th'](_0x54794c(0xfc))&&_0x392e2d[_0x54794c(0x22a)][_0x54794c(0x10c)](_0x54794c(0x1a7)))[_0x54794c(0x1e7)](_0x136ce5=>join(_0x5c37db,_0x136ce5[_0x54794c(0x22a)])),_0x5a0266=await resolveRuntimeChannelImportPath(_0x5c37db,_0x34d01a);if(_0xb27737[_0x54794c(0x118)]===0x0){_0x13cb6e[_0x54794c(0xf8)+_0x54794c(0x318)]?.['warn']?.(_0x54794c(0xfe)+'plugin\x20r'+'untime\x20p'+_0x54794c(0x98)+'pped;\x20lo'+_0x54794c(0xba)+_0x54794c(0x1b5),{'openclawVersion':_0x4708e0[_0x54794c(0x2f4)+'Version']});return;}if(!_0x5a0266){_0x13cb6e[_0x54794c(0xf8)+_0x54794c(0x318)]?.[_0x54794c(0x7f)]?.(_0x54794c(0xfe)+'plugin\x20r'+_0x54794c(0x1a2)+_0x54794c(0x98)+_0x54794c(0x2c6)+_0x54794c(0x1fb)+'annel\x20en'+_0x54794c(0x241)+_0x54794c(0xb0),{'openclawVersion':_0x4708e0['openclaw'+_0x54794c(0x99)],'distDir':_0x5c37db});return;}for(const _0x1d84f0 of _0xb27737){const _0x3ab6ab=await readFile(_0x1d84f0,_0x54794c(0x1b8)),_0x239c2f=patchChannelPluginRuntimeFromSource(_0x3ab6ab,{'runtimeChannelImportPath':_0x5a0266});if(!_0x239c2f[_0x54794c(0x1d5)]){if(_0x239c2f[_0x54794c(0x15c)]===_0x54794c(0x111)+_0x54794c(0x1d5)){_0x13cb6e[_0x54794c(0xf8)+_0x54794c(0x318)]?.['info']?.('channel\x20'+'plugin\x20r'+_0x54794c(0x1a2)+_0x54794c(0x210)+_0x54794c(0x2b1)+_0x54794c(0x10f),{'openclawVersion':_0x4708e0['openclaw'+_0x54794c(0x99)],'filePath':_0x1d84f0});return;}continue;}await writeFile(_0x1d84f0,_0x239c2f['source'],_0x54794c(0x1b8)),_0x13cb6e[_0x54794c(0xf8)+'ogger']?.[_0x54794c(0x2da)]?.(_0x54794c(0xfe)+_0x54794c(0x2db)+'untime\x20p'+_0x54794c(0x18e)+_0x54794c(0x10f),{'openclawVersion':_0x4708e0[_0x54794c(0x2f4)+'Version'],'filePath':_0x1d84f0,'note':_0x54794c(0xed)+_0x54794c(0xd7)+_0x54794c(0x1a9)+_0x54794c(0x127)+_0x54794c(0x2ab)+_0x54794c(0x287)+_0x54794c(0xfb)+_0x54794c(0x155)+'in\x20runti'+_0x54794c(0x12a)+'ng\x20chann'+_0x54794c(0xde)+'nd\x20helpe'+_0x54794c(0x32f)+'fy\x20upstr'+_0x54794c(0x313)+_0x54794c(0x2cd)+_0x54794c(0x20c)+_0x54794c(0x28b)});return;}_0x13cb6e[_0x54794c(0xf8)+_0x54794c(0x318)]?.[_0x54794c(0x7f)]?.(_0x54794c(0xfe)+'plugin\x20r'+_0x54794c(0x1a2)+_0x54794c(0x98)+_0x54794c(0x2c6)+'ntime\x20re'+'solver\x20n'+_0x54794c(0x33d),{'openclawVersion':_0x4708e0[_0x54794c(0x2f4)+_0x54794c(0x99)]});}async function patchSessionStoreSqliteRuntime(_0x4a963a,_0x1e3c0c,_0x1d6074={}){const _0x2d23c4=_0x31e6db,_0xa0862b=resolve(_0x4a963a,_0x1e3c0c[_0x2d23c4(0x2f4)+'WorkingD'+'ir']),_0x5d52da=join(_0xa0862b,_0x2d23c4(0xc7)),_0xe22a78=_0x2d23c4(0x237)+'ell-runt'+_0x2d23c4(0x14a)+_0x2d23c4(0xaa)+'time-bri'+_0x2d23c4(0x28c),_0x22e36e=join(_0x4a963a,_0x2d23c4(0x22e)+_0x2d23c4(0x254),_0x2d23c4(0x240),_0x2d23c4(0x219)+'bridge.m'+'js'),_0x22f68a=(await readdir(_0x5d52da,{'withFileTypes':!![]})[_0x2d23c4(0x24e)](()=>[]))['filter'](_0x5d9930=>_0x5d9930[_0x2d23c4(0x2e7)]()&&_0x5d9930[_0x2d23c4(0x22a)]['startsWi'+'th'](_0x2d23c4(0x25f)+_0x2d23c4(0x227))&&_0x5d9930[_0x2d23c4(0x22a)][_0x2d23c4(0x10c)](_0x2d23c4(0x1a7)))['map'](_0x434c0f=>join(_0x5d52da,_0x434c0f[_0x2d23c4(0x22a)])),_0x5476d9=(await readdir(_0x5d52da,{'withFileTypes':!![]})[_0x2d23c4(0x24e)](()=>[]))['filter'](_0x4c853f=>_0x4c853f[_0x2d23c4(0x2e7)]()&&_0x4c853f[_0x2d23c4(0x22a)][_0x2d23c4(0x28d)+'th']('store-')&&!_0x4c853f[_0x2d23c4(0x22a)][_0x2d23c4(0x28d)+'th'](_0x2d23c4(0x25f)+_0x2d23c4(0x227))&&_0x4c853f['name'][_0x2d23c4(0x10c)]('.js'))['map'](_0x3a2ce1=>join(_0x5d52da,_0x3a2ce1[_0x2d23c4(0x22a)]));if(!existsSync(_0x22e36e)){_0x1d6074['runtimeL'+_0x2d23c4(0x318)]?.['info']?.(_0x2d23c4(0x2e6)+_0x2d23c4(0x23c)+_0x2d23c4(0x21c)+_0x2d23c4(0x160)+_0x2d23c4(0xfd)+_0x2d23c4(0x9e)+_0x2d23c4(0x2c9),{'bridgePath':_0x22e36e,'openclawVersion':_0x1e3c0c[_0x2d23c4(0x2f4)+_0x2d23c4(0x99)]});return;}for(const _0x3adf51 of _0x22f68a){const _0x5d94c7=await readFile(_0x3adf51,_0x2d23c4(0x1b8)),_0x25f368=patchSessionStoreLoadFromSource(_0x5d94c7,{'bridgeImportPath':_0xe22a78});if(!_0x25f368[_0x2d23c4(0x1d5)]){if(_0x25f368['reason']==='already-'+_0x2d23c4(0x1d5)){_0x1d6074[_0x2d23c4(0xf8)+'ogger']?.[_0x2d23c4(0x2da)]?.(_0x2d23c4(0x2e6)+_0x2d23c4(0xc4)+_0x2d23c4(0x33c)+_0x2d23c4(0x13e)+_0x2d23c4(0x8e),{'filePath':_0x3adf51,'openclawVersion':_0x1e3c0c['openclaw'+'Version']});break;}continue;}await writeFile(_0x3adf51,_0x25f368[_0x2d23c4(0x215)],_0x2d23c4(0x1b8)),_0x1d6074[_0x2d23c4(0xf8)+_0x2d23c4(0x318)]?.['info']?.('session\x20'+_0x2d23c4(0xc4)+_0x2d23c4(0x33c)+_0x2d23c4(0x8e),{'filePath':_0x3adf51,'openclawVersion':_0x1e3c0c[_0x2d23c4(0x2f4)+_0x2d23c4(0x99)]});break;}for(const _0x142d0d of _0x5476d9){const _0x5b37fe=await readFile(_0x142d0d,_0x2d23c4(0x1b8)),_0x25d2a8=patchSessionStoreWriteFromSource(_0x5b37fe,{'bridgeImportPath':_0xe22a78});if(!_0x25d2a8[_0x2d23c4(0x1d5)]){if(_0x25d2a8[_0x2d23c4(0x15c)]===_0x2d23c4(0x111)+_0x2d23c4(0x1d5)){_0x1d6074[_0x2d23c4(0xf8)+_0x2d23c4(0x318)]?.[_0x2d23c4(0x2da)]?.('session\x20'+_0x2d23c4(0x26a)+'ite\x20patc'+_0x2d23c4(0x19e)+_0x2d23c4(0x2e1)+'d',{'filePath':_0x142d0d,'openclawVersion':_0x1e3c0c[_0x2d23c4(0x2f4)+_0x2d23c4(0x99)]});break;}continue;}await writeFile(_0x142d0d,_0x25d2a8[_0x2d23c4(0x215)],_0x2d23c4(0x1b8)),_0x1d6074[_0x2d23c4(0xf8)+_0x2d23c4(0x318)]?.[_0x2d23c4(0x2da)]?.(_0x2d23c4(0x2e6)+_0x2d23c4(0x26a)+_0x2d23c4(0xb7)+_0x2d23c4(0x9c)+'d',{'filePath':_0x142d0d,'openclawVersion':_0x1e3c0c[_0x2d23c4(0x2f4)+_0x2d23c4(0x99)]});break;}}async function patchWeixinOutboundSessionRoute(_0x2c6c07,_0x5d4444,_0x14226f={}){const _0x25ea51=_0x31e6db,_0x57521f=join(_0x2c6c07,_0x25ea51(0x2f4),_0x25ea51(0xc7),'extensio'+'ns',_0x25ea51(0x2f4)+_0x25ea51(0x18b),_0x25ea51(0xc7),'src',_0x25ea51(0xf9)+'js');if(!existsSync(_0x57521f)){_0x14226f['runtimeL'+_0x25ea51(0x318)]?.[_0x25ea51(0x2da)]?.(_0x25ea51(0x81)+_0x25ea51(0x2b0)+_0x25ea51(0x2e6)+'route\x20pa'+'tch\x20skip'+_0x25ea51(0x339)+'gin\x20not\x20'+_0x25ea51(0x169)+'d',{'openclawVersion':_0x5d4444[_0x25ea51(0x2f4)+_0x25ea51(0x99)],'filePath':_0x57521f});return;}const _0x59f65a=await readFile(_0x57521f,_0x25ea51(0x1b8)),_0x29d047=patchWeixinOutboundSessionRouteFromSource(_0x59f65a);if(!_0x29d047[_0x25ea51(0x1d5)]){if(_0x29d047[_0x25ea51(0x15c)]===_0x25ea51(0x111)+_0x25ea51(0x1d5)){_0x14226f['runtimeL'+_0x25ea51(0x318)]?.[_0x25ea51(0x2da)]?.(_0x25ea51(0x81)+_0x25ea51(0x2b0)+_0x25ea51(0x2e6)+_0x25ea51(0x1ab)+_0x25ea51(0xc3)+_0x25ea51(0x2d2)+'ied',{'openclawVersion':_0x5d4444['openclaw'+_0x25ea51(0x99)],'filePath':_0x57521f});return;}_0x14226f[_0x25ea51(0xf8)+_0x25ea51(0x318)]?.[_0x25ea51(0x7f)]?.('weixin\x20o'+_0x25ea51(0x2b0)+_0x25ea51(0x2e6)+_0x25ea51(0x1ab)+_0x25ea51(0x202)+'ped;\x20cha'+'nnel\x20sha'+'pe\x20not\x20f'+'ound',{'openclawVersion':_0x5d4444[_0x25ea51(0x2f4)+_0x25ea51(0x99)],'filePath':_0x57521f,'reason':_0x29d047[_0x25ea51(0x15c)]});return;}await writeFile(_0x57521f,_0x29d047[_0x25ea51(0x215)],_0x25ea51(0x1b8)),_0x14226f[_0x25ea51(0xf8)+'ogger']?.['info']?.(_0x25ea51(0x81)+_0x25ea51(0x2b0)+_0x25ea51(0x2e6)+_0x25ea51(0x1ab)+_0x25ea51(0x323)+_0x25ea51(0x83),{'openclawVersion':_0x5d4444['openclaw'+_0x25ea51(0x99)],'filePath':_0x57521f,'note':_0x25ea51(0xed)+'y\x20compat'+_0x25ea51(0x1a9)+'patch\x20fo'+_0x25ea51(0x104)+'nt-weixi'+'n/opencl'+'aw-weixi'+_0x25ea51(0x245)+_0x25ea51(0x265)+'ery\x20mirr'+_0x25ea51(0x121)+_0x25ea51(0x115)+'d\x20as\x20gro'+_0x25ea51(0x8a)+_0x25ea51(0x223)+_0x25ea51(0x325)+_0x25ea51(0x191)+_0x25ea51(0x194)+'re\x20upgra'+_0x25ea51(0x268)});}async function patchWeixinOutboundFallbackRuntime(_0x4e3368,_0x5e077e,_0x2f3a7d={}){const _0x2b75c7=_0x31e6db,_0x4c7567=resolve(_0x4e3368,_0x5e077e['openclaw'+'WorkingD'+'ir']),_0x2b1f90=join(_0x4c7567,'dist'),_0x3805cf=(await readdir(_0x2b1f90,{'withFileTypes':!![]})[_0x2b75c7(0x24e)](()=>[]))[_0x2b75c7(0x132)](_0x1f1d84=>_0x1f1d84[_0x2b75c7(0x2e7)]()&&_0x1f1d84[_0x2b75c7(0x22a)][_0x2b75c7(0x28d)+'th'](_0x2b75c7(0x28a)+_0x2b75c7(0x10b)+'-')&&_0x1f1d84[_0x2b75c7(0x22a)][_0x2b75c7(0x10c)](_0x2b75c7(0x1a7)))[_0x2b75c7(0x1e7)](_0x1cdd82=>join(_0x2b1f90,_0x1cdd82[_0x2b75c7(0x22a)]));if(_0x3805cf['length']===0x0){_0x2f3a7d['runtimeL'+_0x2b75c7(0x318)]?.[_0x2b75c7(0x7f)]?.('weixin\x20o'+'utbound\x20'+_0x2b75c7(0x198)+_0x2b75c7(0x33a)+_0x2b75c7(0x2f0)+_0x2b75c7(0x28a)+_0x2b75c7(0x216)+_0x2b75c7(0x2cc)+'nd',{'openclawVersion':_0x5e077e[_0x2b75c7(0x2f4)+'Version'],'distDir':_0x2b1f90});return;}for(const _0x5b6b06 of _0x3805cf){const _0x564bbb=await readFile(_0x5b6b06,_0x2b75c7(0x1b8)),_0x536454=patchWeixinOutboundFallbackFromSource(_0x564bbb);if(!_0x536454[_0x2b75c7(0x1d5)]){if(_0x536454['reason']==='already-'+_0x2b75c7(0x1d5)){_0x2f3a7d['runtimeL'+_0x2b75c7(0x318)]?.[_0x2b75c7(0x2da)]?.(_0x2b75c7(0x81)+_0x2b75c7(0x2b0)+_0x2b75c7(0x198)+_0x2b75c7(0x1bc)+_0x2b75c7(0x16e)+_0x2b75c7(0x122),{'openclawVersion':_0x5e077e[_0x2b75c7(0x2f4)+_0x2b75c7(0x99)],'filePath':_0x5b6b06});return;}continue;}await writeFile(_0x5b6b06,_0x536454['source'],'utf8'),_0x2f3a7d[_0x2b75c7(0xf8)+_0x2b75c7(0x318)]?.['info']?.(_0x2b75c7(0x81)+'utbound\x20'+_0x2b75c7(0x198)+_0x2b75c7(0x1bc)+'pplied',{'openclawVersion':_0x5e077e['openclaw'+_0x2b75c7(0x99)],'filePath':_0x5b6b06,'note':_0x2b75c7(0xed)+_0x2b75c7(0xd7)+_0x2b75c7(0x1a9)+_0x2b75c7(0x127)+'rcing\x20op'+_0x2b75c7(0x2b6)+_0x2b75c7(0x1d9)+_0x2b75c7(0x195)+_0x2b75c7(0x87)+_0x2b75c7(0xbc)+_0x2b75c7(0x2d0)+_0x2b75c7(0x247)+_0x2b75c7(0x181)+_0x2b75c7(0x279)+_0x2b75c7(0xa0)+_0x2b75c7(0x11e)+_0x2b75c7(0x105)});return;}_0x2f3a7d[_0x2b75c7(0xf8)+'ogger']?.[_0x2b75c7(0x7f)]?.(_0x2b75c7(0x81)+'utbound\x20'+_0x2b75c7(0x198)+_0x2b75c7(0x33a)+_0x2b75c7(0x2f0)+_0x2b75c7(0x2f1)+'\x20shape\x20n'+_0x2b75c7(0x33d),{'openclawVersion':_0x5e077e[_0x2b75c7(0x2f4)+_0x2b75c7(0x99)]});}function _0x5a9f(){const _0x3752a6=['Name','vailable','leName','load:\x20','\x20not\x20fou','on\x20futur','n\x20the\x20di','eady\x20cur','s\x20to\x20dir','syncOnly','ady\x20appl','IPT_DIR=','required','Run\x20\x22wuj','ed\x20npm\x20p','ound','transcri','path:\x20','info','plugin\x20r','STATE_DI','ready\x20ap','&&\x20pwd)','tory\x20mix','flow;\x20ve','y\x20applie','agents\x20s','sion\x20val','json','\x20paths','session\x20','isFile','add',':\x20manife','led','out\x20c2c\x20','TRY','PT_DIR/w','product\x20','pped;\x20di','kipped;\x20','resolver','go.mjs','optional','openclaw','\x20doctor\x20','rg/dist/','--omit=p','6\x20mixed\x20','Duplicat','platform','ase64\x20st','dataDirN','_SHELL_E','red','ecs','e\x20not\x20fo','H%\x22==\x22\x22\x20','/node','package','achment\x20','extensio','ory','e_module','leted','time-bac','13384464hrApPz','bug;\x20ver','Extracte','JSON:\x20','\x20summary','extract\x20','\x20create\x20','npm','size','eam\x20fix\x20','some','string','--json','ujie-log','ogger','createRu','--legacy','[wujie-s','NCLAW_CO','download','und','integrit','zip','HOME=\x22${','rchive\x20-','tch\x20appl','time-too','ify\x20upst','allowMis','OME=','index.mj','NFIG_PAT','now','--no-aud','npm\x20pack','roductRu','utable','rs;\x20veri','time]\x20do','efore\x20pa','lugin\x20','ame','ATH:-','install','\x22\x20at\x20','bridge\x20n','lugin\x20de','ped;\x20plu','\x20patch\x20s','resolved','ad\x20patch','ot\x20found','allback\x20','warn','\x20package','weixin\x20o','dAt','ied','LocalPlu','h\x20summar','keys','\x20outboun','npm\x20plug','join','up\x20sessi','age\x20was\x20','OOT\x20-For','w.cmd','\x20applied','toString','untime-b','PENCLAW_','OPENCLAW','/opencla','vel\x20entr','IR=$(CDP','--fix','shared-c','atch\x20ski','Version','e\x20plugin','tching\x20p','h\x20applie','CONFIG_P','ge\x20not\x20a','ted','\x20routing','ENCLAW_H','.plugin-','s/npm','oot','octor\x20--','Bin','node/lib','s\x20instal','toISOStr','ions/run','114WqvWvZ','missing\x20','ODE\x22\x20\x22$S','play-pro','indexOf','found','red\x20Node','ure\x20upgr','?t=','registry','extract-','\x20version','ite\x20patc','sion\x20mis','er\x20respo','ader\x20not','split','d\x20mirror','lib','connecto','38801vYzznj','doctor','\x20return\x20','LocalAge','tch\x20alre','store\x20lo','\x20-z\x20\x22$WU','ced','dist','configFi','director','pped;\x20fu','1\x20]\x20&&\x20[','jection-','scoped\x20s','est-id/r','node_mod','agent','qqbot\x20ou','LocalSki','\x22\x20\x22$@\x22','\x20\x22%SCRIP','object','ntPaths','y\x20compat','config=','powershe','wujiecla','G_FILE_N','../../as','pack','el.inbou','push','isDirect',',\x20shell.','pluginId','local\x20pl','dataDir','fix\x20mark','href','XTRACT_R','-Command','node\x20ver','HIVE\x20-De','tall\x20the','plugins','Temporar','ackup','tar','UNTIME_N','rify\x20ups','not\x20foun','npm\x20inst','_STATE_D','nse\x20hook','ath\x20$env','tbound\x20d','runtimeL','channel.','NODE=\x22$S','6.6\x20chan','loader-','ed;\x20brid','channel\x20','NPM_CONF','\x20timed\x20o','-peer-de','ion\x20mism','ing\x20\x22','r\x20@tence','ailable.','cal\x20runt','\x20complet','flush','time]\x20in','\x20failed\x20','-session','endsWith','being\x20in','lient-','lied','\x20can\x20ins','already-','CLAW_CON','then','wujieai.','g\x20indexe','nnel','\x20depende','length','24292CuJfkN','ack\x20over','dy\x20appli','m-cli.js','\x20kdocs\x20s','\x20is\x20unav','unknown','.json','ors\x20bein','pplied','nced','wujie-lo','s/npm/bi','replaceA','patch\x20fo','pipe','law\x20','me\x20missi','pruned\x20r','tarball:','function','@echo\x20of','_NAME:-','env','st\x20not\x20f','filter','/npm','\x20\x20\x22$RUNT','ATH=\x22${O','lock.jso','lugins\x20s','ginPaths','Bot\x20c2c\x20','d\x20an\x20inv','with\x20the','-Executi','#!/bin/s','\x20already','https://','ayload\x20b','tar.xz','tests','8bywZnV','log','statusCo','o.mjs\x22\x202','-doctor.','request-','\x20loaded','ime/sess','eted','d\x20to\x20','\x20path\x20wa','law/qqbo','Invalid\x20','aipc-dow','npm\x20root','\x20resolve','\x20prepare','npmCli','nel\x20plug','product','cope\x20syn','wBin','path','ades.','ing','reason','ATH=\x20cd\x20','onPolicy','has','ch\x20skipp','dules/np','ed-tool\x20','.cache','.tools','local','npm-glob','und:\x20','\x22\x20so\x20the','installe','4981260ScVqod','null','arm64','node','lready\x20a','Expand-A','eer','kup','Dependen','devDepen','test','>/dev/nu','generate','aipc-run','_shared','shift','Claw','\x20can\x20be\x20','.d.ts','chat\x20his','HELL_ARC','ignore','-xzf','ions\x20whe','th\x20c2c\x20i','synced','t\x20c2c\x20ou','tbound\x20s','ut\x20after','match','headers','ile\x20not\x20','RUNTIME_','-weixin','projectR','idated','atch\x20app','lize-','if\x20\x22%OPE','ream\x20fix','rcing\x20QQ','spec','\x20on\x20futu','m.wechat','export\x20O','node/bin','fallback','ATE_DIR:','all\x20loca','all\x20plug','i.js','LAW_STAT','h\x20alread','nt-norma','chat\x20att','bin','untime\x20p','104DOeeSb','llPaths','codex','x64','.js','runtimeR','ibility\x20','empty\x20pl','route\x20pa','ugin\x20dep','stinatio','nloads-b','/node_mo','\x20synced','data','unction\x20','-xJf','lark-cli','\x20found','--\x20\x22$(di','bytes','utf8','AME=','14640CppkkE','ncies','\x20patch\x20a','configPa','==\x22\x22\x20set','agentSco','d\x20for\x20lo','ch\x20appli','ies','ed;\x20plug','hell:run','set\x20\x22OPE','tbound\x20f','ules/npm','esolver\x20','appId','able','26CdBnId','ady\x20curr','R=\x22${OPE','base\x20alr','\x20auth\x20sh','nd\x20after','location','.markdow','resume','ugin\x20spe','patched','TIME_NOD','alid\x20pay','kill\x20not','eixin\x20@i','w.mjs','\x22==\x22\x22\x20se','time','scripts','example','ILE_NAME','\x20\x22$0\x22)\x22\x20','kill','CRIPT_DI','isArray','_modules','\x20bin\x20was','ime\x20buil','map','7348023fYGzTA','pid','shasum','fix','provider','shape\x20no','mjs','patch\x20sk','plied','x\x20on\x20fut','nv:WUJIE','pec:\x20','\x20and\x20','red\x20Open','1545764xqdeCV','base\x20bui','6ULWScV','untime\x20c','importan','ntime\x20ch','error','skills','productN','ch\x20alrea','jection\x20','\x20id\x20from','tch\x20skip','\x20validat','label','every','session-','installP','timeoutM','e\x20tools\x20','rebuilt\x20','NFIG_FIL','e\x20upgrad','plugins\x20','runtime\x20','er\x20id.','atch\x20alr','wnloadin','\x20to\x20dire','uth\x20patc','slice','source','\x20runtime','prefix\x20i','r\x20runtim','runtime-','win32','filename','lite\x20pat','.tmp/run','ME%\x22==\x22\x22','npm-cli.','mirrors\x20','\x20request','\x20\x22OPENCL','ons;\x20ver','--no-fun','AW_CONFI','r\x20@openc','ad-','y:\x20','\x20mirrors','name','tory\x20pro','claw-run','-extract','shell-ru','nodeVers','(empty)','exec','ynced','SIGTERM','ipped;\x20o','ed;\x20chan','execPath','../../sh','docs','set\x20\x22SCR','tream\x20fi','ession\x20r','store\x20sq','arch','d\x20Node\x20r','agents','sessions','try\x20not\x20','base64\x20p','ll.exe','get','n\x20outbou','entryCou','ect\x20sess','_HOME:-','prepareP','NCLAW_HO','Bypass','l\x20plugin','nPath\x20$e','catch','d:\x20','referenc','runtimeS','channel-','\x22\x20\x22$SCRI','ntime','\x20started','OpenClaw','doc','40ydJIdu','started','nction\x20n','id\x20title','stdout','ipped;\x20f','configur','store-lo','lib/node','node.exe','dencies','e.exe','ache\x20bef','nd\x20deliv','includes','ridge.mj','des.','in\x20','store\x20wr','-NoProfi','skipped;','ion','find','le\x20not\x20f','ld\x20compl','dexed\x20wi','close','ime/requ','version','man','in\x20not\x20i','npm-cach','node/nod','n\x20plugin','versions','pluginSp','es\x20','sets/wuj','__tests_','local:','all\x20','st\x20be\x20a\x20','nstalled','skill','ase','lled','stderr','aw\x202026.','nodeExec','\x5cwjrt-','outbound','es.','dge.mjs','startsWi','replace','m/bin/np','patch\x20ap','singOpen','\x20configu','trim','WorkingD','\x20install','\x20did\x20not','\x20entry\x20\x22','E_NAME%\x22','d\x20for\x20','codex\x20is','win','NCLAW_ST','n\x20the\x20pe','LiteralP','o\x20resolv','--omit=d','jie-shel','values','cies','dependen','patch\x20al','\x20set\x20\x22OP','T_DIR%','PATH','prepare\x20','skills\x20s','r\x20OpenCl',';\x20dist\x20n','\x20skipped','ath','ules','utbound\x20','eady\x20app','package.','manifest','root','.npmmirr','enclaw-w',';\x20run\x20wu','in\x20insta','ipped;\x20d','olated\x20a','-id\x20head','ed\x20OpenC','\x22\x20%*','CONFIG_F','ore\x20pack','time]\x20ru','oute\x20pat','er\x20patch','rect\x20pee','\x20-g','ipped;\x20r','pped;\x20ru','ape\x20not\x20'];_0x5a9f=function(){return _0x3752a6;};return _0x5a9f();}async function patchRequestIdTitleRuntime(_0x47a64d,_0x46b23a,_0x1aaa8c={}){const _0x4b22e6=_0x31e6db,_0x5771ce=resolve(_0x47a64d,_0x46b23a[_0x4b22e6(0x2f4)+'WorkingD'+'ir']),_0x466e44=join(_0x5771ce,_0x4b22e6(0xc7)),_0x5ee310=_0x4b22e6(0x237)+'ell-runt'+_0x4b22e6(0x273)+_0x4b22e6(0xce)+_0x4b22e6(0x90)+_0x4b22e6(0x267)+'s',_0x3ea7c9=join(_0x47a64d,_0x4b22e6(0x22e)+_0x4b22e6(0x254),_0x4b22e6(0x148)+'id',_0x4b22e6(0x219)+'bridge.m'+'js');if(!existsSync(_0x3ea7c9)){_0x1aaa8c[_0x4b22e6(0xf8)+_0x4b22e6(0x318)]?.['info']?.(_0x4b22e6(0x148)+'id\x20title'+_0x4b22e6(0x216)+_0x4b22e6(0x33a)+_0x4b22e6(0x2f0)+_0x4b22e6(0x337)+'ot\x20avail'+_0x4b22e6(0x1ca),{'bridgePath':_0x3ea7c9,'openclawVersion':_0x46b23a['openclaw'+_0x4b22e6(0x99)]});return;}const _0x281ddc=(await readdir(_0x466e44,{'withFileTypes':!![]})['catch'](()=>[]))['filter'](_0x1d6c6d=>_0x1d6c6d[_0x4b22e6(0x2e7)]()&&_0x1d6c6d[_0x4b22e6(0x22a)][_0x4b22e6(0x28d)+'th']('loader-')&&_0x1d6c6d[_0x4b22e6(0x22a)][_0x4b22e6(0x10c)](_0x4b22e6(0x1a7)))[_0x4b22e6(0x1e7)](_0x37903e=>join(_0x466e44,_0x37903e[_0x4b22e6(0x22a)]));for(const _0x248c89 of _0x281ddc){const _0x5da0ed=await readFile(_0x248c89,_0x4b22e6(0x1b8)),_0xcb2980=patchRequestIdTitleRuntimeFromSource(_0x5da0ed,{'bridgeImportPath':_0x5ee310});if(!_0xcb2980[_0x4b22e6(0x1d5)]){if(_0xcb2980[_0x4b22e6(0x15c)]==='already-'+_0x4b22e6(0x1d5)){_0x1aaa8c[_0x4b22e6(0xf8)+'ogger']?.[_0x4b22e6(0x2da)]?.('request-'+_0x4b22e6(0x25b)+_0x4b22e6(0x216)+_0x4b22e6(0x1bc)+_0x4b22e6(0x16e)+'pplied',{'filePath':_0x248c89,'openclawVersion':_0x46b23a[_0x4b22e6(0x2f4)+'Version']});break;}continue;}await writeFile(_0x248c89,_0xcb2980[_0x4b22e6(0x215)],_0x4b22e6(0x1b8)),_0x1aaa8c[_0x4b22e6(0xf8)+_0x4b22e6(0x318)]?.[_0x4b22e6(0x2da)]?.('request-'+_0x4b22e6(0x25b)+'\x20runtime'+_0x4b22e6(0x1bc)+_0x4b22e6(0x122),{'filePath':_0x248c89,'openclawVersion':_0x46b23a[_0x4b22e6(0x2f4)+_0x4b22e6(0x99)]});break;}}async function patchQQBotOutboundFallbackRuntime(_0x5ce16e,_0x1bb7e2,_0x1e2e0c={}){const _0x275e6a=_0x31e6db,_0x1b90cf=resolve(_0x5ce16e,_0x1bb7e2['openclaw'+_0x275e6a(0x294)+'ir']),_0x1696bd=join(_0x1b90cf,'dist'),_0x33b863=(await readdir(_0x1696bd,{'withFileTypes':!![]})[_0x275e6a(0x24e)](()=>[]))[_0x275e6a(0x132)](_0x5033ff=>_0x5033ff[_0x275e6a(0x2e7)]()&&_0x5033ff[_0x275e6a(0x22a)][_0x275e6a(0x28d)+'th'](_0x275e6a(0x28a)+_0x275e6a(0x10b)+'-')&&_0x5033ff[_0x275e6a(0x22a)][_0x275e6a(0x10c)](_0x275e6a(0x1a7)))['map'](_0x4f9a8e=>join(_0x1696bd,_0x4f9a8e[_0x275e6a(0x22a)]));if(_0x33b863['length']===0x0){_0x1e2e0c[_0x275e6a(0xf8)+_0x275e6a(0x318)]?.[_0x275e6a(0x7f)]?.(_0x275e6a(0xd1)+_0x275e6a(0x1c6)+_0x275e6a(0x33e)+_0x275e6a(0x1ef)+_0x275e6a(0x234)+'utbound\x20'+_0x275e6a(0x20e)+_0x275e6a(0xf2)+'d',{'openclawVersion':_0x1bb7e2[_0x275e6a(0x2f4)+_0x275e6a(0x99)],'distDir':_0x1696bd});return;}for(const _0x31d5f1 of _0x33b863){const _0x1299e1=await readFile(_0x31d5f1,_0x275e6a(0x1b8)),_0x129bb4=patchQQBotOutboundFallbackFromSource(_0x1299e1);if(!_0x129bb4[_0x275e6a(0x1d5)]){if(_0x129bb4[_0x275e6a(0x15c)]===_0x275e6a(0x111)+_0x275e6a(0x1d5)){_0x1e2e0c['runtimeL'+_0x275e6a(0x318)]?.[_0x275e6a(0x2da)]?.('qqbot\x20ou'+'tbound\x20f'+_0x275e6a(0x33e)+'patch\x20al'+_0x275e6a(0x2dd)+_0x275e6a(0x1f0),{'openclawVersion':_0x1bb7e2[_0x275e6a(0x2f4)+_0x275e6a(0x99)],'filePath':_0x31d5f1});return;}continue;}await writeFile(_0x31d5f1,_0x129bb4['source'],'utf8'),_0x1e2e0c['runtimeL'+_0x275e6a(0x318)]?.[_0x275e6a(0x2da)]?.(_0x275e6a(0xd1)+'tbound\x20f'+_0x275e6a(0x33e)+_0x275e6a(0x290)+'plied',{'openclawVersion':_0x1bb7e2['openclaw'+_0x275e6a(0x99)],'filePath':_0x31d5f1,'note':_0x275e6a(0xed)+_0x275e6a(0xd7)+'ibility\x20'+_0x275e6a(0x127)+_0x275e6a(0x192)+_0x275e6a(0x139)+_0x275e6a(0x28a)+_0x275e6a(0x229)+_0x275e6a(0x212)+'ct\x20sessi'+'ons\x20with'+_0x275e6a(0x2eb)+_0x275e6a(0x217)+_0x275e6a(0x29d)+_0x275e6a(0x20f)});return;}_0x1e2e0c['runtimeL'+_0x275e6a(0x318)]?.[_0x275e6a(0x7f)]?.(_0x275e6a(0xd1)+'tbound\x20f'+'allback\x20'+_0x275e6a(0x1ef)+_0x275e6a(0x2c5)+_0x275e6a(0x1c8)+_0x275e6a(0x1ed)+'t\x20found',{'openclawVersion':_0x1bb7e2['openclaw'+_0x275e6a(0x99)]});}async function patchQQBotOutboundSessionRoute(_0x2129d2,_0x100c07,_0x402ab8={}){const _0x4c1824=_0x31e6db,_0x54e858=join(_0x2129d2,_0x4c1824(0x2f4),_0x4c1824(0xc7),_0x4c1824(0x305)+'ns','qqbot',_0x4c1824(0xc7));if(!existsSync(_0x54e858)){_0x402ab8['runtimeL'+_0x4c1824(0x318)]?.['info']?.(_0x4c1824(0xd1)+'tbound\x20s'+_0x4c1824(0x23b)+'oute\x20pat'+_0x4c1824(0x160)+_0x4c1824(0x1c3)+_0x4c1824(0x276)+_0x4c1824(0x282),{'openclawVersion':_0x100c07[_0x4c1824(0x2f4)+'Version'],'distDir':_0x54e858});return;}const _0x38673f=(await readdir(_0x54e858,{'withFileTypes':!![]})[_0x4c1824(0x24e)](()=>[]))['filter'](_0x48b10a=>_0x48b10a[_0x4c1824(0x2e7)]()&&_0x48b10a[_0x4c1824(0x22a)]['endsWith']('.js'))[_0x4c1824(0x1e7)](_0x22c077=>join(_0x54e858,_0x22c077[_0x4c1824(0x22a)]));for(const _0x1bf2fd of _0x38673f){const _0x51860c=await readFile(_0x1bf2fd,'utf8'),_0x767e97=patchQQBotOutboundSessionRouteFromSource(_0x51860c);if(!_0x767e97[_0x4c1824(0x1d5)]){if(_0x767e97[_0x4c1824(0x15c)]==='already-'+_0x4c1824(0x1d5)){_0x402ab8['runtimeL'+_0x4c1824(0x318)]?.['info']?.(_0x4c1824(0xd1)+'tbound\x20s'+_0x4c1824(0x23b)+_0x4c1824(0x2c1)+_0x4c1824(0x1ff)+_0x4c1824(0x11b)+'ed',{'openclawVersion':_0x100c07[_0x4c1824(0x2f4)+'Version'],'filePath':_0x1bf2fd});return;}continue;}await writeFile(_0x1bf2fd,_0x767e97[_0x4c1824(0x215)],_0x4c1824(0x1b8)),_0x402ab8[_0x4c1824(0xf8)+_0x4c1824(0x318)]?.[_0x4c1824(0x2da)]?.(_0x4c1824(0xd1)+'tbound\x20s'+_0x4c1824(0x23b)+_0x4c1824(0x2c1)+_0x4c1824(0x1c1)+'ed',{'openclawVersion':_0x100c07[_0x4c1824(0x2f4)+_0x4c1824(0x99)],'filePath':_0x1bf2fd,'note':_0x4c1824(0xed)+_0x4c1824(0xd7)+_0x4c1824(0x1a9)+_0x4c1824(0x127)+_0x4c1824(0x226)+_0x4c1824(0x14e)+_0x4c1824(0x184)+_0x4c1824(0xf7)+'elivery\x20'+_0x4c1824(0x220)+_0x4c1824(0x10d)+_0x4c1824(0x271)+_0x4c1824(0x182)+_0x4c1824(0x2ce)+_0x4c1824(0x2c3)+'r\x20id.'});return;}_0x402ab8[_0x4c1824(0xf8)+_0x4c1824(0x318)]?.['warn']?.('qqbot\x20ou'+_0x4c1824(0x185)+_0x4c1824(0x23b)+_0x4c1824(0x2c1)+_0x4c1824(0x160)+_0x4c1824(0x235)+'nel\x20shap'+_0x4c1824(0x300)+_0x4c1824(0x31e),{'openclawVersion':_0x100c07[_0x4c1824(0x2f4)+_0x4c1824(0x99)],'distDir':_0x54e858});}async function resolveRuntimeChannelImportPath(_0x29f3e6,_0x6a2840){const _0x4f9d4d=_0x31e6db,_0x57eda4=_0x6a2840[_0x4f9d4d(0x132)](_0x7ab536=>_0x7ab536[_0x4f9d4d(0x2e7)]()&&_0x7ab536[_0x4f9d4d(0x22a)][_0x4f9d4d(0x28d)+'th'](_0x4f9d4d(0x219)+_0x4f9d4d(0x252))&&_0x7ab536[_0x4f9d4d(0x22a)][_0x4f9d4d(0x10c)]('.js')&&!_0x7ab536[_0x4f9d4d(0x22a)]['startsWi'+'th']('runtime-'+_0x4f9d4d(0x252)+'state-'))[_0x4f9d4d(0x1e7)](_0x289cec=>_0x289cec[_0x4f9d4d(0x22a)])['sort']();for(const _0x51764e of _0x57eda4){const _0x1c93b3=await readFile(join(_0x29f3e6,_0x51764e),_0x4f9d4d(0x1b8));if(_0x1c93b3[_0x4f9d4d(0x266)](_0x4f9d4d(0x319)+'ntimeCha'+_0x4f9d4d(0x116)))return'./'+_0x51764e;}return null;}function normalizeRuntimeRelativePath(_0x3e4211){const _0x22a5fe=_0x31e6db;return _0x3e4211[_0x22a5fe(0x126)+'ll']('\x5c','/');}function toWindowsPath(_0x510ee7){return _0x510ee7['replaceA'+'ll']('/','\x5c');}function validateRuntimeNodeVersion(_0x2da79e,_0x34ff30){const _0x45ac3d=_0x31e6db;if(_0x2da79e[_0x45ac3d(0x22f)+_0x45ac3d(0x26d)]===_0x34ff30[_0x45ac3d(0x2f4)][_0x45ac3d(0x22f)+_0x45ac3d(0x26d)])return;throw new Error('runtime\x20'+_0x45ac3d(0x22f)+_0x45ac3d(0x102)+'atch:\x20ma'+'nifest='+(_0x2da79e['nodeVers'+'ion']||'unknown')+(_0x45ac3d(0xe1)+_0x45ac3d(0xd8))+_0x34ff30['openclaw'][_0x45ac3d(0x22f)+_0x45ac3d(0x26d)]+'.\x20'+('Run\x20\x22wuj'+'ie-shell'+'\x20prepare'+_0x45ac3d(0x168)+'\x20product'+_0x45ac3d(0x216)+_0x45ac3d(0x17b)+_0x45ac3d(0x20a)+_0x45ac3d(0x13b)+_0x45ac3d(0x292)+_0x45ac3d(0xb1)+_0x45ac3d(0xb6)+'.'));}function validateRuntimeOpenClawVersion(_0x294230,_0x520ab4){const _0x4f925c=_0x31e6db;if(_0x294230[_0x4f925c(0x2f4)+_0x4f925c(0x99)]===_0x520ab4[_0x4f925c(0x2f4)]['openclaw'+'Version'])return;throw new Error(_0x4f925c(0x20e)+'openclaw'+'Version\x20'+'mismatch'+_0x4f925c(0x2e9)+'st='+(_0x294230[_0x4f925c(0x2f4)+_0x4f925c(0x99)]||_0x4f925c(0x11f))+(',\x20shell.'+'config=')+_0x520ab4[_0x4f925c(0x2f4)][_0x4f925c(0x2f4)+_0x4f925c(0x99)]+'.\x20'+(_0x4f925c(0x2d5)+'ie-shell'+_0x4f925c(0x153)+_0x4f925c(0x168)+'\x20runtime'+_0x4f925c(0x110)+_0x4f925c(0xeb)+_0x4f925c(0x292)+_0x4f925c(0x1f5)+'Claw\x20ver'+'sion.'));}function parseNpmPackJson(_0x2894c7){const _0x26c1f0=_0x31e6db,_0x1ee806=_0x2894c7[_0x26c1f0(0x293)](),_0x3ac103=_0x1ee806[_0x26c1f0(0xaf)]('[');if(_0x3ac103<0x0)throw new Error(_0x26c1f0(0x32c)+_0x26c1f0(0x296)+_0x26c1f0(0xc1)+_0x26c1f0(0x30d)+_0x1ee806[_0x26c1f0(0x214)](0x0,0x1f4));const _0x41bd2e=JSON['parse'](_0x1ee806[_0x26c1f0(0x214)](_0x3ac103)),_0x43a965=Array[_0x26c1f0(0x1e3)](_0x41bd2e)?_0x41bd2e[0x0]:_0x41bd2e;if(!_0x43a965||typeof _0x43a965!==_0x26c1f0(0xd5))throw new Error('npm\x20pack'+'\x20returne'+_0x26c1f0(0x13a)+_0x26c1f0(0x1d7)+_0x26c1f0(0x2cb)+_0x1ee806[_0x26c1f0(0x214)](0x0,0x1f4));return _0x43a965;}function normalizePackedTarballFilename(_0xc04141){const _0x35b76d=_0x31e6db;return _0xc04141['replace'](/^@/,'')[_0x35b76d(0x126)+'ll']('/','-')[_0x35b76d(0x126)+'ll']('\x5c','-');}function _0x3914(_0x35481d,_0xf78ef0){_0x35481d=_0x35481d-0x7f;const _0x5a9f63=_0x5a9f();let _0x391488=_0x5a9f63[_0x35481d];return _0x391488;}async function runProcess(_0x3b2fea,_0x16360d,_0x15e4d1={}){const _0x1db66e=_0x31e6db,_0x396162=_0x15e4d1[_0x1db66e(0x204)]||[_0x3b2fea,..._0x16360d][_0x1db66e(0x89)]('\x20'),_0x49a5fd=_0x15e4d1[_0x1db66e(0x208)+'s']??NPM_INSTALL_TIMEOUT_MS,_0x5e6cff=spawn(_0x3b2fea,_0x16360d,{'cwd':_0x15e4d1['cwd'],'env':_0x15e4d1[_0x1db66e(0x130)],'stdio':[_0x1db66e(0x17f),'pipe',_0x1db66e(0x128)]});return await new Promise((_0x137643,_0x390690)=>{const _0x51aa94=_0x1db66e;let _0x2fd07e='',_0x59ca4e='',_0x5d9350=![];const _0x517436=setTimeout(()=>{const _0x647185=_0x3914;if(_0x5d9350)return;_0x5d9350=!![],_0x5e6cff[_0x647185(0x1e1)]('SIGTERM'),_0x390690(new Error(_0x396162+(_0x647185(0x100)+_0x647185(0x186)+'\x20')+_0x49a5fd+'ms'));},_0x49a5fd);_0x5e6cff[_0x51aa94(0x25c)]['on']('data',_0x48b2f4=>{const _0x369fc2=_0x51aa94;_0x2fd07e+=_0x48b2f4[_0x369fc2(0x8f)]();}),_0x5e6cff['stderr']['on']('data',_0x4aa0d9=>{_0x59ca4e+=_0x4aa0d9['toString']();}),_0x5e6cff['on'](_0x51aa94(0x1fc),_0x509954=>{if(_0x5d9350)return;_0x5d9350=!![],clearTimeout(_0x517436),_0x390690(_0x509954);}),_0x5e6cff['on'](_0x51aa94(0x272),(_0x586639,_0x22e4b6)=>{const _0x45e64c=_0x51aa94;if(_0x5d9350)return;_0x5d9350=!![],clearTimeout(_0x517436);if(_0x586639===0x0){_0x137643({'stdout':_0x2fd07e,'stderr':_0x59ca4e});return;}_0x390690(new Error(_0x396162+(_0x45e64c(0x10a)+'with\x20cod'+'e=')+(_0x586639??_0x45e64c(0x16b))+'\x20signal='+(_0x22e4b6??_0x45e64c(0x16b))+'\x0a'+(''+(_0x59ca4e||_0x2fd07e))[_0x45e64c(0x293)]()));});});}async function installOpenClawPackage(_0x8b33bc,_0x3a3f99){const _0x17a2bb=_0x31e6db,_0x4e0de6=join(_0x8b33bc[_0x17a2bb(0x1a8)+'oot'],_0x17a2bb(0x163)),_0x5c7cd9=join(_0x8b33bc[_0x17a2bb(0x1a8)+_0x17a2bb(0xa4)],'.opencla'+'w-extrac'+'t');await mkdir(_0x4e0de6,{'recursive':!![]}),await removePathWithRetries(_0x5c7cd9),await mkdir(_0x5c7cd9,{'recursive':!![]});const _0x27edab=await createRuntimeEnv(_0x8b33bc),_0x964e1e=_0x17a2bb(0x2f4)+'@'+_0x3a3f99;console[_0x17a2bb(0x144)]('[wujie-s'+_0x17a2bb(0x1c4)+'time]\x20in'+'stalling'+'\x20'+_0x964e1e);const _0x2ef49f=await runProcess(_0x8b33bc[_0x17a2bb(0x288)+_0x17a2bb(0x32e)],[_0x8b33bc[_0x17a2bb(0x154)],_0x17a2bb(0xdd),_0x964e1e,_0x17a2bb(0x316)],{'cwd':_0x4e0de6,'env':_0x27edab,'label':_0x17a2bb(0x32c)+'\x20'+_0x964e1e}),_0x55a1fe=parseNpmPackJson(_0x2ef49f[_0x17a2bb(0x25c)]);if(_0x55a1fe[_0x17a2bb(0x274)]!==_0x3a3f99)throw new Error('Configur'+_0x17a2bb(0x2bc)+_0x17a2bb(0x129)+_0x3a3f99+(_0x17a2bb(0x152)+_0x17a2bb(0x14c))+_0x55a1fe[_0x17a2bb(0x274)]);const _0xfb5ccc=resolve(_0x4e0de6,_0x55a1fe['filename']);if(!existsSync(_0xfb5ccc))throw new Error(_0x17a2bb(0x32c)+'\x20did\x20not'+_0x17a2bb(0x310)+'tarball:'+'\x20'+_0xfb5ccc);await runProcess(_0x17a2bb(0xef),[_0x17a2bb(0x180),_0xfb5ccc,'-C',_0x5c7cd9],{'label':_0x17a2bb(0x30f)+_0x55a1fe[_0x17a2bb(0x21b)]}),await removePathWithRetries(_0x8b33bc[_0x17a2bb(0x2f4)+'WorkingD'+'ir']),await rename(join(_0x5c7cd9,_0x17a2bb(0x303)),_0x8b33bc[_0x17a2bb(0x2f4)+_0x17a2bb(0x294)+'ir']),await removePathWithRetries(_0x5c7cd9),await runProcess(_0x8b33bc[_0x17a2bb(0x288)+'utable'],[_0x8b33bc[_0x17a2bb(0x154)],'install',_0x17a2bb(0x2a0)+'ev','--omit=p'+_0x17a2bb(0x170),_0x17a2bb(0x32b)+'it','--no-fun'+'d','--legacy'+'-peer-de'+'ps'],{'cwd':_0x8b33bc[_0x17a2bb(0x2f4)+_0x17a2bb(0x294)+'ir'],'env':_0x27edab,'label':_0x17a2bb(0xf3)+_0x17a2bb(0x280)+_0x964e1e+(_0x17a2bb(0x216)+_0x17a2bb(0x117)+_0x17a2bb(0x1bb))});if(!existsSync(_0x8b33bc[_0x17a2bb(0x2f4)+'Bin']))throw new Error(_0x17a2bb(0x256)+_0x17a2bb(0x1e5)+_0x17a2bb(0x2cc)+_0x17a2bb(0x1d0)+_0x17a2bb(0x295)+':\x20'+_0x8b33bc['openclaw'+'Bin']);}async function ensureRuntimeBase(_0x23e678,_0x2c4194,_0x11e850={}){const _0x1196bf=_0x31e6db;await mkdir(_0x2c4194,{'recursive':!![]});let _0x15415b=await readRuntimeManifest(_0x2c4194);const _0x4e3bd4=_0x23e678[_0x1196bf(0x2f4)][_0x1196bf(0x22f)+'ion'],_0x51c7b8=_0x23e678['openclaw'][_0x1196bf(0x2f4)+_0x1196bf(0x99)],_0x30a01f=existsSync(resolveManifestPath(_0x2c4194)),_0x2e3c1c=runtimeHasRequiredPaths(_0x2c4194,_0x15415b),_0x4e5d8a=_0x15415b[_0x1196bf(0x22f)+_0x1196bf(0x26d)]===_0x4e3bd4;!_0x30a01f||!_0x2e3c1c||!_0x4e5d8a?(_0x11e850[_0x1196bf(0xf8)+'ogger']?.['importan'+'t']?.('runtime\x20'+_0x1196bf(0x1f7)+'ld\x20start'+'ed',{'runtimeRoot':_0x2c4194,'reason':!_0x30a01f?_0x1196bf(0xac)+_0x1196bf(0x2b3):!_0x2e3c1c?_0x1196bf(0xac)+_0x1196bf(0x2d4)+_0x1196bf(0x216)+_0x1196bf(0x2e5):_0x1196bf(0xe9)+_0x1196bf(0xb8)+_0x1196bf(0x187),'syncOnly':_0x11e850[_0x1196bf(0x2d1)]}),_0x15415b=await buildRuntimeBase(_0x23e678,_0x2c4194,_0x15415b),_0x11e850[_0x1196bf(0xf8)+_0x1196bf(0x318)]?.[_0x1196bf(0x1fa)+'t']?.(_0x1196bf(0x20e)+_0x1196bf(0x1f7)+_0x1196bf(0x270)+_0x1196bf(0x14b),{'manifest':summarizeRuntimeManifest(_0x15415b)})):_0x11e850[_0x1196bf(0xf8)+'ogger']?.[_0x1196bf(0x1fa)+'t']?.(_0x1196bf(0x20e)+_0x1196bf(0x1ce)+_0x1196bf(0x2cf)+'rent',{'manifest':summarizeRuntimeManifest(_0x15415b)});if(!existsSync(resolve(_0x2c4194,_0x15415b[_0x1196bf(0x2f4)+_0x1196bf(0xa6)]))){const _0x50d21e=createRuntimeInfoFromManifest(_0x2c4194,_0x15415b,{'allowMissingOpenClaw':!![]});await installOpenClawPackage(_0x50d21e,_0x51c7b8),_0x15415b[_0x1196bf(0x2f4)+_0x1196bf(0x99)]=_0x51c7b8;}return _0x15415b;}function runtimeHasRequiredPaths(_0x48351b,_0x440976){const _0x2ce889=_0x31e6db;return['nodeExec'+_0x2ce889(0x32e),'npmCli','openclaw'+_0x2ce889(0x294)+'ir',_0x2ce889(0x2f4)+_0x2ce889(0xa6)][_0x2ce889(0x205)](_0x45252e=>typeof _0x440976[_0x45252e]===_0x2ce889(0x315)&&_0x440976[_0x45252e]['trim']())&&[_0x2ce889(0x288)+_0x2ce889(0x32e),_0x2ce889(0x154)][_0x2ce889(0x205)](_0x335b3e=>existsSync(resolve(_0x48351b,_0x440976[_0x335b3e])));}async function buildRuntimeBase(_0x4e07ed,_0x332faa,_0x3d14d7={}){const _0x533839=_0x31e6db,_0x3d592a=join(_0x332faa,_0x533839(0x16d));await ensureRuntimeNode(_0x4e07ed,_0x3d592a);const _0x57c2b9=process[_0x533839(0x2fa)]===_0x533839(0x21a)?_0x533839(0x278)+_0x533839(0x263):_0x533839(0x197)+_0x533839(0x302),_0x5ded57=process[_0x533839(0x2fa)]===_0x533839(0x21a)?_0x533839(0x278)+_0x533839(0x307)+_0x533839(0x125)+'n/npm-cl'+_0x533839(0x19c):_0x533839(0xa7)+_0x533839(0x1af)+_0x533839(0x161)+_0x533839(0x28f)+_0x533839(0x11c),_0x5c621f={..._0x3d14d7,'generatedAt':new Date()[_0x533839(0xa9)+_0x533839(0x15b)](),'nodeVersion':_0x4e07ed[_0x533839(0x2f4)][_0x533839(0x22f)+_0x533839(0x26d)],'openclawVersion':_0x3d14d7[_0x533839(0x2f4)+_0x533839(0x99)]||'','platform':process[_0x533839(0x2fa)],'arch':process['arch'],'nodeExecutable':_0x57c2b9,'npmCli':_0x5ded57,'openclawWorkingDir':_0x533839(0x2f4),'openclawBin':_0x533839(0x2f4)+_0x533839(0x93)+_0x533839(0x1da)};return await writeJson(resolveManifestPath(_0x332faa),_0x5c621f),_0x5c621f;}async function removePathWithRetries(_0x3d0bfb){await rm(_0x3d0bfb,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96});}async function ensureRuntimeNode(_0x355f8a,_0x1bb142){const _0xa758b6=_0x31e6db,_0xb8f568=_0x355f8a[_0xa758b6(0x2f4)][_0xa758b6(0x22f)+_0xa758b6(0x26d)],_0x2407ce=process[_0xa758b6(0x2fa)]===_0xa758b6(0x21a)?join(_0x1bb142,_0xa758b6(0x261)):join(_0x1bb142,_0xa758b6(0x1a1),_0xa758b6(0x16d)),_0x5dbbbe=process[_0xa758b6(0x2fa)]===_0xa758b6(0x21a)?join(_0x1bb142,'node_mod'+_0xa758b6(0x2af),'npm','bin',_0xa758b6(0x21f)+'js'):join(_0x1bb142,_0xa758b6(0xbd),_0xa758b6(0xcf)+_0xa758b6(0x2af),_0xa758b6(0x311),_0xa758b6(0x1a1),'npm-cli.'+'js');if(existsSync(_0x2407ce)&&existsSync(_0x5dbbbe)&&await getNodeVersion(_0x2407ce)===_0xb8f568)return;await removePathWithRetries(_0x1bb142);if(process[_0xa758b6(0x27a)][_0xa758b6(0x16d)]===_0xb8f568){await linkCurrentNodeRuntime(_0x1bb142);return;}await downloadNodeRuntime(_0xb8f568,_0x1bb142);}async function getNodeVersion(_0x567264){const _0x4e717c=_0x31e6db;try{const _0x365349=await runProcess(_0x567264,['-p','process.'+_0x4e717c(0x27a)+'.node'],{'label':_0x567264+_0x4e717c(0xb6),'timeoutMs':0x7530});return _0x365349[_0x4e717c(0x25c)]['trim']();}catch{return'';}}async function linkCurrentNodeRuntime(_0x4fdb28){const _0x5c63fa=_0x31e6db,_0x583002=process[_0x5c63fa(0x236)],_0x5bb805=resolve(dirname(_0x583002),'..'),_0x2c20d1=process['platform']===_0x5c63fa(0x21a)?resolve(_0x5bb805,'node_mod'+_0x5c63fa(0x1c7)):resolve(_0x5bb805,_0x5c63fa(0x260)+_0x5c63fa(0x1e4)+_0x5c63fa(0x133)),_0x25e57b=process[_0x5c63fa(0x2fa)]===_0x5c63fa(0x21a)?join(_0x4fdb28,_0x5c63fa(0x261)):join(_0x4fdb28,'bin',_0x5c63fa(0x16d)),_0x577445=process['platform']==='win32'?join(_0x4fdb28,_0x5c63fa(0xcf)+_0x5c63fa(0x2af),_0x5c63fa(0x311)):join(_0x4fdb28,'lib',_0x5c63fa(0xcf)+'ules',_0x5c63fa(0x311));await mkdir(dirname(_0x25e57b),{'recursive':!![]}),await mkdir(dirname(_0x577445),{'recursive':!![]}),await symlink(_0x583002,_0x25e57b),existsSync(_0x2c20d1)?await symlink(_0x2c20d1,_0x577445):await symlink(await resolveNpmRoot(),_0x577445);}async function resolveNpmRoot(){const _0x52c646=_0x31e6db,_0xcc2dab=await runProcess('npm',[_0x52c646(0x2b4),'-g'],{'label':_0x52c646(0x151)+_0x52c646(0x2c4),'timeoutMs':0x7530}),_0x27b336=process[_0x52c646(0x2fa)]===_0x52c646(0x21a)?_0xcc2dab[_0x52c646(0x25c)][_0x52c646(0x293)]():join(_0xcc2dab[_0x52c646(0x25c)][_0x52c646(0x293)](),'npm');if(!existsSync(join(_0x27b336,_0x52c646(0x1a1),_0x52c646(0x21f)+'js')))throw new Error(_0x52c646(0x32c)+_0x52c646(0x8b)+_0x52c646(0xf2)+_0x52c646(0x1c0)+_0x52c646(0x106)+_0x52c646(0x1e6)+_0x52c646(0x24f)+_0x27b336);return _0x27b336;}async function resolveExtractedNodeRoot(_0x3224c2,_0x3b93cc){const _0x30a5ec=_0x31e6db,_0x273bb5=join(_0x3224c2,_0x3b93cc);if(existsSync(_0x273bb5))return _0x273bb5;const _0x3a5ecc=await readdir(_0x3224c2,{'withFileTypes':!![]}),_0x564f41=_0x3a5ecc[_0x30a5ec(0x132)](_0x5ba69a=>_0x5ba69a[_0x30a5ec(0xe0)+_0x30a5ec(0x306)]());if(_0x564f41[_0x30a5ec(0x118)]===0x1)return join(_0x3224c2,_0x564f41[0x0]['name']);const _0x2edacc=process['platform']==='win32'?join(_0x3224c2,_0x30a5ec(0x261)):join(_0x3224c2,_0x30a5ec(0x1a1),_0x30a5ec(0x16d));if(existsSync(_0x2edacc))return _0x3224c2;const _0x42b5d2=await findNodeRuntimeRoot(_0x3224c2);if(_0x42b5d2)return _0x42b5d2;const _0x5820d2=_0x3a5ecc[_0x30a5ec(0x1e7)](_0x2b873b=>_0x2b873b['name'])[_0x30a5ec(0x89)](',\x20');throw new Error(_0x30a5ec(0x30c)+_0x30a5ec(0x23e)+'untime\x20r'+'oot\x20was\x20'+_0x30a5ec(0xf2)+_0x30a5ec(0x299)+_0x3b93cc+'\x20in\x20'+_0x3224c2+('.\x20Top-le'+_0x30a5ec(0x94)+'ies:\x20')+(_0x5820d2||_0x30a5ec(0x230)));}function resolveNodeExtractRoot(_0x1b33bc,_0x23f7b2,_0x1a242d){const _0x457be5=_0x31e6db;if(process[_0x457be5(0x2fa)]!==_0x457be5(0x21a))return join(_0x1b33bc,_0x23f7b2+(_0x457be5(0x22d)+'-')+process[_0x457be5(0x1e9)]+'-'+Date[_0x457be5(0x32a)]()+'-'+_0x1a242d);const _0x2f33b3=/^[A-Za-z]:[\\/]/[_0x457be5(0x231)](_0x1b33bc),_0x30b2c3=parse(_0x1b33bc),_0x42c4c0=_0x2f33b3?_0x2f33b3[0x0][_0x457be5(0x214)](0x0,0x2)+'\x5c':_0x30b2c3[_0x457be5(0x2b4)]&&_0x30b2c3[_0x457be5(0x2b4)]!=='/'?_0x30b2c3[_0x457be5(0x2b4)]:_0x1b33bc,_0x48efb5=_0x42c4c0['replace'](/[\\/]+$/,'');return _0x48efb5+_0x457be5(0x289)+process[_0x457be5(0x1e9)]+'-'+Date[_0x457be5(0x32a)]()+'-'+_0x1a242d;}async function findNodeRuntimeRoot(_0x444bd7){const _0x231fe5=_0x31e6db,_0x2ce1a7=[_0x444bd7],_0x3059ca=new Set();while(_0x2ce1a7[_0x231fe5(0x118)]>0x0){const _0x250726=_0x2ce1a7[_0x231fe5(0x179)]();if(!_0x250726||_0x3059ca['has'](_0x250726))continue;_0x3059ca[_0x231fe5(0x2e8)](_0x250726);const _0x541f20=process[_0x231fe5(0x2fa)]===_0x231fe5(0x21a)?join(_0x250726,'node.exe'):join(_0x250726,_0x231fe5(0x1a1),_0x231fe5(0x16d)),_0x26583a=process[_0x231fe5(0x2fa)]===_0x231fe5(0x21a)?join(_0x250726,'node_mod'+_0x231fe5(0x2af),'npm',_0x231fe5(0x1a1),'npm-cli.'+'js'):join(_0x250726,_0x231fe5(0xbd),_0x231fe5(0xcf)+_0x231fe5(0x2af),_0x231fe5(0x311),_0x231fe5(0x1a1),'npm-cli.'+'js');if(existsSync(_0x541f20)&&existsSync(_0x26583a))return _0x250726;const _0x4f5813=await readdir(_0x250726,{'withFileTypes':!![]});for(const _0x194578 of _0x4f5813){_0x194578[_0x231fe5(0xe0)+_0x231fe5(0x306)]()&&_0x2ce1a7[_0x231fe5(0xdf)](join(_0x250726,_0x194578[_0x231fe5(0x22a)]));}}return'';}async function downloadNodeRuntime(_0x2ab881,_0x26ba0b){const _0x91d796=_0x31e6db,_0x8b262b=process['platform']===_0x91d796(0x21a)?_0x91d796(0x29b):process['platform'],_0x3635b0=process[_0x91d796(0x23d)]===_0x91d796(0x1a6)?_0x91d796(0x1a6):process[_0x91d796(0x23d)]===_0x91d796(0x16c)?'arm64':process[_0x91d796(0x23d)],_0xde3569=process[_0x91d796(0x2fa)]===_0x91d796(0x21a)?_0x91d796(0x320):_0x91d796(0x141),_0xbcf0e2='node-v'+_0x2ab881+'-'+_0x8b262b+'-'+_0x3635b0,_0x53b4d1=_0xbcf0e2+'.'+_0xde3569,_0x5883e1=join(dirname(_0x26ba0b),'.cache'),_0x340abe=join(_0x5883e1,_0x53b4d1),_0x4a6adb=_0x91d796(0x13f)+'nodejs.o'+_0x91d796(0x2f6)+'v'+_0x2ab881+'/'+_0x53b4d1;await mkdir(_0x5883e1,{'recursive':!![]});const _0x453b6a=resolveNodeExtractRoot(_0x5883e1,_0xbcf0e2,0x1);!existsSync(_0x340abe)&&(console[_0x91d796(0x144)](_0x91d796(0x31b)+'hell:run'+_0x91d796(0x330)+_0x91d796(0x211)+'g\x20'+_0x4a6adb),await downloadFile(_0x4a6adb,_0x340abe));await rm(_0x453b6a,{'recursive':!![],'force':!![]}),await mkdir(_0x453b6a,{'recursive':!![]});process[_0x91d796(0x2fa)]===_0x91d796(0x21a)?await extractZipArchive(_0x340abe,_0x453b6a,_0x53b4d1):await runProcess(_0x91d796(0xef),[_0x91d796(0x1b3),_0x340abe,'-C',_0x453b6a],{'label':'extract\x20'+_0x53b4d1});const _0x4153fd=await resolveExtractedNodeRoot(_0x453b6a,_0xbcf0e2);await mkdir(dirname(_0x26ba0b),{'recursive':!![]}),await rename(_0x4153fd,_0x26ba0b),_0x4153fd!==_0x453b6a&&await rm(_0x453b6a,{'recursive':!![],'force':!![]});}async function extractZipArchive(_0x1915e3,_0x51eb7c,_0x49be85){const _0x69a79c=_0x31e6db;await runProcess(_0x69a79c(0xd9)+_0x69a79c(0x243),[_0x69a79c(0x26b)+'le',_0x69a79c(0x13c)+_0x69a79c(0x15e),_0x69a79c(0x24b),_0x69a79c(0xe8),_0x69a79c(0x16f)+_0x69a79c(0x322)+_0x69a79c(0x29e)+_0x69a79c(0xf6)+':WUJIE_S'+_0x69a79c(0x17e)+_0x69a79c(0xea)+_0x69a79c(0x1ad)+_0x69a79c(0x24d)+_0x69a79c(0x1f2)+_0x69a79c(0x2fd)+_0x69a79c(0xe7)+_0x69a79c(0x8c)+'ce'],{'env':{...process.env,'WUJIE_SHELL_ARCHIVE':_0x1915e3,'WUJIE_SHELL_EXTRACT_ROOT':_0x51eb7c},'label':_0x69a79c(0x30f)+_0x49be85});}async function downloadFile(_0x336162,_0x1eb3ac){await mkdir(dirname(_0x1eb3ac),{'recursive':!![]});const _0xa0183a=await new Promise((_0x486847,_0x109b84)=>{const _0x51e788=_0x3914;get(_0x336162,_0xe4b40b=>{const _0x1b0179=_0x3914;if(_0xe4b40b['statusCo'+'de']>=0x12c&&_0xe4b40b[_0x1b0179(0x145)+'de']<0x190&&_0xe4b40b[_0x1b0179(0x188)][_0x1b0179(0x1d1)]){_0xe4b40b['resume'](),downloadFile(new URL(_0xe4b40b['headers'][_0x1b0179(0x1d1)],_0x336162)[_0x1b0179(0xe6)],_0x1eb3ac)[_0x1b0179(0x113)](()=>_0x486847(null))['catch'](_0x109b84);return;}if(_0xe4b40b[_0x1b0179(0x145)+'de']!==0xc8){_0xe4b40b[_0x1b0179(0x1d3)](),_0x109b84(new Error(_0x1b0179(0x31d)+_0x1b0179(0x10a)+_0xe4b40b[_0x1b0179(0x145)+'de']+':\x20'+_0x336162));return;}_0x486847(_0xe4b40b);})['on'](_0x51e788(0x1fc),_0x109b84);});_0xa0183a&&await pipeline(_0xa0183a,createWriteStream(_0x1eb3ac));}export async function ensureOpenClawDoctorFixed(_0x456be2,_0x41f8e1={}){const _0xaf2b46=_0x31e6db,_0x3c3aeb=await loadRuntimeInfo(_0x456be2[_0xaf2b46(0x18c)+_0xaf2b46(0xa4)]),_0x2759ab=getConfigPaths(_0x456be2),_0x24d41f=join(_0x2759ab[_0xaf2b46(0x251)+'tateDir'],'openclaw'+_0xaf2b46(0x147)+'json'),_0x25933a=await readJson(_0x24d41f,{});if(_0x25933a[_0xaf2b46(0x2f4)+'Version']===_0x3c3aeb[_0xaf2b46(0x2f4)+_0xaf2b46(0x99)])return _0x41f8e1[_0xaf2b46(0xf8)+_0xaf2b46(0x318)]?.['info'](_0xaf2b46(0x2f4)+_0xaf2b46(0x2f5)+'fix\x20alre'+_0xaf2b46(0x1cc)+'ent',{'openclawVersion':_0x3c3aeb[_0xaf2b46(0x2f4)+_0xaf2b46(0x99)],'markerPath':_0x24d41f}),{'ran':![],'openclawVersion':_0x3c3aeb['openclaw'+_0xaf2b46(0x99)],'markerPath':_0x24d41f};return await runOpenClawDoctorFix(_0x456be2,_0x3c3aeb,{'fromVersion':_0x25933a[_0xaf2b46(0x2f4)+_0xaf2b46(0x99)]||_0xaf2b46(0x11f),'toVersion':_0x3c3aeb[_0xaf2b46(0x2f4)+_0xaf2b46(0x99)],'markerPath':_0x24d41f,'runtimeLogger':_0x41f8e1[_0xaf2b46(0xf8)+_0xaf2b46(0x318)]}),{'ran':!![],'openclawVersion':_0x3c3aeb['openclaw'+'Version'],'markerPath':_0x24d41f};}async function runOpenClawDoctorFix(_0x3cc147,_0x19731d,{fromVersion:_0x5a7340,toVersion:_0x17729b,markerPath:markerPath='',runtimeLogger:_0x52f82a}={}){const _0x3297e0=_0x31e6db;_0x52f82a?.[_0x3297e0(0x1fa)+'t']?.(_0x3297e0(0x2f4)+_0x3297e0(0x2f5)+'fix\x20star'+_0x3297e0(0x9f),{'fromVersion':_0x5a7340,'toVersion':_0x17729b});const _0x4f4073=await createRuntimeEnv(_0x19731d,{'OPENCLAW_HOME':_0x3cc147[_0x3297e0(0xe4)],'OPENCLAW_STATE_DIR':_0x3cc147[_0x3297e0(0xe4)],'OPENCLAW_CONFIG_PATH':getConfigPaths(_0x3cc147)[_0x3297e0(0x1bd)+'th']});console['log'](_0x3297e0(0x31b)+'hell:run'+_0x3297e0(0x2c0)+'nning\x20op'+'enclaw\x20d'+_0x3297e0(0xa5)+_0x3297e0(0x1eb));const _0x35afa9=await runProcess(_0x19731d[_0x3297e0(0x288)+'utable'],[_0x19731d[_0x3297e0(0x2f4)+_0x3297e0(0xa6)],_0x3297e0(0xc0),_0x3297e0(0x96)],{'cwd':_0x19731d[_0x3297e0(0x2f4)+_0x3297e0(0x294)+'ir'],'env':_0x4f4073,'label':'openclaw'+_0x3297e0(0x2f5)+'--fix','timeoutMs':0x1d4c0});_0x52f82a?.[_0x3297e0(0x1fa)+'t']?.('openclaw'+_0x3297e0(0x2f5)+'fix\x20comp'+_0x3297e0(0x308),{'fromVersion':_0x5a7340,'toVersion':_0x17729b,'stdout':_0x35afa9[_0x3297e0(0x25c)][_0x3297e0(0x293)]()[_0x3297e0(0x214)](-0xfa0),'stderr':_0x35afa9[_0x3297e0(0x286)][_0x3297e0(0x293)]()['slice'](-0xfa0)}),markerPath&&(await writeJson(markerPath,{'openclawVersion':_0x19731d[_0x3297e0(0x2f4)+_0x3297e0(0x99)],'fixedAt':new Date()[_0x3297e0(0xa9)+'ing']()}),_0x52f82a?.[_0x3297e0(0x1fa)+'t']?.('openclaw'+'\x20doctor\x20'+_0x3297e0(0xe5)+'er\x20writt'+'en',{'markerPath':markerPath,'openclawVersion':_0x19731d[_0x3297e0(0x2f4)+_0x3297e0(0x99)]}));}export async function readRuntimeManifest(_0x71e737){return await readJson(resolveManifestPath(_0x71e737),{});}export async function loadRuntimeInfo(_0x3303e4){const _0x1e54e7=resolveRuntimeRoot(_0x3303e4),_0x32e41e=await readRuntimeManifest(_0x1e54e7);return createRuntimeInfoFromManifest(_0x1e54e7,_0x32e41e);}function createRuntimeInfoFromManifest(_0x5a5cd4,_0x1b4bc5,_0x3928c8={}){const _0x159273=_0x31e6db;for(const _0xee72df of[_0x159273(0x288)+_0x159273(0x32e),_0x159273(0x154),'openclaw'+_0x159273(0x294)+'ir',_0x159273(0x2f4)+'Bin']){if(typeof _0x1b4bc5[_0xee72df]!==_0x159273(0x315)||!_0x1b4bc5[_0xee72df][_0x159273(0x293)]())throw new Error(_0x159273(0x20e)+_0x159273(0x2b3)+'\x20is\x20miss'+_0x159273(0x103)+_0xee72df+_0x159273(0x336)+resolveManifestPath(_0x5a5cd4)+(_0x159273(0x2b7)+_0x159273(0x2a1)+'l\x20prepar'+'e'));}const _0x5596b3=resolve(_0x5a5cd4,_0x1b4bc5[_0x159273(0x288)+_0x159273(0x32e)]),_0x125ae4=resolve(_0x5a5cd4,_0x1b4bc5['npmCli']),_0x44ddee=resolve(_0x5a5cd4,_0x1b4bc5['openclaw'+_0x159273(0x294)+'ir']),_0x4becaf=resolve(_0x5a5cd4,_0x1b4bc5['openclaw'+_0x159273(0xa6)]),_0x5dee21=Array[_0x159273(0x1e3)](_0x1b4bc5[_0x159273(0xec)])?_0x1b4bc5['plugins'][_0x159273(0x1e7)](_0x3f62d4=>({..._0x3f62d4,'installPath':resolve(_0x5a5cd4,_0x3f62d4[_0x159273(0x207)+_0x159273(0x2ae)])})):[],_0x2893c6=_0x3928c8[_0x159273(0x326)+_0x159273(0x291)+_0x159273(0x17a)]?[_0x5596b3,_0x125ae4]:[_0x5596b3,_0x125ae4,_0x44ddee,_0x4becaf];for(const _0x17f581 of _0x2893c6){if(!existsSync(_0x17f581))throw new Error(_0x159273(0x20e)+_0x159273(0xac)+_0x159273(0x2d9)+_0x17f581);}return{'runtimeRoot':_0x5a5cd4,'manifest':_0x1b4bc5,'openclawVersion':_0x1b4bc5[_0x159273(0x2f4)+'Version']||_0x159273(0x11f),'nodeExecutable':_0x5596b3,'npmCli':_0x125ae4,'openclawWorkingDir':_0x44ddee,'openclawBin':_0x4becaf,'plugins':_0x5dee21};}export async function spawnClaw(_0x44314a,_0x186681=[],_0x47eead={}){const _0x4242bd=_0x31e6db,_0x2ed6e3=await loadRuntimeInfo(_0x44314a),_0x3b7ca0=await createRuntimeEnv(_0x2ed6e3,_0x47eead[_0x4242bd(0x130)]??{});return spawn(_0x2ed6e3[_0x4242bd(0x288)+'utable'],[_0x2ed6e3[_0x4242bd(0x2f4)+_0x4242bd(0xa6)],..._0x186681],{'cwd':_0x2ed6e3[_0x4242bd(0x2f4)+_0x4242bd(0x294)+'ir'],'stdio':'pipe',..._0x47eead,'env':_0x3b7ca0});}export async function runClawOnce(_0x50c1c3,_0x32bcf0=[],_0x6b64e=0x15f90){const _0x53e655=await spawnClaw(_0x50c1c3,_0x32bcf0);return await new Promise((_0x1e35ac,_0x44c3c1)=>{const _0x52d02c=_0x3914;let _0x1b8892='',_0x3f615d='',_0x104717=![];const _0x9fe60a=setTimeout(()=>{const _0x43b336=_0x3914;if(_0x104717)return;_0x104717=!![],_0x53e655[_0x43b336(0x1e1)](_0x43b336(0x233)),_0x44c3c1(new Error(_0x43b336(0x2f4)+_0x43b336(0x100)+_0x43b336(0x186)+'\x20'+_0x6b64e+'ms'));},_0x6b64e);_0x53e655['stdout']['on'](_0x52d02c(0x1b1),_0xbdbc07=>{_0x1b8892+=_0xbdbc07['toString']();}),_0x53e655[_0x52d02c(0x286)]['on'](_0x52d02c(0x1b1),_0x8fbe89=>{const _0xf9f270=_0x52d02c;_0x3f615d+=_0x8fbe89[_0xf9f270(0x8f)]();}),_0x53e655['on']('error',_0x30551f=>{if(_0x104717)return;_0x104717=!![],clearTimeout(_0x9fe60a),_0x44c3c1(_0x30551f);}),_0x53e655['on']('close',(_0x502647,_0x4a7a90)=>{if(_0x104717)return;_0x104717=!![],clearTimeout(_0x9fe60a),_0x1e35ac({'code':_0x502647,'signal':_0x4a7a90,'stdout':_0x1b8892,'stderr':_0x3f615d});});});}export{resolveRuntimeLarkCliCommand};function resolvePackageNameFromNpmSpec(_0x578ff5){const _0x4fd009=_0x31e6db,_0x251f1f=_0x578ff5['trim']()[_0x4fd009(0x28e)](/^npm:/,'');if(!_0x251f1f)throw new Error(_0x4fd009(0x14f)+_0x4fd009(0x1aa)+_0x4fd009(0x1d4)+'c');if(_0x251f1f[_0x4fd009(0x28d)+'th']('@')){const _0x44615c=_0x251f1f[_0x4fd009(0xaf)]('/');if(_0x44615c===-0x1)throw new Error(_0x4fd009(0x14f)+_0x4fd009(0xcd)+_0x4fd009(0x1f3)+_0x578ff5);const _0x3c3483=_0x251f1f[_0x4fd009(0xaf)]('@',_0x44615c+0x1);return _0x3c3483===-0x1?_0x251f1f:_0x251f1f['slice'](0x0,_0x3c3483);}const _0x272a3a=_0x251f1f[_0x4fd009(0xaf)]('@');return _0x272a3a===-0x1?_0x251f1f:_0x251f1f[_0x4fd009(0x214)](0x0,_0x272a3a);}async function createRuntimeEnv(_0x5c8ff4,_0x559aa7={}){const _0xb5b578=_0x31e6db,_0x5e009a={...process.env,..._0x559aa7},_0x4cbad2=_0x5e009a['OPENCLAW'+_0xb5b578(0xf4)+'IR']||'',_0x284bd0=_0x5e009a[_0xb5b578(0xff)+'IG_REGIS'+_0xb5b578(0x2ec)]||_0xb5b578(0x13f)+_0xb5b578(0xb4)+_0xb5b578(0x2b5)+'or.com',_0x25d628=_0x4cbad2?join(_0x4cbad2,_0xb5b578(0x22c)+_0xb5b578(0x324)+'ls'):join(_0x5c8ff4[_0xb5b578(0x1a8)+'oot'],'.tools'),_0x50f21b=join(_0x25d628,_0xb5b578(0x166)+'al'),_0x520fd9=join(_0x25d628,_0xb5b578(0x277)+'e'),_0x4dd8ac=join(_0x50f21b,_0xb5b578(0x1a1));await mkdir(_0x4dd8ac,{'recursive':!![]}),await mkdir(_0x520fd9,{'recursive':!![]});const _0x27969a=[_0x4dd8ac,dirname(_0x5c8ff4['nodeExec'+'utable']),_0x5e009a[_0xb5b578(0x2a8)]||''];return{..._0x5e009a,'PATH':_0x27969a['filter'](Boolean)[_0xb5b578(0x89)](delimiter),'npm_config_prefix':_0x50f21b,'NPM_CONFIG_PREFIX':_0x50f21b,'npm_config_cache':_0x520fd9,'NPM_CONFIG_CACHE':_0x520fd9,'NPM_CONFIG_REGISTRY':_0x284bd0,'npm_execpath':_0x5c8ff4[_0xb5b578(0x154)],'npm_node_execpath':_0x5c8ff4['nodeExec'+_0xb5b578(0x32e)],'OPENCLAW_RUNTIME_NPM_PREFIX':_0x50f21b,'OPENCLAW_RUNTIME_NPM_BIN':_0x4dd8ac};}export async function getRuntimeSpawnContext(_0x28b9fa,_0x37d4ff={}){const _0x371793=_0x31e6db,_0x29e99e=await loadRuntimeInfo(_0x28b9fa),_0x2cd43d=await createRuntimeEnv(_0x29e99e,_0x37d4ff);return{'cwd':_0x29e99e[_0x371793(0x2f4)+_0x371793(0x294)+'ir'],'env':_0x2cd43d,'runtime':_0x29e99e};}function resolvePluginDirNameFromSpec(_0x9363c2){const _0x2e5d89=_0x31e6db,_0x41a601=resolvePackageNameFromNpmSpec(_0x9363c2),_0x36ec88=_0x41a601[_0x2e5d89(0xbb)]('/')[_0x2e5d89(0x132)](Boolean),_0x4baad4=_0x36ec88['at'](-0x1)??'';if(!_0x4baad4)throw new Error(_0x2e5d89(0x14f)+'plugin\x20s'+_0x2e5d89(0x1f3)+_0x9363c2);return _0x4baad4;}async function resolvePluginIdFromPackageDir(_0x466719,_0x3c1db4){const _0x150167=_0x31e6db,_0x434111=await readJson(join(_0x466719,_0x150167(0x2b2)+_0x150167(0x2e4)),{}),_0x5cbd66=await readPluginManifest(_0x466719),_0x5a0009=[_0x5cbd66?.['id'],_0x5cbd66?.['pluginId'],_0x5cbd66?.[_0x150167(0x22a)],_0x434111?.[_0x150167(0x2f4)]?.['id'],_0x434111?.[_0x150167(0x2f4)+'Id'],_0x3c1db4],_0x37d0f3=_0x5a0009[_0x150167(0x26e)](_0x900f2f=>typeof _0x900f2f===_0x150167(0x315)&&_0x900f2f['trim']());if(!_0x37d0f3)throw new Error('Unable\x20t'+_0x150167(0x29f)+_0x150167(0x9a)+_0x150167(0x201)+'\x20'+_0x466719);return _0x37d0f3['trim']();}function pluginSpecMatches(_0xeda02b,_0x522b98){const _0x824fe4=_0x31e6db,_0xcd656f=_0x522b98['trim'](),_0x433cce=resolvePackageNameFromNpmSpec(_0xcd656f);return[_0xeda02b[_0x824fe4(0x193)],_0xeda02b[_0x824fe4(0x33b)+'Spec'],_0xeda02b[_0x824fe4(0x33b)+'Name']][_0x824fe4(0x314)](_0x4e0cd8=>_0x4e0cd8===_0xcd656f||_0x4e0cd8===_0x433cce);}async function installPluginFromNpmSpec(_0x2630d7,_0x4fb5ee,_0x5653ff={}){const _0x18791c=_0x31e6db,_0x47633b=_0x2630d7['trim']()['replace'](/^npm:/,''),_0xec3d70=resolvePluginDirNameFromSpec(_0x47633b),_0x378351=join(_0x4fb5ee['openclaw'+'WorkingD'+'ir'],'dist',_0x18791c(0x305)+'ns'),_0x2f013f=join(_0x378351,_0xec3d70),_0x2b1273=join(_0x4fb5ee['runtimeR'+_0x18791c(0xa4)],_0x18791c(0xa2)+_0x18791c(0xb5)+process[_0x18791c(0x1e9)]+'-'+Date[_0x18791c(0x32a)]()),_0x593edf=await createRuntimeEnv(_0x4fb5ee),_0x2d98ef=new Date()[_0x18791c(0xa9)+_0x18791c(0x15b)](),_0x504b79=join(_0x4fb5ee[_0x18791c(0x1a8)+_0x18791c(0xa4)],_0x18791c(0x163));await mkdir(_0x504b79,{'recursive':!![]}),await rm(_0x2b1273,{'recursive':!![],'force':!![]}),await rm(_0x2f013f,{'recursive':!![],'force':!![]}),await mkdir(_0x2b1273,{'recursive':!![]}),await mkdir(_0x378351,{'recursive':!![]}),console[_0x18791c(0x144)](_0x18791c(0x31b)+_0x18791c(0x1c4)+'time]\x20fe'+_0x18791c(0x9b)+_0x18791c(0x332)+_0x47633b);const _0x1cde5d=await runProcess(_0x4fb5ee[_0x18791c(0x288)+'utable'],[_0x4fb5ee[_0x18791c(0x154)],'pack',_0x47633b,_0x18791c(0x316)],{'cwd':_0x504b79,'env':_0x593edf,'label':_0x18791c(0x32c)+'\x20'+_0x47633b}),_0x4ae003=parseNpmPackJson(_0x1cde5d[_0x18791c(0x25c)]),_0xd421d4=normalizePackedTarballFilename(_0x4ae003[_0x18791c(0x21b)]),_0x52d16e=join(_0x504b79,_0xd421d4);if(!existsSync(_0x52d16e))throw new Error('npm\x20pack'+'\x20did\x20not'+_0x18791c(0x310)+_0x18791c(0x12c)+'\x20'+_0x52d16e);await runProcess('tar',['-xzf',_0x52d16e,'-C',_0x2b1273],{'label':_0x18791c(0x30f)+_0xd421d4}),await rename(join(_0x2b1273,_0x18791c(0x303)),_0x2f013f),await rm(_0x2b1273,{'recursive':!![],'force':!![]});const _0x1d37a7=join(_0x2f013f,_0x18791c(0x2b2)+_0x18791c(0x2e4)),_0x4c2f62=await readJson(_0x1d37a7,{});(_0x4c2f62[_0x18791c(0x173)+_0x18791c(0x262)]||_0x4c2f62[_0x18791c(0x1dd)])&&(delete _0x4c2f62[_0x18791c(0x173)+_0x18791c(0x262)],delete _0x4c2f62[_0x18791c(0x1dd)],await writeJson(_0x1d37a7,_0x4c2f62));await runProcess(_0x4fb5ee['nodeExec'+_0x18791c(0x32e)],[_0x4fb5ee[_0x18791c(0x154)],_0x18791c(0x335),'--omit=d'+'ev','--omit=p'+_0x18791c(0x170),_0x18791c(0x32b)+'it',_0x18791c(0x224)+'d','--legacy'+_0x18791c(0x101)+'ps'],{'cwd':_0x2f013f,'env':_0x593edf,'label':_0x18791c(0xf3)+_0x18791c(0x19b)+_0x18791c(0x269)+_0x47633b});const _0x196b28=new Date()[_0x18791c(0xa9)+_0x18791c(0x15b)](),_0xbb20d4=await resolvePluginIdFromPackageDir(_0x2f013f,_0x4ae003[_0x18791c(0x22a)]);return _0x5653ff[_0x18791c(0xf8)+_0x18791c(0x318)]?.['info'](_0x18791c(0x88)+_0x18791c(0x2b8)+_0x18791c(0x285),{'spec':_0x47633b,'pluginId':_0xbb20d4,'installPath':_0x2f013f}),{'pluginId':_0xbb20d4,'source':_0x18791c(0x311),'spec':_0x47633b,'installPath':toRuntimeRelative(_0x4fb5ee[_0x18791c(0x1a8)+_0x18791c(0xa4)],_0x2f013f),'version':_0x4ae003['version'],'resolvedName':_0x4ae003['name'],'resolvedVersion':_0x4ae003['version'],'resolvedSpec':_0x4ae003[_0x18791c(0x22a)]+'@'+_0x4ae003[_0x18791c(0x274)],'integrity':typeof _0x4ae003[_0x18791c(0x31f)+'y']==='string'?_0x4ae003[_0x18791c(0x31f)+'y']:'','shasum':typeof _0x4ae003['shasum']==='string'?_0x4ae003[_0x18791c(0x1ea)]:'','resolvedAt':_0x2d98ef,'installedAt':_0x196b28};}async function syncConfiguredNpmPlugins(_0x1c1a44,_0x2ae580,_0x42c9e6,_0x2b401e={}){const _0x1c3b2c=_0x31e6db;if(_0x2b401e[_0x1c3b2c(0x2d1)])return;const _0x168c10=createRuntimeInfoFromManifest(_0x2ae580,_0x42c9e6),_0x4f5143=Array[_0x1c3b2c(0x1e3)](_0x42c9e6['plugins'])?_0x42c9e6[_0x1c3b2c(0xec)]:[],_0x4f6890=[];for(const _0x2c8799 of _0x1c1a44[_0x1c3b2c(0x2f4)]['pluginSp'+_0x1c3b2c(0x2ff)]){const _0x2d7a46=_0x4f5143[_0x1c3b2c(0x26e)](_0x52180e=>_0x52180e?.[_0x1c3b2c(0x215)]===_0x1c3b2c(0x311)&&pluginSpecMatches(_0x52180e,_0x2c8799)&&typeof _0x52180e[_0x1c3b2c(0x207)+_0x1c3b2c(0x2ae)]===_0x1c3b2c(0x315)&&existsSync(resolve(_0x2ae580,_0x52180e[_0x1c3b2c(0x207)+_0x1c3b2c(0x2ae)])));if(_0x2d7a46){_0x4f6890[_0x1c3b2c(0xdf)](_0x2d7a46);continue;}_0x4f6890[_0x1c3b2c(0xdf)](await installPluginFromNpmSpec(_0x2c8799,_0x168c10,_0x2b401e));}const _0xa23c8d=new Set(_0x1c1a44[_0x1c3b2c(0x2f4)][_0x1c3b2c(0x27b)+'ecs'][_0x1c3b2c(0x1e7)](resolvePackageNameFromNpmSpec)),_0x4e3384=_0x4f5143[_0x1c3b2c(0x132)](_0x2f4dea=>_0x2f4dea?.[_0x1c3b2c(0x215)]!==_0x1c3b2c(0x311)||!_0xa23c8d[_0x1c3b2c(0x15f)](resolvePackageNameFromNpmSpec(_0x2f4dea[_0x1c3b2c(0x33b)+_0x1c3b2c(0x2c8)]||_0x2f4dea[_0x1c3b2c(0x193)]||'')));_0x42c9e6[_0x1c3b2c(0xec)]=[..._0x4e3384,..._0x4f6890];}function hasRuntimeDependencies(_0x1f7b5b){const _0x260d65=_0x31e6db,_0x18405e=_0x1f7b5b?.[_0x260d65(0x2a4)+'cies']&&typeof _0x1f7b5b[_0x260d65(0x2a4)+_0x260d65(0x2a3)]===_0x260d65(0xd5)?Object[_0x260d65(0x86)](_0x1f7b5b[_0x260d65(0x2a4)+_0x260d65(0x2a3)]):[],_0x5e9058=_0x1f7b5b?.[_0x260d65(0x2f3)+_0x260d65(0x172)+_0x260d65(0x2a3)]&&typeof _0x1f7b5b['optional'+_0x260d65(0x172)+_0x260d65(0x2a3)]===_0x260d65(0xd5)?Object[_0x260d65(0x86)](_0x1f7b5b[_0x260d65(0x2f3)+_0x260d65(0x172)+'cies']):[];return _0x18405e[_0x260d65(0x118)]>0x0||_0x5e9058['length']>0x0;}async function installLocalPluginRuntimeDependencies(_0x38ba02,_0x124c12,_0x26f298){const _0x489b2a=_0x31e6db,_0x5af5ad=join(_0x38ba02,'package.'+_0x489b2a(0x2e4)),_0x2fab5a=await readJson(_0x5af5ad,{});(_0x2fab5a[_0x489b2a(0x173)+_0x489b2a(0x262)]||_0x2fab5a[_0x489b2a(0x1dd)])&&(delete _0x2fab5a[_0x489b2a(0x173)+_0x489b2a(0x262)],delete _0x2fab5a[_0x489b2a(0x1dd)],await writeJson(_0x5af5ad,_0x2fab5a));if(!hasRuntimeDependencies(_0x2fab5a))return;const _0xd29526=await createRuntimeEnv(_0x124c12);console[_0x489b2a(0x144)](_0x489b2a(0x31b)+_0x489b2a(0x1c4)+_0x489b2a(0x109)+'stalling'+'\x20local\x20p'+_0x489b2a(0x338)+'pendenci'+_0x489b2a(0x27c)+_0x38ba02),await runProcess(_0x124c12['nodeExec'+_0x489b2a(0x32e)],[_0x124c12[_0x489b2a(0x154)],_0x489b2a(0x335),_0x489b2a(0x2a0)+'ev',_0x489b2a(0x2f7)+_0x489b2a(0x170),_0x489b2a(0x32b)+'it',_0x489b2a(0x224)+'d',_0x489b2a(0x31a)+_0x489b2a(0x101)+'ps'],{'cwd':_0x38ba02,'env':_0xd29526,'label':_0x489b2a(0xf3)+_0x489b2a(0x19a)+_0x489b2a(0x24c)+'\x20'+_0x38ba02}),_0x26f298[_0x489b2a(0xf8)+_0x489b2a(0x318)]?.[_0x489b2a(0x2da)](_0x489b2a(0xe3)+_0x489b2a(0x1ac)+'endencie'+_0x489b2a(0xa8)+_0x489b2a(0x2ea),{'installPath':_0x38ba02});}async function syncSharedPluginModules(_0x355b15,_0x28e0fb){const _0x3d59e4=_0x31e6db,_0x4479fb=new Set();for(const _0x26ac77 of _0x355b15){const _0x4c5e47=join(dirname(_0x26ac77),_0x3d59e4(0x178));if(existsSync(_0x4c5e47))_0x4479fb[_0x3d59e4(0x2e8)](_0x4c5e47);}for(const _0x517a58 of _0x4479fb){await copyDirFresh(_0x517a58,join(_0x28e0fb,_0x3d59e4(0x178)));}}async function syncProductPlugins(_0x1d15b4,_0x47aaba,_0x31217,_0x578d4c={}){const _0x405725=_0x31e6db,_0x4fce25=join(_0x47aaba,_0x405725(0x2f4),_0x405725(0xc7),_0x405725(0x305)+'ns'),_0x2d0898=createRuntimeInfoFromManifest(_0x47aaba,_0x31217),_0x43da8f=[];await syncSharedPluginModules(_0x1d15b4[_0x405725(0x2f4)][_0x405725(0x33b)+_0x405725(0x84)+_0x405725(0x138)],_0x4fce25);for(const _0x22a913 of _0x1d15b4['openclaw']['resolved'+_0x405725(0x84)+'ginPaths']){const _0x555a3c=await getPackageMetadata(_0x22a913),_0x53cb84=await readPluginManifest(_0x22a913),_0x1f8dd2=join(_0x4fce25,_0x555a3c[_0x405725(0xe2)]);await copyDirFresh(_0x22a913,_0x1f8dd2),await installLocalPluginRuntimeDependencies(_0x1f8dd2,_0x2d0898,_0x578d4c),_0x43da8f['push']({'pluginId':_0x555a3c[_0x405725(0xe2)],'source':_0x405725(0x165),'spec':_0x405725(0x27f)+_0x22a913,'installPath':toRuntimeRelative(_0x47aaba,_0x1f8dd2),'version':_0x555a3c['version'],'resolvedName':_0x555a3c[_0x405725(0x22a)],'resolvedVersion':_0x555a3c[_0x405725(0x274)],'resolvedSpec':'local:'+_0x22a913,'integrity':'','shasum':'','resolvedAt':new Date()[_0x405725(0xa9)+_0x405725(0x15b)](),'installedAt':new Date()[_0x405725(0xa9)+_0x405725(0x15b)](),'agentScope':_0x53cb84[_0x405725(0x1bf)+'pe'],'skills':_0x53cb84[_0x405725(0x1fd)]});}const _0x1789ca=new Set(_0x43da8f[_0x405725(0x1e7)](_0x5b16d7=>_0x5b16d7['pluginId'])),_0x1e0bd4=Array[_0x405725(0x1e3)](_0x31217[_0x405725(0xec)])?_0x31217['plugins'][_0x405725(0x132)](_0x29ce13=>!_0x1789ca[_0x405725(0x15f)](_0x29ce13[_0x405725(0xe2)])):[];_0x31217[_0x405725(0xec)]=[..._0x1e0bd4,..._0x43da8f];}async function syncManifestPluginScope(_0x1d88b3,_0x247e82,_0x3db35c){const _0x5a3385=_0x31e6db,_0x4cf295=join(_0x247e82,_0x5a3385(0x2f4),'dist','extensio'+'ns'),_0x18043d=new Set(_0x1d88b3['openclaw'][_0x5a3385(0x27b)+_0x5a3385(0x2ff)]??[]),_0x181895=new Set([..._0x18043d]['map'](_0x2440d0=>_0x2440d0[_0x5a3385(0x28e)](/^npm:/,''))['map'](_0x12ecf2=>{const _0x334a18=_0x5a3385;if(_0x12ecf2[_0x334a18(0x28d)+'th']('@')){const _0x2f85dd=_0x12ecf2[_0x334a18(0xbb)]('@');return _0x2f85dd[_0x334a18(0x118)]>=0x3?'@'+_0x2f85dd[0x1]:_0x12ecf2;}return _0x12ecf2[_0x334a18(0xbb)]('@')[0x0];})['filter'](Boolean)),_0x5ee075=new Set();for(const _0x120527 of _0x1d88b3[_0x5a3385(0x2f4)]['resolved'+_0x5a3385(0x84)+_0x5a3385(0x138)]){const _0x22628b=await getPackageMetadata(_0x120527);if(_0x22628b[_0x5a3385(0xe2)])_0x5ee075['add'](_0x22628b[_0x5a3385(0xe2)]);}const _0x4e72cc=Array[_0x5a3385(0x1e3)](_0x3db35c[_0x5a3385(0xec)])?_0x3db35c[_0x5a3385(0xec)]:[];_0x3db35c[_0x5a3385(0x27b)+_0x5a3385(0x2ff)]=[..._0x1d88b3[_0x5a3385(0x2f4)][_0x5a3385(0x27b)+_0x5a3385(0x2ff)],..._0x1d88b3['openclaw'][_0x5a3385(0x33b)+'LocalPlu'+'ginPaths'][_0x5a3385(0x1e7)](_0x5155e2=>_0x5a3385(0x27f)+_0x5155e2)],_0x3db35c[_0x5a3385(0xec)]=_0x4e72cc[_0x5a3385(0x132)](_0x39bc37=>{const _0xf1c5a9=_0x5a3385;if(!_0x39bc37||typeof _0x39bc37!==_0xf1c5a9(0xd5))return![];if(_0x39bc37[_0xf1c5a9(0x215)]===_0xf1c5a9(0x165))return _0x5ee075[_0xf1c5a9(0x15f)](_0x39bc37[_0xf1c5a9(0xe2)]);if(_0x39bc37['source']===_0xf1c5a9(0x311))return _0x18043d['has'](_0x39bc37[_0xf1c5a9(0x193)])||_0x18043d[_0xf1c5a9(0x15f)](_0x39bc37[_0xf1c5a9(0x33b)+'Spec'])||_0x181895[_0xf1c5a9(0x15f)](_0x39bc37[_0xf1c5a9(0x33b)+'Name']);return![];});const _0x1213ea=new Set(_0x3db35c[_0x5a3385(0xec)]['map'](_0x27a7d2=>_0x27a7d2['pluginId']));for(const _0xf0f3bb of _0x4e72cc){if(!_0xf0f3bb['pluginId']||_0x1213ea['has'](_0xf0f3bb[_0x5a3385(0xe2)]))continue;const _0x5c9c5b=typeof _0xf0f3bb['installP'+'ath']===_0x5a3385(0x315)&&_0xf0f3bb[_0x5a3385(0x207)+_0x5a3385(0x2ae)][_0x5a3385(0x293)]()?resolve(_0x247e82,_0xf0f3bb[_0x5a3385(0x207)+_0x5a3385(0x2ae)]):join(_0x4cf295,_0xf0f3bb['pluginId']),_0x17e041=relative(_0x4cf295,_0x5c9c5b);if(_0x17e041[_0x5a3385(0x28d)+'th']('..')||_0x17e041==='')continue;await rm(_0x5c9c5b,{'recursive':!![],'force':!![]});}}async function collectCapabilityEntries(_0x5a1248,_0x14a2ad){const _0x571a42=_0x31e6db,_0x5623f5=new Map();for(const _0x5cbba9 of _0x5a1248){let _0x1d0c27;try{_0x1d0c27=await stat(_0x5cbba9);}catch{throw new Error(_0x14a2ad+(_0x571a42(0x14d)+'s\x20not\x20fo'+_0x571a42(0x167))+_0x5cbba9);}if(!_0x1d0c27[_0x571a42(0xe0)+'ory']())throw new Error(_0x14a2ad+('\x20path\x20mu'+_0x571a42(0x281)+'director'+_0x571a42(0x228))+_0x5cbba9);const _0x4a962d={'name':basename(_0x5cbba9),'path':_0x5cbba9},_0x447556=_0x5623f5[_0x571a42(0x244)](_0x4a962d['name']);if(_0x447556)throw new Error(_0x571a42(0x2f9)+'e\x20'+_0x14a2ad+_0x571a42(0x297)+_0x4a962d['name']+'\x22\x20from\x20'+_0x447556[_0x571a42(0x159)]+_0x571a42(0x1f4)+_0x4a962d[_0x571a42(0x159)]);_0x5623f5['set'](_0x4a962d[_0x571a42(0x22a)],_0x4a962d);}return[..._0x5623f5[_0x571a42(0x2a2)]()];}async function syncProductCapabilityDirs(_0x3e7b50,_0x17b361,_0x4b9c27){const _0x2d0e60=_0x31e6db,_0x181c4d=await collectCapabilityEntries(_0x3e7b50,_0x4b9c27);await rm(_0x17b361,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await mkdir(_0x17b361,{'recursive':!![]});for(const _0x1a8e04 of _0x181c4d){await cp(_0x1a8e04['path'],join(_0x17b361,_0x1a8e04[_0x2d0e60(0x22a)]),{'recursive':!![]});}return _0x181c4d[_0x2d0e60(0x118)];}export const __test__={'collectCapabilityEntries':collectCapabilityEntries,'prunePackagedRuntimePayload':prunePackagedRuntimePayload,'syncProductCapabilityDirs':syncProductCapabilityDirs,'resolveNodeExtractRoot':resolveNodeExtractRoot};async function syncProductAgents(_0x51a1a4,_0x1d7500,_0x4d1cdc){const _0xd230b5=_0x31e6db,_0x2ab384=join(_0x1d7500,'openclaw','agents'),_0x5b55bf=await syncProductCapabilityDirs(_0x51a1a4[_0xd230b5(0x2f4)][_0xd230b5(0x33b)+_0xd230b5(0xc2)+_0xd230b5(0xd6)],_0x2ab384,_0xd230b5(0xd0));_0x4d1cdc['agents']={'source':_0xd230b5(0x156),'installPath':toRuntimeRelative(_0x1d7500,_0x2ab384),'localPaths':_0x51a1a4[_0xd230b5(0x2f4)][_0xd230b5(0x33b)+'LocalAge'+_0xd230b5(0xd6)],'entryCount':_0x5b55bf};}async function syncProductSkills(_0x2d39f4,_0x1c2b28,_0x3f7cf7){const _0x33bf28=_0x31e6db,_0x886de=join(_0x1c2b28,_0x33bf28(0x2f4),'skills'),_0x575718=await syncProductCapabilityDirs(_0x2d39f4[_0x33bf28(0x2f4)][_0x33bf28(0x33b)+'LocalSki'+_0x33bf28(0x1a4)],_0x886de,_0x33bf28(0x283));_0x3f7cf7[_0x33bf28(0x1fd)]={'source':_0x33bf28(0x156),'installPath':toRuntimeRelative(_0x1c2b28,_0x886de),'localPaths':_0x2d39f4[_0x33bf28(0x2f4)][_0x33bf28(0x33b)+_0x33bf28(0xd2)+_0x33bf28(0x1a4)],'entryCount':_0x575718};}
|
|
1
|
+
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(_0x35ec98,_0x2cbdfa){const _0x55e56c=_0x2fe5,_0x1a101d=_0x35ec98();while(!![]){try{const _0x1dad4c=parseInt(_0x55e56c(0x28c))/0x1+parseInt(_0x55e56c(0x220))/0x2*(parseInt(_0x55e56c(0x282))/0x3)+-parseInt(_0x55e56c(0x1f2))/0x4+-parseInt(_0x55e56c(0x228))/0x5*(-parseInt(_0x55e56c(0x28b))/0x6)+parseInt(_0x55e56c(0x287))/0x7+-parseInt(_0x55e56c(0x245))/0x8*(-parseInt(_0x55e56c(0x27e))/0x9)+-parseInt(_0x55e56c(0x274))/0xa;if(_0x1dad4c===_0x2cbdfa)break;else _0x1a101d['push'](_0x1a101d['shift']());}catch(_0x317f09){_0x1a101d['push'](_0x1a101d['shift']());}}}(_0x5638,0x9e668));export function patchChannelPluginRuntimeFromSource(_0x1af087,_0x44e52a={}){const _0x354928=_0x2fe5,_0xa80516=_0x44e52a['runtimeC'+_0x354928(0x208)+'portPath'];if(!_0xa80516)return{'patched':![],'reason':'runtime-'+_0x354928(0x1ec)+_0x354928(0x244)+_0x354928(0x20a)+'ded'};if(_0x1af087[_0x354928(0x26a)](_0x354928(0x24e)+_0x354928(0x258)+'meChanne'+'l')){if(_0x1af087['includes'](_0x354928(0x23e)+'istingCh'+_0x354928(0x22d)+'rn\x20??')&&hasRuntimeChannelImport(_0x1af087,_0xa80516))return{'patched':![],'reason':'already-'+_0x354928(0x276)};return patchExistingChannelPluginRuntimeFromSource(_0x1af087,{'runtimeChannelImportPath':_0xa80516});}if(_0x1af087[_0x354928(0x26a)]('wujieCha'+_0x354928(0x26e)+_0x354928(0x237)+'se'))return patchExistingChannelPluginRuntimeFromSource(_0x1af087,{'runtimeChannelImportPath':_0xa80516});const _0x3881f9=_0x354928(0x259)+_0x354928(0x25c)+_0x354928(0x288)+_0x354928(0x22b)+_0x354928(0x267)+_0x354928(0x1f3)+_0x354928(0x1fb)+_0x354928(0x227)+'\x09\x09resolv'+'edRuntim'+_0x354928(0x241)+_0x354928(0x23a)+_0x354928(0x260)+_0x354928(0x273)+_0x354928(0x221)+_0x354928(0x257)+_0x354928(0x262)+_0x354928(0x207)+'eturn\x20re'+_0x354928(0x25c)+_0x354928(0x278)+_0x354928(0x224);if(!_0x1af087[_0x354928(0x26a)](_0x3881f9))return{'patched':![],'reason':'not-foun'+'d'};const _0x429089=_0x354928(0x20b)+_0x354928(0x206)+_0x354928(0x277)+_0x354928(0x240)+_0x354928(0x264)+';';if(!_0x1af087[_0x354928(0x26a)](_0x429089))return{'patched':![],'reason':_0x354928(0x244)+'ot-found'};const _0x4691e0=_0x354928(0x259)+_0x354928(0x25c)+_0x354928(0x288)+_0x354928(0x22b)+_0x354928(0x27b)+_0x354928(0x1fc)+'eChannel'+_0x354928(0x1fd)+_0x354928(0x23b)+_0x354928(0x24c)+'e)\x20=>\x20{\x0a'+'\x09\x09\x09if\x20(!'+_0x354928(0x286)+'||\x20typeo'+'f\x20runtim'+_0x354928(0x25e)+'bject\x22)\x20'+'return\x20r'+_0x354928(0x22a)+_0x354928(0x219)+_0x354928(0x1f4)+_0x354928(0x21c)+_0x354928(0x243)+'n\x20&&\x20run'+_0x354928(0x24a)+_0x354928(0x1f6)+_0x354928(0x1fe)+_0x354928(0x239)+_0x354928(0x231)+_0x354928(0x25f)+_0x354928(0x201)+_0x354928(0x26e)+_0x354928(0x223)+_0x354928(0x236)+_0x354928(0x232)+_0x354928(0x253)+');\x0a\x09\x09\x09co'+'nst\x20exis'+_0x354928(0x275)+_0x354928(0x238)+_0x354928(0x268)+_0x354928(0x247)+_0x354928(0x27f)+'runtime.'+_0x354928(0x24f)+_0x354928(0x21b)+_0x354928(0x1f5)+_0x354928(0x1f4)+_0x354928(0x24d)+'\x20{};\x0a\x09\x09\x09'+'runtime.'+_0x354928(0x24f)+'=\x20{\x0a\x09\x09\x09\x09'+_0x354928(0x20d)+_0x354928(0x255)+_0x354928(0x28a)+_0x354928(0x26c)+_0x354928(0x283)+_0x354928(0x1ed)+_0x354928(0x1ee)+_0x354928(0x215)+_0x354928(0x211)+'Channel.'+_0x354928(0x20f)+_0x354928(0x28d)+_0x354928(0x225)+_0x354928(0x255)+'e.runtim'+'eContext'+_0x354928(0x266)+_0x354928(0x212)+_0x354928(0x211)+'Channel.'+_0x354928(0x285)+_0x354928(0x225)+_0x354928(0x255)+'e.inboun'+_0x354928(0x203)+_0x354928(0x234)+_0x354928(0x24b)+_0x354928(0x270)+_0x354928(0x235)+'stingCha'+_0x354928(0x254)+'ound\x20??\x20'+_0x354928(0x249)+'untime.t'+_0x354928(0x20c)+_0x354928(0x204)+_0x354928(0x226)+_0x354928(0x265)+_0x354928(0x261)+_0x354928(0x22c)+_0x354928(0x283)+_0x354928(0x23d)+_0x354928(0x225)+_0x354928(0x255)+_0x354928(0x25b)+_0x354928(0x289)+_0x354928(0x21f)+_0x354928(0x279)+_0x354928(0x1ff)+_0x354928(0x248)+_0x354928(0x26d)+_0x354928(0x246)+_0x354928(0x284)+_0x354928(0x217)+_0x354928(0x20e)+_0x354928(0x213)+_0x354928(0x251)+_0x354928(0x267)+_0x354928(0x1f3)+_0x354928(0x1fb)+_0x354928(0x227)+_0x354928(0x1fa)+'edRuntim'+_0x354928(0x281)+_0x354928(0x1fc)+_0x354928(0x218)+_0x354928(0x1fd)+_0x354928(0x26b)+_0x354928(0x1eb)+_0x354928(0x1f9)+'inRuntim'+_0x354928(0x230)+(_0x354928(0x1ea)+_0x354928(0x250)+_0x354928(0x25d)+'\x09return\x20'+_0x354928(0x256)+'Runtime;'+'\x0a\x09\x09};');return{'patched':!![],'source':_0x1af087['replace'](_0x429089,_0x429089+'\x0a'+createRuntimeChannelImport(_0xa80516))[_0x354928(0x21e)](_0x3881f9,_0x4691e0)};}function patchExistingChannelPluginRuntimeFromSource(_0x216d68,_0x51943a){const _0x5a0b99=_0x2fe5,{runtimeChannelImportPath:_0x521964}=_0x51943a,_0x4ab883=_0x5a0b99(0x20b)+_0x5a0b99(0x206)+_0x5a0b99(0x277)+_0x5a0b99(0x240)+_0x5a0b99(0x264)+';';if(!_0x216d68[_0x5a0b99(0x26a)](_0x4ab883))return{'patched':![],'reason':_0x5a0b99(0x244)+_0x5a0b99(0x216)};const _0x7d2c7e='\x09\x09let\x20re'+_0x5a0b99(0x25c)+_0x5a0b99(0x288)+'null;',_0x341d77=_0x5a0b99(0x22f)+_0x5a0b99(0x1f7)+_0x5a0b99(0x1f8)+_0x5a0b99(0x210)+_0x5a0b99(0x27a)+_0x5a0b99(0x21a)+'ZY_RUNTI'+'ME_REFLE'+_0x5a0b99(0x1f1)+'YS);',_0x1fc864=_0x216d68[_0x5a0b99(0x28e)](_0x7d2c7e),_0x17cb4a=_0x216d68[_0x5a0b99(0x28e)](_0x341d77,_0x1fc864);if(_0x1fc864===-0x1||_0x17cb4a===-0x1)return{'patched':![],'reason':_0x5a0b99(0x280)+'d'};const _0x3af4c3=_0x5a0b99(0x259)+'solvedRu'+_0x5a0b99(0x288)+_0x5a0b99(0x22b)+_0x5a0b99(0x27b)+_0x5a0b99(0x1fc)+_0x5a0b99(0x218)+'RuntimeH'+_0x5a0b99(0x23b)+'\x20(runtim'+_0x5a0b99(0x272)+_0x5a0b99(0x1ef)+'runtime\x20'+_0x5a0b99(0x21d)+_0x5a0b99(0x229)+'e\x20!==\x20\x22o'+'bject\x22)\x20'+_0x5a0b99(0x200)+_0x5a0b99(0x22a)+_0x5a0b99(0x219)+_0x5a0b99(0x1f4)+'hannel?.'+_0x5a0b99(0x243)+'n\x20&&\x20run'+_0x5a0b99(0x24a)+'nnel?.in'+_0x5a0b99(0x1fe)+_0x5a0b99(0x239)+_0x5a0b99(0x231)+_0x5a0b99(0x25f)+_0x5a0b99(0x201)+'nnelRunt'+_0x5a0b99(0x223)+_0x5a0b99(0x236)+_0x5a0b99(0x232)+_0x5a0b99(0x253)+_0x5a0b99(0x269)+_0x5a0b99(0x252)+_0x5a0b99(0x275)+_0x5a0b99(0x238)+_0x5a0b99(0x268)+'annel\x20&&'+_0x5a0b99(0x27f)+_0x5a0b99(0x214)+_0x5a0b99(0x24f)+_0x5a0b99(0x21b)+_0x5a0b99(0x1f5)+_0x5a0b99(0x1f4)+_0x5a0b99(0x24d)+'\x20{};\x0a\x09\x09\x09'+_0x5a0b99(0x214)+'channel\x20'+_0x5a0b99(0x26f)+_0x5a0b99(0x20d)+_0x5a0b99(0x255)+_0x5a0b99(0x28a)+_0x5a0b99(0x26c)+_0x5a0b99(0x283)+'l,\x0a\x09\x09\x09\x09r'+_0x5a0b99(0x1ee)+_0x5a0b99(0x215)+_0x5a0b99(0x211)+_0x5a0b99(0x263)+'runtimeC'+'ontexts\x20'+_0x5a0b99(0x225)+_0x5a0b99(0x255)+'e.runtim'+_0x5a0b99(0x202)+_0x5a0b99(0x266)+_0x5a0b99(0x212)+_0x5a0b99(0x211)+_0x5a0b99(0x263)+'inbound\x20'+_0x5a0b99(0x225)+'elRuntim'+_0x5a0b99(0x205)+_0x5a0b99(0x203)+'urn:\x20exi'+_0x5a0b99(0x24b)+_0x5a0b99(0x270)+'n\x20??\x20exi'+'stingCha'+_0x5a0b99(0x254)+_0x5a0b99(0x271)+_0x5a0b99(0x249)+_0x5a0b99(0x22e)+'urn\x20??\x20c'+_0x5a0b99(0x204)+_0x5a0b99(0x226)+_0x5a0b99(0x265)+'\x09\x09\x09reply'+_0x5a0b99(0x22c)+_0x5a0b99(0x283)+_0x5a0b99(0x23d)+_0x5a0b99(0x225)+_0x5a0b99(0x255)+_0x5a0b99(0x25b)+_0x5a0b99(0x289)+_0x5a0b99(0x21f)+_0x5a0b99(0x279)+_0x5a0b99(0x1ff)+_0x5a0b99(0x248)+'\x20channel'+_0x5a0b99(0x246)+_0x5a0b99(0x284)+_0x5a0b99(0x217)+_0x5a0b99(0x20e)+_0x5a0b99(0x213)+_0x5a0b99(0x251)+_0x5a0b99(0x267)+'solveRun'+_0x5a0b99(0x1fb)+_0x5a0b99(0x227)+'\x09\x09resolv'+_0x5a0b99(0x25a)+'e\x20??=\x20en'+'sureWuji'+_0x5a0b99(0x218)+_0x5a0b99(0x1fd)+_0x5a0b99(0x26b)+_0x5a0b99(0x1eb)+_0x5a0b99(0x1f9)+_0x5a0b99(0x27d)+_0x5a0b99(0x230)+('ons.runt'+_0x5a0b99(0x250)+_0x5a0b99(0x25d)+_0x5a0b99(0x20e)+_0x5a0b99(0x256)+_0x5a0b99(0x242)+_0x5a0b99(0x209)),_0xa6c178=_0x216d68[_0x5a0b99(0x222)](0x0,_0x1fc864)+_0x3af4c3+_0x216d68[_0x5a0b99(0x222)](_0x17cb4a);return{'patched':!![],'source':ensureRuntimeChannelImport(_0xa6c178,{'importMarker':_0x4ab883,'runtimeChannelImportPath':_0x521964})};}function _0x2fe5(_0x1de88b,_0x150fdd){_0x1de88b=_0x1de88b-0x1ea;const _0x5638d0=_0x5638();let _0x2fe525=_0x5638d0[_0x1de88b];return _0x2fe525;}function createRuntimeChannelImport(_0x515c12){const _0x2975cf=_0x2fe5;return'import\x20{'+'\x20createR'+'untimeCh'+_0x2975cf(0x1f0)+'\x20wujieCr'+_0x2975cf(0x23f)+'imeChann'+_0x2975cf(0x23c)+_0x2975cf(0x27c)+_0x515c12+'\x22;';}function hasRuntimeChannelImport(_0x219cdf,_0x2fe4e6){const _0x14704e=_0x2fe5;return _0x219cdf[_0x14704e(0x26a)](createRuntimeChannelImport(_0x2fe4e6));}function ensureRuntimeChannelImport(_0x15423d,{importMarker:_0x3d814a,runtimeChannelImportPath:_0xd1f5a0}){const _0x52908a=_0x2fe5,_0x5babdf=createRuntimeChannelImport(_0xd1f5a0),_0x44408d=/import \{ createRuntimeChannel as wujieCreateRuntimeChannel \} from "\.\/runtime-channel-[^"]+\.js";\n?/;if(_0x44408d[_0x52908a(0x233)](_0x15423d))return _0x15423d[_0x52908a(0x21e)](_0x44408d,_0x5babdf+'\x0a');return _0x15423d[_0x52908a(0x21e)](_0x3d814a,_0x3d814a+'\x0a'+_0x5babdf);}function _0x5638(){const _0x364af8=['indexOf','ons.runt','esolveCr','channel-','l,\x0a\x09\x09\x09\x09r','untimeCo','\x09\x09\x09if\x20(!','annel\x20as','CTION_KE','3115128SjzDaX','solveRun','untime.c','ect\x22\x20?\x20r','nnel?.in','lazyRunt','imeRefle','eatePlug','\x09\x09resolv','time\x20=\x20(','sureWuji','RuntimeH','bound?.r','annel.se','return\x20r','onst\x20cha','eContext','d,\x0a\x09\x09\x09\x09t','hannelRu','e.inboun','\x20createH','s);\x0a\x09\x09\x09r','hannelIm','\x0a\x09\x09};\x0a','ot-provi','import\x20{','urn\x20??\x20c','...chann','\x09return\x20','runtimeC','ctionKey','existing','nbound:\x20','runtime;','runtime.','ntexts:\x20','ot-found','\x09\x09\x09};\x0a\x09\x09','eChannel','\x09\x09\x09if\x20(r','w\x20Set(LA','===\x20\x22obj','hannel?.','||\x20typeo','replace','sion:\x20ex','2nfgZJW','()(optio','slice','ime\x20=\x20wu','\x09};','??\x20chann','ntime.in',')\x20=>\x20{\x0a\x09','5355jbXsXF','f\x20runtim','untime;\x0a','null;\x0a\x09\x09',':\x20existi','annel.tu','untime.t','\x09\x09const\x20','e()(opti','rn\x20runti','eRuntime','test','urn:\x20exi','n\x20??\x20exi','jieCreat','imePromi','nel\x20=\x20ru','un)\x20retu','solveCre','elpers\x20=','el\x20}\x20fro','l.reply\x20','turn:\x20ex','eateRunt','om\x20\x22node','e\x20??=\x20re','Runtime;','turn?.ru','import-n','3088952RvfVzb','Runtime.','annel\x20&&','ssion\x20??','channelR','time.cha','stingCha','\x20(runtim','hannel\x20:','wujieCre','channel\x20','imeOptio','\x0a\x09\x09};\x0a\x09\x09','nst\x20exis','Channel(','nnel.inb','elRuntim','resolved','ns.runti','ateRunti','\x09\x09let\x20re','edRuntim','e.reply,','solvedRu','ns));\x0a\x09\x09','e\x20!==\x20\x22o','me;\x0a\x09\x09\x09c','atePlugi','\x09\x09\x09reply','meOption','Channel.',':crypto\x22','bound,\x0a\x09','s,\x0a\x09\x09\x09\x09i','const\x20re','ntime.ch',');\x0a\x09\x09\x09co','includes','elpers(r','..existi','\x20channel','nnelRunt','=\x20{\x0a\x09\x09\x09\x09','nnel.tur','ound\x20??\x20','e)\x20=>\x20{\x0a','nRuntime','26382590zIrMfr','tingChan','patched','ash\x20}\x20fr','ntime;\x0a\x09','istingCh','Set\x20=\x20ne','const\x20en','m\x20\x22','inRuntim','18PVXKkD','\x20typeof\x20','not-foun','e\x20??=\x20en','3429339eKjrwO','ngChanne','session\x0a','inbound\x20','runtime\x20','235788GFjLrR','ntime\x20=\x20','\x0a\x09\x09\x09\x09ses','e,\x0a\x09\x09\x09\x09.','5826ZnnzLT','1076873sldTuo','ontexts\x20'];_0x5638=function(){return _0x364af8;};return _0x5638();}
|
|
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);}
|