@wujie-shell/core 4.0.0 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/bin/wujie-shell.mjs +1 -1
  2. package/dist/src/agents/bundled-agent-skills.mjs +1 -1
  3. package/dist/src/agents/bundled-agents.mjs +1 -1
  4. package/dist/src/chat/media-archive.mjs +1 -1
  5. package/dist/src/chat/queue.mjs +1 -1
  6. package/dist/src/common/diagnostics.mjs +1 -1
  7. package/dist/src/common/logging.mjs +1 -1
  8. package/dist/src/common/runtime-logger.mjs +1 -1
  9. package/dist/src/common/user-events.mjs +1 -1
  10. package/dist/src/common/utils.mjs +1 -1
  11. package/dist/src/config/controller.mjs +1 -1
  12. package/dist/src/connectors/config-utils.mjs +1 -1
  13. package/dist/src/connectors/constants.mjs +1 -1
  14. package/dist/src/connectors/controller.mjs +1 -1
  15. package/dist/src/connectors/kdocs-cli.mjs +1 -1
  16. package/dist/src/electron/main.mjs +1 -1
  17. package/dist/src/electron/preload.mjs +1 -1
  18. package/dist/src/files/generated-files-store.mjs +1 -1
  19. package/dist/src/files/handlers.mjs +1 -1
  20. package/dist/src/gateway/chat-delta.mjs +1 -1
  21. package/dist/src/gateway/controller.mjs +1 -1
  22. package/dist/src/gateway/ws-client.mjs +1 -1
  23. package/dist/src/index.mjs +1 -1
  24. package/dist/src/log-reporting/handlers.mjs +1 -1
  25. package/dist/src/log-reporting/report-logs.mjs +1 -1
  26. package/dist/src/models/handlers.mjs +1 -1
  27. package/dist/src/preferences/store.mjs +1 -1
  28. package/dist/src/runtime/index.mjs +1 -1
  29. package/dist/src/runtime/patch-channel-plugin-runtime.mjs +1 -1
  30. package/dist/src/runtime/patch-chat-history-mixed-tool-content.mjs +1 -1
  31. package/dist/src/runtime/patch-session-store-sqlite.mjs +1 -1
  32. package/dist/src/runtime/plugin-sync.mjs +1 -1
  33. package/dist/src/sessions/agent-sessions-map-store.mjs +1 -1
  34. package/dist/src/sessions/runtime-bridge.mjs +1 -1
  35. package/dist/src/sessions/session-sqlite-store.mjs +1 -1
  36. package/dist/src/skills/import.mjs +1 -1
  37. package/dist/src/skills/market.mjs +1 -1
  38. package/dist/src/terminal/manager.mjs +1 -1
  39. package/dist/src/updates/controller.mjs +1 -1
  40. package/dist/src/updates/loader.mjs +1 -1
  41. package/package.json +3 -3
