@wujie-shell/core 4.0.0 → 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 _0x38e6be=_0xfe4b;(function(_0x1881a2,_0x42cb06){const _0x5b5a14=_0xfe4b,_0x36beb8=_0x1881a2();while(!![]){try{const _0x25462e=parseInt(_0x5b5a14(0x282))/0x1+parseInt(_0x5b5a14(0x2cc))/0x2*(parseInt(_0x5b5a14(0x1ce))/0x3)+parseInt(_0x5b5a14(0x20f))/0x4+-parseInt(_0x5b5a14(0x2de))/0x5*(parseInt(_0x5b5a14(0x28a))/0x6)+-parseInt(_0x5b5a14(0x32a))/0x7*(-parseInt(_0x5b5a14(0x331))/0x8)+-parseInt(_0x5b5a14(0x25e))/0x9+parseInt(_0x5b5a14(0x34c))/0xa;if(_0x25462e===_0x42cb06)break;else _0x36beb8['push'](_0x36beb8['shift']());}catch(_0x5c841f){_0x36beb8['push'](_0x36beb8['shift']());}}}(_0x21fa,0xae782));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=_0x38e6be(0x369)+_0x38e6be(0x32e),MANIFEST_NAME=_0x38e6be(0x33f)+_0x38e6be(0x22f)+_0x38e6be(0x21d),NPM_INSTALL_TIMEOUT_MS=0xf*0x3c*0x3e8;export function resolveRuntimeRoot(_0x163593){if(process.env.WUJIE_SHELL_RUNTIME_ROOT)return resolve(process.env.WUJIE_SHELL_RUNTIME_ROOT);return resolve(_0x163593,RUNTIME_DIR);}export function resolveManifestPath(_0x35ed60){return join(_0x35ed60,MANIFEST_NAME);}async function loadProductRuntime(_0x24f47e,_0x1728b4){const _0x327551=_0x38e6be,_0x5827c6=[join(_0x24f47e,_0x327551(0x34d)+_0x327551(0x30b),'index.mj'+'s'),join(_0x1728b4,_0x327551(0x34d)+_0x327551(0x30b),_0x327551(0x288)+'s')];for(const _0x4749ab of _0x5827c6){if(!existsSync(_0x4749ab))continue;return await import(pathToFileURL(_0x4749ab)[_0x327551(0x1cd)]+_0x327551(0x2ce)+Date[_0x327551(0x267)]());}return{};}export async function prepareRuntime(_0x412386,{syncOnly:syncOnly=![]}={}){const _0x177071=_0x38e6be,_0x1b7761=resolveRuntimeRoot(_0x412386['projectR'+_0x177071(0x211)]),_0x2b1bde=createRuntimeLogger(getConfigPaths(_0x412386),_0x177071(0x1eb)),_0x20a085=Date[_0x177071(0x267)]();_0x2b1bde?.[_0x177071(0x204)]('prepare\x20'+'runtime\x20'+_0x177071(0x2fd),{'syncOnly':syncOnly,'runtimeRoot':_0x1b7761,'shellConfig':summarizeShellConfig(_0x412386)});try{const _0x4fd903=await ensureRuntimeBase(_0x412386,_0x1b7761,{'runtimeLogger':_0x2b1bde,'syncOnly':syncOnly});_0x2b1bde?.[_0x177071(0x204)](_0x177071(0x28f)+_0x177071(0x22f)+_0x177071(0x233),{'manifestPath':resolveManifestPath(_0x1b7761),'manifest':summarizeRuntimeManifest(_0x4fd903)}),validateRuntimeNodeVersion(_0x4fd903,_0x412386),_0x2b1bde?.[_0x177071(0x204)](_0x177071(0x28f)+_0x177071(0x212)+'sion\x20val'+_0x177071(0x189),{'nodeVersion':_0x4fd903[_0x177071(0x2b1)+_0x177071(0x196)]});if(syncOnly)validateRuntimeOpenClawVersion(_0x4fd903,_0x412386),_0x2b1bde?.[_0x177071(0x204)]('runtime\x20'+_0x177071(0x17d)+_0x177071(0x1d8)+_0x177071(0x358)+'ed',{'openclawVersion':_0x4fd903[_0x177071(0x17d)+'Version']});else{if(_0x4fd903[_0x177071(0x17d)+_0x177071(0x34e)]!==_0x412386[_0x177071(0x17d)][_0x177071(0x17d)+_0x177071(0x34e)]){const _0x5adcb1=await loadRuntimeInfo(_0x412386[_0x177071(0x1d6)+_0x177071(0x211)]);_0x2b1bde?.[_0x177071(0x204)]('openclaw'+_0x177071(0x1c3)+'\x20install'+_0x177071(0x31d),{'fromVersion':_0x4fd903[_0x177071(0x17d)+'Version']||_0x177071(0x35f),'toVersion':_0x412386[_0x177071(0x17d)]['openclaw'+_0x177071(0x34e)]}),await installOpenClawPackage(_0x5adcb1,_0x412386[_0x177071(0x17d)][_0x177071(0x17d)+_0x177071(0x34e)]),_0x4fd903[_0x177071(0x17d)+_0x177071(0x34e)]=_0x412386[_0x177071(0x17d)]['openclaw'+'Version'],_0x2b1bde?.['info'](_0x177071(0x17d)+_0x177071(0x1c3)+_0x177071(0x1ac)+_0x177071(0x1fb)+'ed',{'openclawVersion':_0x4fd903[_0x177071(0x17d)+_0x177071(0x34e)]});}}_0x4fd903[_0x177071(0x1a9)+_0x177071(0x2a4)]=new Date()[_0x177071(0x2d3)+'ing'](),_0x4fd903[_0x177071(0x2b1)+_0x177071(0x196)]=_0x412386['openclaw'][_0x177071(0x2b1)+'ion'],_0x4fd903[_0x177071(0x2d9)]={'appId':_0x412386[_0x177071(0x235)],'productName':_0x412386[_0x177071(0x2d1)+'ame'],'dataDirName':_0x412386['dataDirN'+_0x177071(0x290)]},await patchChatHistoryMixedToolContentBug(_0x1b7761,_0x4fd903,{'runtimeLogger':_0x2b1bde}),await patchChannelPluginRuntimeBug(_0x1b7761,_0x4fd903,{'runtimeLogger':_0x2b1bde});const _0x574920=await loadProductRuntime(_0x412386[_0x177071(0x1d6)+'oot'],_0x1b7761);if(typeof _0x574920['prepareP'+'roductRu'+_0x177071(0x30b)]===_0x177071(0x353)){const _0x2dbbcd=createRuntimeInfoFromManifest(_0x1b7761,_0x4fd903);await _0x574920[_0x177071(0x2a8)+_0x177071(0x324)+_0x177071(0x30b)]({'shellConfig':_0x412386,'runtime':_0x2dbbcd,'runtimeLogger':_0x2b1bde,'syncOnly':syncOnly}),_0x2b1bde?.[_0x177071(0x204)](_0x177071(0x340)+_0x177071(0x28f)+_0x177071(0x2a5)+_0x177071(0x2af));}await patchSessionStoreSqliteRuntime(_0x1b7761,_0x4fd903,{'runtimeLogger':_0x2b1bde});!syncOnly&&(await hasConfiguredKdocsSkill(_0x412386)?(await installKdocsCliBinary(_0x412386,createRuntimeInfoFromManifest(_0x1b7761,_0x4fd903),{'runtimeLogger':_0x2b1bde,'syncOnly':syncOnly}),_0x2b1bde?.[_0x177071(0x204)](_0x177071(0x30c)+_0x177071(0x25c)+_0x177071(0x252)+_0x177071(0x201))):_0x2b1bde?.[_0x177071(0x204)](_0x177071(0x30c)+_0x177071(0x25c)+_0x177071(0x252)+_0x177071(0x30e)+_0x177071(0x296)+_0x177071(0x327)+_0x177071(0x20c)+_0x177071(0x360)));const _0x2ca654=Array[_0x177071(0x2d5)](_0x4fd903[_0x177071(0x1be)])?_0x4fd903['plugins'][_0x177071(0x31a)]:0x0;return await syncManifestPluginScope(_0x412386,_0x1b7761,_0x4fd903),_0x2b1bde?.[_0x177071(0x204)](_0x177071(0x28f)+_0x177071(0x1de)+'cope\x20syn'+_0x177071(0x21e),{'beforePluginCount':_0x2ca654,'afterPluginCount':Array[_0x177071(0x2d5)](_0x4fd903[_0x177071(0x1be)])?_0x4fd903[_0x177071(0x1be)][_0x177071(0x31a)]:0x0,'pluginSpecCount':Array['isArray'](_0x4fd903[_0x177071(0x177)+_0x177071(0x1aa)])?_0x4fd903[_0x177071(0x177)+_0x177071(0x1aa)][_0x177071(0x31a)]:0x0}),await syncConfiguredNpmPlugins(_0x412386,_0x1b7761,_0x4fd903,{'runtimeLogger':_0x2b1bde,'syncOnly':syncOnly}),_0x2b1bde?.['info'](_0x177071(0x2ee)+_0x177071(0x2fb)+'lugins\x20s'+_0x177071(0x31e),{'pluginSpecCount':_0x412386[_0x177071(0x17d)][_0x177071(0x177)+_0x177071(0x1aa)][_0x177071(0x31a)],'pluginCount':Array['isArray'](_0x4fd903[_0x177071(0x1be)])?_0x4fd903[_0x177071(0x1be)]['length']:0x0}),await syncProductPlugins(_0x412386,_0x1b7761,_0x4fd903,{'runtimeLogger':_0x2b1bde}),_0x2b1bde?.[_0x177071(0x204)](_0x177071(0x340)+_0x177071(0x2c4)+_0x177071(0x201),{'localPluginCount':_0x412386[_0x177071(0x17d)][_0x177071(0x1c1)+_0x177071(0x2c0)+_0x177071(0x1f6)]['length'],'pluginCount':Array[_0x177071(0x2d5)](_0x4fd903['plugins'])?_0x4fd903[_0x177071(0x1be)][_0x177071(0x31a)]:0x0}),await syncProductAgents(_0x412386,_0x1b7761,_0x4fd903),_0x2b1bde?.['info'](_0x177071(0x340)+_0x177071(0x37a)+_0x177071(0x31e),{'sources':_0x412386[_0x177071(0x17d)]['resolved'+_0x177071(0x215)+_0x177071(0x2c8)],'entryCount':_0x4fd903[_0x177071(0x312)]?.[_0x177071(0x183)+'nt'],'installPath':_0x4fd903[_0x177071(0x312)]?.[_0x177071(0x208)+_0x177071(0x2ab)]}),await syncProductSkills(_0x412386,_0x1b7761,_0x4fd903),_0x2b1bde?.[_0x177071(0x204)]('product\x20'+'skills\x20s'+_0x177071(0x31e),{'sources':_0x412386[_0x177071(0x17d)]['resolved'+_0x177071(0x1c4)+_0x177071(0x1e1)],'entryCount':_0x4fd903[_0x177071(0x245)]?.['entryCou'+'nt'],'installPath':_0x4fd903['skills']?.[_0x177071(0x208)+_0x177071(0x2ab)]}),await syncRuntimeWrapper(_0x412386,_0x1b7761,_0x4fd903),_0x2b1bde?.[_0x177071(0x204)](_0x177071(0x28f)+'wrapper\x20'+_0x177071(0x201),{'wujieclawBin':_0x4fd903[_0x177071(0x2eb)+_0x177071(0x309)]}),await writeJson(resolveManifestPath(_0x1b7761),_0x4fd903),_0x2b1bde?.[_0x177071(0x204)](_0x177071(0x28f)+'manifest'+_0x177071(0x286),{'manifestPath':resolveManifestPath(_0x1b7761),'manifest':summarizeRuntimeManifest(_0x4fd903),'durationMs':Date[_0x177071(0x267)]()-_0x20a085}),await _0x2b1bde?.['flush'](),_0x4fd903;}catch(_0x1b722c){_0x2b1bde?.['error'](_0x177071(0x209)+_0x177071(0x28f)+_0x177071(0x2ff),{'syncOnly':syncOnly,'runtimeRoot':_0x1b7761,'durationMs':Date[_0x177071(0x267)]()-_0x20a085,'error':_0x1b722c}),await _0x2b1bde?.[_0x177071(0x315)]();throw _0x1b722c;}}async function syncRuntimeWrapper(_0x467c82,_0x32eb21,_0x5d160b){const _0x3ed4b5=_0x38e6be,_0x1a2e7e=_0x467c82[_0x3ed4b5(0x17d)]?.[_0x3ed4b5(0x257)+_0x3ed4b5(0x203)]??_0x3ed4b5(0x29f)+_0x3ed4b5(0x304),_0x44c0d0=join(_0x32eb21,_0x3ed4b5(0x1c9),_0x3ed4b5(0x2eb)+'w'),_0x48d8b2=join(_0x32eb21,_0x3ed4b5(0x1c9),_0x3ed4b5(0x2eb)+_0x3ed4b5(0x248)),_0x1a2cf5=normalizeRuntimeRelativePath(relative(dirname(_0x44c0d0),resolve(_0x32eb21,_0x5d160b[_0x3ed4b5(0x255)+_0x3ed4b5(0x1ba)]))),_0x36a411=normalizeRuntimeRelativePath(relative(dirname(_0x44c0d0),resolve(_0x32eb21,_0x5d160b['openclaw'+_0x3ed4b5(0x1c6)]))),_0x3c7f54=_0x3ed4b5(0x2b7)+_0x467c82['dataDirN'+_0x3ed4b5(0x290)],_0x3189ce=_0x3ed4b5(0x21a)+_0x3ed4b5(0x1a3)+_0x467c82[_0x3ed4b5(0x261)+_0x3ed4b5(0x290)];await mkdir(dirname(_0x44c0d0),{'recursive':!![]});const _0xc3eec0=fileURLToPath(new URL(_0x3ed4b5(0x31b)+_0x3ed4b5(0x266)+_0x3ed4b5(0x323)+_0x3ed4b5(0x185),import.meta.url)),_0x5d2b03=join(_0x32eb21,'bin',_0x3ed4b5(0x200)+_0x3ed4b5(0x1cf));await cp(_0xc3eec0,_0x5d2b03),await writeFile(_0x44c0d0,[_0x3ed4b5(0x1dc)+'h',_0x3ed4b5(0x2ec)+_0x3ed4b5(0x2e0)+_0x3ed4b5(0x274)+_0x3ed4b5(0x2b5)+_0x3ed4b5(0x254)+_0x3c7f54+'}\x22','export\x20O'+_0x3ed4b5(0x2e0)+_0x3ed4b5(0x19f)+_0x3ed4b5(0x23f)+_0x3ed4b5(0x1e9)+_0x3ed4b5(0x2f5)+'-'+_0x3c7f54+'}\x22',_0x3ed4b5(0x2ec)+_0x3ed4b5(0x2e0)+_0x3ed4b5(0x217)+'ILE_NAME'+_0x3ed4b5(0x2b2)+'CLAW_CON'+_0x3ed4b5(0x24d)+_0x3ed4b5(0x26d)+_0x1a2e7e+'}\x22',_0x3ed4b5(0x2ec)+_0x3ed4b5(0x2e0)+_0x3ed4b5(0x2c7)+'ATH=\x22${O'+_0x3ed4b5(0x2e0)+_0x3ed4b5(0x2c7)+_0x3ed4b5(0x283)+_0x3c7f54+'/'+_0x1a2e7e+'}\x22','SCRIPT_D'+'IR=$(CDP'+_0x3ed4b5(0x2a7)+_0x3ed4b5(0x376)+_0x3ed4b5(0x33b)+_0x3ed4b5(0x34f)+_0x3ed4b5(0x299),_0x3ed4b5(0x226)+_0x3ed4b5(0x285)+_0x3ed4b5(0x1f7)+'JIE_NO_L'+'OGO\x22\x20];\x20'+'then',_0x3ed4b5(0x2a2)+_0x3ed4b5(0x2cf)+_0x1a2cf5+(_0x3ed4b5(0x1f8)+'PT_DIR/w'+_0x3ed4b5(0x2e6)+_0x3ed4b5(0x243)+_0x3ed4b5(0x186)+'ll\x20||\x20tr'+'ue'),'fi',_0x3ed4b5(0x367)+_0x3ed4b5(0x1f0)+'R/'+_0x1a2cf5+(_0x3ed4b5(0x1f8)+_0x3ed4b5(0x2cf))+_0x36a411+_0x3ed4b5(0x326),'']['join']('\x0a'),_0x3ed4b5(0x206)),await chmod(_0x44c0d0,0x1ed),await writeFile(_0x48d8b2,[_0x3ed4b5(0x2fe)+'f',_0x3ed4b5(0x306)+_0x3ed4b5(0x22c)+'ME%\x22==\x22\x22'+_0x3ed4b5(0x1e6)+_0x3ed4b5(0x284)+_0x3ed4b5(0x305)+_0x3189ce+'\x22',_0x3ed4b5(0x306)+_0x3ed4b5(0x1e9)+_0x3ed4b5(0x29a)+_0x3ed4b5(0x1b8)+_0x3ed4b5(0x232)+'LAW_STAT'+_0x3ed4b5(0x33a)+_0x3189ce+'\x22',_0x3ed4b5(0x306)+_0x3ed4b5(0x23a)+_0x3ed4b5(0x2b3)+'E_NAME%\x22'+_0x3ed4b5(0x2d0)+_0x3ed4b5(0x1f5)+'AW_CONFI'+'G_FILE_N'+'AME='+_0x1a2e7e+'\x22',_0x3ed4b5(0x306)+'NCLAW_CO'+_0x3ed4b5(0x29d)+_0x3ed4b5(0x2b6)+_0x3ed4b5(0x27f)+_0x3ed4b5(0x23a)+_0x3ed4b5(0x29d)+'H='+_0x3189ce+'\x5c'+_0x1a2e7e+'\x22',_0x3ed4b5(0x1ed)+_0x3ed4b5(0x25d)+_0x3ed4b5(0x279),_0x3ed4b5(0x356)+_0x3ed4b5(0x2c3)+toWindowsPath(_0x1a2cf5)+(_0x3ed4b5(0x325)+'PT_DIR%')+toWindowsPath(_0x36a411)+_0x3ed4b5(0x1df),''][_0x3ed4b5(0x27a)]('\x0d\x0a'),_0x3ed4b5(0x206)),_0x5d160b[_0x3ed4b5(0x2eb)+_0x3ed4b5(0x309)]=toRuntimeRelative(_0x32eb21,process[_0x3ed4b5(0x260)]===_0x3ed4b5(0x28e)?_0x48d8b2:_0x44c0d0);}function _0xfe4b(_0x55369c,_0x68daf){_0x55369c=_0x55369c-0x175;const _0x21fabb=_0x21fa();let _0xfe4bad=_0x21fabb[_0x55369c];return _0xfe4bad;}async function patchChatHistoryMixedToolContentBug(_0x1b31b2,_0x54676d,_0xd48428={}){const _0x57fcb7=_0x38e6be,_0x1fac2b=resolve(_0x1b31b2,_0x54676d['openclaw'+_0x57fcb7(0x23d)+'ir']),_0x12094a=join(_0x1fac2b,_0x57fcb7(0x269));let _0x5bbdc8=[];try{_0x5bbdc8=await readdir(_0x12094a,{'withFileTypes':!![]});}catch{_0xd48428[_0x57fcb7(0x265)+_0x57fcb7(0x294)]?.[_0x57fcb7(0x1f9)]?.(_0x57fcb7(0x1fa)+_0x57fcb7(0x21b)+'ed-tool\x20'+'patch\x20sk'+_0x57fcb7(0x1f4)+_0x57fcb7(0x228)+_0x57fcb7(0x1bb),{'distDir':_0x12094a,'openclawVersion':_0x54676d[_0x57fcb7(0x17d)+'Version']});return;}const _0x171c2b=_0x5bbdc8['filter'](_0x19d960=>_0x19d960[_0x57fcb7(0x1d4)]()&&_0x19d960['name'][_0x57fcb7(0x20b)+'th'](_0x57fcb7(0x335)+_0x57fcb7(0x364)+_0x57fcb7(0x2be))&&_0x19d960[_0x57fcb7(0x1ec)][_0x57fcb7(0x32b)](_0x57fcb7(0x24a)))[_0x57fcb7(0x2ad)](_0x71af2c=>join(_0x12094a,_0x71af2c[_0x57fcb7(0x1ec)]));if(_0x171c2b['length']===0x0){_0xd48428[_0x57fcb7(0x265)+_0x57fcb7(0x294)]?.[_0x57fcb7(0x1f9)]?.(_0x57fcb7(0x1fa)+_0x57fcb7(0x21b)+_0x57fcb7(0x23b)+'patch\x20sk'+_0x57fcb7(0x321)+_0x57fcb7(0x31c)+_0x57fcb7(0x1bb),{'openclawVersion':_0x54676d['openclaw'+_0x57fcb7(0x34e)]});return;}for(const _0x42ae9e of _0x171c2b){const _0x423b36=await readFile(_0x42ae9e,_0x57fcb7(0x206)),_0x541b64=patchMixedToolContentFromSource(_0x423b36);if(!_0x541b64[_0x57fcb7(0x332)]){if(_0x541b64[_0x57fcb7(0x303)]===_0x57fcb7(0x341)+_0x57fcb7(0x332)){_0xd48428[_0x57fcb7(0x265)+_0x57fcb7(0x294)]?.[_0x57fcb7(0x204)]?.(_0x57fcb7(0x1fa)+_0x57fcb7(0x21b)+_0x57fcb7(0x23b)+_0x57fcb7(0x1f3)+_0x57fcb7(0x1a2)+_0x57fcb7(0x1b7),{'openclawVersion':_0x54676d[_0x57fcb7(0x17d)+_0x57fcb7(0x34e)],'filePath':_0x42ae9e});return;}continue;}await writeFile(_0x42ae9e,_0x541b64['source'],_0x57fcb7(0x206)),_0xd48428['runtimeL'+_0x57fcb7(0x294)]?.['info']?.('chat\x20his'+_0x57fcb7(0x21b)+_0x57fcb7(0x23b)+'patch\x20ap'+'plied',{'openclawVersion':_0x54676d[_0x57fcb7(0x17d)+_0x57fcb7(0x34e)],'filePath':_0x42ae9e,'note':'Temporar'+'y\x20compat'+_0x57fcb7(0x237)+_0x57fcb7(0x22b)+_0x57fcb7(0x32f)+_0x57fcb7(0x2a9)+_0x57fcb7(0x295)+_0x57fcb7(0x26e)+_0x57fcb7(0x1e7)+_0x57fcb7(0x2b0)+_0x57fcb7(0x35c)+_0x57fcb7(0x301)+_0x57fcb7(0x280)+_0x57fcb7(0x2bc)+'re\x20upgra'+_0x57fcb7(0x344)});return;}_0xd48428[_0x57fcb7(0x265)+_0x57fcb7(0x294)]?.['warn']?.(_0x57fcb7(0x1fa)+_0x57fcb7(0x21b)+_0x57fcb7(0x23b)+'patch\x20sk'+'ipped;\x20f'+_0x57fcb7(0x374)+_0x57fcb7(0x30a)+'d',{'openclawVersion':_0x54676d[_0x57fcb7(0x17d)+_0x57fcb7(0x34e)]});}async function patchChannelPluginRuntimeBug(_0x20542a,_0x42c939,_0x15135f={}){const _0x2f6256=_0x38e6be,_0x43ec16=resolve(_0x20542a,_0x42c939['openclaw'+_0x2f6256(0x23d)+'ir']),_0xff1e2b=join(_0x43ec16,'dist');let _0x214cb5=[];try{_0x214cb5=await readdir(_0xff1e2b,{'withFileTypes':!![]});}catch{_0x15135f[_0x2f6256(0x265)+_0x2f6256(0x294)]?.[_0x2f6256(0x1f9)]?.(_0x2f6256(0x30d)+_0x2f6256(0x2ed)+'untime\x20p'+_0x2f6256(0x2c5)+_0x2f6256(0x37d)+_0x2f6256(0x231)+_0x2f6256(0x18b),{'distDir':_0xff1e2b,'openclawVersion':_0x42c939[_0x2f6256(0x17d)+_0x2f6256(0x34e)]});return;}const _0x3a8f50=_0x214cb5[_0x2f6256(0x28d)](_0x2c086d=>_0x2c086d[_0x2f6256(0x1d4)]()&&_0x2c086d[_0x2f6256(0x1ec)][_0x2f6256(0x20b)+'th']('loader-')&&_0x2c086d['name'][_0x2f6256(0x32b)](_0x2f6256(0x24a)))[_0x2f6256(0x2ad)](_0xcd3df5=>join(_0xff1e2b,_0xcd3df5['name'])),_0xd2435e=await resolveRuntimeChannelImportPath(_0xff1e2b,_0x214cb5);if(_0x3a8f50[_0x2f6256(0x31a)]===0x0){_0x15135f[_0x2f6256(0x265)+_0x2f6256(0x294)]?.['warn']?.('channel\x20'+_0x2f6256(0x2ed)+_0x2f6256(0x239)+_0x2f6256(0x2c5)+_0x2f6256(0x1b0)+_0x2f6256(0x259)+_0x2f6256(0x371),{'openclawVersion':_0x42c939[_0x2f6256(0x17d)+_0x2f6256(0x34e)]});return;}if(!_0xd2435e){_0x15135f[_0x2f6256(0x265)+'ogger']?.[_0x2f6256(0x1f9)]?.('channel\x20'+_0x2f6256(0x2ed)+_0x2f6256(0x239)+_0x2f6256(0x2c5)+_0x2f6256(0x234)+'ntime\x20ch'+_0x2f6256(0x287)+'try\x20not\x20'+_0x2f6256(0x1bb),{'openclawVersion':_0x42c939[_0x2f6256(0x17d)+'Version'],'distDir':_0xff1e2b});return;}for(const _0x12eef6 of _0x3a8f50){const _0x5c6ff8=await readFile(_0x12eef6,_0x2f6256(0x206)),_0x24ac1d=patchChannelPluginRuntimeFromSource(_0x5c6ff8,{'runtimeChannelImportPath':_0xd2435e});if(!_0x24ac1d[_0x2f6256(0x332)]){if(_0x24ac1d['reason']===_0x2f6256(0x341)+_0x2f6256(0x332)){_0x15135f[_0x2f6256(0x265)+_0x2f6256(0x294)]?.[_0x2f6256(0x204)]?.(_0x2f6256(0x30d)+_0x2f6256(0x2ed)+_0x2f6256(0x239)+_0x2f6256(0x179)+_0x2f6256(0x222)+_0x2f6256(0x191),{'openclawVersion':_0x42c939[_0x2f6256(0x17d)+_0x2f6256(0x34e)],'filePath':_0x12eef6});return;}continue;}await writeFile(_0x12eef6,_0x24ac1d['source'],'utf8'),_0x15135f[_0x2f6256(0x265)+_0x2f6256(0x294)]?.[_0x2f6256(0x204)]?.(_0x2f6256(0x30d)+_0x2f6256(0x2ed)+'untime\x20p'+'atch\x20app'+_0x2f6256(0x191),{'openclawVersion':_0x42c939[_0x2f6256(0x17d)+_0x2f6256(0x34e)],'filePath':_0x12eef6,'note':'Temporar'+_0x2f6256(0x2c1)+_0x2f6256(0x237)+_0x2f6256(0x22b)+_0x2f6256(0x32f)+'aw\x202026.'+_0x2f6256(0x346)+_0x2f6256(0x1e0)+_0x2f6256(0x336)+_0x2f6256(0x268)+'ng\x20chann'+_0x2f6256(0x1a7)+'nd\x20helpe'+_0x2f6256(0x20e)+_0x2f6256(0x2d8)+_0x2f6256(0x2fa)+'on\x20futur'+_0x2f6256(0x2f7)+_0x2f6256(0x342)});return;}_0x15135f[_0x2f6256(0x265)+'ogger']?.[_0x2f6256(0x1f9)]?.(_0x2f6256(0x30d)+_0x2f6256(0x2ed)+'untime\x20p'+_0x2f6256(0x2c5)+_0x2f6256(0x234)+_0x2f6256(0x184)+_0x2f6256(0x1da)+_0x2f6256(0x2da),{'openclawVersion':_0x42c939[_0x2f6256(0x17d)+'Version']});}async function patchSessionStoreSqliteRuntime(_0x2cc63b,_0x19615a,_0x49d0d3={}){const _0x524507=_0x38e6be,_0x39013b=resolve(_0x2cc63b,_0x19615a[_0x524507(0x17d)+_0x524507(0x23d)+'ir']),_0x69f08d=join(_0x39013b,'dist'),_0x20693b=_0x524507(0x1b6)+_0x524507(0x2bd)+_0x524507(0x1b2)+'ions/run'+'time-bri'+_0x524507(0x26a),_0x10cb9a=join(_0x2cc63b,_0x524507(0x34d)+'ntime',_0x524507(0x1d5),_0x524507(0x33f)+_0x524507(0x2b9)+'js'),_0xc0634a=(await readdir(_0x69f08d,{'withFileTypes':!![]})[_0x524507(0x2dc)](()=>[]))[_0x524507(0x28d)](_0x56c271=>_0x56c271[_0x524507(0x1d4)]()&&_0x56c271[_0x524507(0x1ec)][_0x524507(0x20b)+'th'](_0x524507(0x1b4)+_0x524507(0x182))&&_0x56c271[_0x524507(0x1ec)]['endsWith'](_0x524507(0x24a)))[_0x524507(0x2ad)](_0x591e6c=>join(_0x69f08d,_0x591e6c['name'])),_0x4f892e=(await readdir(_0x69f08d,{'withFileTypes':!![]})[_0x524507(0x2dc)](()=>[]))[_0x524507(0x28d)](_0x44246b=>_0x44246b['isFile']()&&_0x44246b[_0x524507(0x1ec)][_0x524507(0x20b)+'th'](_0x524507(0x2f4))&&!_0x44246b[_0x524507(0x1ec)][_0x524507(0x20b)+'th'](_0x524507(0x1b4)+'ad-')&&_0x44246b[_0x524507(0x1ec)][_0x524507(0x32b)]('.js'))['map'](_0x4444e6=>join(_0x69f08d,_0x4444e6[_0x524507(0x1ec)]));if(!existsSync(_0x10cb9a)){_0x49d0d3[_0x524507(0x265)+_0x524507(0x294)]?.[_0x524507(0x204)]?.(_0x524507(0x17e)+_0x524507(0x19e)+_0x524507(0x1db)+'ch\x20skipp'+_0x524507(0x337)+_0x524507(0x368)+'vailable',{'bridgePath':_0x10cb9a,'openclawVersion':_0x19615a[_0x524507(0x17d)+_0x524507(0x34e)]});return;}for(const _0xfa2150 of _0xc0634a){const _0x1a1a4c=await readFile(_0xfa2150,_0x524507(0x206)),_0x3725ba=patchSessionStoreLoadFromSource(_0x1a1a4c,{'bridgeImportPath':_0x20693b});if(!_0x3725ba[_0x524507(0x332)]){if(_0x3725ba[_0x524507(0x303)]===_0x524507(0x341)+_0x524507(0x332)){_0x49d0d3['runtimeL'+_0x524507(0x294)]?.['info']?.(_0x524507(0x17e)+_0x524507(0x1a6)+_0x524507(0x276)+_0x524507(0x28b)+_0x524507(0x316),{'filePath':_0xfa2150,'openclawVersion':_0x19615a[_0x524507(0x17d)+'Version']});break;}continue;}await writeFile(_0xfa2150,_0x3725ba[_0x524507(0x351)],_0x524507(0x206)),_0x49d0d3[_0x524507(0x265)+'ogger']?.[_0x524507(0x204)]?.(_0x524507(0x17e)+_0x524507(0x1a6)+_0x524507(0x276)+'\x20applied',{'filePath':_0xfa2150,'openclawVersion':_0x19615a[_0x524507(0x17d)+'Version']});break;}for(const _0x3eaf51 of _0x4f892e){const _0x58b41c=await readFile(_0x3eaf51,_0x524507(0x206)),_0x55045f=patchSessionStoreWriteFromSource(_0x58b41c,{'bridgeImportPath':_0x20693b});if(!_0x55045f[_0x524507(0x332)]){if(_0x55045f[_0x524507(0x303)]==='already-'+_0x524507(0x332)){_0x49d0d3[_0x524507(0x265)+_0x524507(0x294)]?.[_0x524507(0x204)]?.('session\x20'+'store\x20wr'+_0x524507(0x225)+'h\x20alread'+'y\x20applie'+'d',{'filePath':_0x3eaf51,'openclawVersion':_0x19615a[_0x524507(0x17d)+'Version']});break;}continue;}await writeFile(_0x3eaf51,_0x55045f[_0x524507(0x351)],_0x524507(0x206)),_0x49d0d3[_0x524507(0x265)+'ogger']?.['info']?.(_0x524507(0x17e)+_0x524507(0x1ad)+_0x524507(0x225)+_0x524507(0x25a)+'d',{'filePath':_0x3eaf51,'openclawVersion':_0x19615a[_0x524507(0x17d)+'Version']});break;}}async function resolveRuntimeChannelImportPath(_0x41f7f1,_0x1e4721){const _0x2d0397=_0x38e6be,_0x5f301d=_0x1e4721[_0x2d0397(0x28d)](_0x13c8d2=>_0x13c8d2[_0x2d0397(0x1d4)]()&&_0x13c8d2[_0x2d0397(0x1ec)][_0x2d0397(0x20b)+'th'](_0x2d0397(0x33f)+_0x2d0397(0x247))&&_0x13c8d2['name'][_0x2d0397(0x32b)]('.js')&&!_0x13c8d2[_0x2d0397(0x1ec)][_0x2d0397(0x20b)+'th']('runtime-'+_0x2d0397(0x247)+_0x2d0397(0x1e5)))[_0x2d0397(0x2ad)](_0x11ac83=>_0x11ac83[_0x2d0397(0x1ec)])['sort']();for(const _0x38f8ce of _0x5f301d){const _0x3c6173=await readFile(join(_0x41f7f1,_0x38f8ce),_0x2d0397(0x206));if(_0x3c6173[_0x2d0397(0x262)](_0x2d0397(0x18c)+_0x2d0397(0x363)+_0x2d0397(0x30f)))return'./'+_0x38f8ce;}return null;}function normalizeRuntimeRelativePath(_0x30e55c){return _0x30e55c['replaceA'+'ll']('\x5c','/');}function toWindowsPath(_0x3148a4){const _0x3c3e1a=_0x38e6be;return _0x3148a4[_0x3c3e1a(0x275)+'ll']('/','\x5c');}function validateRuntimeNodeVersion(_0x2e0633,_0x5a71b8){const _0x1f197e=_0x38e6be;if(_0x2e0633[_0x1f197e(0x2b1)+_0x1f197e(0x196)]===_0x5a71b8['openclaw'][_0x1f197e(0x2b1)+'ion'])return;throw new Error(_0x1f197e(0x28f)+'nodeVers'+_0x1f197e(0x313)+'atch:\x20ma'+_0x1f197e(0x194)+(_0x2e0633['nodeVers'+_0x1f197e(0x196)]||_0x1f197e(0x35f))+(_0x1f197e(0x190)+_0x1f197e(0x240))+_0x5a71b8[_0x1f197e(0x17d)][_0x1f197e(0x2b1)+'ion']+'.\x20'+(_0x1f197e(0x197)+_0x1f197e(0x199)+_0x1f197e(0x311)+_0x1f197e(0x320)+_0x1f197e(0x2d7)+'\x20runtime'+_0x1f197e(0x22d)+'rebuilt\x20'+_0x1f197e(0x213)+_0x1f197e(0x20c)+'red\x20Node'+'\x20version'+'.'));}function validateRuntimeOpenClawVersion(_0x2d41cd,_0x5a3215){const _0x58f8e0=_0x38e6be;if(_0x2d41cd[_0x58f8e0(0x17d)+'Version']===_0x5a3215['openclaw']['openclaw'+'Version'])return;throw new Error(_0x58f8e0(0x28f)+'openclaw'+'Version\x20'+'mismatch'+':\x20manife'+_0x58f8e0(0x1ae)+(_0x2d41cd[_0x58f8e0(0x17d)+_0x58f8e0(0x34e)]||_0x58f8e0(0x35f))+(',\x20shell.'+_0x58f8e0(0x240))+_0x5a3215[_0x58f8e0(0x17d)][_0x58f8e0(0x17d)+_0x58f8e0(0x34e)]+'.\x20'+(_0x58f8e0(0x197)+_0x58f8e0(0x199)+_0x58f8e0(0x311)+_0x58f8e0(0x320)+_0x58f8e0(0x2d6)+_0x58f8e0(0x1a1)+_0x58f8e0(0x24b)+_0x58f8e0(0x20c)+_0x58f8e0(0x26b)+_0x58f8e0(0x19d)+_0x58f8e0(0x333)));}function parseNpmPackJson(_0x5e2077){const _0xe87093=_0x38e6be,_0x4fe91e=_0x5e2077[_0xe87093(0x339)](),_0x43e635=_0x4fe91e[_0xe87093(0x263)]('[');if(_0x43e635<0x0)throw new Error(_0xe87093(0x2f6)+'\x20did\x20not'+_0xe87093(0x22a)+_0xe87093(0x26f)+_0x4fe91e[_0xe87093(0x29b)](0x0,0x1f4));const _0x5c18ed=JSON['parse'](_0x4fe91e['slice'](_0x43e635)),_0x39409c=Array['isArray'](_0x5c18ed)?_0x5c18ed[0x0]:_0x5c18ed;if(!_0x39409c||typeof _0x39409c!==_0xe87093(0x2df))throw new Error(_0xe87093(0x2f6)+_0xe87093(0x34b)+_0xe87093(0x251)+_0xe87093(0x307)+_0xe87093(0x1c5)+_0x4fe91e[_0xe87093(0x29b)](0x0,0x1f4));return _0x39409c;}function normalizePackedTarballFilename(_0x1fe01d){const _0x410471=_0x38e6be;return _0x1fe01d[_0x410471(0x1dd)](/^@/,'')['replaceA'+'ll']('/','-')[_0x410471(0x275)+'ll']('\x5c','-');}async function runProcess(_0x5a39a2,_0x128a55,_0x3d4efc={}){const _0x292557=_0x38e6be,_0x37a41f=_0x3d4efc[_0x292557(0x2f9)]||[_0x5a39a2,..._0x128a55][_0x292557(0x27a)]('\x20'),_0x45f0ab=_0x3d4efc[_0x292557(0x1ff)+'s']??NPM_INSTALL_TIMEOUT_MS,_0x5d6c10=spawn(_0x5a39a2,_0x128a55,{'cwd':_0x3d4efc[_0x292557(0x2b4)],'env':_0x3d4efc['env'],'stdio':['ignore','pipe',_0x292557(0x21c)]});return await new Promise((_0x4c12f5,_0x4a1929)=>{const _0x4a4975=_0x292557;let _0x144eb4='',_0x48d407='',_0x48816a=![];const _0x5d33a4=setTimeout(()=>{const _0x293ac2=_0xfe4b;if(_0x48816a)return;_0x48816a=!![],_0x5d6c10['kill'](_0x293ac2(0x1c7)),_0x4a1929(new Error(_0x37a41f+(_0x293ac2(0x192)+_0x293ac2(0x24f)+'\x20')+_0x45f0ab+'ms'));},_0x45f0ab);_0x5d6c10[_0x4a4975(0x2b8)]['on'](_0x4a4975(0x22e),_0x2a06a8=>{_0x144eb4+=_0x2a06a8['toString']();}),_0x5d6c10[_0x4a4975(0x293)]['on'](_0x4a4975(0x22e),_0x45bf6f=>{const _0x4d758e=_0x4a4975;_0x48d407+=_0x45bf6f[_0x4d758e(0x1a4)]();}),_0x5d6c10['on']('error',_0x10ad78=>{if(_0x48816a)return;_0x48816a=!![],clearTimeout(_0x5d33a4),_0x4a1929(_0x10ad78);}),_0x5d6c10['on']('close',(_0x3804fe,_0x3da4a7)=>{const _0x87d6ca=_0x4a4975;if(_0x48816a)return;_0x48816a=!![],clearTimeout(_0x5d33a4);if(_0x3804fe===0x0){_0x4c12f5({'stdout':_0x144eb4,'stderr':_0x48d407});return;}_0x4a1929(new Error(_0x37a41f+('\x20failed\x20'+_0x87d6ca(0x292)+'e=')+(_0x3804fe??_0x87d6ca(0x2fc))+_0x87d6ca(0x1fe)+(_0x3da4a7??_0x87d6ca(0x2fc))+'\x0a'+(''+(_0x48d407||_0x144eb4))[_0x87d6ca(0x339)]()));});});}async function installOpenClawPackage(_0x5e3053,_0x410611){const _0x37a52f=_0x38e6be,_0x1edd47=join(_0x5e3053['runtimeR'+_0x37a52f(0x211)],_0x37a52f(0x1bd)),_0x3a1043=join(_0x5e3053[_0x37a52f(0x37c)+_0x37a52f(0x211)],_0x37a52f(0x220)+_0x37a52f(0x223)+'t');await mkdir(_0x1edd47,{'recursive':!![]}),await removePathWithRetries(_0x3a1043),await mkdir(_0x3a1043,{'recursive':!![]});const _0x102311=await createRuntimeEnv(_0x5e3053),_0x460057=_0x37a52f(0x17d)+'@'+_0x410611;console[_0x37a52f(0x1bc)](_0x37a52f(0x347)+'hell:run'+_0x37a52f(0x18f)+_0x37a52f(0x19b)+'\x20'+_0x460057);const _0x377d33=await runProcess(_0x5e3053['nodeExec'+_0x37a52f(0x1ba)],[_0x5e3053[_0x37a52f(0x372)],'pack',_0x460057,_0x37a52f(0x17a)],{'cwd':_0x1edd47,'env':_0x102311,'label':_0x37a52f(0x2f6)+'\x20'+_0x460057}),_0x235843=parseNpmPackJson(_0x377d33['stdout']);if(_0x235843[_0x37a52f(0x2aa)]!==_0x410611)throw new Error(_0x37a52f(0x198)+_0x37a52f(0x2ea)+'law\x20'+_0x410611+(_0x37a52f(0x188)+_0x37a52f(0x17f))+_0x235843[_0x37a52f(0x2aa)]);const _0x5b7870=resolve(_0x1edd47,_0x235843[_0x37a52f(0x253)]);if(!existsSync(_0x5b7870))throw new Error('npm\x20pack'+_0x37a52f(0x2c2)+_0x37a52f(0x343)+_0x37a52f(0x35a)+'\x20'+_0x5b7870);await runProcess('tar',['-xzf',_0x5b7870,'-C',_0x3a1043],{'label':_0x37a52f(0x27b)+_0x235843[_0x37a52f(0x253)]}),await removePathWithRetries(_0x5e3053[_0x37a52f(0x17d)+_0x37a52f(0x23d)+'ir']),await rename(join(_0x3a1043,_0x37a52f(0x2e5)),_0x5e3053[_0x37a52f(0x17d)+_0x37a52f(0x23d)+'ir']),await removePathWithRetries(_0x3a1043),await runProcess(_0x5e3053[_0x37a52f(0x255)+'utable'],[_0x5e3053['npmCli'],'install',_0x37a52f(0x29c)+'ev',_0x37a52f(0x1b3)+_0x37a52f(0x2f3),_0x37a52f(0x270)+'it',_0x37a52f(0x219)+'d',_0x37a52f(0x348)+_0x37a52f(0x1c2)+'ps'],{'cwd':_0x5e3053[_0x37a52f(0x17d)+_0x37a52f(0x23d)+'ir'],'env':_0x102311,'label':_0x37a52f(0x24c)+_0x37a52f(0x32c)+_0x460057+(_0x37a52f(0x2d6)+'\x20depende'+_0x37a52f(0x1a8))});if(!existsSync(_0x5e3053[_0x37a52f(0x17d)+_0x37a52f(0x1c6)]))throw new Error(_0x37a52f(0x322)+'\x20bin\x20was'+_0x37a52f(0x350)+_0x37a52f(0x35e)+'\x20install'+':\x20'+_0x5e3053[_0x37a52f(0x17d)+_0x37a52f(0x1c6)]);}async function ensureRuntimeBase(_0xce9411,_0x11ab48,_0x318371={}){const _0x144b11=_0x38e6be;await mkdir(_0x11ab48,{'recursive':!![]});let _0xafde3=await readRuntimeManifest(_0x11ab48);const _0x33b363=_0xce9411[_0x144b11(0x17d)][_0x144b11(0x2b1)+_0x144b11(0x196)],_0x571353=_0xce9411[_0x144b11(0x17d)]['openclaw'+_0x144b11(0x34e)],_0x4b910c=existsSync(resolveManifestPath(_0x11ab48)),_0x241c05=runtimeHasRequiredPaths(_0x11ab48,_0xafde3),_0x2eda49=_0xafde3[_0x144b11(0x2b1)+_0x144b11(0x196)]===_0x33b363;!_0x4b910c||!_0x241c05||!_0x2eda49?(_0x318371[_0x144b11(0x265)+'ogger']?.[_0x144b11(0x204)](_0x144b11(0x28f)+_0x144b11(0x28c)+'ld\x20start'+'ed',{'runtimeRoot':_0x11ab48,'reason':!_0x4b910c?_0x144b11(0x1fd)+'manifest':!_0x241c05?_0x144b11(0x1fd)+_0x144b11(0x238)+_0x144b11(0x2d6)+_0x144b11(0x1d7):_0x144b11(0x212)+_0x144b11(0x2bf)+'match','syncOnly':_0x318371[_0x144b11(0x229)]}),_0xafde3=await buildRuntimeBase(_0xce9411,_0x11ab48,_0xafde3),_0x318371[_0x144b11(0x265)+'ogger']?.[_0x144b11(0x204)](_0x144b11(0x28f)+_0x144b11(0x28c)+'ld\x20compl'+_0x144b11(0x334),{'manifest':summarizeRuntimeManifest(_0xafde3)})):_0x318371[_0x144b11(0x265)+_0x144b11(0x294)]?.[_0x144b11(0x204)](_0x144b11(0x28f)+_0x144b11(0x17b)+_0x144b11(0x250)+_0x144b11(0x230),{'manifest':summarizeRuntimeManifest(_0xafde3)});if(!existsSync(resolve(_0x11ab48,_0xafde3[_0x144b11(0x17d)+_0x144b11(0x1c6)]))){const _0x4061a8=createRuntimeInfoFromManifest(_0x11ab48,_0xafde3,{'allowMissingOpenClaw':!![]});await installOpenClawPackage(_0x4061a8,_0x571353),_0xafde3['openclaw'+_0x144b11(0x34e)]=_0x571353;}return _0xafde3;}function runtimeHasRequiredPaths(_0x383cf9,_0x10c555){const _0x585874=_0x38e6be;return[_0x585874(0x255)+_0x585874(0x1ba),_0x585874(0x372),_0x585874(0x17d)+_0x585874(0x23d)+'ir','openclaw'+'Bin'][_0x585874(0x349)](_0x26d819=>typeof _0x10c555[_0x26d819]==='string'&&_0x10c555[_0x26d819][_0x585874(0x339)]())&&[_0x585874(0x255)+_0x585874(0x1ba),'npmCli'][_0x585874(0x349)](_0x2693bd=>existsSync(resolve(_0x383cf9,_0x10c555[_0x2693bd])));}async function buildRuntimeBase(_0x453ddb,_0x128762,_0x11aaf6={}){const _0x2d82d4=_0x38e6be,_0x2d0cfd=join(_0x128762,_0x2d82d4(0x193));await ensureRuntimeNode(_0x453ddb,_0x2d0cfd);const _0x28c572={..._0x11aaf6,'generatedAt':new Date()[_0x2d82d4(0x2d3)+'ing'](),'nodeVersion':_0x453ddb[_0x2d82d4(0x17d)][_0x2d82d4(0x2b1)+_0x2d82d4(0x196)],'openclawVersion':_0x11aaf6['openclaw'+_0x2d82d4(0x34e)]||'','platform':process['platform'],'arch':process[_0x2d82d4(0x1b5)],'nodeExecutable':'node/bin'+_0x2d82d4(0x214),'npmCli':_0x2d82d4(0x2a6)+'/node_mo'+_0x2d82d4(0x180)+_0x2d82d4(0x1af)+_0x2d82d4(0x291),'openclawWorkingDir':'openclaw','openclawBin':_0x2d82d4(0x17d)+_0x2d82d4(0x33e)+_0x2d82d4(0x18e)};return await writeJson(resolveManifestPath(_0x128762),_0x28c572),_0x28c572;}async function removePathWithRetries(_0x3b847f){await rm(_0x3b847f,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96});}async function ensureRuntimeNode(_0x4cbb1c,_0x27b31f){const _0x3433b4=_0x38e6be,_0x4b091b=_0x4cbb1c[_0x3433b4(0x17d)]['nodeVers'+_0x3433b4(0x196)],_0x19abd9=join(_0x27b31f,'bin',_0x3433b4(0x193)),_0x4bf057=join(_0x27b31f,'lib',_0x3433b4(0x329)+'ules',_0x3433b4(0x318),_0x3433b4(0x1c9),'npm-cli.'+'js');if(existsSync(_0x19abd9)&&existsSync(_0x4bf057)&&await getNodeVersion(_0x19abd9)===_0x4b091b)return;await removePathWithRetries(_0x27b31f);if(process[_0x3433b4(0x1bf)][_0x3433b4(0x193)]===_0x4b091b){await linkCurrentNodeRuntime(_0x27b31f);return;}await downloadNodeRuntime(_0x4b091b,_0x27b31f);}async function getNodeVersion(_0x486f75){const _0x5a39e5=_0x38e6be;try{const _0xb02576=await runProcess(_0x486f75,['-p','process.'+_0x5a39e5(0x1bf)+_0x5a39e5(0x242)],{'label':_0x486f75+_0x5a39e5(0x1d8),'timeoutMs':0x7530});return _0xb02576['stdout'][_0x5a39e5(0x339)]();}catch{return'';}}async function linkCurrentNodeRuntime(_0x302a9e){const _0x12f54b=_0x38e6be,_0x37131c=process[_0x12f54b(0x2ac)],_0x51719d=resolve(dirname(_0x37131c),'..'),_0x4ea42d=resolve(_0x51719d,_0x12f54b(0x20a)+_0x12f54b(0x37e)+_0x12f54b(0x328)),_0x24fe95=join(_0x302a9e,_0x12f54b(0x1c9),_0x12f54b(0x193)),_0x1a690d=join(_0x302a9e,_0x12f54b(0x2f8),'node_mod'+_0x12f54b(0x1fc),'npm');await mkdir(dirname(_0x24fe95),{'recursive':!![]}),await mkdir(dirname(_0x1a690d),{'recursive':!![]}),await symlink(_0x37131c,_0x24fe95),existsSync(_0x4ea42d)?await symlink(_0x4ea42d,_0x1a690d):await symlink(await resolveNpmRoot(),_0x1a690d);}function _0x21fa(){const _0x208dc0=['keys','-extract','in\x20insta','href','404148xKjFhZ','go.mjs','.npmmirr','endencie','.tools','statusCo','isFile','sessions','projectR','\x20paths','\x20version','npm\x20root','solver\x20n','lite\x20pat','#!/bin/s','replace','plugin\x20s','\x22\x20%*','nel\x20plug','llPaths','jie-shel','extract-','cies','state-','\x20set\x20\x22OP','tory\x20pro','s\x20not\x20fo','NCLAW_ST','close','runtime','name','set\x20\x22SCR',';\x20run\x20wu','\x20failed\x20','CRIPT_DI','ugin\x20dep','octor\x20--','patch\x20al','ipped;\x20d','\x20\x22OPENCL','ginPaths','\x20-z\x20\x22$WU','\x22\x20\x22$SCRI','warn','chat\x20his','\x20complet','ules','missing\x20','\x20signal=','timeoutM','wujie-lo','synced','agentSco','leName','info','ing\x20\x22','utf8','claw-run','installP','prepare\x20','lib/node','startsWi','\x20configu','ted','rs;\x20veri','333036bvaUmi','npm-cach','oot','node\x20ver','with\x20the','/node','LocalAge','x64','CONFIG_F','\x20local\x20p','--no-fun','%USERPRO','tory\x20mix','pipe','.json','ced','wnloadin','.opencla','er\x20writt','eady\x20app','w-extrac','tar.xz','ite\x20patc','if\x20[\x20-t\x20','skill','ist\x20not\x20','syncOnly','\x20return\x20','patch\x20fo','NCLAW_HO','\x20can\x20be\x20','data','manifest','rent','st\x20not\x20f','t\x20\x22OPENC','\x20loaded','pped;\x20ru','appId','_shared','ibility\x20','required','untime\x20p','NCLAW_CO','ed-tool\x20','optional','WorkingD','all\x20loca','R=\x22${OPE','config=','node-v','.node','o.mjs\x22\x202','ady\x20curr','skills','time]\x20fe','channel-','w.cmd','\x20and\x20','.js','tall\x20the','npm\x20inst','FIG_FILE','error','ut\x20after','eady\x20cur','d\x20an\x20inv','e\x20tools\x20','filename','_HOME:-','nodeExec','headers','configFi','fix\x20comp','ader\x20not','h\x20applie','spec','r\x20runtim','IPT_DIR=','4924215kLSinh','Invalid\x20','platform','dataDirN','includes','indexOf','pec:\x20','runtimeL','sets/wuj','now','me\x20missi','dist','dge.mjs','red\x20Open','resume','_NAME:-','tool\x20his','JSON:\x20','--no-aud','or.com','time]\x20ru','s\x20instal','HOME=\x22${','replaceA','ad\x20patch','install','path','%~dp0\x22','join','extract\x20','und:\x20','runtimeS','fix','set\x20\x22OPE','ream\x20fix','y:\x20','1062442gtaSEC','ATH:-','ENCLAW_H','1\x20]\x20&&\x20[','\x20written','annel\x20en','index.mj','local:','120npNFfS','\x20already','base\x20bui','filter','win32','runtime\x20','ame','m-cli.js','with\x20cod','stderr','ogger','6\x20mixed\x20','\x20kdocs\x20s','split','dencies','&&\x20pwd)','ATE_DIR%','slice','--omit=d','NFIG_PAT','tar','wujieai.','hell:run','registry','\x20\x20\x22$SCRI','-xzf','dAt','tools\x20sy','node/lib','ATH=\x20cd\x20','prepareP','aw\x202026.','version','ath','execPath','map','package.','nced','jection\x20','nodeVers','=\x22${OPEN','NFIG_FIL','cwd','OPENCLAW','H%\x22==\x22\x22\x20','$HOME/','stdout','bridge.m','time-too','time]\x20do','\x20on\x20futu','ell-runt','jection-','sion\x20mis','LocalPlu','y\x20compat','\x20did\x20not','_DIR%','plugins\x20','atch\x20ski','Unable\x20t','CONFIG_P','ntPaths','empty\x20pl','\x20id\x20from','integrit','10sgQSmQ','env','?t=','PT_DIR/','==\x22\x22\x20set','productN','all\x20plug','toISOStr','local\x20pl','isArray','\x20runtime','\x20product','fy\x20upstr','product','ot\x20found','\x20doctor\x20','catch','scripts','341560oYfxVE','object','PENCLAW_','dependen','ll\x20prepa','configPa','zip','package','ujie-log','has','l\x20plugin','allowMis','ed\x20OpenC','wujiecla','export\x20O','plugin\x20r','configur','led','scoped\x20s','re\x22\x20to\x20r','st\x20be\x20a\x20','eer','store-','ATE_DIR:','npm\x20pack','e\x20upgrad','lib','label','eam\x20fix\x20','ed\x20npm\x20p','null','started','@echo\x20of','failed','string','ify\x20upst','devDepen','reason','json','OME=','if\x20\x22%OPE','alid\x20pay','fix\x20alre','wBin','not\x20foun','ntime','connecto','channel\x20','skipped;','nnel','https://','\x20prepare','agents','ion\x20mism','singOpen','flush','\x20applied','Spec','npm','lugin\x20de','length','../../as','ile\x20not\x20','\x20started','ynced','lugin\x20','\x22\x20so\x20the','ipped;\x20f','OpenClaw','ie-logo.','roductRu','\x22\x20\x22%SCRI','\x22\x20\x22$@\x22','kill\x20not','/npm','node_mod','859747kYJUzn','endsWith','all\x20','d:\x20','time','r\x20OpenCl','leted','8yWrndR','patched','sion.','eted','chat-dis','in\x20runti','ed;\x20brid','\x20-g','trim','E_DIR=','rname\x20--','\x20path\x20mu','lark-cli','/opencla','runtime-','product\x20','already-','es.','\x20create\x20','des.','location','6.6\x20chan','[wujie-s','--legacy','every','d\x20for\x20lo','\x20returne','6858990JiWBoS','shell-ru','Version','\x20\x22$0\x22)\x22\x20','\x20not\x20fou','source','doctor','function','nodejs.o','.\x20Run\x20\x22w','\x22%SCRIPT','cal\x20runt','\x20validat','pluginId','tarball:','pendenci','bug;\x20ver','es\x20','nd\x20after','unknown','red','-xJf','penClaw\x20','ntimeCha','play-pro','runtime:','tateDir','exec\x20\x22$S','ge\x20not\x20a','.tmp/run','fix\x20mark','isDirect','npm-cli.','some','extensio','lled','values','\x20found','npmCli','ujie-she','unction\x20','in\x20','--\x20\x22$(di','\x20entry\x20\x22','root','tching\x20p','agents\x20s','Dependen','runtimeR','pped;\x20di','_modules','@larksui','-doctor.','ugin\x20spe','pluginSp','cli','atch\x20alr','--json','base\x20alr','ing','openclaw','session\x20','d\x20to\x20','dules/np','ent','ad-','entryCou','ntime\x20re','mjs','>/dev/nu','--fix','\x20resolve','idated','.plugin-','ound','createRu','g\x20from\x20O','w.mjs','time]\x20in',',\x20shell.','lied','\x20timed\x20o','node','nifest=','add','ion','Run\x20\x22wuj','Configur','ie-shell','download','stalling','Name','Claw\x20ver','store\x20sq','STATE_DI','find','\x20can\x20ins','ready\x20ap','FILE%\x5c','toString','Claw','store\x20lo','el.inbou','ncies','generate','ecs','director','\x20install','store\x20wr','st=','m/bin/np','pped;\x20lo','push','ime/sess','--omit=p','store-lo','arch','../../sh','plied','\x22==\x22\x22\x20se','kill','utable','found','log','.cache','plugins','versions','local','resolved','-peer-de','\x20package','LocalSki','load:\x20','Bin','SIGTERM','enclaw\x20d','bin'];_0x21fa=function(){return _0x208dc0;};return _0x21fa();}async function resolveNpmRoot(){const _0x290707=_0x38e6be,_0x5db604=await runProcess(_0x290707(0x318),[_0x290707(0x378),'-g'],{'label':_0x290707(0x1d9)+_0x290707(0x338),'timeoutMs':0x7530}),_0x4ae1e5=join(_0x5db604[_0x290707(0x2b8)][_0x290707(0x339)](),_0x290707(0x318));if(!existsSync(join(_0x4ae1e5,_0x290707(0x1c9),_0x290707(0x36c)+'js')))throw new Error(_0x290707(0x2f6)+'age\x20was\x20'+'not\x20foun'+_0x290707(0x34a)+_0x290707(0x357)+'ime\x20buil'+_0x290707(0x32d)+_0x4ae1e5);return _0x4ae1e5;}async function downloadNodeRuntime(_0x4a36c1,_0x228edb){const _0x49182f=_0x38e6be,_0x3327a3=process[_0x49182f(0x260)]==='win32'?'win':process['platform'],_0x234b4b=process[_0x49182f(0x1b5)]===_0x49182f(0x216)?_0x49182f(0x216):process[_0x49182f(0x1b5)]==='arm64'?'arm64':process[_0x49182f(0x1b5)],_0x3bb539=process['platform']===_0x49182f(0x28e)?_0x49182f(0x2e4):_0x49182f(0x224),_0x4c8eb6=_0x49182f(0x241)+_0x4a36c1+'-'+_0x3327a3+'-'+_0x234b4b,_0x49adf5=_0x4c8eb6+'.'+_0x3bb539,_0x2af144=join(dirname(_0x228edb),_0x49182f(0x1bd)),_0x20d65d=join(_0x2af144,_0x49adf5),_0x3fadd2=join(_0x2af144,_0x4c8eb6+(_0x49182f(0x1cb)+'-')+process['pid']+'-'+Date[_0x49182f(0x267)]()),_0x1afac6=_0x49182f(0x310)+_0x49182f(0x354)+'rg/dist/'+'v'+_0x4a36c1+'/'+_0x49adf5;await mkdir(_0x2af144,{'recursive':!![]}),!existsSync(_0x20d65d)&&(console[_0x49182f(0x1bc)](_0x49182f(0x347)+_0x49182f(0x2a0)+_0x49182f(0x2bb)+_0x49182f(0x21f)+'g\x20'+_0x1afac6),await downloadFile(_0x1afac6,_0x20d65d)),await rm(_0x3fadd2,{'recursive':!![],'force':!![]}),await mkdir(_0x3fadd2,{'recursive':!![]}),process[_0x49182f(0x260)]==='win32'?await runProcess('unzip',['-q',_0x20d65d,'-d',_0x3fadd2],{'label':_0x49182f(0x27b)+_0x49adf5}):await runProcess(_0x49182f(0x29e),[_0x49182f(0x361),_0x20d65d,'-C',_0x3fadd2],{'label':_0x49182f(0x27b)+_0x49adf5}),await rename(join(_0x3fadd2,_0x4c8eb6),_0x228edb),await rm(_0x3fadd2,{'recursive':!![],'force':!![]});}async function downloadFile(_0x93912e,_0x1603b7){await mkdir(dirname(_0x1603b7),{'recursive':!![]});const _0x268af6=await new Promise((_0x5f4333,_0x2436e0)=>{get(_0x93912e,_0x25a0e1=>{const _0x3baebd=_0xfe4b;if(_0x25a0e1[_0x3baebd(0x1d3)+'de']>=0x12c&&_0x25a0e1[_0x3baebd(0x1d3)+'de']<0x190&&_0x25a0e1[_0x3baebd(0x256)]['location']){_0x25a0e1[_0x3baebd(0x26c)](),downloadFile(new URL(_0x25a0e1[_0x3baebd(0x256)][_0x3baebd(0x345)],_0x93912e)[_0x3baebd(0x1cd)],_0x1603b7)['then'](()=>_0x5f4333(null))['catch'](_0x2436e0);return;}if(_0x25a0e1[_0x3baebd(0x1d3)+'de']!==0xc8){_0x25a0e1[_0x3baebd(0x26c)](),_0x2436e0(new Error(_0x3baebd(0x19a)+_0x3baebd(0x1ef)+_0x25a0e1[_0x3baebd(0x1d3)+'de']+':\x20'+_0x93912e));return;}_0x5f4333(_0x25a0e1);})['on']('error',_0x2436e0);});_0x268af6&&await pipeline(_0x268af6,createWriteStream(_0x1603b7));}export async function ensureOpenClawDoctorFixed(_0x23f52c,_0x503b65={}){const _0x47503c=_0x38e6be,_0x1f8029=await loadRuntimeInfo(_0x23f52c[_0x47503c(0x1d6)+_0x47503c(0x211)]),_0x3e56d7=getConfigPaths(_0x23f52c),_0x17c976=join(_0x3e56d7[_0x47503c(0x27d)+_0x47503c(0x366)],_0x47503c(0x17d)+_0x47503c(0x175)+_0x47503c(0x304)),_0x73d80e=await readJson(_0x17c976,{});if(_0x73d80e[_0x47503c(0x17d)+_0x47503c(0x34e)]===_0x1f8029[_0x47503c(0x17d)+_0x47503c(0x34e)])return _0x503b65[_0x47503c(0x265)+_0x47503c(0x294)]?.[_0x47503c(0x204)]('openclaw'+_0x47503c(0x2db)+_0x47503c(0x308)+_0x47503c(0x244)+_0x47503c(0x181),{'openclawVersion':_0x1f8029[_0x47503c(0x17d)+'Version'],'markerPath':_0x17c976}),{'ran':![],'openclawVersion':_0x1f8029[_0x47503c(0x17d)+_0x47503c(0x34e)],'markerPath':_0x17c976};return await runOpenClawDoctorFix(_0x23f52c,_0x1f8029,{'fromVersion':_0x73d80e[_0x47503c(0x17d)+_0x47503c(0x34e)]||_0x47503c(0x35f),'toVersion':_0x1f8029[_0x47503c(0x17d)+_0x47503c(0x34e)],'markerPath':_0x17c976,'runtimeLogger':_0x503b65['runtimeL'+_0x47503c(0x294)]}),{'ran':!![],'openclawVersion':_0x1f8029[_0x47503c(0x17d)+_0x47503c(0x34e)],'markerPath':_0x17c976};}async function runOpenClawDoctorFix(_0x3d7622,_0x11156d,{fromVersion:_0x1aa05c,toVersion:_0x2906f6,markerPath:markerPath='',runtimeLogger:_0x573c83}={}){const _0xf4d6c5=_0x38e6be;_0x573c83?.[_0xf4d6c5(0x204)](_0xf4d6c5(0x17d)+_0xf4d6c5(0x2db)+'fix\x20star'+_0xf4d6c5(0x20d),{'fromVersion':_0x1aa05c,'toVersion':_0x2906f6});const _0x2531ff=await createRuntimeEnv(_0x11156d,{'OPENCLAW_HOME':_0x3d7622['dataDir'],'OPENCLAW_STATE_DIR':_0x3d7622['dataDir'],'OPENCLAW_CONFIG_PATH':getConfigPaths(_0x3d7622)[_0xf4d6c5(0x2e3)+'th']});console[_0xf4d6c5(0x1bc)](_0xf4d6c5(0x347)+_0xf4d6c5(0x2a0)+_0xf4d6c5(0x272)+'nning\x20op'+_0xf4d6c5(0x1c8)+_0xf4d6c5(0x1f2)+_0xf4d6c5(0x27e));const _0xd0f901=await runProcess(_0x11156d[_0xf4d6c5(0x255)+'utable'],[_0x11156d[_0xf4d6c5(0x17d)+_0xf4d6c5(0x1c6)],_0xf4d6c5(0x352),_0xf4d6c5(0x187)],{'cwd':_0x11156d['openclaw'+_0xf4d6c5(0x23d)+'ir'],'env':_0x2531ff,'label':_0xf4d6c5(0x17d)+'\x20doctor\x20'+_0xf4d6c5(0x187),'timeoutMs':0x1d4c0});_0x573c83?.[_0xf4d6c5(0x204)](_0xf4d6c5(0x17d)+_0xf4d6c5(0x2db)+_0xf4d6c5(0x258)+_0xf4d6c5(0x330),{'fromVersion':_0x1aa05c,'toVersion':_0x2906f6,'stdout':_0xd0f901[_0xf4d6c5(0x2b8)][_0xf4d6c5(0x339)]()[_0xf4d6c5(0x29b)](-0xfa0),'stderr':_0xd0f901[_0xf4d6c5(0x293)]['trim']()[_0xf4d6c5(0x29b)](-0xfa0)}),markerPath&&(await writeJson(markerPath,{'openclawVersion':_0x11156d[_0xf4d6c5(0x17d)+_0xf4d6c5(0x34e)],'fixedAt':new Date()[_0xf4d6c5(0x2d3)+_0xf4d6c5(0x17c)]()}),_0x573c83?.[_0xf4d6c5(0x204)]('openclaw'+_0xf4d6c5(0x2db)+_0xf4d6c5(0x36a)+_0xf4d6c5(0x221)+'en',{'markerPath':markerPath,'openclawVersion':_0x11156d[_0xf4d6c5(0x17d)+'Version']}));}export async function readRuntimeManifest(_0x3f8880){return await readJson(resolveManifestPath(_0x3f8880),{});}export async function loadRuntimeInfo(_0x107700){const _0x829341=resolveRuntimeRoot(_0x107700),_0x327e99=await readRuntimeManifest(_0x829341);return createRuntimeInfoFromManifest(_0x829341,_0x327e99);}function createRuntimeInfoFromManifest(_0x85b8b8,_0xc18396,_0x5ee6a5={}){const _0x2838e6=_0x38e6be;for(const _0x20a6ce of[_0x2838e6(0x255)+'utable',_0x2838e6(0x372),'openclaw'+_0x2838e6(0x23d)+'ir',_0x2838e6(0x17d)+'Bin']){if(typeof _0xc18396[_0x20a6ce]!==_0x2838e6(0x300)||!_0xc18396[_0x20a6ce][_0x2838e6(0x339)]())throw new Error(_0x2838e6(0x28f)+'manifest'+'\x20is\x20miss'+_0x2838e6(0x205)+_0x20a6ce+'\x22\x20at\x20'+resolveManifestPath(_0x85b8b8)+(_0x2838e6(0x1ee)+_0x2838e6(0x1e2)+'l\x20prepar'+'e'));}const _0x5282ec=resolve(_0x85b8b8,_0xc18396[_0x2838e6(0x255)+_0x2838e6(0x1ba)]),_0x21474b=resolve(_0x85b8b8,_0xc18396['npmCli']),_0x1ecf02=resolve(_0x85b8b8,_0xc18396[_0x2838e6(0x17d)+'WorkingD'+'ir']),_0x11991e=resolve(_0x85b8b8,_0xc18396['openclaw'+_0x2838e6(0x1c6)]),_0x3cc6e6=Array[_0x2838e6(0x2d5)](_0xc18396[_0x2838e6(0x1be)])?_0xc18396[_0x2838e6(0x1be)][_0x2838e6(0x2ad)](_0x2eab23=>({..._0x2eab23,'installPath':resolve(_0x85b8b8,_0x2eab23[_0x2838e6(0x208)+_0x2838e6(0x2ab)])})):[],_0x43f11f=_0x5ee6a5[_0x2838e6(0x2e9)+_0x2838e6(0x314)+_0x2838e6(0x1a5)]?[_0x5282ec,_0x21474b]:[_0x5282ec,_0x21474b,_0x1ecf02,_0x11991e];for(const _0x19b5aa of _0x43f11f){if(!existsSync(_0x19b5aa))throw new Error(_0x2838e6(0x28f)+'missing\x20'+'path:\x20'+_0x19b5aa);}return{'runtimeRoot':_0x85b8b8,'manifest':_0xc18396,'openclawVersion':_0xc18396[_0x2838e6(0x17d)+_0x2838e6(0x34e)]||_0x2838e6(0x35f),'nodeExecutable':_0x5282ec,'npmCli':_0x21474b,'openclawWorkingDir':_0x1ecf02,'openclawBin':_0x11991e,'plugins':_0x3cc6e6};}export async function spawnClaw(_0x4f4b9a,_0x4db3ad=[],_0x5d83e1={}){const _0x36a11c=_0x38e6be,_0x1b73f4=await loadRuntimeInfo(_0x4f4b9a),_0x3b82f5=await createRuntimeEnv(_0x1b73f4,_0x5d83e1[_0x36a11c(0x2cd)]??{});return spawn(_0x1b73f4[_0x36a11c(0x255)+_0x36a11c(0x1ba)],[_0x1b73f4[_0x36a11c(0x17d)+'Bin'],..._0x4db3ad],{'cwd':_0x1b73f4[_0x36a11c(0x17d)+_0x36a11c(0x23d)+'ir'],'stdio':'pipe',..._0x5d83e1,'env':_0x3b82f5});}export async function runClawOnce(_0x256b7c,_0x5c8cc3=[],_0x30abcd=0x15f90){const _0x12e33a=await spawnClaw(_0x256b7c,_0x5c8cc3);return await new Promise((_0x374e05,_0x4f92d0)=>{const _0x48dbf2=_0xfe4b;let _0x9f2622='',_0x4ca82e='',_0xf74d87=![];const _0x2caeb3=setTimeout(()=>{const _0x4eb296=_0xfe4b;if(_0xf74d87)return;_0xf74d87=!![],_0x12e33a[_0x4eb296(0x1b9)](_0x4eb296(0x1c7)),_0x4f92d0(new Error(_0x4eb296(0x17d)+_0x4eb296(0x192)+_0x4eb296(0x24f)+'\x20'+_0x30abcd+'ms'));},_0x30abcd);_0x12e33a[_0x48dbf2(0x2b8)]['on'](_0x48dbf2(0x22e),_0x5cedea=>{const _0x51a9d8=_0x48dbf2;_0x9f2622+=_0x5cedea[_0x51a9d8(0x1a4)]();}),_0x12e33a['stderr']['on']('data',_0x4f44b8=>{_0x4ca82e+=_0x4f44b8['toString']();}),_0x12e33a['on'](_0x48dbf2(0x24e),_0x2b4c2b=>{if(_0xf74d87)return;_0xf74d87=!![],clearTimeout(_0x2caeb3),_0x4f92d0(_0x2b4c2b);}),_0x12e33a['on'](_0x48dbf2(0x1ea),(_0x182bd8,_0x206ebf)=>{if(_0xf74d87)return;_0xf74d87=!![],clearTimeout(_0x2caeb3),_0x374e05({'code':_0x182bd8,'signal':_0x206ebf,'stdout':_0x9f2622,'stderr':_0x4ca82e});});});}async function findRuntimeLarkCliBin(_0x2a149a){const _0x5ab238=_0x38e6be,_0x2ae723=join(_0x2a149a[_0x5ab238(0x17d)+_0x5ab238(0x23d)+'ir'],'node_mod'+_0x5ab238(0x1fc),'@larksui'+'te',_0x5ab238(0x178)),_0x2d30c2=join(_0x2ae723,'package.'+_0x5ab238(0x304));if(!existsSync(_0x2d30c2))return{'packageDir':_0x2ae723,'binPath':null};try{const _0x40c781=JSON['parse'](await readFile(_0x2d30c2,_0x5ab238(0x206))),_0x5a461c=typeof _0x40c781[_0x5ab238(0x1c9)]===_0x5ab238(0x300)?_0x40c781[_0x5ab238(0x1c9)]:_0x40c781['bin']&&typeof _0x40c781['bin']===_0x5ab238(0x2df)?_0x40c781[_0x5ab238(0x1c9)][_0x5ab238(0x33d)]||Object[_0x5ab238(0x370)](_0x40c781[_0x5ab238(0x1c9)])[0x0]:'';return{'packageDir':_0x2ae723,'binPath':_0x5a461c?join(_0x2ae723,_0x5a461c):null};}catch{return{'packageDir':_0x2ae723,'binPath':null};}}export async function resolveRuntimeLarkCliCommand(_0x456852){const _0x55a9a3=_0x38e6be,{packageDir:_0x5adeb6,binPath:_0x2ca891}=await findRuntimeLarkCliBin(_0x456852);if(!_0x2ca891||!existsSync(_0x2ca891))throw new Error('Bundled\x20'+_0x55a9a3(0x37f)+'te/cli\x20i'+'s\x20missin'+_0x55a9a3(0x18d)+_0x55a9a3(0x362)+_0x55a9a3(0x365)+'\x20'+_0x5adeb6+(_0x55a9a3(0x355)+_0x55a9a3(0x373)+_0x55a9a3(0x2e2)+_0x55a9a3(0x2f1)+'ebuild\x20t'+'he\x20runti'+'me.'));return{'nodeExecutable':_0x456852[_0x55a9a3(0x255)+_0x55a9a3(0x1ba)],'scriptPath':_0x2ca891,'packageDir':_0x5adeb6};}function resolvePackageNameFromNpmSpec(_0x44512a){const _0x2f53df=_0x38e6be,_0x3d4d9e=_0x44512a['trim']()[_0x2f53df(0x1dd)](/^npm:/,'');if(!_0x3d4d9e)throw new Error(_0x2f53df(0x25f)+_0x2f53df(0x2c9)+_0x2f53df(0x176)+'c');if(_0x3d4d9e['startsWi'+'th']('@')){const _0x541f2d=_0x3d4d9e[_0x2f53df(0x263)]('/');if(_0x541f2d===-0x1)throw new Error(_0x2f53df(0x25f)+_0x2f53df(0x2f0)+_0x2f53df(0x264)+_0x44512a);const _0x192ff5=_0x3d4d9e[_0x2f53df(0x263)]('@',_0x541f2d+0x1);return _0x192ff5===-0x1?_0x3d4d9e:_0x3d4d9e[_0x2f53df(0x29b)](0x0,_0x192ff5);}const _0x1279e2=_0x3d4d9e[_0x2f53df(0x263)]('@');return _0x1279e2===-0x1?_0x3d4d9e:_0x3d4d9e['slice'](0x0,_0x1279e2);}async function createRuntimeEnv(_0x4fa740,_0x219ed5={}){const _0x396f88=_0x38e6be,_0x12cc27=process.env.OPENCLAW_STATE_DIR||'',_0xbbf866=process.env.NPM_CONFIG_REGISTRY||'https://'+_0x396f88(0x2a1)+_0x396f88(0x1d0)+_0x396f88(0x271),_0x5a6692=_0x12cc27?join(_0x12cc27,_0x396f88(0x207)+_0x396f88(0x2ba)+'ls'):join(_0x4fa740['runtimeR'+'oot'],_0x396f88(0x1d2)),_0x4a39f3=join(_0x5a6692,'npm-glob'+'al'),_0x5b8196=join(_0x5a6692,_0x396f88(0x210)+'e'),_0x12cf82=join(_0x4a39f3,_0x396f88(0x1c9));await mkdir(_0x12cf82,{'recursive':!![]}),await mkdir(_0x5b8196,{'recursive':!![]});const _0x242871=[_0x12cf82,dirname(_0x4fa740[_0x396f88(0x255)+'utable']),process.env.PATH||''];return{...process.env,..._0x219ed5,'PATH':_0x242871[_0x396f88(0x28d)](Boolean)[_0x396f88(0x27a)](delimiter),'npm_config_prefix':_0x4a39f3,'NPM_CONFIG_PREFIX':_0x4a39f3,'npm_config_cache':_0x5b8196,'NPM_CONFIG_CACHE':_0x5b8196,'NPM_CONFIG_REGISTRY':_0xbbf866,'npm_execpath':_0x4fa740[_0x396f88(0x372)],'npm_node_execpath':_0x4fa740[_0x396f88(0x255)+'utable'],'OPENCLAW_RUNTIME_NPM_PREFIX':_0x4a39f3,'OPENCLAW_RUNTIME_NPM_BIN':_0x12cf82};}export async function getRuntimeSpawnContext(_0x3c40a3,_0x3f4046={}){const _0x33adb9=_0x38e6be,_0x26af19=await loadRuntimeInfo(_0x3c40a3),_0x3d42b4=await createRuntimeEnv(_0x26af19,_0x3f4046);return{'cwd':_0x26af19[_0x33adb9(0x17d)+_0x33adb9(0x23d)+'ir'],'env':_0x3d42b4,'runtime':_0x26af19};}function resolvePluginDirNameFromSpec(_0x4d0a5c){const _0x34ff7c=_0x38e6be,_0x29e1e7=resolvePackageNameFromNpmSpec(_0x4d0a5c),_0x12988d=_0x29e1e7[_0x34ff7c(0x297)]('/')[_0x34ff7c(0x28d)](Boolean),_0x4e0f1a=_0x12988d['at'](-0x1)??'';if(!_0x4e0f1a)throw new Error('Invalid\x20'+_0x34ff7c(0x1de)+_0x34ff7c(0x264)+_0x4d0a5c);return _0x4e0f1a;}async function resolvePluginIdFromPackageDir(_0x3f0063,_0x224d58){const _0x56598c=_0x38e6be,_0x3e4373=await readJson(join(_0x3f0063,_0x56598c(0x2ae)+_0x56598c(0x304)),{}),_0x291e27=await readPluginManifest(_0x3f0063),_0x4f0681=[_0x291e27?.['id'],_0x291e27?.['pluginId'],_0x291e27?.['name'],_0x3e4373?.[_0x56598c(0x17d)]?.['id'],_0x3e4373?.['openclaw'+'Id'],_0x224d58],_0x3a6b69=_0x4f0681[_0x56598c(0x1a0)](_0xc02630=>typeof _0xc02630==='string'&&_0xc02630['trim']());if(!_0x3a6b69)throw new Error(_0x56598c(0x2c6)+'o\x20resolv'+'e\x20plugin'+_0x56598c(0x2ca)+'\x20'+_0x3f0063);return _0x3a6b69[_0x56598c(0x339)]();}function pluginSpecMatches(_0x2db532,_0x35d2d9){const _0x26d0f3=_0x38e6be,_0x3f8498=_0x35d2d9[_0x26d0f3(0x339)](),_0x47e9f4=resolvePackageNameFromNpmSpec(_0x3f8498);return[_0x2db532[_0x26d0f3(0x25b)],_0x2db532[_0x26d0f3(0x1c1)+_0x26d0f3(0x317)],_0x2db532[_0x26d0f3(0x1c1)+_0x26d0f3(0x19c)]][_0x26d0f3(0x36d)](_0x43f77e=>_0x43f77e===_0x3f8498||_0x43f77e===_0x47e9f4);}async function installPluginFromNpmSpec(_0x5700d7,_0x11e72a,_0x2329dd={}){const _0x2b0bcf=_0x38e6be,_0x4136c9=_0x5700d7['trim']()['replace'](/^npm:/,''),_0x15321f=resolvePluginDirNameFromSpec(_0x4136c9),_0x1bf24b=join(_0x11e72a['openclaw'+_0x2b0bcf(0x23d)+'ir'],'dist',_0x2b0bcf(0x36e)+'ns'),_0x286d89=join(_0x1bf24b,_0x15321f),_0x3a998a=join(_0x11e72a[_0x2b0bcf(0x37c)+_0x2b0bcf(0x211)],_0x2b0bcf(0x18a)+_0x2b0bcf(0x1e3)+process['pid']+'-'+Date[_0x2b0bcf(0x267)]()),_0x596807=await createRuntimeEnv(_0x11e72a),_0x351d43=new Date()[_0x2b0bcf(0x2d3)+_0x2b0bcf(0x17c)](),_0x4312a0=join(_0x11e72a[_0x2b0bcf(0x37c)+_0x2b0bcf(0x211)],_0x2b0bcf(0x1bd));await mkdir(_0x4312a0,{'recursive':!![]}),await rm(_0x3a998a,{'recursive':!![],'force':!![]}),await rm(_0x286d89,{'recursive':!![],'force':!![]}),await mkdir(_0x3a998a,{'recursive':!![]}),await mkdir(_0x1bf24b,{'recursive':!![]}),console['log'](_0x2b0bcf(0x347)+_0x2b0bcf(0x2a0)+_0x2b0bcf(0x246)+_0x2b0bcf(0x379)+_0x2b0bcf(0x31f)+_0x4136c9);const _0x105d27=await runProcess(_0x11e72a[_0x2b0bcf(0x255)+_0x2b0bcf(0x1ba)],[_0x11e72a[_0x2b0bcf(0x372)],'pack',_0x4136c9,_0x2b0bcf(0x17a)],{'cwd':_0x4312a0,'env':_0x596807,'label':'npm\x20pack'+'\x20'+_0x4136c9}),_0x328ce3=parseNpmPackJson(_0x105d27[_0x2b0bcf(0x2b8)]),_0x394fe3=normalizePackedTarballFilename(_0x328ce3[_0x2b0bcf(0x253)]),_0x15186d=join(_0x4312a0,_0x394fe3);if(!existsSync(_0x15186d))throw new Error(_0x2b0bcf(0x2f6)+_0x2b0bcf(0x2c2)+_0x2b0bcf(0x343)+_0x2b0bcf(0x35a)+'\x20'+_0x15186d);await runProcess(_0x2b0bcf(0x29e),[_0x2b0bcf(0x2a3),_0x15186d,'-C',_0x3a998a],{'label':_0x2b0bcf(0x27b)+_0x394fe3}),await rename(join(_0x3a998a,_0x2b0bcf(0x2e5)),_0x286d89),await rm(_0x3a998a,{'recursive':!![],'force':!![]});const _0x28f323=join(_0x286d89,_0x2b0bcf(0x2ae)+_0x2b0bcf(0x304)),_0x3e16f8=await readJson(_0x28f323,{});(_0x3e16f8['devDepen'+'dencies']||_0x3e16f8[_0x2b0bcf(0x2dd)])&&(delete _0x3e16f8['devDepen'+_0x2b0bcf(0x298)],delete _0x3e16f8[_0x2b0bcf(0x2dd)],await writeJson(_0x28f323,_0x3e16f8));await runProcess(_0x11e72a[_0x2b0bcf(0x255)+_0x2b0bcf(0x1ba)],[_0x11e72a[_0x2b0bcf(0x372)],_0x2b0bcf(0x277),_0x2b0bcf(0x29c)+'ev',_0x2b0bcf(0x1b3)+_0x2b0bcf(0x2f3),_0x2b0bcf(0x270)+'it','--no-fun'+'d','--legacy'+_0x2b0bcf(0x1c2)+'ps'],{'cwd':_0x286d89,'env':_0x596807,'label':_0x2b0bcf(0x24c)+_0x2b0bcf(0x2d2)+_0x2b0bcf(0x375)+_0x4136c9});const _0x55f206=new Date()[_0x2b0bcf(0x2d3)+_0x2b0bcf(0x17c)](),_0x1e2472=await resolvePluginIdFromPackageDir(_0x286d89,_0x328ce3[_0x2b0bcf(0x1ec)]);return _0x2329dd[_0x2b0bcf(0x265)+_0x2b0bcf(0x294)]?.[_0x2b0bcf(0x204)]('npm\x20plug'+_0x2b0bcf(0x1cc)+_0x2b0bcf(0x36f),{'spec':_0x4136c9,'pluginId':_0x1e2472,'installPath':_0x286d89}),{'pluginId':_0x1e2472,'source':_0x2b0bcf(0x318),'spec':_0x4136c9,'installPath':toRuntimeRelative(_0x11e72a['runtimeR'+_0x2b0bcf(0x211)],_0x286d89),'version':_0x328ce3[_0x2b0bcf(0x2aa)],'resolvedName':_0x328ce3[_0x2b0bcf(0x1ec)],'resolvedVersion':_0x328ce3[_0x2b0bcf(0x2aa)],'resolvedSpec':_0x328ce3[_0x2b0bcf(0x1ec)]+'@'+_0x328ce3[_0x2b0bcf(0x2aa)],'integrity':typeof _0x328ce3['integrit'+'y']===_0x2b0bcf(0x300)?_0x328ce3[_0x2b0bcf(0x2cb)+'y']:'','shasum':typeof _0x328ce3['shasum']===_0x2b0bcf(0x300)?_0x328ce3['shasum']:'','resolvedAt':_0x351d43,'installedAt':_0x55f206};}async function syncConfiguredNpmPlugins(_0x4a7eb9,_0x5b0143,_0x229db5,_0x17c56e={}){const _0x2ffded=_0x38e6be;if(_0x17c56e['syncOnly'])return;const _0x358d2a=createRuntimeInfoFromManifest(_0x5b0143,_0x229db5),_0x4110f6=Array[_0x2ffded(0x2d5)](_0x229db5[_0x2ffded(0x1be)])?_0x229db5['plugins']:[],_0x546268=[];for(const _0x1cf69b of _0x4a7eb9[_0x2ffded(0x17d)][_0x2ffded(0x177)+'ecs']){const _0x233a32=_0x4110f6['find'](_0x219224=>_0x219224?.[_0x2ffded(0x351)]===_0x2ffded(0x318)&&pluginSpecMatches(_0x219224,_0x1cf69b)&&typeof _0x219224[_0x2ffded(0x208)+'ath']===_0x2ffded(0x300)&&existsSync(resolve(_0x5b0143,_0x219224[_0x2ffded(0x208)+_0x2ffded(0x2ab)])));if(_0x233a32){_0x546268[_0x2ffded(0x1b1)](_0x233a32);continue;}_0x546268[_0x2ffded(0x1b1)](await installPluginFromNpmSpec(_0x1cf69b,_0x358d2a,_0x17c56e));}const _0x4b28f7=new Set(_0x4a7eb9['openclaw']['pluginSp'+_0x2ffded(0x1aa)][_0x2ffded(0x2ad)](resolvePackageNameFromNpmSpec)),_0xb532af=_0x4110f6[_0x2ffded(0x28d)](_0x59258d=>_0x59258d?.[_0x2ffded(0x351)]!==_0x2ffded(0x318)||!_0x4b28f7[_0x2ffded(0x2e7)](resolvePackageNameFromNpmSpec(_0x59258d[_0x2ffded(0x1c1)+'Name']||_0x59258d[_0x2ffded(0x25b)]||'')));_0x229db5['plugins']=[..._0xb532af,..._0x546268];}function hasRuntimeDependencies(_0x154d5c){const _0x206318=_0x38e6be,_0x1904ec=_0x154d5c?.[_0x206318(0x2e1)+'cies']&&typeof _0x154d5c['dependen'+'cies']===_0x206318(0x2df)?Object[_0x206318(0x1ca)](_0x154d5c[_0x206318(0x2e1)+_0x206318(0x1e4)]):[],_0xaa7367=_0x154d5c?.[_0x206318(0x23c)+'Dependen'+_0x206318(0x1e4)]&&typeof _0x154d5c[_0x206318(0x23c)+_0x206318(0x37b)+_0x206318(0x1e4)]===_0x206318(0x2df)?Object[_0x206318(0x1ca)](_0x154d5c[_0x206318(0x23c)+_0x206318(0x37b)+_0x206318(0x1e4)]):[];return _0x1904ec['length']>0x0||_0xaa7367[_0x206318(0x31a)]>0x0;}async function installLocalPluginRuntimeDependencies(_0x4178f6,_0x136455,_0x5e74b0){const _0x2bafd6=_0x38e6be,_0x1a205f=join(_0x4178f6,'package.'+_0x2bafd6(0x304)),_0x17debc=await readJson(_0x1a205f,{});(_0x17debc[_0x2bafd6(0x302)+'dencies']||_0x17debc[_0x2bafd6(0x2dd)])&&(delete _0x17debc['devDepen'+'dencies'],delete _0x17debc[_0x2bafd6(0x2dd)],await writeJson(_0x1a205f,_0x17debc));if(!hasRuntimeDependencies(_0x17debc))return;const _0x3710a6=await createRuntimeEnv(_0x136455);console[_0x2bafd6(0x1bc)](_0x2bafd6(0x347)+_0x2bafd6(0x2a0)+_0x2bafd6(0x18f)+_0x2bafd6(0x19b)+_0x2bafd6(0x218)+_0x2bafd6(0x319)+_0x2bafd6(0x35b)+_0x2bafd6(0x35d)+_0x4178f6),await runProcess(_0x136455[_0x2bafd6(0x255)+_0x2bafd6(0x1ba)],[_0x136455[_0x2bafd6(0x372)],_0x2bafd6(0x277),_0x2bafd6(0x29c)+'ev',_0x2bafd6(0x1b3)+'eer',_0x2bafd6(0x270)+'it',_0x2bafd6(0x219)+'d',_0x2bafd6(0x348)+_0x2bafd6(0x1c2)+'ps'],{'cwd':_0x4178f6,'env':_0x3710a6,'label':_0x2bafd6(0x24c)+_0x2bafd6(0x23e)+_0x2bafd6(0x2e8)+'\x20'+_0x4178f6}),_0x5e74b0[_0x2bafd6(0x265)+_0x2bafd6(0x294)]?.[_0x2bafd6(0x204)](_0x2bafd6(0x2d4)+_0x2bafd6(0x1f1)+_0x2bafd6(0x1d1)+_0x2bafd6(0x273)+_0x2bafd6(0x2ef),{'installPath':_0x4178f6});}async function syncSharedPluginModules(_0x528388,_0x6f8b05){const _0x387d09=_0x38e6be,_0xcc65d6=new Set();for(const _0x355a28 of _0x528388){const _0x59f76f=join(dirname(_0x355a28),_0x387d09(0x236));if(existsSync(_0x59f76f))_0xcc65d6[_0x387d09(0x195)](_0x59f76f);}for(const _0xefdb26 of _0xcc65d6){await copyDirFresh(_0xefdb26,join(_0x6f8b05,_0x387d09(0x236)));}}async function syncProductPlugins(_0x99d4d,_0x48db4d,_0x366ef8,_0x2502af={}){const _0x273bee=_0x38e6be,_0x28bae0=join(_0x48db4d,_0x273bee(0x17d),_0x273bee(0x269),'extensio'+'ns'),_0x54abbc=createRuntimeInfoFromManifest(_0x48db4d,_0x366ef8),_0x59636a=[];await syncSharedPluginModules(_0x99d4d[_0x273bee(0x17d)][_0x273bee(0x1c1)+_0x273bee(0x2c0)+_0x273bee(0x1f6)],_0x28bae0);for(const _0xe6d025 of _0x99d4d[_0x273bee(0x17d)][_0x273bee(0x1c1)+_0x273bee(0x2c0)+_0x273bee(0x1f6)]){const _0x49b648=await getPackageMetadata(_0xe6d025),_0x2e6646=await readPluginManifest(_0xe6d025),_0x5571cc=join(_0x28bae0,_0x49b648[_0x273bee(0x359)]);await copyDirFresh(_0xe6d025,_0x5571cc),await installLocalPluginRuntimeDependencies(_0x5571cc,_0x54abbc,_0x2502af),_0x59636a['push']({'pluginId':_0x49b648[_0x273bee(0x359)],'source':'local','spec':_0x273bee(0x289)+_0xe6d025,'installPath':toRuntimeRelative(_0x48db4d,_0x5571cc),'version':_0x49b648['version'],'resolvedName':_0x49b648[_0x273bee(0x1ec)],'resolvedVersion':_0x49b648[_0x273bee(0x2aa)],'resolvedSpec':'local:'+_0xe6d025,'integrity':'','shasum':'','resolvedAt':new Date()[_0x273bee(0x2d3)+'ing'](),'installedAt':new Date()[_0x273bee(0x2d3)+_0x273bee(0x17c)](),'agentScope':_0x2e6646[_0x273bee(0x202)+'pe'],'skills':_0x2e6646[_0x273bee(0x245)]});}const _0x481a09=new Set(_0x59636a[_0x273bee(0x2ad)](_0x425cc9=>_0x425cc9[_0x273bee(0x359)])),_0x4a9e4f=Array[_0x273bee(0x2d5)](_0x366ef8[_0x273bee(0x1be)])?_0x366ef8[_0x273bee(0x1be)][_0x273bee(0x28d)](_0x461bb9=>!_0x481a09['has'](_0x461bb9[_0x273bee(0x359)])):[];_0x366ef8[_0x273bee(0x1be)]=[..._0x4a9e4f,..._0x59636a];}async function syncManifestPluginScope(_0x1a8245,_0x1ee2c1,_0x36535b){const _0x2c441e=_0x38e6be,_0x35dc15=join(_0x1ee2c1,'openclaw',_0x2c441e(0x269),_0x2c441e(0x36e)+'ns'),_0x21abe1=new Set(_0x1a8245['openclaw'][_0x2c441e(0x177)+'ecs']??[]),_0x5d52f9=new Set([..._0x21abe1][_0x2c441e(0x2ad)](_0x398d5d=>_0x398d5d[_0x2c441e(0x1dd)](/^npm:/,''))[_0x2c441e(0x2ad)](_0x295e4c=>{const _0x317043=_0x2c441e;if(_0x295e4c[_0x317043(0x20b)+'th']('@')){const _0x5c0175=_0x295e4c[_0x317043(0x297)]('@');return _0x5c0175['length']>=0x3?'@'+_0x5c0175[0x1]:_0x295e4c;}return _0x295e4c[_0x317043(0x297)]('@')[0x0];})[_0x2c441e(0x28d)](Boolean)),_0x76bfe=new Set();for(const _0x58fb1f of _0x1a8245['openclaw']['resolved'+'LocalPlu'+_0x2c441e(0x1f6)]){const _0x1d2c8a=await getPackageMetadata(_0x58fb1f);if(_0x1d2c8a[_0x2c441e(0x359)])_0x76bfe[_0x2c441e(0x195)](_0x1d2c8a[_0x2c441e(0x359)]);}const _0x3a2273=Array['isArray'](_0x36535b[_0x2c441e(0x1be)])?_0x36535b[_0x2c441e(0x1be)]:[];_0x36535b[_0x2c441e(0x177)+_0x2c441e(0x1aa)]=[..._0x1a8245['openclaw'][_0x2c441e(0x177)+_0x2c441e(0x1aa)],..._0x1a8245['openclaw']['resolved'+_0x2c441e(0x2c0)+_0x2c441e(0x1f6)][_0x2c441e(0x2ad)](_0x15f574=>_0x2c441e(0x289)+_0x15f574)],_0x36535b[_0x2c441e(0x1be)]=_0x3a2273['filter'](_0x2181fc=>{const _0x17540b=_0x2c441e;if(!_0x2181fc||typeof _0x2181fc!==_0x17540b(0x2df))return![];if(_0x2181fc[_0x17540b(0x351)]===_0x17540b(0x1c0))return _0x76bfe[_0x17540b(0x2e7)](_0x2181fc['pluginId']);if(_0x2181fc['source']===_0x17540b(0x318))return _0x21abe1[_0x17540b(0x2e7)](_0x2181fc[_0x17540b(0x25b)])||_0x21abe1[_0x17540b(0x2e7)](_0x2181fc[_0x17540b(0x1c1)+_0x17540b(0x317)])||_0x5d52f9[_0x17540b(0x2e7)](_0x2181fc[_0x17540b(0x1c1)+_0x17540b(0x19c)]);return![];});const _0x566000=new Set(_0x36535b[_0x2c441e(0x1be)][_0x2c441e(0x2ad)](_0xf0ad74=>_0xf0ad74[_0x2c441e(0x359)]));for(const _0xaaa722 of _0x3a2273){if(!_0xaaa722[_0x2c441e(0x359)]||_0x566000[_0x2c441e(0x2e7)](_0xaaa722[_0x2c441e(0x359)]))continue;const _0x16c465=typeof _0xaaa722[_0x2c441e(0x208)+_0x2c441e(0x2ab)]===_0x2c441e(0x300)&&_0xaaa722[_0x2c441e(0x208)+_0x2c441e(0x2ab)][_0x2c441e(0x339)]()?resolve(_0x1ee2c1,_0xaaa722[_0x2c441e(0x208)+_0x2c441e(0x2ab)]):join(_0x35dc15,_0xaaa722['pluginId']),_0x41ea5b=relative(_0x35dc15,_0x16c465);if(_0x41ea5b[_0x2c441e(0x20b)+'th']('..')||_0x41ea5b==='')continue;await rm(_0x16c465,{'recursive':!![],'force':!![]});}}async function collectCapabilityEntries(_0x46f563,_0x15f9ce){const _0xa9b4f7=_0x38e6be,_0x80dda7=new Map();for(const _0x14aa16 of _0x46f563){let _0x37cb6d;try{_0x37cb6d=await stat(_0x14aa16);}catch{throw new Error(_0x15f9ce+('\x20path\x20wa'+_0xa9b4f7(0x1e8)+_0xa9b4f7(0x27c))+_0x14aa16);}if(!_0x37cb6d[_0xa9b4f7(0x36b)+'ory']())throw new Error(_0x15f9ce+(_0xa9b4f7(0x33c)+_0xa9b4f7(0x2f2)+_0xa9b4f7(0x1ab)+_0xa9b4f7(0x281))+_0x14aa16);const _0x403806={'name':basename(_0x14aa16),'path':_0x14aa16},_0x386e80=_0x80dda7['get'](_0x403806[_0xa9b4f7(0x1ec)]);if(_0x386e80)throw new Error('Duplicat'+'e\x20'+_0x15f9ce+_0xa9b4f7(0x377)+_0x403806[_0xa9b4f7(0x1ec)]+'\x22\x20from\x20'+_0x386e80[_0xa9b4f7(0x278)]+_0xa9b4f7(0x249)+_0x403806[_0xa9b4f7(0x278)]);_0x80dda7['set'](_0x403806['name'],_0x403806);}return[..._0x80dda7[_0xa9b4f7(0x370)]()];}async function syncProductCapabilityDirs(_0x17672d,_0x147250,_0x2e3161){const _0x38449f=_0x38e6be,_0x82458a=await collectCapabilityEntries(_0x17672d,_0x2e3161);await rm(_0x147250,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await mkdir(_0x147250,{'recursive':!![]});for(const _0x29906d of _0x82458a){await cp(_0x29906d[_0x38449f(0x278)],join(_0x147250,_0x29906d[_0x38449f(0x1ec)]),{'recursive':!![]});}return _0x82458a[_0x38449f(0x31a)];}export const __test__={'collectCapabilityEntries':collectCapabilityEntries,'syncProductCapabilityDirs':syncProductCapabilityDirs};async function syncProductAgents(_0x2c11ad,_0xba94ef,_0x39eeae){const _0x43c1f3=_0x38e6be,_0x36efcf=join(_0xba94ef,_0x43c1f3(0x17d),_0x43c1f3(0x312)),_0x362521=await syncProductCapabilityDirs(_0x2c11ad[_0x43c1f3(0x17d)][_0x43c1f3(0x1c1)+_0x43c1f3(0x215)+'ntPaths'],_0x36efcf,'agent');_0x39eeae['agents']={'source':_0x43c1f3(0x2d9),'installPath':toRuntimeRelative(_0xba94ef,_0x36efcf),'localPaths':_0x2c11ad['openclaw'][_0x43c1f3(0x1c1)+_0x43c1f3(0x215)+_0x43c1f3(0x2c8)],'entryCount':_0x362521};}async function syncProductSkills(_0x3570bf,_0x4d0cee,_0x5658bb){const _0x39c098=_0x38e6be,_0x247ccb=join(_0x4d0cee,_0x39c098(0x17d),'skills'),_0x24474f=await syncProductCapabilityDirs(_0x3570bf['openclaw'][_0x39c098(0x1c1)+_0x39c098(0x1c4)+_0x39c098(0x1e1)],_0x247ccb,_0x39c098(0x227));_0x5658bb['skills']={'source':_0x39c098(0x2d9),'installPath':toRuntimeRelative(_0x4d0cee,_0x247ccb),'localPaths':_0x3570bf['openclaw']['resolved'+_0x39c098(0x1c4)+_0x39c098(0x1e1)],'entryCount':_0x24474f};}
|
|
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 _0x3cc0(_0x2e5281,_0x15f7c9){_0x2e5281=_0x2e5281-0xf3;const _0x562343=_0x5623();let _0x3cc0cc=_0x562343[_0x2e5281];return _0x3cc0cc;}function _0x5623(){const _0x1e0cb1=['channel\x20','ME_REFLE','ns));\x0a\x09\x09','null;','167503EjPbam','sureWuji','ound\x20??\x20','=\x20{\x0a\x09\x09\x09\x09','includes','e)\x20=>\x20{\x0a','ect\x22\x20?\x20r','ntime\x20=\x20','ime\x20=\x20wu','n\x20??\x20exi','runtimeC','nbound:\x20','tingChan','untime.t','time\x20=\x20(','already-','ateRunti','e\x20!==\x20\x22o','\x20createR','el\x20}\x20fro','nst\x20exis','turn:\x20ex','ssion\x20??','annel\x20as','inbound\x20','untime.c',')\x20=>\x20{\x0a\x09','istingCh','annel.se','inRuntim','sion:\x20ex','meOption','e.inboun','om\x20\x22node','urn:\x20exi','Runtime.','hannel?.','\x20typeof\x20',':crypto\x22','ZY_RUNTI','nnel.tur','9042780iDKyzZ','ntime.in','eatePlug','\x20{};\x0a\x09\x09\x09','runtime-','\x09\x09\x09if\x20(!','28642864JWGARX','meChanne','nnel?.in','resolved','nnel.inb','imeChann','YS);','solveCre','urn\x20??\x20c','Channel(','\x20channel','const\x20re','elRuntim','e()(opti','\x09return\x20','e.reply,','\x20(runtim','eChannel','null;\x0a\x09\x09','nel\x20=\x20ru','()(optio','\x09\x09const\x20','l.reply\x20','1600816RJnRWF','solvedRu','ons.runt','runtime\x20','runtime.','eContext','\x09\x09let\x20re','session\x0a',');\x0a\x09\x09\x09co','444nzRkIq','l,\x0a\x09\x09\x09\x09r','??\x20chann','s,\x0a\x09\x09\x09\x09i','ontexts\x20','\x09\x09\x09reply','..existi','solveRun','2985819lWxSqF','bound,\x0a\x09','elpers\x20=','nnelRunt','ash\x20}\x20fr','esolveCr','portPath','CTION_KE','Runtime;','n\x20&&\x20run','bound?.r','edRuntim','rn\x20runti','turn?.ru','RuntimeH','ns.runti','stingCha','imeOptio','\x09\x09\x09if\x20(r','3092246NwPnjO','bject\x22)\x20','existing','jieCreat','\x0a\x09\x09\x09\x09ses','elpers(r','untimeCo','import\x20{','channelR','ntexts:\x20','eRuntime','patched','d,\x0a\x09\x09\x09\x09t','||\x20typeo','f\x20runtim','ntime;\x0a\x09','onst\x20cha','\x20createH','untime;\x0a','rn\x20??','ot-provi','e\x20??=\x20en','e,\x0a\x09\x09\x09\x09.','\x09\x09\x09};\x0a\x09\x09','return\x20r','e\x20??=\x20re','===\x20\x22obj','replace','channel-','444063KLBUjL','\x0a\x09\x09};\x0a\x09\x09','\x09\x09resolv','me;\x0a\x09\x09\x09c','indexOf','ngChanne','Channel.','imePromi','...chann','un)\x20retu','ot-found','not-foun','annel\x20&&'];_0x5623=function(){return _0x1e0cb1;};return _0x5623();}(function(_0x3b5cbb,_0x53da70){const _0x18eac8=_0x3cc0,_0x5206dd=_0x3b5cbb();while(!![]){try{const _0xb76922=-parseInt(_0x18eac8(0xf5))/0x1+-parseInt(_0x18eac8(0x170))/0x2+-parseInt(_0x18eac8(0x15d))/0x3+parseInt(_0x18eac8(0x14c))/0x4+-parseInt(_0x18eac8(0x12f))/0x5+parseInt(_0x18eac8(0x155))/0x6*(parseInt(_0x18eac8(0x106))/0x7)+parseInt(_0x18eac8(0x135))/0x8;if(_0xb76922===_0x53da70)break;else _0x5206dd['push'](_0x5206dd['shift']());}catch(_0xafe6e5){_0x5206dd['push'](_0x5206dd['shift']());}}}(_0x5623,0xe9b6d));export function patchChannelPluginRuntimeFromSource(_0x30cb50,_0x125002={}){const _0x1503db=_0x3cc0,_0x574cce=_0x125002['runtimeC'+'hannelIm'+_0x1503db(0x163)];if(!_0x574cce)return{'patched':![],'reason':_0x1503db(0x133)+_0x1503db(0xf4)+'import-n'+_0x1503db(0x184)+'ded'};if(_0x30cb50['includes']('wujieCre'+_0x1503db(0x116)+_0x1503db(0x136)+'l')){if(_0x30cb50[_0x1503db(0x10a)](_0x1503db(0x11b)+'istingCh'+'annel.tu'+_0x1503db(0x183))&&hasRuntimeChannelImport(_0x30cb50,_0x574cce))return{'patched':![],'reason':_0x1503db(0x115)+_0x1503db(0x17b)};return patchExistingChannelPluginRuntimeFromSource(_0x30cb50,{'runtimeChannelImportPath':_0x574cce});}if(_0x30cb50[_0x1503db(0x10a)]('wujieCha'+_0x1503db(0x160)+_0x1503db(0xfc)+'se'))return patchExistingChannelPluginRuntimeFromSource(_0x30cb50,{'runtimeChannelImportPath':_0x574cce});const _0x4186b9='\x09\x09let\x20re'+_0x1503db(0x14d)+_0x1503db(0x10d)+_0x1503db(0x147)+_0x1503db(0x140)+'solveRun'+'time\x20=\x20('+_0x1503db(0x120)+_0x1503db(0xf7)+'edRuntim'+_0x1503db(0x189)+_0x1503db(0x13c)+'atePlugi'+'nRuntime'+_0x1503db(0x149)+_0x1503db(0x16c)+_0x1503db(0x125)+'s);\x0a\x09\x09\x09r'+'eturn\x20re'+'solvedRu'+_0x1503db(0x17f)+'\x09};';if(!_0x30cb50[_0x1503db(0x10a)](_0x4186b9))return{'patched':![],'reason':_0x1503db(0x100)+'d'};const _0x107d67=_0x1503db(0x177)+_0x1503db(0x181)+_0x1503db(0x161)+_0x1503db(0x127)+':crypto\x22'+';';if(!_0x30cb50[_0x1503db(0x10a)](_0x107d67))return{'patched':![],'reason':'import-n'+_0x1503db(0xff)};const _0x39235d=_0x1503db(0x152)+_0x1503db(0x14d)+_0x1503db(0x10d)+_0x1503db(0x147)+'const\x20en'+_0x1503db(0x107)+'eChannel'+_0x1503db(0x16b)+_0x1503db(0x15f)+_0x1503db(0x145)+_0x1503db(0x10b)+_0x1503db(0x134)+_0x1503db(0x14f)+_0x1503db(0x17d)+'f\x20runtim'+_0x1503db(0x117)+_0x1503db(0x171)+'return\x20r'+'untime;\x0a'+'\x09\x09\x09if\x20(r'+_0x1503db(0x11f)+_0x1503db(0x12a)+_0x1503db(0x16a)+'n\x20&&\x20run'+'time.cha'+_0x1503db(0x137)+_0x1503db(0x167)+_0x1503db(0xfe)+_0x1503db(0x169)+'me;\x0a\x09\x09\x09c'+_0x1503db(0x180)+_0x1503db(0x160)+_0x1503db(0x10e)+_0x1503db(0x173)+_0x1503db(0x17a)+_0x1503db(0x13e)+_0x1503db(0x154)+_0x1503db(0x11a)+_0x1503db(0x112)+_0x1503db(0x148)+'ntime.ch'+_0x1503db(0x101)+_0x1503db(0x12b)+_0x1503db(0x150)+_0x1503db(0x102)+_0x1503db(0x18a)+_0x1503db(0x10c)+'untime.c'+'hannel\x20:'+_0x1503db(0x132)+'runtime.'+_0x1503db(0x102)+_0x1503db(0x109)+_0x1503db(0xfd)+_0x1503db(0x141)+_0x1503db(0x186)+_0x1503db(0x15b)+_0x1503db(0xfa)+_0x1503db(0x156)+'untimeCo'+_0x1503db(0x179)+_0x1503db(0x172)+_0x1503db(0xfb)+_0x1503db(0x110)+_0x1503db(0x159)+_0x1503db(0x157)+'elRuntim'+'e.runtim'+'eContext'+_0x1503db(0x158)+'nbound:\x20'+_0x1503db(0x172)+'Channel.'+_0x1503db(0x11e)+'??\x20chann'+_0x1503db(0x141)+_0x1503db(0x126)+'d,\x0a\x09\x09\x09\x09t'+_0x1503db(0x128)+_0x1503db(0x16d)+'nnel.tur'+_0x1503db(0x10f)+'stingCha'+_0x1503db(0x139)+_0x1503db(0x108)+'channelR'+_0x1503db(0x113)+_0x1503db(0x13d)+'hannelRu'+_0x1503db(0x130)+_0x1503db(0x15e)+'\x09\x09\x09reply'+':\x20existi'+_0x1503db(0xfa)+_0x1503db(0x14b)+_0x1503db(0x157)+'elRuntim'+'e.reply,'+_0x1503db(0x174)+_0x1503db(0x124)+_0x1503db(0x121)+_0x1503db(0x122)+'ssion\x20??'+_0x1503db(0x13f)+_0x1503db(0x129)+_0x1503db(0x153)+_0x1503db(0x187)+_0x1503db(0x143)+'runtime;'+_0x1503db(0xf6)+_0x1503db(0x140)+_0x1503db(0x15c)+_0x1503db(0x114)+')\x20=>\x20{\x0a\x09'+'\x09\x09resolv'+'edRuntim'+_0x1503db(0x185)+_0x1503db(0x107)+_0x1503db(0x146)+_0x1503db(0x16b)+_0x1503db(0x175)+_0x1503db(0x162)+'eatePlug'+_0x1503db(0x123)+_0x1503db(0x142)+(_0x1503db(0x14e)+_0x1503db(0x16e)+_0x1503db(0x104)+_0x1503db(0x143)+_0x1503db(0x138)+_0x1503db(0x165)+'\x0a\x09\x09};');return{'patched':!![],'source':_0x30cb50[_0x1503db(0xf3)](_0x107d67,_0x107d67+'\x0a'+createRuntimeChannelImport(_0x574cce))[_0x1503db(0xf3)](_0x4186b9,_0x39235d)};}function patchExistingChannelPluginRuntimeFromSource(_0x114ce1,_0x357518){const _0x1f9920=_0x3cc0,{runtimeChannelImportPath:_0x167d18}=_0x357518,_0x4b4c6f=_0x1f9920(0x177)+'\x20createH'+_0x1f9920(0x161)+_0x1f9920(0x127)+_0x1f9920(0x12c)+';';if(!_0x114ce1['includes'](_0x4b4c6f))return{'patched':![],'reason':'import-n'+_0x1f9920(0xff)};const _0x5846a4=_0x1f9920(0x152)+_0x1f9920(0x14d)+_0x1f9920(0x10d)+_0x1f9920(0x105),_0x4b5fb9=_0x1f9920(0x14a)+'lazyRunt'+'imeRefle'+'ctionKey'+'Set\x20=\x20ne'+'w\x20Set(LA'+_0x1f9920(0x12d)+_0x1f9920(0x103)+_0x1f9920(0x164)+_0x1f9920(0x13b),_0x4b1215=_0x114ce1[_0x1f9920(0xf9)](_0x5846a4),_0x67b1e5=_0x114ce1[_0x1f9920(0xf9)](_0x4b5fb9,_0x4b1215);if(_0x4b1215===-0x1||_0x67b1e5===-0x1)return{'patched':![],'reason':'not-foun'+'d'};const _0xa6d1=_0x1f9920(0x152)+_0x1f9920(0x14d)+'ntime\x20=\x20'+_0x1f9920(0x147)+'const\x20en'+_0x1f9920(0x107)+'eChannel'+_0x1f9920(0x16b)+_0x1f9920(0x15f)+_0x1f9920(0x145)+_0x1f9920(0x10b)+_0x1f9920(0x134)+_0x1f9920(0x14f)+_0x1f9920(0x17d)+_0x1f9920(0x17e)+_0x1f9920(0x117)+_0x1f9920(0x171)+_0x1f9920(0x188)+_0x1f9920(0x182)+_0x1f9920(0x16f)+_0x1f9920(0x11f)+_0x1f9920(0x12a)+_0x1f9920(0x16a)+_0x1f9920(0x166)+'time.cha'+'nnel?.in'+'bound?.r'+'un)\x20retu'+'rn\x20runti'+_0x1f9920(0xf8)+_0x1f9920(0x180)+_0x1f9920(0x160)+_0x1f9920(0x10e)+'jieCreat'+_0x1f9920(0x17a)+_0x1f9920(0x13e)+');\x0a\x09\x09\x09co'+_0x1f9920(0x11a)+_0x1f9920(0x112)+'nel\x20=\x20ru'+'ntime.ch'+_0x1f9920(0x101)+_0x1f9920(0x12b)+_0x1f9920(0x150)+_0x1f9920(0x102)+'===\x20\x22obj'+'ect\x22\x20?\x20r'+_0x1f9920(0x11f)+'hannel\x20:'+'\x20{};\x0a\x09\x09\x09'+_0x1f9920(0x150)+_0x1f9920(0x102)+_0x1f9920(0x109)+_0x1f9920(0xfd)+_0x1f9920(0x141)+_0x1f9920(0x186)+_0x1f9920(0x15b)+_0x1f9920(0xfa)+_0x1f9920(0x156)+_0x1f9920(0x176)+_0x1f9920(0x179)+_0x1f9920(0x172)+_0x1f9920(0xfb)+_0x1f9920(0x110)+_0x1f9920(0x159)+_0x1f9920(0x157)+_0x1f9920(0x141)+'e.runtim'+_0x1f9920(0x151)+_0x1f9920(0x158)+_0x1f9920(0x111)+'existing'+_0x1f9920(0xfb)+_0x1f9920(0x11e)+_0x1f9920(0x157)+'elRuntim'+_0x1f9920(0x126)+_0x1f9920(0x17c)+_0x1f9920(0x128)+_0x1f9920(0x16d)+_0x1f9920(0x12e)+_0x1f9920(0x10f)+_0x1f9920(0x16d)+_0x1f9920(0x139)+_0x1f9920(0x108)+_0x1f9920(0x178)+_0x1f9920(0x113)+_0x1f9920(0x13d)+'hannelRu'+_0x1f9920(0x130)+_0x1f9920(0x15e)+_0x1f9920(0x15a)+':\x20existi'+_0x1f9920(0xfa)+_0x1f9920(0x14b)+_0x1f9920(0x157)+_0x1f9920(0x141)+_0x1f9920(0x144)+'\x0a\x09\x09\x09\x09ses'+_0x1f9920(0x124)+'istingCh'+_0x1f9920(0x122)+_0x1f9920(0x11c)+_0x1f9920(0x13f)+'Runtime.'+_0x1f9920(0x153)+_0x1f9920(0x187)+'\x09return\x20'+'runtime;'+_0x1f9920(0xf6)+_0x1f9920(0x140)+_0x1f9920(0x15c)+_0x1f9920(0x114)+_0x1f9920(0x120)+_0x1f9920(0xf7)+_0x1f9920(0x168)+_0x1f9920(0x185)+_0x1f9920(0x107)+_0x1f9920(0x146)+_0x1f9920(0x16b)+'elpers(r'+_0x1f9920(0x162)+_0x1f9920(0x131)+_0x1f9920(0x123)+_0x1f9920(0x142)+('ons.runt'+_0x1f9920(0x16e)+_0x1f9920(0x104)+_0x1f9920(0x143)+_0x1f9920(0x138)+_0x1f9920(0x165)+'\x0a\x09\x09};\x0a'),_0x3bd378=_0x114ce1['slice'](0x0,_0x4b1215)+_0xa6d1+_0x114ce1['slice'](_0x67b1e5);return{'patched':!![],'source':ensureRuntimeChannelImport(_0x3bd378,{'importMarker':_0x4b4c6f,'runtimeChannelImportPath':_0x167d18})};}function createRuntimeChannelImport(_0x5ecc3f){const _0x48c22d=_0x3cc0;return'import\x20{'+_0x48c22d(0x118)+'untimeCh'+_0x48c22d(0x11d)+'\x20wujieCr'+'eateRunt'+_0x48c22d(0x13a)+_0x48c22d(0x119)+'m\x20\x22'+_0x5ecc3f+'\x22;';}function hasRuntimeChannelImport(_0x505c32,_0x11d970){const _0x409c85=_0x3cc0;return _0x505c32[_0x409c85(0x10a)](createRuntimeChannelImport(_0x11d970));}function ensureRuntimeChannelImport(_0x27a8c3,{importMarker:_0x3a8d7c,runtimeChannelImportPath:_0x276b89}){const _0x466e4f=_0x3cc0,_0x3077d1=createRuntimeChannelImport(_0x276b89),_0x4b42cb=/import \{ createRuntimeChannel as wujieCreateRuntimeChannel \} from "\.\/runtime-channel-[^"]+\.js";\n?/;if(_0x4b42cb['test'](_0x27a8c3))return _0x27a8c3[_0x466e4f(0xf3)](_0x4b42cb,_0x3077d1+'\x0a');return _0x27a8c3[_0x466e4f(0xf3)](_0x3a8d7c,_0x3a8d7c+'\x0a'+_0x3077d1);}
|
|
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();}
|