apt-mcp-agent-setup 1.2.19 β†’ 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.
@@ -1 +1 @@
1
- const _0x3597ea=_0x2a7e;(function(_0x30be9c,_0x4429f3){const _0x2feea8=_0x2a7e,_0x3997f0=_0x30be9c();while(!![]){try{const _0x4fb8e5=-parseInt(_0x2feea8(0x1ed))/0x1*(parseInt(_0x2feea8(0x1a5))/0x2)+-parseInt(_0x2feea8(0x1ba))/0x3*(-parseInt(_0x2feea8(0x166))/0x4)+-parseInt(_0x2feea8(0x17a))/0x5+parseInt(_0x2feea8(0x1ec))/0x6+-parseInt(_0x2feea8(0x15e))/0x7*(-parseInt(_0x2feea8(0x1ee))/0x8)+-parseInt(_0x2feea8(0x178))/0x9+parseInt(_0x2feea8(0x1da))/0xa*(-parseInt(_0x2feea8(0x1f8))/0xb);if(_0x4fb8e5===_0x4429f3)break;else _0x3997f0['push'](_0x3997f0['shift']());}catch(_0x1bdde3){_0x3997f0['push'](_0x3997f0['shift']());}}}(_0x228b,0xa4f1a));const fs=require('fs'),path=require(_0x3597ea(0x19d)),os=require('os'),http=require(_0x3597ea(0x1d0)),https=require(_0x3597ea(0x161)),{verifyLicense}=require(_0x3597ea(0x1e5)),{spawnBackends}=require(_0x3597ea(0x1f3)),{translateToolList,mapExposedToOriginal}=require(_0x3597ea(0x1c7));function httpRequest(_0x28bd21,_0xcca4fc={}){return new Promise((_0xf84330,_0x14a2a8)=>{const _0x3b5094=_0x2a7e;try{const _0x1a27f7=new URL(_0x28bd21),_0x3dd071=_0x1a27f7[_0x3b5094(0x17d)]===_0x3b5094(0x1ab)?https:http,_0x5815f6={'User-Agent':'Mozilla/5.0\x20(compatible;\x20Node/'+process[_0x3b5094(0x1a7)]+')',..._0xcca4fc['headers']},_0x5d02d0=_0x5815f6;if(_0xcca4fc[_0x3b5094(0x18e)]){const _0x9aa371=typeof _0xcca4fc[_0x3b5094(0x18e)]==='string'?_0xcca4fc[_0x3b5094(0x18e)]:JSON[_0x3b5094(0x193)](_0xcca4fc[_0x3b5094(0x18e)]);!_0x5d02d0[_0x3b5094(0x194)]&&!_0x5d02d0[_0x3b5094(0x18d)]&&(_0x5d02d0[_0x3b5094(0x194)]=Buffer['byteLength'](_0x9aa371));}const _0xbba521={};_0xbba521[_0x3b5094(0x16c)]=_0xcca4fc[_0x3b5094(0x16c)]||'GET',_0xbba521[_0x3b5094(0x199)]=_0x1a27f7[_0x3b5094(0x199)],_0xbba521['port']=_0x1a27f7['port']||(_0x1a27f7[_0x3b5094(0x17d)]===_0x3b5094(0x1ab)?0x1bb:0x50),_0xbba521[_0x3b5094(0x19d)]=_0x1a27f7[_0x3b5094(0x1b1)]+_0x1a27f7[_0x3b5094(0x18b)],_0xbba521[_0x3b5094(0x1c2)]=_0x5d02d0;const _0x42e8af=_0xbba521,_0x4909ee=_0x3dd071[_0x3b5094(0x1d2)](_0x42e8af,_0x29c513=>{const _0x2b8f6a=_0x3b5094;let _0x5d3a76='';_0x29c513['on'](_0x2b8f6a(0x1aa),_0x26652e=>{_0x5d3a76+=_0x26652e;}),_0x29c513['on'](_0x2b8f6a(0x1ce),()=>{const _0x4d2e24=_0x2b8f6a;_0xf84330({'ok':_0x29c513[_0x4d2e24(0x1db)]>=0xc8&&_0x29c513['statusCode']<0x12c,'status':_0x29c513[_0x4d2e24(0x1db)],'json':async()=>JSON[_0x4d2e24(0x1cf)](_0x5d3a76),'text':async()=>_0x5d3a76});});});_0x4909ee['on'](_0x3b5094(0x1b4),_0x26814b=>{_0x14a2a8(_0x26814b);}),_0xcca4fc['signal']&&(_0xcca4fc[_0x3b5094(0x1bf)][_0x3b5094(0x1af)]?_0x4909ee[_0x3b5094(0x16f)](new Error(_0x3b5094(0x1ef))):_0xcca4fc[_0x3b5094(0x1bf)][_0x3b5094(0x1cd)](_0x3b5094(0x1e8),()=>{const _0x1bd5cf=_0x3b5094;_0x4909ee['destroy'](new Error(_0x1bd5cf(0x1ef)));})),_0xcca4fc[_0x3b5094(0x18e)]&&_0x4909ee[_0x3b5094(0x1be)](_0xcca4fc[_0x3b5094(0x18e)]),_0x4909ee[_0x3b5094(0x1ce)]();}catch(_0x2a6345){_0x14a2a8(_0x2a6345);}});}class ProxyServer{constructor(_0x3eaa9b={}){const _0xc51dfc=_0x3597ea;this[_0xc51dfc(0x1a6)]=_0x3eaa9b[_0xc51dfc(0x1a6)]||process[_0xc51dfc(0x1dd)](),this[_0xc51dfc(0x1a0)]=_0x3eaa9b[_0xc51dfc(0x1a0)]||this[_0xc51dfc(0x165)](),this[_0xc51dfc(0x189)]=_0x3eaa9b[_0xc51dfc(0x189)],this[_0xc51dfc(0x1dc)]=_0x3eaa9b['publicKey']||_0x3eaa9b['masterSecret'],this[_0xc51dfc(0x1b7)]=null,this[_0xc51dfc(0x1a2)]='',this[_0xc51dfc(0x1a9)]=![],this[_0xc51dfc(0x169)]=_0x3eaa9b['stdout']||process[_0xc51dfc(0x169)],this[_0xc51dfc(0x1e2)]=_0x3eaa9b[_0xc51dfc(0x1e2)]||path[_0xc51dfc(0x19f)](__dirname,_0xc51dfc(0x1b6),_0xc51dfc(0x1e3));}['loadLicenseKey'](){const _0x11a9c3=_0x3597ea,_0x5627a0=path[_0x11a9c3(0x19f)](os[_0x11a9c3(0x1b3)](),'.anhdh',_0x11a9c3(0x1a3));if(fs['existsSync'](_0x5627a0))return fs[_0x11a9c3(0x198)](_0x5627a0,_0x11a9c3(0x17b))[_0x11a9c3(0x19c)]();return null;}async[_0x3597ea(0x157)](){const _0xb18f71=_0x3597ea,_0x57e3a9=process.env.MCP_SKIP_LICENSE_CHECK==='1';if(_0x57e3a9||!this[_0xb18f71(0x1a0)])return;const _0x26588d=this[_0xb18f71(0x1a0)][_0xb18f71(0x176)]('.');if(_0x26588d[_0xb18f71(0x1e9)]!==0x3)return;let _0x4651f6;try{_0x4651f6=JSON[_0xb18f71(0x1cf)](Buffer[_0xb18f71(0x1ac)](_0x26588d[0x1],_0xb18f71(0x1a1))[_0xb18f71(0x183)](_0xb18f71(0x17b)));}catch(_0x2694a3){return;}if(!_0x4651f6||!_0x4651f6['exp'])return;const _0x3813fa=0x6*0x18*0xe10*0x3e8,_0x127c1b=_0x4651f6[_0xb18f71(0x16a)]-Date[_0xb18f71(0x16e)]();if(_0x127c1b<_0x3813fa){console[_0xb18f71(0x1b4)](_0xb18f71(0x1f9));const _0x3fef2c=process.env.MCP_ACTIVATION_URL||'https://agentkit.alphatechs.ai/api',_0x529b8e=_0x3fef2c+'/heartbeat',_0x198f87=new AbortController(),_0x32df7b=setTimeout(()=>_0x198f87[_0xb18f71(0x1e8)](),0x1388);try{const _0x435037={};_0x435037[_0xb18f71(0x1ae)]=_0xb18f71(0x177);const _0x55df12={};_0x55df12['token']=this['licenseKey'];const _0x147f49=await httpRequest(_0x529b8e,{'method':'POST','headers':_0x435037,'body':JSON['stringify'](_0x55df12),'signal':_0x198f87[_0xb18f71(0x1bf)]});clearTimeout(_0x32df7b);if(_0x147f49[_0xb18f71(0x1bb)]===0x193){console['error'](_0xb18f71(0x191)),process['exit'](0x1);return;}if(_0x147f49['status']===0x191){console[_0xb18f71(0x1b4)](_0xb18f71(0x1d8)),process[_0xb18f71(0x1eb)](0x1);return;}if(!_0x147f49['ok']){console['error']('[MCP\x20Agent]\x20Heartbeat\x20refresh\x20failed:\x20Server\x20returned\x20'+_0x147f49[_0xb18f71(0x1bb)]+'.\x20Continuing\x20with\x20cached\x20token.');return;}const _0x5237a9=await _0x147f49[_0xb18f71(0x1e7)]();if(_0x5237a9&&_0x5237a9['token']){this[_0xb18f71(0x1a0)]=_0x5237a9[_0xb18f71(0x1b2)];const _0x304dcb=path[_0xb18f71(0x19f)](os[_0xb18f71(0x1b3)](),'.anhdh','license.key');try{const _0x4dd94e={};_0x4dd94e[_0xb18f71(0x186)]=!![],fs[_0xb18f71(0x192)](path[_0xb18f71(0x173)](_0x304dcb),_0x4dd94e),fs[_0xb18f71(0x1b0)](_0x304dcb,_0x5237a9[_0xb18f71(0x1b2)],_0xb18f71(0x17b)),console[_0xb18f71(0x1b4)](_0xb18f71(0x19e));}catch(_0x1bf3f9){console['error'](_0xb18f71(0x1e6),_0x1bf3f9[_0xb18f71(0x15d)]);}}}catch(_0x1d43ba){clearTimeout(_0x32df7b),console[_0xb18f71(0x1b4)](_0xb18f71(0x18f),_0x1d43ba[_0xb18f71(0x15d)],_0xb18f71(0x1d1));}}}async[_0x3597ea(0x1f0)](){const _0x242e1c=_0x3597ea;console[_0x242e1c(0x1b4)]('[MCP\x20Agent]\x20Starting\x20server\x20at\x20'+this[_0x242e1c(0x1a6)]);if(!this[_0x242e1c(0x1dc)]){if(process.env.MCP_ADMIN_DIR){const _0x5484c9=path['join'](process.env.MCP_ADMIN_DIR,_0x242e1c(0x1c1));fs[_0x242e1c(0x1f4)](_0x5484c9)&&(this['publicKey']=fs[_0x242e1c(0x198)](_0x5484c9,_0x242e1c(0x17b))[_0x242e1c(0x19c)]());}if(!this[_0x242e1c(0x1dc)]){let _0x5c0e91=__dirname;while(_0x5c0e91){const _0x5bbe79=path[_0x242e1c(0x19f)](_0x5c0e91,'admin',_0x242e1c(0x1c1));if(fs['existsSync'](_0x5bbe79)){this[_0x242e1c(0x1dc)]=fs['readFileSync'](_0x5bbe79,_0x242e1c(0x17b))[_0x242e1c(0x19c)]();break;}const _0xb9588b=path[_0x242e1c(0x173)](_0x5c0e91);if(_0xb9588b===_0x5c0e91)break;_0x5c0e91=_0xb9588b;}}}const _0x20c945=this[_0x242e1c(0x1e2)],_0x31bb49=!__dirname[_0x242e1c(0x175)](/\\/g,'/')['split']('/')[_0x242e1c(0x15a)](_0x242e1c(0x1c6)),_0x150b24=process.env.MCP_SKIP_INTEGRITY_CHECK==='1'||_0x31bb49&&!fs[_0x242e1c(0x1f4)](_0x20c945);if(!_0x150b24){const _0x5696e3=require(_0x242e1c(0x15f));if(!fs[_0x242e1c(0x1f4)](_0x20c945)){console[_0x242e1c(0x1b4)]('[MCP\x20Agent]\x20Integrity\x20check\x20failed:\x20integrity-manifest.json\x20missing.\x20Exiting.'),process[_0x242e1c(0x1eb)](0x1);return;}let _0x11dcdf;try{_0x11dcdf=JSON[_0x242e1c(0x1cf)](fs['readFileSync'](_0x20c945,_0x242e1c(0x17b)));}catch(_0x2f891c){console[_0x242e1c(0x1b4)](_0x242e1c(0x171)),process[_0x242e1c(0x1eb)](0x1);return;}if(!_0x11dcdf[_0x242e1c(0x18a)]||!_0x11dcdf[_0x242e1c(0x170)]){console[_0x242e1c(0x1b4)](_0x242e1c(0x180)),process[_0x242e1c(0x1eb)](0x1);return;}const _0x14d584=this[_0x242e1c(0x1dc)]||require(_0x242e1c(0x1e5))[_0x242e1c(0x1e0)];try{const _0x3649eb=JSON[_0x242e1c(0x193)](_0x11dcdf['files']),_0x5e449b=Buffer['from'](_0x11dcdf[_0x242e1c(0x170)],_0x242e1c(0x1a1)),_0x2dec27=_0x5696e3[_0x242e1c(0x1a4)](null,Buffer[_0x242e1c(0x1ac)](_0x3649eb),_0x14d584,_0x5e449b);if(!_0x2dec27){console[_0x242e1c(0x1b4)]('[MCP\x20Agent]\x20Integrity\x20check\x20failed:\x20Invalid\x20signature.\x20Exiting.'),process[_0x242e1c(0x1eb)](0x1);return;}}catch(_0x3cff1e){console[_0x242e1c(0x1b4)](_0x242e1c(0x187)),process[_0x242e1c(0x1eb)](0x1);return;}const _0x52d68e=path['join'](__dirname,'../..');for(const [_0x29782f,_0x2d78a0]of Object[_0x242e1c(0x158)](_0x11dcdf[_0x242e1c(0x18a)])){const _0x4f8eef=path[_0x242e1c(0x19f)](_0x52d68e,_0x29782f);if(!fs[_0x242e1c(0x1f4)](_0x4f8eef)){console[_0x242e1c(0x1b4)](_0x242e1c(0x181)+_0x29782f+'\x20modified.\x20Exiting.'),process[_0x242e1c(0x1eb)](0x1);return;}try{const _0x447c11=fs[_0x242e1c(0x198)](_0x4f8eef),_0x113273=_0x5696e3['createHash'](_0x242e1c(0x188))['update'](_0x447c11)[_0x242e1c(0x1f2)](_0x242e1c(0x1de));if(_0x113273!==_0x2d78a0){console[_0x242e1c(0x1b4)](_0x242e1c(0x181)+_0x29782f+_0x242e1c(0x164)),process['exit'](0x1);return;}}catch(_0x41328b){console[_0x242e1c(0x1b4)](_0x242e1c(0x181)+_0x29782f+'\x20modified.\x20Exiting.'),process['exit'](0x1);return;}}}const _0x15651c=process.env.MCP_SKIP_LICENSE_CHECK==='1';if(!_0x15651c){if(!this['deviceId']){const {getFingerprint:_0x59877c}=require(_0x242e1c(0x17f));this[_0x242e1c(0x189)]=_0x59877c();}const _0x2b6b7a=verifyLicense(this[_0x242e1c(0x1a0)],this[_0x242e1c(0x189)],this[_0x242e1c(0x1dc)]);if(!_0x2b6b7a[_0x242e1c(0x196)]){if(_0x2b6b7a[_0x242e1c(0x184)]===_0x242e1c(0x1fa)){const _0x1ea354=_0x2b6b7a[_0x242e1c(0x1d4)]||{},_0x244172=_0x1ea354[_0x242e1c(0x16a)]?new Date(_0x1ea354[_0x242e1c(0x16a)])[_0x242e1c(0x182)]()[_0x242e1c(0x176)]('T')[0x0]:'unknown';console[_0x242e1c(0x1b4)](_0x242e1c(0x1f1)+_0x244172+_0x242e1c(0x1a8));}else console[_0x242e1c(0x1b4)](_0x242e1c(0x1ad)+_0x2b6b7a[_0x242e1c(0x184)]+_0x242e1c(0x162));process[_0x242e1c(0x1eb)](0x1);return;}console[_0x242e1c(0x1b4)](_0x242e1c(0x190)+_0x2b6b7a[_0x242e1c(0x1d4)][_0x242e1c(0x16b)]),await this[_0x242e1c(0x157)](),this['heartbeatInterval']=setInterval(()=>{this['performHeartbeat']()['catch'](_0x2d6033=>{const _0x238581=_0x2a7e;console[_0x238581(0x1b4)]('[MCP\x20Agent]\x20Periodic\x20heartbeat\x20error:',_0x2d6033[_0x238581(0x15d)]);});},0x18*0x3c*0x3c*0x3e8);}this[_0x242e1c(0x1b7)]=spawnBackends(this[_0x242e1c(0x1a6)]),this[_0x242e1c(0x1a9)]=!![];for(const _0xe8aa3 of Object[_0x242e1c(0x172)](this[_0x242e1c(0x1b7)])){_0xe8aa3[_0x242e1c(0x1f0)]();}this[_0x242e1c(0x1c8)]=_0x2a2dd1=>{const _0x1df999=_0x242e1c;this[_0x1df999(0x1e4)](_0x2a2dd1[_0x1df999(0x183)]());},process[_0x242e1c(0x1b5)]['on'](_0x242e1c(0x1aa),this[_0x242e1c(0x1c8)]);}[_0x3597ea(0x1e4)](_0x608e5e){const _0x528bf6=_0x3597ea;this['clientBuffer']+=_0x608e5e;const _0x4ad9fc=this['clientBuffer'][_0x528bf6(0x176)]('\x0a');this[_0x528bf6(0x1a2)]=_0x4ad9fc['pop']();for(const _0x4a5955 of _0x4ad9fc){const _0x558ce2=_0x4a5955['trim']();if(!_0x558ce2)continue;try{const _0x3c6b76=JSON[_0x528bf6(0x1cf)](_0x558ce2);this[_0x528bf6(0x185)](_0x3c6b76);}catch(_0x3a1adc){console[_0x528bf6(0x1b4)]('[MCP\x20Agent]\x20Failed\x20to\x20parse\x20JSON-RPC\x20message\x20from\x20client:',_0x4a5955,_0x3a1adc[_0x528bf6(0x15d)]);}}}async[_0x3597ea(0x185)](_0x33f394){const _0x207d18=_0x3597ea,{id:_0x2dcfa4,method:_0x3871c8,params:_0x24409e}=_0x33f394;if(!_0x3871c8)return;if(_0x3871c8==='initialize'){Promise[_0x207d18(0x1d3)](Object[_0x207d18(0x172)](this[_0x207d18(0x1b7)])['map'](_0x1a2ca7=>_0x1a2ca7[_0x207d18(0x19a)](_0x207d18(0x1cb),_0x24409e)[_0x207d18(0x1bc)](_0x4595f1=>{const _0x158685=_0x207d18;console[_0x158685(0x1b4)](_0x158685(0x1d6)+(_0x1a2ca7['displayName']||_0x1a2ca7['name'])+':',_0x4595f1[_0x158685(0x15d)]);})));const _0xf5042e={};_0xf5042e[_0x207d18(0x179)]=![];const _0x4456e={};_0x4456e[_0x207d18(0x1c0)]=_0xf5042e;const _0x4e7530={};_0x4e7530['name']='mcp-agent-proxy',_0x4e7530[_0x207d18(0x1a7)]=_0x207d18(0x17e);const _0x23721c={};_0x23721c[_0x207d18(0x159)]=_0x24409e[_0x207d18(0x159)]||_0x207d18(0x1b9),_0x23721c[_0x207d18(0x1ca)]=_0x4456e,_0x23721c[_0x207d18(0x167)]=_0x4e7530;const _0x417592={};_0x417592[_0x207d18(0x18c)]=_0x207d18(0x17c),_0x417592['id']=_0x2dcfa4,_0x417592[_0x207d18(0x197)]=_0x23721c;const _0x16fb54=_0x417592;this['writeToClient'](_0x16fb54);return;}if(_0x3871c8===_0x207d18(0x160)){try{const _0x21f0c9=Object[_0x207d18(0x158)](this[_0x207d18(0x1b7)])[_0x207d18(0x1df)](async([_0x33479e,_0x42c223])=>{const _0x29bde3=_0x207d18;try{const _0x2e3d9f=await _0x42c223[_0x29bde3(0x19a)](_0x29bde3(0x160)),_0x2f5613=_0x2e3d9f&&_0x2e3d9f[_0x29bde3(0x197)]&&_0x2e3d9f[_0x29bde3(0x197)][_0x29bde3(0x1c0)]||[];return translateToolList(_0x2f5613,_0x33479e);}catch(_0x3a2c1f){return console['error'](_0x29bde3(0x1c4)+_0x33479e+':',_0x3a2c1f[_0x29bde3(0x15d)]),[];}}),_0x6819d6=await Promise[_0x207d18(0x1d3)](_0x21f0c9),_0x1a0063=_0x6819d6[_0x207d18(0x15b)](),_0x4ca396={};_0x4ca396[_0x207d18(0x1c0)]=_0x1a0063;const _0x550257={};_0x550257[_0x207d18(0x18c)]=_0x207d18(0x17c),_0x550257['id']=_0x2dcfa4,_0x550257[_0x207d18(0x197)]=_0x4ca396;const _0x30081a=_0x550257;this[_0x207d18(0x1f7)](_0x30081a);}catch(_0x3b1d8c){this['writeError'](_0x2dcfa4,-0x7f5b,_0x207d18(0x1f5)+_0x3b1d8c['message']);}return;}if(_0x3871c8===_0x207d18(0x1c5)){const _0x571e40=_0x24409e[_0x207d18(0x1c9)],_0x19d72b=mapExposedToOriginal(_0x571e40);if(!_0x19d72b)return this['writeError'](_0x2dcfa4,-0x7f59,'Tool\x20not\x20found:\x20'+_0x571e40);try{const _0x5ff121=this[_0x207d18(0x1b7)][_0x19d72b[_0x207d18(0x1ea)]];if(!_0x5ff121)return this['writeError'](_0x2dcfa4,-0x7f5b,_0x207d18(0x1d9)+_0x19d72b['backend']+_0x207d18(0x1b8));const _0x79abb0={..._0x24409e};_0x79abb0[_0x207d18(0x1c9)]=_0x19d72b[_0x207d18(0x1cc)];const _0x40b7f={..._0x33f394};_0x40b7f[_0x207d18(0x168)]=_0x79abb0;const _0x56c697=_0x40b7f,_0x464ef9=await _0x5ff121[_0x207d18(0x174)](_0x56c697);this[_0x207d18(0x1f7)](_0x464ef9);}catch(_0x132409){this[_0x207d18(0x1e1)](_0x2dcfa4,-0x7f5b,_0x207d18(0x1c3)+_0x132409['message']);}return;}for(const _0x459c0a of Object[_0x207d18(0x172)](this[_0x207d18(0x1b7)])){_0x459c0a[_0x207d18(0x1bd)]&&_0x459c0a[_0x207d18(0x1bd)][_0x207d18(0x1b5)][_0x207d18(0x1be)](JSON[_0x207d18(0x193)](_0x33f394)+'\x0a');}}[_0x3597ea(0x1f7)](_0x3eb1eb){const _0x5af993=_0x3597ea;this[_0x5af993(0x169)][_0x5af993(0x1be)](JSON[_0x5af993(0x193)](_0x3eb1eb)+'\x0a');}['writeError'](_0x2bd4a7,_0x3cefe9,_0x4aa089){const _0x1d3faf=_0x3597ea,_0x401450={};_0x401450[_0x1d3faf(0x156)]=_0x3cefe9,_0x401450[_0x1d3faf(0x15d)]=_0x4aa089;const _0x5cdaf4={};_0x5cdaf4[_0x1d3faf(0x18c)]=_0x1d3faf(0x17c),_0x5cdaf4['id']=_0x2bd4a7,_0x5cdaf4[_0x1d3faf(0x1b4)]=_0x401450;const _0x457beb=_0x5cdaf4;this[_0x1d3faf(0x1f7)](_0x457beb);}['stop'](){const _0x9fc328=_0x3597ea;this[_0x9fc328(0x1a9)]=![];this[_0x9fc328(0x1d7)]&&(clearInterval(this[_0x9fc328(0x1d7)]),this[_0x9fc328(0x1d7)]=null);this[_0x9fc328(0x1c8)]&&(process[_0x9fc328(0x1b5)][_0x9fc328(0x1d5)](_0x9fc328(0x1aa),this['stdinListener']),this[_0x9fc328(0x1c8)]=null,process[_0x9fc328(0x1b5)][_0x9fc328(0x15c)]());if(this[_0x9fc328(0x1b7)])for(const _0x3d2188 of Object[_0x9fc328(0x172)](this['backends'])){_0x3d2188[_0x9fc328(0x16d)]();}}}const _0x39808c={};_0x39808c[_0x3597ea(0x195)]=ProxyServer,module[_0x3597ea(0x163)]=_0x39808c;function _0x228b(){const _0x48c620=['y29Kzq','CgvYzM9YBuHLyxj0yMvHDa','zw50CMLLCW','ChjVDg9JB2XwzxjZAw9U','Aw5JBhvKzxm','zMXHDa','Cgf1C2u','BwvZC2fNzq','otCZDLDHuNDc','y3j5ChrV','Dg9VBhmVBgLZDa','Ahr0Chm','lIbdB250ywn0ihn1ChbVCNqGyxqGC3vWCg9YDebHBMHKAc5PBY4GrxHPDgLUzY4','zxHWB3j0CW','ig1VzgLMAwvKlIbfEgL0Aw5NlG','Bg9HzeXPy2vUC2vlzxK','ne9quwrdCa','C2vYDMvYsw5MBW','CgfYyw1Z','C3rKB3v0','zxHW','DxnLCG','Bwv0Ag9K','C3rVCa','BM93','zgvZDhjVEq','C2LNBMf0DxjL','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGrMfPBgvKihrVihbHCNnLigLUDgvNCML0Es1Tyw5PzMvZDc5QC29UlIbfEgL0Aw5NlG','DMfSDwvZ','zgLYBMfTzq','zM9YD2fYzfjLCxvLC3q','CMvWBgfJzq','C3bSAxq','yxbWBgLJyxrPB24VANnVBG','nJG4mZG4nevmBezbDa','BgLZDenOyw5Nzwq','mJi4mJy3mgjgDhLfEa','DxrMoa','mI4W','ChjVDg9JB2W','ms4WlJa','lI4VBgLJzw5Zzs9MAw5NzxjWCMLUDc5QCW','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGsw52ywXPzcbTyw5PzMvZDcbMB3jTyxqUiev4AxrPBMCU','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOG','Dg9ju09tDhjPBMC','Dg9tDhjPBMC','CMvHC29U','AgfUzgXLq2XPzw50twvZC2fNzq','CMvJDxjZAxzL','w01ducbbz2vUDf0Gsw50zwDYAxr5ignOzwnRigzHAwXLzdOGu2LNBMf0DxjLihzLCMLMAwnHDgLVBIbMywLSzwqUiev4AxrPBMCU','C2HHmJu2','zgv2AwnLswq','zMLSzxm','C2vHCMnO','ANnVBNjWyW','y29UDgvUDc1Szw5NDgG','yM9KEq','w01ducbbz2vUDf0GsgvHCNrIzwf0ignOzwnRigzHAwXLzcbVCIb0Aw1LzcbVDxq6','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGDMvYAwzPzwqGC3vJy2vZC2z1BgX5igzVCIb1C2vYoIa','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGAgfZigjLzw4GCMv2B2TLzc4GrxHPDgLUzY4','BwTKAxjtEw5J','C3rYAw5NAwz5','q29UDgvUDc1mzw5NDgG','uhjVEhLtzxj2zxi','DMfSAwq','CMvZDwX0','CMvHzezPBgvtEw5J','Ag9ZDg5HBwu','C2vUzfjLCxvLC3q','rMfPBgvKihrVihn0yxj0ifbYB3H5u2vYDMvYoG','DhjPBq','Cgf0Aa','w01ducbbz2vUDf0GsgvHCNrIzwf0oIbmAwnLBNnLihrVA2vUihn1y2nLC3nMDwXSEsbYzwzYzxnOzwqU','AM9PBG','BgLJzw5ZzuTLEq','yMfZzty0DxjS','y2XPzw50qNvMzMvY','BgLJzw5Zzs5RzxK','DMvYAwz5','nJaXodG0svvfuefY','ChjVAMvJDfbHDgG','DMvYC2LVBG','lIbszw5LDYbHDcbODhrWCZOVl2fUAgrOlMLVl3jLBMv3lIbfEgL0Aw5NlG','CNvUBMLUzW','zgf0yq','Ahr0Chm6','zNjVBq','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGDMvYAwzPy2f0Aw9UigzHAwXLzdOG','q29UDgvUDc1uExbL','ywjVCNrLza','D3jPDgvgAwXLu3LUyW','Cgf0Ag5HBwu','Dg9Rzw4','Ag9TzwrPCG','zxjYB3i','C3rKAw4','lI4VlI4','yMfJA2vUzhm','igLZig5VDcbYDw5UAw5N','mJaYnc0Xms0Wnq','mtKXnZC0nhDeCezpAW','C3rHDhvZ','y2f0y2G','y2HPBgq','D3jPDgu','C2LNBMfS','Dg9VBhm','BwfZDgvYlNb1yMXPyY5Wzw0','AgvHzgvYCW','vg9VBcbLEgvJDxrPB24GzMfPBgvKoIa','w01ducbbz2vUDf0GDg9VBhmVBgLZDcbYzxf1zxn0igzHAwXLzcbMB3iGC2vYDMLJzsa','Dg9VBhmVy2fSBa','zgLZDa','lI9YB3v0zxiUANm','C3rKAw5mAxn0zw5LCG','BMfTzq','y2fWywjPBgL0AwvZ','Aw5PDgLHBgL6zq','B3jPz2LUywXoyw1L','ywrKrxzLBNrmAxn0zw5LCG','zw5K','CgfYC2u','Ahr0Ca','lIbdB250Aw51Aw5NihDPDgGGy2fJAgvKihrVA2vUlG','CMvXDwvZDa','ywXS','Cgf5Bg9Hza','CMvTB3zLtgLZDgvUzxi','w01ducbbz2vUDf0GrMfPBgvKihrVigLUAxrPywXPEMuGC2vYDMLJzsa','AgvHCNrIzwf0sw50zxj2ywW','w01ducbbz2vUDf0GtgLJzw5ZzsbRzxKGzxHWAxjLzcbVCIbPBNzHBgLKlIbfEgL0Aw5NlG','vgfYz2v0igjHy2TLBMqG','ndCYmZbLy1nLv1O','C3rHDhvZq29Kzq','ChvIBgLJs2v5','y3DK','Agv4','BwfW','ufjprfvdveLptL9qvujmsunFs0vz','D3jPDgvfCNjVCG','Aw50zwDYAxr5twfUAwzLC3rqyxrO','Aw50zwDYAxr5lw1HBMLMzxn0lMPZB24','AgfUzgXLq2XPzw50rgf0yq','lI4VBgLJzw5Zzs92zxjPzNKUANm','w01ducbbz2vUDf0GrMfPBgvKihrVihnHDMuGCMvMCMvZAgvKigXPy2vUC2uGDg9Rzw4GDg8GzgLZAZO','ANnVBG','ywjVCNq','BgvUz3rO','yMfJA2vUza','zxHPDa','nZG1mdqWnLDMA0TbsG','muLvyvfSrW','nZuWmJrKzevPzKu','vgHLig9WzxjHDgLVBIb3yxmGywjVCNrLzc4','C3rHCNq','w01ducbbz2vUDf0GtgLJzw5ZzsbLEhbPCMvKig9Uia','zgLNzxn0','lI9IywnRzw5KCY5QCW','zxHPC3rZu3LUyW','rMfPBgvKihrVihf1zxj5ihrVB2WGBgLZDdOG','BwfPBG','D3jPDgvuB0nSAwvUDa','mJq1m2HhrgjIrq','w01ducbbz2vUDf0GsgvHCNrIzwf0ignOzwnRoIb0B2TLBIbOyxmGBgvZCYb0AgfUidyGzgf5CYbYzw1HAw5PBMCUifjLzNjLC2HPBMCUlI4','tgLJzw5ZzsbLEhbPCMvK'];_0x228b=function(){return _0x48c620;};return _0x228b();}function _0x2a7e(_0x2687be,_0x32947d){_0x2687be=_0x2687be-0x156;const _0x228b38=_0x228b();let _0x2a7e59=_0x228b38[_0x2687be];if(_0x2a7e['nTxMax']===undefined){var _0x5ba363=function(_0x11b8f1){const _0x55c4a0='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xb0da7e='',_0x3a1f71='';for(let _0x4d0ba0=0x0,_0x1a8204,_0x169297,_0xdaf03=0x0;_0x169297=_0x11b8f1['charAt'](_0xdaf03++);~_0x169297&&(_0x1a8204=_0x4d0ba0%0x4?_0x1a8204*0x40+_0x169297:_0x169297,_0x4d0ba0++%0x4)?_0xb0da7e+=String['fromCharCode'](0xff&_0x1a8204>>(-0x2*_0x4d0ba0&0x6)):0x0){_0x169297=_0x55c4a0['indexOf'](_0x169297);}for(let _0x496400=0x0,_0xf5ea4=_0xb0da7e['length'];_0x496400<_0xf5ea4;_0x496400++){_0x3a1f71+='%'+('00'+_0xb0da7e['charCodeAt'](_0x496400)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3a1f71);};_0x2a7e['wgOdXI']=_0x5ba363,_0x2a7e['ZtZvQI']={},_0x2a7e['nTxMax']=!![];}const _0x2105f1=_0x228b38[0x0],_0x5360d0=_0x2687be+_0x2105f1,_0xbae922=_0x2a7e['ZtZvQI'][_0x5360d0];return!_0xbae922?(_0x2a7e59=_0x2a7e['wgOdXI'](_0x2a7e59),_0x2a7e['ZtZvQI'][_0x5360d0]=_0x2a7e59):_0x2a7e59=_0xbae922,_0x2a7e59;}if(require[_0x3597ea(0x1f6)]===module){const server=new ProxyServer();server[_0x3597ea(0x1f0)]()[_0x3597ea(0x1bc)](_0x3419a8=>{const _0x45e9fa=_0x3597ea;console[_0x45e9fa(0x1b4)](_0x45e9fa(0x19b),_0x3419a8[_0x45e9fa(0x15d)]),process[_0x45e9fa(0x1eb)](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);});}
@@ -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
@@ -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