apt-mcp-agent-setup 1.2.9 → 1.2.11

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 _0x5b2fd0=_0x53bb;(function(_0x39b5dd,_0x2cf06f){const _0x14a8d9=_0x53bb,_0x29c957=_0x39b5dd();while(!![]){try{const _0x20ddf2=parseInt(_0x14a8d9(0x128))/0x1+parseInt(_0x14a8d9(0x127))/0x2+parseInt(_0x14a8d9(0xee))/0x3+parseInt(_0x14a8d9(0x164))/0x4+parseInt(_0x14a8d9(0xdc))/0x5+parseInt(_0x14a8d9(0x125))/0x6*(-parseInt(_0x14a8d9(0x167))/0x7)+-parseInt(_0x14a8d9(0x115))/0x8;if(_0x20ddf2===_0x2cf06f)break;else _0x29c957['push'](_0x29c957['shift']());}catch(_0x3a9e61){_0x29c957['push'](_0x29c957['shift']());}}}(_0x230d,0x3be83));const fs=require('fs'),path=require('path'),os=require('os'),http=require(_0x5b2fd0(0x13d)),https=require(_0x5b2fd0(0x153)),{verifyLicense}=require(_0x5b2fd0(0x157)),{spawnBackends}=require('./backends.js'),{translateToolList,mapExposedToOriginal}=require('./router.js');function httpRequest(_0x2bc0d6,_0x2b97d5={}){return new Promise((_0x1370a0,_0x187c03)=>{const _0x4108fa=_0x53bb;try{const _0x22762b=new URL(_0x2bc0d6),_0x432a1c=_0x22762b[_0x4108fa(0x14b)]===_0x4108fa(0x119)?https:http,_0x6d01bc={'User-Agent':_0x4108fa(0x146)+process[_0x4108fa(0xec)]+')',..._0x2b97d5[_0x4108fa(0x173)]},_0x226628=_0x6d01bc;if(_0x2b97d5[_0x4108fa(0x168)]){const _0x1bbc22=typeof _0x2b97d5[_0x4108fa(0x168)]==='string'?_0x2b97d5[_0x4108fa(0x168)]:JSON[_0x4108fa(0x11a)](_0x2b97d5[_0x4108fa(0x168)]);!_0x226628[_0x4108fa(0x134)]&&!_0x226628['content-length']&&(_0x226628['Content-Length']=Buffer[_0x4108fa(0xf5)](_0x1bbc22));}const _0x1d7e09={};_0x1d7e09[_0x4108fa(0x129)]=_0x2b97d5[_0x4108fa(0x129)]||_0x4108fa(0xf4),_0x1d7e09[_0x4108fa(0xd8)]=_0x22762b['hostname'],_0x1d7e09[_0x4108fa(0x163)]=_0x22762b[_0x4108fa(0x163)]||(_0x22762b[_0x4108fa(0x14b)]==='https:'?0x1bb:0x50),_0x1d7e09['path']=_0x22762b[_0x4108fa(0x16b)]+_0x22762b[_0x4108fa(0x169)],_0x1d7e09[_0x4108fa(0x173)]=_0x226628;const _0x36ed9f=_0x1d7e09,_0x4aad58=_0x432a1c[_0x4108fa(0x124)](_0x36ed9f,_0x59413f=>{const _0x4f9225=_0x4108fa;let _0x33ba98='';_0x59413f['on'](_0x4f9225(0x141),_0x206598=>{_0x33ba98+=_0x206598;}),_0x59413f['on'](_0x4f9225(0x162),()=>{const _0x1eb55a=_0x4f9225;_0x1370a0({'ok':_0x59413f[_0x1eb55a(0xd9)]>=0xc8&&_0x59413f[_0x1eb55a(0xd9)]<0x12c,'status':_0x59413f[_0x1eb55a(0xd9)],'json':async()=>JSON[_0x1eb55a(0xfa)](_0x33ba98),'text':async()=>_0x33ba98});});});_0x4aad58['on']('error',_0x5a620b=>{_0x187c03(_0x5a620b);}),_0x2b97d5['signal']&&(_0x2b97d5[_0x4108fa(0xf8)][_0x4108fa(0xd4)]?_0x4aad58[_0x4108fa(0x11e)](new Error('The\x20operation\x20was\x20aborted.')):_0x2b97d5[_0x4108fa(0xf8)][_0x4108fa(0x12e)](_0x4108fa(0xe1),()=>{const _0x47301d=_0x4108fa;_0x4aad58[_0x47301d(0x11e)](new Error(_0x47301d(0x15b)));})),_0x2b97d5[_0x4108fa(0x168)]&&_0x4aad58[_0x4108fa(0x103)](_0x2b97d5['body']),_0x4aad58['end']();}catch(_0x2c086c){_0x187c03(_0x2c086c);}});}function _0x53bb(_0x5b1fb2,_0x1046e2){_0x5b1fb2=_0x5b1fb2-0xd1;const _0x230d4b=_0x230d();let _0x53bbaf=_0x230d4b[_0x5b1fb2];if(_0x53bb['IyBOSQ']===undefined){var _0x531581=function(_0x4c92a3){const _0x46b166='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x663329='',_0x5ebf26='';for(let _0x285097=0x0,_0x3e17b5,_0x2d1d53,_0x4f5844=0x0;_0x2d1d53=_0x4c92a3['charAt'](_0x4f5844++);~_0x2d1d53&&(_0x3e17b5=_0x285097%0x4?_0x3e17b5*0x40+_0x2d1d53:_0x2d1d53,_0x285097++%0x4)?_0x663329+=String['fromCharCode'](0xff&_0x3e17b5>>(-0x2*_0x285097&0x6)):0x0){_0x2d1d53=_0x46b166['indexOf'](_0x2d1d53);}for(let _0x16289d=0x0,_0x5405d0=_0x663329['length'];_0x16289d<_0x5405d0;_0x16289d++){_0x5ebf26+='%'+('00'+_0x663329['charCodeAt'](_0x16289d)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5ebf26);};_0x53bb['jXfFrF']=_0x531581,_0x53bb['YLaroh']={},_0x53bb['IyBOSQ']=!![];}const _0x10b8a2=_0x230d4b[0x0],_0x153524=_0x5b1fb2+_0x10b8a2,_0x21f3b8=_0x53bb['YLaroh'][_0x153524];return!_0x21f3b8?(_0x53bbaf=_0x53bb['jXfFrF'](_0x53bbaf),_0x53bb['YLaroh'][_0x153524]=_0x53bbaf):_0x53bbaf=_0x21f3b8,_0x53bbaf;}function _0x230d(){const _0x171141=['ChjVAMvJDfbHDgG','y3DK','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGAw50zwDYAxr5lw1HBMLMzxn0lMPZB24GBwLZC2LUzY4GrxHPDgLUzY4','zgLNzxn0','ywXS','CMvZDwX0','Dg9tDhjPBMC','AgvHzgvYCW','C2HHmJu2','BwfZDgvYlNb1yMXPyY5Wzw0','AM9PBG','ywjVCNrLza','BgLJzw5Zzs5RzxK','AgvHCNrIzwf0sw50zxj2ywW','C3rKAw5mAxn0zw5LCG','Ag9ZDg5HBwu','C3rHDhvZq29Kzq','Bg9HzeXPy2vUC2vlzxK','y2HPBgq','ndu3mZK1vfLRvNHi','zxHW','BwfZDgvYu2vJCMv0','w01ducbbz2vUDf0GrMfPBgvKihrVihbHCNnLiePtt04TuLbdig1LC3nHz2uGzNjVBsbJBgLLBNq6','BgvUz3rO','ywjVCNq','lI4VBgLJzw5Zzs9MAw5NzxjWCMLUDc5QCW','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGrMfPBgvKihrVihbHCNnLigLUDgvNCML0Es1Tyw5PzMvZDc5QC29UlIbfEgL0Aw5NlG','DxbKyxrL','Cgf1C2u','Ag9TzwrPCG','y2XPzw50qNvMzMvY','BMfTzq','B3jPz2LUywXoyw1L','C3rHCNq','BgLJzw5ZzuTLEq','DMvYC2LVBG','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGu2LNBMf0DxjLihzLCMLMAwnHDgLVBIbMywLSzwqUiev4AxrPBMCU','mZG2mZy0BgrfBhjP','y2fWywjPBgL0AwvZ','CMvJDxjZAxzL','Cgf5Bg9Hza','q29UDgvUDc1uExbL','BwvZC2fNzq','r0vu','yNL0zuXLBMD0Aa','AgfUzgXLq2XPzw50rgf0yq','w01ducbbz2vUDf0Gu3rHCNrPBMCGC2vYDMvYigf0ia','C2LNBMfS','w01ducbbz2vUDf0GrMfPBgvKihrVigLUAxrPywXPEMuGC2vYDMLJzsa','CgfYC2u','rMfPBgvKihrVihn0yxj0ifbYB3H5u2vYDMvYoG','CNvUBMLUzW','yMfZzty0DxjS','CMvWBgfJzq','w01ducbbz2vUDf0GsgvHCNrIzwf0ignOzwnRoIb0B2TLBIbOyxmGBgvZCYb0AgfUidyGzgf5CYbYzw1HAw5PBMCUifjLzNjLC2HPBMCUlI4','ChjVDg9JB2XwzxjZAw9U','zMXHDa','Dg9VBhm','D3jPDgu','ig1VzgLMAwvKlIbfEgL0Aw5NlG','zNjVBq','yMfJA2vUzhm','DhjPBq','lIbdB250Aw51Aw5NihDPDgGGy2fJAgvKihrVA2vUlG','C2vUzfjLCxvLC3q','Dg9Rzw4','l2HLyxj0yMvHDa','Dg9VBhmVBgLZDa','Dg9VBhmVy2fSBa','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGDMvYAwzPzwqGC3vJy2vZC2z1BgX5igzVCIb1C2vYoIa','Dg9ju09tDhjPBMC','y29Kzq','lI4VlI4','y3jLyxrLsgfZAa','rMfPBgvKihrVihf1zxj5ihrVB2WGBgLZDdOG','vg9VBcbUB3qGzM91BMq6ia','ntK3mtq5nLPhuuPRvW','yxbWBgLJyxrPB24VANnVBG','zw50CMLLCW','CgvYzM9YBuHLyxj0yMvHDa','Ahr0Chm6','C3rYAw5NAwz5','C3bSAxq','BwfPBG','D3jPDgvfCNjVCG','zgvZDhjVEq','y3j5ChrV','BgLZDenOyw5Nzwq','yMfJA2vUza','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGsw52ywXPzcbTyw5PzMvZDcbMB3jTyxqUiev4AxrPBMCU','lIbszw5LDYbHDcbODhrWCZOVl2fUAgrOlMLVl3jLBMv3lIbfEgL0Aw5NlG','CMvXDwvZDa','mZy5mZe4BvHyCuXJ','ANnVBNjWyW','odK5mJKYshrUyvnp','mJu4nZKYq0zmDMXZ','Bwv0Ag9K','C3rKB3v0','zgLYBMfTzq','zxHPDa','zgv2AwnLswq','ywrKrxzLBNrmAxn0zw5LCG','lMfUAgrO','w01ducbbz2vUDf0GsgvHCNrIzwf0ignOzwnRigzHAwXLzcbVCIb0Aw1LzcbVDxq6','C2LNBMf0DxjL','ChvIBgLJs2v5','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGDMvYAwzPy2f0Aw9UigzHAwXLzdOG','q29UDgvUDc1mzw5NDgG','zxHPC3rZu3LUyW','tgLJzw5ZzsbLEhbPCMvK','w01ducbbz2vUDf0GugvYAw9KAwmGAgvHCNrIzwf0igvYCM9YoG','AgfUzgXLq2XPzw50twvZC2fNzq','lIbdB250ywn0ihn1ChbVCNqGyxqGC3vWCg9YDebHBMHKAc5PBY4GrxHPDgLUzY4','zxHWB3j0CW','zgLZCgXHEu5HBwu','C3rKAw4','Ahr0Ca','DMfSDwvZ','CMvHC29U','w01ducbbz2vUDf0GsgvHCNrIzwf0ihjLzNjLC2GGzMfPBgvKoIbtzxj2zxiGCMv0DxjUzwqG','zgf0yq','BwTKAxjtEw5J','Agv4','ms4WlJa','Dw5RBM93BG','tw96AwXSys81lJaGkgnVBxbHDgLIBgu7ie5VzguV','CMvHzezPBgvtEw5J','uhjVEhLtzxj2zxi','C2vYDMvYsw5MBW','zMLSzxm','ChjVDg9JB2W','DMvYAwz5','DxnLCG','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGAgfZigjLzw4GCMv2B2TLzc4GrxHPDgLUzY4','Cg9W','Aw5PDgLHBgL6zq','mI4W','w01ducbbz2vUDf0GDg9VBhmVBgLZDcbYzxf1zxn0igzHAwXLzcbMB3iGC2vYDMLJzsa','Ahr0Chm','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOG','BwfW','igLZig5VDcbYDw5UAw5N','lI4VBgLJzw5Zzs92zxjPzNKUANm','DxrMoa','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGzxHWAxjLzcbVCIbPBNzHBgLKlIbfEgL0Aw5NlG','zxjYB3i','vgHLig9WzxjHDgLVBIb3yxmGywjVCNrLzc4','C3rHDhvZ','w01ducbbz2vUDf0GrMfPBgvKihrVihnHDMuGCMvMCMvZAgvKigXPy2vUC2uGDg9Rzw4GDg8GzgLZAZO','C3rVCa','w01ducbbz2vUDf0GtgLJzw5ZzsbLEhbPCMvKig9Uia','Ahr0Chm6lY9Hz2vUDgTPDc5HBhbOyxrLy2HZlMfPl2fWAq','y2f0y2G','zw5K','Cg9YDa','mtq4mZuWnfrqr3L5qG','w01ducbbz2vUDf0GsgvHCNrIzwf0oIbmAwnLBNnLihrVA2vUihn1y2nLC3nMDwXSEsbYzwzYzxnOzwqU','zgLZDa','mZvNwej5B3K','yM9KEq','C2vHCMnO','D3jPDgvuB0nSAwvUDa','Cgf0Ag5HBwu'];_0x230d=function(){return _0x171141;};return _0x230d();}class ProxyServer{constructor(_0x4b6d74={}){const _0x81c949=_0x5b2fd0;this[_0x81c949(0x16c)]=_0x4b6d74['projectPath']||process[_0x81c949(0x16d)](),this[_0x81c949(0xeb)]=_0x4b6d74['licenseKey']||this[_0x81c949(0xda)](),this['deviceId']=_0x4b6d74[_0x81c949(0x12d)],this[_0x81c949(0x132)]=_0x4b6d74[_0x81c949(0x132)]||_0x4b6d74[_0x81c949(0xde)],this['backends']=null,this['clientBuffer']='',this[_0x81c949(0xfc)]=![],this[_0x81c949(0x12a)]=_0x4b6d74[_0x81c949(0x12a)]||process['stdout'],this['integrityManifestPath']=_0x4b6d74['integrityManifestPath']||path[_0x81c949(0xd3)](__dirname,_0x81c949(0x111),'integrity-manifest.json');}[_0x5b2fd0(0xda)](){const _0x196ec0=_0x5b2fd0,_0x407eb5=path[_0x196ec0(0xd3)](os[_0x196ec0(0xe6)](),_0x196ec0(0x12f),_0x196ec0(0xd5));if(fs[_0x196ec0(0x135)](_0x407eb5))return fs[_0x196ec0(0x147)](_0x407eb5,_0x196ec0(0x158))[_0x196ec0(0x107)]();return null;}async[_0x5b2fd0(0x118)](){const _0x242a34=_0x5b2fd0,_0x120af2=process.env.MCP_SKIP_LICENSE_CHECK==='1';if(_0x120af2||!this[_0x242a34(0xeb)])return;const _0x57b497=this[_0x242a34(0xeb)]['split']('.');if(_0x57b497[_0x242a34(0xe0)]!==0x3)return;let _0x110b1f;try{_0x110b1f=JSON[_0x242a34(0xfa)](Buffer[_0x242a34(0x105)](_0x57b497[0x1],_0x242a34(0xfd))[_0x242a34(0x172)]('utf8'));}catch(_0x3cc256){return;}if(!_0x110b1f||!_0x110b1f['exp'])return;const _0x4f3fc1=0x6*0x18*0xe10*0x3e8,_0x485797=_0x110b1f[_0x242a34(0xdd)]-Date['now']();if(_0x485797<_0x4f3fc1){console[_0x242a34(0x15a)](_0x242a34(0xff));const _0xa237ce=process.env.MCP_ACTIVATION_URL||_0x242a34(0x160),_0x5454d6=_0xa237ce+_0x242a34(0x10b),_0x105c22=new AbortController(),_0x3914f4=setTimeout(()=>_0x105c22[_0x242a34(0xe1)](),0x1388);try{const _0x47349b={};_0x47349b[_0x242a34(0xf2)]=_0x242a34(0x116);const _0x59363b={};_0x59363b[_0x242a34(0x10a)]=this['licenseKey'];const _0x2e52e1=await httpRequest(_0x5454d6,{'method':'POST','headers':_0x47349b,'body':JSON[_0x242a34(0x11a)](_0x59363b),'signal':_0x105c22[_0x242a34(0xf8)]});clearTimeout(_0x3914f4);if(_0x2e52e1[_0x242a34(0x15c)]===0x193){console[_0x242a34(0x15a)](_0x242a34(0x14e)),process['exit'](0x1);return;}if(_0x2e52e1['status']===0x191){console[_0x242a34(0x15a)](_0x242a34(0x159)),process['exit'](0x1);return;}if(!_0x2e52e1['ok']){console[_0x242a34(0x15a)](_0x242a34(0x140)+_0x2e52e1[_0x242a34(0x15c)]+_0x242a34(0x108));return;}const _0x5dd61d=await _0x2e52e1['json']();if(_0x5dd61d&&_0x5dd61d['token']){this[_0x242a34(0xeb)]=_0x5dd61d[_0x242a34(0x10a)];const _0x2d6117=path['join'](os[_0x242a34(0xe6)](),_0x242a34(0x12f),'license.key');try{const _0x2ae96f={};_0x2ae96f[_0x242a34(0xf0)]=!![],fs[_0x242a34(0x142)](path['dirname'](_0x2d6117),_0x2ae96f),fs['writeFileSync'](_0x2d6117,_0x5dd61d[_0x242a34(0x10a)],_0x242a34(0x158)),console[_0x242a34(0x15a)](_0x242a34(0x165));}catch(_0x34dee5){console[_0x242a34(0x15a)](_0x242a34(0x15d),_0x34dee5[_0x242a34(0xf3)]);}}}catch(_0x1c52ca){clearTimeout(_0x3914f4),console[_0x242a34(0x15a)](_0x242a34(0x130),_0x1c52ca[_0x242a34(0xf3)],'.\x20Continuing\x20with\x20cached\x20token.');}}}async[_0x5b2fd0(0xea)](){const _0xe19f96=_0x5b2fd0;console['error'](_0xe19f96(0xf7)+this[_0xe19f96(0x16c)]);if(!this[_0xe19f96(0x132)]){if(process.env.MCP_ADMIN_DIR){const _0x5bee5b=path['join'](process.env.MCP_ADMIN_DIR,_0xe19f96(0xd2));fs[_0xe19f96(0x135)](_0x5bee5b)&&(this[_0xe19f96(0x132)]=fs['readFileSync'](_0x5bee5b,_0xe19f96(0x158))[_0xe19f96(0x107)]());}if(!this[_0xe19f96(0x132)]){let _0xe0b2e8=__dirname;while(_0xe0b2e8){const _0x54289e=path[_0xe19f96(0xd3)](_0xe0b2e8,'admin','master.public.pem');if(fs[_0xe19f96(0x135)](_0x54289e)){this[_0xe19f96(0x132)]=fs[_0xe19f96(0x147)](_0x54289e,_0xe19f96(0x158))['trim']();break;}const _0x36262b=path[_0xe19f96(0x12b)](_0xe0b2e8);if(_0x36262b===_0xe0b2e8)break;_0xe0b2e8=_0x36262b;}}}const _0x3d3394=this['integrityManifestPath'],_0x57b1ac=!__dirname[_0xe19f96(0xfe)](/\\/g,'/')[_0xe19f96(0x11b)]('/')['includes'](_0xe19f96(0x166)),_0x4f1c46=process.env.MCP_SKIP_INTEGRITY_CHECK==='1'||_0x57b1ac&&!fs[_0xe19f96(0x135)](_0x3d3394);if(!_0x4f1c46){const _0x30ae3d=require(_0xe19f96(0x11f));if(!fs[_0xe19f96(0x135)](_0x3d3394)){console[_0xe19f96(0x15a)](_0xe19f96(0x16e)),process[_0xe19f96(0x12c)](0x1);return;}let _0x1f1431;try{_0x1f1431=JSON[_0xe19f96(0xfa)](fs[_0xe19f96(0x147)](_0x3d3394,'utf8'));}catch(_0x55f7bf){console[_0xe19f96(0x15a)](_0xe19f96(0xe3)),process['exit'](0x1);return;}if(!_0x1f1431[_0xe19f96(0x14a)]||!_0x1f1431[_0xe19f96(0x131)]){console[_0xe19f96(0x15a)](_0xe19f96(0x122)),process[_0xe19f96(0x12c)](0x1);return;}const _0xe4e54a=this[_0xe19f96(0x132)]||require(_0xe19f96(0x157))['PRODUCTION_PUBLIC_KEY'];try{const _0x1db079=JSON[_0xe19f96(0x11a)](_0x1f1431[_0xe19f96(0x14a)]),_0x2b4c60=Buffer[_0xe19f96(0x105)](_0x1f1431[_0xe19f96(0x131)],_0xe19f96(0xfd)),_0x222a35=_0x30ae3d[_0xe19f96(0x14c)](null,Buffer[_0xe19f96(0x105)](_0x1db079),_0xe4e54a,_0x2b4c60);if(!_0x222a35){console[_0xe19f96(0x15a)]('[MCP\x20Agent]\x20Integrity\x20check\x20failed:\x20Invalid\x20signature.\x20Exiting.'),process[_0xe19f96(0x12c)](0x1);return;}}catch(_0xcee97){console[_0xe19f96(0x15a)](_0xe19f96(0xed)),process[_0xe19f96(0x12c)](0x1);return;}const _0x17aae3=path[_0xe19f96(0xd3)](__dirname,_0xe19f96(0x111));for(const [_0x4096fd,_0x380510]of Object[_0xe19f96(0x117)](_0x1f1431['files'])){const _0x34f5ee=path['join'](_0x17aae3,_0x4096fd);if(!fs['existsSync'](_0x34f5ee)){console['error'](_0xe19f96(0x154)+_0x4096fd+_0xe19f96(0x104)),process[_0xe19f96(0x12c)](0x1);return;}try{const _0x2d2fb3=fs['readFileSync'](_0x34f5ee),_0x2598ee=_0x30ae3d[_0xe19f96(0x112)](_0xe19f96(0xd1))[_0xe19f96(0xe4)](_0x2d2fb3)[_0xe19f96(0x16f)](_0xe19f96(0x143));if(_0x2598ee!==_0x380510){console[_0xe19f96(0x15a)](_0xe19f96(0x154)+_0x4096fd+'\x20modified.\x20Exiting.'),process[_0xe19f96(0x12c)](0x1);return;}}catch(_0x295610){console[_0xe19f96(0x15a)](_0xe19f96(0x154)+_0x4096fd+_0xe19f96(0x104)),process[_0xe19f96(0x12c)](0x1);return;}}}const _0x4ce6d3=process.env.MCP_SKIP_LICENSE_CHECK==='1';if(!_0x4ce6d3){if(!this[_0xe19f96(0x12d)]){const {getFingerprint:_0x2f6cec}=require(_0xe19f96(0xe2));this[_0xe19f96(0x12d)]=_0x2f6cec();}const _0x5d74ac=verifyLicense(this[_0xe19f96(0xeb)],this['deviceId'],this['publicKey']);if(!_0x5d74ac['valid']){if(_0x5d74ac['reason']===_0xe19f96(0x136)){const _0x44d3b5=_0x5d74ac['payload']||{},_0x63b266=_0x44d3b5[_0xe19f96(0xdd)]?new Date(_0x44d3b5[_0xe19f96(0xdd)])[_0xe19f96(0x10f)]()[_0xe19f96(0x11b)]('T')[0x0]:_0xe19f96(0x145);console['error'](_0xe19f96(0x15f)+_0x63b266+_0xe19f96(0x123));}else console[_0xe19f96(0x15a)](_0xe19f96(0x133)+_0x5d74ac[_0xe19f96(0x13f)]+_0xe19f96(0x139));process['exit'](0x1);return;}console['error'](_0xe19f96(0x10e)+_0x5d74ac[_0xe19f96(0xf1)][_0xe19f96(0x14d)]),await this[_0xe19f96(0x118)](),this[_0xe19f96(0xd6)]=setInterval(()=>{const _0x4b1f14=_0xe19f96;this[_0x4b1f14(0x118)]()['catch'](_0xf5110f=>{const _0x534bb2=_0x4b1f14;console[_0x534bb2(0x15a)](_0x534bb2(0x137),_0xf5110f[_0x534bb2(0xf3)]);});},0x18*0x3c*0x3c*0x3e8);}this[_0xe19f96(0x106)]=spawnBackends(this[_0xe19f96(0x16c)]),this[_0xe19f96(0xfc)]=!![];for(const _0x448cfe of Object[_0xe19f96(0x13e)](this[_0xe19f96(0x106)])){_0x448cfe[_0xe19f96(0xea)]();}this[_0xe19f96(0xd7)]=_0x1ffc73=>{const _0xa6ac9a=_0xe19f96;this[_0xa6ac9a(0xf6)](_0x1ffc73[_0xa6ac9a(0x172)]());},process[_0xe19f96(0x13c)]['on'](_0xe19f96(0x141),this[_0xe19f96(0xd7)]);}['handleClientData'](_0x5b27e8){const _0x1107b9=_0x5b2fd0;this[_0x1107b9(0xe7)]+=_0x5b27e8;const _0x3e29ab=this[_0x1107b9(0xe7)][_0x1107b9(0x11b)]('\x0a');this[_0x1107b9(0xe7)]=_0x3e29ab[_0x1107b9(0x14f)]();for(const _0x219f8e of _0x3e29ab){const _0x242b5f=_0x219f8e[_0x1107b9(0x107)]();if(!_0x242b5f)continue;try{const _0x3c3e41=JSON[_0x1107b9(0xfa)](_0x242b5f);this[_0x1107b9(0x138)](_0x3c3e41);}catch(_0x5c2d0a){console[_0x1107b9(0x15a)](_0x1107b9(0xdf),_0x219f8e,_0x5c2d0a[_0x1107b9(0xf3)]);}}}async['handleClientMessage'](_0x399b2b){const _0x2b08e0=_0x5b2fd0,{id:_0x3fd229,method:_0x293008,params:_0x199453}=_0x399b2b;if(!_0x293008)return;if(_0x293008===_0x2b08e0(0x150)){Promise[_0x2b08e0(0x170)](Object['values'](this[_0x2b08e0(0x106)])[_0x2b08e0(0x155)](_0x35d93a=>_0x35d93a[_0x2b08e0(0x109)](_0x2b08e0(0x150),_0x199453)[_0x2b08e0(0x161)](_0x787471=>{const _0x59ac56=_0x2b08e0;console[_0x59ac56(0x15a)](_0x59ac56(0xf9)+(_0x35d93a[_0x59ac56(0x13b)]||_0x35d93a[_0x59ac56(0xe8)])+':',_0x787471['message']);})));const _0x148cdd={};_0x148cdd[_0x2b08e0(0x120)]=![];const _0x254ec8={};_0x254ec8[_0x2b08e0(0x102)]=_0x148cdd;const _0x66311b={};_0x66311b[_0x2b08e0(0xe8)]='mcp-agent-proxy',_0x66311b[_0x2b08e0(0xec)]=_0x2b08e0(0x144);const _0x45ee63={};_0x45ee63[_0x2b08e0(0x100)]=_0x199453[_0x2b08e0(0x100)]||'2024-11-05',_0x45ee63[_0x2b08e0(0xef)]=_0x254ec8,_0x45ee63[_0x2b08e0(0x149)]=_0x66311b;const _0x13aaa3={};_0x13aaa3[_0x2b08e0(0x126)]='2.0',_0x13aaa3['id']=_0x3fd229,_0x13aaa3[_0x2b08e0(0x171)]=_0x45ee63;const _0x3ffaf7=_0x13aaa3;this[_0x2b08e0(0x16a)](_0x3ffaf7);return;}if(_0x293008===_0x2b08e0(0x10c)){try{const _0x407185=Object['entries'](this[_0x2b08e0(0x106)])['map'](async([_0x2f8c96,_0x484340])=>{const _0x544fe3=_0x2b08e0;try{const _0x11019a=await _0x484340[_0x544fe3(0x109)]('tools/list'),_0x46fec5=_0x11019a&&_0x11019a['result']&&_0x11019a['result'][_0x544fe3(0x102)]||[];return translateToolList(_0x46fec5,_0x2f8c96);}catch(_0x3df6eb){return console[_0x544fe3(0x15a)](_0x544fe3(0x152)+_0x2f8c96+':',_0x3df6eb[_0x544fe3(0xf3)]),[];}}),_0x383d01=await Promise[_0x2b08e0(0x170)](_0x407185),_0x36ac7c=_0x383d01[_0x2b08e0(0x101)](),_0x55a8ea={};_0x55a8ea[_0x2b08e0(0x102)]=_0x36ac7c;const _0x5a8590={};_0x5a8590['jsonrpc']=_0x2b08e0(0x151),_0x5a8590['id']=_0x3fd229,_0x5a8590[_0x2b08e0(0x171)]=_0x55a8ea;const _0x3c3bce=_0x5a8590;this[_0x2b08e0(0x16a)](_0x3c3bce);}catch(_0x5e8d2f){this[_0x2b08e0(0x11d)](_0x3fd229,-0x7f5b,_0x2b08e0(0x113)+_0x5e8d2f[_0x2b08e0(0xf3)]);}return;}if(_0x293008===_0x2b08e0(0x10d)){const _0x1ecc8f=_0x199453[_0x2b08e0(0xe8)],_0x101c86=mapExposedToOriginal(_0x1ecc8f);if(!_0x101c86)return this[_0x2b08e0(0x11d)](_0x3fd229,-0x7f59,_0x2b08e0(0x114)+_0x1ecc8f);try{const _0x4d4e82=this[_0x2b08e0(0x106)][_0x101c86[_0x2b08e0(0x121)]];if(!_0x4d4e82)return this[_0x2b08e0(0x11d)](_0x3fd229,-0x7f5b,'Target\x20backend\x20'+_0x101c86[_0x2b08e0(0x121)]+_0x2b08e0(0x156));const _0x510014={..._0x199453};_0x510014[_0x2b08e0(0xe8)]=_0x101c86[_0x2b08e0(0xe9)];const _0x30512c={..._0x399b2b};_0x30512c['params']=_0x510014;const _0x6c8e57=_0x30512c,_0x148a07=await _0x4d4e82['forwardRequest'](_0x6c8e57);this['writeToClient'](_0x148a07);}catch(_0x57b371){this[_0x2b08e0(0x11d)](_0x3fd229,-0x7f5b,'Tool\x20execution\x20failed:\x20'+_0x57b371[_0x2b08e0(0xf3)]);}return;}for(const _0x48a605 of Object[_0x2b08e0(0x13e)](this[_0x2b08e0(0x106)])){_0x48a605[_0x2b08e0(0xdb)]&&_0x48a605[_0x2b08e0(0xdb)][_0x2b08e0(0x13c)][_0x2b08e0(0x103)](JSON[_0x2b08e0(0x11a)](_0x399b2b)+'\x0a');}}[_0x5b2fd0(0x16a)](_0x5e73f7){const _0xaccf50=_0x5b2fd0;this[_0xaccf50(0x12a)][_0xaccf50(0x103)](JSON[_0xaccf50(0x11a)](_0x5e73f7)+'\x0a');}[_0x5b2fd0(0x11d)](_0x5bdbbc,_0x394dc1,_0x51aeba){const _0x2a041a=_0x5b2fd0,_0xc04409={};_0xc04409[_0x2a041a(0x110)]=_0x394dc1,_0xc04409[_0x2a041a(0xf3)]=_0x51aeba;const _0x229789={};_0x229789[_0x2a041a(0x126)]='2.0',_0x229789['id']=_0x5bdbbc,_0x229789[_0x2a041a(0x15a)]=_0xc04409;const _0x7621c3=_0x229789;this[_0x2a041a(0x16a)](_0x7621c3);}[_0x5b2fd0(0x15e)](){const _0x139fe9=_0x5b2fd0;this[_0x139fe9(0xfc)]=![];this[_0x139fe9(0xd6)]&&(clearInterval(this[_0x139fe9(0xd6)]),this[_0x139fe9(0xd6)]=null);this[_0x139fe9(0xd7)]&&(process[_0x139fe9(0x13c)]['removeListener'](_0x139fe9(0x141),this[_0x139fe9(0xd7)]),this['stdinListener']=null,process[_0x139fe9(0x13c)][_0x139fe9(0xe5)]());if(this[_0x139fe9(0x106)])for(const _0x310e13 of Object[_0x139fe9(0x13e)](this['backends'])){_0x310e13['stop']();}}}const _0x12165e={};_0x12165e[_0x5b2fd0(0x148)]=ProxyServer,module[_0x5b2fd0(0x13a)]=_0x12165e;if(require[_0x5b2fd0(0x11c)]===module){const server=new ProxyServer();server[_0x5b2fd0(0xea)]()[_0x5b2fd0(0x161)](_0x27d0af=>{const _0x41d0af=_0x5b2fd0;console['error'](_0x41d0af(0xfb),_0x27d0af[_0x41d0af(0xf3)]),process[_0x41d0af(0x12c)](0x1);});}
1
+ function _0xf681(_0x36cff4,_0x2609ce){_0x36cff4=_0x36cff4-0xad;const _0x396d5a=_0x396d();let _0xf6811d=_0x396d5a[_0x36cff4];if(_0xf681['qEVzOL']===undefined){var _0x2b16b8=function(_0x382862){const _0x294c31='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x42e42c='',_0x274181='';for(let _0x138efe=0x0,_0x4e50d1,_0x2cb8bb,_0x4f5fd2=0x0;_0x2cb8bb=_0x382862['charAt'](_0x4f5fd2++);~_0x2cb8bb&&(_0x4e50d1=_0x138efe%0x4?_0x4e50d1*0x40+_0x2cb8bb:_0x2cb8bb,_0x138efe++%0x4)?_0x42e42c+=String['fromCharCode'](0xff&_0x4e50d1>>(-0x2*_0x138efe&0x6)):0x0){_0x2cb8bb=_0x294c31['indexOf'](_0x2cb8bb);}for(let _0x41f018=0x0,_0x2c318e=_0x42e42c['length'];_0x41f018<_0x2c318e;_0x41f018++){_0x274181+='%'+('00'+_0x42e42c['charCodeAt'](_0x41f018)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x274181);};_0xf681['mEVyGU']=_0x2b16b8,_0xf681['nciFhM']={},_0xf681['qEVzOL']=!![];}const _0x5c464f=_0x396d5a[0x0],_0x455d7a=_0x36cff4+_0x5c464f,_0x2025f4=_0xf681['nciFhM'][_0x455d7a];return!_0x2025f4?(_0xf6811d=_0xf681['mEVyGU'](_0xf6811d),_0xf681['nciFhM'][_0x455d7a]=_0xf6811d):_0xf6811d=_0x2025f4,_0xf6811d;}const _0x5ebdeb=_0xf681;(function(_0xd386ff,_0x441a24){const _0x5711d5=_0xf681,_0x209ff7=_0xd386ff();while(!![]){try{const _0x13e083=-parseInt(_0x5711d5(0x12e))/0x1+parseInt(_0x5711d5(0xf2))/0x2*(parseInt(_0x5711d5(0x116))/0x3)+parseInt(_0x5711d5(0xf3))/0x4*(parseInt(_0x5711d5(0x113))/0x5)+parseInt(_0x5711d5(0x149))/0x6+-parseInt(_0x5711d5(0xff))/0x7*(parseInt(_0x5711d5(0xd7))/0x8)+parseInt(_0x5711d5(0x14a))/0x9+parseInt(_0x5711d5(0xf0))/0xa*(-parseInt(_0x5711d5(0x102))/0xb);if(_0x13e083===_0x441a24)break;else _0x209ff7['push'](_0x209ff7['shift']());}catch(_0x5459b7){_0x209ff7['push'](_0x209ff7['shift']());}}}(_0x396d,0x91dad));const fs=require('fs'),path=require(_0x5ebdeb(0x123)),os=require('os'),http=require(_0x5ebdeb(0x10d)),https=require(_0x5ebdeb(0xe2)),{verifyLicense}=require(_0x5ebdeb(0xdd)),{spawnBackends}=require(_0x5ebdeb(0xd3)),{translateToolList,mapExposedToOriginal}=require(_0x5ebdeb(0xeb));function httpRequest(_0x382124,_0x521584={}){return new Promise((_0x3f158a,_0x584c11)=>{const _0x259e1a=_0xf681;try{const _0x157da9=new URL(_0x382124),_0xb21fc4=_0x157da9['protocol']==='https:'?https:http,_0x59cfd0={'User-Agent':'Mozilla/5.0\x20(compatible;\x20Node/'+process[_0x259e1a(0x11c)]+')',..._0x521584[_0x259e1a(0xd6)]},_0x275417=_0x59cfd0;if(_0x521584['body']){const _0x393a9d=typeof _0x521584['body']===_0x259e1a(0xce)?_0x521584['body']:JSON[_0x259e1a(0x100)](_0x521584[_0x259e1a(0xc5)]);!_0x275417['Content-Length']&&!_0x275417[_0x259e1a(0x142)]&&(_0x275417['Content-Length']=Buffer[_0x259e1a(0xbb)](_0x393a9d));}const _0x4babca={};_0x4babca[_0x259e1a(0xf4)]=_0x521584[_0x259e1a(0xf4)]||'GET',_0x4babca[_0x259e1a(0xb6)]=_0x157da9['hostname'],_0x4babca[_0x259e1a(0xb9)]=_0x157da9[_0x259e1a(0xb9)]||(_0x157da9[_0x259e1a(0xef)]===_0x259e1a(0x12a)?0x1bb:0x50),_0x4babca[_0x259e1a(0x123)]=_0x157da9[_0x259e1a(0x14c)]+_0x157da9[_0x259e1a(0x127)],_0x4babca[_0x259e1a(0xd6)]=_0x275417;const _0x49dfd4=_0x4babca,_0x590e7e=_0xb21fc4[_0x259e1a(0x121)](_0x49dfd4,_0x58597b=>{const _0xc2c588=_0x259e1a;let _0x4e212f='';_0x58597b['on']('data',_0x2a1166=>{_0x4e212f+=_0x2a1166;}),_0x58597b['on'](_0xc2c588(0xe5),()=>{const _0x1ce5ce=_0xc2c588;_0x3f158a({'ok':_0x58597b['statusCode']>=0xc8&&_0x58597b[_0x1ce5ce(0x145)]<0x12c,'status':_0x58597b[_0x1ce5ce(0x145)],'json':async()=>JSON[_0x1ce5ce(0xe3)](_0x4e212f),'text':async()=>_0x4e212f});});});_0x590e7e['on'](_0x259e1a(0xd5),_0x36132e=>{_0x584c11(_0x36132e);}),_0x521584[_0x259e1a(0x12d)]&&(_0x521584['signal'][_0x259e1a(0x128)]?_0x590e7e[_0x259e1a(0xf6)](new Error('The\x20operation\x20was\x20aborted.')):_0x521584[_0x259e1a(0x12d)]['addEventListener'](_0x259e1a(0x138),()=>{const _0xf03335=_0x259e1a;_0x590e7e[_0xf03335(0xf6)](new Error(_0xf03335(0x14d)));})),_0x521584[_0x259e1a(0xc5)]&&_0x590e7e['write'](_0x521584[_0x259e1a(0xc5)]),_0x590e7e['end']();}catch(_0x16493b){_0x584c11(_0x16493b);}});}function _0x396d(){const _0x4f6360=['ufjprfvdveLptL9qvujmsunFs0vz','lI9IywnRzw5KCY5QCW','C3rVCa','zxjYB3i','AgvHzgvYCW','mZeXmtG0tfrnuurm','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOG','zgLYBMfTzq','lIbszw5LDYbHDcbODhrWCZOVl2fUAgrOlMLVl3jLBMv3lIbfEgL0Aw5NlG','BgvUz3rO','q29UDgvUDc1uExbL','lI4VBgLJzw5Zzs92zxjPzNKUANm','w01ducbbz2vUDf0GsgvHCNrIzwf0ignOzwnRoIb0B2TLBIbOyxmGBgvZCYb0AgfUidyGzgf5CYbYzw1HAw5PBMCUifjLzNjLC2HPBMCUlI4','C3rHCNq','Agv4','Aw5JBhvKzxm','Ahr0Chm','CgfYC2u','w01ducbbz2vUDf0GugvYAw9KAwmGAgvHCNrIzwf0igvYCM9YoG','zw5K','zxHPC3rZu3LUyW','lIbdB250Aw51Aw5NihDPDgGGy2fJAgvKihrVA2vUlG','BwfW','y3jLyxrLsgfZAa','w01ducbbz2vUDf0GsgvHCNrIzwf0oIbmAwnLBNnLihrVA2vUihn1y2nLC3nMDwXSEsbYzwzYzxnOzwqU','lI9YB3v0zxiUANm','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGrMfPBgvKihrVihbHCNnLigLUDgvNCML0Es1Tyw5PzMvZDc5QC29UlIbfEgL0Aw5NlG','vg9VBcbUB3qGzM91BMq6ia','yMfZzty0DxjS','ChjVDg9JB2W','ntmZntKWCLDTsuvX','BwfZDgvYlNb1yMXPyY5Wzw0','mLbiuwHttq','mte1ndi0zgnzt3rh','Bwv0Ag9K','zNjVBq','zgvZDhjVEq','BgLJzw5ZzuTLEq','zMLSzxm','zgv2AwnLswq','vg9VBcbLEgvJDxrPB24GzMfPBgvKoIa','zxHWB3j0CW','CMvHzezPBgvtEw5J','Cgf5Bg9Hza','C3bSAxq','mtyXsuTwywHX','C3rYAw5NAwz5','zxHPDa','mtK4wxfKAhDl','ue9tva','DxrMoa','w01ducbbz2vUDf0GrMfPBgvKihrVihbHCNnLiePtt04TuLbdig1LC3nHz2uGzNjVBsbJBgLLBNq6','CgvYzM9YBuHLyxj0yMvHDa','ANnVBG','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGDMvYAwzPy2f0Aw9UigzHAwXLzdOG','C2vUzfjLCxvLC3q','DhjPBq','CMvZDwX0','C3rKAw4','Ahr0Ca','ChjVAMvJDfbHDgG','y2HPBgq','Ag9TzwrPCG','BgLJzw5Zzs5RzxK','BwfZDgvYu2vJCMv0','mJaWzfzMCNze','zM9YD2fYzfjLCxvLC3q','Dg9VBhmVy2fSBa','nJK3odC4D1vesuzH','ChjVDg9JB2XwzxjZAw9U','AgfUzgXLq2XPzw50twvZC2fNzq','AgvHCNrIzwf0sw50zxj2ywW','Dg9Rzw4','CMvTB3zLtgLZDgvUzxi','DMvYC2LVBG','CMvWBgfJzq','AgfUzgXLq2XPzw50rgf0yq','ChvIBgLJs2v5','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGu2LNBMf0DxjLihzLCMLMAwnHDgLVBIbMywLSzwqUiev4AxrPBMCU','CMvXDwvZDa','y2XPzw50qNvMzMvY','Cgf0Aa','zgf0yq','lIbdB250ywn0ihn1ChbVCNqGyxqGC3vWCg9YDebHBMHKAc5PBY4GrxHPDgLUzY4','DMvYAwz5','C2vHCMnO','ywjVCNrLza','C3rKAw5mAxn0zw5LCG','Ahr0Chm6','ms4WlJa','lMfUAgrO','C2LNBMfS','nJeWotyZB3LPyvnY','w01ducbbz2vUDf0Gu3rHCNrPBMCGC2vYDMvYigf0ia','Bg9HzeXPy2vUC2vlzxK','y3DK','BwnWlwfNzw50lxbYB3H5','uhjVEhLtzxj2zxi','DxnLCG','mJaYnc0Xms0Wnq','ywXS','C3rHDhvZ','ywjVCNq','Dw5RBM93BG','DMfSDwvZ','w01ducbbz2vUDf0GsgvHCNrIzwf0ignOzwnRigzHAwXLzcbVCIb0Aw1LzcbVDxq6','C3rKB3v0','ANnVBNjWyW','Aw5PDgLHBgL6zq','yMfJA2vUzhm','D3jPDgu','BwvZC2fNzq','y29UDgvUDc1Szw5NDgG','igLZig5VDcbYDw5UAw5N','y2fWywjPBgL0AwvZ','C3rHDhvZq29Kzq','l2HLyxj0yMvHDa','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGzxHWAxjLzcbVCIbPBNzHBgLKlIbfEgL0Aw5NlG','D3jPDgvuB0nSAwvUDa','nJa0ntC1mePOz3HTva','nJaYmta4mvbkvKr1AW','zgLZDa','Cgf0Ag5HBwu','vgHLig9WzxjHDgLVBIb3yxmGywjVCNrLzc4','rMfPBgvKihrVihn0yxj0ifbYB3H5u2vYDMvYoG','D3jPDgvfCNjVCG','ig1VzgLMAwvKlIbfEgL0Aw5NlG','CMvHC29U','w01ducbbz2vUDf0GsgvHCNrIzwf0ihjLzNjLC2GGzMfPBgvKoIbtzxj2zxiGCMv0DxjUzwqG','w01ducbbz2vUDf0GtgLJzw5ZzsbLEhbPCMvKig9Uia','rMfPBgvKihrVihf1zxj5ihrVB2WGBgLZDdOG','BMfTzq','C2LNBMf0DxjL','vgfYz2v0igjHy2TLBMqG','Ag9ZDg5HBwu','zw50CMLLCW','tgLJzw5ZzsbLEhbPCMvK','Cg9YDa','CgfYyw1Z','yNL0zuXLBMD0Aa','C2vYDMvYsw5MBW','y2f0y2G','DMfSAwq','zxHW','Dg9VBhm','mI4W','CNvUBMLUzW','lI4VlI4','y3j5ChrV','yM9KEq','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGsw52ywXPzcbZAwDUyxr1CMuUiev4AxrPBMCU','yMfJA2vUza','Cgf1C2u','Dg9VBhmVBgLZDa','w01ducbbz2vUDf0GrMfPBgvKihrVigLUAxrPywXPEMuGC2vYDMLJzsa','BgLZDenOyw5Nzwq','Aw50zwDYAxr5twfUAwzLC3rqyxrO','AM9PBG','C3rYAw5N','zgLNzxn0','Dg9tDhjPBMC','lI4VBgLJzw5Zzs9MAw5NzxjWCMLUDc5QCW'];_0x396d=function(){return _0x4f6360;};return _0x396d();}class ProxyServer{constructor(_0x4f2742={}){const _0x345bde=_0x5ebdeb;this[_0x345bde(0x10e)]=_0x4f2742[_0x345bde(0x10e)]||process[_0x345bde(0x131)](),this[_0x345bde(0xf7)]=_0x4f2742['licenseKey']||this[_0x345bde(0x130)](),this['deviceId']=_0x4f2742[_0x345bde(0xf9)],this[_0x345bde(0x11f)]=_0x4f2742[_0x345bde(0x11f)]||_0x4f2742[_0x345bde(0x112)],this[_0x345bde(0x13f)]=null,this[_0x345bde(0x122)]='',this[_0x345bde(0xc2)]=![],this[_0x345bde(0x13c)]=_0x4f2742[_0x345bde(0x13c)]||process[_0x345bde(0x13c)],this['integrityManifestPath']=_0x4f2742[_0x345bde(0xcc)]||path[_0x345bde(0xcd)](__dirname,'../..','integrity-manifest.json');}['loadLicenseKey'](){const _0x57b959=_0x5ebdeb,_0x458ee8=path[_0x57b959(0xcd)](os[_0x57b959(0x110)](),_0x57b959(0x12c),_0x57b959(0x111));if(fs[_0x57b959(0xe6)](_0x458ee8))return fs[_0x57b959(0xfc)](_0x458ee8,_0x57b959(0x104))['trim']();return null;}async['performHeartbeat'](){const _0x29d903=_0x5ebdeb,_0x518c5f=process.env.MCP_SKIP_LICENSE_CHECK==='1';if(_0x518c5f||!this['licenseKey'])return;const _0x950d3c=this[_0x29d903(0xf7)]['split']('.');if(_0x950d3c[_0x29d903(0xdb)]!==0x3)return;let _0x5f246f;try{_0x5f246f=JSON[_0x29d903(0xe3)](Buffer[_0x29d903(0xf5)](_0x950d3c[0x1],_0x29d903(0xee))[_0x29d903(0xd0)](_0x29d903(0x104)));}catch(_0xa5b33){return;}if(!_0x5f246f||!_0x5f246f[_0x29d903(0xbf)])return;const _0x29cca5=0x6*0x18*0xe10*0x3e8,_0x358af1=_0x5f246f[_0x29d903(0xbf)]-Date['now']();if(_0x358af1<_0x29cca5){console[_0x29d903(0xd5)](_0x29d903(0xde));const _0x3447ef=process.env.MCP_ACTIVATION_URL||'https://agentkit.alphatechs.ai/api',_0x1d0a7f=_0x3447ef+_0x29d903(0x146),_0x5ea7bc=new AbortController(),_0x1ce0e2=setTimeout(()=>_0x5ea7bc[_0x29d903(0x138)](),0x1388);try{const _0x498d9c={};_0x498d9c[_0x29d903(0xdc)]='application/json';const _0x535306={};_0x535306['token']=this[_0x29d903(0xf7)];const _0x4bad54=await httpRequest(_0x1d0a7f,{'method':_0x29d903(0x103),'headers':_0x498d9c,'body':JSON[_0x29d903(0x100)](_0x535306),'signal':_0x5ea7bc[_0x29d903(0x12d)]});clearTimeout(_0x1ce0e2);if(_0x4bad54[_0x29d903(0x137)]===0x193){console[_0x29d903(0xd5)]('[MCP\x20Agent]\x20License\x20key\x20has\x20been\x20revoked.\x20Exiting.'),process[_0x29d903(0x101)](0x1);return;}if(_0x4bad54[_0x29d903(0x137)]===0x191){console['error'](_0x29d903(0x147)),process[_0x29d903(0x101)](0x1);return;}if(!_0x4bad54['ok']){console['error'](_0x29d903(0xb0)+_0x4bad54[_0x29d903(0x137)]+_0x29d903(0xe7));return;}const _0x29a512=await _0x4bad54[_0x29d903(0x107)]();if(_0x29a512&&_0x29a512[_0x29d903(0x11a)]){this[_0x29d903(0xf7)]=_0x29a512[_0x29d903(0x11a)];const _0x5376eb=path[_0x29d903(0xcd)](os[_0x29d903(0x110)](),_0x29d903(0x12c),'license.key');try{const _0x46e66e={};_0x46e66e['recursive']=!![],fs['mkdirSync'](path[_0x29d903(0xd9)](_0x5376eb),_0x46e66e),fs['writeFileSync'](_0x5376eb,_0x29a512[_0x29d903(0x11a)],'utf8'),console[_0x29d903(0xd5)](_0x29d903(0xea));}catch(_0x522358){console[_0x29d903(0xd5)]('[MCP\x20Agent]\x20Failed\x20to\x20save\x20refreshed\x20license\x20token\x20to\x20disk:',_0x522358[_0x29d903(0x141)]);}}}catch(_0x1ebf48){clearTimeout(_0x1ce0e2),console[_0x29d903(0xd5)](_0x29d903(0x13b),_0x1ebf48['message'],_0x29d903(0xe7));}}}async[_0x5ebdeb(0xdf)](){const _0x19a4c2=_0x5ebdeb;console['error'](_0x19a4c2(0x12f)+this[_0x19a4c2(0x10e)]);if(!this[_0x19a4c2(0x11f)]){if(process.env.MCP_ADMIN_DIR){const _0x4a8c15=path[_0x19a4c2(0xcd)](process.env.MCP_ADMIN_DIR,_0x19a4c2(0xf1));fs[_0x19a4c2(0xe6)](_0x4a8c15)&&(this[_0x19a4c2(0x11f)]=fs['readFileSync'](_0x4a8c15,_0x19a4c2(0x104))['trim']());}if(!this['publicKey']){let _0x25d36c=__dirname;while(_0x25d36c){const _0x76e978=path[_0x19a4c2(0xcd)](_0x25d36c,'admin',_0x19a4c2(0xf1));if(fs[_0x19a4c2(0xe6)](_0x76e978)){this[_0x19a4c2(0x11f)]=fs[_0x19a4c2(0xfc)](_0x76e978,'utf8')[_0x19a4c2(0x10a)]();break;}const _0x1c5b1d=path['dirname'](_0x25d36c);if(_0x1c5b1d===_0x25d36c)break;_0x25d36c=_0x1c5b1d;}}}const _0x38c223=this[_0x19a4c2(0xcc)],_0x13e0fa=!__dirname[_0x19a4c2(0x11d)](/\\/g,'/')[_0x19a4c2(0xfe)]('/')[_0x19a4c2(0xe1)](_0x19a4c2(0x14b)),_0x253dba=process.env.MCP_SKIP_INTEGRITY_CHECK==='1'||_0x13e0fa&&!fs['existsSync'](_0x38c223);if(!_0x253dba){const _0x38376e=require(_0x19a4c2(0xc4));if(!fs[_0x19a4c2(0xe6)](_0x38c223)){console['error']('[MCP\x20Agent]\x20Integrity\x20check\x20failed:\x20integrity-manifest.json\x20missing.\x20Exiting.'),process[_0x19a4c2(0x101)](0x1);return;}let _0x5222ca;try{_0x5222ca=JSON[_0x19a4c2(0xe3)](fs[_0x19a4c2(0xfc)](_0x38c223,_0x19a4c2(0x104)));}catch(_0x349dfb){console[_0x19a4c2(0xd5)](_0x19a4c2(0xec)),process['exit'](0x1);return;}if(!_0x5222ca[_0x19a4c2(0xf8)]||!_0x5222ca[_0x19a4c2(0xb4)]){console[_0x19a4c2(0xd5)]('[MCP\x20Agent]\x20Integrity\x20check\x20failed:\x20Invalid\x20manifest\x20format.\x20Exiting.'),process[_0x19a4c2(0x101)](0x1);return;}const _0x428eaf=this[_0x19a4c2(0x11f)]||require(_0x19a4c2(0xdd))[_0x19a4c2(0xd2)];try{const _0x5c3f04=JSON['stringify'](_0x5222ca[_0x19a4c2(0xf8)]),_0x360bd3=Buffer[_0x19a4c2(0xf5)](_0x5222ca[_0x19a4c2(0xb4)],_0x19a4c2(0xee)),_0x4d8d84=_0x38376e[_0x19a4c2(0x126)](null,Buffer['from'](_0x5c3f04),_0x428eaf,_0x360bd3);if(!_0x4d8d84){console['error'](_0x19a4c2(0xc6)),process[_0x19a4c2(0x101)](0x1);return;}}catch(_0x483f46){console['error'](_0x19a4c2(0x120)),process['exit'](0x1);return;}const _0x562e59=path[_0x19a4c2(0xcd)](__dirname,_0x19a4c2(0xc3));for(const [_0x372003,_0x233c41]of Object[_0x19a4c2(0xb7)](_0x5222ca['files'])){const _0x1fe198=path[_0x19a4c2(0xcd)](_0x562e59,_0x372003);if(!fs[_0x19a4c2(0xe6)](_0x1fe198)){console['error'](_0x19a4c2(0xd8)+_0x372003+_0x19a4c2(0xae)),process[_0x19a4c2(0x101)](0x1);return;}try{const _0x19168f=fs[_0x19a4c2(0xfc)](_0x1fe198),_0xad31a8=_0x38376e[_0x19a4c2(0xe9)]('sha256')['update'](_0x19168f)[_0x19a4c2(0xcf)](_0x19a4c2(0xe0));if(_0xad31a8!==_0x233c41){console[_0x19a4c2(0xd5)](_0x19a4c2(0xd8)+_0x372003+_0x19a4c2(0xae)),process[_0x19a4c2(0x101)](0x1);return;}}catch(_0x1b4d0e){console[_0x19a4c2(0xd5)](_0x19a4c2(0xd8)+_0x372003+_0x19a4c2(0xae)),process[_0x19a4c2(0x101)](0x1);return;}}}const _0x4bbc52=process.env.MCP_SKIP_LICENSE_CHECK==='1';if(!_0x4bbc52){if(!this[_0x19a4c2(0xf9)]){const {getFingerprint:_0x1325b5}=require(_0x19a4c2(0xd1));this[_0x19a4c2(0xf9)]=_0x1325b5();}const _0x3f960f=verifyLicense(this[_0x19a4c2(0xf7)],this['deviceId'],this['publicKey']);if(!_0x3f960f[_0x19a4c2(0xbe)]){if(_0x3f960f[_0x19a4c2(0xaf)]===_0x19a4c2(0xb8)){const _0x5ef481=_0x3f960f[_0x19a4c2(0xfd)]||{},_0x236c04=_0x5ef481[_0x19a4c2(0xbf)]?new Date(_0x5ef481['exp'])['toISOString']()[_0x19a4c2(0xfe)]('T')[0x0]:_0x19a4c2(0x139);console[_0x19a4c2(0xd5)](_0x19a4c2(0xb1)+_0x236c04+_0x19a4c2(0xda));}else console[_0x19a4c2(0xd5)](_0x19a4c2(0x108)+_0x3f960f[_0x19a4c2(0xaf)]+_0x19a4c2(0x125));process[_0x19a4c2(0x101)](0x1);return;}console[_0x19a4c2(0xd5)]('[MCP\x20Agent]\x20License\x20key\x20verified\x20successfully\x20for\x20user:\x20'+_0x3f960f[_0x19a4c2(0xfd)][_0x19a4c2(0x134)]),await this[_0x19a4c2(0x106)](),this[_0x19a4c2(0x119)]=setInterval(()=>{this['performHeartbeat']()['catch'](_0x2fe00a=>{const _0x322b2c=_0xf681;console[_0x322b2c(0xd5)](_0x322b2c(0xe4),_0x2fe00a['message']);});},0x18*0x3c*0x3c*0x3e8);}this[_0x19a4c2(0x13f)]=spawnBackends(this['projectPath']),this[_0x19a4c2(0xc2)]=!![];for(const _0x59d326 of Object[_0x19a4c2(0x13a)](this[_0x19a4c2(0x13f)])){_0x59d326['start']();}this[_0x19a4c2(0x129)]=_0x388b38=>{const _0x131068=_0x19a4c2;this[_0x131068(0x11e)](_0x388b38[_0x131068(0xd0)]());},process['stdin']['on'](_0x19a4c2(0x124),this[_0x19a4c2(0x129)]);}[_0x5ebdeb(0x11e)](_0x1cf77e){const _0x43e12f=_0x5ebdeb;this[_0x43e12f(0x122)]+=_0x1cf77e;const _0x195eae=this[_0x43e12f(0x122)][_0x43e12f(0xfe)]('\x0a');this['clientBuffer']=_0x195eae['pop']();for(const _0x24f0e1 of _0x195eae){const _0x31906e=_0x24f0e1['trim']();if(!_0x31906e)continue;try{const _0x288eb7=JSON['parse'](_0x31906e);this[_0x43e12f(0x118)](_0x288eb7);}catch(_0x44a01e){console[_0x43e12f(0xd5)](_0x43e12f(0x105),_0x24f0e1,_0x44a01e['message']);}}}async[_0x5ebdeb(0x118)](_0x5dc6a2){const _0x5d7eb6=_0x5ebdeb,{id:_0x52808b,method:_0x3e8676,params:_0x185be9}=_0x5dc6a2;if(!_0x3e8676)return;if(_0x3e8676===_0x5d7eb6(0x13e)){Promise[_0x5d7eb6(0x136)](Object['values'](this[_0x5d7eb6(0x13f)])[_0x5d7eb6(0xe8)](_0x2b7263=>_0x2b7263[_0x5d7eb6(0x109)](_0x5d7eb6(0x13e),_0x185be9)[_0x5d7eb6(0xbd)](_0x1346eb=>{const _0x434867=_0x5d7eb6;console[_0x434867(0xd5)](_0x434867(0xca)+(_0x2b7263['displayName']||_0x2b7263[_0x434867(0xb3)])+':',_0x1346eb[_0x434867(0x141)]);})));const _0x332fef={};_0x332fef[_0x5d7eb6(0xcb)]=![];const _0x493bb0={};_0x493bb0[_0x5d7eb6(0xc0)]=_0x332fef;const _0x51bb97={};_0x51bb97[_0x5d7eb6(0xb3)]=_0x5d7eb6(0x132),_0x51bb97[_0x5d7eb6(0x11c)]=_0x5d7eb6(0x12b);const _0x3e1655={};_0x3e1655['protocolVersion']=_0x185be9[_0x5d7eb6(0x117)]||_0x5d7eb6(0x135),_0x3e1655[_0x5d7eb6(0x144)]=_0x493bb0,_0x3e1655[_0x5d7eb6(0xbc)]=_0x51bb97;const _0x40aeb0={};_0x40aeb0['jsonrpc']=_0x5d7eb6(0xc1),_0x40aeb0['id']=_0x52808b,_0x40aeb0['result']=_0x3e1655;const _0x5d3e38=_0x40aeb0;this[_0x5d7eb6(0x148)](_0x5d3e38);return;}if(_0x3e8676===_0x5d7eb6(0xc9)){try{const _0xe2bee5=Object[_0x5d7eb6(0xb7)](this[_0x5d7eb6(0x13f)])[_0x5d7eb6(0xe8)](async([_0x2e2ea6,_0x25574d])=>{const _0x33b4cc=_0x5d7eb6;try{const _0x50779e=await _0x25574d[_0x33b4cc(0x109)](_0x33b4cc(0xc9)),_0x1d03d7=_0x50779e&&_0x50779e[_0x33b4cc(0x10b)]&&_0x50779e[_0x33b4cc(0x10b)]['tools']||[];return translateToolList(_0x1d03d7,_0x2e2ea6);}catch(_0xef8c04){return console[_0x33b4cc(0xd5)]('[MCP\x20Agent]\x20tools/list\x20request\x20failed\x20for\x20service\x20'+_0x2e2ea6+':',_0xef8c04[_0x33b4cc(0x141)]),[];}}),_0x484c7b=await Promise['all'](_0xe2bee5),_0xf59b12=_0x484c7b['flat'](),_0x54e262={};_0x54e262[_0x5d7eb6(0xc0)]=_0xf59b12;const _0x3dd2e6={};_0x3dd2e6[_0x5d7eb6(0x13d)]=_0x5d7eb6(0xc1),_0x3dd2e6['id']=_0x52808b,_0x3dd2e6[_0x5d7eb6(0x10b)]=_0x54e262;const _0x36f0e6=_0x3dd2e6;this[_0x5d7eb6(0x148)](_0x36f0e6);}catch(_0x4b26be){this['writeError'](_0x52808b,-0x7f5b,_0x5d7eb6(0xb2)+_0x4b26be[_0x5d7eb6(0x141)]);}return;}if(_0x3e8676===_0x5d7eb6(0x115)){const _0x4702d0=_0x185be9[_0x5d7eb6(0xb3)],_0x3e2152=mapExposedToOriginal(_0x4702d0);if(!_0x3e2152)return this[_0x5d7eb6(0xad)](_0x52808b,-0x7f59,_0x5d7eb6(0xed)+_0x4702d0);try{const _0x59a289=this[_0x5d7eb6(0x13f)][_0x3e2152[_0x5d7eb6(0xc7)]];if(!_0x59a289)return this['writeError'](_0x52808b,-0x7f5b,_0x5d7eb6(0xb5)+_0x3e2152[_0x5d7eb6(0xc7)]+_0x5d7eb6(0x143));const _0x58708a={..._0x185be9};_0x58708a['name']=_0x3e2152['originalName'];const _0x410575={..._0x5dc6a2};_0x410575[_0x5d7eb6(0xba)]=_0x58708a;const _0x271612=_0x410575,_0x56ed0e=await _0x59a289[_0x5d7eb6(0x114)](_0x271612);this[_0x5d7eb6(0x148)](_0x56ed0e);}catch(_0x1954a1){this[_0x5d7eb6(0xad)](_0x52808b,-0x7f5b,_0x5d7eb6(0xfa)+_0x1954a1[_0x5d7eb6(0x141)]);}return;}for(const _0x2e913f of Object[_0x5d7eb6(0x13a)](this['backends'])){_0x2e913f[_0x5d7eb6(0x10f)]&&_0x2e913f['child'][_0x5d7eb6(0x10c)][_0x5d7eb6(0x140)](JSON['stringify'](_0x5dc6a2)+'\x0a');}}[_0x5ebdeb(0x148)](_0x3a8701){const _0x333e3b=_0x5ebdeb;this[_0x333e3b(0x13c)][_0x333e3b(0x140)](JSON[_0x333e3b(0x100)](_0x3a8701)+'\x0a');}[_0x5ebdeb(0xad)](_0x115d5e,_0x243460,_0x57a39c){const _0x37d2c9=_0x5ebdeb,_0x28e78d={};_0x28e78d['code']=_0x243460,_0x28e78d['message']=_0x57a39c;const _0x456831={};_0x456831['jsonrpc']=_0x37d2c9(0xc1),_0x456831['id']=_0x115d5e,_0x456831['error']=_0x28e78d;const _0x470193=_0x456831;this[_0x37d2c9(0x148)](_0x470193);}['stop'](){const _0xa6f53f=_0x5ebdeb;this[_0xa6f53f(0xc2)]=![];this[_0xa6f53f(0x119)]&&(clearInterval(this[_0xa6f53f(0x119)]),this[_0xa6f53f(0x119)]=null);this[_0xa6f53f(0x129)]&&(process[_0xa6f53f(0x10c)][_0xa6f53f(0x11b)]('data',this[_0xa6f53f(0x129)]),this[_0xa6f53f(0x129)]=null,process[_0xa6f53f(0x10c)][_0xa6f53f(0xc8)]());if(this[_0xa6f53f(0x13f)])for(const _0x15a642 of Object[_0xa6f53f(0x13a)](this[_0xa6f53f(0x13f)])){_0x15a642[_0xa6f53f(0xd4)]();}}}const _0x515360={};_0x515360[_0x5ebdeb(0x133)]=ProxyServer,module[_0x5ebdeb(0xfb)]=_0x515360;if(require['main']===module){const server=new ProxyServer();server[_0x5ebdeb(0xdf)]()[_0x5ebdeb(0xbd)](_0x440c0e=>{const _0x29e6b6=_0x5ebdeb;console[_0x29e6b6(0xd5)](_0x29e6b6(0x14e),_0x440c0e[_0x29e6b6(0x141)]),process[_0x29e6b6(0x101)](0x1);});}