@wujie-shell/core 3.0.1 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 -0
  41. package/package.json +4 -3
@@ -1 +1 @@
1
- (function(_0x4cf28d,_0x49293b){var _0x5a9cfc=_0x5e84,_0x4839ad=_0x4cf28d();while(!![]){try{var _0x4c1157=-parseInt(_0x5a9cfc(0x1d8))/0x1*(parseInt(_0x5a9cfc(0x1da))/0x2)+-parseInt(_0x5a9cfc(0x1d7))/0x3+parseInt(_0x5a9cfc(0x1dc))/0x4*(-parseInt(_0x5a9cfc(0x1d4))/0x5)+-parseInt(_0x5a9cfc(0x1d5))/0x6+-parseInt(_0x5a9cfc(0x1db))/0x7+-parseInt(_0x5a9cfc(0x1d6))/0x8+parseInt(_0x5a9cfc(0x1d9))/0x9*(parseInt(_0x5a9cfc(0x1dd))/0xa);if(_0x4c1157===_0x49293b)break;else _0x4839ad['push'](_0x4839ad['shift']());}catch(_0x1eb160){_0x4839ad['push'](_0x4839ad['shift']());}}}(_0x44a1,0x9bf17));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';export*from'./connectors/constants.mjs';export{createConnectorController}from'./connectors/controller.mjs';function _0x5e84(_0x42fb1c,_0x4013ce){_0x42fb1c=_0x42fb1c-0x1d4;var _0x44a14d=_0x44a1();var _0x5e84e8=_0x44a14d[_0x42fb1c];return _0x5e84e8;}export{installKdocsCliBinary,resolveRuntimeKdocsCliCommand}from'./connectors/kdocs-cli.mjs';function _0x44a1(){var _0x50f2bf=['1386438wYgswk','9619896UqUiOS','187944GYWBkP','675307ynXPkE','9uxkcsn','2oVcbwh','986727FjfcEa','4MGdEJN','41220570jrNNGf','5854190PqUkhW'];_0x44a1=function(){return _0x50f2bf;};return _0x44a1();}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(_0x408d72,_0x4b9bbd){var _0x183899=_0x33fa,_0x3fd605=_0x408d72();while(!![]){try{var _0xba2284=parseInt(_0x183899(0x120))/0x1*(-parseInt(_0x183899(0x124))/0x2)+-parseInt(_0x183899(0x122))/0x3+parseInt(_0x183899(0x11f))/0x4*(-parseInt(_0x183899(0x11e))/0x5)+parseInt(_0x183899(0x123))/0x6*(-parseInt(_0x183899(0x11c))/0x7)+-parseInt(_0x183899(0x11d))/0x8+-parseInt(_0x183899(0x121))/0x9+parseInt(_0x183899(0x11b))/0xa;if(_0xba2284===_0x4b9bbd)break;else _0x3fd605['push'](_0x3fd605['shift']());}catch(_0x58cc99){_0x3fd605['push'](_0x3fd605['shift']());}}}(_0xa599,0x35f58));export{ensureOpenClawDoctorFixed,getRuntimeSpawnContext,loadRuntimeInfo,prepareRuntime,readRuntimeManifest,resolveManifestPath,resolveRuntimeLarkCliCommand,resolveRuntimeRoot,runClawOnce,spawnClaw}from'./runtime/index.mjs';export{createConfigController}from'./config/controller.mjs';export{createGatewayController,syncBundledAgentRuntimeConfig}from'./gateway/controller.mjs';export{discoverBundledAgentSkills,filterSkillsForAgent,syncBundledAgentSkillsToConfig}from'./agents/bundled-agent-skills.mjs';export{ensureBundledAgents,loadBundledAgents,shouldForceFullSync}from'./agents/bundled-agents.mjs';export{archiveChatAttachmentForHistory}from'./chat/media-archive.mjs';export{createGatewayChatQueue}from'./chat/queue.mjs';function _0xa599(){var _0x52ad87=['60741umlgjT','1309101fuJIGp','6VZDUcl','2IfRWOs','18401060DMGbSU','2322082bZEdDN','1099096oVjexK','45kRLnFR','181672DVRYVh','298099DfkgKR'];_0xa599=function(){return _0x52ad87;};return _0xa599();}export{createDiagnosticsWriter,createIncidentId,diagnosticEventFromError}from'./common/diagnostics.mjs';export{createShellLogger,exportLogsArchive,hashText,shouldIncludeLogArchiveEntry,summarizeError,summarizeFilePaths,summarizePayload,summarizeText,toHomePath,truncateText}from'./common/logging.mjs';export{createRuntimeLogger,summarizeRuntimeManifest,summarizeShellConfig}from'./common/runtime-logger.mjs';export{asRecord,asStringArray,copyDirFresh,dedupeStrings,ensureDir,getPackageMetadata,getTrimmedString,hasFile,listDirs,pathExists,readJson,readPluginManifest,toRuntimeRelative,writeJson}from'./common/utils.mjs';export{applyFeishuChannelConfig,createConnectorPluginEntry,createDingtalkDocMcpServerConfig,normalizeFeishuDmPolicy,normalizeFeishuGroupPolicy,pickPluginConfigFields,readOpenClawMcpServersFromConfig,writeOpenClawMcpServersToConfig}from'./connectors/config-utils.mjs';function _0x33fa(_0x5ed5d1,_0x38aaa8){_0x5ed5d1=_0x5ed5d1-0x11b;var _0xa599d6=_0xa599();var _0x33fac6=_0xa599d6[_0x5ed5d1];return _0x33fac6;}export*from'./connectors/constants.mjs';export{createConnectorController}from'./connectors/controller.mjs';export{installKdocsCliBinary,resolveRuntimeKdocsCliCommand}from'./connectors/kdocs-cli.mjs';export{createGeneratedFilesStore}from'./files/generated-files-store.mjs';export{registerFileHandlers}from'./files/handlers.mjs';export{registerProductLogHandlers}from'./log-reporting/handlers.mjs';export{reportLogs,resolveWujieApiEndpoint}from'./log-reporting/report-logs.mjs';export{extractModelMessageContent,registerModelHandlers}from'./models/handlers.mjs';export{createPreferencesStore}from'./preferences/store.mjs';export{createAgentSessionsMapStore}from'./sessions/agent-sessions-map-store.mjs';export{createSessionSqliteStore}from'./sessions/session-sqlite-store.mjs';export{deleteManagedSkill,importSkillZip,syncManagedSkillsToConfig,updateManagedSkillConfig}from'./skills/import.mjs';export{createMarketSkillRuntime,deleteMarketSkillRegistryEntry,importMarketSkillZip,mapMarketRegisteredSkills,readSkillMarketRegistry}from'./skills/market.mjs';export{createTerminalManager}from'./terminal/manager.mjs';
@@ -1 +1 @@
1
- function _0x2614(){var _0x59a589=['2114703zSrzob','15620BHoZPI','18pyAVQU','logs:rep','ested','info','8345190TPgZhW','report','68zjvKYC','descript','gateToke','ion','\x20log\x20rep','14310jWaJog','ort','4808GmQovv','renderer','string','660806EMCswA','4004287NxrNpl','1530936CwQjph','app:log:'];_0x2614=function(){return _0x59a589;};return _0x2614();}(function(_0xeba23d,_0x5ede52){var _0x378490=_0x2f34,_0x3042a2=_0xeba23d();while(!![]){try{var _0x550025=-parseInt(_0x378490(0x171))/0x1+-parseInt(_0x378490(0x16f))/0x2+-parseInt(_0x378490(0x173))/0x3+-parseInt(_0x378490(0x165))/0x4*(-parseInt(_0x378490(0x174))/0x5)+parseInt(_0x378490(0x175))/0x6*(parseInt(_0x378490(0x170))/0x7)+-parseInt(_0x378490(0x16c))/0x8*(-parseInt(_0x378490(0x16a))/0x9)+parseInt(_0x378490(0x179))/0xa;if(_0x550025===_0x5ede52)break;else _0x3042a2['push'](_0x3042a2['shift']());}catch(_0x1a156c){_0x3042a2['push'](_0x3042a2['shift']());}}}(_0x2614,0xf274c));function _0x2f34(_0x550748,_0x165037){_0x550748=_0x550748-0x164;var _0x261470=_0x2614();var _0x2f3462=_0x261470[_0x550748];return _0x2f3462;}import{reportLogs}from'./report-logs.mjs';export function registerProductLogHandlers({app:_0xb2548e,configController:_0x4612ed,diagnosticEventFromError:_0x3a72ac,diagnosticsWriter:_0x27090b,exportLogsArchive:_0x1bdd17,handle:_0x46b346,mainLogger:_0x4ca63e,rendererLogger:_0x1f6824,summarizeText:_0x45affb,toHomePath:_0x5a71d1}){var _0x418039=_0x2f34;_0x46b346(_0x418039(0x172)+_0x418039(0x164),async(_0x264d62,_0x171c68)=>{var _0x32544f=_0x418039;return _0x1f6824?.[_0x32544f(0x178)](_0x32544f(0x16d)+_0x32544f(0x169)+'ort\x20requ'+_0x32544f(0x177),{'description':_0x45affb(String(_0x171c68||''),0xa0)}),!![];}),_0x46b346(_0x418039(0x176)+_0x418039(0x16b),async(_0x1d6bac,_0x14f517={})=>reportLogs({'app':_0xb2548e,'configController':_0x4612ed,'diagnosticsWriter':_0x27090b,'diagnosticEventFromError':_0x3a72ac,'exportLogsArchive':_0x1bdd17,'mainLogger':_0x4ca63e,'summarizeText':_0x45affb,'toHomePath':_0x5a71d1,'description':typeof _0x14f517[_0x418039(0x166)+_0x418039(0x168)]===_0x418039(0x16e)?_0x14f517[_0x418039(0x166)+_0x418039(0x168)]:'','gateToken':typeof _0x14f517[_0x418039(0x167)+'n']===_0x418039(0x16e)?_0x14f517[_0x418039(0x167)+'n']:'','endpoint':typeof _0x14f517['endpoint']==='string'?_0x14f517['endpoint']:''}));}
1
+ function _0x46ea(_0x4f7eee,_0x34d1dc){_0x4f7eee=_0x4f7eee-0xea;var _0x56802e=_0x5680();var _0x46ea92=_0x56802e[_0x4f7eee];return _0x46ea92;}(function(_0x35cde8,_0x5c7483){var _0x5dc60a=_0x46ea,_0x99172a=_0x35cde8();while(!![]){try{var _0x51d32a=parseInt(_0x5dc60a(0xf1))/0x1+-parseInt(_0x5dc60a(0xed))/0x2+parseInt(_0x5dc60a(0xf6))/0x3+parseInt(_0x5dc60a(0xf8))/0x4+parseInt(_0x5dc60a(0xf9))/0x5+-parseInt(_0x5dc60a(0xfa))/0x6+parseInt(_0x5dc60a(0xef))/0x7;if(_0x51d32a===_0x5c7483)break;else _0x99172a['push'](_0x99172a['shift']());}catch(_0x1a8346){_0x99172a['push'](_0x99172a['shift']());}}}(_0x5680,0x514a6));import{reportLogs}from'./report-logs.mjs';function _0x5680(){var _0x52e7a9=['descript','ion','284316NHOEYj','renderer','2655408elkUyS','1781515GOoOFT','3451698dTubcj','endpoint','gateToke','report','logs:rep','725820nTClNc','ort','243026OzWQGd','info','121514aKEQVx','app:log:','string'];_0x5680=function(){return _0x52e7a9;};return _0x5680();}export function registerProductLogHandlers({app:_0x298d53,configController:_0x253255,diagnosticEventFromError:_0x147986,diagnosticsWriter:_0x4abe93,exportLogsArchive:_0x4fb172,handle:_0x102583,mainLogger:_0x111bea,rendererLogger:_0x4adf2d,summarizeText:_0x2165a7,toHomePath:_0xd2092f}){var _0x46ae1a=_0x46ea;_0x102583(_0x46ae1a(0xf2)+_0x46ae1a(0xeb),async(_0x1abec9,_0x23e343)=>{var _0x5b48a2=_0x46ae1a;return _0x4adf2d?.[_0x5b48a2(0xf0)](_0x5b48a2(0xf7)+'\x20log\x20rep'+'ort\x20requ'+'ested',{'description':_0x2165a7(String(_0x23e343||''),0xa0)}),!![];}),_0x102583(_0x46ae1a(0xec)+_0x46ae1a(0xee),async(_0x4c93ba,_0x5cb7fb={})=>reportLogs({'app':_0x298d53,'configController':_0x253255,'diagnosticsWriter':_0x4abe93,'diagnosticEventFromError':_0x147986,'exportLogsArchive':_0x4fb172,'mainLogger':_0x111bea,'summarizeText':_0x2165a7,'toHomePath':_0xd2092f,'description':typeof _0x5cb7fb['descript'+_0x46ae1a(0xf5)]==='string'?_0x5cb7fb[_0x46ae1a(0xf4)+_0x46ae1a(0xf5)]:'','gateToken':typeof _0x5cb7fb[_0x46ae1a(0xea)+'n']===_0x46ae1a(0xf3)?_0x5cb7fb[_0x46ae1a(0xea)+'n']:'','endpoint':typeof _0x5cb7fb['endpoint']===_0x46ae1a(0xf3)?_0x5cb7fb[_0x46ae1a(0xfb)]:''}));}
@@ -1 +1 @@
1
- (function(_0x52d23e,_0x15e841){const _0x1ea4cc=_0xf7e1,_0xacf3f=_0x52d23e();while(!![]){try{const _0x373823=parseInt(_0x1ea4cc(0xd5))/0x1+-parseInt(_0x1ea4cc(0xcf))/0x2+parseInt(_0x1ea4cc(0xc5))/0x3+parseInt(_0x1ea4cc(0xc4))/0x4+parseInt(_0x1ea4cc(0xce))/0x5+-parseInt(_0x1ea4cc(0xd0))/0x6+-parseInt(_0x1ea4cc(0xb9))/0x7;if(_0x373823===_0x15e841)break;else _0xacf3f['push'](_0xacf3f['shift']());}catch(_0x4c9d47){_0xacf3f['push'](_0xacf3f['shift']());}}}(_0x2dc1,0xa20c5));function _0xf7e1(_0xf2b35c,_0x36429e){_0xf2b35c=_0xf2b35c-0xaa;const _0x2dc18e=_0x2dc1();let _0xf7e102=_0x2dc18e[_0xf2b35c];return _0xf7e102;}import{basename}from'node:path';import{readFile,rm}from'node:fs/promises';export function resolveWujieApiEndpoint(){const _0x4c1694=_0xf7e1;return String(process.env.VITE_WUJIE_API_ENDPOINT||'')[_0x4c1694(0xc9)]()[_0x4c1694(0xc6)](/\/+$/,'');}export async function reportLogs({app:_0xc32aa4,configController:_0x4dbd6a,diagnosticsWriter:_0x4ff798,diagnosticEventFromError:_0x147743,exportLogsArchive:_0x4041e0,mainLogger:_0x32e2ce,readFileFn:readFileFn=readFile,rmFn:rmFn=rm,summarizeText:_0x588dda,toHomePath:_0xc1b340,description:description='',gateToken:gateToken='',endpoint:endpoint=''}={}){const _0x1d1b69=_0xf7e1;let _0x96d7a5='';const _0x2dc24f=Date[_0x1d1b69(0xaf)]();try{const _0x2b5294=await _0x4041e0({'logsDir':_0x4dbd6a[_0x1d1b69(0xc1)][_0x1d1b69(0xc8)],'targetDir':_0xc32aa4[_0x1d1b69(0xad)]('temp'),'appVersion':_0xc32aa4[_0x1d1b69(0xd4)+'on']()});_0x96d7a5=_0x2b5294[_0x1d1b69(0xb7)];const _0x523d79=await readFileFn(_0x96d7a5),_0x4f51d5=new FormData();_0x4f51d5[_0x1d1b69(0xd8)]('file',new Blob([_0x523d79],{'type':'applicat'+_0x1d1b69(0xd6)}),basename(_0x96d7a5)),_0x4f51d5['append'](_0x1d1b69(0xaa)+_0x1d1b69(0xb8),'wujie-ag'+_0x1d1b69(0xcc));const _0x130ad2={};typeof gateToken===_0x1d1b69(0xcd)&&gateToken[_0x1d1b69(0xc9)]()&&(_0x130ad2[_0x1d1b69(0xae)+'en']=gateToken['trim']());const _0x18cbd2=String(endpoint||resolveWujieApiEndpoint())['trim']()[_0x1d1b69(0xc6)](/\/+$/,'');if(!_0x18cbd2)throw new Error('缺少日志上传服务'+'地址');const _0x50a7bc=await fetch(_0x18cbd2+('/wj-open'+_0x1d1b69(0xca)+_0x1d1b69(0xbb)+_0x1d1b69(0xb6)),{'method':_0x1d1b69(0xb0),'headers':_0x130ad2,'body':_0x4f51d5,'signal':AbortSignal[_0x1d1b69(0xc3)](0x3a98)}),_0x5a20ac=await _0x50a7bc['text']();let _0x200f63={};try{_0x200f63=JSON[_0x1d1b69(0xac)](_0x5a20ac);}catch{throw new Error('上传日志失败(H'+'TTP\x20'+_0x50a7bc[_0x1d1b69(0xbc)]+')');}const _0x5bb75d=_0x200f63?.[_0x1d1b69(0xb4)]===!![]||String(_0x200f63?.[_0x1d1b69(0xd7)])==='200',_0x1c0419=_0x200f63?.[_0x1d1b69(0xd1)];if(!_0x5bb75d||!_0x1c0419)throw new Error(_0x1d1b69(0xcb)+_0x1d1b69(0xbf)+_0x50a7bc[_0x1d1b69(0xbc)]+')');const _0x84e621=await fetch(_0x18cbd2+('/wj-open'+_0x1d1b69(0xb3)+_0x1d1b69(0xd3)+_0x1d1b69(0xbe)),{'method':'POST','headers':{'Content-Type':_0x1d1b69(0xbd)+'ion/json',..._0x130ad2},'body':JSON['stringif'+'y']({'packageUrl':_0x1c0419,'description':description}),'signal':AbortSignal[_0x1d1b69(0xc3)](0x3a98)});return _0x32e2ce?.[_0x1d1b69(0xb2)](_0x1d1b69(0xc2)+_0x1d1b69(0xba),{'durationMs':Date[_0x1d1b69(0xaf)]()-_0x2dc24f,'uploadStatus':_0x50a7bc[_0x1d1b69(0xbc)],'reportStatus':_0x84e621[_0x1d1b69(0xbc)]}),!![];}catch(_0x39211b){_0x32e2ce?.['error'](_0x1d1b69(0xc2)+_0x1d1b69(0xc7)+'ed',{'durationMs':Date['now']()-_0x2dc24f,'error':_0x39211b}),await _0x4ff798?.[_0x1d1b69(0xc0)+_0x1d1b69(0xd2)](_0x147743(_0x39211b,{'category':_0x1d1b69(0xab)+'rt','event':'logs_rep'+'ort_fail'+'ed','message':_0x1d1b69(0xb5),'durationMs':Date['now']()-_0x2dc24f,'meta':{'description':_0x588dda(description,0xa0),'archivePath':_0x96d7a5?_0xc1b340(_0x96d7a5):''}}));throw _0x39211b;}finally{if(_0x96d7a5)await rmFn(_0x96d7a5,{'force':!![]})[_0x1d1b69(0xb1)](()=>{});}}function _0x2dc1(){const _0x5688a3=['POST','catch','info','/v2/claw','success','日志上传上报失败','/upload','path','y_name','6295688aNCklA','orted','ral/file','status','applicat','ceptions','TTP\x20','captureI','paths','logs\x20rep','timeout','3055144JOvKtz','1164039dCzbAV','replace','ort\x20fail','logsDir','trim','/v2/gene','上传日志失败(H','ent-logs','string','2916030kPNpbX','1585808zQbVBC','3024264mFJROU','data','ncident','/aipc/ex','getVersi','1125076rLRFeM','ion/zip','code','append','director','log_repo','parse','getPath','gate-tok','now'];_0x2dc1=function(){return _0x5688a3;};return _0x2dc1();}
1
+ (function(_0x35fe91,_0x46b61e){const _0x343e0f=_0x11c2,_0x1138ef=_0x35fe91();while(!![]){try{const _0x56845f=parseInt(_0x343e0f(0xdb))/0x1*(parseInt(_0x343e0f(0xf7))/0x2)+-parseInt(_0x343e0f(0xdd))/0x3*(parseInt(_0x343e0f(0xf6))/0x4)+parseInt(_0x343e0f(0xd9))/0x5+-parseInt(_0x343e0f(0xd6))/0x6*(parseInt(_0x343e0f(0xfa))/0x7)+-parseInt(_0x343e0f(0xd1))/0x8*(-parseInt(_0x343e0f(0xde))/0x9)+-parseInt(_0x343e0f(0xd3))/0xa+parseInt(_0x343e0f(0xdc))/0xb*(-parseInt(_0x343e0f(0xe3))/0xc);if(_0x56845f===_0x46b61e)break;else _0x1138ef['push'](_0x1138ef['shift']());}catch(_0x60a8f6){_0x1138ef['push'](_0x1138ef['shift']());}}}(_0x3a80,0x4a62a));function _0x3a80(){const _0x12a5c2=['success','200','上传日志失败(H','wujie-ag','timeout','ral/file','POST','y_name','ceptions','getVersi','info','ort\x20fail','359812WTAvVd','179126JsBKWR','now','/upload','2198588kzbpvI','gate-tok','captureI','file','getPath','status','ncident','/wj-open','logs_rep','applicat','text','orted','2912lwWjEN','ort_fail','1632370NOjIyz','logs\x20rep','append','6bPtUlI','ion/json','error','1265360CvzWAF','path','4NrxuPa','22MRSOQB','3owOCBU','11214HbSAKV','/v2/gene','parse','trim','paths','1157472NeGuac','data','replace','catch','ion/zip','log_repo','temp'];_0x3a80=function(){return _0x12a5c2;};return _0x3a80();}import{basename}from'node:path';import{readFile,rm}from'node:fs/promises';export function resolveWujieApiEndpoint(){const _0x2d2a58=_0x11c2;return String(process.env.VITE_WUJIE_API_ENDPOINT||'')[_0x2d2a58(0xe1)]()[_0x2d2a58(0xe5)](/\/+$/,'');}function _0x11c2(_0x2ca608,_0x5de813){_0x2ca608=_0x2ca608-0xcc;const _0x3a8061=_0x3a80();let _0x11c2ab=_0x3a8061[_0x2ca608];return _0x11c2ab;}export async function reportLogs({app:_0x5ed443,configController:_0x5615a1,diagnosticsWriter:_0x3e4ea2,diagnosticEventFromError:_0x1203bb,exportLogsArchive:_0x406eb5,mainLogger:_0x55563b,readFileFn:readFileFn=readFile,rmFn:rmFn=rm,summarizeText:_0x3e0b04,toHomePath:_0x4beb72,description:description='',gateToken:gateToken='',endpoint:endpoint=''}={}){const _0x122fa9=_0x11c2;let _0x290652='';const _0x589d1e=Date[_0x122fa9(0xf8)]();try{const _0xedf07e=await _0x406eb5({'logsDir':_0x5615a1[_0x122fa9(0xe2)]['logsDir'],'targetDir':_0x5ed443[_0x122fa9(0xfe)](_0x122fa9(0xe9)),'appVersion':_0x5ed443[_0x122fa9(0xf3)+'on']()});_0x290652=_0xedf07e[_0x122fa9(0xda)];const _0x3a4253=await readFileFn(_0x290652),_0x139120=new FormData();_0x139120[_0x122fa9(0xd5)](_0x122fa9(0xfd),new Blob([_0x3a4253],{'type':_0x122fa9(0xce)+_0x122fa9(0xe7)}),basename(_0x290652)),_0x139120[_0x122fa9(0xd5)]('director'+_0x122fa9(0xf1),_0x122fa9(0xed)+'ent-logs');const _0x375ee9={};typeof gateToken==='string'&&gateToken[_0x122fa9(0xe1)]()&&(_0x375ee9[_0x122fa9(0xfb)+'en']=gateToken[_0x122fa9(0xe1)]());const _0x34a08f=String(endpoint||resolveWujieApiEndpoint())[_0x122fa9(0xe1)]()[_0x122fa9(0xe5)](/\/+$/,'');if(!_0x34a08f)throw new Error('缺少日志上传服务'+'地址');const _0x3ce088=await fetch(_0x34a08f+(_0x122fa9(0xcc)+_0x122fa9(0xdf)+_0x122fa9(0xef)+_0x122fa9(0xf9)),{'method':_0x122fa9(0xf0),'headers':_0x375ee9,'body':_0x139120,'signal':AbortSignal['timeout'](0x3a98)}),_0x1d275c=await _0x3ce088[_0x122fa9(0xcf)]();let _0xbad3b9={};try{_0xbad3b9=JSON[_0x122fa9(0xe0)](_0x1d275c);}catch{throw new Error('上传日志失败(H'+'TTP\x20'+_0x3ce088['status']+')');}const _0x36db95=_0xbad3b9?.[_0x122fa9(0xea)]===!![]||String(_0xbad3b9?.['code'])===_0x122fa9(0xeb),_0x1a321f=_0xbad3b9?.[_0x122fa9(0xe4)];if(!_0x36db95||!_0x1a321f)throw new Error(_0x122fa9(0xec)+'TTP\x20'+_0x3ce088['status']+')');const _0x1ba702=await fetch(_0x34a08f+(_0x122fa9(0xcc)+'/v2/claw'+'/aipc/ex'+_0x122fa9(0xf2)),{'method':'POST','headers':{'Content-Type':_0x122fa9(0xce)+_0x122fa9(0xd7),..._0x375ee9},'body':JSON['stringif'+'y']({'packageUrl':_0x1a321f,'description':description}),'signal':AbortSignal[_0x122fa9(0xee)](0x3a98)});return _0x55563b?.[_0x122fa9(0xf4)]('logs\x20rep'+_0x122fa9(0xd0),{'durationMs':Date[_0x122fa9(0xf8)]()-_0x589d1e,'uploadStatus':_0x3ce088[_0x122fa9(0xff)],'reportStatus':_0x1ba702[_0x122fa9(0xff)]}),!![];}catch(_0x1fdf90){_0x55563b?.[_0x122fa9(0xd8)](_0x122fa9(0xd4)+_0x122fa9(0xf5)+'ed',{'durationMs':Date[_0x122fa9(0xf8)]()-_0x589d1e,'error':_0x1fdf90}),await _0x3e4ea2?.[_0x122fa9(0xfc)+_0x122fa9(0x100)](_0x1203bb(_0x1fdf90,{'category':_0x122fa9(0xe8)+'rt','event':_0x122fa9(0xcd)+_0x122fa9(0xd2)+'ed','message':'日志上传上报失败','durationMs':Date['now']()-_0x589d1e,'meta':{'description':_0x3e0b04(description,0xa0),'archivePath':_0x290652?_0x4beb72(_0x290652):''}}));throw _0x1fdf90;}finally{if(_0x290652)await rmFn(_0x290652,{'force':!![]})[_0x122fa9(0xe6)](()=>{});}}
@@ -1 +1 @@
1
- (function(_0x3fd93b,_0x15dc25){const _0x3bc932=_0x5650,_0x23f2af=_0x3fd93b();while(!![]){try{const _0x261115=parseInt(_0x3bc932(0xf1))/0x1*(parseInt(_0x3bc932(0xe5))/0x2)+parseInt(_0x3bc932(0x102))/0x3+-parseInt(_0x3bc932(0xf7))/0x4+parseInt(_0x3bc932(0xe7))/0x5+parseInt(_0x3bc932(0xfe))/0x6*(parseInt(_0x3bc932(0xe9))/0x7)+-parseInt(_0x3bc932(0x10a))/0x8+-parseInt(_0x3bc932(0xfb))/0x9*(-parseInt(_0x3bc932(0xf2))/0xa);if(_0x261115===_0x15dc25)break;else _0x23f2af['push'](_0x23f2af['shift']());}catch(_0x404f2c){_0x23f2af['push'](_0x23f2af['shift']());}}}(_0x4057,0x40dd4));export function extractModelMessageContent(_0x119657){const _0x36bb11=_0x5650;if(typeof _0x119657===_0x36bb11(0xf3))return _0x119657;if(!Array['isArray'](_0x119657))return'';return _0x119657[_0x36bb11(0x104)](_0x1c5c51=>{const _0x272b33=_0x36bb11;if(typeof _0x1c5c51===_0x272b33(0xf3))return _0x1c5c51;if(!_0x1c5c51||typeof _0x1c5c51!==_0x272b33(0xe4))return'';const _0x4417ef=typeof _0x1c5c51[_0x272b33(0x101)]===_0x272b33(0xf3)?_0x1c5c51[_0x272b33(0x101)][_0x272b33(0xec)+'ase']():'';if(_0x4417ef&&_0x4417ef!==_0x272b33(0xfd)&&_0x4417ef!==_0x272b33(0x103)+_0x272b33(0xf4)&&_0x4417ef!==_0x272b33(0x109))return'';for(const _0x3e2e0a of['text',_0x272b33(0x109),_0x272b33(0xeb),_0x272b33(0x10b)+'xt','output_t'+_0x272b33(0xf4)]){if(typeof _0x1c5c51[_0x3e2e0a]===_0x272b33(0xf3))return _0x1c5c51[_0x3e2e0a];}return'';})[_0x36bb11(0x108)]('');}function normalizeCustomModelPayload(_0x23a560={}){const _0x396e35=_0x5650,_0x1e38fb=String(_0x23a560['id']||'')['trim']();return{..._0x23a560,'id':_0x1e38fb,'modelName':String(_0x23a560['modelNam'+'e']||'')['trim'](),'provider':String(_0x23a560[_0x396e35(0xfc)]||_0x396e35(0xe8)),'apiKey':String(_0x23a560[_0x396e35(0xef)]||''),'protocol':_0x23a560['protocol']===_0x396e35(0xe6)+'c'?'anthropi'+'c':_0x396e35(0xfa),'baseUrl':String(_0x23a560[_0x396e35(0x107)]||''),..._0x23a560['provider'+_0x396e35(0xed)]?{'providerName':String(_0x23a560[_0x396e35(0xfc)+'Name'])}:{},..._0x23a560[_0x396e35(0x100)+'oviderNa'+'me']?{'customProviderName':String(_0x23a560['customPr'+'oviderNa'+'me'])}:{}};}function _0x5650(_0x2aa6d1,_0xd28cdc){_0x2aa6d1=_0x2aa6d1-0xe3;const _0x4057f4=_0x4057();let _0x565097=_0x4057f4[_0x2aa6d1];return _0x565097;}export function registerModelHandlers({handle:_0x1e0100,modelHandlers:modelHandlers={}}){const _0x14ad7c=_0x5650,_0x501303=_0x2f0596=>{const _0x181ee8=_0x5650,_0x7ec8c8=modelHandlers[_0x2f0596];if(typeof _0x7ec8c8!==_0x181ee8(0xff))throw new Error(_0x181ee8(0xea)+_0x181ee8(0xf5)+_0x181ee8(0xe3)+'t\x20regist'+_0x181ee8(0x105)+_0x2f0596);return _0x7ec8c8;};_0x1e0100('models:c'+_0x14ad7c(0xf8)+_0x14ad7c(0x106)+'e',async(_0x12c0ed,_0xb36d49={})=>_0x501303('saveCust'+_0x14ad7c(0xf6))(normalizeCustomModelPayload(_0xb36d49))),_0x1e0100(_0x14ad7c(0xee)+_0x14ad7c(0xf8)+_0x14ad7c(0xf0)+'ete',async(_0x1dcce2,_0x4d5a6d={})=>_0x501303('deleteCu'+_0x14ad7c(0xf9)+'l')(_0x4d5a6d));}function _0x4057(){const _0x5d41ec=['201652AqaRtM','anthropi','287600rXKiRe','custom','7DqtSdW','core\x20mod','content','toLowerC','Name','models:c','apiKey','dels:del','1NOSIxy','579230tVvXeA','string','ext','el\x20handl','omModel','1924624EcQZRn','ustom-mo','stomMode','openai','27LnoPsI','provider','text','2827842VhJpJJ','function','customPr','type','663642cVUfUM','output_t','map','ered:\x20','dels:sav','baseUrl','join','message','2222368RzgtRZ','outputTe','er\x20is\x20no','object'];_0x4057=function(){return _0x5d41ec;};return _0x4057();}
1
+ function _0x3cb8(){const _0x2c104f=['el\x20handl','map','1491861DhWQDs','er\x20is\x20no','171molLiq','ase','t\x20regist','modelNam','27620AsbEIV','join','string','956767SximQq','toLowerC','protocol','provider','models:c','outputTe','baseUrl','deleteCu','customPr','anthropi','custom','Name','core\x20mod','text','content','ustom-mo','5554417rASzBq','trim','459ctgCHS','message','296936sQNKGp','dels:del','455GdIBwy','output_t','openai','ete','isArray','saveCust','oviderNa','function','type','object','3485982eVpBCo','30XIPfRg','90FbuWRO'];_0x3cb8=function(){return _0x2c104f;};return _0x3cb8();}(function(_0x542ff3,_0x32c402){const _0x200d99=_0x3d79,_0x1ea627=_0x542ff3();while(!![]){try{const _0x482f8e=parseInt(_0x200d99(0x191))/0x1*(-parseInt(_0x200d99(0x1a1))/0x2)+-parseInt(_0x200d99(0x1a4))/0x3+-parseInt(_0x200d99(0x1aa))/0x4*(parseInt(_0x200d99(0x195))/0x5)+-parseInt(_0x200d99(0x19f))/0x6+-parseInt(_0x200d99(0x1ad))/0x7+parseInt(_0x200d99(0x193))/0x8*(parseInt(_0x200d99(0x1a6))/0x9)+-parseInt(_0x200d99(0x1a0))/0xa*(-parseInt(_0x200d99(0x18f))/0xb);if(_0x482f8e===_0x32c402)break;else _0x1ea627['push'](_0x1ea627['shift']());}catch(_0x4d0760){_0x1ea627['push'](_0x1ea627['shift']());}}}(_0x3cb8,0x56ef9));export function extractModelMessageContent(_0x256019){const _0x1e8062=_0x3d79;if(typeof _0x256019===_0x1e8062(0x1ac))return _0x256019;if(!Array[_0x1e8062(0x199)](_0x256019))return'';return _0x256019[_0x1e8062(0x1a3)](_0x332b0a=>{const _0x1fd35e=_0x1e8062;if(typeof _0x332b0a===_0x1fd35e(0x1ac))return _0x332b0a;if(!_0x332b0a||typeof _0x332b0a!==_0x1fd35e(0x19e))return'';const _0x3315b9=typeof _0x332b0a[_0x1fd35e(0x19d)]===_0x1fd35e(0x1ac)?_0x332b0a[_0x1fd35e(0x19d)][_0x1fd35e(0x1ae)+_0x1fd35e(0x1a7)]():'';if(_0x3315b9&&_0x3315b9!==_0x1fd35e(0x18c)&&_0x3315b9!==_0x1fd35e(0x196)+'ext'&&_0x3315b9!==_0x1fd35e(0x192))return'';for(const _0x42c039 of[_0x1fd35e(0x18c),_0x1fd35e(0x192),_0x1fd35e(0x18d),_0x1fd35e(0x1b2)+'xt',_0x1fd35e(0x196)+'ext']){if(typeof _0x332b0a[_0x42c039]===_0x1fd35e(0x1ac))return _0x332b0a[_0x42c039];}return'';})[_0x1e8062(0x1ab)]('');}function _0x3d79(_0x15f801,_0x246471){_0x15f801=_0x15f801-0x189;const _0x3cb861=_0x3cb8();let _0x3d7941=_0x3cb861[_0x15f801];return _0x3d7941;}function normalizeCustomModelPayload(_0x2050a7={}){const _0x4d939d=_0x3d79,_0x2f6d45=String(_0x2050a7['id']||'')[_0x4d939d(0x190)]();return{..._0x2050a7,'id':_0x2f6d45,'modelName':String(_0x2050a7[_0x4d939d(0x1a9)+'e']||'')[_0x4d939d(0x190)](),'provider':String(_0x2050a7['provider']||_0x4d939d(0x189)),'apiKey':String(_0x2050a7['apiKey']||''),'protocol':_0x2050a7[_0x4d939d(0x1af)]===_0x4d939d(0x1b6)+'c'?_0x4d939d(0x1b6)+'c':_0x4d939d(0x197),'baseUrl':String(_0x2050a7[_0x4d939d(0x1b3)]||''),..._0x2050a7[_0x4d939d(0x1b0)+_0x4d939d(0x18a)]?{'providerName':String(_0x2050a7['provider'+_0x4d939d(0x18a)])}:{},..._0x2050a7[_0x4d939d(0x1b5)+_0x4d939d(0x19b)+'me']?{'customProviderName':String(_0x2050a7['customPr'+_0x4d939d(0x19b)+'me'])}:{}};}export function registerModelHandlers({handle:_0x32ecfe,modelHandlers:modelHandlers={}}){const _0x5ced70=_0x3d79,_0x130020=_0x142418=>{const _0x4b2913=_0x3d79,_0x37242b=modelHandlers[_0x142418];if(typeof _0x37242b!==_0x4b2913(0x19c))throw new Error(_0x4b2913(0x18b)+_0x4b2913(0x1a2)+_0x4b2913(0x1a5)+_0x4b2913(0x1a8)+'ered:\x20'+_0x142418);return _0x37242b;};_0x32ecfe('models:c'+_0x5ced70(0x18e)+'dels:sav'+'e',async(_0x4dddc8,_0x5cf528={})=>_0x130020(_0x5ced70(0x19a)+'omModel')(normalizeCustomModelPayload(_0x5cf528))),_0x32ecfe(_0x5ced70(0x1b1)+_0x5ced70(0x18e)+_0x5ced70(0x194)+_0x5ced70(0x198),async(_0xc4822f,_0x169825={})=>_0x130020(_0x5ced70(0x1b4)+'stomMode'+'l')(_0x169825));}
@@ -1 +1 @@
1
- (function(_0x3c6e24,_0x119223){const _0x366f0a=_0x1449,_0x1abedc=_0x3c6e24();while(!![]){try{const _0x502219=-parseInt(_0x366f0a(0x8e))/0x1*(-parseInt(_0x366f0a(0x8a))/0x2)+-parseInt(_0x366f0a(0x88))/0x3+-parseInt(_0x366f0a(0x8d))/0x4+-parseInt(_0x366f0a(0x80))/0x5*(parseInt(_0x366f0a(0x8c))/0x6)+parseInt(_0x366f0a(0x8b))/0x7*(-parseInt(_0x366f0a(0x82))/0x8)+-parseInt(_0x366f0a(0x83))/0x9*(parseInt(_0x366f0a(0x81))/0xa)+parseInt(_0x366f0a(0x89))/0xb*(parseInt(_0x366f0a(0x84))/0xc);if(_0x502219===_0x119223)break;else _0x1abedc['push'](_0x1abedc['shift']());}catch(_0x30c5b8){_0x1abedc['push'](_0x1abedc['shift']());}}}(_0x3cac,0x343ad));import{join}from'node:path';import{readJson,writeJson}from'../common/utils.mjs';function _0x3cac(){const _0x442904=['585045PoomJR','13012392VODUOZ','hasOwnPr','prototyp','call','894750bfTgkI','11YooefD','2EIVGZf','4963SHCjui','12QbMIzJ','971152mLKoIk','276382vgfjQz','530505LHaJxw','60FzWZal','40lqSEhP'];_0x3cac=function(){return _0x442904;};return _0x3cac();}function _0x1449(_0xe3e189,_0x394d2d){_0xe3e189=_0xe3e189-0x80;const _0x3cace4=_0x3cac();let _0x1449cc=_0x3cace4[_0xe3e189];return _0x1449cc;}const STORE_FILE='preferen'+'ces.json';export function createPreferencesStore({stateDir:_0x486cae,storeFile:storeFile=STORE_FILE}={}){async function _0x4de9e7(){return readJson(join(_0x486cae,storeFile),{});}async function _0xcce8c3(_0xb6696a,_0xaa500b=null){const _0x260548=_0x1449,_0xb1738f=await _0x4de9e7();return Object[_0x260548(0x86)+'e'][_0x260548(0x85)+'operty'][_0x260548(0x87)](_0xb1738f,_0xb6696a)?_0xb1738f[_0xb6696a]:_0xaa500b;}async function _0x1f4cd2(_0x2aa3ef,_0x203219){const _0x5e7d14=await _0x4de9e7();return _0x5e7d14[_0x2aa3ef]=_0x203219,await writeJson(join(_0x486cae,storeFile),_0x5e7d14),{'ok':!![],'value':_0x203219};}return{'read':_0x4de9e7,'get':_0xcce8c3,'set':_0x1f4cd2};}
1
+ const _0x55a7e8=_0x435b;(function(_0x4a293c,_0x7f5593){const _0x1aceeb=_0x435b,_0x4afcae=_0x4a293c();while(!![]){try{const _0x58b6a4=parseInt(_0x1aceeb(0xf6))/0x1+parseInt(_0x1aceeb(0x101))/0x2+parseInt(_0x1aceeb(0xfb))/0x3*(parseInt(_0x1aceeb(0xfa))/0x4)+parseInt(_0x1aceeb(0xfc))/0x5+-parseInt(_0x1aceeb(0xf7))/0x6*(parseInt(_0x1aceeb(0xf8))/0x7)+-parseInt(_0x1aceeb(0xff))/0x8*(parseInt(_0x1aceeb(0x102))/0x9)+parseInt(_0x1aceeb(0x100))/0xa;if(_0x58b6a4===_0x7f5593)break;else _0x4afcae['push'](_0x4afcae['shift']());}catch(_0x431ae7){_0x4afcae['push'](_0x4afcae['shift']());}}}(_0x4eba,0x1b85f));function _0x4eba(){const _0x47a8b2=['9qhdOyV','preferen','call','hasOwnPr','114564zokDnL','169410OWvxYM','49sYnStb','prototyp','8440fnYoSy','78wmkbJz','645690fAOAaC','operty','ces.json','847576hDtRkO','539510eqStcV','127628hDhCnL'];_0x4eba=function(){return _0x47a8b2;};return _0x4eba();}import{join}from'node:path';function _0x435b(_0x18c081,_0x4cb39f){_0x18c081=_0x18c081-0xf3;const _0x4ebafc=_0x4eba();let _0x435b98=_0x4ebafc[_0x18c081];return _0x435b98;}import{readJson,writeJson}from'../common/utils.mjs';const STORE_FILE=_0x55a7e8(0xf3)+_0x55a7e8(0xfe);export function createPreferencesStore({stateDir:_0x5672ab,storeFile:storeFile=STORE_FILE}={}){async function _0x56b5f3(){return readJson(join(_0x5672ab,storeFile),{});}async function _0x5eb2d8(_0x4b7971,_0xf140d9=null){const _0x619fe3=_0x435b,_0x1fee54=await _0x56b5f3();return Object[_0x619fe3(0xf9)+'e'][_0x619fe3(0xf5)+_0x619fe3(0xfd)][_0x619fe3(0xf4)](_0x1fee54,_0x4b7971)?_0x1fee54[_0x4b7971]:_0xf140d9;}async function _0x31fb9e(_0x3596a1,_0x5f6a22){const _0x14c79e=await _0x56b5f3();return _0x14c79e[_0x3596a1]=_0x5f6a22,await writeJson(join(_0x5672ab,storeFile),_0x14c79e),{'ok':!![],'value':_0x5f6a22};}return{'read':_0x56b5f3,'get':_0x5eb2d8,'set':_0x31fb9e};}
@@ -1 +1 @@
1
- const _0x2a1c1c=_0x481e;(function(_0x18e249,_0x22fd92){const _0x30a9ca=_0x481e,_0x5ced1f=_0x18e249();while(!![]){try{const _0x38afb6=parseInt(_0x30a9ca(0x2f8))/0x1*(-parseInt(_0x30a9ca(0x230))/0x2)+-parseInt(_0x30a9ca(0x241))/0x3*(parseInt(_0x30a9ca(0x23c))/0x4)+-parseInt(_0x30a9ca(0x2e1))/0x5*(parseInt(_0x30a9ca(0x224))/0x6)+parseInt(_0x30a9ca(0x346))/0x7*(-parseInt(_0x30a9ca(0x2bf))/0x8)+-parseInt(_0x30a9ca(0x226))/0x9*(-parseInt(_0x30a9ca(0x330))/0xa)+parseInt(_0x30a9ca(0x2f1))/0xb+parseInt(_0x30a9ca(0x3d3))/0xc;if(_0x38afb6===_0x22fd92)break;else _0x5ced1f['push'](_0x5ced1f['shift']());}catch(_0xb53cfa){_0x5ced1f['push'](_0x5ced1f['shift']());}}}(_0x6926,0xeae4e));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=_0x2a1c1c(0x359)+'time',MANIFEST_NAME='runtime-'+'manifest'+_0x2a1c1c(0x3d0),NPM_INSTALL_TIMEOUT_MS=0xf*0x3c*0x3e8;export function resolveRuntimeRoot(_0x2d58b1){if(process.env.WUJIE_SHELL_RUNTIME_ROOT)return resolve(process.env.WUJIE_SHELL_RUNTIME_ROOT);return resolve(_0x2d58b1,RUNTIME_DIR);}export function resolveManifestPath(_0x5c6aaf){return join(_0x5c6aaf,MANIFEST_NAME);}async function loadProductRuntime(_0x227317,_0x3cdeb6){const _0x453287=_0x2a1c1c,_0x16a374=[join(_0x227317,_0x453287(0x2b2)+'ntime','index.mj'+'s'),join(_0x3cdeb6,'shell-ru'+_0x453287(0x38c),_0x453287(0x364)+'s')];for(const _0x436d8a of _0x16a374){if(!existsSync(_0x436d8a))continue;return await import(pathToFileURL(_0x436d8a)[_0x453287(0x3d7)]+_0x453287(0x2ac)+Date['now']());}return{};}export async function prepareRuntime(_0x51d27d,{syncOnly:syncOnly=![]}={}){const _0x2e2ac2=_0x2a1c1c,_0x402a12=resolveRuntimeRoot(_0x51d27d['projectR'+_0x2e2ac2(0x278)]),_0x30e96c=createRuntimeLogger(getConfigPaths(_0x51d27d),'runtime'),_0x5a7c13=Date[_0x2e2ac2(0x21d)]();_0x30e96c?.[_0x2e2ac2(0x219)](_0x2e2ac2(0x36a)+_0x2e2ac2(0x28f)+_0x2e2ac2(0x21a),{'syncOnly':syncOnly,'runtimeRoot':_0x402a12,'shellConfig':summarizeShellConfig(_0x51d27d)});try{const _0x47485d=await ensureRuntimeBase(_0x51d27d,_0x402a12,{'runtimeLogger':_0x30e96c,'syncOnly':syncOnly});_0x30e96c?.[_0x2e2ac2(0x219)](_0x2e2ac2(0x28f)+_0x2e2ac2(0x1ff)+_0x2e2ac2(0x247),{'manifestPath':resolveManifestPath(_0x402a12),'manifest':summarizeRuntimeManifest(_0x47485d)}),validateRuntimeNodeVersion(_0x47485d,_0x51d27d),_0x30e96c?.[_0x2e2ac2(0x219)](_0x2e2ac2(0x28f)+_0x2e2ac2(0x1f2)+_0x2e2ac2(0x2d7)+'idated',{'nodeVersion':_0x47485d['nodeVers'+_0x2e2ac2(0x361)]});if(syncOnly)validateRuntimeOpenClawVersion(_0x47485d,_0x51d27d),_0x30e96c?.[_0x2e2ac2(0x219)]('runtime\x20'+_0x2e2ac2(0x3e7)+'\x20version'+_0x2e2ac2(0x36f)+'ed',{'openclawVersion':_0x47485d['openclaw'+_0x2e2ac2(0x323)]});else{if(_0x47485d[_0x2e2ac2(0x3e7)+_0x2e2ac2(0x323)]!==_0x51d27d[_0x2e2ac2(0x3e7)][_0x2e2ac2(0x3e7)+_0x2e2ac2(0x323)]){const _0x438f9b=await loadRuntimeInfo(_0x51d27d[_0x2e2ac2(0x2e4)+_0x2e2ac2(0x278)]);_0x30e96c?.[_0x2e2ac2(0x219)]('openclaw'+_0x2e2ac2(0x1f8)+_0x2e2ac2(0x220)+'\x20started',{'fromVersion':_0x47485d['openclaw'+_0x2e2ac2(0x323)]||_0x2e2ac2(0x31a),'toVersion':_0x51d27d['openclaw'][_0x2e2ac2(0x3e7)+_0x2e2ac2(0x323)]}),await installOpenClawPackage(_0x438f9b,_0x51d27d[_0x2e2ac2(0x3e7)][_0x2e2ac2(0x3e7)+_0x2e2ac2(0x323)]),_0x47485d[_0x2e2ac2(0x3e7)+'Version']=_0x51d27d[_0x2e2ac2(0x3e7)][_0x2e2ac2(0x3e7)+_0x2e2ac2(0x323)],_0x30e96c?.[_0x2e2ac2(0x219)]('openclaw'+_0x2e2ac2(0x1f8)+_0x2e2ac2(0x220)+'\x20complet'+'ed',{'openclawVersion':_0x47485d['openclaw'+_0x2e2ac2(0x323)]});}}_0x47485d['generate'+_0x2e2ac2(0x2f9)]=new Date()[_0x2e2ac2(0x3e4)+_0x2e2ac2(0x232)](),_0x47485d[_0x2e2ac2(0x237)+_0x2e2ac2(0x361)]=_0x51d27d[_0x2e2ac2(0x3e7)]['nodeVers'+_0x2e2ac2(0x361)],_0x47485d['product']={'appId':_0x51d27d[_0x2e2ac2(0x3c2)],'productName':_0x51d27d['productN'+_0x2e2ac2(0x260)],'dataDirName':_0x51d27d[_0x2e2ac2(0x2d8)+_0x2e2ac2(0x260)]},await patchChatHistoryMixedToolContentBug(_0x402a12,_0x47485d,{'runtimeLogger':_0x30e96c}),await patchChannelPluginRuntimeBug(_0x402a12,_0x47485d,{'runtimeLogger':_0x30e96c});const _0x5b072e=await loadProductRuntime(_0x51d27d[_0x2e2ac2(0x2e4)+'oot'],_0x402a12);if(typeof _0x5b072e[_0x2e2ac2(0x36e)+_0x2e2ac2(0x305)+_0x2e2ac2(0x38c)]===_0x2e2ac2(0x3bc)){const _0xc327e7=createRuntimeInfoFromManifest(_0x402a12,_0x47485d);await _0x5b072e[_0x2e2ac2(0x36e)+'roductRu'+_0x2e2ac2(0x38c)]({'shellConfig':_0x51d27d,'runtime':_0xc327e7,'runtimeLogger':_0x30e96c,'syncOnly':syncOnly}),_0x30e96c?.[_0x2e2ac2(0x219)]('product\x20'+_0x2e2ac2(0x28f)+_0x2e2ac2(0x38d)+'nced');}await patchSessionStoreSqliteRuntime(_0x402a12,_0x47485d,{'runtimeLogger':_0x30e96c});!syncOnly&&(await hasConfiguredKdocsSkill(_0x51d27d)?(await installKdocsCliBinary(_0x51d27d,createRuntimeInfoFromManifest(_0x402a12,_0x47485d),{'runtimeLogger':_0x30e96c,'syncOnly':syncOnly}),_0x30e96c?.[_0x2e2ac2(0x219)](_0x2e2ac2(0x3b7)+_0x2e2ac2(0x279)+'e\x20tools\x20'+_0x2e2ac2(0x22c))):_0x30e96c?.[_0x2e2ac2(0x219)](_0x2e2ac2(0x3b7)+_0x2e2ac2(0x279)+_0x2e2ac2(0x350)+_0x2e2ac2(0x297)+_0x2e2ac2(0x249)+_0x2e2ac2(0x31c)+'\x20configu'+_0x2e2ac2(0x3aa)));const _0x47a9e5=Array[_0x2e2ac2(0x2b3)](_0x47485d[_0x2e2ac2(0x28e)])?_0x47485d[_0x2e2ac2(0x28e)][_0x2e2ac2(0x3b5)]:0x0;return await syncManifestPluginScope(_0x51d27d,_0x402a12,_0x47485d),_0x30e96c?.[_0x2e2ac2(0x219)](_0x2e2ac2(0x28f)+'plugin\x20s'+'cope\x20syn'+_0x2e2ac2(0x339),{'beforePluginCount':_0x47a9e5,'afterPluginCount':Array[_0x2e2ac2(0x2b3)](_0x47485d['plugins'])?_0x47485d[_0x2e2ac2(0x28e)]['length']:0x0,'pluginSpecCount':Array[_0x2e2ac2(0x2b3)](_0x47485d['pluginSp'+_0x2e2ac2(0x338)])?_0x47485d[_0x2e2ac2(0x212)+_0x2e2ac2(0x338)][_0x2e2ac2(0x3b5)]:0x0}),await syncConfiguredNpmPlugins(_0x51d27d,_0x402a12,_0x47485d,{'runtimeLogger':_0x30e96c,'syncOnly':syncOnly}),_0x30e96c?.['info'](_0x2e2ac2(0x307)+'ed\x20npm\x20p'+_0x2e2ac2(0x2f5)+_0x2e2ac2(0x29c),{'pluginSpecCount':_0x51d27d[_0x2e2ac2(0x3e7)]['pluginSp'+_0x2e2ac2(0x338)]['length'],'pluginCount':Array[_0x2e2ac2(0x2b3)](_0x47485d[_0x2e2ac2(0x28e)])?_0x47485d[_0x2e2ac2(0x28e)][_0x2e2ac2(0x3b5)]:0x0}),await syncProductPlugins(_0x51d27d,_0x402a12,_0x47485d,{'runtimeLogger':_0x30e96c}),_0x30e96c?.[_0x2e2ac2(0x219)](_0x2e2ac2(0x2d9)+'plugins\x20'+'synced',{'localPluginCount':_0x51d27d[_0x2e2ac2(0x3e7)]['resolved'+_0x2e2ac2(0x3ca)+_0x2e2ac2(0x385)]['length'],'pluginCount':Array['isArray'](_0x47485d['plugins'])?_0x47485d['plugins']['length']:0x0}),await syncProductAgents(_0x51d27d,_0x402a12,_0x47485d),_0x30e96c?.['info'](_0x2e2ac2(0x2d9)+'agents\x20s'+_0x2e2ac2(0x29c),{'sources':_0x51d27d[_0x2e2ac2(0x3e7)][_0x2e2ac2(0x2ed)+'LocalAge'+_0x2e2ac2(0x290)],'entryCount':_0x47485d['agents']?.[_0x2e2ac2(0x36c)+'nt'],'installPath':_0x47485d[_0x2e2ac2(0x235)]?.[_0x2e2ac2(0x24a)+_0x2e2ac2(0x228)]}),await syncProductSkills(_0x51d27d,_0x402a12,_0x47485d),_0x30e96c?.[_0x2e2ac2(0x219)]('product\x20'+_0x2e2ac2(0x37b)+_0x2e2ac2(0x29c),{'sources':_0x51d27d[_0x2e2ac2(0x3e7)][_0x2e2ac2(0x2ed)+_0x2e2ac2(0x36d)+_0x2e2ac2(0x3c4)],'entryCount':_0x47485d['skills']?.['entryCou'+'nt'],'installPath':_0x47485d[_0x2e2ac2(0x26c)]?.[_0x2e2ac2(0x24a)+'ath']}),await syncRuntimeWrapper(_0x51d27d,_0x402a12,_0x47485d),_0x30e96c?.[_0x2e2ac2(0x219)](_0x2e2ac2(0x28f)+'wrapper\x20'+_0x2e2ac2(0x22c),{'wujieclawBin':_0x47485d[_0x2e2ac2(0x233)+_0x2e2ac2(0x32a)]}),await writeJson(resolveManifestPath(_0x402a12),_0x47485d),_0x30e96c?.[_0x2e2ac2(0x219)](_0x2e2ac2(0x28f)+'manifest'+_0x2e2ac2(0x261),{'manifestPath':resolveManifestPath(_0x402a12),'manifest':summarizeRuntimeManifest(_0x47485d),'durationMs':Date[_0x2e2ac2(0x21d)]()-_0x5a7c13}),await _0x30e96c?.['flush'](),_0x47485d;}catch(_0x442cb9){_0x30e96c?.['error'](_0x2e2ac2(0x36a)+_0x2e2ac2(0x28f)+_0x2e2ac2(0x318),{'syncOnly':syncOnly,'runtimeRoot':_0x402a12,'durationMs':Date[_0x2e2ac2(0x21d)]()-_0x5a7c13,'error':_0x442cb9}),await _0x30e96c?.[_0x2e2ac2(0x20e)]();throw _0x442cb9;}}async function syncRuntimeWrapper(_0x440cc4,_0x330266,_0x428a36){const _0x3d2d6f=_0x2a1c1c,_0x3eca4c=_0x440cc4[_0x3d2d6f(0x3e7)]?.[_0x3d2d6f(0x286)+_0x3d2d6f(0x22f)]??'wujieai.'+'json',_0x11c79e=join(_0x330266,_0x3d2d6f(0x3c8),_0x3d2d6f(0x233)+'w'),_0x291302=join(_0x330266,_0x3d2d6f(0x3c8),'wujiecla'+_0x3d2d6f(0x372)),_0x1c4443=normalizeRuntimeRelativePath(relative(dirname(_0x11c79e),resolve(_0x330266,_0x428a36[_0x3d2d6f(0x328)+'utable']))),_0x4cc2ee=normalizeRuntimeRelativePath(relative(dirname(_0x11c79e),resolve(_0x330266,_0x428a36[_0x3d2d6f(0x3e7)+_0x3d2d6f(0x395)]))),_0x3e14f0=_0x3d2d6f(0x276)+_0x440cc4[_0x3d2d6f(0x2d8)+_0x3d2d6f(0x260)],_0x5c3a1b=_0x3d2d6f(0x35c)+_0x3d2d6f(0x2ef)+_0x440cc4[_0x3d2d6f(0x2d8)+_0x3d2d6f(0x260)];await mkdir(dirname(_0x11c79e),{'recursive':!![]});const _0x19cc9b=fileURLToPath(new URL(_0x3d2d6f(0x27c)+_0x3d2d6f(0x30f)+'ie-logo.'+_0x3d2d6f(0x21e),import.meta.url)),_0x23f351=join(_0x330266,'bin',_0x3d2d6f(0x358)+_0x3d2d6f(0x3e0));await cp(_0x19cc9b,_0x23f351),await writeFile(_0x11c79e,[_0x3d2d6f(0x3ab)+'h','export\x20O'+_0x3d2d6f(0x236)+_0x3d2d6f(0x31e)+'OPENCLAW'+_0x3d2d6f(0x31b)+_0x3e14f0+'}\x22',_0x3d2d6f(0x3a1)+_0x3d2d6f(0x236)+_0x3d2d6f(0x366)+_0x3d2d6f(0x30e)+_0x3d2d6f(0x26f)+_0x3d2d6f(0x356)+'-'+_0x3e14f0+'}\x22',_0x3d2d6f(0x3a1)+_0x3d2d6f(0x236)+_0x3d2d6f(0x240)+_0x3d2d6f(0x2d0)+_0x3d2d6f(0x2ba)+'CLAW_CON'+'FIG_FILE'+'_NAME:-'+_0x3eca4c+'}\x22',_0x3d2d6f(0x3a1)+_0x3d2d6f(0x236)+_0x3d2d6f(0x218)+_0x3d2d6f(0x271)+_0x3d2d6f(0x236)+_0x3d2d6f(0x218)+_0x3d2d6f(0x365)+_0x3e14f0+'/'+_0x3eca4c+'}\x22','SCRIPT_D'+'IR=$(CDP'+'ATH=\x20cd\x20'+_0x3d2d6f(0x34c)+'rname\x20--'+_0x3d2d6f(0x22d)+_0x3d2d6f(0x371),_0x3d2d6f(0x3d2)+_0x3d2d6f(0x285)+_0x3d2d6f(0x380)+'JIE_NO_L'+_0x3d2d6f(0x251)+'then',_0x3d2d6f(0x3a9)+_0x3d2d6f(0x2c7)+_0x1c4443+(_0x3d2d6f(0x28d)+'PT_DIR/w'+_0x3d2d6f(0x3d9)+_0x3d2d6f(0x342)+_0x3d2d6f(0x399)+_0x3d2d6f(0x25d)+'ue'),'fi',_0x3d2d6f(0x301)+_0x3d2d6f(0x352)+'R/'+_0x1c4443+('\x22\x20\x22$SCRI'+'PT_DIR/')+_0x4cc2ee+'\x22\x20\x22$@\x22',''][_0x3d2d6f(0x39b)]('\x0a'),_0x3d2d6f(0x2cc)),await chmod(_0x11c79e,0x1ed),await writeFile(_0x291302,['@echo\x20of'+'f',_0x3d2d6f(0x3a8)+'NCLAW_HO'+_0x3d2d6f(0x25f)+'\x20set\x20\x22OP'+_0x3d2d6f(0x2de)+_0x3d2d6f(0x3da)+_0x5c3a1b+'\x22','if\x20\x22%OPE'+_0x3d2d6f(0x26f)+_0x3d2d6f(0x351)+_0x3d2d6f(0x210)+_0x3d2d6f(0x26b)+'LAW_STAT'+'E_DIR='+_0x5c3a1b+'\x22',_0x3d2d6f(0x3a8)+_0x3d2d6f(0x382)+_0x3d2d6f(0x202)+_0x3d2d6f(0x393)+_0x3d2d6f(0x36b)+_0x3d2d6f(0x23b)+'AW_CONFI'+'G_FILE_N'+'AME='+_0x3eca4c+'\x22','if\x20\x22%OPE'+_0x3d2d6f(0x382)+'NFIG_PAT'+_0x3d2d6f(0x379)+'set\x20\x22OPE'+_0x3d2d6f(0x382)+'NFIG_PAT'+'H='+_0x5c3a1b+'\x5c'+_0x3eca4c+'\x22',_0x3d2d6f(0x377)+_0x3d2d6f(0x2db)+_0x3d2d6f(0x347),_0x3d2d6f(0x1fe)+_0x3d2d6f(0x3b1)+toWindowsPath(_0x1c4443)+('\x22\x20\x22%SCRI'+_0x3d2d6f(0x317))+toWindowsPath(_0x4cc2ee)+_0x3d2d6f(0x2aa),''][_0x3d2d6f(0x39b)]('\x0d\x0a'),'utf8'),_0x428a36['wujiecla'+_0x3d2d6f(0x32a)]=toRuntimeRelative(_0x330266,process[_0x3d2d6f(0x363)]===_0x3d2d6f(0x345)?_0x291302:_0x11c79e);}async function patchChatHistoryMixedToolContentBug(_0x192165,_0x2da8b2,_0x5e1fe2={}){const _0x12600d=_0x2a1c1c,_0x20134b=resolve(_0x192165,_0x2da8b2[_0x12600d(0x3e7)+_0x12600d(0x2f2)+'ir']),_0x785693=join(_0x20134b,_0x12600d(0x1fa));let _0x2c5675=[];try{_0x2c5675=await readdir(_0x785693,{'withFileTypes':!![]});}catch{_0x5e1fe2[_0x12600d(0x397)+'ogger']?.[_0x12600d(0x32c)]?.(_0x12600d(0x327)+_0x12600d(0x289)+_0x12600d(0x2ad)+_0x12600d(0x1fd)+_0x12600d(0x3a5)+_0x12600d(0x20d)+_0x12600d(0x222),{'distDir':_0x785693,'openclawVersion':_0x2da8b2[_0x12600d(0x3e7)+'Version']});return;}const _0x10a312=_0x2c5675[_0x12600d(0x242)](_0x261647=>_0x261647['isFile']()&&_0x261647[_0x12600d(0x30b)][_0x12600d(0x2c2)+'th']('chat-dis'+_0x12600d(0x217)+_0x12600d(0x23d))&&_0x261647['name']['endsWith'](_0x12600d(0x2be)))['map'](_0xb469cd=>join(_0x785693,_0xb469cd[_0x12600d(0x30b)]));if(_0x10a312['length']===0x0){_0x5e1fe2[_0x12600d(0x397)+_0x12600d(0x2d6)]?.[_0x12600d(0x32c)]?.(_0x12600d(0x327)+_0x12600d(0x289)+_0x12600d(0x2ad)+_0x12600d(0x1fd)+_0x12600d(0x394)+'ile\x20not\x20'+_0x12600d(0x222),{'openclawVersion':_0x2da8b2['openclaw'+_0x12600d(0x323)]});return;}for(const _0x3ece8e of _0x10a312){const _0x3673ea=await readFile(_0x3ece8e,_0x12600d(0x2cc)),_0x1858e2=patchMixedToolContentFromSource(_0x3673ea);if(!_0x1858e2['patched']){if(_0x1858e2[_0x12600d(0x341)]===_0x12600d(0x2e5)+_0x12600d(0x320)){_0x5e1fe2['runtimeL'+_0x12600d(0x2d6)]?.[_0x12600d(0x219)]?.('chat\x20his'+_0x12600d(0x289)+_0x12600d(0x2ad)+_0x12600d(0x3ad)+_0x12600d(0x22a)+_0x12600d(0x313),{'openclawVersion':_0x2da8b2['openclaw'+_0x12600d(0x323)],'filePath':_0x3ece8e});return;}continue;}await writeFile(_0x3ece8e,_0x1858e2[_0x12600d(0x2b7)],_0x12600d(0x2cc)),_0x5e1fe2[_0x12600d(0x397)+_0x12600d(0x2d6)]?.[_0x12600d(0x219)]?.(_0x12600d(0x327)+_0x12600d(0x289)+'ed-tool\x20'+_0x12600d(0x3cd)+'plied',{'openclawVersion':_0x2da8b2['openclaw'+_0x12600d(0x323)],'filePath':_0x3ece8e,'note':_0x12600d(0x273)+_0x12600d(0x390)+'ibility\x20'+_0x12600d(0x349)+_0x12600d(0x3e2)+_0x12600d(0x39f)+_0x12600d(0x2c6)+_0x12600d(0x294)+_0x12600d(0x35e)+_0x12600d(0x2a6)+_0x12600d(0x20a)+'ify\x20upst'+_0x12600d(0x2da)+'\x20on\x20futu'+_0x12600d(0x296)+_0x12600d(0x3bb)});return;}_0x5e1fe2[_0x12600d(0x397)+_0x12600d(0x2d6)]?.[_0x12600d(0x32c)]?.(_0x12600d(0x327)+_0x12600d(0x289)+_0x12600d(0x2ad)+_0x12600d(0x1fd)+'ipped;\x20f'+'unction\x20'+'not\x20foun'+'d',{'openclawVersion':_0x2da8b2[_0x12600d(0x3e7)+'Version']});}async function patchChannelPluginRuntimeBug(_0x5901b8,_0x2dfdd0,_0x380979={}){const _0x4b1ae9=_0x2a1c1c,_0x34decc=resolve(_0x5901b8,_0x2dfdd0[_0x4b1ae9(0x3e7)+_0x4b1ae9(0x2f2)+'ir']),_0x1694ba=join(_0x34decc,_0x4b1ae9(0x1fa));let _0x6690af=[];try{_0x6690af=await readdir(_0x1694ba,{'withFileTypes':!![]});}catch{_0x380979[_0x4b1ae9(0x397)+_0x4b1ae9(0x2d6)]?.[_0x4b1ae9(0x32c)]?.(_0x4b1ae9(0x31f)+_0x4b1ae9(0x2ee)+_0x4b1ae9(0x3c5)+_0x4b1ae9(0x277)+'pped;\x20di'+'st\x20not\x20f'+_0x4b1ae9(0x3b9),{'distDir':_0x1694ba,'openclawVersion':_0x2dfdd0[_0x4b1ae9(0x3e7)+_0x4b1ae9(0x323)]});return;}const _0x4a97fa=_0x6690af[_0x4b1ae9(0x242)](_0x578e2a=>_0x578e2a['isFile']()&&_0x578e2a[_0x4b1ae9(0x30b)][_0x4b1ae9(0x2c2)+'th'](_0x4b1ae9(0x3b0))&&_0x578e2a[_0x4b1ae9(0x30b)][_0x4b1ae9(0x250)]('.js'))[_0x4b1ae9(0x30d)](_0x234374=>join(_0x1694ba,_0x234374[_0x4b1ae9(0x30b)])),_0x8ae109=await resolveRuntimeChannelImportPath(_0x1694ba,_0x6690af);if(_0x4a97fa[_0x4b1ae9(0x3b5)]===0x0){_0x380979[_0x4b1ae9(0x397)+'ogger']?.[_0x4b1ae9(0x32c)]?.(_0x4b1ae9(0x31f)+_0x4b1ae9(0x2ee)+_0x4b1ae9(0x3c5)+_0x4b1ae9(0x277)+_0x4b1ae9(0x265)+'ader\x20not'+_0x4b1ae9(0x357),{'openclawVersion':_0x2dfdd0[_0x4b1ae9(0x3e7)+'Version']});return;}if(!_0x8ae109){_0x380979['runtimeL'+_0x4b1ae9(0x2d6)]?.['warn']?.(_0x4b1ae9(0x31f)+_0x4b1ae9(0x2ee)+_0x4b1ae9(0x3c5)+_0x4b1ae9(0x277)+_0x4b1ae9(0x360)+_0x4b1ae9(0x203)+_0x4b1ae9(0x2b1)+_0x4b1ae9(0x37a)+_0x4b1ae9(0x222),{'openclawVersion':_0x2dfdd0[_0x4b1ae9(0x3e7)+'Version'],'distDir':_0x1694ba});return;}for(const _0xa17d86 of _0x4a97fa){const _0x526902=await readFile(_0xa17d86,_0x4b1ae9(0x2cc)),_0x230241=patchChannelPluginRuntimeFromSource(_0x526902,{'runtimeChannelImportPath':_0x8ae109});if(!_0x230241[_0x4b1ae9(0x320)]){if(_0x230241[_0x4b1ae9(0x341)]===_0x4b1ae9(0x2e5)+'patched'){_0x380979['runtimeL'+_0x4b1ae9(0x2d6)]?.['info']?.(_0x4b1ae9(0x31f)+_0x4b1ae9(0x2ee)+_0x4b1ae9(0x3c5)+'atch\x20alr'+'eady\x20app'+_0x4b1ae9(0x2cb),{'openclawVersion':_0x2dfdd0[_0x4b1ae9(0x3e7)+_0x4b1ae9(0x323)],'filePath':_0xa17d86});return;}continue;}await writeFile(_0xa17d86,_0x230241[_0x4b1ae9(0x2b7)],_0x4b1ae9(0x2cc)),_0x380979['runtimeL'+_0x4b1ae9(0x2d6)]?.[_0x4b1ae9(0x219)]?.(_0x4b1ae9(0x31f)+_0x4b1ae9(0x2ee)+_0x4b1ae9(0x3c5)+_0x4b1ae9(0x306)+_0x4b1ae9(0x2cb),{'openclawVersion':_0x2dfdd0[_0x4b1ae9(0x3e7)+_0x4b1ae9(0x323)],'filePath':_0xa17d86,'note':'Temporar'+'y\x20compat'+_0x4b1ae9(0x2ff)+_0x4b1ae9(0x349)+'r\x20OpenCl'+_0x4b1ae9(0x39f)+_0x4b1ae9(0x243)+_0x4b1ae9(0x214)+_0x4b1ae9(0x34d)+_0x4b1ae9(0x2ec)+_0x4b1ae9(0x2a4)+_0x4b1ae9(0x223)+_0x4b1ae9(0x331)+_0x4b1ae9(0x3cb)+_0x4b1ae9(0x2b6)+_0x4b1ae9(0x2d5)+_0x4b1ae9(0x34b)+_0x4b1ae9(0x374)+_0x4b1ae9(0x20f)});return;}_0x380979['runtimeL'+_0x4b1ae9(0x2d6)]?.[_0x4b1ae9(0x32c)]?.(_0x4b1ae9(0x31f)+_0x4b1ae9(0x2ee)+'untime\x20p'+_0x4b1ae9(0x277)+_0x4b1ae9(0x360)+_0x4b1ae9(0x2bc)+_0x4b1ae9(0x2f7)+'ot\x20found',{'openclawVersion':_0x2dfdd0['openclaw'+'Version']});}function _0x481e(_0x542bed,_0x40539){_0x542bed=_0x542bed-0x1f2;const _0x692668=_0x6926();let _0x481e4e=_0x692668[_0x542bed];return _0x481e4e;}async function patchSessionStoreSqliteRuntime(_0x28d793,_0x25e92d,_0x4e938e={}){const _0x2c93bb=_0x2a1c1c,_0x38ac08=resolve(_0x28d793,_0x25e92d[_0x2c93bb(0x3e7)+'WorkingD'+'ir']),_0x2ce8e1=join(_0x38ac08,_0x2c93bb(0x1fa)),_0x1eb378=_0x2c93bb(0x3d4)+_0x2c93bb(0x336)+'ime/sess'+_0x2c93bb(0x329)+_0x2c93bb(0x384)+_0x2c93bb(0x381),_0x1f659b=(await readdir(_0x2ce8e1,{'withFileTypes':!![]})[_0x2c93bb(0x32b)](()=>[]))[_0x2c93bb(0x242)](_0xab4164=>_0xab4164[_0x2c93bb(0x282)]()&&_0xab4164[_0x2c93bb(0x30b)][_0x2c93bb(0x2c2)+'th'](_0x2c93bb(0x21f)+_0x2c93bb(0x2d2))&&_0xab4164[_0x2c93bb(0x30b)][_0x2c93bb(0x250)]('.js'))['map'](_0x37e4ec=>join(_0x2ce8e1,_0x37e4ec['name'])),_0x1eccfa=(await readdir(_0x2ce8e1,{'withFileTypes':!![]})[_0x2c93bb(0x32b)](()=>[]))['filter'](_0x5320b1=>_0x5320b1['isFile']()&&_0x5320b1[_0x2c93bb(0x30b)][_0x2c93bb(0x2c2)+'th'](_0x2c93bb(0x34f))&&!_0x5320b1[_0x2c93bb(0x30b)][_0x2c93bb(0x2c2)+'th']('store-lo'+_0x2c93bb(0x2d2))&&_0x5320b1[_0x2c93bb(0x30b)]['endsWith'](_0x2c93bb(0x2be)))['map'](_0x3e3285=>join(_0x2ce8e1,_0x3e3285['name']));for(const _0x17ae6e of _0x1f659b){const _0x3ef625=await readFile(_0x17ae6e,_0x2c93bb(0x2cc)),_0x51f80f=patchSessionStoreLoadFromSource(_0x3ef625,{'bridgeImportPath':_0x1eb378});if(!_0x51f80f[_0x2c93bb(0x320)]){if(_0x51f80f[_0x2c93bb(0x341)]===_0x2c93bb(0x2e5)+'patched'){_0x4e938e['runtimeL'+_0x2c93bb(0x2d6)]?.[_0x2c93bb(0x219)]?.(_0x2c93bb(0x368)+_0x2c93bb(0x370)+_0x2c93bb(0x2ae)+_0x2c93bb(0x3d8)+_0x2c93bb(0x231),{'filePath':_0x17ae6e,'openclawVersion':_0x25e92d[_0x2c93bb(0x3e7)+_0x2c93bb(0x323)]});break;}continue;}await writeFile(_0x17ae6e,_0x51f80f[_0x2c93bb(0x2b7)],_0x2c93bb(0x2cc)),_0x4e938e[_0x2c93bb(0x397)+'ogger']?.['info']?.(_0x2c93bb(0x368)+_0x2c93bb(0x370)+_0x2c93bb(0x2ae)+'\x20applied',{'filePath':_0x17ae6e,'openclawVersion':_0x25e92d[_0x2c93bb(0x3e7)+_0x2c93bb(0x323)]});break;}for(const _0x3bb5b3 of _0x1eccfa){const _0x3b3058=await readFile(_0x3bb5b3,_0x2c93bb(0x2cc)),_0x415220=patchSessionStoreWriteFromSource(_0x3b3058,{'bridgeImportPath':_0x1eb378});if(!_0x415220[_0x2c93bb(0x320)]){if(_0x415220[_0x2c93bb(0x341)]===_0x2c93bb(0x2e5)+_0x2c93bb(0x320)){_0x4e938e[_0x2c93bb(0x397)+'ogger']?.[_0x2c93bb(0x219)]?.(_0x2c93bb(0x368)+_0x2c93bb(0x2a0)+_0x2c93bb(0x3e8)+_0x2c93bb(0x2ab)+_0x2c93bb(0x213)+'d',{'filePath':_0x3bb5b3,'openclawVersion':_0x25e92d[_0x2c93bb(0x3e7)+_0x2c93bb(0x323)]});break;}continue;}await writeFile(_0x3bb5b3,_0x415220[_0x2c93bb(0x2b7)],_0x2c93bb(0x2cc)),_0x4e938e['runtimeL'+'ogger']?.[_0x2c93bb(0x219)]?.('session\x20'+_0x2c93bb(0x2a0)+_0x2c93bb(0x3e8)+'h\x20applie'+'d',{'filePath':_0x3bb5b3,'openclawVersion':_0x25e92d['openclaw'+'Version']});break;}}async function resolveRuntimeChannelImportPath(_0x3c70a9,_0x132f4e){const _0x53de35=_0x2a1c1c,_0x1ce1e8=_0x132f4e[_0x53de35(0x242)](_0x3791d8=>_0x3791d8[_0x53de35(0x282)]()&&_0x3791d8[_0x53de35(0x30b)][_0x53de35(0x2c2)+'th'](_0x53de35(0x38b)+'channel-')&&_0x3791d8[_0x53de35(0x30b)][_0x53de35(0x250)]('.js')&&!_0x3791d8[_0x53de35(0x30b)]['startsWi'+'th'](_0x53de35(0x38b)+_0x53de35(0x2fa)+_0x53de35(0x1f5)))[_0x53de35(0x30d)](_0x133efb=>_0x133efb[_0x53de35(0x30b)])['sort']();for(const _0x533d5f of _0x1ce1e8){const _0xacebc=await readFile(join(_0x3c70a9,_0x533d5f),_0x53de35(0x2cc));if(_0xacebc[_0x53de35(0x3ae)](_0x53de35(0x34a)+_0x53de35(0x255)+_0x53de35(0x3c6)))return'./'+_0x533d5f;}return null;}function normalizeRuntimeRelativePath(_0x2e099f){const _0xe8394b=_0x2a1c1c;return _0x2e099f[_0xe8394b(0x246)+'ll']('\x5c','/');}function toWindowsPath(_0x2b95dc){const _0x555b93=_0x2a1c1c;return _0x2b95dc[_0x555b93(0x246)+'ll']('/','\x5c');}function validateRuntimeNodeVersion(_0x157d7a,_0x49d815){const _0x2af89f=_0x2a1c1c;if(_0x157d7a[_0x2af89f(0x237)+_0x2af89f(0x361)]===_0x49d815[_0x2af89f(0x3e7)][_0x2af89f(0x237)+'ion'])return;throw new Error(_0x2af89f(0x28f)+_0x2af89f(0x237)+_0x2af89f(0x2a1)+'atch:\x20ma'+'nifest='+(_0x157d7a[_0x2af89f(0x237)+_0x2af89f(0x361)]||_0x2af89f(0x31a))+(_0x2af89f(0x316)+_0x2af89f(0x27b))+_0x49d815[_0x2af89f(0x3e7)][_0x2af89f(0x237)+_0x2af89f(0x361)]+'.\x20'+(_0x2af89f(0x206)+_0x2af89f(0x2e9)+_0x2af89f(0x383)+_0x2af89f(0x216)+_0x2af89f(0x2fc)+'\x20runtime'+_0x2af89f(0x20b)+_0x2af89f(0x39a)+_0x2af89f(0x201)+_0x2af89f(0x398)+_0x2af89f(0x33d)+_0x2af89f(0x389)+'.'));}function validateRuntimeOpenClawVersion(_0x905e81,_0x4087fd){const _0x3d6477=_0x2a1c1c;if(_0x905e81[_0x3d6477(0x3e7)+'Version']===_0x4087fd[_0x3d6477(0x3e7)]['openclaw'+'Version'])return;throw new Error('runtime\x20'+'openclaw'+'Version\x20'+_0x3d6477(0x37d)+_0x3d6477(0x234)+'st='+(_0x905e81[_0x3d6477(0x3e7)+_0x3d6477(0x323)]||_0x3d6477(0x31a))+(_0x3d6477(0x316)+'config=')+_0x4087fd['openclaw'][_0x3d6477(0x3e7)+'Version']+'.\x20'+(_0x3d6477(0x206)+_0x3d6477(0x2e9)+_0x3d6477(0x383)+'\x22\x20so\x20the'+'\x20runtime'+_0x3d6477(0x252)+_0x3d6477(0x30c)+_0x3d6477(0x398)+_0x3d6477(0x3e6)+'Claw\x20ver'+_0x3d6477(0x283)));}function parseNpmPackJson(_0x125f82){const _0x24392c=_0x2a1c1c,_0xf4fab8=_0x125f82[_0x24392c(0x33c)](),_0x55fb4b=_0xf4fab8['indexOf']('[');if(_0x55fb4b<0x0)throw new Error('npm\x20pack'+_0x24392c(0x387)+'\x20return\x20'+_0x24392c(0x2c9)+_0xf4fab8[_0x24392c(0x29a)](0x0,0x1f4));const _0xff05f8=JSON[_0x24392c(0x2a9)](_0xf4fab8['slice'](_0x55fb4b)),_0x2257d6=Array['isArray'](_0xff05f8)?_0xff05f8[0x0]:_0xff05f8;if(!_0x2257d6||typeof _0x2257d6!=='object')throw new Error('npm\x20pack'+_0x24392c(0x2bd)+_0x24392c(0x2a2)+_0x24392c(0x28c)+_0x24392c(0x396)+_0xf4fab8['slice'](0x0,0x1f4));return _0x2257d6;}function normalizePackedTarballFilename(_0x2da96b){const _0x24d4f0=_0x2a1c1c;return _0x2da96b[_0x24d4f0(0x29e)](/^@/,'')[_0x24d4f0(0x246)+'ll']('/','-')[_0x24d4f0(0x246)+'ll']('\x5c','-');}async function runProcess(_0x3cb16a,_0x69891c,_0x4b6dbf={}){const _0x7321c8=_0x2a1c1c,_0x42f9ba=_0x4b6dbf[_0x7321c8(0x3a0)]||[_0x3cb16a,..._0x69891c][_0x7321c8(0x39b)]('\x20'),_0x5e9b4e=_0x4b6dbf['timeoutM'+'s']??NPM_INSTALL_TIMEOUT_MS,_0xede1bb=spawn(_0x3cb16a,_0x69891c,{'cwd':_0x4b6dbf[_0x7321c8(0x326)],'env':_0x4b6dbf[_0x7321c8(0x300)],'stdio':[_0x7321c8(0x256),_0x7321c8(0x270),_0x7321c8(0x270)]});return await new Promise((_0x39ad34,_0x44576f)=>{const _0x33dba2=_0x7321c8;let _0x5e554d='',_0x51fc60='',_0x1153cc=![];const _0x407329=setTimeout(()=>{const _0x55a1be=_0x481e;if(_0x1153cc)return;_0x1153cc=!![],_0xede1bb[_0x55a1be(0x3a2)]('SIGTERM'),_0x44576f(new Error(_0x42f9ba+(_0x55a1be(0x33f)+_0x55a1be(0x325)+'\x20')+_0x5e9b4e+'ms'));},_0x5e9b4e);_0xede1bb[_0x33dba2(0x211)]['on'](_0x33dba2(0x31d),_0x4e91d1=>{const _0x5d537a=_0x33dba2;_0x5e554d+=_0x4e91d1[_0x5d537a(0x37c)]();}),_0xede1bb[_0x33dba2(0x2c4)]['on'](_0x33dba2(0x31d),_0x5d7d22=>{_0x51fc60+=_0x5d7d22['toString']();}),_0xede1bb['on'](_0x33dba2(0x3b3),_0x3cb8c5=>{if(_0x1153cc)return;_0x1153cc=!![],clearTimeout(_0x407329),_0x44576f(_0x3cb8c5);}),_0xede1bb['on'](_0x33dba2(0x2f3),(_0x25181b,_0x44b8de)=>{const _0x50f095=_0x33dba2;if(_0x1153cc)return;_0x1153cc=!![],clearTimeout(_0x407329);if(_0x25181b===0x0){_0x39ad34({'stdout':_0x5e554d,'stderr':_0x51fc60});return;}_0x44576f(new Error(_0x42f9ba+('\x20failed\x20'+_0x50f095(0x2c1)+'e=')+(_0x25181b??_0x50f095(0x369))+_0x50f095(0x2cf)+(_0x44b8de??'null')+'\x0a'+(''+(_0x51fc60||_0x5e554d))[_0x50f095(0x33c)]()));});});}async function installOpenClawPackage(_0x4dcff7,_0x2ad53d){const _0x2bf06c=_0x2a1c1c,_0x575396=join(_0x4dcff7[_0x2bf06c(0x29f)+'oot'],_0x2bf06c(0x208)),_0x539cdc=join(_0x4dcff7[_0x2bf06c(0x29f)+_0x2bf06c(0x278)],_0x2bf06c(0x2dd)+'w-extrac'+'t');await mkdir(_0x575396,{'recursive':!![]}),await removePathWithRetries(_0x539cdc),await mkdir(_0x539cdc,{'recursive':!![]});const _0x4e1e55=await createRuntimeEnv(_0x4dcff7),_0xa5aab4=_0x2bf06c(0x3e7)+'@'+_0x2ad53d;console[_0x2bf06c(0x259)](_0x2bf06c(0x238)+_0x2bf06c(0x3ac)+_0x2bf06c(0x274)+_0x2bf06c(0x2c0)+'\x20'+_0xa5aab4);const _0x3c5a67=await runProcess(_0x4dcff7[_0x2bf06c(0x328)+_0x2bf06c(0x35b)],[_0x4dcff7['npmCli'],_0x2bf06c(0x3dd),_0xa5aab4,_0x2bf06c(0x29b)],{'cwd':_0x575396,'env':_0x4e1e55,'label':_0x2bf06c(0x21c)+'\x20'+_0xa5aab4}),_0x7ee6b3=parseNpmPackJson(_0x3c5a67[_0x2bf06c(0x211)]);if(_0x7ee6b3[_0x2bf06c(0x2c5)]!==_0x2ad53d)throw new Error(_0x2bf06c(0x280)+'ed\x20OpenC'+_0x2bf06c(0x3b6)+_0x2ad53d+(_0x2bf06c(0x3a3)+_0x2bf06c(0x3b8))+_0x7ee6b3[_0x2bf06c(0x2c5)]);const _0x31317e=resolve(_0x575396,_0x7ee6b3[_0x2bf06c(0x2e2)]);if(!existsSync(_0x31317e))throw new Error(_0x2bf06c(0x21c)+_0x2bf06c(0x387)+'\x20create\x20'+_0x2bf06c(0x3b4)+'\x20'+_0x31317e);await runProcess(_0x2bf06c(0x3af),[_0x2bf06c(0x3b2),_0x31317e,'-C',_0x539cdc],{'label':'extract\x20'+_0x7ee6b3[_0x2bf06c(0x2e2)]}),await removePathWithRetries(_0x4dcff7[_0x2bf06c(0x3e7)+'WorkingD'+'ir']),await rename(join(_0x539cdc,_0x2bf06c(0x205)),_0x4dcff7[_0x2bf06c(0x3e7)+'WorkingD'+'ir']),await removePathWithRetries(_0x539cdc),await runProcess(_0x4dcff7[_0x2bf06c(0x328)+_0x2bf06c(0x35b)],[_0x4dcff7['npmCli'],'install',_0x2bf06c(0x2a3)+'ev',_0x2bf06c(0x25b)+_0x2bf06c(0x2df),_0x2bf06c(0x264)+'it',_0x2bf06c(0x3cc)+'d',_0x2bf06c(0x334)+_0x2bf06c(0x253)+'ps'],{'cwd':_0x4dcff7['openclaw'+'WorkingD'+'ir'],'env':_0x4e1e55,'label':_0x2bf06c(0x257)+_0x2bf06c(0x239)+_0xa5aab4+(_0x2bf06c(0x38f)+'\x20depende'+_0x2bf06c(0x376))});if(!existsSync(_0x4dcff7[_0x2bf06c(0x3e7)+_0x2bf06c(0x395)]))throw new Error(_0x2bf06c(0x315)+_0x2bf06c(0x37e)+_0x2bf06c(0x2b4)+_0x2bf06c(0x284)+_0x2bf06c(0x220)+':\x20'+_0x4dcff7[_0x2bf06c(0x3e7)+_0x2bf06c(0x395)]);}async function ensureRuntimeBase(_0x59b32e,_0x4acc8b,_0x15ed02={}){const _0x462759=_0x2a1c1c;await mkdir(_0x4acc8b,{'recursive':!![]});let _0x43ebd4=await readRuntimeManifest(_0x4acc8b);const _0x31b277=_0x59b32e[_0x462759(0x3e7)]['nodeVers'+_0x462759(0x361)],_0x286c92=_0x59b32e['openclaw'][_0x462759(0x3e7)+'Version'],_0x2feaef=existsSync(resolveManifestPath(_0x4acc8b)),_0x23d107=runtimeHasRequiredPaths(_0x4acc8b,_0x43ebd4),_0x218188=_0x43ebd4[_0x462759(0x237)+_0x462759(0x361)]===_0x31b277;!_0x2feaef||!_0x23d107||!_0x218188?(_0x15ed02[_0x462759(0x397)+_0x462759(0x2d6)]?.[_0x462759(0x219)](_0x462759(0x28f)+_0x462759(0x314)+_0x462759(0x373)+'ed',{'runtimeRoot':_0x4acc8b,'reason':!_0x2feaef?_0x462759(0x229)+'manifest':!_0x23d107?_0x462759(0x229)+_0x462759(0x23a)+_0x462759(0x38f)+_0x462759(0x288):'node\x20ver'+'sion\x20mis'+'match','syncOnly':_0x15ed02[_0x462759(0x348)]}),_0x43ebd4=await buildRuntimeBase(_0x59b32e,_0x4acc8b,_0x43ebd4),_0x15ed02[_0x462759(0x397)+_0x462759(0x2d6)]?.[_0x462759(0x219)](_0x462759(0x28f)+_0x462759(0x314)+_0x462759(0x38e)+_0x462759(0x3de),{'manifest':summarizeRuntimeManifest(_0x43ebd4)})):_0x15ed02[_0x462759(0x397)+_0x462759(0x2d6)]?.[_0x462759(0x219)](_0x462759(0x28f)+'base\x20alr'+_0x462759(0x3db)+'rent',{'manifest':summarizeRuntimeManifest(_0x43ebd4)});if(!existsSync(resolve(_0x4acc8b,_0x43ebd4[_0x462759(0x3e7)+'Bin']))){const _0x160c9c=createRuntimeInfoFromManifest(_0x4acc8b,_0x43ebd4,{'allowMissingOpenClaw':!![]});await installOpenClawPackage(_0x160c9c,_0x286c92),_0x43ebd4[_0x462759(0x3e7)+'Version']=_0x286c92;}return _0x43ebd4;}function runtimeHasRequiredPaths(_0x387715,_0x54ed0c){const _0x2f659b=_0x2a1c1c;return[_0x2f659b(0x328)+_0x2f659b(0x35b),_0x2f659b(0x309),_0x2f659b(0x3e7)+_0x2f659b(0x2f2)+'ir','openclaw'+_0x2f659b(0x395)][_0x2f659b(0x33a)](_0x356b6a=>typeof _0x54ed0c[_0x356b6a]==='string'&&_0x54ed0c[_0x356b6a][_0x2f659b(0x33c)]())&&[_0x2f659b(0x328)+_0x2f659b(0x35b),_0x2f659b(0x309)]['every'](_0x3d29bb=>existsSync(resolve(_0x387715,_0x54ed0c[_0x3d29bb])));}async function buildRuntimeBase(_0x27b4c4,_0x489cdc,_0x41d51d={}){const _0x2fea9d=_0x2a1c1c,_0x592ec0=join(_0x489cdc,_0x2fea9d(0x2bb));await ensureRuntimeNode(_0x27b4c4,_0x592ec0);const _0xc7e440={..._0x41d51d,'generatedAt':new Date()[_0x2fea9d(0x3e4)+_0x2fea9d(0x232)](),'nodeVersion':_0x27b4c4[_0x2fea9d(0x3e7)][_0x2fea9d(0x237)+_0x2fea9d(0x361)],'openclawVersion':_0x41d51d[_0x2fea9d(0x3e7)+'Version']||'','platform':process[_0x2fea9d(0x363)],'arch':process[_0x2fea9d(0x266)],'nodeExecutable':'node/bin'+'/node','npmCli':_0x2fea9d(0x32d)+'/node_mo'+'dules/np'+_0x2fea9d(0x2b8)+_0x2fea9d(0x295),'openclawWorkingDir':_0x2fea9d(0x3e7),'openclawBin':'openclaw'+_0x2fea9d(0x2f6)+_0x2fea9d(0x25e)};return await writeJson(resolveManifestPath(_0x489cdc),_0xc7e440),_0xc7e440;}async function removePathWithRetries(_0x1b06f0){await rm(_0x1b06f0,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96});}async function ensureRuntimeNode(_0x16e8b5,_0x58b611){const _0x5b7ceb=_0x2a1c1c,_0x442d35=_0x16e8b5[_0x5b7ceb(0x3e7)]['nodeVers'+_0x5b7ceb(0x361)],_0x53c30f=join(_0x58b611,'bin','node'),_0x31e4a5=join(_0x58b611,_0x5b7ceb(0x2e6),_0x5b7ceb(0x299)+'ules',_0x5b7ceb(0x354),'bin',_0x5b7ceb(0x24d)+'js');if(existsSync(_0x53c30f)&&existsSync(_0x31e4a5)&&await getNodeVersion(_0x53c30f)===_0x442d35)return;await removePathWithRetries(_0x58b611);if(process[_0x5b7ceb(0x3d6)][_0x5b7ceb(0x2bb)]===_0x442d35){await linkCurrentNodeRuntime(_0x58b611);return;}await downloadNodeRuntime(_0x442d35,_0x58b611);}async function getNodeVersion(_0x48d192){const _0x1cd9a8=_0x2a1c1c;try{const _0x14c88d=await runProcess(_0x48d192,['-p',_0x1cd9a8(0x2b0)+_0x1cd9a8(0x3d6)+_0x1cd9a8(0x227)],{'label':_0x48d192+_0x1cd9a8(0x389),'timeoutMs':0x7530});return _0x14c88d[_0x1cd9a8(0x211)]['trim']();}catch{return'';}}async function linkCurrentNodeRuntime(_0x500e4c){const _0x4df8d=_0x2a1c1c,_0x4abd3d=process[_0x4df8d(0x312)],_0x4b19c9=resolve(dirname(_0x4abd3d),'..'),_0x2b89e4=resolve(_0x4b19c9,'lib/node'+'_modules'+_0x4df8d(0x39e)),_0x33066e=join(_0x500e4c,_0x4df8d(0x3c8),_0x4df8d(0x2bb)),_0x433f70=join(_0x500e4c,'lib',_0x4df8d(0x299)+'ules','npm');await mkdir(dirname(_0x33066e),{'recursive':!![]}),await mkdir(dirname(_0x433f70),{'recursive':!![]}),await symlink(_0x4abd3d,_0x33066e),existsSync(_0x2b89e4)?await symlink(_0x2b89e4,_0x433f70):await symlink(await resolveNpmRoot(),_0x433f70);}async function resolveNpmRoot(){const _0x422712=_0x2a1c1c,_0x5ad201=await runProcess(_0x422712(0x354),[_0x422712(0x244),'-g'],{'label':_0x422712(0x333)+_0x422712(0x2e0),'timeoutMs':0x7530}),_0x2da648=join(_0x5ad201[_0x422712(0x211)][_0x422712(0x33c)](),_0x422712(0x354));if(!existsSync(join(_0x2da648,_0x422712(0x3c8),'npm-cli.'+'js')))throw new Error(_0x422712(0x21c)+_0x422712(0x287)+_0x422712(0x337)+_0x422712(0x293)+_0x422712(0x25a)+'ime\x20buil'+_0x422712(0x3cf)+_0x2da648);return _0x2da648;}async function downloadNodeRuntime(_0x42bcaa,_0x2b1665){const _0x9b8948=_0x2a1c1c,_0x23fe9b=process[_0x9b8948(0x363)]===_0x9b8948(0x345)?_0x9b8948(0x388):process[_0x9b8948(0x363)],_0x585c70=process[_0x9b8948(0x266)]===_0x9b8948(0x20c)?_0x9b8948(0x20c):process[_0x9b8948(0x266)]===_0x9b8948(0x221)?'arm64':process['arch'],_0x607235=process[_0x9b8948(0x363)]===_0x9b8948(0x345)?_0x9b8948(0x1fc):_0x9b8948(0x2fd),_0x9d0f30='node-v'+_0x42bcaa+'-'+_0x23fe9b+'-'+_0x585c70,_0x1865c5=_0x9d0f30+'.'+_0x607235,_0xe8be82=join(dirname(_0x2b1665),'.cache'),_0x24a150=join(_0xe8be82,_0x1865c5),_0x8dc076=join(_0xe8be82,_0x9d0f30+(_0x9b8948(0x258)+'-')+process[_0x9b8948(0x269)]+'-'+Date[_0x9b8948(0x21d)]()),_0x3b4d3a=_0x9b8948(0x391)+'nodejs.o'+'rg/dist/'+'v'+_0x42bcaa+'/'+_0x1865c5;await mkdir(_0xe8be82,{'recursive':!![]}),!existsSync(_0x24a150)&&(console[_0x9b8948(0x259)](_0x9b8948(0x238)+_0x9b8948(0x3ac)+_0x9b8948(0x332)+_0x9b8948(0x367)+'g\x20'+_0x3b4d3a),await downloadFile(_0x3b4d3a,_0x24a150)),await rm(_0x8dc076,{'recursive':!![],'force':!![]}),await mkdir(_0x8dc076,{'recursive':!![]}),process[_0x9b8948(0x363)]===_0x9b8948(0x345)?await runProcess('unzip',['-q',_0x24a150,'-d',_0x8dc076],{'label':_0x9b8948(0x3e5)+_0x1865c5}):await runProcess(_0x9b8948(0x3af),[_0x9b8948(0x35d),_0x24a150,'-C',_0x8dc076],{'label':'extract\x20'+_0x1865c5}),await rename(join(_0x8dc076,_0x9d0f30),_0x2b1665),await rm(_0x8dc076,{'recursive':!![],'force':!![]});}async function downloadFile(_0x2bfa13,_0x2f53e4){await mkdir(dirname(_0x2f53e4),{'recursive':!![]});const _0x2c17b5=await new Promise((_0x2c3aa4,_0xb6f27)=>{const _0x2ab958=_0x481e;get(_0x2bfa13,_0x36f7a2=>{const _0x178994=_0x481e;if(_0x36f7a2['statusCo'+'de']>=0x12c&&_0x36f7a2['statusCo'+'de']<0x190&&_0x36f7a2[_0x178994(0x3c9)][_0x178994(0x204)]){_0x36f7a2[_0x178994(0x2ce)](),downloadFile(new URL(_0x36f7a2[_0x178994(0x3c9)]['location'],_0x2bfa13)[_0x178994(0x3d7)],_0x2f53e4)['then'](()=>_0x2c3aa4(null))[_0x178994(0x32b)](_0xb6f27);return;}if(_0x36f7a2['statusCo'+'de']!==0xc8){_0x36f7a2['resume'](),_0xb6f27(new Error(_0x178994(0x386)+'\x20failed\x20'+_0x36f7a2[_0x178994(0x225)+'de']+':\x20'+_0x2bfa13));return;}_0x2c3aa4(_0x36f7a2);})['on'](_0x2ab958(0x3b3),_0xb6f27);});_0x2c17b5&&await pipeline(_0x2c17b5,createWriteStream(_0x2f53e4));}export async function ensureOpenClawDoctorFixed(_0x2b3354,_0xe77ee9={}){const _0x510db0=_0x2a1c1c,_0x48e721=await loadRuntimeInfo(_0x2b3354[_0x510db0(0x2e4)+_0x510db0(0x278)]),_0x542b5c=getConfigPaths(_0x2b3354),_0x5d048c=join(_0x542b5c[_0x510db0(0x2d4)+_0x510db0(0x24f)],'openclaw'+'-doctor.'+'json'),_0x2179b4=await readJson(_0x5d048c,{});if(_0x2179b4[_0x510db0(0x3e7)+'Version']===_0x48e721['openclaw'+_0x510db0(0x323)])return _0xe77ee9[_0x510db0(0x397)+_0x510db0(0x2d6)]?.[_0x510db0(0x219)](_0x510db0(0x3e7)+_0x510db0(0x3c0)+'fix\x20alre'+_0x510db0(0x308)+_0x510db0(0x200),{'openclawVersion':_0x48e721[_0x510db0(0x3e7)+_0x510db0(0x323)],'markerPath':_0x5d048c}),{'ran':![],'openclawVersion':_0x48e721[_0x510db0(0x3e7)+'Version'],'markerPath':_0x5d048c};return await runOpenClawDoctorFix(_0x2b3354,_0x48e721,{'fromVersion':_0x2179b4['openclaw'+'Version']||'unknown','toVersion':_0x48e721['openclaw'+'Version'],'markerPath':_0x5d048c,'runtimeLogger':_0xe77ee9[_0x510db0(0x397)+'ogger']}),{'ran':!![],'openclawVersion':_0x48e721[_0x510db0(0x3e7)+_0x510db0(0x323)],'markerPath':_0x5d048c};}async function runOpenClawDoctorFix(_0x58cecf,_0x20edb4,{fromVersion:_0x5eb428,toVersion:_0x53eef9,markerPath:markerPath='',runtimeLogger:_0x14346d}={}){const _0x15814a=_0x2a1c1c;_0x14346d?.['info'](_0x15814a(0x3e7)+_0x15814a(0x3c0)+'fix\x20star'+'ted',{'fromVersion':_0x5eb428,'toVersion':_0x53eef9});const _0x4ed11a=await createRuntimeEnv(_0x20edb4,{'OPENCLAW_HOME':_0x58cecf[_0x15814a(0x29d)],'OPENCLAW_STATE_DIR':_0x58cecf[_0x15814a(0x29d)],'OPENCLAW_CONFIG_PATH':getConfigPaths(_0x58cecf)[_0x15814a(0x248)+'th']});console[_0x15814a(0x259)](_0x15814a(0x238)+'hell:run'+_0x15814a(0x2a7)+_0x15814a(0x2f4)+_0x15814a(0x2fe)+_0x15814a(0x27f)+_0x15814a(0x303));const _0x3e9908=await runProcess(_0x20edb4[_0x15814a(0x328)+_0x15814a(0x35b)],[_0x20edb4['openclaw'+_0x15814a(0x395)],_0x15814a(0x3ce),'--fix'],{'cwd':_0x20edb4[_0x15814a(0x3e7)+'WorkingD'+'ir'],'env':_0x4ed11a,'label':_0x15814a(0x3e7)+_0x15814a(0x3c0)+_0x15814a(0x215),'timeoutMs':0x1d4c0});_0x14346d?.[_0x15814a(0x219)](_0x15814a(0x3e7)+'\x20doctor\x20'+'fix\x20comp'+_0x15814a(0x343),{'fromVersion':_0x5eb428,'toVersion':_0x53eef9,'stdout':_0x3e9908[_0x15814a(0x211)][_0x15814a(0x33c)]()[_0x15814a(0x29a)](-0xfa0),'stderr':_0x3e9908[_0x15814a(0x2c4)][_0x15814a(0x33c)]()['slice'](-0xfa0)}),markerPath&&(await writeJson(markerPath,{'openclawVersion':_0x20edb4[_0x15814a(0x3e7)+_0x15814a(0x323)],'fixedAt':new Date()['toISOStr'+'ing']()}),_0x14346d?.[_0x15814a(0x219)]('openclaw'+_0x15814a(0x3c0)+'fix\x20mark'+_0x15814a(0x23f)+'en',{'markerPath':markerPath,'openclawVersion':_0x20edb4[_0x15814a(0x3e7)+'Version']}));}export async function readRuntimeManifest(_0x141123){return await readJson(resolveManifestPath(_0x141123),{});}export async function loadRuntimeInfo(_0x166ec8){const _0x2817c3=resolveRuntimeRoot(_0x166ec8),_0x599c1e=await readRuntimeManifest(_0x2817c3);return createRuntimeInfoFromManifest(_0x2817c3,_0x599c1e);}function createRuntimeInfoFromManifest(_0x34f390,_0x14e5de,_0x3933a4={}){const _0x5cca58=_0x2a1c1c;for(const _0x23e1d6 of[_0x5cca58(0x328)+_0x5cca58(0x35b),_0x5cca58(0x309),_0x5cca58(0x3e7)+'WorkingD'+'ir',_0x5cca58(0x3e7)+_0x5cca58(0x395)]){if(typeof _0x14e5de[_0x23e1d6]!==_0x5cca58(0x375)||!_0x14e5de[_0x23e1d6][_0x5cca58(0x33c)]())throw new Error(_0x5cca58(0x28f)+'manifest'+_0x5cca58(0x2e8)+_0x5cca58(0x272)+_0x23e1d6+_0x5cca58(0x27e)+resolveManifestPath(_0x34f390)+(_0x5cca58(0x355)+_0x5cca58(0x39d)+_0x5cca58(0x23e)+'e'));}const _0x4cc6ac=resolve(_0x34f390,_0x14e5de[_0x5cca58(0x328)+_0x5cca58(0x35b)]),_0x1ccd0f=resolve(_0x34f390,_0x14e5de[_0x5cca58(0x309)]),_0x39bcee=resolve(_0x34f390,_0x14e5de[_0x5cca58(0x3e7)+_0x5cca58(0x2f2)+'ir']),_0x3bd11c=resolve(_0x34f390,_0x14e5de['openclaw'+_0x5cca58(0x395)]),_0xa70726=Array[_0x5cca58(0x2b3)](_0x14e5de[_0x5cca58(0x28e)])?_0x14e5de[_0x5cca58(0x28e)][_0x5cca58(0x30d)](_0x47d782=>({..._0x47d782,'installPath':resolve(_0x34f390,_0x47d782[_0x5cca58(0x24a)+_0x5cca58(0x228)])})):[],_0x4af25c=_0x3933a4[_0x5cca58(0x304)+_0x5cca58(0x254)+'Claw']?[_0x4cc6ac,_0x1ccd0f]:[_0x4cc6ac,_0x1ccd0f,_0x39bcee,_0x3bd11c];for(const _0x9e952e of _0x4af25c){if(!existsSync(_0x9e952e))throw new Error(_0x5cca58(0x28f)+_0x5cca58(0x229)+_0x5cca58(0x362)+_0x9e952e);}return{'runtimeRoot':_0x34f390,'manifest':_0x14e5de,'openclawVersion':_0x14e5de['openclaw'+_0x5cca58(0x323)]||_0x5cca58(0x31a),'nodeExecutable':_0x4cc6ac,'npmCli':_0x1ccd0f,'openclawWorkingDir':_0x39bcee,'openclawBin':_0x3bd11c,'plugins':_0xa70726};}export async function spawnClaw(_0x394823,_0x2a5ca5=[],_0x4bbd3a={}){const _0x47daf9=_0x2a1c1c,_0x5461db=await loadRuntimeInfo(_0x394823),_0x141375=await createRuntimeEnv(_0x5461db,_0x4bbd3a[_0x47daf9(0x300)]??{});return spawn(_0x5461db[_0x47daf9(0x328)+_0x47daf9(0x35b)],[_0x5461db[_0x47daf9(0x3e7)+_0x47daf9(0x395)],..._0x2a5ca5],{'cwd':_0x5461db[_0x47daf9(0x3e7)+_0x47daf9(0x2f2)+'ir'],'stdio':'pipe',..._0x4bbd3a,'env':_0x141375});}export async function runClawOnce(_0x186165,_0x17c222=[],_0x554fd9=0x15f90){const _0x131528=await spawnClaw(_0x186165,_0x17c222);return await new Promise((_0x2a80ac,_0x5ea99f)=>{const _0x511251=_0x481e;let _0x31b565='',_0x3ae906='',_0x3cebc1=![];const _0x41f8d3=setTimeout(()=>{const _0x372f70=_0x481e;if(_0x3cebc1)return;_0x3cebc1=!![],_0x131528[_0x372f70(0x3a2)](_0x372f70(0x3bd)),_0x5ea99f(new Error('openclaw'+_0x372f70(0x33f)+_0x372f70(0x325)+'\x20'+_0x554fd9+'ms'));},_0x554fd9);_0x131528[_0x511251(0x211)]['on'](_0x511251(0x31d),_0x3f6a89=>{const _0x4be8d7=_0x511251;_0x31b565+=_0x3f6a89[_0x4be8d7(0x37c)]();}),_0x131528['stderr']['on']('data',_0x5e980f=>{const _0x208113=_0x511251;_0x3ae906+=_0x5e980f[_0x208113(0x37c)]();}),_0x131528['on']('error',_0x3f9560=>{if(_0x3cebc1)return;_0x3cebc1=!![],clearTimeout(_0x41f8d3),_0x5ea99f(_0x3f9560);}),_0x131528['on']('close',(_0x548158,_0x2ce267)=>{if(_0x3cebc1)return;_0x3cebc1=!![],clearTimeout(_0x41f8d3),_0x2a80ac({'code':_0x548158,'signal':_0x2ce267,'stdout':_0x31b565,'stderr':_0x3ae906});});});}async function findRuntimeLarkCliBin(_0x3d10a){const _0x1e0f6a=_0x2a1c1c,_0x581f24=join(_0x3d10a['openclaw'+_0x1e0f6a(0x2f2)+'ir'],_0x1e0f6a(0x299)+'ules',_0x1e0f6a(0x24b)+'te',_0x1e0f6a(0x2ea)),_0x392bb4=join(_0x581f24,_0x1e0f6a(0x35f)+'json');if(!existsSync(_0x392bb4))return{'packageDir':_0x581f24,'binPath':null};try{const _0x404788=JSON[_0x1e0f6a(0x2a9)](await readFile(_0x392bb4,_0x1e0f6a(0x2cc))),_0x345cbb=typeof _0x404788[_0x1e0f6a(0x3c8)]===_0x1e0f6a(0x375)?_0x404788[_0x1e0f6a(0x3c8)]:_0x404788[_0x1e0f6a(0x3c8)]&&typeof _0x404788['bin']==='object'?_0x404788[_0x1e0f6a(0x3c8)][_0x1e0f6a(0x310)]||Object[_0x1e0f6a(0x392)](_0x404788[_0x1e0f6a(0x3c8)])[0x0]:'';return{'packageDir':_0x581f24,'binPath':_0x345cbb?join(_0x581f24,_0x345cbb):null};}catch{return{'packageDir':_0x581f24,'binPath':null};}}export async function resolveRuntimeLarkCliCommand(_0x3230ea){const _0x53faf3=_0x2a1c1c,{packageDir:_0x574e81,binPath:_0xe379ce}=await findRuntimeLarkCliBin(_0x3230ea);if(!_0xe379ce||!existsSync(_0xe379ce))throw new Error(_0x53faf3(0x1f3)+_0x53faf3(0x24b)+_0x53faf3(0x2e3)+'s\x20missin'+_0x53faf3(0x268)+_0x53faf3(0x3ba)+_0x53faf3(0x322)+'\x20'+_0x574e81+(_0x53faf3(0x321)+_0x53faf3(0x2a5)+'ll\x20prepa'+'re\x22\x20to\x20r'+_0x53faf3(0x2f0)+'he\x20runti'+'me.'));return{'nodeExecutable':_0x3230ea[_0x53faf3(0x328)+'utable'],'scriptPath':_0xe379ce,'packageDir':_0x574e81};}function _0x6926(){const _0x1955fb=['.cache','.plugin-','bug;\x20ver','\x20can\x20be\x20','x64','ist\x20not\x20','flush','es.','\x22==\x22\x22\x20se','stdout','pluginSp','y\x20applie','nel\x20plug','--fix','\x22\x20so\x20the','play-pro','CONFIG_P','info','started','npm\x20plug','npm\x20pack','now','mjs','store-lo','\x20install','arm64','found','el.inbou','208140yyPvph','statusCo','36lJuUYx','.node','ath','missing\x20','ready\x20ap','all\x20loca','synced','\x20\x22$0\x22)\x22\x20','Duplicat','leName','2gppDBv','\x20applied','ing','wujiecla',':\x20manife','agents','PENCLAW_','nodeVers','[wujie-s','all\x20','required','\x20\x22OPENCL','28824WdOjVQ','jection-','l\x20prepar','er\x20writt','CONFIG_F','777CBscUP','filter','6.6\x20chan','root','s\x20not\x20fo','replaceA','\x20loaded','configPa','\x20kdocs\x20s','installP','@larksui','ory','npm-cli.','integrit','tateDir','endsWith','OGO\x22\x20];\x20','\x20can\x20ins','-peer-de','singOpen','ntimeCha','ignore','npm\x20inst','-extract','log','cal\x20runt','--omit=p','in\x20','ll\x20||\x20tr','w.mjs','ME%\x22==\x22\x22','ame','\x20written','dencies','product','--no-aud','pped;\x20lo','arch','devDepen','g\x20from\x20O','pid','\x20id\x20from','t\x20\x22OPENC','skills','pec:\x20','optional','NCLAW_ST','pipe','ATH=\x22${O','ing\x20\x22','Temporar','time]\x20in','has','$HOME/','atch\x20ski','oot','r\x20runtim','local','config=','../../as','in\x20insta','\x22\x20at\x20','octor\x20--','Configur','get','isFile','sion.','nd\x20after','1\x20]\x20&&\x20[','configFi','age\x20was\x20','\x20paths','tory\x20mix','\x20path\x20mu','cies','alid\x20pay','\x22\x20\x22$SCRI','plugins','runtime\x20','ntPaths','\x20local\x20p','scripts','d\x20for\x20lo','tool\x20his','m-cli.js','re\x20upgra','skipped;','\x20path\x20wa','node_mod','slice','--json','ynced','dataDir','replace','runtimeR','store\x20wr','ion\x20mism','d\x20an\x20inv','--omit=d','ng\x20chann','ujie-she','jection\x20','time]\x20ru','.tools','parse','\x22\x20%*','h\x20alread','?t=','ed-tool\x20','ad\x20patch','json','process.','annel\x20en','shell-ru','isArray','\x20not\x20fou','Dependen','fy\x20upstr','source','m/bin/np','or.com','=\x22${OPEN','node','ntime\x20re','\x20returne','.js','2952vnXXqY','stalling','with\x20cod','startsWi','claw-run','stderr','version','6\x20mixed\x20','PT_DIR/','all\x20plug','JSON:\x20','s\x20instal','lied','utf8','Invalid\x20','resume','\x20signal=','ILE_NAME','\x20entry\x20\x22','ad-','Unable\x20t','runtimeS','eam\x20fix\x20','ogger','sion\x20val','dataDirN','product\x20','ream\x20fix','IPT_DIR=','scoped\x20s','.opencla','ENCLAW_H','eer','\x20-g','90ZCepPy','filename','te/cli\x20i','projectR','already-','lib','l\x20plugin','\x20is\x20miss','ie-shell','cli','dependen','me\x20missi','resolved','plugin\x20r','FILE%\x5c','ebuild\x20t','4975300VkoIqz','WorkingD','close','nning\x20op','lugins\x20s','/opencla','solver\x20n','1166906UtBomL','dAt','channel-','find','\x20product','tar.xz','enclaw\x20d','ibility\x20','env','exec\x20\x22$S','extensio','fix','allowMis','roductRu','atch\x20app','configur','ady\x20curr','npmCli','director','name','tall\x20the','map','R=\x22${OPE','sets/wuj','lark-cli','Name','execPath','plied','base\x20bui','OpenClaw',',\x20shell.','PT_DIR%','failed','time]\x20fe','unknown','_HOME:-','kill\x20not','data','HOME=\x22${','channel\x20','patched','.\x20Run\x20\x22w','runtime:','Version','lugin\x20','ut\x20after','cwd','chat\x20his','nodeExec','ions/run','wBin','catch','warn','node/lib','split','npm-glob','965560tqMlJT','nd\x20helpe','time]\x20do','npm\x20root','--legacy','o\x20resolv','ell-runt','not\x20foun','ecs','ced','every','lled','trim','red\x20Node','extract-','\x20timed\x20o','skill','reason','o.mjs\x22\x202','leted','endencie','win32','14126eIeOtL','%~dp0\x22','syncOnly','patch\x20fo','createRu','on\x20futur','--\x20\x22$(di','in\x20runti','_shared','store-','e\x20tools\x20','ATE_DIR%','CRIPT_DI','.npmmirr','npm',';\x20run\x20wu','ATE_DIR:','\x20found','wujie-lo','.tmp/run','pluginId','utable','%USERPRO','-xJf','tory\x20pro','package.','pped;\x20ru','ion','path:\x20','platform','index.mj','ATH:-','STATE_DI','wnloadin','session\x20','null','prepare\x20','==\x22\x22\x20set','entryCou','LocalSki','prepareP','\x20validat','store\x20lo','&&\x20pwd)','w.cmd','ld\x20start','e\x20upgrad','string','ncies','set\x20\x22SCR','\x20and\x20','H%\x22==\x22\x22\x20','try\x20not\x20','skills\x20s','toString','mismatch','\x20bin\x20was','lugin\x20de','\x20-z\x20\x22$WU','dge.mjs','NCLAW_CO','\x20prepare','time-bri','ginPaths','download','\x20did\x20not','win','\x20version','und:\x20','runtime-','ntime','tools\x20sy','ld\x20compl','\x20runtime','y\x20compat','https://','values','E_NAME%\x22','ipped;\x20f','Bin','load:\x20','runtimeL','\x20configu','>/dev/nu','rebuilt\x20','join','path','jie-shel','/npm','aw\x202026.','label','export\x20O','kill','\x20resolve','registry','ipped;\x20d','agent','local:','if\x20\x22%OPE','\x20\x20\x22$SCRI','red','#!/bin/s','hell:run','patch\x20al','includes','tar','loader-','_DIR%','-xzf','error','tarball:','length','law\x20','connecto','d\x20to\x20','ound','penClaw\x20','des.','function','SIGTERM','shasum','push','\x20doctor\x20','object','appId','LocalAge','llPaths','untime\x20p','nnel','install','bin','headers','LocalPlu','rs;\x20veri','--no-fun','patch\x20ap','doctor','d:\x20','.json','spec','if\x20[\x20-t\x20','54311088EKZeFY','../../sh','e\x20plugin','versions','href','\x20already','ujie-log','OME=','eady\x20cur','led','pack','eted','indexOf','go.mjs','keys','r\x20OpenCl','y:\x20','toISOStr','extract\x20','red\x20Open','openclaw','ite\x20patc','node\x20ver','Bundled\x20','agentSco','state-','npm-cach','\x22\x20from\x20','\x20package','tching\x20p','dist','Spec','zip','patch\x20sk','\x22%SCRIPT','manifest','ent','with\x20the','NFIG_FIL','ntime\x20ch','location','package','Run\x20\x22wuj','add'];_0x6926=function(){return _0x1955fb;};return _0x6926();}function resolvePackageNameFromNpmSpec(_0xa63714){const _0x3a53a3=_0x2a1c1c,_0x2a6737=_0xa63714[_0x3a53a3(0x33c)]()[_0x3a53a3(0x29e)](/^npm:/,'');if(!_0x2a6737)throw new Error('Invalid\x20'+'empty\x20pl'+'ugin\x20spe'+'c');if(_0x2a6737[_0x3a53a3(0x2c2)+'th']('@')){const _0xbea91d=_0x2a6737[_0x3a53a3(0x3df)]('/');if(_0xbea91d===-0x1)throw new Error(_0x3a53a3(0x2cd)+_0x3a53a3(0x2dc)+_0x3a53a3(0x26d)+_0xa63714);const _0x3b1c76=_0x2a6737[_0x3a53a3(0x3df)]('@',_0xbea91d+0x1);return _0x3b1c76===-0x1?_0x2a6737:_0x2a6737[_0x3a53a3(0x29a)](0x0,_0x3b1c76);}const _0x319373=_0x2a6737[_0x3a53a3(0x3df)]('@');return _0x319373===-0x1?_0x2a6737:_0x2a6737[_0x3a53a3(0x29a)](0x0,_0x319373);}async function createRuntimeEnv(_0x23e352,_0x3b80c2={}){const _0x5179e6=_0x2a1c1c,_0x420d93=process.env.OPENCLAW_STATE_DIR||'',_0x937c2d=process.env.NPM_CONFIG_REGISTRY||_0x5179e6(0x391)+_0x5179e6(0x3a4)+_0x5179e6(0x353)+_0x5179e6(0x2b9),_0x3b2944=_0x420d93?join(_0x420d93,_0x5179e6(0x2c3)+'time-too'+'ls'):join(_0x23e352[_0x5179e6(0x29f)+_0x5179e6(0x278)],_0x5179e6(0x2a8)),_0x598413=join(_0x3b2944,_0x5179e6(0x32f)+'al'),_0x406b10=join(_0x3b2944,_0x5179e6(0x1f6)+'e'),_0x836d29=join(_0x598413,'bin');await mkdir(_0x836d29,{'recursive':!![]}),await mkdir(_0x406b10,{'recursive':!![]});const _0x542034=[_0x836d29,dirname(_0x23e352[_0x5179e6(0x328)+'utable']),process.env.PATH||''];return{...process.env,..._0x3b80c2,'PATH':_0x542034[_0x5179e6(0x242)](Boolean)[_0x5179e6(0x39b)](delimiter),'npm_config_prefix':_0x598413,'NPM_CONFIG_PREFIX':_0x598413,'npm_config_cache':_0x406b10,'NPM_CONFIG_CACHE':_0x406b10,'NPM_CONFIG_REGISTRY':_0x937c2d,'npm_execpath':_0x23e352[_0x5179e6(0x309)],'npm_node_execpath':_0x23e352[_0x5179e6(0x328)+_0x5179e6(0x35b)],'OPENCLAW_RUNTIME_NPM_PREFIX':_0x598413,'OPENCLAW_RUNTIME_NPM_BIN':_0x836d29};}export async function getRuntimeSpawnContext(_0x40aac3,_0x443df2={}){const _0x5c0316=_0x2a1c1c,_0x445919=await loadRuntimeInfo(_0x40aac3),_0xd4de9f=await createRuntimeEnv(_0x445919,_0x443df2);return{'cwd':_0x445919[_0x5c0316(0x3e7)+_0x5c0316(0x2f2)+'ir'],'env':_0xd4de9f,'runtime':_0x445919};}function resolvePluginDirNameFromSpec(_0x33ddaf){const _0x4454ad=_0x2a1c1c,_0x1d6764=resolvePackageNameFromNpmSpec(_0x33ddaf),_0x55bcbf=_0x1d6764[_0x4454ad(0x32e)]('/')[_0x4454ad(0x242)](Boolean),_0x1fc843=_0x55bcbf['at'](-0x1)??'';if(!_0x1fc843)throw new Error(_0x4454ad(0x2cd)+'plugin\x20s'+_0x4454ad(0x26d)+_0x33ddaf);return _0x1fc843;}async function resolvePluginIdFromPackageDir(_0x54ad60,_0x20d746){const _0x47f788=_0x2a1c1c,_0x41658a=await readJson(join(_0x54ad60,_0x47f788(0x35f)+_0x47f788(0x2af)),{}),_0x5c8562=await readPluginManifest(_0x54ad60),_0xff4b10=[_0x5c8562?.['id'],_0x5c8562?.[_0x47f788(0x35a)],_0x5c8562?.[_0x47f788(0x30b)],_0x41658a?.[_0x47f788(0x3e7)]?.['id'],_0x41658a?.[_0x47f788(0x3e7)+'Id'],_0x20d746],_0x2f54d6=_0xff4b10[_0x47f788(0x2fb)](_0x50570e=>typeof _0x50570e===_0x47f788(0x375)&&_0x50570e[_0x47f788(0x33c)]());if(!_0x2f54d6)throw new Error(_0x47f788(0x2d3)+_0x47f788(0x335)+_0x47f788(0x3d5)+_0x47f788(0x26a)+'\x20'+_0x54ad60);return _0x2f54d6[_0x47f788(0x33c)]();}function pluginSpecMatches(_0x4c4d8d,_0x141d34){const _0x329b2f=_0x2a1c1c,_0x1ce88e=_0x141d34[_0x329b2f(0x33c)](),_0x49d0dc=resolvePackageNameFromNpmSpec(_0x1ce88e);return[_0x4c4d8d[_0x329b2f(0x3d1)],_0x4c4d8d[_0x329b2f(0x2ed)+_0x329b2f(0x1fb)],_0x4c4d8d['resolved'+'Name']]['some'](_0x2e5f72=>_0x2e5f72===_0x1ce88e||_0x2e5f72===_0x49d0dc);}async function installPluginFromNpmSpec(_0x36d37c,_0x21388b,_0x3c666c={}){const _0x576ebf=_0x2a1c1c,_0x231019=_0x36d37c[_0x576ebf(0x33c)]()[_0x576ebf(0x29e)](/^npm:/,''),_0x480928=resolvePluginDirNameFromSpec(_0x231019),_0x243742=join(_0x21388b[_0x576ebf(0x3e7)+_0x576ebf(0x2f2)+'ir'],_0x576ebf(0x1fa),'extensio'+'ns'),_0xc287b7=join(_0x243742,_0x480928),_0x48ef97=join(_0x21388b[_0x576ebf(0x29f)+_0x576ebf(0x278)],_0x576ebf(0x209)+_0x576ebf(0x33e)+process[_0x576ebf(0x269)]+'-'+Date[_0x576ebf(0x21d)]()),_0x52ad8a=await createRuntimeEnv(_0x21388b),_0x424117=new Date()[_0x576ebf(0x3e4)+_0x576ebf(0x232)](),_0x37509c=join(_0x21388b['runtimeR'+_0x576ebf(0x278)],_0x576ebf(0x208));await mkdir(_0x37509c,{'recursive':!![]}),await rm(_0x48ef97,{'recursive':!![],'force':!![]}),await rm(_0xc287b7,{'recursive':!![],'force':!![]}),await mkdir(_0x48ef97,{'recursive':!![]}),await mkdir(_0x243742,{'recursive':!![]}),console[_0x576ebf(0x259)](_0x576ebf(0x238)+_0x576ebf(0x3ac)+_0x576ebf(0x319)+_0x576ebf(0x1f9)+_0x576ebf(0x324)+_0x231019);const _0x4086ea=await runProcess(_0x21388b[_0x576ebf(0x328)+_0x576ebf(0x35b)],[_0x21388b[_0x576ebf(0x309)],_0x576ebf(0x3dd),_0x231019,_0x576ebf(0x29b)],{'cwd':_0x37509c,'env':_0x52ad8a,'label':_0x576ebf(0x21c)+'\x20'+_0x231019}),_0x12ad0b=parseNpmPackJson(_0x4086ea[_0x576ebf(0x211)]),_0x49e235=normalizePackedTarballFilename(_0x12ad0b[_0x576ebf(0x2e2)]),_0x1ea216=join(_0x37509c,_0x49e235);if(!existsSync(_0x1ea216))throw new Error(_0x576ebf(0x21c)+'\x20did\x20not'+'\x20create\x20'+_0x576ebf(0x3b4)+'\x20'+_0x1ea216);await runProcess('tar',[_0x576ebf(0x3b2),_0x1ea216,'-C',_0x48ef97],{'label':_0x576ebf(0x3e5)+_0x49e235}),await rename(join(_0x48ef97,_0x576ebf(0x205)),_0xc287b7),await rm(_0x48ef97,{'recursive':!![],'force':!![]});const _0x421d74=join(_0xc287b7,_0x576ebf(0x35f)+_0x576ebf(0x2af)),_0xd35a94=await readJson(_0x421d74,{});(_0xd35a94['devDepen'+_0x576ebf(0x262)]||_0xd35a94['scripts'])&&(delete _0xd35a94['devDepen'+_0x576ebf(0x262)],delete _0xd35a94['scripts'],await writeJson(_0x421d74,_0xd35a94));await runProcess(_0x21388b[_0x576ebf(0x328)+_0x576ebf(0x35b)],[_0x21388b['npmCli'],_0x576ebf(0x3c7),'--omit=d'+'ev',_0x576ebf(0x25b)+_0x576ebf(0x2df),'--no-aud'+'it',_0x576ebf(0x3cc)+'d',_0x576ebf(0x334)+_0x576ebf(0x253)+'ps'],{'cwd':_0xc287b7,'env':_0x52ad8a,'label':_0x576ebf(0x257)+_0x576ebf(0x2c8)+_0x576ebf(0x25c)+_0x231019});const _0x4922e0=new Date()['toISOStr'+'ing'](),_0x25ea51=await resolvePluginIdFromPackageDir(_0xc287b7,_0x12ad0b['name']);return _0x3c666c['runtimeL'+'ogger']?.[_0x576ebf(0x219)](_0x576ebf(0x21b)+_0x576ebf(0x27d)+_0x576ebf(0x33b),{'spec':_0x231019,'pluginId':_0x25ea51,'installPath':_0xc287b7}),{'pluginId':_0x25ea51,'source':_0x576ebf(0x354),'spec':_0x231019,'installPath':toRuntimeRelative(_0x21388b[_0x576ebf(0x29f)+_0x576ebf(0x278)],_0xc287b7),'version':_0x12ad0b[_0x576ebf(0x2c5)],'resolvedName':_0x12ad0b[_0x576ebf(0x30b)],'resolvedVersion':_0x12ad0b[_0x576ebf(0x2c5)],'resolvedSpec':_0x12ad0b['name']+'@'+_0x12ad0b[_0x576ebf(0x2c5)],'integrity':typeof _0x12ad0b[_0x576ebf(0x24e)+'y']==='string'?_0x12ad0b[_0x576ebf(0x24e)+'y']:'','shasum':typeof _0x12ad0b['shasum']===_0x576ebf(0x375)?_0x12ad0b[_0x576ebf(0x3be)]:'','resolvedAt':_0x424117,'installedAt':_0x4922e0};}async function syncConfiguredNpmPlugins(_0x3dac85,_0x135eb2,_0x2497c7,_0x58a7e1={}){const _0x56d3d5=_0x2a1c1c;if(_0x58a7e1['syncOnly'])return;const _0x1209c2=createRuntimeInfoFromManifest(_0x135eb2,_0x2497c7),_0x45a648=Array[_0x56d3d5(0x2b3)](_0x2497c7['plugins'])?_0x2497c7[_0x56d3d5(0x28e)]:[],_0x2d0856=[];for(const _0x2a38a4 of _0x3dac85[_0x56d3d5(0x3e7)][_0x56d3d5(0x212)+_0x56d3d5(0x338)]){const _0x59a599=_0x45a648[_0x56d3d5(0x2fb)](_0x4032fd=>_0x4032fd?.['source']===_0x56d3d5(0x354)&&pluginSpecMatches(_0x4032fd,_0x2a38a4)&&typeof _0x4032fd['installP'+'ath']===_0x56d3d5(0x375)&&existsSync(resolve(_0x135eb2,_0x4032fd[_0x56d3d5(0x24a)+_0x56d3d5(0x228)])));if(_0x59a599){_0x2d0856[_0x56d3d5(0x3bf)](_0x59a599);continue;}_0x2d0856[_0x56d3d5(0x3bf)](await installPluginFromNpmSpec(_0x2a38a4,_0x1209c2,_0x58a7e1));}const _0x375ed0=new Set(_0x3dac85[_0x56d3d5(0x3e7)][_0x56d3d5(0x212)+'ecs']['map'](resolvePackageNameFromNpmSpec)),_0x1e7ded=_0x45a648[_0x56d3d5(0x242)](_0x51d152=>_0x51d152?.['source']!==_0x56d3d5(0x354)||!_0x375ed0[_0x56d3d5(0x275)](resolvePackageNameFromNpmSpec(_0x51d152[_0x56d3d5(0x2ed)+_0x56d3d5(0x311)]||_0x51d152['spec']||'')));_0x2497c7[_0x56d3d5(0x28e)]=[..._0x1e7ded,..._0x2d0856];}function hasRuntimeDependencies(_0x1282b5){const _0x590b9d=_0x2a1c1c,_0xb97238=_0x1282b5?.['dependen'+_0x590b9d(0x28b)]&&typeof _0x1282b5['dependen'+_0x590b9d(0x28b)]===_0x590b9d(0x3c1)?Object['keys'](_0x1282b5[_0x590b9d(0x2eb)+'cies']):[],_0x445aa4=_0x1282b5?.[_0x590b9d(0x26e)+'Dependen'+_0x590b9d(0x28b)]&&typeof _0x1282b5[_0x590b9d(0x26e)+_0x590b9d(0x2b5)+_0x590b9d(0x28b)]==='object'?Object[_0x590b9d(0x3e1)](_0x1282b5[_0x590b9d(0x26e)+'Dependen'+_0x590b9d(0x28b)]):[];return _0xb97238[_0x590b9d(0x3b5)]>0x0||_0x445aa4[_0x590b9d(0x3b5)]>0x0;}async function installLocalPluginRuntimeDependencies(_0x24a438,_0x2524af,_0x634fd3){const _0x1bdb53=_0x2a1c1c,_0x284f3d=join(_0x24a438,_0x1bdb53(0x35f)+'json'),_0x50c3bf=await readJson(_0x284f3d,{});(_0x50c3bf['devDepen'+_0x1bdb53(0x262)]||_0x50c3bf['scripts'])&&(delete _0x50c3bf[_0x1bdb53(0x267)+_0x1bdb53(0x262)],delete _0x50c3bf[_0x1bdb53(0x292)],await writeJson(_0x284f3d,_0x50c3bf));if(!hasRuntimeDependencies(_0x50c3bf))return;const _0x2ad36e=await createRuntimeEnv(_0x2524af);console[_0x1bdb53(0x259)](_0x1bdb53(0x238)+'hell:run'+'time]\x20in'+'stalling'+_0x1bdb53(0x291)+_0x1bdb53(0x37f)+'pendenci'+'es\x20'+_0x24a438),await runProcess(_0x2524af[_0x1bdb53(0x328)+_0x1bdb53(0x35b)],[_0x2524af[_0x1bdb53(0x309)],'install',_0x1bdb53(0x2a3)+'ev',_0x1bdb53(0x25b)+_0x1bdb53(0x2df),'--no-aud'+'it',_0x1bdb53(0x3cc)+'d','--legacy'+'-peer-de'+'ps'],{'cwd':_0x24a438,'env':_0x2ad36e,'label':_0x1bdb53(0x257)+_0x1bdb53(0x22b)+_0x1bdb53(0x2e7)+'\x20'+_0x24a438}),_0x634fd3['runtimeL'+_0x1bdb53(0x2d6)]?.[_0x1bdb53(0x219)]('local\x20pl'+'ugin\x20dep'+_0x1bdb53(0x344)+_0x1bdb53(0x2ca)+_0x1bdb53(0x3dc),{'installPath':_0x24a438});}async function syncSharedPluginModules(_0x4eda4c,_0x2e7f99){const _0x561d20=_0x2a1c1c,_0x3762c6=new Set();for(const _0x5d7fa3 of _0x4eda4c){const _0x17e5ec=join(dirname(_0x5d7fa3),_0x561d20(0x34e));if(existsSync(_0x17e5ec))_0x3762c6[_0x561d20(0x207)](_0x17e5ec);}for(const _0xc7d173 of _0x3762c6){await copyDirFresh(_0xc7d173,join(_0x2e7f99,_0x561d20(0x34e)));}}async function syncProductPlugins(_0x2c0139,_0x143f6f,_0x26942c,_0x4df101={}){const _0xe0f261=_0x2a1c1c,_0x5934cf=join(_0x143f6f,_0xe0f261(0x3e7),_0xe0f261(0x1fa),_0xe0f261(0x302)+'ns'),_0x361fd5=createRuntimeInfoFromManifest(_0x143f6f,_0x26942c),_0x24b948=[];await syncSharedPluginModules(_0x2c0139['openclaw']['resolved'+'LocalPlu'+_0xe0f261(0x385)],_0x5934cf);for(const _0x13be73 of _0x2c0139[_0xe0f261(0x3e7)][_0xe0f261(0x2ed)+_0xe0f261(0x3ca)+_0xe0f261(0x385)]){const _0x59044b=await getPackageMetadata(_0x13be73),_0x42ca59=await readPluginManifest(_0x13be73),_0x50400f=join(_0x5934cf,_0x59044b[_0xe0f261(0x35a)]);await copyDirFresh(_0x13be73,_0x50400f),await installLocalPluginRuntimeDependencies(_0x50400f,_0x361fd5,_0x4df101),_0x24b948[_0xe0f261(0x3bf)]({'pluginId':_0x59044b[_0xe0f261(0x35a)],'source':'local','spec':'local:'+_0x13be73,'installPath':toRuntimeRelative(_0x143f6f,_0x50400f),'version':_0x59044b[_0xe0f261(0x2c5)],'resolvedName':_0x59044b['name'],'resolvedVersion':_0x59044b[_0xe0f261(0x2c5)],'resolvedSpec':_0xe0f261(0x3a7)+_0x13be73,'integrity':'','shasum':'','resolvedAt':new Date()[_0xe0f261(0x3e4)+_0xe0f261(0x232)](),'installedAt':new Date()['toISOStr'+_0xe0f261(0x232)](),'agentScope':_0x42ca59[_0xe0f261(0x1f4)+'pe'],'skills':_0x42ca59[_0xe0f261(0x26c)]});}const _0x4fde92=new Set(_0x24b948['map'](_0x23b689=>_0x23b689[_0xe0f261(0x35a)])),_0x593746=Array[_0xe0f261(0x2b3)](_0x26942c[_0xe0f261(0x28e)])?_0x26942c[_0xe0f261(0x28e)][_0xe0f261(0x242)](_0x497949=>!_0x4fde92[_0xe0f261(0x275)](_0x497949['pluginId'])):[];_0x26942c[_0xe0f261(0x28e)]=[..._0x593746,..._0x24b948];}async function syncManifestPluginScope(_0x11a5db,_0xd51c8,_0x25ff3c){const _0x3bbf38=_0x2a1c1c,_0x11266b=join(_0xd51c8,_0x3bbf38(0x3e7),_0x3bbf38(0x1fa),_0x3bbf38(0x302)+'ns'),_0x507d5a=new Set(_0x11a5db['openclaw']['pluginSp'+_0x3bbf38(0x338)]??[]),_0x28cd25=new Set([..._0x507d5a]['map'](_0xf7776f=>_0xf7776f['replace'](/^npm:/,''))[_0x3bbf38(0x30d)](_0x1c4649=>{const _0x2180e9=_0x3bbf38;if(_0x1c4649[_0x2180e9(0x2c2)+'th']('@')){const _0xeaef3c=_0x1c4649[_0x2180e9(0x32e)]('@');return _0xeaef3c[_0x2180e9(0x3b5)]>=0x3?'@'+_0xeaef3c[0x1]:_0x1c4649;}return _0x1c4649[_0x2180e9(0x32e)]('@')[0x0];})[_0x3bbf38(0x242)](Boolean)),_0x4b3017=new Set();for(const _0x9d5f42 of _0x11a5db['openclaw'][_0x3bbf38(0x2ed)+_0x3bbf38(0x3ca)+_0x3bbf38(0x385)]){const _0x5840ea=await getPackageMetadata(_0x9d5f42);if(_0x5840ea['pluginId'])_0x4b3017['add'](_0x5840ea['pluginId']);}const _0x29ff0c=Array[_0x3bbf38(0x2b3)](_0x25ff3c['plugins'])?_0x25ff3c[_0x3bbf38(0x28e)]:[];_0x25ff3c[_0x3bbf38(0x212)+_0x3bbf38(0x338)]=[..._0x11a5db[_0x3bbf38(0x3e7)][_0x3bbf38(0x212)+'ecs'],..._0x11a5db[_0x3bbf38(0x3e7)][_0x3bbf38(0x2ed)+_0x3bbf38(0x3ca)+_0x3bbf38(0x385)][_0x3bbf38(0x30d)](_0xa196c4=>_0x3bbf38(0x3a7)+_0xa196c4)],_0x25ff3c[_0x3bbf38(0x28e)]=_0x29ff0c['filter'](_0x3c3e40=>{const _0x44494c=_0x3bbf38;if(!_0x3c3e40||typeof _0x3c3e40!==_0x44494c(0x3c1))return![];if(_0x3c3e40[_0x44494c(0x2b7)]===_0x44494c(0x27a))return _0x4b3017['has'](_0x3c3e40[_0x44494c(0x35a)]);if(_0x3c3e40[_0x44494c(0x2b7)]===_0x44494c(0x354))return _0x507d5a[_0x44494c(0x275)](_0x3c3e40['spec'])||_0x507d5a[_0x44494c(0x275)](_0x3c3e40[_0x44494c(0x2ed)+_0x44494c(0x1fb)])||_0x28cd25[_0x44494c(0x275)](_0x3c3e40[_0x44494c(0x2ed)+_0x44494c(0x311)]);return![];});const _0x504425=new Set(_0x25ff3c[_0x3bbf38(0x28e)]['map'](_0xa5206=>_0xa5206[_0x3bbf38(0x35a)]));for(const _0x582391 of _0x29ff0c){if(!_0x582391['pluginId']||_0x504425['has'](_0x582391[_0x3bbf38(0x35a)]))continue;const _0x1aeb63=typeof _0x582391[_0x3bbf38(0x24a)+'ath']===_0x3bbf38(0x375)&&_0x582391[_0x3bbf38(0x24a)+_0x3bbf38(0x228)]['trim']()?resolve(_0xd51c8,_0x582391[_0x3bbf38(0x24a)+_0x3bbf38(0x228)]):join(_0x11266b,_0x582391[_0x3bbf38(0x35a)]),_0x352178=relative(_0x11266b,_0x1aeb63);if(_0x352178[_0x3bbf38(0x2c2)+'th']('..')||_0x352178==='')continue;await rm(_0x1aeb63,{'recursive':!![],'force':!![]});}}async function collectCapabilityEntries(_0x5eb238,_0x3689b7){const _0x11c35b=_0x2a1c1c,_0x3b3204=new Map();for(const _0x50c868 of _0x5eb238){let _0x3c278a;try{_0x3c278a=await stat(_0x50c868);}catch{throw new Error(_0x3689b7+(_0x11c35b(0x298)+_0x11c35b(0x245)+_0x11c35b(0x38a))+_0x50c868);}if(!_0x3c278a['isDirect'+_0x11c35b(0x24c)]())throw new Error(_0x3689b7+(_0x11c35b(0x28a)+'st\x20be\x20a\x20'+_0x11c35b(0x30a)+_0x11c35b(0x3e3))+_0x50c868);const _0xda378e={'name':basename(_0x50c868),'path':_0x50c868},_0x4e079a=_0x3b3204[_0x11c35b(0x281)](_0xda378e[_0x11c35b(0x30b)]);if(_0x4e079a)throw new Error(_0x11c35b(0x22e)+'e\x20'+_0x3689b7+_0x11c35b(0x2d1)+_0xda378e[_0x11c35b(0x30b)]+_0x11c35b(0x1f7)+_0x4e079a[_0x11c35b(0x39c)]+_0x11c35b(0x378)+_0xda378e[_0x11c35b(0x39c)]);_0x3b3204['set'](_0xda378e['name'],_0xda378e);}return[..._0x3b3204[_0x11c35b(0x392)]()];}async function syncProductCapabilityDirs(_0x408b24,_0x512928,_0x2f6517){const _0x1df46f=_0x2a1c1c,_0x27144e=await collectCapabilityEntries(_0x408b24,_0x2f6517);await rm(_0x512928,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await mkdir(_0x512928,{'recursive':!![]});for(const _0x11c2e8 of _0x27144e){await cp(_0x11c2e8[_0x1df46f(0x39c)],join(_0x512928,_0x11c2e8['name']),{'recursive':!![]});}return _0x27144e[_0x1df46f(0x3b5)];}export const __test__={'collectCapabilityEntries':collectCapabilityEntries,'syncProductCapabilityDirs':syncProductCapabilityDirs};async function syncProductAgents(_0x52e0be,_0x46360d,_0x1bf8b5){const _0x134c55=_0x2a1c1c,_0x126e4c=join(_0x46360d,_0x134c55(0x3e7),_0x134c55(0x235)),_0x4d5485=await syncProductCapabilityDirs(_0x52e0be[_0x134c55(0x3e7)][_0x134c55(0x2ed)+_0x134c55(0x3c3)+_0x134c55(0x290)],_0x126e4c,_0x134c55(0x3a6));_0x1bf8b5[_0x134c55(0x235)]={'source':_0x134c55(0x263),'installPath':toRuntimeRelative(_0x46360d,_0x126e4c),'localPaths':_0x52e0be[_0x134c55(0x3e7)][_0x134c55(0x2ed)+_0x134c55(0x3c3)+'ntPaths'],'entryCount':_0x4d5485};}async function syncProductSkills(_0x429524,_0x5b8ee6,_0x4a40ba){const _0xbb6f51=_0x2a1c1c,_0xed5bbc=join(_0x5b8ee6,_0xbb6f51(0x3e7),_0xbb6f51(0x26c)),_0x4a8327=await syncProductCapabilityDirs(_0x429524[_0xbb6f51(0x3e7)]['resolved'+'LocalSki'+_0xbb6f51(0x3c4)],_0xed5bbc,_0xbb6f51(0x340));_0x4a40ba['skills']={'source':_0xbb6f51(0x263),'installPath':toRuntimeRelative(_0x5b8ee6,_0xed5bbc),'localPaths':_0x429524[_0xbb6f51(0x3e7)]['resolved'+_0xbb6f51(0x36d)+_0xbb6f51(0x3c4)],'entryCount':_0x4a8327};}
1
+ const _0x38e6be=_0xfe4b;(function(_0x1881a2,_0x42cb06){const _0x5b5a14=_0xfe4b,_0x36beb8=_0x1881a2();while(!![]){try{const _0x25462e=parseInt(_0x5b5a14(0x282))/0x1+parseInt(_0x5b5a14(0x2cc))/0x2*(parseInt(_0x5b5a14(0x1ce))/0x3)+parseInt(_0x5b5a14(0x20f))/0x4+-parseInt(_0x5b5a14(0x2de))/0x5*(parseInt(_0x5b5a14(0x28a))/0x6)+-parseInt(_0x5b5a14(0x32a))/0x7*(-parseInt(_0x5b5a14(0x331))/0x8)+-parseInt(_0x5b5a14(0x25e))/0x9+parseInt(_0x5b5a14(0x34c))/0xa;if(_0x25462e===_0x42cb06)break;else _0x36beb8['push'](_0x36beb8['shift']());}catch(_0x5c841f){_0x36beb8['push'](_0x36beb8['shift']());}}}(_0x21fa,0xae782));import{existsSync}from'node:fs';import{createWriteStream}from'node:fs';import{chmod,cp,mkdir,readFile,readdir,rename,rm,stat,symlink,writeFile}from'node:fs/promises';import{basename,delimiter,dirname,join,relative,resolve}from'node:path';import{fileURLToPath,pathToFileURL}from'node:url';import{spawn}from'node:child_process';import{get}from'node:https';import{pipeline}from'node:stream/promises';import{getConfigPaths}from'@wujie-shell/config';import{copyDirFresh,getPackageMetadata,readJson,readPluginManifest,toRuntimeRelative,writeJson}from'../common/utils.mjs';import{createRuntimeLogger,summarizeRuntimeManifest,summarizeShellConfig}from'../common/runtime-logger.mjs';import{hasConfiguredKdocsSkill,installKdocsCliBinary}from'../connectors/kdocs-cli.mjs';import{patchMixedToolContentFromSource}from'./patch-chat-history-mixed-tool-content.mjs';import{patchChannelPluginRuntimeFromSource}from'./patch-channel-plugin-runtime.mjs';import{patchSessionStoreLoadFromSource,patchSessionStoreWriteFromSource}from'./patch-session-store-sqlite.mjs';const RUNTIME_DIR=_0x38e6be(0x369)+_0x38e6be(0x32e),MANIFEST_NAME=_0x38e6be(0x33f)+_0x38e6be(0x22f)+_0x38e6be(0x21d),NPM_INSTALL_TIMEOUT_MS=0xf*0x3c*0x3e8;export function resolveRuntimeRoot(_0x163593){if(process.env.WUJIE_SHELL_RUNTIME_ROOT)return resolve(process.env.WUJIE_SHELL_RUNTIME_ROOT);return resolve(_0x163593,RUNTIME_DIR);}export function resolveManifestPath(_0x35ed60){return join(_0x35ed60,MANIFEST_NAME);}async function loadProductRuntime(_0x24f47e,_0x1728b4){const _0x327551=_0x38e6be,_0x5827c6=[join(_0x24f47e,_0x327551(0x34d)+_0x327551(0x30b),'index.mj'+'s'),join(_0x1728b4,_0x327551(0x34d)+_0x327551(0x30b),_0x327551(0x288)+'s')];for(const _0x4749ab of _0x5827c6){if(!existsSync(_0x4749ab))continue;return await import(pathToFileURL(_0x4749ab)[_0x327551(0x1cd)]+_0x327551(0x2ce)+Date[_0x327551(0x267)]());}return{};}export async function prepareRuntime(_0x412386,{syncOnly:syncOnly=![]}={}){const _0x177071=_0x38e6be,_0x1b7761=resolveRuntimeRoot(_0x412386['projectR'+_0x177071(0x211)]),_0x2b1bde=createRuntimeLogger(getConfigPaths(_0x412386),_0x177071(0x1eb)),_0x20a085=Date[_0x177071(0x267)]();_0x2b1bde?.[_0x177071(0x204)]('prepare\x20'+'runtime\x20'+_0x177071(0x2fd),{'syncOnly':syncOnly,'runtimeRoot':_0x1b7761,'shellConfig':summarizeShellConfig(_0x412386)});try{const _0x4fd903=await ensureRuntimeBase(_0x412386,_0x1b7761,{'runtimeLogger':_0x2b1bde,'syncOnly':syncOnly});_0x2b1bde?.[_0x177071(0x204)](_0x177071(0x28f)+_0x177071(0x22f)+_0x177071(0x233),{'manifestPath':resolveManifestPath(_0x1b7761),'manifest':summarizeRuntimeManifest(_0x4fd903)}),validateRuntimeNodeVersion(_0x4fd903,_0x412386),_0x2b1bde?.[_0x177071(0x204)](_0x177071(0x28f)+_0x177071(0x212)+'sion\x20val'+_0x177071(0x189),{'nodeVersion':_0x4fd903[_0x177071(0x2b1)+_0x177071(0x196)]});if(syncOnly)validateRuntimeOpenClawVersion(_0x4fd903,_0x412386),_0x2b1bde?.[_0x177071(0x204)]('runtime\x20'+_0x177071(0x17d)+_0x177071(0x1d8)+_0x177071(0x358)+'ed',{'openclawVersion':_0x4fd903[_0x177071(0x17d)+'Version']});else{if(_0x4fd903[_0x177071(0x17d)+_0x177071(0x34e)]!==_0x412386[_0x177071(0x17d)][_0x177071(0x17d)+_0x177071(0x34e)]){const _0x5adcb1=await loadRuntimeInfo(_0x412386[_0x177071(0x1d6)+_0x177071(0x211)]);_0x2b1bde?.[_0x177071(0x204)]('openclaw'+_0x177071(0x1c3)+'\x20install'+_0x177071(0x31d),{'fromVersion':_0x4fd903[_0x177071(0x17d)+'Version']||_0x177071(0x35f),'toVersion':_0x412386[_0x177071(0x17d)]['openclaw'+_0x177071(0x34e)]}),await installOpenClawPackage(_0x5adcb1,_0x412386[_0x177071(0x17d)][_0x177071(0x17d)+_0x177071(0x34e)]),_0x4fd903[_0x177071(0x17d)+_0x177071(0x34e)]=_0x412386[_0x177071(0x17d)]['openclaw'+'Version'],_0x2b1bde?.['info'](_0x177071(0x17d)+_0x177071(0x1c3)+_0x177071(0x1ac)+_0x177071(0x1fb)+'ed',{'openclawVersion':_0x4fd903[_0x177071(0x17d)+_0x177071(0x34e)]});}}_0x4fd903[_0x177071(0x1a9)+_0x177071(0x2a4)]=new Date()[_0x177071(0x2d3)+'ing'](),_0x4fd903[_0x177071(0x2b1)+_0x177071(0x196)]=_0x412386['openclaw'][_0x177071(0x2b1)+'ion'],_0x4fd903[_0x177071(0x2d9)]={'appId':_0x412386[_0x177071(0x235)],'productName':_0x412386[_0x177071(0x2d1)+'ame'],'dataDirName':_0x412386['dataDirN'+_0x177071(0x290)]},await patchChatHistoryMixedToolContentBug(_0x1b7761,_0x4fd903,{'runtimeLogger':_0x2b1bde}),await patchChannelPluginRuntimeBug(_0x1b7761,_0x4fd903,{'runtimeLogger':_0x2b1bde});const _0x574920=await loadProductRuntime(_0x412386[_0x177071(0x1d6)+'oot'],_0x1b7761);if(typeof _0x574920['prepareP'+'roductRu'+_0x177071(0x30b)]===_0x177071(0x353)){const _0x2dbbcd=createRuntimeInfoFromManifest(_0x1b7761,_0x4fd903);await _0x574920[_0x177071(0x2a8)+_0x177071(0x324)+_0x177071(0x30b)]({'shellConfig':_0x412386,'runtime':_0x2dbbcd,'runtimeLogger':_0x2b1bde,'syncOnly':syncOnly}),_0x2b1bde?.[_0x177071(0x204)](_0x177071(0x340)+_0x177071(0x28f)+_0x177071(0x2a5)+_0x177071(0x2af));}await patchSessionStoreSqliteRuntime(_0x1b7761,_0x4fd903,{'runtimeLogger':_0x2b1bde});!syncOnly&&(await hasConfiguredKdocsSkill(_0x412386)?(await installKdocsCliBinary(_0x412386,createRuntimeInfoFromManifest(_0x1b7761,_0x4fd903),{'runtimeLogger':_0x2b1bde,'syncOnly':syncOnly}),_0x2b1bde?.[_0x177071(0x204)](_0x177071(0x30c)+_0x177071(0x25c)+_0x177071(0x252)+_0x177071(0x201))):_0x2b1bde?.[_0x177071(0x204)](_0x177071(0x30c)+_0x177071(0x25c)+_0x177071(0x252)+_0x177071(0x30e)+_0x177071(0x296)+_0x177071(0x327)+_0x177071(0x20c)+_0x177071(0x360)));const _0x2ca654=Array[_0x177071(0x2d5)](_0x4fd903[_0x177071(0x1be)])?_0x4fd903['plugins'][_0x177071(0x31a)]:0x0;return await syncManifestPluginScope(_0x412386,_0x1b7761,_0x4fd903),_0x2b1bde?.[_0x177071(0x204)](_0x177071(0x28f)+_0x177071(0x1de)+'cope\x20syn'+_0x177071(0x21e),{'beforePluginCount':_0x2ca654,'afterPluginCount':Array[_0x177071(0x2d5)](_0x4fd903[_0x177071(0x1be)])?_0x4fd903[_0x177071(0x1be)][_0x177071(0x31a)]:0x0,'pluginSpecCount':Array['isArray'](_0x4fd903[_0x177071(0x177)+_0x177071(0x1aa)])?_0x4fd903[_0x177071(0x177)+_0x177071(0x1aa)][_0x177071(0x31a)]:0x0}),await syncConfiguredNpmPlugins(_0x412386,_0x1b7761,_0x4fd903,{'runtimeLogger':_0x2b1bde,'syncOnly':syncOnly}),_0x2b1bde?.['info'](_0x177071(0x2ee)+_0x177071(0x2fb)+'lugins\x20s'+_0x177071(0x31e),{'pluginSpecCount':_0x412386[_0x177071(0x17d)][_0x177071(0x177)+_0x177071(0x1aa)][_0x177071(0x31a)],'pluginCount':Array['isArray'](_0x4fd903[_0x177071(0x1be)])?_0x4fd903[_0x177071(0x1be)]['length']:0x0}),await syncProductPlugins(_0x412386,_0x1b7761,_0x4fd903,{'runtimeLogger':_0x2b1bde}),_0x2b1bde?.[_0x177071(0x204)](_0x177071(0x340)+_0x177071(0x2c4)+_0x177071(0x201),{'localPluginCount':_0x412386[_0x177071(0x17d)][_0x177071(0x1c1)+_0x177071(0x2c0)+_0x177071(0x1f6)]['length'],'pluginCount':Array[_0x177071(0x2d5)](_0x4fd903['plugins'])?_0x4fd903[_0x177071(0x1be)][_0x177071(0x31a)]:0x0}),await syncProductAgents(_0x412386,_0x1b7761,_0x4fd903),_0x2b1bde?.['info'](_0x177071(0x340)+_0x177071(0x37a)+_0x177071(0x31e),{'sources':_0x412386[_0x177071(0x17d)]['resolved'+_0x177071(0x215)+_0x177071(0x2c8)],'entryCount':_0x4fd903[_0x177071(0x312)]?.[_0x177071(0x183)+'nt'],'installPath':_0x4fd903[_0x177071(0x312)]?.[_0x177071(0x208)+_0x177071(0x2ab)]}),await syncProductSkills(_0x412386,_0x1b7761,_0x4fd903),_0x2b1bde?.[_0x177071(0x204)]('product\x20'+'skills\x20s'+_0x177071(0x31e),{'sources':_0x412386[_0x177071(0x17d)]['resolved'+_0x177071(0x1c4)+_0x177071(0x1e1)],'entryCount':_0x4fd903[_0x177071(0x245)]?.['entryCou'+'nt'],'installPath':_0x4fd903['skills']?.[_0x177071(0x208)+_0x177071(0x2ab)]}),await syncRuntimeWrapper(_0x412386,_0x1b7761,_0x4fd903),_0x2b1bde?.[_0x177071(0x204)](_0x177071(0x28f)+'wrapper\x20'+_0x177071(0x201),{'wujieclawBin':_0x4fd903[_0x177071(0x2eb)+_0x177071(0x309)]}),await writeJson(resolveManifestPath(_0x1b7761),_0x4fd903),_0x2b1bde?.[_0x177071(0x204)](_0x177071(0x28f)+'manifest'+_0x177071(0x286),{'manifestPath':resolveManifestPath(_0x1b7761),'manifest':summarizeRuntimeManifest(_0x4fd903),'durationMs':Date[_0x177071(0x267)]()-_0x20a085}),await _0x2b1bde?.['flush'](),_0x4fd903;}catch(_0x1b722c){_0x2b1bde?.['error'](_0x177071(0x209)+_0x177071(0x28f)+_0x177071(0x2ff),{'syncOnly':syncOnly,'runtimeRoot':_0x1b7761,'durationMs':Date[_0x177071(0x267)]()-_0x20a085,'error':_0x1b722c}),await _0x2b1bde?.[_0x177071(0x315)]();throw _0x1b722c;}}async function syncRuntimeWrapper(_0x467c82,_0x32eb21,_0x5d160b){const _0x3ed4b5=_0x38e6be,_0x1a2e7e=_0x467c82[_0x3ed4b5(0x17d)]?.[_0x3ed4b5(0x257)+_0x3ed4b5(0x203)]??_0x3ed4b5(0x29f)+_0x3ed4b5(0x304),_0x44c0d0=join(_0x32eb21,_0x3ed4b5(0x1c9),_0x3ed4b5(0x2eb)+'w'),_0x48d8b2=join(_0x32eb21,_0x3ed4b5(0x1c9),_0x3ed4b5(0x2eb)+_0x3ed4b5(0x248)),_0x1a2cf5=normalizeRuntimeRelativePath(relative(dirname(_0x44c0d0),resolve(_0x32eb21,_0x5d160b[_0x3ed4b5(0x255)+_0x3ed4b5(0x1ba)]))),_0x36a411=normalizeRuntimeRelativePath(relative(dirname(_0x44c0d0),resolve(_0x32eb21,_0x5d160b['openclaw'+_0x3ed4b5(0x1c6)]))),_0x3c7f54=_0x3ed4b5(0x2b7)+_0x467c82['dataDirN'+_0x3ed4b5(0x290)],_0x3189ce=_0x3ed4b5(0x21a)+_0x3ed4b5(0x1a3)+_0x467c82[_0x3ed4b5(0x261)+_0x3ed4b5(0x290)];await mkdir(dirname(_0x44c0d0),{'recursive':!![]});const _0xc3eec0=fileURLToPath(new URL(_0x3ed4b5(0x31b)+_0x3ed4b5(0x266)+_0x3ed4b5(0x323)+_0x3ed4b5(0x185),import.meta.url)),_0x5d2b03=join(_0x32eb21,'bin',_0x3ed4b5(0x200)+_0x3ed4b5(0x1cf));await cp(_0xc3eec0,_0x5d2b03),await writeFile(_0x44c0d0,[_0x3ed4b5(0x1dc)+'h',_0x3ed4b5(0x2ec)+_0x3ed4b5(0x2e0)+_0x3ed4b5(0x274)+_0x3ed4b5(0x2b5)+_0x3ed4b5(0x254)+_0x3c7f54+'}\x22','export\x20O'+_0x3ed4b5(0x2e0)+_0x3ed4b5(0x19f)+_0x3ed4b5(0x23f)+_0x3ed4b5(0x1e9)+_0x3ed4b5(0x2f5)+'-'+_0x3c7f54+'}\x22',_0x3ed4b5(0x2ec)+_0x3ed4b5(0x2e0)+_0x3ed4b5(0x217)+'ILE_NAME'+_0x3ed4b5(0x2b2)+'CLAW_CON'+_0x3ed4b5(0x24d)+_0x3ed4b5(0x26d)+_0x1a2e7e+'}\x22',_0x3ed4b5(0x2ec)+_0x3ed4b5(0x2e0)+_0x3ed4b5(0x2c7)+'ATH=\x22${O'+_0x3ed4b5(0x2e0)+_0x3ed4b5(0x2c7)+_0x3ed4b5(0x283)+_0x3c7f54+'/'+_0x1a2e7e+'}\x22','SCRIPT_D'+'IR=$(CDP'+_0x3ed4b5(0x2a7)+_0x3ed4b5(0x376)+_0x3ed4b5(0x33b)+_0x3ed4b5(0x34f)+_0x3ed4b5(0x299),_0x3ed4b5(0x226)+_0x3ed4b5(0x285)+_0x3ed4b5(0x1f7)+'JIE_NO_L'+'OGO\x22\x20];\x20'+'then',_0x3ed4b5(0x2a2)+_0x3ed4b5(0x2cf)+_0x1a2cf5+(_0x3ed4b5(0x1f8)+'PT_DIR/w'+_0x3ed4b5(0x2e6)+_0x3ed4b5(0x243)+_0x3ed4b5(0x186)+'ll\x20||\x20tr'+'ue'),'fi',_0x3ed4b5(0x367)+_0x3ed4b5(0x1f0)+'R/'+_0x1a2cf5+(_0x3ed4b5(0x1f8)+_0x3ed4b5(0x2cf))+_0x36a411+_0x3ed4b5(0x326),'']['join']('\x0a'),_0x3ed4b5(0x206)),await chmod(_0x44c0d0,0x1ed),await writeFile(_0x48d8b2,[_0x3ed4b5(0x2fe)+'f',_0x3ed4b5(0x306)+_0x3ed4b5(0x22c)+'ME%\x22==\x22\x22'+_0x3ed4b5(0x1e6)+_0x3ed4b5(0x284)+_0x3ed4b5(0x305)+_0x3189ce+'\x22',_0x3ed4b5(0x306)+_0x3ed4b5(0x1e9)+_0x3ed4b5(0x29a)+_0x3ed4b5(0x1b8)+_0x3ed4b5(0x232)+'LAW_STAT'+_0x3ed4b5(0x33a)+_0x3189ce+'\x22',_0x3ed4b5(0x306)+_0x3ed4b5(0x23a)+_0x3ed4b5(0x2b3)+'E_NAME%\x22'+_0x3ed4b5(0x2d0)+_0x3ed4b5(0x1f5)+'AW_CONFI'+'G_FILE_N'+'AME='+_0x1a2e7e+'\x22',_0x3ed4b5(0x306)+'NCLAW_CO'+_0x3ed4b5(0x29d)+_0x3ed4b5(0x2b6)+_0x3ed4b5(0x27f)+_0x3ed4b5(0x23a)+_0x3ed4b5(0x29d)+'H='+_0x3189ce+'\x5c'+_0x1a2e7e+'\x22',_0x3ed4b5(0x1ed)+_0x3ed4b5(0x25d)+_0x3ed4b5(0x279),_0x3ed4b5(0x356)+_0x3ed4b5(0x2c3)+toWindowsPath(_0x1a2cf5)+(_0x3ed4b5(0x325)+'PT_DIR%')+toWindowsPath(_0x36a411)+_0x3ed4b5(0x1df),''][_0x3ed4b5(0x27a)]('\x0d\x0a'),_0x3ed4b5(0x206)),_0x5d160b[_0x3ed4b5(0x2eb)+_0x3ed4b5(0x309)]=toRuntimeRelative(_0x32eb21,process[_0x3ed4b5(0x260)]===_0x3ed4b5(0x28e)?_0x48d8b2:_0x44c0d0);}function _0xfe4b(_0x55369c,_0x68daf){_0x55369c=_0x55369c-0x175;const _0x21fabb=_0x21fa();let _0xfe4bad=_0x21fabb[_0x55369c];return _0xfe4bad;}async function patchChatHistoryMixedToolContentBug(_0x1b31b2,_0x54676d,_0xd48428={}){const _0x57fcb7=_0x38e6be,_0x1fac2b=resolve(_0x1b31b2,_0x54676d['openclaw'+_0x57fcb7(0x23d)+'ir']),_0x12094a=join(_0x1fac2b,_0x57fcb7(0x269));let _0x5bbdc8=[];try{_0x5bbdc8=await readdir(_0x12094a,{'withFileTypes':!![]});}catch{_0xd48428[_0x57fcb7(0x265)+_0x57fcb7(0x294)]?.[_0x57fcb7(0x1f9)]?.(_0x57fcb7(0x1fa)+_0x57fcb7(0x21b)+'ed-tool\x20'+'patch\x20sk'+_0x57fcb7(0x1f4)+_0x57fcb7(0x228)+_0x57fcb7(0x1bb),{'distDir':_0x12094a,'openclawVersion':_0x54676d[_0x57fcb7(0x17d)+'Version']});return;}const _0x171c2b=_0x5bbdc8['filter'](_0x19d960=>_0x19d960[_0x57fcb7(0x1d4)]()&&_0x19d960['name'][_0x57fcb7(0x20b)+'th'](_0x57fcb7(0x335)+_0x57fcb7(0x364)+_0x57fcb7(0x2be))&&_0x19d960[_0x57fcb7(0x1ec)][_0x57fcb7(0x32b)](_0x57fcb7(0x24a)))[_0x57fcb7(0x2ad)](_0x71af2c=>join(_0x12094a,_0x71af2c[_0x57fcb7(0x1ec)]));if(_0x171c2b['length']===0x0){_0xd48428[_0x57fcb7(0x265)+_0x57fcb7(0x294)]?.[_0x57fcb7(0x1f9)]?.(_0x57fcb7(0x1fa)+_0x57fcb7(0x21b)+_0x57fcb7(0x23b)+'patch\x20sk'+_0x57fcb7(0x321)+_0x57fcb7(0x31c)+_0x57fcb7(0x1bb),{'openclawVersion':_0x54676d['openclaw'+_0x57fcb7(0x34e)]});return;}for(const _0x42ae9e of _0x171c2b){const _0x423b36=await readFile(_0x42ae9e,_0x57fcb7(0x206)),_0x541b64=patchMixedToolContentFromSource(_0x423b36);if(!_0x541b64[_0x57fcb7(0x332)]){if(_0x541b64[_0x57fcb7(0x303)]===_0x57fcb7(0x341)+_0x57fcb7(0x332)){_0xd48428[_0x57fcb7(0x265)+_0x57fcb7(0x294)]?.[_0x57fcb7(0x204)]?.(_0x57fcb7(0x1fa)+_0x57fcb7(0x21b)+_0x57fcb7(0x23b)+_0x57fcb7(0x1f3)+_0x57fcb7(0x1a2)+_0x57fcb7(0x1b7),{'openclawVersion':_0x54676d[_0x57fcb7(0x17d)+_0x57fcb7(0x34e)],'filePath':_0x42ae9e});return;}continue;}await writeFile(_0x42ae9e,_0x541b64['source'],_0x57fcb7(0x206)),_0xd48428['runtimeL'+_0x57fcb7(0x294)]?.['info']?.('chat\x20his'+_0x57fcb7(0x21b)+_0x57fcb7(0x23b)+'patch\x20ap'+'plied',{'openclawVersion':_0x54676d[_0x57fcb7(0x17d)+_0x57fcb7(0x34e)],'filePath':_0x42ae9e,'note':'Temporar'+'y\x20compat'+_0x57fcb7(0x237)+_0x57fcb7(0x22b)+_0x57fcb7(0x32f)+_0x57fcb7(0x2a9)+_0x57fcb7(0x295)+_0x57fcb7(0x26e)+_0x57fcb7(0x1e7)+_0x57fcb7(0x2b0)+_0x57fcb7(0x35c)+_0x57fcb7(0x301)+_0x57fcb7(0x280)+_0x57fcb7(0x2bc)+'re\x20upgra'+_0x57fcb7(0x344)});return;}_0xd48428[_0x57fcb7(0x265)+_0x57fcb7(0x294)]?.['warn']?.(_0x57fcb7(0x1fa)+_0x57fcb7(0x21b)+_0x57fcb7(0x23b)+'patch\x20sk'+'ipped;\x20f'+_0x57fcb7(0x374)+_0x57fcb7(0x30a)+'d',{'openclawVersion':_0x54676d[_0x57fcb7(0x17d)+_0x57fcb7(0x34e)]});}async function patchChannelPluginRuntimeBug(_0x20542a,_0x42c939,_0x15135f={}){const _0x2f6256=_0x38e6be,_0x43ec16=resolve(_0x20542a,_0x42c939['openclaw'+_0x2f6256(0x23d)+'ir']),_0xff1e2b=join(_0x43ec16,'dist');let _0x214cb5=[];try{_0x214cb5=await readdir(_0xff1e2b,{'withFileTypes':!![]});}catch{_0x15135f[_0x2f6256(0x265)+_0x2f6256(0x294)]?.[_0x2f6256(0x1f9)]?.(_0x2f6256(0x30d)+_0x2f6256(0x2ed)+'untime\x20p'+_0x2f6256(0x2c5)+_0x2f6256(0x37d)+_0x2f6256(0x231)+_0x2f6256(0x18b),{'distDir':_0xff1e2b,'openclawVersion':_0x42c939[_0x2f6256(0x17d)+_0x2f6256(0x34e)]});return;}const _0x3a8f50=_0x214cb5[_0x2f6256(0x28d)](_0x2c086d=>_0x2c086d[_0x2f6256(0x1d4)]()&&_0x2c086d[_0x2f6256(0x1ec)][_0x2f6256(0x20b)+'th']('loader-')&&_0x2c086d['name'][_0x2f6256(0x32b)](_0x2f6256(0x24a)))[_0x2f6256(0x2ad)](_0xcd3df5=>join(_0xff1e2b,_0xcd3df5['name'])),_0xd2435e=await resolveRuntimeChannelImportPath(_0xff1e2b,_0x214cb5);if(_0x3a8f50[_0x2f6256(0x31a)]===0x0){_0x15135f[_0x2f6256(0x265)+_0x2f6256(0x294)]?.['warn']?.('channel\x20'+_0x2f6256(0x2ed)+_0x2f6256(0x239)+_0x2f6256(0x2c5)+_0x2f6256(0x1b0)+_0x2f6256(0x259)+_0x2f6256(0x371),{'openclawVersion':_0x42c939[_0x2f6256(0x17d)+_0x2f6256(0x34e)]});return;}if(!_0xd2435e){_0x15135f[_0x2f6256(0x265)+'ogger']?.[_0x2f6256(0x1f9)]?.('channel\x20'+_0x2f6256(0x2ed)+_0x2f6256(0x239)+_0x2f6256(0x2c5)+_0x2f6256(0x234)+'ntime\x20ch'+_0x2f6256(0x287)+'try\x20not\x20'+_0x2f6256(0x1bb),{'openclawVersion':_0x42c939[_0x2f6256(0x17d)+'Version'],'distDir':_0xff1e2b});return;}for(const _0x12eef6 of _0x3a8f50){const _0x5c6ff8=await readFile(_0x12eef6,_0x2f6256(0x206)),_0x24ac1d=patchChannelPluginRuntimeFromSource(_0x5c6ff8,{'runtimeChannelImportPath':_0xd2435e});if(!_0x24ac1d[_0x2f6256(0x332)]){if(_0x24ac1d['reason']===_0x2f6256(0x341)+_0x2f6256(0x332)){_0x15135f[_0x2f6256(0x265)+_0x2f6256(0x294)]?.[_0x2f6256(0x204)]?.(_0x2f6256(0x30d)+_0x2f6256(0x2ed)+_0x2f6256(0x239)+_0x2f6256(0x179)+_0x2f6256(0x222)+_0x2f6256(0x191),{'openclawVersion':_0x42c939[_0x2f6256(0x17d)+_0x2f6256(0x34e)],'filePath':_0x12eef6});return;}continue;}await writeFile(_0x12eef6,_0x24ac1d['source'],'utf8'),_0x15135f[_0x2f6256(0x265)+_0x2f6256(0x294)]?.[_0x2f6256(0x204)]?.(_0x2f6256(0x30d)+_0x2f6256(0x2ed)+'untime\x20p'+'atch\x20app'+_0x2f6256(0x191),{'openclawVersion':_0x42c939[_0x2f6256(0x17d)+_0x2f6256(0x34e)],'filePath':_0x12eef6,'note':'Temporar'+_0x2f6256(0x2c1)+_0x2f6256(0x237)+_0x2f6256(0x22b)+_0x2f6256(0x32f)+'aw\x202026.'+_0x2f6256(0x346)+_0x2f6256(0x1e0)+_0x2f6256(0x336)+_0x2f6256(0x268)+'ng\x20chann'+_0x2f6256(0x1a7)+'nd\x20helpe'+_0x2f6256(0x20e)+_0x2f6256(0x2d8)+_0x2f6256(0x2fa)+'on\x20futur'+_0x2f6256(0x2f7)+_0x2f6256(0x342)});return;}_0x15135f[_0x2f6256(0x265)+'ogger']?.[_0x2f6256(0x1f9)]?.(_0x2f6256(0x30d)+_0x2f6256(0x2ed)+'untime\x20p'+_0x2f6256(0x2c5)+_0x2f6256(0x234)+_0x2f6256(0x184)+_0x2f6256(0x1da)+_0x2f6256(0x2da),{'openclawVersion':_0x42c939[_0x2f6256(0x17d)+'Version']});}async function patchSessionStoreSqliteRuntime(_0x2cc63b,_0x19615a,_0x49d0d3={}){const _0x524507=_0x38e6be,_0x39013b=resolve(_0x2cc63b,_0x19615a[_0x524507(0x17d)+_0x524507(0x23d)+'ir']),_0x69f08d=join(_0x39013b,'dist'),_0x20693b=_0x524507(0x1b6)+_0x524507(0x2bd)+_0x524507(0x1b2)+'ions/run'+'time-bri'+_0x524507(0x26a),_0x10cb9a=join(_0x2cc63b,_0x524507(0x34d)+'ntime',_0x524507(0x1d5),_0x524507(0x33f)+_0x524507(0x2b9)+'js'),_0xc0634a=(await readdir(_0x69f08d,{'withFileTypes':!![]})[_0x524507(0x2dc)](()=>[]))[_0x524507(0x28d)](_0x56c271=>_0x56c271[_0x524507(0x1d4)]()&&_0x56c271[_0x524507(0x1ec)][_0x524507(0x20b)+'th'](_0x524507(0x1b4)+_0x524507(0x182))&&_0x56c271[_0x524507(0x1ec)]['endsWith'](_0x524507(0x24a)))[_0x524507(0x2ad)](_0x591e6c=>join(_0x69f08d,_0x591e6c['name'])),_0x4f892e=(await readdir(_0x69f08d,{'withFileTypes':!![]})[_0x524507(0x2dc)](()=>[]))[_0x524507(0x28d)](_0x44246b=>_0x44246b['isFile']()&&_0x44246b[_0x524507(0x1ec)][_0x524507(0x20b)+'th'](_0x524507(0x2f4))&&!_0x44246b[_0x524507(0x1ec)][_0x524507(0x20b)+'th'](_0x524507(0x1b4)+'ad-')&&_0x44246b[_0x524507(0x1ec)][_0x524507(0x32b)]('.js'))['map'](_0x4444e6=>join(_0x69f08d,_0x4444e6[_0x524507(0x1ec)]));if(!existsSync(_0x10cb9a)){_0x49d0d3[_0x524507(0x265)+_0x524507(0x294)]?.[_0x524507(0x204)]?.(_0x524507(0x17e)+_0x524507(0x19e)+_0x524507(0x1db)+'ch\x20skipp'+_0x524507(0x337)+_0x524507(0x368)+'vailable',{'bridgePath':_0x10cb9a,'openclawVersion':_0x19615a[_0x524507(0x17d)+_0x524507(0x34e)]});return;}for(const _0xfa2150 of _0xc0634a){const _0x1a1a4c=await readFile(_0xfa2150,_0x524507(0x206)),_0x3725ba=patchSessionStoreLoadFromSource(_0x1a1a4c,{'bridgeImportPath':_0x20693b});if(!_0x3725ba[_0x524507(0x332)]){if(_0x3725ba[_0x524507(0x303)]===_0x524507(0x341)+_0x524507(0x332)){_0x49d0d3['runtimeL'+_0x524507(0x294)]?.['info']?.(_0x524507(0x17e)+_0x524507(0x1a6)+_0x524507(0x276)+_0x524507(0x28b)+_0x524507(0x316),{'filePath':_0xfa2150,'openclawVersion':_0x19615a[_0x524507(0x17d)+'Version']});break;}continue;}await writeFile(_0xfa2150,_0x3725ba[_0x524507(0x351)],_0x524507(0x206)),_0x49d0d3[_0x524507(0x265)+'ogger']?.[_0x524507(0x204)]?.(_0x524507(0x17e)+_0x524507(0x1a6)+_0x524507(0x276)+'\x20applied',{'filePath':_0xfa2150,'openclawVersion':_0x19615a[_0x524507(0x17d)+'Version']});break;}for(const _0x3eaf51 of _0x4f892e){const _0x58b41c=await readFile(_0x3eaf51,_0x524507(0x206)),_0x55045f=patchSessionStoreWriteFromSource(_0x58b41c,{'bridgeImportPath':_0x20693b});if(!_0x55045f[_0x524507(0x332)]){if(_0x55045f[_0x524507(0x303)]==='already-'+_0x524507(0x332)){_0x49d0d3[_0x524507(0x265)+_0x524507(0x294)]?.[_0x524507(0x204)]?.('session\x20'+'store\x20wr'+_0x524507(0x225)+'h\x20alread'+'y\x20applie'+'d',{'filePath':_0x3eaf51,'openclawVersion':_0x19615a[_0x524507(0x17d)+'Version']});break;}continue;}await writeFile(_0x3eaf51,_0x55045f[_0x524507(0x351)],_0x524507(0x206)),_0x49d0d3[_0x524507(0x265)+'ogger']?.['info']?.(_0x524507(0x17e)+_0x524507(0x1ad)+_0x524507(0x225)+_0x524507(0x25a)+'d',{'filePath':_0x3eaf51,'openclawVersion':_0x19615a[_0x524507(0x17d)+'Version']});break;}}async function resolveRuntimeChannelImportPath(_0x41f7f1,_0x1e4721){const _0x2d0397=_0x38e6be,_0x5f301d=_0x1e4721[_0x2d0397(0x28d)](_0x13c8d2=>_0x13c8d2[_0x2d0397(0x1d4)]()&&_0x13c8d2[_0x2d0397(0x1ec)][_0x2d0397(0x20b)+'th'](_0x2d0397(0x33f)+_0x2d0397(0x247))&&_0x13c8d2['name'][_0x2d0397(0x32b)]('.js')&&!_0x13c8d2[_0x2d0397(0x1ec)][_0x2d0397(0x20b)+'th']('runtime-'+_0x2d0397(0x247)+_0x2d0397(0x1e5)))[_0x2d0397(0x2ad)](_0x11ac83=>_0x11ac83[_0x2d0397(0x1ec)])['sort']();for(const _0x38f8ce of _0x5f301d){const _0x3c6173=await readFile(join(_0x41f7f1,_0x38f8ce),_0x2d0397(0x206));if(_0x3c6173[_0x2d0397(0x262)](_0x2d0397(0x18c)+_0x2d0397(0x363)+_0x2d0397(0x30f)))return'./'+_0x38f8ce;}return null;}function normalizeRuntimeRelativePath(_0x30e55c){return _0x30e55c['replaceA'+'ll']('\x5c','/');}function toWindowsPath(_0x3148a4){const _0x3c3e1a=_0x38e6be;return _0x3148a4[_0x3c3e1a(0x275)+'ll']('/','\x5c');}function validateRuntimeNodeVersion(_0x2e0633,_0x5a71b8){const _0x1f197e=_0x38e6be;if(_0x2e0633[_0x1f197e(0x2b1)+_0x1f197e(0x196)]===_0x5a71b8['openclaw'][_0x1f197e(0x2b1)+'ion'])return;throw new Error(_0x1f197e(0x28f)+'nodeVers'+_0x1f197e(0x313)+'atch:\x20ma'+_0x1f197e(0x194)+(_0x2e0633['nodeVers'+_0x1f197e(0x196)]||_0x1f197e(0x35f))+(_0x1f197e(0x190)+_0x1f197e(0x240))+_0x5a71b8[_0x1f197e(0x17d)][_0x1f197e(0x2b1)+'ion']+'.\x20'+(_0x1f197e(0x197)+_0x1f197e(0x199)+_0x1f197e(0x311)+_0x1f197e(0x320)+_0x1f197e(0x2d7)+'\x20runtime'+_0x1f197e(0x22d)+'rebuilt\x20'+_0x1f197e(0x213)+_0x1f197e(0x20c)+'red\x20Node'+'\x20version'+'.'));}function validateRuntimeOpenClawVersion(_0x2d41cd,_0x5a3215){const _0x58f8e0=_0x38e6be;if(_0x2d41cd[_0x58f8e0(0x17d)+'Version']===_0x5a3215['openclaw']['openclaw'+'Version'])return;throw new Error(_0x58f8e0(0x28f)+'openclaw'+'Version\x20'+'mismatch'+':\x20manife'+_0x58f8e0(0x1ae)+(_0x2d41cd[_0x58f8e0(0x17d)+_0x58f8e0(0x34e)]||_0x58f8e0(0x35f))+(',\x20shell.'+_0x58f8e0(0x240))+_0x5a3215[_0x58f8e0(0x17d)][_0x58f8e0(0x17d)+_0x58f8e0(0x34e)]+'.\x20'+(_0x58f8e0(0x197)+_0x58f8e0(0x199)+_0x58f8e0(0x311)+_0x58f8e0(0x320)+_0x58f8e0(0x2d6)+_0x58f8e0(0x1a1)+_0x58f8e0(0x24b)+_0x58f8e0(0x20c)+_0x58f8e0(0x26b)+_0x58f8e0(0x19d)+_0x58f8e0(0x333)));}function parseNpmPackJson(_0x5e2077){const _0xe87093=_0x38e6be,_0x4fe91e=_0x5e2077[_0xe87093(0x339)](),_0x43e635=_0x4fe91e[_0xe87093(0x263)]('[');if(_0x43e635<0x0)throw new Error(_0xe87093(0x2f6)+'\x20did\x20not'+_0xe87093(0x22a)+_0xe87093(0x26f)+_0x4fe91e[_0xe87093(0x29b)](0x0,0x1f4));const _0x5c18ed=JSON['parse'](_0x4fe91e['slice'](_0x43e635)),_0x39409c=Array['isArray'](_0x5c18ed)?_0x5c18ed[0x0]:_0x5c18ed;if(!_0x39409c||typeof _0x39409c!==_0xe87093(0x2df))throw new Error(_0xe87093(0x2f6)+_0xe87093(0x34b)+_0xe87093(0x251)+_0xe87093(0x307)+_0xe87093(0x1c5)+_0x4fe91e[_0xe87093(0x29b)](0x0,0x1f4));return _0x39409c;}function normalizePackedTarballFilename(_0x1fe01d){const _0x410471=_0x38e6be;return _0x1fe01d[_0x410471(0x1dd)](/^@/,'')['replaceA'+'ll']('/','-')[_0x410471(0x275)+'ll']('\x5c','-');}async function runProcess(_0x5a39a2,_0x128a55,_0x3d4efc={}){const _0x292557=_0x38e6be,_0x37a41f=_0x3d4efc[_0x292557(0x2f9)]||[_0x5a39a2,..._0x128a55][_0x292557(0x27a)]('\x20'),_0x45f0ab=_0x3d4efc[_0x292557(0x1ff)+'s']??NPM_INSTALL_TIMEOUT_MS,_0x5d6c10=spawn(_0x5a39a2,_0x128a55,{'cwd':_0x3d4efc[_0x292557(0x2b4)],'env':_0x3d4efc['env'],'stdio':['ignore','pipe',_0x292557(0x21c)]});return await new Promise((_0x4c12f5,_0x4a1929)=>{const _0x4a4975=_0x292557;let _0x144eb4='',_0x48d407='',_0x48816a=![];const _0x5d33a4=setTimeout(()=>{const _0x293ac2=_0xfe4b;if(_0x48816a)return;_0x48816a=!![],_0x5d6c10['kill'](_0x293ac2(0x1c7)),_0x4a1929(new Error(_0x37a41f+(_0x293ac2(0x192)+_0x293ac2(0x24f)+'\x20')+_0x45f0ab+'ms'));},_0x45f0ab);_0x5d6c10[_0x4a4975(0x2b8)]['on'](_0x4a4975(0x22e),_0x2a06a8=>{_0x144eb4+=_0x2a06a8['toString']();}),_0x5d6c10[_0x4a4975(0x293)]['on'](_0x4a4975(0x22e),_0x45bf6f=>{const _0x4d758e=_0x4a4975;_0x48d407+=_0x45bf6f[_0x4d758e(0x1a4)]();}),_0x5d6c10['on']('error',_0x10ad78=>{if(_0x48816a)return;_0x48816a=!![],clearTimeout(_0x5d33a4),_0x4a1929(_0x10ad78);}),_0x5d6c10['on']('close',(_0x3804fe,_0x3da4a7)=>{const _0x87d6ca=_0x4a4975;if(_0x48816a)return;_0x48816a=!![],clearTimeout(_0x5d33a4);if(_0x3804fe===0x0){_0x4c12f5({'stdout':_0x144eb4,'stderr':_0x48d407});return;}_0x4a1929(new Error(_0x37a41f+('\x20failed\x20'+_0x87d6ca(0x292)+'e=')+(_0x3804fe??_0x87d6ca(0x2fc))+_0x87d6ca(0x1fe)+(_0x3da4a7??_0x87d6ca(0x2fc))+'\x0a'+(''+(_0x48d407||_0x144eb4))[_0x87d6ca(0x339)]()));});});}async function installOpenClawPackage(_0x5e3053,_0x410611){const _0x37a52f=_0x38e6be,_0x1edd47=join(_0x5e3053['runtimeR'+_0x37a52f(0x211)],_0x37a52f(0x1bd)),_0x3a1043=join(_0x5e3053[_0x37a52f(0x37c)+_0x37a52f(0x211)],_0x37a52f(0x220)+_0x37a52f(0x223)+'t');await mkdir(_0x1edd47,{'recursive':!![]}),await removePathWithRetries(_0x3a1043),await mkdir(_0x3a1043,{'recursive':!![]});const _0x102311=await createRuntimeEnv(_0x5e3053),_0x460057=_0x37a52f(0x17d)+'@'+_0x410611;console[_0x37a52f(0x1bc)](_0x37a52f(0x347)+'hell:run'+_0x37a52f(0x18f)+_0x37a52f(0x19b)+'\x20'+_0x460057);const _0x377d33=await runProcess(_0x5e3053['nodeExec'+_0x37a52f(0x1ba)],[_0x5e3053[_0x37a52f(0x372)],'pack',_0x460057,_0x37a52f(0x17a)],{'cwd':_0x1edd47,'env':_0x102311,'label':_0x37a52f(0x2f6)+'\x20'+_0x460057}),_0x235843=parseNpmPackJson(_0x377d33['stdout']);if(_0x235843[_0x37a52f(0x2aa)]!==_0x410611)throw new Error(_0x37a52f(0x198)+_0x37a52f(0x2ea)+'law\x20'+_0x410611+(_0x37a52f(0x188)+_0x37a52f(0x17f))+_0x235843[_0x37a52f(0x2aa)]);const _0x5b7870=resolve(_0x1edd47,_0x235843[_0x37a52f(0x253)]);if(!existsSync(_0x5b7870))throw new Error('npm\x20pack'+_0x37a52f(0x2c2)+_0x37a52f(0x343)+_0x37a52f(0x35a)+'\x20'+_0x5b7870);await runProcess('tar',['-xzf',_0x5b7870,'-C',_0x3a1043],{'label':_0x37a52f(0x27b)+_0x235843[_0x37a52f(0x253)]}),await removePathWithRetries(_0x5e3053[_0x37a52f(0x17d)+_0x37a52f(0x23d)+'ir']),await rename(join(_0x3a1043,_0x37a52f(0x2e5)),_0x5e3053[_0x37a52f(0x17d)+_0x37a52f(0x23d)+'ir']),await removePathWithRetries(_0x3a1043),await runProcess(_0x5e3053[_0x37a52f(0x255)+'utable'],[_0x5e3053['npmCli'],'install',_0x37a52f(0x29c)+'ev',_0x37a52f(0x1b3)+_0x37a52f(0x2f3),_0x37a52f(0x270)+'it',_0x37a52f(0x219)+'d',_0x37a52f(0x348)+_0x37a52f(0x1c2)+'ps'],{'cwd':_0x5e3053[_0x37a52f(0x17d)+_0x37a52f(0x23d)+'ir'],'env':_0x102311,'label':_0x37a52f(0x24c)+_0x37a52f(0x32c)+_0x460057+(_0x37a52f(0x2d6)+'\x20depende'+_0x37a52f(0x1a8))});if(!existsSync(_0x5e3053[_0x37a52f(0x17d)+_0x37a52f(0x1c6)]))throw new Error(_0x37a52f(0x322)+'\x20bin\x20was'+_0x37a52f(0x350)+_0x37a52f(0x35e)+'\x20install'+':\x20'+_0x5e3053[_0x37a52f(0x17d)+_0x37a52f(0x1c6)]);}async function ensureRuntimeBase(_0xce9411,_0x11ab48,_0x318371={}){const _0x144b11=_0x38e6be;await mkdir(_0x11ab48,{'recursive':!![]});let _0xafde3=await readRuntimeManifest(_0x11ab48);const _0x33b363=_0xce9411[_0x144b11(0x17d)][_0x144b11(0x2b1)+_0x144b11(0x196)],_0x571353=_0xce9411[_0x144b11(0x17d)]['openclaw'+_0x144b11(0x34e)],_0x4b910c=existsSync(resolveManifestPath(_0x11ab48)),_0x241c05=runtimeHasRequiredPaths(_0x11ab48,_0xafde3),_0x2eda49=_0xafde3[_0x144b11(0x2b1)+_0x144b11(0x196)]===_0x33b363;!_0x4b910c||!_0x241c05||!_0x2eda49?(_0x318371[_0x144b11(0x265)+'ogger']?.[_0x144b11(0x204)](_0x144b11(0x28f)+_0x144b11(0x28c)+'ld\x20start'+'ed',{'runtimeRoot':_0x11ab48,'reason':!_0x4b910c?_0x144b11(0x1fd)+'manifest':!_0x241c05?_0x144b11(0x1fd)+_0x144b11(0x238)+_0x144b11(0x2d6)+_0x144b11(0x1d7):_0x144b11(0x212)+_0x144b11(0x2bf)+'match','syncOnly':_0x318371[_0x144b11(0x229)]}),_0xafde3=await buildRuntimeBase(_0xce9411,_0x11ab48,_0xafde3),_0x318371[_0x144b11(0x265)+'ogger']?.[_0x144b11(0x204)](_0x144b11(0x28f)+_0x144b11(0x28c)+'ld\x20compl'+_0x144b11(0x334),{'manifest':summarizeRuntimeManifest(_0xafde3)})):_0x318371[_0x144b11(0x265)+_0x144b11(0x294)]?.[_0x144b11(0x204)](_0x144b11(0x28f)+_0x144b11(0x17b)+_0x144b11(0x250)+_0x144b11(0x230),{'manifest':summarizeRuntimeManifest(_0xafde3)});if(!existsSync(resolve(_0x11ab48,_0xafde3[_0x144b11(0x17d)+_0x144b11(0x1c6)]))){const _0x4061a8=createRuntimeInfoFromManifest(_0x11ab48,_0xafde3,{'allowMissingOpenClaw':!![]});await installOpenClawPackage(_0x4061a8,_0x571353),_0xafde3['openclaw'+_0x144b11(0x34e)]=_0x571353;}return _0xafde3;}function runtimeHasRequiredPaths(_0x383cf9,_0x10c555){const _0x585874=_0x38e6be;return[_0x585874(0x255)+_0x585874(0x1ba),_0x585874(0x372),_0x585874(0x17d)+_0x585874(0x23d)+'ir','openclaw'+'Bin'][_0x585874(0x349)](_0x26d819=>typeof _0x10c555[_0x26d819]==='string'&&_0x10c555[_0x26d819][_0x585874(0x339)]())&&[_0x585874(0x255)+_0x585874(0x1ba),'npmCli'][_0x585874(0x349)](_0x2693bd=>existsSync(resolve(_0x383cf9,_0x10c555[_0x2693bd])));}async function buildRuntimeBase(_0x453ddb,_0x128762,_0x11aaf6={}){const _0x2d82d4=_0x38e6be,_0x2d0cfd=join(_0x128762,_0x2d82d4(0x193));await ensureRuntimeNode(_0x453ddb,_0x2d0cfd);const _0x28c572={..._0x11aaf6,'generatedAt':new Date()[_0x2d82d4(0x2d3)+'ing'](),'nodeVersion':_0x453ddb[_0x2d82d4(0x17d)][_0x2d82d4(0x2b1)+_0x2d82d4(0x196)],'openclawVersion':_0x11aaf6['openclaw'+_0x2d82d4(0x34e)]||'','platform':process['platform'],'arch':process[_0x2d82d4(0x1b5)],'nodeExecutable':'node/bin'+_0x2d82d4(0x214),'npmCli':_0x2d82d4(0x2a6)+'/node_mo'+_0x2d82d4(0x180)+_0x2d82d4(0x1af)+_0x2d82d4(0x291),'openclawWorkingDir':'openclaw','openclawBin':_0x2d82d4(0x17d)+_0x2d82d4(0x33e)+_0x2d82d4(0x18e)};return await writeJson(resolveManifestPath(_0x128762),_0x28c572),_0x28c572;}async function removePathWithRetries(_0x3b847f){await rm(_0x3b847f,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96});}async function ensureRuntimeNode(_0x4cbb1c,_0x27b31f){const _0x3433b4=_0x38e6be,_0x4b091b=_0x4cbb1c[_0x3433b4(0x17d)]['nodeVers'+_0x3433b4(0x196)],_0x19abd9=join(_0x27b31f,'bin',_0x3433b4(0x193)),_0x4bf057=join(_0x27b31f,'lib',_0x3433b4(0x329)+'ules',_0x3433b4(0x318),_0x3433b4(0x1c9),'npm-cli.'+'js');if(existsSync(_0x19abd9)&&existsSync(_0x4bf057)&&await getNodeVersion(_0x19abd9)===_0x4b091b)return;await removePathWithRetries(_0x27b31f);if(process[_0x3433b4(0x1bf)][_0x3433b4(0x193)]===_0x4b091b){await linkCurrentNodeRuntime(_0x27b31f);return;}await downloadNodeRuntime(_0x4b091b,_0x27b31f);}async function getNodeVersion(_0x486f75){const _0x5a39e5=_0x38e6be;try{const _0xb02576=await runProcess(_0x486f75,['-p','process.'+_0x5a39e5(0x1bf)+_0x5a39e5(0x242)],{'label':_0x486f75+_0x5a39e5(0x1d8),'timeoutMs':0x7530});return _0xb02576['stdout'][_0x5a39e5(0x339)]();}catch{return'';}}async function linkCurrentNodeRuntime(_0x302a9e){const _0x12f54b=_0x38e6be,_0x37131c=process[_0x12f54b(0x2ac)],_0x51719d=resolve(dirname(_0x37131c),'..'),_0x4ea42d=resolve(_0x51719d,_0x12f54b(0x20a)+_0x12f54b(0x37e)+_0x12f54b(0x328)),_0x24fe95=join(_0x302a9e,_0x12f54b(0x1c9),_0x12f54b(0x193)),_0x1a690d=join(_0x302a9e,_0x12f54b(0x2f8),'node_mod'+_0x12f54b(0x1fc),'npm');await mkdir(dirname(_0x24fe95),{'recursive':!![]}),await mkdir(dirname(_0x1a690d),{'recursive':!![]}),await symlink(_0x37131c,_0x24fe95),existsSync(_0x4ea42d)?await symlink(_0x4ea42d,_0x1a690d):await symlink(await resolveNpmRoot(),_0x1a690d);}function _0x21fa(){const _0x208dc0=['keys','-extract','in\x20insta','href','404148xKjFhZ','go.mjs','.npmmirr','endencie','.tools','statusCo','isFile','sessions','projectR','\x20paths','\x20version','npm\x20root','solver\x20n','lite\x20pat','#!/bin/s','replace','plugin\x20s','\x22\x20%*','nel\x20plug','llPaths','jie-shel','extract-','cies','state-','\x20set\x20\x22OP','tory\x20pro','s\x20not\x20fo','NCLAW_ST','close','runtime','name','set\x20\x22SCR',';\x20run\x20wu','\x20failed\x20','CRIPT_DI','ugin\x20dep','octor\x20--','patch\x20al','ipped;\x20d','\x20\x22OPENCL','ginPaths','\x20-z\x20\x22$WU','\x22\x20\x22$SCRI','warn','chat\x20his','\x20complet','ules','missing\x20','\x20signal=','timeoutM','wujie-lo','synced','agentSco','leName','info','ing\x20\x22','utf8','claw-run','installP','prepare\x20','lib/node','startsWi','\x20configu','ted','rs;\x20veri','333036bvaUmi','npm-cach','oot','node\x20ver','with\x20the','/node','LocalAge','x64','CONFIG_F','\x20local\x20p','--no-fun','%USERPRO','tory\x20mix','pipe','.json','ced','wnloadin','.opencla','er\x20writt','eady\x20app','w-extrac','tar.xz','ite\x20patc','if\x20[\x20-t\x20','skill','ist\x20not\x20','syncOnly','\x20return\x20','patch\x20fo','NCLAW_HO','\x20can\x20be\x20','data','manifest','rent','st\x20not\x20f','t\x20\x22OPENC','\x20loaded','pped;\x20ru','appId','_shared','ibility\x20','required','untime\x20p','NCLAW_CO','ed-tool\x20','optional','WorkingD','all\x20loca','R=\x22${OPE','config=','node-v','.node','o.mjs\x22\x202','ady\x20curr','skills','time]\x20fe','channel-','w.cmd','\x20and\x20','.js','tall\x20the','npm\x20inst','FIG_FILE','error','ut\x20after','eady\x20cur','d\x20an\x20inv','e\x20tools\x20','filename','_HOME:-','nodeExec','headers','configFi','fix\x20comp','ader\x20not','h\x20applie','spec','r\x20runtim','IPT_DIR=','4924215kLSinh','Invalid\x20','platform','dataDirN','includes','indexOf','pec:\x20','runtimeL','sets/wuj','now','me\x20missi','dist','dge.mjs','red\x20Open','resume','_NAME:-','tool\x20his','JSON:\x20','--no-aud','or.com','time]\x20ru','s\x20instal','HOME=\x22${','replaceA','ad\x20patch','install','path','%~dp0\x22','join','extract\x20','und:\x20','runtimeS','fix','set\x20\x22OPE','ream\x20fix','y:\x20','1062442gtaSEC','ATH:-','ENCLAW_H','1\x20]\x20&&\x20[','\x20written','annel\x20en','index.mj','local:','120npNFfS','\x20already','base\x20bui','filter','win32','runtime\x20','ame','m-cli.js','with\x20cod','stderr','ogger','6\x20mixed\x20','\x20kdocs\x20s','split','dencies','&&\x20pwd)','ATE_DIR%','slice','--omit=d','NFIG_PAT','tar','wujieai.','hell:run','registry','\x20\x20\x22$SCRI','-xzf','dAt','tools\x20sy','node/lib','ATH=\x20cd\x20','prepareP','aw\x202026.','version','ath','execPath','map','package.','nced','jection\x20','nodeVers','=\x22${OPEN','NFIG_FIL','cwd','OPENCLAW','H%\x22==\x22\x22\x20','$HOME/','stdout','bridge.m','time-too','time]\x20do','\x20on\x20futu','ell-runt','jection-','sion\x20mis','LocalPlu','y\x20compat','\x20did\x20not','_DIR%','plugins\x20','atch\x20ski','Unable\x20t','CONFIG_P','ntPaths','empty\x20pl','\x20id\x20from','integrit','10sgQSmQ','env','?t=','PT_DIR/','==\x22\x22\x20set','productN','all\x20plug','toISOStr','local\x20pl','isArray','\x20runtime','\x20product','fy\x20upstr','product','ot\x20found','\x20doctor\x20','catch','scripts','341560oYfxVE','object','PENCLAW_','dependen','ll\x20prepa','configPa','zip','package','ujie-log','has','l\x20plugin','allowMis','ed\x20OpenC','wujiecla','export\x20O','plugin\x20r','configur','led','scoped\x20s','re\x22\x20to\x20r','st\x20be\x20a\x20','eer','store-','ATE_DIR:','npm\x20pack','e\x20upgrad','lib','label','eam\x20fix\x20','ed\x20npm\x20p','null','started','@echo\x20of','failed','string','ify\x20upst','devDepen','reason','json','OME=','if\x20\x22%OPE','alid\x20pay','fix\x20alre','wBin','not\x20foun','ntime','connecto','channel\x20','skipped;','nnel','https://','\x20prepare','agents','ion\x20mism','singOpen','flush','\x20applied','Spec','npm','lugin\x20de','length','../../as','ile\x20not\x20','\x20started','ynced','lugin\x20','\x22\x20so\x20the','ipped;\x20f','OpenClaw','ie-logo.','roductRu','\x22\x20\x22%SCRI','\x22\x20\x22$@\x22','kill\x20not','/npm','node_mod','859747kYJUzn','endsWith','all\x20','d:\x20','time','r\x20OpenCl','leted','8yWrndR','patched','sion.','eted','chat-dis','in\x20runti','ed;\x20brid','\x20-g','trim','E_DIR=','rname\x20--','\x20path\x20mu','lark-cli','/opencla','runtime-','product\x20','already-','es.','\x20create\x20','des.','location','6.6\x20chan','[wujie-s','--legacy','every','d\x20for\x20lo','\x20returne','6858990JiWBoS','shell-ru','Version','\x20\x22$0\x22)\x22\x20','\x20not\x20fou','source','doctor','function','nodejs.o','.\x20Run\x20\x22w','\x22%SCRIPT','cal\x20runt','\x20validat','pluginId','tarball:','pendenci','bug;\x20ver','es\x20','nd\x20after','unknown','red','-xJf','penClaw\x20','ntimeCha','play-pro','runtime:','tateDir','exec\x20\x22$S','ge\x20not\x20a','.tmp/run','fix\x20mark','isDirect','npm-cli.','some','extensio','lled','values','\x20found','npmCli','ujie-she','unction\x20','in\x20','--\x20\x22$(di','\x20entry\x20\x22','root','tching\x20p','agents\x20s','Dependen','runtimeR','pped;\x20di','_modules','@larksui','-doctor.','ugin\x20spe','pluginSp','cli','atch\x20alr','--json','base\x20alr','ing','openclaw','session\x20','d\x20to\x20','dules/np','ent','ad-','entryCou','ntime\x20re','mjs','>/dev/nu','--fix','\x20resolve','idated','.plugin-','ound','createRu','g\x20from\x20O','w.mjs','time]\x20in',',\x20shell.','lied','\x20timed\x20o','node','nifest=','add','ion','Run\x20\x22wuj','Configur','ie-shell','download','stalling','Name','Claw\x20ver','store\x20sq','STATE_DI','find','\x20can\x20ins','ready\x20ap','FILE%\x5c','toString','Claw','store\x20lo','el.inbou','ncies','generate','ecs','director','\x20install','store\x20wr','st=','m/bin/np','pped;\x20lo','push','ime/sess','--omit=p','store-lo','arch','../../sh','plied','\x22==\x22\x22\x20se','kill','utable','found','log','.cache','plugins','versions','local','resolved','-peer-de','\x20package','LocalSki','load:\x20','Bin','SIGTERM','enclaw\x20d','bin'];_0x21fa=function(){return _0x208dc0;};return _0x21fa();}async function resolveNpmRoot(){const _0x290707=_0x38e6be,_0x5db604=await runProcess(_0x290707(0x318),[_0x290707(0x378),'-g'],{'label':_0x290707(0x1d9)+_0x290707(0x338),'timeoutMs':0x7530}),_0x4ae1e5=join(_0x5db604[_0x290707(0x2b8)][_0x290707(0x339)](),_0x290707(0x318));if(!existsSync(join(_0x4ae1e5,_0x290707(0x1c9),_0x290707(0x36c)+'js')))throw new Error(_0x290707(0x2f6)+'age\x20was\x20'+'not\x20foun'+_0x290707(0x34a)+_0x290707(0x357)+'ime\x20buil'+_0x290707(0x32d)+_0x4ae1e5);return _0x4ae1e5;}async function downloadNodeRuntime(_0x4a36c1,_0x228edb){const _0x49182f=_0x38e6be,_0x3327a3=process[_0x49182f(0x260)]==='win32'?'win':process['platform'],_0x234b4b=process[_0x49182f(0x1b5)]===_0x49182f(0x216)?_0x49182f(0x216):process[_0x49182f(0x1b5)]==='arm64'?'arm64':process[_0x49182f(0x1b5)],_0x3bb539=process['platform']===_0x49182f(0x28e)?_0x49182f(0x2e4):_0x49182f(0x224),_0x4c8eb6=_0x49182f(0x241)+_0x4a36c1+'-'+_0x3327a3+'-'+_0x234b4b,_0x49adf5=_0x4c8eb6+'.'+_0x3bb539,_0x2af144=join(dirname(_0x228edb),_0x49182f(0x1bd)),_0x20d65d=join(_0x2af144,_0x49adf5),_0x3fadd2=join(_0x2af144,_0x4c8eb6+(_0x49182f(0x1cb)+'-')+process['pid']+'-'+Date[_0x49182f(0x267)]()),_0x1afac6=_0x49182f(0x310)+_0x49182f(0x354)+'rg/dist/'+'v'+_0x4a36c1+'/'+_0x49adf5;await mkdir(_0x2af144,{'recursive':!![]}),!existsSync(_0x20d65d)&&(console[_0x49182f(0x1bc)](_0x49182f(0x347)+_0x49182f(0x2a0)+_0x49182f(0x2bb)+_0x49182f(0x21f)+'g\x20'+_0x1afac6),await downloadFile(_0x1afac6,_0x20d65d)),await rm(_0x3fadd2,{'recursive':!![],'force':!![]}),await mkdir(_0x3fadd2,{'recursive':!![]}),process[_0x49182f(0x260)]==='win32'?await runProcess('unzip',['-q',_0x20d65d,'-d',_0x3fadd2],{'label':_0x49182f(0x27b)+_0x49adf5}):await runProcess(_0x49182f(0x29e),[_0x49182f(0x361),_0x20d65d,'-C',_0x3fadd2],{'label':_0x49182f(0x27b)+_0x49adf5}),await rename(join(_0x3fadd2,_0x4c8eb6),_0x228edb),await rm(_0x3fadd2,{'recursive':!![],'force':!![]});}async function downloadFile(_0x93912e,_0x1603b7){await mkdir(dirname(_0x1603b7),{'recursive':!![]});const _0x268af6=await new Promise((_0x5f4333,_0x2436e0)=>{get(_0x93912e,_0x25a0e1=>{const _0x3baebd=_0xfe4b;if(_0x25a0e1[_0x3baebd(0x1d3)+'de']>=0x12c&&_0x25a0e1[_0x3baebd(0x1d3)+'de']<0x190&&_0x25a0e1[_0x3baebd(0x256)]['location']){_0x25a0e1[_0x3baebd(0x26c)](),downloadFile(new URL(_0x25a0e1[_0x3baebd(0x256)][_0x3baebd(0x345)],_0x93912e)[_0x3baebd(0x1cd)],_0x1603b7)['then'](()=>_0x5f4333(null))['catch'](_0x2436e0);return;}if(_0x25a0e1[_0x3baebd(0x1d3)+'de']!==0xc8){_0x25a0e1[_0x3baebd(0x26c)](),_0x2436e0(new Error(_0x3baebd(0x19a)+_0x3baebd(0x1ef)+_0x25a0e1[_0x3baebd(0x1d3)+'de']+':\x20'+_0x93912e));return;}_0x5f4333(_0x25a0e1);})['on']('error',_0x2436e0);});_0x268af6&&await pipeline(_0x268af6,createWriteStream(_0x1603b7));}export async function ensureOpenClawDoctorFixed(_0x23f52c,_0x503b65={}){const _0x47503c=_0x38e6be,_0x1f8029=await loadRuntimeInfo(_0x23f52c[_0x47503c(0x1d6)+_0x47503c(0x211)]),_0x3e56d7=getConfigPaths(_0x23f52c),_0x17c976=join(_0x3e56d7[_0x47503c(0x27d)+_0x47503c(0x366)],_0x47503c(0x17d)+_0x47503c(0x175)+_0x47503c(0x304)),_0x73d80e=await readJson(_0x17c976,{});if(_0x73d80e[_0x47503c(0x17d)+_0x47503c(0x34e)]===_0x1f8029[_0x47503c(0x17d)+_0x47503c(0x34e)])return _0x503b65[_0x47503c(0x265)+_0x47503c(0x294)]?.[_0x47503c(0x204)]('openclaw'+_0x47503c(0x2db)+_0x47503c(0x308)+_0x47503c(0x244)+_0x47503c(0x181),{'openclawVersion':_0x1f8029[_0x47503c(0x17d)+'Version'],'markerPath':_0x17c976}),{'ran':![],'openclawVersion':_0x1f8029[_0x47503c(0x17d)+_0x47503c(0x34e)],'markerPath':_0x17c976};return await runOpenClawDoctorFix(_0x23f52c,_0x1f8029,{'fromVersion':_0x73d80e[_0x47503c(0x17d)+_0x47503c(0x34e)]||_0x47503c(0x35f),'toVersion':_0x1f8029[_0x47503c(0x17d)+_0x47503c(0x34e)],'markerPath':_0x17c976,'runtimeLogger':_0x503b65['runtimeL'+_0x47503c(0x294)]}),{'ran':!![],'openclawVersion':_0x1f8029[_0x47503c(0x17d)+_0x47503c(0x34e)],'markerPath':_0x17c976};}async function runOpenClawDoctorFix(_0x3d7622,_0x11156d,{fromVersion:_0x1aa05c,toVersion:_0x2906f6,markerPath:markerPath='',runtimeLogger:_0x573c83}={}){const _0xf4d6c5=_0x38e6be;_0x573c83?.[_0xf4d6c5(0x204)](_0xf4d6c5(0x17d)+_0xf4d6c5(0x2db)+'fix\x20star'+_0xf4d6c5(0x20d),{'fromVersion':_0x1aa05c,'toVersion':_0x2906f6});const _0x2531ff=await createRuntimeEnv(_0x11156d,{'OPENCLAW_HOME':_0x3d7622['dataDir'],'OPENCLAW_STATE_DIR':_0x3d7622['dataDir'],'OPENCLAW_CONFIG_PATH':getConfigPaths(_0x3d7622)[_0xf4d6c5(0x2e3)+'th']});console[_0xf4d6c5(0x1bc)](_0xf4d6c5(0x347)+_0xf4d6c5(0x2a0)+_0xf4d6c5(0x272)+'nning\x20op'+_0xf4d6c5(0x1c8)+_0xf4d6c5(0x1f2)+_0xf4d6c5(0x27e));const _0xd0f901=await runProcess(_0x11156d[_0xf4d6c5(0x255)+'utable'],[_0x11156d[_0xf4d6c5(0x17d)+_0xf4d6c5(0x1c6)],_0xf4d6c5(0x352),_0xf4d6c5(0x187)],{'cwd':_0x11156d['openclaw'+_0xf4d6c5(0x23d)+'ir'],'env':_0x2531ff,'label':_0xf4d6c5(0x17d)+'\x20doctor\x20'+_0xf4d6c5(0x187),'timeoutMs':0x1d4c0});_0x573c83?.[_0xf4d6c5(0x204)](_0xf4d6c5(0x17d)+_0xf4d6c5(0x2db)+_0xf4d6c5(0x258)+_0xf4d6c5(0x330),{'fromVersion':_0x1aa05c,'toVersion':_0x2906f6,'stdout':_0xd0f901[_0xf4d6c5(0x2b8)][_0xf4d6c5(0x339)]()[_0xf4d6c5(0x29b)](-0xfa0),'stderr':_0xd0f901[_0xf4d6c5(0x293)]['trim']()[_0xf4d6c5(0x29b)](-0xfa0)}),markerPath&&(await writeJson(markerPath,{'openclawVersion':_0x11156d[_0xf4d6c5(0x17d)+_0xf4d6c5(0x34e)],'fixedAt':new Date()[_0xf4d6c5(0x2d3)+_0xf4d6c5(0x17c)]()}),_0x573c83?.[_0xf4d6c5(0x204)]('openclaw'+_0xf4d6c5(0x2db)+_0xf4d6c5(0x36a)+_0xf4d6c5(0x221)+'en',{'markerPath':markerPath,'openclawVersion':_0x11156d[_0xf4d6c5(0x17d)+'Version']}));}export async function readRuntimeManifest(_0x3f8880){return await readJson(resolveManifestPath(_0x3f8880),{});}export async function loadRuntimeInfo(_0x107700){const _0x829341=resolveRuntimeRoot(_0x107700),_0x327e99=await readRuntimeManifest(_0x829341);return createRuntimeInfoFromManifest(_0x829341,_0x327e99);}function createRuntimeInfoFromManifest(_0x85b8b8,_0xc18396,_0x5ee6a5={}){const _0x2838e6=_0x38e6be;for(const _0x20a6ce of[_0x2838e6(0x255)+'utable',_0x2838e6(0x372),'openclaw'+_0x2838e6(0x23d)+'ir',_0x2838e6(0x17d)+'Bin']){if(typeof _0xc18396[_0x20a6ce]!==_0x2838e6(0x300)||!_0xc18396[_0x20a6ce][_0x2838e6(0x339)]())throw new Error(_0x2838e6(0x28f)+'manifest'+'\x20is\x20miss'+_0x2838e6(0x205)+_0x20a6ce+'\x22\x20at\x20'+resolveManifestPath(_0x85b8b8)+(_0x2838e6(0x1ee)+_0x2838e6(0x1e2)+'l\x20prepar'+'e'));}const _0x5282ec=resolve(_0x85b8b8,_0xc18396[_0x2838e6(0x255)+_0x2838e6(0x1ba)]),_0x21474b=resolve(_0x85b8b8,_0xc18396['npmCli']),_0x1ecf02=resolve(_0x85b8b8,_0xc18396[_0x2838e6(0x17d)+'WorkingD'+'ir']),_0x11991e=resolve(_0x85b8b8,_0xc18396['openclaw'+_0x2838e6(0x1c6)]),_0x3cc6e6=Array[_0x2838e6(0x2d5)](_0xc18396[_0x2838e6(0x1be)])?_0xc18396[_0x2838e6(0x1be)][_0x2838e6(0x2ad)](_0x2eab23=>({..._0x2eab23,'installPath':resolve(_0x85b8b8,_0x2eab23[_0x2838e6(0x208)+_0x2838e6(0x2ab)])})):[],_0x43f11f=_0x5ee6a5[_0x2838e6(0x2e9)+_0x2838e6(0x314)+_0x2838e6(0x1a5)]?[_0x5282ec,_0x21474b]:[_0x5282ec,_0x21474b,_0x1ecf02,_0x11991e];for(const _0x19b5aa of _0x43f11f){if(!existsSync(_0x19b5aa))throw new Error(_0x2838e6(0x28f)+'missing\x20'+'path:\x20'+_0x19b5aa);}return{'runtimeRoot':_0x85b8b8,'manifest':_0xc18396,'openclawVersion':_0xc18396[_0x2838e6(0x17d)+_0x2838e6(0x34e)]||_0x2838e6(0x35f),'nodeExecutable':_0x5282ec,'npmCli':_0x21474b,'openclawWorkingDir':_0x1ecf02,'openclawBin':_0x11991e,'plugins':_0x3cc6e6};}export async function spawnClaw(_0x4f4b9a,_0x4db3ad=[],_0x5d83e1={}){const _0x36a11c=_0x38e6be,_0x1b73f4=await loadRuntimeInfo(_0x4f4b9a),_0x3b82f5=await createRuntimeEnv(_0x1b73f4,_0x5d83e1[_0x36a11c(0x2cd)]??{});return spawn(_0x1b73f4[_0x36a11c(0x255)+_0x36a11c(0x1ba)],[_0x1b73f4[_0x36a11c(0x17d)+'Bin'],..._0x4db3ad],{'cwd':_0x1b73f4[_0x36a11c(0x17d)+_0x36a11c(0x23d)+'ir'],'stdio':'pipe',..._0x5d83e1,'env':_0x3b82f5});}export async function runClawOnce(_0x256b7c,_0x5c8cc3=[],_0x30abcd=0x15f90){const _0x12e33a=await spawnClaw(_0x256b7c,_0x5c8cc3);return await new Promise((_0x374e05,_0x4f92d0)=>{const _0x48dbf2=_0xfe4b;let _0x9f2622='',_0x4ca82e='',_0xf74d87=![];const _0x2caeb3=setTimeout(()=>{const _0x4eb296=_0xfe4b;if(_0xf74d87)return;_0xf74d87=!![],_0x12e33a[_0x4eb296(0x1b9)](_0x4eb296(0x1c7)),_0x4f92d0(new Error(_0x4eb296(0x17d)+_0x4eb296(0x192)+_0x4eb296(0x24f)+'\x20'+_0x30abcd+'ms'));},_0x30abcd);_0x12e33a[_0x48dbf2(0x2b8)]['on'](_0x48dbf2(0x22e),_0x5cedea=>{const _0x51a9d8=_0x48dbf2;_0x9f2622+=_0x5cedea[_0x51a9d8(0x1a4)]();}),_0x12e33a['stderr']['on']('data',_0x4f44b8=>{_0x4ca82e+=_0x4f44b8['toString']();}),_0x12e33a['on'](_0x48dbf2(0x24e),_0x2b4c2b=>{if(_0xf74d87)return;_0xf74d87=!![],clearTimeout(_0x2caeb3),_0x4f92d0(_0x2b4c2b);}),_0x12e33a['on'](_0x48dbf2(0x1ea),(_0x182bd8,_0x206ebf)=>{if(_0xf74d87)return;_0xf74d87=!![],clearTimeout(_0x2caeb3),_0x374e05({'code':_0x182bd8,'signal':_0x206ebf,'stdout':_0x9f2622,'stderr':_0x4ca82e});});});}async function findRuntimeLarkCliBin(_0x2a149a){const _0x5ab238=_0x38e6be,_0x2ae723=join(_0x2a149a[_0x5ab238(0x17d)+_0x5ab238(0x23d)+'ir'],'node_mod'+_0x5ab238(0x1fc),'@larksui'+'te',_0x5ab238(0x178)),_0x2d30c2=join(_0x2ae723,'package.'+_0x5ab238(0x304));if(!existsSync(_0x2d30c2))return{'packageDir':_0x2ae723,'binPath':null};try{const _0x40c781=JSON['parse'](await readFile(_0x2d30c2,_0x5ab238(0x206))),_0x5a461c=typeof _0x40c781[_0x5ab238(0x1c9)]===_0x5ab238(0x300)?_0x40c781[_0x5ab238(0x1c9)]:_0x40c781['bin']&&typeof _0x40c781['bin']===_0x5ab238(0x2df)?_0x40c781[_0x5ab238(0x1c9)][_0x5ab238(0x33d)]||Object[_0x5ab238(0x370)](_0x40c781[_0x5ab238(0x1c9)])[0x0]:'';return{'packageDir':_0x2ae723,'binPath':_0x5a461c?join(_0x2ae723,_0x5a461c):null};}catch{return{'packageDir':_0x2ae723,'binPath':null};}}export async function resolveRuntimeLarkCliCommand(_0x456852){const _0x55a9a3=_0x38e6be,{packageDir:_0x5adeb6,binPath:_0x2ca891}=await findRuntimeLarkCliBin(_0x456852);if(!_0x2ca891||!existsSync(_0x2ca891))throw new Error('Bundled\x20'+_0x55a9a3(0x37f)+'te/cli\x20i'+'s\x20missin'+_0x55a9a3(0x18d)+_0x55a9a3(0x362)+_0x55a9a3(0x365)+'\x20'+_0x5adeb6+(_0x55a9a3(0x355)+_0x55a9a3(0x373)+_0x55a9a3(0x2e2)+_0x55a9a3(0x2f1)+'ebuild\x20t'+'he\x20runti'+'me.'));return{'nodeExecutable':_0x456852[_0x55a9a3(0x255)+_0x55a9a3(0x1ba)],'scriptPath':_0x2ca891,'packageDir':_0x5adeb6};}function resolvePackageNameFromNpmSpec(_0x44512a){const _0x2f53df=_0x38e6be,_0x3d4d9e=_0x44512a['trim']()[_0x2f53df(0x1dd)](/^npm:/,'');if(!_0x3d4d9e)throw new Error(_0x2f53df(0x25f)+_0x2f53df(0x2c9)+_0x2f53df(0x176)+'c');if(_0x3d4d9e['startsWi'+'th']('@')){const _0x541f2d=_0x3d4d9e[_0x2f53df(0x263)]('/');if(_0x541f2d===-0x1)throw new Error(_0x2f53df(0x25f)+_0x2f53df(0x2f0)+_0x2f53df(0x264)+_0x44512a);const _0x192ff5=_0x3d4d9e[_0x2f53df(0x263)]('@',_0x541f2d+0x1);return _0x192ff5===-0x1?_0x3d4d9e:_0x3d4d9e[_0x2f53df(0x29b)](0x0,_0x192ff5);}const _0x1279e2=_0x3d4d9e[_0x2f53df(0x263)]('@');return _0x1279e2===-0x1?_0x3d4d9e:_0x3d4d9e['slice'](0x0,_0x1279e2);}async function createRuntimeEnv(_0x4fa740,_0x219ed5={}){const _0x396f88=_0x38e6be,_0x12cc27=process.env.OPENCLAW_STATE_DIR||'',_0xbbf866=process.env.NPM_CONFIG_REGISTRY||'https://'+_0x396f88(0x2a1)+_0x396f88(0x1d0)+_0x396f88(0x271),_0x5a6692=_0x12cc27?join(_0x12cc27,_0x396f88(0x207)+_0x396f88(0x2ba)+'ls'):join(_0x4fa740['runtimeR'+'oot'],_0x396f88(0x1d2)),_0x4a39f3=join(_0x5a6692,'npm-glob'+'al'),_0x5b8196=join(_0x5a6692,_0x396f88(0x210)+'e'),_0x12cf82=join(_0x4a39f3,_0x396f88(0x1c9));await mkdir(_0x12cf82,{'recursive':!![]}),await mkdir(_0x5b8196,{'recursive':!![]});const _0x242871=[_0x12cf82,dirname(_0x4fa740[_0x396f88(0x255)+'utable']),process.env.PATH||''];return{...process.env,..._0x219ed5,'PATH':_0x242871[_0x396f88(0x28d)](Boolean)[_0x396f88(0x27a)](delimiter),'npm_config_prefix':_0x4a39f3,'NPM_CONFIG_PREFIX':_0x4a39f3,'npm_config_cache':_0x5b8196,'NPM_CONFIG_CACHE':_0x5b8196,'NPM_CONFIG_REGISTRY':_0xbbf866,'npm_execpath':_0x4fa740[_0x396f88(0x372)],'npm_node_execpath':_0x4fa740[_0x396f88(0x255)+'utable'],'OPENCLAW_RUNTIME_NPM_PREFIX':_0x4a39f3,'OPENCLAW_RUNTIME_NPM_BIN':_0x12cf82};}export async function getRuntimeSpawnContext(_0x3c40a3,_0x3f4046={}){const _0x33adb9=_0x38e6be,_0x26af19=await loadRuntimeInfo(_0x3c40a3),_0x3d42b4=await createRuntimeEnv(_0x26af19,_0x3f4046);return{'cwd':_0x26af19[_0x33adb9(0x17d)+_0x33adb9(0x23d)+'ir'],'env':_0x3d42b4,'runtime':_0x26af19};}function resolvePluginDirNameFromSpec(_0x4d0a5c){const _0x34ff7c=_0x38e6be,_0x29e1e7=resolvePackageNameFromNpmSpec(_0x4d0a5c),_0x12988d=_0x29e1e7[_0x34ff7c(0x297)]('/')[_0x34ff7c(0x28d)](Boolean),_0x4e0f1a=_0x12988d['at'](-0x1)??'';if(!_0x4e0f1a)throw new Error('Invalid\x20'+_0x34ff7c(0x1de)+_0x34ff7c(0x264)+_0x4d0a5c);return _0x4e0f1a;}async function resolvePluginIdFromPackageDir(_0x3f0063,_0x224d58){const _0x56598c=_0x38e6be,_0x3e4373=await readJson(join(_0x3f0063,_0x56598c(0x2ae)+_0x56598c(0x304)),{}),_0x291e27=await readPluginManifest(_0x3f0063),_0x4f0681=[_0x291e27?.['id'],_0x291e27?.['pluginId'],_0x291e27?.['name'],_0x3e4373?.[_0x56598c(0x17d)]?.['id'],_0x3e4373?.['openclaw'+'Id'],_0x224d58],_0x3a6b69=_0x4f0681[_0x56598c(0x1a0)](_0xc02630=>typeof _0xc02630==='string'&&_0xc02630['trim']());if(!_0x3a6b69)throw new Error(_0x56598c(0x2c6)+'o\x20resolv'+'e\x20plugin'+_0x56598c(0x2ca)+'\x20'+_0x3f0063);return _0x3a6b69[_0x56598c(0x339)]();}function pluginSpecMatches(_0x2db532,_0x35d2d9){const _0x26d0f3=_0x38e6be,_0x3f8498=_0x35d2d9[_0x26d0f3(0x339)](),_0x47e9f4=resolvePackageNameFromNpmSpec(_0x3f8498);return[_0x2db532[_0x26d0f3(0x25b)],_0x2db532[_0x26d0f3(0x1c1)+_0x26d0f3(0x317)],_0x2db532[_0x26d0f3(0x1c1)+_0x26d0f3(0x19c)]][_0x26d0f3(0x36d)](_0x43f77e=>_0x43f77e===_0x3f8498||_0x43f77e===_0x47e9f4);}async function installPluginFromNpmSpec(_0x5700d7,_0x11e72a,_0x2329dd={}){const _0x2b0bcf=_0x38e6be,_0x4136c9=_0x5700d7['trim']()['replace'](/^npm:/,''),_0x15321f=resolvePluginDirNameFromSpec(_0x4136c9),_0x1bf24b=join(_0x11e72a['openclaw'+_0x2b0bcf(0x23d)+'ir'],'dist',_0x2b0bcf(0x36e)+'ns'),_0x286d89=join(_0x1bf24b,_0x15321f),_0x3a998a=join(_0x11e72a[_0x2b0bcf(0x37c)+_0x2b0bcf(0x211)],_0x2b0bcf(0x18a)+_0x2b0bcf(0x1e3)+process['pid']+'-'+Date[_0x2b0bcf(0x267)]()),_0x596807=await createRuntimeEnv(_0x11e72a),_0x351d43=new Date()[_0x2b0bcf(0x2d3)+_0x2b0bcf(0x17c)](),_0x4312a0=join(_0x11e72a[_0x2b0bcf(0x37c)+_0x2b0bcf(0x211)],_0x2b0bcf(0x1bd));await mkdir(_0x4312a0,{'recursive':!![]}),await rm(_0x3a998a,{'recursive':!![],'force':!![]}),await rm(_0x286d89,{'recursive':!![],'force':!![]}),await mkdir(_0x3a998a,{'recursive':!![]}),await mkdir(_0x1bf24b,{'recursive':!![]}),console['log'](_0x2b0bcf(0x347)+_0x2b0bcf(0x2a0)+_0x2b0bcf(0x246)+_0x2b0bcf(0x379)+_0x2b0bcf(0x31f)+_0x4136c9);const _0x105d27=await runProcess(_0x11e72a[_0x2b0bcf(0x255)+_0x2b0bcf(0x1ba)],[_0x11e72a[_0x2b0bcf(0x372)],'pack',_0x4136c9,_0x2b0bcf(0x17a)],{'cwd':_0x4312a0,'env':_0x596807,'label':'npm\x20pack'+'\x20'+_0x4136c9}),_0x328ce3=parseNpmPackJson(_0x105d27[_0x2b0bcf(0x2b8)]),_0x394fe3=normalizePackedTarballFilename(_0x328ce3[_0x2b0bcf(0x253)]),_0x15186d=join(_0x4312a0,_0x394fe3);if(!existsSync(_0x15186d))throw new Error(_0x2b0bcf(0x2f6)+_0x2b0bcf(0x2c2)+_0x2b0bcf(0x343)+_0x2b0bcf(0x35a)+'\x20'+_0x15186d);await runProcess(_0x2b0bcf(0x29e),[_0x2b0bcf(0x2a3),_0x15186d,'-C',_0x3a998a],{'label':_0x2b0bcf(0x27b)+_0x394fe3}),await rename(join(_0x3a998a,_0x2b0bcf(0x2e5)),_0x286d89),await rm(_0x3a998a,{'recursive':!![],'force':!![]});const _0x28f323=join(_0x286d89,_0x2b0bcf(0x2ae)+_0x2b0bcf(0x304)),_0x3e16f8=await readJson(_0x28f323,{});(_0x3e16f8['devDepen'+'dencies']||_0x3e16f8[_0x2b0bcf(0x2dd)])&&(delete _0x3e16f8['devDepen'+_0x2b0bcf(0x298)],delete _0x3e16f8[_0x2b0bcf(0x2dd)],await writeJson(_0x28f323,_0x3e16f8));await runProcess(_0x11e72a[_0x2b0bcf(0x255)+_0x2b0bcf(0x1ba)],[_0x11e72a[_0x2b0bcf(0x372)],_0x2b0bcf(0x277),_0x2b0bcf(0x29c)+'ev',_0x2b0bcf(0x1b3)+_0x2b0bcf(0x2f3),_0x2b0bcf(0x270)+'it','--no-fun'+'d','--legacy'+_0x2b0bcf(0x1c2)+'ps'],{'cwd':_0x286d89,'env':_0x596807,'label':_0x2b0bcf(0x24c)+_0x2b0bcf(0x2d2)+_0x2b0bcf(0x375)+_0x4136c9});const _0x55f206=new Date()[_0x2b0bcf(0x2d3)+_0x2b0bcf(0x17c)](),_0x1e2472=await resolvePluginIdFromPackageDir(_0x286d89,_0x328ce3[_0x2b0bcf(0x1ec)]);return _0x2329dd[_0x2b0bcf(0x265)+_0x2b0bcf(0x294)]?.[_0x2b0bcf(0x204)]('npm\x20plug'+_0x2b0bcf(0x1cc)+_0x2b0bcf(0x36f),{'spec':_0x4136c9,'pluginId':_0x1e2472,'installPath':_0x286d89}),{'pluginId':_0x1e2472,'source':_0x2b0bcf(0x318),'spec':_0x4136c9,'installPath':toRuntimeRelative(_0x11e72a['runtimeR'+_0x2b0bcf(0x211)],_0x286d89),'version':_0x328ce3[_0x2b0bcf(0x2aa)],'resolvedName':_0x328ce3[_0x2b0bcf(0x1ec)],'resolvedVersion':_0x328ce3[_0x2b0bcf(0x2aa)],'resolvedSpec':_0x328ce3[_0x2b0bcf(0x1ec)]+'@'+_0x328ce3[_0x2b0bcf(0x2aa)],'integrity':typeof _0x328ce3['integrit'+'y']===_0x2b0bcf(0x300)?_0x328ce3[_0x2b0bcf(0x2cb)+'y']:'','shasum':typeof _0x328ce3['shasum']===_0x2b0bcf(0x300)?_0x328ce3['shasum']:'','resolvedAt':_0x351d43,'installedAt':_0x55f206};}async function syncConfiguredNpmPlugins(_0x4a7eb9,_0x5b0143,_0x229db5,_0x17c56e={}){const _0x2ffded=_0x38e6be;if(_0x17c56e['syncOnly'])return;const _0x358d2a=createRuntimeInfoFromManifest(_0x5b0143,_0x229db5),_0x4110f6=Array[_0x2ffded(0x2d5)](_0x229db5[_0x2ffded(0x1be)])?_0x229db5['plugins']:[],_0x546268=[];for(const _0x1cf69b of _0x4a7eb9[_0x2ffded(0x17d)][_0x2ffded(0x177)+'ecs']){const _0x233a32=_0x4110f6['find'](_0x219224=>_0x219224?.[_0x2ffded(0x351)]===_0x2ffded(0x318)&&pluginSpecMatches(_0x219224,_0x1cf69b)&&typeof _0x219224[_0x2ffded(0x208)+'ath']===_0x2ffded(0x300)&&existsSync(resolve(_0x5b0143,_0x219224[_0x2ffded(0x208)+_0x2ffded(0x2ab)])));if(_0x233a32){_0x546268[_0x2ffded(0x1b1)](_0x233a32);continue;}_0x546268[_0x2ffded(0x1b1)](await installPluginFromNpmSpec(_0x1cf69b,_0x358d2a,_0x17c56e));}const _0x4b28f7=new Set(_0x4a7eb9['openclaw']['pluginSp'+_0x2ffded(0x1aa)][_0x2ffded(0x2ad)](resolvePackageNameFromNpmSpec)),_0xb532af=_0x4110f6[_0x2ffded(0x28d)](_0x59258d=>_0x59258d?.[_0x2ffded(0x351)]!==_0x2ffded(0x318)||!_0x4b28f7[_0x2ffded(0x2e7)](resolvePackageNameFromNpmSpec(_0x59258d[_0x2ffded(0x1c1)+'Name']||_0x59258d[_0x2ffded(0x25b)]||'')));_0x229db5['plugins']=[..._0xb532af,..._0x546268];}function hasRuntimeDependencies(_0x154d5c){const _0x206318=_0x38e6be,_0x1904ec=_0x154d5c?.[_0x206318(0x2e1)+'cies']&&typeof _0x154d5c['dependen'+'cies']===_0x206318(0x2df)?Object[_0x206318(0x1ca)](_0x154d5c[_0x206318(0x2e1)+_0x206318(0x1e4)]):[],_0xaa7367=_0x154d5c?.[_0x206318(0x23c)+'Dependen'+_0x206318(0x1e4)]&&typeof _0x154d5c[_0x206318(0x23c)+_0x206318(0x37b)+_0x206318(0x1e4)]===_0x206318(0x2df)?Object[_0x206318(0x1ca)](_0x154d5c[_0x206318(0x23c)+_0x206318(0x37b)+_0x206318(0x1e4)]):[];return _0x1904ec['length']>0x0||_0xaa7367[_0x206318(0x31a)]>0x0;}async function installLocalPluginRuntimeDependencies(_0x4178f6,_0x136455,_0x5e74b0){const _0x2bafd6=_0x38e6be,_0x1a205f=join(_0x4178f6,'package.'+_0x2bafd6(0x304)),_0x17debc=await readJson(_0x1a205f,{});(_0x17debc[_0x2bafd6(0x302)+'dencies']||_0x17debc[_0x2bafd6(0x2dd)])&&(delete _0x17debc['devDepen'+'dencies'],delete _0x17debc[_0x2bafd6(0x2dd)],await writeJson(_0x1a205f,_0x17debc));if(!hasRuntimeDependencies(_0x17debc))return;const _0x3710a6=await createRuntimeEnv(_0x136455);console[_0x2bafd6(0x1bc)](_0x2bafd6(0x347)+_0x2bafd6(0x2a0)+_0x2bafd6(0x18f)+_0x2bafd6(0x19b)+_0x2bafd6(0x218)+_0x2bafd6(0x319)+_0x2bafd6(0x35b)+_0x2bafd6(0x35d)+_0x4178f6),await runProcess(_0x136455[_0x2bafd6(0x255)+_0x2bafd6(0x1ba)],[_0x136455[_0x2bafd6(0x372)],_0x2bafd6(0x277),_0x2bafd6(0x29c)+'ev',_0x2bafd6(0x1b3)+'eer',_0x2bafd6(0x270)+'it',_0x2bafd6(0x219)+'d',_0x2bafd6(0x348)+_0x2bafd6(0x1c2)+'ps'],{'cwd':_0x4178f6,'env':_0x3710a6,'label':_0x2bafd6(0x24c)+_0x2bafd6(0x23e)+_0x2bafd6(0x2e8)+'\x20'+_0x4178f6}),_0x5e74b0[_0x2bafd6(0x265)+_0x2bafd6(0x294)]?.[_0x2bafd6(0x204)](_0x2bafd6(0x2d4)+_0x2bafd6(0x1f1)+_0x2bafd6(0x1d1)+_0x2bafd6(0x273)+_0x2bafd6(0x2ef),{'installPath':_0x4178f6});}async function syncSharedPluginModules(_0x528388,_0x6f8b05){const _0x387d09=_0x38e6be,_0xcc65d6=new Set();for(const _0x355a28 of _0x528388){const _0x59f76f=join(dirname(_0x355a28),_0x387d09(0x236));if(existsSync(_0x59f76f))_0xcc65d6[_0x387d09(0x195)](_0x59f76f);}for(const _0xefdb26 of _0xcc65d6){await copyDirFresh(_0xefdb26,join(_0x6f8b05,_0x387d09(0x236)));}}async function syncProductPlugins(_0x99d4d,_0x48db4d,_0x366ef8,_0x2502af={}){const _0x273bee=_0x38e6be,_0x28bae0=join(_0x48db4d,_0x273bee(0x17d),_0x273bee(0x269),'extensio'+'ns'),_0x54abbc=createRuntimeInfoFromManifest(_0x48db4d,_0x366ef8),_0x59636a=[];await syncSharedPluginModules(_0x99d4d[_0x273bee(0x17d)][_0x273bee(0x1c1)+_0x273bee(0x2c0)+_0x273bee(0x1f6)],_0x28bae0);for(const _0xe6d025 of _0x99d4d[_0x273bee(0x17d)][_0x273bee(0x1c1)+_0x273bee(0x2c0)+_0x273bee(0x1f6)]){const _0x49b648=await getPackageMetadata(_0xe6d025),_0x2e6646=await readPluginManifest(_0xe6d025),_0x5571cc=join(_0x28bae0,_0x49b648[_0x273bee(0x359)]);await copyDirFresh(_0xe6d025,_0x5571cc),await installLocalPluginRuntimeDependencies(_0x5571cc,_0x54abbc,_0x2502af),_0x59636a['push']({'pluginId':_0x49b648[_0x273bee(0x359)],'source':'local','spec':_0x273bee(0x289)+_0xe6d025,'installPath':toRuntimeRelative(_0x48db4d,_0x5571cc),'version':_0x49b648['version'],'resolvedName':_0x49b648[_0x273bee(0x1ec)],'resolvedVersion':_0x49b648[_0x273bee(0x2aa)],'resolvedSpec':'local:'+_0xe6d025,'integrity':'','shasum':'','resolvedAt':new Date()[_0x273bee(0x2d3)+'ing'](),'installedAt':new Date()[_0x273bee(0x2d3)+_0x273bee(0x17c)](),'agentScope':_0x2e6646[_0x273bee(0x202)+'pe'],'skills':_0x2e6646[_0x273bee(0x245)]});}const _0x481a09=new Set(_0x59636a[_0x273bee(0x2ad)](_0x425cc9=>_0x425cc9[_0x273bee(0x359)])),_0x4a9e4f=Array[_0x273bee(0x2d5)](_0x366ef8[_0x273bee(0x1be)])?_0x366ef8[_0x273bee(0x1be)][_0x273bee(0x28d)](_0x461bb9=>!_0x481a09['has'](_0x461bb9[_0x273bee(0x359)])):[];_0x366ef8[_0x273bee(0x1be)]=[..._0x4a9e4f,..._0x59636a];}async function syncManifestPluginScope(_0x1a8245,_0x1ee2c1,_0x36535b){const _0x2c441e=_0x38e6be,_0x35dc15=join(_0x1ee2c1,'openclaw',_0x2c441e(0x269),_0x2c441e(0x36e)+'ns'),_0x21abe1=new Set(_0x1a8245['openclaw'][_0x2c441e(0x177)+'ecs']??[]),_0x5d52f9=new Set([..._0x21abe1][_0x2c441e(0x2ad)](_0x398d5d=>_0x398d5d[_0x2c441e(0x1dd)](/^npm:/,''))[_0x2c441e(0x2ad)](_0x295e4c=>{const _0x317043=_0x2c441e;if(_0x295e4c[_0x317043(0x20b)+'th']('@')){const _0x5c0175=_0x295e4c[_0x317043(0x297)]('@');return _0x5c0175['length']>=0x3?'@'+_0x5c0175[0x1]:_0x295e4c;}return _0x295e4c[_0x317043(0x297)]('@')[0x0];})[_0x2c441e(0x28d)](Boolean)),_0x76bfe=new Set();for(const _0x58fb1f of _0x1a8245['openclaw']['resolved'+'LocalPlu'+_0x2c441e(0x1f6)]){const _0x1d2c8a=await getPackageMetadata(_0x58fb1f);if(_0x1d2c8a[_0x2c441e(0x359)])_0x76bfe[_0x2c441e(0x195)](_0x1d2c8a[_0x2c441e(0x359)]);}const _0x3a2273=Array['isArray'](_0x36535b[_0x2c441e(0x1be)])?_0x36535b[_0x2c441e(0x1be)]:[];_0x36535b[_0x2c441e(0x177)+_0x2c441e(0x1aa)]=[..._0x1a8245['openclaw'][_0x2c441e(0x177)+_0x2c441e(0x1aa)],..._0x1a8245['openclaw']['resolved'+_0x2c441e(0x2c0)+_0x2c441e(0x1f6)][_0x2c441e(0x2ad)](_0x15f574=>_0x2c441e(0x289)+_0x15f574)],_0x36535b[_0x2c441e(0x1be)]=_0x3a2273['filter'](_0x2181fc=>{const _0x17540b=_0x2c441e;if(!_0x2181fc||typeof _0x2181fc!==_0x17540b(0x2df))return![];if(_0x2181fc[_0x17540b(0x351)]===_0x17540b(0x1c0))return _0x76bfe[_0x17540b(0x2e7)](_0x2181fc['pluginId']);if(_0x2181fc['source']===_0x17540b(0x318))return _0x21abe1[_0x17540b(0x2e7)](_0x2181fc[_0x17540b(0x25b)])||_0x21abe1[_0x17540b(0x2e7)](_0x2181fc[_0x17540b(0x1c1)+_0x17540b(0x317)])||_0x5d52f9[_0x17540b(0x2e7)](_0x2181fc[_0x17540b(0x1c1)+_0x17540b(0x19c)]);return![];});const _0x566000=new Set(_0x36535b[_0x2c441e(0x1be)][_0x2c441e(0x2ad)](_0xf0ad74=>_0xf0ad74[_0x2c441e(0x359)]));for(const _0xaaa722 of _0x3a2273){if(!_0xaaa722[_0x2c441e(0x359)]||_0x566000[_0x2c441e(0x2e7)](_0xaaa722[_0x2c441e(0x359)]))continue;const _0x16c465=typeof _0xaaa722[_0x2c441e(0x208)+_0x2c441e(0x2ab)]===_0x2c441e(0x300)&&_0xaaa722[_0x2c441e(0x208)+_0x2c441e(0x2ab)][_0x2c441e(0x339)]()?resolve(_0x1ee2c1,_0xaaa722[_0x2c441e(0x208)+_0x2c441e(0x2ab)]):join(_0x35dc15,_0xaaa722['pluginId']),_0x41ea5b=relative(_0x35dc15,_0x16c465);if(_0x41ea5b[_0x2c441e(0x20b)+'th']('..')||_0x41ea5b==='')continue;await rm(_0x16c465,{'recursive':!![],'force':!![]});}}async function collectCapabilityEntries(_0x46f563,_0x15f9ce){const _0xa9b4f7=_0x38e6be,_0x80dda7=new Map();for(const _0x14aa16 of _0x46f563){let _0x37cb6d;try{_0x37cb6d=await stat(_0x14aa16);}catch{throw new Error(_0x15f9ce+('\x20path\x20wa'+_0xa9b4f7(0x1e8)+_0xa9b4f7(0x27c))+_0x14aa16);}if(!_0x37cb6d[_0xa9b4f7(0x36b)+'ory']())throw new Error(_0x15f9ce+(_0xa9b4f7(0x33c)+_0xa9b4f7(0x2f2)+_0xa9b4f7(0x1ab)+_0xa9b4f7(0x281))+_0x14aa16);const _0x403806={'name':basename(_0x14aa16),'path':_0x14aa16},_0x386e80=_0x80dda7['get'](_0x403806[_0xa9b4f7(0x1ec)]);if(_0x386e80)throw new Error('Duplicat'+'e\x20'+_0x15f9ce+_0xa9b4f7(0x377)+_0x403806[_0xa9b4f7(0x1ec)]+'\x22\x20from\x20'+_0x386e80[_0xa9b4f7(0x278)]+_0xa9b4f7(0x249)+_0x403806[_0xa9b4f7(0x278)]);_0x80dda7['set'](_0x403806['name'],_0x403806);}return[..._0x80dda7[_0xa9b4f7(0x370)]()];}async function syncProductCapabilityDirs(_0x17672d,_0x147250,_0x2e3161){const _0x38449f=_0x38e6be,_0x82458a=await collectCapabilityEntries(_0x17672d,_0x2e3161);await rm(_0x147250,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await mkdir(_0x147250,{'recursive':!![]});for(const _0x29906d of _0x82458a){await cp(_0x29906d[_0x38449f(0x278)],join(_0x147250,_0x29906d[_0x38449f(0x1ec)]),{'recursive':!![]});}return _0x82458a[_0x38449f(0x31a)];}export const __test__={'collectCapabilityEntries':collectCapabilityEntries,'syncProductCapabilityDirs':syncProductCapabilityDirs};async function syncProductAgents(_0x2c11ad,_0xba94ef,_0x39eeae){const _0x43c1f3=_0x38e6be,_0x36efcf=join(_0xba94ef,_0x43c1f3(0x17d),_0x43c1f3(0x312)),_0x362521=await syncProductCapabilityDirs(_0x2c11ad[_0x43c1f3(0x17d)][_0x43c1f3(0x1c1)+_0x43c1f3(0x215)+'ntPaths'],_0x36efcf,'agent');_0x39eeae['agents']={'source':_0x43c1f3(0x2d9),'installPath':toRuntimeRelative(_0xba94ef,_0x36efcf),'localPaths':_0x2c11ad['openclaw'][_0x43c1f3(0x1c1)+_0x43c1f3(0x215)+_0x43c1f3(0x2c8)],'entryCount':_0x362521};}async function syncProductSkills(_0x3570bf,_0x4d0cee,_0x5658bb){const _0x39c098=_0x38e6be,_0x247ccb=join(_0x4d0cee,_0x39c098(0x17d),'skills'),_0x24474f=await syncProductCapabilityDirs(_0x3570bf['openclaw'][_0x39c098(0x1c1)+_0x39c098(0x1c4)+_0x39c098(0x1e1)],_0x247ccb,_0x39c098(0x227));_0x5658bb['skills']={'source':_0x39c098(0x2d9),'installPath':toRuntimeRelative(_0x4d0cee,_0x247ccb),'localPaths':_0x3570bf['openclaw']['resolved'+_0x39c098(0x1c4)+_0x39c098(0x1e1)],'entryCount':_0x24474f};}
@@ -1 +1 @@
1
- function _0x96f2(){const _0x262dd9=['ons.runt','edRuntim','s,\x0a\x09\x09\x09\x09i','e\x20??=\x20re','ctionKey',')\x20=>\x20{\x0a\x09','ime\x20=\x20wu','onst\x20cha','ns));\x0a\x09\x09','nRuntime','e.reply,','..existi','el\x20}\x20fro','nel\x20=\x20ru','\x0a\x09\x09};','import-n','solveRun','hannel\x20:','e,\x0a\x09\x09\x09\x09.','50kRLgoU','eturn\x20re','\x09return\x20','\x09\x09resolv','eRuntime','\x09\x09\x09if\x20(!','inRuntim','ntime.ch','ns.runti','ded','\x20channel','stingCha','sureWuji','CTION_KE','??\x20chann','runtimeC','lazyRunt','sion:\x20ex','om\x20\x22node','517815nLsnTO','resolved','w\x20Set(LA','\x20createH','Runtime;','ssion\x20??','ZY_RUNTI','\x0a\x09\x09};\x0a','eChannel','un)\x20retu','includes','elpers\x20=','\x09\x09const\x20','hannelIm','runtime;','2596878KIFcRx','ntime.in','imeOptio','imeRefle','import\x20{','\x20(runtim','ot-provi','\x20typeof\x20','test',':crypto\x22','m\x20\x22','time.cha','Runtime.','l,\x0a\x09\x09\x09\x09r','ntexts:\x20','const\x20re','\x0a\x09\x09};\x0a\x09\x09','rn\x20runti','untime.t','meChanne','Channel(','s);\x0a\x09\x09\x09r','eateRunt','f\x20runtim','e)\x20=>\x20{\x0a','ontexts\x20','\x0a\x09\x09\x09\x09ses','e.inboun','wujieCre','return\x20r','\x09\x09\x09reply','eatePlug','ntime\x20=\x20','hannel?.','ntime;\x0a\x09','ect\x22\x20?\x20r','()(optio','istingCh','nnelRunt','137792YCHooG','solveCre','annel\x20&&','e()(opti','patched','16233qItqCJ','meOption','\x09\x09let\x20re','bject\x22)\x20','nst\x20exis','elRuntim','solvedRu','...chann','existing','runtime-','=\x20{\x0a\x09\x09\x09\x09','annel.se','imePromi','already-','null;\x0a\x09\x09','ash\x20}\x20fr','tingChan',':\x20existi','e\x20??=\x20en','urn\x20??\x20c','elpers(r','n\x20&&\x20run','not-foun','urn:\x20exi','nnel.inb','turn?.ru','nbound:\x20','8864130ELwtGs','untimeCh','n\x20??\x20exi','ngChanne','ound\x20??\x20','ot-found','nnel?.in','channelR','wujieCha','replace','runtime\x20','\x09};','419648qrdiOB','bound,\x0a\x09','untimeCo','eContext','\x20{};\x0a\x09\x09\x09','me;\x0a\x09\x09\x09c','40CxckMf','jieCreat','channel\x20','RuntimeH','\x09\x09\x09};\x0a\x09\x09','===\x20\x22obj','runtime.','null;','slice','162viCcoe','5UMtFIs','bound?.r','hannelRu','untime;\x0a','d,\x0a\x09\x09\x09\x09t','const\x20en','inbound\x20','time\x20=\x20(','\x09\x09\x09if\x20(r','rn\x20??','indexOf','untime.c','session\x0a','Channel.','56616JbdNeU','e\x20!==\x20\x22o'];_0x96f2=function(){return _0x262dd9;};return _0x96f2();}(function(_0x2d108f,_0x2bfc7d){const _0x56a025=_0x47a9,_0x1935f9=_0x2d108f();while(!![]){try{const _0x5180e9=-parseInt(_0x56a025(0x141))/0x1+parseInt(_0x56a025(0xd4))/0x2*(-parseInt(_0x56a025(0x146))/0x3)+parseInt(_0x56a025(0x16d))/0x4+-parseInt(_0x56a025(0xd5))/0x5*(parseInt(_0x56a025(0x11a))/0x6)+-parseInt(_0x56a025(0xe3))/0x7*(-parseInt(_0x56a025(0x173))/0x8)+-parseInt(_0x56a025(0x10b))/0x9*(-parseInt(_0x56a025(0xf8))/0xa)+parseInt(_0x56a025(0x161))/0xb;if(_0x5180e9===_0x2bfc7d)break;else _0x1935f9['push'](_0x1935f9['shift']());}catch(_0x39bf05){_0x1935f9['push'](_0x1935f9['shift']());}}}(_0x96f2,0x38249));export function patchChannelPluginRuntimeFromSource(_0x58af0f,_0x167934={}){const _0x298b97=_0x47a9,_0x64661=_0x167934[_0x298b97(0x107)+_0x298b97(0x118)+'portPath'];if(!_0x64661)return{'patched':![],'reason':_0x298b97(0x14f)+'channel-'+_0x298b97(0xf4)+_0x298b97(0x120)+_0x298b97(0x101)};if(_0x58af0f[_0x298b97(0x115)](_0x298b97(0x136)+'ateRunti'+_0x298b97(0x12d)+'l')){if(_0x58af0f[_0x298b97(0x115)]('turn:\x20ex'+_0x298b97(0x13f)+'annel.tu'+_0x298b97(0xde))&&hasRuntimeChannelImport(_0x58af0f,_0x64661))return{'patched':![],'reason':_0x298b97(0x153)+_0x298b97(0x145)};return patchExistingChannelPluginRuntimeFromSource(_0x58af0f,{'runtimeChannelImportPath':_0x64661});}if(_0x58af0f['includes'](_0x298b97(0x169)+_0x298b97(0x140)+_0x298b97(0x152)+'se'))return patchExistingChannelPluginRuntimeFromSource(_0x58af0f,{'runtimeChannelImportPath':_0x64661});const _0x33bba3=_0x298b97(0x148)+_0x298b97(0x14c)+_0x298b97(0x13a)+'null;\x0a\x09\x09'+_0x298b97(0x129)+_0x298b97(0xf5)+_0x298b97(0xdc)+_0x298b97(0xea)+_0x298b97(0xfb)+'edRuntim'+_0x298b97(0xe8)+_0x298b97(0x142)+'atePlugi'+_0x298b97(0xee)+_0x298b97(0x13e)+_0x298b97(0x100)+_0x298b97(0x147)+_0x298b97(0x12f)+_0x298b97(0xf9)+_0x298b97(0x14c)+_0x298b97(0x13c)+_0x298b97(0x16c);if(!_0x58af0f[_0x298b97(0x115)](_0x33bba3))return{'patched':![],'reason':_0x298b97(0x15c)+'d'};const _0x412543='import\x20{'+_0x298b97(0x10e)+_0x298b97(0x155)+'om\x20\x22node'+_0x298b97(0x123)+';';if(!_0x58af0f['includes'](_0x412543))return{'patched':![],'reason':_0x298b97(0xf4)+'ot-found'};const _0x2b183c=_0x298b97(0x148)+_0x298b97(0x14c)+'ntime\x20=\x20'+_0x298b97(0x154)+_0x298b97(0xda)+_0x298b97(0x104)+'eChannel'+_0x298b97(0x176)+_0x298b97(0x116)+_0x298b97(0x11f)+_0x298b97(0x132)+_0x298b97(0xfd)+_0x298b97(0x16b)+'||\x20typeo'+_0x298b97(0x131)+'e\x20!==\x20\x22o'+_0x298b97(0x149)+_0x298b97(0x137)+'untime;\x0a'+_0x298b97(0xdd)+'untime.c'+_0x298b97(0x13b)+_0x298b97(0x15f)+'n\x20&&\x20run'+_0x298b97(0x125)+_0x298b97(0x167)+_0x298b97(0xd6)+_0x298b97(0x114)+_0x298b97(0x12b)+_0x298b97(0x172)+_0x298b97(0xec)+_0x298b97(0x140)+'ime\x20=\x20wu'+_0x298b97(0x174)+_0x298b97(0xfc)+'Channel('+');\x0a\x09\x09\x09co'+_0x298b97(0x14a)+_0x298b97(0x156)+_0x298b97(0xf2)+_0x298b97(0xff)+_0x298b97(0x143)+_0x298b97(0x121)+'runtime.'+_0x298b97(0x175)+_0x298b97(0x178)+'ect\x22\x20?\x20r'+_0x298b97(0xe0)+_0x298b97(0xf6)+_0x298b97(0x171)+_0x298b97(0xd1)+_0x298b97(0x175)+_0x298b97(0x150)+'...chann'+'elRuntim'+_0x298b97(0xf7)+'..existi'+_0x298b97(0x164)+_0x298b97(0x127)+_0x298b97(0x16f)+_0x298b97(0x128)+_0x298b97(0x14e)+_0x298b97(0xe2)+_0x298b97(0x107)+_0x298b97(0x133)+_0x298b97(0x106)+_0x298b97(0x14b)+'e.runtim'+_0x298b97(0x170)+_0x298b97(0xe7)+_0x298b97(0x160)+_0x298b97(0x14e)+'Channel.'+_0x298b97(0xdb)+'??\x20chann'+'elRuntim'+_0x298b97(0x135)+_0x298b97(0xd9)+_0x298b97(0x15d)+_0x298b97(0x103)+'nnel.tur'+_0x298b97(0x163)+_0x298b97(0x103)+_0x298b97(0x15e)+_0x298b97(0x165)+_0x298b97(0x168)+'untime.t'+_0x298b97(0x159)+_0x298b97(0xd7)+_0x298b97(0x11b)+_0x298b97(0x16e)+_0x298b97(0x138)+_0x298b97(0x157)+_0x298b97(0x164)+'l.reply\x20'+_0x298b97(0x106)+'elRuntim'+_0x298b97(0xef)+'\x0a\x09\x09\x09\x09ses'+_0x298b97(0x109)+_0x298b97(0x13f)+'annel.se'+_0x298b97(0x110)+_0x298b97(0x102)+_0x298b97(0x126)+'session\x0a'+_0x298b97(0x177)+_0x298b97(0xfa)+_0x298b97(0x119)+_0x298b97(0x12a)+_0x298b97(0x129)+_0x298b97(0xf5)+_0x298b97(0xdc)+_0x298b97(0xea)+'\x09\x09resolv'+_0x298b97(0xe6)+_0x298b97(0x158)+'sureWuji'+_0x298b97(0x113)+_0x298b97(0x176)+_0x298b97(0x15a)+'esolveCr'+_0x298b97(0x139)+_0x298b97(0xfe)+_0x298b97(0x144)+(_0x298b97(0xe5)+_0x298b97(0x11c)+_0x298b97(0xed)+_0x298b97(0xfa)+'resolved'+_0x298b97(0x10f)+_0x298b97(0xf3));return{'patched':!![],'source':_0x58af0f['replace'](_0x412543,_0x412543+'\x0a'+createRuntimeChannelImport(_0x64661))['replace'](_0x33bba3,_0x2b183c)};}function patchExistingChannelPluginRuntimeFromSource(_0x4b708b,_0x6bf8){const _0x549ed7=_0x47a9,{runtimeChannelImportPath:_0x140612}=_0x6bf8,_0x2cdb5a=_0x549ed7(0x11e)+'\x20createH'+_0x549ed7(0x155)+_0x549ed7(0x10a)+':crypto\x22'+';';if(!_0x4b708b[_0x549ed7(0x115)](_0x2cdb5a))return{'patched':![],'reason':'import-n'+_0x549ed7(0x166)};const _0x4394a6='\x09\x09let\x20re'+_0x549ed7(0x14c)+_0x549ed7(0x13a)+_0x549ed7(0xd2),_0x19a13c=_0x549ed7(0x117)+_0x549ed7(0x108)+_0x549ed7(0x11d)+_0x549ed7(0xe9)+'Set\x20=\x20ne'+_0x549ed7(0x10d)+_0x549ed7(0x111)+'ME_REFLE'+_0x549ed7(0x105)+'YS);',_0x1da024=_0x4b708b['indexOf'](_0x4394a6),_0x45cdb3=_0x4b708b[_0x549ed7(0xdf)](_0x19a13c,_0x1da024);if(_0x1da024===-0x1||_0x45cdb3===-0x1)return{'patched':![],'reason':_0x549ed7(0x15c)+'d'};const _0x4e863f='\x09\x09let\x20re'+'solvedRu'+_0x549ed7(0x13a)+_0x549ed7(0x154)+_0x549ed7(0xda)+_0x549ed7(0x104)+_0x549ed7(0x113)+_0x549ed7(0x176)+_0x549ed7(0x116)+_0x549ed7(0x11f)+_0x549ed7(0x132)+_0x549ed7(0xfd)+_0x549ed7(0x16b)+'||\x20typeo'+_0x549ed7(0x131)+_0x549ed7(0xe4)+_0x549ed7(0x149)+_0x549ed7(0x137)+_0x549ed7(0xd8)+_0x549ed7(0xdd)+_0x549ed7(0xe0)+'hannel?.'+'turn?.ru'+_0x549ed7(0x15b)+_0x549ed7(0x125)+_0x549ed7(0x167)+_0x549ed7(0xd6)+_0x549ed7(0x114)+_0x549ed7(0x12b)+_0x549ed7(0x172)+'onst\x20cha'+_0x549ed7(0x140)+_0x549ed7(0xeb)+'jieCreat'+'eRuntime'+_0x549ed7(0x12e)+');\x0a\x09\x09\x09co'+_0x549ed7(0x14a)+_0x549ed7(0x156)+_0x549ed7(0xf2)+_0x549ed7(0xff)+_0x549ed7(0x143)+_0x549ed7(0x121)+_0x549ed7(0xd1)+_0x549ed7(0x175)+_0x549ed7(0x178)+_0x549ed7(0x13d)+_0x549ed7(0xe0)+_0x549ed7(0xf6)+_0x549ed7(0x171)+_0x549ed7(0xd1)+_0x549ed7(0x175)+_0x549ed7(0x150)+_0x549ed7(0x14d)+_0x549ed7(0x14b)+_0x549ed7(0xf7)+_0x549ed7(0xf0)+_0x549ed7(0x164)+_0x549ed7(0x127)+_0x549ed7(0x16f)+_0x549ed7(0x128)+_0x549ed7(0x14e)+_0x549ed7(0xe2)+_0x549ed7(0x107)+_0x549ed7(0x133)+_0x549ed7(0x106)+_0x549ed7(0x14b)+'e.runtim'+_0x549ed7(0x170)+'s,\x0a\x09\x09\x09\x09i'+_0x549ed7(0x160)+_0x549ed7(0x14e)+_0x549ed7(0xe2)+'inbound\x20'+_0x549ed7(0x106)+_0x549ed7(0x14b)+_0x549ed7(0x135)+_0x549ed7(0xd9)+_0x549ed7(0x15d)+_0x549ed7(0x103)+'nnel.tur'+_0x549ed7(0x163)+'stingCha'+_0x549ed7(0x15e)+_0x549ed7(0x165)+_0x549ed7(0x168)+_0x549ed7(0x12c)+_0x549ed7(0x159)+_0x549ed7(0xd7)+_0x549ed7(0x11b)+'bound,\x0a\x09'+_0x549ed7(0x138)+_0x549ed7(0x157)+_0x549ed7(0x164)+'l.reply\x20'+_0x549ed7(0x106)+_0x549ed7(0x14b)+_0x549ed7(0xef)+_0x549ed7(0x134)+_0x549ed7(0x109)+_0x549ed7(0x13f)+_0x549ed7(0x151)+_0x549ed7(0x110)+'\x20channel'+_0x549ed7(0x126)+_0x549ed7(0xe1)+_0x549ed7(0x177)+'\x09return\x20'+'runtime;'+'\x0a\x09\x09};\x0a\x09\x09'+_0x549ed7(0x129)+_0x549ed7(0xf5)+_0x549ed7(0xdc)+_0x549ed7(0xea)+_0x549ed7(0xfb)+_0x549ed7(0xe6)+_0x549ed7(0x158)+_0x549ed7(0x104)+_0x549ed7(0x113)+'RuntimeH'+'elpers(r'+'esolveCr'+_0x549ed7(0x139)+_0x549ed7(0xfe)+_0x549ed7(0x144)+(_0x549ed7(0xe5)+_0x549ed7(0x11c)+_0x549ed7(0xed)+'\x09return\x20'+_0x549ed7(0x10c)+_0x549ed7(0x10f)+_0x549ed7(0x112)),_0x3ae363=_0x4b708b[_0x549ed7(0xd3)](0x0,_0x1da024)+_0x4e863f+_0x4b708b[_0x549ed7(0xd3)](_0x45cdb3);return{'patched':!![],'source':ensureRuntimeChannelImport(_0x3ae363,{'importMarker':_0x2cdb5a,'runtimeChannelImportPath':_0x140612})};}function createRuntimeChannelImport(_0x433542){const _0x9c8168=_0x47a9;return _0x9c8168(0x11e)+'\x20createR'+_0x9c8168(0x162)+'annel\x20as'+'\x20wujieCr'+_0x9c8168(0x130)+'imeChann'+_0x9c8168(0xf1)+_0x9c8168(0x124)+_0x433542+'\x22;';}function hasRuntimeChannelImport(_0x1d387e,_0x53e1af){const _0x4349f6=_0x47a9;return _0x1d387e[_0x4349f6(0x115)](createRuntimeChannelImport(_0x53e1af));}function _0x47a9(_0x506394,_0x504416){_0x506394=_0x506394-0xd1;const _0x96f2c3=_0x96f2();let _0x47a9d8=_0x96f2c3[_0x506394];return _0x47a9d8;}function ensureRuntimeChannelImport(_0x485005,{importMarker:_0x1d4a87,runtimeChannelImportPath:_0x18ea80}){const _0xdf5648=_0x47a9,_0x2740b9=createRuntimeChannelImport(_0x18ea80),_0xd22ef0=/import \{ createRuntimeChannel as wujieCreateRuntimeChannel \} from "\.\/runtime-channel-[^"]+\.js";\n?/;if(_0xd22ef0[_0xdf5648(0x122)](_0x485005))return _0x485005['replace'](_0xd22ef0,_0x2740b9+'\x0a');return _0x485005[_0xdf5648(0x16a)](_0x1d4a87,_0x1d4a87+'\x0a'+_0x2740b9);}
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);}