@wujie-shell/core 1.0.2 → 1.0.3
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/README.md +7 -5
- 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/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 -0
- 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 -0
- 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/main.mjs +1 -1
- package/dist/src/electron/preload.mjs +1 -1
- package/dist/src/electron/protocol-url-state.mjs +1 -0
- package/dist/src/events/domain-event-journal.mjs +1 -0
- 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 -0
- 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 -0
- package/dist/src/request-id/runtime-bridge.mjs +1 -0
- package/dist/src/request-id/session-store.mjs +1 -0
- package/dist/src/request-id/title.mjs +1 -0
- package/dist/src/runtime/cron-missed-run-policy.mjs +1 -0
- 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-history-mixed-tool-content.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 -0
- package/dist/src/runtime/patch-request-id-title-runtime.mjs +1 -0
- package/dist/src/runtime/patch-session-store-sqlite.mjs +1 -1
- package/dist/src/runtime/patch-weixin-outbound-session-route.mjs +1 -0
- 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 -0
- package/dist/src/sessions/session-runtime-state.mjs +1 -0
- package/dist/src/sessions/session-sqlite-store.mjs +1 -1
- package/dist/src/sessions/sql/001_init.sql +2 -1
- package/dist/src/sessions/sql/004_request_id_titles.sql +15 -0
- package/dist/src/sessions/sql/005_session_subagents.sql +31 -0
- package/dist/src/sessions/sql/006_session_process_snapshot.sql +24 -0
- package/dist/src/sessions/sql/schema.md +53 -3
- 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 _0x96c1f6=_0x2ee8;(function(_0x4ca1df,_0x2355fb){const _0x34e9ce=_0x2ee8,_0x2cab87=_0x4ca1df();while(!![]){try{const _0x3b1040=-parseInt(_0x34e9ce(0x299))/0x1+-parseInt(_0x34e9ce(0x2e7))/0x2*(parseInt(_0x34e9ce(0x36f))/0x3)+-parseInt(_0x34e9ce(0x350))/0x4*(-parseInt(_0x34e9ce(0x197))/0x5)+parseInt(_0x34e9ce(0x35b))/0x6*(-parseInt(_0x34e9ce(0x321))/0x7)+-parseInt(_0x34e9ce(0x307))/0x8*(parseInt(_0x34e9ce(0x278))/0x9)+-parseInt(_0x34e9ce(0x2fc))/0xa*(parseInt(_0x34e9ce(0x26f))/0xb)+-parseInt(_0x34e9ce(0x2fa))/0xc*(-parseInt(_0x34e9ce(0x20d))/0xd);if(_0x3b1040===_0x2355fb)break;else _0x2cab87['push'](_0x2cab87['shift']());}catch(_0x1745ba){_0x2cab87['push'](_0x2cab87['shift']());}}}(_0x29ee,0xe4e4e));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,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{patchChannelPluginRuntimeFromSource}from'./patch-channel-plugin-runtime.mjs';import{patchProviderRequestIdHeaderFromSource}from'./patch-provider-request-id-header.mjs';function _0x2ee8(_0x171734,_0x534cd3){_0x171734=_0x171734-0x177;const _0x29ee8f=_0x29ee();let _0x2ee820=_0x29ee8f[_0x171734];return _0x2ee820;}import{patchSessionStoreLoadFromSource,patchSessionStoreWriteFromSource}from'./patch-session-store-sqlite.mjs';const RUNTIME_DIR=_0x96c1f6(0x2b4)+'time',MANIFEST_NAME='runtime-'+_0x96c1f6(0x1d3)+'.json',NPM_INSTALL_TIMEOUT_MS=0xf*0x3c*0x3e8;export function resolveRuntimeRoot(_0x5ed689){if(process.env.WUJIE_SHELL_RUNTIME_ROOT)return resolve(process.env.WUJIE_SHELL_RUNTIME_ROOT);return resolve(_0x5ed689,RUNTIME_DIR);}export function resolveManifestPath(_0x50153){return join(_0x50153,MANIFEST_NAME);}async function loadProductRuntime(_0x167913,_0x3e112d){const _0x5f5cac=_0x96c1f6,_0x1f6b02=[join(_0x167913,'shell-ru'+_0x5f5cac(0x1a9),_0x5f5cac(0x375)+'s'),join(_0x3e112d,'shell-ru'+_0x5f5cac(0x1a9),_0x5f5cac(0x375)+'s')];for(const _0x170adb of _0x1f6b02){if(!existsSync(_0x170adb))continue;return await import(pathToFileURL(_0x170adb)[_0x5f5cac(0x17d)]+_0x5f5cac(0x389)+Date[_0x5f5cac(0x1b7)]());}return{};}export async function prepareRuntime(_0x5874e5,{syncOnly:syncOnly=![]}={}){const _0x3c2f90=_0x96c1f6,_0x7fc3e6=resolveRuntimeRoot(_0x5874e5[_0x3c2f90(0x250)+_0x3c2f90(0x310)]),_0x535141=createRuntimeLogger(getConfigPaths(_0x5874e5),_0x3c2f90(0x200)),_0x594b91=Date[_0x3c2f90(0x1b7)]();_0x535141?.['info'](_0x3c2f90(0x29e)+_0x3c2f90(0x1df)+_0x3c2f90(0x18f),{'syncOnly':syncOnly,'runtimeRoot':_0x7fc3e6,'shellConfig':summarizeShellConfig(_0x5874e5)});try{const _0x59e799=await ensureRuntimeBase(_0x5874e5,_0x7fc3e6,{'runtimeLogger':_0x535141,'syncOnly':syncOnly});_0x535141?.[_0x3c2f90(0x1f5)]('runtime\x20'+_0x3c2f90(0x1d3)+'\x20loaded',{'manifestPath':resolveManifestPath(_0x7fc3e6),'manifest':summarizeRuntimeManifest(_0x59e799)}),validateRuntimeNodeVersion(_0x59e799,_0x5874e5),_0x535141?.['info']('runtime\x20'+_0x3c2f90(0x1ab)+_0x3c2f90(0x36b)+_0x3c2f90(0x270),{'nodeVersion':_0x59e799[_0x3c2f90(0x1a5)+_0x3c2f90(0x2aa)]});if(syncOnly)validateRuntimeOpenClawVersion(_0x59e799,_0x5874e5),_0x535141?.[_0x3c2f90(0x1f5)]('runtime\x20'+'openclaw'+_0x3c2f90(0x28c)+_0x3c2f90(0x1c5)+'ed',{'openclawVersion':_0x59e799[_0x3c2f90(0x3ac)+_0x3c2f90(0x373)]});else{if(_0x59e799[_0x3c2f90(0x3ac)+_0x3c2f90(0x373)]!==_0x5874e5[_0x3c2f90(0x3ac)][_0x3c2f90(0x3ac)+'Version']){const _0x304538=await loadRuntimeInfo(_0x5874e5['projectR'+_0x3c2f90(0x310)]);_0x535141?.[_0x3c2f90(0x1f5)](_0x3c2f90(0x3ac)+_0x3c2f90(0x2d4)+_0x3c2f90(0x23a)+_0x3c2f90(0x27d),{'fromVersion':_0x59e799[_0x3c2f90(0x3ac)+_0x3c2f90(0x373)]||_0x3c2f90(0x35a),'toVersion':_0x5874e5[_0x3c2f90(0x3ac)]['openclaw'+'Version']}),await installOpenClawPackage(_0x304538,_0x5874e5[_0x3c2f90(0x3ac)]['openclaw'+_0x3c2f90(0x373)]),_0x59e799[_0x3c2f90(0x3ac)+_0x3c2f90(0x373)]=_0x5874e5[_0x3c2f90(0x3ac)][_0x3c2f90(0x3ac)+_0x3c2f90(0x373)],_0x535141?.['info']('openclaw'+_0x3c2f90(0x2d4)+_0x3c2f90(0x23a)+_0x3c2f90(0x2f7)+'ed',{'openclawVersion':_0x59e799[_0x3c2f90(0x3ac)+'Version']});}}_0x59e799[_0x3c2f90(0x34c)+_0x3c2f90(0x1c7)]=new Date()[_0x3c2f90(0x264)+_0x3c2f90(0x248)](),_0x59e799[_0x3c2f90(0x1a5)+'ion']=_0x5874e5[_0x3c2f90(0x3ac)][_0x3c2f90(0x1a5)+'ion'],_0x59e799[_0x3c2f90(0x27b)]={'appId':_0x5874e5[_0x3c2f90(0x3a5)],'productName':_0x5874e5[_0x3c2f90(0x249)+'ame'],'dataDirName':_0x5874e5[_0x3c2f90(0x351)+_0x3c2f90(0x183)]},await patchChatHistoryMixedToolContentBug(_0x7fc3e6,_0x59e799,{'runtimeLogger':_0x535141}),await patchProviderRequestIdHeader(_0x7fc3e6,_0x59e799,{'runtimeLogger':_0x535141}),await patchChannelPluginRuntimeBug(_0x7fc3e6,_0x59e799,{'runtimeLogger':_0x535141});const _0x50711c=await loadProductRuntime(_0x5874e5[_0x3c2f90(0x250)+_0x3c2f90(0x310)],_0x7fc3e6);if(typeof _0x50711c[_0x3c2f90(0x30e)+_0x3c2f90(0x2a0)+'ntime']===_0x3c2f90(0x2a5)){const _0x54fd4=createRuntimeInfoFromManifest(_0x7fc3e6,_0x59e799);await _0x50711c[_0x3c2f90(0x30e)+_0x3c2f90(0x2a0)+_0x3c2f90(0x1a9)]({'shellConfig':_0x5874e5,'runtime':_0x54fd4,'runtimeLogger':_0x535141,'syncOnly':syncOnly}),_0x535141?.[_0x3c2f90(0x1f5)](_0x3c2f90(0x382)+_0x3c2f90(0x1df)+'tools\x20sy'+_0x3c2f90(0x34e));}await patchSessionStoreSqliteRuntime(_0x7fc3e6,_0x59e799,{'runtimeLogger':_0x535141});!syncOnly&&(await installRuntimeLarkCliPackage(createRuntimeInfoFromManifest(_0x7fc3e6,_0x59e799),{'runtimeLogger':_0x535141,'createRuntimeEnv':createRuntimeEnv}),_0x535141?.[_0x3c2f90(0x1f5)](_0x3c2f90(0x29f)+_0x3c2f90(0x2b5)+_0x3c2f90(0x2d4)+'\x20synced'),await hasConfiguredKdocsSkill(_0x5874e5)?(await installKdocsCliBinary(_0x5874e5,createRuntimeInfoFromManifest(_0x7fc3e6,_0x59e799),{'runtimeLogger':_0x535141,'syncOnly':syncOnly}),_0x535141?.[_0x3c2f90(0x1f5)](_0x3c2f90(0x1a8)+_0x3c2f90(0x1ef)+_0x3c2f90(0x38e)+_0x3c2f90(0x288))):_0x535141?.['info'](_0x3c2f90(0x1a8)+_0x3c2f90(0x1ef)+_0x3c2f90(0x38e)+_0x3c2f90(0x2e1)+_0x3c2f90(0x202)+_0x3c2f90(0x39d)+_0x3c2f90(0x1dd)+'red'));const _0x570e05=Array[_0x3c2f90(0x182)](_0x59e799[_0x3c2f90(0x251)])?_0x59e799[_0x3c2f90(0x251)][_0x3c2f90(0x1c9)]:0x0;return await syncManifestPluginScope(_0x5874e5,_0x7fc3e6,_0x59e799),_0x535141?.[_0x3c2f90(0x1f5)](_0x3c2f90(0x1df)+_0x3c2f90(0x2f0)+'cope\x20syn'+_0x3c2f90(0x1bd),{'beforePluginCount':_0x570e05,'afterPluginCount':Array['isArray'](_0x59e799[_0x3c2f90(0x251)])?_0x59e799[_0x3c2f90(0x251)][_0x3c2f90(0x1c9)]:0x0,'pluginSpecCount':Array[_0x3c2f90(0x182)](_0x59e799[_0x3c2f90(0x25d)+_0x3c2f90(0x325)])?_0x59e799[_0x3c2f90(0x25d)+'ecs'][_0x3c2f90(0x1c9)]:0x0}),await syncConfiguredNpmPlugins(_0x5874e5,_0x7fc3e6,_0x59e799,{'runtimeLogger':_0x535141,'syncOnly':syncOnly}),_0x535141?.[_0x3c2f90(0x1f5)]('configur'+_0x3c2f90(0x18d)+_0x3c2f90(0x38b)+_0x3c2f90(0x398),{'pluginSpecCount':_0x5874e5[_0x3c2f90(0x3ac)][_0x3c2f90(0x25d)+_0x3c2f90(0x325)][_0x3c2f90(0x1c9)],'pluginCount':Array[_0x3c2f90(0x182)](_0x59e799[_0x3c2f90(0x251)])?_0x59e799['plugins']['length']:0x0}),await syncProductPlugins(_0x5874e5,_0x7fc3e6,_0x59e799,{'runtimeLogger':_0x535141}),_0x535141?.[_0x3c2f90(0x1f5)](_0x3c2f90(0x382)+'plugins\x20'+_0x3c2f90(0x288),{'localPluginCount':_0x5874e5['openclaw'][_0x3c2f90(0x216)+'LocalPlu'+_0x3c2f90(0x198)][_0x3c2f90(0x1c9)],'pluginCount':Array[_0x3c2f90(0x182)](_0x59e799['plugins'])?_0x59e799[_0x3c2f90(0x251)][_0x3c2f90(0x1c9)]:0x0}),await syncProductAgents(_0x5874e5,_0x7fc3e6,_0x59e799),_0x535141?.[_0x3c2f90(0x1f5)]('product\x20'+_0x3c2f90(0x1d1)+_0x3c2f90(0x398),{'sources':_0x5874e5[_0x3c2f90(0x3ac)][_0x3c2f90(0x216)+_0x3c2f90(0x2fd)+_0x3c2f90(0x282)],'entryCount':_0x59e799['agents']?.[_0x3c2f90(0x33c)+'nt'],'installPath':_0x59e799[_0x3c2f90(0x394)]?.[_0x3c2f90(0x1f6)+_0x3c2f90(0x2dc)]}),await syncProductSkills(_0x5874e5,_0x7fc3e6,_0x59e799),_0x535141?.['info'](_0x3c2f90(0x382)+'skills\x20s'+_0x3c2f90(0x398),{'sources':_0x5874e5[_0x3c2f90(0x3ac)][_0x3c2f90(0x216)+'LocalSki'+_0x3c2f90(0x273)],'entryCount':_0x59e799[_0x3c2f90(0x2e2)]?.[_0x3c2f90(0x33c)+'nt'],'installPath':_0x59e799[_0x3c2f90(0x2e2)]?.[_0x3c2f90(0x1f6)+'ath']}),await syncRuntimeWrapper(_0x5874e5,_0x7fc3e6,_0x59e799),_0x535141?.[_0x3c2f90(0x1f5)](_0x3c2f90(0x1df)+_0x3c2f90(0x38a)+_0x3c2f90(0x288),{'wujieclawBin':_0x59e799['wujiecla'+_0x3c2f90(0x240)]}),await prunePackagedRuntimeCaches(_0x7fc3e6,_0x535141),await writeJson(resolveManifestPath(_0x7fc3e6),_0x59e799),_0x535141?.[_0x3c2f90(0x1f5)](_0x3c2f90(0x1df)+_0x3c2f90(0x1d3)+'\x20written',{'manifestPath':resolveManifestPath(_0x7fc3e6),'manifest':summarizeRuntimeManifest(_0x59e799),'durationMs':Date['now']()-_0x594b91}),await _0x535141?.['flush'](),_0x59e799;}catch(_0x3d4c6c){_0x535141?.[_0x3c2f90(0x1e8)](_0x3c2f90(0x29e)+_0x3c2f90(0x1df)+_0x3c2f90(0x1cd),{'syncOnly':syncOnly,'runtimeRoot':_0x7fc3e6,'durationMs':Date[_0x3c2f90(0x1b7)]()-_0x594b91,'error':_0x3d4c6c}),await _0x535141?.[_0x3c2f90(0x2f5)]();throw _0x3d4c6c;}}async function prunePackagedRuntimeCaches(_0x1be02b,_0x2bd3ff){const _0x227b03=_0x96c1f6,_0x2f0864=[join(_0x1be02b,'.cache'),join(_0x1be02b,'.tools',_0x227b03(0x39a)+'e'),join(_0x1be02b,'aipc-run'+_0x227b03(0x184)+_0x227b03(0x2d5)),join(_0x1be02b,_0x227b03(0x334)+_0x227b03(0x226)+'ackup')];for(const _0x385d28 of _0x2f0864){if(!existsSync(_0x385d28))continue;await rm(_0x385d28,{'recursive':!![],'force':!![]}),_0x2bd3ff?.[_0x227b03(0x1f5)](_0x227b03(0x32c)+_0x227b03(0x2ab)+_0x227b03(0x2bd)+_0x227b03(0x23c)+_0x227b03(0x24a),{'cachePath':_0x385d28});}}async function syncRuntimeWrapper(_0x11ac52,_0x3af118,_0xeea617){const _0x5317aa=_0x96c1f6,_0x2605c8=_0x11ac52['openclaw']?.['configFi'+_0x5317aa(0x32d)]??_0x5317aa(0x2e6)+_0x5317aa(0x296),_0x4fee55=join(_0x3af118,'bin',_0x5317aa(0x1af)+'w'),_0x1ef2fa=join(_0x3af118,_0x5317aa(0x1b8),_0x5317aa(0x1af)+_0x5317aa(0x2a6)),_0x21c863=normalizeRuntimeRelativePath(relative(dirname(_0x4fee55),resolve(_0x3af118,_0xeea617[_0x5317aa(0x206)+_0x5317aa(0x1cb)]))),_0x7a6342=normalizeRuntimeRelativePath(relative(dirname(_0x4fee55),resolve(_0x3af118,_0xeea617[_0x5317aa(0x3ac)+_0x5317aa(0x1f2)]))),_0x268c87=_0x5317aa(0x348)+_0x11ac52[_0x5317aa(0x351)+_0x5317aa(0x183)],_0x17772c='%USERPRO'+_0x5317aa(0x341)+_0x11ac52['dataDirN'+_0x5317aa(0x183)];await mkdir(dirname(_0x4fee55),{'recursive':!![]});const _0x1497e6=fileURLToPath(new URL(_0x5317aa(0x1fd)+_0x5317aa(0x228)+_0x5317aa(0x38f)+'mjs',import.meta.url)),_0x58db88=join(_0x3af118,_0x5317aa(0x1b8),_0x5317aa(0x246)+_0x5317aa(0x26e));await cp(_0x1497e6,_0x58db88),await writeFile(_0x4fee55,[_0x5317aa(0x229)+'h',_0x5317aa(0x1b3)+'PENCLAW_'+'HOME=\x22${'+_0x5317aa(0x3a8)+_0x5317aa(0x23b)+_0x268c87+'}\x22',_0x5317aa(0x1b3)+_0x5317aa(0x258)+_0x5317aa(0x20e)+_0x5317aa(0x286)+_0x5317aa(0x195)+_0x5317aa(0x284)+'-'+_0x268c87+'}\x22',_0x5317aa(0x1b3)+_0x5317aa(0x258)+_0x5317aa(0x2c9)+_0x5317aa(0x309)+_0x5317aa(0x383)+_0x5317aa(0x241)+_0x5317aa(0x358)+_0x5317aa(0x1b5)+_0x2605c8+'}\x22',_0x5317aa(0x1b3)+_0x5317aa(0x258)+'CONFIG_P'+_0x5317aa(0x1c1)+_0x5317aa(0x258)+_0x5317aa(0x180)+_0x5317aa(0x2d8)+_0x268c87+'/'+_0x2605c8+'}\x22','SCRIPT_D'+_0x5317aa(0x1d5)+_0x5317aa(0x277)+'--\x20\x22$(di'+_0x5317aa(0x25e)+_0x5317aa(0x2c5)+_0x5317aa(0x294),_0x5317aa(0x263)+_0x5317aa(0x223)+_0x5317aa(0x304)+_0x5317aa(0x2ef)+_0x5317aa(0x31f)+_0x5317aa(0x1ec),_0x5317aa(0x386)+_0x5317aa(0x34a)+_0x21c863+('\x22\x20\x22$SCRI'+_0x5317aa(0x1a3)+_0x5317aa(0x3a6)+_0x5317aa(0x220)+_0x5317aa(0x21d)+_0x5317aa(0x1f1)+'ue'),'fi',_0x5317aa(0x1f3)+_0x5317aa(0x318)+'R/'+_0x21c863+(_0x5317aa(0x292)+'PT_DIR/')+_0x7a6342+'\x22\x20\x22$@\x22',''][_0x5317aa(0x28b)]('\x0a'),_0x5317aa(0x2a3)),await chmod(_0x4fee55,0x1ed),await writeFile(_0x1ef2fa,[_0x5317aa(0x267)+'f','if\x20\x22%OPE'+_0x5317aa(0x33d)+'ME%\x22==\x22\x22'+_0x5317aa(0x2e5)+_0x5317aa(0x39e)+'OME='+_0x17772c+'\x22',_0x5317aa(0x25c)+_0x5317aa(0x195)+_0x5317aa(0x209)+_0x5317aa(0x2f9)+_0x5317aa(0x221)+_0x5317aa(0x1f0)+_0x5317aa(0x392)+_0x17772c+'\x22',_0x5317aa(0x25c)+_0x5317aa(0x285)+_0x5317aa(0x32f)+_0x5317aa(0x388)+'==\x22\x22\x20set'+_0x5317aa(0x327)+_0x5317aa(0x368)+_0x5317aa(0x36d)+_0x5317aa(0x1f9)+_0x2605c8+'\x22',_0x5317aa(0x25c)+_0x5317aa(0x285)+_0x5317aa(0x233)+'H%\x22==\x22\x22\x20'+_0x5317aa(0x255)+_0x5317aa(0x285)+'NFIG_PAT'+'H='+_0x17772c+'\x5c'+_0x2605c8+'\x22',_0x5317aa(0x237)+_0x5317aa(0x2ec)+'%~dp0\x22',_0x5317aa(0x20a)+_0x5317aa(0x31a)+toWindowsPath(_0x21c863)+('\x22\x20\x22%SCRI'+_0x5317aa(0x365))+toWindowsPath(_0x7a6342)+_0x5317aa(0x355),'']['join']('\x0d\x0a'),_0x5317aa(0x2a3)),_0xeea617['wujiecla'+_0x5317aa(0x240)]=toRuntimeRelative(_0x3af118,process[_0x5317aa(0x300)]===_0x5317aa(0x315)?_0x1ef2fa:_0x4fee55);}async function patchChatHistoryMixedToolContentBug(_0x3f540f,_0x54f4bc,_0x1816fb={}){const _0x1aa3ba=_0x96c1f6,_0x23dca0=resolve(_0x3f540f,_0x54f4bc[_0x1aa3ba(0x3ac)+_0x1aa3ba(0x380)+'ir']),_0x2a1416=join(_0x23dca0,'dist');let _0x59db2d=[];try{_0x59db2d=await readdir(_0x2a1416,{'withFileTypes':!![]});}catch{_0x1816fb['runtimeL'+_0x1aa3ba(0x344)]?.[_0x1aa3ba(0x1aa)]?.(_0x1aa3ba(0x177)+_0x1aa3ba(0x24d)+_0x1aa3ba(0x208)+_0x1aa3ba(0x1b4)+_0x1aa3ba(0x326)+_0x1aa3ba(0x2e4)+_0x1aa3ba(0x1fa),{'distDir':_0x2a1416,'openclawVersion':_0x54f4bc[_0x1aa3ba(0x3ac)+_0x1aa3ba(0x373)]});return;}const _0x55aef6=_0x59db2d['filter'](_0x3c716f=>_0x3c716f[_0x1aa3ba(0x1dc)]()&&(_0x3c716f['name'][_0x1aa3ba(0x23e)+'th'](_0x1aa3ba(0x302)+'play-pro'+'jection-')||_0x3c716f[_0x1aa3ba(0x32a)][_0x1aa3ba(0x23e)+'th'](_0x1aa3ba(0x235)+_0x1aa3ba(0x27c)+_0x1aa3ba(0x28a)))&&_0x3c716f[_0x1aa3ba(0x32a)][_0x1aa3ba(0x2f4)](_0x1aa3ba(0x22e)))[_0x1aa3ba(0x18e)](_0x34a3cd=>join(_0x2a1416,_0x34a3cd[_0x1aa3ba(0x32a)]));if(_0x55aef6[_0x1aa3ba(0x1c9)]===0x0){_0x1816fb[_0x1aa3ba(0x2db)+_0x1aa3ba(0x344)]?.['warn']?.(_0x1aa3ba(0x177)+_0x1aa3ba(0x24d)+_0x1aa3ba(0x208)+'patch\x20sk'+_0x1aa3ba(0x26a)+_0x1aa3ba(0x31b)+_0x1aa3ba(0x1fa),{'openclawVersion':_0x54f4bc[_0x1aa3ba(0x3ac)+_0x1aa3ba(0x373)]});return;}for(const _0x398c21 of _0x55aef6){const _0xc89c1d=await readFile(_0x398c21,_0x1aa3ba(0x2a3)),_0x33e23b=patchMixedToolContentFromSource(_0xc89c1d);if(!_0x33e23b[_0x1aa3ba(0x27f)]){if(_0x33e23b[_0x1aa3ba(0x20b)]===_0x1aa3ba(0x24f)+_0x1aa3ba(0x27f)){_0x1816fb['runtimeL'+_0x1aa3ba(0x344)]?.[_0x1aa3ba(0x1f5)]?.(_0x1aa3ba(0x177)+_0x1aa3ba(0x24d)+'ed-tool\x20'+_0x1aa3ba(0x312)+'ready\x20ap'+_0x1aa3ba(0x1e3),{'openclawVersion':_0x54f4bc['openclaw'+_0x1aa3ba(0x373)],'filePath':_0x398c21});return;}continue;}await writeFile(_0x398c21,_0x33e23b[_0x1aa3ba(0x17a)],_0x1aa3ba(0x2a3)),_0x1816fb[_0x1aa3ba(0x2db)+'ogger']?.[_0x1aa3ba(0x1f5)]?.(_0x1aa3ba(0x177)+_0x1aa3ba(0x24d)+_0x1aa3ba(0x208)+_0x1aa3ba(0x28e)+'plied',{'openclawVersion':_0x54f4bc['openclaw'+_0x1aa3ba(0x373)],'filePath':_0x398c21,'note':_0x1aa3ba(0x3ab)+_0x1aa3ba(0x1f4)+'ibility\x20'+'patch\x20fo'+_0x1aa3ba(0x367)+_0x1aa3ba(0x2c1)+_0x1aa3ba(0x192)+'tool\x20his'+_0x1aa3ba(0x29a)+_0x1aa3ba(0x366)+_0x1aa3ba(0x21c)+_0x1aa3ba(0x35c)+_0x1aa3ba(0x35e)+_0x1aa3ba(0x23d)+_0x1aa3ba(0x2ed)+_0x1aa3ba(0x2b0)});return;}_0x1816fb['runtimeL'+_0x1aa3ba(0x344)]?.['warn']?.(_0x1aa3ba(0x177)+_0x1aa3ba(0x24d)+_0x1aa3ba(0x208)+'patch\x20sk'+'ipped;\x20f'+'unction\x20'+'not\x20foun'+'d',{'openclawVersion':_0x54f4bc['openclaw'+_0x1aa3ba(0x373)]});}async function patchProviderRequestIdHeader(_0x1433f7,_0x420f08,_0x1f96fa={}){const _0x58b52b=_0x96c1f6,_0x617cc=resolve(_0x1433f7,_0x420f08[_0x58b52b(0x3ac)+_0x58b52b(0x380)+'ir']),_0x25b38f=join(_0x617cc,_0x58b52b(0x2ad));let _0x3e194f=[];try{_0x3e194f=await readdir(_0x25b38f,{'withFileTypes':!![]});}catch{_0x1f96fa['runtimeL'+_0x58b52b(0x344)]?.[_0x58b52b(0x1aa)]?.(_0x58b52b(0x314)+_0x58b52b(0x378)+_0x58b52b(0x260)+_0x58b52b(0x18c)+_0x58b52b(0x19d)+_0x58b52b(0x1a0)+_0x58b52b(0x2da),{'distDir':_0x25b38f,'openclawVersion':_0x420f08[_0x58b52b(0x3ac)+'Version']});return;}const _0x46b969=_0x3e194f[_0x58b52b(0x399)](_0x48a8a6=>_0x48a8a6[_0x58b52b(0x1dc)]()&&_0x48a8a6[_0x58b52b(0x32a)][_0x58b52b(0x2f4)]('.js'))[_0x58b52b(0x18e)](_0x6301c3=>join(_0x25b38f,_0x6301c3[_0x58b52b(0x32a)]));let _0x5cd37a=0x0,_0x235fdc=0x0;for(const _0x2bf9ca of _0x46b969){const _0x778284=await readFile(_0x2bf9ca,_0x58b52b(0x2a3)),_0x3f9d7e=patchProviderRequestIdHeaderFromSource(_0x778284);if(_0x3f9d7e[_0x58b52b(0x27f)]){await writeFile(_0x2bf9ca,_0x3f9d7e[_0x58b52b(0x17a)],_0x58b52b(0x2a3)),_0x5cd37a+=0x1,_0x1f96fa[_0x58b52b(0x2db)+'ogger']?.[_0x58b52b(0x1f5)]?.(_0x58b52b(0x314)+_0x58b52b(0x378)+'-id\x20head'+_0x58b52b(0x18c)+'\x20applied',{'openclawVersion':_0x420f08[_0x58b52b(0x3ac)+_0x58b52b(0x373)],'filePath':_0x2bf9ca});continue;}if(_0x3f9d7e[_0x58b52b(0x20b)]===_0x58b52b(0x24f)+_0x58b52b(0x27f))_0x235fdc+=0x1;}if(_0x5cd37a>0x0){_0x1f96fa[_0x58b52b(0x2db)+_0x58b52b(0x344)]?.[_0x58b52b(0x1f5)]?.(_0x58b52b(0x314)+'\x20request'+'-id\x20head'+_0x58b52b(0x18c)+_0x58b52b(0x32b),{'openclawVersion':_0x420f08['openclaw'+_0x58b52b(0x373)],'patchedCount':_0x5cd37a,'alreadyPatchedCount':_0x235fdc});return;}if(_0x235fdc>0x0){_0x1f96fa[_0x58b52b(0x2db)+_0x58b52b(0x344)]?.[_0x58b52b(0x1f5)]?.('provider'+_0x58b52b(0x378)+'-id\x20head'+'er\x20patch'+'\x20already'+'\x20applied',{'openclawVersion':_0x420f08['openclaw'+_0x58b52b(0x373)],'alreadyPatchedCount':_0x235fdc});return;}_0x1f96fa[_0x58b52b(0x2db)+_0x58b52b(0x344)]?.[_0x58b52b(0x1aa)]?.(_0x58b52b(0x314)+_0x58b52b(0x378)+_0x58b52b(0x260)+_0x58b52b(0x18c)+_0x58b52b(0x19d)+_0x58b52b(0x291)+'er\x20respo'+_0x58b52b(0x2c0)+_0x58b52b(0x1b9)+'nd',{'openclawVersion':_0x420f08[_0x58b52b(0x3ac)+_0x58b52b(0x373)]});}async function patchChannelPluginRuntimeBug(_0x4d7e76,_0x364eff,_0x2e37b1={}){const _0x224dd8=_0x96c1f6,_0x2c6ff9=resolve(_0x4d7e76,_0x364eff[_0x224dd8(0x3ac)+_0x224dd8(0x380)+'ir']),_0x5c412f=join(_0x2c6ff9,_0x224dd8(0x2ad));let _0x123614=[];try{_0x123614=await readdir(_0x5c412f,{'withFileTypes':!![]});}catch{_0x2e37b1[_0x224dd8(0x2db)+'ogger']?.[_0x224dd8(0x1aa)]?.(_0x224dd8(0x38c)+_0x224dd8(0x19c)+_0x224dd8(0x272)+'atch\x20ski'+_0x224dd8(0x196)+_0x224dd8(0x204)+'ound',{'distDir':_0x5c412f,'openclawVersion':_0x364eff[_0x224dd8(0x3ac)+'Version']});return;}const _0x5b9cb1=_0x123614[_0x224dd8(0x399)](_0x143849=>_0x143849['isFile']()&&_0x143849['name'][_0x224dd8(0x23e)+'th']('loader-')&&_0x143849[_0x224dd8(0x32a)][_0x224dd8(0x2f4)](_0x224dd8(0x22e)))['map'](_0x57444c=>join(_0x5c412f,_0x57444c[_0x224dd8(0x32a)])),_0x555a84=await resolveRuntimeChannelImportPath(_0x5c412f,_0x123614);if(_0x5b9cb1[_0x224dd8(0x1c9)]===0x0){_0x2e37b1['runtimeL'+'ogger']?.['warn']?.(_0x224dd8(0x38c)+'plugin\x20r'+_0x224dd8(0x272)+_0x224dd8(0x297)+_0x224dd8(0x269)+_0x224dd8(0x21e)+_0x224dd8(0x332),{'openclawVersion':_0x364eff[_0x224dd8(0x3ac)+_0x224dd8(0x373)]});return;}if(!_0x555a84){_0x2e37b1['runtimeL'+'ogger']?.[_0x224dd8(0x1aa)]?.('channel\x20'+_0x224dd8(0x19c)+_0x224dd8(0x272)+_0x224dd8(0x297)+_0x224dd8(0x361)+_0x224dd8(0x1d9)+_0x224dd8(0x245)+_0x224dd8(0x1e2)+'found',{'openclawVersion':_0x364eff[_0x224dd8(0x3ac)+_0x224dd8(0x373)],'distDir':_0x5c412f});return;}for(const _0x25ec6e of _0x5b9cb1){const _0x187e4f=await readFile(_0x25ec6e,'utf8'),_0x426fcc=patchChannelPluginRuntimeFromSource(_0x187e4f,{'runtimeChannelImportPath':_0x555a84});if(!_0x426fcc['patched']){if(_0x426fcc[_0x224dd8(0x20b)]==='already-'+_0x224dd8(0x27f)){_0x2e37b1['runtimeL'+'ogger']?.['info']?.(_0x224dd8(0x38c)+_0x224dd8(0x19c)+_0x224dd8(0x272)+_0x224dd8(0x244)+_0x224dd8(0x1e9)+'lied',{'openclawVersion':_0x364eff[_0x224dd8(0x3ac)+_0x224dd8(0x373)],'filePath':_0x25ec6e});return;}continue;}await writeFile(_0x25ec6e,_0x426fcc[_0x224dd8(0x17a)],'utf8'),_0x2e37b1[_0x224dd8(0x2db)+_0x224dd8(0x344)]?.[_0x224dd8(0x1f5)]?.('channel\x20'+_0x224dd8(0x19c)+_0x224dd8(0x272)+_0x224dd8(0x384)+_0x224dd8(0x17b),{'openclawVersion':_0x364eff[_0x224dd8(0x3ac)+'Version'],'filePath':_0x25ec6e,'note':'Temporar'+_0x224dd8(0x1f4)+_0x224dd8(0x2cd)+_0x224dd8(0x2cf)+_0x224dd8(0x367)+_0x224dd8(0x2c1)+_0x224dd8(0x26b)+'nel\x20plug'+_0x224dd8(0x35d)+_0x224dd8(0x329)+'ng\x20chann'+_0x224dd8(0x360)+_0x224dd8(0x397)+'rs;\x20veri'+_0x224dd8(0x395)+_0x224dd8(0x371)+_0x224dd8(0x1e5)+'e\x20upgrad'+'es.'});return;}_0x2e37b1[_0x224dd8(0x2db)+_0x224dd8(0x344)]?.[_0x224dd8(0x1aa)]?.(_0x224dd8(0x38c)+_0x224dd8(0x19c)+_0x224dd8(0x272)+'atch\x20ski'+_0x224dd8(0x361)+'ntime\x20re'+_0x224dd8(0x376)+'ot\x20found',{'openclawVersion':_0x364eff['openclaw'+_0x224dd8(0x373)]});}async function patchSessionStoreSqliteRuntime(_0x4ced34,_0x2e2719,_0x3b4434={}){const _0x22cea0=_0x96c1f6,_0xa9a996=resolve(_0x4ced34,_0x2e2719[_0x22cea0(0x3ac)+_0x22cea0(0x380)+'ir']),_0x5bf34a=join(_0xa9a996,_0x22cea0(0x2ad)),_0x1b416e=_0x22cea0(0x194)+'ell-runt'+_0x22cea0(0x2fe)+'ions/run'+_0x22cea0(0x271)+_0x22cea0(0x203),_0x48b1b2=join(_0x4ced34,_0x22cea0(0x1be)+_0x22cea0(0x1a9),_0x22cea0(0x2f6),'runtime-'+'bridge.m'+'js'),_0x7d49ed=(await readdir(_0x5bf34a,{'withFileTypes':!![]})['catch'](()=>[]))['filter'](_0x39164f=>_0x39164f[_0x22cea0(0x1dc)]()&&_0x39164f[_0x22cea0(0x32a)]['startsWi'+'th'](_0x22cea0(0x2a2)+_0x22cea0(0x2eb))&&_0x39164f[_0x22cea0(0x32a)]['endsWith'](_0x22cea0(0x22e)))[_0x22cea0(0x18e)](_0x1e99d8=>join(_0x5bf34a,_0x1e99d8[_0x22cea0(0x32a)])),_0x483aa9=(await readdir(_0x5bf34a,{'withFileTypes':!![]})[_0x22cea0(0x2d1)](()=>[]))[_0x22cea0(0x399)](_0x5b2be1=>_0x5b2be1[_0x22cea0(0x1dc)]()&&_0x5b2be1[_0x22cea0(0x32a)][_0x22cea0(0x23e)+'th'](_0x22cea0(0x30a))&&!_0x5b2be1[_0x22cea0(0x32a)][_0x22cea0(0x23e)+'th'](_0x22cea0(0x2a2)+_0x22cea0(0x2eb))&&_0x5b2be1[_0x22cea0(0x32a)][_0x22cea0(0x2f4)](_0x22cea0(0x22e)))['map'](_0x31d04f=>join(_0x5bf34a,_0x31d04f[_0x22cea0(0x32a)]));if(!existsSync(_0x48b1b2)){_0x3b4434['runtimeL'+_0x22cea0(0x344)]?.['info']?.('session\x20'+_0x22cea0(0x369)+_0x22cea0(0x230)+_0x22cea0(0x37e)+_0x22cea0(0x256)+_0x22cea0(0x2f1)+'vailable',{'bridgePath':_0x48b1b2,'openclawVersion':_0x2e2719[_0x22cea0(0x3ac)+'Version']});return;}for(const _0x1e86cc of _0x7d49ed){const _0x2ccebc=await readFile(_0x1e86cc,_0x22cea0(0x2a3)),_0x5e5396=patchSessionStoreLoadFromSource(_0x2ccebc,{'bridgeImportPath':_0x1b416e});if(!_0x5e5396['patched']){if(_0x5e5396[_0x22cea0(0x20b)]===_0x22cea0(0x24f)+_0x22cea0(0x27f)){_0x3b4434[_0x22cea0(0x2db)+'ogger']?.[_0x22cea0(0x1f5)]?.(_0x22cea0(0x19b)+'store\x20lo'+_0x22cea0(0x2dd)+_0x22cea0(0x238)+'\x20applied',{'filePath':_0x1e86cc,'openclawVersion':_0x2e2719[_0x22cea0(0x3ac)+'Version']});break;}continue;}await writeFile(_0x1e86cc,_0x5e5396[_0x22cea0(0x17a)],'utf8'),_0x3b4434[_0x22cea0(0x2db)+'ogger']?.['info']?.(_0x22cea0(0x19b)+_0x22cea0(0x34d)+'ad\x20patch'+_0x22cea0(0x2f3),{'filePath':_0x1e86cc,'openclawVersion':_0x2e2719[_0x22cea0(0x3ac)+_0x22cea0(0x373)]});break;}for(const _0x35a534 of _0x483aa9){const _0x27bf52=await readFile(_0x35a534,_0x22cea0(0x2a3)),_0x2a6eb5=patchSessionStoreWriteFromSource(_0x27bf52,{'bridgeImportPath':_0x1b416e});if(!_0x2a6eb5[_0x22cea0(0x27f)]){if(_0x2a6eb5[_0x22cea0(0x20b)]==='already-'+_0x22cea0(0x27f)){_0x3b4434[_0x22cea0(0x2db)+_0x22cea0(0x344)]?.[_0x22cea0(0x1f5)]?.(_0x22cea0(0x19b)+_0x22cea0(0x35f)+'ite\x20patc'+_0x22cea0(0x219)+_0x22cea0(0x207)+'d',{'filePath':_0x35a534,'openclawVersion':_0x2e2719[_0x22cea0(0x3ac)+_0x22cea0(0x373)]});break;}continue;}await writeFile(_0x35a534,_0x2a6eb5[_0x22cea0(0x17a)],_0x22cea0(0x2a3)),_0x3b4434[_0x22cea0(0x2db)+_0x22cea0(0x344)]?.[_0x22cea0(0x1f5)]?.(_0x22cea0(0x19b)+_0x22cea0(0x35f)+_0x22cea0(0x333)+_0x22cea0(0x2ee)+'d',{'filePath':_0x35a534,'openclawVersion':_0x2e2719[_0x22cea0(0x3ac)+_0x22cea0(0x373)]});break;}}async function resolveRuntimeChannelImportPath(_0x3ccfeb,_0x145e35){const _0x2d0c14=_0x96c1f6,_0x497522=_0x145e35['filter'](_0x44f5e0=>_0x44f5e0[_0x2d0c14(0x1dc)]()&&_0x44f5e0[_0x2d0c14(0x32a)][_0x2d0c14(0x23e)+'th'](_0x2d0c14(0x36e)+_0x2d0c14(0x2de))&&_0x44f5e0[_0x2d0c14(0x32a)][_0x2d0c14(0x2f4)](_0x2d0c14(0x22e))&&!_0x44f5e0[_0x2d0c14(0x32a)]['startsWi'+'th'](_0x2d0c14(0x36e)+_0x2d0c14(0x2de)+_0x2d0c14(0x363)))[_0x2d0c14(0x18e)](_0x5f074e=>_0x5f074e[_0x2d0c14(0x32a)])[_0x2d0c14(0x18b)]();for(const _0x23836c of _0x497522){const _0x3ecd85=await readFile(join(_0x3ccfeb,_0x23836c),_0x2d0c14(0x2a3));if(_0x3ecd85[_0x2d0c14(0x1eb)](_0x2d0c14(0x1ca)+_0x2d0c14(0x345)+'nnel'))return'./'+_0x23836c;}return null;}function normalizeRuntimeRelativePath(_0x579363){return _0x579363['replaceA'+'ll']('\x5c','/');}function toWindowsPath(_0xc22ae6){const _0x558058=_0x96c1f6;return _0xc22ae6[_0x558058(0x357)+'ll']('/','\x5c');}function validateRuntimeNodeVersion(_0x55bcd2,_0xf3572e){const _0x41ee03=_0x96c1f6;if(_0x55bcd2['nodeVers'+_0x41ee03(0x2aa)]===_0xf3572e[_0x41ee03(0x3ac)][_0x41ee03(0x1a5)+'ion'])return;throw new Error(_0x41ee03(0x1df)+_0x41ee03(0x1a5)+_0x41ee03(0x396)+_0x41ee03(0x2a1)+_0x41ee03(0x2ba)+(_0x55bcd2[_0x41ee03(0x1a5)+'ion']||_0x41ee03(0x35a))+(',\x20shell.'+_0x41ee03(0x2d6))+_0xf3572e[_0x41ee03(0x3ac)][_0x41ee03(0x1a5)+_0x41ee03(0x2aa)]+'.\x20'+(_0x41ee03(0x3a0)+'ie-shell'+_0x41ee03(0x1a1)+_0x41ee03(0x335)+_0x41ee03(0x252)+_0x41ee03(0x2b5)+'\x20can\x20be\x20'+_0x41ee03(0x324)+_0x41ee03(0x179)+_0x41ee03(0x1dd)+_0x41ee03(0x23f)+_0x41ee03(0x28c)+'.'));}function validateRuntimeOpenClawVersion(_0x584b84,_0x1bda8a){const _0x4d024f=_0x96c1f6;if(_0x584b84[_0x4d024f(0x3ac)+_0x4d024f(0x373)]===_0x1bda8a[_0x4d024f(0x3ac)][_0x4d024f(0x3ac)+_0x4d024f(0x373)])return;throw new Error(_0x4d024f(0x1df)+_0x4d024f(0x3ac)+'Version\x20'+_0x4d024f(0x2c8)+_0x4d024f(0x2fb)+_0x4d024f(0x2e3)+(_0x584b84['openclaw'+_0x4d024f(0x373)]||_0x4d024f(0x35a))+(_0x4d024f(0x261)+_0x4d024f(0x2d6))+_0x1bda8a[_0x4d024f(0x3ac)][_0x4d024f(0x3ac)+_0x4d024f(0x373)]+'.\x20'+(_0x4d024f(0x3a0)+_0x4d024f(0x37a)+_0x4d024f(0x1a1)+_0x4d024f(0x335)+_0x4d024f(0x2b5)+_0x4d024f(0x1f7)+_0x4d024f(0x390)+_0x4d024f(0x1dd)+_0x4d024f(0x1fb)+_0x4d024f(0x29c)+_0x4d024f(0x298)));}function parseNpmPackJson(_0x4eaaf9){const _0x542e3a=_0x96c1f6,_0x375c23=_0x4eaaf9[_0x542e3a(0x1d8)](),_0x44c8a6=_0x375c23[_0x542e3a(0x2e0)]('[');if(_0x44c8a6<0x0)throw new Error(_0x542e3a(0x205)+_0x542e3a(0x212)+_0x542e3a(0x186)+'JSON:\x20'+_0x375c23[_0x542e3a(0x336)](0x0,0x1f4));const _0x356ca1=JSON[_0x542e3a(0x2be)](_0x375c23[_0x542e3a(0x336)](_0x44c8a6)),_0x2f4639=Array['isArray'](_0x356ca1)?_0x356ca1[0x0]:_0x356ca1;if(!_0x2f4639||typeof _0x2f4639!==_0x542e3a(0x20c))throw new Error(_0x542e3a(0x205)+_0x542e3a(0x362)+_0x542e3a(0x283)+_0x542e3a(0x231)+_0x542e3a(0x1bb)+_0x375c23[_0x542e3a(0x336)](0x0,0x1f4));return _0x2f4639;}function normalizePackedTarballFilename(_0x57647c){const _0x247a8e=_0x96c1f6;return _0x57647c['replace'](/^@/,'')[_0x247a8e(0x357)+'ll']('/','-')[_0x247a8e(0x357)+'ll']('\x5c','-');}async function runProcess(_0x3a4b8b,_0x57ad59,_0x588357={}){const _0x43a2a1=_0x96c1f6,_0x4a47ad=_0x588357[_0x43a2a1(0x377)]||[_0x3a4b8b,..._0x57ad59][_0x43a2a1(0x28b)]('\x20'),_0x90e73f=_0x588357[_0x43a2a1(0x38d)+'s']??NPM_INSTALL_TIMEOUT_MS,_0x22c61f=spawn(_0x3a4b8b,_0x57ad59,{'cwd':_0x588357[_0x43a2a1(0x1d7)],'env':_0x588357[_0x43a2a1(0x33b)],'stdio':[_0x43a2a1(0x31e),_0x43a2a1(0x225),_0x43a2a1(0x225)]});return await new Promise((_0x31e744,_0x4f1068)=>{const _0x37a368=_0x43a2a1;let _0x569337='',_0x25d2cb='',_0x242d3c=![];const _0x19e5f2=setTimeout(()=>{const _0x2831e5=_0x2ee8;if(_0x242d3c)return;_0x242d3c=!![],_0x22c61f[_0x2831e5(0x1ac)]('SIGTERM'),_0x4f1068(new Error(_0x4a47ad+(_0x2831e5(0x2a4)+_0x2831e5(0x2e8)+'\x20')+_0x90e73f+'ms'));},_0x90e73f);_0x22c61f[_0x37a368(0x2bc)]['on'](_0x37a368(0x232),_0xd04824=>{const _0x242501=_0x37a368;_0x569337+=_0xd04824[_0x242501(0x2ce)]();}),_0x22c61f[_0x37a368(0x381)]['on'](_0x37a368(0x232),_0x901fca=>{const _0x280dec=_0x37a368;_0x25d2cb+=_0x901fca[_0x280dec(0x2ce)]();}),_0x22c61f['on'](_0x37a368(0x1e8),_0x130d74=>{if(_0x242d3c)return;_0x242d3c=!![],clearTimeout(_0x19e5f2),_0x4f1068(_0x130d74);}),_0x22c61f['on']('close',(_0x40724a,_0x40dc30)=>{const _0x37dbb8=_0x37a368;if(_0x242d3c)return;_0x242d3c=!![],clearTimeout(_0x19e5f2);if(_0x40724a===0x0){_0x31e744({'stdout':_0x569337,'stderr':_0x25d2cb});return;}_0x4f1068(new Error(_0x4a47ad+(_0x37dbb8(0x1fc)+_0x37dbb8(0x3a2)+'e=')+(_0x40724a??_0x37dbb8(0x2d9))+_0x37dbb8(0x259)+(_0x40dc30??'null')+'\x0a'+(''+(_0x25d2cb||_0x569337))['trim']()));});});}async function installOpenClawPackage(_0x35ee7f,_0x56235b){const _0x14128c=_0x96c1f6,_0x13bc05=join(_0x35ee7f[_0x14128c(0x2a9)+'oot'],_0x14128c(0x393)),_0x3e95a4=join(_0x35ee7f[_0x14128c(0x2a9)+_0x14128c(0x310)],_0x14128c(0x215)+_0x14128c(0x349)+'t');await mkdir(_0x13bc05,{'recursive':!![]}),await removePathWithRetries(_0x3e95a4),await mkdir(_0x3e95a4,{'recursive':!![]});const _0x234c41=await createRuntimeEnv(_0x35ee7f),_0x18d15d='openclaw'+'@'+_0x56235b;console['log']('[wujie-s'+_0x14128c(0x199)+_0x14128c(0x32e)+_0x14128c(0x347)+'\x20'+_0x18d15d);const _0x28ffb4=await runProcess(_0x35ee7f['nodeExec'+_0x14128c(0x1cb)],[_0x35ee7f['npmCli'],'pack',_0x18d15d,'--json'],{'cwd':_0x13bc05,'env':_0x234c41,'label':_0x14128c(0x205)+'\x20'+_0x18d15d}),_0x2d5179=parseNpmPackJson(_0x28ffb4[_0x14128c(0x2bc)]);if(_0x2d5179['version']!==_0x56235b)throw new Error(_0x14128c(0x370)+_0x14128c(0x1b2)+'law\x20'+_0x56235b+(_0x14128c(0x2d0)+_0x14128c(0x26d))+_0x2d5179[_0x14128c(0x266)]);const _0x2d0076=resolve(_0x13bc05,_0x2d5179[_0x14128c(0x22d)]);if(!existsSync(_0x2d0076))throw new Error(_0x14128c(0x205)+_0x14128c(0x212)+_0x14128c(0x2b9)+_0x14128c(0x18a)+'\x20'+_0x2d0076);await runProcess(_0x14128c(0x2c7),['-xzf',_0x2d0076,'-C',_0x3e95a4],{'label':_0x14128c(0x2f8)+_0x2d5179[_0x14128c(0x22d)]}),await removePathWithRetries(_0x35ee7f['openclaw'+'WorkingD'+'ir']),await rename(join(_0x3e95a4,_0x14128c(0x26c)),_0x35ee7f[_0x14128c(0x3ac)+_0x14128c(0x380)+'ir']),await removePathWithRetries(_0x3e95a4),await runProcess(_0x35ee7f[_0x14128c(0x206)+_0x14128c(0x1cb)],[_0x35ee7f['npmCli'],_0x14128c(0x214),_0x14128c(0x236)+'ev',_0x14128c(0x354)+'eer',_0x14128c(0x1c4)+'it','--no-fun'+'d',_0x14128c(0x364)+_0x14128c(0x1a6)+'ps'],{'cwd':_0x35ee7f[_0x14128c(0x3ac)+'WorkingD'+'ir'],'env':_0x234c41,'label':'npm\x20inst'+_0x14128c(0x1b1)+_0x18d15d+(_0x14128c(0x2b5)+_0x14128c(0x268)+_0x14128c(0x33f))});if(!existsSync(_0x35ee7f[_0x14128c(0x3ac)+'Bin']))throw new Error(_0x14128c(0x276)+_0x14128c(0x191)+'\x20not\x20fou'+'nd\x20after'+_0x14128c(0x23a)+':\x20'+_0x35ee7f[_0x14128c(0x3ac)+_0x14128c(0x1f2)]);}async function ensureRuntimeBase(_0x1c39ba,_0x2a3f2e,_0x5d9d63={}){const _0x49b060=_0x96c1f6;await mkdir(_0x2a3f2e,{'recursive':!![]});let _0x602e67=await readRuntimeManifest(_0x2a3f2e);const _0x20d02d=_0x1c39ba[_0x49b060(0x3ac)]['nodeVers'+_0x49b060(0x2aa)],_0x9ac69f=_0x1c39ba['openclaw'][_0x49b060(0x3ac)+_0x49b060(0x373)],_0x274ad0=existsSync(resolveManifestPath(_0x2a3f2e)),_0x54b460=runtimeHasRequiredPaths(_0x2a3f2e,_0x602e67),_0x4dbe17=_0x602e67['nodeVers'+_0x49b060(0x2aa)]===_0x20d02d;!_0x274ad0||!_0x54b460||!_0x4dbe17?(_0x5d9d63[_0x49b060(0x2db)+'ogger']?.[_0x49b060(0x1f5)](_0x49b060(0x1df)+_0x49b060(0x39c)+_0x49b060(0x2b8)+'ed',{'runtimeRoot':_0x2a3f2e,'reason':!_0x274ad0?_0x49b060(0x227)+_0x49b060(0x1d3):!_0x54b460?_0x49b060(0x227)+_0x49b060(0x2f2)+_0x49b060(0x2b5)+_0x49b060(0x2c3):_0x49b060(0x1ab)+_0x49b060(0x331)+'match','syncOnly':_0x5d9d63[_0x49b060(0x33a)]}),_0x602e67=await buildRuntimeBase(_0x1c39ba,_0x2a3f2e,_0x602e67),_0x5d9d63['runtimeL'+_0x49b060(0x344)]?.[_0x49b060(0x1f5)](_0x49b060(0x1df)+_0x49b060(0x39c)+'ld\x20compl'+_0x49b060(0x210),{'manifest':summarizeRuntimeManifest(_0x602e67)})):_0x5d9d63[_0x49b060(0x2db)+_0x49b060(0x344)]?.[_0x49b060(0x1f5)]('runtime\x20'+'base\x20alr'+'eady\x20cur'+'rent',{'manifest':summarizeRuntimeManifest(_0x602e67)});if(!existsSync(resolve(_0x2a3f2e,_0x602e67[_0x49b060(0x3ac)+_0x49b060(0x1f2)]))){const _0x2688c6=createRuntimeInfoFromManifest(_0x2a3f2e,_0x602e67,{'allowMissingOpenClaw':!![]});await installOpenClawPackage(_0x2688c6,_0x9ac69f),_0x602e67[_0x49b060(0x3ac)+'Version']=_0x9ac69f;}return _0x602e67;}function runtimeHasRequiredPaths(_0x25d4db,_0x3f3a9a){const _0x11ed59=_0x96c1f6;return['nodeExec'+'utable',_0x11ed59(0x1c8),_0x11ed59(0x3ac)+_0x11ed59(0x380)+'ir',_0x11ed59(0x3ac)+_0x11ed59(0x1f2)][_0x11ed59(0x337)](_0x6a01a9=>typeof _0x3f3a9a[_0x6a01a9]===_0x11ed59(0x2df)&&_0x3f3a9a[_0x6a01a9][_0x11ed59(0x1d8)]())&&[_0x11ed59(0x206)+'utable',_0x11ed59(0x1c8)][_0x11ed59(0x337)](_0x4ebd0d=>existsSync(resolve(_0x25d4db,_0x3f3a9a[_0x4ebd0d])));}async function buildRuntimeBase(_0x2e015b,_0x1d2ab3,_0x2d9f40={}){const _0x493464=_0x96c1f6,_0x2f87f5=join(_0x1d2ab3,_0x493464(0x17e));await ensureRuntimeNode(_0x2e015b,_0x2f87f5);const _0x134985=process[_0x493464(0x300)]===_0x493464(0x315)?_0x493464(0x323)+_0x493464(0x34b):_0x493464(0x22a)+_0x493464(0x30c),_0x439b16=process[_0x493464(0x300)]==='win32'?_0x493464(0x323)+_0x493464(0x280)+_0x493464(0x25f)+_0x493464(0x287)+'i.js':_0x493464(0x1db)+_0x493464(0x372)+_0x493464(0x2ca)+_0x493464(0x1a4)+'m-cli.js',_0x45c07f={..._0x2d9f40,'generatedAt':new Date()[_0x493464(0x264)+_0x493464(0x248)](),'nodeVersion':_0x2e015b[_0x493464(0x3ac)][_0x493464(0x1a5)+_0x493464(0x2aa)],'openclawVersion':_0x2d9f40['openclaw'+_0x493464(0x373)]||'','platform':process[_0x493464(0x300)],'arch':process['arch'],'nodeExecutable':_0x134985,'npmCli':_0x439b16,'openclawWorkingDir':_0x493464(0x3ac),'openclawBin':_0x493464(0x3ac)+_0x493464(0x1f8)+'w.mjs'};return await writeJson(resolveManifestPath(_0x1d2ab3),_0x45c07f),_0x45c07f;}async function removePathWithRetries(_0x57b54f){await rm(_0x57b54f,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96});}async function ensureRuntimeNode(_0x3fe8ed,_0x804915){const _0x566ee0=_0x96c1f6,_0x25bd22=_0x3fe8ed[_0x566ee0(0x3ac)]['nodeVers'+_0x566ee0(0x2aa)],_0x4ed790=process[_0x566ee0(0x300)]===_0x566ee0(0x315)?join(_0x804915,_0x566ee0(0x1fe)):join(_0x804915,'bin',_0x566ee0(0x17e)),_0x4691f0=process['platform']===_0x566ee0(0x315)?join(_0x804915,_0x566ee0(0x24b)+_0x566ee0(0x305),_0x566ee0(0x340),_0x566ee0(0x1b8),_0x566ee0(0x188)+'js'):join(_0x804915,_0x566ee0(0x1da),'node_mod'+_0x566ee0(0x305),_0x566ee0(0x340),_0x566ee0(0x1b8),'npm-cli.'+'js');if(existsSync(_0x4ed790)&&existsSync(_0x4691f0)&&await getNodeVersion(_0x4ed790)===_0x25bd22)return;await removePathWithRetries(_0x804915);if(process[_0x566ee0(0x39f)]['node']===_0x25bd22){await linkCurrentNodeRuntime(_0x804915);return;}await downloadNodeRuntime(_0x25bd22,_0x804915);}async function getNodeVersion(_0x6e372a){const _0x4f21af=_0x96c1f6;try{const _0x660aec=await runProcess(_0x6e372a,['-p',_0x4f21af(0x2af)+_0x4f21af(0x39f)+_0x4f21af(0x290)],{'label':_0x6e372a+_0x4f21af(0x28c),'timeoutMs':0x7530});return _0x660aec[_0x4f21af(0x2bc)][_0x4f21af(0x1d8)]();}catch{return'';}}async function linkCurrentNodeRuntime(_0xee10a8){const _0x1fc5e8=_0x96c1f6,_0x5e4ad2=process['execPath'],_0x400c6b=resolve(dirname(_0x5e4ad2),'..'),_0x7bfa09=process[_0x1fc5e8(0x300)]===_0x1fc5e8(0x315)?resolve(_0x400c6b,_0x1fc5e8(0x24b)+_0x1fc5e8(0x1bf)):resolve(_0x400c6b,_0x1fc5e8(0x254)+_0x1fc5e8(0x1ed)+_0x1fc5e8(0x295)),_0x408fc3=process[_0x1fc5e8(0x300)]==='win32'?join(_0xee10a8,_0x1fc5e8(0x1fe)):join(_0xee10a8,_0x1fc5e8(0x1b8),_0x1fc5e8(0x17e)),_0x1d4cc0=process[_0x1fc5e8(0x300)]===_0x1fc5e8(0x315)?join(_0xee10a8,_0x1fc5e8(0x24b)+_0x1fc5e8(0x305),_0x1fc5e8(0x340)):join(_0xee10a8,_0x1fc5e8(0x1da),'node_mod'+'ules','npm');await mkdir(dirname(_0x408fc3),{'recursive':!![]}),await mkdir(dirname(_0x1d4cc0),{'recursive':!![]}),await symlink(_0x5e4ad2,_0x408fc3),existsSync(_0x7bfa09)?await symlink(_0x7bfa09,_0x1d4cc0):await symlink(await resolveNpmRoot(),_0x1d4cc0);}async function resolveNpmRoot(){const _0xbd61dc=_0x96c1f6,_0x494a4b=await runProcess('npm',['root','-g'],{'label':'npm\x20root'+'\x20-g','timeoutMs':0x7530}),_0x4f8c25=process['platform']==='win32'?_0x494a4b[_0xbd61dc(0x2bc)][_0xbd61dc(0x1d8)]():join(_0x494a4b[_0xbd61dc(0x2bc)][_0xbd61dc(0x1d8)](),_0xbd61dc(0x340));if(!existsSync(join(_0x4f8c25,_0xbd61dc(0x1b8),'npm-cli.'+'js')))throw new Error('npm\x20pack'+'age\x20was\x20'+_0xbd61dc(0x391)+_0xbd61dc(0x265)+_0xbd61dc(0x239)+_0xbd61dc(0x262)+'d:\x20'+_0x4f8c25);return _0x4f8c25;}function _0x29ee(){const _0x2d8018=['Name','chat-dis','spec','\x20-z\x20\x22$WU','ules','ent','5920SfcCKf','eer','ILE_NAME','store-','ies:\x20','/node','split','prepareP','package.','oot','dencies','patch\x20al','zip','provider','win32','y:\x20','all\x20loca','CRIPT_DI','HELL_ARC','_DIR%','ile\x20not\x20','dependen','s\x20instal','ignore','OGO\x22\x20];\x20','octor\x20--','574217vctPLb','\x22\x20at\x20','node/nod','rebuilt\x20','ecs','ipped;\x20d','\x20\x22OPENCL','ugin\x20spe','me\x20missi','name','\x20summary','pruned\x20r','leName','time]\x20in','NFIG_FIL','endencie','sion\x20mis','\x20found','ite\x20patc','aipc-dow','\x22\x20so\x20the','slice','every','runtimeS','Bypass','syncOnly','env','entryCou','NCLAW_HO','keys','ncies','npm','FILE%\x5c','agentSco','optional','ogger','ntimeCha','-Executi','stalling','$HOME/','w-extrac','PT_DIR/','e.exe','generate','store\x20lo','nced','[wujie-s','556LBhCaD','dataDirN','s\x20not\x20fo','und:\x20','--omit=p','\x22\x20%*','resume','replaceA','FIG_FILE','-xzf','unknown','6vlORds','ify\x20upst','in\x20runti','ream\x20fix','store\x20wr','el.inbou','pped;\x20ru','\x20returne','state-','--legacy','PT_DIR%','jection\x20','r\x20OpenCl','AW_CONFI','store\x20sq','win','sion\x20val','local:','G_FILE_N','runtime-','3kRNbCN','Configur','eam\x20fix\x20','/node_mo','Version','onPolicy','index.mj','solver\x20n','label','\x20request','extensio','ie-shell','local','vel\x20entr','nning\x20op','ch\x20skipp','singOpen','WorkingD','stderr','product\x20','=\x22${OPEN','atch\x20app','push','\x20\x20\x22$SCRI','https://','E_NAME%\x22','?t=','wrapper\x20','lugins\x20s','channel\x20','timeoutM','e\x20tools\x20','ie-logo.','tall\x20the','not\x20foun','E_DIR=','.cache','agents','fy\x20upstr','ion\x20mism','nd\x20helpe','ynced','filter','npm-cach','arm64','base\x20bui','kill\x20not','ENCLAW_H','versions','Run\x20\x22wuj','headers','with\x20cod','e\x20plugin','\x5cwjrt-','appId','ujie-log','tching\x20p','OPENCLAW','rchive\x20-','pluginId','Temporar','openclaw','chat\x20his','find','with\x20the','source','lied','.npmmirr','href','node','fix','CONFIG_P','LocalPlu','isArray','ame','time-bac','Invalid\x20','\x20return\x20','fix\x20mark','npm-cli.','close','tarball:','sort','er\x20patch','ed\x20npm\x20p','map','started','.tools','\x20bin\x20was','6\x20mixed\x20','extract-','../../sh','NCLAW_ST','pped;\x20di','66745CUNlKR','ginPaths','hell:run','nodejs.o','session\x20','plugin\x20r','\x20skipped','or.com','LiteralP',';\x20dist\x20n','\x20prepare','SIGTERM','PT_DIR/w','m/bin/np','nodeVers','-peer-de','devDepen','connecto','ntime','warn','node\x20ver','kill','values','l\x20plugin','wujiecla','jie-shel','all\x20','ed\x20OpenC','export\x20O','patch\x20sk','_NAME:-','enclaw\x20d','now','bin','\x20not\x20fou','l\x20prepar','load:\x20','path:\x20','ced','shell-ru','ules/npm','pack','ATH=\x22${O','fix\x20comp','all\x20plug','--no-aud','\x20validat','pid','dAt','npmCli','length','createRu','utable','.plugin-','failed','powershe','in\x20','o\x20resolv','agents\x20s','some','manifest','\x20id\x20from','IR=$(CDP','time]\x20ru','cwd','trim','ntime\x20ch','lib','node/lib','isFile','\x20configu','wnloadin','runtime\x20','claw-run','statusCo','try\x20not\x20','plied','-xJf','on\x20futur','director','tar.xz','error','eady\x20app','--fix','includes','then','_modules','\x22\x20from\x20','r\x20runtim','LAW_STAT','ll\x20||\x20tr','Bin','exec\x20\x22$S','y\x20compat','info','installP','\x20can\x20ins','/opencla','AME=','found','red\x20Open','\x20failed\x20','../../as','node.exe','\x20entry\x20\x22','runtime','-NoProfi','\x20kdocs\x20s','dge.mjs','st\x20not\x20f','npm\x20pack','nodeExec','y\x20applie','ed-tool\x20','ATE_DIR%','\x22%SCRIPT','reason','object','10785281GkcodW','STATE_DI','st\x20be\x20a\x20','eted','Dependen','\x20did\x20not','\x20is\x20miss','install','.opencla','resolved','-extract','root','h\x20alread','\x20in\x20','ady\x20curr','bug;\x20ver','>/dev/nu','ader\x20not','download','o.mjs\x22\x202','t\x20\x22OPENC','\x20path\x20mu','1\x20]\x20&&\x20[','npm\x20plug','pipe','nloads-b','missing\x20','sets/wuj','#!/bin/s','node/bin','-Command','replace','filename','.js','isDirect','lite\x20pat','alid\x20pay','data','NFIG_PAT','has','session-','--omit=d','set\x20\x22SCR','\x20already','cal\x20runt','\x20install','_HOME:-','ore\x20pack','\x20on\x20futu','startsWi','red\x20Node','wBin','CLAW_CON','--no-fun','_SHELL_E','atch\x20alr','annel\x20en','wujie-lo','shasum','ing','productN','aging','node_mod','npm\x20inst','tory\x20mix','path','already-','projectR','plugins','\x20product','leted','lib/node','set\x20\x22OPE','ed;\x20brid','dataDir','PENCLAW_','\x20signal=','Unable\x20t','cies','if\x20\x22%OPE','pluginSp','rname\x20--','s/npm/bi','-id\x20head',',\x20shell.','ime\x20buil','if\x20[\x20-t\x20','toISOStr','d\x20for\x20lo','version','@echo\x20of','\x20depende','pped;\x20lo','ipped;\x20f','6.6\x20chan','package','d\x20to\x20','go.mjs','10219dWfybB','idated','time-bri','untime\x20p','llPaths','ing\x20\x22','exec','OpenClaw','ATH=\x20cd\x20','9819zPphGl','time]\x20do','led','product','transcri','\x20started','time]\x20fe','patched','e_module','ory','ntPaths','d\x20an\x20inv','ATE_DIR:','NCLAW_CO','R=\x22${OPE','n/npm-cl','synced','arch','pt-path-','join','\x20version','pendenci','patch\x20ap','fix\x20star','.node',';\x20provid','\x22\x20\x22$SCRI','HIVE\x20-De','&&\x20pwd)','/npm','json','atch\x20ski','sion.','230049myiRDp','tory\x20pro','OOT\x20-For','Claw\x20ver','lugin\x20de','prepare\x20','lark-cli','roductRu','atch:\x20ma','store-lo','utf8','\x20timed\x20o','function','w.cmd','local\x20pl','d\x20for\x20','runtimeR','ion','untime\x20c','Expand-A','dist','er\x20writt','process.','des.','agent','rg/dist/','Spec','.tmp/run','\x20runtime','log','\x20doctor\x20','ld\x20start','\x20create\x20','nifest=','x64','stdout','ache\x20bef','parse','in\x20insta','nse\x20hook','aw\x202026.','_shared','\x20paths','location','\x20\x22$0\x22)\x22\x20','scripts','tar','mismatch','CONFIG_F','dules/np','time-too','get','ibility\x20','toString','patch\x20fo','\x20resolve','catch','add','es\x20','\x20package','kup','config=','-doctor.','ATH:-','null','ot\x20found','runtimeL','ath','ad\x20patch','channel-','string','indexOf','skipped;','skills','st=','ist\x20not\x20','\x20set\x20\x22OP','wujieai.','1663418jzBGST','ut\x20after','registry','LocalSki','ad-','IPT_DIR=','re\x20upgra','h\x20applie','JIE_NO_L','plugin\x20s','ge\x20not\x20a','required','\x20applied','endsWith','flush','sessions','\x20complet','extract\x20','\x22==\x22\x22\x20se','36NXMHdS',':\x20manife','15670GeeSIv','LocalAge','ime/sess','doctor','platform'];_0x29ee=function(){return _0x2d8018;};return _0x29ee();}async function resolveExtractedNodeRoot(_0x53061f,_0x363af4){const _0x245fce=_0x96c1f6,_0x54f6b1=join(_0x53061f,_0x363af4);if(existsSync(_0x54f6b1))return _0x54f6b1;const _0x4ac2e4=await readdir(_0x53061f,{'withFileTypes':!![]}),_0x42dda9=_0x4ac2e4['filter'](_0x4cfa05=>_0x4cfa05[_0x245fce(0x22f)+'ory']());if(_0x42dda9['length']===0x1)return join(_0x53061f,_0x42dda9[0x0][_0x245fce(0x32a)]);const _0x29a9cc=process[_0x245fce(0x300)]===_0x245fce(0x315)?join(_0x53061f,_0x245fce(0x1fe)):join(_0x53061f,_0x245fce(0x1b8),'node');if(existsSync(_0x29a9cc))return _0x53061f;const _0x10b146=await findNodeRuntimeRoot(_0x53061f);if(_0x10b146)return _0x10b146;const _0x4a58aa=_0x4ac2e4['map'](_0x3ef643=>_0x3ef643[_0x245fce(0x32a)])['join'](',\x20');throw new Error('Extracte'+'d\x20Node\x20r'+'untime\x20r'+'oot\x20was\x20'+_0x245fce(0x391)+_0x245fce(0x2a8)+_0x363af4+_0x245fce(0x21a)+_0x53061f+('.\x20Top-le'+_0x245fce(0x37c)+_0x245fce(0x30b))+(_0x4a58aa||'(empty)'));}function resolveNodeExtractRoot(_0x985eaa,_0x553ec7,_0x489729){const _0x200793=_0x96c1f6;if(process[_0x200793(0x300)]!==_0x200793(0x315))return join(_0x985eaa,_0x553ec7+(_0x200793(0x217)+'-')+process[_0x200793(0x1c6)]+'-'+Date['now']()+'-'+_0x489729);const _0x512091=/^[A-Za-z]:[\\/]/[_0x200793(0x275)](_0x985eaa),_0x3a15f5=parse(_0x985eaa),_0xf12f25=_0x512091?_0x512091[0x0][_0x200793(0x336)](0x0,0x2)+'\x5c':_0x3a15f5[_0x200793(0x218)]&&_0x3a15f5['root']!=='/'?_0x3a15f5[_0x200793(0x218)]:_0x985eaa,_0x2a8031=_0xf12f25[_0x200793(0x22c)](/[\\/]+$/,'');return _0x2a8031+_0x200793(0x3a4)+process[_0x200793(0x1c6)]+'-'+Date[_0x200793(0x1b7)]()+'-'+_0x489729;}async function findNodeRuntimeRoot(_0x2262f9){const _0x53ace5=_0x96c1f6,_0x25a521=[_0x2262f9],_0x1ef1a7=new Set();while(_0x25a521['length']>0x0){const _0x4d3d36=_0x25a521['shift']();if(!_0x4d3d36||_0x1ef1a7[_0x53ace5(0x234)](_0x4d3d36))continue;_0x1ef1a7[_0x53ace5(0x2d2)](_0x4d3d36);const _0x59716=process[_0x53ace5(0x300)]==='win32'?join(_0x4d3d36,_0x53ace5(0x1fe)):join(_0x4d3d36,'bin','node'),_0x1981f2=process[_0x53ace5(0x300)]==='win32'?join(_0x4d3d36,'node_mod'+_0x53ace5(0x305),'npm','bin','npm-cli.'+'js'):join(_0x4d3d36,_0x53ace5(0x1da),_0x53ace5(0x24b)+_0x53ace5(0x305),'npm',_0x53ace5(0x1b8),_0x53ace5(0x188)+'js');if(existsSync(_0x59716)&&existsSync(_0x1981f2))return _0x4d3d36;const _0x42952b=await readdir(_0x4d3d36,{'withFileTypes':!![]});for(const _0x4d4bbc of _0x42952b){_0x4d4bbc[_0x53ace5(0x22f)+_0x53ace5(0x281)]()&&_0x25a521[_0x53ace5(0x385)](join(_0x4d3d36,_0x4d4bbc[_0x53ace5(0x32a)]));}}return'';}async function downloadNodeRuntime(_0x3f7398,_0x289f19){const _0xeeaea4=_0x96c1f6,_0x1eb55a=process[_0xeeaea4(0x300)]===_0xeeaea4(0x315)?_0xeeaea4(0x36a):process[_0xeeaea4(0x300)],_0x3ca0bb=process['arch']==='x64'?_0xeeaea4(0x2bb):process[_0xeeaea4(0x289)]===_0xeeaea4(0x39b)?'arm64':process[_0xeeaea4(0x289)],_0x3beade=process[_0xeeaea4(0x300)]===_0xeeaea4(0x315)?_0xeeaea4(0x313):_0xeeaea4(0x1e7),_0x349483='node-v'+_0x3f7398+'-'+_0x1eb55a+'-'+_0x3ca0bb,_0x2564a2=_0x349483+'.'+_0x3beade,_0x50e12a=join(dirname(_0x289f19),_0xeeaea4(0x393)),_0x407fc5=join(_0x50e12a,_0x2564a2),_0x5dc483='https://'+_0xeeaea4(0x19a)+_0xeeaea4(0x2b2)+'v'+_0x3f7398+'/'+_0x2564a2;await mkdir(_0x50e12a,{'recursive':!![]});const _0x385089=resolveNodeExtractRoot(_0x50e12a,_0x349483,0x1);!existsSync(_0x407fc5)&&(console[_0xeeaea4(0x2b6)](_0xeeaea4(0x34f)+_0xeeaea4(0x199)+_0xeeaea4(0x279)+_0xeeaea4(0x1de)+'g\x20'+_0x5dc483),await downloadFile(_0x5dc483,_0x407fc5));await rm(_0x385089,{'recursive':!![],'force':!![]}),await mkdir(_0x385089,{'recursive':!![]});process['platform']===_0xeeaea4(0x315)?await extractZipArchive(_0x407fc5,_0x385089,_0x2564a2):await runProcess(_0xeeaea4(0x2c7),[_0xeeaea4(0x1e4),_0x407fc5,'-C',_0x385089],{'label':_0xeeaea4(0x2f8)+_0x2564a2});const _0x135e54=await resolveExtractedNodeRoot(_0x385089,_0x349483);await mkdir(dirname(_0x289f19),{'recursive':!![]}),await rename(_0x135e54,_0x289f19),_0x135e54!==_0x385089&&await rm(_0x385089,{'recursive':!![],'force':!![]});}async function extractZipArchive(_0x434ad9,_0x3d2825,_0x296722){const _0xfd92b3=_0x96c1f6;await runProcess(_0xfd92b3(0x1ce)+'ll.exe',[_0xfd92b3(0x201)+'le',_0xfd92b3(0x346)+_0xfd92b3(0x374),_0xfd92b3(0x339),_0xfd92b3(0x22b),_0xfd92b3(0x2ac)+_0xfd92b3(0x3a9)+_0xfd92b3(0x19f)+'ath\x20$env'+':WUJIE_S'+_0xfd92b3(0x319)+_0xfd92b3(0x293)+'stinatio'+'nPath\x20$e'+'nv:WUJIE'+_0xfd92b3(0x243)+'XTRACT_R'+_0xfd92b3(0x29b)+'ce'],{'env':{...process.env,'WUJIE_SHELL_ARCHIVE':_0x434ad9,'WUJIE_SHELL_EXTRACT_ROOT':_0x3d2825},'label':_0xfd92b3(0x2f8)+_0x296722});}async function downloadFile(_0x53f681,_0x9c4742){await mkdir(dirname(_0x9c4742),{'recursive':!![]});const _0xc635e1=await new Promise((_0x2b304b,_0x1c24d5)=>{const _0x5c0603=_0x2ee8;get(_0x53f681,_0x3aed14=>{const _0x89c6a=_0x2ee8;if(_0x3aed14[_0x89c6a(0x1e1)+'de']>=0x12c&&_0x3aed14[_0x89c6a(0x1e1)+'de']<0x190&&_0x3aed14[_0x89c6a(0x3a1)][_0x89c6a(0x2c4)]){_0x3aed14[_0x89c6a(0x356)](),downloadFile(new URL(_0x3aed14['headers'][_0x89c6a(0x2c4)],_0x53f681)[_0x89c6a(0x17d)],_0x9c4742)[_0x89c6a(0x1ec)](()=>_0x2b304b(null))[_0x89c6a(0x2d1)](_0x1c24d5);return;}if(_0x3aed14[_0x89c6a(0x1e1)+'de']!==0xc8){_0x3aed14[_0x89c6a(0x356)](),_0x1c24d5(new Error(_0x89c6a(0x21f)+_0x89c6a(0x1fc)+_0x3aed14['statusCo'+'de']+':\x20'+_0x53f681));return;}_0x2b304b(_0x3aed14);})['on'](_0x5c0603(0x1e8),_0x1c24d5);});_0xc635e1&&await pipeline(_0xc635e1,createWriteStream(_0x9c4742));}export async function ensureOpenClawDoctorFixed(_0x14743f,_0x19b229={}){const _0x3fa207=_0x96c1f6,_0x350848=await loadRuntimeInfo(_0x14743f[_0x3fa207(0x250)+_0x3fa207(0x310)]),_0x5d5ed0=getConfigPaths(_0x14743f),_0x5ab45b=join(_0x5d5ed0[_0x3fa207(0x338)+'tateDir'],_0x3fa207(0x3ac)+_0x3fa207(0x2d7)+_0x3fa207(0x296)),_0x5d00d9=await readJson(_0x5ab45b,{});if(_0x5d00d9[_0x3fa207(0x3ac)+_0x3fa207(0x373)]===_0x350848['openclaw'+'Version'])return _0x19b229[_0x3fa207(0x2db)+'ogger']?.[_0x3fa207(0x1f5)](_0x3fa207(0x3ac)+_0x3fa207(0x2b7)+'fix\x20alre'+_0x3fa207(0x21b)+_0x3fa207(0x306),{'openclawVersion':_0x350848[_0x3fa207(0x3ac)+_0x3fa207(0x373)],'markerPath':_0x5ab45b}),{'ran':![],'openclawVersion':_0x350848[_0x3fa207(0x3ac)+_0x3fa207(0x373)],'markerPath':_0x5ab45b};return await runOpenClawDoctorFix(_0x14743f,_0x350848,{'fromVersion':_0x5d00d9['openclaw'+_0x3fa207(0x373)]||'unknown','toVersion':_0x350848[_0x3fa207(0x3ac)+'Version'],'markerPath':_0x5ab45b,'runtimeLogger':_0x19b229[_0x3fa207(0x2db)+_0x3fa207(0x344)]}),{'ran':!![],'openclawVersion':_0x350848[_0x3fa207(0x3ac)+_0x3fa207(0x373)],'markerPath':_0x5ab45b};}async function runOpenClawDoctorFix(_0x2e5933,_0x186489,{fromVersion:_0x5d565a,toVersion:_0x4ef3f5,markerPath:markerPath='',runtimeLogger:_0x224eac}={}){const _0x330a54=_0x96c1f6;_0x224eac?.[_0x330a54(0x1f5)](_0x330a54(0x3ac)+_0x330a54(0x2b7)+_0x330a54(0x28f)+'ted',{'fromVersion':_0x5d565a,'toVersion':_0x4ef3f5});const _0x44ec4d=await createRuntimeEnv(_0x186489,{'OPENCLAW_HOME':_0x2e5933[_0x330a54(0x257)],'OPENCLAW_STATE_DIR':_0x2e5933[_0x330a54(0x257)],'OPENCLAW_CONFIG_PATH':getConfigPaths(_0x2e5933)['configPa'+'th']});console[_0x330a54(0x2b6)](_0x330a54(0x34f)+'hell:run'+_0x330a54(0x1d6)+_0x330a54(0x37d)+_0x330a54(0x1b6)+_0x330a54(0x320)+_0x330a54(0x17f));const _0xaaf93e=await runProcess(_0x186489[_0x330a54(0x206)+_0x330a54(0x1cb)],[_0x186489[_0x330a54(0x3ac)+_0x330a54(0x1f2)],_0x330a54(0x2ff),_0x330a54(0x1ea)],{'cwd':_0x186489[_0x330a54(0x3ac)+_0x330a54(0x380)+'ir'],'env':_0x44ec4d,'label':'openclaw'+'\x20doctor\x20'+'--fix','timeoutMs':0x1d4c0});_0x224eac?.[_0x330a54(0x1f5)](_0x330a54(0x3ac)+_0x330a54(0x2b7)+_0x330a54(0x1c2)+_0x330a54(0x253),{'fromVersion':_0x5d565a,'toVersion':_0x4ef3f5,'stdout':_0xaaf93e[_0x330a54(0x2bc)][_0x330a54(0x1d8)]()[_0x330a54(0x336)](-0xfa0),'stderr':_0xaaf93e[_0x330a54(0x381)][_0x330a54(0x1d8)]()[_0x330a54(0x336)](-0xfa0)}),markerPath&&(await writeJson(markerPath,{'openclawVersion':_0x186489[_0x330a54(0x3ac)+'Version'],'fixedAt':new Date()[_0x330a54(0x264)+'ing']()}),_0x224eac?.['info'](_0x330a54(0x3ac)+'\x20doctor\x20'+_0x330a54(0x187)+_0x330a54(0x2ae)+'en',{'markerPath':markerPath,'openclawVersion':_0x186489[_0x330a54(0x3ac)+_0x330a54(0x373)]}));}export async function readRuntimeManifest(_0x2796b6){return await readJson(resolveManifestPath(_0x2796b6),{});}export async function loadRuntimeInfo(_0x15e247){const _0x11ceeb=resolveRuntimeRoot(_0x15e247),_0x22b7f0=await readRuntimeManifest(_0x11ceeb);return createRuntimeInfoFromManifest(_0x11ceeb,_0x22b7f0);}function createRuntimeInfoFromManifest(_0x1e31d5,_0xdfa06c,_0x2e16f9={}){const _0x2177d5=_0x96c1f6;for(const _0x5ca357 of[_0x2177d5(0x206)+_0x2177d5(0x1cb),'npmCli',_0x2177d5(0x3ac)+_0x2177d5(0x380)+'ir',_0x2177d5(0x3ac)+'Bin']){if(typeof _0xdfa06c[_0x5ca357]!==_0x2177d5(0x2df)||!_0xdfa06c[_0x5ca357]['trim']())throw new Error(_0x2177d5(0x1df)+_0x2177d5(0x1d3)+_0x2177d5(0x213)+_0x2177d5(0x274)+_0x5ca357+_0x2177d5(0x322)+resolveManifestPath(_0x1e31d5)+(';\x20run\x20wu'+_0x2177d5(0x1b0)+_0x2177d5(0x1ba)+'e'));}const _0x22ef25=resolve(_0x1e31d5,_0xdfa06c[_0x2177d5(0x206)+_0x2177d5(0x1cb)]),_0x172f89=resolve(_0x1e31d5,_0xdfa06c[_0x2177d5(0x1c8)]),_0x2077b9=resolve(_0x1e31d5,_0xdfa06c[_0x2177d5(0x3ac)+_0x2177d5(0x380)+'ir']),_0x464d27=resolve(_0x1e31d5,_0xdfa06c['openclaw'+_0x2177d5(0x1f2)]),_0x2d1888=Array[_0x2177d5(0x182)](_0xdfa06c[_0x2177d5(0x251)])?_0xdfa06c[_0x2177d5(0x251)][_0x2177d5(0x18e)](_0x313efe=>({..._0x313efe,'installPath':resolve(_0x1e31d5,_0x313efe[_0x2177d5(0x1f6)+_0x2177d5(0x2dc)])})):[],_0x867892=_0x2e16f9['allowMis'+_0x2177d5(0x37f)+'Claw']?[_0x22ef25,_0x172f89]:[_0x22ef25,_0x172f89,_0x2077b9,_0x464d27];for(const _0xe85b87 of _0x867892){if(!existsSync(_0xe85b87))throw new Error('runtime\x20'+_0x2177d5(0x227)+_0x2177d5(0x1bc)+_0xe85b87);}return{'runtimeRoot':_0x1e31d5,'manifest':_0xdfa06c,'openclawVersion':_0xdfa06c['openclaw'+_0x2177d5(0x373)]||_0x2177d5(0x35a),'nodeExecutable':_0x22ef25,'npmCli':_0x172f89,'openclawWorkingDir':_0x2077b9,'openclawBin':_0x464d27,'plugins':_0x2d1888};}export async function spawnClaw(_0x327f5f,_0x3519dc=[],_0x3989db={}){const _0x103805=_0x96c1f6,_0x193612=await loadRuntimeInfo(_0x327f5f),_0x18b139=await createRuntimeEnv(_0x193612,_0x3989db['env']??{});return spawn(_0x193612[_0x103805(0x206)+_0x103805(0x1cb)],[_0x193612[_0x103805(0x3ac)+'Bin'],..._0x3519dc],{'cwd':_0x193612[_0x103805(0x3ac)+_0x103805(0x380)+'ir'],'stdio':_0x103805(0x225),..._0x3989db,'env':_0x18b139});}export async function runClawOnce(_0x30dbea,_0x43c540=[],_0x3701c9=0x15f90){const _0x3f82f6=await spawnClaw(_0x30dbea,_0x43c540);return await new Promise((_0x18fc9c,_0x4e5ea6)=>{const _0x52db83=_0x2ee8;let _0x58c306='',_0x28236a='',_0x675074=![];const _0xa191cc=setTimeout(()=>{const _0x408f42=_0x2ee8;if(_0x675074)return;_0x675074=!![],_0x3f82f6[_0x408f42(0x1ac)](_0x408f42(0x1a2)),_0x4e5ea6(new Error(_0x408f42(0x3ac)+_0x408f42(0x2a4)+_0x408f42(0x2e8)+'\x20'+_0x3701c9+'ms'));},_0x3701c9);_0x3f82f6[_0x52db83(0x2bc)]['on']('data',_0x290af0=>{const _0x46bf79=_0x52db83;_0x58c306+=_0x290af0[_0x46bf79(0x2ce)]();}),_0x3f82f6[_0x52db83(0x381)]['on'](_0x52db83(0x232),_0x29c280=>{_0x28236a+=_0x29c280['toString']();}),_0x3f82f6['on'](_0x52db83(0x1e8),_0x3b5e88=>{if(_0x675074)return;_0x675074=!![],clearTimeout(_0xa191cc),_0x4e5ea6(_0x3b5e88);}),_0x3f82f6['on'](_0x52db83(0x189),(_0x1b0a64,_0x3fd77d)=>{if(_0x675074)return;_0x675074=!![],clearTimeout(_0xa191cc),_0x18fc9c({'code':_0x1b0a64,'signal':_0x3fd77d,'stdout':_0x58c306,'stderr':_0x28236a});});});}export{resolveRuntimeLarkCliCommand};function resolvePackageNameFromNpmSpec(_0x58f8a4){const _0x577be6=_0x96c1f6,_0x1ae9bf=_0x58f8a4['trim']()['replace'](/^npm:/,'');if(!_0x1ae9bf)throw new Error(_0x577be6(0x185)+'empty\x20pl'+_0x577be6(0x328)+'c');if(_0x1ae9bf[_0x577be6(0x23e)+'th']('@')){const _0x5160b8=_0x1ae9bf[_0x577be6(0x2e0)]('/');if(_0x5160b8===-0x1)throw new Error(_0x577be6(0x185)+'scoped\x20s'+'pec:\x20'+_0x58f8a4);const _0x3db79d=_0x1ae9bf[_0x577be6(0x2e0)]('@',_0x5160b8+0x1);return _0x3db79d===-0x1?_0x1ae9bf:_0x1ae9bf[_0x577be6(0x336)](0x0,_0x3db79d);}const _0x28adf5=_0x1ae9bf[_0x577be6(0x2e0)]('@');return _0x28adf5===-0x1?_0x1ae9bf:_0x1ae9bf[_0x577be6(0x336)](0x0,_0x28adf5);}async function createRuntimeEnv(_0x396659,_0x3d6640={}){const _0x3fc2c8=_0x96c1f6,_0x2efbb8=process.env.OPENCLAW_STATE_DIR||'',_0x31b8e1=process.env.NPM_CONFIG_REGISTRY||_0x3fc2c8(0x387)+_0x3fc2c8(0x2e9)+_0x3fc2c8(0x17c)+_0x3fc2c8(0x19e),_0x217941=_0x2efbb8?join(_0x2efbb8,_0x3fc2c8(0x1e0)+_0x3fc2c8(0x2cb)+'ls'):join(_0x396659[_0x3fc2c8(0x2a9)+_0x3fc2c8(0x310)],_0x3fc2c8(0x190)),_0x14a121=join(_0x217941,'npm-glob'+'al'),_0x4377eb=join(_0x217941,_0x3fc2c8(0x39a)+'e'),_0x3b8939=join(_0x14a121,_0x3fc2c8(0x1b8));await mkdir(_0x3b8939,{'recursive':!![]}),await mkdir(_0x4377eb,{'recursive':!![]});const _0x1468e4=[_0x3b8939,dirname(_0x396659[_0x3fc2c8(0x206)+_0x3fc2c8(0x1cb)]),process.env.PATH||''];return{...process.env,..._0x3d6640,'PATH':_0x1468e4[_0x3fc2c8(0x399)](Boolean)['join'](delimiter),'npm_config_prefix':_0x14a121,'NPM_CONFIG_PREFIX':_0x14a121,'npm_config_cache':_0x4377eb,'NPM_CONFIG_CACHE':_0x4377eb,'NPM_CONFIG_REGISTRY':_0x31b8e1,'npm_execpath':_0x396659[_0x3fc2c8(0x1c8)],'npm_node_execpath':_0x396659['nodeExec'+_0x3fc2c8(0x1cb)],'OPENCLAW_RUNTIME_NPM_PREFIX':_0x14a121,'OPENCLAW_RUNTIME_NPM_BIN':_0x3b8939};}export async function getRuntimeSpawnContext(_0x4015f3,_0x4fd572={}){const _0xcf310a=_0x96c1f6,_0x27efe6=await loadRuntimeInfo(_0x4015f3),_0x4f63c5=await createRuntimeEnv(_0x27efe6,_0x4fd572);return{'cwd':_0x27efe6[_0xcf310a(0x3ac)+_0xcf310a(0x380)+'ir'],'env':_0x4f63c5,'runtime':_0x27efe6};}function resolvePluginDirNameFromSpec(_0x87f0aa){const _0x25b151=_0x96c1f6,_0x49f080=resolvePackageNameFromNpmSpec(_0x87f0aa),_0x135f59=_0x49f080[_0x25b151(0x30d)]('/')['filter'](Boolean),_0x4bb5c2=_0x135f59['at'](-0x1)??'';if(!_0x4bb5c2)throw new Error('Invalid\x20'+_0x25b151(0x2f0)+'pec:\x20'+_0x87f0aa);return _0x4bb5c2;}async function resolvePluginIdFromPackageDir(_0x267460,_0x144140){const _0x45407a=_0x96c1f6,_0x1a2377=await readJson(join(_0x267460,_0x45407a(0x30f)+_0x45407a(0x296)),{}),_0xcf2771=await readPluginManifest(_0x267460),_0x216506=[_0xcf2771?.['id'],_0xcf2771?.[_0x45407a(0x3aa)],_0xcf2771?.[_0x45407a(0x32a)],_0x1a2377?.[_0x45407a(0x3ac)]?.['id'],_0x1a2377?.[_0x45407a(0x3ac)+'Id'],_0x144140],_0xaa6e53=_0x216506[_0x45407a(0x178)](_0x94f639=>typeof _0x94f639===_0x45407a(0x2df)&&_0x94f639[_0x45407a(0x1d8)]());if(!_0xaa6e53)throw new Error(_0x45407a(0x25a)+_0x45407a(0x1d0)+_0x45407a(0x3a3)+_0x45407a(0x1d4)+'\x20'+_0x267460);return _0xaa6e53[_0x45407a(0x1d8)]();}function pluginSpecMatches(_0x331c5d,_0x372225){const _0x1be3a7=_0x96c1f6,_0xd4aa4=_0x372225[_0x1be3a7(0x1d8)](),_0x4a2ace=resolvePackageNameFromNpmSpec(_0xd4aa4);return[_0x331c5d[_0x1be3a7(0x303)],_0x331c5d['resolved'+_0x1be3a7(0x2b3)],_0x331c5d['resolved'+_0x1be3a7(0x301)]][_0x1be3a7(0x1d2)](_0x26ef06=>_0x26ef06===_0xd4aa4||_0x26ef06===_0x4a2ace);}async function installPluginFromNpmSpec(_0x4a66e5,_0xdad048,_0x530be4={}){const _0x5ab5de=_0x96c1f6,_0x5a34d8=_0x4a66e5[_0x5ab5de(0x1d8)]()[_0x5ab5de(0x22c)](/^npm:/,''),_0x45d8c1=resolvePluginDirNameFromSpec(_0x5a34d8),_0x161a84=join(_0xdad048[_0x5ab5de(0x3ac)+_0x5ab5de(0x380)+'ir'],_0x5ab5de(0x2ad),'extensio'+'ns'),_0x44e5dd=join(_0x161a84,_0x45d8c1),_0x52e201=join(_0xdad048[_0x5ab5de(0x2a9)+_0x5ab5de(0x310)],_0x5ab5de(0x1cc)+_0x5ab5de(0x193)+process[_0x5ab5de(0x1c6)]+'-'+Date[_0x5ab5de(0x1b7)]()),_0x30bcdf=await createRuntimeEnv(_0xdad048),_0x3ce1ae=new Date()[_0x5ab5de(0x264)+_0x5ab5de(0x248)](),_0x21b1d2=join(_0xdad048['runtimeR'+_0x5ab5de(0x310)],'.cache');await mkdir(_0x21b1d2,{'recursive':!![]}),await rm(_0x52e201,{'recursive':!![],'force':!![]}),await rm(_0x44e5dd,{'recursive':!![],'force':!![]}),await mkdir(_0x52e201,{'recursive':!![]}),await mkdir(_0x161a84,{'recursive':!![]}),console['log'](_0x5ab5de(0x34f)+_0x5ab5de(0x199)+_0x5ab5de(0x27e)+_0x5ab5de(0x3a7)+'lugin\x20'+_0x5a34d8);const _0x27bfcd=await runProcess(_0xdad048['nodeExec'+_0x5ab5de(0x1cb)],[_0xdad048[_0x5ab5de(0x1c8)],_0x5ab5de(0x1c0),_0x5a34d8,'--json'],{'cwd':_0x21b1d2,'env':_0x30bcdf,'label':_0x5ab5de(0x205)+'\x20'+_0x5a34d8}),_0x24721a=parseNpmPackJson(_0x27bfcd[_0x5ab5de(0x2bc)]),_0x4dd832=normalizePackedTarballFilename(_0x24721a[_0x5ab5de(0x22d)]),_0x5c8823=join(_0x21b1d2,_0x4dd832);if(!existsSync(_0x5c8823))throw new Error(_0x5ab5de(0x205)+'\x20did\x20not'+_0x5ab5de(0x2b9)+'tarball:'+'\x20'+_0x5c8823);await runProcess('tar',[_0x5ab5de(0x359),_0x5c8823,'-C',_0x52e201],{'label':'extract\x20'+_0x4dd832}),await rename(join(_0x52e201,_0x5ab5de(0x26c)),_0x44e5dd),await rm(_0x52e201,{'recursive':!![],'force':!![]});const _0x50d800=join(_0x44e5dd,_0x5ab5de(0x30f)+'json'),_0x51b4c1=await readJson(_0x50d800,{});(_0x51b4c1[_0x5ab5de(0x1a7)+_0x5ab5de(0x311)]||_0x51b4c1['scripts'])&&(delete _0x51b4c1[_0x5ab5de(0x1a7)+_0x5ab5de(0x311)],delete _0x51b4c1[_0x5ab5de(0x2c6)],await writeJson(_0x50d800,_0x51b4c1));await runProcess(_0xdad048['nodeExec'+_0x5ab5de(0x1cb)],[_0xdad048[_0x5ab5de(0x1c8)],_0x5ab5de(0x214),'--omit=d'+'ev',_0x5ab5de(0x354)+_0x5ab5de(0x308),'--no-aud'+'it',_0x5ab5de(0x242)+'d',_0x5ab5de(0x364)+_0x5ab5de(0x1a6)+'ps'],{'cwd':_0x44e5dd,'env':_0x30bcdf,'label':'npm\x20inst'+_0x5ab5de(0x1c3)+_0x5ab5de(0x1cf)+_0x5a34d8});const _0x3b09bb=new Date()[_0x5ab5de(0x264)+_0x5ab5de(0x248)](),_0x172fd1=await resolvePluginIdFromPackageDir(_0x44e5dd,_0x24721a['name']);return _0x530be4[_0x5ab5de(0x2db)+_0x5ab5de(0x344)]?.[_0x5ab5de(0x1f5)](_0x5ab5de(0x224)+_0x5ab5de(0x2bf)+'lled',{'spec':_0x5a34d8,'pluginId':_0x172fd1,'installPath':_0x44e5dd}),{'pluginId':_0x172fd1,'source':_0x5ab5de(0x340),'spec':_0x5a34d8,'installPath':toRuntimeRelative(_0xdad048[_0x5ab5de(0x2a9)+_0x5ab5de(0x310)],_0x44e5dd),'version':_0x24721a[_0x5ab5de(0x266)],'resolvedName':_0x24721a['name'],'resolvedVersion':_0x24721a[_0x5ab5de(0x266)],'resolvedSpec':_0x24721a['name']+'@'+_0x24721a[_0x5ab5de(0x266)],'integrity':typeof _0x24721a['integrit'+'y']===_0x5ab5de(0x2df)?_0x24721a['integrit'+'y']:'','shasum':typeof _0x24721a[_0x5ab5de(0x247)]===_0x5ab5de(0x2df)?_0x24721a[_0x5ab5de(0x247)]:'','resolvedAt':_0x3ce1ae,'installedAt':_0x3b09bb};}async function syncConfiguredNpmPlugins(_0x39e470,_0x5e55ea,_0x244cc7,_0x5c2bf0={}){const _0x26f9aa=_0x96c1f6;if(_0x5c2bf0['syncOnly'])return;const _0x5d9921=createRuntimeInfoFromManifest(_0x5e55ea,_0x244cc7),_0x258555=Array[_0x26f9aa(0x182)](_0x244cc7[_0x26f9aa(0x251)])?_0x244cc7[_0x26f9aa(0x251)]:[],_0xe55fb7=[];for(const _0x304a55 of _0x39e470[_0x26f9aa(0x3ac)]['pluginSp'+_0x26f9aa(0x325)]){const _0x9ef660=_0x258555[_0x26f9aa(0x178)](_0x4197eb=>_0x4197eb?.[_0x26f9aa(0x17a)]===_0x26f9aa(0x340)&&pluginSpecMatches(_0x4197eb,_0x304a55)&&typeof _0x4197eb['installP'+'ath']===_0x26f9aa(0x2df)&&existsSync(resolve(_0x5e55ea,_0x4197eb[_0x26f9aa(0x1f6)+_0x26f9aa(0x2dc)])));if(_0x9ef660){_0xe55fb7['push'](_0x9ef660);continue;}_0xe55fb7['push'](await installPluginFromNpmSpec(_0x304a55,_0x5d9921,_0x5c2bf0));}const _0x162f74=new Set(_0x39e470['openclaw'][_0x26f9aa(0x25d)+_0x26f9aa(0x325)][_0x26f9aa(0x18e)](resolvePackageNameFromNpmSpec)),_0x24838e=_0x258555['filter'](_0x19df7d=>_0x19df7d?.[_0x26f9aa(0x17a)]!==_0x26f9aa(0x340)||!_0x162f74[_0x26f9aa(0x234)](resolvePackageNameFromNpmSpec(_0x19df7d[_0x26f9aa(0x216)+_0x26f9aa(0x301)]||_0x19df7d['spec']||'')));_0x244cc7['plugins']=[..._0x24838e,..._0xe55fb7];}function hasRuntimeDependencies(_0xbf4a66){const _0x45d103=_0x96c1f6,_0x5926f1=_0xbf4a66?.[_0x45d103(0x31c)+'cies']&&typeof _0xbf4a66['dependen'+'cies']===_0x45d103(0x20c)?Object[_0x45d103(0x33e)](_0xbf4a66[_0x45d103(0x31c)+_0x45d103(0x25b)]):[],_0x5a218f=_0xbf4a66?.[_0x45d103(0x343)+_0x45d103(0x211)+'cies']&&typeof _0xbf4a66[_0x45d103(0x343)+'Dependen'+_0x45d103(0x25b)]===_0x45d103(0x20c)?Object['keys'](_0xbf4a66['optional'+_0x45d103(0x211)+_0x45d103(0x25b)]):[];return _0x5926f1[_0x45d103(0x1c9)]>0x0||_0x5a218f[_0x45d103(0x1c9)]>0x0;}async function installLocalPluginRuntimeDependencies(_0x2c192e,_0x43db8d,_0x2a8227){const _0x5bdc14=_0x96c1f6,_0x2768ee=join(_0x2c192e,'package.'+_0x5bdc14(0x296)),_0x1b9c03=await readJson(_0x2768ee,{});(_0x1b9c03[_0x5bdc14(0x1a7)+'dencies']||_0x1b9c03['scripts'])&&(delete _0x1b9c03[_0x5bdc14(0x1a7)+_0x5bdc14(0x311)],delete _0x1b9c03[_0x5bdc14(0x2c6)],await writeJson(_0x2768ee,_0x1b9c03));if(!hasRuntimeDependencies(_0x1b9c03))return;const _0x5b5085=await createRuntimeEnv(_0x43db8d);console[_0x5bdc14(0x2b6)](_0x5bdc14(0x34f)+_0x5bdc14(0x199)+'time]\x20in'+_0x5bdc14(0x347)+'\x20local\x20p'+_0x5bdc14(0x29d)+_0x5bdc14(0x28d)+_0x5bdc14(0x2d3)+_0x2c192e),await runProcess(_0x43db8d[_0x5bdc14(0x206)+_0x5bdc14(0x1cb)],[_0x43db8d['npmCli'],_0x5bdc14(0x214),_0x5bdc14(0x236)+'ev',_0x5bdc14(0x354)+_0x5bdc14(0x308),_0x5bdc14(0x1c4)+'it',_0x5bdc14(0x242)+'d',_0x5bdc14(0x364)+_0x5bdc14(0x1a6)+'ps'],{'cwd':_0x2c192e,'env':_0x5b5085,'label':_0x5bdc14(0x24c)+_0x5bdc14(0x317)+_0x5bdc14(0x1ae)+'\x20'+_0x2c192e}),_0x2a8227[_0x5bdc14(0x2db)+_0x5bdc14(0x344)]?.['info'](_0x5bdc14(0x2a7)+'ugin\x20dep'+_0x5bdc14(0x330)+_0x5bdc14(0x31d)+_0x5bdc14(0x27a),{'installPath':_0x2c192e});}async function syncSharedPluginModules(_0x14415f,_0x5a865d){const _0x2aba92=_0x96c1f6,_0x14c272=new Set();for(const _0xffc196 of _0x14415f){const _0x1f4d17=join(dirname(_0xffc196),_0x2aba92(0x2c2));if(existsSync(_0x1f4d17))_0x14c272[_0x2aba92(0x2d2)](_0x1f4d17);}for(const _0x1d938c of _0x14c272){await copyDirFresh(_0x1d938c,join(_0x5a865d,'_shared'));}}async function syncProductPlugins(_0x4fd4eb,_0x9eb7ce,_0x39dd10,_0x59da28={}){const _0x4d3c13=_0x96c1f6,_0x7dc8a4=join(_0x9eb7ce,_0x4d3c13(0x3ac),_0x4d3c13(0x2ad),_0x4d3c13(0x379)+'ns'),_0x217ab2=createRuntimeInfoFromManifest(_0x9eb7ce,_0x39dd10),_0x10b5d2=[];await syncSharedPluginModules(_0x4fd4eb['openclaw'][_0x4d3c13(0x216)+_0x4d3c13(0x181)+'ginPaths'],_0x7dc8a4);for(const _0x58163d of _0x4fd4eb[_0x4d3c13(0x3ac)]['resolved'+_0x4d3c13(0x181)+'ginPaths']){const _0x390200=await getPackageMetadata(_0x58163d),_0x24c441=await readPluginManifest(_0x58163d),_0x95856a=join(_0x7dc8a4,_0x390200[_0x4d3c13(0x3aa)]);await copyDirFresh(_0x58163d,_0x95856a),await installLocalPluginRuntimeDependencies(_0x95856a,_0x217ab2,_0x59da28),_0x10b5d2[_0x4d3c13(0x385)]({'pluginId':_0x390200[_0x4d3c13(0x3aa)],'source':'local','spec':_0x4d3c13(0x36c)+_0x58163d,'installPath':toRuntimeRelative(_0x9eb7ce,_0x95856a),'version':_0x390200[_0x4d3c13(0x266)],'resolvedName':_0x390200[_0x4d3c13(0x32a)],'resolvedVersion':_0x390200[_0x4d3c13(0x266)],'resolvedSpec':'local:'+_0x58163d,'integrity':'','shasum':'','resolvedAt':new Date()[_0x4d3c13(0x264)+_0x4d3c13(0x248)](),'installedAt':new Date()[_0x4d3c13(0x264)+_0x4d3c13(0x248)](),'agentScope':_0x24c441[_0x4d3c13(0x342)+'pe'],'skills':_0x24c441[_0x4d3c13(0x2e2)]});}const _0x598587=new Set(_0x10b5d2['map'](_0xe76553=>_0xe76553[_0x4d3c13(0x3aa)])),_0x25e628=Array['isArray'](_0x39dd10[_0x4d3c13(0x251)])?_0x39dd10[_0x4d3c13(0x251)]['filter'](_0x587e43=>!_0x598587[_0x4d3c13(0x234)](_0x587e43[_0x4d3c13(0x3aa)])):[];_0x39dd10[_0x4d3c13(0x251)]=[..._0x25e628,..._0x10b5d2];}async function syncManifestPluginScope(_0x22f534,_0x5db77e,_0x14cf55){const _0x2be02a=_0x96c1f6,_0x431eba=join(_0x5db77e,_0x2be02a(0x3ac),_0x2be02a(0x2ad),_0x2be02a(0x379)+'ns'),_0x11eaa1=new Set(_0x22f534[_0x2be02a(0x3ac)][_0x2be02a(0x25d)+_0x2be02a(0x325)]??[]),_0x12d493=new Set([..._0x11eaa1]['map'](_0x59e775=>_0x59e775['replace'](/^npm:/,''))['map'](_0x4f322d=>{const _0x350142=_0x2be02a;if(_0x4f322d[_0x350142(0x23e)+'th']('@')){const _0x4bfea2=_0x4f322d[_0x350142(0x30d)]('@');return _0x4bfea2[_0x350142(0x1c9)]>=0x3?'@'+_0x4bfea2[0x1]:_0x4f322d;}return _0x4f322d[_0x350142(0x30d)]('@')[0x0];})[_0x2be02a(0x399)](Boolean)),_0x53a097=new Set();for(const _0x5f0338 of _0x22f534[_0x2be02a(0x3ac)][_0x2be02a(0x216)+'LocalPlu'+_0x2be02a(0x198)]){const _0x26c24b=await getPackageMetadata(_0x5f0338);if(_0x26c24b['pluginId'])_0x53a097[_0x2be02a(0x2d2)](_0x26c24b[_0x2be02a(0x3aa)]);}const _0x3bd450=Array[_0x2be02a(0x182)](_0x14cf55[_0x2be02a(0x251)])?_0x14cf55[_0x2be02a(0x251)]:[];_0x14cf55[_0x2be02a(0x25d)+'ecs']=[..._0x22f534['openclaw'][_0x2be02a(0x25d)+_0x2be02a(0x325)],..._0x22f534[_0x2be02a(0x3ac)][_0x2be02a(0x216)+_0x2be02a(0x181)+_0x2be02a(0x198)][_0x2be02a(0x18e)](_0x26041e=>'local:'+_0x26041e)],_0x14cf55[_0x2be02a(0x251)]=_0x3bd450[_0x2be02a(0x399)](_0x19680b=>{const _0x141836=_0x2be02a;if(!_0x19680b||typeof _0x19680b!==_0x141836(0x20c))return![];if(_0x19680b['source']===_0x141836(0x37b))return _0x53a097[_0x141836(0x234)](_0x19680b['pluginId']);if(_0x19680b[_0x141836(0x17a)]===_0x141836(0x340))return _0x11eaa1[_0x141836(0x234)](_0x19680b['spec'])||_0x11eaa1[_0x141836(0x234)](_0x19680b['resolved'+'Spec'])||_0x12d493[_0x141836(0x234)](_0x19680b[_0x141836(0x216)+_0x141836(0x301)]);return![];});const _0x54a7ee=new Set(_0x14cf55['plugins'][_0x2be02a(0x18e)](_0x15ec72=>_0x15ec72[_0x2be02a(0x3aa)]));for(const _0x3265f2 of _0x3bd450){if(!_0x3265f2[_0x2be02a(0x3aa)]||_0x54a7ee[_0x2be02a(0x234)](_0x3265f2['pluginId']))continue;const _0x47082a=typeof _0x3265f2['installP'+_0x2be02a(0x2dc)]===_0x2be02a(0x2df)&&_0x3265f2[_0x2be02a(0x1f6)+_0x2be02a(0x2dc)][_0x2be02a(0x1d8)]()?resolve(_0x5db77e,_0x3265f2[_0x2be02a(0x1f6)+_0x2be02a(0x2dc)]):join(_0x431eba,_0x3265f2['pluginId']),_0x528acc=relative(_0x431eba,_0x47082a);if(_0x528acc['startsWi'+'th']('..')||_0x528acc==='')continue;await rm(_0x47082a,{'recursive':!![],'force':!![]});}}async function collectCapabilityEntries(_0x17aa3c,_0x37f46d){const _0x2145c9=_0x96c1f6,_0x12449f=new Map();for(const _0x2556d8 of _0x17aa3c){let _0x2a8287;try{_0x2a8287=await stat(_0x2556d8);}catch{throw new Error(_0x37f46d+('\x20path\x20wa'+_0x2145c9(0x352)+_0x2145c9(0x353))+_0x2556d8);}if(!_0x2a8287[_0x2145c9(0x22f)+_0x2145c9(0x281)]())throw new Error(_0x37f46d+(_0x2145c9(0x222)+_0x2145c9(0x20f)+_0x2145c9(0x1e6)+_0x2145c9(0x316))+_0x2556d8);const _0x12546f={'name':basename(_0x2556d8),'path':_0x2556d8},_0x2e55c9=_0x12449f[_0x2145c9(0x2cc)](_0x12546f['name']);if(_0x2e55c9)throw new Error('Duplicat'+'e\x20'+_0x37f46d+_0x2145c9(0x1ff)+_0x12546f[_0x2145c9(0x32a)]+_0x2145c9(0x1ee)+_0x2e55c9['path']+'\x20and\x20'+_0x12546f['path']);_0x12449f['set'](_0x12546f[_0x2145c9(0x32a)],_0x12546f);}return[..._0x12449f[_0x2145c9(0x1ad)]()];}async function syncProductCapabilityDirs(_0x1402f8,_0x467fea,_0x1049b7){const _0x4aae18=_0x96c1f6,_0x2247da=await collectCapabilityEntries(_0x1402f8,_0x1049b7);await rm(_0x467fea,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await mkdir(_0x467fea,{'recursive':!![]});for(const _0x286f3e of _0x2247da){await cp(_0x286f3e[_0x4aae18(0x24e)],join(_0x467fea,_0x286f3e[_0x4aae18(0x32a)]),{'recursive':!![]});}return _0x2247da[_0x4aae18(0x1c9)];}export const __test__={'collectCapabilityEntries':collectCapabilityEntries,'syncProductCapabilityDirs':syncProductCapabilityDirs,'resolveNodeExtractRoot':resolveNodeExtractRoot};async function syncProductAgents(_0x2399e4,_0x10168d,_0x4dc8d4){const _0x5bad38=_0x96c1f6,_0x26cd55=join(_0x10168d,_0x5bad38(0x3ac),_0x5bad38(0x394)),_0x33583e=await syncProductCapabilityDirs(_0x2399e4[_0x5bad38(0x3ac)][_0x5bad38(0x216)+'LocalAge'+_0x5bad38(0x282)],_0x26cd55,_0x5bad38(0x2b1));_0x4dc8d4['agents']={'source':_0x5bad38(0x27b),'installPath':toRuntimeRelative(_0x10168d,_0x26cd55),'localPaths':_0x2399e4['openclaw']['resolved'+_0x5bad38(0x2fd)+_0x5bad38(0x282)],'entryCount':_0x33583e};}async function syncProductSkills(_0x46bbfc,_0x2bcc87,_0x217bba){const _0x4b1a3f=_0x96c1f6,_0x1afe1f=join(_0x2bcc87,_0x4b1a3f(0x3ac),_0x4b1a3f(0x2e2)),_0x4c03ec=await syncProductCapabilityDirs(_0x46bbfc[_0x4b1a3f(0x3ac)][_0x4b1a3f(0x216)+_0x4b1a3f(0x2ea)+_0x4b1a3f(0x273)],_0x1afe1f,'skill');_0x217bba[_0x4b1a3f(0x2e2)]={'source':_0x4b1a3f(0x27b),'installPath':toRuntimeRelative(_0x2bcc87,_0x1afe1f),'localPaths':_0x46bbfc[_0x4b1a3f(0x3ac)][_0x4b1a3f(0x216)+_0x4b1a3f(0x2ea)+'llPaths'],'entryCount':_0x4c03ec};}
|
|
1
|
+
const _0x3d918c=_0x1d92;(function(_0x1ac0b9,_0x4fb2e9){const _0x513519=_0x1d92,_0x9c2d43=_0x1ac0b9();while(!![]){try{const _0x508069=-parseInt(_0x513519(0x11b))/0x1+-parseInt(_0x513519(0x2a0))/0x2*(-parseInt(_0x513519(0x26d))/0x3)+-parseInt(_0x513519(0x1d6))/0x4*(-parseInt(_0x513519(0x126))/0x5)+parseInt(_0x513519(0x2b2))/0x6+-parseInt(_0x513519(0x1b3))/0x7+parseInt(_0x513519(0x200))/0x8*(-parseInt(_0x513519(0x299))/0x9)+parseInt(_0x513519(0x1ec))/0xa;if(_0x508069===_0x4fb2e9)break;else _0x9c2d43['push'](_0x9c2d43['shift']());}catch(_0x26a9f0){_0x9c2d43['push'](_0x9c2d43['shift']());}}}(_0x4fd9,0xbd75f));import{existsSync}from'node:fs';function _0x1d92(_0xe049b7,_0x544037){_0xe049b7=_0xe049b7-0x95;const _0x4fd9ec=_0x4fd9();let _0x1d92b8=_0x4fd9ec[_0xe049b7];return _0x1d92b8;}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{patchChannelPluginRuntimeFromSource}from'./patch-channel-plugin-runtime.mjs';import{patchProviderRequestIdHeaderFromSource}from'./patch-provider-request-id-header.mjs';import{patchSessionStoreLoadFromSource,patchSessionStoreWriteFromSource}from'./patch-session-store-sqlite.mjs';import{patchQQBotOutboundFallbackFromSource,patchQQBotOutboundSessionRouteFromSource}from'./patch-qqbot-outbound-session-route.mjs';import{patchWeixinOutboundFallbackFromSource,patchWeixinOutboundSessionRouteFromSource}from'./patch-weixin-outbound-session-route.mjs';import{patchRequestIdTitleRuntimeFromSource}from'./patch-request-id-title-runtime.mjs';const RUNTIME_DIR=_0x3d918c(0x2ee)+_0x3d918c(0xef),MANIFEST_NAME=_0x3d918c(0x27c)+_0x3d918c(0x209)+_0x3d918c(0xbf),NPM_INSTALL_TIMEOUT_MS=0xf*0x3c*0x3e8;export function resolveRuntimeRoot(_0x4be870){if(process.env.WUJIE_SHELL_RUNTIME_ROOT)return resolve(process.env.WUJIE_SHELL_RUNTIME_ROOT);return resolve(_0x4be870,RUNTIME_DIR);}export function resolveManifestPath(_0x576ce1){return join(_0x576ce1,MANIFEST_NAME);}async function loadProductRuntime(_0x3354f4,_0x70e727){const _0x3bf8a9=_0x3d918c,_0x317b82=[join(_0x3354f4,_0x3bf8a9(0x181)+_0x3bf8a9(0x25d),_0x3bf8a9(0x18d)+'s'),join(_0x70e727,'shell-ru'+_0x3bf8a9(0x25d),'index.mj'+'s')];for(const _0x379097 of _0x317b82){if(!existsSync(_0x379097))continue;return await import(pathToFileURL(_0x379097)[_0x3bf8a9(0x178)]+_0x3bf8a9(0x19c)+Date['now']());}return{};}export async function prepareRuntime(_0x172163,{syncOnly:syncOnly=![],pruneForPackaging:pruneForPackaging=![]}={}){const _0x4062b0=_0x3d918c,_0x2ddd94=resolveRuntimeRoot(_0x172163[_0x4062b0(0x149)+_0x4062b0(0x302)]),_0x16703e=createRuntimeLogger(getConfigPaths(_0x172163),'runtime'),_0x5f04e2=Date[_0x4062b0(0x242)]();_0x16703e?.[_0x4062b0(0x143)+'t']?.('prepare\x20'+'runtime\x20'+'started',{'syncOnly':syncOnly,'runtimeRoot':_0x2ddd94,'shellConfig':summarizeShellConfig(_0x172163)});try{const _0x24ecbd=await ensureRuntimeBase(_0x172163,_0x2ddd94,{'runtimeLogger':_0x16703e,'syncOnly':syncOnly});_0x16703e?.[_0x4062b0(0x143)+'t']?.('runtime\x20'+'manifest'+_0x4062b0(0x2c6),{'manifestPath':resolveManifestPath(_0x2ddd94),'manifest':summarizeRuntimeManifest(_0x24ecbd)}),validateRuntimeNodeVersion(_0x24ecbd,_0x172163),_0x16703e?.[_0x4062b0(0x143)+'t']?.(_0x4062b0(0x1eb)+_0x4062b0(0x10d)+'sion\x20val'+_0x4062b0(0x2fc),{'nodeVersion':_0x24ecbd[_0x4062b0(0x232)+_0x4062b0(0x156)]});if(syncOnly)validateRuntimeOpenClawVersion(_0x24ecbd,_0x172163),_0x16703e?.[_0x4062b0(0x143)+'t']?.('runtime\x20'+'openclaw'+_0x4062b0(0x19a)+_0x4062b0(0x227)+'ed',{'openclawVersion':_0x24ecbd[_0x4062b0(0x21d)+'Version']});else{if(_0x24ecbd['openclaw'+_0x4062b0(0x323)]!==_0x172163['openclaw'][_0x4062b0(0x21d)+'Version']){const _0x25b85b=await loadRuntimeInfo(_0x172163[_0x4062b0(0x149)+_0x4062b0(0x302)]);_0x16703e?.[_0x4062b0(0x143)+'t']?.(_0x4062b0(0x21d)+_0x4062b0(0x2f2)+_0x4062b0(0xa0)+'\x20started',{'fromVersion':_0x24ecbd[_0x4062b0(0x21d)+'Version']||_0x4062b0(0xa5),'toVersion':_0x172163['openclaw'][_0x4062b0(0x21d)+_0x4062b0(0x323)]}),await installOpenClawPackage(_0x25b85b,_0x172163[_0x4062b0(0x21d)][_0x4062b0(0x21d)+_0x4062b0(0x323)]),_0x24ecbd[_0x4062b0(0x21d)+_0x4062b0(0x323)]=_0x172163[_0x4062b0(0x21d)]['openclaw'+_0x4062b0(0x323)],_0x16703e?.['importan'+'t']?.(_0x4062b0(0x21d)+_0x4062b0(0x2f2)+_0x4062b0(0xa0)+'\x20complet'+'ed',{'openclawVersion':_0x24ecbd[_0x4062b0(0x21d)+_0x4062b0(0x323)]});}}_0x24ecbd[_0x4062b0(0x318)+'dAt']=new Date()[_0x4062b0(0xb8)+'ing'](),_0x24ecbd[_0x4062b0(0x232)+_0x4062b0(0x156)]=_0x172163[_0x4062b0(0x21d)][_0x4062b0(0x232)+_0x4062b0(0x156)],_0x24ecbd[_0x4062b0(0x1c5)]={'appId':_0x172163[_0x4062b0(0x17b)],'productName':_0x172163['productN'+_0x4062b0(0x257)],'dataDirName':_0x172163[_0x4062b0(0xb7)+_0x4062b0(0x257)]},await patchChatHistoryMixedToolContentBug(_0x2ddd94,_0x24ecbd,{'runtimeLogger':_0x16703e}),await patchProviderRequestIdHeader(_0x2ddd94,_0x24ecbd,{'runtimeLogger':_0x16703e}),await patchChannelPluginRuntimeBug(_0x2ddd94,_0x24ecbd,{'runtimeLogger':_0x16703e}),await patchWeixinOutboundFallbackRuntime(_0x2ddd94,_0x24ecbd,{'runtimeLogger':_0x16703e}),await patchQQBotOutboundFallbackRuntime(_0x2ddd94,_0x24ecbd,{'runtimeLogger':_0x16703e});const _0x40b745=await loadProductRuntime(_0x172163['projectR'+'oot'],_0x2ddd94);if(typeof _0x40b745[_0x4062b0(0xd1)+_0x4062b0(0x1b5)+_0x4062b0(0x25d)]===_0x4062b0(0x202)){const _0x5e9528=createRuntimeInfoFromManifest(_0x2ddd94,_0x24ecbd);await _0x40b745[_0x4062b0(0xd1)+'roductRu'+_0x4062b0(0x25d)]({'shellConfig':_0x172163,'runtime':_0x5e9528,'runtimeLogger':_0x16703e,'syncOnly':syncOnly}),_0x16703e?.[_0x4062b0(0x143)+'t']?.(_0x4062b0(0x99)+_0x4062b0(0x1eb)+_0x4062b0(0x1a9)+'nced');}await patchSessionStoreSqliteRuntime(_0x2ddd94,_0x24ecbd,{'runtimeLogger':_0x16703e}),await patchRequestIdTitleRuntime(_0x2ddd94,_0x24ecbd,{'runtimeLogger':_0x16703e});!syncOnly&&(await installRuntimeLarkCliPackage(createRuntimeInfoFromManifest(_0x2ddd94,_0x24ecbd),{'runtimeLogger':_0x16703e,'createRuntimeEnv':createRuntimeEnv}),_0x16703e?.[_0x4062b0(0x143)+'t']?.(_0x4062b0(0x11a)+_0x4062b0(0x1ab)+'\x20package'+_0x4062b0(0x141)),await hasConfiguredKdocsSkill(_0x172163)?(await installKdocsCliBinary(_0x172163,createRuntimeInfoFromManifest(_0x2ddd94,_0x24ecbd),{'runtimeLogger':_0x16703e,'syncOnly':syncOnly}),_0x16703e?.['importan'+'t']?.('connecto'+_0x4062b0(0x142)+'e\x20tools\x20'+_0x4062b0(0x15a))):_0x16703e?.[_0x4062b0(0xc9)]('connecto'+_0x4062b0(0x142)+_0x4062b0(0x25e)+'skipped;'+_0x4062b0(0x291)+_0x4062b0(0x1b8)+_0x4062b0(0x316)+'red'));const _0x1254aa=Array['isArray'](_0x24ecbd[_0x4062b0(0x218)])?_0x24ecbd['plugins']['length']:0x0;return await syncManifestPluginScope(_0x172163,_0x2ddd94,_0x24ecbd),_0x16703e?.[_0x4062b0(0x143)+'t']?.(_0x4062b0(0x1eb)+_0x4062b0(0x2ea)+_0x4062b0(0x16f)+_0x4062b0(0xff),{'beforePluginCount':_0x1254aa,'afterPluginCount':Array['isArray'](_0x24ecbd['plugins'])?_0x24ecbd[_0x4062b0(0x218)][_0x4062b0(0xde)]:0x0,'pluginSpecCount':Array['isArray'](_0x24ecbd['pluginSp'+_0x4062b0(0xbb)])?_0x24ecbd[_0x4062b0(0x23e)+_0x4062b0(0xbb)]['length']:0x0}),await syncConfiguredNpmPlugins(_0x172163,_0x2ddd94,_0x24ecbd,{'runtimeLogger':_0x16703e,'syncOnly':syncOnly}),_0x16703e?.['importan'+'t']?.(_0x4062b0(0x24e)+_0x4062b0(0x324)+_0x4062b0(0x1de)+_0x4062b0(0x146),{'pluginSpecCount':_0x172163[_0x4062b0(0x21d)][_0x4062b0(0x23e)+_0x4062b0(0xbb)][_0x4062b0(0xde)],'pluginCount':Array['isArray'](_0x24ecbd[_0x4062b0(0x218)])?_0x24ecbd['plugins'][_0x4062b0(0xde)]:0x0}),await patchWeixinOutboundSessionRoute(_0x2ddd94,_0x24ecbd,{'runtimeLogger':_0x16703e}),await patchQQBotOutboundSessionRoute(_0x2ddd94,_0x24ecbd,{'runtimeLogger':_0x16703e}),await syncProductPlugins(_0x172163,_0x2ddd94,_0x24ecbd,{'runtimeLogger':_0x16703e}),_0x16703e?.[_0x4062b0(0x143)+'t']?.(_0x4062b0(0x99)+_0x4062b0(0x123)+'synced',{'localPluginCount':_0x172163['openclaw'][_0x4062b0(0x214)+_0x4062b0(0x20f)+'ginPaths'][_0x4062b0(0xde)],'pluginCount':Array[_0x4062b0(0x233)](_0x24ecbd[_0x4062b0(0x218)])?_0x24ecbd[_0x4062b0(0x218)][_0x4062b0(0xde)]:0x0}),await syncProductAgents(_0x172163,_0x2ddd94,_0x24ecbd),_0x16703e?.['importan'+'t']?.('product\x20'+_0x4062b0(0x2c4)+'ynced',{'sources':_0x172163['openclaw']['resolved'+_0x4062b0(0x139)+_0x4062b0(0x1db)],'entryCount':_0x24ecbd[_0x4062b0(0x337)]?.[_0x4062b0(0xe2)+'nt'],'installPath':_0x24ecbd[_0x4062b0(0x337)]?.[_0x4062b0(0x100)+_0x4062b0(0x2c9)]}),await syncProductSkills(_0x172163,_0x2ddd94,_0x24ecbd),_0x16703e?.[_0x4062b0(0x143)+'t']?.(_0x4062b0(0x99)+_0x4062b0(0x117)+'ynced',{'sources':_0x172163[_0x4062b0(0x21d)][_0x4062b0(0x214)+_0x4062b0(0x2bf)+'llPaths'],'entryCount':_0x24ecbd['skills']?.[_0x4062b0(0xe2)+'nt'],'installPath':_0x24ecbd['skills']?.[_0x4062b0(0x100)+_0x4062b0(0x2c9)]}),await syncRuntimeWrapper(_0x172163,_0x2ddd94,_0x24ecbd),_0x16703e?.[_0x4062b0(0x143)+'t']?.(_0x4062b0(0x1eb)+'wrapper\x20'+_0x4062b0(0x15a),{'wujieclawBin':_0x24ecbd[_0x4062b0(0x1f5)+'wBin']}),await prunePackagedRuntimeCaches(_0x2ddd94,_0x16703e),pruneForPackaging&&await prunePackagedRuntimePayload(_0x2ddd94,_0x24ecbd,_0x16703e),await writeJson(resolveManifestPath(_0x2ddd94),_0x24ecbd),_0x16703e?.['importan'+'t']?.('runtime\x20'+_0x4062b0(0x209)+_0x4062b0(0x1d2),{'manifestPath':resolveManifestPath(_0x2ddd94),'manifest':summarizeRuntimeManifest(_0x24ecbd),'durationMs':Date[_0x4062b0(0x242)]()-_0x5f04e2}),await _0x16703e?.['flush'](),_0x24ecbd;}catch(_0x366dcd){_0x16703e?.[_0x4062b0(0x2aa)](_0x4062b0(0x189)+'runtime\x20'+_0x4062b0(0xd8),{'syncOnly':syncOnly,'runtimeRoot':_0x2ddd94,'durationMs':Date['now']()-_0x5f04e2,'error':_0x366dcd}),await _0x16703e?.['flush']();throw _0x366dcd;}}async function prunePackagedRuntimeCaches(_0xa00abc,_0x42c60b){const _0x2327c1=_0x3d918c,_0x59b877=[join(_0xa00abc,_0x2327c1(0x333)),join(_0xa00abc,_0x2327c1(0x1df),_0x2327c1(0x16e)+'e'),join(_0xa00abc,_0x2327c1(0x2e1)+'time-bac'+_0x2327c1(0x14a)),join(_0xa00abc,_0x2327c1(0x14c)+_0x2327c1(0x2cd)+'ackup')];for(const _0x2a3f14 of _0x59b877){if(!existsSync(_0x2a3f14))continue;await rm(_0x2a3f14,{'recursive':!![],'force':!![]}),_0x42c60b?.[_0x2327c1(0xc9)]('pruned\x20r'+'untime\x20c'+_0x2327c1(0x1b2)+_0x2327c1(0xe8)+_0x2327c1(0x1cd),{'cachePath':_0x2a3f14});}}async function prunePackagedRuntimePayload(_0x5ea7d1,_0x207093,_0xb5226e){const _0x4ed637=_0x3d918c,_0x4675c0=createRuntimeInfoFromManifest(_0x5ea7d1,_0x207093),_0x2f730b=[join(_0x5ea7d1,process[_0x4ed637(0x1a4)]==='win32'?_0x4ed637(0x225)+_0x4ed637(0x11f)+_0x4ed637(0x11c):_0x4ed637(0x198)+_0x4ed637(0x1ae)+'dules/np'+'m'),join(_0x4675c0[_0x4ed637(0x21d)+_0x4ed637(0x1a6)+'ir'],_0x4ed637(0x2e9)+_0x4ed637(0xb3))],_0xba01=join(_0x4675c0[_0x4ed637(0x21d)+_0x4ed637(0x1a6)+'ir'],_0x4ed637(0x315),'extensio'+'ns');if(existsSync(_0xba01))for(const _0x1a5e12 of await readdir(_0xba01,{'withFileTypes':!![]})){_0x1a5e12['isDirect'+_0x4ed637(0x9a)]()&&_0x2f730b[_0x4ed637(0x2e8)](join(_0xba01,_0x1a5e12[_0x4ed637(0x22d)],_0x4ed637(0x2e9)+_0x4ed637(0xb3)));}const _0x45768e={'files':0x0,'directories':0x0,'bytes':0x0};for(const _0x485e56 of _0x2f730b){await pruneRuntimeDependencyTree(_0x485e56,_0x45768e);}await pruneOpenClawDocs(_0x4675c0['openclaw'+_0x4ed637(0x1a6)+'ir'],_0x45768e),_0xb5226e?.[_0x4ed637(0xc9)](_0x4ed637(0x1bd)+_0x4ed637(0xc3)+_0x4ed637(0xcf)+_0x4ed637(0x12b)+_0x4ed637(0x24d),_0x45768e);}async function pruneOpenClawDocs(_0x81019e,_0x534fb0){const _0x5ce35b=_0x3d918c,_0x42e1ca=join(_0x81019e,_0x5ce35b(0x183));if(!existsSync(_0x42e1ca))return;for(const _0x6193d1 of await readdir(_0x42e1ca,{'withFileTypes':!![]})){if(_0x6193d1[_0x5ce35b(0x22d)]===_0x5ce35b(0x1d9)+'e')continue;await removePrunedPath(join(_0x42e1ca,_0x6193d1['name']),_0x534fb0);}}async function pruneRuntimeDependencyTree(_0x2b984d,_0x476492){const _0x150da1=_0x3d918c;if(!existsSync(_0x2b984d))return;for(const _0x484071 of await readdir(_0x2b984d,{'withFileTypes':!![]})){const _0xdc7a17=join(_0x2b984d,_0x484071['name']);if(_0x484071[_0x150da1(0x268)+_0x150da1(0x9a)]()){if(shouldPruneRuntimeDirectory(_0x2b984d,_0x484071[_0x150da1(0x22d)])){await removePrunedPath(_0xdc7a17,_0x476492);continue;}await pruneRuntimeDependencyTree(_0xdc7a17,_0x476492);continue;}_0x484071[_0x150da1(0x2b7)]()&&shouldPruneRuntimeFile(_0x484071[_0x150da1(0x22d)])&&await removePrunedPath(_0xdc7a17,_0x476492);}}function shouldPruneRuntimeDirectory(_0x3db639,_0x89f8e2){const _0x39d47d=_0x3d918c;if(_0x89f8e2===_0x39d47d(0x2a5))return!![];if(new Set([_0x39d47d(0x17c),_0x39d47d(0x183),'man'])[_0x39d47d(0x2b5)](_0x89f8e2))return existsSync(join(_0x3db639,_0x39d47d(0x1ee)+_0x39d47d(0x155)));return new Set([_0x39d47d(0x325)+'_',_0x39d47d(0x109),_0x39d47d(0x1e2),_0x39d47d(0x17a),_0x39d47d(0x166)])[_0x39d47d(0x2b5)](_0x89f8e2);}function shouldPruneRuntimeFile(_0x2a213d){const _0x7a199d=_0x3d918c;if(_0x2a213d==='package-'+'lock.jso'+'n'||_0x2a213d[_0x7a199d(0xac)](_0x7a199d(0x1bc)))return!![];return new Set([_0x7a199d(0x1fe),_0x7a199d(0x1b6),_0x7a199d(0x18f)+'n'])[_0x7a199d(0x2b5)](extname(_0x2a213d)[_0x7a199d(0x2ae)+'ase']());}async function removePrunedPath(_0x1fccb4,_0x8fd6ec){const _0x172e85=_0x3d918c;if(!existsSync(_0x1fccb4))return;const _0x21be5a=await getPathSize(_0x1fccb4),_0x3fbc39=await stat(_0x1fccb4);await rm(_0x1fccb4,{'recursive':!![],'force':!![]}),_0x8fd6ec[_0x172e85(0x2d6)]+=_0x21be5a;if(_0x3fbc39[_0x172e85(0x268)+_0x172e85(0x9a)]())_0x8fd6ec[_0x172e85(0x245)+_0x172e85(0x199)]+=0x1;else _0x8fd6ec[_0x172e85(0xab)]+=0x1;}async function getPathSize(_0x3636d4){const _0x5da755=_0x3d918c,_0x5a6544=await stat(_0x3636d4);if(!_0x5a6544[_0x5da755(0x268)+_0x5da755(0x9a)]())return _0x5a6544['size'];let _0x1a754a=0x0;for(const _0x167e34 of await readdir(_0x3636d4,{'withFileTypes':!![]})){_0x1a754a+=await getPathSize(join(_0x3636d4,_0x167e34['name']));}return _0x1a754a;}async function syncRuntimeWrapper(_0x206980,_0x281b7f,_0x941c6){const _0x1cb30b=_0x3d918c,_0x4d4bd1=_0x206980[_0x1cb30b(0x21d)]?.[_0x1cb30b(0x30d)+'leName']??_0x1cb30b(0x129)+'json',_0x5bb607=join(_0x281b7f,_0x1cb30b(0x10b),_0x1cb30b(0x1f5)+'w'),_0x5e507d=join(_0x281b7f,_0x1cb30b(0x10b),_0x1cb30b(0x1f5)+_0x1cb30b(0xf6)),_0x23cac3=normalizeRuntimeRelativePath(relative(dirname(_0x5bb607),resolve(_0x281b7f,_0x941c6[_0x1cb30b(0x334)+_0x1cb30b(0x219)]))),_0x935335=normalizeRuntimeRelativePath(relative(dirname(_0x5bb607),resolve(_0x281b7f,_0x941c6[_0x1cb30b(0x21d)+_0x1cb30b(0x2d5)]))),_0x1585fd=_0x1cb30b(0x1ff)+_0x206980[_0x1cb30b(0xb7)+_0x1cb30b(0x257)],_0xbcc12e=_0x1cb30b(0x300)+_0x1cb30b(0x30b)+_0x206980[_0x1cb30b(0xb7)+_0x1cb30b(0x257)];await mkdir(dirname(_0x5bb607),{'recursive':!![]});const _0x5e8d52=fileURLToPath(new URL(_0x1cb30b(0x31e)+'sets/wuj'+_0x1cb30b(0x2d9)+_0x1cb30b(0x293),import.meta.url)),_0x21cd43=join(_0x281b7f,_0x1cb30b(0x10b),'wujie-lo'+_0x1cb30b(0x31d));await cp(_0x5e8d52,_0x21cd43),await writeFile(_0x5bb607,[_0x1cb30b(0x280)+'h',_0x1cb30b(0xf7)+_0x1cb30b(0x102)+_0x1cb30b(0x9e)+_0x1cb30b(0x2a2)+'_HOME:-'+_0x1585fd+'}\x22',_0x1cb30b(0xf7)+_0x1cb30b(0x102)+_0x1cb30b(0x23a)+_0x1cb30b(0x10c)+_0x1cb30b(0x1da)+_0x1cb30b(0x2b4)+'-'+_0x1585fd+'}\x22',_0x1cb30b(0xf7)+_0x1cb30b(0x102)+'CONFIG_F'+_0x1cb30b(0x284)+_0x1cb30b(0x1c3)+'CLAW_CON'+_0x1cb30b(0x217)+_0x1cb30b(0x1b7)+_0x4d4bd1+'}\x22',_0x1cb30b(0xf7)+'PENCLAW_'+_0x1cb30b(0x235)+'ATH=\x22${O'+_0x1cb30b(0x102)+_0x1cb30b(0x235)+_0x1cb30b(0x221)+_0x1585fd+'/'+_0x4d4bd1+'}\x22',_0x1cb30b(0x231)+'IR=$(CDP'+'ATH=\x20cd\x20'+_0x1cb30b(0x224)+'rname\x20--'+'\x20\x22$0\x22)\x22\x20'+_0x1cb30b(0xe7),_0x1cb30b(0x122)+_0x1cb30b(0x1bb)+'\x20-z\x20\x22$WU'+_0x1cb30b(0x1dc)+_0x1cb30b(0xd3)+_0x1cb30b(0x114),'\x20\x20\x22$SCRI'+_0x1cb30b(0x29f)+_0x23cac3+('\x22\x20\x22$SCRI'+'PT_DIR/w'+_0x1cb30b(0xd0)+_0x1cb30b(0x2d0)+_0x1cb30b(0x98)+_0x1cb30b(0x230)+'ue'),'fi',_0x1cb30b(0x29a)+_0x1cb30b(0x310)+'R/'+_0x23cac3+('\x22\x20\x22$SCRI'+_0x1cb30b(0x29f))+_0x935335+_0x1cb30b(0xcd),''][_0x1cb30b(0x13f)]('\x0a'),_0x1cb30b(0x1ce)),await chmod(_0x5bb607,0x1ed),await writeFile(_0x5e507d,[_0x1cb30b(0x1b0)+'f',_0x1cb30b(0x23c)+_0x1cb30b(0x27b)+_0x1cb30b(0x2c2)+'\x20set\x20\x22OP'+_0x1cb30b(0x22f)+_0x1cb30b(0x2e6)+_0xbcc12e+'\x22',_0x1cb30b(0x23c)+_0x1cb30b(0x1da)+'ATE_DIR%'+_0x1cb30b(0x2ed)+_0x1cb30b(0x22e)+_0x1cb30b(0x105)+_0x1cb30b(0x2dd)+_0xbcc12e+'\x22','if\x20\x22%OPE'+_0x1cb30b(0x274)+'NFIG_FIL'+'E_NAME%\x22'+_0x1cb30b(0xf5)+_0x1cb30b(0x159)+_0x1cb30b(0x1a1)+'G_FILE_N'+'AME='+_0x4d4bd1+'\x22','if\x20\x22%OPE'+'NCLAW_CO'+'NFIG_PAT'+'H%\x22==\x22\x22\x20'+_0x1cb30b(0x190)+_0x1cb30b(0x274)+_0x1cb30b(0x212)+'H='+_0xbcc12e+'\x5c'+_0x4d4bd1+'\x22',_0x1cb30b(0x13c)+_0x1cb30b(0x1e7)+_0x1cb30b(0x16d),'\x22%SCRIPT'+_0x1cb30b(0x17e)+toWindowsPath(_0x23cac3)+(_0x1cb30b(0x1cf)+_0x1cb30b(0x2eb))+toWindowsPath(_0x935335)+_0x1cb30b(0x2b8),''][_0x1cb30b(0x13f)]('\x0d\x0a'),'utf8'),_0x941c6['wujiecla'+_0x1cb30b(0x206)]=toRuntimeRelative(_0x281b7f,process[_0x1cb30b(0x1a4)]==='win32'?_0x5e507d:_0x5bb607);}async function patchChatHistoryMixedToolContentBug(_0xf7d1,_0x3d7442,_0x108eac={}){const _0x597ce8=_0x3d918c,_0x3287da=resolve(_0xf7d1,_0x3d7442['openclaw'+_0x597ce8(0x1a6)+'ir']),_0xa3c9b8=join(_0x3287da,'dist');let _0x2f56b4=[];try{_0x2f56b4=await readdir(_0xa3c9b8,{'withFileTypes':!![]});}catch{_0x108eac[_0x597ce8(0x285)+'ogger']?.[_0x597ce8(0x1b4)]?.(_0x597ce8(0x135)+_0x597ce8(0xa9)+_0x597ce8(0x1f0)+'patch\x20sk'+_0x597ce8(0xc6)+'ist\x20not\x20'+'found',{'distDir':_0xa3c9b8,'openclawVersion':_0x3d7442['openclaw'+_0x597ce8(0x323)]});return;}const _0x2c1e36=_0x2f56b4[_0x597ce8(0x254)](_0x2bc797=>_0x2bc797[_0x597ce8(0x2b7)]()&&(_0x2bc797[_0x597ce8(0x22d)][_0x597ce8(0x1c6)+'th'](_0x597ce8(0x2f4)+_0x597ce8(0x12a)+'jection-')||_0x2bc797[_0x597ce8(0x22d)][_0x597ce8(0x1c6)+'th']('session-'+_0x597ce8(0xe3)+_0x597ce8(0x28b)))&&_0x2bc797[_0x597ce8(0x22d)]['endsWith'](_0x597ce8(0x153)))['map'](_0x34fd08=>join(_0xa3c9b8,_0x34fd08[_0x597ce8(0x22d)]));if(_0x2c1e36['length']===0x0){_0x108eac[_0x597ce8(0x285)+'ogger']?.[_0x597ce8(0x1b4)]?.(_0x597ce8(0x135)+_0x597ce8(0xa9)+'ed-tool\x20'+'patch\x20sk'+_0x597ce8(0x169)+_0x597ce8(0x15e)+_0x597ce8(0x104),{'openclawVersion':_0x3d7442[_0x597ce8(0x21d)+_0x597ce8(0x323)]});return;}for(const _0x235d20 of _0x2c1e36){const _0x2b5a41=await readFile(_0x235d20,_0x597ce8(0x1ce)),_0x4f6f9a=patchMixedToolContentFromSource(_0x2b5a41);if(!_0x4f6f9a[_0x597ce8(0x32c)]){if(_0x4f6f9a['reason']==='already-'+_0x597ce8(0x32c)){_0x108eac[_0x597ce8(0x285)+_0x597ce8(0x10a)]?.[_0x597ce8(0xc9)]?.(_0x597ce8(0x135)+_0x597ce8(0xa9)+_0x597ce8(0x1f0)+'patch\x20al'+_0x597ce8(0x16a)+_0x597ce8(0x255),{'openclawVersion':_0x3d7442[_0x597ce8(0x21d)+_0x597ce8(0x323)],'filePath':_0x235d20});return;}continue;}await writeFile(_0x235d20,_0x4f6f9a['source'],_0x597ce8(0x1ce)),_0x108eac[_0x597ce8(0x285)+'ogger']?.['info']?.('chat\x20his'+'tory\x20mix'+_0x597ce8(0x1f0)+'patch\x20ap'+_0x597ce8(0x255),{'openclawVersion':_0x3d7442[_0x597ce8(0x21d)+_0x597ce8(0x323)],'filePath':_0x235d20,'note':_0x597ce8(0x30a)+_0x597ce8(0x111)+_0x597ce8(0x2ba)+'patch\x20fo'+_0x597ce8(0x180)+'aw\x202026.'+_0x597ce8(0x32d)+_0x597ce8(0x2e7)+_0x597ce8(0x168)+_0x597ce8(0x1cb)+_0x597ce8(0x2de)+_0x597ce8(0x137)+_0x597ce8(0x1e0)+_0x597ce8(0x12e)+'re\x20upgra'+_0x597ce8(0x265)});return;}_0x108eac[_0x597ce8(0x285)+'ogger']?.[_0x597ce8(0x1b4)]?.(_0x597ce8(0x135)+_0x597ce8(0xa9)+_0x597ce8(0x1f0)+_0x597ce8(0x326)+'ipped;\x20f'+'unction\x20'+_0x597ce8(0x127)+'d',{'openclawVersion':_0x3d7442[_0x597ce8(0x21d)+_0x597ce8(0x323)]});}async function patchProviderRequestIdHeader(_0x79e1db,_0x40b11f,_0x448c08={}){const _0x304b2b=_0x3d918c,_0x171b9e=resolve(_0x79e1db,_0x40b11f['openclaw'+_0x304b2b(0x1a6)+'ir']),_0x42a2c6=join(_0x171b9e,_0x304b2b(0x315));let _0x1be71d=[];try{_0x1be71d=await readdir(_0x42a2c6,{'withFileTypes':!![]});}catch{_0x448c08['runtimeL'+'ogger']?.[_0x304b2b(0x1b4)]?.(_0x304b2b(0x260)+_0x304b2b(0x27f)+_0x304b2b(0x15c)+_0x304b2b(0x2ad)+'\x20skipped'+_0x304b2b(0x154)+_0x304b2b(0x241),{'distDir':_0x42a2c6,'openclawVersion':_0x40b11f[_0x304b2b(0x21d)+'Version']});return;}const _0x34e4e8=_0x1be71d[_0x304b2b(0x254)](_0x4bd7df=>_0x4bd7df[_0x304b2b(0x2b7)]()&&_0x4bd7df[_0x304b2b(0x22d)][_0x304b2b(0xac)]('.js'))[_0x304b2b(0x1f6)](_0x539324=>join(_0x42a2c6,_0x539324[_0x304b2b(0x22d)]));let _0x5a387c=0x0,_0xee9aa7=0x0;for(const _0x201497 of _0x34e4e8){const _0x463c41=await readFile(_0x201497,_0x304b2b(0x1ce)),_0x4a2e4a=patchProviderRequestIdHeaderFromSource(_0x463c41);if(_0x4a2e4a[_0x304b2b(0x32c)]){await writeFile(_0x201497,_0x4a2e4a[_0x304b2b(0x96)],_0x304b2b(0x1ce)),_0x5a387c+=0x1,_0x448c08[_0x304b2b(0x285)+_0x304b2b(0x10a)]?.['info']?.(_0x304b2b(0x260)+'\x20request'+_0x304b2b(0x15c)+_0x304b2b(0x2ad)+_0x304b2b(0x1d5),{'openclawVersion':_0x40b11f['openclaw'+'Version'],'filePath':_0x201497});continue;}if(_0x4a2e4a[_0x304b2b(0x2f3)]==='already-'+_0x304b2b(0x32c))_0xee9aa7+=0x1;}if(_0x5a387c>0x0){_0x448c08['runtimeL'+_0x304b2b(0x10a)]?.[_0x304b2b(0xc9)]?.('provider'+_0x304b2b(0x27f)+_0x304b2b(0x15c)+_0x304b2b(0x2ad)+_0x304b2b(0xa3),{'openclawVersion':_0x40b11f[_0x304b2b(0x21d)+_0x304b2b(0x323)],'patchedCount':_0x5a387c,'alreadyPatchedCount':_0xee9aa7});return;}if(_0xee9aa7>0x0){_0x448c08[_0x304b2b(0x285)+_0x304b2b(0x10a)]?.['info']?.(_0x304b2b(0x260)+_0x304b2b(0x27f)+_0x304b2b(0x15c)+_0x304b2b(0x2ad)+_0x304b2b(0x9d)+_0x304b2b(0x1d5),{'openclawVersion':_0x40b11f[_0x304b2b(0x21d)+_0x304b2b(0x323)],'alreadyPatchedCount':_0xee9aa7});return;}_0x448c08[_0x304b2b(0x285)+_0x304b2b(0x10a)]?.[_0x304b2b(0x1b4)]?.('provider'+_0x304b2b(0x27f)+_0x304b2b(0x15c)+_0x304b2b(0x2ad)+_0x304b2b(0xbe)+_0x304b2b(0x2a7)+_0x304b2b(0x20e)+_0x304b2b(0x335)+_0x304b2b(0xc7)+'nd',{'openclawVersion':_0x40b11f[_0x304b2b(0x21d)+_0x304b2b(0x323)]});}async function patchChannelPluginRuntimeBug(_0x4917b9,_0x110e6c,_0x480c92={}){const _0x1517e1=_0x3d918c,_0x3dd283=resolve(_0x4917b9,_0x110e6c[_0x1517e1(0x21d)+_0x1517e1(0x1a6)+'ir']),_0xb7cd2e=join(_0x3dd283,'dist');let _0x1e9a9e=[];try{_0x1e9a9e=await readdir(_0xb7cd2e,{'withFileTypes':!![]});}catch{_0x480c92[_0x1517e1(0x285)+_0x1517e1(0x10a)]?.[_0x1517e1(0x1b4)]?.(_0x1517e1(0x175)+'plugin\x20r'+_0x1517e1(0xc3)+'atch\x20ski'+'pped;\x20di'+'st\x20not\x20f'+'ound',{'distDir':_0xb7cd2e,'openclawVersion':_0x110e6c['openclaw'+_0x1517e1(0x323)]});return;}const _0x38e762=_0x1e9a9e[_0x1517e1(0x254)](_0x188c0a=>_0x188c0a[_0x1517e1(0x2b7)]()&&_0x188c0a[_0x1517e1(0x22d)][_0x1517e1(0x1c6)+'th'](_0x1517e1(0x9b))&&_0x188c0a[_0x1517e1(0x22d)][_0x1517e1(0xac)](_0x1517e1(0x153)))[_0x1517e1(0x1f6)](_0x5e1a32=>join(_0xb7cd2e,_0x5e1a32[_0x1517e1(0x22d)])),_0x1cc4ce=await resolveRuntimeChannelImportPath(_0xb7cd2e,_0x1e9a9e);if(_0x38e762[_0x1517e1(0xde)]===0x0){_0x480c92[_0x1517e1(0x285)+'ogger']?.['warn']?.('channel\x20'+_0x1517e1(0x2e2)+_0x1517e1(0xc3)+_0x1517e1(0x244)+'pped;\x20lo'+'ader\x20not'+_0x1517e1(0x18a),{'openclawVersion':_0x110e6c[_0x1517e1(0x21d)+_0x1517e1(0x323)]});return;}if(!_0x1cc4ce){_0x480c92['runtimeL'+_0x1517e1(0x10a)]?.['warn']?.(_0x1517e1(0x175)+_0x1517e1(0x2e2)+_0x1517e1(0xc3)+'atch\x20ski'+_0x1517e1(0x294)+_0x1517e1(0x243)+_0x1517e1(0x1a8)+_0x1517e1(0x278)+_0x1517e1(0x104),{'openclawVersion':_0x110e6c[_0x1517e1(0x21d)+'Version'],'distDir':_0xb7cd2e});return;}for(const _0x4780a9 of _0x38e762){const _0x3f46a3=await readFile(_0x4780a9,_0x1517e1(0x1ce)),_0x48139d=patchChannelPluginRuntimeFromSource(_0x3f46a3,{'runtimeChannelImportPath':_0x1cc4ce});if(!_0x48139d[_0x1517e1(0x32c)]){if(_0x48139d['reason']===_0x1517e1(0x2ac)+_0x1517e1(0x32c)){_0x480c92[_0x1517e1(0x285)+_0x1517e1(0x10a)]?.[_0x1517e1(0xc9)]?.(_0x1517e1(0x175)+_0x1517e1(0x2e2)+_0x1517e1(0xc3)+_0x1517e1(0x262)+_0x1517e1(0x1af)+_0x1517e1(0xe0),{'openclawVersion':_0x110e6c[_0x1517e1(0x21d)+'Version'],'filePath':_0x4780a9});return;}continue;}await writeFile(_0x4780a9,_0x48139d[_0x1517e1(0x96)],_0x1517e1(0x1ce)),_0x480c92['runtimeL'+_0x1517e1(0x10a)]?.[_0x1517e1(0xc9)]?.(_0x1517e1(0x175)+_0x1517e1(0x2e2)+_0x1517e1(0xc3)+_0x1517e1(0x187)+'lied',{'openclawVersion':_0x110e6c['openclaw'+'Version'],'filePath':_0x4780a9,'note':_0x1517e1(0x30a)+_0x1517e1(0x111)+_0x1517e1(0x2ba)+_0x1517e1(0x140)+_0x1517e1(0x180)+_0x1517e1(0x162)+_0x1517e1(0x15f)+_0x1517e1(0xcc)+_0x1517e1(0x136)+_0x1517e1(0x161)+_0x1517e1(0x32f)+_0x1517e1(0x249)+_0x1517e1(0x2c0)+'rs;\x20veri'+_0x1517e1(0x2bd)+_0x1517e1(0x226)+_0x1517e1(0x10e)+_0x1517e1(0x29e)+_0x1517e1(0x115)});return;}_0x480c92[_0x1517e1(0x285)+'ogger']?.[_0x1517e1(0x1b4)]?.(_0x1517e1(0x175)+_0x1517e1(0x2e2)+'untime\x20p'+'atch\x20ski'+_0x1517e1(0x294)+'ntime\x20re'+_0x1517e1(0x2c7)+_0x1517e1(0x241),{'openclawVersion':_0x110e6c[_0x1517e1(0x21d)+_0x1517e1(0x323)]});}async function patchSessionStoreSqliteRuntime(_0x3857c7,_0x2798ad,_0x7bc3f0={}){const _0x250785=_0x3d918c,_0x3a46b5=resolve(_0x3857c7,_0x2798ad[_0x250785(0x21d)+'WorkingD'+'ir']),_0x4e861b=join(_0x3a46b5,_0x250785(0x315)),_0x116cb5=_0x250785(0x30c)+_0x250785(0x2b9)+_0x250785(0xb2)+'ions/run'+_0x250785(0x194)+'dge.mjs',_0x1996bc=join(_0x3857c7,_0x250785(0x181)+_0x250785(0x25d),_0x250785(0x2f0),_0x250785(0x27c)+_0x250785(0xfb)+'js'),_0x563408=(await readdir(_0x4e861b,{'withFileTypes':!![]})[_0x250785(0x298)](()=>[]))[_0x250785(0x254)](_0x59c8d4=>_0x59c8d4[_0x250785(0x2b7)]()&&_0x59c8d4['name']['startsWi'+'th'](_0x250785(0x295)+_0x250785(0x22c))&&_0x59c8d4[_0x250785(0x22d)][_0x250785(0xac)](_0x250785(0x153)))[_0x250785(0x1f6)](_0x552700=>join(_0x4e861b,_0x552700[_0x250785(0x22d)])),_0x2b3ac8=(await readdir(_0x4e861b,{'withFileTypes':!![]})[_0x250785(0x298)](()=>[]))[_0x250785(0x254)](_0x14d2b5=>_0x14d2b5[_0x250785(0x2b7)]()&&_0x14d2b5[_0x250785(0x22d)][_0x250785(0x1c6)+'th'](_0x250785(0x103))&&!_0x14d2b5[_0x250785(0x22d)][_0x250785(0x1c6)+'th']('store-lo'+_0x250785(0x22c))&&_0x14d2b5[_0x250785(0x22d)][_0x250785(0xac)](_0x250785(0x153)))['map'](_0x486786=>join(_0x4e861b,_0x486786[_0x250785(0x22d)]));if(!existsSync(_0x1996bc)){_0x7bc3f0[_0x250785(0x285)+'ogger']?.[_0x250785(0xc9)]?.('session\x20'+'store\x20sq'+'lite\x20pat'+'ch\x20skipp'+_0x250785(0x172)+'ge\x20not\x20a'+'vailable',{'bridgePath':_0x1996bc,'openclawVersion':_0x2798ad[_0x250785(0x21d)+_0x250785(0x323)]});return;}for(const _0x2c3c30 of _0x563408){const _0x47c9bf=await readFile(_0x2c3c30,_0x250785(0x1ce)),_0x3d5aa0=patchSessionStoreLoadFromSource(_0x47c9bf,{'bridgeImportPath':_0x116cb5});if(!_0x3d5aa0['patched']){if(_0x3d5aa0[_0x250785(0x2f3)]==='already-'+_0x250785(0x32c)){_0x7bc3f0[_0x250785(0x285)+_0x250785(0x10a)]?.[_0x250785(0xc9)]?.(_0x250785(0x147)+'store\x20lo'+_0x250785(0x24c)+_0x250785(0x9d)+_0x250785(0x1d5),{'filePath':_0x2c3c30,'openclawVersion':_0x2798ad['openclaw'+'Version']});break;}continue;}await writeFile(_0x2c3c30,_0x3d5aa0[_0x250785(0x96)],_0x250785(0x1ce)),_0x7bc3f0[_0x250785(0x285)+'ogger']?.['info']?.(_0x250785(0x147)+_0x250785(0x321)+'ad\x20patch'+_0x250785(0x1d5),{'filePath':_0x2c3c30,'openclawVersion':_0x2798ad[_0x250785(0x21d)+_0x250785(0x323)]});break;}for(const _0x293c6b of _0x2b3ac8){const _0xbb6878=await readFile(_0x293c6b,_0x250785(0x1ce)),_0x502d42=patchSessionStoreWriteFromSource(_0xbb6878,{'bridgeImportPath':_0x116cb5});if(!_0x502d42[_0x250785(0x32c)]){if(_0x502d42[_0x250785(0x2f3)]===_0x250785(0x2ac)+'patched'){_0x7bc3f0[_0x250785(0x285)+_0x250785(0x10a)]?.[_0x250785(0xc9)]?.(_0x250785(0x147)+_0x250785(0x2d7)+_0x250785(0x1c9)+_0x250785(0x330)+_0x250785(0x272)+'d',{'filePath':_0x293c6b,'openclawVersion':_0x2798ad[_0x250785(0x21d)+_0x250785(0x323)]});break;}continue;}await writeFile(_0x293c6b,_0x502d42[_0x250785(0x96)],_0x250785(0x1ce)),_0x7bc3f0[_0x250785(0x285)+_0x250785(0x10a)]?.[_0x250785(0xc9)]?.(_0x250785(0x147)+_0x250785(0x2d7)+_0x250785(0x1c9)+_0x250785(0x21b)+'d',{'filePath':_0x293c6b,'openclawVersion':_0x2798ad[_0x250785(0x21d)+_0x250785(0x323)]});break;}}async function patchWeixinOutboundSessionRoute(_0x393b6,_0xda1a75,_0x2944d0={}){const _0x3d77d5=_0x3d918c,_0x316dbf=join(_0x393b6,_0x3d77d5(0x21d),_0x3d77d5(0x315),_0x3d77d5(0xe1)+'ns',_0x3d77d5(0x21d)+_0x3d77d5(0x164),_0x3d77d5(0x315),_0x3d77d5(0xb6),_0x3d77d5(0xbd)+'js');if(!existsSync(_0x316dbf)){_0x2944d0[_0x3d77d5(0x285)+_0x3d77d5(0x10a)]?.[_0x3d77d5(0xc9)]?.(_0x3d77d5(0xfa)+_0x3d77d5(0x2a4)+'session\x20'+'route\x20pa'+'tch\x20skip'+'ped;\x20plu'+_0x3d77d5(0x188)+'installe'+'d',{'openclawVersion':_0xda1a75[_0x3d77d5(0x21d)+_0x3d77d5(0x323)],'filePath':_0x316dbf});return;}const _0x46de1b=await readFile(_0x316dbf,'utf8'),_0x3f4c4a=patchWeixinOutboundSessionRouteFromSource(_0x46de1b);if(!_0x3f4c4a[_0x3d77d5(0x32c)]){if(_0x3f4c4a[_0x3d77d5(0x2f3)]===_0x3d77d5(0x2ac)+_0x3d77d5(0x32c)){_0x2944d0['runtimeL'+_0x3d77d5(0x10a)]?.['info']?.(_0x3d77d5(0xfa)+'utbound\x20'+_0x3d77d5(0x147)+_0x3d77d5(0x173)+_0x3d77d5(0x2b6)+_0x3d77d5(0x21e)+_0x3d77d5(0x26f),{'openclawVersion':_0xda1a75[_0x3d77d5(0x21d)+_0x3d77d5(0x323)],'filePath':_0x316dbf});return;}_0x2944d0[_0x3d77d5(0x285)+_0x3d77d5(0x10a)]?.[_0x3d77d5(0x1b4)]?.(_0x3d77d5(0xfa)+_0x3d77d5(0x2a4)+_0x3d77d5(0x147)+_0x3d77d5(0x173)+_0x3d77d5(0x170)+_0x3d77d5(0x25f)+_0x3d77d5(0xce)+_0x3d77d5(0x216)+'ound',{'openclawVersion':_0xda1a75[_0x3d77d5(0x21d)+_0x3d77d5(0x323)],'filePath':_0x316dbf,'reason':_0x3f4c4a[_0x3d77d5(0x2f3)]});return;}await writeFile(_0x316dbf,_0x3f4c4a[_0x3d77d5(0x96)],_0x3d77d5(0x1ce)),_0x2944d0['runtimeL'+_0x3d77d5(0x10a)]?.[_0x3d77d5(0xc9)]?.(_0x3d77d5(0xfa)+_0x3d77d5(0x2a4)+_0x3d77d5(0x147)+_0x3d77d5(0x173)+'tch\x20appl'+'ied',{'openclawVersion':_0xda1a75[_0x3d77d5(0x21d)+_0x3d77d5(0x323)],'filePath':_0x316dbf,'note':_0x3d77d5(0x30a)+_0x3d77d5(0x111)+'ibility\x20'+_0x3d77d5(0x140)+'r\x20@tence'+_0x3d77d5(0x1fa)+_0x3d77d5(0x286)+_0x3d77d5(0x197)+_0x3d77d5(0x28c)+_0x3d77d5(0x2d1)+_0x3d77d5(0x138)+_0x3d77d5(0xd2)+'g\x20indexe'+_0x3d77d5(0x26b)+_0x3d77d5(0xf1)+_0x3d77d5(0x336)+_0x3d77d5(0x137)+_0x3d77d5(0x1e0)+_0x3d77d5(0x12e)+_0x3d77d5(0x107)+'des.'});}async function patchWeixinOutboundFallbackRuntime(_0x2e8c2a,_0x29c9b1,_0x141c1d={}){const _0x2df960=_0x3d918c,_0x39fda4=resolve(_0x2e8c2a,_0x29c9b1[_0x2df960(0x21d)+_0x2df960(0x1a6)+'ir']),_0x1d34da=join(_0x39fda4,_0x2df960(0x315)),_0x45506d=(await readdir(_0x1d34da,{'withFileTypes':!![]})[_0x2df960(0x298)](()=>[]))[_0x2df960(0x254)](_0x53b8d9=>_0x53b8d9['isFile']()&&_0x53b8d9[_0x2df960(0x22d)]['startsWi'+'th'](_0x2df960(0x116)+'-session'+'-')&&_0x53b8d9[_0x2df960(0x22d)][_0x2df960(0xac)](_0x2df960(0x153)))['map'](_0x4a1f82=>join(_0x1d34da,_0x4a1f82[_0x2df960(0x22d)]));if(_0x45506d[_0x2df960(0xde)]===0x0){_0x141c1d[_0x2df960(0x285)+'ogger']?.[_0x2df960(0x1b4)]?.(_0x2df960(0xfa)+_0x2df960(0x2a4)+'fallback'+'\x20patch\x20s'+_0x2df960(0x131)+'outbound'+_0x2df960(0x1ab)+_0x2df960(0xc7)+'nd',{'openclawVersion':_0x29c9b1[_0x2df960(0x21d)+_0x2df960(0x323)],'distDir':_0x1d34da});return;}for(const _0x9e872 of _0x45506d){const _0x236b65=await readFile(_0x9e872,'utf8'),_0x493320=patchWeixinOutboundFallbackFromSource(_0x236b65);if(!_0x493320[_0x2df960(0x32c)]){if(_0x493320['reason']==='already-'+_0x2df960(0x32c)){_0x141c1d[_0x2df960(0x285)+'ogger']?.['info']?.(_0x2df960(0xfa)+_0x2df960(0x2a4)+_0x2df960(0x10f)+_0x2df960(0x215)+_0x2df960(0x133)+_0x2df960(0x2cc),{'openclawVersion':_0x29c9b1[_0x2df960(0x21d)+_0x2df960(0x323)],'filePath':_0x9e872});return;}continue;}await writeFile(_0x9e872,_0x493320[_0x2df960(0x96)],_0x2df960(0x1ce)),_0x141c1d[_0x2df960(0x285)+_0x2df960(0x10a)]?.[_0x2df960(0xc9)]?.(_0x2df960(0xfa)+_0x2df960(0x2a4)+'fallback'+_0x2df960(0x215)+_0x2df960(0x2cc),{'openclawVersion':_0x29c9b1[_0x2df960(0x21d)+'Version'],'filePath':_0x9e872,'note':_0x2df960(0x30a)+_0x2df960(0x111)+_0x2df960(0x2ba)+_0x2df960(0x140)+_0x2df960(0x2a1)+_0x2df960(0x193)+_0x2df960(0x237)+'m.wechat'+_0x2df960(0xc4)+_0x2df960(0x25c)+_0x2df960(0x287)+_0x2df960(0x303)+_0x2df960(0x128)+_0x2df960(0x1dd)+_0x2df960(0xa8)+'\x20is\x20unav'+_0x2df960(0x14e)});return;}_0x141c1d[_0x2df960(0x285)+_0x2df960(0x10a)]?.[_0x2df960(0x1b4)]?.(_0x2df960(0xfa)+_0x2df960(0x2a4)+'fallback'+'\x20patch\x20s'+_0x2df960(0x131)+_0x2df960(0x1e6)+_0x2df960(0x20b)+_0x2df960(0x241),{'openclawVersion':_0x29c9b1[_0x2df960(0x21d)+_0x2df960(0x323)]});}async function patchRequestIdTitleRuntime(_0x48a257,_0x43323f,_0x2bd473={}){const _0x4d222a=_0x3d918c,_0x3add64=resolve(_0x48a257,_0x43323f[_0x4d222a(0x21d)+_0x4d222a(0x1a6)+'ir']),_0x59c40a=join(_0x3add64,_0x4d222a(0x315)),_0x520d58=_0x4d222a(0x30c)+'ell-runt'+_0x4d222a(0x165)+'est-id/r'+'untime-b'+'ridge.mj'+'s',_0x3c81b0=join(_0x48a257,'shell-ru'+_0x4d222a(0x25d),_0x4d222a(0x2d3)+'id',_0x4d222a(0x27c)+_0x4d222a(0xfb)+'js');if(!existsSync(_0x3c81b0)){_0x2bd473[_0x4d222a(0x285)+_0x4d222a(0x10a)]?.[_0x4d222a(0xc9)]?.(_0x4d222a(0x2d3)+_0x4d222a(0x279)+_0x4d222a(0x1ab)+_0x4d222a(0xb0)+_0x4d222a(0x131)+_0x4d222a(0x21a)+'ot\x20avail'+_0x4d222a(0x320),{'bridgePath':_0x3c81b0,'openclawVersion':_0x43323f[_0x4d222a(0x21d)+'Version']});return;}const _0x217210=(await readdir(_0x59c40a,{'withFileTypes':!![]})[_0x4d222a(0x298)](()=>[]))['filter'](_0x23b80c=>_0x23b80c[_0x4d222a(0x2b7)]()&&_0x23b80c[_0x4d222a(0x22d)][_0x4d222a(0x1c6)+'th'](_0x4d222a(0x9b))&&_0x23b80c['name'][_0x4d222a(0xac)](_0x4d222a(0x153)))[_0x4d222a(0x1f6)](_0x3985f7=>join(_0x59c40a,_0x3985f7[_0x4d222a(0x22d)]));for(const _0x2c3640 of _0x217210){const _0x7d5be8=await readFile(_0x2c3640,_0x4d222a(0x1ce)),_0x29cbe6=patchRequestIdTitleRuntimeFromSource(_0x7d5be8,{'bridgeImportPath':_0x520d58});if(!_0x29cbe6[_0x4d222a(0x32c)]){if(_0x29cbe6[_0x4d222a(0x2f3)]==='already-'+'patched'){_0x2bd473[_0x4d222a(0x285)+_0x4d222a(0x10a)]?.[_0x4d222a(0xc9)]?.(_0x4d222a(0x2d3)+_0x4d222a(0x279)+_0x4d222a(0x1ab)+'\x20patch\x20a'+_0x4d222a(0x133)+_0x4d222a(0x2cc),{'filePath':_0x2c3640,'openclawVersion':_0x43323f[_0x4d222a(0x21d)+'Version']});break;}continue;}await writeFile(_0x2c3640,_0x29cbe6['source'],_0x4d222a(0x1ce)),_0x2bd473['runtimeL'+_0x4d222a(0x10a)]?.[_0x4d222a(0xc9)]?.('request-'+_0x4d222a(0x279)+_0x4d222a(0x1ab)+_0x4d222a(0x215)+_0x4d222a(0x2cc),{'filePath':_0x2c3640,'openclawVersion':_0x43323f['openclaw'+_0x4d222a(0x323)]});break;}}async function patchQQBotOutboundFallbackRuntime(_0x14fe2e,_0x2020d4,_0x5ca1b8={}){const _0x123792=_0x3d918c,_0xd13fad=resolve(_0x14fe2e,_0x2020d4[_0x123792(0x21d)+'WorkingD'+'ir']),_0x58256d=join(_0xd13fad,_0x123792(0x315)),_0x1f9db1=(await readdir(_0x58256d,{'withFileTypes':!![]})[_0x123792(0x298)](()=>[]))[_0x123792(0x254)](_0x4dc779=>_0x4dc779[_0x123792(0x2b7)]()&&_0x4dc779[_0x123792(0x22d)]['startsWi'+'th'](_0x123792(0x116)+_0x123792(0x177)+'-')&&_0x4dc779[_0x123792(0x22d)]['endsWith'](_0x123792(0x153)))[_0x123792(0x1f6)](_0x24ba63=>join(_0x58256d,_0x24ba63[_0x123792(0x22d)]));if(_0x1f9db1['length']===0x0){_0x5ca1b8[_0x123792(0x285)+_0x123792(0x10a)]?.['warn']?.('qqbot\x20ou'+_0x123792(0xeb)+_0x123792(0x1c7)+_0x123792(0x326)+_0x123792(0xa6)+_0x123792(0x2a4)+_0x123792(0x1eb)+_0x123792(0x127)+'d',{'openclawVersion':_0x2020d4[_0x123792(0x21d)+_0x123792(0x323)],'distDir':_0x58256d});return;}for(const _0x275374 of _0x1f9db1){const _0x2b642c=await readFile(_0x275374,'utf8'),_0x35adfd=patchQQBotOutboundFallbackFromSource(_0x2b642c);if(!_0x35adfd[_0x123792(0x32c)]){if(_0x35adfd[_0x123792(0x2f3)]===_0x123792(0x2ac)+'patched'){_0x5ca1b8[_0x123792(0x285)+_0x123792(0x10a)]?.[_0x123792(0xc9)]?.(_0x123792(0x246)+_0x123792(0xeb)+'allback\x20'+_0x123792(0x119)+'ready\x20ap'+'plied',{'openclawVersion':_0x2020d4['openclaw'+_0x123792(0x323)],'filePath':_0x275374});return;}continue;}await writeFile(_0x275374,_0x35adfd[_0x123792(0x96)],_0x123792(0x1ce)),_0x5ca1b8['runtimeL'+'ogger']?.[_0x123792(0xc9)]?.(_0x123792(0x246)+_0x123792(0xeb)+_0x123792(0x1c7)+'patch\x20ap'+_0x123792(0x255),{'openclawVersion':_0x2020d4[_0x123792(0x21d)+_0x123792(0x323)],'filePath':_0x275374,'note':_0x123792(0x30a)+_0x123792(0x111)+'ibility\x20'+'patch\x20fo'+_0x123792(0x2fa)+_0x123792(0x1b9)+_0x123792(0x116)+_0x123792(0x250)+_0x123792(0xba)+_0x123792(0x2ce)+_0x123792(0x1f8)+_0x123792(0x1e9)+_0x123792(0x106)+_0x123792(0x308)+_0x123792(0x21c)});return;}_0x5ca1b8[_0x123792(0x285)+_0x123792(0x10a)]?.[_0x123792(0x1b4)]?.('qqbot\x20ou'+'tbound\x20f'+_0x123792(0x1c7)+_0x123792(0x326)+_0x123792(0x267)+'esolver\x20'+_0x123792(0xb1)+_0x123792(0x1a3),{'openclawVersion':_0x2020d4[_0x123792(0x21d)+_0x123792(0x323)]});}async function patchQQBotOutboundSessionRoute(_0x4be5e0,_0x4a4127,_0x31ff6a={}){const _0x3cc489=_0x3d918c,_0x1fd741=join(_0x4be5e0,'openclaw',_0x3cc489(0x315),'extensio'+'ns','qqbot',_0x3cc489(0x315));if(!existsSync(_0x1fd741)){_0x31ff6a['runtimeL'+_0x3cc489(0x10a)]?.[_0x3cc489(0xc9)]?.(_0x3cc489(0x246)+_0x3cc489(0xee)+_0x3cc489(0x150)+'oute\x20pat'+_0x3cc489(0x29b)+_0x3cc489(0x11d)+_0x3cc489(0x160)+'nstalled',{'openclawVersion':_0x4a4127[_0x3cc489(0x21d)+_0x3cc489(0x323)],'distDir':_0x1fd741});return;}const _0x511ad6=(await readdir(_0x1fd741,{'withFileTypes':!![]})[_0x3cc489(0x298)](()=>[]))[_0x3cc489(0x254)](_0x4dde76=>_0x4dde76[_0x3cc489(0x2b7)]()&&_0x4dde76[_0x3cc489(0x22d)]['endsWith'](_0x3cc489(0x153)))[_0x3cc489(0x1f6)](_0x5443ae=>join(_0x1fd741,_0x5443ae[_0x3cc489(0x22d)]));for(const _0x1f6b64 of _0x511ad6){const _0x41dcda=await readFile(_0x1f6b64,'utf8'),_0x78cc30=patchQQBotOutboundSessionRouteFromSource(_0x41dcda);if(!_0x78cc30[_0x3cc489(0x32c)]){if(_0x78cc30[_0x3cc489(0x2f3)]==='already-'+'patched'){_0x31ff6a[_0x3cc489(0x285)+_0x3cc489(0x10a)]?.[_0x3cc489(0xc9)]?.('qqbot\x20ou'+_0x3cc489(0xee)+_0x3cc489(0x150)+_0x3cc489(0x31b)+_0x3cc489(0xa7)+_0x3cc489(0x31f)+'ed',{'openclawVersion':_0x4a4127[_0x3cc489(0x21d)+_0x3cc489(0x323)],'filePath':_0x1f6b64});return;}continue;}await writeFile(_0x1f6b64,_0x78cc30[_0x3cc489(0x96)],_0x3cc489(0x1ce)),_0x31ff6a['runtimeL'+_0x3cc489(0x10a)]?.['info']?.(_0x3cc489(0x246)+_0x3cc489(0xee)+_0x3cc489(0x150)+'oute\x20pat'+_0x3cc489(0x2da)+'ed',{'openclawVersion':_0x4a4127[_0x3cc489(0x21d)+_0x3cc489(0x323)],'filePath':_0x1f6b64,'note':_0x3cc489(0x30a)+_0x3cc489(0x111)+'ibility\x20'+_0x3cc489(0x140)+_0x3cc489(0x2db)+_0x3cc489(0x14d)+'t\x20c2c\x20ou'+'tbound\x20d'+_0x3cc489(0xf8)+_0x3cc489(0x331)+'being\x20in'+_0x3cc489(0xdd)+_0x3cc489(0x277)+_0x3cc489(0x28f)+'rect\x20pee'+_0x3cc489(0x25b)});return;}_0x31ff6a[_0x3cc489(0x285)+_0x3cc489(0x10a)]?.[_0x3cc489(0x1b4)]?.(_0x3cc489(0x246)+'tbound\x20s'+_0x3cc489(0x150)+_0x3cc489(0x31b)+_0x3cc489(0x29b)+_0x3cc489(0x2af)+_0x3cc489(0x18c)+_0x3cc489(0x2c1)+_0x3cc489(0x201),{'openclawVersion':_0x4a4127[_0x3cc489(0x21d)+_0x3cc489(0x323)],'distDir':_0x1fd741});}async function resolveRuntimeChannelImportPath(_0x33c481,_0x46ab94){const _0x1d4d38=_0x3d918c,_0x2f3090=_0x46ab94[_0x1d4d38(0x254)](_0x42faa3=>_0x42faa3[_0x1d4d38(0x2b7)]()&&_0x42faa3[_0x1d4d38(0x22d)][_0x1d4d38(0x1c6)+'th'](_0x1d4d38(0x27c)+_0x1d4d38(0x247))&&_0x42faa3[_0x1d4d38(0x22d)][_0x1d4d38(0xac)](_0x1d4d38(0x153))&&!_0x42faa3[_0x1d4d38(0x22d)]['startsWi'+'th'](_0x1d4d38(0x27c)+_0x1d4d38(0x247)+_0x1d4d38(0x270)))[_0x1d4d38(0x1f6)](_0x3defb2=>_0x3defb2['name'])[_0x1d4d38(0x20a)]();for(const _0x52673c of _0x2f3090){const _0x49794e=await readFile(join(_0x33c481,_0x52673c),_0x1d4d38(0x1ce));if(_0x49794e[_0x1d4d38(0x281)](_0x1d4d38(0x1d8)+_0x1d4d38(0xa2)+_0x1d4d38(0x213)))return'./'+_0x52673c;}return null;}function normalizeRuntimeRelativePath(_0x2841b9){return _0x2841b9['replaceA'+'ll']('\x5c','/');}function toWindowsPath(_0x54b57f){const _0x509e26=_0x3d918c;return _0x54b57f[_0x509e26(0x19f)+'ll']('/','\x5c');}function validateRuntimeNodeVersion(_0x650858,_0x1a2732){const _0x19a33d=_0x3d918c;if(_0x650858[_0x19a33d(0x232)+'ion']===_0x1a2732[_0x19a33d(0x21d)][_0x19a33d(0x232)+_0x19a33d(0x156)])return;throw new Error(_0x19a33d(0x1eb)+_0x19a33d(0x232)+_0x19a33d(0x273)+_0x19a33d(0x1c1)+_0x19a33d(0x1ef)+(_0x650858[_0x19a33d(0x232)+_0x19a33d(0x156)]||'unknown')+(_0x19a33d(0x252)+'config=')+_0x1a2732[_0x19a33d(0x21d)][_0x19a33d(0x232)+_0x19a33d(0x156)]+'.\x20'+(_0x19a33d(0xd9)+_0x19a33d(0xc8)+_0x19a33d(0x191)+_0x19a33d(0x26a)+_0x19a33d(0xb4)+_0x19a33d(0x1ab)+_0x19a33d(0x2bc)+_0x19a33d(0x2e4)+_0x19a33d(0x275)+_0x19a33d(0x316)+_0x19a33d(0x24f)+_0x19a33d(0x19a)+'.'));}function validateRuntimeOpenClawVersion(_0x2ab26f,_0x5b41c2){const _0x5f5d24=_0x3d918c;if(_0x2ab26f[_0x5f5d24(0x21d)+_0x5f5d24(0x323)]===_0x5b41c2['openclaw'][_0x5f5d24(0x21d)+_0x5f5d24(0x323)])return;throw new Error(_0x5f5d24(0x1eb)+'openclaw'+_0x5f5d24(0xcb)+_0x5f5d24(0x171)+_0x5f5d24(0x1ac)+_0x5f5d24(0x13d)+(_0x2ab26f[_0x5f5d24(0x21d)+_0x5f5d24(0x323)]||_0x5f5d24(0xa5))+(_0x5f5d24(0x252)+_0x5f5d24(0x1e3))+_0x5b41c2[_0x5f5d24(0x21d)][_0x5f5d24(0x21d)+_0x5f5d24(0x323)]+'.\x20'+(_0x5f5d24(0xd9)+_0x5f5d24(0xc8)+'\x20prepare'+'\x22\x20so\x20the'+'\x20runtime'+_0x5f5d24(0x1fd)+'tall\x20the'+'\x20configu'+_0x5f5d24(0x222)+_0x5f5d24(0x2ec)+_0x5f5d24(0x2be)));}function parseNpmPackJson(_0x4ae1cb){const _0x53f580=_0x3d918c,_0x5311c4=_0x4ae1cb[_0x53f580(0x2f9)](),_0x532a67=_0x5311c4[_0x53f580(0x163)]('[');if(_0x532a67<0x0)throw new Error(_0x53f580(0xa4)+_0x53f580(0x234)+'\x20return\x20'+_0x53f580(0x1e1)+_0x5311c4[_0x53f580(0x1a5)](0x0,0x1f4));const _0x19a190=JSON[_0x53f580(0x276)](_0x5311c4[_0x53f580(0x1a5)](_0x532a67)),_0x4f2f70=Array[_0x53f580(0x233)](_0x19a190)?_0x19a190[0x0]:_0x19a190;if(!_0x4f2f70||typeof _0x4f2f70!==_0x53f580(0x112))throw new Error(_0x53f580(0xa4)+_0x53f580(0x239)+_0x53f580(0xdf)+_0x53f580(0xf9)+_0x53f580(0x319)+_0x5311c4[_0x53f580(0x1a5)](0x0,0x1f4));return _0x4f2f70;}function normalizePackedTarballFilename(_0xece905){const _0x55c2e1=_0x3d918c;return _0xece905[_0x55c2e1(0x1d7)](/^@/,'')['replaceA'+'ll']('/','-')[_0x55c2e1(0x19f)+'ll']('\x5c','-');}async function runProcess(_0x2cf4f9,_0x460747,_0x7ede80={}){const _0x381122=_0x3d918c,_0x1a0a6a=_0x7ede80[_0x381122(0x240)]||[_0x2cf4f9,..._0x460747]['join']('\x20'),_0x164ff0=_0x7ede80['timeoutM'+'s']??NPM_INSTALL_TIMEOUT_MS,_0x2864d1=spawn(_0x2cf4f9,_0x460747,{'cwd':_0x7ede80[_0x381122(0x25a)],'env':_0x7ede80[_0x381122(0x95)],'stdio':[_0x381122(0x2b0),'pipe','pipe']});return await new Promise((_0xc8c53f,_0x741598)=>{const _0x1b7163=_0x381122;let _0x18edbc='',_0x43c5a4='',_0x59a167=![];const _0x599f23=setTimeout(()=>{const _0x978511=_0x1d92;if(_0x59a167)return;_0x59a167=!![],_0x2864d1['kill'](_0x978511(0x1d0)),_0x741598(new Error(_0x1a0a6a+(_0x978511(0x253)+_0x978511(0x18e)+'\x20')+_0x164ff0+'ms'));},_0x164ff0);_0x2864d1[_0x1b7163(0xfd)]['on']('data',_0x43504d=>{const _0x490f57=_0x1b7163;_0x18edbc+=_0x43504d[_0x490f57(0x174)]();}),_0x2864d1[_0x1b7163(0x2c5)]['on'](_0x1b7163(0x2d8),_0x5a4005=>{const _0x383c01=_0x1b7163;_0x43c5a4+=_0x5a4005[_0x383c01(0x174)]();}),_0x2864d1['on'](_0x1b7163(0x2aa),_0x2462f8=>{if(_0x59a167)return;_0x59a167=!![],clearTimeout(_0x599f23),_0x741598(_0x2462f8);}),_0x2864d1['on'](_0x1b7163(0x309),(_0xd42766,_0x48792f)=>{const _0x5745ff=_0x1b7163;if(_0x59a167)return;_0x59a167=!![],clearTimeout(_0x599f23);if(_0xd42766===0x0){_0xc8c53f({'stdout':_0x18edbc,'stderr':_0x43c5a4});return;}_0x741598(new Error(_0x1a0a6a+(_0x5745ff(0xc2)+_0x5745ff(0x121)+'e=')+(_0xd42766??'null')+_0x5745ff(0x1ba)+(_0x48792f??_0x5745ff(0x15b))+'\x0a'+(''+(_0x43c5a4||_0x18edbc))[_0x5745ff(0x2f9)]()));});});}async function installOpenClawPackage(_0x2bde9e,_0x3c4990){const _0x286cc4=_0x3d918c,_0x2dc38c=join(_0x2bde9e[_0x286cc4(0x207)+_0x286cc4(0x302)],'.cache'),_0x378a4b=join(_0x2bde9e['runtimeR'+_0x286cc4(0x302)],'.opencla'+_0x286cc4(0x258)+'t');await mkdir(_0x2dc38c,{'recursive':!![]}),await removePathWithRetries(_0x378a4b),await mkdir(_0x378a4b,{'recursive':!![]});const _0x50b9f2=await createRuntimeEnv(_0x2bde9e),_0x59e34c='openclaw'+'@'+_0x3c4990;console['log'](_0x286cc4(0xbc)+'hell:run'+'time]\x20in'+_0x286cc4(0x1d3)+'\x20'+_0x59e34c);const _0x4e031f=await runProcess(_0x2bde9e[_0x286cc4(0x334)+_0x286cc4(0x219)],[_0x2bde9e[_0x286cc4(0x1e5)],'pack',_0x59e34c,_0x286cc4(0x22a)],{'cwd':_0x2dc38c,'env':_0x50b9f2,'label':'npm\x20pack'+'\x20'+_0x59e34c}),_0xf058fb=parseNpmPackJson(_0x4e031f[_0x286cc4(0xfd)]);if(_0xf058fb['version']!==_0x3c4990)throw new Error(_0x286cc4(0x296)+_0x286cc4(0x196)+_0x286cc4(0xfe)+_0x3c4990+(_0x286cc4(0x236)+_0x286cc4(0x1f7))+_0xf058fb[_0x286cc4(0xae)]);const _0x2a7cbd=resolve(_0x2dc38c,_0xf058fb[_0x286cc4(0xe9)]);if(!existsSync(_0x2a7cbd))throw new Error('npm\x20pack'+'\x20did\x20not'+_0x286cc4(0x152)+_0x286cc4(0x32e)+'\x20'+_0x2a7cbd);await runProcess(_0x286cc4(0x151),[_0x286cc4(0xea),_0x2a7cbd,'-C',_0x378a4b],{'label':'extract\x20'+_0xf058fb[_0x286cc4(0xe9)]}),await removePathWithRetries(_0x2bde9e[_0x286cc4(0x21d)+_0x286cc4(0x1a6)+'ir']),await rename(join(_0x378a4b,'package'),_0x2bde9e[_0x286cc4(0x21d)+_0x286cc4(0x1a6)+'ir']),await removePathWithRetries(_0x378a4b),await runProcess(_0x2bde9e[_0x286cc4(0x334)+_0x286cc4(0x219)],[_0x2bde9e['npmCli'],_0x286cc4(0x312),_0x286cc4(0x2dc)+'ev','--omit=p'+_0x286cc4(0xc1),_0x286cc4(0x261)+'it',_0x286cc4(0x144)+'d',_0x286cc4(0x108)+_0x286cc4(0x2f5)+'ps'],{'cwd':_0x2bde9e[_0x286cc4(0x21d)+_0x286cc4(0x1a6)+'ir'],'env':_0x50b9f2,'label':'npm\x20inst'+_0x286cc4(0x328)+_0x59e34c+(_0x286cc4(0x1ab)+_0x286cc4(0x2cf)+_0x286cc4(0x264))});if(!existsSync(_0x2bde9e['openclaw'+_0x286cc4(0x2d5)]))throw new Error('OpenClaw'+_0x286cc4(0x12f)+_0x286cc4(0xc7)+_0x286cc4(0x1fc)+'\x20install'+':\x20'+_0x2bde9e['openclaw'+_0x286cc4(0x2d5)]);}async function ensureRuntimeBase(_0x28e03f,_0x5275a6,_0x156cbd={}){const _0x27129a=_0x3d918c;await mkdir(_0x5275a6,{'recursive':!![]});let _0x4a2b63=await readRuntimeManifest(_0x5275a6);const _0x48494a=_0x28e03f['openclaw'][_0x27129a(0x232)+'ion'],_0x276d29=_0x28e03f['openclaw']['openclaw'+_0x27129a(0x323)],_0x5e0628=existsSync(resolveManifestPath(_0x5275a6)),_0x449392=runtimeHasRequiredPaths(_0x5275a6,_0x4a2b63),_0x2ad4b6=_0x4a2b63[_0x27129a(0x232)+_0x27129a(0x156)]===_0x48494a;!_0x5e0628||!_0x449392||!_0x2ad4b6?(_0x156cbd['runtimeL'+_0x27129a(0x10a)]?.[_0x27129a(0x143)+'t']?.(_0x27129a(0x1eb)+_0x27129a(0x185)+_0x27129a(0x1f4)+'ed',{'runtimeRoot':_0x5275a6,'reason':!_0x5e0628?_0x27129a(0x1d1)+_0x27129a(0x209):!_0x449392?_0x27129a(0x1d1)+_0x27129a(0x130)+_0x27129a(0x1ab)+_0x27129a(0xd7):_0x27129a(0x10d)+_0x27129a(0x2e5)+_0x27129a(0x1c0),'syncOnly':_0x156cbd[_0x27129a(0x184)]}),_0x4a2b63=await buildRuntimeBase(_0x28e03f,_0x5275a6,_0x4a2b63),_0x156cbd['runtimeL'+_0x27129a(0x10a)]?.[_0x27129a(0x143)+'t']?.(_0x27129a(0x1eb)+'base\x20bui'+_0x27129a(0x19d)+'eted',{'manifest':summarizeRuntimeManifest(_0x4a2b63)})):_0x156cbd[_0x27129a(0x285)+_0x27129a(0x10a)]?.['importan'+'t']?.(_0x27129a(0x1eb)+_0x27129a(0x327)+_0x27129a(0x26c)+_0x27129a(0x192),{'manifest':summarizeRuntimeManifest(_0x4a2b63)});if(!existsSync(resolve(_0x5275a6,_0x4a2b63[_0x27129a(0x21d)+_0x27129a(0x2d5)]))){const _0x35f228=createRuntimeInfoFromManifest(_0x5275a6,_0x4a2b63,{'allowMissingOpenClaw':!![]});await installOpenClawPackage(_0x35f228,_0x276d29),_0x4a2b63[_0x27129a(0x21d)+'Version']=_0x276d29;}return _0x4a2b63;}function runtimeHasRequiredPaths(_0x17f4c2,_0x1efaa6){const _0x5823cd=_0x3d918c;return[_0x5823cd(0x334)+_0x5823cd(0x219),_0x5823cd(0x1e5),_0x5823cd(0x21d)+_0x5823cd(0x1a6)+'ir','openclaw'+_0x5823cd(0x2d5)][_0x5823cd(0x30f)](_0x53b0d8=>typeof _0x1efaa6[_0x53b0d8]==='string'&&_0x1efaa6[_0x53b0d8]['trim']())&&[_0x5823cd(0x334)+_0x5823cd(0x219),_0x5823cd(0x1e5)][_0x5823cd(0x30f)](_0x2038e7=>existsSync(resolve(_0x17f4c2,_0x1efaa6[_0x2038e7])));}function _0x4fd9(){const _0xf60fa=['json','ion','arm64','node/bin','\x20\x22OPENCL','synced','null','-id\x20head','log','ile\x20not\x20','6.6\x20chan','in\x20not\x20i','me\x20missi','aw\x202026.','indexOf','-weixin','ime/requ','tests','untime\x20r','tory\x20pro','ipped;\x20f','ready\x20ap','cal\x20runt','\x20path\x20mu','%~dp0\x22','npm-cach','cope\x20syn','tch\x20skip','mismatch','ed;\x20brid','route\x20pa','toString','channel\x20','dependen','-session','href','led','test','appId','doc','npm','_DIR%','LiteralP','r\x20OpenCl','shell-ru','in\x20','docs','syncOnly','base\x20bui','nodejs.o','atch\x20app','gin\x20not\x20','prepare\x20','\x20found','x64','nel\x20shap','index.mj','ut\x20after','.markdow','set\x20\x22OPE','\x20prepare','rent','enclaw-w','time-bri','location','ed\x20OpenC','aw-weixi','node/lib','ies','\x20version','find','?t=','ld\x20compl','-NoProfi','replaceA','\x20doctor\x20','AW_CONFI','node.exe','t\x20found','platform','slice','WorkingD','headers','annel\x20en','tools\x20sy','local\x20pl','\x20runtime',':\x20manife','pendenci','/node_mo','eady\x20app','@echo\x20of','er\x20writt','ache\x20bef','6969655omxvOI','warn','roductRu','.md','_NAME:-','kill\x20not','Bot\x20c2c\x20','\x20signal=','1\x20]\x20&&\x20[','.d.ts','pruned\x20r','nPath\x20$e','root','match','atch:\x20ma','lugin\x20','=\x22${OPEN','-xJf','product','startsWi','allback\x20','fix','ite\x20patc','https://','jection\x20','agent','aging','utf8','\x22\x20\x22%SCRI','SIGTERM','missing\x20','\x20written','stalling','e.exe','\x20applied','2604nLctCN','replace','createRu','referenc','NCLAW_ST','ntPaths','JIE_NO_L','n\x20plugin','lugins\x20s','.tools','ream\x20fix','JSON:\x20','examples','config=','und:\x20','npmCli','resolver','IPT_DIR=','leted','out\x20c2c\x20','fix\x20comp','runtime\x20','25663320uHQvSK','skills','package.','nifest=','ed-tool\x20','ent','configPa','\x20and\x20','ld\x20start','wujiecla','map','d\x20to\x20','ons\x20with','s\x20not\x20fo','nt-weixi','split','nd\x20after','\x20can\x20ins','.map','$HOME/','2021272jaEWHK','und','function','spec','in\x20insta','some','wBin','runtimeR','pluginId','manifest','sort','\x20shape\x20n','\x20entry\x20\x22','dencies','er\x20respo','LocalPlu','--omit=p','win32','NFIG_PAT','nnel','resolved','\x20patch\x20a','pe\x20not\x20f','FIG_FILE','plugins','utable','bridge\x20n','h\x20applie','er\x20id.','openclaw','ady\x20appl','ime\x20buil','m-cli.js','ATH:-','red\x20Open','execPath','--\x20\x22$(di','node/nod','eam\x20fix\x20','\x20validat','Spec','time]\x20do','--json','oot\x20was\x20','ad-','name','t\x20\x22OPENC','ENCLAW_H','ll\x20||\x20tr','SCRIPT_D','nodeVers','isArray','\x20did\x20not','CONFIG_P','\x20resolve','eixin\x20@i','endencie','\x20returne','STATE_DI','shift','if\x20\x22%OPE','pid','pluginSp','octor\x20--','label','ot\x20found','now','ntime\x20ch','atch\x20ski','director','qqbot\x20ou','channel-','package','el.inbou','Dependen','age\x20was\x20','ad\x20patch','ckaging','configur','red\x20Node','\x20mirrors','lib',',\x20shell.','\x20timed\x20o','filter','plied','Name','ame','w-extrac','npm\x20plug','cwd','r\x20id.','d\x20mirror','ntime','e\x20tools\x20','ped;\x20cha','provider','--no-aud','atch\x20alr','/npm','ncies','des.','scripts','ipped;\x20r','isDirect','keys','\x22\x20so\x20the','d\x20as\x20gro','eady\x20cur','49227KeqpgL','w.mjs','ied','state-','extract\x20','y\x20applie','ion\x20mism','NCLAW_CO','with\x20the','parse','th\x20c2c\x20i','try\x20not\x20','id\x20title','HIVE\x20-De','NCLAW_HO','runtime-','ugin\x20dep','process.','\x20request','#!/bin/s','includes','arch','allowMis','ILE_NAME','runtimeL','n/opencl','s\x20to\x20dir','time-too','ugin\x20spe','integrit','pt-path-','n\x20outbou','set','npm-cli.','n\x20the\x20di','o\x20resolv','\x20kdocs\x20s','path:\x20','mjs','pped;\x20ru','store-lo','Configur','singOpen','catch','45qakmyM','exec\x20\x22$S','ch\x20skipp','fix\x20star','versions','e\x20upgrad','PT_DIR/','38jojZKg','rcing\x20op','OPENCLAW','or.com','utbound\x20','@types','wnloadin',';\x20provid','.npmmirr','hell:run','error','-Executi','already-','er\x20patch','toLowerC','ed;\x20chan','ignore','all\x20plug','6353160WWwWPx','(empty)','ATE_DIR:','has','tch\x20alre','isFile','\x22\x20%*','ell-runt','ibility\x20','string','\x20can\x20be\x20','fy\x20upstr','sion.','LocalSki','nd\x20helpe','e\x20not\x20fo','ME%\x22==\x22\x22','local','agents\x20s','stderr','\x20loaded','solver\x20n','dataDir','ath','es\x20','add','pplied','nloads-b','ct\x20sessi','\x20depende','o.mjs\x22\x202','nd\x20deliv','_modules','request-','kill','Bin','bytes','store\x20wr','data','ie-logo.','ch\x20appli','r\x20@openc','--omit=d','E_DIR=','bug;\x20ver','Invalid\x20','m/bin/np','aipc-run','plugin\x20r','Bypass','rebuilt\x20','sion\x20mis','OME=','tool\x20his','push','node_mod','plugin\x20s','PT_DIR%','Claw\x20ver','\x22==\x22\x22\x20se','.tmp/run','stinatio','sessions','d:\x20','\x20package','reason','chat-dis','-peer-de','ules/npm','/node','lled','trim','rcing\x20QQ','Expand-A','idated','shasum','ginPaths','vel\x20entr','%USERPRO','OOT\x20-For','oot','ect\x20sess','\x20-g','node-v','fix\x20alre','onPolicy','n\x20the\x20pe','close','Temporar','FILE%\x5c','../../sh','configFi','jie-shel','every','CRIPT_DI','get','install','ies:\x20','ll.exe','dist','\x20configu','tching\x20p','generate','load:\x20','pec:\x20','oute\x20pat','enclaw\x20d','go.mjs','../../as','dy\x20appli','able','store\x20lo','optional','Version','ed\x20npm\x20p','__tests_','patch\x20sk','base\x20alr','all\x20','_SHELL_E','path','d\x20Node\x20r','patched','6\x20mixed\x20','tarball:','ng\x20chann','h\x20alread','mirrors\x20','fix\x20mark','.cache','nodeExec','nse\x20hook','ons;\x20ver','agents','env','source','cies','>/dev/nu','product\x20','ory','loader-','rchive\x20-','\x20already','HOME=\x22${','l\x20prepar','\x20install','\x20id\x20from','ntimeCha','\x20summary','npm\x20pack','unknown','ipped;\x20o','ch\x20alrea','\x20routing','tory\x20mix',':WUJIE_S','files','endsWith','pipe','version','d\x20for\x20lo','\x20patch\x20s','shape\x20no','ime/sess','ules','\x20product','st\x20be\x20a\x20','src','dataDirN','toISOStr','\x22\x20at\x20','\x20to\x20dire','ecs','[wujie-s','channel.','\x20skipped','.json','XTRACT_R','eer','\x20failed\x20','untime\x20p','\x20outboun','lugin\x20de','ipped;\x20d','\x20not\x20fou','ie-shell','info','Duplicat','Version\x20','nel\x20plug','\x22\x20\x22$@\x22','nnel\x20sha','ayload\x20b','ujie-log','prepareP','ors\x20bein','OGO\x22\x20];\x20','all\x20loca','s\x20instal','ing\x20\x22','\x20paths','failed','Run\x20\x22wuj','registry','pack','n/npm-cl','dexed\x20wi','length','d\x20an\x20inv','lied','extensio','entryCou','transcri','npm-glob','\x20in\x20','--fix','&&\x20pwd)','ore\x20pack','filename','-xzf','tbound\x20f','node','devDepen','tbound\x20s','time','npm\x20inst','up\x20sessi','statusCo','time]\x20fe','\x20path\x20wa','==\x22\x22\x20set','w.cmd','export\x20O','elivery\x20','alid\x20pay','weixin\x20o','bridge.m','Extracte','stdout','law\x20','ced','installP','doctor','PENCLAW_','store-','found','LAW_STAT','prefix\x20i','re\x20upgra','--legacy','example','ogger','bin','R=\x22${OPE','node\x20ver','on\x20futur','fallback','lib/node','y\x20compat','object','scoped\x20s','then','es.','outbound','skills\x20s','\x20is\x20miss','patch\x20al','lark-cli','1119406tWTtlq','s/npm','ed;\x20plug','\x5cwjrt-','e_module','ing','with\x20cod','if\x20[\x20-t\x20','plugins\x20','local:','_shared','1670NGPtMy','not\x20foun','ions\x20whe','wujieai.','play-pro','efore\x20pa','time]\x20in','rg/dist/','\x20on\x20futu','\x20bin\x20was','required','kipped;\x20','exec','lready\x20a','resume','chat\x20his','in\x20runti','ify\x20upst','ery\x20mirr','LocalAge','y:\x20','llPaths','set\x20\x22SCR','st=','values','join','patch\x20fo','\x20synced','r\x20runtim','importan','--no-fun','l\x20plugin','ynced','session\x20','agentSco','projectR','kup','.node','aipc-dow','law/qqbo','ailable.','\x20local\x20p','ession\x20r','tar','\x20create\x20','.js',';\x20dist\x20n'];_0x4fd9=function(){return _0xf60fa;};return _0x4fd9();}async function buildRuntimeBase(_0x12b3d5,_0x576a38,_0x46d387={}){const _0x355327=_0x3d918c,_0x56ebe4=join(_0x576a38,_0x355327(0xec));await ensureRuntimeNode(_0x12b3d5,_0x56ebe4);const _0x1fba70=process['platform']===_0x355327(0x211)?_0x355327(0x225)+_0x355327(0x1d4):_0x355327(0x158)+_0x355327(0x2f7),_0x178259=process[_0x355327(0x1a4)]===_0x355327(0x211)?_0x355327(0x225)+_0x355327(0x11f)+'s/npm/bi'+_0x355327(0xdc)+'i.js':_0x355327(0x198)+_0x355327(0x1ae)+'dules/np'+_0x355327(0x2e0)+_0x355327(0x220),_0x24ef13={..._0x46d387,'generatedAt':new Date()[_0x355327(0xb8)+_0x355327(0x120)](),'nodeVersion':_0x12b3d5['openclaw'][_0x355327(0x232)+_0x355327(0x156)],'openclawVersion':_0x46d387['openclaw'+_0x355327(0x323)]||'','platform':process['platform'],'arch':process[_0x355327(0x282)],'nodeExecutable':_0x1fba70,'npmCli':_0x178259,'openclawWorkingDir':_0x355327(0x21d),'openclawBin':_0x355327(0x21d)+'/opencla'+_0x355327(0x26e)};return await writeJson(resolveManifestPath(_0x576a38),_0x24ef13),_0x24ef13;}async function removePathWithRetries(_0x383384){await rm(_0x383384,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96});}async function ensureRuntimeNode(_0x527f7f,_0xbd59db){const _0x139222=_0x3d918c,_0x2e2b65=_0x527f7f['openclaw']['nodeVers'+_0x139222(0x156)],_0x4b84bf=process[_0x139222(0x1a4)]===_0x139222(0x211)?join(_0xbd59db,_0x139222(0x1a2)):join(_0xbd59db,_0x139222(0x10b),_0x139222(0xec)),_0x2083de=process[_0x139222(0x1a4)]===_0x139222(0x211)?join(_0xbd59db,_0x139222(0x2e9)+_0x139222(0xb3),'npm',_0x139222(0x10b),'npm-cli.'+'js'):join(_0xbd59db,'lib',_0x139222(0x2e9)+'ules',_0x139222(0x17d),'bin',_0x139222(0x28e)+'js');if(existsSync(_0x4b84bf)&&existsSync(_0x2083de)&&await getNodeVersion(_0x4b84bf)===_0x2e2b65)return;await removePathWithRetries(_0xbd59db);if(process[_0x139222(0x29d)]['node']===_0x2e2b65){await linkCurrentNodeRuntime(_0xbd59db);return;}await downloadNodeRuntime(_0x2e2b65,_0xbd59db);}async function getNodeVersion(_0x1f72d2){const _0x225708=_0x3d918c;try{const _0x483c6f=await runProcess(_0x1f72d2,['-p',_0x225708(0x27e)+_0x225708(0x29d)+_0x225708(0x14b)],{'label':_0x1f72d2+_0x225708(0x19a),'timeoutMs':0x7530});return _0x483c6f[_0x225708(0xfd)][_0x225708(0x2f9)]();}catch{return'';}}async function linkCurrentNodeRuntime(_0x3b45a2){const _0x135680=_0x3d918c,_0x416aef=process[_0x135680(0x223)],_0x5ce336=resolve(dirname(_0x416aef),'..'),_0x2368d3=process[_0x135680(0x1a4)]===_0x135680(0x211)?resolve(_0x5ce336,_0x135680(0x2e9)+_0x135680(0x2f6)):resolve(_0x5ce336,_0x135680(0x110)+_0x135680(0x2d2)+_0x135680(0x263)),_0x3cb50c=process[_0x135680(0x1a4)]===_0x135680(0x211)?join(_0x3b45a2,_0x135680(0x1a2)):join(_0x3b45a2,'bin',_0x135680(0xec)),_0x939adc=process['platform']===_0x135680(0x211)?join(_0x3b45a2,'node_mod'+_0x135680(0xb3),_0x135680(0x17d)):join(_0x3b45a2,_0x135680(0x251),_0x135680(0x2e9)+'ules',_0x135680(0x17d));await mkdir(dirname(_0x3cb50c),{'recursive':!![]}),await mkdir(dirname(_0x939adc),{'recursive':!![]}),await symlink(_0x416aef,_0x3cb50c),existsSync(_0x2368d3)?await symlink(_0x2368d3,_0x939adc):await symlink(await resolveNpmRoot(),_0x939adc);}async function resolveNpmRoot(){const _0x328616=_0x3d918c,_0x1ea27f=await runProcess(_0x328616(0x17d),['root','-g'],{'label':'npm\x20root'+_0x328616(0x304),'timeoutMs':0x7530}),_0x5d87f4=process[_0x328616(0x1a4)]===_0x328616(0x211)?_0x1ea27f['stdout'][_0x328616(0x2f9)]():join(_0x1ea27f[_0x328616(0xfd)][_0x328616(0x2f9)](),'npm');if(!existsSync(join(_0x5d87f4,_0x328616(0x10b),'npm-cli.'+'js')))throw new Error(_0x328616(0xa4)+_0x328616(0x24b)+'not\x20foun'+_0x328616(0xaf)+_0x328616(0x16b)+_0x328616(0x21f)+_0x328616(0x2f1)+_0x5d87f4);return _0x5d87f4;}async function resolveExtractedNodeRoot(_0x3c95dd,_0xeba5ec){const _0x37a20b=_0x3d918c,_0x5ca177=join(_0x3c95dd,_0xeba5ec);if(existsSync(_0x5ca177))return _0x5ca177;const _0x26ed51=await readdir(_0x3c95dd,{'withFileTypes':!![]}),_0x13b9bb=_0x26ed51[_0x37a20b(0x254)](_0x43f60a=>_0x43f60a['isDirect'+_0x37a20b(0x9a)]());if(_0x13b9bb[_0x37a20b(0xde)]===0x1)return join(_0x3c95dd,_0x13b9bb[0x0][_0x37a20b(0x22d)]);const _0x55c945=process[_0x37a20b(0x1a4)]==='win32'?join(_0x3c95dd,_0x37a20b(0x1a2)):join(_0x3c95dd,_0x37a20b(0x10b),'node');if(existsSync(_0x55c945))return _0x3c95dd;const _0x2f330c=await findNodeRuntimeRoot(_0x3c95dd);if(_0x2f330c)return _0x2f330c;const _0x3bea00=_0x26ed51[_0x37a20b(0x1f6)](_0x464e2f=>_0x464e2f['name'])[_0x37a20b(0x13f)](',\x20');throw new Error(_0x37a20b(0xfc)+_0x37a20b(0x32b)+_0x37a20b(0x167)+_0x37a20b(0x22b)+_0x37a20b(0x127)+'d\x20for\x20'+_0xeba5ec+_0x37a20b(0xe5)+_0x3c95dd+('.\x20Top-le'+_0x37a20b(0x2ff)+_0x37a20b(0x313))+(_0x3bea00||_0x37a20b(0x2b3)));}function resolveNodeExtractRoot(_0x2219a0,_0x1aa215,_0x35b971){const _0x598f7e=_0x3d918c;if(process['platform']!==_0x598f7e(0x211))return join(_0x2219a0,_0x1aa215+('-extract'+'-')+process[_0x598f7e(0x23d)]+'-'+Date[_0x598f7e(0x242)]()+'-'+_0x35b971);const _0x20f85d=/^[A-Za-z]:[\\/]/[_0x598f7e(0x132)](_0x2219a0),_0x36e2dd=parse(_0x2219a0),_0x2853c0=_0x20f85d?_0x20f85d[0x0][_0x598f7e(0x1a5)](0x0,0x2)+'\x5c':_0x36e2dd[_0x598f7e(0x1bf)]&&_0x36e2dd[_0x598f7e(0x1bf)]!=='/'?_0x36e2dd[_0x598f7e(0x1bf)]:_0x2219a0,_0x1c57ac=_0x2853c0[_0x598f7e(0x1d7)](/[\\/]+$/,'');return _0x1c57ac+_0x598f7e(0x11e)+process[_0x598f7e(0x23d)]+'-'+Date['now']()+'-'+_0x35b971;}async function findNodeRuntimeRoot(_0x5c23d0){const _0x2256d2=_0x3d918c,_0x5439cd=[_0x5c23d0],_0x4be828=new Set();while(_0x5439cd[_0x2256d2(0xde)]>0x0){const _0x29b1a8=_0x5439cd[_0x2256d2(0x23b)]();if(!_0x29b1a8||_0x4be828[_0x2256d2(0x2b5)](_0x29b1a8))continue;_0x4be828[_0x2256d2(0x2cb)](_0x29b1a8);const _0x717fa3=process[_0x2256d2(0x1a4)]==='win32'?join(_0x29b1a8,_0x2256d2(0x1a2)):join(_0x29b1a8,_0x2256d2(0x10b),_0x2256d2(0xec)),_0x339ac8=process[_0x2256d2(0x1a4)]===_0x2256d2(0x211)?join(_0x29b1a8,_0x2256d2(0x2e9)+_0x2256d2(0xb3),'npm','bin','npm-cli.'+'js'):join(_0x29b1a8,_0x2256d2(0x251),_0x2256d2(0x2e9)+_0x2256d2(0xb3),'npm','bin',_0x2256d2(0x28e)+'js');if(existsSync(_0x717fa3)&&existsSync(_0x339ac8))return _0x29b1a8;const _0x5accef=await readdir(_0x29b1a8,{'withFileTypes':!![]});for(const _0x4fa8b0 of _0x5accef){_0x4fa8b0[_0x2256d2(0x268)+_0x2256d2(0x9a)]()&&_0x5439cd[_0x2256d2(0x2e8)](join(_0x29b1a8,_0x4fa8b0[_0x2256d2(0x22d)]));}}return'';}async function downloadNodeRuntime(_0x4223ff,_0x1d4d8d){const _0x180d85=_0x3d918c,_0x21e65f=process['platform']===_0x180d85(0x211)?'win':process['platform'],_0x259fce=process['arch']==='x64'?_0x180d85(0x18b):process[_0x180d85(0x282)]===_0x180d85(0x157)?_0x180d85(0x157):process[_0x180d85(0x282)],_0x120052=process['platform']==='win32'?'zip':'tar.xz',_0x556cbb=_0x180d85(0x305)+_0x4223ff+'-'+_0x21e65f+'-'+_0x259fce,_0x5f9f70=_0x556cbb+'.'+_0x120052,_0x4d1c5c=join(dirname(_0x1d4d8d),_0x180d85(0x333)),_0x5974ce=join(_0x4d1c5c,_0x5f9f70),_0x588b17=_0x180d85(0x1ca)+_0x180d85(0x186)+_0x180d85(0x12d)+'v'+_0x4223ff+'/'+_0x5f9f70;await mkdir(_0x4d1c5c,{'recursive':!![]});const _0x2b2e74=resolveNodeExtractRoot(_0x4d1c5c,_0x556cbb,0x1);!existsSync(_0x5974ce)&&(console[_0x180d85(0x15d)](_0x180d85(0xbc)+_0x180d85(0x2a9)+_0x180d85(0x229)+_0x180d85(0x2a6)+'g\x20'+_0x588b17),await downloadFile(_0x588b17,_0x5974ce));await rm(_0x2b2e74,{'recursive':!![],'force':!![]}),await mkdir(_0x2b2e74,{'recursive':!![]});process['platform']===_0x180d85(0x211)?await extractZipArchive(_0x5974ce,_0x2b2e74,_0x5f9f70):await runProcess('tar',[_0x180d85(0x1c4),_0x5974ce,'-C',_0x2b2e74],{'label':'extract\x20'+_0x5f9f70});const _0xb66ad7=await resolveExtractedNodeRoot(_0x2b2e74,_0x556cbb);await mkdir(dirname(_0x1d4d8d),{'recursive':!![]}),await rename(_0xb66ad7,_0x1d4d8d),_0xb66ad7!==_0x2b2e74&&await rm(_0x2b2e74,{'recursive':!![],'force':!![]});}async function extractZipArchive(_0xd709e3,_0x1b21b0,_0x4c9a3f){const _0x43214a=_0x3d918c;await runProcess('powershe'+_0x43214a(0x314),[_0x43214a(0x19e)+'le',_0x43214a(0x2ab)+_0x43214a(0x307),_0x43214a(0x2e3),'-Command',_0x43214a(0x2fb)+_0x43214a(0x9c)+_0x43214a(0x17f)+'ath\x20$env'+_0x43214a(0xaa)+'HELL_ARC'+_0x43214a(0x27a)+_0x43214a(0x2ef)+_0x43214a(0x1be)+'nv:WUJIE'+_0x43214a(0x329)+_0x43214a(0xc0)+_0x43214a(0x301)+'ce'],{'env':{...process.env,'WUJIE_SHELL_ARCHIVE':_0xd709e3,'WUJIE_SHELL_EXTRACT_ROOT':_0x1b21b0},'label':_0x43214a(0x271)+_0x4c9a3f});}async function downloadFile(_0x552155,_0x10574e){await mkdir(dirname(_0x10574e),{'recursive':!![]});const _0x359dc0=await new Promise((_0xefcf19,_0x18845a)=>{get(_0x552155,_0x2beda6=>{const _0x5739e3=_0x1d92;if(_0x2beda6[_0x5739e3(0xf2)+'de']>=0x12c&&_0x2beda6[_0x5739e3(0xf2)+'de']<0x190&&_0x2beda6['headers'][_0x5739e3(0x195)]){_0x2beda6[_0x5739e3(0x134)](),downloadFile(new URL(_0x2beda6[_0x5739e3(0x1a7)][_0x5739e3(0x195)],_0x552155)[_0x5739e3(0x178)],_0x10574e)[_0x5739e3(0x114)](()=>_0xefcf19(null))[_0x5739e3(0x298)](_0x18845a);return;}if(_0x2beda6[_0x5739e3(0xf2)+'de']!==0xc8){_0x2beda6['resume'](),_0x18845a(new Error('download'+'\x20failed\x20'+_0x2beda6['statusCo'+'de']+':\x20'+_0x552155));return;}_0xefcf19(_0x2beda6);})['on']('error',_0x18845a);});_0x359dc0&&await pipeline(_0x359dc0,createWriteStream(_0x10574e));}export async function ensureOpenClawDoctorFixed(_0x4e3242,_0x105d92={}){const _0x3b0cb7=_0x3d918c,_0x332655=await loadRuntimeInfo(_0x4e3242[_0x3b0cb7(0x149)+'oot']),_0x358fc1=getConfigPaths(_0x4e3242),_0x4e6202=join(_0x358fc1['runtimeS'+'tateDir'],_0x3b0cb7(0x21d)+'-doctor.'+'json'),_0xbc6186=await readJson(_0x4e6202,{});if(_0xbc6186['openclaw'+_0x3b0cb7(0x323)]===_0x332655[_0x3b0cb7(0x21d)+'Version'])return _0x105d92[_0x3b0cb7(0x285)+_0x3b0cb7(0x10a)]?.[_0x3b0cb7(0xc9)](_0x3b0cb7(0x21d)+'\x20doctor\x20'+_0x3b0cb7(0x306)+'ady\x20curr'+_0x3b0cb7(0x1f1),{'openclawVersion':_0x332655['openclaw'+_0x3b0cb7(0x323)],'markerPath':_0x4e6202}),{'ran':![],'openclawVersion':_0x332655[_0x3b0cb7(0x21d)+_0x3b0cb7(0x323)],'markerPath':_0x4e6202};return await runOpenClawDoctorFix(_0x4e3242,_0x332655,{'fromVersion':_0xbc6186[_0x3b0cb7(0x21d)+'Version']||_0x3b0cb7(0xa5),'toVersion':_0x332655[_0x3b0cb7(0x21d)+_0x3b0cb7(0x323)],'markerPath':_0x4e6202,'runtimeLogger':_0x105d92[_0x3b0cb7(0x285)+_0x3b0cb7(0x10a)]}),{'ran':!![],'openclawVersion':_0x332655['openclaw'+_0x3b0cb7(0x323)],'markerPath':_0x4e6202};}async function runOpenClawDoctorFix(_0x30536a,_0x186a1d,{fromVersion:_0x8f71ec,toVersion:_0x176d28,markerPath:markerPath='',runtimeLogger:_0x1ff076}={}){const _0x5e690b=_0x3d918c;_0x1ff076?.[_0x5e690b(0x143)+'t']?.(_0x5e690b(0x21d)+_0x5e690b(0x1a0)+_0x5e690b(0x29c)+'ted',{'fromVersion':_0x8f71ec,'toVersion':_0x176d28});const _0x3c7257=await createRuntimeEnv(_0x186a1d,{'OPENCLAW_HOME':_0x30536a['dataDir'],'OPENCLAW_STATE_DIR':_0x30536a[_0x5e690b(0x2c8)],'OPENCLAW_CONFIG_PATH':getConfigPaths(_0x30536a)[_0x5e690b(0x1f2)+'th']});console['log'](_0x5e690b(0xbc)+_0x5e690b(0x2a9)+'time]\x20ru'+'nning\x20op'+_0x5e690b(0x31c)+_0x5e690b(0x23f)+_0x5e690b(0x1c8));const _0x2fb083=await runProcess(_0x186a1d[_0x5e690b(0x334)+_0x5e690b(0x219)],[_0x186a1d[_0x5e690b(0x21d)+'Bin'],_0x5e690b(0x101),_0x5e690b(0xe6)],{'cwd':_0x186a1d[_0x5e690b(0x21d)+'WorkingD'+'ir'],'env':_0x3c7257,'label':'openclaw'+_0x5e690b(0x1a0)+'--fix','timeoutMs':0x1d4c0});_0x1ff076?.['importan'+'t']?.(_0x5e690b(0x21d)+_0x5e690b(0x1a0)+_0x5e690b(0x1ea)+_0x5e690b(0x1e8),{'fromVersion':_0x8f71ec,'toVersion':_0x176d28,'stdout':_0x2fb083[_0x5e690b(0xfd)][_0x5e690b(0x2f9)]()[_0x5e690b(0x1a5)](-0xfa0),'stderr':_0x2fb083[_0x5e690b(0x2c5)][_0x5e690b(0x2f9)]()[_0x5e690b(0x1a5)](-0xfa0)}),markerPath&&(await writeJson(markerPath,{'openclawVersion':_0x186a1d['openclaw'+'Version'],'fixedAt':new Date()[_0x5e690b(0xb8)+_0x5e690b(0x120)]()}),_0x1ff076?.[_0x5e690b(0x143)+'t']?.('openclaw'+'\x20doctor\x20'+_0x5e690b(0x332)+_0x5e690b(0x1b1)+'en',{'markerPath':markerPath,'openclawVersion':_0x186a1d[_0x5e690b(0x21d)+_0x5e690b(0x323)]}));}export async function readRuntimeManifest(_0x387b8d){return await readJson(resolveManifestPath(_0x387b8d),{});}export async function loadRuntimeInfo(_0x45f1e7){const _0x5da5e1=resolveRuntimeRoot(_0x45f1e7),_0x20dc2f=await readRuntimeManifest(_0x5da5e1);return createRuntimeInfoFromManifest(_0x5da5e1,_0x20dc2f);}function createRuntimeInfoFromManifest(_0x49c32c,_0x5675ec,_0x77151d={}){const _0x54e515=_0x3d918c;for(const _0x174506 of[_0x54e515(0x334)+_0x54e515(0x219),_0x54e515(0x1e5),_0x54e515(0x21d)+_0x54e515(0x1a6)+'ir',_0x54e515(0x21d)+_0x54e515(0x2d5)]){if(typeof _0x5675ec[_0x174506]!==_0x54e515(0x2bb)||!_0x5675ec[_0x174506]['trim']())throw new Error(_0x54e515(0x1eb)+_0x54e515(0x209)+_0x54e515(0x118)+_0x54e515(0xd6)+_0x174506+_0x54e515(0xb9)+resolveManifestPath(_0x49c32c)+(';\x20run\x20wu'+_0x54e515(0x30e)+_0x54e515(0x9f)+'e'));}const _0x4e8179=resolve(_0x49c32c,_0x5675ec['nodeExec'+_0x54e515(0x219)]),_0x502c75=resolve(_0x49c32c,_0x5675ec[_0x54e515(0x1e5)]),_0x27745b=resolve(_0x49c32c,_0x5675ec[_0x54e515(0x21d)+_0x54e515(0x1a6)+'ir']),_0x11ccef=resolve(_0x49c32c,_0x5675ec[_0x54e515(0x21d)+'Bin']),_0x14eea2=Array['isArray'](_0x5675ec[_0x54e515(0x218)])?_0x5675ec[_0x54e515(0x218)][_0x54e515(0x1f6)](_0x27a9dd=>({..._0x27a9dd,'installPath':resolve(_0x49c32c,_0x27a9dd['installP'+_0x54e515(0x2c9)])})):[],_0x193d90=_0x77151d[_0x54e515(0x283)+_0x54e515(0x297)+'Claw']?[_0x4e8179,_0x502c75]:[_0x4e8179,_0x502c75,_0x27745b,_0x11ccef];for(const _0x4dbdbb of _0x193d90){if(!existsSync(_0x4dbdbb))throw new Error(_0x54e515(0x1eb)+_0x54e515(0x1d1)+_0x54e515(0x292)+_0x4dbdbb);}return{'runtimeRoot':_0x49c32c,'manifest':_0x5675ec,'openclawVersion':_0x5675ec[_0x54e515(0x21d)+_0x54e515(0x323)]||'unknown','nodeExecutable':_0x4e8179,'npmCli':_0x502c75,'openclawWorkingDir':_0x27745b,'openclawBin':_0x11ccef,'plugins':_0x14eea2};}export async function spawnClaw(_0x546c97,_0x50b662=[],_0x145d3f={}){const _0x380c48=_0x3d918c,_0x492745=await loadRuntimeInfo(_0x546c97),_0x484907=await createRuntimeEnv(_0x492745,_0x145d3f['env']??{});return spawn(_0x492745[_0x380c48(0x334)+'utable'],[_0x492745[_0x380c48(0x21d)+_0x380c48(0x2d5)],..._0x50b662],{'cwd':_0x492745['openclaw'+_0x380c48(0x1a6)+'ir'],'stdio':_0x380c48(0xad),..._0x145d3f,'env':_0x484907});}export async function runClawOnce(_0x4b3b2d,_0x11143b=[],_0x275199=0x15f90){const _0x2555e0=await spawnClaw(_0x4b3b2d,_0x11143b);return await new Promise((_0x4b296d,_0x42322d)=>{const _0x51a2af=_0x1d92;let _0x14c4ec='',_0x2cddcf='',_0x3e07e3=![];const _0x5f0b3c=setTimeout(()=>{const _0x3bcd63=_0x1d92;if(_0x3e07e3)return;_0x3e07e3=!![],_0x2555e0[_0x3bcd63(0x2d4)](_0x3bcd63(0x1d0)),_0x42322d(new Error(_0x3bcd63(0x21d)+_0x3bcd63(0x253)+_0x3bcd63(0x18e)+'\x20'+_0x275199+'ms'));},_0x275199);_0x2555e0[_0x51a2af(0xfd)]['on'](_0x51a2af(0x2d8),_0x5545ab=>{_0x14c4ec+=_0x5545ab['toString']();}),_0x2555e0[_0x51a2af(0x2c5)]['on']('data',_0x36bce1=>{const _0x5581e3=_0x51a2af;_0x2cddcf+=_0x36bce1[_0x5581e3(0x174)]();}),_0x2555e0['on'](_0x51a2af(0x2aa),_0x183ece=>{if(_0x3e07e3)return;_0x3e07e3=!![],clearTimeout(_0x5f0b3c),_0x42322d(_0x183ece);}),_0x2555e0['on'](_0x51a2af(0x309),(_0x2b62ca,_0x9c481f)=>{if(_0x3e07e3)return;_0x3e07e3=!![],clearTimeout(_0x5f0b3c),_0x4b296d({'code':_0x2b62ca,'signal':_0x9c481f,'stdout':_0x14c4ec,'stderr':_0x2cddcf});});});}export{resolveRuntimeLarkCliCommand};function resolvePackageNameFromNpmSpec(_0x2aa89a){const _0x10b06c=_0x3d918c,_0xab2072=_0x2aa89a[_0x10b06c(0x2f9)]()[_0x10b06c(0x1d7)](/^npm:/,'');if(!_0xab2072)throw new Error('Invalid\x20'+'empty\x20pl'+_0x10b06c(0x289)+'c');if(_0xab2072[_0x10b06c(0x1c6)+'th']('@')){const _0x43ad4e=_0xab2072[_0x10b06c(0x163)]('/');if(_0x43ad4e===-0x1)throw new Error(_0x10b06c(0x2df)+_0x10b06c(0x113)+'pec:\x20'+_0x2aa89a);const _0x56b5a2=_0xab2072[_0x10b06c(0x163)]('@',_0x43ad4e+0x1);return _0x56b5a2===-0x1?_0xab2072:_0xab2072[_0x10b06c(0x1a5)](0x0,_0x56b5a2);}const _0x3f852f=_0xab2072[_0x10b06c(0x163)]('@');return _0x3f852f===-0x1?_0xab2072:_0xab2072['slice'](0x0,_0x3f852f);}async function createRuntimeEnv(_0x201179,_0x695f3c={}){const _0xd5c0f3=_0x3d918c,_0x52e78=process.env.OPENCLAW_STATE_DIR||'',_0x36d990=process.env.NPM_CONFIG_REGISTRY||_0xd5c0f3(0x1ca)+_0xd5c0f3(0xda)+_0xd5c0f3(0x2a8)+_0xd5c0f3(0x2a3),_0xdd5d20=_0x52e78?join(_0x52e78,'claw-run'+_0xd5c0f3(0x288)+'ls'):join(_0x201179['runtimeR'+_0xd5c0f3(0x302)],'.tools'),_0x21000c=join(_0xdd5d20,_0xd5c0f3(0xe4)+'al'),_0x1f3d48=join(_0xdd5d20,'npm-cach'+'e'),_0x100fee=join(_0x21000c,_0xd5c0f3(0x10b));await mkdir(_0x100fee,{'recursive':!![]}),await mkdir(_0x1f3d48,{'recursive':!![]});const _0x4cabeb=[_0x100fee,dirname(_0x201179['nodeExec'+_0xd5c0f3(0x219)]),process.env.PATH||''];return{...process.env,..._0x695f3c,'PATH':_0x4cabeb[_0xd5c0f3(0x254)](Boolean)[_0xd5c0f3(0x13f)](delimiter),'npm_config_prefix':_0x21000c,'NPM_CONFIG_PREFIX':_0x21000c,'npm_config_cache':_0x1f3d48,'NPM_CONFIG_CACHE':_0x1f3d48,'NPM_CONFIG_REGISTRY':_0x36d990,'npm_execpath':_0x201179[_0xd5c0f3(0x1e5)],'npm_node_execpath':_0x201179[_0xd5c0f3(0x334)+_0xd5c0f3(0x219)],'OPENCLAW_RUNTIME_NPM_PREFIX':_0x21000c,'OPENCLAW_RUNTIME_NPM_BIN':_0x100fee};}export async function getRuntimeSpawnContext(_0x1efcf7,_0x2c0e37={}){const _0x5f33f5=_0x3d918c,_0x26eacf=await loadRuntimeInfo(_0x1efcf7),_0x1aef87=await createRuntimeEnv(_0x26eacf,_0x2c0e37);return{'cwd':_0x26eacf[_0x5f33f5(0x21d)+_0x5f33f5(0x1a6)+'ir'],'env':_0x1aef87,'runtime':_0x26eacf};}function resolvePluginDirNameFromSpec(_0x5143e5){const _0xb88768=_0x3d918c,_0x2909a4=resolvePackageNameFromNpmSpec(_0x5143e5),_0x5dde39=_0x2909a4[_0xb88768(0x1fb)]('/')[_0xb88768(0x254)](Boolean),_0x488764=_0x5dde39['at'](-0x1)??'';if(!_0x488764)throw new Error(_0xb88768(0x2df)+_0xb88768(0x2ea)+_0xb88768(0x31a)+_0x5143e5);return _0x488764;}async function resolvePluginIdFromPackageDir(_0x54d8cf,_0x48e92e){const _0x44e612=_0x3d918c,_0x517540=await readJson(join(_0x54d8cf,_0x44e612(0x1ee)+_0x44e612(0x155)),{}),_0x3bd7de=await readPluginManifest(_0x54d8cf),_0x54a0ea=[_0x3bd7de?.['id'],_0x3bd7de?.['pluginId'],_0x3bd7de?.[_0x44e612(0x22d)],_0x517540?.[_0x44e612(0x21d)]?.['id'],_0x517540?.[_0x44e612(0x21d)+'Id'],_0x48e92e],_0x21bed2=_0x54a0ea[_0x44e612(0x19b)](_0x186cf7=>typeof _0x186cf7==='string'&&_0x186cf7['trim']());if(!_0x21bed2)throw new Error('Unable\x20t'+_0x44e612(0x290)+'e\x20plugin'+_0x44e612(0xa1)+'\x20'+_0x54d8cf);return _0x21bed2['trim']();}function pluginSpecMatches(_0x56b3f8,_0x9ff7b2){const _0x1278ea=_0x3d918c,_0x50ce9a=_0x9ff7b2[_0x1278ea(0x2f9)](),_0x225a72=resolvePackageNameFromNpmSpec(_0x50ce9a);return[_0x56b3f8['spec'],_0x56b3f8[_0x1278ea(0x214)+'Spec'],_0x56b3f8['resolved'+_0x1278ea(0x256)]][_0x1278ea(0x205)](_0x19a39f=>_0x19a39f===_0x50ce9a||_0x19a39f===_0x225a72);}async function installPluginFromNpmSpec(_0x289549,_0x162727,_0x51eb65={}){const _0x26f76f=_0x3d918c,_0x1d5201=_0x289549[_0x26f76f(0x2f9)]()[_0x26f76f(0x1d7)](/^npm:/,''),_0x2dead6=resolvePluginDirNameFromSpec(_0x1d5201),_0x5aefd6=join(_0x162727[_0x26f76f(0x21d)+_0x26f76f(0x1a6)+'ir'],_0x26f76f(0x315),_0x26f76f(0xe1)+'ns'),_0x230f8b=join(_0x5aefd6,_0x2dead6),_0x523536=join(_0x162727[_0x26f76f(0x207)+_0x26f76f(0x302)],'.plugin-'+'extract-'+process['pid']+'-'+Date[_0x26f76f(0x242)]()),_0x30c823=await createRuntimeEnv(_0x162727),_0x3311b8=new Date()['toISOStr'+_0x26f76f(0x120)](),_0x34eaf0=join(_0x162727['runtimeR'+_0x26f76f(0x302)],'.cache');await mkdir(_0x34eaf0,{'recursive':!![]}),await rm(_0x523536,{'recursive':!![],'force':!![]}),await rm(_0x230f8b,{'recursive':!![],'force':!![]}),await mkdir(_0x523536,{'recursive':!![]}),await mkdir(_0x5aefd6,{'recursive':!![]}),console['log'](_0x26f76f(0xbc)+_0x26f76f(0x2a9)+_0x26f76f(0xf3)+_0x26f76f(0x317)+_0x26f76f(0x1c2)+_0x1d5201);const _0x52d5ac=await runProcess(_0x162727[_0x26f76f(0x334)+'utable'],[_0x162727['npmCli'],_0x26f76f(0xdb),_0x1d5201,'--json'],{'cwd':_0x34eaf0,'env':_0x30c823,'label':_0x26f76f(0xa4)+'\x20'+_0x1d5201}),_0x49488a=parseNpmPackJson(_0x52d5ac[_0x26f76f(0xfd)]),_0x1564d2=normalizePackedTarballFilename(_0x49488a['filename']),_0x493275=join(_0x34eaf0,_0x1564d2);if(!existsSync(_0x493275))throw new Error('npm\x20pack'+_0x26f76f(0x234)+'\x20create\x20'+'tarball:'+'\x20'+_0x493275);await runProcess(_0x26f76f(0x151),[_0x26f76f(0xea),_0x493275,'-C',_0x523536],{'label':_0x26f76f(0x271)+_0x1564d2}),await rename(join(_0x523536,_0x26f76f(0x248)),_0x230f8b),await rm(_0x523536,{'recursive':!![],'force':!![]});const _0x404a55=join(_0x230f8b,'package.'+_0x26f76f(0x155)),_0x48dff5=await readJson(_0x404a55,{});(_0x48dff5['devDepen'+_0x26f76f(0x20d)]||_0x48dff5['scripts'])&&(delete _0x48dff5['devDepen'+_0x26f76f(0x20d)],delete _0x48dff5['scripts'],await writeJson(_0x404a55,_0x48dff5));await runProcess(_0x162727[_0x26f76f(0x334)+'utable'],[_0x162727[_0x26f76f(0x1e5)],'install',_0x26f76f(0x2dc)+'ev',_0x26f76f(0x210)+_0x26f76f(0xc1),'--no-aud'+'it',_0x26f76f(0x144)+'d','--legacy'+_0x26f76f(0x2f5)+'ps'],{'cwd':_0x230f8b,'env':_0x30c823,'label':_0x26f76f(0xf0)+_0x26f76f(0x2b1)+_0x26f76f(0x182)+_0x1d5201});const _0x54d9ca=new Date()[_0x26f76f(0xb8)+_0x26f76f(0x120)](),_0x59a1bb=await resolvePluginIdFromPackageDir(_0x230f8b,_0x49488a['name']);return _0x51eb65['runtimeL'+_0x26f76f(0x10a)]?.[_0x26f76f(0xc9)](_0x26f76f(0x259)+_0x26f76f(0x204)+_0x26f76f(0x2f8),{'spec':_0x1d5201,'pluginId':_0x59a1bb,'installPath':_0x230f8b}),{'pluginId':_0x59a1bb,'source':'npm','spec':_0x1d5201,'installPath':toRuntimeRelative(_0x162727[_0x26f76f(0x207)+_0x26f76f(0x302)],_0x230f8b),'version':_0x49488a['version'],'resolvedName':_0x49488a[_0x26f76f(0x22d)],'resolvedVersion':_0x49488a['version'],'resolvedSpec':_0x49488a['name']+'@'+_0x49488a['version'],'integrity':typeof _0x49488a[_0x26f76f(0x28a)+'y']===_0x26f76f(0x2bb)?_0x49488a['integrit'+'y']:'','shasum':typeof _0x49488a[_0x26f76f(0x2fd)]===_0x26f76f(0x2bb)?_0x49488a['shasum']:'','resolvedAt':_0x3311b8,'installedAt':_0x54d9ca};}async function syncConfiguredNpmPlugins(_0x4b0968,_0x506f3a,_0x3c5562,_0x20f146={}){const _0x174342=_0x3d918c;if(_0x20f146[_0x174342(0x184)])return;const _0x103263=createRuntimeInfoFromManifest(_0x506f3a,_0x3c5562),_0x49b28c=Array['isArray'](_0x3c5562['plugins'])?_0x3c5562[_0x174342(0x218)]:[],_0x2de83d=[];for(const _0x2499b9 of _0x4b0968[_0x174342(0x21d)][_0x174342(0x23e)+_0x174342(0xbb)]){const _0x4143bd=_0x49b28c[_0x174342(0x19b)](_0x55761e=>_0x55761e?.[_0x174342(0x96)]===_0x174342(0x17d)&&pluginSpecMatches(_0x55761e,_0x2499b9)&&typeof _0x55761e[_0x174342(0x100)+_0x174342(0x2c9)]===_0x174342(0x2bb)&&existsSync(resolve(_0x506f3a,_0x55761e[_0x174342(0x100)+_0x174342(0x2c9)])));if(_0x4143bd){_0x2de83d[_0x174342(0x2e8)](_0x4143bd);continue;}_0x2de83d[_0x174342(0x2e8)](await installPluginFromNpmSpec(_0x2499b9,_0x103263,_0x20f146));}const _0x41c3dc=new Set(_0x4b0968[_0x174342(0x21d)][_0x174342(0x23e)+_0x174342(0xbb)]['map'](resolvePackageNameFromNpmSpec)),_0x1d7085=_0x49b28c[_0x174342(0x254)](_0x1b1110=>_0x1b1110?.['source']!==_0x174342(0x17d)||!_0x41c3dc['has'](resolvePackageNameFromNpmSpec(_0x1b1110[_0x174342(0x214)+_0x174342(0x256)]||_0x1b1110[_0x174342(0x203)]||'')));_0x3c5562[_0x174342(0x218)]=[..._0x1d7085,..._0x2de83d];}function hasRuntimeDependencies(_0x4a1b28){const _0x21a0c4=_0x3d918c,_0x7c2198=_0x4a1b28?.[_0x21a0c4(0x176)+_0x21a0c4(0x97)]&&typeof _0x4a1b28[_0x21a0c4(0x176)+_0x21a0c4(0x97)]===_0x21a0c4(0x112)?Object[_0x21a0c4(0x269)](_0x4a1b28[_0x21a0c4(0x176)+_0x21a0c4(0x97)]):[],_0x228017=_0x4a1b28?.[_0x21a0c4(0x322)+'Dependen'+'cies']&&typeof _0x4a1b28['optional'+_0x21a0c4(0x24a)+_0x21a0c4(0x97)]===_0x21a0c4(0x112)?Object[_0x21a0c4(0x269)](_0x4a1b28[_0x21a0c4(0x322)+_0x21a0c4(0x24a)+'cies']):[];return _0x7c2198[_0x21a0c4(0xde)]>0x0||_0x228017[_0x21a0c4(0xde)]>0x0;}async function installLocalPluginRuntimeDependencies(_0x24c84a,_0x4cbbfe,_0x3bb5c1){const _0x415853=_0x3d918c,_0xb8a561=join(_0x24c84a,'package.'+'json'),_0x564b85=await readJson(_0xb8a561,{});(_0x564b85[_0x415853(0xed)+'dencies']||_0x564b85[_0x415853(0x266)])&&(delete _0x564b85[_0x415853(0xed)+_0x415853(0x20d)],delete _0x564b85[_0x415853(0x266)],await writeJson(_0xb8a561,_0x564b85));if(!hasRuntimeDependencies(_0x564b85))return;const _0xb58ec0=await createRuntimeEnv(_0x4cbbfe);console['log'](_0x415853(0xbc)+_0x415853(0x2a9)+_0x415853(0x12c)+'stalling'+_0x415853(0x14f)+_0x415853(0xc5)+_0x415853(0x1ad)+_0x415853(0x2ca)+_0x24c84a),await runProcess(_0x4cbbfe[_0x415853(0x334)+_0x415853(0x219)],[_0x4cbbfe[_0x415853(0x1e5)],_0x415853(0x312),'--omit=d'+'ev',_0x415853(0x210)+_0x415853(0xc1),_0x415853(0x261)+'it',_0x415853(0x144)+'d',_0x415853(0x108)+_0x415853(0x2f5)+'ps'],{'cwd':_0x24c84a,'env':_0xb58ec0,'label':_0x415853(0xf0)+_0x415853(0xd4)+_0x415853(0x145)+'\x20'+_0x24c84a}),_0x3bb5c1[_0x415853(0x285)+_0x415853(0x10a)]?.[_0x415853(0xc9)](_0x415853(0x1aa)+_0x415853(0x27d)+_0x415853(0x238)+_0x415853(0xd5)+_0x415853(0x179),{'installPath':_0x24c84a});}async function syncSharedPluginModules(_0x29c3e7,_0x595596){const _0x145487=_0x3d918c,_0x3b9738=new Set();for(const _0x1d6cc0 of _0x29c3e7){const _0x394fbe=join(dirname(_0x1d6cc0),_0x145487(0x125));if(existsSync(_0x394fbe))_0x3b9738['add'](_0x394fbe);}for(const _0x7d5bc0 of _0x3b9738){await copyDirFresh(_0x7d5bc0,join(_0x595596,'_shared'));}}async function syncProductPlugins(_0x3e6f03,_0x2d09bc,_0x24add9,_0xfeade9={}){const _0x19e251=_0x3d918c,_0x296505=join(_0x2d09bc,_0x19e251(0x21d),_0x19e251(0x315),'extensio'+'ns'),_0x5dbbfd=createRuntimeInfoFromManifest(_0x2d09bc,_0x24add9),_0x2f1f47=[];await syncSharedPluginModules(_0x3e6f03[_0x19e251(0x21d)][_0x19e251(0x214)+_0x19e251(0x20f)+'ginPaths'],_0x296505);for(const _0x38db54 of _0x3e6f03[_0x19e251(0x21d)]['resolved'+_0x19e251(0x20f)+_0x19e251(0x2fe)]){const _0x228272=await getPackageMetadata(_0x38db54),_0x209915=await readPluginManifest(_0x38db54),_0x1250fa=join(_0x296505,_0x228272[_0x19e251(0x208)]);await copyDirFresh(_0x38db54,_0x1250fa),await installLocalPluginRuntimeDependencies(_0x1250fa,_0x5dbbfd,_0xfeade9),_0x2f1f47['push']({'pluginId':_0x228272[_0x19e251(0x208)],'source':_0x19e251(0x2c3),'spec':_0x19e251(0x124)+_0x38db54,'installPath':toRuntimeRelative(_0x2d09bc,_0x1250fa),'version':_0x228272[_0x19e251(0xae)],'resolvedName':_0x228272['name'],'resolvedVersion':_0x228272[_0x19e251(0xae)],'resolvedSpec':_0x19e251(0x124)+_0x38db54,'integrity':'','shasum':'','resolvedAt':new Date()[_0x19e251(0xb8)+_0x19e251(0x120)](),'installedAt':new Date()[_0x19e251(0xb8)+_0x19e251(0x120)](),'agentScope':_0x209915[_0x19e251(0x148)+'pe'],'skills':_0x209915[_0x19e251(0x1ed)]});}const _0x23a882=new Set(_0x2f1f47[_0x19e251(0x1f6)](_0x4f3ef0=>_0x4f3ef0[_0x19e251(0x208)])),_0x3466fc=Array[_0x19e251(0x233)](_0x24add9[_0x19e251(0x218)])?_0x24add9['plugins'][_0x19e251(0x254)](_0x434975=>!_0x23a882[_0x19e251(0x2b5)](_0x434975['pluginId'])):[];_0x24add9[_0x19e251(0x218)]=[..._0x3466fc,..._0x2f1f47];}async function syncManifestPluginScope(_0x4c5bb3,_0x2b08cb,_0x635692){const _0x4bc81c=_0x3d918c,_0x4f82a8=join(_0x2b08cb,_0x4bc81c(0x21d),_0x4bc81c(0x315),_0x4bc81c(0xe1)+'ns'),_0x2a5870=new Set(_0x4c5bb3[_0x4bc81c(0x21d)]['pluginSp'+_0x4bc81c(0xbb)]??[]),_0x279fa4=new Set([..._0x2a5870][_0x4bc81c(0x1f6)](_0xfcf527=>_0xfcf527[_0x4bc81c(0x1d7)](/^npm:/,''))[_0x4bc81c(0x1f6)](_0x228b38=>{const _0x480530=_0x4bc81c;if(_0x228b38[_0x480530(0x1c6)+'th']('@')){const _0xcb2018=_0x228b38[_0x480530(0x1fb)]('@');return _0xcb2018[_0x480530(0xde)]>=0x3?'@'+_0xcb2018[0x1]:_0x228b38;}return _0x228b38[_0x480530(0x1fb)]('@')[0x0];})[_0x4bc81c(0x254)](Boolean)),_0x3fca7a=new Set();for(const _0x5cbd3f of _0x4c5bb3[_0x4bc81c(0x21d)][_0x4bc81c(0x214)+_0x4bc81c(0x20f)+_0x4bc81c(0x2fe)]){const _0x3e26e5=await getPackageMetadata(_0x5cbd3f);if(_0x3e26e5['pluginId'])_0x3fca7a[_0x4bc81c(0x2cb)](_0x3e26e5[_0x4bc81c(0x208)]);}const _0x3b808c=Array[_0x4bc81c(0x233)](_0x635692['plugins'])?_0x635692[_0x4bc81c(0x218)]:[];_0x635692[_0x4bc81c(0x23e)+_0x4bc81c(0xbb)]=[..._0x4c5bb3[_0x4bc81c(0x21d)][_0x4bc81c(0x23e)+_0x4bc81c(0xbb)],..._0x4c5bb3[_0x4bc81c(0x21d)][_0x4bc81c(0x214)+_0x4bc81c(0x20f)+'ginPaths'][_0x4bc81c(0x1f6)](_0x24fb78=>_0x4bc81c(0x124)+_0x24fb78)],_0x635692[_0x4bc81c(0x218)]=_0x3b808c[_0x4bc81c(0x254)](_0x829dd3=>{const _0x3d3199=_0x4bc81c;if(!_0x829dd3||typeof _0x829dd3!==_0x3d3199(0x112))return![];if(_0x829dd3[_0x3d3199(0x96)]===_0x3d3199(0x2c3))return _0x3fca7a[_0x3d3199(0x2b5)](_0x829dd3['pluginId']);if(_0x829dd3[_0x3d3199(0x96)]==='npm')return _0x2a5870[_0x3d3199(0x2b5)](_0x829dd3[_0x3d3199(0x203)])||_0x2a5870['has'](_0x829dd3['resolved'+_0x3d3199(0x228)])||_0x279fa4[_0x3d3199(0x2b5)](_0x829dd3[_0x3d3199(0x214)+_0x3d3199(0x256)]);return![];});const _0xef6254=new Set(_0x635692['plugins'][_0x4bc81c(0x1f6)](_0x5684c4=>_0x5684c4[_0x4bc81c(0x208)]));for(const _0x42455a of _0x3b808c){if(!_0x42455a[_0x4bc81c(0x208)]||_0xef6254[_0x4bc81c(0x2b5)](_0x42455a[_0x4bc81c(0x208)]))continue;const _0x481d23=typeof _0x42455a['installP'+_0x4bc81c(0x2c9)]==='string'&&_0x42455a[_0x4bc81c(0x100)+'ath']['trim']()?resolve(_0x2b08cb,_0x42455a[_0x4bc81c(0x100)+_0x4bc81c(0x2c9)]):join(_0x4f82a8,_0x42455a[_0x4bc81c(0x208)]),_0x8192ba=relative(_0x4f82a8,_0x481d23);if(_0x8192ba[_0x4bc81c(0x1c6)+'th']('..')||_0x8192ba==='')continue;await rm(_0x481d23,{'recursive':!![],'force':!![]});}}async function collectCapabilityEntries(_0x24e0b1,_0x25de40){const _0x142b7d=_0x3d918c,_0x25bc99=new Map();for(const _0x4e93a7 of _0x24e0b1){let _0x192d4c;try{_0x192d4c=await stat(_0x4e93a7);}catch{throw new Error(_0x25de40+(_0x142b7d(0xf4)+_0x142b7d(0x1f9)+_0x142b7d(0x1e4))+_0x4e93a7);}if(!_0x192d4c['isDirect'+'ory']())throw new Error(_0x25de40+(_0x142b7d(0x16c)+_0x142b7d(0xb5)+_0x142b7d(0x245)+_0x142b7d(0x13a))+_0x4e93a7);const _0x14d2cb={'name':basename(_0x4e93a7),'path':_0x4e93a7},_0x1a725b=_0x25bc99[_0x142b7d(0x311)](_0x14d2cb['name']);if(_0x1a725b)throw new Error(_0x142b7d(0xca)+'e\x20'+_0x25de40+_0x142b7d(0x20c)+_0x14d2cb['name']+'\x22\x20from\x20'+_0x1a725b[_0x142b7d(0x32a)]+_0x142b7d(0x1f3)+_0x14d2cb[_0x142b7d(0x32a)]);_0x25bc99[_0x142b7d(0x28d)](_0x14d2cb[_0x142b7d(0x22d)],_0x14d2cb);}return[..._0x25bc99[_0x142b7d(0x13e)]()];}async function syncProductCapabilityDirs(_0x59fa09,_0x12344d,_0x1506d3){const _0x476565=_0x3d918c,_0x2f36c4=await collectCapabilityEntries(_0x59fa09,_0x1506d3);await rm(_0x12344d,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await mkdir(_0x12344d,{'recursive':!![]});for(const _0x9307be of _0x2f36c4){await cp(_0x9307be[_0x476565(0x32a)],join(_0x12344d,_0x9307be[_0x476565(0x22d)]),{'recursive':!![]});}return _0x2f36c4[_0x476565(0xde)];}export const __test__={'collectCapabilityEntries':collectCapabilityEntries,'prunePackagedRuntimePayload':prunePackagedRuntimePayload,'syncProductCapabilityDirs':syncProductCapabilityDirs,'resolveNodeExtractRoot':resolveNodeExtractRoot};async function syncProductAgents(_0x5041fe,_0x5cd989,_0xe1a1db){const _0x10723f=_0x3d918c,_0x1573c5=join(_0x5cd989,'openclaw',_0x10723f(0x337)),_0x3bf946=await syncProductCapabilityDirs(_0x5041fe[_0x10723f(0x21d)][_0x10723f(0x214)+_0x10723f(0x139)+_0x10723f(0x1db)],_0x1573c5,_0x10723f(0x1cc));_0xe1a1db['agents']={'source':_0x10723f(0x1c5),'installPath':toRuntimeRelative(_0x5cd989,_0x1573c5),'localPaths':_0x5041fe['openclaw'][_0x10723f(0x214)+_0x10723f(0x139)+_0x10723f(0x1db)],'entryCount':_0x3bf946};}async function syncProductSkills(_0x57e7ed,_0x5d799d,_0x2a106d){const _0x3b57b1=_0x3d918c,_0x5eaf9c=join(_0x5d799d,_0x3b57b1(0x21d),'skills'),_0x105679=await syncProductCapabilityDirs(_0x57e7ed[_0x3b57b1(0x21d)][_0x3b57b1(0x214)+'LocalSki'+_0x3b57b1(0x13b)],_0x5eaf9c,'skill');_0x2a106d[_0x3b57b1(0x1ed)]={'source':_0x3b57b1(0x1c5),'installPath':toRuntimeRelative(_0x5d799d,_0x5eaf9c),'localPaths':_0x57e7ed[_0x3b57b1(0x21d)]['resolved'+_0x3b57b1(0x2bf)+_0x3b57b1(0x13b)],'entryCount':_0x105679};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x17d3a7,_0xb5152c){const _0x440bc7=_0x2764,_0x3a5d4a=_0x17d3a7();while(!![]){try{const _0x1e9aaf=parseInt(_0x440bc7(0x15a))/0x1+parseInt(_0x440bc7(0x1a8))/0x2+-parseInt(_0x440bc7(0x1b2))/0x3+-parseInt(_0x440bc7(0x1e5))/0x4*(parseInt(_0x440bc7(0x1cb))/0x5)+-parseInt(_0x440bc7(0x1de))/0x6*(parseInt(_0x440bc7(0x1c7))/0x7)+parseInt(_0x440bc7(0x1c5))/0x8*(-parseInt(_0x440bc7(0x191))/0x9)+parseInt(_0x440bc7(0x167))/0xa;if(_0x1e9aaf===_0xb5152c)break;else _0x3a5d4a['push'](_0x3a5d4a['shift']());}catch(_0x9a5aee){_0x3a5d4a['push'](_0x3a5d4a['shift']());}}}(_0x5043,0xea6c9));export function patchChannelPluginRuntimeFromSource(_0x31ba3a,_0x4a23a5={}){const _0x2aa90b=_0x2764,_0x4cf466=_0x4a23a5[_0x2aa90b(0x1e1)+_0x2aa90b(0x1b5)+_0x2aa90b(0x174)];if(!_0x4cf466)return{'patched':![],'reason':_0x2aa90b(0x180)+_0x2aa90b(0x1ca)+_0x2aa90b(0x17d)+'ot-provi'+_0x2aa90b(0x163)};if(_0x31ba3a[_0x2aa90b(0x1da)](_0x2aa90b(0x1bd)+_0x2aa90b(0x1cc)+'meChanne'+'l')){if(_0x31ba3a[_0x2aa90b(0x1da)](_0x2aa90b(0x1d4)+_0x2aa90b(0x1c2)+'annel.tu'+_0x2aa90b(0x19b))&&hasRuntimeChannelImport(_0x31ba3a,_0x4cf466))return{'patched':![],'reason':'already-'+_0x2aa90b(0x15c)};return patchExistingChannelPluginRuntimeFromSource(_0x31ba3a,{'runtimeChannelImportPath':_0x4cf466});}if(_0x31ba3a[_0x2aa90b(0x1da)](_0x2aa90b(0x171)+'nnelRunt'+_0x2aa90b(0x168)+'se'))return patchExistingChannelPluginRuntimeFromSource(_0x31ba3a,{'runtimeChannelImportPath':_0x4cf466});const _0x53a968=_0x2aa90b(0x14c)+'solvedRu'+_0x2aa90b(0x18f)+'null;\x0a\x09\x09'+_0x2aa90b(0x170)+'solveRun'+_0x2aa90b(0x1d6)+_0x2aa90b(0x18a)+_0x2aa90b(0x159)+_0x2aa90b(0x1b8)+'e\x20??=\x20re'+_0x2aa90b(0x1e4)+'atePlugi'+_0x2aa90b(0x14e)+_0x2aa90b(0x1d3)+_0x2aa90b(0x178)+'meOption'+_0x2aa90b(0x157)+_0x2aa90b(0x1d1)+_0x2aa90b(0x19e)+_0x2aa90b(0x1be)+_0x2aa90b(0x184);if(!_0x31ba3a[_0x2aa90b(0x1da)](_0x53a968))return{'patched':![],'reason':_0x2aa90b(0x199)+'d'};const _0x3c88ee=_0x2aa90b(0x17a)+_0x2aa90b(0x18d)+'ash\x20}\x20fr'+'om\x20\x22node'+_0x2aa90b(0x173)+';';if(!_0x31ba3a[_0x2aa90b(0x1da)](_0x3c88ee))return{'patched':![],'reason':_0x2aa90b(0x17d)+_0x2aa90b(0x144)};const _0x3ba20a='\x09\x09let\x20re'+_0x2aa90b(0x19e)+_0x2aa90b(0x18f)+_0x2aa90b(0x16d)+_0x2aa90b(0x172)+_0x2aa90b(0x179)+_0x2aa90b(0x1ab)+_0x2aa90b(0x162)+'elpers\x20='+_0x2aa90b(0x18e)+_0x2aa90b(0x196)+_0x2aa90b(0x1c1)+_0x2aa90b(0x198)+_0x2aa90b(0x1e2)+_0x2aa90b(0x195)+_0x2aa90b(0x18c)+_0x2aa90b(0x16a)+_0x2aa90b(0x1dd)+_0x2aa90b(0x19c)+_0x2aa90b(0x1a0)+'untime.c'+'hannel?.'+_0x2aa90b(0x147)+_0x2aa90b(0x145)+_0x2aa90b(0x15e)+_0x2aa90b(0x155)+_0x2aa90b(0x1c3)+'un)\x20retu'+_0x2aa90b(0x1a5)+_0x2aa90b(0x15f)+_0x2aa90b(0x164)+'nnelRunt'+'ime\x20=\x20wu'+'jieCreat'+_0x2aa90b(0x181)+_0x2aa90b(0x146)+');\x0a\x09\x09\x09co'+_0x2aa90b(0x1a3)+_0x2aa90b(0x14d)+_0x2aa90b(0x1b0)+_0x2aa90b(0x1b3)+_0x2aa90b(0x152)+_0x2aa90b(0x15d)+_0x2aa90b(0x158)+_0x2aa90b(0x1db)+'===\x20\x22obj'+_0x2aa90b(0x1ae)+_0x2aa90b(0x154)+'hannel\x20:'+'\x20{};\x0a\x09\x09\x09'+'runtime.'+_0x2aa90b(0x1db)+_0x2aa90b(0x1b4)+_0x2aa90b(0x17c)+_0x2aa90b(0x1b9)+'e,\x0a\x09\x09\x09\x09.'+_0x2aa90b(0x1b6)+_0x2aa90b(0x1ba)+_0x2aa90b(0x16c)+_0x2aa90b(0x1c0)+_0x2aa90b(0x1c9)+_0x2aa90b(0x1af)+_0x2aa90b(0x149)+_0x2aa90b(0x1e1)+_0x2aa90b(0x1bc)+_0x2aa90b(0x1cd)+_0x2aa90b(0x1b9)+_0x2aa90b(0x156)+_0x2aa90b(0x17b)+_0x2aa90b(0x14a)+_0x2aa90b(0x150)+'existing'+_0x2aa90b(0x149)+'inbound\x20'+'??\x20chann'+'elRuntim'+'e.inboun'+_0x2aa90b(0x1e3)+_0x2aa90b(0x160)+_0x2aa90b(0x1d7)+_0x2aa90b(0x165)+'n\x20??\x20exi'+_0x2aa90b(0x1d7)+_0x2aa90b(0x1bb)+'ound\x20??\x20'+_0x2aa90b(0x183)+_0x2aa90b(0x16e)+_0x2aa90b(0x17f)+_0x2aa90b(0x1d9)+'ntime.in'+'bound,\x0a\x09'+_0x2aa90b(0x19a)+_0x2aa90b(0x1a2)+'ngChanne'+'l.reply\x20'+_0x2aa90b(0x1cd)+_0x2aa90b(0x1b9)+'e.reply,'+'\x0a\x09\x09\x09\x09ses'+'sion:\x20ex'+_0x2aa90b(0x1c2)+_0x2aa90b(0x169)+_0x2aa90b(0x18b)+'\x20channel'+_0x2aa90b(0x1d2)+'session\x0a'+_0x2aa90b(0x148)+_0x2aa90b(0x1a9)+_0x2aa90b(0x1d0)+_0x2aa90b(0x177)+_0x2aa90b(0x170)+_0x2aa90b(0x151)+_0x2aa90b(0x1d6)+_0x2aa90b(0x18a)+'\x09\x09resolv'+_0x2aa90b(0x1b8)+_0x2aa90b(0x1c6)+_0x2aa90b(0x179)+_0x2aa90b(0x1ab)+_0x2aa90b(0x162)+_0x2aa90b(0x17e)+_0x2aa90b(0x1df)+'eatePlug'+'inRuntim'+'e()(opti'+(_0x2aa90b(0x16f)+_0x2aa90b(0x1bf)+_0x2aa90b(0x187)+_0x2aa90b(0x1a9)+_0x2aa90b(0x143)+_0x2aa90b(0x19f)+_0x2aa90b(0x15b));return{'patched':!![],'source':_0x31ba3a[_0x2aa90b(0x192)](_0x3c88ee,_0x3c88ee+'\x0a'+createRuntimeChannelImport(_0x4cf466))[_0x2aa90b(0x192)](_0x53a968,_0x3ba20a)};}function patchExistingChannelPluginRuntimeFromSource(_0x4a233d,_0x99ecfa){const _0x1c1837=_0x2764,{runtimeChannelImportPath:_0x48201f}=_0x99ecfa,_0x15f2bf='import\x20{'+_0x1c1837(0x18d)+_0x1c1837(0x188)+'om\x20\x22node'+':crypto\x22'+';';if(!_0x4a233d[_0x1c1837(0x1da)](_0x15f2bf))return{'patched':![],'reason':_0x1c1837(0x17d)+_0x1c1837(0x144)};const _0x8701a5=_0x1c1837(0x14c)+_0x1c1837(0x19e)+_0x1c1837(0x18f)+'null;',_0x902b78='\x09\x09const\x20'+'lazyRunt'+_0x1c1837(0x194)+'ctionKey'+_0x1c1837(0x1c8)+_0x1c1837(0x16b)+_0x1c1837(0x1a6)+_0x1c1837(0x1a4)+_0x1c1837(0x182)+_0x1c1837(0x1ac),_0x4e05bf=_0x4a233d[_0x1c1837(0x1b1)](_0x8701a5),_0x24ca72=_0x4a233d['indexOf'](_0x902b78,_0x4e05bf);if(_0x4e05bf===-0x1||_0x24ca72===-0x1)return{'patched':![],'reason':_0x1c1837(0x199)+'d'};const _0x2c0975=_0x1c1837(0x14c)+_0x1c1837(0x19e)+'ntime\x20=\x20'+'null;\x0a\x09\x09'+_0x1c1837(0x172)+_0x1c1837(0x179)+'eChannel'+_0x1c1837(0x162)+'elpers\x20='+'\x20(runtim'+'e)\x20=>\x20{\x0a'+'\x09\x09\x09if\x20(!'+_0x1c1837(0x198)+_0x1c1837(0x1e2)+_0x1c1837(0x195)+'e\x20!==\x20\x22o'+_0x1c1837(0x16a)+_0x1c1837(0x1dd)+_0x1c1837(0x19c)+_0x1c1837(0x1a0)+_0x1c1837(0x154)+_0x1c1837(0x153)+_0x1c1837(0x147)+_0x1c1837(0x145)+_0x1c1837(0x15e)+_0x1c1837(0x155)+_0x1c1837(0x1c3)+_0x1c1837(0x1dc)+_0x1c1837(0x1a5)+_0x1c1837(0x15f)+_0x1c1837(0x164)+_0x1c1837(0x166)+_0x1c1837(0x1ad)+'jieCreat'+_0x1c1837(0x181)+_0x1c1837(0x146)+_0x1c1837(0x1a7)+_0x1c1837(0x1a3)+_0x1c1837(0x14d)+_0x1c1837(0x1b0)+_0x1c1837(0x1b3)+_0x1c1837(0x152)+_0x1c1837(0x15d)+'runtime.'+_0x1c1837(0x1db)+'===\x20\x22obj'+_0x1c1837(0x1ae)+_0x1c1837(0x154)+_0x1c1837(0x19d)+_0x1c1837(0x1e0)+_0x1c1837(0x158)+_0x1c1837(0x1db)+_0x1c1837(0x1b4)+_0x1c1837(0x17c)+_0x1c1837(0x1b9)+_0x1c1837(0x190)+_0x1c1837(0x1b6)+_0x1c1837(0x1ba)+_0x1c1837(0x16c)+'untimeCo'+_0x1c1837(0x1c9)+'existing'+'Channel.'+_0x1c1837(0x1e1)+_0x1c1837(0x1bc)+_0x1c1837(0x1cd)+_0x1c1837(0x1b9)+'e.runtim'+_0x1c1837(0x17b)+_0x1c1837(0x14a)+_0x1c1837(0x150)+_0x1c1837(0x1af)+_0x1c1837(0x149)+_0x1c1837(0x1d8)+_0x1c1837(0x1cd)+_0x1c1837(0x1b9)+_0x1c1837(0x14b)+_0x1c1837(0x1e3)+_0x1c1837(0x160)+_0x1c1837(0x1d7)+_0x1c1837(0x165)+'n\x20??\x20exi'+_0x1c1837(0x1d7)+_0x1c1837(0x1bb)+_0x1c1837(0x185)+_0x1c1837(0x183)+'untime.t'+_0x1c1837(0x17f)+_0x1c1837(0x1d9)+_0x1c1837(0x1b7)+_0x1c1837(0x1d5)+_0x1c1837(0x19a)+':\x20existi'+_0x1c1837(0x1ba)+_0x1c1837(0x1e6)+_0x1c1837(0x1cd)+_0x1c1837(0x1b9)+'e.reply,'+_0x1c1837(0x1cf)+_0x1c1837(0x1e7)+_0x1c1837(0x1c2)+_0x1c1837(0x169)+_0x1c1837(0x18b)+_0x1c1837(0x1c4)+_0x1c1837(0x1d2)+'session\x0a'+_0x1c1837(0x148)+_0x1c1837(0x1a9)+_0x1c1837(0x1d0)+'\x0a\x09\x09};\x0a\x09\x09'+_0x1c1837(0x170)+'solveRun'+_0x1c1837(0x1d6)+')\x20=>\x20{\x0a\x09'+'\x09\x09resolv'+_0x1c1837(0x1b8)+_0x1c1837(0x1c6)+_0x1c1837(0x179)+_0x1c1837(0x1ab)+_0x1c1837(0x162)+'elpers(r'+_0x1c1837(0x1df)+_0x1c1837(0x1ce)+_0x1c1837(0x189)+_0x1c1837(0x1aa)+(_0x1c1837(0x16f)+'imeOptio'+_0x1c1837(0x187)+'\x09return\x20'+_0x1c1837(0x143)+_0x1c1837(0x19f)+_0x1c1837(0x197)),_0x1cf9eb=_0x4a233d['slice'](0x0,_0x4e05bf)+_0x2c0975+_0x4a233d['slice'](_0x24ca72);return{'patched':!![],'source':ensureRuntimeChannelImport(_0x1cf9eb,{'importMarker':_0x15f2bf,'runtimeChannelImportPath':_0x48201f})};}function createRuntimeChannelImport(_0x2c3f9a){const _0x3d965a=_0x2764;return'import\x20{'+_0x3d965a(0x193)+_0x3d965a(0x175)+'annel\x20as'+_0x3d965a(0x176)+_0x3d965a(0x14f)+_0x3d965a(0x1a1)+_0x3d965a(0x161)+_0x3d965a(0x186)+_0x2c3f9a+'\x22;';}function _0x2764(_0x619e8a,_0x510de9){_0x619e8a=_0x619e8a-0x143;const _0x50439b=_0x5043();let _0x2764da=_0x50439b[_0x619e8a];return _0x2764da;}function _0x5043(){const _0x13bbbc=['e()(opti','eChannel','YS);','ime\x20=\x20wu','ect\x22\x20?\x20r','existing','nel\x20=\x20ru','indexOf','3972921CsIZwq','ntime.ch','=\x20{\x0a\x09\x09\x09\x09','hannelIm','..existi','ntime.in','edRuntim','elRuntim','ngChanne','nnel.inb','ontexts\x20','wujieCre','ntime;\x0a\x09','imeOptio','untimeCo','\x09\x09\x09if\x20(!','istingCh','bound?.r','\x20channel','9977512VKEpTK','e\x20??=\x20en','1778LRNdhQ','Set\x20=\x20ne','ntexts:\x20','channel-','60CSAZIl','ateRunti','??\x20chann','eatePlug','\x0a\x09\x09\x09\x09ses','runtime;','eturn\x20re','Runtime.','()(optio','turn:\x20ex','bound,\x0a\x09','time\x20=\x20(','stingCha','inbound\x20','hannelRu','includes','channel\x20','un)\x20retu','return\x20r','9642QMZRMU','esolveCr','\x20{};\x0a\x09\x09\x09','runtimeC','||\x20typeo','d,\x0a\x09\x09\x09\x09t','solveCre','297068TdqjPa','l.reply\x20','sion:\x20ex','resolved','ot-found','n\x20&&\x20run','Channel(','turn?.ru','\x09\x09\x09};\x0a\x09\x09','Channel.','s,\x0a\x09\x09\x09\x09i','e.inboun','\x09\x09let\x20re','tingChan','nRuntime','eateRunt','nbound:\x20','solveRun','annel\x20&&','hannel?.','untime.c','nnel?.in','e.runtim','s);\x0a\x09\x09\x09r','runtime.','\x09\x09resolv','117777orgHXU','\x0a\x09\x09};','patched','\x20typeof\x20','time.cha','me;\x0a\x09\x09\x09c','urn:\x20exi','el\x20}\x20fro','RuntimeH','ded','onst\x20cha','nnel.tur','nnelRunt','34305950ZfMAIf','imePromi','annel.se','bject\x22)\x20','w\x20Set(LA','l,\x0a\x09\x09\x09\x09r','null;\x0a\x09\x09','untime.t','ons.runt','const\x20re','wujieCha','const\x20en',':crypto\x22','portPath','untimeCh','\x20wujieCr','\x0a\x09\x09};\x0a\x09\x09','ns.runti','sureWuji','import\x20{','eContext','...chann','import-n','elpers(r','urn\x20??\x20c','runtime-','eRuntime','CTION_KE','channelR','\x09};','ound\x20??\x20','m\x20\x22','ns));\x0a\x09\x09','ash\x20}\x20fr','inRuntim',')\x20=>\x20{\x0a\x09','ssion\x20??','e\x20!==\x20\x22o','\x20createH','\x20(runtim','ntime\x20=\x20','e,\x0a\x09\x09\x09\x09.','9aeufBi','replace','\x20createR','imeRefle','f\x20runtim','e)\x20=>\x20{\x0a','\x0a\x09\x09};\x0a','runtime\x20','not-foun','\x09\x09\x09reply','rn\x20??','untime;\x0a','hannel\x20:','solvedRu','Runtime;','\x09\x09\x09if\x20(r','imeChann',':\x20existi','nst\x20exis','ME_REFLE','rn\x20runti','ZY_RUNTI',');\x0a\x09\x09\x09co','2565414IIdWEF','\x09return\x20'];_0x5043=function(){return _0x13bbbc;};return _0x5043();}function hasRuntimeChannelImport(_0x315a03,_0x597ca8){const _0x50f5be=_0x2764;return _0x315a03[_0x50f5be(0x1da)](createRuntimeChannelImport(_0x597ca8));}function ensureRuntimeChannelImport(_0x217a74,{importMarker:_0x50f2bc,runtimeChannelImportPath:_0xde4ccb}){const _0x357cde=_0x2764,_0x20ced1=createRuntimeChannelImport(_0xde4ccb),_0x194607=/import \{ createRuntimeChannel as wujieCreateRuntimeChannel \} from "\.\/runtime-channel-[^"]+\.js";\n?/;if(_0x194607['test'](_0x217a74))return _0x217a74[_0x357cde(0x192)](_0x194607,_0x20ced1+'\x0a');return _0x217a74['replace'](_0x50f2bc,_0x50f2bc+'\x0a'+_0x20ced1);}
|
|
1
|
+
(function(_0x51e222,_0x4963f2){const _0x5976b1=_0xfd0a,_0x134ccc=_0x51e222();while(!![]){try{const _0xc80241=-parseInt(_0x5976b1(0x267))/0x1+parseInt(_0x5976b1(0x249))/0x2*(parseInt(_0x5976b1(0x1d7))/0x3)+-parseInt(_0x5976b1(0x1e2))/0x4+parseInt(_0x5976b1(0x23b))/0x5*(parseInt(_0x5976b1(0x26a))/0x6)+parseInt(_0x5976b1(0x239))/0x7+parseInt(_0x5976b1(0x25e))/0x8*(parseInt(_0x5976b1(0x251))/0x9)+-parseInt(_0x5976b1(0x20b))/0xa*(parseInt(_0x5976b1(0x1ea))/0xb);if(_0xc80241===_0x4963f2)break;else _0x134ccc['push'](_0x134ccc['shift']());}catch(_0x42ade4){_0x134ccc['push'](_0x134ccc['shift']());}}}(_0x3a95,0xf0383));export function patchChannelPluginRuntimeFromSource(_0x3c19ac,_0x3a3dee={}){const _0x21d64d=_0xfd0a,_0x270970=_0x3a3dee[_0x21d64d(0x244)+'hannelIm'+_0x21d64d(0x272)];if(!_0x270970)return{'patched':![],'reason':'runtime-'+'channel-'+_0x21d64d(0x1f3)+'ot-provi'+'ded'};if(_0x3c19ac[_0x21d64d(0x1fc)](_0x21d64d(0x221)+'ateRunti'+'meChanne'+'l')){if(_0x3c19ac['includes'](_0x21d64d(0x1e0)+'istingCh'+_0x21d64d(0x204)+_0x21d64d(0x1f4))&&hasRuntimeChannelImport(_0x3c19ac,_0x270970))return{'patched':![],'reason':'already-'+_0x21d64d(0x1fd)};return patchExistingChannelPluginRuntimeFromSource(_0x3c19ac,{'runtimeChannelImportPath':_0x270970});}if(_0x3c19ac[_0x21d64d(0x1fc)](_0x21d64d(0x23d)+_0x21d64d(0x20c)+_0x21d64d(0x230)+'se'))return patchExistingChannelPluginRuntimeFromSource(_0x3c19ac,{'runtimeChannelImportPath':_0x270970});const _0x5c8c73=_0x21d64d(0x254)+_0x21d64d(0x269)+_0x21d64d(0x278)+_0x21d64d(0x1de)+_0x21d64d(0x22a)+_0x21d64d(0x241)+_0x21d64d(0x223)+_0x21d64d(0x24d)+_0x21d64d(0x225)+_0x21d64d(0x234)+_0x21d64d(0x1ee)+_0x21d64d(0x259)+_0x21d64d(0x211)+_0x21d64d(0x1e1)+_0x21d64d(0x21f)+_0x21d64d(0x228)+_0x21d64d(0x220)+_0x21d64d(0x208)+_0x21d64d(0x243)+_0x21d64d(0x269)+_0x21d64d(0x25b)+_0x21d64d(0x24b);if(!_0x3c19ac[_0x21d64d(0x1fc)](_0x5c8c73))return{'patched':![],'reason':_0x21d64d(0x257)+'d'};const _0x5590cf=_0x21d64d(0x23c)+'\x20createH'+_0x21d64d(0x205)+'om\x20\x22node'+':crypto\x22'+';';if(!_0x3c19ac[_0x21d64d(0x1fc)](_0x5590cf))return{'patched':![],'reason':_0x21d64d(0x1f3)+_0x21d64d(0x1f5)};const _0x1be336=_0x21d64d(0x254)+_0x21d64d(0x269)+_0x21d64d(0x278)+'null;\x0a\x09\x09'+_0x21d64d(0x246)+_0x21d64d(0x1db)+'eChannel'+_0x21d64d(0x1fe)+_0x21d64d(0x21b)+_0x21d64d(0x1f9)+_0x21d64d(0x23e)+_0x21d64d(0x202)+'runtime\x20'+_0x21d64d(0x260)+_0x21d64d(0x201)+_0x21d64d(0x24f)+_0x21d64d(0x258)+_0x21d64d(0x224)+_0x21d64d(0x1f1)+_0x21d64d(0x1dd)+'untime.c'+_0x21d64d(0x20e)+'turn?.ru'+'n\x20&&\x20run'+_0x21d64d(0x235)+_0x21d64d(0x25f)+_0x21d64d(0x1e5)+_0x21d64d(0x1e8)+_0x21d64d(0x214)+_0x21d64d(0x26b)+'onst\x20cha'+_0x21d64d(0x20c)+_0x21d64d(0x200)+_0x21d64d(0x1fb)+_0x21d64d(0x24c)+_0x21d64d(0x275)+_0x21d64d(0x1e4)+_0x21d64d(0x233)+_0x21d64d(0x1ed)+_0x21d64d(0x23a)+_0x21d64d(0x1d3)+_0x21d64d(0x270)+_0x21d64d(0x20d)+_0x21d64d(0x253)+_0x21d64d(0x279)+'===\x20\x22obj'+'ect\x22\x20?\x20r'+_0x21d64d(0x24e)+_0x21d64d(0x1eb)+_0x21d64d(0x250)+_0x21d64d(0x253)+'channel\x20'+_0x21d64d(0x248)+_0x21d64d(0x217)+_0x21d64d(0x242)+_0x21d64d(0x271)+'..existi'+'ngChanne'+_0x21d64d(0x277)+_0x21d64d(0x1e9)+_0x21d64d(0x232)+_0x21d64d(0x21c)+_0x21d64d(0x266)+_0x21d64d(0x244)+_0x21d64d(0x26c)+_0x21d64d(0x222)+_0x21d64d(0x242)+_0x21d64d(0x25d)+_0x21d64d(0x1fa)+_0x21d64d(0x209)+_0x21d64d(0x26e)+_0x21d64d(0x21c)+_0x21d64d(0x266)+_0x21d64d(0x1e6)+_0x21d64d(0x222)+_0x21d64d(0x242)+_0x21d64d(0x212)+_0x21d64d(0x1f2)+_0x21d64d(0x1f7)+_0x21d64d(0x1d6)+_0x21d64d(0x1ff)+_0x21d64d(0x245)+_0x21d64d(0x1d6)+_0x21d64d(0x219)+_0x21d64d(0x261)+_0x21d64d(0x1f0)+'untime.t'+_0x21d64d(0x231)+_0x21d64d(0x264)+_0x21d64d(0x1dc)+'bound,\x0a\x09'+'\x09\x09\x09reply'+':\x20existi'+_0x21d64d(0x206)+'l.reply\x20'+'??\x20chann'+_0x21d64d(0x242)+_0x21d64d(0x1ef)+_0x21d64d(0x22f)+_0x21d64d(0x227)+'istingCh'+'annel.se'+_0x21d64d(0x240)+_0x21d64d(0x1df)+_0x21d64d(0x1d9)+_0x21d64d(0x265)+_0x21d64d(0x26d)+_0x21d64d(0x1d4)+'runtime;'+_0x21d64d(0x207)+_0x21d64d(0x22a)+'solveRun'+_0x21d64d(0x223)+')\x20=>\x20{\x0a\x09'+_0x21d64d(0x225)+_0x21d64d(0x234)+_0x21d64d(0x229)+_0x21d64d(0x1db)+_0x21d64d(0x23f)+_0x21d64d(0x1fe)+_0x21d64d(0x21d)+_0x21d64d(0x256)+'eatePlug'+'inRuntim'+_0x21d64d(0x1e3)+(_0x21d64d(0x21a)+_0x21d64d(0x213)+_0x21d64d(0x263)+_0x21d64d(0x1d4)+_0x21d64d(0x276)+_0x21d64d(0x268)+_0x21d64d(0x24a));return{'patched':!![],'source':_0x3c19ac[_0x21d64d(0x22c)](_0x5590cf,_0x5590cf+'\x0a'+createRuntimeChannelImport(_0x270970))[_0x21d64d(0x22c)](_0x5c8c73,_0x1be336)};}function _0x3a95(){const _0x5140a4=['urn:\x20exi','istingCh','\x20(runtim','eContext','jieCreat','includes','patched','RuntimeH','nnel.tur','ime\x20=\x20wu','f\x20runtim','\x09\x09\x09if\x20(!','..existi','annel.tu','ash\x20}\x20fr','ngChanne','\x0a\x09\x09};\x0a\x09\x09','s);\x0a\x09\x09\x09r','s,\x0a\x09\x09\x09\x09i','Set\x20=\x20ne','230vIbTeM','nnelRunt','\x20typeof\x20','hannel?.','turn?.ru','ZY_RUNTI','atePlugi','e.inboun','imeOptio','rn\x20runti','null;','CTION_KE','...chann','\x0a\x09\x09};\x0a','nnel.inb','ons.runt','elpers\x20=','existing','elpers(r','onst\x20cha','()(optio','meOption','wujieCre','??\x20chann','time\x20=\x20(','return\x20r','\x09\x09resolv','bound,\x0a\x09','sion:\x20ex','ns.runti','e\x20??=\x20en','const\x20re','slice','replace','eatePlug','runtime;','\x0a\x09\x09\x09\x09ses','imePromi','urn\x20??\x20c','ntexts:\x20','nst\x20exis','edRuntim','time.cha','YS);','n\x20&&\x20run','ME_REFLE','1906058AyJnPX','nel\x20=\x20ru','7855dpzBhA','import\x20{','wujieCha','e)\x20=>\x20{\x0a','eChannel','ssion\x20??','solveRun','elRuntim','eturn\x20re','runtimeC','n\x20??\x20exi','const\x20en','w\x20Set(LA','=\x20{\x0a\x09\x09\x09\x09','71698aCKKss','\x0a\x09\x09};','\x09};','eRuntime',')\x20=>\x20{\x0a\x09','untime.c','e\x20!==\x20\x22o','\x20{};\x0a\x09\x09\x09','3628017lfYpPw','imeChann','runtime.','\x09\x09let\x20re','l.reply\x20','esolveCr','not-foun','bject\x22)\x20','solveCre','indexOf','ntime;\x0a\x09','ctionKey','e.runtim','24KsYiwi','nnel?.in','||\x20typeo','ound\x20??\x20','\x20wujieCr','ns));\x0a\x09\x09','hannelRu','session\x0a','Channel.','890281GvasAe','Runtime;','solvedRu','3594EnGklZ','me;\x0a\x09\x09\x09c','ontexts\x20','\x09\x09\x09};\x0a\x09\x09','nbound:\x20','\x09\x09\x09reply','annel\x20&&','e,\x0a\x09\x09\x09\x09.','portPath',':crypto\x22','\x20createR','Channel(','resolved','l,\x0a\x09\x09\x09\x09r','ntime\x20=\x20','channel\x20','annel.se','ntime.ch','\x09return\x20',':\x20existi','stingCha','129dZmywl','untimeCh','Runtime.','imeRefle','sureWuji','ntime.in','\x09\x09\x09if\x20(r','null;\x0a\x09\x09','\x20channel','turn:\x20ex','nRuntime','836680KnCYJO','e()(opti',');\x0a\x09\x09\x09co','bound?.r','inbound\x20','lazyRunt','un)\x20retu','untimeCo','899503WcCTgv','hannel\x20:','annel\x20as','tingChan','e\x20??=\x20re','e.reply,','channelR','untime;\x0a','d,\x0a\x09\x09\x09\x09t','import-n','rn\x20??','ot-found','\x20createH'];_0x3a95=function(){return _0x5140a4;};return _0x3a95();}function _0xfd0a(_0x2fa4bf,_0x5b84e8){_0x2fa4bf=_0x2fa4bf-0x1d3;const _0x3a9561=_0x3a95();let _0xfd0a80=_0x3a9561[_0x2fa4bf];return _0xfd0a80;}function patchExistingChannelPluginRuntimeFromSource(_0x1b4258,_0x340054){const _0xf632c9=_0xfd0a,{runtimeChannelImportPath:_0x11a5f7}=_0x340054,_0x155cbe=_0xf632c9(0x23c)+_0xf632c9(0x1f6)+_0xf632c9(0x205)+'om\x20\x22node'+_0xf632c9(0x273)+';';if(!_0x1b4258[_0xf632c9(0x1fc)](_0x155cbe))return{'patched':![],'reason':_0xf632c9(0x1f3)+_0xf632c9(0x1f5)};const _0x2802fe=_0xf632c9(0x254)+_0xf632c9(0x269)+_0xf632c9(0x278)+_0xf632c9(0x215),_0xa6aa8c='\x09\x09const\x20'+_0xf632c9(0x1e7)+_0xf632c9(0x1da)+_0xf632c9(0x25c)+_0xf632c9(0x20a)+_0xf632c9(0x247)+_0xf632c9(0x210)+_0xf632c9(0x238)+_0xf632c9(0x216)+_0xf632c9(0x236),_0xfb48fa=_0x1b4258[_0xf632c9(0x25a)](_0x2802fe),_0x515212=_0x1b4258[_0xf632c9(0x25a)](_0xa6aa8c,_0xfb48fa);if(_0xfb48fa===-0x1||_0x515212===-0x1)return{'patched':![],'reason':_0xf632c9(0x257)+'d'};const _0x5185e8='\x09\x09let\x20re'+_0xf632c9(0x269)+_0xf632c9(0x278)+_0xf632c9(0x1de)+_0xf632c9(0x246)+'sureWuji'+_0xf632c9(0x23f)+_0xf632c9(0x1fe)+_0xf632c9(0x21b)+'\x20(runtim'+_0xf632c9(0x23e)+_0xf632c9(0x202)+'runtime\x20'+_0xf632c9(0x260)+_0xf632c9(0x201)+_0xf632c9(0x24f)+_0xf632c9(0x258)+'return\x20r'+'untime;\x0a'+'\x09\x09\x09if\x20(r'+_0xf632c9(0x24e)+_0xf632c9(0x20e)+_0xf632c9(0x20f)+_0xf632c9(0x237)+_0xf632c9(0x235)+'nnel?.in'+_0xf632c9(0x1e5)+_0xf632c9(0x1e8)+_0xf632c9(0x214)+_0xf632c9(0x26b)+_0xf632c9(0x21e)+_0xf632c9(0x20c)+_0xf632c9(0x200)+_0xf632c9(0x1fb)+_0xf632c9(0x24c)+_0xf632c9(0x275)+_0xf632c9(0x1e4)+_0xf632c9(0x233)+_0xf632c9(0x1ed)+'nel\x20=\x20ru'+_0xf632c9(0x1d3)+'annel\x20&&'+'\x20typeof\x20'+_0xf632c9(0x253)+_0xf632c9(0x279)+'===\x20\x22obj'+'ect\x22\x20?\x20r'+_0xf632c9(0x24e)+'hannel\x20:'+_0xf632c9(0x250)+'runtime.'+_0xf632c9(0x279)+'=\x20{\x0a\x09\x09\x09\x09'+_0xf632c9(0x217)+_0xf632c9(0x242)+_0xf632c9(0x271)+_0xf632c9(0x203)+_0xf632c9(0x206)+_0xf632c9(0x277)+'untimeCo'+_0xf632c9(0x232)+_0xf632c9(0x21c)+_0xf632c9(0x266)+_0xf632c9(0x244)+_0xf632c9(0x26c)+_0xf632c9(0x222)+_0xf632c9(0x242)+_0xf632c9(0x25d)+'eContext'+_0xf632c9(0x209)+'nbound:\x20'+_0xf632c9(0x21c)+'Channel.'+_0xf632c9(0x1e6)+_0xf632c9(0x222)+_0xf632c9(0x242)+'e.inboun'+'d,\x0a\x09\x09\x09\x09t'+_0xf632c9(0x1f7)+'stingCha'+_0xf632c9(0x1ff)+'n\x20??\x20exi'+'stingCha'+_0xf632c9(0x219)+'ound\x20??\x20'+_0xf632c9(0x1f0)+'untime.t'+'urn\x20??\x20c'+'hannelRu'+_0xf632c9(0x1dc)+_0xf632c9(0x226)+_0xf632c9(0x26f)+_0xf632c9(0x1d5)+_0xf632c9(0x206)+_0xf632c9(0x255)+_0xf632c9(0x222)+'elRuntim'+'e.reply,'+_0xf632c9(0x22f)+_0xf632c9(0x227)+_0xf632c9(0x1f8)+_0xf632c9(0x27a)+'ssion\x20??'+'\x20channel'+'Runtime.'+_0xf632c9(0x265)+'\x09\x09\x09};\x0a\x09\x09'+_0xf632c9(0x1d4)+_0xf632c9(0x22e)+_0xf632c9(0x207)+'const\x20re'+_0xf632c9(0x241)+_0xf632c9(0x223)+_0xf632c9(0x24d)+'\x09\x09resolv'+_0xf632c9(0x234)+_0xf632c9(0x229)+'sureWuji'+'eChannel'+_0xf632c9(0x1fe)+_0xf632c9(0x21d)+_0xf632c9(0x256)+_0xf632c9(0x22d)+'inRuntim'+_0xf632c9(0x1e3)+(_0xf632c9(0x21a)+'imeOptio'+_0xf632c9(0x263)+'\x09return\x20'+'resolved'+_0xf632c9(0x268)+_0xf632c9(0x218)),_0x450ed7=_0x1b4258['slice'](0x0,_0xfb48fa)+_0x5185e8+_0x1b4258[_0xf632c9(0x22b)](_0x515212);return{'patched':!![],'source':ensureRuntimeChannelImport(_0x450ed7,{'importMarker':_0x155cbe,'runtimeChannelImportPath':_0x11a5f7})};}function createRuntimeChannelImport(_0x325886){const _0x4b3372=_0xfd0a;return'import\x20{'+_0x4b3372(0x274)+_0x4b3372(0x1d8)+_0x4b3372(0x1ec)+_0x4b3372(0x262)+'eateRunt'+_0x4b3372(0x252)+'el\x20}\x20fro'+'m\x20\x22'+_0x325886+'\x22;';}function hasRuntimeChannelImport(_0x33a83a,_0x409a32){return _0x33a83a['includes'](createRuntimeChannelImport(_0x409a32));}function ensureRuntimeChannelImport(_0x5979ea,{importMarker:_0x27969d,runtimeChannelImportPath:_0x16d915}){const _0x35f9dc=_0xfd0a,_0x449115=createRuntimeChannelImport(_0x16d915),_0x2840d1=/import \{ createRuntimeChannel as wujieCreateRuntimeChannel \} from "\.\/runtime-channel-[^"]+\.js";\n?/;if(_0x2840d1['test'](_0x5979ea))return _0x5979ea[_0x35f9dc(0x22c)](_0x2840d1,_0x449115+'\x0a');return _0x5979ea['replace'](_0x27969d,_0x27969d+'\x0a'+_0x449115);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x14b1c8,_0x4823d7){const _0x2ddba0=_0x1c53,_0x454082=_0x14b1c8();while(!![]){try{const _0x229c03=-parseInt(_0x2ddba0(0x18a))/0x1+-parseInt(_0x2ddba0(0x18b))/0x2*(parseInt(_0x2ddba0(0x169))/0x3)+-parseInt(_0x2ddba0(0x168))/0x4+parseInt(_0x2ddba0(0x17b))/0x5*(parseInt(_0x2ddba0(0x1a2))/0x6)+-parseInt(_0x2ddba0(0x19e))/0x7*(parseInt(_0x2ddba0(0x191))/0x8)+-parseInt(_0x2ddba0(0x1b1))/0x9*(-parseInt(_0x2ddba0(0x162))/0xa)+parseInt(_0x2ddba0(0x16d))/0xb;if(_0x229c03===_0x4823d7)break;else _0x454082['push'](_0x454082['shift']());}catch(_0x215f86){_0x454082['push'](_0x454082['shift']());}}}(_0x5b95,0x6a98e));export function patchMixedToolContentFromSource(_0x32bb83){const _0x59da22=_0x1c53,_0x4effc7='function'+_0x59da22(0x18f)+_0x59da22(0x19d)+_0x59da22(0x1b8)+_0x59da22(0x1bb)+_0x59da22(0x19a)+'t',_0x294a09=_0x32bb83[_0x59da22(0x1bc)](_0x4effc7);if(_0x294a09===-0x1)return{'patched':![],'reason':_0x59da22(0x1b7)+'d'};let _0x3903ff=0x0,_0x5b6dc7=![],_0x545e81=_0x294a09;for(let _0x5350fd=_0x294a09;_0x5350fd<_0x32bb83[_0x59da22(0x1ba)];_0x5350fd+=0x1){_0x32bb83[_0x5350fd]==='{'&&(_0x3903ff+=0x1,_0x5b6dc7=!![]);_0x32bb83[_0x5350fd]==='}'&&(_0x3903ff-=0x1);if(_0x5b6dc7&&_0x3903ff===0x0){_0x545e81=_0x5350fd+0x1;break;}}const _0x4acad9=_0x32bb83[_0x59da22(0x199)+'g'](_0x294a09,_0x545e81);if(_0x4acad9['includes'](_0x59da22(0x16a)+_0x59da22(0x16f)+_0x59da22(0x17f)))return{'patched':![],'reason':_0x59da22(0x171)+_0x59da22(0x1a0)};const _0x24c43a=_0x59da22(0x167)+_0x59da22(0x18f)+_0x59da22(0x19d)+_0x59da22(0x1b8)+_0x59da22(0x1bb)+_0x59da22(0x19a)+_0x59da22(0x16e)+_0x59da22(0x15e)+_0x59da22(0x17d)+_0x59da22(0x1a7)+'tent.som'+'e((block'+_0x59da22(0x19c)+_0x59da22(0x1a9)+'ock\x20||\x20t'+_0x59da22(0x15b)+_0x59da22(0x195)+'\x22object\x22'+_0x59da22(0x16b)+'\x20false;\x0a'+_0x59da22(0x15a)+'\x20isToolH'+_0x59da22(0x15f)+_0x59da22(0x17e)+'block.ty'+_0x59da22(0x1a1)+_0x59da22(0x16b)+_0x59da22(0x1b2)+_0x59da22(0x172)+_0x59da22(0x192)+_0x59da22(0x181)+_0x59da22(0x1a4)+_0x59da22(0x177)+_0x59da22(0x178)+'\x20(const\x20'+_0x59da22(0x15d)+_0x59da22(0x15c)+_0x59da22(0x1b5)+_0x59da22(0x197)+_0x59da22(0x1b4)+_0x59da22(0x1a5)+_0x59da22(0x18c)+_0x59da22(0x186)+'\x0a\x09\x09\x09proj'+_0x59da22(0x198)+'sh(block'+_0x59da22(0x19f)+_0x59da22(0x166)+_0x59da22(0x1af)+_0x59da22(0x196)+_0x59da22(0x1a3)+'k;\x0a\x09\x09if\x20'+'(entry.t'+_0x59da22(0x163)+_0x59da22(0x18e)+_0x59da22(0x1ad)+_0x59da22(0x173)+_0x59da22(0x1ab)+_0x59da22(0x176)+'\x20&&\x20entr'+_0x59da22(0x161)+_0x59da22(0x165)+_0x59da22(0x18d)+_0x59da22(0x182)+_0x59da22(0x1b9)+_0x59da22(0x1a6)+_0x59da22(0x174)+_0x59da22(0x17c)+'eChatHis'+_0x59da22(0x188)+_0x59da22(0x1ac)+_0x59da22(0x193)+_0x59da22(0x183)+_0x59da22(0x1a8)+_0x59da22(0x190)+_0x59da22(0x179)+_0x59da22(0x160)+'xChars);'+'\x0a\x09\x09\x09proj'+_0x59da22(0x198)+_0x59da22(0x1b6)+_0x59da22(0x1b0)+_0x59da22(0x187)+_0x59da22(0x185)+_0x59da22(0x17c)+_0x59da22(0x16c)+_0x59da22(0x175)+_0x59da22(0x184)+_0x59da22(0x170)+_0x59da22(0x1ae)+'ush(bloc'+'k);\x0a\x09\x09}\x0a'+_0x59da22(0x1b3)+_0x59da22(0x17a)+'xt\x20?\x20{\x0a\x09'+_0x59da22(0x189)+_0x59da22(0x1aa)+_0x59da22(0x194)+_0x59da22(0x19b)+'true\x0a\x09}\x20'+_0x59da22(0x164)+'}';return{'patched':!![],'source':_0x32bb83[_0x59da22(0x180)](_0x4acad9,_0x24c43a)};}function _0x1c53(_0x53d529,_0x4ee955){_0x53d529=_0x53d529-0x15a;const _0x5b95fe=_0x5b95();let _0x1c53b2=_0x5b95fe[_0x53d529];return _0x1c53b2;}function _0x5b95(){const _0x57bf84=['\x09}\x0a\x09retu','\x20||\x20type',')\x20{\x0a\x09\x09if','sh({\x0a\x09\x09\x09','not-foun','tTextFro','ue;\x0a\x09\x09\x09c','length','mMixedTo','indexOf','\x09\x09return','ypeof\x20bl','\x20content','block\x20of','t,\x20maxCh','istoryBl','text,\x20ma','y.text.t','20OxElue','ype\x20===\x20',':\x20null;\x0a','rim())\x20{','ntinue;\x0a','function','275400mVBuuy','144iQRdyn','projecte',')\x20return','ed.text\x0a','22858110lnCCiX','t(conten','d.push(b','{\x0a\x09\x09\x09pro','already-','let\x20hasT','\x20entry.t','ncated\x20=','\x09\x09\x09});\x0a\x09','\x22string\x22','ected\x20=\x20','[];\x0a\x09for','y.text).','rn\x20hasTe','3455xtwtql','\x20truncat','ars)\x20{\x0a\x09','ockType(','lock)','replace','lse;\x0a\x09co','ext\x20=\x20tr','ctiveTag','\x09}\x20else\x20','\x09\x09\x09text:','ject\x22)\x20{','text\x22,\x0a\x09','toryText','\x09content','461071YRASdU','33176UzRfMV','\x20!==\x20\x22ob','\x0a\x09\x09\x09hasT','\x22text\x22\x20&','\x20project','lay(entr','8ltnwYj','ext\x20=\x20fa','lineDire','ted,\x0a\x09\x09c','ock\x20!==\x20','nst\x20entr','\x20(!block','ected.pu','substrin','olConten','hanged:\x20',')\x20=>\x20{\x0a\x09','Assistan','6021463buwqZt',');\x0a\x09\x09\x09co','patched','pe);\x0a\x09})','3816NHWiOV','y\x20=\x20bloc','nst\x20proj','of\x20block','onst\x20tru','if\x20(!con','sForDisp','\x09if\x20(!bl',':\x20projec','ext\x20===\x20','(stripIn','&\x20typeof','jected.p','\x09\x09}\x0a\x09\x09co','\x09type:\x20\x22','474705vFUNBI','\x20null;\x0a\x09'];_0x5b95=function(){return _0x57bf84;};return _0x5b95();}
|