apt-mcp-agent-setup 1.2.13 → 1.2.14

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 _0x10d1ab=_0x48dc;(function(_0x1ea3a3,_0x439c9c){const _0x547903=_0x48dc,_0x17f1a6=_0x1ea3a3();while(!![]){try{const _0x2ec3cd=parseInt(_0x547903(0x131))/0x1+-parseInt(_0x547903(0x18b))/0x2*(parseInt(_0x547903(0x120))/0x3)+parseInt(_0x547903(0x151))/0x4+parseInt(_0x547903(0x15f))/0x5+-parseInt(_0x547903(0xfa))/0x6+parseInt(_0x547903(0x124))/0x7+-parseInt(_0x547903(0x149))/0x8;if(_0x2ec3cd===_0x439c9c)break;else _0x17f1a6['push'](_0x17f1a6['shift']());}catch(_0x1a2972){_0x17f1a6['push'](_0x17f1a6['shift']());}}}(_0x4c89,0x6bb96));function _0x48dc(_0x2249c3,_0x53a7b6){_0x2249c3=_0x2249c3-0xec;const _0x4c8969=_0x4c89();let _0x48dcc9=_0x4c8969[_0x2249c3];if(_0x48dc['JigeOt']===undefined){var _0x23b158=function(_0xcc5ecd){const _0x1eab71='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x26a162='',_0x6c7b77='';for(let _0x34920e=0x0,_0x120b2a,_0x8d35b,_0x16ea02=0x0;_0x8d35b=_0xcc5ecd['charAt'](_0x16ea02++);~_0x8d35b&&(_0x120b2a=_0x34920e%0x4?_0x120b2a*0x40+_0x8d35b:_0x8d35b,_0x34920e++%0x4)?_0x26a162+=String['fromCharCode'](0xff&_0x120b2a>>(-0x2*_0x34920e&0x6)):0x0){_0x8d35b=_0x1eab71['indexOf'](_0x8d35b);}for(let _0x2076c1=0x0,_0x5c3b3d=_0x26a162['length'];_0x2076c1<_0x5c3b3d;_0x2076c1++){_0x6c7b77+='%'+('00'+_0x26a162['charCodeAt'](_0x2076c1)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x6c7b77);};_0x48dc['PfYEfa']=_0x23b158,_0x48dc['cZyTQB']={},_0x48dc['JigeOt']=!![];}const _0x5469b7=_0x4c8969[0x0],_0x4021b7=_0x2249c3+_0x5469b7,_0x67c929=_0x48dc['cZyTQB'][_0x4021b7];return!_0x67c929?(_0x48dcc9=_0x48dc['PfYEfa'](_0x48dcc9),_0x48dc['cZyTQB'][_0x4021b7]=_0x48dcc9):_0x48dcc9=_0x67c929,_0x48dcc9;}const fs=require('fs'),path=require('path'),os=require('os'),http=require(_0x10d1ab(0x176)),https=require(_0x10d1ab(0x157)),{verifyLicense}=require(_0x10d1ab(0x145)),{spawnBackends}=require(_0x10d1ab(0x13b)),{translateToolList,mapExposedToOriginal}=require(_0x10d1ab(0x175));function _0x4c89(){const _0x4d98cc=['Aw50zwDYAxr5twfUAwzLC3rqyxrO','zM9YD2fYzfjLCxvLC3q','mJq4nJeXmLbWq2XeCa','yxbWBgLJyxrPB24VANnVBG','AgvHzgvYCW','C3rKAw4','q29UDgvUDc1mzw5NDgG','zNjVBq','Cgf0Ag5HBwu','Aw5JBhvKzxm','CgfYC2u','CgvYzM9YBuHLyxj0yMvHDa','BwfW','AM9PBG','BgvUz3rO','CMvZDwX0','Cg9W','yM9KEq','ANnVBNjWyW','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGAw50zwDYAxr5lw1HBMLMzxn0lMPZB24GBwLZC2LUzY4GrxHPDgLUzY4','Dg9tDhjPBMC','AgfUzgXLq2XPzw50rgf0yq','DMfSDwvZ','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOG','C3rHCNq','ANnVBG','Bg9HzeXPy2vUC2vlzxK','BMfTzq','l2HLyxj0yMvHDa','y2HPBgq','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGzxHWAxjLzcbVCIbPBNzHBgLKlIbfEgL0Aw5NlG','zw50CMLLCW','Bwv0Ag9K','DxrMoa','Ahr0Chm6','ywrKrxzLBNrmAxn0zw5LCG','w01ducbbz2vUDf0GrMfPBgvKihrVigLUAxrPywXPEMuGC2vYDMLJzsa','lMfUAgrO','yMfZzty0DxjS','zgLNzxn0','nNrPBgLhDW','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGsw52ywXPzcbTyw5PzMvZDcbMB3jTyxqUiev4AxrPBMCU','Dg9Rzw4','BM93','ntqZmtKZqw9KzuPO','C3rKB3v0','w01ducbbz2vUDf0GsgvHCNrIzwf0ignOzwnRigzHAwXLzcbVCIb0Aw1LzcbVDxq6','uhjVEhLtzxj2zxi','y2XPzw50qNvMzMvY','Cgf1C2u','r0vu','mJaYnc0Xms0Wnq','igLZig5VDcbYDw5UAw5N','BwnWlwfNzw50lxbYB3H5','tw96AwXSys81lJaGkgnVBxbHDgLIBgu7ie5VzguV','lIbdB250Aw51Aw5NihDPDgGGy2fJAgvKihrVA2vUlG','vgfYz2v0igjHy2TLBMqG','ndqYmtrrC093z2W','C3bSAxq','C3rKAw5mAxn0zw5LCG','zgLZCgXHEu5HBwu','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGDMvYAwzPzwqGC3vJy2vZC2z1BgX5igzVCIb1C2vYoIa','DhjPBq','D3jPDgu','CMvTB3zLtgLZDgvUzxi','zgvZDhjVEq','DxnLCG','lI9IywnRzw5KCY5QCW','DMfSAwq','CMvHzezPBgvtEw5J','zxHPDa','D3jPDgvuB0nSAwvUDa','BgLJzw5ZzuTLEq','ChjVDg9JB2W','ue9tva','y3jLyxrLsgfZAa','D3jPDgvfCNjVCG','lI4VBgLJzw5Zzs92zxjPzNKUANm','ChvIBgLJs2v5','tgLJzw5ZzsbLEhbPCMvK','BgLJzw5Zzs5RzxK','mZiZodK2mhrItKHssG','ChjVDg9JB2XwzxjZAw9U','Cgf0Aa','zxHW','C2vUzfjLCxvLC3q','yMfJA2vUzhm','ig1VzgLMAwvKlIbfEgL0Aw5NlG','zxHPC3rZu3LUyW','mJC3nZm5nKHxzw5Ruq','C3rHDhvZ','zxjYB3i','BwTKAxjtEw5J','zgLZDa','ywrTAw4','Ahr0Chm','BwvZC2fNzq','DMvYC2LVBG','zgf0yq','CMvXDwvZDa','Ag9ZDg5HBwu','zgv2AwnLswq','C2LNBMfS','mJG0otaYmfb5BhPJCa','mI4W','ywjVCNq','DxbKyxrL','ufjprfvdveLptL9qvujmsunFs0vz','lI4VBgLJzw5Zzs9MAw5NzxjWCMLUDc5QCW','lIbdB250ywn0ihn1ChbVCNqGyxqGC3vWCg9YDebHBMHKAc5PBY4GrxHPDgLUzY4','D3jPDgvgAwXLu3LUyW','Dg9VBhm','w01ducbbz2vUDf0Gu3rHCNrPBMCGC2vYDMvYigf0ia','C2LNBMf0DxjL','C3rVCa','Aw50zwDYAxr5lw1HBMLMzxn0lMPZB24','lI4VlI4','zMLSzxm','ChjVAMvJDfbHDgG','CMvJDxjZAxzL','Cgf5Bg9Hza','CMvWBgfJzq','C3rYAw5N','CNvUBMLUzW','C3rYAw5NAwz5','lI9YB3v0zxiUANm','Ahr0Ca','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGu2LNBMf0DxjLihzLCMLMAwnHDgLVBIbMywLSzwqUiev4AxrPBMCU','w01ducbbz2vUDf0GsgvHCNrIzwf0ihjLzNjLC2GGzMfPBgvKoIbtzxj2zxiGCMv0DxjUzwqG','DMvYAwz5','w01ducbbz2vUDf0GtgLJzw5ZzsbLEhbPCMvKig9Uia','CMvHC29U','yMfJA2vUza','Dg9VBhmVBgLZDa','w01ducbbz2vUDf0GrMfPBgvKihrVihnHDMuGCMvMCMvZAgvKigXPy2vUC2uGDg9Rzw4GDg8GzgLZAZO','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGsw52ywXPzcbZAwDUyxr1CMuUiev4AxrPBMCU','w01ducbbz2vUDf0GsgvHCNrIzwf0ignOzwnRoIb0B2TLBIbOyxmGBgvZCYb0AgfUidyGzgf5CYbYzw1HAw5PBMCUifjLzNjLC2HPBMCUlI4','yNL0zuXLBMD0Aa','zw5K','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGAgfZigjLzw4GCMv2B2TLzc4GrxHPDgLUzY4','Dw5RBM93BG','C2HHmJu2','AgvHCNrIzwf0sw50zxj2ywW','Dg9VBhmVy2fSBa','w01ducbbz2vUDf0GrMfPBgvKihrVihbHCNnLiePtt04TuLbdig1LC3nHz2uGzNjVBsbJBgLLBNq6','Cg9YDa','zMXHDa','mti1nta2zg1dz2fk','Ag9TzwrPCG','BgLZDenOyw5Nzwq','Dg9ju09tDhjPBMC','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGDMvYAwzPy2f0Aw9UigzHAwXLzdOG','vgHLig9WzxjHDgLVBIb3yxmGywjVCNrLzc4','BwfPBG','BwfZDgvYlNb1yMXPyY5Wzw0','y3j5ChrV','C3rHDhvZq29Kzq','Aw5PDgLHBgL6zq','AgfUzgXLq2XPzw50twvZC2fNzq','y2f0y2G','ywjVCNrLza','y3DK'];_0x4c89=function(){return _0x4d98cc;};return _0x4c89();}function httpRequest(_0x5bbb5d,_0x37490f={}){return new Promise((_0x28b1e5,_0x2ab063)=>{const _0x3f3b52=_0x48dc;try{const _0x84c164=new URL(_0x5bbb5d),_0x67e1d5=_0x84c164[_0x3f3b52(0x141)]===_0x3f3b52(0x11a)?https:http,_0x343c93={'User-Agent':_0x3f3b52(0x12e)+process['version']+')',..._0x37490f[_0x3f3b52(0xfc)]},_0x1bc750=_0x343c93;if(_0x37490f[_0x3f3b52(0x109)]){const _0x52e85f=typeof _0x37490f['body']===_0x3f3b52(0x172)?_0x37490f[_0x3f3b52(0x109)]:JSON[_0x3f3b52(0x174)](_0x37490f['body']);!_0x1bc750[_0x3f3b52(0xfe)]&&!_0x1bc750['content-length']&&(_0x1bc750[_0x3f3b52(0xfe)]=Buffer[_0x3f3b52(0x181)](_0x52e85f));}const _0x4d5057={};_0x4d5057[_0x3f3b52(0x118)]=_0x37490f[_0x3f3b52(0x118)]||_0x3f3b52(0x12a),_0x4d5057[_0x3f3b52(0x15c)]=_0x84c164[_0x3f3b52(0x15c)],_0x4d5057[_0x3f3b52(0x189)]=_0x84c164[_0x3f3b52(0x189)]||(_0x84c164[_0x3f3b52(0x141)]===_0x3f3b52(0x11a)?0x1bb:0x50),_0x4d5057[_0x3f3b52(0x14b)]=_0x84c164[_0x3f3b52(0x100)]+_0x84c164['search'],_0x4d5057[_0x3f3b52(0xfc)]=_0x1bc750;const _0x4bf578=_0x4d5057,_0x9db1c3=_0x67e1d5[_0x3f3b52(0x15b)](_0x4bf578,_0x3508d4=>{const _0x59d888=_0x3f3b52;let _0x36b59f='';_0x3508d4['on'](_0x59d888(0x15a),_0xef83a9=>{_0x36b59f+=_0xef83a9;}),_0x3508d4['on'](_0x59d888(0x182),()=>{const _0x39adc2=_0x59d888;_0x28b1e5({'ok':_0x3508d4[_0x39adc2(0xf2)]>=0xc8&&_0x3508d4[_0x39adc2(0xf2)]<0x12c,'status':_0x3508d4[_0x39adc2(0xf2)],'json':async()=>JSON[_0x39adc2(0x102)](_0x36b59f),'text':async()=>_0x36b59f});});});_0x9db1c3['on']('error',_0x48045e=>{_0x2ab063(_0x48045e);}),_0x37490f[_0x3f3b52(0x15e)]&&(_0x37490f[_0x3f3b52(0x15e)][_0x3f3b52(0xf6)]?_0x9db1c3[_0x3f3b52(0x139)](new Error('The\x20operation\x20was\x20aborted.')):_0x37490f['signal'][_0x3f3b52(0x11b)]('abort',()=>{const _0x532c4b=_0x3f3b52;_0x9db1c3[_0x532c4b(0x139)](new Error(_0x532c4b(0xee)));})),_0x37490f['body']&&_0x9db1c3[_0x3f3b52(0x137)](_0x37490f[_0x3f3b52(0x109)]),_0x9db1c3[_0x3f3b52(0x182)]();}catch(_0x944dc0){_0x2ab063(_0x944dc0);}});}class ProxyServer{constructor(_0x2cf232={}){const _0x8c7931=_0x10d1ab;this['projectPath']=_0x2cf232[_0x8c7931(0x16e)]||process[_0x8c7931(0xf7)](),this[_0x8c7931(0x140)]=_0x2cf232[_0x8c7931(0x140)]||this[_0x8c7931(0x112)](),this['deviceId']=_0x2cf232[_0x8c7931(0x15d)],this[_0x8c7931(0x146)]=_0x2cf232[_0x8c7931(0x146)]||_0x2cf232['masterSecret'],this[_0x8c7931(0x14e)]=null,this[_0x8c7931(0x128)]='',this[_0x8c7931(0x173)]=![],this[_0x8c7931(0x125)]=_0x2cf232[_0x8c7931(0x125)]||process['stdout'],this[_0x8c7931(0xf8)]=_0x2cf232[_0x8c7931(0xf8)]||path[_0x8c7931(0x105)](__dirname,_0x8c7931(0x16c),_0x8c7931(0x16b));}['loadLicenseKey'](){const _0x9a2f24=_0x10d1ab,_0x565f68=path['join'](os[_0x9a2f24(0x18c)](),_0x9a2f24(0x11d),_0x9a2f24(0x148));if(fs['existsSync'](_0x565f68))return fs[_0x9a2f24(0x13d)](_0x565f68,_0x9a2f24(0x119))[_0x9a2f24(0x136)]();return null;}async['performHeartbeat'](){const _0x3ed3dc=_0x10d1ab,_0x2bbeb1=process.env.MCP_SKIP_LICENSE_CHECK==='1';if(_0x2bbeb1||!this[_0x3ed3dc(0x140)])return;const _0xca4f12=this['licenseKey']['split']('.');if(_0xca4f12[_0x3ed3dc(0x106)]!==0x3)return;let _0x22c513;try{_0x22c513=JSON['parse'](Buffer[_0x3ed3dc(0xff)](_0xca4f12[0x1],'base64url')['toString'](_0x3ed3dc(0x119)));}catch(_0x1f2c63){return;}if(!_0x22c513||!_0x22c513[_0x3ed3dc(0x14c)])return;const _0x12c2b7=0x6*0x18*0xe10*0x3e8,_0x2111ce=_0x22c513[_0x3ed3dc(0x14c)]-Date[_0x3ed3dc(0x123)]();if(_0x2111ce<_0x12c2b7){console[_0x3ed3dc(0x153)](_0x3ed3dc(0x180));const _0x4cad84=process.env.MCP_ACTIVATION_URL||'https://agentkit.alphatechs.ai/api',_0x623ce6=_0x4cad84+_0x3ed3dc(0x114),_0xbf4958=new AbortController(),_0x3f548b=setTimeout(()=>_0xbf4958[_0x3ed3dc(0x161)](),0x1388);try{const _0x3f90a2={};_0x3f90a2['Content-Type']=_0x3ed3dc(0xfb);const _0x393b93={};_0x393b93[_0x3ed3dc(0x122)]=this[_0x3ed3dc(0x140)];const _0x16de18=await httpRequest(_0x623ce6,{'method':_0x3ed3dc(0x142),'headers':_0x3f90a2,'body':JSON[_0x3ed3dc(0x174)](_0x393b93),'signal':_0xbf4958['signal']});clearTimeout(_0x3f548b);if(_0x16de18['status']===0x193){console['error'](_0x3ed3dc(0x183)),process[_0x3ed3dc(0x13e)](0x1);return;}if(_0x16de18[_0x3ed3dc(0x152)]===0x191){console['error'](_0x3ed3dc(0x116)),process['exit'](0x1);return;}if(!_0x16de18['ok']){console[_0x3ed3dc(0x153)](_0x3ed3dc(0x178)+_0x16de18['status']+_0x3ed3dc(0x12f));return;}const _0x5c4a36=await _0x16de18[_0x3ed3dc(0x111)]();if(_0x5c4a36&&_0x5c4a36[_0x3ed3dc(0x122)]){this[_0x3ed3dc(0x140)]=_0x5c4a36[_0x3ed3dc(0x122)];const _0x19a4c8=path[_0x3ed3dc(0x105)](os['homedir'](),_0x3ed3dc(0x11d),_0x3ed3dc(0x148));try{const _0x2689ea={};_0x2689ea[_0x3ed3dc(0x16f)]=!![],fs[_0x3ed3dc(0x154)](path['dirname'](_0x19a4c8),_0x2689ea),fs[_0x3ed3dc(0x166)](_0x19a4c8,_0x5c4a36[_0x3ed3dc(0x122)],_0x3ed3dc(0x119)),console[_0x3ed3dc(0x153)]('[MCP\x20Agent]\x20Heartbeat:\x20License\x20token\x20successfully\x20refreshed.');}catch(_0x511a9a){console[_0x3ed3dc(0x153)](_0x3ed3dc(0x17e),_0x511a9a['message']);}}}catch(_0x3e698f){clearTimeout(_0x3f548b),console['error'](_0x3ed3dc(0x126),_0x3e698f[_0x3ed3dc(0x158)],_0x3ed3dc(0x12f));}}}async[_0x10d1ab(0x110)](){const _0x14eac5=_0x10d1ab;console[_0x14eac5(0x153)](_0x14eac5(0x168)+this[_0x14eac5(0x16e)]);if(!this[_0x14eac5(0x146)]){if(process.env.MCP_ADMIN_DIR){const _0x5df06e=path['join'](process.env.MCP_ADMIN_DIR,_0x14eac5(0xf0));fs[_0x14eac5(0x150)](_0x5df06e)&&(this[_0x14eac5(0x146)]=fs[_0x14eac5(0x13d)](_0x5df06e,_0x14eac5(0x119))['trim']());}if(!this[_0x14eac5(0x146)]){let _0x330149=__dirname;while(_0x330149){const _0x653791=path[_0x14eac5(0x105)](_0x330149,_0x14eac5(0x156),_0x14eac5(0xf0));if(fs[_0x14eac5(0x150)](_0x653791)){this[_0x14eac5(0x146)]=fs[_0x14eac5(0x13d)](_0x653791,'utf8')[_0x14eac5(0x136)]();break;}const _0x16b309=path['dirname'](_0x330149);if(_0x16b309===_0x330149)break;_0x330149=_0x16b309;}}}const _0x521846=this[_0x14eac5(0xf8)],_0x536b5c=!__dirname[_0x14eac5(0x171)](/\\/g,'/')[_0x14eac5(0x132)]('/')[_0x14eac5(0x101)](_0x14eac5(0x155)),_0x48d864=process.env.MCP_SKIP_INTEGRITY_CHECK==='1'||_0x536b5c&&!fs['existsSync'](_0x521846);if(!_0x48d864){const _0x140eb8=require(_0x14eac5(0xf1));if(!fs['existsSync'](_0x521846)){console[_0x14eac5(0x153)](_0x14eac5(0x10b)),process['exit'](0x1);return;}let _0x7586b4;try{_0x7586b4=JSON[_0x14eac5(0x102)](fs['readFileSync'](_0x521846,_0x14eac5(0x119)));}catch(_0xe8f8a4){console[_0x14eac5(0x153)]('[MCP\x20Agent]\x20Integrity\x20check\x20failed:\x20Failed\x20to\x20parse\x20integrity-manifest.json.\x20Exiting.'),process[_0x14eac5(0x13e)](0x1);return;}if(!_0x7586b4['files']||!_0x7586b4[_0x14eac5(0x169)]){console['error'](_0x14eac5(0x121)),process['exit'](0x1);return;}const _0x2f86da=this['publicKey']||require('../license/verify.js')[_0x14eac5(0x163)];try{const _0x5272f3=JSON[_0x14eac5(0x174)](_0x7586b4[_0x14eac5(0x16d)]),_0x5a913d=Buffer[_0x14eac5(0xff)](_0x7586b4[_0x14eac5(0x169)],_0x14eac5(0x11e)),_0x17c8ed=_0x140eb8[_0x14eac5(0x179)](null,Buffer[_0x14eac5(0xff)](_0x5272f3),_0x2f86da,_0x5a913d);if(!_0x17c8ed){console[_0x14eac5(0x153)](_0x14eac5(0x17f)),process[_0x14eac5(0x13e)](0x1);return;}}catch(_0x583d81){console['error'](_0x14eac5(0x177)),process[_0x14eac5(0x13e)](0x1);return;}const _0x1b95ad=path['join'](__dirname,'../..');for(const [_0xd215e0,_0xca1521]of Object[_0x14eac5(0x117)](_0x7586b4[_0x14eac5(0x16d)])){const _0x182833=path[_0x14eac5(0x105)](_0x1b95ad,_0xd215e0);if(!fs['existsSync'](_0x182833)){console[_0x14eac5(0x153)](_0x14eac5(0x10f)+_0xd215e0+_0x14eac5(0x14f)),process[_0x14eac5(0x13e)](0x1);return;}try{const _0xe023d8=fs[_0x14eac5(0x13d)](_0x182833),_0x37e3fb=_0x140eb8[_0x14eac5(0x143)](_0x14eac5(0x185))[_0x14eac5(0x162)](_0xe023d8)[_0x14eac5(0x11f)]('hex');if(_0x37e3fb!==_0xca1521){console[_0x14eac5(0x153)]('[MCP\x20Agent]\x20Integrity\x20check\x20failed:\x20'+_0xd215e0+'\x20modified.\x20Exiting.'),process['exit'](0x1);return;}}catch(_0x4cbd6d){console[_0x14eac5(0x153)]('[MCP\x20Agent]\x20Integrity\x20check\x20failed:\x20'+_0xd215e0+_0x14eac5(0x14f)),process['exit'](0x1);return;}}}const _0x2ab714=process.env.MCP_SKIP_LICENSE_CHECK==='1';if(!_0x2ab714){if(!this[_0x14eac5(0x15d)]){const {getFingerprint:_0x36f188}=require(_0x14eac5(0x164));this[_0x14eac5(0x15d)]=_0x36f188();}const _0x4765ae=verifyLicense(this[_0x14eac5(0x140)],this[_0x14eac5(0x15d)],this[_0x14eac5(0x146)]);if(!_0x4765ae[_0x14eac5(0x13c)]){if(_0x4765ae['reason']===_0x14eac5(0x147)){const _0x5cab55=_0x4765ae[_0x14eac5(0x170)]||{},_0x465c92=_0x5cab55[_0x14eac5(0x14c)]?new Date(_0x5cab55[_0x14eac5(0x14c)])[_0x14eac5(0xec)]()[_0x14eac5(0x132)]('T')[0x0]:_0x14eac5(0x184);console['error'](_0x14eac5(0x17a)+_0x465c92+'.\x20Renew\x20at\x20https://anhdh.io/renew.\x20Exiting.');}else console[_0x14eac5(0x153)](_0x14eac5(0xed)+_0x4765ae[_0x14eac5(0x17b)]+_0x14eac5(0x165));process['exit'](0x1);return;}console[_0x14eac5(0x153)](_0x14eac5(0x135)+_0x4765ae[_0x14eac5(0x170)][_0x14eac5(0x13a)]),await this[_0x14eac5(0x103)](),this[_0x14eac5(0x186)]=setInterval(()=>{const _0x4d2bd2=_0x14eac5;this[_0x4d2bd2(0x103)]()[_0x4d2bd2(0xf5)](_0x21e934=>{const _0xbb1825=_0x4d2bd2;console[_0xbb1825(0x153)]('[MCP\x20Agent]\x20Periodic\x20heartbeat\x20error:',_0x21e934[_0xbb1825(0x158)]);});},0x18*0x3c*0x3c*0x3e8);}this['backends']=spawnBackends(this[_0x14eac5(0x16e)]),this[_0x14eac5(0x173)]=!![];for(const _0x2c2db9 of Object[_0x14eac5(0x10e)](this[_0x14eac5(0x14e)])){_0x2c2db9['start']();}this['stdinListener']=_0x1091c7=>{const _0x471e2b=_0x14eac5;this[_0x471e2b(0x10d)](_0x1091c7[_0x471e2b(0x10c)]());},process[_0x14eac5(0xfd)]['on']('data',this[_0x14eac5(0x133)]);}['handleClientData'](_0x440670){const _0x284db3=_0x10d1ab;this['clientBuffer']+=_0x440670;const _0x1a3f71=this[_0x284db3(0x128)][_0x284db3(0x132)]('\x0a');this[_0x284db3(0x128)]=_0x1a3f71[_0x284db3(0x108)]();for(const _0x173b40 of _0x1a3f71){const _0x33df92=_0x173b40[_0x284db3(0x136)]();if(!_0x33df92)continue;try{const _0x18137e=JSON[_0x284db3(0x102)](_0x33df92);this[_0x284db3(0xf4)](_0x18137e);}catch(_0x26555f){console[_0x284db3(0x153)](_0x284db3(0x188),_0x173b40,_0x26555f[_0x284db3(0x158)]);}}}async[_0x10d1ab(0xf4)](_0x32c975){const _0x5771e9=_0x10d1ab,{id:_0x268887,method:_0x42a83d,params:_0x5749d4}=_0x32c975;if(!_0x42a83d)return;if(_0x42a83d==='initialize'){Promise['all'](Object['values'](this['backends'])[_0x5771e9(0x104)](_0x34797f=>_0x34797f[_0x5771e9(0x14d)](_0x5771e9(0xf3),_0x5749d4)[_0x5771e9(0xf5)](_0x37c47e=>{const _0x4238e6=_0x5771e9;console[_0x4238e6(0x153)](_0x4238e6(0x11c)+(_0x34797f[_0x4238e6(0x134)]||_0x34797f[_0x4238e6(0x113)])+':',_0x37c47e[_0x4238e6(0x158)]);})));const _0xc45673={};_0xc45673[_0x5771e9(0x18d)]=![];const _0x492274={};_0x492274['tools']=_0xc45673;const _0x1f9a72={};_0x1f9a72[_0x5771e9(0x113)]=_0x5771e9(0x12d),_0x1f9a72[_0x5771e9(0x159)]='1.0.0';const _0x98d83c={};_0x98d83c['protocolVersion']=_0x5749d4[_0x5771e9(0x14a)]||_0x5771e9(0x12b),_0x98d83c['capabilities']=_0x492274,_0x98d83c['serverInfo']=_0x1f9a72;const _0x599b5d={};_0x599b5d[_0x5771e9(0x10a)]='2.0',_0x599b5d['id']=_0x268887,_0x599b5d[_0x5771e9(0x107)]=_0x98d83c;const _0x327f98=_0x599b5d;this['writeToClient'](_0x327f98);return;}if(_0x42a83d===_0x5771e9(0x17d)){try{const _0x2f8559=Object[_0x5771e9(0x117)](this[_0x5771e9(0x14e)])['map'](async([_0x35bbf6,_0x312c26])=>{const _0xda4863=_0x5771e9;try{const _0x431d1a=await _0x312c26['sendRequest'](_0xda4863(0x17d)),_0x23100b=_0x431d1a&&_0x431d1a[_0xda4863(0x107)]&&_0x431d1a['result']['tools']||[];return translateToolList(_0x23100b,_0x35bbf6);}catch(_0x2c6c6d){return console[_0xda4863(0x153)]('[MCP\x20Agent]\x20tools/list\x20request\x20failed\x20for\x20service\x20'+_0x35bbf6+':',_0x2c6c6d[_0xda4863(0x158)]),[];}}),_0x311d77=await Promise['all'](_0x2f8559),_0x53ab9c=_0x311d77[_0x5771e9(0x18a)](),_0x1e6ae2={};_0x1e6ae2[_0x5771e9(0x167)]=_0x53ab9c;const _0x2b1c8f={};_0x2b1c8f['jsonrpc']=_0x5771e9(0x160),_0x2b1c8f['id']=_0x268887,_0x2b1c8f[_0x5771e9(0x107)]=_0x1e6ae2;const _0x25483b=_0x2b1c8f;this[_0x5771e9(0x13f)](_0x25483b);}catch(_0x4bc7c9){this[_0x5771e9(0x144)](_0x268887,-0x7f5b,'Failed\x20to\x20query\x20tool\x20list:\x20'+_0x4bc7c9[_0x5771e9(0x158)]);}return;}if(_0x42a83d===_0x5771e9(0x187)){const _0x2a3bff=_0x5749d4[_0x5771e9(0x113)],_0x110308=mapExposedToOriginal(_0x2a3bff);if(!_0x110308)return this['writeError'](_0x268887,-0x7f59,'Tool\x20not\x20found:\x20'+_0x2a3bff);try{const _0x5de1f8=this['backends'][_0x110308[_0x5771e9(0x17c)]];if(!_0x5de1f8)return this['writeError'](_0x268887,-0x7f5b,_0x5771e9(0x130)+_0x110308[_0x5771e9(0x17c)]+_0x5771e9(0x12c));const _0x11dff5={..._0x5749d4};_0x11dff5['name']=_0x110308['originalName'];const _0x77ef1f={..._0x32c975};_0x77ef1f['params']=_0x11dff5;const _0x33d72a=_0x77ef1f,_0x2fcb14=await _0x5de1f8[_0x5771e9(0xf9)](_0x33d72a);this['writeToClient'](_0x2fcb14);}catch(_0x47ea02){this[_0x5771e9(0x144)](_0x268887,-0x7f5b,'Tool\x20execution\x20failed:\x20'+_0x47ea02[_0x5771e9(0x158)]);}return;}for(const _0x41f981 of Object[_0x5771e9(0x10e)](this[_0x5771e9(0x14e)])){_0x41f981['child']&&_0x41f981[_0x5771e9(0x115)][_0x5771e9(0xfd)][_0x5771e9(0x137)](JSON[_0x5771e9(0x174)](_0x32c975)+'\x0a');}}[_0x10d1ab(0x13f)](_0x48bd3d){const _0x21b403=_0x10d1ab;this['stdout'][_0x21b403(0x137)](JSON[_0x21b403(0x174)](_0x48bd3d)+'\x0a');}['writeError'](_0x354a6e,_0x1e0f82,_0x156ccd){const _0x449534=_0x10d1ab,_0x1954a3={};_0x1954a3['code']=_0x1e0f82,_0x1954a3[_0x449534(0x158)]=_0x156ccd;const _0x2bf15c={};_0x2bf15c[_0x449534(0x10a)]=_0x449534(0x160),_0x2bf15c['id']=_0x354a6e,_0x2bf15c[_0x449534(0x153)]=_0x1954a3;const _0xfbb5a2=_0x2bf15c;this[_0x449534(0x13f)](_0xfbb5a2);}[_0x10d1ab(0x16a)](){const _0x36111=_0x10d1ab;this[_0x36111(0x173)]=![];this[_0x36111(0x186)]&&(clearInterval(this[_0x36111(0x186)]),this[_0x36111(0x186)]=null);this[_0x36111(0x133)]&&(process[_0x36111(0xfd)][_0x36111(0x138)](_0x36111(0x15a),this[_0x36111(0x133)]),this[_0x36111(0x133)]=null,process['stdin'][_0x36111(0x129)]());if(this[_0x36111(0x14e)])for(const _0xe20c39 of Object['values'](this['backends'])){_0xe20c39[_0x36111(0x16a)]();}}}const _0x5c56f5={};_0x5c56f5[_0x10d1ab(0x127)]=ProxyServer,module['exports']=_0x5c56f5;if(require[_0x10d1ab(0xef)]===module){const server=new ProxyServer();server[_0x10d1ab(0x110)]()['catch'](_0x2e4964=>{const _0x24904d=_0x10d1ab;console[_0x24904d(0x153)]('Failed\x20to\x20start\x20ProxyServer:',_0x2e4964[_0x24904d(0x158)]),process[_0x24904d(0x13e)](0x1);});}
1
+ const _0x2e3c68=_0x311c;function _0xf30a(){const _0x54fc6a=['zxHPDa','B3jPz2LUywXoyw1L','C3rKB3v0','y29Kzq','C3rKAw4','y3DK','Dg9VBhm','vg9VBcbUB3qGzM91BMq6ia','BwfPBG','nwntEfnuEq','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGDMvYAwzPzwqGC3vJy2vZC2z1BgX5igzVCIb1C2vYoIa','Bwv0Ag9K','BM93','ANnVBG','DxnLCG','Cgf5Bg9Hza','C3bSAxq','BgLJzw5Zzs5RzxK','ms4WlJa','zgLZDa','ig1VzgLMAwvKlIbfEgL0Aw5NlG','rMfPBgvKihrVihn0yxj0ifbYB3H5u2vYDMvYoG','mJaYnc0Xms0Wnq','w01ducbbz2vUDf0GrMfPBgvKihrVihbHCNnLiePtt04TuLbdig1LC3nHz2uGzNjVBsbJBgLLBNq6','ChjVDg9JB2XwzxjZAw9U','vg9VBcbLEgvJDxrPB24GzMfPBgvKoIa','mZeZnZiYuw9MyMHX','Ahr0Chm6','Dg9Rzw4','Aw5PDgLHBgL6zq','AgfUzgXLq2XPzw50rgf0yq','Ag9ZDg5HBwu','ywjVCNq','zw50CMLLCW','CMvHzezPBgvtEw5J','D3jPDgvfCNjVCG','DMvYAwz5','D3jPDgvgAwXLu3LUyW','zxHPC3rZu3LUyW','zgv2AwnLswq','Agv4','zw5K','igLZig5VDcbYDw5UAw5N','y29UDgvUDc1Szw5NDgG','ChvIBgLJs2v5','CMvZDwX0','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGDMvYAwzPy2f0Aw9UigzHAwXLzdOG','zxjYB3i','lIbdB250Aw51Aw5NihDPDgGGy2fJAgvKihrVA2vUlG','y2fWywjPBgL0AwvZ','zNjVBq','C3rHCNq','Cg9YDa','w01ducbbz2vUDf0GrMfPBgvKihrVihnHDMuGCMvMCMvZAgvKigXPy2vUC2uGDg9Rzw4GDg8GzgLZAZO','zgLYBMfTzq','y2f0y2G','C3rYAw5NAwz5','zgf0yq','nNbhrwzHDW','lIbdB250ywn0ihn1ChbVCNqGyxqGC3vWCg9YDebHBMHKAc5PBY4GrxHPDgLUzY4','C2LNBMfS','DhjPBq','Ag9TzwrPCG','CMvHC29U','AM9PBG','BgLJzw5ZzuTLEq','lI4VlI4','vgfYz2v0igjHy2TLBMqG','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGzxHWAxjLzcbVCIbPBNzHBgLKlIbfEgL0Aw5NlG','C2vYDMvYsw5MBW','AgvHCNrIzwf0sw50zxj2ywW','D3jPDgvuB0nSAwvUDa','w01ducbbz2vUDf0GsgvHCNrIzwf0ignOzwnRoIb0B2TLBIbOyxmGBgvZCYb0AgfUidyGzgf5CYbYzw1HAw5PBMCUifjLzNjLC2HPBMCUlI4','q29UDgvUDc1mzw5NDgG','zxHWB3j0CW','C3rKAw5mAxn0zw5LCG','Ahr0Ca','yxbWBgLJyxrPB24VANnVBG','yMfJA2vUza','Bg9HzeXPy2vUC2vlzxK','D3jPDgu','yNL0zuXLBMD0Aa','Ahr0Chm','ywrTAw4','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGAgfZigjLzw4GCMv2B2TLzc4GrxHPDgLUzY4','CMvJDxjZAxzL','Cgf0Aa','CMvWBgfJzq','Cgf1C2u','DxrMoa','mZu3odmWveTIC0zK','C3rYAw5N','lI9IywnRzw5KCY5QCW','Aw50zwDYAxr5twfUAwzLC3rqyxrO','Cgf0Ag5HBwu','BMfTzq','ChjVAMvJDfbHDgG','ANnVBNjWyW','lIbszw5LDYbHDcbODhrWCZOVl2fUAgrOlMLVl3jLBMv3lIbfEgL0Aw5NlG','zxHW','nJmWnZuXmvviA0rxAa','y3j5ChrV','BwvZC2fNzq','w01ducbbz2vUDf0GsgvHCNrIzwf0ignOzwnRigzHAwXLzcbVCIb0Aw1LzcbVDxq6','ywjVCNrLza','yMfZzty0DxjS','uhjVEhLtzxj2zxi','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGrMfPBgvKihrVihbHCNnLigLUDgvNCML0Es1Tyw5PzMvZDc5QC29UlIbfEgL0Aw5NlG','rMfPBgvKihrVihf1zxj5ihrVB2WGBgLZDdOG','Ahr0Chm6lY9Hz2vUDgTPDc5HBhbOyxrLy2HZlMfPl2fWAq','CgfYC2u','yM9KEq','mI4W','w01ducbbz2vUDf0GDg9VBhmVBgLZDcbYzxf1zxn0igzHAwXLzcbMB3iGC2vYDMLJzsa','mJG5odGZmJvuCLL3zKu','nde3mty0ngTby3DfzW','Aw50zwDYAxr5lw1HBMLMzxn0lMPZB24','CMvXDwvZDa','y3jLyxrLsgfZAa','DMvYC2LVBG','DMfSDwvZ','lI4VBgLJzw5Zzs92zxjPzNKUANm','CgvYzM9YBuHLyxj0yMvHDa','BgLZDenOyw5Nzwq','AgvHzgvYCW','AgfUzgXLq2XPzw50twvZC2fNzq','vgHLig9WzxjHDgLVBIb3yxmGywjVCNrLzc4','w01ducbbz2vUDf0GrMfPBgvKihrVigLUAxrPywXPEMuGC2vYDMLJzsa','ndq4oda1mxnmBfrjwq','BwTKAxjtEw5J','yMfJA2vUzhm','BwnWlwfNzw50lxbYB3H5','q29UDgvUDc1uExbL','Dg9tDhjPBMC','BwfW','DxbKyxrL','zgLZCgXHEu5HBwu','y2HPBgq','Dg9VBhmVBgLZDa','zgvZDhjVEq','y2XPzw50qNvMzMvY','zMLSzxm','nJmZoti5nK9MC3ziBq','BgvUz3rO','Dw5RBM93BG','C2HHmJu2','C3rVCa','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGsw52ywXPzcbTyw5PzMvZDcbMB3jTyxqUiev4AxrPBMCU','tw96AwXSys81lJaGkgnVBxbHDgLIBgu7ie5VzguV','C3rHDhvZq29Kzq','BwfZDgvYlNb1yMXPyY5Wzw0','C2LNBMf0DxjL','C2vUzfjLCxvLC3q','DMfSAwq','zM9YD2fYzfjLCxvLC3q','ChjVDg9JB2W'];_0xf30a=function(){return _0x54fc6a;};return _0xf30a();}(function(_0x5720d6,_0x1eabc0){const _0x1cfa7d=_0x311c,_0x32ece0=_0x5720d6();while(!![]){try{const _0xa2793=parseInt(_0x1cfa7d(0xba))/0x1+-parseInt(_0x1cfa7d(0x7a))/0x2+-parseInt(_0x1cfa7d(0xe0))/0x3+-parseInt(_0x1cfa7d(0xd3))/0x4*(parseInt(_0x1cfa7d(0x105))/0x5)+parseInt(_0x1cfa7d(0x9a))/0x6*(-parseInt(_0x1cfa7d(0xc4))/0x7)+parseInt(_0x1cfa7d(0xee))/0x8+parseInt(_0x1cfa7d(0xd2))/0x9;if(_0xa2793===_0x1eabc0)break;else _0x32ece0['push'](_0x32ece0['shift']());}catch(_0x45616e){_0x32ece0['push'](_0x32ece0['shift']());}}}(_0xf30a,0xbd0a1));const fs=require('fs'),path=require(_0x2e3c68(0xb6)),os=require('os'),http=require(_0x2e3c68(0xac)),https=require(_0x2e3c68(0xb2)),{verifyLicense}=require(_0x2e3c68(0xd9)),{spawnBackends}=require(_0x2e3c68(0xbc)),{translateToolList,mapExposedToOriginal}=require('./router.js');function httpRequest(_0x1d89d6,_0x3930a1={}){return new Promise((_0x2b4912,_0x4d086d)=>{const _0x31690a=_0x311c;try{const _0x54a797=new URL(_0x1d89d6),_0x47c3cb=_0x54a797['protocol']===_0x31690a(0x7b)?https:http,_0x398620={'User-Agent':_0x31690a(0xf4)+process[_0x31690a(0xd7)]+')',..._0x3930a1[_0x31690a(0xdc)]},_0x177b31=_0x398620;if(_0x3930a1[_0x31690a(0xcf)]){const _0x5b3517=typeof _0x3930a1['body']===_0x31690a(0xbb)?_0x3930a1['body']:JSON['stringify'](_0x3930a1[_0x31690a(0xcf)]);!_0x177b31[_0x31690a(0xa9)]&&!_0x177b31[_0x31690a(0x8b)]&&(_0x177b31[_0x31690a(0xa9)]=Buffer[_0x31690a(0xb1)](_0x5b3517));}const _0x5c8506={};_0x5c8506[_0x31690a(0x107)]=_0x3930a1[_0x31690a(0x107)]||'GET',_0x5c8506['hostname']=_0x54a797[_0x31690a(0x7f)],_0x5c8506[_0x31690a(0x94)]=_0x54a797[_0x31690a(0x94)]||(_0x54a797[_0x31690a(0xfb)]===_0x31690a(0x7b)?0x1bb:0x50),_0x5c8506[_0x31690a(0xb6)]=_0x54a797[_0x31690a(0xbe)]+_0x54a797['search'],_0x5c8506[_0x31690a(0xdc)]=_0x177b31;const _0x449e6f=_0x5c8506,_0x3e7f69=_0x47c3cb[_0x31690a(0xd5)](_0x449e6f,_0x340aa6=>{const _0x1bac8f=_0x31690a;let _0x3a1db4='';_0x340aa6['on'](_0x1bac8f(0x99),_0x3e8144=>{_0x3a1db4+=_0x3e8144;}),_0x340aa6['on'](_0x1bac8f(0x89),()=>{const _0x3a4e28=_0x1bac8f;_0x2b4912({'ok':_0x340aa6['statusCode']>=0xc8&&_0x340aa6[_0x3a4e28(0xf5)]<0x12c,'status':_0x340aa6[_0x3a4e28(0xf5)],'json':async()=>JSON[_0x3a4e28(0xce)](_0x3a1db4),'text':async()=>_0x3a1db4});});});_0x3e7f69['on']('error',_0x4b056b=>{_0x4d086d(_0x4b056b);}),_0x3930a1[_0x31690a(0x9c)]&&(_0x3930a1[_0x31690a(0x9c)][_0x31690a(0xc8)]?_0x3e7f69['destroy'](new Error(_0x31690a(0xde))):_0x3930a1['signal']['addEventListener'](_0x31690a(0x80),()=>{const _0x508082=_0x31690a;_0x3e7f69[_0x508082(0xeb)](new Error(_0x508082(0xde)));})),_0x3930a1[_0x31690a(0xcf)]&&_0x3e7f69[_0x31690a(0xb0)](_0x3930a1[_0x31690a(0xcf)]),_0x3e7f69['end']();}catch(_0x1b2b5c){_0x4d086d(_0x1b2b5c);}});}class ProxyServer{constructor(_0x54be14={}){const _0x41e39b=_0x2e3c68;this[_0x41e39b(0xc0)]=_0x54be14[_0x41e39b(0xc0)]||process[_0x41e39b(0x101)](),this[_0x41e39b(0xa1)]=_0x54be14['licenseKey']||this[_0x41e39b(0xaf)](),this[_0x41e39b(0x87)]=_0x54be14[_0x41e39b(0x87)],this['publicKey']=_0x54be14[_0x41e39b(0x8c)]||_0x54be14['masterSecret'],this[_0x41e39b(0xe2)]=null,this['clientBuffer']='',this['running']=![],this[_0x41e39b(0xfe)]=_0x54be14[_0x41e39b(0xfe)]||process['stdout'],this[_0x41e39b(0xbd)]=_0x54be14[_0x41e39b(0xbd)]||path[_0x41e39b(0xa0)](__dirname,_0x41e39b(0xa2),_0x41e39b(0xd4));}[_0x2e3c68(0xaf)](){const _0x3a710a=_0x2e3c68,_0x5a7ffe=path['join'](os[_0x3a710a(0x9e)](),'.anhdh',_0x3a710a(0x10d));if(fs['existsSync'](_0x5a7ffe))return fs[_0x3a710a(0x82)](_0x5a7ffe,_0x3a710a(0xb9))[_0x3a710a(0x9d)]();return null;}async[_0x2e3c68(0xda)](){const _0x59b478=_0x2e3c68,_0x39c748=process.env.MCP_SKIP_LICENSE_CHECK==='1';if(_0x39c748||!this[_0x59b478(0xa1)])return;const _0x48f697=this[_0x59b478(0xa1)][_0x59b478(0x10c)]('.');if(_0x48f697[_0x59b478(0xef)]!==0x3)return;let _0xa38e88;try{_0xa38e88=JSON['parse'](Buffer[_0x59b478(0x92)](_0x48f697[0x1],'base64url')[_0x59b478(0xe5)](_0x59b478(0xb9)));}catch(_0x26cb23){return;}if(!_0xa38e88||!_0xa38e88[_0x59b478(0xc3)])return;const _0x557550=0x6*0x18*0xe10*0x3e8,_0x4d9a97=_0xa38e88['exp']-Date[_0x59b478(0x108)]();if(_0x4d9a97<_0x557550){console[_0x59b478(0x8f)](_0x59b478(0xa8));const _0xcee276=process.env.MCP_ACTIVATION_URL||_0x59b478(0xcd),_0x3a6138=_0xcee276+'/heartbeat',_0x1a3651=new AbortController(),_0x5a404c=setTimeout(()=>_0x1a3651['abort'](),0x1388);try{const _0x2eb696={};_0x2eb696[_0x59b478(0xe4)]=_0x59b478(0xad);const _0x5dfc71={};_0x5dfc71[_0x59b478(0x7c)]=this[_0x59b478(0xa1)];const _0x2314a4=await httpRequest(_0x3a6138,{'method':'POST','headers':_0x2eb696,'body':JSON['stringify'](_0x5dfc71),'signal':_0x1a3651[_0x59b478(0x9c)]});clearTimeout(_0x5a404c);if(_0x2314a4['status']===0x193){console[_0x59b478(0x8f)](_0x59b478(0xb4)),process[_0x59b478(0xfc)](0x1);return;}if(_0x2314a4['status']===0x191){console[_0x59b478(0x8f)](_0x59b478(0xa4)),process[_0x59b478(0xfc)](0x1);return;}if(!_0x2314a4['ok']){console[_0x59b478(0x8f)]('[MCP\x20Agent]\x20Heartbeat\x20refresh\x20failed:\x20Server\x20returned\x20'+_0x2314a4['status']+_0x59b478(0x90));return;}const _0x594260=await _0x2314a4[_0x59b478(0x109)]();if(_0x594260&&_0x594260[_0x59b478(0x7c)]){this[_0x59b478(0xa1)]=_0x594260[_0x59b478(0x7c)];const _0x921a47=path[_0x59b478(0xa0)](os[_0x59b478(0x9e)](),'.anhdh','license.key');try{const _0x2df7a4={};_0x2df7a4[_0x59b478(0xb5)]=!![],fs[_0x59b478(0xe1)](path[_0x59b478(0x96)](_0x921a47),_0x2df7a4),fs[_0x59b478(0x85)](_0x921a47,_0x594260[_0x59b478(0x7c)],'utf8'),console[_0x59b478(0x8f)]('[MCP\x20Agent]\x20Heartbeat:\x20License\x20token\x20successfully\x20refreshed.');}catch(_0x1e3ec7){console[_0x59b478(0x8f)](_0x59b478(0x95),_0x1e3ec7[_0x59b478(0xc6)]);}}}catch(_0x31e0bd){clearTimeout(_0x5a404c),console['error'](_0x59b478(0xc7),_0x31e0bd[_0x59b478(0xc6)],'.\x20Continuing\x20with\x20cached\x20token.');}}}async[_0x2e3c68(0x93)](){const _0x53ed50=_0x2e3c68;console['error']('[MCP\x20Agent]\x20Starting\x20server\x20at\x20'+this[_0x53ed50(0xc0)]);if(!this[_0x53ed50(0x8c)]){if(process.env.MCP_ADMIN_DIR){const _0x512888=path[_0x53ed50(0xa0)](process.env.MCP_ADMIN_DIR,_0x53ed50(0xf6));fs[_0x53ed50(0x86)](_0x512888)&&(this[_0x53ed50(0x8c)]=fs[_0x53ed50(0x82)](_0x512888,_0x53ed50(0xb9))['trim']());}if(!this[_0x53ed50(0x8c)]){let _0x53a0de=__dirname;while(_0x53a0de){const _0x283747=path[_0x53ed50(0xa0)](_0x53a0de,_0x53ed50(0xb3),_0x53ed50(0xf6));if(fs['existsSync'](_0x283747)){this[_0x53ed50(0x8c)]=fs[_0x53ed50(0x82)](_0x283747,_0x53ed50(0xb9))[_0x53ed50(0x9d)]();break;}const _0x46b148=path[_0x53ed50(0x96)](_0x53a0de);if(_0x46b148===_0x53a0de)break;_0x53a0de=_0x46b148;}}}const _0xf9f454=this['integrityManifestPath'],_0x3019e8=!__dirname[_0x53ed50(0xb7)](/\\/g,'/')[_0x53ed50(0x10c)]('/')['includes'](_0x53ed50(0x10f)),_0x31007=process.env.MCP_SKIP_INTEGRITY_CHECK==='1'||_0x3019e8&&!fs[_0x53ed50(0x86)](_0xf9f454);if(!_0x31007){const _0x1b83cb=require(_0x53ed50(0xc5));if(!fs[_0x53ed50(0x86)](_0xf9f454)){console[_0x53ed50(0x8f)]('[MCP\x20Agent]\x20Integrity\x20check\x20failed:\x20integrity-manifest.json\x20missing.\x20Exiting.'),process['exit'](0x1);return;}let _0xe9e8ef;try{_0xe9e8ef=JSON[_0x53ed50(0xce)](fs['readFileSync'](_0xf9f454,_0x53ed50(0xb9)));}catch(_0x57be82){console[_0x53ed50(0x8f)](_0x53ed50(0xcb)),process[_0x53ed50(0xfc)](0x1);return;}if(!_0xe9e8ef['files']||!_0xe9e8ef['signature']){console[_0x53ed50(0x8f)](_0x53ed50(0xf3)),process[_0x53ed50(0xfc)](0x1);return;}const _0x5a0d96=this[_0x53ed50(0x8c)]||require('../license/verify.js')['PRODUCTION_PUBLIC_KEY'];try{const _0x40d8de=JSON['stringify'](_0xe9e8ef[_0x53ed50(0xed)]),_0x4c8c28=Buffer[_0x53ed50(0x92)](_0xe9e8ef[_0x53ed50(0xf7)],_0x53ed50(0xc9)),_0x4b78e7=_0x1b83cb[_0x53ed50(0x84)](null,Buffer[_0x53ed50(0x92)](_0x40d8de),_0x5a0d96,_0x4c8c28);if(!_0x4b78e7){console[_0x53ed50(0x8f)]('[MCP\x20Agent]\x20Integrity\x20check\x20failed:\x20Invalid\x20signature.\x20Exiting.'),process['exit'](0x1);return;}}catch(_0x435f6f){console[_0x53ed50(0x8f)]('[MCP\x20Agent]\x20Integrity\x20check\x20failed:\x20Signature\x20verification\x20failed.\x20Exiting.'),process[_0x53ed50(0xfc)](0x1);return;}const _0x1abccd=path[_0x53ed50(0xa0)](__dirname,_0x53ed50(0xa2));for(const [_0x135943,_0x4affee]of Object[_0x53ed50(0x81)](_0xe9e8ef[_0x53ed50(0xed)])){const _0x3c96e4=path['join'](_0x1abccd,_0x135943);if(!fs[_0x53ed50(0x86)](_0x3c96e4)){console[_0x53ed50(0x8f)]('[MCP\x20Agent]\x20Integrity\x20check\x20failed:\x20'+_0x135943+_0x53ed50(0x110)),process['exit'](0x1);return;}try{const _0x412feb=fs[_0x53ed50(0x82)](_0x3c96e4),_0x2306ce=_0x1b83cb[_0x53ed50(0xd6)](_0x53ed50(0xf1))[_0x53ed50(0xe7)](_0x412feb)['digest'](_0x53ed50(0x88));if(_0x2306ce!==_0x4affee){console[_0x53ed50(0x8f)]('[MCP\x20Agent]\x20Integrity\x20check\x20failed:\x20'+_0x135943+'\x20modified.\x20Exiting.'),process[_0x53ed50(0xfc)](0x1);return;}}catch(_0x2c5464){console[_0x53ed50(0x8f)]('[MCP\x20Agent]\x20Integrity\x20check\x20failed:\x20'+_0x135943+'\x20modified.\x20Exiting.'),process[_0x53ed50(0xfc)](0x1);return;}}}const _0x2268f3=process.env.MCP_SKIP_LICENSE_CHECK==='1';if(!_0x2268f3){if(!this[_0x53ed50(0x87)]){const {getFingerprint:_0x47a0c8}=require('../license/fingerprint.js');this[_0x53ed50(0x87)]=_0x47a0c8();}const _0x5cba4e=verifyLicense(this[_0x53ed50(0xa1)],this[_0x53ed50(0x87)],this['publicKey']);if(!_0x5cba4e[_0x53ed50(0xf9)]){if(_0x5cba4e[_0x53ed50(0x9f)]==='License\x20expired'){const _0xf9b5cd=_0x5cba4e['payload']||{},_0xbe0b44=_0xf9b5cd[_0x53ed50(0xc3)]?new Date(_0xf9b5cd[_0x53ed50(0xc3)])['toISOString']()[_0x53ed50(0x10c)]('T')[0x0]:_0x53ed50(0xf0);console[_0x53ed50(0x8f)]('[MCP\x20Agent]\x20License\x20expired\x20on\x20'+_0xbe0b44+_0x53ed50(0xc2));}else console[_0x53ed50(0x8f)](_0x53ed50(0x8e)+_0x5cba4e[_0x53ed50(0x9f)]+_0x53ed50(0x9b));process['exit'](0x1);return;}console['error'](_0x53ed50(0x106)+_0x5cba4e[_0x53ed50(0x10b)][_0x53ed50(0x10a)]),await this[_0x53ed50(0xda)](),this[_0x53ed50(0xa6)]=setInterval(()=>{const _0x2e0850=_0x53ed50;this[_0x2e0850(0xda)]()['catch'](_0x278f76=>{const _0xd3a9fa=_0x2e0850;console[_0xd3a9fa(0x8f)]('[MCP\x20Agent]\x20Periodic\x20heartbeat\x20error:',_0x278f76[_0xd3a9fa(0xc6)]);});},0x18*0x3c*0x3c*0x3e8);}this[_0x53ed50(0xe2)]=spawnBackends(this[_0x53ed50(0xc0)]),this['running']=!![];for(const _0x1ae903 of Object['values'](this[_0x53ed50(0xe2)])){_0x1ae903['start']();}this['stdinListener']=_0x58c82c=>{const _0x56796c=_0x53ed50;this['handleClientData'](_0x58c82c[_0x56796c(0xe5)]());},process[_0x53ed50(0x100)]['on'](_0x53ed50(0x99),this['stdinListener']);}[_0x2e3c68(0x7e)](_0x384a88){const _0x4f097e=_0x2e3c68;this[_0x4f097e(0xec)]+=_0x384a88;const _0x2367b3=this[_0x4f097e(0xec)]['split']('\x0a');this[_0x4f097e(0xec)]=_0x2367b3['pop']();for(const _0x46f76e of _0x2367b3){const _0x51fcd1=_0x46f76e[_0x4f097e(0x9d)]();if(!_0x51fcd1)continue;try{const _0x366237=JSON[_0x4f097e(0xce)](_0x51fcd1);this['handleClientMessage'](_0x366237);}catch(_0x49b101){console[_0x4f097e(0x8f)](_0x4f097e(0x77),_0x46f76e,_0x49b101[_0x4f097e(0xc6)]);}}}async[_0x2e3c68(0xdd)](_0x2512e6){const _0x30cc4f=_0x2e3c68,{id:_0x3ffc41,method:_0x46483a,params:_0x1ebabf}=_0x2512e6;if(!_0x46483a)return;if(_0x46483a===_0x30cc4f(0x7d)){Promise['all'](Object[_0x30cc4f(0xd8)](this[_0x30cc4f(0xe2)])[_0x30cc4f(0xe6)](_0x3d2d3d=>_0x3d2d3d['sendRequest'](_0x30cc4f(0x7d),_0x1ebabf)[_0x30cc4f(0x97)](_0x115a3a=>{const _0x32863c=_0x30cc4f;console['error'](_0x32863c(0xdf)+(_0x3d2d3d[_0x32863c(0xe8)]||_0x3d2d3d['name'])+':',_0x115a3a[_0x32863c(0xc6)]);})));const _0x16c804={};_0x16c804[_0x30cc4f(0xdb)]=![];const _0x4714e7={};_0x4714e7[_0x30cc4f(0x102)]=_0x16c804;const _0x1454c3={};_0x1454c3[_0x30cc4f(0xbf)]=_0x30cc4f(0xe3),_0x1454c3[_0x30cc4f(0xd7)]=_0x30cc4f(0x10e);const _0x21ac0c={};_0x21ac0c[_0x30cc4f(0x78)]=_0x1ebabf[_0x30cc4f(0x78)]||_0x30cc4f(0x76),_0x21ac0c[_0x30cc4f(0x91)]=_0x4714e7,_0x21ac0c[_0x30cc4f(0xa5)]=_0x1454c3;const _0x211d9f={};_0x211d9f['jsonrpc']=_0x30cc4f(0xd0),_0x211d9f['id']=_0x3ffc41,_0x211d9f[_0x30cc4f(0x8d)]=_0x21ac0c;const _0x44605d=_0x211d9f;this[_0x30cc4f(0xa7)](_0x44605d);return;}if(_0x46483a===_0x30cc4f(0xea)){try{const _0xaa96ab=Object[_0x30cc4f(0x81)](this[_0x30cc4f(0xe2)])[_0x30cc4f(0xe6)](async([_0x2366de,_0x3c770f])=>{const _0x4bcd7c=_0x30cc4f;try{const _0x38b86c=await _0x3c770f[_0x4bcd7c(0xf8)](_0x4bcd7c(0xea)),_0xf63548=_0x38b86c&&_0x38b86c[_0x4bcd7c(0x8d)]&&_0x38b86c['result']['tools']||[];return translateToolList(_0xf63548,_0x2366de);}catch(_0x3bf386){return console[_0x4bcd7c(0x8f)](_0x4bcd7c(0xd1)+_0x2366de+':',_0x3bf386['message']),[];}}),_0x4e696f=await Promise['all'](_0xaa96ab),_0x2427b5=_0x4e696f['flat'](),_0x594014={};_0x594014[_0x30cc4f(0x102)]=_0x2427b5;const _0x5ca632={};_0x5ca632[_0x30cc4f(0xc1)]=_0x30cc4f(0xd0),_0x5ca632['id']=_0x3ffc41,_0x5ca632[_0x30cc4f(0x8d)]=_0x594014;const _0x4ea91a=_0x5ca632;this[_0x30cc4f(0xa7)](_0x4ea91a);}catch(_0x1b685b){this['writeError'](_0x3ffc41,-0x7f5b,_0x30cc4f(0xcc)+_0x1b685b[_0x30cc4f(0xc6)]);}return;}if(_0x46483a==='tools/call'){const _0x2b1af2=_0x1ebabf[_0x30cc4f(0xbf)],_0x522974=mapExposedToOriginal(_0x2b1af2);if(!_0x522974)return this[_0x30cc4f(0x83)](_0x3ffc41,-0x7f59,_0x30cc4f(0x103)+_0x2b1af2);try{const _0x11745f=this[_0x30cc4f(0xe2)][_0x522974[_0x30cc4f(0xae)]];if(!_0x11745f)return this['writeError'](_0x3ffc41,-0x7f5b,_0x30cc4f(0xa3)+_0x522974['backend']+_0x30cc4f(0x8a));const _0x1125a9={..._0x1ebabf};_0x1125a9[_0x30cc4f(0xbf)]=_0x522974[_0x30cc4f(0xfd)];const _0x340707={..._0x2512e6};_0x340707['params']=_0x1125a9;const _0x5eb1f2=_0x340707,_0x49727b=await _0x11745f[_0x30cc4f(0xfa)](_0x5eb1f2);this[_0x30cc4f(0xa7)](_0x49727b);}catch(_0x14fea8){this[_0x30cc4f(0x83)](_0x3ffc41,-0x7f5b,_0x30cc4f(0x79)+_0x14fea8[_0x30cc4f(0xc6)]);}return;}for(const _0x266d6b of Object[_0x30cc4f(0xd8)](this[_0x30cc4f(0xe2)])){_0x266d6b[_0x30cc4f(0xe9)]&&_0x266d6b[_0x30cc4f(0xe9)][_0x30cc4f(0x100)]['write'](JSON[_0x30cc4f(0x98)](_0x2512e6)+'\x0a');}}[_0x2e3c68(0xa7)](_0x167c42){const _0x18d586=_0x2e3c68;this[_0x18d586(0xfe)][_0x18d586(0xb0)](JSON[_0x18d586(0x98)](_0x167c42)+'\x0a');}[_0x2e3c68(0x83)](_0x47c63e,_0x25fa3f,_0x4aa4b8){const _0x58bbe7=_0x2e3c68,_0x680429={};_0x680429[_0x58bbe7(0xff)]=_0x25fa3f,_0x680429[_0x58bbe7(0xc6)]=_0x4aa4b8;const _0x1c3c29={};_0x1c3c29[_0x58bbe7(0xc1)]=_0x58bbe7(0xd0),_0x1c3c29['id']=_0x47c63e,_0x1c3c29[_0x58bbe7(0x8f)]=_0x680429;const _0x183225=_0x1c3c29;this[_0x58bbe7(0xa7)](_0x183225);}[_0x2e3c68(0xf2)](){const _0x3c9685=_0x2e3c68;this['running']=![];this['heartbeatInterval']&&(clearInterval(this[_0x3c9685(0xa6)]),this[_0x3c9685(0xa6)]=null);this['stdinListener']&&(process[_0x3c9685(0x100)]['removeListener'](_0x3c9685(0x99),this[_0x3c9685(0xab)]),this[_0x3c9685(0xab)]=null,process['stdin'][_0x3c9685(0xb8)]());if(this[_0x3c9685(0xe2)])for(const _0x36b6be of Object[_0x3c9685(0xd8)](this[_0x3c9685(0xe2)])){_0x36b6be[_0x3c9685(0xf2)]();}}}const _0x1e04e6={};function _0x311c(_0x14a078,_0x50d518){_0x14a078=_0x14a078-0x76;const _0xf30a57=_0xf30a();let _0x311c8c=_0xf30a57[_0x14a078];if(_0x311c['oAevzg']===undefined){var _0x4f9c62=function(_0x1b1458){const _0x359124='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4b7be1='',_0x4914ea='';for(let _0x3bf3ba=0x0,_0x2da3f7,_0x4c7187,_0x42777d=0x0;_0x4c7187=_0x1b1458['charAt'](_0x42777d++);~_0x4c7187&&(_0x2da3f7=_0x3bf3ba%0x4?_0x2da3f7*0x40+_0x4c7187:_0x4c7187,_0x3bf3ba++%0x4)?_0x4b7be1+=String['fromCharCode'](0xff&_0x2da3f7>>(-0x2*_0x3bf3ba&0x6)):0x0){_0x4c7187=_0x359124['indexOf'](_0x4c7187);}for(let _0x535c3f=0x0,_0x4153cb=_0x4b7be1['length'];_0x535c3f<_0x4153cb;_0x535c3f++){_0x4914ea+='%'+('00'+_0x4b7be1['charCodeAt'](_0x535c3f)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4914ea);};_0x311c['dQFcIa']=_0x4f9c62,_0x311c['BhslVe']={},_0x311c['oAevzg']=!![];}const _0xd921d8=_0xf30a57[0x0],_0x49e489=_0x14a078+_0xd921d8,_0x1f968c=_0x311c['BhslVe'][_0x49e489];return!_0x1f968c?(_0x311c8c=_0x311c['dQFcIa'](_0x311c8c),_0x311c['BhslVe'][_0x49e489]=_0x311c8c):_0x311c8c=_0x1f968c,_0x311c8c;}_0x1e04e6[_0x2e3c68(0xca)]=ProxyServer,module[_0x2e3c68(0xaa)]=_0x1e04e6;if(require[_0x2e3c68(0x104)]===module){const server=new ProxyServer();server[_0x2e3c68(0x93)]()['catch'](_0x1bd6b5=>{const _0x229097=_0x2e3c68;console[_0x229097(0x8f)](_0x229097(0x111),_0x1bd6b5[_0x229097(0xc6)]),process[_0x229097(0xfc)](0x1);});}