@wujie-shell/core 3.0.2 → 4.0.0
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(_0x408d72,_0x4b9bbd){var _0x183899=_0x33fa,_0x3fd605=_0x408d72();while(!![]){try{var _0xba2284=parseInt(_0x183899(0x120))/0x1*(-parseInt(_0x183899(0x124))/0x2)+-parseInt(_0x183899(0x122))/0x3+parseInt(_0x183899(0x11f))/0x4*(-parseInt(_0x183899(0x11e))/0x5)+parseInt(_0x183899(0x123))/0x6*(-parseInt(_0x183899(0x11c))/0x7)+-parseInt(_0x183899(0x11d))/0x8+-parseInt(_0x183899(0x121))/0x9+parseInt(_0x183899(0x11b))/0xa;if(_0xba2284===_0x4b9bbd)break;else _0x3fd605['push'](_0x3fd605['shift']());}catch(_0x58cc99){_0x3fd605['push'](_0x3fd605['shift']());}}}(_0xa599,0x35f58));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';export{ensureBundledAgents,loadBundledAgents,shouldForceFullSync}from'./agents/bundled-agents.mjs';export{archiveChatAttachmentForHistory}from'./chat/media-archive.mjs';export{createGatewayChatQueue}from'./chat/queue.mjs';function _0xa599(){var _0x52ad87=['60741umlgjT','1309101fuJIGp','6VZDUcl','2IfRWOs','18401060DMGbSU','2322082bZEdDN','1099096oVjexK','45kRLnFR','181672DVRYVh','298099DfkgKR'];_0xa599=function(){return _0x52ad87;};return _0xa599();}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';function _0x33fa(_0x5ed5d1,_0x38aaa8){_0x5ed5d1=_0x5ed5d1-0x11b;var _0xa599d6=_0xa599();var _0x33fac6=_0xa599d6[_0x5ed5d1];return _0x33fac6;}export*from'./connectors/constants.mjs';export{createConnectorController}from'./connectors/controller.mjs';export{installKdocsCliBinary,resolveRuntimeKdocsCliCommand}from'./connectors/kdocs-cli.mjs';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 _0x46ea(_0x4f7eee,_0x34d1dc){_0x4f7eee=_0x4f7eee-0xea;var _0x56802e=_0x5680();var _0x46ea92=_0x56802e[_0x4f7eee];return _0x46ea92;}(function(_0x35cde8,_0x5c7483){var _0x5dc60a=_0x46ea,_0x99172a=_0x35cde8();while(!![]){try{var _0x51d32a=parseInt(_0x5dc60a(0xf1))/0x1+-parseInt(_0x5dc60a(0xed))/0x2+parseInt(_0x5dc60a(0xf6))/0x3+parseInt(_0x5dc60a(0xf8))/0x4+parseInt(_0x5dc60a(0xf9))/0x5+-parseInt(_0x5dc60a(0xfa))/0x6+parseInt(_0x5dc60a(0xef))/0x7;if(_0x51d32a===_0x5c7483)break;else _0x99172a['push'](_0x99172a['shift']());}catch(_0x1a8346){_0x99172a['push'](_0x99172a['shift']());}}}(_0x5680,0x514a6));import{reportLogs}from'./report-logs.mjs';function _0x5680(){var _0x52e7a9=['descript','ion','284316NHOEYj','renderer','2655408elkUyS','1781515GOoOFT','3451698dTubcj','endpoint','gateToke','report','logs:rep','725820nTClNc','ort','243026OzWQGd','info','121514aKEQVx','app:log:','string'];_0x5680=function(){return _0x52e7a9;};return _0x5680();}export function registerProductLogHandlers({app:_0x298d53,configController:_0x253255,diagnosticEventFromError:_0x147986,diagnosticsWriter:_0x4abe93,exportLogsArchive:_0x4fb172,handle:_0x102583,mainLogger:_0x111bea,rendererLogger:_0x4adf2d,summarizeText:_0x2165a7,toHomePath:_0xd2092f}){var _0x46ae1a=_0x46ea;_0x102583(_0x46ae1a(0xf2)+_0x46ae1a(0xeb),async(_0x1abec9,_0x23e343)=>{var _0x5b48a2=_0x46ae1a;return _0x4adf2d?.[_0x5b48a2(0xf0)](_0x5b48a2(0xf7)+'\x20log\x20rep'+'ort\x20requ'+'ested',{'description':_0x2165a7(String(_0x23e343||''),0xa0)}),!![];}),_0x102583(_0x46ae1a(0xec)+_0x46ae1a(0xee),async(_0x4c93ba,_0x5cb7fb={})=>reportLogs({'app':_0x298d53,'configController':_0x253255,'diagnosticsWriter':_0x4abe93,'diagnosticEventFromError':_0x147986,'exportLogsArchive':_0x4fb172,'mainLogger':_0x111bea,'summarizeText':_0x2165a7,'toHomePath':_0xd2092f,'description':typeof _0x5cb7fb['descript'+_0x46ae1a(0xf5)]==='string'?_0x5cb7fb[_0x46ae1a(0xf4)+_0x46ae1a(0xf5)]:'','gateToken':typeof _0x5cb7fb[_0x46ae1a(0xea)+'n']===_0x46ae1a(0xf3)?_0x5cb7fb[_0x46ae1a(0xea)+'n']:'','endpoint':typeof _0x5cb7fb['endpoint']===_0x46ae1a(0xf3)?_0x5cb7fb[_0x46ae1a(0xfb)]:''}));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x35fe91,_0x46b61e){const _0x343e0f=_0x11c2,_0x1138ef=_0x35fe91();while(!![]){try{const _0x56845f=parseInt(_0x343e0f(0xdb))/0x1*(parseInt(_0x343e0f(0xf7))/0x2)+-parseInt(_0x343e0f(0xdd))/0x3*(parseInt(_0x343e0f(0xf6))/0x4)+parseInt(_0x343e0f(0xd9))/0x5+-parseInt(_0x343e0f(0xd6))/0x6*(parseInt(_0x343e0f(0xfa))/0x7)+-parseInt(_0x343e0f(0xd1))/0x8*(-parseInt(_0x343e0f(0xde))/0x9)+-parseInt(_0x343e0f(0xd3))/0xa+parseInt(_0x343e0f(0xdc))/0xb*(-parseInt(_0x343e0f(0xe3))/0xc);if(_0x56845f===_0x46b61e)break;else _0x1138ef['push'](_0x1138ef['shift']());}catch(_0x60a8f6){_0x1138ef['push'](_0x1138ef['shift']());}}}(_0x3a80,0x4a62a));function _0x3a80(){const _0x12a5c2=['success','200','上传日志失败(H','wujie-ag','timeout','ral/file','POST','y_name','ceptions','getVersi','info','ort\x20fail','359812WTAvVd','179126JsBKWR','now','/upload','2198588kzbpvI','gate-tok','captureI','file','getPath','status','ncident','/wj-open','logs_rep','applicat','text','orted','2912lwWjEN','ort_fail','1632370NOjIyz','logs\x20rep','append','6bPtUlI','ion/json','error','1265360CvzWAF','path','4NrxuPa','22MRSOQB','3owOCBU','11214HbSAKV','/v2/gene','parse','trim','paths','1157472NeGuac','data','replace','catch','ion/zip','log_repo','temp'];_0x3a80=function(){return _0x12a5c2;};return _0x3a80();}import{basename}from'node:path';import{readFile,rm}from'node:fs/promises';export function resolveWujieApiEndpoint(){const _0x2d2a58=_0x11c2;return String(process.env.VITE_WUJIE_API_ENDPOINT||'')[_0x2d2a58(0xe1)]()[_0x2d2a58(0xe5)](/\/+$/,'');}function _0x11c2(_0x2ca608,_0x5de813){_0x2ca608=_0x2ca608-0xcc;const _0x3a8061=_0x3a80();let _0x11c2ab=_0x3a8061[_0x2ca608];return _0x11c2ab;}export async function reportLogs({app:_0x5ed443,configController:_0x5615a1,diagnosticsWriter:_0x3e4ea2,diagnosticEventFromError:_0x1203bb,exportLogsArchive:_0x406eb5,mainLogger:_0x55563b,readFileFn:readFileFn=readFile,rmFn:rmFn=rm,summarizeText:_0x3e0b04,toHomePath:_0x4beb72,description:description='',gateToken:gateToken='',endpoint:endpoint=''}={}){const _0x122fa9=_0x11c2;let _0x290652='';const _0x589d1e=Date[_0x122fa9(0xf8)]();try{const _0xedf07e=await _0x406eb5({'logsDir':_0x5615a1[_0x122fa9(0xe2)]['logsDir'],'targetDir':_0x5ed443[_0x122fa9(0xfe)](_0x122fa9(0xe9)),'appVersion':_0x5ed443[_0x122fa9(0xf3)+'on']()});_0x290652=_0xedf07e[_0x122fa9(0xda)];const _0x3a4253=await readFileFn(_0x290652),_0x139120=new FormData();_0x139120[_0x122fa9(0xd5)](_0x122fa9(0xfd),new Blob([_0x3a4253],{'type':_0x122fa9(0xce)+_0x122fa9(0xe7)}),basename(_0x290652)),_0x139120[_0x122fa9(0xd5)]('director'+_0x122fa9(0xf1),_0x122fa9(0xed)+'ent-logs');const _0x375ee9={};typeof gateToken==='string'&&gateToken[_0x122fa9(0xe1)]()&&(_0x375ee9[_0x122fa9(0xfb)+'en']=gateToken[_0x122fa9(0xe1)]());const _0x34a08f=String(endpoint||resolveWujieApiEndpoint())[_0x122fa9(0xe1)]()[_0x122fa9(0xe5)](/\/+$/,'');if(!_0x34a08f)throw new Error('缺少日志上传服务'+'地址');const _0x3ce088=await fetch(_0x34a08f+(_0x122fa9(0xcc)+_0x122fa9(0xdf)+_0x122fa9(0xef)+_0x122fa9(0xf9)),{'method':_0x122fa9(0xf0),'headers':_0x375ee9,'body':_0x139120,'signal':AbortSignal['timeout'](0x3a98)}),_0x1d275c=await _0x3ce088[_0x122fa9(0xcf)]();let _0xbad3b9={};try{_0xbad3b9=JSON[_0x122fa9(0xe0)](_0x1d275c);}catch{throw new Error('上传日志失败(H'+'TTP\x20'+_0x3ce088['status']+')');}const _0x36db95=_0xbad3b9?.[_0x122fa9(0xea)]===!![]||String(_0xbad3b9?.['code'])===_0x122fa9(0xeb),_0x1a321f=_0xbad3b9?.[_0x122fa9(0xe4)];if(!_0x36db95||!_0x1a321f)throw new Error(_0x122fa9(0xec)+'TTP\x20'+_0x3ce088['status']+')');const _0x1ba702=await fetch(_0x34a08f+(_0x122fa9(0xcc)+'/v2/claw'+'/aipc/ex'+_0x122fa9(0xf2)),{'method':'POST','headers':{'Content-Type':_0x122fa9(0xce)+_0x122fa9(0xd7),..._0x375ee9},'body':JSON['stringif'+'y']({'packageUrl':_0x1a321f,'description':description}),'signal':AbortSignal[_0x122fa9(0xee)](0x3a98)});return _0x55563b?.[_0x122fa9(0xf4)]('logs\x20rep'+_0x122fa9(0xd0),{'durationMs':Date[_0x122fa9(0xf8)]()-_0x589d1e,'uploadStatus':_0x3ce088[_0x122fa9(0xff)],'reportStatus':_0x1ba702[_0x122fa9(0xff)]}),!![];}catch(_0x1fdf90){_0x55563b?.[_0x122fa9(0xd8)](_0x122fa9(0xd4)+_0x122fa9(0xf5)+'ed',{'durationMs':Date[_0x122fa9(0xf8)]()-_0x589d1e,'error':_0x1fdf90}),await _0x3e4ea2?.[_0x122fa9(0xfc)+_0x122fa9(0x100)](_0x1203bb(_0x1fdf90,{'category':_0x122fa9(0xe8)+'rt','event':_0x122fa9(0xcd)+_0x122fa9(0xd2)+'ed','message':'日志上传上报失败','durationMs':Date['now']()-_0x589d1e,'meta':{'description':_0x3e0b04(description,0xa0),'archivePath':_0x290652?_0x4beb72(_0x290652):''}}));throw _0x1fdf90;}finally{if(_0x290652)await rmFn(_0x290652,{'force':!![]})[_0x122fa9(0xe6)](()=>{});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x3cb8(){const _0x2c104f=['el\x20handl','map','1491861DhWQDs','er\x20is\x20no','171molLiq','ase','t\x20regist','modelNam','27620AsbEIV','join','string','956767SximQq','toLowerC','protocol','provider','models:c','outputTe','baseUrl','deleteCu','customPr','anthropi','custom','Name','core\x20mod','text','content','ustom-mo','5554417rASzBq','trim','459ctgCHS','message','296936sQNKGp','dels:del','455GdIBwy','output_t','openai','ete','isArray','saveCust','oviderNa','function','type','object','3485982eVpBCo','30XIPfRg','90FbuWRO'];_0x3cb8=function(){return _0x2c104f;};return _0x3cb8();}(function(_0x542ff3,_0x32c402){const _0x200d99=_0x3d79,_0x1ea627=_0x542ff3();while(!![]){try{const _0x482f8e=parseInt(_0x200d99(0x191))/0x1*(-parseInt(_0x200d99(0x1a1))/0x2)+-parseInt(_0x200d99(0x1a4))/0x3+-parseInt(_0x200d99(0x1aa))/0x4*(parseInt(_0x200d99(0x195))/0x5)+-parseInt(_0x200d99(0x19f))/0x6+-parseInt(_0x200d99(0x1ad))/0x7+parseInt(_0x200d99(0x193))/0x8*(parseInt(_0x200d99(0x1a6))/0x9)+-parseInt(_0x200d99(0x1a0))/0xa*(-parseInt(_0x200d99(0x18f))/0xb);if(_0x482f8e===_0x32c402)break;else _0x1ea627['push'](_0x1ea627['shift']());}catch(_0x4d0760){_0x1ea627['push'](_0x1ea627['shift']());}}}(_0x3cb8,0x56ef9));export function extractModelMessageContent(_0x256019){const _0x1e8062=_0x3d79;if(typeof _0x256019===_0x1e8062(0x1ac))return _0x256019;if(!Array[_0x1e8062(0x199)](_0x256019))return'';return _0x256019[_0x1e8062(0x1a3)](_0x332b0a=>{const _0x1fd35e=_0x1e8062;if(typeof _0x332b0a===_0x1fd35e(0x1ac))return _0x332b0a;if(!_0x332b0a||typeof _0x332b0a!==_0x1fd35e(0x19e))return'';const _0x3315b9=typeof _0x332b0a[_0x1fd35e(0x19d)]===_0x1fd35e(0x1ac)?_0x332b0a[_0x1fd35e(0x19d)][_0x1fd35e(0x1ae)+_0x1fd35e(0x1a7)]():'';if(_0x3315b9&&_0x3315b9!==_0x1fd35e(0x18c)&&_0x3315b9!==_0x1fd35e(0x196)+'ext'&&_0x3315b9!==_0x1fd35e(0x192))return'';for(const _0x42c039 of[_0x1fd35e(0x18c),_0x1fd35e(0x192),_0x1fd35e(0x18d),_0x1fd35e(0x1b2)+'xt',_0x1fd35e(0x196)+'ext']){if(typeof _0x332b0a[_0x42c039]===_0x1fd35e(0x1ac))return _0x332b0a[_0x42c039];}return'';})[_0x1e8062(0x1ab)]('');}function _0x3d79(_0x15f801,_0x246471){_0x15f801=_0x15f801-0x189;const _0x3cb861=_0x3cb8();let _0x3d7941=_0x3cb861[_0x15f801];return _0x3d7941;}function normalizeCustomModelPayload(_0x2050a7={}){const _0x4d939d=_0x3d79,_0x2f6d45=String(_0x2050a7['id']||'')[_0x4d939d(0x190)]();return{..._0x2050a7,'id':_0x2f6d45,'modelName':String(_0x2050a7[_0x4d939d(0x1a9)+'e']||'')[_0x4d939d(0x190)](),'provider':String(_0x2050a7['provider']||_0x4d939d(0x189)),'apiKey':String(_0x2050a7['apiKey']||''),'protocol':_0x2050a7[_0x4d939d(0x1af)]===_0x4d939d(0x1b6)+'c'?_0x4d939d(0x1b6)+'c':_0x4d939d(0x197),'baseUrl':String(_0x2050a7[_0x4d939d(0x1b3)]||''),..._0x2050a7[_0x4d939d(0x1b0)+_0x4d939d(0x18a)]?{'providerName':String(_0x2050a7['provider'+_0x4d939d(0x18a)])}:{},..._0x2050a7[_0x4d939d(0x1b5)+_0x4d939d(0x19b)+'me']?{'customProviderName':String(_0x2050a7['customPr'+_0x4d939d(0x19b)+'me'])}:{}};}export function registerModelHandlers({handle:_0x32ecfe,modelHandlers:modelHandlers={}}){const _0x5ced70=_0x3d79,_0x130020=_0x142418=>{const _0x4b2913=_0x3d79,_0x37242b=modelHandlers[_0x142418];if(typeof _0x37242b!==_0x4b2913(0x19c))throw new Error(_0x4b2913(0x18b)+_0x4b2913(0x1a2)+_0x4b2913(0x1a5)+_0x4b2913(0x1a8)+'ered:\x20'+_0x142418);return _0x37242b;};_0x32ecfe('models:c'+_0x5ced70(0x18e)+'dels:sav'+'e',async(_0x4dddc8,_0x5cf528={})=>_0x130020(_0x5ced70(0x19a)+'omModel')(normalizeCustomModelPayload(_0x5cf528))),_0x32ecfe(_0x5ced70(0x1b1)+_0x5ced70(0x18e)+_0x5ced70(0x194)+_0x5ced70(0x198),async(_0xc4822f,_0x169825={})=>_0x130020(_0x5ced70(0x1b4)+'stomMode'+'l')(_0x169825));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x55a7e8=_0x435b;(function(_0x4a293c,_0x7f5593){const _0x1aceeb=_0x435b,_0x4afcae=_0x4a293c();while(!![]){try{const _0x58b6a4=parseInt(_0x1aceeb(0xf6))/0x1+parseInt(_0x1aceeb(0x101))/0x2+parseInt(_0x1aceeb(0xfb))/0x3*(parseInt(_0x1aceeb(0xfa))/0x4)+parseInt(_0x1aceeb(0xfc))/0x5+-parseInt(_0x1aceeb(0xf7))/0x6*(parseInt(_0x1aceeb(0xf8))/0x7)+-parseInt(_0x1aceeb(0xff))/0x8*(parseInt(_0x1aceeb(0x102))/0x9)+parseInt(_0x1aceeb(0x100))/0xa;if(_0x58b6a4===_0x7f5593)break;else _0x4afcae['push'](_0x4afcae['shift']());}catch(_0x431ae7){_0x4afcae['push'](_0x4afcae['shift']());}}}(_0x4eba,0x1b85f));function _0x4eba(){const _0x47a8b2=['9qhdOyV','preferen','call','hasOwnPr','114564zokDnL','169410OWvxYM','49sYnStb','prototyp','8440fnYoSy','78wmkbJz','645690fAOAaC','operty','ces.json','847576hDtRkO','539510eqStcV','127628hDhCnL'];_0x4eba=function(){return _0x47a8b2;};return _0x4eba();}import{join}from'node:path';function _0x435b(_0x18c081,_0x4cb39f){_0x18c081=_0x18c081-0xf3;const _0x4ebafc=_0x4eba();let _0x435b98=_0x4ebafc[_0x18c081];return _0x435b98;}import{readJson,writeJson}from'../common/utils.mjs';const STORE_FILE=_0x55a7e8(0xf3)+_0x55a7e8(0xfe);export function createPreferencesStore({stateDir:_0x5672ab,storeFile:storeFile=STORE_FILE}={}){async function _0x56b5f3(){return readJson(join(_0x5672ab,storeFile),{});}async function _0x5eb2d8(_0x4b7971,_0xf140d9=null){const _0x619fe3=_0x435b,_0x1fee54=await _0x56b5f3();return Object[_0x619fe3(0xf9)+'e'][_0x619fe3(0xf5)+_0x619fe3(0xfd)][_0x619fe3(0xf4)](_0x1fee54,_0x4b7971)?_0x1fee54[_0x4b7971]:_0xf140d9;}async function _0x31fb9e(_0x3596a1,_0x5f6a22){const _0x14c79e=await _0x56b5f3();return _0x14c79e[_0x3596a1]=_0x5f6a22,await writeJson(join(_0x5672ab,storeFile),_0x14c79e),{'ok':!![],'value':_0x5f6a22};}return{'read':_0x56b5f3,'get':_0x5eb2d8,'set':_0x31fb9e};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x5ae80f=_0x458f;(function(_0x5285d9,_0x28e3c6){const _0x30528d=_0x458f,_0x54359f=_0x5285d9();while(!![]){try{const _0x43cb42=parseInt(_0x30528d(0x16e))/0x1*(parseInt(_0x30528d(0x232))/0x2)+parseInt(_0x30528d(0xb1))/0x3*(-parseInt(_0x30528d(0x183))/0x4)+-parseInt(_0x30528d(0x129))/0x5*(parseInt(_0x30528d(0x118))/0x6)+-parseInt(_0x30528d(0x131))/0x7+parseInt(_0x30528d(0x7c))/0x8+parseInt(_0x30528d(0x87))/0x9*(-parseInt(_0x30528d(0xa3))/0xa)+-parseInt(_0x30528d(0x213))/0xb*(-parseInt(_0x30528d(0x126))/0xc);if(_0x43cb42===_0x28e3c6)break;else _0x54359f['push'](_0x54359f['shift']());}catch(_0x5e9092){_0x54359f['push'](_0x54359f['shift']());}}}(_0x52fa,0x7b630));import{existsSync}from'node:fs';import{createWriteStream}from'node:fs';import{chmod,cp,mkdir,readFile,readdir,rename,rm,stat,symlink,writeFile}from'node:fs/promises';import{basename,delimiter,dirname,join,relative,resolve}from'node:path';import{fileURLToPath,pathToFileURL}from'node:url';import{spawn}from'node:child_process';import{get}from'node:https';import{pipeline}from'node:stream/promises';import{getConfigPaths}from'@wujie-shell/config';import{copyDirFresh,getPackageMetadata,readJson,readPluginManifest,toRuntimeRelative,writeJson}from'../common/utils.mjs';import{createRuntimeLogger,summarizeRuntimeManifest,summarizeShellConfig}from'../common/runtime-logger.mjs';import{hasConfiguredKdocsSkill,installKdocsCliBinary}from'../connectors/kdocs-cli.mjs';import{patchMixedToolContentFromSource}from'./patch-chat-history-mixed-tool-content.mjs';import{patchChannelPluginRuntimeFromSource}from'./patch-channel-plugin-runtime.mjs';import{patchSessionStoreLoadFromSource,patchSessionStoreWriteFromSource}from'./patch-session-store-sqlite.mjs';const RUNTIME_DIR='.tmp/run'+_0x5ae80f(0x132),MANIFEST_NAME=_0x5ae80f(0x181)+_0x5ae80f(0xbc)+_0x5ae80f(0x228),NPM_INSTALL_TIMEOUT_MS=0xf*0x3c*0x3e8;export function resolveRuntimeRoot(_0xd9fc08){if(process.env.WUJIE_SHELL_RUNTIME_ROOT)return resolve(process.env.WUJIE_SHELL_RUNTIME_ROOT);return resolve(_0xd9fc08,RUNTIME_DIR);}export function resolveManifestPath(_0x100c7f){return join(_0x100c7f,MANIFEST_NAME);}async function loadProductRuntime(_0x3f79f9,_0x3d2b2f){const _0x52ba4c=_0x5ae80f,_0x448e9e=[join(_0x3f79f9,_0x52ba4c(0xbd)+_0x52ba4c(0x154),_0x52ba4c(0xfb)+'s'),join(_0x3d2b2f,_0x52ba4c(0xbd)+_0x52ba4c(0x154),_0x52ba4c(0xfb)+'s')];for(const _0x328e08 of _0x448e9e){if(!existsSync(_0x328e08))continue;return await import(pathToFileURL(_0x328e08)[_0x52ba4c(0xd1)]+_0x52ba4c(0x1b4)+Date[_0x52ba4c(0x210)]());}return{};}export async function prepareRuntime(_0x225d9e,{syncOnly:syncOnly=![]}={}){const _0xf8f9b8=_0x5ae80f,_0x376bd2=resolveRuntimeRoot(_0x225d9e['projectR'+_0xf8f9b8(0x19e)]),_0xa9c66a=createRuntimeLogger(getConfigPaths(_0x225d9e),_0xf8f9b8(0xd6)),_0x277dba=Date[_0xf8f9b8(0x210)]();_0xa9c66a?.[_0xf8f9b8(0x148)](_0xf8f9b8(0x15d)+_0xf8f9b8(0x136)+_0xf8f9b8(0x1ce),{'syncOnly':syncOnly,'runtimeRoot':_0x376bd2,'shellConfig':summarizeShellConfig(_0x225d9e)});try{const _0x126d52=await ensureRuntimeBase(_0x225d9e,_0x376bd2,{'runtimeLogger':_0xa9c66a,'syncOnly':syncOnly});_0xa9c66a?.[_0xf8f9b8(0x148)](_0xf8f9b8(0x136)+_0xf8f9b8(0xbc)+_0xf8f9b8(0x1bc),{'manifestPath':resolveManifestPath(_0x376bd2),'manifest':summarizeRuntimeManifest(_0x126d52)}),validateRuntimeNodeVersion(_0x126d52,_0x225d9e),_0xa9c66a?.['info']('runtime\x20'+_0xf8f9b8(0x164)+_0xf8f9b8(0x9f)+_0xf8f9b8(0x80),{'nodeVersion':_0x126d52[_0xf8f9b8(0x20b)+_0xf8f9b8(0x106)]});if(syncOnly)validateRuntimeOpenClawVersion(_0x126d52,_0x225d9e),_0xa9c66a?.[_0xf8f9b8(0x148)]('runtime\x20'+'openclaw'+_0xf8f9b8(0x1b5)+_0xf8f9b8(0x1a1)+'ed',{'openclawVersion':_0x126d52[_0xf8f9b8(0x1d4)+_0xf8f9b8(0x237)]});else{if(_0x126d52[_0xf8f9b8(0x1d4)+'Version']!==_0x225d9e[_0xf8f9b8(0x1d4)]['openclaw'+_0xf8f9b8(0x237)]){const _0xe139b=await loadRuntimeInfo(_0x225d9e[_0xf8f9b8(0xbb)+'oot']);_0xa9c66a?.['info'](_0xf8f9b8(0x1d4)+'\x20package'+_0xf8f9b8(0x137)+'\x20started',{'fromVersion':_0x126d52[_0xf8f9b8(0x1d4)+'Version']||_0xf8f9b8(0x234),'toVersion':_0x225d9e[_0xf8f9b8(0x1d4)][_0xf8f9b8(0x1d4)+_0xf8f9b8(0x237)]}),await installOpenClawPackage(_0xe139b,_0x225d9e[_0xf8f9b8(0x1d4)]['openclaw'+_0xf8f9b8(0x237)]),_0x126d52[_0xf8f9b8(0x1d4)+_0xf8f9b8(0x237)]=_0x225d9e[_0xf8f9b8(0x1d4)][_0xf8f9b8(0x1d4)+_0xf8f9b8(0x237)],_0xa9c66a?.[_0xf8f9b8(0x148)]('openclaw'+'\x20package'+_0xf8f9b8(0x137)+_0xf8f9b8(0xc0)+'ed',{'openclawVersion':_0x126d52['openclaw'+_0xf8f9b8(0x237)]});}}_0x126d52[_0xf8f9b8(0x1b8)+_0xf8f9b8(0x1c0)]=new Date()['toISOStr'+_0xf8f9b8(0x14a)](),_0x126d52[_0xf8f9b8(0x20b)+_0xf8f9b8(0x106)]=_0x225d9e[_0xf8f9b8(0x1d4)][_0xf8f9b8(0x20b)+_0xf8f9b8(0x106)],_0x126d52[_0xf8f9b8(0x1df)]={'appId':_0x225d9e[_0xf8f9b8(0x1d9)],'productName':_0x225d9e['productN'+_0xf8f9b8(0x223)],'dataDirName':_0x225d9e[_0xf8f9b8(0x12d)+'ame']},await patchChatHistoryMixedToolContentBug(_0x376bd2,_0x126d52,{'runtimeLogger':_0xa9c66a}),await patchChannelPluginRuntimeBug(_0x376bd2,_0x126d52,{'runtimeLogger':_0xa9c66a});const _0x33e57b=await loadProductRuntime(_0x225d9e[_0xf8f9b8(0xbb)+'oot'],_0x376bd2);if(typeof _0x33e57b['prepareP'+_0xf8f9b8(0xd8)+'ntime']===_0xf8f9b8(0x24c)){const _0x2e1684=createRuntimeInfoFromManifest(_0x376bd2,_0x126d52);await _0x33e57b[_0xf8f9b8(0x15f)+_0xf8f9b8(0xd8)+_0xf8f9b8(0x154)]({'shellConfig':_0x225d9e,'runtime':_0x2e1684,'runtimeLogger':_0xa9c66a,'syncOnly':syncOnly}),_0xa9c66a?.[_0xf8f9b8(0x148)]('product\x20'+_0xf8f9b8(0x136)+_0xf8f9b8(0x13d)+_0xf8f9b8(0x22c));}await patchSessionStoreSqliteRuntime(_0x376bd2,_0x126d52,{'runtimeLogger':_0xa9c66a});!syncOnly&&(await hasConfiguredKdocsSkill(_0x225d9e)?(await installKdocsCliBinary(_0x225d9e,createRuntimeInfoFromManifest(_0x376bd2,_0x126d52),{'runtimeLogger':_0xa9c66a,'syncOnly':syncOnly}),_0xa9c66a?.['info'](_0xf8f9b8(0x25b)+_0xf8f9b8(0x1de)+'e\x20tools\x20'+_0xf8f9b8(0xe7))):_0xa9c66a?.[_0xf8f9b8(0x148)]('connecto'+_0xf8f9b8(0x1de)+_0xf8f9b8(0x1e3)+_0xf8f9b8(0xd5)+_0xf8f9b8(0x84)+_0xf8f9b8(0x140)+'\x20configu'+'red'));const _0x18f36d=Array[_0xf8f9b8(0x7e)](_0x126d52[_0xf8f9b8(0x111)])?_0x126d52[_0xf8f9b8(0x111)][_0xf8f9b8(0x171)]:0x0;return await syncManifestPluginScope(_0x225d9e,_0x376bd2,_0x126d52),_0xa9c66a?.['info']('runtime\x20'+_0xf8f9b8(0xb6)+'cope\x20syn'+_0xf8f9b8(0x187),{'beforePluginCount':_0x18f36d,'afterPluginCount':Array[_0xf8f9b8(0x7e)](_0x126d52[_0xf8f9b8(0x111)])?_0x126d52[_0xf8f9b8(0x111)][_0xf8f9b8(0x171)]:0x0,'pluginSpecCount':Array[_0xf8f9b8(0x7e)](_0x126d52[_0xf8f9b8(0x98)+'ecs'])?_0x126d52[_0xf8f9b8(0x98)+'ecs'][_0xf8f9b8(0x171)]:0x0}),await syncConfiguredNpmPlugins(_0x225d9e,_0x376bd2,_0x126d52,{'runtimeLogger':_0xa9c66a,'syncOnly':syncOnly}),_0xa9c66a?.[_0xf8f9b8(0x148)](_0xf8f9b8(0xe3)+'ed\x20npm\x20p'+'lugins\x20s'+_0xf8f9b8(0xe9),{'pluginSpecCount':_0x225d9e['openclaw']['pluginSp'+'ecs'][_0xf8f9b8(0x171)],'pluginCount':Array[_0xf8f9b8(0x7e)](_0x126d52[_0xf8f9b8(0x111)])?_0x126d52[_0xf8f9b8(0x111)][_0xf8f9b8(0x171)]:0x0}),await syncProductPlugins(_0x225d9e,_0x376bd2,_0x126d52,{'runtimeLogger':_0xa9c66a}),_0xa9c66a?.[_0xf8f9b8(0x148)](_0xf8f9b8(0xa2)+_0xf8f9b8(0x19b)+_0xf8f9b8(0xe7),{'localPluginCount':_0x225d9e[_0xf8f9b8(0x1d4)]['resolved'+_0xf8f9b8(0xc3)+_0xf8f9b8(0x130)]['length'],'pluginCount':Array['isArray'](_0x126d52[_0xf8f9b8(0x111)])?_0x126d52[_0xf8f9b8(0x111)]['length']:0x0}),await syncProductAgents(_0x225d9e,_0x376bd2,_0x126d52),_0xa9c66a?.[_0xf8f9b8(0x148)](_0xf8f9b8(0xa2)+'agents\x20s'+_0xf8f9b8(0xe9),{'sources':_0x225d9e['openclaw'][_0xf8f9b8(0x79)+_0xf8f9b8(0xda)+_0xf8f9b8(0x226)],'entryCount':_0x126d52[_0xf8f9b8(0x178)]?.[_0xf8f9b8(0xf4)+'nt'],'installPath':_0x126d52[_0xf8f9b8(0x178)]?.[_0xf8f9b8(0x252)+_0xf8f9b8(0x102)]}),await syncProductSkills(_0x225d9e,_0x376bd2,_0x126d52),_0xa9c66a?.[_0xf8f9b8(0x148)](_0xf8f9b8(0xa2)+_0xf8f9b8(0x66)+'ynced',{'sources':_0x225d9e[_0xf8f9b8(0x1d4)]['resolved'+'LocalSki'+_0xf8f9b8(0xf7)],'entryCount':_0x126d52['skills']?.[_0xf8f9b8(0xf4)+'nt'],'installPath':_0x126d52[_0xf8f9b8(0x215)]?.[_0xf8f9b8(0x252)+'ath']}),await syncRuntimeWrapper(_0x225d9e,_0x376bd2,_0x126d52),_0xa9c66a?.['info'](_0xf8f9b8(0x136)+_0xf8f9b8(0x172)+_0xf8f9b8(0xe7),{'wujieclawBin':_0x126d52[_0xf8f9b8(0x1da)+_0xf8f9b8(0x1fb)]}),await writeJson(resolveManifestPath(_0x376bd2),_0x126d52),_0xa9c66a?.[_0xf8f9b8(0x148)]('runtime\x20'+_0xf8f9b8(0xbc)+_0xf8f9b8(0xca),{'manifestPath':resolveManifestPath(_0x376bd2),'manifest':summarizeRuntimeManifest(_0x126d52),'durationMs':Date[_0xf8f9b8(0x210)]()-_0x277dba}),await _0xa9c66a?.[_0xf8f9b8(0xd3)](),_0x126d52;}catch(_0x7b5a5e){_0xa9c66a?.[_0xf8f9b8(0x107)](_0xf8f9b8(0x15d)+_0xf8f9b8(0x136)+_0xf8f9b8(0x1cf),{'syncOnly':syncOnly,'runtimeRoot':_0x376bd2,'durationMs':Date[_0xf8f9b8(0x210)]()-_0x277dba,'error':_0x7b5a5e}),await _0xa9c66a?.['flush']();throw _0x7b5a5e;}}async function syncRuntimeWrapper(_0x13094b,_0x263e49,_0x4bab1c){const _0x55eb7b=_0x5ae80f,_0x9035e9=_0x13094b[_0x55eb7b(0x1d4)]?.[_0x55eb7b(0x1f7)+_0x55eb7b(0x1c3)]??_0x55eb7b(0x70)+_0x55eb7b(0x8c),_0x4f103=join(_0x263e49,_0x55eb7b(0x14b),_0x55eb7b(0x1da)+'w'),_0x1ef6c1=join(_0x263e49,_0x55eb7b(0x14b),_0x55eb7b(0x1da)+_0x55eb7b(0x218)),_0x64006b=normalizeRuntimeRelativePath(relative(dirname(_0x4f103),resolve(_0x263e49,_0x4bab1c[_0x55eb7b(0x95)+_0x55eb7b(0x204)]))),_0x1da6e5=normalizeRuntimeRelativePath(relative(dirname(_0x4f103),resolve(_0x263e49,_0x4bab1c[_0x55eb7b(0x1d4)+_0x55eb7b(0x1c5)]))),_0x243acf=_0x55eb7b(0xc5)+_0x13094b[_0x55eb7b(0x12d)+_0x55eb7b(0x223)],_0x3ad2b8=_0x55eb7b(0xa9)+_0x55eb7b(0xab)+_0x13094b['dataDirN'+_0x55eb7b(0x223)];await mkdir(dirname(_0x4f103),{'recursive':!![]});const _0x343945=fileURLToPath(new URL('../../as'+_0x55eb7b(0x1f5)+'ie-logo.'+_0x55eb7b(0x22a),import.meta.url)),_0xa47c4c=join(_0x263e49,_0x55eb7b(0x14b),_0x55eb7b(0x24e)+_0x55eb7b(0x1e8));await cp(_0x343945,_0xa47c4c),await writeFile(_0x4f103,['#!/bin/s'+'h',_0x55eb7b(0x206)+_0x55eb7b(0x18e)+_0x55eb7b(0x160)+'OPENCLAW'+_0x55eb7b(0x224)+_0x243acf+'}\x22',_0x55eb7b(0x206)+'PENCLAW_'+_0x55eb7b(0xc8)+'R=\x22${OPE'+_0x55eb7b(0x1d5)+_0x55eb7b(0x189)+'-'+_0x243acf+'}\x22','export\x20O'+_0x55eb7b(0x18e)+'CONFIG_F'+_0x55eb7b(0x249)+_0x55eb7b(0x207)+_0x55eb7b(0x194)+_0x55eb7b(0x13a)+_0x55eb7b(0x69)+_0x9035e9+'}\x22',_0x55eb7b(0x206)+'PENCLAW_'+'CONFIG_P'+_0x55eb7b(0x156)+_0x55eb7b(0x18e)+'CONFIG_P'+_0x55eb7b(0x82)+_0x243acf+'/'+_0x9035e9+'}\x22',_0x55eb7b(0x1cc)+_0x55eb7b(0x20e)+_0x55eb7b(0x1be)+_0x55eb7b(0x23a)+_0x55eb7b(0x257)+'\x20\x22$0\x22)\x22\x20'+_0x55eb7b(0x1d6),_0x55eb7b(0x105)+_0x55eb7b(0x9c)+_0x55eb7b(0x23b)+'JIE_NO_L'+_0x55eb7b(0x90)+_0x55eb7b(0x14f),_0x55eb7b(0x1c2)+'PT_DIR/'+_0x64006b+(_0x55eb7b(0x114)+'PT_DIR/w'+'ujie-log'+'o.mjs\x22\x202'+_0x55eb7b(0x200)+'ll\x20||\x20tr'+'ue'),'fi',_0x55eb7b(0x1a9)+_0x55eb7b(0x13f)+'R/'+_0x64006b+(_0x55eb7b(0x114)+_0x55eb7b(0x175))+_0x1da6e5+_0x55eb7b(0x113),''][_0x55eb7b(0x18f)]('\x0a'),_0x55eb7b(0xc7)),await chmod(_0x4f103,0x1ed),await writeFile(_0x1ef6c1,[_0x55eb7b(0x239)+'f',_0x55eb7b(0x112)+'NCLAW_HO'+'ME%\x22==\x22\x22'+_0x55eb7b(0x1fc)+_0x55eb7b(0x149)+_0x55eb7b(0x247)+_0x3ad2b8+'\x22',_0x55eb7b(0x112)+'NCLAW_ST'+_0x55eb7b(0x25a)+_0x55eb7b(0x7d)+_0x55eb7b(0x201)+_0x55eb7b(0x1b6)+_0x55eb7b(0x6c)+_0x3ad2b8+'\x22',_0x55eb7b(0x112)+_0x55eb7b(0x11f)+_0x55eb7b(0xd4)+_0x55eb7b(0x7f)+_0x55eb7b(0x23d)+_0x55eb7b(0x10f)+_0x55eb7b(0xe1)+_0x55eb7b(0x12f)+_0x55eb7b(0x1d0)+_0x9035e9+'\x22','if\x20\x22%OPE'+_0x55eb7b(0x11f)+'NFIG_PAT'+'H%\x22==\x22\x22\x20'+'set\x20\x22OPE'+_0x55eb7b(0x11f)+'NFIG_PAT'+'H='+_0x3ad2b8+'\x5c'+_0x9035e9+'\x22',_0x55eb7b(0xf6)+_0x55eb7b(0x1e2)+'%~dp0\x22',_0x55eb7b(0x15e)+_0x55eb7b(0x6d)+toWindowsPath(_0x64006b)+(_0x55eb7b(0x1e6)+'PT_DIR%')+toWindowsPath(_0x1da6e5)+_0x55eb7b(0x25d),''][_0x55eb7b(0x18f)]('\x0d\x0a'),_0x55eb7b(0xc7)),_0x4bab1c['wujiecla'+_0x55eb7b(0x1fb)]=toRuntimeRelative(_0x263e49,process[_0x55eb7b(0xad)]===_0x55eb7b(0x85)?_0x1ef6c1:_0x4f103);}async function patchChatHistoryMixedToolContentBug(_0x305417,_0x2afaac,_0x45c6f7={}){const _0x5a8e1c=_0x5ae80f,_0xa150b9=resolve(_0x305417,_0x2afaac[_0x5a8e1c(0x1d4)+_0x5a8e1c(0x157)+'ir']),_0x14dcc0=join(_0xa150b9,_0x5a8e1c(0x229));let _0x159b73=[];try{_0x159b73=await readdir(_0x14dcc0,{'withFileTypes':!![]});}catch{_0x45c6f7[_0x5a8e1c(0xef)+_0x5a8e1c(0x11e)]?.[_0x5a8e1c(0x159)]?.(_0x5a8e1c(0x259)+'tory\x20mix'+_0x5a8e1c(0xe4)+_0x5a8e1c(0x1a5)+_0x5a8e1c(0x214)+_0x5a8e1c(0x246)+'found',{'distDir':_0x14dcc0,'openclawVersion':_0x2afaac[_0x5a8e1c(0x1d4)+_0x5a8e1c(0x237)]});return;}const _0x121087=_0x159b73['filter'](_0xb62b0d=>_0xb62b0d[_0x5a8e1c(0x17e)]()&&_0xb62b0d[_0x5a8e1c(0xb7)][_0x5a8e1c(0x96)+'th'](_0x5a8e1c(0x1ec)+'play-pro'+'jection-')&&_0xb62b0d[_0x5a8e1c(0xb7)][_0x5a8e1c(0xcb)](_0x5a8e1c(0x8d)))[_0x5a8e1c(0x1a8)](_0x31528b=>join(_0x14dcc0,_0x31528b[_0x5a8e1c(0xb7)]));if(_0x121087[_0x5a8e1c(0x171)]===0x0){_0x45c6f7[_0x5a8e1c(0xef)+_0x5a8e1c(0x11e)]?.[_0x5a8e1c(0x159)]?.(_0x5a8e1c(0x259)+_0x5a8e1c(0x1ab)+_0x5a8e1c(0xe4)+_0x5a8e1c(0x1a5)+_0x5a8e1c(0xe0)+_0x5a8e1c(0x180)+_0x5a8e1c(0x72),{'openclawVersion':_0x2afaac[_0x5a8e1c(0x1d4)+_0x5a8e1c(0x237)]});return;}for(const _0x3660d8 of _0x121087){const _0x13bfe2=await readFile(_0x3660d8,_0x5a8e1c(0xc7)),_0x5a29b5=patchMixedToolContentFromSource(_0x13bfe2);if(!_0x5a29b5[_0x5a8e1c(0xee)]){if(_0x5a29b5['reason']===_0x5a8e1c(0x16f)+_0x5a8e1c(0xee)){_0x45c6f7[_0x5a8e1c(0xef)+_0x5a8e1c(0x11e)]?.[_0x5a8e1c(0x148)]?.('chat\x20his'+_0x5a8e1c(0x1ab)+_0x5a8e1c(0xe4)+_0x5a8e1c(0x1ee)+'ready\x20ap'+_0x5a8e1c(0x23f),{'openclawVersion':_0x2afaac[_0x5a8e1c(0x1d4)+'Version'],'filePath':_0x3660d8});return;}continue;}await writeFile(_0x3660d8,_0x5a29b5[_0x5a8e1c(0x150)],_0x5a8e1c(0xc7)),_0x45c6f7[_0x5a8e1c(0xef)+'ogger']?.[_0x5a8e1c(0x148)]?.(_0x5a8e1c(0x259)+'tory\x20mix'+'ed-tool\x20'+_0x5a8e1c(0x103)+_0x5a8e1c(0x23f),{'openclawVersion':_0x2afaac['openclaw'+'Version'],'filePath':_0x3660d8,'note':'Temporar'+'y\x20compat'+'ibility\x20'+'patch\x20fo'+_0x5a8e1c(0x16c)+_0x5a8e1c(0x225)+'6\x20mixed\x20'+'tool\x20his'+_0x5a8e1c(0xf3)+_0x5a8e1c(0x92)+_0x5a8e1c(0x1b9)+_0x5a8e1c(0xc6)+'ream\x20fix'+_0x5a8e1c(0x11d)+_0x5a8e1c(0x108)+_0x5a8e1c(0x217)});return;}_0x45c6f7[_0x5a8e1c(0xef)+_0x5a8e1c(0x11e)]?.[_0x5a8e1c(0x159)]?.('chat\x20his'+'tory\x20mix'+_0x5a8e1c(0xe4)+'patch\x20sk'+_0x5a8e1c(0xe0)+_0x5a8e1c(0x24d)+_0x5a8e1c(0xe6)+'d',{'openclawVersion':_0x2afaac['openclaw'+_0x5a8e1c(0x237)]});}async function patchChannelPluginRuntimeBug(_0x396855,_0xb27f8e,_0x243bff={}){const _0x2b9492=_0x5ae80f,_0x5f55af=resolve(_0x396855,_0xb27f8e['openclaw'+_0x2b9492(0x157)+'ir']),_0x5aaafb=join(_0x5f55af,_0x2b9492(0x229));let _0x4ff850=[];try{_0x4ff850=await readdir(_0x5aaafb,{'withFileTypes':!![]});}catch{_0x243bff['runtimeL'+_0x2b9492(0x11e)]?.[_0x2b9492(0x159)]?.(_0x2b9492(0xeb)+_0x2b9492(0x91)+_0x2b9492(0x141)+_0x2b9492(0x1bf)+_0x2b9492(0xb0)+_0x2b9492(0x120)+_0x2b9492(0x18b),{'distDir':_0x5aaafb,'openclawVersion':_0xb27f8e[_0x2b9492(0x1d4)+_0x2b9492(0x237)]});return;}const _0x309859=_0x4ff850[_0x2b9492(0xdc)](_0x43b913=>_0x43b913[_0x2b9492(0x17e)]()&&_0x43b913['name'][_0x2b9492(0x96)+'th'](_0x2b9492(0x77))&&_0x43b913[_0x2b9492(0xb7)]['endsWith'](_0x2b9492(0x8d)))[_0x2b9492(0x1a8)](_0x12539e=>join(_0x5aaafb,_0x12539e[_0x2b9492(0xb7)])),_0x301e9d=await resolveRuntimeChannelImportPath(_0x5aaafb,_0x4ff850);if(_0x309859['length']===0x0){_0x243bff[_0x2b9492(0xef)+_0x2b9492(0x11e)]?.[_0x2b9492(0x159)]?.(_0x2b9492(0xeb)+_0x2b9492(0x91)+'untime\x20p'+'atch\x20ski'+_0x2b9492(0xf9)+_0x2b9492(0x170)+_0x2b9492(0x230),{'openclawVersion':_0xb27f8e['openclaw'+_0x2b9492(0x237)]});return;}if(!_0x301e9d){_0x243bff[_0x2b9492(0xef)+_0x2b9492(0x11e)]?.[_0x2b9492(0x159)]?.('channel\x20'+_0x2b9492(0x91)+_0x2b9492(0x141)+_0x2b9492(0x1bf)+_0x2b9492(0x123)+'ntime\x20ch'+'annel\x20en'+_0x2b9492(0x88)+_0x2b9492(0x72),{'openclawVersion':_0xb27f8e[_0x2b9492(0x1d4)+_0x2b9492(0x237)],'distDir':_0x5aaafb});return;}for(const _0x469946 of _0x309859){const _0x50193d=await readFile(_0x469946,_0x2b9492(0xc7)),_0x2f8bad=patchChannelPluginRuntimeFromSource(_0x50193d,{'runtimeChannelImportPath':_0x301e9d});if(!_0x2f8bad[_0x2b9492(0xee)]){if(_0x2f8bad[_0x2b9492(0x75)]===_0x2b9492(0x16f)+_0x2b9492(0xee)){_0x243bff[_0x2b9492(0xef)+'ogger']?.[_0x2b9492(0x148)]?.(_0x2b9492(0xeb)+'plugin\x20r'+_0x2b9492(0x141)+_0x2b9492(0xac)+_0x2b9492(0xd9)+_0x2b9492(0x186),{'openclawVersion':_0xb27f8e[_0x2b9492(0x1d4)+_0x2b9492(0x237)],'filePath':_0x469946});return;}continue;}await writeFile(_0x469946,_0x2f8bad['source'],_0x2b9492(0xc7)),_0x243bff[_0x2b9492(0xef)+_0x2b9492(0x11e)]?.[_0x2b9492(0x148)]?.(_0x2b9492(0xeb)+_0x2b9492(0x91)+_0x2b9492(0x141)+'atch\x20app'+_0x2b9492(0x186),{'openclawVersion':_0xb27f8e[_0x2b9492(0x1d4)+_0x2b9492(0x237)],'filePath':_0x469946,'note':_0x2b9492(0x258)+_0x2b9492(0x18d)+'ibility\x20'+'patch\x20fo'+_0x2b9492(0x16c)+_0x2b9492(0x225)+'6.6\x20chan'+'nel\x20plug'+_0x2b9492(0xfd)+_0x2b9492(0xaa)+_0x2b9492(0x1ef)+_0x2b9492(0x13c)+_0x2b9492(0x177)+_0x2b9492(0x21a)+'fy\x20upstr'+'eam\x20fix\x20'+_0x2b9492(0x250)+_0x2b9492(0x173)+'es.'});return;}_0x243bff['runtimeL'+'ogger']?.[_0x2b9492(0x159)]?.('channel\x20'+'plugin\x20r'+_0x2b9492(0x141)+_0x2b9492(0x1bf)+_0x2b9492(0x123)+_0x2b9492(0xf5)+_0x2b9492(0x1eb)+_0x2b9492(0xb5),{'openclawVersion':_0xb27f8e['openclaw'+'Version']});}async function patchSessionStoreSqliteRuntime(_0x1d565e,_0x5239e5,_0x29c5e5={}){const _0x3fb9c9=_0x5ae80f,_0x3bd8a5=resolve(_0x1d565e,_0x5239e5[_0x3fb9c9(0x1d4)+'WorkingD'+'ir']),_0x5e547b=join(_0x3bd8a5,'dist'),_0xf63066='../../sh'+'ell-runt'+_0x3fb9c9(0xde)+'ions/run'+_0x3fb9c9(0x127)+_0x3fb9c9(0x143),_0x57c3a6=(await readdir(_0x5e547b,{'withFileTypes':!![]})[_0x3fb9c9(0x11c)](()=>[]))[_0x3fb9c9(0xdc)](_0x9ae1d8=>_0x9ae1d8['isFile']()&&_0x9ae1d8[_0x3fb9c9(0xb7)]['startsWi'+'th']('store-lo'+_0x3fb9c9(0x24f))&&_0x9ae1d8[_0x3fb9c9(0xb7)]['endsWith']('.js'))[_0x3fb9c9(0x1a8)](_0x5676fe=>join(_0x5e547b,_0x5676fe[_0x3fb9c9(0xb7)])),_0x15c5bc=(await readdir(_0x5e547b,{'withFileTypes':!![]})[_0x3fb9c9(0x11c)](()=>[]))[_0x3fb9c9(0xdc)](_0x2c6386=>_0x2c6386['isFile']()&&_0x2c6386[_0x3fb9c9(0xb7)][_0x3fb9c9(0x96)+'th']('store-')&&!_0x2c6386[_0x3fb9c9(0xb7)][_0x3fb9c9(0x96)+'th'](_0x3fb9c9(0x21c)+_0x3fb9c9(0x24f))&&_0x2c6386[_0x3fb9c9(0xb7)]['endsWith']('.js'))[_0x3fb9c9(0x1a8)](_0x249a7d=>join(_0x5e547b,_0x249a7d[_0x3fb9c9(0xb7)]));for(const _0x28f51a of _0x57c3a6){const _0x2022f2=await readFile(_0x28f51a,_0x3fb9c9(0xc7)),_0x253655=patchSessionStoreLoadFromSource(_0x2022f2,{'bridgeImportPath':_0xf63066});if(!_0x253655['patched']){if(_0x253655[_0x3fb9c9(0x75)]===_0x3fb9c9(0x16f)+_0x3fb9c9(0xee)){_0x29c5e5[_0x3fb9c9(0xef)+_0x3fb9c9(0x11e)]?.[_0x3fb9c9(0x148)]?.(_0x3fb9c9(0x16d)+_0x3fb9c9(0x21f)+_0x3fb9c9(0x125)+_0x3fb9c9(0x231)+_0x3fb9c9(0x153),{'filePath':_0x28f51a,'openclawVersion':_0x5239e5[_0x3fb9c9(0x1d4)+'Version']});break;}continue;}await writeFile(_0x28f51a,_0x253655[_0x3fb9c9(0x150)],_0x3fb9c9(0xc7)),_0x29c5e5[_0x3fb9c9(0xef)+_0x3fb9c9(0x11e)]?.[_0x3fb9c9(0x148)]?.('session\x20'+'store\x20lo'+_0x3fb9c9(0x125)+'\x20applied',{'filePath':_0x28f51a,'openclawVersion':_0x5239e5['openclaw'+_0x3fb9c9(0x237)]});break;}for(const _0x2fede2 of _0x15c5bc){const _0x5a2a4a=await readFile(_0x2fede2,_0x3fb9c9(0xc7)),_0x48280a=patchSessionStoreWriteFromSource(_0x5a2a4a,{'bridgeImportPath':_0xf63066});if(!_0x48280a[_0x3fb9c9(0xee)]){if(_0x48280a[_0x3fb9c9(0x75)]===_0x3fb9c9(0x16f)+_0x3fb9c9(0xee)){_0x29c5e5[_0x3fb9c9(0xef)+'ogger']?.[_0x3fb9c9(0x148)]?.(_0x3fb9c9(0x16d)+_0x3fb9c9(0x1e0)+_0x3fb9c9(0x8b)+'h\x20alread'+_0x3fb9c9(0x167)+'d',{'filePath':_0x2fede2,'openclawVersion':_0x5239e5[_0x3fb9c9(0x1d4)+'Version']});break;}continue;}await writeFile(_0x2fede2,_0x48280a[_0x3fb9c9(0x150)],'utf8'),_0x29c5e5[_0x3fb9c9(0xef)+_0x3fb9c9(0x11e)]?.[_0x3fb9c9(0x148)]?.(_0x3fb9c9(0x16d)+_0x3fb9c9(0x1e0)+_0x3fb9c9(0x8b)+_0x3fb9c9(0x1fa)+'d',{'filePath':_0x2fede2,'openclawVersion':_0x5239e5[_0x3fb9c9(0x1d4)+_0x3fb9c9(0x237)]});break;}}async function resolveRuntimeChannelImportPath(_0x5f10fd,_0x3625c5){const _0x34fd74=_0x5ae80f,_0xd42522=_0x3625c5[_0x34fd74(0xdc)](_0x1afe2d=>_0x1afe2d[_0x34fd74(0x17e)]()&&_0x1afe2d[_0x34fd74(0xb7)][_0x34fd74(0x96)+'th'](_0x34fd74(0x181)+_0x34fd74(0x128))&&_0x1afe2d[_0x34fd74(0xb7)][_0x34fd74(0xcb)](_0x34fd74(0x8d))&&!_0x1afe2d[_0x34fd74(0xb7)][_0x34fd74(0x96)+'th'](_0x34fd74(0x181)+'channel-'+_0x34fd74(0x9d)))[_0x34fd74(0x1a8)](_0x5a9875=>_0x5a9875[_0x34fd74(0xb7)])[_0x34fd74(0x1fe)]();for(const _0x16a9f3 of _0xd42522){const _0x597b7e=await readFile(join(_0x5f10fd,_0x16a9f3),_0x34fd74(0xc7));if(_0x597b7e[_0x34fd74(0x68)](_0x34fd74(0x166)+_0x34fd74(0x202)+_0x34fd74(0x1f8)))return'./'+_0x16a9f3;}return null;}function normalizeRuntimeRelativePath(_0x206db5){const _0x43696b=_0x5ae80f;return _0x206db5[_0x43696b(0x81)+'ll']('\x5c','/');}function _0x52fa(){const _0x3e9d90=['d\x20an\x20inv','h\x20applie','wBin','\x20set\x20\x22OP','penClaw\x20','sort','find','>/dev/nu','t\x20\x22OPENC','ntimeCha','ugin\x20dep','utable','Spec','export\x20O','=\x22${OPEN','fix\x20star','--omit=d','required','nodeVers','g\x20from\x20O','ecs','IR=$(CDP','st\x20be\x20a\x20','now','lib/node','win','14775112yalqaU','ipped;\x20d','skills','rg/dist/','des.','w.cmd','-peer-de','rs;\x20veri','keys','store-lo','npm-cli.','match','store\x20lo','parse','d:\x20','st=','ame','_HOME:-','aw\x202026.','ntPaths','data','.json','dist','mjs','package','nced',',\x20shell.','npm-glob','--legacy','\x20found','\x20already','2JGfuaL','toISOStr','unknown','pendenci','split','Version','lugin\x20','@echo\x20of','--\x20\x22$(di','\x20-z\x20\x22$WU','string','==\x22\x22\x20set','und:\x20','plied','ld\x20start','m-cli.js','replace','\x20not\x20fou','age\x20was\x20','download','ist\x20not\x20','OME=','nning\x20op','ILE_NAME','agentSco','fix\x20mark','function','unction\x20','wujie-lo','ad-','on\x20futur','time]\x20ru','installP','trim','npm-cach','runtimeS','arch','rname\x20--','Temporar','chat\x20his','ATE_DIR%','connecto','runtime:','\x22\x20%*','skills\x20s','/npm','includes','_NAME:-','-doctor.','arm64','E_DIR=','_DIR%','\x20prepare','local\x20pl','wujieai.','devDepen','found','time]\x20do','pipe','reason','object','loader-','npm\x20root','resolved','\x20paths','[wujie-s','268456BETFIu','\x22==\x22\x22\x20se','isArray','E_NAME%\x22','idated','replaceA','ATH:-','te/cli\x20i','\x20kdocs\x20s','win32','l\x20prepar','153EEMvXt','try\x20not\x20','package.','lib','ite\x20patc','json','.js','--no-fun','rebuilt\x20','OGO\x22\x20];\x20','plugin\x20r','jection\x20','cal\x20runt','slice','nodeExec','startsWi','\x20resolve','pluginSp','label','shasum','indexOf','1\x20]\x20&&\x20[','state-','-extract','sion\x20val','alid\x20pay','path','product\x20','288410eZXxLR','ie-shell','config=','npm','\x20create\x20','\x20path\x20mu','%USERPRO','me\x20missi','FILE%\x5c','atch\x20alr','platform','dules/np','sion\x20mis','pped;\x20di','1986996iUPKfS','octor\x20--','Claw','stdout','ot\x20found','plugin\x20s','name','dependen','node','add','projectR','manifest','shell-ru','values','unzip','\x20complet','he\x20runti','npmCli','LocalPlu','enclaw\x20d','$HOME/','ify\x20upst','utf8','STATE_DI','with\x20cod','\x20written','endsWith','integrit','OpenClaw','tarball:','isDirect','all\x20loca','href','d\x20to\x20','flush','NFIG_FIL','skipped;','runtime','runtimeR','roductRu','eady\x20app','LocalAge','pid','filter','node/bin','ime/sess','ules','ipped;\x20f','AW_CONFI','pec:\x20','configur','ed-tool\x20','in\x20','not\x20foun','synced','-xzf','ynced','--no-aud','channel\x20','process.','cli','patched','runtimeL','stalling','push','headers','tory\x20pro','entryCou','ntime\x20re','set\x20\x22SCR','llPaths','scripts','pped;\x20lo','skill','index.mj','base\x20bui','in\x20runti','in\x20insta','_shared','Dependen','extract-','ath','patch\x20ap','er\x20writt','if\x20[\x20-t\x20','ion','error','re\x20upgra','rent','leted','tar','\x20product','ut\x20after','LocalSki','\x20\x22OPENCL','es\x20','plugins','if\x20\x22%OPE','\x22\x20\x22$@\x22','\x22\x20\x22$SCRI','\x20can\x20ins','stderr','npm\x20pack','132vrcCYr','y:\x20','path:\x20','tar.xz','catch','\x20on\x20futu','ogger','NCLAW_CO','st\x20not\x20f','\x20configu','director','pped;\x20ru','npm\x20inst','ad\x20patch','12wAFYmB','time-bri','channel-','68290lpYdAr',':\x20manife','--fix','time-too','dataDirN','red\x20Open','G_FILE_N','ginPaths','2428223TdWHUj','time','--json','ncies','\x20doctor\x20','runtime\x20','\x20install','@larksui','/node_mo','FIG_FILE','node_mod','el.inbou','tools\x20sy','ady\x20curr','CRIPT_DI','kill\x20not','untime\x20p','fix\x20comp','dge.mjs','\x20bin\x20was','set','timeoutM','w-extrac','info','ENCLAW_H','ing','bin','endencie','npm\x20plug','ebuild\x20t','then','source','eted','eer','\x20applied','ntime','hell:run','ATH=\x22${O','WorkingD','ent','warn','doctor','\x22\x20at\x20','syncOnly','prepare\x20','\x22%SCRIPT','prepareP','HOME=\x22${','SIGTERM','\x20path\x20wa','\x22\x20so\x20the','node\x20ver','\x20did\x20not','createRu','y\x20applie','\x20returne','s\x20not\x20fo','close','Unable\x20t','r\x20OpenCl','session\x20','928637YvKFnW','already-','ader\x20not','length','wrapper\x20','e\x20upgrad','lled','PT_DIR/','led','nd\x20helpe','agents','\x20timed\x20o','ted','has','resume','registry','isFile','nd\x20after','ile\x20not\x20','runtime-','Name','4wzICLS','kill','\x22\x20from\x20','lied','ced','statusCo','ATE_DIR:','dencies','ound','Configur','y\x20compat','PENCLAW_','join','.opencla','Duplicat','ignore',';\x20run\x20wu','CLAW_CON','https://','filename','e\x20plugin','null','optional','extensio','plugins\x20','ujie-she','ime\x20buil','oot','spec','\x20entry\x20\x22','\x20validat','\x20id\x20from','atch:\x20ma','.\x20Run\x20\x22w','patch\x20sk','ed\x20OpenC','Run\x20\x22wuj','map','exec\x20\x22$S','location','tory\x20mix','red\x20Node','dataDir','re\x22\x20to\x20r','missing\x20','s\x20instal','some','-xJf','d\x20for\x20lo','?t=','\x20version','LAW_STAT','toString','generate','bug;\x20ver','root','\x20is\x20miss','\x20loaded','execPath','ATH=\x20cd\x20','atch\x20ski','dAt','log','\x20\x20\x22$SCRI','leName','m/bin/np','Bin','install','Invalid\x20','x64','allowMis','\x20runtime','JSON:\x20','SCRIPT_D','eady\x20cur','started','failed','AME=','env','extract\x20','local:','openclaw','NCLAW_ST','&&\x20pwd)','.plugin-','local','appId','wujiecla','s\x20missin','ory','cies','r\x20runtim','product','store\x20wr','jie-shel','IPT_DIR=','e\x20tools\x20','pack','\x20failed\x20','\x22\x20\x22%SCRI','/opencla','go.mjs','version','Claw\x20ver','solver\x20n','chat-dis','versions','patch\x20al','ng\x20chann','ld\x20compl','.cache','time]\x20in','or.com','--omit=p','sets/wuj','pluginId','configFi','nnel'];_0x52fa=function(){return _0x3e9d90;};return _0x52fa();}function toWindowsPath(_0xcda2f0){return _0xcda2f0['replaceA'+'ll']('/','\x5c');}function validateRuntimeNodeVersion(_0x3bd505,_0x123540){const _0x5958c3=_0x5ae80f;if(_0x3bd505[_0x5958c3(0x20b)+_0x5958c3(0x106)]===_0x123540[_0x5958c3(0x1d4)][_0x5958c3(0x20b)+_0x5958c3(0x106)])return;throw new Error(_0x5958c3(0x136)+_0x5958c3(0x20b)+'ion\x20mism'+_0x5958c3(0x1a3)+'nifest='+(_0x3bd505[_0x5958c3(0x20b)+'ion']||_0x5958c3(0x234))+(_0x5958c3(0x22d)+_0x5958c3(0xa5))+_0x123540[_0x5958c3(0x1d4)][_0x5958c3(0x20b)+_0x5958c3(0x106)]+'.\x20'+(_0x5958c3(0x1a7)+_0x5958c3(0xa4)+_0x5958c3(0x6e)+_0x5958c3(0x163)+_0x5958c3(0x10c)+_0x5958c3(0x1ca)+'\x20can\x20be\x20'+_0x5958c3(0x8f)+'with\x20the'+'\x20configu'+_0x5958c3(0x1ac)+_0x5958c3(0x1b5)+'.'));}function validateRuntimeOpenClawVersion(_0x1fb9ea,_0x2f1f49){const _0x3c3962=_0x5ae80f;if(_0x1fb9ea[_0x3c3962(0x1d4)+_0x3c3962(0x237)]===_0x2f1f49[_0x3c3962(0x1d4)]['openclaw'+_0x3c3962(0x237)])return;throw new Error(_0x3c3962(0x136)+'openclaw'+'Version\x20'+'mismatch'+_0x3c3962(0x12a)+_0x3c3962(0x222)+(_0x1fb9ea['openclaw'+'Version']||_0x3c3962(0x234))+(_0x3c3962(0x22d)+_0x3c3962(0xa5))+_0x2f1f49[_0x3c3962(0x1d4)][_0x3c3962(0x1d4)+_0x3c3962(0x237)]+'.\x20'+(_0x3c3962(0x1a7)+'ie-shell'+_0x3c3962(0x6e)+'\x22\x20so\x20the'+_0x3c3962(0x1ca)+_0x3c3962(0x115)+'tall\x20the'+_0x3c3962(0x121)+_0x3c3962(0x12e)+_0x3c3962(0x1ea)+'sion.'));}function parseNpmPackJson(_0x5178bd){const _0x1ed40e=_0x5ae80f,_0x133784=_0x5178bd[_0x1ed40e(0x253)](),_0x2d9623=_0x133784[_0x1ed40e(0x9b)]('[');if(_0x2d9623<0x0)throw new Error('npm\x20pack'+'\x20did\x20not'+'\x20return\x20'+_0x1ed40e(0x1cb)+_0x133784[_0x1ed40e(0x94)](0x0,0x1f4));const _0x33f40f=JSON[_0x1ed40e(0x220)](_0x133784[_0x1ed40e(0x94)](_0x2d9623)),_0x388df3=Array[_0x1ed40e(0x7e)](_0x33f40f)?_0x33f40f[0x0]:_0x33f40f;if(!_0x388df3||typeof _0x388df3!==_0x1ed40e(0x76))throw new Error(_0x1ed40e(0x117)+_0x1ed40e(0x168)+_0x1ed40e(0x1f9)+_0x1ed40e(0xa0)+'load:\x20'+_0x133784[_0x1ed40e(0x94)](0x0,0x1f4));return _0x388df3;}function normalizePackedTarballFilename(_0x51f1a5){const _0x5a0534=_0x5ae80f;return _0x51f1a5[_0x5a0534(0x242)](/^@/,'')['replaceA'+'ll']('/','-')[_0x5a0534(0x81)+'ll']('\x5c','-');}async function runProcess(_0x27f1e2,_0x3e8842,_0x3998d7={}){const _0x3d4e57=_0x5ae80f,_0x528b21=_0x3998d7[_0x3d4e57(0x99)]||[_0x27f1e2,..._0x3e8842][_0x3d4e57(0x18f)]('\x20'),_0x53dcdc=_0x3998d7[_0x3d4e57(0x146)+'s']??NPM_INSTALL_TIMEOUT_MS,_0xcdc066=spawn(_0x27f1e2,_0x3e8842,{'cwd':_0x3998d7['cwd'],'env':_0x3998d7[_0x3d4e57(0x1d1)],'stdio':[_0x3d4e57(0x192),_0x3d4e57(0x74),'pipe']});return await new Promise((_0x186dac,_0x53161d)=>{const _0x580938=_0x3d4e57;let _0xe3adfe='',_0x56b6cb='',_0x55ecfa=![];const _0x4b2061=setTimeout(()=>{const _0x4c86eb=_0x458f;if(_0x55ecfa)return;_0x55ecfa=!![],_0xcdc066[_0x4c86eb(0x184)](_0x4c86eb(0x161)),_0x53161d(new Error(_0x528b21+(_0x4c86eb(0x179)+_0x4c86eb(0x10d)+'\x20')+_0x53dcdc+'ms'));},_0x53dcdc);_0xcdc066['stdout']['on']('data',_0x30e879=>{const _0x364ff8=_0x458f;_0xe3adfe+=_0x30e879[_0x364ff8(0x1b7)]();}),_0xcdc066[_0x580938(0x116)]['on'](_0x580938(0x227),_0x618997=>{const _0x1f9c05=_0x580938;_0x56b6cb+=_0x618997[_0x1f9c05(0x1b7)]();}),_0xcdc066['on'](_0x580938(0x107),_0x271145=>{if(_0x55ecfa)return;_0x55ecfa=!![],clearTimeout(_0x4b2061),_0x53161d(_0x271145);}),_0xcdc066['on']('close',(_0x16c3d1,_0x2e4bac)=>{const _0x1ec2a4=_0x580938;if(_0x55ecfa)return;_0x55ecfa=!![],clearTimeout(_0x4b2061);if(_0x16c3d1===0x0){_0x186dac({'stdout':_0xe3adfe,'stderr':_0x56b6cb});return;}_0x53161d(new Error(_0x528b21+(_0x1ec2a4(0x1e5)+_0x1ec2a4(0xc9)+'e=')+(_0x16c3d1??_0x1ec2a4(0x198))+'\x20signal='+(_0x2e4bac??'null')+'\x0a'+(''+(_0x56b6cb||_0xe3adfe))[_0x1ec2a4(0x253)]()));});});}async function installOpenClawPackage(_0xb57fa4,_0xd0a945){const _0x3e8bbc=_0x5ae80f,_0x310adc=join(_0xb57fa4['runtimeR'+_0x3e8bbc(0x19e)],_0x3e8bbc(0x1f1)),_0x4f20af=join(_0xb57fa4[_0x3e8bbc(0xd7)+_0x3e8bbc(0x19e)],_0x3e8bbc(0x190)+_0x3e8bbc(0x147)+'t');await mkdir(_0x310adc,{'recursive':!![]}),await removePathWithRetries(_0x4f20af),await mkdir(_0x4f20af,{'recursive':!![]});const _0x40a273=await createRuntimeEnv(_0xb57fa4),_0x4672f8=_0x3e8bbc(0x1d4)+'@'+_0xd0a945;console['log'](_0x3e8bbc(0x7b)+'hell:run'+_0x3e8bbc(0x1f2)+_0x3e8bbc(0xf0)+'\x20'+_0x4672f8);const _0x43c04c=await runProcess(_0xb57fa4[_0x3e8bbc(0x95)+'utable'],[_0xb57fa4[_0x3e8bbc(0xc2)],_0x3e8bbc(0x1e4),_0x4672f8,_0x3e8bbc(0x133)],{'cwd':_0x310adc,'env':_0x40a273,'label':'npm\x20pack'+'\x20'+_0x4672f8}),_0xd4aac=parseNpmPackJson(_0x43c04c[_0x3e8bbc(0xb4)]);if(_0xd4aac['version']!==_0xd0a945)throw new Error(_0x3e8bbc(0x18c)+_0x3e8bbc(0x1a6)+'law\x20'+_0xd0a945+(_0x3e8bbc(0x97)+_0x3e8bbc(0xd2))+_0xd4aac[_0x3e8bbc(0x1e9)]);const _0x8f3104=resolve(_0x310adc,_0xd4aac[_0x3e8bbc(0x196)]);if(!existsSync(_0x8f3104))throw new Error(_0x3e8bbc(0x117)+_0x3e8bbc(0x165)+'\x20create\x20'+_0x3e8bbc(0xce)+'\x20'+_0x8f3104);await runProcess(_0x3e8bbc(0x10b),[_0x3e8bbc(0xe8),_0x8f3104,'-C',_0x4f20af],{'label':_0x3e8bbc(0x1d2)+_0xd4aac[_0x3e8bbc(0x196)]}),await removePathWithRetries(_0xb57fa4[_0x3e8bbc(0x1d4)+'WorkingD'+'ir']),await rename(join(_0x4f20af,_0x3e8bbc(0x22b)),_0xb57fa4[_0x3e8bbc(0x1d4)+_0x3e8bbc(0x157)+'ir']),await removePathWithRetries(_0x4f20af),await runProcess(_0xb57fa4[_0x3e8bbc(0x95)+_0x3e8bbc(0x204)],[_0xb57fa4[_0x3e8bbc(0xc2)],_0x3e8bbc(0x1c6),_0x3e8bbc(0x209)+'ev',_0x3e8bbc(0x1f4)+_0x3e8bbc(0x152),'--no-aud'+'it',_0x3e8bbc(0x8e)+'d',_0x3e8bbc(0x22f)+_0x3e8bbc(0x219)+'ps'],{'cwd':_0xb57fa4[_0x3e8bbc(0x1d4)+_0x3e8bbc(0x157)+'ir'],'env':_0x40a273,'label':_0x3e8bbc(0x124)+'all\x20'+_0x4672f8+(_0x3e8bbc(0x1ca)+'\x20depende'+_0x3e8bbc(0x134))});if(!existsSync(_0xb57fa4[_0x3e8bbc(0x1d4)+_0x3e8bbc(0x1c5)]))throw new Error(_0x3e8bbc(0xcd)+_0x3e8bbc(0x144)+_0x3e8bbc(0x243)+_0x3e8bbc(0x17f)+_0x3e8bbc(0x137)+':\x20'+_0xb57fa4[_0x3e8bbc(0x1d4)+_0x3e8bbc(0x1c5)]);}async function ensureRuntimeBase(_0x27163a,_0x3a59a1,_0x62f1ee={}){const _0x15dfa8=_0x5ae80f;await mkdir(_0x3a59a1,{'recursive':!![]});let _0x34b84e=await readRuntimeManifest(_0x3a59a1);const _0x3e1d1b=_0x27163a[_0x15dfa8(0x1d4)][_0x15dfa8(0x20b)+_0x15dfa8(0x106)],_0x422d63=_0x27163a[_0x15dfa8(0x1d4)][_0x15dfa8(0x1d4)+_0x15dfa8(0x237)],_0xc57446=existsSync(resolveManifestPath(_0x3a59a1)),_0x280b70=runtimeHasRequiredPaths(_0x3a59a1,_0x34b84e),_0x453af5=_0x34b84e['nodeVers'+_0x15dfa8(0x106)]===_0x3e1d1b;!_0xc57446||!_0x280b70||!_0x453af5?(_0x62f1ee[_0x15dfa8(0xef)+'ogger']?.['info'](_0x15dfa8(0x136)+'base\x20bui'+_0x15dfa8(0x240)+'ed',{'runtimeRoot':_0x3a59a1,'reason':!_0xc57446?'missing\x20'+_0x15dfa8(0xbc):!_0x280b70?'missing\x20'+_0x15dfa8(0x20a)+_0x15dfa8(0x1ca)+_0x15dfa8(0x7a):_0x15dfa8(0x164)+_0x15dfa8(0xaf)+_0x15dfa8(0x21e),'syncOnly':_0x62f1ee[_0x15dfa8(0x15c)]}),_0x34b84e=await buildRuntimeBase(_0x27163a,_0x3a59a1,_0x34b84e),_0x62f1ee['runtimeL'+_0x15dfa8(0x11e)]?.[_0x15dfa8(0x148)](_0x15dfa8(0x136)+_0x15dfa8(0xfc)+_0x15dfa8(0x1f0)+_0x15dfa8(0x151),{'manifest':summarizeRuntimeManifest(_0x34b84e)})):_0x62f1ee[_0x15dfa8(0xef)+'ogger']?.[_0x15dfa8(0x148)](_0x15dfa8(0x136)+'base\x20alr'+_0x15dfa8(0x1cd)+_0x15dfa8(0x109),{'manifest':summarizeRuntimeManifest(_0x34b84e)});if(!existsSync(resolve(_0x3a59a1,_0x34b84e[_0x15dfa8(0x1d4)+_0x15dfa8(0x1c5)]))){const _0x55bbb7=createRuntimeInfoFromManifest(_0x3a59a1,_0x34b84e,{'allowMissingOpenClaw':!![]});await installOpenClawPackage(_0x55bbb7,_0x422d63),_0x34b84e[_0x15dfa8(0x1d4)+'Version']=_0x422d63;}return _0x34b84e;}function runtimeHasRequiredPaths(_0x527def,_0x592378){const _0x5d8946=_0x5ae80f;return[_0x5d8946(0x95)+_0x5d8946(0x204),_0x5d8946(0xc2),_0x5d8946(0x1d4)+_0x5d8946(0x157)+'ir',_0x5d8946(0x1d4)+_0x5d8946(0x1c5)]['every'](_0x319556=>typeof _0x592378[_0x319556]===_0x5d8946(0x23c)&&_0x592378[_0x319556][_0x5d8946(0x253)]())&&[_0x5d8946(0x95)+_0x5d8946(0x204),'npmCli']['every'](_0xe71f38=>existsSync(resolve(_0x527def,_0x592378[_0xe71f38])));}async function buildRuntimeBase(_0x1305a2,_0x350a13,_0xa916a4={}){const _0x400d45=_0x5ae80f,_0x58b890=join(_0x350a13,_0x400d45(0xb9));await ensureRuntimeNode(_0x1305a2,_0x58b890);const _0x3e9cdc={..._0xa916a4,'generatedAt':new Date()[_0x400d45(0x233)+_0x400d45(0x14a)](),'nodeVersion':_0x1305a2['openclaw'][_0x400d45(0x20b)+'ion'],'openclawVersion':_0xa916a4['openclaw'+'Version']||'','platform':process[_0x400d45(0xad)],'arch':process[_0x400d45(0x256)],'nodeExecutable':_0x400d45(0xdd)+'/node','npmCli':'node/lib'+_0x400d45(0x139)+_0x400d45(0xae)+_0x400d45(0x1c4)+_0x400d45(0x241),'openclawWorkingDir':'openclaw','openclawBin':_0x400d45(0x1d4)+_0x400d45(0x1e7)+'w.mjs'};return await writeJson(resolveManifestPath(_0x350a13),_0x3e9cdc),_0x3e9cdc;}async function removePathWithRetries(_0x1a40b2){await rm(_0x1a40b2,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96});}async function ensureRuntimeNode(_0x2cfed8,_0x1712d1){const _0x408fae=_0x5ae80f,_0x20bb5d=_0x2cfed8[_0x408fae(0x1d4)][_0x408fae(0x20b)+_0x408fae(0x106)],_0x4ecd88=join(_0x1712d1,_0x408fae(0x14b),'node'),_0x2232dd=join(_0x1712d1,_0x408fae(0x8a),_0x408fae(0x13b)+_0x408fae(0xdf),_0x408fae(0xa6),'bin',_0x408fae(0x21d)+'js');if(existsSync(_0x4ecd88)&&existsSync(_0x2232dd)&&await getNodeVersion(_0x4ecd88)===_0x20bb5d)return;await removePathWithRetries(_0x1712d1);if(process[_0x408fae(0x1ed)][_0x408fae(0xb9)]===_0x20bb5d){await linkCurrentNodeRuntime(_0x1712d1);return;}await downloadNodeRuntime(_0x20bb5d,_0x1712d1);}async function getNodeVersion(_0x2c2821){const _0x214f84=_0x5ae80f;try{const _0x467de4=await runProcess(_0x2c2821,['-p',_0x214f84(0xec)+_0x214f84(0x1ed)+'.node'],{'label':_0x2c2821+'\x20version','timeoutMs':0x7530});return _0x467de4[_0x214f84(0xb4)][_0x214f84(0x253)]();}catch{return'';}}async function linkCurrentNodeRuntime(_0x11c571){const _0x504b5a=_0x5ae80f,_0x176962=process[_0x504b5a(0x1bd)],_0xa75980=resolve(dirname(_0x176962),'..'),_0x1fe685=resolve(_0xa75980,_0x504b5a(0x211)+'_modules'+_0x504b5a(0x67)),_0x53c66e=join(_0x11c571,'bin',_0x504b5a(0xb9)),_0x3134ad=join(_0x11c571,_0x504b5a(0x8a),_0x504b5a(0x13b)+'ules','npm');await mkdir(dirname(_0x53c66e),{'recursive':!![]}),await mkdir(dirname(_0x3134ad),{'recursive':!![]}),await symlink(_0x176962,_0x53c66e),existsSync(_0x1fe685)?await symlink(_0x1fe685,_0x3134ad):await symlink(await resolveNpmRoot(),_0x3134ad);}async function resolveNpmRoot(){const _0x4bef49=_0x5ae80f,_0x268b63=await runProcess('npm',[_0x4bef49(0x1ba),'-g'],{'label':_0x4bef49(0x78)+'\x20-g','timeoutMs':0x7530}),_0x267306=join(_0x268b63[_0x4bef49(0xb4)][_0x4bef49(0x253)](),'npm');if(!existsSync(join(_0x267306,_0x4bef49(0x14b),_0x4bef49(0x21d)+'js')))throw new Error('npm\x20pack'+_0x4bef49(0x244)+'not\x20foun'+_0x4bef49(0x1b3)+_0x4bef49(0x93)+_0x4bef49(0x19d)+_0x4bef49(0x221)+_0x267306);return _0x267306;}async function downloadNodeRuntime(_0x14c241,_0x4ac8be){const _0x44dba8=_0x5ae80f,_0x3679cd=process['platform']===_0x44dba8(0x85)?_0x44dba8(0x212):process['platform'],_0x2e9d8a=process[_0x44dba8(0x256)]===_0x44dba8(0x1c8)?_0x44dba8(0x1c8):process[_0x44dba8(0x256)]===_0x44dba8(0x6b)?_0x44dba8(0x6b):process[_0x44dba8(0x256)],_0x540097=process[_0x44dba8(0xad)]===_0x44dba8(0x85)?'zip':_0x44dba8(0x11b),_0x4df7aa='node-v'+_0x14c241+'-'+_0x3679cd+'-'+_0x2e9d8a,_0x5f52c2=_0x4df7aa+'.'+_0x540097,_0x24e979=join(dirname(_0x4ac8be),_0x44dba8(0x1f1)),_0x11afd3=join(_0x24e979,_0x5f52c2),_0x583f07=join(_0x24e979,_0x4df7aa+(_0x44dba8(0x9e)+'-')+process[_0x44dba8(0xdb)]+'-'+Date[_0x44dba8(0x210)]()),_0x2564c2=_0x44dba8(0x195)+'nodejs.o'+_0x44dba8(0x216)+'v'+_0x14c241+'/'+_0x5f52c2;await mkdir(_0x24e979,{'recursive':!![]}),!existsSync(_0x11afd3)&&(console[_0x44dba8(0x1c1)](_0x44dba8(0x7b)+'hell:run'+_0x44dba8(0x73)+'wnloadin'+'g\x20'+_0x2564c2),await downloadFile(_0x2564c2,_0x11afd3)),await rm(_0x583f07,{'recursive':!![],'force':!![]}),await mkdir(_0x583f07,{'recursive':!![]}),process[_0x44dba8(0xad)]===_0x44dba8(0x85)?await runProcess(_0x44dba8(0xbf),['-q',_0x11afd3,'-d',_0x583f07],{'label':_0x44dba8(0x1d2)+_0x5f52c2}):await runProcess(_0x44dba8(0x10b),[_0x44dba8(0x1b2),_0x11afd3,'-C',_0x583f07],{'label':_0x44dba8(0x1d2)+_0x5f52c2}),await rename(join(_0x583f07,_0x4df7aa),_0x4ac8be),await rm(_0x583f07,{'recursive':!![],'force':!![]});}async function downloadFile(_0x102839,_0xd9588){await mkdir(dirname(_0xd9588),{'recursive':!![]});const _0x1bfe6c=await new Promise((_0x3c0901,_0x30efac)=>{const _0x3b9ba6=_0x458f;get(_0x102839,_0x476328=>{const _0x1af8b3=_0x458f;if(_0x476328[_0x1af8b3(0x188)+'de']>=0x12c&&_0x476328['statusCo'+'de']<0x190&&_0x476328['headers'][_0x1af8b3(0x1aa)]){_0x476328['resume'](),downloadFile(new URL(_0x476328[_0x1af8b3(0xf2)][_0x1af8b3(0x1aa)],_0x102839)[_0x1af8b3(0xd1)],_0xd9588)[_0x1af8b3(0x14f)](()=>_0x3c0901(null))[_0x1af8b3(0x11c)](_0x30efac);return;}if(_0x476328[_0x1af8b3(0x188)+'de']!==0xc8){_0x476328[_0x1af8b3(0x17c)](),_0x30efac(new Error(_0x1af8b3(0x245)+'\x20failed\x20'+_0x476328['statusCo'+'de']+':\x20'+_0x102839));return;}_0x3c0901(_0x476328);})['on'](_0x3b9ba6(0x107),_0x30efac);});_0x1bfe6c&&await pipeline(_0x1bfe6c,createWriteStream(_0xd9588));}export async function ensureOpenClawDoctorFixed(_0x1d8870,_0x26db71={}){const _0x1c355d=_0x5ae80f,_0x5d03e7=await loadRuntimeInfo(_0x1d8870['projectR'+_0x1c355d(0x19e)]),_0x42e7ec=getConfigPaths(_0x1d8870),_0x981f5c=join(_0x42e7ec[_0x1c355d(0x255)+'tateDir'],_0x1c355d(0x1d4)+_0x1c355d(0x6a)+_0x1c355d(0x8c)),_0x2bd2a1=await readJson(_0x981f5c,{});if(_0x2bd2a1[_0x1c355d(0x1d4)+_0x1c355d(0x237)]===_0x5d03e7[_0x1c355d(0x1d4)+_0x1c355d(0x237)])return _0x26db71[_0x1c355d(0xef)+_0x1c355d(0x11e)]?.[_0x1c355d(0x148)](_0x1c355d(0x1d4)+_0x1c355d(0x135)+'fix\x20alre'+_0x1c355d(0x13e)+_0x1c355d(0x158),{'openclawVersion':_0x5d03e7['openclaw'+_0x1c355d(0x237)],'markerPath':_0x981f5c}),{'ran':![],'openclawVersion':_0x5d03e7[_0x1c355d(0x1d4)+'Version'],'markerPath':_0x981f5c};return await runOpenClawDoctorFix(_0x1d8870,_0x5d03e7,{'fromVersion':_0x2bd2a1[_0x1c355d(0x1d4)+_0x1c355d(0x237)]||_0x1c355d(0x234),'toVersion':_0x5d03e7[_0x1c355d(0x1d4)+_0x1c355d(0x237)],'markerPath':_0x981f5c,'runtimeLogger':_0x26db71[_0x1c355d(0xef)+_0x1c355d(0x11e)]}),{'ran':!![],'openclawVersion':_0x5d03e7[_0x1c355d(0x1d4)+_0x1c355d(0x237)],'markerPath':_0x981f5c};}async function runOpenClawDoctorFix(_0x529c81,_0xa08646,{fromVersion:_0x2f67ed,toVersion:_0x39a2ba,markerPath:markerPath='',runtimeLogger:_0x9d3eb1}={}){const _0x599ec4=_0x5ae80f;_0x9d3eb1?.[_0x599ec4(0x148)](_0x599ec4(0x1d4)+_0x599ec4(0x135)+_0x599ec4(0x208)+_0x599ec4(0x17a),{'fromVersion':_0x2f67ed,'toVersion':_0x39a2ba});const _0x116f58=await createRuntimeEnv(_0xa08646,{'OPENCLAW_HOME':_0x529c81[_0x599ec4(0x1ad)],'OPENCLAW_STATE_DIR':_0x529c81['dataDir'],'OPENCLAW_CONFIG_PATH':getConfigPaths(_0x529c81)['configPa'+'th']});console[_0x599ec4(0x1c1)](_0x599ec4(0x7b)+_0x599ec4(0x155)+_0x599ec4(0x251)+_0x599ec4(0x248)+_0x599ec4(0xc4)+_0x599ec4(0xb2)+'fix');const _0x2b4f12=await runProcess(_0xa08646[_0x599ec4(0x95)+_0x599ec4(0x204)],[_0xa08646[_0x599ec4(0x1d4)+'Bin'],_0x599ec4(0x15a),_0x599ec4(0x12b)],{'cwd':_0xa08646[_0x599ec4(0x1d4)+_0x599ec4(0x157)+'ir'],'env':_0x116f58,'label':_0x599ec4(0x1d4)+_0x599ec4(0x135)+_0x599ec4(0x12b),'timeoutMs':0x1d4c0});_0x9d3eb1?.['info'](_0x599ec4(0x1d4)+'\x20doctor\x20'+_0x599ec4(0x142)+_0x599ec4(0x10a),{'fromVersion':_0x2f67ed,'toVersion':_0x39a2ba,'stdout':_0x2b4f12[_0x599ec4(0xb4)]['trim']()['slice'](-0xfa0),'stderr':_0x2b4f12['stderr'][_0x599ec4(0x253)]()[_0x599ec4(0x94)](-0xfa0)}),markerPath&&(await writeJson(markerPath,{'openclawVersion':_0xa08646[_0x599ec4(0x1d4)+'Version'],'fixedAt':new Date()[_0x599ec4(0x233)+'ing']()}),_0x9d3eb1?.[_0x599ec4(0x148)]('openclaw'+_0x599ec4(0x135)+_0x599ec4(0x24b)+_0x599ec4(0x104)+'en',{'markerPath':markerPath,'openclawVersion':_0xa08646['openclaw'+_0x599ec4(0x237)]}));}export async function readRuntimeManifest(_0x525901){return await readJson(resolveManifestPath(_0x525901),{});}export async function loadRuntimeInfo(_0x37a02f){const _0xe08c7d=resolveRuntimeRoot(_0x37a02f),_0x3a92ba=await readRuntimeManifest(_0xe08c7d);return createRuntimeInfoFromManifest(_0xe08c7d,_0x3a92ba);}function createRuntimeInfoFromManifest(_0x50dfd8,_0x5ec637,_0x35d871={}){const _0x40c4d5=_0x5ae80f;for(const _0x46a49f of[_0x40c4d5(0x95)+_0x40c4d5(0x204),_0x40c4d5(0xc2),_0x40c4d5(0x1d4)+_0x40c4d5(0x157)+'ir',_0x40c4d5(0x1d4)+'Bin']){if(typeof _0x5ec637[_0x46a49f]!=='string'||!_0x5ec637[_0x46a49f][_0x40c4d5(0x253)]())throw new Error('runtime\x20'+'manifest'+_0x40c4d5(0x1bb)+'ing\x20\x22'+_0x46a49f+_0x40c4d5(0x15b)+resolveManifestPath(_0x50dfd8)+(_0x40c4d5(0x193)+_0x40c4d5(0x1e1)+_0x40c4d5(0x86)+'e'));}const _0x169d51=resolve(_0x50dfd8,_0x5ec637[_0x40c4d5(0x95)+'utable']),_0x51bced=resolve(_0x50dfd8,_0x5ec637[_0x40c4d5(0xc2)]),_0x138f1e=resolve(_0x50dfd8,_0x5ec637[_0x40c4d5(0x1d4)+_0x40c4d5(0x157)+'ir']),_0x20a9a5=resolve(_0x50dfd8,_0x5ec637['openclaw'+'Bin']),_0x355aa1=Array[_0x40c4d5(0x7e)](_0x5ec637[_0x40c4d5(0x111)])?_0x5ec637[_0x40c4d5(0x111)]['map'](_0x3771a2=>({..._0x3771a2,'installPath':resolve(_0x50dfd8,_0x3771a2[_0x40c4d5(0x252)+'ath'])})):[],_0x2eb102=_0x35d871[_0x40c4d5(0x1c9)+'singOpen'+_0x40c4d5(0xb3)]?[_0x169d51,_0x51bced]:[_0x169d51,_0x51bced,_0x138f1e,_0x20a9a5];for(const _0x17b923 of _0x2eb102){if(!existsSync(_0x17b923))throw new Error(_0x40c4d5(0x136)+_0x40c4d5(0x1af)+_0x40c4d5(0x11a)+_0x17b923);}return{'runtimeRoot':_0x50dfd8,'manifest':_0x5ec637,'openclawVersion':_0x5ec637[_0x40c4d5(0x1d4)+_0x40c4d5(0x237)]||_0x40c4d5(0x234),'nodeExecutable':_0x169d51,'npmCli':_0x51bced,'openclawWorkingDir':_0x138f1e,'openclawBin':_0x20a9a5,'plugins':_0x355aa1};}function _0x458f(_0x521402,_0x23a86b){_0x521402=_0x521402-0x66;const _0x52fab1=_0x52fa();let _0x458f28=_0x52fab1[_0x521402];return _0x458f28;}export async function spawnClaw(_0x477872,_0x3440fb=[],_0x370008={}){const _0x24657d=_0x5ae80f,_0x2ef129=await loadRuntimeInfo(_0x477872),_0x1a7783=await createRuntimeEnv(_0x2ef129,_0x370008[_0x24657d(0x1d1)]??{});return spawn(_0x2ef129[_0x24657d(0x95)+_0x24657d(0x204)],[_0x2ef129[_0x24657d(0x1d4)+'Bin'],..._0x3440fb],{'cwd':_0x2ef129[_0x24657d(0x1d4)+_0x24657d(0x157)+'ir'],'stdio':_0x24657d(0x74),..._0x370008,'env':_0x1a7783});}export async function runClawOnce(_0x53a40f,_0x53615e=[],_0x4fc00c=0x15f90){const _0x42f0ef=await spawnClaw(_0x53a40f,_0x53615e);return await new Promise((_0x67c392,_0x3e047b)=>{const _0x239e5a=_0x458f;let _0x21d82e='',_0x347701='',_0x229e27=![];const _0x40f11a=setTimeout(()=>{const _0x3a0a52=_0x458f;if(_0x229e27)return;_0x229e27=!![],_0x42f0ef[_0x3a0a52(0x184)](_0x3a0a52(0x161)),_0x3e047b(new Error(_0x3a0a52(0x1d4)+'\x20timed\x20o'+_0x3a0a52(0x10d)+'\x20'+_0x4fc00c+'ms'));},_0x4fc00c);_0x42f0ef['stdout']['on']('data',_0x3a56b6=>{_0x21d82e+=_0x3a56b6['toString']();}),_0x42f0ef[_0x239e5a(0x116)]['on'](_0x239e5a(0x227),_0x1ebb19=>{const _0x2cf431=_0x239e5a;_0x347701+=_0x1ebb19[_0x2cf431(0x1b7)]();}),_0x42f0ef['on'](_0x239e5a(0x107),_0x102879=>{if(_0x229e27)return;_0x229e27=!![],clearTimeout(_0x40f11a),_0x3e047b(_0x102879);}),_0x42f0ef['on'](_0x239e5a(0x16a),(_0x451fe9,_0x476553)=>{if(_0x229e27)return;_0x229e27=!![],clearTimeout(_0x40f11a),_0x67c392({'code':_0x451fe9,'signal':_0x476553,'stdout':_0x21d82e,'stderr':_0x347701});});});}async function findRuntimeLarkCliBin(_0x34751c){const _0x2c02fa=_0x5ae80f,_0x45858b=join(_0x34751c[_0x2c02fa(0x1d4)+'WorkingD'+'ir'],_0x2c02fa(0x13b)+'ules',_0x2c02fa(0x138)+'te',_0x2c02fa(0xed)),_0x5ad4b4=join(_0x45858b,_0x2c02fa(0x89)+_0x2c02fa(0x8c));if(!existsSync(_0x5ad4b4))return{'packageDir':_0x45858b,'binPath':null};try{const _0x2ba9ed=JSON['parse'](await readFile(_0x5ad4b4,'utf8')),_0x544ed1=typeof _0x2ba9ed[_0x2c02fa(0x14b)]===_0x2c02fa(0x23c)?_0x2ba9ed[_0x2c02fa(0x14b)]:_0x2ba9ed[_0x2c02fa(0x14b)]&&typeof _0x2ba9ed['bin']===_0x2c02fa(0x76)?_0x2ba9ed['bin']['lark-cli']||Object['values'](_0x2ba9ed['bin'])[0x0]:'';return{'packageDir':_0x45858b,'binPath':_0x544ed1?join(_0x45858b,_0x544ed1):null};}catch{return{'packageDir':_0x45858b,'binPath':null};}}export async function resolveRuntimeLarkCliCommand(_0x6c5b9){const _0x298201=_0x5ae80f,{packageDir:_0xc0eb1a,binPath:_0x1b44fb}=await findRuntimeLarkCliBin(_0x6c5b9);if(!_0x1b44fb||!existsSync(_0x1b44fb))throw new Error('Bundled\x20'+_0x298201(0x138)+_0x298201(0x83)+_0x298201(0x1db)+_0x298201(0x20c)+_0x298201(0x1fd)+_0x298201(0x25c)+'\x20'+_0xc0eb1a+(_0x298201(0x1a4)+_0x298201(0x19c)+'ll\x20prepa'+_0x298201(0x1ae)+_0x298201(0x14e)+_0x298201(0xc1)+'me.'));return{'nodeExecutable':_0x6c5b9['nodeExec'+_0x298201(0x204)],'scriptPath':_0x1b44fb,'packageDir':_0xc0eb1a};}function resolvePackageNameFromNpmSpec(_0x232bc0){const _0x3e5980=_0x5ae80f,_0xb86209=_0x232bc0[_0x3e5980(0x253)]()[_0x3e5980(0x242)](/^npm:/,'');if(!_0xb86209)throw new Error(_0x3e5980(0x1c7)+'empty\x20pl'+'ugin\x20spe'+'c');if(_0xb86209[_0x3e5980(0x96)+'th']('@')){const _0x5ef422=_0xb86209[_0x3e5980(0x9b)]('/');if(_0x5ef422===-0x1)throw new Error(_0x3e5980(0x1c7)+'scoped\x20s'+_0x3e5980(0xe2)+_0x232bc0);const _0x198eb4=_0xb86209[_0x3e5980(0x9b)]('@',_0x5ef422+0x1);return _0x198eb4===-0x1?_0xb86209:_0xb86209['slice'](0x0,_0x198eb4);}const _0x2b8a9a=_0xb86209[_0x3e5980(0x9b)]('@');return _0x2b8a9a===-0x1?_0xb86209:_0xb86209['slice'](0x0,_0x2b8a9a);}async function createRuntimeEnv(_0x59af8a,_0x13e0df={}){const _0x9262=_0x5ae80f,_0x358519=process.env.OPENCLAW_STATE_DIR||'',_0x1597fe=process.env.NPM_CONFIG_REGISTRY||_0x9262(0x195)+_0x9262(0x17d)+'.npmmirr'+_0x9262(0x1f3),_0x178149=_0x358519?join(_0x358519,'claw-run'+_0x9262(0x12c)+'ls'):join(_0x59af8a['runtimeR'+_0x9262(0x19e)],'.tools'),_0x558346=join(_0x178149,_0x9262(0x22e)+'al'),_0x11cc5d=join(_0x178149,_0x9262(0x254)+'e'),_0x54347f=join(_0x558346,_0x9262(0x14b));await mkdir(_0x54347f,{'recursive':!![]}),await mkdir(_0x11cc5d,{'recursive':!![]});const _0x22d823=[_0x54347f,dirname(_0x59af8a['nodeExec'+_0x9262(0x204)]),process.env.PATH||''];return{...process.env,..._0x13e0df,'PATH':_0x22d823['filter'](Boolean)[_0x9262(0x18f)](delimiter),'npm_config_prefix':_0x558346,'NPM_CONFIG_PREFIX':_0x558346,'npm_config_cache':_0x11cc5d,'NPM_CONFIG_CACHE':_0x11cc5d,'NPM_CONFIG_REGISTRY':_0x1597fe,'npm_execpath':_0x59af8a[_0x9262(0xc2)],'npm_node_execpath':_0x59af8a[_0x9262(0x95)+'utable'],'OPENCLAW_RUNTIME_NPM_PREFIX':_0x558346,'OPENCLAW_RUNTIME_NPM_BIN':_0x54347f};}export async function getRuntimeSpawnContext(_0x247428,_0xe93f19={}){const _0x18a44a=_0x5ae80f,_0x5b8f69=await loadRuntimeInfo(_0x247428),_0xdb151=await createRuntimeEnv(_0x5b8f69,_0xe93f19);return{'cwd':_0x5b8f69[_0x18a44a(0x1d4)+_0x18a44a(0x157)+'ir'],'env':_0xdb151,'runtime':_0x5b8f69};}function resolvePluginDirNameFromSpec(_0x35ed64){const _0x5599e9=_0x5ae80f,_0x1d021c=resolvePackageNameFromNpmSpec(_0x35ed64),_0x4b4593=_0x1d021c[_0x5599e9(0x236)]('/')[_0x5599e9(0xdc)](Boolean),_0x13612d=_0x4b4593['at'](-0x1)??'';if(!_0x13612d)throw new Error(_0x5599e9(0x1c7)+_0x5599e9(0xb6)+'pec:\x20'+_0x35ed64);return _0x13612d;}async function resolvePluginIdFromPackageDir(_0x5c12cb,_0x54c97f){const _0x5a299f=_0x5ae80f,_0x4ef220=await readJson(join(_0x5c12cb,_0x5a299f(0x89)+_0x5a299f(0x8c)),{}),_0x404e84=await readPluginManifest(_0x5c12cb),_0x36e360=[_0x404e84?.['id'],_0x404e84?.['pluginId'],_0x404e84?.[_0x5a299f(0xb7)],_0x4ef220?.[_0x5a299f(0x1d4)]?.['id'],_0x4ef220?.[_0x5a299f(0x1d4)+'Id'],_0x54c97f],_0x87d775=_0x36e360[_0x5a299f(0x1ff)](_0x4c596f=>typeof _0x4c596f===_0x5a299f(0x23c)&&_0x4c596f[_0x5a299f(0x253)]());if(!_0x87d775)throw new Error(_0x5a299f(0x16b)+'o\x20resolv'+_0x5a299f(0x197)+_0x5a299f(0x1a2)+'\x20'+_0x5c12cb);return _0x87d775[_0x5a299f(0x253)]();}function pluginSpecMatches(_0x256ecc,_0x52bfae){const _0x7ff4bf=_0x5ae80f,_0x1f2f5f=_0x52bfae['trim'](),_0x5f0d40=resolvePackageNameFromNpmSpec(_0x1f2f5f);return[_0x256ecc[_0x7ff4bf(0x19f)],_0x256ecc[_0x7ff4bf(0x79)+_0x7ff4bf(0x205)],_0x256ecc['resolved'+_0x7ff4bf(0x182)]][_0x7ff4bf(0x1b1)](_0x3ed356=>_0x3ed356===_0x1f2f5f||_0x3ed356===_0x5f0d40);}async function installPluginFromNpmSpec(_0x11792c,_0x4f5984,_0x50492e={}){const _0x4df825=_0x5ae80f,_0x2ca9c0=_0x11792c[_0x4df825(0x253)]()['replace'](/^npm:/,''),_0x11f442=resolvePluginDirNameFromSpec(_0x2ca9c0),_0x372bad=join(_0x4f5984[_0x4df825(0x1d4)+_0x4df825(0x157)+'ir'],_0x4df825(0x229),_0x4df825(0x19a)+'ns'),_0x41f3c7=join(_0x372bad,_0x11f442),_0x5532dc=join(_0x4f5984['runtimeR'+'oot'],_0x4df825(0x1d7)+_0x4df825(0x101)+process[_0x4df825(0xdb)]+'-'+Date['now']()),_0x139964=await createRuntimeEnv(_0x4f5984),_0x3e08a6=new Date()['toISOStr'+'ing'](),_0x5286e0=join(_0x4f5984[_0x4df825(0xd7)+'oot'],_0x4df825(0x1f1));await mkdir(_0x5286e0,{'recursive':!![]}),await rm(_0x5532dc,{'recursive':!![],'force':!![]}),await rm(_0x41f3c7,{'recursive':!![],'force':!![]}),await mkdir(_0x5532dc,{'recursive':!![]}),await mkdir(_0x372bad,{'recursive':!![]}),console['log'](_0x4df825(0x7b)+_0x4df825(0x155)+'time]\x20fe'+'tching\x20p'+_0x4df825(0x238)+_0x2ca9c0);const _0x1227f4=await runProcess(_0x4f5984[_0x4df825(0x95)+'utable'],[_0x4f5984[_0x4df825(0xc2)],_0x4df825(0x1e4),_0x2ca9c0,'--json'],{'cwd':_0x5286e0,'env':_0x139964,'label':_0x4df825(0x117)+'\x20'+_0x2ca9c0}),_0x506eba=parseNpmPackJson(_0x1227f4[_0x4df825(0xb4)]),_0xec8daa=normalizePackedTarballFilename(_0x506eba[_0x4df825(0x196)]),_0x5d7219=join(_0x5286e0,_0xec8daa);if(!existsSync(_0x5d7219))throw new Error(_0x4df825(0x117)+_0x4df825(0x165)+_0x4df825(0xa7)+'tarball:'+'\x20'+_0x5d7219);await runProcess(_0x4df825(0x10b),[_0x4df825(0xe8),_0x5d7219,'-C',_0x5532dc],{'label':_0x4df825(0x1d2)+_0xec8daa}),await rename(join(_0x5532dc,_0x4df825(0x22b)),_0x41f3c7),await rm(_0x5532dc,{'recursive':!![],'force':!![]});const _0xbbf070=join(_0x41f3c7,_0x4df825(0x89)+_0x4df825(0x8c)),_0xfaebe8=await readJson(_0xbbf070,{});(_0xfaebe8[_0x4df825(0x71)+_0x4df825(0x18a)]||_0xfaebe8[_0x4df825(0xf8)])&&(delete _0xfaebe8['devDepen'+_0x4df825(0x18a)],delete _0xfaebe8[_0x4df825(0xf8)],await writeJson(_0xbbf070,_0xfaebe8));await runProcess(_0x4f5984[_0x4df825(0x95)+_0x4df825(0x204)],[_0x4f5984[_0x4df825(0xc2)],_0x4df825(0x1c6),_0x4df825(0x209)+'ev',_0x4df825(0x1f4)+_0x4df825(0x152),'--no-aud'+'it','--no-fun'+'d',_0x4df825(0x22f)+_0x4df825(0x219)+'ps'],{'cwd':_0x41f3c7,'env':_0x139964,'label':'npm\x20inst'+'all\x20plug'+_0x4df825(0xe5)+_0x2ca9c0});const _0x5105fc=new Date()[_0x4df825(0x233)+_0x4df825(0x14a)](),_0x1eaa4d=await resolvePluginIdFromPackageDir(_0x41f3c7,_0x506eba[_0x4df825(0xb7)]);return _0x50492e[_0x4df825(0xef)+'ogger']?.[_0x4df825(0x148)](_0x4df825(0x14d)+_0x4df825(0xfe)+_0x4df825(0x174),{'spec':_0x2ca9c0,'pluginId':_0x1eaa4d,'installPath':_0x41f3c7}),{'pluginId':_0x1eaa4d,'source':_0x4df825(0xa6),'spec':_0x2ca9c0,'installPath':toRuntimeRelative(_0x4f5984[_0x4df825(0xd7)+'oot'],_0x41f3c7),'version':_0x506eba['version'],'resolvedName':_0x506eba[_0x4df825(0xb7)],'resolvedVersion':_0x506eba[_0x4df825(0x1e9)],'resolvedSpec':_0x506eba[_0x4df825(0xb7)]+'@'+_0x506eba[_0x4df825(0x1e9)],'integrity':typeof _0x506eba[_0x4df825(0xcc)+'y']==='string'?_0x506eba[_0x4df825(0xcc)+'y']:'','shasum':typeof _0x506eba[_0x4df825(0x9a)]==='string'?_0x506eba[_0x4df825(0x9a)]:'','resolvedAt':_0x3e08a6,'installedAt':_0x5105fc};}async function syncConfiguredNpmPlugins(_0x4fb999,_0x5679f8,_0x315a69,_0x1ee923={}){const _0x3efcec=_0x5ae80f;if(_0x1ee923['syncOnly'])return;const _0x3099a7=createRuntimeInfoFromManifest(_0x5679f8,_0x315a69),_0x2ec156=Array['isArray'](_0x315a69[_0x3efcec(0x111)])?_0x315a69[_0x3efcec(0x111)]:[],_0x31a32d=[];for(const _0x47d485 of _0x4fb999[_0x3efcec(0x1d4)][_0x3efcec(0x98)+_0x3efcec(0x20d)]){const _0x40f312=_0x2ec156[_0x3efcec(0x1ff)](_0x12e337=>_0x12e337?.['source']==='npm'&&pluginSpecMatches(_0x12e337,_0x47d485)&&typeof _0x12e337['installP'+_0x3efcec(0x102)]===_0x3efcec(0x23c)&&existsSync(resolve(_0x5679f8,_0x12e337[_0x3efcec(0x252)+'ath'])));if(_0x40f312){_0x31a32d[_0x3efcec(0xf1)](_0x40f312);continue;}_0x31a32d[_0x3efcec(0xf1)](await installPluginFromNpmSpec(_0x47d485,_0x3099a7,_0x1ee923));}const _0x8b8076=new Set(_0x4fb999[_0x3efcec(0x1d4)][_0x3efcec(0x98)+_0x3efcec(0x20d)]['map'](resolvePackageNameFromNpmSpec)),_0x23829a=_0x2ec156['filter'](_0x1d6e13=>_0x1d6e13?.[_0x3efcec(0x150)]!=='npm'||!_0x8b8076[_0x3efcec(0x17b)](resolvePackageNameFromNpmSpec(_0x1d6e13[_0x3efcec(0x79)+'Name']||_0x1d6e13[_0x3efcec(0x19f)]||'')));_0x315a69['plugins']=[..._0x23829a,..._0x31a32d];}function hasRuntimeDependencies(_0x2b4f47){const _0x58e657=_0x5ae80f,_0x3073da=_0x2b4f47?.[_0x58e657(0xb8)+'cies']&&typeof _0x2b4f47[_0x58e657(0xb8)+_0x58e657(0x1dd)]===_0x58e657(0x76)?Object['keys'](_0x2b4f47[_0x58e657(0xb8)+_0x58e657(0x1dd)]):[],_0x221de7=_0x2b4f47?.[_0x58e657(0x199)+_0x58e657(0x100)+'cies']&&typeof _0x2b4f47[_0x58e657(0x199)+_0x58e657(0x100)+_0x58e657(0x1dd)]==='object'?Object[_0x58e657(0x21b)](_0x2b4f47['optional'+'Dependen'+_0x58e657(0x1dd)]):[];return _0x3073da[_0x58e657(0x171)]>0x0||_0x221de7[_0x58e657(0x171)]>0x0;}async function installLocalPluginRuntimeDependencies(_0x397ea3,_0x898396,_0x45731a){const _0xfb6558=_0x5ae80f,_0x54b4c8=join(_0x397ea3,_0xfb6558(0x89)+_0xfb6558(0x8c)),_0x114c1e=await readJson(_0x54b4c8,{});(_0x114c1e[_0xfb6558(0x71)+_0xfb6558(0x18a)]||_0x114c1e[_0xfb6558(0xf8)])&&(delete _0x114c1e[_0xfb6558(0x71)+_0xfb6558(0x18a)],delete _0x114c1e[_0xfb6558(0xf8)],await writeJson(_0x54b4c8,_0x114c1e));if(!hasRuntimeDependencies(_0x114c1e))return;const _0x525279=await createRuntimeEnv(_0x898396);console[_0xfb6558(0x1c1)](_0xfb6558(0x7b)+_0xfb6558(0x155)+_0xfb6558(0x1f2)+_0xfb6558(0xf0)+'\x20local\x20p'+'lugin\x20de'+_0xfb6558(0x235)+_0xfb6558(0x110)+_0x397ea3),await runProcess(_0x898396['nodeExec'+_0xfb6558(0x204)],[_0x898396[_0xfb6558(0xc2)],'install',_0xfb6558(0x209)+'ev','--omit=p'+_0xfb6558(0x152),_0xfb6558(0xea)+'it',_0xfb6558(0x8e)+'d',_0xfb6558(0x22f)+_0xfb6558(0x219)+'ps'],{'cwd':_0x397ea3,'env':_0x525279,'label':_0xfb6558(0x124)+_0xfb6558(0xd0)+'l\x20plugin'+'\x20'+_0x397ea3}),_0x45731a[_0xfb6558(0xef)+_0xfb6558(0x11e)]?.[_0xfb6558(0x148)](_0xfb6558(0x6f)+_0xfb6558(0x203)+_0xfb6558(0x14c)+_0xfb6558(0x1b0)+_0xfb6558(0x176),{'installPath':_0x397ea3});}async function syncSharedPluginModules(_0x3456ef,_0xa69587){const _0x28abcb=_0x5ae80f,_0x13af27=new Set();for(const _0x4c8b6e of _0x3456ef){const _0x30ea99=join(dirname(_0x4c8b6e),_0x28abcb(0xff));if(existsSync(_0x30ea99))_0x13af27[_0x28abcb(0xba)](_0x30ea99);}for(const _0x31350a of _0x13af27){await copyDirFresh(_0x31350a,join(_0xa69587,_0x28abcb(0xff)));}}async function syncProductPlugins(_0x2622f3,_0x473253,_0x3a12b6,_0x164411={}){const _0x45fd75=_0x5ae80f,_0x449d09=join(_0x473253,'openclaw',_0x45fd75(0x229),_0x45fd75(0x19a)+'ns'),_0x2e639d=createRuntimeInfoFromManifest(_0x473253,_0x3a12b6),_0x2f01e6=[];await syncSharedPluginModules(_0x2622f3[_0x45fd75(0x1d4)][_0x45fd75(0x79)+_0x45fd75(0xc3)+_0x45fd75(0x130)],_0x449d09);for(const _0x2b7da3 of _0x2622f3[_0x45fd75(0x1d4)]['resolved'+_0x45fd75(0xc3)+_0x45fd75(0x130)]){const _0x2ed210=await getPackageMetadata(_0x2b7da3),_0x3c946c=await readPluginManifest(_0x2b7da3),_0x338126=join(_0x449d09,_0x2ed210['pluginId']);await copyDirFresh(_0x2b7da3,_0x338126),await installLocalPluginRuntimeDependencies(_0x338126,_0x2e639d,_0x164411),_0x2f01e6[_0x45fd75(0xf1)]({'pluginId':_0x2ed210[_0x45fd75(0x1f6)],'source':'local','spec':_0x45fd75(0x1d3)+_0x2b7da3,'installPath':toRuntimeRelative(_0x473253,_0x338126),'version':_0x2ed210[_0x45fd75(0x1e9)],'resolvedName':_0x2ed210[_0x45fd75(0xb7)],'resolvedVersion':_0x2ed210['version'],'resolvedSpec':'local:'+_0x2b7da3,'integrity':'','shasum':'','resolvedAt':new Date()['toISOStr'+_0x45fd75(0x14a)](),'installedAt':new Date()[_0x45fd75(0x233)+_0x45fd75(0x14a)](),'agentScope':_0x3c946c[_0x45fd75(0x24a)+'pe'],'skills':_0x3c946c[_0x45fd75(0x215)]});}const _0x1b4d91=new Set(_0x2f01e6['map'](_0x407581=>_0x407581[_0x45fd75(0x1f6)])),_0x33b774=Array[_0x45fd75(0x7e)](_0x3a12b6[_0x45fd75(0x111)])?_0x3a12b6['plugins'][_0x45fd75(0xdc)](_0x2bfc1d=>!_0x1b4d91[_0x45fd75(0x17b)](_0x2bfc1d[_0x45fd75(0x1f6)])):[];_0x3a12b6[_0x45fd75(0x111)]=[..._0x33b774,..._0x2f01e6];}async function syncManifestPluginScope(_0x12e8c6,_0x10d061,_0x111563){const _0x37e957=_0x5ae80f,_0x358a56=join(_0x10d061,_0x37e957(0x1d4),_0x37e957(0x229),_0x37e957(0x19a)+'ns'),_0x5e8e58=new Set(_0x12e8c6['openclaw'][_0x37e957(0x98)+_0x37e957(0x20d)]??[]),_0x3745aa=new Set([..._0x5e8e58][_0x37e957(0x1a8)](_0x24147b=>_0x24147b[_0x37e957(0x242)](/^npm:/,''))['map'](_0x7be7a8=>{const _0xbec0c5=_0x37e957;if(_0x7be7a8[_0xbec0c5(0x96)+'th']('@')){const _0x4dd0ca=_0x7be7a8[_0xbec0c5(0x236)]('@');return _0x4dd0ca[_0xbec0c5(0x171)]>=0x3?'@'+_0x4dd0ca[0x1]:_0x7be7a8;}return _0x7be7a8[_0xbec0c5(0x236)]('@')[0x0];})[_0x37e957(0xdc)](Boolean)),_0x3c95a7=new Set();for(const _0xa15abc of _0x12e8c6['openclaw'][_0x37e957(0x79)+_0x37e957(0xc3)+_0x37e957(0x130)]){const _0x5bb409=await getPackageMetadata(_0xa15abc);if(_0x5bb409[_0x37e957(0x1f6)])_0x3c95a7[_0x37e957(0xba)](_0x5bb409['pluginId']);}const _0x421bdb=Array[_0x37e957(0x7e)](_0x111563[_0x37e957(0x111)])?_0x111563[_0x37e957(0x111)]:[];_0x111563['pluginSp'+_0x37e957(0x20d)]=[..._0x12e8c6[_0x37e957(0x1d4)][_0x37e957(0x98)+_0x37e957(0x20d)],..._0x12e8c6[_0x37e957(0x1d4)][_0x37e957(0x79)+_0x37e957(0xc3)+_0x37e957(0x130)]['map'](_0x50b0d8=>'local:'+_0x50b0d8)],_0x111563[_0x37e957(0x111)]=_0x421bdb[_0x37e957(0xdc)](_0xd056dc=>{const _0x4c7c5a=_0x37e957;if(!_0xd056dc||typeof _0xd056dc!==_0x4c7c5a(0x76))return![];if(_0xd056dc['source']===_0x4c7c5a(0x1d8))return _0x3c95a7[_0x4c7c5a(0x17b)](_0xd056dc['pluginId']);if(_0xd056dc[_0x4c7c5a(0x150)]==='npm')return _0x5e8e58['has'](_0xd056dc['spec'])||_0x5e8e58[_0x4c7c5a(0x17b)](_0xd056dc[_0x4c7c5a(0x79)+'Spec'])||_0x3745aa[_0x4c7c5a(0x17b)](_0xd056dc[_0x4c7c5a(0x79)+_0x4c7c5a(0x182)]);return![];});const _0x1a393a=new Set(_0x111563[_0x37e957(0x111)][_0x37e957(0x1a8)](_0xcd4e3=>_0xcd4e3[_0x37e957(0x1f6)]));for(const _0x17b446 of _0x421bdb){if(!_0x17b446[_0x37e957(0x1f6)]||_0x1a393a[_0x37e957(0x17b)](_0x17b446[_0x37e957(0x1f6)]))continue;const _0x444d45=typeof _0x17b446[_0x37e957(0x252)+_0x37e957(0x102)]===_0x37e957(0x23c)&&_0x17b446[_0x37e957(0x252)+_0x37e957(0x102)]['trim']()?resolve(_0x10d061,_0x17b446[_0x37e957(0x252)+'ath']):join(_0x358a56,_0x17b446[_0x37e957(0x1f6)]),_0x5ba1b9=relative(_0x358a56,_0x444d45);if(_0x5ba1b9['startsWi'+'th']('..')||_0x5ba1b9==='')continue;await rm(_0x444d45,{'recursive':!![],'force':!![]});}}async function collectCapabilityEntries(_0xf1a8ec,_0x2a9e17){const _0x35abc7=_0x5ae80f,_0x27dd18=new Map();for(const _0x4d7875 of _0xf1a8ec){let _0x41b643;try{_0x41b643=await stat(_0x4d7875);}catch{throw new Error(_0x2a9e17+(_0x35abc7(0x162)+_0x35abc7(0x169)+_0x35abc7(0x23e))+_0x4d7875);}if(!_0x41b643[_0x35abc7(0xcf)+_0x35abc7(0x1dc)]())throw new Error(_0x2a9e17+(_0x35abc7(0xa8)+_0x35abc7(0x20f)+_0x35abc7(0x122)+_0x35abc7(0x119))+_0x4d7875);const _0x329eaa={'name':basename(_0x4d7875),'path':_0x4d7875},_0x167421=_0x27dd18['get'](_0x329eaa[_0x35abc7(0xb7)]);if(_0x167421)throw new Error(_0x35abc7(0x191)+'e\x20'+_0x2a9e17+_0x35abc7(0x1a0)+_0x329eaa['name']+_0x35abc7(0x185)+_0x167421['path']+'\x20and\x20'+_0x329eaa['path']);_0x27dd18[_0x35abc7(0x145)](_0x329eaa[_0x35abc7(0xb7)],_0x329eaa);}return[..._0x27dd18[_0x35abc7(0xbe)]()];}async function syncProductCapabilityDirs(_0x2bb91f,_0x5dadcb,_0x6824fb){const _0x4d2789=_0x5ae80f,_0xd86e2=await collectCapabilityEntries(_0x2bb91f,_0x6824fb);await rm(_0x5dadcb,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await mkdir(_0x5dadcb,{'recursive':!![]});for(const _0x3b0748 of _0xd86e2){await cp(_0x3b0748[_0x4d2789(0xa1)],join(_0x5dadcb,_0x3b0748['name']),{'recursive':!![]});}return _0xd86e2[_0x4d2789(0x171)];}export const __test__={'collectCapabilityEntries':collectCapabilityEntries,'syncProductCapabilityDirs':syncProductCapabilityDirs};async function syncProductAgents(_0x592068,_0x219511,_0x4bcb3f){const _0x38c9cf=_0x5ae80f,_0x4de18c=join(_0x219511,_0x38c9cf(0x1d4),_0x38c9cf(0x178)),_0xe20649=await syncProductCapabilityDirs(_0x592068[_0x38c9cf(0x1d4)]['resolved'+_0x38c9cf(0xda)+_0x38c9cf(0x226)],_0x4de18c,'agent');_0x4bcb3f[_0x38c9cf(0x178)]={'source':'product','installPath':toRuntimeRelative(_0x219511,_0x4de18c),'localPaths':_0x592068[_0x38c9cf(0x1d4)]['resolved'+'LocalAge'+_0x38c9cf(0x226)],'entryCount':_0xe20649};}async function syncProductSkills(_0x26fb26,_0x5d6ba9,_0x317f41){const _0x543522=_0x5ae80f,_0xc3ee49=join(_0x5d6ba9,_0x543522(0x1d4),_0x543522(0x215)),_0x522ada=await syncProductCapabilityDirs(_0x26fb26[_0x543522(0x1d4)][_0x543522(0x79)+_0x543522(0x10e)+'llPaths'],_0xc3ee49,_0x543522(0xfa));_0x317f41['skills']={'source':_0x543522(0x1df),'installPath':toRuntimeRelative(_0x5d6ba9,_0xc3ee49),'localPaths':_0x26fb26['openclaw'][_0x543522(0x79)+_0x543522(0x10e)+_0x543522(0xf7)],'entryCount':_0x522ada};}
|
|
1
|
+
const _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 +1 @@
|
|
|
1
|
-
function _0x4d62(){const _0x1eb431=['558936XjQCkL','()(optio','Channel.','ntime\x20=\x20','1490280xKqjns','111182jeXnEn','YS);','\x09};','replace','ntime.ch','97507nzbkRc','patched','nst\x20exis','imeRefle','ntime;\x0a\x09','Channel(','const\x20re','return\x20r','ctionKey','n\x20&&\x20run','om\x20\x22node','ssion\x20??','imeChann','runtime-','eateRunt','runtime.','channel-','\x09\x09\x09if\x20(r','inRuntim','hannelIm','ect\x22\x20?\x20r','ntime.in','e\x20!==\x20\x22o','time\x20=\x20(','runtime\x20','istingCh','el\x20}\x20fro','===\x20\x22obj','ound\x20??\x20','nbound:\x20','annel\x20&&','ns));\x0a\x09\x09','89556pmSanA','elpers(r','rn\x20runti','ntexts:\x20','untime;\x0a','meChanne','l,\x0a\x09\x09\x09\x09r','\x20{};\x0a\x09\x09\x09','eContext','\x0a\x09\x09};\x0a','e\x20??=\x20en','elRuntim','channelR','ontexts\x20','indexOf','null;','nel\x20=\x20ru','untime.t','7XJbzam','bound,\x0a\x09','ime\x20=\x20wu','existing','sureWuji','urn\x20??\x20c','eturn\x20re','f\x20runtim','||\x20typeo','ME_REFLE','..existi','nnel?.in','solvedRu','eChannel','hannel\x20:','hannelRu','runtime;','elpers\x20=','imePromi','e.inboun','\x0a\x09\x09\x09\x09ses','ngChanne','nnel.inb','turn:\x20ex','\x09\x09\x09};\x0a\x09\x09','lazyRunt','RuntimeH','annel.se','un)\x20retu','sion:\x20ex','\x09\x09const\x20','imeOptio','l.reply\x20','e)\x20=>\x20{\x0a','ons.runt',');\x0a\x09\x09\x09co','edRuntim','n\x20??\x20exi','import\x20{','annel.tu','e()(opti','\x09\x09let\x20re','wujieCre','meOption','\x20channel','ateRunti','ns.runti','const\x20en','ot-provi',')\x20=>\x20{\x0a\x09','\x09\x09resolv','Runtime.','20DmPuOo','e.runtim','hannel?.','\x09return\x20','onst\x20cha','rn\x20??','resolved','CTION_KE','bound?.r','\x09\x09\x09if\x20(!','\x0a\x09\x09};\x0a\x09\x09','ded','jieCreat','nnel.tur','\x20typeof\x20','stingCha','me;\x0a\x09\x09\x09c','slice','channel\x20','solveCre','eRuntime','=\x20{\x0a\x09\x09\x09\x09','time.cha','session\x0a','1978182qmWkJi','null;\x0a\x09\x09','Runtime;','solveRun','ZY_RUNTI','d,\x0a\x09\x09\x09\x09t','e\x20??=\x20re','e.reply,','not-foun','277158QjBpos','nnelRunt','urn:\x20exi','s,\x0a\x09\x09\x09\x09i','eatePlug','portPath','runtimeC','e,\x0a\x09\x09\x09\x09.','annel\x20as','import-n','??\x20chann','ot-found','includes','test','...chann','\x20(runtim','untimeCh','bject\x22)\x20','untime.c','ash\x20}\x20fr','turn?.ru','\x20createR','\x20createH',':crypto\x22','s);\x0a\x09\x09\x09r','\x20wujieCr','esolveCr'];_0x4d62=function(){return _0x1eb431;};return _0x4d62();}(function(_0x41a349,_0x25eb51){const _0x2b72e2=_0x4155,_0x336242=_0x41a349();while(!![]){try{const _0x30de08=parseInt(_0x2b72e2(0x27a))/0x1+parseInt(_0x2b72e2(0x275))/0x2+parseInt(_0x2b72e2(0x1ee))/0x3+parseInt(_0x2b72e2(0x270))/0x4+parseInt(_0x2b72e2(0x234))/0x5*(parseInt(_0x2b72e2(0x255))/0x6)+-parseInt(_0x2b72e2(0x200))/0x7*(parseInt(_0x2b72e2(0x274))/0x8)+-parseInt(_0x2b72e2(0x24c))/0x9;if(_0x30de08===_0x25eb51)break;else _0x336242['push'](_0x336242['shift']());}catch(_0x3901ef){_0x336242['push'](_0x336242['shift']());}}}(_0x4d62,0x18bfd));function _0x4155(_0x251677,_0x540f6){_0x251677=_0x251677-0x1de;const _0x4d62f2=_0x4d62();let _0x415553=_0x4d62f2[_0x251677];return _0x415553;}export function patchChannelPluginRuntimeFromSource(_0x4e3439,_0x194624={}){const _0x586550=_0x4155,_0x307643=_0x194624['runtimeC'+_0x586550(0x1e1)+_0x586550(0x25a)];if(!_0x307643)return{'patched':![],'reason':_0x586550(0x287)+_0x586550(0x1de)+_0x586550(0x25e)+_0x586550(0x230)+_0x586550(0x23f)};if(_0x4e3439[_0x586550(0x261)](_0x586550(0x22a)+_0x586550(0x22d)+_0x586550(0x1f3)+'l')){if(_0x4e3439[_0x586550(0x261)](_0x586550(0x217)+'istingCh'+_0x586550(0x227)+_0x586550(0x239))&&hasRuntimeChannelImport(_0x4e3439,_0x307643))return{'patched':![],'reason':'already-'+_0x586550(0x27b)};return patchExistingChannelPluginRuntimeFromSource(_0x4e3439,{'runtimeChannelImportPath':_0x307643});}if(_0x4e3439[_0x586550(0x261)]('wujieCha'+_0x586550(0x256)+_0x586550(0x212)+'se'))return patchExistingChannelPluginRuntimeFromSource(_0x4e3439,{'runtimeChannelImportPath':_0x307643});const _0x24f80b='\x09\x09let\x20re'+_0x586550(0x20c)+_0x586550(0x273)+_0x586550(0x24d)+_0x586550(0x280)+_0x586550(0x24f)+_0x586550(0x1e5)+_0x586550(0x231)+_0x586550(0x232)+_0x586550(0x224)+_0x586550(0x252)+_0x586550(0x247)+'atePlugi'+'nRuntime'+_0x586550(0x271)+_0x586550(0x22e)+_0x586550(0x22b)+_0x586550(0x26d)+_0x586550(0x206)+'solvedRu'+_0x586550(0x27e)+_0x586550(0x277);if(!_0x4e3439[_0x586550(0x261)](_0x24f80b))return{'patched':![],'reason':_0x586550(0x254)+'d'};const _0x141069=_0x586550(0x226)+_0x586550(0x26b)+'ash\x20}\x20fr'+'om\x20\x22node'+':crypto\x22'+';';if(!_0x4e3439[_0x586550(0x261)](_0x141069))return{'patched':![],'reason':_0x586550(0x25e)+'ot-found'};const _0x30dab8=_0x586550(0x229)+_0x586550(0x20c)+_0x586550(0x273)+_0x586550(0x24d)+_0x586550(0x22f)+_0x586550(0x204)+_0x586550(0x20d)+_0x586550(0x21a)+_0x586550(0x211)+'\x20(runtim'+_0x586550(0x221)+_0x586550(0x23d)+_0x586550(0x1e6)+_0x586550(0x208)+_0x586550(0x207)+_0x586550(0x1e4)+_0x586550(0x266)+'return\x20r'+_0x586550(0x1f2)+_0x586550(0x1df)+_0x586550(0x267)+_0x586550(0x236)+_0x586550(0x269)+'n\x20&&\x20run'+_0x586550(0x24a)+_0x586550(0x20b)+'bound?.r'+_0x586550(0x21c)+_0x586550(0x1f0)+_0x586550(0x244)+_0x586550(0x238)+_0x586550(0x256)+_0x586550(0x202)+_0x586550(0x240)+'eRuntime'+_0x586550(0x27f)+');\x0a\x09\x09\x09co'+'nst\x20exis'+'tingChan'+_0x586550(0x1fe)+_0x586550(0x279)+_0x586550(0x1ec)+_0x586550(0x242)+_0x586550(0x289)+'channel\x20'+_0x586550(0x1e9)+_0x586550(0x1e2)+_0x586550(0x267)+'hannel\x20:'+_0x586550(0x1f5)+_0x586550(0x289)+_0x586550(0x246)+_0x586550(0x249)+_0x586550(0x263)+_0x586550(0x1f9)+_0x586550(0x25c)+_0x586550(0x20a)+_0x586550(0x215)+_0x586550(0x1f4)+'untimeCo'+'ntexts:\x20'+_0x586550(0x203)+'Channel.'+_0x586550(0x25b)+_0x586550(0x1fb)+_0x586550(0x25f)+_0x586550(0x1f9)+_0x586550(0x235)+_0x586550(0x1f6)+'s,\x0a\x09\x09\x09\x09i'+_0x586550(0x1eb)+_0x586550(0x203)+'Channel.'+'inbound\x20'+_0x586550(0x25f)+_0x586550(0x1f9)+_0x586550(0x213)+_0x586550(0x251)+_0x586550(0x257)+'stingCha'+_0x586550(0x241)+_0x586550(0x225)+_0x586550(0x243)+_0x586550(0x216)+_0x586550(0x1ea)+_0x586550(0x1fa)+_0x586550(0x1ff)+_0x586550(0x205)+_0x586550(0x20f)+_0x586550(0x1e3)+_0x586550(0x201)+'\x09\x09\x09reply'+':\x20existi'+_0x586550(0x215)+_0x586550(0x220)+_0x586550(0x25f)+'elRuntim'+_0x586550(0x253)+_0x586550(0x214)+_0x586550(0x21d)+_0x586550(0x1e7)+_0x586550(0x21b)+'ssion\x20??'+_0x586550(0x22c)+'Runtime.'+'session\x0a'+_0x586550(0x218)+_0x586550(0x237)+_0x586550(0x210)+_0x586550(0x23e)+_0x586550(0x280)+_0x586550(0x24f)+_0x586550(0x1e5)+_0x586550(0x231)+_0x586550(0x232)+_0x586550(0x224)+_0x586550(0x1f8)+_0x586550(0x204)+_0x586550(0x20d)+_0x586550(0x21a)+'elpers(r'+_0x586550(0x26f)+'eatePlug'+_0x586550(0x1e0)+'e()(opti'+('ons.runt'+_0x586550(0x21f)+_0x586550(0x1ed)+_0x586550(0x237)+_0x586550(0x23a)+_0x586550(0x24e)+'\x0a\x09\x09};');return{'patched':!![],'source':_0x4e3439[_0x586550(0x278)](_0x141069,_0x141069+'\x0a'+createRuntimeChannelImport(_0x307643))[_0x586550(0x278)](_0x24f80b,_0x30dab8)};}function patchExistingChannelPluginRuntimeFromSource(_0x5c0f2a,_0x4be685){const _0x23d937=_0x4155,{runtimeChannelImportPath:_0x1865e8}=_0x4be685,_0x18e1f3='import\x20{'+_0x23d937(0x26b)+_0x23d937(0x268)+_0x23d937(0x284)+_0x23d937(0x26c)+';';if(!_0x5c0f2a[_0x23d937(0x261)](_0x18e1f3))return{'patched':![],'reason':_0x23d937(0x25e)+_0x23d937(0x260)};const _0x3a815b='\x09\x09let\x20re'+'solvedRu'+'ntime\x20=\x20'+_0x23d937(0x1fd),_0x1af79a=_0x23d937(0x21e)+_0x23d937(0x219)+_0x23d937(0x27d)+_0x23d937(0x282)+'Set\x20=\x20ne'+'w\x20Set(LA'+_0x23d937(0x250)+_0x23d937(0x209)+_0x23d937(0x23b)+_0x23d937(0x276),_0x36a17d=_0x5c0f2a[_0x23d937(0x1fc)](_0x3a815b),_0x3706ef=_0x5c0f2a[_0x23d937(0x1fc)](_0x1af79a,_0x36a17d);if(_0x36a17d===-0x1||_0x3706ef===-0x1)return{'patched':![],'reason':_0x23d937(0x254)+'d'};const _0x55c2b2=_0x23d937(0x229)+_0x23d937(0x20c)+_0x23d937(0x273)+_0x23d937(0x24d)+_0x23d937(0x22f)+_0x23d937(0x204)+'eChannel'+_0x23d937(0x21a)+_0x23d937(0x211)+_0x23d937(0x264)+'e)\x20=>\x20{\x0a'+_0x23d937(0x23d)+_0x23d937(0x1e6)+_0x23d937(0x208)+_0x23d937(0x207)+_0x23d937(0x1e4)+'bject\x22)\x20'+_0x23d937(0x281)+_0x23d937(0x1f2)+_0x23d937(0x1df)+_0x23d937(0x267)+_0x23d937(0x236)+_0x23d937(0x269)+_0x23d937(0x283)+_0x23d937(0x24a)+_0x23d937(0x20b)+_0x23d937(0x23c)+_0x23d937(0x21c)+_0x23d937(0x1f0)+'me;\x0a\x09\x09\x09c'+'onst\x20cha'+_0x23d937(0x256)+_0x23d937(0x202)+_0x23d937(0x240)+_0x23d937(0x248)+_0x23d937(0x27f)+_0x23d937(0x223)+_0x23d937(0x27c)+'tingChan'+'nel\x20=\x20ru'+_0x23d937(0x279)+'annel\x20&&'+'\x20typeof\x20'+_0x23d937(0x289)+_0x23d937(0x246)+'===\x20\x22obj'+_0x23d937(0x1e2)+_0x23d937(0x267)+_0x23d937(0x20e)+'\x20{};\x0a\x09\x09\x09'+_0x23d937(0x289)+_0x23d937(0x246)+_0x23d937(0x249)+_0x23d937(0x263)+_0x23d937(0x1f9)+_0x23d937(0x25c)+'..existi'+'ngChanne'+'l,\x0a\x09\x09\x09\x09r'+'untimeCo'+_0x23d937(0x1f1)+_0x23d937(0x203)+_0x23d937(0x272)+_0x23d937(0x25b)+_0x23d937(0x1fb)+_0x23d937(0x25f)+_0x23d937(0x1f9)+_0x23d937(0x235)+'eContext'+_0x23d937(0x258)+_0x23d937(0x1eb)+_0x23d937(0x203)+_0x23d937(0x272)+'inbound\x20'+_0x23d937(0x25f)+_0x23d937(0x1f9)+'e.inboun'+_0x23d937(0x251)+_0x23d937(0x257)+'stingCha'+_0x23d937(0x241)+_0x23d937(0x225)+'stingCha'+_0x23d937(0x216)+_0x23d937(0x1ea)+_0x23d937(0x1fa)+_0x23d937(0x1ff)+_0x23d937(0x205)+_0x23d937(0x20f)+'ntime.in'+'bound,\x0a\x09'+'\x09\x09\x09reply'+':\x20existi'+_0x23d937(0x215)+_0x23d937(0x220)+'??\x20chann'+_0x23d937(0x1f9)+_0x23d937(0x253)+_0x23d937(0x214)+_0x23d937(0x21d)+_0x23d937(0x1e7)+_0x23d937(0x21b)+_0x23d937(0x285)+_0x23d937(0x22c)+_0x23d937(0x233)+_0x23d937(0x24b)+'\x09\x09\x09};\x0a\x09\x09'+_0x23d937(0x237)+_0x23d937(0x210)+_0x23d937(0x23e)+_0x23d937(0x280)+'solveRun'+_0x23d937(0x1e5)+_0x23d937(0x231)+_0x23d937(0x232)+_0x23d937(0x224)+'e\x20??=\x20en'+'sureWuji'+_0x23d937(0x20d)+_0x23d937(0x21a)+_0x23d937(0x1ef)+_0x23d937(0x26f)+_0x23d937(0x259)+'inRuntim'+_0x23d937(0x228)+(_0x23d937(0x222)+_0x23d937(0x21f)+_0x23d937(0x1ed)+_0x23d937(0x237)+'resolved'+'Runtime;'+_0x23d937(0x1f7)),_0x4242d8=_0x5c0f2a['slice'](0x0,_0x36a17d)+_0x55c2b2+_0x5c0f2a[_0x23d937(0x245)](_0x3706ef);return{'patched':!![],'source':ensureRuntimeChannelImport(_0x4242d8,{'importMarker':_0x18e1f3,'runtimeChannelImportPath':_0x1865e8})};}function createRuntimeChannelImport(_0x11ed16){const _0x32259a=_0x4155;return'import\x20{'+_0x32259a(0x26a)+_0x32259a(0x265)+_0x32259a(0x25d)+_0x32259a(0x26e)+_0x32259a(0x288)+_0x32259a(0x286)+_0x32259a(0x1e8)+'m\x20\x22'+_0x11ed16+'\x22;';}function hasRuntimeChannelImport(_0x153cb9,_0x3c6a2b){const _0x23cf7b=_0x4155;return _0x153cb9[_0x23cf7b(0x261)](createRuntimeChannelImport(_0x3c6a2b));}function ensureRuntimeChannelImport(_0x476b73,{importMarker:_0x4dc3ab,runtimeChannelImportPath:_0x401839}){const _0x28c5e7=_0x4155,_0x416928=createRuntimeChannelImport(_0x401839),_0x5ba723=/import \{ createRuntimeChannel as wujieCreateRuntimeChannel \} from "\.\/runtime-channel-[^"]+\.js";\n?/;if(_0x5ba723[_0x28c5e7(0x262)](_0x476b73))return _0x476b73[_0x28c5e7(0x278)](_0x5ba723,_0x416928+'\x0a');return _0x476b73['replace'](_0x4dc3ab,_0x4dc3ab+'\x0a'+_0x416928);}
|
|
1
|
+
function _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);}
|