@wujie-shell/core 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/wujie-shell.mjs +10 -30
- package/dist/bin/wujie-shell.mjs +1 -1
- package/dist/src/agents/bundled-agent-skills.mjs +1 -1
- package/dist/src/agents/bundled-agents.mjs +1 -1
- package/dist/src/agents/codex-home.mjs +1 -0
- package/dist/src/agents/runtime-config.mjs +1 -1
- package/dist/src/chat/media-archive.mjs +1 -1
- package/dist/src/chat/queue.mjs +1 -1
- package/dist/src/common/cron-session-key.mjs +1 -1
- package/dist/src/common/diagnostics.mjs +1 -1
- package/dist/src/common/logging.mjs +1 -1
- package/dist/src/common/runtime-logger.mjs +1 -1
- package/dist/src/common/sqlite-paths.mjs +1 -1
- package/dist/src/common/user-events.mjs +1 -1
- package/dist/src/common/utils.mjs +1 -1
- package/dist/src/config/controller.mjs +1 -1
- package/dist/src/connectors/config-utils.mjs +1 -1
- package/dist/src/connectors/constants.mjs +1 -1
- package/dist/src/connectors/controller.mjs +1 -1
- package/dist/src/connectors/kdocs-cli.mjs +1 -1
- package/dist/src/connectors/lark-cli.mjs +1 -1
- package/dist/src/electron/instance-identity.mjs +1 -0
- package/dist/src/electron/main.mjs +1 -1
- package/dist/src/electron/preload.mjs +1 -1
- package/dist/src/electron/protocol-url-state.mjs +1 -1
- package/dist/src/events/domain-event-journal.mjs +1 -1
- package/dist/src/files/generated-files-store.mjs +1 -1
- package/dist/src/files/handlers.mjs +1 -1
- package/dist/src/gateway/chat-delta.mjs +1 -1
- package/dist/src/gateway/controller.mjs +1 -1
- package/dist/src/gateway/request-id-title-events.mjs +1 -1
- package/dist/src/gateway/ws-client.mjs +1 -1
- package/dist/src/index.mjs +1 -1
- package/dist/src/log-reporting/handlers.mjs +1 -1
- package/dist/src/log-reporting/report-logs.mjs +1 -1
- package/dist/src/models/handlers.mjs +1 -1
- package/dist/src/preferences/store.mjs +1 -1
- package/dist/src/request-id/handlers.mjs +1 -1
- package/dist/src/request-id/runtime-bridge.mjs +1 -1
- package/dist/src/request-id/session-store.mjs +1 -1
- package/dist/src/request-id/title.mjs +1 -1
- package/dist/src/review/controller.mjs +1 -0
- package/dist/src/runtime/cron-missed-run-policy.mjs +1 -1
- package/dist/src/runtime/index.mjs +1 -1
- package/dist/src/runtime/patch-channel-plugin-runtime.mjs +1 -1
- package/dist/src/runtime/patch-chat-attachment-base64.mjs +1 -0
- package/dist/src/runtime/patch-chat-history-mixed-tool-content.mjs +1 -1
- package/dist/src/runtime/patch-codex-isolated-auth.mjs +1 -0
- package/dist/src/runtime/patch-provider-request-id-header.mjs +1 -1
- package/dist/src/runtime/patch-qqbot-outbound-session-route.mjs +1 -1
- package/dist/src/runtime/patch-request-id-title-runtime.mjs +1 -1
- package/dist/src/runtime/patch-session-store-sqlite.mjs +1 -1
- package/dist/src/runtime/patch-weixin-outbound-session-route.mjs +1 -1
- package/dist/src/runtime/plugin-sync.mjs +1 -1
- package/dist/src/sessions/agent-sessions-map-store.mjs +1 -1
- package/dist/src/sessions/runtime-bridge.mjs +1 -1
- package/dist/src/sessions/session-data-service.mjs +1 -1
- package/dist/src/sessions/session-runtime-state-service.mjs +1 -1
- package/dist/src/sessions/session-runtime-state.mjs +1 -1
- package/dist/src/sessions/session-sqlite-store.mjs +1 -1
- package/dist/src/skills/import.mjs +1 -1
- package/dist/src/skills/market.mjs +1 -1
- package/dist/src/terminal/manager.mjs +1 -1
- package/dist/src/updates/controller.mjs +1 -1
- package/dist/src/updates/loader.mjs +1 -1
- package/package.json +7 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x44ad8a=_0x537f;(function(_0x27541f,_0x196adf){const _0x3d1055=_0x537f,_0x28bffb=_0x27541f();while(!![]){try{const _0x22d712=-parseInt(_0x3d1055(0x39f))/0x1+parseInt(_0x3d1055(0x153))/0x2+-parseInt(_0x3d1055(0x1a7))/0x3*(parseInt(_0x3d1055(0x335))/0x4)+parseInt(_0x3d1055(0x2c1))/0x5*(parseInt(_0x3d1055(0x1a3))/0x6)+-parseInt(_0x3d1055(0x271))/0x7+parseInt(_0x3d1055(0x289))/0x8*(parseInt(_0x3d1055(0x3b3))/0x9)+parseInt(_0x3d1055(0x347))/0xa;if(_0x22d712===_0x196adf)break;else _0x28bffb['push'](_0x28bffb['shift']());}catch(_0x450ad3){_0x28bffb['push'](_0x28bffb['shift']());}}}(_0x251d,0x582f5));import{existsSync}from'node:fs';import{createWriteStream}from'node:fs';import{chmod,cp,mkdir,readFile,readdir,rename,rm,stat,symlink,writeFile}from'node:fs/promises';import{basename,delimiter,dirname,join,extname,parse,relative,resolve}from'node:path';import{fileURLToPath,pathToFileURL}from'node:url';import{spawn}from'node:child_process';import{get}from'node:https';import{pipeline}from'node:stream/promises';import{getConfigPaths}from'@wujie-shell/config';import{copyDirFresh,getPackageMetadata,readJson,readPluginManifest,toRuntimeRelative,writeJson}from'../common/utils.mjs';import{createRuntimeLogger,summarizeRuntimeManifest,summarizeShellConfig}from'../common/runtime-logger.mjs';import{hasConfiguredKdocsSkill,installKdocsCliBinary}from'../connectors/kdocs-cli.mjs';import{installRuntimeLarkCliPackage,resolveRuntimeLarkCliCommand}from'../connectors/lark-cli.mjs';function _0x251d(){const _0x205e06=['aipc-dow','win32','pluginId','ch\x20skipp','test','stalling','stderr','plugin\x20s','pendenci','export\x20O','found','object','nodejs.o','OPENCLAW','nstalled','close','pipe','[wujie-s','ed;\x20plug','t\x20c2c\x20ou','Claw','nse\x20hook','location','\x20patch\x20s','play-pro','npm-cach','pid','_modules','has','bug;\x20ver','product\x20','tall\x20the','y\x20applie','json','es.','LocalSki','node/nod','generate','spec','dexed\x20wi','Unable\x20t','tching\x20p','ady\x20curr','time]\x20fe','oute\x20pat','d\x20for\x20lo','time','node_mod','pruned\x20r','ibility\x20','\x22\x20\x22%SCRI',':\x20manife','hell:run','unknown','efore\x20pa','exec','--fix','ch\x20alrea','re\x20upgra','ame','npm\x20plug','ies:\x20','--omit=p','createRu','OME=','\x20id\x20from','ath','red\x20Open','director','openclaw','node/lib','nt-weixi','nning\x20op','isFile','oot\x20was\x20','ot\x20found','chat\x20his','st\x20be\x20a\x20','\x20and\x20','tbound\x20d','route\x20pa','n\x20plugin','then','Dependen','href','des.','IR=$(CDP','ache\x20bef','importan','roductRu','agents\x20s','examples',',\x20shell.','mirrors\x20','tar.xz','channel\x20','configur','ons;\x20ver','started','dge.mjs','base\x20bui','4411512tcKdhe','WorkingD','out\x20c2c\x20','path','ced','HOME=\x22${','replaceA','er\x20patch','local:','runtimeR','ad\x20patch','wujie-lo','bridge\x20n','pack','set','doc','package-','\x22\x20from\x20','catch','pped;\x20di','ipped;\x20o','lite\x20pat','bin','-weixin','16XDvcmj','all\x20loca','ies','.npmmirr','\x20product','red\x20Node','\x20request','.json','tateDir','ore\x20pack','solver\x20n','und:\x20','\x20is\x20miss','isDirect','powershe','E_NAME%\x22','npmCli','loader-','_DIR%','outbound','request-','isArray','--no-aud','ipped;\x20r','OGO\x22\x20];\x20','ge\x20not\x20a','\x20did\x20not',':WUJIE_S','est-id/r','nPath\x20$e','src','e\x20plugin','all\x20','exec\x20\x22$S','ase','SIGTERM','rcing\x20QQ','l\x20plugin','being\x20in','\x20failed\x20','time]\x20in','ready\x20ap','statusCo','s\x20to\x20dir','eixin\x20@i','--omit=d','%USERPRO','runtime','untime\x20r','ipped;\x20f','\x20doctor\x20','atch\x20alr','tory\x20pro','1\x20]\x20&&\x20[','ions/run','-extract','1390160mvnkhC','utf8','__tests_','push','-xJf','atch\x20ski','registry','ntime','node\x20ver','indexOf','\x20-g','scripts','und','zip','cwd','/opencla','ILE_NAME','\x20not\x20fou','ld\x20start','\x20path\x20wa','\x20shape\x20n','--no-fun','join','rent','ie-shell','ream\x20fix','t\x20\x22OPENC','t\x20found','set\x20\x22OPE','ime/requ','fy\x20upstr','Bin','qqbot','tch\x20alre','platform','r\x20runtim','ipped;\x20d','\x20mirrors','G_FILE_N','ion','package','\x22\x20so\x20the','package.','lark-cli','st=','weixin\x20o','runtime\x20','age\x20was\x20','\x20resolve','env','startsWi','ent','with\x20cod','enclaw-w','ckaging','ion\x20mism','versions','Bypass','PT_DIR/','\x20create\x20','o.mjs\x22\x202','rchive\x20-','npm\x20inst','projectR','l\x20prepar','ujie-log','ackup','timeoutM','LocalPlu','s/npm','ing\x20\x22','AW_CONFI','\x20prepare','ogger','ntPaths','find','prefix\x20i','sion\x20val','ed;\x20chan','\x20applied','mismatch','\x20already','configFi','manifest','\x20patch\x20a','ed-tool\x20','n\x20outbou','size','scoped\x20s','ery\x20mirr','ignore','process.','allowMis','try\x20not\x20','tbound\x20f','resolved','wujieai.','tarball:','Version','ell-runt','\x20paths','d\x20an\x20inv','jie-shel','eady\x20app','x64','fix','patch\x20fo','warn','stinatio','sort','.tools','ons\x20with','name','npm','\x22\x20%*','-id\x20head','684JFWqmD','in\x20insta','map','skipped;','with\x20the','--legacy','LAW_STAT','dAt','man','tbound\x20s','octor\x20--','atch\x20app','\x20package','/npm','every','--json','\x20set\x20\x22OP','log','11359080kPopWP','\x22\x20\x22$SCRI','qqbot\x20ou','(empty)','headers',';\x20run\x20wu','kup','llPaths','kill\x20not','toISOStr','-Executi','\x20synced','kill','trim','utbound\x20','source','ession\x20r','fallback','e_module','ATH:-','IPT_DIR=','\x20local\x20p','d\x20Node\x20r','sion.','d\x20as\x20gro','eer','jection-','slice','.md','runtimeS','bridge.m','devDepen','session\x20','er\x20id.','arch','../../sh','STATE_DI','ntime\x20ch','ify\x20upst','utable','doctor','.cache','\x22%SCRIPT','PT_DIR/w','https://','agents','referenc','product','m-cli.js','missing\x20','vailable','patched','parse','go.mjs','dataDir','\x20runtime','extract-','HELL_ARC','NCLAW_CO','installe','ped;\x20cha','plied','PT_DIR%','\x20return\x20','ory','.js','resume','dencies','ile\x20not\x20','idated','aw\x202026.','nced','st\x20not\x20f','split','dataDirN','PENCLAW_','able','\x20skipped','provider','leName','.plugin-','ot\x20avail','\x20timed\x20o','ATH=\x22${O','ecs','m.wechat','on\x20futur','Run\x20\x22wuj','482793SuvegB','ntime\x20re','\x20bin\x20was','#!/bin/s','alid\x20pay','-peer-de','\x20signal=','../../as','CLAW_CON','untime\x20c','entryCou','singOpen','wnloadin','ime\x20buil','ed\x20OpenC','lib/node','FILE%\x5c','plugins\x20','patch\x20ap','unction\x20','469188guyzwJ','\x20started','-xzf','fix\x20star','store-lo','pt-path-','n\x20the\x20pe','r\x20@tence','.\x20Top-le','w.mjs','flush','or.com','replace','lready\x20a','configPa','syncOnly','$HOME/','in\x20not\x20i','extensio','ed;\x20brid','data','rcing\x20op','endsWith','execPath','ied','synced','Spec','appId','r\x20id.','ATE_DIR:','red','\x20\x22OPENCL','failed','law/qqbo','%~dp0\x22','wBin','er\x20respo','version','nnel','store\x20lo','shell-ru','tar','6\x20mixed\x20','ions\x20whe','\x20on\x20futu','\x20returne','\x20kdocs\x20s','SCRIPT_D','ME%\x22==\x22\x22','ader\x20not','local\x20pl','ATH=\x20cd\x20','_HOME:-','y:\x20','not\x20foun','ite\x20patc','\x20is\x20unav','nel\x20plug','reason','stdout','integrit','\x20\x22$0\x22)\x22\x20','287564AkGoDB','match','extract\x20','error','ch\x20appli','Version\x20','optional','transcri','\x5cwjrt-','patch\x20sk','nifest=','Invalid\x20','=\x22${OPEN','resolver','chat-dis','ENCLAW_H','ect\x20sess','ed\x20npm\x20p','null','pped;\x20ru','aipc-run','installP','y\x20compat','skills\x20s','nodeVers','patch\x20al','now','store\x20sq','shift','\x20\x20\x22$SCRI','node/bin','npm-cli.','required','6.6\x20chan','NFIG_PAT','ugin\x20spe','ailable.','set\x20\x22SCR','\x22\x20\x22$@\x22','fix\x20alre','toString','\x20depende','NCLAW_ST','lib','node.exe','ad-','channel.','untime-b','path:\x20','local','fix\x20mark','nd\x20after','h\x20applie','enclaw\x20d','rect\x20pee','ules','store\x20wr','r\x20@openc','prepare\x20','endencie','\x20summary','R=\x22${OPE','\x20complet','ors\x20bein','atch:\x20ma','some','dependen','connecto','ing','function','>/dev/nu','e\x20upgrad','\x20written','CONFIG_F','rs;\x20veri','\x20found','ATE_DIR%','d:\x20','root','claw-run','12upchVs','includes','filename','ist\x20not\x20','8172lXvWTi','nd\x20helpe','gin\x20not\x20','w.cmd','@echo\x20of','untime\x20p','ut\x20after','pped;\x20lo','ng\x20chann','Claw\x20ver','node','leted','nodeExec','install','JIE_NO_L','store-','g\x20indexe','session-','rebuilt\x20','/node_mo','index.mj','allback\x20','\x20install','cies','plugin\x20r','runtimeL',';\x20provid','ath\x20$env','kipped;\x20','Name','length','get','skills','eted','\x20can\x20ins','download','_shared','filter','id\x20title','runtime-','already-','r\x20OpenCl','tory\x20mix','empty\x20pl','.d.ts','dist','arm64','string','JSON:\x20','load:\x20','\x20configu','node-v','Extracte','oot','d\x20for\x20','wujiecla','docs','LiteralP','ynced','sets/wuj','npm-glob','plugins','.tmp/run','h\x20alread','e\x20tools\x20','wrapper\x20','ound','ime/sess','aging','add','lugin\x20de','\x20version','channel-','ginPaths','\x20to\x20dire','OOT\x20-For','nnel\x20sha','tests','Temporar','==\x22\x22\x20set','mjs','tch\x20appl','_SHELL_E','nv:WUJIE','el.inbou','pplied','shasum','dy\x20appli','\x20loaded','info','eady\x20cur','pluginSp','n\x20the\x20di','in\x20','jection\x20','npm\x20pack','nd\x20deliv','Configur','ie-logo.','H%\x22==\x22\x22\x20','if\x20\x22%OPE'];_0x251d=function(){return _0x205e06;};return _0x251d();}import{patchMixedToolContentFromSource}from'./patch-chat-history-mixed-tool-content.mjs';import{patchChannelPluginRuntimeFromSource}from'./patch-channel-plugin-runtime.mjs';import{patchProviderRequestIdHeaderFromSource}from'./patch-provider-request-id-header.mjs';import{patchSessionStoreLoadFromSource,patchSessionStoreWriteFromSource}from'./patch-session-store-sqlite.mjs';import{patchQQBotOutboundFallbackFromSource,patchQQBotOutboundSessionRouteFromSource}from'./patch-qqbot-outbound-session-route.mjs';import{patchWeixinOutboundFallbackFromSource,patchWeixinOutboundSessionRouteFromSource}from'./patch-weixin-outbound-session-route.mjs';import{patchRequestIdTitleRuntimeFromSource}from'./patch-request-id-title-runtime.mjs';const RUNTIME_DIR=_0x44ad8a(0x1e5)+_0x44ad8a(0x23a),MANIFEST_NAME=_0x44ad8a(0x1ce)+_0x44ad8a(0x314)+_0x44ad8a(0x290),NPM_INSTALL_TIMEOUT_MS=0xf*0x3c*0x3e8;export function resolveRuntimeRoot(_0x38e5d3){if(process.env.WUJIE_SHELL_RUNTIME_ROOT)return resolve(process.env.WUJIE_SHELL_RUNTIME_ROOT);return resolve(_0x38e5d3,RUNTIME_DIR);}export function resolveManifestPath(_0x5bcc22){return join(_0x5bcc22,MANIFEST_NAME);}async function loadProductRuntime(_0x5b7f81,_0x4ede30){const _0x10669c=_0x44ad8a,_0x5642c2=[join(_0x5b7f81,'shell-ru'+'ntime',_0x10669c(0x1bb)+'s'),join(_0x4ede30,_0x10669c(0x13d)+_0x10669c(0x2c8),'index.mj'+'s')];for(const _0x27ebfe of _0x5642c2){if(!existsSync(_0x27ebfe))continue;return await import(pathToFileURL(_0x27ebfe)[_0x10669c(0x260)]+'?t='+Date['now']());}return{};}export async function prepareRuntime(_0x3e9506,{syncOnly:syncOnly=![],pruneForPackaging:pruneForPackaging=![]}={}){const _0x4a8200=_0x44ad8a,_0x58a3ae=resolveRuntimeRoot(_0x3e9506['projectR'+_0x4a8200(0x1dc)]),_0x26ace8=createRuntimeLogger(getConfigPaths(_0x3e9506),_0x4a8200(0x2b8)),_0x2c38e2=Date[_0x4a8200(0x16d)]();_0x26ace8?.[_0x4a8200(0x264)+'t']?.(_0x4a8200(0x18d)+_0x4a8200(0x2ef)+_0x4a8200(0x26e),{'syncOnly':syncOnly,'runtimeRoot':_0x58a3ae,'shellConfig':summarizeShellConfig(_0x3e9506)});try{const _0x5c2deb=await ensureRuntimeBase(_0x3e9506,_0x58a3ae,{'runtimeLogger':_0x26ace8,'syncOnly':syncOnly});_0x26ace8?.[_0x4a8200(0x264)+'t']?.(_0x4a8200(0x2ef)+_0x4a8200(0x314)+_0x4a8200(0x1ff),{'manifestPath':resolveManifestPath(_0x58a3ae),'manifest':summarizeRuntimeManifest(_0x5c2deb)}),validateRuntimeNodeVersion(_0x5c2deb,_0x3e9506),_0x26ace8?.[_0x4a8200(0x264)+'t']?.(_0x4a8200(0x2ef)+_0x4a8200(0x2c9)+_0x4a8200(0x30e)+_0x4a8200(0x38c),{'nodeVersion':_0x5c2deb[_0x4a8200(0x16b)+_0x4a8200(0x2e8)]});if(syncOnly)validateRuntimeOpenClawVersion(_0x5c2deb,_0x3e9506),_0x26ace8?.['importan'+'t']?.('runtime\x20'+_0x4a8200(0x251)+'\x20version'+'\x20validat'+'ed',{'openclawVersion':_0x5c2deb[_0x4a8200(0x251)+_0x4a8200(0x323)]});else{if(_0x5c2deb[_0x4a8200(0x251)+_0x4a8200(0x323)]!==_0x3e9506['openclaw'][_0x4a8200(0x251)+_0x4a8200(0x323)]){const _0x5815a8=await loadRuntimeInfo(_0x3e9506['projectR'+_0x4a8200(0x1dc)]);_0x26ace8?.[_0x4a8200(0x264)+'t']?.(_0x4a8200(0x251)+_0x4a8200(0x341)+_0x4a8200(0x1bd)+_0x4a8200(0x3b4),{'fromVersion':_0x5c2deb[_0x4a8200(0x251)+_0x4a8200(0x323)]||'unknown','toVersion':_0x3e9506[_0x4a8200(0x251)]['openclaw'+_0x4a8200(0x323)]}),await installOpenClawPackage(_0x5815a8,_0x3e9506[_0x4a8200(0x251)][_0x4a8200(0x251)+_0x4a8200(0x323)]),_0x5c2deb[_0x4a8200(0x251)+'Version']=_0x3e9506['openclaw']['openclaw'+_0x4a8200(0x323)],_0x26ace8?.[_0x4a8200(0x264)+'t']?.(_0x4a8200(0x251)+_0x4a8200(0x341)+_0x4a8200(0x1bd)+_0x4a8200(0x191)+'ed',{'openclawVersion':_0x5c2deb[_0x4a8200(0x251)+_0x4a8200(0x323)]});}}_0x5c2deb[_0x4a8200(0x231)+_0x4a8200(0x33c)]=new Date()[_0x4a8200(0x350)+_0x4a8200(0x197)](),_0x5c2deb[_0x4a8200(0x16b)+_0x4a8200(0x2e8)]=_0x3e9506['openclaw'][_0x4a8200(0x16b)+_0x4a8200(0x2e8)],_0x5c2deb[_0x4a8200(0x376)]={'appId':_0x3e9506[_0x4a8200(0x3ce)],'productName':_0x3e9506['productN'+_0x4a8200(0x247)],'dataDirName':_0x3e9506[_0x4a8200(0x391)+_0x4a8200(0x247)]},await patchChatHistoryMixedToolContentBug(_0x58a3ae,_0x5c2deb,{'runtimeLogger':_0x26ace8}),await patchProviderRequestIdHeader(_0x58a3ae,_0x5c2deb,{'runtimeLogger':_0x26ace8}),await patchChannelPluginRuntimeBug(_0x58a3ae,_0x5c2deb,{'runtimeLogger':_0x26ace8}),await patchWeixinOutboundFallbackRuntime(_0x58a3ae,_0x5c2deb,{'runtimeLogger':_0x26ace8}),await patchQQBotOutboundFallbackRuntime(_0x58a3ae,_0x5c2deb,{'runtimeLogger':_0x26ace8});const _0x3a2721=await loadProductRuntime(_0x3e9506[_0x4a8200(0x300)+_0x4a8200(0x1dc)],_0x58a3ae);if(typeof _0x3a2721['prepareP'+_0x4a8200(0x265)+'ntime']===_0x4a8200(0x198)){const _0x23900e=createRuntimeInfoFromManifest(_0x58a3ae,_0x5c2deb);await _0x3a2721['prepareP'+'roductRu'+_0x4a8200(0x2c8)]({'shellConfig':_0x3e9506,'runtime':_0x23900e,'runtimeLogger':_0x26ace8,'syncOnly':syncOnly}),_0x26ace8?.[_0x4a8200(0x264)+'t']?.(_0x4a8200(0x22a)+'runtime\x20'+'tools\x20sy'+_0x4a8200(0x38e));}await patchSessionStoreSqliteRuntime(_0x58a3ae,_0x5c2deb,{'runtimeLogger':_0x26ace8}),await patchRequestIdTitleRuntime(_0x58a3ae,_0x5c2deb,{'runtimeLogger':_0x26ace8});!syncOnly&&(await installRuntimeLarkCliPackage(createRuntimeInfoFromManifest(_0x58a3ae,_0x5c2deb),{'runtimeLogger':_0x26ace8,'createRuntimeEnv':createRuntimeEnv}),_0x26ace8?.['importan'+'t']?.(_0x4a8200(0x2ec)+_0x4a8200(0x37e)+_0x4a8200(0x341)+_0x4a8200(0x352)),await hasConfiguredKdocsSkill(_0x3e9506)?(await installKdocsCliBinary(_0x3e9506,createRuntimeInfoFromManifest(_0x58a3ae,_0x5c2deb),{'runtimeLogger':_0x26ace8,'syncOnly':syncOnly}),_0x26ace8?.[_0x4a8200(0x264)+'t']?.(_0x4a8200(0x196)+_0x4a8200(0x2e4)+_0x4a8200(0x1e7)+'synced')):_0x26ace8?.[_0x4a8200(0x200)](_0x4a8200(0x196)+_0x4a8200(0x2e4)+_0x4a8200(0x1e7)+_0x4a8200(0x338)+_0x4a8200(0x143)+_0x4a8200(0x34f)+'\x20configu'+_0x4a8200(0x3d1)));const _0xd836ed=Array[_0x4a8200(0x29e)](_0x5c2deb['plugins'])?_0x5c2deb[_0x4a8200(0x1e4)][_0x4a8200(0x1c5)]:0x0;return await syncManifestPluginScope(_0x3e9506,_0x58a3ae,_0x5c2deb),_0x26ace8?.[_0x4a8200(0x264)+'t']?.(_0x4a8200(0x2ef)+'plugin\x20s'+'cope\x20syn'+_0x4a8200(0x275),{'beforePluginCount':_0xd836ed,'afterPluginCount':Array[_0x4a8200(0x29e)](_0x5c2deb['plugins'])?_0x5c2deb[_0x4a8200(0x1e4)]['length']:0x0,'pluginSpecCount':Array[_0x4a8200(0x29e)](_0x5c2deb[_0x4a8200(0x202)+_0x4a8200(0x39b)])?_0x5c2deb[_0x4a8200(0x202)+_0x4a8200(0x39b)][_0x4a8200(0x1c5)]:0x0}),await syncConfiguredNpmPlugins(_0x3e9506,_0x58a3ae,_0x5c2deb,{'runtimeLogger':_0x26ace8,'syncOnly':syncOnly}),_0x26ace8?.[_0x4a8200(0x264)+'t']?.(_0x4a8200(0x26c)+_0x4a8200(0x164)+'lugins\x20s'+_0x4a8200(0x1e1),{'pluginSpecCount':_0x3e9506[_0x4a8200(0x251)]['pluginSp'+_0x4a8200(0x39b)][_0x4a8200(0x1c5)],'pluginCount':Array[_0x4a8200(0x29e)](_0x5c2deb[_0x4a8200(0x1e4)])?_0x5c2deb[_0x4a8200(0x1e4)]['length']:0x0}),await patchWeixinOutboundSessionRoute(_0x58a3ae,_0x5c2deb,{'runtimeLogger':_0x26ace8}),await patchQQBotOutboundSessionRoute(_0x58a3ae,_0x5c2deb,{'runtimeLogger':_0x26ace8}),await syncProductPlugins(_0x3e9506,_0x58a3ae,_0x5c2deb,{'runtimeLogger':_0x26ace8}),_0x26ace8?.[_0x4a8200(0x264)+'t']?.('product\x20'+_0x4a8200(0x3b0)+_0x4a8200(0x3cc),{'localPluginCount':_0x3e9506[_0x4a8200(0x251)][_0x4a8200(0x320)+_0x4a8200(0x305)+_0x4a8200(0x1f0)]['length'],'pluginCount':Array['isArray'](_0x5c2deb[_0x4a8200(0x1e4)])?_0x5c2deb[_0x4a8200(0x1e4)][_0x4a8200(0x1c5)]:0x0}),await syncProductAgents(_0x3e9506,_0x58a3ae,_0x5c2deb),_0x26ace8?.[_0x4a8200(0x264)+'t']?.(_0x4a8200(0x22a)+_0x4a8200(0x266)+_0x4a8200(0x1e1),{'sources':_0x3e9506[_0x4a8200(0x251)][_0x4a8200(0x320)+'LocalAge'+_0x4a8200(0x30b)],'entryCount':_0x5c2deb[_0x4a8200(0x374)]?.['entryCou'+'nt'],'installPath':_0x5c2deb[_0x4a8200(0x374)]?.['installP'+_0x4a8200(0x24e)]}),await syncProductSkills(_0x3e9506,_0x58a3ae,_0x5c2deb),_0x26ace8?.[_0x4a8200(0x264)+'t']?.(_0x4a8200(0x22a)+_0x4a8200(0x16a)+'ynced',{'sources':_0x3e9506[_0x4a8200(0x251)]['resolved'+_0x4a8200(0x22f)+_0x4a8200(0x34e)],'entryCount':_0x5c2deb[_0x4a8200(0x1c7)]?.[_0x4a8200(0x3a9)+'nt'],'installPath':_0x5c2deb[_0x4a8200(0x1c7)]?.['installP'+_0x4a8200(0x24e)]}),await syncRuntimeWrapper(_0x3e9506,_0x58a3ae,_0x5c2deb),_0x26ace8?.['importan'+'t']?.(_0x4a8200(0x2ef)+_0x4a8200(0x1e8)+_0x4a8200(0x3cc),{'wujieclawBin':_0x5c2deb[_0x4a8200(0x1de)+_0x4a8200(0x3d6)]}),await prunePackagedRuntimeCaches(_0x58a3ae,_0x26ace8),pruneForPackaging&&await prunePackagedRuntimePayload(_0x58a3ae,_0x5c2deb,_0x26ace8),await writeJson(resolveManifestPath(_0x58a3ae),_0x5c2deb),_0x26ace8?.['importan'+'t']?.(_0x4a8200(0x2ef)+'manifest'+_0x4a8200(0x19b),{'manifestPath':resolveManifestPath(_0x58a3ae),'manifest':summarizeRuntimeManifest(_0x5c2deb),'durationMs':Date[_0x4a8200(0x16d)]()-_0x2c38e2}),await _0x26ace8?.[_0x4a8200(0x3bd)](),_0x5c2deb;}catch(_0x16b109){_0x26ace8?.[_0x4a8200(0x156)]('prepare\x20'+_0x4a8200(0x2ef)+_0x4a8200(0x3d3),{'syncOnly':syncOnly,'runtimeRoot':_0x58a3ae,'durationMs':Date[_0x4a8200(0x16d)]()-_0x2c38e2,'error':_0x16b109}),await _0x26ace8?.[_0x4a8200(0x3bd)]();throw _0x16b109;}}async function prunePackagedRuntimeCaches(_0x315397,_0x492563){const _0x484700=_0x44ad8a,_0x2c1cb2=[join(_0x315397,_0x484700(0x370)),join(_0x315397,_0x484700(0x32f),'npm-cach'+'e'),join(_0x315397,_0x484700(0x167)+'time-bac'+_0x484700(0x34d)),join(_0x315397,_0x484700(0x20c)+'nloads-b'+_0x484700(0x303))];for(const _0xb983c8 of _0x2c1cb2){if(!existsSync(_0xb983c8))continue;await rm(_0xb983c8,{'recursive':!![],'force':!![]}),_0x492563?.[_0x484700(0x200)](_0x484700(0x23c)+_0x484700(0x3a8)+_0x484700(0x263)+_0x484700(0x292)+_0x484700(0x1eb),{'cachePath':_0xb983c8});}}async function prunePackagedRuntimePayload(_0x3740be,_0x5282c9,_0x298c17){const _0x2422fc=_0x44ad8a,_0x5af0f4=createRuntimeInfoFromManifest(_0x3740be,_0x5282c9),_0x5643aa=[join(_0x3740be,process[_0x2422fc(0x2e3)]===_0x2422fc(0x20d)?'node/nod'+_0x2422fc(0x359)+_0x2422fc(0x306):_0x2422fc(0x252)+_0x2422fc(0x1ba)+'dules/np'+'m'),join(_0x5af0f4[_0x2422fc(0x251)+_0x2422fc(0x272)+'ir'],_0x2422fc(0x23b)+_0x2422fc(0x18a))],_0x4d5ed5=join(_0x5af0f4[_0x2422fc(0x251)+_0x2422fc(0x272)+'ir'],'dist',_0x2422fc(0x3c5)+'ns');if(existsSync(_0x4d5ed5))for(const _0x4ac492 of await readdir(_0x4d5ed5,{'withFileTypes':!![]})){_0x4ac492[_0x2422fc(0x296)+'ory']()&&_0x5643aa['push'](join(_0x4d5ed5,_0x4ac492[_0x2422fc(0x331)],_0x2422fc(0x23b)+_0x2422fc(0x18a)));}const _0x18f893={'files':0x0,'directories':0x0,'bytes':0x0};for(const _0x49634e of _0x5643aa){await pruneRuntimeDependencyTree(_0x49634e,_0x18f893);}await pruneOpenClawDocs(_0x5af0f4['openclaw'+'WorkingD'+'ir'],_0x18f893),_0x298c17?.[_0x2422fc(0x200)](_0x2422fc(0x23c)+_0x2422fc(0x1ac)+'ayload\x20b'+_0x2422fc(0x242)+_0x2422fc(0x2f7),_0x18f893);}async function pruneOpenClawDocs(_0x4726c0,_0x2c9872){const _0x37ac82=_0x44ad8a,_0x17bbcd=join(_0x4726c0,_0x37ac82(0x1df));if(!existsSync(_0x17bbcd))return;for(const _0x25c2af of await readdir(_0x17bbcd,{'withFileTypes':!![]})){if(_0x25c2af[_0x37ac82(0x331)]===_0x37ac82(0x375)+'e')continue;await removePrunedPath(join(_0x17bbcd,_0x25c2af[_0x37ac82(0x331)]),_0x2c9872);}}async function pruneRuntimeDependencyTree(_0x1dc04d,_0x56c621){const _0x361c2b=_0x44ad8a;if(!existsSync(_0x1dc04d))return;for(const _0x148fa8 of await readdir(_0x1dc04d,{'withFileTypes':!![]})){const _0x575057=join(_0x1dc04d,_0x148fa8[_0x361c2b(0x331)]);if(_0x148fa8[_0x361c2b(0x296)+_0x361c2b(0x387)]()){if(shouldPruneRuntimeDirectory(_0x1dc04d,_0x148fa8['name'])){await removePrunedPath(_0x575057,_0x56c621);continue;}await pruneRuntimeDependencyTree(_0x575057,_0x56c621);continue;}_0x148fa8['isFile']()&&shouldPruneRuntimeFile(_0x148fa8[_0x361c2b(0x331)])&&await removePrunedPath(_0x575057,_0x56c621);}}function shouldPruneRuntimeDirectory(_0x260f7e,_0x3af44d){const _0x2966f1=_0x44ad8a;if(_0x3af44d==='@types')return!![];if(new Set([_0x2966f1(0x280),_0x2966f1(0x1df),_0x2966f1(0x33d)])[_0x2966f1(0x228)](_0x3af44d))return existsSync(join(_0x260f7e,_0x2966f1(0x2eb)+_0x2966f1(0x22d)));return new Set([_0x2966f1(0x2c3)+'_','example',_0x2966f1(0x267),_0x2966f1(0x210),_0x2966f1(0x1f4)])['has'](_0x3af44d);}function shouldPruneRuntimeFile(_0x45eb44){const _0x5f1645=_0x44ad8a;if(_0x45eb44===_0x5f1645(0x281)+'lock.jso'+'n'||_0x45eb44[_0x5f1645(0x3c9)](_0x5f1645(0x1d3)))return!![];return new Set(['.map',_0x5f1645(0x363),'.markdow'+'n'])[_0x5f1645(0x228)](extname(_0x45eb44)['toLowerC'+_0x5f1645(0x2ab)]());}async function removePrunedPath(_0x309fc0,_0x58a51c){const _0x132e9c=_0x44ad8a;if(!existsSync(_0x309fc0))return;const _0x513b56=await getPathSize(_0x309fc0),_0x2a14c9=await stat(_0x309fc0);await rm(_0x309fc0,{'recursive':!![],'force':!![]}),_0x58a51c['bytes']+=_0x513b56;if(_0x2a14c9[_0x132e9c(0x296)+_0x132e9c(0x387)]())_0x58a51c[_0x132e9c(0x250)+_0x132e9c(0x28b)]+=0x1;else _0x58a51c['files']+=0x1;}async function getPathSize(_0x2450e8){const _0x64573d=_0x44ad8a,_0x4d38cb=await stat(_0x2450e8);if(!_0x4d38cb[_0x64573d(0x296)+_0x64573d(0x387)]())return _0x4d38cb[_0x64573d(0x318)];let _0x1e2f98=0x0;for(const _0x3e8ee8 of await readdir(_0x2450e8,{'withFileTypes':!![]})){_0x1e2f98+=await getPathSize(join(_0x2450e8,_0x3e8ee8[_0x64573d(0x331)]));}return _0x1e2f98;}function _0x537f(_0xd3c41f,_0x44cc64){_0xd3c41f=_0xd3c41f-0x139;const _0x251da2=_0x251d();let _0x537fd3=_0x251da2[_0xd3c41f];return _0x537fd3;}async function syncRuntimeWrapper(_0x307d56,_0x1b4870,_0x3c50bd){const _0x336ffa=_0x44ad8a,_0x1e5f84=_0x307d56[_0x336ffa(0x251)]?.[_0x336ffa(0x313)+_0x336ffa(0x396)]??_0x336ffa(0x321)+_0x336ffa(0x22d),_0x1cd4b1=join(_0x1b4870,_0x336ffa(0x287),'wujiecla'+'w'),_0x3fa152=join(_0x1b4870,_0x336ffa(0x287),_0x336ffa(0x1de)+_0x336ffa(0x1aa)),_0x388e11=normalizeRuntimeRelativePath(relative(dirname(_0x1cd4b1),resolve(_0x1b4870,_0x3c50bd[_0x336ffa(0x1b3)+_0x336ffa(0x36e)]))),_0x4915ed=normalizeRuntimeRelativePath(relative(dirname(_0x1cd4b1),resolve(_0x1b4870,_0x3c50bd[_0x336ffa(0x251)+_0x336ffa(0x2e0)]))),_0x1fb753=_0x336ffa(0x3c3)+_0x307d56[_0x336ffa(0x391)+_0x336ffa(0x247)],_0x2fba98=_0x336ffa(0x2b7)+_0x336ffa(0x3af)+_0x307d56[_0x336ffa(0x391)+_0x336ffa(0x247)];await mkdir(dirname(_0x1cd4b1),{'recursive':!![]});const _0x2bc254=fileURLToPath(new URL(_0x336ffa(0x3a6)+_0x336ffa(0x1e2)+_0x336ffa(0x209)+_0x336ffa(0x1f7),import.meta.url)),_0x11ffdf=join(_0x1b4870,_0x336ffa(0x287),_0x336ffa(0x27c)+_0x336ffa(0x37c));await cp(_0x2bc254,_0x11ffdf),await writeFile(_0x1cd4b1,[_0x336ffa(0x3a2)+'h','export\x20O'+'PENCLAW_'+_0x336ffa(0x276)+_0x336ffa(0x219)+_0x336ffa(0x149)+_0x1fb753+'}\x22','export\x20O'+_0x336ffa(0x392)+_0x336ffa(0x36b)+_0x336ffa(0x190)+_0x336ffa(0x17d)+_0x336ffa(0x3d0)+'-'+_0x1fb753+'}\x22',_0x336ffa(0x215)+_0x336ffa(0x392)+_0x336ffa(0x19c)+_0x336ffa(0x2d1)+_0x336ffa(0x15f)+_0x336ffa(0x3a7)+'FIG_FILE'+'_NAME:-'+_0x1e5f84+'}\x22',_0x336ffa(0x215)+_0x336ffa(0x392)+'CONFIG_P'+_0x336ffa(0x39a)+_0x336ffa(0x392)+'CONFIG_P'+_0x336ffa(0x35a)+_0x1fb753+'/'+_0x1e5f84+'}\x22',_0x336ffa(0x144)+_0x336ffa(0x262)+_0x336ffa(0x148)+'--\x20\x22$(di'+'rname\x20--'+_0x336ffa(0x152)+'&&\x20pwd)','if\x20[\x20-t\x20'+_0x336ffa(0x2be)+'\x20-z\x20\x22$WU'+_0x336ffa(0x1b5)+_0x336ffa(0x2a1)+_0x336ffa(0x25e),_0x336ffa(0x170)+'PT_DIR/'+_0x388e11+('\x22\x20\x22$SCRI'+_0x336ffa(0x372)+_0x336ffa(0x302)+_0x336ffa(0x2fd)+_0x336ffa(0x199)+'ll\x20||\x20tr'+'ue'),'fi',_0x336ffa(0x2aa)+'CRIPT_DI'+'R/'+_0x388e11+(_0x336ffa(0x348)+_0x336ffa(0x2fb))+_0x4915ed+_0x336ffa(0x179),''][_0x336ffa(0x2d7)]('\x0a'),'utf8'),await chmod(_0x1cd4b1,0x1ed),await writeFile(_0x3fa152,[_0x336ffa(0x1ab)+'f','if\x20\x22%OPE'+'NCLAW_HO'+_0x336ffa(0x145)+_0x336ffa(0x345)+_0x336ffa(0x162)+_0x336ffa(0x24c)+_0x2fba98+'\x22',_0x336ffa(0x20b)+_0x336ffa(0x17d)+_0x336ffa(0x19f)+'\x22==\x22\x22\x20se'+_0x336ffa(0x2db)+_0x336ffa(0x33b)+'E_DIR='+_0x2fba98+'\x22','if\x20\x22%OPE'+_0x336ffa(0x381)+'NFIG_FIL'+_0x336ffa(0x298)+_0x336ffa(0x1f6)+_0x336ffa(0x3d2)+_0x336ffa(0x308)+_0x336ffa(0x2e7)+'AME='+_0x1e5f84+'\x22','if\x20\x22%OPE'+'NCLAW_CO'+'NFIG_PAT'+_0x336ffa(0x20a)+_0x336ffa(0x2dd)+_0x336ffa(0x381)+_0x336ffa(0x175)+'H='+_0x2fba98+'\x5c'+_0x1e5f84+'\x22',_0x336ffa(0x178)+_0x336ffa(0x35b)+_0x336ffa(0x3d5),_0x336ffa(0x371)+_0x336ffa(0x29b)+toWindowsPath(_0x388e11)+(_0x336ffa(0x23e)+_0x336ffa(0x385))+toWindowsPath(_0x4915ed)+_0x336ffa(0x333),''][_0x336ffa(0x2d7)]('\x0d\x0a'),'utf8'),_0x3c50bd[_0x336ffa(0x1de)+_0x336ffa(0x3d6)]=toRuntimeRelative(_0x1b4870,process[_0x336ffa(0x2e3)]===_0x336ffa(0x20d)?_0x3fa152:_0x1cd4b1);}async function patchChatHistoryMixedToolContentBug(_0x4ea4cb,_0x5644ac,_0x439a16={}){const _0x3f515d=_0x44ad8a,_0x2257fc=resolve(_0x4ea4cb,_0x5644ac['openclaw'+_0x3f515d(0x272)+'ir']),_0x15031d=join(_0x2257fc,_0x3f515d(0x1d4));let _0x142fac=[];try{_0x142fac=await readdir(_0x15031d,{'withFileTypes':!![]});}catch{_0x439a16[_0x3f515d(0x1c0)+_0x3f515d(0x30a)]?.[_0x3f515d(0x32c)]?.('chat\x20his'+'tory\x20mix'+_0x3f515d(0x316)+_0x3f515d(0x15c)+_0x3f515d(0x2e5)+_0x3f515d(0x1a6)+_0x3f515d(0x216),{'distDir':_0x15031d,'openclawVersion':_0x5644ac[_0x3f515d(0x251)+_0x3f515d(0x323)]});return;}const _0x1ca14e=_0x142fac[_0x3f515d(0x1cc)](_0xbb77dd=>_0xbb77dd[_0x3f515d(0x255)]()&&(_0xbb77dd[_0x3f515d(0x331)]['startsWi'+'th'](_0x3f515d(0x161)+_0x3f515d(0x224)+_0x3f515d(0x361))||_0xbb77dd[_0x3f515d(0x331)][_0x3f515d(0x2f3)+'th'](_0x3f515d(0x1b8)+_0x3f515d(0x15a)+_0x3f515d(0x3b8)))&&_0xbb77dd[_0x3f515d(0x331)][_0x3f515d(0x3c9)](_0x3f515d(0x388)))[_0x3f515d(0x337)](_0x5dcda8=>join(_0x15031d,_0x5dcda8[_0x3f515d(0x331)]));if(_0x1ca14e[_0x3f515d(0x1c5)]===0x0){_0x439a16[_0x3f515d(0x1c0)+'ogger']?.[_0x3f515d(0x32c)]?.(_0x3f515d(0x258)+_0x3f515d(0x1d1)+_0x3f515d(0x316)+_0x3f515d(0x15c)+_0x3f515d(0x2ba)+_0x3f515d(0x38b)+'found',{'openclawVersion':_0x5644ac[_0x3f515d(0x251)+_0x3f515d(0x323)]});return;}for(const _0x4bd685 of _0x1ca14e){const _0xd68a34=await readFile(_0x4bd685,_0x3f515d(0x2c2)),_0x406408=patchMixedToolContentFromSource(_0xd68a34);if(!_0x406408[_0x3f515d(0x37a)]){if(_0x406408[_0x3f515d(0x14f)]===_0x3f515d(0x1cf)+_0x3f515d(0x37a)){_0x439a16[_0x3f515d(0x1c0)+_0x3f515d(0x30a)]?.[_0x3f515d(0x200)]?.('chat\x20his'+_0x3f515d(0x1d1)+'ed-tool\x20'+_0x3f515d(0x16c)+_0x3f515d(0x2b2)+'plied',{'openclawVersion':_0x5644ac['openclaw'+'Version'],'filePath':_0x4bd685});return;}continue;}await writeFile(_0x4bd685,_0x406408[_0x3f515d(0x356)],'utf8'),_0x439a16[_0x3f515d(0x1c0)+'ogger']?.['info']?.('chat\x20his'+_0x3f515d(0x1d1)+_0x3f515d(0x316)+_0x3f515d(0x3b1)+_0x3f515d(0x384),{'openclawVersion':_0x5644ac[_0x3f515d(0x251)+_0x3f515d(0x323)],'filePath':_0x4bd685,'note':_0x3f515d(0x1f5)+'y\x20compat'+_0x3f515d(0x23d)+_0x3f515d(0x32b)+'r\x20OpenCl'+_0x3f515d(0x38d)+_0x3f515d(0x13f)+'tool\x20his'+_0x3f515d(0x2bd)+_0x3f515d(0x205)+_0x3f515d(0x229)+'ify\x20upst'+'ream\x20fix'+_0x3f515d(0x141)+_0x3f515d(0x246)+_0x3f515d(0x261)});return;}_0x439a16['runtimeL'+'ogger']?.['warn']?.('chat\x20his'+_0x3f515d(0x1d1)+_0x3f515d(0x316)+_0x3f515d(0x15c)+_0x3f515d(0x2ba)+_0x3f515d(0x3b2)+_0x3f515d(0x14b)+'d',{'openclawVersion':_0x5644ac['openclaw'+_0x3f515d(0x323)]});}async function patchProviderRequestIdHeader(_0x585100,_0x99851,_0x5122c4={}){const _0x254210=_0x44ad8a,_0x4e1224=resolve(_0x585100,_0x99851['openclaw'+_0x254210(0x272)+'ir']),_0x4098e2=join(_0x4e1224,'dist');let _0xd6cf79=[];try{_0xd6cf79=await readdir(_0x4098e2,{'withFileTypes':!![]});}catch{_0x5122c4[_0x254210(0x1c0)+_0x254210(0x30a)]?.[_0x254210(0x32c)]?.(_0x254210(0x395)+_0x254210(0x28f)+_0x254210(0x334)+_0x254210(0x278)+_0x254210(0x394)+';\x20dist\x20n'+_0x254210(0x257),{'distDir':_0x4098e2,'openclawVersion':_0x99851['openclaw'+_0x254210(0x323)]});return;}const _0x3b97ef=_0xd6cf79[_0x254210(0x1cc)](_0x41283b=>_0x41283b[_0x254210(0x255)]()&&_0x41283b[_0x254210(0x331)]['endsWith'](_0x254210(0x388)))[_0x254210(0x337)](_0x43044c=>join(_0x4098e2,_0x43044c['name']));let _0x2df2a0=0x0,_0x3351a0=0x0;for(const _0x1f9f27 of _0x3b97ef){const _0x58ed74=await readFile(_0x1f9f27,_0x254210(0x2c2)),_0x1b57c0=patchProviderRequestIdHeaderFromSource(_0x58ed74);if(_0x1b57c0[_0x254210(0x37a)]){await writeFile(_0x1f9f27,_0x1b57c0[_0x254210(0x356)],_0x254210(0x2c2)),_0x2df2a0+=0x1,_0x5122c4[_0x254210(0x1c0)+'ogger']?.[_0x254210(0x200)]?.(_0x254210(0x395)+_0x254210(0x28f)+'-id\x20head'+_0x254210(0x278)+_0x254210(0x310),{'openclawVersion':_0x99851['openclaw'+_0x254210(0x323)],'filePath':_0x1f9f27});continue;}if(_0x1b57c0[_0x254210(0x14f)]==='already-'+_0x254210(0x37a))_0x3351a0+=0x1;}if(_0x2df2a0>0x0){_0x5122c4[_0x254210(0x1c0)+_0x254210(0x30a)]?.[_0x254210(0x200)]?.(_0x254210(0x395)+_0x254210(0x28f)+_0x254210(0x334)+_0x254210(0x278)+_0x254210(0x18f),{'openclawVersion':_0x99851[_0x254210(0x251)+_0x254210(0x323)],'patchedCount':_0x2df2a0,'alreadyPatchedCount':_0x3351a0});return;}if(_0x3351a0>0x0){_0x5122c4[_0x254210(0x1c0)+_0x254210(0x30a)]?.[_0x254210(0x200)]?.(_0x254210(0x395)+_0x254210(0x28f)+'-id\x20head'+'er\x20patch'+_0x254210(0x312)+_0x254210(0x310),{'openclawVersion':_0x99851[_0x254210(0x251)+'Version'],'alreadyPatchedCount':_0x3351a0});return;}_0x5122c4[_0x254210(0x1c0)+_0x254210(0x30a)]?.[_0x254210(0x32c)]?.(_0x254210(0x395)+_0x254210(0x28f)+'-id\x20head'+_0x254210(0x278)+_0x254210(0x394)+_0x254210(0x1c1)+_0x254210(0x139)+_0x254210(0x221)+_0x254210(0x2d2)+'nd',{'openclawVersion':_0x99851[_0x254210(0x251)+_0x254210(0x323)]});}async function patchChannelPluginRuntimeBug(_0x326dcf,_0x2233c1,_0x10c0af={}){const _0x50ddfc=_0x44ad8a,_0xaf3e5e=resolve(_0x326dcf,_0x2233c1[_0x50ddfc(0x251)+'WorkingD'+'ir']),_0x371061=join(_0xaf3e5e,'dist');let _0x397a94=[];try{_0x397a94=await readdir(_0x371061,{'withFileTypes':!![]});}catch{_0x10c0af[_0x50ddfc(0x1c0)+_0x50ddfc(0x30a)]?.[_0x50ddfc(0x32c)]?.(_0x50ddfc(0x26b)+_0x50ddfc(0x1bf)+'untime\x20p'+_0x50ddfc(0x2c6)+_0x50ddfc(0x284)+_0x50ddfc(0x38f)+_0x50ddfc(0x1e9),{'distDir':_0x371061,'openclawVersion':_0x2233c1[_0x50ddfc(0x251)+_0x50ddfc(0x323)]});return;}const _0x1b15ba=_0x397a94['filter'](_0x26c559=>_0x26c559[_0x50ddfc(0x255)]()&&_0x26c559[_0x50ddfc(0x331)]['startsWi'+'th'](_0x50ddfc(0x29a))&&_0x26c559['name'][_0x50ddfc(0x3c9)](_0x50ddfc(0x388)))[_0x50ddfc(0x337)](_0x4f1fc9=>join(_0x371061,_0x4f1fc9[_0x50ddfc(0x331)])),_0x4dddcc=await resolveRuntimeChannelImportPath(_0x371061,_0x397a94);if(_0x1b15ba[_0x50ddfc(0x1c5)]===0x0){_0x10c0af['runtimeL'+_0x50ddfc(0x30a)]?.[_0x50ddfc(0x32c)]?.('channel\x20'+_0x50ddfc(0x1bf)+_0x50ddfc(0x1ac)+_0x50ddfc(0x2c6)+_0x50ddfc(0x1ae)+_0x50ddfc(0x146)+_0x50ddfc(0x19e),{'openclawVersion':_0x2233c1[_0x50ddfc(0x251)+_0x50ddfc(0x323)]});return;}if(!_0x4dddcc){_0x10c0af[_0x50ddfc(0x1c0)+_0x50ddfc(0x30a)]?.['warn']?.(_0x50ddfc(0x26b)+_0x50ddfc(0x1bf)+_0x50ddfc(0x1ac)+_0x50ddfc(0x2c6)+_0x50ddfc(0x166)+_0x50ddfc(0x36c)+'annel\x20en'+_0x50ddfc(0x31e)+_0x50ddfc(0x216),{'openclawVersion':_0x2233c1[_0x50ddfc(0x251)+_0x50ddfc(0x323)],'distDir':_0x371061});return;}for(const _0x14b530 of _0x1b15ba){const _0x1faadf=await readFile(_0x14b530,_0x50ddfc(0x2c2)),_0x531a97=patchChannelPluginRuntimeFromSource(_0x1faadf,{'runtimeChannelImportPath':_0x4dddcc});if(!_0x531a97[_0x50ddfc(0x37a)]){if(_0x531a97[_0x50ddfc(0x14f)]===_0x50ddfc(0x1cf)+'patched'){_0x10c0af['runtimeL'+'ogger']?.[_0x50ddfc(0x200)]?.(_0x50ddfc(0x26b)+_0x50ddfc(0x1bf)+_0x50ddfc(0x1ac)+_0x50ddfc(0x2bc)+_0x50ddfc(0x328)+'lied',{'openclawVersion':_0x2233c1[_0x50ddfc(0x251)+_0x50ddfc(0x323)],'filePath':_0x14b530});return;}continue;}await writeFile(_0x14b530,_0x531a97['source'],_0x50ddfc(0x2c2)),_0x10c0af[_0x50ddfc(0x1c0)+_0x50ddfc(0x30a)]?.['info']?.('channel\x20'+_0x50ddfc(0x1bf)+_0x50ddfc(0x1ac)+_0x50ddfc(0x340)+'lied',{'openclawVersion':_0x2233c1['openclaw'+_0x50ddfc(0x323)],'filePath':_0x14b530,'note':_0x50ddfc(0x1f5)+_0x50ddfc(0x169)+_0x50ddfc(0x23d)+_0x50ddfc(0x32b)+_0x50ddfc(0x1d0)+_0x50ddfc(0x38d)+_0x50ddfc(0x174)+_0x50ddfc(0x14e)+'in\x20runti'+'me\x20missi'+_0x50ddfc(0x1af)+_0x50ddfc(0x1fb)+_0x50ddfc(0x1a8)+_0x50ddfc(0x19d)+_0x50ddfc(0x2df)+'eam\x20fix\x20'+_0x50ddfc(0x39d)+_0x50ddfc(0x19a)+_0x50ddfc(0x22e)});return;}_0x10c0af[_0x50ddfc(0x1c0)+_0x50ddfc(0x30a)]?.[_0x50ddfc(0x32c)]?.(_0x50ddfc(0x26b)+_0x50ddfc(0x1bf)+_0x50ddfc(0x1ac)+'atch\x20ski'+_0x50ddfc(0x166)+_0x50ddfc(0x3a0)+_0x50ddfc(0x293)+_0x50ddfc(0x257),{'openclawVersion':_0x2233c1[_0x50ddfc(0x251)+'Version']});}async function patchSessionStoreSqliteRuntime(_0x569ea6,_0x26dbfd,_0x3a62c8={}){const _0x5c270a=_0x44ad8a,_0x180609=resolve(_0x569ea6,_0x26dbfd[_0x5c270a(0x251)+_0x5c270a(0x272)+'ir']),_0x124b09=join(_0x180609,_0x5c270a(0x1d4)),_0x158b33=_0x5c270a(0x36a)+_0x5c270a(0x324)+_0x5c270a(0x1ea)+_0x5c270a(0x2bf)+'time-bri'+_0x5c270a(0x26f),_0x159d13=join(_0x569ea6,_0x5c270a(0x13d)+_0x5c270a(0x2c8),'sessions','runtime-'+_0x5c270a(0x365)+'js'),_0x1f4b7e=(await readdir(_0x124b09,{'withFileTypes':!![]})[_0x5c270a(0x283)](()=>[]))['filter'](_0x2da284=>_0x2da284['isFile']()&&_0x2da284['name']['startsWi'+'th'](_0x5c270a(0x3b7)+_0x5c270a(0x180))&&_0x2da284['name']['endsWith'](_0x5c270a(0x388)))[_0x5c270a(0x337)](_0x58b6f6=>join(_0x124b09,_0x58b6f6[_0x5c270a(0x331)])),_0x3a1d14=(await readdir(_0x124b09,{'withFileTypes':!![]})[_0x5c270a(0x283)](()=>[]))[_0x5c270a(0x1cc)](_0xb590e8=>_0xb590e8[_0x5c270a(0x255)]()&&_0xb590e8[_0x5c270a(0x331)][_0x5c270a(0x2f3)+'th'](_0x5c270a(0x1b6))&&!_0xb590e8['name']['startsWi'+'th'](_0x5c270a(0x3b7)+'ad-')&&_0xb590e8[_0x5c270a(0x331)][_0x5c270a(0x3c9)](_0x5c270a(0x388)))['map'](_0x458a34=>join(_0x124b09,_0x458a34['name']));if(!existsSync(_0x159d13)){_0x3a62c8[_0x5c270a(0x1c0)+_0x5c270a(0x30a)]?.[_0x5c270a(0x200)]?.(_0x5c270a(0x367)+_0x5c270a(0x16e)+_0x5c270a(0x286)+_0x5c270a(0x20f)+_0x5c270a(0x3c6)+_0x5c270a(0x2a2)+_0x5c270a(0x379),{'bridgePath':_0x159d13,'openclawVersion':_0x26dbfd[_0x5c270a(0x251)+'Version']});return;}for(const _0x5ad691 of _0x1f4b7e){const _0x308e46=await readFile(_0x5ad691,'utf8'),_0x297f8f=patchSessionStoreLoadFromSource(_0x308e46,{'bridgeImportPath':_0x158b33});if(!_0x297f8f['patched']){if(_0x297f8f[_0x5c270a(0x14f)]===_0x5c270a(0x1cf)+'patched'){_0x3a62c8[_0x5c270a(0x1c0)+_0x5c270a(0x30a)]?.[_0x5c270a(0x200)]?.('session\x20'+'store\x20lo'+'ad\x20patch'+_0x5c270a(0x312)+_0x5c270a(0x310),{'filePath':_0x5ad691,'openclawVersion':_0x26dbfd['openclaw'+_0x5c270a(0x323)]});break;}continue;}await writeFile(_0x5ad691,_0x297f8f[_0x5c270a(0x356)],_0x5c270a(0x2c2)),_0x3a62c8[_0x5c270a(0x1c0)+_0x5c270a(0x30a)]?.[_0x5c270a(0x200)]?.(_0x5c270a(0x367)+_0x5c270a(0x13c)+_0x5c270a(0x27b)+'\x20applied',{'filePath':_0x5ad691,'openclawVersion':_0x26dbfd[_0x5c270a(0x251)+_0x5c270a(0x323)]});break;}for(const _0x31a3eb of _0x3a1d14){const _0x999adc=await readFile(_0x31a3eb,_0x5c270a(0x2c2)),_0x1adc6c=patchSessionStoreWriteFromSource(_0x999adc,{'bridgeImportPath':_0x158b33});if(!_0x1adc6c['patched']){if(_0x1adc6c[_0x5c270a(0x14f)]===_0x5c270a(0x1cf)+_0x5c270a(0x37a)){_0x3a62c8[_0x5c270a(0x1c0)+_0x5c270a(0x30a)]?.[_0x5c270a(0x200)]?.('session\x20'+'store\x20wr'+_0x5c270a(0x14c)+_0x5c270a(0x1e6)+_0x5c270a(0x22c)+'d',{'filePath':_0x31a3eb,'openclawVersion':_0x26dbfd['openclaw'+'Version']});break;}continue;}await writeFile(_0x31a3eb,_0x1adc6c['source'],'utf8'),_0x3a62c8[_0x5c270a(0x1c0)+_0x5c270a(0x30a)]?.['info']?.(_0x5c270a(0x367)+_0x5c270a(0x18b)+'ite\x20patc'+_0x5c270a(0x187)+'d',{'filePath':_0x31a3eb,'openclawVersion':_0x26dbfd[_0x5c270a(0x251)+_0x5c270a(0x323)]});break;}}async function patchWeixinOutboundSessionRoute(_0xb046a2,_0x4931d5,_0x3da068={}){const _0x2b91b3=_0x44ad8a,_0x5488e9=join(_0xb046a2,_0x2b91b3(0x251),_0x2b91b3(0x1d4),_0x2b91b3(0x3c5)+'ns','openclaw'+_0x2b91b3(0x288),_0x2b91b3(0x1d4),_0x2b91b3(0x2a7),_0x2b91b3(0x181)+'js');if(!existsSync(_0x5488e9)){_0x3da068[_0x2b91b3(0x1c0)+'ogger']?.[_0x2b91b3(0x200)]?.(_0x2b91b3(0x2ee)+_0x2b91b3(0x355)+'session\x20'+'route\x20pa'+'tch\x20skip'+'ped;\x20plu'+_0x2b91b3(0x1a9)+_0x2b91b3(0x382)+'d',{'openclawVersion':_0x4931d5[_0x2b91b3(0x251)+_0x2b91b3(0x323)],'filePath':_0x5488e9});return;}const _0x293da6=await readFile(_0x5488e9,'utf8'),_0x148e58=patchWeixinOutboundSessionRouteFromSource(_0x293da6);if(!_0x148e58[_0x2b91b3(0x37a)]){if(_0x148e58[_0x2b91b3(0x14f)]===_0x2b91b3(0x1cf)+'patched'){_0x3da068[_0x2b91b3(0x1c0)+_0x2b91b3(0x30a)]?.[_0x2b91b3(0x200)]?.(_0x2b91b3(0x2ee)+_0x2b91b3(0x355)+_0x2b91b3(0x367)+'route\x20pa'+_0x2b91b3(0x2e2)+'ady\x20appl'+_0x2b91b3(0x3cb),{'openclawVersion':_0x4931d5[_0x2b91b3(0x251)+_0x2b91b3(0x323)],'filePath':_0x5488e9});return;}_0x3da068[_0x2b91b3(0x1c0)+_0x2b91b3(0x30a)]?.[_0x2b91b3(0x32c)]?.(_0x2b91b3(0x2ee)+'utbound\x20'+'session\x20'+_0x2b91b3(0x25c)+'tch\x20skip'+_0x2b91b3(0x383)+_0x2b91b3(0x1f3)+'pe\x20not\x20f'+_0x2b91b3(0x1e9),{'openclawVersion':_0x4931d5['openclaw'+_0x2b91b3(0x323)],'filePath':_0x5488e9,'reason':_0x148e58[_0x2b91b3(0x14f)]});return;}await writeFile(_0x5488e9,_0x148e58[_0x2b91b3(0x356)],'utf8'),_0x3da068['runtimeL'+_0x2b91b3(0x30a)]?.[_0x2b91b3(0x200)]?.(_0x2b91b3(0x2ee)+_0x2b91b3(0x355)+_0x2b91b3(0x367)+'route\x20pa'+_0x2b91b3(0x1f8)+'ied',{'openclawVersion':_0x4931d5[_0x2b91b3(0x251)+_0x2b91b3(0x323)],'filePath':_0x5488e9,'note':_0x2b91b3(0x1f5)+_0x2b91b3(0x169)+_0x2b91b3(0x23d)+_0x2b91b3(0x32b)+_0x2b91b3(0x3ba)+_0x2b91b3(0x253)+'n/opencl'+'aw-weixi'+_0x2b91b3(0x317)+_0x2b91b3(0x207)+_0x2b91b3(0x31a)+_0x2b91b3(0x192)+_0x2b91b3(0x1b7)+_0x2b91b3(0x35f)+'up\x20sessi'+_0x2b91b3(0x26d)+_0x2b91b3(0x36d)+_0x2b91b3(0x2da)+_0x2b91b3(0x141)+_0x2b91b3(0x246)+_0x2b91b3(0x261)});}async function patchWeixinOutboundFallbackRuntime(_0x3ba174,_0x47d96d,_0x4c19a9={}){const _0x3de756=_0x44ad8a,_0x2c483e=resolve(_0x3ba174,_0x47d96d['openclaw'+_0x3de756(0x272)+'ir']),_0x482b5a=join(_0x2c483e,'dist'),_0x4ca04a=(await readdir(_0x482b5a,{'withFileTypes':!![]})[_0x3de756(0x283)](()=>[]))[_0x3de756(0x1cc)](_0x273535=>_0x273535[_0x3de756(0x255)]()&&_0x273535[_0x3de756(0x331)][_0x3de756(0x2f3)+'th'](_0x3de756(0x29c)+'-session'+'-')&&_0x273535[_0x3de756(0x331)]['endsWith'](_0x3de756(0x388)))[_0x3de756(0x337)](_0x3bb0c5=>join(_0x482b5a,_0x3bb0c5[_0x3de756(0x331)]));if(_0x4ca04a[_0x3de756(0x1c5)]===0x0){_0x4c19a9['runtimeL'+_0x3de756(0x30a)]?.[_0x3de756(0x32c)]?.(_0x3de756(0x2ee)+_0x3de756(0x355)+_0x3de756(0x358)+_0x3de756(0x223)+_0x3de756(0x1c3)+_0x3de756(0x29c)+_0x3de756(0x37e)+_0x3de756(0x2d2)+'nd',{'openclawVersion':_0x47d96d[_0x3de756(0x251)+_0x3de756(0x323)],'distDir':_0x482b5a});return;}for(const _0xacc544 of _0x4ca04a){const _0x3d2c9f=await readFile(_0xacc544,'utf8'),_0x4b63d7=patchWeixinOutboundFallbackFromSource(_0x3d2c9f);if(!_0x4b63d7[_0x3de756(0x37a)]){if(_0x4b63d7[_0x3de756(0x14f)]===_0x3de756(0x1cf)+_0x3de756(0x37a)){_0x4c19a9[_0x3de756(0x1c0)+_0x3de756(0x30a)]?.[_0x3de756(0x200)]?.(_0x3de756(0x2ee)+'utbound\x20'+_0x3de756(0x358)+'\x20patch\x20a'+_0x3de756(0x3c0)+'pplied',{'openclawVersion':_0x47d96d[_0x3de756(0x251)+_0x3de756(0x323)],'filePath':_0xacc544});return;}continue;}await writeFile(_0xacc544,_0x4b63d7['source'],_0x3de756(0x2c2)),_0x4c19a9[_0x3de756(0x1c0)+_0x3de756(0x30a)]?.['info']?.(_0x3de756(0x2ee)+_0x3de756(0x355)+'fallback'+_0x3de756(0x315)+_0x3de756(0x1fc),{'openclawVersion':_0x47d96d[_0x3de756(0x251)+_0x3de756(0x323)],'filePath':_0xacc544,'note':_0x3de756(0x1f5)+_0x3de756(0x169)+'ibility\x20'+_0x3de756(0x32b)+_0x3de756(0x3c8)+_0x3de756(0x2f6)+_0x3de756(0x2b5)+_0x3de756(0x39c)+'\x20outboun'+'d\x20mirror'+_0x3de756(0x2b4)+_0x3de756(0x163)+_0x3de756(0x140)+_0x3de756(0x25d)+'\x20routing'+_0x3de756(0x14d)+_0x3de756(0x177)});return;}_0x4c19a9['runtimeL'+_0x3de756(0x30a)]?.[_0x3de756(0x32c)]?.('weixin\x20o'+_0x3de756(0x355)+_0x3de756(0x358)+_0x3de756(0x223)+_0x3de756(0x1c3)+_0x3de756(0x160)+_0x3de756(0x2d5)+_0x3de756(0x257),{'openclawVersion':_0x47d96d['openclaw'+_0x3de756(0x323)]});}async function patchRequestIdTitleRuntime(_0x8dae7d,_0x4c5dd8,_0x1a0843={}){const _0x14f9d1=_0x44ad8a,_0x561253=resolve(_0x8dae7d,_0x4c5dd8[_0x14f9d1(0x251)+_0x14f9d1(0x272)+'ir']),_0x2c3f39=join(_0x561253,_0x14f9d1(0x1d4)),_0x176a42=_0x14f9d1(0x36a)+_0x14f9d1(0x324)+_0x14f9d1(0x2de)+_0x14f9d1(0x2a5)+_0x14f9d1(0x182)+'ridge.mj'+'s',_0x397481=join(_0x8dae7d,_0x14f9d1(0x13d)+_0x14f9d1(0x2c8),_0x14f9d1(0x29d)+'id','runtime-'+'bridge.m'+'js');if(!existsSync(_0x397481)){_0x1a0843['runtimeL'+'ogger']?.['info']?.('request-'+_0x14f9d1(0x1cd)+'\x20runtime'+_0x14f9d1(0x223)+'kipped;\x20'+_0x14f9d1(0x27d)+_0x14f9d1(0x398)+_0x14f9d1(0x393),{'bridgePath':_0x397481,'openclawVersion':_0x4c5dd8['openclaw'+_0x14f9d1(0x323)]});return;}const _0x12323e=(await readdir(_0x2c3f39,{'withFileTypes':!![]})[_0x14f9d1(0x283)](()=>[]))['filter'](_0xe3b54c=>_0xe3b54c[_0x14f9d1(0x255)]()&&_0xe3b54c[_0x14f9d1(0x331)][_0x14f9d1(0x2f3)+'th'](_0x14f9d1(0x29a))&&_0xe3b54c[_0x14f9d1(0x331)][_0x14f9d1(0x3c9)](_0x14f9d1(0x388)))[_0x14f9d1(0x337)](_0x4b6622=>join(_0x2c3f39,_0x4b6622['name']));for(const _0xd90e86 of _0x12323e){const _0x2f7c20=await readFile(_0xd90e86,'utf8'),_0x1f1be2=patchRequestIdTitleRuntimeFromSource(_0x2f7c20,{'bridgeImportPath':_0x176a42});if(!_0x1f1be2[_0x14f9d1(0x37a)]){if(_0x1f1be2['reason']===_0x14f9d1(0x1cf)+_0x14f9d1(0x37a)){_0x1a0843[_0x14f9d1(0x1c0)+_0x14f9d1(0x30a)]?.[_0x14f9d1(0x200)]?.(_0x14f9d1(0x29d)+_0x14f9d1(0x1cd)+_0x14f9d1(0x37e)+_0x14f9d1(0x315)+'lready\x20a'+_0x14f9d1(0x1fc),{'filePath':_0xd90e86,'openclawVersion':_0x4c5dd8[_0x14f9d1(0x251)+_0x14f9d1(0x323)]});break;}continue;}await writeFile(_0xd90e86,_0x1f1be2[_0x14f9d1(0x356)],_0x14f9d1(0x2c2)),_0x1a0843['runtimeL'+_0x14f9d1(0x30a)]?.['info']?.(_0x14f9d1(0x29d)+_0x14f9d1(0x1cd)+'\x20runtime'+_0x14f9d1(0x315)+'pplied',{'filePath':_0xd90e86,'openclawVersion':_0x4c5dd8[_0x14f9d1(0x251)+_0x14f9d1(0x323)]});break;}}async function patchQQBotOutboundFallbackRuntime(_0x1c23b7,_0xb476c,_0x1e47d4={}){const _0x1937de=_0x44ad8a,_0x30ad27=resolve(_0x1c23b7,_0xb476c[_0x1937de(0x251)+'WorkingD'+'ir']),_0x55b178=join(_0x30ad27,'dist'),_0x3784ef=(await readdir(_0x55b178,{'withFileTypes':!![]})[_0x1937de(0x283)](()=>[]))[_0x1937de(0x1cc)](_0x3877ce=>_0x3877ce[_0x1937de(0x255)]()&&_0x3877ce[_0x1937de(0x331)][_0x1937de(0x2f3)+'th'](_0x1937de(0x29c)+'-session'+'-')&&_0x3877ce[_0x1937de(0x331)][_0x1937de(0x3c9)](_0x1937de(0x388)))[_0x1937de(0x337)](_0x403761=>join(_0x55b178,_0x403761['name']));if(_0x3784ef[_0x1937de(0x1c5)]===0x0){_0x1e47d4[_0x1937de(0x1c0)+'ogger']?.['warn']?.(_0x1937de(0x349)+'tbound\x20f'+_0x1937de(0x1bc)+_0x1937de(0x15c)+_0x1937de(0x285)+_0x1937de(0x355)+'runtime\x20'+_0x1937de(0x14b)+'d',{'openclawVersion':_0xb476c[_0x1937de(0x251)+_0x1937de(0x323)],'distDir':_0x55b178});return;}for(const _0x4943a6 of _0x3784ef){const _0x255a8c=await readFile(_0x4943a6,'utf8'),_0x5e1752=patchQQBotOutboundFallbackFromSource(_0x255a8c);if(!_0x5e1752[_0x1937de(0x37a)]){if(_0x5e1752[_0x1937de(0x14f)]==='already-'+'patched'){_0x1e47d4['runtimeL'+_0x1937de(0x30a)]?.['info']?.('qqbot\x20ou'+_0x1937de(0x31f)+_0x1937de(0x1bc)+_0x1937de(0x16c)+_0x1937de(0x2b2)+_0x1937de(0x384),{'openclawVersion':_0xb476c[_0x1937de(0x251)+_0x1937de(0x323)],'filePath':_0x4943a6});return;}continue;}await writeFile(_0x4943a6,_0x5e1752[_0x1937de(0x356)],_0x1937de(0x2c2)),_0x1e47d4['runtimeL'+_0x1937de(0x30a)]?.[_0x1937de(0x200)]?.(_0x1937de(0x349)+_0x1937de(0x31f)+_0x1937de(0x1bc)+_0x1937de(0x3b1)+_0x1937de(0x384),{'openclawVersion':_0xb476c[_0x1937de(0x251)+'Version'],'filePath':_0x4943a6,'note':_0x1937de(0x1f5)+_0x1937de(0x169)+_0x1937de(0x23d)+_0x1937de(0x32b)+_0x1937de(0x2ad)+'Bot\x20c2c\x20'+_0x1937de(0x29c)+_0x1937de(0x2e6)+_0x1937de(0x1f1)+'ct\x20sessi'+_0x1937de(0x330)+_0x1937de(0x273)+_0x1937de(0x30d)+_0x1937de(0x3b9)+_0x1937de(0x368)});return;}_0x1e47d4['runtimeL'+'ogger']?.['warn']?.(_0x1937de(0x349)+_0x1937de(0x31f)+_0x1937de(0x1bc)+_0x1937de(0x15c)+_0x1937de(0x2a0)+'esolver\x20'+'shape\x20no'+_0x1937de(0x2dc),{'openclawVersion':_0xb476c[_0x1937de(0x251)+'Version']});}async function patchQQBotOutboundSessionRoute(_0x1cd53e,_0x4d3166,_0x5da2c8={}){const _0x223679=_0x44ad8a,_0x385af6=join(_0x1cd53e,'openclaw',_0x223679(0x1d4),_0x223679(0x3c5)+'ns',_0x223679(0x2e1),'dist');if(!existsSync(_0x385af6)){_0x5da2c8[_0x223679(0x1c0)+_0x223679(0x30a)]?.[_0x223679(0x200)]?.(_0x223679(0x349)+'tbound\x20s'+_0x223679(0x357)+_0x223679(0x238)+_0x223679(0x20f)+_0x223679(0x21e)+_0x223679(0x3c4)+_0x223679(0x21a),{'openclawVersion':_0x4d3166[_0x223679(0x251)+'Version'],'distDir':_0x385af6});return;}const _0x500e21=(await readdir(_0x385af6,{'withFileTypes':!![]})[_0x223679(0x283)](()=>[]))[_0x223679(0x1cc)](_0x586c07=>_0x586c07[_0x223679(0x255)]()&&_0x586c07[_0x223679(0x331)][_0x223679(0x3c9)](_0x223679(0x388)))[_0x223679(0x337)](_0x3f6eeb=>join(_0x385af6,_0x3f6eeb[_0x223679(0x331)]));for(const _0x1b580c of _0x500e21){const _0x319f5e=await readFile(_0x1b580c,'utf8'),_0x529f3f=patchQQBotOutboundSessionRouteFromSource(_0x319f5e);if(!_0x529f3f['patched']){if(_0x529f3f[_0x223679(0x14f)]===_0x223679(0x1cf)+_0x223679(0x37a)){_0x5da2c8[_0x223679(0x1c0)+'ogger']?.['info']?.(_0x223679(0x349)+_0x223679(0x33e)+_0x223679(0x357)+_0x223679(0x238)+_0x223679(0x245)+_0x223679(0x1fe)+'ed',{'openclawVersion':_0x4d3166[_0x223679(0x251)+_0x223679(0x323)],'filePath':_0x1b580c});return;}continue;}await writeFile(_0x1b580c,_0x529f3f['source'],_0x223679(0x2c2)),_0x5da2c8[_0x223679(0x1c0)+_0x223679(0x30a)]?.['info']?.(_0x223679(0x349)+_0x223679(0x33e)+_0x223679(0x357)+_0x223679(0x238)+_0x223679(0x157)+'ed',{'openclawVersion':_0x4d3166[_0x223679(0x251)+'Version'],'filePath':_0x1b580c,'note':_0x223679(0x1f5)+_0x223679(0x169)+'ibility\x20'+'patch\x20fo'+_0x223679(0x18c)+_0x223679(0x3d4)+_0x223679(0x21f)+_0x223679(0x25b)+'elivery\x20'+_0x223679(0x269)+_0x223679(0x2af)+_0x223679(0x233)+'th\x20c2c\x20i'+_0x223679(0x203)+_0x223679(0x189)+_0x223679(0x3cf)});return;}_0x5da2c8['runtimeL'+_0x223679(0x30a)]?.[_0x223679(0x32c)]?.(_0x223679(0x349)+_0x223679(0x33e)+_0x223679(0x357)+_0x223679(0x238)+_0x223679(0x20f)+_0x223679(0x30f)+'nel\x20shap'+'e\x20not\x20fo'+_0x223679(0x2cd),{'openclawVersion':_0x4d3166[_0x223679(0x251)+'Version'],'distDir':_0x385af6});}async function resolveRuntimeChannelImportPath(_0x27dc52,_0x3ebc68){const _0x5cdf8e=_0x44ad8a,_0x44f6a8=_0x3ebc68[_0x5cdf8e(0x1cc)](_0x2e441e=>_0x2e441e[_0x5cdf8e(0x255)]()&&_0x2e441e[_0x5cdf8e(0x331)][_0x5cdf8e(0x2f3)+'th'](_0x5cdf8e(0x1ce)+_0x5cdf8e(0x1ef))&&_0x2e441e[_0x5cdf8e(0x331)][_0x5cdf8e(0x3c9)](_0x5cdf8e(0x388))&&!_0x2e441e[_0x5cdf8e(0x331)][_0x5cdf8e(0x2f3)+'th']('runtime-'+_0x5cdf8e(0x1ef)+'state-'))[_0x5cdf8e(0x337)](_0xdab370=>_0xdab370[_0x5cdf8e(0x331)])[_0x5cdf8e(0x32e)]();for(const _0xe97b1b of _0x44f6a8){const _0x2faa16=await readFile(join(_0x27dc52,_0xe97b1b),_0x5cdf8e(0x2c2));if(_0x2faa16[_0x5cdf8e(0x1a4)](_0x5cdf8e(0x24b)+'ntimeCha'+_0x5cdf8e(0x13b)))return'./'+_0xe97b1b;}return null;}function normalizeRuntimeRelativePath(_0x3e249d){const _0x27086d=_0x44ad8a;return _0x3e249d[_0x27086d(0x277)+'ll']('\x5c','/');}function toWindowsPath(_0x6ecea1){const _0x146661=_0x44ad8a;return _0x6ecea1[_0x146661(0x277)+'ll']('/','\x5c');}function validateRuntimeNodeVersion(_0x2f1257,_0xa5b5a3){const _0x303988=_0x44ad8a;if(_0x2f1257[_0x303988(0x16b)+_0x303988(0x2e8)]===_0xa5b5a3['openclaw'][_0x303988(0x16b)+_0x303988(0x2e8)])return;throw new Error(_0x303988(0x2ef)+'nodeVers'+_0x303988(0x2f8)+_0x303988(0x193)+_0x303988(0x15d)+(_0x2f1257[_0x303988(0x16b)+_0x303988(0x2e8)]||_0x303988(0x241))+(',\x20shell.'+'config=')+_0xa5b5a3[_0x303988(0x251)][_0x303988(0x16b)+_0x303988(0x2e8)]+'.\x20'+('Run\x20\x22wuj'+_0x303988(0x2d9)+'\x20prepare'+'\x22\x20so\x20the'+_0x303988(0x28d)+'\x20runtime'+'\x20can\x20be\x20'+_0x303988(0x1b9)+_0x303988(0x339)+_0x303988(0x1d9)+_0x303988(0x28e)+_0x303988(0x1ee)+'.'));}function validateRuntimeOpenClawVersion(_0x2d3341,_0x7f48c7){const _0x3d2ffd=_0x44ad8a;if(_0x2d3341['openclaw'+_0x3d2ffd(0x323)]===_0x7f48c7[_0x3d2ffd(0x251)][_0x3d2ffd(0x251)+_0x3d2ffd(0x323)])return;throw new Error(_0x3d2ffd(0x2ef)+_0x3d2ffd(0x251)+_0x3d2ffd(0x158)+_0x3d2ffd(0x311)+_0x3d2ffd(0x23f)+_0x3d2ffd(0x2ed)+(_0x2d3341[_0x3d2ffd(0x251)+_0x3d2ffd(0x323)]||'unknown')+(_0x3d2ffd(0x268)+'config=')+_0x7f48c7[_0x3d2ffd(0x251)][_0x3d2ffd(0x251)+_0x3d2ffd(0x323)]+'.\x20'+(_0x3d2ffd(0x39e)+_0x3d2ffd(0x2d9)+_0x3d2ffd(0x309)+_0x3d2ffd(0x2ea)+_0x3d2ffd(0x37e)+_0x3d2ffd(0x1c9)+_0x3d2ffd(0x22b)+_0x3d2ffd(0x1d9)+_0x3d2ffd(0x24f)+_0x3d2ffd(0x1b0)+_0x3d2ffd(0x35e)));}function parseNpmPackJson(_0x3cb85c){const _0x21c035=_0x44ad8a,_0x1ec16f=_0x3cb85c['trim'](),_0x30b8e1=_0x1ec16f[_0x21c035(0x2ca)]('[');if(_0x30b8e1<0x0)throw new Error('npm\x20pack'+_0x21c035(0x2a3)+_0x21c035(0x386)+_0x21c035(0x1d7)+_0x1ec16f[_0x21c035(0x362)](0x0,0x1f4));const _0x1c6eb4=JSON[_0x21c035(0x37b)](_0x1ec16f['slice'](_0x30b8e1)),_0x56faa4=Array[_0x21c035(0x29e)](_0x1c6eb4)?_0x1c6eb4[0x0]:_0x1c6eb4;if(!_0x56faa4||typeof _0x56faa4!==_0x21c035(0x217))throw new Error(_0x21c035(0x206)+_0x21c035(0x142)+_0x21c035(0x326)+_0x21c035(0x3a3)+_0x21c035(0x1d8)+_0x1ec16f[_0x21c035(0x362)](0x0,0x1f4));return _0x56faa4;}function normalizePackedTarballFilename(_0x47ead6){const _0x3fb1d2=_0x44ad8a;return _0x47ead6['replace'](/^@/,'')[_0x3fb1d2(0x277)+'ll']('/','-')[_0x3fb1d2(0x277)+'ll']('\x5c','-');}async function runProcess(_0x4661bd,_0x7d7349,_0x5d1d1={}){const _0x2b9b7e=_0x44ad8a,_0x3d5491=_0x5d1d1['label']||[_0x4661bd,..._0x7d7349]['join']('\x20'),_0x5b7c1a=_0x5d1d1[_0x2b9b7e(0x304)+'s']??NPM_INSTALL_TIMEOUT_MS,_0x3643fb=spawn(_0x4661bd,_0x7d7349,{'cwd':_0x5d1d1[_0x2b9b7e(0x2cf)],'env':_0x5d1d1[_0x2b9b7e(0x2f2)],'stdio':[_0x2b9b7e(0x31b),_0x2b9b7e(0x21c),'pipe']});return await new Promise((_0x28d5bb,_0x77d983)=>{const _0x13f413=_0x2b9b7e;let _0x25c9df='',_0x150db2='',_0x4d3955=![];const _0x32e804=setTimeout(()=>{const _0x159d86=_0x537f;if(_0x4d3955)return;_0x4d3955=!![],_0x3643fb['kill'](_0x159d86(0x2ac)),_0x77d983(new Error(_0x3d5491+(_0x159d86(0x399)+_0x159d86(0x1ad)+'\x20')+_0x5b7c1a+'ms'));},_0x5b7c1a);_0x3643fb[_0x13f413(0x150)]['on'](_0x13f413(0x3c7),_0x1655ee=>{const _0x2e07c1=_0x13f413;_0x25c9df+=_0x1655ee[_0x2e07c1(0x17b)]();}),_0x3643fb[_0x13f413(0x212)]['on'](_0x13f413(0x3c7),_0x2763b8=>{_0x150db2+=_0x2763b8['toString']();}),_0x3643fb['on'](_0x13f413(0x156),_0x1720b7=>{if(_0x4d3955)return;_0x4d3955=!![],clearTimeout(_0x32e804),_0x77d983(_0x1720b7);}),_0x3643fb['on'](_0x13f413(0x21b),(_0x3e7853,_0x1f4142)=>{const _0x438502=_0x13f413;if(_0x4d3955)return;_0x4d3955=!![],clearTimeout(_0x32e804);if(_0x3e7853===0x0){_0x28d5bb({'stdout':_0x25c9df,'stderr':_0x150db2});return;}_0x77d983(new Error(_0x3d5491+(_0x438502(0x2b0)+_0x438502(0x2f5)+'e=')+(_0x3e7853??_0x438502(0x165))+_0x438502(0x3a5)+(_0x1f4142??_0x438502(0x165))+'\x0a'+(''+(_0x150db2||_0x25c9df))[_0x438502(0x354)]()));});});}async function installOpenClawPackage(_0x4aa55e,_0x56db4e){const _0x278abf=_0x44ad8a,_0x3deb87=join(_0x4aa55e['runtimeR'+_0x278abf(0x1dc)],'.cache'),_0xfef83c=join(_0x4aa55e[_0x278abf(0x27a)+_0x278abf(0x1dc)],'.opencla'+'w-extrac'+'t');await mkdir(_0x3deb87,{'recursive':!![]}),await removePathWithRetries(_0xfef83c),await mkdir(_0xfef83c,{'recursive':!![]});const _0x4dccd4=await createRuntimeEnv(_0x4aa55e),_0xd6b789=_0x278abf(0x251)+'@'+_0x56db4e;console[_0x278abf(0x346)](_0x278abf(0x21d)+'hell:run'+'time]\x20in'+_0x278abf(0x211)+'\x20'+_0xd6b789);const _0x15c16c=await runProcess(_0x4aa55e[_0x278abf(0x1b3)+_0x278abf(0x36e)],[_0x4aa55e[_0x278abf(0x299)],_0x278abf(0x27e),_0xd6b789,_0x278abf(0x344)],{'cwd':_0x3deb87,'env':_0x4dccd4,'label':_0x278abf(0x206)+'\x20'+_0xd6b789}),_0x223af9=parseNpmPackJson(_0x15c16c['stdout']);if(_0x223af9[_0x278abf(0x13a)]!==_0x56db4e)throw new Error(_0x278abf(0x208)+_0x278abf(0x3ad)+'law\x20'+_0x56db4e+(_0x278abf(0x2f1)+'d\x20to\x20')+_0x223af9[_0x278abf(0x13a)]);const _0x4fcf18=resolve(_0x3deb87,_0x223af9[_0x278abf(0x1a5)]);if(!existsSync(_0x4fcf18))throw new Error('npm\x20pack'+_0x278abf(0x2a3)+'\x20create\x20'+_0x278abf(0x322)+'\x20'+_0x4fcf18);await runProcess(_0x278abf(0x13e),[_0x278abf(0x3b5),_0x4fcf18,'-C',_0xfef83c],{'label':_0x278abf(0x155)+_0x223af9['filename']}),await removePathWithRetries(_0x4aa55e[_0x278abf(0x251)+_0x278abf(0x272)+'ir']),await rename(join(_0xfef83c,_0x278abf(0x2e9)),_0x4aa55e[_0x278abf(0x251)+_0x278abf(0x272)+'ir']),await removePathWithRetries(_0xfef83c),await runProcess(_0x4aa55e[_0x278abf(0x1b3)+_0x278abf(0x36e)],[_0x4aa55e[_0x278abf(0x299)],_0x278abf(0x1b4),_0x278abf(0x2b6)+'ev',_0x278abf(0x24a)+'eer',_0x278abf(0x29f)+'it',_0x278abf(0x2d6)+'d',_0x278abf(0x33a)+_0x278abf(0x3a4)+'ps'],{'cwd':_0x4aa55e['openclaw'+_0x278abf(0x272)+'ir'],'env':_0x4dccd4,'label':_0x278abf(0x2ff)+_0x278abf(0x2a9)+_0xd6b789+('\x20runtime'+_0x278abf(0x17c)+'ncies')});if(!existsSync(_0x4aa55e[_0x278abf(0x251)+_0x278abf(0x2e0)]))throw new Error('OpenClaw'+_0x278abf(0x3a1)+_0x278abf(0x2d2)+_0x278abf(0x186)+_0x278abf(0x1bd)+':\x20'+_0x4aa55e[_0x278abf(0x251)+'Bin']);}async function ensureRuntimeBase(_0x2a80e5,_0x2358a6,_0x11d379={}){const _0x3c51b9=_0x44ad8a;await mkdir(_0x2358a6,{'recursive':!![]});let _0x2787d2=await readRuntimeManifest(_0x2358a6);const _0x54be39=_0x2a80e5[_0x3c51b9(0x251)][_0x3c51b9(0x16b)+_0x3c51b9(0x2e8)],_0x26492b=_0x2a80e5[_0x3c51b9(0x251)]['openclaw'+_0x3c51b9(0x323)],_0x29606d=existsSync(resolveManifestPath(_0x2358a6)),_0x123745=runtimeHasRequiredPaths(_0x2358a6,_0x2787d2),_0x2a61b5=_0x2787d2['nodeVers'+_0x3c51b9(0x2e8)]===_0x54be39;!_0x29606d||!_0x123745||!_0x2a61b5?(_0x11d379[_0x3c51b9(0x1c0)+'ogger']?.[_0x3c51b9(0x264)+'t']?.(_0x3c51b9(0x2ef)+_0x3c51b9(0x270)+_0x3c51b9(0x2d3)+'ed',{'runtimeRoot':_0x2358a6,'reason':!_0x29606d?_0x3c51b9(0x378)+_0x3c51b9(0x314):!_0x123745?'missing\x20'+_0x3c51b9(0x173)+'\x20runtime'+_0x3c51b9(0x325):'node\x20ver'+'sion\x20mis'+_0x3c51b9(0x154),'syncOnly':_0x11d379[_0x3c51b9(0x3c2)]}),_0x2787d2=await buildRuntimeBase(_0x2a80e5,_0x2358a6,_0x2787d2),_0x11d379[_0x3c51b9(0x1c0)+_0x3c51b9(0x30a)]?.[_0x3c51b9(0x264)+'t']?.(_0x3c51b9(0x2ef)+_0x3c51b9(0x270)+'ld\x20compl'+_0x3c51b9(0x1c8),{'manifest':summarizeRuntimeManifest(_0x2787d2)})):_0x11d379[_0x3c51b9(0x1c0)+'ogger']?.[_0x3c51b9(0x264)+'t']?.(_0x3c51b9(0x2ef)+'base\x20alr'+_0x3c51b9(0x201)+_0x3c51b9(0x2d8),{'manifest':summarizeRuntimeManifest(_0x2787d2)});if(!existsSync(resolve(_0x2358a6,_0x2787d2['openclaw'+_0x3c51b9(0x2e0)]))){const _0x10517e=createRuntimeInfoFromManifest(_0x2358a6,_0x2787d2,{'allowMissingOpenClaw':!![]});await installOpenClawPackage(_0x10517e,_0x26492b),_0x2787d2['openclaw'+_0x3c51b9(0x323)]=_0x26492b;}return _0x2787d2;}function runtimeHasRequiredPaths(_0x211275,_0x18fdea){const _0x2081fb=_0x44ad8a;return['nodeExec'+_0x2081fb(0x36e),'npmCli',_0x2081fb(0x251)+'WorkingD'+'ir','openclaw'+_0x2081fb(0x2e0)]['every'](_0x3c0b1e=>typeof _0x18fdea[_0x3c0b1e]===_0x2081fb(0x1d6)&&_0x18fdea[_0x3c0b1e][_0x2081fb(0x354)]())&&[_0x2081fb(0x1b3)+'utable',_0x2081fb(0x299)][_0x2081fb(0x343)](_0x49ddd7=>existsSync(resolve(_0x211275,_0x18fdea[_0x49ddd7])));}async function buildRuntimeBase(_0x5d0445,_0xe97d57,_0x9b3119={}){const _0x4c2072=_0x44ad8a,_0x1eda68=join(_0xe97d57,'node');await ensureRuntimeNode(_0x5d0445,_0x1eda68);const _0x45a4a3=process[_0x4c2072(0x2e3)]===_0x4c2072(0x20d)?_0x4c2072(0x230)+'e.exe':_0x4c2072(0x171)+'/node',_0x1b11ea=process['platform']===_0x4c2072(0x20d)?_0x4c2072(0x230)+_0x4c2072(0x359)+'s/npm/bi'+'n/npm-cl'+'i.js':_0x4c2072(0x252)+'/node_mo'+'dules/np'+'m/bin/np'+_0x4c2072(0x377),_0x18d57d={..._0x9b3119,'generatedAt':new Date()[_0x4c2072(0x350)+_0x4c2072(0x197)](),'nodeVersion':_0x5d0445['openclaw'][_0x4c2072(0x16b)+_0x4c2072(0x2e8)],'openclawVersion':_0x9b3119[_0x4c2072(0x251)+'Version']||'','platform':process[_0x4c2072(0x2e3)],'arch':process['arch'],'nodeExecutable':_0x45a4a3,'npmCli':_0x1b11ea,'openclawWorkingDir':'openclaw','openclawBin':_0x4c2072(0x251)+_0x4c2072(0x2d0)+_0x4c2072(0x3bc)};return await writeJson(resolveManifestPath(_0xe97d57),_0x18d57d),_0x18d57d;}async function removePathWithRetries(_0x358cdc){await rm(_0x358cdc,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96});}async function ensureRuntimeNode(_0x460efa,_0x20730a){const _0x20f729=_0x44ad8a,_0x3515ea=_0x460efa[_0x20f729(0x251)][_0x20f729(0x16b)+_0x20f729(0x2e8)],_0x5b870b=process['platform']===_0x20f729(0x20d)?join(_0x20730a,_0x20f729(0x17f)):join(_0x20730a,_0x20f729(0x287),'node'),_0x27faa7=process[_0x20f729(0x2e3)]==='win32'?join(_0x20730a,_0x20f729(0x23b)+'ules',_0x20f729(0x332),'bin',_0x20f729(0x172)+'js'):join(_0x20730a,'lib','node_mod'+_0x20f729(0x18a),_0x20f729(0x332),_0x20f729(0x287),_0x20f729(0x172)+'js');if(existsSync(_0x5b870b)&&existsSync(_0x27faa7)&&await getNodeVersion(_0x5b870b)===_0x3515ea)return;await removePathWithRetries(_0x20730a);if(process[_0x20f729(0x2f9)][_0x20f729(0x1b1)]===_0x3515ea){await linkCurrentNodeRuntime(_0x20730a);return;}await downloadNodeRuntime(_0x3515ea,_0x20730a);}async function getNodeVersion(_0x3db7c3){const _0x604093=_0x44ad8a;try{const _0x15066e=await runProcess(_0x3db7c3,['-p',_0x604093(0x31c)+_0x604093(0x2f9)+'.node'],{'label':_0x3db7c3+_0x604093(0x1ee),'timeoutMs':0x7530});return _0x15066e[_0x604093(0x150)][_0x604093(0x354)]();}catch{return'';}}async function linkCurrentNodeRuntime(_0x3e9fe3){const _0x121522=_0x44ad8a,_0x5464a7=process[_0x121522(0x3ca)],_0xc79852=resolve(dirname(_0x5464a7),'..'),_0x3d5e59=process['platform']===_0x121522(0x20d)?resolve(_0xc79852,_0x121522(0x23b)+'ules/npm'):resolve(_0xc79852,_0x121522(0x3ae)+_0x121522(0x227)+_0x121522(0x342)),_0x53ff4a=process[_0x121522(0x2e3)]===_0x121522(0x20d)?join(_0x3e9fe3,'node.exe'):join(_0x3e9fe3,_0x121522(0x287),_0x121522(0x1b1)),_0x2e6095=process['platform']===_0x121522(0x20d)?join(_0x3e9fe3,_0x121522(0x23b)+'ules',_0x121522(0x332)):join(_0x3e9fe3,_0x121522(0x17e),'node_mod'+_0x121522(0x18a),_0x121522(0x332));await mkdir(dirname(_0x53ff4a),{'recursive':!![]}),await mkdir(dirname(_0x2e6095),{'recursive':!![]}),await symlink(_0x5464a7,_0x53ff4a),existsSync(_0x3d5e59)?await symlink(_0x3d5e59,_0x2e6095):await symlink(await resolveNpmRoot(),_0x2e6095);}async function resolveNpmRoot(){const _0x5bc2b4=_0x44ad8a,_0x3856be=await runProcess(_0x5bc2b4(0x332),[_0x5bc2b4(0x1a1),'-g'],{'label':'npm\x20root'+_0x5bc2b4(0x2cb),'timeoutMs':0x7530}),_0x2a69d0=process[_0x5bc2b4(0x2e3)]===_0x5bc2b4(0x20d)?_0x3856be[_0x5bc2b4(0x150)][_0x5bc2b4(0x354)]():join(_0x3856be[_0x5bc2b4(0x150)]['trim'](),_0x5bc2b4(0x332));if(!existsSync(join(_0x2a69d0,_0x5bc2b4(0x287),_0x5bc2b4(0x172)+'js')))throw new Error(_0x5bc2b4(0x206)+_0x5bc2b4(0x2f0)+_0x5bc2b4(0x14b)+_0x5bc2b4(0x239)+'cal\x20runt'+_0x5bc2b4(0x3ac)+_0x5bc2b4(0x1a0)+_0x2a69d0);return _0x2a69d0;}async function resolveExtractedNodeRoot(_0x37ef15,_0x203796){const _0x10caa6=_0x44ad8a,_0x3d799d=join(_0x37ef15,_0x203796);if(existsSync(_0x3d799d))return _0x3d799d;const _0x1839af=await readdir(_0x37ef15,{'withFileTypes':!![]}),_0x6860d5=_0x1839af[_0x10caa6(0x1cc)](_0xde768c=>_0xde768c[_0x10caa6(0x296)+'ory']());if(_0x6860d5[_0x10caa6(0x1c5)]===0x1)return join(_0x37ef15,_0x6860d5[0x0][_0x10caa6(0x331)]);const _0x454eca=process[_0x10caa6(0x2e3)]==='win32'?join(_0x37ef15,'node.exe'):join(_0x37ef15,_0x10caa6(0x287),_0x10caa6(0x1b1));if(existsSync(_0x454eca))return _0x37ef15;const _0x44fcde=await findNodeRuntimeRoot(_0x37ef15);if(_0x44fcde)return _0x44fcde;const _0x42323a=_0x1839af['map'](_0x4243fc=>_0x4243fc['name'])[_0x10caa6(0x2d7)](',\x20');throw new Error(_0x10caa6(0x1db)+_0x10caa6(0x35d)+_0x10caa6(0x2b9)+_0x10caa6(0x256)+'not\x20foun'+_0x10caa6(0x1dd)+_0x203796+'\x20in\x20'+_0x37ef15+(_0x10caa6(0x3bb)+'vel\x20entr'+_0x10caa6(0x249))+(_0x42323a||_0x10caa6(0x34a)));}function resolveNodeExtractRoot(_0x290051,_0x76bf69,_0x1b6848){const _0x2d7749=_0x44ad8a;if(process[_0x2d7749(0x2e3)]!==_0x2d7749(0x20d))return join(_0x290051,_0x76bf69+(_0x2d7749(0x2c0)+'-')+process[_0x2d7749(0x226)]+'-'+Date['now']()+'-'+_0x1b6848);const _0x26687a=/^[A-Za-z]:[\\/]/[_0x2d7749(0x243)](_0x290051),_0x25213b=parse(_0x290051),_0x569afa=_0x26687a?_0x26687a[0x0][_0x2d7749(0x362)](0x0,0x2)+'\x5c':_0x25213b[_0x2d7749(0x1a1)]&&_0x25213b[_0x2d7749(0x1a1)]!=='/'?_0x25213b[_0x2d7749(0x1a1)]:_0x290051,_0x4eba44=_0x569afa[_0x2d7749(0x3bf)](/[\\/]+$/,'');return _0x4eba44+_0x2d7749(0x15b)+process[_0x2d7749(0x226)]+'-'+Date[_0x2d7749(0x16d)]()+'-'+_0x1b6848;}async function findNodeRuntimeRoot(_0x5d454d){const _0x4d716a=_0x44ad8a,_0x23be61=[_0x5d454d],_0x2971fe=new Set();while(_0x23be61[_0x4d716a(0x1c5)]>0x0){const _0x2e2f3c=_0x23be61[_0x4d716a(0x16f)]();if(!_0x2e2f3c||_0x2971fe[_0x4d716a(0x228)](_0x2e2f3c))continue;_0x2971fe[_0x4d716a(0x1ec)](_0x2e2f3c);const _0x455ccc=process[_0x4d716a(0x2e3)]===_0x4d716a(0x20d)?join(_0x2e2f3c,_0x4d716a(0x17f)):join(_0x2e2f3c,_0x4d716a(0x287),_0x4d716a(0x1b1)),_0x473a68=process[_0x4d716a(0x2e3)]===_0x4d716a(0x20d)?join(_0x2e2f3c,'node_mod'+_0x4d716a(0x18a),'npm',_0x4d716a(0x287),_0x4d716a(0x172)+'js'):join(_0x2e2f3c,'lib',_0x4d716a(0x23b)+_0x4d716a(0x18a),_0x4d716a(0x332),_0x4d716a(0x287),'npm-cli.'+'js');if(existsSync(_0x455ccc)&&existsSync(_0x473a68))return _0x2e2f3c;const _0x1496fa=await readdir(_0x2e2f3c,{'withFileTypes':!![]});for(const _0x65dfcd of _0x1496fa){_0x65dfcd[_0x4d716a(0x296)+_0x4d716a(0x387)]()&&_0x23be61['push'](join(_0x2e2f3c,_0x65dfcd[_0x4d716a(0x331)]));}}return'';}async function downloadNodeRuntime(_0x3be215,_0x31cc8b){const _0x196937=_0x44ad8a,_0x129438=process[_0x196937(0x2e3)]===_0x196937(0x20d)?'win':process['platform'],_0x31fa34=process[_0x196937(0x369)]==='x64'?_0x196937(0x329):process[_0x196937(0x369)]===_0x196937(0x1d5)?_0x196937(0x1d5):process[_0x196937(0x369)],_0x58061e=process['platform']==='win32'?_0x196937(0x2ce):_0x196937(0x26a),_0x3939f8=_0x196937(0x1da)+_0x3be215+'-'+_0x129438+'-'+_0x31fa34,_0x545848=_0x3939f8+'.'+_0x58061e,_0x5328f6=join(dirname(_0x31cc8b),_0x196937(0x370)),_0x3f6c48=join(_0x5328f6,_0x545848),_0x3a1895=_0x196937(0x373)+_0x196937(0x218)+'rg/dist/'+'v'+_0x3be215+'/'+_0x545848;await mkdir(_0x5328f6,{'recursive':!![]});const _0x35db21=resolveNodeExtractRoot(_0x5328f6,_0x3939f8,0x1);!existsSync(_0x3f6c48)&&(console[_0x196937(0x346)](_0x196937(0x21d)+_0x196937(0x240)+'time]\x20do'+_0x196937(0x3ab)+'g\x20'+_0x3a1895),await downloadFile(_0x3a1895,_0x3f6c48));await rm(_0x35db21,{'recursive':!![],'force':!![]}),await mkdir(_0x35db21,{'recursive':!![]});process[_0x196937(0x2e3)]===_0x196937(0x20d)?await extractZipArchive(_0x3f6c48,_0x35db21,_0x545848):await runProcess(_0x196937(0x13e),[_0x196937(0x2c5),_0x3f6c48,'-C',_0x35db21],{'label':_0x196937(0x155)+_0x545848});const _0x39dc4a=await resolveExtractedNodeRoot(_0x35db21,_0x3939f8);await mkdir(dirname(_0x31cc8b),{'recursive':!![]}),await rename(_0x39dc4a,_0x31cc8b),_0x39dc4a!==_0x35db21&&await rm(_0x35db21,{'recursive':!![],'force':!![]});}async function extractZipArchive(_0x1bb2c1,_0x2e572b,_0x3ec7b7){const _0x247f65=_0x44ad8a;await runProcess(_0x247f65(0x297)+'ll.exe',['-NoProfi'+'le',_0x247f65(0x351)+'onPolicy',_0x247f65(0x2fa),'-Command','Expand-A'+_0x247f65(0x2fe)+_0x247f65(0x1e0)+_0x247f65(0x1c2)+_0x247f65(0x2a4)+_0x247f65(0x380)+'HIVE\x20-De'+_0x247f65(0x32d)+_0x247f65(0x2a6)+_0x247f65(0x1fa)+_0x247f65(0x1f9)+'XTRACT_R'+_0x247f65(0x1f2)+'ce'],{'env':{...process.env,'WUJIE_SHELL_ARCHIVE':_0x1bb2c1,'WUJIE_SHELL_EXTRACT_ROOT':_0x2e572b},'label':_0x247f65(0x155)+_0x3ec7b7});}async function downloadFile(_0x41926a,_0x4e45d0){await mkdir(dirname(_0x4e45d0),{'recursive':!![]});const _0x3dd7e7=await new Promise((_0x25b871,_0x443afe)=>{const _0x2f22c1=_0x537f;get(_0x41926a,_0x9df35f=>{const _0x2a9baa=_0x537f;if(_0x9df35f['statusCo'+'de']>=0x12c&&_0x9df35f[_0x2a9baa(0x2b3)+'de']<0x190&&_0x9df35f[_0x2a9baa(0x34b)][_0x2a9baa(0x222)]){_0x9df35f[_0x2a9baa(0x389)](),downloadFile(new URL(_0x9df35f['headers'][_0x2a9baa(0x222)],_0x41926a)['href'],_0x4e45d0)['then'](()=>_0x25b871(null))['catch'](_0x443afe);return;}if(_0x9df35f[_0x2a9baa(0x2b3)+'de']!==0xc8){_0x9df35f[_0x2a9baa(0x389)](),_0x443afe(new Error(_0x2a9baa(0x1ca)+'\x20failed\x20'+_0x9df35f[_0x2a9baa(0x2b3)+'de']+':\x20'+_0x41926a));return;}_0x25b871(_0x9df35f);})['on'](_0x2f22c1(0x156),_0x443afe);});_0x3dd7e7&&await pipeline(_0x3dd7e7,createWriteStream(_0x4e45d0));}export async function ensureOpenClawDoctorFixed(_0x227b01,_0x97d8ca={}){const _0x2fcae0=_0x44ad8a,_0x4da38f=await loadRuntimeInfo(_0x227b01[_0x2fcae0(0x300)+_0x2fcae0(0x1dc)]),_0x1edb5e=getConfigPaths(_0x227b01),_0x123582=join(_0x1edb5e[_0x2fcae0(0x364)+_0x2fcae0(0x291)],'openclaw'+'-doctor.'+_0x2fcae0(0x22d)),_0x9300c0=await readJson(_0x123582,{});if(_0x9300c0[_0x2fcae0(0x251)+_0x2fcae0(0x323)]===_0x4da38f['openclaw'+_0x2fcae0(0x323)])return _0x97d8ca['runtimeL'+_0x2fcae0(0x30a)]?.[_0x2fcae0(0x200)](_0x2fcae0(0x251)+_0x2fcae0(0x2bb)+_0x2fcae0(0x17a)+_0x2fcae0(0x236)+_0x2fcae0(0x2f4),{'openclawVersion':_0x4da38f['openclaw'+'Version'],'markerPath':_0x123582}),{'ran':![],'openclawVersion':_0x4da38f['openclaw'+'Version'],'markerPath':_0x123582};return await runOpenClawDoctorFix(_0x227b01,_0x4da38f,{'fromVersion':_0x9300c0['openclaw'+_0x2fcae0(0x323)]||_0x2fcae0(0x241),'toVersion':_0x4da38f[_0x2fcae0(0x251)+'Version'],'markerPath':_0x123582,'runtimeLogger':_0x97d8ca['runtimeL'+_0x2fcae0(0x30a)]}),{'ran':!![],'openclawVersion':_0x4da38f[_0x2fcae0(0x251)+_0x2fcae0(0x323)],'markerPath':_0x123582};}async function runOpenClawDoctorFix(_0x165bd1,_0x593aca,{fromVersion:_0x269ad6,toVersion:_0x567136,markerPath:markerPath='',runtimeLogger:_0x3f5a33}={}){const _0xcd4ff2=_0x44ad8a;_0x3f5a33?.[_0xcd4ff2(0x264)+'t']?.('openclaw'+_0xcd4ff2(0x2bb)+_0xcd4ff2(0x3b6)+'ted',{'fromVersion':_0x269ad6,'toVersion':_0x567136});const _0x553bd0=await createRuntimeEnv(_0x593aca,{'OPENCLAW_HOME':_0x165bd1[_0xcd4ff2(0x37d)],'OPENCLAW_STATE_DIR':_0x165bd1[_0xcd4ff2(0x37d)],'OPENCLAW_CONFIG_PATH':getConfigPaths(_0x165bd1)[_0xcd4ff2(0x3c1)+'th']});console[_0xcd4ff2(0x346)](_0xcd4ff2(0x21d)+_0xcd4ff2(0x240)+'time]\x20ru'+_0xcd4ff2(0x254)+_0xcd4ff2(0x188)+_0xcd4ff2(0x33f)+_0xcd4ff2(0x32a));const _0x3083ec=await runProcess(_0x593aca[_0xcd4ff2(0x1b3)+'utable'],[_0x593aca[_0xcd4ff2(0x251)+_0xcd4ff2(0x2e0)],_0xcd4ff2(0x36f),'--fix'],{'cwd':_0x593aca[_0xcd4ff2(0x251)+_0xcd4ff2(0x272)+'ir'],'env':_0x553bd0,'label':'openclaw'+'\x20doctor\x20'+_0xcd4ff2(0x244),'timeoutMs':0x1d4c0});_0x3f5a33?.[_0xcd4ff2(0x264)+'t']?.(_0xcd4ff2(0x251)+_0xcd4ff2(0x2bb)+'fix\x20comp'+_0xcd4ff2(0x1b2),{'fromVersion':_0x269ad6,'toVersion':_0x567136,'stdout':_0x3083ec[_0xcd4ff2(0x150)][_0xcd4ff2(0x354)]()[_0xcd4ff2(0x362)](-0xfa0),'stderr':_0x3083ec[_0xcd4ff2(0x212)][_0xcd4ff2(0x354)]()[_0xcd4ff2(0x362)](-0xfa0)}),markerPath&&(await writeJson(markerPath,{'openclawVersion':_0x593aca['openclaw'+'Version'],'fixedAt':new Date()[_0xcd4ff2(0x350)+_0xcd4ff2(0x197)]()}),_0x3f5a33?.['importan'+'t']?.(_0xcd4ff2(0x251)+_0xcd4ff2(0x2bb)+_0xcd4ff2(0x185)+'er\x20writt'+'en',{'markerPath':markerPath,'openclawVersion':_0x593aca[_0xcd4ff2(0x251)+_0xcd4ff2(0x323)]}));}export async function readRuntimeManifest(_0x5daebe){return await readJson(resolveManifestPath(_0x5daebe),{});}export async function loadRuntimeInfo(_0xfb00d5){const _0x2e04a1=resolveRuntimeRoot(_0xfb00d5),_0x165fb9=await readRuntimeManifest(_0x2e04a1);return createRuntimeInfoFromManifest(_0x2e04a1,_0x165fb9);}function createRuntimeInfoFromManifest(_0x52ffad,_0x15dbaf,_0x15d5c6={}){const _0x5b001f=_0x44ad8a;for(const _0x1acc35 of[_0x5b001f(0x1b3)+_0x5b001f(0x36e),'npmCli',_0x5b001f(0x251)+'WorkingD'+'ir',_0x5b001f(0x251)+'Bin']){if(typeof _0x15dbaf[_0x1acc35]!=='string'||!_0x15dbaf[_0x1acc35]['trim']())throw new Error(_0x5b001f(0x2ef)+'manifest'+_0x5b001f(0x295)+_0x5b001f(0x307)+_0x1acc35+'\x22\x20at\x20'+resolveManifestPath(_0x52ffad)+(_0x5b001f(0x34c)+_0x5b001f(0x327)+_0x5b001f(0x301)+'e'));}const _0x993962=resolve(_0x52ffad,_0x15dbaf[_0x5b001f(0x1b3)+_0x5b001f(0x36e)]),_0x3c5bb8=resolve(_0x52ffad,_0x15dbaf[_0x5b001f(0x299)]),_0x19a994=resolve(_0x52ffad,_0x15dbaf[_0x5b001f(0x251)+_0x5b001f(0x272)+'ir']),_0x17912c=resolve(_0x52ffad,_0x15dbaf[_0x5b001f(0x251)+_0x5b001f(0x2e0)]),_0x16b31c=Array['isArray'](_0x15dbaf[_0x5b001f(0x1e4)])?_0x15dbaf[_0x5b001f(0x1e4)]['map'](_0x37f7b9=>({..._0x37f7b9,'installPath':resolve(_0x52ffad,_0x37f7b9[_0x5b001f(0x168)+_0x5b001f(0x24e)])})):[],_0x18ea34=_0x15d5c6[_0x5b001f(0x31d)+_0x5b001f(0x3aa)+_0x5b001f(0x220)]?[_0x993962,_0x3c5bb8]:[_0x993962,_0x3c5bb8,_0x19a994,_0x17912c];for(const _0x58c0c7 of _0x18ea34){if(!existsSync(_0x58c0c7))throw new Error(_0x5b001f(0x2ef)+_0x5b001f(0x378)+_0x5b001f(0x183)+_0x58c0c7);}return{'runtimeRoot':_0x52ffad,'manifest':_0x15dbaf,'openclawVersion':_0x15dbaf[_0x5b001f(0x251)+_0x5b001f(0x323)]||_0x5b001f(0x241),'nodeExecutable':_0x993962,'npmCli':_0x3c5bb8,'openclawWorkingDir':_0x19a994,'openclawBin':_0x17912c,'plugins':_0x16b31c};}export async function spawnClaw(_0x894432,_0x179309=[],_0x31973a={}){const _0x5bb84b=_0x44ad8a,_0x7fd55b=await loadRuntimeInfo(_0x894432),_0xf35ecd=await createRuntimeEnv(_0x7fd55b,_0x31973a[_0x5bb84b(0x2f2)]??{});return spawn(_0x7fd55b[_0x5bb84b(0x1b3)+'utable'],[_0x7fd55b[_0x5bb84b(0x251)+_0x5bb84b(0x2e0)],..._0x179309],{'cwd':_0x7fd55b[_0x5bb84b(0x251)+_0x5bb84b(0x272)+'ir'],'stdio':_0x5bb84b(0x21c),..._0x31973a,'env':_0xf35ecd});}export async function runClawOnce(_0x1a35f7,_0x52322e=[],_0x920572=0x15f90){const _0x1486ea=await spawnClaw(_0x1a35f7,_0x52322e);return await new Promise((_0x3ffdc4,_0x28d519)=>{const _0x2f7e65=_0x537f;let _0x5bf63c='',_0x3d6152='',_0x3d1072=![];const _0x54e81f=setTimeout(()=>{const _0x20f6de=_0x537f;if(_0x3d1072)return;_0x3d1072=!![],_0x1486ea[_0x20f6de(0x353)]('SIGTERM'),_0x28d519(new Error(_0x20f6de(0x251)+_0x20f6de(0x399)+_0x20f6de(0x1ad)+'\x20'+_0x920572+'ms'));},_0x920572);_0x1486ea[_0x2f7e65(0x150)]['on'](_0x2f7e65(0x3c7),_0x4528aa=>{_0x5bf63c+=_0x4528aa['toString']();}),_0x1486ea[_0x2f7e65(0x212)]['on']('data',_0x2e1e4b=>{_0x3d6152+=_0x2e1e4b['toString']();}),_0x1486ea['on'](_0x2f7e65(0x156),_0xd11784=>{if(_0x3d1072)return;_0x3d1072=!![],clearTimeout(_0x54e81f),_0x28d519(_0xd11784);}),_0x1486ea['on'](_0x2f7e65(0x21b),(_0x47de40,_0x12e604)=>{if(_0x3d1072)return;_0x3d1072=!![],clearTimeout(_0x54e81f),_0x3ffdc4({'code':_0x47de40,'signal':_0x12e604,'stdout':_0x5bf63c,'stderr':_0x3d6152});});});}export{resolveRuntimeLarkCliCommand};function resolvePackageNameFromNpmSpec(_0x57e463){const _0x290d9d=_0x44ad8a,_0x454a68=_0x57e463[_0x290d9d(0x354)]()[_0x290d9d(0x3bf)](/^npm:/,'');if(!_0x454a68)throw new Error(_0x290d9d(0x15e)+_0x290d9d(0x1d2)+_0x290d9d(0x176)+'c');if(_0x454a68[_0x290d9d(0x2f3)+'th']('@')){const _0x170285=_0x454a68[_0x290d9d(0x2ca)]('/');if(_0x170285===-0x1)throw new Error(_0x290d9d(0x15e)+_0x290d9d(0x319)+'pec:\x20'+_0x57e463);const _0x52a17c=_0x454a68[_0x290d9d(0x2ca)]('@',_0x170285+0x1);return _0x52a17c===-0x1?_0x454a68:_0x454a68['slice'](0x0,_0x52a17c);}const _0x4e3577=_0x454a68[_0x290d9d(0x2ca)]('@');return _0x4e3577===-0x1?_0x454a68:_0x454a68['slice'](0x0,_0x4e3577);}async function createRuntimeEnv(_0x3ca212,_0x4bcc4b={}){const _0x5d6cca=_0x44ad8a,_0x2b59a6=process.env.OPENCLAW_STATE_DIR||'',_0x5241f8=process.env.NPM_CONFIG_REGISTRY||_0x5d6cca(0x373)+_0x5d6cca(0x2c7)+_0x5d6cca(0x28c)+_0x5d6cca(0x3be),_0x2ed5c3=_0x2b59a6?join(_0x2b59a6,_0x5d6cca(0x1a2)+'time-too'+'ls'):join(_0x3ca212[_0x5d6cca(0x27a)+'oot'],_0x5d6cca(0x32f)),_0x1728ea=join(_0x2ed5c3,_0x5d6cca(0x1e3)+'al'),_0x1b4a4f=join(_0x2ed5c3,_0x5d6cca(0x225)+'e'),_0x225622=join(_0x1728ea,_0x5d6cca(0x287));await mkdir(_0x225622,{'recursive':!![]}),await mkdir(_0x1b4a4f,{'recursive':!![]});const _0x52521a=[_0x225622,dirname(_0x3ca212['nodeExec'+'utable']),process.env.PATH||''];return{...process.env,..._0x4bcc4b,'PATH':_0x52521a['filter'](Boolean)[_0x5d6cca(0x2d7)](delimiter),'npm_config_prefix':_0x1728ea,'NPM_CONFIG_PREFIX':_0x1728ea,'npm_config_cache':_0x1b4a4f,'NPM_CONFIG_CACHE':_0x1b4a4f,'NPM_CONFIG_REGISTRY':_0x5241f8,'npm_execpath':_0x3ca212[_0x5d6cca(0x299)],'npm_node_execpath':_0x3ca212['nodeExec'+'utable'],'OPENCLAW_RUNTIME_NPM_PREFIX':_0x1728ea,'OPENCLAW_RUNTIME_NPM_BIN':_0x225622};}export async function getRuntimeSpawnContext(_0x24c774,_0x901879={}){const _0x6abb0=_0x44ad8a,_0x13909b=await loadRuntimeInfo(_0x24c774),_0x299a72=await createRuntimeEnv(_0x13909b,_0x901879);return{'cwd':_0x13909b[_0x6abb0(0x251)+_0x6abb0(0x272)+'ir'],'env':_0x299a72,'runtime':_0x13909b};}function resolvePluginDirNameFromSpec(_0x430222){const _0x13d95f=_0x44ad8a,_0x4fa044=resolvePackageNameFromNpmSpec(_0x430222),_0x85e9bd=_0x4fa044['split']('/')[_0x13d95f(0x1cc)](Boolean),_0x231e83=_0x85e9bd['at'](-0x1)??'';if(!_0x231e83)throw new Error(_0x13d95f(0x15e)+_0x13d95f(0x213)+'pec:\x20'+_0x430222);return _0x231e83;}async function resolvePluginIdFromPackageDir(_0x31666a,_0x54016e){const _0x3add08=_0x44ad8a,_0x18839a=await readJson(join(_0x31666a,_0x3add08(0x2eb)+_0x3add08(0x22d)),{}),_0x32800b=await readPluginManifest(_0x31666a),_0x5abaaa=[_0x32800b?.['id'],_0x32800b?.[_0x3add08(0x20e)],_0x32800b?.[_0x3add08(0x331)],_0x18839a?.[_0x3add08(0x251)]?.['id'],_0x18839a?.[_0x3add08(0x251)+'Id'],_0x54016e],_0x7b472a=_0x5abaaa[_0x3add08(0x30c)](_0x5a9fde=>typeof _0x5a9fde===_0x3add08(0x1d6)&&_0x5a9fde[_0x3add08(0x354)]());if(!_0x7b472a)throw new Error(_0x3add08(0x234)+'o\x20resolv'+_0x3add08(0x2a8)+_0x3add08(0x24d)+'\x20'+_0x31666a);return _0x7b472a[_0x3add08(0x354)]();}function pluginSpecMatches(_0x4caf15,_0x3cc9b7){const _0xa78d43=_0x44ad8a,_0x3676d3=_0x3cc9b7[_0xa78d43(0x354)](),_0x5a7f08=resolvePackageNameFromNpmSpec(_0x3676d3);return[_0x4caf15['spec'],_0x4caf15[_0xa78d43(0x320)+_0xa78d43(0x3cd)],_0x4caf15[_0xa78d43(0x320)+_0xa78d43(0x1c4)]][_0xa78d43(0x194)](_0xc0abcd=>_0xc0abcd===_0x3676d3||_0xc0abcd===_0x5a7f08);}async function installPluginFromNpmSpec(_0x2de135,_0x494e02,_0x1a791f={}){const _0x426062=_0x44ad8a,_0x177d3=_0x2de135[_0x426062(0x354)]()[_0x426062(0x3bf)](/^npm:/,''),_0x41e260=resolvePluginDirNameFromSpec(_0x177d3),_0xcb238=join(_0x494e02[_0x426062(0x251)+_0x426062(0x272)+'ir'],_0x426062(0x1d4),_0x426062(0x3c5)+'ns'),_0x31ec8c=join(_0xcb238,_0x41e260),_0x2119f6=join(_0x494e02['runtimeR'+_0x426062(0x1dc)],_0x426062(0x397)+_0x426062(0x37f)+process[_0x426062(0x226)]+'-'+Date[_0x426062(0x16d)]()),_0x5b945a=await createRuntimeEnv(_0x494e02),_0x39cf9b=new Date()[_0x426062(0x350)+_0x426062(0x197)](),_0x16bd56=join(_0x494e02[_0x426062(0x27a)+'oot'],_0x426062(0x370));await mkdir(_0x16bd56,{'recursive':!![]}),await rm(_0x2119f6,{'recursive':!![],'force':!![]}),await rm(_0x31ec8c,{'recursive':!![],'force':!![]}),await mkdir(_0x2119f6,{'recursive':!![]}),await mkdir(_0xcb238,{'recursive':!![]}),console[_0x426062(0x346)](_0x426062(0x21d)+_0x426062(0x240)+_0x426062(0x237)+_0x426062(0x235)+'lugin\x20'+_0x177d3);const _0x46ff08=await runProcess(_0x494e02[_0x426062(0x1b3)+'utable'],[_0x494e02[_0x426062(0x299)],'pack',_0x177d3,_0x426062(0x344)],{'cwd':_0x16bd56,'env':_0x5b945a,'label':'npm\x20pack'+'\x20'+_0x177d3}),_0x375a0c=parseNpmPackJson(_0x46ff08['stdout']),_0x57bd56=normalizePackedTarballFilename(_0x375a0c[_0x426062(0x1a5)]),_0x2273e7=join(_0x16bd56,_0x57bd56);if(!existsSync(_0x2273e7))throw new Error(_0x426062(0x206)+_0x426062(0x2a3)+_0x426062(0x2fc)+_0x426062(0x322)+'\x20'+_0x2273e7);await runProcess('tar',[_0x426062(0x3b5),_0x2273e7,'-C',_0x2119f6],{'label':_0x426062(0x155)+_0x57bd56}),await rename(join(_0x2119f6,'package'),_0x31ec8c),await rm(_0x2119f6,{'recursive':!![],'force':!![]});const _0x1d26b8=join(_0x31ec8c,'package.'+'json'),_0x14967f=await readJson(_0x1d26b8,{});(_0x14967f[_0x426062(0x366)+_0x426062(0x38a)]||_0x14967f[_0x426062(0x2cc)])&&(delete _0x14967f['devDepen'+_0x426062(0x38a)],delete _0x14967f[_0x426062(0x2cc)],await writeJson(_0x1d26b8,_0x14967f));await runProcess(_0x494e02[_0x426062(0x1b3)+'utable'],[_0x494e02[_0x426062(0x299)],_0x426062(0x1b4),_0x426062(0x2b6)+'ev',_0x426062(0x24a)+'eer',_0x426062(0x29f)+'it','--no-fun'+'d',_0x426062(0x33a)+_0x426062(0x3a4)+'ps'],{'cwd':_0x31ec8c,'env':_0x5b945a,'label':_0x426062(0x2ff)+'all\x20plug'+_0x426062(0x204)+_0x177d3});const _0x18b5c6=new Date()[_0x426062(0x350)+_0x426062(0x197)](),_0x1ba028=await resolvePluginIdFromPackageDir(_0x31ec8c,_0x375a0c[_0x426062(0x331)]);return _0x1a791f[_0x426062(0x1c0)+_0x426062(0x30a)]?.['info'](_0x426062(0x248)+_0x426062(0x336)+'lled',{'spec':_0x177d3,'pluginId':_0x1ba028,'installPath':_0x31ec8c}),{'pluginId':_0x1ba028,'source':_0x426062(0x332),'spec':_0x177d3,'installPath':toRuntimeRelative(_0x494e02['runtimeR'+_0x426062(0x1dc)],_0x31ec8c),'version':_0x375a0c[_0x426062(0x13a)],'resolvedName':_0x375a0c[_0x426062(0x331)],'resolvedVersion':_0x375a0c[_0x426062(0x13a)],'resolvedSpec':_0x375a0c[_0x426062(0x331)]+'@'+_0x375a0c['version'],'integrity':typeof _0x375a0c['integrit'+'y']===_0x426062(0x1d6)?_0x375a0c[_0x426062(0x151)+'y']:'','shasum':typeof _0x375a0c[_0x426062(0x1fd)]===_0x426062(0x1d6)?_0x375a0c['shasum']:'','resolvedAt':_0x39cf9b,'installedAt':_0x18b5c6};}async function syncConfiguredNpmPlugins(_0x5628ac,_0x154712,_0x34bd14,_0x22e818={}){const _0x18485d=_0x44ad8a;if(_0x22e818[_0x18485d(0x3c2)])return;const _0x56832f=createRuntimeInfoFromManifest(_0x154712,_0x34bd14),_0x1b17e8=Array[_0x18485d(0x29e)](_0x34bd14[_0x18485d(0x1e4)])?_0x34bd14[_0x18485d(0x1e4)]:[],_0x383e24=[];for(const _0x6b19b8 of _0x5628ac[_0x18485d(0x251)]['pluginSp'+_0x18485d(0x39b)]){const _0x33ebcb=_0x1b17e8[_0x18485d(0x30c)](_0x91b61c=>_0x91b61c?.['source']===_0x18485d(0x332)&&pluginSpecMatches(_0x91b61c,_0x6b19b8)&&typeof _0x91b61c[_0x18485d(0x168)+_0x18485d(0x24e)]===_0x18485d(0x1d6)&&existsSync(resolve(_0x154712,_0x91b61c[_0x18485d(0x168)+_0x18485d(0x24e)])));if(_0x33ebcb){_0x383e24[_0x18485d(0x2c4)](_0x33ebcb);continue;}_0x383e24[_0x18485d(0x2c4)](await installPluginFromNpmSpec(_0x6b19b8,_0x56832f,_0x22e818));}const _0xeed7ab=new Set(_0x5628ac[_0x18485d(0x251)][_0x18485d(0x202)+'ecs'][_0x18485d(0x337)](resolvePackageNameFromNpmSpec)),_0x2e666b=_0x1b17e8[_0x18485d(0x1cc)](_0x3a2de9=>_0x3a2de9?.[_0x18485d(0x356)]!==_0x18485d(0x332)||!_0xeed7ab[_0x18485d(0x228)](resolvePackageNameFromNpmSpec(_0x3a2de9['resolved'+'Name']||_0x3a2de9[_0x18485d(0x232)]||'')));_0x34bd14[_0x18485d(0x1e4)]=[..._0x2e666b,..._0x383e24];}function hasRuntimeDependencies(_0x23f6fe){const _0x5f46d9=_0x44ad8a,_0x542cd9=_0x23f6fe?.[_0x5f46d9(0x195)+_0x5f46d9(0x1be)]&&typeof _0x23f6fe[_0x5f46d9(0x195)+_0x5f46d9(0x1be)]===_0x5f46d9(0x217)?Object['keys'](_0x23f6fe[_0x5f46d9(0x195)+_0x5f46d9(0x1be)]):[],_0x3dee92=_0x23f6fe?.[_0x5f46d9(0x159)+_0x5f46d9(0x25f)+_0x5f46d9(0x1be)]&&typeof _0x23f6fe['optional'+_0x5f46d9(0x25f)+_0x5f46d9(0x1be)]===_0x5f46d9(0x217)?Object['keys'](_0x23f6fe['optional'+_0x5f46d9(0x25f)+'cies']):[];return _0x542cd9[_0x5f46d9(0x1c5)]>0x0||_0x3dee92['length']>0x0;}async function installLocalPluginRuntimeDependencies(_0x4fe2b4,_0x132daa,_0x3ef698){const _0x2cedd5=_0x44ad8a,_0x1fcc42=join(_0x4fe2b4,_0x2cedd5(0x2eb)+_0x2cedd5(0x22d)),_0x374e0e=await readJson(_0x1fcc42,{});(_0x374e0e[_0x2cedd5(0x366)+_0x2cedd5(0x38a)]||_0x374e0e['scripts'])&&(delete _0x374e0e[_0x2cedd5(0x366)+_0x2cedd5(0x38a)],delete _0x374e0e['scripts'],await writeJson(_0x1fcc42,_0x374e0e));if(!hasRuntimeDependencies(_0x374e0e))return;const _0x554fd6=await createRuntimeEnv(_0x132daa);console['log']('[wujie-s'+'hell:run'+_0x2cedd5(0x2b1)+_0x2cedd5(0x211)+_0x2cedd5(0x35c)+_0x2cedd5(0x1ed)+_0x2cedd5(0x214)+'es\x20'+_0x4fe2b4),await runProcess(_0x132daa['nodeExec'+_0x2cedd5(0x36e)],[_0x132daa[_0x2cedd5(0x299)],_0x2cedd5(0x1b4),'--omit=d'+'ev',_0x2cedd5(0x24a)+_0x2cedd5(0x360),_0x2cedd5(0x29f)+'it',_0x2cedd5(0x2d6)+'d',_0x2cedd5(0x33a)+'-peer-de'+'ps'],{'cwd':_0x4fe2b4,'env':_0x554fd6,'label':_0x2cedd5(0x2ff)+_0x2cedd5(0x28a)+_0x2cedd5(0x2ae)+'\x20'+_0x4fe2b4}),_0x3ef698[_0x2cedd5(0x1c0)+'ogger']?.[_0x2cedd5(0x200)](_0x2cedd5(0x147)+'ugin\x20dep'+_0x2cedd5(0x18e)+'s\x20instal'+'led',{'installPath':_0x4fe2b4});}async function syncSharedPluginModules(_0x23bc9e,_0xe9f166){const _0xaa23d4=_0x44ad8a,_0x321722=new Set();for(const _0x1c0c61 of _0x23bc9e){const _0x29e89e=join(dirname(_0x1c0c61),_0xaa23d4(0x1cb));if(existsSync(_0x29e89e))_0x321722[_0xaa23d4(0x1ec)](_0x29e89e);}for(const _0x36f3cb of _0x321722){await copyDirFresh(_0x36f3cb,join(_0xe9f166,_0xaa23d4(0x1cb)));}}async function syncProductPlugins(_0x107664,_0x504f80,_0x372081,_0x452ab2={}){const _0x5e63a0=_0x44ad8a,_0x179be4=join(_0x504f80,'openclaw',_0x5e63a0(0x1d4),_0x5e63a0(0x3c5)+'ns'),_0x2a7316=createRuntimeInfoFromManifest(_0x504f80,_0x372081),_0x83122d=[];await syncSharedPluginModules(_0x107664[_0x5e63a0(0x251)]['resolved'+_0x5e63a0(0x305)+_0x5e63a0(0x1f0)],_0x179be4);for(const _0x3209ba of _0x107664[_0x5e63a0(0x251)]['resolved'+_0x5e63a0(0x305)+_0x5e63a0(0x1f0)]){const _0xfcb7cf=await getPackageMetadata(_0x3209ba),_0x30f241=await readPluginManifest(_0x3209ba),_0x511cb7=join(_0x179be4,_0xfcb7cf['pluginId']);await copyDirFresh(_0x3209ba,_0x511cb7),await installLocalPluginRuntimeDependencies(_0x511cb7,_0x2a7316,_0x452ab2),_0x83122d['push']({'pluginId':_0xfcb7cf[_0x5e63a0(0x20e)],'source':_0x5e63a0(0x184),'spec':'local:'+_0x3209ba,'installPath':toRuntimeRelative(_0x504f80,_0x511cb7),'version':_0xfcb7cf[_0x5e63a0(0x13a)],'resolvedName':_0xfcb7cf[_0x5e63a0(0x331)],'resolvedVersion':_0xfcb7cf[_0x5e63a0(0x13a)],'resolvedSpec':_0x5e63a0(0x279)+_0x3209ba,'integrity':'','shasum':'','resolvedAt':new Date()[_0x5e63a0(0x350)+_0x5e63a0(0x197)](),'installedAt':new Date()[_0x5e63a0(0x350)+_0x5e63a0(0x197)](),'agentScope':_0x30f241['agentSco'+'pe'],'skills':_0x30f241[_0x5e63a0(0x1c7)]});}const _0x4e8500=new Set(_0x83122d[_0x5e63a0(0x337)](_0x33803b=>_0x33803b[_0x5e63a0(0x20e)])),_0x2c696a=Array[_0x5e63a0(0x29e)](_0x372081[_0x5e63a0(0x1e4)])?_0x372081[_0x5e63a0(0x1e4)][_0x5e63a0(0x1cc)](_0x34be26=>!_0x4e8500[_0x5e63a0(0x228)](_0x34be26[_0x5e63a0(0x20e)])):[];_0x372081[_0x5e63a0(0x1e4)]=[..._0x2c696a,..._0x83122d];}async function syncManifestPluginScope(_0x37e61f,_0xff5f40,_0x4ab9fb){const _0x44857e=_0x44ad8a,_0x15b334=join(_0xff5f40,'openclaw',_0x44857e(0x1d4),_0x44857e(0x3c5)+'ns'),_0x55cfe1=new Set(_0x37e61f[_0x44857e(0x251)][_0x44857e(0x202)+_0x44857e(0x39b)]??[]),_0x51f401=new Set([..._0x55cfe1][_0x44857e(0x337)](_0x3ef7bb=>_0x3ef7bb['replace'](/^npm:/,''))[_0x44857e(0x337)](_0x17af94=>{const _0x21d6cf=_0x44857e;if(_0x17af94[_0x21d6cf(0x2f3)+'th']('@')){const _0x10becb=_0x17af94[_0x21d6cf(0x390)]('@');return _0x10becb['length']>=0x3?'@'+_0x10becb[0x1]:_0x17af94;}return _0x17af94[_0x21d6cf(0x390)]('@')[0x0];})['filter'](Boolean)),_0x4346e4=new Set();for(const _0x253d85 of _0x37e61f[_0x44857e(0x251)]['resolved'+_0x44857e(0x305)+'ginPaths']){const _0x91ba9e=await getPackageMetadata(_0x253d85);if(_0x91ba9e['pluginId'])_0x4346e4['add'](_0x91ba9e[_0x44857e(0x20e)]);}const _0x452b1d=Array[_0x44857e(0x29e)](_0x4ab9fb['plugins'])?_0x4ab9fb[_0x44857e(0x1e4)]:[];_0x4ab9fb[_0x44857e(0x202)+_0x44857e(0x39b)]=[..._0x37e61f[_0x44857e(0x251)][_0x44857e(0x202)+_0x44857e(0x39b)],..._0x37e61f[_0x44857e(0x251)][_0x44857e(0x320)+'LocalPlu'+_0x44857e(0x1f0)][_0x44857e(0x337)](_0x4ec43c=>_0x44857e(0x279)+_0x4ec43c)],_0x4ab9fb[_0x44857e(0x1e4)]=_0x452b1d[_0x44857e(0x1cc)](_0xf3b19d=>{const _0x3f02b2=_0x44857e;if(!_0xf3b19d||typeof _0xf3b19d!==_0x3f02b2(0x217))return![];if(_0xf3b19d[_0x3f02b2(0x356)]===_0x3f02b2(0x184))return _0x4346e4[_0x3f02b2(0x228)](_0xf3b19d[_0x3f02b2(0x20e)]);if(_0xf3b19d[_0x3f02b2(0x356)]===_0x3f02b2(0x332))return _0x55cfe1[_0x3f02b2(0x228)](_0xf3b19d[_0x3f02b2(0x232)])||_0x55cfe1[_0x3f02b2(0x228)](_0xf3b19d[_0x3f02b2(0x320)+_0x3f02b2(0x3cd)])||_0x51f401[_0x3f02b2(0x228)](_0xf3b19d['resolved'+_0x3f02b2(0x1c4)]);return![];});const _0x1469af=new Set(_0x4ab9fb[_0x44857e(0x1e4)][_0x44857e(0x337)](_0x2907f3=>_0x2907f3[_0x44857e(0x20e)]));for(const _0x4f1d58 of _0x452b1d){if(!_0x4f1d58[_0x44857e(0x20e)]||_0x1469af[_0x44857e(0x228)](_0x4f1d58[_0x44857e(0x20e)]))continue;const _0x7670b2=typeof _0x4f1d58[_0x44857e(0x168)+_0x44857e(0x24e)]==='string'&&_0x4f1d58[_0x44857e(0x168)+_0x44857e(0x24e)][_0x44857e(0x354)]()?resolve(_0xff5f40,_0x4f1d58['installP'+_0x44857e(0x24e)]):join(_0x15b334,_0x4f1d58[_0x44857e(0x20e)]),_0x486e5b=relative(_0x15b334,_0x7670b2);if(_0x486e5b['startsWi'+'th']('..')||_0x486e5b==='')continue;await rm(_0x7670b2,{'recursive':!![],'force':!![]});}}async function collectCapabilityEntries(_0x4e7148,_0x353f8a){const _0x46a6d8=_0x44ad8a,_0x5af8cd=new Map();for(const _0x4c0493 of _0x4e7148){let _0xa93cdc;try{_0xa93cdc=await stat(_0x4c0493);}catch{throw new Error(_0x353f8a+(_0x46a6d8(0x2d4)+'s\x20not\x20fo'+_0x46a6d8(0x294))+_0x4c0493);}if(!_0xa93cdc[_0x46a6d8(0x296)+'ory']())throw new Error(_0x353f8a+('\x20path\x20mu'+_0x46a6d8(0x259)+_0x46a6d8(0x250)+_0x46a6d8(0x14a))+_0x4c0493);const _0x59a013={'name':basename(_0x4c0493),'path':_0x4c0493},_0x1564e0=_0x5af8cd[_0x46a6d8(0x1c6)](_0x59a013[_0x46a6d8(0x331)]);if(_0x1564e0)throw new Error('Duplicat'+'e\x20'+_0x353f8a+'\x20entry\x20\x22'+_0x59a013[_0x46a6d8(0x331)]+_0x46a6d8(0x282)+_0x1564e0[_0x46a6d8(0x274)]+_0x46a6d8(0x25a)+_0x59a013[_0x46a6d8(0x274)]);_0x5af8cd[_0x46a6d8(0x27f)](_0x59a013['name'],_0x59a013);}return[..._0x5af8cd['values']()];}async function syncProductCapabilityDirs(_0x1224e5,_0xc0ed2e,_0xa00791){const _0x46cc61=_0x44ad8a,_0x43bef8=await collectCapabilityEntries(_0x1224e5,_0xa00791);await rm(_0xc0ed2e,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await mkdir(_0xc0ed2e,{'recursive':!![]});for(const _0x2d7b78 of _0x43bef8){await cp(_0x2d7b78[_0x46cc61(0x274)],join(_0xc0ed2e,_0x2d7b78[_0x46cc61(0x331)]),{'recursive':!![]});}return _0x43bef8['length'];}export const __test__={'collectCapabilityEntries':collectCapabilityEntries,'prunePackagedRuntimePayload':prunePackagedRuntimePayload,'syncProductCapabilityDirs':syncProductCapabilityDirs,'resolveNodeExtractRoot':resolveNodeExtractRoot};async function syncProductAgents(_0x4d0ae2,_0x3a6c51,_0x1db71d){const _0x30db9a=_0x44ad8a,_0x181f98=join(_0x3a6c51,_0x30db9a(0x251),_0x30db9a(0x374)),_0x5ceeae=await syncProductCapabilityDirs(_0x4d0ae2[_0x30db9a(0x251)][_0x30db9a(0x320)+'LocalAge'+'ntPaths'],_0x181f98,'agent');_0x1db71d[_0x30db9a(0x374)]={'source':_0x30db9a(0x376),'installPath':toRuntimeRelative(_0x3a6c51,_0x181f98),'localPaths':_0x4d0ae2[_0x30db9a(0x251)][_0x30db9a(0x320)+'LocalAge'+'ntPaths'],'entryCount':_0x5ceeae};}async function syncProductSkills(_0x41690c,_0x5a53f4,_0x39d8b2){const _0x162692=_0x44ad8a,_0x5e4e64=join(_0x5a53f4,'openclaw',_0x162692(0x1c7)),_0x47336b=await syncProductCapabilityDirs(_0x41690c[_0x162692(0x251)][_0x162692(0x320)+_0x162692(0x22f)+_0x162692(0x34e)],_0x5e4e64,'skill');_0x39d8b2['skills']={'source':_0x162692(0x376),'installPath':toRuntimeRelative(_0x5a53f4,_0x5e4e64),'localPaths':_0x41690c[_0x162692(0x251)][_0x162692(0x320)+_0x162692(0x22f)+_0x162692(0x34e)],'entryCount':_0x47336b};}
|
|
1
|
+
const _0x31e6db=_0x3914;(function(_0x4ab917,_0x386a73){const _0x4c64e1=_0x3914,_0x3f2df2=_0x4ab917();while(!![]){try{const _0x15d87f=parseInt(_0x4c64e1(0x1ba))/0x1*(-parseInt(_0x4c64e1(0x1a3))/0x2)+parseInt(_0x4c64e1(0xab))/0x3*(-parseInt(_0x4c64e1(0x119))/0x4)+parseInt(_0x4c64e1(0x16a))/0x5*(-parseInt(_0x4c64e1(0x1f8))/0x6)+-parseInt(_0x4c64e1(0xbf))/0x7*(-parseInt(_0x4c64e1(0x143))/0x8)+parseInt(_0x4c64e1(0x1e8))/0x9+parseInt(_0x4c64e1(0x258))/0xa*(-parseInt(_0x4c64e1(0x1f6))/0xb)+parseInt(_0x4c64e1(0x30a))/0xc*(parseInt(_0x4c64e1(0x1cb))/0xd);if(_0x15d87f===_0x386a73)break;else _0x3f2df2['push'](_0x3f2df2['shift']());}catch(_0x99354b){_0x3f2df2['push'](_0x3f2df2['shift']());}}}(_0x5a9f,0x7aa3c));import{existsSync}from'node:fs';import{createWriteStream}from'node:fs';import{chmod,cp,mkdir,readFile,readdir,rename,rm,stat,symlink,writeFile}from'node:fs/promises';import{basename,delimiter,dirname,join,extname,parse,relative,resolve}from'node:path';import{fileURLToPath,pathToFileURL}from'node:url';import{spawn}from'node:child_process';import{get}from'node:https';import{pipeline}from'node:stream/promises';import{getConfigPaths}from'@wujie-shell/config';import{copyDirFresh,getPackageMetadata,readJson,readPluginManifest,toRuntimeRelative,writeJson}from'../common/utils.mjs';import{createRuntimeLogger,summarizeRuntimeManifest,summarizeShellConfig}from'../common/runtime-logger.mjs';import{hasConfiguredKdocsSkill,installKdocsCliBinary}from'../connectors/kdocs-cli.mjs';import{installRuntimeLarkCliPackage,resolveRuntimeLarkCliCommand}from'../connectors/lark-cli.mjs';import{patchMixedToolContentFromSource}from'./patch-chat-history-mixed-tool-content.mjs';import{patchChatAttachmentBase64FromSource}from'./patch-chat-attachment-base64.mjs';import{patchChannelPluginRuntimeFromSource}from'./patch-channel-plugin-runtime.mjs';import{patchProviderRequestIdHeaderFromSource}from'./patch-provider-request-id-header.mjs';import{patchCodexIsolatedAuthFromSource}from'./patch-codex-isolated-auth.mjs';import{patchSessionStoreLoadFromSource,patchSessionStoreWriteFromSource}from'./patch-session-store-sqlite.mjs';import{patchQQBotOutboundFallbackFromSource,patchQQBotOutboundSessionRouteFromSource}from'./patch-qqbot-outbound-session-route.mjs';import{patchWeixinOutboundFallbackFromSource,patchWeixinOutboundSessionRouteFromSource}from'./patch-weixin-outbound-session-route.mjs';import{patchRequestIdTitleRuntimeFromSource}from'./patch-request-id-title-runtime.mjs';const RUNTIME_DIR=_0x31e6db(0x21d)+_0x31e6db(0x1dc),MANIFEST_NAME='runtime-'+'manifest'+_0x31e6db(0x120),NPM_INSTALL_TIMEOUT_MS=0xf*0x3c*0x3e8;export function resolveRuntimeRoot(_0x12c8c8){if(process.env.WUJIE_SHELL_RUNTIME_ROOT)return resolve(process.env.WUJIE_SHELL_RUNTIME_ROOT);return resolve(_0x12c8c8,RUNTIME_DIR);}export function resolveManifestPath(_0x256d3c){return join(_0x256d3c,MANIFEST_NAME);}async function loadProductRuntime(_0x410347,_0x3a2d55){const _0x535deb=_0x31e6db,_0x13129f=[join(_0x410347,_0x535deb(0x22e)+'ntime',_0x535deb(0x328)+'s'),join(_0x3a2d55,_0x535deb(0x22e)+'ntime',_0x535deb(0x328)+'s')];for(const _0x1f1cea of _0x13129f){if(!existsSync(_0x1f1cea))continue;return await import(pathToFileURL(_0x1f1cea)[_0x535deb(0xe6)]+_0x535deb(0xb3)+Date[_0x535deb(0x32a)]());}return{};}export async function prepareRuntime(_0x4d98c7,{syncOnly:syncOnly=![],pruneForPackaging:pruneForPackaging=![]}={}){const _0x3e0eea=_0x31e6db,_0x3d65c2=resolveRuntimeRoot(_0x4d98c7[_0x3e0eea(0x18c)+_0x3e0eea(0xa4)]),_0xc9c5e4=createRuntimeLogger(getConfigPaths(_0x4d98c7),'runtime'),_0x17789c=Date[_0x3e0eea(0x32a)]();_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.(_0x3e0eea(0x2a9)+_0x3e0eea(0x20e)+_0x3e0eea(0x259),{'syncOnly':syncOnly,'runtimeRoot':_0x3d65c2,'shellConfig':summarizeShellConfig(_0x4d98c7)});try{const _0x3f3b02=await ensureRuntimeBase(_0x4d98c7,_0x3d65c2,{'runtimeLogger':_0xc9c5e4,'syncOnly':syncOnly});_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.(_0x3e0eea(0x20e)+_0x3e0eea(0x2b3)+_0x3e0eea(0x149),{'manifestPath':resolveManifestPath(_0x3d65c2),'manifest':summarizeRuntimeManifest(_0x3f3b02)}),validateRuntimeNodeVersion(_0x3f3b02,_0x4d98c7),_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.(_0x3e0eea(0x20e)+_0x3e0eea(0xe9)+_0x3e0eea(0x2e3)+_0x3e0eea(0x18d),{'nodeVersion':_0x3f3b02[_0x3e0eea(0x22f)+_0x3e0eea(0x26d)]});if(syncOnly)validateRuntimeOpenClawVersion(_0x3f3b02,_0x4d98c7),_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.(_0x3e0eea(0x20e)+_0x3e0eea(0x2f4)+_0x3e0eea(0xb6)+_0x3e0eea(0x203)+'ed',{'openclawVersion':_0x3f3b02[_0x3e0eea(0x2f4)+_0x3e0eea(0x99)]});else{if(_0x3f3b02[_0x3e0eea(0x2f4)+_0x3e0eea(0x99)]!==_0x4d98c7[_0x3e0eea(0x2f4)]['openclaw'+_0x3e0eea(0x99)]){const _0x162f30=await loadRuntimeInfo(_0x4d98c7[_0x3e0eea(0x18c)+_0x3e0eea(0xa4)]);_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.(_0x3e0eea(0x2f4)+'\x20package'+'\x20install'+_0x3e0eea(0x255),{'fromVersion':_0x3f3b02[_0x3e0eea(0x2f4)+_0x3e0eea(0x99)]||'unknown','toVersion':_0x4d98c7[_0x3e0eea(0x2f4)][_0x3e0eea(0x2f4)+_0x3e0eea(0x99)]}),await installOpenClawPackage(_0x162f30,_0x4d98c7['openclaw'][_0x3e0eea(0x2f4)+_0x3e0eea(0x99)]),_0x3f3b02[_0x3e0eea(0x2f4)+_0x3e0eea(0x99)]=_0x4d98c7[_0x3e0eea(0x2f4)][_0x3e0eea(0x2f4)+_0x3e0eea(0x99)],_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.(_0x3e0eea(0x2f4)+_0x3e0eea(0x80)+'\x20install'+_0x3e0eea(0x107)+'ed',{'openclawVersion':_0x3f3b02[_0x3e0eea(0x2f4)+_0x3e0eea(0x99)]});}}_0x3f3b02[_0x3e0eea(0x176)+_0x3e0eea(0x82)]=new Date()['toISOStr'+_0x3e0eea(0x15b)](),_0x3f3b02[_0x3e0eea(0x22f)+_0x3e0eea(0x26d)]=_0x4d98c7[_0x3e0eea(0x2f4)][_0x3e0eea(0x22f)+_0x3e0eea(0x26d)],_0x3f3b02['product']={'appId':_0x4d98c7[_0x3e0eea(0x1c9)],'productName':_0x4d98c7[_0x3e0eea(0x1fe)+_0x3e0eea(0x333)],'dataDirName':_0x4d98c7[_0x3e0eea(0x2fc)+_0x3e0eea(0x333)]},await patchChatHistoryMixedToolContentBug(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),await patchChatAttachmentBase64Runtime(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),await patchProviderRequestIdHeader(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),await patchCodexIsolatedAuthRuntime(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),await patchChannelPluginRuntimeBug(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),await patchWeixinOutboundFallbackRuntime(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),await patchQQBotOutboundFallbackRuntime(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4});const _0x12f8de=await loadProductRuntime(_0x4d98c7[_0x3e0eea(0x18c)+_0x3e0eea(0xa4)],_0x3d65c2);if(typeof _0x12f8de['prepareP'+_0x3e0eea(0x32d)+_0x3e0eea(0x254)]===_0x3e0eea(0x12d)){const _0x28fcb5=createRuntimeInfoFromManifest(_0x3d65c2,_0x3f3b02);await _0x12f8de[_0x3e0eea(0x249)+_0x3e0eea(0x32d)+_0x3e0eea(0x254)]({'shellConfig':_0x4d98c7,'runtime':_0x28fcb5,'runtimeLogger':_0xc9c5e4,'syncOnly':syncOnly}),_0xc9c5e4?.['importan'+'t']?.(_0x3e0eea(0x2ee)+'runtime\x20'+'tools\x20sy'+_0x3e0eea(0x123));}await patchSessionStoreSqliteRuntime(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),await patchRequestIdTitleRuntime(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4});!syncOnly&&(await installRuntimeLarkCliPackage(createRuntimeInfoFromManifest(_0x3d65c2,_0x3f3b02),{'runtimeLogger':_0xc9c5e4,'createRuntimeEnv':createRuntimeEnv}),_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.(_0x3e0eea(0x1b4)+_0x3e0eea(0x216)+_0x3e0eea(0x80)+_0x3e0eea(0x1b0)),await hasConfiguredKdocsSkill(_0x4d98c7)?(await installKdocsCliBinary(_0x4d98c7,createRuntimeInfoFromManifest(_0x3d65c2,_0x3f3b02),{'runtimeLogger':_0xc9c5e4,'syncOnly':syncOnly}),_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.(_0x3e0eea(0xbe)+'r\x20runtim'+_0x3e0eea(0x209)+_0x3e0eea(0x183))):_0xc9c5e4?.[_0x3e0eea(0x2da)](_0x3e0eea(0xbe)+_0x3e0eea(0x218)+'e\x20tools\x20'+_0x3e0eea(0x26c)+_0x3e0eea(0x11d)+_0x3e0eea(0x1d8)+_0x3e0eea(0x292)+_0x3e0eea(0x2fe)));const _0x2418b3=Array[_0x3e0eea(0x1e3)](_0x3f3b02[_0x3e0eea(0xec)])?_0x3f3b02['plugins'][_0x3e0eea(0x118)]:0x0;return await syncManifestPluginScope(_0x4d98c7,_0x3d65c2,_0x3f3b02),_0xc9c5e4?.['importan'+'t']?.('runtime\x20'+'plugin\x20s'+_0x3e0eea(0x157)+_0x3e0eea(0xc6),{'beforePluginCount':_0x2418b3,'afterPluginCount':Array['isArray'](_0x3f3b02['plugins'])?_0x3f3b02[_0x3e0eea(0xec)][_0x3e0eea(0x118)]:0x0,'pluginSpecCount':Array[_0x3e0eea(0x1e3)](_0x3f3b02[_0x3e0eea(0x27b)+_0x3e0eea(0x2ff)])?_0x3f3b02[_0x3e0eea(0x27b)+_0x3e0eea(0x2ff)][_0x3e0eea(0x118)]:0x0}),await syncConfiguredNpmPlugins(_0x4d98c7,_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4,'syncOnly':syncOnly}),_0xc9c5e4?.['importan'+'t']?.(_0x3e0eea(0x25e)+_0x3e0eea(0x2d6)+_0x3e0eea(0x137)+_0x3e0eea(0x232),{'pluginSpecCount':_0x4d98c7[_0x3e0eea(0x2f4)][_0x3e0eea(0x27b)+'ecs'][_0x3e0eea(0x118)],'pluginCount':Array['isArray'](_0x3f3b02[_0x3e0eea(0xec)])?_0x3f3b02[_0x3e0eea(0xec)][_0x3e0eea(0x118)]:0x0}),await patchWeixinOutboundSessionRoute(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),await patchQQBotOutboundSessionRoute(_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),await syncProductPlugins(_0x4d98c7,_0x3d65c2,_0x3f3b02,{'runtimeLogger':_0xc9c5e4}),_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.(_0x3e0eea(0x2ee)+_0x3e0eea(0x20d)+_0x3e0eea(0x183),{'localPluginCount':_0x4d98c7[_0x3e0eea(0x2f4)][_0x3e0eea(0x33b)+_0x3e0eea(0x84)+_0x3e0eea(0x138)]['length'],'pluginCount':Array[_0x3e0eea(0x1e3)](_0x3f3b02[_0x3e0eea(0xec)])?_0x3f3b02[_0x3e0eea(0xec)][_0x3e0eea(0x118)]:0x0}),await syncProductAgents(_0x4d98c7,_0x3d65c2,_0x3f3b02),_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.('product\x20'+_0x3e0eea(0x2e2)+_0x3e0eea(0x232),{'sources':_0x4d98c7[_0x3e0eea(0x2f4)][_0x3e0eea(0x33b)+'LocalAge'+_0x3e0eea(0xd6)],'entryCount':_0x3f3b02['agents']?.['entryCou'+'nt'],'installPath':_0x3f3b02[_0x3e0eea(0x23f)]?.['installP'+_0x3e0eea(0x2ae)]}),await syncProductSkills(_0x4d98c7,_0x3d65c2,_0x3f3b02),_0xc9c5e4?.['importan'+'t']?.(_0x3e0eea(0x2ee)+_0x3e0eea(0x2aa)+'ynced',{'sources':_0x4d98c7['openclaw']['resolved'+_0x3e0eea(0xd2)+_0x3e0eea(0x1a4)],'entryCount':_0x3f3b02[_0x3e0eea(0x1fd)]?.[_0x3e0eea(0x246)+'nt'],'installPath':_0x3f3b02[_0x3e0eea(0x1fd)]?.[_0x3e0eea(0x207)+_0x3e0eea(0x2ae)]}),await syncRuntimeWrapper(_0x4d98c7,_0x3d65c2,_0x3f3b02),_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.('runtime\x20'+'wrapper\x20'+_0x3e0eea(0x183),{'wujieclawBin':_0x3f3b02[_0x3e0eea(0xda)+_0x3e0eea(0x158)]}),await prunePackagedRuntimeCaches(_0x3d65c2,_0xc9c5e4),pruneForPackaging&&await prunePackagedRuntimePayload(_0x3d65c2,_0x3f3b02,_0xc9c5e4),await writeJson(resolveManifestPath(_0x3d65c2),_0x3f3b02),_0xc9c5e4?.[_0x3e0eea(0x1fa)+'t']?.('runtime\x20'+_0x3e0eea(0x2b3)+'\x20written',{'manifestPath':resolveManifestPath(_0x3d65c2),'manifest':summarizeRuntimeManifest(_0x3f3b02),'durationMs':Date[_0x3e0eea(0x32a)]()-_0x17789c}),await _0xc9c5e4?.['flush'](),_0x3f3b02;}catch(_0x490aaf){_0xc9c5e4?.['error'](_0x3e0eea(0x2a9)+_0x3e0eea(0x20e)+'failed',{'syncOnly':syncOnly,'runtimeRoot':_0x3d65c2,'durationMs':Date['now']()-_0x17789c,'error':_0x490aaf}),await _0xc9c5e4?.[_0x3e0eea(0x108)]();throw _0x490aaf;}}async function prunePackagedRuntimeCaches(_0x1eefc8,_0x219bde){const _0x4b49e2=_0x31e6db,_0x4c644b=[join(_0x1eefc8,_0x4b49e2(0x163)),join(_0x1eefc8,_0x4b49e2(0x164),_0x4b49e2(0x277)+'e'),join(_0x1eefc8,_0x4b49e2(0x177)+_0x4b49e2(0x309)+_0x4b49e2(0x171)),join(_0x1eefc8,_0x4b49e2(0x150)+_0x4b49e2(0x1ae)+_0x4b49e2(0xee))];for(const _0x50e4bd of _0x4c644b){if(!existsSync(_0x50e4bd))continue;await rm(_0x50e4bd,{'recursive':!![],'force':!![]}),_0x219bde?.[_0x4b49e2(0x2da)](_0x4b49e2(0x12b)+_0x4b49e2(0x1f9)+_0x4b49e2(0x264)+_0x4b49e2(0x2bf)+'aging',{'cachePath':_0x50e4bd});}}async function prunePackagedRuntimePayload(_0x4c3cf6,_0x536093,_0x356d60){const _0x4fe24f=_0x31e6db,_0x215b61=createRuntimeInfoFromManifest(_0x4c3cf6,_0x536093),_0x5623c5=[join(_0x4c3cf6,process['platform']===_0x4fe24f(0x21a)?_0x4fe24f(0x278)+_0x4fe24f(0x307)+_0x4fe24f(0xa3):_0x4fe24f(0xa7)+_0x4fe24f(0x1af)+_0x4fe24f(0x161)+'m'),join(_0x215b61[_0x4fe24f(0x2f4)+_0x4fe24f(0x294)+'ir'],_0x4fe24f(0xcf)+'ules')],_0x5860eb=join(_0x215b61['openclaw'+_0x4fe24f(0x294)+'ir'],_0x4fe24f(0xc7),'extensio'+'ns');if(existsSync(_0x5860eb))for(const _0x4fbc2a of await readdir(_0x5860eb,{'withFileTypes':!![]})){_0x4fbc2a[_0x4fe24f(0xe0)+'ory']()&&_0x5623c5['push'](join(_0x5860eb,_0x4fbc2a[_0x4fe24f(0x22a)],'node_mod'+_0x4fe24f(0x2af)));}const _0x86261d={'files':0x0,'directories':0x0,'bytes':0x0};for(const _0xd65e0a of _0x5623c5){await pruneRuntimeDependencyTree(_0xd65e0a,_0x86261d);}await pruneOpenClawDocs(_0x215b61['openclaw'+_0x4fe24f(0x294)+'ir'],_0x86261d),_0x356d60?.[_0x4fe24f(0x2da)]('pruned\x20r'+'untime\x20p'+_0x4fe24f(0x140)+_0x4fe24f(0x331)+'ckaging',_0x86261d);}async function pruneOpenClawDocs(_0x31be73,_0xd7c3f4){const _0x37d6fd=_0x31e6db,_0x2c484c=join(_0x31be73,_0x37d6fd(0x238));if(!existsSync(_0x2c484c))return;for(const _0x128836 of await readdir(_0x2c484c,{'withFileTypes':!![]})){if(_0x128836[_0x37d6fd(0x22a)]===_0x37d6fd(0x250)+'e')continue;await removePrunedPath(join(_0x2c484c,_0x128836['name']),_0xd7c3f4);}}async function pruneRuntimeDependencyTree(_0x520d63,_0x554e60){const _0x349269=_0x31e6db;if(!existsSync(_0x520d63))return;for(const _0x548d40 of await readdir(_0x520d63,{'withFileTypes':!![]})){const _0x4f99a0=join(_0x520d63,_0x548d40['name']);if(_0x548d40[_0x349269(0xe0)+'ory']()){if(shouldPruneRuntimeDirectory(_0x520d63,_0x548d40[_0x349269(0x22a)])){await removePrunedPath(_0x4f99a0,_0x554e60);continue;}await pruneRuntimeDependencyTree(_0x4f99a0,_0x554e60);continue;}_0x548d40[_0x349269(0x2e7)]()&&shouldPruneRuntimeFile(_0x548d40[_0x349269(0x22a)])&&await removePrunedPath(_0x4f99a0,_0x554e60);}}function shouldPruneRuntimeDirectory(_0x1f7fd9,_0x3f7c9e){const _0x53cd40=_0x31e6db;if(_0x3f7c9e==='@types')return!![];if(new Set([_0x53cd40(0x257),_0x53cd40(0x238),_0x53cd40(0x275)])[_0x53cd40(0x15f)](_0x3f7c9e))return existsSync(join(_0x1f7fd9,_0x53cd40(0x2b2)+'json'));return new Set([_0x53cd40(0x27e)+'_',_0x53cd40(0x1de),'examples',_0x53cd40(0x174),_0x53cd40(0x142)])[_0x53cd40(0x15f)](_0x3f7c9e);}function shouldPruneRuntimeFile(_0x409247){const _0xf38941=_0x31e6db;if(_0x409247==='package-'+_0xf38941(0x136)+'n'||_0x409247[_0xf38941(0x10c)](_0xf38941(0x17c)))return!![];return new Set(['.map','.md',_0xf38941(0x1d2)+'n'])[_0xf38941(0x15f)](extname(_0x409247)['toLowerC'+_0xf38941(0x284)]());}async function removePrunedPath(_0x39a621,_0x54e405){const _0x118382=_0x31e6db;if(!existsSync(_0x39a621))return;const _0x4df8a4=await getPathSize(_0x39a621),_0x10a051=await stat(_0x39a621);await rm(_0x39a621,{'recursive':!![],'force':!![]}),_0x54e405[_0x118382(0x1b7)]+=_0x4df8a4;if(_0x10a051[_0x118382(0xe0)+'ory']())_0x54e405[_0x118382(0xc9)+_0x118382(0x1c2)]+=0x1;else _0x54e405['files']+=0x1;}async function getPathSize(_0x3c04f6){const _0x3d14a2=_0x31e6db,_0x47bd6d=await stat(_0x3c04f6);if(!_0x47bd6d[_0x3d14a2(0xe0)+_0x3d14a2(0x306)]())return _0x47bd6d[_0x3d14a2(0x312)];let _0x450991=0x0;for(const _0x162043 of await readdir(_0x3c04f6,{'withFileTypes':!![]})){_0x450991+=await getPathSize(join(_0x3c04f6,_0x162043[_0x3d14a2(0x22a)]));}return _0x450991;}async function syncRuntimeWrapper(_0x4cd861,_0x100774,_0x3bacab){const _0x1390af=_0x31e6db,_0x4b1421=_0x4cd861[_0x1390af(0x2f4)]?.[_0x1390af(0xc8)+_0x1390af(0x2ca)]??_0x1390af(0x114)+_0x1390af(0x2e4),_0x583a62=join(_0x100774,_0x1390af(0x1a1),'wujiecla'+'w'),_0x5a2d18=join(_0x100774,_0x1390af(0x1a1),_0x1390af(0xda)+_0x1390af(0x8d)),_0x27c12a=normalizeRuntimeRelativePath(relative(dirname(_0x583a62),resolve(_0x100774,_0x3bacab[_0x1390af(0x288)+_0x1390af(0x32e)]))),_0x7baf18=normalizeRuntimeRelativePath(relative(dirname(_0x583a62),resolve(_0x100774,_0x3bacab[_0x1390af(0x2f4)+_0x1390af(0xa6)]))),_0x44f2c6='$HOME/'+_0x4cd861[_0x1390af(0x2fc)+_0x1390af(0x333)],_0x445aea='%USERPRO'+'FILE%\x5c'+_0x4cd861['dataDirN'+_0x1390af(0x333)];await mkdir(dirname(_0x583a62),{'recursive':!![]});const _0x59bcb3=fileURLToPath(new URL(_0x1390af(0xdc)+_0x1390af(0x27d)+'ie-logo.'+_0x1390af(0x1ee),import.meta.url)),_0x349ea3=join(_0x100774,_0x1390af(0x1a1),_0x1390af(0x124)+_0x1390af(0x2f2));await cp(_0x59bcb3,_0x349ea3),await writeFile(_0x583a62,[_0x1390af(0x13d)+'h','export\x20O'+_0x1390af(0x91)+_0x1390af(0x321)+_0x1390af(0x92)+_0x1390af(0x248)+_0x44f2c6+'}\x22',_0x1390af(0x196)+_0x1390af(0x91)+_0x1390af(0x2dc)+_0x1390af(0x1cd)+_0x1390af(0x29c)+_0x1390af(0x199)+'-'+_0x44f2c6+'}\x22','export\x20O'+_0x1390af(0x91)+_0x1390af(0x2be)+_0x1390af(0x1df)+'=\x22${OPEN'+_0x1390af(0x112)+'FIG_FILE'+_0x1390af(0x12f)+_0x4b1421+'}\x22',_0x1390af(0x196)+'PENCLAW_'+_0x1390af(0x9d)+_0x1390af(0x135)+'PENCLAW_'+'CONFIG_P'+_0x1390af(0x334)+_0x44f2c6+'/'+_0x4b1421+'}\x22','SCRIPT_D'+_0x1390af(0x95)+_0x1390af(0x15d)+_0x1390af(0x1b6)+'rname\x20--'+_0x1390af(0x1e0)+_0x1390af(0x2de),_0x1390af(0x18a)+_0x1390af(0xfa)+_0x1390af(0x1e2)+'R/'+_0x27c12a+'\x22','if\x20[\x20-t\x20'+_0x1390af(0xcb)+_0x1390af(0xc5)+'JIE_NO_L'+'OGO\x22\x20];\x20'+_0x1390af(0x113),_0x1390af(0x134)+'IME_NODE'+_0x1390af(0x253)+_0x1390af(0x2ed)+_0x1390af(0x317)+_0x1390af(0x146)+_0x1390af(0x175)+'ll\x20||\x20tr'+'ue','fi','exec\x20\x22$R'+_0x1390af(0xf0)+_0x1390af(0xad)+_0x1390af(0x1e2)+'R/'+_0x7baf18+_0x1390af(0xd3),''][_0x1390af(0x89)]('\x0a'),'utf8'),await chmod(_0x583a62,0x1ed),await writeFile(_0x5a2d18,[_0x1390af(0x12e)+'f',_0x1390af(0x190)+_0x1390af(0x24a)+_0x1390af(0x21e)+_0x1390af(0x2a6)+_0x1390af(0xa1)+_0x1390af(0x327)+_0x445aea+'\x22',_0x1390af(0x190)+_0x1390af(0x29c)+'ATE_DIR%'+_0x1390af(0x1db)+'t\x20\x22OPENC'+_0x1390af(0x19d)+'E_DIR='+_0x445aea+'\x22',_0x1390af(0x190)+'NCLAW_CO'+_0x1390af(0x20b)+_0x1390af(0x298)+_0x1390af(0x1be)+_0x1390af(0x222)+_0x1390af(0x225)+_0x1390af(0xdb)+_0x1390af(0x1b9)+_0x4b1421+'\x22','if\x20\x22%OPE'+_0x1390af(0x31c)+_0x1390af(0x329)+_0x1390af(0x301)+_0x1390af(0x1c5)+'NCLAW_CO'+'NFIG_PAT'+'H='+_0x445aea+'\x5c'+_0x4b1421+'\x22',_0x1390af(0x239)+_0x1390af(0x2d3)+'%~dp0\x22','set\x20\x22RUN'+_0x1390af(0x1d6)+'E=%SCRIP'+_0x1390af(0x2a7)+toWindowsPath(_0x27c12a)+'\x22','\x22%RUNTIM'+'E_NODE%\x22'+_0x1390af(0xd4)+'T_DIR%'+toWindowsPath(_0x7baf18)+_0x1390af(0x2bd),''][_0x1390af(0x89)]('\x0d\x0a'),'utf8'),_0x3bacab[_0x1390af(0xda)+_0x1390af(0x158)]=toRuntimeRelative(_0x100774,process[_0x1390af(0x2fa)]===_0x1390af(0x21a)?_0x5a2d18:_0x583a62);}async function patchChatHistoryMixedToolContentBug(_0x10f03b,_0x20b539,_0x25fafa={}){const _0x482379=_0x31e6db,_0x475346=resolve(_0x10f03b,_0x20b539[_0x482379(0x2f4)+_0x482379(0x294)+'ir']),_0x6d7441=join(_0x475346,_0x482379(0xc7));let _0x3fa49a=[];try{_0x3fa49a=await readdir(_0x6d7441,{'withFileTypes':!![]});}catch{_0x25fafa[_0x482379(0xf8)+'ogger']?.[_0x482379(0x7f)]?.(_0x482379(0x17d)+'tory\x20mix'+_0x482379(0x162)+'patch\x20sk'+_0x482379(0x2b9)+'ist\x20not\x20'+_0x482379(0xb0),{'distDir':_0x6d7441,'openclawVersion':_0x20b539[_0x482379(0x2f4)+_0x482379(0x99)]});return;}const _0x236e9e=_0x3fa49a[_0x482379(0x132)](_0x12f9f2=>_0x12f9f2[_0x482379(0x2e7)]()&&(_0x12f9f2[_0x482379(0x22a)][_0x482379(0x28d)+'th']('chat-dis'+_0x482379(0xae)+_0x482379(0xcc))||_0x12f9f2['name'][_0x482379(0x28d)+'th'](_0x482379(0x206)+_0x482379(0x2d8)+'pt-path-'))&&_0x12f9f2[_0x482379(0x22a)][_0x482379(0x10c)](_0x482379(0x1a7)))['map'](_0x4e70fc=>join(_0x6d7441,_0x4e70fc[_0x482379(0x22a)]));if(_0x236e9e[_0x482379(0x118)]===0x0){_0x25fafa[_0x482379(0xf8)+_0x482379(0x318)]?.[_0x482379(0x7f)]?.('chat\x20his'+'tory\x20mix'+_0x482379(0x162)+_0x482379(0x1ef)+_0x482379(0x25d)+_0x482379(0x189)+_0x482379(0xb0),{'openclawVersion':_0x20b539[_0x482379(0x2f4)+_0x482379(0x99)]});return;}for(const _0x270c37 of _0x236e9e){const _0x283964=await readFile(_0x270c37,_0x482379(0x1b8)),_0x15064e=patchMixedToolContentFromSource(_0x283964);if(!_0x15064e[_0x482379(0x1d5)]){if(_0x15064e[_0x482379(0x15c)]===_0x482379(0x111)+_0x482379(0x1d5)){_0x25fafa[_0x482379(0xf8)+_0x482379(0x318)]?.[_0x482379(0x2da)]?.(_0x482379(0x17d)+_0x482379(0x2df)+_0x482379(0x162)+_0x482379(0x2a5)+'ready\x20ap'+'plied',{'openclawVersion':_0x20b539[_0x482379(0x2f4)+'Version'],'filePath':_0x270c37});return;}continue;}await writeFile(_0x270c37,_0x15064e['source'],'utf8'),_0x25fafa[_0x482379(0xf8)+'ogger']?.[_0x482379(0x2da)]?.(_0x482379(0x17d)+_0x482379(0x2df)+'ed-tool\x20'+_0x482379(0x290)+_0x482379(0x1f0),{'openclawVersion':_0x20b539[_0x482379(0x2f4)+_0x482379(0x99)],'filePath':_0x270c37,'note':_0x482379(0xed)+'y\x20compat'+_0x482379(0x1a9)+_0x482379(0x127)+_0x482379(0x2ab)+_0x482379(0x287)+_0x482379(0x2f8)+'tool\x20his'+_0x482379(0x22b)+_0x482379(0x200)+_0x482379(0x30b)+_0x482379(0x325)+'ream\x20fix'+_0x482379(0x194)+'re\x20upgra'+_0x482379(0x268)});return;}_0x25fafa[_0x482379(0xf8)+_0x482379(0x318)]?.[_0x482379(0x7f)]?.(_0x482379(0x17d)+_0x482379(0x2df)+_0x482379(0x162)+_0x482379(0x1ef)+'ipped;\x20f'+_0x482379(0x1b2)+_0x482379(0xf2)+'d',{'openclawVersion':_0x20b539[_0x482379(0x2f4)+_0x482379(0x99)]});}async function patchChatAttachmentBase64Runtime(_0x208606,_0x563445,_0x5c36e7={}){const _0xb0fc7b=_0x31e6db,_0x3f6aa8=resolve(_0x208606,_0x563445[_0xb0fc7b(0x2f4)+'WorkingD'+'ir']),_0x22730d=join(_0x3f6aa8,_0xb0fc7b(0xc7));let _0x2d6645=[];try{_0x2d6645=await readdir(_0x22730d,{'withFileTypes':!![]});}catch{_0x5c36e7[_0xb0fc7b(0xf8)+_0xb0fc7b(0x318)]?.['warn']?.(_0xb0fc7b(0x1a0)+'achment\x20'+_0xb0fc7b(0x242)+_0xb0fc7b(0x98)+_0xb0fc7b(0x2ef)+_0xb0fc7b(0x131)+_0xb0fc7b(0x2d7),{'distDir':_0x22730d,'openclawVersion':_0x563445[_0xb0fc7b(0x2f4)+_0xb0fc7b(0x99)]});return;}const _0x39bb4e=_0x2d6645[_0xb0fc7b(0x132)](_0x2ceb3c=>_0x2ceb3c[_0xb0fc7b(0x2e7)]()&&_0x2ceb3c[_0xb0fc7b(0x22a)][_0xb0fc7b(0x28d)+'th']('attachme'+_0xb0fc7b(0x19f)+_0xb0fc7b(0x18f))&&_0x2ceb3c[_0xb0fc7b(0x22a)][_0xb0fc7b(0x10c)]('.js'))[_0xb0fc7b(0x1e7)](_0x4ff9c5=>join(_0x22730d,_0x4ff9c5['name']));if(_0x39bb4e['length']===0x0){_0x5c36e7[_0xb0fc7b(0xf8)+'ogger']?.['warn']?.('chat\x20att'+'achment\x20'+'base64\x20p'+'atch\x20ski'+'pped;\x20fi'+_0xb0fc7b(0x26f)+_0xb0fc7b(0x2d7),{'openclawVersion':_0x563445['openclaw'+_0xb0fc7b(0x99)]});return;}for(const _0x1d1fa6 of _0x39bb4e){const _0x5bd375=await readFile(_0x1d1fa6,_0xb0fc7b(0x1b8)),_0x10ab88=patchChatAttachmentBase64FromSource(_0x5bd375);if(!_0x10ab88[_0xb0fc7b(0x1d5)]){if(_0x10ab88[_0xb0fc7b(0x15c)]==='already-'+_0xb0fc7b(0x1d5)){_0x5c36e7[_0xb0fc7b(0xf8)+'ogger']?.[_0xb0fc7b(0x2da)]?.(_0xb0fc7b(0x1a0)+_0xb0fc7b(0x304)+'base64\x20p'+_0xb0fc7b(0x210)+_0xb0fc7b(0x2b1)+_0xb0fc7b(0x10f),{'openclawVersion':_0x563445[_0xb0fc7b(0x2f4)+'Version'],'filePath':_0x1d1fa6});return;}continue;}await writeFile(_0x1d1fa6,_0x10ab88[_0xb0fc7b(0x215)],_0xb0fc7b(0x1b8)),_0x5c36e7[_0xb0fc7b(0xf8)+'ogger']?.[_0xb0fc7b(0x2da)]?.('chat\x20att'+_0xb0fc7b(0x304)+_0xb0fc7b(0x242)+_0xb0fc7b(0x18e)+_0xb0fc7b(0x10f),{'openclawVersion':_0x563445[_0xb0fc7b(0x2f4)+_0xb0fc7b(0x99)],'filePath':_0x1d1fa6,'note':_0xb0fc7b(0xed)+_0xb0fc7b(0xd7)+_0xb0fc7b(0x1a9)+'patch\x20fo'+_0xb0fc7b(0x2ab)+_0xb0fc7b(0x287)+'6\x20chat.s'+'end\x20atta'+'chment\x20b'+_0xb0fc7b(0x2fb)+_0xb0fc7b(0x11a)+_0xb0fc7b(0x2e0)+_0xb0fc7b(0xf1)+_0xb0fc7b(0x23a)+_0xb0fc7b(0x1f1)+_0xb0fc7b(0xb2)+_0xb0fc7b(0x15a)});return;}_0x5c36e7[_0xb0fc7b(0xf8)+_0xb0fc7b(0x318)]?.[_0xb0fc7b(0x7f)]?.(_0xb0fc7b(0x1a0)+'achment\x20'+_0xb0fc7b(0x242)+'atch\x20ski'+_0xb0fc7b(0xca)+_0xb0fc7b(0x25a)+_0xb0fc7b(0x33d),{'openclawVersion':_0x563445[_0xb0fc7b(0x2f4)+_0xb0fc7b(0x99)]});}async function patchProviderRequestIdHeader(_0x57f5ca,_0x27df86,_0xcba21e={}){const _0x3cde88=_0x31e6db,_0x1751c9=resolve(_0x57f5ca,_0x27df86[_0x3cde88(0x2f4)+_0x3cde88(0x294)+'ir']),_0x4ea96f=join(_0x1751c9,_0x3cde88(0xc7));let _0x34cac9=[];try{_0x34cac9=await readdir(_0x4ea96f,{'withFileTypes':!![]});}catch{_0xcba21e[_0x3cde88(0xf8)+'ogger']?.['warn']?.(_0x3cde88(0x1ec)+_0x3cde88(0x221)+'-id\x20head'+'er\x20patch'+_0x3cde88(0x2ad)+_0x3cde88(0x2ac)+'ot\x20found',{'distDir':_0x4ea96f,'openclawVersion':_0x27df86[_0x3cde88(0x2f4)+_0x3cde88(0x99)]});return;}const _0x5dd11f=_0x34cac9['filter'](_0x507b8a=>_0x507b8a[_0x3cde88(0x2e7)]()&&_0x507b8a[_0x3cde88(0x22a)][_0x3cde88(0x10c)]('.js'))['map'](_0x476780=>join(_0x4ea96f,_0x476780[_0x3cde88(0x22a)]));let _0x294342=0x0,_0x52aea3=0x0;for(const _0x1f8bbb of _0x5dd11f){const _0x2e40ab=await readFile(_0x1f8bbb,'utf8'),_0x5d09e1=patchProviderRequestIdHeaderFromSource(_0x2e40ab);if(_0x5d09e1[_0x3cde88(0x1d5)]){await writeFile(_0x1f8bbb,_0x5d09e1['source'],'utf8'),_0x294342+=0x1,_0xcba21e[_0x3cde88(0xf8)+_0x3cde88(0x318)]?.[_0x3cde88(0x2da)]?.(_0x3cde88(0x1ec)+_0x3cde88(0x221)+_0x3cde88(0x2bb)+'er\x20patch'+_0x3cde88(0x8e),{'openclawVersion':_0x27df86[_0x3cde88(0x2f4)+'Version'],'filePath':_0x1f8bbb});continue;}if(_0x5d09e1['reason']===_0x3cde88(0x111)+_0x3cde88(0x1d5))_0x52aea3+=0x1;}if(_0x294342>0x0){_0xcba21e[_0x3cde88(0xf8)+'ogger']?.['info']?.(_0x3cde88(0x1ec)+'\x20request'+'-id\x20head'+_0x3cde88(0x2c2)+_0x3cde88(0x30e),{'openclawVersion':_0x27df86[_0x3cde88(0x2f4)+_0x3cde88(0x99)],'patchedCount':_0x294342,'alreadyPatchedCount':_0x52aea3});return;}if(_0x52aea3>0x0){_0xcba21e['runtimeL'+_0x3cde88(0x318)]?.[_0x3cde88(0x2da)]?.(_0x3cde88(0x1ec)+_0x3cde88(0x221)+_0x3cde88(0x2bb)+_0x3cde88(0x2c2)+'\x20already'+_0x3cde88(0x8e),{'openclawVersion':_0x27df86['openclaw'+'Version'],'alreadyPatchedCount':_0x52aea3});return;}_0xcba21e[_0x3cde88(0xf8)+_0x3cde88(0x318)]?.[_0x3cde88(0x7f)]?.('provider'+'\x20request'+_0x3cde88(0x2bb)+'er\x20patch'+_0x3cde88(0x2ad)+';\x20provid'+_0x3cde88(0xb9)+_0x3cde88(0xf5)+_0x3cde88(0x2cc)+'nd',{'openclawVersion':_0x27df86[_0x3cde88(0x2f4)+_0x3cde88(0x99)]});}async function patchCodexIsolatedAuthRuntime(_0x18dd45,_0x30caf7,_0x3e7e96={}){const _0x40bfcc=_0x31e6db,_0x2c7a69=resolve(_0x18dd45,_0x30caf7['openclaw'+'WorkingD'+'ir']),_0x1d569c=[join(_0x2c7a69,_0x40bfcc(0xc7)),join(_0x2c7a69,_0x40bfcc(0xc7),'extensio'+'ns',_0x40bfcc(0x1a5),_0x40bfcc(0xc7))],_0x30edb9=[];for(const _0x3433c0 of _0x1d569c){const _0x171b00=await readdir(_0x3433c0,{'withFileTypes':!![]})[_0x40bfcc(0x24e)](()=>[]);for(const _0x243e14 of _0x171b00){_0x243e14[_0x40bfcc(0x2e7)]()&&_0x243e14[_0x40bfcc(0x22a)]['startsWi'+'th'](_0x40bfcc(0x97)+_0x40bfcc(0x10e))&&_0x243e14[_0x40bfcc(0x22a)][_0x40bfcc(0x10c)](_0x40bfcc(0x1a7))&&_0x30edb9[_0x40bfcc(0xdf)](join(_0x3433c0,_0x243e14['name']));}}let _0x3a21b8=0x0,_0x39225d=0x0;for(const _0x342792 of _0x30edb9){const _0x115783=await readFile(_0x342792,_0x40bfcc(0x1b8)),_0x2b0702=patchCodexIsolatedAuthFromSource(_0x115783);if(_0x2b0702[_0x40bfcc(0x1d5)]){await writeFile(_0x342792,_0x2b0702[_0x40bfcc(0x215)],_0x40bfcc(0x1b8)),_0x3a21b8+=0x1,_0x3e7e96[_0x40bfcc(0xf8)+_0x40bfcc(0x318)]?.['info']?.(_0x40bfcc(0x29a)+'olated\x20a'+_0x40bfcc(0x213)+'h\x20applie'+'d',{'openclawVersion':_0x30caf7[_0x40bfcc(0x2f4)+_0x40bfcc(0x99)],'filePath':_0x342792});continue;}if(_0x2b0702[_0x40bfcc(0x15c)]===_0x40bfcc(0x111)+_0x40bfcc(0x1d5))_0x39225d+=0x1;}if(_0x3a21b8>0x0||_0x39225d>0x0){_0x3e7e96['runtimeL'+'ogger']?.[_0x40bfcc(0x2da)]?.('codex\x20is'+'olated\x20a'+_0x40bfcc(0x213)+_0x40bfcc(0x85)+'y',{'openclawVersion':_0x30caf7[_0x40bfcc(0x2f4)+_0x40bfcc(0x99)],'patchedCount':_0x3a21b8,'alreadyPatchedCount':_0x39225d});return;}_0x3e7e96[_0x40bfcc(0xf8)+'ogger']?.[_0x40bfcc(0x7f)]?.('codex\x20is'+_0x40bfcc(0x2ba)+_0x40bfcc(0x213)+'h\x20skippe'+'d;\x20share'+'d\x20client'+_0x40bfcc(0x1cf)+_0x40bfcc(0x2c7)+'found',{'openclawVersion':_0x30caf7['openclaw'+_0x40bfcc(0x99)],'candidateFiles':_0x30edb9});}async function patchChannelPluginRuntimeBug(_0x16a273,_0x4708e0,_0x13cb6e={}){const _0x54794c=_0x31e6db,_0x19526a=resolve(_0x16a273,_0x4708e0[_0x54794c(0x2f4)+_0x54794c(0x294)+'ir']),_0x5c37db=join(_0x19526a,'dist');let _0x34d01a=[];try{_0x34d01a=await readdir(_0x5c37db,{'withFileTypes':!![]});}catch{_0x13cb6e[_0x54794c(0xf8)+'ogger']?.[_0x54794c(0x7f)]?.('channel\x20'+_0x54794c(0x2db)+_0x54794c(0x1a2)+_0x54794c(0x98)+_0x54794c(0x2ef)+_0x54794c(0x131)+_0x54794c(0x2d7),{'distDir':_0x5c37db,'openclawVersion':_0x4708e0[_0x54794c(0x2f4)+_0x54794c(0x99)]});return;}const _0xb27737=_0x34d01a[_0x54794c(0x132)](_0x392e2d=>_0x392e2d[_0x54794c(0x2e7)]()&&_0x392e2d['name'][_0x54794c(0x28d)+'th'](_0x54794c(0xfc))&&_0x392e2d[_0x54794c(0x22a)][_0x54794c(0x10c)](_0x54794c(0x1a7)))[_0x54794c(0x1e7)](_0x136ce5=>join(_0x5c37db,_0x136ce5[_0x54794c(0x22a)])),_0x5a0266=await resolveRuntimeChannelImportPath(_0x5c37db,_0x34d01a);if(_0xb27737[_0x54794c(0x118)]===0x0){_0x13cb6e[_0x54794c(0xf8)+_0x54794c(0x318)]?.['warn']?.(_0x54794c(0xfe)+'plugin\x20r'+'untime\x20p'+_0x54794c(0x98)+'pped;\x20lo'+_0x54794c(0xba)+_0x54794c(0x1b5),{'openclawVersion':_0x4708e0[_0x54794c(0x2f4)+'Version']});return;}if(!_0x5a0266){_0x13cb6e[_0x54794c(0xf8)+_0x54794c(0x318)]?.[_0x54794c(0x7f)]?.(_0x54794c(0xfe)+'plugin\x20r'+_0x54794c(0x1a2)+_0x54794c(0x98)+_0x54794c(0x2c6)+_0x54794c(0x1fb)+'annel\x20en'+_0x54794c(0x241)+_0x54794c(0xb0),{'openclawVersion':_0x4708e0['openclaw'+_0x54794c(0x99)],'distDir':_0x5c37db});return;}for(const _0x1d84f0 of _0xb27737){const _0x3ab6ab=await readFile(_0x1d84f0,_0x54794c(0x1b8)),_0x239c2f=patchChannelPluginRuntimeFromSource(_0x3ab6ab,{'runtimeChannelImportPath':_0x5a0266});if(!_0x239c2f[_0x54794c(0x1d5)]){if(_0x239c2f[_0x54794c(0x15c)]===_0x54794c(0x111)+_0x54794c(0x1d5)){_0x13cb6e[_0x54794c(0xf8)+_0x54794c(0x318)]?.['info']?.('channel\x20'+'plugin\x20r'+_0x54794c(0x1a2)+_0x54794c(0x210)+_0x54794c(0x2b1)+_0x54794c(0x10f),{'openclawVersion':_0x4708e0['openclaw'+_0x54794c(0x99)],'filePath':_0x1d84f0});return;}continue;}await writeFile(_0x1d84f0,_0x239c2f['source'],_0x54794c(0x1b8)),_0x13cb6e[_0x54794c(0xf8)+'ogger']?.[_0x54794c(0x2da)]?.(_0x54794c(0xfe)+_0x54794c(0x2db)+'untime\x20p'+_0x54794c(0x18e)+_0x54794c(0x10f),{'openclawVersion':_0x4708e0[_0x54794c(0x2f4)+'Version'],'filePath':_0x1d84f0,'note':_0x54794c(0xed)+_0x54794c(0xd7)+_0x54794c(0x1a9)+_0x54794c(0x127)+_0x54794c(0x2ab)+_0x54794c(0x287)+_0x54794c(0xfb)+_0x54794c(0x155)+'in\x20runti'+_0x54794c(0x12a)+'ng\x20chann'+_0x54794c(0xde)+'nd\x20helpe'+_0x54794c(0x32f)+'fy\x20upstr'+_0x54794c(0x313)+_0x54794c(0x2cd)+_0x54794c(0x20c)+_0x54794c(0x28b)});return;}_0x13cb6e[_0x54794c(0xf8)+_0x54794c(0x318)]?.[_0x54794c(0x7f)]?.(_0x54794c(0xfe)+'plugin\x20r'+_0x54794c(0x1a2)+_0x54794c(0x98)+_0x54794c(0x2c6)+'ntime\x20re'+'solver\x20n'+_0x54794c(0x33d),{'openclawVersion':_0x4708e0[_0x54794c(0x2f4)+_0x54794c(0x99)]});}async function patchSessionStoreSqliteRuntime(_0x4a963a,_0x1e3c0c,_0x1d6074={}){const _0x2d23c4=_0x31e6db,_0xa0862b=resolve(_0x4a963a,_0x1e3c0c[_0x2d23c4(0x2f4)+'WorkingD'+'ir']),_0x5d52da=join(_0xa0862b,_0x2d23c4(0xc7)),_0xe22a78=_0x2d23c4(0x237)+'ell-runt'+_0x2d23c4(0x14a)+_0x2d23c4(0xaa)+'time-bri'+_0x2d23c4(0x28c),_0x22e36e=join(_0x4a963a,_0x2d23c4(0x22e)+_0x2d23c4(0x254),_0x2d23c4(0x240),_0x2d23c4(0x219)+'bridge.m'+'js'),_0x22f68a=(await readdir(_0x5d52da,{'withFileTypes':!![]})[_0x2d23c4(0x24e)](()=>[]))['filter'](_0x5d9930=>_0x5d9930[_0x2d23c4(0x2e7)]()&&_0x5d9930[_0x2d23c4(0x22a)]['startsWi'+'th'](_0x2d23c4(0x25f)+_0x2d23c4(0x227))&&_0x5d9930[_0x2d23c4(0x22a)][_0x2d23c4(0x10c)](_0x2d23c4(0x1a7)))['map'](_0x434c0f=>join(_0x5d52da,_0x434c0f[_0x2d23c4(0x22a)])),_0x5476d9=(await readdir(_0x5d52da,{'withFileTypes':!![]})[_0x2d23c4(0x24e)](()=>[]))['filter'](_0x4c853f=>_0x4c853f[_0x2d23c4(0x2e7)]()&&_0x4c853f[_0x2d23c4(0x22a)][_0x2d23c4(0x28d)+'th']('store-')&&!_0x4c853f[_0x2d23c4(0x22a)][_0x2d23c4(0x28d)+'th'](_0x2d23c4(0x25f)+_0x2d23c4(0x227))&&_0x4c853f['name'][_0x2d23c4(0x10c)]('.js'))['map'](_0x3a2ce1=>join(_0x5d52da,_0x3a2ce1[_0x2d23c4(0x22a)]));if(!existsSync(_0x22e36e)){_0x1d6074['runtimeL'+_0x2d23c4(0x318)]?.['info']?.(_0x2d23c4(0x2e6)+_0x2d23c4(0x23c)+_0x2d23c4(0x21c)+_0x2d23c4(0x160)+_0x2d23c4(0xfd)+_0x2d23c4(0x9e)+_0x2d23c4(0x2c9),{'bridgePath':_0x22e36e,'openclawVersion':_0x1e3c0c[_0x2d23c4(0x2f4)+_0x2d23c4(0x99)]});return;}for(const _0x3adf51 of _0x22f68a){const _0x5d94c7=await readFile(_0x3adf51,_0x2d23c4(0x1b8)),_0x25f368=patchSessionStoreLoadFromSource(_0x5d94c7,{'bridgeImportPath':_0xe22a78});if(!_0x25f368[_0x2d23c4(0x1d5)]){if(_0x25f368['reason']==='already-'+_0x2d23c4(0x1d5)){_0x1d6074[_0x2d23c4(0xf8)+'ogger']?.[_0x2d23c4(0x2da)]?.(_0x2d23c4(0x2e6)+_0x2d23c4(0xc4)+_0x2d23c4(0x33c)+_0x2d23c4(0x13e)+_0x2d23c4(0x8e),{'filePath':_0x3adf51,'openclawVersion':_0x1e3c0c['openclaw'+'Version']});break;}continue;}await writeFile(_0x3adf51,_0x25f368[_0x2d23c4(0x215)],_0x2d23c4(0x1b8)),_0x1d6074[_0x2d23c4(0xf8)+_0x2d23c4(0x318)]?.['info']?.('session\x20'+_0x2d23c4(0xc4)+_0x2d23c4(0x33c)+_0x2d23c4(0x8e),{'filePath':_0x3adf51,'openclawVersion':_0x1e3c0c[_0x2d23c4(0x2f4)+_0x2d23c4(0x99)]});break;}for(const _0x142d0d of _0x5476d9){const _0x5b37fe=await readFile(_0x142d0d,_0x2d23c4(0x1b8)),_0x25d2a8=patchSessionStoreWriteFromSource(_0x5b37fe,{'bridgeImportPath':_0xe22a78});if(!_0x25d2a8[_0x2d23c4(0x1d5)]){if(_0x25d2a8[_0x2d23c4(0x15c)]===_0x2d23c4(0x111)+_0x2d23c4(0x1d5)){_0x1d6074[_0x2d23c4(0xf8)+_0x2d23c4(0x318)]?.[_0x2d23c4(0x2da)]?.('session\x20'+_0x2d23c4(0x26a)+'ite\x20patc'+_0x2d23c4(0x19e)+_0x2d23c4(0x2e1)+'d',{'filePath':_0x142d0d,'openclawVersion':_0x1e3c0c[_0x2d23c4(0x2f4)+_0x2d23c4(0x99)]});break;}continue;}await writeFile(_0x142d0d,_0x25d2a8[_0x2d23c4(0x215)],_0x2d23c4(0x1b8)),_0x1d6074[_0x2d23c4(0xf8)+_0x2d23c4(0x318)]?.[_0x2d23c4(0x2da)]?.(_0x2d23c4(0x2e6)+_0x2d23c4(0x26a)+_0x2d23c4(0xb7)+_0x2d23c4(0x9c)+'d',{'filePath':_0x142d0d,'openclawVersion':_0x1e3c0c[_0x2d23c4(0x2f4)+_0x2d23c4(0x99)]});break;}}async function patchWeixinOutboundSessionRoute(_0x2c6c07,_0x5d4444,_0x14226f={}){const _0x25ea51=_0x31e6db,_0x57521f=join(_0x2c6c07,_0x25ea51(0x2f4),_0x25ea51(0xc7),'extensio'+'ns',_0x25ea51(0x2f4)+_0x25ea51(0x18b),_0x25ea51(0xc7),'src',_0x25ea51(0xf9)+'js');if(!existsSync(_0x57521f)){_0x14226f['runtimeL'+_0x25ea51(0x318)]?.[_0x25ea51(0x2da)]?.(_0x25ea51(0x81)+_0x25ea51(0x2b0)+_0x25ea51(0x2e6)+'route\x20pa'+'tch\x20skip'+_0x25ea51(0x339)+'gin\x20not\x20'+_0x25ea51(0x169)+'d',{'openclawVersion':_0x5d4444[_0x25ea51(0x2f4)+_0x25ea51(0x99)],'filePath':_0x57521f});return;}const _0x59f65a=await readFile(_0x57521f,_0x25ea51(0x1b8)),_0x29d047=patchWeixinOutboundSessionRouteFromSource(_0x59f65a);if(!_0x29d047[_0x25ea51(0x1d5)]){if(_0x29d047[_0x25ea51(0x15c)]===_0x25ea51(0x111)+_0x25ea51(0x1d5)){_0x14226f['runtimeL'+_0x25ea51(0x318)]?.[_0x25ea51(0x2da)]?.(_0x25ea51(0x81)+_0x25ea51(0x2b0)+_0x25ea51(0x2e6)+_0x25ea51(0x1ab)+_0x25ea51(0xc3)+_0x25ea51(0x2d2)+'ied',{'openclawVersion':_0x5d4444['openclaw'+_0x25ea51(0x99)],'filePath':_0x57521f});return;}_0x14226f[_0x25ea51(0xf8)+_0x25ea51(0x318)]?.[_0x25ea51(0x7f)]?.('weixin\x20o'+_0x25ea51(0x2b0)+_0x25ea51(0x2e6)+_0x25ea51(0x1ab)+_0x25ea51(0x202)+'ped;\x20cha'+'nnel\x20sha'+'pe\x20not\x20f'+'ound',{'openclawVersion':_0x5d4444[_0x25ea51(0x2f4)+_0x25ea51(0x99)],'filePath':_0x57521f,'reason':_0x29d047[_0x25ea51(0x15c)]});return;}await writeFile(_0x57521f,_0x29d047[_0x25ea51(0x215)],_0x25ea51(0x1b8)),_0x14226f[_0x25ea51(0xf8)+'ogger']?.['info']?.(_0x25ea51(0x81)+_0x25ea51(0x2b0)+_0x25ea51(0x2e6)+_0x25ea51(0x1ab)+_0x25ea51(0x323)+_0x25ea51(0x83),{'openclawVersion':_0x5d4444['openclaw'+_0x25ea51(0x99)],'filePath':_0x57521f,'note':_0x25ea51(0xed)+'y\x20compat'+_0x25ea51(0x1a9)+'patch\x20fo'+_0x25ea51(0x104)+'nt-weixi'+'n/opencl'+'aw-weixi'+_0x25ea51(0x245)+_0x25ea51(0x265)+'ery\x20mirr'+_0x25ea51(0x121)+_0x25ea51(0x115)+'d\x20as\x20gro'+_0x25ea51(0x8a)+_0x25ea51(0x223)+_0x25ea51(0x325)+_0x25ea51(0x191)+_0x25ea51(0x194)+'re\x20upgra'+_0x25ea51(0x268)});}async function patchWeixinOutboundFallbackRuntime(_0x4e3368,_0x5e077e,_0x2f3a7d={}){const _0x2b75c7=_0x31e6db,_0x4c7567=resolve(_0x4e3368,_0x5e077e['openclaw'+'WorkingD'+'ir']),_0x2b1f90=join(_0x4c7567,'dist'),_0x3805cf=(await readdir(_0x2b1f90,{'withFileTypes':!![]})[_0x2b75c7(0x24e)](()=>[]))[_0x2b75c7(0x132)](_0x1f1d84=>_0x1f1d84[_0x2b75c7(0x2e7)]()&&_0x1f1d84[_0x2b75c7(0x22a)][_0x2b75c7(0x28d)+'th'](_0x2b75c7(0x28a)+_0x2b75c7(0x10b)+'-')&&_0x1f1d84[_0x2b75c7(0x22a)][_0x2b75c7(0x10c)](_0x2b75c7(0x1a7)))[_0x2b75c7(0x1e7)](_0x1cdd82=>join(_0x2b1f90,_0x1cdd82[_0x2b75c7(0x22a)]));if(_0x3805cf['length']===0x0){_0x2f3a7d['runtimeL'+_0x2b75c7(0x318)]?.[_0x2b75c7(0x7f)]?.('weixin\x20o'+'utbound\x20'+_0x2b75c7(0x198)+_0x2b75c7(0x33a)+_0x2b75c7(0x2f0)+_0x2b75c7(0x28a)+_0x2b75c7(0x216)+_0x2b75c7(0x2cc)+'nd',{'openclawVersion':_0x5e077e[_0x2b75c7(0x2f4)+'Version'],'distDir':_0x2b1f90});return;}for(const _0x5b6b06 of _0x3805cf){const _0x564bbb=await readFile(_0x5b6b06,_0x2b75c7(0x1b8)),_0x536454=patchWeixinOutboundFallbackFromSource(_0x564bbb);if(!_0x536454[_0x2b75c7(0x1d5)]){if(_0x536454['reason']==='already-'+_0x2b75c7(0x1d5)){_0x2f3a7d['runtimeL'+_0x2b75c7(0x318)]?.[_0x2b75c7(0x2da)]?.(_0x2b75c7(0x81)+_0x2b75c7(0x2b0)+_0x2b75c7(0x198)+_0x2b75c7(0x1bc)+_0x2b75c7(0x16e)+_0x2b75c7(0x122),{'openclawVersion':_0x5e077e[_0x2b75c7(0x2f4)+_0x2b75c7(0x99)],'filePath':_0x5b6b06});return;}continue;}await writeFile(_0x5b6b06,_0x536454['source'],'utf8'),_0x2f3a7d[_0x2b75c7(0xf8)+_0x2b75c7(0x318)]?.['info']?.(_0x2b75c7(0x81)+'utbound\x20'+_0x2b75c7(0x198)+_0x2b75c7(0x1bc)+'pplied',{'openclawVersion':_0x5e077e['openclaw'+_0x2b75c7(0x99)],'filePath':_0x5b6b06,'note':_0x2b75c7(0xed)+_0x2b75c7(0xd7)+_0x2b75c7(0x1a9)+_0x2b75c7(0x127)+'rcing\x20op'+_0x2b75c7(0x2b6)+_0x2b75c7(0x1d9)+_0x2b75c7(0x195)+_0x2b75c7(0x87)+_0x2b75c7(0xbc)+_0x2b75c7(0x2d0)+_0x2b75c7(0x247)+_0x2b75c7(0x181)+_0x2b75c7(0x279)+_0x2b75c7(0xa0)+_0x2b75c7(0x11e)+_0x2b75c7(0x105)});return;}_0x2f3a7d[_0x2b75c7(0xf8)+'ogger']?.[_0x2b75c7(0x7f)]?.(_0x2b75c7(0x81)+'utbound\x20'+_0x2b75c7(0x198)+_0x2b75c7(0x33a)+_0x2b75c7(0x2f0)+_0x2b75c7(0x2f1)+'\x20shape\x20n'+_0x2b75c7(0x33d),{'openclawVersion':_0x5e077e[_0x2b75c7(0x2f4)+_0x2b75c7(0x99)]});}function _0x5a9f(){const _0x3752a6=['Name','vailable','leName','load:\x20','\x20not\x20fou','on\x20futur','n\x20the\x20di','eady\x20cur','s\x20to\x20dir','syncOnly','ady\x20appl','IPT_DIR=','required','Run\x20\x22wuj','ed\x20npm\x20p','ound','transcri','path:\x20','info','plugin\x20r','STATE_DI','ready\x20ap','&&\x20pwd)','tory\x20mix','flow;\x20ve','y\x20applie','agents\x20s','sion\x20val','json','\x20paths','session\x20','isFile','add',':\x20manife','led','out\x20c2c\x20','TRY','PT_DIR/w','product\x20','pped;\x20di','kipped;\x20','resolver','go.mjs','optional','openclaw','\x20doctor\x20','rg/dist/','--omit=p','6\x20mixed\x20','Duplicat','platform','ase64\x20st','dataDirN','_SHELL_E','red','ecs','e\x20not\x20fo','H%\x22==\x22\x22\x20','/node','package','achment\x20','extensio','ory','e_module','leted','time-bac','13384464hrApPz','bug;\x20ver','Extracte','JSON:\x20','\x20summary','extract\x20','\x20create\x20','npm','size','eam\x20fix\x20','some','string','--json','ujie-log','ogger','createRu','--legacy','[wujie-s','NCLAW_CO','download','und','integrit','zip','HOME=\x22${','rchive\x20-','tch\x20appl','time-too','ify\x20upst','allowMis','OME=','index.mj','NFIG_PAT','now','--no-aud','npm\x20pack','roductRu','utable','rs;\x20veri','time]\x20do','efore\x20pa','lugin\x20','ame','ATH:-','install','\x22\x20at\x20','bridge\x20n','lugin\x20de','ped;\x20plu','\x20patch\x20s','resolved','ad\x20patch','ot\x20found','allback\x20','warn','\x20package','weixin\x20o','dAt','ied','LocalPlu','h\x20summar','keys','\x20outboun','npm\x20plug','join','up\x20sessi','age\x20was\x20','OOT\x20-For','w.cmd','\x20applied','toString','untime-b','PENCLAW_','OPENCLAW','/opencla','vel\x20entr','IR=$(CDP','--fix','shared-c','atch\x20ski','Version','e\x20plugin','tching\x20p','h\x20applie','CONFIG_P','ge\x20not\x20a','ted','\x20routing','ENCLAW_H','.plugin-','s/npm','oot','octor\x20--','Bin','node/lib','s\x20instal','toISOStr','ions/run','114WqvWvZ','missing\x20','ODE\x22\x20\x22$S','play-pro','indexOf','found','red\x20Node','ure\x20upgr','?t=','registry','extract-','\x20version','ite\x20patc','sion\x20mis','er\x20respo','ader\x20not','split','d\x20mirror','lib','connecto','38801vYzznj','doctor','\x20return\x20','LocalAge','tch\x20alre','store\x20lo','\x20-z\x20\x22$WU','ced','dist','configFi','director','pped;\x20fu','1\x20]\x20&&\x20[','jection-','scoped\x20s','est-id/r','node_mod','agent','qqbot\x20ou','LocalSki','\x22\x20\x22$@\x22','\x20\x22%SCRIP','object','ntPaths','y\x20compat','config=','powershe','wujiecla','G_FILE_N','../../as','pack','el.inbou','push','isDirect',',\x20shell.','pluginId','local\x20pl','dataDir','fix\x20mark','href','XTRACT_R','-Command','node\x20ver','HIVE\x20-De','tall\x20the','plugins','Temporar','ackup','tar','UNTIME_N','rify\x20ups','not\x20foun','npm\x20inst','_STATE_D','nse\x20hook','ath\x20$env','tbound\x20d','runtimeL','channel.','NODE=\x22$S','6.6\x20chan','loader-','ed;\x20brid','channel\x20','NPM_CONF','\x20timed\x20o','-peer-de','ion\x20mism','ing\x20\x22','r\x20@tence','ailable.','cal\x20runt','\x20complet','flush','time]\x20in','\x20failed\x20','-session','endsWith','being\x20in','lient-','lied','\x20can\x20ins','already-','CLAW_CON','then','wujieai.','g\x20indexe','nnel','\x20depende','length','24292CuJfkN','ack\x20over','dy\x20appli','m-cli.js','\x20kdocs\x20s','\x20is\x20unav','unknown','.json','ors\x20bein','pplied','nced','wujie-lo','s/npm/bi','replaceA','patch\x20fo','pipe','law\x20','me\x20missi','pruned\x20r','tarball:','function','@echo\x20of','_NAME:-','env','st\x20not\x20f','filter','/npm','\x20\x20\x22$RUNT','ATH=\x22${O','lock.jso','lugins\x20s','ginPaths','Bot\x20c2c\x20','d\x20an\x20inv','with\x20the','-Executi','#!/bin/s','\x20already','https://','ayload\x20b','tar.xz','tests','8bywZnV','log','statusCo','o.mjs\x22\x202','-doctor.','request-','\x20loaded','ime/sess','eted','d\x20to\x20','\x20path\x20wa','law/qqbo','Invalid\x20','aipc-dow','npm\x20root','\x20resolve','\x20prepare','npmCli','nel\x20plug','product','cope\x20syn','wBin','path','ades.','ing','reason','ATH=\x20cd\x20','onPolicy','has','ch\x20skipp','dules/np','ed-tool\x20','.cache','.tools','local','npm-glob','und:\x20','\x22\x20so\x20the','installe','4981260ScVqod','null','arm64','node','lready\x20a','Expand-A','eer','kup','Dependen','devDepen','test','>/dev/nu','generate','aipc-run','_shared','shift','Claw','\x20can\x20be\x20','.d.ts','chat\x20his','HELL_ARC','ignore','-xzf','ions\x20whe','th\x20c2c\x20i','synced','t\x20c2c\x20ou','tbound\x20s','ut\x20after','match','headers','ile\x20not\x20','RUNTIME_','-weixin','projectR','idated','atch\x20app','lize-','if\x20\x22%OPE','ream\x20fix','rcing\x20QQ','spec','\x20on\x20futu','m.wechat','export\x20O','node/bin','fallback','ATE_DIR:','all\x20loca','all\x20plug','i.js','LAW_STAT','h\x20alread','nt-norma','chat\x20att','bin','untime\x20p','104DOeeSb','llPaths','codex','x64','.js','runtimeR','ibility\x20','empty\x20pl','route\x20pa','ugin\x20dep','stinatio','nloads-b','/node_mo','\x20synced','data','unction\x20','-xJf','lark-cli','\x20found','--\x20\x22$(di','bytes','utf8','AME=','14640CppkkE','ncies','\x20patch\x20a','configPa','==\x22\x22\x20set','agentSco','d\x20for\x20lo','ch\x20appli','ies','ed;\x20plug','hell:run','set\x20\x22OPE','tbound\x20f','ules/npm','esolver\x20','appId','able','26CdBnId','ady\x20curr','R=\x22${OPE','base\x20alr','\x20auth\x20sh','nd\x20after','location','.markdow','resume','ugin\x20spe','patched','TIME_NOD','alid\x20pay','kill\x20not','eixin\x20@i','w.mjs','\x22==\x22\x22\x20se','time','scripts','example','ILE_NAME','\x20\x22$0\x22)\x22\x20','kill','CRIPT_DI','isArray','_modules','\x20bin\x20was','ime\x20buil','map','7348023fYGzTA','pid','shasum','fix','provider','shape\x20no','mjs','patch\x20sk','plied','x\x20on\x20fut','nv:WUJIE','pec:\x20','\x20and\x20','red\x20Open','1545764xqdeCV','base\x20bui','6ULWScV','untime\x20c','importan','ntime\x20ch','error','skills','productN','ch\x20alrea','jection\x20','\x20id\x20from','tch\x20skip','\x20validat','label','every','session-','installP','timeoutM','e\x20tools\x20','rebuilt\x20','NFIG_FIL','e\x20upgrad','plugins\x20','runtime\x20','er\x20id.','atch\x20alr','wnloadin','\x20to\x20dire','uth\x20patc','slice','source','\x20runtime','prefix\x20i','r\x20runtim','runtime-','win32','filename','lite\x20pat','.tmp/run','ME%\x22==\x22\x22','npm-cli.','mirrors\x20','\x20request','\x20\x22OPENCL','ons;\x20ver','--no-fun','AW_CONFI','r\x20@openc','ad-','y:\x20','\x20mirrors','name','tory\x20pro','claw-run','-extract','shell-ru','nodeVers','(empty)','exec','ynced','SIGTERM','ipped;\x20o','ed;\x20chan','execPath','../../sh','docs','set\x20\x22SCR','tream\x20fi','ession\x20r','store\x20sq','arch','d\x20Node\x20r','agents','sessions','try\x20not\x20','base64\x20p','ll.exe','get','n\x20outbou','entryCou','ect\x20sess','_HOME:-','prepareP','NCLAW_HO','Bypass','l\x20plugin','nPath\x20$e','catch','d:\x20','referenc','runtimeS','channel-','\x22\x20\x22$SCRI','ntime','\x20started','OpenClaw','doc','40ydJIdu','started','nction\x20n','id\x20title','stdout','ipped;\x20f','configur','store-lo','lib/node','node.exe','dencies','e.exe','ache\x20bef','nd\x20deliv','includes','ridge.mj','des.','in\x20','store\x20wr','-NoProfi','skipped;','ion','find','le\x20not\x20f','ld\x20compl','dexed\x20wi','close','ime/requ','version','man','in\x20not\x20i','npm-cach','node/nod','n\x20plugin','versions','pluginSp','es\x20','sets/wuj','__tests_','local:','all\x20','st\x20be\x20a\x20','nstalled','skill','ase','lled','stderr','aw\x202026.','nodeExec','\x5cwjrt-','outbound','es.','dge.mjs','startsWi','replace','m/bin/np','patch\x20ap','singOpen','\x20configu','trim','WorkingD','\x20install','\x20did\x20not','\x20entry\x20\x22','E_NAME%\x22','d\x20for\x20','codex\x20is','win','NCLAW_ST','n\x20the\x20pe','LiteralP','o\x20resolv','--omit=d','jie-shel','values','cies','dependen','patch\x20al','\x20set\x20\x22OP','T_DIR%','PATH','prepare\x20','skills\x20s','r\x20OpenCl',';\x20dist\x20n','\x20skipped','ath','ules','utbound\x20','eady\x20app','package.','manifest','root','.npmmirr','enclaw-w',';\x20run\x20wu','in\x20insta','ipped;\x20d','olated\x20a','-id\x20head','ed\x20OpenC','\x22\x20%*','CONFIG_F','ore\x20pack','time]\x20ru','oute\x20pat','er\x20patch','rect\x20pee','\x20-g','ipped;\x20r','pped;\x20ru','ape\x20not\x20'];_0x5a9f=function(){return _0x3752a6;};return _0x5a9f();}async function patchRequestIdTitleRuntime(_0x47a64d,_0x46b23a,_0x1aaa8c={}){const _0x4b22e6=_0x31e6db,_0x5771ce=resolve(_0x47a64d,_0x46b23a[_0x4b22e6(0x2f4)+'WorkingD'+'ir']),_0x466e44=join(_0x5771ce,_0x4b22e6(0xc7)),_0x5ee310=_0x4b22e6(0x237)+'ell-runt'+_0x4b22e6(0x273)+_0x4b22e6(0xce)+_0x4b22e6(0x90)+_0x4b22e6(0x267)+'s',_0x3ea7c9=join(_0x47a64d,_0x4b22e6(0x22e)+_0x4b22e6(0x254),_0x4b22e6(0x148)+'id',_0x4b22e6(0x219)+'bridge.m'+'js');if(!existsSync(_0x3ea7c9)){_0x1aaa8c[_0x4b22e6(0xf8)+_0x4b22e6(0x318)]?.['info']?.(_0x4b22e6(0x148)+'id\x20title'+_0x4b22e6(0x216)+_0x4b22e6(0x33a)+_0x4b22e6(0x2f0)+_0x4b22e6(0x337)+'ot\x20avail'+_0x4b22e6(0x1ca),{'bridgePath':_0x3ea7c9,'openclawVersion':_0x46b23a['openclaw'+_0x4b22e6(0x99)]});return;}const _0x281ddc=(await readdir(_0x466e44,{'withFileTypes':!![]})['catch'](()=>[]))['filter'](_0x1d6c6d=>_0x1d6c6d[_0x4b22e6(0x2e7)]()&&_0x1d6c6d[_0x4b22e6(0x22a)][_0x4b22e6(0x28d)+'th']('loader-')&&_0x1d6c6d[_0x4b22e6(0x22a)][_0x4b22e6(0x10c)](_0x4b22e6(0x1a7)))[_0x4b22e6(0x1e7)](_0x37903e=>join(_0x466e44,_0x37903e[_0x4b22e6(0x22a)]));for(const _0x248c89 of _0x281ddc){const _0x5da0ed=await readFile(_0x248c89,_0x4b22e6(0x1b8)),_0xcb2980=patchRequestIdTitleRuntimeFromSource(_0x5da0ed,{'bridgeImportPath':_0x5ee310});if(!_0xcb2980[_0x4b22e6(0x1d5)]){if(_0xcb2980[_0x4b22e6(0x15c)]==='already-'+_0x4b22e6(0x1d5)){_0x1aaa8c[_0x4b22e6(0xf8)+'ogger']?.[_0x4b22e6(0x2da)]?.('request-'+_0x4b22e6(0x25b)+_0x4b22e6(0x216)+_0x4b22e6(0x1bc)+_0x4b22e6(0x16e)+'pplied',{'filePath':_0x248c89,'openclawVersion':_0x46b23a[_0x4b22e6(0x2f4)+'Version']});break;}continue;}await writeFile(_0x248c89,_0xcb2980[_0x4b22e6(0x215)],_0x4b22e6(0x1b8)),_0x1aaa8c[_0x4b22e6(0xf8)+_0x4b22e6(0x318)]?.[_0x4b22e6(0x2da)]?.('request-'+_0x4b22e6(0x25b)+'\x20runtime'+_0x4b22e6(0x1bc)+_0x4b22e6(0x122),{'filePath':_0x248c89,'openclawVersion':_0x46b23a[_0x4b22e6(0x2f4)+_0x4b22e6(0x99)]});break;}}async function patchQQBotOutboundFallbackRuntime(_0x5ce16e,_0x1bb7e2,_0x1e2e0c={}){const _0x275e6a=_0x31e6db,_0x1b90cf=resolve(_0x5ce16e,_0x1bb7e2['openclaw'+_0x275e6a(0x294)+'ir']),_0x1696bd=join(_0x1b90cf,'dist'),_0x33b863=(await readdir(_0x1696bd,{'withFileTypes':!![]})[_0x275e6a(0x24e)](()=>[]))[_0x275e6a(0x132)](_0x5033ff=>_0x5033ff[_0x275e6a(0x2e7)]()&&_0x5033ff[_0x275e6a(0x22a)][_0x275e6a(0x28d)+'th'](_0x275e6a(0x28a)+_0x275e6a(0x10b)+'-')&&_0x5033ff[_0x275e6a(0x22a)][_0x275e6a(0x10c)](_0x275e6a(0x1a7)))['map'](_0x4f9a8e=>join(_0x1696bd,_0x4f9a8e[_0x275e6a(0x22a)]));if(_0x33b863['length']===0x0){_0x1e2e0c[_0x275e6a(0xf8)+_0x275e6a(0x318)]?.[_0x275e6a(0x7f)]?.(_0x275e6a(0xd1)+_0x275e6a(0x1c6)+_0x275e6a(0x33e)+_0x275e6a(0x1ef)+_0x275e6a(0x234)+'utbound\x20'+_0x275e6a(0x20e)+_0x275e6a(0xf2)+'d',{'openclawVersion':_0x1bb7e2[_0x275e6a(0x2f4)+_0x275e6a(0x99)],'distDir':_0x1696bd});return;}for(const _0x31d5f1 of _0x33b863){const _0x1299e1=await readFile(_0x31d5f1,_0x275e6a(0x1b8)),_0x129bb4=patchQQBotOutboundFallbackFromSource(_0x1299e1);if(!_0x129bb4[_0x275e6a(0x1d5)]){if(_0x129bb4[_0x275e6a(0x15c)]===_0x275e6a(0x111)+_0x275e6a(0x1d5)){_0x1e2e0c['runtimeL'+_0x275e6a(0x318)]?.[_0x275e6a(0x2da)]?.('qqbot\x20ou'+'tbound\x20f'+_0x275e6a(0x33e)+'patch\x20al'+_0x275e6a(0x2dd)+_0x275e6a(0x1f0),{'openclawVersion':_0x1bb7e2[_0x275e6a(0x2f4)+_0x275e6a(0x99)],'filePath':_0x31d5f1});return;}continue;}await writeFile(_0x31d5f1,_0x129bb4['source'],'utf8'),_0x1e2e0c['runtimeL'+_0x275e6a(0x318)]?.[_0x275e6a(0x2da)]?.(_0x275e6a(0xd1)+'tbound\x20f'+_0x275e6a(0x33e)+_0x275e6a(0x290)+'plied',{'openclawVersion':_0x1bb7e2['openclaw'+_0x275e6a(0x99)],'filePath':_0x31d5f1,'note':_0x275e6a(0xed)+_0x275e6a(0xd7)+'ibility\x20'+_0x275e6a(0x127)+_0x275e6a(0x192)+_0x275e6a(0x139)+_0x275e6a(0x28a)+_0x275e6a(0x229)+_0x275e6a(0x212)+'ct\x20sessi'+'ons\x20with'+_0x275e6a(0x2eb)+_0x275e6a(0x217)+_0x275e6a(0x29d)+_0x275e6a(0x20f)});return;}_0x1e2e0c['runtimeL'+_0x275e6a(0x318)]?.[_0x275e6a(0x7f)]?.(_0x275e6a(0xd1)+'tbound\x20f'+'allback\x20'+_0x275e6a(0x1ef)+_0x275e6a(0x2c5)+_0x275e6a(0x1c8)+_0x275e6a(0x1ed)+'t\x20found',{'openclawVersion':_0x1bb7e2['openclaw'+_0x275e6a(0x99)]});}async function patchQQBotOutboundSessionRoute(_0x2129d2,_0x100c07,_0x402ab8={}){const _0x4c1824=_0x31e6db,_0x54e858=join(_0x2129d2,_0x4c1824(0x2f4),_0x4c1824(0xc7),_0x4c1824(0x305)+'ns','qqbot',_0x4c1824(0xc7));if(!existsSync(_0x54e858)){_0x402ab8['runtimeL'+_0x4c1824(0x318)]?.['info']?.(_0x4c1824(0xd1)+'tbound\x20s'+_0x4c1824(0x23b)+'oute\x20pat'+_0x4c1824(0x160)+_0x4c1824(0x1c3)+_0x4c1824(0x276)+_0x4c1824(0x282),{'openclawVersion':_0x100c07[_0x4c1824(0x2f4)+'Version'],'distDir':_0x54e858});return;}const _0x38673f=(await readdir(_0x54e858,{'withFileTypes':!![]})[_0x4c1824(0x24e)](()=>[]))['filter'](_0x48b10a=>_0x48b10a[_0x4c1824(0x2e7)]()&&_0x48b10a[_0x4c1824(0x22a)]['endsWith']('.js'))[_0x4c1824(0x1e7)](_0x22c077=>join(_0x54e858,_0x22c077[_0x4c1824(0x22a)]));for(const _0x1bf2fd of _0x38673f){const _0x51860c=await readFile(_0x1bf2fd,'utf8'),_0x767e97=patchQQBotOutboundSessionRouteFromSource(_0x51860c);if(!_0x767e97[_0x4c1824(0x1d5)]){if(_0x767e97[_0x4c1824(0x15c)]==='already-'+_0x4c1824(0x1d5)){_0x402ab8['runtimeL'+_0x4c1824(0x318)]?.['info']?.(_0x4c1824(0xd1)+'tbound\x20s'+_0x4c1824(0x23b)+_0x4c1824(0x2c1)+_0x4c1824(0x1ff)+_0x4c1824(0x11b)+'ed',{'openclawVersion':_0x100c07[_0x4c1824(0x2f4)+'Version'],'filePath':_0x1bf2fd});return;}continue;}await writeFile(_0x1bf2fd,_0x767e97[_0x4c1824(0x215)],_0x4c1824(0x1b8)),_0x402ab8[_0x4c1824(0xf8)+_0x4c1824(0x318)]?.[_0x4c1824(0x2da)]?.(_0x4c1824(0xd1)+'tbound\x20s'+_0x4c1824(0x23b)+_0x4c1824(0x2c1)+_0x4c1824(0x1c1)+'ed',{'openclawVersion':_0x100c07[_0x4c1824(0x2f4)+_0x4c1824(0x99)],'filePath':_0x1bf2fd,'note':_0x4c1824(0xed)+_0x4c1824(0xd7)+_0x4c1824(0x1a9)+_0x4c1824(0x127)+_0x4c1824(0x226)+_0x4c1824(0x14e)+_0x4c1824(0x184)+_0x4c1824(0xf7)+'elivery\x20'+_0x4c1824(0x220)+_0x4c1824(0x10d)+_0x4c1824(0x271)+_0x4c1824(0x182)+_0x4c1824(0x2ce)+_0x4c1824(0x2c3)+'r\x20id.'});return;}_0x402ab8[_0x4c1824(0xf8)+_0x4c1824(0x318)]?.['warn']?.('qqbot\x20ou'+_0x4c1824(0x185)+_0x4c1824(0x23b)+_0x4c1824(0x2c1)+_0x4c1824(0x160)+_0x4c1824(0x235)+'nel\x20shap'+_0x4c1824(0x300)+_0x4c1824(0x31e),{'openclawVersion':_0x100c07[_0x4c1824(0x2f4)+_0x4c1824(0x99)],'distDir':_0x54e858});}async function resolveRuntimeChannelImportPath(_0x29f3e6,_0x6a2840){const _0x4f9d4d=_0x31e6db,_0x57eda4=_0x6a2840[_0x4f9d4d(0x132)](_0x7ab536=>_0x7ab536[_0x4f9d4d(0x2e7)]()&&_0x7ab536[_0x4f9d4d(0x22a)][_0x4f9d4d(0x28d)+'th'](_0x4f9d4d(0x219)+_0x4f9d4d(0x252))&&_0x7ab536[_0x4f9d4d(0x22a)][_0x4f9d4d(0x10c)]('.js')&&!_0x7ab536[_0x4f9d4d(0x22a)]['startsWi'+'th']('runtime-'+_0x4f9d4d(0x252)+'state-'))[_0x4f9d4d(0x1e7)](_0x289cec=>_0x289cec[_0x4f9d4d(0x22a)])['sort']();for(const _0x51764e of _0x57eda4){const _0x1c93b3=await readFile(join(_0x29f3e6,_0x51764e),_0x4f9d4d(0x1b8));if(_0x1c93b3[_0x4f9d4d(0x266)](_0x4f9d4d(0x319)+'ntimeCha'+_0x4f9d4d(0x116)))return'./'+_0x51764e;}return null;}function normalizeRuntimeRelativePath(_0x3e4211){const _0x22a5fe=_0x31e6db;return _0x3e4211[_0x22a5fe(0x126)+'ll']('\x5c','/');}function toWindowsPath(_0x510ee7){return _0x510ee7['replaceA'+'ll']('/','\x5c');}function validateRuntimeNodeVersion(_0x2da79e,_0x34ff30){const _0x45ac3d=_0x31e6db;if(_0x2da79e[_0x45ac3d(0x22f)+_0x45ac3d(0x26d)]===_0x34ff30[_0x45ac3d(0x2f4)][_0x45ac3d(0x22f)+_0x45ac3d(0x26d)])return;throw new Error('runtime\x20'+_0x45ac3d(0x22f)+_0x45ac3d(0x102)+'atch:\x20ma'+'nifest='+(_0x2da79e['nodeVers'+'ion']||'unknown')+(_0x45ac3d(0xe1)+_0x45ac3d(0xd8))+_0x34ff30['openclaw'][_0x45ac3d(0x22f)+_0x45ac3d(0x26d)]+'.\x20'+('Run\x20\x22wuj'+'ie-shell'+'\x20prepare'+_0x45ac3d(0x168)+'\x20product'+_0x45ac3d(0x216)+_0x45ac3d(0x17b)+_0x45ac3d(0x20a)+_0x45ac3d(0x13b)+_0x45ac3d(0x292)+_0x45ac3d(0xb1)+_0x45ac3d(0xb6)+'.'));}function validateRuntimeOpenClawVersion(_0x294230,_0x520ab4){const _0x4f925c=_0x31e6db;if(_0x294230[_0x4f925c(0x2f4)+_0x4f925c(0x99)]===_0x520ab4[_0x4f925c(0x2f4)]['openclaw'+'Version'])return;throw new Error(_0x4f925c(0x20e)+'openclaw'+'Version\x20'+'mismatch'+_0x4f925c(0x2e9)+'st='+(_0x294230[_0x4f925c(0x2f4)+_0x4f925c(0x99)]||_0x4f925c(0x11f))+(',\x20shell.'+'config=')+_0x520ab4[_0x4f925c(0x2f4)][_0x4f925c(0x2f4)+_0x4f925c(0x99)]+'.\x20'+(_0x4f925c(0x2d5)+'ie-shell'+_0x4f925c(0x153)+_0x4f925c(0x168)+'\x20runtime'+_0x4f925c(0x110)+_0x4f925c(0xeb)+_0x4f925c(0x292)+_0x4f925c(0x1f5)+'Claw\x20ver'+'sion.'));}function parseNpmPackJson(_0x2894c7){const _0x26c1f0=_0x31e6db,_0x1ee806=_0x2894c7[_0x26c1f0(0x293)](),_0x3ac103=_0x1ee806[_0x26c1f0(0xaf)]('[');if(_0x3ac103<0x0)throw new Error(_0x26c1f0(0x32c)+_0x26c1f0(0x296)+_0x26c1f0(0xc1)+_0x26c1f0(0x30d)+_0x1ee806[_0x26c1f0(0x214)](0x0,0x1f4));const _0x41bd2e=JSON['parse'](_0x1ee806[_0x26c1f0(0x214)](_0x3ac103)),_0x43a965=Array[_0x26c1f0(0x1e3)](_0x41bd2e)?_0x41bd2e[0x0]:_0x41bd2e;if(!_0x43a965||typeof _0x43a965!==_0x26c1f0(0xd5))throw new Error('npm\x20pack'+'\x20returne'+_0x26c1f0(0x13a)+_0x26c1f0(0x1d7)+_0x26c1f0(0x2cb)+_0x1ee806[_0x26c1f0(0x214)](0x0,0x1f4));return _0x43a965;}function normalizePackedTarballFilename(_0xc04141){const _0x35b76d=_0x31e6db;return _0xc04141['replace'](/^@/,'')[_0x35b76d(0x126)+'ll']('/','-')[_0x35b76d(0x126)+'ll']('\x5c','-');}function _0x3914(_0x35481d,_0xf78ef0){_0x35481d=_0x35481d-0x7f;const _0x5a9f63=_0x5a9f();let _0x391488=_0x5a9f63[_0x35481d];return _0x391488;}async function runProcess(_0x3b2fea,_0x16360d,_0x15e4d1={}){const _0x1db66e=_0x31e6db,_0x396162=_0x15e4d1[_0x1db66e(0x204)]||[_0x3b2fea,..._0x16360d][_0x1db66e(0x89)]('\x20'),_0x49a5fd=_0x15e4d1[_0x1db66e(0x208)+'s']??NPM_INSTALL_TIMEOUT_MS,_0x5e6cff=spawn(_0x3b2fea,_0x16360d,{'cwd':_0x15e4d1['cwd'],'env':_0x15e4d1[_0x1db66e(0x130)],'stdio':[_0x1db66e(0x17f),'pipe',_0x1db66e(0x128)]});return await new Promise((_0x137643,_0x390690)=>{const _0x51aa94=_0x1db66e;let _0x2fd07e='',_0x59ca4e='',_0x5d9350=![];const _0x517436=setTimeout(()=>{const _0x647185=_0x3914;if(_0x5d9350)return;_0x5d9350=!![],_0x5e6cff[_0x647185(0x1e1)]('SIGTERM'),_0x390690(new Error(_0x396162+(_0x647185(0x100)+_0x647185(0x186)+'\x20')+_0x49a5fd+'ms'));},_0x49a5fd);_0x5e6cff[_0x51aa94(0x25c)]['on']('data',_0x48b2f4=>{const _0x369fc2=_0x51aa94;_0x2fd07e+=_0x48b2f4[_0x369fc2(0x8f)]();}),_0x5e6cff['stderr']['on']('data',_0x4aa0d9=>{_0x59ca4e+=_0x4aa0d9['toString']();}),_0x5e6cff['on'](_0x51aa94(0x1fc),_0x509954=>{if(_0x5d9350)return;_0x5d9350=!![],clearTimeout(_0x517436),_0x390690(_0x509954);}),_0x5e6cff['on'](_0x51aa94(0x272),(_0x586639,_0x22e4b6)=>{const _0x45e64c=_0x51aa94;if(_0x5d9350)return;_0x5d9350=!![],clearTimeout(_0x517436);if(_0x586639===0x0){_0x137643({'stdout':_0x2fd07e,'stderr':_0x59ca4e});return;}_0x390690(new Error(_0x396162+(_0x45e64c(0x10a)+'with\x20cod'+'e=')+(_0x586639??_0x45e64c(0x16b))+'\x20signal='+(_0x22e4b6??_0x45e64c(0x16b))+'\x0a'+(''+(_0x59ca4e||_0x2fd07e))[_0x45e64c(0x293)]()));});});}async function installOpenClawPackage(_0x8b33bc,_0x3a3f99){const _0x17a2bb=_0x31e6db,_0x4e0de6=join(_0x8b33bc[_0x17a2bb(0x1a8)+'oot'],_0x17a2bb(0x163)),_0x5c7cd9=join(_0x8b33bc[_0x17a2bb(0x1a8)+_0x17a2bb(0xa4)],'.opencla'+'w-extrac'+'t');await mkdir(_0x4e0de6,{'recursive':!![]}),await removePathWithRetries(_0x5c7cd9),await mkdir(_0x5c7cd9,{'recursive':!![]});const _0x27edab=await createRuntimeEnv(_0x8b33bc),_0x964e1e=_0x17a2bb(0x2f4)+'@'+_0x3a3f99;console[_0x17a2bb(0x144)]('[wujie-s'+_0x17a2bb(0x1c4)+'time]\x20in'+'stalling'+'\x20'+_0x964e1e);const _0x2ef49f=await runProcess(_0x8b33bc[_0x17a2bb(0x288)+_0x17a2bb(0x32e)],[_0x8b33bc[_0x17a2bb(0x154)],_0x17a2bb(0xdd),_0x964e1e,_0x17a2bb(0x316)],{'cwd':_0x4e0de6,'env':_0x27edab,'label':_0x17a2bb(0x32c)+'\x20'+_0x964e1e}),_0x55a1fe=parseNpmPackJson(_0x2ef49f[_0x17a2bb(0x25c)]);if(_0x55a1fe[_0x17a2bb(0x274)]!==_0x3a3f99)throw new Error('Configur'+_0x17a2bb(0x2bc)+_0x17a2bb(0x129)+_0x3a3f99+(_0x17a2bb(0x152)+_0x17a2bb(0x14c))+_0x55a1fe[_0x17a2bb(0x274)]);const _0xfb5ccc=resolve(_0x4e0de6,_0x55a1fe['filename']);if(!existsSync(_0xfb5ccc))throw new Error(_0x17a2bb(0x32c)+'\x20did\x20not'+_0x17a2bb(0x310)+'tarball:'+'\x20'+_0xfb5ccc);await runProcess(_0x17a2bb(0xef),[_0x17a2bb(0x180),_0xfb5ccc,'-C',_0x5c7cd9],{'label':_0x17a2bb(0x30f)+_0x55a1fe[_0x17a2bb(0x21b)]}),await removePathWithRetries(_0x8b33bc[_0x17a2bb(0x2f4)+'WorkingD'+'ir']),await rename(join(_0x5c7cd9,_0x17a2bb(0x303)),_0x8b33bc[_0x17a2bb(0x2f4)+_0x17a2bb(0x294)+'ir']),await removePathWithRetries(_0x5c7cd9),await runProcess(_0x8b33bc[_0x17a2bb(0x288)+'utable'],[_0x8b33bc[_0x17a2bb(0x154)],'install',_0x17a2bb(0x2a0)+'ev','--omit=p'+_0x17a2bb(0x170),_0x17a2bb(0x32b)+'it','--no-fun'+'d','--legacy'+'-peer-de'+'ps'],{'cwd':_0x8b33bc[_0x17a2bb(0x2f4)+_0x17a2bb(0x294)+'ir'],'env':_0x27edab,'label':_0x17a2bb(0xf3)+_0x17a2bb(0x280)+_0x964e1e+(_0x17a2bb(0x216)+_0x17a2bb(0x117)+_0x17a2bb(0x1bb))});if(!existsSync(_0x8b33bc[_0x17a2bb(0x2f4)+'Bin']))throw new Error(_0x17a2bb(0x256)+_0x17a2bb(0x1e5)+_0x17a2bb(0x2cc)+_0x17a2bb(0x1d0)+_0x17a2bb(0x295)+':\x20'+_0x8b33bc['openclaw'+'Bin']);}async function ensureRuntimeBase(_0x23e678,_0x2c4194,_0x11e850={}){const _0x1196bf=_0x31e6db;await mkdir(_0x2c4194,{'recursive':!![]});let _0x15415b=await readRuntimeManifest(_0x2c4194);const _0x4e3bd4=_0x23e678[_0x1196bf(0x2f4)][_0x1196bf(0x22f)+'ion'],_0x51c7b8=_0x23e678['openclaw'][_0x1196bf(0x2f4)+_0x1196bf(0x99)],_0x30a01f=existsSync(resolveManifestPath(_0x2c4194)),_0x2e3c1c=runtimeHasRequiredPaths(_0x2c4194,_0x15415b),_0x4e5d8a=_0x15415b[_0x1196bf(0x22f)+_0x1196bf(0x26d)]===_0x4e3bd4;!_0x30a01f||!_0x2e3c1c||!_0x4e5d8a?(_0x11e850[_0x1196bf(0xf8)+'ogger']?.['importan'+'t']?.('runtime\x20'+_0x1196bf(0x1f7)+'ld\x20start'+'ed',{'runtimeRoot':_0x2c4194,'reason':!_0x30a01f?_0x1196bf(0xac)+_0x1196bf(0x2b3):!_0x2e3c1c?_0x1196bf(0xac)+_0x1196bf(0x2d4)+_0x1196bf(0x216)+_0x1196bf(0x2e5):_0x1196bf(0xe9)+_0x1196bf(0xb8)+_0x1196bf(0x187),'syncOnly':_0x11e850[_0x1196bf(0x2d1)]}),_0x15415b=await buildRuntimeBase(_0x23e678,_0x2c4194,_0x15415b),_0x11e850[_0x1196bf(0xf8)+_0x1196bf(0x318)]?.[_0x1196bf(0x1fa)+'t']?.(_0x1196bf(0x20e)+_0x1196bf(0x1f7)+_0x1196bf(0x270)+_0x1196bf(0x14b),{'manifest':summarizeRuntimeManifest(_0x15415b)})):_0x11e850[_0x1196bf(0xf8)+'ogger']?.[_0x1196bf(0x1fa)+'t']?.(_0x1196bf(0x20e)+_0x1196bf(0x1ce)+_0x1196bf(0x2cf)+'rent',{'manifest':summarizeRuntimeManifest(_0x15415b)});if(!existsSync(resolve(_0x2c4194,_0x15415b[_0x1196bf(0x2f4)+_0x1196bf(0xa6)]))){const _0x50d21e=createRuntimeInfoFromManifest(_0x2c4194,_0x15415b,{'allowMissingOpenClaw':!![]});await installOpenClawPackage(_0x50d21e,_0x51c7b8),_0x15415b[_0x1196bf(0x2f4)+_0x1196bf(0x99)]=_0x51c7b8;}return _0x15415b;}function runtimeHasRequiredPaths(_0x48351b,_0x440976){const _0x2ce889=_0x31e6db;return['nodeExec'+_0x2ce889(0x32e),'npmCli','openclaw'+_0x2ce889(0x294)+'ir',_0x2ce889(0x2f4)+_0x2ce889(0xa6)][_0x2ce889(0x205)](_0x45252e=>typeof _0x440976[_0x45252e]===_0x2ce889(0x315)&&_0x440976[_0x45252e]['trim']())&&[_0x2ce889(0x288)+_0x2ce889(0x32e),_0x2ce889(0x154)][_0x2ce889(0x205)](_0x335b3e=>existsSync(resolve(_0x48351b,_0x440976[_0x335b3e])));}async function buildRuntimeBase(_0x4e07ed,_0x332faa,_0x3d14d7={}){const _0x533839=_0x31e6db,_0x3d592a=join(_0x332faa,_0x533839(0x16d));await ensureRuntimeNode(_0x4e07ed,_0x3d592a);const _0x57c2b9=process[_0x533839(0x2fa)]===_0x533839(0x21a)?_0x533839(0x278)+_0x533839(0x263):_0x533839(0x197)+_0x533839(0x302),_0x5ded57=process[_0x533839(0x2fa)]===_0x533839(0x21a)?_0x533839(0x278)+_0x533839(0x307)+_0x533839(0x125)+'n/npm-cl'+_0x533839(0x19c):_0x533839(0xa7)+_0x533839(0x1af)+_0x533839(0x161)+_0x533839(0x28f)+_0x533839(0x11c),_0x5c621f={..._0x3d14d7,'generatedAt':new Date()[_0x533839(0xa9)+_0x533839(0x15b)](),'nodeVersion':_0x4e07ed[_0x533839(0x2f4)][_0x533839(0x22f)+_0x533839(0x26d)],'openclawVersion':_0x3d14d7[_0x533839(0x2f4)+_0x533839(0x99)]||'','platform':process[_0x533839(0x2fa)],'arch':process['arch'],'nodeExecutable':_0x57c2b9,'npmCli':_0x5ded57,'openclawWorkingDir':_0x533839(0x2f4),'openclawBin':_0x533839(0x2f4)+_0x533839(0x93)+_0x533839(0x1da)};return await writeJson(resolveManifestPath(_0x332faa),_0x5c621f),_0x5c621f;}async function removePathWithRetries(_0x3d0bfb){await rm(_0x3d0bfb,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96});}async function ensureRuntimeNode(_0x355f8a,_0x1bb142){const _0xa758b6=_0x31e6db,_0xb8f568=_0x355f8a[_0xa758b6(0x2f4)][_0xa758b6(0x22f)+_0xa758b6(0x26d)],_0x2407ce=process[_0xa758b6(0x2fa)]===_0xa758b6(0x21a)?join(_0x1bb142,_0xa758b6(0x261)):join(_0x1bb142,_0xa758b6(0x1a1),_0xa758b6(0x16d)),_0x5dbbbe=process[_0xa758b6(0x2fa)]===_0xa758b6(0x21a)?join(_0x1bb142,'node_mod'+_0xa758b6(0x2af),'npm','bin',_0xa758b6(0x21f)+'js'):join(_0x1bb142,_0xa758b6(0xbd),_0xa758b6(0xcf)+_0xa758b6(0x2af),_0xa758b6(0x311),_0xa758b6(0x1a1),'npm-cli.'+'js');if(existsSync(_0x2407ce)&&existsSync(_0x5dbbbe)&&await getNodeVersion(_0x2407ce)===_0xb8f568)return;await removePathWithRetries(_0x1bb142);if(process[_0xa758b6(0x27a)][_0xa758b6(0x16d)]===_0xb8f568){await linkCurrentNodeRuntime(_0x1bb142);return;}await downloadNodeRuntime(_0xb8f568,_0x1bb142);}async function getNodeVersion(_0x567264){const _0x4e717c=_0x31e6db;try{const _0x365349=await runProcess(_0x567264,['-p','process.'+_0x4e717c(0x27a)+'.node'],{'label':_0x567264+_0x4e717c(0xb6),'timeoutMs':0x7530});return _0x365349[_0x4e717c(0x25c)]['trim']();}catch{return'';}}async function linkCurrentNodeRuntime(_0x4fdb28){const _0x5c63fa=_0x31e6db,_0x583002=process[_0x5c63fa(0x236)],_0x5bb805=resolve(dirname(_0x583002),'..'),_0x2c20d1=process['platform']===_0x5c63fa(0x21a)?resolve(_0x5bb805,'node_mod'+_0x5c63fa(0x1c7)):resolve(_0x5bb805,_0x5c63fa(0x260)+_0x5c63fa(0x1e4)+_0x5c63fa(0x133)),_0x25e57b=process[_0x5c63fa(0x2fa)]===_0x5c63fa(0x21a)?join(_0x4fdb28,_0x5c63fa(0x261)):join(_0x4fdb28,'bin',_0x5c63fa(0x16d)),_0x577445=process['platform']==='win32'?join(_0x4fdb28,_0x5c63fa(0xcf)+_0x5c63fa(0x2af),_0x5c63fa(0x311)):join(_0x4fdb28,'lib',_0x5c63fa(0xcf)+'ules',_0x5c63fa(0x311));await mkdir(dirname(_0x25e57b),{'recursive':!![]}),await mkdir(dirname(_0x577445),{'recursive':!![]}),await symlink(_0x583002,_0x25e57b),existsSync(_0x2c20d1)?await symlink(_0x2c20d1,_0x577445):await symlink(await resolveNpmRoot(),_0x577445);}async function resolveNpmRoot(){const _0x52c646=_0x31e6db,_0xcc2dab=await runProcess('npm',[_0x52c646(0x2b4),'-g'],{'label':_0x52c646(0x151)+_0x52c646(0x2c4),'timeoutMs':0x7530}),_0x27b336=process[_0x52c646(0x2fa)]===_0x52c646(0x21a)?_0xcc2dab[_0x52c646(0x25c)][_0x52c646(0x293)]():join(_0xcc2dab[_0x52c646(0x25c)][_0x52c646(0x293)](),'npm');if(!existsSync(join(_0x27b336,_0x52c646(0x1a1),_0x52c646(0x21f)+'js')))throw new Error(_0x52c646(0x32c)+_0x52c646(0x8b)+_0x52c646(0xf2)+_0x52c646(0x1c0)+_0x52c646(0x106)+_0x52c646(0x1e6)+_0x52c646(0x24f)+_0x27b336);return _0x27b336;}async function resolveExtractedNodeRoot(_0x3224c2,_0x3b93cc){const _0x30a5ec=_0x31e6db,_0x273bb5=join(_0x3224c2,_0x3b93cc);if(existsSync(_0x273bb5))return _0x273bb5;const _0x3a5ecc=await readdir(_0x3224c2,{'withFileTypes':!![]}),_0x564f41=_0x3a5ecc[_0x30a5ec(0x132)](_0x5ba69a=>_0x5ba69a[_0x30a5ec(0xe0)+_0x30a5ec(0x306)]());if(_0x564f41[_0x30a5ec(0x118)]===0x1)return join(_0x3224c2,_0x564f41[0x0]['name']);const _0x2edacc=process['platform']==='win32'?join(_0x3224c2,_0x30a5ec(0x261)):join(_0x3224c2,_0x30a5ec(0x1a1),_0x30a5ec(0x16d));if(existsSync(_0x2edacc))return _0x3224c2;const _0x42b5d2=await findNodeRuntimeRoot(_0x3224c2);if(_0x42b5d2)return _0x42b5d2;const _0x5820d2=_0x3a5ecc[_0x30a5ec(0x1e7)](_0x2b873b=>_0x2b873b['name'])[_0x30a5ec(0x89)](',\x20');throw new Error(_0x30a5ec(0x30c)+_0x30a5ec(0x23e)+'untime\x20r'+'oot\x20was\x20'+_0x30a5ec(0xf2)+_0x30a5ec(0x299)+_0x3b93cc+'\x20in\x20'+_0x3224c2+('.\x20Top-le'+_0x30a5ec(0x94)+'ies:\x20')+(_0x5820d2||_0x30a5ec(0x230)));}function resolveNodeExtractRoot(_0x1b33bc,_0x23f7b2,_0x1a242d){const _0x457be5=_0x31e6db;if(process[_0x457be5(0x2fa)]!==_0x457be5(0x21a))return join(_0x1b33bc,_0x23f7b2+(_0x457be5(0x22d)+'-')+process[_0x457be5(0x1e9)]+'-'+Date[_0x457be5(0x32a)]()+'-'+_0x1a242d);const _0x2f33b3=/^[A-Za-z]:[\\/]/[_0x457be5(0x231)](_0x1b33bc),_0x30b2c3=parse(_0x1b33bc),_0x42c4c0=_0x2f33b3?_0x2f33b3[0x0][_0x457be5(0x214)](0x0,0x2)+'\x5c':_0x30b2c3[_0x457be5(0x2b4)]&&_0x30b2c3[_0x457be5(0x2b4)]!=='/'?_0x30b2c3[_0x457be5(0x2b4)]:_0x1b33bc,_0x48efb5=_0x42c4c0['replace'](/[\\/]+$/,'');return _0x48efb5+_0x457be5(0x289)+process[_0x457be5(0x1e9)]+'-'+Date[_0x457be5(0x32a)]()+'-'+_0x1a242d;}async function findNodeRuntimeRoot(_0x444bd7){const _0x231fe5=_0x31e6db,_0x2ce1a7=[_0x444bd7],_0x3059ca=new Set();while(_0x2ce1a7[_0x231fe5(0x118)]>0x0){const _0x250726=_0x2ce1a7[_0x231fe5(0x179)]();if(!_0x250726||_0x3059ca['has'](_0x250726))continue;_0x3059ca[_0x231fe5(0x2e8)](_0x250726);const _0x541f20=process[_0x231fe5(0x2fa)]===_0x231fe5(0x21a)?join(_0x250726,'node.exe'):join(_0x250726,_0x231fe5(0x1a1),_0x231fe5(0x16d)),_0x26583a=process[_0x231fe5(0x2fa)]===_0x231fe5(0x21a)?join(_0x250726,'node_mod'+_0x231fe5(0x2af),'npm',_0x231fe5(0x1a1),'npm-cli.'+'js'):join(_0x250726,_0x231fe5(0xbd),_0x231fe5(0xcf)+_0x231fe5(0x2af),_0x231fe5(0x311),_0x231fe5(0x1a1),'npm-cli.'+'js');if(existsSync(_0x541f20)&&existsSync(_0x26583a))return _0x250726;const _0x4f5813=await readdir(_0x250726,{'withFileTypes':!![]});for(const _0x194578 of _0x4f5813){_0x194578[_0x231fe5(0xe0)+_0x231fe5(0x306)]()&&_0x2ce1a7[_0x231fe5(0xdf)](join(_0x250726,_0x194578[_0x231fe5(0x22a)]));}}return'';}async function downloadNodeRuntime(_0x2ab881,_0x26ba0b){const _0x91d796=_0x31e6db,_0x8b262b=process['platform']===_0x91d796(0x21a)?_0x91d796(0x29b):process['platform'],_0x3635b0=process[_0x91d796(0x23d)]===_0x91d796(0x1a6)?_0x91d796(0x1a6):process[_0x91d796(0x23d)]===_0x91d796(0x16c)?'arm64':process[_0x91d796(0x23d)],_0xde3569=process[_0x91d796(0x2fa)]===_0x91d796(0x21a)?_0x91d796(0x320):_0x91d796(0x141),_0xbcf0e2='node-v'+_0x2ab881+'-'+_0x8b262b+'-'+_0x3635b0,_0x53b4d1=_0xbcf0e2+'.'+_0xde3569,_0x5883e1=join(dirname(_0x26ba0b),'.cache'),_0x340abe=join(_0x5883e1,_0x53b4d1),_0x4a6adb=_0x91d796(0x13f)+'nodejs.o'+_0x91d796(0x2f6)+'v'+_0x2ab881+'/'+_0x53b4d1;await mkdir(_0x5883e1,{'recursive':!![]});const _0x453b6a=resolveNodeExtractRoot(_0x5883e1,_0xbcf0e2,0x1);!existsSync(_0x340abe)&&(console[_0x91d796(0x144)](_0x91d796(0x31b)+'hell:run'+_0x91d796(0x330)+_0x91d796(0x211)+'g\x20'+_0x4a6adb),await downloadFile(_0x4a6adb,_0x340abe));await rm(_0x453b6a,{'recursive':!![],'force':!![]}),await mkdir(_0x453b6a,{'recursive':!![]});process[_0x91d796(0x2fa)]===_0x91d796(0x21a)?await extractZipArchive(_0x340abe,_0x453b6a,_0x53b4d1):await runProcess(_0x91d796(0xef),[_0x91d796(0x1b3),_0x340abe,'-C',_0x453b6a],{'label':'extract\x20'+_0x53b4d1});const _0x4153fd=await resolveExtractedNodeRoot(_0x453b6a,_0xbcf0e2);await mkdir(dirname(_0x26ba0b),{'recursive':!![]}),await rename(_0x4153fd,_0x26ba0b),_0x4153fd!==_0x453b6a&&await rm(_0x453b6a,{'recursive':!![],'force':!![]});}async function extractZipArchive(_0x1915e3,_0x51eb7c,_0x49be85){const _0x69a79c=_0x31e6db;await runProcess(_0x69a79c(0xd9)+_0x69a79c(0x243),[_0x69a79c(0x26b)+'le',_0x69a79c(0x13c)+_0x69a79c(0x15e),_0x69a79c(0x24b),_0x69a79c(0xe8),_0x69a79c(0x16f)+_0x69a79c(0x322)+_0x69a79c(0x29e)+_0x69a79c(0xf6)+':WUJIE_S'+_0x69a79c(0x17e)+_0x69a79c(0xea)+_0x69a79c(0x1ad)+_0x69a79c(0x24d)+_0x69a79c(0x1f2)+_0x69a79c(0x2fd)+_0x69a79c(0xe7)+_0x69a79c(0x8c)+'ce'],{'env':{...process.env,'WUJIE_SHELL_ARCHIVE':_0x1915e3,'WUJIE_SHELL_EXTRACT_ROOT':_0x51eb7c},'label':_0x69a79c(0x30f)+_0x49be85});}async function downloadFile(_0x336162,_0x1eb3ac){await mkdir(dirname(_0x1eb3ac),{'recursive':!![]});const _0xa0183a=await new Promise((_0x486847,_0x109b84)=>{const _0x51e788=_0x3914;get(_0x336162,_0xe4b40b=>{const _0x1b0179=_0x3914;if(_0xe4b40b['statusCo'+'de']>=0x12c&&_0xe4b40b[_0x1b0179(0x145)+'de']<0x190&&_0xe4b40b[_0x1b0179(0x188)][_0x1b0179(0x1d1)]){_0xe4b40b['resume'](),downloadFile(new URL(_0xe4b40b['headers'][_0x1b0179(0x1d1)],_0x336162)[_0x1b0179(0xe6)],_0x1eb3ac)[_0x1b0179(0x113)](()=>_0x486847(null))['catch'](_0x109b84);return;}if(_0xe4b40b[_0x1b0179(0x145)+'de']!==0xc8){_0xe4b40b[_0x1b0179(0x1d3)](),_0x109b84(new Error(_0x1b0179(0x31d)+_0x1b0179(0x10a)+_0xe4b40b[_0x1b0179(0x145)+'de']+':\x20'+_0x336162));return;}_0x486847(_0xe4b40b);})['on'](_0x51e788(0x1fc),_0x109b84);});_0xa0183a&&await pipeline(_0xa0183a,createWriteStream(_0x1eb3ac));}export async function ensureOpenClawDoctorFixed(_0x456be2,_0x41f8e1={}){const _0xaf2b46=_0x31e6db,_0x3c3aeb=await loadRuntimeInfo(_0x456be2[_0xaf2b46(0x18c)+_0xaf2b46(0xa4)]),_0x2759ab=getConfigPaths(_0x456be2),_0x24d41f=join(_0x2759ab[_0xaf2b46(0x251)+'tateDir'],'openclaw'+_0xaf2b46(0x147)+'json'),_0x25933a=await readJson(_0x24d41f,{});if(_0x25933a[_0xaf2b46(0x2f4)+'Version']===_0x3c3aeb[_0xaf2b46(0x2f4)+_0xaf2b46(0x99)])return _0x41f8e1[_0xaf2b46(0xf8)+_0xaf2b46(0x318)]?.['info'](_0xaf2b46(0x2f4)+_0xaf2b46(0x2f5)+'fix\x20alre'+_0xaf2b46(0x1cc)+'ent',{'openclawVersion':_0x3c3aeb[_0xaf2b46(0x2f4)+_0xaf2b46(0x99)],'markerPath':_0x24d41f}),{'ran':![],'openclawVersion':_0x3c3aeb['openclaw'+_0xaf2b46(0x99)],'markerPath':_0x24d41f};return await runOpenClawDoctorFix(_0x456be2,_0x3c3aeb,{'fromVersion':_0x25933a[_0xaf2b46(0x2f4)+_0xaf2b46(0x99)]||_0xaf2b46(0x11f),'toVersion':_0x3c3aeb[_0xaf2b46(0x2f4)+_0xaf2b46(0x99)],'markerPath':_0x24d41f,'runtimeLogger':_0x41f8e1[_0xaf2b46(0xf8)+_0xaf2b46(0x318)]}),{'ran':!![],'openclawVersion':_0x3c3aeb['openclaw'+'Version'],'markerPath':_0x24d41f};}async function runOpenClawDoctorFix(_0x3cc147,_0x19731d,{fromVersion:_0x5a7340,toVersion:_0x17729b,markerPath:markerPath='',runtimeLogger:_0x52f82a}={}){const _0x3297e0=_0x31e6db;_0x52f82a?.[_0x3297e0(0x1fa)+'t']?.(_0x3297e0(0x2f4)+_0x3297e0(0x2f5)+'fix\x20star'+_0x3297e0(0x9f),{'fromVersion':_0x5a7340,'toVersion':_0x17729b});const _0x4f4073=await createRuntimeEnv(_0x19731d,{'OPENCLAW_HOME':_0x3cc147[_0x3297e0(0xe4)],'OPENCLAW_STATE_DIR':_0x3cc147[_0x3297e0(0xe4)],'OPENCLAW_CONFIG_PATH':getConfigPaths(_0x3cc147)[_0x3297e0(0x1bd)+'th']});console['log'](_0x3297e0(0x31b)+'hell:run'+_0x3297e0(0x2c0)+'nning\x20op'+'enclaw\x20d'+_0x3297e0(0xa5)+_0x3297e0(0x1eb));const _0x35afa9=await runProcess(_0x19731d[_0x3297e0(0x288)+'utable'],[_0x19731d[_0x3297e0(0x2f4)+_0x3297e0(0xa6)],_0x3297e0(0xc0),_0x3297e0(0x96)],{'cwd':_0x19731d[_0x3297e0(0x2f4)+_0x3297e0(0x294)+'ir'],'env':_0x4f4073,'label':'openclaw'+_0x3297e0(0x2f5)+'--fix','timeoutMs':0x1d4c0});_0x52f82a?.[_0x3297e0(0x1fa)+'t']?.('openclaw'+_0x3297e0(0x2f5)+'fix\x20comp'+_0x3297e0(0x308),{'fromVersion':_0x5a7340,'toVersion':_0x17729b,'stdout':_0x35afa9[_0x3297e0(0x25c)][_0x3297e0(0x293)]()[_0x3297e0(0x214)](-0xfa0),'stderr':_0x35afa9[_0x3297e0(0x286)][_0x3297e0(0x293)]()['slice'](-0xfa0)}),markerPath&&(await writeJson(markerPath,{'openclawVersion':_0x19731d[_0x3297e0(0x2f4)+_0x3297e0(0x99)],'fixedAt':new Date()[_0x3297e0(0xa9)+'ing']()}),_0x52f82a?.[_0x3297e0(0x1fa)+'t']?.('openclaw'+'\x20doctor\x20'+_0x3297e0(0xe5)+'er\x20writt'+'en',{'markerPath':markerPath,'openclawVersion':_0x19731d[_0x3297e0(0x2f4)+_0x3297e0(0x99)]}));}export async function readRuntimeManifest(_0x71e737){return await readJson(resolveManifestPath(_0x71e737),{});}export async function loadRuntimeInfo(_0x3303e4){const _0x1e54e7=resolveRuntimeRoot(_0x3303e4),_0x32e41e=await readRuntimeManifest(_0x1e54e7);return createRuntimeInfoFromManifest(_0x1e54e7,_0x32e41e);}function createRuntimeInfoFromManifest(_0x5a5cd4,_0x1b4bc5,_0x3928c8={}){const _0x159273=_0x31e6db;for(const _0xee72df of[_0x159273(0x288)+_0x159273(0x32e),_0x159273(0x154),'openclaw'+_0x159273(0x294)+'ir',_0x159273(0x2f4)+'Bin']){if(typeof _0x1b4bc5[_0xee72df]!==_0x159273(0x315)||!_0x1b4bc5[_0xee72df][_0x159273(0x293)]())throw new Error(_0x159273(0x20e)+_0x159273(0x2b3)+'\x20is\x20miss'+_0x159273(0x103)+_0xee72df+_0x159273(0x336)+resolveManifestPath(_0x5a5cd4)+(_0x159273(0x2b7)+_0x159273(0x2a1)+'l\x20prepar'+'e'));}const _0x5596b3=resolve(_0x5a5cd4,_0x1b4bc5[_0x159273(0x288)+_0x159273(0x32e)]),_0x125ae4=resolve(_0x5a5cd4,_0x1b4bc5['npmCli']),_0x44ddee=resolve(_0x5a5cd4,_0x1b4bc5['openclaw'+_0x159273(0x294)+'ir']),_0x4becaf=resolve(_0x5a5cd4,_0x1b4bc5['openclaw'+_0x159273(0xa6)]),_0x5dee21=Array[_0x159273(0x1e3)](_0x1b4bc5[_0x159273(0xec)])?_0x1b4bc5['plugins'][_0x159273(0x1e7)](_0x3f62d4=>({..._0x3f62d4,'installPath':resolve(_0x5a5cd4,_0x3f62d4[_0x159273(0x207)+_0x159273(0x2ae)])})):[],_0x2893c6=_0x3928c8[_0x159273(0x326)+_0x159273(0x291)+_0x159273(0x17a)]?[_0x5596b3,_0x125ae4]:[_0x5596b3,_0x125ae4,_0x44ddee,_0x4becaf];for(const _0x17f581 of _0x2893c6){if(!existsSync(_0x17f581))throw new Error(_0x159273(0x20e)+_0x159273(0xac)+_0x159273(0x2d9)+_0x17f581);}return{'runtimeRoot':_0x5a5cd4,'manifest':_0x1b4bc5,'openclawVersion':_0x1b4bc5[_0x159273(0x2f4)+'Version']||_0x159273(0x11f),'nodeExecutable':_0x5596b3,'npmCli':_0x125ae4,'openclawWorkingDir':_0x44ddee,'openclawBin':_0x4becaf,'plugins':_0x5dee21};}export async function spawnClaw(_0x44314a,_0x186681=[],_0x47eead={}){const _0x4242bd=_0x31e6db,_0x2ed6e3=await loadRuntimeInfo(_0x44314a),_0x3b7ca0=await createRuntimeEnv(_0x2ed6e3,_0x47eead[_0x4242bd(0x130)]??{});return spawn(_0x2ed6e3[_0x4242bd(0x288)+'utable'],[_0x2ed6e3[_0x4242bd(0x2f4)+_0x4242bd(0xa6)],..._0x186681],{'cwd':_0x2ed6e3[_0x4242bd(0x2f4)+_0x4242bd(0x294)+'ir'],'stdio':'pipe',..._0x47eead,'env':_0x3b7ca0});}export async function runClawOnce(_0x50c1c3,_0x32bcf0=[],_0x6b64e=0x15f90){const _0x53e655=await spawnClaw(_0x50c1c3,_0x32bcf0);return await new Promise((_0x1e35ac,_0x44c3c1)=>{const _0x52d02c=_0x3914;let _0x1b8892='',_0x3f615d='',_0x104717=![];const _0x9fe60a=setTimeout(()=>{const _0x43b336=_0x3914;if(_0x104717)return;_0x104717=!![],_0x53e655[_0x43b336(0x1e1)](_0x43b336(0x233)),_0x44c3c1(new Error(_0x43b336(0x2f4)+_0x43b336(0x100)+_0x43b336(0x186)+'\x20'+_0x6b64e+'ms'));},_0x6b64e);_0x53e655['stdout']['on'](_0x52d02c(0x1b1),_0xbdbc07=>{_0x1b8892+=_0xbdbc07['toString']();}),_0x53e655[_0x52d02c(0x286)]['on'](_0x52d02c(0x1b1),_0x8fbe89=>{const _0xf9f270=_0x52d02c;_0x3f615d+=_0x8fbe89[_0xf9f270(0x8f)]();}),_0x53e655['on']('error',_0x30551f=>{if(_0x104717)return;_0x104717=!![],clearTimeout(_0x9fe60a),_0x44c3c1(_0x30551f);}),_0x53e655['on']('close',(_0x502647,_0x4a7a90)=>{if(_0x104717)return;_0x104717=!![],clearTimeout(_0x9fe60a),_0x1e35ac({'code':_0x502647,'signal':_0x4a7a90,'stdout':_0x1b8892,'stderr':_0x3f615d});});});}export{resolveRuntimeLarkCliCommand};function resolvePackageNameFromNpmSpec(_0x578ff5){const _0x4fd009=_0x31e6db,_0x251f1f=_0x578ff5['trim']()[_0x4fd009(0x28e)](/^npm:/,'');if(!_0x251f1f)throw new Error(_0x4fd009(0x14f)+_0x4fd009(0x1aa)+_0x4fd009(0x1d4)+'c');if(_0x251f1f[_0x4fd009(0x28d)+'th']('@')){const _0x44615c=_0x251f1f[_0x4fd009(0xaf)]('/');if(_0x44615c===-0x1)throw new Error(_0x4fd009(0x14f)+_0x4fd009(0xcd)+_0x4fd009(0x1f3)+_0x578ff5);const _0x3c3483=_0x251f1f[_0x4fd009(0xaf)]('@',_0x44615c+0x1);return _0x3c3483===-0x1?_0x251f1f:_0x251f1f['slice'](0x0,_0x3c3483);}const _0x272a3a=_0x251f1f[_0x4fd009(0xaf)]('@');return _0x272a3a===-0x1?_0x251f1f:_0x251f1f[_0x4fd009(0x214)](0x0,_0x272a3a);}async function createRuntimeEnv(_0x5c8ff4,_0x559aa7={}){const _0xb5b578=_0x31e6db,_0x5e009a={...process.env,..._0x559aa7},_0x4cbad2=_0x5e009a['OPENCLAW'+_0xb5b578(0xf4)+'IR']||'',_0x284bd0=_0x5e009a[_0xb5b578(0xff)+'IG_REGIS'+_0xb5b578(0x2ec)]||_0xb5b578(0x13f)+_0xb5b578(0xb4)+_0xb5b578(0x2b5)+'or.com',_0x25d628=_0x4cbad2?join(_0x4cbad2,_0xb5b578(0x22c)+_0xb5b578(0x324)+'ls'):join(_0x5c8ff4[_0xb5b578(0x1a8)+'oot'],'.tools'),_0x50f21b=join(_0x25d628,_0xb5b578(0x166)+'al'),_0x520fd9=join(_0x25d628,_0xb5b578(0x277)+'e'),_0x4dd8ac=join(_0x50f21b,_0xb5b578(0x1a1));await mkdir(_0x4dd8ac,{'recursive':!![]}),await mkdir(_0x520fd9,{'recursive':!![]});const _0x27969a=[_0x4dd8ac,dirname(_0x5c8ff4['nodeExec'+'utable']),_0x5e009a[_0xb5b578(0x2a8)]||''];return{..._0x5e009a,'PATH':_0x27969a['filter'](Boolean)[_0xb5b578(0x89)](delimiter),'npm_config_prefix':_0x50f21b,'NPM_CONFIG_PREFIX':_0x50f21b,'npm_config_cache':_0x520fd9,'NPM_CONFIG_CACHE':_0x520fd9,'NPM_CONFIG_REGISTRY':_0x284bd0,'npm_execpath':_0x5c8ff4[_0xb5b578(0x154)],'npm_node_execpath':_0x5c8ff4['nodeExec'+_0xb5b578(0x32e)],'OPENCLAW_RUNTIME_NPM_PREFIX':_0x50f21b,'OPENCLAW_RUNTIME_NPM_BIN':_0x4dd8ac};}export async function getRuntimeSpawnContext(_0x28b9fa,_0x37d4ff={}){const _0x371793=_0x31e6db,_0x29e99e=await loadRuntimeInfo(_0x28b9fa),_0x2cd43d=await createRuntimeEnv(_0x29e99e,_0x37d4ff);return{'cwd':_0x29e99e[_0x371793(0x2f4)+_0x371793(0x294)+'ir'],'env':_0x2cd43d,'runtime':_0x29e99e};}function resolvePluginDirNameFromSpec(_0x9363c2){const _0x2e5d89=_0x31e6db,_0x41a601=resolvePackageNameFromNpmSpec(_0x9363c2),_0x36ec88=_0x41a601[_0x2e5d89(0xbb)]('/')[_0x2e5d89(0x132)](Boolean),_0x4baad4=_0x36ec88['at'](-0x1)??'';if(!_0x4baad4)throw new Error(_0x2e5d89(0x14f)+'plugin\x20s'+_0x2e5d89(0x1f3)+_0x9363c2);return _0x4baad4;}async function resolvePluginIdFromPackageDir(_0x466719,_0x3c1db4){const _0x150167=_0x31e6db,_0x434111=await readJson(join(_0x466719,_0x150167(0x2b2)+_0x150167(0x2e4)),{}),_0x5cbd66=await readPluginManifest(_0x466719),_0x5a0009=[_0x5cbd66?.['id'],_0x5cbd66?.['pluginId'],_0x5cbd66?.[_0x150167(0x22a)],_0x434111?.[_0x150167(0x2f4)]?.['id'],_0x434111?.[_0x150167(0x2f4)+'Id'],_0x3c1db4],_0x37d0f3=_0x5a0009[_0x150167(0x26e)](_0x900f2f=>typeof _0x900f2f===_0x150167(0x315)&&_0x900f2f['trim']());if(!_0x37d0f3)throw new Error('Unable\x20t'+_0x150167(0x29f)+_0x150167(0x9a)+_0x150167(0x201)+'\x20'+_0x466719);return _0x37d0f3['trim']();}function pluginSpecMatches(_0xeda02b,_0x522b98){const _0x824fe4=_0x31e6db,_0xcd656f=_0x522b98['trim'](),_0x433cce=resolvePackageNameFromNpmSpec(_0xcd656f);return[_0xeda02b[_0x824fe4(0x193)],_0xeda02b[_0x824fe4(0x33b)+'Spec'],_0xeda02b[_0x824fe4(0x33b)+'Name']][_0x824fe4(0x314)](_0x4e0cd8=>_0x4e0cd8===_0xcd656f||_0x4e0cd8===_0x433cce);}async function installPluginFromNpmSpec(_0x2630d7,_0x4fb5ee,_0x5653ff={}){const _0x18791c=_0x31e6db,_0x47633b=_0x2630d7['trim']()['replace'](/^npm:/,''),_0xec3d70=resolvePluginDirNameFromSpec(_0x47633b),_0x378351=join(_0x4fb5ee['openclaw'+'WorkingD'+'ir'],'dist',_0x18791c(0x305)+'ns'),_0x2f013f=join(_0x378351,_0xec3d70),_0x2b1273=join(_0x4fb5ee['runtimeR'+_0x18791c(0xa4)],_0x18791c(0xa2)+_0x18791c(0xb5)+process[_0x18791c(0x1e9)]+'-'+Date[_0x18791c(0x32a)]()),_0x593edf=await createRuntimeEnv(_0x4fb5ee),_0x2d98ef=new Date()[_0x18791c(0xa9)+_0x18791c(0x15b)](),_0x504b79=join(_0x4fb5ee[_0x18791c(0x1a8)+_0x18791c(0xa4)],_0x18791c(0x163));await mkdir(_0x504b79,{'recursive':!![]}),await rm(_0x2b1273,{'recursive':!![],'force':!![]}),await rm(_0x2f013f,{'recursive':!![],'force':!![]}),await mkdir(_0x2b1273,{'recursive':!![]}),await mkdir(_0x378351,{'recursive':!![]}),console[_0x18791c(0x144)](_0x18791c(0x31b)+_0x18791c(0x1c4)+'time]\x20fe'+_0x18791c(0x9b)+_0x18791c(0x332)+_0x47633b);const _0x1cde5d=await runProcess(_0x4fb5ee[_0x18791c(0x288)+'utable'],[_0x4fb5ee[_0x18791c(0x154)],'pack',_0x47633b,_0x18791c(0x316)],{'cwd':_0x504b79,'env':_0x593edf,'label':_0x18791c(0x32c)+'\x20'+_0x47633b}),_0x4ae003=parseNpmPackJson(_0x1cde5d[_0x18791c(0x25c)]),_0xd421d4=normalizePackedTarballFilename(_0x4ae003[_0x18791c(0x21b)]),_0x52d16e=join(_0x504b79,_0xd421d4);if(!existsSync(_0x52d16e))throw new Error('npm\x20pack'+'\x20did\x20not'+_0x18791c(0x310)+_0x18791c(0x12c)+'\x20'+_0x52d16e);await runProcess('tar',['-xzf',_0x52d16e,'-C',_0x2b1273],{'label':_0x18791c(0x30f)+_0xd421d4}),await rename(join(_0x2b1273,_0x18791c(0x303)),_0x2f013f),await rm(_0x2b1273,{'recursive':!![],'force':!![]});const _0x1d37a7=join(_0x2f013f,_0x18791c(0x2b2)+_0x18791c(0x2e4)),_0x4c2f62=await readJson(_0x1d37a7,{});(_0x4c2f62[_0x18791c(0x173)+_0x18791c(0x262)]||_0x4c2f62[_0x18791c(0x1dd)])&&(delete _0x4c2f62[_0x18791c(0x173)+_0x18791c(0x262)],delete _0x4c2f62[_0x18791c(0x1dd)],await writeJson(_0x1d37a7,_0x4c2f62));await runProcess(_0x4fb5ee['nodeExec'+_0x18791c(0x32e)],[_0x4fb5ee[_0x18791c(0x154)],_0x18791c(0x335),'--omit=d'+'ev','--omit=p'+_0x18791c(0x170),_0x18791c(0x32b)+'it',_0x18791c(0x224)+'d','--legacy'+_0x18791c(0x101)+'ps'],{'cwd':_0x2f013f,'env':_0x593edf,'label':_0x18791c(0xf3)+_0x18791c(0x19b)+_0x18791c(0x269)+_0x47633b});const _0x196b28=new Date()[_0x18791c(0xa9)+_0x18791c(0x15b)](),_0xbb20d4=await resolvePluginIdFromPackageDir(_0x2f013f,_0x4ae003[_0x18791c(0x22a)]);return _0x5653ff[_0x18791c(0xf8)+_0x18791c(0x318)]?.['info'](_0x18791c(0x88)+_0x18791c(0x2b8)+_0x18791c(0x285),{'spec':_0x47633b,'pluginId':_0xbb20d4,'installPath':_0x2f013f}),{'pluginId':_0xbb20d4,'source':_0x18791c(0x311),'spec':_0x47633b,'installPath':toRuntimeRelative(_0x4fb5ee[_0x18791c(0x1a8)+_0x18791c(0xa4)],_0x2f013f),'version':_0x4ae003['version'],'resolvedName':_0x4ae003['name'],'resolvedVersion':_0x4ae003['version'],'resolvedSpec':_0x4ae003[_0x18791c(0x22a)]+'@'+_0x4ae003[_0x18791c(0x274)],'integrity':typeof _0x4ae003[_0x18791c(0x31f)+'y']==='string'?_0x4ae003[_0x18791c(0x31f)+'y']:'','shasum':typeof _0x4ae003['shasum']==='string'?_0x4ae003[_0x18791c(0x1ea)]:'','resolvedAt':_0x2d98ef,'installedAt':_0x196b28};}async function syncConfiguredNpmPlugins(_0x1c1a44,_0x2ae580,_0x42c9e6,_0x2b401e={}){const _0x1c3b2c=_0x31e6db;if(_0x2b401e[_0x1c3b2c(0x2d1)])return;const _0x168c10=createRuntimeInfoFromManifest(_0x2ae580,_0x42c9e6),_0x4f5143=Array[_0x1c3b2c(0x1e3)](_0x42c9e6['plugins'])?_0x42c9e6[_0x1c3b2c(0xec)]:[],_0x4f6890=[];for(const _0x2c8799 of _0x1c1a44[_0x1c3b2c(0x2f4)]['pluginSp'+_0x1c3b2c(0x2ff)]){const _0x2d7a46=_0x4f5143[_0x1c3b2c(0x26e)](_0x52180e=>_0x52180e?.[_0x1c3b2c(0x215)]===_0x1c3b2c(0x311)&&pluginSpecMatches(_0x52180e,_0x2c8799)&&typeof _0x52180e[_0x1c3b2c(0x207)+_0x1c3b2c(0x2ae)]===_0x1c3b2c(0x315)&&existsSync(resolve(_0x2ae580,_0x52180e[_0x1c3b2c(0x207)+_0x1c3b2c(0x2ae)])));if(_0x2d7a46){_0x4f6890[_0x1c3b2c(0xdf)](_0x2d7a46);continue;}_0x4f6890[_0x1c3b2c(0xdf)](await installPluginFromNpmSpec(_0x2c8799,_0x168c10,_0x2b401e));}const _0xa23c8d=new Set(_0x1c1a44[_0x1c3b2c(0x2f4)][_0x1c3b2c(0x27b)+'ecs'][_0x1c3b2c(0x1e7)](resolvePackageNameFromNpmSpec)),_0x4e3384=_0x4f5143[_0x1c3b2c(0x132)](_0x2f4dea=>_0x2f4dea?.[_0x1c3b2c(0x215)]!==_0x1c3b2c(0x311)||!_0xa23c8d[_0x1c3b2c(0x15f)](resolvePackageNameFromNpmSpec(_0x2f4dea[_0x1c3b2c(0x33b)+_0x1c3b2c(0x2c8)]||_0x2f4dea[_0x1c3b2c(0x193)]||'')));_0x42c9e6[_0x1c3b2c(0xec)]=[..._0x4e3384,..._0x4f6890];}function hasRuntimeDependencies(_0x1f7b5b){const _0x260d65=_0x31e6db,_0x18405e=_0x1f7b5b?.[_0x260d65(0x2a4)+'cies']&&typeof _0x1f7b5b[_0x260d65(0x2a4)+_0x260d65(0x2a3)]===_0x260d65(0xd5)?Object[_0x260d65(0x86)](_0x1f7b5b[_0x260d65(0x2a4)+_0x260d65(0x2a3)]):[],_0x5e9058=_0x1f7b5b?.[_0x260d65(0x2f3)+_0x260d65(0x172)+_0x260d65(0x2a3)]&&typeof _0x1f7b5b['optional'+_0x260d65(0x172)+_0x260d65(0x2a3)]===_0x260d65(0xd5)?Object[_0x260d65(0x86)](_0x1f7b5b[_0x260d65(0x2f3)+_0x260d65(0x172)+'cies']):[];return _0x18405e[_0x260d65(0x118)]>0x0||_0x5e9058['length']>0x0;}async function installLocalPluginRuntimeDependencies(_0x38ba02,_0x124c12,_0x26f298){const _0x489b2a=_0x31e6db,_0x5af5ad=join(_0x38ba02,'package.'+_0x489b2a(0x2e4)),_0x2fab5a=await readJson(_0x5af5ad,{});(_0x2fab5a[_0x489b2a(0x173)+_0x489b2a(0x262)]||_0x2fab5a[_0x489b2a(0x1dd)])&&(delete _0x2fab5a[_0x489b2a(0x173)+_0x489b2a(0x262)],delete _0x2fab5a[_0x489b2a(0x1dd)],await writeJson(_0x5af5ad,_0x2fab5a));if(!hasRuntimeDependencies(_0x2fab5a))return;const _0xd29526=await createRuntimeEnv(_0x124c12);console[_0x489b2a(0x144)](_0x489b2a(0x31b)+_0x489b2a(0x1c4)+_0x489b2a(0x109)+'stalling'+'\x20local\x20p'+_0x489b2a(0x338)+'pendenci'+_0x489b2a(0x27c)+_0x38ba02),await runProcess(_0x124c12['nodeExec'+_0x489b2a(0x32e)],[_0x124c12[_0x489b2a(0x154)],_0x489b2a(0x335),_0x489b2a(0x2a0)+'ev',_0x489b2a(0x2f7)+_0x489b2a(0x170),_0x489b2a(0x32b)+'it',_0x489b2a(0x224)+'d',_0x489b2a(0x31a)+_0x489b2a(0x101)+'ps'],{'cwd':_0x38ba02,'env':_0xd29526,'label':_0x489b2a(0xf3)+_0x489b2a(0x19a)+_0x489b2a(0x24c)+'\x20'+_0x38ba02}),_0x26f298[_0x489b2a(0xf8)+_0x489b2a(0x318)]?.[_0x489b2a(0x2da)](_0x489b2a(0xe3)+_0x489b2a(0x1ac)+'endencie'+_0x489b2a(0xa8)+_0x489b2a(0x2ea),{'installPath':_0x38ba02});}async function syncSharedPluginModules(_0x355b15,_0x28e0fb){const _0x3d59e4=_0x31e6db,_0x4479fb=new Set();for(const _0x26ac77 of _0x355b15){const _0x4c5e47=join(dirname(_0x26ac77),_0x3d59e4(0x178));if(existsSync(_0x4c5e47))_0x4479fb[_0x3d59e4(0x2e8)](_0x4c5e47);}for(const _0x517a58 of _0x4479fb){await copyDirFresh(_0x517a58,join(_0x28e0fb,_0x3d59e4(0x178)));}}async function syncProductPlugins(_0x1d15b4,_0x47aaba,_0x31217,_0x578d4c={}){const _0x405725=_0x31e6db,_0x4fce25=join(_0x47aaba,_0x405725(0x2f4),_0x405725(0xc7),_0x405725(0x305)+'ns'),_0x2d0898=createRuntimeInfoFromManifest(_0x47aaba,_0x31217),_0x43da8f=[];await syncSharedPluginModules(_0x1d15b4[_0x405725(0x2f4)][_0x405725(0x33b)+_0x405725(0x84)+_0x405725(0x138)],_0x4fce25);for(const _0x22a913 of _0x1d15b4['openclaw']['resolved'+_0x405725(0x84)+'ginPaths']){const _0x555a3c=await getPackageMetadata(_0x22a913),_0x53cb84=await readPluginManifest(_0x22a913),_0x1f8dd2=join(_0x4fce25,_0x555a3c[_0x405725(0xe2)]);await copyDirFresh(_0x22a913,_0x1f8dd2),await installLocalPluginRuntimeDependencies(_0x1f8dd2,_0x2d0898,_0x578d4c),_0x43da8f['push']({'pluginId':_0x555a3c[_0x405725(0xe2)],'source':_0x405725(0x165),'spec':_0x405725(0x27f)+_0x22a913,'installPath':toRuntimeRelative(_0x47aaba,_0x1f8dd2),'version':_0x555a3c['version'],'resolvedName':_0x555a3c[_0x405725(0x22a)],'resolvedVersion':_0x555a3c[_0x405725(0x274)],'resolvedSpec':'local:'+_0x22a913,'integrity':'','shasum':'','resolvedAt':new Date()[_0x405725(0xa9)+_0x405725(0x15b)](),'installedAt':new Date()[_0x405725(0xa9)+_0x405725(0x15b)](),'agentScope':_0x53cb84[_0x405725(0x1bf)+'pe'],'skills':_0x53cb84[_0x405725(0x1fd)]});}const _0x1789ca=new Set(_0x43da8f[_0x405725(0x1e7)](_0x5b16d7=>_0x5b16d7['pluginId'])),_0x1e0bd4=Array[_0x405725(0x1e3)](_0x31217[_0x405725(0xec)])?_0x31217['plugins'][_0x405725(0x132)](_0x29ce13=>!_0x1789ca[_0x405725(0x15f)](_0x29ce13[_0x405725(0xe2)])):[];_0x31217[_0x405725(0xec)]=[..._0x1e0bd4,..._0x43da8f];}async function syncManifestPluginScope(_0x1d88b3,_0x247e82,_0x3db35c){const _0x5a3385=_0x31e6db,_0x4cf295=join(_0x247e82,_0x5a3385(0x2f4),'dist','extensio'+'ns'),_0x18043d=new Set(_0x1d88b3['openclaw'][_0x5a3385(0x27b)+_0x5a3385(0x2ff)]??[]),_0x181895=new Set([..._0x18043d]['map'](_0x2440d0=>_0x2440d0[_0x5a3385(0x28e)](/^npm:/,''))['map'](_0x12ecf2=>{const _0x334a18=_0x5a3385;if(_0x12ecf2[_0x334a18(0x28d)+'th']('@')){const _0x2f85dd=_0x12ecf2[_0x334a18(0xbb)]('@');return _0x2f85dd[_0x334a18(0x118)]>=0x3?'@'+_0x2f85dd[0x1]:_0x12ecf2;}return _0x12ecf2[_0x334a18(0xbb)]('@')[0x0];})['filter'](Boolean)),_0x5ee075=new Set();for(const _0x120527 of _0x1d88b3[_0x5a3385(0x2f4)]['resolved'+_0x5a3385(0x84)+_0x5a3385(0x138)]){const _0x22628b=await getPackageMetadata(_0x120527);if(_0x22628b[_0x5a3385(0xe2)])_0x5ee075['add'](_0x22628b[_0x5a3385(0xe2)]);}const _0x4e72cc=Array[_0x5a3385(0x1e3)](_0x3db35c[_0x5a3385(0xec)])?_0x3db35c[_0x5a3385(0xec)]:[];_0x3db35c[_0x5a3385(0x27b)+_0x5a3385(0x2ff)]=[..._0x1d88b3[_0x5a3385(0x2f4)][_0x5a3385(0x27b)+_0x5a3385(0x2ff)],..._0x1d88b3['openclaw'][_0x5a3385(0x33b)+'LocalPlu'+'ginPaths'][_0x5a3385(0x1e7)](_0x5155e2=>_0x5a3385(0x27f)+_0x5155e2)],_0x3db35c[_0x5a3385(0xec)]=_0x4e72cc[_0x5a3385(0x132)](_0x39bc37=>{const _0xf1c5a9=_0x5a3385;if(!_0x39bc37||typeof _0x39bc37!==_0xf1c5a9(0xd5))return![];if(_0x39bc37[_0xf1c5a9(0x215)]===_0xf1c5a9(0x165))return _0x5ee075[_0xf1c5a9(0x15f)](_0x39bc37[_0xf1c5a9(0xe2)]);if(_0x39bc37['source']===_0xf1c5a9(0x311))return _0x18043d['has'](_0x39bc37[_0xf1c5a9(0x193)])||_0x18043d[_0xf1c5a9(0x15f)](_0x39bc37[_0xf1c5a9(0x33b)+'Spec'])||_0x181895[_0xf1c5a9(0x15f)](_0x39bc37[_0xf1c5a9(0x33b)+'Name']);return![];});const _0x1213ea=new Set(_0x3db35c[_0x5a3385(0xec)]['map'](_0x27a7d2=>_0x27a7d2['pluginId']));for(const _0xf0f3bb of _0x4e72cc){if(!_0xf0f3bb['pluginId']||_0x1213ea['has'](_0xf0f3bb[_0x5a3385(0xe2)]))continue;const _0x5c9c5b=typeof _0xf0f3bb['installP'+'ath']===_0x5a3385(0x315)&&_0xf0f3bb[_0x5a3385(0x207)+_0x5a3385(0x2ae)][_0x5a3385(0x293)]()?resolve(_0x247e82,_0xf0f3bb[_0x5a3385(0x207)+_0x5a3385(0x2ae)]):join(_0x4cf295,_0xf0f3bb['pluginId']),_0x17e041=relative(_0x4cf295,_0x5c9c5b);if(_0x17e041[_0x5a3385(0x28d)+'th']('..')||_0x17e041==='')continue;await rm(_0x5c9c5b,{'recursive':!![],'force':!![]});}}async function collectCapabilityEntries(_0x5a1248,_0x14a2ad){const _0x571a42=_0x31e6db,_0x5623f5=new Map();for(const _0x5cbba9 of _0x5a1248){let _0x1d0c27;try{_0x1d0c27=await stat(_0x5cbba9);}catch{throw new Error(_0x14a2ad+(_0x571a42(0x14d)+'s\x20not\x20fo'+_0x571a42(0x167))+_0x5cbba9);}if(!_0x1d0c27[_0x571a42(0xe0)+'ory']())throw new Error(_0x14a2ad+('\x20path\x20mu'+_0x571a42(0x281)+'director'+_0x571a42(0x228))+_0x5cbba9);const _0x4a962d={'name':basename(_0x5cbba9),'path':_0x5cbba9},_0x447556=_0x5623f5[_0x571a42(0x244)](_0x4a962d['name']);if(_0x447556)throw new Error(_0x571a42(0x2f9)+'e\x20'+_0x14a2ad+_0x571a42(0x297)+_0x4a962d['name']+'\x22\x20from\x20'+_0x447556[_0x571a42(0x159)]+_0x571a42(0x1f4)+_0x4a962d[_0x571a42(0x159)]);_0x5623f5['set'](_0x4a962d[_0x571a42(0x22a)],_0x4a962d);}return[..._0x5623f5[_0x571a42(0x2a2)]()];}async function syncProductCapabilityDirs(_0x3e7b50,_0x17b361,_0x4b9c27){const _0x2d0e60=_0x31e6db,_0x181c4d=await collectCapabilityEntries(_0x3e7b50,_0x4b9c27);await rm(_0x17b361,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await mkdir(_0x17b361,{'recursive':!![]});for(const _0x1a8e04 of _0x181c4d){await cp(_0x1a8e04['path'],join(_0x17b361,_0x1a8e04[_0x2d0e60(0x22a)]),{'recursive':!![]});}return _0x181c4d[_0x2d0e60(0x118)];}export const __test__={'collectCapabilityEntries':collectCapabilityEntries,'prunePackagedRuntimePayload':prunePackagedRuntimePayload,'syncProductCapabilityDirs':syncProductCapabilityDirs,'resolveNodeExtractRoot':resolveNodeExtractRoot};async function syncProductAgents(_0x51a1a4,_0x1d7500,_0x4d1cdc){const _0xd230b5=_0x31e6db,_0x2ab384=join(_0x1d7500,'openclaw','agents'),_0x5b55bf=await syncProductCapabilityDirs(_0x51a1a4[_0xd230b5(0x2f4)][_0xd230b5(0x33b)+_0xd230b5(0xc2)+_0xd230b5(0xd6)],_0x2ab384,_0xd230b5(0xd0));_0x4d1cdc['agents']={'source':_0xd230b5(0x156),'installPath':toRuntimeRelative(_0x1d7500,_0x2ab384),'localPaths':_0x51a1a4[_0xd230b5(0x2f4)][_0xd230b5(0x33b)+'LocalAge'+_0xd230b5(0xd6)],'entryCount':_0x5b55bf};}async function syncProductSkills(_0x2d39f4,_0x1c2b28,_0x3f7cf7){const _0x33bf28=_0x31e6db,_0x886de=join(_0x1c2b28,_0x33bf28(0x2f4),'skills'),_0x575718=await syncProductCapabilityDirs(_0x2d39f4[_0x33bf28(0x2f4)][_0x33bf28(0x33b)+'LocalSki'+_0x33bf28(0x1a4)],_0x886de,_0x33bf28(0x283));_0x3f7cf7[_0x33bf28(0x1fd)]={'source':_0x33bf28(0x156),'installPath':toRuntimeRelative(_0x1c2b28,_0x886de),'localPaths':_0x2d39f4[_0x33bf28(0x2f4)][_0x33bf28(0x33b)+_0x33bf28(0xd2)+_0x33bf28(0x1a4)],'entryCount':_0x575718};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x8e24b4,_0x491bdd){const _0x5b75a2=_0x5122,_0x42bbff=_0x8e24b4();while(!![]){try{const _0x1b37eb=-parseInt(_0x5b75a2(0x1dc))/0x1+-parseInt(_0x5b75a2(0x1d9))/0x2+parseInt(_0x5b75a2(0x1ba))/0x3+-parseInt(_0x5b75a2(0x1c6))/0x4*(parseInt(_0x5b75a2(0x181))/0x5)+-parseInt(_0x5b75a2(0x151))/0x6+parseInt(_0x5b75a2(0x140))/0x7+parseInt(_0x5b75a2(0x17e))/0x8*(parseInt(_0x5b75a2(0x162))/0x9);if(_0x1b37eb===_0x491bdd)break;else _0x42bbff['push'](_0x42bbff['shift']());}catch(_0x3d6b17){_0x42bbff['push'](_0x42bbff['shift']());}}}(_0x2647,0xa07e6));export function patchChannelPluginRuntimeFromSource(_0x4180a2,_0x5a26b1={}){const _0x3f06a2=_0x5122,_0x3deb75=_0x5a26b1[_0x3f06a2(0x1a3)+_0x3f06a2(0x19d)+'portPath'];if(!_0x3deb75)return{'patched':![],'reason':'runtime-'+'channel-'+_0x3f06a2(0x148)+'ot-provi'+_0x3f06a2(0x194)};if(_0x4180a2[_0x3f06a2(0x184)](_0x3f06a2(0x153)+_0x3f06a2(0x1a6)+_0x3f06a2(0x198)+'l')){if(_0x4180a2[_0x3f06a2(0x184)](_0x3f06a2(0x18d)+_0x3f06a2(0x15f)+'annel.tu'+_0x3f06a2(0x1aa))&&hasRuntimeChannelImport(_0x4180a2,_0x3deb75))return{'patched':![],'reason':_0x3f06a2(0x1d0)+_0x3f06a2(0x1c9)};return patchExistingChannelPluginRuntimeFromSource(_0x4180a2,{'runtimeChannelImportPath':_0x3deb75});}if(_0x4180a2[_0x3f06a2(0x184)]('wujieCha'+'nnelRunt'+_0x3f06a2(0x1d2)+'se'))return patchExistingChannelPluginRuntimeFromSource(_0x4180a2,{'runtimeChannelImportPath':_0x3deb75});const _0x59d03e=_0x3f06a2(0x14e)+'solvedRu'+_0x3f06a2(0x1bf)+'null;\x0a\x09\x09'+'const\x20re'+'solveRun'+_0x3f06a2(0x1d8)+')\x20=>\x20{\x0a\x09'+_0x3f06a2(0x1a4)+_0x3f06a2(0x19b)+'e\x20??=\x20re'+_0x3f06a2(0x1b7)+_0x3f06a2(0x1c5)+_0x3f06a2(0x1dd)+_0x3f06a2(0x199)+_0x3f06a2(0x17c)+_0x3f06a2(0x1db)+_0x3f06a2(0x197)+_0x3f06a2(0x1da)+_0x3f06a2(0x1a7)+'ntime;\x0a\x09'+'\x09};';if(!_0x4180a2[_0x3f06a2(0x184)](_0x59d03e))return{'patched':![],'reason':_0x3f06a2(0x169)+'d'};const _0x59e0e6='import\x20{'+_0x3f06a2(0x161)+_0x3f06a2(0x187)+'om\x20\x22node'+_0x3f06a2(0x1de)+';';if(!_0x4180a2[_0x3f06a2(0x184)](_0x59e0e6))return{'patched':![],'reason':_0x3f06a2(0x148)+'ot-found'};const _0x568716=_0x3f06a2(0x14e)+_0x3f06a2(0x1a7)+_0x3f06a2(0x1bf)+_0x3f06a2(0x1c7)+'const\x20en'+_0x3f06a2(0x1be)+_0x3f06a2(0x16a)+'RuntimeH'+_0x3f06a2(0x172)+'\x20(runtim'+'e)\x20=>\x20{\x0a'+_0x3f06a2(0x188)+_0x3f06a2(0x167)+_0x3f06a2(0x1ad)+_0x3f06a2(0x19e)+'e\x20!==\x20\x22o'+_0x3f06a2(0x150)+_0x3f06a2(0x15d)+_0x3f06a2(0x1c8)+_0x3f06a2(0x14a)+'untime.c'+'hannel?.'+'turn?.ru'+'n\x20&&\x20run'+_0x3f06a2(0x1e0)+_0x3f06a2(0x1ab)+_0x3f06a2(0x16f)+_0x3f06a2(0x1c3)+_0x3f06a2(0x163)+_0x3f06a2(0x14f)+_0x3f06a2(0x1cb)+_0x3f06a2(0x1a2)+_0x3f06a2(0x152)+'jieCreat'+_0x3f06a2(0x16c)+'Channel('+_0x3f06a2(0x1b0)+_0x3f06a2(0x173)+_0x3f06a2(0x19f)+_0x3f06a2(0x17f)+_0x3f06a2(0x1b5)+_0x3f06a2(0x193)+_0x3f06a2(0x191)+_0x3f06a2(0x1c0)+'channel\x20'+_0x3f06a2(0x1cd)+_0x3f06a2(0x1b2)+_0x3f06a2(0x170)+'hannel\x20:'+_0x3f06a2(0x18f)+_0x3f06a2(0x1c0)+_0x3f06a2(0x175)+_0x3f06a2(0x171)+'...chann'+_0x3f06a2(0x1df)+_0x3f06a2(0x156)+'..existi'+_0x3f06a2(0x16d)+'l,\x0a\x09\x09\x09\x09r'+_0x3f06a2(0x168)+_0x3f06a2(0x164)+_0x3f06a2(0x1cc)+_0x3f06a2(0x16e)+_0x3f06a2(0x1a3)+'ontexts\x20'+_0x3f06a2(0x141)+_0x3f06a2(0x1df)+_0x3f06a2(0x14d)+'eContext'+_0x3f06a2(0x1b1)+_0x3f06a2(0x179)+'existing'+_0x3f06a2(0x16e)+_0x3f06a2(0x1ae)+_0x3f06a2(0x141)+'elRuntim'+_0x3f06a2(0x192)+_0x3f06a2(0x1af)+'urn:\x20exi'+_0x3f06a2(0x174)+_0x3f06a2(0x17a)+_0x3f06a2(0x154)+_0x3f06a2(0x174)+_0x3f06a2(0x18e)+_0x3f06a2(0x149)+_0x3f06a2(0x15b)+_0x3f06a2(0x158)+'urn\x20??\x20c'+'hannelRu'+_0x3f06a2(0x155)+_0x3f06a2(0x159)+_0x3f06a2(0x1a9)+_0x3f06a2(0x146)+'ngChanne'+'l.reply\x20'+_0x3f06a2(0x141)+'elRuntim'+_0x3f06a2(0x182)+'\x0a\x09\x09\x09\x09ses'+'sion:\x20ex'+_0x3f06a2(0x15f)+_0x3f06a2(0x15e)+_0x3f06a2(0x1b4)+_0x3f06a2(0x178)+_0x3f06a2(0x1d6)+_0x3f06a2(0x186)+_0x3f06a2(0x143)+_0x3f06a2(0x145)+'runtime;'+_0x3f06a2(0x1d1)+'const\x20re'+'solveRun'+_0x3f06a2(0x1d8)+_0x3f06a2(0x189)+_0x3f06a2(0x1a4)+'edRuntim'+_0x3f06a2(0x1e1)+_0x3f06a2(0x1be)+'eChannel'+_0x3f06a2(0x1a8)+_0x3f06a2(0x1a5)+_0x3f06a2(0x17b)+_0x3f06a2(0x165)+_0x3f06a2(0x180)+_0x3f06a2(0x19a)+(_0x3f06a2(0x1b9)+'imeOptio'+_0x3f06a2(0x17d)+'\x09return\x20'+'resolved'+_0x3f06a2(0x1bd)+'\x0a\x09\x09};');return{'patched':!![],'source':_0x4180a2[_0x3f06a2(0x1b8)](_0x59e0e6,_0x59e0e6+'\x0a'+createRuntimeChannelImport(_0x3deb75))[_0x3f06a2(0x1b8)](_0x59d03e,_0x568716)};}function patchExistingChannelPluginRuntimeFromSource(_0x1770f9,_0x667c){const _0x4ad992=_0x5122,{runtimeChannelImportPath:_0xee7034}=_0x667c,_0x19d524=_0x4ad992(0x1d7)+_0x4ad992(0x161)+_0x4ad992(0x187)+_0x4ad992(0x147)+_0x4ad992(0x1de)+';';if(!_0x1770f9[_0x4ad992(0x184)](_0x19d524))return{'patched':![],'reason':_0x4ad992(0x148)+_0x4ad992(0x1cf)};const _0x3c7598=_0x4ad992(0x14e)+'solvedRu'+_0x4ad992(0x1bf)+_0x4ad992(0x1c1),_0x2706f9=_0x4ad992(0x1b6)+_0x4ad992(0x15a)+_0x4ad992(0x176)+_0x4ad992(0x18a)+_0x4ad992(0x18b)+_0x4ad992(0x142)+_0x4ad992(0x177)+'ME_REFLE'+_0x4ad992(0x14b)+_0x4ad992(0x1d3),_0x41265b=_0x1770f9[_0x4ad992(0x1d4)](_0x3c7598),_0xde6fee=_0x1770f9[_0x4ad992(0x1d4)](_0x2706f9,_0x41265b);if(_0x41265b===-0x1||_0xde6fee===-0x1)return{'patched':![],'reason':_0x4ad992(0x169)+'d'};const _0x58805d=_0x4ad992(0x14e)+_0x4ad992(0x1a7)+'ntime\x20=\x20'+_0x4ad992(0x1c7)+'const\x20en'+_0x4ad992(0x1be)+_0x4ad992(0x16a)+_0x4ad992(0x1a8)+'elpers\x20='+_0x4ad992(0x183)+'e)\x20=>\x20{\x0a'+_0x4ad992(0x188)+_0x4ad992(0x167)+_0x4ad992(0x1ad)+_0x4ad992(0x19e)+'e\x20!==\x20\x22o'+'bject\x22)\x20'+_0x4ad992(0x15d)+'untime;\x0a'+_0x4ad992(0x14a)+_0x4ad992(0x170)+_0x4ad992(0x1c4)+'turn?.ru'+_0x4ad992(0x185)+_0x4ad992(0x1e0)+'nnel?.in'+_0x4ad992(0x16f)+_0x4ad992(0x1c3)+_0x4ad992(0x163)+'me;\x0a\x09\x09\x09c'+_0x4ad992(0x1cb)+_0x4ad992(0x1a2)+_0x4ad992(0x152)+'jieCreat'+_0x4ad992(0x16c)+'Channel('+_0x4ad992(0x1b0)+_0x4ad992(0x173)+'tingChan'+_0x4ad992(0x17f)+_0x4ad992(0x1b5)+'annel\x20&&'+_0x4ad992(0x191)+_0x4ad992(0x1c0)+_0x4ad992(0x175)+_0x4ad992(0x1cd)+'ect\x22\x20?\x20r'+_0x4ad992(0x170)+'hannel\x20:'+_0x4ad992(0x18f)+_0x4ad992(0x1c0)+_0x4ad992(0x175)+_0x4ad992(0x171)+_0x4ad992(0x1a0)+_0x4ad992(0x1df)+_0x4ad992(0x156)+'..existi'+_0x4ad992(0x16d)+_0x4ad992(0x16b)+_0x4ad992(0x168)+_0x4ad992(0x164)+'existing'+_0x4ad992(0x16e)+_0x4ad992(0x1a3)+_0x4ad992(0x18c)+_0x4ad992(0x141)+_0x4ad992(0x1df)+_0x4ad992(0x14d)+_0x4ad992(0x1ac)+_0x4ad992(0x1b1)+'nbound:\x20'+_0x4ad992(0x1cc)+'Channel.'+_0x4ad992(0x1ae)+_0x4ad992(0x141)+_0x4ad992(0x1df)+_0x4ad992(0x192)+_0x4ad992(0x1af)+_0x4ad992(0x1bb)+_0x4ad992(0x174)+_0x4ad992(0x17a)+'n\x20??\x20exi'+_0x4ad992(0x174)+_0x4ad992(0x18e)+'ound\x20??\x20'+_0x4ad992(0x15b)+_0x4ad992(0x158)+_0x4ad992(0x19c)+'hannelRu'+_0x4ad992(0x155)+_0x4ad992(0x159)+_0x4ad992(0x1a9)+_0x4ad992(0x146)+'ngChanne'+_0x4ad992(0x1b3)+_0x4ad992(0x141)+_0x4ad992(0x1df)+_0x4ad992(0x182)+_0x4ad992(0x157)+_0x4ad992(0x1ca)+_0x4ad992(0x15f)+_0x4ad992(0x15e)+_0x4ad992(0x1b4)+_0x4ad992(0x178)+_0x4ad992(0x1d6)+_0x4ad992(0x186)+_0x4ad992(0x143)+_0x4ad992(0x145)+_0x4ad992(0x14c)+_0x4ad992(0x1d1)+_0x4ad992(0x144)+'solveRun'+_0x4ad992(0x1d8)+_0x4ad992(0x189)+_0x4ad992(0x1a4)+_0x4ad992(0x19b)+'e\x20??=\x20en'+'sureWuji'+_0x4ad992(0x16a)+_0x4ad992(0x1a8)+_0x4ad992(0x1a5)+'esolveCr'+'eatePlug'+_0x4ad992(0x180)+_0x4ad992(0x19a)+('ons.runt'+_0x4ad992(0x15c)+'ns));\x0a\x09\x09'+_0x4ad992(0x145)+_0x4ad992(0x1a1)+_0x4ad992(0x1bd)+_0x4ad992(0x1bc)),_0x54a858=_0x1770f9[_0x4ad992(0x190)](0x0,_0x41265b)+_0x58805d+_0x1770f9[_0x4ad992(0x190)](_0xde6fee);return{'patched':!![],'source':ensureRuntimeChannelImport(_0x54a858,{'importMarker':_0x19d524,'runtimeChannelImportPath':_0xee7034})};}function createRuntimeChannelImport(_0x5061b5){const _0x79c9de=_0x5122;return _0x79c9de(0x1d7)+_0x79c9de(0x1ce)+_0x79c9de(0x196)+_0x79c9de(0x160)+_0x79c9de(0x1c2)+'eateRunt'+_0x79c9de(0x166)+_0x79c9de(0x1d5)+'m\x20\x22'+_0x5061b5+'\x22;';}function _0x5122(_0x5d1c12,_0x4695af){_0x5d1c12=_0x5d1c12-0x140;const _0x264714=_0x2647();let _0x5122e9=_0x264714[_0x5d1c12];return _0x5122e9;}function hasRuntimeChannelImport(_0x29e942,_0x35c8b5){const _0x1d7a4d=_0x5122;return _0x29e942[_0x1d7a4d(0x184)](createRuntimeChannelImport(_0x35c8b5));}function ensureRuntimeChannelImport(_0x502f29,{importMarker:_0x5e5f96,runtimeChannelImportPath:_0xd2f11e}){const _0x4688df=_0x5122,_0x11f8c6=createRuntimeChannelImport(_0xd2f11e),_0x4fc430=/import \{ createRuntimeChannel as wujieCreateRuntimeChannel \} from "\.\/runtime-channel-[^"]+\.js";\n?/;if(_0x4fc430[_0x4688df(0x195)](_0x502f29))return _0x502f29['replace'](_0x4fc430,_0x11f8c6+'\x0a');return _0x502f29[_0x4688df(0x1b8)](_0x5e5f96,_0x5e5f96+'\x0a'+_0x11f8c6);}function _0x2647(){const _0x21b3ca=['ns));\x0a\x09\x09','280qyuKTa','nel\x20=\x20ru','inRuntim','185fyPPuA','e.reply,','\x20(runtim','includes','n\x20&&\x20run','session\x0a','ash\x20}\x20fr','\x09\x09\x09if\x20(!',')\x20=>\x20{\x0a\x09','ctionKey','Set\x20=\x20ne','ontexts\x20','turn:\x20ex','nnel.inb','\x20{};\x0a\x09\x09\x09','slice','\x20typeof\x20','e.inboun','annel\x20&&','ded','test','untimeCh','s);\x0a\x09\x09\x09r','meChanne','()(optio','e()(opti','edRuntim','urn\x20??\x20c','hannelIm','f\x20runtim','tingChan','...chann','resolved','nnelRunt','runtimeC','\x09\x09resolv','elpers(r','ateRunti','solvedRu','RuntimeH','\x09\x09\x09reply','rn\x20??','nnel?.in','eContext','||\x20typeo','inbound\x20','d,\x0a\x09\x09\x09\x09t',');\x0a\x09\x09\x09co','s,\x0a\x09\x09\x09\x09i','ect\x22\x20?\x20r','l.reply\x20','ssion\x20??','ntime.ch','\x09\x09const\x20','solveCre','replace','ons.runt','2530983JBAOza','urn:\x20exi','\x0a\x09\x09};\x0a','Runtime;','sureWuji','ntime\x20=\x20','runtime.','null;','\x20wujieCr','un)\x20retu','hannel?.','atePlugi','118316uuqAVi','null;\x0a\x09\x09','untime;\x0a','patched','sion:\x20ex','onst\x20cha','existing','===\x20\x22obj','\x20createR','ot-found','already-','\x0a\x09\x09};\x0a\x09\x09','imePromi','YS);','indexOf','el\x20}\x20fro','Runtime.','import\x20{','time\x20=\x20(','717426YEDuEO','eturn\x20re','meOption','228525kYxkPM','nRuntime',':crypto\x22','elRuntim','time.cha','e\x20??=\x20en','5675978TOUzAg','??\x20chann','w\x20Set(LA','\x09\x09\x09};\x0a\x09\x09','const\x20re','\x09return\x20',':\x20existi','om\x20\x22node','import-n','ound\x20??\x20','\x09\x09\x09if\x20(r','CTION_KE','runtime;','e.runtim','\x09\x09let\x20re','me;\x0a\x09\x09\x09c','bject\x22)\x20','1770942WTjQoo','ime\x20=\x20wu','wujieCre','n\x20??\x20exi','ntime.in','e,\x0a\x09\x09\x09\x09.','\x0a\x09\x09\x09\x09ses','untime.t','bound,\x0a\x09','lazyRunt','channelR','imeOptio','return\x20r','annel.se','istingCh','annel\x20as','\x20createH','251919RWjNku','rn\x20runti','ntexts:\x20','eatePlug','imeChann','runtime\x20','untimeCo','not-foun','eChannel','l,\x0a\x09\x09\x09\x09r','eRuntime','ngChanne','Channel.','bound?.r','untime.c','=\x20{\x0a\x09\x09\x09\x09','elpers\x20=','nst\x20exis','stingCha','channel\x20','imeRefle','ZY_RUNTI','\x20channel','nbound:\x20','nnel.tur','esolveCr','ns.runti'];_0x2647=function(){return _0x21b3ca;};return _0x2647();}
|
|
1
|
+
(function(_0x35ec98,_0x2cbdfa){const _0x55e56c=_0x2fe5,_0x1a101d=_0x35ec98();while(!![]){try{const _0x1dad4c=parseInt(_0x55e56c(0x28c))/0x1+parseInt(_0x55e56c(0x220))/0x2*(parseInt(_0x55e56c(0x282))/0x3)+-parseInt(_0x55e56c(0x1f2))/0x4+-parseInt(_0x55e56c(0x228))/0x5*(-parseInt(_0x55e56c(0x28b))/0x6)+parseInt(_0x55e56c(0x287))/0x7+-parseInt(_0x55e56c(0x245))/0x8*(-parseInt(_0x55e56c(0x27e))/0x9)+-parseInt(_0x55e56c(0x274))/0xa;if(_0x1dad4c===_0x2cbdfa)break;else _0x1a101d['push'](_0x1a101d['shift']());}catch(_0x317f09){_0x1a101d['push'](_0x1a101d['shift']());}}}(_0x5638,0x9e668));export function patchChannelPluginRuntimeFromSource(_0x1af087,_0x44e52a={}){const _0x354928=_0x2fe5,_0xa80516=_0x44e52a['runtimeC'+_0x354928(0x208)+'portPath'];if(!_0xa80516)return{'patched':![],'reason':'runtime-'+_0x354928(0x1ec)+_0x354928(0x244)+_0x354928(0x20a)+'ded'};if(_0x1af087[_0x354928(0x26a)](_0x354928(0x24e)+_0x354928(0x258)+'meChanne'+'l')){if(_0x1af087['includes'](_0x354928(0x23e)+'istingCh'+_0x354928(0x22d)+'rn\x20??')&&hasRuntimeChannelImport(_0x1af087,_0xa80516))return{'patched':![],'reason':'already-'+_0x354928(0x276)};return patchExistingChannelPluginRuntimeFromSource(_0x1af087,{'runtimeChannelImportPath':_0xa80516});}if(_0x1af087[_0x354928(0x26a)]('wujieCha'+_0x354928(0x26e)+_0x354928(0x237)+'se'))return patchExistingChannelPluginRuntimeFromSource(_0x1af087,{'runtimeChannelImportPath':_0xa80516});const _0x3881f9=_0x354928(0x259)+_0x354928(0x25c)+_0x354928(0x288)+_0x354928(0x22b)+_0x354928(0x267)+_0x354928(0x1f3)+_0x354928(0x1fb)+_0x354928(0x227)+'\x09\x09resolv'+'edRuntim'+_0x354928(0x241)+_0x354928(0x23a)+_0x354928(0x260)+_0x354928(0x273)+_0x354928(0x221)+_0x354928(0x257)+_0x354928(0x262)+_0x354928(0x207)+'eturn\x20re'+_0x354928(0x25c)+_0x354928(0x278)+_0x354928(0x224);if(!_0x1af087[_0x354928(0x26a)](_0x3881f9))return{'patched':![],'reason':'not-foun'+'d'};const _0x429089=_0x354928(0x20b)+_0x354928(0x206)+_0x354928(0x277)+_0x354928(0x240)+_0x354928(0x264)+';';if(!_0x1af087[_0x354928(0x26a)](_0x429089))return{'patched':![],'reason':_0x354928(0x244)+'ot-found'};const _0x4691e0=_0x354928(0x259)+_0x354928(0x25c)+_0x354928(0x288)+_0x354928(0x22b)+_0x354928(0x27b)+_0x354928(0x1fc)+'eChannel'+_0x354928(0x1fd)+_0x354928(0x23b)+_0x354928(0x24c)+'e)\x20=>\x20{\x0a'+'\x09\x09\x09if\x20(!'+_0x354928(0x286)+'||\x20typeo'+'f\x20runtim'+_0x354928(0x25e)+'bject\x22)\x20'+'return\x20r'+_0x354928(0x22a)+_0x354928(0x219)+_0x354928(0x1f4)+_0x354928(0x21c)+_0x354928(0x243)+'n\x20&&\x20run'+_0x354928(0x24a)+_0x354928(0x1f6)+_0x354928(0x1fe)+_0x354928(0x239)+_0x354928(0x231)+_0x354928(0x25f)+_0x354928(0x201)+_0x354928(0x26e)+_0x354928(0x223)+_0x354928(0x236)+_0x354928(0x232)+_0x354928(0x253)+');\x0a\x09\x09\x09co'+'nst\x20exis'+_0x354928(0x275)+_0x354928(0x238)+_0x354928(0x268)+_0x354928(0x247)+_0x354928(0x27f)+'runtime.'+_0x354928(0x24f)+_0x354928(0x21b)+_0x354928(0x1f5)+_0x354928(0x1f4)+_0x354928(0x24d)+'\x20{};\x0a\x09\x09\x09'+'runtime.'+_0x354928(0x24f)+'=\x20{\x0a\x09\x09\x09\x09'+_0x354928(0x20d)+_0x354928(0x255)+_0x354928(0x28a)+_0x354928(0x26c)+_0x354928(0x283)+_0x354928(0x1ed)+_0x354928(0x1ee)+_0x354928(0x215)+_0x354928(0x211)+'Channel.'+_0x354928(0x20f)+_0x354928(0x28d)+_0x354928(0x225)+_0x354928(0x255)+'e.runtim'+'eContext'+_0x354928(0x266)+_0x354928(0x212)+_0x354928(0x211)+'Channel.'+_0x354928(0x285)+_0x354928(0x225)+_0x354928(0x255)+'e.inboun'+_0x354928(0x203)+_0x354928(0x234)+_0x354928(0x24b)+_0x354928(0x270)+_0x354928(0x235)+'stingCha'+_0x354928(0x254)+'ound\x20??\x20'+_0x354928(0x249)+'untime.t'+_0x354928(0x20c)+_0x354928(0x204)+_0x354928(0x226)+_0x354928(0x265)+_0x354928(0x261)+_0x354928(0x22c)+_0x354928(0x283)+_0x354928(0x23d)+_0x354928(0x225)+_0x354928(0x255)+_0x354928(0x25b)+_0x354928(0x289)+_0x354928(0x21f)+_0x354928(0x279)+_0x354928(0x1ff)+_0x354928(0x248)+_0x354928(0x26d)+_0x354928(0x246)+_0x354928(0x284)+_0x354928(0x217)+_0x354928(0x20e)+_0x354928(0x213)+_0x354928(0x251)+_0x354928(0x267)+_0x354928(0x1f3)+_0x354928(0x1fb)+_0x354928(0x227)+_0x354928(0x1fa)+'edRuntim'+_0x354928(0x281)+_0x354928(0x1fc)+_0x354928(0x218)+_0x354928(0x1fd)+_0x354928(0x26b)+_0x354928(0x1eb)+_0x354928(0x1f9)+'inRuntim'+_0x354928(0x230)+(_0x354928(0x1ea)+_0x354928(0x250)+_0x354928(0x25d)+'\x09return\x20'+_0x354928(0x256)+'Runtime;'+'\x0a\x09\x09};');return{'patched':!![],'source':_0x1af087['replace'](_0x429089,_0x429089+'\x0a'+createRuntimeChannelImport(_0xa80516))[_0x354928(0x21e)](_0x3881f9,_0x4691e0)};}function patchExistingChannelPluginRuntimeFromSource(_0x216d68,_0x51943a){const _0x5a0b99=_0x2fe5,{runtimeChannelImportPath:_0x521964}=_0x51943a,_0x4ab883=_0x5a0b99(0x20b)+_0x5a0b99(0x206)+_0x5a0b99(0x277)+_0x5a0b99(0x240)+_0x5a0b99(0x264)+';';if(!_0x216d68[_0x5a0b99(0x26a)](_0x4ab883))return{'patched':![],'reason':_0x5a0b99(0x244)+_0x5a0b99(0x216)};const _0x7d2c7e='\x09\x09let\x20re'+_0x5a0b99(0x25c)+_0x5a0b99(0x288)+'null;',_0x341d77=_0x5a0b99(0x22f)+_0x5a0b99(0x1f7)+_0x5a0b99(0x1f8)+_0x5a0b99(0x210)+_0x5a0b99(0x27a)+_0x5a0b99(0x21a)+'ZY_RUNTI'+'ME_REFLE'+_0x5a0b99(0x1f1)+'YS);',_0x1fc864=_0x216d68[_0x5a0b99(0x28e)](_0x7d2c7e),_0x17cb4a=_0x216d68[_0x5a0b99(0x28e)](_0x341d77,_0x1fc864);if(_0x1fc864===-0x1||_0x17cb4a===-0x1)return{'patched':![],'reason':_0x5a0b99(0x280)+'d'};const _0x3af4c3=_0x5a0b99(0x259)+'solvedRu'+_0x5a0b99(0x288)+_0x5a0b99(0x22b)+_0x5a0b99(0x27b)+_0x5a0b99(0x1fc)+_0x5a0b99(0x218)+'RuntimeH'+_0x5a0b99(0x23b)+'\x20(runtim'+_0x5a0b99(0x272)+_0x5a0b99(0x1ef)+'runtime\x20'+_0x5a0b99(0x21d)+_0x5a0b99(0x229)+'e\x20!==\x20\x22o'+'bject\x22)\x20'+_0x5a0b99(0x200)+_0x5a0b99(0x22a)+_0x5a0b99(0x219)+_0x5a0b99(0x1f4)+'hannel?.'+_0x5a0b99(0x243)+'n\x20&&\x20run'+_0x5a0b99(0x24a)+'nnel?.in'+_0x5a0b99(0x1fe)+_0x5a0b99(0x239)+_0x5a0b99(0x231)+_0x5a0b99(0x25f)+_0x5a0b99(0x201)+'nnelRunt'+_0x5a0b99(0x223)+_0x5a0b99(0x236)+_0x5a0b99(0x232)+_0x5a0b99(0x253)+_0x5a0b99(0x269)+_0x5a0b99(0x252)+_0x5a0b99(0x275)+_0x5a0b99(0x238)+_0x5a0b99(0x268)+'annel\x20&&'+_0x5a0b99(0x27f)+_0x5a0b99(0x214)+_0x5a0b99(0x24f)+_0x5a0b99(0x21b)+_0x5a0b99(0x1f5)+_0x5a0b99(0x1f4)+_0x5a0b99(0x24d)+'\x20{};\x0a\x09\x09\x09'+_0x5a0b99(0x214)+'channel\x20'+_0x5a0b99(0x26f)+_0x5a0b99(0x20d)+_0x5a0b99(0x255)+_0x5a0b99(0x28a)+_0x5a0b99(0x26c)+_0x5a0b99(0x283)+'l,\x0a\x09\x09\x09\x09r'+_0x5a0b99(0x1ee)+_0x5a0b99(0x215)+_0x5a0b99(0x211)+_0x5a0b99(0x263)+'runtimeC'+'ontexts\x20'+_0x5a0b99(0x225)+_0x5a0b99(0x255)+'e.runtim'+_0x5a0b99(0x202)+_0x5a0b99(0x266)+_0x5a0b99(0x212)+_0x5a0b99(0x211)+_0x5a0b99(0x263)+'inbound\x20'+_0x5a0b99(0x225)+'elRuntim'+_0x5a0b99(0x205)+_0x5a0b99(0x203)+'urn:\x20exi'+_0x5a0b99(0x24b)+_0x5a0b99(0x270)+'n\x20??\x20exi'+'stingCha'+_0x5a0b99(0x254)+_0x5a0b99(0x271)+_0x5a0b99(0x249)+_0x5a0b99(0x22e)+'urn\x20??\x20c'+_0x5a0b99(0x204)+_0x5a0b99(0x226)+_0x5a0b99(0x265)+'\x09\x09\x09reply'+_0x5a0b99(0x22c)+_0x5a0b99(0x283)+_0x5a0b99(0x23d)+_0x5a0b99(0x225)+_0x5a0b99(0x255)+_0x5a0b99(0x25b)+_0x5a0b99(0x289)+_0x5a0b99(0x21f)+_0x5a0b99(0x279)+_0x5a0b99(0x1ff)+_0x5a0b99(0x248)+'\x20channel'+_0x5a0b99(0x246)+_0x5a0b99(0x284)+_0x5a0b99(0x217)+_0x5a0b99(0x20e)+_0x5a0b99(0x213)+_0x5a0b99(0x251)+_0x5a0b99(0x267)+'solveRun'+_0x5a0b99(0x1fb)+_0x5a0b99(0x227)+'\x09\x09resolv'+_0x5a0b99(0x25a)+'e\x20??=\x20en'+'sureWuji'+_0x5a0b99(0x218)+_0x5a0b99(0x1fd)+_0x5a0b99(0x26b)+_0x5a0b99(0x1eb)+_0x5a0b99(0x1f9)+_0x5a0b99(0x27d)+_0x5a0b99(0x230)+('ons.runt'+_0x5a0b99(0x250)+_0x5a0b99(0x25d)+_0x5a0b99(0x20e)+_0x5a0b99(0x256)+_0x5a0b99(0x242)+_0x5a0b99(0x209)),_0xa6c178=_0x216d68[_0x5a0b99(0x222)](0x0,_0x1fc864)+_0x3af4c3+_0x216d68[_0x5a0b99(0x222)](_0x17cb4a);return{'patched':!![],'source':ensureRuntimeChannelImport(_0xa6c178,{'importMarker':_0x4ab883,'runtimeChannelImportPath':_0x521964})};}function _0x2fe5(_0x1de88b,_0x150fdd){_0x1de88b=_0x1de88b-0x1ea;const _0x5638d0=_0x5638();let _0x2fe525=_0x5638d0[_0x1de88b];return _0x2fe525;}function createRuntimeChannelImport(_0x515c12){const _0x2975cf=_0x2fe5;return'import\x20{'+'\x20createR'+'untimeCh'+_0x2975cf(0x1f0)+'\x20wujieCr'+_0x2975cf(0x23f)+'imeChann'+_0x2975cf(0x23c)+_0x2975cf(0x27c)+_0x515c12+'\x22;';}function hasRuntimeChannelImport(_0x219cdf,_0x2fe4e6){const _0x14704e=_0x2fe5;return _0x219cdf[_0x14704e(0x26a)](createRuntimeChannelImport(_0x2fe4e6));}function ensureRuntimeChannelImport(_0x15423d,{importMarker:_0x3d814a,runtimeChannelImportPath:_0xd1f5a0}){const _0x52908a=_0x2fe5,_0x5babdf=createRuntimeChannelImport(_0xd1f5a0),_0x44408d=/import \{ createRuntimeChannel as wujieCreateRuntimeChannel \} from "\.\/runtime-channel-[^"]+\.js";\n?/;if(_0x44408d[_0x52908a(0x233)](_0x15423d))return _0x15423d[_0x52908a(0x21e)](_0x44408d,_0x5babdf+'\x0a');return _0x15423d[_0x52908a(0x21e)](_0x3d814a,_0x3d814a+'\x0a'+_0x5babdf);}function _0x5638(){const _0x364af8=['indexOf','ons.runt','esolveCr','channel-','l,\x0a\x09\x09\x09\x09r','untimeCo','\x09\x09\x09if\x20(!','annel\x20as','CTION_KE','3115128SjzDaX','solveRun','untime.c','ect\x22\x20?\x20r','nnel?.in','lazyRunt','imeRefle','eatePlug','\x09\x09resolv','time\x20=\x20(','sureWuji','RuntimeH','bound?.r','annel.se','return\x20r','onst\x20cha','eContext','d,\x0a\x09\x09\x09\x09t','hannelRu','e.inboun','\x20createH','s);\x0a\x09\x09\x09r','hannelIm','\x0a\x09\x09};\x0a','ot-provi','import\x20{','urn\x20??\x20c','...chann','\x09return\x20','runtimeC','ctionKey','existing','nbound:\x20','runtime;','runtime.','ntexts:\x20','ot-found','\x09\x09\x09};\x0a\x09\x09','eChannel','\x09\x09\x09if\x20(r','w\x20Set(LA','===\x20\x22obj','hannel?.','||\x20typeo','replace','sion:\x20ex','2nfgZJW','()(optio','slice','ime\x20=\x20wu','\x09};','??\x20chann','ntime.in',')\x20=>\x20{\x0a\x09','5355jbXsXF','f\x20runtim','untime;\x0a','null;\x0a\x09\x09',':\x20existi','annel.tu','untime.t','\x09\x09const\x20','e()(opti','rn\x20runti','eRuntime','test','urn:\x20exi','n\x20??\x20exi','jieCreat','imePromi','nel\x20=\x20ru','un)\x20retu','solveCre','elpers\x20=','el\x20}\x20fro','l.reply\x20','turn:\x20ex','eateRunt','om\x20\x22node','e\x20??=\x20re','Runtime;','turn?.ru','import-n','3088952RvfVzb','Runtime.','annel\x20&&','ssion\x20??','channelR','time.cha','stingCha','\x20(runtim','hannel\x20:','wujieCre','channel\x20','imeOptio','\x0a\x09\x09};\x0a\x09\x09','nst\x20exis','Channel(','nnel.inb','elRuntim','resolved','ns.runti','ateRunti','\x09\x09let\x20re','edRuntim','e.reply,','solvedRu','ns));\x0a\x09\x09','e\x20!==\x20\x22o','me;\x0a\x09\x09\x09c','atePlugi','\x09\x09\x09reply','meOption','Channel.',':crypto\x22','bound,\x0a\x09','s,\x0a\x09\x09\x09\x09i','const\x20re','ntime.ch',');\x0a\x09\x09\x09co','includes','elpers(r','..existi','\x20channel','nnelRunt','=\x20{\x0a\x09\x09\x09\x09','nnel.tur','ound\x20??\x20','e)\x20=>\x20{\x0a','nRuntime','26382590zIrMfr','tingChan','patched','ash\x20}\x20fr','ntime;\x0a\x09','istingCh','Set\x20=\x20ne','const\x20en','m\x20\x22','inRuntim','18PVXKkD','\x20typeof\x20','not-foun','e\x20??=\x20en','3429339eKjrwO','ngChanne','session\x0a','inbound\x20','runtime\x20','235788GFjLrR','ntime\x20=\x20','\x0a\x09\x09\x09\x09ses','e,\x0a\x09\x09\x09\x09.','5826ZnnzLT','1076873sldTuo','ontexts\x20'];_0x5638=function(){return _0x364af8;};return _0x5638();}
|