@wujie-shell/core 0.1.2 → 0.1.3

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.
@@ -1 +1 @@
1
- const _0x509c47=_0x1d3e;(function(_0x4c8eb3,_0x49a458){const _0x5d3cfa=_0x1d3e,_0x4ee1b8=_0x4c8eb3();while(!![]){try{const _0x487ace=-parseInt(_0x5d3cfa(0x126))/0x1+-parseInt(_0x5d3cfa(0x15c))/0x2*(parseInt(_0x5d3cfa(0x17b))/0x3)+-parseInt(_0x5d3cfa(0x178))/0x4+parseInt(_0x5d3cfa(0x12c))/0x5+parseInt(_0x5d3cfa(0x93))/0x6*(-parseInt(_0x5d3cfa(0x99))/0x7)+-parseInt(_0x5d3cfa(0xaf))/0x8+parseInt(_0x5d3cfa(0x17f))/0x9;if(_0x487ace===_0x49a458)break;else _0x4ee1b8['push'](_0x4ee1b8['shift']());}catch(_0x2f70ac){_0x4ee1b8['push'](_0x4ee1b8['shift']());}}}(_0x46d0,0xc2ed0));import{existsSync}from'node:fs';import{chmod,cp,mkdir,rename,rm,writeFile}from'node:fs/promises';import{delimiter,dirname,join,relative,resolve}from'node:path';import{spawn}from'node:child_process';import{getConfigPaths}from'@wujie-shell/config';import{copyDirFresh,getPackageMetadata,readJson,readPluginManifest,toRuntimeRelative,writeJson}from'./utils.mjs';import{createRuntimeLogger,summarizeRuntimeManifest,summarizeShellConfig}from'./runtime-logger.mjs';const RUNTIME_DIR=_0x509c47(0x90)+_0x509c47(0xd0),MANIFEST_NAME=_0x509c47(0xb0)+'manifest'+'.json',NPM_INSTALL_TIMEOUT_MS=0xf*0x3c*0x3e8;export function resolveRuntimeRoot(_0x2fad90){if(process.env.WUJIE_SHELL_RUNTIME_ROOT)return resolve(process.env.WUJIE_SHELL_RUNTIME_ROOT);return resolve(_0x2fad90,RUNTIME_DIR);}export function resolveManifestPath(_0x4cb479){return join(_0x4cb479,MANIFEST_NAME);}export async function prepareRuntime(_0x5ad828,{syncOnly:syncOnly=![]}={}){const _0x4163f6=_0x509c47,_0x473762=resolveRuntimeRoot(_0x5ad828[_0x4163f6(0xb8)+_0x4163f6(0x14d)]),_0x2e9ec0=_0x5ad828[_0x4163f6(0x164)][_0x4163f6(0x177)+'pRuntime'+'Dir'],_0x285bd1=createRuntimeLogger(getConfigPaths(_0x5ad828),'runtime'),_0x1b24c3=Date['now']();_0x285bd1?.[_0x4163f6(0xe3)](_0x4163f6(0x159)+_0x4163f6(0xf3)+_0x4163f6(0xca),{'syncOnly':syncOnly,'runtimeRoot':_0x473762,'shellConfig':summarizeShellConfig(_0x5ad828)});try{if(!existsSync(join(_0x2e9ec0,MANIFEST_NAME)))throw new Error(_0x4163f6(0x177)+_0x4163f6(0xad)+_0x4163f6(0xb7)+_0x4163f6(0x127)+_0x2e9ec0+(_0x4163f6(0x167)+_0x4163f6(0x179)+_0x4163f6(0x13b)+_0x4163f6(0x138)+_0x4163f6(0x150)+'t.'));_0x285bd1?.['info']('bootstra'+'p\x20runtim'+_0x4163f6(0x15e)+'d',{'bootstrapRuntimeDir':_0x2e9ec0});const _0x58aba1=!syncOnly||!existsSync(resolveManifestPath(_0x473762));_0x58aba1?(_0x285bd1?.['info'](_0x4163f6(0xf3)+_0x4163f6(0x14e)+'ent\x20star'+_0x4163f6(0x17c),{'from':_0x2e9ec0,'to':_0x473762,'reason':syncOnly?'missing\x20'+_0x4163f6(0xb3):_0x4163f6(0x159)+_0x4163f6(0xde)}),await replaceRuntimeFromBootstrap(_0x2e9ec0,_0x473762),_0x285bd1?.[_0x4163f6(0xe3)](_0x4163f6(0xf3)+_0x4163f6(0x14e)+_0x4163f6(0x9f)+_0x4163f6(0xd1),{'runtimeRoot':_0x473762})):_0x285bd1?.[_0x4163f6(0xe3)](_0x4163f6(0xf3)+_0x4163f6(0x14e)+'ent\x20skip'+_0x4163f6(0xef),{'reason':_0x4163f6(0xba)+_0x4163f6(0xbe)+_0x4163f6(0x130)+'s','manifestPath':resolveManifestPath(_0x473762)});const _0x53a166=await readRuntimeManifest(_0x473762);_0x285bd1?.[_0x4163f6(0xe3)](_0x4163f6(0xf3)+_0x4163f6(0xb3)+_0x4163f6(0xee),{'manifestPath':resolveManifestPath(_0x473762),'manifest':summarizeRuntimeManifest(_0x53a166)}),validateRuntimeNodeVersion(_0x53a166,_0x5ad828),_0x285bd1?.[_0x4163f6(0xe3)](_0x4163f6(0xf3)+_0x4163f6(0x117)+_0x4163f6(0x154)+_0x4163f6(0x16a),{'nodeVersion':_0x53a166[_0x4163f6(0xc7)+_0x4163f6(0x98)]});if(syncOnly)validateRuntimeOpenClawVersion(_0x53a166,_0x5ad828),_0x285bd1?.['info'](_0x4163f6(0xf3)+_0x4163f6(0x164)+'\x20version'+_0x4163f6(0x17e)+'ed',{'openclawVersion':_0x53a166[_0x4163f6(0x164)+'Version']});else{if(_0x53a166[_0x4163f6(0x164)+'Version']!==_0x5ad828[_0x4163f6(0x164)]['openclaw'+'Version']){const _0x31ba2b=await loadRuntimeInfo(_0x5ad828['projectR'+'oot']);_0x285bd1?.[_0x4163f6(0xe3)](_0x4163f6(0x164)+_0x4163f6(0x158)+'\x20install'+_0x4163f6(0x12b),{'fromVersion':_0x53a166[_0x4163f6(0x164)+_0x4163f6(0xb1)]||_0x4163f6(0x11f),'toVersion':_0x5ad828['openclaw']['openclaw'+_0x4163f6(0xb1)]}),await installOpenClawPackage(_0x31ba2b,_0x5ad828[_0x4163f6(0x164)][_0x4163f6(0x164)+_0x4163f6(0xb1)]),_0x53a166[_0x4163f6(0x164)+_0x4163f6(0xb1)]=_0x5ad828[_0x4163f6(0x164)][_0x4163f6(0x164)+_0x4163f6(0xb1)],_0x285bd1?.[_0x4163f6(0xe3)](_0x4163f6(0x164)+_0x4163f6(0x158)+_0x4163f6(0x156)+'\x20complet'+'ed',{'openclawVersion':_0x53a166[_0x4163f6(0x164)+_0x4163f6(0xb1)]});}}_0x53a166['generate'+_0x4163f6(0x10b)]=new Date()[_0x4163f6(0x144)+'ing'](),_0x53a166[_0x4163f6(0xc7)+_0x4163f6(0x98)]=_0x5ad828[_0x4163f6(0x164)][_0x4163f6(0xc7)+'ion'],_0x53a166[_0x4163f6(0x96)]={'appId':_0x5ad828[_0x4163f6(0xed)],'productName':_0x5ad828['productN'+_0x4163f6(0xdf)],'dataDirName':_0x5ad828['dataDirN'+'ame']};const _0x4cbdec=Array[_0x4163f6(0x122)](_0x53a166[_0x4163f6(0x15a)])?_0x53a166[_0x4163f6(0x15a)][_0x4163f6(0x115)]:0x0;return await syncManifestPluginScope(_0x5ad828,_0x473762,_0x53a166),_0x285bd1?.[_0x4163f6(0xe3)](_0x4163f6(0xf3)+_0x4163f6(0x10d)+_0x4163f6(0xe4)+_0x4163f6(0xb6),{'beforePluginCount':_0x4cbdec,'afterPluginCount':Array[_0x4163f6(0x122)](_0x53a166[_0x4163f6(0x15a)])?_0x53a166[_0x4163f6(0x15a)][_0x4163f6(0x115)]:0x0,'pluginSpecCount':Array[_0x4163f6(0x122)](_0x53a166[_0x4163f6(0xe1)+_0x4163f6(0xcc)])?_0x53a166[_0x4163f6(0xe1)+_0x4163f6(0xcc)][_0x4163f6(0x115)]:0x0}),await syncProductPlugins(_0x5ad828,_0x473762,_0x53a166),_0x285bd1?.['info'](_0x4163f6(0xc2)+_0x4163f6(0xf4)+'synced',{'localPluginCount':_0x5ad828[_0x4163f6(0x164)][_0x4163f6(0x128)+_0x4163f6(0xf1)+_0x4163f6(0x171)][_0x4163f6(0x115)],'pluginCount':Array[_0x4163f6(0x122)](_0x53a166['plugins'])?_0x53a166['plugins'][_0x4163f6(0x115)]:0x0}),await syncProductAgents(_0x5ad828,_0x473762,_0x53a166),_0x285bd1?.['info']('product\x20'+_0x4163f6(0x13c)+_0x4163f6(0x139),{'source':_0x5ad828[_0x4163f6(0x164)][_0x4163f6(0x111)+'r'],'installPath':_0x53a166['agents']?.['installP'+'ath']}),await syncProductSkills(_0x5ad828,_0x473762,_0x53a166),_0x285bd1?.[_0x4163f6(0xe3)]('product\x20'+'skills\x20s'+_0x4163f6(0x139),{'source':_0x5ad828[_0x4163f6(0x164)][_0x4163f6(0x146)+'r'],'installPath':_0x53a166['skills']?.[_0x4163f6(0x16d)+_0x4163f6(0x157)]}),await syncRuntimeWrapper(_0x5ad828,_0x473762,_0x53a166),_0x285bd1?.['info']('runtime\x20'+_0x4163f6(0x14c)+_0x4163f6(0x166),{'wujieclawBin':_0x53a166[_0x4163f6(0x132)+_0x4163f6(0xe5)]}),await writeJson(resolveManifestPath(_0x473762),_0x53a166),_0x285bd1?.[_0x4163f6(0xe3)]('runtime\x20'+_0x4163f6(0xb3)+_0x4163f6(0xff),{'manifestPath':resolveManifestPath(_0x473762),'manifest':summarizeRuntimeManifest(_0x53a166),'durationMs':Date['now']()-_0x1b24c3}),await _0x285bd1?.[_0x4163f6(0xa8)](),_0x53a166;}catch(_0xdebd9a){_0x285bd1?.[_0x4163f6(0x162)]('prepare\x20'+_0x4163f6(0xf3)+_0x4163f6(0x11c),{'syncOnly':syncOnly,'runtimeRoot':_0x473762,'durationMs':Date['now']()-_0x1b24c3,'error':_0xdebd9a}),await _0x285bd1?.[_0x4163f6(0xa8)]();throw _0xdebd9a;}}async function syncRuntimeWrapper(_0x5ed3cb,_0x49fe73,_0x2c98f7){const _0x522af0=_0x509c47,_0x1580af=join(_0x49fe73,_0x522af0(0xeb),_0x522af0(0x132)+'w'),_0x3fc441=join(_0x49fe73,_0x522af0(0xeb),'wujiecla'+'w.cmd'),_0x1c5697=normalizeRuntimeRelativePath(relative(dirname(_0x1580af),resolve(_0x49fe73,_0x2c98f7[_0x522af0(0x12e)+_0x522af0(0x108)]))),_0x43ee42=normalizeRuntimeRelativePath(relative(dirname(_0x1580af),resolve(_0x49fe73,_0x2c98f7['openclaw'+'Bin']))),_0x6e80cb=_0x522af0(0x14f)+_0x5ed3cb['dataDirN'+'ame'],_0x1e929b='%USERPRO'+'FILE%\x5c'+_0x5ed3cb[_0x522af0(0x160)+_0x522af0(0xdf)];await mkdir(dirname(_0x1580af),{'recursive':!![]}),await writeFile(_0x1580af,[_0x522af0(0x10e)+'h','export\x20O'+_0x522af0(0xbb)+_0x522af0(0xfe)+'OPENCLAW'+'_HOME:-'+_0x6e80cb+'}\x22','export\x20O'+_0x522af0(0xbb)+'STATE_DI'+_0x522af0(0x101)+_0x522af0(0x9e)+_0x522af0(0x163)+'-'+_0x6e80cb+'}\x22',_0x522af0(0x113)+_0x522af0(0xbb)+'CONFIG_P'+_0x522af0(0x12f)+'PENCLAW_'+_0x522af0(0x184)+_0x522af0(0x16e)+_0x6e80cb+('/opencla'+'w.json}\x22'),'SCRIPT_D'+_0x522af0(0x110)+_0x522af0(0x103)+_0x522af0(0x8e)+'rname\x20--'+'\x20\x22$0\x22)\x22\x20'+_0x522af0(0x140),_0x522af0(0x169)+_0x522af0(0xd9)+'R/'+_0x1c5697+(_0x522af0(0xf7)+_0x522af0(0x129))+_0x43ee42+_0x522af0(0x15f),''][_0x522af0(0x136)]('\x0a'),'utf8'),await chmod(_0x1580af,0x1ed),await writeFile(_0x3fc441,[_0x522af0(0xa1)+'f',_0x522af0(0x149)+_0x522af0(0xc5)+_0x522af0(0xc3)+_0x522af0(0x168)+_0x522af0(0x141)+_0x522af0(0xd6)+_0x1e929b+'\x22',_0x522af0(0x149)+_0x522af0(0x9e)+_0x522af0(0x145)+_0x522af0(0xa0)+_0x522af0(0x9a)+_0x522af0(0x13e)+'E_DIR='+_0x1e929b+'\x22',_0x522af0(0x149)+_0x522af0(0xce)+_0x522af0(0xdc)+'H%\x22==\x22\x22\x20'+'set\x20\x22OPE'+'NCLAW_CO'+_0x522af0(0xdc)+'H='+_0x1e929b+('\x5copencla'+_0x522af0(0x14b)),_0x522af0(0xf8)+'IPT_DIR='+_0x522af0(0x161),'\x22%SCRIPT'+_0x522af0(0xf6)+toWindowsPath(_0x1c5697)+(_0x522af0(0x13d)+_0x522af0(0x151))+toWindowsPath(_0x43ee42)+_0x522af0(0x174),''][_0x522af0(0x136)]('\x0d\x0a'),_0x522af0(0x148)),_0x2c98f7[_0x522af0(0x132)+_0x522af0(0xe5)]=toRuntimeRelative(_0x49fe73,process[_0x522af0(0x14a)]===_0x522af0(0xc4)?_0x3fc441:_0x1580af);}function normalizeRuntimeRelativePath(_0x4dedb5){const _0x374019=_0x509c47;return _0x4dedb5[_0x374019(0xcd)+'ll']('\x5c','/');}function toWindowsPath(_0x3ca686){return _0x3ca686['replaceA'+'ll']('/','\x5c');}function validateRuntimeNodeVersion(_0x189de1,_0x5ec5dc){const _0x25e01e=_0x509c47;if(_0x189de1[_0x25e01e(0xc7)+_0x25e01e(0x98)]===_0x5ec5dc[_0x25e01e(0x164)][_0x25e01e(0xc7)+_0x25e01e(0x98)])return;throw new Error(_0x25e01e(0xf3)+_0x25e01e(0xc7)+_0x25e01e(0xa4)+'atch:\x20ma'+_0x25e01e(0x104)+(_0x189de1[_0x25e01e(0xc7)+_0x25e01e(0x98)]||_0x25e01e(0x11f))+(',\x20shell.'+'config=')+_0x5ec5dc['openclaw'][_0x25e01e(0xc7)+_0x25e01e(0x98)]+'.\x20'+(_0x25e01e(0x134)+'the\x20boot'+'strap\x20ru'+_0x25e01e(0x16b)+'th\x20the\x20c'+'onfigure'+_0x25e01e(0x124)+'ersion\x20b'+_0x25e01e(0xa2)+_0x25e01e(0x12d)+_0x25e01e(0x142)+_0x25e01e(0xdb)));}function validateRuntimeOpenClawVersion(_0x58de58,_0x253768){const _0x4ded6c=_0x509c47;if(_0x58de58[_0x4ded6c(0x164)+_0x4ded6c(0xb1)]===_0x253768[_0x4ded6c(0x164)][_0x4ded6c(0x164)+_0x4ded6c(0xb1)])return;throw new Error(_0x4ded6c(0xf3)+_0x4ded6c(0x164)+_0x4ded6c(0x16f)+_0x4ded6c(0x106)+':\x20manife'+'st='+(_0x58de58[_0x4ded6c(0x164)+_0x4ded6c(0xb1)]||'unknown')+(_0x4ded6c(0x112)+_0x4ded6c(0x180))+_0x253768[_0x4ded6c(0x164)][_0x4ded6c(0x164)+_0x4ded6c(0xb1)]+'.\x20'+(_0x4ded6c(0x10c)+_0x4ded6c(0x143)+'\x20prepare'+'\x22\x20so\x20the'+_0x4ded6c(0xaa)+_0x4ded6c(0x121)+'tall\x20the'+'\x20configu'+_0x4ded6c(0xea)+_0x4ded6c(0x118)+_0x4ded6c(0x11b)));}function parseNpmPackJson(_0x17062b){const _0x298370=_0x509c47,_0x3a7ba2=_0x17062b[_0x298370(0x102)](),_0x518f31=_0x3a7ba2[_0x298370(0x107)]('[');if(_0x518f31<0x0)throw new Error('npm\x20pack'+_0x298370(0x183)+_0x298370(0xc8)+_0x298370(0xbd)+_0x3a7ba2[_0x298370(0x10a)](0x0,0x1f4));const _0x1d063b=JSON['parse'](_0x3a7ba2[_0x298370(0x10a)](_0x518f31)),_0x3ed286=Array[_0x298370(0x122)](_0x1d063b)?_0x1d063b[0x0]:_0x1d063b;if(!_0x3ed286||typeof _0x3ed286!==_0x298370(0x131))throw new Error(_0x298370(0x172)+_0x298370(0xec)+'d\x20an\x20inv'+'alid\x20pay'+_0x298370(0xbc)+_0x3a7ba2[_0x298370(0x10a)](0x0,0x1f4));return _0x3ed286;}async function runProcess(_0x1e6097,_0x16a87f,_0x544cd4={}){const _0x26df4b=_0x509c47,_0x4382b4=_0x544cd4[_0x26df4b(0x100)]||[_0x1e6097,..._0x16a87f]['join']('\x20'),_0x116ab6=_0x544cd4['timeoutM'+'s']??NPM_INSTALL_TIMEOUT_MS,_0x673e8=spawn(_0x1e6097,_0x16a87f,{'cwd':_0x544cd4[_0x26df4b(0xa3)],'env':_0x544cd4['env'],'stdio':['ignore',_0x26df4b(0xcf),'pipe']});return await new Promise((_0x1f97db,_0x366489)=>{const _0x5ccb21=_0x26df4b;let _0x473e7e='',_0x25fa51='',_0x305926=![];const _0x1f04c3=setTimeout(()=>{const _0x3e8998=_0x1d3e;if(_0x305926)return;_0x305926=!![],_0x673e8['kill']('SIGTERM'),_0x366489(new Error(_0x4382b4+('\x20timed\x20o'+_0x3e8998(0xd5)+'\x20')+_0x116ab6+'ms'));},_0x116ab6);_0x673e8['stdout']['on'](_0x5ccb21(0x165),_0x3cbf76=>{const _0x40dac7=_0x5ccb21;_0x473e7e+=_0x3cbf76[_0x40dac7(0x116)]();}),_0x673e8[_0x5ccb21(0x97)]['on']('data',_0x2d1ce6=>{_0x25fa51+=_0x2d1ce6['toString']();}),_0x673e8['on'](_0x5ccb21(0x162),_0x4449e4=>{if(_0x305926)return;_0x305926=!![],clearTimeout(_0x1f04c3),_0x366489(_0x4449e4);}),_0x673e8['on']('close',(_0x4613f6,_0x4a2e5b)=>{const _0x554a60=_0x5ccb21;if(_0x305926)return;_0x305926=!![],clearTimeout(_0x1f04c3);if(_0x4613f6===0x0){_0x1f97db({'stdout':_0x473e7e,'stderr':_0x25fa51});return;}_0x366489(new Error(_0x4382b4+(_0x554a60(0x11d)+_0x554a60(0xc0)+'e=')+(_0x4613f6??'null')+_0x554a60(0x11a)+(_0x4a2e5b??'null')+'\x0a'+(''+(_0x25fa51||_0x473e7e))[_0x554a60(0x102)]()));});});}async function installOpenClawPackage(_0x46ab9d,_0xc45c96){const _0x41ef2b=_0x509c47,_0x1d8a67=join(_0x46ab9d[_0x41ef2b(0xac)+_0x41ef2b(0x14d)],_0x41ef2b(0xe0)),_0x3aa0c9=join(_0x46ab9d[_0x41ef2b(0xac)+_0x41ef2b(0x14d)],_0x41ef2b(0x105)+'w-extrac'+'t');await mkdir(_0x1d8a67,{'recursive':!![]}),await rm(_0x3aa0c9,{'recursive':!![],'force':!![]}),await mkdir(_0x3aa0c9,{'recursive':!![]});const _0x178e2d=await createRuntimeEnv(_0x46ab9d),_0x38365c=_0x41ef2b(0x164)+'@'+_0xc45c96;console[_0x41ef2b(0x176)](_0x41ef2b(0x152)+_0x41ef2b(0xbf)+_0x41ef2b(0x91)+_0x41ef2b(0x114)+'\x20'+_0x38365c);const _0x6a7711=await runProcess(_0x46ab9d['nodeExec'+_0x41ef2b(0x108)],[_0x46ab9d[_0x41ef2b(0x119)],'pack',_0x38365c,_0x41ef2b(0xfb)],{'cwd':_0x1d8a67,'env':_0x178e2d,'label':_0x41ef2b(0x172)+'\x20'+_0x38365c}),_0x235fa5=parseNpmPackJson(_0x6a7711['stdout']);if(_0x235fa5[_0x41ef2b(0x120)]!==_0xc45c96)throw new Error('Configur'+'ed\x20OpenC'+_0x41ef2b(0x182)+_0xc45c96+(_0x41ef2b(0xf5)+_0x41ef2b(0xc1))+_0x235fa5[_0x41ef2b(0x120)]);const _0x57da59=resolve(_0x1d8a67,_0x235fa5['filename']);if(!existsSync(_0x57da59))throw new Error(_0x41ef2b(0x172)+_0x41ef2b(0x183)+_0x41ef2b(0x17a)+_0x41ef2b(0xd4)+'\x20'+_0x57da59);await runProcess('tar',['-xzf',_0x57da59,'-C',_0x3aa0c9],{'label':_0x41ef2b(0xd2)+_0x235fa5['filename']}),await rm(_0x46ab9d[_0x41ef2b(0x164)+'WorkingD'+'ir'],{'recursive':!![],'force':!![]}),await rename(join(_0x3aa0c9,_0x41ef2b(0xd3)),_0x46ab9d['openclaw'+'WorkingD'+'ir']),await rm(_0x3aa0c9,{'recursive':!![],'force':!![]}),await runProcess(_0x46ab9d[_0x41ef2b(0x12e)+'utable'],[_0x46ab9d['npmCli'],_0x41ef2b(0x155),_0x41ef2b(0xe2)+'ev',_0x41ef2b(0x147)+'eer',_0x41ef2b(0xe7)+'it',_0x41ef2b(0x15d)+'d',_0x41ef2b(0x12a)+_0x41ef2b(0xfc)+'ps'],{'cwd':_0x46ab9d['openclaw'+'WorkingD'+'ir'],'env':_0x178e2d,'label':'npm\x20inst'+'all\x20'+_0x38365c+(_0x41ef2b(0xaa)+_0x41ef2b(0xcb)+_0x41ef2b(0x9b))});if(!existsSync(_0x46ab9d['openclaw'+_0x41ef2b(0xa5)]))throw new Error(_0x41ef2b(0xc6)+_0x41ef2b(0x16c)+_0x41ef2b(0x170)+_0x41ef2b(0x133)+_0x41ef2b(0x156)+':\x20'+_0x46ab9d[_0x41ef2b(0x164)+_0x41ef2b(0xa5)]);}function _0x46d0(){const _0x4f08dd=['t\x20\x22OPENC','ncies','.old-','replace','NCLAW_ST','ent\x20comp','\x22==\x22\x22\x20se','@echo\x20of','efore\x20pr','cwd','ion\x20mism','Bin','\x20is\x20miss','ing\x20\x22','flush','agents','\x20runtime',';\x20run\x20wu','runtimeR','p\x20runtim','string','8064848jSIZMY','runtime-','Version','missing\x20','manifest','path:\x20','npm-cach','ced','e\x20not\x20fo','projectR','jie-shel','sync-onl','PENCLAW_','load:\x20','JSON:\x20','y\x20manife','hell:run','with\x20cod','d\x20to\x20','product\x20','ME%\x22==\x22\x22','win32','NCLAW_HO','OpenClaw','nodeVers','\x20return\x20','npm-glob','started','\x20depende','ecs','replaceA','NCLAW_CO','pipe','time','leted','extract\x20','package','tarball:','ut\x20after','OME=','WorkingD','env','CRIPT_DI','rg/','ell.','NFIG_PAT','source','command','ame','.cache','pluginSp','--omit=d','info','cope\x20syn','wBin','startsWi','--no-aud','has','close','red\x20Open','bin','\x20returne','appId','\x20loaded','ped','split','LocalPlu','filter','runtime\x20','plugins\x20','\x20resolve','_DIR%','\x22\x20\x22$SCRI','set\x20\x22SCR','pid','Spec','--json','-peer-de','npm','HOME=\x22${','\x20written','label','R=\x22${OPE','trim','ATH=\x20cd\x20','nifest=','.opencla','mismatch','indexOf','utable','registry','slice','dAt','Run\x20\x22wuj','plugin\x20s','#!/bin/s','SIGTERM','IR=$(CDP','agentsDi',',\x20shell.','export\x20O','stalling','length','toString','node\x20ver','Claw\x20ver','npmCli','\x20signal=','sion.','failed','\x20failed\x20','.npmjs.o','unknown','version','\x20can\x20ins','isArray','dist','d\x20Node\x20v','now','1072575CQJBaT','und:\x20','resolved','PT_DIR/','--legacy','\x20started','4709100pUdfSt','eparing\x20','nodeExec','ATH=\x22${O','st\x20exist','object','wujiecla','nd\x20after','Rebuild\x20','ing','join','Name','-ai\x20runt','ynced','local','re\x20wujie','agents\x20s','\x22\x20\x22%SCRI','LAW_STAT','skills','&&\x20pwd)','ENCLAW_H','wujie-sh','ie-shell','toISOStr','ATE_DIR%','skillsDi','--omit=p','utf8','if\x20\x22%OPE','platform','w.json\x22','wrapper\x20','oot','replacem','$HOME/','ime\x20firs','PT_DIR%','[wujie-s','agentSco','sion\x20val','install','\x20install','ath','\x20package','prepare\x20','plugins','local:','18FNLBRg','--no-fun','e\x20checke','\x22\x20\x22$@\x22','dataDirN','%~dp0\x22','error','ATE_DIR:','openclaw','data','synced','.\x20For\x20MV','\x20set\x20\x22OP','exec\x20\x22$S','idated','ntime\x20wi','\x20bin\x20was','installP','ATH:-','Version\x20','\x20not\x20fou','ginPaths','npm\x20pack','\x20timed\x20o','\x22\x20%*','push','log','bootstra','1690020tRBJjS','P,\x20prepa','\x20create\x20','413787svFyDZ','ted','extensio','\x20validat','39176982LQClPW','config=','time-too','law\x20','\x20did\x20not','CONFIG_P','--\x20\x22$(di','map','.tmp/run','time]\x20in','https://','902226ZPrAYS','pluginId','\x22\x20at\x20','product','stderr','ion','35DuVKJt'];_0x46d0=function(){return _0x4f08dd;};return _0x46d0();}async function replaceRuntimeFromBootstrap(_0x1c1123,_0x403fd0){const _0x1a6ee7=_0x509c47;await mkdir(dirname(_0x403fd0),{'recursive':!![]});const _0x2a4a9e=_0x403fd0+'.next-'+process[_0x1a6ee7(0xf9)]+'-'+Date[_0x1a6ee7(0x125)](),_0x3cc0d7=_0x403fd0+_0x1a6ee7(0x9c)+process[_0x1a6ee7(0xf9)]+'-'+Date[_0x1a6ee7(0x125)]();await rm(_0x2a4a9e,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await rm(_0x3cc0d7,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await cp(_0x1c1123,_0x2a4a9e,{'recursive':!![],'force':!![]}),existsSync(_0x403fd0)&&(await rm(_0x3cc0d7,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await rename(_0x403fd0,_0x3cc0d7)),await rename(_0x2a4a9e,_0x403fd0),await rm(_0x3cc0d7,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96});}export async function readRuntimeManifest(_0x4f7597){return await readJson(resolveManifestPath(_0x4f7597),{});}export async function loadRuntimeInfo(_0x22c239){const _0xbd8620=_0x509c47,_0x4f68de=resolveRuntimeRoot(_0x22c239),_0x2af98e=await readRuntimeManifest(_0x4f68de);for(const _0x485700 of['nodeExec'+_0xbd8620(0x108),'npmCli',_0xbd8620(0x164)+_0xbd8620(0xd7)+'ir',_0xbd8620(0x164)+'Bin']){if(typeof _0x2af98e[_0x485700]!==_0xbd8620(0xae)||!_0x2af98e[_0x485700][_0xbd8620(0x102)]())throw new Error(_0xbd8620(0xf3)+'manifest'+_0xbd8620(0xa6)+_0xbd8620(0xa7)+_0x485700+_0xbd8620(0x95)+resolveManifestPath(_0x4f68de)+(_0xbd8620(0xab)+_0xbd8620(0xb9)+'l\x20prepar'+'e'));}const _0x58d934=resolve(_0x4f68de,_0x2af98e[_0xbd8620(0x12e)+'utable']),_0x3e6042=resolve(_0x4f68de,_0x2af98e[_0xbd8620(0x119)]),_0x5a0cbe=resolve(_0x4f68de,_0x2af98e[_0xbd8620(0x164)+'WorkingD'+'ir']),_0xb65b89=resolve(_0x4f68de,_0x2af98e[_0xbd8620(0x164)+'Bin']),_0x7f605c=Array[_0xbd8620(0x122)](_0x2af98e[_0xbd8620(0x15a)])?_0x2af98e[_0xbd8620(0x15a)]['map'](_0x48df3f=>({..._0x48df3f,'installPath':resolve(_0x4f68de,_0x48df3f[_0xbd8620(0x16d)+_0xbd8620(0x157)])})):[];for(const _0x28bfc3 of[_0x58d934,_0x3e6042,_0x5a0cbe,_0xb65b89]){if(!existsSync(_0x28bfc3))throw new Error('runtime\x20'+_0xbd8620(0xb2)+_0xbd8620(0xb4)+_0x28bfc3);}return{'runtimeRoot':_0x4f68de,'manifest':_0x2af98e,'openclawVersion':_0x2af98e[_0xbd8620(0x164)+_0xbd8620(0xb1)]||'unknown','nodeExecutable':_0x58d934,'npmCli':_0x3e6042,'openclawWorkingDir':_0x5a0cbe,'openclawBin':_0xb65b89,'plugins':_0x7f605c};}export async function spawnClaw(_0x47d56a,_0x260a1c=[],_0x4dbc03={}){const _0x381c61=_0x509c47,_0x5a4028=await loadRuntimeInfo(_0x47d56a),_0x5e6fad=await createRuntimeEnv(_0x5a4028,_0x4dbc03[_0x381c61(0xd8)]??{});return spawn(_0x5a4028[_0x381c61(0x12e)+_0x381c61(0x108)],[_0x5a4028[_0x381c61(0x164)+_0x381c61(0xa5)],..._0x260a1c],{'cwd':_0x5a4028[_0x381c61(0x164)+'WorkingD'+'ir'],'stdio':'pipe',..._0x4dbc03,'env':_0x5e6fad});}export async function runClawOnce(_0xad2fec,_0x3b4555=[],_0x471ab5=0x15f90){const _0x17aba7=await spawnClaw(_0xad2fec,_0x3b4555);return await new Promise((_0x2ecfc0,_0x5f3a6d)=>{const _0x47c9ae=_0x1d3e;let _0x203d22='',_0x52ffb5='',_0x1f6a4f=![];const _0x182589=setTimeout(()=>{const _0x4ef6eb=_0x1d3e;if(_0x1f6a4f)return;_0x1f6a4f=!![],_0x17aba7['kill'](_0x4ef6eb(0x10f)),_0x5f3a6d(new Error('openclaw'+_0x4ef6eb(0x173)+_0x4ef6eb(0xd5)+'\x20'+_0x471ab5+'ms'));},_0x471ab5);_0x17aba7['stdout']['on'](_0x47c9ae(0x165),_0x34a096=>{const _0x4554bd=_0x47c9ae;_0x203d22+=_0x34a096[_0x4554bd(0x116)]();}),_0x17aba7[_0x47c9ae(0x97)]['on'](_0x47c9ae(0x165),_0x301761=>{_0x52ffb5+=_0x301761['toString']();}),_0x17aba7['on'](_0x47c9ae(0x162),_0x2dec8f=>{if(_0x1f6a4f)return;_0x1f6a4f=!![],clearTimeout(_0x182589),_0x5f3a6d(_0x2dec8f);}),_0x17aba7['on'](_0x47c9ae(0xe9),(_0x2518bf,_0x20395d)=>{if(_0x1f6a4f)return;_0x1f6a4f=!![],clearTimeout(_0x182589),_0x2ecfc0({'code':_0x2518bf,'signal':_0x20395d,'stdout':_0x203d22,'stderr':_0x52ffb5});});});}function _0x1d3e(_0x4b3ab0,_0x1184ea){_0x4b3ab0=_0x4b3ab0-0x8e;const _0x46d02a=_0x46d0();let _0x1d3ee5=_0x46d02a[_0x4b3ab0];return _0x1d3ee5;}async function createRuntimeEnv(_0x33fd32,_0x17f6cb={}){const _0x4c6158=_0x509c47,_0x35c2db=process.env.OPENCLAW_STATE_DIR||'',_0x4f7818=_0x35c2db?join(_0x35c2db,'claw-run'+_0x4c6158(0x181)+'ls'):join(_0x33fd32[_0x4c6158(0xac)+_0x4c6158(0x14d)],'.tools'),_0x5ce801=join(_0x4f7818,_0x4c6158(0xc9)+'al'),_0x2ca727=join(_0x4f7818,_0x4c6158(0xb5)+'e'),_0x4631cc=join(_0x5ce801,'bin');await mkdir(_0x4631cc,{'recursive':!![]}),await mkdir(_0x2ca727,{'recursive':!![]});const _0x5d495a=[_0x4631cc,dirname(_0x33fd32[_0x4c6158(0x12e)+_0x4c6158(0x108)]),process.env.PATH||''];return{...process.env,..._0x17f6cb,'PATH':_0x5d495a[_0x4c6158(0xf2)](Boolean)[_0x4c6158(0x136)](delimiter),'npm_config_prefix':_0x5ce801,'NPM_CONFIG_PREFIX':_0x5ce801,'npm_config_cache':_0x2ca727,'NPM_CONFIG_CACHE':_0x2ca727,'npm_config_registry':_0x4c6158(0x92)+'registry'+_0x4c6158(0x11e)+_0x4c6158(0xda),'NPM_CONFIG_REGISTRY':_0x4c6158(0x92)+_0x4c6158(0x109)+'.npmjs.o'+_0x4c6158(0xda),'npm_execpath':_0x33fd32[_0x4c6158(0x119)],'npm_node_execpath':_0x33fd32[_0x4c6158(0x12e)+_0x4c6158(0x108)],'OPENCLAW_RUNTIME_NPM_PREFIX':_0x5ce801,'OPENCLAW_RUNTIME_NPM_BIN':_0x4631cc,'OPENCLAW_RUNTIME_NPM_REGISTRY':_0x4c6158(0x92)+_0x4c6158(0x109)+_0x4c6158(0x11e)+_0x4c6158(0xda)};}async function syncProductPlugins(_0x3201ef,_0x3d1819,_0x2db475){const _0x2e4b90=_0x509c47,_0x30482d=join(_0x3d1819,'openclaw',_0x2e4b90(0x123),_0x2e4b90(0x17d)+'ns'),_0x71de69=[];for(const _0x1a3e33 of _0x3201ef[_0x2e4b90(0x164)]['resolved'+'LocalPlu'+_0x2e4b90(0x171)]){const _0x4f3a6d=await getPackageMetadata(_0x1a3e33),_0x71cd75=await readPluginManifest(_0x1a3e33),_0x190955=join(_0x30482d,_0x4f3a6d[_0x2e4b90(0x94)]);await copyDirFresh(_0x1a3e33,_0x190955),_0x71de69[_0x2e4b90(0x175)]({'pluginId':_0x4f3a6d['pluginId'],'source':'local','spec':_0x2e4b90(0x15b)+_0x1a3e33,'installPath':toRuntimeRelative(_0x3d1819,_0x190955),'version':_0x4f3a6d[_0x2e4b90(0x120)],'resolvedName':_0x4f3a6d['name'],'resolvedVersion':_0x4f3a6d[_0x2e4b90(0x120)],'resolvedSpec':'local:'+_0x1a3e33,'integrity':'','shasum':'','resolvedAt':new Date()[_0x2e4b90(0x144)+'ing'](),'installedAt':new Date()[_0x2e4b90(0x144)+_0x2e4b90(0x135)](),'agentScope':_0x71cd75[_0x2e4b90(0x153)+'pe'],'skills':_0x71cd75[_0x2e4b90(0x13f)]});}const _0x499092=new Set(_0x71de69[_0x2e4b90(0x8f)](_0x1c2f3d=>_0x1c2f3d['pluginId'])),_0x4639ac=Array[_0x2e4b90(0x122)](_0x2db475[_0x2e4b90(0x15a)])?_0x2db475[_0x2e4b90(0x15a)][_0x2e4b90(0xf2)](_0x15c7d5=>!_0x499092[_0x2e4b90(0xe8)](_0x15c7d5[_0x2e4b90(0x94)])):[];_0x2db475[_0x2e4b90(0x15a)]=[..._0x4639ac,..._0x71de69];}async function syncManifestPluginScope(_0x15fca9,_0x267487,_0x13a04d){const _0x4bcab9=_0x509c47,_0x707f0f=join(_0x267487,_0x4bcab9(0x164),'dist',_0x4bcab9(0x17d)+'ns'),_0x545bff=new Set(_0x15fca9[_0x4bcab9(0x164)]['pluginSp'+'ecs']??[]),_0x1fc694=new Set([..._0x545bff][_0x4bcab9(0x8f)](_0x383616=>_0x383616[_0x4bcab9(0x9d)](/^npm:/,''))[_0x4bcab9(0x8f)](_0x37c4c9=>{const _0xd76a4b=_0x4bcab9;if(_0x37c4c9[_0xd76a4b(0xe6)+'th']('@')){const _0x5a252a=_0x37c4c9['split']('@');return _0x5a252a['length']>=0x3?'@'+_0x5a252a[0x1]:_0x37c4c9;}return _0x37c4c9[_0xd76a4b(0xf0)]('@')[0x0];})[_0x4bcab9(0xf2)](Boolean)),_0x2adc78=new Set();for(const _0x573986 of _0x15fca9[_0x4bcab9(0x164)][_0x4bcab9(0x128)+_0x4bcab9(0xf1)+'ginPaths']){const _0xa5b51a=await getPackageMetadata(_0x573986);if(_0xa5b51a[_0x4bcab9(0x94)])_0x2adc78['add'](_0xa5b51a[_0x4bcab9(0x94)]);}const _0x279b47=Array[_0x4bcab9(0x122)](_0x13a04d[_0x4bcab9(0x15a)])?_0x13a04d['plugins']:[];_0x13a04d['pluginSp'+_0x4bcab9(0xcc)]=[..._0x15fca9[_0x4bcab9(0x164)]['pluginSp'+_0x4bcab9(0xcc)],..._0x15fca9[_0x4bcab9(0x164)]['resolved'+_0x4bcab9(0xf1)+_0x4bcab9(0x171)][_0x4bcab9(0x8f)](_0x557ca3=>_0x4bcab9(0x15b)+_0x557ca3)],_0x13a04d['plugins']=_0x279b47[_0x4bcab9(0xf2)](_0x3d77b8=>{const _0x5b60c=_0x4bcab9;if(!_0x3d77b8||typeof _0x3d77b8!==_0x5b60c(0x131))return![];if(_0x3d77b8[_0x5b60c(0xdd)]===_0x5b60c(0x13a))return _0x2adc78['has'](_0x3d77b8[_0x5b60c(0x94)]);if(_0x3d77b8[_0x5b60c(0xdd)]===_0x5b60c(0xfd))return _0x545bff['has'](_0x3d77b8['spec'])||_0x545bff[_0x5b60c(0xe8)](_0x3d77b8[_0x5b60c(0x128)+_0x5b60c(0xfa)])||_0x1fc694[_0x5b60c(0xe8)](_0x3d77b8[_0x5b60c(0x128)+_0x5b60c(0x137)]);return![];});const _0x1dc638=new Set(_0x13a04d[_0x4bcab9(0x15a)]['map'](_0x5250c7=>_0x5250c7[_0x4bcab9(0x94)]));for(const _0x19061f of _0x279b47){if(!_0x19061f[_0x4bcab9(0x94)]||_0x1dc638[_0x4bcab9(0xe8)](_0x19061f['pluginId']))continue;const _0x4fc105=typeof _0x19061f[_0x4bcab9(0x16d)+_0x4bcab9(0x157)]===_0x4bcab9(0xae)&&_0x19061f[_0x4bcab9(0x16d)+_0x4bcab9(0x157)][_0x4bcab9(0x102)]()?resolve(_0x267487,_0x19061f[_0x4bcab9(0x16d)+_0x4bcab9(0x157)]):join(_0x707f0f,_0x19061f[_0x4bcab9(0x94)]),_0x27da3d=relative(_0x707f0f,_0x4fc105);if(_0x27da3d[_0x4bcab9(0xe6)+'th']('..')||_0x27da3d==='')continue;await rm(_0x4fc105,{'recursive':!![],'force':!![]});}}async function syncProductAgents(_0x1cbf4f,_0x1fba5e,_0x1029ab){const _0x243ec5=_0x509c47,_0x367a76=join(_0x1fba5e,_0x243ec5(0x164),_0x243ec5(0xa9));await copyDirFresh(_0x1cbf4f[_0x243ec5(0x164)][_0x243ec5(0x111)+'r'],_0x367a76),_0x1029ab[_0x243ec5(0xa9)]={'source':'product','installPath':toRuntimeRelative(_0x1fba5e,_0x367a76)};}async function syncProductSkills(_0x4d9b4c,_0xbd71ee,_0x3db897){const _0xc2a855=_0x509c47,_0x4147e3=join(_0xbd71ee,_0xc2a855(0x164),'skills');await copyDirFresh(_0x4d9b4c[_0xc2a855(0x164)][_0xc2a855(0x146)+'r'],_0x4147e3),_0x3db897['skills']={'source':_0xc2a855(0x96),'installPath':toRuntimeRelative(_0xbd71ee,_0x4147e3)};}
1
+ const _0x51e383=_0x2d02;(function(_0xbbca86,_0x55ae2c){const _0x396310=_0x2d02,_0x4614ba=_0xbbca86();while(!![]){try{const _0x4f8eb3=parseInt(_0x396310(0x165))/0x1+-parseInt(_0x396310(0x183))/0x2*(parseInt(_0x396310(0xaf))/0x3)+parseInt(_0x396310(0x15c))/0x4+-parseInt(_0x396310(0x12d))/0x5+parseInt(_0x396310(0xa1))/0x6*(-parseInt(_0x396310(0x109))/0x7)+parseInt(_0x396310(0x144))/0x8*(parseInt(_0x396310(0x14c))/0x9)+-parseInt(_0x396310(0x13a))/0xa;if(_0x4f8eb3===_0x55ae2c)break;else _0x4614ba['push'](_0x4614ba['shift']());}catch(_0x225010){_0x4614ba['push'](_0x4614ba['shift']());}}}(_0x503b,0x58166));import{existsSync}from'node:fs';import{chmod,cp,mkdir,rename,rm,writeFile}from'node:fs/promises';import{delimiter,dirname,join,relative,resolve}from'node:path';import{spawn}from'node:child_process';import{getConfigPaths}from'@wujie-shell/config';import{copyDirFresh,getPackageMetadata,readJson,readPluginManifest,toRuntimeRelative,writeJson}from'./utils.mjs';import{createRuntimeLogger,summarizeRuntimeManifest,summarizeShellConfig}from'./runtime-logger.mjs';const RUNTIME_DIR=_0x51e383(0x127)+'time',MANIFEST_NAME='runtime-'+_0x51e383(0x173)+'.json',NPM_INSTALL_TIMEOUT_MS=0xf*0x3c*0x3e8;export function resolveRuntimeRoot(_0x351422){if(process.env.WUJIE_SHELL_RUNTIME_ROOT)return resolve(process.env.WUJIE_SHELL_RUNTIME_ROOT);return resolve(_0x351422,RUNTIME_DIR);}export function resolveManifestPath(_0x3a99d8){return join(_0x3a99d8,MANIFEST_NAME);}export async function prepareRuntime(_0x3b5842,{syncOnly:syncOnly=![]}={}){const _0x274394=_0x51e383,_0x4db234=resolveRuntimeRoot(_0x3b5842[_0x274394(0x177)+_0x274394(0xfc)]),_0x5626a9=_0x3b5842[_0x274394(0x17c)][_0x274394(0x124)+'pRuntime'+'Dir'],_0x3329a9=createRuntimeLogger(getConfigPaths(_0x3b5842),_0x274394(0x17d)),_0x34bc78=Date['now']();_0x3329a9?.[_0x274394(0xc9)](_0x274394(0xff)+_0x274394(0x142)+_0x274394(0x129),{'syncOnly':syncOnly,'runtimeRoot':_0x4db234,'shellConfig':summarizeShellConfig(_0x3b5842)});try{if(!existsSync(join(_0x5626a9,MANIFEST_NAME)))throw new Error(_0x274394(0x124)+_0x274394(0x123)+_0x274394(0x134)+_0x274394(0xdf)+_0x5626a9+('.\x20For\x20MV'+_0x274394(0xc3)+_0x274394(0x14a)+_0x274394(0x9e)+'ime\x20firs'+'t.'));_0x3329a9?.[_0x274394(0xc9)]('bootstra'+_0x274394(0x123)+_0x274394(0x152)+'d',{'bootstrapRuntimeDir':_0x5626a9});const _0x205166=!syncOnly||!existsSync(resolveManifestPath(_0x4db234));_0x205166?(_0x3329a9?.['info'](_0x274394(0x142)+'replacem'+_0x274394(0x146)+_0x274394(0x9f),{'from':_0x5626a9,'to':_0x4db234,'reason':syncOnly?_0x274394(0x19c)+_0x274394(0x173):_0x274394(0xff)+'command'}),await replaceRuntimeFromBootstrap(_0x5626a9,_0x4db234),_0x3329a9?.[_0x274394(0xc9)](_0x274394(0x142)+_0x274394(0x106)+_0x274394(0xe4)+_0x274394(0x187),{'runtimeRoot':_0x4db234})):_0x3329a9?.[_0x274394(0xc9)](_0x274394(0x142)+_0x274394(0x106)+_0x274394(0x12c)+_0x274394(0x13e),{'reason':_0x274394(0xa2)+_0x274394(0x17f)+_0x274394(0x185)+'s','manifestPath':resolveManifestPath(_0x4db234)});const _0x2de632=await readRuntimeManifest(_0x4db234);_0x3329a9?.[_0x274394(0xc9)](_0x274394(0x142)+_0x274394(0x173)+'\x20loaded',{'manifestPath':resolveManifestPath(_0x4db234),'manifest':summarizeRuntimeManifest(_0x2de632)}),validateRuntimeNodeVersion(_0x2de632,_0x3b5842),_0x3329a9?.[_0x274394(0xc9)](_0x274394(0x142)+'node\x20ver'+_0x274394(0x162)+'idated',{'nodeVersion':_0x2de632[_0x274394(0x143)+_0x274394(0xf7)]});if(syncOnly)validateRuntimeOpenClawVersion(_0x2de632,_0x3b5842),_0x3329a9?.[_0x274394(0xc9)](_0x274394(0x142)+_0x274394(0x17c)+_0x274394(0xfa)+_0x274394(0x155)+'ed',{'openclawVersion':_0x2de632[_0x274394(0x17c)+_0x274394(0x101)]});else{if(_0x2de632[_0x274394(0x17c)+'Version']!==_0x3b5842[_0x274394(0x17c)][_0x274394(0x17c)+'Version']){const _0x83a918=await loadRuntimeInfo(_0x3b5842[_0x274394(0x177)+_0x274394(0xfc)]);_0x3329a9?.[_0x274394(0xc9)](_0x274394(0x17c)+_0x274394(0x14e)+_0x274394(0x121)+'\x20started',{'fromVersion':_0x2de632[_0x274394(0x17c)+_0x274394(0x101)]||_0x274394(0xbd),'toVersion':_0x3b5842['openclaw'][_0x274394(0x17c)+_0x274394(0x101)]}),await installOpenClawPackage(_0x83a918,_0x3b5842['openclaw']['openclaw'+_0x274394(0x101)]),_0x2de632['openclaw'+_0x274394(0x101)]=_0x3b5842[_0x274394(0x17c)][_0x274394(0x17c)+_0x274394(0x101)],_0x3329a9?.['info'](_0x274394(0x17c)+_0x274394(0x14e)+'\x20install'+'\x20complet'+'ed',{'openclawVersion':_0x2de632[_0x274394(0x17c)+_0x274394(0x101)]});}}_0x2de632['generate'+_0x274394(0x139)]=new Date()[_0x274394(0x167)+_0x274394(0x19b)](),_0x2de632[_0x274394(0x143)+'ion']=_0x3b5842[_0x274394(0x17c)][_0x274394(0x143)+_0x274394(0xf7)],_0x2de632['product']={'appId':_0x3b5842[_0x274394(0xdb)],'productName':_0x3b5842[_0x274394(0x13c)+_0x274394(0x189)],'dataDirName':_0x3b5842['dataDirN'+_0x274394(0x189)]};const _0x287aa2=Array[_0x274394(0x108)](_0x2de632[_0x274394(0x15d)])?_0x2de632[_0x274394(0x15d)]['length']:0x0;return await syncManifestPluginScope(_0x3b5842,_0x4db234,_0x2de632),_0x3329a9?.['info'](_0x274394(0x142)+_0x274394(0x114)+'cope\x20syn'+_0x274394(0x14b),{'beforePluginCount':_0x287aa2,'afterPluginCount':Array['isArray'](_0x2de632['plugins'])?_0x2de632['plugins']['length']:0x0,'pluginSpecCount':Array[_0x274394(0x108)](_0x2de632['pluginSp'+_0x274394(0x9d)])?_0x2de632['pluginSp'+_0x274394(0x9d)]['length']:0x0}),await syncProductPlugins(_0x3b5842,_0x4db234,_0x2de632),_0x3329a9?.[_0x274394(0xc9)](_0x274394(0x16e)+'plugins\x20'+_0x274394(0xdc),{'localPluginCount':_0x3b5842[_0x274394(0x17c)][_0x274394(0xe2)+'LocalPlu'+_0x274394(0x19e)][_0x274394(0x11e)],'pluginCount':Array[_0x274394(0x108)](_0x2de632[_0x274394(0x15d)])?_0x2de632[_0x274394(0x15d)][_0x274394(0x11e)]:0x0}),await syncProductAgents(_0x3b5842,_0x4db234,_0x2de632),_0x3329a9?.['info'](_0x274394(0x16e)+'agents\x20s'+'ynced',{'source':_0x3b5842['openclaw'][_0x274394(0x18f)+'r'],'installPath':_0x2de632[_0x274394(0x158)]?.['installP'+'ath']}),await syncProductSkills(_0x3b5842,_0x4db234,_0x2de632),_0x3329a9?.['info'](_0x274394(0x16e)+_0x274394(0x120)+'ynced',{'source':_0x3b5842['openclaw'][_0x274394(0xa5)+'r'],'installPath':_0x2de632[_0x274394(0x11a)]?.[_0x274394(0x126)+_0x274394(0xf5)]}),await syncRuntimeWrapper(_0x3b5842,_0x4db234,_0x2de632),_0x3329a9?.[_0x274394(0xc9)](_0x274394(0x142)+_0x274394(0x107)+_0x274394(0xdc),{'wujieclawBin':_0x2de632[_0x274394(0x11f)+_0x274394(0xe6)]}),await writeJson(resolveManifestPath(_0x4db234),_0x2de632),_0x3329a9?.[_0x274394(0xc9)](_0x274394(0x142)+'manifest'+_0x274394(0xb3),{'manifestPath':resolveManifestPath(_0x4db234),'manifest':summarizeRuntimeManifest(_0x2de632),'durationMs':Date[_0x274394(0x164)]()-_0x34bc78}),await _0x3329a9?.[_0x274394(0x17b)](),_0x2de632;}catch(_0x30f89a){_0x3329a9?.[_0x274394(0x178)](_0x274394(0xff)+_0x274394(0x142)+_0x274394(0x136),{'syncOnly':syncOnly,'runtimeRoot':_0x4db234,'durationMs':Date['now']()-_0x34bc78,'error':_0x30f89a}),await _0x3329a9?.['flush']();throw _0x30f89a;}}async function syncRuntimeWrapper(_0x37f005,_0x1e1f26,_0x378641){const _0x4ba4b8=_0x51e383,_0x3c5e0a=join(_0x1e1f26,'bin',_0x4ba4b8(0x11f)+'w'),_0x3a387c=join(_0x1e1f26,_0x4ba4b8(0x122),_0x4ba4b8(0x11f)+_0x4ba4b8(0x18d)),_0x222982=normalizeRuntimeRelativePath(relative(dirname(_0x3c5e0a),resolve(_0x1e1f26,_0x378641[_0x4ba4b8(0x157)+_0x4ba4b8(0x166)]))),_0x489f74=normalizeRuntimeRelativePath(relative(dirname(_0x3c5e0a),resolve(_0x1e1f26,_0x378641[_0x4ba4b8(0x17c)+_0x4ba4b8(0xc6)]))),_0x4a6e52=_0x4ba4b8(0x18a)+_0x37f005[_0x4ba4b8(0xd9)+_0x4ba4b8(0x189)],_0xc8eaef=_0x4ba4b8(0xd3)+_0x4ba4b8(0x160)+_0x37f005[_0x4ba4b8(0xd9)+_0x4ba4b8(0x189)];await mkdir(dirname(_0x3c5e0a),{'recursive':!![]}),await writeFile(_0x3c5e0a,[_0x4ba4b8(0x133)+'h',_0x4ba4b8(0x159)+_0x4ba4b8(0xd5)+_0x4ba4b8(0x16a)+'OPENCLAW'+'_HOME:-'+_0x4a6e52+'}\x22',_0x4ba4b8(0x159)+_0x4ba4b8(0xd5)+_0x4ba4b8(0x13d)+_0x4ba4b8(0xa9)+_0x4ba4b8(0xb6)+_0x4ba4b8(0x16b)+'-'+_0x4a6e52+'}\x22',_0x4ba4b8(0x159)+_0x4ba4b8(0xd5)+_0x4ba4b8(0x10b)+_0x4ba4b8(0xf8)+_0x4ba4b8(0xd5)+'CONFIG_P'+_0x4ba4b8(0xbf)+_0x4a6e52+('/opencla'+'w.json}\x22'),_0x4ba4b8(0x154)+'IR=$(CDP'+_0x4ba4b8(0xd4)+_0x4ba4b8(0x131)+_0x4ba4b8(0x15a)+_0x4ba4b8(0x112)+'&&\x20pwd)',_0x4ba4b8(0xc4)+_0x4ba4b8(0x181)+'R/'+_0x222982+('\x22\x20\x22$SCRI'+_0x4ba4b8(0x11b))+_0x489f74+'\x22\x20\x22$@\x22','']['join']('\x0a'),_0x4ba4b8(0xab)),await chmod(_0x3c5e0a,0x1ed),await writeFile(_0x3a387c,['@echo\x20of'+'f',_0x4ba4b8(0xd7)+_0x4ba4b8(0x148)+_0x4ba4b8(0x179)+_0x4ba4b8(0xa6)+'ENCLAW_H'+_0x4ba4b8(0x117)+_0xc8eaef+'\x22',_0x4ba4b8(0xd7)+_0x4ba4b8(0xb6)+'ATE_DIR%'+'\x22==\x22\x22\x20se'+_0x4ba4b8(0xc8)+_0x4ba4b8(0x10d)+_0x4ba4b8(0x103)+_0xc8eaef+'\x22',_0x4ba4b8(0xd7)+'NCLAW_CO'+'NFIG_PAT'+_0x4ba4b8(0x191)+_0x4ba4b8(0x147)+_0x4ba4b8(0x110)+'NFIG_PAT'+'H='+_0xc8eaef+(_0x4ba4b8(0x12f)+'w.json\x22'),_0x4ba4b8(0xbe)+_0x4ba4b8(0xae)+_0x4ba4b8(0x182),_0x4ba4b8(0x161)+_0x4ba4b8(0x197)+toWindowsPath(_0x222982)+(_0x4ba4b8(0x171)+'PT_DIR%')+toWindowsPath(_0x489f74)+_0x4ba4b8(0xc2),''][_0x4ba4b8(0xea)]('\x0d\x0a'),_0x4ba4b8(0xab)),_0x378641[_0x4ba4b8(0x11f)+_0x4ba4b8(0xe6)]=toRuntimeRelative(_0x1e1f26,process['platform']===_0x4ba4b8(0xda)?_0x3a387c:_0x3c5e0a);}function normalizeRuntimeRelativePath(_0x18f02c){return _0x18f02c['replaceA'+'ll']('\x5c','/');}function toWindowsPath(_0x322943){return _0x322943['replaceA'+'ll']('/','\x5c');}function validateRuntimeNodeVersion(_0x5d51fa,_0xc8fbb5){const _0x3e2a7c=_0x51e383;if(_0x5d51fa[_0x3e2a7c(0x143)+_0x3e2a7c(0xf7)]===_0xc8fbb5[_0x3e2a7c(0x17c)][_0x3e2a7c(0x143)+'ion'])return;throw new Error(_0x3e2a7c(0x142)+_0x3e2a7c(0x143)+'ion\x20mism'+_0x3e2a7c(0xcb)+'nifest='+(_0x5d51fa['nodeVers'+_0x3e2a7c(0xf7)]||'unknown')+(_0x3e2a7c(0x150)+_0x3e2a7c(0x135))+_0xc8fbb5[_0x3e2a7c(0x17c)][_0x3e2a7c(0x143)+_0x3e2a7c(0xf7)]+'.\x20'+('Rebuild\x20'+_0x3e2a7c(0x132)+_0x3e2a7c(0xed)+'ntime\x20wi'+_0x3e2a7c(0xa7)+_0x3e2a7c(0xfe)+_0x3e2a7c(0x138)+_0x3e2a7c(0x18e)+_0x3e2a7c(0xb1)+_0x3e2a7c(0xc7)+'wujie-sh'+_0x3e2a7c(0xf6)));}function _0x503b(){const _0x5793fe=['\x22\x20at\x20','filename','w.cmd','ersion\x20b','agentsDi','.cache','H%\x22==\x22\x22\x20','map','Version\x20','tall\x20the','hell:run','pid','_DIR%','er\x20writt','source','npm\x20pack','ing','missing\x20','startsWi','ginPaths','\x22\x20so\x20the','ecs','-ai\x20runt','ted','push','6MvxgKO','sync-onl','with\x20cod','\x20can\x20ins','skillsDi','\x20set\x20\x22OP','th\x20the\x20c','stalling','R=\x22${OPE','fix\x20comp','utf8','rg/','replace','IPT_DIR=','12zfJEbx','parse','efore\x20pr','pluginSp','\x20written','\x20create\x20','Name','NCLAW_ST','ent','sion.','dist','--fix','Run\x20\x22wuj','\x20timed\x20o','unknown','set\x20\x22SCR','ATH:-','npmCli','red\x20Open','\x22\x20%*','P,\x20prepa','exec\x20\x22$S','nd\x20after','Bin','eparing\x20','t\x20\x22OPENC','info','json','atch:\x20ma','WorkingD','cwd','configPa','-xzf','fix\x20alre','ogger','close','%USERPRO','ATH=\x20cd\x20','PENCLAW_','st=','if\x20\x22%OPE','-peer-de','dataDirN','win32','appId','synced','ing\x20\x22','spec','und:\x20','log','\x20resolve','resolved','\x20doctor\x20','ent\x20comp','timeoutM','wBin','ie-shell','kill','SIGTERM','join','has','--omit=d','strap\x20ru','data','.tools','runtimeS','--legacy','[wujie-s','string','--no-aud','ath','ell.','ion','ATH=\x22${O','toString','\x20version','Configur','oot','\x20bin\x20was','onfigure','prepare\x20','ut\x20after','Version','pipe','E_DIR=','claw-run','registry','replacem','wrapper\x20','isArray','766815MrARft',';\x20run\x20wu','CONFIG_P','time]\x20in','LAW_STAT','alid\x20pay','pluginId','NCLAW_CO','package','\x20\x22$0\x22)\x22\x20','load:\x20','plugin\x20s','Spec','mismatch','OME=','pack','stdout','skills','PT_DIR/','extensio','time-too','length','wujiecla','skills\x20s','\x20install','bin','p\x20runtim','bootstra','filter','installP','.tmp/run','product','started','fix\x20star','local','ent\x20skip','3075310TcJPRV','object','\x5copencla','name','--\x20\x22$(di','the\x20boot','#!/bin/s','e\x20not\x20fo','config=','failed','local:','d\x20Node\x20v','dAt','274500nytTmL','version','productN','STATE_DI','ped','slice','law\x20','runtimeR','runtime\x20','nodeVers','728SoCZyf','\x20depende','ent\x20star','set\x20\x22OPE','NCLAW_HO','add','re\x20wujie','ced','5013rQAWVU','.npmjs.o','\x20package','l\x20prepar',',\x20shell.','time]\x20ru','e\x20checke','split','SCRIPT_D','\x20validat','\x20did\x20not','nodeExec','agents','export\x20O','rname\x20--','octor\x20--','1599880LpMGxH','plugins','dataDir','https://','FILE%\x5c','\x22%SCRIPT','sion\x20val','stderr','now','706398pkQypF','utable','toISOStr','d\x20to\x20','\x20returne','HOME=\x22${','ATE_DIR:','extract\x20','LocalPlu','product\x20','--json','JSON:\x20','\x22\x20\x22%SCRI','trim','manifest','fix','tar','w-extrac','projectR','error','ME%\x22==\x22\x22','\x20runtime','flush','openclaw','runtime','ady\x20curr','y\x20manife','null','CRIPT_DI','%~dp0\x22','22096moWWpY','fix\x20mark','st\x20exist','ed\x20OpenC','leted','\x20is\x20miss','ame','$HOME/'];_0x503b=function(){return _0x5793fe;};return _0x503b();}function validateRuntimeOpenClawVersion(_0x9883f1,_0x1cb5c1){const _0x171c24=_0x51e383;if(_0x9883f1[_0x171c24(0x17c)+_0x171c24(0x101)]===_0x1cb5c1[_0x171c24(0x17c)][_0x171c24(0x17c)+'Version'])return;throw new Error(_0x171c24(0x142)+'openclaw'+_0x171c24(0x193)+_0x171c24(0x116)+':\x20manife'+_0x171c24(0xd6)+(_0x9883f1[_0x171c24(0x17c)+_0x171c24(0x101)]||_0x171c24(0xbd))+(_0x171c24(0x150)+_0x171c24(0x135))+_0x1cb5c1[_0x171c24(0x17c)]['openclaw'+'Version']+'.\x20'+(_0x171c24(0xbb)+_0x171c24(0xe7)+'\x20prepare'+_0x171c24(0x19f)+_0x171c24(0x17a)+_0x171c24(0xa4)+_0x171c24(0x194)+'\x20configu'+_0x171c24(0xc1)+'Claw\x20ver'+_0x171c24(0xb8)));}function parseNpmPackJson(_0x14daa2){const _0x25ebb8=_0x51e383,_0xcecbb=_0x14daa2[_0x25ebb8(0x172)](),_0x2bcb12=_0xcecbb['indexOf']('[');if(_0x2bcb12<0x0)throw new Error(_0x25ebb8(0x19a)+_0x25ebb8(0x156)+'\x20return\x20'+_0x25ebb8(0x170)+_0xcecbb[_0x25ebb8(0x13f)](0x0,0x1f4));const _0x59b48b=JSON[_0x25ebb8(0xb0)](_0xcecbb[_0x25ebb8(0x13f)](_0x2bcb12)),_0x48a1e6=Array[_0x25ebb8(0x108)](_0x59b48b)?_0x59b48b[0x0]:_0x59b48b;if(!_0x48a1e6||typeof _0x48a1e6!==_0x25ebb8(0x12e))throw new Error(_0x25ebb8(0x19a)+_0x25ebb8(0x169)+'d\x20an\x20inv'+_0x25ebb8(0x10e)+_0x25ebb8(0x113)+_0xcecbb[_0x25ebb8(0x13f)](0x0,0x1f4));return _0x48a1e6;}async function runProcess(_0x2e6457,_0x229974,_0x684bb8={}){const _0x3ae77b=_0x51e383,_0x17c68f=_0x684bb8['label']||[_0x2e6457,..._0x229974][_0x3ae77b(0xea)]('\x20'),_0x39b058=_0x684bb8[_0x3ae77b(0xe5)+'s']??NPM_INSTALL_TIMEOUT_MS,_0x566db1=spawn(_0x2e6457,_0x229974,{'cwd':_0x684bb8[_0x3ae77b(0xcd)],'env':_0x684bb8['env'],'stdio':['ignore',_0x3ae77b(0x102),_0x3ae77b(0x102)]});return await new Promise((_0x1a28e8,_0x20420b)=>{const _0x1a6db7=_0x3ae77b;let _0x3697bf='',_0x134c52='',_0xed8e2c=![];const _0x656fb2=setTimeout(()=>{const _0x2ae848=_0x2d02;if(_0xed8e2c)return;_0xed8e2c=!![],_0x566db1[_0x2ae848(0xe8)](_0x2ae848(0xe9)),_0x20420b(new Error(_0x17c68f+(_0x2ae848(0xbc)+_0x2ae848(0x100)+'\x20')+_0x39b058+'ms'));},_0x39b058);_0x566db1[_0x1a6db7(0x119)]['on']('data',_0xa41e6d=>{const _0x57f171=_0x1a6db7;_0x3697bf+=_0xa41e6d[_0x57f171(0xf9)]();}),_0x566db1['stderr']['on'](_0x1a6db7(0xee),_0x3b1747=>{_0x134c52+=_0x3b1747['toString']();}),_0x566db1['on'](_0x1a6db7(0x178),_0x5ae0dd=>{if(_0xed8e2c)return;_0xed8e2c=!![],clearTimeout(_0x656fb2),_0x20420b(_0x5ae0dd);}),_0x566db1['on'](_0x1a6db7(0xd2),(_0xe34365,_0x2b1759)=>{const _0x3069c6=_0x1a6db7;if(_0xed8e2c)return;_0xed8e2c=!![],clearTimeout(_0x656fb2);if(_0xe34365===0x0){_0x1a28e8({'stdout':_0x3697bf,'stderr':_0x134c52});return;}_0x20420b(new Error(_0x17c68f+('\x20failed\x20'+_0x3069c6(0xa3)+'e=')+(_0xe34365??_0x3069c6(0x180))+'\x20signal='+(_0x2b1759??'null')+'\x0a'+(''+(_0x134c52||_0x3697bf))['trim']()));});});}async function installOpenClawPackage(_0x48f8de,_0x17ae97){const _0x2b4327=_0x51e383,_0x4a3903=join(_0x48f8de['runtimeR'+'oot'],_0x2b4327(0x190)),_0x323549=join(_0x48f8de[_0x2b4327(0x141)+'oot'],'.opencla'+_0x2b4327(0x176)+'t');await mkdir(_0x4a3903,{'recursive':!![]}),await rm(_0x323549,{'recursive':!![],'force':!![]}),await mkdir(_0x323549,{'recursive':!![]});const _0x50bbf3=await createRuntimeEnv(_0x48f8de),_0x35d9ec=_0x2b4327(0x17c)+'@'+_0x17ae97;console[_0x2b4327(0xe0)](_0x2b4327(0xf2)+_0x2b4327(0x195)+_0x2b4327(0x10c)+_0x2b4327(0xa8)+'\x20'+_0x35d9ec);const _0x3ec5c1=await runProcess(_0x48f8de[_0x2b4327(0x157)+_0x2b4327(0x166)],[_0x48f8de[_0x2b4327(0xc0)],_0x2b4327(0x118),_0x35d9ec,_0x2b4327(0x16f)],{'cwd':_0x4a3903,'env':_0x50bbf3,'label':_0x2b4327(0x19a)+'\x20'+_0x35d9ec}),_0x175e4a=parseNpmPackJson(_0x3ec5c1['stdout']);if(_0x175e4a[_0x2b4327(0x13b)]!==_0x17ae97)throw new Error(_0x2b4327(0xfb)+_0x2b4327(0x186)+_0x2b4327(0x140)+_0x17ae97+(_0x2b4327(0xe1)+_0x2b4327(0x168))+_0x175e4a['version']);const _0x4705cb=resolve(_0x4a3903,_0x175e4a[_0x2b4327(0x18c)]);if(!existsSync(_0x4705cb))throw new Error(_0x2b4327(0x19a)+'\x20did\x20not'+_0x2b4327(0xb4)+'tarball:'+'\x20'+_0x4705cb);await runProcess(_0x2b4327(0x175),[_0x2b4327(0xcf),_0x4705cb,'-C',_0x323549],{'label':_0x2b4327(0x16c)+_0x175e4a[_0x2b4327(0x18c)]}),await rm(_0x48f8de[_0x2b4327(0x17c)+'WorkingD'+'ir'],{'recursive':!![],'force':!![]}),await rename(join(_0x323549,_0x2b4327(0x111)),_0x48f8de[_0x2b4327(0x17c)+_0x2b4327(0xcc)+'ir']),await rm(_0x323549,{'recursive':!![],'force':!![]}),await runProcess(_0x48f8de[_0x2b4327(0x157)+'utable'],[_0x48f8de[_0x2b4327(0xc0)],'install',_0x2b4327(0xec)+'ev','--omit=p'+'eer',_0x2b4327(0xf4)+'it','--no-fun'+'d',_0x2b4327(0xf1)+_0x2b4327(0xd8)+'ps'],{'cwd':_0x48f8de[_0x2b4327(0x17c)+_0x2b4327(0xcc)+'ir'],'env':_0x50bbf3,'label':'npm\x20inst'+'all\x20'+_0x35d9ec+('\x20runtime'+_0x2b4327(0x145)+'ncies')});if(!existsSync(_0x48f8de[_0x2b4327(0x17c)+'Bin']))throw new Error('OpenClaw'+_0x2b4327(0xfd)+'\x20not\x20fou'+_0x2b4327(0xc5)+'\x20install'+':\x20'+_0x48f8de['openclaw'+'Bin']);}export async function ensureOpenClawDoctorFixed(_0x42363d,_0x33d3bd={}){const _0x3b6d1d=_0x51e383,_0x46c2ad=await loadRuntimeInfo(_0x42363d[_0x3b6d1d(0x177)+_0x3b6d1d(0xfc)]),_0x5c2f8a=getConfigPaths(_0x42363d),_0x5e20b3=join(_0x5c2f8a[_0x3b6d1d(0xf0)+'tateDir'],'openclaw'+'-doctor.'+_0x3b6d1d(0xca)),_0xb24d2d=await readJson(_0x5e20b3,{});if(_0xb24d2d[_0x3b6d1d(0x17c)+_0x3b6d1d(0x101)]===_0x46c2ad['openclaw'+_0x3b6d1d(0x101)])return _0x33d3bd['runtimeL'+'ogger']?.[_0x3b6d1d(0xc9)](_0x3b6d1d(0x17c)+_0x3b6d1d(0xe3)+_0x3b6d1d(0xd0)+_0x3b6d1d(0x17e)+_0x3b6d1d(0xb7),{'openclawVersion':_0x46c2ad['openclaw'+_0x3b6d1d(0x101)],'markerPath':_0x5e20b3}),{'ran':![],'openclawVersion':_0x46c2ad[_0x3b6d1d(0x17c)+_0x3b6d1d(0x101)],'markerPath':_0x5e20b3};return await runOpenClawDoctorFix(_0x42363d,_0x46c2ad,{'fromVersion':_0xb24d2d[_0x3b6d1d(0x17c)+'Version']||_0x3b6d1d(0xbd),'toVersion':_0x46c2ad[_0x3b6d1d(0x17c)+_0x3b6d1d(0x101)],'markerPath':_0x5e20b3,'runtimeLogger':_0x33d3bd['runtimeL'+_0x3b6d1d(0xd1)]}),{'ran':!![],'openclawVersion':_0x46c2ad[_0x3b6d1d(0x17c)+_0x3b6d1d(0x101)],'markerPath':_0x5e20b3};}async function runOpenClawDoctorFix(_0x24c542,_0x58020c,{fromVersion:_0x21c9d7,toVersion:_0x58cce7,markerPath:markerPath='',runtimeLogger:_0x17d596}={}){const _0x58b0a9=_0x51e383;_0x17d596?.[_0x58b0a9(0xc9)](_0x58b0a9(0x17c)+_0x58b0a9(0xe3)+_0x58b0a9(0x12a)+_0x58b0a9(0x9f),{'fromVersion':_0x21c9d7,'toVersion':_0x58cce7});const _0x245092=await createRuntimeEnv(_0x58020c,{'OPENCLAW_HOME':_0x24c542[_0x58b0a9(0x15e)],'OPENCLAW_STATE_DIR':_0x24c542[_0x58b0a9(0x15e)],'OPENCLAW_CONFIG_PATH':getConfigPaths(_0x24c542)[_0x58b0a9(0xce)+'th']});console[_0x58b0a9(0xe0)]('[wujie-s'+'hell:run'+_0x58b0a9(0x151)+'nning\x20op'+'enclaw\x20d'+_0x58b0a9(0x15b)+_0x58b0a9(0x174));const _0x334657=await runProcess(_0x58020c[_0x58b0a9(0x157)+'utable'],[_0x58020c[_0x58b0a9(0x17c)+'Bin'],'doctor',_0x58b0a9(0xba)],{'cwd':_0x58020c[_0x58b0a9(0x17c)+_0x58b0a9(0xcc)+'ir'],'env':_0x245092,'label':_0x58b0a9(0x17c)+_0x58b0a9(0xe3)+_0x58b0a9(0xba),'timeoutMs':0x1d4c0});_0x17d596?.[_0x58b0a9(0xc9)](_0x58b0a9(0x17c)+_0x58b0a9(0xe3)+_0x58b0a9(0xaa)+'leted',{'fromVersion':_0x21c9d7,'toVersion':_0x58cce7,'stdout':_0x334657['stdout'][_0x58b0a9(0x172)]()[_0x58b0a9(0x13f)](-0xfa0),'stderr':_0x334657[_0x58b0a9(0x163)]['trim']()[_0x58b0a9(0x13f)](-0xfa0)}),markerPath&&(await writeJson(markerPath,{'openclawVersion':_0x58020c['openclaw'+_0x58b0a9(0x101)],'fixedAt':new Date()[_0x58b0a9(0x167)+_0x58b0a9(0x19b)]()}),_0x17d596?.[_0x58b0a9(0xc9)](_0x58b0a9(0x17c)+_0x58b0a9(0xe3)+_0x58b0a9(0x184)+_0x58b0a9(0x198)+'en',{'markerPath':markerPath,'openclawVersion':_0x58020c[_0x58b0a9(0x17c)+_0x58b0a9(0x101)]}));}async function replaceRuntimeFromBootstrap(_0x58e758,_0x2887e9){const _0x502815=_0x51e383;await mkdir(dirname(_0x2887e9),{'recursive':!![]});const _0x2d49eb=_0x2887e9+'.next-'+process['pid']+'-'+Date[_0x502815(0x164)](),_0x3fb2f7=_0x2887e9+'.old-'+process[_0x502815(0x196)]+'-'+Date[_0x502815(0x164)]();await rm(_0x2d49eb,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await rm(_0x3fb2f7,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await cp(_0x58e758,_0x2d49eb,{'recursive':!![],'force':!![]}),existsSync(_0x2887e9)&&(await rm(_0x3fb2f7,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await rename(_0x2887e9,_0x3fb2f7)),await rename(_0x2d49eb,_0x2887e9),await rm(_0x3fb2f7,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96});}export async function readRuntimeManifest(_0x2289a2){return await readJson(resolveManifestPath(_0x2289a2),{});}export async function loadRuntimeInfo(_0x16b6d3){const _0x4dce2c=_0x51e383,_0x47c1ee=resolveRuntimeRoot(_0x16b6d3),_0xe5f917=await readRuntimeManifest(_0x47c1ee);for(const _0x7b864 of[_0x4dce2c(0x157)+_0x4dce2c(0x166),_0x4dce2c(0xc0),_0x4dce2c(0x17c)+_0x4dce2c(0xcc)+'ir',_0x4dce2c(0x17c)+_0x4dce2c(0xc6)]){if(typeof _0xe5f917[_0x7b864]!==_0x4dce2c(0xf3)||!_0xe5f917[_0x7b864][_0x4dce2c(0x172)]())throw new Error(_0x4dce2c(0x142)+_0x4dce2c(0x173)+_0x4dce2c(0x188)+_0x4dce2c(0xdd)+_0x7b864+_0x4dce2c(0x18b)+resolveManifestPath(_0x47c1ee)+(_0x4dce2c(0x10a)+'jie-shel'+_0x4dce2c(0x14f)+'e'));}const _0xb67e74=resolve(_0x47c1ee,_0xe5f917[_0x4dce2c(0x157)+'utable']),_0x56e7a7=resolve(_0x47c1ee,_0xe5f917[_0x4dce2c(0xc0)]),_0xec8156=resolve(_0x47c1ee,_0xe5f917[_0x4dce2c(0x17c)+_0x4dce2c(0xcc)+'ir']),_0x3bb678=resolve(_0x47c1ee,_0xe5f917['openclaw'+_0x4dce2c(0xc6)]),_0x242e27=Array[_0x4dce2c(0x108)](_0xe5f917[_0x4dce2c(0x15d)])?_0xe5f917[_0x4dce2c(0x15d)][_0x4dce2c(0x192)](_0x55b67e=>({..._0x55b67e,'installPath':resolve(_0x47c1ee,_0x55b67e[_0x4dce2c(0x126)+_0x4dce2c(0xf5)])})):[];for(const _0x411f22 of[_0xb67e74,_0x56e7a7,_0xec8156,_0x3bb678]){if(!existsSync(_0x411f22))throw new Error(_0x4dce2c(0x142)+_0x4dce2c(0x19c)+'path:\x20'+_0x411f22);}return{'runtimeRoot':_0x47c1ee,'manifest':_0xe5f917,'openclawVersion':_0xe5f917[_0x4dce2c(0x17c)+'Version']||_0x4dce2c(0xbd),'nodeExecutable':_0xb67e74,'npmCli':_0x56e7a7,'openclawWorkingDir':_0xec8156,'openclawBin':_0x3bb678,'plugins':_0x242e27};}export async function spawnClaw(_0x3549b6,_0x51a4fa=[],_0x4a2ef1={}){const _0x417fe4=_0x51e383,_0x7bdaa3=await loadRuntimeInfo(_0x3549b6),_0x31c9ec=await createRuntimeEnv(_0x7bdaa3,_0x4a2ef1['env']??{});return spawn(_0x7bdaa3[_0x417fe4(0x157)+'utable'],[_0x7bdaa3['openclaw'+_0x417fe4(0xc6)],..._0x51a4fa],{'cwd':_0x7bdaa3['openclaw'+_0x417fe4(0xcc)+'ir'],'stdio':_0x417fe4(0x102),..._0x4a2ef1,'env':_0x31c9ec});}export async function runClawOnce(_0x3aa679,_0x35e152=[],_0x35f19e=0x15f90){const _0x808a78=await spawnClaw(_0x3aa679,_0x35e152);return await new Promise((_0x5864d8,_0x318674)=>{const _0x481405=_0x2d02;let _0x2ad22e='',_0x29ef92='',_0x542b43=![];const _0x45b5bb=setTimeout(()=>{const _0x1eb6c1=_0x2d02;if(_0x542b43)return;_0x542b43=!![],_0x808a78[_0x1eb6c1(0xe8)](_0x1eb6c1(0xe9)),_0x318674(new Error(_0x1eb6c1(0x17c)+_0x1eb6c1(0xbc)+_0x1eb6c1(0x100)+'\x20'+_0x35f19e+'ms'));},_0x35f19e);_0x808a78[_0x481405(0x119)]['on'](_0x481405(0xee),_0x163e0c=>{const _0x180776=_0x481405;_0x2ad22e+=_0x163e0c[_0x180776(0xf9)]();}),_0x808a78[_0x481405(0x163)]['on'](_0x481405(0xee),_0x128e4c=>{const _0x41ab4e=_0x481405;_0x29ef92+=_0x128e4c[_0x41ab4e(0xf9)]();}),_0x808a78['on'](_0x481405(0x178),_0x3bf5e8=>{if(_0x542b43)return;_0x542b43=!![],clearTimeout(_0x45b5bb),_0x318674(_0x3bf5e8);}),_0x808a78['on'](_0x481405(0xd2),(_0x424e17,_0x2e1288)=>{if(_0x542b43)return;_0x542b43=!![],clearTimeout(_0x45b5bb),_0x5864d8({'code':_0x424e17,'signal':_0x2e1288,'stdout':_0x2ad22e,'stderr':_0x29ef92});});});}function _0x2d02(_0x12f09a,_0x4d29b7){_0x12f09a=_0x12f09a-0x9d;const _0x503b5a=_0x503b();let _0x2d02ad=_0x503b5a[_0x12f09a];return _0x2d02ad;}async function createRuntimeEnv(_0x25cfb0,_0x21d17e={}){const _0x5680d6=_0x51e383,_0x69acbf=process.env.OPENCLAW_STATE_DIR||'',_0xa7e5e1=_0x69acbf?join(_0x69acbf,_0x5680d6(0x104)+_0x5680d6(0x11d)+'ls'):join(_0x25cfb0[_0x5680d6(0x141)+_0x5680d6(0xfc)],_0x5680d6(0xef)),_0x35e54d=join(_0xa7e5e1,'npm-glob'+'al'),_0x3ce0f9=join(_0xa7e5e1,'npm-cach'+'e'),_0x1fb833=join(_0x35e54d,'bin');await mkdir(_0x1fb833,{'recursive':!![]}),await mkdir(_0x3ce0f9,{'recursive':!![]});const _0x26ca0b=[_0x1fb833,dirname(_0x25cfb0['nodeExec'+'utable']),process.env.PATH||''];return{...process.env,..._0x21d17e,'PATH':_0x26ca0b[_0x5680d6(0x125)](Boolean)[_0x5680d6(0xea)](delimiter),'npm_config_prefix':_0x35e54d,'NPM_CONFIG_PREFIX':_0x35e54d,'npm_config_cache':_0x3ce0f9,'NPM_CONFIG_CACHE':_0x3ce0f9,'npm_config_registry':_0x5680d6(0x15f)+_0x5680d6(0x105)+_0x5680d6(0x14d)+'rg/','NPM_CONFIG_REGISTRY':_0x5680d6(0x15f)+_0x5680d6(0x105)+'.npmjs.o'+_0x5680d6(0xac),'npm_execpath':_0x25cfb0[_0x5680d6(0xc0)],'npm_node_execpath':_0x25cfb0[_0x5680d6(0x157)+_0x5680d6(0x166)],'OPENCLAW_RUNTIME_NPM_PREFIX':_0x35e54d,'OPENCLAW_RUNTIME_NPM_BIN':_0x1fb833,'OPENCLAW_RUNTIME_NPM_REGISTRY':_0x5680d6(0x15f)+_0x5680d6(0x105)+_0x5680d6(0x14d)+_0x5680d6(0xac)};}async function syncProductPlugins(_0x467167,_0xb47306,_0x2d97aa){const _0xc9c782=_0x51e383,_0x178d23=join(_0xb47306,'openclaw','dist',_0xc9c782(0x11c)+'ns'),_0x23a54d=[];for(const _0x5c1510 of _0x467167[_0xc9c782(0x17c)][_0xc9c782(0xe2)+_0xc9c782(0x16d)+_0xc9c782(0x19e)]){const _0xeff200=await getPackageMetadata(_0x5c1510),_0x50022e=await readPluginManifest(_0x5c1510),_0x2f269d=join(_0x178d23,_0xeff200['pluginId']);await copyDirFresh(_0x5c1510,_0x2f269d),_0x23a54d[_0xc9c782(0xa0)]({'pluginId':_0xeff200[_0xc9c782(0x10f)],'source':'local','spec':'local:'+_0x5c1510,'installPath':toRuntimeRelative(_0xb47306,_0x2f269d),'version':_0xeff200['version'],'resolvedName':_0xeff200[_0xc9c782(0x130)],'resolvedVersion':_0xeff200['version'],'resolvedSpec':_0xc9c782(0x137)+_0x5c1510,'integrity':'','shasum':'','resolvedAt':new Date()[_0xc9c782(0x167)+'ing'](),'installedAt':new Date()[_0xc9c782(0x167)+'ing'](),'agentScope':_0x50022e['agentSco'+'pe'],'skills':_0x50022e[_0xc9c782(0x11a)]});}const _0x31c806=new Set(_0x23a54d['map'](_0x3c4709=>_0x3c4709[_0xc9c782(0x10f)])),_0x16100d=Array[_0xc9c782(0x108)](_0x2d97aa['plugins'])?_0x2d97aa[_0xc9c782(0x15d)]['filter'](_0x1f856f=>!_0x31c806[_0xc9c782(0xeb)](_0x1f856f['pluginId'])):[];_0x2d97aa['plugins']=[..._0x16100d,..._0x23a54d];}async function syncManifestPluginScope(_0x59591d,_0x6da86b,_0x25d07d){const _0xae7b1=_0x51e383,_0x40fc66=join(_0x6da86b,_0xae7b1(0x17c),_0xae7b1(0xb9),'extensio'+'ns'),_0x48d719=new Set(_0x59591d[_0xae7b1(0x17c)][_0xae7b1(0xb2)+_0xae7b1(0x9d)]??[]),_0x8d32cf=new Set([..._0x48d719][_0xae7b1(0x192)](_0x19fd1f=>_0x19fd1f[_0xae7b1(0xad)](/^npm:/,''))[_0xae7b1(0x192)](_0x51ea9c=>{const _0x3eebb2=_0xae7b1;if(_0x51ea9c['startsWi'+'th']('@')){const _0x51bfcc=_0x51ea9c[_0x3eebb2(0x153)]('@');return _0x51bfcc[_0x3eebb2(0x11e)]>=0x3?'@'+_0x51bfcc[0x1]:_0x51ea9c;}return _0x51ea9c[_0x3eebb2(0x153)]('@')[0x0];})['filter'](Boolean)),_0x2cedfc=new Set();for(const _0x4f105e of _0x59591d[_0xae7b1(0x17c)][_0xae7b1(0xe2)+_0xae7b1(0x16d)+_0xae7b1(0x19e)]){const _0x5d964c=await getPackageMetadata(_0x4f105e);if(_0x5d964c[_0xae7b1(0x10f)])_0x2cedfc[_0xae7b1(0x149)](_0x5d964c[_0xae7b1(0x10f)]);}const _0x246ee2=Array[_0xae7b1(0x108)](_0x25d07d['plugins'])?_0x25d07d['plugins']:[];_0x25d07d['pluginSp'+_0xae7b1(0x9d)]=[..._0x59591d[_0xae7b1(0x17c)][_0xae7b1(0xb2)+_0xae7b1(0x9d)],..._0x59591d['openclaw'][_0xae7b1(0xe2)+_0xae7b1(0x16d)+_0xae7b1(0x19e)][_0xae7b1(0x192)](_0x5e5fd8=>'local:'+_0x5e5fd8)],_0x25d07d['plugins']=_0x246ee2[_0xae7b1(0x125)](_0x5ecf14=>{const _0x40a9a8=_0xae7b1;if(!_0x5ecf14||typeof _0x5ecf14!==_0x40a9a8(0x12e))return![];if(_0x5ecf14['source']===_0x40a9a8(0x12b))return _0x2cedfc[_0x40a9a8(0xeb)](_0x5ecf14['pluginId']);if(_0x5ecf14[_0x40a9a8(0x199)]==='npm')return _0x48d719[_0x40a9a8(0xeb)](_0x5ecf14[_0x40a9a8(0xde)])||_0x48d719[_0x40a9a8(0xeb)](_0x5ecf14[_0x40a9a8(0xe2)+_0x40a9a8(0x115)])||_0x8d32cf[_0x40a9a8(0xeb)](_0x5ecf14[_0x40a9a8(0xe2)+_0x40a9a8(0xb5)]);return![];});const _0x3d7183=new Set(_0x25d07d[_0xae7b1(0x15d)]['map'](_0x5620aa=>_0x5620aa['pluginId']));for(const _0x3464b7 of _0x246ee2){if(!_0x3464b7[_0xae7b1(0x10f)]||_0x3d7183[_0xae7b1(0xeb)](_0x3464b7[_0xae7b1(0x10f)]))continue;const _0x43fe55=typeof _0x3464b7[_0xae7b1(0x126)+'ath']===_0xae7b1(0xf3)&&_0x3464b7[_0xae7b1(0x126)+_0xae7b1(0xf5)]['trim']()?resolve(_0x6da86b,_0x3464b7['installP'+_0xae7b1(0xf5)]):join(_0x40fc66,_0x3464b7[_0xae7b1(0x10f)]),_0x331856=relative(_0x40fc66,_0x43fe55);if(_0x331856[_0xae7b1(0x19d)+'th']('..')||_0x331856==='')continue;await rm(_0x43fe55,{'recursive':!![],'force':!![]});}}async function syncProductAgents(_0x4bbef6,_0x4fc248,_0x1514f7){const _0x524eea=_0x51e383,_0x9bb43b=join(_0x4fc248,_0x524eea(0x17c),_0x524eea(0x158));await copyDirFresh(_0x4bbef6[_0x524eea(0x17c)]['agentsDi'+'r'],_0x9bb43b),_0x1514f7[_0x524eea(0x158)]={'source':_0x524eea(0x128),'installPath':toRuntimeRelative(_0x4fc248,_0x9bb43b)};}async function syncProductSkills(_0x2c6127,_0x3bdbb2,_0xfaff86){const _0xca9f4e=_0x51e383,_0x4e56dd=join(_0x3bdbb2,_0xca9f4e(0x17c),_0xca9f4e(0x11a));await copyDirFresh(_0x2c6127[_0xca9f4e(0x17c)][_0xca9f4e(0xa5)+'r'],_0x4e56dd),_0xfaff86['skills']={'source':_0xca9f4e(0x128),'installPath':toRuntimeRelative(_0x3bdbb2,_0x4e56dd)};}
@@ -1 +1 @@
1
- (function(_0x484b7d,_0x55b0a9){const _0x205009=_0x40be,_0x4642f0=_0x484b7d();while(!![]){try{const _0x3cecea=-parseInt(_0x205009(0x86))/0x1*(-parseInt(_0x205009(0x7a))/0x2)+parseInt(_0x205009(0x78))/0x3+-parseInt(_0x205009(0x7b))/0x4+-parseInt(_0x205009(0x83))/0x5+parseInt(_0x205009(0x85))/0x6+parseInt(_0x205009(0x7c))/0x7*(-parseInt(_0x205009(0x87))/0x8)+parseInt(_0x205009(0x71))/0x9*(parseInt(_0x205009(0x88))/0xa);if(_0x3cecea===_0x55b0a9)break;else _0x4642f0['push'](_0x4642f0['shift']());}catch(_0x34d8a4){_0x4642f0['push'](_0x4642f0['shift']());}}}(_0x2ffe,0xa7f7f));function _0x40be(_0x4efc45,_0x2e4c6a){_0x4efc45=_0x4efc45-0x70;const _0x2ffe07=_0x2ffe();let _0x40beee=_0x2ffe07[_0x4efc45];return _0x40beee;}import{existsSync}from'node:fs';import{cp,mkdir,readFile,readdir,rm,stat,writeFile}from'node:fs/promises';import{basename,dirname,join,relative}from'node:path';export function asRecord(_0x1b2687){const _0xce861=_0x40be;return _0x1b2687&&typeof _0x1b2687===_0xce861(0x84)&&!Array[_0xce861(0x7d)](_0x1b2687)?_0x1b2687:{};}export function asStringArray(_0x539217){const _0x941db2=_0x40be;return Array[_0x941db2(0x7d)](_0x539217)?_0x539217[_0x941db2(0x79)](_0x2b108c=>typeof _0x2b108c===_0x941db2(0x81)&&_0x2b108c[_0x941db2(0x7e)]())[_0x941db2(0x82)](_0x29cc48=>_0x29cc48[_0x941db2(0x7e)]()):[];}export function dedupeStrings(_0x2eec47){const _0x4563bb=_0x40be;return[...new Set(_0x2eec47[_0x4563bb(0x79)](Boolean))];}export function getTrimmedString(_0x1d244c){const _0x51121a=_0x40be;return typeof _0x1d244c===_0x51121a(0x81)?_0x1d244c[_0x51121a(0x7e)]():'';}export async function readJson(_0x576d95,_0x43e029={}){const _0x148782=_0x40be;try{return JSON[_0x148782(0x76)](await readFile(_0x576d95,_0x148782(0x89)));}catch{return _0x43e029;}}export async function writeJson(_0x59a807,_0x172d66){const _0x20bd3c=_0x40be;await mkdir(dirname(_0x59a807),{'recursive':!![]}),await writeFile(_0x59a807,JSON['stringif'+'y'](_0x172d66,null,0x2)+'\x0a',_0x20bd3c(0x89));}export async function copyDirFresh(_0x17a4e3,_0x58d5bb){await rm(_0x58d5bb,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await mkdir(dirname(_0x58d5bb),{'recursive':!![]}),await cp(_0x17a4e3,_0x58d5bb,{'recursive':!![]});}export async function ensureDir(_0x1086a1){await mkdir(_0x1086a1,{'recursive':!![]});}export function pathExists(_0x30a2a1){return existsSync(_0x30a2a1);}export async function listDirs(_0x12e5f9){const _0x1b9c1f=_0x40be;try{const _0x47cbef=await readdir(_0x12e5f9,{'withFileTypes':!![],'encoding':'utf8'});return _0x47cbef[_0x1b9c1f(0x79)](_0x402cb1=>_0x402cb1[_0x1b9c1f(0x73)+'ory']())[_0x1b9c1f(0x82)](_0x791180=>_0x791180['name']);}catch{return[];}}export async function getPackageMetadata(_0x1214f0){const _0x5fc9d5=_0x40be,_0x4eedb9=await readJson(join(_0x1214f0,_0x5fc9d5(0x70)+_0x5fc9d5(0x72)),{}),_0x5d90f4=asRecord(_0x4eedb9[_0x5fc9d5(0x7f)]);return{'name':getTrimmedString(_0x4eedb9[_0x5fc9d5(0x80)])||basename(_0x1214f0),'version':getTrimmedString(_0x4eedb9[_0x5fc9d5(0x8a)])||'0.0.0','pluginId':getTrimmedString(_0x5d90f4['id'])||getTrimmedString(_0x4eedb9[_0x5fc9d5(0x7f)+'Id'])||basename(_0x1214f0)};}function _0x2ffe(){const _0x474a8a=['openclaw','name','string','map','4282495PjHfaH','object','2428302nGpqnu','82163CsDtfl','4304752ehLVLB','50sOAUiq','utf8','version','package.','4472073Iktsov','json','isDirect','replaceA','isFile','parse','.plugin.','60108mUhKHd','filter','2ogltFa','3635236uuaTer','7dYHEPG','isArray','trim'];_0x2ffe=function(){return _0x474a8a;};return _0x2ffe();}export async function readPluginManifest(_0x2955d6){const _0x314330=_0x40be,_0x78a197=join(_0x2955d6,_0x314330(0x7f)+_0x314330(0x77)+'json'),_0x3e6e88=await readJson(_0x78a197,{});return asRecord(_0x3e6e88);}export async function hasFile(_0x5a490c){const _0x108454=_0x40be;try{const _0x1c4373=await stat(_0x5a490c);return _0x1c4373[_0x108454(0x75)]();}catch{return![];}}export function toRuntimeRelative(_0x4f66ce,_0x36694e){const _0x2e6fae=_0x40be;return relative(_0x4f66ce,_0x36694e)[_0x2e6fae(0x74)+'ll']('\x5c','/');}
1
+ (function(_0xe45316,_0x16e5ae){const _0x564426=_0x24bd,_0x3fab62=_0xe45316();while(!![]){try{const _0x229377=parseInt(_0x564426(0xf1))/0x1*(-parseInt(_0x564426(0x100))/0x2)+-parseInt(_0x564426(0x105))/0x3*(-parseInt(_0x564426(0x102))/0x4)+parseInt(_0x564426(0x106))/0x5+parseInt(_0x564426(0xff))/0x6+parseInt(_0x564426(0xf9))/0x7+parseInt(_0x564426(0xfe))/0x8+parseInt(_0x564426(0xef))/0x9*(-parseInt(_0x564426(0xee))/0xa);if(_0x229377===_0x16e5ae)break;else _0x3fab62['push'](_0x3fab62['shift']());}catch(_0x4fbb93){_0x3fab62['push'](_0x3fab62['shift']());}}}(_0x4cc0,0xc1362));import{existsSync}from'node:fs';import{cp,mkdir,readFile,readdir,rm,stat,writeFile}from'node:fs/promises';import{basename,dirname,join,relative}from'node:path';export function asRecord(_0x503229){const _0x413eb4=_0x24bd;return _0x503229&&typeof _0x503229===_0x413eb4(0xfd)&&!Array['isArray'](_0x503229)?_0x503229:{};}export function asStringArray(_0xe657bc){const _0x160363=_0x24bd;return Array[_0x160363(0xf0)](_0xe657bc)?_0xe657bc['filter'](_0x564af4=>typeof _0x564af4===_0x160363(0xf6)&&_0x564af4[_0x160363(0x108)]())[_0x160363(0xf4)](_0x25a7bb=>_0x25a7bb[_0x160363(0x108)]()):[];}export function dedupeStrings(_0xdbe864){return[...new Set(_0xdbe864['filter'](Boolean))];}function _0x24bd(_0x4de065,_0x24b5b3){_0x4de065=_0x4de065-0xee;const _0x4cc071=_0x4cc0();let _0x24bd96=_0x4cc071[_0x4de065];return _0x24bd96;}export function getTrimmedString(_0x33eb3a){const _0x6281b6=_0x24bd;return typeof _0x33eb3a==='string'?_0x33eb3a[_0x6281b6(0x108)]():'';}export async function readJson(_0x49665b,_0x41dac9={}){const _0x4cc539=_0x24bd;try{return JSON[_0x4cc539(0x101)](await readFile(_0x49665b,_0x4cc539(0x109)));}catch{return _0x41dac9;}}export async function writeJson(_0x2c2230,_0x2852f8){const _0x47cb78=_0x24bd;await mkdir(dirname(_0x2c2230),{'recursive':!![]}),await writeFile(_0x2c2230,JSON['stringif'+'y'](_0x2852f8,null,0x2)+'\x0a',_0x47cb78(0x109));}export async function copyDirFresh(_0x38c873,_0x3155be){await rm(_0x3155be,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await mkdir(dirname(_0x3155be),{'recursive':!![]}),await cp(_0x38c873,_0x3155be,{'recursive':!![]});}export async function ensureDir(_0x4e930c){await mkdir(_0x4e930c,{'recursive':!![]});}export function pathExists(_0x5e72a8){return existsSync(_0x5e72a8);}export async function listDirs(_0x497129){const _0x159f5e=_0x24bd;try{const _0x2a861c=await readdir(_0x497129,{'withFileTypes':!![],'encoding':_0x159f5e(0x109)});return _0x2a861c[_0x159f5e(0xfa)](_0x46358d=>_0x46358d[_0x159f5e(0x107)+'ory']())[_0x159f5e(0xf4)](_0x4d90e2=>_0x4d90e2['name']);}catch{return[];}}export async function getPackageMetadata(_0x8ee3b8){const _0x3a983e=_0x24bd,_0x1cbeec=await readJson(join(_0x8ee3b8,_0x3a983e(0xf3)+_0x3a983e(0xf2)),{}),_0x43733b=asRecord(_0x1cbeec[_0x3a983e(0x104)]);return{'name':getTrimmedString(_0x1cbeec[_0x3a983e(0xf8)])||basename(_0x8ee3b8),'version':getTrimmedString(_0x1cbeec[_0x3a983e(0xf7)])||_0x3a983e(0xfc),'pluginId':getTrimmedString(_0x43733b['id'])||getTrimmedString(_0x1cbeec[_0x3a983e(0x104)+'Id'])||basename(_0x8ee3b8)};}export async function readPluginManifest(_0x4f732b){const _0x106457=_0x24bd,_0x3c45bb=join(_0x4f732b,_0x106457(0x104)+_0x106457(0x103)+_0x106457(0xf2)),_0x2f5475=await readJson(_0x3c45bb,{});return asRecord(_0x2f5475);}export async function hasFile(_0x2cac33){const _0x3efe24=_0x24bd;try{const _0x49f51b=await stat(_0x2cac33);return _0x49f51b[_0x3efe24(0xfb)]();}catch{return![];}}export function toRuntimeRelative(_0x3b5098,_0x4c08e6){const _0x1d3a33=_0x24bd;return relative(_0x3b5098,_0x4c08e6)[_0x1d3a33(0xf5)+'ll']('\x5c','/');}function _0x4cc0(){const _0x10d41a=['package.','map','replaceA','string','version','name','10217340KvHOXf','filter','isFile','0.0.0','object','8915568bgQYkT','5751984RAewVC','2tpIHqi','parse','1056568nIxZiU','.plugin.','openclaw','9irrwjF','2905950ByWXRH','isDirect','trim','utf8','9051230WpKqTL','27hLKkuw','isArray','1399583ZzBofj','json'];_0x4cc0=function(){return _0x10d41a;};return _0x4cc0();}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wujie-shell/core",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "main": "dist/src/index.mjs",
6
6
  "exports": {
@@ -27,8 +27,8 @@
27
27
  "dependencies": {
28
28
  "get-port": "^7.2.0",
29
29
  "ws": "^8.20.0",
30
- "@wujie-shell/config": "0.1.2",
31
- "@wujie-shell/logger": "0.1.2"
30
+ "@wujie-shell/config": "0.1.3",
31
+ "@wujie-shell/logger": "0.1.3"
32
32
  },
33
33
  "scripts": {
34
34
  "build": "node ../../scripts/build-packages.mjs --package @wujie-shell/core"