@wujie-shell/core 0.1.5 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- const _0x52cc87=_0x2db8;(function(_0x1901fe,_0x4948c9){const _0x3612ef=_0x2db8,_0x298565=_0x1901fe();while(!![]){try{const _0x2eded6=parseInt(_0x3612ef(0x1f2))/0x1+-parseInt(_0x3612ef(0x259))/0x2+-parseInt(_0x3612ef(0x24d))/0x3+parseInt(_0x3612ef(0x1b6))/0x4*(-parseInt(_0x3612ef(0x175))/0x5)+parseInt(_0x3612ef(0x262))/0x6*(-parseInt(_0x3612ef(0x209))/0x7)+parseInt(_0x3612ef(0x268))/0x8*(-parseInt(_0x3612ef(0x1d8))/0x9)+parseInt(_0x3612ef(0x229))/0xa;if(_0x2eded6===_0x4948c9)break;else _0x298565['push'](_0x298565['shift']());}catch(_0x354e06){_0x298565['push'](_0x298565['shift']());}}}(_0x3e1c,0x9715d));import{existsSync}from'node:fs';import{createWriteStream}from'node:fs';import{chmod,cp,mkdir,rename,rm,symlink,writeFile}from'node:fs/promises';import{delimiter,dirname,join,relative,resolve}from'node:path';import{fileURLToPath}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'./utils.mjs';import{createRuntimeLogger,summarizeRuntimeManifest,summarizeShellConfig}from'./runtime-logger.mjs';const RUNTIME_DIR=_0x52cc87(0x184)+_0x52cc87(0x23a),MANIFEST_NAME=_0x52cc87(0x28a)+_0x52cc87(0x27e)+_0x52cc87(0x20a),NPM_INSTALL_TIMEOUT_MS=0xf*0x3c*0x3e8;export function resolveRuntimeRoot(_0x468b3f){if(process.env.WUJIE_SHELL_RUNTIME_ROOT)return resolve(process.env.WUJIE_SHELL_RUNTIME_ROOT);return resolve(_0x468b3f,RUNTIME_DIR);}export function resolveManifestPath(_0x44fb77){return join(_0x44fb77,MANIFEST_NAME);}export async function prepareRuntime(_0xce7b59,{syncOnly:syncOnly=![]}={}){const _0x3ac95d=_0x52cc87,_0x4c7ea6=resolveRuntimeRoot(_0xce7b59[_0x3ac95d(0x182)+_0x3ac95d(0x16a)]),_0x1d6b08=createRuntimeLogger(getConfigPaths(_0xce7b59),_0x3ac95d(0x22b)),_0x340d53=Date['now']();_0x1d6b08?.['info'](_0x3ac95d(0x1a6)+_0x3ac95d(0x211)+_0x3ac95d(0x15c),{'syncOnly':syncOnly,'runtimeRoot':_0x4c7ea6,'shellConfig':summarizeShellConfig(_0xce7b59)});try{const _0x4cc128=await ensureRuntimeBase(_0xce7b59,_0x4c7ea6,{'runtimeLogger':_0x1d6b08,'syncOnly':syncOnly});_0x1d6b08?.[_0x3ac95d(0x28e)](_0x3ac95d(0x211)+'manifest'+_0x3ac95d(0x1c0),{'manifestPath':resolveManifestPath(_0x4c7ea6),'manifest':summarizeRuntimeManifest(_0x4cc128)}),validateRuntimeNodeVersion(_0x4cc128,_0xce7b59),_0x1d6b08?.[_0x3ac95d(0x28e)]('runtime\x20'+_0x3ac95d(0x17f)+_0x3ac95d(0x181)+'idated',{'nodeVersion':_0x4cc128['nodeVers'+_0x3ac95d(0x269)]});if(syncOnly)validateRuntimeOpenClawVersion(_0x4cc128,_0xce7b59),_0x1d6b08?.[_0x3ac95d(0x28e)]('runtime\x20'+_0x3ac95d(0x14e)+_0x3ac95d(0x1b8)+_0x3ac95d(0x200)+'ed',{'openclawVersion':_0x4cc128[_0x3ac95d(0x14e)+'Version']});else{if(_0x4cc128[_0x3ac95d(0x14e)+_0x3ac95d(0x221)]!==_0xce7b59[_0x3ac95d(0x14e)][_0x3ac95d(0x14e)+_0x3ac95d(0x221)]){const _0x45f182=await loadRuntimeInfo(_0xce7b59[_0x3ac95d(0x182)+_0x3ac95d(0x16a)]);_0x1d6b08?.[_0x3ac95d(0x28e)](_0x3ac95d(0x14e)+_0x3ac95d(0x1a4)+_0x3ac95d(0x171)+'\x20started',{'fromVersion':_0x4cc128[_0x3ac95d(0x14e)+_0x3ac95d(0x221)]||'unknown','toVersion':_0xce7b59['openclaw'][_0x3ac95d(0x14e)+_0x3ac95d(0x221)]}),await installOpenClawPackage(_0x45f182,_0xce7b59[_0x3ac95d(0x14e)][_0x3ac95d(0x14e)+_0x3ac95d(0x221)]),_0x4cc128[_0x3ac95d(0x14e)+'Version']=_0xce7b59[_0x3ac95d(0x14e)][_0x3ac95d(0x14e)+_0x3ac95d(0x221)],_0x1d6b08?.['info'](_0x3ac95d(0x14e)+_0x3ac95d(0x1a4)+'\x20install'+_0x3ac95d(0x1ca)+'ed',{'openclawVersion':_0x4cc128[_0x3ac95d(0x14e)+'Version']});}}_0x4cc128['generate'+_0x3ac95d(0x213)]=new Date()[_0x3ac95d(0x216)+_0x3ac95d(0x1ff)](),_0x4cc128[_0x3ac95d(0x246)+_0x3ac95d(0x269)]=_0xce7b59[_0x3ac95d(0x14e)][_0x3ac95d(0x246)+_0x3ac95d(0x269)],_0x4cc128[_0x3ac95d(0x163)]={'appId':_0xce7b59[_0x3ac95d(0x24b)],'productName':_0xce7b59['productN'+'ame'],'dataDirName':_0xce7b59[_0x3ac95d(0x159)+'ame']};const _0xe2091c=Array[_0x3ac95d(0x231)](_0x4cc128[_0x3ac95d(0x1e3)])?_0x4cc128[_0x3ac95d(0x1e3)][_0x3ac95d(0x152)]:0x0;return await syncManifestPluginScope(_0xce7b59,_0x4c7ea6,_0x4cc128),_0x1d6b08?.[_0x3ac95d(0x28e)](_0x3ac95d(0x211)+_0x3ac95d(0x193)+'cope\x20syn'+_0x3ac95d(0x250),{'beforePluginCount':_0xe2091c,'afterPluginCount':Array[_0x3ac95d(0x231)](_0x4cc128['plugins'])?_0x4cc128[_0x3ac95d(0x1e3)][_0x3ac95d(0x152)]:0x0,'pluginSpecCount':Array['isArray'](_0x4cc128[_0x3ac95d(0x1e4)+_0x3ac95d(0x1fa)])?_0x4cc128[_0x3ac95d(0x1e4)+_0x3ac95d(0x1fa)][_0x3ac95d(0x152)]:0x0}),await syncProductPlugins(_0xce7b59,_0x4c7ea6,_0x4cc128),_0x1d6b08?.[_0x3ac95d(0x28e)](_0x3ac95d(0x1aa)+_0x3ac95d(0x21f)+_0x3ac95d(0x1a1),{'localPluginCount':_0xce7b59[_0x3ac95d(0x14e)]['resolved'+_0x3ac95d(0x1cb)+'ginPaths'][_0x3ac95d(0x152)],'pluginCount':Array[_0x3ac95d(0x231)](_0x4cc128['plugins'])?_0x4cc128[_0x3ac95d(0x1e3)][_0x3ac95d(0x152)]:0x0}),await syncProductAgents(_0xce7b59,_0x4c7ea6,_0x4cc128),_0x1d6b08?.[_0x3ac95d(0x28e)](_0x3ac95d(0x1aa)+_0x3ac95d(0x241)+'ynced',{'source':_0xce7b59[_0x3ac95d(0x14e)]['agentsDi'+'r'],'installPath':_0x4cc128[_0x3ac95d(0x27c)]?.['installP'+_0x3ac95d(0x151)]}),await syncProductSkills(_0xce7b59,_0x4c7ea6,_0x4cc128),_0x1d6b08?.['info'](_0x3ac95d(0x1aa)+_0x3ac95d(0x274)+'ynced',{'source':_0xce7b59['openclaw']['skillsDi'+'r'],'installPath':_0x4cc128[_0x3ac95d(0x233)]?.[_0x3ac95d(0x20d)+_0x3ac95d(0x151)]}),await syncRuntimeWrapper(_0xce7b59,_0x4c7ea6,_0x4cc128),_0x1d6b08?.[_0x3ac95d(0x28e)]('runtime\x20'+_0x3ac95d(0x26a)+'synced',{'wujieclawBin':_0x4cc128[_0x3ac95d(0x222)+_0x3ac95d(0x249)]}),await writeJson(resolveManifestPath(_0x4c7ea6),_0x4cc128),_0x1d6b08?.[_0x3ac95d(0x28e)](_0x3ac95d(0x211)+'manifest'+_0x3ac95d(0x173),{'manifestPath':resolveManifestPath(_0x4c7ea6),'manifest':summarizeRuntimeManifest(_0x4cc128),'durationMs':Date[_0x3ac95d(0x263)]()-_0x340d53}),await _0x1d6b08?.['flush'](),_0x4cc128;}catch(_0xa57810){_0x1d6b08?.[_0x3ac95d(0x1ee)]('prepare\x20'+_0x3ac95d(0x211)+_0x3ac95d(0x261),{'syncOnly':syncOnly,'runtimeRoot':_0x4c7ea6,'durationMs':Date[_0x3ac95d(0x263)]()-_0x340d53,'error':_0xa57810}),await _0x1d6b08?.[_0x3ac95d(0x204)]();throw _0xa57810;}}function _0x3e1c(){const _0x1a2be4=['time-too','\x20can\x20be\x20','\x20doctor\x20','runtime-','law\x20','ed\x20OpenC','every','info','openclaw','download','\x22==\x22\x22\x20se','ath','length','spec','\x20\x22$0\x22)\x22\x20','--no-aud','arm64','\x20returne','/opencla','dataDirN','config=','time]\x20in','started','\x20product','ut\x20after','m/bin/np','npm\x20pack','s/wujie-','base\x20bui','product','fix\x20alre','IPT_DIR=','../asset','nning\x20op','rname\x20--','d\x20to\x20','oot','ujie-log','npm-glob','npmCli','/node','rg/dist/','w.mjs','\x20install','headers','\x20written','ginPaths','5ynLdEm','env','--no-fun','er\x20writt','arch','log','&&\x20pwd)','nodejs.o','runtimeL','join','node\x20ver','filter','sion\x20val','projectR','utf8','.tmp/run','ATE_DIR%','\x20bin\x20was','base\x20alr','resolved','node','ame','CONFIG_P','NCLAW_ST','npm','HOME=\x22${','dataDir','CRIPT_DI','doctor','kill','plugin\x20s','NCLAW_HO','IR=$(CDP','\x20-z\x20\x22$WU','leted','dules/np','R=\x22${OPE','NCLAW_CO','add','#!/bin/s','PT_DIR/','local','ignore','resume','synced','d:\x20','ogger','\x20package','-peer-de','prepare\x20','set\x20\x22OPE','rg/','STATE_DI','product\x20','required','then','nodeExec','fix\x20comp','\x20not\x20fou','OpenClaw','object','Spec','eer','name','\x20-g','1912728hdLaZx','ules','\x20version','if\x20\x22%OPE','OME=','FILE%\x5c','ie-shell','--omit=d','execPath','PENCLAW_','\x20loaded','.node','atch:\x20ma',',\x20shell.','toString','ll\x20||\x20tr','octor\x20--','_modules','replace','bin','\x20complet','LocalPlu','configPa','stdout','NFIG_PAT','\x20set\x20\x22OP','runtimeS','dist','[wujie-s','Version\x20','extensio','npm\x20root','stderr','replaceA','18EMDJft','\x22%SCRIPT','lib/node','Run\x20\x22wuj','ATE_DIR:','tar','Bin','eady\x20cur','OPENCLAW','allowMis','ME%\x22==\x22\x22','plugins','pluginSp','path:\x20','statusCo','mismatch','%USERPRO','\x20signal=','trim','-xJf','_DIR%','hell:run','error','WorkingD','skillsDi','\x20did\x20not','1131930DyYYZw','agentsDi','\x20\x20\x22$SCRI','/npm','string','.tools','SIGTERM','>/dev/nu','ecs','parse','fix\x20mark','npm-cli.','l\x20prepar','ing','\x20validat','\x20runtime','versions','tateDir','flush','cwd','%~dp0\x22','runtimeR','rent','7fhMDDt','.json','go.mjs','$HOME/','installP','\x20timed\x20o','\x20failed\x20','not\x20foun','runtime\x20','fix\x20star','dAt','npm-cach','d\x20an\x20inv','toISOStr','w.json\x22','map','slice','\x22\x20so\x20the','st=','node_mod','set\x20\x22SCR','OGO\x22\x20];\x20','plugins\x20','Name','Version','wujiecla','ENCLAW_H','\x22\x20at\x20','d\x20for\x20lo','unknown','stalling','https://','22598130MOstBO','tar.xz','runtime','has','--\x20\x22$(di','json','alid\x20pay','1\x20]\x20&&\x20[','isArray','w.cmd','skills','pipe','data','version','\x20paths','missing\x20','platform','time','label','package','.opencla','lib','Claw','zip','agents\x20s','extract\x20','if\x20[\x20-t\x20','export\x20O','ncies','nodeVers','install','\x5copencla','wBin','\x20is\x20miss','appId','SCRIPT_D','616977WtstSm','--fix','node-v','ced','sion\x20mis','win32','ATH=\x20cd\x20','with\x20the','.npmjs.o','\x20depende',':\x20manife','filename','1838870xrnYOx','/node_mo','o.mjs\x22\x202','close','LAW_STAT','ld\x20start','w-extrac','source','failed','6121068PqBiZv','now','m-cli.js','\x20prepare','x64','.cache','597776PBVmoD','ion','wrapper\x20','null','wujie-lo','sion.','ATH:-','H%\x22==\x22\x22\x20',';\x20run\x20wu','local:','-extract','agentSco','skills\x20s','pluginId','\x20create\x20','t\x20\x22OPENC','\x20configu','nd\x20after','JIE_NO_L','rebuilt\x20','agents','catch','manifest','utable','-doctor.','time]\x20do','location','ime\x20buil','ent','--json','registry'];_0x3e1c=function(){return _0x1a2be4;};return _0x3e1c();}async function syncRuntimeWrapper(_0x41b615,_0x11398d,_0x195eaa){const _0xb5180b=_0x52cc87,_0x4f4537=join(_0x11398d,'bin',_0xb5180b(0x222)+'w'),_0x4aa6de=join(_0x11398d,'bin','wujiecla'+_0xb5180b(0x232)),_0x388f5a=normalizeRuntimeRelativePath(relative(dirname(_0x4f4537),resolve(_0x11398d,_0x195eaa[_0xb5180b(0x1ad)+_0xb5180b(0x27f)]))),_0xf62dc7=normalizeRuntimeRelativePath(relative(dirname(_0x4f4537),resolve(_0x11398d,_0x195eaa[_0xb5180b(0x14e)+'Bin']))),_0xc72fc5=_0xb5180b(0x20c)+_0x41b615[_0xb5180b(0x159)+'ame'],_0x548ce0=_0xb5180b(0x1e8)+_0xb5180b(0x1bb)+_0x41b615[_0xb5180b(0x159)+_0xb5180b(0x18a)];await mkdir(dirname(_0x4f4537),{'recursive':!![]});const _0x11d7b6=fileURLToPath(new URL(_0xb5180b(0x166)+_0xb5180b(0x161)+'logo.mjs',import.meta.url)),_0x16159f=join(_0x11398d,_0xb5180b(0x1c9),_0xb5180b(0x26c)+_0xb5180b(0x20b));await cp(_0x11d7b6,_0x16159f),await writeFile(_0x4f4537,[_0xb5180b(0x19c)+'h',_0xb5180b(0x244)+_0xb5180b(0x1bf)+_0xb5180b(0x18e)+_0xb5180b(0x1e0)+'_HOME:-'+_0xc72fc5+'}\x22',_0xb5180b(0x244)+'PENCLAW_'+_0xb5180b(0x1a9)+_0xb5180b(0x199)+'NCLAW_ST'+_0xb5180b(0x1dc)+'-'+_0xc72fc5+'}\x22',_0xb5180b(0x244)+_0xb5180b(0x1bf)+_0xb5180b(0x18b)+'ATH=\x22${O'+_0xb5180b(0x1bf)+'CONFIG_P'+_0xb5180b(0x26e)+_0xc72fc5+(_0xb5180b(0x158)+'w.json}\x22'),_0xb5180b(0x24c)+_0xb5180b(0x195)+_0xb5180b(0x253)+_0xb5180b(0x22d)+_0xb5180b(0x168)+_0xb5180b(0x154)+_0xb5180b(0x17b),_0xb5180b(0x243)+_0xb5180b(0x230)+_0xb5180b(0x196)+_0xb5180b(0x27a)+_0xb5180b(0x21e)+_0xb5180b(0x1ac),_0xb5180b(0x1f4)+'PT_DIR/'+_0x388f5a+('\x22\x20\x22$SCRI'+'PT_DIR/w'+_0xb5180b(0x16b)+_0xb5180b(0x25b)+_0xb5180b(0x1f9)+_0xb5180b(0x1c5)+'ue'),'fi','exec\x20\x22$S'+_0xb5180b(0x190)+'R/'+_0x388f5a+('\x22\x20\x22$SCRI'+_0xb5180b(0x19d))+_0xf62dc7+'\x22\x20\x22$@\x22','']['join']('\x0a'),_0xb5180b(0x183)),await chmod(_0x4f4537,0x1ed),await writeFile(_0x4aa6de,['@echo\x20of'+'f',_0xb5180b(0x1b9)+_0xb5180b(0x194)+_0xb5180b(0x1e2)+_0xb5180b(0x1cf)+_0xb5180b(0x223)+_0xb5180b(0x1ba)+_0x548ce0+'\x22',_0xb5180b(0x1b9)+_0xb5180b(0x18c)+_0xb5180b(0x185)+_0xb5180b(0x150)+_0xb5180b(0x277)+_0xb5180b(0x25d)+'E_DIR='+_0x548ce0+'\x22',_0xb5180b(0x1b9)+_0xb5180b(0x19a)+'NFIG_PAT'+_0xb5180b(0x26f)+_0xb5180b(0x1a7)+'NCLAW_CO'+_0xb5180b(0x1ce)+'H='+_0x548ce0+(_0xb5180b(0x248)+_0xb5180b(0x217)),_0xb5180b(0x21d)+_0xb5180b(0x165)+_0xb5180b(0x206),_0xb5180b(0x1d9)+_0xb5180b(0x1ec)+toWindowsPath(_0x388f5a)+('\x22\x20\x22%SCRI'+'PT_DIR%')+toWindowsPath(_0xf62dc7)+'\x22\x20%*','']['join']('\x0d\x0a'),_0xb5180b(0x183)),_0x195eaa[_0xb5180b(0x222)+'wBin']=toRuntimeRelative(_0x11398d,process[_0xb5180b(0x239)]===_0xb5180b(0x252)?_0x4aa6de:_0x4f4537);}function normalizeRuntimeRelativePath(_0x41f10d){const _0x51d45f=_0x52cc87;return _0x41f10d[_0x51d45f(0x1d7)+'ll']('\x5c','/');}function toWindowsPath(_0x5ebee3){return _0x5ebee3['replaceA'+'ll']('/','\x5c');}function validateRuntimeNodeVersion(_0x3eb7b7,_0x27ae92){const _0x14a2f4=_0x52cc87;if(_0x3eb7b7[_0x14a2f4(0x246)+_0x14a2f4(0x269)]===_0x27ae92['openclaw'][_0x14a2f4(0x246)+_0x14a2f4(0x269)])return;throw new Error(_0x14a2f4(0x211)+_0x14a2f4(0x246)+'ion\x20mism'+_0x14a2f4(0x1c2)+'nifest='+(_0x3eb7b7['nodeVers'+_0x14a2f4(0x269)]||'unknown')+(_0x14a2f4(0x1c3)+_0x14a2f4(0x15a))+_0x27ae92['openclaw'][_0x14a2f4(0x246)+_0x14a2f4(0x269)]+'.\x20'+(_0x14a2f4(0x1db)+_0x14a2f4(0x1bc)+_0x14a2f4(0x265)+'\x22\x20so\x20the'+_0x14a2f4(0x15d)+_0x14a2f4(0x201)+_0x14a2f4(0x288)+_0x14a2f4(0x27b)+_0x14a2f4(0x254)+_0x14a2f4(0x278)+'red\x20Node'+'\x20version'+'.'));}function validateRuntimeOpenClawVersion(_0x20a3c1,_0x333e58){const _0x28c84f=_0x52cc87;if(_0x20a3c1[_0x28c84f(0x14e)+_0x28c84f(0x221)]===_0x333e58[_0x28c84f(0x14e)][_0x28c84f(0x14e)+_0x28c84f(0x221)])return;throw new Error('runtime\x20'+_0x28c84f(0x14e)+_0x28c84f(0x1d3)+_0x28c84f(0x1e7)+_0x28c84f(0x257)+_0x28c84f(0x21b)+(_0x20a3c1[_0x28c84f(0x14e)+_0x28c84f(0x221)]||_0x28c84f(0x226))+(_0x28c84f(0x1c3)+_0x28c84f(0x15a))+_0x333e58[_0x28c84f(0x14e)]['openclaw'+_0x28c84f(0x221)]+'.\x20'+(_0x28c84f(0x1db)+_0x28c84f(0x1bc)+'\x20prepare'+_0x28c84f(0x21a)+_0x28c84f(0x201)+'\x20can\x20ins'+'tall\x20the'+_0x28c84f(0x278)+'red\x20Open'+'Claw\x20ver'+_0x28c84f(0x26d)));}function parseNpmPackJson(_0x424c83){const _0x2c1b3d=_0x52cc87,_0x1c6103=_0x424c83[_0x2c1b3d(0x1ea)](),_0x31c6bc=_0x1c6103['indexOf']('[');if(_0x31c6bc<0x0)throw new Error('npm\x20pack'+_0x2c1b3d(0x1f1)+'\x20return\x20'+'JSON:\x20'+_0x1c6103['slice'](0x0,0x1f4));const _0x1cebc3=JSON[_0x2c1b3d(0x1fb)](_0x1c6103[_0x2c1b3d(0x219)](_0x31c6bc)),_0x388b1a=Array[_0x2c1b3d(0x231)](_0x1cebc3)?_0x1cebc3[0x0]:_0x1cebc3;if(!_0x388b1a||typeof _0x388b1a!==_0x2c1b3d(0x1b1))throw new Error(_0x2c1b3d(0x160)+_0x2c1b3d(0x157)+_0x2c1b3d(0x215)+_0x2c1b3d(0x22f)+'load:\x20'+_0x1c6103[_0x2c1b3d(0x219)](0x0,0x1f4));return _0x388b1a;}async function runProcess(_0x233a2a,_0x5384ff,_0x205022={}){const _0x2cfd6f=_0x52cc87,_0x5993ee=_0x205022[_0x2cfd6f(0x23b)]||[_0x233a2a,..._0x5384ff][_0x2cfd6f(0x17e)]('\x20'),_0x316f24=_0x205022['timeoutM'+'s']??NPM_INSTALL_TIMEOUT_MS,_0x5cae99=spawn(_0x233a2a,_0x5384ff,{'cwd':_0x205022[_0x2cfd6f(0x205)],'env':_0x205022[_0x2cfd6f(0x176)],'stdio':[_0x2cfd6f(0x19f),_0x2cfd6f(0x234),_0x2cfd6f(0x234)]});return await new Promise((_0x193d19,_0x5ce5cf)=>{const _0x2e7ac4=_0x2cfd6f;let _0x14039d='',_0x58276f='',_0x1e534b=![];const _0x325df8=setTimeout(()=>{const _0x361eee=_0x2db8;if(_0x1e534b)return;_0x1e534b=!![],_0x5cae99[_0x361eee(0x192)](_0x361eee(0x1f8)),_0x5ce5cf(new Error(_0x5993ee+('\x20timed\x20o'+_0x361eee(0x15e)+'\x20')+_0x316f24+'ms'));},_0x316f24);_0x5cae99[_0x2e7ac4(0x1cd)]['on'](_0x2e7ac4(0x235),_0x5e7b5c=>{const _0x4784bf=_0x2e7ac4;_0x14039d+=_0x5e7b5c[_0x4784bf(0x1c4)]();}),_0x5cae99[_0x2e7ac4(0x1d6)]['on'](_0x2e7ac4(0x235),_0x2f5688=>{const _0x110d0d=_0x2e7ac4;_0x58276f+=_0x2f5688[_0x110d0d(0x1c4)]();}),_0x5cae99['on']('error',_0x452567=>{if(_0x1e534b)return;_0x1e534b=!![],clearTimeout(_0x325df8),_0x5ce5cf(_0x452567);}),_0x5cae99['on'](_0x2e7ac4(0x25c),(_0xb02c0a,_0x3e285b)=>{const _0x5b0a44=_0x2e7ac4;if(_0x1e534b)return;_0x1e534b=!![],clearTimeout(_0x325df8);if(_0xb02c0a===0x0){_0x193d19({'stdout':_0x14039d,'stderr':_0x58276f});return;}_0x5ce5cf(new Error(_0x5993ee+(_0x5b0a44(0x20f)+'with\x20cod'+'e=')+(_0xb02c0a??'null')+_0x5b0a44(0x1e9)+(_0x3e285b??_0x5b0a44(0x26b))+'\x0a'+(''+(_0x58276f||_0x14039d))[_0x5b0a44(0x1ea)]()));});});}async function installOpenClawPackage(_0x44c894,_0x49ee24){const _0x1bb11a=_0x52cc87,_0x2e0ce0=join(_0x44c894['runtimeR'+_0x1bb11a(0x16a)],_0x1bb11a(0x267)),_0x37c78b=join(_0x44c894[_0x1bb11a(0x207)+'oot'],_0x1bb11a(0x23d)+_0x1bb11a(0x25f)+'t');await mkdir(_0x2e0ce0,{'recursive':!![]}),await rm(_0x37c78b,{'recursive':!![],'force':!![]}),await mkdir(_0x37c78b,{'recursive':!![]});const _0x27b4e3=await createRuntimeEnv(_0x44c894),_0x234d2f=_0x1bb11a(0x14e)+'@'+_0x49ee24;console[_0x1bb11a(0x17a)](_0x1bb11a(0x1d2)+_0x1bb11a(0x1ed)+_0x1bb11a(0x15b)+_0x1bb11a(0x227)+'\x20'+_0x234d2f);const _0x4fa388=await runProcess(_0x44c894['nodeExec'+_0x1bb11a(0x27f)],[_0x44c894[_0x1bb11a(0x16d)],'pack',_0x234d2f,_0x1bb11a(0x285)],{'cwd':_0x2e0ce0,'env':_0x27b4e3,'label':_0x1bb11a(0x160)+'\x20'+_0x234d2f}),_0x506408=parseNpmPackJson(_0x4fa388['stdout']);if(_0x506408[_0x1bb11a(0x236)]!==_0x49ee24)throw new Error('Configur'+_0x1bb11a(0x28c)+_0x1bb11a(0x28b)+_0x49ee24+('\x20resolve'+_0x1bb11a(0x169))+_0x506408[_0x1bb11a(0x236)]);const _0x2c8005=resolve(_0x2e0ce0,_0x506408[_0x1bb11a(0x258)]);if(!existsSync(_0x2c8005))throw new Error(_0x1bb11a(0x160)+_0x1bb11a(0x1f1)+_0x1bb11a(0x276)+'tarball:'+'\x20'+_0x2c8005);await runProcess('tar',['-xzf',_0x2c8005,'-C',_0x37c78b],{'label':'extract\x20'+_0x506408['filename']}),await rm(_0x44c894[_0x1bb11a(0x14e)+'WorkingD'+'ir'],{'recursive':!![],'force':!![]}),await rename(join(_0x37c78b,_0x1bb11a(0x23c)),_0x44c894[_0x1bb11a(0x14e)+'WorkingD'+'ir']),await rm(_0x37c78b,{'recursive':!![],'force':!![]}),await runProcess(_0x44c894[_0x1bb11a(0x1ad)+_0x1bb11a(0x27f)],[_0x44c894[_0x1bb11a(0x16d)],_0x1bb11a(0x247),_0x1bb11a(0x1bd)+'ev','--omit=p'+_0x1bb11a(0x1b3),_0x1bb11a(0x155)+'it',_0x1bb11a(0x177)+'d','--legacy'+_0x1bb11a(0x1a5)+'ps'],{'cwd':_0x44c894[_0x1bb11a(0x14e)+_0x1bb11a(0x1ef)+'ir'],'env':_0x27b4e3,'label':'npm\x20inst'+'all\x20'+_0x234d2f+(_0x1bb11a(0x201)+_0x1bb11a(0x256)+_0x1bb11a(0x245))});if(!existsSync(_0x44c894['openclaw'+'Bin']))throw new Error(_0x1bb11a(0x1b0)+_0x1bb11a(0x186)+_0x1bb11a(0x1af)+_0x1bb11a(0x279)+'\x20install'+':\x20'+_0x44c894['openclaw'+_0x1bb11a(0x1de)]);}async function ensureRuntimeBase(_0x53a3bf,_0x5b6f99,_0x299d75={}){const _0x24ca0b=_0x52cc87;await mkdir(_0x5b6f99,{'recursive':!![]});let _0x247c9a=await readRuntimeManifest(_0x5b6f99);const _0x1d9a4d=_0x53a3bf['openclaw'][_0x24ca0b(0x246)+_0x24ca0b(0x269)],_0x28dbd8=_0x53a3bf[_0x24ca0b(0x14e)]['openclaw'+_0x24ca0b(0x221)],_0x1780eb=existsSync(resolveManifestPath(_0x5b6f99)),_0x41c11c=runtimeHasRequiredPaths(_0x5b6f99,_0x247c9a),_0x11ca96=_0x247c9a[_0x24ca0b(0x246)+_0x24ca0b(0x269)]===_0x1d9a4d;!_0x1780eb||!_0x41c11c||!_0x11ca96?(_0x299d75[_0x24ca0b(0x17d)+'ogger']?.[_0x24ca0b(0x28e)]('runtime\x20'+_0x24ca0b(0x162)+_0x24ca0b(0x25e)+'ed',{'runtimeRoot':_0x5b6f99,'reason':!_0x1780eb?_0x24ca0b(0x238)+_0x24ca0b(0x27e):!_0x41c11c?_0x24ca0b(0x238)+_0x24ca0b(0x1ab)+_0x24ca0b(0x201)+_0x24ca0b(0x237):_0x24ca0b(0x17f)+_0x24ca0b(0x251)+'match','syncOnly':_0x299d75['syncOnly']}),_0x247c9a=await buildRuntimeBase(_0x53a3bf,_0x5b6f99,_0x247c9a),_0x299d75[_0x24ca0b(0x17d)+_0x24ca0b(0x1a3)]?.[_0x24ca0b(0x28e)](_0x24ca0b(0x211)+_0x24ca0b(0x162)+'ld\x20compl'+'eted',{'manifest':summarizeRuntimeManifest(_0x247c9a)})):_0x299d75[_0x24ca0b(0x17d)+_0x24ca0b(0x1a3)]?.[_0x24ca0b(0x28e)](_0x24ca0b(0x211)+_0x24ca0b(0x187)+_0x24ca0b(0x1df)+_0x24ca0b(0x208),{'manifest':summarizeRuntimeManifest(_0x247c9a)});if(!existsSync(resolve(_0x5b6f99,_0x247c9a[_0x24ca0b(0x14e)+_0x24ca0b(0x1de)]))){const _0x2d2d0a=createRuntimeInfoFromManifest(_0x5b6f99,_0x247c9a,{'allowMissingOpenClaw':!![]});await installOpenClawPackage(_0x2d2d0a,_0x28dbd8),_0x247c9a[_0x24ca0b(0x14e)+_0x24ca0b(0x221)]=_0x28dbd8;}return _0x247c9a;}function runtimeHasRequiredPaths(_0x2bccfe,_0x21cdd4){const _0x3f346f=_0x52cc87;return[_0x3f346f(0x1ad)+_0x3f346f(0x27f),'npmCli',_0x3f346f(0x14e)+_0x3f346f(0x1ef)+'ir',_0x3f346f(0x14e)+_0x3f346f(0x1de)][_0x3f346f(0x28d)](_0x222fa4=>typeof _0x21cdd4[_0x222fa4]===_0x3f346f(0x1f6)&&_0x21cdd4[_0x222fa4]['trim']())&&['nodeExec'+_0x3f346f(0x27f),_0x3f346f(0x16d)][_0x3f346f(0x28d)](_0x50425a=>existsSync(resolve(_0x2bccfe,_0x21cdd4[_0x50425a])));}async function buildRuntimeBase(_0x2d1d4a,_0x2d8006,_0x44c8e5={}){const _0x686cab=_0x52cc87,_0x477297=join(_0x2d8006,_0x686cab(0x189));await ensureRuntimeNode(_0x2d1d4a,_0x477297);const _0x2fd614={..._0x44c8e5,'generatedAt':new Date()[_0x686cab(0x216)+'ing'](),'nodeVersion':_0x2d1d4a[_0x686cab(0x14e)][_0x686cab(0x246)+_0x686cab(0x269)],'openclawVersion':_0x44c8e5[_0x686cab(0x14e)+'Version']||'','platform':process['platform'],'arch':process[_0x686cab(0x179)],'nodeExecutable':'node/bin'+_0x686cab(0x16e),'npmCli':'node/lib'+_0x686cab(0x25a)+_0x686cab(0x198)+_0x686cab(0x15f)+_0x686cab(0x264),'openclawWorkingDir':_0x686cab(0x14e),'openclawBin':_0x686cab(0x14e)+_0x686cab(0x158)+_0x686cab(0x170)};return await writeJson(resolveManifestPath(_0x2d8006),_0x2fd614),_0x2fd614;}async function ensureRuntimeNode(_0x1cec61,_0x2f51ec){const _0x2bb09f=_0x52cc87,_0x1b9055=_0x1cec61[_0x2bb09f(0x14e)][_0x2bb09f(0x246)+_0x2bb09f(0x269)],_0x2eebbb=join(_0x2f51ec,_0x2bb09f(0x1c9),_0x2bb09f(0x189)),_0x380cbb=join(_0x2f51ec,_0x2bb09f(0x23e),'node_mod'+_0x2bb09f(0x1b7),_0x2bb09f(0x18d),'bin',_0x2bb09f(0x1fd)+'js');if(existsSync(_0x2eebbb)&&existsSync(_0x380cbb)&&await getNodeVersion(_0x2eebbb)===_0x1b9055)return;await rm(_0x2f51ec,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96});if(process[_0x2bb09f(0x202)][_0x2bb09f(0x189)]===_0x1b9055){await linkCurrentNodeRuntime(_0x2f51ec);return;}await downloadNodeRuntime(_0x1b9055,_0x2f51ec);}async function getNodeVersion(_0xb51c4e){const _0x5a082f=_0x52cc87;try{const _0x2ec5ba=await runProcess(_0xb51c4e,['-p','process.'+'versions'+_0x5a082f(0x1c1)],{'label':_0xb51c4e+'\x20version','timeoutMs':0x7530});return _0x2ec5ba[_0x5a082f(0x1cd)][_0x5a082f(0x1ea)]();}catch{return'';}}async function linkCurrentNodeRuntime(_0x1f1590){const _0x3eafd7=_0x52cc87,_0x5041a3=process[_0x3eafd7(0x1be)],_0x50b302=resolve(dirname(_0x5041a3),'..'),_0x1009a1=resolve(_0x50b302,_0x3eafd7(0x1da)+_0x3eafd7(0x1c7)+_0x3eafd7(0x1f5)),_0x22cf49=join(_0x1f1590,'bin',_0x3eafd7(0x189)),_0x3c95ef=join(_0x1f1590,_0x3eafd7(0x23e),_0x3eafd7(0x21c)+'ules','npm');await mkdir(dirname(_0x22cf49),{'recursive':!![]}),await mkdir(dirname(_0x3c95ef),{'recursive':!![]}),await symlink(_0x5041a3,_0x22cf49),existsSync(_0x1009a1)?await symlink(_0x1009a1,_0x3c95ef):await symlink(await resolveNpmRoot(),_0x3c95ef);}async function resolveNpmRoot(){const _0x58360b=_0x52cc87,_0x3763d8=await runProcess(_0x58360b(0x18d),['root','-g'],{'label':_0x58360b(0x1d5)+_0x58360b(0x1b5),'timeoutMs':0x7530}),_0x41ee2a=join(_0x3763d8['stdout'][_0x58360b(0x1ea)](),_0x58360b(0x18d));if(!existsSync(join(_0x41ee2a,'bin',_0x58360b(0x1fd)+'js')))throw new Error(_0x58360b(0x160)+'age\x20was\x20'+_0x58360b(0x210)+_0x58360b(0x225)+'cal\x20runt'+_0x58360b(0x283)+_0x58360b(0x1a2)+_0x41ee2a);return _0x41ee2a;}async function downloadNodeRuntime(_0x48e32a,_0x4e9bd5){const _0x11bc22=_0x52cc87,_0x173292=process['platform']===_0x11bc22(0x252)?'win':process[_0x11bc22(0x239)],_0x14a4e3=process[_0x11bc22(0x179)]===_0x11bc22(0x266)?_0x11bc22(0x266):process[_0x11bc22(0x179)]===_0x11bc22(0x156)?_0x11bc22(0x156):process['arch'],_0x16dbbb=process[_0x11bc22(0x239)]===_0x11bc22(0x252)?_0x11bc22(0x240):_0x11bc22(0x22a),_0x5c3a12=_0x11bc22(0x24f)+_0x48e32a+'-'+_0x173292+'-'+_0x14a4e3,_0x5eb008=_0x5c3a12+'.'+_0x16dbbb,_0x4b6bde=join(dirname(_0x4e9bd5),_0x11bc22(0x267)),_0x31ff99=join(_0x4b6bde,_0x5eb008),_0x3a0554=join(_0x4b6bde,_0x5c3a12+(_0x11bc22(0x272)+'-')+process['pid']+'-'+Date['now']()),_0x29d6e3=_0x11bc22(0x228)+_0x11bc22(0x17c)+_0x11bc22(0x16f)+'v'+_0x48e32a+'/'+_0x5eb008;await mkdir(_0x4b6bde,{'recursive':!![]}),!existsSync(_0x31ff99)&&(console[_0x11bc22(0x17a)](_0x11bc22(0x1d2)+'hell:run'+_0x11bc22(0x281)+'wnloadin'+'g\x20'+_0x29d6e3),await downloadFile(_0x29d6e3,_0x31ff99)),await rm(_0x3a0554,{'recursive':!![],'force':!![]}),await mkdir(_0x3a0554,{'recursive':!![]}),process[_0x11bc22(0x239)]===_0x11bc22(0x252)?await runProcess('unzip',['-q',_0x31ff99,'-d',_0x3a0554],{'label':_0x11bc22(0x242)+_0x5eb008}):await runProcess(_0x11bc22(0x1dd),[_0x11bc22(0x1eb),_0x31ff99,'-C',_0x3a0554],{'label':_0x11bc22(0x242)+_0x5eb008}),await rename(join(_0x3a0554,_0x5c3a12),_0x4e9bd5),await rm(_0x3a0554,{'recursive':!![],'force':!![]});}async function downloadFile(_0x439450,_0x223654){await mkdir(dirname(_0x223654),{'recursive':!![]});const _0x329ed8=await new Promise((_0x1a13b4,_0x442eb9)=>{const _0x2d6799=_0x2db8;get(_0x439450,_0x541b2d=>{const _0x754375=_0x2db8;if(_0x541b2d['statusCo'+'de']>=0x12c&&_0x541b2d[_0x754375(0x1e6)+'de']<0x190&&_0x541b2d[_0x754375(0x172)][_0x754375(0x282)]){_0x541b2d[_0x754375(0x1a0)](),downloadFile(new URL(_0x541b2d['headers']['location'],_0x439450)['href'],_0x223654)['then'](()=>_0x1a13b4(null))[_0x754375(0x27d)](_0x442eb9);return;}if(_0x541b2d[_0x754375(0x1e6)+'de']!==0xc8){_0x541b2d[_0x754375(0x1a0)](),_0x442eb9(new Error(_0x754375(0x14f)+_0x754375(0x20f)+_0x541b2d[_0x754375(0x1e6)+'de']+':\x20'+_0x439450));return;}_0x1a13b4(_0x541b2d);})['on'](_0x2d6799(0x1ee),_0x442eb9);});_0x329ed8&&await pipeline(_0x329ed8,createWriteStream(_0x223654));}export async function ensureOpenClawDoctorFixed(_0x3008aa,_0x401bbf={}){const _0x5124b6=_0x52cc87,_0x43e6b5=await loadRuntimeInfo(_0x3008aa['projectR'+_0x5124b6(0x16a)]),_0x56a9cc=getConfigPaths(_0x3008aa),_0x417bfa=join(_0x56a9cc[_0x5124b6(0x1d0)+_0x5124b6(0x203)],_0x5124b6(0x14e)+_0x5124b6(0x280)+_0x5124b6(0x22e)),_0x58fe56=await readJson(_0x417bfa,{});if(_0x58fe56['openclaw'+_0x5124b6(0x221)]===_0x43e6b5[_0x5124b6(0x14e)+_0x5124b6(0x221)])return _0x401bbf[_0x5124b6(0x17d)+_0x5124b6(0x1a3)]?.[_0x5124b6(0x28e)]('openclaw'+_0x5124b6(0x289)+_0x5124b6(0x164)+'ady\x20curr'+_0x5124b6(0x284),{'openclawVersion':_0x43e6b5[_0x5124b6(0x14e)+_0x5124b6(0x221)],'markerPath':_0x417bfa}),{'ran':![],'openclawVersion':_0x43e6b5[_0x5124b6(0x14e)+'Version'],'markerPath':_0x417bfa};return await runOpenClawDoctorFix(_0x3008aa,_0x43e6b5,{'fromVersion':_0x58fe56['openclaw'+_0x5124b6(0x221)]||_0x5124b6(0x226),'toVersion':_0x43e6b5[_0x5124b6(0x14e)+_0x5124b6(0x221)],'markerPath':_0x417bfa,'runtimeLogger':_0x401bbf['runtimeL'+_0x5124b6(0x1a3)]}),{'ran':!![],'openclawVersion':_0x43e6b5[_0x5124b6(0x14e)+_0x5124b6(0x221)],'markerPath':_0x417bfa};}async function runOpenClawDoctorFix(_0x517d9d,_0x51b24e,{fromVersion:_0x1d5ebc,toVersion:_0xa19acb,markerPath:markerPath='',runtimeLogger:_0x5911ba}={}){const _0x5e58f3=_0x52cc87;_0x5911ba?.['info'](_0x5e58f3(0x14e)+_0x5e58f3(0x289)+_0x5e58f3(0x212)+'ted',{'fromVersion':_0x1d5ebc,'toVersion':_0xa19acb});const _0x407a61=await createRuntimeEnv(_0x51b24e,{'OPENCLAW_HOME':_0x517d9d[_0x5e58f3(0x18f)],'OPENCLAW_STATE_DIR':_0x517d9d[_0x5e58f3(0x18f)],'OPENCLAW_CONFIG_PATH':getConfigPaths(_0x517d9d)[_0x5e58f3(0x1cc)+'th']});console[_0x5e58f3(0x17a)](_0x5e58f3(0x1d2)+_0x5e58f3(0x1ed)+'time]\x20ru'+_0x5e58f3(0x167)+'enclaw\x20d'+_0x5e58f3(0x1c6)+'fix');const _0x38c201=await runProcess(_0x51b24e[_0x5e58f3(0x1ad)+_0x5e58f3(0x27f)],[_0x51b24e[_0x5e58f3(0x14e)+_0x5e58f3(0x1de)],_0x5e58f3(0x191),_0x5e58f3(0x24e)],{'cwd':_0x51b24e[_0x5e58f3(0x14e)+_0x5e58f3(0x1ef)+'ir'],'env':_0x407a61,'label':_0x5e58f3(0x14e)+_0x5e58f3(0x289)+_0x5e58f3(0x24e),'timeoutMs':0x1d4c0});_0x5911ba?.[_0x5e58f3(0x28e)](_0x5e58f3(0x14e)+_0x5e58f3(0x289)+_0x5e58f3(0x1ae)+_0x5e58f3(0x197),{'fromVersion':_0x1d5ebc,'toVersion':_0xa19acb,'stdout':_0x38c201[_0x5e58f3(0x1cd)][_0x5e58f3(0x1ea)]()[_0x5e58f3(0x219)](-0xfa0),'stderr':_0x38c201[_0x5e58f3(0x1d6)][_0x5e58f3(0x1ea)]()[_0x5e58f3(0x219)](-0xfa0)}),markerPath&&(await writeJson(markerPath,{'openclawVersion':_0x51b24e[_0x5e58f3(0x14e)+'Version'],'fixedAt':new Date()[_0x5e58f3(0x216)+_0x5e58f3(0x1ff)]()}),_0x5911ba?.['info'](_0x5e58f3(0x14e)+_0x5e58f3(0x289)+_0x5e58f3(0x1fc)+_0x5e58f3(0x178)+'en',{'markerPath':markerPath,'openclawVersion':_0x51b24e['openclaw'+_0x5e58f3(0x221)]}));}export async function readRuntimeManifest(_0x136611){return await readJson(resolveManifestPath(_0x136611),{});}export async function loadRuntimeInfo(_0x690016){const _0x270b04=resolveRuntimeRoot(_0x690016),_0x526504=await readRuntimeManifest(_0x270b04);return createRuntimeInfoFromManifest(_0x270b04,_0x526504);}function createRuntimeInfoFromManifest(_0x1e426e,_0x325c19,_0x3a3415={}){const _0x51926b=_0x52cc87;for(const _0x11a71c of[_0x51926b(0x1ad)+_0x51926b(0x27f),_0x51926b(0x16d),'openclaw'+_0x51926b(0x1ef)+'ir',_0x51926b(0x14e)+'Bin']){if(typeof _0x325c19[_0x11a71c]!==_0x51926b(0x1f6)||!_0x325c19[_0x11a71c][_0x51926b(0x1ea)]())throw new Error(_0x51926b(0x211)+_0x51926b(0x27e)+_0x51926b(0x24a)+'ing\x20\x22'+_0x11a71c+_0x51926b(0x224)+resolveManifestPath(_0x1e426e)+(_0x51926b(0x270)+'jie-shel'+_0x51926b(0x1fe)+'e'));}const _0x2c7ec2=resolve(_0x1e426e,_0x325c19[_0x51926b(0x1ad)+_0x51926b(0x27f)]),_0x511d99=resolve(_0x1e426e,_0x325c19[_0x51926b(0x16d)]),_0x35f5f0=resolve(_0x1e426e,_0x325c19['openclaw'+_0x51926b(0x1ef)+'ir']),_0x368ad1=resolve(_0x1e426e,_0x325c19[_0x51926b(0x14e)+'Bin']),_0x241e26=Array[_0x51926b(0x231)](_0x325c19['plugins'])?_0x325c19[_0x51926b(0x1e3)][_0x51926b(0x218)](_0xa9ebca=>({..._0xa9ebca,'installPath':resolve(_0x1e426e,_0xa9ebca['installP'+_0x51926b(0x151)])})):[],_0x33fd25=_0x3a3415[_0x51926b(0x1e1)+'singOpen'+_0x51926b(0x23f)]?[_0x2c7ec2,_0x511d99]:[_0x2c7ec2,_0x511d99,_0x35f5f0,_0x368ad1];for(const _0x1a6086 of _0x33fd25){if(!existsSync(_0x1a6086))throw new Error('runtime\x20'+_0x51926b(0x238)+_0x51926b(0x1e5)+_0x1a6086);}return{'runtimeRoot':_0x1e426e,'manifest':_0x325c19,'openclawVersion':_0x325c19[_0x51926b(0x14e)+_0x51926b(0x221)]||_0x51926b(0x226),'nodeExecutable':_0x2c7ec2,'npmCli':_0x511d99,'openclawWorkingDir':_0x35f5f0,'openclawBin':_0x368ad1,'plugins':_0x241e26};}export async function spawnClaw(_0x287354,_0x1effe4=[],_0x1edd8c={}){const _0x91cab3=_0x52cc87,_0x5eb215=await loadRuntimeInfo(_0x287354),_0x1da4d6=await createRuntimeEnv(_0x5eb215,_0x1edd8c[_0x91cab3(0x176)]??{});return spawn(_0x5eb215[_0x91cab3(0x1ad)+_0x91cab3(0x27f)],[_0x5eb215[_0x91cab3(0x14e)+'Bin'],..._0x1effe4],{'cwd':_0x5eb215[_0x91cab3(0x14e)+_0x91cab3(0x1ef)+'ir'],'stdio':_0x91cab3(0x234),..._0x1edd8c,'env':_0x1da4d6});}export async function runClawOnce(_0x1bfa2d,_0x6c35ce=[],_0x29c99d=0x15f90){const _0x2250ff=await spawnClaw(_0x1bfa2d,_0x6c35ce);return await new Promise((_0x51c318,_0x407936)=>{const _0x22e1b4=_0x2db8;let _0x3698c1='',_0x4cd9d5='',_0x1e038d=![];const _0x82b327=setTimeout(()=>{const _0x4ecaa6=_0x2db8;if(_0x1e038d)return;_0x1e038d=!![],_0x2250ff[_0x4ecaa6(0x192)](_0x4ecaa6(0x1f8)),_0x407936(new Error(_0x4ecaa6(0x14e)+_0x4ecaa6(0x20e)+_0x4ecaa6(0x15e)+'\x20'+_0x29c99d+'ms'));},_0x29c99d);_0x2250ff[_0x22e1b4(0x1cd)]['on'](_0x22e1b4(0x235),_0x4bee29=>{const _0x339ba5=_0x22e1b4;_0x3698c1+=_0x4bee29[_0x339ba5(0x1c4)]();}),_0x2250ff[_0x22e1b4(0x1d6)]['on']('data',_0x1eb2a0=>{const _0x172b7e=_0x22e1b4;_0x4cd9d5+=_0x1eb2a0[_0x172b7e(0x1c4)]();}),_0x2250ff['on']('error',_0x1749cc=>{if(_0x1e038d)return;_0x1e038d=!![],clearTimeout(_0x82b327),_0x407936(_0x1749cc);}),_0x2250ff['on'](_0x22e1b4(0x25c),(_0x21a164,_0x26efc6)=>{if(_0x1e038d)return;_0x1e038d=!![],clearTimeout(_0x82b327),_0x51c318({'code':_0x21a164,'signal':_0x26efc6,'stdout':_0x3698c1,'stderr':_0x4cd9d5});});});}async function createRuntimeEnv(_0x39a27e,_0x2e4f41={}){const _0x1fef14=_0x52cc87,_0x524e7d=process.env.OPENCLAW_STATE_DIR||'',_0x2a8dd1=_0x524e7d?join(_0x524e7d,'claw-run'+_0x1fef14(0x287)+'ls'):join(_0x39a27e[_0x1fef14(0x207)+'oot'],_0x1fef14(0x1f7)),_0x2a145d=join(_0x2a8dd1,_0x1fef14(0x16c)+'al'),_0x55efb3=join(_0x2a8dd1,_0x1fef14(0x214)+'e'),_0x64f66a=join(_0x2a145d,'bin');await mkdir(_0x64f66a,{'recursive':!![]}),await mkdir(_0x55efb3,{'recursive':!![]});const _0x3aad40=[_0x64f66a,dirname(_0x39a27e['nodeExec'+_0x1fef14(0x27f)]),process.env.PATH||''];return{...process.env,..._0x2e4f41,'PATH':_0x3aad40[_0x1fef14(0x180)](Boolean)['join'](delimiter),'npm_config_prefix':_0x2a145d,'NPM_CONFIG_PREFIX':_0x2a145d,'npm_config_cache':_0x55efb3,'NPM_CONFIG_CACHE':_0x55efb3,'npm_config_registry':_0x1fef14(0x228)+_0x1fef14(0x286)+_0x1fef14(0x255)+'rg/','NPM_CONFIG_REGISTRY':_0x1fef14(0x228)+_0x1fef14(0x286)+_0x1fef14(0x255)+_0x1fef14(0x1a8),'npm_execpath':_0x39a27e[_0x1fef14(0x16d)],'npm_node_execpath':_0x39a27e[_0x1fef14(0x1ad)+'utable'],'OPENCLAW_RUNTIME_NPM_PREFIX':_0x2a145d,'OPENCLAW_RUNTIME_NPM_BIN':_0x64f66a,'OPENCLAW_RUNTIME_NPM_REGISTRY':_0x1fef14(0x228)+_0x1fef14(0x286)+'.npmjs.o'+'rg/'};}async function syncProductPlugins(_0x31b212,_0x71c37,_0x25d6da){const _0x46be36=_0x52cc87,_0x107cbe=join(_0x71c37,_0x46be36(0x14e),'dist',_0x46be36(0x1d4)+'ns'),_0x42e2a8=[];for(const _0x5cecb1 of _0x31b212['openclaw']['resolved'+_0x46be36(0x1cb)+_0x46be36(0x174)]){const _0x22c5bd=await getPackageMetadata(_0x5cecb1),_0x3a6246=await readPluginManifest(_0x5cecb1),_0xc8fc19=join(_0x107cbe,_0x22c5bd[_0x46be36(0x275)]);await copyDirFresh(_0x5cecb1,_0xc8fc19),_0x42e2a8['push']({'pluginId':_0x22c5bd[_0x46be36(0x275)],'source':_0x46be36(0x19e),'spec':_0x46be36(0x271)+_0x5cecb1,'installPath':toRuntimeRelative(_0x71c37,_0xc8fc19),'version':_0x22c5bd[_0x46be36(0x236)],'resolvedName':_0x22c5bd[_0x46be36(0x1b4)],'resolvedVersion':_0x22c5bd[_0x46be36(0x236)],'resolvedSpec':_0x46be36(0x271)+_0x5cecb1,'integrity':'','shasum':'','resolvedAt':new Date()[_0x46be36(0x216)+'ing'](),'installedAt':new Date()['toISOStr'+_0x46be36(0x1ff)](),'agentScope':_0x3a6246[_0x46be36(0x273)+'pe'],'skills':_0x3a6246[_0x46be36(0x233)]});}const _0x1b221b=new Set(_0x42e2a8[_0x46be36(0x218)](_0xe1e9cc=>_0xe1e9cc[_0x46be36(0x275)])),_0x25f728=Array[_0x46be36(0x231)](_0x25d6da['plugins'])?_0x25d6da[_0x46be36(0x1e3)]['filter'](_0x5092ec=>!_0x1b221b['has'](_0x5092ec[_0x46be36(0x275)])):[];_0x25d6da[_0x46be36(0x1e3)]=[..._0x25f728,..._0x42e2a8];}async function syncManifestPluginScope(_0x3f9818,_0x1ec191,_0x258a19){const _0x4511f8=_0x52cc87,_0x2b5c6a=join(_0x1ec191,_0x4511f8(0x14e),_0x4511f8(0x1d1),_0x4511f8(0x1d4)+'ns'),_0x11b5fc=new Set(_0x3f9818[_0x4511f8(0x14e)]['pluginSp'+_0x4511f8(0x1fa)]??[]),_0x118866=new Set([..._0x11b5fc][_0x4511f8(0x218)](_0x44c7a3=>_0x44c7a3[_0x4511f8(0x1c8)](/^npm:/,''))[_0x4511f8(0x218)](_0x527718=>{const _0x18e546=_0x4511f8;if(_0x527718['startsWi'+'th']('@')){const _0x3f60b1=_0x527718['split']('@');return _0x3f60b1[_0x18e546(0x152)]>=0x3?'@'+_0x3f60b1[0x1]:_0x527718;}return _0x527718['split']('@')[0x0];})[_0x4511f8(0x180)](Boolean)),_0x7a7419=new Set();for(const _0x45bcb2 of _0x3f9818['openclaw'][_0x4511f8(0x188)+_0x4511f8(0x1cb)+_0x4511f8(0x174)]){const _0x275f28=await getPackageMetadata(_0x45bcb2);if(_0x275f28['pluginId'])_0x7a7419[_0x4511f8(0x19b)](_0x275f28[_0x4511f8(0x275)]);}const _0xd66cfb=Array[_0x4511f8(0x231)](_0x258a19[_0x4511f8(0x1e3)])?_0x258a19['plugins']:[];_0x258a19[_0x4511f8(0x1e4)+'ecs']=[..._0x3f9818[_0x4511f8(0x14e)][_0x4511f8(0x1e4)+_0x4511f8(0x1fa)],..._0x3f9818[_0x4511f8(0x14e)][_0x4511f8(0x188)+'LocalPlu'+_0x4511f8(0x174)][_0x4511f8(0x218)](_0x3577ad=>_0x4511f8(0x271)+_0x3577ad)],_0x258a19[_0x4511f8(0x1e3)]=_0xd66cfb[_0x4511f8(0x180)](_0x145a27=>{const _0x4e2f26=_0x4511f8;if(!_0x145a27||typeof _0x145a27!==_0x4e2f26(0x1b1))return![];if(_0x145a27[_0x4e2f26(0x260)]===_0x4e2f26(0x19e))return _0x7a7419['has'](_0x145a27[_0x4e2f26(0x275)]);if(_0x145a27[_0x4e2f26(0x260)]===_0x4e2f26(0x18d))return _0x11b5fc[_0x4e2f26(0x22c)](_0x145a27[_0x4e2f26(0x153)])||_0x11b5fc[_0x4e2f26(0x22c)](_0x145a27[_0x4e2f26(0x188)+_0x4e2f26(0x1b2)])||_0x118866['has'](_0x145a27[_0x4e2f26(0x188)+_0x4e2f26(0x220)]);return![];});const _0x8ffe07=new Set(_0x258a19[_0x4511f8(0x1e3)]['map'](_0x4bca75=>_0x4bca75[_0x4511f8(0x275)]));for(const _0x3c1298 of _0xd66cfb){if(!_0x3c1298[_0x4511f8(0x275)]||_0x8ffe07[_0x4511f8(0x22c)](_0x3c1298['pluginId']))continue;const _0x4853c6=typeof _0x3c1298['installP'+_0x4511f8(0x151)]===_0x4511f8(0x1f6)&&_0x3c1298[_0x4511f8(0x20d)+_0x4511f8(0x151)][_0x4511f8(0x1ea)]()?resolve(_0x1ec191,_0x3c1298[_0x4511f8(0x20d)+_0x4511f8(0x151)]):join(_0x2b5c6a,_0x3c1298['pluginId']),_0x3af9bc=relative(_0x2b5c6a,_0x4853c6);if(_0x3af9bc['startsWi'+'th']('..')||_0x3af9bc==='')continue;await rm(_0x4853c6,{'recursive':!![],'force':!![]});}}async function syncProductAgents(_0x174a12,_0x55669f,_0x2a2383){const _0x520967=_0x52cc87,_0x16ec61=join(_0x55669f,_0x520967(0x14e),_0x520967(0x27c));await copyDirFresh(_0x174a12[_0x520967(0x14e)][_0x520967(0x1f3)+'r'],_0x16ec61),_0x2a2383['agents']={'source':_0x520967(0x163),'installPath':toRuntimeRelative(_0x55669f,_0x16ec61)};}function _0x2db8(_0x37039b,_0x85e0c7){_0x37039b=_0x37039b-0x14e;const _0x3e1c12=_0x3e1c();let _0x2db8dc=_0x3e1c12[_0x37039b];return _0x2db8dc;}async function syncProductSkills(_0xb957f,_0x239599,_0x42b32f){const _0xcdff3d=_0x52cc87,_0x3ad944=join(_0x239599,_0xcdff3d(0x14e),_0xcdff3d(0x233));await copyDirFresh(_0xb957f['openclaw'][_0xcdff3d(0x1f0)+'r'],_0x3ad944),_0x42b32f['skills']={'source':'product','installPath':toRuntimeRelative(_0x239599,_0x3ad944)};}
1
+ const _0x17a6e2=_0x2a9a;(function(_0x4f71aa,_0x5cc382){const _0x2be597=_0x2a9a,_0x403210=_0x4f71aa();while(!![]){try{const _0x44f7ad=parseInt(_0x2be597(0x284))/0x1+-parseInt(_0x2be597(0x1e9))/0x2+-parseInt(_0x2be597(0x302))/0x3*(-parseInt(_0x2be597(0x2b1))/0x4)+parseInt(_0x2be597(0x1cd))/0x5*(-parseInt(_0x2be597(0x1e6))/0x6)+parseInt(_0x2be597(0x27f))/0x7*(parseInt(_0x2be597(0x267))/0x8)+parseInt(_0x2be597(0x1ca))/0x9+-parseInt(_0x2be597(0x1f5))/0xa*(parseInt(_0x2be597(0x273))/0xb);if(_0x44f7ad===_0x5cc382)break;else _0x403210['push'](_0x403210['shift']());}catch(_0x17d125){_0x403210['push'](_0x403210['shift']());}}}(_0x4be1,0xd76b9));import{existsSync}from'node:fs';import{createWriteStream}from'node:fs';import{chmod,cp,mkdir,rename,rm,symlink,writeFile}from'node:fs/promises';import{delimiter,dirname,join,relative,resolve}from'node:path';import{fileURLToPath}from'node:url';import{spawn}from'node:child_process';import{get}from'node:https';import{pipeline}from'node:stream/promises';function _0x2a9a(_0x420ce4,_0x11bc56){_0x420ce4=_0x420ce4-0x1c0;const _0x4be14f=_0x4be1();let _0x2a9a70=_0x4be14f[_0x420ce4];return _0x2a9a70;}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=_0x17a6e2(0x1e1)+_0x17a6e2(0x2c6),MANIFEST_NAME=_0x17a6e2(0x2b8)+'manifest'+_0x17a6e2(0x304),NPM_INSTALL_TIMEOUT_MS=0xf*0x3c*0x3e8;export function resolveRuntimeRoot(_0x2ae8e2){if(process.env.WUJIE_SHELL_RUNTIME_ROOT)return resolve(process.env.WUJIE_SHELL_RUNTIME_ROOT);return resolve(_0x2ae8e2,RUNTIME_DIR);}export function resolveManifestPath(_0x1c96b7){return join(_0x1c96b7,MANIFEST_NAME);}export async function prepareRuntime(_0x359b26,{syncOnly:syncOnly=![]}={}){const _0x459261=_0x17a6e2,_0x2a4045=resolveRuntimeRoot(_0x359b26[_0x459261(0x1fd)+_0x459261(0x268)]),_0x31b096=createRuntimeLogger(getConfigPaths(_0x359b26),_0x459261(0x208)),_0x26c54d=Date[_0x459261(0x2ac)]();_0x31b096?.['info'](_0x459261(0x21e)+_0x459261(0x20f)+_0x459261(0x1c1),{'syncOnly':syncOnly,'runtimeRoot':_0x2a4045,'shellConfig':summarizeShellConfig(_0x359b26)});try{const _0x2c7c82=await ensureRuntimeBase(_0x359b26,_0x2a4045,{'runtimeLogger':_0x31b096,'syncOnly':syncOnly});_0x31b096?.[_0x459261(0x299)]('runtime\x20'+_0x459261(0x2b3)+_0x459261(0x2b5),{'manifestPath':resolveManifestPath(_0x2a4045),'manifest':summarizeRuntimeManifest(_0x2c7c82)}),validateRuntimeNodeVersion(_0x2c7c82,_0x359b26),_0x31b096?.['info'](_0x459261(0x20f)+_0x459261(0x230)+_0x459261(0x29b)+'idated',{'nodeVersion':_0x2c7c82[_0x459261(0x275)+_0x459261(0x2f8)]});if(syncOnly)validateRuntimeOpenClawVersion(_0x2c7c82,_0x359b26),_0x31b096?.[_0x459261(0x299)](_0x459261(0x20f)+_0x459261(0x2ae)+_0x459261(0x2e4)+'\x20validat'+'ed',{'openclawVersion':_0x2c7c82[_0x459261(0x2ae)+_0x459261(0x1c7)]});else{if(_0x2c7c82[_0x459261(0x2ae)+'Version']!==_0x359b26[_0x459261(0x2ae)][_0x459261(0x2ae)+_0x459261(0x1c7)]){const _0x269624=await loadRuntimeInfo(_0x359b26[_0x459261(0x1fd)+_0x459261(0x268)]);_0x31b096?.[_0x459261(0x299)](_0x459261(0x2ae)+_0x459261(0x2d2)+_0x459261(0x2a8)+'\x20started',{'fromVersion':_0x2c7c82[_0x459261(0x2ae)+'Version']||_0x459261(0x1f2),'toVersion':_0x359b26[_0x459261(0x2ae)][_0x459261(0x2ae)+_0x459261(0x1c7)]}),await installOpenClawPackage(_0x269624,_0x359b26[_0x459261(0x2ae)][_0x459261(0x2ae)+_0x459261(0x1c7)]),_0x2c7c82[_0x459261(0x2ae)+'Version']=_0x359b26['openclaw'][_0x459261(0x2ae)+_0x459261(0x1c7)],_0x31b096?.[_0x459261(0x299)](_0x459261(0x2ae)+_0x459261(0x2d2)+_0x459261(0x2a8)+_0x459261(0x1df)+'ed',{'openclawVersion':_0x2c7c82[_0x459261(0x2ae)+_0x459261(0x1c7)]});}}_0x2c7c82['generate'+_0x459261(0x2bd)]=new Date()['toISOStr'+_0x459261(0x24f)](),_0x2c7c82[_0x459261(0x275)+_0x459261(0x2f8)]=_0x359b26['openclaw'][_0x459261(0x275)+_0x459261(0x2f8)],_0x2c7c82[_0x459261(0x2d5)]={'appId':_0x359b26[_0x459261(0x29f)],'productName':_0x359b26[_0x459261(0x204)+'ame'],'dataDirName':_0x359b26['dataDirN'+_0x459261(0x2ea)]};const _0x83ab51=Array[_0x459261(0x21c)](_0x2c7c82['plugins'])?_0x2c7c82[_0x459261(0x2dc)]['length']:0x0;return await syncManifestPluginScope(_0x359b26,_0x2a4045,_0x2c7c82),_0x31b096?.[_0x459261(0x299)](_0x459261(0x20f)+_0x459261(0x27a)+_0x459261(0x2b2)+_0x459261(0x24a),{'beforePluginCount':_0x83ab51,'afterPluginCount':Array['isArray'](_0x2c7c82[_0x459261(0x2dc)])?_0x2c7c82[_0x459261(0x2dc)][_0x459261(0x238)]:0x0,'pluginSpecCount':Array[_0x459261(0x21c)](_0x2c7c82[_0x459261(0x2c4)+'ecs'])?_0x2c7c82[_0x459261(0x2c4)+_0x459261(0x2cb)][_0x459261(0x238)]:0x0}),await syncProductPlugins(_0x359b26,_0x2a4045,_0x2c7c82),_0x31b096?.[_0x459261(0x299)]('product\x20'+_0x459261(0x2e0)+_0x459261(0x2e2),{'localPluginCount':_0x359b26[_0x459261(0x2ae)][_0x459261(0x1d0)+_0x459261(0x2a6)+'ginPaths'][_0x459261(0x238)],'pluginCount':Array[_0x459261(0x21c)](_0x2c7c82['plugins'])?_0x2c7c82[_0x459261(0x2dc)][_0x459261(0x238)]:0x0}),await syncProductAgents(_0x359b26,_0x2a4045,_0x2c7c82),_0x31b096?.[_0x459261(0x299)](_0x459261(0x25e)+_0x459261(0x2c0)+'ynced',{'source':_0x359b26[_0x459261(0x2ae)][_0x459261(0x241)+'r'],'installPath':_0x2c7c82[_0x459261(0x2a0)]?.[_0x459261(0x2d1)+_0x459261(0x2b6)]}),await syncProductSkills(_0x359b26,_0x2a4045,_0x2c7c82),_0x31b096?.['info'](_0x459261(0x25e)+_0x459261(0x211)+_0x459261(0x26a),{'source':_0x359b26[_0x459261(0x2ae)]['skillsDi'+'r'],'installPath':_0x2c7c82[_0x459261(0x21a)]?.[_0x459261(0x2d1)+_0x459261(0x2b6)]}),await syncRuntimeWrapper(_0x359b26,_0x2a4045,_0x2c7c82),_0x31b096?.[_0x459261(0x299)](_0x459261(0x20f)+_0x459261(0x1d3)+_0x459261(0x2e2),{'wujieclawBin':_0x2c7c82[_0x459261(0x23a)+'wBin']}),await writeJson(resolveManifestPath(_0x2a4045),_0x2c7c82),_0x31b096?.[_0x459261(0x299)](_0x459261(0x20f)+_0x459261(0x2b3)+_0x459261(0x2ec),{'manifestPath':resolveManifestPath(_0x2a4045),'manifest':summarizeRuntimeManifest(_0x2c7c82),'durationMs':Date[_0x459261(0x2ac)]()-_0x26c54d}),await _0x31b096?.[_0x459261(0x2ce)](),_0x2c7c82;}catch(_0x127e97){_0x31b096?.['error']('prepare\x20'+'runtime\x20'+'failed',{'syncOnly':syncOnly,'runtimeRoot':_0x2a4045,'durationMs':Date['now']()-_0x26c54d,'error':_0x127e97}),await _0x31b096?.['flush']();throw _0x127e97;}}async function syncRuntimeWrapper(_0x71ce8e,_0x1e1d71,_0x106e0a){const _0xb3b84d=_0x17a6e2,_0x5dd995=join(_0x1e1d71,_0xb3b84d(0x2e8),_0xb3b84d(0x23a)+'w'),_0x15a517=join(_0x1e1d71,_0xb3b84d(0x2e8),_0xb3b84d(0x23a)+'w.cmd'),_0x56c6d8=normalizeRuntimeRelativePath(relative(dirname(_0x5dd995),resolve(_0x1e1d71,_0x106e0a['nodeExec'+'utable']))),_0x4595dc=normalizeRuntimeRelativePath(relative(dirname(_0x5dd995),resolve(_0x1e1d71,_0x106e0a[_0xb3b84d(0x2ae)+_0xb3b84d(0x1d4)]))),_0x353b3b=_0xb3b84d(0x243)+_0x71ce8e[_0xb3b84d(0x2d8)+_0xb3b84d(0x2ea)],_0xde9a60=_0xb3b84d(0x2ad)+_0xb3b84d(0x203)+_0x71ce8e[_0xb3b84d(0x2d8)+_0xb3b84d(0x2ea)];await mkdir(dirname(_0x5dd995),{'recursive':!![]});const _0x17acf8=fileURLToPath(new URL(_0xb3b84d(0x2bc)+_0xb3b84d(0x25d)+_0xb3b84d(0x2e1),import.meta.url)),_0x20644f=join(_0x1e1d71,_0xb3b84d(0x2e8),_0xb3b84d(0x233)+_0xb3b84d(0x1d1));await cp(_0x17acf8,_0x20644f),await writeFile(_0x5dd995,['#!/bin/s'+'h',_0xb3b84d(0x2b9)+_0xb3b84d(0x20b)+_0xb3b84d(0x213)+_0xb3b84d(0x250)+'_HOME:-'+_0x353b3b+'}\x22','export\x20O'+'PENCLAW_'+_0xb3b84d(0x1e8)+_0xb3b84d(0x1f0)+'NCLAW_ST'+_0xb3b84d(0x27d)+'-'+_0x353b3b+'}\x22','export\x20O'+_0xb3b84d(0x20b)+_0xb3b84d(0x2c9)+_0xb3b84d(0x25a)+_0xb3b84d(0x20b)+_0xb3b84d(0x2c9)+'ATH:-'+_0x353b3b+(_0xb3b84d(0x207)+_0xb3b84d(0x22b)),_0xb3b84d(0x285)+_0xb3b84d(0x265)+'ATH=\x20cd\x20'+_0xb3b84d(0x269)+_0xb3b84d(0x301)+'\x20\x22$0\x22)\x22\x20'+_0xb3b84d(0x1ef),_0xb3b84d(0x2ee)+_0xb3b84d(0x1da)+_0xb3b84d(0x1f7)+_0xb3b84d(0x216)+_0xb3b84d(0x1c8)+_0xb3b84d(0x2bb),_0xb3b84d(0x272)+_0xb3b84d(0x1ec)+_0x56c6d8+(_0xb3b84d(0x2a7)+_0xb3b84d(0x2c1)+_0xb3b84d(0x21f)+'o.mjs\x22\x202'+'>/dev/nu'+'ll\x20||\x20tr'+'ue'),'fi',_0xb3b84d(0x249)+_0xb3b84d(0x1f8)+'R/'+_0x56c6d8+(_0xb3b84d(0x2a7)+_0xb3b84d(0x1ec))+_0x4595dc+_0xb3b84d(0x2f6),'']['join']('\x0a'),_0xb3b84d(0x257)),await chmod(_0x5dd995,0x1ed),await writeFile(_0x15a517,['@echo\x20of'+'f','if\x20\x22%OPE'+_0xb3b84d(0x259)+_0xb3b84d(0x1e4)+'\x20set\x20\x22OP'+_0xb3b84d(0x270)+_0xb3b84d(0x2e3)+_0xde9a60+'\x22',_0xb3b84d(0x210)+_0xb3b84d(0x296)+'ATE_DIR%'+_0xb3b84d(0x2dd)+_0xb3b84d(0x1db)+_0xb3b84d(0x281)+_0xb3b84d(0x253)+_0xde9a60+'\x22',_0xb3b84d(0x210)+_0xb3b84d(0x278)+'NFIG_PAT'+_0xb3b84d(0x2be)+_0xb3b84d(0x23b)+_0xb3b84d(0x278)+_0xb3b84d(0x214)+'H='+_0xde9a60+(_0xb3b84d(0x23e)+_0xb3b84d(0x1f6)),_0xb3b84d(0x2d3)+_0xb3b84d(0x2f9)+'%~dp0\x22','\x22%SCRIPT'+'_DIR%'+toWindowsPath(_0x56c6d8)+(_0xb3b84d(0x2fe)+_0xb3b84d(0x25c))+toWindowsPath(_0x4595dc)+_0xb3b84d(0x2c3),''][_0xb3b84d(0x2bf)]('\x0d\x0a'),_0xb3b84d(0x257)),_0x106e0a[_0xb3b84d(0x23a)+_0xb3b84d(0x256)]=toRuntimeRelative(_0x1e1d71,process['platform']===_0xb3b84d(0x24b)?_0x15a517:_0x5dd995);}function normalizeRuntimeRelativePath(_0x55b594){const _0x3d9f60=_0x17a6e2;return _0x55b594[_0x3d9f60(0x20d)+'ll']('\x5c','/');}function toWindowsPath(_0x26485e){const _0x2eb060=_0x17a6e2;return _0x26485e[_0x2eb060(0x20d)+'ll']('/','\x5c');}function validateRuntimeNodeVersion(_0x47cb2f,_0x3b3010){const _0x6edf39=_0x17a6e2;if(_0x47cb2f[_0x6edf39(0x275)+_0x6edf39(0x2f8)]===_0x3b3010[_0x6edf39(0x2ae)][_0x6edf39(0x275)+_0x6edf39(0x2f8)])return;throw new Error(_0x6edf39(0x20f)+_0x6edf39(0x275)+'ion\x20mism'+_0x6edf39(0x1dc)+_0x6edf39(0x24d)+(_0x47cb2f[_0x6edf39(0x275)+_0x6edf39(0x2f8)]||'unknown')+(_0x6edf39(0x1ff)+_0x6edf39(0x2ed))+_0x3b3010[_0x6edf39(0x2ae)][_0x6edf39(0x275)+_0x6edf39(0x2f8)]+'.\x20'+(_0x6edf39(0x2e7)+'ie-shell'+_0x6edf39(0x220)+_0x6edf39(0x27b)+_0x6edf39(0x21d)+_0x6edf39(0x219)+_0x6edf39(0x222)+_0x6edf39(0x263)+_0x6edf39(0x231)+_0x6edf39(0x26c)+'red\x20Node'+_0x6edf39(0x2e4)+'.'));}function validateRuntimeOpenClawVersion(_0x4a06d0,_0x338f20){const _0x1217b7=_0x17a6e2;if(_0x4a06d0['openclaw'+_0x1217b7(0x1c7)]===_0x338f20['openclaw'][_0x1217b7(0x2ae)+'Version'])return;throw new Error(_0x1217b7(0x20f)+_0x1217b7(0x2ae)+_0x1217b7(0x2a5)+_0x1217b7(0x235)+':\x20manife'+'st='+(_0x4a06d0['openclaw'+_0x1217b7(0x1c7)]||'unknown')+(_0x1217b7(0x1ff)+_0x1217b7(0x2ed))+_0x338f20[_0x1217b7(0x2ae)]['openclaw'+_0x1217b7(0x1c7)]+'.\x20'+(_0x1217b7(0x2e7)+_0x1217b7(0x282)+'\x20prepare'+_0x1217b7(0x27b)+_0x1217b7(0x219)+_0x1217b7(0x221)+_0x1217b7(0x290)+'\x20configu'+_0x1217b7(0x2d0)+_0x1217b7(0x22c)+_0x1217b7(0x24c)));}function parseNpmPackJson(_0x554424){const _0x5de9b3=_0x17a6e2,_0x233dd2=_0x554424[_0x5de9b3(0x2d6)](),_0x5cfce3=_0x233dd2['indexOf']('[');if(_0x5cfce3<0x0)throw new Error(_0x5de9b3(0x2da)+'\x20did\x20not'+_0x5de9b3(0x239)+_0x5de9b3(0x248)+_0x233dd2[_0x5de9b3(0x2d4)](0x0,0x1f4));const _0x53f0bb=JSON['parse'](_0x233dd2[_0x5de9b3(0x2d4)](_0x5cfce3)),_0x28e5d5=Array['isArray'](_0x53f0bb)?_0x53f0bb[0x0]:_0x53f0bb;if(!_0x28e5d5||typeof _0x28e5d5!==_0x5de9b3(0x244))throw new Error('npm\x20pack'+_0x5de9b3(0x289)+_0x5de9b3(0x1ea)+_0x5de9b3(0x2db)+_0x5de9b3(0x217)+_0x233dd2['slice'](0x0,0x1f4));return _0x28e5d5;}async function runProcess(_0x552f84,_0x106fa2,_0x1a6aa8={}){const _0x32516e=_0x17a6e2,_0x521af7=_0x1a6aa8[_0x32516e(0x279)]||[_0x552f84,..._0x106fa2][_0x32516e(0x2bf)]('\x20'),_0x3bb6d4=_0x1a6aa8[_0x32516e(0x2ba)+'s']??NPM_INSTALL_TIMEOUT_MS,_0x1089d0=spawn(_0x552f84,_0x106fa2,{'cwd':_0x1a6aa8[_0x32516e(0x1fa)],'env':_0x1a6aa8['env'],'stdio':[_0x32516e(0x2aa),_0x32516e(0x2a2),_0x32516e(0x2a2)]});return await new Promise((_0x384e17,_0x24d54a)=>{const _0x3a9fda=_0x32516e;let _0x29b615='',_0x5ebc82='',_0xbd7495=![];const _0x450621=setTimeout(()=>{const _0x2a18c2=_0x2a9a;if(_0xbd7495)return;_0xbd7495=!![],_0x1089d0[_0x2a18c2(0x27c)](_0x2a18c2(0x218)),_0x24d54a(new Error(_0x521af7+(_0x2a18c2(0x2d7)+_0x2a18c2(0x205)+'\x20')+_0x3bb6d4+'ms'));},_0x3bb6d4);_0x1089d0['stdout']['on'](_0x3a9fda(0x2c7),_0x55cb71=>{const _0x2e1d0d=_0x3a9fda;_0x29b615+=_0x55cb71[_0x2e1d0d(0x1d2)]();}),_0x1089d0[_0x3a9fda(0x209)]['on'](_0x3a9fda(0x2c7),_0x517338=>{const _0x3105c7=_0x3a9fda;_0x5ebc82+=_0x517338[_0x3105c7(0x1d2)]();}),_0x1089d0['on'](_0x3a9fda(0x2fd),_0x371d34=>{if(_0xbd7495)return;_0xbd7495=!![],clearTimeout(_0x450621),_0x24d54a(_0x371d34);}),_0x1089d0['on'](_0x3a9fda(0x255),(_0x1caec2,_0x28d210)=>{const _0x157122=_0x3a9fda;if(_0xbd7495)return;_0xbd7495=!![],clearTimeout(_0x450621);if(_0x1caec2===0x0){_0x384e17({'stdout':_0x29b615,'stderr':_0x5ebc82});return;}_0x24d54a(new Error(_0x521af7+('\x20failed\x20'+'with\x20cod'+'e=')+(_0x1caec2??_0x157122(0x247))+_0x157122(0x20c)+(_0x28d210??_0x157122(0x247))+'\x0a'+(''+(_0x5ebc82||_0x29b615))[_0x157122(0x2d6)]()));});});}async function installOpenClawPackage(_0x244975,_0x414474){const _0x487141=_0x17a6e2,_0x409855=join(_0x244975[_0x487141(0x2f2)+_0x487141(0x268)],_0x487141(0x20a)),_0x39ad9f=join(_0x244975[_0x487141(0x2f2)+_0x487141(0x268)],_0x487141(0x26f)+_0x487141(0x2df)+'t');await mkdir(_0x409855,{'recursive':!![]}),await rm(_0x39ad9f,{'recursive':!![],'force':!![]}),await mkdir(_0x39ad9f,{'recursive':!![]});const _0x3a6d12=await createRuntimeEnv(_0x244975),_0x4e9735=_0x487141(0x2ae)+'@'+_0x414474;console[_0x487141(0x300)](_0x487141(0x2a4)+_0x487141(0x2af)+'time]\x20in'+_0x487141(0x240)+'\x20'+_0x4e9735);const _0x2d5e01=await runProcess(_0x244975[_0x487141(0x234)+_0x487141(0x24e)],[_0x244975[_0x487141(0x1cc)],_0x487141(0x1fe),_0x4e9735,_0x487141(0x242)],{'cwd':_0x409855,'env':_0x3a6d12,'label':'npm\x20pack'+'\x20'+_0x4e9735}),_0x1fde43=parseNpmPackJson(_0x2d5e01['stdout']);if(_0x1fde43[_0x487141(0x25b)]!==_0x414474)throw new Error(_0x487141(0x303)+_0x487141(0x22a)+_0x487141(0x2cc)+_0x414474+(_0x487141(0x21b)+_0x487141(0x251))+_0x1fde43['version']);const _0x5e4576=resolve(_0x409855,_0x1fde43['filename']);if(!existsSync(_0x5e4576))throw new Error('npm\x20pack'+_0x487141(0x274)+'\x20create\x20'+_0x487141(0x297)+'\x20'+_0x5e4576);await runProcess(_0x487141(0x2c2),['-xzf',_0x5e4576,'-C',_0x39ad9f],{'label':_0x487141(0x2ef)+_0x1fde43[_0x487141(0x2f1)]}),await rm(_0x244975[_0x487141(0x2ae)+_0x487141(0x2f0)+'ir'],{'recursive':!![],'force':!![]}),await rename(join(_0x39ad9f,_0x487141(0x2de)),_0x244975[_0x487141(0x2ae)+_0x487141(0x2f0)+'ir']),await rm(_0x39ad9f,{'recursive':!![],'force':!![]}),await runProcess(_0x244975['nodeExec'+_0x487141(0x24e)],[_0x244975['npmCli'],_0x487141(0x2fa),_0x487141(0x236)+'ev',_0x487141(0x26d)+_0x487141(0x28c),'--no-aud'+'it','--no-fun'+'d',_0x487141(0x287)+_0x487141(0x200)+'ps'],{'cwd':_0x244975[_0x487141(0x2ae)+_0x487141(0x2f0)+'ir'],'env':_0x3a6d12,'label':_0x487141(0x237)+_0x487141(0x298)+_0x4e9735+(_0x487141(0x219)+_0x487141(0x2d9)+_0x487141(0x1dd))});if(!existsSync(_0x244975['openclaw'+_0x487141(0x1d4)]))throw new Error(_0x487141(0x262)+_0x487141(0x2cd)+_0x487141(0x246)+_0x487141(0x227)+_0x487141(0x2a8)+':\x20'+_0x244975[_0x487141(0x2ae)+'Bin']);}async function ensureRuntimeBase(_0x12f313,_0xa18e26,_0x1fe8a0={}){const _0x428c22=_0x17a6e2;await mkdir(_0xa18e26,{'recursive':!![]});let _0x4d3c0b=await readRuntimeManifest(_0xa18e26);const _0x2ef71d=_0x12f313[_0x428c22(0x2ae)][_0x428c22(0x275)+_0x428c22(0x2f8)],_0x2559c5=_0x12f313[_0x428c22(0x2ae)][_0x428c22(0x2ae)+'Version'],_0x237d2c=existsSync(resolveManifestPath(_0xa18e26)),_0x14aea5=runtimeHasRequiredPaths(_0xa18e26,_0x4d3c0b),_0xb5466e=_0x4d3c0b[_0x428c22(0x275)+_0x428c22(0x2f8)]===_0x2ef71d;!_0x237d2c||!_0x14aea5||!_0xb5466e?(_0x1fe8a0[_0x428c22(0x1f4)+'ogger']?.[_0x428c22(0x299)](_0x428c22(0x20f)+'base\x20bui'+'ld\x20start'+'ed',{'runtimeRoot':_0xa18e26,'reason':!_0x237d2c?'missing\x20'+_0x428c22(0x2b3):!_0x14aea5?_0x428c22(0x1d6)+'required'+_0x428c22(0x219)+_0x428c22(0x1e7):_0x428c22(0x230)+_0x428c22(0x28a)+_0x428c22(0x2a3),'syncOnly':_0x1fe8a0[_0x428c22(0x1d8)]}),_0x4d3c0b=await buildRuntimeBase(_0x12f313,_0xa18e26,_0x4d3c0b),_0x1fe8a0['runtimeL'+_0x428c22(0x1c3)]?.[_0x428c22(0x299)](_0x428c22(0x20f)+'base\x20bui'+_0x428c22(0x1d9)+'eted',{'manifest':summarizeRuntimeManifest(_0x4d3c0b)})):_0x1fe8a0[_0x428c22(0x1f4)+_0x428c22(0x1c3)]?.[_0x428c22(0x299)](_0x428c22(0x20f)+_0x428c22(0x1d5)+_0x428c22(0x2fc)+_0x428c22(0x2a9),{'manifest':summarizeRuntimeManifest(_0x4d3c0b)});if(!existsSync(resolve(_0xa18e26,_0x4d3c0b[_0x428c22(0x2ae)+_0x428c22(0x1d4)]))){const _0x50e096=createRuntimeInfoFromManifest(_0xa18e26,_0x4d3c0b,{'allowMissingOpenClaw':!![]});await installOpenClawPackage(_0x50e096,_0x2559c5),_0x4d3c0b[_0x428c22(0x2ae)+_0x428c22(0x1c7)]=_0x2559c5;}return _0x4d3c0b;}function runtimeHasRequiredPaths(_0x3959a7,_0x58e606){const _0x525a18=_0x17a6e2;return['nodeExec'+_0x525a18(0x24e),_0x525a18(0x1cc),_0x525a18(0x2ae)+'WorkingD'+'ir',_0x525a18(0x2ae)+_0x525a18(0x1d4)][_0x525a18(0x252)](_0x25e63c=>typeof _0x58e606[_0x25e63c]==='string'&&_0x58e606[_0x25e63c][_0x525a18(0x2d6)]())&&[_0x525a18(0x234)+_0x525a18(0x24e),_0x525a18(0x1cc)]['every'](_0x78afb9=>existsSync(resolve(_0x3959a7,_0x58e606[_0x78afb9])));}async function buildRuntimeBase(_0x355f7d,_0x5edfdb,_0x59ee6d={}){const _0xfe10fb=_0x17a6e2,_0x56873a=join(_0x5edfdb,_0xfe10fb(0x2ab));await ensureRuntimeNode(_0x355f7d,_0x56873a);const _0x56590e={..._0x59ee6d,'generatedAt':new Date()[_0xfe10fb(0x2c8)+_0xfe10fb(0x24f)](),'nodeVersion':_0x355f7d['openclaw'][_0xfe10fb(0x275)+'ion'],'openclawVersion':_0x59ee6d[_0xfe10fb(0x2ae)+'Version']||'','platform':process[_0xfe10fb(0x28e)],'arch':process[_0xfe10fb(0x280)],'nodeExecutable':_0xfe10fb(0x288)+_0xfe10fb(0x2b0),'npmCli':'node/lib'+_0xfe10fb(0x260)+_0xfe10fb(0x28f)+_0xfe10fb(0x1c6)+_0xfe10fb(0x291),'openclawWorkingDir':'openclaw','openclawBin':'openclaw'+_0xfe10fb(0x207)+_0xfe10fb(0x2b4)};return await writeJson(resolveManifestPath(_0x5edfdb),_0x56590e),_0x56590e;}async function ensureRuntimeNode(_0x14b403,_0x264713){const _0x2eed6c=_0x17a6e2,_0x145883=_0x14b403['openclaw'][_0x2eed6c(0x275)+_0x2eed6c(0x2f8)],_0x3d3339=join(_0x264713,_0x2eed6c(0x2e8),'node'),_0x3bf154=join(_0x264713,_0x2eed6c(0x26e),_0x2eed6c(0x1fc)+_0x2eed6c(0x1d7),_0x2eed6c(0x206),'bin',_0x2eed6c(0x228)+'js');if(existsSync(_0x3d3339)&&existsSync(_0x3bf154)&&await getNodeVersion(_0x3d3339)===_0x145883)return;await rm(_0x264713,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96});if(process[_0x2eed6c(0x1f3)]['node']===_0x145883){await linkCurrentNodeRuntime(_0x264713);return;}await downloadNodeRuntime(_0x145883,_0x264713);}async function getNodeVersion(_0x17d578){const _0x5c8458=_0x17a6e2;try{const _0x55b2be=await runProcess(_0x17d578,['-p',_0x5c8458(0x2a1)+_0x5c8458(0x1f3)+_0x5c8458(0x2ff)],{'label':_0x17d578+_0x5c8458(0x2e4),'timeoutMs':0x7530});return _0x55b2be[_0x5c8458(0x29d)][_0x5c8458(0x2d6)]();}catch{return'';}}async function linkCurrentNodeRuntime(_0x398e3c){const _0x1923b6=_0x17a6e2,_0x6e057a=process[_0x1923b6(0x1cb)],_0x2844a9=resolve(dirname(_0x6e057a),'..'),_0x17765b=resolve(_0x2844a9,'lib/node'+_0x1923b6(0x23d)+'/npm'),_0xdd8109=join(_0x398e3c,'bin',_0x1923b6(0x2ab)),_0xe651ca=join(_0x398e3c,_0x1923b6(0x26e),_0x1923b6(0x1fc)+_0x1923b6(0x1d7),_0x1923b6(0x206));await mkdir(dirname(_0xdd8109),{'recursive':!![]}),await mkdir(dirname(_0xe651ca),{'recursive':!![]}),await symlink(_0x6e057a,_0xdd8109),existsSync(_0x17765b)?await symlink(_0x17765b,_0xe651ca):await symlink(await resolveNpmRoot(),_0xe651ca);}async function resolveNpmRoot(){const _0x371f5a=_0x17a6e2,_0x17ce31=await runProcess('npm',[_0x371f5a(0x1c0),'-g'],{'label':'npm\x20root'+'\x20-g','timeoutMs':0x7530}),_0x48087d=join(_0x17ce31[_0x371f5a(0x29d)][_0x371f5a(0x2d6)](),_0x371f5a(0x206));if(!existsSync(join(_0x48087d,_0x371f5a(0x2e8),_0x371f5a(0x228)+'js')))throw new Error('npm\x20pack'+'age\x20was\x20'+'not\x20foun'+_0x371f5a(0x20e)+'cal\x20runt'+_0x371f5a(0x2fb)+'d:\x20'+_0x48087d);return _0x48087d;}async function downloadNodeRuntime(_0x3e455a,_0x4c6e80){const _0xbd20db=_0x17a6e2,_0x4192f2=process[_0xbd20db(0x28e)]===_0xbd20db(0x24b)?_0xbd20db(0x266):process[_0xbd20db(0x28e)],_0x754060=process[_0xbd20db(0x280)]==='x64'?_0xbd20db(0x264):process[_0xbd20db(0x280)]==='arm64'?'arm64':process[_0xbd20db(0x280)],_0x1ee2d8=process[_0xbd20db(0x28e)]===_0xbd20db(0x24b)?'zip':_0xbd20db(0x1f1),_0x3fca83=_0xbd20db(0x224)+_0x3e455a+'-'+_0x4192f2+'-'+_0x754060,_0x505c54=_0x3fca83+'.'+_0x1ee2d8,_0x52fe40=join(dirname(_0x4c6e80),_0xbd20db(0x20a)),_0x119835=join(_0x52fe40,_0x505c54),_0x1f1f9a=join(_0x52fe40,_0x3fca83+(_0xbd20db(0x22e)+'-')+process[_0xbd20db(0x1ce)]+'-'+Date[_0xbd20db(0x2ac)]()),_0xbb96d8=_0xbd20db(0x292)+'nodejs.o'+_0xbd20db(0x212)+'v'+_0x3e455a+'/'+_0x505c54;await mkdir(_0x52fe40,{'recursive':!![]}),!existsSync(_0x119835)&&(console[_0xbd20db(0x300)](_0xbd20db(0x2a4)+_0xbd20db(0x2af)+_0xbd20db(0x293)+_0xbd20db(0x277)+'g\x20'+_0xbb96d8),await downloadFile(_0xbb96d8,_0x119835)),await rm(_0x1f1f9a,{'recursive':!![],'force':!![]}),await mkdir(_0x1f1f9a,{'recursive':!![]}),process[_0xbd20db(0x28e)]===_0xbd20db(0x24b)?await runProcess(_0xbd20db(0x229),['-q',_0x119835,'-d',_0x1f1f9a],{'label':'extract\x20'+_0x505c54}):await runProcess(_0xbd20db(0x2c2),[_0xbd20db(0x2f3),_0x119835,'-C',_0x1f1f9a],{'label':'extract\x20'+_0x505c54}),await rename(join(_0x1f1f9a,_0x3fca83),_0x4c6e80),await rm(_0x1f1f9a,{'recursive':!![],'force':!![]});}async function downloadFile(_0x37006f,_0x273953){await mkdir(dirname(_0x273953),{'recursive':!![]});const _0x2ed301=await new Promise((_0x25c5b7,_0x21b09a)=>{const _0x5b9ba2=_0x2a9a;get(_0x37006f,_0x5b1082=>{const _0x454f95=_0x2a9a;if(_0x5b1082[_0x454f95(0x1eb)+'de']>=0x12c&&_0x5b1082[_0x454f95(0x1eb)+'de']<0x190&&_0x5b1082[_0x454f95(0x1e0)][_0x454f95(0x1e2)]){_0x5b1082[_0x454f95(0x1c4)](),downloadFile(new URL(_0x5b1082['headers'][_0x454f95(0x1e2)],_0x37006f)['href'],_0x273953)['then'](()=>_0x25c5b7(null))[_0x454f95(0x1c5)](_0x21b09a);return;}if(_0x5b1082[_0x454f95(0x1eb)+'de']!==0xc8){_0x5b1082[_0x454f95(0x1c4)](),_0x21b09a(new Error(_0x454f95(0x286)+_0x454f95(0x223)+_0x5b1082['statusCo'+'de']+':\x20'+_0x37006f));return;}_0x25c5b7(_0x5b1082);})['on'](_0x5b9ba2(0x2fd),_0x21b09a);});_0x2ed301&&await pipeline(_0x2ed301,createWriteStream(_0x273953));}export async function ensureOpenClawDoctorFixed(_0x5c35b5,_0x287ffe={}){const _0x510f6f=_0x17a6e2,_0x18e1b4=await loadRuntimeInfo(_0x5c35b5[_0x510f6f(0x1fd)+_0x510f6f(0x268)]),_0x38dbd9=getConfigPaths(_0x5c35b5),_0x176866=join(_0x38dbd9[_0x510f6f(0x232)+'tateDir'],_0x510f6f(0x2ae)+_0x510f6f(0x23f)+'json'),_0x2d4006=await readJson(_0x176866,{});if(_0x2d4006[_0x510f6f(0x2ae)+_0x510f6f(0x1c7)]===_0x18e1b4[_0x510f6f(0x2ae)+_0x510f6f(0x1c7)])return _0x287ffe[_0x510f6f(0x1f4)+_0x510f6f(0x1c3)]?.['info'](_0x510f6f(0x2ae)+_0x510f6f(0x225)+_0x510f6f(0x276)+_0x510f6f(0x2cf)+'ent',{'openclawVersion':_0x18e1b4[_0x510f6f(0x2ae)+_0x510f6f(0x1c7)],'markerPath':_0x176866}),{'ran':![],'openclawVersion':_0x18e1b4[_0x510f6f(0x2ae)+_0x510f6f(0x1c7)],'markerPath':_0x176866};return await runOpenClawDoctorFix(_0x5c35b5,_0x18e1b4,{'fromVersion':_0x2d4006['openclaw'+_0x510f6f(0x1c7)]||_0x510f6f(0x1f2),'toVersion':_0x18e1b4['openclaw'+_0x510f6f(0x1c7)],'markerPath':_0x176866,'runtimeLogger':_0x287ffe[_0x510f6f(0x1f4)+_0x510f6f(0x1c3)]}),{'ran':!![],'openclawVersion':_0x18e1b4[_0x510f6f(0x2ae)+_0x510f6f(0x1c7)],'markerPath':_0x176866};}async function runOpenClawDoctorFix(_0x393651,_0x2bd607,{fromVersion:_0x5a270b,toVersion:_0x239981,markerPath:markerPath='',runtimeLogger:_0x557c68}={}){const _0x70be50=_0x17a6e2;_0x557c68?.[_0x70be50(0x299)](_0x70be50(0x2ae)+_0x70be50(0x225)+_0x70be50(0x1c2)+_0x70be50(0x271),{'fromVersion':_0x5a270b,'toVersion':_0x239981});const _0x15a32d=await createRuntimeEnv(_0x2bd607,{'OPENCLAW_HOME':_0x393651[_0x70be50(0x28d)],'OPENCLAW_STATE_DIR':_0x393651['dataDir'],'OPENCLAW_CONFIG_PATH':getConfigPaths(_0x393651)[_0x70be50(0x2ca)+'th']});console[_0x70be50(0x300)](_0x70be50(0x2a4)+_0x70be50(0x2af)+_0x70be50(0x215)+_0x70be50(0x23c)+'enclaw\x20d'+_0x70be50(0x261)+'fix');const _0x1c0674=await runProcess(_0x2bd607[_0x70be50(0x234)+_0x70be50(0x24e)],[_0x2bd607[_0x70be50(0x2ae)+_0x70be50(0x1d4)],'doctor','--fix'],{'cwd':_0x2bd607[_0x70be50(0x2ae)+_0x70be50(0x2f0)+'ir'],'env':_0x15a32d,'label':'openclaw'+'\x20doctor\x20'+'--fix','timeoutMs':0x1d4c0});_0x557c68?.[_0x70be50(0x299)](_0x70be50(0x2ae)+_0x70be50(0x225)+'fix\x20comp'+_0x70be50(0x2e5),{'fromVersion':_0x5a270b,'toVersion':_0x239981,'stdout':_0x1c0674[_0x70be50(0x29d)][_0x70be50(0x2d6)]()[_0x70be50(0x2d4)](-0xfa0),'stderr':_0x1c0674[_0x70be50(0x209)][_0x70be50(0x2d6)]()[_0x70be50(0x2d4)](-0xfa0)}),markerPath&&(await writeJson(markerPath,{'openclawVersion':_0x2bd607[_0x70be50(0x2ae)+_0x70be50(0x1c7)],'fixedAt':new Date()[_0x70be50(0x2c8)+_0x70be50(0x24f)]()}),_0x557c68?.[_0x70be50(0x299)](_0x70be50(0x2ae)+_0x70be50(0x225)+_0x70be50(0x283)+_0x70be50(0x1e5)+'en',{'markerPath':markerPath,'openclawVersion':_0x2bd607[_0x70be50(0x2ae)+_0x70be50(0x1c7)]}));}export async function readRuntimeManifest(_0xc286eb){return await readJson(resolveManifestPath(_0xc286eb),{});}function _0x4be1(){const _0x428ec7=['wnloadin','NCLAW_CO','label','plugin\x20s','\x22\x20so\x20the','kill','ATE_DIR:','l\x20prepar','5125582XTeuLx','arch','LAW_STAT','ie-shell','fix\x20mark','512561YxFYzu','SCRIPT_D','download','--legacy','node/bin','\x20returne','sion\x20mis','string','eer','dataDir','platform','dules/np','tall\x20the','m-cli.js','https://','time]\x20do','extensio','source','NCLAW_ST','tarball:','all\x20','info','\x20is\x20miss','sion\x20val','skillsDi','stdout','pluginId','appId','agents','process.','pipe','match','[wujie-s','Version\x20','LocalPlu','\x22\x20\x22$SCRI','\x20install','rent','ignore','node','now','%USERPRO','openclaw','hell:run','/node','88HhYjRZ','cope\x20syn','manifest','w.mjs','\x20loaded','ath','add','runtime-','export\x20O','timeoutM','then','../asset','dAt','H%\x22==\x22\x22\x20','join','agents\x20s','PT_DIR/w','tar','\x22\x20%*','pluginSp','npm-cach','time','data','toISOStr','CONFIG_P','configPa','ecs','law\x20','\x20bin\x20was','flush','ady\x20curr','red\x20Open','installP','\x20package','set\x20\x22SCR','slice','product','trim','\x20timed\x20o','dataDirN','\x20depende','npm\x20pack','alid\x20pay','plugins','\x22==\x22\x22\x20se','package','w-extrac','plugins\x20','logo.mjs','synced','OME=','\x20version','leted','map','Run\x20\x22wuj','bin','local:','ame','\x22\x20at\x20','\x20written','config=','if\x20[\x20-t\x20','extract\x20','WorkingD','filename','runtimeR','-xJf','npm-glob','split','\x22\x20\x22$@\x22','local','ion','IPT_DIR=','install','ime\x20buil','eady\x20cur','error','\x22\x20\x22%SCRI','.node','log','rname\x20--','117066Aswxlv','Configur','.json','root','started','fix\x20star','ogger','resume','catch','m/bin/np','Version','OGO\x22\x20];\x20','claw-run','13655142mGjhdP','execPath','npmCli','201125LbKebL','pid','jie-shel','resolved','go.mjs','toString','wrapper\x20','Bin','base\x20alr','missing\x20','ules','syncOnly','ld\x20compl','1\x20]\x20&&\x20[','t\x20\x22OPENC','atch:\x20ma','ncies','time-too','\x20complet','headers','.tmp/run','location','singOpen','ME%\x22==\x22\x22','er\x20writt','102lGswfN','\x20paths','STATE_DI','2292854bJkqjw','d\x20an\x20inv','statusCo','PT_DIR/','env','has','&&\x20pwd)','R=\x22${OPE','tar.xz','unknown','versions','runtimeL','119460cLrQrr','w.json\x22','\x20-z\x20\x22$WU','CRIPT_DI','push','cwd','replace','node_mod','projectR','pack',',\x20shell.','-peer-de','registry','startsWi','FILE%\x5c','productN','ut\x20after','npm','/opencla','runtime','stderr','.cache','PENCLAW_','\x20signal=','replaceA','d\x20for\x20lo','runtime\x20','if\x20\x22%OPE','skills\x20s','rg/dist/','HOME=\x22${','NFIG_PAT','time]\x20ru','JIE_NO_L','load:\x20','SIGTERM','\x20runtime','skills','\x20resolve','isArray','\x20product','prepare\x20','ujie-log','\x20prepare','\x20can\x20ins','\x20can\x20be\x20','\x20failed\x20','node-v','\x20doctor\x20','path:\x20','nd\x20after','npm-cli.','unzip','ed\x20OpenC','w.json}\x22','Claw\x20ver','ing\x20\x22','-extract','Spec','node\x20ver','with\x20the','runtimeS','wujie-lo','nodeExec','mismatch','--omit=d','npm\x20inst','length','\x20return\x20','wujiecla','set\x20\x22OPE','nning\x20op','_modules','\x5copencla','-doctor.','stalling','agentsDi','--json','$HOME/','object','filter','\x20not\x20fou','null','JSON:\x20','exec\x20\x22$S','ced','win32','sion.','nifest=','utable','ing','OPENCLAW','d\x20to\x20','every','E_DIR=','rg/','close','wBin','utf8','ginPaths','NCLAW_HO','ATH=\x22${O','version','PT_DIR%','s/wujie-','product\x20','dist','/node_mo','octor\x20--','OpenClaw','rebuilt\x20','x64','IR=$(CDP','win','8cXkTSJ','oot','--\x20\x22$(di','ynced','.npmjs.o','\x20configu','--omit=p','lib','.opencla','ENCLAW_H','ted','\x20\x20\x22$SCRI','836RVhRer','\x20did\x20not','nodeVers','fix\x20alre'];_0x4be1=function(){return _0x428ec7;};return _0x4be1();}export async function loadRuntimeInfo(_0x3ee1dc){const _0x1fa0e0=resolveRuntimeRoot(_0x3ee1dc),_0xc4af2d=await readRuntimeManifest(_0x1fa0e0);return createRuntimeInfoFromManifest(_0x1fa0e0,_0xc4af2d);}function createRuntimeInfoFromManifest(_0x13b78c,_0x49138d,_0x17ad2a={}){const _0x5c4138=_0x17a6e2;for(const _0x3b5ea8 of['nodeExec'+'utable',_0x5c4138(0x1cc),_0x5c4138(0x2ae)+_0x5c4138(0x2f0)+'ir',_0x5c4138(0x2ae)+_0x5c4138(0x1d4)]){if(typeof _0x49138d[_0x3b5ea8]!==_0x5c4138(0x28b)||!_0x49138d[_0x3b5ea8][_0x5c4138(0x2d6)]())throw new Error(_0x5c4138(0x20f)+_0x5c4138(0x2b3)+_0x5c4138(0x29a)+_0x5c4138(0x22d)+_0x3b5ea8+_0x5c4138(0x2eb)+resolveManifestPath(_0x13b78c)+(';\x20run\x20wu'+_0x5c4138(0x1cf)+_0x5c4138(0x27e)+'e'));}const _0x3af176=resolve(_0x13b78c,_0x49138d[_0x5c4138(0x234)+'utable']),_0x121453=resolve(_0x13b78c,_0x49138d[_0x5c4138(0x1cc)]),_0x57dc25=resolve(_0x13b78c,_0x49138d[_0x5c4138(0x2ae)+_0x5c4138(0x2f0)+'ir']),_0x213fc8=resolve(_0x13b78c,_0x49138d[_0x5c4138(0x2ae)+_0x5c4138(0x1d4)]),_0x28b8e1=Array[_0x5c4138(0x21c)](_0x49138d[_0x5c4138(0x2dc)])?_0x49138d[_0x5c4138(0x2dc)][_0x5c4138(0x2e6)](_0x3c59f6=>({..._0x3c59f6,'installPath':resolve(_0x13b78c,_0x3c59f6[_0x5c4138(0x2d1)+_0x5c4138(0x2b6)])})):[],_0x31fe58=_0x17ad2a['allowMis'+_0x5c4138(0x1e3)+'Claw']?[_0x3af176,_0x121453]:[_0x3af176,_0x121453,_0x57dc25,_0x213fc8];for(const _0x5b3e11 of _0x31fe58){if(!existsSync(_0x5b3e11))throw new Error('runtime\x20'+_0x5c4138(0x1d6)+_0x5c4138(0x226)+_0x5b3e11);}return{'runtimeRoot':_0x13b78c,'manifest':_0x49138d,'openclawVersion':_0x49138d[_0x5c4138(0x2ae)+_0x5c4138(0x1c7)]||_0x5c4138(0x1f2),'nodeExecutable':_0x3af176,'npmCli':_0x121453,'openclawWorkingDir':_0x57dc25,'openclawBin':_0x213fc8,'plugins':_0x28b8e1};}export async function spawnClaw(_0x9a40b6,_0x955069=[],_0x68b944={}){const _0x202616=_0x17a6e2,_0x447a90=await loadRuntimeInfo(_0x9a40b6),_0x2fe149=await createRuntimeEnv(_0x447a90,_0x68b944[_0x202616(0x1ed)]??{});return spawn(_0x447a90[_0x202616(0x234)+'utable'],[_0x447a90[_0x202616(0x2ae)+_0x202616(0x1d4)],..._0x955069],{'cwd':_0x447a90[_0x202616(0x2ae)+_0x202616(0x2f0)+'ir'],'stdio':_0x202616(0x2a2),..._0x68b944,'env':_0x2fe149});}export async function runClawOnce(_0x30ae3d,_0x302052=[],_0x48b7e1=0x15f90){const _0x3051ca=await spawnClaw(_0x30ae3d,_0x302052);return await new Promise((_0x4b31ac,_0x2aa072)=>{const _0x5ac713=_0x2a9a;let _0x4d95b8='',_0x4e4bc4='',_0x102b62=![];const _0x262ca4=setTimeout(()=>{const _0x1d853f=_0x2a9a;if(_0x102b62)return;_0x102b62=!![],_0x3051ca[_0x1d853f(0x27c)]('SIGTERM'),_0x2aa072(new Error('openclaw'+_0x1d853f(0x2d7)+_0x1d853f(0x205)+'\x20'+_0x48b7e1+'ms'));},_0x48b7e1);_0x3051ca[_0x5ac713(0x29d)]['on']('data',_0x14bfa1=>{_0x4d95b8+=_0x14bfa1['toString']();}),_0x3051ca[_0x5ac713(0x209)]['on'](_0x5ac713(0x2c7),_0x38a6b2=>{const _0x4c098c=_0x5ac713;_0x4e4bc4+=_0x38a6b2[_0x4c098c(0x1d2)]();}),_0x3051ca['on'](_0x5ac713(0x2fd),_0x76c814=>{if(_0x102b62)return;_0x102b62=!![],clearTimeout(_0x262ca4),_0x2aa072(_0x76c814);}),_0x3051ca['on'](_0x5ac713(0x255),(_0x2cae3b,_0x20b2c5)=>{if(_0x102b62)return;_0x102b62=!![],clearTimeout(_0x262ca4),_0x4b31ac({'code':_0x2cae3b,'signal':_0x20b2c5,'stdout':_0x4d95b8,'stderr':_0x4e4bc4});});});}async function createRuntimeEnv(_0x2d7f51,_0x10d089={}){const _0x670251=_0x17a6e2,_0x9a0e2d=process.env.OPENCLAW_STATE_DIR||'',_0x364760=_0x9a0e2d?join(_0x9a0e2d,_0x670251(0x1c9)+_0x670251(0x1de)+'ls'):join(_0x2d7f51[_0x670251(0x2f2)+'oot'],'.tools'),_0x2dbf50=join(_0x364760,_0x670251(0x2f4)+'al'),_0x56c92b=join(_0x364760,_0x670251(0x2c5)+'e'),_0x37e465=join(_0x2dbf50,_0x670251(0x2e8));await mkdir(_0x37e465,{'recursive':!![]}),await mkdir(_0x56c92b,{'recursive':!![]});const _0x2079f8=[_0x37e465,dirname(_0x2d7f51[_0x670251(0x234)+_0x670251(0x24e)]),process.env.PATH||''];return{...process.env,..._0x10d089,'PATH':_0x2079f8[_0x670251(0x245)](Boolean)[_0x670251(0x2bf)](delimiter),'npm_config_prefix':_0x2dbf50,'NPM_CONFIG_PREFIX':_0x2dbf50,'npm_config_cache':_0x56c92b,'NPM_CONFIG_CACHE':_0x56c92b,'npm_config_registry':_0x670251(0x292)+_0x670251(0x201)+_0x670251(0x26b)+_0x670251(0x254),'NPM_CONFIG_REGISTRY':_0x670251(0x292)+'registry'+_0x670251(0x26b)+_0x670251(0x254),'npm_execpath':_0x2d7f51[_0x670251(0x1cc)],'npm_node_execpath':_0x2d7f51['nodeExec'+_0x670251(0x24e)],'OPENCLAW_RUNTIME_NPM_PREFIX':_0x2dbf50,'OPENCLAW_RUNTIME_NPM_BIN':_0x37e465,'OPENCLAW_RUNTIME_NPM_REGISTRY':'https://'+_0x670251(0x201)+_0x670251(0x26b)+'rg/'};}async function syncProductPlugins(_0x4b7cc4,_0x146edd,_0xa1204b){const _0x20af7e=_0x17a6e2,_0x2cfe49=join(_0x146edd,_0x20af7e(0x2ae),_0x20af7e(0x25f),_0x20af7e(0x294)+'ns'),_0x10766b=[];for(const _0x1fbd32 of _0x4b7cc4[_0x20af7e(0x2ae)]['resolved'+_0x20af7e(0x2a6)+_0x20af7e(0x258)]){const _0x239969=await getPackageMetadata(_0x1fbd32),_0x21d28d=await readPluginManifest(_0x1fbd32),_0x73b00a=join(_0x2cfe49,_0x239969['pluginId']);await copyDirFresh(_0x1fbd32,_0x73b00a),_0x10766b[_0x20af7e(0x1f9)]({'pluginId':_0x239969[_0x20af7e(0x29e)],'source':'local','spec':'local:'+_0x1fbd32,'installPath':toRuntimeRelative(_0x146edd,_0x73b00a),'version':_0x239969['version'],'resolvedName':_0x239969['name'],'resolvedVersion':_0x239969[_0x20af7e(0x25b)],'resolvedSpec':_0x20af7e(0x2e9)+_0x1fbd32,'integrity':'','shasum':'','resolvedAt':new Date()[_0x20af7e(0x2c8)+_0x20af7e(0x24f)](),'installedAt':new Date()[_0x20af7e(0x2c8)+'ing'](),'agentScope':_0x21d28d['agentSco'+'pe'],'skills':_0x21d28d[_0x20af7e(0x21a)]});}const _0x592f33=new Set(_0x10766b[_0x20af7e(0x2e6)](_0x486b30=>_0x486b30['pluginId'])),_0x1b9007=Array[_0x20af7e(0x21c)](_0xa1204b[_0x20af7e(0x2dc)])?_0xa1204b[_0x20af7e(0x2dc)][_0x20af7e(0x245)](_0x480792=>!_0x592f33[_0x20af7e(0x1ee)](_0x480792[_0x20af7e(0x29e)])):[];_0xa1204b[_0x20af7e(0x2dc)]=[..._0x1b9007,..._0x10766b];}async function syncManifestPluginScope(_0x2134be,_0x2da22a,_0x55d87f){const _0x3c7471=_0x17a6e2,_0x46dd9f=join(_0x2da22a,'openclaw',_0x3c7471(0x25f),_0x3c7471(0x294)+'ns'),_0x572aa3=new Set(_0x2134be['openclaw'][_0x3c7471(0x2c4)+'ecs']??[]),_0x274904=new Set([..._0x572aa3][_0x3c7471(0x2e6)](_0x4c6614=>_0x4c6614[_0x3c7471(0x1fb)](/^npm:/,''))[_0x3c7471(0x2e6)](_0x550d1d=>{const _0x5b7120=_0x3c7471;if(_0x550d1d[_0x5b7120(0x202)+'th']('@')){const _0x11a26d=_0x550d1d['split']('@');return _0x11a26d['length']>=0x3?'@'+_0x11a26d[0x1]:_0x550d1d;}return _0x550d1d[_0x5b7120(0x2f5)]('@')[0x0];})[_0x3c7471(0x245)](Boolean)),_0x1d7268=new Set();for(const _0x33bbed of _0x2134be[_0x3c7471(0x2ae)][_0x3c7471(0x1d0)+_0x3c7471(0x2a6)+'ginPaths']){const _0x15962e=await getPackageMetadata(_0x33bbed);if(_0x15962e[_0x3c7471(0x29e)])_0x1d7268[_0x3c7471(0x2b7)](_0x15962e[_0x3c7471(0x29e)]);}const _0x11625b=Array['isArray'](_0x55d87f[_0x3c7471(0x2dc)])?_0x55d87f[_0x3c7471(0x2dc)]:[];_0x55d87f[_0x3c7471(0x2c4)+_0x3c7471(0x2cb)]=[..._0x2134be[_0x3c7471(0x2ae)][_0x3c7471(0x2c4)+_0x3c7471(0x2cb)],..._0x2134be[_0x3c7471(0x2ae)][_0x3c7471(0x1d0)+'LocalPlu'+_0x3c7471(0x258)]['map'](_0x42774b=>'local:'+_0x42774b)],_0x55d87f[_0x3c7471(0x2dc)]=_0x11625b['filter'](_0x14a20c=>{const _0xd04b52=_0x3c7471;if(!_0x14a20c||typeof _0x14a20c!==_0xd04b52(0x244))return![];if(_0x14a20c['source']===_0xd04b52(0x2f7))return _0x1d7268['has'](_0x14a20c[_0xd04b52(0x29e)]);if(_0x14a20c[_0xd04b52(0x295)]===_0xd04b52(0x206))return _0x572aa3['has'](_0x14a20c['spec'])||_0x572aa3[_0xd04b52(0x1ee)](_0x14a20c[_0xd04b52(0x1d0)+_0xd04b52(0x22f)])||_0x274904[_0xd04b52(0x1ee)](_0x14a20c[_0xd04b52(0x1d0)+'Name']);return![];});const _0xf04b29=new Set(_0x55d87f['plugins']['map'](_0x55f8a9=>_0x55f8a9[_0x3c7471(0x29e)]));for(const _0x4d28c3 of _0x11625b){if(!_0x4d28c3[_0x3c7471(0x29e)]||_0xf04b29['has'](_0x4d28c3['pluginId']))continue;const _0x38f2ab=typeof _0x4d28c3[_0x3c7471(0x2d1)+_0x3c7471(0x2b6)]===_0x3c7471(0x28b)&&_0x4d28c3[_0x3c7471(0x2d1)+_0x3c7471(0x2b6)][_0x3c7471(0x2d6)]()?resolve(_0x2da22a,_0x4d28c3['installP'+_0x3c7471(0x2b6)]):join(_0x46dd9f,_0x4d28c3[_0x3c7471(0x29e)]),_0x556fd9=relative(_0x46dd9f,_0x38f2ab);if(_0x556fd9[_0x3c7471(0x202)+'th']('..')||_0x556fd9==='')continue;await rm(_0x38f2ab,{'recursive':!![],'force':!![]});}}async function syncProductAgents(_0x3df82b,_0x184f8d,_0x5a9f23){const _0x1e1f5f=_0x17a6e2,_0x30f033=join(_0x184f8d,_0x1e1f5f(0x2ae),_0x1e1f5f(0x2a0));await copyDirFresh(_0x3df82b[_0x1e1f5f(0x2ae)][_0x1e1f5f(0x241)+'r'],_0x30f033),_0x5a9f23[_0x1e1f5f(0x2a0)]={'source':_0x1e1f5f(0x2d5),'installPath':toRuntimeRelative(_0x184f8d,_0x30f033)};}async function syncProductSkills(_0xe72375,_0x29e93a,_0x7026a9){const _0x223ff5=_0x17a6e2,_0x410988=join(_0x29e93a,_0x223ff5(0x2ae),_0x223ff5(0x21a));await copyDirFresh(_0xe72375[_0x223ff5(0x2ae)][_0x223ff5(0x29c)+'r'],_0x410988),_0x7026a9[_0x223ff5(0x21a)]={'source':_0x223ff5(0x2d5),'installPath':toRuntimeRelative(_0x29e93a,_0x410988)};}
@@ -1 +1 @@
1
- function _0x4a16(){const _0x27704a=['parse','1070547NfUxqw','map','ory','filter','1344332DzhHBH','3538476aCQNVf','isArray','isDirect','trim','openclaw','package.','1878738bFFOnN','utf8','stringif','name','object','4856310oWUsAL','5dfbPfT','replaceA','string','3440DQpsQt','50872QPnHeH','18477jxHMkS','.plugin.','203YDCWKH','json'];_0x4a16=function(){return _0x27704a;};return _0x4a16();}(function(_0x5bc940,_0x277b60){const _0x39254a=_0x4c86,_0x41736b=_0x5bc940();while(!![]){try{const _0x52b471=-parseInt(_0x39254a(0x1e2))/0x1+parseInt(_0x39254a(0x1e6))/0x2+parseInt(_0x39254a(0x1ed))/0x3+-parseInt(_0x39254a(0x1e7))/0x4+-parseInt(_0x39254a(0x1f3))/0x5*(-parseInt(_0x39254a(0x1f2))/0x6)+parseInt(_0x39254a(0x1df))/0x7*(-parseInt(_0x39254a(0x1dc))/0x8)+-parseInt(_0x39254a(0x1dd))/0x9*(-parseInt(_0x39254a(0x1db))/0xa);if(_0x52b471===_0x277b60)break;else _0x41736b['push'](_0x41736b['shift']());}catch(_0x4491c5){_0x41736b['push'](_0x41736b['shift']());}}}(_0x4a16,0xa4a94));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(_0xd37e8c){const _0x5908cb=_0x4c86;return _0xd37e8c&&typeof _0xd37e8c===_0x5908cb(0x1f1)&&!Array[_0x5908cb(0x1e8)](_0xd37e8c)?_0xd37e8c:{};}export function asStringArray(_0x10c538){const _0x181702=_0x4c86;return Array[_0x181702(0x1e8)](_0x10c538)?_0x10c538[_0x181702(0x1e5)](_0x28a60b=>typeof _0x28a60b===_0x181702(0x1da)&&_0x28a60b[_0x181702(0x1ea)]())[_0x181702(0x1e3)](_0x180176=>_0x180176['trim']()):[];}export function dedupeStrings(_0x362ffc){const _0x4b7d03=_0x4c86;return[...new Set(_0x362ffc[_0x4b7d03(0x1e5)](Boolean))];}export function getTrimmedString(_0xb6ae92){const _0x16d540=_0x4c86;return typeof _0xb6ae92===_0x16d540(0x1da)?_0xb6ae92['trim']():'';}export async function readJson(_0x7bcdf1,_0x1f67e1={}){const _0x50f7e0=_0x4c86;try{return JSON[_0x50f7e0(0x1e1)](await readFile(_0x7bcdf1,_0x50f7e0(0x1ee)));}catch{return _0x1f67e1;}}export async function writeJson(_0x301e08,_0xc24d43){const _0x10e98e=_0x4c86;await mkdir(dirname(_0x301e08),{'recursive':!![]}),await writeFile(_0x301e08,JSON[_0x10e98e(0x1ef)+'y'](_0xc24d43,null,0x2)+'\x0a',_0x10e98e(0x1ee));}export async function copyDirFresh(_0x396361,_0x29eb6e){await rm(_0x29eb6e,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await mkdir(dirname(_0x29eb6e),{'recursive':!![]}),await cp(_0x396361,_0x29eb6e,{'recursive':!![]});}export async function ensureDir(_0x3e0df2){await mkdir(_0x3e0df2,{'recursive':!![]});}export function pathExists(_0x3642d1){return existsSync(_0x3642d1);}export async function listDirs(_0xfc74a9){const _0x36a727=_0x4c86;try{const _0x4f6f9f=await readdir(_0xfc74a9,{'withFileTypes':!![],'encoding':'utf8'});return _0x4f6f9f['filter'](_0x273568=>_0x273568[_0x36a727(0x1e9)+_0x36a727(0x1e4)]())['map'](_0x259c64=>_0x259c64[_0x36a727(0x1f0)]);}catch{return[];}}export async function getPackageMetadata(_0x510172){const _0x5c4aa3=_0x4c86,_0x562fc5=await readJson(join(_0x510172,_0x5c4aa3(0x1ec)+_0x5c4aa3(0x1e0)),{}),_0x545649=asRecord(_0x562fc5['openclaw']);return{'name':getTrimmedString(_0x562fc5['name'])||basename(_0x510172),'version':getTrimmedString(_0x562fc5['version'])||'0.0.0','pluginId':getTrimmedString(_0x545649['id'])||getTrimmedString(_0x562fc5[_0x5c4aa3(0x1eb)+'Id'])||basename(_0x510172)};}function _0x4c86(_0x427c98,_0x3d3230){_0x427c98=_0x427c98-0x1da;const _0x4a1659=_0x4a16();let _0x4c864d=_0x4a1659[_0x427c98];return _0x4c864d;}export async function readPluginManifest(_0x3efae4){const _0x1a7e06=_0x4c86,_0x3a9ec0=join(_0x3efae4,_0x1a7e06(0x1eb)+_0x1a7e06(0x1de)+'json'),_0x510265=await readJson(_0x3a9ec0,{});return asRecord(_0x510265);}export async function hasFile(_0x10836e){try{const _0x15ce79=await stat(_0x10836e);return _0x15ce79['isFile']();}catch{return![];}}export function toRuntimeRelative(_0x16c48e,_0x5622fe){const _0x124ac2=_0x4c86;return relative(_0x16c48e,_0x5622fe)[_0x124ac2(0x1f4)+'ll']('\x5c','/');}
1
+ (function(_0x5250e0,_0x212c1d){const _0x30615e=_0x382e,_0x29e927=_0x5250e0();while(!![]){try{const _0x38106a=-parseInt(_0x30615e(0xd6))/0x1*(parseInt(_0x30615e(0xc4))/0x2)+parseInt(_0x30615e(0xcb))/0x3+parseInt(_0x30615e(0xca))/0x4*(-parseInt(_0x30615e(0xc7))/0x5)+-parseInt(_0x30615e(0xdd))/0x6*(-parseInt(_0x30615e(0xc5))/0x7)+parseInt(_0x30615e(0xc3))/0x8*(-parseInt(_0x30615e(0xc9))/0x9)+-parseInt(_0x30615e(0xe0))/0xa*(parseInt(_0x30615e(0xdf))/0xb)+parseInt(_0x30615e(0xc8))/0xc;if(_0x38106a===_0x212c1d)break;else _0x29e927['push'](_0x29e927['shift']());}catch(_0x24e483){_0x29e927['push'](_0x29e927['shift']());}}}(_0x19ed,0x5fe85));import{existsSync}from'node:fs';import{cp,mkdir,readFile,readdir,rm,stat,writeFile}from'node:fs/promises';function _0x19ed(){const _0x11a5de=['8WqnNjf','272208PzaLvr','797881QjoZdM','name','19405TjtqMu','12245484yFxurJ','3503889spHQXX','316gnQMYy','1016094xJOYcX','filter','isFile','openclaw','string','.plugin.','0.0.0','version','isDirect','ory','map','4Jwtymt','replaceA','stringif','utf8','json','trim','parse','18juCAcU','package.','11SqepqQ','679310NJHbNt','isArray'];_0x19ed=function(){return _0x11a5de;};return _0x19ed();}import{basename,dirname,join,relative}from'node:path';export function asRecord(_0x3977d1){const _0x2fb10c=_0x382e;return _0x3977d1&&typeof _0x3977d1==='object'&&!Array[_0x2fb10c(0xc2)](_0x3977d1)?_0x3977d1:{};}export function asStringArray(_0x157ffe){const _0x1a86a6=_0x382e;return Array['isArray'](_0x157ffe)?_0x157ffe[_0x1a86a6(0xcc)](_0x328dcd=>typeof _0x328dcd===_0x1a86a6(0xcf)&&_0x328dcd['trim']())[_0x1a86a6(0xd5)](_0x5cf1d7=>_0x5cf1d7['trim']()):[];}export function dedupeStrings(_0x171ed0){const _0x49b7c6=_0x382e;return[...new Set(_0x171ed0[_0x49b7c6(0xcc)](Boolean))];}export function getTrimmedString(_0x51cd57){const _0x500382=_0x382e;return typeof _0x51cd57===_0x500382(0xcf)?_0x51cd57[_0x500382(0xdb)]():'';}export async function readJson(_0x318a6e,_0x4cdc82={}){const _0x8407=_0x382e;try{return JSON[_0x8407(0xdc)](await readFile(_0x318a6e,_0x8407(0xd9)));}catch{return _0x4cdc82;}}export async function writeJson(_0xadd7f2,_0x70f70a){const _0x4338f0=_0x382e;await mkdir(dirname(_0xadd7f2),{'recursive':!![]}),await writeFile(_0xadd7f2,JSON[_0x4338f0(0xd8)+'y'](_0x70f70a,null,0x2)+'\x0a',_0x4338f0(0xd9));}export async function copyDirFresh(_0x41dec7,_0x834a25){await rm(_0x834a25,{'recursive':!![],'force':!![],'maxRetries':0x5,'retryDelay':0x96}),await mkdir(dirname(_0x834a25),{'recursive':!![]}),await cp(_0x41dec7,_0x834a25,{'recursive':!![]});}export async function ensureDir(_0x2661e0){await mkdir(_0x2661e0,{'recursive':!![]});}export function pathExists(_0x22d64a){return existsSync(_0x22d64a);}export async function listDirs(_0x2c7fb1){const _0x438aa2=_0x382e;try{const _0x5cb2e7=await readdir(_0x2c7fb1,{'withFileTypes':!![],'encoding':_0x438aa2(0xd9)});return _0x5cb2e7['filter'](_0x38a1e9=>_0x38a1e9[_0x438aa2(0xd3)+_0x438aa2(0xd4)]())[_0x438aa2(0xd5)](_0x4265e8=>_0x4265e8[_0x438aa2(0xc6)]);}catch{return[];}}export async function getPackageMetadata(_0xbb8724){const _0x5d3a19=_0x382e,_0x41dfb7=await readJson(join(_0xbb8724,_0x5d3a19(0xde)+_0x5d3a19(0xda)),{}),_0x46e07a=asRecord(_0x41dfb7['openclaw']);return{'name':getTrimmedString(_0x41dfb7['name'])||basename(_0xbb8724),'version':getTrimmedString(_0x41dfb7[_0x5d3a19(0xd2)])||_0x5d3a19(0xd1),'pluginId':getTrimmedString(_0x46e07a['id'])||getTrimmedString(_0x41dfb7[_0x5d3a19(0xce)+'Id'])||basename(_0xbb8724)};}export async function readPluginManifest(_0x3d07c2){const _0x23711f=_0x382e,_0x35e3dc=join(_0x3d07c2,_0x23711f(0xce)+_0x23711f(0xd0)+'json'),_0x27caf1=await readJson(_0x35e3dc,{});return asRecord(_0x27caf1);}function _0x382e(_0x39119d,_0x45a4c1){_0x39119d=_0x39119d-0xc2;const _0x19ed5f=_0x19ed();let _0x382e4f=_0x19ed5f[_0x39119d];return _0x382e4f;}export async function hasFile(_0x5c08e1){const _0x201fc0=_0x382e;try{const _0x421342=await stat(_0x5c08e1);return _0x421342[_0x201fc0(0xcd)]();}catch{return![];}}export function toRuntimeRelative(_0x4a7b8c,_0x5d2e5c){const _0x36aaa5=_0x382e;return relative(_0x4a7b8c,_0x5d2e5c)[_0x36aaa5(0xd7)+'ll']('\x5c','/');}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wujie-shell/core",
3
- "version": "0.1.5",
3
+ "version": "1.0.0",
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/logger": "0.1.5",
31
- "@wujie-shell/config": "0.1.5"
30
+ "@wujie-shell/config": "1.0.0",
31
+ "@wujie-shell/logger": "1.0.0"
32
32
  },
33
33
  "scripts": {
34
34
  "build": "node ../../scripts/build-packages.mjs --package @wujie-shell/core"