@wujie-shell/core 3.0.2 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/wujie-shell.mjs +1 -1
- package/dist/src/agents/bundled-agent-skills.mjs +1 -1
- package/dist/src/agents/bundled-agents.mjs +1 -1
- package/dist/src/chat/media-archive.mjs +1 -1
- package/dist/src/chat/queue.mjs +1 -1
- package/dist/src/common/diagnostics.mjs +1 -1
- package/dist/src/common/logging.mjs +1 -1
- package/dist/src/common/runtime-logger.mjs +1 -1
- package/dist/src/common/user-events.mjs +1 -1
- package/dist/src/common/utils.mjs +1 -1
- package/dist/src/config/controller.mjs +1 -1
- package/dist/src/connectors/config-utils.mjs +1 -1
- package/dist/src/connectors/constants.mjs +1 -1
- package/dist/src/connectors/controller.mjs +1 -1
- package/dist/src/connectors/kdocs-cli.mjs +1 -1
- package/dist/src/electron/main.mjs +1 -1
- package/dist/src/electron/preload.mjs +1 -1
- package/dist/src/files/generated-files-store.mjs +1 -1
- package/dist/src/files/handlers.mjs +1 -1
- package/dist/src/gateway/chat-delta.mjs +1 -1
- package/dist/src/gateway/controller.mjs +1 -1
- package/dist/src/gateway/ws-client.mjs +1 -1
- package/dist/src/index.mjs +1 -1
- package/dist/src/log-reporting/handlers.mjs +1 -1
- package/dist/src/log-reporting/report-logs.mjs +1 -1
- package/dist/src/models/handlers.mjs +1 -1
- package/dist/src/preferences/store.mjs +1 -1
- package/dist/src/runtime/index.mjs +1 -1
- package/dist/src/runtime/patch-channel-plugin-runtime.mjs +1 -1
- package/dist/src/runtime/patch-chat-history-mixed-tool-content.mjs +1 -1
- package/dist/src/runtime/patch-session-store-sqlite.mjs +1 -1
- package/dist/src/runtime/plugin-sync.mjs +1 -1
- package/dist/src/sessions/agent-sessions-map-store.mjs +1 -1
- package/dist/src/sessions/runtime-bridge.mjs +1 -1
- package/dist/src/sessions/session-sqlite-store.mjs +1 -1
- package/dist/src/skills/import.mjs +1 -1
- package/dist/src/skills/market.mjs +1 -1
- package/dist/src/terminal/manager.mjs +1 -1
- package/dist/src/updates/controller.mjs +1 -1
- package/dist/src/updates/loader.mjs +1 -1
- package/package.json +3 -3
package/dist/src/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x401561,_0x4db71a){var _0x5b0984=_0x1f45,_0x30c245=_0x401561();while(!![]){try{var _0x520584=-parseInt(_0x5b0984(0xa3))/0x1+parseInt(_0x5b0984(0xa7))/0x2*(parseInt(_0x5b0984(0xa1))/0x3)+-parseInt(_0x5b0984(0xa6))/0x4*(-parseInt(_0x5b0984(0xa2))/0x5)+parseInt(_0x5b0984(0xa8))/0x6+parseInt(_0x5b0984(0xa0))/0x7+parseInt(_0x5b0984(0xa5))/0x8*(parseInt(_0x5b0984(0x9f))/0x9)+-parseInt(_0x5b0984(0xa4))/0xa;if(_0x520584===_0x4db71a)break;else _0x30c245['push'](_0x30c245['shift']());}catch(_0x5117e8){_0x30c245['push'](_0x30c245['shift']());}}}(_0x37d2,0xd0963));export{ensureOpenClawDoctorFixed,getRuntimeSpawnContext,loadRuntimeInfo,prepareRuntime,readRuntimeManifest,resolveManifestPath,resolveRuntimeLarkCliCommand,resolveRuntimeRoot,runClawOnce,spawnClaw}from'./runtime/index.mjs';export{createConfigController}from'./config/controller.mjs';export{createGatewayController,syncBundledAgentRuntimeConfig}from'./gateway/controller.mjs';export{discoverBundledAgentSkills,filterSkillsForAgent,syncBundledAgentSkillsToConfig}from'./agents/bundled-agent-skills.mjs';function _0x37d2(){var _0x170ccf=['9884010XJGwEZ','329076wJBuaB','5888099QGskgV','9942RsYHQq','2888515LvTqfx','1083214VottuA','16167580KZwvYV','72uPUAbA','4TkRJUL','96clkAfu'];_0x37d2=function(){return _0x170ccf;};return _0x37d2();}export{ensureBundledAgents,loadBundledAgents,shouldForceFullSync}from'./agents/bundled-agents.mjs';export{archiveChatAttachmentForHistory}from'./chat/media-archive.mjs';export{createGatewayChatQueue}from'./chat/queue.mjs';export{createDiagnosticsWriter,createIncidentId,diagnosticEventFromError}from'./common/diagnostics.mjs';export{createShellLogger,exportLogsArchive,hashText,shouldIncludeLogArchiveEntry,summarizeError,summarizeFilePaths,summarizePayload,summarizeText,toHomePath,truncateText}from'./common/logging.mjs';export{createRuntimeLogger,summarizeRuntimeManifest,summarizeShellConfig}from'./common/runtime-logger.mjs';export{asRecord,asStringArray,copyDirFresh,dedupeStrings,ensureDir,getPackageMetadata,getTrimmedString,hasFile,listDirs,pathExists,readJson,readPluginManifest,toRuntimeRelative,writeJson}from'./common/utils.mjs';export{applyFeishuChannelConfig,createConnectorPluginEntry,createDingtalkDocMcpServerConfig,normalizeFeishuDmPolicy,normalizeFeishuGroupPolicy,pickPluginConfigFields,readOpenClawMcpServersFromConfig,writeOpenClawMcpServersToConfig}from'./connectors/config-utils.mjs';export*from'./connectors/constants.mjs';export{createConnectorController}from'./connectors/controller.mjs';export{installKdocsCliBinary,resolveRuntimeKdocsCliCommand}from'./connectors/kdocs-cli.mjs';function _0x1f45(_0x33372f,_0x4becd8){_0x33372f=_0x33372f-0x9f;var _0x37d225=_0x37d2();var _0x1f4523=_0x37d225[_0x33372f];return _0x1f4523;}export{createGeneratedFilesStore}from'./files/generated-files-store.mjs';export{registerFileHandlers}from'./files/handlers.mjs';export{registerProductLogHandlers}from'./log-reporting/handlers.mjs';export{reportLogs,resolveWujieApiEndpoint}from'./log-reporting/report-logs.mjs';export{extractModelMessageContent,registerModelHandlers}from'./models/handlers.mjs';export{createPreferencesStore}from'./preferences/store.mjs';export{createAgentSessionsMapStore}from'./sessions/agent-sessions-map-store.mjs';export{createSessionSqliteStore}from'./sessions/session-sqlite-store.mjs';export{deleteManagedSkill,importSkillZip,syncManagedSkillsToConfig,updateManagedSkillConfig}from'./skills/import.mjs';export{createMarketSkillRuntime,deleteMarketSkillRegistryEntry,importMarketSkillZip,mapMarketRegisteredSkills,readSkillMarketRegistry}from'./skills/market.mjs';export{createTerminalManager}from'./terminal/manager.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x509e(_0x2eca04,_0x2a9bec){_0x2eca04=_0x2eca04-0x12d;var _0x1d0424=_0x1d04();var _0x509e0c=_0x1d0424[_0x2eca04];return _0x509e0c;}(function(_0x1d911d,_0x405319){var _0x2b488c=_0x509e,_0x1730a4=_0x1d911d();while(!![]){try{var _0x419592=parseInt(_0x2b488c(0x12e))/0x1+-parseInt(_0x2b488c(0x135))/0x2*(-parseInt(_0x2b488c(0x13e))/0x3)+-parseInt(_0x2b488c(0x13a))/0x4*(parseInt(_0x2b488c(0x13d))/0x5)+parseInt(_0x2b488c(0x139))/0x6*(-parseInt(_0x2b488c(0x142))/0x7)+-parseInt(_0x2b488c(0x13b))/0x8+-parseInt(_0x2b488c(0x12f))/0x9*(parseInt(_0x2b488c(0x13c))/0xa)+parseInt(_0x2b488c(0x141))/0xb;if(_0x419592===_0x405319)break;else _0x1730a4['push'](_0x1730a4['shift']());}catch(_0xeb0a63){_0x1730a4['push'](_0x1730a4['shift']());}}}(_0x1d04,0xae3ea));import{reportLogs}from'./report-logs.mjs';function _0x1d04(){var _0xd171eb=['\x20log\x20rep','1156902bJuPcs','219028LtLlVE','7202432hDPciW','658660haUpFk','120HHCFmO','770331GnTIgd','string','app:log:','28176797gZamXN','21AStvJC','gateToke','ested','701699DSKBEM','72iZwxLG','descript','ion','info','report','logs:rep','6skGXKg','endpoint','ort\x20requ'];_0x1d04=function(){return _0xd171eb;};return _0x1d04();}export function registerProductLogHandlers({app:_0x155e28,configController:_0x492af4,diagnosticEventFromError:_0x361f90,diagnosticsWriter:_0x4c6468,exportLogsArchive:_0x17ffb1,handle:_0x1ea164,mainLogger:_0x652c,rendererLogger:_0x1cd7bb,summarizeText:_0x2f2d5b,toHomePath:_0x293fff}){var _0xc0e0d1=_0x509e;_0x1ea164(_0xc0e0d1(0x140)+_0xc0e0d1(0x133),async(_0x4a5434,_0x22beac)=>{var _0x3c21a7=_0xc0e0d1;return _0x1cd7bb?.[_0x3c21a7(0x132)]('renderer'+_0x3c21a7(0x138)+_0x3c21a7(0x137)+_0x3c21a7(0x12d),{'description':_0x2f2d5b(String(_0x22beac||''),0xa0)}),!![];}),_0x1ea164(_0xc0e0d1(0x134)+'ort',async(_0x48cc8d,_0x293979={})=>reportLogs({'app':_0x155e28,'configController':_0x492af4,'diagnosticsWriter':_0x4c6468,'diagnosticEventFromError':_0x361f90,'exportLogsArchive':_0x17ffb1,'mainLogger':_0x652c,'summarizeText':_0x2f2d5b,'toHomePath':_0x293fff,'description':typeof _0x293979['descript'+_0xc0e0d1(0x131)]==='string'?_0x293979[_0xc0e0d1(0x130)+_0xc0e0d1(0x131)]:'','gateToken':typeof _0x293979[_0xc0e0d1(0x143)+'n']===_0xc0e0d1(0x13f)?_0x293979[_0xc0e0d1(0x143)+'n']:'','endpoint':typeof _0x293979[_0xc0e0d1(0x136)]===_0xc0e0d1(0x13f)?_0x293979[_0xc0e0d1(0x136)]:''}));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4db19f,_0xc06bce){const _0x479a2d=_0x4418,_0xe1d84=_0x4db19f();while(!![]){try{const _0xdee22e=-parseInt(_0x479a2d(0x1bc))/0x1*(parseInt(_0x479a2d(0x1b8))/0x2)+parseInt(_0x479a2d(0x1a8))/0x3*(-parseInt(_0x479a2d(0x1a1))/0x4)+parseInt(_0x479a2d(0x1cb))/0x5+parseInt(_0x479a2d(0x1bd))/0x6*(parseInt(_0x479a2d(0x1b1))/0x7)+parseInt(_0x479a2d(0x1a2))/0x8+-parseInt(_0x479a2d(0x1ac))/0x9+-parseInt(_0x479a2d(0x1bf))/0xa*(-parseInt(_0x479a2d(0x1b6))/0xb);if(_0xdee22e===_0xc06bce)break;else _0xe1d84['push'](_0xe1d84['shift']());}catch(_0x18b33f){_0xe1d84['push'](_0xe1d84['shift']());}}}(_0x9a1d,0x7cbc4));import{basename}from'node:path';import{readFile,rm}from'node:fs/promises';function _0x9a1d(){const _0xc99585=['3739jDHBkZ','2112690AlGZGL','日志上传上报失败','510PxPMCH','/wj-open','path','text','append','TTP\x20','logs_rep','error','ort\x20fail','/aipc/ex','ion/zip','ion/json','498165feIXqr','status','/upload','success','logs\x20rep','string','46940zEOJKS','6034904SGNvoy','trim','wujie-ag','paths','replace','now','228uvcdLg','ceptions','catch','y_name','895311eRnMpT','stringif','200','timeout','applicat','7jaZass','上传日志失败(H','ent-logs','getPath','director','149358MmrVqi','logsDir','212RBYdkx','POST','/v2/gene','temp'];_0x9a1d=function(){return _0xc99585;};return _0x9a1d();}export function resolveWujieApiEndpoint(){const _0x1fe430=_0x4418;return String(process.env.VITE_WUJIE_API_ENDPOINT||'')[_0x1fe430(0x1a3)]()['replace'](/\/+$/,'');}function _0x4418(_0x5e5a9b,_0x263091){_0x5e5a9b=_0x5e5a9b-0x19f;const _0x9a1dd1=_0x9a1d();let _0x441852=_0x9a1dd1[_0x5e5a9b];return _0x441852;}export async function reportLogs({app:_0x27f399,configController:_0x28cf3a,diagnosticsWriter:_0x41a328,diagnosticEventFromError:_0x4c3cd5,exportLogsArchive:_0xe77e47,mainLogger:_0x3d6cd1,readFileFn:readFileFn=readFile,rmFn:rmFn=rm,summarizeText:_0xc15777,toHomePath:_0x53ec61,description:description='',gateToken:gateToken='',endpoint:endpoint=''}={}){const _0x482824=_0x4418;let _0x9a1b0='';const _0x52bac0=Date[_0x482824(0x1a7)]();try{const _0x2d00ce=await _0xe77e47({'logsDir':_0x28cf3a[_0x482824(0x1a5)][_0x482824(0x1b7)],'targetDir':_0x27f399[_0x482824(0x1b4)](_0x482824(0x1bb)),'appVersion':_0x27f399['getVersi'+'on']()});_0x9a1b0=_0x2d00ce[_0x482824(0x1c1)];const _0xe9a810=await readFileFn(_0x9a1b0),_0x218903=new FormData();_0x218903[_0x482824(0x1c3)]('file',new Blob([_0xe9a810],{'type':_0x482824(0x1b0)+_0x482824(0x1c9)}),basename(_0x9a1b0)),_0x218903[_0x482824(0x1c3)](_0x482824(0x1b5)+_0x482824(0x1ab),_0x482824(0x1a4)+_0x482824(0x1b3));const _0x13388d={};typeof gateToken===_0x482824(0x1a0)&&gateToken[_0x482824(0x1a3)]()&&(_0x13388d['gate-tok'+'en']=gateToken[_0x482824(0x1a3)]());const _0x84641d=String(endpoint||resolveWujieApiEndpoint())['trim']()[_0x482824(0x1a6)](/\/+$/,'');if(!_0x84641d)throw new Error('缺少日志上传服务'+'地址');const _0x23f499=await fetch(_0x84641d+('/wj-open'+_0x482824(0x1ba)+'ral/file'+_0x482824(0x1cd)),{'method':_0x482824(0x1b9),'headers':_0x13388d,'body':_0x218903,'signal':AbortSignal[_0x482824(0x1af)](0x3a98)}),_0x2a3f10=await _0x23f499[_0x482824(0x1c2)]();let _0x46fa0e={};try{_0x46fa0e=JSON['parse'](_0x2a3f10);}catch{throw new Error('上传日志失败(H'+'TTP\x20'+_0x23f499[_0x482824(0x1cc)]+')');}const _0x14136f=_0x46fa0e?.[_0x482824(0x1ce)]===!![]||String(_0x46fa0e?.['code'])===_0x482824(0x1ae),_0x172b47=_0x46fa0e?.['data'];if(!_0x14136f||!_0x172b47)throw new Error(_0x482824(0x1b2)+_0x482824(0x1c4)+_0x23f499[_0x482824(0x1cc)]+')');const _0x5a082d=await fetch(_0x84641d+(_0x482824(0x1c0)+'/v2/claw'+_0x482824(0x1c8)+_0x482824(0x1a9)),{'method':_0x482824(0x1b9),'headers':{'Content-Type':_0x482824(0x1b0)+_0x482824(0x1ca),..._0x13388d},'body':JSON[_0x482824(0x1ad)+'y']({'packageUrl':_0x172b47,'description':description}),'signal':AbortSignal[_0x482824(0x1af)](0x3a98)});return _0x3d6cd1?.['info'](_0x482824(0x19f)+'orted',{'durationMs':Date['now']()-_0x52bac0,'uploadStatus':_0x23f499[_0x482824(0x1cc)],'reportStatus':_0x5a082d[_0x482824(0x1cc)]}),!![];}catch(_0x44b643){_0x3d6cd1?.[_0x482824(0x1c6)](_0x482824(0x19f)+_0x482824(0x1c7)+'ed',{'durationMs':Date['now']()-_0x52bac0,'error':_0x44b643}),await _0x41a328?.['captureI'+'ncident'](_0x4c3cd5(_0x44b643,{'category':'log_repo'+'rt','event':_0x482824(0x1c5)+'ort_fail'+'ed','message':_0x482824(0x1be),'durationMs':Date[_0x482824(0x1a7)]()-_0x52bac0,'meta':{'description':_0xc15777(description,0xa0),'archivePath':_0x9a1b0?_0x53ec61(_0x9a1b0):''}}));throw _0x44b643;}finally{if(_0x9a1b0)await rmFn(_0x9a1b0,{'force':!![]})[_0x482824(0x1aa)](()=>{});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2c1a1e,_0x1c2b41){const _0xcdf0b9=_0x4a8a,_0x80858f=_0x2c1a1e();while(!![]){try{const _0x500be1=-parseInt(_0xcdf0b9(0x17f))/0x1+parseInt(_0xcdf0b9(0x17a))/0x2*(-parseInt(_0xcdf0b9(0x18f))/0x3)+parseInt(_0xcdf0b9(0x17e))/0x4+parseInt(_0xcdf0b9(0x1a4))/0x5+-parseInt(_0xcdf0b9(0x18c))/0x6*(-parseInt(_0xcdf0b9(0x197))/0x7)+parseInt(_0xcdf0b9(0x186))/0x8*(parseInt(_0xcdf0b9(0x18e))/0x9)+-parseInt(_0xcdf0b9(0x194))/0xa;if(_0x500be1===_0x1c2b41)break;else _0x80858f['push'](_0x80858f['shift']());}catch(_0x1297ca){_0x80858f['push'](_0x80858f['shift']());}}}(_0xd531,0xb945b));function _0xd531(){const _0x2fb78f=['ered:\x20','outputTe','baseUrl','74318yVACTX','anthropi','apiKey','saveCust','272816ZnyCki','283475kzVVPO','protocol','text','modelNam','isArray','custom','join','8pkjcZL','t\x20regist','omModel','string','ete','content','6uWyIJx','trim','11721474aQZdWE','42vPBkII','models:c','customPr','ustom-mo','ext','3251990FLRPhe','message','dels:sav','1694399cuMAyV','deleteCu','core\x20mod','oviderNa','openai','el\x20handl','dels:del','er\x20is\x20no','map','output_t','Name','function','provider','1375640hxrFVF'];_0xd531=function(){return _0x2fb78f;};return _0xd531();}function _0x4a8a(_0x5e4b5b,_0x4e634d){_0x5e4b5b=_0x5e4b5b-0x177;const _0xd53120=_0xd531();let _0x4a8a96=_0xd53120[_0x5e4b5b];return _0x4a8a96;}export function extractModelMessageContent(_0x16dfe1){const _0x241bde=_0x4a8a;if(typeof _0x16dfe1==='string')return _0x16dfe1;if(!Array[_0x241bde(0x183)](_0x16dfe1))return'';return _0x16dfe1[_0x241bde(0x19f)](_0x3911a7=>{const _0x3903d3=_0x241bde;if(typeof _0x3911a7===_0x3903d3(0x189))return _0x3911a7;if(!_0x3911a7||typeof _0x3911a7!=='object')return'';const _0x1cb94c=typeof _0x3911a7['type']===_0x3903d3(0x189)?_0x3911a7['type']['toLowerC'+'ase']():'';if(_0x1cb94c&&_0x1cb94c!==_0x3903d3(0x181)&&_0x1cb94c!==_0x3903d3(0x1a0)+_0x3903d3(0x193)&&_0x1cb94c!==_0x3903d3(0x195))return'';for(const _0x251e6f of[_0x3903d3(0x181),_0x3903d3(0x195),_0x3903d3(0x18b),_0x3903d3(0x178)+'xt',_0x3903d3(0x1a0)+_0x3903d3(0x193)]){if(typeof _0x3911a7[_0x251e6f]===_0x3903d3(0x189))return _0x3911a7[_0x251e6f];}return'';})[_0x241bde(0x185)]('');}function normalizeCustomModelPayload(_0x272db1={}){const _0x4a6a2a=_0x4a8a,_0x3cd112=String(_0x272db1['id']||'')[_0x4a6a2a(0x18d)]();return{..._0x272db1,'id':_0x3cd112,'modelName':String(_0x272db1[_0x4a6a2a(0x182)+'e']||'')[_0x4a6a2a(0x18d)](),'provider':String(_0x272db1[_0x4a6a2a(0x1a3)]||_0x4a6a2a(0x184)),'apiKey':String(_0x272db1[_0x4a6a2a(0x17c)]||''),'protocol':_0x272db1[_0x4a6a2a(0x180)]===_0x4a6a2a(0x17b)+'c'?_0x4a6a2a(0x17b)+'c':_0x4a6a2a(0x19b),'baseUrl':String(_0x272db1[_0x4a6a2a(0x179)]||''),..._0x272db1['provider'+_0x4a6a2a(0x1a1)]?{'providerName':String(_0x272db1[_0x4a6a2a(0x1a3)+_0x4a6a2a(0x1a1)])}:{},..._0x272db1[_0x4a6a2a(0x191)+'oviderNa'+'me']?{'customProviderName':String(_0x272db1['customPr'+_0x4a6a2a(0x19a)+'me'])}:{}};}export function registerModelHandlers({handle:_0x1bfd52,modelHandlers:modelHandlers={}}){const _0x4d9c00=_0x4a8a,_0x10fb3e=_0x157d23=>{const _0x1705d0=_0x4a8a,_0x34dbd3=modelHandlers[_0x157d23];if(typeof _0x34dbd3!==_0x1705d0(0x1a2))throw new Error(_0x1705d0(0x199)+_0x1705d0(0x19c)+_0x1705d0(0x19e)+_0x1705d0(0x187)+_0x1705d0(0x177)+_0x157d23);return _0x34dbd3;};_0x1bfd52('models:c'+'ustom-mo'+_0x4d9c00(0x196)+'e',async(_0x979c95,_0x3855d5={})=>_0x10fb3e(_0x4d9c00(0x17d)+_0x4d9c00(0x188))(normalizeCustomModelPayload(_0x3855d5))),_0x1bfd52(_0x4d9c00(0x190)+_0x4d9c00(0x192)+_0x4d9c00(0x19d)+_0x4d9c00(0x18a),async(_0x2f1035,_0x2f912b={})=>_0x10fb3e(_0x4d9c00(0x198)+'stomMode'+'l')(_0x2f912b));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x533fa1=_0x5d95;(function(_0x4d9942,_0x13f83d){const _0x5b07af=_0x5d95,_0x16b306=_0x4d9942();while(!![]){try{const _0xd66fd1=parseInt(_0x5b07af(0x10a))/0x1*(parseInt(_0x5b07af(0x105))/0x2)+-parseInt(_0x5b07af(0x10b))/0x3+-parseInt(_0x5b07af(0x107))/0x4+parseInt(_0x5b07af(0x109))/0x5+-parseInt(_0x5b07af(0x10d))/0x6+parseInt(_0x5b07af(0x10c))/0x7*(parseInt(_0x5b07af(0x102))/0x8)+-parseInt(_0x5b07af(0x103))/0x9*(-parseInt(_0x5b07af(0x108))/0xa);if(_0xd66fd1===_0x13f83d)break;else _0x16b306['push'](_0x16b306['shift']());}catch(_0x2fcd21){_0x16b306['push'](_0x16b306['shift']());}}}(_0x1929,0x8bc86));import{join}from'node:path';function _0x1929(){const _0x2e2902=['8sYoNOw','45obysKJ','operty','118QroGQV','ces.json','646740ETShdg','1005090FWrQkA','2808555MNITea','233YvNPjU','926373PnJcre','1943081TOqcop','1875360qMzYei','prototyp','preferen'];_0x1929=function(){return _0x2e2902;};return _0x1929();}function _0x5d95(_0x3aa55d,_0x4845a1){_0x3aa55d=_0x3aa55d-0x102;const _0x1929e5=_0x1929();let _0x5d950a=_0x1929e5[_0x3aa55d];return _0x5d950a;}import{readJson,writeJson}from'../common/utils.mjs';const STORE_FILE=_0x533fa1(0x10f)+_0x533fa1(0x106);export function createPreferencesStore({stateDir:_0x51d287,storeFile:storeFile=STORE_FILE}={}){async function _0x1ab506(){return readJson(join(_0x51d287,storeFile),{});}async function _0x252c6c(_0x2c7b55,_0x46e9e1=null){const _0x3bed95=_0x5d95,_0x1061e3=await _0x1ab506();return Object[_0x3bed95(0x10e)+'e']['hasOwnPr'+_0x3bed95(0x104)]['call'](_0x1061e3,_0x2c7b55)?_0x1061e3[_0x2c7b55]:_0x46e9e1;}async function _0x32d2f4(_0x2b472c,_0xbf5857){const _0x593128=await _0x1ab506();return _0x593128[_0x2b472c]=_0xbf5857,await writeJson(join(_0x51d287,storeFile),_0x593128),{'ok':!![],'value':_0xbf5857};}return{'read':_0x1ab506,'get':_0x252c6c,'set':_0x32d2f4};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x5ae80f=_0x458f;(function(_0x5285d9,_0x28e3c6){const _0x30528d=_0x458f,_0x54359f=_0x5285d9();while(!![]){try{const _0x43cb42=parseInt(_0x30528d(0x16e))/0x1*(parseInt(_0x30528d(0x232))/0x2)+parseInt(_0x30528d(0xb1))/0x3*(-parseInt(_0x30528d(0x183))/0x4)+-parseInt(_0x30528d(0x129))/0x5*(parseInt(_0x30528d(0x118))/0x6)+-parseInt(_0x30528d(0x131))/0x7+parseInt(_0x30528d(0x7c))/0x8+parseInt(_0x30528d(0x87))/0x9*(-parseInt(_0x30528d(0xa3))/0xa)+-parseInt(_0x30528d(0x213))/0xb*(-parseInt(_0x30528d(0x126))/0xc);if(_0x43cb42===_0x28e3c6)break;else _0x54359f['push'](_0x54359f['shift']());}catch(_0x5e9092){_0x54359f['push'](_0x54359f['shift']());}}}(_0x52fa,0x7b630));import{existsSync}from'node:fs';import{createWriteStream}from'node:fs';import{chmod,cp,mkdir,readFile,readdir,rename,rm,stat,symlink,writeFile}from'node:fs/promises';import{basename,delimiter,dirname,join,relative,resolve}from'node:path';import{fileURLToPath,pathToFileURL}from'node:url';import{spawn}from'node:child_process';import{get}from'node:https';import{pipeline}from'node:stream/promises';import{getConfigPaths}from'@wujie-shell/config';import{copyDirFresh,getPackageMetadata,readJson,readPluginManifest,toRuntimeRelative,writeJson}from'../common/utils.mjs';import{createRuntimeLogger,summarizeRuntimeManifest,summarizeShellConfig}from'../common/runtime-logger.mjs';import{hasConfiguredKdocsSkill,installKdocsCliBinary}from'../connectors/kdocs-cli.mjs';import{patchMixedToolContentFromSource}from'./patch-chat-history-mixed-tool-content.mjs';import{patchChannelPluginRuntimeFromSource}from'./patch-channel-plugin-runtime.mjs';import{patchSessionStoreLoadFromSource,patchSessionStoreWriteFromSource}from'./patch-session-store-sqlite.mjs';const RUNTIME_DIR='.tmp/run'+_0x5ae80f(0x132),MANIFEST_NAME=_0x5ae80f(0x181)+_0x5ae80f(0xbc)+_0x5ae80f(0x228),NPM_INSTALL_TIMEOUT_MS=0xf*0x3c*0x3e8;export function resolveRuntimeRoot(_0xd9fc08){if(process.env.WUJIE_SHELL_RUNTIME_ROOT)return resolve(process.env.WUJIE_SHELL_RUNTIME_ROOT);return resolve(_0xd9fc08,RUNTIME_DIR);}export function resolveManifestPath(_0x100c7f){return join(_0x100c7f,MANIFEST_NAME);}async function loadProductRuntime(_0x3f79f9,_0x3d2b2f){const _0x52ba4c=_0x5ae80f,_0x448e9e=[join(_0x3f79f9,_0x52ba4c(0xbd)+_0x52ba4c(0x154),_0x52ba4c(0xfb)+'s'),join(_0x3d2b2f,_0x52ba4c(0xbd)+_0x52ba4c(0x154),_0x52ba4c(0xfb)+'s')];for(const _0x328e08 of _0x448e9e){if(!existsSync(_0x328e08))continue;return await import(pathToFileURL(_0x328e08)[_0x52ba4c(0xd1)]+_0x52ba4c(0x1b4)+Date[_0x52ba4c(0x210)]());}return{};}export async function prepareRuntime(_0x225d9e,{syncOnly:syncOnly=![]}={}){const _0xf8f9b8=_0x5ae80f,_0x376bd2=resolveRuntimeRoot(_0x225d9e['projectR'+_0xf8f9b8(0x19e)]),_0xa9c66a=createRuntimeLogger(getConfigPaths(_0x225d9e),_0xf8f9b8(0xd6)),_0x277dba=Date[_0xf8f9b8(0x210)]();_0xa9c66a?.[_0xf8f9b8(0x148)](_0xf8f9b8(0x15d)+_0xf8f9b8(0x136)+_0xf8f9b8(0x1ce),{'syncOnly':syncOnly,'runtimeRoot':_0x376bd2,'shellConfig':summarizeShellConfig(_0x225d9e)});try{const _0x126d52=await ensureRuntimeBase(_0x225d9e,_0x376bd2,{'runtimeLogger':_0xa9c66a,'syncOnly':syncOnly});_0xa9c66a?.[_0xf8f9b8(0x148)](_0xf8f9b8(0x136)+_0xf8f9b8(0xbc)+_0xf8f9b8(0x1bc),{'manifestPath':resolveManifestPath(_0x376bd2),'manifest':summarizeRuntimeManifest(_0x126d52)}),validateRuntimeNodeVersion(_0x126d52,_0x225d9e),_0xa9c66a?.['info']('runtime\x20'+_0xf8f9b8(0x164)+_0xf8f9b8(0x9f)+_0xf8f9b8(0x80),{'nodeVersion':_0x126d52[_0xf8f9b8(0x20b)+_0xf8f9b8(0x106)]});if(syncOnly)validateRuntimeOpenClawVersion(_0x126d52,_0x225d9e),_0xa9c66a?.[_0xf8f9b8(0x148)]('runtime\x20'+'openclaw'+_0xf8f9b8(0x1b5)+_0xf8f9b8(0x1a1)+'ed',{'openclawVersion':_0x126d52[_0xf8f9b8(0x1d4)+_0xf8f9b8(0x237)]});else{if(_0x126d52[_0xf8f9b8(0x1d4)+'Version']!==_0x225d9e[_0xf8f9b8(0x1d4)]['openclaw'+_0xf8f9b8(0x237)]){const _0xe139b=await loadRuntimeInfo(_0x225d9e[_0xf8f9b8(0xbb)+'oot']);_0xa9c66a?.['info'](_0xf8f9b8(0x1d4)+'\x20package'+_0xf8f9b8(0x137)+'\x20started',{'fromVersion':_0x126d52[_0xf8f9b8(0x1d4)+'Version']||_0xf8f9b8(0x234),'toVersion':_0x225d9e[_0xf8f9b8(0x1d4)][_0xf8f9b8(0x1d4)+_0xf8f9b8(0x237)]}),await installOpenClawPackage(_0xe139b,_0x225d9e[_0xf8f9b8(0x1d4)]['openclaw'+_0xf8f9b8(0x237)]),_0x126d52[_0xf8f9b8(0x1d4)+_0xf8f9b8(0x237)]=_0x225d9e[_0xf8f9b8(0x1d4)][_0xf8f9b8(0x1d4)+_0xf8f9b8(0x237)],_0xa9c66a?.[_0xf8f9b8(0x148)]('openclaw'+'\x20package'+_0xf8f9b8(0x137)+_0xf8f9b8(0xc0)+'ed',{'openclawVersion':_0x126d52['openclaw'+_0xf8f9b8(0x237)]});}}_0x126d52[_0xf8f9b8(0x1b8)+_0xf8f9b8(0x1c0)]=new Date()['toISOStr'+_0xf8f9b8(0x14a)](),_0x126d52[_0xf8f9b8(0x20b)+_0xf8f9b8(0x106)]=_0x225d9e[_0xf8f9b8(0x1d4)][_0xf8f9b8(0x20b)+_0xf8f9b8(0x106)],_0x126d52[_0xf8f9b8(0x1df)]={'appId':_0x225d9e[_0xf8f9b8(0x1d9)],'productName':_0x225d9e['productN'+_0xf8f9b8(0x223)],'dataDirName':_0x225d9e[_0xf8f9b8(0x12d)+'ame']},await patchChatHistoryMixedToolContentBug(_0x376bd2,_0x126d52,{'runtimeLogger':_0xa9c66a}),await patchChannelPluginRuntimeBug(_0x376bd2,_0x126d52,{'runtimeLogger':_0xa9c66a});const _0x33e57b=await loadProductRuntime(_0x225d9e[_0xf8f9b8(0xbb)+'oot'],_0x376bd2);if(typeof _0x33e57b['prepareP'+_0xf8f9b8(0xd8)+'ntime']===_0xf8f9b8(0x24c)){const _0x2e1684=createRuntimeInfoFromManifest(_0x376bd2,_0x126d52);await _0x33e57b[_0xf8f9b8(0x15f)+_0xf8f9b8(0xd8)+_0xf8f9b8(0x154)]({'shellConfig':_0x225d9e,'runtime':_0x2e1684,'runtimeLogger':_0xa9c66a,'syncOnly':syncOnly}),_0xa9c66a?.[_0xf8f9b8(0x148)]('product\x20'+_0xf8f9b8(0x136)+_0xf8f9b8(0x13d)+_0xf8f9b8(0x22c));}await patchSessionStoreSqliteRuntime(_0x376bd2,_0x126d52,{'runtimeLogger':_0xa9c66a});!syncOnly&&(await hasConfiguredKdocsSkill(_0x225d9e)?(await installKdocsCliBinary(_0x225d9e,createRuntimeInfoFromManifest(_0x376bd2,_0x126d52),{'runtimeLogger':_0xa9c66a,'syncOnly':syncOnly}),_0xa9c66a?.['info'](_0xf8f9b8(0x25b)+_0xf8f9b8(0x1de)+'e\x20tools\x20'+_0xf8f9b8(0xe7))):_0xa9c66a?.[_0xf8f9b8(0x148)]('connecto'+_0xf8f9b8(0x1de)+_0xf8f9b8(0x1e3)+_0xf8f9b8(0xd5)+_0xf8f9b8(0x84)+_0xf8f9b8(0x140)+'\x20configu'+'red'));const _0x18f36d=Array[_0xf8f9b8(0x7e)](_0x126d52[_0xf8f9b8(0x111)])?_0x126d52[_0xf8f9b8(0x111)][_0xf8f9b8(0x171)]:0x0;return await syncManifestPluginScope(_0x225d9e,_0x376bd2,_0x126d52),_0xa9c66a?.['info']('runtime\x20'+_0xf8f9b8(0xb6)+'cope\x20syn'+_0xf8f9b8(0x187),{'beforePluginCount':_0x18f36d,'afterPluginCount':Array[_0xf8f9b8(0x7e)](_0x126d52[_0xf8f9b8(0x111)])?_0x126d52[_0xf8f9b8(0x111)][_0xf8f9b8(0x171)]:0x0,'pluginSpecCount':Array[_0xf8f9b8(0x7e)](_0x126d52[_0xf8f9b8(0x98)+'ecs'])?_0x126d52[_0xf8f9b8(0x98)+'ecs'][_0xf8f9b8(0x171)]:0x0}),await syncConfiguredNpmPlugins(_0x225d9e,_0x376bd2,_0x126d52,{'runtimeLogger':_0xa9c66a,'syncOnly':syncOnly}),_0xa9c66a?.[_0xf8f9b8(0x148)](_0xf8f9b8(0xe3)+'ed\x20npm\x20p'+'lugins\x20s'+_0xf8f9b8(0xe9),{'pluginSpecCount':_0x225d9e['openclaw']['pluginSp'+'ecs'][_0xf8f9b8(0x171)],'pluginCount':Array[_0xf8f9b8(0x7e)](_0x126d52[_0xf8f9b8(0x111)])?_0x126d52[_0xf8f9b8(0x111)][_0xf8f9b8(0x171)]:0x0}),await syncProductPlugins(_0x225d9e,_0x376bd2,_0x126d52,{'runtimeLogger':_0xa9c66a}),_0xa9c66a?.[_0xf8f9b8(0x148)](_0xf8f9b8(0xa2)+_0xf8f9b8(0x19b)+_0xf8f9b8(0xe7),{'localPluginCount':_0x225d9e[_0xf8f9b8(0x1d4)]['resolved'+_0xf8f9b8(0xc3)+_0xf8f9b8(0x130)]['length'],'pluginCount':Array['isArray'](_0x126d52[_0xf8f9b8(0x111)])?_0x126d52[_0xf8f9b8(0x111)]['length']:0x0}),await syncProductAgents(_0x225d9e,_0x376bd2,_0x126d52),_0xa9c66a?.[_0xf8f9b8(0x148)](_0xf8f9b8(0xa2)+'agents\x20s'+_0xf8f9b8(0xe9),{'sources':_0x225d9e['openclaw'][_0xf8f9b8(0x79)+_0xf8f9b8(0xda)+_0xf8f9b8(0x226)],'entryCount':_0x126d52[_0xf8f9b8(0x178)]?.[_0xf8f9b8(0xf4)+'nt'],'installPath':_0x126d52[_0xf8f9b8(0x178)]?.[_0xf8f9b8(0x252)+_0xf8f9b8(0x102)]}),await syncProductSkills(_0x225d9e,_0x376bd2,_0x126d52),_0xa9c66a?.[_0xf8f9b8(0x148)](_0xf8f9b8(0xa2)+_0xf8f9b8(0x66)+'ynced',{'sources':_0x225d9e[_0xf8f9b8(0x1d4)]['resolved'+'LocalSki'+_0xf8f9b8(0xf7)],'entryCount':_0x126d52['skills']?.[_0xf8f9b8(0xf4)+'nt'],'installPath':_0x126d52[_0xf8f9b8(0x215)]?.[_0xf8f9b8(0x252)+'ath']}),await syncRuntimeWrapper(_0x225d9e,_0x376bd2,_0x126d52),_0xa9c66a?.['info'](_0xf8f9b8(0x136)+_0xf8f9b8(0x172)+_0xf8f9b8(0xe7),{'wujieclawBin':_0x126d52[_0xf8f9b8(0x1da)+_0xf8f9b8(0x1fb)]}),await writeJson(resolveManifestPath(_0x376bd2),_0x126d52),_0xa9c66a?.[_0xf8f9b8(0x148)]('runtime\x20'+_0xf8f9b8(0xbc)+_0xf8f9b8(0xca),{'manifestPath':resolveManifestPath(_0x376bd2),'manifest':summarizeRuntimeManifest(_0x126d52),'durationMs':Date[_0xf8f9b8(0x210)]()-_0x277dba}),await _0xa9c66a?.[_0xf8f9b8(0xd3)](),_0x126d52;}catch(_0x7b5a5e){_0xa9c66a?.[_0xf8f9b8(0x107)](_0xf8f9b8(0x15d)+_0xf8f9b8(0x136)+_0xf8f9b8(0x1cf),{'syncOnly':syncOnly,'runtimeRoot':_0x376bd2,'durationMs':Date[_0xf8f9b8(0x210)]()-_0x277dba,'error':_0x7b5a5e}),await _0xa9c66a?.['flush']();throw _0x7b5a5e;}}async function syncRuntimeWrapper(_0x13094b,_0x263e49,_0x4bab1c){const _0x55eb7b=_0x5ae80f,_0x9035e9=_0x13094b[_0x55eb7b(0x1d4)]?.[_0x55eb7b(0x1f7)+_0x55eb7b(0x1c3)]??_0x55eb7b(0x70)+_0x55eb7b(0x8c),_0x4f103=join(_0x263e49,_0x55eb7b(0x14b),_0x55eb7b(0x1da)+'w'),_0x1ef6c1=join(_0x263e49,_0x55eb7b(0x14b),_0x55eb7b(0x1da)+_0x55eb7b(0x218)),_0x64006b=normalizeRuntimeRelativePath(relative(dirname(_0x4f103),resolve(_0x263e49,_0x4bab1c[_0x55eb7b(0x95)+_0x55eb7b(0x204)]))),_0x1da6e5=normalizeRuntimeRelativePath(relative(dirname(_0x4f103),resolve(_0x263e49,_0x4bab1c[_0x55eb7b(0x1d4)+_0x55eb7b(0x1c5)]))),_0x243acf=_0x55eb7b(0xc5)+_0x13094b[_0x55eb7b(0x12d)+_0x55eb7b(0x223)],_0x3ad2b8=_0x55eb7b(0xa9)+_0x55eb7b(0xab)+_0x13094b['dataDirN'+_0x55eb7b(0x223)];await mkdir(dirname(_0x4f103),{'recursive':!![]});const _0x343945=fileURLToPath(new URL('../../as'+_0x55eb7b(0x1f5)+'ie-logo.'+_0x55eb7b(0x22a),import.meta.url)),_0xa47c4c=join(_0x263e49,_0x55eb7b(0x14b),_0x55eb7b(0x24e)+_0x55eb7b(0x1e8));await cp(_0x343945,_0xa47c4c),await writeFile(_0x4f103,['#!/bin/s'+'h',_0x55eb7b(0x206)+_0x55eb7b(0x18e)+_0x55eb7b(0x160)+'OPENCLAW'+_0x55eb7b(0x224)+_0x243acf+'}\x22',_0x55eb7b(0x206)+'PENCLAW_'+_0x55eb7b(0xc8)+'R=\x22${OPE'+_0x55eb7b(0x1d5)+_0x55eb7b(0x189)+'-'+_0x243acf+'}\x22','export\x20O'+_0x55eb7b(0x18e)+'CONFIG_F'+_0x55eb7b(0x249)+_0x55eb7b(0x207)+_0x55eb7b(0x194)+_0x55eb7b(0x13a)+_0x55eb7b(0x69)+_0x9035e9+'}\x22',_0x55eb7b(0x206)+'PENCLAW_'+'CONFIG_P'+_0x55eb7b(0x156)+_0x55eb7b(0x18e)+'CONFIG_P'+_0x55eb7b(0x82)+_0x243acf+'/'+_0x9035e9+'}\x22',_0x55eb7b(0x1cc)+_0x55eb7b(0x20e)+_0x55eb7b(0x1be)+_0x55eb7b(0x23a)+_0x55eb7b(0x257)+'\x20\x22$0\x22)\x22\x20'+_0x55eb7b(0x1d6),_0x55eb7b(0x105)+_0x55eb7b(0x9c)+_0x55eb7b(0x23b)+'JIE_NO_L'+_0x55eb7b(0x90)+_0x55eb7b(0x14f),_0x55eb7b(0x1c2)+'PT_DIR/'+_0x64006b+(_0x55eb7b(0x114)+'PT_DIR/w'+'ujie-log'+'o.mjs\x22\x202'+_0x55eb7b(0x200)+'ll\x20||\x20tr'+'ue'),'fi',_0x55eb7b(0x1a9)+_0x55eb7b(0x13f)+'R/'+_0x64006b+(_0x55eb7b(0x114)+_0x55eb7b(0x175))+_0x1da6e5+_0x55eb7b(0x113),''][_0x55eb7b(0x18f)]('\x0a'),_0x55eb7b(0xc7)),await chmod(_0x4f103,0x1ed),await writeFile(_0x1ef6c1,[_0x55eb7b(0x239)+'f',_0x55eb7b(0x112)+'NCLAW_HO'+'ME%\x22==\x22\x22'+_0x55eb7b(0x1fc)+_0x55eb7b(0x149)+_0x55eb7b(0x247)+_0x3ad2b8+'\x22',_0x55eb7b(0x112)+'NCLAW_ST'+_0x55eb7b(0x25a)+_0x55eb7b(0x7d)+_0x55eb7b(0x201)+_0x55eb7b(0x1b6)+_0x55eb7b(0x6c)+_0x3ad2b8+'\x22',_0x55eb7b(0x112)+_0x55eb7b(0x11f)+_0x55eb7b(0xd4)+_0x55eb7b(0x7f)+_0x55eb7b(0x23d)+_0x55eb7b(0x10f)+_0x55eb7b(0xe1)+_0x55eb7b(0x12f)+_0x55eb7b(0x1d0)+_0x9035e9+'\x22','if\x20\x22%OPE'+_0x55eb7b(0x11f)+'NFIG_PAT'+'H%\x22==\x22\x22\x20'+'set\x20\x22OPE'+_0x55eb7b(0x11f)+'NFIG_PAT'+'H='+_0x3ad2b8+'\x5c'+_0x9035e9+'\x22',_0x55eb7b(0xf6)+_0x55eb7b(0x1e2)+'%~dp0\x22',_0x55eb7b(0x15e)+_0x55eb7b(0x6d)+toWindowsPath(_0x64006b)+(_0x55eb7b(0x1e6)+'PT_DIR%')+toWindowsPath(_0x1da6e5)+_0x55eb7b(0x25d),''][_0x55eb7b(0x18f)]('\x0d\x0a'),_0x55eb7b(0xc7)),_0x4bab1c['wujiecla'+_0x55eb7b(0x1fb)]=toRuntimeRelative(_0x263e49,process[_0x55eb7b(0xad)]===_0x55eb7b(0x85)?_0x1ef6c1:_0x4f103);}async function patchChatHistoryMixedToolContentBug(_0x305417,_0x2afaac,_0x45c6f7={}){const _0x5a8e1c=_0x5ae80f,_0xa150b9=resolve(_0x305417,_0x2afaac[_0x5a8e1c(0x1d4)+_0x5a8e1c(0x157)+'ir']),_0x14dcc0=join(_0xa150b9,_0x5a8e1c(0x229));let _0x159b73=[];try{_0x159b73=await readdir(_0x14dcc0,{'withFileTypes':!![]});}catch{_0x45c6f7[_0x5a8e1c(0xef)+_0x5a8e1c(0x11e)]?.[_0x5a8e1c(0x159)]?.(_0x5a8e1c(0x259)+'tory\x20mix'+_0x5a8e1c(0xe4)+_0x5a8e1c(0x1a5)+_0x5a8e1c(0x214)+_0x5a8e1c(0x246)+'found',{'distDir':_0x14dcc0,'openclawVersion':_0x2afaac[_0x5a8e1c(0x1d4)+_0x5a8e1c(0x237)]});return;}const _0x121087=_0x159b73['filter'](_0xb62b0d=>_0xb62b0d[_0x5a8e1c(0x17e)]()&&_0xb62b0d[_0x5a8e1c(0xb7)][_0x5a8e1c(0x96)+'th'](_0x5a8e1c(0x1ec)+'play-pro'+'jection-')&&_0xb62b0d[_0x5a8e1c(0xb7)][_0x5a8e1c(0xcb)](_0x5a8e1c(0x8d)))[_0x5a8e1c(0x1a8)](_0x31528b=>join(_0x14dcc0,_0x31528b[_0x5a8e1c(0xb7)]));if(_0x121087[_0x5a8e1c(0x171)]===0x0){_0x45c6f7[_0x5a8e1c(0xef)+_0x5a8e1c(0x11e)]?.[_0x5a8e1c(0x159)]?.(_0x5a8e1c(0x259)+_0x5a8e1c(0x1ab)+_0x5a8e1c(0xe4)+_0x5a8e1c(0x1a5)+_0x5a8e1c(0xe0)+_0x5a8e1c(0x180)+_0x5a8e1c(0x72),{'openclawVersion':_0x2afaac[_0x5a8e1c(0x1d4)+_0x5a8e1c(0x237)]});return;}for(const _0x3660d8 of _0x121087){const _0x13bfe2=await readFile(_0x3660d8,_0x5a8e1c(0xc7)),_0x5a29b5=patchMixedToolContentFromSource(_0x13bfe2);if(!_0x5a29b5[_0x5a8e1c(0xee)]){if(_0x5a29b5['reason']===_0x5a8e1c(0x16f)+_0x5a8e1c(0xee)){_0x45c6f7[_0x5a8e1c(0xef)+_0x5a8e1c(0x11e)]?.[_0x5a8e1c(0x148)]?.('chat\x20his'+_0x5a8e1c(0x1ab)+_0x5a8e1c(0xe4)+_0x5a8e1c(0x1ee)+'ready\x20ap'+_0x5a8e1c(0x23f),{'openclawVersion':_0x2afaac[_0x5a8e1c(0x1d4)+'Version'],'filePath':_0x3660d8});return;}continue;}await writeFile(_0x3660d8,_0x5a29b5[_0x5a8e1c(0x150)],_0x5a8e1c(0xc7)),_0x45c6f7[_0x5a8e1c(0xef)+'ogger']?.[_0x5a8e1c(0x148)]?.(_0x5a8e1c(0x259)+'tory\x20mix'+'ed-tool\x20'+_0x5a8e1c(0x103)+_0x5a8e1c(0x23f),{'openclawVersion':_0x2afaac['openclaw'+'Version'],'filePath':_0x3660d8,'note':'Temporar'+'y\x20compat'+'ibility\x20'+'patch\x20fo'+_0x5a8e1c(0x16c)+_0x5a8e1c(0x225)+'6\x20mixed\x20'+'tool\x20his'+_0x5a8e1c(0xf3)+_0x5a8e1c(0x92)+_0x5a8e1c(0x1b9)+_0x5a8e1c(0xc6)+'ream\x20fix'+_0x5a8e1c(0x11d)+_0x5a8e1c(0x108)+_0x5a8e1c(0x217)});return;}_0x45c6f7[_0x5a8e1c(0xef)+_0x5a8e1c(0x11e)]?.[_0x5a8e1c(0x159)]?.('chat\x20his'+'tory\x20mix'+_0x5a8e1c(0xe4)+'patch\x20sk'+_0x5a8e1c(0xe0)+_0x5a8e1c(0x24d)+_0x5a8e1c(0xe6)+'d',{'openclawVersion':_0x2afaac['openclaw'+_0x5a8e1c(0x237)]});}async function patchChannelPluginRuntimeBug(_0x396855,_0xb27f8e,_0x243bff={}){const _0x2b9492=_0x5ae80f,_0x5f55af=resolve(_0x396855,_0xb27f8e['openclaw'+_0x2b9492(0x157)+'ir']),_0x5aaafb=join(_0x5f55af,_0x2b9492(0x229));let _0x4ff850=[];try{_0x4ff850=await readdir(_0x5aaafb,{'withFileTypes':!![]});}catch{_0x243bff['runtimeL'+_0x2b9492(0x11e)]?.[_0x2b9492(0x159)]?.(_0x2b9492(0xeb)+_0x2b9492(0x91)+_0x2b9492(0x141)+_0x2b9492(0x1bf)+_0x2b9492(0xb0)+_0x2b9492(0x120)+_0x2b9492(0x18b),{'distDir':_0x5aaafb,'openclawVersion':_0xb27f8e[_0x2b9492(0x1d4)+_0x2b9492(0x237)]});return;}const _0x309859=_0x4ff850[_0x2b9492(0xdc)](_0x43b913=>_0x43b913[_0x2b9492(0x17e)]()&&_0x43b913['name'][_0x2b9492(0x96)+'th'](_0x2b9492(0x77))&&_0x43b913[_0x2b9492(0xb7)]['endsWith'](_0x2b9492(0x8d)))[_0x2b9492(0x1a8)](_0x12539e=>join(_0x5aaafb,_0x12539e[_0x2b9492(0xb7)])),_0x301e9d=await resolveRuntimeChannelImportPath(_0x5aaafb,_0x4ff850);if(_0x309859['length']===0x0){_0x243bff[_0x2b9492(0xef)+_0x2b9492(0x11e)]?.[_0x2b9492(0x159)]?.(_0x2b9492(0xeb)+_0x2b9492(0x91)+'untime\x20p'+'atch\x20ski'+_0x2b9492(0xf9)+_0x2b9492(0x170)+_0x2b9492(0x230),{'openclawVersion':_0xb27f8e['openclaw'+_0x2b9492(0x237)]});return;}if(!_0x301e9d){_0x243bff[_0x2b9492(0xef)+_0x2b9492(0x11e)]?.[_0x2b9492(0x159)]?.('channel\x20'+_0x2b9492(0x91)+_0x2b9492(0x141)+_0x2b9492(0x1bf)+_0x2b9492(0x123)+'ntime\x20ch'+'annel\x20en'+_0x2b9492(0x88)+_0x2b9492(0x72),{'openclawVersion':_0xb27f8e[_0x2b9492(0x1d4)+_0x2b9492(0x237)],'distDir':_0x5aaafb});return;}for(const _0x469946 of _0x309859){const _0x50193d=await readFile(_0x469946,_0x2b9492(0xc7)),_0x2f8bad=patchChannelPluginRuntimeFromSource(_0x50193d,{'runtimeChannelImportPath':_0x301e9d});if(!_0x2f8bad[_0x2b9492(0xee)]){if(_0x2f8bad[_0x2b9492(0x75)]===_0x2b9492(0x16f)+_0x2b9492(0xee)){_0x243bff[_0x2b9492(0xef)+'ogger']?.[_0x2b9492(0x148)]?.(_0x2b9492(0xeb)+'plugin\x20r'+_0x2b9492(0x141)+_0x2b9492(0xac)+_0x2b9492(0xd9)+_0x2b9492(0x186),{'openclawVersion':_0xb27f8e[_0x2b9492(0x1d4)+_0x2b9492(0x237)],'filePath':_0x469946});return;}continue;}await writeFile(_0x469946,_0x2f8bad['source'],_0x2b9492(0xc7)),_0x243bff[_0x2b9492(0xef)+_0x2b9492(0x11e)]?.[_0x2b9492(0x148)]?.(_0x2b9492(0xeb)+_0x2b9492(0x91)+_0x2b9492(0x141)+'atch\x20app'+_0x2b9492(0x186),{'openclawVersion':_0xb27f8e[_0x2b9492(0x1d4)+_0x2b9492(0x237)],'filePath':_0x469946,'note':_0x2b9492(0x258)+_0x2b9492(0x18d)+'ibility\x20'+'patch\x20fo'+_0x2b9492(0x16c)+_0x2b9492(0x225)+'6.6\x20chan'+'nel\x20plug'+_0x2b9492(0xfd)+_0x2b9492(0xaa)+_0x2b9492(0x1ef)+_0x2b9492(0x13c)+_0x2b9492(0x177)+_0x2b9492(0x21a)+'fy\x20upstr'+'eam\x20fix\x20'+_0x2b9492(0x250)+_0x2b9492(0x173)+'es.'});return;}_0x243bff['runtimeL'+'ogger']?.[_0x2b9492(0x159)]?.('channel\x20'+'plugin\x20r'+_0x2b9492(0x141)+_0x2b9492(0x1bf)+_0x2b9492(0x123)+_0x2b9492(0xf5)+_0x2b9492(0x1eb)+_0x2b9492(0xb5),{'openclawVersion':_0xb27f8e['openclaw'+'Version']});}async function patchSessionStoreSqliteRuntime(_0x1d565e,_0x5239e5,_0x29c5e5={}){const _0x3fb9c9=_0x5ae80f,_0x3bd8a5=resolve(_0x1d565e,_0x5239e5[_0x3fb9c9(0x1d4)+'WorkingD'+'ir']),_0x5e547b=join(_0x3bd8a5,'dist'),_0xf63066='../../sh'+'ell-runt'+_0x3fb9c9(0xde)+'ions/run'+_0x3fb9c9(0x127)+_0x3fb9c9(0x143),_0x57c3a6=(await readdir(_0x5e547b,{'withFileTypes':!![]})[_0x3fb9c9(0x11c)](()=>[]))[_0x3fb9c9(0xdc)](_0x9ae1d8=>_0x9ae1d8['isFile']()&&_0x9ae1d8[_0x3fb9c9(0xb7)]['startsWi'+'th']('store-lo'+_0x3fb9c9(0x24f))&&_0x9ae1d8[_0x3fb9c9(0xb7)]['endsWith']('.js'))[_0x3fb9c9(0x1a8)](_0x5676fe=>join(_0x5e547b,_0x5676fe[_0x3fb9c9(0xb7)])),_0x15c5bc=(await readdir(_0x5e547b,{'withFileTypes':!![]})[_0x3fb9c9(0x11c)](()=>[]))[_0x3fb9c9(0xdc)](_0x2c6386=>_0x2c6386['isFile']()&&_0x2c6386[_0x3fb9c9(0xb7)][_0x3fb9c9(0x96)+'th']('store-')&&!_0x2c6386[_0x3fb9c9(0xb7)][_0x3fb9c9(0x96)+'th'](_0x3fb9c9(0x21c)+_0x3fb9c9(0x24f))&&_0x2c6386[_0x3fb9c9(0xb7)]['endsWith']('.js'))[_0x3fb9c9(0x1a8)](_0x249a7d=>join(_0x5e547b,_0x249a7d[_0x3fb9c9(0xb7)]));for(const _0x28f51a of _0x57c3a6){const _0x2022f2=await readFile(_0x28f51a,_0x3fb9c9(0xc7)),_0x253655=patchSessionStoreLoadFromSource(_0x2022f2,{'bridgeImportPath':_0xf63066});if(!_0x253655['patched']){if(_0x253655[_0x3fb9c9(0x75)]===_0x3fb9c9(0x16f)+_0x3fb9c9(0xee)){_0x29c5e5[_0x3fb9c9(0xef)+_0x3fb9c9(0x11e)]?.[_0x3fb9c9(0x148)]?.(_0x3fb9c9(0x16d)+_0x3fb9c9(0x21f)+_0x3fb9c9(0x125)+_0x3fb9c9(0x231)+_0x3fb9c9(0x153),{'filePath':_0x28f51a,'openclawVersion':_0x5239e5[_0x3fb9c9(0x1d4)+'Version']});break;}continue;}await writeFile(_0x28f51a,_0x253655[_0x3fb9c9(0x150)],_0x3fb9c9(0xc7)),_0x29c5e5[_0x3fb9c9(0xef)+_0x3fb9c9(0x11e)]?.[_0x3fb9c9(0x148)]?.('session\x20'+'store\x20lo'+_0x3fb9c9(0x125)+'\x20applied',{'filePath':_0x28f51a,'openclawVersion':_0x5239e5['openclaw'+_0x3fb9c9(0x237)]});break;}for(const _0x2fede2 of _0x15c5bc){const _0x5a2a4a=await readFile(_0x2fede2,_0x3fb9c9(0xc7)),_0x48280a=patchSessionStoreWriteFromSource(_0x5a2a4a,{'bridgeImportPath':_0xf63066});if(!_0x48280a[_0x3fb9c9(0xee)]){if(_0x48280a[_0x3fb9c9(0x75)]===_0x3fb9c9(0x16f)+_0x3fb9c9(0xee)){_0x29c5e5[_0x3fb9c9(0xef)+'ogger']?.[_0x3fb9c9(0x148)]?.(_0x3fb9c9(0x16d)+_0x3fb9c9(0x1e0)+_0x3fb9c9(0x8b)+'h\x20alread'+_0x3fb9c9(0x167)+'d',{'filePath':_0x2fede2,'openclawVersion':_0x5239e5[_0x3fb9c9(0x1d4)+'Version']});break;}continue;}await writeFile(_0x2fede2,_0x48280a[_0x3fb9c9(0x150)],'utf8'),_0x29c5e5[_0x3fb9c9(0xef)+_0x3fb9c9(0x11e)]?.[_0x3fb9c9(0x148)]?.(_0x3fb9c9(0x16d)+_0x3fb9c9(0x1e0)+_0x3fb9c9(0x8b)+_0x3fb9c9(0x1fa)+'d',{'filePath':_0x2fede2,'openclawVersion':_0x5239e5[_0x3fb9c9(0x1d4)+_0x3fb9c9(0x237)]});break;}}async function resolveRuntimeChannelImportPath(_0x5f10fd,_0x3625c5){const _0x34fd74=_0x5ae80f,_0xd42522=_0x3625c5[_0x34fd74(0xdc)](_0x1afe2d=>_0x1afe2d[_0x34fd74(0x17e)]()&&_0x1afe2d[_0x34fd74(0xb7)][_0x34fd74(0x96)+'th'](_0x34fd74(0x181)+_0x34fd74(0x128))&&_0x1afe2d[_0x34fd74(0xb7)][_0x34fd74(0xcb)](_0x34fd74(0x8d))&&!_0x1afe2d[_0x34fd74(0xb7)][_0x34fd74(0x96)+'th'](_0x34fd74(0x181)+'channel-'+_0x34fd74(0x9d)))[_0x34fd74(0x1a8)](_0x5a9875=>_0x5a9875[_0x34fd74(0xb7)])[_0x34fd74(0x1fe)]();for(const _0x16a9f3 of _0xd42522){const _0x597b7e=await readFile(join(_0x5f10fd,_0x16a9f3),_0x34fd74(0xc7));if(_0x597b7e[_0x34fd74(0x68)](_0x34fd74(0x166)+_0x34fd74(0x202)+_0x34fd74(0x1f8)))return'./'+_0x16a9f3;}return null;}function normalizeRuntimeRelativePath(_0x206db5){const _0x43696b=_0x5ae80f;return _0x206db5[_0x43696b(0x81)+'ll']('\x5c','/');}function _0x52fa(){const _0x3e9d90=['d\x20an\x20inv','h\x20applie','wBin','\x20set\x20\x22OP','penClaw\x20','sort','find','>/dev/nu','t\x20\x22OPENC','ntimeCha','ugin\x20dep','utable','Spec','export\x20O','=\x22${OPEN','fix\x20star','--omit=d','required','nodeVers','g\x20from\x20O','ecs','IR=$(CDP','st\x20be\x20a\x20','now','lib/node','win','14775112yalqaU','ipped;\x20d','skills','rg/dist/','des.','w.cmd','-peer-de','rs;\x20veri','keys','store-lo','npm-cli.','match','store\x20lo','parse','d:\x20','st=','ame','_HOME:-','aw\x202026.','ntPaths','data','.json','dist','mjs','package','nced',',\x20shell.','npm-glob','--legacy','\x20found','\x20already','2JGfuaL','toISOStr','unknown','pendenci','split','Version','lugin\x20','@echo\x20of','--\x20\x22$(di','\x20-z\x20\x22$WU','string','==\x22\x22\x20set','und:\x20','plied','ld\x20start','m-cli.js','replace','\x20not\x20fou','age\x20was\x20','download','ist\x20not\x20','OME=','nning\x20op','ILE_NAME','agentSco','fix\x20mark','function','unction\x20','wujie-lo','ad-','on\x20futur','time]\x20ru','installP','trim','npm-cach','runtimeS','arch','rname\x20--','Temporar','chat\x20his','ATE_DIR%','connecto','runtime:','\x22\x20%*','skills\x20s','/npm','includes','_NAME:-','-doctor.','arm64','E_DIR=','_DIR%','\x20prepare','local\x20pl','wujieai.','devDepen','found','time]\x20do','pipe','reason','object','loader-','npm\x20root','resolved','\x20paths','[wujie-s','268456BETFIu','\x22==\x22\x22\x20se','isArray','E_NAME%\x22','idated','replaceA','ATH:-','te/cli\x20i','\x20kdocs\x20s','win32','l\x20prepar','153EEMvXt','try\x20not\x20','package.','lib','ite\x20patc','json','.js','--no-fun','rebuilt\x20','OGO\x22\x20];\x20','plugin\x20r','jection\x20','cal\x20runt','slice','nodeExec','startsWi','\x20resolve','pluginSp','label','shasum','indexOf','1\x20]\x20&&\x20[','state-','-extract','sion\x20val','alid\x20pay','path','product\x20','288410eZXxLR','ie-shell','config=','npm','\x20create\x20','\x20path\x20mu','%USERPRO','me\x20missi','FILE%\x5c','atch\x20alr','platform','dules/np','sion\x20mis','pped;\x20di','1986996iUPKfS','octor\x20--','Claw','stdout','ot\x20found','plugin\x20s','name','dependen','node','add','projectR','manifest','shell-ru','values','unzip','\x20complet','he\x20runti','npmCli','LocalPlu','enclaw\x20d','$HOME/','ify\x20upst','utf8','STATE_DI','with\x20cod','\x20written','endsWith','integrit','OpenClaw','tarball:','isDirect','all\x20loca','href','d\x20to\x20','flush','NFIG_FIL','skipped;','runtime','runtimeR','roductRu','eady\x20app','LocalAge','pid','filter','node/bin','ime/sess','ules','ipped;\x20f','AW_CONFI','pec:\x20','configur','ed-tool\x20','in\x20','not\x20foun','synced','-xzf','ynced','--no-aud','channel\x20','process.','cli','patched','runtimeL','stalling','push','headers','tory\x20pro','entryCou','ntime\x20re','set\x20\x22SCR','llPaths','scripts','pped;\x20lo','skill','index.mj','base\x20bui','in\x20runti','in\x20insta','_shared','Dependen','extract-','ath','patch\x20ap','er\x20writt','if\x20[\x20-t\x20','ion','error','re\x20upgra','rent','leted','tar','\x20product','ut\x20after','LocalSki','\x20\x22OPENCL','es\x20','plugins','if\x20\x22%OPE','\x22\x20\x22$@\x22','\x22\x20\x22$SCRI','\x20can\x20ins','stderr','npm\x20pack','132vrcCYr','y:\x20','path:\x20','tar.xz','catch','\x20on\x20futu','ogger','NCLAW_CO','st\x20not\x20f','\x20configu','director','pped;\x20ru','npm\x20inst','ad\x20patch','12wAFYmB','time-bri','channel-','68290lpYdAr',':\x20manife','--fix','time-too','dataDirN','red\x20Open','G_FILE_N','ginPaths','2428223TdWHUj','time','--json','ncies','\x20doctor\x20','runtime\x20','\x20install','@larksui','/node_mo','FIG_FILE','node_mod','el.inbou','tools\x20sy','ady\x20curr','CRIPT_DI','kill\x20not','untime\x20p','fix\x20comp','dge.mjs','\x20bin\x20was','set','timeoutM','w-extrac','info','ENCLAW_H','ing','bin','endencie','npm\x20plug','ebuild\x20t','then','source','eted','eer','\x20applied','ntime','hell:run','ATH=\x22${O','WorkingD','ent','warn','doctor','\x22\x20at\x20','syncOnly','prepare\x20','\x22%SCRIPT','prepareP','HOME=\x22${','SIGTERM','\x20path\x20wa','\x22\x20so\x20the','node\x20ver','\x20did\x20not','createRu','y\x20applie','\x20returne','s\x20not\x20fo','close','Unable\x20t','r\x20OpenCl','session\x20','928637YvKFnW','already-','ader\x20not','length','wrapper\x20','e\x20upgrad','lled','PT_DIR/','led','nd\x20helpe','agents','\x20timed\x20o','ted','has','resume','registry','isFile','nd\x20after','ile\x20not\x20','runtime-','Name','4wzICLS','kill','\x22\x20from\x20','lied','ced','statusCo','ATE_DIR:','dencies','ound','Configur','y\x20compat','PENCLAW_','join','.opencla','Duplicat','ignore',';\x20run\x20wu','CLAW_CON','https://','filename','e\x20plugin','null','optional','extensio','plugins\x20','ujie-she','ime\x20buil','oot','spec','\x20entry\x20\x22','\x20validat','\x20id\x20from','atch:\x20ma','.\x20Run\x20\x22w','patch\x20sk','ed\x20OpenC','Run\x20\x22wuj','map','exec\x20\x22$S','location','tory\x20mix','red\x20Node','dataDir','re\x22\x20to\x20r','missing\x20','s\x20instal','some','-xJf','d\x20for\x20lo','?t=','\x20version','LAW_STAT','toString','generate','bug;\x20ver','root','\x20is\x20miss','\x20loaded','execPath','ATH=\x20cd\x20','atch\x20ski','dAt','log','\x20\x20\x22$SCRI','leName','m/bin/np','Bin','install','Invalid\x20','x64','allowMis','\x20runtime','JSON:\x20','SCRIPT_D','eady\x20cur','started','failed','AME=','env','extract\x20','local:','openclaw','NCLAW_ST','&&\x20pwd)','.plugin-','local','appId','wujiecla','s\x20missin','ory','cies','r\x20runtim','product','store\x20wr','jie-shel','IPT_DIR=','e\x20tools\x20','pack','\x20failed\x20','\x22\x20\x22%SCRI','/opencla','go.mjs','version','Claw\x20ver','solver\x20n','chat-dis','versions','patch\x20al','ng\x20chann','ld\x20compl','.cache','time]\x20in','or.com','--omit=p','sets/wuj','pluginId','configFi','nnel'];_0x52fa=function(){return _0x3e9d90;};return _0x52fa();}function toWindowsPath(_0xcda2f0){return _0xcda2f0['replaceA'+'ll']('/','\x5c');}function validateRuntimeNodeVersion(_0x3bd505,_0x123540){const _0x5958c3=_0x5ae80f;if(_0x3bd505[_0x5958c3(0x20b)+_0x5958c3(0x106)]===_0x123540[_0x5958c3(0x1d4)][_0x5958c3(0x20b)+_0x5958c3(0x106)])return;throw new Error(_0x5958c3(0x136)+_0x5958c3(0x20b)+'ion\x20mism'+_0x5958c3(0x1a3)+'nifest='+(_0x3bd505[_0x5958c3(0x20b)+'ion']||_0x5958c3(0x234))+(_0x5958c3(0x22d)+_0x5958c3(0xa5))+_0x123540[_0x5958c3(0x1d4)][_0x5958c3(0x20b)+_0x5958c3(0x106)]+'.\x20'+(_0x5958c3(0x1a7)+_0x5958c3(0xa4)+_0x5958c3(0x6e)+_0x5958c3(0x163)+_0x5958c3(0x10c)+_0x5958c3(0x1ca)+'\x20can\x20be\x20'+_0x5958c3(0x8f)+'with\x20the'+'\x20configu'+_0x5958c3(0x1ac)+_0x5958c3(0x1b5)+'.'));}function validateRuntimeOpenClawVersion(_0x1fb9ea,_0x2f1f49){const _0x3c3962=_0x5ae80f;if(_0x1fb9ea[_0x3c3962(0x1d4)+_0x3c3962(0x237)]===_0x2f1f49[_0x3c3962(0x1d4)]['openclaw'+_0x3c3962(0x237)])return;throw new Error(_0x3c3962(0x136)+'openclaw'+'Version\x20'+'mismatch'+_0x3c3962(0x12a)+_0x3c3962(0x222)+(_0x1fb9ea['openclaw'+'Version']||_0x3c3962(0x234))+(_0x3c3962(0x22d)+_0x3c3962(0xa5))+_0x2f1f49[_0x3c3962(0x1d4)][_0x3c3962(0x1d4)+_0x3c3962(0x237)]+'.\x20'+(_0x3c3962(0x1a7)+'ie-shell'+_0x3c3962(0x6e)+'\x22\x20so\x20the'+_0x3c3962(0x1ca)+_0x3c3962(0x115)+'tall\x20the'+_0x3c3962(0x121)+_0x3c3962(0x12e)+_0x3c3962(0x1ea)+'sion.'));}function parseNpmPackJson(_0x5178bd){const _0x1ed40e=_0x5ae80f,_0x133784=_0x5178bd[_0x1ed40e(0x253)](),_0x2d9623=_0x133784[_0x1ed40e(0x9b)]('[');if(_0x2d9623<0x0)throw new Error('npm\x20pack'+'\x20did\x20not'+'\x20return\x20'+_0x1ed40e(0x1cb)+_0x133784[_0x1ed40e(0x94)](0x0,0x1f4));const _0x33f40f=JSON[_0x1ed40e(0x220)](_0x133784[_0x1ed40e(0x94)](_0x2d9623)),_0x388df3=Array[_0x1ed40e(0x7e)](_0x33f40f)?_0x33f40f[0x0]:_0x33f40f;if(!_0x388df3||typeof _0x388df3!==_0x1ed40e(0x76))throw new Error(_0x1ed40e(0x117)+_0x1ed40e(0x168)+_0x1ed40e(0x1f9)+_0x1ed40e(0xa0)+'load:\x20'+_0x133784[_0x1ed40e(0x94)](0x0,0x1f4));return _0x388df3;}function normalizePackedTarballFilename(_0x51f1a5){const _0x5a0534=_0x5ae80f;return _0x51f1a5[_0x5a0534(0x242)](/^@/,'')['replaceA'+'ll']('/','-')[_0x5a0534(0x81)+'ll']('\x5c','-');}async function runProcess(_0x27f1e2,_0x3e8842,_0x3998d7={}){const _0x3d4e57=_0x5ae80f,_0x528b21=_0x3998d7[_0x3d4e57(0x99)]||[_0x27f1e2,..._0x3e8842][_0x3d4e57(0x18f)]('\x20'),_0x53dcdc=_0x3998d7[_0x3d4e57(0x146)+'s']??NPM_INSTALL_TIMEOUT_MS,_0xcdc066=spawn(_0x27f1e2,_0x3e8842,{'cwd':_0x3998d7['cwd'],'env':_0x3998d7[_0x3d4e57(0x1d1)],'stdio':[_0x3d4e57(0x192),_0x3d4e57(0x74),'pipe']});return await new Promise((_0x186dac,_0x53161d)=>{const _0x580938=_0x3d4e57;let _0xe3adfe='',_0x56b6cb='',_0x55ecfa=![];const _0x4b2061=setTimeout(()=>{const _0x4c86eb=_0x458f;if(_0x55ecfa)return;_0x55ecfa=!![],_0xcdc066[_0x4c86eb(0x184)](_0x4c86eb(0x161)),_0x53161d(new Error(_0x528b21+(_0x4c86eb(0x179)+_0x4c86eb(0x10d)+'\x20')+_0x53dcdc+'ms'));},_0x53dcdc);_0xcdc066['stdout']['on']('data',_0x30e879=>{const _0x364ff8=_0x458f;_0xe3adfe+=_0x30e879[_0x364ff8(0x1b7)]();}),_0xcdc066[_0x580938(0x116)]['on'](_0x580938(0x227),_0x618997=>{const _0x1f9c05=_0x580938;_0x56b6cb+=_0x618997[_0x1f9c05(0x1b7)]();}),_0xcdc066['on'](_0x580938(0x107),_0x271145=>{if(_0x55ecfa)return;_0x55ecfa=!![],clearTimeout(_0x4b2061),_0x53161d(_0x271145);}),_0xcdc066['on']('close',(_0x16c3d1,_0x2e4bac)=>{const _0x1ec2a4=_0x580938;if(_0x55ecfa)return;_0x55ecfa=!![],clearTimeout(_0x4b2061);if(_0x16c3d1===0x0){_0x186dac({'stdout':_0xe3adfe,'stderr':_0x56b6cb});return;}_0x53161d(new Error(_0x528b21+(_0x1ec2a4(0x1e5)+_0x1ec2a4(0xc9)+'e=')+(_0x16c3d1??_0x1ec2a4(0x198))+'\x20signal='+(_0x2e4bac??'null')+'\x0a'+(''+(_0x56b6cb||_0xe3adfe))[_0x1ec2a4(0x253)]()));});});}async function installOpenClawPackage(_0xb57fa4,_0xd0a945){const _0x3e8bbc=_0x5ae80f,_0x310adc=join(_0xb57fa4['runtimeR'+_0x3e8bbc(0x19e)],_0x3e8bbc(0x1f1)),_0x4f20af=join(_0xb57fa4[_0x3e8bbc(0xd7)+_0x3e8bbc(0x19e)],_0x3e8bbc(0x190)+_0x3e8bbc(0x147)+'t');await mkdir(_0x310adc,{'recursive':!![]}),await removePathWithRetries(_0x4f20af),await mkdir(_0x4f20af,{'recursive':!![]});const _0x40a273=await createRuntimeEnv(_0xb57fa4),_0x4672f8=_0x3e8bbc(0x1d4)+'@'+_0xd0a945;console['log'](_0x3e8bbc(0x7b)+'hell:run'+_0x3e8bbc(0x1f2)+_0x3e8bbc(0xf0)+'\x20'+_0x4672f8);const _0x43c04c=await runProcess(_0xb57fa4[_0x3e8bbc(0x95)+'utable'],[_0xb57fa4[_0x3e8bbc(0xc2)],_0x3e8bbc(0x1e4),_0x4672f8,_0x3e8bbc(0x133)],{'cwd':_0x310adc,'env':_0x40a273,'label':'npm\x20pack'+'\x20'+_0x4672f8}),_0xd4aac=parseNpmPackJson(_0x43c04c[_0x3e8bbc(0xb4)]);if(_0xd4aac['version']!==_0xd0a945)throw new Error(_0x3e8bbc(0x18c)+_0x3e8bbc(0x1a6)+'law\x20'+_0xd0a945+(_0x3e8bbc(0x97)+_0x3e8bbc(0xd2))+_0xd4aac[_0x3e8bbc(0x1e9)]);const _0x8f3104=resolve(_0x310adc,_0xd4aac[_0x3e8bbc(0x196)]);if(!existsSync(_0x8f3104))throw new Error(_0x3e8bbc(0x117)+_0x3e8bbc(0x165)+'\x20create\x20'+_0x3e8bbc(0xce)+'\x20'+_0x8f3104);await runProcess(_0x3e8bbc(0x10b),[_0x3e8bbc(0xe8),_0x8f3104,'-C',_0x4f20af],{'label':_0x3e8bbc(0x1d2)+_0xd4aac[_0x3e8bbc(0x196)]}),await removePathWithRetries(_0xb57fa4[_0x3e8bbc(0x1d4)+'WorkingD'+'ir']),await rename(join(_0x4f20af,_0x3e8bbc(0x22b)),_0xb57fa4[_0x3e8bbc(0x1d4)+_0x3e8bbc(0x157)+'ir']),await removePathWithRetries(_0x4f20af),await runProcess(_0xb57fa4[_0x3e8bbc(0x95)+_0x3e8bbc(0x204)],[_0xb57fa4[_0x3e8bbc(0xc2)],_0x3e8bbc(0x1c6),_0x3e8bbc(0x209)+'ev',_0x3e8bbc(0x1f4)+_0x3e8bbc(0x152),'--no-aud'+'it',_0x3e8bbc(0x8e)+'d',_0x3e8bbc(0x22f)+_0x3e8bbc(0x219)+'ps'],{'cwd':_0xb57fa4[_0x3e8bbc(0x1d4)+_0x3e8bbc(0x157)+'ir'],'env':_0x40a273,'label':_0x3e8bbc(0x124)+'all\x20'+_0x4672f8+(_0x3e8bbc(0x1ca)+'\x20depende'+_0x3e8bbc(0x134))});if(!existsSync(_0xb57fa4[_0x3e8bbc(0x1d4)+_0x3e8bbc(0x1c5)]))throw new Error(_0x3e8bbc(0xcd)+_0x3e8bbc(0x144)+_0x3e8bbc(0x243)+_0x3e8bbc(0x17f)+_0x3e8bbc(0x137)+':\x20'+_0xb57fa4[_0x3e8bbc(0x1d4)+_0x3e8bbc(0x1c5)]);}async function ensureRuntimeBase(_0x27163a,_0x3a59a1,_0x62f1ee={}){const _0x15dfa8=_0x5ae80f;await mkdir(_0x3a59a1,{'recursive':!![]});let _0x34b84e=await readRuntimeManifest(_0x3a59a1);const _0x3e1d1b=_0x27163a[_0x15dfa8(0x1d4)][_0x15dfa8(0x20b)+_0x15dfa8(0x106)],_0x422d63=_0x27163a[_0x15dfa8(0x1d4)][_0x15dfa8(0x1d4)+_0x15dfa8(0x237)],_0xc57446=existsSync(resolveManifestPath(_0x3a59a1)),_0x280b70=runtimeHasRequiredPaths(_0x3a59a1,_0x34b84e),_0x453af5=_0x34b84e['nodeVers'+_0x15dfa8(0x106)]===_0x3e1d1b;!_0xc57446||!_0x280b70||!_0x453af5?(_0x62f1ee[_0x15dfa8(0xef)+'ogger']?.['info'](_0x15dfa8(0x136)+'base\x20bui'+_0x15dfa8(0x240)+'ed',{'runtimeRoot':_0x3a59a1,'reason':!_0xc57446?'missing\x20'+_0x15dfa8(0xbc):!_0x280b70?'missing\x20'+_0x15dfa8(0x20a)+_0x15dfa8(0x1ca)+_0x15dfa8(0x7a):_0x15dfa8(0x164)+_0x15dfa8(0xaf)+_0x15dfa8(0x21e),'syncOnly':_0x62f1ee[_0x15dfa8(0x15c)]}),_0x34b84e=await buildRuntimeBase(_0x27163a,_0x3a59a1,_0x34b84e),_0x62f1ee['runtimeL'+_0x15dfa8(0x11e)]?.[_0x15dfa8(0x148)](_0x15dfa8(0x136)+_0x15dfa8(0xfc)+_0x15dfa8(0x1f0)+_0x15dfa8(0x151),{'manifest':summarizeRuntimeManifest(_0x34b84e)})):_0x62f1ee[_0x15dfa8(0xef)+'ogger']?.[_0x15dfa8(0x148)](_0x15dfa8(0x136)+'base\x20alr'+_0x15dfa8(0x1cd)+_0x15dfa8(0x109),{'manifest':summarizeRuntimeManifest(_0x34b84e)});if(!existsSync(resolve(_0x3a59a1,_0x34b84e[_0x15dfa8(0x1d4)+_0x15dfa8(0x1c5)]))){const _0x55bbb7=createRuntimeInfoFromManifest(_0x3a59a1,_0x34b84e,{'allowMissingOpenClaw':!![]});await installOpenClawPackage(_0x55bbb7,_0x422d63),_0x34b84e[_0x15dfa8(0x1d4)+'Version']=_0x422d63;}return _0x34b84e;}function runtimeHasRequiredPaths(_0x527def,_0x592378){const _0x5d8946=_0x5ae80f;return[_0x5d8946(0x95)+_0x5d8946(0x204),_0x5d8946(0xc2),_0x5d8946(0x1d4)+_0x5d8946(0x157)+'ir',_0x5d8946(0x1d4)+_0x5d8946(0x1c5)]['every'](_0x319556=>typeof _0x592378[_0x319556]===_0x5d8946(0x23c)&&_0x592378[_0x319556][_0x5d8946(0x253)]())&&[_0x5d8946(0x95)+_0x5d8946(0x204),'npmCli']['every'](_0xe71f38=>existsSync(resolve(_0x527def,_0x592378[_0xe71f38])));}async function buildRuntimeBase(_0x1305a2,_0x350a13,_0xa916a4={}){const _0x400d45=_0x5ae80f,_0x58b890=join(_0x350a13,_0x400d45(0xb9));await ensureRuntimeNode(_0x1305a2,_0x58b890);const _0x3e9cdc={..._0xa916a4,'generatedAt':new Date()[_0x400d45(0x233)+_0x400d45(0x14a)](),'nodeVersion':_0x1305a2['openclaw'][_0x400d45(0x20b)+'ion'],'openclawVersion':_0xa916a4['openclaw'+'Version']||'','platform':process[_0x400d45(0xad)],'arch':process[_0x400d45(0x256)],'nodeExecutable':_0x400d45(0xdd)+'/node','npmCli':'node/lib'+_0x400d45(0x139)+_0x400d45(0xae)+_0x400d45(0x1c4)+_0x400d45(0x241),'openclawWorkingDir':'openclaw','openclawBin':_0x400d45(0x1d4)+_0x400d45(0x1e7)+'w.mjs'};return await writeJson(resolveManifestPath(_0x350a13),_0x3e9cdc),_0x3e9cdc;}async function removePathWithRetries(_0x1a40b2){await rm(_0x1a40b2,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96});}async function ensureRuntimeNode(_0x2cfed8,_0x1712d1){const _0x408fae=_0x5ae80f,_0x20bb5d=_0x2cfed8[_0x408fae(0x1d4)][_0x408fae(0x20b)+_0x408fae(0x106)],_0x4ecd88=join(_0x1712d1,_0x408fae(0x14b),'node'),_0x2232dd=join(_0x1712d1,_0x408fae(0x8a),_0x408fae(0x13b)+_0x408fae(0xdf),_0x408fae(0xa6),'bin',_0x408fae(0x21d)+'js');if(existsSync(_0x4ecd88)&&existsSync(_0x2232dd)&&await getNodeVersion(_0x4ecd88)===_0x20bb5d)return;await removePathWithRetries(_0x1712d1);if(process[_0x408fae(0x1ed)][_0x408fae(0xb9)]===_0x20bb5d){await linkCurrentNodeRuntime(_0x1712d1);return;}await downloadNodeRuntime(_0x20bb5d,_0x1712d1);}async function getNodeVersion(_0x2c2821){const _0x214f84=_0x5ae80f;try{const _0x467de4=await runProcess(_0x2c2821,['-p',_0x214f84(0xec)+_0x214f84(0x1ed)+'.node'],{'label':_0x2c2821+'\x20version','timeoutMs':0x7530});return _0x467de4[_0x214f84(0xb4)][_0x214f84(0x253)]();}catch{return'';}}async function linkCurrentNodeRuntime(_0x11c571){const _0x504b5a=_0x5ae80f,_0x176962=process[_0x504b5a(0x1bd)],_0xa75980=resolve(dirname(_0x176962),'..'),_0x1fe685=resolve(_0xa75980,_0x504b5a(0x211)+'_modules'+_0x504b5a(0x67)),_0x53c66e=join(_0x11c571,'bin',_0x504b5a(0xb9)),_0x3134ad=join(_0x11c571,_0x504b5a(0x8a),_0x504b5a(0x13b)+'ules','npm');await mkdir(dirname(_0x53c66e),{'recursive':!![]}),await mkdir(dirname(_0x3134ad),{'recursive':!![]}),await symlink(_0x176962,_0x53c66e),existsSync(_0x1fe685)?await symlink(_0x1fe685,_0x3134ad):await symlink(await resolveNpmRoot(),_0x3134ad);}async function resolveNpmRoot(){const _0x4bef49=_0x5ae80f,_0x268b63=await runProcess('npm',[_0x4bef49(0x1ba),'-g'],{'label':_0x4bef49(0x78)+'\x20-g','timeoutMs':0x7530}),_0x267306=join(_0x268b63[_0x4bef49(0xb4)][_0x4bef49(0x253)](),'npm');if(!existsSync(join(_0x267306,_0x4bef49(0x14b),_0x4bef49(0x21d)+'js')))throw new Error('npm\x20pack'+_0x4bef49(0x244)+'not\x20foun'+_0x4bef49(0x1b3)+_0x4bef49(0x93)+_0x4bef49(0x19d)+_0x4bef49(0x221)+_0x267306);return _0x267306;}async function downloadNodeRuntime(_0x14c241,_0x4ac8be){const _0x44dba8=_0x5ae80f,_0x3679cd=process['platform']===_0x44dba8(0x85)?_0x44dba8(0x212):process['platform'],_0x2e9d8a=process[_0x44dba8(0x256)]===_0x44dba8(0x1c8)?_0x44dba8(0x1c8):process[_0x44dba8(0x256)]===_0x44dba8(0x6b)?_0x44dba8(0x6b):process[_0x44dba8(0x256)],_0x540097=process[_0x44dba8(0xad)]===_0x44dba8(0x85)?'zip':_0x44dba8(0x11b),_0x4df7aa='node-v'+_0x14c241+'-'+_0x3679cd+'-'+_0x2e9d8a,_0x5f52c2=_0x4df7aa+'.'+_0x540097,_0x24e979=join(dirname(_0x4ac8be),_0x44dba8(0x1f1)),_0x11afd3=join(_0x24e979,_0x5f52c2),_0x583f07=join(_0x24e979,_0x4df7aa+(_0x44dba8(0x9e)+'-')+process[_0x44dba8(0xdb)]+'-'+Date[_0x44dba8(0x210)]()),_0x2564c2=_0x44dba8(0x195)+'nodejs.o'+_0x44dba8(0x216)+'v'+_0x14c241+'/'+_0x5f52c2;await mkdir(_0x24e979,{'recursive':!![]}),!existsSync(_0x11afd3)&&(console[_0x44dba8(0x1c1)](_0x44dba8(0x7b)+'hell:run'+_0x44dba8(0x73)+'wnloadin'+'g\x20'+_0x2564c2),await downloadFile(_0x2564c2,_0x11afd3)),await rm(_0x583f07,{'recursive':!![],'force':!![]}),await mkdir(_0x583f07,{'recursive':!![]}),process[_0x44dba8(0xad)]===_0x44dba8(0x85)?await runProcess(_0x44dba8(0xbf),['-q',_0x11afd3,'-d',_0x583f07],{'label':_0x44dba8(0x1d2)+_0x5f52c2}):await runProcess(_0x44dba8(0x10b),[_0x44dba8(0x1b2),_0x11afd3,'-C',_0x583f07],{'label':_0x44dba8(0x1d2)+_0x5f52c2}),await rename(join(_0x583f07,_0x4df7aa),_0x4ac8be),await rm(_0x583f07,{'recursive':!![],'force':!![]});}async function downloadFile(_0x102839,_0xd9588){await mkdir(dirname(_0xd9588),{'recursive':!![]});const _0x1bfe6c=await new Promise((_0x3c0901,_0x30efac)=>{const _0x3b9ba6=_0x458f;get(_0x102839,_0x476328=>{const _0x1af8b3=_0x458f;if(_0x476328[_0x1af8b3(0x188)+'de']>=0x12c&&_0x476328['statusCo'+'de']<0x190&&_0x476328['headers'][_0x1af8b3(0x1aa)]){_0x476328['resume'](),downloadFile(new URL(_0x476328[_0x1af8b3(0xf2)][_0x1af8b3(0x1aa)],_0x102839)[_0x1af8b3(0xd1)],_0xd9588)[_0x1af8b3(0x14f)](()=>_0x3c0901(null))[_0x1af8b3(0x11c)](_0x30efac);return;}if(_0x476328[_0x1af8b3(0x188)+'de']!==0xc8){_0x476328[_0x1af8b3(0x17c)](),_0x30efac(new Error(_0x1af8b3(0x245)+'\x20failed\x20'+_0x476328['statusCo'+'de']+':\x20'+_0x102839));return;}_0x3c0901(_0x476328);})['on'](_0x3b9ba6(0x107),_0x30efac);});_0x1bfe6c&&await pipeline(_0x1bfe6c,createWriteStream(_0xd9588));}export async function ensureOpenClawDoctorFixed(_0x1d8870,_0x26db71={}){const _0x1c355d=_0x5ae80f,_0x5d03e7=await loadRuntimeInfo(_0x1d8870['projectR'+_0x1c355d(0x19e)]),_0x42e7ec=getConfigPaths(_0x1d8870),_0x981f5c=join(_0x42e7ec[_0x1c355d(0x255)+'tateDir'],_0x1c355d(0x1d4)+_0x1c355d(0x6a)+_0x1c355d(0x8c)),_0x2bd2a1=await readJson(_0x981f5c,{});if(_0x2bd2a1[_0x1c355d(0x1d4)+_0x1c355d(0x237)]===_0x5d03e7[_0x1c355d(0x1d4)+_0x1c355d(0x237)])return _0x26db71[_0x1c355d(0xef)+_0x1c355d(0x11e)]?.[_0x1c355d(0x148)](_0x1c355d(0x1d4)+_0x1c355d(0x135)+'fix\x20alre'+_0x1c355d(0x13e)+_0x1c355d(0x158),{'openclawVersion':_0x5d03e7['openclaw'+_0x1c355d(0x237)],'markerPath':_0x981f5c}),{'ran':![],'openclawVersion':_0x5d03e7[_0x1c355d(0x1d4)+'Version'],'markerPath':_0x981f5c};return await runOpenClawDoctorFix(_0x1d8870,_0x5d03e7,{'fromVersion':_0x2bd2a1[_0x1c355d(0x1d4)+_0x1c355d(0x237)]||_0x1c355d(0x234),'toVersion':_0x5d03e7[_0x1c355d(0x1d4)+_0x1c355d(0x237)],'markerPath':_0x981f5c,'runtimeLogger':_0x26db71[_0x1c355d(0xef)+_0x1c355d(0x11e)]}),{'ran':!![],'openclawVersion':_0x5d03e7[_0x1c355d(0x1d4)+_0x1c355d(0x237)],'markerPath':_0x981f5c};}async function runOpenClawDoctorFix(_0x529c81,_0xa08646,{fromVersion:_0x2f67ed,toVersion:_0x39a2ba,markerPath:markerPath='',runtimeLogger:_0x9d3eb1}={}){const _0x599ec4=_0x5ae80f;_0x9d3eb1?.[_0x599ec4(0x148)](_0x599ec4(0x1d4)+_0x599ec4(0x135)+_0x599ec4(0x208)+_0x599ec4(0x17a),{'fromVersion':_0x2f67ed,'toVersion':_0x39a2ba});const _0x116f58=await createRuntimeEnv(_0xa08646,{'OPENCLAW_HOME':_0x529c81[_0x599ec4(0x1ad)],'OPENCLAW_STATE_DIR':_0x529c81['dataDir'],'OPENCLAW_CONFIG_PATH':getConfigPaths(_0x529c81)['configPa'+'th']});console[_0x599ec4(0x1c1)](_0x599ec4(0x7b)+_0x599ec4(0x155)+_0x599ec4(0x251)+_0x599ec4(0x248)+_0x599ec4(0xc4)+_0x599ec4(0xb2)+'fix');const _0x2b4f12=await runProcess(_0xa08646[_0x599ec4(0x95)+_0x599ec4(0x204)],[_0xa08646[_0x599ec4(0x1d4)+'Bin'],_0x599ec4(0x15a),_0x599ec4(0x12b)],{'cwd':_0xa08646[_0x599ec4(0x1d4)+_0x599ec4(0x157)+'ir'],'env':_0x116f58,'label':_0x599ec4(0x1d4)+_0x599ec4(0x135)+_0x599ec4(0x12b),'timeoutMs':0x1d4c0});_0x9d3eb1?.['info'](_0x599ec4(0x1d4)+'\x20doctor\x20'+_0x599ec4(0x142)+_0x599ec4(0x10a),{'fromVersion':_0x2f67ed,'toVersion':_0x39a2ba,'stdout':_0x2b4f12[_0x599ec4(0xb4)]['trim']()['slice'](-0xfa0),'stderr':_0x2b4f12['stderr'][_0x599ec4(0x253)]()[_0x599ec4(0x94)](-0xfa0)}),markerPath&&(await writeJson(markerPath,{'openclawVersion':_0xa08646[_0x599ec4(0x1d4)+'Version'],'fixedAt':new Date()[_0x599ec4(0x233)+'ing']()}),_0x9d3eb1?.[_0x599ec4(0x148)]('openclaw'+_0x599ec4(0x135)+_0x599ec4(0x24b)+_0x599ec4(0x104)+'en',{'markerPath':markerPath,'openclawVersion':_0xa08646['openclaw'+_0x599ec4(0x237)]}));}export async function readRuntimeManifest(_0x525901){return await readJson(resolveManifestPath(_0x525901),{});}export async function loadRuntimeInfo(_0x37a02f){const _0xe08c7d=resolveRuntimeRoot(_0x37a02f),_0x3a92ba=await readRuntimeManifest(_0xe08c7d);return createRuntimeInfoFromManifest(_0xe08c7d,_0x3a92ba);}function createRuntimeInfoFromManifest(_0x50dfd8,_0x5ec637,_0x35d871={}){const _0x40c4d5=_0x5ae80f;for(const _0x46a49f of[_0x40c4d5(0x95)+_0x40c4d5(0x204),_0x40c4d5(0xc2),_0x40c4d5(0x1d4)+_0x40c4d5(0x157)+'ir',_0x40c4d5(0x1d4)+'Bin']){if(typeof _0x5ec637[_0x46a49f]!=='string'||!_0x5ec637[_0x46a49f][_0x40c4d5(0x253)]())throw new Error('runtime\x20'+'manifest'+_0x40c4d5(0x1bb)+'ing\x20\x22'+_0x46a49f+_0x40c4d5(0x15b)+resolveManifestPath(_0x50dfd8)+(_0x40c4d5(0x193)+_0x40c4d5(0x1e1)+_0x40c4d5(0x86)+'e'));}const _0x169d51=resolve(_0x50dfd8,_0x5ec637[_0x40c4d5(0x95)+'utable']),_0x51bced=resolve(_0x50dfd8,_0x5ec637[_0x40c4d5(0xc2)]),_0x138f1e=resolve(_0x50dfd8,_0x5ec637[_0x40c4d5(0x1d4)+_0x40c4d5(0x157)+'ir']),_0x20a9a5=resolve(_0x50dfd8,_0x5ec637['openclaw'+'Bin']),_0x355aa1=Array[_0x40c4d5(0x7e)](_0x5ec637[_0x40c4d5(0x111)])?_0x5ec637[_0x40c4d5(0x111)]['map'](_0x3771a2=>({..._0x3771a2,'installPath':resolve(_0x50dfd8,_0x3771a2[_0x40c4d5(0x252)+'ath'])})):[],_0x2eb102=_0x35d871[_0x40c4d5(0x1c9)+'singOpen'+_0x40c4d5(0xb3)]?[_0x169d51,_0x51bced]:[_0x169d51,_0x51bced,_0x138f1e,_0x20a9a5];for(const _0x17b923 of _0x2eb102){if(!existsSync(_0x17b923))throw new Error(_0x40c4d5(0x136)+_0x40c4d5(0x1af)+_0x40c4d5(0x11a)+_0x17b923);}return{'runtimeRoot':_0x50dfd8,'manifest':_0x5ec637,'openclawVersion':_0x5ec637[_0x40c4d5(0x1d4)+_0x40c4d5(0x237)]||_0x40c4d5(0x234),'nodeExecutable':_0x169d51,'npmCli':_0x51bced,'openclawWorkingDir':_0x138f1e,'openclawBin':_0x20a9a5,'plugins':_0x355aa1};}function _0x458f(_0x521402,_0x23a86b){_0x521402=_0x521402-0x66;const _0x52fab1=_0x52fa();let _0x458f28=_0x52fab1[_0x521402];return _0x458f28;}export async function spawnClaw(_0x477872,_0x3440fb=[],_0x370008={}){const _0x24657d=_0x5ae80f,_0x2ef129=await loadRuntimeInfo(_0x477872),_0x1a7783=await createRuntimeEnv(_0x2ef129,_0x370008[_0x24657d(0x1d1)]??{});return spawn(_0x2ef129[_0x24657d(0x95)+_0x24657d(0x204)],[_0x2ef129[_0x24657d(0x1d4)+'Bin'],..._0x3440fb],{'cwd':_0x2ef129[_0x24657d(0x1d4)+_0x24657d(0x157)+'ir'],'stdio':_0x24657d(0x74),..._0x370008,'env':_0x1a7783});}export async function runClawOnce(_0x53a40f,_0x53615e=[],_0x4fc00c=0x15f90){const _0x42f0ef=await spawnClaw(_0x53a40f,_0x53615e);return await new Promise((_0x67c392,_0x3e047b)=>{const _0x239e5a=_0x458f;let _0x21d82e='',_0x347701='',_0x229e27=![];const _0x40f11a=setTimeout(()=>{const _0x3a0a52=_0x458f;if(_0x229e27)return;_0x229e27=!![],_0x42f0ef[_0x3a0a52(0x184)](_0x3a0a52(0x161)),_0x3e047b(new Error(_0x3a0a52(0x1d4)+'\x20timed\x20o'+_0x3a0a52(0x10d)+'\x20'+_0x4fc00c+'ms'));},_0x4fc00c);_0x42f0ef['stdout']['on']('data',_0x3a56b6=>{_0x21d82e+=_0x3a56b6['toString']();}),_0x42f0ef[_0x239e5a(0x116)]['on'](_0x239e5a(0x227),_0x1ebb19=>{const _0x2cf431=_0x239e5a;_0x347701+=_0x1ebb19[_0x2cf431(0x1b7)]();}),_0x42f0ef['on'](_0x239e5a(0x107),_0x102879=>{if(_0x229e27)return;_0x229e27=!![],clearTimeout(_0x40f11a),_0x3e047b(_0x102879);}),_0x42f0ef['on'](_0x239e5a(0x16a),(_0x451fe9,_0x476553)=>{if(_0x229e27)return;_0x229e27=!![],clearTimeout(_0x40f11a),_0x67c392({'code':_0x451fe9,'signal':_0x476553,'stdout':_0x21d82e,'stderr':_0x347701});});});}async function findRuntimeLarkCliBin(_0x34751c){const _0x2c02fa=_0x5ae80f,_0x45858b=join(_0x34751c[_0x2c02fa(0x1d4)+'WorkingD'+'ir'],_0x2c02fa(0x13b)+'ules',_0x2c02fa(0x138)+'te',_0x2c02fa(0xed)),_0x5ad4b4=join(_0x45858b,_0x2c02fa(0x89)+_0x2c02fa(0x8c));if(!existsSync(_0x5ad4b4))return{'packageDir':_0x45858b,'binPath':null};try{const _0x2ba9ed=JSON['parse'](await readFile(_0x5ad4b4,'utf8')),_0x544ed1=typeof _0x2ba9ed[_0x2c02fa(0x14b)]===_0x2c02fa(0x23c)?_0x2ba9ed[_0x2c02fa(0x14b)]:_0x2ba9ed[_0x2c02fa(0x14b)]&&typeof _0x2ba9ed['bin']===_0x2c02fa(0x76)?_0x2ba9ed['bin']['lark-cli']||Object['values'](_0x2ba9ed['bin'])[0x0]:'';return{'packageDir':_0x45858b,'binPath':_0x544ed1?join(_0x45858b,_0x544ed1):null};}catch{return{'packageDir':_0x45858b,'binPath':null};}}export async function resolveRuntimeLarkCliCommand(_0x6c5b9){const _0x298201=_0x5ae80f,{packageDir:_0xc0eb1a,binPath:_0x1b44fb}=await findRuntimeLarkCliBin(_0x6c5b9);if(!_0x1b44fb||!existsSync(_0x1b44fb))throw new Error('Bundled\x20'+_0x298201(0x138)+_0x298201(0x83)+_0x298201(0x1db)+_0x298201(0x20c)+_0x298201(0x1fd)+_0x298201(0x25c)+'\x20'+_0xc0eb1a+(_0x298201(0x1a4)+_0x298201(0x19c)+'ll\x20prepa'+_0x298201(0x1ae)+_0x298201(0x14e)+_0x298201(0xc1)+'me.'));return{'nodeExecutable':_0x6c5b9['nodeExec'+_0x298201(0x204)],'scriptPath':_0x1b44fb,'packageDir':_0xc0eb1a};}function resolvePackageNameFromNpmSpec(_0x232bc0){const _0x3e5980=_0x5ae80f,_0xb86209=_0x232bc0[_0x3e5980(0x253)]()[_0x3e5980(0x242)](/^npm:/,'');if(!_0xb86209)throw new Error(_0x3e5980(0x1c7)+'empty\x20pl'+'ugin\x20spe'+'c');if(_0xb86209[_0x3e5980(0x96)+'th']('@')){const _0x5ef422=_0xb86209[_0x3e5980(0x9b)]('/');if(_0x5ef422===-0x1)throw new Error(_0x3e5980(0x1c7)+'scoped\x20s'+_0x3e5980(0xe2)+_0x232bc0);const _0x198eb4=_0xb86209[_0x3e5980(0x9b)]('@',_0x5ef422+0x1);return _0x198eb4===-0x1?_0xb86209:_0xb86209['slice'](0x0,_0x198eb4);}const _0x2b8a9a=_0xb86209[_0x3e5980(0x9b)]('@');return _0x2b8a9a===-0x1?_0xb86209:_0xb86209['slice'](0x0,_0x2b8a9a);}async function createRuntimeEnv(_0x59af8a,_0x13e0df={}){const _0x9262=_0x5ae80f,_0x358519=process.env.OPENCLAW_STATE_DIR||'',_0x1597fe=process.env.NPM_CONFIG_REGISTRY||_0x9262(0x195)+_0x9262(0x17d)+'.npmmirr'+_0x9262(0x1f3),_0x178149=_0x358519?join(_0x358519,'claw-run'+_0x9262(0x12c)+'ls'):join(_0x59af8a['runtimeR'+_0x9262(0x19e)],'.tools'),_0x558346=join(_0x178149,_0x9262(0x22e)+'al'),_0x11cc5d=join(_0x178149,_0x9262(0x254)+'e'),_0x54347f=join(_0x558346,_0x9262(0x14b));await mkdir(_0x54347f,{'recursive':!![]}),await mkdir(_0x11cc5d,{'recursive':!![]});const _0x22d823=[_0x54347f,dirname(_0x59af8a['nodeExec'+_0x9262(0x204)]),process.env.PATH||''];return{...process.env,..._0x13e0df,'PATH':_0x22d823['filter'](Boolean)[_0x9262(0x18f)](delimiter),'npm_config_prefix':_0x558346,'NPM_CONFIG_PREFIX':_0x558346,'npm_config_cache':_0x11cc5d,'NPM_CONFIG_CACHE':_0x11cc5d,'NPM_CONFIG_REGISTRY':_0x1597fe,'npm_execpath':_0x59af8a[_0x9262(0xc2)],'npm_node_execpath':_0x59af8a[_0x9262(0x95)+'utable'],'OPENCLAW_RUNTIME_NPM_PREFIX':_0x558346,'OPENCLAW_RUNTIME_NPM_BIN':_0x54347f};}export async function getRuntimeSpawnContext(_0x247428,_0xe93f19={}){const _0x18a44a=_0x5ae80f,_0x5b8f69=await loadRuntimeInfo(_0x247428),_0xdb151=await createRuntimeEnv(_0x5b8f69,_0xe93f19);return{'cwd':_0x5b8f69[_0x18a44a(0x1d4)+_0x18a44a(0x157)+'ir'],'env':_0xdb151,'runtime':_0x5b8f69};}function resolvePluginDirNameFromSpec(_0x35ed64){const _0x5599e9=_0x5ae80f,_0x1d021c=resolvePackageNameFromNpmSpec(_0x35ed64),_0x4b4593=_0x1d021c[_0x5599e9(0x236)]('/')[_0x5599e9(0xdc)](Boolean),_0x13612d=_0x4b4593['at'](-0x1)??'';if(!_0x13612d)throw new Error(_0x5599e9(0x1c7)+_0x5599e9(0xb6)+'pec:\x20'+_0x35ed64);return _0x13612d;}async function resolvePluginIdFromPackageDir(_0x5c12cb,_0x54c97f){const _0x5a299f=_0x5ae80f,_0x4ef220=await readJson(join(_0x5c12cb,_0x5a299f(0x89)+_0x5a299f(0x8c)),{}),_0x404e84=await readPluginManifest(_0x5c12cb),_0x36e360=[_0x404e84?.['id'],_0x404e84?.['pluginId'],_0x404e84?.[_0x5a299f(0xb7)],_0x4ef220?.[_0x5a299f(0x1d4)]?.['id'],_0x4ef220?.[_0x5a299f(0x1d4)+'Id'],_0x54c97f],_0x87d775=_0x36e360[_0x5a299f(0x1ff)](_0x4c596f=>typeof _0x4c596f===_0x5a299f(0x23c)&&_0x4c596f[_0x5a299f(0x253)]());if(!_0x87d775)throw new Error(_0x5a299f(0x16b)+'o\x20resolv'+_0x5a299f(0x197)+_0x5a299f(0x1a2)+'\x20'+_0x5c12cb);return _0x87d775[_0x5a299f(0x253)]();}function pluginSpecMatches(_0x256ecc,_0x52bfae){const _0x7ff4bf=_0x5ae80f,_0x1f2f5f=_0x52bfae['trim'](),_0x5f0d40=resolvePackageNameFromNpmSpec(_0x1f2f5f);return[_0x256ecc[_0x7ff4bf(0x19f)],_0x256ecc[_0x7ff4bf(0x79)+_0x7ff4bf(0x205)],_0x256ecc['resolved'+_0x7ff4bf(0x182)]][_0x7ff4bf(0x1b1)](_0x3ed356=>_0x3ed356===_0x1f2f5f||_0x3ed356===_0x5f0d40);}async function installPluginFromNpmSpec(_0x11792c,_0x4f5984,_0x50492e={}){const _0x4df825=_0x5ae80f,_0x2ca9c0=_0x11792c[_0x4df825(0x253)]()['replace'](/^npm:/,''),_0x11f442=resolvePluginDirNameFromSpec(_0x2ca9c0),_0x372bad=join(_0x4f5984[_0x4df825(0x1d4)+_0x4df825(0x157)+'ir'],_0x4df825(0x229),_0x4df825(0x19a)+'ns'),_0x41f3c7=join(_0x372bad,_0x11f442),_0x5532dc=join(_0x4f5984['runtimeR'+'oot'],_0x4df825(0x1d7)+_0x4df825(0x101)+process[_0x4df825(0xdb)]+'-'+Date['now']()),_0x139964=await createRuntimeEnv(_0x4f5984),_0x3e08a6=new Date()['toISOStr'+'ing'](),_0x5286e0=join(_0x4f5984[_0x4df825(0xd7)+'oot'],_0x4df825(0x1f1));await mkdir(_0x5286e0,{'recursive':!![]}),await rm(_0x5532dc,{'recursive':!![],'force':!![]}),await rm(_0x41f3c7,{'recursive':!![],'force':!![]}),await mkdir(_0x5532dc,{'recursive':!![]}),await mkdir(_0x372bad,{'recursive':!![]}),console['log'](_0x4df825(0x7b)+_0x4df825(0x155)+'time]\x20fe'+'tching\x20p'+_0x4df825(0x238)+_0x2ca9c0);const _0x1227f4=await runProcess(_0x4f5984[_0x4df825(0x95)+'utable'],[_0x4f5984[_0x4df825(0xc2)],_0x4df825(0x1e4),_0x2ca9c0,'--json'],{'cwd':_0x5286e0,'env':_0x139964,'label':_0x4df825(0x117)+'\x20'+_0x2ca9c0}),_0x506eba=parseNpmPackJson(_0x1227f4[_0x4df825(0xb4)]),_0xec8daa=normalizePackedTarballFilename(_0x506eba[_0x4df825(0x196)]),_0x5d7219=join(_0x5286e0,_0xec8daa);if(!existsSync(_0x5d7219))throw new Error(_0x4df825(0x117)+_0x4df825(0x165)+_0x4df825(0xa7)+'tarball:'+'\x20'+_0x5d7219);await runProcess(_0x4df825(0x10b),[_0x4df825(0xe8),_0x5d7219,'-C',_0x5532dc],{'label':_0x4df825(0x1d2)+_0xec8daa}),await rename(join(_0x5532dc,_0x4df825(0x22b)),_0x41f3c7),await rm(_0x5532dc,{'recursive':!![],'force':!![]});const _0xbbf070=join(_0x41f3c7,_0x4df825(0x89)+_0x4df825(0x8c)),_0xfaebe8=await readJson(_0xbbf070,{});(_0xfaebe8[_0x4df825(0x71)+_0x4df825(0x18a)]||_0xfaebe8[_0x4df825(0xf8)])&&(delete _0xfaebe8['devDepen'+_0x4df825(0x18a)],delete _0xfaebe8[_0x4df825(0xf8)],await writeJson(_0xbbf070,_0xfaebe8));await runProcess(_0x4f5984[_0x4df825(0x95)+_0x4df825(0x204)],[_0x4f5984[_0x4df825(0xc2)],_0x4df825(0x1c6),_0x4df825(0x209)+'ev',_0x4df825(0x1f4)+_0x4df825(0x152),'--no-aud'+'it','--no-fun'+'d',_0x4df825(0x22f)+_0x4df825(0x219)+'ps'],{'cwd':_0x41f3c7,'env':_0x139964,'label':'npm\x20inst'+'all\x20plug'+_0x4df825(0xe5)+_0x2ca9c0});const _0x5105fc=new Date()[_0x4df825(0x233)+_0x4df825(0x14a)](),_0x1eaa4d=await resolvePluginIdFromPackageDir(_0x41f3c7,_0x506eba[_0x4df825(0xb7)]);return _0x50492e[_0x4df825(0xef)+'ogger']?.[_0x4df825(0x148)](_0x4df825(0x14d)+_0x4df825(0xfe)+_0x4df825(0x174),{'spec':_0x2ca9c0,'pluginId':_0x1eaa4d,'installPath':_0x41f3c7}),{'pluginId':_0x1eaa4d,'source':_0x4df825(0xa6),'spec':_0x2ca9c0,'installPath':toRuntimeRelative(_0x4f5984[_0x4df825(0xd7)+'oot'],_0x41f3c7),'version':_0x506eba['version'],'resolvedName':_0x506eba[_0x4df825(0xb7)],'resolvedVersion':_0x506eba[_0x4df825(0x1e9)],'resolvedSpec':_0x506eba[_0x4df825(0xb7)]+'@'+_0x506eba[_0x4df825(0x1e9)],'integrity':typeof _0x506eba[_0x4df825(0xcc)+'y']==='string'?_0x506eba[_0x4df825(0xcc)+'y']:'','shasum':typeof _0x506eba[_0x4df825(0x9a)]==='string'?_0x506eba[_0x4df825(0x9a)]:'','resolvedAt':_0x3e08a6,'installedAt':_0x5105fc};}async function syncConfiguredNpmPlugins(_0x4fb999,_0x5679f8,_0x315a69,_0x1ee923={}){const _0x3efcec=_0x5ae80f;if(_0x1ee923['syncOnly'])return;const _0x3099a7=createRuntimeInfoFromManifest(_0x5679f8,_0x315a69),_0x2ec156=Array['isArray'](_0x315a69[_0x3efcec(0x111)])?_0x315a69[_0x3efcec(0x111)]:[],_0x31a32d=[];for(const _0x47d485 of _0x4fb999[_0x3efcec(0x1d4)][_0x3efcec(0x98)+_0x3efcec(0x20d)]){const _0x40f312=_0x2ec156[_0x3efcec(0x1ff)](_0x12e337=>_0x12e337?.['source']==='npm'&&pluginSpecMatches(_0x12e337,_0x47d485)&&typeof _0x12e337['installP'+_0x3efcec(0x102)]===_0x3efcec(0x23c)&&existsSync(resolve(_0x5679f8,_0x12e337[_0x3efcec(0x252)+'ath'])));if(_0x40f312){_0x31a32d[_0x3efcec(0xf1)](_0x40f312);continue;}_0x31a32d[_0x3efcec(0xf1)](await installPluginFromNpmSpec(_0x47d485,_0x3099a7,_0x1ee923));}const _0x8b8076=new Set(_0x4fb999[_0x3efcec(0x1d4)][_0x3efcec(0x98)+_0x3efcec(0x20d)]['map'](resolvePackageNameFromNpmSpec)),_0x23829a=_0x2ec156['filter'](_0x1d6e13=>_0x1d6e13?.[_0x3efcec(0x150)]!=='npm'||!_0x8b8076[_0x3efcec(0x17b)](resolvePackageNameFromNpmSpec(_0x1d6e13[_0x3efcec(0x79)+'Name']||_0x1d6e13[_0x3efcec(0x19f)]||'')));_0x315a69['plugins']=[..._0x23829a,..._0x31a32d];}function hasRuntimeDependencies(_0x2b4f47){const _0x58e657=_0x5ae80f,_0x3073da=_0x2b4f47?.[_0x58e657(0xb8)+'cies']&&typeof _0x2b4f47[_0x58e657(0xb8)+_0x58e657(0x1dd)]===_0x58e657(0x76)?Object['keys'](_0x2b4f47[_0x58e657(0xb8)+_0x58e657(0x1dd)]):[],_0x221de7=_0x2b4f47?.[_0x58e657(0x199)+_0x58e657(0x100)+'cies']&&typeof _0x2b4f47[_0x58e657(0x199)+_0x58e657(0x100)+_0x58e657(0x1dd)]==='object'?Object[_0x58e657(0x21b)](_0x2b4f47['optional'+'Dependen'+_0x58e657(0x1dd)]):[];return _0x3073da[_0x58e657(0x171)]>0x0||_0x221de7[_0x58e657(0x171)]>0x0;}async function installLocalPluginRuntimeDependencies(_0x397ea3,_0x898396,_0x45731a){const _0xfb6558=_0x5ae80f,_0x54b4c8=join(_0x397ea3,_0xfb6558(0x89)+_0xfb6558(0x8c)),_0x114c1e=await readJson(_0x54b4c8,{});(_0x114c1e[_0xfb6558(0x71)+_0xfb6558(0x18a)]||_0x114c1e[_0xfb6558(0xf8)])&&(delete _0x114c1e[_0xfb6558(0x71)+_0xfb6558(0x18a)],delete _0x114c1e[_0xfb6558(0xf8)],await writeJson(_0x54b4c8,_0x114c1e));if(!hasRuntimeDependencies(_0x114c1e))return;const _0x525279=await createRuntimeEnv(_0x898396);console[_0xfb6558(0x1c1)](_0xfb6558(0x7b)+_0xfb6558(0x155)+_0xfb6558(0x1f2)+_0xfb6558(0xf0)+'\x20local\x20p'+'lugin\x20de'+_0xfb6558(0x235)+_0xfb6558(0x110)+_0x397ea3),await runProcess(_0x898396['nodeExec'+_0xfb6558(0x204)],[_0x898396[_0xfb6558(0xc2)],'install',_0xfb6558(0x209)+'ev','--omit=p'+_0xfb6558(0x152),_0xfb6558(0xea)+'it',_0xfb6558(0x8e)+'d',_0xfb6558(0x22f)+_0xfb6558(0x219)+'ps'],{'cwd':_0x397ea3,'env':_0x525279,'label':_0xfb6558(0x124)+_0xfb6558(0xd0)+'l\x20plugin'+'\x20'+_0x397ea3}),_0x45731a[_0xfb6558(0xef)+_0xfb6558(0x11e)]?.[_0xfb6558(0x148)](_0xfb6558(0x6f)+_0xfb6558(0x203)+_0xfb6558(0x14c)+_0xfb6558(0x1b0)+_0xfb6558(0x176),{'installPath':_0x397ea3});}async function syncSharedPluginModules(_0x3456ef,_0xa69587){const _0x28abcb=_0x5ae80f,_0x13af27=new Set();for(const _0x4c8b6e of _0x3456ef){const _0x30ea99=join(dirname(_0x4c8b6e),_0x28abcb(0xff));if(existsSync(_0x30ea99))_0x13af27[_0x28abcb(0xba)](_0x30ea99);}for(const _0x31350a of _0x13af27){await copyDirFresh(_0x31350a,join(_0xa69587,_0x28abcb(0xff)));}}async function syncProductPlugins(_0x2622f3,_0x473253,_0x3a12b6,_0x164411={}){const _0x45fd75=_0x5ae80f,_0x449d09=join(_0x473253,'openclaw',_0x45fd75(0x229),_0x45fd75(0x19a)+'ns'),_0x2e639d=createRuntimeInfoFromManifest(_0x473253,_0x3a12b6),_0x2f01e6=[];await syncSharedPluginModules(_0x2622f3[_0x45fd75(0x1d4)][_0x45fd75(0x79)+_0x45fd75(0xc3)+_0x45fd75(0x130)],_0x449d09);for(const _0x2b7da3 of _0x2622f3[_0x45fd75(0x1d4)]['resolved'+_0x45fd75(0xc3)+_0x45fd75(0x130)]){const _0x2ed210=await getPackageMetadata(_0x2b7da3),_0x3c946c=await readPluginManifest(_0x2b7da3),_0x338126=join(_0x449d09,_0x2ed210['pluginId']);await copyDirFresh(_0x2b7da3,_0x338126),await installLocalPluginRuntimeDependencies(_0x338126,_0x2e639d,_0x164411),_0x2f01e6[_0x45fd75(0xf1)]({'pluginId':_0x2ed210[_0x45fd75(0x1f6)],'source':'local','spec':_0x45fd75(0x1d3)+_0x2b7da3,'installPath':toRuntimeRelative(_0x473253,_0x338126),'version':_0x2ed210[_0x45fd75(0x1e9)],'resolvedName':_0x2ed210[_0x45fd75(0xb7)],'resolvedVersion':_0x2ed210['version'],'resolvedSpec':'local:'+_0x2b7da3,'integrity':'','shasum':'','resolvedAt':new Date()['toISOStr'+_0x45fd75(0x14a)](),'installedAt':new Date()[_0x45fd75(0x233)+_0x45fd75(0x14a)](),'agentScope':_0x3c946c[_0x45fd75(0x24a)+'pe'],'skills':_0x3c946c[_0x45fd75(0x215)]});}const _0x1b4d91=new Set(_0x2f01e6['map'](_0x407581=>_0x407581[_0x45fd75(0x1f6)])),_0x33b774=Array[_0x45fd75(0x7e)](_0x3a12b6[_0x45fd75(0x111)])?_0x3a12b6['plugins'][_0x45fd75(0xdc)](_0x2bfc1d=>!_0x1b4d91[_0x45fd75(0x17b)](_0x2bfc1d[_0x45fd75(0x1f6)])):[];_0x3a12b6[_0x45fd75(0x111)]=[..._0x33b774,..._0x2f01e6];}async function syncManifestPluginScope(_0x12e8c6,_0x10d061,_0x111563){const _0x37e957=_0x5ae80f,_0x358a56=join(_0x10d061,_0x37e957(0x1d4),_0x37e957(0x229),_0x37e957(0x19a)+'ns'),_0x5e8e58=new Set(_0x12e8c6['openclaw'][_0x37e957(0x98)+_0x37e957(0x20d)]??[]),_0x3745aa=new Set([..._0x5e8e58][_0x37e957(0x1a8)](_0x24147b=>_0x24147b[_0x37e957(0x242)](/^npm:/,''))['map'](_0x7be7a8=>{const _0xbec0c5=_0x37e957;if(_0x7be7a8[_0xbec0c5(0x96)+'th']('@')){const _0x4dd0ca=_0x7be7a8[_0xbec0c5(0x236)]('@');return _0x4dd0ca[_0xbec0c5(0x171)]>=0x3?'@'+_0x4dd0ca[0x1]:_0x7be7a8;}return _0x7be7a8[_0xbec0c5(0x236)]('@')[0x0];})[_0x37e957(0xdc)](Boolean)),_0x3c95a7=new Set();for(const _0xa15abc of _0x12e8c6['openclaw'][_0x37e957(0x79)+_0x37e957(0xc3)+_0x37e957(0x130)]){const _0x5bb409=await getPackageMetadata(_0xa15abc);if(_0x5bb409[_0x37e957(0x1f6)])_0x3c95a7[_0x37e957(0xba)](_0x5bb409['pluginId']);}const _0x421bdb=Array[_0x37e957(0x7e)](_0x111563[_0x37e957(0x111)])?_0x111563[_0x37e957(0x111)]:[];_0x111563['pluginSp'+_0x37e957(0x20d)]=[..._0x12e8c6[_0x37e957(0x1d4)][_0x37e957(0x98)+_0x37e957(0x20d)],..._0x12e8c6[_0x37e957(0x1d4)][_0x37e957(0x79)+_0x37e957(0xc3)+_0x37e957(0x130)]['map'](_0x50b0d8=>'local:'+_0x50b0d8)],_0x111563[_0x37e957(0x111)]=_0x421bdb[_0x37e957(0xdc)](_0xd056dc=>{const _0x4c7c5a=_0x37e957;if(!_0xd056dc||typeof _0xd056dc!==_0x4c7c5a(0x76))return![];if(_0xd056dc['source']===_0x4c7c5a(0x1d8))return _0x3c95a7[_0x4c7c5a(0x17b)](_0xd056dc['pluginId']);if(_0xd056dc[_0x4c7c5a(0x150)]==='npm')return _0x5e8e58['has'](_0xd056dc['spec'])||_0x5e8e58[_0x4c7c5a(0x17b)](_0xd056dc[_0x4c7c5a(0x79)+'Spec'])||_0x3745aa[_0x4c7c5a(0x17b)](_0xd056dc[_0x4c7c5a(0x79)+_0x4c7c5a(0x182)]);return![];});const _0x1a393a=new Set(_0x111563[_0x37e957(0x111)][_0x37e957(0x1a8)](_0xcd4e3=>_0xcd4e3[_0x37e957(0x1f6)]));for(const _0x17b446 of _0x421bdb){if(!_0x17b446[_0x37e957(0x1f6)]||_0x1a393a[_0x37e957(0x17b)](_0x17b446[_0x37e957(0x1f6)]))continue;const _0x444d45=typeof _0x17b446[_0x37e957(0x252)+_0x37e957(0x102)]===_0x37e957(0x23c)&&_0x17b446[_0x37e957(0x252)+_0x37e957(0x102)]['trim']()?resolve(_0x10d061,_0x17b446[_0x37e957(0x252)+'ath']):join(_0x358a56,_0x17b446[_0x37e957(0x1f6)]),_0x5ba1b9=relative(_0x358a56,_0x444d45);if(_0x5ba1b9['startsWi'+'th']('..')||_0x5ba1b9==='')continue;await rm(_0x444d45,{'recursive':!![],'force':!![]});}}async function collectCapabilityEntries(_0xf1a8ec,_0x2a9e17){const _0x35abc7=_0x5ae80f,_0x27dd18=new Map();for(const _0x4d7875 of _0xf1a8ec){let _0x41b643;try{_0x41b643=await stat(_0x4d7875);}catch{throw new Error(_0x2a9e17+(_0x35abc7(0x162)+_0x35abc7(0x169)+_0x35abc7(0x23e))+_0x4d7875);}if(!_0x41b643[_0x35abc7(0xcf)+_0x35abc7(0x1dc)]())throw new Error(_0x2a9e17+(_0x35abc7(0xa8)+_0x35abc7(0x20f)+_0x35abc7(0x122)+_0x35abc7(0x119))+_0x4d7875);const _0x329eaa={'name':basename(_0x4d7875),'path':_0x4d7875},_0x167421=_0x27dd18['get'](_0x329eaa[_0x35abc7(0xb7)]);if(_0x167421)throw new Error(_0x35abc7(0x191)+'e\x20'+_0x2a9e17+_0x35abc7(0x1a0)+_0x329eaa['name']+_0x35abc7(0x185)+_0x167421['path']+'\x20and\x20'+_0x329eaa['path']);_0x27dd18[_0x35abc7(0x145)](_0x329eaa[_0x35abc7(0xb7)],_0x329eaa);}return[..._0x27dd18[_0x35abc7(0xbe)]()];}async function syncProductCapabilityDirs(_0x2bb91f,_0x5dadcb,_0x6824fb){const _0x4d2789=_0x5ae80f,_0xd86e2=await collectCapabilityEntries(_0x2bb91f,_0x6824fb);await rm(_0x5dadcb,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await mkdir(_0x5dadcb,{'recursive':!![]});for(const _0x3b0748 of _0xd86e2){await cp(_0x3b0748[_0x4d2789(0xa1)],join(_0x5dadcb,_0x3b0748['name']),{'recursive':!![]});}return _0xd86e2[_0x4d2789(0x171)];}export const __test__={'collectCapabilityEntries':collectCapabilityEntries,'syncProductCapabilityDirs':syncProductCapabilityDirs};async function syncProductAgents(_0x592068,_0x219511,_0x4bcb3f){const _0x38c9cf=_0x5ae80f,_0x4de18c=join(_0x219511,_0x38c9cf(0x1d4),_0x38c9cf(0x178)),_0xe20649=await syncProductCapabilityDirs(_0x592068[_0x38c9cf(0x1d4)]['resolved'+_0x38c9cf(0xda)+_0x38c9cf(0x226)],_0x4de18c,'agent');_0x4bcb3f[_0x38c9cf(0x178)]={'source':'product','installPath':toRuntimeRelative(_0x219511,_0x4de18c),'localPaths':_0x592068[_0x38c9cf(0x1d4)]['resolved'+'LocalAge'+_0x38c9cf(0x226)],'entryCount':_0xe20649};}async function syncProductSkills(_0x26fb26,_0x5d6ba9,_0x317f41){const _0x543522=_0x5ae80f,_0xc3ee49=join(_0x5d6ba9,_0x543522(0x1d4),_0x543522(0x215)),_0x522ada=await syncProductCapabilityDirs(_0x26fb26[_0x543522(0x1d4)][_0x543522(0x79)+_0x543522(0x10e)+'llPaths'],_0xc3ee49,_0x543522(0xfa));_0x317f41['skills']={'source':_0x543522(0x1df),'installPath':toRuntimeRelative(_0x5d6ba9,_0xc3ee49),'localPaths':_0x26fb26['openclaw'][_0x543522(0x79)+_0x543522(0x10e)+_0x543522(0xf7)],'entryCount':_0x522ada};}
|
|
1
|
+
const _0x209e23=_0x147a;(function(_0x1521cb,_0xc7f434){const _0x53e287=_0x147a,_0x7c0bf2=_0x1521cb();while(!![]){try{const _0x203394=parseInt(_0x53e287(0x240))/0x1*(-parseInt(_0x53e287(0x18f))/0x2)+parseInt(_0x53e287(0x27b))/0x3*(-parseInt(_0x53e287(0x376))/0x4)+-parseInt(_0x53e287(0x29f))/0x5+parseInt(_0x53e287(0x1a9))/0x6+parseInt(_0x53e287(0x201))/0x7*(-parseInt(_0x53e287(0x33c))/0x8)+parseInt(_0x53e287(0x191))/0x9*(parseInt(_0x53e287(0x384))/0xa)+parseInt(_0x53e287(0x262))/0xb;if(_0x203394===_0xc7f434)break;else _0x7c0bf2['push'](_0x7c0bf2['shift']());}catch(_0x2e54b8){_0x7c0bf2['push'](_0x7c0bf2['shift']());}}}(_0x2e91,0x3b58e));import{existsSync}from'node:fs';import{createWriteStream}from'node:fs';import{chmod,cp,mkdir,readFile,readdir,rename,rm,stat,symlink,writeFile}from'node:fs/promises';import{basename,delimiter,dirname,join,relative,resolve}from'node:path';import{fileURLToPath,pathToFileURL}from'node:url';import{spawn}from'node:child_process';function _0x147a(_0x4ed1db,_0x2a936e){_0x4ed1db=_0x4ed1db-0x18e;const _0x2e91eb=_0x2e91();let _0x147ad1=_0x2e91eb[_0x4ed1db];return _0x147ad1;}import{get}from'node:https';import{pipeline}from'node:stream/promises';import{getConfigPaths}from'@wujie-shell/config';import{copyDirFresh,getPackageMetadata,readJson,readPluginManifest,toRuntimeRelative,writeJson}from'../common/utils.mjs';import{createRuntimeLogger,summarizeRuntimeManifest,summarizeShellConfig}from'../common/runtime-logger.mjs';import{hasConfiguredKdocsSkill,installKdocsCliBinary}from'../connectors/kdocs-cli.mjs';import{patchMixedToolContentFromSource}from'./patch-chat-history-mixed-tool-content.mjs';import{patchChannelPluginRuntimeFromSource}from'./patch-channel-plugin-runtime.mjs';import{patchSessionStoreLoadFromSource,patchSessionStoreWriteFromSource}from'./patch-session-store-sqlite.mjs';const RUNTIME_DIR=_0x209e23(0x249)+'time',MANIFEST_NAME=_0x209e23(0x266)+_0x209e23(0x2ad)+_0x209e23(0x360),NPM_INSTALL_TIMEOUT_MS=0xf*0x3c*0x3e8;export function resolveRuntimeRoot(_0x4a3b2a){if(process.env.WUJIE_SHELL_RUNTIME_ROOT)return resolve(process.env.WUJIE_SHELL_RUNTIME_ROOT);return resolve(_0x4a3b2a,RUNTIME_DIR);}export function resolveManifestPath(_0x5e8ec4){return join(_0x5e8ec4,MANIFEST_NAME);}async function loadProductRuntime(_0x4ad757,_0xe92108){const _0x7f117f=_0x209e23,_0x156f82=[join(_0x4ad757,'shell-ru'+_0x7f117f(0x2f6),_0x7f117f(0x1dc)+'s'),join(_0xe92108,_0x7f117f(0x1a4)+_0x7f117f(0x2f6),_0x7f117f(0x1dc)+'s')];for(const _0x17afbb of _0x156f82){if(!existsSync(_0x17afbb))continue;return await import(pathToFileURL(_0x17afbb)[_0x7f117f(0x19c)]+_0x7f117f(0x311)+Date[_0x7f117f(0x217)]());}return{};}export async function prepareRuntime(_0x3061ca,{syncOnly:syncOnly=![]}={}){const _0x1be8e9=_0x209e23,_0x5c2c50=resolveRuntimeRoot(_0x3061ca[_0x1be8e9(0x38c)+_0x1be8e9(0x23d)]),_0x245639=createRuntimeLogger(getConfigPaths(_0x3061ca),'runtime'),_0x2c6c5e=Date[_0x1be8e9(0x217)]();_0x245639?.[_0x1be8e9(0x21d)](_0x1be8e9(0x28d)+_0x1be8e9(0x23e)+_0x1be8e9(0x250),{'syncOnly':syncOnly,'runtimeRoot':_0x5c2c50,'shellConfig':summarizeShellConfig(_0x3061ca)});try{const _0x1f41e8=await ensureRuntimeBase(_0x3061ca,_0x5c2c50,{'runtimeLogger':_0x245639,'syncOnly':syncOnly});_0x245639?.['info'](_0x1be8e9(0x23e)+_0x1be8e9(0x2ad)+_0x1be8e9(0x37d),{'manifestPath':resolveManifestPath(_0x5c2c50),'manifest':summarizeRuntimeManifest(_0x1f41e8)}),validateRuntimeNodeVersion(_0x1f41e8,_0x3061ca),_0x245639?.['info'](_0x1be8e9(0x23e)+_0x1be8e9(0x1fe)+_0x1be8e9(0x199)+_0x1be8e9(0x22e),{'nodeVersion':_0x1f41e8[_0x1be8e9(0x2c3)+_0x1be8e9(0x202)]});if(syncOnly)validateRuntimeOpenClawVersion(_0x1f41e8,_0x3061ca),_0x245639?.[_0x1be8e9(0x21d)]('runtime\x20'+_0x1be8e9(0x278)+_0x1be8e9(0x1c9)+'\x20validat'+'ed',{'openclawVersion':_0x1f41e8[_0x1be8e9(0x278)+_0x1be8e9(0x32a)]});else{if(_0x1f41e8[_0x1be8e9(0x278)+_0x1be8e9(0x32a)]!==_0x3061ca['openclaw']['openclaw'+'Version']){const _0x35c06a=await loadRuntimeInfo(_0x3061ca[_0x1be8e9(0x38c)+_0x1be8e9(0x23d)]);_0x245639?.[_0x1be8e9(0x21d)](_0x1be8e9(0x278)+_0x1be8e9(0x26a)+'\x20install'+_0x1be8e9(0x1bb),{'fromVersion':_0x1f41e8[_0x1be8e9(0x278)+_0x1be8e9(0x32a)]||_0x1be8e9(0x281),'toVersion':_0x3061ca[_0x1be8e9(0x278)][_0x1be8e9(0x278)+_0x1be8e9(0x32a)]}),await installOpenClawPackage(_0x35c06a,_0x3061ca[_0x1be8e9(0x278)][_0x1be8e9(0x278)+_0x1be8e9(0x32a)]),_0x1f41e8[_0x1be8e9(0x278)+_0x1be8e9(0x32a)]=_0x3061ca['openclaw'][_0x1be8e9(0x278)+_0x1be8e9(0x32a)],_0x245639?.[_0x1be8e9(0x21d)](_0x1be8e9(0x278)+'\x20package'+_0x1be8e9(0x212)+_0x1be8e9(0x23f)+'ed',{'openclawVersion':_0x1f41e8[_0x1be8e9(0x278)+_0x1be8e9(0x32a)]});}}_0x1f41e8['generate'+_0x1be8e9(0x21b)]=new Date()['toISOStr'+_0x1be8e9(0x2dd)](),_0x1f41e8[_0x1be8e9(0x2c3)+_0x1be8e9(0x202)]=_0x3061ca[_0x1be8e9(0x278)][_0x1be8e9(0x2c3)+'ion'],_0x1f41e8[_0x1be8e9(0x1b9)]={'appId':_0x3061ca[_0x1be8e9(0x300)],'productName':_0x3061ca[_0x1be8e9(0x1dd)+_0x1be8e9(0x34e)],'dataDirName':_0x3061ca[_0x1be8e9(0x26d)+_0x1be8e9(0x34e)]},await patchChatHistoryMixedToolContentBug(_0x5c2c50,_0x1f41e8,{'runtimeLogger':_0x245639}),await patchChannelPluginRuntimeBug(_0x5c2c50,_0x1f41e8,{'runtimeLogger':_0x245639});const _0x434a9c=await loadProductRuntime(_0x3061ca['projectR'+_0x1be8e9(0x23d)],_0x5c2c50);if(typeof _0x434a9c['prepareP'+'roductRu'+'ntime']==='function'){const _0x5229aa=createRuntimeInfoFromManifest(_0x5c2c50,_0x1f41e8);await _0x434a9c[_0x1be8e9(0x286)+_0x1be8e9(0x38a)+_0x1be8e9(0x2f6)]({'shellConfig':_0x3061ca,'runtime':_0x5229aa,'runtimeLogger':_0x245639,'syncOnly':syncOnly}),_0x245639?.[_0x1be8e9(0x21d)](_0x1be8e9(0x369)+_0x1be8e9(0x23e)+_0x1be8e9(0x2bc)+_0x1be8e9(0x252));}await patchSessionStoreSqliteRuntime(_0x5c2c50,_0x1f41e8,{'runtimeLogger':_0x245639});!syncOnly&&(await hasConfiguredKdocsSkill(_0x3061ca)?(await installKdocsCliBinary(_0x3061ca,createRuntimeInfoFromManifest(_0x5c2c50,_0x1f41e8),{'runtimeLogger':_0x245639,'syncOnly':syncOnly}),_0x245639?.[_0x1be8e9(0x21d)]('connecto'+_0x1be8e9(0x1e9)+_0x1be8e9(0x29a)+_0x1be8e9(0x346))):_0x245639?.['info']('connecto'+'r\x20runtim'+'e\x20tools\x20'+_0x1be8e9(0x23c)+_0x1be8e9(0x38f)+_0x1be8e9(0x38d)+_0x1be8e9(0x1f7)+_0x1be8e9(0x1cc)));const _0x1f9f70=Array[_0x1be8e9(0x2e0)](_0x1f41e8[_0x1be8e9(0x1c4)])?_0x1f41e8[_0x1be8e9(0x1c4)][_0x1be8e9(0x370)]:0x0;return await syncManifestPluginScope(_0x3061ca,_0x5c2c50,_0x1f41e8),_0x245639?.[_0x1be8e9(0x21d)](_0x1be8e9(0x23e)+_0x1be8e9(0x1ba)+_0x1be8e9(0x18e)+_0x1be8e9(0x2c2),{'beforePluginCount':_0x1f9f70,'afterPluginCount':Array[_0x1be8e9(0x2e0)](_0x1f41e8[_0x1be8e9(0x1c4)])?_0x1f41e8[_0x1be8e9(0x1c4)][_0x1be8e9(0x370)]:0x0,'pluginSpecCount':Array[_0x1be8e9(0x2e0)](_0x1f41e8[_0x1be8e9(0x1ad)+_0x1be8e9(0x23a)])?_0x1f41e8[_0x1be8e9(0x1ad)+'ecs'][_0x1be8e9(0x370)]:0x0}),await syncConfiguredNpmPlugins(_0x3061ca,_0x5c2c50,_0x1f41e8,{'runtimeLogger':_0x245639,'syncOnly':syncOnly}),_0x245639?.[_0x1be8e9(0x21d)](_0x1be8e9(0x206)+'ed\x20npm\x20p'+_0x1be8e9(0x237)+_0x1be8e9(0x1b6),{'pluginSpecCount':_0x3061ca[_0x1be8e9(0x278)][_0x1be8e9(0x1ad)+_0x1be8e9(0x23a)][_0x1be8e9(0x370)],'pluginCount':Array[_0x1be8e9(0x2e0)](_0x1f41e8[_0x1be8e9(0x1c4)])?_0x1f41e8['plugins'][_0x1be8e9(0x370)]:0x0}),await syncProductPlugins(_0x3061ca,_0x5c2c50,_0x1f41e8,{'runtimeLogger':_0x245639}),_0x245639?.[_0x1be8e9(0x21d)](_0x1be8e9(0x369)+_0x1be8e9(0x282)+_0x1be8e9(0x346),{'localPluginCount':_0x3061ca[_0x1be8e9(0x278)]['resolved'+'LocalPlu'+_0x1be8e9(0x1af)]['length'],'pluginCount':Array[_0x1be8e9(0x2e0)](_0x1f41e8[_0x1be8e9(0x1c4)])?_0x1f41e8[_0x1be8e9(0x1c4)]['length']:0x0}),await syncProductAgents(_0x3061ca,_0x5c2c50,_0x1f41e8),_0x245639?.[_0x1be8e9(0x21d)](_0x1be8e9(0x369)+_0x1be8e9(0x305)+_0x1be8e9(0x1b6),{'sources':_0x3061ca[_0x1be8e9(0x278)][_0x1be8e9(0x1db)+'LocalAge'+'ntPaths'],'entryCount':_0x1f41e8['agents']?.[_0x1be8e9(0x260)+'nt'],'installPath':_0x1f41e8[_0x1be8e9(0x30a)]?.[_0x1be8e9(0x20b)+_0x1be8e9(0x22c)]}),await syncProductSkills(_0x3061ca,_0x5c2c50,_0x1f41e8),_0x245639?.[_0x1be8e9(0x21d)](_0x1be8e9(0x369)+_0x1be8e9(0x25e)+'ynced',{'sources':_0x3061ca[_0x1be8e9(0x278)]['resolved'+_0x1be8e9(0x38e)+_0x1be8e9(0x255)],'entryCount':_0x1f41e8[_0x1be8e9(0x2f0)]?.[_0x1be8e9(0x260)+'nt'],'installPath':_0x1f41e8[_0x1be8e9(0x2f0)]?.['installP'+_0x1be8e9(0x22c)]}),await syncRuntimeWrapper(_0x3061ca,_0x5c2c50,_0x1f41e8),_0x245639?.[_0x1be8e9(0x21d)]('runtime\x20'+'wrapper\x20'+_0x1be8e9(0x346),{'wujieclawBin':_0x1f41e8['wujiecla'+_0x1be8e9(0x20d)]}),await writeJson(resolveManifestPath(_0x5c2c50),_0x1f41e8),_0x245639?.[_0x1be8e9(0x21d)](_0x1be8e9(0x23e)+_0x1be8e9(0x2ad)+'\x20written',{'manifestPath':resolveManifestPath(_0x5c2c50),'manifest':summarizeRuntimeManifest(_0x1f41e8),'durationMs':Date[_0x1be8e9(0x217)]()-_0x2c6c5e}),await _0x245639?.[_0x1be8e9(0x2bb)](),_0x1f41e8;}catch(_0x14c43a){_0x245639?.['error'](_0x1be8e9(0x28d)+_0x1be8e9(0x23e)+'failed',{'syncOnly':syncOnly,'runtimeRoot':_0x5c2c50,'durationMs':Date['now']()-_0x2c6c5e,'error':_0x14c43a}),await _0x245639?.['flush']();throw _0x14c43a;}}async function syncRuntimeWrapper(_0x430226,_0x3b9805,_0xb43d9f){const _0x340501=_0x209e23,_0x411e7b=_0x430226[_0x340501(0x278)]?.[_0x340501(0x316)+'leName']??_0x340501(0x1d3)+_0x340501(0x333),_0x34c39c=join(_0x3b9805,_0x340501(0x388),_0x340501(0x2dc)+'w'),_0x1997da=join(_0x3b9805,_0x340501(0x388),_0x340501(0x2dc)+'w.cmd'),_0x102a91=normalizeRuntimeRelativePath(relative(dirname(_0x34c39c),resolve(_0x3b9805,_0xb43d9f[_0x340501(0x2c7)+_0x340501(0x1ab)]))),_0x2b5c6c=normalizeRuntimeRelativePath(relative(dirname(_0x34c39c),resolve(_0x3b9805,_0xb43d9f[_0x340501(0x278)+'Bin']))),_0x25ae8d=_0x340501(0x2d6)+_0x430226[_0x340501(0x26d)+_0x340501(0x34e)],_0xea5cac=_0x340501(0x2a9)+_0x340501(0x1de)+_0x430226['dataDirN'+_0x340501(0x34e)];await mkdir(dirname(_0x34c39c),{'recursive':!![]});const _0x6bf622=fileURLToPath(new URL(_0x340501(0x299)+_0x340501(0x30c)+_0x340501(0x2e4)+_0x340501(0x303),import.meta.url)),_0x49ef69=join(_0x3b9805,_0x340501(0x388),_0x340501(0x2f3)+'go.mjs');await cp(_0x6bf622,_0x49ef69),await writeFile(_0x34c39c,[_0x340501(0x2ee)+'h','export\x20O'+_0x340501(0x276)+_0x340501(0x205)+_0x340501(0x2a6)+'_HOME:-'+_0x25ae8d+'}\x22','export\x20O'+'PENCLAW_'+_0x340501(0x232)+_0x340501(0x37f)+_0x340501(0x213)+_0x340501(0x359)+'-'+_0x25ae8d+'}\x22','export\x20O'+_0x340501(0x276)+'CONFIG_F'+_0x340501(0x2aa)+_0x340501(0x292)+'CLAW_CON'+_0x340501(0x383)+_0x340501(0x1b5)+_0x411e7b+'}\x22','export\x20O'+_0x340501(0x276)+_0x340501(0x33d)+_0x340501(0x371)+_0x340501(0x276)+_0x340501(0x33d)+_0x340501(0x343)+_0x25ae8d+'/'+_0x411e7b+'}\x22',_0x340501(0x328)+_0x340501(0x2ed)+_0x340501(0x1d4)+'--\x20\x22$(di'+_0x340501(0x2cc)+'\x20\x22$0\x22)\x22\x20'+'&&\x20pwd)','if\x20[\x20-t\x20'+'1\x20]\x20&&\x20['+_0x340501(0x2cb)+_0x340501(0x259)+_0x340501(0x326)+_0x340501(0x29d),_0x340501(0x37b)+_0x340501(0x22b)+_0x102a91+(_0x340501(0x211)+_0x340501(0x27f)+'ujie-log'+_0x340501(0x231)+_0x340501(0x2b7)+_0x340501(0x2d0)+'ue'),'fi',_0x340501(0x1ee)+_0x340501(0x367)+'R/'+_0x102a91+(_0x340501(0x211)+_0x340501(0x22b))+_0x2b5c6c+_0x340501(0x2f7),''][_0x340501(0x2fa)]('\x0a'),'utf8'),await chmod(_0x34c39c,0x1ed),await writeFile(_0x1997da,['@echo\x20of'+'f',_0x340501(0x20f)+'NCLAW_HO'+_0x340501(0x1eb)+'\x20set\x20\x22OP'+_0x340501(0x234)+_0x340501(0x258)+_0xea5cac+'\x22',_0x340501(0x20f)+_0x340501(0x213)+_0x340501(0x347)+_0x340501(0x389)+_0x340501(0x2be)+'LAW_STAT'+_0x340501(0x1fd)+_0xea5cac+'\x22',_0x340501(0x20f)+_0x340501(0x20a)+_0x340501(0x331)+_0x340501(0x2ca)+'==\x22\x22\x20set'+'\x20\x22OPENCL'+_0x340501(0x28b)+_0x340501(0x264)+_0x340501(0x363)+_0x411e7b+'\x22',_0x340501(0x20f)+_0x340501(0x20a)+_0x340501(0x2f8)+_0x340501(0x26c)+_0x340501(0x348)+_0x340501(0x20a)+_0x340501(0x2f8)+'H='+_0xea5cac+'\x5c'+_0x411e7b+'\x22',_0x340501(0x25d)+_0x340501(0x23b)+_0x340501(0x2ef),_0x340501(0x27e)+_0x340501(0x338)+toWindowsPath(_0x102a91)+(_0x340501(0x334)+_0x340501(0x228))+toWindowsPath(_0x2b5c6c)+_0x340501(0x2e5),'']['join']('\x0d\x0a'),'utf8'),_0xb43d9f[_0x340501(0x2dc)+_0x340501(0x20d)]=toRuntimeRelative(_0x3b9805,process[_0x340501(0x345)]==='win32'?_0x1997da:_0x34c39c);}async function patchChatHistoryMixedToolContentBug(_0x2cb256,_0x43419f,_0x3684c2={}){const _0x1a5f85=_0x209e23,_0x55b180=resolve(_0x2cb256,_0x43419f[_0x1a5f85(0x278)+_0x1a5f85(0x261)+'ir']),_0x3f6972=join(_0x55b180,'dist');let _0x557673=[];try{_0x557673=await readdir(_0x3f6972,{'withFileTypes':!![]});}catch{_0x3684c2['runtimeL'+_0x1a5f85(0x2b5)]?.[_0x1a5f85(0x1ca)]?.(_0x1a5f85(0x243)+_0x1a5f85(0x273)+'ed-tool\x20'+'patch\x20sk'+_0x1a5f85(0x321)+'ist\x20not\x20'+'found',{'distDir':_0x3f6972,'openclawVersion':_0x43419f[_0x1a5f85(0x278)+_0x1a5f85(0x32a)]});return;}const _0x374ef1=_0x557673[_0x1a5f85(0x246)](_0x4ca04c=>_0x4ca04c[_0x1a5f85(0x1e6)]()&&_0x4ca04c[_0x1a5f85(0x36a)][_0x1a5f85(0x314)+'th'](_0x1a5f85(0x1ec)+_0x1a5f85(0x22f)+_0x1a5f85(0x193))&&_0x4ca04c[_0x1a5f85(0x36a)][_0x1a5f85(0x227)]('.js'))['map'](_0x39cac2=>join(_0x3f6972,_0x39cac2[_0x1a5f85(0x36a)]));if(_0x374ef1[_0x1a5f85(0x370)]===0x0){_0x3684c2[_0x1a5f85(0x1fb)+'ogger']?.[_0x1a5f85(0x1ca)]?.(_0x1a5f85(0x243)+_0x1a5f85(0x273)+'ed-tool\x20'+_0x1a5f85(0x215)+_0x1a5f85(0x2a7)+_0x1a5f85(0x2a8)+_0x1a5f85(0x1d7),{'openclawVersion':_0x43419f[_0x1a5f85(0x278)+_0x1a5f85(0x32a)]});return;}for(const _0x56b6d6 of _0x374ef1){const _0x22c713=await readFile(_0x56b6d6,_0x1a5f85(0x19b)),_0x4a6248=patchMixedToolContentFromSource(_0x22c713);if(!_0x4a6248[_0x1a5f85(0x36b)]){if(_0x4a6248[_0x1a5f85(0x2a1)]==='already-'+_0x1a5f85(0x36b)){_0x3684c2['runtimeL'+_0x1a5f85(0x2b5)]?.[_0x1a5f85(0x21d)]?.(_0x1a5f85(0x243)+_0x1a5f85(0x273)+_0x1a5f85(0x34d)+_0x1a5f85(0x1df)+_0x1a5f85(0x1ea)+_0x1a5f85(0x344),{'openclawVersion':_0x43419f[_0x1a5f85(0x278)+_0x1a5f85(0x32a)],'filePath':_0x56b6d6});return;}continue;}await writeFile(_0x56b6d6,_0x4a6248[_0x1a5f85(0x1e2)],'utf8'),_0x3684c2[_0x1a5f85(0x1fb)+_0x1a5f85(0x2b5)]?.[_0x1a5f85(0x21d)]?.(_0x1a5f85(0x243)+_0x1a5f85(0x273)+_0x1a5f85(0x34d)+_0x1a5f85(0x31b)+_0x1a5f85(0x344),{'openclawVersion':_0x43419f[_0x1a5f85(0x278)+_0x1a5f85(0x32a)],'filePath':_0x56b6d6,'note':_0x1a5f85(0x257)+'y\x20compat'+_0x1a5f85(0x19e)+_0x1a5f85(0x245)+_0x1a5f85(0x2d4)+_0x1a5f85(0x336)+_0x1a5f85(0x226)+_0x1a5f85(0x2de)+_0x1a5f85(0x31e)+'jection\x20'+_0x1a5f85(0x1b2)+'ify\x20upst'+'ream\x20fix'+_0x1a5f85(0x1bd)+_0x1a5f85(0x20e)+_0x1a5f85(0x209)});return;}_0x3684c2[_0x1a5f85(0x1fb)+'ogger']?.[_0x1a5f85(0x1ca)]?.(_0x1a5f85(0x243)+_0x1a5f85(0x273)+_0x1a5f85(0x34d)+'patch\x20sk'+_0x1a5f85(0x2a7)+_0x1a5f85(0x200)+'not\x20foun'+'d',{'openclawVersion':_0x43419f['openclaw'+'Version']});}async function patchChannelPluginRuntimeBug(_0x5c9a2b,_0x2e64a8,_0x13efe6={}){const _0xb8d696=_0x209e23,_0x493875=resolve(_0x5c9a2b,_0x2e64a8[_0xb8d696(0x278)+_0xb8d696(0x261)+'ir']),_0x53394b=join(_0x493875,_0xb8d696(0x306));let _0x320605=[];try{_0x320605=await readdir(_0x53394b,{'withFileTypes':!![]});}catch{_0x13efe6[_0xb8d696(0x1fb)+_0xb8d696(0x2b5)]?.[_0xb8d696(0x1ca)]?.(_0xb8d696(0x1d0)+_0xb8d696(0x297)+_0xb8d696(0x35d)+_0xb8d696(0x20c)+_0xb8d696(0x2d8)+_0xb8d696(0x374)+_0xb8d696(0x1a1),{'distDir':_0x53394b,'openclawVersion':_0x2e64a8['openclaw'+'Version']});return;}const _0x39808c=_0x320605[_0xb8d696(0x246)](_0x352cc2=>_0x352cc2[_0xb8d696(0x1e6)]()&&_0x352cc2['name'][_0xb8d696(0x314)+'th'](_0xb8d696(0x241))&&_0x352cc2['name']['endsWith'](_0xb8d696(0x322)))[_0xb8d696(0x224)](_0x112e26=>join(_0x53394b,_0x112e26['name'])),_0x41cf5e=await resolveRuntimeChannelImportPath(_0x53394b,_0x320605);if(_0x39808c[_0xb8d696(0x370)]===0x0){_0x13efe6[_0xb8d696(0x1fb)+_0xb8d696(0x2b5)]?.[_0xb8d696(0x1ca)]?.(_0xb8d696(0x1d0)+_0xb8d696(0x297)+_0xb8d696(0x35d)+_0xb8d696(0x20c)+'pped;\x20lo'+_0xb8d696(0x2c1)+_0xb8d696(0x285),{'openclawVersion':_0x2e64a8[_0xb8d696(0x278)+_0xb8d696(0x32a)]});return;}if(!_0x41cf5e){_0x13efe6[_0xb8d696(0x1fb)+_0xb8d696(0x2b5)]?.[_0xb8d696(0x1ca)]?.(_0xb8d696(0x1d0)+_0xb8d696(0x297)+_0xb8d696(0x35d)+'atch\x20ski'+'pped;\x20ru'+_0xb8d696(0x36e)+_0xb8d696(0x2eb)+_0xb8d696(0x1b1)+_0xb8d696(0x1d7),{'openclawVersion':_0x2e64a8['openclaw'+_0xb8d696(0x32a)],'distDir':_0x53394b});return;}for(const _0x2de4a0 of _0x39808c){const _0x377342=await readFile(_0x2de4a0,_0xb8d696(0x19b)),_0x2f1ed5=patchChannelPluginRuntimeFromSource(_0x377342,{'runtimeChannelImportPath':_0x41cf5e});if(!_0x2f1ed5[_0xb8d696(0x36b)]){if(_0x2f1ed5[_0xb8d696(0x2a1)]==='already-'+_0xb8d696(0x36b)){_0x13efe6['runtimeL'+_0xb8d696(0x2b5)]?.['info']?.('channel\x20'+_0xb8d696(0x297)+_0xb8d696(0x35d)+'atch\x20alr'+_0xb8d696(0x263)+_0xb8d696(0x1e1),{'openclawVersion':_0x2e64a8[_0xb8d696(0x278)+_0xb8d696(0x32a)],'filePath':_0x2de4a0});return;}continue;}await writeFile(_0x2de4a0,_0x2f1ed5[_0xb8d696(0x1e2)],_0xb8d696(0x19b)),_0x13efe6[_0xb8d696(0x1fb)+'ogger']?.[_0xb8d696(0x21d)]?.(_0xb8d696(0x1d0)+'plugin\x20r'+'untime\x20p'+_0xb8d696(0x387)+_0xb8d696(0x1e1),{'openclawVersion':_0x2e64a8[_0xb8d696(0x278)+_0xb8d696(0x32a)],'filePath':_0x2de4a0,'note':_0xb8d696(0x257)+_0xb8d696(0x31d)+_0xb8d696(0x19e)+_0xb8d696(0x245)+_0xb8d696(0x2d4)+_0xb8d696(0x336)+'6.6\x20chan'+_0xb8d696(0x362)+'in\x20runti'+'me\x20missi'+'ng\x20chann'+_0xb8d696(0x1b3)+_0xb8d696(0x277)+_0xb8d696(0x340)+'fy\x20upstr'+_0xb8d696(0x2df)+'on\x20futur'+_0xb8d696(0x32b)+_0xb8d696(0x229)});return;}_0x13efe6['runtimeL'+_0xb8d696(0x2b5)]?.[_0xb8d696(0x1ca)]?.('channel\x20'+_0xb8d696(0x297)+_0xb8d696(0x35d)+'atch\x20ski'+'pped;\x20ru'+_0xb8d696(0x364)+'solver\x20n'+_0xb8d696(0x24f),{'openclawVersion':_0x2e64a8[_0xb8d696(0x278)+_0xb8d696(0x32a)]});}async function patchSessionStoreSqliteRuntime(_0x1678b5,_0x2ca10c,_0x38c6a5={}){const _0x240a97=_0x209e23,_0x1512a4=resolve(_0x1678b5,_0x2ca10c['openclaw'+_0x240a97(0x261)+'ir']),_0x43a785=join(_0x1512a4,'dist'),_0x296b69='../../sh'+_0x240a97(0x2ac)+'ime/sess'+_0x240a97(0x2e1)+_0x240a97(0x1fc)+_0x240a97(0x204),_0xb099a9=join(_0x1678b5,_0x240a97(0x1a4)+_0x240a97(0x2f6),_0x240a97(0x349),_0x240a97(0x266)+_0x240a97(0x288)+'js'),_0x9f346=(await readdir(_0x43a785,{'withFileTypes':!![]})['catch'](()=>[]))[_0x240a97(0x246)](_0x4cb8fd=>_0x4cb8fd[_0x240a97(0x1e6)]()&&_0x4cb8fd['name']['startsWi'+'th']('store-lo'+_0x240a97(0x1f4))&&_0x4cb8fd[_0x240a97(0x36a)]['endsWith'](_0x240a97(0x322)))[_0x240a97(0x224)](_0x3b2bf6=>join(_0x43a785,_0x3b2bf6[_0x240a97(0x36a)])),_0x665d22=(await readdir(_0x43a785,{'withFileTypes':!![]})[_0x240a97(0x30f)](()=>[]))[_0x240a97(0x246)](_0x12a01c=>_0x12a01c['isFile']()&&_0x12a01c[_0x240a97(0x36a)][_0x240a97(0x314)+'th'](_0x240a97(0x25a))&&!_0x12a01c['name'][_0x240a97(0x314)+'th'](_0x240a97(0x267)+_0x240a97(0x1f4))&&_0x12a01c['name']['endsWith'](_0x240a97(0x322)))['map'](_0x56c414=>join(_0x43a785,_0x56c414[_0x240a97(0x36a)]));if(!existsSync(_0xb099a9)){_0x38c6a5[_0x240a97(0x1fb)+'ogger']?.['info']?.(_0x240a97(0x1e3)+_0x240a97(0x216)+'lite\x20pat'+'ch\x20skipp'+_0x240a97(0x1cd)+'ge\x20not\x20a'+_0x240a97(0x2c9),{'bridgePath':_0xb099a9,'openclawVersion':_0x2ca10c[_0x240a97(0x278)+_0x240a97(0x32a)]});return;}for(const _0x31100b of _0x9f346){const _0x2b7538=await readFile(_0x31100b,_0x240a97(0x19b)),_0xc222ac=patchSessionStoreLoadFromSource(_0x2b7538,{'bridgeImportPath':_0x296b69});if(!_0xc222ac['patched']){if(_0xc222ac[_0x240a97(0x2a1)]===_0x240a97(0x1f6)+_0x240a97(0x36b)){_0x38c6a5[_0x240a97(0x1fb)+_0x240a97(0x2b5)]?.[_0x240a97(0x21d)]?.(_0x240a97(0x1e3)+_0x240a97(0x225)+_0x240a97(0x19a)+'\x20already'+_0x240a97(0x323),{'filePath':_0x31100b,'openclawVersion':_0x2ca10c[_0x240a97(0x278)+_0x240a97(0x32a)]});break;}continue;}await writeFile(_0x31100b,_0xc222ac[_0x240a97(0x1e2)],_0x240a97(0x19b)),_0x38c6a5[_0x240a97(0x1fb)+_0x240a97(0x2b5)]?.[_0x240a97(0x21d)]?.(_0x240a97(0x1e3)+_0x240a97(0x225)+_0x240a97(0x19a)+_0x240a97(0x323),{'filePath':_0x31100b,'openclawVersion':_0x2ca10c['openclaw'+'Version']});break;}for(const _0x352b75 of _0x665d22){const _0x39343e=await readFile(_0x352b75,_0x240a97(0x19b)),_0x3cd558=patchSessionStoreWriteFromSource(_0x39343e,{'bridgeImportPath':_0x296b69});if(!_0x3cd558[_0x240a97(0x36b)]){if(_0x3cd558[_0x240a97(0x2a1)]===_0x240a97(0x1f6)+_0x240a97(0x36b)){_0x38c6a5[_0x240a97(0x1fb)+_0x240a97(0x2b5)]?.[_0x240a97(0x21d)]?.('session\x20'+_0x240a97(0x35f)+'ite\x20patc'+_0x240a97(0x272)+'y\x20applie'+'d',{'filePath':_0x352b75,'openclawVersion':_0x2ca10c[_0x240a97(0x278)+_0x240a97(0x32a)]});break;}continue;}await writeFile(_0x352b75,_0x3cd558[_0x240a97(0x1e2)],_0x240a97(0x19b)),_0x38c6a5[_0x240a97(0x1fb)+_0x240a97(0x2b5)]?.['info']?.(_0x240a97(0x1e3)+_0x240a97(0x35f)+_0x240a97(0x2ea)+_0x240a97(0x2d9)+'d',{'filePath':_0x352b75,'openclawVersion':_0x2ca10c[_0x240a97(0x278)+_0x240a97(0x32a)]});break;}}async function resolveRuntimeChannelImportPath(_0x1a24ee,_0xb477c4){const _0x466468=_0x209e23,_0x33cb71=_0xb477c4[_0x466468(0x246)](_0x3d60f8=>_0x3d60f8[_0x466468(0x1e6)]()&&_0x3d60f8[_0x466468(0x36a)][_0x466468(0x314)+'th'](_0x466468(0x266)+'channel-')&&_0x3d60f8['name'][_0x466468(0x227)](_0x466468(0x322))&&!_0x3d60f8[_0x466468(0x36a)][_0x466468(0x314)+'th'](_0x466468(0x266)+_0x466468(0x2f4)+_0x466468(0x320)))['map'](_0x4a103f=>_0x4a103f[_0x466468(0x36a)])[_0x466468(0x22a)]();for(const _0x24a66c of _0x33cb71){const _0x5dbcba=await readFile(join(_0x1a24ee,_0x24a66c),_0x466468(0x19b));if(_0x5dbcba[_0x466468(0x380)](_0x466468(0x354)+_0x466468(0x36d)+_0x466468(0x351)))return'./'+_0x24a66c;}return null;}function normalizeRuntimeRelativePath(_0x16b204){const _0x5c1274=_0x209e23;return _0x16b204[_0x5c1274(0x244)+'ll']('\x5c','/');}function toWindowsPath(_0x2f4724){return _0x2f4724['replaceA'+'ll']('/','\x5c');}function validateRuntimeNodeVersion(_0x5589b0,_0x4e3796){const _0x4d6599=_0x209e23;if(_0x5589b0['nodeVers'+'ion']===_0x4e3796['openclaw'][_0x4d6599(0x2c3)+_0x4d6599(0x202)])return;throw new Error(_0x4d6599(0x23e)+_0x4d6599(0x2c3)+_0x4d6599(0x2af)+_0x4d6599(0x1a3)+_0x4d6599(0x230)+(_0x5589b0[_0x4d6599(0x2c3)+_0x4d6599(0x202)]||'unknown')+(',\x20shell.'+'config=')+_0x4e3796['openclaw']['nodeVers'+'ion']+'.\x20'+(_0x4d6599(0x304)+_0x4d6599(0x37e)+_0x4d6599(0x1c5)+'\x22\x20so\x20the'+_0x4d6599(0x2e9)+_0x4d6599(0x33f)+_0x4d6599(0x293)+_0x4d6599(0x35c)+'with\x20the'+'\x20configu'+_0x4d6599(0x1ef)+_0x4d6599(0x1c9)+'.'));}function validateRuntimeOpenClawVersion(_0x1cb7ff,_0x3b03f8){const _0x5951ab=_0x209e23;if(_0x1cb7ff['openclaw'+_0x5951ab(0x32a)]===_0x3b03f8['openclaw'][_0x5951ab(0x278)+_0x5951ab(0x32a)])return;throw new Error(_0x5951ab(0x23e)+_0x5951ab(0x278)+_0x5951ab(0x317)+_0x5951ab(0x280)+':\x20manife'+_0x5951ab(0x1f8)+(_0x1cb7ff[_0x5951ab(0x278)+_0x5951ab(0x32a)]||_0x5951ab(0x281))+(_0x5951ab(0x1ed)+'config=')+_0x3b03f8[_0x5951ab(0x278)][_0x5951ab(0x278)+_0x5951ab(0x32a)]+'.\x20'+(_0x5951ab(0x304)+'ie-shell'+_0x5951ab(0x1c5)+_0x5951ab(0x253)+_0x5951ab(0x33f)+'\x20can\x20ins'+'tall\x20the'+_0x5951ab(0x1f7)+_0x5951ab(0x283)+'Claw\x20ver'+_0x5951ab(0x327)));}function parseNpmPackJson(_0x47b8bb){const _0x246c7c=_0x209e23,_0x1ba530=_0x47b8bb['trim'](),_0x38b225=_0x1ba530[_0x246c7c(0x2cd)]('[');if(_0x38b225<0x0)throw new Error(_0x246c7c(0x2f2)+_0x246c7c(0x32d)+'\x20return\x20'+_0x246c7c(0x2ce)+_0x1ba530[_0x246c7c(0x34a)](0x0,0x1f4));const _0x272de6=JSON[_0x246c7c(0x308)](_0x1ba530['slice'](_0x38b225)),_0x4e8d31=Array['isArray'](_0x272de6)?_0x272de6[0x0]:_0x272de6;if(!_0x4e8d31||typeof _0x4e8d31!==_0x246c7c(0x251))throw new Error(_0x246c7c(0x2f2)+_0x246c7c(0x275)+_0x246c7c(0x284)+_0x246c7c(0x287)+'load:\x20'+_0x1ba530[_0x246c7c(0x34a)](0x0,0x1f4));return _0x4e8d31;}function normalizePackedTarballFilename(_0x101e10){const _0x1bce18=_0x209e23;return _0x101e10[_0x1bce18(0x2bd)](/^@/,'')[_0x1bce18(0x244)+'ll']('/','-')[_0x1bce18(0x244)+'ll']('\x5c','-');}async function runProcess(_0x406acc,_0x276018,_0x1b76f2={}){const _0x2e34a6=_0x209e23,_0x4a70a3=_0x1b76f2[_0x2e34a6(0x307)]||[_0x406acc,..._0x276018]['join']('\x20'),_0x2cb6ab=_0x1b76f2['timeoutM'+'s']??NPM_INSTALL_TIMEOUT_MS,_0x38ecfb=spawn(_0x406acc,_0x276018,{'cwd':_0x1b76f2[_0x2e34a6(0x290)],'env':_0x1b76f2[_0x2e34a6(0x2e3)],'stdio':['ignore','pipe',_0x2e34a6(0x34f)]});return await new Promise((_0x3152f1,_0x332ecb)=>{const _0x345437=_0x2e34a6;let _0x632ded='',_0x21a4ae='',_0x3f2fe5=![];const _0x3416ff=setTimeout(()=>{const _0x55d7bd=_0x147a;if(_0x3f2fe5)return;_0x3f2fe5=!![],_0x38ecfb[_0x55d7bd(0x1d1)](_0x55d7bd(0x31c)),_0x332ecb(new Error(_0x4a70a3+(_0x55d7bd(0x1c1)+_0x55d7bd(0x295)+'\x20')+_0x2cb6ab+'ms'));},_0x2cb6ab);_0x38ecfb['stdout']['on']('data',_0xff987b=>{const _0x5715c7=_0x147a;_0x632ded+=_0xff987b[_0x5715c7(0x294)]();}),_0x38ecfb['stderr']['on'](_0x345437(0x324),_0x246b89=>{const _0x411e4d=_0x345437;_0x21a4ae+=_0x246b89[_0x411e4d(0x294)]();}),_0x38ecfb['on']('error',_0x1cf64e=>{if(_0x3f2fe5)return;_0x3f2fe5=!![],clearTimeout(_0x3416ff),_0x332ecb(_0x1cf64e);}),_0x38ecfb['on']('close',(_0x42b4b4,_0x58efa2)=>{const _0x13a0e0=_0x345437;if(_0x3f2fe5)return;_0x3f2fe5=!![],clearTimeout(_0x3416ff);if(_0x42b4b4===0x0){_0x3152f1({'stdout':_0x632ded,'stderr':_0x21a4ae});return;}_0x332ecb(new Error(_0x4a70a3+(_0x13a0e0(0x298)+'with\x20cod'+'e=')+(_0x42b4b4??_0x13a0e0(0x221))+_0x13a0e0(0x26f)+(_0x58efa2??_0x13a0e0(0x221))+'\x0a'+(''+(_0x21a4ae||_0x632ded))[_0x13a0e0(0x391)]()));});});}async function installOpenClawPackage(_0x4dffe0,_0x5daf95){const _0x502b5e=_0x209e23,_0x2e0d05=join(_0x4dffe0[_0x502b5e(0x27c)+_0x502b5e(0x23d)],'.cache'),_0x51ee73=join(_0x4dffe0[_0x502b5e(0x27c)+_0x502b5e(0x23d)],'.opencla'+_0x502b5e(0x1e7)+'t');await mkdir(_0x2e0d05,{'recursive':!![]}),await removePathWithRetries(_0x51ee73),await mkdir(_0x51ee73,{'recursive':!![]});const _0x446eb1=await createRuntimeEnv(_0x4dffe0),_0x5af502=_0x502b5e(0x278)+'@'+_0x5daf95;console[_0x502b5e(0x25c)](_0x502b5e(0x1fa)+_0x502b5e(0x271)+_0x502b5e(0x381)+'stalling'+'\x20'+_0x5af502);const _0x350633=await runProcess(_0x4dffe0[_0x502b5e(0x2c7)+'utable'],[_0x4dffe0[_0x502b5e(0x2fb)],'pack',_0x5af502,_0x502b5e(0x2ba)],{'cwd':_0x2e0d05,'env':_0x446eb1,'label':_0x502b5e(0x2f2)+'\x20'+_0x5af502}),_0x202146=parseNpmPackJson(_0x350633[_0x502b5e(0x352)]);if(_0x202146[_0x502b5e(0x2ec)]!==_0x5daf95)throw new Error(_0x502b5e(0x1b0)+_0x502b5e(0x24c)+_0x502b5e(0x274)+_0x5daf95+('\x20resolve'+_0x502b5e(0x337))+_0x202146[_0x502b5e(0x2ec)]);const _0x3ac6b3=resolve(_0x2e0d05,_0x202146[_0x502b5e(0x31f)]);if(!existsSync(_0x3ac6b3))throw new Error('npm\x20pack'+_0x502b5e(0x32d)+_0x502b5e(0x26b)+'tarball:'+'\x20'+_0x3ac6b3);await runProcess('tar',[_0x502b5e(0x385),_0x3ac6b3,'-C',_0x51ee73],{'label':_0x502b5e(0x28f)+_0x202146['filename']}),await removePathWithRetries(_0x4dffe0[_0x502b5e(0x278)+_0x502b5e(0x261)+'ir']),await rename(join(_0x51ee73,_0x502b5e(0x24b)),_0x4dffe0[_0x502b5e(0x278)+_0x502b5e(0x261)+'ir']),await removePathWithRetries(_0x51ee73),await runProcess(_0x4dffe0[_0x502b5e(0x2c7)+_0x502b5e(0x1ab)],[_0x4dffe0['npmCli'],_0x502b5e(0x1d2),_0x502b5e(0x1d6)+'ev','--omit=p'+_0x502b5e(0x382),_0x502b5e(0x24d)+'it',_0x502b5e(0x31a)+'d',_0x502b5e(0x238)+_0x502b5e(0x1a2)+'ps'],{'cwd':_0x4dffe0[_0x502b5e(0x278)+_0x502b5e(0x261)+'ir'],'env':_0x446eb1,'label':_0x502b5e(0x32f)+_0x502b5e(0x2d3)+_0x5af502+('\x20runtime'+_0x502b5e(0x207)+_0x502b5e(0x233))});if(!existsSync(_0x4dffe0[_0x502b5e(0x278)+_0x502b5e(0x358)]))throw new Error(_0x502b5e(0x33e)+_0x502b5e(0x2b1)+_0x502b5e(0x270)+_0x502b5e(0x19d)+_0x502b5e(0x212)+':\x20'+_0x4dffe0['openclaw'+_0x502b5e(0x358)]);}async function ensureRuntimeBase(_0x21f1ce,_0x3127ee,_0x270507={}){const _0x1a1fae=_0x209e23;await mkdir(_0x3127ee,{'recursive':!![]});let _0x1eb3b8=await readRuntimeManifest(_0x3127ee);const _0x8681f8=_0x21f1ce[_0x1a1fae(0x278)][_0x1a1fae(0x2c3)+_0x1a1fae(0x202)],_0x130521=_0x21f1ce[_0x1a1fae(0x278)][_0x1a1fae(0x278)+_0x1a1fae(0x32a)],_0x1b1f64=existsSync(resolveManifestPath(_0x3127ee)),_0x3f9cfa=runtimeHasRequiredPaths(_0x3127ee,_0x1eb3b8),_0x255b00=_0x1eb3b8[_0x1a1fae(0x2c3)+'ion']===_0x8681f8;!_0x1b1f64||!_0x3f9cfa||!_0x255b00?(_0x270507[_0x1a1fae(0x1fb)+_0x1a1fae(0x2b5)]?.['info'](_0x1a1fae(0x23e)+'base\x20bui'+'ld\x20start'+'ed',{'runtimeRoot':_0x3127ee,'reason':!_0x1b1f64?_0x1a1fae(0x219)+_0x1a1fae(0x2ad):!_0x3f9cfa?'missing\x20'+_0x1a1fae(0x1f9)+_0x1a1fae(0x33f)+_0x1a1fae(0x313):_0x1a1fae(0x1fe)+_0x1a1fae(0x2e7)+_0x1a1fae(0x32e),'syncOnly':_0x270507[_0x1a1fae(0x30e)]}),_0x1eb3b8=await buildRuntimeBase(_0x21f1ce,_0x3127ee,_0x1eb3b8),_0x270507[_0x1a1fae(0x1fb)+'ogger']?.[_0x1a1fae(0x21d)]('runtime\x20'+'base\x20bui'+_0x1a1fae(0x1a5)+_0x1a1fae(0x29b),{'manifest':summarizeRuntimeManifest(_0x1eb3b8)})):_0x270507[_0x1a1fae(0x1fb)+_0x1a1fae(0x2b5)]?.[_0x1a1fae(0x21d)]('runtime\x20'+_0x1a1fae(0x342)+'eady\x20cur'+_0x1a1fae(0x1ae),{'manifest':summarizeRuntimeManifest(_0x1eb3b8)});if(!existsSync(resolve(_0x3127ee,_0x1eb3b8[_0x1a1fae(0x278)+'Bin']))){const _0x2845ea=createRuntimeInfoFromManifest(_0x3127ee,_0x1eb3b8,{'allowMissingOpenClaw':!![]});await installOpenClawPackage(_0x2845ea,_0x130521),_0x1eb3b8[_0x1a1fae(0x278)+'Version']=_0x130521;}return _0x1eb3b8;}function runtimeHasRequiredPaths(_0x59b7d9,_0x25b4eb){const _0x3e36e3=_0x209e23;return['nodeExec'+_0x3e36e3(0x1ab),_0x3e36e3(0x2fb),_0x3e36e3(0x278)+_0x3e36e3(0x261)+'ir','openclaw'+'Bin'][_0x3e36e3(0x335)](_0x2dc71a=>typeof _0x25b4eb[_0x2dc71a]===_0x3e36e3(0x1b4)&&_0x25b4eb[_0x2dc71a][_0x3e36e3(0x391)]())&&['nodeExec'+_0x3e36e3(0x1ab),_0x3e36e3(0x2fb)][_0x3e36e3(0x335)](_0x21fd1d=>existsSync(resolve(_0x59b7d9,_0x25b4eb[_0x21fd1d])));}async function buildRuntimeBase(_0x23b880,_0x454a66,_0x446fb5={}){const _0xeedbe0=_0x209e23,_0x116b78=join(_0x454a66,'node');await ensureRuntimeNode(_0x23b880,_0x116b78);const _0x386b59={..._0x446fb5,'generatedAt':new Date()[_0xeedbe0(0x339)+_0xeedbe0(0x2dd)](),'nodeVersion':_0x23b880[_0xeedbe0(0x278)][_0xeedbe0(0x2c3)+_0xeedbe0(0x202)],'openclawVersion':_0x446fb5['openclaw'+'Version']||'','platform':process[_0xeedbe0(0x345)],'arch':process[_0xeedbe0(0x268)],'nodeExecutable':_0xeedbe0(0x1ff)+_0xeedbe0(0x372),'npmCli':'node/lib'+_0xeedbe0(0x195)+_0xeedbe0(0x1c6)+'m/bin/np'+_0xeedbe0(0x1d8),'openclawWorkingDir':_0xeedbe0(0x278),'openclawBin':'openclaw'+_0xeedbe0(0x2c0)+_0xeedbe0(0x37c)};return await writeJson(resolveManifestPath(_0x454a66),_0x386b59),_0x386b59;}async function removePathWithRetries(_0x49e7f2){await rm(_0x49e7f2,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96});}async function ensureRuntimeNode(_0x534d22,_0xe0a455){const _0x30540c=_0x209e23,_0x45cd65=_0x534d22[_0x30540c(0x278)][_0x30540c(0x2c3)+_0x30540c(0x202)],_0x5d11b4=join(_0xe0a455,_0x30540c(0x388),'node'),_0x2dfca6=join(_0xe0a455,_0x30540c(0x2f9),_0x30540c(0x1e5)+_0x30540c(0x37a),'npm',_0x30540c(0x388),'npm-cli.'+'js');if(existsSync(_0x5d11b4)&&existsSync(_0x2dfca6)&&await getNodeVersion(_0x5d11b4)===_0x45cd65)return;await removePathWithRetries(_0xe0a455);if(process[_0x30540c(0x197)]['node']===_0x45cd65){await linkCurrentNodeRuntime(_0xe0a455);return;}await downloadNodeRuntime(_0x45cd65,_0xe0a455);}async function getNodeVersion(_0xeacd47){const _0x195be9=_0x209e23;try{const _0x233991=await runProcess(_0xeacd47,['-p',_0x195be9(0x1e4)+'versions'+_0x195be9(0x1a7)],{'label':_0xeacd47+_0x195be9(0x1c9),'timeoutMs':0x7530});return _0x233991[_0x195be9(0x352)]['trim']();}catch{return'';}}async function linkCurrentNodeRuntime(_0x25bb64){const _0x1bcf40=_0x209e23,_0x19aabb=process['execPath'],_0x56a215=resolve(dirname(_0x19aabb),'..'),_0x3e70df=resolve(_0x56a215,_0x1bcf40(0x1a8)+'_modules'+_0x1bcf40(0x32c)),_0x331a4b=join(_0x25bb64,_0x1bcf40(0x388),_0x1bcf40(0x190)),_0x55c533=join(_0x25bb64,_0x1bcf40(0x2f9),_0x1bcf40(0x1e5)+_0x1bcf40(0x37a),_0x1bcf40(0x378));await mkdir(dirname(_0x331a4b),{'recursive':!![]}),await mkdir(dirname(_0x55c533),{'recursive':!![]}),await symlink(_0x19aabb,_0x331a4b),existsSync(_0x3e70df)?await symlink(_0x3e70df,_0x55c533):await symlink(await resolveNpmRoot(),_0x55c533);}async function resolveNpmRoot(){const _0x5718e6=_0x209e23,_0x10fb06=await runProcess('npm',[_0x5718e6(0x1f1),'-g'],{'label':_0x5718e6(0x1e0)+_0x5718e6(0x1c0),'timeoutMs':0x7530}),_0x3e717e=join(_0x10fb06[_0x5718e6(0x352)][_0x5718e6(0x391)](),_0x5718e6(0x378));if(!existsSync(join(_0x3e717e,_0x5718e6(0x388),_0x5718e6(0x329)+'js')))throw new Error(_0x5718e6(0x2f2)+'age\x20was\x20'+_0x5718e6(0x368)+'d\x20for\x20lo'+_0x5718e6(0x28a)+_0x5718e6(0x265)+'d:\x20'+_0x3e717e);return _0x3e717e;}async function downloadNodeRuntime(_0x12727b,_0x27c212){const _0x26236f=_0x209e23,_0x2a6695=process['platform']===_0x26236f(0x309)?_0x26236f(0x35e):process[_0x26236f(0x345)],_0x5076bd=process[_0x26236f(0x268)]==='x64'?'x64':process['arch']===_0x26236f(0x2d2)?'arm64':process[_0x26236f(0x268)],_0x38dd01=process[_0x26236f(0x345)]===_0x26236f(0x309)?_0x26236f(0x373):_0x26236f(0x2fd),_0x4c8679=_0x26236f(0x2d5)+_0x12727b+'-'+_0x2a6695+'-'+_0x5076bd,_0x390d9d=_0x4c8679+'.'+_0x38dd01,_0x3cf6f0=join(dirname(_0x27c212),_0x26236f(0x2c6)),_0x670c20=join(_0x3cf6f0,_0x390d9d),_0x323d5e=join(_0x3cf6f0,_0x4c8679+(_0x26236f(0x34b)+'-')+process[_0x26236f(0x1f5)]+'-'+Date[_0x26236f(0x217)]()),_0xa62242='https://'+'nodejs.o'+_0x26236f(0x35b)+'v'+_0x12727b+'/'+_0x390d9d;await mkdir(_0x3cf6f0,{'recursive':!![]}),!existsSync(_0x670c20)&&(console[_0x26236f(0x25c)]('[wujie-s'+_0x26236f(0x271)+_0x26236f(0x1bf)+_0x26236f(0x214)+'g\x20'+_0xa62242),await downloadFile(_0xa62242,_0x670c20)),await rm(_0x323d5e,{'recursive':!![],'force':!![]}),await mkdir(_0x323d5e,{'recursive':!![]}),process[_0x26236f(0x345)]===_0x26236f(0x309)?await runProcess(_0x26236f(0x2e8),['-q',_0x670c20,'-d',_0x323d5e],{'label':_0x26236f(0x28f)+_0x390d9d}):await runProcess('tar',[_0x26236f(0x1cb),_0x670c20,'-C',_0x323d5e],{'label':_0x26236f(0x28f)+_0x390d9d}),await rename(join(_0x323d5e,_0x4c8679),_0x27c212),await rm(_0x323d5e,{'recursive':!![],'force':!![]});}async function downloadFile(_0x4c1024,_0x521dc7){await mkdir(dirname(_0x521dc7),{'recursive':!![]});const _0x5794af=await new Promise((_0x20b1e0,_0x32ddad)=>{get(_0x4c1024,_0x45f8bf=>{const _0x361c7a=_0x147a;if(_0x45f8bf[_0x361c7a(0x2a0)+'de']>=0x12c&&_0x45f8bf[_0x361c7a(0x2a0)+'de']<0x190&&_0x45f8bf[_0x361c7a(0x2c4)][_0x361c7a(0x1f3)]){_0x45f8bf['resume'](),downloadFile(new URL(_0x45f8bf[_0x361c7a(0x2c4)][_0x361c7a(0x1f3)],_0x4c1024)[_0x361c7a(0x19c)],_0x521dc7)[_0x361c7a(0x29d)](()=>_0x20b1e0(null))[_0x361c7a(0x30f)](_0x32ddad);return;}if(_0x45f8bf[_0x361c7a(0x2a0)+'de']!==0xc8){_0x45f8bf[_0x361c7a(0x2b2)](),_0x32ddad(new Error(_0x361c7a(0x30d)+_0x361c7a(0x298)+_0x45f8bf[_0x361c7a(0x2a0)+'de']+':\x20'+_0x4c1024));return;}_0x20b1e0(_0x45f8bf);})['on']('error',_0x32ddad);});_0x5794af&&await pipeline(_0x5794af,createWriteStream(_0x521dc7));}export async function ensureOpenClawDoctorFixed(_0x42b22a,_0x3c298b={}){const _0xa9ae5=_0x209e23,_0x1e3e63=await loadRuntimeInfo(_0x42b22a[_0xa9ae5(0x38c)+_0xa9ae5(0x23d)]),_0x5e0aa6=getConfigPaths(_0x42b22a),_0x3d22e3=join(_0x5e0aa6['runtimeS'+'tateDir'],_0xa9ae5(0x278)+_0xa9ae5(0x2e6)+_0xa9ae5(0x333)),_0x146b25=await readJson(_0x3d22e3,{});if(_0x146b25[_0xa9ae5(0x278)+_0xa9ae5(0x32a)]===_0x1e3e63[_0xa9ae5(0x278)+_0xa9ae5(0x32a)])return _0x3c298b[_0xa9ae5(0x1fb)+_0xa9ae5(0x2b5)]?.[_0xa9ae5(0x21d)]('openclaw'+_0xa9ae5(0x21e)+_0xa9ae5(0x33a)+_0xa9ae5(0x2b8)+_0xa9ae5(0x291),{'openclawVersion':_0x1e3e63[_0xa9ae5(0x278)+'Version'],'markerPath':_0x3d22e3}),{'ran':![],'openclawVersion':_0x1e3e63[_0xa9ae5(0x278)+_0xa9ae5(0x32a)],'markerPath':_0x3d22e3};return await runOpenClawDoctorFix(_0x42b22a,_0x1e3e63,{'fromVersion':_0x146b25[_0xa9ae5(0x278)+'Version']||'unknown','toVersion':_0x1e3e63[_0xa9ae5(0x278)+_0xa9ae5(0x32a)],'markerPath':_0x3d22e3,'runtimeLogger':_0x3c298b[_0xa9ae5(0x1fb)+'ogger']}),{'ran':!![],'openclawVersion':_0x1e3e63[_0xa9ae5(0x278)+_0xa9ae5(0x32a)],'markerPath':_0x3d22e3};}async function runOpenClawDoctorFix(_0x19fbbe,_0x12c1f3,{fromVersion:_0x5ea0b0,toVersion:_0x3cedb4,markerPath:markerPath='',runtimeLogger:_0x48721c}={}){const _0x912ca6=_0x209e23;_0x48721c?.[_0x912ca6(0x21d)](_0x912ca6(0x278)+_0x912ca6(0x21e)+'fix\x20star'+_0x912ca6(0x1da),{'fromVersion':_0x5ea0b0,'toVersion':_0x3cedb4});const _0x211394=await createRuntimeEnv(_0x12c1f3,{'OPENCLAW_HOME':_0x19fbbe[_0x912ca6(0x279)],'OPENCLAW_STATE_DIR':_0x19fbbe[_0x912ca6(0x279)],'OPENCLAW_CONFIG_PATH':getConfigPaths(_0x19fbbe)[_0x912ca6(0x1a6)+'th']});console[_0x912ca6(0x25c)](_0x912ca6(0x1fa)+_0x912ca6(0x271)+_0x912ca6(0x1d9)+_0x912ca6(0x2a5)+_0x912ca6(0x2da)+_0x912ca6(0x2f5)+'fix');const _0x4b0d95=await runProcess(_0x12c1f3[_0x912ca6(0x2c7)+_0x912ca6(0x1ab)],[_0x12c1f3[_0x912ca6(0x278)+_0x912ca6(0x358)],'doctor',_0x912ca6(0x26e)],{'cwd':_0x12c1f3[_0x912ca6(0x278)+_0x912ca6(0x261)+'ir'],'env':_0x211394,'label':_0x912ca6(0x278)+_0x912ca6(0x21e)+_0x912ca6(0x26e),'timeoutMs':0x1d4c0});_0x48721c?.[_0x912ca6(0x21d)](_0x912ca6(0x278)+'\x20doctor\x20'+_0x912ca6(0x2b6)+_0x912ca6(0x1b8),{'fromVersion':_0x5ea0b0,'toVersion':_0x3cedb4,'stdout':_0x4b0d95['stdout'][_0x912ca6(0x391)]()['slice'](-0xfa0),'stderr':_0x4b0d95[_0x912ca6(0x366)]['trim']()[_0x912ca6(0x34a)](-0xfa0)}),markerPath&&(await writeJson(markerPath,{'openclawVersion':_0x12c1f3[_0x912ca6(0x278)+'Version'],'fixedAt':new Date()['toISOStr'+_0x912ca6(0x2dd)]()}),_0x48721c?.[_0x912ca6(0x21d)]('openclaw'+_0x912ca6(0x21e)+_0x912ca6(0x296)+_0x912ca6(0x2cf)+'en',{'markerPath':markerPath,'openclawVersion':_0x12c1f3[_0x912ca6(0x278)+'Version']}));}export async function readRuntimeManifest(_0x4d68c9){return await readJson(resolveManifestPath(_0x4d68c9),{});}export async function loadRuntimeInfo(_0x1ff871){const _0x301bb5=resolveRuntimeRoot(_0x1ff871),_0x481615=await readRuntimeManifest(_0x301bb5);return createRuntimeInfoFromManifest(_0x301bb5,_0x481615);}function createRuntimeInfoFromManifest(_0xd55bd1,_0x52c63c,_0x5cf3af={}){const _0x30887d=_0x209e23;for(const _0x2fe3ae of[_0x30887d(0x2c7)+_0x30887d(0x1ab),_0x30887d(0x2fb),'openclaw'+_0x30887d(0x261)+'ir','openclaw'+_0x30887d(0x358)]){if(typeof _0x52c63c[_0x2fe3ae]!==_0x30887d(0x1b4)||!_0x52c63c[_0x2fe3ae][_0x30887d(0x391)]())throw new Error(_0x30887d(0x23e)+_0x30887d(0x2ad)+_0x30887d(0x365)+_0x30887d(0x1b7)+_0x2fe3ae+_0x30887d(0x2b4)+resolveManifestPath(_0xd55bd1)+(_0x30887d(0x2fe)+_0x30887d(0x332)+_0x30887d(0x390)+'e'));}const _0x286ba9=resolve(_0xd55bd1,_0x52c63c['nodeExec'+_0x30887d(0x1ab)]),_0x18c7c0=resolve(_0xd55bd1,_0x52c63c[_0x30887d(0x2fb)]),_0x1c5fbf=resolve(_0xd55bd1,_0x52c63c[_0x30887d(0x278)+_0x30887d(0x261)+'ir']),_0x5e6052=resolve(_0xd55bd1,_0x52c63c[_0x30887d(0x278)+'Bin']),_0x41d64f=Array[_0x30887d(0x2e0)](_0x52c63c['plugins'])?_0x52c63c['plugins'][_0x30887d(0x224)](_0x568440=>({..._0x568440,'installPath':resolve(_0xd55bd1,_0x568440[_0x30887d(0x20b)+'ath'])})):[],_0x14b9e9=_0x5cf3af[_0x30887d(0x239)+_0x30887d(0x2db)+_0x30887d(0x24a)]?[_0x286ba9,_0x18c7c0]:[_0x286ba9,_0x18c7c0,_0x1c5fbf,_0x5e6052];for(const _0x63797c of _0x14b9e9){if(!existsSync(_0x63797c))throw new Error(_0x30887d(0x23e)+_0x30887d(0x219)+_0x30887d(0x35a)+_0x63797c);}return{'runtimeRoot':_0xd55bd1,'manifest':_0x52c63c,'openclawVersion':_0x52c63c[_0x30887d(0x278)+'Version']||_0x30887d(0x281),'nodeExecutable':_0x286ba9,'npmCli':_0x18c7c0,'openclawWorkingDir':_0x1c5fbf,'openclawBin':_0x5e6052,'plugins':_0x41d64f};}export async function spawnClaw(_0x248a3d,_0x56aa2d=[],_0x457e0f={}){const _0x31cef4=_0x209e23,_0xc25529=await loadRuntimeInfo(_0x248a3d),_0x70ed98=await createRuntimeEnv(_0xc25529,_0x457e0f[_0x31cef4(0x2e3)]??{});return spawn(_0xc25529[_0x31cef4(0x2c7)+_0x31cef4(0x1ab)],[_0xc25529[_0x31cef4(0x278)+_0x31cef4(0x358)],..._0x56aa2d],{'cwd':_0xc25529['openclaw'+_0x31cef4(0x261)+'ir'],'stdio':_0x31cef4(0x34f),..._0x457e0f,'env':_0x70ed98});}export async function runClawOnce(_0x3c148f,_0x16615c=[],_0x20263f=0x15f90){const _0x44dbf9=await spawnClaw(_0x3c148f,_0x16615c);return await new Promise((_0x2f83b6,_0x4110d4)=>{const _0x5aea47=_0x147a;let _0x47b4ab='',_0x6c41d6='',_0x3354b0=![];const _0x39a19f=setTimeout(()=>{const _0x2b93bc=_0x147a;if(_0x3354b0)return;_0x3354b0=!![],_0x44dbf9['kill'](_0x2b93bc(0x31c)),_0x4110d4(new Error(_0x2b93bc(0x278)+_0x2b93bc(0x1c1)+'ut\x20after'+'\x20'+_0x20263f+'ms'));},_0x20263f);_0x44dbf9[_0x5aea47(0x352)]['on']('data',_0x1da014=>{const _0x3b6415=_0x5aea47;_0x47b4ab+=_0x1da014[_0x3b6415(0x294)]();}),_0x44dbf9['stderr']['on'](_0x5aea47(0x324),_0xe3f6d0=>{_0x6c41d6+=_0xe3f6d0['toString']();}),_0x44dbf9['on'](_0x5aea47(0x2d1),_0x1d9639=>{if(_0x3354b0)return;_0x3354b0=!![],clearTimeout(_0x39a19f),_0x4110d4(_0x1d9639);}),_0x44dbf9['on']('close',(_0x430a22,_0x236593)=>{if(_0x3354b0)return;_0x3354b0=!![],clearTimeout(_0x39a19f),_0x2f83b6({'code':_0x430a22,'signal':_0x236593,'stdout':_0x47b4ab,'stderr':_0x6c41d6});});});}async function findRuntimeLarkCliBin(_0x1fde70){const _0x1ad53b=_0x209e23,_0x113f59=join(_0x1fde70[_0x1ad53b(0x278)+_0x1ad53b(0x261)+'ir'],_0x1ad53b(0x1e5)+_0x1ad53b(0x37a),_0x1ad53b(0x194)+'te','cli'),_0x442ad1=join(_0x113f59,_0x1ad53b(0x210)+_0x1ad53b(0x333));if(!existsSync(_0x442ad1))return{'packageDir':_0x113f59,'binPath':null};try{const _0xc86600=JSON[_0x1ad53b(0x308)](await readFile(_0x442ad1,_0x1ad53b(0x19b))),_0x28dd47=typeof _0xc86600[_0x1ad53b(0x388)]==='string'?_0xc86600[_0x1ad53b(0x388)]:_0xc86600[_0x1ad53b(0x388)]&&typeof _0xc86600[_0x1ad53b(0x388)]===_0x1ad53b(0x251)?_0xc86600[_0x1ad53b(0x388)][_0x1ad53b(0x223)]||Object['values'](_0xc86600['bin'])[0x0]:'';return{'packageDir':_0x113f59,'binPath':_0x28dd47?join(_0x113f59,_0x28dd47):null};}catch{return{'packageDir':_0x113f59,'binPath':null};}}export async function resolveRuntimeLarkCliCommand(_0xcb3f2b){const _0x5a4f82=_0x209e23,{packageDir:_0x57a0af,binPath:_0x359f20}=await findRuntimeLarkCliBin(_0xcb3f2b);if(!_0x359f20||!existsSync(_0x359f20))throw new Error(_0x5a4f82(0x2ae)+_0x5a4f82(0x194)+_0x5a4f82(0x38b)+_0x5a4f82(0x1f0)+_0x5a4f82(0x2fc)+_0x5a4f82(0x2ff)+_0x5a4f82(0x29c)+'\x20'+_0x57a0af+(_0x5a4f82(0x27d)+_0x5a4f82(0x356)+_0x5a4f82(0x198)+'re\x22\x20to\x20r'+'ebuild\x20t'+_0x5a4f82(0x301)+_0x5a4f82(0x341)));return{'nodeExecutable':_0xcb3f2b[_0x5a4f82(0x2c7)+_0x5a4f82(0x1ab)],'scriptPath':_0x359f20,'packageDir':_0x57a0af};}function resolvePackageNameFromNpmSpec(_0x5b220b){const _0x35342a=_0x209e23,_0x4aaac1=_0x5b220b[_0x35342a(0x391)]()[_0x35342a(0x2bd)](/^npm:/,'');if(!_0x4aaac1)throw new Error(_0x35342a(0x1c7)+_0x35342a(0x2b3)+'ugin\x20spe'+'c');if(_0x4aaac1['startsWi'+'th']('@')){const _0x2cb603=_0x4aaac1['indexOf']('/');if(_0x2cb603===-0x1)throw new Error(_0x35342a(0x1c7)+'scoped\x20s'+_0x35342a(0x2b0)+_0x5b220b);const _0x48f0d2=_0x4aaac1[_0x35342a(0x2cd)]('@',_0x2cb603+0x1);return _0x48f0d2===-0x1?_0x4aaac1:_0x4aaac1[_0x35342a(0x34a)](0x0,_0x48f0d2);}const _0x297fc9=_0x4aaac1[_0x35342a(0x2cd)]('@');return _0x297fc9===-0x1?_0x4aaac1:_0x4aaac1[_0x35342a(0x34a)](0x0,_0x297fc9);}async function createRuntimeEnv(_0x4912f2,_0x5d0af4={}){const _0x2d8c24=_0x209e23,_0x51c34d=process.env.OPENCLAW_STATE_DIR||'',_0xcbbf95=process.env.NPM_CONFIG_REGISTRY||_0x2d8c24(0x375)+'registry'+_0x2d8c24(0x357)+_0x2d8c24(0x21c),_0x19b368=_0x51c34d?join(_0x51c34d,_0x2d8c24(0x386)+_0x2d8c24(0x1aa)+'ls'):join(_0x4912f2[_0x2d8c24(0x27c)+'oot'],'.tools'),_0x1b75b5=join(_0x19b368,'npm-glob'+'al'),_0x3da23c=join(_0x19b368,_0x2d8c24(0x377)+'e'),_0x39a8d2=join(_0x1b75b5,_0x2d8c24(0x388));await mkdir(_0x39a8d2,{'recursive':!![]}),await mkdir(_0x3da23c,{'recursive':!![]});const _0x56a440=[_0x39a8d2,dirname(_0x4912f2['nodeExec'+_0x2d8c24(0x1ab)]),process.env.PATH||''];return{...process.env,..._0x5d0af4,'PATH':_0x56a440['filter'](Boolean)[_0x2d8c24(0x2fa)](delimiter),'npm_config_prefix':_0x1b75b5,'NPM_CONFIG_PREFIX':_0x1b75b5,'npm_config_cache':_0x3da23c,'NPM_CONFIG_CACHE':_0x3da23c,'NPM_CONFIG_REGISTRY':_0xcbbf95,'npm_execpath':_0x4912f2[_0x2d8c24(0x2fb)],'npm_node_execpath':_0x4912f2['nodeExec'+_0x2d8c24(0x1ab)],'OPENCLAW_RUNTIME_NPM_PREFIX':_0x1b75b5,'OPENCLAW_RUNTIME_NPM_BIN':_0x39a8d2};}export async function getRuntimeSpawnContext(_0x14b871,_0x176eff={}){const _0x495144=_0x209e23,_0xc2c633=await loadRuntimeInfo(_0x14b871),_0x1a9789=await createRuntimeEnv(_0xc2c633,_0x176eff);return{'cwd':_0xc2c633[_0x495144(0x278)+_0x495144(0x261)+'ir'],'env':_0x1a9789,'runtime':_0xc2c633};}function resolvePluginDirNameFromSpec(_0x59ca63){const _0x4fef99=_0x209e23,_0x15ecfc=resolvePackageNameFromNpmSpec(_0x59ca63),_0x1645c5=_0x15ecfc[_0x4fef99(0x24e)]('/')[_0x4fef99(0x246)](Boolean),_0x2a05ba=_0x1645c5['at'](-0x1)??'';if(!_0x2a05ba)throw new Error('Invalid\x20'+'plugin\x20s'+_0x4fef99(0x2b0)+_0x59ca63);return _0x2a05ba;}async function resolvePluginIdFromPackageDir(_0x105e44,_0x421d40){const _0x1839c1=_0x209e23,_0x2e198b=await readJson(join(_0x105e44,'package.'+_0x1839c1(0x333)),{}),_0x44dab0=await readPluginManifest(_0x105e44),_0x4596ce=[_0x44dab0?.['id'],_0x44dab0?.[_0x1839c1(0x21f)],_0x44dab0?.[_0x1839c1(0x36a)],_0x2e198b?.[_0x1839c1(0x278)]?.['id'],_0x2e198b?.['openclaw'+'Id'],_0x421d40],_0x236c8a=_0x4596ce[_0x1839c1(0x208)](_0x43f6b0=>typeof _0x43f6b0===_0x1839c1(0x1b4)&&_0x43f6b0[_0x1839c1(0x391)]());if(!_0x236c8a)throw new Error(_0x1839c1(0x196)+_0x1839c1(0x2c8)+_0x1839c1(0x1be)+'\x20id\x20from'+'\x20'+_0x105e44);return _0x236c8a[_0x1839c1(0x391)]();}function pluginSpecMatches(_0x43365f,_0xf4ec11){const _0x2cf4aa=_0x209e23,_0x39aae8=_0xf4ec11[_0x2cf4aa(0x391)](),_0x3e7dc0=resolvePackageNameFromNpmSpec(_0x39aae8);return[_0x43365f[_0x2cf4aa(0x25f)],_0x43365f[_0x2cf4aa(0x1db)+_0x2cf4aa(0x269)],_0x43365f[_0x2cf4aa(0x1db)+_0x2cf4aa(0x28c)]][_0x2cf4aa(0x220)](_0x178e66=>_0x178e66===_0x39aae8||_0x178e66===_0x3e7dc0);}async function installPluginFromNpmSpec(_0x4e86be,_0x39e775,_0x4f7415={}){const _0x4a7a13=_0x209e23,_0xfacd5e=_0x4e86be[_0x4a7a13(0x391)]()[_0x4a7a13(0x2bd)](/^npm:/,''),_0x3f9d9d=resolvePluginDirNameFromSpec(_0xfacd5e),_0x1c3313=join(_0x39e775[_0x4a7a13(0x278)+_0x4a7a13(0x261)+'ir'],_0x4a7a13(0x306),_0x4a7a13(0x361)+'ns'),_0x2c526c=join(_0x1c3313,_0x3f9d9d),_0x1e0abc=join(_0x39e775['runtimeR'+_0x4a7a13(0x23d)],_0x4a7a13(0x2ab)+_0x4a7a13(0x318)+process['pid']+'-'+Date['now']()),_0x5ac0f5=await createRuntimeEnv(_0x39e775),_0x30f9d3=new Date()['toISOStr'+_0x4a7a13(0x2dd)](),_0x579cc1=join(_0x39e775['runtimeR'+_0x4a7a13(0x23d)],_0x4a7a13(0x2c6));await mkdir(_0x579cc1,{'recursive':!![]}),await rm(_0x1e0abc,{'recursive':!![],'force':!![]}),await rm(_0x2c526c,{'recursive':!![],'force':!![]}),await mkdir(_0x1e0abc,{'recursive':!![]}),await mkdir(_0x1c3313,{'recursive':!![]}),console['log'](_0x4a7a13(0x1fa)+'hell:run'+_0x4a7a13(0x22d)+'tching\x20p'+_0x4a7a13(0x315)+_0xfacd5e);const _0x5a2f69=await runProcess(_0x39e775[_0x4a7a13(0x2c7)+_0x4a7a13(0x1ab)],[_0x39e775[_0x4a7a13(0x2fb)],_0x4a7a13(0x302),_0xfacd5e,'--json'],{'cwd':_0x579cc1,'env':_0x5ac0f5,'label':'npm\x20pack'+'\x20'+_0xfacd5e}),_0x34782e=parseNpmPackJson(_0x5a2f69[_0x4a7a13(0x352)]),_0x25e28d=normalizePackedTarballFilename(_0x34782e[_0x4a7a13(0x31f)]),_0x24d181=join(_0x579cc1,_0x25e28d);if(!existsSync(_0x24d181))throw new Error(_0x4a7a13(0x2f2)+_0x4a7a13(0x32d)+'\x20create\x20'+_0x4a7a13(0x2b9)+'\x20'+_0x24d181);await runProcess(_0x4a7a13(0x247),[_0x4a7a13(0x385),_0x24d181,'-C',_0x1e0abc],{'label':'extract\x20'+_0x25e28d}),await rename(join(_0x1e0abc,'package'),_0x2c526c),await rm(_0x1e0abc,{'recursive':!![],'force':!![]});const _0x312d91=join(_0x2c526c,'package.'+_0x4a7a13(0x333)),_0x58d504=await readJson(_0x312d91,{});(_0x58d504[_0x4a7a13(0x2d7)+_0x4a7a13(0x2e2)]||_0x58d504[_0x4a7a13(0x1e8)])&&(delete _0x58d504[_0x4a7a13(0x2d7)+'dencies'],delete _0x58d504[_0x4a7a13(0x1e8)],await writeJson(_0x312d91,_0x58d504));await runProcess(_0x39e775[_0x4a7a13(0x2c7)+_0x4a7a13(0x1ab)],[_0x39e775['npmCli'],_0x4a7a13(0x1d2),_0x4a7a13(0x1d6)+'ev',_0x4a7a13(0x25b)+_0x4a7a13(0x382),_0x4a7a13(0x24d)+'it',_0x4a7a13(0x31a)+'d',_0x4a7a13(0x238)+_0x4a7a13(0x1a2)+'ps'],{'cwd':_0x2c526c,'env':_0x5ac0f5,'label':_0x4a7a13(0x32f)+_0x4a7a13(0x1d5)+_0x4a7a13(0x325)+_0xfacd5e});const _0x39a74c=new Date()[_0x4a7a13(0x339)+'ing'](),_0x995a2a=await resolvePluginIdFromPackageDir(_0x2c526c,_0x34782e[_0x4a7a13(0x36a)]);return _0x4f7415[_0x4a7a13(0x1fb)+_0x4a7a13(0x2b5)]?.['info']('npm\x20plug'+'in\x20insta'+'lled',{'spec':_0xfacd5e,'pluginId':_0x995a2a,'installPath':_0x2c526c}),{'pluginId':_0x995a2a,'source':_0x4a7a13(0x378),'spec':_0xfacd5e,'installPath':toRuntimeRelative(_0x39e775[_0x4a7a13(0x27c)+'oot'],_0x2c526c),'version':_0x34782e[_0x4a7a13(0x2ec)],'resolvedName':_0x34782e['name'],'resolvedVersion':_0x34782e[_0x4a7a13(0x2ec)],'resolvedSpec':_0x34782e[_0x4a7a13(0x36a)]+'@'+_0x34782e[_0x4a7a13(0x2ec)],'integrity':typeof _0x34782e[_0x4a7a13(0x330)+'y']==='string'?_0x34782e[_0x4a7a13(0x330)+'y']:'','shasum':typeof _0x34782e[_0x4a7a13(0x27a)]===_0x4a7a13(0x1b4)?_0x34782e[_0x4a7a13(0x27a)]:'','resolvedAt':_0x30f9d3,'installedAt':_0x39a74c};}async function syncConfiguredNpmPlugins(_0x116d73,_0x3c1b15,_0x344265,_0x2da5f6={}){const _0x1380f0=_0x209e23;if(_0x2da5f6[_0x1380f0(0x30e)])return;const _0x5862ba=createRuntimeInfoFromManifest(_0x3c1b15,_0x344265),_0x15bdff=Array[_0x1380f0(0x2e0)](_0x344265[_0x1380f0(0x1c4)])?_0x344265['plugins']:[],_0x4f6f44=[];for(const _0x546731 of _0x116d73['openclaw'][_0x1380f0(0x1ad)+'ecs']){const _0x5d71c6=_0x15bdff[_0x1380f0(0x208)](_0x26f4be=>_0x26f4be?.[_0x1380f0(0x1e2)]===_0x1380f0(0x378)&&pluginSpecMatches(_0x26f4be,_0x546731)&&typeof _0x26f4be['installP'+'ath']==='string'&&existsSync(resolve(_0x3c1b15,_0x26f4be[_0x1380f0(0x20b)+'ath'])));if(_0x5d71c6){_0x4f6f44[_0x1380f0(0x1c8)](_0x5d71c6);continue;}_0x4f6f44[_0x1380f0(0x1c8)](await installPluginFromNpmSpec(_0x546731,_0x5862ba,_0x2da5f6));}const _0x32bec6=new Set(_0x116d73[_0x1380f0(0x278)][_0x1380f0(0x1ad)+_0x1380f0(0x23a)][_0x1380f0(0x224)](resolvePackageNameFromNpmSpec)),_0x51d308=_0x15bdff[_0x1380f0(0x246)](_0x560e59=>_0x560e59?.['source']!==_0x1380f0(0x378)||!_0x32bec6[_0x1380f0(0x2a3)](resolvePackageNameFromNpmSpec(_0x560e59[_0x1380f0(0x1db)+_0x1380f0(0x28c)]||_0x560e59[_0x1380f0(0x25f)]||'')));_0x344265[_0x1380f0(0x1c4)]=[..._0x51d308,..._0x4f6f44];}function hasRuntimeDependencies(_0x39d078){const _0x1783a3=_0x209e23,_0x33de4e=_0x39d078?.[_0x1783a3(0x319)+_0x1783a3(0x192)]&&typeof _0x39d078['dependen'+_0x1783a3(0x192)]===_0x1783a3(0x251)?Object[_0x1783a3(0x242)](_0x39d078['dependen'+_0x1783a3(0x192)]):[],_0x1afdd5=_0x39d078?.['optional'+'Dependen'+_0x1783a3(0x192)]&&typeof _0x39d078[_0x1783a3(0x30b)+'Dependen'+_0x1783a3(0x192)]==='object'?Object[_0x1783a3(0x242)](_0x39d078[_0x1783a3(0x30b)+_0x1783a3(0x1bc)+_0x1783a3(0x192)]):[];return _0x33de4e[_0x1783a3(0x370)]>0x0||_0x1afdd5[_0x1783a3(0x370)]>0x0;}async function installLocalPluginRuntimeDependencies(_0x42c8d7,_0x26f412,_0x2233c4){const _0x3751cf=_0x209e23,_0xa880c4=join(_0x42c8d7,_0x3751cf(0x210)+'json'),_0x525bdd=await readJson(_0xa880c4,{});(_0x525bdd[_0x3751cf(0x2d7)+_0x3751cf(0x2e2)]||_0x525bdd[_0x3751cf(0x1e8)])&&(delete _0x525bdd[_0x3751cf(0x2d7)+_0x3751cf(0x2e2)],delete _0x525bdd[_0x3751cf(0x1e8)],await writeJson(_0xa880c4,_0x525bdd));if(!hasRuntimeDependencies(_0x525bdd))return;const _0x45bdf1=await createRuntimeEnv(_0x26f412);console[_0x3751cf(0x25c)](_0x3751cf(0x1fa)+_0x3751cf(0x271)+'time]\x20in'+_0x3751cf(0x28e)+_0x3751cf(0x2f1)+_0x3751cf(0x1c2)+_0x3751cf(0x19f)+_0x3751cf(0x248)+_0x42c8d7),await runProcess(_0x26f412[_0x3751cf(0x2c7)+_0x3751cf(0x1ab)],[_0x26f412[_0x3751cf(0x2fb)],_0x3751cf(0x1d2),'--omit=d'+'ev',_0x3751cf(0x25b)+'eer',_0x3751cf(0x24d)+'it',_0x3751cf(0x31a)+'d',_0x3751cf(0x238)+_0x3751cf(0x1a2)+'ps'],{'cwd':_0x42c8d7,'env':_0x45bdf1,'label':'npm\x20inst'+_0x3751cf(0x355)+_0x3751cf(0x33b)+'\x20'+_0x42c8d7}),_0x2233c4[_0x3751cf(0x1fb)+_0x3751cf(0x2b5)]?.['info'](_0x3751cf(0x21a)+'ugin\x20dep'+_0x3751cf(0x236)+_0x3751cf(0x36c)+_0x3751cf(0x1ac),{'installPath':_0x42c8d7});}async function syncSharedPluginModules(_0x4df676,_0x431fb0){const _0x1aa0ed=_0x209e23,_0x12a51c=new Set();for(const _0x1c758d of _0x4df676){const _0x1a750b=join(dirname(_0x1c758d),_0x1aa0ed(0x2c5));if(existsSync(_0x1a750b))_0x12a51c['add'](_0x1a750b);}for(const _0x29958c of _0x12a51c){await copyDirFresh(_0x29958c,join(_0x431fb0,_0x1aa0ed(0x2c5)));}}async function syncProductPlugins(_0x2eded5,_0x53b854,_0x2058b7,_0x32911c={}){const _0x155a3c=_0x209e23,_0x2d0be3=join(_0x53b854,_0x155a3c(0x278),_0x155a3c(0x306),_0x155a3c(0x361)+'ns'),_0x2e2f29=createRuntimeInfoFromManifest(_0x53b854,_0x2058b7),_0x7178a7=[];await syncSharedPluginModules(_0x2eded5[_0x155a3c(0x278)]['resolved'+_0x155a3c(0x29e)+_0x155a3c(0x1af)],_0x2d0be3);for(const _0x4e7b61 of _0x2eded5[_0x155a3c(0x278)][_0x155a3c(0x1db)+_0x155a3c(0x29e)+_0x155a3c(0x1af)]){const _0x4c673f=await getPackageMetadata(_0x4e7b61),_0x302f25=await readPluginManifest(_0x4e7b61),_0x39a45d=join(_0x2d0be3,_0x4c673f['pluginId']);await copyDirFresh(_0x4e7b61,_0x39a45d),await installLocalPluginRuntimeDependencies(_0x39a45d,_0x2e2f29,_0x32911c),_0x7178a7[_0x155a3c(0x1c8)]({'pluginId':_0x4c673f[_0x155a3c(0x21f)],'source':_0x155a3c(0x203),'spec':_0x155a3c(0x350)+_0x4e7b61,'installPath':toRuntimeRelative(_0x53b854,_0x39a45d),'version':_0x4c673f[_0x155a3c(0x2ec)],'resolvedName':_0x4c673f[_0x155a3c(0x36a)],'resolvedVersion':_0x4c673f[_0x155a3c(0x2ec)],'resolvedSpec':_0x155a3c(0x350)+_0x4e7b61,'integrity':'','shasum':'','resolvedAt':new Date()[_0x155a3c(0x339)+_0x155a3c(0x2dd)](),'installedAt':new Date()[_0x155a3c(0x339)+_0x155a3c(0x2dd)](),'agentScope':_0x302f25[_0x155a3c(0x2bf)+'pe'],'skills':_0x302f25[_0x155a3c(0x2f0)]});}const _0x12764b=new Set(_0x7178a7[_0x155a3c(0x224)](_0x5bea66=>_0x5bea66[_0x155a3c(0x21f)])),_0x530b29=Array[_0x155a3c(0x2e0)](_0x2058b7['plugins'])?_0x2058b7[_0x155a3c(0x1c4)][_0x155a3c(0x246)](_0x25bb23=>!_0x12764b['has'](_0x25bb23[_0x155a3c(0x21f)])):[];_0x2058b7[_0x155a3c(0x1c4)]=[..._0x530b29,..._0x7178a7];}async function syncManifestPluginScope(_0x26a41b,_0x9172a3,_0x273320){const _0x5c465f=_0x209e23,_0x186160=join(_0x9172a3,'openclaw','dist',_0x5c465f(0x361)+'ns'),_0xb91be=new Set(_0x26a41b[_0x5c465f(0x278)][_0x5c465f(0x1ad)+_0x5c465f(0x23a)]??[]),_0x40a44d=new Set([..._0xb91be]['map'](_0x8270e1=>_0x8270e1['replace'](/^npm:/,''))[_0x5c465f(0x224)](_0x2d7cce=>{const _0x5ad2f2=_0x5c465f;if(_0x2d7cce[_0x5ad2f2(0x314)+'th']('@')){const _0x305b8c=_0x2d7cce[_0x5ad2f2(0x24e)]('@');return _0x305b8c['length']>=0x3?'@'+_0x305b8c[0x1]:_0x2d7cce;}return _0x2d7cce[_0x5ad2f2(0x24e)]('@')[0x0];})[_0x5c465f(0x246)](Boolean)),_0x572cdd=new Set();for(const _0xeea16c of _0x26a41b[_0x5c465f(0x278)]['resolved'+_0x5c465f(0x29e)+'ginPaths']){const _0x141c8d=await getPackageMetadata(_0xeea16c);if(_0x141c8d[_0x5c465f(0x21f)])_0x572cdd['add'](_0x141c8d[_0x5c465f(0x21f)]);}const _0x5a5d78=Array['isArray'](_0x273320[_0x5c465f(0x1c4)])?_0x273320[_0x5c465f(0x1c4)]:[];_0x273320[_0x5c465f(0x1ad)+_0x5c465f(0x23a)]=[..._0x26a41b[_0x5c465f(0x278)][_0x5c465f(0x1ad)+'ecs'],..._0x26a41b[_0x5c465f(0x278)][_0x5c465f(0x1db)+_0x5c465f(0x29e)+_0x5c465f(0x1af)][_0x5c465f(0x224)](_0x29d6ac=>_0x5c465f(0x350)+_0x29d6ac)],_0x273320[_0x5c465f(0x1c4)]=_0x5a5d78[_0x5c465f(0x246)](_0x1cdcee=>{const _0x58e333=_0x5c465f;if(!_0x1cdcee||typeof _0x1cdcee!==_0x58e333(0x251))return![];if(_0x1cdcee[_0x58e333(0x1e2)]===_0x58e333(0x203))return _0x572cdd['has'](_0x1cdcee[_0x58e333(0x21f)]);if(_0x1cdcee[_0x58e333(0x1e2)]==='npm')return _0xb91be[_0x58e333(0x2a3)](_0x1cdcee[_0x58e333(0x25f)])||_0xb91be['has'](_0x1cdcee[_0x58e333(0x1db)+_0x58e333(0x269)])||_0x40a44d['has'](_0x1cdcee['resolved'+_0x58e333(0x28c)]);return![];});const _0x3359dd=new Set(_0x273320[_0x5c465f(0x1c4)]['map'](_0x2580bf=>_0x2580bf[_0x5c465f(0x21f)]));for(const _0x329547 of _0x5a5d78){if(!_0x329547[_0x5c465f(0x21f)]||_0x3359dd[_0x5c465f(0x2a3)](_0x329547[_0x5c465f(0x21f)]))continue;const _0x57c2f4=typeof _0x329547[_0x5c465f(0x20b)+_0x5c465f(0x22c)]==='string'&&_0x329547['installP'+_0x5c465f(0x22c)]['trim']()?resolve(_0x9172a3,_0x329547[_0x5c465f(0x20b)+_0x5c465f(0x22c)]):join(_0x186160,_0x329547[_0x5c465f(0x21f)]),_0x3d63b7=relative(_0x186160,_0x57c2f4);if(_0x3d63b7[_0x5c465f(0x314)+'th']('..')||_0x3d63b7==='')continue;await rm(_0x57c2f4,{'recursive':!![],'force':!![]});}}async function collectCapabilityEntries(_0x41ddec,_0x59cfbf){const _0x39b453=_0x209e23,_0x1b9fc7=new Map();for(const _0x4493f1 of _0x41ddec){let _0x4da38c;try{_0x4da38c=await stat(_0x4493f1);}catch{throw new Error(_0x59cfbf+(_0x39b453(0x2a4)+_0x39b453(0x1c3)+_0x39b453(0x1a0))+_0x4493f1);}if(!_0x4da38c[_0x39b453(0x353)+_0x39b453(0x1ce)]())throw new Error(_0x59cfbf+(_0x39b453(0x289)+_0x39b453(0x235)+'director'+_0x39b453(0x218))+_0x4493f1);const _0x7f8d06={'name':basename(_0x4493f1),'path':_0x4493f1},_0x10073c=_0x1b9fc7[_0x39b453(0x379)](_0x7f8d06[_0x39b453(0x36a)]);if(_0x10073c)throw new Error(_0x39b453(0x222)+'e\x20'+_0x59cfbf+_0x39b453(0x1cf)+_0x7f8d06[_0x39b453(0x36a)]+_0x39b453(0x36f)+_0x10073c[_0x39b453(0x254)]+_0x39b453(0x34c)+_0x7f8d06[_0x39b453(0x254)]);_0x1b9fc7[_0x39b453(0x2a2)](_0x7f8d06[_0x39b453(0x36a)],_0x7f8d06);}return[..._0x1b9fc7[_0x39b453(0x256)]()];}async function syncProductCapabilityDirs(_0x1af51a,_0x3d708d,_0x4ad583){const _0x146cff=_0x209e23,_0x5eb023=await collectCapabilityEntries(_0x1af51a,_0x4ad583);await rm(_0x3d708d,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await mkdir(_0x3d708d,{'recursive':!![]});for(const _0x30ae48 of _0x5eb023){await cp(_0x30ae48[_0x146cff(0x254)],join(_0x3d708d,_0x30ae48[_0x146cff(0x36a)]),{'recursive':!![]});}return _0x5eb023['length'];}export const __test__={'collectCapabilityEntries':collectCapabilityEntries,'syncProductCapabilityDirs':syncProductCapabilityDirs};function _0x2e91(){const _0x17a752=['-peer-de','atch:\x20ma','shell-ru','ld\x20compl','configPa','.node','lib/node','1146258ZTAZHS','time-too','utable','led','pluginSp','rent','ginPaths','Configur','try\x20not\x20','bug;\x20ver','el.inbou','string','_NAME:-','ynced','ing\x20\x22','leted','product','plugin\x20s','\x20started','Dependen','\x20on\x20futu','e\x20plugin','time]\x20do','\x20-g','\x20timed\x20o','lugin\x20de','s\x20not\x20fo','plugins','\x20prepare','dules/np','Invalid\x20','push','\x20version','warn','-xJf','red','ed;\x20brid','ory','\x20entry\x20\x22','channel\x20','kill','install','wujieai.','ATH=\x20cd\x20','all\x20plug','--omit=d','found','m-cli.js','time]\x20ru','ted','resolved','index.mj','productN','FILE%\x5c','patch\x20al','npm\x20root','lied','source','session\x20','process.','node_mod','isFile','w-extrac','scripts','r\x20runtim','ready\x20ap','ME%\x22==\x22\x22','chat-dis',',\x20shell.','exec\x20\x22$S','red\x20Node','s\x20missin','root','agent','location','ad-','pid','already-','\x20configu','st=','required','[wujie-s','runtimeL','time-bri','E_DIR=','node\x20ver','node/bin','unction\x20','19103JzXuqE','ion','local','dge.mjs','HOME=\x22${','configur','\x20depende','find','des.','NCLAW_CO','installP','atch\x20ski','wBin','re\x20upgra','if\x20\x22%OPE','package.','\x22\x20\x22$SCRI','\x20install','NCLAW_ST','wnloadin','patch\x20sk','store\x20sq','now','y:\x20','missing\x20','local\x20pl','dAt','or.com','info','\x20doctor\x20','pluginId','some','null','Duplicat','lark-cli','map','store\x20lo','6\x20mixed\x20','endsWith','PT_DIR%','es.','sort','PT_DIR/','ath','time]\x20fe','idated','play-pro','nifest=','o.mjs\x22\x202','STATE_DI','ncies','ENCLAW_H','st\x20be\x20a\x20','endencie','lugins\x20s','--legacy','allowMis','ecs','IPT_DIR=','skipped;','oot','runtime\x20','\x20complet','152332aLCqsy','loader-','keys','chat\x20his','replaceA','patch\x20fo','filter','tar','es\x20','.tmp/run','Claw','package','ed\x20OpenC','--no-aud','split','ot\x20found','started','object','nced','\x22\x20so\x20the','path','llPaths','values','Temporar','OME=','JIE_NO_L','store-','--omit=p','log','set\x20\x22SCR','skills\x20s','spec','entryCou','WorkingD','10393482QTzgXN','eady\x20app','G_FILE_N','ime\x20buil','runtime-','store-lo','arch','Spec','\x20package','\x20create\x20','H%\x22==\x22\x22\x20','dataDirN','--fix','\x20signal=','\x20not\x20fou','hell:run','h\x20alread','tory\x20mix','law\x20','\x20returne','PENCLAW_','nd\x20helpe','openclaw','dataDir','shasum','393vZdKJA','runtimeR','.\x20Run\x20\x22w','\x22%SCRIPT','PT_DIR/w','mismatch','unknown','plugins\x20','red\x20Open','d\x20an\x20inv','\x20found','prepareP','alid\x20pay','bridge.m','\x20path\x20mu','cal\x20runt','AW_CONFI','Name','prepare\x20','stalling','extract\x20','cwd','ent','=\x22${OPEN','\x20can\x20be\x20','toString','ut\x20after','fix\x20mark','plugin\x20r','\x20failed\x20','../../as','e\x20tools\x20','eted','runtime:','then','LocalPlu','2175435tgtuVz','statusCo','reason','set','has','\x20path\x20wa','nning\x20op','OPENCLAW','ipped;\x20f','ile\x20not\x20','%USERPRO','ILE_NAME','.plugin-','ell-runt','manifest','Bundled\x20','ion\x20mism','pec:\x20','\x20bin\x20was','resume','empty\x20pl','\x22\x20at\x20','ogger','fix\x20comp','>/dev/nu','ady\x20curr','tarball:','--json','flush','tools\x20sy','replace','t\x20\x22OPENC','agentSco','/opencla','ader\x20not','ced','nodeVers','headers','_shared','.cache','nodeExec','o\x20resolv','vailable','E_NAME%\x22','\x20-z\x20\x22$WU','rname\x20--','indexOf','JSON:\x20','er\x20writt','ll\x20||\x20tr','error','arm64','all\x20','r\x20OpenCl','node-v','$HOME/','devDepen','pped;\x20di','h\x20applie','enclaw\x20d','singOpen','wujiecla','ing','tool\x20his','eam\x20fix\x20','isArray','ions/run','dencies','env','ie-logo.','\x22\x20%*','-doctor.','sion\x20mis','unzip','\x20product','ite\x20patc','annel\x20en','version','IR=$(CDP','#!/bin/s','%~dp0\x22','skills','\x20local\x20p','npm\x20pack','wujie-lo','channel-','octor\x20--','ntime','\x22\x20\x22$@\x22','NFIG_PAT','lib','join','npmCli','g\x20from\x20O','tar.xz',';\x20run\x20wu','penClaw\x20','appId','he\x20runti','pack','mjs','Run\x20\x22wuj','agents\x20s','dist','label','parse','win32','agents','optional','sets/wuj','download','syncOnly','catch','LocalAge','?t=','skill','\x20paths','startsWi','lugin\x20','configFi','Version\x20','extract-','dependen','--no-fun','patch\x20ap','SIGTERM','y\x20compat','tory\x20pro','filename','state-','ipped;\x20d','.js','\x20applied','data','in\x20','OGO\x22\x20];\x20','sion.','SCRIPT_D','npm-cli.','Version','e\x20upgrad','/npm','\x20did\x20not','match','npm\x20inst','integrit','NFIG_FIL','jie-shel','json','\x22\x20\x22%SCRI','every','aw\x202026.','d\x20to\x20','_DIR%','toISOStr','fix\x20alre','l\x20plugin','1264dcITts','CONFIG_P','OpenClaw','\x20runtime','rs;\x20veri','me.','base\x20alr','ATH:-','plied','platform','synced','ATE_DIR%','set\x20\x22OPE','sessions','slice','-extract','\x20and\x20','ed-tool\x20','ame','pipe','local:','nnel','stdout','isDirect','createRu','all\x20loca','ujie-she','.npmmirr','Bin','ATE_DIR:','path:\x20','rg/dist/','rebuilt\x20','untime\x20p','win','store\x20wr','.json','extensio','nel\x20plug','AME=','ntime\x20re','\x20is\x20miss','stderr','CRIPT_DI','not\x20foun','product\x20','name','patched','s\x20instal','ntimeCha','ntime\x20ch','\x22\x20from\x20','length','ATH=\x22${O','/node','zip','st\x20not\x20f','https://','3076sDEpSd','npm-cach','npm','get','ules','\x20\x20\x22$SCRI','w.mjs','\x20loaded','ie-shell','R=\x22${OPE','includes','time]\x20in','eer','FIG_FILE','2265210uHddhP','-xzf','claw-run','atch\x20app','bin','\x22==\x22\x22\x20se','roductRu','te/cli\x20i','projectR','kill\x20not','LocalSki','\x20kdocs\x20s','l\x20prepar','trim','cope\x20syn','2UgTPNi','node','9hHAtOX','cies','jection-','@larksui','/node_mo','Unable\x20t','versions','ll\x20prepa','sion\x20val','ad\x20patch','utf8','href','nd\x20after','ibility\x20','pendenci','und:\x20','ound'];_0x2e91=function(){return _0x17a752;};return _0x2e91();}async function syncProductAgents(_0x135092,_0xee69c,_0x26a986){const _0x582a25=_0x209e23,_0x283d86=join(_0xee69c,_0x582a25(0x278),_0x582a25(0x30a)),_0x2487db=await syncProductCapabilityDirs(_0x135092[_0x582a25(0x278)][_0x582a25(0x1db)+_0x582a25(0x310)+'ntPaths'],_0x283d86,_0x582a25(0x1f2));_0x26a986[_0x582a25(0x30a)]={'source':_0x582a25(0x1b9),'installPath':toRuntimeRelative(_0xee69c,_0x283d86),'localPaths':_0x135092[_0x582a25(0x278)]['resolved'+_0x582a25(0x310)+'ntPaths'],'entryCount':_0x2487db};}async function syncProductSkills(_0x283292,_0x39bd6e,_0x140766){const _0x5b2ee5=_0x209e23,_0x31ec3c=join(_0x39bd6e,'openclaw','skills'),_0x1ad2b9=await syncProductCapabilityDirs(_0x283292[_0x5b2ee5(0x278)][_0x5b2ee5(0x1db)+'LocalSki'+_0x5b2ee5(0x255)],_0x31ec3c,_0x5b2ee5(0x312));_0x140766[_0x5b2ee5(0x2f0)]={'source':_0x5b2ee5(0x1b9),'installPath':toRuntimeRelative(_0x39bd6e,_0x31ec3c),'localPaths':_0x283292[_0x5b2ee5(0x278)]['resolved'+_0x5b2ee5(0x38e)+'llPaths'],'entryCount':_0x1ad2b9};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x4d62(){const _0x1eb431=['558936XjQCkL','()(optio','Channel.','ntime\x20=\x20','1490280xKqjns','111182jeXnEn','YS);','\x09};','replace','ntime.ch','97507nzbkRc','patched','nst\x20exis','imeRefle','ntime;\x0a\x09','Channel(','const\x20re','return\x20r','ctionKey','n\x20&&\x20run','om\x20\x22node','ssion\x20??','imeChann','runtime-','eateRunt','runtime.','channel-','\x09\x09\x09if\x20(r','inRuntim','hannelIm','ect\x22\x20?\x20r','ntime.in','e\x20!==\x20\x22o','time\x20=\x20(','runtime\x20','istingCh','el\x20}\x20fro','===\x20\x22obj','ound\x20??\x20','nbound:\x20','annel\x20&&','ns));\x0a\x09\x09','89556pmSanA','elpers(r','rn\x20runti','ntexts:\x20','untime;\x0a','meChanne','l,\x0a\x09\x09\x09\x09r','\x20{};\x0a\x09\x09\x09','eContext','\x0a\x09\x09};\x0a','e\x20??=\x20en','elRuntim','channelR','ontexts\x20','indexOf','null;','nel\x20=\x20ru','untime.t','7XJbzam','bound,\x0a\x09','ime\x20=\x20wu','existing','sureWuji','urn\x20??\x20c','eturn\x20re','f\x20runtim','||\x20typeo','ME_REFLE','..existi','nnel?.in','solvedRu','eChannel','hannel\x20:','hannelRu','runtime;','elpers\x20=','imePromi','e.inboun','\x0a\x09\x09\x09\x09ses','ngChanne','nnel.inb','turn:\x20ex','\x09\x09\x09};\x0a\x09\x09','lazyRunt','RuntimeH','annel.se','un)\x20retu','sion:\x20ex','\x09\x09const\x20','imeOptio','l.reply\x20','e)\x20=>\x20{\x0a','ons.runt',');\x0a\x09\x09\x09co','edRuntim','n\x20??\x20exi','import\x20{','annel.tu','e()(opti','\x09\x09let\x20re','wujieCre','meOption','\x20channel','ateRunti','ns.runti','const\x20en','ot-provi',')\x20=>\x20{\x0a\x09','\x09\x09resolv','Runtime.','20DmPuOo','e.runtim','hannel?.','\x09return\x20','onst\x20cha','rn\x20??','resolved','CTION_KE','bound?.r','\x09\x09\x09if\x20(!','\x0a\x09\x09};\x0a\x09\x09','ded','jieCreat','nnel.tur','\x20typeof\x20','stingCha','me;\x0a\x09\x09\x09c','slice','channel\x20','solveCre','eRuntime','=\x20{\x0a\x09\x09\x09\x09','time.cha','session\x0a','1978182qmWkJi','null;\x0a\x09\x09','Runtime;','solveRun','ZY_RUNTI','d,\x0a\x09\x09\x09\x09t','e\x20??=\x20re','e.reply,','not-foun','277158QjBpos','nnelRunt','urn:\x20exi','s,\x0a\x09\x09\x09\x09i','eatePlug','portPath','runtimeC','e,\x0a\x09\x09\x09\x09.','annel\x20as','import-n','??\x20chann','ot-found','includes','test','...chann','\x20(runtim','untimeCh','bject\x22)\x20','untime.c','ash\x20}\x20fr','turn?.ru','\x20createR','\x20createH',':crypto\x22','s);\x0a\x09\x09\x09r','\x20wujieCr','esolveCr'];_0x4d62=function(){return _0x1eb431;};return _0x4d62();}(function(_0x41a349,_0x25eb51){const _0x2b72e2=_0x4155,_0x336242=_0x41a349();while(!![]){try{const _0x30de08=parseInt(_0x2b72e2(0x27a))/0x1+parseInt(_0x2b72e2(0x275))/0x2+parseInt(_0x2b72e2(0x1ee))/0x3+parseInt(_0x2b72e2(0x270))/0x4+parseInt(_0x2b72e2(0x234))/0x5*(parseInt(_0x2b72e2(0x255))/0x6)+-parseInt(_0x2b72e2(0x200))/0x7*(parseInt(_0x2b72e2(0x274))/0x8)+-parseInt(_0x2b72e2(0x24c))/0x9;if(_0x30de08===_0x25eb51)break;else _0x336242['push'](_0x336242['shift']());}catch(_0x3901ef){_0x336242['push'](_0x336242['shift']());}}}(_0x4d62,0x18bfd));function _0x4155(_0x251677,_0x540f6){_0x251677=_0x251677-0x1de;const _0x4d62f2=_0x4d62();let _0x415553=_0x4d62f2[_0x251677];return _0x415553;}export function patchChannelPluginRuntimeFromSource(_0x4e3439,_0x194624={}){const _0x586550=_0x4155,_0x307643=_0x194624['runtimeC'+_0x586550(0x1e1)+_0x586550(0x25a)];if(!_0x307643)return{'patched':![],'reason':_0x586550(0x287)+_0x586550(0x1de)+_0x586550(0x25e)+_0x586550(0x230)+_0x586550(0x23f)};if(_0x4e3439[_0x586550(0x261)](_0x586550(0x22a)+_0x586550(0x22d)+_0x586550(0x1f3)+'l')){if(_0x4e3439[_0x586550(0x261)](_0x586550(0x217)+'istingCh'+_0x586550(0x227)+_0x586550(0x239))&&hasRuntimeChannelImport(_0x4e3439,_0x307643))return{'patched':![],'reason':'already-'+_0x586550(0x27b)};return patchExistingChannelPluginRuntimeFromSource(_0x4e3439,{'runtimeChannelImportPath':_0x307643});}if(_0x4e3439[_0x586550(0x261)]('wujieCha'+_0x586550(0x256)+_0x586550(0x212)+'se'))return patchExistingChannelPluginRuntimeFromSource(_0x4e3439,{'runtimeChannelImportPath':_0x307643});const _0x24f80b='\x09\x09let\x20re'+_0x586550(0x20c)+_0x586550(0x273)+_0x586550(0x24d)+_0x586550(0x280)+_0x586550(0x24f)+_0x586550(0x1e5)+_0x586550(0x231)+_0x586550(0x232)+_0x586550(0x224)+_0x586550(0x252)+_0x586550(0x247)+'atePlugi'+'nRuntime'+_0x586550(0x271)+_0x586550(0x22e)+_0x586550(0x22b)+_0x586550(0x26d)+_0x586550(0x206)+'solvedRu'+_0x586550(0x27e)+_0x586550(0x277);if(!_0x4e3439[_0x586550(0x261)](_0x24f80b))return{'patched':![],'reason':_0x586550(0x254)+'d'};const _0x141069=_0x586550(0x226)+_0x586550(0x26b)+'ash\x20}\x20fr'+'om\x20\x22node'+':crypto\x22'+';';if(!_0x4e3439[_0x586550(0x261)](_0x141069))return{'patched':![],'reason':_0x586550(0x25e)+'ot-found'};const _0x30dab8=_0x586550(0x229)+_0x586550(0x20c)+_0x586550(0x273)+_0x586550(0x24d)+_0x586550(0x22f)+_0x586550(0x204)+_0x586550(0x20d)+_0x586550(0x21a)+_0x586550(0x211)+'\x20(runtim'+_0x586550(0x221)+_0x586550(0x23d)+_0x586550(0x1e6)+_0x586550(0x208)+_0x586550(0x207)+_0x586550(0x1e4)+_0x586550(0x266)+'return\x20r'+_0x586550(0x1f2)+_0x586550(0x1df)+_0x586550(0x267)+_0x586550(0x236)+_0x586550(0x269)+'n\x20&&\x20run'+_0x586550(0x24a)+_0x586550(0x20b)+'bound?.r'+_0x586550(0x21c)+_0x586550(0x1f0)+_0x586550(0x244)+_0x586550(0x238)+_0x586550(0x256)+_0x586550(0x202)+_0x586550(0x240)+'eRuntime'+_0x586550(0x27f)+');\x0a\x09\x09\x09co'+'nst\x20exis'+'tingChan'+_0x586550(0x1fe)+_0x586550(0x279)+_0x586550(0x1ec)+_0x586550(0x242)+_0x586550(0x289)+'channel\x20'+_0x586550(0x1e9)+_0x586550(0x1e2)+_0x586550(0x267)+'hannel\x20:'+_0x586550(0x1f5)+_0x586550(0x289)+_0x586550(0x246)+_0x586550(0x249)+_0x586550(0x263)+_0x586550(0x1f9)+_0x586550(0x25c)+_0x586550(0x20a)+_0x586550(0x215)+_0x586550(0x1f4)+'untimeCo'+'ntexts:\x20'+_0x586550(0x203)+'Channel.'+_0x586550(0x25b)+_0x586550(0x1fb)+_0x586550(0x25f)+_0x586550(0x1f9)+_0x586550(0x235)+_0x586550(0x1f6)+'s,\x0a\x09\x09\x09\x09i'+_0x586550(0x1eb)+_0x586550(0x203)+'Channel.'+'inbound\x20'+_0x586550(0x25f)+_0x586550(0x1f9)+_0x586550(0x213)+_0x586550(0x251)+_0x586550(0x257)+'stingCha'+_0x586550(0x241)+_0x586550(0x225)+_0x586550(0x243)+_0x586550(0x216)+_0x586550(0x1ea)+_0x586550(0x1fa)+_0x586550(0x1ff)+_0x586550(0x205)+_0x586550(0x20f)+_0x586550(0x1e3)+_0x586550(0x201)+'\x09\x09\x09reply'+':\x20existi'+_0x586550(0x215)+_0x586550(0x220)+_0x586550(0x25f)+'elRuntim'+_0x586550(0x253)+_0x586550(0x214)+_0x586550(0x21d)+_0x586550(0x1e7)+_0x586550(0x21b)+'ssion\x20??'+_0x586550(0x22c)+'Runtime.'+'session\x0a'+_0x586550(0x218)+_0x586550(0x237)+_0x586550(0x210)+_0x586550(0x23e)+_0x586550(0x280)+_0x586550(0x24f)+_0x586550(0x1e5)+_0x586550(0x231)+_0x586550(0x232)+_0x586550(0x224)+_0x586550(0x1f8)+_0x586550(0x204)+_0x586550(0x20d)+_0x586550(0x21a)+'elpers(r'+_0x586550(0x26f)+'eatePlug'+_0x586550(0x1e0)+'e()(opti'+('ons.runt'+_0x586550(0x21f)+_0x586550(0x1ed)+_0x586550(0x237)+_0x586550(0x23a)+_0x586550(0x24e)+'\x0a\x09\x09};');return{'patched':!![],'source':_0x4e3439[_0x586550(0x278)](_0x141069,_0x141069+'\x0a'+createRuntimeChannelImport(_0x307643))[_0x586550(0x278)](_0x24f80b,_0x30dab8)};}function patchExistingChannelPluginRuntimeFromSource(_0x5c0f2a,_0x4be685){const _0x23d937=_0x4155,{runtimeChannelImportPath:_0x1865e8}=_0x4be685,_0x18e1f3='import\x20{'+_0x23d937(0x26b)+_0x23d937(0x268)+_0x23d937(0x284)+_0x23d937(0x26c)+';';if(!_0x5c0f2a[_0x23d937(0x261)](_0x18e1f3))return{'patched':![],'reason':_0x23d937(0x25e)+_0x23d937(0x260)};const _0x3a815b='\x09\x09let\x20re'+'solvedRu'+'ntime\x20=\x20'+_0x23d937(0x1fd),_0x1af79a=_0x23d937(0x21e)+_0x23d937(0x219)+_0x23d937(0x27d)+_0x23d937(0x282)+'Set\x20=\x20ne'+'w\x20Set(LA'+_0x23d937(0x250)+_0x23d937(0x209)+_0x23d937(0x23b)+_0x23d937(0x276),_0x36a17d=_0x5c0f2a[_0x23d937(0x1fc)](_0x3a815b),_0x3706ef=_0x5c0f2a[_0x23d937(0x1fc)](_0x1af79a,_0x36a17d);if(_0x36a17d===-0x1||_0x3706ef===-0x1)return{'patched':![],'reason':_0x23d937(0x254)+'d'};const _0x55c2b2=_0x23d937(0x229)+_0x23d937(0x20c)+_0x23d937(0x273)+_0x23d937(0x24d)+_0x23d937(0x22f)+_0x23d937(0x204)+'eChannel'+_0x23d937(0x21a)+_0x23d937(0x211)+_0x23d937(0x264)+'e)\x20=>\x20{\x0a'+_0x23d937(0x23d)+_0x23d937(0x1e6)+_0x23d937(0x208)+_0x23d937(0x207)+_0x23d937(0x1e4)+'bject\x22)\x20'+_0x23d937(0x281)+_0x23d937(0x1f2)+_0x23d937(0x1df)+_0x23d937(0x267)+_0x23d937(0x236)+_0x23d937(0x269)+_0x23d937(0x283)+_0x23d937(0x24a)+_0x23d937(0x20b)+_0x23d937(0x23c)+_0x23d937(0x21c)+_0x23d937(0x1f0)+'me;\x0a\x09\x09\x09c'+'onst\x20cha'+_0x23d937(0x256)+_0x23d937(0x202)+_0x23d937(0x240)+_0x23d937(0x248)+_0x23d937(0x27f)+_0x23d937(0x223)+_0x23d937(0x27c)+'tingChan'+'nel\x20=\x20ru'+_0x23d937(0x279)+'annel\x20&&'+'\x20typeof\x20'+_0x23d937(0x289)+_0x23d937(0x246)+'===\x20\x22obj'+_0x23d937(0x1e2)+_0x23d937(0x267)+_0x23d937(0x20e)+'\x20{};\x0a\x09\x09\x09'+_0x23d937(0x289)+_0x23d937(0x246)+_0x23d937(0x249)+_0x23d937(0x263)+_0x23d937(0x1f9)+_0x23d937(0x25c)+'..existi'+'ngChanne'+'l,\x0a\x09\x09\x09\x09r'+'untimeCo'+_0x23d937(0x1f1)+_0x23d937(0x203)+_0x23d937(0x272)+_0x23d937(0x25b)+_0x23d937(0x1fb)+_0x23d937(0x25f)+_0x23d937(0x1f9)+_0x23d937(0x235)+'eContext'+_0x23d937(0x258)+_0x23d937(0x1eb)+_0x23d937(0x203)+_0x23d937(0x272)+'inbound\x20'+_0x23d937(0x25f)+_0x23d937(0x1f9)+'e.inboun'+_0x23d937(0x251)+_0x23d937(0x257)+'stingCha'+_0x23d937(0x241)+_0x23d937(0x225)+'stingCha'+_0x23d937(0x216)+_0x23d937(0x1ea)+_0x23d937(0x1fa)+_0x23d937(0x1ff)+_0x23d937(0x205)+_0x23d937(0x20f)+'ntime.in'+'bound,\x0a\x09'+'\x09\x09\x09reply'+':\x20existi'+_0x23d937(0x215)+_0x23d937(0x220)+'??\x20chann'+_0x23d937(0x1f9)+_0x23d937(0x253)+_0x23d937(0x214)+_0x23d937(0x21d)+_0x23d937(0x1e7)+_0x23d937(0x21b)+_0x23d937(0x285)+_0x23d937(0x22c)+_0x23d937(0x233)+_0x23d937(0x24b)+'\x09\x09\x09};\x0a\x09\x09'+_0x23d937(0x237)+_0x23d937(0x210)+_0x23d937(0x23e)+_0x23d937(0x280)+'solveRun'+_0x23d937(0x1e5)+_0x23d937(0x231)+_0x23d937(0x232)+_0x23d937(0x224)+'e\x20??=\x20en'+'sureWuji'+_0x23d937(0x20d)+_0x23d937(0x21a)+_0x23d937(0x1ef)+_0x23d937(0x26f)+_0x23d937(0x259)+'inRuntim'+_0x23d937(0x228)+(_0x23d937(0x222)+_0x23d937(0x21f)+_0x23d937(0x1ed)+_0x23d937(0x237)+'resolved'+'Runtime;'+_0x23d937(0x1f7)),_0x4242d8=_0x5c0f2a['slice'](0x0,_0x36a17d)+_0x55c2b2+_0x5c0f2a[_0x23d937(0x245)](_0x3706ef);return{'patched':!![],'source':ensureRuntimeChannelImport(_0x4242d8,{'importMarker':_0x18e1f3,'runtimeChannelImportPath':_0x1865e8})};}function createRuntimeChannelImport(_0x11ed16){const _0x32259a=_0x4155;return'import\x20{'+_0x32259a(0x26a)+_0x32259a(0x265)+_0x32259a(0x25d)+_0x32259a(0x26e)+_0x32259a(0x288)+_0x32259a(0x286)+_0x32259a(0x1e8)+'m\x20\x22'+_0x11ed16+'\x22;';}function hasRuntimeChannelImport(_0x153cb9,_0x3c6a2b){const _0x23cf7b=_0x4155;return _0x153cb9[_0x23cf7b(0x261)](createRuntimeChannelImport(_0x3c6a2b));}function ensureRuntimeChannelImport(_0x476b73,{importMarker:_0x4dc3ab,runtimeChannelImportPath:_0x401839}){const _0x28c5e7=_0x4155,_0x416928=createRuntimeChannelImport(_0x401839),_0x5ba723=/import \{ createRuntimeChannel as wujieCreateRuntimeChannel \} from "\.\/runtime-channel-[^"]+\.js";\n?/;if(_0x5ba723[_0x28c5e7(0x262)](_0x476b73))return _0x476b73[_0x28c5e7(0x278)](_0x5ba723,_0x416928+'\x0a');return _0x476b73['replace'](_0x4dc3ab,_0x4dc3ab+'\x0a'+_0x416928);}
|
|
1
|
+
(function(_0x1f3bae,_0x11f0d3){const _0xaf9ded=_0x1bf6,_0x2bc8c9=_0x1f3bae();while(!![]){try{const _0x1f7247=parseInt(_0xaf9ded(0x118))/0x1*(-parseInt(_0xaf9ded(0x12c))/0x2)+-parseInt(_0xaf9ded(0x15c))/0x3*(-parseInt(_0xaf9ded(0x127))/0x4)+-parseInt(_0xaf9ded(0x168))/0x5*(parseInt(_0xaf9ded(0x150))/0x6)+parseInt(_0xaf9ded(0x123))/0x7+parseInt(_0xaf9ded(0x194))/0x8+parseInt(_0xaf9ded(0x12b))/0x9*(-parseInt(_0xaf9ded(0x18d))/0xa)+-parseInt(_0xaf9ded(0x178))/0xb*(parseInt(_0xaf9ded(0x161))/0xc);if(_0x1f7247===_0x11f0d3)break;else _0x2bc8c9['push'](_0x2bc8c9['shift']());}catch(_0x974f5b){_0x2bc8c9['push'](_0x2bc8c9['shift']());}}}(_0x34ca,0x99256));export function patchChannelPluginRuntimeFromSource(_0x197baf,_0x9da827={}){const _0x30f22d=_0x1bf6,_0x2ef50b=_0x9da827['runtimeC'+_0x30f22d(0x17c)+_0x30f22d(0x17a)];if(!_0x2ef50b)return{'patched':![],'reason':_0x30f22d(0x1a2)+_0x30f22d(0x10c)+_0x30f22d(0x15a)+_0x30f22d(0x171)+_0x30f22d(0x121)};if(_0x197baf[_0x30f22d(0x13a)](_0x30f22d(0x11c)+_0x30f22d(0x126)+_0x30f22d(0x124)+'l')){if(_0x197baf[_0x30f22d(0x13a)](_0x30f22d(0x183)+_0x30f22d(0x157)+_0x30f22d(0x186)+_0x30f22d(0x15e))&&hasRuntimeChannelImport(_0x197baf,_0x2ef50b))return{'patched':![],'reason':_0x30f22d(0x167)+_0x30f22d(0x14a)};return patchExistingChannelPluginRuntimeFromSource(_0x197baf,{'runtimeChannelImportPath':_0x2ef50b});}if(_0x197baf[_0x30f22d(0x13a)](_0x30f22d(0x13e)+_0x30f22d(0x188)+'imePromi'+'se'))return patchExistingChannelPluginRuntimeFromSource(_0x197baf,{'runtimeChannelImportPath':_0x2ef50b});const _0x950e7c=_0x30f22d(0x108)+_0x30f22d(0x162)+_0x30f22d(0x1a4)+'null;\x0a\x09\x09'+'const\x20re'+_0x30f22d(0x16d)+'time\x20=\x20('+')\x20=>\x20{\x0a\x09'+_0x30f22d(0x133)+_0x30f22d(0x11d)+_0x30f22d(0x165)+_0x30f22d(0x147)+_0x30f22d(0x125)+_0x30f22d(0x141)+_0x30f22d(0x10f)+_0x30f22d(0x12a)+'meOption'+'s);\x0a\x09\x09\x09r'+_0x30f22d(0x17d)+_0x30f22d(0x162)+_0x30f22d(0x114)+_0x30f22d(0x104);if(!_0x197baf[_0x30f22d(0x13a)](_0x950e7c))return{'patched':![],'reason':'not-foun'+'d'};const _0x1df79c=_0x30f22d(0x19d)+_0x30f22d(0x189)+'ash\x20}\x20fr'+_0x30f22d(0x1a3)+_0x30f22d(0x148)+';';if(!_0x197baf[_0x30f22d(0x13a)](_0x1df79c))return{'patched':![],'reason':'import-n'+'ot-found'};const _0x9da67d='\x09\x09let\x20re'+_0x30f22d(0x162)+'ntime\x20=\x20'+_0x30f22d(0x199)+_0x30f22d(0x145)+_0x30f22d(0x1a5)+_0x30f22d(0x164)+_0x30f22d(0x16e)+_0x30f22d(0x18f)+'\x20(runtim'+_0x30f22d(0x182)+'\x09\x09\x09if\x20(!'+'runtime\x20'+_0x30f22d(0x177)+'f\x20runtim'+_0x30f22d(0x17f)+_0x30f22d(0x15d)+_0x30f22d(0x163)+_0x30f22d(0x105)+'\x09\x09\x09if\x20(r'+_0x30f22d(0x1a7)+_0x30f22d(0x113)+_0x30f22d(0x196)+_0x30f22d(0x16a)+_0x30f22d(0x13c)+_0x30f22d(0x112)+'bound?.r'+_0x30f22d(0x116)+_0x30f22d(0x140)+'me;\x0a\x09\x09\x09c'+_0x30f22d(0x142)+_0x30f22d(0x188)+_0x30f22d(0x134)+_0x30f22d(0x111)+_0x30f22d(0x197)+_0x30f22d(0x14e)+_0x30f22d(0x12f)+_0x30f22d(0x1a8)+'tingChan'+_0x30f22d(0x16f)+_0x30f22d(0x117)+_0x30f22d(0x179)+'\x20typeof\x20'+_0x30f22d(0x119)+_0x30f22d(0x152)+_0x30f22d(0x10a)+_0x30f22d(0x159)+_0x30f22d(0x1a7)+'hannel\x20:'+'\x20{};\x0a\x09\x09\x09'+'runtime.'+_0x30f22d(0x152)+_0x30f22d(0x14b)+_0x30f22d(0x181)+'elRuntim'+_0x30f22d(0x160)+_0x30f22d(0x19f)+_0x30f22d(0x172)+_0x30f22d(0x106)+_0x30f22d(0x136)+_0x30f22d(0x11a)+_0x30f22d(0x153)+_0x30f22d(0x18b)+'runtimeC'+_0x30f22d(0x103)+_0x30f22d(0x155)+_0x30f22d(0x1ab)+_0x30f22d(0x19e)+_0x30f22d(0x192)+'s,\x0a\x09\x09\x09\x09i'+_0x30f22d(0x10d)+_0x30f22d(0x153)+_0x30f22d(0x18b)+_0x30f22d(0x130)+_0x30f22d(0x155)+_0x30f22d(0x1ab)+'e.inboun'+_0x30f22d(0x176)+'urn:\x20exi'+_0x30f22d(0x19a)+_0x30f22d(0x17e)+_0x30f22d(0x1a6)+_0x30f22d(0x19a)+_0x30f22d(0x190)+'ound\x20??\x20'+_0x30f22d(0x131)+_0x30f22d(0x16b)+'urn\x20??\x20c'+_0x30f22d(0x13d)+_0x30f22d(0x135)+_0x30f22d(0x115)+'\x09\x09\x09reply'+':\x20existi'+_0x30f22d(0x172)+_0x30f22d(0x13b)+_0x30f22d(0x155)+_0x30f22d(0x1ab)+_0x30f22d(0x180)+_0x30f22d(0x137)+_0x30f22d(0x18a)+_0x30f22d(0x157)+_0x30f22d(0x1aa)+_0x30f22d(0x122)+_0x30f22d(0x175)+_0x30f22d(0x120)+_0x30f22d(0x11b)+'\x09\x09\x09};\x0a\x09\x09'+_0x30f22d(0x16c)+'runtime;'+_0x30f22d(0x144)+'const\x20re'+_0x30f22d(0x16d)+'time\x20=\x20('+')\x20=>\x20{\x0a\x09'+'\x09\x09resolv'+_0x30f22d(0x11d)+_0x30f22d(0x1a0)+_0x30f22d(0x1a5)+_0x30f22d(0x164)+_0x30f22d(0x16e)+_0x30f22d(0x129)+_0x30f22d(0x18e)+_0x30f22d(0x19b)+'inRuntim'+'e()(opti'+(_0x30f22d(0x14d)+_0x30f22d(0x170)+_0x30f22d(0x191)+_0x30f22d(0x16c)+_0x30f22d(0x154)+_0x30f22d(0x198)+'\x0a\x09\x09};');return{'patched':!![],'source':_0x197baf[_0x30f22d(0x169)](_0x1df79c,_0x1df79c+'\x0a'+createRuntimeChannelImport(_0x2ef50b))[_0x30f22d(0x169)](_0x950e7c,_0x9da67d)};}function patchExistingChannelPluginRuntimeFromSource(_0x22ba96,_0x2e7994){const _0x53036f=_0x1bf6,{runtimeChannelImportPath:_0x4fd2d5}=_0x2e7994,_0x20d7d6=_0x53036f(0x19d)+_0x53036f(0x189)+'ash\x20}\x20fr'+'om\x20\x22node'+_0x53036f(0x148)+';';if(!_0x22ba96[_0x53036f(0x13a)](_0x20d7d6))return{'patched':![],'reason':_0x53036f(0x15a)+_0x53036f(0x185)};const _0x1b9389=_0x53036f(0x108)+_0x53036f(0x162)+_0x53036f(0x1a4)+_0x53036f(0x184),_0x5d5970=_0x53036f(0x146)+_0x53036f(0x143)+_0x53036f(0x14c)+'ctionKey'+_0x53036f(0x156)+_0x53036f(0x1a9)+_0x53036f(0x173)+_0x53036f(0x15b)+_0x53036f(0x174)+'YS);',_0x4d1b4b=_0x22ba96[_0x53036f(0x13f)](_0x1b9389),_0x306b9b=_0x22ba96[_0x53036f(0x13f)](_0x5d5970,_0x4d1b4b);if(_0x4d1b4b===-0x1||_0x306b9b===-0x1)return{'patched':![],'reason':'not-foun'+'d'};const _0x4a939e=_0x53036f(0x108)+_0x53036f(0x162)+_0x53036f(0x1a4)+'null;\x0a\x09\x09'+_0x53036f(0x145)+'sureWuji'+_0x53036f(0x164)+_0x53036f(0x16e)+_0x53036f(0x18f)+_0x53036f(0x132)+_0x53036f(0x182)+_0x53036f(0x10b)+'runtime\x20'+_0x53036f(0x177)+_0x53036f(0x151)+_0x53036f(0x17f)+'bject\x22)\x20'+_0x53036f(0x163)+_0x53036f(0x105)+_0x53036f(0x18c)+_0x53036f(0x1a7)+_0x53036f(0x113)+'turn?.ru'+'n\x20&&\x20run'+_0x53036f(0x13c)+_0x53036f(0x112)+_0x53036f(0x15f)+_0x53036f(0x116)+_0x53036f(0x140)+'me;\x0a\x09\x09\x09c'+_0x53036f(0x142)+_0x53036f(0x188)+_0x53036f(0x134)+'jieCreat'+'eRuntime'+'Channel('+_0x53036f(0x12f)+_0x53036f(0x1a8)+_0x53036f(0x12e)+_0x53036f(0x16f)+_0x53036f(0x117)+_0x53036f(0x179)+'\x20typeof\x20'+_0x53036f(0x119)+_0x53036f(0x152)+'===\x20\x22obj'+'ect\x22\x20?\x20r'+'untime.c'+_0x53036f(0x109)+_0x53036f(0x1a1)+_0x53036f(0x119)+'channel\x20'+_0x53036f(0x14b)+_0x53036f(0x181)+'elRuntim'+_0x53036f(0x160)+_0x53036f(0x19f)+_0x53036f(0x172)+_0x53036f(0x106)+_0x53036f(0x136)+_0x53036f(0x11a)+'existing'+_0x53036f(0x18b)+_0x53036f(0x10e)+_0x53036f(0x103)+_0x53036f(0x155)+_0x53036f(0x1ab)+_0x53036f(0x19e)+_0x53036f(0x192)+_0x53036f(0x17b)+'nbound:\x20'+_0x53036f(0x153)+_0x53036f(0x18b)+_0x53036f(0x130)+'??\x20chann'+_0x53036f(0x1ab)+_0x53036f(0x149)+'d,\x0a\x09\x09\x09\x09t'+'urn:\x20exi'+_0x53036f(0x19a)+_0x53036f(0x17e)+'n\x20??\x20exi'+_0x53036f(0x19a)+_0x53036f(0x190)+_0x53036f(0x12d)+'channelR'+_0x53036f(0x16b)+_0x53036f(0x195)+_0x53036f(0x13d)+'ntime.in'+'bound,\x0a\x09'+'\x09\x09\x09reply'+':\x20existi'+_0x53036f(0x172)+'l.reply\x20'+_0x53036f(0x155)+_0x53036f(0x1ab)+_0x53036f(0x180)+_0x53036f(0x137)+_0x53036f(0x18a)+_0x53036f(0x157)+_0x53036f(0x1aa)+'ssion\x20??'+'\x20channel'+_0x53036f(0x120)+_0x53036f(0x11b)+_0x53036f(0x128)+_0x53036f(0x16c)+_0x53036f(0x107)+_0x53036f(0x144)+_0x53036f(0x19c)+_0x53036f(0x16d)+_0x53036f(0x158)+_0x53036f(0x193)+'\x09\x09resolv'+_0x53036f(0x11d)+'e\x20??=\x20en'+_0x53036f(0x1a5)+_0x53036f(0x164)+_0x53036f(0x16e)+_0x53036f(0x129)+_0x53036f(0x18e)+_0x53036f(0x19b)+'inRuntim'+'e()(opti'+(_0x53036f(0x14d)+'imeOptio'+_0x53036f(0x191)+_0x53036f(0x16c)+_0x53036f(0x154)+'Runtime;'+_0x53036f(0x14f)),_0x56aa27=_0x22ba96[_0x53036f(0x139)](0x0,_0x4d1b4b)+_0x4a939e+_0x22ba96['slice'](_0x306b9b);return{'patched':!![],'source':ensureRuntimeChannelImport(_0x56aa27,{'importMarker':_0x20d7d6,'runtimeChannelImportPath':_0x4fd2d5})};}function _0x1bf6(_0x270152,_0x38dc45){_0x270152=_0x270152-0x103;const _0x34ca72=_0x34ca();let _0x1bf6bd=_0x34ca72[_0x270152];return _0x1bf6bd;}function createRuntimeChannelImport(_0x26edc1){const _0x291f33=_0x1bf6;return _0x291f33(0x19d)+_0x291f33(0x11f)+'untimeCh'+_0x291f33(0x138)+_0x291f33(0x187)+'eateRunt'+'imeChann'+_0x291f33(0x11e)+_0x291f33(0x166)+_0x26edc1+'\x22;';}function hasRuntimeChannelImport(_0x23d192,_0x184081){const _0x303abe=_0x1bf6;return _0x23d192[_0x303abe(0x13a)](createRuntimeChannelImport(_0x184081));}function ensureRuntimeChannelImport(_0x35d066,{importMarker:_0x46f3ca,runtimeChannelImportPath:_0x4dfe10}){const _0x1a4bad=_0x1bf6,_0x35d869=createRuntimeChannelImport(_0x4dfe10),_0x3bd68f=/import \{ createRuntimeChannel as wujieCreateRuntimeChannel \} from "\.\/runtime-channel-[^"]+\.js";\n?/;if(_0x3bd68f[_0x1a4bad(0x110)](_0x35d066))return _0x35d066[_0x1a4bad(0x169)](_0x3bd68f,_0x35d869+'\x0a');return _0x35d066['replace'](_0x46f3ca,_0x46f3ca+'\x0a'+_0x35d869);}function _0x34ca(){const _0x4b2a95=['elpers(r','ns.runti','3933ovrvoz','934942KKxseF','ound\x20??\x20','tingChan',');\x0a\x09\x09\x09co','inbound\x20','channelR','\x20(runtim','\x09\x09resolv','ime\x20=\x20wu','ntime.in','untimeCo','\x0a\x09\x09\x09\x09ses','annel\x20as','slice','includes','l.reply\x20','time.cha','hannelRu','wujieCha','indexOf','rn\x20runti','nRuntime','onst\x20cha','lazyRunt','\x0a\x09\x09};\x0a\x09\x09','const\x20en','\x09\x09const\x20','solveCre',':crypto\x22','e.inboun','patched','=\x20{\x0a\x09\x09\x09\x09','imeRefle','ons.runt','Channel(','\x0a\x09\x09};\x0a','6piFuRy','f\x20runtim','channel\x20','existing','resolved','??\x20chann','Set\x20=\x20ne','istingCh','time\x20=\x20(','ect\x22\x20?\x20r','import-n','ME_REFLE','1905tNPHTr','bject\x22)\x20','rn\x20??','bound?.r','e,\x0a\x09\x09\x09\x09.','12IOYaRF','solvedRu','return\x20r','eChannel','e\x20??=\x20re','m\x20\x22','already-','1041245CACFBD','replace','n\x20&&\x20run','untime.t','\x09return\x20','solveRun','RuntimeH','nel\x20=\x20ru','imeOptio','ot-provi','ngChanne','ZY_RUNTI','CTION_KE','\x20channel','d,\x0a\x09\x09\x09\x09t','||\x20typeo','23593867SHbpbm','annel\x20&&','portPath','s,\x0a\x09\x09\x09\x09i','hannelIm','eturn\x20re','nnel.tur','e\x20!==\x20\x22o','e.reply,','...chann','e)\x20=>\x20{\x0a','turn:\x20ex','null;','ot-found','annel.tu','\x20wujieCr','nnelRunt','\x20createH','sion:\x20ex','Channel.','\x09\x09\x09if\x20(r','1320iAiaWa','esolveCr','elpers\x20=','nnel.inb','ns));\x0a\x09\x09','eContext',')\x20=>\x20{\x0a\x09','9508120Ipezzd','urn\x20??\x20c','turn?.ru','eRuntime','Runtime;','null;\x0a\x09\x09','stingCha','eatePlug','const\x20re','import\x20{','e.runtim','..existi','e\x20??=\x20en','\x20{};\x0a\x09\x09\x09','runtime-','om\x20\x22node','ntime\x20=\x20','sureWuji','n\x20??\x20exi','untime.c','nst\x20exis','w\x20Set(LA','annel.se','elRuntim','ontexts\x20','\x09};','untime;\x0a','l,\x0a\x09\x09\x09\x09r','runtime;','\x09\x09let\x20re','hannel\x20:','===\x20\x22obj','\x09\x09\x09if\x20(!','channel-','nbound:\x20','runtimeC','()(optio','test','jieCreat','nnel?.in','hannel?.','ntime;\x0a\x09','bound,\x0a\x09','un)\x20retu','ntime.ch','1WUCfeM','runtime.','ntexts:\x20','session\x0a','wujieCre','edRuntim','el\x20}\x20fro','\x20createR','Runtime.','ded','ssion\x20??','8142939iCOxVd','meChanne','atePlugi','ateRunti','7268iyoEpC','\x09\x09\x09};\x0a\x09\x09'];_0x34ca=function(){return _0x4b2a95;};return _0x34ca();}
|