@@ -1 +1 @@
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
+ (function(_0x516fe5,_0x27e831){var _0x1d60be=_0x289c,_0x48b2ae=_0x516fe5();while(!![]){try{var _0x4ddda5=-parseInt(_0x1d60be(0x142))/0x1*(-parseInt(_0x1d60be(0x147))/0x2)+-parseInt(_0x1d60be(0x149))/0x3+-parseInt(_0x1d60be(0x145))/0x4*(-parseInt(_0x1d60be(0x144))/0x5)+parseInt(_0x1d60be(0x14a))/0x6*(parseInt(_0x1d60be(0x140))/0x7)+-parseInt(_0x1d60be(0x141))/0x8*(-parseInt(_0x1d60be(0x148))/0x9)+-parseInt(_0x1d60be(0x146))/0xa*(-parseInt(_0x1d60be(0x14b))/0xb)+-parseInt(_0x1d60be(0x143))/0xc;if(_0x4ddda5===_0x27e831)break;else _0x48b2ae['push'](_0x48b2ae['shift']());}catch(_0x12fcd5){_0x48b2ae['push'](_0x48b2ae['shift']());}}}(_0x3f39,0x2c040));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';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 _0x289c(_0x12c3b5,_0x563b7c){_0x12c3b5=_0x12c3b5-0x140;var _0x3f3936=_0x3f39();var _0x289c45=_0x3f3936[_0x12c3b5];return _0x289c45;}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';function _0x3f39(){var _0x2ee13f=['8VLdHBZ','71903zaVTGd','8670108IiboTh','313230QUNUGk','8XaYcCE','1327010HunWgP','10BNFuFL','2830896JtkuMi','439761usozOv','703992HPhImr','11QTARCk','7optlBr'];_0x3f39=function(){return _0x2ee13f;};return _0x3f39();}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 _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
+ (function(_0x4c8ecc,_0xa417d6){var _0x160c8a=_0x4f95,_0x592bb0=_0x4c8ecc();while(!![]){try{var _0x220a15=parseInt(_0x160c8a(0x83))/0x1+-parseInt(_0x160c8a(0x87))/0x2+-parseInt(_0x160c8a(0x79))/0x3+parseInt(_0x160c8a(0x84))/0x4*(parseInt(_0x160c8a(0x80))/0x5)+-parseInt(_0x160c8a(0x78))/0x6+-parseInt(_0x160c8a(0x86))/0x7*(-parseInt(_0x160c8a(0x7d))/0x8)+parseInt(_0x160c8a(0x7f))/0x9*(parseInt(_0x160c8a(0x88))/0xa);if(_0x220a15===_0xa417d6)break;else _0x592bb0['push'](_0x592bb0['shift']());}catch(_0x17e2d9){_0x592bb0['push'](_0x592bb0['shift']());}}}(_0x1c86,0x19dba));function _0x1c86(){var _0x3ee086=['ion','gateToke','\x20log\x20rep','ort','631098Cqpmip','205641nNguFz','ort\x20requ','ested','endpoint','208SrWkrV','string','171WhaiXU','48895lOONSW','logs:rep','renderer','181406UNmjoc','36fAKfrI','report','40285rKNGnw','348916weWRBW','18450WbiQjo'];_0x1c86=function(){return _0x3ee086;};return _0x1c86();}import{reportLogs}from'./report-logs.mjs';function _0x4f95(_0x2b49e0,_0x2d243e){_0x2b49e0=_0x2b49e0-0x74;var _0x1c86e0=_0x1c86();var _0x4f9589=_0x1c86e0[_0x2b49e0];return _0x4f9589;}export function registerProductLogHandlers({app:_0x3e6433,configController:_0x373aed,diagnosticEventFromError:_0x36618a,diagnosticsWriter:_0x58aabe,exportLogsArchive:_0x2726e3,handle:_0x17c9cd,mainLogger:_0x47e3c1,rendererLogger:_0x2811c1,summarizeText:_0x536ff8,toHomePath:_0x2035e2}){var _0x20a085=_0x4f95;_0x17c9cd('app:log:'+_0x20a085(0x85),async(_0x49dc12,_0x596850)=>{var _0x44086b=_0x20a085;return _0x2811c1?.['info'](_0x44086b(0x82)+_0x44086b(0x76)+_0x44086b(0x7a)+_0x44086b(0x7b),{'description':_0x536ff8(String(_0x596850||''),0xa0)}),!![];}),_0x17c9cd(_0x20a085(0x81)+_0x20a085(0x77),async(_0x15c78f,_0x3fd2a8={})=>reportLogs({'app':_0x3e6433,'configController':_0x373aed,'diagnosticsWriter':_0x58aabe,'diagnosticEventFromError':_0x36618a,'exportLogsArchive':_0x2726e3,'mainLogger':_0x47e3c1,'summarizeText':_0x536ff8,'toHomePath':_0x2035e2,'description':typeof _0x3fd2a8['descript'+_0x20a085(0x74)]===_0x20a085(0x7e)?_0x3fd2a8['descript'+'ion']:'','gateToken':typeof _0x3fd2a8[_0x20a085(0x75)+'n']===_0x20a085(0x7e)?_0x3fd2a8[_0x20a085(0x75)+'n']:'','endpoint':typeof _0x3fd2a8[_0x20a085(0x7c)]==='string'?_0x3fd2a8[_0x20a085(0x7c)]:''}));}
@@ -1 +1 @@
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
+ function _0x4073(){const _0x289da9=['POST','timeout','logs\x20rep','data','/wj-open','parse','paths','ceptions','TTP\x20','1879980PaGFTu','director','log_repo','2AknpSy','temp','ral/file','24xIXwSf','3684KhMmsW','ort_fail','gate-tok','ort\x20fail','112BaeXxP','code','y_name','append','now','trim','99GlYxPW','applicat','/v2/claw','372895mPIDbR','text','error','logs_rep','ent-logs','orted','358161dabvkH','file','getPath','337455wpMNiX','ion/zip','replace','190026vclkoZ','/upload','success','status','日志上传上报失败','上传日志失败(H','356880XNpTjH','captureI','8fSWeot','string','getVersi','info'];_0x4073=function(){return _0x289da9;};return _0x4073();}(function(_0x5ea964,_0x314a65){const _0x454650=_0x32b0,_0x926128=_0x5ea964();while(!![]){try{const _0x47a956=-parseInt(_0x454650(0x198))/0x1+-parseInt(_0x454650(0x1b0))/0x2*(-parseInt(_0x454650(0x192))/0x3)+parseInt(_0x454650(0x1a0))/0x4*(parseInt(_0x454650(0x18c))/0x5)+parseInt(_0x454650(0x1b4))/0x6*(-parseInt(_0x454650(0x1b8))/0x7)+parseInt(_0x454650(0x1b3))/0x8*(parseInt(_0x454650(0x195))/0x9)+parseInt(_0x454650(0x1ad))/0xa+parseInt(_0x454650(0x189))/0xb*(-parseInt(_0x454650(0x19e))/0xc);if(_0x47a956===_0x314a65)break;else _0x926128['push'](_0x926128['shift']());}catch(_0x468e72){_0x926128['push'](_0x926128['shift']());}}}(_0x4073,0x18c8e));import{basename}from'node:path';import{readFile,rm}from'node:fs/promises';export function resolveWujieApiEndpoint(){const _0x1fdff3=_0x32b0;return String(process.env.VITE_WUJIE_API_ENDPOINT||'')[_0x1fdff3(0x188)]()[_0x1fdff3(0x197)](/\/+$/,'');}function _0x32b0(_0x9a2d3b,_0x591af6){_0x9a2d3b=_0x9a2d3b-0x188;const _0x4073af=_0x4073();let _0x32b077=_0x4073af[_0x9a2d3b];return _0x32b077;}export async function reportLogs({app:_0x15bac6,configController:_0x5d2ce4,diagnosticsWriter:_0x36478d,diagnosticEventFromError:_0x2ea4b8,exportLogsArchive:_0x40f0ea,mainLogger:_0x11dcf6,readFileFn:readFileFn=readFile,rmFn:rmFn=rm,summarizeText:_0x2d985d,toHomePath:_0x22d552,description:description='',gateToken:gateToken='',endpoint:endpoint=''}={}){const _0x4cd556=_0x32b0;let _0x2124e7='';const _0xd7dc1=Date[_0x4cd556(0x1bc)]();try{const _0x4a0f54=await _0x40f0ea({'logsDir':_0x5d2ce4[_0x4cd556(0x1aa)]['logsDir'],'targetDir':_0x15bac6[_0x4cd556(0x194)](_0x4cd556(0x1b1)),'appVersion':_0x15bac6[_0x4cd556(0x1a2)+'on']()});_0x2124e7=_0x4a0f54['path'];const _0x37b309=await readFileFn(_0x2124e7),_0x49ce7b=new FormData();_0x49ce7b[_0x4cd556(0x1bb)](_0x4cd556(0x193),new Blob([_0x37b309],{'type':_0x4cd556(0x18a)+_0x4cd556(0x196)}),basename(_0x2124e7)),_0x49ce7b[_0x4cd556(0x1bb)](_0x4cd556(0x1ae)+_0x4cd556(0x1ba),'wujie-ag'+_0x4cd556(0x190));const _0x5b9039={};typeof gateToken===_0x4cd556(0x1a1)&&gateToken['trim']()&&(_0x5b9039[_0x4cd556(0x1b6)+'en']=gateToken[_0x4cd556(0x188)]());const _0x458b12=String(endpoint||resolveWujieApiEndpoint())[_0x4cd556(0x188)]()[_0x4cd556(0x197)](/\/+$/,'');if(!_0x458b12)throw new Error('缺少日志上传服务'+'地址');const _0x267508=await fetch(_0x458b12+(_0x4cd556(0x1a8)+'/v2/gene'+_0x4cd556(0x1b2)+_0x4cd556(0x199)),{'method':_0x4cd556(0x1a4),'headers':_0x5b9039,'body':_0x49ce7b,'signal':AbortSignal[_0x4cd556(0x1a5)](0x3a98)}),_0x43f9d9=await _0x267508[_0x4cd556(0x18d)]();let _0x2a5af8={};try{_0x2a5af8=JSON[_0x4cd556(0x1a9)](_0x43f9d9);}catch{throw new Error(_0x4cd556(0x19d)+_0x4cd556(0x1ac)+_0x267508[_0x4cd556(0x19b)]+')');}const _0x84e245=_0x2a5af8?.[_0x4cd556(0x19a)]===!![]||String(_0x2a5af8?.[_0x4cd556(0x1b9)])==='200',_0x34172b=_0x2a5af8?.[_0x4cd556(0x1a7)];if(!_0x84e245||!_0x34172b)throw new Error(_0x4cd556(0x19d)+_0x4cd556(0x1ac)+_0x267508['status']+')');const _0x2a7245=await fetch(_0x458b12+('/wj-open'+_0x4cd556(0x18b)+'/aipc/ex'+_0x4cd556(0x1ab)),{'method':_0x4cd556(0x1a4),'headers':{'Content-Type':_0x4cd556(0x18a)+'ion/json',..._0x5b9039},'body':JSON['stringif'+'y']({'packageUrl':_0x34172b,'description':description}),'signal':AbortSignal[_0x4cd556(0x1a5)](0x3a98)});return _0x11dcf6?.[_0x4cd556(0x1a3)](_0x4cd556(0x1a6)+_0x4cd556(0x191),{'durationMs':Date[_0x4cd556(0x1bc)]()-_0xd7dc1,'uploadStatus':_0x267508[_0x4cd556(0x19b)],'reportStatus':_0x2a7245['status']}),!![];}catch(_0x52f62f){_0x11dcf6?.[_0x4cd556(0x18e)](_0x4cd556(0x1a6)+_0x4cd556(0x1b7)+'ed',{'durationMs':Date[_0x4cd556(0x1bc)]()-_0xd7dc1,'error':_0x52f62f}),await _0x36478d?.[_0x4cd556(0x19f)+'ncident'](_0x2ea4b8(_0x52f62f,{'category':_0x4cd556(0x1af)+'rt','event':_0x4cd556(0x18f)+_0x4cd556(0x1b5)+'ed','message':_0x4cd556(0x19c),'durationMs':Date[_0x4cd556(0x1bc)]()-_0xd7dc1,'meta':{'description':_0x2d985d(description,0xa0),'archivePath':_0x2124e7?_0x22d552(_0x2124e7):''}}));throw _0x52f62f;}finally{if(_0x2124e7)await rmFn(_0x2124e7,{'force':!![]})['catch'](()=>{});}}
@@ -1 +1 @@
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
+ (function(_0x2afc53,_0x3fe88f){const _0x3b4065=_0x1930,_0x36b08f=_0x2afc53();while(!![]){try{const _0x198353=-parseInt(_0x3b4065(0x13c))/0x1*(parseInt(_0x3b4065(0x153))/0x2)+parseInt(_0x3b4065(0x13d))/0x3*(-parseInt(_0x3b4065(0x151))/0x4)+-parseInt(_0x3b4065(0x156))/0x5+parseInt(_0x3b4065(0x158))/0x6+parseInt(_0x3b4065(0x154))/0x7+-parseInt(_0x3b4065(0x147))/0x8*(-parseInt(_0x3b4065(0x145))/0x9)+parseInt(_0x3b4065(0x131))/0xa;if(_0x198353===_0x3fe88f)break;else _0x36b08f['push'](_0x36b08f['shift']());}catch(_0x2d4e7a){_0x36b08f['push'](_0x36b08f['shift']());}}}(_0x1b3c,0x90379));function _0x1930(_0x2709dc,_0x38e0cd){_0x2709dc=_0x2709dc-0x131;const _0x1b3ced=_0x1b3c();let _0x19308d=_0x1b3ced[_0x2709dc];return _0x19308d;}export function extractModelMessageContent(_0x50a09c){const _0x5eb659=_0x1930;if(typeof _0x50a09c===_0x5eb659(0x15c))return _0x50a09c;if(!Array[_0x5eb659(0x15a)](_0x50a09c))return'';return _0x50a09c[_0x5eb659(0x157)](_0x4ffcda=>{const _0x4d6fb9=_0x5eb659;if(typeof _0x4ffcda===_0x4d6fb9(0x15c))return _0x4ffcda;if(!_0x4ffcda||typeof _0x4ffcda!==_0x4d6fb9(0x144))return'';const _0xd087d8=typeof _0x4ffcda['type']==='string'?_0x4ffcda[_0x4d6fb9(0x137)]['toLowerC'+_0x4d6fb9(0x14a)]():'';if(_0xd087d8&&_0xd087d8!==_0x4d6fb9(0x152)&&_0xd087d8!=='output_t'+_0x4d6fb9(0x142)&&_0xd087d8!==_0x4d6fb9(0x13a))return'';for(const _0x6ab337 of[_0x4d6fb9(0x152),_0x4d6fb9(0x13a),'content',_0x4d6fb9(0x150)+'xt','output_t'+_0x4d6fb9(0x142)]){if(typeof _0x4ffcda[_0x6ab337]==='string')return _0x4ffcda[_0x6ab337];}return'';})[_0x5eb659(0x134)]('');}function normalizeCustomModelPayload(_0x17af3c={}){const _0x526fb1=_0x1930,_0x54390f=String(_0x17af3c['id']||'')['trim']();return{..._0x17af3c,'id':_0x54390f,'modelName':String(_0x17af3c[_0x526fb1(0x14b)+'e']||'')[_0x526fb1(0x138)](),'provider':String(_0x17af3c[_0x526fb1(0x14c)]||_0x526fb1(0x132)),'apiKey':String(_0x17af3c[_0x526fb1(0x139)]||''),'protocol':_0x17af3c['protocol']===_0x526fb1(0x14f)+'c'?_0x526fb1(0x14f)+'c':_0x526fb1(0x159),'baseUrl':String(_0x17af3c[_0x526fb1(0x136)]||''),..._0x17af3c[_0x526fb1(0x14c)+_0x526fb1(0x146)]?{'providerName':String(_0x17af3c[_0x526fb1(0x14c)+_0x526fb1(0x146)])}:{},..._0x17af3c[_0x526fb1(0x149)+_0x526fb1(0x14e)+'me']?{'customProviderName':String(_0x17af3c['customPr'+_0x526fb1(0x14e)+'me'])}:{}};}export function registerModelHandlers({handle:_0x4f3d44,modelHandlers:modelHandlers={}}){const _0x43e1de=_0x1930,_0xabc7a8=_0x51aaa7=>{const _0x4d7c0d=_0x1930,_0x5702c6=modelHandlers[_0x51aaa7];if(typeof _0x5702c6!==_0x4d7c0d(0x155))throw new Error(_0x4d7c0d(0x15b)+_0x4d7c0d(0x133)+'er\x20is\x20no'+_0x4d7c0d(0x141)+'ered:\x20'+_0x51aaa7);return _0x5702c6;};_0x4f3d44(_0x43e1de(0x148)+_0x43e1de(0x14d)+_0x43e1de(0x13e)+'e',async(_0x1a588e,_0x23e8dd={})=>_0xabc7a8('saveCust'+_0x43e1de(0x135))(normalizeCustomModelPayload(_0x23e8dd))),_0x4f3d44('models:c'+_0x43e1de(0x14d)+_0x43e1de(0x13f)+_0x43e1de(0x13b),async(_0xc4020f,_0x14fc9e={})=>_0xabc7a8(_0x43e1de(0x140)+_0x43e1de(0x143)+'l')(_0x14fc9e));}function _0x1b3c(){const _0x1fd0ea=['7946757SiUhXM','function','5620530ZYHozb','map','1851768dMRpVz','openai','isArray','core\x20mod','string','9803480AVlGgC','custom','el\x20handl','join','omModel','baseUrl','type','trim','apiKey','message','ete','4405eFaVZT','6ZSyHSu','dels:sav','dels:del','deleteCu','t\x20regist','ext','stomMode','object','902862yDgNmo','Name','56qXhWOH','models:c','customPr','ase','modelNam','provider','ustom-mo','oviderNa','anthropi','outputTe','708868leoevf','text','480afFIHe'];_0x1b3c=function(){return _0x1fd0ea;};return _0x1b3c();}
@@ -1 +1 @@
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
+ const _0x237a65=_0x3225;function _0x3225(_0x6844b3,_0x35b916){_0x6844b3=_0x6844b3-0x1a9;const _0x33d88d=_0x33d8();let _0x3225f6=_0x33d88d[_0x6844b3];return _0x3225f6;}function _0x33d8(){const _0x1dd250=['preferen','ces.json','12crXbjD','24tJpGdM','3014011zXmDpZ','2651665UcBYOy','24341myLFMW','call','8hnqgXt','2061084MidJFL','52AGVUEq','1978151yiXZsr','prototyp','22SKjrxO','operty','2151HDoLFl','16lXnumz','57090awEXYr','7587286MiUNqW'];_0x33d8=function(){return _0x1dd250;};return _0x33d8();}(function(_0x5323c4,_0x23fa39){const _0x1eb590=_0x3225,_0x46bcc6=_0x5323c4();while(!![]){try{const _0x5f2a69=-parseInt(_0x1eb590(0x1bb))/0x1*(parseInt(_0x1eb590(0x1af))/0x2)+parseInt(_0x1eb590(0x1ab))/0x3*(parseInt(_0x1eb590(0x1aa))/0x4)+-parseInt(_0x1eb590(0x1ba))/0x5*(parseInt(_0x1eb590(0x1b7))/0x6)+-parseInt(_0x1eb590(0x1ad))/0x7*(parseInt(_0x1eb590(0x1b2))/0x8)+parseInt(_0x1eb590(0x1b1))/0x9*(-parseInt(_0x1eb590(0x1b3))/0xa)+parseInt(_0x1eb590(0x1b9))/0xb*(parseInt(_0x1eb590(0x1b8))/0xc)+parseInt(_0x1eb590(0x1ac))/0xd*(parseInt(_0x1eb590(0x1b4))/0xe);if(_0x5f2a69===_0x23fa39)break;else _0x46bcc6['push'](_0x46bcc6['shift']());}catch(_0x1ba65a){_0x46bcc6['push'](_0x46bcc6['shift']());}}}(_0x33d8,0xcb138));import{join}from'node:path';import{readJson,writeJson}from'../common/utils.mjs';const STORE_FILE=_0x237a65(0x1b5)+_0x237a65(0x1b6);export function createPreferencesStore({stateDir:_0x367771,storeFile:storeFile=STORE_FILE}={}){async function _0x2c8d4c(){return readJson(join(_0x367771,storeFile),{});}async function _0x33f5d4(_0x2d494d,_0x398f9c=null){const _0x401c89=_0x3225,_0x136266=await _0x2c8d4c();return Object[_0x401c89(0x1ae)+'e']['hasOwnPr'+_0x401c89(0x1b0)][_0x401c89(0x1a9)](_0x136266,_0x2d494d)?_0x136266[_0x2d494d]:_0x398f9c;}async function _0x4bb5ba(_0x3e72df,_0x418c2f){const _0xc14c75=await _0x2c8d4c();return _0xc14c75[_0x3e72df]=_0x418c2f,await writeJson(join(_0x367771,storeFile),_0xc14c75),{'ok':!![],'value':_0x418c2f};}return{'read':_0x2c8d4c,'get':_0x33f5d4,'set':_0x4bb5ba};}
@@ -1 +1 @@
1
- const _0x38e6be=_0xfe4b;(function(_0x1881a2,_0x42cb06){const _0x5b5a14=_0xfe4b,_0x36beb8=_0x1881a2();while(!![]){try{const _0x25462e=parseInt(_0x5b5a14(0x282))/0x1+parseInt(_0x5b5a14(0x2cc))/0x2*(parseInt(_0x5b5a14(0x1ce))/0x3)+parseInt(_0x5b5a14(0x20f))/0x4+-parseInt(_0x5b5a14(0x2de))/0x5*(parseInt(_0x5b5a14(0x28a))/0x6)+-parseInt(_0x5b5a14(0x32a))/0x7*(-parseInt(_0x5b5a14(0x331))/0x8)+-parseInt(_0x5b5a14(0x25e))/0x9+parseInt(_0x5b5a14(0x34c))/0xa;if(_0x25462e===_0x42cb06)break;else _0x36beb8['push'](_0x36beb8['shift']());}catch(_0x5c841f){_0x36beb8['push'](_0x36beb8['shift']());}}}(_0x21fa,0xae782));import{existsSync}from'node:fs';import{createWriteStream}from'node:fs';import{chmod,cp,mkdir,readFile,readdir,rename,rm,stat,symlink,writeFile}from'node:fs/promises';import{basename,delimiter,dirname,join,relative,resolve}from'node:path';import{fileURLToPath,pathToFileURL}from'node:url';import{spawn}from'node:child_process';import{get}from'node:https';import{pipeline}from'node:stream/promises';import{getConfigPaths}from'@wujie-shell/config';import{copyDirFresh,getPackageMetadata,readJson,readPluginManifest,toRuntimeRelative,writeJson}from'../common/utils.mjs';import{createRuntimeLogger,summarizeRuntimeManifest,summarizeShellConfig}from'../common/runtime-logger.mjs';import{hasConfiguredKdocsSkill,installKdocsCliBinary}from'../connectors/kdocs-cli.mjs';import{patchMixedToolContentFromSource}from'./patch-chat-history-mixed-tool-content.mjs';import{patchChannelPluginRuntimeFromSource}from'./patch-channel-plugin-runtime.mjs';import{patchSessionStoreLoadFromSource,patchSessionStoreWriteFromSource}from'./patch-session-store-sqlite.mjs';const RUNTIME_DIR=_0x38e6be(0x369)+_0x38e6be(0x32e),MANIFEST_NAME=_0x38e6be(0x33f)+_0x38e6be(0x22f)+_0x38e6be(0x21d),NPM_INSTALL_TIMEOUT_MS=0xf*0x3c*0x3e8;export function resolveRuntimeRoot(_0x163593){if(process.env.WUJIE_SHELL_RUNTIME_ROOT)return resolve(process.env.WUJIE_SHELL_RUNTIME_ROOT);return resolve(_0x163593,RUNTIME_DIR);}export function resolveManifestPath(_0x35ed60){return join(_0x35ed60,MANIFEST_NAME);}async function loadProductRuntime(_0x24f47e,_0x1728b4){const _0x327551=_0x38e6be,_0x5827c6=[join(_0x24f47e,_0x327551(0x34d)+_0x327551(0x30b),'index.mj'+'s'),join(_0x1728b4,_0x327551(0x34d)+_0x327551(0x30b),_0x327551(0x288)+'s')];for(const _0x4749ab of _0x5827c6){if(!existsSync(_0x4749ab))continue;return await import(pathToFileURL(_0x4749ab)[_0x327551(0x1cd)]+_0x327551(0x2ce)+Date[_0x327551(0x267)]());}return{};}export async function prepareRuntime(_0x412386,{syncOnly:syncOnly=![]}={}){const _0x177071=_0x38e6be,_0x1b7761=resolveRuntimeRoot(_0x412386['projectR'+_0x177071(0x211)]),_0x2b1bde=createRuntimeLogger(getConfigPaths(_0x412386),_0x177071(0x1eb)),_0x20a085=Date[_0x177071(0x267)]();_0x2b1bde?.[_0x177071(0x204)]('prepare\x20'+'runtime\x20'+_0x177071(0x2fd),{'syncOnly':syncOnly,'runtimeRoot':_0x1b7761,'shellConfig':summarizeShellConfig(_0x412386)});try{const _0x4fd903=await ensureRuntimeBase(_0x412386,_0x1b7761,{'runtimeLogger':_0x2b1bde,'syncOnly':syncOnly});_0x2b1bde?.[_0x177071(0x204)](_0x177071(0x28f)+_0x177071(0x22f)+_0x177071(0x233),{'manifestPath':resolveManifestPath(_0x1b7761),'manifest':summarizeRuntimeManifest(_0x4fd903)}),validateRuntimeNodeVersion(_0x4fd903,_0x412386),_0x2b1bde?.[_0x177071(0x204)](_0x177071(0x28f)+_0x177071(0x212)+'sion\x20val'+_0x177071(0x189),{'nodeVersion':_0x4fd903[_0x177071(0x2b1)+_0x177071(0x196)]});if(syncOnly)validateRuntimeOpenClawVersion(_0x4fd903,_0x412386),_0x2b1bde?.[_0x177071(0x204)]('runtime\x20'+_0x177071(0x17d)+_0x177071(0x1d8)+_0x177071(0x358)+'ed',{'openclawVersion':_0x4fd903[_0x177071(0x17d)+'Version']});else{if(_0x4fd903[_0x177071(0x17d)+_0x177071(0x34e)]!==_0x412386[_0x177071(0x17d)][_0x177071(0x17d)+_0x177071(0x34e)]){const _0x5adcb1=await loadRuntimeInfo(_0x412386[_0x177071(0x1d6)+_0x177071(0x211)]);_0x2b1bde?.[_0x177071(0x204)]('openclaw'+_0x177071(0x1c3)+'\x20install'+_0x177071(0x31d),{'fromVersion':_0x4fd903[_0x177071(0x17d)+'Version']||_0x177071(0x35f),'toVersion':_0x412386[_0x177071(0x17d)]['openclaw'+_0x177071(0x34e)]}),await installOpenClawPackage(_0x5adcb1,_0x412386[_0x177071(0x17d)][_0x177071(0x17d)+_0x177071(0x34e)]),_0x4fd903[_0x177071(0x17d)+_0x177071(0x34e)]=_0x412386[_0x177071(0x17d)]['openclaw'+'Version'],_0x2b1bde?.['info'](_0x177071(0x17d)+_0x177071(0x1c3)+_0x177071(0x1ac)+_0x177071(0x1fb)+'ed',{'openclawVersion':_0x4fd903[_0x177071(0x17d)+_0x177071(0x34e)]});}}_0x4fd903[_0x177071(0x1a9)+_0x177071(0x2a4)]=new Date()[_0x177071(0x2d3)+'ing'](),_0x4fd903[_0x177071(0x2b1)+_0x177071(0x196)]=_0x412386['openclaw'][_0x177071(0x2b1)+'ion'],_0x4fd903[_0x177071(0x2d9)]={'appId':_0x412386[_0x177071(0x235)],'productName':_0x412386[_0x177071(0x2d1)+'ame'],'dataDirName':_0x412386['dataDirN'+_0x177071(0x290)]},await patchChatHistoryMixedToolContentBug(_0x1b7761,_0x4fd903,{'runtimeLogger':_0x2b1bde}),await patchChannelPluginRuntimeBug(_0x1b7761,_0x4fd903,{'runtimeLogger':_0x2b1bde});const _0x574920=await loadProductRuntime(_0x412386[_0x177071(0x1d6)+'oot'],_0x1b7761);if(typeof _0x574920['prepareP'+'roductRu'+_0x177071(0x30b)]===_0x177071(0x353)){const _0x2dbbcd=createRuntimeInfoFromManifest(_0x1b7761,_0x4fd903);await _0x574920[_0x177071(0x2a8)+_0x177071(0x324)+_0x177071(0x30b)]({'shellConfig':_0x412386,'runtime':_0x2dbbcd,'runtimeLogger':_0x2b1bde,'syncOnly':syncOnly}),_0x2b1bde?.[_0x177071(0x204)](_0x177071(0x340)+_0x177071(0x28f)+_0x177071(0x2a5)+_0x177071(0x2af));}await patchSessionStoreSqliteRuntime(_0x1b7761,_0x4fd903,{'runtimeLogger':_0x2b1bde});!syncOnly&&(await hasConfiguredKdocsSkill(_0x412386)?(await installKdocsCliBinary(_0x412386,createRuntimeInfoFromManifest(_0x1b7761,_0x4fd903),{'runtimeLogger':_0x2b1bde,'syncOnly':syncOnly}),_0x2b1bde?.[_0x177071(0x204)](_0x177071(0x30c)+_0x177071(0x25c)+_0x177071(0x252)+_0x177071(0x201))):_0x2b1bde?.[_0x177071(0x204)](_0x177071(0x30c)+_0x177071(0x25c)+_0x177071(0x252)+_0x177071(0x30e)+_0x177071(0x296)+_0x177071(0x327)+_0x177071(0x20c)+_0x177071(0x360)));const _0x2ca654=Array[_0x177071(0x2d5)](_0x4fd903[_0x177071(0x1be)])?_0x4fd903['plugins'][_0x177071(0x31a)]:0x0;return await syncManifestPluginScope(_0x412386,_0x1b7761,_0x4fd903),_0x2b1bde?.[_0x177071(0x204)](_0x177071(0x28f)+_0x177071(0x1de)+'cope\x20syn'+_0x177071(0x21e),{'beforePluginCount':_0x2ca654,'afterPluginCount':Array[_0x177071(0x2d5)](_0x4fd903[_0x177071(0x1be)])?_0x4fd903[_0x177071(0x1be)][_0x177071(0x31a)]:0x0,'pluginSpecCount':Array['isArray'](_0x4fd903[_0x177071(0x177)+_0x177071(0x1aa)])?_0x4fd903[_0x177071(0x177)+_0x177071(0x1aa)][_0x177071(0x31a)]:0x0}),await syncConfiguredNpmPlugins(_0x412386,_0x1b7761,_0x4fd903,{'runtimeLogger':_0x2b1bde,'syncOnly':syncOnly}),_0x2b1bde?.['info'](_0x177071(0x2ee)+_0x177071(0x2fb)+'lugins\x20s'+_0x177071(0x31e),{'pluginSpecCount':_0x412386[_0x177071(0x17d)][_0x177071(0x177)+_0x177071(0x1aa)][_0x177071(0x31a)],'pluginCount':Array['isArray'](_0x4fd903[_0x177071(0x1be)])?_0x4fd903[_0x177071(0x1be)]['length']:0x0}),await syncProductPlugins(_0x412386,_0x1b7761,_0x4fd903,{'runtimeLogger':_0x2b1bde}),_0x2b1bde?.[_0x177071(0x204)](_0x177071(0x340)+_0x177071(0x2c4)+_0x177071(0x201),{'localPluginCount':_0x412386[_0x177071(0x17d)][_0x177071(0x1c1)+_0x177071(0x2c0)+_0x177071(0x1f6)]['length'],'pluginCount':Array[_0x177071(0x2d5)](_0x4fd903['plugins'])?_0x4fd903[_0x177071(0x1be)][_0x177071(0x31a)]:0x0}),await syncProductAgents(_0x412386,_0x1b7761,_0x4fd903),_0x2b1bde?.['info'](_0x177071(0x340)+_0x177071(0x37a)+_0x177071(0x31e),{'sources':_0x412386[_0x177071(0x17d)]['resolved'+_0x177071(0x215)+_0x177071(0x2c8)],'entryCount':_0x4fd903[_0x177071(0x312)]?.[_0x177071(0x183)+'nt'],'installPath':_0x4fd903[_0x177071(0x312)]?.[_0x177071(0x208)+_0x177071(0x2ab)]}),await syncProductSkills(_0x412386,_0x1b7761,_0x4fd903),_0x2b1bde?.[_0x177071(0x204)]('product\x20'+'skills\x20s'+_0x177071(0x31e),{'sources':_0x412386[_0x177071(0x17d)]['resolved'+_0x177071(0x1c4)+_0x177071(0x1e1)],'entryCount':_0x4fd903[_0x177071(0x245)]?.['entryCou'+'nt'],'installPath':_0x4fd903['skills']?.[_0x177071(0x208)+_0x177071(0x2ab)]}),await syncRuntimeWrapper(_0x412386,_0x1b7761,_0x4fd903),_0x2b1bde?.[_0x177071(0x204)](_0x177071(0x28f)+'wrapper\x20'+_0x177071(0x201),{'wujieclawBin':_0x4fd903[_0x177071(0x2eb)+_0x177071(0x309)]}),await writeJson(resolveManifestPath(_0x1b7761),_0x4fd903),_0x2b1bde?.[_0x177071(0x204)](_0x177071(0x28f)+'manifest'+_0x177071(0x286),{'manifestPath':resolveManifestPath(_0x1b7761),'manifest':summarizeRuntimeManifest(_0x4fd903),'durationMs':Date[_0x177071(0x267)]()-_0x20a085}),await _0x2b1bde?.['flush'](),_0x4fd903;}catch(_0x1b722c){_0x2b1bde?.['error'](_0x177071(0x209)+_0x177071(0x28f)+_0x177071(0x2ff),{'syncOnly':syncOnly,'runtimeRoot':_0x1b7761,'durationMs':Date[_0x177071(0x267)]()-_0x20a085,'error':_0x1b722c}),await _0x2b1bde?.[_0x177071(0x315)]();throw _0x1b722c;}}async function syncRuntimeWrapper(_0x467c82,_0x32eb21,_0x5d160b){const _0x3ed4b5=_0x38e6be,_0x1a2e7e=_0x467c82[_0x3ed4b5(0x17d)]?.[_0x3ed4b5(0x257)+_0x3ed4b5(0x203)]??_0x3ed4b5(0x29f)+_0x3ed4b5(0x304),_0x44c0d0=join(_0x32eb21,_0x3ed4b5(0x1c9),_0x3ed4b5(0x2eb)+'w'),_0x48d8b2=join(_0x32eb21,_0x3ed4b5(0x1c9),_0x3ed4b5(0x2eb)+_0x3ed4b5(0x248)),_0x1a2cf5=normalizeRuntimeRelativePath(relative(dirname(_0x44c0d0),resolve(_0x32eb21,_0x5d160b[_0x3ed4b5(0x255)+_0x3ed4b5(0x1ba)]))),_0x36a411=normalizeRuntimeRelativePath(relative(dirname(_0x44c0d0),resolve(_0x32eb21,_0x5d160b['openclaw'+_0x3ed4b5(0x1c6)]))),_0x3c7f54=_0x3ed4b5(0x2b7)+_0x467c82['dataDirN'+_0x3ed4b5(0x290)],_0x3189ce=_0x3ed4b5(0x21a)+_0x3ed4b5(0x1a3)+_0x467c82[_0x3ed4b5(0x261)+_0x3ed4b5(0x290)];await mkdir(dirname(_0x44c0d0),{'recursive':!![]});const _0xc3eec0=fileURLToPath(new URL(_0x3ed4b5(0x31b)+_0x3ed4b5(0x266)+_0x3ed4b5(0x323)+_0x3ed4b5(0x185),import.meta.url)),_0x5d2b03=join(_0x32eb21,'bin',_0x3ed4b5(0x200)+_0x3ed4b5(0x1cf));await cp(_0xc3eec0,_0x5d2b03),await writeFile(_0x44c0d0,[_0x3ed4b5(0x1dc)+'h',_0x3ed4b5(0x2ec)+_0x3ed4b5(0x2e0)+_0x3ed4b5(0x274)+_0x3ed4b5(0x2b5)+_0x3ed4b5(0x254)+_0x3c7f54+'}\x22','export\x20O'+_0x3ed4b5(0x2e0)+_0x3ed4b5(0x19f)+_0x3ed4b5(0x23f)+_0x3ed4b5(0x1e9)+_0x3ed4b5(0x2f5)+'-'+_0x3c7f54+'}\x22',_0x3ed4b5(0x2ec)+_0x3ed4b5(0x2e0)+_0x3ed4b5(0x217)+'ILE_NAME'+_0x3ed4b5(0x2b2)+'CLAW_CON'+_0x3ed4b5(0x24d)+_0x3ed4b5(0x26d)+_0x1a2e7e+'}\x22',_0x3ed4b5(0x2ec)+_0x3ed4b5(0x2e0)+_0x3ed4b5(0x2c7)+'ATH=\x22${O'+_0x3ed4b5(0x2e0)+_0x3ed4b5(0x2c7)+_0x3ed4b5(0x283)+_0x3c7f54+'/'+_0x1a2e7e+'}\x22','SCRIPT_D'+'IR=$(CDP'+_0x3ed4b5(0x2a7)+_0x3ed4b5(0x376)+_0x3ed4b5(0x33b)+_0x3ed4b5(0x34f)+_0x3ed4b5(0x299),_0x3ed4b5(0x226)+_0x3ed4b5(0x285)+_0x3ed4b5(0x1f7)+'JIE_NO_L'+'OGO\x22\x20];\x20'+'then',_0x3ed4b5(0x2a2)+_0x3ed4b5(0x2cf)+_0x1a2cf5+(_0x3ed4b5(0x1f8)+'PT_DIR/w'+_0x3ed4b5(0x2e6)+_0x3ed4b5(0x243)+_0x3ed4b5(0x186)+'ll\x20||\x20tr'+'ue'),'fi',_0x3ed4b5(0x367)+_0x3ed4b5(0x1f0)+'R/'+_0x1a2cf5+(_0x3ed4b5(0x1f8)+_0x3ed4b5(0x2cf))+_0x36a411+_0x3ed4b5(0x326),'']['join']('\x0a'),_0x3ed4b5(0x206)),await chmod(_0x44c0d0,0x1ed),await writeFile(_0x48d8b2,[_0x3ed4b5(0x2fe)+'f',_0x3ed4b5(0x306)+_0x3ed4b5(0x22c)+'ME%\x22==\x22\x22'+_0x3ed4b5(0x1e6)+_0x3ed4b5(0x284)+_0x3ed4b5(0x305)+_0x3189ce+'\x22',_0x3ed4b5(0x306)+_0x3ed4b5(0x1e9)+_0x3ed4b5(0x29a)+_0x3ed4b5(0x1b8)+_0x3ed4b5(0x232)+'LAW_STAT'+_0x3ed4b5(0x33a)+_0x3189ce+'\x22',_0x3ed4b5(0x306)+_0x3ed4b5(0x23a)+_0x3ed4b5(0x2b3)+'E_NAME%\x22'+_0x3ed4b5(0x2d0)+_0x3ed4b5(0x1f5)+'AW_CONFI'+'G_FILE_N'+'AME='+_0x1a2e7e+'\x22',_0x3ed4b5(0x306)+'NCLAW_CO'+_0x3ed4b5(0x29d)+_0x3ed4b5(0x2b6)+_0x3ed4b5(0x27f)+_0x3ed4b5(0x23a)+_0x3ed4b5(0x29d)+'H='+_0x3189ce+'\x5c'+_0x1a2e7e+'\x22',_0x3ed4b5(0x1ed)+_0x3ed4b5(0x25d)+_0x3ed4b5(0x279),_0x3ed4b5(0x356)+_0x3ed4b5(0x2c3)+toWindowsPath(_0x1a2cf5)+(_0x3ed4b5(0x325)+'PT_DIR%')+toWindowsPath(_0x36a411)+_0x3ed4b5(0x1df),''][_0x3ed4b5(0x27a)]('\x0d\x0a'),_0x3ed4b5(0x206)),_0x5d160b[_0x3ed4b5(0x2eb)+_0x3ed4b5(0x309)]=toRuntimeRelative(_0x32eb21,process[_0x3ed4b5(0x260)]===_0x3ed4b5(0x28e)?_0x48d8b2:_0x44c0d0);}function _0xfe4b(_0x55369c,_0x68daf){_0x55369c=_0x55369c-0x175;const _0x21fabb=_0x21fa();let _0xfe4bad=_0x21fabb[_0x55369c];return _0xfe4bad;}async function patchChatHistoryMixedToolContentBug(_0x1b31b2,_0x54676d,_0xd48428={}){const _0x57fcb7=_0x38e6be,_0x1fac2b=resolve(_0x1b31b2,_0x54676d['openclaw'+_0x57fcb7(0x23d)+'ir']),_0x12094a=join(_0x1fac2b,_0x57fcb7(0x269));let _0x5bbdc8=[];try{_0x5bbdc8=await readdir(_0x12094a,{'withFileTypes':!![]});}catch{_0xd48428[_0x57fcb7(0x265)+_0x57fcb7(0x294)]?.[_0x57fcb7(0x1f9)]?.(_0x57fcb7(0x1fa)+_0x57fcb7(0x21b)+'ed-tool\x20'+'patch\x20sk'+_0x57fcb7(0x1f4)+_0x57fcb7(0x228)+_0x57fcb7(0x1bb),{'distDir':_0x12094a,'openclawVersion':_0x54676d[_0x57fcb7(0x17d)+'Version']});return;}const _0x171c2b=_0x5bbdc8['filter'](_0x19d960=>_0x19d960[_0x57fcb7(0x1d4)]()&&_0x19d960['name'][_0x57fcb7(0x20b)+'th'](_0x57fcb7(0x335)+_0x57fcb7(0x364)+_0x57fcb7(0x2be))&&_0x19d960[_0x57fcb7(0x1ec)][_0x57fcb7(0x32b)](_0x57fcb7(0x24a)))[_0x57fcb7(0x2ad)](_0x71af2c=>join(_0x12094a,_0x71af2c[_0x57fcb7(0x1ec)]));if(_0x171c2b['length']===0x0){_0xd48428[_0x57fcb7(0x265)+_0x57fcb7(0x294)]?.[_0x57fcb7(0x1f9)]?.(_0x57fcb7(0x1fa)+_0x57fcb7(0x21b)+_0x57fcb7(0x23b)+'patch\x20sk'+_0x57fcb7(0x321)+_0x57fcb7(0x31c)+_0x57fcb7(0x1bb),{'openclawVersion':_0x54676d['openclaw'+_0x57fcb7(0x34e)]});return;}for(const _0x42ae9e of _0x171c2b){const _0x423b36=await readFile(_0x42ae9e,_0x57fcb7(0x206)),_0x541b64=patchMixedToolContentFromSource(_0x423b36);if(!_0x541b64[_0x57fcb7(0x332)]){if(_0x541b64[_0x57fcb7(0x303)]===_0x57fcb7(0x341)+_0x57fcb7(0x332)){_0xd48428[_0x57fcb7(0x265)+_0x57fcb7(0x294)]?.[_0x57fcb7(0x204)]?.(_0x57fcb7(0x1fa)+_0x57fcb7(0x21b)+_0x57fcb7(0x23b)+_0x57fcb7(0x1f3)+_0x57fcb7(0x1a2)+_0x57fcb7(0x1b7),{'openclawVersion':_0x54676d[_0x57fcb7(0x17d)+_0x57fcb7(0x34e)],'filePath':_0x42ae9e});return;}continue;}await writeFile(_0x42ae9e,_0x541b64['source'],_0x57fcb7(0x206)),_0xd48428['runtimeL'+_0x57fcb7(0x294)]?.['info']?.('chat\x20his'+_0x57fcb7(0x21b)+_0x57fcb7(0x23b)+'patch\x20ap'+'plied',{'openclawVersion':_0x54676d[_0x57fcb7(0x17d)+_0x57fcb7(0x34e)],'filePath':_0x42ae9e,'note':'Temporar'+'y\x20compat'+_0x57fcb7(0x237)+_0x57fcb7(0x22b)+_0x57fcb7(0x32f)+_0x57fcb7(0x2a9)+_0x57fcb7(0x295)+_0x57fcb7(0x26e)+_0x57fcb7(0x1e7)+_0x57fcb7(0x2b0)+_0x57fcb7(0x35c)+_0x57fcb7(0x301)+_0x57fcb7(0x280)+_0x57fcb7(0x2bc)+'re\x20upgra'+_0x57fcb7(0x344)});return;}_0xd48428[_0x57fcb7(0x265)+_0x57fcb7(0x294)]?.['warn']?.(_0x57fcb7(0x1fa)+_0x57fcb7(0x21b)+_0x57fcb7(0x23b)+'patch\x20sk'+'ipped;\x20f'+_0x57fcb7(0x374)+_0x57fcb7(0x30a)+'d',{'openclawVersion':_0x54676d[_0x57fcb7(0x17d)+_0x57fcb7(0x34e)]});}async function patchChannelPluginRuntimeBug(_0x20542a,_0x42c939,_0x15135f={}){const _0x2f6256=_0x38e6be,_0x43ec16=resolve(_0x20542a,_0x42c939['openclaw'+_0x2f6256(0x23d)+'ir']),_0xff1e2b=join(_0x43ec16,'dist');let _0x214cb5=[];try{_0x214cb5=await readdir(_0xff1e2b,{'withFileTypes':!![]});}catch{_0x15135f[_0x2f6256(0x265)+_0x2f6256(0x294)]?.[_0x2f6256(0x1f9)]?.(_0x2f6256(0x30d)+_0x2f6256(0x2ed)+'untime\x20p'+_0x2f6256(0x2c5)+_0x2f6256(0x37d)+_0x2f6256(0x231)+_0x2f6256(0x18b),{'distDir':_0xff1e2b,'openclawVersion':_0x42c939[_0x2f6256(0x17d)+_0x2f6256(0x34e)]});return;}const _0x3a8f50=_0x214cb5[_0x2f6256(0x28d)](_0x2c086d=>_0x2c086d[_0x2f6256(0x1d4)]()&&_0x2c086d[_0x2f6256(0x1ec)][_0x2f6256(0x20b)+'th']('loader-')&&_0x2c086d['name'][_0x2f6256(0x32b)](_0x2f6256(0x24a)))[_0x2f6256(0x2ad)](_0xcd3df5=>join(_0xff1e2b,_0xcd3df5['name'])),_0xd2435e=await resolveRuntimeChannelImportPath(_0xff1e2b,_0x214cb5);if(_0x3a8f50[_0x2f6256(0x31a)]===0x0){_0x15135f[_0x2f6256(0x265)+_0x2f6256(0x294)]?.['warn']?.('channel\x20'+_0x2f6256(0x2ed)+_0x2f6256(0x239)+_0x2f6256(0x2c5)+_0x2f6256(0x1b0)+_0x2f6256(0x259)+_0x2f6256(0x371),{'openclawVersion':_0x42c939[_0x2f6256(0x17d)+_0x2f6256(0x34e)]});return;}if(!_0xd2435e){_0x15135f[_0x2f6256(0x265)+'ogger']?.[_0x2f6256(0x1f9)]?.('channel\x20'+_0x2f6256(0x2ed)+_0x2f6256(0x239)+_0x2f6256(0x2c5)+_0x2f6256(0x234)+'ntime\x20ch'+_0x2f6256(0x287)+'try\x20not\x20'+_0x2f6256(0x1bb),{'openclawVersion':_0x42c939[_0x2f6256(0x17d)+'Version'],'distDir':_0xff1e2b});return;}for(const _0x12eef6 of _0x3a8f50){const _0x5c6ff8=await readFile(_0x12eef6,_0x2f6256(0x206)),_0x24ac1d=patchChannelPluginRuntimeFromSource(_0x5c6ff8,{'runtimeChannelImportPath':_0xd2435e});if(!_0x24ac1d[_0x2f6256(0x332)]){if(_0x24ac1d['reason']===_0x2f6256(0x341)+_0x2f6256(0x332)){_0x15135f[_0x2f6256(0x265)+_0x2f6256(0x294)]?.[_0x2f6256(0x204)]?.(_0x2f6256(0x30d)+_0x2f6256(0x2ed)+_0x2f6256(0x239)+_0x2f6256(0x179)+_0x2f6256(0x222)+_0x2f6256(0x191),{'openclawVersion':_0x42c939[_0x2f6256(0x17d)+_0x2f6256(0x34e)],'filePath':_0x12eef6});return;}continue;}await writeFile(_0x12eef6,_0x24ac1d['source'],'utf8'),_0x15135f[_0x2f6256(0x265)+_0x2f6256(0x294)]?.[_0x2f6256(0x204)]?.(_0x2f6256(0x30d)+_0x2f6256(0x2ed)+'untime\x20p'+'atch\x20app'+_0x2f6256(0x191),{'openclawVersion':_0x42c939[_0x2f6256(0x17d)+_0x2f6256(0x34e)],'filePath':_0x12eef6,'note':'Temporar'+_0x2f6256(0x2c1)+_0x2f6256(0x237)+_0x2f6256(0x22b)+_0x2f6256(0x32f)+'aw\x202026.'+_0x2f6256(0x346)+_0x2f6256(0x1e0)+_0x2f6256(0x336)+_0x2f6256(0x268)+'ng\x20chann'+_0x2f6256(0x1a7)+'nd\x20helpe'+_0x2f6256(0x20e)+_0x2f6256(0x2d8)+_0x2f6256(0x2fa)+'on\x20futur'+_0x2f6256(0x2f7)+_0x2f6256(0x342)});return;}_0x15135f[_0x2f6256(0x265)+'ogger']?.[_0x2f6256(0x1f9)]?.(_0x2f6256(0x30d)+_0x2f6256(0x2ed)+'untime\x20p'+_0x2f6256(0x2c5)+_0x2f6256(0x234)+_0x2f6256(0x184)+_0x2f6256(0x1da)+_0x2f6256(0x2da),{'openclawVersion':_0x42c939[_0x2f6256(0x17d)+'Version']});}async function patchSessionStoreSqliteRuntime(_0x2cc63b,_0x19615a,_0x49d0d3={}){const _0x524507=_0x38e6be,_0x39013b=resolve(_0x2cc63b,_0x19615a[_0x524507(0x17d)+_0x524507(0x23d)+'ir']),_0x69f08d=join(_0x39013b,'dist'),_0x20693b=_0x524507(0x1b6)+_0x524507(0x2bd)+_0x524507(0x1b2)+'ions/run'+'time-bri'+_0x524507(0x26a),_0x10cb9a=join(_0x2cc63b,_0x524507(0x34d)+'ntime',_0x524507(0x1d5),_0x524507(0x33f)+_0x524507(0x2b9)+'js'),_0xc0634a=(await readdir(_0x69f08d,{'withFileTypes':!![]})[_0x524507(0x2dc)](()=>[]))[_0x524507(0x28d)](_0x56c271=>_0x56c271[_0x524507(0x1d4)]()&&_0x56c271[_0x524507(0x1ec)][_0x524507(0x20b)+'th'](_0x524507(0x1b4)+_0x524507(0x182))&&_0x56c271[_0x524507(0x1ec)]['endsWith'](_0x524507(0x24a)))[_0x524507(0x2ad)](_0x591e6c=>join(_0x69f08d,_0x591e6c['name'])),_0x4f892e=(await readdir(_0x69f08d,{'withFileTypes':!![]})[_0x524507(0x2dc)](()=>[]))[_0x524507(0x28d)](_0x44246b=>_0x44246b['isFile']()&&_0x44246b[_0x524507(0x1ec)][_0x524507(0x20b)+'th'](_0x524507(0x2f4))&&!_0x44246b[_0x524507(0x1ec)][_0x524507(0x20b)+'th'](_0x524507(0x1b4)+'ad-')&&_0x44246b[_0x524507(0x1ec)][_0x524507(0x32b)]('.js'))['map'](_0x4444e6=>join(_0x69f08d,_0x4444e6[_0x524507(0x1ec)]));if(!existsSync(_0x10cb9a)){_0x49d0d3[_0x524507(0x265)+_0x524507(0x294)]?.[_0x524507(0x204)]?.(_0x524507(0x17e)+_0x524507(0x19e)+_0x524507(0x1db)+'ch\x20skipp'+_0x524507(0x337)+_0x524507(0x368)+'vailable',{'bridgePath':_0x10cb9a,'openclawVersion':_0x19615a[_0x524507(0x17d)+_0x524507(0x34e)]});return;}for(const _0xfa2150 of _0xc0634a){const _0x1a1a4c=await readFile(_0xfa2150,_0x524507(0x206)),_0x3725ba=patchSessionStoreLoadFromSource(_0x1a1a4c,{'bridgeImportPath':_0x20693b});if(!_0x3725ba[_0x524507(0x332)]){if(_0x3725ba[_0x524507(0x303)]===_0x524507(0x341)+_0x524507(0x332)){_0x49d0d3['runtimeL'+_0x524507(0x294)]?.['info']?.(_0x524507(0x17e)+_0x524507(0x1a6)+_0x524507(0x276)+_0x524507(0x28b)+_0x524507(0x316),{'filePath':_0xfa2150,'openclawVersion':_0x19615a[_0x524507(0x17d)+'Version']});break;}continue;}await writeFile(_0xfa2150,_0x3725ba[_0x524507(0x351)],_0x524507(0x206)),_0x49d0d3[_0x524507(0x265)+'ogger']?.[_0x524507(0x204)]?.(_0x524507(0x17e)+_0x524507(0x1a6)+_0x524507(0x276)+'\x20applied',{'filePath':_0xfa2150,'openclawVersion':_0x19615a[_0x524507(0x17d)+'Version']});break;}for(const _0x3eaf51 of _0x4f892e){const _0x58b41c=await readFile(_0x3eaf51,_0x524507(0x206)),_0x55045f=patchSessionStoreWriteFromSource(_0x58b41c,{'bridgeImportPath':_0x20693b});if(!_0x55045f[_0x524507(0x332)]){if(_0x55045f[_0x524507(0x303)]==='already-'+_0x524507(0x332)){_0x49d0d3[_0x524507(0x265)+_0x524507(0x294)]?.[_0x524507(0x204)]?.('session\x20'+'store\x20wr'+_0x524507(0x225)+'h\x20alread'+'y\x20applie'+'d',{'filePath':_0x3eaf51,'openclawVersion':_0x19615a[_0x524507(0x17d)+'Version']});break;}continue;}await writeFile(_0x3eaf51,_0x55045f[_0x524507(0x351)],_0x524507(0x206)),_0x49d0d3[_0x524507(0x265)+'ogger']?.['info']?.(_0x524507(0x17e)+_0x524507(0x1ad)+_0x524507(0x225)+_0x524507(0x25a)+'d',{'filePath':_0x3eaf51,'openclawVersion':_0x19615a[_0x524507(0x17d)+'Version']});break;}}async function resolveRuntimeChannelImportPath(_0x41f7f1,_0x1e4721){const _0x2d0397=_0x38e6be,_0x5f301d=_0x1e4721[_0x2d0397(0x28d)](_0x13c8d2=>_0x13c8d2[_0x2d0397(0x1d4)]()&&_0x13c8d2[_0x2d0397(0x1ec)][_0x2d0397(0x20b)+'th'](_0x2d0397(0x33f)+_0x2d0397(0x247))&&_0x13c8d2['name'][_0x2d0397(0x32b)]('.js')&&!_0x13c8d2[_0x2d0397(0x1ec)][_0x2d0397(0x20b)+'th']('runtime-'+_0x2d0397(0x247)+_0x2d0397(0x1e5)))[_0x2d0397(0x2ad)](_0x11ac83=>_0x11ac83[_0x2d0397(0x1ec)])['sort']();for(const _0x38f8ce of _0x5f301d){const _0x3c6173=await readFile(join(_0x41f7f1,_0x38f8ce),_0x2d0397(0x206));if(_0x3c6173[_0x2d0397(0x262)](_0x2d0397(0x18c)+_0x2d0397(0x363)+_0x2d0397(0x30f)))return'./'+_0x38f8ce;}return null;}function normalizeRuntimeRelativePath(_0x30e55c){return _0x30e55c['replaceA'+'ll']('\x5c','/');}function toWindowsPath(_0x3148a4){const _0x3c3e1a=_0x38e6be;return _0x3148a4[_0x3c3e1a(0x275)+'ll']('/','\x5c');}function validateRuntimeNodeVersion(_0x2e0633,_0x5a71b8){const _0x1f197e=_0x38e6be;if(_0x2e0633[_0x1f197e(0x2b1)+_0x1f197e(0x196)]===_0x5a71b8['openclaw'][_0x1f197e(0x2b1)+'ion'])return;throw new Error(_0x1f197e(0x28f)+'nodeVers'+_0x1f197e(0x313)+'atch:\x20ma'+_0x1f197e(0x194)+(_0x2e0633['nodeVers'+_0x1f197e(0x196)]||_0x1f197e(0x35f))+(_0x1f197e(0x190)+_0x1f197e(0x240))+_0x5a71b8[_0x1f197e(0x17d)][_0x1f197e(0x2b1)+'ion']+'.\x20'+(_0x1f197e(0x197)+_0x1f197e(0x199)+_0x1f197e(0x311)+_0x1f197e(0x320)+_0x1f197e(0x2d7)+'\x20runtime'+_0x1f197e(0x22d)+'rebuilt\x20'+_0x1f197e(0x213)+_0x1f197e(0x20c)+'red\x20Node'+'\x20version'+'.'));}function validateRuntimeOpenClawVersion(_0x2d41cd,_0x5a3215){const _0x58f8e0=_0x38e6be;if(_0x2d41cd[_0x58f8e0(0x17d)+'Version']===_0x5a3215['openclaw']['openclaw'+'Version'])return;throw new Error(_0x58f8e0(0x28f)+'openclaw'+'Version\x20'+'mismatch'+':\x20manife'+_0x58f8e0(0x1ae)+(_0x2d41cd[_0x58f8e0(0x17d)+_0x58f8e0(0x34e)]||_0x58f8e0(0x35f))+(',\x20shell.'+_0x58f8e0(0x240))+_0x5a3215[_0x58f8e0(0x17d)][_0x58f8e0(0x17d)+_0x58f8e0(0x34e)]+'.\x20'+(_0x58f8e0(0x197)+_0x58f8e0(0x199)+_0x58f8e0(0x311)+_0x58f8e0(0x320)+_0x58f8e0(0x2d6)+_0x58f8e0(0x1a1)+_0x58f8e0(0x24b)+_0x58f8e0(0x20c)+_0x58f8e0(0x26b)+_0x58f8e0(0x19d)+_0x58f8e0(0x333)));}function parseNpmPackJson(_0x5e2077){const _0xe87093=_0x38e6be,_0x4fe91e=_0x5e2077[_0xe87093(0x339)](),_0x43e635=_0x4fe91e[_0xe87093(0x263)]('[');if(_0x43e635<0x0)throw new Error(_0xe87093(0x2f6)+'\x20did\x20not'+_0xe87093(0x22a)+_0xe87093(0x26f)+_0x4fe91e[_0xe87093(0x29b)](0x0,0x1f4));const _0x5c18ed=JSON['parse'](_0x4fe91e['slice'](_0x43e635)),_0x39409c=Array['isArray'](_0x5c18ed)?_0x5c18ed[0x0]:_0x5c18ed;if(!_0x39409c||typeof _0x39409c!==_0xe87093(0x2df))throw new Error(_0xe87093(0x2f6)+_0xe87093(0x34b)+_0xe87093(0x251)+_0xe87093(0x307)+_0xe87093(0x1c5)+_0x4fe91e[_0xe87093(0x29b)](0x0,0x1f4));return _0x39409c;}function normalizePackedTarballFilename(_0x1fe01d){const _0x410471=_0x38e6be;return _0x1fe01d[_0x410471(0x1dd)](/^@/,'')['replaceA'+'ll']('/','-')[_0x410471(0x275)+'ll']('\x5c','-');}async function runProcess(_0x5a39a2,_0x128a55,_0x3d4efc={}){const _0x292557=_0x38e6be,_0x37a41f=_0x3d4efc[_0x292557(0x2f9)]||[_0x5a39a2,..._0x128a55][_0x292557(0x27a)]('\x20'),_0x45f0ab=_0x3d4efc[_0x292557(0x1ff)+'s']??NPM_INSTALL_TIMEOUT_MS,_0x5d6c10=spawn(_0x5a39a2,_0x128a55,{'cwd':_0x3d4efc[_0x292557(0x2b4)],'env':_0x3d4efc['env'],'stdio':['ignore','pipe',_0x292557(0x21c)]});return await new Promise((_0x4c12f5,_0x4a1929)=>{const _0x4a4975=_0x292557;let _0x144eb4='',_0x48d407='',_0x48816a=![];const _0x5d33a4=setTimeout(()=>{const _0x293ac2=_0xfe4b;if(_0x48816a)return;_0x48816a=!![],_0x5d6c10['kill'](_0x293ac2(0x1c7)),_0x4a1929(new Error(_0x37a41f+(_0x293ac2(0x192)+_0x293ac2(0x24f)+'\x20')+_0x45f0ab+'ms'));},_0x45f0ab);_0x5d6c10[_0x4a4975(0x2b8)]['on'](_0x4a4975(0x22e),_0x2a06a8=>{_0x144eb4+=_0x2a06a8['toString']();}),_0x5d6c10[_0x4a4975(0x293)]['on'](_0x4a4975(0x22e),_0x45bf6f=>{const _0x4d758e=_0x4a4975;_0x48d407+=_0x45bf6f[_0x4d758e(0x1a4)]();}),_0x5d6c10['on']('error',_0x10ad78=>{if(_0x48816a)return;_0x48816a=!![],clearTimeout(_0x5d33a4),_0x4a1929(_0x10ad78);}),_0x5d6c10['on']('close',(_0x3804fe,_0x3da4a7)=>{const _0x87d6ca=_0x4a4975;if(_0x48816a)return;_0x48816a=!![],clearTimeout(_0x5d33a4);if(_0x3804fe===0x0){_0x4c12f5({'stdout':_0x144eb4,'stderr':_0x48d407});return;}_0x4a1929(new Error(_0x37a41f+('\x20failed\x20'+_0x87d6ca(0x292)+'e=')+(_0x3804fe??_0x87d6ca(0x2fc))+_0x87d6ca(0x1fe)+(_0x3da4a7??_0x87d6ca(0x2fc))+'\x0a'+(''+(_0x48d407||_0x144eb4))[_0x87d6ca(0x339)]()));});});}async function installOpenClawPackage(_0x5e3053,_0x410611){const _0x37a52f=_0x38e6be,_0x1edd47=join(_0x5e3053['runtimeR'+_0x37a52f(0x211)],_0x37a52f(0x1bd)),_0x3a1043=join(_0x5e3053[_0x37a52f(0x37c)+_0x37a52f(0x211)],_0x37a52f(0x220)+_0x37a52f(0x223)+'t');await mkdir(_0x1edd47,{'recursive':!![]}),await removePathWithRetries(_0x3a1043),await mkdir(_0x3a1043,{'recursive':!![]});const _0x102311=await createRuntimeEnv(_0x5e3053),_0x460057=_0x37a52f(0x17d)+'@'+_0x410611;console[_0x37a52f(0x1bc)](_0x37a52f(0x347)+'hell:run'+_0x37a52f(0x18f)+_0x37a52f(0x19b)+'\x20'+_0x460057);const _0x377d33=await runProcess(_0x5e3053['nodeExec'+_0x37a52f(0x1ba)],[_0x5e3053[_0x37a52f(0x372)],'pack',_0x460057,_0x37a52f(0x17a)],{'cwd':_0x1edd47,'env':_0x102311,'label':_0x37a52f(0x2f6)+'\x20'+_0x460057}),_0x235843=parseNpmPackJson(_0x377d33['stdout']);if(_0x235843[_0x37a52f(0x2aa)]!==_0x410611)throw new Error(_0x37a52f(0x198)+_0x37a52f(0x2ea)+'law\x20'+_0x410611+(_0x37a52f(0x188)+_0x37a52f(0x17f))+_0x235843[_0x37a52f(0x2aa)]);const _0x5b7870=resolve(_0x1edd47,_0x235843[_0x37a52f(0x253)]);if(!existsSync(_0x5b7870))throw new Error('npm\x20pack'+_0x37a52f(0x2c2)+_0x37a52f(0x343)+_0x37a52f(0x35a)+'\x20'+_0x5b7870);await runProcess('tar',['-xzf',_0x5b7870,'-C',_0x3a1043],{'label':_0x37a52f(0x27b)+_0x235843[_0x37a52f(0x253)]}),await removePathWithRetries(_0x5e3053[_0x37a52f(0x17d)+_0x37a52f(0x23d)+'ir']),await rename(join(_0x3a1043,_0x37a52f(0x2e5)),_0x5e3053[_0x37a52f(0x17d)+_0x37a52f(0x23d)+'ir']),await removePathWithRetries(_0x3a1043),await runProcess(_0x5e3053[_0x37a52f(0x255)+'utable'],[_0x5e3053['npmCli'],'install',_0x37a52f(0x29c)+'ev',_0x37a52f(0x1b3)+_0x37a52f(0x2f3),_0x37a52f(0x270)+'it',_0x37a52f(0x219)+'d',_0x37a52f(0x348)+_0x37a52f(0x1c2)+'ps'],{'cwd':_0x5e3053[_0x37a52f(0x17d)+_0x37a52f(0x23d)+'ir'],'env':_0x102311,'label':_0x37a52f(0x24c)+_0x37a52f(0x32c)+_0x460057+(_0x37a52f(0x2d6)+'\x20depende'+_0x37a52f(0x1a8))});if(!existsSync(_0x5e3053[_0x37a52f(0x17d)+_0x37a52f(0x1c6)]))throw new Error(_0x37a52f(0x322)+'\x20bin\x20was'+_0x37a52f(0x350)+_0x37a52f(0x35e)+'\x20install'+':\x20'+_0x5e3053[_0x37a52f(0x17d)+_0x37a52f(0x1c6)]);}async function ensureRuntimeBase(_0xce9411,_0x11ab48,_0x318371={}){const _0x144b11=_0x38e6be;await mkdir(_0x11ab48,{'recursive':!![]});let _0xafde3=await readRuntimeManifest(_0x11ab48);const _0x33b363=_0xce9411[_0x144b11(0x17d)][_0x144b11(0x2b1)+_0x144b11(0x196)],_0x571353=_0xce9411[_0x144b11(0x17d)]['openclaw'+_0x144b11(0x34e)],_0x4b910c=existsSync(resolveManifestPath(_0x11ab48)),_0x241c05=runtimeHasRequiredPaths(_0x11ab48,_0xafde3),_0x2eda49=_0xafde3[_0x144b11(0x2b1)+_0x144b11(0x196)]===_0x33b363;!_0x4b910c||!_0x241c05||!_0x2eda49?(_0x318371[_0x144b11(0x265)+'ogger']?.[_0x144b11(0x204)](_0x144b11(0x28f)+_0x144b11(0x28c)+'ld\x20start'+'ed',{'runtimeRoot':_0x11ab48,'reason':!_0x4b910c?_0x144b11(0x1fd)+'manifest':!_0x241c05?_0x144b11(0x1fd)+_0x144b11(0x238)+_0x144b11(0x2d6)+_0x144b11(0x1d7):_0x144b11(0x212)+_0x144b11(0x2bf)+'match','syncOnly':_0x318371[_0x144b11(0x229)]}),_0xafde3=await buildRuntimeBase(_0xce9411,_0x11ab48,_0xafde3),_0x318371[_0x144b11(0x265)+'ogger']?.[_0x144b11(0x204)](_0x144b11(0x28f)+_0x144b11(0x28c)+'ld\x20compl'+_0x144b11(0x334),{'manifest':summarizeRuntimeManifest(_0xafde3)})):_0x318371[_0x144b11(0x265)+_0x144b11(0x294)]?.[_0x144b11(0x204)](_0x144b11(0x28f)+_0x144b11(0x17b)+_0x144b11(0x250)+_0x144b11(0x230),{'manifest':summarizeRuntimeManifest(_0xafde3)});if(!existsSync(resolve(_0x11ab48,_0xafde3[_0x144b11(0x17d)+_0x144b11(0x1c6)]))){const _0x4061a8=createRuntimeInfoFromManifest(_0x11ab48,_0xafde3,{'allowMissingOpenClaw':!![]});await installOpenClawPackage(_0x4061a8,_0x571353),_0xafde3['openclaw'+_0x144b11(0x34e)]=_0x571353;}return _0xafde3;}function runtimeHasRequiredPaths(_0x383cf9,_0x10c555){const _0x585874=_0x38e6be;return[_0x585874(0x255)+_0x585874(0x1ba),_0x585874(0x372),_0x585874(0x17d)+_0x585874(0x23d)+'ir','openclaw'+'Bin'][_0x585874(0x349)](_0x26d819=>typeof _0x10c555[_0x26d819]==='string'&&_0x10c555[_0x26d819][_0x585874(0x339)]())&&[_0x585874(0x255)+_0x585874(0x1ba),'npmCli'][_0x585874(0x349)](_0x2693bd=>existsSync(resolve(_0x383cf9,_0x10c555[_0x2693bd])));}async function buildRuntimeBase(_0x453ddb,_0x128762,_0x11aaf6={}){const _0x2d82d4=_0x38e6be,_0x2d0cfd=join(_0x128762,_0x2d82d4(0x193));await ensureRuntimeNode(_0x453ddb,_0x2d0cfd);const _0x28c572={..._0x11aaf6,'generatedAt':new Date()[_0x2d82d4(0x2d3)+'ing'](),'nodeVersion':_0x453ddb[_0x2d82d4(0x17d)][_0x2d82d4(0x2b1)+_0x2d82d4(0x196)],'openclawVersion':_0x11aaf6['openclaw'+_0x2d82d4(0x34e)]||'','platform':process['platform'],'arch':process[_0x2d82d4(0x1b5)],'nodeExecutable':'node/bin'+_0x2d82d4(0x214),'npmCli':_0x2d82d4(0x2a6)+'/node_mo'+_0x2d82d4(0x180)+_0x2d82d4(0x1af)+_0x2d82d4(0x291),'openclawWorkingDir':'openclaw','openclawBin':_0x2d82d4(0x17d)+_0x2d82d4(0x33e)+_0x2d82d4(0x18e)};return await writeJson(resolveManifestPath(_0x128762),_0x28c572),_0x28c572;}async function removePathWithRetries(_0x3b847f){await rm(_0x3b847f,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96});}async function ensureRuntimeNode(_0x4cbb1c,_0x27b31f){const _0x3433b4=_0x38e6be,_0x4b091b=_0x4cbb1c[_0x3433b4(0x17d)]['nodeVers'+_0x3433b4(0x196)],_0x19abd9=join(_0x27b31f,'bin',_0x3433b4(0x193)),_0x4bf057=join(_0x27b31f,'lib',_0x3433b4(0x329)+'ules',_0x3433b4(0x318),_0x3433b4(0x1c9),'npm-cli.'+'js');if(existsSync(_0x19abd9)&&existsSync(_0x4bf057)&&await getNodeVersion(_0x19abd9)===_0x4b091b)return;await removePathWithRetries(_0x27b31f);if(process[_0x3433b4(0x1bf)][_0x3433b4(0x193)]===_0x4b091b){await linkCurrentNodeRuntime(_0x27b31f);return;}await downloadNodeRuntime(_0x4b091b,_0x27b31f);}async function getNodeVersion(_0x486f75){const _0x5a39e5=_0x38e6be;try{const _0xb02576=await runProcess(_0x486f75,['-p','process.'+_0x5a39e5(0x1bf)+_0x5a39e5(0x242)],{'label':_0x486f75+_0x5a39e5(0x1d8),'timeoutMs':0x7530});return _0xb02576['stdout'][_0x5a39e5(0x339)]();}catch{return'';}}async function linkCurrentNodeRuntime(_0x302a9e){const _0x12f54b=_0x38e6be,_0x37131c=process[_0x12f54b(0x2ac)],_0x51719d=resolve(dirname(_0x37131c),'..'),_0x4ea42d=resolve(_0x51719d,_0x12f54b(0x20a)+_0x12f54b(0x37e)+_0x12f54b(0x328)),_0x24fe95=join(_0x302a9e,_0x12f54b(0x1c9),_0x12f54b(0x193)),_0x1a690d=join(_0x302a9e,_0x12f54b(0x2f8),'node_mod'+_0x12f54b(0x1fc),'npm');await mkdir(dirname(_0x24fe95),{'recursive':!![]}),await mkdir(dirname(_0x1a690d),{'recursive':!![]}),await symlink(_0x37131c,_0x24fe95),existsSync(_0x4ea42d)?await symlink(_0x4ea42d,_0x1a690d):await symlink(await resolveNpmRoot(),_0x1a690d);}function _0x21fa(){const _0x208dc0=['keys','-extract','in\x20insta','href','404148xKjFhZ','go.mjs','.npmmirr','endencie','.tools','statusCo','isFile','sessions','projectR','\x20paths','\x20version','npm\x20root','solver\x20n','lite\x20pat','#!/bin/s','replace','plugin\x20s','\x22\x20%*','nel\x20plug','llPaths','jie-shel','extract-','cies','state-','\x20set\x20\x22OP','tory\x20pro','s\x20not\x20fo','NCLAW_ST','close','runtime','name','set\x20\x22SCR',';\x20run\x20wu','\x20failed\x20','CRIPT_DI','ugin\x20dep','octor\x20--','patch\x20al','ipped;\x20d','\x20\x22OPENCL','ginPaths','\x20-z\x20\x22$WU','\x22\x20\x22$SCRI','warn','chat\x20his','\x20complet','ules','missing\x20','\x20signal=','timeoutM','wujie-lo','synced','agentSco','leName','info','ing\x20\x22','utf8','claw-run','installP','prepare\x20','lib/node','startsWi','\x20configu','ted','rs;\x20veri','333036bvaUmi','npm-cach','oot','node\x20ver','with\x20the','/node','LocalAge','x64','CONFIG_F','\x20local\x20p','--no-fun','%USERPRO','tory\x20mix','pipe','.json','ced','wnloadin','.opencla','er\x20writt','eady\x20app','w-extrac','tar.xz','ite\x20patc','if\x20[\x20-t\x20','skill','ist\x20not\x20','syncOnly','\x20return\x20','patch\x20fo','NCLAW_HO','\x20can\x20be\x20','data','manifest','rent','st\x20not\x20f','t\x20\x22OPENC','\x20loaded','pped;\x20ru','appId','_shared','ibility\x20','required','untime\x20p','NCLAW_CO','ed-tool\x20','optional','WorkingD','all\x20loca','R=\x22${OPE','config=','node-v','.node','o.mjs\x22\x202','ady\x20curr','skills','time]\x20fe','channel-','w.cmd','\x20and\x20','.js','tall\x20the','npm\x20inst','FIG_FILE','error','ut\x20after','eady\x20cur','d\x20an\x20inv','e\x20tools\x20','filename','_HOME:-','nodeExec','headers','configFi','fix\x20comp','ader\x20not','h\x20applie','spec','r\x20runtim','IPT_DIR=','4924215kLSinh','Invalid\x20','platform','dataDirN','includes','indexOf','pec:\x20','runtimeL','sets/wuj','now','me\x20missi','dist','dge.mjs','red\x20Open','resume','_NAME:-','tool\x20his','JSON:\x20','--no-aud','or.com','time]\x20ru','s\x20instal','HOME=\x22${','replaceA','ad\x20patch','install','path','%~dp0\x22','join','extract\x20','und:\x20','runtimeS','fix','set\x20\x22OPE','ream\x20fix','y:\x20','1062442gtaSEC','ATH:-','ENCLAW_H','1\x20]\x20&&\x20[','\x20written','annel\x20en','index.mj','local:','120npNFfS','\x20already','base\x20bui','filter','win32','runtime\x20','ame','m-cli.js','with\x20cod','stderr','ogger','6\x20mixed\x20','\x20kdocs\x20s','split','dencies','&&\x20pwd)','ATE_DIR%','slice','--omit=d','NFIG_PAT','tar','wujieai.','hell:run','registry','\x20\x20\x22$SCRI','-xzf','dAt','tools\x20sy','node/lib','ATH=\x20cd\x20','prepareP','aw\x202026.','version','ath','execPath','map','package.','nced','jection\x20','nodeVers','=\x22${OPEN','NFIG_FIL','cwd','OPENCLAW','H%\x22==\x22\x22\x20','$HOME/','stdout','bridge.m','time-too','time]\x20do','\x20on\x20futu','ell-runt','jection-','sion\x20mis','LocalPlu','y\x20compat','\x20did\x20not','_DIR%','plugins\x20','atch\x20ski','Unable\x20t','CONFIG_P','ntPaths','empty\x20pl','\x20id\x20from','integrit','10sgQSmQ','env','?t=','PT_DIR/','==\x22\x22\x20set','productN','all\x20plug','toISOStr','local\x20pl','isArray','\x20runtime','\x20product','fy\x20upstr','product','ot\x20found','\x20doctor\x20','catch','scripts','341560oYfxVE','object','PENCLAW_','dependen','ll\x20prepa','configPa','zip','package','ujie-log','has','l\x20plugin','allowMis','ed\x20OpenC','wujiecla','export\x20O','plugin\x20r','configur','led','scoped\x20s','re\x22\x20to\x20r','st\x20be\x20a\x20','eer','store-','ATE_DIR:','npm\x20pack','e\x20upgrad','lib','label','eam\x20fix\x20','ed\x20npm\x20p','null','started','@echo\x20of','failed','string','ify\x20upst','devDepen','reason','json','OME=','if\x20\x22%OPE','alid\x20pay','fix\x20alre','wBin','not\x20foun','ntime','connecto','channel\x20','skipped;','nnel','https://','\x20prepare','agents','ion\x20mism','singOpen','flush','\x20applied','Spec','npm','lugin\x20de','length','../../as','ile\x20not\x20','\x20started','ynced','lugin\x20','\x22\x20so\x20the','ipped;\x20f','OpenClaw','ie-logo.','roductRu','\x22\x20\x22%SCRI','\x22\x20\x22$@\x22','kill\x20not','/npm','node_mod','859747kYJUzn','endsWith','all\x20','d:\x20','time','r\x20OpenCl','leted','8yWrndR','patched','sion.','eted','chat-dis','in\x20runti','ed;\x20brid','\x20-g','trim','E_DIR=','rname\x20--','\x20path\x20mu','lark-cli','/opencla','runtime-','product\x20','already-','es.','\x20create\x20','des.','location','6.6\x20chan','[wujie-s','--legacy','every','d\x20for\x20lo','\x20returne','6858990JiWBoS','shell-ru','Version','\x20\x22$0\x22)\x22\x20','\x20not\x20fou','source','doctor','function','nodejs.o','.\x20Run\x20\x22w','\x22%SCRIPT','cal\x20runt','\x20validat','pluginId','tarball:','pendenci','bug;\x20ver','es\x20','nd\x20after','unknown','red','-xJf','penClaw\x20','ntimeCha','play-pro','runtime:','tateDir','exec\x20\x22$S','ge\x20not\x20a','.tmp/run','fix\x20mark','isDirect','npm-cli.','some','extensio','lled','values','\x20found','npmCli','ujie-she','unction\x20','in\x20','--\x20\x22$(di','\x20entry\x20\x22','root','tching\x20p','agents\x20s','Dependen','runtimeR','pped;\x20di','_modules','@larksui','-doctor.','ugin\x20spe','pluginSp','cli','atch\x20alr','--json','base\x20alr','ing','openclaw','session\x20','d\x20to\x20','dules/np','ent','ad-','entryCou','ntime\x20re','mjs','>/dev/nu','--fix','\x20resolve','idated','.plugin-','ound','createRu','g\x20from\x20O','w.mjs','time]\x20in',',\x20shell.','lied','\x20timed\x20o','node','nifest=','add','ion','Run\x20\x22wuj','Configur','ie-shell','download','stalling','Name','Claw\x20ver','store\x20sq','STATE_DI','find','\x20can\x20ins','ready\x20ap','FILE%\x5c','toString','Claw','store\x20lo','el.inbou','ncies','generate','ecs','director','\x20install','store\x20wr','st=','m/bin/np','pped;\x20lo','push','ime/sess','--omit=p','store-lo','arch','../../sh','plied','\x22==\x22\x22\x20se','kill','utable','found','log','.cache','plugins','versions','local','resolved','-peer-de','\x20package','LocalSki','load:\x20','Bin','SIGTERM','enclaw\x20d','bin'];_0x21fa=function(){return _0x208dc0;};return _0x21fa();}async function resolveNpmRoot(){const _0x290707=_0x38e6be,_0x5db604=await runProcess(_0x290707(0x318),[_0x290707(0x378),'-g'],{'label':_0x290707(0x1d9)+_0x290707(0x338),'timeoutMs':0x7530}),_0x4ae1e5=join(_0x5db604[_0x290707(0x2b8)][_0x290707(0x339)](),_0x290707(0x318));if(!existsSync(join(_0x4ae1e5,_0x290707(0x1c9),_0x290707(0x36c)+'js')))throw new Error(_0x290707(0x2f6)+'age\x20was\x20'+'not\x20foun'+_0x290707(0x34a)+_0x290707(0x357)+'ime\x20buil'+_0x290707(0x32d)+_0x4ae1e5);return _0x4ae1e5;}async function downloadNodeRuntime(_0x4a36c1,_0x228edb){const _0x49182f=_0x38e6be,_0x3327a3=process[_0x49182f(0x260)]==='win32'?'win':process['platform'],_0x234b4b=process[_0x49182f(0x1b5)]===_0x49182f(0x216)?_0x49182f(0x216):process[_0x49182f(0x1b5)]==='arm64'?'arm64':process[_0x49182f(0x1b5)],_0x3bb539=process['platform']===_0x49182f(0x28e)?_0x49182f(0x2e4):_0x49182f(0x224),_0x4c8eb6=_0x49182f(0x241)+_0x4a36c1+'-'+_0x3327a3+'-'+_0x234b4b,_0x49adf5=_0x4c8eb6+'.'+_0x3bb539,_0x2af144=join(dirname(_0x228edb),_0x49182f(0x1bd)),_0x20d65d=join(_0x2af144,_0x49adf5),_0x3fadd2=join(_0x2af144,_0x4c8eb6+(_0x49182f(0x1cb)+'-')+process['pid']+'-'+Date[_0x49182f(0x267)]()),_0x1afac6=_0x49182f(0x310)+_0x49182f(0x354)+'rg/dist/'+'v'+_0x4a36c1+'/'+_0x49adf5;await mkdir(_0x2af144,{'recursive':!![]}),!existsSync(_0x20d65d)&&(console[_0x49182f(0x1bc)](_0x49182f(0x347)+_0x49182f(0x2a0)+_0x49182f(0x2bb)+_0x49182f(0x21f)+'g\x20'+_0x1afac6),await downloadFile(_0x1afac6,_0x20d65d)),await rm(_0x3fadd2,{'recursive':!![],'force':!![]}),await mkdir(_0x3fadd2,{'recursive':!![]}),process[_0x49182f(0x260)]==='win32'?await runProcess('unzip',['-q',_0x20d65d,'-d',_0x3fadd2],{'label':_0x49182f(0x27b)+_0x49adf5}):await runProcess(_0x49182f(0x29e),[_0x49182f(0x361),_0x20d65d,'-C',_0x3fadd2],{'label':_0x49182f(0x27b)+_0x49adf5}),await rename(join(_0x3fadd2,_0x4c8eb6),_0x228edb),await rm(_0x3fadd2,{'recursive':!![],'force':!![]});}async function downloadFile(_0x93912e,_0x1603b7){await mkdir(dirname(_0x1603b7),{'recursive':!![]});const _0x268af6=await new Promise((_0x5f4333,_0x2436e0)=>{get(_0x93912e,_0x25a0e1=>{const _0x3baebd=_0xfe4b;if(_0x25a0e1[_0x3baebd(0x1d3)+'de']>=0x12c&&_0x25a0e1[_0x3baebd(0x1d3)+'de']<0x190&&_0x25a0e1[_0x3baebd(0x256)]['location']){_0x25a0e1[_0x3baebd(0x26c)](),downloadFile(new URL(_0x25a0e1[_0x3baebd(0x256)][_0x3baebd(0x345)],_0x93912e)[_0x3baebd(0x1cd)],_0x1603b7)['then'](()=>_0x5f4333(null))['catch'](_0x2436e0);return;}if(_0x25a0e1[_0x3baebd(0x1d3)+'de']!==0xc8){_0x25a0e1[_0x3baebd(0x26c)](),_0x2436e0(new Error(_0x3baebd(0x19a)+_0x3baebd(0x1ef)+_0x25a0e1[_0x3baebd(0x1d3)+'de']+':\x20'+_0x93912e));return;}_0x5f4333(_0x25a0e1);})['on']('error',_0x2436e0);});_0x268af6&&await pipeline(_0x268af6,createWriteStream(_0x1603b7));}export async function ensureOpenClawDoctorFixed(_0x23f52c,_0x503b65={}){const _0x47503c=_0x38e6be,_0x1f8029=await loadRuntimeInfo(_0x23f52c[_0x47503c(0x1d6)+_0x47503c(0x211)]),_0x3e56d7=getConfigPaths(_0x23f52c),_0x17c976=join(_0x3e56d7[_0x47503c(0x27d)+_0x47503c(0x366)],_0x47503c(0x17d)+_0x47503c(0x175)+_0x47503c(0x304)),_0x73d80e=await readJson(_0x17c976,{});if(_0x73d80e[_0x47503c(0x17d)+_0x47503c(0x34e)]===_0x1f8029[_0x47503c(0x17d)+_0x47503c(0x34e)])return _0x503b65[_0x47503c(0x265)+_0x47503c(0x294)]?.[_0x47503c(0x204)]('openclaw'+_0x47503c(0x2db)+_0x47503c(0x308)+_0x47503c(0x244)+_0x47503c(0x181),{'openclawVersion':_0x1f8029[_0x47503c(0x17d)+'Version'],'markerPath':_0x17c976}),{'ran':![],'openclawVersion':_0x1f8029[_0x47503c(0x17d)+_0x47503c(0x34e)],'markerPath':_0x17c976};return await runOpenClawDoctorFix(_0x23f52c,_0x1f8029,{'fromVersion':_0x73d80e[_0x47503c(0x17d)+_0x47503c(0x34e)]||_0x47503c(0x35f),'toVersion':_0x1f8029[_0x47503c(0x17d)+_0x47503c(0x34e)],'markerPath':_0x17c976,'runtimeLogger':_0x503b65['runtimeL'+_0x47503c(0x294)]}),{'ran':!![],'openclawVersion':_0x1f8029[_0x47503c(0x17d)+_0x47503c(0x34e)],'markerPath':_0x17c976};}async function runOpenClawDoctorFix(_0x3d7622,_0x11156d,{fromVersion:_0x1aa05c,toVersion:_0x2906f6,markerPath:markerPath='',runtimeLogger:_0x573c83}={}){const _0xf4d6c5=_0x38e6be;_0x573c83?.[_0xf4d6c5(0x204)](_0xf4d6c5(0x17d)+_0xf4d6c5(0x2db)+'fix\x20star'+_0xf4d6c5(0x20d),{'fromVersion':_0x1aa05c,'toVersion':_0x2906f6});const _0x2531ff=await createRuntimeEnv(_0x11156d,{'OPENCLAW_HOME':_0x3d7622['dataDir'],'OPENCLAW_STATE_DIR':_0x3d7622['dataDir'],'OPENCLAW_CONFIG_PATH':getConfigPaths(_0x3d7622)[_0xf4d6c5(0x2e3)+'th']});console[_0xf4d6c5(0x1bc)](_0xf4d6c5(0x347)+_0xf4d6c5(0x2a0)+_0xf4d6c5(0x272)+'nning\x20op'+_0xf4d6c5(0x1c8)+_0xf4d6c5(0x1f2)+_0xf4d6c5(0x27e));const _0xd0f901=await runProcess(_0x11156d[_0xf4d6c5(0x255)+'utable'],[_0x11156d[_0xf4d6c5(0x17d)+_0xf4d6c5(0x1c6)],_0xf4d6c5(0x352),_0xf4d6c5(0x187)],{'cwd':_0x11156d['openclaw'+_0xf4d6c5(0x23d)+'ir'],'env':_0x2531ff,'label':_0xf4d6c5(0x17d)+'\x20doctor\x20'+_0xf4d6c5(0x187),'timeoutMs':0x1d4c0});_0x573c83?.[_0xf4d6c5(0x204)](_0xf4d6c5(0x17d)+_0xf4d6c5(0x2db)+_0xf4d6c5(0x258)+_0xf4d6c5(0x330),{'fromVersion':_0x1aa05c,'toVersion':_0x2906f6,'stdout':_0xd0f901[_0xf4d6c5(0x2b8)][_0xf4d6c5(0x339)]()[_0xf4d6c5(0x29b)](-0xfa0),'stderr':_0xd0f901[_0xf4d6c5(0x293)]['trim']()[_0xf4d6c5(0x29b)](-0xfa0)}),markerPath&&(await writeJson(markerPath,{'openclawVersion':_0x11156d[_0xf4d6c5(0x17d)+_0xf4d6c5(0x34e)],'fixedAt':new Date()[_0xf4d6c5(0x2d3)+_0xf4d6c5(0x17c)]()}),_0x573c83?.[_0xf4d6c5(0x204)]('openclaw'+_0xf4d6c5(0x2db)+_0xf4d6c5(0x36a)+_0xf4d6c5(0x221)+'en',{'markerPath':markerPath,'openclawVersion':_0x11156d[_0xf4d6c5(0x17d)+'Version']}));}export async function readRuntimeManifest(_0x3f8880){return await readJson(resolveManifestPath(_0x3f8880),{});}export async function loadRuntimeInfo(_0x107700){const _0x829341=resolveRuntimeRoot(_0x107700),_0x327e99=await readRuntimeManifest(_0x829341);return createRuntimeInfoFromManifest(_0x829341,_0x327e99);}function createRuntimeInfoFromManifest(_0x85b8b8,_0xc18396,_0x5ee6a5={}){const _0x2838e6=_0x38e6be;for(const _0x20a6ce of[_0x2838e6(0x255)+'utable',_0x2838e6(0x372),'openclaw'+_0x2838e6(0x23d)+'ir',_0x2838e6(0x17d)+'Bin']){if(typeof _0xc18396[_0x20a6ce]!==_0x2838e6(0x300)||!_0xc18396[_0x20a6ce][_0x2838e6(0x339)]())throw new Error(_0x2838e6(0x28f)+'manifest'+'\x20is\x20miss'+_0x2838e6(0x205)+_0x20a6ce+'\x22\x20at\x20'+resolveManifestPath(_0x85b8b8)+(_0x2838e6(0x1ee)+_0x2838e6(0x1e2)+'l\x20prepar'+'e'));}const _0x5282ec=resolve(_0x85b8b8,_0xc18396[_0x2838e6(0x255)+_0x2838e6(0x1ba)]),_0x21474b=resolve(_0x85b8b8,_0xc18396['npmCli']),_0x1ecf02=resolve(_0x85b8b8,_0xc18396[_0x2838e6(0x17d)+'WorkingD'+'ir']),_0x11991e=resolve(_0x85b8b8,_0xc18396['openclaw'+_0x2838e6(0x1c6)]),_0x3cc6e6=Array[_0x2838e6(0x2d5)](_0xc18396[_0x2838e6(0x1be)])?_0xc18396[_0x2838e6(0x1be)][_0x2838e6(0x2ad)](_0x2eab23=>({..._0x2eab23,'installPath':resolve(_0x85b8b8,_0x2eab23[_0x2838e6(0x208)+_0x2838e6(0x2ab)])})):[],_0x43f11f=_0x5ee6a5[_0x2838e6(0x2e9)+_0x2838e6(0x314)+_0x2838e6(0x1a5)]?[_0x5282ec,_0x21474b]:[_0x5282ec,_0x21474b,_0x1ecf02,_0x11991e];for(const _0x19b5aa of _0x43f11f){if(!existsSync(_0x19b5aa))throw new Error(_0x2838e6(0x28f)+'missing\x20'+'path:\x20'+_0x19b5aa);}return{'runtimeRoot':_0x85b8b8,'manifest':_0xc18396,'openclawVersion':_0xc18396[_0x2838e6(0x17d)+_0x2838e6(0x34e)]||_0x2838e6(0x35f),'nodeExecutable':_0x5282ec,'npmCli':_0x21474b,'openclawWorkingDir':_0x1ecf02,'openclawBin':_0x11991e,'plugins':_0x3cc6e6};}export async function spawnClaw(_0x4f4b9a,_0x4db3ad=[],_0x5d83e1={}){const _0x36a11c=_0x38e6be,_0x1b73f4=await loadRuntimeInfo(_0x4f4b9a),_0x3b82f5=await createRuntimeEnv(_0x1b73f4,_0x5d83e1[_0x36a11c(0x2cd)]??{});return spawn(_0x1b73f4[_0x36a11c(0x255)+_0x36a11c(0x1ba)],[_0x1b73f4[_0x36a11c(0x17d)+'Bin'],..._0x4db3ad],{'cwd':_0x1b73f4[_0x36a11c(0x17d)+_0x36a11c(0x23d)+'ir'],'stdio':'pipe',..._0x5d83e1,'env':_0x3b82f5});}export async function runClawOnce(_0x256b7c,_0x5c8cc3=[],_0x30abcd=0x15f90){const _0x12e33a=await spawnClaw(_0x256b7c,_0x5c8cc3);return await new Promise((_0x374e05,_0x4f92d0)=>{const _0x48dbf2=_0xfe4b;let _0x9f2622='',_0x4ca82e='',_0xf74d87=![];const _0x2caeb3=setTimeout(()=>{const _0x4eb296=_0xfe4b;if(_0xf74d87)return;_0xf74d87=!![],_0x12e33a[_0x4eb296(0x1b9)](_0x4eb296(0x1c7)),_0x4f92d0(new Error(_0x4eb296(0x17d)+_0x4eb296(0x192)+_0x4eb296(0x24f)+'\x20'+_0x30abcd+'ms'));},_0x30abcd);_0x12e33a[_0x48dbf2(0x2b8)]['on'](_0x48dbf2(0x22e),_0x5cedea=>{const _0x51a9d8=_0x48dbf2;_0x9f2622+=_0x5cedea[_0x51a9d8(0x1a4)]();}),_0x12e33a['stderr']['on']('data',_0x4f44b8=>{_0x4ca82e+=_0x4f44b8['toString']();}),_0x12e33a['on'](_0x48dbf2(0x24e),_0x2b4c2b=>{if(_0xf74d87)return;_0xf74d87=!![],clearTimeout(_0x2caeb3),_0x4f92d0(_0x2b4c2b);}),_0x12e33a['on'](_0x48dbf2(0x1ea),(_0x182bd8,_0x206ebf)=>{if(_0xf74d87)return;_0xf74d87=!![],clearTimeout(_0x2caeb3),_0x374e05({'code':_0x182bd8,'signal':_0x206ebf,'stdout':_0x9f2622,'stderr':_0x4ca82e});});});}async function findRuntimeLarkCliBin(_0x2a149a){const _0x5ab238=_0x38e6be,_0x2ae723=join(_0x2a149a[_0x5ab238(0x17d)+_0x5ab238(0x23d)+'ir'],'node_mod'+_0x5ab238(0x1fc),'@larksui'+'te',_0x5ab238(0x178)),_0x2d30c2=join(_0x2ae723,'package.'+_0x5ab238(0x304));if(!existsSync(_0x2d30c2))return{'packageDir':_0x2ae723,'binPath':null};try{const _0x40c781=JSON['parse'](await readFile(_0x2d30c2,_0x5ab238(0x206))),_0x5a461c=typeof _0x40c781[_0x5ab238(0x1c9)]===_0x5ab238(0x300)?_0x40c781[_0x5ab238(0x1c9)]:_0x40c781['bin']&&typeof _0x40c781['bin']===_0x5ab238(0x2df)?_0x40c781[_0x5ab238(0x1c9)][_0x5ab238(0x33d)]||Object[_0x5ab238(0x370)](_0x40c781[_0x5ab238(0x1c9)])[0x0]:'';return{'packageDir':_0x2ae723,'binPath':_0x5a461c?join(_0x2ae723,_0x5a461c):null};}catch{return{'packageDir':_0x2ae723,'binPath':null};}}export async function resolveRuntimeLarkCliCommand(_0x456852){const _0x55a9a3=_0x38e6be,{packageDir:_0x5adeb6,binPath:_0x2ca891}=await findRuntimeLarkCliBin(_0x456852);if(!_0x2ca891||!existsSync(_0x2ca891))throw new Error('Bundled\x20'+_0x55a9a3(0x37f)+'te/cli\x20i'+'s\x20missin'+_0x55a9a3(0x18d)+_0x55a9a3(0x362)+_0x55a9a3(0x365)+'\x20'+_0x5adeb6+(_0x55a9a3(0x355)+_0x55a9a3(0x373)+_0x55a9a3(0x2e2)+_0x55a9a3(0x2f1)+'ebuild\x20t'+'he\x20runti'+'me.'));return{'nodeExecutable':_0x456852[_0x55a9a3(0x255)+_0x55a9a3(0x1ba)],'scriptPath':_0x2ca891,'packageDir':_0x5adeb6};}function resolvePackageNameFromNpmSpec(_0x44512a){const _0x2f53df=_0x38e6be,_0x3d4d9e=_0x44512a['trim']()[_0x2f53df(0x1dd)](/^npm:/,'');if(!_0x3d4d9e)throw new Error(_0x2f53df(0x25f)+_0x2f53df(0x2c9)+_0x2f53df(0x176)+'c');if(_0x3d4d9e['startsWi'+'th']('@')){const _0x541f2d=_0x3d4d9e[_0x2f53df(0x263)]('/');if(_0x541f2d===-0x1)throw new Error(_0x2f53df(0x25f)+_0x2f53df(0x2f0)+_0x2f53df(0x264)+_0x44512a);const _0x192ff5=_0x3d4d9e[_0x2f53df(0x263)]('@',_0x541f2d+0x1);return _0x192ff5===-0x1?_0x3d4d9e:_0x3d4d9e[_0x2f53df(0x29b)](0x0,_0x192ff5);}const _0x1279e2=_0x3d4d9e[_0x2f53df(0x263)]('@');return _0x1279e2===-0x1?_0x3d4d9e:_0x3d4d9e['slice'](0x0,_0x1279e2);}async function createRuntimeEnv(_0x4fa740,_0x219ed5={}){const _0x396f88=_0x38e6be,_0x12cc27=process.env.OPENCLAW_STATE_DIR||'',_0xbbf866=process.env.NPM_CONFIG_REGISTRY||'https://'+_0x396f88(0x2a1)+_0x396f88(0x1d0)+_0x396f88(0x271),_0x5a6692=_0x12cc27?join(_0x12cc27,_0x396f88(0x207)+_0x396f88(0x2ba)+'ls'):join(_0x4fa740['runtimeR'+'oot'],_0x396f88(0x1d2)),_0x4a39f3=join(_0x5a6692,'npm-glob'+'al'),_0x5b8196=join(_0x5a6692,_0x396f88(0x210)+'e'),_0x12cf82=join(_0x4a39f3,_0x396f88(0x1c9));await mkdir(_0x12cf82,{'recursive':!![]}),await mkdir(_0x5b8196,{'recursive':!![]});const _0x242871=[_0x12cf82,dirname(_0x4fa740[_0x396f88(0x255)+'utable']),process.env.PATH||''];return{...process.env,..._0x219ed5,'PATH':_0x242871[_0x396f88(0x28d)](Boolean)[_0x396f88(0x27a)](delimiter),'npm_config_prefix':_0x4a39f3,'NPM_CONFIG_PREFIX':_0x4a39f3,'npm_config_cache':_0x5b8196,'NPM_CONFIG_CACHE':_0x5b8196,'NPM_CONFIG_REGISTRY':_0xbbf866,'npm_execpath':_0x4fa740[_0x396f88(0x372)],'npm_node_execpath':_0x4fa740[_0x396f88(0x255)+'utable'],'OPENCLAW_RUNTIME_NPM_PREFIX':_0x4a39f3,'OPENCLAW_RUNTIME_NPM_BIN':_0x12cf82};}export async function getRuntimeSpawnContext(_0x3c40a3,_0x3f4046={}){const _0x33adb9=_0x38e6be,_0x26af19=await loadRuntimeInfo(_0x3c40a3),_0x3d42b4=await createRuntimeEnv(_0x26af19,_0x3f4046);return{'cwd':_0x26af19[_0x33adb9(0x17d)+_0x33adb9(0x23d)+'ir'],'env':_0x3d42b4,'runtime':_0x26af19};}function resolvePluginDirNameFromSpec(_0x4d0a5c){const _0x34ff7c=_0x38e6be,_0x29e1e7=resolvePackageNameFromNpmSpec(_0x4d0a5c),_0x12988d=_0x29e1e7[_0x34ff7c(0x297)]('/')[_0x34ff7c(0x28d)](Boolean),_0x4e0f1a=_0x12988d['at'](-0x1)??'';if(!_0x4e0f1a)throw new Error('Invalid\x20'+_0x34ff7c(0x1de)+_0x34ff7c(0x264)+_0x4d0a5c);return _0x4e0f1a;}async function resolvePluginIdFromPackageDir(_0x3f0063,_0x224d58){const _0x56598c=_0x38e6be,_0x3e4373=await readJson(join(_0x3f0063,_0x56598c(0x2ae)+_0x56598c(0x304)),{}),_0x291e27=await readPluginManifest(_0x3f0063),_0x4f0681=[_0x291e27?.['id'],_0x291e27?.['pluginId'],_0x291e27?.['name'],_0x3e4373?.[_0x56598c(0x17d)]?.['id'],_0x3e4373?.['openclaw'+'Id'],_0x224d58],_0x3a6b69=_0x4f0681[_0x56598c(0x1a0)](_0xc02630=>typeof _0xc02630==='string'&&_0xc02630['trim']());if(!_0x3a6b69)throw new Error(_0x56598c(0x2c6)+'o\x20resolv'+'e\x20plugin'+_0x56598c(0x2ca)+'\x20'+_0x3f0063);return _0x3a6b69[_0x56598c(0x339)]();}function pluginSpecMatches(_0x2db532,_0x35d2d9){const _0x26d0f3=_0x38e6be,_0x3f8498=_0x35d2d9[_0x26d0f3(0x339)](),_0x47e9f4=resolvePackageNameFromNpmSpec(_0x3f8498);return[_0x2db532[_0x26d0f3(0x25b)],_0x2db532[_0x26d0f3(0x1c1)+_0x26d0f3(0x317)],_0x2db532[_0x26d0f3(0x1c1)+_0x26d0f3(0x19c)]][_0x26d0f3(0x36d)](_0x43f77e=>_0x43f77e===_0x3f8498||_0x43f77e===_0x47e9f4);}async function installPluginFromNpmSpec(_0x5700d7,_0x11e72a,_0x2329dd={}){const _0x2b0bcf=_0x38e6be,_0x4136c9=_0x5700d7['trim']()['replace'](/^npm:/,''),_0x15321f=resolvePluginDirNameFromSpec(_0x4136c9),_0x1bf24b=join(_0x11e72a['openclaw'+_0x2b0bcf(0x23d)+'ir'],'dist',_0x2b0bcf(0x36e)+'ns'),_0x286d89=join(_0x1bf24b,_0x15321f),_0x3a998a=join(_0x11e72a[_0x2b0bcf(0x37c)+_0x2b0bcf(0x211)],_0x2b0bcf(0x18a)+_0x2b0bcf(0x1e3)+process['pid']+'-'+Date[_0x2b0bcf(0x267)]()),_0x596807=await createRuntimeEnv(_0x11e72a),_0x351d43=new Date()[_0x2b0bcf(0x2d3)+_0x2b0bcf(0x17c)](),_0x4312a0=join(_0x11e72a[_0x2b0bcf(0x37c)+_0x2b0bcf(0x211)],_0x2b0bcf(0x1bd));await mkdir(_0x4312a0,{'recursive':!![]}),await rm(_0x3a998a,{'recursive':!![],'force':!![]}),await rm(_0x286d89,{'recursive':!![],'force':!![]}),await mkdir(_0x3a998a,{'recursive':!![]}),await mkdir(_0x1bf24b,{'recursive':!![]}),console['log'](_0x2b0bcf(0x347)+_0x2b0bcf(0x2a0)+_0x2b0bcf(0x246)+_0x2b0bcf(0x379)+_0x2b0bcf(0x31f)+_0x4136c9);const _0x105d27=await runProcess(_0x11e72a[_0x2b0bcf(0x255)+_0x2b0bcf(0x1ba)],[_0x11e72a[_0x2b0bcf(0x372)],'pack',_0x4136c9,_0x2b0bcf(0x17a)],{'cwd':_0x4312a0,'env':_0x596807,'label':'npm\x20pack'+'\x20'+_0x4136c9}),_0x328ce3=parseNpmPackJson(_0x105d27[_0x2b0bcf(0x2b8)]),_0x394fe3=normalizePackedTarballFilename(_0x328ce3[_0x2b0bcf(0x253)]),_0x15186d=join(_0x4312a0,_0x394fe3);if(!existsSync(_0x15186d))throw new Error(_0x2b0bcf(0x2f6)+_0x2b0bcf(0x2c2)+_0x2b0bcf(0x343)+_0x2b0bcf(0x35a)+'\x20'+_0x15186d);await runProcess(_0x2b0bcf(0x29e),[_0x2b0bcf(0x2a3),_0x15186d,'-C',_0x3a998a],{'label':_0x2b0bcf(0x27b)+_0x394fe3}),await rename(join(_0x3a998a,_0x2b0bcf(0x2e5)),_0x286d89),await rm(_0x3a998a,{'recursive':!![],'force':!![]});const _0x28f323=join(_0x286d89,_0x2b0bcf(0x2ae)+_0x2b0bcf(0x304)),_0x3e16f8=await readJson(_0x28f323,{});(_0x3e16f8['devDepen'+'dencies']||_0x3e16f8[_0x2b0bcf(0x2dd)])&&(delete _0x3e16f8['devDepen'+_0x2b0bcf(0x298)],delete _0x3e16f8[_0x2b0bcf(0x2dd)],await writeJson(_0x28f323,_0x3e16f8));await runProcess(_0x11e72a[_0x2b0bcf(0x255)+_0x2b0bcf(0x1ba)],[_0x11e72a[_0x2b0bcf(0x372)],_0x2b0bcf(0x277),_0x2b0bcf(0x29c)+'ev',_0x2b0bcf(0x1b3)+_0x2b0bcf(0x2f3),_0x2b0bcf(0x270)+'it','--no-fun'+'d','--legacy'+_0x2b0bcf(0x1c2)+'ps'],{'cwd':_0x286d89,'env':_0x596807,'label':_0x2b0bcf(0x24c)+_0x2b0bcf(0x2d2)+_0x2b0bcf(0x375)+_0x4136c9});const _0x55f206=new Date()[_0x2b0bcf(0x2d3)+_0x2b0bcf(0x17c)](),_0x1e2472=await resolvePluginIdFromPackageDir(_0x286d89,_0x328ce3[_0x2b0bcf(0x1ec)]);return _0x2329dd[_0x2b0bcf(0x265)+_0x2b0bcf(0x294)]?.[_0x2b0bcf(0x204)]('npm\x20plug'+_0x2b0bcf(0x1cc)+_0x2b0bcf(0x36f),{'spec':_0x4136c9,'pluginId':_0x1e2472,'installPath':_0x286d89}),{'pluginId':_0x1e2472,'source':_0x2b0bcf(0x318),'spec':_0x4136c9,'installPath':toRuntimeRelative(_0x11e72a['runtimeR'+_0x2b0bcf(0x211)],_0x286d89),'version':_0x328ce3[_0x2b0bcf(0x2aa)],'resolvedName':_0x328ce3[_0x2b0bcf(0x1ec)],'resolvedVersion':_0x328ce3[_0x2b0bcf(0x2aa)],'resolvedSpec':_0x328ce3[_0x2b0bcf(0x1ec)]+'@'+_0x328ce3[_0x2b0bcf(0x2aa)],'integrity':typeof _0x328ce3['integrit'+'y']===_0x2b0bcf(0x300)?_0x328ce3[_0x2b0bcf(0x2cb)+'y']:'','shasum':typeof _0x328ce3['shasum']===_0x2b0bcf(0x300)?_0x328ce3['shasum']:'','resolvedAt':_0x351d43,'installedAt':_0x55f206};}async function syncConfiguredNpmPlugins(_0x4a7eb9,_0x5b0143,_0x229db5,_0x17c56e={}){const _0x2ffded=_0x38e6be;if(_0x17c56e['syncOnly'])return;const _0x358d2a=createRuntimeInfoFromManifest(_0x5b0143,_0x229db5),_0x4110f6=Array[_0x2ffded(0x2d5)](_0x229db5[_0x2ffded(0x1be)])?_0x229db5['plugins']:[],_0x546268=[];for(const _0x1cf69b of _0x4a7eb9[_0x2ffded(0x17d)][_0x2ffded(0x177)+'ecs']){const _0x233a32=_0x4110f6['find'](_0x219224=>_0x219224?.[_0x2ffded(0x351)]===_0x2ffded(0x318)&&pluginSpecMatches(_0x219224,_0x1cf69b)&&typeof _0x219224[_0x2ffded(0x208)+'ath']===_0x2ffded(0x300)&&existsSync(resolve(_0x5b0143,_0x219224[_0x2ffded(0x208)+_0x2ffded(0x2ab)])));if(_0x233a32){_0x546268[_0x2ffded(0x1b1)](_0x233a32);continue;}_0x546268[_0x2ffded(0x1b1)](await installPluginFromNpmSpec(_0x1cf69b,_0x358d2a,_0x17c56e));}const _0x4b28f7=new Set(_0x4a7eb9['openclaw']['pluginSp'+_0x2ffded(0x1aa)][_0x2ffded(0x2ad)](resolvePackageNameFromNpmSpec)),_0xb532af=_0x4110f6[_0x2ffded(0x28d)](_0x59258d=>_0x59258d?.[_0x2ffded(0x351)]!==_0x2ffded(0x318)||!_0x4b28f7[_0x2ffded(0x2e7)](resolvePackageNameFromNpmSpec(_0x59258d[_0x2ffded(0x1c1)+'Name']||_0x59258d[_0x2ffded(0x25b)]||'')));_0x229db5['plugins']=[..._0xb532af,..._0x546268];}function hasRuntimeDependencies(_0x154d5c){const _0x206318=_0x38e6be,_0x1904ec=_0x154d5c?.[_0x206318(0x2e1)+'cies']&&typeof _0x154d5c['dependen'+'cies']===_0x206318(0x2df)?Object[_0x206318(0x1ca)](_0x154d5c[_0x206318(0x2e1)+_0x206318(0x1e4)]):[],_0xaa7367=_0x154d5c?.[_0x206318(0x23c)+'Dependen'+_0x206318(0x1e4)]&&typeof _0x154d5c[_0x206318(0x23c)+_0x206318(0x37b)+_0x206318(0x1e4)]===_0x206318(0x2df)?Object[_0x206318(0x1ca)](_0x154d5c[_0x206318(0x23c)+_0x206318(0x37b)+_0x206318(0x1e4)]):[];return _0x1904ec['length']>0x0||_0xaa7367[_0x206318(0x31a)]>0x0;}async function installLocalPluginRuntimeDependencies(_0x4178f6,_0x136455,_0x5e74b0){const _0x2bafd6=_0x38e6be,_0x1a205f=join(_0x4178f6,'package.'+_0x2bafd6(0x304)),_0x17debc=await readJson(_0x1a205f,{});(_0x17debc[_0x2bafd6(0x302)+'dencies']||_0x17debc[_0x2bafd6(0x2dd)])&&(delete _0x17debc['devDepen'+'dencies'],delete _0x17debc[_0x2bafd6(0x2dd)],await writeJson(_0x1a205f,_0x17debc));if(!hasRuntimeDependencies(_0x17debc))return;const _0x3710a6=await createRuntimeEnv(_0x136455);console[_0x2bafd6(0x1bc)](_0x2bafd6(0x347)+_0x2bafd6(0x2a0)+_0x2bafd6(0x18f)+_0x2bafd6(0x19b)+_0x2bafd6(0x218)+_0x2bafd6(0x319)+_0x2bafd6(0x35b)+_0x2bafd6(0x35d)+_0x4178f6),await runProcess(_0x136455[_0x2bafd6(0x255)+_0x2bafd6(0x1ba)],[_0x136455[_0x2bafd6(0x372)],_0x2bafd6(0x277),_0x2bafd6(0x29c)+'ev',_0x2bafd6(0x1b3)+'eer',_0x2bafd6(0x270)+'it',_0x2bafd6(0x219)+'d',_0x2bafd6(0x348)+_0x2bafd6(0x1c2)+'ps'],{'cwd':_0x4178f6,'env':_0x3710a6,'label':_0x2bafd6(0x24c)+_0x2bafd6(0x23e)+_0x2bafd6(0x2e8)+'\x20'+_0x4178f6}),_0x5e74b0[_0x2bafd6(0x265)+_0x2bafd6(0x294)]?.[_0x2bafd6(0x204)](_0x2bafd6(0x2d4)+_0x2bafd6(0x1f1)+_0x2bafd6(0x1d1)+_0x2bafd6(0x273)+_0x2bafd6(0x2ef),{'installPath':_0x4178f6});}async function syncSharedPluginModules(_0x528388,_0x6f8b05){const _0x387d09=_0x38e6be,_0xcc65d6=new Set();for(const _0x355a28 of _0x528388){const _0x59f76f=join(dirname(_0x355a28),_0x387d09(0x236));if(existsSync(_0x59f76f))_0xcc65d6[_0x387d09(0x195)](_0x59f76f);}for(const _0xefdb26 of _0xcc65d6){await copyDirFresh(_0xefdb26,join(_0x6f8b05,_0x387d09(0x236)));}}async function syncProductPlugins(_0x99d4d,_0x48db4d,_0x366ef8,_0x2502af={}){const _0x273bee=_0x38e6be,_0x28bae0=join(_0x48db4d,_0x273bee(0x17d),_0x273bee(0x269),'extensio'+'ns'),_0x54abbc=createRuntimeInfoFromManifest(_0x48db4d,_0x366ef8),_0x59636a=[];await syncSharedPluginModules(_0x99d4d[_0x273bee(0x17d)][_0x273bee(0x1c1)+_0x273bee(0x2c0)+_0x273bee(0x1f6)],_0x28bae0);for(const _0xe6d025 of _0x99d4d[_0x273bee(0x17d)][_0x273bee(0x1c1)+_0x273bee(0x2c0)+_0x273bee(0x1f6)]){const _0x49b648=await getPackageMetadata(_0xe6d025),_0x2e6646=await readPluginManifest(_0xe6d025),_0x5571cc=join(_0x28bae0,_0x49b648[_0x273bee(0x359)]);await copyDirFresh(_0xe6d025,_0x5571cc),await installLocalPluginRuntimeDependencies(_0x5571cc,_0x54abbc,_0x2502af),_0x59636a['push']({'pluginId':_0x49b648[_0x273bee(0x359)],'source':'local','spec':_0x273bee(0x289)+_0xe6d025,'installPath':toRuntimeRelative(_0x48db4d,_0x5571cc),'version':_0x49b648['version'],'resolvedName':_0x49b648[_0x273bee(0x1ec)],'resolvedVersion':_0x49b648[_0x273bee(0x2aa)],'resolvedSpec':'local:'+_0xe6d025,'integrity':'','shasum':'','resolvedAt':new Date()[_0x273bee(0x2d3)+'ing'](),'installedAt':new Date()[_0x273bee(0x2d3)+_0x273bee(0x17c)](),'agentScope':_0x2e6646[_0x273bee(0x202)+'pe'],'skills':_0x2e6646[_0x273bee(0x245)]});}const _0x481a09=new Set(_0x59636a[_0x273bee(0x2ad)](_0x425cc9=>_0x425cc9[_0x273bee(0x359)])),_0x4a9e4f=Array[_0x273bee(0x2d5)](_0x366ef8[_0x273bee(0x1be)])?_0x366ef8[_0x273bee(0x1be)][_0x273bee(0x28d)](_0x461bb9=>!_0x481a09['has'](_0x461bb9[_0x273bee(0x359)])):[];_0x366ef8[_0x273bee(0x1be)]=[..._0x4a9e4f,..._0x59636a];}async function syncManifestPluginScope(_0x1a8245,_0x1ee2c1,_0x36535b){const _0x2c441e=_0x38e6be,_0x35dc15=join(_0x1ee2c1,'openclaw',_0x2c441e(0x269),_0x2c441e(0x36e)+'ns'),_0x21abe1=new Set(_0x1a8245['openclaw'][_0x2c441e(0x177)+'ecs']??[]),_0x5d52f9=new Set([..._0x21abe1][_0x2c441e(0x2ad)](_0x398d5d=>_0x398d5d[_0x2c441e(0x1dd)](/^npm:/,''))[_0x2c441e(0x2ad)](_0x295e4c=>{const _0x317043=_0x2c441e;if(_0x295e4c[_0x317043(0x20b)+'th']('@')){const _0x5c0175=_0x295e4c[_0x317043(0x297)]('@');return _0x5c0175['length']>=0x3?'@'+_0x5c0175[0x1]:_0x295e4c;}return _0x295e4c[_0x317043(0x297)]('@')[0x0];})[_0x2c441e(0x28d)](Boolean)),_0x76bfe=new Set();for(const _0x58fb1f of _0x1a8245['openclaw']['resolved'+'LocalPlu'+_0x2c441e(0x1f6)]){const _0x1d2c8a=await getPackageMetadata(_0x58fb1f);if(_0x1d2c8a[_0x2c441e(0x359)])_0x76bfe[_0x2c441e(0x195)](_0x1d2c8a[_0x2c441e(0x359)]);}const _0x3a2273=Array['isArray'](_0x36535b[_0x2c441e(0x1be)])?_0x36535b[_0x2c441e(0x1be)]:[];_0x36535b[_0x2c441e(0x177)+_0x2c441e(0x1aa)]=[..._0x1a8245['openclaw'][_0x2c441e(0x177)+_0x2c441e(0x1aa)],..._0x1a8245['openclaw']['resolved'+_0x2c441e(0x2c0)+_0x2c441e(0x1f6)][_0x2c441e(0x2ad)](_0x15f574=>_0x2c441e(0x289)+_0x15f574)],_0x36535b[_0x2c441e(0x1be)]=_0x3a2273['filter'](_0x2181fc=>{const _0x17540b=_0x2c441e;if(!_0x2181fc||typeof _0x2181fc!==_0x17540b(0x2df))return![];if(_0x2181fc[_0x17540b(0x351)]===_0x17540b(0x1c0))return _0x76bfe[_0x17540b(0x2e7)](_0x2181fc['pluginId']);if(_0x2181fc['source']===_0x17540b(0x318))return _0x21abe1[_0x17540b(0x2e7)](_0x2181fc[_0x17540b(0x25b)])||_0x21abe1[_0x17540b(0x2e7)](_0x2181fc[_0x17540b(0x1c1)+_0x17540b(0x317)])||_0x5d52f9[_0x17540b(0x2e7)](_0x2181fc[_0x17540b(0x1c1)+_0x17540b(0x19c)]);return![];});const _0x566000=new Set(_0x36535b[_0x2c441e(0x1be)][_0x2c441e(0x2ad)](_0xf0ad74=>_0xf0ad74[_0x2c441e(0x359)]));for(const _0xaaa722 of _0x3a2273){if(!_0xaaa722[_0x2c441e(0x359)]||_0x566000[_0x2c441e(0x2e7)](_0xaaa722[_0x2c441e(0x359)]))continue;const _0x16c465=typeof _0xaaa722[_0x2c441e(0x208)+_0x2c441e(0x2ab)]===_0x2c441e(0x300)&&_0xaaa722[_0x2c441e(0x208)+_0x2c441e(0x2ab)][_0x2c441e(0x339)]()?resolve(_0x1ee2c1,_0xaaa722[_0x2c441e(0x208)+_0x2c441e(0x2ab)]):join(_0x35dc15,_0xaaa722['pluginId']),_0x41ea5b=relative(_0x35dc15,_0x16c465);if(_0x41ea5b[_0x2c441e(0x20b)+'th']('..')||_0x41ea5b==='')continue;await rm(_0x16c465,{'recursive':!![],'force':!![]});}}async function collectCapabilityEntries(_0x46f563,_0x15f9ce){const _0xa9b4f7=_0x38e6be,_0x80dda7=new Map();for(const _0x14aa16 of _0x46f563){let _0x37cb6d;try{_0x37cb6d=await stat(_0x14aa16);}catch{throw new Error(_0x15f9ce+('\x20path\x20wa'+_0xa9b4f7(0x1e8)+_0xa9b4f7(0x27c))+_0x14aa16);}if(!_0x37cb6d[_0xa9b4f7(0x36b)+'ory']())throw new Error(_0x15f9ce+(_0xa9b4f7(0x33c)+_0xa9b4f7(0x2f2)+_0xa9b4f7(0x1ab)+_0xa9b4f7(0x281))+_0x14aa16);const _0x403806={'name':basename(_0x14aa16),'path':_0x14aa16},_0x386e80=_0x80dda7['get'](_0x403806[_0xa9b4f7(0x1ec)]);if(_0x386e80)throw new Error('Duplicat'+'e\x20'+_0x15f9ce+_0xa9b4f7(0x377)+_0x403806[_0xa9b4f7(0x1ec)]+'\x22\x20from\x20'+_0x386e80[_0xa9b4f7(0x278)]+_0xa9b4f7(0x249)+_0x403806[_0xa9b4f7(0x278)]);_0x80dda7['set'](_0x403806['name'],_0x403806);}return[..._0x80dda7[_0xa9b4f7(0x370)]()];}async function syncProductCapabilityDirs(_0x17672d,_0x147250,_0x2e3161){const _0x38449f=_0x38e6be,_0x82458a=await collectCapabilityEntries(_0x17672d,_0x2e3161);await rm(_0x147250,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await mkdir(_0x147250,{'recursive':!![]});for(const _0x29906d of _0x82458a){await cp(_0x29906d[_0x38449f(0x278)],join(_0x147250,_0x29906d[_0x38449f(0x1ec)]),{'recursive':!![]});}return _0x82458a[_0x38449f(0x31a)];}export const __test__={'collectCapabilityEntries':collectCapabilityEntries,'syncProductCapabilityDirs':syncProductCapabilityDirs};async function syncProductAgents(_0x2c11ad,_0xba94ef,_0x39eeae){const _0x43c1f3=_0x38e6be,_0x36efcf=join(_0xba94ef,_0x43c1f3(0x17d),_0x43c1f3(0x312)),_0x362521=await syncProductCapabilityDirs(_0x2c11ad[_0x43c1f3(0x17d)][_0x43c1f3(0x1c1)+_0x43c1f3(0x215)+'ntPaths'],_0x36efcf,'agent');_0x39eeae['agents']={'source':_0x43c1f3(0x2d9),'installPath':toRuntimeRelative(_0xba94ef,_0x36efcf),'localPaths':_0x2c11ad['openclaw'][_0x43c1f3(0x1c1)+_0x43c1f3(0x215)+_0x43c1f3(0x2c8)],'entryCount':_0x362521};}async function syncProductSkills(_0x3570bf,_0x4d0cee,_0x5658bb){const _0x39c098=_0x38e6be,_0x247ccb=join(_0x4d0cee,_0x39c098(0x17d),'skills'),_0x24474f=await syncProductCapabilityDirs(_0x3570bf['openclaw'][_0x39c098(0x1c1)+_0x39c098(0x1c4)+_0x39c098(0x1e1)],_0x247ccb,_0x39c098(0x227));_0x5658bb['skills']={'source':_0x39c098(0x2d9),'installPath':toRuntimeRelative(_0x4d0cee,_0x247ccb),'localPaths':_0x3570bf['openclaw']['resolved'+_0x39c098(0x1c4)+_0x39c098(0x1e1)],'entryCount':_0x24474f};}
1
+ const _0x5a6cc0=_0x5e0d;(function(_0x27bf8c,_0x2b6c59){const _0x4f62bb=_0x5e0d,_0x413930=_0x27bf8c();while(!![]){try{const _0x437528=-parseInt(_0x4f62bb(0x318))/0x1*(parseInt(_0x4f62bb(0x138))/0x2)+parseInt(_0x4f62bb(0x1af))/0x3+-parseInt(_0x4f62bb(0x1fb))/0x4+parseInt(_0x4f62bb(0x2b1))/0x5+parseInt(_0x4f62bb(0x288))/0x6*(-parseInt(_0x4f62bb(0x166))/0x7)+parseInt(_0x4f62bb(0x237))/0x8+-parseInt(_0x4f62bb(0x125))/0x9;if(_0x437528===_0x2b6c59)break;else _0x413930['push'](_0x413930['shift']());}catch(_0x49798a){_0x413930['push'](_0x413930['shift']());}}}(_0x1799,0x46cc9));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';function _0x1799(){const _0x422ce2=['eam\x20fix\x20','go.mjs','ugin\x20spe','Temporar','>/dev/nu','ebuild\x20t','agentSco','-peer-de','LocalSki','r\x20runtim','\x20is\x20miss','me.','eady\x20cur','1\x20]\x20&&\x20[','runtime\x20','resume','pipe','channel\x20','wnloadin','stderr','23303pzNpaV','arch','split','reason','dependen','npm\x20root','headers','../../sh','dAt','some','.tools','pendenci','productN','local\x20pl','s\x20not\x20fo','.plugin-','ent','-extract','d\x20an\x20inv','penClaw\x20','--no-aud','WorkingD','flush','--omit=p','er\x20writt','ll\x20prepa','ecs','=\x22${OPEN','ynced','led','/node','ie-shell','cope\x20syn','projectR','bin','parse','ced','optional','process.','rname\x20--','?t=','ujie-she','close','loader-','ATH=\x20cd\x20','--json','lled','\x20prepare','tar','ing\x20\x22','llPaths','\x20runtime','integrit','Spec','data','fix\x20star','$HOME/','tall\x20the','Run\x20\x22wuj','href','syncOnly','nifest=','npmCli','utable','wBin','if\x20\x22%OPE','installP','\x20-z\x20\x22$WU','Version','map','lugin\x20de','log','runtimeL','1223241yqINKG',',\x20shell.','store\x20lo','-doctor.','skill','\x20\x22OPENCL','store-lo','unction\x20','https://','\x20failed\x20','ogger','cies','sessions','@echo\x20of','\x20return\x20','e\x20upgrad','local:','lugins\x20s','\x20written','ntime\x20ch','ATE_DIR%','nodeExec','CLAW_CON','\x20install','download','all\x20loca','JIE_NO_L','sort','ify\x20upst','leted','\x20path\x20wa','ntime','fix','ld\x20start','if\x20[\x20-t\x20','install','.npmmirr','store\x20sq','prepare\x20','%~dp0\x22','bug;\x20ver','E_DIR=','Bundled\x20','in\x20runti','package','\x20applied','ipped;\x20f','\x22\x20from\x20','string','runtime:','ed-tool\x20','failed','LocalPlu','dencies','.json','chat-dis','now','openclaw','tateDir','rebuilt\x20','ing','.tmp/run','prepareP','h\x20applie','oot','in\x20','tools\x20sy','Version\x20','AW_CONFI','\x20did\x20not','r\x20OpenCl','\x20kdocs\x20s','Unable\x20t','\x20create\x20','error','empty\x20pl','1368168ExLGzw','roductRu','filename','rent','devDepen','ll\x20||\x20tr','match','info','\x22%SCRIPT','warn','node','ell-runt','d\x20for\x20lo','json','toISOStr','synced','ugin\x20dep','bridge.m','ie-logo.','nodeVers','age\x20was\x20','es.','nel\x20plug','aw\x202026.','ound','ujie-log','wujie-lo','.js','h\x20alread','o\x20resolv','ready\x20ap','-xJf','time','des.','plied','skills','\x20product','\x22\x20\x22$@\x22','d\x20to\x20','ame','doctor','SCRIPT_D','export\x20O','agent','SIGTERM','pack','values','\x20started','object','tool\x20his','tar.xz','started','npm\x20inst','set\x20\x22OPE','name','with\x20cod','cal\x20runt','fix\x20alre','ules','OGO\x22\x20];\x20','3663032cVdZPB','sets/wuj','base\x20bui','config=','npm-cach','ntime\x20re','unknown','6\x20mixed\x20','node-v','zip','null','shasum','label','lib','\x20resolve','--no-fun',';\x20run\x20wu','toString','indexOf','npm\x20plug','\x20can\x20ins','missing\x20','time-too','alid\x20pay','patch\x20fo','store\x20wr','\x20bin\x20was','plugin\x20s','\x20id\x20from','has','generate','npm-glob','in\x20insta','ite\x20patc','e\x20plugin','\x20configu','y\x20applie','time]\x20in','PT_DIR/w','ions/run','OME=','skipped;','ibility\x20','pluginId','versions','time]\x20do','keys','endencie','ENCLAW_H','OpenClaw','red','hell:run','execPath','startsWi','\x20package','set','node/bin','enclaw\x20d','env','../../as','stdout','extensio','get','H%\x22==\x22\x22\x20','pluginSp','\x20\x22$0\x22)\x22\x20','manifest','patched','shell-ru','solver\x20n','replace','agents','red\x20Open','claw-run','push','atch\x20alr','jie-shel','ginPaths','Invalid\x20','PENCLAW_','s\x20instal','618yRFGmO','state-','\x20complet','CONFIG_P','patch\x20ap','spec','\x20set\x20\x22OP','trim','index.mj','agents\x20s','lib/node','fy\x20upstr','R=\x22${OPE','nced','nning\x20op','scoped\x20s','pped;\x20ru','\x20not\x20fou','--fix','\x20and\x20','ime/sess','ntPaths','arm64','octor\x20--','source','ion','npm-cli.','isFile','wujieai.','ch\x20skipp','untime\x20p','lugin\x20','configFi','local','stalling','o.mjs\x22\x202','with\x20the','unzip','length','st=','runtime-','1427925gjsDqy','IR=$(CDP','utf8','d:\x20','path','pped;\x20di','slice','AME=','on\x20futur','dataDir','plugins\x20','l\x20plugin','ed\x20OpenC','.\x20Run\x20\x22w','und:\x20','\x22\x20so\x20the','y\x20compat','\x20doctor\x20','Bin','_NAME:-','.opencla','location','connecto','Name','\x20path\x20mu','product\x20','time]\x20ru','isArray','filter','LocalAge','pid','node\x20ver','runtimeR','NCLAW_HO','idated','/node_mo','NFIG_FIL','load:\x20','rs;\x20veri','catch','plugins','ted','npm','tory\x20mix','s\x20missin','dataDirN','\x20already','Configur','ILE_NAME','ncies','scripts','ATH=\x22${O','me\x20missi','--legacy','every','npm\x20pack','PT_DIR/','atch:\x20ma','wujiecla','lied','ignore','ut\x20after','found','ad-','statusCo','_modules','/npm','tory\x20pro','set\x20\x22SCR','ld\x20compl','patch\x20sk','registry','atch\x20app','\x22\x20at\x20','version','\x20on\x20futu','tching\x20p','ader\x20not','endsWith','te/cli\x20i','.cache','==\x22\x22\x20set','NFIG_PAT','JSON:\x20','exec\x20\x22$S','timeoutM','extract-','dist','tarball:','appId','already-','mismatch','jection\x20','eady\x20app','singOpen','--omit=d','x64','.node','FILE%\x5c','runtime','nd\x20after','try\x20not\x20','\x20local\x20p','103kAAsIt','kill','@larksui','platform','es\x20','ed;\x20brid','\x20signal=','resolved','replaceA','/opencla','patch\x20al','w.cmd','eer','774549YRloYW','product','root','\x20version','find','e\x20tools\x20','atch\x20ski','\x20timed\x20o','ile\x20not\x20','all\x20plug','not\x20foun','win32','chat\x20his','store-','plugin\x20r','node_mod','re\x20upgra','-xzf','--\x20\x22$(di','1752mhCHfg','entryCou','_shared','win','sion\x20mis','package.','node/lib','\x22\x20%*','Dependen','kill\x20not','extract\x20','6.6\x20chan','m-cli.js','cli','[wujie-s','session\x20','ath','sion.','Claw','NCLAW_CO','channel-','ime\x20buil','el.inbou','base\x20alr','join','y:\x20'];_0x1799=function(){return _0x422ce2;};return _0x1799();}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=_0x5a6cc0(0x1ec)+_0x5a6cc0(0x21b),MANIFEST_NAME=_0x5a6cc0(0x2b0)+'manifest'+_0x5a6cc0(0x1e5),NPM_INSTALL_TIMEOUT_MS=0xf*0x3c*0x3e8;export function resolveRuntimeRoot(_0xa7d63e){if(process.env.WUJIE_SHELL_RUNTIME_ROOT)return resolve(process.env.WUJIE_SHELL_RUNTIME_ROOT);return resolve(_0xa7d63e,RUNTIME_DIR);}export function resolveManifestPath(_0x222dfb){return join(_0x222dfb,MANIFEST_NAME);}async function loadProductRuntime(_0x51b189,_0x2035b4){const _0x9c3e7b=_0x5a6cc0,_0x3951a2=[join(_0x51b189,_0x9c3e7b(0x27b)+_0x9c3e7b(0x1ce),_0x9c3e7b(0x290)+'s'),join(_0x2035b4,_0x9c3e7b(0x27b)+_0x9c3e7b(0x1ce),_0x9c3e7b(0x290)+'s')];for(const _0x55d5bd of _0x3951a2){if(!existsSync(_0x55d5bd))continue;return await import(pathToFileURL(_0x55d5bd)[_0x9c3e7b(0x1a1)]+_0x9c3e7b(0x18e)+Date[_0x9c3e7b(0x1e7)]());}return{};}export async function prepareRuntime(_0x51162f,{syncOnly:syncOnly=![]}={}){const _0x55d263=_0x5a6cc0,_0x778558=resolveRuntimeRoot(_0x51162f[_0x55d263(0x187)+_0x55d263(0x1ef)]),_0x3f413e=createRuntimeLogger(getConfigPaths(_0x51162f),_0x55d263(0x314)),_0x36925f=Date[_0x55d263(0x1e7)]();_0x3f413e?.[_0x55d263(0x202)](_0x55d263(0x1d5)+'runtime\x20'+_0x55d263(0x22e),{'syncOnly':syncOnly,'runtimeRoot':_0x778558,'shellConfig':summarizeShellConfig(_0x51162f)});try{const _0x2aa26f=await ensureRuntimeBase(_0x51162f,_0x778558,{'runtimeLogger':_0x3f413e,'syncOnly':syncOnly});_0x3f413e?.[_0x55d263(0x202)](_0x55d263(0x160)+'manifest'+'\x20loaded',{'manifestPath':resolveManifestPath(_0x778558),'manifest':summarizeRuntimeManifest(_0x2aa26f)}),validateRuntimeNodeVersion(_0x2aa26f,_0x51162f),_0x3f413e?.['info'](_0x55d263(0x160)+'node\x20ver'+'sion\x20val'+_0x55d263(0x2d3),{'nodeVersion':_0x2aa26f[_0x55d263(0x20e)+'ion']});if(syncOnly)validateRuntimeOpenClawVersion(_0x2aa26f,_0x51162f),_0x3f413e?.[_0x55d263(0x202)]('runtime\x20'+'openclaw'+_0x55d263(0x128)+'\x20validat'+'ed',{'openclawVersion':_0x2aa26f[_0x55d263(0x1e8)+_0x55d263(0x1aa)]});else{if(_0x2aa26f['openclaw'+_0x55d263(0x1aa)]!==_0x51162f['openclaw'][_0x55d263(0x1e8)+_0x55d263(0x1aa)]){const _0x31b010=await loadRuntimeInfo(_0x51162f[_0x55d263(0x187)+_0x55d263(0x1ef)]);_0x3f413e?.['info'](_0x55d263(0x1e8)+_0x55d263(0x26d)+'\x20install'+_0x55d263(0x22a),{'fromVersion':_0x2aa26f[_0x55d263(0x1e8)+_0x55d263(0x1aa)]||_0x55d263(0x23d),'toVersion':_0x51162f[_0x55d263(0x1e8)][_0x55d263(0x1e8)+_0x55d263(0x1aa)]}),await installOpenClawPackage(_0x31b010,_0x51162f[_0x55d263(0x1e8)]['openclaw'+'Version']),_0x2aa26f[_0x55d263(0x1e8)+_0x55d263(0x1aa)]=_0x51162f[_0x55d263(0x1e8)][_0x55d263(0x1e8)+_0x55d263(0x1aa)],_0x3f413e?.[_0x55d263(0x202)](_0x55d263(0x1e8)+_0x55d263(0x26d)+'\x20install'+_0x55d263(0x28a)+'ed',{'openclawVersion':_0x2aa26f[_0x55d263(0x1e8)+_0x55d263(0x1aa)]});}}_0x2aa26f[_0x55d263(0x255)+_0x55d263(0x16e)]=new Date()[_0x55d263(0x209)+_0x55d263(0x1eb)](),_0x2aa26f['nodeVers'+_0x55d263(0x2a1)]=_0x51162f[_0x55d263(0x1e8)][_0x55d263(0x20e)+'ion'],_0x2aa26f[_0x55d263(0x126)]={'appId':_0x51162f[_0x55d263(0x30a)],'productName':_0x51162f[_0x55d263(0x172)+'ame'],'dataDirName':_0x51162f['dataDirN'+_0x55d263(0x222)]},await patchChatHistoryMixedToolContentBug(_0x778558,_0x2aa26f,{'runtimeLogger':_0x3f413e}),await patchChannelPluginRuntimeBug(_0x778558,_0x2aa26f,{'runtimeLogger':_0x3f413e});const _0x5721a3=await loadProductRuntime(_0x51162f[_0x55d263(0x187)+'oot'],_0x778558);if(typeof _0x5721a3[_0x55d263(0x1ed)+'roductRu'+_0x55d263(0x1ce)]==='function'){const _0x1e1c1c=createRuntimeInfoFromManifest(_0x778558,_0x2aa26f);await _0x5721a3[_0x55d263(0x1ed)+_0x55d263(0x1fc)+_0x55d263(0x1ce)]({'shellConfig':_0x51162f,'runtime':_0x1e1c1c,'runtimeLogger':_0x3f413e,'syncOnly':syncOnly}),_0x3f413e?.[_0x55d263(0x202)](_0x55d263(0x2ca)+'runtime\x20'+_0x55d263(0x1f1)+_0x55d263(0x295));}await patchSessionStoreSqliteRuntime(_0x778558,_0x2aa26f,{'runtimeLogger':_0x3f413e});!syncOnly&&(await hasConfiguredKdocsSkill(_0x51162f)?(await installKdocsCliBinary(_0x51162f,createRuntimeInfoFromManifest(_0x778558,_0x2aa26f),{'runtimeLogger':_0x3f413e,'syncOnly':syncOnly}),_0x3f413e?.[_0x55d263(0x202)](_0x55d263(0x2c7)+_0x55d263(0x15b)+_0x55d263(0x12a)+_0x55d263(0x20a))):_0x3f413e?.[_0x55d263(0x202)](_0x55d263(0x2c7)+_0x55d263(0x15b)+_0x55d263(0x12a)+_0x55d263(0x260)+_0x55d263(0x1f6)+_0x55d263(0x141)+'\x20configu'+_0x55d263(0x269)));const _0x15eb17=Array[_0x55d263(0x2cc)](_0x2aa26f['plugins'])?_0x2aa26f['plugins'][_0x55d263(0x2ae)]:0x0;return await syncManifestPluginScope(_0x51162f,_0x778558,_0x2aa26f),_0x3f413e?.['info']('runtime\x20'+_0x55d263(0x252)+_0x55d263(0x186)+_0x55d263(0x18a),{'beforePluginCount':_0x15eb17,'afterPluginCount':Array[_0x55d263(0x2cc)](_0x2aa26f['plugins'])?_0x2aa26f[_0x55d263(0x2d9)][_0x55d263(0x2ae)]:0x0,'pluginSpecCount':Array[_0x55d263(0x2cc)](_0x2aa26f[_0x55d263(0x277)+_0x55d263(0x180)])?_0x2aa26f[_0x55d263(0x277)+_0x55d263(0x180)][_0x55d263(0x2ae)]:0x0}),await syncConfiguredNpmPlugins(_0x51162f,_0x778558,_0x2aa26f,{'runtimeLogger':_0x3f413e,'syncOnly':syncOnly}),_0x3f413e?.['info']('configur'+'ed\x20npm\x20p'+_0x55d263(0x1c0)+_0x55d263(0x182),{'pluginSpecCount':_0x51162f[_0x55d263(0x1e8)][_0x55d263(0x277)+_0x55d263(0x180)][_0x55d263(0x2ae)],'pluginCount':Array[_0x55d263(0x2cc)](_0x2aa26f[_0x55d263(0x2d9)])?_0x2aa26f[_0x55d263(0x2d9)]['length']:0x0}),await syncProductPlugins(_0x51162f,_0x778558,_0x2aa26f,{'runtimeLogger':_0x3f413e}),_0x3f413e?.[_0x55d263(0x202)](_0x55d263(0x2ca)+_0x55d263(0x2bb)+'synced',{'localPluginCount':_0x51162f[_0x55d263(0x1e8)][_0x55d263(0x11f)+'LocalPlu'+'ginPaths']['length'],'pluginCount':Array[_0x55d263(0x2cc)](_0x2aa26f[_0x55d263(0x2d9)])?_0x2aa26f[_0x55d263(0x2d9)][_0x55d263(0x2ae)]:0x0}),await syncProductAgents(_0x51162f,_0x778558,_0x2aa26f),_0x3f413e?.[_0x55d263(0x202)](_0x55d263(0x2ca)+_0x55d263(0x291)+_0x55d263(0x182),{'sources':_0x51162f[_0x55d263(0x1e8)][_0x55d263(0x11f)+_0x55d263(0x2ce)+_0x55d263(0x29d)],'entryCount':_0x2aa26f[_0x55d263(0x27e)]?.['entryCou'+'nt'],'installPath':_0x2aa26f[_0x55d263(0x27e)]?.[_0x55d263(0x1a8)+_0x55d263(0x148)]}),await syncProductSkills(_0x51162f,_0x778558,_0x2aa26f),_0x3f413e?.[_0x55d263(0x202)](_0x55d263(0x2ca)+'skills\x20s'+'ynced',{'sources':_0x51162f[_0x55d263(0x1e8)][_0x55d263(0x11f)+_0x55d263(0x15a)+_0x55d263(0x198)],'entryCount':_0x2aa26f[_0x55d263(0x21e)]?.[_0x55d263(0x139)+'nt'],'installPath':_0x2aa26f[_0x55d263(0x21e)]?.[_0x55d263(0x1a8)+_0x55d263(0x148)]}),await syncRuntimeWrapper(_0x51162f,_0x778558,_0x2aa26f),_0x3f413e?.[_0x55d263(0x202)](_0x55d263(0x160)+'wrapper\x20'+_0x55d263(0x20a),{'wujieclawBin':_0x2aa26f['wujiecla'+_0x55d263(0x1a6)]}),await writeJson(resolveManifestPath(_0x778558),_0x2aa26f),_0x3f413e?.[_0x55d263(0x202)](_0x55d263(0x160)+_0x55d263(0x279)+_0x55d263(0x1c1),{'manifestPath':resolveManifestPath(_0x778558),'manifest':summarizeRuntimeManifest(_0x2aa26f),'durationMs':Date[_0x55d263(0x1e7)]()-_0x36925f}),await _0x3f413e?.[_0x55d263(0x17c)](),_0x2aa26f;}catch(_0x4797c8){_0x3f413e?.[_0x55d263(0x1f9)]('prepare\x20'+_0x55d263(0x160)+_0x55d263(0x1e2),{'syncOnly':syncOnly,'runtimeRoot':_0x778558,'durationMs':Date['now']()-_0x36925f,'error':_0x4797c8}),await _0x3f413e?.[_0x55d263(0x17c)]();throw _0x4797c8;}}async function syncRuntimeWrapper(_0x397741,_0x21bf67,_0x467fbd){const _0x1c7a3e=_0x5a6cc0,_0x298cb7=_0x397741[_0x1c7a3e(0x1e8)]?.[_0x1c7a3e(0x2a8)+'leName']??_0x1c7a3e(0x2a4)+'json',_0x2544e7=join(_0x21bf67,'bin',_0x1c7a3e(0x2eb)+'w'),_0x266a69=join(_0x21bf67,_0x1c7a3e(0x188),'wujiecla'+_0x1c7a3e(0x123)),_0x46429d=normalizeRuntimeRelativePath(relative(dirname(_0x2544e7),resolve(_0x21bf67,_0x467fbd[_0x1c7a3e(0x1c4)+_0x1c7a3e(0x1a5)]))),_0x599ad5=normalizeRuntimeRelativePath(relative(dirname(_0x2544e7),resolve(_0x21bf67,_0x467fbd['openclaw'+'Bin']))),_0x6de259=_0x1c7a3e(0x19e)+_0x397741['dataDirN'+_0x1c7a3e(0x222)],_0x665550='%USERPRO'+_0x1c7a3e(0x313)+_0x397741[_0x1c7a3e(0x2de)+_0x1c7a3e(0x222)];await mkdir(dirname(_0x2544e7),{'recursive':!![]});const _0x5b5607=fileURLToPath(new URL(_0x1c7a3e(0x272)+_0x1c7a3e(0x238)+_0x1c7a3e(0x20d)+'mjs',import.meta.url)),_0x4b7b26=join(_0x21bf67,_0x1c7a3e(0x188),_0x1c7a3e(0x215)+_0x1c7a3e(0x153));await cp(_0x5b5607,_0x4b7b26),await writeFile(_0x2544e7,['#!/bin/s'+'h',_0x1c7a3e(0x225)+_0x1c7a3e(0x286)+'HOME=\x22${'+'OPENCLAW'+'_HOME:-'+_0x6de259+'}\x22',_0x1c7a3e(0x225)+_0x1c7a3e(0x286)+'STATE_DI'+_0x1c7a3e(0x294)+'NCLAW_ST'+'ATE_DIR:'+'-'+_0x6de259+'}\x22',_0x1c7a3e(0x225)+_0x1c7a3e(0x286)+'CONFIG_F'+_0x1c7a3e(0x2e1)+_0x1c7a3e(0x181)+_0x1c7a3e(0x1c5)+'FIG_FILE'+_0x1c7a3e(0x2c4)+_0x298cb7+'}\x22',_0x1c7a3e(0x225)+_0x1c7a3e(0x286)+_0x1c7a3e(0x28b)+_0x1c7a3e(0x2e4)+'PENCLAW_'+_0x1c7a3e(0x28b)+'ATH:-'+_0x6de259+'/'+_0x298cb7+'}\x22',_0x1c7a3e(0x224)+_0x1c7a3e(0x2b2)+_0x1c7a3e(0x192)+_0x1c7a3e(0x137)+_0x1c7a3e(0x18d)+_0x1c7a3e(0x278)+'&&\x20pwd)',_0x1c7a3e(0x1d1)+_0x1c7a3e(0x15f)+_0x1c7a3e(0x1a9)+_0x1c7a3e(0x1c9)+_0x1c7a3e(0x236)+'then','\x20\x20\x22$SCRI'+_0x1c7a3e(0x2e9)+_0x46429d+('\x22\x20\x22$SCRI'+_0x1c7a3e(0x25d)+_0x1c7a3e(0x214)+_0x1c7a3e(0x2ab)+_0x1c7a3e(0x156)+_0x1c7a3e(0x200)+'ue'),'fi',_0x1c7a3e(0x305)+'CRIPT_DI'+'R/'+_0x46429d+('\x22\x20\x22$SCRI'+_0x1c7a3e(0x2e9))+_0x599ad5+_0x1c7a3e(0x220),''][_0x1c7a3e(0x150)]('\x0a'),_0x1c7a3e(0x2b3)),await chmod(_0x2544e7,0x1ed),await writeFile(_0x266a69,[_0x1c7a3e(0x1bc)+'f',_0x1c7a3e(0x1a7)+_0x1c7a3e(0x2d2)+'ME%\x22==\x22\x22'+_0x1c7a3e(0x28e)+_0x1c7a3e(0x267)+_0x1c7a3e(0x25f)+_0x665550+'\x22',_0x1c7a3e(0x1a7)+'NCLAW_ST'+_0x1c7a3e(0x1c3)+'\x22==\x22\x22\x20se'+'t\x20\x22OPENC'+'LAW_STAT'+_0x1c7a3e(0x1d8)+_0x665550+'\x22',_0x1c7a3e(0x1a7)+_0x1c7a3e(0x14b)+_0x1c7a3e(0x2d5)+'E_NAME%\x22'+_0x1c7a3e(0x302)+_0x1c7a3e(0x1b4)+_0x1c7a3e(0x1f3)+'G_FILE_N'+_0x1c7a3e(0x2b8)+_0x298cb7+'\x22',_0x1c7a3e(0x1a7)+'NCLAW_CO'+'NFIG_PAT'+_0x1c7a3e(0x276)+_0x1c7a3e(0x230)+_0x1c7a3e(0x14b)+_0x1c7a3e(0x303)+'H='+_0x665550+'\x5c'+_0x298cb7+'\x22',_0x1c7a3e(0x2f5)+'IPT_DIR='+_0x1c7a3e(0x1d6),_0x1c7a3e(0x203)+'_DIR%'+toWindowsPath(_0x46429d)+('\x22\x20\x22%SCRI'+'PT_DIR%')+toWindowsPath(_0x599ad5)+_0x1c7a3e(0x13f),''][_0x1c7a3e(0x150)]('\x0d\x0a'),_0x1c7a3e(0x2b3)),_0x467fbd[_0x1c7a3e(0x2eb)+'wBin']=toRuntimeRelative(_0x21bf67,process['platform']===_0x1c7a3e(0x130)?_0x266a69:_0x2544e7);}async function patchChatHistoryMixedToolContentBug(_0x4fb079,_0xe1f902,_0x8813a={}){const _0x51dd27=_0x5a6cc0,_0x39ccfc=resolve(_0x4fb079,_0xe1f902[_0x51dd27(0x1e8)+_0x51dd27(0x17b)+'ir']),_0x46dd36=join(_0x39ccfc,_0x51dd27(0x308));let _0x11938e=[];try{_0x11938e=await readdir(_0x46dd36,{'withFileTypes':!![]});}catch{_0x8813a[_0x51dd27(0x1ae)+'ogger']?.[_0x51dd27(0x204)]?.(_0x51dd27(0x131)+_0x51dd27(0x2dc)+_0x51dd27(0x1e1)+_0x51dd27(0x2f7)+'ipped;\x20d'+'ist\x20not\x20'+_0x51dd27(0x2ef),{'distDir':_0x46dd36,'openclawVersion':_0xe1f902[_0x51dd27(0x1e8)+_0x51dd27(0x1aa)]});return;}const _0x44d0c5=_0x11938e[_0x51dd27(0x2cd)](_0x1e361f=>_0x1e361f['isFile']()&&_0x1e361f[_0x51dd27(0x231)]['startsWi'+'th'](_0x51dd27(0x1e6)+'play-pro'+'jection-')&&_0x1e361f['name'][_0x51dd27(0x2ff)](_0x51dd27(0x216)))[_0x51dd27(0x1ab)](_0x3c04dc=>join(_0x46dd36,_0x3c04dc[_0x51dd27(0x231)]));if(_0x44d0c5[_0x51dd27(0x2ae)]===0x0){_0x8813a['runtimeL'+_0x51dd27(0x1b9)]?.[_0x51dd27(0x204)]?.('chat\x20his'+_0x51dd27(0x2dc)+'ed-tool\x20'+_0x51dd27(0x2f7)+_0x51dd27(0x1dd)+_0x51dd27(0x12d)+_0x51dd27(0x2ef),{'openclawVersion':_0xe1f902[_0x51dd27(0x1e8)+'Version']});return;}for(const _0x5eefa9 of _0x44d0c5){const _0x14c289=await readFile(_0x5eefa9,_0x51dd27(0x2b3)),_0x5ba14a=patchMixedToolContentFromSource(_0x14c289);if(!_0x5ba14a['patched']){if(_0x5ba14a[_0x51dd27(0x169)]===_0x51dd27(0x30b)+_0x51dd27(0x27a)){_0x8813a[_0x51dd27(0x1ae)+_0x51dd27(0x1b9)]?.[_0x51dd27(0x202)]?.('chat\x20his'+_0x51dd27(0x2dc)+_0x51dd27(0x1e1)+_0x51dd27(0x122)+_0x51dd27(0x219)+'plied',{'openclawVersion':_0xe1f902['openclaw'+_0x51dd27(0x1aa)],'filePath':_0x5eefa9});return;}continue;}await writeFile(_0x5eefa9,_0x5ba14a[_0x51dd27(0x2a0)],'utf8'),_0x8813a[_0x51dd27(0x1ae)+_0x51dd27(0x1b9)]?.[_0x51dd27(0x202)]?.(_0x51dd27(0x131)+_0x51dd27(0x2dc)+_0x51dd27(0x1e1)+_0x51dd27(0x28c)+_0x51dd27(0x21d),{'openclawVersion':_0xe1f902[_0x51dd27(0x1e8)+_0x51dd27(0x1aa)],'filePath':_0x5eefa9,'note':_0x51dd27(0x155)+_0x51dd27(0x2c1)+_0x51dd27(0x261)+'patch\x20fo'+'r\x20OpenCl'+'aw\x202026.'+_0x51dd27(0x23e)+_0x51dd27(0x22c)+_0x51dd27(0x2f4)+_0x51dd27(0x30d)+_0x51dd27(0x1d7)+_0x51dd27(0x1cb)+'ream\x20fix'+_0x51dd27(0x2fc)+_0x51dd27(0x135)+_0x51dd27(0x21c)});return;}_0x8813a[_0x51dd27(0x1ae)+_0x51dd27(0x1b9)]?.[_0x51dd27(0x204)]?.(_0x51dd27(0x131)+_0x51dd27(0x2dc)+_0x51dd27(0x1e1)+_0x51dd27(0x2f7)+_0x51dd27(0x1dd)+_0x51dd27(0x1b6)+_0x51dd27(0x12f)+'d',{'openclawVersion':_0xe1f902['openclaw'+_0x51dd27(0x1aa)]});}async function patchChannelPluginRuntimeBug(_0x11a9f7,_0x29b2b1,_0xd4a225={}){const _0x4d6f96=_0x5a6cc0,_0x50f420=resolve(_0x11a9f7,_0x29b2b1[_0x4d6f96(0x1e8)+'WorkingD'+'ir']),_0x4e54a7=join(_0x50f420,_0x4d6f96(0x308));let _0x4bbdef=[];try{_0x4bbdef=await readdir(_0x4e54a7,{'withFileTypes':!![]});}catch{_0xd4a225['runtimeL'+'ogger']?.[_0x4d6f96(0x204)]?.(_0x4d6f96(0x163)+_0x4d6f96(0x133)+_0x4d6f96(0x2a6)+_0x4d6f96(0x12b)+_0x4d6f96(0x2b6)+'st\x20not\x20f'+_0x4d6f96(0x213),{'distDir':_0x4e54a7,'openclawVersion':_0x29b2b1[_0x4d6f96(0x1e8)+_0x4d6f96(0x1aa)]});return;}const _0x3439d0=_0x4bbdef[_0x4d6f96(0x2cd)](_0x12b074=>_0x12b074['isFile']()&&_0x12b074[_0x4d6f96(0x231)][_0x4d6f96(0x26c)+'th'](_0x4d6f96(0x191))&&_0x12b074['name']['endsWith']('.js'))[_0x4d6f96(0x1ab)](_0x3228fd=>join(_0x4e54a7,_0x3228fd[_0x4d6f96(0x231)])),_0x5681a7=await resolveRuntimeChannelImportPath(_0x4e54a7,_0x4bbdef);if(_0x3439d0['length']===0x0){_0xd4a225[_0x4d6f96(0x1ae)+_0x4d6f96(0x1b9)]?.[_0x4d6f96(0x204)]?.('channel\x20'+'plugin\x20r'+_0x4d6f96(0x2a6)+_0x4d6f96(0x12b)+'pped;\x20lo'+_0x4d6f96(0x2fe)+'\x20found',{'openclawVersion':_0x29b2b1[_0x4d6f96(0x1e8)+_0x4d6f96(0x1aa)]});return;}if(!_0x5681a7){_0xd4a225[_0x4d6f96(0x1ae)+_0x4d6f96(0x1b9)]?.[_0x4d6f96(0x204)]?.(_0x4d6f96(0x163)+_0x4d6f96(0x133)+_0x4d6f96(0x2a6)+_0x4d6f96(0x12b)+_0x4d6f96(0x298)+_0x4d6f96(0x1c2)+'annel\x20en'+_0x4d6f96(0x316)+'found',{'openclawVersion':_0x29b2b1[_0x4d6f96(0x1e8)+_0x4d6f96(0x1aa)],'distDir':_0x4e54a7});return;}for(const _0x435b8f of _0x3439d0){const _0x58ffbe=await readFile(_0x435b8f,_0x4d6f96(0x2b3)),_0x4b7b14=patchChannelPluginRuntimeFromSource(_0x58ffbe,{'runtimeChannelImportPath':_0x5681a7});if(!_0x4b7b14[_0x4d6f96(0x27a)]){if(_0x4b7b14['reason']===_0x4d6f96(0x30b)+_0x4d6f96(0x27a)){_0xd4a225[_0x4d6f96(0x1ae)+_0x4d6f96(0x1b9)]?.[_0x4d6f96(0x202)]?.(_0x4d6f96(0x163)+_0x4d6f96(0x133)+_0x4d6f96(0x2a6)+_0x4d6f96(0x282)+_0x4d6f96(0x30e)+_0x4d6f96(0x2ec),{'openclawVersion':_0x29b2b1[_0x4d6f96(0x1e8)+'Version'],'filePath':_0x435b8f});return;}continue;}await writeFile(_0x435b8f,_0x4b7b14['source'],'utf8'),_0xd4a225['runtimeL'+_0x4d6f96(0x1b9)]?.['info']?.(_0x4d6f96(0x163)+'plugin\x20r'+_0x4d6f96(0x2a6)+_0x4d6f96(0x2f9)+_0x4d6f96(0x2ec),{'openclawVersion':_0x29b2b1['openclaw'+_0x4d6f96(0x1aa)],'filePath':_0x435b8f,'note':_0x4d6f96(0x155)+_0x4d6f96(0x2c1)+_0x4d6f96(0x261)+_0x4d6f96(0x24f)+_0x4d6f96(0x1f5)+_0x4d6f96(0x212)+_0x4d6f96(0x143)+_0x4d6f96(0x211)+_0x4d6f96(0x1da)+_0x4d6f96(0x2e5)+'ng\x20chann'+_0x4d6f96(0x14e)+'nd\x20helpe'+_0x4d6f96(0x2d7)+_0x4d6f96(0x293)+_0x4d6f96(0x152)+_0x4d6f96(0x2b9)+_0x4d6f96(0x1be)+_0x4d6f96(0x210)});return;}_0xd4a225['runtimeL'+_0x4d6f96(0x1b9)]?.['warn']?.(_0x4d6f96(0x163)+'plugin\x20r'+_0x4d6f96(0x2a6)+_0x4d6f96(0x12b)+_0x4d6f96(0x298)+_0x4d6f96(0x23c)+_0x4d6f96(0x27c)+'ot\x20found',{'openclawVersion':_0x29b2b1[_0x4d6f96(0x1e8)+_0x4d6f96(0x1aa)]});}async function patchSessionStoreSqliteRuntime(_0x2031e3,_0x111539,_0x46fa6f={}){const _0xadcd4c=_0x5a6cc0,_0x548179=resolve(_0x2031e3,_0x111539[_0xadcd4c(0x1e8)+'WorkingD'+'ir']),_0x38c610=join(_0x548179,_0xadcd4c(0x308)),_0x4ace9c=_0xadcd4c(0x16d)+_0xadcd4c(0x206)+_0xadcd4c(0x29c)+_0xadcd4c(0x25e)+'time-bri'+'dge.mjs',_0x17bd6e=join(_0x2031e3,_0xadcd4c(0x27b)+'ntime',_0xadcd4c(0x1bb),_0xadcd4c(0x2b0)+_0xadcd4c(0x20c)+'js'),_0x3d35bf=(await readdir(_0x38c610,{'withFileTypes':!![]})[_0xadcd4c(0x2d8)](()=>[]))['filter'](_0x278f8d=>_0x278f8d[_0xadcd4c(0x2a3)]()&&_0x278f8d[_0xadcd4c(0x231)][_0xadcd4c(0x26c)+'th'](_0xadcd4c(0x1b5)+_0xadcd4c(0x2f0))&&_0x278f8d[_0xadcd4c(0x231)][_0xadcd4c(0x2ff)](_0xadcd4c(0x216)))[_0xadcd4c(0x1ab)](_0x247377=>join(_0x38c610,_0x247377[_0xadcd4c(0x231)])),_0x4ff51a=(await readdir(_0x38c610,{'withFileTypes':!![]})[_0xadcd4c(0x2d8)](()=>[]))[_0xadcd4c(0x2cd)](_0x511d22=>_0x511d22['isFile']()&&_0x511d22[_0xadcd4c(0x231)]['startsWi'+'th'](_0xadcd4c(0x132))&&!_0x511d22[_0xadcd4c(0x231)]['startsWi'+'th'](_0xadcd4c(0x1b5)+_0xadcd4c(0x2f0))&&_0x511d22[_0xadcd4c(0x231)][_0xadcd4c(0x2ff)]('.js'))[_0xadcd4c(0x1ab)](_0x6c5f45=>join(_0x38c610,_0x6c5f45[_0xadcd4c(0x231)]));if(!existsSync(_0x17bd6e)){_0x46fa6f[_0xadcd4c(0x1ae)+_0xadcd4c(0x1b9)]?.[_0xadcd4c(0x202)]?.(_0xadcd4c(0x147)+_0xadcd4c(0x1d4)+'lite\x20pat'+_0xadcd4c(0x2a5)+_0xadcd4c(0x31d)+'ge\x20not\x20a'+'vailable',{'bridgePath':_0x17bd6e,'openclawVersion':_0x111539[_0xadcd4c(0x1e8)+'Version']});return;}for(const _0x38090c of _0x3d35bf){const _0x7b941c=await readFile(_0x38090c,_0xadcd4c(0x2b3)),_0x5b353a=patchSessionStoreLoadFromSource(_0x7b941c,{'bridgeImportPath':_0x4ace9c});if(!_0x5b353a[_0xadcd4c(0x27a)]){if(_0x5b353a[_0xadcd4c(0x169)]===_0xadcd4c(0x30b)+_0xadcd4c(0x27a)){_0x46fa6f[_0xadcd4c(0x1ae)+_0xadcd4c(0x1b9)]?.[_0xadcd4c(0x202)]?.('session\x20'+_0xadcd4c(0x1b1)+'ad\x20patch'+_0xadcd4c(0x2df)+'\x20applied',{'filePath':_0x38090c,'openclawVersion':_0x111539[_0xadcd4c(0x1e8)+'Version']});break;}continue;}await writeFile(_0x38090c,_0x5b353a[_0xadcd4c(0x2a0)],_0xadcd4c(0x2b3)),_0x46fa6f['runtimeL'+_0xadcd4c(0x1b9)]?.[_0xadcd4c(0x202)]?.('session\x20'+_0xadcd4c(0x1b1)+'ad\x20patch'+_0xadcd4c(0x1dc),{'filePath':_0x38090c,'openclawVersion':_0x111539['openclaw'+'Version']});break;}for(const _0x46ddb3 of _0x4ff51a){const _0x31cfec=await readFile(_0x46ddb3,_0xadcd4c(0x2b3)),_0x3076c4=patchSessionStoreWriteFromSource(_0x31cfec,{'bridgeImportPath':_0x4ace9c});if(!_0x3076c4[_0xadcd4c(0x27a)]){if(_0x3076c4[_0xadcd4c(0x169)]===_0xadcd4c(0x30b)+_0xadcd4c(0x27a)){_0x46fa6f[_0xadcd4c(0x1ae)+_0xadcd4c(0x1b9)]?.[_0xadcd4c(0x202)]?.('session\x20'+_0xadcd4c(0x250)+_0xadcd4c(0x258)+_0xadcd4c(0x217)+_0xadcd4c(0x25b)+'d',{'filePath':_0x46ddb3,'openclawVersion':_0x111539[_0xadcd4c(0x1e8)+_0xadcd4c(0x1aa)]});break;}continue;}await writeFile(_0x46ddb3,_0x3076c4[_0xadcd4c(0x2a0)],_0xadcd4c(0x2b3)),_0x46fa6f[_0xadcd4c(0x1ae)+_0xadcd4c(0x1b9)]?.[_0xadcd4c(0x202)]?.(_0xadcd4c(0x147)+_0xadcd4c(0x250)+_0xadcd4c(0x258)+_0xadcd4c(0x1ee)+'d',{'filePath':_0x46ddb3,'openclawVersion':_0x111539[_0xadcd4c(0x1e8)+_0xadcd4c(0x1aa)]});break;}}async function resolveRuntimeChannelImportPath(_0x1077a9,_0x10ba67){const _0x232c6d=_0x5a6cc0,_0x3f36ca=_0x10ba67['filter'](_0x441dbf=>_0x441dbf[_0x232c6d(0x2a3)]()&&_0x441dbf[_0x232c6d(0x231)][_0x232c6d(0x26c)+'th']('runtime-'+_0x232c6d(0x14c))&&_0x441dbf[_0x232c6d(0x231)][_0x232c6d(0x2ff)]('.js')&&!_0x441dbf[_0x232c6d(0x231)][_0x232c6d(0x26c)+'th']('runtime-'+_0x232c6d(0x14c)+_0x232c6d(0x289)))['map'](_0x2be3dd=>_0x2be3dd[_0x232c6d(0x231)])[_0x232c6d(0x1ca)]();for(const _0x151658 of _0x3f36ca){const _0x20bb8=await readFile(join(_0x1077a9,_0x151658),_0x232c6d(0x2b3));if(_0x20bb8['includes']('createRu'+'ntimeCha'+'nnel'))return'./'+_0x151658;}return null;}function normalizeRuntimeRelativePath(_0x5714bb){const _0x38af7a=_0x5a6cc0;return _0x5714bb[_0x38af7a(0x120)+'ll']('\x5c','/');}function toWindowsPath(_0x116556){const _0x3f1a42=_0x5a6cc0;return _0x116556[_0x3f1a42(0x120)+'ll']('/','\x5c');}function validateRuntimeNodeVersion(_0x13bf0e,_0x34241f){const _0x420389=_0x5a6cc0;if(_0x13bf0e[_0x420389(0x20e)+'ion']===_0x34241f[_0x420389(0x1e8)]['nodeVers'+_0x420389(0x2a1)])return;throw new Error(_0x420389(0x160)+_0x420389(0x20e)+'ion\x20mism'+_0x420389(0x2ea)+_0x420389(0x1a3)+(_0x13bf0e[_0x420389(0x20e)+_0x420389(0x2a1)]||_0x420389(0x23d))+(_0x420389(0x1b0)+'config=')+_0x34241f[_0x420389(0x1e8)][_0x420389(0x20e)+_0x420389(0x2a1)]+'.\x20'+(_0x420389(0x1a0)+'ie-shell'+_0x420389(0x195)+_0x420389(0x2c0)+_0x420389(0x21f)+_0x420389(0x199)+'\x20can\x20be\x20'+_0x420389(0x1ea)+_0x420389(0x2ac)+_0x420389(0x25a)+'red\x20Node'+_0x420389(0x128)+'.'));}function validateRuntimeOpenClawVersion(_0x28f1b7,_0x5c7f9e){const _0x57c77c=_0x5a6cc0;if(_0x28f1b7[_0x57c77c(0x1e8)+'Version']===_0x5c7f9e[_0x57c77c(0x1e8)][_0x57c77c(0x1e8)+_0x57c77c(0x1aa)])return;throw new Error(_0x57c77c(0x160)+_0x57c77c(0x1e8)+_0x57c77c(0x1f2)+_0x57c77c(0x30c)+':\x20manife'+_0x57c77c(0x2af)+(_0x28f1b7[_0x57c77c(0x1e8)+_0x57c77c(0x1aa)]||_0x57c77c(0x23d))+(_0x57c77c(0x1b0)+_0x57c77c(0x23a))+_0x5c7f9e[_0x57c77c(0x1e8)][_0x57c77c(0x1e8)+_0x57c77c(0x1aa)]+'.\x20'+(_0x57c77c(0x1a0)+_0x57c77c(0x185)+_0x57c77c(0x195)+'\x22\x20so\x20the'+_0x57c77c(0x199)+_0x57c77c(0x24b)+_0x57c77c(0x19f)+_0x57c77c(0x25a)+_0x57c77c(0x27f)+'Claw\x20ver'+_0x57c77c(0x149)));}function parseNpmPackJson(_0x10959c){const _0x984498=_0x5a6cc0,_0x8a7164=_0x10959c[_0x984498(0x28f)](),_0x211824=_0x8a7164[_0x984498(0x249)]('[');if(_0x211824<0x0)throw new Error('npm\x20pack'+_0x984498(0x1f4)+_0x984498(0x1bd)+_0x984498(0x304)+_0x8a7164[_0x984498(0x2b7)](0x0,0x1f4));const _0x4f2e9a=JSON[_0x984498(0x189)](_0x8a7164[_0x984498(0x2b7)](_0x211824)),_0x126b40=Array[_0x984498(0x2cc)](_0x4f2e9a)?_0x4f2e9a[0x0]:_0x4f2e9a;if(!_0x126b40||typeof _0x126b40!==_0x984498(0x22b))throw new Error(_0x984498(0x2e8)+'\x20returne'+_0x984498(0x178)+_0x984498(0x24e)+_0x984498(0x2d6)+_0x8a7164['slice'](0x0,0x1f4));return _0x126b40;}function normalizePackedTarballFilename(_0x355df0){const _0x3700c4=_0x5a6cc0;return _0x355df0[_0x3700c4(0x27d)](/^@/,'')[_0x3700c4(0x120)+'ll']('/','-')[_0x3700c4(0x120)+'ll']('\x5c','-');}async function runProcess(_0x24103a,_0x11423c,_0x54cc04={}){const _0x486b79=_0x5a6cc0,_0x1835b1=_0x54cc04[_0x486b79(0x243)]||[_0x24103a,..._0x11423c][_0x486b79(0x150)]('\x20'),_0x213e13=_0x54cc04[_0x486b79(0x306)+'s']??NPM_INSTALL_TIMEOUT_MS,_0x216c7c=spawn(_0x24103a,_0x11423c,{'cwd':_0x54cc04['cwd'],'env':_0x54cc04['env'],'stdio':[_0x486b79(0x2ed),_0x486b79(0x162),_0x486b79(0x162)]});return await new Promise((_0x1bef07,_0x355a2e)=>{const _0x5cdc9b=_0x486b79;let _0x5b5b86='',_0x7db211='',_0x40f422=![];const _0xd22909=setTimeout(()=>{const _0x19b3b0=_0x5e0d;if(_0x40f422)return;_0x40f422=!![],_0x216c7c[_0x19b3b0(0x319)](_0x19b3b0(0x227)),_0x355a2e(new Error(_0x1835b1+(_0x19b3b0(0x12c)+_0x19b3b0(0x2ee)+'\x20')+_0x213e13+'ms'));},_0x213e13);_0x216c7c[_0x5cdc9b(0x273)]['on'](_0x5cdc9b(0x19c),_0x11e8ed=>{const _0x1d343f=_0x5cdc9b;_0x5b5b86+=_0x11e8ed[_0x1d343f(0x248)]();}),_0x216c7c[_0x5cdc9b(0x165)]['on']('data',_0x4625d8=>{const _0xb669fd=_0x5cdc9b;_0x7db211+=_0x4625d8[_0xb669fd(0x248)]();}),_0x216c7c['on'](_0x5cdc9b(0x1f9),_0x3d10bd=>{if(_0x40f422)return;_0x40f422=!![],clearTimeout(_0xd22909),_0x355a2e(_0x3d10bd);}),_0x216c7c['on']('close',(_0x4451f3,_0x5664f3)=>{const _0x3c7b7a=_0x5cdc9b;if(_0x40f422)return;_0x40f422=!![],clearTimeout(_0xd22909);if(_0x4451f3===0x0){_0x1bef07({'stdout':_0x5b5b86,'stderr':_0x7db211});return;}_0x355a2e(new Error(_0x1835b1+(_0x3c7b7a(0x1b8)+_0x3c7b7a(0x232)+'e=')+(_0x4451f3??'null')+_0x3c7b7a(0x31e)+(_0x5664f3??_0x3c7b7a(0x241))+'\x0a'+(''+(_0x7db211||_0x5b5b86))[_0x3c7b7a(0x28f)]()));});});}async function installOpenClawPackage(_0x222729,_0x1f3a1f){const _0x16989f=_0x5a6cc0,_0x4e708a=join(_0x222729['runtimeR'+_0x16989f(0x1ef)],'.cache'),_0x51bef9=join(_0x222729[_0x16989f(0x2d1)+'oot'],_0x16989f(0x2c5)+'w-extrac'+'t');await mkdir(_0x4e708a,{'recursive':!![]}),await removePathWithRetries(_0x51bef9),await mkdir(_0x51bef9,{'recursive':!![]});const _0x22cdb9=await createRuntimeEnv(_0x222729),_0x5b4863='openclaw'+'@'+_0x1f3a1f;console[_0x16989f(0x1ad)](_0x16989f(0x146)+'hell:run'+_0x16989f(0x25c)+'stalling'+'\x20'+_0x5b4863);const _0x5e7401=await runProcess(_0x222729[_0x16989f(0x1c4)+_0x16989f(0x1a5)],[_0x222729[_0x16989f(0x1a4)],'pack',_0x5b4863,'--json'],{'cwd':_0x4e708a,'env':_0x22cdb9,'label':_0x16989f(0x2e8)+'\x20'+_0x5b4863}),_0x296283=parseNpmPackJson(_0x5e7401[_0x16989f(0x273)]);if(_0x296283[_0x16989f(0x2fb)]!==_0x1f3a1f)throw new Error(_0x16989f(0x2e0)+_0x16989f(0x2bd)+'law\x20'+_0x1f3a1f+(_0x16989f(0x245)+_0x16989f(0x221))+_0x296283['version']);const _0x4bdd92=resolve(_0x4e708a,_0x296283[_0x16989f(0x1fd)]);if(!existsSync(_0x4bdd92))throw new Error(_0x16989f(0x2e8)+_0x16989f(0x1f4)+'\x20create\x20'+_0x16989f(0x309)+'\x20'+_0x4bdd92);await runProcess(_0x16989f(0x196),[_0x16989f(0x136),_0x4bdd92,'-C',_0x51bef9],{'label':'extract\x20'+_0x296283[_0x16989f(0x1fd)]}),await removePathWithRetries(_0x222729[_0x16989f(0x1e8)+'WorkingD'+'ir']),await rename(join(_0x51bef9,_0x16989f(0x1db)),_0x222729[_0x16989f(0x1e8)+_0x16989f(0x17b)+'ir']),await removePathWithRetries(_0x51bef9),await runProcess(_0x222729[_0x16989f(0x1c4)+_0x16989f(0x1a5)],[_0x222729[_0x16989f(0x1a4)],_0x16989f(0x1d2),'--omit=d'+'ev','--omit=p'+'eer','--no-aud'+'it',_0x16989f(0x246)+'d',_0x16989f(0x2e6)+_0x16989f(0x159)+'ps'],{'cwd':_0x222729[_0x16989f(0x1e8)+'WorkingD'+'ir'],'env':_0x22cdb9,'label':_0x16989f(0x22f)+'all\x20'+_0x5b4863+('\x20runtime'+'\x20depende'+_0x16989f(0x2e2))});if(!existsSync(_0x222729[_0x16989f(0x1e8)+'Bin']))throw new Error(_0x16989f(0x268)+_0x16989f(0x251)+_0x16989f(0x299)+_0x16989f(0x315)+_0x16989f(0x1c6)+':\x20'+_0x222729[_0x16989f(0x1e8)+'Bin']);}async function ensureRuntimeBase(_0x326a4f,_0x33e095,_0x56aa7d={}){const _0x200e16=_0x5a6cc0;await mkdir(_0x33e095,{'recursive':!![]});let _0x12007e=await readRuntimeManifest(_0x33e095);const _0x58efea=_0x326a4f[_0x200e16(0x1e8)][_0x200e16(0x20e)+_0x200e16(0x2a1)],_0x1b83ee=_0x326a4f['openclaw']['openclaw'+_0x200e16(0x1aa)],_0x548995=existsSync(resolveManifestPath(_0x33e095)),_0x243c1e=runtimeHasRequiredPaths(_0x33e095,_0x12007e),_0x25f26c=_0x12007e['nodeVers'+_0x200e16(0x2a1)]===_0x58efea;!_0x548995||!_0x243c1e||!_0x25f26c?(_0x56aa7d[_0x200e16(0x1ae)+_0x200e16(0x1b9)]?.['info']('runtime\x20'+'base\x20bui'+_0x200e16(0x1d0)+'ed',{'runtimeRoot':_0x33e095,'reason':!_0x548995?_0x200e16(0x24c)+'manifest':!_0x243c1e?'missing\x20'+'required'+_0x200e16(0x199)+'\x20paths':_0x200e16(0x2d0)+_0x200e16(0x13c)+_0x200e16(0x201),'syncOnly':_0x56aa7d[_0x200e16(0x1a2)]}),_0x12007e=await buildRuntimeBase(_0x326a4f,_0x33e095,_0x12007e),_0x56aa7d[_0x200e16(0x1ae)+_0x200e16(0x1b9)]?.['info']('runtime\x20'+_0x200e16(0x239)+_0x200e16(0x2f6)+'eted',{'manifest':summarizeRuntimeManifest(_0x12007e)})):_0x56aa7d[_0x200e16(0x1ae)+_0x200e16(0x1b9)]?.['info'](_0x200e16(0x160)+_0x200e16(0x14f)+_0x200e16(0x15e)+_0x200e16(0x1fe),{'manifest':summarizeRuntimeManifest(_0x12007e)});if(!existsSync(resolve(_0x33e095,_0x12007e[_0x200e16(0x1e8)+_0x200e16(0x2c3)]))){const _0x848fbe=createRuntimeInfoFromManifest(_0x33e095,_0x12007e,{'allowMissingOpenClaw':!![]});await installOpenClawPackage(_0x848fbe,_0x1b83ee),_0x12007e[_0x200e16(0x1e8)+_0x200e16(0x1aa)]=_0x1b83ee;}return _0x12007e;}function runtimeHasRequiredPaths(_0x479f2b,_0x34348b){const _0xc34db0=_0x5a6cc0;return[_0xc34db0(0x1c4)+_0xc34db0(0x1a5),'npmCli','openclaw'+_0xc34db0(0x17b)+'ir',_0xc34db0(0x1e8)+'Bin'][_0xc34db0(0x2e7)](_0x4a36ab=>typeof _0x34348b[_0x4a36ab]===_0xc34db0(0x1df)&&_0x34348b[_0x4a36ab]['trim']())&&[_0xc34db0(0x1c4)+_0xc34db0(0x1a5),_0xc34db0(0x1a4)][_0xc34db0(0x2e7)](_0x64a9e=>existsSync(resolve(_0x479f2b,_0x34348b[_0x64a9e])));}async function buildRuntimeBase(_0x240b34,_0x363b2a,_0x3bcbfc={}){const _0x3cee21=_0x5a6cc0,_0x568345=join(_0x363b2a,_0x3cee21(0x205));await ensureRuntimeNode(_0x240b34,_0x568345);const _0x45d2c4={..._0x3bcbfc,'generatedAt':new Date()['toISOStr'+'ing'](),'nodeVersion':_0x240b34[_0x3cee21(0x1e8)][_0x3cee21(0x20e)+_0x3cee21(0x2a1)],'openclawVersion':_0x3bcbfc[_0x3cee21(0x1e8)+_0x3cee21(0x1aa)]||'','platform':process[_0x3cee21(0x31b)],'arch':process[_0x3cee21(0x167)],'nodeExecutable':_0x3cee21(0x26f)+_0x3cee21(0x184),'npmCli':_0x3cee21(0x13e)+_0x3cee21(0x2d4)+'dules/np'+'m/bin/np'+_0x3cee21(0x144),'openclawWorkingDir':_0x3cee21(0x1e8),'openclawBin':_0x3cee21(0x1e8)+_0x3cee21(0x121)+'w.mjs'};return await writeJson(resolveManifestPath(_0x363b2a),_0x45d2c4),_0x45d2c4;}async function removePathWithRetries(_0x526cad){await rm(_0x526cad,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96});}async function ensureRuntimeNode(_0x48701d,_0x10de51){const _0x229b72=_0x5a6cc0,_0x5bac70=_0x48701d['openclaw'][_0x229b72(0x20e)+'ion'],_0x18612c=join(_0x10de51,_0x229b72(0x188),_0x229b72(0x205)),_0x32176e=join(_0x10de51,_0x229b72(0x244),'node_mod'+'ules',_0x229b72(0x2db),_0x229b72(0x188),'npm-cli.'+'js');if(existsSync(_0x18612c)&&existsSync(_0x32176e)&&await getNodeVersion(_0x18612c)===_0x5bac70)return;await removePathWithRetries(_0x10de51);if(process['versions'][_0x229b72(0x205)]===_0x5bac70){await linkCurrentNodeRuntime(_0x10de51);return;}await downloadNodeRuntime(_0x5bac70,_0x10de51);}async function getNodeVersion(_0x298780){const _0x2df71a=_0x5a6cc0;try{const _0x2b8340=await runProcess(_0x298780,['-p',_0x2df71a(0x18c)+_0x2df71a(0x263)+_0x2df71a(0x312)],{'label':_0x298780+_0x2df71a(0x128),'timeoutMs':0x7530});return _0x2b8340['stdout'][_0x2df71a(0x28f)]();}catch{return'';}}function _0x5e0d(_0x2bb88a,_0x5bfb07){_0x2bb88a=_0x2bb88a-0x11f;const _0x179917=_0x1799();let _0x5e0d0e=_0x179917[_0x2bb88a];return _0x5e0d0e;}async function linkCurrentNodeRuntime(_0x379f50){const _0x395b2f=_0x5a6cc0,_0x3943f5=process[_0x395b2f(0x26b)],_0x34ef85=resolve(dirname(_0x3943f5),'..'),_0x4bab4a=resolve(_0x34ef85,_0x395b2f(0x292)+_0x395b2f(0x2f2)+_0x395b2f(0x2f3)),_0x13e624=join(_0x379f50,_0x395b2f(0x188),_0x395b2f(0x205)),_0x4399fc=join(_0x379f50,'lib',_0x395b2f(0x134)+_0x395b2f(0x235),_0x395b2f(0x2db));await mkdir(dirname(_0x13e624),{'recursive':!![]}),await mkdir(dirname(_0x4399fc),{'recursive':!![]}),await symlink(_0x3943f5,_0x13e624),existsSync(_0x4bab4a)?await symlink(_0x4bab4a,_0x4399fc):await symlink(await resolveNpmRoot(),_0x4399fc);}async function resolveNpmRoot(){const _0x35d152=_0x5a6cc0,_0x58dc35=await runProcess(_0x35d152(0x2db),[_0x35d152(0x127),'-g'],{'label':_0x35d152(0x16b)+'\x20-g','timeoutMs':0x7530}),_0x155164=join(_0x58dc35['stdout']['trim'](),_0x35d152(0x2db));if(!existsSync(join(_0x155164,_0x35d152(0x188),_0x35d152(0x2a2)+'js')))throw new Error(_0x35d152(0x2e8)+_0x35d152(0x20f)+_0x35d152(0x12f)+_0x35d152(0x207)+_0x35d152(0x233)+_0x35d152(0x14d)+_0x35d152(0x2b4)+_0x155164);return _0x155164;}async function downloadNodeRuntime(_0x3b00fb,_0xa572d9){const _0x29bf8e=_0x5a6cc0,_0x3fcf99=process['platform']===_0x29bf8e(0x130)?_0x29bf8e(0x13b):process[_0x29bf8e(0x31b)],_0x498829=process[_0x29bf8e(0x167)]===_0x29bf8e(0x311)?_0x29bf8e(0x311):process[_0x29bf8e(0x167)]===_0x29bf8e(0x29e)?_0x29bf8e(0x29e):process[_0x29bf8e(0x167)],_0x4d0633=process[_0x29bf8e(0x31b)]===_0x29bf8e(0x130)?_0x29bf8e(0x240):_0x29bf8e(0x22d),_0x19e8cd=_0x29bf8e(0x23f)+_0x3b00fb+'-'+_0x3fcf99+'-'+_0x498829,_0x597d28=_0x19e8cd+'.'+_0x4d0633,_0x14c16c=join(dirname(_0xa572d9),_0x29bf8e(0x301)),_0x273b56=join(_0x14c16c,_0x597d28),_0x3a4326=join(_0x14c16c,_0x19e8cd+(_0x29bf8e(0x177)+'-')+process[_0x29bf8e(0x2cf)]+'-'+Date['now']()),_0x39094e=_0x29bf8e(0x1b7)+'nodejs.o'+'rg/dist/'+'v'+_0x3b00fb+'/'+_0x597d28;await mkdir(_0x14c16c,{'recursive':!![]}),!existsSync(_0x273b56)&&(console['log'](_0x29bf8e(0x146)+'hell:run'+_0x29bf8e(0x264)+_0x29bf8e(0x164)+'g\x20'+_0x39094e),await downloadFile(_0x39094e,_0x273b56)),await rm(_0x3a4326,{'recursive':!![],'force':!![]}),await mkdir(_0x3a4326,{'recursive':!![]}),process[_0x29bf8e(0x31b)]===_0x29bf8e(0x130)?await runProcess(_0x29bf8e(0x2ad),['-q',_0x273b56,'-d',_0x3a4326],{'label':_0x29bf8e(0x142)+_0x597d28}):await runProcess('tar',[_0x29bf8e(0x21a),_0x273b56,'-C',_0x3a4326],{'label':_0x29bf8e(0x142)+_0x597d28}),await rename(join(_0x3a4326,_0x19e8cd),_0xa572d9),await rm(_0x3a4326,{'recursive':!![],'force':!![]});}async function downloadFile(_0x4b48ed,_0x53ff4a){await mkdir(dirname(_0x53ff4a),{'recursive':!![]});const _0x57b331=await new Promise((_0x50605a,_0x25f270)=>{const _0x1bd7e6=_0x5e0d;get(_0x4b48ed,_0x4aa3f2=>{const _0x3cbc89=_0x5e0d;if(_0x4aa3f2[_0x3cbc89(0x2f1)+'de']>=0x12c&&_0x4aa3f2[_0x3cbc89(0x2f1)+'de']<0x190&&_0x4aa3f2[_0x3cbc89(0x16c)]['location']){_0x4aa3f2[_0x3cbc89(0x161)](),downloadFile(new URL(_0x4aa3f2[_0x3cbc89(0x16c)][_0x3cbc89(0x2c6)],_0x4b48ed)[_0x3cbc89(0x1a1)],_0x53ff4a)['then'](()=>_0x50605a(null))[_0x3cbc89(0x2d8)](_0x25f270);return;}if(_0x4aa3f2[_0x3cbc89(0x2f1)+'de']!==0xc8){_0x4aa3f2[_0x3cbc89(0x161)](),_0x25f270(new Error(_0x3cbc89(0x1c7)+_0x3cbc89(0x1b8)+_0x4aa3f2[_0x3cbc89(0x2f1)+'de']+':\x20'+_0x4b48ed));return;}_0x50605a(_0x4aa3f2);})['on'](_0x1bd7e6(0x1f9),_0x25f270);});_0x57b331&&await pipeline(_0x57b331,createWriteStream(_0x53ff4a));}export async function ensureOpenClawDoctorFixed(_0x378401,_0x3eb268={}){const _0x18f323=_0x5a6cc0,_0x1c15f5=await loadRuntimeInfo(_0x378401[_0x18f323(0x187)+_0x18f323(0x1ef)]),_0x351598=getConfigPaths(_0x378401),_0x42fdc5=join(_0x351598['runtimeS'+_0x18f323(0x1e9)],'openclaw'+_0x18f323(0x1b2)+_0x18f323(0x208)),_0x47a505=await readJson(_0x42fdc5,{});if(_0x47a505[_0x18f323(0x1e8)+_0x18f323(0x1aa)]===_0x1c15f5['openclaw'+_0x18f323(0x1aa)])return _0x3eb268[_0x18f323(0x1ae)+_0x18f323(0x1b9)]?.[_0x18f323(0x202)](_0x18f323(0x1e8)+'\x20doctor\x20'+_0x18f323(0x234)+'ady\x20curr'+_0x18f323(0x176),{'openclawVersion':_0x1c15f5[_0x18f323(0x1e8)+_0x18f323(0x1aa)],'markerPath':_0x42fdc5}),{'ran':![],'openclawVersion':_0x1c15f5[_0x18f323(0x1e8)+_0x18f323(0x1aa)],'markerPath':_0x42fdc5};return await runOpenClawDoctorFix(_0x378401,_0x1c15f5,{'fromVersion':_0x47a505[_0x18f323(0x1e8)+_0x18f323(0x1aa)]||_0x18f323(0x23d),'toVersion':_0x1c15f5[_0x18f323(0x1e8)+_0x18f323(0x1aa)],'markerPath':_0x42fdc5,'runtimeLogger':_0x3eb268[_0x18f323(0x1ae)+'ogger']}),{'ran':!![],'openclawVersion':_0x1c15f5['openclaw'+_0x18f323(0x1aa)],'markerPath':_0x42fdc5};}async function runOpenClawDoctorFix(_0x2f51c0,_0x2eb435,{fromVersion:_0x3fbbfa,toVersion:_0x3255b7,markerPath:markerPath='',runtimeLogger:_0x26559e}={}){const _0x3bc0eb=_0x5a6cc0;_0x26559e?.['info']('openclaw'+_0x3bc0eb(0x2c2)+_0x3bc0eb(0x19d)+_0x3bc0eb(0x2da),{'fromVersion':_0x3fbbfa,'toVersion':_0x3255b7});const _0xe270df=await createRuntimeEnv(_0x2eb435,{'OPENCLAW_HOME':_0x2f51c0['dataDir'],'OPENCLAW_STATE_DIR':_0x2f51c0[_0x3bc0eb(0x2ba)],'OPENCLAW_CONFIG_PATH':getConfigPaths(_0x2f51c0)['configPa'+'th']});console['log'](_0x3bc0eb(0x146)+'hell:run'+_0x3bc0eb(0x2cb)+_0x3bc0eb(0x296)+_0x3bc0eb(0x270)+_0x3bc0eb(0x29f)+_0x3bc0eb(0x1cf));const _0x59407c=await runProcess(_0x2eb435[_0x3bc0eb(0x1c4)+_0x3bc0eb(0x1a5)],[_0x2eb435[_0x3bc0eb(0x1e8)+_0x3bc0eb(0x2c3)],_0x3bc0eb(0x223),_0x3bc0eb(0x29a)],{'cwd':_0x2eb435['openclaw'+_0x3bc0eb(0x17b)+'ir'],'env':_0xe270df,'label':_0x3bc0eb(0x1e8)+_0x3bc0eb(0x2c2)+_0x3bc0eb(0x29a),'timeoutMs':0x1d4c0});_0x26559e?.[_0x3bc0eb(0x202)](_0x3bc0eb(0x1e8)+_0x3bc0eb(0x2c2)+'fix\x20comp'+_0x3bc0eb(0x1cc),{'fromVersion':_0x3fbbfa,'toVersion':_0x3255b7,'stdout':_0x59407c['stdout'][_0x3bc0eb(0x28f)]()[_0x3bc0eb(0x2b7)](-0xfa0),'stderr':_0x59407c[_0x3bc0eb(0x165)][_0x3bc0eb(0x28f)]()[_0x3bc0eb(0x2b7)](-0xfa0)}),markerPath&&(await writeJson(markerPath,{'openclawVersion':_0x2eb435['openclaw'+'Version'],'fixedAt':new Date()[_0x3bc0eb(0x209)+_0x3bc0eb(0x1eb)]()}),_0x26559e?.['info'](_0x3bc0eb(0x1e8)+_0x3bc0eb(0x2c2)+'fix\x20mark'+_0x3bc0eb(0x17e)+'en',{'markerPath':markerPath,'openclawVersion':_0x2eb435[_0x3bc0eb(0x1e8)+_0x3bc0eb(0x1aa)]}));}export async function readRuntimeManifest(_0x812be2){return await readJson(resolveManifestPath(_0x812be2),{});}export async function loadRuntimeInfo(_0x4a613a){const _0x1f0531=resolveRuntimeRoot(_0x4a613a),_0x5ac0dc=await readRuntimeManifest(_0x1f0531);return createRuntimeInfoFromManifest(_0x1f0531,_0x5ac0dc);}function createRuntimeInfoFromManifest(_0x368d91,_0x242d5c,_0x16b92a={}){const _0x2426b8=_0x5a6cc0;for(const _0x2fed3d of[_0x2426b8(0x1c4)+_0x2426b8(0x1a5),'npmCli',_0x2426b8(0x1e8)+'WorkingD'+'ir',_0x2426b8(0x1e8)+_0x2426b8(0x2c3)]){if(typeof _0x242d5c[_0x2fed3d]!==_0x2426b8(0x1df)||!_0x242d5c[_0x2fed3d][_0x2426b8(0x28f)]())throw new Error(_0x2426b8(0x160)+_0x2426b8(0x279)+_0x2426b8(0x15c)+_0x2426b8(0x197)+_0x2fed3d+_0x2426b8(0x2fa)+resolveManifestPath(_0x368d91)+(_0x2426b8(0x247)+_0x2426b8(0x283)+'l\x20prepar'+'e'));}const _0x56e7d3=resolve(_0x368d91,_0x242d5c[_0x2426b8(0x1c4)+'utable']),_0x3964d7=resolve(_0x368d91,_0x242d5c[_0x2426b8(0x1a4)]),_0x16b440=resolve(_0x368d91,_0x242d5c[_0x2426b8(0x1e8)+_0x2426b8(0x17b)+'ir']),_0x56f495=resolve(_0x368d91,_0x242d5c['openclaw'+_0x2426b8(0x2c3)]),_0x3cb6f0=Array[_0x2426b8(0x2cc)](_0x242d5c['plugins'])?_0x242d5c['plugins'][_0x2426b8(0x1ab)](_0x3d1949=>({..._0x3d1949,'installPath':resolve(_0x368d91,_0x3d1949[_0x2426b8(0x1a8)+_0x2426b8(0x148)])})):[],_0xc001cf=_0x16b92a['allowMis'+_0x2426b8(0x30f)+_0x2426b8(0x14a)]?[_0x56e7d3,_0x3964d7]:[_0x56e7d3,_0x3964d7,_0x16b440,_0x56f495];for(const _0x2588fe of _0xc001cf){if(!existsSync(_0x2588fe))throw new Error(_0x2426b8(0x160)+'missing\x20'+'path:\x20'+_0x2588fe);}return{'runtimeRoot':_0x368d91,'manifest':_0x242d5c,'openclawVersion':_0x242d5c[_0x2426b8(0x1e8)+_0x2426b8(0x1aa)]||'unknown','nodeExecutable':_0x56e7d3,'npmCli':_0x3964d7,'openclawWorkingDir':_0x16b440,'openclawBin':_0x56f495,'plugins':_0x3cb6f0};}export async function spawnClaw(_0x32d354,_0x5b0893=[],_0x420db0={}){const _0x234685=_0x5a6cc0,_0x1191eb=await loadRuntimeInfo(_0x32d354),_0x30b909=await createRuntimeEnv(_0x1191eb,_0x420db0[_0x234685(0x271)]??{});return spawn(_0x1191eb[_0x234685(0x1c4)+'utable'],[_0x1191eb['openclaw'+'Bin'],..._0x5b0893],{'cwd':_0x1191eb['openclaw'+_0x234685(0x17b)+'ir'],'stdio':'pipe',..._0x420db0,'env':_0x30b909});}export async function runClawOnce(_0x386317,_0x218403=[],_0x2f1956=0x15f90){const _0x17bfcd=await spawnClaw(_0x386317,_0x218403);return await new Promise((_0x233972,_0x3176ae)=>{const _0x790c5a=_0x5e0d;let _0x2ce1c5='',_0x5e99b6='',_0x33bbec=![];const _0x5d9113=setTimeout(()=>{const _0x3d8f4e=_0x5e0d;if(_0x33bbec)return;_0x33bbec=!![],_0x17bfcd[_0x3d8f4e(0x319)](_0x3d8f4e(0x227)),_0x3176ae(new Error(_0x3d8f4e(0x1e8)+_0x3d8f4e(0x12c)+_0x3d8f4e(0x2ee)+'\x20'+_0x2f1956+'ms'));},_0x2f1956);_0x17bfcd[_0x790c5a(0x273)]['on'](_0x790c5a(0x19c),_0x11824e=>{_0x2ce1c5+=_0x11824e['toString']();}),_0x17bfcd[_0x790c5a(0x165)]['on']('data',_0x3c5fc8=>{const _0xc6f6e4=_0x790c5a;_0x5e99b6+=_0x3c5fc8[_0xc6f6e4(0x248)]();}),_0x17bfcd['on'](_0x790c5a(0x1f9),_0xb1e568=>{if(_0x33bbec)return;_0x33bbec=!![],clearTimeout(_0x5d9113),_0x3176ae(_0xb1e568);}),_0x17bfcd['on'](_0x790c5a(0x190),(_0x505149,_0x17f02f)=>{if(_0x33bbec)return;_0x33bbec=!![],clearTimeout(_0x5d9113),_0x233972({'code':_0x505149,'signal':_0x17f02f,'stdout':_0x2ce1c5,'stderr':_0x5e99b6});});});}async function findRuntimeLarkCliBin(_0x14e2f5){const _0x3130b6=_0x5a6cc0,_0x36607d=join(_0x14e2f5[_0x3130b6(0x1e8)+'WorkingD'+'ir'],'node_mod'+'ules',_0x3130b6(0x31a)+'te',_0x3130b6(0x145)),_0x13b3b0=join(_0x36607d,'package.'+_0x3130b6(0x208));if(!existsSync(_0x13b3b0))return{'packageDir':_0x36607d,'binPath':null};try{const _0x1b782f=JSON[_0x3130b6(0x189)](await readFile(_0x13b3b0,_0x3130b6(0x2b3))),_0x3e4f96=typeof _0x1b782f[_0x3130b6(0x188)]===_0x3130b6(0x1df)?_0x1b782f[_0x3130b6(0x188)]:_0x1b782f['bin']&&typeof _0x1b782f['bin']===_0x3130b6(0x22b)?_0x1b782f[_0x3130b6(0x188)]['lark-cli']||Object['values'](_0x1b782f['bin'])[0x0]:'';return{'packageDir':_0x36607d,'binPath':_0x3e4f96?join(_0x36607d,_0x3e4f96):null};}catch{return{'packageDir':_0x36607d,'binPath':null};}}export async function resolveRuntimeLarkCliCommand(_0x36d8e7){const _0x142142=_0x5a6cc0,{packageDir:_0x52b4dd,binPath:_0xd860a5}=await findRuntimeLarkCliBin(_0x36d8e7);if(!_0xd860a5||!existsSync(_0xd860a5))throw new Error(_0x142142(0x1d9)+_0x142142(0x31a)+_0x142142(0x300)+_0x142142(0x2dd)+'g\x20from\x20O'+_0x142142(0x179)+_0x142142(0x1e0)+'\x20'+_0x52b4dd+(_0x142142(0x2be)+_0x142142(0x18f)+_0x142142(0x17f)+'re\x22\x20to\x20r'+_0x142142(0x157)+'he\x20runti'+_0x142142(0x15d)));return{'nodeExecutable':_0x36d8e7[_0x142142(0x1c4)+_0x142142(0x1a5)],'scriptPath':_0xd860a5,'packageDir':_0x52b4dd};}function resolvePackageNameFromNpmSpec(_0x492f6a){const _0x71ed54=_0x5a6cc0,_0x86c714=_0x492f6a[_0x71ed54(0x28f)]()['replace'](/^npm:/,'');if(!_0x86c714)throw new Error(_0x71ed54(0x285)+_0x71ed54(0x1fa)+_0x71ed54(0x154)+'c');if(_0x86c714[_0x71ed54(0x26c)+'th']('@')){const _0x555de5=_0x86c714[_0x71ed54(0x249)]('/');if(_0x555de5===-0x1)throw new Error('Invalid\x20'+_0x71ed54(0x297)+'pec:\x20'+_0x492f6a);const _0x42f080=_0x86c714[_0x71ed54(0x249)]('@',_0x555de5+0x1);return _0x42f080===-0x1?_0x86c714:_0x86c714[_0x71ed54(0x2b7)](0x0,_0x42f080);}const _0x1c70b4=_0x86c714[_0x71ed54(0x249)]('@');return _0x1c70b4===-0x1?_0x86c714:_0x86c714[_0x71ed54(0x2b7)](0x0,_0x1c70b4);}async function createRuntimeEnv(_0x352d95,_0x234135={}){const _0x441668=_0x5a6cc0,_0x5f90a9=process.env.OPENCLAW_STATE_DIR||'',_0x5dd4bc=process.env.NPM_CONFIG_REGISTRY||'https://'+_0x441668(0x2f8)+_0x441668(0x1d3)+'or.com',_0x5b9d7d=_0x5f90a9?join(_0x5f90a9,_0x441668(0x280)+_0x441668(0x24d)+'ls'):join(_0x352d95['runtimeR'+'oot'],_0x441668(0x170)),_0x50b9ca=join(_0x5b9d7d,_0x441668(0x256)+'al'),_0xdd69d6=join(_0x5b9d7d,_0x441668(0x23b)+'e'),_0x1a0d30=join(_0x50b9ca,_0x441668(0x188));await mkdir(_0x1a0d30,{'recursive':!![]}),await mkdir(_0xdd69d6,{'recursive':!![]});const _0x111dbd=[_0x1a0d30,dirname(_0x352d95[_0x441668(0x1c4)+_0x441668(0x1a5)]),process.env.PATH||''];return{...process.env,..._0x234135,'PATH':_0x111dbd[_0x441668(0x2cd)](Boolean)[_0x441668(0x150)](delimiter),'npm_config_prefix':_0x50b9ca,'NPM_CONFIG_PREFIX':_0x50b9ca,'npm_config_cache':_0xdd69d6,'NPM_CONFIG_CACHE':_0xdd69d6,'NPM_CONFIG_REGISTRY':_0x5dd4bc,'npm_execpath':_0x352d95[_0x441668(0x1a4)],'npm_node_execpath':_0x352d95[_0x441668(0x1c4)+_0x441668(0x1a5)],'OPENCLAW_RUNTIME_NPM_PREFIX':_0x50b9ca,'OPENCLAW_RUNTIME_NPM_BIN':_0x1a0d30};}export async function getRuntimeSpawnContext(_0x12aa66,_0x4c8d47={}){const _0x2a5ad5=_0x5a6cc0,_0x4c54b7=await loadRuntimeInfo(_0x12aa66),_0x42f78b=await createRuntimeEnv(_0x4c54b7,_0x4c8d47);return{'cwd':_0x4c54b7[_0x2a5ad5(0x1e8)+'WorkingD'+'ir'],'env':_0x42f78b,'runtime':_0x4c54b7};}function resolvePluginDirNameFromSpec(_0x1c0cbb){const _0x1152fb=_0x5a6cc0,_0x52974a=resolvePackageNameFromNpmSpec(_0x1c0cbb),_0x45fdf4=_0x52974a['split']('/')['filter'](Boolean),_0x1210cd=_0x45fdf4['at'](-0x1)??'';if(!_0x1210cd)throw new Error(_0x1152fb(0x285)+'plugin\x20s'+'pec:\x20'+_0x1c0cbb);return _0x1210cd;}async function resolvePluginIdFromPackageDir(_0xfcbb7e,_0xfae1ec){const _0x451b23=_0x5a6cc0,_0x311e84=await readJson(join(_0xfcbb7e,_0x451b23(0x13d)+_0x451b23(0x208)),{}),_0x3f20c2=await readPluginManifest(_0xfcbb7e),_0x393aad=[_0x3f20c2?.['id'],_0x3f20c2?.[_0x451b23(0x262)],_0x3f20c2?.['name'],_0x311e84?.[_0x451b23(0x1e8)]?.['id'],_0x311e84?.[_0x451b23(0x1e8)+'Id'],_0xfae1ec],_0x1d2d8e=_0x393aad[_0x451b23(0x129)](_0x161e3e=>typeof _0x161e3e==='string'&&_0x161e3e['trim']());if(!_0x1d2d8e)throw new Error(_0x451b23(0x1f7)+_0x451b23(0x218)+_0x451b23(0x259)+_0x451b23(0x253)+'\x20'+_0xfcbb7e);return _0x1d2d8e['trim']();}function pluginSpecMatches(_0x3a99b2,_0x3f415a){const _0x5c3dd6=_0x5a6cc0,_0x13c0b4=_0x3f415a[_0x5c3dd6(0x28f)](),_0x20f984=resolvePackageNameFromNpmSpec(_0x13c0b4);return[_0x3a99b2[_0x5c3dd6(0x28d)],_0x3a99b2['resolved'+'Spec'],_0x3a99b2[_0x5c3dd6(0x11f)+_0x5c3dd6(0x2c8)]][_0x5c3dd6(0x16f)](_0x17e194=>_0x17e194===_0x13c0b4||_0x17e194===_0x20f984);}async function installPluginFromNpmSpec(_0x62efcb,_0x5c51fb,_0x4b9479={}){const _0x10b5ee=_0x5a6cc0,_0xfbfe77=_0x62efcb[_0x10b5ee(0x28f)]()['replace'](/^npm:/,''),_0x4783c0=resolvePluginDirNameFromSpec(_0xfbfe77),_0x2cc69d=join(_0x5c51fb[_0x10b5ee(0x1e8)+'WorkingD'+'ir'],_0x10b5ee(0x308),_0x10b5ee(0x274)+'ns'),_0x279e1a=join(_0x2cc69d,_0x4783c0),_0x504b86=join(_0x5c51fb[_0x10b5ee(0x2d1)+_0x10b5ee(0x1ef)],_0x10b5ee(0x175)+_0x10b5ee(0x307)+process[_0x10b5ee(0x2cf)]+'-'+Date[_0x10b5ee(0x1e7)]()),_0x29e316=await createRuntimeEnv(_0x5c51fb),_0x1f5f65=new Date()[_0x10b5ee(0x209)+_0x10b5ee(0x1eb)](),_0x4a49b2=join(_0x5c51fb['runtimeR'+_0x10b5ee(0x1ef)],'.cache');await mkdir(_0x4a49b2,{'recursive':!![]}),await rm(_0x504b86,{'recursive':!![],'force':!![]}),await rm(_0x279e1a,{'recursive':!![],'force':!![]}),await mkdir(_0x504b86,{'recursive':!![]}),await mkdir(_0x2cc69d,{'recursive':!![]}),console['log']('[wujie-s'+_0x10b5ee(0x26a)+'time]\x20fe'+_0x10b5ee(0x2fd)+_0x10b5ee(0x2a7)+_0xfbfe77);const _0x3f22ab=await runProcess(_0x5c51fb[_0x10b5ee(0x1c4)+_0x10b5ee(0x1a5)],[_0x5c51fb['npmCli'],_0x10b5ee(0x228),_0xfbfe77,_0x10b5ee(0x193)],{'cwd':_0x4a49b2,'env':_0x29e316,'label':_0x10b5ee(0x2e8)+'\x20'+_0xfbfe77}),_0x56e191=parseNpmPackJson(_0x3f22ab[_0x10b5ee(0x273)]),_0x2758fc=normalizePackedTarballFilename(_0x56e191[_0x10b5ee(0x1fd)]),_0x875408=join(_0x4a49b2,_0x2758fc);if(!existsSync(_0x875408))throw new Error('npm\x20pack'+_0x10b5ee(0x1f4)+_0x10b5ee(0x1f8)+_0x10b5ee(0x309)+'\x20'+_0x875408);await runProcess(_0x10b5ee(0x196),[_0x10b5ee(0x136),_0x875408,'-C',_0x504b86],{'label':_0x10b5ee(0x142)+_0x2758fc}),await rename(join(_0x504b86,'package'),_0x279e1a),await rm(_0x504b86,{'recursive':!![],'force':!![]});const _0x138a90=join(_0x279e1a,_0x10b5ee(0x13d)+_0x10b5ee(0x208)),_0x272858=await readJson(_0x138a90,{});(_0x272858[_0x10b5ee(0x1ff)+_0x10b5ee(0x1e4)]||_0x272858[_0x10b5ee(0x2e3)])&&(delete _0x272858[_0x10b5ee(0x1ff)+_0x10b5ee(0x1e4)],delete _0x272858[_0x10b5ee(0x2e3)],await writeJson(_0x138a90,_0x272858));await runProcess(_0x5c51fb[_0x10b5ee(0x1c4)+_0x10b5ee(0x1a5)],[_0x5c51fb['npmCli'],'install',_0x10b5ee(0x310)+'ev',_0x10b5ee(0x17d)+_0x10b5ee(0x124),'--no-aud'+'it','--no-fun'+'d',_0x10b5ee(0x2e6)+'-peer-de'+'ps'],{'cwd':_0x279e1a,'env':_0x29e316,'label':_0x10b5ee(0x22f)+_0x10b5ee(0x12e)+_0x10b5ee(0x1f0)+_0xfbfe77});const _0xe74136=new Date()[_0x10b5ee(0x209)+_0x10b5ee(0x1eb)](),_0x4be306=await resolvePluginIdFromPackageDir(_0x279e1a,_0x56e191['name']);return _0x4b9479[_0x10b5ee(0x1ae)+'ogger']?.[_0x10b5ee(0x202)](_0x10b5ee(0x24a)+_0x10b5ee(0x257)+_0x10b5ee(0x194),{'spec':_0xfbfe77,'pluginId':_0x4be306,'installPath':_0x279e1a}),{'pluginId':_0x4be306,'source':'npm','spec':_0xfbfe77,'installPath':toRuntimeRelative(_0x5c51fb[_0x10b5ee(0x2d1)+_0x10b5ee(0x1ef)],_0x279e1a),'version':_0x56e191[_0x10b5ee(0x2fb)],'resolvedName':_0x56e191[_0x10b5ee(0x231)],'resolvedVersion':_0x56e191['version'],'resolvedSpec':_0x56e191[_0x10b5ee(0x231)]+'@'+_0x56e191[_0x10b5ee(0x2fb)],'integrity':typeof _0x56e191[_0x10b5ee(0x19a)+'y']===_0x10b5ee(0x1df)?_0x56e191['integrit'+'y']:'','shasum':typeof _0x56e191['shasum']===_0x10b5ee(0x1df)?_0x56e191[_0x10b5ee(0x242)]:'','resolvedAt':_0x1f5f65,'installedAt':_0xe74136};}async function syncConfiguredNpmPlugins(_0x49b07c,_0x5aa535,_0xac17cc,_0x2c765f={}){const _0x23b0ff=_0x5a6cc0;if(_0x2c765f[_0x23b0ff(0x1a2)])return;const _0x2570d5=createRuntimeInfoFromManifest(_0x5aa535,_0xac17cc),_0x434ff9=Array[_0x23b0ff(0x2cc)](_0xac17cc[_0x23b0ff(0x2d9)])?_0xac17cc[_0x23b0ff(0x2d9)]:[],_0x812638=[];for(const _0x55591f of _0x49b07c[_0x23b0ff(0x1e8)]['pluginSp'+'ecs']){const _0x4d8117=_0x434ff9[_0x23b0ff(0x129)](_0x2af348=>_0x2af348?.[_0x23b0ff(0x2a0)]===_0x23b0ff(0x2db)&&pluginSpecMatches(_0x2af348,_0x55591f)&&typeof _0x2af348[_0x23b0ff(0x1a8)+_0x23b0ff(0x148)]===_0x23b0ff(0x1df)&&existsSync(resolve(_0x5aa535,_0x2af348[_0x23b0ff(0x1a8)+'ath'])));if(_0x4d8117){_0x812638[_0x23b0ff(0x281)](_0x4d8117);continue;}_0x812638[_0x23b0ff(0x281)](await installPluginFromNpmSpec(_0x55591f,_0x2570d5,_0x2c765f));}const _0x5f16d6=new Set(_0x49b07c[_0x23b0ff(0x1e8)][_0x23b0ff(0x277)+'ecs'][_0x23b0ff(0x1ab)](resolvePackageNameFromNpmSpec)),_0x2981d1=_0x434ff9[_0x23b0ff(0x2cd)](_0x44514c=>_0x44514c?.[_0x23b0ff(0x2a0)]!=='npm'||!_0x5f16d6[_0x23b0ff(0x254)](resolvePackageNameFromNpmSpec(_0x44514c['resolved'+_0x23b0ff(0x2c8)]||_0x44514c[_0x23b0ff(0x28d)]||'')));_0xac17cc[_0x23b0ff(0x2d9)]=[..._0x2981d1,..._0x812638];}function hasRuntimeDependencies(_0x5f1aef){const _0xc82748=_0x5a6cc0,_0x5d0aba=_0x5f1aef?.[_0xc82748(0x16a)+_0xc82748(0x1ba)]&&typeof _0x5f1aef[_0xc82748(0x16a)+_0xc82748(0x1ba)]===_0xc82748(0x22b)?Object[_0xc82748(0x265)](_0x5f1aef[_0xc82748(0x16a)+_0xc82748(0x1ba)]):[],_0x1a0ade=_0x5f1aef?.[_0xc82748(0x18b)+_0xc82748(0x140)+_0xc82748(0x1ba)]&&typeof _0x5f1aef[_0xc82748(0x18b)+_0xc82748(0x140)+_0xc82748(0x1ba)]===_0xc82748(0x22b)?Object[_0xc82748(0x265)](_0x5f1aef[_0xc82748(0x18b)+'Dependen'+_0xc82748(0x1ba)]):[];return _0x5d0aba[_0xc82748(0x2ae)]>0x0||_0x1a0ade['length']>0x0;}async function installLocalPluginRuntimeDependencies(_0x536798,_0x426d09,_0x5ac25b){const _0x34f9f1=_0x5a6cc0,_0x2af84a=join(_0x536798,_0x34f9f1(0x13d)+_0x34f9f1(0x208)),_0x17b2a5=await readJson(_0x2af84a,{});(_0x17b2a5[_0x34f9f1(0x1ff)+_0x34f9f1(0x1e4)]||_0x17b2a5['scripts'])&&(delete _0x17b2a5[_0x34f9f1(0x1ff)+_0x34f9f1(0x1e4)],delete _0x17b2a5['scripts'],await writeJson(_0x2af84a,_0x17b2a5));if(!hasRuntimeDependencies(_0x17b2a5))return;const _0x53533c=await createRuntimeEnv(_0x426d09);console['log'](_0x34f9f1(0x146)+_0x34f9f1(0x26a)+_0x34f9f1(0x25c)+_0x34f9f1(0x2aa)+_0x34f9f1(0x317)+_0x34f9f1(0x1ac)+_0x34f9f1(0x171)+_0x34f9f1(0x31c)+_0x536798),await runProcess(_0x426d09[_0x34f9f1(0x1c4)+'utable'],[_0x426d09[_0x34f9f1(0x1a4)],_0x34f9f1(0x1d2),'--omit=d'+'ev',_0x34f9f1(0x17d)+_0x34f9f1(0x124),_0x34f9f1(0x17a)+'it',_0x34f9f1(0x246)+'d',_0x34f9f1(0x2e6)+_0x34f9f1(0x159)+'ps'],{'cwd':_0x536798,'env':_0x53533c,'label':_0x34f9f1(0x22f)+_0x34f9f1(0x1c8)+_0x34f9f1(0x2bc)+'\x20'+_0x536798}),_0x5ac25b[_0x34f9f1(0x1ae)+_0x34f9f1(0x1b9)]?.[_0x34f9f1(0x202)](_0x34f9f1(0x173)+_0x34f9f1(0x20b)+_0x34f9f1(0x266)+_0x34f9f1(0x287)+_0x34f9f1(0x183),{'installPath':_0x536798});}async function syncSharedPluginModules(_0x57f6ef,_0x3cdaee){const _0x3f713b=_0x5a6cc0,_0x54bd40=new Set();for(const _0x2b2634 of _0x57f6ef){const _0x1da02f=join(dirname(_0x2b2634),_0x3f713b(0x13a));if(existsSync(_0x1da02f))_0x54bd40['add'](_0x1da02f);}for(const _0x2ec9a3 of _0x54bd40){await copyDirFresh(_0x2ec9a3,join(_0x3cdaee,'_shared'));}}async function syncProductPlugins(_0x846776,_0x43d45c,_0x3cd493,_0x3e4232={}){const _0x52a691=_0x5a6cc0,_0x261079=join(_0x43d45c,'openclaw',_0x52a691(0x308),_0x52a691(0x274)+'ns'),_0x300098=createRuntimeInfoFromManifest(_0x43d45c,_0x3cd493),_0x2edbda=[];await syncSharedPluginModules(_0x846776[_0x52a691(0x1e8)][_0x52a691(0x11f)+_0x52a691(0x1e3)+_0x52a691(0x284)],_0x261079);for(const _0x14d795 of _0x846776[_0x52a691(0x1e8)][_0x52a691(0x11f)+_0x52a691(0x1e3)+_0x52a691(0x284)]){const _0x4fd7fa=await getPackageMetadata(_0x14d795),_0x226d71=await readPluginManifest(_0x14d795),_0x22602a=join(_0x261079,_0x4fd7fa['pluginId']);await copyDirFresh(_0x14d795,_0x22602a),await installLocalPluginRuntimeDependencies(_0x22602a,_0x300098,_0x3e4232),_0x2edbda[_0x52a691(0x281)]({'pluginId':_0x4fd7fa[_0x52a691(0x262)],'source':_0x52a691(0x2a9),'spec':_0x52a691(0x1bf)+_0x14d795,'installPath':toRuntimeRelative(_0x43d45c,_0x22602a),'version':_0x4fd7fa[_0x52a691(0x2fb)],'resolvedName':_0x4fd7fa[_0x52a691(0x231)],'resolvedVersion':_0x4fd7fa[_0x52a691(0x2fb)],'resolvedSpec':_0x52a691(0x1bf)+_0x14d795,'integrity':'','shasum':'','resolvedAt':new Date()[_0x52a691(0x209)+_0x52a691(0x1eb)](),'installedAt':new Date()[_0x52a691(0x209)+_0x52a691(0x1eb)](),'agentScope':_0x226d71[_0x52a691(0x158)+'pe'],'skills':_0x226d71[_0x52a691(0x21e)]});}const _0xa91851=new Set(_0x2edbda['map'](_0x75b7e4=>_0x75b7e4[_0x52a691(0x262)])),_0x5b7b93=Array['isArray'](_0x3cd493[_0x52a691(0x2d9)])?_0x3cd493[_0x52a691(0x2d9)]['filter'](_0x19d7be=>!_0xa91851[_0x52a691(0x254)](_0x19d7be[_0x52a691(0x262)])):[];_0x3cd493['plugins']=[..._0x5b7b93,..._0x2edbda];}async function syncManifestPluginScope(_0x27de2a,_0x4ef3ed,_0x5320ed){const _0x47166b=_0x5a6cc0,_0x2e65c0=join(_0x4ef3ed,_0x47166b(0x1e8),'dist',_0x47166b(0x274)+'ns'),_0x1883d5=new Set(_0x27de2a[_0x47166b(0x1e8)][_0x47166b(0x277)+_0x47166b(0x180)]??[]),_0x34103f=new Set([..._0x1883d5][_0x47166b(0x1ab)](_0x27752c=>_0x27752c[_0x47166b(0x27d)](/^npm:/,''))[_0x47166b(0x1ab)](_0x5c160b=>{const _0x380028=_0x47166b;if(_0x5c160b[_0x380028(0x26c)+'th']('@')){const _0x1a21ed=_0x5c160b[_0x380028(0x168)]('@');return _0x1a21ed['length']>=0x3?'@'+_0x1a21ed[0x1]:_0x5c160b;}return _0x5c160b['split']('@')[0x0];})[_0x47166b(0x2cd)](Boolean)),_0x5c7086=new Set();for(const _0x2ffab7 of _0x27de2a[_0x47166b(0x1e8)]['resolved'+'LocalPlu'+_0x47166b(0x284)]){const _0x563556=await getPackageMetadata(_0x2ffab7);if(_0x563556[_0x47166b(0x262)])_0x5c7086['add'](_0x563556[_0x47166b(0x262)]);}const _0x55f8ba=Array[_0x47166b(0x2cc)](_0x5320ed[_0x47166b(0x2d9)])?_0x5320ed[_0x47166b(0x2d9)]:[];_0x5320ed[_0x47166b(0x277)+'ecs']=[..._0x27de2a[_0x47166b(0x1e8)]['pluginSp'+_0x47166b(0x180)],..._0x27de2a[_0x47166b(0x1e8)][_0x47166b(0x11f)+'LocalPlu'+'ginPaths'][_0x47166b(0x1ab)](_0x2617ce=>_0x47166b(0x1bf)+_0x2617ce)],_0x5320ed[_0x47166b(0x2d9)]=_0x55f8ba['filter'](_0x312a68=>{const _0x5d1284=_0x47166b;if(!_0x312a68||typeof _0x312a68!=='object')return![];if(_0x312a68[_0x5d1284(0x2a0)]===_0x5d1284(0x2a9))return _0x5c7086['has'](_0x312a68[_0x5d1284(0x262)]);if(_0x312a68['source']===_0x5d1284(0x2db))return _0x1883d5[_0x5d1284(0x254)](_0x312a68[_0x5d1284(0x28d)])||_0x1883d5[_0x5d1284(0x254)](_0x312a68[_0x5d1284(0x11f)+_0x5d1284(0x19b)])||_0x34103f['has'](_0x312a68['resolved'+_0x5d1284(0x2c8)]);return![];});const _0x2076da=new Set(_0x5320ed[_0x47166b(0x2d9)]['map'](_0x2d22ef=>_0x2d22ef[_0x47166b(0x262)]));for(const _0x45c401 of _0x55f8ba){if(!_0x45c401['pluginId']||_0x2076da[_0x47166b(0x254)](_0x45c401[_0x47166b(0x262)]))continue;const _0x350e29=typeof _0x45c401[_0x47166b(0x1a8)+_0x47166b(0x148)]===_0x47166b(0x1df)&&_0x45c401[_0x47166b(0x1a8)+'ath'][_0x47166b(0x28f)]()?resolve(_0x4ef3ed,_0x45c401[_0x47166b(0x1a8)+_0x47166b(0x148)]):join(_0x2e65c0,_0x45c401['pluginId']),_0x52cc02=relative(_0x2e65c0,_0x350e29);if(_0x52cc02[_0x47166b(0x26c)+'th']('..')||_0x52cc02==='')continue;await rm(_0x350e29,{'recursive':!![],'force':!![]});}}async function collectCapabilityEntries(_0x451c62,_0x1cf047){const _0x43a0cc=_0x5a6cc0,_0x37e539=new Map();for(const _0x4f4fba of _0x451c62){let _0xe89389;try{_0xe89389=await stat(_0x4f4fba);}catch{throw new Error(_0x1cf047+(_0x43a0cc(0x1cd)+_0x43a0cc(0x174)+_0x43a0cc(0x2bf))+_0x4f4fba);}if(!_0xe89389['isDirect'+'ory']())throw new Error(_0x1cf047+(_0x43a0cc(0x2c9)+'st\x20be\x20a\x20'+'director'+_0x43a0cc(0x151))+_0x4f4fba);const _0x24c3b5={'name':basename(_0x4f4fba),'path':_0x4f4fba},_0xa35a8b=_0x37e539[_0x43a0cc(0x275)](_0x24c3b5[_0x43a0cc(0x231)]);if(_0xa35a8b)throw new Error('Duplicat'+'e\x20'+_0x1cf047+'\x20entry\x20\x22'+_0x24c3b5[_0x43a0cc(0x231)]+_0x43a0cc(0x1de)+_0xa35a8b['path']+_0x43a0cc(0x29b)+_0x24c3b5[_0x43a0cc(0x2b5)]);_0x37e539[_0x43a0cc(0x26e)](_0x24c3b5[_0x43a0cc(0x231)],_0x24c3b5);}return[..._0x37e539[_0x43a0cc(0x229)]()];}async function syncProductCapabilityDirs(_0x20d950,_0x76f46f,_0x30a807){const _0x221aa4=_0x5a6cc0,_0x32b911=await collectCapabilityEntries(_0x20d950,_0x30a807);await rm(_0x76f46f,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await mkdir(_0x76f46f,{'recursive':!![]});for(const _0x28f1c5 of _0x32b911){await cp(_0x28f1c5[_0x221aa4(0x2b5)],join(_0x76f46f,_0x28f1c5['name']),{'recursive':!![]});}return _0x32b911[_0x221aa4(0x2ae)];}export const __test__={'collectCapabilityEntries':collectCapabilityEntries,'syncProductCapabilityDirs':syncProductCapabilityDirs};async function syncProductAgents(_0x38b56c,_0x409710,_0x4503af){const _0x48b210=_0x5a6cc0,_0x21d333=join(_0x409710,_0x48b210(0x1e8),_0x48b210(0x27e)),_0x1710e1=await syncProductCapabilityDirs(_0x38b56c['openclaw'][_0x48b210(0x11f)+_0x48b210(0x2ce)+_0x48b210(0x29d)],_0x21d333,_0x48b210(0x226));_0x4503af[_0x48b210(0x27e)]={'source':_0x48b210(0x126),'installPath':toRuntimeRelative(_0x409710,_0x21d333),'localPaths':_0x38b56c[_0x48b210(0x1e8)][_0x48b210(0x11f)+'LocalAge'+_0x48b210(0x29d)],'entryCount':_0x1710e1};}async function syncProductSkills(_0x5c073c,_0x43f586,_0x4e3d81){const _0x28d8f6=_0x5a6cc0,_0x34e4d2=join(_0x43f586,_0x28d8f6(0x1e8),_0x28d8f6(0x21e)),_0x53806d=await syncProductCapabilityDirs(_0x5c073c[_0x28d8f6(0x1e8)][_0x28d8f6(0x11f)+_0x28d8f6(0x15a)+_0x28d8f6(0x198)],_0x34e4d2,_0x28d8f6(0x1b3));_0x4e3d81['skills']={'source':_0x28d8f6(0x126),'installPath':toRuntimeRelative(_0x43f586,_0x34e4d2),'localPaths':_0x5c073c[_0x28d8f6(0x1e8)][_0x28d8f6(0x11f)+'LocalSki'+_0x28d8f6(0x198)],'entryCount':_0x53806d};}
@@ -1 +1 @@
1
- function _0x3cc0(_0x2e5281,_0x15f7c9){_0x2e5281=_0x2e5281-0xf3;const _0x562343=_0x5623();let _0x3cc0cc=_0x562343[_0x2e5281];return _0x3cc0cc;}function _0x5623(){const _0x1e0cb1=['channel\x20','ME_REFLE','ns));\x0a\x09\x09','null;','167503EjPbam','sureWuji','ound\x20??\x20','=\x20{\x0a\x09\x09\x09\x09','includes','e)\x20=>\x20{\x0a','ect\x22\x20?\x20r','ntime\x20=\x20','ime\x20=\x20wu','n\x20??\x20exi','runtimeC','nbound:\x20','tingChan','untime.t','time\x20=\x20(','already-','ateRunti','e\x20!==\x20\x22o','\x20createR','el\x20}\x20fro','nst\x20exis','turn:\x20ex','ssion\x20??','annel\x20as','inbound\x20','untime.c',')\x20=>\x20{\x0a\x09','istingCh','annel.se','inRuntim','sion:\x20ex','meOption','e.inboun','om\x20\x22node','urn:\x20exi','Runtime.','hannel?.','\x20typeof\x20',':crypto\x22','ZY_RUNTI','nnel.tur','9042780iDKyzZ','ntime.in','eatePlug','\x20{};\x0a\x09\x09\x09','runtime-','\x09\x09\x09if\x20(!','28642864JWGARX','meChanne','nnel?.in','resolved','nnel.inb','imeChann','YS);','solveCre','urn\x20??\x20c','Channel(','\x20channel','const\x20re','elRuntim','e()(opti','\x09return\x20','e.reply,','\x20(runtim','eChannel','null;\x0a\x09\x09','nel\x20=\x20ru','()(optio','\x09\x09const\x20','l.reply\x20','1600816RJnRWF','solvedRu','ons.runt','runtime\x20','runtime.','eContext','\x09\x09let\x20re','session\x0a',');\x0a\x09\x09\x09co','444nzRkIq','l,\x0a\x09\x09\x09\x09r','??\x20chann','s,\x0a\x09\x09\x09\x09i','ontexts\x20','\x09\x09\x09reply','..existi','solveRun','2985819lWxSqF','bound,\x0a\x09','elpers\x20=','nnelRunt','ash\x20}\x20fr','esolveCr','portPath','CTION_KE','Runtime;','n\x20&&\x20run','bound?.r','edRuntim','rn\x20runti','turn?.ru','RuntimeH','ns.runti','stingCha','imeOptio','\x09\x09\x09if\x20(r','3092246NwPnjO','bject\x22)\x20','existing','jieCreat','\x0a\x09\x09\x09\x09ses','elpers(r','untimeCo','import\x20{','channelR','ntexts:\x20','eRuntime','patched','d,\x0a\x09\x09\x09\x09t','||\x20typeo','f\x20runtim','ntime;\x0a\x09','onst\x20cha','\x20createH','untime;\x0a','rn\x20??','ot-provi','e\x20??=\x20en','e,\x0a\x09\x09\x09\x09.','\x09\x09\x09};\x0a\x09\x09','return\x20r','e\x20??=\x20re','===\x20\x22obj','replace','channel-','444063KLBUjL','\x0a\x09\x09};\x0a\x09\x09','\x09\x09resolv','me;\x0a\x09\x09\x09c','indexOf','ngChanne','Channel.','imePromi','...chann','un)\x20retu','ot-found','not-foun','annel\x20&&'];_0x5623=function(){return _0x1e0cb1;};return _0x5623();}(function(_0x3b5cbb,_0x53da70){const _0x18eac8=_0x3cc0,_0x5206dd=_0x3b5cbb();while(!![]){try{const _0xb76922=-parseInt(_0x18eac8(0xf5))/0x1+-parseInt(_0x18eac8(0x170))/0x2+-parseInt(_0x18eac8(0x15d))/0x3+parseInt(_0x18eac8(0x14c))/0x4+-parseInt(_0x18eac8(0x12f))/0x5+parseInt(_0x18eac8(0x155))/0x6*(parseInt(_0x18eac8(0x106))/0x7)+parseInt(_0x18eac8(0x135))/0x8;if(_0xb76922===_0x53da70)break;else _0x5206dd['push'](_0x5206dd['shift']());}catch(_0xafe6e5){_0x5206dd['push'](_0x5206dd['shift']());}}}(_0x5623,0xe9b6d));export function patchChannelPluginRuntimeFromSource(_0x30cb50,_0x125002={}){const _0x1503db=_0x3cc0,_0x574cce=_0x125002['runtimeC'+'hannelIm'+_0x1503db(0x163)];if(!_0x574cce)return{'patched':![],'reason':_0x1503db(0x133)+_0x1503db(0xf4)+'import-n'+_0x1503db(0x184)+'ded'};if(_0x30cb50['includes']('wujieCre'+_0x1503db(0x116)+_0x1503db(0x136)+'l')){if(_0x30cb50[_0x1503db(0x10a)](_0x1503db(0x11b)+'istingCh'+'annel.tu'+_0x1503db(0x183))&&hasRuntimeChannelImport(_0x30cb50,_0x574cce))return{'patched':![],'reason':_0x1503db(0x115)+_0x1503db(0x17b)};return patchExistingChannelPluginRuntimeFromSource(_0x30cb50,{'runtimeChannelImportPath':_0x574cce});}if(_0x30cb50[_0x1503db(0x10a)]('wujieCha'+_0x1503db(0x160)+_0x1503db(0xfc)+'se'))return patchExistingChannelPluginRuntimeFromSource(_0x30cb50,{'runtimeChannelImportPath':_0x574cce});const _0x4186b9='\x09\x09let\x20re'+_0x1503db(0x14d)+_0x1503db(0x10d)+_0x1503db(0x147)+_0x1503db(0x140)+'solveRun'+'time\x20=\x20('+_0x1503db(0x120)+_0x1503db(0xf7)+'edRuntim'+_0x1503db(0x189)+_0x1503db(0x13c)+'atePlugi'+'nRuntime'+_0x1503db(0x149)+_0x1503db(0x16c)+_0x1503db(0x125)+'s);\x0a\x09\x09\x09r'+'eturn\x20re'+'solvedRu'+_0x1503db(0x17f)+'\x09};';if(!_0x30cb50[_0x1503db(0x10a)](_0x4186b9))return{'patched':![],'reason':_0x1503db(0x100)+'d'};const _0x107d67=_0x1503db(0x177)+_0x1503db(0x181)+_0x1503db(0x161)+_0x1503db(0x127)+':crypto\x22'+';';if(!_0x30cb50[_0x1503db(0x10a)](_0x107d67))return{'patched':![],'reason':'import-n'+_0x1503db(0xff)};const _0x39235d=_0x1503db(0x152)+_0x1503db(0x14d)+_0x1503db(0x10d)+_0x1503db(0x147)+'const\x20en'+_0x1503db(0x107)+'eChannel'+_0x1503db(0x16b)+_0x1503db(0x15f)+_0x1503db(0x145)+_0x1503db(0x10b)+_0x1503db(0x134)+_0x1503db(0x14f)+_0x1503db(0x17d)+'f\x20runtim'+_0x1503db(0x117)+_0x1503db(0x171)+'return\x20r'+'untime;\x0a'+'\x09\x09\x09if\x20(r'+_0x1503db(0x11f)+_0x1503db(0x12a)+_0x1503db(0x16a)+'n\x20&&\x20run'+'time.cha'+_0x1503db(0x137)+_0x1503db(0x167)+_0x1503db(0xfe)+_0x1503db(0x169)+'me;\x0a\x09\x09\x09c'+_0x1503db(0x180)+_0x1503db(0x160)+_0x1503db(0x10e)+_0x1503db(0x173)+_0x1503db(0x17a)+_0x1503db(0x13e)+_0x1503db(0x154)+_0x1503db(0x11a)+_0x1503db(0x112)+_0x1503db(0x148)+'ntime.ch'+_0x1503db(0x101)+_0x1503db(0x12b)+_0x1503db(0x150)+_0x1503db(0x102)+_0x1503db(0x18a)+_0x1503db(0x10c)+'untime.c'+'hannel\x20:'+_0x1503db(0x132)+'runtime.'+_0x1503db(0x102)+_0x1503db(0x109)+_0x1503db(0xfd)+_0x1503db(0x141)+_0x1503db(0x186)+_0x1503db(0x15b)+_0x1503db(0xfa)+_0x1503db(0x156)+'untimeCo'+_0x1503db(0x179)+_0x1503db(0x172)+_0x1503db(0xfb)+_0x1503db(0x110)+_0x1503db(0x159)+_0x1503db(0x157)+'elRuntim'+'e.runtim'+'eContext'+_0x1503db(0x158)+'nbound:\x20'+_0x1503db(0x172)+'Channel.'+_0x1503db(0x11e)+'??\x20chann'+_0x1503db(0x141)+_0x1503db(0x126)+'d,\x0a\x09\x09\x09\x09t'+_0x1503db(0x128)+_0x1503db(0x16d)+'nnel.tur'+_0x1503db(0x10f)+'stingCha'+_0x1503db(0x139)+_0x1503db(0x108)+'channelR'+_0x1503db(0x113)+_0x1503db(0x13d)+'hannelRu'+_0x1503db(0x130)+_0x1503db(0x15e)+'\x09\x09\x09reply'+':\x20existi'+_0x1503db(0xfa)+_0x1503db(0x14b)+_0x1503db(0x157)+'elRuntim'+'e.reply,'+_0x1503db(0x174)+_0x1503db(0x124)+_0x1503db(0x121)+_0x1503db(0x122)+'ssion\x20??'+_0x1503db(0x13f)+_0x1503db(0x129)+_0x1503db(0x153)+_0x1503db(0x187)+_0x1503db(0x143)+'runtime;'+_0x1503db(0xf6)+_0x1503db(0x140)+_0x1503db(0x15c)+_0x1503db(0x114)+')\x20=>\x20{\x0a\x09'+'\x09\x09resolv'+'edRuntim'+_0x1503db(0x185)+_0x1503db(0x107)+_0x1503db(0x146)+_0x1503db(0x16b)+_0x1503db(0x175)+_0x1503db(0x162)+'eatePlug'+_0x1503db(0x123)+_0x1503db(0x142)+(_0x1503db(0x14e)+_0x1503db(0x16e)+_0x1503db(0x104)+_0x1503db(0x143)+_0x1503db(0x138)+_0x1503db(0x165)+'\x0a\x09\x09};');return{'patched':!![],'source':_0x30cb50[_0x1503db(0xf3)](_0x107d67,_0x107d67+'\x0a'+createRuntimeChannelImport(_0x574cce))[_0x1503db(0xf3)](_0x4186b9,_0x39235d)};}function patchExistingChannelPluginRuntimeFromSource(_0x114ce1,_0x357518){const _0x1f9920=_0x3cc0,{runtimeChannelImportPath:_0x167d18}=_0x357518,_0x4b4c6f=_0x1f9920(0x177)+'\x20createH'+_0x1f9920(0x161)+_0x1f9920(0x127)+_0x1f9920(0x12c)+';';if(!_0x114ce1['includes'](_0x4b4c6f))return{'patched':![],'reason':'import-n'+_0x1f9920(0xff)};const _0x5846a4=_0x1f9920(0x152)+_0x1f9920(0x14d)+_0x1f9920(0x10d)+_0x1f9920(0x105),_0x4b5fb9=_0x1f9920(0x14a)+'lazyRunt'+'imeRefle'+'ctionKey'+'Set\x20=\x20ne'+'w\x20Set(LA'+_0x1f9920(0x12d)+_0x1f9920(0x103)+_0x1f9920(0x164)+_0x1f9920(0x13b),_0x4b1215=_0x114ce1[_0x1f9920(0xf9)](_0x5846a4),_0x67b1e5=_0x114ce1[_0x1f9920(0xf9)](_0x4b5fb9,_0x4b1215);if(_0x4b1215===-0x1||_0x67b1e5===-0x1)return{'patched':![],'reason':'not-foun'+'d'};const _0xa6d1=_0x1f9920(0x152)+_0x1f9920(0x14d)+'ntime\x20=\x20'+_0x1f9920(0x147)+'const\x20en'+_0x1f9920(0x107)+'eChannel'+_0x1f9920(0x16b)+_0x1f9920(0x15f)+_0x1f9920(0x145)+_0x1f9920(0x10b)+_0x1f9920(0x134)+_0x1f9920(0x14f)+_0x1f9920(0x17d)+_0x1f9920(0x17e)+_0x1f9920(0x117)+_0x1f9920(0x171)+_0x1f9920(0x188)+_0x1f9920(0x182)+_0x1f9920(0x16f)+_0x1f9920(0x11f)+_0x1f9920(0x12a)+_0x1f9920(0x16a)+_0x1f9920(0x166)+'time.cha'+'nnel?.in'+'bound?.r'+'un)\x20retu'+'rn\x20runti'+_0x1f9920(0xf8)+_0x1f9920(0x180)+_0x1f9920(0x160)+_0x1f9920(0x10e)+'jieCreat'+_0x1f9920(0x17a)+_0x1f9920(0x13e)+');\x0a\x09\x09\x09co'+_0x1f9920(0x11a)+_0x1f9920(0x112)+'nel\x20=\x20ru'+'ntime.ch'+_0x1f9920(0x101)+_0x1f9920(0x12b)+_0x1f9920(0x150)+_0x1f9920(0x102)+'===\x20\x22obj'+'ect\x22\x20?\x20r'+_0x1f9920(0x11f)+'hannel\x20:'+'\x20{};\x0a\x09\x09\x09'+_0x1f9920(0x150)+_0x1f9920(0x102)+_0x1f9920(0x109)+_0x1f9920(0xfd)+_0x1f9920(0x141)+_0x1f9920(0x186)+_0x1f9920(0x15b)+_0x1f9920(0xfa)+_0x1f9920(0x156)+_0x1f9920(0x176)+_0x1f9920(0x179)+_0x1f9920(0x172)+_0x1f9920(0xfb)+_0x1f9920(0x110)+_0x1f9920(0x159)+_0x1f9920(0x157)+_0x1f9920(0x141)+'e.runtim'+_0x1f9920(0x151)+_0x1f9920(0x158)+_0x1f9920(0x111)+'existing'+_0x1f9920(0xfb)+_0x1f9920(0x11e)+_0x1f9920(0x157)+'elRuntim'+_0x1f9920(0x126)+_0x1f9920(0x17c)+_0x1f9920(0x128)+_0x1f9920(0x16d)+_0x1f9920(0x12e)+_0x1f9920(0x10f)+_0x1f9920(0x16d)+_0x1f9920(0x139)+_0x1f9920(0x108)+_0x1f9920(0x178)+_0x1f9920(0x113)+_0x1f9920(0x13d)+'hannelRu'+_0x1f9920(0x130)+_0x1f9920(0x15e)+_0x1f9920(0x15a)+':\x20existi'+_0x1f9920(0xfa)+_0x1f9920(0x14b)+_0x1f9920(0x157)+_0x1f9920(0x141)+_0x1f9920(0x144)+'\x0a\x09\x09\x09\x09ses'+_0x1f9920(0x124)+'istingCh'+_0x1f9920(0x122)+_0x1f9920(0x11c)+_0x1f9920(0x13f)+'Runtime.'+_0x1f9920(0x153)+_0x1f9920(0x187)+'\x09return\x20'+'runtime;'+_0x1f9920(0xf6)+_0x1f9920(0x140)+_0x1f9920(0x15c)+_0x1f9920(0x114)+_0x1f9920(0x120)+_0x1f9920(0xf7)+_0x1f9920(0x168)+_0x1f9920(0x185)+_0x1f9920(0x107)+_0x1f9920(0x146)+_0x1f9920(0x16b)+'elpers(r'+_0x1f9920(0x162)+_0x1f9920(0x131)+_0x1f9920(0x123)+_0x1f9920(0x142)+('ons.runt'+_0x1f9920(0x16e)+_0x1f9920(0x104)+_0x1f9920(0x143)+_0x1f9920(0x138)+_0x1f9920(0x165)+'\x0a\x09\x09};\x0a'),_0x3bd378=_0x114ce1['slice'](0x0,_0x4b1215)+_0xa6d1+_0x114ce1['slice'](_0x67b1e5);return{'patched':!![],'source':ensureRuntimeChannelImport(_0x3bd378,{'importMarker':_0x4b4c6f,'runtimeChannelImportPath':_0x167d18})};}function createRuntimeChannelImport(_0x5ecc3f){const _0x48c22d=_0x3cc0;return'import\x20{'+_0x48c22d(0x118)+'untimeCh'+_0x48c22d(0x11d)+'\x20wujieCr'+'eateRunt'+_0x48c22d(0x13a)+_0x48c22d(0x119)+'m\x20\x22'+_0x5ecc3f+'\x22;';}function hasRuntimeChannelImport(_0x505c32,_0x11d970){const _0x409c85=_0x3cc0;return _0x505c32[_0x409c85(0x10a)](createRuntimeChannelImport(_0x11d970));}function ensureRuntimeChannelImport(_0x27a8c3,{importMarker:_0x3a8d7c,runtimeChannelImportPath:_0x276b89}){const _0x466e4f=_0x3cc0,_0x3077d1=createRuntimeChannelImport(_0x276b89),_0x4b42cb=/import \{ createRuntimeChannel as wujieCreateRuntimeChannel \} from "\.\/runtime-channel-[^"]+\.js";\n?/;if(_0x4b42cb['test'](_0x27a8c3))return _0x27a8c3[_0x466e4f(0xf3)](_0x4b42cb,_0x3077d1+'\x0a');return _0x27a8c3[_0x466e4f(0xf3)](_0x3a8d7c,_0x3a8d7c+'\x0a'+_0x3077d1);}
1
+ (function(_0x3fc375,_0x4e1bbb){const _0x31785e=_0x37d8,_0x315afe=_0x3fc375();while(!![]){try{const _0xa600e5=-parseInt(_0x31785e(0x1d5))/0x1*(parseInt(_0x31785e(0x1a6))/0x2)+parseInt(_0x31785e(0x1d9))/0x3+-parseInt(_0x31785e(0x1cc))/0x4+parseInt(_0x31785e(0x1d8))/0x5*(parseInt(_0x31785e(0x218))/0x6)+parseInt(_0x31785e(0x1d0))/0x7*(parseInt(_0x31785e(0x1f1))/0x8)+-parseInt(_0x31785e(0x1f4))/0x9+parseInt(_0x31785e(0x1a7))/0xa;if(_0xa600e5===_0x4e1bbb)break;else _0x315afe['push'](_0x315afe['shift']());}catch(_0x2c64a8){_0x315afe['push'](_0x315afe['shift']());}}}(_0x4999,0x8362d));function _0x37d8(_0x440114,_0x1952ae){_0x440114=_0x440114-0x178;const _0x499996=_0x4999();let _0x37d834=_0x499996[_0x440114];return _0x37d834;}export function patchChannelPluginRuntimeFromSource(_0x49be83,_0x7a497={}){const _0x3546da=_0x37d8,_0x585803=_0x7a497['runtimeC'+_0x3546da(0x198)+_0x3546da(0x1ee)];if(!_0x585803)return{'patched':![],'reason':'runtime-'+_0x3546da(0x1c3)+_0x3546da(0x1f6)+_0x3546da(0x17e)+_0x3546da(0x194)};if(_0x49be83[_0x3546da(0x1cd)]('wujieCre'+_0x3546da(0x208)+'meChanne'+'l')){if(_0x49be83[_0x3546da(0x1cd)](_0x3546da(0x1eb)+'istingCh'+_0x3546da(0x17a)+_0x3546da(0x1c1))&&hasRuntimeChannelImport(_0x49be83,_0x585803))return{'patched':![],'reason':'already-'+_0x3546da(0x1a2)};return patchExistingChannelPluginRuntimeFromSource(_0x49be83,{'runtimeChannelImportPath':_0x585803});}if(_0x49be83[_0x3546da(0x1cd)]('wujieCha'+_0x3546da(0x190)+'imePromi'+'se'))return patchExistingChannelPluginRuntimeFromSource(_0x49be83,{'runtimeChannelImportPath':_0x585803});const _0x57e8b9='\x09\x09let\x20re'+_0x3546da(0x206)+_0x3546da(0x214)+_0x3546da(0x1e7)+_0x3546da(0x19c)+_0x3546da(0x21c)+_0x3546da(0x20e)+_0x3546da(0x18b)+_0x3546da(0x1e2)+'edRuntim'+_0x3546da(0x1b4)+'solveCre'+'atePlugi'+_0x3546da(0x1a8)+'()(optio'+'ns.runti'+'meOption'+_0x3546da(0x1b7)+_0x3546da(0x1cb)+_0x3546da(0x206)+'ntime;\x0a\x09'+_0x3546da(0x1fa);if(!_0x49be83[_0x3546da(0x1cd)](_0x57e8b9))return{'patched':![],'reason':_0x3546da(0x1c9)+'d'};const _0x5ad865=_0x3546da(0x21b)+_0x3546da(0x186)+_0x3546da(0x1e4)+_0x3546da(0x1db)+_0x3546da(0x1c2)+';';if(!_0x49be83[_0x3546da(0x1cd)](_0x5ad865))return{'patched':![],'reason':_0x3546da(0x1f6)+_0x3546da(0x1ae)};const _0x1c7eb6='\x09\x09let\x20re'+'solvedRu'+'ntime\x20=\x20'+_0x3546da(0x1e7)+_0x3546da(0x1c4)+'sureWuji'+_0x3546da(0x1d7)+'RuntimeH'+_0x3546da(0x1fc)+_0x3546da(0x1df)+_0x3546da(0x1ad)+_0x3546da(0x1f9)+'runtime\x20'+'||\x20typeo'+_0x3546da(0x181)+_0x3546da(0x1b5)+'bject\x22)\x20'+_0x3546da(0x204)+_0x3546da(0x1ab)+_0x3546da(0x1a5)+_0x3546da(0x1e8)+'hannel?.'+'turn?.ru'+_0x3546da(0x202)+_0x3546da(0x213)+_0x3546da(0x1a0)+_0x3546da(0x1f8)+_0x3546da(0x18c)+_0x3546da(0x182)+_0x3546da(0x1ac)+_0x3546da(0x19d)+_0x3546da(0x190)+_0x3546da(0x1b1)+_0x3546da(0x1d2)+_0x3546da(0x17f)+'Channel('+_0x3546da(0x1c8)+_0x3546da(0x1af)+_0x3546da(0x212)+_0x3546da(0x1ef)+_0x3546da(0x1ed)+_0x3546da(0x203)+_0x3546da(0x1aa)+_0x3546da(0x20b)+_0x3546da(0x18a)+_0x3546da(0x1e5)+'ect\x22\x20?\x20r'+'untime.c'+_0x3546da(0x1ce)+'\x20{};\x0a\x09\x09\x09'+_0x3546da(0x20b)+_0x3546da(0x18a)+_0x3546da(0x192)+_0x3546da(0x1f7)+'elRuntim'+_0x3546da(0x1b0)+_0x3546da(0x1c7)+_0x3546da(0x183)+_0x3546da(0x18d)+'untimeCo'+_0x3546da(0x1d1)+'existing'+_0x3546da(0x17d)+'runtimeC'+_0x3546da(0x20c)+_0x3546da(0x1ea)+_0x3546da(0x1bc)+_0x3546da(0x1f2)+_0x3546da(0x216)+_0x3546da(0x197)+'nbound:\x20'+_0x3546da(0x1f0)+_0x3546da(0x17d)+_0x3546da(0x1f3)+'??\x20chann'+'elRuntim'+'e.inboun'+_0x3546da(0x20d)+_0x3546da(0x1fb)+_0x3546da(0x1c0)+_0x3546da(0x219)+_0x3546da(0x1e0)+_0x3546da(0x1c0)+_0x3546da(0x1e1)+_0x3546da(0x1e9)+_0x3546da(0x1d4)+'untime.t'+_0x3546da(0x1a9)+_0x3546da(0x1a4)+_0x3546da(0x18e)+_0x3546da(0x1f5)+_0x3546da(0x19a)+_0x3546da(0x188)+'ngChanne'+_0x3546da(0x201)+_0x3546da(0x1ea)+_0x3546da(0x1bc)+_0x3546da(0x1b2)+_0x3546da(0x19f)+'sion:\x20ex'+_0x3546da(0x189)+_0x3546da(0x1ff)+'ssion\x20??'+_0x3546da(0x178)+_0x3546da(0x195)+_0x3546da(0x1b6)+_0x3546da(0x193)+_0x3546da(0x1c6)+'runtime;'+_0x3546da(0x180)+_0x3546da(0x19c)+_0x3546da(0x21c)+_0x3546da(0x20e)+_0x3546da(0x18b)+_0x3546da(0x1e2)+_0x3546da(0x179)+_0x3546da(0x184)+_0x3546da(0x1be)+'eChannel'+_0x3546da(0x187)+_0x3546da(0x17c)+_0x3546da(0x1ca)+'eatePlug'+_0x3546da(0x1b9)+'e()(opti'+(_0x3546da(0x1bb)+_0x3546da(0x200)+_0x3546da(0x1a3)+_0x3546da(0x1c6)+_0x3546da(0x205)+_0x3546da(0x1da)+_0x3546da(0x1d3));return{'patched':!![],'source':_0x49be83[_0x3546da(0x1cf)](_0x5ad865,_0x5ad865+'\x0a'+createRuntimeChannelImport(_0x585803))[_0x3546da(0x1cf)](_0x57e8b9,_0x1c7eb6)};}function patchExistingChannelPluginRuntimeFromSource(_0x294da5,_0x187e91){const _0x4293de=_0x37d8,{runtimeChannelImportPath:_0x1fb94d}=_0x187e91,_0x427e89='import\x20{'+_0x4293de(0x186)+_0x4293de(0x1e4)+_0x4293de(0x1db)+_0x4293de(0x1c2)+';';if(!_0x294da5['includes'](_0x427e89))return{'patched':![],'reason':_0x4293de(0x1f6)+_0x4293de(0x1ae)};const _0x225fb7=_0x4293de(0x1bf)+_0x4293de(0x206)+_0x4293de(0x214)+_0x4293de(0x21d),_0x553fbd='\x09\x09const\x20'+_0x4293de(0x1dd)+_0x4293de(0x1c5)+_0x4293de(0x19b)+_0x4293de(0x1b3)+_0x4293de(0x1a1)+_0x4293de(0x196)+_0x4293de(0x20f)+_0x4293de(0x1ba)+_0x4293de(0x1e3),_0x4b5870=_0x294da5['indexOf'](_0x225fb7),_0x2c9c59=_0x294da5[_0x4293de(0x1fe)](_0x553fbd,_0x4b5870);if(_0x4b5870===-0x1||_0x2c9c59===-0x1)return{'patched':![],'reason':'not-foun'+'d'};const _0x7cc6b0='\x09\x09let\x20re'+_0x4293de(0x206)+'ntime\x20=\x20'+_0x4293de(0x1e7)+_0x4293de(0x1c4)+_0x4293de(0x1be)+_0x4293de(0x1d7)+_0x4293de(0x187)+_0x4293de(0x1fc)+'\x20(runtim'+'e)\x20=>\x20{\x0a'+'\x09\x09\x09if\x20(!'+'runtime\x20'+'||\x20typeo'+_0x4293de(0x181)+_0x4293de(0x1b5)+_0x4293de(0x1bd)+_0x4293de(0x204)+'untime;\x0a'+_0x4293de(0x1a5)+'untime.c'+_0x4293de(0x18f)+_0x4293de(0x1fd)+'n\x20&&\x20run'+'time.cha'+'nnel?.in'+_0x4293de(0x1f8)+'un)\x20retu'+_0x4293de(0x182)+_0x4293de(0x1ac)+'onst\x20cha'+_0x4293de(0x190)+_0x4293de(0x1b1)+_0x4293de(0x1d2)+_0x4293de(0x17f)+_0x4293de(0x199)+_0x4293de(0x1c8)+'nst\x20exis'+'tingChan'+_0x4293de(0x1ef)+_0x4293de(0x1ed)+_0x4293de(0x203)+_0x4293de(0x1aa)+_0x4293de(0x20b)+_0x4293de(0x18a)+_0x4293de(0x1e5)+'ect\x22\x20?\x20r'+_0x4293de(0x1e8)+_0x4293de(0x1ce)+_0x4293de(0x21a)+'runtime.'+'channel\x20'+'=\x20{\x0a\x09\x09\x09\x09'+_0x4293de(0x1f7)+_0x4293de(0x1bc)+'e,\x0a\x09\x09\x09\x09.'+_0x4293de(0x1c7)+'ngChanne'+'l,\x0a\x09\x09\x09\x09r'+_0x4293de(0x1b8)+_0x4293de(0x1d1)+'existing'+_0x4293de(0x17d)+_0x4293de(0x217)+_0x4293de(0x20c)+'??\x20chann'+'elRuntim'+_0x4293de(0x1f2)+_0x4293de(0x216)+'s,\x0a\x09\x09\x09\x09i'+_0x4293de(0x19e)+'existing'+_0x4293de(0x17d)+'inbound\x20'+_0x4293de(0x1ea)+_0x4293de(0x1bc)+_0x4293de(0x1dc)+'d,\x0a\x09\x09\x09\x09t'+_0x4293de(0x1fb)+_0x4293de(0x1c0)+_0x4293de(0x219)+_0x4293de(0x1e0)+_0x4293de(0x1c0)+_0x4293de(0x1e1)+'ound\x20??\x20'+_0x4293de(0x1d4)+_0x4293de(0x1de)+_0x4293de(0x1a9)+_0x4293de(0x1a4)+'ntime.in'+_0x4293de(0x1f5)+_0x4293de(0x19a)+_0x4293de(0x188)+_0x4293de(0x183)+_0x4293de(0x201)+_0x4293de(0x1ea)+_0x4293de(0x1bc)+_0x4293de(0x1b2)+_0x4293de(0x19f)+_0x4293de(0x209)+'istingCh'+_0x4293de(0x1ff)+_0x4293de(0x1ec)+'\x20channel'+_0x4293de(0x195)+'session\x0a'+_0x4293de(0x193)+_0x4293de(0x1c6)+_0x4293de(0x1d6)+_0x4293de(0x180)+_0x4293de(0x19c)+'solveRun'+_0x4293de(0x20e)+_0x4293de(0x18b)+_0x4293de(0x1e2)+'edRuntim'+_0x4293de(0x184)+_0x4293de(0x1be)+'eChannel'+_0x4293de(0x187)+_0x4293de(0x17c)+'esolveCr'+'eatePlug'+'inRuntim'+_0x4293de(0x210)+(_0x4293de(0x1bb)+'imeOptio'+_0x4293de(0x1a3)+'\x09return\x20'+_0x4293de(0x205)+_0x4293de(0x1da)+_0x4293de(0x17b)),_0x51e18e=_0x294da5['slice'](0x0,_0x4b5870)+_0x7cc6b0+_0x294da5['slice'](_0x2c9c59);return{'patched':!![],'source':ensureRuntimeChannelImport(_0x51e18e,{'importMarker':_0x427e89,'runtimeChannelImportPath':_0x1fb94d})};}function createRuntimeChannelImport(_0x255529){const _0x332ca7=_0x37d8;return _0x332ca7(0x21b)+_0x332ca7(0x215)+'untimeCh'+_0x332ca7(0x207)+_0x332ca7(0x1e6)+_0x332ca7(0x185)+_0x332ca7(0x211)+_0x332ca7(0x191)+'m\x20\x22'+_0x255529+'\x22;';}function hasRuntimeChannelImport(_0x2e5c21,_0xb64147){const _0x207b2f=_0x37d8;return _0x2e5c21[_0x207b2f(0x1cd)](createRuntimeChannelImport(_0xb64147));}function ensureRuntimeChannelImport(_0x2a84e2,{importMarker:_0x8ca07c,runtimeChannelImportPath:_0x177ebe}){const _0x1f27c9=_0x37d8,_0x4a18ef=createRuntimeChannelImport(_0x177ebe),_0x4fbe23=/import \{ createRuntimeChannel as wujieCreateRuntimeChannel \} from "\.\/runtime-channel-[^"]+\.js";\n?/;if(_0x4fbe23[_0x1f27c9(0x20a)](_0x2a84e2))return _0x2a84e2['replace'](_0x4fbe23,_0x4a18ef+'\x0a');return _0x2a84e2['replace'](_0x8ca07c,_0x8ca07c+'\x0a'+_0x4a18ef);}function _0x4999(){const _0x223255=['hannelRu','\x09\x09\x09if\x20(r','2QshYUe','8331330QeMldo','nRuntime','urn\x20??\x20c','\x20typeof\x20','untime;\x0a','me;\x0a\x09\x09\x09c','e)\x20=>\x20{\x0a','ot-found','nst\x20exis','e,\x0a\x09\x09\x09\x09.','ime\x20=\x20wu','e.reply,','Set\x20=\x20ne','e\x20??=\x20re','e\x20!==\x20\x22o','session\x0a','s);\x0a\x09\x09\x09r','untimeCo','inRuntim','CTION_KE','ons.runt','elRuntim','bject\x22)\x20','sureWuji','\x09\x09let\x20re','stingCha','rn\x20??',':crypto\x22','channel-','const\x20en','imeRefle','\x09return\x20','..existi',');\x0a\x09\x09\x09co','not-foun','esolveCr','eturn\x20re','2278644oKEuGP','includes','hannel\x20:','replace','290626rfgkMb','ntexts:\x20','jieCreat','\x0a\x09\x09};','channelR','980383BkroIj','runtime;','eChannel','3383275HGJycv','2341917NaMATi','Runtime;','om\x20\x22node','e.inboun','lazyRunt','untime.t','\x20(runtim','n\x20??\x20exi','nnel.inb','\x09\x09resolv','YS);','ash\x20}\x20fr','===\x20\x22obj','\x20wujieCr','null;\x0a\x09\x09','untime.c','ound\x20??\x20','??\x20chann','turn:\x20ex','ssion\x20??','ntime.ch','portPath','nel\x20=\x20ru','existing','152xzDpWx','e.runtim','inbound\x20','8919612yuKCGG','bound,\x0a\x09','import-n','...chann','bound?.r','\x09\x09\x09if\x20(!','\x09};','urn:\x20exi','elpers\x20=','turn?.ru','indexOf','annel.se','imeOptio','l.reply\x20','n\x20&&\x20run','annel\x20&&','return\x20r','resolved','solvedRu','annel\x20as','ateRunti','sion:\x20ex','test','runtime.','ontexts\x20','d,\x0a\x09\x09\x09\x09t','time\x20=\x20(','ME_REFLE','e()(opti','imeChann','tingChan','time.cha','ntime\x20=\x20','\x20createR','eContext','runtimeC','6RqhRRg','nnel.tur','\x20{};\x0a\x09\x09\x09','import\x20{','solveRun','null;','\x20channel','edRuntim','annel.tu','\x0a\x09\x09};\x0a','elpers(r','Channel.','ot-provi','eRuntime','\x0a\x09\x09};\x0a\x09\x09','f\x20runtim','rn\x20runti','ngChanne','e\x20??=\x20en','eateRunt','\x20createH','RuntimeH',':\x20existi','istingCh','channel\x20',')\x20=>\x20{\x0a\x09','un)\x20retu','l,\x0a\x09\x09\x09\x09r','ntime.in','hannel?.','nnelRunt','el\x20}\x20fro','=\x20{\x0a\x09\x09\x09\x09','\x09\x09\x09};\x0a\x09\x09','ded','Runtime.','ZY_RUNTI','s,\x0a\x09\x09\x09\x09i','hannelIm','Channel(','\x09\x09\x09reply','ctionKey','const\x20re','onst\x20cha','nbound:\x20','\x0a\x09\x09\x09\x09ses','nnel?.in','w\x20Set(LA','patched','ns));\x0a\x09\x09'];_0x4999=function(){return _0x223255;};return _0x4999();}