@whalent/agent 0.3.92 → 0.3.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';const a0_0x11309b=a0_0x1032;(function(_0x395b7c,_0x56d622){const _0x2cccd8=a0_0x1032,_0x3d8709=_0x395b7c();while(!![]){try{const _0x56456d=parseInt(_0x2cccd8(0x152))/0x1+-parseInt(_0x2cccd8(0xef))/0x2*(parseInt(_0x2cccd8(0x13b))/0x3)+parseInt(_0x2cccd8(0x166))/0x4+-parseInt(_0x2cccd8(0xfc))/0x5+-parseInt(_0x2cccd8(0x139))/0x6*(parseInt(_0x2cccd8(0x172))/0x7)+parseInt(_0x2cccd8(0x15c))/0x8+-parseInt(_0x2cccd8(0x102))/0x9*(parseInt(_0x2cccd8(0x136))/0xa);if(_0x56456d===_0x56d622)break;else _0x3d8709['push'](_0x3d8709['shift']());}catch(_0x254d8a){_0x3d8709['push'](_0x3d8709['shift']());}}}(a0_0x176f,0x2d9f6));var __create=Object['create'],__defProp=Object[a0_0x11309b(0x111)],__getOwnPropDesc=Object[a0_0x11309b(0xf5)+a0_0x11309b(0x168)],__getOwnPropNames=Object['getOwnPropertyNames'],__getProtoOf=Object['getPrototypeOf'],__hasOwnProp=Object[a0_0x11309b(0xf3)][a0_0x11309b(0x107)],__copyProps=(_0xfe6f55,_0x2d894e,_0xbacaca,_0x109513)=>{const _0x2a6e7c=a0_0x11309b;if(_0x2d894e&&typeof _0x2d894e==='object'||typeof _0x2d894e===_0x2a6e7c(0x14d)){for(let _0x505143 of __getOwnPropNames(_0x2d894e))if(!__hasOwnProp[_0x2a6e7c(0x100)](_0xfe6f55,_0x505143)&&_0x505143!==_0xbacaca)__defProp(_0xfe6f55,_0x505143,{'get':()=>_0x2d894e[_0x505143],'enumerable':!(_0x109513=__getOwnPropDesc(_0x2d894e,_0x505143))||_0x109513['enumerable']});}return _0xfe6f55;},__toESM=(_0x411cf0,_0x1202ed,_0x4d0ba5)=>(_0x4d0ba5=_0x411cf0!=null?__create(__getProtoOf(_0x411cf0)):{},__copyProps(_0x1202ed||!_0x411cf0||!_0x411cf0[a0_0x11309b(0x116)]?__defProp(_0x4d0ba5,a0_0x11309b(0x11a),{'value':_0x411cf0,'enumerable':!![]}):_0x4d0ba5,_0x411cf0)),import_child_process=require(a0_0x11309b(0x10a)),fs=__toESM(require('fs'),0x1),import_module=require(a0_0x11309b(0x14f)),os=__toESM(require('os'),0x1),path=__toESM(require('path'),0x1),WRAPPER_PKG_NAME=a0_0x11309b(0x11f),CORE_PKG_NAME='@whalent/agent-core',NPM_REGISTRY='https://registry.npm'+a0_0x11309b(0x147),SUPERVISED_RESTART_CODE=0x4b,NPM_VIEW_TIMEOUT_MS=0x3a98,HEALTH_TIMEOUT_MS=0xafc8,MIN_RESTART_DELAY_MS=0x3e8,MAX_RESTART_DELAY_MS=0xea60,MAX_CRASHES_IN_WINDOW=0x3,CRASH_WINDOW_MS=0x3*0x3c*0x3e8,NPM_INSTALL_TIMEOUT_MS=0xa*0x3c*0x3e8,NPM_INSTALL_MAX_BUFFER=0x20*0x400*0x400,FATAL_PATTERN=/\[(?:agent|daemon|wrapper)\][^\n]*\bFatal error:[^\n]+|\[daemon\] Failed to start:[^\n]+|Error:[^\n]+/,WRAPPER_VERSION=readWrapperVersion(),CHECKED_PTY_HELPERS=new Set();function wrapperBaseDir(){return __dirname;}function configDir(){const _0x58632f=a0_0x11309b;return path[_0x58632f(0x171)](os['homedir'](),_0x58632f(0x14e));}function upgradeStatePath(){return path['join'](configDir(),'core-upgrade.json');}function lastCrashFilePath(){const _0x167a06=a0_0x11309b;return path[_0x167a06(0x171)](configDir(),'last-crash.json');}function writeLastCrash(_0x24eafb){const _0x36f5b3=a0_0x11309b;try{fs['mkdirSync'](configDir(),{'recursive':!![]});const _0x3e2d37={..._0x24eafb,'reported':![]};fs['writeFileSync'](lastCrashFilePath(),JSON[_0x36f5b3(0x135)](_0x3e2d37,null,0x2),_0x36f5b3(0x12f));}catch{}}function readWrapperVersion(){const _0x16b94d=a0_0x11309b;try{const _0x13e00a=JSON[_0x16b94d(0x105)](fs[_0x16b94d(0xea)](path['join'](wrapperBaseDir(),'..','package.json'),_0x16b94d(0x12f)));return String(_0x13e00a['version']||_0x16b94d(0x163));}catch{return _0x16b94d(0x163);}}function readUpgradeState(){const _0x1442a2=a0_0x11309b;try{return JSON[_0x1442a2(0x105)](fs[_0x1442a2(0xea)](upgradeStatePath(),'utf-8'));}catch{return null;}}function writeUpgradeState(_0x3f98cf){const _0x270903=a0_0x11309b;try{fs[_0x270903(0xf0)](configDir(),{'recursive':!![]}),fs['writeFileSync'](upgradeStatePath(),JSON['stringify']({..._0x3f98cf,'updated_at':Date['now']()},null,0x2),'utf-8');}catch{}}function run(_0x32bd00,_0x5443aa,_0x37e66e=process.env){const _0x1df485=a0_0x11309b;return(0x0,import_child_process[_0x1df485(0x155)])(_0x32bd00,_0x5443aa,{'encoding':_0x1df485(0x167),'timeout':NPM_INSTALL_TIMEOUT_MS,'maxBuffer':NPM_INSTALL_MAX_BUFFER,'env':_0x37e66e,'shell':![]});}function runNpmView(_0x3d03b6){const _0x2d1f42=a0_0x11309b,_0x1c939e=resolveExecutable(_0x2d1f42(0xfa));if(!_0x1c939e)return{'status':0x7f,'stdout':'','stderr':_0x2d1f42(0x144),'error':new Error('npm\x20not\x20found')};return(0x0,import_child_process[_0x2d1f42(0x155)])(_0x1c939e,_0x3d03b6,{'encoding':'utf8','timeout':NPM_VIEW_TIMEOUT_MS,'maxBuffer':0x400*0x400,'env':process.env,'shell':![]});}function npmRootGlobal(){const _0x1bd509=a0_0x11309b,_0x144181=resolveExecutable(_0x1bd509(0xfa));if(!_0x144181)return'';const _0x763782=run(_0x144181,[_0x1bd509(0x129),'-g']);if(_0x763782[_0x1bd509(0x16c)]!==0x0)return'';return String(_0x763782['stdout']||'')[_0x1bd509(0x137)]();}function compareSemver(_0x5d064f,_0x5d458c){const _0x4d3ca5=a0_0x11309b,_0x2f8547=String(_0x5d064f||'')['replace'](/^v/,'')['split'](/[.-]/)['map'](_0x1f822f=>Number[_0x4d3ca5(0x112)](_0x1f822f,0xa)||0x0),_0x3f1df2=String(_0x5d458c||'')[_0x4d3ca5(0x142)](/^v/,'')['split'](/[.-]/)['map'](_0x7f3046=>Number[_0x4d3ca5(0x112)](_0x7f3046,0xa)||0x0);for(let _0x2693d8=0x0;_0x2693d8<Math['max'](_0x2f8547[_0x4d3ca5(0x11c)],_0x3f1df2['length'],0x3);_0x2693d8++){const _0x22f678=_0x2f8547[_0x2693d8]||0x0,_0x249a5a=_0x3f1df2[_0x2693d8]||0x0;if(_0x22f678>_0x249a5a)return 0x1;if(_0x22f678<_0x249a5a)return-0x1;}return 0x0;}function resolveExecutable(_0x1c1c62){const _0xfe9a7c=a0_0x11309b,_0x5725b2=process[_0xfe9a7c(0x154)]===_0xfe9a7c(0xfb)?'where.exe':'which';try{const _0xee42d2=(0x0,import_child_process[_0xfe9a7c(0x155)])(_0x5725b2,[_0x1c1c62],{'encoding':_0xfe9a7c(0x167),'timeout':0xbb8,'shell':![]});if(_0xee42d2['status']!==0x0)return'';return String(_0xee42d2['stdout']||'')['split'](/\r?\n/)[_0xfe9a7c(0x106)](_0x291d38=>_0x291d38[_0xfe9a7c(0x137)]())['filter'](Boolean)[0x0]||'';}catch{return'';}}function skipWrapperUpdateCheck(){const _0x191d23=a0_0x11309b,_0x380525=String(process.env.WHALENT_SKIP_UPDATE_CHECK||process.env.WHALENT_NO_UPDATE_CHECK||process.env.WHALENT_SKIP_WRAPPER_UPDATE||'')[_0x191d23(0x137)]()['toLowerCase']();return _0x380525==='1'||_0x380525===_0x191d23(0x119)||_0x380525===_0x191d23(0x115)||_0x380525==='on';}function latestWrapperVersion(){const _0x5e1d99=a0_0x11309b,_0x16fce0=runNpmView([_0x5e1d99(0x114),WRAPPER_PKG_NAME+_0x5e1d99(0x124),'version',_0x5e1d99(0x13f)+NPM_REGISTRY]);if(_0x16fce0['status']!==0x0)return'';return String(_0x16fce0[_0x5e1d99(0x125)]||'')[_0x5e1d99(0x137)]()['split'](/\r?\n/)[_0x5e1d99(0x15d)](Boolean)['pop']()||'';}function installWrapperVersion(_0xc90f1a){const _0x4d8ba3=a0_0x11309b,_0x59eb95=resolveExecutable(_0x4d8ba3(0xfa));if(!_0x59eb95)return{'ok':![],'output':'npm\x20not\x20found\x20on\x20PAT'+'H'};const _0x2862dc=run(_0x59eb95,['install','-g',WRAPPER_PKG_NAME+'@'+_0xc90f1a,'--registry='+NPM_REGISTRY]),_0x1d6590=((_0x2862dc[_0x4d8ba3(0x125)]||'')+'\x0a'+(_0x2862dc[_0x4d8ba3(0xed)]||''))[_0x4d8ba3(0x137)]();return{'ok':_0x2862dc['status']===0x0,'output':_0x1d6590};}function maybeUpdateWrapper(_0x351e3c){const _0xb0dd09=a0_0x11309b;if(skipWrapperUpdateCheck())return![];if(process.env.WHALENT_WRAPPER_UPDATE_ATTEMPTED)return![];const _0x890611=latestWrapperVersion();if(!_0x890611||compareSemver(_0x890611,WRAPPER_VERSION)<=0x0)return![];console[_0xb0dd09(0x113)]('[wrapper]\x20update\x20ava'+'ilable:\x20'+WRAPPER_VERSION+_0xb0dd09(0x15f)+_0x890611),console['warn']('[wrapper]\x20installing'+'\x20'+WRAPPER_PKG_NAME+'@'+_0x890611+(_0xb0dd09(0x104)+_0xb0dd09(0x15e)));const _0x2786f8=installWrapperVersion(_0x890611);if(!_0x2786f8['ok']){console[_0xb0dd09(0x113)]('[wrapper]\x20wrapper\x20up'+_0xb0dd09(0x121)+_0xb0dd09(0x16d)+WRAPPER_VERSION);if(_0x2786f8['output'])console[_0xb0dd09(0x113)](_0x2786f8[_0xb0dd09(0x173)]['split'](/\r?\n/)['slice'](-0xc)[_0xb0dd09(0x171)]('\x0a'));return console['warn'](_0xb0dd09(0x169)+'ate:\x20npm\x20install\x20-g\x20'+WRAPPER_PKG_NAME+'@'+_0x890611+'\x20--registry='+NPM_REGISTRY),![];}console[_0xb0dd09(0x113)](_0xb0dd09(0x13a)+_0xb0dd09(0x164)+_0x890611+';\x20restarting\x20wrapper');const _0x492556=process[_0xb0dd09(0x110)][0x1],_0x377e5f=(0x0,import_child_process[_0xb0dd09(0x155)])(process['execPath'],[_0x492556,..._0x351e3c],{'stdio':_0xb0dd09(0x11b),'env':{...process.env,'WHALENT_WRAPPER_UPDATE_ATTEMPTED':_0x890611},'shell':![]});process['exit'](_0x377e5f['status']??0x0);}function findCoreScript(){const _0x3baa16=a0_0x11309b,_0x34a875=String(process.env.WHALENT_CORE_ENTRY||'')[_0x3baa16(0x137)](),_0x13fa5b=['1',_0x3baa16(0x119),_0x3baa16(0x115),'on'][_0x3baa16(0x158)](String(process.env.WHALENT_FORCE_CORE_ENTRY||'')['trim']()[_0x3baa16(0x10c)]());if(_0x34a875&&_0x13fa5b&&fs['existsSync'](_0x34a875))return _0x34a875;const _0x368370=[],_0x3fad0b=_0x5367df=>{const _0x82162a=_0x3baa16;if(fs[_0x82162a(0x109)](_0x5367df)&&!_0x368370['includes'](_0x5367df))_0x368370['push'](_0x5367df);};if(_0x34a875)_0x3fad0b(_0x34a875);const _0x5dbf8c=npmRootGlobal();if(_0x5dbf8c){const _0x102db8=path[_0x3baa16(0x171)](_0x5dbf8c,_0x3baa16(0x157),'agent-core',_0x3baa16(0x143),'index.cjs');_0x3fad0b(_0x102db8);}const _0x1a571a=path['join'](wrapperBaseDir(),_0x3baa16(0x132));_0x3fad0b(_0x1a571a);const _0x3d77dc=path['join'](wrapperBaseDir(),'..',_0x3baa16(0x13c),_0x3baa16(0x16b),_0x3baa16(0x143),_0x3baa16(0x12b));_0x3fad0b(_0x3d77dc);if(_0x368370[_0x3baa16(0x11c)]>0x0)return _0x368370['map']((_0x46ac81,_0x4fa7be)=>({'candidate':_0x46ac81,'index':_0x4fa7be,'version':coreVersion(_0x46ac81)}))['sort']((_0x137c16,_0x47c61c)=>{const _0x5ce2a5=_0x3baa16,_0x30dc51=compareSemver(_0x47c61c[_0x5ce2a5(0x127)],_0x137c16['version']);if(_0x30dc51!==0x0)return _0x30dc51;return _0x47c61c[_0x5ce2a5(0x10b)]-_0x137c16[_0x5ce2a5(0x10b)];})[0x0]['candidate'];throw new Error('whalent\x20core\x20runtime'+'\x20not\x20found;\x20install\x20'+'@whalent/agent-core\x20'+_0x3baa16(0x149)+_0x3baa16(0x117));}function a0_0x1032(_0x38cf5c,_0x68e73e){_0x38cf5c=_0x38cf5c-0xea;const _0x176f60=a0_0x176f();let _0x10322d=_0x176f60[_0x38cf5c];if(a0_0x1032['ldmcLF']===undefined){var _0x379035=function(_0x2cc480){const _0x4c17e7='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xfe6f55='',_0x2d894e='';for(let _0xbacaca=0x0,_0x109513,_0x505143,_0x411cf0=0x0;_0x505143=_0x2cc480['charAt'](_0x411cf0++);~_0x505143&&(_0x109513=_0xbacaca%0x4?_0x109513*0x40+_0x505143:_0x505143,_0xbacaca++%0x4)?_0xfe6f55+=String['fromCharCode'](0xff&_0x109513>>(-0x2*_0xbacaca&0x6)):0x0){_0x505143=_0x4c17e7['indexOf'](_0x505143);}for(let _0x1202ed=0x0,_0x4d0ba5=_0xfe6f55['length'];_0x1202ed<_0x4d0ba5;_0x1202ed++){_0x2d894e+='%'+('00'+_0xfe6f55['charCodeAt'](_0x1202ed)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2d894e);};a0_0x1032['ohlwgP']=_0x379035,a0_0x1032['qWIlwA']={},a0_0x1032['ldmcLF']=!![];}const _0x573158=_0x176f60[0x0],_0x3393c3=_0x38cf5c+_0x573158,_0x39952b=a0_0x1032['qWIlwA'][_0x3393c3];return!_0x39952b?(_0x10322d=a0_0x1032['ohlwgP'](_0x10322d),a0_0x1032['qWIlwA'][_0x3393c3]=_0x10322d):_0x10322d=_0x39952b,_0x10322d;}function coreVersion(_0x2f8f8b=findCoreScript()){const _0x2810cc=a0_0x11309b,_0x10a8b4=(0x0,import_child_process['spawnSync'])(process[_0x2810cc(0x138)],[_0x2f8f8b,'--version'],{'encoding':_0x2810cc(0x167),'timeout':0x3a98,'env':{...process.env,'WHALENT_SKIP_UPDATE_CHECK':'1'},'shell':![]}),_0x187fc9=(_0x10a8b4[_0x2810cc(0x125)]||'')+'\x0a'+(_0x10a8b4['stderr']||'');return _0x187fc9[_0x2810cc(0x130)](/(\d+\.\d+\.\d+(?:[-\w.]+)?)/)?.[0x1]||'';}function isExecutable(_0x274e41){const _0xb2f225=a0_0x11309b;try{return fs[_0xb2f225(0x165)](_0x274e41,fs['constants']['X_OK']),!![];}catch{return![];}}function shellQuote(_0xe2c594){const _0x217bb7=a0_0x11309b;return'\x27'+_0xe2c594['replace'](/'/g,_0x217bb7(0x13d))+'\x27';}function coreNodePtySpawnHelperPath(_0x1d13fa){const _0x470390=a0_0x11309b;if(process[_0x470390(0x154)]!==_0x470390(0xff))return'';try{const _0x4b53c5=(0x0,import_module[_0x470390(0x122)])(_0x1d13fa),_0x290c49=_0x4b53c5['resolve']('node-pty'),_0xcbffc9=path[_0x470390(0x10d)](path[_0x470390(0x108)](_0x290c49),'..');return path['join'](_0xcbffc9,_0x470390(0x14a),_0x470390(0xf8)+process[_0x470390(0x12e)],'spawn-helper');}catch{return'';}}function checkMacNodePtySpawnHelper(_0x2798f1){const _0x174352=a0_0x11309b,_0x2a6b13=coreNodePtySpawnHelperPath(_0x2798f1);if(!_0x2a6b13||CHECKED_PTY_HELPERS[_0x174352(0x15b)](_0x2a6b13))return;CHECKED_PTY_HELPERS['add'](_0x2a6b13);if(!fs[_0x174352(0x109)](_0x2a6b13)){console[_0x174352(0x113)](_0x174352(0xf4)+_0x174352(0x16e)+_0x174352(0x126)+_0x2a6b13);return;}if(isExecutable(_0x2a6b13))return;try{const _0x31d226=fs[_0x174352(0x170)](_0x2a6b13)[_0x174352(0xf2)];fs['chmodSync'](_0x2a6b13,_0x31d226|0x1ed);}catch{}if(isExecutable(_0x2a6b13)){console['warn']('[wrapper]\x20fixed\x20macO'+'S\x20node-pty\x20spawn-hel'+'per\x20executable\x20bit:\x20'+_0x2a6b13);return;}console[_0x174352(0x113)]('[wrapper]\x20macOS\x20node'+'-pty\x20spawn-helper\x20is'+'\x20not\x20executable:\x20'+_0x2a6b13),console[_0x174352(0x113)](_0x174352(0x103)+'nce\x20to\x20fix\x20terminal/'+_0x174352(0x14c)),console[_0x174352(0x113)](_0x174352(0xf9)+shellQuote(_0x2a6b13)),console[_0x174352(0x113)](_0x174352(0xf7)),console[_0x174352(0x113)]('\x20\x20chmod\x20+x\x20\x22$HELPER\x22');}function printVersion(){const _0x59a460=a0_0x11309b;let _0x10a283='';try{_0x10a283=coreVersion();}catch{}console['log']('whalent-agent\x20'+WRAPPER_VERSION),console[_0x59a460(0xfe)](_0x59a460(0xf1)+WRAPPER_VERSION),console[_0x59a460(0xfe)]('core\x20'+(_0x10a283||'not\x20installed'));}function directCore(_0x32f894){const _0x19a5fe=a0_0x11309b,_0xb321bd=findCoreScript();checkMacNodePtySpawnHelper(_0xb321bd);const _0x15b40f=(0x0,import_child_process[_0x19a5fe(0x155)])(process['execPath'],[_0xb321bd,..._0x32f894],{'stdio':'inherit','env':{...process.env,'WHALENT_WRAPPER_VERSION':WRAPPER_VERSION,'WHALENT_CORE_ENTRY':_0xb321bd},'shell':![]});process[_0x19a5fe(0xec)](_0x15b40f['status']??0x0);}function shouldSupervise(_0x491c7c){const _0xc143a=a0_0x11309b;if(_0x491c7c['includes']('--agent-id'))return![];if(_0x491c7c[_0xc143a(0x158)](_0xc143a(0x12d))||_0x491c7c[0x0]===_0xc143a(0x133))return![];const _0x21b660=_0x491c7c[0x0]||'';if(_0x21b660==='ls'||_0x21b660===_0xc143a(0x16c)||_0x21b660==='ps')return![];if(_0x21b660===_0xc143a(0x16f)||_0x21b660===_0xc143a(0x148))return![];if(_0x491c7c[_0xc143a(0x158)]('--help')||_0x491c7c['includes']('-h'))return![];return!![];}function installCoreVersion(_0x52e613){const _0x228b71=a0_0x11309b,_0x21b3f4=resolveExecutable(_0x228b71(0xfa));if(!_0x21b3f4)return{'ok':![],'output':_0x228b71(0x10f)+'H'};const _0x3ab1b9=CORE_PKG_NAME+'@'+_0x52e613,_0x58ffd7=run(_0x21b3f4,['install','-g',_0x3ab1b9,'--registry='+NPM_REGISTRY]),_0x126787=((_0x58ffd7[_0x228b71(0x125)]||'')+'\x0a'+(_0x58ffd7['stderr']||''))['trim']();return{'ok':_0x58ffd7['status']===0x0,'output':_0x126787};}async function superviseCore(_0xe7ba2e){const _0x338c2f=a0_0x11309b;let _0x83181a=![],_0x306804=null;const _0x3639f9=[];let _0x3fdd6b=MIN_RESTART_DELAY_MS;const _0x53d448=()=>{const _0x34c467=a0_0x1032;_0x83181a=!![];if(_0x306804&&!_0x306804[_0x34c467(0x14b)])try{_0x306804['kill'](_0x34c467(0x145));}catch{}else process[_0x34c467(0xec)](0x0);};process['on'](_0x338c2f(0x146),_0x53d448),process['on']('SIGTERM',_0x53d448);while(!![]){const _0x5b46e4=findCoreScript();checkMacNodePtySpawnHelper(_0x5b46e4);const _0x3cf01b={...process.env,'WHALENT_WRAPPER_VERSION':WRAPPER_VERSION,'WHALENT_WRAPPER_MANAGED':'1','WHALENT_CORE_ENTRY':_0x5b46e4},_0x463cbc=readUpgradeState(),_0xc0ede1=!!_0x463cbc?.['pending'];let _0x57fcee=![],_0x1a71b0=null,_0x5c444e='';const _0x49ba23=[],_0x4b110f=0xc;console[_0x338c2f(0xfe)](_0x338c2f(0xeb)+_0x338c2f(0x16a)+_0x5b46e4),_0x306804=(0x0,import_child_process[_0x338c2f(0x156)])(process[_0x338c2f(0x138)],[_0x5b46e4,..._0xe7ba2e],{'env':_0x3cf01b,'stdio':[_0x338c2f(0x11b),'pipe',_0x338c2f(0x12a)]});const _0xa34840=()=>{if(_0x57fcee)return;_0x57fcee=!![];if(_0x1a71b0)clearTimeout(_0x1a71b0);_0x3639f9['length']=0x0,_0x3fdd6b=MIN_RESTART_DELAY_MS;const _0x5c4627=readUpgradeState();_0x5c4627?.['pending']&&(writeUpgradeState({..._0x5c4627,'pending':![],'rollback':![],'health_status':'healthy'}),console['log']('[wrapper]\x20core\x20upgra'+'de\x20healthy:\x20'+(_0x5c4627['installed_version']||_0x5c4627['target_version']||'')));},_0xdf81a8=(_0x1f696f,_0x56f90=![])=>{const _0x579c2e=_0x338c2f,_0x4cd65d=_0x1f696f['toString']();(_0x56f90?process[_0x579c2e(0xed)]:process[_0x579c2e(0x125)])[_0x579c2e(0x120)](_0x4cd65d);if(_0x56f90)for(const _0x5a6472 of _0x4cd65d['split'](/\r?\n/)){if(!_0x5a6472['trim']())continue;_0x49ba23['push'](_0x5a6472);if(_0x49ba23['length']>_0x4b110f)_0x49ba23[_0x579c2e(0x10e)]();const _0x1c2f7a=_0x5a6472['match'](FATAL_PATTERN);if(_0x1c2f7a)_0x5c444e=_0x1c2f7a[0x0];}(_0x4cd65d['includes']('[gateway]\x20Connected')||_0x4cd65d[_0x579c2e(0x158)](_0x579c2e(0x162)+'achine')||_0x4cd65d['includes']('Gateway:\x20connected'))&&_0xa34840();};_0x306804['stdout']?.['on'](_0x338c2f(0x159),_0x133cf2=>_0xdf81a8(_0x133cf2,![])),_0x306804['stderr']?.['on'](_0x338c2f(0x159),_0x138892=>_0xdf81a8(_0x138892,!![]));_0xc0ede1&&(_0x1a71b0=setTimeout(()=>{const _0x636ba=_0x338c2f;if(_0x57fcee||!_0x306804||_0x306804[_0x636ba(0x14b)])return;console[_0x636ba(0xfd)](_0x636ba(0x123)+_0x636ba(0x15a)+'y\x20in\x20time;\x20rolling\x20b'+'ack');try{_0x306804[_0x636ba(0x131)]('SIGTERM');}catch{}},HEALTH_TIMEOUT_MS));const _0x913d21=await new Promise(_0x4de3d6=>{_0x306804['once']('exit',(_0x10e907,_0x23014c)=>_0x4de3d6({'code':_0x10e907,'signal':_0x23014c}));});if(_0x1a71b0)clearTimeout(_0x1a71b0);_0x306804=null;if(_0x83181a)process['exit'](_0x913d21['code']??0x0);const _0x45f9ee=readUpgradeState();if(_0x45f9ee?.[_0x338c2f(0x11e)]&&!_0x57fcee){const _0x39ce7c=String(_0x45f9ee['previous_core_versio'+'n']||'')['trim']();if(_0x39ce7c){console['error']('[wrapper]\x20rolling\x20ba'+_0x338c2f(0x101)+_0x39ce7c);const _0xe1b07d=installCoreVersion(_0x39ce7c);writeUpgradeState({..._0x45f9ee,'pending':![],'rollback':!![],'health_status':_0xe1b07d['ok']?'rolled_back':'rollback_failed','error':_0xe1b07d['ok']?'':_0xe1b07d[_0x338c2f(0x173)]});}else writeUpgradeState({..._0x45f9ee,'pending':![],'rollback':!![],'health_status':'rollback_unavailable','error':'previous\x20core\x20versio'+_0x338c2f(0x160)});}const _0x5c2d8e=_0x913d21[_0x338c2f(0x151)]===SUPERVISED_RESTART_CODE||_0x45f9ee?.['pending'];if(!_0x5c2d8e&&_0x913d21[_0x338c2f(0x151)]===0x0)process[_0x338c2f(0xec)](0x0);const _0x43c84e=Date['now']();_0x3639f9['push'](_0x43c84e);while(_0x3639f9['length']>0x0&&_0x43c84e-_0x3639f9[0x0]>CRASH_WINDOW_MS){_0x3639f9[_0x338c2f(0x10e)]();}const _0x1cfd22=_0x3639f9['length'];writeLastCrash({'timestamp':_0x43c84e,'exit_code':_0x913d21[_0x338c2f(0x151)],'exit_signal':_0x913d21['signal']||null,'fatal_line':_0x5c444e,'raw_tail':_0x49ba23['join']('\x0a'),'consecutive_crashes':_0x1cfd22}),console['log']('[wrapper]\x20core\x20exite'+_0x338c2f(0x150)+(_0x913d21[_0x338c2f(0x151)]??'')+(_0x913d21['signal']?_0x338c2f(0x11d)+_0x913d21['signal']:'')+'\x20('+_0x1cfd22+'/'+MAX_CRASHES_IN_WINDOW+'\x20in\x20last\x20'+Math['round'](CRASH_WINDOW_MS/0x3e8)+'s)');if(_0x5c444e)console[_0x338c2f(0xfe)]('[wrapper]\x20last\x20fatal'+':\x20'+_0x5c444e);_0x1cfd22>=MAX_CRASHES_IN_WINDOW&&(console[_0x338c2f(0xfd)](_0x338c2f(0x12c)+'d\x20'+_0x1cfd22+'\x20times\x20within\x20'+Math[_0x338c2f(0xee)](CRASH_WINDOW_MS/0x3e8)+('s;\x20giving\x20up.\x20Crash\x20'+_0x338c2f(0x140))+lastCrashFilePath()+('.\x20Restart\x20wrapper\x20ma'+_0x338c2f(0x128)+'erlying\x20issue\x20is\x20fix'+_0x338c2f(0x153))),process['exit'](0x1)),console['log'](_0x338c2f(0x161)+'\x20in\x20'+_0x3fdd6b+'ms'),await new Promise(_0x47bd55=>setTimeout(_0x47bd55,_0x3fdd6b)),_0x3fdd6b=Math['min'](_0x3fdd6b*0x2,MAX_RESTART_DELAY_MS);}}function a0_0x176f(){const _0x14b13b=['zMLSDgvY','CNrPBMCGy29Yzs4UlG','ic0+ia','BIb1BMTUB3DU','w3DYyxbWzxjDihjLC3rHCNrPBMC','r2f0zxDHEsbYzwDPC3rLCMvKig0','mc4WlJa','zgf0zwqGDg8G','ywnJzxnZu3LUyW','mtq4ndmWmeTtDuXlzW','DxrMoa','ChrVCG','w3DYyxbWzxjDie1HBNvHBcb1Cgq','B3jLoIa','y29Yzq','C3rHDhvZ','Aw5NihDPDgGG','lxb0EsbZCgf3BI1OzwXWzxiGBM8','BwnW','C3rHDfn5BMm','AM9PBG','mteYodKXmuD1zNb5BG','B3v0Chv0','CMvHzezPBgvtEw5J','w3DYyxbWzxjDihn0yxj0Aw5Nigm','zxHPDa','C3rKzxjY','CM91BMq','odGYntHeuMHgrMu','BwTKAxjtEw5J','D3jHChbLCIa','Bw9Kzq','ChjVDg90ExbL','w3DYyxbWzxjDig1Hy09tig5Vzgu','z2v0t3DUuhjVCgvYDhLezxnJCMK','CJOG','icbSCYaTBcaIjeHftfbfuIi','zgfYD2LUlq','icbiruXqrvi9','BNbT','D2LUmZi','mJqZmZmWrfv6zK5s','zxjYB3i','Bg9N','zgfYD2LU','y2fSBa','y2SGy29Yzsb0BYa','odKYnZfhB1DIq3C','w3DYyxbWzxjDifj1BIb0AgLZig8','igzYB20GBNbTigjLzM9YzsbZDge','CgfYC2u','BwfW','AgfZt3DUuhjVCgvYDhK','zgLYBMfTzq','zxHPC3rZu3LUyW','y2HPBgrFChjVy2vZCW','Aw5KzxG','Dg9mB3DLCKnHC2u','CMvZB2X2zq','C2HPzNq','BNbTig5VDcbMB3vUzcbVBIbqqvq','yxjNDG','zgvMAw5LuhjVCgvYDhK','CgfYC2vjBNq','D2fYBG','DMLLDW','EwvZ','x19LC01VzhvSzq','ywDLBNq','ls12zxjZAw9U','Dhj1zq','zgvMyxvSDa','Aw5OzxjPDa','BgvUz3rO','ihnPz25HBd0','CgvUzgLUzW','qhDOywXLBNqVywDLBNq','D3jPDgu','zgf0zsbMywLSzwq7ignVBNrPBNu','y3jLyxrLuMvXDwLYzq','w3DYyxbWzxjDig5LDYbJB3jLigq','qgXHDgvZDa','C3rKB3v0','DcbMB3vUzdOG','DMvYC2LVBG','BNvHBgX5igfMDgvYihrOzsb1BMq','CM9VDa','CgLWzq','Aw5KzxGUy2PZ','w3DYyxbWzxjDignVCMuGzMfPBgu','ls1Yzxn1Bwu','yxjJAa','DxrMltG','Bwf0y2G','A2LSBa','y29Yzs5JANm','CMvZDw1L','C2XPy2u','C3rYAw5NAwz5','mZyWv252zMHV','DhjPBq','zxHLy1bHDgG','nKfArfjMAW','w3DYyxbWzxjDihDYyxbWzxiGDxa','m1n2DLjtza','CgfJA2fNzxm','j1WNjW','y29Yzsa','ls1YzwDPC3rYEt0','CMvJB3jKoIa','BwvZC2fNzq','CMvWBgfJzq','zgLZDa','BNbTig5VDcbMB3vUza','u0Lhvevstq','u0Lhsu5u','ANmUB3jN','zgfLBw9Ulw1JCa','B3iGCMvIDwLSzcbaD2HHBgvUDc8','ChjLyNvPBgrZ','A2LSBgvK','ufrzihn0yxj0Dxa6','zNvUy3rPB24','lNDOywXLBNqTywDLBNq','Bw9KDwXL','zcbJB2rLpq','y29Kzq','mtm5ntiWt0z0qwXo','zwqU','CgXHDgzVCM0','C3bHD25tEw5J','C3bHD24','qhDOywXLBNq','Aw5JBhvKzxm','zgf0yq','AwqGBM90igjLy29TzsbOzwfSDgG','AgfZ','mJi5otqXnLnPzMHKtq'];a0_0x176f=function(){return _0x14b13b;};return a0_0x176f();}async function main(){const _0x24c3e8=a0_0x11309b,_0x3a9aef=process['argv'][_0x24c3e8(0x134)](0x2);if(_0x3a9aef[0x0]===_0x24c3e8(0x118)||_0x3a9aef[0x0]==='-v'||_0x3a9aef[0x0]==='version'){printVersion();return;}if((_0x3a9aef[0x0]===_0x24c3e8(0x16c)||_0x3a9aef[0x0]==='ls'||_0x3a9aef[0x0]==='ps')&&!_0x3a9aef[_0x24c3e8(0x158)]('--json')){console['log']('wrapper\x20'+WRAPPER_VERSION);try{console[_0x24c3e8(0xfe)](_0x24c3e8(0x13e)+(coreVersion()||'not\x20installed'));}catch{console[_0x24c3e8(0xfe)]('core\x20not\x20installed');}}maybeUpdateWrapper(_0x3a9aef);if(!shouldSupervise(_0x3a9aef))directCore(_0x3a9aef);await superviseCore(_0x3a9aef);}main()['catch'](_0x1a1213=>{const _0x4cb330=a0_0x11309b;console['error']('[wrapper]\x20Fatal\x20erro'+_0x4cb330(0xf6)+(_0x1a1213?.[_0x4cb330(0x141)]||String(_0x1a1213))),process[_0x4cb330(0xec)](0x1);});
2
+ 'use strict';const a0_0x782f9d=a0_0x5e2b;(function(_0x32dd2a,_0x141329){const _0xa208ae=a0_0x5e2b,_0x2600e8=_0x32dd2a();while(!![]){try{const _0x2cb983=-parseInt(_0xa208ae(0x1df))/0x1*(parseInt(_0xa208ae(0x222))/0x2)+-parseInt(_0xa208ae(0x22c))/0x3+parseInt(_0xa208ae(0x22f))/0x4+parseInt(_0xa208ae(0x1fa))/0x5+parseInt(_0xa208ae(0x1bf))/0x6+-parseInt(_0xa208ae(0x21e))/0x7+-parseInt(_0xa208ae(0x1d7))/0x8*(parseInt(_0xa208ae(0x1cf))/0x9);if(_0x2cb983===_0x141329)break;else _0x2600e8['push'](_0x2600e8['shift']());}catch(_0x5d5055){_0x2600e8['push'](_0x2600e8['shift']());}}}(a0_0x46ca,0x1cbf2));var __create=Object[a0_0x782f9d(0x235)],__defProp=Object[a0_0x782f9d(0x1e7)],__getOwnPropDesc=Object[a0_0x782f9d(0x21c)+a0_0x782f9d(0x226)],__getOwnPropNames=Object['getOwnPropertyNames'],__getProtoOf=Object[a0_0x782f9d(0x1db)],__hasOwnProp=Object['prototype'][a0_0x782f9d(0x1f0)],__copyProps=(_0x2b7a39,_0xed8bb2,_0x34dd68,_0x2ebc92)=>{const _0x320509=a0_0x782f9d;if(_0xed8bb2&&typeof _0xed8bb2==='object'||typeof _0xed8bb2===_0x320509(0x1d4)){for(let _0x390f81 of __getOwnPropNames(_0xed8bb2))if(!__hasOwnProp[_0x320509(0x20b)](_0x2b7a39,_0x390f81)&&_0x390f81!==_0x34dd68)__defProp(_0x2b7a39,_0x390f81,{'get':()=>_0xed8bb2[_0x390f81],'enumerable':!(_0x2ebc92=__getOwnPropDesc(_0xed8bb2,_0x390f81))||_0x2ebc92['enumerable']});}return _0x2b7a39;},__toESM=(_0xe3e50,_0x541a4e,_0x33d6df)=>(_0x33d6df=_0xe3e50!=null?__create(__getProtoOf(_0xe3e50)):{},__copyProps(_0x541a4e||!_0xe3e50||!_0xe3e50[a0_0x782f9d(0x1c3)]?__defProp(_0x33d6df,a0_0x782f9d(0x20e),{'value':_0xe3e50,'enumerable':!![]}):_0x33d6df,_0xe3e50)),import_child_process=require(a0_0x782f9d(0x1f9)),fs=__toESM(require('fs'),0x1),import_module=require(a0_0x782f9d(0x1e6)),os=__toESM(require('os'),0x1),path=__toESM(require('path'),0x1),WRAPPER_PKG_NAME=a0_0x782f9d(0x21b),CORE_PKG_NAME=a0_0x782f9d(0x203),NPM_REGISTRY=a0_0x782f9d(0x1e1)+'js.org',SUPERVISED_RESTART_CODE=0x4b,NPM_VIEW_TIMEOUT_MS=0x3a98,HEALTH_TIMEOUT_MS=0xafc8,MIN_RESTART_DELAY_MS=0x3e8,MAX_RESTART_DELAY_MS=0xea60,MAX_CRASHES_IN_WINDOW=0x3,CRASH_WINDOW_MS=0x3*0x3c*0x3e8,NPM_INSTALL_TIMEOUT_MS=0xa*0x3c*0x3e8,NPM_INSTALL_MAX_BUFFER=0x20*0x400*0x400,FATAL_PATTERN=/\[(?:agent|daemon|wrapper)\][^\n]*\bFatal error:[^\n]+|\[daemon\] Failed to start:[^\n]+|Error:[^\n]+/,WRAPPER_VERSION=readWrapperVersion(),CHECKED_PTY_HELPERS=new Set();function wrapperBaseDir(){return __dirname;}function configDir(){const _0x22df52=a0_0x782f9d;return path['join'](os[_0x22df52(0x207)](),'.whalent-agent');}function upgradeStatePath(){return path['join'](configDir(),'core-upgrade.json');}function lastCrashFilePath(){const _0x2c6070=a0_0x782f9d;return path['join'](configDir(),_0x2c6070(0x1bb));}function writeLastCrash(_0x8973b4){const _0x5106bf=a0_0x782f9d;try{fs['mkdirSync'](configDir(),{'recursive':!![]});const _0x398159={..._0x8973b4,'reported':![]};fs[_0x5106bf(0x1c6)](lastCrashFilePath(),JSON[_0x5106bf(0x1ba)](_0x398159,null,0x2),'utf-8');}catch{}}function readWrapperVersion(){const _0x4f7373=a0_0x782f9d;try{const _0x111479=JSON['parse'](fs[_0x4f7373(0x211)](path['join'](wrapperBaseDir(),'..','package.json'),'utf-8'));return String(_0x111479[_0x4f7373(0x238)]||_0x4f7373(0x1de));}catch{return _0x4f7373(0x1de);}}function readUpgradeState(){const _0x1c1eac=a0_0x782f9d;try{return JSON['parse'](fs[_0x1c1eac(0x211)](upgradeStatePath(),'utf-8'));}catch{return null;}}function writeUpgradeState(_0x55d404){const _0x1541bb=a0_0x782f9d;try{fs['mkdirSync'](configDir(),{'recursive':!![]}),fs[_0x1541bb(0x1c6)](upgradeStatePath(),JSON['stringify']({..._0x55d404,'updated_at':Date['now']()},null,0x2),_0x1541bb(0x204));}catch{}}function a0_0x5e2b(_0xb5ad1f,_0x5e0198){_0xb5ad1f=_0xb5ad1f-0x1ac;const _0x46ca2a=a0_0x46ca();let _0x5e2bf2=_0x46ca2a[_0xb5ad1f];if(a0_0x5e2b['cZmini']===undefined){var _0x4eac47=function(_0x4a2e1e){const _0x354ae8='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2b7a39='',_0xed8bb2='';for(let _0x34dd68=0x0,_0x2ebc92,_0x390f81,_0xe3e50=0x0;_0x390f81=_0x4a2e1e['charAt'](_0xe3e50++);~_0x390f81&&(_0x2ebc92=_0x34dd68%0x4?_0x2ebc92*0x40+_0x390f81:_0x390f81,_0x34dd68++%0x4)?_0x2b7a39+=String['fromCharCode'](0xff&_0x2ebc92>>(-0x2*_0x34dd68&0x6)):0x0){_0x390f81=_0x354ae8['indexOf'](_0x390f81);}for(let _0x541a4e=0x0,_0x33d6df=_0x2b7a39['length'];_0x541a4e<_0x33d6df;_0x541a4e++){_0xed8bb2+='%'+('00'+_0x2b7a39['charCodeAt'](_0x541a4e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xed8bb2);};a0_0x5e2b['FdyZOa']=_0x4eac47,a0_0x5e2b['GthUmJ']={},a0_0x5e2b['cZmini']=!![];}const _0x20b758=_0x46ca2a[0x0],_0x127aae=_0xb5ad1f+_0x20b758,_0x318b62=a0_0x5e2b['GthUmJ'][_0x127aae];return!_0x318b62?(_0x5e2bf2=a0_0x5e2b['FdyZOa'](_0x5e2bf2),a0_0x5e2b['GthUmJ'][_0x127aae]=_0x5e2bf2):_0x5e2bf2=_0x318b62,_0x5e2bf2;}function run(_0x4ce36d,_0x5a8ac7,_0x49b0c9=process.env){const _0x449404=a0_0x782f9d;return(0x0,import_child_process['spawnSync'])(_0x4ce36d,_0x5a8ac7,{'encoding':_0x449404(0x1b6),'timeout':NPM_INSTALL_TIMEOUT_MS,'maxBuffer':NPM_INSTALL_MAX_BUFFER,'env':_0x49b0c9,'shell':![]});}function runNpmView(_0x1ffa42){const _0x5d7641=a0_0x782f9d,_0x28d979=resolveExecutable('npm');if(!_0x28d979)return{'status':0x7f,'stdout':'','stderr':_0x5d7641(0x236),'error':new Error(_0x5d7641(0x236))};return(0x0,import_child_process['spawnSync'])(_0x28d979,_0x1ffa42,{'encoding':_0x5d7641(0x1b6),'timeout':NPM_VIEW_TIMEOUT_MS,'maxBuffer':0x400*0x400,'env':process.env,'shell':![]});}function npmRootGlobal(){const _0x4e2999=a0_0x782f9d,_0x29ae1f=resolveExecutable('npm');if(!_0x29ae1f)return'';const _0x45429b=run(_0x29ae1f,[_0x4e2999(0x1ec),'-g']);if(_0x45429b[_0x4e2999(0x1ea)]!==0x0)return'';return String(_0x45429b['stdout']||'')[_0x4e2999(0x221)]();}function compareSemver(_0x33f2e0,_0x4a32e6){const _0x2b48e3=a0_0x782f9d,_0x1bb39a=String(_0x33f2e0||'')[_0x2b48e3(0x1ae)](/^v/,'')[_0x2b48e3(0x1ad)](/[.-]/)['map'](_0x42956c=>Number['parseInt'](_0x42956c,0xa)||0x0),_0xd39f80=String(_0x4a32e6||'')[_0x2b48e3(0x1ae)](/^v/,'')['split'](/[.-]/)['map'](_0x5d67d2=>Number['parseInt'](_0x5d67d2,0xa)||0x0);for(let _0x1e3431=0x0;_0x1e3431<Math[_0x2b48e3(0x1f3)](_0x1bb39a[_0x2b48e3(0x1d2)],_0xd39f80[_0x2b48e3(0x1d2)],0x3);_0x1e3431++){const _0x2ea391=_0x1bb39a[_0x1e3431]||0x0,_0x1d57ea=_0xd39f80[_0x1e3431]||0x0;if(_0x2ea391>_0x1d57ea)return 0x1;if(_0x2ea391<_0x1d57ea)return-0x1;}return 0x0;}function resolveExecutable(_0x36c08d){const _0x469c01=a0_0x782f9d,_0x2e1ec1=process[_0x469c01(0x1c2)]===_0x469c01(0x1e5)?'where.exe':_0x469c01(0x228);try{const _0x3f1901=(0x0,import_child_process[_0x469c01(0x210)])(_0x2e1ec1,[_0x36c08d],{'encoding':_0x469c01(0x1b6),'timeout':0xbb8,'shell':![]});if(_0x3f1901['status']!==0x0)return'';return String(_0x3f1901[_0x469c01(0x1c0)]||'')['split'](/\r?\n/)['map'](_0x34c8cc=>_0x34c8cc[_0x469c01(0x221)]())[_0x469c01(0x202)](Boolean)[0x0]||'';}catch{return'';}}function skipWrapperUpdateCheck(){const _0x43c004=a0_0x782f9d,_0x5ef0b8=String(process.env.WHALENT_SKIP_UPDATE_CHECK||process.env.WHALENT_NO_UPDATE_CHECK||process.env.WHALENT_SKIP_WRAPPER_UPDATE||'')['trim']()['toLowerCase']();return _0x5ef0b8==='1'||_0x5ef0b8===_0x43c004(0x1cd)||_0x5ef0b8===_0x43c004(0x225)||_0x5ef0b8==='on';}function latestWrapperVersion(){const _0xa8bcc6=a0_0x782f9d,_0x1fcd6f=runNpmView(['view',WRAPPER_PKG_NAME+'@latest',_0xa8bcc6(0x238),_0xa8bcc6(0x1b7)+NPM_REGISTRY]);if(_0x1fcd6f[_0xa8bcc6(0x1ea)]!==0x0)return'';return String(_0x1fcd6f['stdout']||'')[_0xa8bcc6(0x221)]()['split'](/\r?\n/)[_0xa8bcc6(0x202)](Boolean)[_0xa8bcc6(0x1e0)]()||'';}function installWrapperVersion(_0x5ecbea){const _0x28bff6=a0_0x782f9d,_0x4195ca=resolveExecutable(_0x28bff6(0x1ef));if(!_0x4195ca)return{'ok':![],'output':'npm\x20not\x20found\x20on\x20PAT'+'H'};const _0x4362fd=run(_0x4195ca,['install','-g',WRAPPER_PKG_NAME+'@'+_0x5ecbea,_0x28bff6(0x1b7)+NPM_REGISTRY]),_0xc7d83c=((_0x4362fd[_0x28bff6(0x1c0)]||'')+'\x0a'+(_0x4362fd[_0x28bff6(0x1d0)]||''))['trim']();return{'ok':_0x4362fd['status']===0x0,'output':_0xc7d83c};}function maybeUpdateWrapper(_0x17b793){const _0x2ae1d6=a0_0x782f9d;if(skipWrapperUpdateCheck())return![];if(process.env.WHALENT_WRAPPER_UPDATE_ATTEMPTED)return![];const _0x77d385=latestWrapperVersion();if(!_0x77d385||compareSemver(_0x77d385,WRAPPER_VERSION)<=0x0)return![];console[_0x2ae1d6(0x1bd)]('[wrapper]\x20update\x20ava'+_0x2ae1d6(0x1e9)+WRAPPER_VERSION+'\x20->\x20'+_0x77d385),console['warn'](_0x2ae1d6(0x218)+'\x20'+WRAPPER_PKG_NAME+'@'+_0x77d385+('\x20from\x20npm\x20before\x20sta'+'rting\x20core...'));const _0x129c99=installWrapperVersion(_0x77d385);if(!_0x129c99['ok']){console['warn'](_0x2ae1d6(0x1d6)+_0x2ae1d6(0x231)+_0x2ae1d6(0x1dd)+WRAPPER_VERSION);if(_0x129c99[_0x2ae1d6(0x223)])console['warn'](_0x129c99[_0x2ae1d6(0x223)][_0x2ae1d6(0x1ad)](/\r?\n/)['slice'](-0xc)['join']('\x0a'));return console[_0x2ae1d6(0x1bd)]('[wrapper]\x20Manual\x20upd'+_0x2ae1d6(0x21f)+WRAPPER_PKG_NAME+'@'+_0x77d385+'\x20--registry='+NPM_REGISTRY),![];}console['warn']('[wrapper]\x20wrapper\x20up'+'dated\x20to\x20'+_0x77d385+_0x2ae1d6(0x216));const _0x2bd08a=process['argv'][0x1],_0xc7e6af=(0x0,import_child_process['spawnSync'])(process['execPath'],[_0x2bd08a,..._0x17b793],{'stdio':_0x2ae1d6(0x1e3),'env':{...process.env,'WHALENT_WRAPPER_UPDATE_ATTEMPTED':_0x77d385},'shell':![]});process[_0x2ae1d6(0x1cc)](_0xc7e6af['status']??0x0);}function findCoreScript(){const _0x262a28=a0_0x782f9d,_0x49a852=String(process.env.WHALENT_CORE_ENTRY||'')['trim'](),_0x4de993=['1',_0x262a28(0x1cd),_0x262a28(0x225),'on'][_0x262a28(0x213)](String(process.env.WHALENT_FORCE_CORE_ENTRY||'')[_0x262a28(0x221)]()[_0x262a28(0x1c8)]());if(_0x49a852&&_0x4de993&&fs['existsSync'](_0x49a852))return _0x49a852;const _0x125e49=[],_0x589ac8=_0x38c17f=>{const _0xf21328=_0x262a28;if(fs['existsSync'](_0x38c17f)&&!_0x125e49[_0xf21328(0x213)](_0x38c17f))_0x125e49[_0xf21328(0x212)](_0x38c17f);};if(_0x49a852)_0x589ac8(_0x49a852);const _0x443ce0=npmRootGlobal();if(_0x443ce0){const _0x4cb5a5=path['join'](_0x443ce0,_0x262a28(0x1ac),'agent-core','dist','index.cjs');_0x589ac8(_0x4cb5a5);}const _0x185653=path[_0x262a28(0x1f4)](wrapperBaseDir(),'core.cjs');_0x589ac8(_0x185653);const _0x363694=path['join'](wrapperBaseDir(),'..','packages','core','dist',_0x262a28(0x205));_0x589ac8(_0x363694);if(_0x125e49[_0x262a28(0x1d2)]>0x0)return _0x125e49[_0x262a28(0x1c5)]((_0x57eef1,_0x170a3a)=>({'candidate':_0x57eef1,'index':_0x170a3a,'version':coreVersion(_0x57eef1)}))[_0x262a28(0x1ed)]((_0x4401a5,_0x3bc24a)=>{const _0x13ed8c=_0x262a28,_0x57361e=compareSemver(_0x3bc24a['version'],_0x4401a5[_0x13ed8c(0x238)]);if(_0x57361e!==0x0)return _0x57361e;return _0x3bc24a[_0x13ed8c(0x1f5)]-_0x4401a5['index'];})[0x0][_0x262a28(0x1f7)];throw new Error(_0x262a28(0x1d8)+_0x262a28(0x1ce)+'@whalent/agent-core\x20'+'or\x20rebuild\x20@whalent/'+_0x262a28(0x1cb));}function coreVersion(_0x3f2cbe=findCoreScript()){const _0x2b5afc=a0_0x782f9d,_0x5e4428=(0x0,import_child_process['spawnSync'])(process[_0x2b5afc(0x1e2)],[_0x3f2cbe,'--version'],{'encoding':'utf8','timeout':0x3a98,'env':{...process.env,'WHALENT_SKIP_UPDATE_CHECK':'1'},'shell':![]}),_0x58f66b=(_0x5e4428['stdout']||'')+'\x0a'+(_0x5e4428[_0x2b5afc(0x1d0)]||'');return _0x58f66b['match'](/(\d+\.\d+\.\d+(?:[-\w.]+)?)/)?.[0x1]||'';}function isExecutable(_0x218bc4){const _0x521fae=a0_0x782f9d;try{return fs['accessSync'](_0x218bc4,fs[_0x521fae(0x230)]['X_OK']),!![];}catch{return![];}}function shellQuote(_0x13c18a){const _0x59ea80=a0_0x782f9d;return'\x27'+_0x13c18a[_0x59ea80(0x1ae)](/'/g,_0x59ea80(0x21d))+'\x27';}function coreNodePtySpawnHelperPath(_0x45c82d){const _0x625a70=a0_0x782f9d;if(process[_0x625a70(0x1c2)]!=='darwin')return'';try{const _0x3232d8=(0x0,import_module['createRequire'])(_0x45c82d),_0x2017a4=_0x3232d8['resolve'](_0x625a70(0x1ee)),_0x40fe47=path[_0x625a70(0x234)](path[_0x625a70(0x1b3)](_0x2017a4),'..');return path['join'](_0x40fe47,_0x625a70(0x21a),'darwin-'+process['arch'],_0x625a70(0x1eb));}catch{return'';}}function checkMacNodePtySpawnHelper(_0x278e93){const _0x47157d=a0_0x782f9d,_0xa46feb=coreNodePtySpawnHelperPath(_0x278e93);if(!_0xa46feb||CHECKED_PTY_HELPERS[_0x47157d(0x20c)](_0xa46feb))return;CHECKED_PTY_HELPERS['add'](_0xa46feb);if(!fs['existsSync'](_0xa46feb)){console[_0x47157d(0x1bd)]('[wrapper]\x20macOS\x20node'+'-pty\x20spawn-helper\x20no'+'t\x20found:\x20'+_0xa46feb);return;}if(isExecutable(_0xa46feb))return;try{const _0x293f14=fs['statSync'](_0xa46feb)[_0x47157d(0x1b8)];fs[_0x47157d(0x1f6)](_0xa46feb,_0x293f14|0x1ed);}catch{}if(isExecutable(_0xa46feb)){console['warn'](_0x47157d(0x220)+'S\x20node-pty\x20spawn-hel'+'per\x20executable\x20bit:\x20'+_0xa46feb);return;}console['warn'](_0x47157d(0x1b9)+_0x47157d(0x206)+'\x20not\x20executable:\x20'+_0xa46feb),console[_0x47157d(0x1bd)](_0x47157d(0x1c4)+_0x47157d(0x233)+_0x47157d(0x1c1)),console[_0x47157d(0x1bd)](_0x47157d(0x1d9)+shellQuote(_0xa46feb)),console['warn'](_0x47157d(0x1d5)),console['warn'](_0x47157d(0x1d3));}function printVersion(){const _0x1fea93=a0_0x782f9d;let _0xb14e15='';try{_0xb14e15=coreVersion();}catch{}console[_0x1fea93(0x1c7)](_0x1fea93(0x200)+WRAPPER_VERSION),console[_0x1fea93(0x1c7)]('wrapper\x20'+WRAPPER_VERSION),console[_0x1fea93(0x1c7)](_0x1fea93(0x224)+(_0xb14e15||_0x1fea93(0x1f8)));}function a0_0x46ca(){const _0x289b7b=['Bwf4','AM9PBG','Aw5KzxG','y2HTB2rtEw5J','y2fUzgLKyxrL','BM90igLUC3rHBgXLza','y2HPBgrFChjVy2vZCW','nZmYmJqWEM1kvwnc','zxjSEwLUzYbPC3n1zsbPCYbMAxG','C2HPzNq','w3DYyxbWzxjDiezHDgfSigvYCM8','CgvUzgLUzW','ls1Yzxn1Bwu','D2HHBgvUDc1Hz2vUDca','BIb1BMTUB3DU','zMLSDgvY','qhDOywXLBNqVywDLBNqTy29Yzq','DxrMltG','Aw5KzxGUy2PZ','lxb0EsbZCgf3BI1OzwXWzxiGAxm','Ag9TzwrPCG','r2f0zxDHEtOGy29UBMvJDgvK','D3jHChbLCIa','y2f0y2G','y2fSBa','AgfZ','yxjNDG','zgvMyxvSDa','y29Kzq','C3bHD25tEw5J','CMvHzezPBgvtEw5J','ChvZAa','Aw5JBhvKzxm','zcbJB2rLpq','A2LSBa','oYbYzxn0yxj0Aw5NihDYyxbWzxi','CM9SBgvKx2jHy2S','w3DYyxbWzxjDigLUC3rHBgXPBMC','CZSGz2L2Aw5NihvWlIbdCMfZAca','ChjLyNvPBgrZ','qhDOywXLBNqVywDLBNq','z2v0t3DUuhjVCgvYDhLezxnJCMK','j1WNjW','mtuWnZeWmejby1LgtW','yxrLoIbUCg0GAw5ZDgfSBcaTzYa','w3DYyxbWzxjDigzPEgvKig1Hy08','DhjPBq','otm0nNnlsg5mqq','B3v0Chv0','y29Yzsa','EwvZ','ChrVCG','zxjYB3i','D2HPy2G','ChjLDMLVDxnFy29Yzv92zxjZAw8','Aw5ZDgfSBa','w3DYyxbWzxjDigXHC3qGzMf0ywW','mti0nte4AuvgD1fO','D3jPDgu','r2f0zxDHEsbYzwDPC3rLCMvKig0','odqZmJm2uMzdsKDk','y29UC3rHBNrZ','zgf0zsbMywLSzwq7ignVBNrPBNu','zgf0yq','BMnLihrVigzPEcb0zxjTAw5HBc8','CMvZB2X2zq','y3jLyxrL','BNbTig5VDcbMB3vUza','CM9SBgjHy2TFzMfPBgvK','DMvYC2LVBG','qhDOywXLBNq','C3bSAxq','CMvWBgfJzq','w3DYyxbWzxjDignVCMuGzxHPDgu','CM91BMq','BwnW','ihrPBwvZihDPDgHPBIa','zgLYBMfTzq','Aw5ZDgfSBgvKx3zLCNnPB24','w3DYyxbWzxjDignVCMuGzMfPBgu','DxrMoa','ls1YzwDPC3rYEt0','Bw9Kzq','w3DYyxbWzxjDig1Hy09tig5Vzgu','C3rYAw5NAwz5','BgfZDc1JCMfZAc5QC29U','DgfYz2v0x3zLCNnPB24','D2fYBG','C3bHD24','mte0ote1mezAsev3zW','C3rKB3v0','ufrzihn0yxj0Dxa6','CgXHDgzVCM0','x19LC01VzhvSzq','w3DYyxbWzxjDifj1BIb0AgLZig8','BwfW','D3jPDgvgAwXLu3LUyW','Bg9N','Dg9mB3DLCKnHC2u','A2LSBgvK','B25Jzq','ywDLBNq','zxHPDa','Dhj1zq','ig5VDcbMB3vUzdSGAw5ZDgfSBca','mteXmtiZDLzrA3H0','C3rKzxjY','zgfLBw9Ulw1JCa','BgvUz3rO','icbJAg1VzcaREcaIjeHftfbfuIi','zNvUy3rPB24','icbSCYaTBcaIjeHftfbfuIi','w3DYyxbWzxjDihDYyxbWzxiGDxa','mtzMww1Ltxm','D2HHBgvUDcbJB3jLihj1BNrPBwu','icbiruXqrvi9','w3DYyxbWzxjDig5LDYbJB3jLigq','z2v0uhjVDg90ExbLt2y','BM93','Aw5NihDPDgGG','mc4WlJa','mZjWyLvYqMm','Cg9W','Ahr0Chm6lY9YzwDPC3rYEs5UCg0','zxHLy1bHDgG','Aw5OzxjPDa','y2SGy29Yzsb0BYa','D2LUmZi','Bw9KDwXL','zgvMAw5LuhjVCgvYDhK','BwvZC2fNzq','AwXHyMXLoIa','C3rHDhvZ','C3bHD24TAgvSCgvY','CM9VDa','C29YDa','BM9Kzs1WDhK','BNbT','AgfZt3DUuhjVCgvYDhK','u0Lhvevstq','BwLU'];a0_0x46ca=function(){return _0x289b7b;};return a0_0x46ca();}function directCore(_0x53443e){const _0x55f064=a0_0x782f9d,_0x1337e6=findCoreScript();checkMacNodePtySpawnHelper(_0x1337e6);const _0x599841=(0x0,import_child_process[_0x55f064(0x210)])(process[_0x55f064(0x1e2)],[_0x1337e6,..._0x53443e],{'stdio':_0x55f064(0x1e3),'env':{...process.env,'WHALENT_WRAPPER_VERSION':WRAPPER_VERSION,'WHALENT_CORE_ENTRY':_0x1337e6},'shell':![]});process[_0x55f064(0x1cc)](_0x599841['status']??0x0);}function shouldSupervise(_0x5d4115){const _0x25b95b=a0_0x782f9d;if(_0x5d4115['includes']('--agent-id'))return![];if(_0x5d4115['includes'](_0x25b95b(0x1ff))||_0x5d4115[0x0]==='resume')return![];const _0x1c890d=_0x5d4115[0x0]||'';if(_0x1c890d==='ls'||_0x1c890d===_0x25b95b(0x1ea)||_0x1c890d==='ps')return![];if(_0x1c890d===_0x25b95b(0x1b1)||_0x1c890d===_0x25b95b(0x1d1))return![];if(_0x5d4115[_0x25b95b(0x213)]('--help')||_0x5d4115['includes']('-h'))return![];return!![];}function installCoreVersion(_0x59c2de){const _0x50c8eb=a0_0x782f9d,_0x11c0c9=resolveExecutable(_0x50c8eb(0x1ef));if(!_0x11c0c9)return{'ok':![],'output':'npm\x20not\x20found\x20on\x20PAT'+'H'};const _0x1a4c14=CORE_PKG_NAME+'@'+_0x59c2de,_0x65f88a=run(_0x11c0c9,[_0x50c8eb(0x22a),'-g',_0x1a4c14,_0x50c8eb(0x1b7)+NPM_REGISTRY]),_0x101f23=((_0x65f88a[_0x50c8eb(0x1c0)]||'')+'\x0a'+(_0x65f88a['stderr']||''))[_0x50c8eb(0x221)]();return{'ok':_0x65f88a[_0x50c8eb(0x1ea)]===0x0,'output':_0x101f23};}async function superviseCore(_0x495278){const _0x92becd=a0_0x782f9d;let _0x1d1f76=![],_0x286adc=null;const _0x3a69af=[];let _0x31bfdd=MIN_RESTART_DELAY_MS;const _0xb82b02=()=>{const _0x235499=a0_0x5e2b;_0x1d1f76=!![];if(_0x286adc&&!_0x286adc[_0x235499(0x1c9)])try{_0x286adc[_0x235499(0x215)](_0x235499(0x1f1));}catch{}else process[_0x235499(0x1cc)](0x0);};process['on']('SIGINT',_0xb82b02),process['on'](_0x92becd(0x1f1),_0xb82b02);while(!![]){const _0x315ce7=findCoreScript();checkMacNodePtySpawnHelper(_0x315ce7);const _0x2df926={...process.env,'WHALENT_WRAPPER_VERSION':WRAPPER_VERSION,'WHALENT_WRAPPER_MANAGED':'1','WHALENT_CORE_ENTRY':_0x315ce7},_0x33e927=readUpgradeState(),_0x11b82d=!!_0x33e927?.[_0x92becd(0x1fe)];let _0x561405=![],_0x1dda67=null,_0x33efc0='';const _0x1809a2=[],_0x2c8275=0xc;console[_0x92becd(0x1c7)]('[wrapper]\x20starting\x20c'+'ore:\x20'+_0x315ce7),_0x286adc=(0x0,import_child_process[_0x92becd(0x1be)])(process[_0x92becd(0x1e2)],[_0x315ce7,..._0x495278],{'env':_0x2df926,'stdio':[_0x92becd(0x1e3),'pipe','pipe']});const _0x21ab81=()=>{const _0x1cf994=_0x92becd;if(_0x561405)return;_0x561405=!![];if(_0x1dda67)clearTimeout(_0x1dda67);_0x3a69af['length']=0x0,_0x31bfdd=MIN_RESTART_DELAY_MS;const _0xbd5dc6=readUpgradeState();_0xbd5dc6?.['pending']&&(writeUpgradeState({..._0xbd5dc6,'pending':![],'rollback':![],'health_status':'healthy'}),console['log']('[wrapper]\x20core\x20upgra'+'de\x20healthy:\x20'+(_0xbd5dc6[_0x1cf994(0x1b4)]||_0xbd5dc6[_0x1cf994(0x1bc)]||'')));},_0x2a1bd4=(_0x595553,_0x3f5c41=![])=>{const _0x286883=_0x92becd,_0x2edfb6=_0x595553['toString']();(_0x3f5c41?process['stderr']:process['stdout'])[_0x286883(0x22d)](_0x2edfb6);if(_0x3f5c41)for(const _0x26afa4 of _0x2edfb6[_0x286883(0x1ad)](/\r?\n/)){if(!_0x26afa4[_0x286883(0x221)]())continue;_0x1809a2[_0x286883(0x212)](_0x26afa4);if(_0x1809a2[_0x286883(0x1d2)]>_0x2c8275)_0x1809a2['shift']();const _0x461893=_0x26afa4['match'](FATAL_PATTERN);if(_0x461893)_0x33efc0=_0x461893[0x0];}(_0x2edfb6['includes']('[gateway]\x20Connected')||_0x2edfb6['includes'](_0x286883(0x22e)+'achine')||_0x2edfb6[_0x286883(0x213)](_0x286883(0x208)))&&_0x21ab81();};_0x286adc['stdout']?.['on'](_0x92becd(0x232),_0x4cd1fa=>_0x2a1bd4(_0x4cd1fa,![])),_0x286adc['stderr']?.['on'](_0x92becd(0x232),_0x493265=>_0x2a1bd4(_0x493265,!![]));_0x11b82d&&(_0x1dda67=setTimeout(()=>{const _0x3a4be6=_0x92becd;if(_0x561405||!_0x286adc||_0x286adc['killed'])return;console['error'](_0x3a4be6(0x1da)+'id\x20not\x20become\x20health'+'y\x20in\x20time;\x20rolling\x20b'+'ack');try{_0x286adc['kill']('SIGTERM');}catch{}},HEALTH_TIMEOUT_MS));const _0x543504=await new Promise(_0x3ede38=>{const _0x1a4472=_0x92becd;_0x286adc[_0x1a4472(0x1ca)](_0x1a4472(0x1cc),(_0x49ddd0,_0x3176cd)=>_0x3ede38({'code':_0x49ddd0,'signal':_0x3176cd}));});if(_0x1dda67)clearTimeout(_0x1dda67);_0x286adc=null;if(_0x1d1f76)process['exit'](_0x543504[_0x92becd(0x20f)]??0x0);const _0x43f4c7=readUpgradeState();if(_0x43f4c7?.[_0x92becd(0x1fe)]&&!_0x561405){const _0x7dd2de=String(_0x43f4c7[_0x92becd(0x229)+'n']||'')['trim']();if(_0x7dd2de){console['error']('[wrapper]\x20rolling\x20ba'+_0x92becd(0x1e4)+_0x7dd2de);const _0x346842=installCoreVersion(_0x7dd2de);writeUpgradeState({..._0x43f4c7,'pending':![],'rollback':!![],'health_status':_0x346842['ok']?_0x92becd(0x217):_0x92becd(0x237),'error':_0x346842['ok']?'':_0x346842['output']});}else writeUpgradeState({..._0x43f4c7,'pending':![],'rollback':!![],'health_status':'rollback_unavailable','error':'previous\x20core\x20versio'+_0x92becd(0x201)});}const _0x10e89c=_0x543504['code']===SUPERVISED_RESTART_CODE||_0x43f4c7?.[_0x92becd(0x1fe)];if(!_0x10e89c&&_0x543504[_0x92becd(0x20f)]===0x0)process['exit'](0x0);const _0xcd7ae6=Date[_0x92becd(0x1dc)]();_0x3a69af[_0x92becd(0x212)](_0xcd7ae6);while(_0x3a69af[_0x92becd(0x1d2)]>0x0&&_0xcd7ae6-_0x3a69af[0x0]>CRASH_WINDOW_MS){_0x3a69af[_0x92becd(0x1fc)]();}const _0x20df5e=_0x3a69af['length'];writeLastCrash({'timestamp':_0xcd7ae6,'exit_code':_0x543504[_0x92becd(0x20f)],'exit_signal':_0x543504['signal']||null,'fatal_line':_0x33efc0,'raw_tail':_0x1809a2['join']('\x0a'),'consecutive_crashes':_0x20df5e}),console[_0x92becd(0x1c7)](_0x92becd(0x1af)+_0x92becd(0x214)+(_0x543504[_0x92becd(0x20f)]??'')+(_0x543504['signal']?'\x20signal='+_0x543504['signal']:'')+'\x20('+_0x20df5e+'/'+MAX_CRASHES_IN_WINDOW+'\x20in\x20last\x20'+Math[_0x92becd(0x1b0)](CRASH_WINDOW_MS/0x3e8)+'s)');if(_0x33efc0)console['log'](_0x92becd(0x22b)+':\x20'+_0x33efc0);_0x20df5e>=MAX_CRASHES_IN_WINDOW&&(console[_0x92becd(0x227)](_0x92becd(0x1b5)+'d\x20'+_0x20df5e+_0x92becd(0x1b2)+Math[_0x92becd(0x1b0)](CRASH_WINDOW_MS/0x3e8)+(_0x92becd(0x219)+'record:\x20')+lastCrashFilePath()+('.\x20Restart\x20wrapper\x20ma'+'nually\x20after\x20the\x20und'+_0x92becd(0x1fb)+'ed.')),process['exit'](0x1)),console['log']('[wrapper]\x20restarting'+'\x20in\x20'+_0x31bfdd+'ms'),await new Promise(_0x298e54=>setTimeout(_0x298e54,_0x31bfdd)),_0x31bfdd=Math[_0x92becd(0x1f2)](_0x31bfdd*0x2,MAX_RESTART_DELAY_MS);}}async function main(){const _0x149301=a0_0x782f9d,_0x2e25c8=process[_0x149301(0x20d)]['slice'](0x2);if(_0x2e25c8[0x0]==='--version'||_0x2e25c8[0x0]==='-v'||_0x2e25c8[0x0]==='version'){printVersion();return;}if((_0x2e25c8[0x0]==='status'||_0x2e25c8[0x0]==='ls'||_0x2e25c8[0x0]==='ps')&&!_0x2e25c8['includes']('--json')){console[_0x149301(0x1c7)](_0x149301(0x209)+WRAPPER_VERSION);try{console['log'](_0x149301(0x224)+(coreVersion()||'not\x20installed'));}catch{console['log']('core\x20not\x20installed');}}maybeUpdateWrapper(_0x2e25c8);if(!shouldSupervise(_0x2e25c8))directCore(_0x2e25c8);await superviseCore(_0x2e25c8);}main()[a0_0x782f9d(0x20a)](_0x7b0484=>{const _0x2695eb=a0_0x782f9d;console[_0x2695eb(0x227)](_0x2695eb(0x1fd)+'r:\x20'+(_0x7b0484?.[_0x2695eb(0x1e8)]||String(_0x7b0484))),process[_0x2695eb(0x1cc)](0x1);});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whalent/agent",
3
- "version": "0.3.92",
3
+ "version": "0.3.93",
4
4
  "description": "Stable wrapper for Whalent Agent core runtime",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -42,7 +42,7 @@
42
42
  "yaml": "^2.4.0"
43
43
  },
44
44
  "optionalDependencies": {
45
- "@whalent/agent-core": "0.3.92"
45
+ "@whalent/agent-core": "0.3.93"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/node": "^20.0.0",