@wujie-shell/core 3.0.0 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/wujie-shell.mjs +1 -1
- package/dist/src/agents/bundled-agent-skills.mjs +1 -1
- package/dist/src/agents/bundled-agents.mjs +1 -1
- package/dist/src/chat/media-archive.mjs +1 -1
- package/dist/src/chat/queue.mjs +1 -1
- package/dist/src/common/diagnostics.mjs +1 -1
- package/dist/src/common/logging.mjs +1 -1
- package/dist/src/common/runtime-logger.mjs +1 -1
- package/dist/src/common/user-events.mjs +1 -1
- package/dist/src/common/utils.mjs +1 -1
- package/dist/src/config/controller.mjs +1 -1
- package/dist/src/connectors/config-utils.mjs +1 -1
- package/dist/src/connectors/constants.mjs +1 -1
- package/dist/src/connectors/controller.mjs +1 -1
- package/dist/src/connectors/kdocs-cli.mjs +1 -1
- package/dist/src/electron/main.mjs +1 -1
- package/dist/src/electron/preload.mjs +1 -1
- package/dist/src/files/generated-files-store.mjs +1 -1
- package/dist/src/files/handlers.mjs +1 -1
- package/dist/src/gateway/chat-delta.mjs +1 -1
- package/dist/src/gateway/controller.mjs +1 -1
- package/dist/src/gateway/ws-client.mjs +1 -1
- package/dist/src/index.mjs +1 -1
- package/dist/src/log-reporting/handlers.mjs +1 -1
- package/dist/src/log-reporting/report-logs.mjs +1 -1
- package/dist/src/models/handlers.mjs +1 -1
- package/dist/src/preferences/store.mjs +1 -1
- package/dist/src/runtime/index.mjs +1 -1
- package/dist/src/runtime/patch-channel-plugin-runtime.mjs +1 -1
- package/dist/src/runtime/patch-chat-history-mixed-tool-content.mjs +1 -1
- package/dist/src/runtime/patch-session-store-sqlite.mjs +1 -1
- package/dist/src/runtime/plugin-sync.mjs +1 -1
- package/dist/src/sessions/agent-sessions-map-store.mjs +1 -1
- package/dist/src/sessions/runtime-bridge.mjs +1 -1
- package/dist/src/sessions/session-sqlite-store.mjs +1 -1
- package/dist/src/skills/import.mjs +1 -1
- package/dist/src/skills/market.mjs +1 -1
- package/dist/src/terminal/manager.mjs +1 -1
- package/dist/src/updates/controller.mjs +1 -1
- package/dist/src/updates/loader.mjs +1 -0
- package/package.json +4 -3
package/dist/src/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x58829c,_0x3a2b05){var _0x449d83=_0x35ba,_0x35cffd=_0x58829c();while(!![]){try{var _0x24a5b8=parseInt(_0x449d83(0xa8))/0x1+parseInt(_0x449d83(0xad))/0x2+parseInt(_0x449d83(0xaf))/0x3*(parseInt(_0x449d83(0xac))/0x4)+parseInt(_0x449d83(0xb1))/0x5+-parseInt(_0x449d83(0xa9))/0x6*(parseInt(_0x449d83(0xab))/0x7)+parseInt(_0x449d83(0xae))/0x8*(-parseInt(_0x449d83(0xaa))/0x9)+-parseInt(_0x449d83(0xb0))/0xa;if(_0x24a5b8===_0x3a2b05)break;else _0x35cffd['push'](_0x35cffd['shift']());}catch(_0x37ee54){_0x35cffd['push'](_0x35cffd['shift']());}}}(_0x1154,0x68283));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';export{installKdocsCliBinary,resolveRuntimeKdocsCliCommand}from'./connectors/kdocs-cli.mjs';export{createGeneratedFilesStore}from'./files/generated-files-store.mjs';export{registerFileHandlers}from'./files/handlers.mjs';function _0x1154(){var _0x40e709=['1253810uWNvju','3164930SoQRGN','682882cGvUWS','504246fIQhLR','64080YLsQKB','14QkirGb','36vKmqMc','22260NAduVD','808uLJLtx','37404dwAJQj'];_0x1154=function(){return _0x40e709;};return _0x1154();}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';function _0x35ba(_0x5314b9,_0x232c79){_0x5314b9=_0x5314b9-0xa8;var _0x115477=_0x1154();var _0x35ba74=_0x115477[_0x5314b9];return _0x35ba74;}export{deleteManagedSkill,importSkillZip,syncManagedSkillsToConfig,updateManagedSkillConfig}from'./skills/import.mjs';export{createMarketSkillRuntime,deleteMarketSkillRegistryEntry,importMarketSkillZip,mapMarketRegisteredSkills,readSkillMarketRegistry}from'./skills/market.mjs';export{createTerminalManager}from'./terminal/manager.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x4140(_0xd17bf9,_0x181333){_0xd17bf9=_0xd17bf9-0x96;var _0x292378=_0x2923();var _0x4140fa=_0x292378[_0xd17bf9];return _0x4140fa;}(function(_0x5831ed,_0x995da7){var _0xf411b1=_0x4140,_0x1fb432=_0x5831ed();while(!![]){try{var _0xa87bda=-parseInt(_0xf411b1(0x9d))/0x1+-parseInt(_0xf411b1(0x9f))/0x2*(-parseInt(_0xf411b1(0xa3))/0x3)+-parseInt(_0xf411b1(0x9a))/0x4+-parseInt(_0xf411b1(0xa0))/0x5+-parseInt(_0xf411b1(0xa9))/0x6*(parseInt(_0xf411b1(0x97))/0x7)+parseInt(_0xf411b1(0xaa))/0x8*(parseInt(_0xf411b1(0xac))/0x9)+-parseInt(_0xf411b1(0xa7))/0xa*(-parseInt(_0xf411b1(0xa1))/0xb);if(_0xa87bda===_0x995da7)break;else _0x1fb432['push'](_0x1fb432['shift']());}catch(_0x332ec1){_0x1fb432['push'](_0x1fb432['shift']());}}}(_0x2923,0x55a7a));import{reportLogs}from'./report-logs.mjs';function _0x2923(){var _0x4cfd55=['45mRPCjV','renderer','app:log:','gateToke','120110uIpOut','string','15186dvfeyz','3675048qrKxhF','info','9knmoPN','ested','logs:rep','161qqnAmS','report','descript','2729664ORtqpj','ort','endpoint','182045MzgKwP','ort\x20requ','75434dvwxCG','1340465PMdgvp','473CTACVC','\x20log\x20rep'];_0x2923=function(){return _0x4cfd55;};return _0x2923();}export function registerProductLogHandlers({app:_0xad2152,configController:_0x340865,diagnosticEventFromError:_0x19fec8,diagnosticsWriter:_0x296a84,exportLogsArchive:_0x9c37b2,handle:_0x38fc30,mainLogger:_0x24c25c,rendererLogger:_0xd4d2b0,summarizeText:_0x23d74e,toHomePath:_0xa609a0}){var _0x5a8769=_0x4140;_0x38fc30(_0x5a8769(0xa5)+_0x5a8769(0x98),async(_0x490f7e,_0x50dd2d)=>{var _0x5eacf0=_0x5a8769;return _0xd4d2b0?.[_0x5eacf0(0xab)](_0x5eacf0(0xa4)+_0x5eacf0(0xa2)+_0x5eacf0(0x9e)+_0x5eacf0(0xad),{'description':_0x23d74e(String(_0x50dd2d||''),0xa0)}),!![];}),_0x38fc30(_0x5a8769(0x96)+_0x5a8769(0x9b),async(_0x379666,_0x1413c6={})=>reportLogs({'app':_0xad2152,'configController':_0x340865,'diagnosticsWriter':_0x296a84,'diagnosticEventFromError':_0x19fec8,'exportLogsArchive':_0x9c37b2,'mainLogger':_0x24c25c,'summarizeText':_0x23d74e,'toHomePath':_0xa609a0,'description':typeof _0x1413c6[_0x5a8769(0x99)+'ion']===_0x5a8769(0xa8)?_0x1413c6[_0x5a8769(0x99)+'ion']:'','gateToken':typeof _0x1413c6[_0x5a8769(0xa6)+'n']==='string'?_0x1413c6[_0x5a8769(0xa6)+'n']:'','endpoint':typeof _0x1413c6[_0x5a8769(0x9c)]===_0x5a8769(0xa8)?_0x1413c6[_0x5a8769(0x9c)]:''}));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1935ba,_0x462332){const _0x38297e=_0x5b36,_0x4c6f3d=_0x1935ba();while(!![]){try{const _0x4fbed5=-parseInt(_0x38297e(0x116))/0x1+-parseInt(_0x38297e(0x12e))/0x2*(-parseInt(_0x38297e(0x10b))/0x3)+parseInt(_0x38297e(0x137))/0x4*(parseInt(_0x38297e(0x11e))/0x5)+-parseInt(_0x38297e(0x125))/0x6*(-parseInt(_0x38297e(0x128))/0x7)+parseInt(_0x38297e(0x124))/0x8*(-parseInt(_0x38297e(0x11a))/0x9)+-parseInt(_0x38297e(0x13d))/0xa+parseInt(_0x38297e(0x120))/0xb*(parseInt(_0x38297e(0x12c))/0xc);if(_0x4fbed5===_0x462332)break;else _0x4c6f3d['push'](_0x4c6f3d['shift']());}catch(_0x2c651c){_0x4c6f3d['push'](_0x4c6f3d['shift']());}}}(_0x3913,0xa4875));function _0x3913(){const _0x34e45e=['/v2/claw','/upload','/v2/gene','applicat','error','success','ion/zip','12jYodVJ','orted','200','catch','上传日志失败(H','ort_fail','11071180rOervG','timeout','42lxhuHU','paths','status','ncident','/aipc/ex','getPath','y_name','director','string','wujie-ag','POST','728114btxLcT','code','logs_rep','/wj-open','2050506JEHFtQ','info','ent-logs','parse','603090hAXgDI','stringif','6053718EUTfZT','append','log_repo','now','40GfSuky','6edZOaN','TTP\x20','ceptions','5869647hzLaUz','trim','logs\x20rep','replace','36XvRkpB','path','113846ClzoOw','captureI'];_0x3913=function(){return _0x34e45e;};return _0x3913();}import{basename}from'node:path';import{readFile,rm}from'node:fs/promises';function _0x5b36(_0x2625b4,_0x2e9816){_0x2625b4=_0x2625b4-0x10b;const _0x39133b=_0x3913();let _0x5b362d=_0x39133b[_0x2625b4];return _0x5b362d;}export function resolveWujieApiEndpoint(){const _0x51b06e=_0x5b36;return String(process.env.VITE_WUJIE_API_ENDPOINT||'')[_0x51b06e(0x129)]()[_0x51b06e(0x12b)](/\/+$/,'');}export async function reportLogs({app:_0x190ae3,configController:_0x4e8f1a,diagnosticsWriter:_0x765cb6,diagnosticEventFromError:_0x3b4453,exportLogsArchive:_0x186e33,mainLogger:_0x53568d,readFileFn:readFileFn=readFile,rmFn:rmFn=rm,summarizeText:_0x6f4cde,toHomePath:_0x16855e,description:description='',gateToken:gateToken='',endpoint:endpoint=''}={}){const _0x1bd0e0=_0x5b36;let _0x58863b='';const _0x59b9a3=Date[_0x1bd0e0(0x123)]();try{const _0x4aa46a=await _0x186e33({'logsDir':_0x4e8f1a[_0x1bd0e0(0x10c)]['logsDir'],'targetDir':_0x190ae3[_0x1bd0e0(0x110)]('temp'),'appVersion':_0x190ae3['getVersi'+'on']()});_0x58863b=_0x4aa46a[_0x1bd0e0(0x12d)];const _0x16d8dd=await readFileFn(_0x58863b),_0x14db6f=new FormData();_0x14db6f[_0x1bd0e0(0x121)]('file',new Blob([_0x16d8dd],{'type':_0x1bd0e0(0x133)+_0x1bd0e0(0x136)}),basename(_0x58863b)),_0x14db6f[_0x1bd0e0(0x121)](_0x1bd0e0(0x112)+_0x1bd0e0(0x111),_0x1bd0e0(0x114)+_0x1bd0e0(0x11c));const _0x5d20e2={};typeof gateToken===_0x1bd0e0(0x113)&&gateToken['trim']()&&(_0x5d20e2['gate-tok'+'en']=gateToken[_0x1bd0e0(0x129)]());const _0x458d5a=String(endpoint||resolveWujieApiEndpoint())[_0x1bd0e0(0x129)]()[_0x1bd0e0(0x12b)](/\/+$/,'');if(!_0x458d5a)throw new Error('缺少日志上传服务'+'地址');const _0x5ae13c=await fetch(_0x458d5a+(_0x1bd0e0(0x119)+_0x1bd0e0(0x132)+'ral/file'+_0x1bd0e0(0x131)),{'method':_0x1bd0e0(0x115),'headers':_0x5d20e2,'body':_0x14db6f,'signal':AbortSignal[_0x1bd0e0(0x13e)](0x3a98)}),_0x264b48=await _0x5ae13c['text']();let _0x14a4b2={};try{_0x14a4b2=JSON[_0x1bd0e0(0x11d)](_0x264b48);}catch{throw new Error(_0x1bd0e0(0x13b)+_0x1bd0e0(0x126)+_0x5ae13c[_0x1bd0e0(0x10d)]+')');}const _0x464ce6=_0x14a4b2?.[_0x1bd0e0(0x135)]===!![]||String(_0x14a4b2?.[_0x1bd0e0(0x117)])===_0x1bd0e0(0x139),_0x5e9d98=_0x14a4b2?.['data'];if(!_0x464ce6||!_0x5e9d98)throw new Error(_0x1bd0e0(0x13b)+_0x1bd0e0(0x126)+_0x5ae13c[_0x1bd0e0(0x10d)]+')');const _0x26c40f=await fetch(_0x458d5a+('/wj-open'+_0x1bd0e0(0x130)+_0x1bd0e0(0x10f)+_0x1bd0e0(0x127)),{'method':'POST','headers':{'Content-Type':_0x1bd0e0(0x133)+'ion/json',..._0x5d20e2},'body':JSON[_0x1bd0e0(0x11f)+'y']({'packageUrl':_0x5e9d98,'description':description}),'signal':AbortSignal['timeout'](0x3a98)});return _0x53568d?.[_0x1bd0e0(0x11b)](_0x1bd0e0(0x12a)+_0x1bd0e0(0x138),{'durationMs':Date[_0x1bd0e0(0x123)]()-_0x59b9a3,'uploadStatus':_0x5ae13c[_0x1bd0e0(0x10d)],'reportStatus':_0x26c40f[_0x1bd0e0(0x10d)]}),!![];}catch(_0x518138){_0x53568d?.[_0x1bd0e0(0x134)](_0x1bd0e0(0x12a)+'ort\x20fail'+'ed',{'durationMs':Date[_0x1bd0e0(0x123)]()-_0x59b9a3,'error':_0x518138}),await _0x765cb6?.[_0x1bd0e0(0x12f)+_0x1bd0e0(0x10e)](_0x3b4453(_0x518138,{'category':_0x1bd0e0(0x122)+'rt','event':_0x1bd0e0(0x118)+_0x1bd0e0(0x13c)+'ed','message':'日志上传上报失败','durationMs':Date[_0x1bd0e0(0x123)]()-_0x59b9a3,'meta':{'description':_0x6f4cde(description,0xa0),'archivePath':_0x58863b?_0x16855e(_0x58863b):''}}));throw _0x518138;}finally{if(_0x58863b)await rmFn(_0x58863b,{'force':!![]})[_0x1bd0e0(0x13a)](()=>{});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x38a1b7,_0x1b03b5){const _0x7f452a=_0x56cb,_0x21d3f0=_0x38a1b7();while(!![]){try{const _0x3b8582=-parseInt(_0x7f452a(0xe2))/0x1+-parseInt(_0x7f452a(0xc7))/0x2*(parseInt(_0x7f452a(0xe1))/0x3)+-parseInt(_0x7f452a(0xe4))/0x4*(parseInt(_0x7f452a(0xec))/0x5)+-parseInt(_0x7f452a(0xd1))/0x6+parseInt(_0x7f452a(0xd4))/0x7+-parseInt(_0x7f452a(0xcc))/0x8+parseInt(_0x7f452a(0xd7))/0x9*(parseInt(_0x7f452a(0xd9))/0xa);if(_0x3b8582===_0x1b03b5)break;else _0x21d3f0['push'](_0x21d3f0['shift']());}catch(_0x1092d9){_0x21d3f0['push'](_0x21d3f0['shift']());}}}(_0x3b97,0xe8265));function _0x56cb(_0x5fc8eb,_0x38ca73){_0x5fc8eb=_0x5fc8eb-0xc5;const _0x3b97e3=_0x3b97();let _0x56cb1f=_0x3b97e3[_0x5fc8eb];return _0x56cb1f;}export function extractModelMessageContent(_0xc0d34b){const _0x3bb3cb=_0x56cb;if(typeof _0xc0d34b===_0x3bb3cb(0xdf))return _0xc0d34b;if(!Array['isArray'](_0xc0d34b))return'';return _0xc0d34b[_0x3bb3cb(0xc9)](_0xf352e5=>{const _0x4ec813=_0x3bb3cb;if(typeof _0xf352e5==='string')return _0xf352e5;if(!_0xf352e5||typeof _0xf352e5!==_0x4ec813(0xe8))return'';const _0x51fbce=typeof _0xf352e5[_0x4ec813(0xe0)]==='string'?_0xf352e5['type'][_0x4ec813(0xd2)+_0x4ec813(0xde)]():'';if(_0x51fbce&&_0x51fbce!==_0x4ec813(0xef)&&_0x51fbce!==_0x4ec813(0xd0)+_0x4ec813(0xca)&&_0x51fbce!==_0x4ec813(0xed))return'';for(const _0xcde61 of[_0x4ec813(0xef),_0x4ec813(0xed),_0x4ec813(0xda),'outputTe'+'xt',_0x4ec813(0xd0)+_0x4ec813(0xca)]){if(typeof _0xf352e5[_0xcde61]===_0x4ec813(0xdf))return _0xf352e5[_0xcde61];}return'';})[_0x3bb3cb(0xee)]('');}function normalizeCustomModelPayload(_0x77b5d3={}){const _0x57503f=_0x56cb,_0xebf26e=String(_0x77b5d3['id']||'')[_0x57503f(0xe9)]();return{..._0x77b5d3,'id':_0xebf26e,'modelName':String(_0x77b5d3['modelNam'+'e']||'')['trim'](),'provider':String(_0x77b5d3['provider']||'custom'),'apiKey':String(_0x77b5d3[_0x57503f(0xd3)]||''),'protocol':_0x77b5d3[_0x57503f(0xdb)]===_0x57503f(0xd8)+'c'?_0x57503f(0xd8)+'c':_0x57503f(0xe3),'baseUrl':String(_0x77b5d3[_0x57503f(0xce)]||''),..._0x77b5d3[_0x57503f(0xd6)+_0x57503f(0xc8)]?{'providerName':String(_0x77b5d3[_0x57503f(0xd6)+_0x57503f(0xc8)])}:{},..._0x77b5d3[_0x57503f(0xcd)+'oviderNa'+'me']?{'customProviderName':String(_0x77b5d3[_0x57503f(0xcd)+_0x57503f(0xeb)+'me'])}:{}};}function _0x3b97(){const _0x58a756=['30wMymtu','content','protocol','t\x20regist','deleteCu','ase','string','type','38964KYBGIs','613388DRvtDV','openai','738316WNLTuf','omModel','ered:\x20','ete','object','trim','function','oviderNa','25vQGcrD','message','join','text','ustom-mo','dels:del','230hwALEj','Name','map','ext','saveCust','1303672oYzjYu','customPr','baseUrl','models:c','output_t','5936076ZdBQJF','toLowerC','apiKey','7354872bdjoOs','stomMode','provider','12247191KLjbss','anthropi'];_0x3b97=function(){return _0x58a756;};return _0x3b97();}export function registerModelHandlers({handle:_0x52c3b7,modelHandlers:modelHandlers={}}){const _0x1df418=_0x56cb,_0x72b73d=_0x5ea63b=>{const _0x2432ce=_0x56cb,_0x2d6647=modelHandlers[_0x5ea63b];if(typeof _0x2d6647!==_0x2432ce(0xea))throw new Error('core\x20mod'+'el\x20handl'+'er\x20is\x20no'+_0x2432ce(0xdc)+_0x2432ce(0xe6)+_0x5ea63b);return _0x2d6647;};_0x52c3b7(_0x1df418(0xcf)+_0x1df418(0xc5)+'dels:sav'+'e',async(_0x3fb9cd,_0x13bb83={})=>_0x72b73d(_0x1df418(0xcb)+_0x1df418(0xe5))(normalizeCustomModelPayload(_0x13bb83))),_0x52c3b7('models:c'+_0x1df418(0xc5)+_0x1df418(0xc6)+_0x1df418(0xe7),async(_0x454fa8,_0x36fc58={})=>_0x72b73d(_0x1df418(0xdd)+_0x1df418(0xd5)+'l')(_0x36fc58));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const _0xe84643=_0x5b1c;(function(_0x1fd4e3,_0x183df8){const _0xbb35d6=_0x5b1c,_0x49c0ef=_0x1fd4e3();while(!![]){try{const _0x3b4215=-parseInt(_0xbb35d6(0x8f))/0x1+-parseInt(_0xbb35d6(0x89))/0x2+-parseInt(_0xbb35d6(0x92))/0x3+parseInt(_0xbb35d6(0x8d))/0x4+-parseInt(_0xbb35d6(0x91))/0x5+-parseInt(_0xbb35d6(0x8e))/0x6*(parseInt(_0xbb35d6(0x90))/0x7)+parseInt(_0xbb35d6(0x94))/0x8;if(_0x3b4215===_0x183df8)break;else _0x49c0ef['push'](_0x49c0ef['shift']());}catch(_0x20ca84){_0x49c0ef['push'](_0x49c0ef['shift']());}}}(_0x2429,0xa6890));import{join}from'node:path';import{readJson,writeJson}from'../common/utils.mjs';function _0x5b1c(_0x4fd6b8,_0x1ce039){_0x4fd6b8=_0x4fd6b8-0x88;const _0x24292c=_0x2429();let _0x5b1ccb=_0x24292c[_0x4fd6b8];return _0x5b1ccb;}const STORE_FILE=_0xe84643(0x8a)+_0xe84643(0x8b);function _0x2429(){const _0x5543f3=['prototyp','2295782RgtIvt','preferen','ces.json','hasOwnPr','3911732XgpWUx','1472658SoRniZ','871500OhUrPA','35iTMlCX','2679915gHKdjT','81219qBrHBq','operty','28110856WWoQye'];_0x2429=function(){return _0x5543f3;};return _0x2429();}export function createPreferencesStore({stateDir:_0xe2f45f,storeFile:storeFile=STORE_FILE}={}){async function _0x581f77(){return readJson(join(_0xe2f45f,storeFile),{});}async function _0x36c048(_0x3930a3,_0x455f80=null){const _0x1d675e=_0x5b1c,_0x2e3d66=await _0x581f77();return Object[_0x1d675e(0x88)+'e'][_0x1d675e(0x8c)+_0x1d675e(0x93)]['call'](_0x2e3d66,_0x3930a3)?_0x2e3d66[_0x3930a3]:_0x455f80;}async function _0x5d4e72(_0x7d85a0,_0x527f65){const _0xb4a6fa=await _0x581f77();return _0xb4a6fa[_0x7d85a0]=_0x527f65,await writeJson(join(_0xe2f45f,storeFile),_0xb4a6fa),{'ok':!![],'value':_0x527f65};}return{'read':_0x581f77,'get':_0x36c048,'set':_0x5d4e72};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x41e84f=_0x37e5;(function(_0x13c472,_0x1b2b5b){const _0x5b91e4=_0x37e5,_0x245e8d=_0x13c472();while(!![]){try{const _0x700f07=-parseInt(_0x5b91e4(0x278))/0x1*(-parseInt(_0x5b91e4(0x31e))/0x2)+-parseInt(_0x5b91e4(0x233))/0x3+-parseInt(_0x5b91e4(0x202))/0x4*(parseInt(_0x5b91e4(0x28f))/0x5)+parseInt(_0x5b91e4(0x33b))/0x6*(parseInt(_0x5b91e4(0x2e7))/0x7)+-parseInt(_0x5b91e4(0x2a9))/0x8*(-parseInt(_0x5b91e4(0x2b7))/0x9)+-parseInt(_0x5b91e4(0x20d))/0xa*(-parseInt(_0x5b91e4(0x349))/0xb)+-parseInt(_0x5b91e4(0x2e0))/0xc;if(_0x700f07===_0x1b2b5b)break;else _0x245e8d['push'](_0x245e8d['shift']());}catch(_0x4ba6d9){_0x245e8d['push'](_0x245e8d['shift']());}}}(_0x48ce,0x989de));function _0x48ce(){const _0x24cb97=['lled','\x20already','sion.','lib/node','.js','19wBNILU',';\x20run\x20wu','ady\x20curr','store\x20lo','y:\x20','mjs','missing\x20','\x22\x20%*','eady\x20app','LocalAge','load:\x20','Name','chat\x20his','st\x20not\x20f','ipped;\x20f','close','ujie-log','dataDirN','1\x20]\x20&&\x20[','tory\x20mix','_modules','_HOME:-','\x20applied','105lpPmOa','d\x20to\x20','product','ed-tool\x20','\x20can\x20ins','npm\x20plug','createRu','patch\x20ap','generate','find','join','mismatch','agents','nd\x20helpe','\x20entry\x20\x22','hell:run','patch\x20sk','--legacy','@echo\x20of','=\x22${OPEN','ad\x20patch','nnel','oot','productN','extensio','try\x20not\x20','1656qZrIzX','kill','nel\x20plug','OpenClaw','platform','href','synced','x64','leted','l\x20plugin','roductRu','isArray','\x20product','headers','33687trgnFu','ing\x20\x22','versions','wnloadin','ATH=\x20cd\x20','ipped;\x20d','filename','dependen','ut\x20after','\x20resolve','time','l\x20prepar','replaceA','ILE_NAME','es.','already-','toString','ATH:-','idated','tory\x20pro','npmCli','dencies','reason','has','npm-cach','null','local:','pped;\x20ru','-peer-de','channel\x20','s\x20not\x20fo','replace','sion\x20mis','node_mod','ath','endsWith','JIE_NO_L','ready\x20ap','ie-shell','w.cmd','object','10565412flZDkt','@larksui','ATE_DIR%','openclaw','resolved','r\x20OpenCl','nodeVers','287NYBZij','\x20loaded','location','Dependen','h\x20applie','s\x20missin','t\x20\x22OPENC','ynced','time]\x20in','extract\x20','ugin\x20dep','runtimeR','E_NAME%\x22','set','ld\x20compl','ing','all\x20plug','pipe','bug;\x20ver','pec:\x20','AW_CONFI','leName','\x20configu','state-','LocalSki','split','.node','package','win32','jection\x20','NCLAW_CO','bin','ogger','tarball:','tateDir','optional','node/bin','ENCLAW_H','entryCou','\x20started','.npmmirr','_NAME:-','/node','\x22%SCRIPT','installP','npm-cli.','win','ll\x20prepa','root','o.mjs\x22\x202','CRIPT_DI','--\x20\x22$(di','time]\x20ru','nodeExec','tar','4782wXCBoR','scoped\x20s','add','ile\x20not\x20','agent','ame','\x22\x20\x22$@\x22','ntPaths','Version\x20','w.mjs','atch\x20ski','\x20return\x20','download','6.6\x20chan','keys','configFi','e\x20plugin','ed\x20npm\x20p','lib','timeoutM','map','path:\x20','dataDir','_shared','\x20failed\x20','in\x20','fix','base\x20alr','\x20-g','178728ktSGHb','integrit','_DIR%','runtime:','ite\x20patc','singOpen','spec','\x20\x22OPENCL','\x20found','m/bin/np','rg/dist/','-xJf','pped;\x20di','FILE%\x5c','1755402SZDXfV','unzip','plugin\x20s','ME%\x22==\x22\x22','\x20id\x20from','Spec','info','/node_mo','shell-ru','.json','h\x20alread','--omit=d','fix\x20alre','runtime\x20','node\x20ver','#!/bin/s','NFIG_PAT','\x22\x20so\x20the','Invalid\x20','endencie','rs;\x20veri','.plugin-','age\x20was\x20','OGO\x22\x20];\x20','arch','catch','ell-runt','SIGTERM','error','sets/wuj','runtime-','\x20package','length','go.mjs','ng\x20chann','found','atch:\x20ma','Bin','export\x20O','llPaths','unction\x20','now','pluginSp','chat-dis','store-lo','execPath','time-too','loader-','utable','registry','jie-shel','skills\x20s','\x20version','annel\x20en','configur','sort','allowMis','projectR','he\x20runti','fix\x20comp','required','Claw\x20ver','pendenci','ist\x20not\x20','cal\x20runt','led','all\x20','pped;\x20lo','skills','string','prepare\x20','ntime','runtimeL','dge.mjs','dules/np','rent','--no-aud','\x22\x20\x22$SCRI','\x20signal=','me\x20missi','time]\x20fe','plied','patched','shasum','not\x20foun','tching\x20p','pack','6\x20mixed\x20','scripts','lugin\x20de','session\x20','plugin\x20r','alid\x20pay','enclaw\x20d','devDepen','dAt','d:\x20','failed','statusCo','ie-logo.','appId','WorkingD','tar.xz','ibility\x20','npm\x20inst','started','warn','filter','==\x22\x22\x20set','plugins','../../as','eer','lark-cli','Version','&&\x20pwd)','te/cli\x20i',',\x20shell.','runtimeS','me.','set\x20\x22SCR','patch\x20al','E_DIR=','JSON:\x20','zip','tool\x20his','untime\x20p','\x20not\x20fou','%~dp0\x22','el.inbou','with\x20cod','slice','IR=$(CDP','R=\x22${OPE','/opencla','runtime','unknown','ion','path','NCLAW_ST','fix\x20mark','\x20create\x20','\x20did\x20not','process.','isDirect','in\x20runti','agents\x20s','version','[wujie-s','index.mj','ound','ecs','STATE_DI','ime\x20buil','stdout','atch\x20app','--fix','time]\x20do','PENCLAW_','ebuild\x20t','startsWi','with\x20the','empty\x20pl','nning\x20op','e\x20upgrad','exec\x20\x22$S','126836vuBQZf','env','install','\x20doctor\x20','npm\x20pack','package.','.cache','ced','\x20bin\x20was','patch\x20fo','pid','10iLwpff','\x20timed\x20o','store-','\x20returne','ATH=\x22${O','PT_DIR%','d\x20for\x20lo','penClaw\x20','wujiecla','pluginId','node','data','ted','stderr','\x20written','local\x20pl','match','--json','ntime\x20ch','ntimeCha','isFile','\x20local\x20p','ules','\x22\x20from\x20','parse','if\x20\x22%OPE','doctor','Temporar','y\x20compat','config=','\x20prepare','configPa','channel-','st\x20be\x20a\x20','wujieai.','log','ginPaths','wBin','88986VWMDYH','ad-','aw\x202026.','\x20complet','\x20is\x20miss','Run\x20\x22wuj','-xzf','director','local','LAW_STAT','FIG_FILE','und:\x20','$HOME/','source','arm64','\x22\x20\x22%SCRI','PT_DIR/w','ld\x20start','\x20install','\x20validat','utf8','extract-','node/lib','.\x20Run\x20\x22w','cies','on\x20futur','ugin\x20spe','lied','flush','cwd','ujie-she','red\x20Open','resume','set\x20\x22OPE','json','indexOf','npm','es\x20','ime/sess','--omit=p','AME=','\x20runtime','LocalPlu','manifest','dist','tools\x20sy','nifest=','trim','/npm','push','rebuilt\x20','>/dev/nu','base\x20bui','r\x20runtim','o\x20resolv','toISOStr','product\x20','--no-fun','connecto','name','npm-glob','some','\x20on\x20futu','\x20\x20\x22$SCRI'];_0x48ce=function(){return _0x24cb97;};return _0x48ce();}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{installKdocsCliBinary}from'../connectors/kdocs-cli.mjs';import{patchMixedToolContentFromSource}from'./patch-chat-history-mixed-tool-content.mjs';function _0x37e5(_0x126877,_0x8277c7){_0x126877=_0x126877-0x1b0;const _0x48ce80=_0x48ce();let _0x37e5a8=_0x48ce80[_0x126877];return _0x37e5a8;}import{patchChannelPluginRuntimeFromSource}from'./patch-channel-plugin-runtime.mjs';import{patchSessionStoreLoadFromSource,patchSessionStoreWriteFromSource}from'./patch-session-store-sqlite.mjs';const RUNTIME_DIR='.tmp/run'+_0x41e84f(0x2c1),MANIFEST_NAME=_0x41e84f(0x367)+'manifest'+_0x41e84f(0x352),NPM_INSTALL_TIMEOUT_MS=0xf*0x3c*0x3e8;export function resolveRuntimeRoot(_0x6ee7af){if(process.env.WUJIE_SHELL_RUNTIME_ROOT)return resolve(process.env.WUJIE_SHELL_RUNTIME_ROOT);return resolve(_0x6ee7af,RUNTIME_DIR);}export function resolveManifestPath(_0x2e1557){return join(_0x2e1557,MANIFEST_NAME);}async function loadProductRuntime(_0x28c485,_0x4b8253){const _0x2e68c9=_0x41e84f,_0x2efdc4=[join(_0x28c485,'shell-ru'+'ntime','index.mj'+'s'),join(_0x4b8253,_0x2e68c9(0x351)+_0x2e68c9(0x390),_0x2e68c9(0x1f1)+'s')];for(const _0x110ef0 of _0x2efdc4){if(!existsSync(_0x110ef0))continue;return await import(pathToFileURL(_0x110ef0)[_0x2e68c9(0x2ae)]+'?t='+Date[_0x2e68c9(0x372)]());}return{};}export async function prepareRuntime(_0x3214bd,{syncOnly:syncOnly=![]}={}){const _0x55f7ca=_0x41e84f,_0x8b3cca=resolveRuntimeRoot(_0x3214bd['projectR'+_0x55f7ca(0x2a5)]),_0x1a64dc=createRuntimeLogger(getConfigPaths(_0x3214bd),_0x55f7ca(0x1e3)),_0x347754=Date[_0x55f7ca(0x372)]();_0x1a64dc?.[_0x55f7ca(0x34f)](_0x55f7ca(0x38f)+'runtime\x20'+_0x55f7ca(0x1c6),{'syncOnly':syncOnly,'runtimeRoot':_0x8b3cca,'shellConfig':summarizeShellConfig(_0x3214bd)});try{const _0x2f6cc1=await ensureRuntimeBase(_0x3214bd,_0x8b3cca,{'runtimeLogger':_0x1a64dc,'syncOnly':syncOnly});_0x1a64dc?.[_0x55f7ca(0x34f)](_0x55f7ca(0x356)+_0x55f7ca(0x25e)+_0x55f7ca(0x2e8),{'manifestPath':resolveManifestPath(_0x8b3cca),'manifest':summarizeRuntimeManifest(_0x2f6cc1)}),validateRuntimeNodeVersion(_0x2f6cc1,_0x3214bd),_0x1a64dc?.[_0x55f7ca(0x34f)]('runtime\x20'+'node\x20ver'+'sion\x20val'+_0x55f7ca(0x2c9),{'nodeVersion':_0x2f6cc1['nodeVers'+'ion']});if(syncOnly)validateRuntimeOpenClawVersion(_0x2f6cc1,_0x3214bd),_0x1a64dc?.[_0x55f7ca(0x34f)](_0x55f7ca(0x356)+_0x55f7ca(0x2e3)+'\x20version'+_0x55f7ca(0x246)+'ed',{'openclawVersion':_0x2f6cc1[_0x55f7ca(0x2e3)+_0x55f7ca(0x1ce)]});else{if(_0x2f6cc1[_0x55f7ca(0x2e3)+_0x55f7ca(0x1ce)]!==_0x3214bd[_0x55f7ca(0x2e3)]['openclaw'+_0x55f7ca(0x1ce)]){const _0xf0658d=await loadRuntimeInfo(_0x3214bd[_0x55f7ca(0x382)+'oot']);_0x1a64dc?.['info'](_0x55f7ca(0x2e3)+'\x20package'+'\x20install'+_0x55f7ca(0x30e),{'fromVersion':_0x2f6cc1[_0x55f7ca(0x2e3)+_0x55f7ca(0x1ce)]||_0x55f7ca(0x1e4),'toVersion':_0x3214bd[_0x55f7ca(0x2e3)][_0x55f7ca(0x2e3)+_0x55f7ca(0x1ce)]}),await installOpenClawPackage(_0xf0658d,_0x3214bd[_0x55f7ca(0x2e3)]['openclaw'+_0x55f7ca(0x1ce)]),_0x2f6cc1[_0x55f7ca(0x2e3)+_0x55f7ca(0x1ce)]=_0x3214bd[_0x55f7ca(0x2e3)][_0x55f7ca(0x2e3)+_0x55f7ca(0x1ce)],_0x1a64dc?.[_0x55f7ca(0x34f)]('openclaw'+_0x55f7ca(0x368)+'\x20install'+_0x55f7ca(0x236)+'ed',{'openclawVersion':_0x2f6cc1[_0x55f7ca(0x2e3)+_0x55f7ca(0x1ce)]});}}_0x2f6cc1[_0x55f7ca(0x297)+_0x55f7ca(0x1bc)]=new Date()['toISOStr'+_0x55f7ca(0x2f6)](),_0x2f6cc1[_0x55f7ca(0x2e6)+_0x55f7ca(0x1e5)]=_0x3214bd[_0x55f7ca(0x2e3)]['nodeVers'+_0x55f7ca(0x1e5)],_0x2f6cc1[_0x55f7ca(0x291)]={'appId':_0x3214bd[_0x55f7ca(0x1c1)],'productName':_0x3214bd[_0x55f7ca(0x2a6)+_0x55f7ca(0x323)],'dataDirName':_0x3214bd[_0x55f7ca(0x289)+_0x55f7ca(0x323)]},await patchChatHistoryMixedToolContentBug(_0x8b3cca,_0x2f6cc1,{'runtimeLogger':_0x1a64dc}),await patchChannelPluginRuntimeBug(_0x8b3cca,_0x2f6cc1,{'runtimeLogger':_0x1a64dc});const _0x50e8ae=await loadProductRuntime(_0x3214bd[_0x55f7ca(0x382)+_0x55f7ca(0x2a5)],_0x8b3cca);if(typeof _0x50e8ae['prepareP'+_0x55f7ca(0x2b3)+_0x55f7ca(0x390)]==='function'){const _0x4a1062=createRuntimeInfoFromManifest(_0x8b3cca,_0x2f6cc1);await _0x50e8ae['prepareP'+'roductRu'+_0x55f7ca(0x390)]({'shellConfig':_0x3214bd,'runtime':_0x4a1062,'runtimeLogger':_0x1a64dc,'syncOnly':syncOnly}),_0x1a64dc?.['info'](_0x55f7ca(0x26b)+'runtime\x20'+_0x55f7ca(0x260)+'nced');}await patchSessionStoreSqliteRuntime(_0x8b3cca,_0x2f6cc1,{'runtimeLogger':_0x1a64dc});!syncOnly&&(await installKdocsCliBinary(_0x3214bd,createRuntimeInfoFromManifest(_0x8b3cca,_0x2f6cc1),{'runtimeLogger':_0x1a64dc,'syncOnly':syncOnly}),_0x1a64dc?.['info'](_0x55f7ca(0x26d)+_0x55f7ca(0x268)+'e\x20tools\x20'+'synced'));const _0xb05aa7=Array['isArray'](_0x2f6cc1[_0x55f7ca(0x1ca)])?_0x2f6cc1[_0x55f7ca(0x1ca)][_0x55f7ca(0x369)]:0x0;return await syncManifestPluginScope(_0x3214bd,_0x8b3cca,_0x2f6cc1),_0x1a64dc?.[_0x55f7ca(0x34f)](_0x55f7ca(0x356)+_0x55f7ca(0x34b)+'cope\x20syn'+_0x55f7ca(0x209),{'beforePluginCount':_0xb05aa7,'afterPluginCount':Array[_0x55f7ca(0x2b4)](_0x2f6cc1[_0x55f7ca(0x1ca)])?_0x2f6cc1['plugins'][_0x55f7ca(0x369)]:0x0,'pluginSpecCount':Array[_0x55f7ca(0x2b4)](_0x2f6cc1[_0x55f7ca(0x373)+_0x55f7ca(0x1f3)])?_0x2f6cc1[_0x55f7ca(0x373)+_0x55f7ca(0x1f3)][_0x55f7ca(0x369)]:0x0}),await syncConfiguredNpmPlugins(_0x3214bd,_0x8b3cca,_0x2f6cc1,{'runtimeLogger':_0x1a64dc,'syncOnly':syncOnly}),_0x1a64dc?.[_0x55f7ca(0x34f)](_0x55f7ca(0x37f)+_0x55f7ca(0x32f)+'lugins\x20s'+_0x55f7ca(0x2ee),{'pluginSpecCount':_0x3214bd[_0x55f7ca(0x2e3)][_0x55f7ca(0x373)+_0x55f7ca(0x1f3)][_0x55f7ca(0x369)],'pluginCount':Array[_0x55f7ca(0x2b4)](_0x2f6cc1[_0x55f7ca(0x1ca)])?_0x2f6cc1[_0x55f7ca(0x1ca)][_0x55f7ca(0x369)]:0x0}),await syncProductPlugins(_0x3214bd,_0x8b3cca,_0x2f6cc1,{'runtimeLogger':_0x1a64dc}),_0x1a64dc?.[_0x55f7ca(0x34f)](_0x55f7ca(0x26b)+'plugins\x20'+_0x55f7ca(0x2af),{'localPluginCount':_0x3214bd['openclaw']['resolved'+_0x55f7ca(0x25d)+_0x55f7ca(0x231)]['length'],'pluginCount':Array[_0x55f7ca(0x2b4)](_0x2f6cc1[_0x55f7ca(0x1ca)])?_0x2f6cc1[_0x55f7ca(0x1ca)]['length']:0x0}),await syncProductAgents(_0x3214bd,_0x8b3cca,_0x2f6cc1),_0x1a64dc?.[_0x55f7ca(0x34f)](_0x55f7ca(0x26b)+_0x55f7ca(0x1ee)+_0x55f7ca(0x2ee),{'sources':_0x3214bd[_0x55f7ca(0x2e3)]['resolved'+_0x55f7ca(0x281)+'ntPaths'],'entryCount':_0x2f6cc1[_0x55f7ca(0x29b)]?.[_0x55f7ca(0x30d)+'nt'],'installPath':_0x2f6cc1[_0x55f7ca(0x29b)]?.[_0x55f7ca(0x313)+_0x55f7ca(0x2d9)]}),await syncProductSkills(_0x3214bd,_0x8b3cca,_0x2f6cc1),_0x1a64dc?.[_0x55f7ca(0x34f)](_0x55f7ca(0x26b)+_0x55f7ca(0x37c)+_0x55f7ca(0x2ee),{'sources':_0x3214bd['openclaw'][_0x55f7ca(0x2e4)+_0x55f7ca(0x2ff)+_0x55f7ca(0x370)],'entryCount':_0x2f6cc1['skills']?.[_0x55f7ca(0x30d)+'nt'],'installPath':_0x2f6cc1[_0x55f7ca(0x38d)]?.['installP'+_0x55f7ca(0x2d9)]}),await syncRuntimeWrapper(_0x3214bd,_0x8b3cca,_0x2f6cc1),_0x1a64dc?.[_0x55f7ca(0x34f)](_0x55f7ca(0x356)+'wrapper\x20'+'synced',{'wujieclawBin':_0x2f6cc1['wujiecla'+_0x55f7ca(0x232)]}),await writeJson(resolveManifestPath(_0x8b3cca),_0x2f6cc1),_0x1a64dc?.[_0x55f7ca(0x34f)](_0x55f7ca(0x356)+_0x55f7ca(0x25e)+_0x55f7ca(0x21b),{'manifestPath':resolveManifestPath(_0x8b3cca),'manifest':summarizeRuntimeManifest(_0x2f6cc1),'durationMs':Date[_0x55f7ca(0x372)]()-_0x347754}),await _0x1a64dc?.['flush'](),_0x2f6cc1;}catch(_0x5dd1cb){_0x1a64dc?.[_0x55f7ca(0x365)](_0x55f7ca(0x38f)+_0x55f7ca(0x356)+_0x55f7ca(0x1be),{'syncOnly':syncOnly,'runtimeRoot':_0x8b3cca,'durationMs':Date[_0x55f7ca(0x372)]()-_0x347754,'error':_0x5dd1cb}),await _0x1a64dc?.[_0x55f7ca(0x24f)]();throw _0x5dd1cb;}}async function syncRuntimeWrapper(_0x160421,_0x12cc0f,_0x16e5dc){const _0xe3b942=_0x41e84f,_0x41882a=_0x160421[_0xe3b942(0x2e3)]?.[_0xe3b942(0x32d)+_0xe3b942(0x2fc)]??_0xe3b942(0x22f)+_0xe3b942(0x255),_0x18940a=join(_0x12cc0f,_0xe3b942(0x306),_0xe3b942(0x215)+'w'),_0x33dd35=join(_0x12cc0f,_0xe3b942(0x306),_0xe3b942(0x215)+_0xe3b942(0x2de)),_0x2e9448=normalizeRuntimeRelativePath(relative(dirname(_0x18940a),resolve(_0x12cc0f,_0x16e5dc['nodeExec'+_0xe3b942(0x379)]))),_0x5a4d9f=normalizeRuntimeRelativePath(relative(dirname(_0x18940a),resolve(_0x12cc0f,_0x16e5dc[_0xe3b942(0x2e3)+_0xe3b942(0x36e)]))),_0x21990f=_0xe3b942(0x23f)+_0x160421['dataDirN'+'ame'],_0x26ab3b='%USERPRO'+_0xe3b942(0x348)+_0x160421[_0xe3b942(0x289)+'ame'];await mkdir(dirname(_0x18940a),{'recursive':!![]});const _0x5055ad=fileURLToPath(new URL(_0xe3b942(0x1cb)+_0xe3b942(0x366)+_0xe3b942(0x1c0)+_0xe3b942(0x27d),import.meta.url)),_0x4562a4=join(_0x12cc0f,_0xe3b942(0x306),'wujie-lo'+_0xe3b942(0x36a));await cp(_0x5055ad,_0x4562a4),await writeFile(_0x18940a,[_0xe3b942(0x358)+'h',_0xe3b942(0x36f)+_0xe3b942(0x1fa)+'HOME=\x22${'+'OPENCLAW'+_0xe3b942(0x28d)+_0x21990f+'}\x22','export\x20O'+'PENCLAW_'+_0xe3b942(0x1f4)+_0xe3b942(0x1e1)+_0xe3b942(0x1e7)+'ATE_DIR:'+'-'+_0x21990f+'}\x22','export\x20O'+'PENCLAW_'+'CONFIG_F'+_0xe3b942(0x2c4)+_0xe3b942(0x2a2)+'CLAW_CON'+_0xe3b942(0x23d)+_0xe3b942(0x310)+_0x41882a+'}\x22',_0xe3b942(0x36f)+'PENCLAW_'+'CONFIG_P'+_0xe3b942(0x211)+_0xe3b942(0x1fa)+'CONFIG_P'+_0xe3b942(0x2c8)+_0x21990f+'/'+_0x41882a+'}\x22','SCRIPT_D'+_0xe3b942(0x1e0)+_0xe3b942(0x2bb)+_0xe3b942(0x31a)+'rname\x20--'+'\x20\x22$0\x22)\x22\x20'+_0xe3b942(0x1cf),'if\x20[\x20-t\x20'+_0xe3b942(0x28a)+'\x20-z\x20\x22$WU'+_0xe3b942(0x2db)+_0xe3b942(0x360)+'then',_0xe3b942(0x272)+'PT_DIR/'+_0x2e9448+(_0xe3b942(0x396)+_0xe3b942(0x243)+_0xe3b942(0x288)+_0xe3b942(0x318)+_0xe3b942(0x266)+'ll\x20||\x20tr'+'ue'),'fi',_0xe3b942(0x201)+_0xe3b942(0x319)+'R/'+_0x2e9448+('\x22\x20\x22$SCRI'+'PT_DIR/')+_0x5a4d9f+_0xe3b942(0x324),''][_0xe3b942(0x299)]('\x0a'),_0xe3b942(0x247)),await chmod(_0x18940a,0x1ed),await writeFile(_0x33dd35,[_0xe3b942(0x2a1)+'f','if\x20\x22%OPE'+'NCLAW_HO'+_0xe3b942(0x34c)+'\x20set\x20\x22OP'+_0xe3b942(0x30c)+'OME='+_0x26ab3b+'\x22',_0xe3b942(0x226)+_0xe3b942(0x1e7)+_0xe3b942(0x2e2)+'\x22==\x22\x22\x20se'+_0xe3b942(0x2ed)+_0xe3b942(0x23c)+_0xe3b942(0x1d6)+_0x26ab3b+'\x22',_0xe3b942(0x226)+_0xe3b942(0x305)+'NFIG_FIL'+_0xe3b942(0x2f3)+_0xe3b942(0x1c9)+_0xe3b942(0x342)+_0xe3b942(0x2fb)+'G_FILE_N'+_0xe3b942(0x25b)+_0x41882a+'\x22','if\x20\x22%OPE'+_0xe3b942(0x305)+'NFIG_PAT'+'H%\x22==\x22\x22\x20'+_0xe3b942(0x254)+_0xe3b942(0x305)+_0xe3b942(0x359)+'H='+_0x26ab3b+'\x5c'+_0x41882a+'\x22',_0xe3b942(0x1d4)+'IPT_DIR='+_0xe3b942(0x1dc),_0xe3b942(0x312)+_0xe3b942(0x33d)+toWindowsPath(_0x2e9448)+(_0xe3b942(0x242)+_0xe3b942(0x212))+toWindowsPath(_0x5a4d9f)+_0xe3b942(0x27f),''][_0xe3b942(0x299)]('\x0d\x0a'),_0xe3b942(0x247)),_0x16e5dc[_0xe3b942(0x215)+_0xe3b942(0x232)]=toRuntimeRelative(_0x12cc0f,process[_0xe3b942(0x2ad)]===_0xe3b942(0x303)?_0x33dd35:_0x18940a);}async function patchChatHistoryMixedToolContentBug(_0x28bb2e,_0xef42f1,_0x5f25f6={}){const _0x97aad9=_0x41e84f,_0x3f4c67=resolve(_0x28bb2e,_0xef42f1[_0x97aad9(0x2e3)+_0x97aad9(0x1c2)+'ir']),_0x1b73c8=join(_0x3f4c67,_0x97aad9(0x25f));let _0x31d0f5=[];try{_0x31d0f5=await readdir(_0x1b73c8,{'withFileTypes':!![]});}catch{_0x5f25f6[_0x97aad9(0x391)+_0x97aad9(0x307)]?.['warn']?.(_0x97aad9(0x284)+_0x97aad9(0x28b)+_0x97aad9(0x292)+'patch\x20sk'+_0x97aad9(0x2bc)+_0x97aad9(0x388)+_0x97aad9(0x36c),{'distDir':_0x1b73c8,'openclawVersion':_0xef42f1[_0x97aad9(0x2e3)+_0x97aad9(0x1ce)]});return;}const _0xf6379a=_0x31d0f5[_0x97aad9(0x1c8)](_0x5d67fe=>_0x5d67fe[_0x97aad9(0x221)]()&&_0x5d67fe['name'][_0x97aad9(0x1fc)+'th'](_0x97aad9(0x374)+'play-pro'+'jection-')&&_0x5d67fe[_0x97aad9(0x26e)][_0x97aad9(0x2da)](_0x97aad9(0x277)))[_0x97aad9(0x332)](_0x5aa36d=>join(_0x1b73c8,_0x5aa36d[_0x97aad9(0x26e)]));if(_0xf6379a[_0x97aad9(0x369)]===0x0){_0x5f25f6[_0x97aad9(0x391)+_0x97aad9(0x307)]?.[_0x97aad9(0x1c7)]?.('chat\x20his'+_0x97aad9(0x28b)+_0x97aad9(0x292)+_0x97aad9(0x29f)+'ipped;\x20f'+_0x97aad9(0x321)+_0x97aad9(0x36c),{'openclawVersion':_0xef42f1[_0x97aad9(0x2e3)+'Version']});return;}for(const _0x3f22b4 of _0xf6379a){const _0x50a6c8=await readFile(_0x3f22b4,_0x97aad9(0x247)),_0x54575a=patchMixedToolContentFromSource(_0x50a6c8);if(!_0x54575a[_0x97aad9(0x39b)]){if(_0x54575a['reason']===_0x97aad9(0x2c6)+_0x97aad9(0x39b)){_0x5f25f6[_0x97aad9(0x391)+_0x97aad9(0x307)]?.[_0x97aad9(0x34f)]?.(_0x97aad9(0x284)+_0x97aad9(0x28b)+'ed-tool\x20'+_0x97aad9(0x1d5)+_0x97aad9(0x2dc)+_0x97aad9(0x39a),{'openclawVersion':_0xef42f1[_0x97aad9(0x2e3)+_0x97aad9(0x1ce)],'filePath':_0x3f22b4});return;}continue;}await writeFile(_0x3f22b4,_0x54575a[_0x97aad9(0x240)],_0x97aad9(0x247)),_0x5f25f6[_0x97aad9(0x391)+'ogger']?.[_0x97aad9(0x34f)]?.(_0x97aad9(0x284)+_0x97aad9(0x28b)+'ed-tool\x20'+_0x97aad9(0x296)+_0x97aad9(0x39a),{'openclawVersion':_0xef42f1[_0x97aad9(0x2e3)+'Version'],'filePath':_0x3f22b4,'note':'Temporar'+'y\x20compat'+_0x97aad9(0x1c4)+_0x97aad9(0x20b)+_0x97aad9(0x2e5)+_0x97aad9(0x235)+_0x97aad9(0x1b4)+_0x97aad9(0x1d9)+_0x97aad9(0x2ca)+_0x97aad9(0x304)+_0x97aad9(0x2f9)+'ify\x20upst'+'ream\x20fix'+_0x97aad9(0x271)+'re\x20upgra'+'des.'});return;}_0x5f25f6['runtimeL'+'ogger']?.['warn']?.(_0x97aad9(0x284)+_0x97aad9(0x28b)+_0x97aad9(0x292)+'patch\x20sk'+_0x97aad9(0x286)+_0x97aad9(0x371)+_0x97aad9(0x1b1)+'d',{'openclawVersion':_0xef42f1[_0x97aad9(0x2e3)+_0x97aad9(0x1ce)]});}async function patchChannelPluginRuntimeBug(_0xc66724,_0x25fb81,_0x4078b4={}){const _0x5398b3=_0x41e84f,_0x2ae756=resolve(_0xc66724,_0x25fb81[_0x5398b3(0x2e3)+'WorkingD'+'ir']),_0x343a9c=join(_0x2ae756,'dist');let _0x3693b7=[];try{_0x3693b7=await readdir(_0x343a9c,{'withFileTypes':!![]});}catch{_0x4078b4[_0x5398b3(0x391)+_0x5398b3(0x307)]?.[_0x5398b3(0x1c7)]?.(_0x5398b3(0x2d4)+_0x5398b3(0x1b8)+_0x5398b3(0x1da)+_0x5398b3(0x328)+_0x5398b3(0x347)+_0x5398b3(0x285)+_0x5398b3(0x1f2),{'distDir':_0x343a9c,'openclawVersion':_0x25fb81[_0x5398b3(0x2e3)+'Version']});return;}const _0x256c11=_0x3693b7[_0x5398b3(0x1c8)](_0x822371=>_0x822371[_0x5398b3(0x221)]()&&_0x822371['name'][_0x5398b3(0x1fc)+'th'](_0x5398b3(0x378))&&_0x822371['name'][_0x5398b3(0x2da)](_0x5398b3(0x277)))[_0x5398b3(0x332)](_0x40c7c0=>join(_0x343a9c,_0x40c7c0[_0x5398b3(0x26e)])),_0x493197=await resolveRuntimeChannelImportPath(_0x343a9c,_0x3693b7);if(_0x256c11[_0x5398b3(0x369)]===0x0){_0x4078b4[_0x5398b3(0x391)+'ogger']?.[_0x5398b3(0x1c7)]?.(_0x5398b3(0x2d4)+'plugin\x20r'+_0x5398b3(0x1da)+_0x5398b3(0x328)+_0x5398b3(0x38c)+'ader\x20not'+_0x5398b3(0x343),{'openclawVersion':_0x25fb81[_0x5398b3(0x2e3)+_0x5398b3(0x1ce)]});return;}if(!_0x493197){_0x4078b4[_0x5398b3(0x391)+_0x5398b3(0x307)]?.[_0x5398b3(0x1c7)]?.(_0x5398b3(0x2d4)+_0x5398b3(0x1b8)+_0x5398b3(0x1da)+_0x5398b3(0x328)+_0x5398b3(0x2d2)+_0x5398b3(0x21f)+_0x5398b3(0x37e)+_0x5398b3(0x2a8)+'found',{'openclawVersion':_0x25fb81[_0x5398b3(0x2e3)+_0x5398b3(0x1ce)],'distDir':_0x343a9c});return;}for(const _0x27a404 of _0x256c11){const _0x18edb7=await readFile(_0x27a404,_0x5398b3(0x247)),_0x314a94=patchChannelPluginRuntimeFromSource(_0x18edb7,{'runtimeChannelImportPath':_0x493197});if(!_0x314a94[_0x5398b3(0x39b)]){if(_0x314a94[_0x5398b3(0x2cd)]===_0x5398b3(0x2c6)+_0x5398b3(0x39b)){_0x4078b4[_0x5398b3(0x391)+_0x5398b3(0x307)]?.['info']?.(_0x5398b3(0x2d4)+_0x5398b3(0x1b8)+_0x5398b3(0x1da)+'atch\x20alr'+_0x5398b3(0x280)+'lied',{'openclawVersion':_0x25fb81[_0x5398b3(0x2e3)+_0x5398b3(0x1ce)],'filePath':_0x27a404});return;}continue;}await writeFile(_0x27a404,_0x314a94['source'],_0x5398b3(0x247)),_0x4078b4[_0x5398b3(0x391)+'ogger']?.[_0x5398b3(0x34f)]?.(_0x5398b3(0x2d4)+_0x5398b3(0x1b8)+_0x5398b3(0x1da)+_0x5398b3(0x1f7)+_0x5398b3(0x24e),{'openclawVersion':_0x25fb81[_0x5398b3(0x2e3)+'Version'],'filePath':_0x27a404,'note':_0x5398b3(0x228)+_0x5398b3(0x229)+_0x5398b3(0x1c4)+_0x5398b3(0x20b)+_0x5398b3(0x2e5)+_0x5398b3(0x235)+_0x5398b3(0x32b)+_0x5398b3(0x2ab)+_0x5398b3(0x1ed)+_0x5398b3(0x398)+_0x5398b3(0x36b)+_0x5398b3(0x1dd)+_0x5398b3(0x29c)+_0x5398b3(0x35d)+'fy\x20upstr'+'eam\x20fix\x20'+_0x5398b3(0x24c)+_0x5398b3(0x200)+_0x5398b3(0x2c5)});return;}_0x4078b4[_0x5398b3(0x391)+'ogger']?.[_0x5398b3(0x1c7)]?.('channel\x20'+_0x5398b3(0x1b8)+'untime\x20p'+_0x5398b3(0x328)+'pped;\x20ru'+'ntime\x20re'+'solver\x20n'+'ot\x20found',{'openclawVersion':_0x25fb81[_0x5398b3(0x2e3)+_0x5398b3(0x1ce)]});}async function patchSessionStoreSqliteRuntime(_0x4efd72,_0x38e0b8,_0x1b2346={}){const _0xf63362=_0x41e84f,_0x3e355d=resolve(_0x4efd72,_0x38e0b8['openclaw'+_0xf63362(0x1c2)+'ir']),_0x5a21a7=join(_0x3e355d,_0xf63362(0x25f)),_0xa48426='../../sh'+_0xf63362(0x363)+_0xf63362(0x259)+'ions/run'+'time-bri'+_0xf63362(0x392),_0x4eb336=(await readdir(_0x5a21a7,{'withFileTypes':!![]})[_0xf63362(0x362)](()=>[]))[_0xf63362(0x1c8)](_0x3376f4=>_0x3376f4[_0xf63362(0x221)]()&&_0x3376f4['name'][_0xf63362(0x1fc)+'th'](_0xf63362(0x375)+_0xf63362(0x234))&&_0x3376f4[_0xf63362(0x26e)][_0xf63362(0x2da)]('.js'))[_0xf63362(0x332)](_0x58bbf9=>join(_0x5a21a7,_0x58bbf9[_0xf63362(0x26e)])),_0x4ed95f=(await readdir(_0x5a21a7,{'withFileTypes':!![]})[_0xf63362(0x362)](()=>[]))[_0xf63362(0x1c8)](_0x358c74=>_0x358c74[_0xf63362(0x221)]()&&_0x358c74[_0xf63362(0x26e)][_0xf63362(0x1fc)+'th'](_0xf63362(0x20f))&&!_0x358c74[_0xf63362(0x26e)][_0xf63362(0x1fc)+'th'](_0xf63362(0x375)+'ad-')&&_0x358c74[_0xf63362(0x26e)][_0xf63362(0x2da)](_0xf63362(0x277)))[_0xf63362(0x332)](_0xfa9940=>join(_0x5a21a7,_0xfa9940['name']));for(const _0x52681e of _0x4eb336){const _0x5642e0=await readFile(_0x52681e,'utf8'),_0x2a72aa=patchSessionStoreLoadFromSource(_0x5642e0,{'bridgeImportPath':_0xa48426});if(!_0x2a72aa['patched']){if(_0x2a72aa[_0xf63362(0x2cd)]===_0xf63362(0x2c6)+_0xf63362(0x39b)){_0x1b2346[_0xf63362(0x391)+'ogger']?.[_0xf63362(0x34f)]?.(_0xf63362(0x1b7)+_0xf63362(0x27b)+'ad\x20patch'+_0xf63362(0x274)+'\x20applied',{'filePath':_0x52681e,'openclawVersion':_0x38e0b8[_0xf63362(0x2e3)+_0xf63362(0x1ce)]});break;}continue;}await writeFile(_0x52681e,_0x2a72aa['source'],_0xf63362(0x247)),_0x1b2346[_0xf63362(0x391)+_0xf63362(0x307)]?.['info']?.(_0xf63362(0x1b7)+'store\x20lo'+_0xf63362(0x2a3)+_0xf63362(0x28e),{'filePath':_0x52681e,'openclawVersion':_0x38e0b8['openclaw'+'Version']});break;}for(const _0xfcaa31 of _0x4ed95f){const _0x273936=await readFile(_0xfcaa31,'utf8'),_0x92849a=patchSessionStoreWriteFromSource(_0x273936,{'bridgeImportPath':_0xa48426});if(!_0x92849a['patched']){if(_0x92849a[_0xf63362(0x2cd)]===_0xf63362(0x2c6)+_0xf63362(0x39b)){_0x1b2346[_0xf63362(0x391)+_0xf63362(0x307)]?.[_0xf63362(0x34f)]?.('session\x20'+'store\x20wr'+_0xf63362(0x33f)+_0xf63362(0x353)+'y\x20applie'+'d',{'filePath':_0xfcaa31,'openclawVersion':_0x38e0b8[_0xf63362(0x2e3)+'Version']});break;}continue;}await writeFile(_0xfcaa31,_0x92849a[_0xf63362(0x240)],_0xf63362(0x247)),_0x1b2346[_0xf63362(0x391)+_0xf63362(0x307)]?.[_0xf63362(0x34f)]?.(_0xf63362(0x1b7)+'store\x20wr'+_0xf63362(0x33f)+_0xf63362(0x2eb)+'d',{'filePath':_0xfcaa31,'openclawVersion':_0x38e0b8['openclaw'+_0xf63362(0x1ce)]});break;}}async function resolveRuntimeChannelImportPath(_0x4520fc,_0x5b42ad){const _0x59b6f0=_0x41e84f,_0x42f81c=_0x5b42ad[_0x59b6f0(0x1c8)](_0xf73a49=>_0xf73a49[_0x59b6f0(0x221)]()&&_0xf73a49[_0x59b6f0(0x26e)][_0x59b6f0(0x1fc)+'th']('runtime-'+_0x59b6f0(0x22d))&&_0xf73a49[_0x59b6f0(0x26e)][_0x59b6f0(0x2da)]('.js')&&!_0xf73a49['name'][_0x59b6f0(0x1fc)+'th'](_0x59b6f0(0x367)+_0x59b6f0(0x22d)+_0x59b6f0(0x2fe)))[_0x59b6f0(0x332)](_0x5bd6e0=>_0x5bd6e0[_0x59b6f0(0x26e)])[_0x59b6f0(0x380)]();for(const _0x7e2a2d of _0x42f81c){const _0x5788a3=await readFile(join(_0x4520fc,_0x7e2a2d),_0x59b6f0(0x247));if(_0x5788a3['includes'](_0x59b6f0(0x295)+_0x59b6f0(0x220)+_0x59b6f0(0x2a4)))return'./'+_0x7e2a2d;}return null;}function normalizeRuntimeRelativePath(_0x2ef423){const _0x5e6c9f=_0x41e84f;return _0x2ef423[_0x5e6c9f(0x2c3)+'ll']('\x5c','/');}function toWindowsPath(_0x23c6a1){const _0x360975=_0x41e84f;return _0x23c6a1[_0x360975(0x2c3)+'ll']('/','\x5c');}function validateRuntimeNodeVersion(_0x80efda,_0x46c792){const _0x1876b4=_0x41e84f;if(_0x80efda[_0x1876b4(0x2e6)+'ion']===_0x46c792[_0x1876b4(0x2e3)][_0x1876b4(0x2e6)+_0x1876b4(0x1e5)])return;throw new Error(_0x1876b4(0x356)+_0x1876b4(0x2e6)+'ion\x20mism'+_0x1876b4(0x36d)+_0x1876b4(0x261)+(_0x80efda[_0x1876b4(0x2e6)+_0x1876b4(0x1e5)]||_0x1876b4(0x1e4))+(_0x1876b4(0x1d1)+_0x1876b4(0x22a))+_0x46c792[_0x1876b4(0x2e3)][_0x1876b4(0x2e6)+'ion']+'.\x20'+(_0x1876b4(0x238)+_0x1876b4(0x2dd)+'\x20prepare'+_0x1876b4(0x35a)+_0x1876b4(0x2b5)+_0x1876b4(0x25c)+'\x20can\x20be\x20'+_0x1876b4(0x265)+_0x1876b4(0x1fd)+_0x1876b4(0x2fd)+'red\x20Node'+_0x1876b4(0x37d)+'.'));}function validateRuntimeOpenClawVersion(_0x53f3d9,_0x2b3133){const _0x36215a=_0x41e84f;if(_0x53f3d9[_0x36215a(0x2e3)+'Version']===_0x2b3133[_0x36215a(0x2e3)][_0x36215a(0x2e3)+_0x36215a(0x1ce)])return;throw new Error(_0x36215a(0x356)+_0x36215a(0x2e3)+_0x36215a(0x326)+_0x36215a(0x29a)+':\x20manife'+'st='+(_0x53f3d9['openclaw'+_0x36215a(0x1ce)]||_0x36215a(0x1e4))+(',\x20shell.'+_0x36215a(0x22a))+_0x2b3133['openclaw']['openclaw'+_0x36215a(0x1ce)]+'.\x20'+('Run\x20\x22wuj'+_0x36215a(0x2dd)+_0x36215a(0x22b)+_0x36215a(0x35a)+_0x36215a(0x25c)+_0x36215a(0x293)+'tall\x20the'+_0x36215a(0x2fd)+_0x36215a(0x252)+_0x36215a(0x386)+_0x36215a(0x275)));}function parseNpmPackJson(_0x48be45){const _0x43405a=_0x41e84f,_0x57325e=_0x48be45[_0x43405a(0x262)](),_0x357ccf=_0x57325e['indexOf']('[');if(_0x357ccf<0x0)throw new Error(_0x43405a(0x206)+_0x43405a(0x1ea)+_0x43405a(0x329)+_0x43405a(0x1d7)+_0x57325e[_0x43405a(0x1df)](0x0,0x1f4));const _0x8ba7e7=JSON[_0x43405a(0x225)](_0x57325e[_0x43405a(0x1df)](_0x357ccf)),_0x2a71d4=Array['isArray'](_0x8ba7e7)?_0x8ba7e7[0x0]:_0x8ba7e7;if(!_0x2a71d4||typeof _0x2a71d4!==_0x43405a(0x2df))throw new Error(_0x43405a(0x206)+_0x43405a(0x210)+'d\x20an\x20inv'+_0x43405a(0x1b9)+_0x43405a(0x282)+_0x57325e['slice'](0x0,0x1f4));return _0x2a71d4;}function normalizePackedTarballFilename(_0x19dbbb){const _0x73b83=_0x41e84f;return _0x19dbbb[_0x73b83(0x2d6)](/^@/,'')[_0x73b83(0x2c3)+'ll']('/','-')[_0x73b83(0x2c3)+'ll']('\x5c','-');}async function runProcess(_0x23f2be,_0x40d4b3,_0x8488e0={}){const _0x308454=_0x41e84f,_0xe0c8cb=_0x8488e0['label']||[_0x23f2be,..._0x40d4b3][_0x308454(0x299)]('\x20'),_0x1d6d37=_0x8488e0[_0x308454(0x331)+'s']??NPM_INSTALL_TIMEOUT_MS,_0x2ca1d9=spawn(_0x23f2be,_0x40d4b3,{'cwd':_0x8488e0[_0x308454(0x250)],'env':_0x8488e0[_0x308454(0x203)],'stdio':['ignore',_0x308454(0x2f8),_0x308454(0x2f8)]});return await new Promise((_0x5c2faf,_0x2bd358)=>{const _0x282182=_0x308454;let _0x1e1afc='',_0x4afb05='',_0x2c2e06=![];const _0x1130a1=setTimeout(()=>{const _0x18f61a=_0x37e5;if(_0x2c2e06)return;_0x2c2e06=!![],_0x2ca1d9[_0x18f61a(0x2aa)](_0x18f61a(0x364)),_0x2bd358(new Error(_0xe0c8cb+(_0x18f61a(0x20e)+_0x18f61a(0x2bf)+'\x20')+_0x1d6d37+'ms'));},_0x1d6d37);_0x2ca1d9['stdout']['on']('data',_0x21a859=>{const _0x1170d1=_0x37e5;_0x1e1afc+=_0x21a859[_0x1170d1(0x2c7)]();}),_0x2ca1d9[_0x282182(0x21a)]['on'](_0x282182(0x218),_0x376e9c=>{const _0x4400c2=_0x282182;_0x4afb05+=_0x376e9c[_0x4400c2(0x2c7)]();}),_0x2ca1d9['on'](_0x282182(0x365),_0x1ff51b=>{if(_0x2c2e06)return;_0x2c2e06=!![],clearTimeout(_0x1130a1),_0x2bd358(_0x1ff51b);}),_0x2ca1d9['on'](_0x282182(0x287),(_0x3da939,_0x50401a)=>{const _0x23d740=_0x282182;if(_0x2c2e06)return;_0x2c2e06=!![],clearTimeout(_0x1130a1);if(_0x3da939===0x0){_0x5c2faf({'stdout':_0x1e1afc,'stderr':_0x4afb05});return;}_0x2bd358(new Error(_0xe0c8cb+('\x20failed\x20'+_0x23d740(0x1de)+'e=')+(_0x3da939??_0x23d740(0x2d0))+_0x23d740(0x397)+(_0x50401a??'null')+'\x0a'+(''+(_0x4afb05||_0x1e1afc))[_0x23d740(0x262)]()));});});}async function installOpenClawPackage(_0x44a352,_0x2f4d94){const _0x1f5a91=_0x41e84f,_0x2cc72a=join(_0x44a352[_0x1f5a91(0x2f2)+_0x1f5a91(0x2a5)],'.cache'),_0xe1aaa8=join(_0x44a352[_0x1f5a91(0x2f2)+'oot'],'.opencla'+'w-extrac'+'t');await mkdir(_0x2cc72a,{'recursive':!![]}),await removePathWithRetries(_0xe1aaa8),await mkdir(_0xe1aaa8,{'recursive':!![]});const _0x3a0721=await createRuntimeEnv(_0x44a352),_0x404170=_0x1f5a91(0x2e3)+'@'+_0x2f4d94;console[_0x1f5a91(0x230)](_0x1f5a91(0x1f0)+_0x1f5a91(0x29e)+_0x1f5a91(0x2ef)+'stalling'+'\x20'+_0x404170);const _0x24165b=await runProcess(_0x44a352[_0x1f5a91(0x31c)+_0x1f5a91(0x379)],[_0x44a352[_0x1f5a91(0x2cb)],_0x1f5a91(0x1b3),_0x404170,_0x1f5a91(0x21e)],{'cwd':_0x2cc72a,'env':_0x3a0721,'label':_0x1f5a91(0x206)+'\x20'+_0x404170}),_0x3b6852=parseNpmPackJson(_0x24165b[_0x1f5a91(0x1f6)]);if(_0x3b6852['version']!==_0x2f4d94)throw new Error('Configur'+'ed\x20OpenC'+'law\x20'+_0x2f4d94+(_0x1f5a91(0x2c0)+_0x1f5a91(0x290))+_0x3b6852[_0x1f5a91(0x1ef)]);const _0x55fe2e=resolve(_0x2cc72a,_0x3b6852[_0x1f5a91(0x2bd)]);if(!existsSync(_0x55fe2e))throw new Error(_0x1f5a91(0x206)+_0x1f5a91(0x1ea)+'\x20create\x20'+_0x1f5a91(0x308)+'\x20'+_0x55fe2e);await runProcess(_0x1f5a91(0x31d),[_0x1f5a91(0x239),_0x55fe2e,'-C',_0xe1aaa8],{'label':'extract\x20'+_0x3b6852[_0x1f5a91(0x2bd)]}),await removePathWithRetries(_0x44a352['openclaw'+_0x1f5a91(0x1c2)+'ir']),await rename(join(_0xe1aaa8,_0x1f5a91(0x302)),_0x44a352['openclaw'+'WorkingD'+'ir']),await removePathWithRetries(_0xe1aaa8),await runProcess(_0x44a352[_0x1f5a91(0x31c)+_0x1f5a91(0x379)],[_0x44a352[_0x1f5a91(0x2cb)],_0x1f5a91(0x204),_0x1f5a91(0x354)+'ev',_0x1f5a91(0x25a)+_0x1f5a91(0x1cc),_0x1f5a91(0x395)+'it',_0x1f5a91(0x26c)+'d',_0x1f5a91(0x2a0)+_0x1f5a91(0x2d3)+'ps'],{'cwd':_0x44a352[_0x1f5a91(0x2e3)+_0x1f5a91(0x1c2)+'ir'],'env':_0x3a0721,'label':_0x1f5a91(0x1c5)+_0x1f5a91(0x38b)+_0x404170+('\x20runtime'+'\x20depende'+'ncies')});if(!existsSync(_0x44a352[_0x1f5a91(0x2e3)+_0x1f5a91(0x36e)]))throw new Error(_0x1f5a91(0x2ac)+_0x1f5a91(0x20a)+_0x1f5a91(0x1db)+'nd\x20after'+_0x1f5a91(0x245)+':\x20'+_0x44a352['openclaw'+_0x1f5a91(0x36e)]);}async function ensureRuntimeBase(_0x4ff544,_0x5c63b3,_0x300491={}){const _0x46e3c5=_0x41e84f;await mkdir(_0x5c63b3,{'recursive':!![]});let _0x57bd67=await readRuntimeManifest(_0x5c63b3);const _0x43996c=_0x4ff544[_0x46e3c5(0x2e3)][_0x46e3c5(0x2e6)+_0x46e3c5(0x1e5)],_0x292d8a=_0x4ff544[_0x46e3c5(0x2e3)]['openclaw'+'Version'],_0x3e7dd3=existsSync(resolveManifestPath(_0x5c63b3)),_0xe1b1bb=runtimeHasRequiredPaths(_0x5c63b3,_0x57bd67),_0x577047=_0x57bd67['nodeVers'+_0x46e3c5(0x1e5)]===_0x43996c;!_0x3e7dd3||!_0xe1b1bb||!_0x577047?(_0x300491['runtimeL'+'ogger']?.['info']('runtime\x20'+_0x46e3c5(0x267)+_0x46e3c5(0x244)+'ed',{'runtimeRoot':_0x5c63b3,'reason':!_0x3e7dd3?'missing\x20'+_0x46e3c5(0x25e):!_0xe1b1bb?_0x46e3c5(0x27e)+_0x46e3c5(0x385)+_0x46e3c5(0x25c)+'\x20paths':_0x46e3c5(0x357)+_0x46e3c5(0x2d7)+_0x46e3c5(0x21d),'syncOnly':_0x300491['syncOnly']}),_0x57bd67=await buildRuntimeBase(_0x4ff544,_0x5c63b3,_0x57bd67),_0x300491[_0x46e3c5(0x391)+_0x46e3c5(0x307)]?.['info'](_0x46e3c5(0x356)+_0x46e3c5(0x267)+_0x46e3c5(0x2f5)+'eted',{'manifest':summarizeRuntimeManifest(_0x57bd67)})):_0x300491[_0x46e3c5(0x391)+_0x46e3c5(0x307)]?.[_0x46e3c5(0x34f)](_0x46e3c5(0x356)+_0x46e3c5(0x339)+'eady\x20cur'+_0x46e3c5(0x394),{'manifest':summarizeRuntimeManifest(_0x57bd67)});if(!existsSync(resolve(_0x5c63b3,_0x57bd67['openclaw'+_0x46e3c5(0x36e)]))){const _0x1f3513=createRuntimeInfoFromManifest(_0x5c63b3,_0x57bd67,{'allowMissingOpenClaw':!![]});await installOpenClawPackage(_0x1f3513,_0x292d8a),_0x57bd67[_0x46e3c5(0x2e3)+_0x46e3c5(0x1ce)]=_0x292d8a;}return _0x57bd67;}function runtimeHasRequiredPaths(_0x1cd383,_0x2eadfb){const _0x1352a5=_0x41e84f;return[_0x1352a5(0x31c)+_0x1352a5(0x379),'npmCli',_0x1352a5(0x2e3)+'WorkingD'+'ir',_0x1352a5(0x2e3)+'Bin']['every'](_0x375554=>typeof _0x2eadfb[_0x375554]===_0x1352a5(0x38e)&&_0x2eadfb[_0x375554][_0x1352a5(0x262)]())&&[_0x1352a5(0x31c)+_0x1352a5(0x379),_0x1352a5(0x2cb)]['every'](_0x38466d=>existsSync(resolve(_0x1cd383,_0x2eadfb[_0x38466d])));}async function buildRuntimeBase(_0x4f4659,_0x1765c6,_0x4a956f={}){const _0x7f8474=_0x41e84f,_0x1e8b19=join(_0x1765c6,_0x7f8474(0x217));await ensureRuntimeNode(_0x4f4659,_0x1e8b19);const _0x6ee2b4={..._0x4a956f,'generatedAt':new Date()[_0x7f8474(0x26a)+_0x7f8474(0x2f6)](),'nodeVersion':_0x4f4659[_0x7f8474(0x2e3)][_0x7f8474(0x2e6)+_0x7f8474(0x1e5)],'openclawVersion':_0x4a956f[_0x7f8474(0x2e3)+_0x7f8474(0x1ce)]||'','platform':process[_0x7f8474(0x2ad)],'arch':process[_0x7f8474(0x361)],'nodeExecutable':_0x7f8474(0x30b)+_0x7f8474(0x311),'npmCli':_0x7f8474(0x249)+_0x7f8474(0x350)+_0x7f8474(0x393)+_0x7f8474(0x344)+'m-cli.js','openclawWorkingDir':'openclaw','openclawBin':_0x7f8474(0x2e3)+_0x7f8474(0x1e2)+_0x7f8474(0x327)};return await writeJson(resolveManifestPath(_0x1765c6),_0x6ee2b4),_0x6ee2b4;}async function removePathWithRetries(_0x45a8b1){await rm(_0x45a8b1,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96});}async function ensureRuntimeNode(_0x3e750f,_0x10b67f){const _0x38fca4=_0x41e84f,_0x4bc841=_0x3e750f[_0x38fca4(0x2e3)]['nodeVers'+_0x38fca4(0x1e5)],_0x37ebc6=join(_0x10b67f,_0x38fca4(0x306),_0x38fca4(0x217)),_0xcc1f55=join(_0x10b67f,_0x38fca4(0x330),'node_mod'+'ules',_0x38fca4(0x257),_0x38fca4(0x306),_0x38fca4(0x314)+'js');if(existsSync(_0x37ebc6)&&existsSync(_0xcc1f55)&&await getNodeVersion(_0x37ebc6)===_0x4bc841)return;await removePathWithRetries(_0x10b67f);if(process[_0x38fca4(0x2b9)][_0x38fca4(0x217)]===_0x4bc841){await linkCurrentNodeRuntime(_0x10b67f);return;}await downloadNodeRuntime(_0x4bc841,_0x10b67f);}async function getNodeVersion(_0x4f8065){const _0x59e0c7=_0x41e84f;try{const _0x591d6f=await runProcess(_0x4f8065,['-p',_0x59e0c7(0x1eb)+'versions'+_0x59e0c7(0x301)],{'label':_0x4f8065+'\x20version','timeoutMs':0x7530});return _0x591d6f[_0x59e0c7(0x1f6)][_0x59e0c7(0x262)]();}catch{return'';}}async function linkCurrentNodeRuntime(_0x39211f){const _0x5bb750=_0x41e84f,_0xc83de2=process[_0x5bb750(0x376)],_0x34f947=resolve(dirname(_0xc83de2),'..'),_0x2f2bbc=resolve(_0x34f947,_0x5bb750(0x276)+_0x5bb750(0x28c)+_0x5bb750(0x263)),_0x48f84c=join(_0x39211f,_0x5bb750(0x306),'node'),_0x4a9e8b=join(_0x39211f,'lib','node_mod'+_0x5bb750(0x223),_0x5bb750(0x257));await mkdir(dirname(_0x48f84c),{'recursive':!![]}),await mkdir(dirname(_0x4a9e8b),{'recursive':!![]}),await symlink(_0xc83de2,_0x48f84c),existsSync(_0x2f2bbc)?await symlink(_0x2f2bbc,_0x4a9e8b):await symlink(await resolveNpmRoot(),_0x4a9e8b);}async function resolveNpmRoot(){const _0x334712=_0x41e84f,_0x508d6c=await runProcess('npm',[_0x334712(0x317),'-g'],{'label':'npm\x20root'+_0x334712(0x33a),'timeoutMs':0x7530}),_0x35e311=join(_0x508d6c[_0x334712(0x1f6)][_0x334712(0x262)](),_0x334712(0x257));if(!existsSync(join(_0x35e311,_0x334712(0x306),_0x334712(0x314)+'js')))throw new Error(_0x334712(0x206)+_0x334712(0x35f)+'not\x20foun'+_0x334712(0x213)+_0x334712(0x389)+_0x334712(0x1f5)+_0x334712(0x1bd)+_0x35e311);return _0x35e311;}async function downloadNodeRuntime(_0x3575d1,_0xc90c84){const _0x1264a0=_0x41e84f,_0x5f0168=process[_0x1264a0(0x2ad)]===_0x1264a0(0x303)?_0x1264a0(0x315):process[_0x1264a0(0x2ad)],_0x1da7cd=process[_0x1264a0(0x361)]===_0x1264a0(0x2b0)?_0x1264a0(0x2b0):process[_0x1264a0(0x361)]==='arm64'?_0x1264a0(0x241):process['arch'],_0x7fac1e=process[_0x1264a0(0x2ad)]===_0x1264a0(0x303)?_0x1264a0(0x1d8):_0x1264a0(0x1c3),_0x4172a9='node-v'+_0x3575d1+'-'+_0x5f0168+'-'+_0x1da7cd,_0x2da3b2=_0x4172a9+'.'+_0x7fac1e,_0xe5781f=join(dirname(_0xc90c84),_0x1264a0(0x208)),_0x4dbef9=join(_0xe5781f,_0x2da3b2),_0x1eaf86=join(_0xe5781f,_0x4172a9+('-extract'+'-')+process['pid']+'-'+Date[_0x1264a0(0x372)]()),_0x5cfeb8='https://'+'nodejs.o'+_0x1264a0(0x345)+'v'+_0x3575d1+'/'+_0x2da3b2;await mkdir(_0xe5781f,{'recursive':!![]}),!existsSync(_0x4dbef9)&&(console[_0x1264a0(0x230)](_0x1264a0(0x1f0)+_0x1264a0(0x29e)+_0x1264a0(0x1f9)+_0x1264a0(0x2ba)+'g\x20'+_0x5cfeb8),await downloadFile(_0x5cfeb8,_0x4dbef9)),await rm(_0x1eaf86,{'recursive':!![],'force':!![]}),await mkdir(_0x1eaf86,{'recursive':!![]}),process[_0x1264a0(0x2ad)]===_0x1264a0(0x303)?await runProcess(_0x1264a0(0x34a),['-q',_0x4dbef9,'-d',_0x1eaf86],{'label':_0x1264a0(0x2f0)+_0x2da3b2}):await runProcess(_0x1264a0(0x31d),[_0x1264a0(0x346),_0x4dbef9,'-C',_0x1eaf86],{'label':_0x1264a0(0x2f0)+_0x2da3b2}),await rename(join(_0x1eaf86,_0x4172a9),_0xc90c84),await rm(_0x1eaf86,{'recursive':!![],'force':!![]});}async function downloadFile(_0x358a4a,_0x47228f){await mkdir(dirname(_0x47228f),{'recursive':!![]});const _0x5b5590=await new Promise((_0x40fc6b,_0x5e6618)=>{const _0xaab38c=_0x37e5;get(_0x358a4a,_0x1d6727=>{const _0x3d2cc5=_0x37e5;if(_0x1d6727[_0x3d2cc5(0x1bf)+'de']>=0x12c&&_0x1d6727[_0x3d2cc5(0x1bf)+'de']<0x190&&_0x1d6727[_0x3d2cc5(0x2b6)][_0x3d2cc5(0x2e9)]){_0x1d6727[_0x3d2cc5(0x253)](),downloadFile(new URL(_0x1d6727[_0x3d2cc5(0x2b6)]['location'],_0x358a4a)['href'],_0x47228f)['then'](()=>_0x40fc6b(null))[_0x3d2cc5(0x362)](_0x5e6618);return;}if(_0x1d6727['statusCo'+'de']!==0xc8){_0x1d6727[_0x3d2cc5(0x253)](),_0x5e6618(new Error(_0x3d2cc5(0x32a)+_0x3d2cc5(0x336)+_0x1d6727[_0x3d2cc5(0x1bf)+'de']+':\x20'+_0x358a4a));return;}_0x40fc6b(_0x1d6727);})['on'](_0xaab38c(0x365),_0x5e6618);});_0x5b5590&&await pipeline(_0x5b5590,createWriteStream(_0x47228f));}export async function ensureOpenClawDoctorFixed(_0x969512,_0x47642c={}){const _0x470832=_0x41e84f,_0x18d01d=await loadRuntimeInfo(_0x969512[_0x470832(0x382)+_0x470832(0x2a5)]),_0x2350ba=getConfigPaths(_0x969512),_0x2b853b=join(_0x2350ba[_0x470832(0x1d2)+_0x470832(0x309)],_0x470832(0x2e3)+'-doctor.'+_0x470832(0x255)),_0x2207bf=await readJson(_0x2b853b,{});if(_0x2207bf[_0x470832(0x2e3)+_0x470832(0x1ce)]===_0x18d01d['openclaw'+_0x470832(0x1ce)])return _0x47642c['runtimeL'+_0x470832(0x307)]?.['info'](_0x470832(0x2e3)+_0x470832(0x205)+_0x470832(0x355)+_0x470832(0x27a)+'ent',{'openclawVersion':_0x18d01d[_0x470832(0x2e3)+'Version'],'markerPath':_0x2b853b}),{'ran':![],'openclawVersion':_0x18d01d[_0x470832(0x2e3)+_0x470832(0x1ce)],'markerPath':_0x2b853b};return await runOpenClawDoctorFix(_0x969512,_0x18d01d,{'fromVersion':_0x2207bf[_0x470832(0x2e3)+'Version']||'unknown','toVersion':_0x18d01d[_0x470832(0x2e3)+_0x470832(0x1ce)],'markerPath':_0x2b853b,'runtimeLogger':_0x47642c[_0x470832(0x391)+'ogger']}),{'ran':!![],'openclawVersion':_0x18d01d[_0x470832(0x2e3)+_0x470832(0x1ce)],'markerPath':_0x2b853b};}async function runOpenClawDoctorFix(_0x3dcd6c,_0x2c554d,{fromVersion:_0x4a013d,toVersion:_0x5a34ba,markerPath:markerPath='',runtimeLogger:_0x3547ab}={}){const _0x2bc880=_0x41e84f;_0x3547ab?.[_0x2bc880(0x34f)](_0x2bc880(0x2e3)+_0x2bc880(0x205)+'fix\x20star'+_0x2bc880(0x219),{'fromVersion':_0x4a013d,'toVersion':_0x5a34ba});const _0x322f74=await createRuntimeEnv(_0x2c554d,{'OPENCLAW_HOME':_0x3dcd6c[_0x2bc880(0x334)],'OPENCLAW_STATE_DIR':_0x3dcd6c['dataDir'],'OPENCLAW_CONFIG_PATH':getConfigPaths(_0x3dcd6c)[_0x2bc880(0x22c)+'th']});console[_0x2bc880(0x230)](_0x2bc880(0x1f0)+'hell:run'+_0x2bc880(0x31b)+_0x2bc880(0x1ff)+_0x2bc880(0x1ba)+'octor\x20--'+_0x2bc880(0x338));const _0x2d4f1c=await runProcess(_0x2c554d[_0x2bc880(0x31c)+'utable'],[_0x2c554d[_0x2bc880(0x2e3)+'Bin'],_0x2bc880(0x227),_0x2bc880(0x1f8)],{'cwd':_0x2c554d[_0x2bc880(0x2e3)+'WorkingD'+'ir'],'env':_0x322f74,'label':'openclaw'+_0x2bc880(0x205)+_0x2bc880(0x1f8),'timeoutMs':0x1d4c0});_0x3547ab?.['info'](_0x2bc880(0x2e3)+_0x2bc880(0x205)+_0x2bc880(0x384)+_0x2bc880(0x2b1),{'fromVersion':_0x4a013d,'toVersion':_0x5a34ba,'stdout':_0x2d4f1c['stdout'][_0x2bc880(0x262)]()[_0x2bc880(0x1df)](-0xfa0),'stderr':_0x2d4f1c[_0x2bc880(0x21a)]['trim']()[_0x2bc880(0x1df)](-0xfa0)}),markerPath&&(await writeJson(markerPath,{'openclawVersion':_0x2c554d[_0x2bc880(0x2e3)+_0x2bc880(0x1ce)],'fixedAt':new Date()[_0x2bc880(0x26a)+_0x2bc880(0x2f6)]()}),_0x3547ab?.[_0x2bc880(0x34f)]('openclaw'+_0x2bc880(0x205)+_0x2bc880(0x1e8)+'er\x20writt'+'en',{'markerPath':markerPath,'openclawVersion':_0x2c554d[_0x2bc880(0x2e3)+_0x2bc880(0x1ce)]}));}export async function readRuntimeManifest(_0x19b92c){return await readJson(resolveManifestPath(_0x19b92c),{});}export async function loadRuntimeInfo(_0x3b57e7){const _0x42fd77=resolveRuntimeRoot(_0x3b57e7),_0x4dbe95=await readRuntimeManifest(_0x42fd77);return createRuntimeInfoFromManifest(_0x42fd77,_0x4dbe95);}function createRuntimeInfoFromManifest(_0x43c804,_0x4afad2,_0x2dbfeb={}){const _0x1e892e=_0x41e84f;for(const _0x713bb2 of[_0x1e892e(0x31c)+'utable',_0x1e892e(0x2cb),_0x1e892e(0x2e3)+'WorkingD'+'ir',_0x1e892e(0x2e3)+_0x1e892e(0x36e)]){if(typeof _0x4afad2[_0x713bb2]!==_0x1e892e(0x38e)||!_0x4afad2[_0x713bb2][_0x1e892e(0x262)]())throw new Error(_0x1e892e(0x356)+_0x1e892e(0x25e)+_0x1e892e(0x237)+_0x1e892e(0x2b8)+_0x713bb2+'\x22\x20at\x20'+resolveManifestPath(_0x43c804)+(_0x1e892e(0x279)+_0x1e892e(0x37b)+_0x1e892e(0x2c2)+'e'));}const _0x16e337=resolve(_0x43c804,_0x4afad2['nodeExec'+'utable']),_0x56299a=resolve(_0x43c804,_0x4afad2[_0x1e892e(0x2cb)]),_0x5be76a=resolve(_0x43c804,_0x4afad2[_0x1e892e(0x2e3)+_0x1e892e(0x1c2)+'ir']),_0x4f97d3=resolve(_0x43c804,_0x4afad2[_0x1e892e(0x2e3)+_0x1e892e(0x36e)]),_0x757be6=Array['isArray'](_0x4afad2['plugins'])?_0x4afad2[_0x1e892e(0x1ca)][_0x1e892e(0x332)](_0x52e7b4=>({..._0x52e7b4,'installPath':resolve(_0x43c804,_0x52e7b4[_0x1e892e(0x313)+_0x1e892e(0x2d9)])})):[],_0x27fda6=_0x2dbfeb[_0x1e892e(0x381)+_0x1e892e(0x340)+'Claw']?[_0x16e337,_0x56299a]:[_0x16e337,_0x56299a,_0x5be76a,_0x4f97d3];for(const _0x54c940 of _0x27fda6){if(!existsSync(_0x54c940))throw new Error('runtime\x20'+_0x1e892e(0x27e)+_0x1e892e(0x333)+_0x54c940);}return{'runtimeRoot':_0x43c804,'manifest':_0x4afad2,'openclawVersion':_0x4afad2[_0x1e892e(0x2e3)+'Version']||_0x1e892e(0x1e4),'nodeExecutable':_0x16e337,'npmCli':_0x56299a,'openclawWorkingDir':_0x5be76a,'openclawBin':_0x4f97d3,'plugins':_0x757be6};}export async function spawnClaw(_0x38b391,_0x505948=[],_0x282c95={}){const _0x52f460=_0x41e84f,_0x4e69de=await loadRuntimeInfo(_0x38b391),_0x5437c0=await createRuntimeEnv(_0x4e69de,_0x282c95['env']??{});return spawn(_0x4e69de[_0x52f460(0x31c)+'utable'],[_0x4e69de[_0x52f460(0x2e3)+_0x52f460(0x36e)],..._0x505948],{'cwd':_0x4e69de[_0x52f460(0x2e3)+_0x52f460(0x1c2)+'ir'],'stdio':_0x52f460(0x2f8),..._0x282c95,'env':_0x5437c0});}export async function runClawOnce(_0x183f82,_0x66c6c1=[],_0x528cb1=0x15f90){const _0x559397=await spawnClaw(_0x183f82,_0x66c6c1);return await new Promise((_0x61b2e,_0x824e19)=>{const _0x25f942=_0x37e5;let _0x154c02='',_0x32faa3='',_0x6632fb=![];const _0x8c1447=setTimeout(()=>{const _0x55b7e4=_0x37e5;if(_0x6632fb)return;_0x6632fb=!![],_0x559397[_0x55b7e4(0x2aa)](_0x55b7e4(0x364)),_0x824e19(new Error(_0x55b7e4(0x2e3)+'\x20timed\x20o'+'ut\x20after'+'\x20'+_0x528cb1+'ms'));},_0x528cb1);_0x559397[_0x25f942(0x1f6)]['on']('data',_0x5baaea=>{const _0x331267=_0x25f942;_0x154c02+=_0x5baaea[_0x331267(0x2c7)]();}),_0x559397[_0x25f942(0x21a)]['on'](_0x25f942(0x218),_0x241c5d=>{const _0x129cbf=_0x25f942;_0x32faa3+=_0x241c5d[_0x129cbf(0x2c7)]();}),_0x559397['on'](_0x25f942(0x365),_0x3df3c5=>{if(_0x6632fb)return;_0x6632fb=!![],clearTimeout(_0x8c1447),_0x824e19(_0x3df3c5);}),_0x559397['on'](_0x25f942(0x287),(_0x40a0c3,_0x31b186)=>{if(_0x6632fb)return;_0x6632fb=!![],clearTimeout(_0x8c1447),_0x61b2e({'code':_0x40a0c3,'signal':_0x31b186,'stdout':_0x154c02,'stderr':_0x32faa3});});});}async function findRuntimeLarkCliBin(_0x2cb9a8){const _0x51ab7a=_0x41e84f,_0x1c5e71=join(_0x2cb9a8[_0x51ab7a(0x2e3)+_0x51ab7a(0x1c2)+'ir'],_0x51ab7a(0x2d8)+_0x51ab7a(0x223),_0x51ab7a(0x2e1)+'te','cli'),_0x3681c9=join(_0x1c5e71,'package.'+'json');if(!existsSync(_0x3681c9))return{'packageDir':_0x1c5e71,'binPath':null};try{const _0x24ec78=JSON['parse'](await readFile(_0x3681c9,_0x51ab7a(0x247))),_0x47e0b4=typeof _0x24ec78[_0x51ab7a(0x306)]===_0x51ab7a(0x38e)?_0x24ec78[_0x51ab7a(0x306)]:_0x24ec78[_0x51ab7a(0x306)]&&typeof _0x24ec78[_0x51ab7a(0x306)]==='object'?_0x24ec78[_0x51ab7a(0x306)][_0x51ab7a(0x1cd)]||Object['values'](_0x24ec78[_0x51ab7a(0x306)])[0x0]:'';return{'packageDir':_0x1c5e71,'binPath':_0x47e0b4?join(_0x1c5e71,_0x47e0b4):null};}catch{return{'packageDir':_0x1c5e71,'binPath':null};}}export async function resolveRuntimeLarkCliCommand(_0x1682f9){const _0x208dfb=_0x41e84f,{packageDir:_0x12dd2a,binPath:_0x573fd6}=await findRuntimeLarkCliBin(_0x1682f9);if(!_0x573fd6||!existsSync(_0x573fd6))throw new Error('Bundled\x20'+_0x208dfb(0x2e1)+_0x208dfb(0x1d0)+_0x208dfb(0x2ec)+'g\x20from\x20O'+_0x208dfb(0x214)+_0x208dfb(0x33e)+'\x20'+_0x12dd2a+(_0x208dfb(0x24a)+_0x208dfb(0x251)+_0x208dfb(0x316)+'re\x22\x20to\x20r'+_0x208dfb(0x1fb)+_0x208dfb(0x383)+_0x208dfb(0x1d3)));return{'nodeExecutable':_0x1682f9['nodeExec'+_0x208dfb(0x379)],'scriptPath':_0x573fd6,'packageDir':_0x12dd2a};}function resolvePackageNameFromNpmSpec(_0x316dc4){const _0xb1ee82=_0x41e84f,_0x1819a7=_0x316dc4[_0xb1ee82(0x262)]()[_0xb1ee82(0x2d6)](/^npm:/,'');if(!_0x1819a7)throw new Error(_0xb1ee82(0x35b)+_0xb1ee82(0x1fe)+_0xb1ee82(0x24d)+'c');if(_0x1819a7[_0xb1ee82(0x1fc)+'th']('@')){const _0x372de5=_0x1819a7[_0xb1ee82(0x256)]('/');if(_0x372de5===-0x1)throw new Error(_0xb1ee82(0x35b)+_0xb1ee82(0x31f)+_0xb1ee82(0x2fa)+_0x316dc4);const _0x252a67=_0x1819a7[_0xb1ee82(0x256)]('@',_0x372de5+0x1);return _0x252a67===-0x1?_0x1819a7:_0x1819a7[_0xb1ee82(0x1df)](0x0,_0x252a67);}const _0x5d3ddc=_0x1819a7['indexOf']('@');return _0x5d3ddc===-0x1?_0x1819a7:_0x1819a7[_0xb1ee82(0x1df)](0x0,_0x5d3ddc);}async function createRuntimeEnv(_0x4e2d40,_0x9728af={}){const _0x129fc3=_0x41e84f,_0x4d44ff=process.env.OPENCLAW_STATE_DIR||'',_0x46dd7d=process.env.NPM_CONFIG_REGISTRY||'https://'+_0x129fc3(0x37a)+_0x129fc3(0x30f)+'or.com',_0xce7f1f=_0x4d44ff?join(_0x4d44ff,'claw-run'+_0x129fc3(0x377)+'ls'):join(_0x4e2d40[_0x129fc3(0x2f2)+_0x129fc3(0x2a5)],'.tools'),_0x462cd9=join(_0xce7f1f,_0x129fc3(0x26f)+'al'),_0x287049=join(_0xce7f1f,_0x129fc3(0x2cf)+'e'),_0x48145a=join(_0x462cd9,'bin');await mkdir(_0x48145a,{'recursive':!![]}),await mkdir(_0x287049,{'recursive':!![]});const _0x11bb6f=[_0x48145a,dirname(_0x4e2d40[_0x129fc3(0x31c)+_0x129fc3(0x379)]),process.env.PATH||''];return{...process.env,..._0x9728af,'PATH':_0x11bb6f['filter'](Boolean)[_0x129fc3(0x299)](delimiter),'npm_config_prefix':_0x462cd9,'NPM_CONFIG_PREFIX':_0x462cd9,'npm_config_cache':_0x287049,'NPM_CONFIG_CACHE':_0x287049,'NPM_CONFIG_REGISTRY':_0x46dd7d,'npm_execpath':_0x4e2d40[_0x129fc3(0x2cb)],'npm_node_execpath':_0x4e2d40[_0x129fc3(0x31c)+_0x129fc3(0x379)],'OPENCLAW_RUNTIME_NPM_PREFIX':_0x462cd9,'OPENCLAW_RUNTIME_NPM_BIN':_0x48145a};}export async function getRuntimeSpawnContext(_0x408c5d,_0x262708={}){const _0x5eeff7=_0x41e84f,_0x169de5=await loadRuntimeInfo(_0x408c5d),_0x2c9651=await createRuntimeEnv(_0x169de5,_0x262708);return{'cwd':_0x169de5[_0x5eeff7(0x2e3)+'WorkingD'+'ir'],'env':_0x2c9651,'runtime':_0x169de5};}function resolvePluginDirNameFromSpec(_0x35dff0){const _0x6fb129=_0x41e84f,_0x59f529=resolvePackageNameFromNpmSpec(_0x35dff0),_0x30881a=_0x59f529['split']('/')[_0x6fb129(0x1c8)](Boolean),_0x23120c=_0x30881a['at'](-0x1)??'';if(!_0x23120c)throw new Error(_0x6fb129(0x35b)+_0x6fb129(0x34b)+_0x6fb129(0x2fa)+_0x35dff0);return _0x23120c;}async function resolvePluginIdFromPackageDir(_0x45179b,_0x357e98){const _0x4561fa=_0x41e84f,_0x3a55e6=await readJson(join(_0x45179b,_0x4561fa(0x207)+_0x4561fa(0x255)),{}),_0x11ea75=await readPluginManifest(_0x45179b),_0x1f0e99=[_0x11ea75?.['id'],_0x11ea75?.[_0x4561fa(0x216)],_0x11ea75?.[_0x4561fa(0x26e)],_0x3a55e6?.['openclaw']?.['id'],_0x3a55e6?.['openclaw'+'Id'],_0x357e98],_0x247184=_0x1f0e99[_0x4561fa(0x298)](_0x7c393d=>typeof _0x7c393d===_0x4561fa(0x38e)&&_0x7c393d[_0x4561fa(0x262)]());if(!_0x247184)throw new Error('Unable\x20t'+_0x4561fa(0x269)+_0x4561fa(0x32e)+_0x4561fa(0x34d)+'\x20'+_0x45179b);return _0x247184[_0x4561fa(0x262)]();}function pluginSpecMatches(_0x1972bf,_0x3d9d61){const _0x40cfe6=_0x41e84f,_0x4e25b9=_0x3d9d61[_0x40cfe6(0x262)](),_0x457168=resolvePackageNameFromNpmSpec(_0x4e25b9);return[_0x1972bf[_0x40cfe6(0x341)],_0x1972bf[_0x40cfe6(0x2e4)+_0x40cfe6(0x34e)],_0x1972bf[_0x40cfe6(0x2e4)+'Name']][_0x40cfe6(0x270)](_0x186e7c=>_0x186e7c===_0x4e25b9||_0x186e7c===_0x457168);}async function installPluginFromNpmSpec(_0x3c272f,_0xb59b53,_0x3d83a6={}){const _0x40246e=_0x41e84f,_0x27bcae=_0x3c272f[_0x40246e(0x262)]()['replace'](/^npm:/,''),_0x43c0ca=resolvePluginDirNameFromSpec(_0x27bcae),_0x42c8cb=join(_0xb59b53[_0x40246e(0x2e3)+'WorkingD'+'ir'],_0x40246e(0x25f),_0x40246e(0x2a7)+'ns'),_0x526d2b=join(_0x42c8cb,_0x43c0ca),_0x2b51ea=join(_0xb59b53[_0x40246e(0x2f2)+'oot'],_0x40246e(0x35e)+_0x40246e(0x248)+process[_0x40246e(0x20c)]+'-'+Date[_0x40246e(0x372)]()),_0x5c4734=await createRuntimeEnv(_0xb59b53),_0x21be2b=new Date()[_0x40246e(0x26a)+_0x40246e(0x2f6)](),_0xa10bcf=join(_0xb59b53[_0x40246e(0x2f2)+_0x40246e(0x2a5)],_0x40246e(0x208));await mkdir(_0xa10bcf,{'recursive':!![]}),await rm(_0x2b51ea,{'recursive':!![],'force':!![]}),await rm(_0x526d2b,{'recursive':!![],'force':!![]}),await mkdir(_0x2b51ea,{'recursive':!![]}),await mkdir(_0x42c8cb,{'recursive':!![]}),console[_0x40246e(0x230)]('[wujie-s'+_0x40246e(0x29e)+_0x40246e(0x399)+_0x40246e(0x1b2)+'lugin\x20'+_0x27bcae);const _0x16644e=await runProcess(_0xb59b53[_0x40246e(0x31c)+'utable'],[_0xb59b53['npmCli'],_0x40246e(0x1b3),_0x27bcae,'--json'],{'cwd':_0xa10bcf,'env':_0x5c4734,'label':_0x40246e(0x206)+'\x20'+_0x27bcae}),_0x558d4e=parseNpmPackJson(_0x16644e[_0x40246e(0x1f6)]),_0xee911f=normalizePackedTarballFilename(_0x558d4e['filename']),_0x92a062=join(_0xa10bcf,_0xee911f);if(!existsSync(_0x92a062))throw new Error(_0x40246e(0x206)+_0x40246e(0x1ea)+_0x40246e(0x1e9)+_0x40246e(0x308)+'\x20'+_0x92a062);await runProcess(_0x40246e(0x31d),[_0x40246e(0x239),_0x92a062,'-C',_0x2b51ea],{'label':_0x40246e(0x2f0)+_0xee911f}),await rename(join(_0x2b51ea,_0x40246e(0x302)),_0x526d2b),await rm(_0x2b51ea,{'recursive':!![],'force':!![]});const _0x2ac6a5=join(_0x526d2b,_0x40246e(0x207)+_0x40246e(0x255)),_0x4ecb0c=await readJson(_0x2ac6a5,{});(_0x4ecb0c[_0x40246e(0x1bb)+'dencies']||_0x4ecb0c['scripts'])&&(delete _0x4ecb0c['devDepen'+_0x40246e(0x2cc)],delete _0x4ecb0c[_0x40246e(0x1b5)],await writeJson(_0x2ac6a5,_0x4ecb0c));await runProcess(_0xb59b53[_0x40246e(0x31c)+'utable'],[_0xb59b53[_0x40246e(0x2cb)],_0x40246e(0x204),_0x40246e(0x354)+'ev',_0x40246e(0x25a)+_0x40246e(0x1cc),'--no-aud'+'it',_0x40246e(0x26c)+'d',_0x40246e(0x2a0)+_0x40246e(0x2d3)+'ps'],{'cwd':_0x526d2b,'env':_0x5c4734,'label':_0x40246e(0x1c5)+_0x40246e(0x2f7)+_0x40246e(0x337)+_0x27bcae});const _0x3990fa=new Date()['toISOStr'+_0x40246e(0x2f6)](),_0x25e743=await resolvePluginIdFromPackageDir(_0x526d2b,_0x558d4e[_0x40246e(0x26e)]);return _0x3d83a6[_0x40246e(0x391)+'ogger']?.[_0x40246e(0x34f)](_0x40246e(0x294)+'in\x20insta'+_0x40246e(0x273),{'spec':_0x27bcae,'pluginId':_0x25e743,'installPath':_0x526d2b}),{'pluginId':_0x25e743,'source':'npm','spec':_0x27bcae,'installPath':toRuntimeRelative(_0xb59b53['runtimeR'+_0x40246e(0x2a5)],_0x526d2b),'version':_0x558d4e[_0x40246e(0x1ef)],'resolvedName':_0x558d4e[_0x40246e(0x26e)],'resolvedVersion':_0x558d4e[_0x40246e(0x1ef)],'resolvedSpec':_0x558d4e[_0x40246e(0x26e)]+'@'+_0x558d4e['version'],'integrity':typeof _0x558d4e[_0x40246e(0x33c)+'y']===_0x40246e(0x38e)?_0x558d4e[_0x40246e(0x33c)+'y']:'','shasum':typeof _0x558d4e[_0x40246e(0x1b0)]===_0x40246e(0x38e)?_0x558d4e['shasum']:'','resolvedAt':_0x21be2b,'installedAt':_0x3990fa};}async function syncConfiguredNpmPlugins(_0x4d6aa6,_0x336ea3,_0x415834,_0x9823eb={}){const _0x10283b=_0x41e84f;if(_0x9823eb['syncOnly'])return;const _0x5af856=createRuntimeInfoFromManifest(_0x336ea3,_0x415834),_0x2660c8=Array[_0x10283b(0x2b4)](_0x415834[_0x10283b(0x1ca)])?_0x415834[_0x10283b(0x1ca)]:[],_0x18193a=[];for(const _0x2a95fb of _0x4d6aa6[_0x10283b(0x2e3)]['pluginSp'+'ecs']){const _0x1a7982=_0x2660c8[_0x10283b(0x298)](_0x3c72b1=>_0x3c72b1?.['source']===_0x10283b(0x257)&&pluginSpecMatches(_0x3c72b1,_0x2a95fb)&&typeof _0x3c72b1[_0x10283b(0x313)+_0x10283b(0x2d9)]===_0x10283b(0x38e)&&existsSync(resolve(_0x336ea3,_0x3c72b1['installP'+_0x10283b(0x2d9)])));if(_0x1a7982){_0x18193a[_0x10283b(0x264)](_0x1a7982);continue;}_0x18193a[_0x10283b(0x264)](await installPluginFromNpmSpec(_0x2a95fb,_0x5af856,_0x9823eb));}const _0x328ffb=new Set(_0x4d6aa6['openclaw'][_0x10283b(0x373)+_0x10283b(0x1f3)]['map'](resolvePackageNameFromNpmSpec)),_0x59cbcd=_0x2660c8[_0x10283b(0x1c8)](_0x39d3ba=>_0x39d3ba?.[_0x10283b(0x240)]!==_0x10283b(0x257)||!_0x328ffb[_0x10283b(0x2ce)](resolvePackageNameFromNpmSpec(_0x39d3ba[_0x10283b(0x2e4)+_0x10283b(0x283)]||_0x39d3ba['spec']||'')));_0x415834[_0x10283b(0x1ca)]=[..._0x59cbcd,..._0x18193a];}function hasRuntimeDependencies(_0x2becea){const _0x37c65f=_0x41e84f,_0x23960b=_0x2becea?.[_0x37c65f(0x2be)+_0x37c65f(0x24b)]&&typeof _0x2becea[_0x37c65f(0x2be)+'cies']===_0x37c65f(0x2df)?Object[_0x37c65f(0x32c)](_0x2becea[_0x37c65f(0x2be)+_0x37c65f(0x24b)]):[],_0x1d7bbd=_0x2becea?.['optional'+_0x37c65f(0x2ea)+'cies']&&typeof _0x2becea['optional'+_0x37c65f(0x2ea)+_0x37c65f(0x24b)]==='object'?Object['keys'](_0x2becea[_0x37c65f(0x30a)+_0x37c65f(0x2ea)+_0x37c65f(0x24b)]):[];return _0x23960b[_0x37c65f(0x369)]>0x0||_0x1d7bbd[_0x37c65f(0x369)]>0x0;}async function installLocalPluginRuntimeDependencies(_0x5155db,_0x1bd381,_0x2949e2){const _0x14bf2c=_0x41e84f,_0xf76d21=join(_0x5155db,'package.'+_0x14bf2c(0x255)),_0x27d9c9=await readJson(_0xf76d21,{});(_0x27d9c9[_0x14bf2c(0x1bb)+_0x14bf2c(0x2cc)]||_0x27d9c9[_0x14bf2c(0x1b5)])&&(delete _0x27d9c9['devDepen'+_0x14bf2c(0x2cc)],delete _0x27d9c9[_0x14bf2c(0x1b5)],await writeJson(_0xf76d21,_0x27d9c9));if(!hasRuntimeDependencies(_0x27d9c9))return;const _0x7b7c5b=await createRuntimeEnv(_0x1bd381);console['log']('[wujie-s'+_0x14bf2c(0x29e)+'time]\x20in'+'stalling'+_0x14bf2c(0x222)+_0x14bf2c(0x1b6)+_0x14bf2c(0x387)+_0x14bf2c(0x258)+_0x5155db),await runProcess(_0x1bd381[_0x14bf2c(0x31c)+'utable'],[_0x1bd381[_0x14bf2c(0x2cb)],_0x14bf2c(0x204),_0x14bf2c(0x354)+'ev',_0x14bf2c(0x25a)+_0x14bf2c(0x1cc),_0x14bf2c(0x395)+'it',_0x14bf2c(0x26c)+'d',_0x14bf2c(0x2a0)+_0x14bf2c(0x2d3)+'ps'],{'cwd':_0x5155db,'env':_0x7b7c5b,'label':_0x14bf2c(0x1c5)+'all\x20loca'+_0x14bf2c(0x2b2)+'\x20'+_0x5155db}),_0x2949e2[_0x14bf2c(0x391)+_0x14bf2c(0x307)]?.['info'](_0x14bf2c(0x21c)+_0x14bf2c(0x2f1)+_0x14bf2c(0x35c)+'s\x20instal'+_0x14bf2c(0x38a),{'installPath':_0x5155db});}async function syncSharedPluginModules(_0x71f92,_0x25a09a){const _0x52f7f3=_0x41e84f,_0x3e01a7=new Set();for(const _0x23ddc2 of _0x71f92){const _0x1554e2=join(dirname(_0x23ddc2),_0x52f7f3(0x335));if(existsSync(_0x1554e2))_0x3e01a7[_0x52f7f3(0x320)](_0x1554e2);}for(const _0x1bf35d of _0x3e01a7){await copyDirFresh(_0x1bf35d,join(_0x25a09a,_0x52f7f3(0x335)));}}async function syncProductPlugins(_0x24ec29,_0x2c1560,_0x524f0b,_0xae550f={}){const _0x328aab=_0x41e84f,_0x5e53a8=join(_0x2c1560,_0x328aab(0x2e3),'dist',_0x328aab(0x2a7)+'ns'),_0x895d8=createRuntimeInfoFromManifest(_0x2c1560,_0x524f0b),_0x33a641=[];await syncSharedPluginModules(_0x24ec29[_0x328aab(0x2e3)][_0x328aab(0x2e4)+_0x328aab(0x25d)+'ginPaths'],_0x5e53a8);for(const _0x197e84 of _0x24ec29['openclaw'][_0x328aab(0x2e4)+'LocalPlu'+_0x328aab(0x231)]){const _0x5d3524=await getPackageMetadata(_0x197e84),_0x2c52cf=await readPluginManifest(_0x197e84),_0x222116=join(_0x5e53a8,_0x5d3524[_0x328aab(0x216)]);await copyDirFresh(_0x197e84,_0x222116),await installLocalPluginRuntimeDependencies(_0x222116,_0x895d8,_0xae550f),_0x33a641[_0x328aab(0x264)]({'pluginId':_0x5d3524['pluginId'],'source':_0x328aab(0x23b),'spec':_0x328aab(0x2d1)+_0x197e84,'installPath':toRuntimeRelative(_0x2c1560,_0x222116),'version':_0x5d3524[_0x328aab(0x1ef)],'resolvedName':_0x5d3524[_0x328aab(0x26e)],'resolvedVersion':_0x5d3524[_0x328aab(0x1ef)],'resolvedSpec':'local:'+_0x197e84,'integrity':'','shasum':'','resolvedAt':new Date()[_0x328aab(0x26a)+_0x328aab(0x2f6)](),'installedAt':new Date()[_0x328aab(0x26a)+_0x328aab(0x2f6)](),'agentScope':_0x2c52cf['agentSco'+'pe'],'skills':_0x2c52cf[_0x328aab(0x38d)]});}const _0x3edd23=new Set(_0x33a641['map'](_0x254660=>_0x254660[_0x328aab(0x216)])),_0x7a4059=Array[_0x328aab(0x2b4)](_0x524f0b[_0x328aab(0x1ca)])?_0x524f0b['plugins'][_0x328aab(0x1c8)](_0x42f9f2=>!_0x3edd23[_0x328aab(0x2ce)](_0x42f9f2[_0x328aab(0x216)])):[];_0x524f0b['plugins']=[..._0x7a4059,..._0x33a641];}async function syncManifestPluginScope(_0x3f8461,_0x5cb03d,_0x10f5d3){const _0x3c8839=_0x41e84f,_0x4193af=join(_0x5cb03d,_0x3c8839(0x2e3),_0x3c8839(0x25f),'extensio'+'ns'),_0x36ad47=new Set(_0x3f8461[_0x3c8839(0x2e3)][_0x3c8839(0x373)+_0x3c8839(0x1f3)]??[]),_0x2be03f=new Set([..._0x36ad47][_0x3c8839(0x332)](_0x34b6f=>_0x34b6f[_0x3c8839(0x2d6)](/^npm:/,''))[_0x3c8839(0x332)](_0x49d87b=>{const _0x3393c4=_0x3c8839;if(_0x49d87b[_0x3393c4(0x1fc)+'th']('@')){const _0x5e6697=_0x49d87b[_0x3393c4(0x300)]('@');return _0x5e6697[_0x3393c4(0x369)]>=0x3?'@'+_0x5e6697[0x1]:_0x49d87b;}return _0x49d87b[_0x3393c4(0x300)]('@')[0x0];})['filter'](Boolean)),_0x671704=new Set();for(const _0x3ecede of _0x3f8461['openclaw'][_0x3c8839(0x2e4)+_0x3c8839(0x25d)+_0x3c8839(0x231)]){const _0x2eb234=await getPackageMetadata(_0x3ecede);if(_0x2eb234[_0x3c8839(0x216)])_0x671704[_0x3c8839(0x320)](_0x2eb234[_0x3c8839(0x216)]);}const _0x41fd33=Array[_0x3c8839(0x2b4)](_0x10f5d3[_0x3c8839(0x1ca)])?_0x10f5d3['plugins']:[];_0x10f5d3['pluginSp'+_0x3c8839(0x1f3)]=[..._0x3f8461[_0x3c8839(0x2e3)]['pluginSp'+_0x3c8839(0x1f3)],..._0x3f8461[_0x3c8839(0x2e3)]['resolved'+_0x3c8839(0x25d)+_0x3c8839(0x231)][_0x3c8839(0x332)](_0x4e6e4c=>_0x3c8839(0x2d1)+_0x4e6e4c)],_0x10f5d3[_0x3c8839(0x1ca)]=_0x41fd33[_0x3c8839(0x1c8)](_0x5d5c06=>{const _0x58b6a7=_0x3c8839;if(!_0x5d5c06||typeof _0x5d5c06!==_0x58b6a7(0x2df))return![];if(_0x5d5c06[_0x58b6a7(0x240)]===_0x58b6a7(0x23b))return _0x671704['has'](_0x5d5c06['pluginId']);if(_0x5d5c06[_0x58b6a7(0x240)]===_0x58b6a7(0x257))return _0x36ad47[_0x58b6a7(0x2ce)](_0x5d5c06[_0x58b6a7(0x341)])||_0x36ad47['has'](_0x5d5c06['resolved'+_0x58b6a7(0x34e)])||_0x2be03f[_0x58b6a7(0x2ce)](_0x5d5c06[_0x58b6a7(0x2e4)+_0x58b6a7(0x283)]);return![];});const _0x256685=new Set(_0x10f5d3[_0x3c8839(0x1ca)][_0x3c8839(0x332)](_0x30e4d2=>_0x30e4d2[_0x3c8839(0x216)]));for(const _0x5ac475 of _0x41fd33){if(!_0x5ac475[_0x3c8839(0x216)]||_0x256685[_0x3c8839(0x2ce)](_0x5ac475['pluginId']))continue;const _0xc58b15=typeof _0x5ac475[_0x3c8839(0x313)+'ath']==='string'&&_0x5ac475[_0x3c8839(0x313)+_0x3c8839(0x2d9)]['trim']()?resolve(_0x5cb03d,_0x5ac475[_0x3c8839(0x313)+_0x3c8839(0x2d9)]):join(_0x4193af,_0x5ac475[_0x3c8839(0x216)]),_0x3bec74=relative(_0x4193af,_0xc58b15);if(_0x3bec74[_0x3c8839(0x1fc)+'th']('..')||_0x3bec74==='')continue;await rm(_0xc58b15,{'recursive':!![],'force':!![]});}}async function collectCapabilityEntries(_0xc0c34d,_0x4cd3a8){const _0x434ea0=_0x41e84f,_0x9428ca=new Map();for(const _0x2fe0cb of _0xc0c34d){let _0x4cfb3d;try{_0x4cfb3d=await stat(_0x2fe0cb);}catch{throw new Error(_0x4cd3a8+('\x20path\x20wa'+_0x434ea0(0x2d5)+_0x434ea0(0x23e))+_0x2fe0cb);}if(!_0x4cfb3d[_0x434ea0(0x1ec)+'ory']())throw new Error(_0x4cd3a8+('\x20path\x20mu'+_0x434ea0(0x22e)+_0x434ea0(0x23a)+_0x434ea0(0x27c))+_0x2fe0cb);const _0xcf288={'name':basename(_0x2fe0cb),'path':_0x2fe0cb},_0x356e0d=_0x9428ca['get'](_0xcf288[_0x434ea0(0x26e)]);if(_0x356e0d)throw new Error('Duplicat'+'e\x20'+_0x4cd3a8+_0x434ea0(0x29d)+_0xcf288['name']+_0x434ea0(0x224)+_0x356e0d['path']+'\x20and\x20'+_0xcf288[_0x434ea0(0x1e6)]);_0x9428ca[_0x434ea0(0x2f4)](_0xcf288['name'],_0xcf288);}return[..._0x9428ca['values']()];}async function syncProductCapabilityDirs(_0x5e9a3b,_0x3d4961,_0x17cea6){const _0x5c99e5=_0x41e84f,_0x293876=await collectCapabilityEntries(_0x5e9a3b,_0x17cea6);await rm(_0x3d4961,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await mkdir(_0x3d4961,{'recursive':!![]});for(const _0x25a73f of _0x293876){await cp(_0x25a73f['path'],join(_0x3d4961,_0x25a73f[_0x5c99e5(0x26e)]),{'recursive':!![]});}return _0x293876['length'];}export const __test__={'collectCapabilityEntries':collectCapabilityEntries,'syncProductCapabilityDirs':syncProductCapabilityDirs};async function syncProductAgents(_0x5d7e46,_0x57cb69,_0x372faa){const _0x38bbc2=_0x41e84f,_0x507d4e=join(_0x57cb69,_0x38bbc2(0x2e3),_0x38bbc2(0x29b)),_0x3b0314=await syncProductCapabilityDirs(_0x5d7e46[_0x38bbc2(0x2e3)][_0x38bbc2(0x2e4)+_0x38bbc2(0x281)+_0x38bbc2(0x325)],_0x507d4e,_0x38bbc2(0x322));_0x372faa[_0x38bbc2(0x29b)]={'source':_0x38bbc2(0x291),'installPath':toRuntimeRelative(_0x57cb69,_0x507d4e),'localPaths':_0x5d7e46[_0x38bbc2(0x2e3)][_0x38bbc2(0x2e4)+_0x38bbc2(0x281)+_0x38bbc2(0x325)],'entryCount':_0x3b0314};}async function syncProductSkills(_0x4e1261,_0x473835,_0x1cc68c){const _0xdf3ea3=_0x41e84f,_0x307c48=join(_0x473835,_0xdf3ea3(0x2e3),_0xdf3ea3(0x38d)),_0x122a4f=await syncProductCapabilityDirs(_0x4e1261[_0xdf3ea3(0x2e3)]['resolved'+_0xdf3ea3(0x2ff)+_0xdf3ea3(0x370)],_0x307c48,'skill');_0x1cc68c[_0xdf3ea3(0x38d)]={'source':_0xdf3ea3(0x291),'installPath':toRuntimeRelative(_0x473835,_0x307c48),'localPaths':_0x4e1261[_0xdf3ea3(0x2e3)][_0xdf3ea3(0x2e4)+'LocalSki'+_0xdf3ea3(0x370)],'entryCount':_0x122a4f};}
|
|
1
|
+
const _0x5ae80f=_0x458f;(function(_0x5285d9,_0x28e3c6){const _0x30528d=_0x458f,_0x54359f=_0x5285d9();while(!![]){try{const _0x43cb42=parseInt(_0x30528d(0x16e))/0x1*(parseInt(_0x30528d(0x232))/0x2)+parseInt(_0x30528d(0xb1))/0x3*(-parseInt(_0x30528d(0x183))/0x4)+-parseInt(_0x30528d(0x129))/0x5*(parseInt(_0x30528d(0x118))/0x6)+-parseInt(_0x30528d(0x131))/0x7+parseInt(_0x30528d(0x7c))/0x8+parseInt(_0x30528d(0x87))/0x9*(-parseInt(_0x30528d(0xa3))/0xa)+-parseInt(_0x30528d(0x213))/0xb*(-parseInt(_0x30528d(0x126))/0xc);if(_0x43cb42===_0x28e3c6)break;else _0x54359f['push'](_0x54359f['shift']());}catch(_0x5e9092){_0x54359f['push'](_0x54359f['shift']());}}}(_0x52fa,0x7b630));import{existsSync}from'node:fs';import{createWriteStream}from'node:fs';import{chmod,cp,mkdir,readFile,readdir,rename,rm,stat,symlink,writeFile}from'node:fs/promises';import{basename,delimiter,dirname,join,relative,resolve}from'node:path';import{fileURLToPath,pathToFileURL}from'node:url';import{spawn}from'node:child_process';import{get}from'node:https';import{pipeline}from'node:stream/promises';import{getConfigPaths}from'@wujie-shell/config';import{copyDirFresh,getPackageMetadata,readJson,readPluginManifest,toRuntimeRelative,writeJson}from'../common/utils.mjs';import{createRuntimeLogger,summarizeRuntimeManifest,summarizeShellConfig}from'../common/runtime-logger.mjs';import{hasConfiguredKdocsSkill,installKdocsCliBinary}from'../connectors/kdocs-cli.mjs';import{patchMixedToolContentFromSource}from'./patch-chat-history-mixed-tool-content.mjs';import{patchChannelPluginRuntimeFromSource}from'./patch-channel-plugin-runtime.mjs';import{patchSessionStoreLoadFromSource,patchSessionStoreWriteFromSource}from'./patch-session-store-sqlite.mjs';const RUNTIME_DIR='.tmp/run'+_0x5ae80f(0x132),MANIFEST_NAME=_0x5ae80f(0x181)+_0x5ae80f(0xbc)+_0x5ae80f(0x228),NPM_INSTALL_TIMEOUT_MS=0xf*0x3c*0x3e8;export function resolveRuntimeRoot(_0xd9fc08){if(process.env.WUJIE_SHELL_RUNTIME_ROOT)return resolve(process.env.WUJIE_SHELL_RUNTIME_ROOT);return resolve(_0xd9fc08,RUNTIME_DIR);}export function resolveManifestPath(_0x100c7f){return join(_0x100c7f,MANIFEST_NAME);}async function loadProductRuntime(_0x3f79f9,_0x3d2b2f){const _0x52ba4c=_0x5ae80f,_0x448e9e=[join(_0x3f79f9,_0x52ba4c(0xbd)+_0x52ba4c(0x154),_0x52ba4c(0xfb)+'s'),join(_0x3d2b2f,_0x52ba4c(0xbd)+_0x52ba4c(0x154),_0x52ba4c(0xfb)+'s')];for(const _0x328e08 of _0x448e9e){if(!existsSync(_0x328e08))continue;return await import(pathToFileURL(_0x328e08)[_0x52ba4c(0xd1)]+_0x52ba4c(0x1b4)+Date[_0x52ba4c(0x210)]());}return{};}export async function prepareRuntime(_0x225d9e,{syncOnly:syncOnly=![]}={}){const _0xf8f9b8=_0x5ae80f,_0x376bd2=resolveRuntimeRoot(_0x225d9e['projectR'+_0xf8f9b8(0x19e)]),_0xa9c66a=createRuntimeLogger(getConfigPaths(_0x225d9e),_0xf8f9b8(0xd6)),_0x277dba=Date[_0xf8f9b8(0x210)]();_0xa9c66a?.[_0xf8f9b8(0x148)](_0xf8f9b8(0x15d)+_0xf8f9b8(0x136)+_0xf8f9b8(0x1ce),{'syncOnly':syncOnly,'runtimeRoot':_0x376bd2,'shellConfig':summarizeShellConfig(_0x225d9e)});try{const _0x126d52=await ensureRuntimeBase(_0x225d9e,_0x376bd2,{'runtimeLogger':_0xa9c66a,'syncOnly':syncOnly});_0xa9c66a?.[_0xf8f9b8(0x148)](_0xf8f9b8(0x136)+_0xf8f9b8(0xbc)+_0xf8f9b8(0x1bc),{'manifestPath':resolveManifestPath(_0x376bd2),'manifest':summarizeRuntimeManifest(_0x126d52)}),validateRuntimeNodeVersion(_0x126d52,_0x225d9e),_0xa9c66a?.['info']('runtime\x20'+_0xf8f9b8(0x164)+_0xf8f9b8(0x9f)+_0xf8f9b8(0x80),{'nodeVersion':_0x126d52[_0xf8f9b8(0x20b)+_0xf8f9b8(0x106)]});if(syncOnly)validateRuntimeOpenClawVersion(_0x126d52,_0x225d9e),_0xa9c66a?.[_0xf8f9b8(0x148)]('runtime\x20'+'openclaw'+_0xf8f9b8(0x1b5)+_0xf8f9b8(0x1a1)+'ed',{'openclawVersion':_0x126d52[_0xf8f9b8(0x1d4)+_0xf8f9b8(0x237)]});else{if(_0x126d52[_0xf8f9b8(0x1d4)+'Version']!==_0x225d9e[_0xf8f9b8(0x1d4)]['openclaw'+_0xf8f9b8(0x237)]){const _0xe139b=await loadRuntimeInfo(_0x225d9e[_0xf8f9b8(0xbb)+'oot']);_0xa9c66a?.['info'](_0xf8f9b8(0x1d4)+'\x20package'+_0xf8f9b8(0x137)+'\x20started',{'fromVersion':_0x126d52[_0xf8f9b8(0x1d4)+'Version']||_0xf8f9b8(0x234),'toVersion':_0x225d9e[_0xf8f9b8(0x1d4)][_0xf8f9b8(0x1d4)+_0xf8f9b8(0x237)]}),await installOpenClawPackage(_0xe139b,_0x225d9e[_0xf8f9b8(0x1d4)]['openclaw'+_0xf8f9b8(0x237)]),_0x126d52[_0xf8f9b8(0x1d4)+_0xf8f9b8(0x237)]=_0x225d9e[_0xf8f9b8(0x1d4)][_0xf8f9b8(0x1d4)+_0xf8f9b8(0x237)],_0xa9c66a?.[_0xf8f9b8(0x148)]('openclaw'+'\x20package'+_0xf8f9b8(0x137)+_0xf8f9b8(0xc0)+'ed',{'openclawVersion':_0x126d52['openclaw'+_0xf8f9b8(0x237)]});}}_0x126d52[_0xf8f9b8(0x1b8)+_0xf8f9b8(0x1c0)]=new Date()['toISOStr'+_0xf8f9b8(0x14a)](),_0x126d52[_0xf8f9b8(0x20b)+_0xf8f9b8(0x106)]=_0x225d9e[_0xf8f9b8(0x1d4)][_0xf8f9b8(0x20b)+_0xf8f9b8(0x106)],_0x126d52[_0xf8f9b8(0x1df)]={'appId':_0x225d9e[_0xf8f9b8(0x1d9)],'productName':_0x225d9e['productN'+_0xf8f9b8(0x223)],'dataDirName':_0x225d9e[_0xf8f9b8(0x12d)+'ame']},await patchChatHistoryMixedToolContentBug(_0x376bd2,_0x126d52,{'runtimeLogger':_0xa9c66a}),await patchChannelPluginRuntimeBug(_0x376bd2,_0x126d52,{'runtimeLogger':_0xa9c66a});const _0x33e57b=await loadProductRuntime(_0x225d9e[_0xf8f9b8(0xbb)+'oot'],_0x376bd2);if(typeof _0x33e57b['prepareP'+_0xf8f9b8(0xd8)+'ntime']===_0xf8f9b8(0x24c)){const _0x2e1684=createRuntimeInfoFromManifest(_0x376bd2,_0x126d52);await _0x33e57b[_0xf8f9b8(0x15f)+_0xf8f9b8(0xd8)+_0xf8f9b8(0x154)]({'shellConfig':_0x225d9e,'runtime':_0x2e1684,'runtimeLogger':_0xa9c66a,'syncOnly':syncOnly}),_0xa9c66a?.[_0xf8f9b8(0x148)]('product\x20'+_0xf8f9b8(0x136)+_0xf8f9b8(0x13d)+_0xf8f9b8(0x22c));}await patchSessionStoreSqliteRuntime(_0x376bd2,_0x126d52,{'runtimeLogger':_0xa9c66a});!syncOnly&&(await hasConfiguredKdocsSkill(_0x225d9e)?(await installKdocsCliBinary(_0x225d9e,createRuntimeInfoFromManifest(_0x376bd2,_0x126d52),{'runtimeLogger':_0xa9c66a,'syncOnly':syncOnly}),_0xa9c66a?.['info'](_0xf8f9b8(0x25b)+_0xf8f9b8(0x1de)+'e\x20tools\x20'+_0xf8f9b8(0xe7))):_0xa9c66a?.[_0xf8f9b8(0x148)]('connecto'+_0xf8f9b8(0x1de)+_0xf8f9b8(0x1e3)+_0xf8f9b8(0xd5)+_0xf8f9b8(0x84)+_0xf8f9b8(0x140)+'\x20configu'+'red'));const _0x18f36d=Array[_0xf8f9b8(0x7e)](_0x126d52[_0xf8f9b8(0x111)])?_0x126d52[_0xf8f9b8(0x111)][_0xf8f9b8(0x171)]:0x0;return await syncManifestPluginScope(_0x225d9e,_0x376bd2,_0x126d52),_0xa9c66a?.['info']('runtime\x20'+_0xf8f9b8(0xb6)+'cope\x20syn'+_0xf8f9b8(0x187),{'beforePluginCount':_0x18f36d,'afterPluginCount':Array[_0xf8f9b8(0x7e)](_0x126d52[_0xf8f9b8(0x111)])?_0x126d52[_0xf8f9b8(0x111)][_0xf8f9b8(0x171)]:0x0,'pluginSpecCount':Array[_0xf8f9b8(0x7e)](_0x126d52[_0xf8f9b8(0x98)+'ecs'])?_0x126d52[_0xf8f9b8(0x98)+'ecs'][_0xf8f9b8(0x171)]:0x0}),await syncConfiguredNpmPlugins(_0x225d9e,_0x376bd2,_0x126d52,{'runtimeLogger':_0xa9c66a,'syncOnly':syncOnly}),_0xa9c66a?.[_0xf8f9b8(0x148)](_0xf8f9b8(0xe3)+'ed\x20npm\x20p'+'lugins\x20s'+_0xf8f9b8(0xe9),{'pluginSpecCount':_0x225d9e['openclaw']['pluginSp'+'ecs'][_0xf8f9b8(0x171)],'pluginCount':Array[_0xf8f9b8(0x7e)](_0x126d52[_0xf8f9b8(0x111)])?_0x126d52[_0xf8f9b8(0x111)][_0xf8f9b8(0x171)]:0x0}),await syncProductPlugins(_0x225d9e,_0x376bd2,_0x126d52,{'runtimeLogger':_0xa9c66a}),_0xa9c66a?.[_0xf8f9b8(0x148)](_0xf8f9b8(0xa2)+_0xf8f9b8(0x19b)+_0xf8f9b8(0xe7),{'localPluginCount':_0x225d9e[_0xf8f9b8(0x1d4)]['resolved'+_0xf8f9b8(0xc3)+_0xf8f9b8(0x130)]['length'],'pluginCount':Array['isArray'](_0x126d52[_0xf8f9b8(0x111)])?_0x126d52[_0xf8f9b8(0x111)]['length']:0x0}),await syncProductAgents(_0x225d9e,_0x376bd2,_0x126d52),_0xa9c66a?.[_0xf8f9b8(0x148)](_0xf8f9b8(0xa2)+'agents\x20s'+_0xf8f9b8(0xe9),{'sources':_0x225d9e['openclaw'][_0xf8f9b8(0x79)+_0xf8f9b8(0xda)+_0xf8f9b8(0x226)],'entryCount':_0x126d52[_0xf8f9b8(0x178)]?.[_0xf8f9b8(0xf4)+'nt'],'installPath':_0x126d52[_0xf8f9b8(0x178)]?.[_0xf8f9b8(0x252)+_0xf8f9b8(0x102)]}),await syncProductSkills(_0x225d9e,_0x376bd2,_0x126d52),_0xa9c66a?.[_0xf8f9b8(0x148)](_0xf8f9b8(0xa2)+_0xf8f9b8(0x66)+'ynced',{'sources':_0x225d9e[_0xf8f9b8(0x1d4)]['resolved'+'LocalSki'+_0xf8f9b8(0xf7)],'entryCount':_0x126d52['skills']?.[_0xf8f9b8(0xf4)+'nt'],'installPath':_0x126d52[_0xf8f9b8(0x215)]?.[_0xf8f9b8(0x252)+'ath']}),await syncRuntimeWrapper(_0x225d9e,_0x376bd2,_0x126d52),_0xa9c66a?.['info'](_0xf8f9b8(0x136)+_0xf8f9b8(0x172)+_0xf8f9b8(0xe7),{'wujieclawBin':_0x126d52[_0xf8f9b8(0x1da)+_0xf8f9b8(0x1fb)]}),await writeJson(resolveManifestPath(_0x376bd2),_0x126d52),_0xa9c66a?.[_0xf8f9b8(0x148)]('runtime\x20'+_0xf8f9b8(0xbc)+_0xf8f9b8(0xca),{'manifestPath':resolveManifestPath(_0x376bd2),'manifest':summarizeRuntimeManifest(_0x126d52),'durationMs':Date[_0xf8f9b8(0x210)]()-_0x277dba}),await _0xa9c66a?.[_0xf8f9b8(0xd3)](),_0x126d52;}catch(_0x7b5a5e){_0xa9c66a?.[_0xf8f9b8(0x107)](_0xf8f9b8(0x15d)+_0xf8f9b8(0x136)+_0xf8f9b8(0x1cf),{'syncOnly':syncOnly,'runtimeRoot':_0x376bd2,'durationMs':Date[_0xf8f9b8(0x210)]()-_0x277dba,'error':_0x7b5a5e}),await _0xa9c66a?.['flush']();throw _0x7b5a5e;}}async function syncRuntimeWrapper(_0x13094b,_0x263e49,_0x4bab1c){const _0x55eb7b=_0x5ae80f,_0x9035e9=_0x13094b[_0x55eb7b(0x1d4)]?.[_0x55eb7b(0x1f7)+_0x55eb7b(0x1c3)]??_0x55eb7b(0x70)+_0x55eb7b(0x8c),_0x4f103=join(_0x263e49,_0x55eb7b(0x14b),_0x55eb7b(0x1da)+'w'),_0x1ef6c1=join(_0x263e49,_0x55eb7b(0x14b),_0x55eb7b(0x1da)+_0x55eb7b(0x218)),_0x64006b=normalizeRuntimeRelativePath(relative(dirname(_0x4f103),resolve(_0x263e49,_0x4bab1c[_0x55eb7b(0x95)+_0x55eb7b(0x204)]))),_0x1da6e5=normalizeRuntimeRelativePath(relative(dirname(_0x4f103),resolve(_0x263e49,_0x4bab1c[_0x55eb7b(0x1d4)+_0x55eb7b(0x1c5)]))),_0x243acf=_0x55eb7b(0xc5)+_0x13094b[_0x55eb7b(0x12d)+_0x55eb7b(0x223)],_0x3ad2b8=_0x55eb7b(0xa9)+_0x55eb7b(0xab)+_0x13094b['dataDirN'+_0x55eb7b(0x223)];await mkdir(dirname(_0x4f103),{'recursive':!![]});const _0x343945=fileURLToPath(new URL('../../as'+_0x55eb7b(0x1f5)+'ie-logo.'+_0x55eb7b(0x22a),import.meta.url)),_0xa47c4c=join(_0x263e49,_0x55eb7b(0x14b),_0x55eb7b(0x24e)+_0x55eb7b(0x1e8));await cp(_0x343945,_0xa47c4c),await writeFile(_0x4f103,['#!/bin/s'+'h',_0x55eb7b(0x206)+_0x55eb7b(0x18e)+_0x55eb7b(0x160)+'OPENCLAW'+_0x55eb7b(0x224)+_0x243acf+'}\x22',_0x55eb7b(0x206)+'PENCLAW_'+_0x55eb7b(0xc8)+'R=\x22${OPE'+_0x55eb7b(0x1d5)+_0x55eb7b(0x189)+'-'+_0x243acf+'}\x22','export\x20O'+_0x55eb7b(0x18e)+'CONFIG_F'+_0x55eb7b(0x249)+_0x55eb7b(0x207)+_0x55eb7b(0x194)+_0x55eb7b(0x13a)+_0x55eb7b(0x69)+_0x9035e9+'}\x22',_0x55eb7b(0x206)+'PENCLAW_'+'CONFIG_P'+_0x55eb7b(0x156)+_0x55eb7b(0x18e)+'CONFIG_P'+_0x55eb7b(0x82)+_0x243acf+'/'+_0x9035e9+'}\x22',_0x55eb7b(0x1cc)+_0x55eb7b(0x20e)+_0x55eb7b(0x1be)+_0x55eb7b(0x23a)+_0x55eb7b(0x257)+'\x20\x22$0\x22)\x22\x20'+_0x55eb7b(0x1d6),_0x55eb7b(0x105)+_0x55eb7b(0x9c)+_0x55eb7b(0x23b)+'JIE_NO_L'+_0x55eb7b(0x90)+_0x55eb7b(0x14f),_0x55eb7b(0x1c2)+'PT_DIR/'+_0x64006b+(_0x55eb7b(0x114)+'PT_DIR/w'+'ujie-log'+'o.mjs\x22\x202'+_0x55eb7b(0x200)+'ll\x20||\x20tr'+'ue'),'fi',_0x55eb7b(0x1a9)+_0x55eb7b(0x13f)+'R/'+_0x64006b+(_0x55eb7b(0x114)+_0x55eb7b(0x175))+_0x1da6e5+_0x55eb7b(0x113),''][_0x55eb7b(0x18f)]('\x0a'),_0x55eb7b(0xc7)),await chmod(_0x4f103,0x1ed),await writeFile(_0x1ef6c1,[_0x55eb7b(0x239)+'f',_0x55eb7b(0x112)+'NCLAW_HO'+'ME%\x22==\x22\x22'+_0x55eb7b(0x1fc)+_0x55eb7b(0x149)+_0x55eb7b(0x247)+_0x3ad2b8+'\x22',_0x55eb7b(0x112)+'NCLAW_ST'+_0x55eb7b(0x25a)+_0x55eb7b(0x7d)+_0x55eb7b(0x201)+_0x55eb7b(0x1b6)+_0x55eb7b(0x6c)+_0x3ad2b8+'\x22',_0x55eb7b(0x112)+_0x55eb7b(0x11f)+_0x55eb7b(0xd4)+_0x55eb7b(0x7f)+_0x55eb7b(0x23d)+_0x55eb7b(0x10f)+_0x55eb7b(0xe1)+_0x55eb7b(0x12f)+_0x55eb7b(0x1d0)+_0x9035e9+'\x22','if\x20\x22%OPE'+_0x55eb7b(0x11f)+'NFIG_PAT'+'H%\x22==\x22\x22\x20'+'set\x20\x22OPE'+_0x55eb7b(0x11f)+'NFIG_PAT'+'H='+_0x3ad2b8+'\x5c'+_0x9035e9+'\x22',_0x55eb7b(0xf6)+_0x55eb7b(0x1e2)+'%~dp0\x22',_0x55eb7b(0x15e)+_0x55eb7b(0x6d)+toWindowsPath(_0x64006b)+(_0x55eb7b(0x1e6)+'PT_DIR%')+toWindowsPath(_0x1da6e5)+_0x55eb7b(0x25d),''][_0x55eb7b(0x18f)]('\x0d\x0a'),_0x55eb7b(0xc7)),_0x4bab1c['wujiecla'+_0x55eb7b(0x1fb)]=toRuntimeRelative(_0x263e49,process[_0x55eb7b(0xad)]===_0x55eb7b(0x85)?_0x1ef6c1:_0x4f103);}async function patchChatHistoryMixedToolContentBug(_0x305417,_0x2afaac,_0x45c6f7={}){const _0x5a8e1c=_0x5ae80f,_0xa150b9=resolve(_0x305417,_0x2afaac[_0x5a8e1c(0x1d4)+_0x5a8e1c(0x157)+'ir']),_0x14dcc0=join(_0xa150b9,_0x5a8e1c(0x229));let _0x159b73=[];try{_0x159b73=await readdir(_0x14dcc0,{'withFileTypes':!![]});}catch{_0x45c6f7[_0x5a8e1c(0xef)+_0x5a8e1c(0x11e)]?.[_0x5a8e1c(0x159)]?.(_0x5a8e1c(0x259)+'tory\x20mix'+_0x5a8e1c(0xe4)+_0x5a8e1c(0x1a5)+_0x5a8e1c(0x214)+_0x5a8e1c(0x246)+'found',{'distDir':_0x14dcc0,'openclawVersion':_0x2afaac[_0x5a8e1c(0x1d4)+_0x5a8e1c(0x237)]});return;}const _0x121087=_0x159b73['filter'](_0xb62b0d=>_0xb62b0d[_0x5a8e1c(0x17e)]()&&_0xb62b0d[_0x5a8e1c(0xb7)][_0x5a8e1c(0x96)+'th'](_0x5a8e1c(0x1ec)+'play-pro'+'jection-')&&_0xb62b0d[_0x5a8e1c(0xb7)][_0x5a8e1c(0xcb)](_0x5a8e1c(0x8d)))[_0x5a8e1c(0x1a8)](_0x31528b=>join(_0x14dcc0,_0x31528b[_0x5a8e1c(0xb7)]));if(_0x121087[_0x5a8e1c(0x171)]===0x0){_0x45c6f7[_0x5a8e1c(0xef)+_0x5a8e1c(0x11e)]?.[_0x5a8e1c(0x159)]?.(_0x5a8e1c(0x259)+_0x5a8e1c(0x1ab)+_0x5a8e1c(0xe4)+_0x5a8e1c(0x1a5)+_0x5a8e1c(0xe0)+_0x5a8e1c(0x180)+_0x5a8e1c(0x72),{'openclawVersion':_0x2afaac[_0x5a8e1c(0x1d4)+_0x5a8e1c(0x237)]});return;}for(const _0x3660d8 of _0x121087){const _0x13bfe2=await readFile(_0x3660d8,_0x5a8e1c(0xc7)),_0x5a29b5=patchMixedToolContentFromSource(_0x13bfe2);if(!_0x5a29b5[_0x5a8e1c(0xee)]){if(_0x5a29b5['reason']===_0x5a8e1c(0x16f)+_0x5a8e1c(0xee)){_0x45c6f7[_0x5a8e1c(0xef)+_0x5a8e1c(0x11e)]?.[_0x5a8e1c(0x148)]?.('chat\x20his'+_0x5a8e1c(0x1ab)+_0x5a8e1c(0xe4)+_0x5a8e1c(0x1ee)+'ready\x20ap'+_0x5a8e1c(0x23f),{'openclawVersion':_0x2afaac[_0x5a8e1c(0x1d4)+'Version'],'filePath':_0x3660d8});return;}continue;}await writeFile(_0x3660d8,_0x5a29b5[_0x5a8e1c(0x150)],_0x5a8e1c(0xc7)),_0x45c6f7[_0x5a8e1c(0xef)+'ogger']?.[_0x5a8e1c(0x148)]?.(_0x5a8e1c(0x259)+'tory\x20mix'+'ed-tool\x20'+_0x5a8e1c(0x103)+_0x5a8e1c(0x23f),{'openclawVersion':_0x2afaac['openclaw'+'Version'],'filePath':_0x3660d8,'note':'Temporar'+'y\x20compat'+'ibility\x20'+'patch\x20fo'+_0x5a8e1c(0x16c)+_0x5a8e1c(0x225)+'6\x20mixed\x20'+'tool\x20his'+_0x5a8e1c(0xf3)+_0x5a8e1c(0x92)+_0x5a8e1c(0x1b9)+_0x5a8e1c(0xc6)+'ream\x20fix'+_0x5a8e1c(0x11d)+_0x5a8e1c(0x108)+_0x5a8e1c(0x217)});return;}_0x45c6f7[_0x5a8e1c(0xef)+_0x5a8e1c(0x11e)]?.[_0x5a8e1c(0x159)]?.('chat\x20his'+'tory\x20mix'+_0x5a8e1c(0xe4)+'patch\x20sk'+_0x5a8e1c(0xe0)+_0x5a8e1c(0x24d)+_0x5a8e1c(0xe6)+'d',{'openclawVersion':_0x2afaac['openclaw'+_0x5a8e1c(0x237)]});}async function patchChannelPluginRuntimeBug(_0x396855,_0xb27f8e,_0x243bff={}){const _0x2b9492=_0x5ae80f,_0x5f55af=resolve(_0x396855,_0xb27f8e['openclaw'+_0x2b9492(0x157)+'ir']),_0x5aaafb=join(_0x5f55af,_0x2b9492(0x229));let _0x4ff850=[];try{_0x4ff850=await readdir(_0x5aaafb,{'withFileTypes':!![]});}catch{_0x243bff['runtimeL'+_0x2b9492(0x11e)]?.[_0x2b9492(0x159)]?.(_0x2b9492(0xeb)+_0x2b9492(0x91)+_0x2b9492(0x141)+_0x2b9492(0x1bf)+_0x2b9492(0xb0)+_0x2b9492(0x120)+_0x2b9492(0x18b),{'distDir':_0x5aaafb,'openclawVersion':_0xb27f8e[_0x2b9492(0x1d4)+_0x2b9492(0x237)]});return;}const _0x309859=_0x4ff850[_0x2b9492(0xdc)](_0x43b913=>_0x43b913[_0x2b9492(0x17e)]()&&_0x43b913['name'][_0x2b9492(0x96)+'th'](_0x2b9492(0x77))&&_0x43b913[_0x2b9492(0xb7)]['endsWith'](_0x2b9492(0x8d)))[_0x2b9492(0x1a8)](_0x12539e=>join(_0x5aaafb,_0x12539e[_0x2b9492(0xb7)])),_0x301e9d=await resolveRuntimeChannelImportPath(_0x5aaafb,_0x4ff850);if(_0x309859['length']===0x0){_0x243bff[_0x2b9492(0xef)+_0x2b9492(0x11e)]?.[_0x2b9492(0x159)]?.(_0x2b9492(0xeb)+_0x2b9492(0x91)+'untime\x20p'+'atch\x20ski'+_0x2b9492(0xf9)+_0x2b9492(0x170)+_0x2b9492(0x230),{'openclawVersion':_0xb27f8e['openclaw'+_0x2b9492(0x237)]});return;}if(!_0x301e9d){_0x243bff[_0x2b9492(0xef)+_0x2b9492(0x11e)]?.[_0x2b9492(0x159)]?.('channel\x20'+_0x2b9492(0x91)+_0x2b9492(0x141)+_0x2b9492(0x1bf)+_0x2b9492(0x123)+'ntime\x20ch'+'annel\x20en'+_0x2b9492(0x88)+_0x2b9492(0x72),{'openclawVersion':_0xb27f8e[_0x2b9492(0x1d4)+_0x2b9492(0x237)],'distDir':_0x5aaafb});return;}for(const _0x469946 of _0x309859){const _0x50193d=await readFile(_0x469946,_0x2b9492(0xc7)),_0x2f8bad=patchChannelPluginRuntimeFromSource(_0x50193d,{'runtimeChannelImportPath':_0x301e9d});if(!_0x2f8bad[_0x2b9492(0xee)]){if(_0x2f8bad[_0x2b9492(0x75)]===_0x2b9492(0x16f)+_0x2b9492(0xee)){_0x243bff[_0x2b9492(0xef)+'ogger']?.[_0x2b9492(0x148)]?.(_0x2b9492(0xeb)+'plugin\x20r'+_0x2b9492(0x141)+_0x2b9492(0xac)+_0x2b9492(0xd9)+_0x2b9492(0x186),{'openclawVersion':_0xb27f8e[_0x2b9492(0x1d4)+_0x2b9492(0x237)],'filePath':_0x469946});return;}continue;}await writeFile(_0x469946,_0x2f8bad['source'],_0x2b9492(0xc7)),_0x243bff[_0x2b9492(0xef)+_0x2b9492(0x11e)]?.[_0x2b9492(0x148)]?.(_0x2b9492(0xeb)+_0x2b9492(0x91)+_0x2b9492(0x141)+'atch\x20app'+_0x2b9492(0x186),{'openclawVersion':_0xb27f8e[_0x2b9492(0x1d4)+_0x2b9492(0x237)],'filePath':_0x469946,'note':_0x2b9492(0x258)+_0x2b9492(0x18d)+'ibility\x20'+'patch\x20fo'+_0x2b9492(0x16c)+_0x2b9492(0x225)+'6.6\x20chan'+'nel\x20plug'+_0x2b9492(0xfd)+_0x2b9492(0xaa)+_0x2b9492(0x1ef)+_0x2b9492(0x13c)+_0x2b9492(0x177)+_0x2b9492(0x21a)+'fy\x20upstr'+'eam\x20fix\x20'+_0x2b9492(0x250)+_0x2b9492(0x173)+'es.'});return;}_0x243bff['runtimeL'+'ogger']?.[_0x2b9492(0x159)]?.('channel\x20'+'plugin\x20r'+_0x2b9492(0x141)+_0x2b9492(0x1bf)+_0x2b9492(0x123)+_0x2b9492(0xf5)+_0x2b9492(0x1eb)+_0x2b9492(0xb5),{'openclawVersion':_0xb27f8e['openclaw'+'Version']});}async function patchSessionStoreSqliteRuntime(_0x1d565e,_0x5239e5,_0x29c5e5={}){const _0x3fb9c9=_0x5ae80f,_0x3bd8a5=resolve(_0x1d565e,_0x5239e5[_0x3fb9c9(0x1d4)+'WorkingD'+'ir']),_0x5e547b=join(_0x3bd8a5,'dist'),_0xf63066='../../sh'+'ell-runt'+_0x3fb9c9(0xde)+'ions/run'+_0x3fb9c9(0x127)+_0x3fb9c9(0x143),_0x57c3a6=(await readdir(_0x5e547b,{'withFileTypes':!![]})[_0x3fb9c9(0x11c)](()=>[]))[_0x3fb9c9(0xdc)](_0x9ae1d8=>_0x9ae1d8['isFile']()&&_0x9ae1d8[_0x3fb9c9(0xb7)]['startsWi'+'th']('store-lo'+_0x3fb9c9(0x24f))&&_0x9ae1d8[_0x3fb9c9(0xb7)]['endsWith']('.js'))[_0x3fb9c9(0x1a8)](_0x5676fe=>join(_0x5e547b,_0x5676fe[_0x3fb9c9(0xb7)])),_0x15c5bc=(await readdir(_0x5e547b,{'withFileTypes':!![]})[_0x3fb9c9(0x11c)](()=>[]))[_0x3fb9c9(0xdc)](_0x2c6386=>_0x2c6386['isFile']()&&_0x2c6386[_0x3fb9c9(0xb7)][_0x3fb9c9(0x96)+'th']('store-')&&!_0x2c6386[_0x3fb9c9(0xb7)][_0x3fb9c9(0x96)+'th'](_0x3fb9c9(0x21c)+_0x3fb9c9(0x24f))&&_0x2c6386[_0x3fb9c9(0xb7)]['endsWith']('.js'))[_0x3fb9c9(0x1a8)](_0x249a7d=>join(_0x5e547b,_0x249a7d[_0x3fb9c9(0xb7)]));for(const _0x28f51a of _0x57c3a6){const _0x2022f2=await readFile(_0x28f51a,_0x3fb9c9(0xc7)),_0x253655=patchSessionStoreLoadFromSource(_0x2022f2,{'bridgeImportPath':_0xf63066});if(!_0x253655['patched']){if(_0x253655[_0x3fb9c9(0x75)]===_0x3fb9c9(0x16f)+_0x3fb9c9(0xee)){_0x29c5e5[_0x3fb9c9(0xef)+_0x3fb9c9(0x11e)]?.[_0x3fb9c9(0x148)]?.(_0x3fb9c9(0x16d)+_0x3fb9c9(0x21f)+_0x3fb9c9(0x125)+_0x3fb9c9(0x231)+_0x3fb9c9(0x153),{'filePath':_0x28f51a,'openclawVersion':_0x5239e5[_0x3fb9c9(0x1d4)+'Version']});break;}continue;}await writeFile(_0x28f51a,_0x253655[_0x3fb9c9(0x150)],_0x3fb9c9(0xc7)),_0x29c5e5[_0x3fb9c9(0xef)+_0x3fb9c9(0x11e)]?.[_0x3fb9c9(0x148)]?.('session\x20'+'store\x20lo'+_0x3fb9c9(0x125)+'\x20applied',{'filePath':_0x28f51a,'openclawVersion':_0x5239e5['openclaw'+_0x3fb9c9(0x237)]});break;}for(const _0x2fede2 of _0x15c5bc){const _0x5a2a4a=await readFile(_0x2fede2,_0x3fb9c9(0xc7)),_0x48280a=patchSessionStoreWriteFromSource(_0x5a2a4a,{'bridgeImportPath':_0xf63066});if(!_0x48280a[_0x3fb9c9(0xee)]){if(_0x48280a[_0x3fb9c9(0x75)]===_0x3fb9c9(0x16f)+_0x3fb9c9(0xee)){_0x29c5e5[_0x3fb9c9(0xef)+'ogger']?.[_0x3fb9c9(0x148)]?.(_0x3fb9c9(0x16d)+_0x3fb9c9(0x1e0)+_0x3fb9c9(0x8b)+'h\x20alread'+_0x3fb9c9(0x167)+'d',{'filePath':_0x2fede2,'openclawVersion':_0x5239e5[_0x3fb9c9(0x1d4)+'Version']});break;}continue;}await writeFile(_0x2fede2,_0x48280a[_0x3fb9c9(0x150)],'utf8'),_0x29c5e5[_0x3fb9c9(0xef)+_0x3fb9c9(0x11e)]?.[_0x3fb9c9(0x148)]?.(_0x3fb9c9(0x16d)+_0x3fb9c9(0x1e0)+_0x3fb9c9(0x8b)+_0x3fb9c9(0x1fa)+'d',{'filePath':_0x2fede2,'openclawVersion':_0x5239e5[_0x3fb9c9(0x1d4)+_0x3fb9c9(0x237)]});break;}}async function resolveRuntimeChannelImportPath(_0x5f10fd,_0x3625c5){const _0x34fd74=_0x5ae80f,_0xd42522=_0x3625c5[_0x34fd74(0xdc)](_0x1afe2d=>_0x1afe2d[_0x34fd74(0x17e)]()&&_0x1afe2d[_0x34fd74(0xb7)][_0x34fd74(0x96)+'th'](_0x34fd74(0x181)+_0x34fd74(0x128))&&_0x1afe2d[_0x34fd74(0xb7)][_0x34fd74(0xcb)](_0x34fd74(0x8d))&&!_0x1afe2d[_0x34fd74(0xb7)][_0x34fd74(0x96)+'th'](_0x34fd74(0x181)+'channel-'+_0x34fd74(0x9d)))[_0x34fd74(0x1a8)](_0x5a9875=>_0x5a9875[_0x34fd74(0xb7)])[_0x34fd74(0x1fe)]();for(const _0x16a9f3 of _0xd42522){const _0x597b7e=await readFile(join(_0x5f10fd,_0x16a9f3),_0x34fd74(0xc7));if(_0x597b7e[_0x34fd74(0x68)](_0x34fd74(0x166)+_0x34fd74(0x202)+_0x34fd74(0x1f8)))return'./'+_0x16a9f3;}return null;}function normalizeRuntimeRelativePath(_0x206db5){const _0x43696b=_0x5ae80f;return _0x206db5[_0x43696b(0x81)+'ll']('\x5c','/');}function _0x52fa(){const _0x3e9d90=['d\x20an\x20inv','h\x20applie','wBin','\x20set\x20\x22OP','penClaw\x20','sort','find','>/dev/nu','t\x20\x22OPENC','ntimeCha','ugin\x20dep','utable','Spec','export\x20O','=\x22${OPEN','fix\x20star','--omit=d','required','nodeVers','g\x20from\x20O','ecs','IR=$(CDP','st\x20be\x20a\x20','now','lib/node','win','14775112yalqaU','ipped;\x20d','skills','rg/dist/','des.','w.cmd','-peer-de','rs;\x20veri','keys','store-lo','npm-cli.','match','store\x20lo','parse','d:\x20','st=','ame','_HOME:-','aw\x202026.','ntPaths','data','.json','dist','mjs','package','nced',',\x20shell.','npm-glob','--legacy','\x20found','\x20already','2JGfuaL','toISOStr','unknown','pendenci','split','Version','lugin\x20','@echo\x20of','--\x20\x22$(di','\x20-z\x20\x22$WU','string','==\x22\x22\x20set','und:\x20','plied','ld\x20start','m-cli.js','replace','\x20not\x20fou','age\x20was\x20','download','ist\x20not\x20','OME=','nning\x20op','ILE_NAME','agentSco','fix\x20mark','function','unction\x20','wujie-lo','ad-','on\x20futur','time]\x20ru','installP','trim','npm-cach','runtimeS','arch','rname\x20--','Temporar','chat\x20his','ATE_DIR%','connecto','runtime:','\x22\x20%*','skills\x20s','/npm','includes','_NAME:-','-doctor.','arm64','E_DIR=','_DIR%','\x20prepare','local\x20pl','wujieai.','devDepen','found','time]\x20do','pipe','reason','object','loader-','npm\x20root','resolved','\x20paths','[wujie-s','268456BETFIu','\x22==\x22\x22\x20se','isArray','E_NAME%\x22','idated','replaceA','ATH:-','te/cli\x20i','\x20kdocs\x20s','win32','l\x20prepar','153EEMvXt','try\x20not\x20','package.','lib','ite\x20patc','json','.js','--no-fun','rebuilt\x20','OGO\x22\x20];\x20','plugin\x20r','jection\x20','cal\x20runt','slice','nodeExec','startsWi','\x20resolve','pluginSp','label','shasum','indexOf','1\x20]\x20&&\x20[','state-','-extract','sion\x20val','alid\x20pay','path','product\x20','288410eZXxLR','ie-shell','config=','npm','\x20create\x20','\x20path\x20mu','%USERPRO','me\x20missi','FILE%\x5c','atch\x20alr','platform','dules/np','sion\x20mis','pped;\x20di','1986996iUPKfS','octor\x20--','Claw','stdout','ot\x20found','plugin\x20s','name','dependen','node','add','projectR','manifest','shell-ru','values','unzip','\x20complet','he\x20runti','npmCli','LocalPlu','enclaw\x20d','$HOME/','ify\x20upst','utf8','STATE_DI','with\x20cod','\x20written','endsWith','integrit','OpenClaw','tarball:','isDirect','all\x20loca','href','d\x20to\x20','flush','NFIG_FIL','skipped;','runtime','runtimeR','roductRu','eady\x20app','LocalAge','pid','filter','node/bin','ime/sess','ules','ipped;\x20f','AW_CONFI','pec:\x20','configur','ed-tool\x20','in\x20','not\x20foun','synced','-xzf','ynced','--no-aud','channel\x20','process.','cli','patched','runtimeL','stalling','push','headers','tory\x20pro','entryCou','ntime\x20re','set\x20\x22SCR','llPaths','scripts','pped;\x20lo','skill','index.mj','base\x20bui','in\x20runti','in\x20insta','_shared','Dependen','extract-','ath','patch\x20ap','er\x20writt','if\x20[\x20-t\x20','ion','error','re\x20upgra','rent','leted','tar','\x20product','ut\x20after','LocalSki','\x20\x22OPENCL','es\x20','plugins','if\x20\x22%OPE','\x22\x20\x22$@\x22','\x22\x20\x22$SCRI','\x20can\x20ins','stderr','npm\x20pack','132vrcCYr','y:\x20','path:\x20','tar.xz','catch','\x20on\x20futu','ogger','NCLAW_CO','st\x20not\x20f','\x20configu','director','pped;\x20ru','npm\x20inst','ad\x20patch','12wAFYmB','time-bri','channel-','68290lpYdAr',':\x20manife','--fix','time-too','dataDirN','red\x20Open','G_FILE_N','ginPaths','2428223TdWHUj','time','--json','ncies','\x20doctor\x20','runtime\x20','\x20install','@larksui','/node_mo','FIG_FILE','node_mod','el.inbou','tools\x20sy','ady\x20curr','CRIPT_DI','kill\x20not','untime\x20p','fix\x20comp','dge.mjs','\x20bin\x20was','set','timeoutM','w-extrac','info','ENCLAW_H','ing','bin','endencie','npm\x20plug','ebuild\x20t','then','source','eted','eer','\x20applied','ntime','hell:run','ATH=\x22${O','WorkingD','ent','warn','doctor','\x22\x20at\x20','syncOnly','prepare\x20','\x22%SCRIPT','prepareP','HOME=\x22${','SIGTERM','\x20path\x20wa','\x22\x20so\x20the','node\x20ver','\x20did\x20not','createRu','y\x20applie','\x20returne','s\x20not\x20fo','close','Unable\x20t','r\x20OpenCl','session\x20','928637YvKFnW','already-','ader\x20not','length','wrapper\x20','e\x20upgrad','lled','PT_DIR/','led','nd\x20helpe','agents','\x20timed\x20o','ted','has','resume','registry','isFile','nd\x20after','ile\x20not\x20','runtime-','Name','4wzICLS','kill','\x22\x20from\x20','lied','ced','statusCo','ATE_DIR:','dencies','ound','Configur','y\x20compat','PENCLAW_','join','.opencla','Duplicat','ignore',';\x20run\x20wu','CLAW_CON','https://','filename','e\x20plugin','null','optional','extensio','plugins\x20','ujie-she','ime\x20buil','oot','spec','\x20entry\x20\x22','\x20validat','\x20id\x20from','atch:\x20ma','.\x20Run\x20\x22w','patch\x20sk','ed\x20OpenC','Run\x20\x22wuj','map','exec\x20\x22$S','location','tory\x20mix','red\x20Node','dataDir','re\x22\x20to\x20r','missing\x20','s\x20instal','some','-xJf','d\x20for\x20lo','?t=','\x20version','LAW_STAT','toString','generate','bug;\x20ver','root','\x20is\x20miss','\x20loaded','execPath','ATH=\x20cd\x20','atch\x20ski','dAt','log','\x20\x20\x22$SCRI','leName','m/bin/np','Bin','install','Invalid\x20','x64','allowMis','\x20runtime','JSON:\x20','SCRIPT_D','eady\x20cur','started','failed','AME=','env','extract\x20','local:','openclaw','NCLAW_ST','&&\x20pwd)','.plugin-','local','appId','wujiecla','s\x20missin','ory','cies','r\x20runtim','product','store\x20wr','jie-shel','IPT_DIR=','e\x20tools\x20','pack','\x20failed\x20','\x22\x20\x22%SCRI','/opencla','go.mjs','version','Claw\x20ver','solver\x20n','chat-dis','versions','patch\x20al','ng\x20chann','ld\x20compl','.cache','time]\x20in','or.com','--omit=p','sets/wuj','pluginId','configFi','nnel'];_0x52fa=function(){return _0x3e9d90;};return _0x52fa();}function toWindowsPath(_0xcda2f0){return _0xcda2f0['replaceA'+'ll']('/','\x5c');}function validateRuntimeNodeVersion(_0x3bd505,_0x123540){const _0x5958c3=_0x5ae80f;if(_0x3bd505[_0x5958c3(0x20b)+_0x5958c3(0x106)]===_0x123540[_0x5958c3(0x1d4)][_0x5958c3(0x20b)+_0x5958c3(0x106)])return;throw new Error(_0x5958c3(0x136)+_0x5958c3(0x20b)+'ion\x20mism'+_0x5958c3(0x1a3)+'nifest='+(_0x3bd505[_0x5958c3(0x20b)+'ion']||_0x5958c3(0x234))+(_0x5958c3(0x22d)+_0x5958c3(0xa5))+_0x123540[_0x5958c3(0x1d4)][_0x5958c3(0x20b)+_0x5958c3(0x106)]+'.\x20'+(_0x5958c3(0x1a7)+_0x5958c3(0xa4)+_0x5958c3(0x6e)+_0x5958c3(0x163)+_0x5958c3(0x10c)+_0x5958c3(0x1ca)+'\x20can\x20be\x20'+_0x5958c3(0x8f)+'with\x20the'+'\x20configu'+_0x5958c3(0x1ac)+_0x5958c3(0x1b5)+'.'));}function validateRuntimeOpenClawVersion(_0x1fb9ea,_0x2f1f49){const _0x3c3962=_0x5ae80f;if(_0x1fb9ea[_0x3c3962(0x1d4)+_0x3c3962(0x237)]===_0x2f1f49[_0x3c3962(0x1d4)]['openclaw'+_0x3c3962(0x237)])return;throw new Error(_0x3c3962(0x136)+'openclaw'+'Version\x20'+'mismatch'+_0x3c3962(0x12a)+_0x3c3962(0x222)+(_0x1fb9ea['openclaw'+'Version']||_0x3c3962(0x234))+(_0x3c3962(0x22d)+_0x3c3962(0xa5))+_0x2f1f49[_0x3c3962(0x1d4)][_0x3c3962(0x1d4)+_0x3c3962(0x237)]+'.\x20'+(_0x3c3962(0x1a7)+'ie-shell'+_0x3c3962(0x6e)+'\x22\x20so\x20the'+_0x3c3962(0x1ca)+_0x3c3962(0x115)+'tall\x20the'+_0x3c3962(0x121)+_0x3c3962(0x12e)+_0x3c3962(0x1ea)+'sion.'));}function parseNpmPackJson(_0x5178bd){const _0x1ed40e=_0x5ae80f,_0x133784=_0x5178bd[_0x1ed40e(0x253)](),_0x2d9623=_0x133784[_0x1ed40e(0x9b)]('[');if(_0x2d9623<0x0)throw new Error('npm\x20pack'+'\x20did\x20not'+'\x20return\x20'+_0x1ed40e(0x1cb)+_0x133784[_0x1ed40e(0x94)](0x0,0x1f4));const _0x33f40f=JSON[_0x1ed40e(0x220)](_0x133784[_0x1ed40e(0x94)](_0x2d9623)),_0x388df3=Array[_0x1ed40e(0x7e)](_0x33f40f)?_0x33f40f[0x0]:_0x33f40f;if(!_0x388df3||typeof _0x388df3!==_0x1ed40e(0x76))throw new Error(_0x1ed40e(0x117)+_0x1ed40e(0x168)+_0x1ed40e(0x1f9)+_0x1ed40e(0xa0)+'load:\x20'+_0x133784[_0x1ed40e(0x94)](0x0,0x1f4));return _0x388df3;}function normalizePackedTarballFilename(_0x51f1a5){const _0x5a0534=_0x5ae80f;return _0x51f1a5[_0x5a0534(0x242)](/^@/,'')['replaceA'+'ll']('/','-')[_0x5a0534(0x81)+'ll']('\x5c','-');}async function runProcess(_0x27f1e2,_0x3e8842,_0x3998d7={}){const _0x3d4e57=_0x5ae80f,_0x528b21=_0x3998d7[_0x3d4e57(0x99)]||[_0x27f1e2,..._0x3e8842][_0x3d4e57(0x18f)]('\x20'),_0x53dcdc=_0x3998d7[_0x3d4e57(0x146)+'s']??NPM_INSTALL_TIMEOUT_MS,_0xcdc066=spawn(_0x27f1e2,_0x3e8842,{'cwd':_0x3998d7['cwd'],'env':_0x3998d7[_0x3d4e57(0x1d1)],'stdio':[_0x3d4e57(0x192),_0x3d4e57(0x74),'pipe']});return await new Promise((_0x186dac,_0x53161d)=>{const _0x580938=_0x3d4e57;let _0xe3adfe='',_0x56b6cb='',_0x55ecfa=![];const _0x4b2061=setTimeout(()=>{const _0x4c86eb=_0x458f;if(_0x55ecfa)return;_0x55ecfa=!![],_0xcdc066[_0x4c86eb(0x184)](_0x4c86eb(0x161)),_0x53161d(new Error(_0x528b21+(_0x4c86eb(0x179)+_0x4c86eb(0x10d)+'\x20')+_0x53dcdc+'ms'));},_0x53dcdc);_0xcdc066['stdout']['on']('data',_0x30e879=>{const _0x364ff8=_0x458f;_0xe3adfe+=_0x30e879[_0x364ff8(0x1b7)]();}),_0xcdc066[_0x580938(0x116)]['on'](_0x580938(0x227),_0x618997=>{const _0x1f9c05=_0x580938;_0x56b6cb+=_0x618997[_0x1f9c05(0x1b7)]();}),_0xcdc066['on'](_0x580938(0x107),_0x271145=>{if(_0x55ecfa)return;_0x55ecfa=!![],clearTimeout(_0x4b2061),_0x53161d(_0x271145);}),_0xcdc066['on']('close',(_0x16c3d1,_0x2e4bac)=>{const _0x1ec2a4=_0x580938;if(_0x55ecfa)return;_0x55ecfa=!![],clearTimeout(_0x4b2061);if(_0x16c3d1===0x0){_0x186dac({'stdout':_0xe3adfe,'stderr':_0x56b6cb});return;}_0x53161d(new Error(_0x528b21+(_0x1ec2a4(0x1e5)+_0x1ec2a4(0xc9)+'e=')+(_0x16c3d1??_0x1ec2a4(0x198))+'\x20signal='+(_0x2e4bac??'null')+'\x0a'+(''+(_0x56b6cb||_0xe3adfe))[_0x1ec2a4(0x253)]()));});});}async function installOpenClawPackage(_0xb57fa4,_0xd0a945){const _0x3e8bbc=_0x5ae80f,_0x310adc=join(_0xb57fa4['runtimeR'+_0x3e8bbc(0x19e)],_0x3e8bbc(0x1f1)),_0x4f20af=join(_0xb57fa4[_0x3e8bbc(0xd7)+_0x3e8bbc(0x19e)],_0x3e8bbc(0x190)+_0x3e8bbc(0x147)+'t');await mkdir(_0x310adc,{'recursive':!![]}),await removePathWithRetries(_0x4f20af),await mkdir(_0x4f20af,{'recursive':!![]});const _0x40a273=await createRuntimeEnv(_0xb57fa4),_0x4672f8=_0x3e8bbc(0x1d4)+'@'+_0xd0a945;console['log'](_0x3e8bbc(0x7b)+'hell:run'+_0x3e8bbc(0x1f2)+_0x3e8bbc(0xf0)+'\x20'+_0x4672f8);const _0x43c04c=await runProcess(_0xb57fa4[_0x3e8bbc(0x95)+'utable'],[_0xb57fa4[_0x3e8bbc(0xc2)],_0x3e8bbc(0x1e4),_0x4672f8,_0x3e8bbc(0x133)],{'cwd':_0x310adc,'env':_0x40a273,'label':'npm\x20pack'+'\x20'+_0x4672f8}),_0xd4aac=parseNpmPackJson(_0x43c04c[_0x3e8bbc(0xb4)]);if(_0xd4aac['version']!==_0xd0a945)throw new Error(_0x3e8bbc(0x18c)+_0x3e8bbc(0x1a6)+'law\x20'+_0xd0a945+(_0x3e8bbc(0x97)+_0x3e8bbc(0xd2))+_0xd4aac[_0x3e8bbc(0x1e9)]);const _0x8f3104=resolve(_0x310adc,_0xd4aac[_0x3e8bbc(0x196)]);if(!existsSync(_0x8f3104))throw new Error(_0x3e8bbc(0x117)+_0x3e8bbc(0x165)+'\x20create\x20'+_0x3e8bbc(0xce)+'\x20'+_0x8f3104);await runProcess(_0x3e8bbc(0x10b),[_0x3e8bbc(0xe8),_0x8f3104,'-C',_0x4f20af],{'label':_0x3e8bbc(0x1d2)+_0xd4aac[_0x3e8bbc(0x196)]}),await removePathWithRetries(_0xb57fa4[_0x3e8bbc(0x1d4)+'WorkingD'+'ir']),await rename(join(_0x4f20af,_0x3e8bbc(0x22b)),_0xb57fa4[_0x3e8bbc(0x1d4)+_0x3e8bbc(0x157)+'ir']),await removePathWithRetries(_0x4f20af),await runProcess(_0xb57fa4[_0x3e8bbc(0x95)+_0x3e8bbc(0x204)],[_0xb57fa4[_0x3e8bbc(0xc2)],_0x3e8bbc(0x1c6),_0x3e8bbc(0x209)+'ev',_0x3e8bbc(0x1f4)+_0x3e8bbc(0x152),'--no-aud'+'it',_0x3e8bbc(0x8e)+'d',_0x3e8bbc(0x22f)+_0x3e8bbc(0x219)+'ps'],{'cwd':_0xb57fa4[_0x3e8bbc(0x1d4)+_0x3e8bbc(0x157)+'ir'],'env':_0x40a273,'label':_0x3e8bbc(0x124)+'all\x20'+_0x4672f8+(_0x3e8bbc(0x1ca)+'\x20depende'+_0x3e8bbc(0x134))});if(!existsSync(_0xb57fa4[_0x3e8bbc(0x1d4)+_0x3e8bbc(0x1c5)]))throw new Error(_0x3e8bbc(0xcd)+_0x3e8bbc(0x144)+_0x3e8bbc(0x243)+_0x3e8bbc(0x17f)+_0x3e8bbc(0x137)+':\x20'+_0xb57fa4[_0x3e8bbc(0x1d4)+_0x3e8bbc(0x1c5)]);}async function ensureRuntimeBase(_0x27163a,_0x3a59a1,_0x62f1ee={}){const _0x15dfa8=_0x5ae80f;await mkdir(_0x3a59a1,{'recursive':!![]});let _0x34b84e=await readRuntimeManifest(_0x3a59a1);const _0x3e1d1b=_0x27163a[_0x15dfa8(0x1d4)][_0x15dfa8(0x20b)+_0x15dfa8(0x106)],_0x422d63=_0x27163a[_0x15dfa8(0x1d4)][_0x15dfa8(0x1d4)+_0x15dfa8(0x237)],_0xc57446=existsSync(resolveManifestPath(_0x3a59a1)),_0x280b70=runtimeHasRequiredPaths(_0x3a59a1,_0x34b84e),_0x453af5=_0x34b84e['nodeVers'+_0x15dfa8(0x106)]===_0x3e1d1b;!_0xc57446||!_0x280b70||!_0x453af5?(_0x62f1ee[_0x15dfa8(0xef)+'ogger']?.['info'](_0x15dfa8(0x136)+'base\x20bui'+_0x15dfa8(0x240)+'ed',{'runtimeRoot':_0x3a59a1,'reason':!_0xc57446?'missing\x20'+_0x15dfa8(0xbc):!_0x280b70?'missing\x20'+_0x15dfa8(0x20a)+_0x15dfa8(0x1ca)+_0x15dfa8(0x7a):_0x15dfa8(0x164)+_0x15dfa8(0xaf)+_0x15dfa8(0x21e),'syncOnly':_0x62f1ee[_0x15dfa8(0x15c)]}),_0x34b84e=await buildRuntimeBase(_0x27163a,_0x3a59a1,_0x34b84e),_0x62f1ee['runtimeL'+_0x15dfa8(0x11e)]?.[_0x15dfa8(0x148)](_0x15dfa8(0x136)+_0x15dfa8(0xfc)+_0x15dfa8(0x1f0)+_0x15dfa8(0x151),{'manifest':summarizeRuntimeManifest(_0x34b84e)})):_0x62f1ee[_0x15dfa8(0xef)+'ogger']?.[_0x15dfa8(0x148)](_0x15dfa8(0x136)+'base\x20alr'+_0x15dfa8(0x1cd)+_0x15dfa8(0x109),{'manifest':summarizeRuntimeManifest(_0x34b84e)});if(!existsSync(resolve(_0x3a59a1,_0x34b84e[_0x15dfa8(0x1d4)+_0x15dfa8(0x1c5)]))){const _0x55bbb7=createRuntimeInfoFromManifest(_0x3a59a1,_0x34b84e,{'allowMissingOpenClaw':!![]});await installOpenClawPackage(_0x55bbb7,_0x422d63),_0x34b84e[_0x15dfa8(0x1d4)+'Version']=_0x422d63;}return _0x34b84e;}function runtimeHasRequiredPaths(_0x527def,_0x592378){const _0x5d8946=_0x5ae80f;return[_0x5d8946(0x95)+_0x5d8946(0x204),_0x5d8946(0xc2),_0x5d8946(0x1d4)+_0x5d8946(0x157)+'ir',_0x5d8946(0x1d4)+_0x5d8946(0x1c5)]['every'](_0x319556=>typeof _0x592378[_0x319556]===_0x5d8946(0x23c)&&_0x592378[_0x319556][_0x5d8946(0x253)]())&&[_0x5d8946(0x95)+_0x5d8946(0x204),'npmCli']['every'](_0xe71f38=>existsSync(resolve(_0x527def,_0x592378[_0xe71f38])));}async function buildRuntimeBase(_0x1305a2,_0x350a13,_0xa916a4={}){const _0x400d45=_0x5ae80f,_0x58b890=join(_0x350a13,_0x400d45(0xb9));await ensureRuntimeNode(_0x1305a2,_0x58b890);const _0x3e9cdc={..._0xa916a4,'generatedAt':new Date()[_0x400d45(0x233)+_0x400d45(0x14a)](),'nodeVersion':_0x1305a2['openclaw'][_0x400d45(0x20b)+'ion'],'openclawVersion':_0xa916a4['openclaw'+'Version']||'','platform':process[_0x400d45(0xad)],'arch':process[_0x400d45(0x256)],'nodeExecutable':_0x400d45(0xdd)+'/node','npmCli':'node/lib'+_0x400d45(0x139)+_0x400d45(0xae)+_0x400d45(0x1c4)+_0x400d45(0x241),'openclawWorkingDir':'openclaw','openclawBin':_0x400d45(0x1d4)+_0x400d45(0x1e7)+'w.mjs'};return await writeJson(resolveManifestPath(_0x350a13),_0x3e9cdc),_0x3e9cdc;}async function removePathWithRetries(_0x1a40b2){await rm(_0x1a40b2,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96});}async function ensureRuntimeNode(_0x2cfed8,_0x1712d1){const _0x408fae=_0x5ae80f,_0x20bb5d=_0x2cfed8[_0x408fae(0x1d4)][_0x408fae(0x20b)+_0x408fae(0x106)],_0x4ecd88=join(_0x1712d1,_0x408fae(0x14b),'node'),_0x2232dd=join(_0x1712d1,_0x408fae(0x8a),_0x408fae(0x13b)+_0x408fae(0xdf),_0x408fae(0xa6),'bin',_0x408fae(0x21d)+'js');if(existsSync(_0x4ecd88)&&existsSync(_0x2232dd)&&await getNodeVersion(_0x4ecd88)===_0x20bb5d)return;await removePathWithRetries(_0x1712d1);if(process[_0x408fae(0x1ed)][_0x408fae(0xb9)]===_0x20bb5d){await linkCurrentNodeRuntime(_0x1712d1);return;}await downloadNodeRuntime(_0x20bb5d,_0x1712d1);}async function getNodeVersion(_0x2c2821){const _0x214f84=_0x5ae80f;try{const _0x467de4=await runProcess(_0x2c2821,['-p',_0x214f84(0xec)+_0x214f84(0x1ed)+'.node'],{'label':_0x2c2821+'\x20version','timeoutMs':0x7530});return _0x467de4[_0x214f84(0xb4)][_0x214f84(0x253)]();}catch{return'';}}async function linkCurrentNodeRuntime(_0x11c571){const _0x504b5a=_0x5ae80f,_0x176962=process[_0x504b5a(0x1bd)],_0xa75980=resolve(dirname(_0x176962),'..'),_0x1fe685=resolve(_0xa75980,_0x504b5a(0x211)+'_modules'+_0x504b5a(0x67)),_0x53c66e=join(_0x11c571,'bin',_0x504b5a(0xb9)),_0x3134ad=join(_0x11c571,_0x504b5a(0x8a),_0x504b5a(0x13b)+'ules','npm');await mkdir(dirname(_0x53c66e),{'recursive':!![]}),await mkdir(dirname(_0x3134ad),{'recursive':!![]}),await symlink(_0x176962,_0x53c66e),existsSync(_0x1fe685)?await symlink(_0x1fe685,_0x3134ad):await symlink(await resolveNpmRoot(),_0x3134ad);}async function resolveNpmRoot(){const _0x4bef49=_0x5ae80f,_0x268b63=await runProcess('npm',[_0x4bef49(0x1ba),'-g'],{'label':_0x4bef49(0x78)+'\x20-g','timeoutMs':0x7530}),_0x267306=join(_0x268b63[_0x4bef49(0xb4)][_0x4bef49(0x253)](),'npm');if(!existsSync(join(_0x267306,_0x4bef49(0x14b),_0x4bef49(0x21d)+'js')))throw new Error('npm\x20pack'+_0x4bef49(0x244)+'not\x20foun'+_0x4bef49(0x1b3)+_0x4bef49(0x93)+_0x4bef49(0x19d)+_0x4bef49(0x221)+_0x267306);return _0x267306;}async function downloadNodeRuntime(_0x14c241,_0x4ac8be){const _0x44dba8=_0x5ae80f,_0x3679cd=process['platform']===_0x44dba8(0x85)?_0x44dba8(0x212):process['platform'],_0x2e9d8a=process[_0x44dba8(0x256)]===_0x44dba8(0x1c8)?_0x44dba8(0x1c8):process[_0x44dba8(0x256)]===_0x44dba8(0x6b)?_0x44dba8(0x6b):process[_0x44dba8(0x256)],_0x540097=process[_0x44dba8(0xad)]===_0x44dba8(0x85)?'zip':_0x44dba8(0x11b),_0x4df7aa='node-v'+_0x14c241+'-'+_0x3679cd+'-'+_0x2e9d8a,_0x5f52c2=_0x4df7aa+'.'+_0x540097,_0x24e979=join(dirname(_0x4ac8be),_0x44dba8(0x1f1)),_0x11afd3=join(_0x24e979,_0x5f52c2),_0x583f07=join(_0x24e979,_0x4df7aa+(_0x44dba8(0x9e)+'-')+process[_0x44dba8(0xdb)]+'-'+Date[_0x44dba8(0x210)]()),_0x2564c2=_0x44dba8(0x195)+'nodejs.o'+_0x44dba8(0x216)+'v'+_0x14c241+'/'+_0x5f52c2;await mkdir(_0x24e979,{'recursive':!![]}),!existsSync(_0x11afd3)&&(console[_0x44dba8(0x1c1)](_0x44dba8(0x7b)+'hell:run'+_0x44dba8(0x73)+'wnloadin'+'g\x20'+_0x2564c2),await downloadFile(_0x2564c2,_0x11afd3)),await rm(_0x583f07,{'recursive':!![],'force':!![]}),await mkdir(_0x583f07,{'recursive':!![]}),process[_0x44dba8(0xad)]===_0x44dba8(0x85)?await runProcess(_0x44dba8(0xbf),['-q',_0x11afd3,'-d',_0x583f07],{'label':_0x44dba8(0x1d2)+_0x5f52c2}):await runProcess(_0x44dba8(0x10b),[_0x44dba8(0x1b2),_0x11afd3,'-C',_0x583f07],{'label':_0x44dba8(0x1d2)+_0x5f52c2}),await rename(join(_0x583f07,_0x4df7aa),_0x4ac8be),await rm(_0x583f07,{'recursive':!![],'force':!![]});}async function downloadFile(_0x102839,_0xd9588){await mkdir(dirname(_0xd9588),{'recursive':!![]});const _0x1bfe6c=await new Promise((_0x3c0901,_0x30efac)=>{const _0x3b9ba6=_0x458f;get(_0x102839,_0x476328=>{const _0x1af8b3=_0x458f;if(_0x476328[_0x1af8b3(0x188)+'de']>=0x12c&&_0x476328['statusCo'+'de']<0x190&&_0x476328['headers'][_0x1af8b3(0x1aa)]){_0x476328['resume'](),downloadFile(new URL(_0x476328[_0x1af8b3(0xf2)][_0x1af8b3(0x1aa)],_0x102839)[_0x1af8b3(0xd1)],_0xd9588)[_0x1af8b3(0x14f)](()=>_0x3c0901(null))[_0x1af8b3(0x11c)](_0x30efac);return;}if(_0x476328[_0x1af8b3(0x188)+'de']!==0xc8){_0x476328[_0x1af8b3(0x17c)](),_0x30efac(new Error(_0x1af8b3(0x245)+'\x20failed\x20'+_0x476328['statusCo'+'de']+':\x20'+_0x102839));return;}_0x3c0901(_0x476328);})['on'](_0x3b9ba6(0x107),_0x30efac);});_0x1bfe6c&&await pipeline(_0x1bfe6c,createWriteStream(_0xd9588));}export async function ensureOpenClawDoctorFixed(_0x1d8870,_0x26db71={}){const _0x1c355d=_0x5ae80f,_0x5d03e7=await loadRuntimeInfo(_0x1d8870['projectR'+_0x1c355d(0x19e)]),_0x42e7ec=getConfigPaths(_0x1d8870),_0x981f5c=join(_0x42e7ec[_0x1c355d(0x255)+'tateDir'],_0x1c355d(0x1d4)+_0x1c355d(0x6a)+_0x1c355d(0x8c)),_0x2bd2a1=await readJson(_0x981f5c,{});if(_0x2bd2a1[_0x1c355d(0x1d4)+_0x1c355d(0x237)]===_0x5d03e7[_0x1c355d(0x1d4)+_0x1c355d(0x237)])return _0x26db71[_0x1c355d(0xef)+_0x1c355d(0x11e)]?.[_0x1c355d(0x148)](_0x1c355d(0x1d4)+_0x1c355d(0x135)+'fix\x20alre'+_0x1c355d(0x13e)+_0x1c355d(0x158),{'openclawVersion':_0x5d03e7['openclaw'+_0x1c355d(0x237)],'markerPath':_0x981f5c}),{'ran':![],'openclawVersion':_0x5d03e7[_0x1c355d(0x1d4)+'Version'],'markerPath':_0x981f5c};return await runOpenClawDoctorFix(_0x1d8870,_0x5d03e7,{'fromVersion':_0x2bd2a1[_0x1c355d(0x1d4)+_0x1c355d(0x237)]||_0x1c355d(0x234),'toVersion':_0x5d03e7[_0x1c355d(0x1d4)+_0x1c355d(0x237)],'markerPath':_0x981f5c,'runtimeLogger':_0x26db71[_0x1c355d(0xef)+_0x1c355d(0x11e)]}),{'ran':!![],'openclawVersion':_0x5d03e7[_0x1c355d(0x1d4)+_0x1c355d(0x237)],'markerPath':_0x981f5c};}async function runOpenClawDoctorFix(_0x529c81,_0xa08646,{fromVersion:_0x2f67ed,toVersion:_0x39a2ba,markerPath:markerPath='',runtimeLogger:_0x9d3eb1}={}){const _0x599ec4=_0x5ae80f;_0x9d3eb1?.[_0x599ec4(0x148)](_0x599ec4(0x1d4)+_0x599ec4(0x135)+_0x599ec4(0x208)+_0x599ec4(0x17a),{'fromVersion':_0x2f67ed,'toVersion':_0x39a2ba});const _0x116f58=await createRuntimeEnv(_0xa08646,{'OPENCLAW_HOME':_0x529c81[_0x599ec4(0x1ad)],'OPENCLAW_STATE_DIR':_0x529c81['dataDir'],'OPENCLAW_CONFIG_PATH':getConfigPaths(_0x529c81)['configPa'+'th']});console[_0x599ec4(0x1c1)](_0x599ec4(0x7b)+_0x599ec4(0x155)+_0x599ec4(0x251)+_0x599ec4(0x248)+_0x599ec4(0xc4)+_0x599ec4(0xb2)+'fix');const _0x2b4f12=await runProcess(_0xa08646[_0x599ec4(0x95)+_0x599ec4(0x204)],[_0xa08646[_0x599ec4(0x1d4)+'Bin'],_0x599ec4(0x15a),_0x599ec4(0x12b)],{'cwd':_0xa08646[_0x599ec4(0x1d4)+_0x599ec4(0x157)+'ir'],'env':_0x116f58,'label':_0x599ec4(0x1d4)+_0x599ec4(0x135)+_0x599ec4(0x12b),'timeoutMs':0x1d4c0});_0x9d3eb1?.['info'](_0x599ec4(0x1d4)+'\x20doctor\x20'+_0x599ec4(0x142)+_0x599ec4(0x10a),{'fromVersion':_0x2f67ed,'toVersion':_0x39a2ba,'stdout':_0x2b4f12[_0x599ec4(0xb4)]['trim']()['slice'](-0xfa0),'stderr':_0x2b4f12['stderr'][_0x599ec4(0x253)]()[_0x599ec4(0x94)](-0xfa0)}),markerPath&&(await writeJson(markerPath,{'openclawVersion':_0xa08646[_0x599ec4(0x1d4)+'Version'],'fixedAt':new Date()[_0x599ec4(0x233)+'ing']()}),_0x9d3eb1?.[_0x599ec4(0x148)]('openclaw'+_0x599ec4(0x135)+_0x599ec4(0x24b)+_0x599ec4(0x104)+'en',{'markerPath':markerPath,'openclawVersion':_0xa08646['openclaw'+_0x599ec4(0x237)]}));}export async function readRuntimeManifest(_0x525901){return await readJson(resolveManifestPath(_0x525901),{});}export async function loadRuntimeInfo(_0x37a02f){const _0xe08c7d=resolveRuntimeRoot(_0x37a02f),_0x3a92ba=await readRuntimeManifest(_0xe08c7d);return createRuntimeInfoFromManifest(_0xe08c7d,_0x3a92ba);}function createRuntimeInfoFromManifest(_0x50dfd8,_0x5ec637,_0x35d871={}){const _0x40c4d5=_0x5ae80f;for(const _0x46a49f of[_0x40c4d5(0x95)+_0x40c4d5(0x204),_0x40c4d5(0xc2),_0x40c4d5(0x1d4)+_0x40c4d5(0x157)+'ir',_0x40c4d5(0x1d4)+'Bin']){if(typeof _0x5ec637[_0x46a49f]!=='string'||!_0x5ec637[_0x46a49f][_0x40c4d5(0x253)]())throw new Error('runtime\x20'+'manifest'+_0x40c4d5(0x1bb)+'ing\x20\x22'+_0x46a49f+_0x40c4d5(0x15b)+resolveManifestPath(_0x50dfd8)+(_0x40c4d5(0x193)+_0x40c4d5(0x1e1)+_0x40c4d5(0x86)+'e'));}const _0x169d51=resolve(_0x50dfd8,_0x5ec637[_0x40c4d5(0x95)+'utable']),_0x51bced=resolve(_0x50dfd8,_0x5ec637[_0x40c4d5(0xc2)]),_0x138f1e=resolve(_0x50dfd8,_0x5ec637[_0x40c4d5(0x1d4)+_0x40c4d5(0x157)+'ir']),_0x20a9a5=resolve(_0x50dfd8,_0x5ec637['openclaw'+'Bin']),_0x355aa1=Array[_0x40c4d5(0x7e)](_0x5ec637[_0x40c4d5(0x111)])?_0x5ec637[_0x40c4d5(0x111)]['map'](_0x3771a2=>({..._0x3771a2,'installPath':resolve(_0x50dfd8,_0x3771a2[_0x40c4d5(0x252)+'ath'])})):[],_0x2eb102=_0x35d871[_0x40c4d5(0x1c9)+'singOpen'+_0x40c4d5(0xb3)]?[_0x169d51,_0x51bced]:[_0x169d51,_0x51bced,_0x138f1e,_0x20a9a5];for(const _0x17b923 of _0x2eb102){if(!existsSync(_0x17b923))throw new Error(_0x40c4d5(0x136)+_0x40c4d5(0x1af)+_0x40c4d5(0x11a)+_0x17b923);}return{'runtimeRoot':_0x50dfd8,'manifest':_0x5ec637,'openclawVersion':_0x5ec637[_0x40c4d5(0x1d4)+_0x40c4d5(0x237)]||_0x40c4d5(0x234),'nodeExecutable':_0x169d51,'npmCli':_0x51bced,'openclawWorkingDir':_0x138f1e,'openclawBin':_0x20a9a5,'plugins':_0x355aa1};}function _0x458f(_0x521402,_0x23a86b){_0x521402=_0x521402-0x66;const _0x52fab1=_0x52fa();let _0x458f28=_0x52fab1[_0x521402];return _0x458f28;}export async function spawnClaw(_0x477872,_0x3440fb=[],_0x370008={}){const _0x24657d=_0x5ae80f,_0x2ef129=await loadRuntimeInfo(_0x477872),_0x1a7783=await createRuntimeEnv(_0x2ef129,_0x370008[_0x24657d(0x1d1)]??{});return spawn(_0x2ef129[_0x24657d(0x95)+_0x24657d(0x204)],[_0x2ef129[_0x24657d(0x1d4)+'Bin'],..._0x3440fb],{'cwd':_0x2ef129[_0x24657d(0x1d4)+_0x24657d(0x157)+'ir'],'stdio':_0x24657d(0x74),..._0x370008,'env':_0x1a7783});}export async function runClawOnce(_0x53a40f,_0x53615e=[],_0x4fc00c=0x15f90){const _0x42f0ef=await spawnClaw(_0x53a40f,_0x53615e);return await new Promise((_0x67c392,_0x3e047b)=>{const _0x239e5a=_0x458f;let _0x21d82e='',_0x347701='',_0x229e27=![];const _0x40f11a=setTimeout(()=>{const _0x3a0a52=_0x458f;if(_0x229e27)return;_0x229e27=!![],_0x42f0ef[_0x3a0a52(0x184)](_0x3a0a52(0x161)),_0x3e047b(new Error(_0x3a0a52(0x1d4)+'\x20timed\x20o'+_0x3a0a52(0x10d)+'\x20'+_0x4fc00c+'ms'));},_0x4fc00c);_0x42f0ef['stdout']['on']('data',_0x3a56b6=>{_0x21d82e+=_0x3a56b6['toString']();}),_0x42f0ef[_0x239e5a(0x116)]['on'](_0x239e5a(0x227),_0x1ebb19=>{const _0x2cf431=_0x239e5a;_0x347701+=_0x1ebb19[_0x2cf431(0x1b7)]();}),_0x42f0ef['on'](_0x239e5a(0x107),_0x102879=>{if(_0x229e27)return;_0x229e27=!![],clearTimeout(_0x40f11a),_0x3e047b(_0x102879);}),_0x42f0ef['on'](_0x239e5a(0x16a),(_0x451fe9,_0x476553)=>{if(_0x229e27)return;_0x229e27=!![],clearTimeout(_0x40f11a),_0x67c392({'code':_0x451fe9,'signal':_0x476553,'stdout':_0x21d82e,'stderr':_0x347701});});});}async function findRuntimeLarkCliBin(_0x34751c){const _0x2c02fa=_0x5ae80f,_0x45858b=join(_0x34751c[_0x2c02fa(0x1d4)+'WorkingD'+'ir'],_0x2c02fa(0x13b)+'ules',_0x2c02fa(0x138)+'te',_0x2c02fa(0xed)),_0x5ad4b4=join(_0x45858b,_0x2c02fa(0x89)+_0x2c02fa(0x8c));if(!existsSync(_0x5ad4b4))return{'packageDir':_0x45858b,'binPath':null};try{const _0x2ba9ed=JSON['parse'](await readFile(_0x5ad4b4,'utf8')),_0x544ed1=typeof _0x2ba9ed[_0x2c02fa(0x14b)]===_0x2c02fa(0x23c)?_0x2ba9ed[_0x2c02fa(0x14b)]:_0x2ba9ed[_0x2c02fa(0x14b)]&&typeof _0x2ba9ed['bin']===_0x2c02fa(0x76)?_0x2ba9ed['bin']['lark-cli']||Object['values'](_0x2ba9ed['bin'])[0x0]:'';return{'packageDir':_0x45858b,'binPath':_0x544ed1?join(_0x45858b,_0x544ed1):null};}catch{return{'packageDir':_0x45858b,'binPath':null};}}export async function resolveRuntimeLarkCliCommand(_0x6c5b9){const _0x298201=_0x5ae80f,{packageDir:_0xc0eb1a,binPath:_0x1b44fb}=await findRuntimeLarkCliBin(_0x6c5b9);if(!_0x1b44fb||!existsSync(_0x1b44fb))throw new Error('Bundled\x20'+_0x298201(0x138)+_0x298201(0x83)+_0x298201(0x1db)+_0x298201(0x20c)+_0x298201(0x1fd)+_0x298201(0x25c)+'\x20'+_0xc0eb1a+(_0x298201(0x1a4)+_0x298201(0x19c)+'ll\x20prepa'+_0x298201(0x1ae)+_0x298201(0x14e)+_0x298201(0xc1)+'me.'));return{'nodeExecutable':_0x6c5b9['nodeExec'+_0x298201(0x204)],'scriptPath':_0x1b44fb,'packageDir':_0xc0eb1a};}function resolvePackageNameFromNpmSpec(_0x232bc0){const _0x3e5980=_0x5ae80f,_0xb86209=_0x232bc0[_0x3e5980(0x253)]()[_0x3e5980(0x242)](/^npm:/,'');if(!_0xb86209)throw new Error(_0x3e5980(0x1c7)+'empty\x20pl'+'ugin\x20spe'+'c');if(_0xb86209[_0x3e5980(0x96)+'th']('@')){const _0x5ef422=_0xb86209[_0x3e5980(0x9b)]('/');if(_0x5ef422===-0x1)throw new Error(_0x3e5980(0x1c7)+'scoped\x20s'+_0x3e5980(0xe2)+_0x232bc0);const _0x198eb4=_0xb86209[_0x3e5980(0x9b)]('@',_0x5ef422+0x1);return _0x198eb4===-0x1?_0xb86209:_0xb86209['slice'](0x0,_0x198eb4);}const _0x2b8a9a=_0xb86209[_0x3e5980(0x9b)]('@');return _0x2b8a9a===-0x1?_0xb86209:_0xb86209['slice'](0x0,_0x2b8a9a);}async function createRuntimeEnv(_0x59af8a,_0x13e0df={}){const _0x9262=_0x5ae80f,_0x358519=process.env.OPENCLAW_STATE_DIR||'',_0x1597fe=process.env.NPM_CONFIG_REGISTRY||_0x9262(0x195)+_0x9262(0x17d)+'.npmmirr'+_0x9262(0x1f3),_0x178149=_0x358519?join(_0x358519,'claw-run'+_0x9262(0x12c)+'ls'):join(_0x59af8a['runtimeR'+_0x9262(0x19e)],'.tools'),_0x558346=join(_0x178149,_0x9262(0x22e)+'al'),_0x11cc5d=join(_0x178149,_0x9262(0x254)+'e'),_0x54347f=join(_0x558346,_0x9262(0x14b));await mkdir(_0x54347f,{'recursive':!![]}),await mkdir(_0x11cc5d,{'recursive':!![]});const _0x22d823=[_0x54347f,dirname(_0x59af8a['nodeExec'+_0x9262(0x204)]),process.env.PATH||''];return{...process.env,..._0x13e0df,'PATH':_0x22d823['filter'](Boolean)[_0x9262(0x18f)](delimiter),'npm_config_prefix':_0x558346,'NPM_CONFIG_PREFIX':_0x558346,'npm_config_cache':_0x11cc5d,'NPM_CONFIG_CACHE':_0x11cc5d,'NPM_CONFIG_REGISTRY':_0x1597fe,'npm_execpath':_0x59af8a[_0x9262(0xc2)],'npm_node_execpath':_0x59af8a[_0x9262(0x95)+'utable'],'OPENCLAW_RUNTIME_NPM_PREFIX':_0x558346,'OPENCLAW_RUNTIME_NPM_BIN':_0x54347f};}export async function getRuntimeSpawnContext(_0x247428,_0xe93f19={}){const _0x18a44a=_0x5ae80f,_0x5b8f69=await loadRuntimeInfo(_0x247428),_0xdb151=await createRuntimeEnv(_0x5b8f69,_0xe93f19);return{'cwd':_0x5b8f69[_0x18a44a(0x1d4)+_0x18a44a(0x157)+'ir'],'env':_0xdb151,'runtime':_0x5b8f69};}function resolvePluginDirNameFromSpec(_0x35ed64){const _0x5599e9=_0x5ae80f,_0x1d021c=resolvePackageNameFromNpmSpec(_0x35ed64),_0x4b4593=_0x1d021c[_0x5599e9(0x236)]('/')[_0x5599e9(0xdc)](Boolean),_0x13612d=_0x4b4593['at'](-0x1)??'';if(!_0x13612d)throw new Error(_0x5599e9(0x1c7)+_0x5599e9(0xb6)+'pec:\x20'+_0x35ed64);return _0x13612d;}async function resolvePluginIdFromPackageDir(_0x5c12cb,_0x54c97f){const _0x5a299f=_0x5ae80f,_0x4ef220=await readJson(join(_0x5c12cb,_0x5a299f(0x89)+_0x5a299f(0x8c)),{}),_0x404e84=await readPluginManifest(_0x5c12cb),_0x36e360=[_0x404e84?.['id'],_0x404e84?.['pluginId'],_0x404e84?.[_0x5a299f(0xb7)],_0x4ef220?.[_0x5a299f(0x1d4)]?.['id'],_0x4ef220?.[_0x5a299f(0x1d4)+'Id'],_0x54c97f],_0x87d775=_0x36e360[_0x5a299f(0x1ff)](_0x4c596f=>typeof _0x4c596f===_0x5a299f(0x23c)&&_0x4c596f[_0x5a299f(0x253)]());if(!_0x87d775)throw new Error(_0x5a299f(0x16b)+'o\x20resolv'+_0x5a299f(0x197)+_0x5a299f(0x1a2)+'\x20'+_0x5c12cb);return _0x87d775[_0x5a299f(0x253)]();}function pluginSpecMatches(_0x256ecc,_0x52bfae){const _0x7ff4bf=_0x5ae80f,_0x1f2f5f=_0x52bfae['trim'](),_0x5f0d40=resolvePackageNameFromNpmSpec(_0x1f2f5f);return[_0x256ecc[_0x7ff4bf(0x19f)],_0x256ecc[_0x7ff4bf(0x79)+_0x7ff4bf(0x205)],_0x256ecc['resolved'+_0x7ff4bf(0x182)]][_0x7ff4bf(0x1b1)](_0x3ed356=>_0x3ed356===_0x1f2f5f||_0x3ed356===_0x5f0d40);}async function installPluginFromNpmSpec(_0x11792c,_0x4f5984,_0x50492e={}){const _0x4df825=_0x5ae80f,_0x2ca9c0=_0x11792c[_0x4df825(0x253)]()['replace'](/^npm:/,''),_0x11f442=resolvePluginDirNameFromSpec(_0x2ca9c0),_0x372bad=join(_0x4f5984[_0x4df825(0x1d4)+_0x4df825(0x157)+'ir'],_0x4df825(0x229),_0x4df825(0x19a)+'ns'),_0x41f3c7=join(_0x372bad,_0x11f442),_0x5532dc=join(_0x4f5984['runtimeR'+'oot'],_0x4df825(0x1d7)+_0x4df825(0x101)+process[_0x4df825(0xdb)]+'-'+Date['now']()),_0x139964=await createRuntimeEnv(_0x4f5984),_0x3e08a6=new Date()['toISOStr'+'ing'](),_0x5286e0=join(_0x4f5984[_0x4df825(0xd7)+'oot'],_0x4df825(0x1f1));await mkdir(_0x5286e0,{'recursive':!![]}),await rm(_0x5532dc,{'recursive':!![],'force':!![]}),await rm(_0x41f3c7,{'recursive':!![],'force':!![]}),await mkdir(_0x5532dc,{'recursive':!![]}),await mkdir(_0x372bad,{'recursive':!![]}),console['log'](_0x4df825(0x7b)+_0x4df825(0x155)+'time]\x20fe'+'tching\x20p'+_0x4df825(0x238)+_0x2ca9c0);const _0x1227f4=await runProcess(_0x4f5984[_0x4df825(0x95)+'utable'],[_0x4f5984[_0x4df825(0xc2)],_0x4df825(0x1e4),_0x2ca9c0,'--json'],{'cwd':_0x5286e0,'env':_0x139964,'label':_0x4df825(0x117)+'\x20'+_0x2ca9c0}),_0x506eba=parseNpmPackJson(_0x1227f4[_0x4df825(0xb4)]),_0xec8daa=normalizePackedTarballFilename(_0x506eba[_0x4df825(0x196)]),_0x5d7219=join(_0x5286e0,_0xec8daa);if(!existsSync(_0x5d7219))throw new Error(_0x4df825(0x117)+_0x4df825(0x165)+_0x4df825(0xa7)+'tarball:'+'\x20'+_0x5d7219);await runProcess(_0x4df825(0x10b),[_0x4df825(0xe8),_0x5d7219,'-C',_0x5532dc],{'label':_0x4df825(0x1d2)+_0xec8daa}),await rename(join(_0x5532dc,_0x4df825(0x22b)),_0x41f3c7),await rm(_0x5532dc,{'recursive':!![],'force':!![]});const _0xbbf070=join(_0x41f3c7,_0x4df825(0x89)+_0x4df825(0x8c)),_0xfaebe8=await readJson(_0xbbf070,{});(_0xfaebe8[_0x4df825(0x71)+_0x4df825(0x18a)]||_0xfaebe8[_0x4df825(0xf8)])&&(delete _0xfaebe8['devDepen'+_0x4df825(0x18a)],delete _0xfaebe8[_0x4df825(0xf8)],await writeJson(_0xbbf070,_0xfaebe8));await runProcess(_0x4f5984[_0x4df825(0x95)+_0x4df825(0x204)],[_0x4f5984[_0x4df825(0xc2)],_0x4df825(0x1c6),_0x4df825(0x209)+'ev',_0x4df825(0x1f4)+_0x4df825(0x152),'--no-aud'+'it','--no-fun'+'d',_0x4df825(0x22f)+_0x4df825(0x219)+'ps'],{'cwd':_0x41f3c7,'env':_0x139964,'label':'npm\x20inst'+'all\x20plug'+_0x4df825(0xe5)+_0x2ca9c0});const _0x5105fc=new Date()[_0x4df825(0x233)+_0x4df825(0x14a)](),_0x1eaa4d=await resolvePluginIdFromPackageDir(_0x41f3c7,_0x506eba[_0x4df825(0xb7)]);return _0x50492e[_0x4df825(0xef)+'ogger']?.[_0x4df825(0x148)](_0x4df825(0x14d)+_0x4df825(0xfe)+_0x4df825(0x174),{'spec':_0x2ca9c0,'pluginId':_0x1eaa4d,'installPath':_0x41f3c7}),{'pluginId':_0x1eaa4d,'source':_0x4df825(0xa6),'spec':_0x2ca9c0,'installPath':toRuntimeRelative(_0x4f5984[_0x4df825(0xd7)+'oot'],_0x41f3c7),'version':_0x506eba['version'],'resolvedName':_0x506eba[_0x4df825(0xb7)],'resolvedVersion':_0x506eba[_0x4df825(0x1e9)],'resolvedSpec':_0x506eba[_0x4df825(0xb7)]+'@'+_0x506eba[_0x4df825(0x1e9)],'integrity':typeof _0x506eba[_0x4df825(0xcc)+'y']==='string'?_0x506eba[_0x4df825(0xcc)+'y']:'','shasum':typeof _0x506eba[_0x4df825(0x9a)]==='string'?_0x506eba[_0x4df825(0x9a)]:'','resolvedAt':_0x3e08a6,'installedAt':_0x5105fc};}async function syncConfiguredNpmPlugins(_0x4fb999,_0x5679f8,_0x315a69,_0x1ee923={}){const _0x3efcec=_0x5ae80f;if(_0x1ee923['syncOnly'])return;const _0x3099a7=createRuntimeInfoFromManifest(_0x5679f8,_0x315a69),_0x2ec156=Array['isArray'](_0x315a69[_0x3efcec(0x111)])?_0x315a69[_0x3efcec(0x111)]:[],_0x31a32d=[];for(const _0x47d485 of _0x4fb999[_0x3efcec(0x1d4)][_0x3efcec(0x98)+_0x3efcec(0x20d)]){const _0x40f312=_0x2ec156[_0x3efcec(0x1ff)](_0x12e337=>_0x12e337?.['source']==='npm'&&pluginSpecMatches(_0x12e337,_0x47d485)&&typeof _0x12e337['installP'+_0x3efcec(0x102)]===_0x3efcec(0x23c)&&existsSync(resolve(_0x5679f8,_0x12e337[_0x3efcec(0x252)+'ath'])));if(_0x40f312){_0x31a32d[_0x3efcec(0xf1)](_0x40f312);continue;}_0x31a32d[_0x3efcec(0xf1)](await installPluginFromNpmSpec(_0x47d485,_0x3099a7,_0x1ee923));}const _0x8b8076=new Set(_0x4fb999[_0x3efcec(0x1d4)][_0x3efcec(0x98)+_0x3efcec(0x20d)]['map'](resolvePackageNameFromNpmSpec)),_0x23829a=_0x2ec156['filter'](_0x1d6e13=>_0x1d6e13?.[_0x3efcec(0x150)]!=='npm'||!_0x8b8076[_0x3efcec(0x17b)](resolvePackageNameFromNpmSpec(_0x1d6e13[_0x3efcec(0x79)+'Name']||_0x1d6e13[_0x3efcec(0x19f)]||'')));_0x315a69['plugins']=[..._0x23829a,..._0x31a32d];}function hasRuntimeDependencies(_0x2b4f47){const _0x58e657=_0x5ae80f,_0x3073da=_0x2b4f47?.[_0x58e657(0xb8)+'cies']&&typeof _0x2b4f47[_0x58e657(0xb8)+_0x58e657(0x1dd)]===_0x58e657(0x76)?Object['keys'](_0x2b4f47[_0x58e657(0xb8)+_0x58e657(0x1dd)]):[],_0x221de7=_0x2b4f47?.[_0x58e657(0x199)+_0x58e657(0x100)+'cies']&&typeof _0x2b4f47[_0x58e657(0x199)+_0x58e657(0x100)+_0x58e657(0x1dd)]==='object'?Object[_0x58e657(0x21b)](_0x2b4f47['optional'+'Dependen'+_0x58e657(0x1dd)]):[];return _0x3073da[_0x58e657(0x171)]>0x0||_0x221de7[_0x58e657(0x171)]>0x0;}async function installLocalPluginRuntimeDependencies(_0x397ea3,_0x898396,_0x45731a){const _0xfb6558=_0x5ae80f,_0x54b4c8=join(_0x397ea3,_0xfb6558(0x89)+_0xfb6558(0x8c)),_0x114c1e=await readJson(_0x54b4c8,{});(_0x114c1e[_0xfb6558(0x71)+_0xfb6558(0x18a)]||_0x114c1e[_0xfb6558(0xf8)])&&(delete _0x114c1e[_0xfb6558(0x71)+_0xfb6558(0x18a)],delete _0x114c1e[_0xfb6558(0xf8)],await writeJson(_0x54b4c8,_0x114c1e));if(!hasRuntimeDependencies(_0x114c1e))return;const _0x525279=await createRuntimeEnv(_0x898396);console[_0xfb6558(0x1c1)](_0xfb6558(0x7b)+_0xfb6558(0x155)+_0xfb6558(0x1f2)+_0xfb6558(0xf0)+'\x20local\x20p'+'lugin\x20de'+_0xfb6558(0x235)+_0xfb6558(0x110)+_0x397ea3),await runProcess(_0x898396['nodeExec'+_0xfb6558(0x204)],[_0x898396[_0xfb6558(0xc2)],'install',_0xfb6558(0x209)+'ev','--omit=p'+_0xfb6558(0x152),_0xfb6558(0xea)+'it',_0xfb6558(0x8e)+'d',_0xfb6558(0x22f)+_0xfb6558(0x219)+'ps'],{'cwd':_0x397ea3,'env':_0x525279,'label':_0xfb6558(0x124)+_0xfb6558(0xd0)+'l\x20plugin'+'\x20'+_0x397ea3}),_0x45731a[_0xfb6558(0xef)+_0xfb6558(0x11e)]?.[_0xfb6558(0x148)](_0xfb6558(0x6f)+_0xfb6558(0x203)+_0xfb6558(0x14c)+_0xfb6558(0x1b0)+_0xfb6558(0x176),{'installPath':_0x397ea3});}async function syncSharedPluginModules(_0x3456ef,_0xa69587){const _0x28abcb=_0x5ae80f,_0x13af27=new Set();for(const _0x4c8b6e of _0x3456ef){const _0x30ea99=join(dirname(_0x4c8b6e),_0x28abcb(0xff));if(existsSync(_0x30ea99))_0x13af27[_0x28abcb(0xba)](_0x30ea99);}for(const _0x31350a of _0x13af27){await copyDirFresh(_0x31350a,join(_0xa69587,_0x28abcb(0xff)));}}async function syncProductPlugins(_0x2622f3,_0x473253,_0x3a12b6,_0x164411={}){const _0x45fd75=_0x5ae80f,_0x449d09=join(_0x473253,'openclaw',_0x45fd75(0x229),_0x45fd75(0x19a)+'ns'),_0x2e639d=createRuntimeInfoFromManifest(_0x473253,_0x3a12b6),_0x2f01e6=[];await syncSharedPluginModules(_0x2622f3[_0x45fd75(0x1d4)][_0x45fd75(0x79)+_0x45fd75(0xc3)+_0x45fd75(0x130)],_0x449d09);for(const _0x2b7da3 of _0x2622f3[_0x45fd75(0x1d4)]['resolved'+_0x45fd75(0xc3)+_0x45fd75(0x130)]){const _0x2ed210=await getPackageMetadata(_0x2b7da3),_0x3c946c=await readPluginManifest(_0x2b7da3),_0x338126=join(_0x449d09,_0x2ed210['pluginId']);await copyDirFresh(_0x2b7da3,_0x338126),await installLocalPluginRuntimeDependencies(_0x338126,_0x2e639d,_0x164411),_0x2f01e6[_0x45fd75(0xf1)]({'pluginId':_0x2ed210[_0x45fd75(0x1f6)],'source':'local','spec':_0x45fd75(0x1d3)+_0x2b7da3,'installPath':toRuntimeRelative(_0x473253,_0x338126),'version':_0x2ed210[_0x45fd75(0x1e9)],'resolvedName':_0x2ed210[_0x45fd75(0xb7)],'resolvedVersion':_0x2ed210['version'],'resolvedSpec':'local:'+_0x2b7da3,'integrity':'','shasum':'','resolvedAt':new Date()['toISOStr'+_0x45fd75(0x14a)](),'installedAt':new Date()[_0x45fd75(0x233)+_0x45fd75(0x14a)](),'agentScope':_0x3c946c[_0x45fd75(0x24a)+'pe'],'skills':_0x3c946c[_0x45fd75(0x215)]});}const _0x1b4d91=new Set(_0x2f01e6['map'](_0x407581=>_0x407581[_0x45fd75(0x1f6)])),_0x33b774=Array[_0x45fd75(0x7e)](_0x3a12b6[_0x45fd75(0x111)])?_0x3a12b6['plugins'][_0x45fd75(0xdc)](_0x2bfc1d=>!_0x1b4d91[_0x45fd75(0x17b)](_0x2bfc1d[_0x45fd75(0x1f6)])):[];_0x3a12b6[_0x45fd75(0x111)]=[..._0x33b774,..._0x2f01e6];}async function syncManifestPluginScope(_0x12e8c6,_0x10d061,_0x111563){const _0x37e957=_0x5ae80f,_0x358a56=join(_0x10d061,_0x37e957(0x1d4),_0x37e957(0x229),_0x37e957(0x19a)+'ns'),_0x5e8e58=new Set(_0x12e8c6['openclaw'][_0x37e957(0x98)+_0x37e957(0x20d)]??[]),_0x3745aa=new Set([..._0x5e8e58][_0x37e957(0x1a8)](_0x24147b=>_0x24147b[_0x37e957(0x242)](/^npm:/,''))['map'](_0x7be7a8=>{const _0xbec0c5=_0x37e957;if(_0x7be7a8[_0xbec0c5(0x96)+'th']('@')){const _0x4dd0ca=_0x7be7a8[_0xbec0c5(0x236)]('@');return _0x4dd0ca[_0xbec0c5(0x171)]>=0x3?'@'+_0x4dd0ca[0x1]:_0x7be7a8;}return _0x7be7a8[_0xbec0c5(0x236)]('@')[0x0];})[_0x37e957(0xdc)](Boolean)),_0x3c95a7=new Set();for(const _0xa15abc of _0x12e8c6['openclaw'][_0x37e957(0x79)+_0x37e957(0xc3)+_0x37e957(0x130)]){const _0x5bb409=await getPackageMetadata(_0xa15abc);if(_0x5bb409[_0x37e957(0x1f6)])_0x3c95a7[_0x37e957(0xba)](_0x5bb409['pluginId']);}const _0x421bdb=Array[_0x37e957(0x7e)](_0x111563[_0x37e957(0x111)])?_0x111563[_0x37e957(0x111)]:[];_0x111563['pluginSp'+_0x37e957(0x20d)]=[..._0x12e8c6[_0x37e957(0x1d4)][_0x37e957(0x98)+_0x37e957(0x20d)],..._0x12e8c6[_0x37e957(0x1d4)][_0x37e957(0x79)+_0x37e957(0xc3)+_0x37e957(0x130)]['map'](_0x50b0d8=>'local:'+_0x50b0d8)],_0x111563[_0x37e957(0x111)]=_0x421bdb[_0x37e957(0xdc)](_0xd056dc=>{const _0x4c7c5a=_0x37e957;if(!_0xd056dc||typeof _0xd056dc!==_0x4c7c5a(0x76))return![];if(_0xd056dc['source']===_0x4c7c5a(0x1d8))return _0x3c95a7[_0x4c7c5a(0x17b)](_0xd056dc['pluginId']);if(_0xd056dc[_0x4c7c5a(0x150)]==='npm')return _0x5e8e58['has'](_0xd056dc['spec'])||_0x5e8e58[_0x4c7c5a(0x17b)](_0xd056dc[_0x4c7c5a(0x79)+'Spec'])||_0x3745aa[_0x4c7c5a(0x17b)](_0xd056dc[_0x4c7c5a(0x79)+_0x4c7c5a(0x182)]);return![];});const _0x1a393a=new Set(_0x111563[_0x37e957(0x111)][_0x37e957(0x1a8)](_0xcd4e3=>_0xcd4e3[_0x37e957(0x1f6)]));for(const _0x17b446 of _0x421bdb){if(!_0x17b446[_0x37e957(0x1f6)]||_0x1a393a[_0x37e957(0x17b)](_0x17b446[_0x37e957(0x1f6)]))continue;const _0x444d45=typeof _0x17b446[_0x37e957(0x252)+_0x37e957(0x102)]===_0x37e957(0x23c)&&_0x17b446[_0x37e957(0x252)+_0x37e957(0x102)]['trim']()?resolve(_0x10d061,_0x17b446[_0x37e957(0x252)+'ath']):join(_0x358a56,_0x17b446[_0x37e957(0x1f6)]),_0x5ba1b9=relative(_0x358a56,_0x444d45);if(_0x5ba1b9['startsWi'+'th']('..')||_0x5ba1b9==='')continue;await rm(_0x444d45,{'recursive':!![],'force':!![]});}}async function collectCapabilityEntries(_0xf1a8ec,_0x2a9e17){const _0x35abc7=_0x5ae80f,_0x27dd18=new Map();for(const _0x4d7875 of _0xf1a8ec){let _0x41b643;try{_0x41b643=await stat(_0x4d7875);}catch{throw new Error(_0x2a9e17+(_0x35abc7(0x162)+_0x35abc7(0x169)+_0x35abc7(0x23e))+_0x4d7875);}if(!_0x41b643[_0x35abc7(0xcf)+_0x35abc7(0x1dc)]())throw new Error(_0x2a9e17+(_0x35abc7(0xa8)+_0x35abc7(0x20f)+_0x35abc7(0x122)+_0x35abc7(0x119))+_0x4d7875);const _0x329eaa={'name':basename(_0x4d7875),'path':_0x4d7875},_0x167421=_0x27dd18['get'](_0x329eaa[_0x35abc7(0xb7)]);if(_0x167421)throw new Error(_0x35abc7(0x191)+'e\x20'+_0x2a9e17+_0x35abc7(0x1a0)+_0x329eaa['name']+_0x35abc7(0x185)+_0x167421['path']+'\x20and\x20'+_0x329eaa['path']);_0x27dd18[_0x35abc7(0x145)](_0x329eaa[_0x35abc7(0xb7)],_0x329eaa);}return[..._0x27dd18[_0x35abc7(0xbe)]()];}async function syncProductCapabilityDirs(_0x2bb91f,_0x5dadcb,_0x6824fb){const _0x4d2789=_0x5ae80f,_0xd86e2=await collectCapabilityEntries(_0x2bb91f,_0x6824fb);await rm(_0x5dadcb,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await mkdir(_0x5dadcb,{'recursive':!![]});for(const _0x3b0748 of _0xd86e2){await cp(_0x3b0748[_0x4d2789(0xa1)],join(_0x5dadcb,_0x3b0748['name']),{'recursive':!![]});}return _0xd86e2[_0x4d2789(0x171)];}export const __test__={'collectCapabilityEntries':collectCapabilityEntries,'syncProductCapabilityDirs':syncProductCapabilityDirs};async function syncProductAgents(_0x592068,_0x219511,_0x4bcb3f){const _0x38c9cf=_0x5ae80f,_0x4de18c=join(_0x219511,_0x38c9cf(0x1d4),_0x38c9cf(0x178)),_0xe20649=await syncProductCapabilityDirs(_0x592068[_0x38c9cf(0x1d4)]['resolved'+_0x38c9cf(0xda)+_0x38c9cf(0x226)],_0x4de18c,'agent');_0x4bcb3f[_0x38c9cf(0x178)]={'source':'product','installPath':toRuntimeRelative(_0x219511,_0x4de18c),'localPaths':_0x592068[_0x38c9cf(0x1d4)]['resolved'+'LocalAge'+_0x38c9cf(0x226)],'entryCount':_0xe20649};}async function syncProductSkills(_0x26fb26,_0x5d6ba9,_0x317f41){const _0x543522=_0x5ae80f,_0xc3ee49=join(_0x5d6ba9,_0x543522(0x1d4),_0x543522(0x215)),_0x522ada=await syncProductCapabilityDirs(_0x26fb26[_0x543522(0x1d4)][_0x543522(0x79)+_0x543522(0x10e)+'llPaths'],_0xc3ee49,_0x543522(0xfa));_0x317f41['skills']={'source':_0x543522(0x1df),'installPath':toRuntimeRelative(_0x5d6ba9,_0xc3ee49),'localPaths':_0x26fb26['openclaw'][_0x543522(0x79)+_0x543522(0x10e)+_0x543522(0xf7)],'entryCount':_0x522ada};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x3fcb(){const _0x4a8b59=['eContext','onst\x20cha','865680shpfwN','untime;\x0a','ntime.in','stingCha','ntime\x20=\x20','nnel.inb','l.reply\x20','e.inboun','bound?.r','me;\x0a\x09\x09\x09c','\x09\x09\x09if\x20(!','elRuntim','401364viPicU','untime.c','ntime.ch','\x09\x09\x09};\x0a\x09\x09','turn?.ru','\x0a\x09\x09};\x0a','runtime\x20','\x0a\x09\x09\x09\x09ses','includes','sion:\x20ex','not-foun','\x20{};\x0a\x09\x09\x09','CTION_KE','rn\x20runti','\x09return\x20','rn\x20??',')\x20=>\x20{\x0a\x09','untime.t','\x20typeof\x20','nnel?.in','e\x20??=\x20en','eatePlug','elpers\x20=','hannel\x20:','imeRefle','ot-found','e.reply,','nbound:\x20','||\x20typeo','edRuntim','ns));\x0a\x09\x09',':crypto\x22','d,\x0a\x09\x09\x09\x09t','existing','...chann','untimeCh','tingChan','ontexts\x20','nnelRunt','istingCh','imePromi','Runtime;','import-n','solvedRu','Channel(','bound,\x0a\x09','untimeCo','ons.runt','urn:\x20exi','882vinpid','portPath','eRuntime','ded','..existi','time\x20=\x20(','null;','3048960KGNjJd','nel\x20=\x20ru','\x20createH','ect\x22\x20?\x20r','eChannel','RuntimeH','\x09\x09\x09if\x20(r','556507lROyeH','atePlugi','nnel.tur','\x0a\x09\x09};','ngChanne','ctionKey','\x20channel','import\x20{','eateRunt','inRuntim','\x0a\x09\x09};\x0a\x09\x09','nRuntime','ound\x20??\x20','annel\x20as','\x09};','replace','channel-','wujieCre',');\x0a\x09\x09\x09co','annel\x20&&','solveCre','\x09\x09let\x20re','patched','e.runtim','Channel.','hannelRu','const\x20en','s,\x0a\x09\x09\x09\x09i',':\x20existi','e,\x0a\x09\x09\x09\x09.','===\x20\x22obj','bject\x22)\x20','=\x20{\x0a\x09\x09\x09\x09','solveRun','()(optio','hannel?.','eturn\x20re','105108maNgEG','744208cFQPSZ','\x20createR','un)\x20retu','w\x20Set(LA','\x20(runtim','ot-provi','f\x20runtim','annel.tu','ntexts:\x20','indexOf','channel\x20','Runtime.','??\x20chann','slice','ash\x20}\x20fr','annel.se','Set\x20=\x20ne','ssion\x20??','time.cha','const\x20re','m\x20\x22','jieCreat','sureWuji','om\x20\x22node','nst\x20exis','resolved','ime\x20=\x20wu','lazyRunt','imeChann','runtime;','e\x20??=\x20re','23248eLIEbZ','turn:\x20ex','inbound\x20','e()(opti','\x09\x09resolv','elpers(r','channelR','ntime;\x0a\x09','\x09\x09const\x20','esolveCr','n\x20&&\x20run','runtime.','session\x0a','runtimeC','null;\x0a\x09\x09','imeOptio','n\x20??\x20exi','urn\x20??\x20c','e)\x20=>\x20{\x0a'];_0x3fcb=function(){return _0x4a8b59;};return _0x3fcb();}function _0x49ee(_0x22518c,_0x2399fc){_0x22518c=_0x22518c-0x1c5;const _0x3fcb9a=_0x3fcb();let _0x49eee6=_0x3fcb9a[_0x22518c];return _0x49eee6;}(function(_0x4d990b,_0x233e38){const _0x262591=_0x49ee,_0x36c9c2=_0x4d990b();while(!![]){try{const _0x5442e2=-parseInt(_0x262591(0x20e))/0x1+parseInt(_0x262591(0x234))/0x2+parseInt(_0x262591(0x1cf))/0x3+parseInt(_0x262591(0x233))/0x4+parseInt(_0x262591(0x268))/0x5+parseInt(_0x262591(0x207))/0x6+-parseInt(_0x262591(0x200))/0x7*(parseInt(_0x262591(0x253))/0x8);if(_0x5442e2===_0x233e38)break;else _0x36c9c2['push'](_0x36c9c2['shift']());}catch(_0x4abf5d){_0x36c9c2['push'](_0x36c9c2['shift']());}}}(_0x3fcb,0x46ff2));export function patchChannelPluginRuntimeFromSource(_0x3c42a9,_0x3957b6={}){const _0x39c8d6=_0x49ee,_0xb6606f=_0x3957b6['runtimeC'+'hannelIm'+_0x39c8d6(0x201)];if(!_0xb6606f)return{'patched':![],'reason':'runtime-'+_0x39c8d6(0x21e)+_0x39c8d6(0x1f9)+_0x39c8d6(0x239)+_0x39c8d6(0x203)};if(_0x3c42a9['includes'](_0x39c8d6(0x21f)+'ateRunti'+'meChanne'+'l')){if(_0x3c42a9['includes'](_0x39c8d6(0x254)+_0x39c8d6(0x1f6)+_0x39c8d6(0x23b)+_0x39c8d6(0x1de))&&hasRuntimeChannelImport(_0x3c42a9,_0xb6606f))return{'patched':![],'reason':'already-'+_0x39c8d6(0x224)};return patchExistingChannelPluginRuntimeFromSource(_0x3c42a9,{'runtimeChannelImportPath':_0xb6606f});}if(_0x3c42a9[_0x39c8d6(0x1d7)]('wujieCha'+_0x39c8d6(0x1f5)+_0x39c8d6(0x1f7)+'se'))return patchExistingChannelPluginRuntimeFromSource(_0x3c42a9,{'runtimeChannelImportPath':_0xb6606f});const _0x1496ef=_0x39c8d6(0x223)+_0x39c8d6(0x1fa)+_0x39c8d6(0x1c7)+_0x39c8d6(0x261)+_0x39c8d6(0x247)+'solveRun'+_0x39c8d6(0x205)+_0x39c8d6(0x1df)+'\x09\x09resolv'+_0x39c8d6(0x1ec)+_0x39c8d6(0x252)+_0x39c8d6(0x222)+_0x39c8d6(0x20f)+_0x39c8d6(0x219)+_0x39c8d6(0x230)+'ns.runti'+'meOption'+'s);\x0a\x09\x09\x09r'+_0x39c8d6(0x232)+_0x39c8d6(0x1fa)+_0x39c8d6(0x25a)+_0x39c8d6(0x21c);if(!_0x3c42a9[_0x39c8d6(0x1d7)](_0x1496ef))return{'patched':![],'reason':_0x39c8d6(0x1d9)+'d'};const _0x39daca=_0x39c8d6(0x215)+'\x20createH'+_0x39c8d6(0x242)+'om\x20\x22node'+_0x39c8d6(0x1ee)+';';if(!_0x3c42a9['includes'](_0x39daca))return{'patched':![],'reason':_0x39c8d6(0x1f9)+_0x39c8d6(0x1e8)};const _0x94520d='\x09\x09let\x20re'+_0x39c8d6(0x1fa)+_0x39c8d6(0x1c7)+'null;\x0a\x09\x09'+_0x39c8d6(0x228)+_0x39c8d6(0x24a)+_0x39c8d6(0x20b)+_0x39c8d6(0x20c)+_0x39c8d6(0x1e5)+'\x20(runtim'+_0x39c8d6(0x265)+_0x39c8d6(0x1cd)+_0x39c8d6(0x1d5)+_0x39c8d6(0x1eb)+_0x39c8d6(0x23a)+'e\x20!==\x20\x22o'+_0x39c8d6(0x22d)+'return\x20r'+'untime;\x0a'+_0x39c8d6(0x20d)+'untime.c'+'hannel?.'+'turn?.ru'+_0x39c8d6(0x25d)+'time.cha'+_0x39c8d6(0x1e2)+_0x39c8d6(0x1cb)+_0x39c8d6(0x236)+'rn\x20runti'+_0x39c8d6(0x1cc)+_0x39c8d6(0x267)+_0x39c8d6(0x1f5)+_0x39c8d6(0x24e)+'jieCreat'+_0x39c8d6(0x202)+_0x39c8d6(0x1fb)+');\x0a\x09\x09\x09co'+_0x39c8d6(0x24c)+_0x39c8d6(0x1f3)+_0x39c8d6(0x208)+_0x39c8d6(0x1d1)+_0x39c8d6(0x221)+'\x20typeof\x20'+'runtime.'+_0x39c8d6(0x23e)+_0x39c8d6(0x22c)+_0x39c8d6(0x20a)+'untime.c'+_0x39c8d6(0x1e6)+_0x39c8d6(0x1da)+_0x39c8d6(0x25e)+_0x39c8d6(0x23e)+_0x39c8d6(0x22e)+_0x39c8d6(0x1f1)+'elRuntim'+_0x39c8d6(0x22b)+_0x39c8d6(0x204)+_0x39c8d6(0x212)+'l,\x0a\x09\x09\x09\x09r'+'untimeCo'+_0x39c8d6(0x23c)+_0x39c8d6(0x1f0)+_0x39c8d6(0x226)+_0x39c8d6(0x260)+_0x39c8d6(0x1f4)+'??\x20chann'+_0x39c8d6(0x1ce)+_0x39c8d6(0x225)+'eContext'+_0x39c8d6(0x229)+_0x39c8d6(0x1ea)+_0x39c8d6(0x1f0)+_0x39c8d6(0x226)+_0x39c8d6(0x255)+'??\x20chann'+'elRuntim'+_0x39c8d6(0x1ca)+'d,\x0a\x09\x09\x09\x09t'+'urn:\x20exi'+'stingCha'+_0x39c8d6(0x210)+_0x39c8d6(0x263)+_0x39c8d6(0x1c6)+_0x39c8d6(0x1c8)+_0x39c8d6(0x21a)+_0x39c8d6(0x259)+_0x39c8d6(0x1e0)+_0x39c8d6(0x264)+_0x39c8d6(0x227)+_0x39c8d6(0x1c5)+_0x39c8d6(0x1fc)+'\x09\x09\x09reply'+_0x39c8d6(0x22a)+_0x39c8d6(0x212)+'l.reply\x20'+_0x39c8d6(0x240)+'elRuntim'+'e.reply,'+_0x39c8d6(0x1d6)+_0x39c8d6(0x1d8)+'istingCh'+_0x39c8d6(0x243)+_0x39c8d6(0x245)+_0x39c8d6(0x214)+_0x39c8d6(0x23f)+_0x39c8d6(0x25f)+_0x39c8d6(0x1d2)+_0x39c8d6(0x1dd)+_0x39c8d6(0x251)+_0x39c8d6(0x218)+_0x39c8d6(0x247)+_0x39c8d6(0x22f)+'time\x20=\x20('+_0x39c8d6(0x1df)+'\x09\x09resolv'+_0x39c8d6(0x1ec)+_0x39c8d6(0x1e3)+_0x39c8d6(0x24a)+_0x39c8d6(0x20b)+_0x39c8d6(0x20c)+'elpers(r'+_0x39c8d6(0x25c)+_0x39c8d6(0x1e4)+_0x39c8d6(0x217)+'e()(opti'+('ons.runt'+_0x39c8d6(0x262)+_0x39c8d6(0x1ed)+'\x09return\x20'+_0x39c8d6(0x24d)+_0x39c8d6(0x1f8)+_0x39c8d6(0x211));return{'patched':!![],'source':_0x3c42a9[_0x39c8d6(0x21d)](_0x39daca,_0x39daca+'\x0a'+createRuntimeChannelImport(_0xb6606f))[_0x39c8d6(0x21d)](_0x1496ef,_0x94520d)};}function patchExistingChannelPluginRuntimeFromSource(_0x438213,_0x24547d){const _0x3fbad8=_0x49ee,{runtimeChannelImportPath:_0x2783bc}=_0x24547d,_0x4d6f64=_0x3fbad8(0x215)+_0x3fbad8(0x209)+_0x3fbad8(0x242)+_0x3fbad8(0x24b)+_0x3fbad8(0x1ee)+';';if(!_0x438213[_0x3fbad8(0x1d7)](_0x4d6f64))return{'patched':![],'reason':'import-n'+'ot-found'};const _0x2d2405=_0x3fbad8(0x223)+'solvedRu'+_0x3fbad8(0x1c7)+_0x3fbad8(0x206),_0x3a3861=_0x3fbad8(0x25b)+_0x3fbad8(0x24f)+_0x3fbad8(0x1e7)+_0x3fbad8(0x213)+_0x3fbad8(0x244)+_0x3fbad8(0x237)+'ZY_RUNTI'+'ME_REFLE'+_0x3fbad8(0x1db)+'YS);',_0x440fd9=_0x438213[_0x3fbad8(0x23d)](_0x2d2405),_0x3734b7=_0x438213['indexOf'](_0x3a3861,_0x440fd9);if(_0x440fd9===-0x1||_0x3734b7===-0x1)return{'patched':![],'reason':_0x3fbad8(0x1d9)+'d'};const _0x5eeb21=_0x3fbad8(0x223)+_0x3fbad8(0x1fa)+_0x3fbad8(0x1c7)+_0x3fbad8(0x261)+'const\x20en'+'sureWuji'+_0x3fbad8(0x20b)+_0x3fbad8(0x20c)+_0x3fbad8(0x1e5)+_0x3fbad8(0x238)+_0x3fbad8(0x265)+'\x09\x09\x09if\x20(!'+_0x3fbad8(0x1d5)+_0x3fbad8(0x1eb)+'f\x20runtim'+'e\x20!==\x20\x22o'+_0x3fbad8(0x22d)+'return\x20r'+_0x3fbad8(0x269)+_0x3fbad8(0x20d)+'untime.c'+_0x3fbad8(0x231)+_0x3fbad8(0x1d3)+_0x3fbad8(0x25d)+_0x3fbad8(0x246)+_0x3fbad8(0x1e2)+_0x3fbad8(0x1cb)+_0x3fbad8(0x236)+_0x3fbad8(0x1dc)+'me;\x0a\x09\x09\x09c'+_0x3fbad8(0x267)+_0x3fbad8(0x1f5)+'ime\x20=\x20wu'+_0x3fbad8(0x249)+_0x3fbad8(0x202)+_0x3fbad8(0x1fb)+_0x3fbad8(0x220)+_0x3fbad8(0x24c)+_0x3fbad8(0x1f3)+_0x3fbad8(0x208)+_0x3fbad8(0x1d1)+_0x3fbad8(0x221)+_0x3fbad8(0x1e1)+_0x3fbad8(0x25e)+_0x3fbad8(0x23e)+'===\x20\x22obj'+_0x3fbad8(0x20a)+_0x3fbad8(0x1d0)+_0x3fbad8(0x1e6)+'\x20{};\x0a\x09\x09\x09'+_0x3fbad8(0x25e)+_0x3fbad8(0x23e)+'=\x20{\x0a\x09\x09\x09\x09'+'...chann'+_0x3fbad8(0x1ce)+_0x3fbad8(0x22b)+_0x3fbad8(0x204)+_0x3fbad8(0x212)+'l,\x0a\x09\x09\x09\x09r'+_0x3fbad8(0x1fd)+'ntexts:\x20'+_0x3fbad8(0x1f0)+_0x3fbad8(0x226)+_0x3fbad8(0x260)+_0x3fbad8(0x1f4)+_0x3fbad8(0x240)+'elRuntim'+_0x3fbad8(0x225)+_0x3fbad8(0x266)+'s,\x0a\x09\x09\x09\x09i'+'nbound:\x20'+_0x3fbad8(0x1f0)+'Channel.'+_0x3fbad8(0x255)+_0x3fbad8(0x240)+_0x3fbad8(0x1ce)+_0x3fbad8(0x1ca)+_0x3fbad8(0x1ef)+_0x3fbad8(0x1ff)+_0x3fbad8(0x1c6)+'nnel.tur'+_0x3fbad8(0x263)+_0x3fbad8(0x1c6)+_0x3fbad8(0x1c8)+_0x3fbad8(0x21a)+_0x3fbad8(0x259)+_0x3fbad8(0x1e0)+_0x3fbad8(0x264)+'hannelRu'+_0x3fbad8(0x1c5)+_0x3fbad8(0x1fc)+'\x09\x09\x09reply'+_0x3fbad8(0x22a)+_0x3fbad8(0x212)+_0x3fbad8(0x1c9)+_0x3fbad8(0x240)+_0x3fbad8(0x1ce)+_0x3fbad8(0x1e9)+_0x3fbad8(0x1d6)+_0x3fbad8(0x1d8)+_0x3fbad8(0x1f6)+_0x3fbad8(0x243)+_0x3fbad8(0x245)+'\x20channel'+_0x3fbad8(0x23f)+'session\x0a'+_0x3fbad8(0x1d2)+_0x3fbad8(0x1dd)+_0x3fbad8(0x251)+_0x3fbad8(0x218)+'const\x20re'+_0x3fbad8(0x22f)+_0x3fbad8(0x205)+_0x3fbad8(0x1df)+_0x3fbad8(0x257)+_0x3fbad8(0x1ec)+_0x3fbad8(0x1e3)+_0x3fbad8(0x24a)+'eChannel'+'RuntimeH'+_0x3fbad8(0x258)+_0x3fbad8(0x25c)+_0x3fbad8(0x1e4)+'inRuntim'+_0x3fbad8(0x256)+(_0x3fbad8(0x1fe)+_0x3fbad8(0x262)+_0x3fbad8(0x1ed)+_0x3fbad8(0x1dd)+'resolved'+_0x3fbad8(0x1f8)+_0x3fbad8(0x1d4)),_0x398c8d=_0x438213[_0x3fbad8(0x241)](0x0,_0x440fd9)+_0x5eeb21+_0x438213[_0x3fbad8(0x241)](_0x3734b7);return{'patched':!![],'source':ensureRuntimeChannelImport(_0x398c8d,{'importMarker':_0x4d6f64,'runtimeChannelImportPath':_0x2783bc})};}function createRuntimeChannelImport(_0x1e2ad5){const _0x4b9772=_0x49ee;return'import\x20{'+_0x4b9772(0x235)+_0x4b9772(0x1f2)+_0x4b9772(0x21b)+'\x20wujieCr'+_0x4b9772(0x216)+_0x4b9772(0x250)+'el\x20}\x20fro'+_0x4b9772(0x248)+_0x1e2ad5+'\x22;';}function hasRuntimeChannelImport(_0x2eda35,_0x10c6a1){const _0x58864b=_0x49ee;return _0x2eda35[_0x58864b(0x1d7)](createRuntimeChannelImport(_0x10c6a1));}function ensureRuntimeChannelImport(_0x277d94,{importMarker:_0x6399c,runtimeChannelImportPath:_0xd1462c}){const _0x107470=createRuntimeChannelImport(_0xd1462c),_0x2816f2=/import \{ createRuntimeChannel as wujieCreateRuntimeChannel \} from "\.\/runtime-channel-[^"]+\.js";\n?/;if(_0x2816f2['test'](_0x277d94))return _0x277d94['replace'](_0x2816f2,_0x107470+'\x0a');return _0x277d94['replace'](_0x6399c,_0x6399c+'\x0a'+_0x107470);}
|
|
1
|
+
function _0x4d62(){const _0x1eb431=['558936XjQCkL','()(optio','Channel.','ntime\x20=\x20','1490280xKqjns','111182jeXnEn','YS);','\x09};','replace','ntime.ch','97507nzbkRc','patched','nst\x20exis','imeRefle','ntime;\x0a\x09','Channel(','const\x20re','return\x20r','ctionKey','n\x20&&\x20run','om\x20\x22node','ssion\x20??','imeChann','runtime-','eateRunt','runtime.','channel-','\x09\x09\x09if\x20(r','inRuntim','hannelIm','ect\x22\x20?\x20r','ntime.in','e\x20!==\x20\x22o','time\x20=\x20(','runtime\x20','istingCh','el\x20}\x20fro','===\x20\x22obj','ound\x20??\x20','nbound:\x20','annel\x20&&','ns));\x0a\x09\x09','89556pmSanA','elpers(r','rn\x20runti','ntexts:\x20','untime;\x0a','meChanne','l,\x0a\x09\x09\x09\x09r','\x20{};\x0a\x09\x09\x09','eContext','\x0a\x09\x09};\x0a','e\x20??=\x20en','elRuntim','channelR','ontexts\x20','indexOf','null;','nel\x20=\x20ru','untime.t','7XJbzam','bound,\x0a\x09','ime\x20=\x20wu','existing','sureWuji','urn\x20??\x20c','eturn\x20re','f\x20runtim','||\x20typeo','ME_REFLE','..existi','nnel?.in','solvedRu','eChannel','hannel\x20:','hannelRu','runtime;','elpers\x20=','imePromi','e.inboun','\x0a\x09\x09\x09\x09ses','ngChanne','nnel.inb','turn:\x20ex','\x09\x09\x09};\x0a\x09\x09','lazyRunt','RuntimeH','annel.se','un)\x20retu','sion:\x20ex','\x09\x09const\x20','imeOptio','l.reply\x20','e)\x20=>\x20{\x0a','ons.runt',');\x0a\x09\x09\x09co','edRuntim','n\x20??\x20exi','import\x20{','annel.tu','e()(opti','\x09\x09let\x20re','wujieCre','meOption','\x20channel','ateRunti','ns.runti','const\x20en','ot-provi',')\x20=>\x20{\x0a\x09','\x09\x09resolv','Runtime.','20DmPuOo','e.runtim','hannel?.','\x09return\x20','onst\x20cha','rn\x20??','resolved','CTION_KE','bound?.r','\x09\x09\x09if\x20(!','\x0a\x09\x09};\x0a\x09\x09','ded','jieCreat','nnel.tur','\x20typeof\x20','stingCha','me;\x0a\x09\x09\x09c','slice','channel\x20','solveCre','eRuntime','=\x20{\x0a\x09\x09\x09\x09','time.cha','session\x0a','1978182qmWkJi','null;\x0a\x09\x09','Runtime;','solveRun','ZY_RUNTI','d,\x0a\x09\x09\x09\x09t','e\x20??=\x20re','e.reply,','not-foun','277158QjBpos','nnelRunt','urn:\x20exi','s,\x0a\x09\x09\x09\x09i','eatePlug','portPath','runtimeC','e,\x0a\x09\x09\x09\x09.','annel\x20as','import-n','??\x20chann','ot-found','includes','test','...chann','\x20(runtim','untimeCh','bject\x22)\x20','untime.c','ash\x20}\x20fr','turn?.ru','\x20createR','\x20createH',':crypto\x22','s);\x0a\x09\x09\x09r','\x20wujieCr','esolveCr'];_0x4d62=function(){return _0x1eb431;};return _0x4d62();}(function(_0x41a349,_0x25eb51){const _0x2b72e2=_0x4155,_0x336242=_0x41a349();while(!![]){try{const _0x30de08=parseInt(_0x2b72e2(0x27a))/0x1+parseInt(_0x2b72e2(0x275))/0x2+parseInt(_0x2b72e2(0x1ee))/0x3+parseInt(_0x2b72e2(0x270))/0x4+parseInt(_0x2b72e2(0x234))/0x5*(parseInt(_0x2b72e2(0x255))/0x6)+-parseInt(_0x2b72e2(0x200))/0x7*(parseInt(_0x2b72e2(0x274))/0x8)+-parseInt(_0x2b72e2(0x24c))/0x9;if(_0x30de08===_0x25eb51)break;else _0x336242['push'](_0x336242['shift']());}catch(_0x3901ef){_0x336242['push'](_0x336242['shift']());}}}(_0x4d62,0x18bfd));function _0x4155(_0x251677,_0x540f6){_0x251677=_0x251677-0x1de;const _0x4d62f2=_0x4d62();let _0x415553=_0x4d62f2[_0x251677];return _0x415553;}export function patchChannelPluginRuntimeFromSource(_0x4e3439,_0x194624={}){const _0x586550=_0x4155,_0x307643=_0x194624['runtimeC'+_0x586550(0x1e1)+_0x586550(0x25a)];if(!_0x307643)return{'patched':![],'reason':_0x586550(0x287)+_0x586550(0x1de)+_0x586550(0x25e)+_0x586550(0x230)+_0x586550(0x23f)};if(_0x4e3439[_0x586550(0x261)](_0x586550(0x22a)+_0x586550(0x22d)+_0x586550(0x1f3)+'l')){if(_0x4e3439[_0x586550(0x261)](_0x586550(0x217)+'istingCh'+_0x586550(0x227)+_0x586550(0x239))&&hasRuntimeChannelImport(_0x4e3439,_0x307643))return{'patched':![],'reason':'already-'+_0x586550(0x27b)};return patchExistingChannelPluginRuntimeFromSource(_0x4e3439,{'runtimeChannelImportPath':_0x307643});}if(_0x4e3439[_0x586550(0x261)]('wujieCha'+_0x586550(0x256)+_0x586550(0x212)+'se'))return patchExistingChannelPluginRuntimeFromSource(_0x4e3439,{'runtimeChannelImportPath':_0x307643});const _0x24f80b='\x09\x09let\x20re'+_0x586550(0x20c)+_0x586550(0x273)+_0x586550(0x24d)+_0x586550(0x280)+_0x586550(0x24f)+_0x586550(0x1e5)+_0x586550(0x231)+_0x586550(0x232)+_0x586550(0x224)+_0x586550(0x252)+_0x586550(0x247)+'atePlugi'+'nRuntime'+_0x586550(0x271)+_0x586550(0x22e)+_0x586550(0x22b)+_0x586550(0x26d)+_0x586550(0x206)+'solvedRu'+_0x586550(0x27e)+_0x586550(0x277);if(!_0x4e3439[_0x586550(0x261)](_0x24f80b))return{'patched':![],'reason':_0x586550(0x254)+'d'};const _0x141069=_0x586550(0x226)+_0x586550(0x26b)+'ash\x20}\x20fr'+'om\x20\x22node'+':crypto\x22'+';';if(!_0x4e3439[_0x586550(0x261)](_0x141069))return{'patched':![],'reason':_0x586550(0x25e)+'ot-found'};const _0x30dab8=_0x586550(0x229)+_0x586550(0x20c)+_0x586550(0x273)+_0x586550(0x24d)+_0x586550(0x22f)+_0x586550(0x204)+_0x586550(0x20d)+_0x586550(0x21a)+_0x586550(0x211)+'\x20(runtim'+_0x586550(0x221)+_0x586550(0x23d)+_0x586550(0x1e6)+_0x586550(0x208)+_0x586550(0x207)+_0x586550(0x1e4)+_0x586550(0x266)+'return\x20r'+_0x586550(0x1f2)+_0x586550(0x1df)+_0x586550(0x267)+_0x586550(0x236)+_0x586550(0x269)+'n\x20&&\x20run'+_0x586550(0x24a)+_0x586550(0x20b)+'bound?.r'+_0x586550(0x21c)+_0x586550(0x1f0)+_0x586550(0x244)+_0x586550(0x238)+_0x586550(0x256)+_0x586550(0x202)+_0x586550(0x240)+'eRuntime'+_0x586550(0x27f)+');\x0a\x09\x09\x09co'+'nst\x20exis'+'tingChan'+_0x586550(0x1fe)+_0x586550(0x279)+_0x586550(0x1ec)+_0x586550(0x242)+_0x586550(0x289)+'channel\x20'+_0x586550(0x1e9)+_0x586550(0x1e2)+_0x586550(0x267)+'hannel\x20:'+_0x586550(0x1f5)+_0x586550(0x289)+_0x586550(0x246)+_0x586550(0x249)+_0x586550(0x263)+_0x586550(0x1f9)+_0x586550(0x25c)+_0x586550(0x20a)+_0x586550(0x215)+_0x586550(0x1f4)+'untimeCo'+'ntexts:\x20'+_0x586550(0x203)+'Channel.'+_0x586550(0x25b)+_0x586550(0x1fb)+_0x586550(0x25f)+_0x586550(0x1f9)+_0x586550(0x235)+_0x586550(0x1f6)+'s,\x0a\x09\x09\x09\x09i'+_0x586550(0x1eb)+_0x586550(0x203)+'Channel.'+'inbound\x20'+_0x586550(0x25f)+_0x586550(0x1f9)+_0x586550(0x213)+_0x586550(0x251)+_0x586550(0x257)+'stingCha'+_0x586550(0x241)+_0x586550(0x225)+_0x586550(0x243)+_0x586550(0x216)+_0x586550(0x1ea)+_0x586550(0x1fa)+_0x586550(0x1ff)+_0x586550(0x205)+_0x586550(0x20f)+_0x586550(0x1e3)+_0x586550(0x201)+'\x09\x09\x09reply'+':\x20existi'+_0x586550(0x215)+_0x586550(0x220)+_0x586550(0x25f)+'elRuntim'+_0x586550(0x253)+_0x586550(0x214)+_0x586550(0x21d)+_0x586550(0x1e7)+_0x586550(0x21b)+'ssion\x20??'+_0x586550(0x22c)+'Runtime.'+'session\x0a'+_0x586550(0x218)+_0x586550(0x237)+_0x586550(0x210)+_0x586550(0x23e)+_0x586550(0x280)+_0x586550(0x24f)+_0x586550(0x1e5)+_0x586550(0x231)+_0x586550(0x232)+_0x586550(0x224)+_0x586550(0x1f8)+_0x586550(0x204)+_0x586550(0x20d)+_0x586550(0x21a)+'elpers(r'+_0x586550(0x26f)+'eatePlug'+_0x586550(0x1e0)+'e()(opti'+('ons.runt'+_0x586550(0x21f)+_0x586550(0x1ed)+_0x586550(0x237)+_0x586550(0x23a)+_0x586550(0x24e)+'\x0a\x09\x09};');return{'patched':!![],'source':_0x4e3439[_0x586550(0x278)](_0x141069,_0x141069+'\x0a'+createRuntimeChannelImport(_0x307643))[_0x586550(0x278)](_0x24f80b,_0x30dab8)};}function patchExistingChannelPluginRuntimeFromSource(_0x5c0f2a,_0x4be685){const _0x23d937=_0x4155,{runtimeChannelImportPath:_0x1865e8}=_0x4be685,_0x18e1f3='import\x20{'+_0x23d937(0x26b)+_0x23d937(0x268)+_0x23d937(0x284)+_0x23d937(0x26c)+';';if(!_0x5c0f2a[_0x23d937(0x261)](_0x18e1f3))return{'patched':![],'reason':_0x23d937(0x25e)+_0x23d937(0x260)};const _0x3a815b='\x09\x09let\x20re'+'solvedRu'+'ntime\x20=\x20'+_0x23d937(0x1fd),_0x1af79a=_0x23d937(0x21e)+_0x23d937(0x219)+_0x23d937(0x27d)+_0x23d937(0x282)+'Set\x20=\x20ne'+'w\x20Set(LA'+_0x23d937(0x250)+_0x23d937(0x209)+_0x23d937(0x23b)+_0x23d937(0x276),_0x36a17d=_0x5c0f2a[_0x23d937(0x1fc)](_0x3a815b),_0x3706ef=_0x5c0f2a[_0x23d937(0x1fc)](_0x1af79a,_0x36a17d);if(_0x36a17d===-0x1||_0x3706ef===-0x1)return{'patched':![],'reason':_0x23d937(0x254)+'d'};const _0x55c2b2=_0x23d937(0x229)+_0x23d937(0x20c)+_0x23d937(0x273)+_0x23d937(0x24d)+_0x23d937(0x22f)+_0x23d937(0x204)+'eChannel'+_0x23d937(0x21a)+_0x23d937(0x211)+_0x23d937(0x264)+'e)\x20=>\x20{\x0a'+_0x23d937(0x23d)+_0x23d937(0x1e6)+_0x23d937(0x208)+_0x23d937(0x207)+_0x23d937(0x1e4)+'bject\x22)\x20'+_0x23d937(0x281)+_0x23d937(0x1f2)+_0x23d937(0x1df)+_0x23d937(0x267)+_0x23d937(0x236)+_0x23d937(0x269)+_0x23d937(0x283)+_0x23d937(0x24a)+_0x23d937(0x20b)+_0x23d937(0x23c)+_0x23d937(0x21c)+_0x23d937(0x1f0)+'me;\x0a\x09\x09\x09c'+'onst\x20cha'+_0x23d937(0x256)+_0x23d937(0x202)+_0x23d937(0x240)+_0x23d937(0x248)+_0x23d937(0x27f)+_0x23d937(0x223)+_0x23d937(0x27c)+'tingChan'+'nel\x20=\x20ru'+_0x23d937(0x279)+'annel\x20&&'+'\x20typeof\x20'+_0x23d937(0x289)+_0x23d937(0x246)+'===\x20\x22obj'+_0x23d937(0x1e2)+_0x23d937(0x267)+_0x23d937(0x20e)+'\x20{};\x0a\x09\x09\x09'+_0x23d937(0x289)+_0x23d937(0x246)+_0x23d937(0x249)+_0x23d937(0x263)+_0x23d937(0x1f9)+_0x23d937(0x25c)+'..existi'+'ngChanne'+'l,\x0a\x09\x09\x09\x09r'+'untimeCo'+_0x23d937(0x1f1)+_0x23d937(0x203)+_0x23d937(0x272)+_0x23d937(0x25b)+_0x23d937(0x1fb)+_0x23d937(0x25f)+_0x23d937(0x1f9)+_0x23d937(0x235)+'eContext'+_0x23d937(0x258)+_0x23d937(0x1eb)+_0x23d937(0x203)+_0x23d937(0x272)+'inbound\x20'+_0x23d937(0x25f)+_0x23d937(0x1f9)+'e.inboun'+_0x23d937(0x251)+_0x23d937(0x257)+'stingCha'+_0x23d937(0x241)+_0x23d937(0x225)+'stingCha'+_0x23d937(0x216)+_0x23d937(0x1ea)+_0x23d937(0x1fa)+_0x23d937(0x1ff)+_0x23d937(0x205)+_0x23d937(0x20f)+'ntime.in'+'bound,\x0a\x09'+'\x09\x09\x09reply'+':\x20existi'+_0x23d937(0x215)+_0x23d937(0x220)+'??\x20chann'+_0x23d937(0x1f9)+_0x23d937(0x253)+_0x23d937(0x214)+_0x23d937(0x21d)+_0x23d937(0x1e7)+_0x23d937(0x21b)+_0x23d937(0x285)+_0x23d937(0x22c)+_0x23d937(0x233)+_0x23d937(0x24b)+'\x09\x09\x09};\x0a\x09\x09'+_0x23d937(0x237)+_0x23d937(0x210)+_0x23d937(0x23e)+_0x23d937(0x280)+'solveRun'+_0x23d937(0x1e5)+_0x23d937(0x231)+_0x23d937(0x232)+_0x23d937(0x224)+'e\x20??=\x20en'+'sureWuji'+_0x23d937(0x20d)+_0x23d937(0x21a)+_0x23d937(0x1ef)+_0x23d937(0x26f)+_0x23d937(0x259)+'inRuntim'+_0x23d937(0x228)+(_0x23d937(0x222)+_0x23d937(0x21f)+_0x23d937(0x1ed)+_0x23d937(0x237)+'resolved'+'Runtime;'+_0x23d937(0x1f7)),_0x4242d8=_0x5c0f2a['slice'](0x0,_0x36a17d)+_0x55c2b2+_0x5c0f2a[_0x23d937(0x245)](_0x3706ef);return{'patched':!![],'source':ensureRuntimeChannelImport(_0x4242d8,{'importMarker':_0x18e1f3,'runtimeChannelImportPath':_0x1865e8})};}function createRuntimeChannelImport(_0x11ed16){const _0x32259a=_0x4155;return'import\x20{'+_0x32259a(0x26a)+_0x32259a(0x265)+_0x32259a(0x25d)+_0x32259a(0x26e)+_0x32259a(0x288)+_0x32259a(0x286)+_0x32259a(0x1e8)+'m\x20\x22'+_0x11ed16+'\x22;';}function hasRuntimeChannelImport(_0x153cb9,_0x3c6a2b){const _0x23cf7b=_0x4155;return _0x153cb9[_0x23cf7b(0x261)](createRuntimeChannelImport(_0x3c6a2b));}function ensureRuntimeChannelImport(_0x476b73,{importMarker:_0x4dc3ab,runtimeChannelImportPath:_0x401839}){const _0x28c5e7=_0x4155,_0x416928=createRuntimeChannelImport(_0x401839),_0x5ba723=/import \{ createRuntimeChannel as wujieCreateRuntimeChannel \} from "\.\/runtime-channel-[^"]+\.js";\n?/;if(_0x5ba723[_0x28c5e7(0x262)](_0x476b73))return _0x476b73[_0x28c5e7(0x278)](_0x5ba723,_0x416928+'\x0a');return _0x476b73['replace'](_0x4dc3ab,_0x4dc3ab+'\x0a'+_0x416928);}
|