@wujie-shell/core 1.0.1 → 1.0.2
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 +10 -3
- package/bin/wujie-shell.mjs +22 -1
- 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 -0
- package/dist/src/chat/media-archive.mjs +1 -1
- package/dist/src/chat/queue.mjs +1 -1
- package/dist/src/common/diagnostics.mjs +1 -1
- package/dist/src/common/logging.mjs +1 -1
- package/dist/src/common/runtime-logger.mjs +1 -1
- package/dist/src/common/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 -0
- package/dist/src/electron/main.mjs +1 -1
- package/dist/src/electron/preload.mjs +1 -1
- package/dist/src/files/generated-files-store.mjs +1 -1
- package/dist/src/files/handlers.mjs +1 -1
- package/dist/src/gateway/chat-delta.mjs +1 -1
- package/dist/src/gateway/controller.mjs +1 -1
- package/dist/src/gateway/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/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 -0
- package/dist/src/runtime/patch-session-store-sqlite.mjs +1 -1
- package/dist/src/runtime/plugin-sync.mjs +1 -1
- package/dist/src/sessions/agent-sessions-map-store.mjs +1 -1
- package/dist/src/sessions/runtime-bridge.mjs +1 -1
- package/dist/src/sessions/session-data-service.mjs +1 -0
- package/dist/src/sessions/session-sqlite-store.mjs +1 -1
- package/dist/src/sessions/sql/003_session_message_index.sql +29 -0
- 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 _0x30af49=_0x3e4d;(function(_0x137564,_0x1d7b4d){const _0x503d41=_0x3e4d,_0x942ec3=_0x137564();while(!![]){try{const _0x4e4580=-parseInt(_0x503d41(0x2c2))/0x1+-parseInt(_0x503d41(0x16a))/0x2*(parseInt(_0x503d41(0x335))/0x3)+parseInt(_0x503d41(0x16d))/0x4*(-parseInt(_0x503d41(0x223))/0x5)+parseInt(_0x503d41(0x2e4))/0x6*(parseInt(_0x503d41(0x332))/0x7)+parseInt(_0x503d41(0x168))/0x8*(-parseInt(_0x503d41(0x1fd))/0x9)+-parseInt(_0x503d41(0x339))/0xa+parseInt(_0x503d41(0x2a7))/0xb;if(_0x4e4580===_0x1d7b4d)break;else _0x942ec3['push'](_0x942ec3['shift']());}catch(_0xb2d2e3){_0x942ec3['push'](_0x942ec3['shift']());}}}(_0x1e29,0x4dae9));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,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{patchMixedToolContentFromSource}from'./patch-chat-history-mixed-tool-content.mjs';import{patchChannelPluginRuntimeFromSource}from'./patch-channel-plugin-runtime.mjs';import{patchSessionStoreLoadFromSource,patchSessionStoreWriteFromSource}from'./patch-session-store-sqlite.mjs';const RUNTIME_DIR=_0x30af49(0x259)+_0x30af49(0x19a),MANIFEST_NAME=_0x30af49(0x22e)+'manifest'+_0x30af49(0x253),NPM_INSTALL_TIMEOUT_MS=0xf*0x3c*0x3e8;function _0x3e4d(_0x593325,_0x974a7c){_0x593325=_0x593325-0x131;const _0x1e291a=_0x1e29();let _0x3e4d69=_0x1e291a[_0x593325];return _0x3e4d69;}export function resolveRuntimeRoot(_0x177230){if(process.env.WUJIE_SHELL_RUNTIME_ROOT)return resolve(process.env.WUJIE_SHELL_RUNTIME_ROOT);return resolve(_0x177230,RUNTIME_DIR);}export function resolveManifestPath(_0x2186c2){return join(_0x2186c2,MANIFEST_NAME);}async function loadProductRuntime(_0xebadc9,_0x3b7795){const _0x5852ad=_0x30af49,_0x4138e3=[join(_0xebadc9,_0x5852ad(0x182)+_0x5852ad(0x1d6),_0x5852ad(0x302)+'s'),join(_0x3b7795,_0x5852ad(0x182)+_0x5852ad(0x1d6),_0x5852ad(0x302)+'s')];for(const _0x993fdf of _0x4138e3){if(!existsSync(_0x993fdf))continue;return await import(pathToFileURL(_0x993fdf)[_0x5852ad(0x14a)]+'?t='+Date['now']());}return{};}export async function prepareRuntime(_0x585ff6,{syncOnly:syncOnly=![]}={}){const _0x4e1078=_0x30af49,_0xe94f53=resolveRuntimeRoot(_0x585ff6[_0x4e1078(0x149)+_0x4e1078(0x28e)]),_0x102147=createRuntimeLogger(getConfigPaths(_0x585ff6),_0x4e1078(0x277)),_0x34cc45=Date[_0x4e1078(0x14d)]();_0x102147?.[_0x4e1078(0x144)](_0x4e1078(0x24a)+_0x4e1078(0x205)+_0x4e1078(0x20e),{'syncOnly':syncOnly,'runtimeRoot':_0xe94f53,'shellConfig':summarizeShellConfig(_0x585ff6)});try{const _0x1554c2=await ensureRuntimeBase(_0x585ff6,_0xe94f53,{'runtimeLogger':_0x102147,'syncOnly':syncOnly});_0x102147?.[_0x4e1078(0x144)](_0x4e1078(0x205)+'manifest'+_0x4e1078(0x1db),{'manifestPath':resolveManifestPath(_0xe94f53),'manifest':summarizeRuntimeManifest(_0x1554c2)}),validateRuntimeNodeVersion(_0x1554c2,_0x585ff6),_0x102147?.[_0x4e1078(0x144)](_0x4e1078(0x205)+_0x4e1078(0x2ad)+_0x4e1078(0x201)+_0x4e1078(0x1a8),{'nodeVersion':_0x1554c2[_0x4e1078(0x1d0)+_0x4e1078(0x229)]});if(syncOnly)validateRuntimeOpenClawVersion(_0x1554c2,_0x585ff6),_0x102147?.[_0x4e1078(0x144)](_0x4e1078(0x205)+'openclaw'+_0x4e1078(0x165)+_0x4e1078(0x1df)+'ed',{'openclawVersion':_0x1554c2[_0x4e1078(0x19b)+'Version']});else{if(_0x1554c2[_0x4e1078(0x19b)+_0x4e1078(0x26f)]!==_0x585ff6[_0x4e1078(0x19b)]['openclaw'+_0x4e1078(0x26f)]){const _0x257f22=await loadRuntimeInfo(_0x585ff6[_0x4e1078(0x149)+_0x4e1078(0x28e)]);_0x102147?.[_0x4e1078(0x144)](_0x4e1078(0x19b)+_0x4e1078(0x231)+'\x20install'+'\x20started',{'fromVersion':_0x1554c2[_0x4e1078(0x19b)+_0x4e1078(0x26f)]||_0x4e1078(0x2ce),'toVersion':_0x585ff6['openclaw'][_0x4e1078(0x19b)+'Version']}),await installOpenClawPackage(_0x257f22,_0x585ff6[_0x4e1078(0x19b)][_0x4e1078(0x19b)+_0x4e1078(0x26f)]),_0x1554c2[_0x4e1078(0x19b)+_0x4e1078(0x26f)]=_0x585ff6[_0x4e1078(0x19b)]['openclaw'+_0x4e1078(0x26f)],_0x102147?.['info']('openclaw'+_0x4e1078(0x231)+_0x4e1078(0x14c)+_0x4e1078(0x157)+'ed',{'openclawVersion':_0x1554c2[_0x4e1078(0x19b)+_0x4e1078(0x26f)]});}}_0x1554c2['generate'+_0x4e1078(0x2ea)]=new Date()['toISOStr'+_0x4e1078(0x329)](),_0x1554c2['nodeVers'+_0x4e1078(0x229)]=_0x585ff6[_0x4e1078(0x19b)][_0x4e1078(0x1d0)+_0x4e1078(0x229)],_0x1554c2[_0x4e1078(0x139)]={'appId':_0x585ff6[_0x4e1078(0x17b)],'productName':_0x585ff6[_0x4e1078(0x13f)+_0x4e1078(0x174)],'dataDirName':_0x585ff6['dataDirN'+'ame']},await patchChatHistoryMixedToolContentBug(_0xe94f53,_0x1554c2,{'runtimeLogger':_0x102147}),await patchChannelPluginRuntimeBug(_0xe94f53,_0x1554c2,{'runtimeLogger':_0x102147});const _0x1de50c=await loadProductRuntime(_0x585ff6[_0x4e1078(0x149)+_0x4e1078(0x28e)],_0xe94f53);if(typeof _0x1de50c[_0x4e1078(0x178)+_0x4e1078(0x1c9)+_0x4e1078(0x1d6)]==='function'){const _0x21e336=createRuntimeInfoFromManifest(_0xe94f53,_0x1554c2);await _0x1de50c['prepareP'+_0x4e1078(0x1c9)+'ntime']({'shellConfig':_0x585ff6,'runtime':_0x21e336,'runtimeLogger':_0x102147,'syncOnly':syncOnly}),_0x102147?.[_0x4e1078(0x144)](_0x4e1078(0x256)+_0x4e1078(0x205)+_0x4e1078(0x280)+_0x4e1078(0x240));}await patchSessionStoreSqliteRuntime(_0xe94f53,_0x1554c2,{'runtimeLogger':_0x102147});!syncOnly&&(await hasConfiguredKdocsSkill(_0x585ff6)?(await installKdocsCliBinary(_0x585ff6,createRuntimeInfoFromManifest(_0xe94f53,_0x1554c2),{'runtimeLogger':_0x102147,'syncOnly':syncOnly}),_0x102147?.[_0x4e1078(0x144)](_0x4e1078(0x32c)+_0x4e1078(0x323)+_0x4e1078(0x232)+'synced')):_0x102147?.['info']('connecto'+'r\x20runtim'+_0x4e1078(0x232)+_0x4e1078(0x230)+_0x4e1078(0x1f8)+_0x4e1078(0x147)+_0x4e1078(0x27a)+_0x4e1078(0x2fb)));const _0x3e27aa=Array[_0x4e1078(0x248)](_0x1554c2[_0x4e1078(0x28a)])?_0x1554c2[_0x4e1078(0x28a)][_0x4e1078(0x1c3)]:0x0;return await syncManifestPluginScope(_0x585ff6,_0xe94f53,_0x1554c2),_0x102147?.[_0x4e1078(0x144)]('runtime\x20'+_0x4e1078(0x221)+_0x4e1078(0x282)+'ced',{'beforePluginCount':_0x3e27aa,'afterPluginCount':Array[_0x4e1078(0x248)](_0x1554c2[_0x4e1078(0x28a)])?_0x1554c2[_0x4e1078(0x28a)][_0x4e1078(0x1c3)]:0x0,'pluginSpecCount':Array[_0x4e1078(0x248)](_0x1554c2[_0x4e1078(0x188)+_0x4e1078(0x235)])?_0x1554c2[_0x4e1078(0x188)+_0x4e1078(0x235)][_0x4e1078(0x1c3)]:0x0}),await syncConfiguredNpmPlugins(_0x585ff6,_0xe94f53,_0x1554c2,{'runtimeLogger':_0x102147,'syncOnly':syncOnly}),_0x102147?.[_0x4e1078(0x144)](_0x4e1078(0x29b)+'ed\x20npm\x20p'+_0x4e1078(0x198)+_0x4e1078(0x162),{'pluginSpecCount':_0x585ff6['openclaw'][_0x4e1078(0x188)+_0x4e1078(0x235)][_0x4e1078(0x1c3)],'pluginCount':Array[_0x4e1078(0x248)](_0x1554c2['plugins'])?_0x1554c2[_0x4e1078(0x28a)][_0x4e1078(0x1c3)]:0x0}),await syncProductPlugins(_0x585ff6,_0xe94f53,_0x1554c2,{'runtimeLogger':_0x102147}),_0x102147?.[_0x4e1078(0x144)](_0x4e1078(0x256)+'plugins\x20'+_0x4e1078(0x246),{'localPluginCount':_0x585ff6['openclaw'][_0x4e1078(0x1a2)+_0x4e1078(0x331)+_0x4e1078(0x181)][_0x4e1078(0x1c3)],'pluginCount':Array[_0x4e1078(0x248)](_0x1554c2[_0x4e1078(0x28a)])?_0x1554c2['plugins'][_0x4e1078(0x1c3)]:0x0}),await syncProductAgents(_0x585ff6,_0xe94f53,_0x1554c2),_0x102147?.[_0x4e1078(0x144)](_0x4e1078(0x256)+_0x4e1078(0x167)+_0x4e1078(0x162),{'sources':_0x585ff6[_0x4e1078(0x19b)]['resolved'+_0x4e1078(0x21c)+_0x4e1078(0x255)],'entryCount':_0x1554c2['agents']?.[_0x4e1078(0x304)+'nt'],'installPath':_0x1554c2[_0x4e1078(0x2d3)]?.[_0x4e1078(0x1a6)+_0x4e1078(0x1a5)]}),await syncProductSkills(_0x585ff6,_0xe94f53,_0x1554c2),_0x102147?.[_0x4e1078(0x144)](_0x4e1078(0x256)+'skills\x20s'+_0x4e1078(0x162),{'sources':_0x585ff6['openclaw'][_0x4e1078(0x1a2)+_0x4e1078(0x320)+_0x4e1078(0x300)],'entryCount':_0x1554c2['skills']?.[_0x4e1078(0x304)+'nt'],'installPath':_0x1554c2[_0x4e1078(0x24b)]?.['installP'+'ath']}),await syncRuntimeWrapper(_0x585ff6,_0xe94f53,_0x1554c2),_0x102147?.['info']('runtime\x20'+_0x4e1078(0x237)+_0x4e1078(0x246),{'wujieclawBin':_0x1554c2[_0x4e1078(0x272)+_0x4e1078(0x218)]}),await writeJson(resolveManifestPath(_0xe94f53),_0x1554c2),_0x102147?.[_0x4e1078(0x144)](_0x4e1078(0x205)+_0x4e1078(0x27f)+_0x4e1078(0x247),{'manifestPath':resolveManifestPath(_0xe94f53),'manifest':summarizeRuntimeManifest(_0x1554c2),'durationMs':Date['now']()-_0x34cc45}),await _0x102147?.[_0x4e1078(0x26e)](),_0x1554c2;}catch(_0x24bfbb){_0x102147?.[_0x4e1078(0x16e)](_0x4e1078(0x24a)+_0x4e1078(0x205)+_0x4e1078(0x1e8),{'syncOnly':syncOnly,'runtimeRoot':_0xe94f53,'durationMs':Date['now']()-_0x34cc45,'error':_0x24bfbb}),await _0x102147?.['flush']();throw _0x24bfbb;}}async function syncRuntimeWrapper(_0xcaa5fa,_0x4c8fe7,_0x4de3c4){const _0x367f5c=_0x30af49,_0x495a4=_0xcaa5fa[_0x367f5c(0x19b)]?.[_0x367f5c(0x1cc)+'leName']??_0x367f5c(0x2f7)+'json',_0x48e4b5=join(_0x4c8fe7,_0x367f5c(0x2a3),'wujiecla'+'w'),_0x30fed4=join(_0x4c8fe7,'bin',_0x367f5c(0x272)+_0x367f5c(0x252)),_0x1a6dbb=normalizeRuntimeRelativePath(relative(dirname(_0x48e4b5),resolve(_0x4c8fe7,_0x4de3c4[_0x367f5c(0x2c7)+'utable']))),_0x6a8c6e=normalizeRuntimeRelativePath(relative(dirname(_0x48e4b5),resolve(_0x4c8fe7,_0x4de3c4['openclaw'+_0x367f5c(0x21d)]))),_0x36a0e9=_0x367f5c(0x1b7)+_0xcaa5fa['dataDirN'+_0x367f5c(0x174)],_0x34ce12=_0x367f5c(0x1e4)+_0x367f5c(0x2ae)+_0xcaa5fa[_0x367f5c(0x1fc)+_0x367f5c(0x174)];await mkdir(dirname(_0x48e4b5),{'recursive':!![]});const _0x5e14fd=fileURLToPath(new URL(_0x367f5c(0x158)+_0x367f5c(0x2bb)+_0x367f5c(0x216)+_0x367f5c(0x2e0),import.meta.url)),_0x1967f=join(_0x4c8fe7,'bin',_0x367f5c(0x194)+'go.mjs');await cp(_0x5e14fd,_0x1967f),await writeFile(_0x48e4b5,[_0x367f5c(0x219)+'h',_0x367f5c(0x164)+_0x367f5c(0x185)+_0x367f5c(0x301)+'OPENCLAW'+'_HOME:-'+_0x36a0e9+'}\x22','export\x20O'+_0x367f5c(0x185)+_0x367f5c(0x33e)+_0x367f5c(0x288)+'NCLAW_ST'+_0x367f5c(0x1d5)+'-'+_0x36a0e9+'}\x22','export\x20O'+_0x367f5c(0x185)+'CONFIG_F'+_0x367f5c(0x284)+_0x367f5c(0x2fc)+_0x367f5c(0x170)+_0x367f5c(0x2b9)+_0x367f5c(0x274)+_0x495a4+'}\x22','export\x20O'+_0x367f5c(0x185)+_0x367f5c(0x33d)+_0x367f5c(0x29e)+'PENCLAW_'+_0x367f5c(0x33d)+_0x367f5c(0x20a)+_0x36a0e9+'/'+_0x495a4+'}\x22',_0x367f5c(0x203)+'IR=$(CDP'+_0x367f5c(0x306)+'--\x20\x22$(di'+_0x367f5c(0x25a)+_0x367f5c(0x2f2)+_0x367f5c(0x2cc),_0x367f5c(0x1a0)+_0x367f5c(0x31c)+_0x367f5c(0x1e7)+_0x367f5c(0x1a4)+'OGO\x22\x20];\x20'+'then','\x20\x20\x22$SCRI'+_0x367f5c(0x281)+_0x1a6dbb+(_0x367f5c(0x2b2)+'PT_DIR/w'+_0x367f5c(0x244)+'o.mjs\x22\x202'+_0x367f5c(0x2ec)+_0x367f5c(0x2d8)+'ue'),'fi',_0x367f5c(0x1a3)+'CRIPT_DI'+'R/'+_0x1a6dbb+(_0x367f5c(0x2b2)+_0x367f5c(0x281))+_0x6a8c6e+_0x367f5c(0x1ed),'']['join']('\x0a'),_0x367f5c(0x2f4)),await chmod(_0x48e4b5,0x1ed),await writeFile(_0x30fed4,[_0x367f5c(0x1fa)+'f',_0x367f5c(0x293)+'NCLAW_HO'+_0x367f5c(0x2e8)+_0x367f5c(0x271)+_0x367f5c(0x285)+_0x367f5c(0x334)+_0x34ce12+'\x22',_0x367f5c(0x293)+_0x367f5c(0x257)+_0x367f5c(0x199)+_0x367f5c(0x1c5)+_0x367f5c(0x200)+_0x367f5c(0x1b5)+_0x367f5c(0x1e2)+_0x34ce12+'\x22','if\x20\x22%OPE'+_0x367f5c(0x1f4)+_0x367f5c(0x2d2)+'E_NAME%\x22'+_0x367f5c(0x15b)+'\x20\x22OPENCL'+_0x367f5c(0x1b3)+_0x367f5c(0x242)+_0x367f5c(0x20d)+_0x495a4+'\x22',_0x367f5c(0x293)+_0x367f5c(0x1f4)+_0x367f5c(0x30f)+_0x367f5c(0x192)+_0x367f5c(0x1d8)+_0x367f5c(0x1f4)+_0x367f5c(0x30f)+'H='+_0x34ce12+'\x5c'+_0x495a4+'\x22',_0x367f5c(0x270)+_0x367f5c(0x1da)+_0x367f5c(0x30b),'\x22%SCRIPT'+_0x367f5c(0x1d2)+toWindowsPath(_0x1a6dbb)+(_0x367f5c(0x268)+_0x367f5c(0x22d))+toWindowsPath(_0x6a8c6e)+'\x22\x20%*',''][_0x367f5c(0x173)]('\x0d\x0a'),_0x367f5c(0x2f4)),_0x4de3c4['wujiecla'+_0x367f5c(0x218)]=toRuntimeRelative(_0x4c8fe7,process[_0x367f5c(0x1d1)]===_0x367f5c(0x2bf)?_0x30fed4:_0x48e4b5);}async function patchChatHistoryMixedToolContentBug(_0x5836f2,_0x3195c5,_0x35252e={}){const _0xf9dbc7=_0x30af49,_0x1ab62e=resolve(_0x5836f2,_0x3195c5[_0xf9dbc7(0x19b)+_0xf9dbc7(0x169)+'ir']),_0x34de72=join(_0x1ab62e,_0xf9dbc7(0x2b3));let _0xa8e808=[];try{_0xa8e808=await readdir(_0x34de72,{'withFileTypes':!![]});}catch{_0x35252e[_0xf9dbc7(0x1c4)+_0xf9dbc7(0x23b)]?.[_0xf9dbc7(0x1f1)]?.(_0xf9dbc7(0x313)+_0xf9dbc7(0x2f8)+_0xf9dbc7(0x278)+_0xf9dbc7(0x15e)+_0xf9dbc7(0x2eb)+'ist\x20not\x20'+_0xf9dbc7(0x1ae),{'distDir':_0x34de72,'openclawVersion':_0x3195c5[_0xf9dbc7(0x19b)+_0xf9dbc7(0x26f)]});return;}const _0x1dcaef=_0xa8e808['filter'](_0x58f285=>_0x58f285['isFile']()&&_0x58f285['name'][_0xf9dbc7(0x31d)+'th'](_0xf9dbc7(0x1c2)+_0xf9dbc7(0x215)+_0xf9dbc7(0x160))&&_0x58f285[_0xf9dbc7(0x187)][_0xf9dbc7(0x32a)](_0xf9dbc7(0x2d0)))[_0xf9dbc7(0x209)](_0x52560f=>join(_0x34de72,_0x52560f[_0xf9dbc7(0x187)]));if(_0x1dcaef[_0xf9dbc7(0x1c3)]===0x0){_0x35252e[_0xf9dbc7(0x1c4)+_0xf9dbc7(0x23b)]?.[_0xf9dbc7(0x1f1)]?.('chat\x20his'+_0xf9dbc7(0x2f8)+_0xf9dbc7(0x278)+_0xf9dbc7(0x15e)+_0xf9dbc7(0x298)+_0xf9dbc7(0x135)+_0xf9dbc7(0x1ae),{'openclawVersion':_0x3195c5['openclaw'+'Version']});return;}for(const _0x30e502 of _0x1dcaef){const _0x279143=await readFile(_0x30e502,_0xf9dbc7(0x2f4)),_0x435f90=patchMixedToolContentFromSource(_0x279143);if(!_0x435f90[_0xf9dbc7(0x2f5)]){if(_0x435f90[_0xf9dbc7(0x196)]===_0xf9dbc7(0x2d9)+_0xf9dbc7(0x2f5)){_0x35252e['runtimeL'+'ogger']?.[_0xf9dbc7(0x144)]?.(_0xf9dbc7(0x313)+_0xf9dbc7(0x2f8)+_0xf9dbc7(0x278)+_0xf9dbc7(0x13e)+_0xf9dbc7(0x2d5)+'plied',{'openclawVersion':_0x3195c5[_0xf9dbc7(0x19b)+_0xf9dbc7(0x26f)],'filePath':_0x30e502});return;}continue;}await writeFile(_0x30e502,_0x435f90[_0xf9dbc7(0x172)],_0xf9dbc7(0x2f4)),_0x35252e[_0xf9dbc7(0x1c4)+_0xf9dbc7(0x23b)]?.[_0xf9dbc7(0x144)]?.('chat\x20his'+_0xf9dbc7(0x2f8)+_0xf9dbc7(0x278)+_0xf9dbc7(0x291)+_0xf9dbc7(0x24c),{'openclawVersion':_0x3195c5[_0xf9dbc7(0x19b)+_0xf9dbc7(0x26f)],'filePath':_0x30e502,'note':_0xf9dbc7(0x326)+_0xf9dbc7(0x213)+'ibility\x20'+_0xf9dbc7(0x258)+_0xf9dbc7(0x1bf)+_0xf9dbc7(0x20b)+_0xf9dbc7(0x28f)+_0xf9dbc7(0x262)+_0xf9dbc7(0x245)+'jection\x20'+_0xf9dbc7(0x33c)+'ify\x20upst'+_0xf9dbc7(0x154)+_0xf9dbc7(0x1e0)+_0xf9dbc7(0x2c1)+_0xf9dbc7(0x1ab)});return;}_0x35252e[_0xf9dbc7(0x1c4)+_0xf9dbc7(0x23b)]?.[_0xf9dbc7(0x1f1)]?.(_0xf9dbc7(0x313)+_0xf9dbc7(0x2f8)+'ed-tool\x20'+_0xf9dbc7(0x15e)+_0xf9dbc7(0x298)+_0xf9dbc7(0x32b)+'not\x20foun'+'d',{'openclawVersion':_0x3195c5[_0xf9dbc7(0x19b)+_0xf9dbc7(0x26f)]});}async function patchChannelPluginRuntimeBug(_0x3f20da,_0x42c8aa,_0x154732={}){const _0x5249ed=_0x30af49,_0x34399f=resolve(_0x3f20da,_0x42c8aa[_0x5249ed(0x19b)+'WorkingD'+'ir']),_0x8ecf57=join(_0x34399f,_0x5249ed(0x2b3));let _0x34a90b=[];try{_0x34a90b=await readdir(_0x8ecf57,{'withFileTypes':!![]});}catch{_0x154732[_0x5249ed(0x1c4)+_0x5249ed(0x23b)]?.[_0x5249ed(0x1f1)]?.(_0x5249ed(0x2a6)+'plugin\x20r'+_0x5249ed(0x16f)+'atch\x20ski'+'pped;\x20di'+_0x5249ed(0x2c5)+_0x5249ed(0x279),{'distDir':_0x8ecf57,'openclawVersion':_0x42c8aa[_0x5249ed(0x19b)+_0x5249ed(0x26f)]});return;}const _0x3f4872=_0x34a90b[_0x5249ed(0x250)](_0x29e149=>_0x29e149[_0x5249ed(0x145)]()&&_0x29e149[_0x5249ed(0x187)][_0x5249ed(0x31d)+'th']('loader-')&&_0x29e149[_0x5249ed(0x187)][_0x5249ed(0x32a)](_0x5249ed(0x2d0)))[_0x5249ed(0x209)](_0x7e71e=>join(_0x8ecf57,_0x7e71e[_0x5249ed(0x187)])),_0x744bea=await resolveRuntimeChannelImportPath(_0x8ecf57,_0x34a90b);if(_0x3f4872[_0x5249ed(0x1c3)]===0x0){_0x154732[_0x5249ed(0x1c4)+'ogger']?.[_0x5249ed(0x1f1)]?.('channel\x20'+_0x5249ed(0x25e)+_0x5249ed(0x16f)+'atch\x20ski'+_0x5249ed(0x2c9)+_0x5249ed(0x2c4)+_0x5249ed(0x308),{'openclawVersion':_0x42c8aa[_0x5249ed(0x19b)+_0x5249ed(0x26f)]});return;}if(!_0x744bea){_0x154732[_0x5249ed(0x1c4)+_0x5249ed(0x23b)]?.[_0x5249ed(0x1f1)]?.(_0x5249ed(0x2a6)+_0x5249ed(0x25e)+_0x5249ed(0x16f)+_0x5249ed(0x21e)+_0x5249ed(0x254)+_0x5249ed(0x296)+_0x5249ed(0x150)+_0x5249ed(0x1d3)+_0x5249ed(0x1ae),{'openclawVersion':_0x42c8aa[_0x5249ed(0x19b)+_0x5249ed(0x26f)],'distDir':_0x8ecf57});return;}for(const _0x2d3446 of _0x3f4872){const _0x404931=await readFile(_0x2d3446,_0x5249ed(0x2f4)),_0x274685=patchChannelPluginRuntimeFromSource(_0x404931,{'runtimeChannelImportPath':_0x744bea});if(!_0x274685[_0x5249ed(0x2f5)]){if(_0x274685['reason']===_0x5249ed(0x2d9)+_0x5249ed(0x2f5)){_0x154732[_0x5249ed(0x1c4)+_0x5249ed(0x23b)]?.[_0x5249ed(0x144)]?.(_0x5249ed(0x2a6)+_0x5249ed(0x25e)+_0x5249ed(0x16f)+_0x5249ed(0x228)+_0x5249ed(0x156)+'lied',{'openclawVersion':_0x42c8aa[_0x5249ed(0x19b)+_0x5249ed(0x26f)],'filePath':_0x2d3446});return;}continue;}await writeFile(_0x2d3446,_0x274685[_0x5249ed(0x172)],_0x5249ed(0x2f4)),_0x154732[_0x5249ed(0x1c4)+'ogger']?.['info']?.(_0x5249ed(0x2a6)+_0x5249ed(0x25e)+_0x5249ed(0x16f)+'atch\x20app'+_0x5249ed(0x2b4),{'openclawVersion':_0x42c8aa[_0x5249ed(0x19b)+_0x5249ed(0x26f)],'filePath':_0x2d3446,'note':_0x5249ed(0x326)+_0x5249ed(0x213)+_0x5249ed(0x2cf)+_0x5249ed(0x258)+_0x5249ed(0x1bf)+'aw\x202026.'+_0x5249ed(0x2a2)+_0x5249ed(0x183)+_0x5249ed(0x1f6)+_0x5249ed(0x2cb)+_0x5249ed(0x1a9)+_0x5249ed(0x265)+_0x5249ed(0x2d6)+'rs;\x20veri'+_0x5249ed(0x233)+_0x5249ed(0x2a9)+_0x5249ed(0x22a)+_0x5249ed(0x2fa)+_0x5249ed(0x226)});return;}_0x154732['runtimeL'+_0x5249ed(0x23b)]?.[_0x5249ed(0x1f1)]?.(_0x5249ed(0x2a6)+_0x5249ed(0x25e)+_0x5249ed(0x16f)+'atch\x20ski'+'pped;\x20ru'+_0x5249ed(0x220)+_0x5249ed(0x2a0)+_0x5249ed(0x26b),{'openclawVersion':_0x42c8aa[_0x5249ed(0x19b)+'Version']});}async function patchSessionStoreSqliteRuntime(_0x21700f,_0x584efd,_0x2cf68f={}){const _0x37b005=_0x30af49,_0x5664f4=resolve(_0x21700f,_0x584efd[_0x37b005(0x19b)+'WorkingD'+'ir']),_0x2a8821=join(_0x5664f4,_0x37b005(0x2b3)),_0x49bbdd=_0x37b005(0x241)+_0x37b005(0x20c)+'ime/sess'+_0x37b005(0x238)+_0x37b005(0x22c)+_0x37b005(0x295),_0x16fd8d=join(_0x21700f,_0x37b005(0x182)+'ntime','sessions',_0x37b005(0x22e)+_0x37b005(0x27e)+'js'),_0x284665=(await readdir(_0x2a8821,{'withFileTypes':!![]})[_0x37b005(0x1e6)](()=>[]))[_0x37b005(0x250)](_0x56c1fa=>_0x56c1fa[_0x37b005(0x145)]()&&_0x56c1fa[_0x37b005(0x187)]['startsWi'+'th'](_0x37b005(0x19c)+_0x37b005(0x14f))&&_0x56c1fa['name'][_0x37b005(0x32a)]('.js'))[_0x37b005(0x209)](_0x1477c4=>join(_0x2a8821,_0x1477c4[_0x37b005(0x187)])),_0x75beb4=(await readdir(_0x2a8821,{'withFileTypes':!![]})[_0x37b005(0x1e6)](()=>[]))[_0x37b005(0x250)](_0x24a06f=>_0x24a06f[_0x37b005(0x145)]()&&_0x24a06f[_0x37b005(0x187)][_0x37b005(0x31d)+'th']('store-')&&!_0x24a06f[_0x37b005(0x187)][_0x37b005(0x31d)+'th'](_0x37b005(0x19c)+'ad-')&&_0x24a06f[_0x37b005(0x187)][_0x37b005(0x32a)](_0x37b005(0x2d0)))[_0x37b005(0x209)](_0x3fce7a=>join(_0x2a8821,_0x3fce7a[_0x37b005(0x187)]));if(!existsSync(_0x16fd8d)){_0x2cf68f[_0x37b005(0x1c4)+_0x37b005(0x23b)]?.[_0x37b005(0x144)]?.(_0x37b005(0x197)+_0x37b005(0x13b)+_0x37b005(0x134)+_0x37b005(0x202)+_0x37b005(0x15a)+_0x37b005(0x1d4)+_0x37b005(0x177),{'bridgePath':_0x16fd8d,'openclawVersion':_0x584efd[_0x37b005(0x19b)+_0x37b005(0x26f)]});return;}for(const _0xbd4f7e of _0x284665){const _0x23bad4=await readFile(_0xbd4f7e,_0x37b005(0x2f4)),_0x3b8f52=patchSessionStoreLoadFromSource(_0x23bad4,{'bridgeImportPath':_0x49bbdd});if(!_0x3b8f52['patched']){if(_0x3b8f52[_0x37b005(0x196)]===_0x37b005(0x2d9)+_0x37b005(0x2f5)){_0x2cf68f[_0x37b005(0x1c4)+_0x37b005(0x23b)]?.[_0x37b005(0x144)]?.('session\x20'+_0x37b005(0x143)+_0x37b005(0x222)+_0x37b005(0x131)+_0x37b005(0x29f),{'filePath':_0xbd4f7e,'openclawVersion':_0x584efd[_0x37b005(0x19b)+_0x37b005(0x26f)]});break;}continue;}await writeFile(_0xbd4f7e,_0x3b8f52[_0x37b005(0x172)],_0x37b005(0x2f4)),_0x2cf68f[_0x37b005(0x1c4)+_0x37b005(0x23b)]?.[_0x37b005(0x144)]?.(_0x37b005(0x197)+'store\x20lo'+_0x37b005(0x222)+_0x37b005(0x29f),{'filePath':_0xbd4f7e,'openclawVersion':_0x584efd[_0x37b005(0x19b)+'Version']});break;}for(const _0x549ae4 of _0x75beb4){const _0xf513be=await readFile(_0x549ae4,_0x37b005(0x2f4)),_0x35e487=patchSessionStoreWriteFromSource(_0xf513be,{'bridgeImportPath':_0x49bbdd});if(!_0x35e487['patched']){if(_0x35e487['reason']===_0x37b005(0x2d9)+_0x37b005(0x2f5)){_0x2cf68f[_0x37b005(0x1c4)+_0x37b005(0x23b)]?.['info']?.(_0x37b005(0x197)+_0x37b005(0x264)+_0x37b005(0x2ef)+_0x37b005(0x1fe)+_0x37b005(0x2cd)+'d',{'filePath':_0x549ae4,'openclawVersion':_0x584efd[_0x37b005(0x19b)+_0x37b005(0x26f)]});break;}continue;}await writeFile(_0x549ae4,_0x35e487[_0x37b005(0x172)],_0x37b005(0x2f4)),_0x2cf68f[_0x37b005(0x1c4)+_0x37b005(0x23b)]?.[_0x37b005(0x144)]?.(_0x37b005(0x197)+_0x37b005(0x264)+_0x37b005(0x2ef)+'h\x20applie'+'d',{'filePath':_0x549ae4,'openclawVersion':_0x584efd[_0x37b005(0x19b)+_0x37b005(0x26f)]});break;}}async function resolveRuntimeChannelImportPath(_0x54a409,_0x1f569b){const _0x386ac9=_0x30af49,_0x3cf18f=_0x1f569b['filter'](_0x45a254=>_0x45a254[_0x386ac9(0x145)]()&&_0x45a254['name'][_0x386ac9(0x31d)+'th'](_0x386ac9(0x22e)+_0x386ac9(0x2e1))&&_0x45a254[_0x386ac9(0x187)][_0x386ac9(0x32a)](_0x386ac9(0x2d0))&&!_0x45a254[_0x386ac9(0x187)][_0x386ac9(0x31d)+'th'](_0x386ac9(0x22e)+'channel-'+'state-'))[_0x386ac9(0x209)](_0x4dbb57=>_0x4dbb57[_0x386ac9(0x187)])['sort']();for(const _0x102948 of _0x3cf18f){const _0x3f8b8d=await readFile(join(_0x54a409,_0x102948),_0x386ac9(0x2f4));if(_0x3f8b8d[_0x386ac9(0x239)]('createRu'+_0x386ac9(0x195)+_0x386ac9(0x1c6)))return'./'+_0x102948;}return null;}function normalizeRuntimeRelativePath(_0x2e5f9e){const _0x1d9155=_0x30af49;return _0x2e5f9e[_0x1d9155(0x32e)+'ll']('\x5c','/');}function _0x1e29(){const _0x37249e=['re\x20upgra','112318hTXtSt','extract\x20','ader\x20not','st\x20not\x20f','-doctor.','nodeExec','https://','pped;\x20lo','time]\x20do','me\x20missi','&&\x20pwd)','y\x20applie','unknown','ibility\x20','.js','\x20doctor\x20','NFIG_FIL','agents','mismatch','ready\x20ap','nd\x20helpe','--fix','ll\x20||\x20tr','already-','pid','version','m-cli.js','has','npm-cli.','runtimeR','mjs','channel-','er\x20writt','te/cli\x20i','1467858SFTEuH','\x20return\x20','e\x20plugin','.node','ME%\x22==\x22\x22','jie-shel','dAt','ipped;\x20d','>/dev/nu','isDirect','/npm','ite\x20patc','-xzf','/node','\x20\x22$0\x22)\x22\x20','Invalid\x20','utf8','patched','with\x20cod','wujieai.','tory\x20mix','nodejs.o','e\x20upgrad','red','=\x22${OPEN','ie-shell','time]\x20ru','npm-cach','llPaths','HOME=\x22${','index.mj','d:\x20','entryCou','me.','ATH=\x20cd\x20','npm','\x20found','npm\x20inst','--omit=d','%~dp0\x22','fix\x20alre','\x20local\x20p','.cache','NFIG_PAT','st=','\x20returne','npm-glob','chat\x20his','g\x20from\x20O','d\x20an\x20inv','\x20is\x20miss','pack','lib/node','base\x20alr','_shared','values','1\x20]\x20&&\x20[','startsWi','in\x20insta','ignore','LocalSki','ing\x20\x22','toISOStr','r\x20runtim','add','\x20timed\x20o','Temporar','match','nd\x20after','ing','endsWith','unction\x20','connecto','tar.xz','replaceA','node-v','all\x20','LocalPlu','14ScIfxy','-extract','OME=','183624pFhIlX','ent','l\x20plugin','wnloadin','6216200nNcudZ','node/lib','execPath','bug;\x20ver','CONFIG_P','STATE_DI','\x20already','versions','find','lite\x20pat','ile\x20not\x20','Dependen','kill','utable','product','-peer-de','store\x20sq','stdout','rg/dist/','patch\x20al','productN','Configur','cli','headers','store\x20lo','info','isFile','configPa','kill\x20not','config=','projectR','href','node/bin','\x20install','now','runtime:','ad-','annel\x20en','ed\x20OpenC','devDepen','d\x20to\x20','ream\x20fix','fix\x20mark','eady\x20app','\x20complet','../../as','claw-run','ed;\x20brid','==\x22\x22\x20set','\x20failed\x20','ugin\x20spe','patch\x20sk','fix\x20star','jection-','ugin\x20dep','ynced','\x20bin\x20was','export\x20O','\x20version','\x20can\x20ins','agents\x20s','8jsZFoz','WorkingD','8grzToo','dataDir','s\x20not\x20fo','34096gpBPmb','error','untime\x20p','CLAW_CON','location','source','join','ame','spec','st\x20be\x20a\x20','vailable','prepareP','then','arm64','appId','eer','optional','ules','time]\x20in','hell:run','ginPaths','shell-ru','nel\x20plug','registry','PENCLAW_','\x20depende','name','pluginSp','m/bin/np','endencie','rebuilt\x20','pluginId','Name','SIGTERM','--no-fun','\x20prepare','o\x20resolv','H%\x22==\x22\x22\x20','base\x20bui','wujie-lo','ntimeCha','reason','session\x20','lugins\x20s','ATE_DIR%','time','openclaw','store-lo','/opencla','extensio','env','if\x20[\x20-t\x20','integrit','resolved','exec\x20\x22$S','JIE_NO_L','ath','installP','--no-aud','idated','ng\x20chann','keys','des.','string','lugin\x20de','found','parse','Claw','label','agent','AW_CONFI','lled','LAW_STAT','npmCli','$HOME/',',\x20shell.','ion\x20mism','shasum','sion.','dependen','s\x20instal','tarball:','r\x20OpenCl','tall\x20the','\x20resolve','chat-dis','length','runtimeL','\x22==\x22\x22\x20se','nnel','--legacy','Duplicat','roductRu','close','nning\x20op','configFi','win','in\x20','ime\x20buil','nodeVers','platform','_DIR%','try\x20not\x20','ge\x20not\x20a','ATE_DIR:','ntime','missing\x20','set\x20\x22OPE','ory','IPT_DIR=','\x20loaded','Bundled\x20','runtimeS','split','\x20validat','\x20on\x20futu','arch','E_DIR=','OpenClaw','%USERPRO','package','catch','\x20-z\x20\x22$WU','failed','red\x20Node','set','process.','\x20create\x20','\x22\x20\x22$@\x22','with\x20the','resume','load:\x20','warn','object','age\x20was\x20','NCLAW_CO','replace','in\x20runti','nifest=','\x20kdocs\x20s','cal\x20runt','@echo\x20of','npm\x20plug','dataDirN','2103183cVPfax','h\x20alread','fix','t\x20\x22OPENC','sion\x20val','ch\x20skipp','SCRIPT_D','path','runtime\x20','npm\x20pack','x64','pendenci','map','ATH:-','aw\x202026.','ell-runt','AME=','started','Claw\x20ver','every','node_mod','.plugin-','y\x20compat','syncOnly','play-pro','ie-logo.','Run\x20\x22wuj','wBin','#!/bin/s','d\x20for\x20lo','ady\x20curr','LocalAge','Bin','atch\x20ski','data','ntime\x20re','plugin\x20s','ad\x20patch','120dNMySs','--json','local','es.','[wujie-s','atch\x20alr','ion','on\x20futur','red\x20Open','time-bri','PT_DIR%','runtime-','slice','skipped;','\x20package','e\x20tools\x20','fy\x20upstr','push','ecs','.npmmirr','wrapper\x20','ions/run','includes','path:\x20','ogger','trim','dencies','\x20path\x20mu','@larksui','nced','../../sh','G_FILE_N','y:\x20','ujie-log','tory\x20pro','synced','\x20written','isArray','zip','prepare\x20','skills','plied','toString','pipe','\x20path\x20wa','filter','ld\x20compl','w.cmd','.json','pped;\x20ru','ntPaths','product\x20','NCLAW_ST','patch\x20fo','.tmp/run','rname\x20--','w-extrac','not\x20foun','led','plugin\x20r','skill','package.','lugin\x20','tool\x20his','null','store\x20wr','el.inbou','law\x20','--omit=p','\x22\x20\x22%SCRI','he\x20runti','ut\x20after','ot\x20found','log','tar','flush','Version','set\x20\x22SCR','\x20set\x20\x22OP','wujiecla','lib','_NAME:-','stalling','Spec','runtime','ed-tool\x20','ound','\x20configu','node','get','Version\x20','bridge.m','manifest','tools\x20sy','PT_DIR/','cope\x20syn','\x22\x20so\x20the','ILE_NAME','ENCLAW_H','scripts','statusCo','R=\x22${OPE','scoped\x20s','plugins','local\x20pl','filename','allowMis','oot','6\x20mixed\x20','-xJf','patch\x20ap','time-too','if\x20\x22%OPE','cies','dge.mjs','ntime\x20ch','director','ipped;\x20f','re\x22\x20to\x20r','_modules','configur','\x20runtime','root','ATH=\x22${O','\x20applied','solver\x20n','\x22\x20from\x20','6.6\x20chan','bin','extract-','\x20signal=','channel\x20','13705252AzBJtF','\x20and\x20','eam\x20fix\x20','cwd','unzip','\x20can\x20be\x20','node\x20ver','FILE%\x5c','\x20did\x20not','or.com','sion\x20mis','\x22\x20\x22$SCRI','dist','lied','install','\x20paths','json','Unable\x20t','FIG_FILE','\x20-g','sets/wuj','indexOf','lark-cli','fix\x20comp','win32','stderr'];_0x1e29=function(){return _0x37249e;};return _0x1e29();}function toWindowsPath(_0x54ec97){const _0x24207c=_0x30af49;return _0x54ec97[_0x24207c(0x32e)+'ll']('/','\x5c');}function validateRuntimeNodeVersion(_0x3a07b8,_0x3c2031){const _0x26feb9=_0x30af49;if(_0x3a07b8[_0x26feb9(0x1d0)+_0x26feb9(0x229)]===_0x3c2031[_0x26feb9(0x19b)][_0x26feb9(0x1d0)+_0x26feb9(0x229)])return;throw new Error('runtime\x20'+'nodeVers'+_0x26feb9(0x1b9)+'atch:\x20ma'+_0x26feb9(0x1f7)+(_0x3a07b8['nodeVers'+_0x26feb9(0x229)]||_0x26feb9(0x2ce))+(_0x26feb9(0x1b8)+_0x26feb9(0x148))+_0x3c2031[_0x26feb9(0x19b)]['nodeVers'+_0x26feb9(0x229)]+'.\x20'+(_0x26feb9(0x217)+_0x26feb9(0x2fd)+_0x26feb9(0x190)+_0x26feb9(0x283)+'\x20product'+_0x26feb9(0x29c)+_0x26feb9(0x2ac)+_0x26feb9(0x18b)+_0x26feb9(0x1ee)+'\x20configu'+_0x26feb9(0x1e9)+_0x26feb9(0x165)+'.'));}function validateRuntimeOpenClawVersion(_0x26a3a3,_0x10ee69){const _0x28251b=_0x30af49;if(_0x26a3a3[_0x28251b(0x19b)+'Version']===_0x10ee69[_0x28251b(0x19b)][_0x28251b(0x19b)+'Version'])return;throw new Error(_0x28251b(0x205)+_0x28251b(0x19b)+_0x28251b(0x27d)+_0x28251b(0x2d4)+':\x20manife'+_0x28251b(0x310)+(_0x26a3a3[_0x28251b(0x19b)+_0x28251b(0x26f)]||_0x28251b(0x2ce))+(',\x20shell.'+_0x28251b(0x148))+_0x10ee69[_0x28251b(0x19b)][_0x28251b(0x19b)+_0x28251b(0x26f)]+'.\x20'+(_0x28251b(0x217)+_0x28251b(0x2fd)+_0x28251b(0x190)+_0x28251b(0x283)+_0x28251b(0x29c)+_0x28251b(0x166)+_0x28251b(0x1c0)+_0x28251b(0x27a)+_0x28251b(0x22b)+_0x28251b(0x20f)+_0x28251b(0x1bb)));}function parseNpmPackJson(_0x3f0fbe){const _0x46582d=_0x30af49,_0x3dee41=_0x3f0fbe['trim'](),_0x5e9be2=_0x3dee41[_0x46582d(0x2bc)]('[');if(_0x5e9be2<0x0)throw new Error(_0x46582d(0x206)+_0x46582d(0x2af)+_0x46582d(0x2e5)+'JSON:\x20'+_0x3dee41['slice'](0x0,0x1f4));const _0x4b3dd4=JSON[_0x46582d(0x1af)](_0x3dee41[_0x46582d(0x22f)](_0x5e9be2)),_0x29bf72=Array[_0x46582d(0x248)](_0x4b3dd4)?_0x4b3dd4[0x0]:_0x4b3dd4;if(!_0x29bf72||typeof _0x29bf72!==_0x46582d(0x1f2))throw new Error(_0x46582d(0x206)+_0x46582d(0x311)+_0x46582d(0x315)+'alid\x20pay'+_0x46582d(0x1f0)+_0x3dee41[_0x46582d(0x22f)](0x0,0x1f4));return _0x29bf72;}function normalizePackedTarballFilename(_0x4cde9f){const _0x311ef5=_0x30af49;return _0x4cde9f['replace'](/^@/,'')['replaceA'+'ll']('/','-')[_0x311ef5(0x32e)+'ll']('\x5c','-');}async function runProcess(_0x135e8a,_0x2900b3,_0x198fa3={}){const _0x3e28e8=_0x30af49,_0x3e3af3=_0x198fa3[_0x3e28e8(0x1b1)]||[_0x135e8a,..._0x2900b3]['join']('\x20'),_0x14f41c=_0x198fa3['timeoutM'+'s']??NPM_INSTALL_TIMEOUT_MS,_0x3be0dc=spawn(_0x135e8a,_0x2900b3,{'cwd':_0x198fa3[_0x3e28e8(0x2aa)],'env':_0x198fa3[_0x3e28e8(0x19f)],'stdio':[_0x3e28e8(0x31f),'pipe',_0x3e28e8(0x24e)]});return await new Promise((_0x21a36d,_0x4c4b86)=>{const _0x1c799f=_0x3e28e8;let _0x55845b='',_0x5b8946='',_0x3843e1=![];const _0x442760=setTimeout(()=>{const _0xbf7fd4=_0x3e4d;if(_0x3843e1)return;_0x3843e1=!![],_0x3be0dc[_0xbf7fd4(0x137)](_0xbf7fd4(0x18e)),_0x4c4b86(new Error(_0x3e3af3+('\x20timed\x20o'+'ut\x20after'+'\x20')+_0x14f41c+'ms'));},_0x14f41c);_0x3be0dc[_0x1c799f(0x13c)]['on'](_0x1c799f(0x21f),_0x5a7594=>{const _0x52f366=_0x1c799f;_0x55845b+=_0x5a7594[_0x52f366(0x24d)]();}),_0x3be0dc[_0x1c799f(0x2c0)]['on'](_0x1c799f(0x21f),_0x2539d3=>{_0x5b8946+=_0x2539d3['toString']();}),_0x3be0dc['on'](_0x1c799f(0x16e),_0x324a07=>{if(_0x3843e1)return;_0x3843e1=!![],clearTimeout(_0x442760),_0x4c4b86(_0x324a07);}),_0x3be0dc['on'](_0x1c799f(0x1ca),(_0x1155f6,_0x5e2224)=>{const _0xce4d18=_0x1c799f;if(_0x3843e1)return;_0x3843e1=!![],clearTimeout(_0x442760);if(_0x1155f6===0x0){_0x21a36d({'stdout':_0x55845b,'stderr':_0x5b8946});return;}_0x4c4b86(new Error(_0x3e3af3+(_0xce4d18(0x15c)+_0xce4d18(0x2f6)+'e=')+(_0x1155f6??_0xce4d18(0x263))+_0xce4d18(0x2a5)+(_0x5e2224??'null')+'\x0a'+(''+(_0x5b8946||_0x55845b))['trim']()));});});}async function installOpenClawPackage(_0x47a39d,_0xd7dec6){const _0xf082a0=_0x30af49,_0x1ff94c=join(_0x47a39d[_0xf082a0(0x2df)+_0xf082a0(0x28e)],_0xf082a0(0x30e)),_0x440dba=join(_0x47a39d[_0xf082a0(0x2df)+_0xf082a0(0x28e)],'.opencla'+_0xf082a0(0x25b)+'t');await mkdir(_0x1ff94c,{'recursive':!![]}),await removePathWithRetries(_0x440dba),await mkdir(_0x440dba,{'recursive':!![]});const _0x29b405=await createRuntimeEnv(_0x47a39d),_0x26ee4f=_0xf082a0(0x19b)+'@'+_0xd7dec6;console['log'](_0xf082a0(0x227)+_0xf082a0(0x180)+_0xf082a0(0x17f)+_0xf082a0(0x275)+'\x20'+_0x26ee4f);const _0x2985b6=await runProcess(_0x47a39d[_0xf082a0(0x2c7)+_0xf082a0(0x138)],[_0x47a39d[_0xf082a0(0x1b6)],_0xf082a0(0x317),_0x26ee4f,'--json'],{'cwd':_0x1ff94c,'env':_0x29b405,'label':_0xf082a0(0x206)+'\x20'+_0x26ee4f}),_0x384f26=parseNpmPackJson(_0x2985b6[_0xf082a0(0x13c)]);if(_0x384f26[_0xf082a0(0x2db)]!==_0xd7dec6)throw new Error(_0xf082a0(0x140)+_0xf082a0(0x151)+_0xf082a0(0x266)+_0xd7dec6+(_0xf082a0(0x1c1)+_0xf082a0(0x153))+_0x384f26[_0xf082a0(0x2db)]);const _0x59d13e=resolve(_0x1ff94c,_0x384f26[_0xf082a0(0x28c)]);if(!existsSync(_0x59d13e))throw new Error(_0xf082a0(0x206)+_0xf082a0(0x2af)+_0xf082a0(0x1ec)+_0xf082a0(0x1be)+'\x20'+_0x59d13e);await runProcess('tar',[_0xf082a0(0x2f0),_0x59d13e,'-C',_0x440dba],{'label':_0xf082a0(0x2c3)+_0x384f26[_0xf082a0(0x28c)]}),await removePathWithRetries(_0x47a39d['openclaw'+_0xf082a0(0x169)+'ir']),await rename(join(_0x440dba,'package'),_0x47a39d[_0xf082a0(0x19b)+_0xf082a0(0x169)+'ir']),await removePathWithRetries(_0x440dba),await runProcess(_0x47a39d[_0xf082a0(0x2c7)+_0xf082a0(0x138)],[_0x47a39d['npmCli'],_0xf082a0(0x2b5),_0xf082a0(0x30a)+'ev',_0xf082a0(0x267)+_0xf082a0(0x17c),_0xf082a0(0x1a7)+'it',_0xf082a0(0x18f)+'d',_0xf082a0(0x1c7)+_0xf082a0(0x13a)+'ps'],{'cwd':_0x47a39d[_0xf082a0(0x19b)+'WorkingD'+'ir'],'env':_0x29b405,'label':_0xf082a0(0x309)+_0xf082a0(0x330)+_0x26ee4f+(_0xf082a0(0x29c)+_0xf082a0(0x186)+'ncies')});if(!existsSync(_0x47a39d['openclaw'+_0xf082a0(0x21d)]))throw new Error(_0xf082a0(0x1e3)+_0xf082a0(0x163)+'\x20not\x20fou'+_0xf082a0(0x328)+'\x20install'+':\x20'+_0x47a39d[_0xf082a0(0x19b)+'Bin']);}async function ensureRuntimeBase(_0x460e89,_0x57c466,_0x32bf16={}){const _0x3a31b5=_0x30af49;await mkdir(_0x57c466,{'recursive':!![]});let _0x4be06e=await readRuntimeManifest(_0x57c466);const _0x32c155=_0x460e89[_0x3a31b5(0x19b)]['nodeVers'+_0x3a31b5(0x229)],_0x36e926=_0x460e89[_0x3a31b5(0x19b)]['openclaw'+_0x3a31b5(0x26f)],_0x462bc2=existsSync(resolveManifestPath(_0x57c466)),_0x495aa2=runtimeHasRequiredPaths(_0x57c466,_0x4be06e),_0x2f0342=_0x4be06e[_0x3a31b5(0x1d0)+_0x3a31b5(0x229)]===_0x32c155;!_0x462bc2||!_0x495aa2||!_0x2f0342?(_0x32bf16[_0x3a31b5(0x1c4)+_0x3a31b5(0x23b)]?.[_0x3a31b5(0x144)]('runtime\x20'+_0x3a31b5(0x193)+'ld\x20start'+'ed',{'runtimeRoot':_0x57c466,'reason':!_0x462bc2?_0x3a31b5(0x1d7)+'manifest':!_0x495aa2?_0x3a31b5(0x1d7)+'required'+_0x3a31b5(0x29c)+_0x3a31b5(0x2b6):_0x3a31b5(0x2ad)+_0x3a31b5(0x2b1)+_0x3a31b5(0x327),'syncOnly':_0x32bf16['syncOnly']}),_0x4be06e=await buildRuntimeBase(_0x460e89,_0x57c466,_0x4be06e),_0x32bf16[_0x3a31b5(0x1c4)+_0x3a31b5(0x23b)]?.[_0x3a31b5(0x144)](_0x3a31b5(0x205)+_0x3a31b5(0x193)+_0x3a31b5(0x251)+'eted',{'manifest':summarizeRuntimeManifest(_0x4be06e)})):_0x32bf16['runtimeL'+_0x3a31b5(0x23b)]?.[_0x3a31b5(0x144)](_0x3a31b5(0x205)+_0x3a31b5(0x319)+'eady\x20cur'+'rent',{'manifest':summarizeRuntimeManifest(_0x4be06e)});if(!existsSync(resolve(_0x57c466,_0x4be06e[_0x3a31b5(0x19b)+_0x3a31b5(0x21d)]))){const _0x5777f4=createRuntimeInfoFromManifest(_0x57c466,_0x4be06e,{'allowMissingOpenClaw':!![]});await installOpenClawPackage(_0x5777f4,_0x36e926),_0x4be06e['openclaw'+'Version']=_0x36e926;}return _0x4be06e;}function runtimeHasRequiredPaths(_0x35fdda,_0x1dc174){const _0x22448e=_0x30af49;return[_0x22448e(0x2c7)+_0x22448e(0x138),_0x22448e(0x1b6),_0x22448e(0x19b)+_0x22448e(0x169)+'ir','openclaw'+_0x22448e(0x21d)][_0x22448e(0x210)](_0x4235be=>typeof _0x1dc174[_0x4235be]===_0x22448e(0x1ac)&&_0x1dc174[_0x4235be][_0x22448e(0x23c)]())&&[_0x22448e(0x2c7)+'utable',_0x22448e(0x1b6)][_0x22448e(0x210)](_0x42cf5c=>existsSync(resolve(_0x35fdda,_0x1dc174[_0x42cf5c])));}async function buildRuntimeBase(_0x533d64,_0x19178b,_0x56aa8e={}){const _0x4deff2=_0x30af49,_0x10a2b0=join(_0x19178b,_0x4deff2(0x27b));await ensureRuntimeNode(_0x533d64,_0x10a2b0);const _0x4366be={..._0x56aa8e,'generatedAt':new Date()[_0x4deff2(0x322)+_0x4deff2(0x329)](),'nodeVersion':_0x533d64[_0x4deff2(0x19b)][_0x4deff2(0x1d0)+_0x4deff2(0x229)],'openclawVersion':_0x56aa8e[_0x4deff2(0x19b)+_0x4deff2(0x26f)]||'','platform':process[_0x4deff2(0x1d1)],'arch':process[_0x4deff2(0x1e1)],'nodeExecutable':_0x4deff2(0x14b)+_0x4deff2(0x2f1),'npmCli':_0x4deff2(0x33a)+'/node_mo'+'dules/np'+_0x4deff2(0x189)+_0x4deff2(0x2dc),'openclawWorkingDir':_0x4deff2(0x19b),'openclawBin':_0x4deff2(0x19b)+_0x4deff2(0x19d)+'w.mjs'};return await writeJson(resolveManifestPath(_0x19178b),_0x4366be),_0x4366be;}async function removePathWithRetries(_0x51c595){await rm(_0x51c595,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96});}async function ensureRuntimeNode(_0x4b3325,_0x2a0fab){const _0x3fc686=_0x30af49,_0x5b87f3=_0x4b3325[_0x3fc686(0x19b)][_0x3fc686(0x1d0)+_0x3fc686(0x229)],_0x21aec3=join(_0x2a0fab,_0x3fc686(0x2a3),_0x3fc686(0x27b)),_0x2da232=join(_0x2a0fab,_0x3fc686(0x273),'node_mod'+_0x3fc686(0x17e),'npm',_0x3fc686(0x2a3),'npm-cli.'+'js');if(existsSync(_0x21aec3)&&existsSync(_0x2da232)&&await getNodeVersion(_0x21aec3)===_0x5b87f3)return;await removePathWithRetries(_0x2a0fab);if(process[_0x3fc686(0x132)][_0x3fc686(0x27b)]===_0x5b87f3){await linkCurrentNodeRuntime(_0x2a0fab);return;}await downloadNodeRuntime(_0x5b87f3,_0x2a0fab);}async function getNodeVersion(_0x4b10ca){const _0x535d6d=_0x30af49;try{const _0x78e30c=await runProcess(_0x4b10ca,['-p',_0x535d6d(0x1eb)+'versions'+_0x535d6d(0x2e7)],{'label':_0x4b10ca+_0x535d6d(0x165),'timeoutMs':0x7530});return _0x78e30c['stdout'][_0x535d6d(0x23c)]();}catch{return'';}}async function linkCurrentNodeRuntime(_0xa8d4d6){const _0x1b6120=_0x30af49,_0x3a9745=process[_0x1b6120(0x33b)],_0x19cd35=resolve(dirname(_0x3a9745),'..'),_0x405ede=resolve(_0x19cd35,_0x1b6120(0x318)+_0x1b6120(0x29a)+_0x1b6120(0x2ee)),_0x94bafb=join(_0xa8d4d6,_0x1b6120(0x2a3),_0x1b6120(0x27b)),_0x5cbfcc=join(_0xa8d4d6,'lib','node_mod'+_0x1b6120(0x17e),'npm');await mkdir(dirname(_0x94bafb),{'recursive':!![]}),await mkdir(dirname(_0x5cbfcc),{'recursive':!![]}),await symlink(_0x3a9745,_0x94bafb),existsSync(_0x405ede)?await symlink(_0x405ede,_0x5cbfcc):await symlink(await resolveNpmRoot(),_0x5cbfcc);}async function resolveNpmRoot(){const _0x7c32d0=_0x30af49,_0x4277c6=await runProcess(_0x7c32d0(0x307),[_0x7c32d0(0x29d),'-g'],{'label':'npm\x20root'+_0x7c32d0(0x2ba),'timeoutMs':0x7530}),_0x35039e=join(_0x4277c6[_0x7c32d0(0x13c)][_0x7c32d0(0x23c)](),_0x7c32d0(0x307));if(!existsSync(join(_0x35039e,'bin',_0x7c32d0(0x2de)+'js')))throw new Error(_0x7c32d0(0x206)+_0x7c32d0(0x1f3)+_0x7c32d0(0x25c)+_0x7c32d0(0x21a)+_0x7c32d0(0x1f9)+_0x7c32d0(0x1cf)+_0x7c32d0(0x303)+_0x35039e);return _0x35039e;}async function downloadNodeRuntime(_0x1cf3e6,_0x5e22b0){const _0x5b5285=_0x30af49,_0x469a51=process[_0x5b5285(0x1d1)]==='win32'?_0x5b5285(0x1cd):process[_0x5b5285(0x1d1)],_0x1ebda8=process['arch']===_0x5b5285(0x207)?_0x5b5285(0x207):process[_0x5b5285(0x1e1)]===_0x5b5285(0x17a)?_0x5b5285(0x17a):process[_0x5b5285(0x1e1)],_0x1d91a7=process[_0x5b5285(0x1d1)]==='win32'?_0x5b5285(0x249):_0x5b5285(0x32d),_0x2733f8=_0x5b5285(0x32f)+_0x1cf3e6+'-'+_0x469a51+'-'+_0x1ebda8,_0x572299=_0x2733f8+'.'+_0x1d91a7,_0x27c888=join(dirname(_0x5e22b0),_0x5b5285(0x30e)),_0x873279=join(_0x27c888,_0x572299),_0x471e7e=join(_0x27c888,_0x2733f8+(_0x5b5285(0x333)+'-')+process[_0x5b5285(0x2da)]+'-'+Date[_0x5b5285(0x14d)]()),_0x1b97c8='https://'+_0x5b5285(0x2f9)+_0x5b5285(0x13d)+'v'+_0x1cf3e6+'/'+_0x572299;await mkdir(_0x27c888,{'recursive':!![]}),!existsSync(_0x873279)&&(console['log'](_0x5b5285(0x227)+'hell:run'+_0x5b5285(0x2ca)+_0x5b5285(0x338)+'g\x20'+_0x1b97c8),await downloadFile(_0x1b97c8,_0x873279)),await rm(_0x471e7e,{'recursive':!![],'force':!![]}),await mkdir(_0x471e7e,{'recursive':!![]}),process[_0x5b5285(0x1d1)]==='win32'?await runProcess(_0x5b5285(0x2ab),['-q',_0x873279,'-d',_0x471e7e],{'label':_0x5b5285(0x2c3)+_0x572299}):await runProcess(_0x5b5285(0x26d),[_0x5b5285(0x290),_0x873279,'-C',_0x471e7e],{'label':_0x5b5285(0x2c3)+_0x572299}),await rename(join(_0x471e7e,_0x2733f8),_0x5e22b0),await rm(_0x471e7e,{'recursive':!![],'force':!![]});}async function downloadFile(_0x1b55ba,_0x2cf9df){await mkdir(dirname(_0x2cf9df),{'recursive':!![]});const _0x2b60b9=await new Promise((_0x1cea19,_0x5a42fc)=>{const _0x5801a8=_0x3e4d;get(_0x1b55ba,_0x4393f1=>{const _0x2fc40d=_0x3e4d;if(_0x4393f1[_0x2fc40d(0x287)+'de']>=0x12c&&_0x4393f1[_0x2fc40d(0x287)+'de']<0x190&&_0x4393f1[_0x2fc40d(0x142)][_0x2fc40d(0x171)]){_0x4393f1['resume'](),downloadFile(new URL(_0x4393f1['headers']['location'],_0x1b55ba)[_0x2fc40d(0x14a)],_0x2cf9df)[_0x2fc40d(0x179)](()=>_0x1cea19(null))[_0x2fc40d(0x1e6)](_0x5a42fc);return;}if(_0x4393f1[_0x2fc40d(0x287)+'de']!==0xc8){_0x4393f1[_0x2fc40d(0x1ef)](),_0x5a42fc(new Error('download'+'\x20failed\x20'+_0x4393f1[_0x2fc40d(0x287)+'de']+':\x20'+_0x1b55ba));return;}_0x1cea19(_0x4393f1);})['on'](_0x5801a8(0x16e),_0x5a42fc);});_0x2b60b9&&await pipeline(_0x2b60b9,createWriteStream(_0x2cf9df));}export async function ensureOpenClawDoctorFixed(_0xc77148,_0xb62b45={}){const _0x5e804e=_0x30af49,_0xac00de=await loadRuntimeInfo(_0xc77148[_0x5e804e(0x149)+_0x5e804e(0x28e)]),_0x2133e9=getConfigPaths(_0xc77148),_0x4ac493=join(_0x2133e9[_0x5e804e(0x1dd)+'tateDir'],'openclaw'+_0x5e804e(0x2c6)+_0x5e804e(0x2b7)),_0x2d1a98=await readJson(_0x4ac493,{});if(_0x2d1a98['openclaw'+_0x5e804e(0x26f)]===_0xac00de['openclaw'+'Version'])return _0xb62b45[_0x5e804e(0x1c4)+_0x5e804e(0x23b)]?.[_0x5e804e(0x144)](_0x5e804e(0x19b)+_0x5e804e(0x2d1)+_0x5e804e(0x30c)+_0x5e804e(0x21b)+_0x5e804e(0x336),{'openclawVersion':_0xac00de[_0x5e804e(0x19b)+_0x5e804e(0x26f)],'markerPath':_0x4ac493}),{'ran':![],'openclawVersion':_0xac00de[_0x5e804e(0x19b)+_0x5e804e(0x26f)],'markerPath':_0x4ac493};return await runOpenClawDoctorFix(_0xc77148,_0xac00de,{'fromVersion':_0x2d1a98[_0x5e804e(0x19b)+_0x5e804e(0x26f)]||_0x5e804e(0x2ce),'toVersion':_0xac00de[_0x5e804e(0x19b)+_0x5e804e(0x26f)],'markerPath':_0x4ac493,'runtimeLogger':_0xb62b45[_0x5e804e(0x1c4)+_0x5e804e(0x23b)]}),{'ran':!![],'openclawVersion':_0xac00de[_0x5e804e(0x19b)+_0x5e804e(0x26f)],'markerPath':_0x4ac493};}async function runOpenClawDoctorFix(_0x529355,_0x2ac6ed,{fromVersion:_0xdddeaf,toVersion:_0x187115,markerPath:markerPath='',runtimeLogger:_0xc04747}={}){const _0x3e0eb7=_0x30af49;_0xc04747?.[_0x3e0eb7(0x144)]('openclaw'+_0x3e0eb7(0x2d1)+_0x3e0eb7(0x15f)+'ted',{'fromVersion':_0xdddeaf,'toVersion':_0x187115});const _0x203d72=await createRuntimeEnv(_0x2ac6ed,{'OPENCLAW_HOME':_0x529355[_0x3e0eb7(0x16b)],'OPENCLAW_STATE_DIR':_0x529355[_0x3e0eb7(0x16b)],'OPENCLAW_CONFIG_PATH':getConfigPaths(_0x529355)[_0x3e0eb7(0x146)+'th']});console[_0x3e0eb7(0x26c)](_0x3e0eb7(0x227)+_0x3e0eb7(0x180)+_0x3e0eb7(0x2fe)+_0x3e0eb7(0x1cb)+'enclaw\x20d'+'octor\x20--'+_0x3e0eb7(0x1ff));const _0xcf2b4f=await runProcess(_0x2ac6ed[_0x3e0eb7(0x2c7)+'utable'],[_0x2ac6ed[_0x3e0eb7(0x19b)+'Bin'],'doctor',_0x3e0eb7(0x2d7)],{'cwd':_0x2ac6ed[_0x3e0eb7(0x19b)+'WorkingD'+'ir'],'env':_0x203d72,'label':_0x3e0eb7(0x19b)+_0x3e0eb7(0x2d1)+'--fix','timeoutMs':0x1d4c0});_0xc04747?.[_0x3e0eb7(0x144)](_0x3e0eb7(0x19b)+_0x3e0eb7(0x2d1)+_0x3e0eb7(0x2be)+'leted',{'fromVersion':_0xdddeaf,'toVersion':_0x187115,'stdout':_0xcf2b4f[_0x3e0eb7(0x13c)][_0x3e0eb7(0x23c)]()['slice'](-0xfa0),'stderr':_0xcf2b4f[_0x3e0eb7(0x2c0)]['trim']()[_0x3e0eb7(0x22f)](-0xfa0)}),markerPath&&(await writeJson(markerPath,{'openclawVersion':_0x2ac6ed[_0x3e0eb7(0x19b)+'Version'],'fixedAt':new Date()[_0x3e0eb7(0x322)+'ing']()}),_0xc04747?.['info'](_0x3e0eb7(0x19b)+_0x3e0eb7(0x2d1)+_0x3e0eb7(0x155)+_0x3e0eb7(0x2e2)+'en',{'markerPath':markerPath,'openclawVersion':_0x2ac6ed[_0x3e0eb7(0x19b)+_0x3e0eb7(0x26f)]}));}export async function readRuntimeManifest(_0x3c8c7b){return await readJson(resolveManifestPath(_0x3c8c7b),{});}export async function loadRuntimeInfo(_0x55874a){const _0x8cfb8e=resolveRuntimeRoot(_0x55874a),_0x496f3a=await readRuntimeManifest(_0x8cfb8e);return createRuntimeInfoFromManifest(_0x8cfb8e,_0x496f3a);}function createRuntimeInfoFromManifest(_0x4edc8b,_0x16dae1,_0x4f76e4={}){const _0x53896c=_0x30af49;for(const _0x3207eb of[_0x53896c(0x2c7)+_0x53896c(0x138),_0x53896c(0x1b6),_0x53896c(0x19b)+'WorkingD'+'ir','openclaw'+_0x53896c(0x21d)]){if(typeof _0x16dae1[_0x3207eb]!==_0x53896c(0x1ac)||!_0x16dae1[_0x3207eb][_0x53896c(0x23c)]())throw new Error(_0x53896c(0x205)+_0x53896c(0x27f)+_0x53896c(0x316)+_0x53896c(0x321)+_0x3207eb+'\x22\x20at\x20'+resolveManifestPath(_0x4edc8b)+(';\x20run\x20wu'+_0x53896c(0x2e9)+'l\x20prepar'+'e'));}const _0x377134=resolve(_0x4edc8b,_0x16dae1[_0x53896c(0x2c7)+'utable']),_0x24441c=resolve(_0x4edc8b,_0x16dae1[_0x53896c(0x1b6)]),_0x59b5bc=resolve(_0x4edc8b,_0x16dae1['openclaw'+_0x53896c(0x169)+'ir']),_0x39c89f=resolve(_0x4edc8b,_0x16dae1[_0x53896c(0x19b)+_0x53896c(0x21d)]),_0x4eaaf4=Array[_0x53896c(0x248)](_0x16dae1[_0x53896c(0x28a)])?_0x16dae1['plugins'][_0x53896c(0x209)](_0x34be04=>({..._0x34be04,'installPath':resolve(_0x4edc8b,_0x34be04[_0x53896c(0x1a6)+_0x53896c(0x1a5)])})):[],_0x2f8f05=_0x4f76e4[_0x53896c(0x28d)+'singOpen'+_0x53896c(0x1b0)]?[_0x377134,_0x24441c]:[_0x377134,_0x24441c,_0x59b5bc,_0x39c89f];for(const _0xb772d8 of _0x2f8f05){if(!existsSync(_0xb772d8))throw new Error(_0x53896c(0x205)+_0x53896c(0x1d7)+_0x53896c(0x23a)+_0xb772d8);}return{'runtimeRoot':_0x4edc8b,'manifest':_0x16dae1,'openclawVersion':_0x16dae1[_0x53896c(0x19b)+'Version']||_0x53896c(0x2ce),'nodeExecutable':_0x377134,'npmCli':_0x24441c,'openclawWorkingDir':_0x59b5bc,'openclawBin':_0x39c89f,'plugins':_0x4eaaf4};}export async function spawnClaw(_0x571853,_0x532446=[],_0x3a2fac={}){const _0x56ccc7=_0x30af49,_0xe399b7=await loadRuntimeInfo(_0x571853),_0x44485d=await createRuntimeEnv(_0xe399b7,_0x3a2fac[_0x56ccc7(0x19f)]??{});return spawn(_0xe399b7[_0x56ccc7(0x2c7)+_0x56ccc7(0x138)],[_0xe399b7['openclaw'+_0x56ccc7(0x21d)],..._0x532446],{'cwd':_0xe399b7[_0x56ccc7(0x19b)+'WorkingD'+'ir'],'stdio':'pipe',..._0x3a2fac,'env':_0x44485d});}export async function runClawOnce(_0x3ce4ef,_0xe1d0a3=[],_0x6713dc=0x15f90){const _0x2cd3b5=await spawnClaw(_0x3ce4ef,_0xe1d0a3);return await new Promise((_0x20e540,_0x499a1c)=>{const _0x21a06b=_0x3e4d;let _0x12be5d='',_0x4ef051='',_0x59f713=![];const _0x5df7a5=setTimeout(()=>{const _0x4230c1=_0x3e4d;if(_0x59f713)return;_0x59f713=!![],_0x2cd3b5[_0x4230c1(0x137)](_0x4230c1(0x18e)),_0x499a1c(new Error(_0x4230c1(0x19b)+_0x4230c1(0x325)+_0x4230c1(0x26a)+'\x20'+_0x6713dc+'ms'));},_0x6713dc);_0x2cd3b5[_0x21a06b(0x13c)]['on'](_0x21a06b(0x21f),_0x566bb2=>{const _0x3a85c8=_0x21a06b;_0x12be5d+=_0x566bb2[_0x3a85c8(0x24d)]();}),_0x2cd3b5[_0x21a06b(0x2c0)]['on'](_0x21a06b(0x21f),_0x1b4212=>{_0x4ef051+=_0x1b4212['toString']();}),_0x2cd3b5['on'](_0x21a06b(0x16e),_0xe1c717=>{if(_0x59f713)return;_0x59f713=!![],clearTimeout(_0x5df7a5),_0x499a1c(_0xe1c717);}),_0x2cd3b5['on'](_0x21a06b(0x1ca),(_0x58f8a1,_0x1a55c9)=>{if(_0x59f713)return;_0x59f713=!![],clearTimeout(_0x5df7a5),_0x20e540({'code':_0x58f8a1,'signal':_0x1a55c9,'stdout':_0x12be5d,'stderr':_0x4ef051});});});}async function findRuntimeLarkCliBin(_0x1a47ed){const _0x38e491=_0x30af49,_0x395087=join(_0x1a47ed[_0x38e491(0x19b)+_0x38e491(0x169)+'ir'],_0x38e491(0x211)+'ules',_0x38e491(0x23f)+'te',_0x38e491(0x141)),_0x2fc813=join(_0x395087,'package.'+'json');if(!existsSync(_0x2fc813))return{'packageDir':_0x395087,'binPath':null};try{const _0x599a6e=JSON[_0x38e491(0x1af)](await readFile(_0x2fc813,_0x38e491(0x2f4))),_0x1e23f9=typeof _0x599a6e[_0x38e491(0x2a3)]==='string'?_0x599a6e[_0x38e491(0x2a3)]:_0x599a6e[_0x38e491(0x2a3)]&&typeof _0x599a6e[_0x38e491(0x2a3)]===_0x38e491(0x1f2)?_0x599a6e['bin'][_0x38e491(0x2bd)]||Object[_0x38e491(0x31b)](_0x599a6e['bin'])[0x0]:'';return{'packageDir':_0x395087,'binPath':_0x1e23f9?join(_0x395087,_0x1e23f9):null};}catch{return{'packageDir':_0x395087,'binPath':null};}}export async function resolveRuntimeLarkCliCommand(_0x15b2e2){const _0xbffcbb=_0x30af49,{packageDir:_0x333551,binPath:_0x568d59}=await findRuntimeLarkCliBin(_0x15b2e2);if(!_0x568d59||!existsSync(_0x568d59))throw new Error(_0xbffcbb(0x1dc)+_0xbffcbb(0x23f)+_0xbffcbb(0x2e3)+'s\x20missin'+_0xbffcbb(0x314)+'penClaw\x20'+_0xbffcbb(0x14e)+'\x20'+_0x333551+('.\x20Run\x20\x22w'+'ujie-she'+'ll\x20prepa'+_0xbffcbb(0x299)+'ebuild\x20t'+_0xbffcbb(0x269)+_0xbffcbb(0x305)));return{'nodeExecutable':_0x15b2e2[_0xbffcbb(0x2c7)+_0xbffcbb(0x138)],'scriptPath':_0x568d59,'packageDir':_0x333551};}function resolvePackageNameFromNpmSpec(_0x37d197){const _0x4d7ec0=_0x30af49,_0x321531=_0x37d197[_0x4d7ec0(0x23c)]()[_0x4d7ec0(0x1f5)](/^npm:/,'');if(!_0x321531)throw new Error(_0x4d7ec0(0x2f3)+'empty\x20pl'+_0x4d7ec0(0x15d)+'c');if(_0x321531['startsWi'+'th']('@')){const _0x23b346=_0x321531['indexOf']('/');if(_0x23b346===-0x1)throw new Error('Invalid\x20'+_0x4d7ec0(0x289)+'pec:\x20'+_0x37d197);const _0x45f6d6=_0x321531[_0x4d7ec0(0x2bc)]('@',_0x23b346+0x1);return _0x45f6d6===-0x1?_0x321531:_0x321531[_0x4d7ec0(0x22f)](0x0,_0x45f6d6);}const _0x4a18b4=_0x321531[_0x4d7ec0(0x2bc)]('@');return _0x4a18b4===-0x1?_0x321531:_0x321531[_0x4d7ec0(0x22f)](0x0,_0x4a18b4);}async function createRuntimeEnv(_0x22ccd9,_0x2c2cf7={}){const _0x1dd821=_0x30af49,_0x117d3b=process.env.OPENCLAW_STATE_DIR||'',_0x5bc0f5=process.env.NPM_CONFIG_REGISTRY||_0x1dd821(0x2c8)+_0x1dd821(0x184)+_0x1dd821(0x236)+_0x1dd821(0x2b0),_0x39af5d=_0x117d3b?join(_0x117d3b,_0x1dd821(0x159)+_0x1dd821(0x292)+'ls'):join(_0x22ccd9[_0x1dd821(0x2df)+_0x1dd821(0x28e)],'.tools'),_0x42d6c3=join(_0x39af5d,_0x1dd821(0x312)+'al'),_0x1c1a15=join(_0x39af5d,_0x1dd821(0x2ff)+'e'),_0x21d6f1=join(_0x42d6c3,_0x1dd821(0x2a3));await mkdir(_0x21d6f1,{'recursive':!![]}),await mkdir(_0x1c1a15,{'recursive':!![]});const _0x169237=[_0x21d6f1,dirname(_0x22ccd9[_0x1dd821(0x2c7)+'utable']),process.env.PATH||''];return{...process.env,..._0x2c2cf7,'PATH':_0x169237['filter'](Boolean)['join'](delimiter),'npm_config_prefix':_0x42d6c3,'NPM_CONFIG_PREFIX':_0x42d6c3,'npm_config_cache':_0x1c1a15,'NPM_CONFIG_CACHE':_0x1c1a15,'NPM_CONFIG_REGISTRY':_0x5bc0f5,'npm_execpath':_0x22ccd9['npmCli'],'npm_node_execpath':_0x22ccd9[_0x1dd821(0x2c7)+_0x1dd821(0x138)],'OPENCLAW_RUNTIME_NPM_PREFIX':_0x42d6c3,'OPENCLAW_RUNTIME_NPM_BIN':_0x21d6f1};}export async function getRuntimeSpawnContext(_0x15eaa1,_0x421af1={}){const _0x2b5c8f=_0x30af49,_0x54e82d=await loadRuntimeInfo(_0x15eaa1),_0x5ad35f=await createRuntimeEnv(_0x54e82d,_0x421af1);return{'cwd':_0x54e82d[_0x2b5c8f(0x19b)+_0x2b5c8f(0x169)+'ir'],'env':_0x5ad35f,'runtime':_0x54e82d};}function resolvePluginDirNameFromSpec(_0x3ba9f8){const _0x30ce4b=_0x30af49,_0x2514d9=resolvePackageNameFromNpmSpec(_0x3ba9f8),_0x2d0246=_0x2514d9[_0x30ce4b(0x1de)]('/')[_0x30ce4b(0x250)](Boolean),_0x325a45=_0x2d0246['at'](-0x1)??'';if(!_0x325a45)throw new Error('Invalid\x20'+_0x30ce4b(0x221)+'pec:\x20'+_0x3ba9f8);return _0x325a45;}async function resolvePluginIdFromPackageDir(_0x2be043,_0x29212b){const _0x2e512a=_0x30af49,_0x18d6aa=await readJson(join(_0x2be043,'package.'+_0x2e512a(0x2b7)),{}),_0x48fa9c=await readPluginManifest(_0x2be043),_0x339472=[_0x48fa9c?.['id'],_0x48fa9c?.['pluginId'],_0x48fa9c?.[_0x2e512a(0x187)],_0x18d6aa?.[_0x2e512a(0x19b)]?.['id'],_0x18d6aa?.[_0x2e512a(0x19b)+'Id'],_0x29212b],_0x213346=_0x339472['find'](_0x2ad229=>typeof _0x2ad229===_0x2e512a(0x1ac)&&_0x2ad229['trim']());if(!_0x213346)throw new Error(_0x2e512a(0x2b8)+_0x2e512a(0x191)+_0x2e512a(0x2e6)+'\x20id\x20from'+'\x20'+_0x2be043);return _0x213346[_0x2e512a(0x23c)]();}function pluginSpecMatches(_0x126d67,_0xefbd6){const _0x4b7721=_0x30af49,_0x58527b=_0xefbd6[_0x4b7721(0x23c)](),_0x44031a=resolvePackageNameFromNpmSpec(_0x58527b);return[_0x126d67[_0x4b7721(0x175)],_0x126d67['resolved'+_0x4b7721(0x276)],_0x126d67[_0x4b7721(0x1a2)+_0x4b7721(0x18d)]]['some'](_0x14f6ea=>_0x14f6ea===_0x58527b||_0x14f6ea===_0x44031a);}async function installPluginFromNpmSpec(_0x75bfa1,_0x5dabfe,_0x452eb8={}){const _0x513566=_0x30af49,_0x82f93a=_0x75bfa1['trim']()[_0x513566(0x1f5)](/^npm:/,''),_0x316eab=resolvePluginDirNameFromSpec(_0x82f93a),_0x5bb066=join(_0x5dabfe[_0x513566(0x19b)+'WorkingD'+'ir'],'dist',_0x513566(0x19e)+'ns'),_0x45abeb=join(_0x5bb066,_0x316eab),_0x52361f=join(_0x5dabfe[_0x513566(0x2df)+_0x513566(0x28e)],_0x513566(0x212)+_0x513566(0x2a4)+process[_0x513566(0x2da)]+'-'+Date[_0x513566(0x14d)]()),_0x314dba=await createRuntimeEnv(_0x5dabfe),_0x53f90c=new Date()['toISOStr'+_0x513566(0x329)](),_0x45b22a=join(_0x5dabfe['runtimeR'+_0x513566(0x28e)],'.cache');await mkdir(_0x45b22a,{'recursive':!![]}),await rm(_0x52361f,{'recursive':!![],'force':!![]}),await rm(_0x45abeb,{'recursive':!![],'force':!![]}),await mkdir(_0x52361f,{'recursive':!![]}),await mkdir(_0x5bb066,{'recursive':!![]}),console[_0x513566(0x26c)]('[wujie-s'+_0x513566(0x180)+'time]\x20fe'+'tching\x20p'+_0x513566(0x261)+_0x82f93a);const _0x320aea=await runProcess(_0x5dabfe[_0x513566(0x2c7)+_0x513566(0x138)],[_0x5dabfe['npmCli'],_0x513566(0x317),_0x82f93a,_0x513566(0x224)],{'cwd':_0x45b22a,'env':_0x314dba,'label':'npm\x20pack'+'\x20'+_0x82f93a}),_0x1cee29=parseNpmPackJson(_0x320aea[_0x513566(0x13c)]),_0x26b631=normalizePackedTarballFilename(_0x1cee29['filename']),_0x3a4e91=join(_0x45b22a,_0x26b631);if(!existsSync(_0x3a4e91))throw new Error('npm\x20pack'+_0x513566(0x2af)+'\x20create\x20'+_0x513566(0x1be)+'\x20'+_0x3a4e91);await runProcess(_0x513566(0x26d),[_0x513566(0x2f0),_0x3a4e91,'-C',_0x52361f],{'label':_0x513566(0x2c3)+_0x26b631}),await rename(join(_0x52361f,_0x513566(0x1e5)),_0x45abeb),await rm(_0x52361f,{'recursive':!![],'force':!![]});const _0x1933a5=join(_0x45abeb,'package.'+_0x513566(0x2b7)),_0x3f5dc4=await readJson(_0x1933a5,{});(_0x3f5dc4['devDepen'+_0x513566(0x23d)]||_0x3f5dc4[_0x513566(0x286)])&&(delete _0x3f5dc4[_0x513566(0x152)+_0x513566(0x23d)],delete _0x3f5dc4[_0x513566(0x286)],await writeJson(_0x1933a5,_0x3f5dc4));await runProcess(_0x5dabfe[_0x513566(0x2c7)+_0x513566(0x138)],[_0x5dabfe[_0x513566(0x1b6)],_0x513566(0x2b5),'--omit=d'+'ev','--omit=p'+'eer','--no-aud'+'it',_0x513566(0x18f)+'d','--legacy'+_0x513566(0x13a)+'ps'],{'cwd':_0x45abeb,'env':_0x314dba,'label':_0x513566(0x309)+'all\x20plug'+_0x513566(0x1ce)+_0x82f93a});const _0x805fb1=new Date()['toISOStr'+'ing'](),_0x129d14=await resolvePluginIdFromPackageDir(_0x45abeb,_0x1cee29[_0x513566(0x187)]);return _0x452eb8[_0x513566(0x1c4)+_0x513566(0x23b)]?.[_0x513566(0x144)](_0x513566(0x1fb)+_0x513566(0x31e)+_0x513566(0x1b4),{'spec':_0x82f93a,'pluginId':_0x129d14,'installPath':_0x45abeb}),{'pluginId':_0x129d14,'source':_0x513566(0x307),'spec':_0x82f93a,'installPath':toRuntimeRelative(_0x5dabfe['runtimeR'+_0x513566(0x28e)],_0x45abeb),'version':_0x1cee29[_0x513566(0x2db)],'resolvedName':_0x1cee29[_0x513566(0x187)],'resolvedVersion':_0x1cee29[_0x513566(0x2db)],'resolvedSpec':_0x1cee29[_0x513566(0x187)]+'@'+_0x1cee29['version'],'integrity':typeof _0x1cee29['integrit'+'y']===_0x513566(0x1ac)?_0x1cee29[_0x513566(0x1a1)+'y']:'','shasum':typeof _0x1cee29[_0x513566(0x1ba)]==='string'?_0x1cee29[_0x513566(0x1ba)]:'','resolvedAt':_0x53f90c,'installedAt':_0x805fb1};}async function syncConfiguredNpmPlugins(_0x4d2d38,_0x4e0151,_0x3fabf2,_0x225fdb={}){const _0x25ef53=_0x30af49;if(_0x225fdb[_0x25ef53(0x214)])return;const _0x20f932=createRuntimeInfoFromManifest(_0x4e0151,_0x3fabf2),_0x347526=Array[_0x25ef53(0x248)](_0x3fabf2[_0x25ef53(0x28a)])?_0x3fabf2[_0x25ef53(0x28a)]:[],_0x250a7d=[];for(const _0x3e37bc of _0x4d2d38['openclaw']['pluginSp'+_0x25ef53(0x235)]){const _0x2e1f14=_0x347526[_0x25ef53(0x133)](_0x1edc10=>_0x1edc10?.[_0x25ef53(0x172)]===_0x25ef53(0x307)&&pluginSpecMatches(_0x1edc10,_0x3e37bc)&&typeof _0x1edc10['installP'+'ath']===_0x25ef53(0x1ac)&&existsSync(resolve(_0x4e0151,_0x1edc10[_0x25ef53(0x1a6)+_0x25ef53(0x1a5)])));if(_0x2e1f14){_0x250a7d[_0x25ef53(0x234)](_0x2e1f14);continue;}_0x250a7d[_0x25ef53(0x234)](await installPluginFromNpmSpec(_0x3e37bc,_0x20f932,_0x225fdb));}const _0x47c8c9=new Set(_0x4d2d38[_0x25ef53(0x19b)][_0x25ef53(0x188)+_0x25ef53(0x235)][_0x25ef53(0x209)](resolvePackageNameFromNpmSpec)),_0xc34dfd=_0x347526[_0x25ef53(0x250)](_0x7e5c55=>_0x7e5c55?.[_0x25ef53(0x172)]!==_0x25ef53(0x307)||!_0x47c8c9[_0x25ef53(0x2dd)](resolvePackageNameFromNpmSpec(_0x7e5c55['resolved'+_0x25ef53(0x18d)]||_0x7e5c55[_0x25ef53(0x175)]||'')));_0x3fabf2[_0x25ef53(0x28a)]=[..._0xc34dfd,..._0x250a7d];}function hasRuntimeDependencies(_0x29b83d){const _0x57d6a8=_0x30af49,_0x560083=_0x29b83d?.[_0x57d6a8(0x1bc)+_0x57d6a8(0x294)]&&typeof _0x29b83d['dependen'+'cies']===_0x57d6a8(0x1f2)?Object[_0x57d6a8(0x1aa)](_0x29b83d[_0x57d6a8(0x1bc)+_0x57d6a8(0x294)]):[],_0x2e9252=_0x29b83d?.[_0x57d6a8(0x17d)+'Dependen'+_0x57d6a8(0x294)]&&typeof _0x29b83d[_0x57d6a8(0x17d)+'Dependen'+'cies']==='object'?Object['keys'](_0x29b83d['optional'+_0x57d6a8(0x136)+_0x57d6a8(0x294)]):[];return _0x560083[_0x57d6a8(0x1c3)]>0x0||_0x2e9252['length']>0x0;}async function installLocalPluginRuntimeDependencies(_0xd84df4,_0x283602,_0x488e20){const _0xc3dc3a=_0x30af49,_0x66c394=join(_0xd84df4,_0xc3dc3a(0x260)+_0xc3dc3a(0x2b7)),_0x332d34=await readJson(_0x66c394,{});(_0x332d34[_0xc3dc3a(0x152)+'dencies']||_0x332d34['scripts'])&&(delete _0x332d34[_0xc3dc3a(0x152)+'dencies'],delete _0x332d34[_0xc3dc3a(0x286)],await writeJson(_0x66c394,_0x332d34));if(!hasRuntimeDependencies(_0x332d34))return;const _0x36f9de=await createRuntimeEnv(_0x283602);console[_0xc3dc3a(0x26c)](_0xc3dc3a(0x227)+_0xc3dc3a(0x180)+_0xc3dc3a(0x17f)+_0xc3dc3a(0x275)+_0xc3dc3a(0x30d)+_0xc3dc3a(0x1ad)+_0xc3dc3a(0x208)+'es\x20'+_0xd84df4),await runProcess(_0x283602[_0xc3dc3a(0x2c7)+'utable'],[_0x283602[_0xc3dc3a(0x1b6)],_0xc3dc3a(0x2b5),_0xc3dc3a(0x30a)+'ev',_0xc3dc3a(0x267)+_0xc3dc3a(0x17c),_0xc3dc3a(0x1a7)+'it','--no-fun'+'d',_0xc3dc3a(0x1c7)+_0xc3dc3a(0x13a)+'ps'],{'cwd':_0xd84df4,'env':_0x36f9de,'label':_0xc3dc3a(0x309)+'all\x20loca'+_0xc3dc3a(0x337)+'\x20'+_0xd84df4}),_0x488e20[_0xc3dc3a(0x1c4)+_0xc3dc3a(0x23b)]?.[_0xc3dc3a(0x144)](_0xc3dc3a(0x28b)+_0xc3dc3a(0x161)+_0xc3dc3a(0x18a)+_0xc3dc3a(0x1bd)+_0xc3dc3a(0x25d),{'installPath':_0xd84df4});}async function syncSharedPluginModules(_0x1a7322,_0x2d9b4e){const _0x59be5f=_0x30af49,_0x39d1fb=new Set();for(const _0x59818c of _0x1a7322){const _0x3ee05f=join(dirname(_0x59818c),_0x59be5f(0x31a));if(existsSync(_0x3ee05f))_0x39d1fb[_0x59be5f(0x324)](_0x3ee05f);}for(const _0x14872c of _0x39d1fb){await copyDirFresh(_0x14872c,join(_0x2d9b4e,'_shared'));}}async function syncProductPlugins(_0x4267ca,_0x16baaf,_0x3f2445,_0x2aade5={}){const _0x107988=_0x30af49,_0x455255=join(_0x16baaf,_0x107988(0x19b),'dist',_0x107988(0x19e)+'ns'),_0x403212=createRuntimeInfoFromManifest(_0x16baaf,_0x3f2445),_0x139965=[];await syncSharedPluginModules(_0x4267ca[_0x107988(0x19b)][_0x107988(0x1a2)+_0x107988(0x331)+_0x107988(0x181)],_0x455255);for(const _0x44010e of _0x4267ca[_0x107988(0x19b)][_0x107988(0x1a2)+'LocalPlu'+_0x107988(0x181)]){const _0x368b0b=await getPackageMetadata(_0x44010e),_0xa5478d=await readPluginManifest(_0x44010e),_0x26c280=join(_0x455255,_0x368b0b[_0x107988(0x18c)]);await copyDirFresh(_0x44010e,_0x26c280),await installLocalPluginRuntimeDependencies(_0x26c280,_0x403212,_0x2aade5),_0x139965[_0x107988(0x234)]({'pluginId':_0x368b0b['pluginId'],'source':_0x107988(0x225),'spec':'local:'+_0x44010e,'installPath':toRuntimeRelative(_0x16baaf,_0x26c280),'version':_0x368b0b[_0x107988(0x2db)],'resolvedName':_0x368b0b[_0x107988(0x187)],'resolvedVersion':_0x368b0b[_0x107988(0x2db)],'resolvedSpec':'local:'+_0x44010e,'integrity':'','shasum':'','resolvedAt':new Date()[_0x107988(0x322)+'ing'](),'installedAt':new Date()[_0x107988(0x322)+'ing'](),'agentScope':_0xa5478d['agentSco'+'pe'],'skills':_0xa5478d[_0x107988(0x24b)]});}const _0x48c259=new Set(_0x139965['map'](_0x204600=>_0x204600[_0x107988(0x18c)])),_0x209093=Array[_0x107988(0x248)](_0x3f2445[_0x107988(0x28a)])?_0x3f2445[_0x107988(0x28a)]['filter'](_0x163409=>!_0x48c259[_0x107988(0x2dd)](_0x163409['pluginId'])):[];_0x3f2445[_0x107988(0x28a)]=[..._0x209093,..._0x139965];}async function syncManifestPluginScope(_0x70f23b,_0x5ef734,_0xd40677){const _0x5f5d81=_0x30af49,_0x217a25=join(_0x5ef734,'openclaw',_0x5f5d81(0x2b3),'extensio'+'ns'),_0xed6d94=new Set(_0x70f23b[_0x5f5d81(0x19b)]['pluginSp'+_0x5f5d81(0x235)]??[]),_0x2102c5=new Set([..._0xed6d94][_0x5f5d81(0x209)](_0x5e12e2=>_0x5e12e2[_0x5f5d81(0x1f5)](/^npm:/,''))[_0x5f5d81(0x209)](_0xca079c=>{const _0x329d16=_0x5f5d81;if(_0xca079c[_0x329d16(0x31d)+'th']('@')){const _0x536468=_0xca079c[_0x329d16(0x1de)]('@');return _0x536468[_0x329d16(0x1c3)]>=0x3?'@'+_0x536468[0x1]:_0xca079c;}return _0xca079c[_0x329d16(0x1de)]('@')[0x0];})[_0x5f5d81(0x250)](Boolean)),_0x5a3910=new Set();for(const _0x228e27 of _0x70f23b[_0x5f5d81(0x19b)][_0x5f5d81(0x1a2)+_0x5f5d81(0x331)+_0x5f5d81(0x181)]){const _0x3e1a26=await getPackageMetadata(_0x228e27);if(_0x3e1a26[_0x5f5d81(0x18c)])_0x5a3910[_0x5f5d81(0x324)](_0x3e1a26[_0x5f5d81(0x18c)]);}const _0x1da548=Array['isArray'](_0xd40677[_0x5f5d81(0x28a)])?_0xd40677['plugins']:[];_0xd40677[_0x5f5d81(0x188)+'ecs']=[..._0x70f23b[_0x5f5d81(0x19b)][_0x5f5d81(0x188)+'ecs'],..._0x70f23b[_0x5f5d81(0x19b)]['resolved'+_0x5f5d81(0x331)+'ginPaths'][_0x5f5d81(0x209)](_0x59c90f=>'local:'+_0x59c90f)],_0xd40677[_0x5f5d81(0x28a)]=_0x1da548[_0x5f5d81(0x250)](_0x25e44a=>{const _0x487ae8=_0x5f5d81;if(!_0x25e44a||typeof _0x25e44a!==_0x487ae8(0x1f2))return![];if(_0x25e44a[_0x487ae8(0x172)]==='local')return _0x5a3910[_0x487ae8(0x2dd)](_0x25e44a[_0x487ae8(0x18c)]);if(_0x25e44a['source']===_0x487ae8(0x307))return _0xed6d94[_0x487ae8(0x2dd)](_0x25e44a[_0x487ae8(0x175)])||_0xed6d94[_0x487ae8(0x2dd)](_0x25e44a[_0x487ae8(0x1a2)+_0x487ae8(0x276)])||_0x2102c5[_0x487ae8(0x2dd)](_0x25e44a[_0x487ae8(0x1a2)+_0x487ae8(0x18d)]);return![];});const _0x594e17=new Set(_0xd40677['plugins'][_0x5f5d81(0x209)](_0x219bb9=>_0x219bb9[_0x5f5d81(0x18c)]));for(const _0x4e3f69 of _0x1da548){if(!_0x4e3f69['pluginId']||_0x594e17[_0x5f5d81(0x2dd)](_0x4e3f69[_0x5f5d81(0x18c)]))continue;const _0x123dbe=typeof _0x4e3f69['installP'+_0x5f5d81(0x1a5)]===_0x5f5d81(0x1ac)&&_0x4e3f69[_0x5f5d81(0x1a6)+_0x5f5d81(0x1a5)][_0x5f5d81(0x23c)]()?resolve(_0x5ef734,_0x4e3f69[_0x5f5d81(0x1a6)+_0x5f5d81(0x1a5)]):join(_0x217a25,_0x4e3f69[_0x5f5d81(0x18c)]),_0x45c0b0=relative(_0x217a25,_0x123dbe);if(_0x45c0b0[_0x5f5d81(0x31d)+'th']('..')||_0x45c0b0==='')continue;await rm(_0x123dbe,{'recursive':!![],'force':!![]});}}async function collectCapabilityEntries(_0x3d6dc6,_0x2f8a10){const _0x46b503=_0x30af49,_0x2b4861=new Map();for(const _0xa829d7 of _0x3d6dc6){let _0x541137;try{_0x541137=await stat(_0xa829d7);}catch{throw new Error(_0x2f8a10+(_0x46b503(0x24f)+_0x46b503(0x16c)+'und:\x20')+_0xa829d7);}if(!_0x541137[_0x46b503(0x2ed)+_0x46b503(0x1d9)]())throw new Error(_0x2f8a10+(_0x46b503(0x23e)+_0x46b503(0x176)+_0x46b503(0x297)+_0x46b503(0x243))+_0xa829d7);const _0x45bdf5={'name':basename(_0xa829d7),'path':_0xa829d7},_0x1a8778=_0x2b4861[_0x46b503(0x27c)](_0x45bdf5[_0x46b503(0x187)]);if(_0x1a8778)throw new Error(_0x46b503(0x1c8)+'e\x20'+_0x2f8a10+'\x20entry\x20\x22'+_0x45bdf5[_0x46b503(0x187)]+_0x46b503(0x2a1)+_0x1a8778[_0x46b503(0x204)]+_0x46b503(0x2a8)+_0x45bdf5[_0x46b503(0x204)]);_0x2b4861[_0x46b503(0x1ea)](_0x45bdf5[_0x46b503(0x187)],_0x45bdf5);}return[..._0x2b4861['values']()];}async function syncProductCapabilityDirs(_0x9ca9d0,_0x1082dc,_0x511fb8){const _0x174eb6=_0x30af49,_0x4c59f3=await collectCapabilityEntries(_0x9ca9d0,_0x511fb8);await rm(_0x1082dc,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await mkdir(_0x1082dc,{'recursive':!![]});for(const _0x5efb3d of _0x4c59f3){await cp(_0x5efb3d[_0x174eb6(0x204)],join(_0x1082dc,_0x5efb3d[_0x174eb6(0x187)]),{'recursive':!![]});}return _0x4c59f3[_0x174eb6(0x1c3)];}export const __test__={'collectCapabilityEntries':collectCapabilityEntries,'syncProductCapabilityDirs':syncProductCapabilityDirs};async function syncProductAgents(_0x2a82cb,_0x2ac77b,_0x3b1610){const _0xc7716f=_0x30af49,_0x249bd6=join(_0x2ac77b,_0xc7716f(0x19b),_0xc7716f(0x2d3)),_0x5bd863=await syncProductCapabilityDirs(_0x2a82cb['openclaw'][_0xc7716f(0x1a2)+_0xc7716f(0x21c)+'ntPaths'],_0x249bd6,_0xc7716f(0x1b2));_0x3b1610['agents']={'source':_0xc7716f(0x139),'installPath':toRuntimeRelative(_0x2ac77b,_0x249bd6),'localPaths':_0x2a82cb[_0xc7716f(0x19b)][_0xc7716f(0x1a2)+'LocalAge'+_0xc7716f(0x255)],'entryCount':_0x5bd863};}async function syncProductSkills(_0xef6ee8,_0x5dfb7d,_0x395143){const _0x286361=_0x30af49,_0x5c7491=join(_0x5dfb7d,_0x286361(0x19b),'skills'),_0xa786b2=await syncProductCapabilityDirs(_0xef6ee8['openclaw'][_0x286361(0x1a2)+_0x286361(0x320)+'llPaths'],_0x5c7491,_0x286361(0x25f));_0x395143[_0x286361(0x24b)]={'source':_0x286361(0x139),'installPath':toRuntimeRelative(_0x5dfb7d,_0x5c7491),'localPaths':_0xef6ee8[_0x286361(0x19b)]['resolved'+'LocalSki'+_0x286361(0x300)],'entryCount':_0xa786b2};}
|
|
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 +1 @@
|
|
|
1
|
-
(function(_0x2b3114,_0x5b35ef){const _0x28a661=_0x3984,_0x153b60=_0x2b3114();while(!![]){try{const _0x2d8905=parseInt(_0x28a661(0x160))/0x1+-parseInt(_0x28a661(0x146))/0x2+parseInt(_0x28a661(0x18c))/0x3*(parseInt(_0x28a661(0x18f))/0x4)+parseInt(_0x28a661(0x18a))/0x5+parseInt(_0x28a661(0x14c))/0x6*(-parseInt(_0x28a661(0x16c))/0x7)+parseInt(_0x28a661(0x192))/0x8*(-parseInt(_0x28a661(0x1be))/0x9)+parseInt(_0x28a661(0x120))/0xa;if(_0x2d8905===_0x5b35ef)break;else _0x153b60['push'](_0x153b60['shift']());}catch(_0x542fbf){_0x153b60['push'](_0x153b60['shift']());}}}(_0x21b3,0x55b34));export function patchChannelPluginRuntimeFromSource(_0x45a9ba,_0x35ede5={}){const _0x3f9dc1=_0x3984,_0x39835f=_0x35ede5['runtimeC'+_0x3f9dc1(0x17f)+_0x3f9dc1(0x138)];if(!_0x39835f)return{'patched':![],'reason':_0x3f9dc1(0x13f)+_0x3f9dc1(0x167)+_0x3f9dc1(0x1c3)+_0x3f9dc1(0x188)+_0x3f9dc1(0x17b)};if(_0x45a9ba[_0x3f9dc1(0x1a8)](_0x3f9dc1(0x16f)+_0x3f9dc1(0x1bd)+_0x3f9dc1(0x18e)+'l')){if(_0x45a9ba[_0x3f9dc1(0x1a8)](_0x3f9dc1(0x19d)+'istingCh'+_0x3f9dc1(0x173)+'rn\x20??')&&hasRuntimeChannelImport(_0x45a9ba,_0x39835f))return{'patched':![],'reason':_0x3f9dc1(0x185)+'patched'};return patchExistingChannelPluginRuntimeFromSource(_0x45a9ba,{'runtimeChannelImportPath':_0x39835f});}if(_0x45a9ba[_0x3f9dc1(0x1a8)]('wujieCha'+_0x3f9dc1(0x172)+_0x3f9dc1(0x1c1)+'se'))return patchExistingChannelPluginRuntimeFromSource(_0x45a9ba,{'runtimeChannelImportPath':_0x39835f});const _0x3a62b0=_0x3f9dc1(0x168)+_0x3f9dc1(0x1af)+'ntime\x20=\x20'+_0x3f9dc1(0x198)+'const\x20re'+'solveRun'+_0x3f9dc1(0x136)+_0x3f9dc1(0x145)+_0x3f9dc1(0x148)+'edRuntim'+_0x3f9dc1(0x1a2)+_0x3f9dc1(0x126)+_0x3f9dc1(0x1b4)+_0x3f9dc1(0x17c)+_0x3f9dc1(0x1c7)+_0x3f9dc1(0x196)+_0x3f9dc1(0x13a)+'s);\x0a\x09\x09\x09r'+_0x3f9dc1(0x165)+'solvedRu'+_0x3f9dc1(0x17a)+_0x3f9dc1(0x187);if(!_0x45a9ba['includes'](_0x3a62b0))return{'patched':![],'reason':_0x3f9dc1(0x169)+'d'};const _0x5004da=_0x3f9dc1(0x1a1)+'\x20createH'+_0x3f9dc1(0x121)+_0x3f9dc1(0x193)+':crypto\x22'+';';if(!_0x45a9ba[_0x3f9dc1(0x1a8)](_0x5004da))return{'patched':![],'reason':_0x3f9dc1(0x1c3)+_0x3f9dc1(0x181)};const _0x2c81aa=_0x3f9dc1(0x168)+_0x3f9dc1(0x1af)+_0x3f9dc1(0x178)+'null;\x0a\x09\x09'+'const\x20en'+_0x3f9dc1(0x143)+_0x3f9dc1(0x15f)+_0x3f9dc1(0x128)+'elpers\x20='+_0x3f9dc1(0x124)+_0x3f9dc1(0x144)+_0x3f9dc1(0x1b2)+'runtime\x20'+_0x3f9dc1(0x147)+_0x3f9dc1(0x1b6)+_0x3f9dc1(0x14e)+'bject\x22)\x20'+'return\x20r'+_0x3f9dc1(0x161)+_0x3f9dc1(0x1b5)+_0x3f9dc1(0x164)+'hannel?.'+_0x3f9dc1(0x156)+_0x3f9dc1(0x1b1)+_0x3f9dc1(0x135)+'nnel?.in'+_0x3f9dc1(0x1bb)+_0x3f9dc1(0x122)+_0x3f9dc1(0x1a0)+_0x3f9dc1(0x180)+_0x3f9dc1(0x1b3)+_0x3f9dc1(0x172)+'ime\x20=\x20wu'+_0x3f9dc1(0x18d)+_0x3f9dc1(0x1b0)+_0x3f9dc1(0x190)+_0x3f9dc1(0x139)+_0x3f9dc1(0x18b)+_0x3f9dc1(0x189)+'nel\x20=\x20ru'+_0x3f9dc1(0x16d)+'annel\x20&&'+_0x3f9dc1(0x15b)+_0x3f9dc1(0x16b)+_0x3f9dc1(0x15d)+_0x3f9dc1(0x131)+_0x3f9dc1(0x151)+_0x3f9dc1(0x164)+_0x3f9dc1(0x1b9)+_0x3f9dc1(0x14d)+_0x3f9dc1(0x16b)+_0x3f9dc1(0x15d)+_0x3f9dc1(0x16e)+_0x3f9dc1(0x123)+_0x3f9dc1(0x129)+_0x3f9dc1(0x157)+_0x3f9dc1(0x184)+_0x3f9dc1(0x19e)+_0x3f9dc1(0x1ac)+_0x3f9dc1(0x174)+'ntexts:\x20'+'existing'+_0x3f9dc1(0x13c)+_0x3f9dc1(0x12c)+_0x3f9dc1(0x170)+_0x3f9dc1(0x1ab)+_0x3f9dc1(0x129)+_0x3f9dc1(0x153)+'eContext'+'s,\x0a\x09\x09\x09\x09i'+_0x3f9dc1(0x155)+_0x3f9dc1(0x1ad)+_0x3f9dc1(0x13c)+_0x3f9dc1(0x149)+'??\x20chann'+_0x3f9dc1(0x129)+_0x3f9dc1(0x158)+_0x3f9dc1(0x13d)+'urn:\x20exi'+'stingCha'+_0x3f9dc1(0x1a3)+'n\x20??\x20exi'+_0x3f9dc1(0x12a)+_0x3f9dc1(0x186)+_0x3f9dc1(0x13b)+_0x3f9dc1(0x1bf)+_0x3f9dc1(0x13e)+'urn\x20??\x20c'+_0x3f9dc1(0x1c2)+'ntime.in'+_0x3f9dc1(0x12e)+_0x3f9dc1(0x152)+_0x3f9dc1(0x19a)+'ngChanne'+_0x3f9dc1(0x1a7)+'??\x20chann'+'elRuntim'+_0x3f9dc1(0x127)+_0x3f9dc1(0x166)+_0x3f9dc1(0x19b)+_0x3f9dc1(0x17d)+'annel.se'+'ssion\x20??'+_0x3f9dc1(0x125)+_0x3f9dc1(0x1bc)+'session\x0a'+_0x3f9dc1(0x14a)+_0x3f9dc1(0x19f)+'runtime;'+_0x3f9dc1(0x1b7)+_0x3f9dc1(0x12b)+_0x3f9dc1(0x1a5)+_0x3f9dc1(0x136)+_0x3f9dc1(0x145)+'\x09\x09resolv'+_0x3f9dc1(0x1aa)+_0x3f9dc1(0x133)+_0x3f9dc1(0x143)+_0x3f9dc1(0x15f)+_0x3f9dc1(0x128)+_0x3f9dc1(0x159)+'esolveCr'+'eatePlug'+_0x3f9dc1(0x1c4)+_0x3f9dc1(0x15c)+('ons.runt'+_0x3f9dc1(0x12d)+_0x3f9dc1(0x1ba)+_0x3f9dc1(0x19f)+_0x3f9dc1(0x15e)+_0x3f9dc1(0x15a)+_0x3f9dc1(0x171));return{'patched':!![],'source':_0x45a9ba[_0x3f9dc1(0x1a6)](_0x5004da,_0x5004da+'\x0a'+createRuntimeChannelImport(_0x39835f))[_0x3f9dc1(0x1a6)](_0x3a62b0,_0x2c81aa)};}function patchExistingChannelPluginRuntimeFromSource(_0x53c4ff,_0x2018f0){const _0x4d1f0c=_0x3984,{runtimeChannelImportPath:_0x589da7}=_0x2018f0,_0x19c246=_0x4d1f0c(0x1a1)+'\x20createH'+_0x4d1f0c(0x121)+_0x4d1f0c(0x193)+_0x4d1f0c(0x130)+';';if(!_0x53c4ff[_0x4d1f0c(0x1a8)](_0x19c246))return{'patched':![],'reason':_0x4d1f0c(0x1c3)+'ot-found'};const _0x500af1=_0x4d1f0c(0x168)+_0x4d1f0c(0x1af)+_0x4d1f0c(0x178)+'null;',_0x494909=_0x4d1f0c(0x12f)+_0x4d1f0c(0x1a9)+_0x4d1f0c(0x1c6)+_0x4d1f0c(0x176)+'Set\x20=\x20ne'+_0x4d1f0c(0x195)+_0x4d1f0c(0x194)+_0x4d1f0c(0x17e)+_0x4d1f0c(0x16a)+_0x4d1f0c(0x197),_0x1912ef=_0x53c4ff[_0x4d1f0c(0x182)](_0x500af1),_0x5dd8f4=_0x53c4ff[_0x4d1f0c(0x182)](_0x494909,_0x1912ef);if(_0x1912ef===-0x1||_0x5dd8f4===-0x1)return{'patched':![],'reason':'not-foun'+'d'};const _0x984d41=_0x4d1f0c(0x168)+'solvedRu'+_0x4d1f0c(0x178)+_0x4d1f0c(0x198)+'const\x20en'+_0x4d1f0c(0x143)+_0x4d1f0c(0x15f)+'RuntimeH'+_0x4d1f0c(0x141)+_0x4d1f0c(0x124)+_0x4d1f0c(0x144)+_0x4d1f0c(0x1b2)+_0x4d1f0c(0x177)+_0x4d1f0c(0x147)+_0x4d1f0c(0x1b6)+'e\x20!==\x20\x22o'+_0x4d1f0c(0x1c5)+'return\x20r'+_0x4d1f0c(0x161)+_0x4d1f0c(0x1b5)+_0x4d1f0c(0x164)+_0x4d1f0c(0x14b)+_0x4d1f0c(0x156)+_0x4d1f0c(0x1b1)+_0x4d1f0c(0x135)+'nnel?.in'+_0x4d1f0c(0x1bb)+_0x4d1f0c(0x122)+_0x4d1f0c(0x1a0)+_0x4d1f0c(0x180)+_0x4d1f0c(0x1b3)+_0x4d1f0c(0x172)+_0x4d1f0c(0x179)+'jieCreat'+_0x4d1f0c(0x1b0)+_0x4d1f0c(0x190)+_0x4d1f0c(0x139)+'nst\x20exis'+_0x4d1f0c(0x189)+'nel\x20=\x20ru'+'ntime.ch'+_0x4d1f0c(0x191)+'\x20typeof\x20'+'runtime.'+_0x4d1f0c(0x15d)+_0x4d1f0c(0x131)+_0x4d1f0c(0x151)+_0x4d1f0c(0x164)+_0x4d1f0c(0x1b9)+_0x4d1f0c(0x14d)+_0x4d1f0c(0x16b)+'channel\x20'+_0x4d1f0c(0x16e)+_0x4d1f0c(0x123)+'elRuntim'+_0x4d1f0c(0x157)+_0x4d1f0c(0x184)+_0x4d1f0c(0x19e)+_0x4d1f0c(0x1ac)+_0x4d1f0c(0x174)+_0x4d1f0c(0x1b8)+_0x4d1f0c(0x1ad)+_0x4d1f0c(0x13c)+_0x4d1f0c(0x12c)+_0x4d1f0c(0x170)+_0x4d1f0c(0x1ab)+'elRuntim'+'e.runtim'+'eContext'+'s,\x0a\x09\x09\x09\x09i'+_0x4d1f0c(0x155)+'existing'+_0x4d1f0c(0x13c)+_0x4d1f0c(0x149)+_0x4d1f0c(0x1ab)+_0x4d1f0c(0x129)+_0x4d1f0c(0x158)+_0x4d1f0c(0x13d)+_0x4d1f0c(0x163)+_0x4d1f0c(0x12a)+_0x4d1f0c(0x1a3)+_0x4d1f0c(0x154)+'stingCha'+_0x4d1f0c(0x186)+_0x4d1f0c(0x13b)+_0x4d1f0c(0x1bf)+_0x4d1f0c(0x13e)+'urn\x20??\x20c'+_0x4d1f0c(0x1c2)+_0x4d1f0c(0x137)+_0x4d1f0c(0x12e)+'\x09\x09\x09reply'+_0x4d1f0c(0x19a)+_0x4d1f0c(0x19e)+_0x4d1f0c(0x1a7)+_0x4d1f0c(0x1ab)+_0x4d1f0c(0x129)+_0x4d1f0c(0x127)+_0x4d1f0c(0x166)+_0x4d1f0c(0x19b)+_0x4d1f0c(0x17d)+_0x4d1f0c(0x14f)+_0x4d1f0c(0x1c0)+_0x4d1f0c(0x125)+_0x4d1f0c(0x1bc)+_0x4d1f0c(0x19c)+'\x09\x09\x09};\x0a\x09\x09'+_0x4d1f0c(0x19f)+'runtime;'+'\x0a\x09\x09};\x0a\x09\x09'+_0x4d1f0c(0x12b)+_0x4d1f0c(0x1a5)+_0x4d1f0c(0x136)+_0x4d1f0c(0x145)+_0x4d1f0c(0x148)+_0x4d1f0c(0x1aa)+'e\x20??=\x20en'+_0x4d1f0c(0x143)+_0x4d1f0c(0x15f)+_0x4d1f0c(0x128)+_0x4d1f0c(0x159)+'esolveCr'+_0x4d1f0c(0x162)+_0x4d1f0c(0x1c4)+_0x4d1f0c(0x15c)+(_0x4d1f0c(0x183)+_0x4d1f0c(0x12d)+_0x4d1f0c(0x1ba)+'\x09return\x20'+_0x4d1f0c(0x15e)+'Runtime;'+'\x0a\x09\x09};\x0a'),_0x3b66da=_0x53c4ff[_0x4d1f0c(0x1ae)](0x0,_0x1912ef)+_0x984d41+_0x53c4ff[_0x4d1f0c(0x1ae)](_0x5dd8f4);return{'patched':!![],'source':ensureRuntimeChannelImport(_0x3b66da,{'importMarker':_0x19c246,'runtimeChannelImportPath':_0x589da7})};}function createRuntimeChannelImport(_0x9af3d8){const _0x4af62b=_0x3984;return _0x4af62b(0x1a1)+_0x4af62b(0x1a4)+_0x4af62b(0x199)+'annel\x20as'+_0x4af62b(0x142)+_0x4af62b(0x132)+_0x4af62b(0x140)+_0x4af62b(0x134)+_0x4af62b(0x175)+_0x9af3d8+'\x22;';}function _0x3984(_0x5a064f,_0x2e114d){_0x5a064f=_0x5a064f-0x120;const _0x21b30b=_0x21b3();let _0x3984e7=_0x21b30b[_0x5a064f];return _0x3984e7;}function hasRuntimeChannelImport(_0x40b017,_0x5235c9){return _0x40b017['includes'](createRuntimeChannelImport(_0x5235c9));}function ensureRuntimeChannelImport(_0x4312b7,{importMarker:_0x5972b5,runtimeChannelImportPath:_0x2987f3}){const _0x1e8440=_0x3984,_0xe4e293=createRuntimeChannelImport(_0x2987f3),_0x58ff98=/import \{ createRuntimeChannel as wujieCreateRuntimeChannel \} from "\.\/runtime-channel-[^"]+\.js";\n?/;if(_0x58ff98[_0x1e8440(0x150)](_0x4312b7))return _0x4312b7[_0x1e8440(0x1a6)](_0x58ff98,_0xe4e293+'\x0a');return _0x4312b7[_0x1e8440(0x1a6)](_0x5972b5,_0x5972b5+'\x0a'+_0xe4e293);}function _0x21b3(){const _0x256cce=['452804meDFpC','untime;\x0a','eatePlug','urn:\x20exi','untime.c','eturn\x20re','\x0a\x09\x09\x09\x09ses','channel-','\x09\x09let\x20re','not-foun','CTION_KE','runtime.','7qyvoJj','ntime.ch','=\x20{\x0a\x09\x09\x09\x09','wujieCre','ontexts\x20','\x0a\x09\x09};','nnelRunt','annel.tu','untimeCo','m\x20\x22','ctionKey','runtime\x20','ntime\x20=\x20','ime\x20=\x20wu','ntime;\x0a\x09','ded','nRuntime','istingCh','ME_REFLE','hannelIm','me;\x0a\x09\x09\x09c','ot-found','indexOf','ons.runt','..existi','already-','nnel.inb','\x09};','ot-provi','tingChan','436500xouWMd','nst\x20exis','3XqlHwc','jieCreat','meChanne','589348AKlUpw','Channel(','annel\x20&&','528OGpVuX','om\x20\x22node','ZY_RUNTI','w\x20Set(LA','ns.runti','YS);','null;\x0a\x09\x09','untimeCh',':\x20existi','sion:\x20ex','session\x0a','turn:\x20ex','ngChanne','\x09return\x20','rn\x20runti','import\x20{','e\x20??=\x20re','nnel.tur','\x20createR','solveRun','replace','l.reply\x20','includes','lazyRunt','edRuntim','??\x20chann','l,\x0a\x09\x09\x09\x09r','existing','slice','solvedRu','eRuntime','n\x20&&\x20run','\x09\x09\x09if\x20(!','onst\x20cha','atePlugi','\x09\x09\x09if\x20(r','f\x20runtim','\x0a\x09\x09};\x0a\x09\x09','ntexts:\x20','hannel\x20:','ns));\x0a\x09\x09','bound?.r','Runtime.','ateRunti','49968IQJRFV','channelR','ssion\x20??','imePromi','hannelRu','import-n','inRuntim','bject\x22)\x20','imeRefle','()(optio','7439530bNRBGf','ash\x20}\x20fr','un)\x20retu','...chann','\x20(runtim','\x20channel','solveCre','e.reply,','RuntimeH','elRuntim','stingCha','const\x20re','runtimeC','imeOptio','bound,\x0a\x09','\x09\x09const\x20',':crypto\x22','===\x20\x22obj','eateRunt','e\x20??=\x20en','el\x20}\x20fro','time.cha','time\x20=\x20(','ntime.in','portPath',');\x0a\x09\x09\x09co','meOption','ound\x20??\x20','Channel.','d,\x0a\x09\x09\x09\x09t','untime.t','runtime-','imeChann','elpers\x20=','\x20wujieCr','sureWuji','e)\x20=>\x20{\x0a',')\x20=>\x20{\x0a\x09','952842adcTOL','||\x20typeo','\x09\x09resolv','inbound\x20','\x09\x09\x09};\x0a\x09\x09','hannel?.','1425078TLCfFw','\x20{};\x0a\x09\x09\x09','e\x20!==\x20\x22o','annel.se','test','ect\x22\x20?\x20r','\x09\x09\x09reply','e.runtim','n\x20??\x20exi','nbound:\x20','turn?.ru','e,\x0a\x09\x09\x09\x09.','e.inboun','elpers(r','Runtime;','\x20typeof\x20','e()(opti','channel\x20','resolved','eChannel'];_0x21b3=function(){return _0x256cce;};return _0x21b3();}
|
|
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 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x43f480,_0x39f43e){const _0x4260b4=_0x49a4,_0x4ef751=_0x43f480();while(!![]){try{const _0x41d126=-parseInt(_0x4260b4(0x201))/0x1*(-parseInt(_0x4260b4(0x20a))/0x2)+-parseInt(_0x4260b4(0x1db))/0x3*(-parseInt(_0x4260b4(0x1f0))/0x4)+parseInt(_0x4260b4(0x1dd))/0x5*(-parseInt(_0x4260b4(0x21f))/0x6)+-parseInt(_0x4260b4(0x233))/0x7+parseInt(_0x4260b4(0x1e6))/0x8*(-parseInt(_0x4260b4(0x1f7))/0x9)+parseInt(_0x4260b4(0x1f2))/0xa+parseInt(_0x4260b4(0x206))/0xb;if(_0x41d126===_0x39f43e)break;else _0x4ef751['push'](_0x4ef751['shift']());}catch(_0x387dd7){_0x4ef751['push'](_0x4ef751['shift']());}}}(_0x2f33,0xf158f));function _0x49a4(_0x5ab893,_0x1ad03f){_0x5ab893=_0x5ab893-0x1db;const _0x2f3308=_0x2f33();let _0x49a400=_0x2f3308[_0x5ab893];return _0x49a400;}export function patchMixedToolContentFromSource(_0xf876a0){const _0x580cd8=_0x49a4,_0x1b9790=_0x580cd8(0x1e8)+_0x580cd8(0x217)+'Assistan'+_0x580cd8(0x228)+_0x580cd8(0x1df)+_0x580cd8(0x216)+'t',_0x53459e=_0xf876a0[_0x580cd8(0x21e)](_0x1b9790);if(_0x53459e===-0x1)return{'patched':![],'reason':'not-foun'+'d'};let _0x3490bc=0x0,_0x4b2738=![],_0x75004d=_0x53459e;for(let _0xfec319=_0x53459e;_0xfec319<_0xf876a0['length'];_0xfec319+=0x1){_0xf876a0[_0xfec319]==='{'&&(_0x3490bc+=0x1,_0x4b2738=!![]);_0xf876a0[_0xfec319]==='}'&&(_0x3490bc-=0x1);if(_0x4b2738&&_0x3490bc===0x0){_0x75004d=_0xfec319+0x1;break;}}const _0xa1d0e0=_0xf876a0['substrin'+'g'](_0x53459e,_0x75004d);if(_0xa1d0e0[_0x580cd8(0x1dc)](_0x580cd8(0x222)+_0x580cd8(0x1ed)+'lock)'))return{'patched':![],'reason':'already-'+_0x580cd8(0x1ef)};const _0x54b038='function'+_0x580cd8(0x217)+_0x580cd8(0x1f1)+_0x580cd8(0x228)+_0x580cd8(0x1df)+'olConten'+_0x580cd8(0x229)+_0x580cd8(0x1de)+'ars)\x20{\x0a\x09'+_0x580cd8(0x1e0)+_0x580cd8(0x22f)+_0x580cd8(0x1fd)+_0x580cd8(0x214)+_0x580cd8(0x219)+'ock\x20||\x20t'+'ypeof\x20bl'+'ock\x20!==\x20'+_0x580cd8(0x220)+_0x580cd8(0x210)+_0x580cd8(0x20f)+_0x580cd8(0x1e1)+_0x580cd8(0x221)+_0x580cd8(0x20c)+'ockType('+_0x580cd8(0x21b)+_0x580cd8(0x1f3)+_0x580cd8(0x210)+_0x580cd8(0x204)+_0x580cd8(0x1e3)+_0x580cd8(0x21d)+_0x580cd8(0x20e)+'nst\x20proj'+_0x580cd8(0x1f5)+_0x580cd8(0x1ec)+_0x580cd8(0x21a)+'block\x20of'+_0x580cd8(0x218)+')\x20{\x0a\x09\x09if'+_0x580cd8(0x22a)+'\x20||\x20type'+'of\x20block'+_0x580cd8(0x1ff)+_0x580cd8(0x234)+_0x580cd8(0x22c)+_0x580cd8(0x223)+_0x580cd8(0x1fe)+');\x0a\x09\x09\x09co'+_0x580cd8(0x212)+_0x580cd8(0x22e)+_0x580cd8(0x1e9)+_0x580cd8(0x1ea)+_0x580cd8(0x20d)+_0x580cd8(0x1fa)+_0x580cd8(0x232)+'\x22text\x22\x20&'+'&\x20typeof'+'\x20entry.t'+_0x580cd8(0x231)+'\x22string\x22'+_0x580cd8(0x208)+_0x580cd8(0x1e7)+_0x580cd8(0x1ee)+_0x580cd8(0x209)+_0x580cd8(0x224)+'ue;\x0a\x09\x09\x09c'+_0x580cd8(0x1f4)+_0x580cd8(0x202)+_0x580cd8(0x22b)+_0x580cd8(0x227)+'toryText'+'(stripIn'+_0x580cd8(0x230)+_0x580cd8(0x207)+'sForDisp'+_0x580cd8(0x213)+'y.text).'+_0x580cd8(0x211)+_0x580cd8(0x1f6)+_0x580cd8(0x22c)+_0x580cd8(0x223)+_0x580cd8(0x22d)+_0x580cd8(0x1fc)+_0x580cd8(0x225)+_0x580cd8(0x1f8)+_0x580cd8(0x22b)+_0x580cd8(0x226)+_0x580cd8(0x215)+_0x580cd8(0x1f9)+_0x580cd8(0x20b)+_0x580cd8(0x235)+_0x580cd8(0x200)+_0x580cd8(0x1fb)+'\x09}\x0a\x09retu'+'rn\x20hasTe'+_0x580cd8(0x1e4)+_0x580cd8(0x203)+_0x580cd8(0x21c)+_0x580cd8(0x205)+_0x580cd8(0x1e2)+'true\x0a\x09}\x20'+_0x580cd8(0x1eb)+'}';return{'patched':!![],'source':_0xf876a0[_0x580cd8(0x1e5)](_0xa1d0e0,_0x54b038)};}function _0x2f33(){const _0x4575e8=['d.push(b','rim())\x20{','patched','835868ilEqng','Assistan','9434570RgLdOu','pe);\x0a\x09})','onst\x20tru','ected\x20=\x20','xChars);','63vjickp','\x09\x09\x09text:','\x09}\x20else\x20','(entry.t','k);\x0a\x09\x09}\x0a','\x09type:\x20\x22','e((block','sh(block','\x20!==\x20\x22ob','ush(bloc','77929wjaxMl','ncated\x20=','\x09content','\x20null;\x0a\x09','ted,\x0a\x09\x09c','23729167jeYTPC','ctiveTag','\x20&&\x20entr','\x0a\x09\x09\x09hasT','30coAgMZ','{\x0a\x09\x09\x09pro','istoryBl','k;\x0a\x09\x09if\x20','lse;\x0a\x09co','\x20false;\x0a',')\x20return','text,\x20ma','ntinue;\x0a','lay(entr',')\x20=>\x20{\x0a\x09','\x09\x09\x09});\x0a\x09','olConten','\x20project','\x20content','\x09if\x20(!bl','\x20(const\x20','block.ty',':\x20projec','ext\x20=\x20fa','indexOf','1556196mzZzst','\x22object\x22','\x20isToolH','projecte','ected.pu','ext\x20=\x20tr','text\x22,\x0a\x09','ed.text\x0a','eChatHis','tTextFro','t(conten','\x20(!block','\x20truncat','\x0a\x09\x09\x09proj','sh({\x0a\x09\x09\x09','\x09\x09}\x0a\x09\x09co','tent.som','lineDire','ext\x20===\x20','ype\x20===\x20','10596551csxhEd','ject\x22)\x20{','jected.p','6tHUdfH','includes','5NIqJfi','t,\x20maxCh','mMixedTo','if\x20(!con','\x09\x09return','hanged:\x20','let\x20hasT','xt\x20?\x20{\x0a\x09','replace','2200920pfPVSe','y.text.t','function','nst\x20entr','y\x20=\x20bloc',':\x20null;\x0a','[];\x0a\x09for'];_0x2f33=function(){return _0x4575e8;};return _0x2f33();}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function _0x5e87(_0x54db66,_0x3d066c){_0x54db66=_0x54db66-0x13c;const _0x1498e3=_0x1498();let _0x5e8755=_0x1498e3[_0x54db66];return _0x5e8755;}const _0x37eb28=_0x5e87;(function(_0x1b6ea9,_0x124047){const _0x468d15=_0x5e87,_0x5a1316=_0x1b6ea9();while(!![]){try{const _0x1036cd=parseInt(_0x468d15(0x17a))/0x1+parseInt(_0x468d15(0x17c))/0x2*(parseInt(_0x468d15(0x16a))/0x3)+parseInt(_0x468d15(0x15a))/0x4*(-parseInt(_0x468d15(0x16b))/0x5)+parseInt(_0x468d15(0x17f))/0x6*(parseInt(_0x468d15(0x147))/0x7)+parseInt(_0x468d15(0x15f))/0x8+parseInt(_0x468d15(0x18d))/0x9+-parseInt(_0x468d15(0x186))/0xa*(parseInt(_0x468d15(0x151))/0xb);if(_0x1036cd===_0x124047)break;else _0x5a1316['push'](_0x5a1316['shift']());}catch(_0x862f69){_0x5a1316['push'](_0x5a1316['shift']());}}}(_0x1498,0x66d89));const REQUEST_ID_HEADER_PATCH_MARKER='const\x20re'+_0x37eb28(0x15b)+_0x37eb28(0x167)+_0x37eb28(0x168)+_0x37eb28(0x188)+_0x37eb28(0x17b)+'id\x22);',OPENAI_COMPLETIONS_TRANSPORT_CREATE_LINE='const\x20re'+'sponseSt'+_0x37eb28(0x16d)+_0x37eb28(0x142)+_0x37eb28(0x149)+_0x37eb28(0x156)+_0x37eb28(0x175)+_0x37eb28(0x144)+_0x37eb28(0x15c)+_0x37eb28(0x171)+_0x37eb28(0x18c)+_0x37eb28(0x15d)+_0x37eb28(0x14c)+_0x37eb28(0x180)+'.signal)'+');',OPENAI_COMPLETIONS_TRANSPORT_PATCH_MARKER=_0x37eb28(0x159)+_0x37eb28(0x174)+_0x37eb28(0x145)+'ream,\x20re'+_0x37eb28(0x160)+_0x37eb28(0x181)+_0x37eb28(0x13e)+_0x37eb28(0x166)+_0x37eb28(0x143)+_0x37eb28(0x162)+'params,\x20'+_0x37eb28(0x190)+_0x37eb28(0x177)+_0x37eb28(0x16e)+_0x37eb28(0x164)+'el,\x20opti'+'ons?.sig'+_0x37eb28(0x17e)+'thRespon'+_0x37eb28(0x179);export function patchProviderRequestIdHeaderFromSource(_0x4bc666){const _0x386804=_0x37eb28,_0x193d51=_0x4bc666['split']('\x0a'),_0x56e790=[];let _0x369813=![],_0x55a07b=_0x4bc666[_0x386804(0x13d)](OPENAI_COMPLETIONS_TRANSPORT_PATCH_MARKER),_0x19fea9=/if \(requestId\) output\["request-id"\] = requestId;\s*await options\?\.onResponse\?\.\(\{/['test'](_0x4bc666);for(let _0x2e1001=0x0;_0x2e1001<_0x193d51[_0x386804(0x150)];_0x2e1001+=0x1){const _0x4703fd=_0x193d51[_0x2e1001];if(!_0x55a07b&&_0x4703fd[_0x386804(0x13d)](OPENAI_COMPLETIONS_TRANSPORT_CREATE_LINE)){const _0x2308e2=_0x4703fd[_0x386804(0x176)](/^\s*/)?.[0x0]??'';_0x56e790['push'](''+_0x2308e2+OPENAI_COMPLETIONS_TRANSPORT_PATCH_MARKER,_0x2308e2+(_0x386804(0x169)+_0x386804(0x15b)+'=\x20respon'+_0x386804(0x168)+_0x386804(0x188)+_0x386804(0x17b)+_0x386804(0x18b)),_0x2308e2+(_0x386804(0x17d)+_0x386804(0x18f)+_0x386804(0x14d)+_0x386804(0x17b)+_0x386804(0x185)+_0x386804(0x173)+_0x386804(0x141)),_0x2308e2+(_0x386804(0x15e)+_0x386804(0x153)+_0x386804(0x148)+'er\x20??\x20nu'+'ll,'),_0x2308e2+(_0x386804(0x158)+_0x386804(0x14e)+_0x386804(0x161)+'l,'),_0x2308e2+('\x09status:'+_0x386804(0x14b)+_0x386804(0x152)+','),_0x2308e2+(_0x386804(0x157)+_0x386804(0x184)+_0x386804(0x189)+'equestId'+'),'),_0x2308e2+_0x386804(0x183),_0x2308e2+(_0x386804(0x155)+_0x386804(0x163)+_0x386804(0x16c)+_0x386804(0x182)+'d\x22]\x20=\x20re'+_0x386804(0x13c))),_0x369813=!![],_0x55a07b=!![];continue;}if(_0x19fea9||!_0x4703fd[_0x386804(0x13d)]('await\x20op'+_0x386804(0x140)+_0x386804(0x170)+_0x386804(0x18e))){_0x56e790[_0x386804(0x187)](_0x4703fd);continue;}let _0xedaae1=_0x2e1001;while(_0xedaae1<_0x193d51[_0x386804(0x150)]&&_0xedaae1-_0x2e1001<0x8&&_0x193d51[_0xedaae1][_0x386804(0x16f)]()!==_0x386804(0x146)+');'){_0xedaae1+=0x1;}const _0xacb97e=_0x193d51[_0x386804(0x172)](_0x2e1001,_0xedaae1+0x1)[_0x386804(0x165)]('\x0a');if(!_0xacb97e['includes'](_0x386804(0x14a)+_0x386804(0x154)+_0x386804(0x178)+'(respons'+_0x386804(0x13f)+'s)')){_0x56e790[_0x386804(0x187)](_0x4703fd);continue;}const _0x4d0ac0=_0x4703fd[_0x386804(0x176)](/^\s*/)?.[0x0]??'';_0x56e790['push'](_0x4d0ac0+(_0x386804(0x169)+_0x386804(0x15b)+'=\x20respon'+'se.heade'+_0x386804(0x188)+_0x386804(0x17b)+_0x386804(0x18b)),_0x4d0ac0+(_0x386804(0x155)+_0x386804(0x163)+_0x386804(0x16c)+_0x386804(0x182)+'d\x22]\x20=\x20re'+_0x386804(0x13c))),_0x369813=!![],_0x19fea9=!![],_0x56e790[_0x386804(0x187)](_0x4703fd);}if(!_0x369813)return{'patched':![],'reason':_0x4bc666[_0x386804(0x13d)](REQUEST_ID_HEADER_PATCH_MARKER)||_0x4bc666[_0x386804(0x13d)](OPENAI_COMPLETIONS_TRANSPORT_PATCH_MARKER)?'already-'+_0x386804(0x14f):_0x386804(0x18a)+'d'};return{'patched':!![],'source':_0x56e790[_0x386804(0x165)]('\x0a')};}function _0x1498(){const _0x29ee74=['\x20respons','(model,\x20','rovider-','model?.i','patched','length','11EHxERw','e.status','r:\x20model','\x20headers','if\x20(requ','.complet','\x09hasRequ','\x09model:\x20','const\x20{\x20','567472DtuTXV','questId\x20','ms,\x20buil','tOptions','\x09provide','4428424bUxndR','sponse\x20}','d\x20??\x20nul','.create(','estId)\x20o','ions(mod','join','chat.com','=\x20respon','se.heade','const\x20re','12459GqMwFx','10WKSDUf','utput[\x22r','ream\x20=\x20a','questOpt','trim','nRespons','dOpenAIS','slice','onse\x20hea','data:\x20re','ions.cre','match','nAISdkRe','ToRecord','se();','546801CVASnd','request-','4sifqtB','console.','nal)).wi','42WGrdzq','options?','\x20=\x20await','equest-i','});','estId:\x20B','id]\x20resp','14955190NgrKov','push','rs.get(\x22','oolean(r','not-foun','id\x22);','dkReques','7566354WLCjNH','e?.({','info(\x22[p','buildOpe','questId;','includes','\x20client.','e.header','tions?.o','der\x22,\x20{','wait\x20cli','pletions','ate(para','sponseSt','},\x20model','251146ZotNFU','?.provid','ent.chat','headers:'];_0x1498=function(){return _0x29ee74;};return _0x1498();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1456d1,_0x28c3ea){const _0x1a58f7=_0x5e9c,_0x34facd=_0x1456d1();while(!![]){try{const _0xb33617=-parseInt(_0x1a58f7(0xcb))/0x1+-parseInt(_0x1a58f7(0xbb))/0x2+parseInt(_0x1a58f7(0xb3))/0x3*(-parseInt(_0x1a58f7(0xd1))/0x4)+-parseInt(_0x1a58f7(0xbc))/0x5+-parseInt(_0x1a58f7(0xbf))/0x6+parseInt(_0x1a58f7(0xe1))/0x7+parseInt(_0x1a58f7(0xcd))/0x8;if(_0xb33617===_0x28c3ea)break;else _0x34facd['push'](_0x34facd['shift']());}catch(_0x2cfd80){_0x34facd['push'](_0x34facd['shift']());}}}(_0x59a5,0x44d3b));function createBridgeImport(_0x5345f8){const _0x10fefa=_0x5e9c;return _0x10fefa(0xb4)+_0x10fefa(0xcc)+'eSession'+_0x10fefa(0xbd)+_0x10fefa(0xd4)+_0x5345f8+'\x22;';}function ensureBridgeImport(_0x404c6a,_0x119124){const _0x52d0a9=_0x5e9c,_0x514b72=createBridgeImport(_0x119124);if(_0x404c6a['includes'](_0x514b72))return _0x404c6a;const _0xb3f9f1=_0x404c6a[_0x52d0a9(0xc7)](/^import .*;$/m);if(!_0xb3f9f1)return _0x514b72+'\x0a'+_0x404c6a;return _0x404c6a[_0x52d0a9(0xce)](_0xb3f9f1[0x0],_0xb3f9f1[0x0]+'\x0a'+_0x514b72);}function findFunctionBodyStart(_0xe9bc42,_0x195222){const _0x1d2ab4=_0x5e9c,_0x19ad13=_0xe9bc42[_0x1d2ab4(0xcf)]('(',_0x195222);if(_0x19ad13===-0x1)return-0x1;let _0x54431a=0x0,_0x1f63c6=null,_0x562a32=![];for(let _0x367a26=_0x19ad13;_0x367a26<_0xe9bc42['length'];_0x367a26+=0x1){const _0x65e813=_0xe9bc42[_0x367a26];if(_0x1f63c6){if(_0x562a32){_0x562a32=![];continue;}if(_0x65e813==='\x5c'){_0x562a32=!![];continue;}if(_0x65e813===_0x1f63c6)_0x1f63c6=null;continue;}if(_0x65e813==='\x22'||_0x65e813==='\x27'||_0x65e813==='`'){_0x1f63c6=_0x65e813;continue;}if(_0x65e813==='('){_0x54431a+=0x1;continue;}if(_0x65e813===')'){_0x54431a-=0x1;continue;}if(_0x65e813==='{'&&_0x54431a===0x0)return _0x367a26;}return-0x1;}function findMatchingBlockEnd(_0x1a5dc9,_0x31743d){const _0x423233=_0x5e9c;let _0x5579e3=0x0,_0x5e9745=null,_0x5e1c81=![];for(let _0x4c8707=_0x31743d;_0x4c8707<_0x1a5dc9[_0x423233(0xba)];_0x4c8707+=0x1){const _0x350c38=_0x1a5dc9[_0x4c8707];if(_0x5e9745){if(_0x5e1c81){_0x5e1c81=![];continue;}if(_0x350c38==='\x5c'){_0x5e1c81=!![];continue;}if(_0x350c38===_0x5e9745)_0x5e9745=null;continue;}if(_0x350c38==='\x22'||_0x350c38==='\x27'||_0x350c38==='`'){_0x5e9745=_0x350c38;continue;}if(_0x350c38==='{')_0x5579e3+=0x1;if(_0x350c38==='}')_0x5579e3-=0x1;if(_0x5579e3===0x0)return _0x4c8707+0x1;}return-0x1;}function findNextNonWhitespace(_0x567ebf,_0x14c83c){const _0x2ef74d=_0x5e9c;for(let _0x35a5db=_0x14c83c;_0x35a5db<_0x567ebf[_0x2ef74d(0xba)];_0x35a5db+=0x1){if(!/\s/[_0x2ef74d(0xd7)](_0x567ebf[_0x35a5db]))return _0x35a5db;}return-0x1;}function repairMalformedAlreadyPatchedFunction(_0x163955,_0x4669fd){const _0x8090d7=_0x5e9c,_0x3954d5=_0x163955[_0x8090d7(0xcf)](_0x4669fd);if(_0x3954d5===-0x1)return{'patched':![],'reason':_0x8090d7(0xd9)+'d'};const _0x3807f8=findFunctionBodyStart(_0x163955,_0x3954d5);if(_0x3807f8===-0x1)return{'patched':![],'reason':_0x8090d7(0xdf)+'-found'};const _0x111017=findMatchingBlockEnd(_0x163955,_0x3807f8);if(_0x111017===-0x1)return{'patched':![],'reason':_0x8090d7(0xca)+_0x8090d7(0xb0)+'nd'};const _0x16be9=findNextNonWhitespace(_0x163955,_0x111017);if(_0x163955[_0x16be9]!==')')return{'patched':![],'reason':_0x8090d7(0xae)+_0x8090d7(0xac)};const _0x335349=findNextNonWhitespace(_0x163955,_0x16be9+0x1);if(_0x163955[_0x335349]!=='{')return{'patched':![],'reason':_0x8090d7(0xae)+_0x8090d7(0xac)};const _0x550b75=findMatchingBlockEnd(_0x163955,_0x335349);if(_0x550b75===-0x1)return{'patched':![],'reason':_0x8090d7(0xca)+_0x8090d7(0xb0)+'nd'};return{'patched':!![],'source':_0x163955[_0x8090d7(0xdc)](0x0,_0x111017)+_0x163955[_0x8090d7(0xdc)](_0x550b75)};}function replaceFunctionBody(_0x145ebb,_0x47cb81,_0x3dbb80){const _0x1ce78a=_0x5e9c,_0x22d0df=_0x145ebb['indexOf'](_0x47cb81);if(_0x22d0df===-0x1)return{'patched':![],'reason':'not-foun'+'d'};const _0x18bfb7=findFunctionBodyStart(_0x145ebb,_0x22d0df);if(_0x18bfb7===-0x1)return{'patched':![],'reason':_0x1ce78a(0xdf)+_0x1ce78a(0xad)};const _0x525472=findMatchingBlockEnd(_0x145ebb,_0x18bfb7);if(_0x525472===-0x1)return{'patched':![],'reason':'body-end'+_0x1ce78a(0xb0)+'nd'};const _0x2dbf96=_0x47cb81+'\x20'+_0x3dbb80;return{'patched':!![],'source':_0x145ebb['slice'](0x0,_0x22d0df)+_0x2dbf96+_0x145ebb[_0x1ce78a(0xdc)](_0x525472)};}export function patchSessionStoreLoadFromSource(_0x3575f4,_0x18ef63={}){const _0x1f41b7=_0x5e9c,_0x933354=_0x18ef63['bridgeIm'+_0x1f41b7(0xaa)];if(!_0x933354)return{'patched':![],'reason':_0x1f41b7(0xc5)+'mport-no'+_0x1f41b7(0xbe)+'ed'};if(_0x3575f4[_0x1f41b7(0xc4)]('wujieSes'+'sionBrid'+_0x1f41b7(0xc2)+'essionSt'+_0x1f41b7(0xda)))return repairMalformedAlreadyPatchedFunction(_0x3575f4,_0x1f41b7(0xab)+_0x1f41b7(0xc8)+_0x1f41b7(0xb8)+'e(storeP'+_0x1f41b7(0xc0)+'s\x20=\x20{})');const _0x29f1f2=replaceFunctionBody(ensureBridgeImport(_0x3575f4,_0x933354),_0x1f41b7(0xab)+_0x1f41b7(0xc8)+_0x1f41b7(0xb8)+_0x1f41b7(0xdb)+_0x1f41b7(0xc0)+_0x1f41b7(0xb7),'{\x0a\x09retur'+'n\x20wujieS'+_0x1f41b7(0xd8)+_0x1f41b7(0xb9)+_0x1f41b7(0xd2)+_0x1f41b7(0xd5)+_0x1f41b7(0xd6)+'\x20opts);\x0a'+'}');return _0x29f1f2;}function _0x5e9c(_0x1e0d7d,_0x517be6){_0x1e0d7d=_0x1e0d7d-0xaa;const _0x59a5b8=_0x59a5();let _0x5e9c5e=_0x59a5b8[_0x1e0d7d];return _0x5e9c5e;}function _0x59a5(){const _0x128471=['indexOf','wujieSes','8qlvTiS','dSession','sionBrid','rom\x20\x22','Store(st','orePath,','test','essionBr','not-foun','ore','e(storeP','slice','riteSess','s);\x0a}','body-not','ionStore','1274378DByfkg','portPath','function','patched','-found','already-','ge.write','-not-fou','arams)','ic(param','831102RgnnRV','import\x20*','SessionS','nction\x20w','s\x20=\x20{})','sionStor','idge.loa','length','630464TjWoCQ','350085bVZHwy','Bridge\x20f','t-provid','1437786GLEndD','ath,\x20opt','toreAtom','ge.loadS','n\x20await\x20','includes','bridge-i','async\x20fu','match','\x20loadSes','mport-no','body-end','432730atBaaq','\x20as\x20wuji','13692312BdIztJ','replace'];_0x59a5=function(){return _0x128471;};return _0x59a5();}export function patchSessionStoreWriteFromSource(_0x310704,_0x3195fb={}){const _0x5bde64=_0x5e9c,_0xda3765=_0x3195fb['bridgeIm'+'portPath'];if(!_0xda3765)return{'patched':![],'reason':'bridge-i'+_0x5bde64(0xc9)+_0x5bde64(0xbe)+'ed'};const _0x3fb79c=replaceFunctionBody(ensureBridgeImport(_0x310704,_0xda3765),_0x5bde64(0xc6)+_0x5bde64(0xb6)+_0x5bde64(0xdd)+_0x5bde64(0xe0)+'Atomic(p'+_0x5bde64(0xb1),'{\x0a\x09retur'+_0x5bde64(0xc3)+_0x5bde64(0xd0)+_0x5bde64(0xd3)+_0x5bde64(0xaf)+_0x5bde64(0xb5)+_0x5bde64(0xc1)+_0x5bde64(0xb2)+_0x5bde64(0xde));if(!_0x3fb79c[_0x5bde64(0xac)])return _0x3fb79c;return _0x3fb79c;}
|