apt-mcp-agent-setup 1.2.4 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +1 -1
- package/bundle/NOTICES.md +0 -0
- package/bundle/core.enc +0 -0
- package/bundle/mcp-rules.enc +0 -0
- package/bundle/skills-aso.enc +0 -0
- package/bundle/skills-ba.enc +0 -0
- package/bundle/skills-base.enc +0 -0
- package/bundle/skills-be.enc +0 -0
- package/bundle/skills-design.enc +0 -0
- package/bundle/skills-fe.enc +0 -0
- package/bundle/skills-mobile.enc +0 -0
- package/bundle/skills-pm.enc +0 -0
- package/integrity-manifest.json +16 -16
- package/package.json +1 -1
- package/src/installer/global-setup.js +1 -1
- package/src/installer/platform-config.js +1 -1
- package/src/installer/prerequisites.js +1 -1
- package/src/installer/project-setup.js +1 -1
- package/src/installer/setup-wizard.js +1 -1
- package/src/license/crypto.js +1 -1
- package/src/license/fingerprint.js +1 -1
- package/src/license/terms.js +1 -1
- package/src/license/verify.js +1 -1
- package/src/presets/index.js +1 -1
- package/src/proxy/backends.js +1 -1
- package/src/proxy/router.config.js +1 -1
- package/src/proxy/router.js +1 -1
- package/src/proxy/server.js +1 -1
- package/src/templates/GEMINI.md +2 -2
package/src/proxy/server.js
CHANGED
|
@@ -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 _0x4849d0=_0x3a1c;(function(_0x1e3b19,_0x17c133){const _0x3be19e=_0x3a1c,_0x1add1f=_0x1e3b19();while(!![]){try{const _0x3a13c3=parseInt(_0x3be19e(0x185))/0x1*(parseInt(_0x3be19e(0x163))/0x2)+-parseInt(_0x3be19e(0xfa))/0x3+-parseInt(_0x3be19e(0x131))/0x4+-parseInt(_0x3be19e(0xfd))/0x5+parseInt(_0x3be19e(0x141))/0x6*(-parseInt(_0x3be19e(0x149))/0x7)+-parseInt(_0x3be19e(0x130))/0x8*(parseInt(_0x3be19e(0x117))/0x9)+-parseInt(_0x3be19e(0x14b))/0xa*(-parseInt(_0x3be19e(0x107))/0xb);if(_0x3a13c3===_0x17c133)break;else _0x1add1f['push'](_0x1add1f['shift']());}catch(_0x279515){_0x1add1f['push'](_0x1add1f['shift']());}}}(_0x2100,0x64275));const fs=require('fs'),path=require(_0x4849d0(0xeb)),os=require('os'),http=require(_0x4849d0(0x17e)),https=require(_0x4849d0(0x183)),{verifyLicense}=require(_0x4849d0(0xe8)),{spawnBackends}=require(_0x4849d0(0x140)),{translateToolList,mapExposedToOriginal}=require(_0x4849d0(0x11c));function httpRequest(_0x8cabab,_0x10f9c7={}){return new Promise((_0x19eaef,_0x5604dc)=>{const _0x5ea18d=_0x3a1c;try{const _0x3a04b7=new URL(_0x8cabab),_0x7c0e5d=_0x3a04b7[_0x5ea18d(0x137)]==='https:'?https:http,_0x35953c={};_0x35953c[_0x5ea18d(0xfc)]=_0x10f9c7[_0x5ea18d(0xfc)]||_0x5ea18d(0x13a),_0x35953c[_0x5ea18d(0xee)]=_0x3a04b7[_0x5ea18d(0xee)],_0x35953c[_0x5ea18d(0x15c)]=_0x3a04b7[_0x5ea18d(0x15c)]||(_0x3a04b7[_0x5ea18d(0x137)]===_0x5ea18d(0x176)?0x1bb:0x50),_0x35953c[_0x5ea18d(0xeb)]=_0x3a04b7[_0x5ea18d(0x112)]+_0x3a04b7['search'],_0x35953c['headers']=_0x10f9c7[_0x5ea18d(0xf9)]||{};const _0x44fcad=_0x35953c,_0x1093fb=_0x7c0e5d['request'](_0x44fcad,_0x1f2198=>{const _0x9ddd5e=_0x5ea18d;let _0x4393bc='';_0x1f2198['on'](_0x9ddd5e(0x179),_0x225b42=>{_0x4393bc+=_0x225b42;}),_0x1f2198['on'](_0x9ddd5e(0x182),()=>{const _0x3a5d90=_0x9ddd5e;_0x19eaef({'ok':_0x1f2198[_0x3a5d90(0x128)]>=0xc8&&_0x1f2198['statusCode']<0x12c,'status':_0x1f2198[_0x3a5d90(0x128)],'json':async()=>JSON[_0x3a5d90(0x134)](_0x4393bc),'text':async()=>_0x4393bc});});});_0x1093fb['on'](_0x5ea18d(0x124),_0x53a4b3=>{_0x5604dc(_0x53a4b3);}),_0x10f9c7['signal']&&(_0x10f9c7['signal'][_0x5ea18d(0x168)]?_0x1093fb[_0x5ea18d(0x126)](new Error(_0x5ea18d(0xff))):_0x10f9c7[_0x5ea18d(0x109)]['addEventListener'](_0x5ea18d(0x153),()=>{const _0x555223=_0x5ea18d;_0x1093fb[_0x555223(0x126)](new Error(_0x555223(0xff)));})),_0x10f9c7[_0x5ea18d(0xfb)]&&_0x1093fb[_0x5ea18d(0x125)](_0x10f9c7[_0x5ea18d(0xfb)]),_0x1093fb[_0x5ea18d(0x182)]();}catch(_0x330d1c){_0x5604dc(_0x330d1c);}});}function _0x2100(){const _0x2ef6e1=['Cgf1C2u','zw5K','Ahr0Chm','yxbWBgLJyxrPB24VANnVBG','odnPt1rSqK4','BwnWlwfNzw50lxbYB3H5','AgvHCNrIzwf0sw50zxj2ywW','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGzxHWAxjLzcbVCIbPBNzHBgLKlIbfEgL0Aw5NlG','C3rVCa','lI4VBgLJzw5Zzs92zxjPzNKUANm','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGrMfPBgvKihrVihbHCNnLigLUDgvNCML0Es1Tyw5PzMvZDc5QC29UlIbfEgL0Aw5NlG','ChjVAMvJDfbHDgG','Cgf0Aa','DxnLCG','Dg9Rzw4','Ag9ZDg5HBwu','w01ducbbz2vUDf0Gu3rHCNrPBMCGC2vYDMvYigf0ia','C3rHCNq','yMfZzty0DxjS','ChjVDg9JB2XwzxjZAw9U','Dg9VBhm','Aw5JBhvKzxm','y3jLyxrLsgfZAa','zM9YD2fYzfjLCxvLC3q','C3rKAw5mAxn0zw5LCG','igLZig5VDcbYDw5UAw5N','AgvHzgvYCW','mJq0ode5nuXbzhDjwa','yM9KEq','Bwv0Ag9K','mJq4mtuXmhvTqwnjvG','ANnVBG','vgHLig9WzxjHDgLVBIb3yxmGywjVCNrLzc4','tgLJzw5ZzsbLEhbPCMvK','zMLSzxm','yMfJA2vUza','w01ducbbz2vUDf0GsgvHCNrIzwf0oIbmAwnLBNnLihrVA2vUihn1y2nLC3nMDwXSEsbYzwzYzxnOzwqU','w01ducbbz2vUDf0GrMfPBgvKihrVigLUAxrPywXPEMuGC2vYDMLJzsa','C3rYAw5NAwz5','Ahr0Chm6lY9Hz2vUDgTPDc5HBhbOyxrLy2HZlMfPl2fWAq','mtmYqNjlq3vV','Cgf5Bg9Hza','C2LNBMfS','CNvUBMLUzW','vg9VBcbLEgvJDxrPB24GzMfPBgvKoIa','Aw5PDgLHBgL6zq','BwfPBG','mI4W','ywrTAw4','mJaYnc0Xms0Wnq','lI4VlI4','Cgf0Ag5HBwu','lMfUAgrO','zgLYBMfTzq','C2vYDMvYsw5MBW','zw50CMLLCW','ounsCxbNqW','CgvYzM9YBuHLyxj0yMvHDa','lIbdB250ywn0ihn1ChbVCNqGyxqGC3vWCg9YDebHBMHKAc5PBY4GrxHPDgLUzY4','C2LNBMf0DxjL','y3DK','lI9YB3v0zxiUANm','CMvHC29U','zxHPC3rZu3LUyW','C3rHDhvZ','CMvWBgfJzq','lIbdB250Aw51Aw5NihDPDgGGy2fJAgvKihrVA2vUlG','Dw5RBM93BG','D3jPDgvuB0nSAwvUDa','zxjYB3i','D3jPDgu','zgvZDhjVEq','rMfPBgvKihrVihf1zxj5ihrVB2WGBgLZDdOG','C3rHDhvZq29Kzq','zxHPDa','zMXHDa','CMvJDxjZAxzL','C2vUzfjLCxvLC3q','AgfUzgXLq2XPzw50twvZC2fNzq','CMvZDwX0','ig1VzgLMAwvKlIbfEgL0Aw5NlG','ndK0nJy5nNjRvfr4Aq','mZaYodaWngD1z2TrwG','ms4WlJa','rMfPBgvKihrVihn0yxj0ifbYB3H5u2vYDMvYoG','CgfYC2u','BgLJzw5Zzs5RzxK','Cg9W','ChjVDg9JB2W','C3bSAxq','w01ducbbz2vUDf0GugvYAw9KAwmGAgvHCNrIzwf0igvYCM9YoG','r0vu','yMfJA2vUzhm','D3jPDgvgAwXLu3LUyW','Dg9VBhmVy2fSBa','Agv4','w01ducbbz2vUDf0GsgvHCNrIzwf0ihjLzNjLC2GGzMfPBgvKoIbtzxj2zxiGCMv0DxjUzwqG','lI9IywnRzw5KCY5QCW','ndeXmJK0rfbqs291','Dg9VBhmVBgLZDa','w01ducbbz2vUDf0GDg9VBhmVBgLZDcbYzxf1zxn0igzHAwXLzcbMB3iGC2vYDMLJzsa','BwfZDgvYlNb1yMXPyY5Wzw0','ChvIBgLJs2v5','y2XPzw50qNvMzMvY','vgfYz2v0igjHy2TLBMqG','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOG','n3n5rwrovq','Ag9TzwrPCG','mJqWntK5mgHushDgwq','DhjPBq','zNjVBq','ANnVBNjWyW','BgvUz3rO','BM93','D3jPDgvfCNjVCG','lIbszw5LDYbHDcbODhrWCZOVl2fUAgrOlMLVl3jLBMv3lIbfEgL0Aw5NlG','ywjVCNq','BwfW','Dg9tDhjPBMC','Aw50zwDYAxr5lw1HBMLMzxn0lMPZB24','lI4VBgLJzw5Zzs9MAw5NzxjWCMLUDc5QCW','zgLZCgXHEu5HBwu','y29Kzq','AgfUzgXLq2XPzw50rgf0yq','zgv2AwnLswq','Cg9YDa','BwvZC2fNzq','w01ducbbz2vUDf0GrMfPBgvKihrVihbHCNnLiePtt04TuLbdig1LC3nHz2uGzNjVBsbJBgLLBNq6','DMfSAwq','BMfTzq','zxHW','CMvTB3zLtgLZDgvUzxi','nJCZmefjBwrerG','l2HLyxj0yMvHDa','BgLJzw5ZzuTLEq','B3jPz2LUywXoyw1L','CMvHzezPBgvtEw5J','ywjVCNrLza','C3rKB3v0','y3j5ChrV','zxHWB3j0CW','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGsw52ywXPzcbTyw5PzMvZDcbMB3jTyxqUiev4AxrPBMCU','DMfSDwvZ','q29UDgvUDc1uExbL','uhjVEhLtzxj2zxi','w01ducbbz2vUDf0GsgvHCNrIzwf0ignOzwnRigzHAwXLzcbVCIb0Aw1LzcbVDxq6','Aw50zwDYAxr5twfUAwzLC3rqyxrO','vg9VBcbUB3qGzM91BMq6ia','DxrMoa','C2HHmJu2','AM9PBG','Ahr0Chm6','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGsw52ywXPzcbZAwDUyxr1CMuUiev4AxrPBMCU','Bg9HzeXPy2vUC2vlzxK','zgf0yq','BwTKAxjtEw5J','DMvYAwz5','C3rKAw4','ue9tva','Ahr0Ca','y2f0y2G','y2HPBgq'];_0x2100=function(){return _0x2ef6e1;};return _0x2100();}function _0x3a1c(_0x5a424b,_0x4fd05e){_0x5a424b=_0x5a424b-0xe7;const _0x2100d7=_0x2100();let _0x3a1cf4=_0x2100d7[_0x5a424b];if(_0x3a1c['hBAGvu']===undefined){var _0x5d829c=function(_0x108521){const _0x3ed607='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2333fe='',_0x3446f2='';for(let _0x36afb0=0x0,_0x599931,_0x34713d,_0x3cb618=0x0;_0x34713d=_0x108521['charAt'](_0x3cb618++);~_0x34713d&&(_0x599931=_0x36afb0%0x4?_0x599931*0x40+_0x34713d:_0x34713d,_0x36afb0++%0x4)?_0x2333fe+=String['fromCharCode'](0xff&_0x599931>>(-0x2*_0x36afb0&0x6)):0x0){_0x34713d=_0x3ed607['indexOf'](_0x34713d);}for(let _0x5416f3=0x0,_0x55e002=_0x2333fe['length'];_0x5416f3<_0x55e002;_0x5416f3++){_0x3446f2+='%'+('00'+_0x2333fe['charCodeAt'](_0x5416f3)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3446f2);};_0x3a1c['xPRFka']=_0x5d829c,_0x3a1c['IduVuA']={},_0x3a1c['hBAGvu']=!![];}const _0x5dc7d8=_0x2100d7[0x0],_0x2f752b=_0x5a424b+_0x5dc7d8,_0x4712e8=_0x3a1c['IduVuA'][_0x2f752b];return!_0x4712e8?(_0x3a1cf4=_0x3a1c['xPRFka'](_0x3a1cf4),_0x3a1c['IduVuA'][_0x2f752b]=_0x3a1cf4):_0x3a1cf4=_0x4712e8,_0x3a1cf4;}class ProxyServer{constructor(_0x5b94c8={}){const _0x18219a=_0x4849d0;this[_0x18219a(0xea)]=_0x5b94c8['projectPath']||process[_0x18219a(0x11b)](),this['licenseKey']=_0x5b94c8['licenseKey']||this[_0x18219a(0x178)](),this['deviceId']=_0x5b94c8['deviceId'],this[_0x18219a(0x145)]=_0x5b94c8[_0x18219a(0x145)]||_0x5b94c8['masterSecret'],this[_0x18219a(0x13b)]=null,this[_0x18219a(0x146)]='',this[_0x18219a(0x10a)]=![],this[_0x18219a(0x169)]=_0x5b94c8[_0x18219a(0x169)]||process[_0x18219a(0x169)],this[_0x18219a(0x171)]=_0x5b94c8['integrityManifestPath']||path['join'](__dirname,_0x18219a(0x111),_0x18219a(0x156));}[_0x4849d0(0x178)](){const _0x225488=_0x4849d0,_0x48bf7c=path[_0x225488(0x175)](os[_0x225488(0x14a)](),_0x225488(0x113),'license.key');if(fs['existsSync'](_0x48bf7c))return fs[_0x225488(0x167)](_0x48bf7c,_0x225488(0x173))['trim']();return null;}async[_0x4849d0(0x118)](){const _0x361a8d=_0x4849d0,_0x33645b=process.env.MCP_SKIP_LICENSE_CHECK==='1';if(_0x33645b||!this[_0x361a8d(0x165)])return;const _0xbaaf4c=this[_0x361a8d(0x165)][_0x361a8d(0x138)]('.');if(_0xbaaf4c[_0x361a8d(0x14f)]!==0x3)return;let _0x2456ef;try{_0x2456ef=JSON['parse'](Buffer[_0x361a8d(0x14d)](_0xbaaf4c[0x1],_0x361a8d(0xf1))[_0x361a8d(0x155)]('utf8'));}catch(_0x49f8a0){return;}if(!_0x2456ef||!_0x2456ef[_0x361a8d(0x161)])return;const _0x3f9842=0x6*0x18*0xe10*0x3e8,_0x51287e=_0x2456ef[_0x361a8d(0x161)]-Date[_0x361a8d(0x150)]();if(_0x51287e<_0x3f9842){console[_0x361a8d(0x124)]('[MCP\x20Agent]\x20Heartbeat\x20check:\x20token\x20has\x20less\x20than\x206\x20days\x20remaining.\x20Refreshing...');const _0x417315=process.env.MCP_ACTIVATION_URL||_0x361a8d(0x106),_0x1f362f=_0x417315+_0x361a8d(0x164),_0x560f61=new AbortController(),_0x15be79=setTimeout(()=>_0x560f61['abort'](),0x1388);try{const _0x1a131d={};_0x1a131d[_0x361a8d(0x16e)]=_0x361a8d(0x184);const _0x4dbb2d={};_0x4dbb2d['token']=this['licenseKey'];const _0x2086e1=await httpRequest(_0x1f362f,{'method':_0x361a8d(0x17d),'headers':_0x1a131d,'body':JSON[_0x361a8d(0x105)](_0x4dbb2d),'signal':_0x560f61[_0x361a8d(0x109)]});clearTimeout(_0x15be79);if(_0x2086e1[_0x361a8d(0x11f)]===0x193){console[_0x361a8d(0x124)]('[MCP\x20Agent]\x20License\x20key\x20has\x20been\x20revoked.\x20Exiting.'),process[_0x361a8d(0x129)](0x1);return;}if(_0x2086e1[_0x361a8d(0x11f)]===0x191){console[_0x361a8d(0x124)](_0x361a8d(0x188)),process[_0x361a8d(0x129)](0x1);return;}if(!_0x2086e1['ok']){console['error'](_0x361a8d(0x13f)+_0x2086e1['status']+'.\x20Continuing\x20with\x20cached\x20token.');return;}const _0x46ee11=await _0x2086e1[_0x361a8d(0xfe)]();if(_0x46ee11&&_0x46ee11['token']){this['licenseKey']=_0x46ee11[_0x361a8d(0xed)];const _0x29ca25=path[_0x361a8d(0x175)](os[_0x361a8d(0x14a)](),_0x361a8d(0x113),_0x361a8d(0x135));try{const _0x35aec0={};_0x35aec0[_0x361a8d(0x12b)]=!![],fs[_0x361a8d(0x17a)](path[_0x361a8d(0x114)](_0x29ca25),_0x35aec0),fs[_0x361a8d(0x13c)](_0x29ca25,_0x46ee11['token'],_0x361a8d(0x173)),console['error'](_0x361a8d(0x103));}catch(_0x3dbf50){console[_0x361a8d(0x124)]('[MCP\x20Agent]\x20Failed\x20to\x20save\x20refreshed\x20license\x20token\x20to\x20disk:',_0x3dbf50['message']);}}}catch(_0x4767ec){clearTimeout(_0x15be79),console[_0x361a8d(0x124)](_0x361a8d(0x170),_0x4767ec[_0x361a8d(0x15d)],_0x361a8d(0x121));}}}async[_0x4849d0(0xf0)](){const _0x3650c6=_0x4849d0;console['error'](_0x3650c6(0xef)+this[_0x3650c6(0xea)]);if(!this[_0x3650c6(0x145)]){if(process.env.MCP_ADMIN_DIR){const _0xd4b21e=path[_0x3650c6(0x175)](process.env.MCP_ADMIN_DIR,_0x3650c6(0x144));fs['existsSync'](_0xd4b21e)&&(this[_0x3650c6(0x145)]=fs[_0x3650c6(0x167)](_0xd4b21e,_0x3650c6(0x173))[_0x3650c6(0x14c)]());}if(!this[_0x3650c6(0x145)]){let _0x2997a4=__dirname;while(_0x2997a4){const _0x7a64f3=path[_0x3650c6(0x175)](_0x2997a4,_0x3650c6(0x10f),_0x3650c6(0x144));if(fs[_0x3650c6(0x11e)](_0x7a64f3)){this[_0x3650c6(0x145)]=fs['readFileSync'](_0x7a64f3,_0x3650c6(0x173))[_0x3650c6(0x14c)]();break;}const _0x24c726=path[_0x3650c6(0x114)](_0x2997a4);if(_0x24c726===_0x2997a4)break;_0x2997a4=_0x24c726;}}}const _0x5a5b03=this[_0x3650c6(0x171)],_0x5081bc=!__dirname[_0x3650c6(0x120)](/\\/g,'/')[_0x3650c6(0x138)]('/')[_0x3650c6(0xf4)]('dist'),_0x58c6f2=process.env.MCP_SKIP_INTEGRITY_CHECK==='1'||_0x5081bc&&!fs[_0x3650c6(0x11e)](_0x5a5b03);if(!_0x58c6f2){const _0x5b8f70=require(_0x3650c6(0x16a));if(!fs['existsSync'](_0x5a5b03)){console['error']('[MCP\x20Agent]\x20Integrity\x20check\x20failed:\x20integrity-manifest.json\x20missing.\x20Exiting.'),process[_0x3650c6(0x129)](0x1);return;}let _0xd6e9f;try{_0xd6e9f=JSON[_0x3650c6(0x134)](fs[_0x3650c6(0x167)](_0x5a5b03,_0x3650c6(0x173)));}catch(_0x2a6e9a){console['error'](_0x3650c6(0xe9)),process['exit'](0x1);return;}if(!_0xd6e9f[_0x3650c6(0x101)]||!_0xd6e9f[_0x3650c6(0x11a)]){console[_0x3650c6(0x124)](_0x3650c6(0x16c)),process[_0x3650c6(0x129)](0x1);return;}const _0x4ae84c=this[_0x3650c6(0x145)]||require('../license/verify.js')['PRODUCTION_PUBLIC_KEY'];try{const _0x3974f2=JSON['stringify'](_0xd6e9f[_0x3650c6(0x101)]),_0x26b90f=Buffer[_0x3650c6(0x14d)](_0xd6e9f[_0x3650c6(0x11a)],_0x3650c6(0xf1)),_0x3aea2f=_0x5b8f70[_0x3650c6(0x17b)](null,Buffer[_0x3650c6(0x14d)](_0x3974f2),_0x4ae84c,_0x26b90f);if(!_0x3aea2f){console[_0x3650c6(0x124)](_0x3650c6(0x177)),process[_0x3650c6(0x129)](0x1);return;}}catch(_0x479ee9){console[_0x3650c6(0x124)]('[MCP\x20Agent]\x20Integrity\x20check\x20failed:\x20Signature\x20verification\x20failed.\x20Exiting.'),process[_0x3650c6(0x129)](0x1);return;}const _0x219b8d=path[_0x3650c6(0x175)](__dirname,_0x3650c6(0x111));for(const [_0xf7b594,_0x30409c]of Object[_0x3650c6(0x116)](_0xd6e9f['files'])){const _0x3928a3=path[_0x3650c6(0x175)](_0x219b8d,_0xf7b594);if(!fs[_0x3650c6(0x11e)](_0x3928a3)){console[_0x3650c6(0x124)]('[MCP\x20Agent]\x20Integrity\x20check\x20failed:\x20'+_0xf7b594+_0x3650c6(0x12f)),process[_0x3650c6(0x129)](0x1);return;}try{const _0x3a4578=fs[_0x3650c6(0x167)](_0x3928a3),_0x137fa5=_0x5b8f70[_0x3650c6(0xf5)](_0x3650c6(0x174))['update'](_0x3a4578)['digest'](_0x3650c6(0x13e));if(_0x137fa5!==_0x30409c){console['error'](_0x3650c6(0x148)+_0xf7b594+'\x20modified.\x20Exiting.'),process[_0x3650c6(0x129)](0x1);return;}}catch(_0x4fbcd8){console['error'](_0x3650c6(0x148)+_0xf7b594+_0x3650c6(0x12f)),process['exit'](0x1);return;}}}const _0x2917a3=process.env.MCP_SKIP_LICENSE_CHECK==='1';if(!_0x2917a3){if(!this['deviceId']){const {getFingerprint:_0x21ed6c}=require(_0x3650c6(0x157));this[_0x3650c6(0x15b)]=_0x21ed6c();}const _0x291d90=verifyLicense(this[_0x3650c6(0x165)],this[_0x3650c6(0x15b)],this['publicKey']);if(!_0x291d90[_0x3650c6(0x15f)]){if(_0x291d90[_0x3650c6(0x11d)]===_0x3650c6(0x100)){const _0x49bf55=_0x291d90[_0x3650c6(0x108)]||{},_0xd3576f=_0x49bf55['exp']?new Date(_0x49bf55[_0x3650c6(0x161)])['toISOString']()[_0x3650c6(0x138)]('T')[0x0]:_0x3650c6(0x122);console['error']('[MCP\x20Agent]\x20License\x20expired\x20on\x20'+_0xd3576f+_0x3650c6(0x152));}else console['error']('[MCP\x20Agent]\x20License\x20key\x20verification\x20failed:\x20'+_0x291d90[_0x3650c6(0x11d)]+_0x3650c6(0x119));process[_0x3650c6(0x129)](0x1);return;}console[_0x3650c6(0x124)]('[MCP\x20Agent]\x20License\x20key\x20verified\x20successfully\x20for\x20user:\x20'+_0x291d90[_0x3650c6(0x108)][_0x3650c6(0xec)]),await this[_0x3650c6(0x118)](),this['heartbeatInterval']=setInterval(()=>{const _0x292768=_0x3650c6;this[_0x292768(0x118)]()[_0x292768(0x17f)](_0x78f9cb=>{const _0x3750da=_0x292768;console[_0x3750da(0x124)](_0x3750da(0x139),_0x78f9cb[_0x3750da(0x15d)]);});},0x18*0x3c*0x3c*0x3e8);}this[_0x3650c6(0x13b)]=spawnBackends(this[_0x3650c6(0xea)]),this[_0x3650c6(0x10a)]=!![];for(const _0x3049cb of Object[_0x3650c6(0x16d)](this[_0x3650c6(0x13b)])){_0x3049cb['start']();}this[_0x3650c6(0xf7)]=_0x51e3c1=>{const _0xe4768d=_0x3650c6;this[_0xe4768d(0x15a)](_0x51e3c1['toString']());},process['stdin']['on'](_0x3650c6(0x179),this['stdinListener']);}[_0x4849d0(0x15a)](_0x5bdb99){const _0x1eba5f=_0x4849d0;this[_0x1eba5f(0x146)]+=_0x5bdb99;const _0x41f15a=this[_0x1eba5f(0x146)][_0x1eba5f(0x138)]('\x0a');this['clientBuffer']=_0x41f15a[_0x1eba5f(0x136)]();for(const _0x10f2e9 of _0x41f15a){const _0x5f0319=_0x10f2e9[_0x1eba5f(0x14c)]();if(!_0x5f0319)continue;try{const _0x134663=JSON[_0x1eba5f(0x134)](_0x5f0319);this[_0x1eba5f(0x12d)](_0x134663);}catch(_0x8ebc92){console[_0x1eba5f(0x124)](_0x1eba5f(0x15e),_0x10f2e9,_0x8ebc92[_0x1eba5f(0x15d)]);}}}async['handleClientMessage'](_0x38a312){const _0x341f84=_0x4849d0,{id:_0x4546a3,method:_0x6d0f5a,params:_0x1da452}=_0x38a312;if(!_0x6d0f5a)return;if(_0x6d0f5a==='initialize'){Promise['all'](Object[_0x341f84(0x16d)](this[_0x341f84(0x13b)])[_0x341f84(0x154)](_0x5b8d42=>_0x5b8d42[_0x341f84(0x12c)](_0x341f84(0x10c),_0x1da452)['catch'](_0x160266=>{const _0x4d7f55=_0x341f84;console[_0x4d7f55(0x124)](_0x4d7f55(0x104)+(_0x5b8d42[_0x4d7f55(0x158)]||_0x5b8d42[_0x4d7f55(0x160)])+':',_0x160266['message']);})));const _0x39bbb1={};_0x39bbb1['listChanged']=![];const _0x4a3f9b={};_0x4a3f9b[_0x341f84(0xf3)]=_0x39bbb1;const _0x494a33={};_0x494a33[_0x341f84(0x160)]=_0x341f84(0x186),_0x494a33['version']=_0x341f84(0x132);const _0x9e68f1={};_0x9e68f1[_0x341f84(0xf2)]=_0x1da452[_0x341f84(0xf2)]||_0x341f84(0x110),_0x9e68f1['capabilities']=_0x4a3f9b,_0x9e68f1[_0x341f84(0x115)]=_0x494a33;const _0x51795c={};_0x51795c[_0x341f84(0x14e)]='2.0',_0x51795c['id']=_0x4546a3,_0x51795c['result']=_0x9e68f1;const _0x4686c3=_0x51795c;this[_0x341f84(0x123)](_0x4686c3);return;}if(_0x6d0f5a===_0x341f84(0x142)){try{const _0x912ca4=Object[_0x341f84(0x116)](this[_0x341f84(0x13b)])[_0x341f84(0x154)](async([_0x460860,_0x3e8c1f])=>{const _0x4e693c=_0x341f84;try{const _0x489010=await _0x3e8c1f[_0x4e693c(0x12c)](_0x4e693c(0x142)),_0x5b5acd=_0x489010&&_0x489010[_0x4e693c(0x12e)]&&_0x489010[_0x4e693c(0x12e)][_0x4e693c(0xf3)]||[];return translateToolList(_0x5b5acd,_0x460860);}catch(_0x1b6b9f){return console[_0x4e693c(0x124)](_0x4e693c(0x143)+_0x460860+':',_0x1b6b9f[_0x4e693c(0x15d)]),[];}}),_0x615ab7=await Promise['all'](_0x912ca4),_0x5e0268=_0x615ab7[_0x341f84(0x12a)](),_0x1df1cd={};_0x1df1cd[_0x341f84(0xf3)]=_0x5e0268;const _0x5b356a={};_0x5b356a[_0x341f84(0x14e)]=_0x341f84(0x10e),_0x5b356a['id']=_0x4546a3,_0x5b356a['result']=_0x1df1cd;const _0x30aaca=_0x5b356a;this['writeToClient'](_0x30aaca);}catch(_0x2535fa){this['writeError'](_0x4546a3,-0x7f5b,_0x341f84(0x127)+_0x2535fa[_0x341f84(0x15d)]);}return;}if(_0x6d0f5a===_0x341f84(0x13d)){const _0x1cf961=_0x1da452[_0x341f84(0x160)],_0x522490=mapExposedToOriginal(_0x1cf961);if(!_0x522490)return this[_0x341f84(0x151)](_0x4546a3,-0x7f59,_0x341f84(0x172)+_0x1cf961);try{const _0x5ecb70=this[_0x341f84(0x13b)][_0x522490[_0x341f84(0x102)]];if(!_0x5ecb70)return this[_0x341f84(0x151)](_0x4546a3,-0x7f5b,_0x341f84(0x147)+_0x522490[_0x341f84(0x102)]+_0x341f84(0xf8));const _0x37959d={..._0x1da452};_0x37959d[_0x341f84(0x160)]=_0x522490[_0x341f84(0x166)];const _0x281ef5={..._0x38a312};_0x281ef5['params']=_0x37959d;const _0x1d53fa=_0x281ef5,_0x25b0e2=await _0x5ecb70[_0x341f84(0xf6)](_0x1d53fa);this[_0x341f84(0x123)](_0x25b0e2);}catch(_0x85bc26){this[_0x341f84(0x151)](_0x4546a3,-0x7f5b,_0x341f84(0x10b)+_0x85bc26[_0x341f84(0x15d)]);}return;}for(const _0x5f4054 of Object[_0x341f84(0x16d)](this['backends'])){_0x5f4054[_0x341f84(0x180)]&&_0x5f4054[_0x341f84(0x180)]['stdin'][_0x341f84(0x125)](JSON[_0x341f84(0x105)](_0x38a312)+'\x0a');}}[_0x4849d0(0x123)](_0x32ef44){const _0x340eca=_0x4849d0;this[_0x340eca(0x169)][_0x340eca(0x125)](JSON['stringify'](_0x32ef44)+'\x0a');}[_0x4849d0(0x151)](_0x1b76a8,_0x79e472,_0x49dfef){const _0x1f7108=_0x4849d0,_0x4c59ca={};_0x4c59ca[_0x1f7108(0x159)]=_0x79e472,_0x4c59ca[_0x1f7108(0x15d)]=_0x49dfef;const _0x3e923e={};_0x3e923e[_0x1f7108(0x14e)]='2.0',_0x3e923e['id']=_0x1b76a8,_0x3e923e['error']=_0x4c59ca;const _0x3d4e98=_0x3e923e;this[_0x1f7108(0x123)](_0x3d4e98);}['stop'](){const _0x444083=_0x4849d0;this['running']=![];this[_0x444083(0x187)]&&(clearInterval(this[_0x444083(0x187)]),this[_0x444083(0x187)]=null);this['stdinListener']&&(process[_0x444083(0x17c)][_0x444083(0x162)](_0x444083(0x179),this[_0x444083(0xf7)]),this[_0x444083(0xf7)]=null,process[_0x444083(0x17c)][_0x444083(0x181)]());if(this[_0x444083(0x13b)])for(const _0x1ea77f of Object[_0x444083(0x16d)](this[_0x444083(0x13b)])){_0x1ea77f[_0x444083(0xe7)]();}}}const _0x4c9c84={};_0x4c9c84[_0x4849d0(0x16f)]=ProxyServer,module[_0x4849d0(0x16b)]=_0x4c9c84;if(require[_0x4849d0(0x10d)]===module){const server=new ProxyServer();server[_0x4849d0(0xf0)]()[_0x4849d0(0x17f)](_0x389c8a=>{const _0x3ff5eb=_0x4849d0;console[_0x3ff5eb(0x124)](_0x3ff5eb(0x133),_0x389c8a[_0x3ff5eb(0x15d)]),process[_0x3ff5eb(0x129)](0x1);});}
|
package/src/templates/GEMINI.md
CHANGED
|
@@ -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", "/
|
|
66
|
-
| `prd-gen` | New feature/product description with enough context for spec, "/
|
|
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
|
|