apt-mcp-agent-setup 1.2.18 β 1.2.20
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/CLAUDE.md +11 -0
- package/src/templates/GEMINI.md +11 -0
- package/src/templates/copilot-instructions.md +12 -0
- package/src/templates/cursorrules.mdc +12 -0
- package/src/templates/windsurfrules.md +12 -0
package/src/proxy/server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x184d(_0x12f72f,_0x1ddea4){_0x12f72f=_0x12f72f-0x1df;const _0x3a020e=_0x3a02();let _0x184d1a=_0x3a020e[_0x12f72f];if(_0x184d['bmnmuw']===undefined){var _0x16489a=function(_0x3fd368){const _0x4fc60b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x57b9fb='',_0x6018a5='';for(let _0x2eecea=0x0,_0x331696,_0x3c751f,_0x557356=0x0;_0x3c751f=_0x3fd368['charAt'](_0x557356++);~_0x3c751f&&(_0x331696=_0x2eecea%0x4?_0x331696*0x40+_0x3c751f:_0x3c751f,_0x2eecea++%0x4)?_0x57b9fb+=String['fromCharCode'](0xff&_0x331696>>(-0x2*_0x2eecea&0x6)):0x0){_0x3c751f=_0x4fc60b['indexOf'](_0x3c751f);}for(let _0x5932d3=0x0,_0x3bc6f7=_0x57b9fb['length'];_0x5932d3<_0x3bc6f7;_0x5932d3++){_0x6018a5+='%'+('00'+_0x57b9fb['charCodeAt'](_0x5932d3)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x6018a5);};_0x184d['FEOqZd']=_0x16489a,_0x184d['teKfOH']={},_0x184d['bmnmuw']=!![];}const _0x294fc4=_0x3a020e[0x0],_0x2d6d9f=_0x12f72f+_0x294fc4,_0x3a9b22=_0x184d['teKfOH'][_0x2d6d9f];return!_0x3a9b22?(_0x184d1a=_0x184d['FEOqZd'](_0x184d1a),_0x184d['teKfOH'][_0x2d6d9f]=_0x184d1a):_0x184d1a=_0x3a9b22,_0x184d1a;}const _0x22ccd5=_0x184d;(function(_0x44792c,_0x7ffdb7){const _0x3c0bd1=_0x184d,_0x2e6526=_0x44792c();while(!![]){try{const _0x5ebbd4=-parseInt(_0x3c0bd1(0x260))/0x1+-parseInt(_0x3c0bd1(0x27e))/0x2*(-parseInt(_0x3c0bd1(0x269))/0x3)+-parseInt(_0x3c0bd1(0x26d))/0x4+parseInt(_0x3c0bd1(0x27c))/0x5*(parseInt(_0x3c0bd1(0x206))/0x6)+parseInt(_0x3c0bd1(0x1eb))/0x7+parseInt(_0x3c0bd1(0x1df))/0x8*(-parseInt(_0x3c0bd1(0x225))/0x9)+-parseInt(_0x3c0bd1(0x256))/0xa*(-parseInt(_0x3c0bd1(0x1fa))/0xb);if(_0x5ebbd4===_0x7ffdb7)break;else _0x2e6526['push'](_0x2e6526['shift']());}catch(_0x5c5ae8){_0x2e6526['push'](_0x2e6526['shift']());}}}(_0x3a02,0xbe0d3));const fs=require('fs'),path=require(_0x22ccd5(0x220)),os=require('os'),http=require('http'),https=require(_0x22ccd5(0x236)),{verifyLicense}=require(_0x22ccd5(0x27a)),{spawnBackends}=require(_0x22ccd5(0x237)),{translateToolList,mapExposedToOriginal}=require(_0x22ccd5(0x26f));function httpRequest(_0x4e19cd,_0x22d9a4={}){return new Promise((_0x1a56cd,_0x3c1bca)=>{const _0x22d0fd=_0x184d;try{const _0x1f61b8=new URL(_0x4e19cd),_0x42995f=_0x1f61b8[_0x22d0fd(0x227)]===_0x22d0fd(0x1f4)?https:http,_0x49cc41={'User-Agent':'Mozilla/5.0\x20(compatible;\x20Node/'+process[_0x22d0fd(0x261)]+')',..._0x22d9a4['headers']},_0x4dacd1=_0x49cc41;if(_0x22d9a4[_0x22d0fd(0x23e)]){const _0x4adfe5=typeof _0x22d9a4[_0x22d0fd(0x23e)]===_0x22d0fd(0x226)?_0x22d9a4[_0x22d0fd(0x23e)]:JSON[_0x22d0fd(0x209)](_0x22d9a4[_0x22d0fd(0x23e)]);!_0x4dacd1[_0x22d0fd(0x1e4)]&&!_0x4dacd1[_0x22d0fd(0x234)]&&(_0x4dacd1['Content-Length']=Buffer[_0x22d0fd(0x202)](_0x4adfe5));}const _0x24b630={};_0x24b630[_0x22d0fd(0x211)]=_0x22d9a4['method']||_0x22d0fd(0x1fc),_0x24b630[_0x22d0fd(0x23a)]=_0x1f61b8[_0x22d0fd(0x23a)],_0x24b630[_0x22d0fd(0x21c)]=_0x1f61b8[_0x22d0fd(0x21c)]||(_0x1f61b8[_0x22d0fd(0x227)]===_0x22d0fd(0x1f4)?0x1bb:0x50),_0x24b630[_0x22d0fd(0x220)]=_0x1f61b8[_0x22d0fd(0x27f)]+_0x1f61b8[_0x22d0fd(0x246)],_0x24b630[_0x22d0fd(0x1f5)]=_0x4dacd1;const _0x11d020=_0x24b630,_0x3df841=_0x42995f[_0x22d0fd(0x222)](_0x11d020,_0x2286ba=>{const _0x19a9c2=_0x22d0fd;let _0x3c06b9='';_0x2286ba['on'](_0x19a9c2(0x255),_0x54f6ed=>{_0x3c06b9+=_0x54f6ed;}),_0x2286ba['on'](_0x19a9c2(0x259),()=>{const _0x267bc2=_0x19a9c2;_0x1a56cd({'ok':_0x2286ba[_0x267bc2(0x1ff)]>=0xc8&&_0x2286ba[_0x267bc2(0x1ff)]<0x12c,'status':_0x2286ba[_0x267bc2(0x1ff)],'json':async()=>JSON['parse'](_0x3c06b9),'text':async()=>_0x3c06b9});});});_0x3df841['on']('error',_0x3d4369=>{_0x3c1bca(_0x3d4369);}),_0x22d9a4['signal']&&(_0x22d9a4[_0x22d0fd(0x270)][_0x22d0fd(0x26a)]?_0x3df841[_0x22d0fd(0x1ef)](new Error('The\x20operation\x20was\x20aborted.')):_0x22d9a4['signal'][_0x22d0fd(0x23d)]('abort',()=>{const _0x328e32=_0x22d0fd;_0x3df841['destroy'](new Error(_0x328e32(0x25b)));})),_0x22d9a4[_0x22d0fd(0x23e)]&&_0x3df841['write'](_0x22d9a4[_0x22d0fd(0x23e)]),_0x3df841[_0x22d0fd(0x259)]();}catch(_0x37d9c9){_0x3c1bca(_0x37d9c9);}});}class ProxyServer{constructor(_0x3e9ba5={}){const _0x2eeaef=_0x22ccd5;this[_0x2eeaef(0x203)]=_0x3e9ba5[_0x2eeaef(0x203)]||process[_0x2eeaef(0x20f)](),this[_0x2eeaef(0x223)]=_0x3e9ba5[_0x2eeaef(0x223)]||this['loadLicenseKey'](),this[_0x2eeaef(0x210)]=_0x3e9ba5[_0x2eeaef(0x210)],this[_0x2eeaef(0x25d)]=_0x3e9ba5[_0x2eeaef(0x25d)]||_0x3e9ba5['masterSecret'],this[_0x2eeaef(0x1f7)]=null,this['clientBuffer']='',this['running']=![],this[_0x2eeaef(0x262)]=_0x3e9ba5[_0x2eeaef(0x262)]||process[_0x2eeaef(0x262)],this[_0x2eeaef(0x271)]=_0x3e9ba5['integrityManifestPath']||path['join'](__dirname,_0x2eeaef(0x278),_0x2eeaef(0x1ed));}[_0x22ccd5(0x25e)](){const _0x18d5f2=_0x22ccd5,_0x52eb5a=path[_0x18d5f2(0x243)](os[_0x18d5f2(0x281)](),_0x18d5f2(0x1f1),_0x18d5f2(0x1f8));if(fs['existsSync'](_0x52eb5a))return fs[_0x18d5f2(0x267)](_0x52eb5a,_0x18d5f2(0x22a))['trim']();return null;}async['performHeartbeat'](){const _0x5f0a47=_0x22ccd5,_0x180d72=process.env.MCP_SKIP_LICENSE_CHECK==='1';if(_0x180d72||!this[_0x5f0a47(0x223)])return;const _0x4db736=this[_0x5f0a47(0x223)]['split']('.');if(_0x4db736['length']!==0x3)return;let _0x4dbf8e;try{_0x4dbf8e=JSON[_0x5f0a47(0x25f)](Buffer[_0x5f0a47(0x264)](_0x4db736[0x1],_0x5f0a47(0x1f3))[_0x5f0a47(0x208)](_0x5f0a47(0x22a)));}catch(_0x1ab36e){return;}if(!_0x4dbf8e||!_0x4dbf8e[_0x5f0a47(0x21a)])return;const _0x5bf21f=0x6*0x18*0xe10*0x3e8,_0x20782e=_0x4dbf8e[_0x5f0a47(0x21a)]-Date['now']();if(_0x20782e<_0x5bf21f){console[_0x5f0a47(0x218)](_0x5f0a47(0x22f));const _0x1276f1=process.env.MCP_ACTIVATION_URL||_0x5f0a47(0x25c),_0x5eff2b=_0x1276f1+'/heartbeat',_0x43b3bb=new AbortController(),_0x1b842b=setTimeout(()=>_0x43b3bb['abort'](),0x1388);try{const _0x379e4d={};_0x379e4d[_0x5f0a47(0x21b)]=_0x5f0a47(0x219);const _0x3f08ab={};_0x3f08ab[_0x5f0a47(0x1f2)]=this[_0x5f0a47(0x223)];const _0x66ca8b=await httpRequest(_0x5eff2b,{'method':_0x5f0a47(0x266),'headers':_0x379e4d,'body':JSON[_0x5f0a47(0x209)](_0x3f08ab),'signal':_0x43b3bb[_0x5f0a47(0x270)]});clearTimeout(_0x1b842b);if(_0x66ca8b[_0x5f0a47(0x274)]===0x193){console[_0x5f0a47(0x218)]('[MCP\x20Agent]\x20License\x20key\x20has\x20been\x20revoked.\x20Exiting.'),process[_0x5f0a47(0x23f)](0x1);return;}if(_0x66ca8b[_0x5f0a47(0x274)]===0x191){console[_0x5f0a47(0x218)](_0x5f0a47(0x241)),process[_0x5f0a47(0x23f)](0x1);return;}if(!_0x66ca8b['ok']){console[_0x5f0a47(0x218)](_0x5f0a47(0x221)+_0x66ca8b[_0x5f0a47(0x274)]+'.\x20Continuing\x20with\x20cached\x20token.');return;}const _0x48d229=await _0x66ca8b[_0x5f0a47(0x212)]();if(_0x48d229&&_0x48d229['token']){this[_0x5f0a47(0x223)]=_0x48d229[_0x5f0a47(0x1f2)];const _0x49589b=path['join'](os[_0x5f0a47(0x281)](),'.anhdh',_0x5f0a47(0x1f8));try{const _0x311430={};_0x311430[_0x5f0a47(0x273)]=!![],fs[_0x5f0a47(0x229)](path[_0x5f0a47(0x21f)](_0x49589b),_0x311430),fs['writeFileSync'](_0x49589b,_0x48d229[_0x5f0a47(0x1f2)],_0x5f0a47(0x22a)),console[_0x5f0a47(0x218)](_0x5f0a47(0x215));}catch(_0x456f84){console[_0x5f0a47(0x218)]('[MCP\x20Agent]\x20Failed\x20to\x20save\x20refreshed\x20license\x20token\x20to\x20disk:',_0x456f84['message']);}}}catch(_0x49e289){clearTimeout(_0x1b842b),console[_0x5f0a47(0x218)](_0x5f0a47(0x216),_0x49e289[_0x5f0a47(0x239)],_0x5f0a47(0x233));}}}async[_0x22ccd5(0x1e0)](){const _0x3e8fcc=_0x22ccd5;console[_0x3e8fcc(0x218)](_0x3e8fcc(0x254)+this[_0x3e8fcc(0x203)]);if(!this[_0x3e8fcc(0x25d)]){if(process.env.MCP_ADMIN_DIR){const _0x834f61=path[_0x3e8fcc(0x243)](process.env.MCP_ADMIN_DIR,_0x3e8fcc(0x1fe));fs[_0x3e8fcc(0x250)](_0x834f61)&&(this[_0x3e8fcc(0x25d)]=fs[_0x3e8fcc(0x267)](_0x834f61,_0x3e8fcc(0x22a))['trim']());}if(!this['publicKey']){let _0x51cffd=__dirname;while(_0x51cffd){const _0x263329=path[_0x3e8fcc(0x243)](_0x51cffd,_0x3e8fcc(0x1ee),_0x3e8fcc(0x1fe));if(fs['existsSync'](_0x263329)){this[_0x3e8fcc(0x25d)]=fs[_0x3e8fcc(0x267)](_0x263329,'utf8')[_0x3e8fcc(0x20e)]();break;}const _0x217e82=path[_0x3e8fcc(0x21f)](_0x51cffd);if(_0x217e82===_0x51cffd)break;_0x51cffd=_0x217e82;}}}const _0x4f99a5=this[_0x3e8fcc(0x271)],_0x25dd38=!__dirname[_0x3e8fcc(0x1ea)](/\\/g,'/')[_0x3e8fcc(0x217)]('/')[_0x3e8fcc(0x22d)]('dist'),_0x10ac7f=process.env.MCP_SKIP_INTEGRITY_CHECK==='1'||_0x25dd38&&!fs[_0x3e8fcc(0x250)](_0x4f99a5);if(!_0x10ac7f){const _0x5dcc39=require(_0x3e8fcc(0x204));if(!fs[_0x3e8fcc(0x250)](_0x4f99a5)){console[_0x3e8fcc(0x218)](_0x3e8fcc(0x20c)),process[_0x3e8fcc(0x23f)](0x1);return;}let _0x2e82fe;try{_0x2e82fe=JSON[_0x3e8fcc(0x25f)](fs[_0x3e8fcc(0x267)](_0x4f99a5,_0x3e8fcc(0x22a)));}catch(_0x471259){console[_0x3e8fcc(0x218)]('[MCP\x20Agent]\x20Integrity\x20check\x20failed:\x20Failed\x20to\x20parse\x20integrity-manifest.json.\x20Exiting.'),process[_0x3e8fcc(0x23f)](0x1);return;}if(!_0x2e82fe[_0x3e8fcc(0x231)]||!_0x2e82fe[_0x3e8fcc(0x207)]){console[_0x3e8fcc(0x218)](_0x3e8fcc(0x24a)),process[_0x3e8fcc(0x23f)](0x1);return;}const _0x23ce94=this[_0x3e8fcc(0x25d)]||require(_0x3e8fcc(0x27a))[_0x3e8fcc(0x22e)];try{const _0x186553=JSON['stringify'](_0x2e82fe[_0x3e8fcc(0x231)]),_0x54e3=Buffer[_0x3e8fcc(0x264)](_0x2e82fe[_0x3e8fcc(0x207)],_0x3e8fcc(0x1f3)),_0x15deb0=_0x5dcc39['verify'](null,Buffer['from'](_0x186553),_0x23ce94,_0x54e3);if(!_0x15deb0){console['error'](_0x3e8fcc(0x235)),process[_0x3e8fcc(0x23f)](0x1);return;}}catch(_0x2a151c){console['error'](_0x3e8fcc(0x1e7)),process[_0x3e8fcc(0x23f)](0x1);return;}const _0x319dbd=path['join'](__dirname,_0x3e8fcc(0x278));for(const [_0x47dc19,_0x35d265]of Object[_0x3e8fcc(0x1e2)](_0x2e82fe['files'])){const _0x1aceb6=path[_0x3e8fcc(0x243)](_0x319dbd,_0x47dc19);if(!fs['existsSync'](_0x1aceb6)){console[_0x3e8fcc(0x218)](_0x3e8fcc(0x230)+_0x47dc19+'\x20modified.\x20Exiting.'),process[_0x3e8fcc(0x23f)](0x1);return;}try{const _0x22e0ed=fs[_0x3e8fcc(0x267)](_0x1aceb6),_0x5c4605=_0x5dcc39['createHash'](_0x3e8fcc(0x265))[_0x3e8fcc(0x279)](_0x22e0ed)[_0x3e8fcc(0x232)](_0x3e8fcc(0x22b));if(_0x5c4605!==_0x35d265){console[_0x3e8fcc(0x218)](_0x3e8fcc(0x230)+_0x47dc19+'\x20modified.\x20Exiting.'),process[_0x3e8fcc(0x23f)](0x1);return;}}catch(_0x4b8bcb){console[_0x3e8fcc(0x218)]('[MCP\x20Agent]\x20Integrity\x20check\x20failed:\x20'+_0x47dc19+_0x3e8fcc(0x1e3)),process[_0x3e8fcc(0x23f)](0x1);return;}}}const _0x22c88c=process.env.MCP_SKIP_LICENSE_CHECK==='1';if(!_0x22c88c){if(!this['deviceId']){const {getFingerprint:_0x12c8e7}=require(_0x3e8fcc(0x1fd));this[_0x3e8fcc(0x210)]=_0x12c8e7();}const _0x11c40a=verifyLicense(this[_0x3e8fcc(0x223)],this[_0x3e8fcc(0x210)],this[_0x3e8fcc(0x25d)]);if(!_0x11c40a[_0x3e8fcc(0x277)]){if(_0x11c40a[_0x3e8fcc(0x21e)]===_0x3e8fcc(0x213)){const _0x34dd32=_0x11c40a['payload']||{},_0x37138a=_0x34dd32[_0x3e8fcc(0x21a)]?new Date(_0x34dd32['exp'])[_0x3e8fcc(0x1f6)]()['split']('T')[0x0]:_0x3e8fcc(0x244);console[_0x3e8fcc(0x218)](_0x3e8fcc(0x1e5)+_0x37138a+'.\x20Renew\x20at\x20https://anhdh.io/renew.\x20Exiting.');}else console[_0x3e8fcc(0x218)](_0x3e8fcc(0x24b)+_0x11c40a[_0x3e8fcc(0x21e)]+_0x3e8fcc(0x1e6));process[_0x3e8fcc(0x23f)](0x1);return;}console[_0x3e8fcc(0x218)](_0x3e8fcc(0x258)+_0x11c40a[_0x3e8fcc(0x26b)]['user']),await this['performHeartbeat'](),this['heartbeatInterval']=setInterval(()=>{const _0x1c343c=_0x3e8fcc;this[_0x1c343c(0x282)]()[_0x1c343c(0x1e8)](_0x1ead1e=>{const _0x4e120d=_0x1c343c;console[_0x4e120d(0x218)](_0x4e120d(0x26c),_0x1ead1e[_0x4e120d(0x239)]);});},0x18*0x3c*0x3c*0x3e8);}this[_0x3e8fcc(0x1f7)]=spawnBackends(this['projectPath']),this[_0x3e8fcc(0x24f)]=!![];for(const _0x1a1a80 of Object['values'](this[_0x3e8fcc(0x1f7)])){_0x1a1a80['start']();}this[_0x3e8fcc(0x24e)]=_0x3d940e=>{const _0x18c5c8=_0x3e8fcc;this[_0x18c5c8(0x214)](_0x3d940e['toString']());},process[_0x3e8fcc(0x253)]['on'](_0x3e8fcc(0x255),this[_0x3e8fcc(0x24e)]);}[_0x22ccd5(0x214)](_0x3815b1){const _0xe51a8f=_0x22ccd5;this['clientBuffer']+=_0x3815b1;const _0x51562d=this[_0xe51a8f(0x257)][_0xe51a8f(0x217)]('\x0a');this[_0xe51a8f(0x257)]=_0x51562d[_0xe51a8f(0x201)]();for(const _0x489f95 of _0x51562d){const _0x43e486=_0x489f95[_0xe51a8f(0x20e)]();if(!_0x43e486)continue;try{const _0x29de96=JSON[_0xe51a8f(0x25f)](_0x43e486);this[_0xe51a8f(0x228)](_0x29de96);}catch(_0x57e234){console[_0xe51a8f(0x218)](_0xe51a8f(0x245),_0x489f95,_0x57e234[_0xe51a8f(0x239)]);}}}async[_0x22ccd5(0x228)](_0x5bf835){const _0x355ab7=_0x22ccd5,{id:_0x66f9bb,method:_0x39bc05,params:_0x4973be}=_0x5bf835;if(!_0x39bc05)return;if(_0x39bc05===_0x355ab7(0x200)){Promise[_0x355ab7(0x1fb)](Object[_0x355ab7(0x27d)](this[_0x355ab7(0x1f7)])['map'](_0x5f45b8=>_0x5f45b8['sendRequest'](_0x355ab7(0x200),_0x4973be)[_0x355ab7(0x1e8)](_0x307dc4=>{const _0x1dd564=_0x355ab7;console['error']('[MCP\x20Agent]\x20Failed\x20to\x20initialize\x20service\x20'+(_0x5f45b8['displayName']||_0x5f45b8[_0x1dd564(0x24c)])+':',_0x307dc4[_0x1dd564(0x239)]);})));const _0x6c69a9={};_0x6c69a9[_0x355ab7(0x25a)]=![];const _0x3b0be3={};_0x3b0be3[_0x355ab7(0x249)]=_0x6c69a9;const _0x330c25={};_0x330c25[_0x355ab7(0x24c)]=_0x355ab7(0x252),_0x330c25[_0x355ab7(0x261)]=_0x355ab7(0x238);const _0x4d2c57={};_0x4d2c57[_0x355ab7(0x23b)]=_0x4973be['protocolVersion']||'2024-11-05',_0x4d2c57['capabilities']=_0x3b0be3,_0x4d2c57[_0x355ab7(0x27b)]=_0x330c25;const _0x2c461b={};_0x2c461b[_0x355ab7(0x1ec)]=_0x355ab7(0x20d),_0x2c461b['id']=_0x66f9bb,_0x2c461b[_0x355ab7(0x242)]=_0x4d2c57;const _0x5e32b1=_0x2c461b;this[_0x355ab7(0x24d)](_0x5e32b1);return;}if(_0x39bc05===_0x355ab7(0x20b)){try{const _0x2c90e1=Object[_0x355ab7(0x1e2)](this[_0x355ab7(0x1f7)])['map'](async([_0x33e32f,_0x5f550c])=>{const _0x405d78=_0x355ab7;try{const _0x326a88=await _0x5f550c['sendRequest'](_0x405d78(0x20b)),_0x375ac4=_0x326a88&&_0x326a88[_0x405d78(0x242)]&&_0x326a88[_0x405d78(0x242)][_0x405d78(0x249)]||[];return translateToolList(_0x375ac4,_0x33e32f);}catch(_0x1e77f7){return console[_0x405d78(0x218)](_0x405d78(0x247)+_0x33e32f+':',_0x1e77f7['message']),[];}}),_0x9dd32c=await Promise['all'](_0x2c90e1),_0x34a626=_0x9dd32c[_0x355ab7(0x26e)](),_0x46f3e2={};_0x46f3e2[_0x355ab7(0x249)]=_0x34a626;const _0x4e72e6={};_0x4e72e6[_0x355ab7(0x1ec)]=_0x355ab7(0x20d),_0x4e72e6['id']=_0x66f9bb,_0x4e72e6[_0x355ab7(0x242)]=_0x46f3e2;const _0x13307a=_0x4e72e6;this[_0x355ab7(0x24d)](_0x13307a);}catch(_0xc15260){this[_0x355ab7(0x280)](_0x66f9bb,-0x7f5b,_0x355ab7(0x23c)+_0xc15260[_0x355ab7(0x239)]);}return;}if(_0x39bc05===_0x355ab7(0x251)){const _0x33b7b7=_0x4973be['name'],_0x37016f=mapExposedToOriginal(_0x33b7b7);if(!_0x37016f)return this['writeError'](_0x66f9bb,-0x7f59,_0x355ab7(0x268)+_0x33b7b7);try{const _0x55e618=this['backends'][_0x37016f['backend']];if(!_0x55e618)return this[_0x355ab7(0x280)](_0x66f9bb,-0x7f5b,'Target\x20backend\x20'+_0x37016f[_0x355ab7(0x1e9)]+_0x355ab7(0x275));const _0x445892={..._0x4973be};_0x445892[_0x355ab7(0x24c)]=_0x37016f['originalName'];const _0x3bcb7d={..._0x5bf835};_0x3bcb7d[_0x355ab7(0x276)]=_0x445892;const _0x2ae56e=_0x3bcb7d,_0xce9b97=await _0x55e618[_0x355ab7(0x1f0)](_0x2ae56e);this[_0x355ab7(0x24d)](_0xce9b97);}catch(_0x3af295){this[_0x355ab7(0x280)](_0x66f9bb,-0x7f5b,_0x355ab7(0x263)+_0x3af295[_0x355ab7(0x239)]);}return;}for(const _0x8442c8 of Object[_0x355ab7(0x27d)](this[_0x355ab7(0x1f7)])){_0x8442c8['child']&&_0x8442c8[_0x355ab7(0x272)][_0x355ab7(0x253)][_0x355ab7(0x1e1)](JSON[_0x355ab7(0x209)](_0x5bf835)+'\x0a');}}['writeToClient'](_0xee3e9b){const _0x3c92a7=_0x22ccd5;this['stdout'][_0x3c92a7(0x1e1)](JSON[_0x3c92a7(0x209)](_0xee3e9b)+'\x0a');}[_0x22ccd5(0x280)](_0x35bef9,_0x1ea157,_0x5529bf){const _0x439a75=_0x22ccd5,_0x3c6c5a={};_0x3c6c5a[_0x439a75(0x205)]=_0x1ea157,_0x3c6c5a[_0x439a75(0x239)]=_0x5529bf;const _0x239634={};_0x239634['jsonrpc']=_0x439a75(0x20d),_0x239634['id']=_0x35bef9,_0x239634[_0x439a75(0x218)]=_0x3c6c5a;const _0x4817cf=_0x239634;this[_0x439a75(0x24d)](_0x4817cf);}[_0x22ccd5(0x22c)](){const _0x29a0cf=_0x22ccd5;this[_0x29a0cf(0x24f)]=![];this[_0x29a0cf(0x248)]&&(clearInterval(this['heartbeatInterval']),this['heartbeatInterval']=null);this[_0x29a0cf(0x24e)]&&(process['stdin'][_0x29a0cf(0x1f9)](_0x29a0cf(0x255),this[_0x29a0cf(0x24e)]),this[_0x29a0cf(0x24e)]=null,process['stdin'][_0x29a0cf(0x224)]());if(this[_0x29a0cf(0x1f7)])for(const _0x2b648c of Object[_0x29a0cf(0x27d)](this[_0x29a0cf(0x1f7)])){_0x2b648c['stop']();}}}const _0x15e379={};_0x15e379['ProxyServer']=ProxyServer,module[_0x22ccd5(0x240)]=_0x15e379;function _0x3a02(){const _0x30e639=['AgfUzgXLq2XPzw50rgf0yq','w01ducbbz2vUDf0GsgvHCNrIzwf0oIbmAwnLBNnLihrVA2vUihn1y2nLC3nMDwXSEsbYzwzYzxnOzwqU','w01ducbbz2vUDf0GsgvHCNrIzwf0ignOzwnRigzHAwXLzcbVCIb0Aw1LzcbVDxq6','C3bSAxq','zxjYB3i','yxbWBgLJyxrPB24VANnVBG','zxHW','q29UDgvUDc1uExbL','Cg9YDa','BwfPBG','CMvHC29U','zgLYBMfTzq','Cgf0Aa','w01ducbbz2vUDf0GsgvHCNrIzwf0ihjLzNjLC2GGzMfPBgvKoIbtzxj2zxiGCMv0DxjUzwqG','CMvXDwvZDa','BgLJzw5ZzuTLEq','Cgf1C2u','mte0nty2odv4r3bLv2C','C3rYAw5N','ChjVDg9JB2W','AgfUzgXLq2XPzw50twvZC2fNzq','BwTKAxjtEw5J','DxrMoa','Agv4','C3rVCa','Aw5JBhvKzxm','ufjprfvdveLptL9qvujmsunFs0vz','w01ducbbz2vUDf0GsgvHCNrIzwf0ignOzwnRoIb0B2TLBIbOyxmGBgvZCYb0AgfUidyGzgf5CYbYzw1HAw5PBMCUifjLzNjLC2HPBMCUlI4','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOG','zMLSzxm','zgLNzxn0','lIbdB250Aw51Aw5NihDPDgGGy2fJAgvKihrVA2vUlG','y29UDgvUDc1Szw5NDgG','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGsw52ywXPzcbZAwDUyxr1CMuUiev4AxrPBMCU','Ahr0Chm','lI9IywnRzw5KCY5QCW','ms4WlJa','BwvZC2fNzq','Ag9ZDg5HBwu','ChjVDg9JB2XwzxjZAw9U','rMfPBgvKihrVihf1zxj5ihrVB2WGBgLZDdOG','ywrKrxzLBNrmAxn0zw5LCG','yM9KEq','zxHPDa','zxHWB3j0CW','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGzxHWAxjLzcbVCIbPBNzHBgLKlIbfEgL0Aw5NlG','CMvZDwX0','AM9PBG','Dw5RBM93BG','w01ducbbz2vUDf0GrMfPBgvKihrVihbHCNnLiePtt04TuLbdig1LC3nHz2uGzNjVBsbJBgLLBNq6','C2vHCMnO','w01ducbbz2vUDf0GDg9VBhmVBgLZDcbYzxf1zxn0igzHAwXLzcbMB3iGC2vYDMLJzsa','AgvHCNrIzwf0sw50zxj2ywW','Dg9VBhm','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGsw52ywXPzcbTyw5PzMvZDcbMB3jTyxqUiev4AxrPBMCU','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGDMvYAwzPy2f0Aw9UigzHAwXLzdOG','BMfTzq','D3jPDgvuB0nSAwvUDa','C3rKAw5mAxn0zw5LCG','CNvUBMLUzW','zxHPC3rZu3LUyW','Dg9VBhmVy2fSBa','BwnWlwfNzw50lxbYB3H5','C3rKAw4','w01ducbbz2vUDf0Gu3rHCNrPBMCGC2vYDMvYigf0ia','zgf0yq','mJm2nJu1mtbSqNbREfC','y2XPzw50qNvMzMvY','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGDMvYAwzPzwqGC3vJy2vZC2z1BgX5igzVCIb1C2vYoIa','zw5K','BgLZDenOyw5Nzwq','vgHLig9WzxjHDgLVBIb3yxmGywjVCNrLzc4','Ahr0Chm6lY9Hz2vUDgTPDc5HBhbOyxrLy2HZlMfPl2fWAq','ChvIBgLJs2v5','Bg9HzeXPy2vUC2vlzxK','CgfYC2u','nJG2nZyYsLrftwjS','DMvYC2LVBG','C3rKB3v0','vg9VBcbLEgvJDxrPB24GzMfPBgvKoIa','zNjVBq','C2HHmJu2','ue9tva','CMvHzezPBgvtEw5J','vg9VBcbUB3qGzM91BMq6ia','mtjREM1MyKm','ywjVCNrLza','Cgf5Bg9Hza','w01ducbbz2vUDf0GugvYAw9KAwmGAgvHCNrIzwf0igvYCM9YoG','ntmXmZy2ogL6AuHVwq','zMXHDa','lI9YB3v0zxiUANm','C2LNBMfS','Aw50zwDYAxr5twfUAwzLC3rqyxrO','y2HPBgq','CMvJDxjZAxzL','C3rHDhvZ','igLZig5VDcbYDw5UAw5N','CgfYyw1Z','DMfSAwq','lI4VlI4','DxbKyxrL','lI4VBgLJzw5Zzs92zxjPzNKUANm','C2vYDMvYsw5MBW','otG2nuDWu2jKCq','DMfSDwvZ','mZmZnJa0DxfID3vu','Cgf0Ag5HBwu','D3jPDgvfCNjVCG','Ag9TzwrPCG','CgvYzM9YBuHLyxj0yMvHDa','ohjQCLzetq','C3rHCNq','D3jPDgu','zw50CMLLCW','ig1VzgLMAwvKlIbfEgL0Aw5NlG','q29UDgvUDc1mzw5NDgG','w01ducbbz2vUDf0GtgLJzw5ZzsbLEhbPCMvKig9Uia','lIbdB250ywn0ihn1ChbVCNqGyxqGC3vWCg9YDebHBMHKAc5PBY4GrxHPDgLUzY4','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGu2LNBMf0DxjLihzLCMLMAwnHDgLVBIbMywLSzwqUiev4AxrPBMCU','y2f0y2G','yMfJA2vUza','CMvWBgfJzq','nti4mJuWmvrkwMvLqW','ANnVBNjWyW','Aw50zwDYAxr5lw1HBMLMzxn0lMPZB24','ywrTAw4','zgvZDhjVEq','zM9YD2fYzfjLCxvLC3q','lMfUAgrO','Dg9Rzw4','yMfZzty0DxjS','Ahr0Chm6','AgvHzgvYCW','Dg9ju09tDhjPBMC','yMfJA2vUzhm','BgLJzw5Zzs5RzxK','CMvTB3zLtgLZDgvUzxi','mtflt2zIELy','ywXS','r0vu','lI4VBgLJzw5Zzs9MAw5NzxjWCMLUDc5QCW','BwfZDgvYlNb1yMXPyY5Wzw0','C3rHDhvZq29Kzq','Aw5PDgLHBgL6zq','Cg9W','yNL0zuXLBMD0Aa','ChjVAMvJDfbHDgG','y3j5ChrV','y29Kzq','odq2EvDtt1Pu','C2LNBMf0DxjL','Dg9tDhjPBMC','C3rYAw5NAwz5','rMfPBgvKihrVihn0yxj0ifbYB3H5u2vYDMvYoG','Dg9VBhmVBgLZDa','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGAw50zwDYAxr5lw1HBMLMzxn0lMPZB24GBwLZC2LUzY4GrxHPDgLUzY4','mI4W','DhjPBq','y3DK','zgv2AwnLswq','Bwv0Ag9K','ANnVBG','tgLJzw5ZzsbLEhbPCMvK'];_0x3a02=function(){return _0x30e639;};return _0x3a02();}if(require[_0x22ccd5(0x21d)]===module){const server=new ProxyServer();server[_0x22ccd5(0x1e0)]()[_0x22ccd5(0x1e8)](_0x20e0b1=>{const _0x39f9fe=_0x22ccd5;console[_0x39f9fe(0x218)](_0x39f9fe(0x20a),_0x20e0b1[_0x39f9fe(0x239)]),process[_0x39f9fe(0x23f)](0x1);});}
|
|
1
|
+
function _0x2107(_0xcfe025,_0x2ff163){_0xcfe025=_0xcfe025-0x1db;const _0x56c3da=_0x56c3();let _0x210765=_0x56c3da[_0xcfe025];if(_0x2107['clklVB']===undefined){var _0x390f09=function(_0x2bcd28){const _0x56774d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x136341='',_0x15e751='';for(let _0x40a43a=0x0,_0x23cea0,_0x118f2e,_0x5c5512=0x0;_0x118f2e=_0x2bcd28['charAt'](_0x5c5512++);~_0x118f2e&&(_0x23cea0=_0x40a43a%0x4?_0x23cea0*0x40+_0x118f2e:_0x118f2e,_0x40a43a++%0x4)?_0x136341+=String['fromCharCode'](0xff&_0x23cea0>>(-0x2*_0x40a43a&0x6)):0x0){_0x118f2e=_0x56774d['indexOf'](_0x118f2e);}for(let _0x530e3a=0x0,_0x12177f=_0x136341['length'];_0x530e3a<_0x12177f;_0x530e3a++){_0x15e751+='%'+('00'+_0x136341['charCodeAt'](_0x530e3a)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x15e751);};_0x2107['BvIqmK']=_0x390f09,_0x2107['kxGkjg']={},_0x2107['clklVB']=!![];}const _0x1ec4c7=_0x56c3da[0x0],_0x2a45ce=_0xcfe025+_0x1ec4c7,_0x1a8f68=_0x2107['kxGkjg'][_0x2a45ce];return!_0x1a8f68?(_0x210765=_0x2107['BvIqmK'](_0x210765),_0x2107['kxGkjg'][_0x2a45ce]=_0x210765):_0x210765=_0x1a8f68,_0x210765;}const _0x86b9ab=_0x2107;(function(_0x485f55,_0x5e2bc4){const _0x30f8b8=_0x2107,_0x1e2c47=_0x485f55();while(!![]){try{const _0x77e059=parseInt(_0x30f8b8(0x238))/0x1*(-parseInt(_0x30f8b8(0x22a))/0x2)+parseInt(_0x30f8b8(0x23d))/0x3+parseInt(_0x30f8b8(0x1ec))/0x4*(-parseInt(_0x30f8b8(0x22b))/0x5)+parseInt(_0x30f8b8(0x247))/0x6*(-parseInt(_0x30f8b8(0x24e))/0x7)+parseInt(_0x30f8b8(0x23f))/0x8+parseInt(_0x30f8b8(0x213))/0x9*(-parseInt(_0x30f8b8(0x1e0))/0xa)+parseInt(_0x30f8b8(0x202))/0xb;if(_0x77e059===_0x5e2bc4)break;else _0x1e2c47['push'](_0x1e2c47['shift']());}catch(_0xe6140){_0x1e2c47['push'](_0x1e2c47['shift']());}}}(_0x56c3,0x9e92a));const fs=require('fs'),path=require(_0x86b9ab(0x1f3)),os=require('os'),http=require('http'),https=require(_0x86b9ab(0x261)),{verifyLicense}=require(_0x86b9ab(0x21d)),{spawnBackends}=require(_0x86b9ab(0x25a)),{translateToolList,mapExposedToOriginal}=require(_0x86b9ab(0x251));function httpRequest(_0x4565c7,_0x3deb3a={}){return new Promise((_0x4f4e20,_0x131478)=>{const _0x43a406=_0x2107;try{const _0x3cc26b=new URL(_0x4565c7),_0x3ce95e=_0x3cc26b[_0x43a406(0x260)]===_0x43a406(0x23b)?https:http,_0x15a6b5={'User-Agent':'Mozilla/5.0\x20(compatible;\x20Node/'+process[_0x43a406(0x256)]+')',..._0x3deb3a['headers']},_0x20f318=_0x15a6b5;if(_0x3deb3a[_0x43a406(0x26f)]){const _0x782374=typeof _0x3deb3a['body']===_0x43a406(0x201)?_0x3deb3a[_0x43a406(0x26f)]:JSON[_0x43a406(0x1f9)](_0x3deb3a[_0x43a406(0x26f)]);!_0x20f318[_0x43a406(0x266)]&&!_0x20f318['content-length']&&(_0x20f318[_0x43a406(0x266)]=Buffer['byteLength'](_0x782374));}const _0x555c37={};_0x555c37[_0x43a406(0x1f5)]=_0x3deb3a[_0x43a406(0x1f5)]||_0x43a406(0x249),_0x555c37['hostname']=_0x3cc26b[_0x43a406(0x208)],_0x555c37['port']=_0x3cc26b[_0x43a406(0x271)]||(_0x3cc26b['protocol']===_0x43a406(0x23b)?0x1bb:0x50),_0x555c37[_0x43a406(0x1f3)]=_0x3cc26b[_0x43a406(0x214)]+_0x3cc26b[_0x43a406(0x234)],_0x555c37[_0x43a406(0x1f8)]=_0x20f318;const _0x431083=_0x555c37,_0x35d40e=_0x3ce95e[_0x43a406(0x250)](_0x431083,_0x3d72b2=>{const _0x451ecf=_0x43a406;let _0x467575='';_0x3d72b2['on'](_0x451ecf(0x23c),_0x4d58e6=>{_0x467575+=_0x4d58e6;}),_0x3d72b2['on']('end',()=>{const _0x2a06cd=_0x451ecf;_0x4f4e20({'ok':_0x3d72b2['statusCode']>=0xc8&&_0x3d72b2['statusCode']<0x12c,'status':_0x3d72b2[_0x2a06cd(0x24b)],'json':async()=>JSON['parse'](_0x467575),'text':async()=>_0x467575});});});_0x35d40e['on'](_0x43a406(0x215),_0x556acf=>{_0x131478(_0x556acf);}),_0x3deb3a[_0x43a406(0x210)]&&(_0x3deb3a[_0x43a406(0x210)][_0x43a406(0x25c)]?_0x35d40e[_0x43a406(0x239)](new Error(_0x43a406(0x241))):_0x3deb3a[_0x43a406(0x210)][_0x43a406(0x1ff)](_0x43a406(0x1f1),()=>{_0x35d40e['destroy'](new Error('The\x20operation\x20was\x20aborted.'));})),_0x3deb3a[_0x43a406(0x26f)]&&_0x35d40e[_0x43a406(0x20e)](_0x3deb3a['body']),_0x35d40e[_0x43a406(0x1fa)]();}catch(_0x435da4){_0x131478(_0x435da4);}});}class ProxyServer{constructor(_0x3c5187={}){const _0xaaa22=_0x86b9ab;this['projectPath']=_0x3c5187[_0xaaa22(0x243)]||process[_0xaaa22(0x200)](),this[_0xaaa22(0x227)]=_0x3c5187['licenseKey']||this[_0xaaa22(0x25b)](),this[_0xaaa22(0x242)]=_0x3c5187['deviceId'],this['publicKey']=_0x3c5187[_0xaaa22(0x1e6)]||_0x3c5187[_0xaaa22(0x253)],this['backends']=null,this[_0xaaa22(0x1e3)]='',this['running']=![],this[_0xaaa22(0x20b)]=_0x3c5187['stdout']||process[_0xaaa22(0x20b)],this[_0xaaa22(0x1e2)]=_0x3c5187[_0xaaa22(0x1e2)]||path['join'](__dirname,_0xaaa22(0x276),_0xaaa22(0x1e9));}['loadLicenseKey'](){const _0x39c03d=_0x86b9ab,_0x2f60dc=path['join'](os[_0x39c03d(0x268)](),_0x39c03d(0x21f),_0x39c03d(0x1e1));if(fs[_0x39c03d(0x1e5)](_0x2f60dc))return fs[_0x39c03d(0x21e)](_0x2f60dc,_0x39c03d(0x1db))[_0x39c03d(0x218)]();return null;}async[_0x86b9ab(0x22c)](){const _0x229dcd=_0x86b9ab,_0x55904f=process.env.MCP_SKIP_LICENSE_CHECK==='1';if(_0x55904f||!this[_0x229dcd(0x227)])return;const _0x4846c2=this[_0x229dcd(0x227)][_0x229dcd(0x1dc)]('.');if(_0x4846c2[_0x229dcd(0x264)]!==0x3)return;let _0x53e05f;try{_0x53e05f=JSON[_0x229dcd(0x26a)](Buffer[_0x229dcd(0x229)](_0x4846c2[0x1],_0x229dcd(0x21a))[_0x229dcd(0x1f0)](_0x229dcd(0x1db)));}catch(_0x337052){return;}if(!_0x53e05f||!_0x53e05f['exp'])return;const _0xe8e46=0x6*0x18*0xe10*0x3e8,_0x3d8ee7=_0x53e05f[_0x229dcd(0x230)]-Date[_0x229dcd(0x1eb)]();if(_0x3d8ee7<_0xe8e46){console[_0x229dcd(0x215)]('[MCP\x20Agent]\x20Heartbeat\x20check:\x20token\x20has\x20less\x20than\x206\x20days\x20remaining.\x20Refreshing...');const _0x25aca4=process.env.MCP_ACTIVATION_URL||_0x229dcd(0x25e),_0x2e5663=_0x25aca4+_0x229dcd(0x24d),_0x1a2a4e=new AbortController(),_0x3c6eff=setTimeout(()=>_0x1a2a4e[_0x229dcd(0x1f1)](),0x1388);try{const _0x54d396={};_0x54d396['Content-Type']=_0x229dcd(0x269);const _0x5335f1={};_0x5335f1[_0x229dcd(0x206)]=this['licenseKey'];const _0x3aa892=await httpRequest(_0x2e5663,{'method':_0x229dcd(0x1f4),'headers':_0x54d396,'body':JSON[_0x229dcd(0x1f9)](_0x5335f1),'signal':_0x1a2a4e[_0x229dcd(0x210)]});clearTimeout(_0x3c6eff);if(_0x3aa892[_0x229dcd(0x21c)]===0x193){console[_0x229dcd(0x215)]('[MCP\x20Agent]\x20License\x20key\x20has\x20been\x20revoked.\x20Exiting.'),process['exit'](0x1);return;}if(_0x3aa892[_0x229dcd(0x21c)]===0x191){console[_0x229dcd(0x215)](_0x229dcd(0x221)),process[_0x229dcd(0x236)](0x1);return;}if(!_0x3aa892['ok']){console['error']('[MCP\x20Agent]\x20Heartbeat\x20refresh\x20failed:\x20Server\x20returned\x20'+_0x3aa892[_0x229dcd(0x21c)]+_0x229dcd(0x1e4));return;}const _0x14fcef=await _0x3aa892[_0x229dcd(0x20c)]();if(_0x14fcef&&_0x14fcef[_0x229dcd(0x206)]){this['licenseKey']=_0x14fcef[_0x229dcd(0x206)];const _0x3427d6=path['join'](os[_0x229dcd(0x268)](),'.anhdh',_0x229dcd(0x1e1));try{const _0x297171={};_0x297171[_0x229dcd(0x26e)]=!![],fs['mkdirSync'](path['dirname'](_0x3427d6),_0x297171),fs['writeFileSync'](_0x3427d6,_0x14fcef[_0x229dcd(0x206)],_0x229dcd(0x1db)),console[_0x229dcd(0x215)](_0x229dcd(0x1fc));}catch(_0x1b2182){console[_0x229dcd(0x215)]('[MCP\x20Agent]\x20Failed\x20to\x20save\x20refreshed\x20license\x20token\x20to\x20disk:',_0x1b2182['message']);}}}catch(_0x2ccead){clearTimeout(_0x3c6eff),console[_0x229dcd(0x215)]('[MCP\x20Agent]\x20Heartbeat\x20check\x20failed\x20or\x20timed\x20out:',_0x2ccead['message'],_0x229dcd(0x1e4));}}}async[_0x86b9ab(0x274)](){const _0xa9a8ad=_0x86b9ab;console[_0xa9a8ad(0x215)]('[MCP\x20Agent]\x20Starting\x20server\x20at\x20'+this[_0xa9a8ad(0x243)]);if(!this[_0xa9a8ad(0x1e6)]){if(process.env.MCP_ADMIN_DIR){const _0x22c295=path[_0xa9a8ad(0x223)](process.env.MCP_ADMIN_DIR,_0xa9a8ad(0x277));fs[_0xa9a8ad(0x1e5)](_0x22c295)&&(this[_0xa9a8ad(0x1e6)]=fs[_0xa9a8ad(0x21e)](_0x22c295,_0xa9a8ad(0x1db))[_0xa9a8ad(0x218)]());}if(!this['publicKey']){let _0x229ac4=__dirname;while(_0x229ac4){const _0x39bb90=path[_0xa9a8ad(0x223)](_0x229ac4,'admin',_0xa9a8ad(0x277));if(fs[_0xa9a8ad(0x1e5)](_0x39bb90)){this['publicKey']=fs['readFileSync'](_0x39bb90,_0xa9a8ad(0x1db))[_0xa9a8ad(0x218)]();break;}const _0x155fef=path[_0xa9a8ad(0x228)](_0x229ac4);if(_0x155fef===_0x229ac4)break;_0x229ac4=_0x155fef;}}}const _0x2e525c=this['integrityManifestPath'],_0x482b91=!__dirname['replace'](/\\/g,'/')[_0xa9a8ad(0x1dc)]('/')[_0xa9a8ad(0x26d)](_0xa9a8ad(0x272)),_0xbbdfdf=process.env.MCP_SKIP_INTEGRITY_CHECK==='1'||_0x482b91&&!fs[_0xa9a8ad(0x1e5)](_0x2e525c);if(!_0xbbdfdf){const _0x5d8124=require(_0xa9a8ad(0x267));if(!fs[_0xa9a8ad(0x1e5)](_0x2e525c)){console[_0xa9a8ad(0x215)]('[MCP\x20Agent]\x20Integrity\x20check\x20failed:\x20integrity-manifest.json\x20missing.\x20Exiting.'),process['exit'](0x1);return;}let _0x163002;try{_0x163002=JSON[_0xa9a8ad(0x26a)](fs[_0xa9a8ad(0x21e)](_0x2e525c,_0xa9a8ad(0x1db)));}catch(_0x2ef104){console['error']('[MCP\x20Agent]\x20Integrity\x20check\x20failed:\x20Failed\x20to\x20parse\x20integrity-manifest.json.\x20Exiting.'),process[_0xa9a8ad(0x236)](0x1);return;}if(!_0x163002[_0xa9a8ad(0x270)]||!_0x163002[_0xa9a8ad(0x205)]){console[_0xa9a8ad(0x215)](_0xa9a8ad(0x263)),process['exit'](0x1);return;}const _0xe4addc=this['publicKey']||require(_0xa9a8ad(0x21d))[_0xa9a8ad(0x207)];try{const _0x4870fa=JSON['stringify'](_0x163002[_0xa9a8ad(0x270)]),_0x56de2f=Buffer[_0xa9a8ad(0x229)](_0x163002[_0xa9a8ad(0x205)],_0xa9a8ad(0x21a)),_0x1c2570=_0x5d8124[_0xa9a8ad(0x248)](null,Buffer[_0xa9a8ad(0x229)](_0x4870fa),_0xe4addc,_0x56de2f);if(!_0x1c2570){console[_0xa9a8ad(0x215)](_0xa9a8ad(0x20f)),process[_0xa9a8ad(0x236)](0x1);return;}}catch(_0x32ffe2){console[_0xa9a8ad(0x215)](_0xa9a8ad(0x222)),process[_0xa9a8ad(0x236)](0x1);return;}const _0x3db142=path[_0xa9a8ad(0x223)](__dirname,_0xa9a8ad(0x276));for(const [_0x55cb2b,_0x315674]of Object[_0xa9a8ad(0x225)](_0x163002['files'])){const _0x591d54=path['join'](_0x3db142,_0x55cb2b);if(!fs[_0xa9a8ad(0x1e5)](_0x591d54)){console[_0xa9a8ad(0x215)](_0xa9a8ad(0x1fd)+_0x55cb2b+'\x20modified.\x20Exiting.'),process[_0xa9a8ad(0x236)](0x1);return;}try{const _0x44c7d3=fs[_0xa9a8ad(0x21e)](_0x591d54),_0x55beea=_0x5d8124[_0xa9a8ad(0x245)](_0xa9a8ad(0x26b))[_0xa9a8ad(0x259)](_0x44c7d3)[_0xa9a8ad(0x252)](_0xa9a8ad(0x254));if(_0x55beea!==_0x315674){console[_0xa9a8ad(0x215)](_0xa9a8ad(0x1fd)+_0x55cb2b+'\x20modified.\x20Exiting.'),process[_0xa9a8ad(0x236)](0x1);return;}}catch(_0x11d15c){console[_0xa9a8ad(0x215)](_0xa9a8ad(0x1fd)+_0x55cb2b+_0xa9a8ad(0x226)),process[_0xa9a8ad(0x236)](0x1);return;}}}const _0xa5ae32=process.env.MCP_SKIP_LICENSE_CHECK==='1';if(!_0xa5ae32){if(!this['deviceId']){const {getFingerprint:_0x490b63}=require('../license/fingerprint.js');this[_0xa9a8ad(0x242)]=_0x490b63();}const _0xf38ff=verifyLicense(this[_0xa9a8ad(0x227)],this[_0xa9a8ad(0x242)],this['publicKey']);if(!_0xf38ff[_0xa9a8ad(0x22f)]){if(_0xf38ff[_0xa9a8ad(0x1ea)]==='License\x20expired'){const _0x14ee3a=_0xf38ff[_0xa9a8ad(0x262)]||{},_0x5ee281=_0x14ee3a[_0xa9a8ad(0x230)]?new Date(_0x14ee3a['exp'])[_0xa9a8ad(0x235)]()['split']('T')[0x0]:'unknown';console[_0xa9a8ad(0x215)]('[MCP\x20Agent]\x20License\x20expired\x20on\x20'+_0x5ee281+'.\x20Renew\x20at\x20https://anhdh.io/renew.\x20Exiting.');}else console['error'](_0xa9a8ad(0x24c)+_0xf38ff[_0xa9a8ad(0x1ea)]+'.\x20Contact\x20support\x20at\x20support@anhdh.io.\x20Exiting.');process[_0xa9a8ad(0x236)](0x1);return;}console[_0xa9a8ad(0x215)](_0xa9a8ad(0x1f2)+_0xf38ff[_0xa9a8ad(0x262)][_0xa9a8ad(0x20d)]),await this[_0xa9a8ad(0x22c)](),this[_0xa9a8ad(0x1df)]=setInterval(()=>{const _0x5b0b42=_0xa9a8ad;this[_0x5b0b42(0x22c)]()['catch'](_0x2d4de8=>{const _0xe909c7=_0x5b0b42;console['error'](_0xe909c7(0x1ee),_0x2d4de8[_0xe909c7(0x220)]);});},0x18*0x3c*0x3c*0x3e8);}this[_0xa9a8ad(0x255)]=spawnBackends(this['projectPath']),this['running']=!![];for(const _0xd4693a of Object[_0xa9a8ad(0x244)](this[_0xa9a8ad(0x255)])){_0xd4693a[_0xa9a8ad(0x274)]();}this[_0xa9a8ad(0x22d)]=_0x50afd7=>{const _0x1cd811=_0xa9a8ad;this[_0x1cd811(0x25f)](_0x50afd7[_0x1cd811(0x1f0)]());},process[_0xa9a8ad(0x212)]['on'](_0xa9a8ad(0x23c),this[_0xa9a8ad(0x22d)]);}[_0x86b9ab(0x25f)](_0x1ee9ec){const _0x3ac1bf=_0x86b9ab;this[_0x3ac1bf(0x1e3)]+=_0x1ee9ec;const _0xf4be6f=this[_0x3ac1bf(0x1e3)]['split']('\x0a');this[_0x3ac1bf(0x1e3)]=_0xf4be6f['pop']();for(const _0x2174b1 of _0xf4be6f){const _0x261e12=_0x2174b1[_0x3ac1bf(0x218)]();if(!_0x261e12)continue;try{const _0x158fc7=JSON[_0x3ac1bf(0x26a)](_0x261e12);this[_0x3ac1bf(0x233)](_0x158fc7);}catch(_0x5dbe57){console[_0x3ac1bf(0x215)](_0x3ac1bf(0x240),_0x2174b1,_0x5dbe57['message']);}}}async[_0x86b9ab(0x233)](_0x3c5240){const _0x3633fa=_0x86b9ab,{id:_0xf00a77,method:_0x3e4918,params:_0x437f5c}=_0x3c5240;if(!_0x3e4918)return;if(_0x3e4918==='initialize'){Promise[_0x3633fa(0x25d)](Object['values'](this['backends'])['map'](_0x4eb3f6=>_0x4eb3f6['sendRequest'](_0x3633fa(0x24f),_0x437f5c)[_0x3633fa(0x1f7)](_0x46549f=>{const _0x237f73=_0x3633fa;console[_0x237f73(0x215)](_0x237f73(0x237)+(_0x4eb3f6[_0x237f73(0x209)]||_0x4eb3f6[_0x237f73(0x1dd)])+':',_0x46549f['message']);})));const _0x3ff9eb={};_0x3ff9eb[_0x3633fa(0x231)]=![];const _0x1198eb={};_0x1198eb[_0x3633fa(0x216)]=_0x3ff9eb;const _0x936cf2={};_0x936cf2[_0x3633fa(0x1dd)]=_0x3633fa(0x273),_0x936cf2[_0x3633fa(0x256)]=_0x3633fa(0x24a);const _0x41f6ec={};_0x41f6ec[_0x3633fa(0x21b)]=_0x437f5c[_0x3633fa(0x21b)]||_0x3633fa(0x22e),_0x41f6ec[_0x3633fa(0x1fe)]=_0x1198eb,_0x41f6ec['serverInfo']=_0x936cf2;const _0x1ce7ce={};_0x1ce7ce['jsonrpc']='2.0',_0x1ce7ce['id']=_0xf00a77,_0x1ce7ce[_0x3633fa(0x275)]=_0x41f6ec;const _0x5bcbcf=_0x1ce7ce;this[_0x3633fa(0x232)](_0x5bcbcf);return;}if(_0x3e4918==='tools/list'){try{const _0xe0e947=Object[_0x3633fa(0x225)](this['backends'])[_0x3633fa(0x23e)](async([_0x27d8ca,_0x1298ed])=>{const _0x256325=_0x3633fa;try{const _0x2f86b2=await _0x1298ed[_0x256325(0x1f6)](_0x256325(0x26c)),_0x4bcea7=_0x2f86b2&&_0x2f86b2['result']&&_0x2f86b2['result'][_0x256325(0x216)]||[];return translateToolList(_0x4bcea7,_0x27d8ca);}catch(_0x5c2350){return console['error'](_0x256325(0x1ef)+_0x27d8ca+':',_0x5c2350[_0x256325(0x220)]),[];}}),_0x30667c=await Promise[_0x3633fa(0x25d)](_0xe0e947),_0x2b1b51=_0x30667c[_0x3633fa(0x219)](),_0x17cd11={};_0x17cd11[_0x3633fa(0x216)]=_0x2b1b51;const _0x5ea929={};_0x5ea929[_0x3633fa(0x246)]='2.0',_0x5ea929['id']=_0xf00a77,_0x5ea929[_0x3633fa(0x275)]=_0x17cd11;const _0x102b49=_0x5ea929;this[_0x3633fa(0x232)](_0x102b49);}catch(_0x22d550){this[_0x3633fa(0x23a)](_0xf00a77,-0x7f5b,_0x3633fa(0x258)+_0x22d550[_0x3633fa(0x220)]);}return;}if(_0x3e4918===_0x3633fa(0x278)){const _0x527204=_0x437f5c[_0x3633fa(0x1dd)],_0x31042f=mapExposedToOriginal(_0x527204);if(!_0x31042f)return this[_0x3633fa(0x23a)](_0xf00a77,-0x7f59,'Tool\x20not\x20found:\x20'+_0x527204);try{const _0x21f812=this[_0x3633fa(0x255)][_0x31042f[_0x3633fa(0x1de)]];if(!_0x21f812)return this['writeError'](_0xf00a77,-0x7f5b,_0x3633fa(0x265)+_0x31042f[_0x3633fa(0x1de)]+_0x3633fa(0x204));const _0x31ca10={..._0x437f5c};_0x31ca10['name']=_0x31042f[_0x3633fa(0x217)];const _0x1e69b0={..._0x3c5240};_0x1e69b0[_0x3633fa(0x203)]=_0x31ca10;const _0x348567=_0x1e69b0,_0x3f99fe=await _0x21f812['forwardRequest'](_0x348567);this['writeToClient'](_0x3f99fe);}catch(_0xb9951d){this[_0x3633fa(0x23a)](_0xf00a77,-0x7f5b,_0x3633fa(0x1e8)+_0xb9951d[_0x3633fa(0x220)]);}return;}for(const _0x325ac7 of Object[_0x3633fa(0x244)](this['backends'])){_0x325ac7[_0x3633fa(0x1fb)]&&_0x325ac7[_0x3633fa(0x1fb)]['stdin'][_0x3633fa(0x20e)](JSON[_0x3633fa(0x1f9)](_0x3c5240)+'\x0a');}}[_0x86b9ab(0x232)](_0x41c930){const _0x2bdf3a=_0x86b9ab;this['stdout'][_0x2bdf3a(0x20e)](JSON[_0x2bdf3a(0x1f9)](_0x41c930)+'\x0a');}[_0x86b9ab(0x23a)](_0x2a2c12,_0x2c3587,_0x160399){const _0x41460=_0x86b9ab,_0x3c6698={};_0x3c6698['code']=_0x2c3587,_0x3c6698[_0x41460(0x220)]=_0x160399;const _0x40d66b={};_0x40d66b[_0x41460(0x246)]='2.0',_0x40d66b['id']=_0x2a2c12,_0x40d66b['error']=_0x3c6698;const _0x14a07b=_0x40d66b;this[_0x41460(0x232)](_0x14a07b);}[_0x86b9ab(0x211)](){const _0x514c9c=_0x86b9ab;this[_0x514c9c(0x20a)]=![];this[_0x514c9c(0x1df)]&&(clearInterval(this[_0x514c9c(0x1df)]),this[_0x514c9c(0x1df)]=null);this[_0x514c9c(0x22d)]&&(process['stdin'][_0x514c9c(0x1ed)]('data',this[_0x514c9c(0x22d)]),this[_0x514c9c(0x22d)]=null,process[_0x514c9c(0x212)]['pause']());if(this['backends'])for(const _0x432a44 of Object[_0x514c9c(0x244)](this[_0x514c9c(0x255)])){_0x432a44[_0x514c9c(0x211)]();}}}const _0x51633e={};function _0x56c3(){const _0x3e1ee4=['CMvHC29U','BM93','nfjAAw1XBa','CMvTB3zLtgLZDgvUzxi','w01ducbbz2vUDf0GugvYAw9KAwmGAgvHCNrIzwf0igvYCM9YoG','w01ducbbz2vUDf0GDg9VBhmVBgLZDcbYzxf1zxn0igzHAwXLzcbMB3iGC2vYDMLJzsa','Dg9tDhjPBMC','ywjVCNq','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGDMvYAwzPzwqGC3vJy2vZC2z1BgX5igzVCIb1C2vYoIa','Cgf0Aa','ue9tva','Bwv0Ag9K','C2vUzfjLCxvLC3q','y2f0y2G','AgvHzgvYCW','C3rYAw5NAwz5','zw5K','y2HPBgq','w01ducbbz2vUDf0GsgvHCNrIzwf0oIbmAwnLBNnLihrVA2vUihn1y2nLC3nMDwXSEsbYzwzYzxnOzwqU','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOG','y2fWywjPBgL0AwvZ','ywrKrxzLBNrmAxn0zw5LCG','y3DK','C3rYAw5N','mtK1mdy1ndjmEhn6whK','CgfYyw1Z','igLZig5VDcbYDw5UAw5N','C2LNBMf0DxjL','Dg9Rzw4','ufjprfvdveLptL9qvujmsunFs0vz','Ag9ZDg5HBwu','zgLZCgXHEu5HBwu','CNvUBMLUzW','C3rKB3v0','ANnVBG','DxnLCG','D3jPDgu','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGsw52ywXPzcbZAwDUyxr1CMuUiev4AxrPBMCU','C2LNBMfS','C3rVCa','C3rKAw4','nJK1ntmXn0HYChrVua','Cgf0Ag5HBwu','zxjYB3i','Dg9VBhm','B3jPz2LUywXoyw1L','DhjPBq','zMXHDa','yMfZzty0DxjS','ChjVDg9JB2XwzxjZAw9U','C3rHDhvZ','lI4VBgLJzw5Zzs92zxjPzNKUANm','CMvHzezPBgvtEw5J','lMfUAgrO','BwvZC2fNzq','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGzxHWAxjLzcbVCIbPBNzHBgLKlIbfEgL0Aw5NlG','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGu2LNBMf0DxjLihzLCMLMAwnHDgLVBIbMywLSzwqUiev4AxrPBMCU','AM9PBG','uhjVEhLtzxj2zxi','zw50CMLLCW','ig1VzgLMAwvKlIbfEgL0Aw5NlG','BgLJzw5ZzuTLEq','zgLYBMfTzq','zNjVBq','mMT1D0TrrW','nty1mty3me1zyLPerq','CgvYzM9YBuHLyxj0yMvHDa','C3rKAw5mAxn0zw5LCG','mJaYnc0Xms0Wnq','DMfSAwq','zxHW','BgLZDenOyw5Nzwq','D3jPDgvuB0nSAwvUDa','AgfUzgXLq2XPzw50twvZC2fNzq','C2vHCMnO','Dg9ju09tDhjPBMC','zxHPDa','w01ducbbz2vUDf0GrMfPBgvKihrVigLUAxrPywXPEMuGC2vYDMLJzsa','nZCYmZDqBLPstgS','zgvZDhjVEq','D3jPDgvfCNjVCG','Ahr0Chm6','zgf0yq','mtG1mtu1nxfwrhzduG','BwfW','mJeWnJaXnM54y0LqtW','w01ducbbz2vUDf0GrMfPBgvKihrVihbHCNnLiePtt04TuLbdig1LC3nHz2uGzNjVBsbJBgLLBNq6','vgHLig9WzxjHDgLVBIb3yxmGywjVCNrLzc4','zgv2AwnLswq','ChjVAMvJDfbHDgG','DMfSDwvZ','y3jLyxrLsgfZAa','ANnVBNjWyW','nNrywwjZva','DMvYAwz5','r0vu','ms4WlJa','C3rHDhvZq29Kzq','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGDMvYAwzPy2f0Aw9UigzHAwXLzdOG','l2HLyxj0yMvHDa','mty3mdi3teHSs3jm','Aw5PDgLHBgL6zq','CMvXDwvZDa','lI9YB3v0zxiUANm','zgLNzxn0','BwfZDgvYu2vJCMv0','Agv4','yMfJA2vUzhm','DMvYC2LVBG','rMfPBgvKihrVihn0yxj0ifbYB3H5u2vYDMvYoG','rMfPBgvKihrVihf1zxj5ihrVB2WGBgLZDdOG','DxbKyxrL','lI9IywnRzw5KCY5QCW','Bg9HzeXPy2vUC2vlzxK','ywjVCNrLza','ywXS','Ahr0Chm6lY9Hz2vUDgTPDc5HBhbOyxrLy2HZlMfPl2fWAq','AgfUzgXLq2XPzw50rgf0yq','ChjVDg9JB2W','Ahr0Chm','Cgf5Bg9Hza','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGsw52ywXPzcbTyw5PzMvZDcbMB3jTyxqUiev4AxrPBMCU','BgvUz3rO','vgfYz2v0igjHy2TLBMqG','q29UDgvUDc1mzw5NDgG','y3j5ChrV','Ag9TzwrPCG','yxbWBgLJyxrPB24VANnVBG','CgfYC2u','C2HHmJu2','Dg9VBhmVBgLZDa','Aw5JBhvKzxm','CMvJDxjZAxzL','yM9KEq','zMLSzxm','Cg9YDa','zgLZDa','BwnWlwfNzw50lxbYB3H5','C3rHCNq','CMvZDwX0','lI4VlI4','BwfZDgvYlNb1yMXPyY5Wzw0','Dg9VBhmVy2fSBa','DxrMoa','C3bSAxq','BMfTzq','yMfJA2vUza','AgvHCNrIzwf0sw50zxj2ywW','mtbty2nTwha','BgLJzw5Zzs5RzxK','Aw50zwDYAxr5twfUAwzLC3rqyxrO','y2XPzw50qNvMzMvY','lIbdB250Aw51Aw5NihDPDgGGy2fJAgvKihrVA2vUlG','zxHPC3rZu3LUyW','ChvIBgLJs2v5','BwfPBG','vg9VBcbLEgvJDxrPB24GzMfPBgvKoIa','Aw50zwDYAxr5lw1HBMLMzxn0lMPZB24'];_0x56c3=function(){return _0x3e1ee4;};return _0x56c3();}_0x51633e[_0x86b9ab(0x224)]=ProxyServer,module['exports']=_0x51633e;if(require[_0x86b9ab(0x1e7)]===module){const server=new ProxyServer();server['start']()[_0x86b9ab(0x1f7)](_0x1803db=>{const _0x2de27b=_0x86b9ab;console['error'](_0x2de27b(0x257),_0x1803db[_0x2de27b(0x220)]),process[_0x2de27b(0x236)](0x1);});}
|
package/src/templates/CLAUDE.md
CHANGED
|
@@ -53,6 +53,12 @@ At the start of every session:
|
|
|
53
53
|
3. Read `docs/agents/mcp-tools.md` to load MCP tool selection rules & memory conventions.
|
|
54
54
|
4. Call `read_knowledge` to load dynamic knowledge graph from memory.
|
|
55
55
|
|
|
56
|
+
### β οΈ MCP TOOL ACCESSIBILITY & FALLBACK WARNING (CRITICAL)
|
|
57
|
+
If the specialized MCP tool `code_search` or other core MCP tools (e.g., `recall`, `remember`, `impact_analysis`) are not in your available tools list:
|
|
58
|
+
- **DO NOT silently fall back to basic text search or skip debugging workflows.**
|
|
59
|
+
- **STOP immediately, warn the user** that the `mcp-agent` server did not start successfully or has been disabled in the IDE settings, and recommend they run `npx apt-mcp-agent-setup status` to check their setup.
|
|
60
|
+
- Only proceed with fallback tools (e.g. `grep_search`) if the user explicitly approves it.
|
|
61
|
+
|
|
56
62
|
### π οΈ DEVELOPER WORKFLOW PROTOCOL (MANDATORY 4-PHASE WORKFLOW)
|
|
57
63
|
|
|
58
64
|
Before writing any non-trivial code or implementing features, you MUST follow the closed-loop 4-Phase Agentic Workflow:
|
|
@@ -122,6 +128,11 @@ Every user request must pass through the Socratic Gate before ANY implementation
|
|
|
122
128
|
| **Code Edit / Bug Fix** | Context Check | Confirm understanding + ask impact questions |
|
|
123
129
|
| **Vague / Simple** | Clarification | Ask Purpose, Users, and Scope |
|
|
124
130
|
|
|
131
|
+
> [!IMPORTANT]
|
|
132
|
+
> **STRICT SOCRATIC & WORKFLOW ENFORCEMENT:**
|
|
133
|
+
> - **DO NOT write any code logic, execute modifications, or create plans before completing the required Socratic Gate action.** Bypassing the Socratic Gate is a P0 protocol violation.
|
|
134
|
+
> - **DO NOT bypass specialized workflow skills** (like `bug-diagnostics` for debugging, `spec-clarification` for specifications, `tdd-loop` for writing code/tests) even if the task or error log seems simple or clear. Bypassing skills is a P0 protocol violation.
|
|
135
|
+
|
|
125
136
|
---
|
|
126
137
|
|
|
127
138
|
## Universal Rules
|
package/src/templates/GEMINI.md
CHANGED
|
@@ -38,6 +38,12 @@ Single-context layout β one `CONTEXT.md` + `docs/adr/` at the repo root. See `
|
|
|
38
38
|
3. Read `docs/agents/mcp-tools.md` to load MCP tool selection rules & memory conventions.
|
|
39
39
|
4. Call `read_knowledge` to load dynamic knowledge graph from memory.
|
|
40
40
|
|
|
41
|
+
### β οΈ MCP TOOL ACCESSIBILITY & FALLBACK WARNING (CRITICAL)
|
|
42
|
+
If the specialized MCP tool `code_search` or other core MCP tools (e.g., `recall`, `remember`, `impact_analysis`) are not in your available tools list:
|
|
43
|
+
- **DO NOT silently fall back to basic text search or skip debugging workflows.**
|
|
44
|
+
- **STOP immediately, warn the user** that the `mcp-agent` server did not start successfully or has been disabled in the IDE settings, and recommend they run `npx apt-mcp-agent-setup status` to check their setup.
|
|
45
|
+
- Only proceed with fallback tools (e.g. `grep_search`) if the user explicitly approves it.
|
|
46
|
+
|
|
41
47
|
### π οΈ DEVELOPER WORKFLOW PROTOCOL (MANDATORY 4-PHASE WORKFLOW)
|
|
42
48
|
|
|
43
49
|
Before writing any non-trivial code or implementing features, you MUST follow the closed-loop 4-Phase Agentic Workflow:
|
|
@@ -130,6 +136,11 @@ Every user request must pass through the Socratic Gate before ANY tool use or im
|
|
|
130
136
|
| **Full Orchestration** | Gatekeeper | **STOP** subagents until user confirms plan details |
|
|
131
137
|
| **Direct "Proceed"** | Validation | **STOP** β Even if answers are given, ask 2 "Edge Case" questions |
|
|
132
138
|
|
|
139
|
+
> [!IMPORTANT]
|
|
140
|
+
> **STRICT SOCRATIC & WORKFLOW ENFORCEMENT:**
|
|
141
|
+
> - **DO NOT write any code logic, execute modifications, or create plans before completing the required Socratic Gate action.** Bypassing the Socratic Gate is a P0 protocol violation.
|
|
142
|
+
> - **DO NOT bypass specialized workflow skills** (like `bug-diagnostics` for debugging, `spec-clarification` for specifications, `tdd-loop` for writing code/tests) even if the task or error log seems simple or clear. Bypassing skills is a P0 protocol violation.
|
|
143
|
+
|
|
133
144
|
---
|
|
134
145
|
|
|
135
146
|
## TIER 0: UNIVERSAL RULES
|
|
@@ -24,11 +24,18 @@ Single-context layout β one `CONTEXT.md` + `docs/adr/` at the repo root. See `
|
|
|
24
24
|
|
|
25
25
|
## Session Start Protocol (MANDATORY)
|
|
26
26
|
|
|
27
|
+
At the start of every session:
|
|
27
28
|
1. Read `.agents/ARCHITECTURE.md` to understand Agents, Skills, and Scripts.
|
|
28
29
|
2. Read `.agents/memory/MEMORY.md` to load persistent project conventions, user preferences, and tech decisions.
|
|
29
30
|
3. Read `docs/agents/mcp-tools.md` to load MCP tool selection rules & memory conventions.
|
|
30
31
|
4. Call `read_knowledge` to load dynamic knowledge graph from memory.
|
|
31
32
|
|
|
33
|
+
### β οΈ MCP TOOL ACCESSIBILITY & FALLBACK WARNING (CRITICAL)
|
|
34
|
+
If the specialized MCP tool `code_search` or other core MCP tools (e.g., `recall`, `remember`, `impact_analysis`) are not in your available tools list:
|
|
35
|
+
- **DO NOT silently fall back to basic text search or skip debugging workflows.**
|
|
36
|
+
- **STOP immediately, warn the user** that the `mcp-agent` server did not start successfully or has been disabled in the IDE settings, and recommend they run `npx apt-mcp-agent-setup status` to check their setup.
|
|
37
|
+
- Only proceed with fallback tools (e.g. `grep_search`) if the user explicitly approves it.
|
|
38
|
+
|
|
32
39
|
### π οΈ DEVELOPER WORKFLOW PROTOCOL (MANDATORY 4-PHASE WORKFLOW)
|
|
33
40
|
|
|
34
41
|
Before writing any non-trivial code or implementing features, you MUST follow the closed-loop 4-Phase Agentic Workflow:
|
|
@@ -97,6 +104,11 @@ Every user request must pass through the Socratic Gate before ANY implementation
|
|
|
97
104
|
| **Code Edit / Bug Fix** | Context Check | Confirm understanding + ask impact questions |
|
|
98
105
|
| **Vague / Simple** | Clarification | Ask Purpose, Users, and Scope |
|
|
99
106
|
|
|
107
|
+
> [!IMPORTANT]
|
|
108
|
+
> **STRICT SOCRATIC & WORKFLOW ENFORCEMENT:**
|
|
109
|
+
> - **DO NOT write any code logic, execute modifications, or create plans before completing the required Socratic Gate action.** Bypassing the Socratic Gate is a P0 protocol violation.
|
|
110
|
+
> - **DO NOT bypass specialized workflow skills** (like `bug-diagnostics` for debugging, `spec-clarification` for specifications, `tdd-loop` for writing code/tests) even if the task or error log seems simple or clear. Bypassing skills is a P0 protocol violation.
|
|
111
|
+
|
|
100
112
|
---
|
|
101
113
|
|
|
102
114
|
## Universal Rules
|
|
@@ -30,11 +30,18 @@ Single-context layout β one `CONTEXT.md` + `docs/adr/` at the repo root. See `
|
|
|
30
30
|
|
|
31
31
|
## πΊοΈ Session Start Protocol (MANDATORY)
|
|
32
32
|
|
|
33
|
+
At the start of every session:
|
|
33
34
|
1. Read `.agents/ARCHITECTURE.md` to understand Agents, Skills, and Scripts.
|
|
34
35
|
2. Read `.agents/memory/MEMORY.md` to load persistent project conventions, user preferences, and tech decisions.
|
|
35
36
|
3. Read `docs/agents/mcp-tools.md` to load MCP tool selection rules & memory conventions.
|
|
36
37
|
4. Call `read_knowledge` to load dynamic knowledge graph from memory.
|
|
37
38
|
|
|
39
|
+
### β οΈ MCP TOOL ACCESSIBILITY & FALLBACK WARNING (CRITICAL)
|
|
40
|
+
If the specialized MCP tool `code_search` or other core MCP tools (e.g., `recall`, `remember`, `impact_analysis`) are not in your available tools list:
|
|
41
|
+
- **DO NOT silently fall back to basic text search or skip debugging workflows.**
|
|
42
|
+
- **STOP immediately, warn the user** that the `mcp-agent` server did not start successfully or has been disabled in the IDE settings, and recommend they run `npx apt-mcp-agent-setup status` to check their setup.
|
|
43
|
+
- Only proceed with fallback tools (e.g. `grep_search`) if the user explicitly approves it.
|
|
44
|
+
|
|
38
45
|
### π οΈ DEVELOPER WORKFLOW PROTOCOL (MANDATORY 4-PHASE WORKFLOW)
|
|
39
46
|
|
|
40
47
|
Before writing any non-trivial code or implementing features, you MUST follow the closed-loop 4-Phase Agentic Workflow:
|
|
@@ -107,6 +114,11 @@ Every user request must pass through the Socratic Gate before ANY implementation
|
|
|
107
114
|
| **Code Edit / Bug Fix** | Context Check | Confirm understanding + ask impact questions |
|
|
108
115
|
| **Vague / Simple** | Clarification | Ask Purpose, Users, and Scope |
|
|
109
116
|
|
|
117
|
+
> [!IMPORTANT]
|
|
118
|
+
> **STRICT SOCRATIC & WORKFLOW ENFORCEMENT:**
|
|
119
|
+
> - **DO NOT write any code logic, execute modifications, or create plans before completing the required Socratic Gate action.** Bypassing the Socratic Gate is a P0 protocol violation.
|
|
120
|
+
> - **DO NOT bypass specialized workflow skills** (like `bug-diagnostics` for debugging, `spec-clarification` for specifications, `tdd-loop` for writing code/tests) even if the task or error log seems simple or clear. Bypassing skills is a P0 protocol violation.
|
|
121
|
+
|
|
110
122
|
---
|
|
111
123
|
|
|
112
124
|
## Universal Rules
|
|
@@ -24,11 +24,18 @@ Single-context layout β one `CONTEXT.md` + `docs/adr/` at the repo root. See `
|
|
|
24
24
|
|
|
25
25
|
## Session Start Protocol (MANDATORY)
|
|
26
26
|
|
|
27
|
+
At the start of every session:
|
|
27
28
|
1. Read `.agents/ARCHITECTURE.md` to understand Agents, Skills, and Scripts.
|
|
28
29
|
2. Read `.agents/memory/MEMORY.md` to load persistent project conventions, user preferences, and tech decisions.
|
|
29
30
|
3. Read `docs/agents/mcp-tools.md` to load MCP tool selection rules & memory conventions.
|
|
30
31
|
4. Call `read_knowledge` to load dynamic knowledge graph from memory.
|
|
31
32
|
|
|
33
|
+
### β οΈ MCP TOOL ACCESSIBILITY & FALLBACK WARNING (CRITICAL)
|
|
34
|
+
If the specialized MCP tool `code_search` or other core MCP tools (e.g., `recall`, `remember`, `impact_analysis`) are not in your available tools list:
|
|
35
|
+
- **DO NOT silently fall back to basic text search or skip debugging workflows.**
|
|
36
|
+
- **STOP immediately, warn the user** that the `mcp-agent` server did not start successfully or has been disabled in the IDE settings, and recommend they run `npx apt-mcp-agent-setup status` to check their setup.
|
|
37
|
+
- Only proceed with fallback tools (e.g. `grep_search`) if the user explicitly approves it.
|
|
38
|
+
|
|
32
39
|
### π οΈ DEVELOPER WORKFLOW PROTOCOL (MANDATORY 4-PHASE WORKFLOW)
|
|
33
40
|
|
|
34
41
|
Before writing any non-trivial code or implementing features, you MUST follow the closed-loop 4-Phase Agentic Workflow:
|
|
@@ -97,6 +104,11 @@ Every user request must pass through the Socratic Gate before ANY implementation
|
|
|
97
104
|
| **Code Edit / Bug Fix** | Context Check | Confirm understanding + ask impact questions |
|
|
98
105
|
| **Vague / Simple** | Clarification | Ask Purpose, Users, and Scope |
|
|
99
106
|
|
|
107
|
+
> [!IMPORTANT]
|
|
108
|
+
> **STRICT SOCRATIC & WORKFLOW ENFORCEMENT:**
|
|
109
|
+
> - **DO NOT write any code logic, execute modifications, or create plans before completing the required Socratic Gate action.** Bypassing the Socratic Gate is a P0 protocol violation.
|
|
110
|
+
> - **DO NOT bypass specialized workflow skills** (like `bug-diagnostics` for debugging, `spec-clarification` for specifications, `tdd-loop` for writing code/tests) even if the task or error log seems simple or clear. Bypassing skills is a P0 protocol violation.
|
|
111
|
+
|
|
100
112
|
---
|
|
101
113
|
|
|
102
114
|
## Universal Rules
|