apt-mcp-agent-setup 1.2.4 → 1.2.5

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 _0x5d87a2=_0x1aab;(function(_0xbba437,_0x3294d7){const _0x1a1196=_0x1aab,_0x5e38a3=_0xbba437();while(!![]){try{const _0x6c8f4f=parseInt(_0x1a1196(0xe2))/0x1*(parseInt(_0x1a1196(0xfc))/0x2)+parseInt(_0x1a1196(0x13e))/0x3+-parseInt(_0x1a1196(0x117))/0x4*(parseInt(_0x1a1196(0x128))/0x5)+-parseInt(_0x1a1196(0x138))/0x6*(-parseInt(_0x1a1196(0xf8))/0x7)+parseInt(_0x1a1196(0x14e))/0x8*(parseInt(_0x1a1196(0xf6))/0x9)+parseInt(_0x1a1196(0x11b))/0xa+parseInt(_0x1a1196(0x106))/0xb*(-parseInt(_0x1a1196(0x11d))/0xc);if(_0x6c8f4f===_0x3294d7)break;else _0x5e38a3['push'](_0x5e38a3['shift']());}catch(_0x135f54){_0x5e38a3['push'](_0x5e38a3['shift']());}}}(_0x1b9c,0xaf4da));const fs=require('fs'),path=require(_0x5d87a2(0xf2)),os=require('os'),{verifyLicense}=require(_0x5d87a2(0x141)),{spawnBackends}=require(_0x5d87a2(0x147)),{translateToolList,mapExposedToOriginal}=require(_0x5d87a2(0xe0));function _0x1b9c(){const _0x2d83f8=['BwfW','C3rKB3v0','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGDMvYAwzPzwqGC3vJy2vZC2z1BgX5igzVCIb1C2vYoIa','uhjVEhLtzxj2zxi','q29UDgvUDc1uExbL','lI4VBgLJzw5Zzs9MAw5NzxjWCMLUDc5QCW','vgfYz2v0igjHy2TLBMqG','CMvWBgfJzq','C2vYDMvYsw5MBW','y2fWywjPBgL0AwvZ','CgvYzM9YBuHLyxj0yMvHDa','ig1VzgLMAwvKlIbfEgL0Aw5NlG','ChjVAMvJDfbHDgG','BwfZDgvYu2vJCMv0','BwvZC2fNzq','w01ducbbz2vUDf0GrMfPBgvKihrVihbHCNnLiePtt04TuLbdig1LC3nHz2uGzNjVBsbJBgLLBNq6','DMvYAwz5','lI9YB3v0zxiUANm','zMLSzxm','mwzuDg1wwa','zgLNzxn0','DxrMoa','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGsw52ywXPzcbZAwDUyxr1CMuUiev4AxrPBMCU','tgLJzw5ZzsbLEhbPCMvK','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGAgfZigjLzw4GCMv2B2TLzc4GrxHPDgLUzY4','vg9VBcbLEgvJDxrPB24GzMfPBgvKoIa','zxHPC3rZu3LUyW','Bg9HzeXPy2vUC2vlzxK','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGAw50zwDYAxr5lw1HBMLMzxn0lMPZB24GBwLZC2LUzY4GrxHPDgLUzY4','lIbdB250ywn0ihn1ChbVCNqGyxqGC3vWCg9YDebHBMHKAc5PBY4GrxHPDgLUzY4','BwfZDgvYlNb1yMXPyY5Wzw0','ue9tva','mI4W','zxHPDa','Dg9tDhjPBMC','Cgf0Aa','y2HPBgq','C3rHCNq','BgvUz3rO','mZK5nde3m3LfzfPxvW','zgf0yq','mtrduujYtKm','ChjVDg9JB2XwzxjZAw9U','Dg9Rzw4','AgvHCNrIzwf0sw50zxj2ywW','ndmYnJy0Dvrgthv2','C3rVCa','B3jPz2LUywXoyw1L','rMfPBgvKihrVihf1zxj5ihrVB2WGBgLZDdOG','y2XPzw50qNvMzMvY','C2vUzfjLCxvLC3q','lI4VlI4','DMvYC2LVBG','C2HHmJu2','w01ducbbz2vUDf0GrMfPBgvKihrVigLUAxrPywXPEMuGC2vYDMLJzsa','nJzHy2DQwuq','ANnVBG','C3rHDhvZ','y3DK','l2HLyxj0yMvHDa','CMvZDwX0','yMfJA2vUza','DMfSDwvZ','Dg9ju09tDhjPBMC','zNjVBq','y3j5ChrV','zMXHDa','zw50CMLLCW','DxnLCG','yxbWBgLJyxrPB24VANnVBG','zgLZDa','zM9YD2fYzfjLCxvLC3q','mJiYntGYmhjcBef4Eq','ANnVBNjWyW','D3jPDgu','C3bSAxq','nJe0odm5mhjeC29ltq','ChvIBgLJs2v5','mZa1otG5mNLgy1HOEa','zxHWB3j0CW','vg9VBcbUB3qGzM91BMq6ia','BgLJzw5ZzuTLEq','AgfUzgXLq2XPzw50twvZC2fNzq','ywjVCNq','D3jPDgvfCNjVCG','DxbKyxrL','Dg9VBhm','C3rKAw5mAxn0zw5LCG','BgLJzw5Zzs5RzxK','nuv4sgHwvG','w01ducbbz2vUDf0GrMfPBgvKihrVihnHDMuGCMvMCMvZAgvKigXPy2vUC2uGDg9Rzw4GDg8GzgLZAZO','BMfTzq','CNvUBMLUzW','BM93','Dg9VBhmVBgLZDa','BwfPBG','Ag9TzwrPCG','w01ducbbz2vUDf0GsgvHCNrIzwf0ihjLzNjLC2GGzMfPBgvKoIbtzxj2zxiGCMv0DxjUzwqG','yMfZzty0DxjS','Cgf1C2u','DMfSAwq','lMfUAgrO','CMvHC29U','CgfYyw1Z','Aw50zwDYAxr5twfUAwzLC3rqyxrO','mZy4ntaWmMrLzuHQqq','ufjprfvdveLptL9qvujmsunFs0vz','Agv4','ywrTAw4','BwTKAxjtEw5J','CMvHzezPBgvtEw5J','otaZndiZz2nPrwDM','Aw5PDgLHBgL6zq','zgLYBMfTzq','lI4VBgLJzw5Zzs92zxjPzNKUANm','ywXS','zgv2AwnLswq','yMfJA2vUzhm','zxHW','w01ducbbz2vUDf0GsgvHCNrIzwf0ignOzwnRigzHAwXLzcbVCIb0Aw1LzcbVDxq6','lI9IywnRzw5KCY5QCW','zxjYB3i','y2f0y2G','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOG','w01ducbbz2vUDf0GtgLJzw5ZzsbLEhbPCMvKig9Uia','AgfUzgXLq2XPzw50rgf0yq','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGDMvYAwzPy2f0Aw9UigzHAwXLzdOG','og5Xu2TwwG','C3rYAw5NAwz5','igLZig5VDcbYDw5UAw5N','C3rKAw4','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGu2LNBMf0DxjLihzLCMLMAwnHDgLVBIbMywLSzwqUiev4AxrPBMCU','DhjPBq','D3jPDgvuB0nSAwvUDa','CgfYC2u','Aw5JBhvKzxm','w01ducbbz2vUDf0GugvYAw9KAwmGAgvHCNrIzwf0igvYCM9YoG','AM9PBG','lIbdB250Aw51Aw5NihDPDgGGy2fJAgvKihrVA2vUlG'];_0x1b9c=function(){return _0x2d83f8;};return _0x1b9c();}function _0x1aab(_0x293d16,_0xe18693){_0x293d16=_0x293d16-0xc6;const _0x1b9c35=_0x1b9c();let _0x1aabfd=_0x1b9c35[_0x293d16];if(_0x1aab['kFocJd']===undefined){var _0x4842de=function(_0x1ff12e){const _0x30571e='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x326eb3='',_0x1f5e08='';for(let _0x4592dd=0x0,_0x13ade9,_0x25e21d,_0x43b9e3=0x0;_0x25e21d=_0x1ff12e['charAt'](_0x43b9e3++);~_0x25e21d&&(_0x13ade9=_0x4592dd%0x4?_0x13ade9*0x40+_0x25e21d:_0x25e21d,_0x4592dd++%0x4)?_0x326eb3+=String['fromCharCode'](0xff&_0x13ade9>>(-0x2*_0x4592dd&0x6)):0x0){_0x25e21d=_0x30571e['indexOf'](_0x25e21d);}for(let _0x4b7534=0x0,_0xd7c5f2=_0x326eb3['length'];_0x4b7534<_0xd7c5f2;_0x4b7534++){_0x1f5e08+='%'+('00'+_0x326eb3['charCodeAt'](_0x4b7534)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1f5e08);};_0x1aab['TwABKX']=_0x4842de,_0x1aab['RjzrlO']={},_0x1aab['kFocJd']=!![];}const _0x25c1f3=_0x1b9c35[0x0],_0x304076=_0x293d16+_0x25c1f3,_0x287d5c=_0x1aab['RjzrlO'][_0x304076];return!_0x287d5c?(_0x1aabfd=_0x1aab['TwABKX'](_0x1aabfd),_0x1aab['RjzrlO'][_0x304076]=_0x1aabfd):_0x1aabfd=_0x287d5c,_0x1aabfd;}class ProxyServer{constructor(_0x173707={}){const _0x43c494=_0x5d87a2;this[_0x43c494(0xdb)]=_0x173707[_0x43c494(0xdb)]||process[_0x43c494(0x109)](),this[_0x43c494(0x120)]=_0x173707[_0x43c494(0x120)]||this[_0x43c494(0xea)](),this[_0x43c494(0x143)]=_0x173707[_0x43c494(0x143)],this[_0x43c494(0x11c)]=_0x173707[_0x43c494(0x11c)]||_0x173707[_0x43c494(0xdc)],this[_0x43c494(0x144)]=null,this[_0x43c494(0x100)]='',this[_0x43c494(0x12b)]=![],this[_0x43c494(0xd0)]=_0x173707[_0x43c494(0xd0)]||process[_0x43c494(0xd0)],this[_0x43c494(0x137)]=_0x173707['integrityManifestPath']||path['join'](__dirname,_0x43c494(0x102),'integrity-manifest.json');}['loadLicenseKey'](){const _0x263f5d=_0x5d87a2,_0x54c292=path['join'](os['homedir'](),_0x263f5d(0x134),_0x263f5d(0x127));if(fs['existsSync'](_0x54c292))return fs[_0x263f5d(0x13d)](_0x54c292,_0x263f5d(0xe4))['trim']();return null;}async[_0x5d87a2(0xd9)](){const _0x3dd701=_0x5d87a2,_0x57c3af=process.env.MCP_SKIP_LICENSE_CHECK==='1';if(_0x57c3af||!this['licenseKey'])return;const _0x228ec6=this[_0x3dd701(0x120)]['split']('.');if(_0x228ec6[_0x3dd701(0xf5)]!==0x3)return;let _0xce381;try{_0xce381=JSON[_0x3dd701(0xca)](Buffer[_0x3dd701(0x10f)](_0x228ec6[0x1],_0x3dd701(0x131))[_0x3dd701(0xf1)](_0x3dd701(0xe4)));}catch(_0x59d47e){return;}if(!_0xce381||!_0xce381['exp'])return;const _0x2ec041=0x6*0x18*0xe10*0x3e8,_0x29305b=_0xce381['exp']-Date[_0x3dd701(0x12c)]();if(_0x29305b<_0x2ec041){console['error']('[MCP\x20Agent]\x20Heartbeat\x20check:\x20token\x20has\x20less\x20than\x206\x20days\x20remaining.\x20Refreshing...');const _0xfb366c=process.env.MCP_ACTIVATION_URL||'https://agentkit.alphatechs.ai/api',_0x21b170=_0xfb366c+_0x3dd701(0x10a),_0x107783=new AbortController(),_0x427f71=setTimeout(()=>_0x107783[_0x3dd701(0x122)](),0x1388);try{const _0x1409bf={};_0x1409bf[_0x3dd701(0xd3)]=_0x3dd701(0x114);const _0x1d2b72={};_0x1d2b72[_0x3dd701(0xfa)]=this[_0x3dd701(0x120)];const _0x1596e3=await fetch(_0x21b170,{'method':_0x3dd701(0xee),'headers':_0x1409bf,'body':JSON[_0x3dd701(0x14f)](_0x1d2b72),'signal':_0x107783['signal']});clearTimeout(_0x427f71);if(_0x1596e3[_0x3dd701(0x108)]===0x193){console[_0x3dd701(0x148)](_0x3dd701(0xe7)),process[_0x3dd701(0xf0)](0x1);return;}if(_0x1596e3[_0x3dd701(0x108)]===0x191){console[_0x3dd701(0x148)]('[MCP\x20Agent]\x20License\x20key\x20expired\x20or\x20invalid.\x20Exiting.'),process['exit'](0x1);return;}if(!_0x1596e3['ok']){console[_0x3dd701(0x148)](_0x3dd701(0x130)+_0x1596e3[_0x3dd701(0x108)]+_0x3dd701(0xce));return;}const _0x2277d5=await _0x1596e3[_0x3dd701(0x107)]();if(_0x2277d5&&_0x2277d5[_0x3dd701(0xfa)]){this[_0x3dd701(0x120)]=_0x2277d5['token'];const _0x1f5c99=path[_0x3dd701(0xcd)](os[_0x3dd701(0x12f)](),'.anhdh',_0x3dd701(0x127));try{const _0x5284a2={};_0x5284a2['recursive']=!![],fs[_0x3dd701(0x13c)](path[_0x3dd701(0x140)](_0x1f5c99),_0x5284a2),fs['writeFileSync'](_0x1f5c99,_0x2277d5[_0x3dd701(0xfa)],_0x3dd701(0xe4)),console['error']('[MCP\x20Agent]\x20Heartbeat:\x20License\x20token\x20successfully\x20refreshed.');}catch(_0x4baf5a){console[_0x3dd701(0x148)](_0x3dd701(0x129),_0x4baf5a[_0x3dd701(0xdd)]);}}}catch(_0x318dae){clearTimeout(_0x427f71),console['error'](_0x3dd701(0x146),_0x318dae[_0x3dd701(0xdd)],_0x3dd701(0xce));}}}async[_0x5d87a2(0xf4)](){const _0x107eb0=_0x5d87a2;console[_0x107eb0(0x148)]('[MCP\x20Agent]\x20Starting\x20server\x20at\x20'+this[_0x107eb0(0xdb)]);if(!this['publicKey']){if(process.env.MCP_ADMIN_DIR){const _0x2495da=path[_0x107eb0(0xcd)](process.env.MCP_ADMIN_DIR,_0x107eb0(0xed));fs['existsSync'](_0x2495da)&&(this[_0x107eb0(0x11c)]=fs['readFileSync'](_0x2495da,'utf8')['trim']());}if(!this[_0x107eb0(0x11c)]){let _0x4496c5=__dirname;while(_0x4496c5){const _0x4f84ce=path[_0x107eb0(0xcd)](_0x4496c5,_0x107eb0(0x13b),'master.public.pem');if(fs[_0x107eb0(0xe9)](_0x4f84ce)){this['publicKey']=fs[_0x107eb0(0x13d)](_0x4f84ce,_0x107eb0(0xe4))[_0x107eb0(0xc8)]();break;}const _0x337fc8=path[_0x107eb0(0x140)](_0x4496c5);if(_0x337fc8===_0x4496c5)break;_0x4496c5=_0x337fc8;}}}const _0x2ed0fb=this[_0x107eb0(0x137)],_0x4ef687=!__dirname[_0x107eb0(0xd6)](/\\/g,'/')[_0x107eb0(0x11a)]('/')[_0x107eb0(0xcb)](_0x107eb0(0x115)),_0x2a5911=process.env.MCP_SKIP_INTEGRITY_CHECK==='1'||_0x4ef687&&!fs[_0x107eb0(0xe9)](_0x2ed0fb);if(!_0x2a5911){const _0x5ae5a1=require(_0x107eb0(0x110));if(!fs[_0x107eb0(0xe9)](_0x2ed0fb)){console['error'](_0x107eb0(0xeb)),process['exit'](0x1);return;}let _0x4b3b17;try{_0x4b3b17=JSON[_0x107eb0(0xca)](fs[_0x107eb0(0x13d)](_0x2ed0fb,_0x107eb0(0xe4)));}catch(_0x46a917){console[_0x107eb0(0x148)]('[MCP\x20Agent]\x20Integrity\x20check\x20failed:\x20Failed\x20to\x20parse\x20integrity-manifest.json.\x20Exiting.'),process['exit'](0x1);return;}if(!_0x4b3b17[_0x107eb0(0xe1)]||!_0x4b3b17['signature']){console[_0x107eb0(0x148)]('[MCP\x20Agent]\x20Integrity\x20check\x20failed:\x20Invalid\x20manifest\x20format.\x20Exiting.'),process[_0x107eb0(0xf0)](0x1);return;}const _0xcf599d=this[_0x107eb0(0x11c)]||require(_0x107eb0(0x141))[_0x107eb0(0x139)];try{const _0x258778=JSON['stringify'](_0x4b3b17[_0x107eb0(0xe1)]),_0x247597=Buffer[_0x107eb0(0x10f)](_0x4b3b17['signature'],'base64url'),_0x2dc7e6=_0x5ae5a1[_0x107eb0(0xdf)](null,Buffer[_0x107eb0(0x10f)](_0x258778),_0xcf599d,_0x247597);if(!_0x2dc7e6){console['error'](_0x107eb0(0xe5)),process[_0x107eb0(0xf0)](0x1);return;}}catch(_0x401b34){console[_0x107eb0(0x148)](_0x107eb0(0xc7)),process['exit'](0x1);return;}const _0x4d12fb=path['join'](__dirname,'../..');for(const [_0x4bcc13,_0x47466f]of Object[_0x107eb0(0x112)](_0x4b3b17[_0x107eb0(0xe1)])){const _0x5a798a=path['join'](_0x4d12fb,_0x4bcc13);if(!fs[_0x107eb0(0xe9)](_0x5a798a)){console[_0x107eb0(0x148)](_0x107eb0(0x14a)+_0x4bcc13+'\x20modified.\x20Exiting.'),process[_0x107eb0(0xf0)](0x1);return;}try{const _0x58567e=fs[_0x107eb0(0x13d)](_0x5a798a),_0x4ff7b3=_0x5ae5a1['createHash'](_0x107eb0(0x104))[_0x107eb0(0x124)](_0x58567e)[_0x107eb0(0xe3)](_0x107eb0(0x13a));if(_0x4ff7b3!==_0x47466f){console[_0x107eb0(0x148)](_0x107eb0(0x14a)+_0x4bcc13+_0x107eb0(0xda)),process[_0x107eb0(0xf0)](0x1);return;}}catch(_0x27ec30){console[_0x107eb0(0x148)](_0x107eb0(0x14a)+_0x4bcc13+_0x107eb0(0xda)),process[_0x107eb0(0xf0)](0x1);return;}}}const _0x18170c=process.env.MCP_SKIP_LICENSE_CHECK==='1';if(!_0x18170c){if(!this[_0x107eb0(0x143)]){const {getFingerprint:_0x39940d}=require(_0x107eb0(0xd4));this[_0x107eb0(0x143)]=_0x39940d();}const _0x21be6d=verifyLicense(this['licenseKey'],this['deviceId'],this[_0x107eb0(0x11c)]);if(!_0x21be6d[_0x107eb0(0x133)]){if(_0x21be6d[_0x107eb0(0x135)]===_0x107eb0(0xe6)){const _0x397b56=_0x21be6d['payload']||{},_0x32fcaf=_0x397b56[_0x107eb0(0x145)]?new Date(_0x397b56[_0x107eb0(0x145)])[_0x107eb0(0x10e)]()[_0x107eb0(0x11a)]('T')[0x0]:'unknown';console['error'](_0x107eb0(0x14b)+_0x32fcaf+'.\x20Renew\x20at\x20https://anhdh.io/renew.\x20Exiting.');}else console[_0x107eb0(0x148)](_0x107eb0(0x14d)+_0x21be6d['reason']+_0x107eb0(0xec));process[_0x107eb0(0xf0)](0x1);return;}console[_0x107eb0(0x148)](_0x107eb0(0xd1)+_0x21be6d['payload'][_0x107eb0(0x113)]),await this[_0x107eb0(0xd9)](),this[_0x107eb0(0xfb)]=setInterval(()=>{const _0x51018d=_0x107eb0;this[_0x51018d(0xd9)]()[_0x51018d(0x149)](_0x361e4b=>{const _0x3d9d67=_0x51018d;console[_0x3d9d67(0x148)](_0x3d9d67(0xcc),_0x361e4b[_0x3d9d67(0xdd)]);});},0x18*0x3c*0x3c*0x3e8);}this[_0x107eb0(0x144)]=spawnBackends(this[_0x107eb0(0xdb)]),this[_0x107eb0(0x12b)]=!![];for(const _0xb563aa of Object[_0x107eb0(0x10d)](this[_0x107eb0(0x144)])){_0xb563aa[_0x107eb0(0xf4)]();}this[_0x107eb0(0x126)]=_0x1dde52=>{this['handleClientData'](_0x1dde52['toString']());},process[_0x107eb0(0xc6)]['on'](_0x107eb0(0xf7),this['stdinListener']);}[_0x5d87a2(0x14c)](_0x4623a6){const _0x6bfff4=_0x5d87a2;this[_0x6bfff4(0x100)]+=_0x4623a6;const _0x1420ae=this[_0x6bfff4(0x100)][_0x6bfff4(0x11a)]('\x0a');this[_0x6bfff4(0x100)]=_0x1420ae['pop']();for(const _0x4ade53 of _0x1420ae){const _0x52eb4f=_0x4ade53[_0x6bfff4(0xc8)]();if(!_0x52eb4f)continue;try{const _0x34836b=JSON[_0x6bfff4(0xca)](_0x52eb4f);this[_0x6bfff4(0x121)](_0x34836b);}catch(_0x352871){console[_0x6bfff4(0x148)](_0x6bfff4(0xde),_0x4ade53,_0x352871[_0x6bfff4(0xdd)]);}}}async['handleClientMessage'](_0x356ab5){const _0xa9e8b4=_0x5d87a2,{id:_0x833689,method:_0x4f467f,params:_0x3eda4a}=_0x356ab5;if(!_0x4f467f)return;if(_0x4f467f===_0xa9e8b4(0x13f)){Promise[_0xa9e8b4(0x142)](Object[_0xa9e8b4(0x10d)](this[_0xa9e8b4(0x144)])[_0xa9e8b4(0xcf)](_0x1c3d74=>_0x1c3d74[_0xa9e8b4(0x101)](_0xa9e8b4(0x13f),_0x3eda4a)[_0xa9e8b4(0x149)](_0x3a12ad=>{const _0x41de0e=_0xa9e8b4;console['error'](_0x41de0e(0x105)+(_0x1c3d74['displayName']||_0x1c3d74['name'])+':',_0x3a12ad['message']);})));const _0x69fc0b={};_0x69fc0b['listChanged']=![];const _0x41dbb0={};_0x41dbb0[_0xa9e8b4(0x125)]=_0x69fc0b;const _0x2cfae5={};_0x2cfae5[_0xa9e8b4(0x12a)]='mcp-agent-proxy',_0x2cfae5[_0xa9e8b4(0x103)]='1.0.0';const _0x27f594={};_0x27f594['protocolVersion']=_0x3eda4a[_0xa9e8b4(0xf9)]||'2024-11-05',_0x27f594[_0xa9e8b4(0xd8)]=_0x41dbb0,_0x27f594[_0xa9e8b4(0xd7)]=_0x2cfae5;const _0xb5d017={};_0xb5d017[_0xa9e8b4(0x118)]=_0xa9e8b4(0xef),_0xb5d017['id']=_0x833689,_0xb5d017['result']=_0x27f594;const _0x1d1648=_0xb5d017;this[_0xa9e8b4(0xc9)](_0x1d1648);return;}if(_0x4f467f===_0xa9e8b4(0x12d)){try{const _0x4134f6=Object['entries'](this[_0xa9e8b4(0x144)])[_0xa9e8b4(0xcf)](async([_0x1c17f6,_0x5234db])=>{const _0x18d4a4=_0xa9e8b4;try{const _0x16b957=await _0x5234db[_0x18d4a4(0x101)]('tools/list'),_0x2b1f78=_0x16b957&&_0x16b957[_0x18d4a4(0x10b)]&&_0x16b957[_0x18d4a4(0x10b)][_0x18d4a4(0x125)]||[];return translateToolList(_0x2b1f78,_0x1c17f6);}catch(_0x4d428e){return console[_0x18d4a4(0x148)]('[MCP\x20Agent]\x20tools/list\x20request\x20failed\x20for\x20service\x20'+_0x1c17f6+':',_0x4d428e[_0x18d4a4(0xdd)]),[];}}),_0x1e3c1a=await Promise[_0xa9e8b4(0x142)](_0x4134f6),_0x1d5ad1=_0x1e3c1a[_0xa9e8b4(0x111)](),_0x153c06={};_0x153c06[_0xa9e8b4(0x125)]=_0x1d5ad1;const _0x2173bc={};_0x2173bc[_0xa9e8b4(0x118)]='2.0',_0x2173bc['id']=_0x833689,_0x2173bc[_0xa9e8b4(0x10b)]=_0x153c06;const _0x1d3631=_0x2173bc;this[_0xa9e8b4(0xc9)](_0x1d3631);}catch(_0x43b15a){this[_0xa9e8b4(0x123)](_0x833689,-0x7f5b,_0xa9e8b4(0xff)+_0x43b15a['message']);}return;}if(_0x4f467f==='tools/call'){const _0x1b9bf3=_0x3eda4a[_0xa9e8b4(0x12a)],_0x172eb3=mapExposedToOriginal(_0x1b9bf3);if(!_0x172eb3)return this[_0xa9e8b4(0x123)](_0x833689,-0x7f59,_0xa9e8b4(0x11f)+_0x1b9bf3);try{const _0x5dccf7=this[_0xa9e8b4(0x144)][_0x172eb3[_0xa9e8b4(0x10c)]];if(!_0x5dccf7)return this[_0xa9e8b4(0x123)](_0x833689,-0x7f5b,_0xa9e8b4(0xd5)+_0x172eb3[_0xa9e8b4(0x10c)]+_0xa9e8b4(0x150));const _0x761b4a={..._0x3eda4a};_0x761b4a[_0xa9e8b4(0x12a)]=_0x172eb3[_0xa9e8b4(0xfe)];const _0x3802c9={..._0x356ab5};_0x3802c9[_0xa9e8b4(0x136)]=_0x761b4a;const _0x2b4322=_0x3802c9,_0x8a030b=await _0x5dccf7[_0xa9e8b4(0x116)](_0x2b4322);this[_0xa9e8b4(0xc9)](_0x8a030b);}catch(_0x10c567){this[_0xa9e8b4(0x123)](_0x833689,-0x7f5b,_0xa9e8b4(0xe8)+_0x10c567['message']);}return;}for(const _0x4f631f of Object['values'](this[_0xa9e8b4(0x144)])){_0x4f631f[_0xa9e8b4(0xf3)]&&_0x4f631f[_0xa9e8b4(0xf3)][_0xa9e8b4(0xc6)][_0xa9e8b4(0x119)](JSON['stringify'](_0x356ab5)+'\x0a');}}[_0x5d87a2(0xc9)](_0x67367b){const _0x1f0857=_0x5d87a2;this[_0x1f0857(0xd0)][_0x1f0857(0x119)](JSON[_0x1f0857(0x14f)](_0x67367b)+'\x0a');}[_0x5d87a2(0x123)](_0x28f63b,_0x3c63e3,_0x464a19){const _0x57b2e0=_0x5d87a2,_0x16fe82={};_0x16fe82['code']=_0x3c63e3,_0x16fe82[_0x57b2e0(0xdd)]=_0x464a19;const _0x30942e={};_0x30942e[_0x57b2e0(0x118)]=_0x57b2e0(0xef),_0x30942e['id']=_0x28f63b,_0x30942e['error']=_0x16fe82;const _0x2b252b=_0x30942e;this[_0x57b2e0(0xc9)](_0x2b252b);}['stop'](){const _0x4f00ef=_0x5d87a2;this[_0x4f00ef(0x12b)]=![];this[_0x4f00ef(0xfb)]&&(clearInterval(this[_0x4f00ef(0xfb)]),this[_0x4f00ef(0xfb)]=null);this['stdinListener']&&(process[_0x4f00ef(0xc6)]['removeListener'](_0x4f00ef(0xf7),this[_0x4f00ef(0x126)]),this[_0x4f00ef(0x126)]=null,process[_0x4f00ef(0xc6)][_0x4f00ef(0x132)]());if(this[_0x4f00ef(0x144)])for(const _0x58521b of Object[_0x4f00ef(0x10d)](this[_0x4f00ef(0x144)])){_0x58521b[_0x4f00ef(0xfd)]();}}}const _0x5aa348={};_0x5aa348[_0x5d87a2(0xd2)]=ProxyServer,module[_0x5d87a2(0x11e)]=_0x5aa348;if(require[_0x5d87a2(0x12e)]===module){const server=new ProxyServer();server[_0x5d87a2(0xf4)]()[_0x5d87a2(0x149)](_0x3aaa5d=>{const _0x15d123=_0x5d87a2;console[_0x15d123(0x148)]('Failed\x20to\x20start\x20ProxyServer:',_0x3aaa5d['message']),process[_0x15d123(0xf0)](0x1);});}
1
+ const _0x561961=_0x11b1;(function(_0x5ccaa1,_0xb296b8){const _0x3083f8=_0x11b1,_0x1ff6a7=_0x5ccaa1();while(!![]){try{const _0x5a46be=parseInt(_0x3083f8(0x1e1))/0x1*(-parseInt(_0x3083f8(0x1c8))/0x2)+-parseInt(_0x3083f8(0x1b6))/0x3*(parseInt(_0x3083f8(0x1ca))/0x4)+parseInt(_0x3083f8(0x21c))/0x5*(parseInt(_0x3083f8(0x1b1))/0x6)+parseInt(_0x3083f8(0x1dd))/0x7+parseInt(_0x3083f8(0x20c))/0x8+-parseInt(_0x3083f8(0x1a8))/0x9+-parseInt(_0x3083f8(0x1d6))/0xa*(parseInt(_0x3083f8(0x1f6))/0xb);if(_0x5a46be===_0xb296b8)break;else _0x1ff6a7['push'](_0x1ff6a7['shift']());}catch(_0x275ced){_0x1ff6a7['push'](_0x1ff6a7['shift']());}}}(_0x1b08,0x6cc37));const fs=require('fs'),path=require(_0x561961(0x211)),os=require('os'),{verifyLicense}=require(_0x561961(0x1f2)),{spawnBackends}=require(_0x561961(0x1ae)),{translateToolList,mapExposedToOriginal}=require(_0x561961(0x1d0));function _0x1b08(){const _0x21ddfe=['w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGAgfZigjLzw4GCMv2B2TLzc4GrxHPDgLUzY4','zw50CMLLCW','yMfZzty0DxjS','zgLZCgXHEu5HBwu','Ag9TzwrPCG','nuTus01JDW','C3bSAxq','w01ducbbz2vUDf0GsgvHCNrIzwf0ignOzwnRigzHAwXLzcbVCIb0Aw1LzcbVDxq6','zgv2AwnLswq','Aw50zwDYAxr5twfUAwzLC3rqyxrO','ufjprfvdveLptL9qvujmsunFs0vz','w01ducbbz2vUDf0GsgvHCNrIzwf0ihjLzNjLC2GGzMfPBgvKoIbtzxj2zxiGCMv0DxjUzwqG','lIbdB250ywn0ihn1ChbVCNqGyxqGC3vWCg9YDebHBMHKAc5PBY4GrxHPDgLUzY4','BgLJzw5Zzs5RzxK','w01ducbbz2vUDf0GrMfPBgvKihrVihnHDMuGCMvMCMvZAgvKigXPy2vUC2uGDg9Rzw4GDg8GzgLZAZO','vg9VBcbLEgvJDxrPB24GzMfPBgvKoIa','lI4VlI4','zNjVBq','zxHPC3rZu3LUyW','yxbWBgLJyxrPB24VANnVBG','rMfPBgvKihrVihn0yxj0ifbYB3H5u2vYDMvYoG','y3j5ChrV','AgfUzgXLq2XPzw50twvZC2fNzq','Ahr0Chm6lY9Hz2vUDgTPDc5HBhbOyxrLy2HZlMfPl2fWAq','w01ducbbz2vUDf0GsgvHCNrIzwf0ignOzwnRoIb0B2TLBIbOyxmGBgvZCYb0AgfUidyGzgf5CYbYzw1HAw5PBMCUifjLzNjLC2HPBMCUlI4','C3rHCNq','Dg9VBhm','Dg9Rzw4','y2f0y2G','DxbKyxrL','C3rVCa','ntKZoda3nfbkzeLXCW','Dw5RBM93BG','DMvYAwz5','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGAw50zwDYAxr5lw1HBMLMzxn0lMPZB24GBwLZC2LUzY4GrxHPDgLUzY4','C3rKAw5mAxn0zw5LCG','C2LNBMfS','lI9IywnRzw5KCY5QCW','y2HPBgq','C2vUzfjLCxvLC3q','mZCZmdu5nKPVwffnCG','C3rKAw4','ywjVCNq','w01ducbbz2vUDf0GrMfPBgvKihrVigLUAxrPywXPEMuGC2vYDMLJzsa','AgvHCNrIzwf0sw50zxj2ywW','odGZnJe3yKPHv25z','DhjPBq','ChjVAMvJDfbHDgG','uhjVEhLtzxj2zxi','CNvUBMLUzW','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGDMvYAwzPy2f0Aw9UigzHAwXLzdOG','y3DK','BwfZDgvYlNb1yMXPyY5Wzw0','BM93','zxjYB3i','ig1VzgLMAwvKlIbfEgL0Aw5NlG','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGsw52ywXPzcbZAwDUyxr1CMuUiev4AxrPBMCU','CMvJDxjZAxzL','Dg9VBhmVBgLZDa','D3jPDgvuB0nSAwvUDa','y29Kzq','q29UDgvUDc1uExbL','ANnVBNjWyW','mKvRzgvStG','tgLJzw5ZzsbLEhbPCMvK','ng9LA25REG','zMLSzxm','BwfZDgvYu2vJCMv0','ChjVDg9JB2XwzxjZAw9U','ywrTAw4','y2fWywjPBgL0AwvZ','lI9YB3v0zxiUANm','zxHWB3j0CW','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGzxHWAxjLzcbVCIbPBNzHBgLKlIbfEgL0Aw5NlG','Cg9W','B3jPz2LUywXoyw1L','D3jPDgvgAwXLu3LUyW','mtbjvMvOz0K','BwfPBG','BwTKAxjtEw5J','DMvYC2LVBG','D3jPDgvfCNjVCG','zgLYBMfTzq','zxHPDa','ndyYote4ne5Kt2XhsG','BMfTzq','ChvIBgLJs2v5','AM9PBG','mteZofHnqwjvuq','Dg9ju09tDhjPBMC','DMfSDwvZ','mI4W','BwvZC2fNzq','zgLZDa','zgf0yq','CMvHzezPBgvtEw5J','Agv4','lIbszw5LDYbHDcbODhrWCZOVl2fUAgrOlMLVl3jLBMv3lIbfEgL0Aw5NlG','yMfJA2vUzhm','mJaYnc0Xms0Wnq','w01ducbbz2vUDf0GugvYAw9KAwmGAgvHCNrIzwf0igvYCM9YoG','C3rHDhvZ','Cgf5Bg9Hza','Aw5PDgLHBgL6zq','C2LNBMf0DxjL','lI4VBgLJzw5Zzs92zxjPzNKUANm','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGsw52ywXPzcbTyw5PzMvZDcbMB3jTyxqUiev4AxrPBMCU','lIbdB250Aw51Aw5NihDPDgGGy2fJAgvKihrVA2vUlG','ywXS','ndqYntK3mvfXwhLLEG','yMfJA2vUza','rMfPBgvKihrVihf1zxj5ihrVB2WGBgLZDdOG','zM9YD2fYzfjLCxvLC3q','zMXHDa','Dg9tDhjPBMC','CMvZDwX0','DxnLCG','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGrMfPBgvKihrVihbHCNnLigLUDgvNCML0Es1Tyw5PzMvZDc5QC29UlIbfEgL0Aw5NlG','Aw50zwDYAxr5lw1HBMLMzxn0lMPZB24','CMvHC29U','igLZig5VDcbYDw5UAw5N','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOG','AgfUzgXLq2XPzw50rgf0yq','zxHW','C3rYAw5NAwz5','CgvYzM9YBuHLyxj0yMvHDa','Dg9VBhmVy2fSBa','Aw5JBhvKzxm','w01ducbbz2vUDf0GrMfPBgvKihrVihbHCNnLiePtt04TuLbdig1LC3nHz2uGzNjVBsbJBgLLBNq6','CgfYC2u','CgfYyw1Z','nde2mtKYogvfBMDXDG','BgLJzw5ZzuTLEq','BgvUz3rO','vg9VBcbUB3qGzM91BMq6ia','BwfW','Cgf0Aa','y3jLyxrLsgfZAa','C2HHmJu2','D3jPDgu','DxrMoa','C3rKB3v0'];_0x1b08=function(){return _0x21ddfe;};return _0x1b08();}function _0x11b1(_0xd3fb35,_0x17a4fa){_0xd3fb35=_0xd3fb35-0x1a7;const _0x1b084c=_0x1b08();let _0x11b17b=_0x1b084c[_0xd3fb35];if(_0x11b1['GMKbwV']===undefined){var _0x2223fb=function(_0x3fea72){const _0x6446f3='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1956af='',_0xb22128='';for(let _0x426ada=0x0,_0x510969,_0x5602eb,_0x1fd493=0x0;_0x5602eb=_0x3fea72['charAt'](_0x1fd493++);~_0x5602eb&&(_0x510969=_0x426ada%0x4?_0x510969*0x40+_0x5602eb:_0x5602eb,_0x426ada++%0x4)?_0x1956af+=String['fromCharCode'](0xff&_0x510969>>(-0x2*_0x426ada&0x6)):0x0){_0x5602eb=_0x6446f3['indexOf'](_0x5602eb);}for(let _0x40d51f=0x0,_0x29996a=_0x1956af['length'];_0x40d51f<_0x29996a;_0x40d51f++){_0xb22128+='%'+('00'+_0x1956af['charCodeAt'](_0x40d51f)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xb22128);};_0x11b1['cMoOaz']=_0x2223fb,_0x11b1['ADeBeb']={},_0x11b1['GMKbwV']=!![];}const _0x3b51f2=_0x1b084c[0x0],_0x329f7f=_0xd3fb35+_0x3b51f2,_0x3b39dc=_0x11b1['ADeBeb'][_0x329f7f];return!_0x3b39dc?(_0x11b17b=_0x11b1['cMoOaz'](_0x11b17b),_0x11b1['ADeBeb'][_0x329f7f]=_0x11b17b):_0x11b17b=_0x3b39dc,_0x11b17b;}class ProxyServer{constructor(_0x4cf074={}){const _0x1df9d6=_0x561961;this['projectPath']=_0x4cf074['projectPath']||process[_0x1df9d6(0x1bc)](),this[_0x1df9d6(0x20d)]=_0x4cf074['licenseKey']||this['loadLicenseKey'](),this[_0x1df9d6(0x21f)]=_0x4cf074[_0x1df9d6(0x21f)],this['publicKey']=_0x4cf074[_0x1df9d6(0x1df)]||_0x4cf074[_0x1df9d6(0x1cc)],this[_0x1df9d6(0x1eb)]=null,this['clientBuffer']='',this[_0x1df9d6(0x1ba)]=![],this[_0x1df9d6(0x216)]=_0x4cf074[_0x1df9d6(0x216)]||process[_0x1df9d6(0x216)],this[_0x1df9d6(0x220)]=_0x4cf074[_0x1df9d6(0x220)]||path[_0x1df9d6(0x1e0)](__dirname,_0x1df9d6(0x227),_0x1df9d6(0x1ff));}['loadLicenseKey'](){const _0xbdbb11=_0x561961,_0x20c079=path[_0xbdbb11(0x1e0)](os[_0xbdbb11(0x21b)](),'.anhdh',_0xbdbb11(0x224));if(fs[_0xbdbb11(0x229)](_0x20c079))return fs[_0xbdbb11(0x1e8)](_0x20c079,_0xbdbb11(0x215))[_0xbdbb11(0x1b7)]();return null;}async['performHeartbeat'](){const _0x2b189e=_0x561961,_0x5104a2=process.env.MCP_SKIP_LICENSE_CHECK==='1';if(_0x5104a2||!this[_0x2b189e(0x20d)])return;const _0x33f1d6=this[_0x2b189e(0x20d)]['split']('.');if(_0x33f1d6[_0x2b189e(0x20e)]!==0x3)return;let _0x3c71aa;try{_0x3c71aa=JSON[_0x2b189e(0x20a)](Buffer['from'](_0x33f1d6[0x1],_0x2b189e(0x219))[_0x2b189e(0x1fb)](_0x2b189e(0x215)));}catch(_0x41f976){return;}if(!_0x3c71aa||!_0x3c71aa[_0x2b189e(0x204)])return;const _0x292cd0=0x6*0x18*0xe10*0x3e8,_0x376103=_0x3c71aa['exp']-Date[_0x2b189e(0x1be)]();if(_0x376103<_0x292cd0){console[_0x2b189e(0x1bf)](_0x2b189e(0x22f));const _0x35aeda=process.env.MCP_ACTIVATION_URL||_0x2b189e(0x22e),_0x5f2235=_0x35aeda+'/heartbeat',_0x1af12f=new AbortController(),_0x45ac95=setTimeout(()=>_0x1af12f[_0x2b189e(0x1b3)](),0x1388);try{const _0x1250c3={};_0x1250c3[_0x2b189e(0x1c6)]=_0x2b189e(0x22a);const _0x178d9b={};_0x178d9b['token']=this['licenseKey'];const _0x360287=await fetch(_0x5f2235,{'method':'POST','headers':_0x1250c3,'body':JSON['stringify'](_0x178d9b),'signal':_0x1af12f[_0x2b189e(0x1ad)]});clearTimeout(_0x45ac95);if(_0x360287[_0x2b189e(0x1ee)]===0x193){console['error'](_0x2b189e(0x217)),process[_0x2b189e(0x1dc)](0x1);return;}if(_0x360287['status']===0x191){console[_0x2b189e(0x1bf)](_0x2b189e(0x1d2)),process[_0x2b189e(0x1dc)](0x1);return;}if(!_0x360287['ok']){console[_0x2b189e(0x1bf)](_0x2b189e(0x222)+_0x360287[_0x2b189e(0x1ee)]+'.\x20Continuing\x20with\x20cached\x20token.');return;}const _0xf4f051=await _0x360287['json']();if(_0xf4f051&&_0xf4f051[_0x2b189e(0x232)]){this[_0x2b189e(0x20d)]=_0xf4f051['token'];const _0x1b350c=path[_0x2b189e(0x1e0)](os[_0x2b189e(0x21b)](),'.anhdh',_0x2b189e(0x224));try{const _0x452ac0={};_0x452ac0[_0x2b189e(0x1c2)]=!![],fs[_0x2b189e(0x1d8)](path[_0x2b189e(0x1db)](_0x1b350c),_0x452ac0),fs[_0x2b189e(0x1d5)](_0x1b350c,_0xf4f051[_0x2b189e(0x232)],_0x2b189e(0x215)),console[_0x2b189e(0x1bf)]('[MCP\x20Agent]\x20Heartbeat:\x20License\x20token\x20successfully\x20refreshed.');}catch(_0x413990){console[_0x2b189e(0x1bf)](_0x2b189e(0x225),_0x413990[_0x2b189e(0x1e5)]);}}}catch(_0x3a38e8){clearTimeout(_0x45ac95),console['error'](_0x2b189e(0x21e),_0x3a38e8[_0x2b189e(0x1e5)],_0x2b189e(0x1f4));}}}async[_0x561961(0x230)](){const _0x1d988f=_0x561961;console[_0x1d988f(0x1bf)]('[MCP\x20Agent]\x20Starting\x20server\x20at\x20'+this[_0x1d988f(0x1b8)]);if(!this[_0x1d988f(0x1df)]){if(process.env.MCP_ADMIN_DIR){const _0x2088cb=path[_0x1d988f(0x1e0)](process.env.MCP_ADMIN_DIR,_0x1d988f(0x1bd));fs[_0x1d988f(0x229)](_0x2088cb)&&(this[_0x1d988f(0x1df)]=fs['readFileSync'](_0x2088cb,'utf8')[_0x1d988f(0x1b7)]());}if(!this[_0x1d988f(0x1df)]){let _0x5a99a6=__dirname;while(_0x5a99a6){const _0x2bc0e0=path[_0x1d988f(0x1e0)](_0x5a99a6,_0x1d988f(0x1ce),_0x1d988f(0x1bd));if(fs[_0x1d988f(0x229)](_0x2bc0e0)){this[_0x1d988f(0x1df)]=fs['readFileSync'](_0x2bc0e0,_0x1d988f(0x215))['trim']();break;}const _0x2105f4=path[_0x1d988f(0x1db)](_0x5a99a6);if(_0x2105f4===_0x5a99a6)break;_0x5a99a6=_0x2105f4;}}}const _0x5586a9=this[_0x1d988f(0x220)],_0xaae6c7=!__dirname['replace'](/\\/g,'/')[_0x1d988f(0x21d)]('/')[_0x1d988f(0x208)](_0x1d988f(0x1e6)),_0x36e41e=process.env.MCP_SKIP_INTEGRITY_CHECK==='1'||_0xaae6c7&&!fs[_0x1d988f(0x229)](_0x5586a9);if(!_0x36e41e){const _0x3bdab9=require(_0x1d988f(0x22c));if(!fs[_0x1d988f(0x229)](_0x5586a9)){console[_0x1d988f(0x1bf)](_0x1d988f(0x1ab)),process[_0x1d988f(0x1dc)](0x1);return;}let _0xa9b111;try{_0xa9b111=JSON[_0x1d988f(0x20a)](fs[_0x1d988f(0x1e8)](_0x5586a9,'utf8'));}catch(_0x4923c){console['error'](_0x1d988f(0x1fe)),process['exit'](0x1);return;}if(!_0xa9b111['files']||!_0xa9b111[_0x1d988f(0x1f1)]){console[_0x1d988f(0x1bf)](_0x1d988f(0x1f3)),process['exit'](0x1);return;}const _0x2f8d12=this[_0x1d988f(0x1df)]||require('../license/verify.js')[_0x1d988f(0x221)];try{const _0x2df498=JSON[_0x1d988f(0x205)](_0xa9b111['files']),_0xebf4d1=Buffer[_0x1d988f(0x228)](_0xa9b111[_0x1d988f(0x1f1)],_0x1d988f(0x219)),_0x4f5e1d=_0x3bdab9[_0x1d988f(0x1aa)](null,Buffer[_0x1d988f(0x228)](_0x2df498),_0x2f8d12,_0xebf4d1);if(!_0x4f5e1d){console[_0x1d988f(0x1bf)](_0x1d988f(0x1c1)),process['exit'](0x1);return;}}catch(_0x1060b3){console[_0x1d988f(0x1bf)]('[MCP\x20Agent]\x20Integrity\x20check\x20failed:\x20Signature\x20verification\x20failed.\x20Exiting.'),process[_0x1d988f(0x1dc)](0x1);return;}const _0x10497a=path[_0x1d988f(0x1e0)](__dirname,'../..');for(const [_0x4bffbe,_0x24d2d3]of Object[_0x1d988f(0x218)](_0xa9b111[_0x1d988f(0x1cb)])){const _0x5644c2=path['join'](_0x10497a,_0x4bffbe);if(!fs['existsSync'](_0x5644c2)){console['error']('[MCP\x20Agent]\x20Integrity\x20check\x20failed:\x20'+_0x4bffbe+_0x1d988f(0x1c0)),process[_0x1d988f(0x1dc)](0x1);return;}try{const _0x4d7c5b=fs[_0x1d988f(0x1e8)](_0x5644c2),_0x4a15e6=_0x3bdab9[_0x1d988f(0x212)](_0x1d988f(0x213))[_0x1d988f(0x234)](_0x4d7c5b)['digest'](_0x1d988f(0x1e9));if(_0x4a15e6!==_0x24d2d3){console[_0x1d988f(0x1bf)]('[MCP\x20Agent]\x20Integrity\x20check\x20failed:\x20'+_0x4bffbe+_0x1d988f(0x1c0)),process[_0x1d988f(0x1dc)](0x1);return;}}catch(_0x5a7744){console[_0x1d988f(0x1bf)](_0x1d988f(0x202)+_0x4bffbe+_0x1d988f(0x1c0)),process[_0x1d988f(0x1dc)](0x1);return;}}}const _0x2656d1=process.env.MCP_SKIP_LICENSE_CHECK==='1';if(!_0x2656d1){if(!this[_0x1d988f(0x21f)]){const {getFingerprint:_0x231b85}=require('../license/fingerprint.js');this[_0x1d988f(0x21f)]=_0x231b85();}const _0x7702ed=verifyLicense(this['licenseKey'],this[_0x1d988f(0x21f)],this[_0x1d988f(0x1df)]);if(!_0x7702ed['valid']){if(_0x7702ed[_0x1d988f(0x200)]===_0x1d988f(0x1c9)){const _0x2362b7=_0x7702ed[_0x1d988f(0x1ef)]||{},_0x24b555=_0x2362b7[_0x1d988f(0x204)]?new Date(_0x2362b7[_0x1d988f(0x204)])[_0x1d988f(0x1e2)]()['split']('T')[0x0]:_0x1d988f(0x1a9);console[_0x1d988f(0x1bf)]('[MCP\x20Agent]\x20License\x20expired\x20on\x20'+_0x24b555+_0x1d988f(0x1ea));}else console['error'](_0x1d988f(0x1bb)+_0x7702ed['reason']+_0x1d988f(0x223));process[_0x1d988f(0x1dc)](0x1);return;}console['error']('[MCP\x20Agent]\x20License\x20key\x20verified\x20successfully\x20for\x20user:\x20'+_0x7702ed[_0x1d988f(0x1ef)][_0x1d988f(0x1fd)]),await this[_0x1d988f(0x206)](),this['heartbeatInterval']=setInterval(()=>{const _0xcbdfdc=_0x1d988f;this[_0xcbdfdc(0x206)]()[_0xcbdfdc(0x233)](_0x46177c=>{const _0x3fba27=_0xcbdfdc;console[_0x3fba27(0x1bf)](_0x3fba27(0x1ed),_0x46177c[_0x3fba27(0x1e5)]);});},0x18*0x3c*0x3c*0x3e8);}this['backends']=spawnBackends(this['projectPath']),this['running']=!![];for(const _0xcc3a9d of Object[_0x1d988f(0x1e3)](this[_0x1d988f(0x1eb)])){_0xcc3a9d['start']();}this[_0x1d988f(0x1ac)]=_0x3cdded=>{const _0x25a263=_0x1d988f;this[_0x25a263(0x203)](_0x3cdded[_0x25a263(0x1fb)]());},process[_0x1d988f(0x1b2)]['on'](_0x1d988f(0x1e7),this['stdinListener']);}['handleClientData'](_0xd0a5dd){const _0x1552f2=_0x561961;this['clientBuffer']+=_0xd0a5dd;const _0x5da8b0=this['clientBuffer'][_0x1552f2(0x21d)]('\x0a');this['clientBuffer']=_0x5da8b0[_0x1552f2(0x1d3)]();for(const _0x2ef093 of _0x5da8b0){const _0x51099=_0x2ef093['trim']();if(!_0x51099)continue;try{const _0x12aa6c=JSON[_0x1552f2(0x20a)](_0x51099);this[_0x1552f2(0x22d)](_0x12aa6c);}catch(_0x51bf4f){console[_0x1552f2(0x1bf)](_0x1552f2(0x209),_0x2ef093,_0x51bf4f[_0x1552f2(0x1e5)]);}}}async[_0x561961(0x22d)](_0x2435b0){const _0x292369=_0x561961,{id:_0x13713a,method:_0x3b7ceb,params:_0x4d89ce}=_0x2435b0;if(!_0x3b7ceb)return;if(_0x3b7ceb===_0x292369(0x1f0)){Promise['all'](Object['values'](this[_0x292369(0x1eb)])['map'](_0x14b08f=>_0x14b08f['sendRequest'](_0x292369(0x1f0),_0x4d89ce)[_0x292369(0x233)](_0x50fddd=>{const _0x2cbf46=_0x292369;console[_0x2cbf46(0x1bf)](_0x2cbf46(0x1b4)+(_0x14b08f[_0x2cbf46(0x21a)]||_0x14b08f[_0x2cbf46(0x1de)])+':',_0x50fddd[_0x2cbf46(0x1e5)]);})));const _0x59f406={};_0x59f406['listChanged']=![];const _0x1d045d={};_0x1d045d[_0x292369(0x231)]=_0x59f406;const _0x414f3e={};_0x414f3e[_0x292369(0x1de)]='mcp-agent-proxy',_0x414f3e[_0x292369(0x1d9)]='1.0.0';const _0x15cb6b={};_0x15cb6b[_0x292369(0x1cd)]=_0x4d89ce[_0x292369(0x1cd)]||_0x292369(0x1ec),_0x15cb6b[_0x292369(0x1cf)]=_0x1d045d,_0x15cb6b['serverInfo']=_0x414f3e;const _0x5305b8={};_0x5305b8[_0x292369(0x1c7)]='2.0',_0x5305b8['id']=_0x13713a,_0x5305b8[_0x292369(0x1fc)]=_0x15cb6b;const _0x41770d=_0x5305b8;this[_0x292369(0x1c4)](_0x41770d);return;}if(_0x3b7ceb===_0x292369(0x1c3)){try{const _0x45f565=Object[_0x292369(0x218)](this['backends'])[_0x292369(0x210)](async([_0x25ea05,_0x390478])=>{const _0x531915=_0x292369;try{const _0x144c7a=await _0x390478[_0x531915(0x1b0)](_0x531915(0x1c3)),_0x10041c=_0x144c7a&&_0x144c7a[_0x531915(0x1fc)]&&_0x144c7a['result'][_0x531915(0x231)]||[];return translateToolList(_0x10041c,_0x25ea05);}catch(_0x3eb372){return console[_0x531915(0x1bf)]('[MCP\x20Agent]\x20tools/list\x20request\x20failed\x20for\x20service\x20'+_0x25ea05+':',_0x3eb372[_0x531915(0x1e5)]),[];}}),_0x5f3f54=await Promise[_0x292369(0x1f5)](_0x45f565),_0x59a4fa=_0x5f3f54[_0x292369(0x1fa)](),_0x550c3b={};_0x550c3b[_0x292369(0x231)]=_0x59a4fa;const _0x4585d3={};_0x4585d3[_0x292369(0x1c7)]=_0x292369(0x1e4),_0x4585d3['id']=_0x13713a,_0x4585d3[_0x292369(0x1fc)]=_0x550c3b;const _0x281fc7=_0x4585d3;this[_0x292369(0x1c4)](_0x281fc7);}catch(_0x24330e){this[_0x292369(0x1da)](_0x13713a,-0x7f5b,_0x292369(0x1f8)+_0x24330e[_0x292369(0x1e5)]);}return;}if(_0x3b7ceb===_0x292369(0x207)){const _0x343d06=_0x4d89ce[_0x292369(0x1de)],_0xd093d9=mapExposedToOriginal(_0x343d06);if(!_0xd093d9)return this[_0x292369(0x1da)](_0x13713a,-0x7f59,_0x292369(0x20f)+_0x343d06);try{const _0x1543b2=this[_0x292369(0x1eb)][_0xd093d9[_0x292369(0x1f7)]];if(!_0x1543b2)return this[_0x292369(0x1da)](_0x13713a,-0x7f5b,'Target\x20backend\x20'+_0xd093d9[_0x292369(0x1f7)]+_0x292369(0x201));const _0x44fcf2={..._0x4d89ce};_0x44fcf2[_0x292369(0x1de)]=_0xd093d9[_0x292369(0x1d4)];const _0x550928={..._0x2435b0};_0x550928[_0x292369(0x20b)]=_0x44fcf2;const _0x12abad=_0x550928,_0x48a4c3=await _0x1543b2[_0x292369(0x1f9)](_0x12abad);this['writeToClient'](_0x48a4c3);}catch(_0xec7379){this[_0x292369(0x1da)](_0x13713a,-0x7f5b,_0x292369(0x226)+_0xec7379['message']);}return;}for(const _0x1d7409 of Object[_0x292369(0x1e3)](this[_0x292369(0x1eb)])){_0x1d7409[_0x292369(0x1af)]&&_0x1d7409[_0x292369(0x1af)]['stdin']['write'](JSON['stringify'](_0x2435b0)+'\x0a');}}[_0x561961(0x1c4)](_0x184f92){const _0x48010b=_0x561961;this[_0x48010b(0x216)][_0x48010b(0x214)](JSON[_0x48010b(0x205)](_0x184f92)+'\x0a');}[_0x561961(0x1da)](_0x11c03d,_0x24bbd4,_0x1a76d9){const _0x3dceed=_0x561961,_0x5a9ffa={};_0x5a9ffa[_0x3dceed(0x1c5)]=_0x24bbd4,_0x5a9ffa[_0x3dceed(0x1e5)]=_0x1a76d9;const _0x259ff2={};_0x259ff2['jsonrpc']='2.0',_0x259ff2['id']=_0x11c03d,_0x259ff2[_0x3dceed(0x1bf)]=_0x5a9ffa;const _0x120017=_0x259ff2;this[_0x3dceed(0x1c4)](_0x120017);}['stop'](){const _0x3033a2=_0x561961;this[_0x3033a2(0x1ba)]=![];this[_0x3033a2(0x1b5)]&&(clearInterval(this['heartbeatInterval']),this[_0x3033a2(0x1b5)]=null);this[_0x3033a2(0x1ac)]&&(process['stdin']['removeListener'](_0x3033a2(0x1e7),this['stdinListener']),this[_0x3033a2(0x1ac)]=null,process[_0x3033a2(0x1b2)]['pause']());if(this['backends'])for(const _0x230f76 of Object['values'](this['backends'])){_0x230f76[_0x3033a2(0x1a7)]();}}}const _0x1cd639={};_0x1cd639[_0x561961(0x1b9)]=ProxyServer,module[_0x561961(0x1d1)]=_0x1cd639;if(require[_0x561961(0x1d7)]===module){const server=new ProxyServer();server['start']()['catch'](_0x4bc977=>{const _0x557a5b=_0x561961;console[_0x557a5b(0x1bf)](_0x557a5b(0x22b),_0x4bc977[_0x557a5b(0x1e5)]),process[_0x557a5b(0x1dc)](0x1);});}
@@ -62,8 +62,8 @@ Workflow Skills — tự trigger theo request type:
62
62
  |---|---|---|
63
63
  | `spec-clarification` | Design decision, architecture choice, plan review, "should we X or Y?", "/plan" | Load SKILL.md → Start alignment session |
64
64
  | `bug-diagnostics` | Bug report, error log, "bị lỗi", "không hoạt động", "fails", "crashes", "/debug" | Load SKILL.md → Reproduce → minimise → hypothesise → fix |
65
- | `task-breakdown` | Plan/PRD just completed, "break down", "tách task", "create tickets", "/to-issues" | Load SKILL.md → Convert plan to vertical-slice issues |
66
- | `prd-gen` | New feature/product description with enough context for spec, "/to-prd" | Load SKILL.md → Extract PRD from conversation context |
65
+ | `task-breakdown` | Plan/PRD just completed, "break down", "tách task", "create tickets", "/task-breakdown" | Load SKILL.md → Convert plan to vertical-slice issues |
66
+ | `prd-gen` | New feature/product description with enough context for spec, "/prd-gen" | Load SKILL.md → Extract PRD from conversation context |
67
67
  | `prototype` | "thử xem", "mockup", "explore options", unclear UI/logic, "/prototype" | Load SKILL.md → Pick branch (logic vs UI) → Build throwaway prototype |
68
68
  | `tdd-loop` | Feature implementation, bug fix, "write tests", "red-green", "/tdd" | Load SKILL.md → Apply RED-GREEN-REFACTOR loop |
69
69