@syke1/mcp-server 1.6.0 → 1.7.0

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,925 @@
1
- 'use strict';const _0x7171ec=_0x42a8;(function(_0x46ceab,_0x2e4810){const _0x50fdc2={_0x225ed3:0x1bd,_0xa19845:0x1ad,_0x2f1daf:0x18b,_0x2dcdf0:0x16e,_0x21778c:0x1d1,_0x681bdf:0xe6,_0x5b7d31:0x11e},_0x3241f6=_0x42a8,_0x20ec9e=_0x46ceab();while(!![]){try{const _0x12a8e6=parseInt(_0x3241f6(_0x50fdc2._0x225ed3))/0x1*(-parseInt(_0x3241f6(_0x50fdc2._0xa19845))/0x2)+parseInt(_0x3241f6(0xbc))/0x3*(parseInt(_0x3241f6(_0x50fdc2._0x2f1daf))/0x4)+parseInt(_0x3241f6(0x167))/0x5+parseInt(_0x3241f6(_0x50fdc2._0x2dcdf0))/0x6*(parseInt(_0x3241f6(0x121))/0x7)+-parseInt(_0x3241f6(0xec))/0x8*(parseInt(_0x3241f6(_0x50fdc2._0x21778c))/0x9)+-parseInt(_0x3241f6(_0x50fdc2._0x681bdf))/0xa*(parseInt(_0x3241f6(0x12e))/0xb)+parseInt(_0x3241f6(_0x50fdc2._0x5b7d31))/0xc;if(_0x12a8e6===_0x2e4810)break;else _0x20ec9e['push'](_0x20ec9e['shift']());}catch(_0x58d325){_0x20ec9e['push'](_0x20ec9e['shift']());}}}(_0x1813,0xb0dba));var __createBinding=this&&this['__createBinding']||(Object['create']?function(_0x22816c,_0x3d4978,_0x43ffa6,_0x13c47f){const _0x555e85={_0x2be01b:0x1b5,_0x3faf24:0x171,_0x1cd617:0x177},_0x215f3c=_0x42a8,_0x24f3ea={};_0x24f3ea['hvowE']=function(_0x5d8d61,_0x2bd427){return _0x5d8d61===_0x2bd427;},_0x24f3ea[_0x215f3c(_0x555e85._0x2be01b)]='get';const _0x2937f3=_0x24f3ea;if(_0x2937f3[_0x215f3c(_0x555e85._0x3faf24)](_0x13c47f,undefined))_0x13c47f=_0x43ffa6;var _0x5ecfce=Object['getOwnPropertyDescriptor'](_0x3d4978,_0x43ffa6);if(!_0x5ecfce||(_0x2937f3[_0x215f3c(0x1b5)]in _0x5ecfce?!_0x3d4978['__esModule']:_0x5ecfce[_0x215f3c(0x18e)]||_0x5ecfce['configurable'])){const _0x112553={};_0x112553[_0x215f3c(_0x555e85._0x1cd617)]=!![],_0x112553['get']=function(){return _0x3d4978[_0x43ffa6];},_0x5ecfce=_0x112553;}Object[_0x215f3c(0xc3)](_0x22816c,_0x13c47f,_0x5ecfce);}:function(_0x2d19ca,_0x4f410c,_0x100880,_0x350a0f){const _0x512e86={};_0x512e86['FWSpO']=function(_0x2eb874,_0x246f5d){return _0x2eb874===_0x246f5d;};const _0x4c841a=_0x512e86;if(_0x4c841a['FWSpO'](_0x350a0f,undefined))_0x350a0f=_0x100880;_0x2d19ca[_0x350a0f]=_0x4f410c[_0x100880];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(_0x1f4a6c,_0x1f527e){const _0x399e81={_0x1837e2:0xc3},_0x58319f=_0x42a8,_0x59a19c={};_0x59a19c['enumerable']=!![],_0x59a19c['value']=_0x1f527e,Object[_0x58319f(_0x399e81._0x1837e2)](_0x1f4a6c,_0x58319f(0xb3),_0x59a19c);}:function(_0xc66098,_0x466b8d){const _0x51f967=_0x42a8;_0xc66098[_0x51f967(0xb3)]=_0x466b8d;}),__importStar=this&&this[_0x7171ec(0x1f7)]||(function(){const _0x2c77bf={_0x306918:0x1a4},_0x5cacc2={_0x10eb42:0x1f8},_0x3a896d={_0x1fe4fc:0x1a4},_0xfe0c32={'lpPaB':function(_0x24947c,_0x5a32df){return _0x24947c(_0x5a32df);},'qAAoB':'default'};var _0x37974d=function(_0x4265f7){const _0x33574f=_0x42a8;return _0x37974d=Object[_0x33574f(_0x5cacc2._0x10eb42)]||function(_0x3648d2){const _0x2fe06d=_0x33574f;var _0x5108b4=[];for(var _0x104921 in _0x3648d2)if(Object['prototype']['hasOwnProperty'][_0x2fe06d(0x147)](_0x3648d2,_0x104921))_0x5108b4[_0x5108b4[_0x2fe06d(_0x3a896d._0x1fe4fc)]]=_0x104921;return _0x5108b4;},_0x37974d(_0x4265f7);};return function(_0x123a4b){const _0x56817c=_0x42a8;if(_0x123a4b&&_0x123a4b['__esModule'])return _0x123a4b;var _0x3bca95={};if(_0x123a4b!=null){for(var _0x3a1b28=_0xfe0c32['lpPaB'](_0x37974d,_0x123a4b),_0x2a9f9a=0x0;_0x2a9f9a<_0x3a1b28[_0x56817c(_0x2c77bf._0x306918)];_0x2a9f9a++)if(_0x3a1b28[_0x2a9f9a]!==_0xfe0c32['qAAoB'])__createBinding(_0x3bca95,_0x123a4b,_0x3a1b28[_0x2a9f9a]);}return __setModuleDefault(_0x3bca95,_0x123a4b),_0x3bca95;};}()),__importDefault=this&&this['__importDefault']||function(_0x3f226a){const _0x39a279=_0x7171ec;return _0x3f226a&&_0x3f226a[_0x39a279(0x155)]?_0x3f226a:{'default':_0x3f226a};};const _0x2bfffc={};_0x2bfffc[_0x7171ec(0x1db)]=!![],Object[_0x7171ec(0xc3)](exports,_0x7171ec(0x155),_0x2bfffc),exports['addWarning']=addWarning,exports['getUnacknowledgedWarnings']=getUnacknowledgedWarnings,exports[_0x7171ec(0x1eb)]=acknowledgeWarnings,exports['getAllWarnings']=getAllWarnings,exports['createWebServer']=createWebServer;const path=__importStar(require('path')),fs=__importStar(require('fs')),express_1=__importDefault(require(_0x7171ec(0x1de))),plugin_1=require(_0x7171ec(0xdf)),analyze_impact_1=require('../tools/analyze-impact'),analyzer_1=require('../ai/analyzer'),realtime_analyzer_1=require(_0x7171ec(0x1ec)),config_1=require('../config');let realtimeAIEnabled=!![];function _0x1813(){const _0x5c7d08=['CMLZA0XLDMvS','zw51BwvYywjSzq','q29UDgvUDc1uExbL','ANnVBG','DgfYz2v0','C3nLq2XPzw50CW','ChLWCM9Qzwn0lNrVBwW','l3jVDxrLCI8','CvfbAMW','x25VDgLMAwvYlMrHCNq','Dg90ywXgAwXLCW','A0f4DKm','l3rLC3qV','x2HLBhbLCI5Kyxj0','AuP5C2O','CujZtMm','s296CKe','C2v0','zMLSzunVDw50','x3rPBguUzgfYDa','quKGyw5HBhLZAxmGzMfPBgvK','ngL0AwPnyW','ChvIC3bLyY55yw1S','x3bHz2uUzgfYDa','D3jPDgfIBgu','Cg9ZDa','x3rLC3q','l3bHz2vZlW','CLnRq2q','zgLYBMfTzq','Aw5JBhvKzxm','wwLRt1O','D2LUmZi','l2fWAs9ZzxqTywKTA2v5','q3DxBKK','zMLSzq','C29Tzq','CMvSyxrPDMu','wefXuK8','x2rHDgfFC291CMnL','rgLYzwn0B3j5ig5VDcbMB3vUzdOG','EMvgvLi','BMfTzq','CMv2zxjZzq','wxrpBLC','Bw9KAwz5','BgvUz3rO','l21VzgvSCY8','Dw5YzxnVBhzLzenVDw50','C2HPzNq','yNjVA2vUsw1WB3j0CW','l2fWAs9ZzxqTywKTChjVDMLKzxi','CMvWBgfJzq','zM9YD2fYza','l2fWAs9NCMfWAa','ota3ndmWCKnVBwzh','l3bYzxnLBNrHDgLVBI8','lMnVBMzPzY5QCW','tNj3D2i','BwvZC2fNzq','zwrPDa','C3bSAxq','ywn0AxzLuhjVDMLKzxi','yKjUBe0','BwDdswW','uMvHBc10Aw1Lig1VBML0B3jPBMC','u0jYCw8','Dw5ZAgLMDa','Cgf0Aa','yw5HBhL6zvDPDgHbsq','zwrNzxndAgfUz2vK','m2vhzhnjva','CgfYyw1Z','zxbhtvK','x3bHz2u','yNvPBgqUz3jHzgXL','C2LKzuvMzMvJDhm','D2L0AezPBgvuExbLCW','x2nSAwvUDc5Kyxj0','x3bYB3zPzgvYlMrHCNq','BwfW','D2vIl3nLCNzLCG','C2XPy2u','B3LxBMC','BMv3','l2fWAs93yxjUAw5NCW','y2XVDwrFzNvUy3rPB24','BvjbDhe','DxbNCMfKzq','zM9Yy2vK','zLDxru8','mJm3mduZn3bRDfHzBa','DNfNC2u','Dg90ywXdB3vUDa','tw92AMC','t0LMzxm','Ee1oAfq','AxneAxjLy3rVCNK','BhzosuC','D2fYBMLUz3m','x3nJCMvLBG','DMfSDwu','z0rZv2S','AM9PBG','zxHWCMvZCW','CNz4wMe','C2v0rMLSzunHy2HL','B3PRru4','yxbWlW','WRFcT8k3WRC','vfPLrfy','twnhuwm','DxnL','wffHDge','D2f0y2HLCI8','lNv0AwWUDhm','uNjxsNy','ywnRBM93BgvKz2vxyxjUAw5NCW','lI4VywKVCMvHBhrPBwuTyw5HBhL6zxi','cMrHDge6ia','CerADMO','Dg90ywXmAw5LCW','tNPhEfy','x3nLCNzPy2uUzgfYDa','l2rVBwfPBI8','rgvSzxrLihnPBxvSyxrPB24','CgXHBG','twfRzwzPBgu','y29TCg9Uzw50CY8','x19PBxbVCNrtDgfY','z2v0t3DUuhjVCgvYDhLoyw1LCW','y2fJAgvtAxPL','AvHbqM0','rMfPBgvKihrVihn3AxrJAcbWCM9Qzwn0','C29YDa','zw52','Aw5KzxGUDhm','q09orKLh','tM90igeGzgLYzwn0B3j5oIa','yw5HBhL6zunOyw5NzvjLywX0Aw1L','C2L6zq','C3rYAw5N','l2fWAs9LDMvUDhm','qvbj','seLhsa','zMLSzsbYzxf1AxjLza','t3f3C0W','zgvMyxvSDa','ChvZAa','rMLSzsbUB3qGzM91BMq6ia','y29UBMvJDgvKtM9Kzxm','zw5tCu0','D3jPDgu','y29UzMLNDxjLza','C3vJy2vZCW','l2fWCgXPy2f0Aw9UlW','mtu2mdq1m01ese5xzG','zMXJteS','BM8Ty2fJAgu','vfjeu0u','C3rHCNrZv2L0Aa','ru5bqKXfra','C21tuLK','zgvMAw5LuhjVCgvYDhK','jfjfq1LdteuUqKLo','CMvSyxrPDMvqyxrO','C291CMnLrgLY','z2v0','AgfZ','C2vYDMvYlMPZ','zNjVBsbHBMqGDg8GCMvXDwLYzwq','uezXyxC','ChjVDMLKzxiGBxvZDcbIzsbNzw1PBMKSig9Wzw5HAsWGB3iGyw50AhjVCgLJ','uhDRDeO','BM9YBwfSAxPL','ufjpra','zM9YrwfJAa','quKGyw5HBhLZAxm','Cg9W','l2fWAs9ODwiTzMLSzxm','AxnbyNnVBhv0zq','CMvHC29U','x3zPzxCUzgfYDa','vhjPywWGzxHWAxjLzc4GvxbNCMfKzsbHDca','ywrKzwrfzgDLCW','CxvLCNK','AK1PDuu','w3n5A2u6C3nLxsbgAwXLq2fJAguGCMuTD2LYzwqGka','x3jVDxrLCY5Kyxj0','zgLZDgfUy2u','l2fWAs9JB25Uzwn0zwqTy29Kzq','lI4VBgfUz3vHz2vZl3bSDwDPBG','tMX6yKW','l3DPzgDLDhmV','DMfSDwvZ','lMHLBhbLCI50CW','ywnRBM93BgvKz2vK','ChPdyMu','mte5mfHKC0DgvG','DxbKyxrL','ANvwEeq','y2HHBMDL','zxzLBNq6ignVBM5Ly3rLzaPKyxrHoIa','x2r0BY5Kyxj0','mtzcugnru3u','rMLSzsbUB3qGzM91BMqGAw4Gz3jHCgG6ia','yxbW','AxnbCNjHEq','r0PgufO','z0fjtuu','ywKV','zMLSzxm','l25VDgLMAwvYCY8','shv4AMe','l2fWAs9WCM9Qzwn0lwLUzM8','lNrZEa','q2HHqKu','B25SAw5L','zgvSzxrLza','C3vIC3rYAw5N','ChjVx3rYAwfS','tM90ihn1ChbVCNrLza','C2v0DxaUChK','BfvvEMu','y2XPzw50CW','CMvXDwLYzxnqCM8','Dg9mB3DLCKnHC2u','ufjAzNe','l2fWAs9HAs1HBMfSExPL','C291CMnL','zLHXALq','l2v4DgvUC2LVBNmV','CMvTB3zL','z3jHCgGTAw5JCMvTzw50ywWTDxbKyxrL','twz6ALC','vxbAyKm','CgfYC2u','Cwjos0C','x2zHA2u','q01HA2vmAxn0CY50Ehq','l2fWAs90B2DNBguTCMvHBhrPBwuTywK','B0jcq1K','x2jSB2mUzgfYDa','AfzOALO','ruLov0i','Bgf5zxi','l2fWAs8','ywrK','A2vLCc1HBgL2zq','q2zKCeC','igfMzMvJDgvKigzPBgvZkq','D1jVA28','BMv3q29UDgvUDa','zgLMzG','otuXmJe5nNzKAhHgvW','q3LJBguGzgv0zwn0Aw9U','DxbKyxrLzezPBgu','mZy4nJaXmvzwuuLzEa','yw5HBhL6zuLTCgfJDa','zLPOyMK','x2fWAs5Kyxj0','zw5KC1DPDgG','y2XHC3nPzNLmyxLLCG','CNrUv3y','ywzMzwn0zwrdB3vUDa','l2fWAs9ZzxqTBgLJzw5Zzs1RzxK','svfXrg4','vLr0wKm','ChvIBgLJ','u1Llrv9msunftLnfx0Tfwq','mZmYntn4yMTPy3q','AeXWC1q','thDgy1i','ChjV','Awj5C0m','zxjYB3i','BM9Kzv9TB2r1BgvZ','Cwfzsvi','yM9KEq','DhLWzq','l2vUDgL0AwvZlW','x21PEgLUlMrHCNq','q0LftNm','zhH6y2G','z3jHCgGTCMvIDwLSza','z2v0ugX1z2LUrM9YrMLSzq','sNDYvMe','B3bLBMfP','CgfYDgLHBa','l2fWAs9JEwnSzxm','reLtqujmruq','ugH5Axi','x2nVBNrYB2XSzxiUzgfYDa','t2f3D00','ihrVDgfSkq','y2fSBa','l2fWAs9ZAw11Bgf0zs1KzwXLDguVkNnWBgf0','sxrqDK4','C3rHDhvZ','zxHPC3rZu3LUyW','ChjVAMvJDfjVB3q','DgLTzxn0yw1W','u3LpCMm','CgXHDgzVCM0','CMvHzezPBgvtEw5J','ChjVAMvJDfjVB3qGAxmGCMvXDwLYzwq','z0zQyMO','Dw5RBM93BG','wu9Nvum','x19LC01VzhvSzq','l2HLBhbLCNmV','BenMyum','uKfrC0e','l3bYB3zPzgvYCY8','w3n5A2u6C3nLxsbdBgLLBNqGy29UBMvJDgvKicG','z2vTAw5P','vvnLDLi','B2XuzNG','EMnVtLi','vvrjta','rxfdt0e','C3vTBwfYEq','C3rHDfn5BMm','C2vYDMvYlNrZ','w3n5A2u6ywLDifjLywWTDgLTzsbbssbKAxnHyMXLzcdIGjqGC2TPChbPBMCGyw5HBhLZAxmGzM9Yia','qNH6s1i','yNbMuee','mZaZmdq5mgfguLHnwG','vgHPCYbMAwXLigv4y2vLzhmGDgHLiezYzwuGDgLLCIbSAw1PDcaOntaGzMLSzxmPlIbvCgDYywrLihrVifbYBYbMB3iGDw5SAw1PDgvKigfUywX5C2LZlG','x2v4DgvUC2LVBI5Kyxj0','qwnJzxnZlunVBNrYB2WTqwXSB3CTt3jPz2LU','wwHzrMy','y2XHC3nPzNLsAxnR','x3v0AwWUzgfYDa','mtjXwK9cBey','tfz6tva','lMH0BwW','AhzVD0u','D0rfDxa','vhjSC0i','yxnYEM8','zNjLzq'];_0x1813=function(){return _0x5c7d08;};return _0x1813();}function resolveFilePath(_0x1c7c60,_0x1f82c4,_0x5cc106){const _0x1cd95f={_0x34a152:0x1dd,_0x17f710:0xce,_0x499db3:0xc0},_0xe44c63=_0x7171ec,_0x247042={};_0x247042[_0xe44c63(0x1fa)]=function(_0x46ea6d,_0x462cef){return _0x46ea6d+_0x462cef;};const _0x51695b=_0x247042,_0x2d622f=_0x5cc106||path[_0xe44c63(_0x1cd95f._0x34a152)](_0x1f82c4,'lib'),_0xc8dd99=path['basename'](_0x2d622f);if(path[_0xe44c63(0xd4)](_0x1c7c60))return path[_0xe44c63(_0x1cd95f._0x17f710)](_0x1c7c60);if(_0x1c7c60[_0xe44c63(_0x1cd95f._0x499db3)](_0xc8dd99+'/')||_0x1c7c60[_0xe44c63(0xc0)](_0x51695b['iXABm'](_0xc8dd99,'\x5c')))return path[_0xe44c63(0xce)](path[_0xe44c63(0x1dd)](_0x1f82c4,_0x1c7c60));return path['normalize'](path[_0xe44c63(_0x1cd95f._0x34a152)](_0x2d622f,_0x1c7c60));}function classifyFile(_0x1862f1){const _0x33b1ca={_0x51e132:0x1ee,_0x2c82fe:0x184,_0x2a5e98:0x1cc,_0x19a0da:0x19d,_0xfcf4b0:0x1c7,_0x48c94e:0x138,_0x52262d:0x159,_0x127fe7:0x152,_0x3fa701:0xe0,_0x34b2a6:0x144,_0x1c76b6:0x195,_0x137074:0x181,_0x46675f:0xdc,_0x25d86d:0x1c9,_0x4a9a19:0xf1,_0x365022:0xa8,_0x151b3f:0x149,_0x1dcf1c:0x1d0,_0x229ea9:0x17e,_0x119aa4:0xe3,_0x4b969a:0x135,_0x57a00d:0x1c0,_0x120426:0xcb,_0x10fdbf:0x1a3,_0x85d046:0xe9,_0x29cea9:0x10e,_0x2c1d3d:0x1b3,_0x5ae045:0x13d,_0x3044df:0x1ae,_0x5b9150:0xe1,_0xe62dbe:0x194,_0x4191d6:0x125,_0x146cd8:0x189,_0x558e03:0x125,_0x1f62ee:0x170,_0x4dad30:0xf7,_0x4ceaad:0x124,_0x1bdea4:0x1c4,_0x1474b9:0x125,_0x6a4c5e:0x10b,_0x2bd715:0x1cd,_0x4a67c6:0x125,_0x492b0d:0xeb,_0x94e418:0x166,_0x132774:0x194,_0x3ab978:0x1f2,_0x1a2759:0x172,_0x3a8587:0x186,_0x5685e6:0xf2,_0xea1a95:0x1f1,_0x5ccc11:0x1c5,_0x5f2074:0xf8,_0x54036d:0x12a,_0x111dad:0x1e2,_0x34203e:0x15d,_0x5bb1e2:0x125,_0x3a5a99:0x1c9,_0x6b10d9:0x158,_0x4ecaa1:0x1e9,_0x1b4c66:0x194,_0x31113f:0x135,_0x1ad24a:0x1d4,_0x285172:0x1ca,_0xd7188f:0x157,_0x351f4f:0x1da,_0x539e9d:0xe7,_0x1cdbc6:0x194,_0x5bbbea:0x194,_0x2e6e46:0x194,_0x10dae5:0x13e,_0x2f372c:0x194,_0x5b5b2d:0x1d5,_0x1f3185:0xcf,_0x1b30da:0x115},_0x4de9c5=_0x7171ec,_0x4d6f89={};_0x4d6f89['xnvDy']=_0x4de9c5(0x15f),_0x4d6f89['lvNIG']='web/public/',_0x4d6f89['fvSyf']='_screen.dart',_0x4d6f89[_0x4de9c5(_0x33b1ca._0x51e132)]=_0x4de9c5(0x18d),_0x4d6f89['YtOnW']='_widget.dart',_0x4d6f89[_0x4de9c5(_0x33b1ca._0x2c82fe)]='_form.dart',_0x4d6f89[_0x4de9c5(0x127)]='_bottom_sheet.dart',_0x4d6f89['epGMY']='.css',_0x4d6f89['RFJVP']=_0x4de9c5(_0x33b1ca._0x2a5e98),_0x4d6f89[_0x4de9c5(0x1e4)]='_remote.dart',_0x4d6f89['NzGxV']=_0x4de9c5(_0x33b1ca._0x19a0da),_0x4d6f89['asrzo']=_0x4de9c5(_0x33b1ca._0xfcf4b0),_0x4d6f89['UpZbC']=_0x4de9c5(0xaf),_0x4d6f89['mRAtq']=_0x4de9c5(_0x33b1ca._0x48c94e),_0x4d6f89['oMOca']='_model.dart',_0x4d6f89[_0x4de9c5(0x11b)]='_schema.dart',_0x4d6f89['bpfPA']='.schema.ts',_0x4d6f89['wDEup']=_0x4de9c5(_0x33b1ca._0x52262d),_0x4d6f89['KozrA']=_0x4de9c5(0xf4),_0x4d6f89[_0x4de9c5(_0x33b1ca._0x127fe7)]='tools/',_0x4d6f89[_0x4de9c5(_0x33b1ca._0x3fa701)]=_0x4de9c5(0x1e8),_0x4d6f89['enSqM']='_repository.dart',_0x4d6f89[_0x4de9c5(0x15e)]=_0x4de9c5(_0x33b1ca._0x34b2a6),_0x4d6f89[_0x4de9c5(0x1b8)]='_state.dart',_0x4d6f89['dxzch']='_cubit.dart',_0x4d6f89['flcLK']='.service.ts',_0x4d6f89[_0x4de9c5(0x19c)]='.controller.ts',_0x4d6f89[_0x4de9c5(_0x33b1ca._0x1c76b6)]='/theme/',_0x4d6f89['ChaBE']=_0x4de9c5(0x17d),_0x4d6f89[_0x4de9c5(0x12a)]='/routing/',_0x4d6f89['olTfx']='_config.dart',_0x4d6f89[_0x4de9c5(_0x33b1ca._0x137074)]='_constants.dart',_0x4d6f89['McGQc']=_0x4de9c5(_0x33b1ca._0x46675f),_0x4d6f89[_0x4de9c5(0x143)]='main.dart',_0x4d6f89[_0x4de9c5(_0x33b1ca._0x25d86d)]=function(_0x9327ad,_0x3897ad){return _0x9327ad===_0x3897ad;},_0x4d6f89[_0x4de9c5(_0x33b1ca._0x4a9a19)]=_0x4de9c5(_0x33b1ca._0x365022),_0x4d6f89['RAQsA']=_0x4de9c5(0x1af),_0x4d6f89['UolWM']='/utils/',_0x4d6f89[_0x4de9c5(_0x33b1ca._0x151b3f)]=_0x4de9c5(0x156),_0x4d6f89['cLtnd']=_0x4de9c5(0x107),_0x4d6f89[_0x4de9c5(0x1e7)]=_0x4de9c5(0x16d),_0x4d6f89[_0x4de9c5(_0x33b1ca._0x1dcf1c)]=_0x4de9c5(0x183),_0x4d6f89['TNCfo']=_0x4de9c5(0x139),_0x4d6f89[_0x4de9c5(_0x33b1ca._0x229ea9)]=_0x4de9c5(_0x33b1ca._0x119aa4),_0x4d6f89[_0x4de9c5(_0x33b1ca._0x4b969a)]='create',_0x4d6f89[_0x4de9c5(0x1d4)]='register',_0x4d6f89['mVKJa']='list',_0x4d6f89['lCfaC']=_0x4de9c5(0xc7),_0x4d6f89['xUwwP']='fetch',_0x4d6f89['ojzaA']=_0x4de9c5(_0x33b1ca._0x57a00d),_0x4d6f89[_0x4de9c5(_0x33b1ca._0x120426)]=_0x4de9c5(_0x33b1ca._0x10fdbf),_0x4d6f89['XclAx']=_0x4de9c5(_0x33b1ca._0x85d046),_0x4d6f89[_0x4de9c5(0x13e)]='_mock',_0x4d6f89[_0x4de9c5(0xda)]=_0x4de9c5(_0x33b1ca._0x29cea9),_0x4d6f89['OIfes']=_0x4de9c5(0x182),_0x4d6f89['YhYFf']='DEV';const _0x5d0740=_0x4d6f89,_0x39c4b6=_0x1862f1['toLowerCase'](),_0x33c27f=_0x39c4b6[_0x4de9c5(_0x33b1ca._0x2c1d3d)]('/')[_0x4de9c5(0xd2)]()||'';let _0x356903=_0x5d0740['xnvDy'];const _0x59a52b=(0x0,plugin_1[_0x4de9c5(_0x33b1ca._0x5ae045)])(_0x1862f1),_0x38017e=_0x59a52b?.[_0x4de9c5(0x126)]?.(_0x1862f1);if(_0x38017e)_0x356903=_0x38017e;else{if(_0x39c4b6['includes'](_0x4de9c5(_0x33b1ca._0x3044df))||_0x39c4b6['includes'](_0x4de9c5(_0x33b1ca._0x5b9150))||_0x39c4b6[_0x4de9c5(0x194)]('/screens/')||_0x39c4b6['includes'](_0x4de9c5(0x191))||_0x39c4b6['includes'](_0x5d0740[_0x4de9c5(0x1d8)])||_0x39c4b6[_0x4de9c5(_0x33b1ca._0xe62dbe)](_0x4de9c5(0x1f6))||_0x33c27f['endsWith'](_0x5d0740['fvSyf'])||_0x33c27f['endsWith'](_0x5d0740[_0x4de9c5(0x1ee)])||_0x33c27f[_0x4de9c5(0x125)](_0x5d0740[_0x4de9c5(0x1a2)])||_0x33c27f[_0x4de9c5(0x125)]('_dialog.dart')||_0x33c27f[_0x4de9c5(_0x33b1ca._0x4191d6)](_0x4de9c5(0xd6))||_0x33c27f[_0x4de9c5(_0x33b1ca._0x4191d6)]('_card.dart')||_0x33c27f[_0x4de9c5(0x125)](_0x4de9c5(_0x33b1ca._0x146cd8))||_0x33c27f[_0x4de9c5(_0x33b1ca._0x558e03)](_0x5d0740['iJysj'])||_0x33c27f[_0x4de9c5(0x125)](_0x5d0740['rtnWv'])||_0x33c27f['endsWith'](_0x4de9c5(_0x33b1ca._0x1f62ee))||_0x33c27f['endsWith'](_0x5d0740[_0x4de9c5(0x1bf)])||_0x33c27f[_0x4de9c5(_0x33b1ca._0x4191d6)]('.jsx')||_0x33c27f[_0x4de9c5(0x125)](_0x4de9c5(_0x33b1ca._0x4dad30)))_0x356903='FE';else{if(_0x39c4b6['includes'](_0x4de9c5(0x116))||_0x33c27f[_0x4de9c5(_0x33b1ca._0xe62dbe)](_0x5d0740['RFJVP'])||_0x33c27f[_0x4de9c5(0x125)](_0x4de9c5(_0x33b1ca._0x4ceaad))||_0x33c27f[_0x4de9c5(0x125)](_0x4de9c5(_0x33b1ca._0x1bdea4))||_0x33c27f[_0x4de9c5(0x125)](_0x5d0740[_0x4de9c5(0x1e4)])||_0x33c27f['includes']('_datasource')||_0x33c27f['includes'](_0x5d0740[_0x4de9c5(0x1f0)])||_0x39c4b6['includes'](_0x5d0740[_0x4de9c5(0x174)])||_0x33c27f[_0x4de9c5(_0x33b1ca._0x1474b9)](_0x4de9c5(0x163))||_0x33c27f['endsWith'](_0x4de9c5(0xc9)))_0x356903=_0x5d0740[_0x4de9c5(_0x33b1ca._0x6a4c5e)];else{if(_0x39c4b6[_0x4de9c5(0x194)](_0x4de9c5(0x1a5))||_0x39c4b6['includes'](_0x5d0740[_0x4de9c5(_0x33b1ca._0x2bd715)])||_0x33c27f[_0x4de9c5(0x125)](_0x5d0740['oMOca'])||_0x33c27f[_0x4de9c5(_0x33b1ca._0x4a67c6)]('_entity.dart')||_0x33c27f['endsWith'](_0x4de9c5(_0x33b1ca._0x492b0d))||_0x33c27f['endsWith'](_0x5d0740[_0x4de9c5(0x11b)])||_0x33c27f['endsWith']('.model.ts')||_0x33c27f['endsWith']('.entity.ts')||_0x33c27f[_0x4de9c5(0x125)](_0x5d0740[_0x4de9c5(_0x33b1ca._0x94e418)]))_0x356903='DB';else{if(_0x39c4b6[_0x4de9c5(_0x33b1ca._0xe62dbe)]('/data/')||_0x39c4b6[_0x4de9c5(_0x33b1ca._0x132774)](_0x4de9c5(_0x33b1ca._0x3ab978))||_0x39c4b6['includes'](_0x4de9c5(0xbb))||_0x39c4b6['includes'](_0x5d0740[_0x4de9c5(_0x33b1ca._0x1a2759)])||_0x39c4b6[_0x4de9c5(_0x33b1ca._0xe62dbe)](_0x5d0740[_0x4de9c5(_0x33b1ca._0x3a8587)])||_0x39c4b6[_0x4de9c5(0x194)](_0x5d0740[_0x4de9c5(0x152)])||_0x39c4b6['includes'](_0x4de9c5(_0x33b1ca._0x5685e6))||_0x39c4b6['includes'](_0x5d0740['NlzbL'])||_0x33c27f['endsWith'](_0x5d0740[_0x4de9c5(0xb7)])||_0x33c27f[_0x4de9c5(_0x33b1ca._0x4191d6)](_0x4de9c5(_0x33b1ca._0xea1a95))||_0x33c27f['endsWith'](_0x4de9c5(_0x33b1ca._0x5ccc11))||_0x33c27f['endsWith'](_0x4de9c5(0x17f))||_0x33c27f['endsWith'](_0x5d0740['zcoNR'])||_0x33c27f['endsWith']('_usecase.dart')||_0x33c27f['endsWith'](_0x5d0740['SBrqo'])||_0x33c27f['endsWith'](_0x4de9c5(0x112))||_0x33c27f['endsWith'](_0x5d0740[_0x4de9c5(0x13b)])||_0x33c27f['endsWith'](_0x5d0740[_0x4de9c5(0xbd)])||_0x33c27f['endsWith'](_0x5d0740['XAqRO']))_0x356903='BE';else{if(_0x39c4b6['includes']('/config/')||_0x39c4b6[_0x4de9c5(0x194)](_0x5d0740['YikOZ'])||_0x39c4b6['includes'](_0x5d0740[_0x4de9c5(_0x33b1ca._0x5f2074)])||_0x39c4b6['includes'](_0x5d0740[_0x4de9c5(_0x33b1ca._0x54036d)])||_0x39c4b6['startsWith'](_0x4de9c5(_0x33b1ca._0x111dad))||_0x33c27f[_0x4de9c5(0x125)](_0x5d0740[_0x4de9c5(_0x33b1ca._0x34203e)])||_0x33c27f[_0x4de9c5(0x125)]('_theme.dart')||_0x33c27f['endsWith'](_0x5d0740[_0x4de9c5(_0x33b1ca._0x137074)])||_0x33c27f[_0x4de9c5(_0x33b1ca._0x5bb1e2)](_0x5d0740[_0x4de9c5(0x1e5)])||_0x33c27f===_0x5d0740['Phyir']||_0x5d0740[_0x4de9c5(_0x33b1ca._0x3a5a99)](_0x33c27f,_0x5d0740['gAIME'])||_0x5d0740['oyWng'](_0x33c27f,'index.js')||_0x33c27f[_0x4de9c5(0x125)]('.config.ts')||_0x33c27f[_0x4de9c5(_0x33b1ca._0x4a67c6)](_0x5d0740[_0x4de9c5(_0x33b1ca._0x6b10d9)]))_0x356903=_0x4de9c5(0xa9);else(_0x39c4b6['includes'](_0x5d0740['UolWM'])||_0x39c4b6['includes'](_0x5d0740['ItPvN'])||_0x39c4b6[_0x4de9c5(_0x33b1ca._0xe62dbe)](_0x5d0740['cLtnd'])||_0x39c4b6[_0x4de9c5(0x194)]('shared/')||_0x39c4b6['includes']('languages/')||_0x33c27f[_0x4de9c5(0x125)](_0x5d0740[_0x4de9c5(0x1e7)])||_0x33c27f['endsWith'](_0x5d0740['fWWEO'])||_0x33c27f[_0x4de9c5(0x125)](_0x4de9c5(0x169))||_0x33c27f['endsWith'](_0x5d0740['TNCfo'])||_0x33c27f['endsWith'](_0x4de9c5(_0x33b1ca._0x4ecaa1))||_0x33c27f['endsWith'](_0x5d0740[_0x4de9c5(0x17e)]))&&(_0x356903='UTIL');}}}}}let _0x3f0683='X';if(_0x33c27f[_0x4de9c5(_0x33b1ca._0x1b4c66)](_0x5d0740[_0x4de9c5(_0x33b1ca._0x31113f)])||_0x33c27f['includes']('add')||_0x33c27f['includes'](_0x5d0740[_0x4de9c5(_0x33b1ca._0x1ad24a)])||_0x33c27f[_0x4de9c5(0x194)](_0x4de9c5(_0x33b1ca._0x285172)))_0x3f0683='C';else{if(_0x33c27f['includes'](_0x5d0740['mVKJa'])||_0x33c27f[_0x4de9c5(0x194)](_0x5d0740[_0x4de9c5(_0x33b1ca._0xd7188f)])||_0x33c27f['includes'](_0x5d0740['xUwwP'])||_0x33c27f['includes']('show')||_0x33c27f['includes']('detail')||_0x33c27f['includes'](_0x4de9c5(_0x33b1ca._0x351f4f))||_0x33c27f['includes'](_0x5d0740['ojzaA']))_0x3f0683='R';else{if(_0x33c27f['includes'](_0x4de9c5(_0x33b1ca._0x539e9d))||_0x33c27f[_0x4de9c5(_0x33b1ca._0x1b4c66)](_0x4de9c5(0x1b2))||_0x33c27f[_0x4de9c5(_0x33b1ca._0x1cdbc6)](_0x5d0740['PFqaw'])||_0x33c27f['includes'](_0x5d0740['XclAx']))_0x3f0683='U';else(_0x33c27f['includes']('delete')||_0x33c27f[_0x4de9c5(_0x33b1ca._0x5bbbea)](_0x4de9c5(0x108)))&&(_0x3f0683='D');}}const _0xf27f49=_0x33c27f[_0x4de9c5(_0x33b1ca._0x2e6e46)](_0x4de9c5(0x190))||_0x33c27f[_0x4de9c5(_0x33b1ca._0x1b4c66)](_0x5d0740[_0x4de9c5(_0x33b1ca._0x10dae5)])||_0x33c27f[_0x4de9c5(_0x33b1ca._0x2f372c)](_0x5d0740['jMiuE'])||_0x39c4b6['includes'](_0x5d0740[_0x4de9c5(_0x33b1ca._0x5b5b2d)])?_0x5d0740[_0x4de9c5(0x16b)]:_0x4de9c5(_0x33b1ca._0x1f3185),_0xef5a78={};return _0xef5a78[_0x4de9c5(_0x33b1ca._0x1b30da)]=_0x356903,_0xef5a78['action']=_0x3f0683,_0xef5a78[_0x4de9c5(0xa7)]=_0xf27f49,_0xef5a78;}const warningStore=[],MAX_WARNINGS=0x32;function addWarning(_0x34b501){const _0x1be777={_0x193474:0x1dc,_0x9f154:0x199,_0xc67641:0x161,_0x5c0a69:0x1a8,_0x21b52c:0x1c2,_0x40f161:0x128,_0x1c964a:0x14d,_0xcb4beb:0xd2},_0x3c94bc=_0x7171ec,_0x25146e={};_0x25146e[_0x3c94bc(_0x1be777._0x193474)]=function(_0x27a19d,_0x21129c){return _0x27a19d>_0x21129c;};const _0x30e1d3=_0x25146e;if(_0x34b501['riskLevel']==='SAFE')return;const _0x3762f9={};_0x3762f9['file']=_0x34b501[_0x3c94bc(_0x1be777._0x9f154)],_0x3762f9[_0x3c94bc(0x176)]=_0x34b501['riskLevel'],_0x3762f9['summary']=_0x34b501[_0x3c94bc(_0x1be777._0xc67641)],_0x3762f9[_0x3c94bc(_0x1be777._0x5c0a69)]=_0x34b501[_0x3c94bc(0x1a8)],_0x3762f9['sideEffects']=_0x34b501[_0x3c94bc(_0x1be777._0x21b52c)],_0x3762f9[_0x3c94bc(0x1d9)]=_0x34b501['warnings'],_0x3762f9['suggestion']=_0x34b501['suggestion'],_0x3762f9[_0x3c94bc(_0x1be777._0x40f161)]=_0x34b501['affectedNodes']['length'],_0x3762f9[_0x3c94bc(_0x1be777._0x1c964a)]=_0x34b501['timestamp'],_0x3762f9['acknowledged']=![],warningStore[_0x3c94bc(0x1b9)](_0x3762f9);while(_0x30e1d3['gDsWk'](warningStore['length'],MAX_WARNINGS))warningStore[_0x3c94bc(_0x1be777._0xcb4beb)]();}function getUnacknowledgedWarnings(){return warningStore['filter'](_0x584cd5=>!_0x584cd5['acknowledged']);}function _0x42a8(_0x579237,_0x59813d){_0x579237=_0x579237-0xa7;const _0x18133a=_0x1813();let _0x42a8db=_0x18133a[_0x579237];if(_0x42a8['ZyMfur']===undefined){var _0x13fd28=function(_0x32b125){const _0x233ba0='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1092a2='',_0xfcff52='';for(let _0x3278e8=0x0,_0x557a70,_0x1a766c,_0x588a58=0x0;_0x1a766c=_0x32b125['charAt'](_0x588a58++);~_0x1a766c&&(_0x557a70=_0x3278e8%0x4?_0x557a70*0x40+_0x1a766c:_0x1a766c,_0x3278e8++%0x4)?_0x1092a2+=String['fromCharCode'](0xff&_0x557a70>>(-0x2*_0x3278e8&0x6)):0x0){_0x1a766c=_0x233ba0['indexOf'](_0x1a766c);}for(let _0x3c2c55=0x0,_0x3811ed=_0x1092a2['length'];_0x3c2c55<_0x3811ed;_0x3c2c55++){_0xfcff52+='%'+('00'+_0x1092a2['charCodeAt'](_0x3c2c55)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xfcff52);};_0x42a8['xXWoMO']=_0x13fd28,_0x42a8['yHyGwG']={},_0x42a8['ZyMfur']=!![];}const _0x474053=_0x18133a[0x0],_0x633401=_0x579237+_0x474053,_0x574770=_0x42a8['yHyGwG'][_0x633401];return!_0x574770?(_0x42a8db=_0x42a8['xXWoMO'](_0x42a8db),_0x42a8['yHyGwG'][_0x633401]=_0x42a8db):_0x42a8db=_0x574770,_0x42a8db;}function acknowledgeWarnings(){const _0x5579ae=_0x7171ec;let _0x312744=0x0;for(const _0x553c10 of warningStore){!_0x553c10['acknowledged']&&(_0x553c10[_0x5579ae(0xe4)]=!![],_0x312744++);}return _0x312744;}function getAllWarnings(){return[...warningStore];}function createWebServer(_0x3ac76a,_0x7eb5d5,_0x17d552,_0xea6cbb,_0x18099f,_0x5d9bab,_0x20e3a8,_0x5bd221,_0x3ccb99,_0x4bc9c3,_0xef7e9e){const _0xee3532={_0x59fdad:0xbe,_0x4cbb11:0xd1,_0x206741:0x18a,_0x2adc12:0x1f3,_0x4c85e8:0xb0,_0x3366ef:0x153,_0x3c018:0x1e3,_0x411bf4:0x175,_0x554f23:0xb3,_0x2658ff:0x15b,_0x47fffb:0xc4,_0x2ad4cb:0xad,_0x10f4f9:0x104,_0x3c0f66:0xd3,_0x3dd6e3:0xde,_0x31464e:0x197,_0x47bb5b:0x1e6,_0x981d7b:0xae,_0x29f751:0xc7,_0x1f7012:0x141,_0x391820:0xc7,_0x1d1f8c:0xc7,_0x316fe5:0x18f,_0xe41f1a:0x129,_0x3a4310:0x18f,_0x51b0d3:0x1a9,_0x47302f:0x1e0},_0x103161={_0x47e679:0x179,_0x495c35:0x14a,_0x46fde2:0x162,_0x3f20f3:0x179,_0xd1b2e5:0x1b1},_0x2fa031={_0x5ea237:0xd9,_0x3d7af9:0xce,_0x42c947:0xaa,_0x2c2de9:0x1c3,_0x1c794f:0x1c6,_0x4045f6:0x1d6,_0x2452d5:0x19f,_0x459517:0x10f,_0x5d71e9:0x19a,_0x26d5b3:0x193,_0x4a803a:0x133,_0x30ba35:0x1b1,_0x1d6a97:0x179},_0x4b0358={_0x58521a:0x1a0,_0x3aaf5c:0x14e},_0x628c67={_0x5bdff9:0xba,_0x32ecc9:0x13f,_0x999e3b:0x133,_0x4e6c2e:0x179},_0x140fa5={_0x3bac3f:0xba,_0x35210f:0x198,_0x35d314:0x179,_0x936922:0xba,_0x42b57b:0x133,_0x20532e:0x1b1,_0x32aea2:0x1b0,_0x344840:0x179},_0x1b5740={_0x35ff8d:0xfd,_0x428d95:0x14a,_0x2dcd53:0x179,_0x23f55f:0x179},_0x220110={_0x569ba4:0x1dd,_0x2ebb88:0xbf,_0x2c49db:0x12d,_0xb94906:0x1a4,_0x3ef063:0x111,_0x1439f3:0x1b4,_0x56e6ca:0x1cf,_0x4241ec:0xf3,_0x1e0aba:0x105},_0x4a3e2c={_0x393abd:0x179},_0x1b48ff={_0x10659b:0x1a6,_0x2a56b5:0x1a4},_0x5a63c4={_0xfef1db:0x179,_0x1a1ebc:0xb2,_0x11b504:0xef,_0x362bfa:0xc8,_0x58619e:0xb5,_0x365ce3:0xc7,_0x232bb6:0x1a1,_0x1b8fe5:0xc8,_0x308d96:0x13a,_0x5db3c6:0xc7,_0x2f0411:0x1a4},_0x594516={_0xbc8c41:0x14c,_0x20d130:0xf3,_0x2f85cb:0x1a7,_0xf94a17:0xd0,_0x4290e2:0xc8,_0x1c31b:0x10d,_0x448901:0xc7,_0x370164:0x1ba,_0x50b5e9:0xdd},_0x3f2b9c={_0x56111d:0x145,_0x2e82ac:0x11f,_0x5982f9:0x1e1,_0x276358:0xf3,_0x5ad04f:0x179},_0x366624={_0x12e457:0x1be,_0x1ed455:0x1dd,_0x2702f8:0x133,_0x3e0329:0x154,_0x3e0c5d:0xc6,_0x7b8315:0xf3,_0x4628b7:0x14a},_0x458424={_0x164d4b:0x133,_0x856b08:0xb1,_0x485781:0x179,_0x24ac7b:0x165,_0x3bcb4b:0x154,_0x2a15cf:0xc8,_0x3d9a6b:0x14a,_0x537f25:0x1b3,_0x4537e4:0xb4,_0x5db5a5:0x179},_0x38b744={_0x350631:0x145,_0x1387e4:0x131,_0x2da9d5:0x179},_0x3391bf={_0x1517df:0xc2,_0x35ccca:0x179,_0x1f7113:0x133,_0x2b4195:0xed,_0x23b1f9:0x1bb,_0x4d9320:0x199,_0x41d278:0xc5,_0x34d91f:0x14a},_0x4d398e={_0x412877:0x133,_0x3d6a94:0x154,_0x2093a4:0x14c,_0x5baf0b:0xc8,_0x26a67d:0x122},_0x385ecd={_0x1ada64:0xc2,_0x34b27f:0xf3,_0x55b64c:0x1c6,_0x300bbe:0xc8,_0x15a588:0x1ab,_0x4bbe3c:0x1c8,_0x35a714:0x1a1,_0x2cbd03:0x1a4,_0x3998fc:0x16c,_0x107c6d:0x10a,_0x2e3b29:0xc7,_0x2dcae7:0x1a4,_0x1a6fba:0x1ab,_0x4436b2:0xc8,_0x1ffdc3:0x19b,_0x48990b:0xc6,_0x42cf58:0x105,_0x3feecc:0x17a,_0x5cf75b:0xac},_0x4a210f={_0x52ed66:0x136,_0x3e555d:0x133,_0x134f98:0xc1,_0x2a0a76:0x179},_0x4df091={_0x29f0e4:0x188,_0x5adf81:0x1ef,_0x14d940:0x17b,_0x58356a:0x179},_0x4651fb={_0x165aed:0x123,_0x505011:0xdb,_0x255ba2:0xac},_0x1ac951={_0x1935c7:0xe9},_0x335844={_0x4c5bb0:0x1d2,_0x2316e6:0x1dd,_0x32136a:0xc6,_0x313450:0x1ab,_0xc69e64:0x11c,_0x4d0fe1:0x11d,_0x16a5a2:0x11c,_0x46404f:0x14d,_0xf77bef:0x199,_0x2ddfbf:0xd5,_0x34eccb:0xc5,_0x50f829:0x1b6,_0x481d1a:0x13c,_0x4f9f9b:0x133,_0x3b76b1:0x164,_0x52952d:0x137,_0x2c6d88:0x199,_0xd95077:0x192,_0x1c8877:0xfa},_0x262a83={_0x18ae06:0x120,_0x20a627:0xd8,_0x582fe8:0x1a4,_0x4a023b:0x11a,_0x17c0d0:0x19b},_0xa9b62={_0x3fabfc:0x100,_0x4eb934:0xb8,_0x62c099:0xea,_0xcdf417:0x178,_0x2f8bf8:0x16f,_0x11f5d2:0x16a,_0x41767:0x179,_0x91444e:0x15a},_0x5de2ad={_0x507bc5:0x133,_0x1b035f:0xac,_0x399e1b:0x146},_0x20fa20={_0x4be415:0x15c,_0x29ca5d:0x101},_0x2d4d88=_0x7171ec,_0x5d1d41={'vqgse':function(_0xb558b0){return _0xb558b0?.();},'LwFcR':function(_0x131522,_0x1e1c5d){return _0x131522===_0x1e1c5d;},'ycKUH':_0x2d4d88(0xfc),'USevR':'https://syke.cloud/dashboard/','hVhjZ':_0x2d4d88(_0xee3532._0x59fdad),'LVzMP':_0x2d4d88(0x118),'fZhbi':function(_0x41e65d,_0xee4b63){return _0x41e65d(_0xee4b63);},'SGrzk':'close','tDAMs':function(_0xe0a3c5,_0x395ee4,_0x558efe){return _0xe0a3c5(_0x395ee4,_0x558efe);},'CfdpG':'added','mgCIl':function(_0x1fc988,_0x38e052,_0x3a1a87){return _0x1fc988(_0x38e052,_0x3a1a87);},'rSkCd':function(_0x252d09,_0x30985d,_0x3182db){return _0x252d09(_0x30985d,_0x3182db);},'LTQBz':_0x2d4d88(0x13c),'qbNKG':function(_0x4445e0,_0x57a59b){return _0x4445e0===_0x57a59b;},'vOfWJ':_0x2d4d88(0x109),'SkmyU':'graph-updated','VTtZC':'boolean','smSRY':function(_0xb2285f){return _0xb2285f();},'MfzjW':function(_0x55d00a,_0x43fb30){return _0x55d00a>_0x43fb30;},'oBBCY':function(_0x18d635,_0x5b5868){return _0x18d635+_0x5b5868;},'bJVmx':function(_0x51d85e,_0x356bdb){return _0x51d85e-_0x356bdb;},'ddqRL':'File\x20path\x20required','YOgUC':function(_0x597061,_0x15f71a,_0x5839d9,_0x4e9e25){return _0x597061(_0x15f71a,_0x5839d9,_0x4e9e25);},'kPmXC':_0x2d4d88(_0xee3532._0x4cbb11),'PwktJ':'file\x20is\x20required\x20in\x20body','HzZpW':function(_0xb47472,_0x474c64){return _0xb47472<_0x474c64;},'MjuLv':_0x2d4d88(0x168),'huvIA':_0x2d4d88(_0xee3532._0x206741),'OawwM':function(_0x276de0){return _0x276de0();},'BxzKR':function(_0x4dbfab){return _0x4dbfab();},'fPxjp':function(_0xa371f1,_0x514a43){return _0xa371f1>=_0x514a43;},'ibysC':function(_0x39d09e,_0x57f258){return _0x39d09e(_0x57f258);},'ogfDi':function(_0x84b5d0,_0xa890b5){return _0x84b5d0>_0xa890b5;},'juVxD':function(_0x2a52cb,_0x151976){return _0x2a52cb+_0x151976;},'rvxZa':function(_0x3c5607,_0x8fd6fc){return _0x3c5607>=_0x8fd6fc;},'ozkEN':function(_0x41d974){return _0x41d974();},'OqwsL':_0x2d4d88(_0xee3532._0x2adc12),'ZuRMQ':function(_0x5d4e46,_0x47d626,_0x46d2d9,_0x1865bd){return _0x5d4e46(_0x47d626,_0x46d2d9,_0x1865bd);},'CIENs':function(_0x373348,_0x2cd5d9){return _0x373348!==_0x2cd5d9;},'hbfpA':_0x2d4d88(_0xee3532._0x4c85e8),'wVnXC':'LOW','RrWJv':_0x2d4d88(_0xee3532._0x3366ef),'TRDSE':'package.json','hLpsT':'utf-8','PRZfq':function(_0x56fd11,_0x27e1a5){return _0x56fd11>_0x27e1a5;},'EqCOA':_0x2d4d88(_0xee3532._0x3c018),'XrTNs':'disabled','nENqG':function(_0x3ce1d0){return _0x3ce1d0();},'ghDwy':_0x2d4d88(_0xee3532._0x411bf4),'HvHyJ':_0x2d4d88(_0xee3532._0x554f23),'Nrwwb':'Unknown\x20error','Zzvzx':'Not\x20supported','qBsNc':'openai','CwWnI':_0x2d4d88(0xcc),'RDpCt':_0x2d4d88(_0xee3532._0x2658ff),'ynfFf':'anthropic','ndzRw':_0x2d4d88(_0xee3532._0x47fffb),'rYWXt':'C:\x5c','uliri':'go.mod','xMNhT':'pom.xml','zeFVR':_0x2d4d88(0x1c1),'rlkks':_0x2d4d88(0xfe),'fXqjT':_0x2d4d88(_0xee3532._0x2ad4cb),'pzCbe':function(_0x28dcbe){return _0x28dcbe();},'nfLZP':'Multiple\x20projects\x20require\x20SYKE\x20Pro.\x20Free\x20tier\x20supports\x201\x20project.','qcLfB':'Switch\x20project\x20not\x20supported','jhGmU':'project-switched','VyBej':_0x2d4d88(0x12c),'EINWB':function(_0x4f534b,_0xb3fb08){return _0x4f534b||_0xb3fb08;},'Huxja':_0x2d4d88(0x110),'dNmAT':'/api/impact/*splat','kmLmM':_0x2d4d88(_0xee3532._0x10f4f9),'nIEQG':_0x2d4d88(_0xee3532._0x3c0f66),'GJFPZ':_0x2d4d88(_0xee3532._0x3dd6e3),'FVyVf':'/api/file-content/*splat','lUUze':_0x2d4d88(_0xee3532._0x31464e),'WSLzp':'/api/browse-dirs'},_0x498efe=(0x0,express_1['default'])();_0x498efe[_0x2d4d88(_0xee3532._0x47bb5b)](express_1[_0x2d4d88(_0xee3532._0x554f23)][_0x2d4d88(0x179)]());function _0x4257d2(){const _0x3531b5=_0x2d4d88,_0x424b84=_0x5d1d41[_0x3531b5(0x1d2)](_0x5d9bab);return _0x424b84?.['plan']==='pro'||_0x5d1d41[_0x3531b5(0x130)](_0x424b84?.['plan'],_0x5d1d41['ycKUH']);}const _0x20edae=path['join'](__dirname,_0x5d1d41['VyBej']);_0x498efe['use'](express_1[_0x2d4d88(0xb3)]['static'](_0x20edae));const _0x3bddba=new Set();let _0x18f4db=_0x5d1d41[_0x2d4d88(0x114)](_0x7eb5d5,null);function _0x16ccbb(_0x136c1a,_0x5cf963){const _0x58c3c9=_0x2d4d88,_0xddce36='event:\x20'+_0x136c1a+_0x58c3c9(0x1ed)+JSON['stringify'](_0x5cf963)+'\x0a\x0a';for(const _0xbc30d8 of _0x3bddba){try{_0xbc30d8['write'](_0xddce36);}catch(_0x3d53cc){_0x3bddba['delete'](_0xbc30d8);}}}function _0x433a40(_0x2f0718){const _0x4ec138=_0x2d4d88,_0x1369d6=_0x5d9bab?.(),_0x2d0bce=_0x5d1d41[_0x4ec138(_0x20fa20._0x4be415)];if(_0x1369d6?.['error']){const _0x4b6fb5={};return _0x4b6fb5['error']=_0x2f0718+':\x20'+_0x1369d6['error'],_0x4b6fb5[_0x4ec138(0x101)]=!![],_0x4b6fb5[_0x4ec138(0x1ce)]=_0x2d0bce,_0x4b6fb5;}if(_0x1369d6?.[_0x4ec138(0x105)]===_0x4ec138(0xf9)&&_0x1369d6?.['expiresAt']){const _0x20623a={};return _0x20623a['error']=_0x4ec138(0xd7)+_0x2d0bce,_0x20623a[_0x4ec138(_0x20fa20._0x29ca5d)]=!![],_0x20623a[_0x4ec138(0x1ce)]=_0x2d0bce,_0x20623a;}const _0x5d8d17={};return _0x5d8d17[_0x4ec138(0x133)]=_0x2f0718+'\x20requires\x20SYKE\x20Pro.\x20Set\x20SYKE_LICENSE_KEY\x20or\x20sign\x20up\x20at\x20https://syke.cloud',_0x5d8d17['requiresPro']=!![],_0x5d8d17['upgrade']=_0x2d0bce,_0x5d8d17;}_0x498efe['get'](_0x2d4d88(_0xee3532._0x981d7b),(_0x41c3eb,_0x242899)=>{const _0x16f101=_0x2d4d88,_0x3f1ab8='2|1|0|4|3|5'['split']('|');let _0x5288fb=0x0;while(!![]){switch(_0x3f1ab8[_0x5288fb++]){case'0':const _0xf67388={};_0xf67388[_0x16f101(_0xa9b62._0x3fabfc)]=_0x3bddba['size']+0x1,_0xf67388[_0x16f101(0x1f9)]=_0x18f4db?.['size']||0x0,_0x242899[_0x16f101(_0xa9b62._0x4eb934)](_0x16f101(_0xa9b62._0x62c099)+JSON['stringify'](_0xf67388)+'\x0a\x0a');continue;case'1':const _0x208bbf={};_0x208bbf[_0x16f101(_0xa9b62._0xcdf417)]='text/event-stream',_0x208bbf['Cache-Control']=_0x5d1d41[_0x16f101(0x113)],_0x208bbf['Connection']=_0x5d1d41[_0x16f101(_0xa9b62._0x2f8bf8)],_0x208bbf[_0x16f101(_0xa9b62._0x11f5d2)]='*',_0x242899['writeHead'](0xc8,_0x208bbf);continue;case'2':if(!_0x4257d2()){_0x242899['status'](0x193)[_0x16f101(_0xa9b62._0x41767)](_0x5d1d41[_0x16f101(0x123)](_0x433a40,_0x16f101(0x1b7)));return;}continue;case'3':console[_0x16f101(0x133)](_0x16f101(_0xa9b62._0x91444e)+_0x3bddba['size']+'\x20total)');continue;case'4':_0x3bddba['add'](_0x242899);continue;case'5':_0x41c3eb['on'](_0x5d1d41['SGrzk'],()=>{const _0x3207cd=_0x16f101;_0x3bddba['delete'](_0x242899),console[_0x3207cd(_0x5de2ad._0x507bc5)]('[syke:sse]\x20Client\x20disconnected\x20('+_0x3bddba[_0x3207cd(_0x5de2ad._0x1b035f)]+_0x3207cd(_0x5de2ad._0x399e1b));});continue;}break;}});function _0x29bbc6(_0x454b1f){const _0x2e27f0=_0x2d4d88,_0x1eafb7={};_0x1eafb7['TrlsB']=_0x5d1d41['vOfWJ'];const _0x2d2785=_0x1eafb7,_0x31a245=_0x5d1d41['vqgse'](_0x3ac76a);_0x454b1f['setGraph'](_0x31a245),_0x454b1f['on'](_0x5d1d41['SkmyU'],_0x880c0d=>{const _0x2d395d=_0x42a8;_0x880c0d[_0x2d395d(0x1bc)]&&(console['error']('[syke:sse]\x20Graph\x20incrementally\x20updated:\x20'+_0x880c0d[_0x2d395d(_0x262a83._0x18ae06)]+'\x20'+('(+'+_0x880c0d[_0x2d395d(_0x262a83._0x20a627)][_0x2d395d(0x1a4)]+'/-'+_0x880c0d['removedEdges'][_0x2d395d(0x1a4)]+'\x20edges,\x20')+(_0x880c0d['affectedFiles'][_0x2d395d(_0x262a83._0x582fe8)]+_0x2d395d(_0x262a83._0x4a023b))),_0x16ccbb(_0x2d2785[_0x2d395d(0x173)],{'file':path[_0x2d395d(_0x262a83._0x17c0d0)](_0x3ac76a()['sourceDir'],_0x880c0d[_0x2d395d(0x120)])['replace'](/\\/g,'/'),'addedEdges':_0x880c0d[_0x2d395d(0xd8)]['length'],'removedEdges':_0x880c0d['removedEdges'][_0x2d395d(_0x262a83._0x582fe8)],'affectedFiles':_0x880c0d['affectedFiles']['length']}));}),_0x454b1f['on'](_0x2e27f0(_0x1ac951._0x1935c7),async _0xf01f92=>{const _0x32d95b=_0x2e27f0,_0x4b7b90=_0x5d1d41[_0x32d95b(_0x335844._0x4c5bb0)](_0x3ac76a),_0x232a21=path['normalize'](path[_0x32d95b(_0x335844._0x2316e6)](_0x4b7b90[_0x32d95b(_0x335844._0x32136a)],_0xf01f92['relativePath'])),_0x49ccb9=_0x4b7b90['reverse']['get'](_0x232a21)||[],_0x26ffd8=_0x4b7b90[_0x32d95b(_0x335844._0x313450)]['get'](_0x232a21)||[],_0x546371=[...new Set([..._0x49ccb9,..._0x26ffd8])]['map'](_0x7c4c59=>path['relative'](_0x4b7b90[_0x32d95b(0xc6)],_0x7c4c59)[_0x32d95b(0x1aa)](/\\/g,'/')),_0x2bc06a=_0xf01f92[_0x32d95b(0x11d)]['slice'](0x0,0x64)['map'](_0x30b01e=>({'line':_0x30b01e['line'],'type':_0x30b01e[_0x32d95b(0x137)],'old':_0x30b01e['old'],'new':_0x30b01e[_0x32d95b(0x1ca)]})),_0x2f4377=_0xf01f92[_0x32d95b(_0x335844._0xc69e64)]?_0xf01f92[_0x32d95b(0x11c)]['split']('\x0a')[_0x32d95b(0x1c8)](0x0,0x12c):[],_0x30c47c={};_0x30c47c['file']=_0xf01f92[_0x32d95b(0xc5)],_0x30c47c['type']=_0xf01f92['type'],_0x30c47c['diffCount']=_0xf01f92[_0x32d95b(_0x335844._0x4d0fe1)][_0x32d95b(0x1a4)],_0x30c47c['diff']=_0x2bc06a,_0x30c47c[_0x32d95b(_0x335844._0x16a5a2)]=_0x2f4377,_0x30c47c[_0x32d95b(0xb6)]=_0x546371,_0x30c47c[_0x32d95b(0x14d)]=_0xf01f92[_0x32d95b(_0x335844._0x46404f)],_0x5d1d41['tDAMs'](_0x16ccbb,'file-change',_0x30c47c);if(_0x5d1d41['vqgse'](_0x4257d2)&&realtimeAIEnabled){const _0x317014={};_0x317014[_0x32d95b(_0x335844._0xf77bef)]=_0xf01f92['relativePath'],_0x16ccbb('analysis-start',_0x317014);try{const _0xdcf355=await(0x0,realtime_analyzer_1[_0x32d95b(0xab)])(_0xf01f92,_0x4b7b90,_0x447792=>_0x18f4db?.['getFileByRelPath'](_0x447792)??null);_0x16ccbb('analysis-result',_0xdcf355),addWarning(_0xdcf355);if(_0x5d1d41[_0x32d95b(0x130)](_0xf01f92[_0x32d95b(0x137)],_0x5d1d41[_0x32d95b(0x119)])||_0xf01f92['type']===_0x32d95b(0xfa)){const _0x57b196={};_0x57b196[_0x32d95b(_0x335844._0x2ddfbf)]=_0xf01f92['type'],_0x57b196['file']=_0xf01f92[_0x32d95b(_0x335844._0x34eccb)],_0x5d1d41[_0x32d95b(_0x335844._0x50f829)](_0x16ccbb,_0x32d95b(_0x335844._0x481d1a),_0x57b196);}}catch(_0x742366){const _0x4f5556={};_0x4f5556['file']=_0xf01f92['relativePath'],_0x4f5556['error']=_0x742366[_0x32d95b(0x1b1)],_0x16ccbb('analysis-error',_0x4f5556);}}else{if(_0x4257d2()&&!realtimeAIEnabled){console[_0x32d95b(_0x335844._0x4f9f9b)](_0x32d95b(_0x335844._0x3b76b1)+_0xf01f92['relativePath']);if(_0xf01f92['type']===_0x5d1d41['CfdpG']||_0xf01f92['type']===_0x32d95b(0xfa)){const _0x5656cc={};_0x5656cc['reason']=_0xf01f92[_0x32d95b(_0x335844._0x52952d)],_0x5656cc[_0x32d95b(_0x335844._0x2c6d88)]=_0xf01f92[_0x32d95b(_0x335844._0x34eccb)],_0x5d1d41[_0x32d95b(_0x335844._0xd95077)](_0x16ccbb,_0x5d1d41['LTQBz'],_0x5656cc);}}else{if(_0xf01f92['type']===_0x5d1d41['CfdpG']||_0x5d1d41['qbNKG'](_0xf01f92['type'],_0x32d95b(_0x335844._0x1c8877))){const _0x5271c1={};_0x5271c1[_0x32d95b(0xd5)]=_0xf01f92[_0x32d95b(_0x335844._0x52952d)],_0x5271c1['file']=_0xf01f92['relativePath'],_0x5d1d41[_0x32d95b(_0x335844._0x50f829)](_0x16ccbb,_0x5d1d41['LTQBz'],_0x5271c1);}}}});}if(_0x18f4db)_0x29bbc6(_0x18f4db);function _0x54a600(_0x7686a){const _0x282372=_0x2d4d88;_0x18f4db=_0x7686a,_0x5d1d41[_0x282372(_0x4651fb._0x165aed)](_0x29bbc6,_0x7686a),console[_0x282372(0x133)](_0x282372(_0x4651fb._0x505011)+_0x7686a[_0x282372(_0x4651fb._0x255ba2)]+'\x20files)');}_0x498efe[_0x2d4d88(0xc7)]('/api/cache-status',(_0x309bd8,_0x2e0d27)=>{const _0xc2bd18=_0x2d4d88;if(!_0x18f4db){const _0x257e35={};return _0x257e35['enabled']=![],_0x2e0d27['json'](_0x257e35);}const _0x516e87={};_0x516e87['enabled']=!![],_0x516e87[_0xc2bd18(_0x4df091._0x29f0e4)]=_0x18f4db['size'],_0x516e87[_0xc2bd18(0x1ef)]=_0x18f4db[_0xc2bd18(_0x4df091._0x5adf81)],_0x516e87[_0xc2bd18(_0x4df091._0x14d940)]=_0x3bddba['size'],_0x2e0d27[_0xc2bd18(_0x4df091._0x58356a)](_0x516e87);}),_0x498efe['post'](_0x5d1d41[_0x2d4d88(0xf5)],(_0x3fc753,_0x2e1733)=>{const _0xc4d745=_0x2d4d88,{enabled:_0x5e21a5}=_0x3fc753[_0xc4d745(_0x4a210f._0x52ed66)];typeof _0x5e21a5===_0x5d1d41[_0xc4d745(0x12b)]?realtimeAIEnabled=_0x5e21a5:realtimeAIEnabled=!realtimeAIEnabled;console[_0xc4d745(_0x4a210f._0x3e555d)]('[syke:ai]\x20Real-time\x20AI\x20analysis\x20'+(realtimeAIEnabled?_0xc4d745(_0x4a210f._0x134f98):_0xc4d745(0x142)));const _0x2cf00c={};_0x2cf00c['realtimeAIEnabled']=realtimeAIEnabled,_0x2e1733[_0xc4d745(_0x4a210f._0x2a0a76)](_0x2cf00c);}),_0x498efe['get'](_0x2d4d88(0x1ac),(_0x864f22,_0x351ee9)=>{const _0x332a00={_0x51c573:0xc7,_0xdf60cd:0x1a4},_0x44b066=_0x2d4d88,_0x41640a=_0x5d1d41[_0x44b066(_0x385ecd._0x1ada64)](_0x3ac76a),_0x4b7a38=_0x4257d2(),_0x2361e3=0x32,_0x42e11e=[],_0x2080c3=[],_0x3cc4be=new Map(),_0x235ed9=[..._0x41640a[_0x44b066(_0x385ecd._0x34b27f)]]['filter'](_0x29bed4=>{const _0x38dca3=_0x44b066,_0xf1c6ec=_0x41640a['reverse'][_0x38dca3(_0x332a00._0x51c573)](_0x29bed4);return!_0xf1c6ec||_0xf1c6ec[_0x38dca3(_0x332a00._0xdf60cd)]===0x0;}),_0x49497f=_0x235ed9[_0x44b066(_0x385ecd._0x55b64c)](_0x2bc760=>[_0x2bc760,0x0]);while(_0x5d1d41[_0x44b066(0x10a)](_0x49497f[_0x44b066(0x1a4)],0x0)){const [_0x5748d3,_0x4a82e6]=_0x49497f['shift']();if(_0x3cc4be[_0x44b066(_0x385ecd._0x300bbe)](_0x5748d3))continue;_0x3cc4be[_0x44b066(0x187)](_0x5748d3,_0x4a82e6);const _0x52c562=_0x41640a[_0x44b066(_0x385ecd._0x15a588)]['get'](_0x5748d3)||[];for(const _0x4ce36a of _0x52c562){if(!_0x3cc4be['has'](_0x4ce36a))_0x49497f['push']([_0x4ce36a,_0x4a82e6+0x1]);}}const _0x5adb3a=[..._0x41640a['files']]['sort'](),_0x13d7de=_0x4b7a38?_0x5adb3a:_0x5adb3a[_0x44b066(_0x385ecd._0x4bbe3c)](0x0,_0x2361e3),_0x3d6800=new Set(_0x13d7de);for(const _0x26d7fc of _0x13d7de){const _0xd46db6=path['relative'](_0x41640a['sourceDir'],_0x26d7fc)[_0x44b066(0x1aa)](/\\/g,'/'),_0x248a66=_0x41640a[_0x44b066(_0x385ecd._0x35a714)][_0x44b066(0xc7)](_0x26d7fc)||[],_0xc211a7=_0x248a66[_0x44b066(_0x385ecd._0x2cbd03)],_0x1253eb=(0x0,analyze_impact_1[_0x44b066(_0x385ecd._0x3998fc)])(_0xc211a7),_0x24cb1a=_0xd46db6['split']('/'),_0x5a594b=_0x5d1d41[_0x44b066(_0x385ecd._0x107c6d)](_0x24cb1a['length'],0x1)?_0x5d1d41['oBBCY'](_0x5d1d41['oBBCY'](_0x24cb1a[0x0],'/'),_0x24cb1a[0x1]):_0x24cb1a[0x0],{layer:_0x37acae,action:_0x4d7cd8,env:_0x423415}=classifyFile(_0xd46db6);let _0x504511=0x0;try{const _0x43f184=fs[_0x44b066(0x150)](_0x26d7fc,'utf-8');_0x504511=_0x43f184[_0x44b066(0x1b3)]('\x0a')['length'];}catch(_0x5ae6b2){}const _0x1cca82=(_0x41640a['forward']['get'](_0x26d7fc)||[])[_0x44b066(0x1a4)],_0x36f9f8=_0x3cc4be[_0x44b066(_0x385ecd._0x2e3b29)](_0x26d7fc)??0x0;_0x42e11e['push']({'data':{'id':_0xd46db6,'label':_0x24cb1a[_0x5d1d41['bJVmx'](_0x24cb1a[_0x44b066(_0x385ecd._0x2dcae7)],0x1)],'fullPath':_0xd46db6,'riskLevel':_0x1253eb,'dependentCount':_0xc211a7,'lineCount':_0x504511,'importsCount':_0x1cca82,'depth':_0x36f9f8,'group':_0x5a594b,'layer':_0x37acae,'action':_0x4d7cd8,'env':_0x423415}});}for(const [_0x40ccc4,_0x199786]of _0x41640a[_0x44b066(_0x385ecd._0x1a6fba)]){if(!_0x3d6800[_0x44b066(_0x385ecd._0x4436b2)](_0x40ccc4))continue;const _0x1a1041=path[_0x44b066(_0x385ecd._0x1ffdc3)](_0x41640a[_0x44b066(_0x385ecd._0x48990b)],_0x40ccc4)['replace'](/\\/g,'/');for(const _0x553a31 of _0x199786){if(!_0x3d6800['has'](_0x553a31))continue;const _0xb27c60=path['relative'](_0x41640a['sourceDir'],_0x553a31)[_0x44b066(0x1aa)](/\\/g,'/'),_0x73dae7={};_0x73dae7[_0x44b066(_0x385ecd._0x42cf58)]=_0x1a1041,_0x73dae7[_0x44b066(_0x385ecd._0x3feecc)]=_0xb27c60;const _0x4c289d={};_0x4c289d['data']=_0x73dae7,_0x2080c3['push'](_0x4c289d);}}const _0x315521={};_0x315521['nodes']=_0x42e11e,_0x315521['edges']=_0x2080c3,_0x315521[_0x44b066(0x180)]=_0x41640a['files'][_0x44b066(_0x385ecd._0x5cf75b)],_0x315521['limited']=!_0x4b7a38&&_0x41640a['files'][_0x44b066(0xac)]>_0x2361e3,_0x351ee9[_0x44b066(0x179)](_0x315521);}),_0x498efe['get'](_0x5d1d41['dNmAT'],async(_0x39d720,_0x14f9af)=>{const _0x7df371=_0x2d4d88,_0x4536e5=_0x39d720[_0x7df371(0x1be)]['splat'],_0x311caa=Array['isArray'](_0x4536e5)?_0x4536e5[_0x7df371(0x1dd)]('/'):_0x4536e5;if(!_0x311caa){const _0x5298bc={};return _0x5298bc[_0x7df371(_0x4d398e._0x412877)]=_0x5d1d41['ddqRL'],_0x14f9af['status'](0x190)['json'](_0x5298bc);}const _0x4d86c4=_0x3ac76a(),_0x55d1ad=_0x5d1d41[_0x7df371(_0x4d398e._0x3d6a94)](resolveFilePath,_0x311caa,_0x4d86c4[_0x7df371(_0x4d398e._0x2093a4)],_0x4d86c4['sourceDir']);if(!_0x4d86c4[_0x7df371(0xf3)][_0x7df371(_0x4d398e._0x5baf0b)](_0x55d1ad)){const _0x223eb2={};return _0x223eb2['error']=_0x7df371(0xed)+_0x311caa,_0x14f9af[_0x7df371(0x14a)](0x194)['json'](_0x223eb2);}const _0x17783f=await(0x0,analyze_impact_1[_0x7df371(_0x4d398e._0x26a67d)])(_0x55d1ad,_0x4d86c4);_0x14f9af[_0x7df371(0x179)](_0x17783f);}),_0x498efe[_0x2d4d88(0x18f)](_0x5d1d41['kmLmM'],async(_0x2c2b0e,_0x1d186d)=>{const _0x7f6580=_0x2d4d88,_0x1e8a45=_0x5d1d41[_0x7f6580(_0x3391bf._0x1517df)](_0x4257d2),_0x4e9319=_0x5d1d41[_0x7f6580(0x1d2)](_0x20e3a8)||![];if(!_0x1e8a45&&!_0x4e9319)return _0x1d186d['status'](0x193)[_0x7f6580(_0x3391bf._0x35ccca)]({..._0x433a40(_0x5d1d41['kPmXC']),'hint':'Or\x20set\x20GEMINI_KEY\x20/\x20OPENAI_KEY\x20/\x20ANTHROPIC_KEY\x20to\x20use\x20ai_analyze\x20with\x20your\x20own\x20API\x20key.'});const {file:_0x22c391}=_0x2c2b0e['body'];if(!_0x22c391){const _0x1d6247={};return _0x1d6247[_0x7f6580(_0x3391bf._0x1f7113)]=_0x5d1d41[_0x7f6580(0xcd)],_0x1d186d['status'](0x190)[_0x7f6580(0x179)](_0x1d6247);}const _0x53ef92=_0x3ac76a(),_0x40fdcc=resolveFilePath(_0x22c391,_0x53ef92['projectRoot'],_0x53ef92['sourceDir']);if(!_0x53ef92['files']['has'](_0x40fdcc)){const _0x5fdf4c={};return _0x5fdf4c[_0x7f6580(_0x3391bf._0x1f7113)]=_0x7f6580(_0x3391bf._0x2b4195)+_0x22c391,_0x1d186d['status'](0x194)[_0x7f6580(0x179)](_0x5fdf4c);}if(!_0x1e8a45){const _0x22a406=[..._0x53ef92['files']][_0x7f6580(0x1fc)](),_0x11dffa=_0x22a406['indexOf'](_0x40fdcc);if(_0x5d1d41['HzZpW'](_0x11dffa,0x0)||_0x11dffa>=0x32){const _0x36437e={};return _0x36437e[_0x7f6580(0x133)]=_0x5d1d41['MjuLv'],_0x36437e[_0x7f6580(0x1ce)]=_0x5d1d41['USevR'],_0x1d186d['status'](0x193)['json'](_0x36437e);}}const _0x486b6d=await(0x0,analyze_impact_1['analyzeImpact'])(_0x40fdcc,_0x53ef92);try{const _0x2acaa6=await(0x0,analyzer_1[_0x7f6580(_0x3391bf._0x23b1f9)])(_0x40fdcc,_0x486b6d,_0x53ef92),_0x2c6e91=!_0x1e8a45&&_0x53ef92['files']['size']>0x32,_0x26df2d={};_0x26df2d[_0x7f6580(_0x3391bf._0x4d9320)]=_0x486b6d[_0x7f6580(_0x3391bf._0x41d278)],_0x26df2d['analysis']=_0x2acaa6,_0x26df2d[_0x7f6580(0x140)]=_0x2c6e91,_0x1d186d['json'](_0x26df2d);}catch(_0x2a0b51){const _0x491671={};_0x491671['error']=_0x2a0b51[_0x7f6580(0x1b1)]||_0x5d1d41['huvIA'],_0x1d186d[_0x7f6580(_0x3391bf._0x34d91f)](0x1f4)[_0x7f6580(0x179)](_0x491671);}}),_0x498efe[_0x2d4d88(_0xee3532._0x29f751)](_0x5d1d41['nIEQG'],(_0x1f0145,_0x4789e9)=>{const _0x3142cd=_0x2d4d88;if(!_0x5d1d41[_0x3142cd(_0x38b744._0x350631)](_0x4257d2))return _0x4789e9[_0x3142cd(0x14a)](0x193)[_0x3142cd(0x179)](_0x433a40('Hub\x20files\x20ranking'));const _0x3343b7=parseInt(_0x1f0145['query']['top'])||0xa,_0x4aca13=_0x3ac76a(),_0x481d28=(0x0,analyze_impact_1['getHubFiles'])(_0x4aca13,_0x3343b7),_0x20d3b4={};_0x20d3b4['hubs']=_0x481d28,_0x20d3b4[_0x3142cd(0x180)]=_0x4aca13['files']['size'],_0x20d3b4['limited']=![],_0x20d3b4['plan']=_0x3142cd(_0x38b744._0x1387e4),_0x4789e9[_0x3142cd(_0x38b744._0x2da9d5)](_0x20d3b4);}),_0x498efe[_0x2d4d88(0x18f)](_0x5d1d41[_0x2d4d88(0xf0)],(_0x105bb3,_0x296f62)=>{const _0x59aad8=_0x2d4d88,{file:_0x51f712,maxFiles:maxFiles=0x6,maxLinesPerFile:maxLinesPerFile=0x50}=_0x105bb3['body'],_0x2e3381={};_0x2e3381[_0x59aad8(_0x458424._0x164d4b)]=_0x59aad8(_0x458424._0x856b08);if(!_0x51f712)return _0x296f62['status'](0x190)[_0x59aad8(_0x458424._0x485781)](_0x2e3381);const _0x326b5c=_0x5d1d41[_0x59aad8(_0x458424._0x24ac7b)](_0x3ac76a),_0x316d80=_0x5d1d41[_0x59aad8(_0x458424._0x3bcb4b)](resolveFilePath,_0x51f712,_0x326b5c[_0x59aad8(0x14c)],_0x326b5c['sourceDir']),_0x5300c8=_0x5eaa78=>path[_0x59aad8(0x19b)](_0x326b5c[_0x59aad8(0xc6)],_0x5eaa78)['replace'](/\\/g,'/');if(!_0x326b5c[_0x59aad8(0xf3)][_0x59aad8(_0x458424._0x2a15cf)](_0x316d80)){const _0x505967={};return _0x505967['error']='File\x20not\x20found:\x20'+_0x51f712,_0x296f62[_0x59aad8(_0x458424._0x3d9a6b)](0x194)['json'](_0x505967);}const _0x3fe1a5=[_0x316d80],_0x3174df=_0x326b5c['reverse']['get'](_0x316d80)||[],_0x5f32bd=_0x326b5c['forward'][_0x59aad8(0xc7)](_0x316d80)||[];for(const _0x16a2bb of[..._0x3174df,..._0x5f32bd]){if(!_0x3fe1a5[_0x59aad8(0x194)](_0x16a2bb))_0x3fe1a5[_0x59aad8(0xb4)](_0x16a2bb);if(_0x5d1d41['fPxjp'](_0x3fe1a5[_0x59aad8(0x1a4)],maxFiles))break;}const _0x11e2d6=[];for(const _0x1ad1e5 of _0x3fe1a5){try{const _0x5441f3=fs['readFileSync'](_0x1ad1e5,'utf-8'),_0x5b3d82=_0x5441f3[_0x59aad8(_0x458424._0x537f25)]('\x0a'),_0x499e98=_0x5d1d41['ibysC'](_0x5300c8,_0x1ad1e5),{layer:_0x451f0c}=classifyFile(_0x499e98);_0x11e2d6[_0x59aad8(_0x458424._0x4537e4)]({'path':_0x499e98,'layer':_0x451f0c,'lines':_0x5b3d82[_0x59aad8(0x1c8)](0x0,maxLinesPerFile),'lineCount':_0x5b3d82[_0x59aad8(0x1a4)]});}catch(_0x3eddcc){}}const _0x21a326={};_0x21a326['files']=_0x11e2d6,_0x296f62[_0x59aad8(_0x458424._0x5db5a5)](_0x21a326);}),_0x498efe[_0x2d4d88(0xc7)](_0x5d1d41['FVyVf'],(_0x5d5929,_0x49bce9)=>{const _0x111c23=_0x2d4d88,_0x360b8d=_0x5d5929[_0x111c23(_0x366624._0x12e457)]['splat'],_0x2f0d15=Array['isArray'](_0x360b8d)?_0x360b8d[_0x111c23(_0x366624._0x1ed455)]('/'):_0x360b8d,_0x461efb={};_0x461efb[_0x111c23(_0x366624._0x2702f8)]=_0x5d1d41['ddqRL'];if(!_0x2f0d15)return _0x49bce9['status'](0x190)['json'](_0x461efb);const _0x4056e5=_0x3ac76a(),_0x5911a1=_0x5d1d41[_0x111c23(_0x366624._0x3e0329)](resolveFilePath,_0x2f0d15,_0x4056e5['projectRoot'],_0x4056e5[_0x111c23(_0x366624._0x3e0c5d)]);if(!_0x4056e5[_0x111c23(_0x366624._0x7b8315)]['has'](_0x5911a1)){const _0x121b1a={};return _0x121b1a['error']=_0x111c23(0xb5)+_0x2f0d15,_0x49bce9[_0x111c23(_0x366624._0x4628b7)](0x194)['json'](_0x121b1a);}try{const _0x4d8387=fs[_0x111c23(0x150)](_0x5911a1,'utf-8'),_0x1abe65=_0x4d8387[_0x111c23(0x1b3)]('\x0a');_0x49bce9['json']({'path':_0x2f0d15,'lineCount':_0x1abe65[_0x111c23(0x1a4)],'content':_0x5d1d41['ogfDi'](_0x1abe65['length'],0x1f4)?_0x5d1d41[_0x111c23(0xe8)](_0x1abe65['slice'](0x0,0x1f4)[_0x111c23(0x1dd)]('\x0a'),'\x0a//\x20...\x20truncated\x20...'):_0x4d8387,'truncated':_0x1abe65['length']>0x1f4});}catch(_0x438573){const _0x4f88ce={};_0x4f88ce[_0x111c23(0x133)]=_0x438573['message'],_0x49bce9['status'](0x1f4)[_0x111c23(0x179)](_0x4f88ce);}}),_0x498efe['get'](_0x2d4d88(_0xee3532._0x1f7012),(_0x4b018d,_0x3769b2)=>{const _0x2175f2={_0x858e02:0x117,_0x2e5116:0x117,_0x442cff:0x1df,_0xdb5365:0x1c6,_0x255c87:0x132,_0x45740d:0xc8},_0x57add8=_0x2d4d88;if(!_0x5d1d41[_0x57add8(_0x3f2b9c._0x56111d)](_0x4257d2))return _0x3769b2['status'](0x193)[_0x57add8(0x179)](_0x5d1d41[_0x57add8(0x123)](_0x433a40,_0x57add8(_0x3f2b9c._0x2e82ac)));const _0x27988a=_0x5d1d41[_0x57add8(_0x3f2b9c._0x5982f9)](_0x3ac76a),_0x4ed4fc=_0x23d802=>path['relative'](_0x27988a[_0x57add8(0xc6)],_0x23d802)[_0x57add8(0x1aa)](/\\/g,'/'),_0x457288=[],_0x4c6184=new Set(),_0x5bd6d6=new Set(),_0x1094eb=new Map();function _0x409b43(_0x52ba52,_0x1ac8f4){const _0x4164b5=_0x57add8;if(_0x5d1d41['rvxZa'](_0x457288['length'],0x32))return;_0x4c6184[_0x4164b5(_0x2175f2._0x858e02)](_0x52ba52),_0x5bd6d6[_0x4164b5(_0x2175f2._0x2e5116)](_0x52ba52);const _0x4ed689=_0x27988a[_0x4164b5(0x1ab)]['get'](_0x52ba52)||[];for(const _0x492a26 of _0x4ed689){if(_0x5bd6d6[_0x4164b5(0xc8)](_0x492a26)){const _0x1a300c=_0x1ac8f4['indexOf'](_0x492a26);if(_0x5d1d41[_0x4164b5(_0x2175f2._0x442cff)](_0x1a300c,0x0)){const _0x3bf87a=_0x1ac8f4[_0x4164b5(0x1c8)](_0x1a300c)[_0x4164b5(_0x2175f2._0xdb5365)](_0x4ed4fc);_0x3bf87a['push'](_0x5d1d41[_0x4164b5(_0x2175f2._0x255c87)](_0x4ed4fc,_0x492a26)),_0x457288['push'](_0x3bf87a);}}else!_0x4c6184[_0x4164b5(_0x2175f2._0x45740d)](_0x492a26)&&_0x409b43(_0x492a26,[..._0x1ac8f4,_0x492a26]);}_0x5bd6d6['delete'](_0x52ba52);}for(const _0x1b2214 of _0x27988a[_0x57add8(_0x3f2b9c._0x276358)]){!_0x4c6184[_0x57add8(0xc8)](_0x1b2214)&&_0x409b43(_0x1b2214,[_0x1b2214]);}const _0x35d253={};_0x35d253['cycles']=_0x457288,_0x35d253['count']=_0x457288['length'],_0x3769b2[_0x57add8(_0x3f2b9c._0x5ad04f)](_0x35d253);}),_0x498efe[_0x2d4d88(_0xee3532._0x391820)]('/api/shortest-path',(_0xd8242,_0x29b330)=>{const _0xad3b86=_0x2d4d88,_0x442200=_0xd8242[_0xad3b86(0xd9)]['from'],_0x42283f=_0xd8242['query']['to'],_0x45c822={};_0x45c822['error']=_0xad3b86(0xca);if(!_0x442200||!_0x42283f)return _0x29b330['status'](0x190)['json'](_0x45c822);const _0x3cbea0=_0x3ac76a(),_0x135604=_0x255c44=>path[_0xad3b86(0x19b)](_0x3cbea0['sourceDir'],_0x255c44)[_0xad3b86(0x1aa)](/\\/g,'/'),_0x2eceaa=resolveFilePath(_0x442200,_0x3cbea0['projectRoot'],_0x3cbea0['sourceDir']),_0x57d94f=resolveFilePath(_0x42283f,_0x3cbea0[_0xad3b86(_0x594516._0xbc8c41)],_0x3cbea0['sourceDir']);if(!_0x3cbea0['files']['has'](_0x2eceaa)||!_0x3cbea0[_0xad3b86(_0x594516._0x20d130)]['has'](_0x57d94f)){const _0x1e976b={};return _0x1e976b[_0xad3b86(0x133)]='File\x20not\x20found\x20in\x20graph',_0x29b330['status'](0x194)['json'](_0x1e976b);}const _0x16386d=new Map(),_0x5393fd=new Set(),_0x3a5fc3=[_0x2eceaa];_0x5393fd[_0xad3b86(0x117)](_0x2eceaa);let _0x5e7fd5=![];while(_0x5d1d41[_0xad3b86(0x10a)](_0x3a5fc3['length'],0x0)&&!_0x5e7fd5){const _0x5bc00c=_0x3a5fc3[_0xad3b86(_0x594516._0x2f85cb)](),_0xf15936=new Set();(_0x3cbea0[_0xad3b86(0x1ab)][_0xad3b86(0xc7)](_0x5bc00c)||[])[_0xad3b86(_0x594516._0xf94a17)](_0x1adc5f=>_0xf15936['add'](_0x1adc5f)),(_0x3cbea0['reverse'][_0xad3b86(0xc7)](_0x5bc00c)||[])['forEach'](_0x41652b=>_0xf15936['add'](_0x41652b));for(const _0x4b7dad of _0xf15936){if(!_0x5393fd[_0xad3b86(_0x594516._0x4290e2)](_0x4b7dad)){_0x5393fd[_0xad3b86(0x117)](_0x4b7dad),_0x16386d['set'](_0x4b7dad,_0x5bc00c);if(_0x5d1d41[_0xad3b86(_0x594516._0x1c31b)](_0x4b7dad,_0x57d94f)){_0x5e7fd5=!![];break;}_0x3a5fc3['push'](_0x4b7dad);}}}const _0x1af272={};_0x1af272[_0xad3b86(0x1ba)]=[],_0x1af272['distance']=-0x1;if(!_0x5e7fd5)return _0x29b330[_0xad3b86(0x179)](_0x1af272);const _0x395a0f=[];let _0x4cf3c5=_0x57d94f;while(_0x4cf3c5){_0x395a0f['unshift'](_0x135604(_0x4cf3c5)),_0x4cf3c5=_0x16386d[_0xad3b86(_0x594516._0x448901)](_0x4cf3c5);}const _0x35212c={};_0x35212c[_0xad3b86(_0x594516._0x370164)]=_0x395a0f,_0x35212c[_0xad3b86(_0x594516._0x50b5e9)]=_0x395a0f['length']-0x1,_0x29b330['json'](_0x35212c);}),_0x498efe[_0x2d4d88(_0xee3532._0x29f751)](_0x2d4d88(0x148),(_0x4413c1,_0x2eadfe)=>{const _0x141824=_0x2d4d88;if(!_0x4257d2())return _0x2eadfe[_0x141824(0x14a)](0x193)[_0x141824(_0x5a63c4._0xfef1db)](_0x433a40(_0x5d1d41[_0x141824(_0x5a63c4._0x1a1ebc)]));const _0x2aa407=_0x4413c1['params']['splat'],_0x3cdfbc=Array[_0x141824(_0x5a63c4._0x11b504)](_0x2aa407)?_0x2aa407[_0x141824(0x1dd)]('/'):_0x2aa407,_0x419e18={};_0x419e18[_0x141824(0x133)]='File\x20path\x20required';if(!_0x3cdfbc)return _0x2eadfe['status'](0x190)['json'](_0x419e18);const _0x10d6c9=_0x3ac76a(),_0x5f21c2=_0x5d1d41['ZuRMQ'](resolveFilePath,_0x3cdfbc,_0x10d6c9[_0x141824(0x14c)],_0x10d6c9['sourceDir']),_0x225bd4=_0x78211a=>path['relative'](_0x10d6c9['sourceDir'],_0x78211a)['replace'](/\\/g,'/');if(!_0x10d6c9['files'][_0x141824(_0x5a63c4._0x362bfa)](_0x5f21c2)){const _0x19298f={};return _0x19298f['error']=_0x141824(_0x5a63c4._0x58619e)+_0x3cdfbc,_0x2eadfe['status'](0x194)[_0x141824(0x179)](_0x19298f);}const _0x95b450=(_0x10d6c9['reverse'][_0x141824(_0x5a63c4._0x365ce3)](_0x5f21c2)||[])[_0x141824(0x1c6)](_0x225bd4),_0x408a89=new Set(),_0x49dbb1=[..._0x10d6c9['reverse']['get'](_0x5f21c2)||[]];for(const _0x5ed07e of _0x49dbb1)_0x408a89['add'](_0x5ed07e);while(_0x49dbb1['length']>0x0){const _0x4ff513=_0x49dbb1[_0x141824(0x1a7)]();for(const _0x435a27 of _0x10d6c9[_0x141824(_0x5a63c4._0x232bb6)][_0x141824(_0x5a63c4._0x365ce3)](_0x4ff513)||[]){!_0x408a89[_0x141824(_0x5a63c4._0x1b8fe5)](_0x435a27)&&_0x5d1d41[_0x141824(_0x5a63c4._0x308d96)](_0x435a27,_0x5f21c2)&&(_0x408a89['add'](_0x435a27),_0x49dbb1['push'](_0x435a27));}}const _0x45ef1a=[];for(const _0xe6d224 of _0x10d6c9[_0x141824(0x1ab)]['get'](_0x5f21c2)||[]){const _0x4f426d=_0x10d6c9['reverse'][_0x141824(_0x5a63c4._0x5db3c6)](_0xe6d224)||[];_0x4f426d[_0x141824(0x1a4)]===0x1&&_0x4f426d[0x0]===_0x5f21c2&&_0x45ef1a['push'](_0x225bd4(_0xe6d224));}_0x2eadfe[_0x141824(_0x5a63c4._0xfef1db)]({'deletedFile':_0x3cdfbc,'brokenImports':_0x95b450,'brokenCount':_0x95b450['length'],'cascadeFiles':[..._0x408a89][_0x141824(0x1c6)](_0x225bd4),'cascadeCount':_0x408a89[_0x141824(0xac)],'orphanedFiles':_0x45ef1a,'orphanedCount':_0x45ef1a[_0x141824(_0x5a63c4._0x2f0411)],'severity':_0x408a89['size']>=0x14?'CRITICAL':_0x408a89[_0x141824(0xac)]>=0xa?_0x5d1d41['hbfpA']:_0x408a89['size']>=0x5?'MEDIUM':_0x5d1d41['wVnXC']});}),_0x498efe[_0x2d4d88(_0xee3532._0x1d1f8c)](_0x2d4d88(0x1cb),(_0x1c0e47,_0x290af8)=>{const _0x5a90f6=_0x2d4d88,_0x373d15=_0x5d1d41['OawwM'](getUnacknowledgedWarnings),_0x2e7524=getAllWarnings(),_0x2595e0={};_0x2595e0['unresolved']=_0x373d15,_0x2595e0[_0x5a90f6(_0x1b48ff._0x10659b)]=_0x373d15[_0x5a90f6(_0x1b48ff._0x2a56b5)],_0x2595e0[_0x5a90f6(0x1d3)]=_0x2e7524['length'],_0x290af8['json'](_0x2595e0);}),_0x498efe[_0x2d4d88(_0xee3532._0x316fe5)]('/api/warnings/acknowledge',(_0x14c4e3,_0xbf096e)=>{const _0x368b94=_0x2d4d88,_0x2a0886=acknowledgeWarnings(),_0xc47130={};_0xc47130[_0x368b94(0xe4)]=_0x2a0886,_0xbf096e[_0x368b94(_0x4a3e2c._0x393abd)](_0xc47130);}),_0x498efe[_0x2d4d88(0xc7)](_0x2d4d88(0xf6),(_0x57ff69,_0x445f3d)=>{const _0x1fffff=_0x2d4d88,_0x3c34fe=_0x5d1d41[_0x1fffff(0x145)](_0x3ac76a);let _0x48d3b9=0x0;for(const _0x549721 of _0x3c34fe[_0x1fffff(0x1ab)][_0x1fffff(0xe2)]())_0x48d3b9+=_0x549721['length'];const _0x34aebb=_0x5d9bab?.();let _0x96b6c7=_0x5d1d41[_0x1fffff(0x1ea)];try{const _0x5e9b13=JSON[_0x1fffff(0x10c)](fs['readFileSync'](path[_0x1fffff(_0x220110._0x569ba4)](__dirname,'..',_0x5d1d41[_0x1fffff(_0x220110._0x2ebb88)]),_0x5d1d41[_0x1fffff(0x12f)]));_0x96b6c7=_0x5e9b13['version']||'unknown';}catch{}const _0x197a7a=(0x0,config_1['getConfig'])('licenseKey',_0x1fffff(_0x220110._0x2c49db))||'',_0x5f4e55=_0x5d1d41[_0x1fffff(0x103)](_0x197a7a[_0x1fffff(_0x220110._0xb94906)],0xa)?_0x5d1d41[_0x1fffff(_0x220110._0x3ef063)](_0x197a7a[_0x1fffff(0xfb)](0x0,0x9),_0x5d1d41[_0x1fffff(0x160)])+_0x197a7a['substring'](_0x197a7a[_0x1fffff(0x1a4)]-0x4):'',_0x1dc877={};_0x1dc877['gemini']=![],_0x1dc877[_0x1fffff(0x13f)]=![],_0x1dc877['anthropic']=![];const _0x4748dc={};_0x4748dc[_0x1fffff(_0x220110._0x1439f3)]=_0x5d1d41['XrTNs'],_0x4748dc['configured']=_0x1dc877,_0x4748dc[_0x1fffff(_0x220110._0x56e6ca)]=null;const _0x3fba1b=_0x4bc9c3?_0x4bc9c3():_0x4748dc;_0x445f3d[_0x1fffff(0x179)]({'projectRoot':_0xea6cbb?_0x5d1d41['nENqG'](_0xea6cbb):_0x3c34fe['projectRoot'],'packageName':_0x18099f?_0x5d1d41['OawwM'](_0x18099f):'','languages':_0x3c34fe['languages'],'fileCount':_0x3c34fe[_0x1fffff(_0x220110._0x4241ec)]['size'],'edgeCount':_0x48d3b9,'plan':_0x34aebb?.[_0x1fffff(0x1f4)]||_0x5d1d41['ghDwy'],'planSource':_0x34aebb?.[_0x1fffff(_0x220110._0x1e0aba)]||_0x5d1d41['HvHyJ'],'expiresAt':_0x34aebb?.['expiresAt']||null,'licenseKey':_0x5f4e55,'freeFileLimit':0x32,'sykeVersion':_0x96b6c7,'aiProvider':_0x3fba1b['activeProvider'],'aiKeys':_0x3fba1b[_0x1fffff(0xb9)],'aiProviderForced':_0x3fba1b['forced']});}),_0x498efe['post'](_0x2d4d88(_0xee3532._0xe41f1a),async(_0x32e011,_0x191073)=>{const _0x95fb92=_0x2d4d88;if(!_0x5bd221){const _0x1d7f9b={};_0x1d7f9b[_0x95fb92(0xba)]=![],_0x1d7f9b[_0x95fb92(0x133)]=_0x95fb92(_0x1b5740._0x35ff8d),_0x191073[_0x95fb92(_0x1b5740._0x428d95)](0x1f5)['json'](_0x1d7f9b);return;}const {key:_0x449913}=_0x32e011['body'];try{const _0x384cbb=await _0x5d1d41['ibysC'](_0x5bd221,_0x449913||null);_0x191073[_0x95fb92(_0x1b5740._0x2dcd53)](_0x384cbb);}catch(_0x39fd03){const _0x643c93={};_0x643c93['success']=![],_0x643c93['error']=_0x39fd03[_0x95fb92(0x1b1)]||_0x5d1d41[_0x95fb92(0x1b0)],_0x191073['status'](0x1f4)[_0x95fb92(_0x1b5740._0x23f55f)](_0x643c93);}}),_0x498efe['post'](_0x5d1d41[_0x2d4d88(0xff)],(_0x11d628,_0x3b5a8b)=>{const _0x17c642=_0x2d4d88;if(!_0x3ccb99){const _0x813c88={};_0x813c88[_0x17c642(_0x140fa5._0x3bac3f)]=![],_0x813c88[_0x17c642(0x133)]=_0x5d1d41['Zzvzx'],_0x3b5a8b[_0x17c642(0x14a)](0x1f5)['json'](_0x813c88);return;}const {provider:_0x5d21fb,key:_0x3ecec7}=_0x11d628['body'];if(!_0x5d21fb||!['gemini',_0x5d1d41[_0x17c642(0x185)],'anthropic'][_0x17c642(0x194)](_0x5d21fb)){const _0x464494={};_0x464494['success']=![],_0x464494[_0x17c642(0x133)]=_0x5d1d41[_0x17c642(_0x140fa5._0x35210f)],_0x3b5a8b['status'](0x190)['json'](_0x464494);return;}try{const _0x3e9fb6=_0x3ccb99(_0x5d21fb,_0x3ecec7||null);_0x3b5a8b[_0x17c642(_0x140fa5._0x35d314)](_0x3e9fb6);}catch(_0x526fdc){const _0x3d50e4={};_0x3d50e4[_0x17c642(_0x140fa5._0x936922)]=![],_0x3d50e4[_0x17c642(_0x140fa5._0x42b57b)]=_0x526fdc[_0x17c642(_0x140fa5._0x20532e)]||_0x5d1d41[_0x17c642(_0x140fa5._0x32aea2)],_0x3b5a8b['status'](0x1f4)[_0x17c642(_0x140fa5._0x344840)](_0x3d50e4);}}),_0x498efe[_0x2d4d88(_0xee3532._0x3a4310)](_0x2d4d88(_0xee3532._0x51b0d3),(_0x269a78,_0x40fc0f)=>{const _0x4d8862=_0x2d4d88;if(!_0xef7e9e){const _0x4ebf42={};_0x4ebf42[_0x4d8862(_0x628c67._0x5bdff9)]=![],_0x4ebf42[_0x4d8862(0x133)]=_0x5d1d41['Zzvzx'],_0x40fc0f[_0x4d8862(0x14a)](0x1f5)['json'](_0x4ebf42);return;}const {provider:_0x191d21}=_0x269a78['body'];if(!_0x191d21||![_0x5d1d41['RDpCt'],_0x4d8862(_0x628c67._0x32ecc9),_0x5d1d41['ynfFf'],'auto'][_0x4d8862(0x194)](_0x191d21)){const _0x2bfa31={};_0x2bfa31['success']=![],_0x2bfa31[_0x4d8862(_0x628c67._0x999e3b)]='provider\x20must\x20be\x20gemini,\x20openai,\x20anthropic,\x20or\x20auto',_0x40fc0f['status'](0x190)['json'](_0x2bfa31);return;}try{const _0x5e6529=_0xef7e9e(_0x191d21);_0x40fc0f[_0x4d8862(_0x628c67._0x4e6c2e)](_0x5e6529);}catch(_0x664cfc){const _0x25856b={};_0x25856b[_0x4d8862(0xba)]=![],_0x25856b['error']=_0x664cfc[_0x4d8862(0x1b1)]||_0x5d1d41[_0x4d8862(0x1b0)],_0x40fc0f[_0x4d8862(0x14a)](0x1f4)['json'](_0x25856b);}}),_0x498efe['get'](_0x5d1d41['WSLzp'],(_0x3657e3,_0x201683)=>{const _0x185451=_0x2d4d88,_0xc3dac6={'SyOrc':_0x185451(0x134),'siGuY':function(_0x394a85,_0x32727a){return _0x5d1d41['LwFcR'](_0x394a85,_0x32727a);},'LmjGi':_0x5d1d41['ndzRw']},_0x92e9e0=_0x3657e3[_0x185451(_0x2fa031._0x5ea237)][_0x185451(0x1ba)]||(process[_0x185451(0x14f)]===_0x185451(0x196)?_0x5d1d41['rYWXt']:'/'),_0x3b34c1=path[_0x185451(_0x2fa031._0x3d7af9)](_0x92e9e0);if(!fs['existsSync'](_0x3b34c1)||!fs['statSync'](_0x3b34c1)[_0x185451(0x1d7)]()){const _0x422bb6={};return _0x422bb6[_0x185451(0x133)]=_0x185451(_0x2fa031._0x42c947)+_0x3b34c1,_0x201683['status'](0x190)['json'](_0x422bb6);}try{const _0x1704ea={};_0x1704ea[_0x185451(_0x2fa031._0x2c2de9)]=!![];const _0x462d87=fs['readdirSync'](_0x3b34c1,_0x1704ea),_0x5c2644=_0x462d87['filter'](_0x25e9a4=>{const _0x5b47d7=_0x185451;if(!_0x25e9a4['isDirectory']())return![];const _0x14e029=_0x25e9a4[_0x5b47d7(_0x4b0358._0x58521a)];if(_0x14e029['startsWith']('.')||_0x14e029===_0xc3dac6[_0x5b47d7(_0x4b0358._0x3aaf5c)]||_0xc3dac6['siGuY'](_0x14e029,_0xc3dac6['LmjGi'])||_0x14e029==='System\x20Volume\x20Information')return![];return!![];})[_0x185451(_0x2fa031._0x1c794f)](_0x5ab6d9=>_0x5ab6d9[_0x185451(0x1a0)])['sort']((_0x53da75,_0x281a49)=>_0x53da75[_0x185451(0x102)]()['localeCompare'](_0x281a49['toLowerCase']())),_0x2e390d=[_0x5d1d41['TRDSE'],_0x185451(0x18c),'Cargo.toml',_0x5d1d41['uliri'],_0x5d1d41[_0x185451(_0x2fa031._0x4045f6)],_0x5d1d41[_0x185451(_0x2fa031._0x2452d5)],_0x185451(_0x2fa031._0x459517),_0x185451(0x1f5),_0x185451(0x17c),_0x5d1d41['rlkks']],_0x4aaeb3=_0x2e390d[_0x185451(_0x2fa031._0x5d71e9)](_0x2dc093=>fs[_0x185451(0x14b)](path['join'](_0x3b34c1,_0x2dc093))),_0x4790c9=_0x2e390d['find'](_0x575de=>fs['existsSync'](path[_0x185451(0x1dd)](_0x3b34c1,_0x575de)))||null;_0x201683['json']({'current':_0x3b34c1,'parent':_0x5d1d41[_0x185451(0x13a)](path[_0x185451(_0x2fa031._0x26d5b3)](_0x3b34c1),_0x3b34c1)?path['dirname'](_0x3b34c1):null,'dirs':_0x5c2644,'isProject':_0x4aaeb3,'detectedMarker':_0x4790c9});}catch(_0x23e4c9){const _0x153d70={};_0x153d70[_0x185451(_0x2fa031._0x4a803a)]=_0x23e4c9[_0x185451(_0x2fa031._0x30ba35)],_0x201683['status'](0x1f4)[_0x185451(_0x2fa031._0x1d6a97)](_0x153d70);}}),_0x498efe['post']('/api/switch-project',(_0x311b66,_0x492f2d)=>{const _0x4b40af=_0x2d4d88,{projectRoot:_0x5efeee}=_0x311b66['body'];if(!_0x5efeee||typeof _0x5efeee!==_0x5d1d41[_0x4b40af(0x106)]){const _0x56a6b9={};return _0x56a6b9[_0x4b40af(0x133)]=_0x4b40af(0x151),_0x492f2d[_0x4b40af(0x14a)](0x190)[_0x4b40af(_0x103161._0x47e679)](_0x56a6b9);}const _0x50c7b0=path['normalize'](_0x5efeee);if(!_0x4257d2()){const _0x290d90=_0xea6cbb?path[_0x4b40af(0xce)](_0x5d1d41[_0x4b40af(0xe5)](_0xea6cbb)):null;if(_0x290d90&&_0x5d1d41[_0x4b40af(0x13a)](_0x50c7b0,_0x290d90)){const _0x2bede8={};return _0x2bede8['error']=_0x5d1d41['nfLZP'],_0x2bede8[_0x4b40af(0x1ce)]=_0x5d1d41['USevR'],_0x492f2d[_0x4b40af(_0x103161._0x495c35)](0x193)['json'](_0x2bede8);}}if(!fs[_0x4b40af(0x14b)](_0x50c7b0)||!fs[_0x4b40af(_0x103161._0x46fde2)](_0x50c7b0)[_0x4b40af(0x1d7)]()){const _0x100896={};return _0x100896[_0x4b40af(0x133)]=_0x4b40af(0x19e)+_0x50c7b0,_0x492f2d['status'](0x190)[_0x4b40af(_0x103161._0x47e679)](_0x100896);}if(!_0x17d552){const _0x1391ab={};return _0x1391ab['error']=_0x5d1d41['qcLfB'],_0x492f2d['status'](0x1f4)[_0x4b40af(_0x103161._0x3f20f3)](_0x1391ab);}try{const _0x55fca9=_0x17d552(_0x50c7b0);_0x16ccbb(_0x5d1d41['jhGmU'],_0x55fca9),_0x492f2d['json'](_0x55fca9);}catch(_0x23e8c8){const _0x287c39={};_0x287c39['error']=_0x23e8c8[_0x4b40af(_0x103161._0xd1b2e5)]||_0x4b40af(0x1fb),_0x492f2d[_0x4b40af(0x14a)](0x1f4)['json'](_0x287c39);}});const _0x15d392={};return _0x15d392[_0x2d4d88(0xee)]=_0x498efe,_0x15d392[_0x2d4d88(_0xee3532._0x47302f)]=_0x54a600,_0x15d392;}
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.addWarning = addWarning;
40
+ exports.getUnacknowledgedWarnings = getUnacknowledgedWarnings;
41
+ exports.acknowledgeWarnings = acknowledgeWarnings;
42
+ exports.getAllWarnings = getAllWarnings;
43
+ exports.createWebServer = createWebServer;
44
+ const path = __importStar(require("path"));
45
+ const fs = __importStar(require("fs"));
46
+ const express_1 = __importDefault(require("express"));
47
+ const plugin_1 = require("../languages/plugin");
48
+ const analyze_impact_1 = require("../tools/analyze-impact");
49
+ const analyzer_1 = require("../ai/analyzer");
50
+ const realtime_analyzer_1 = require("../ai/realtime-analyzer");
51
+ const config_1 = require("../config");
52
+ // ── Real-time AI analysis toggle ──
53
+ let realtimeAIEnabled = true;
54
+ function resolveFilePath(fileArg, projectRoot, sourceDir) {
55
+ const srcDir = sourceDir || path.join(projectRoot, "lib");
56
+ const srcDirName = path.basename(srcDir); // "lib" or "src"
57
+ if (path.isAbsolute(fileArg))
58
+ return path.normalize(fileArg);
59
+ if (fileArg.startsWith(srcDirName + "/") || fileArg.startsWith(srcDirName + "\\")) {
60
+ return path.normalize(path.join(projectRoot, fileArg));
61
+ }
62
+ return path.normalize(path.join(srcDir, fileArg));
63
+ }
64
+ function classifyFile(relPath) {
65
+ const lower = relPath.toLowerCase();
66
+ const fileName = lower.split("/").pop() || "";
67
+ // ── Layer — try plugin-specific classification first ──
68
+ let layer = "UTIL";
69
+ const plugin = (0, plugin_1.getPluginForFile)(relPath);
70
+ const pluginLayer = plugin?.classifyLayer?.(relPath);
71
+ if (pluginLayer) {
72
+ layer = pluginLayer;
73
+ }
74
+ else {
75
+ // FE: presentation layer, UI components
76
+ if (lower.includes("/presentation/") ||
77
+ lower.includes("/widgets/") ||
78
+ lower.includes("/screens/") ||
79
+ lower.includes("/pages/") ||
80
+ lower.includes("web/public/") ||
81
+ lower.includes("components/") ||
82
+ fileName.endsWith("_screen.dart") ||
83
+ fileName.endsWith("_page.dart") ||
84
+ fileName.endsWith("_widget.dart") ||
85
+ fileName.endsWith("_dialog.dart") ||
86
+ fileName.endsWith("_view.dart") ||
87
+ fileName.endsWith("_card.dart") ||
88
+ fileName.endsWith("_tile.dart") ||
89
+ fileName.endsWith("_form.dart") ||
90
+ fileName.endsWith("_bottom_sheet.dart") ||
91
+ fileName.endsWith(".html") ||
92
+ fileName.endsWith(".css") ||
93
+ fileName.endsWith(".jsx") ||
94
+ fileName.endsWith(".tsx")) {
95
+ layer = "FE";
96
+ }
97
+ // API: network/remote layer
98
+ else if (lower.includes("/api/") ||
99
+ fileName.includes("cloud_function") ||
100
+ fileName.endsWith("_api.dart") ||
101
+ fileName.endsWith("_client.dart") ||
102
+ fileName.endsWith("_remote.dart") ||
103
+ fileName.includes("_datasource") ||
104
+ fileName.includes("_data_source") ||
105
+ lower.includes("web/server") ||
106
+ fileName.endsWith("server.ts") ||
107
+ fileName.endsWith("server.js")) {
108
+ layer = "API";
109
+ }
110
+ // DB: data models, entities
111
+ else if (lower.includes("/models/") ||
112
+ lower.includes("/entities/") ||
113
+ fileName.endsWith("_model.dart") ||
114
+ fileName.endsWith("_entity.dart") ||
115
+ fileName.endsWith("_dto.dart") ||
116
+ fileName.endsWith("_schema.dart") ||
117
+ fileName.endsWith(".model.ts") ||
118
+ fileName.endsWith(".entity.ts") ||
119
+ fileName.endsWith(".schema.ts")) {
120
+ layer = "DB";
121
+ }
122
+ // BE: business logic, repositories, services, state management
123
+ else if (lower.includes("/data/") ||
124
+ lower.includes("/domain/") ||
125
+ lower.includes("/application/") ||
126
+ lower.includes("/providers/") ||
127
+ lower.includes("/notifiers/") ||
128
+ lower.includes("tools/") ||
129
+ lower.includes("ai/") ||
130
+ lower.includes("watcher/") ||
131
+ fileName.endsWith("_repository.dart") ||
132
+ fileName.endsWith("_service.dart") ||
133
+ fileName.endsWith("_provider.dart") ||
134
+ fileName.endsWith("_notifier.dart") ||
135
+ fileName.endsWith("_controller.dart") ||
136
+ fileName.endsWith("_usecase.dart") ||
137
+ fileName.endsWith("_state.dart") ||
138
+ fileName.endsWith("_bloc.dart") ||
139
+ fileName.endsWith("_cubit.dart") ||
140
+ fileName.endsWith(".service.ts") ||
141
+ fileName.endsWith(".controller.ts")) {
142
+ layer = "BE";
143
+ }
144
+ // CONFIG: app config, themes, routing, constants
145
+ else if (lower.includes("/config/") ||
146
+ lower.includes("/theme/") ||
147
+ lower.includes("/router/") ||
148
+ lower.includes("/routing/") ||
149
+ lower.startsWith("app/") ||
150
+ fileName.endsWith("_config.dart") ||
151
+ fileName.endsWith("_theme.dart") ||
152
+ fileName.endsWith("_constants.dart") ||
153
+ fileName.endsWith("_routes.dart") ||
154
+ fileName === "main.dart" ||
155
+ fileName === "index.ts" ||
156
+ fileName === "index.js" ||
157
+ fileName.endsWith(".config.ts") ||
158
+ fileName.endsWith(".config.js")) {
159
+ layer = "CONFIG";
160
+ }
161
+ // UTIL: utilities, helpers, extensions, shared
162
+ else if (lower.includes("/utils/") ||
163
+ lower.includes("/helpers/") ||
164
+ lower.includes("/extensions/") ||
165
+ lower.includes("shared/") ||
166
+ lower.includes("languages/") ||
167
+ fileName.endsWith("_util.dart") ||
168
+ fileName.endsWith("_helper.dart") ||
169
+ fileName.endsWith("_extension.dart") ||
170
+ fileName.endsWith("_mixin.dart") ||
171
+ fileName.endsWith(".util.ts") ||
172
+ fileName.endsWith(".helper.ts")) {
173
+ layer = "UTIL";
174
+ }
175
+ } // end plugin fallback
176
+ // ── Action (infer from filename patterns) ──
177
+ let action = "X";
178
+ if (fileName.includes("create") || fileName.includes("add") || fileName.includes("register") || fileName.includes("new")) {
179
+ action = "C";
180
+ }
181
+ else if (fileName.includes("list") || fileName.includes("get") || fileName.includes("fetch") || fileName.includes("show") || fileName.includes("detail") || fileName.includes("_screen") || fileName.includes("_page")) {
182
+ action = "R";
183
+ }
184
+ else if (fileName.includes("update") || fileName.includes("edit") || fileName.includes("modify") || fileName.includes("change")) {
185
+ action = "U";
186
+ }
187
+ else if (fileName.includes("delete") || fileName.includes("remove")) {
188
+ action = "D";
189
+ }
190
+ // ── Environment ──
191
+ const env = (fileName.includes("_test") || fileName.includes("_mock") || fileName.includes("_fake") || lower.includes("/test/")) ? "DEV" : "PROD";
192
+ return { layer, action, env };
193
+ }
194
+ const warningStore = [];
195
+ const MAX_WARNINGS = 50;
196
+ function addWarning(analysis) {
197
+ // Only store non-SAFE warnings
198
+ if (analysis.riskLevel === "SAFE")
199
+ return;
200
+ warningStore.unshift({
201
+ file: analysis.file,
202
+ riskLevel: analysis.riskLevel,
203
+ summary: analysis.summary,
204
+ brokenImports: analysis.brokenImports,
205
+ sideEffects: analysis.sideEffects,
206
+ warnings: analysis.warnings,
207
+ suggestion: analysis.suggestion,
208
+ affectedCount: analysis.affectedNodes.length,
209
+ timestamp: analysis.timestamp,
210
+ acknowledged: false,
211
+ });
212
+ // Cap the store
213
+ while (warningStore.length > MAX_WARNINGS)
214
+ warningStore.pop();
215
+ }
216
+ function getUnacknowledgedWarnings() {
217
+ return warningStore.filter(w => !w.acknowledged);
218
+ }
219
+ function acknowledgeWarnings() {
220
+ let count = 0;
221
+ for (const w of warningStore) {
222
+ if (!w.acknowledged) {
223
+ w.acknowledged = true;
224
+ count++;
225
+ }
226
+ }
227
+ return count;
228
+ }
229
+ function getAllWarnings() {
230
+ return [...warningStore];
231
+ }
232
+ function createWebServer(getGraphFn, initialFileCache, switchProjectFn, getProjectRoot, getPackageName, getLicenseStatus, hasAIKeyFn, setLicenseKeyFn, setAIKeyFn, getAIInfoFn, setAIProviderFn) {
233
+ const app = (0, express_1.default)();
234
+ app.use(express_1.default.json());
235
+ /** Check if current license is Pro (includes pro_trial) */
236
+ function isProPlan() {
237
+ const license = getLicenseStatus?.();
238
+ return license?.plan === "pro" || license?.plan === "pro_trial";
239
+ }
240
+ // Serve static files from public/
241
+ const publicDir = path.join(__dirname, "public");
242
+ app.use(express_1.default.static(publicDir));
243
+ // ── SSE: Server-Sent Events for real-time updates ──
244
+ const sseClients = new Set();
245
+ let currentFileCache = initialFileCache || null;
246
+ function broadcastSSE(event, data) {
247
+ const payload = `event: ${event}\ndata: ${JSON.stringify(data)}\n\n`;
248
+ for (const client of sseClients) {
249
+ try {
250
+ client.write(payload);
251
+ }
252
+ catch (_) {
253
+ sseClients.delete(client);
254
+ }
255
+ }
256
+ }
257
+ /**
258
+ * Build a specific error message for Pro-only features based on license state.
259
+ */
260
+ function getProFeatureError(featureName) {
261
+ const license = getLicenseStatus?.();
262
+ const upgrade = "https://syke.cloud/dashboard/";
263
+ if (license?.error) {
264
+ return { error: `${featureName}: ${license.error}`, requiresPro: true, upgrade };
265
+ }
266
+ if (license?.source === "online" && license?.expiresAt) {
267
+ // Had a license but it's no longer valid (expired trial or subscription)
268
+ return { error: `Trial expired. Upgrade at ${upgrade}`, requiresPro: true, upgrade };
269
+ }
270
+ return { error: `${featureName} requires SYKE Pro. Set SYKE_LICENSE_KEY or sign up at https://syke.cloud`, requiresPro: true, upgrade };
271
+ }
272
+ app.get("/api/events", (_req, res) => {
273
+ // Pro-only: real-time monitoring via SSE
274
+ if (!isProPlan()) {
275
+ res.status(403).json(getProFeatureError("Real-time monitoring"));
276
+ return;
277
+ }
278
+ res.writeHead(200, {
279
+ "Content-Type": "text/event-stream",
280
+ "Cache-Control": "no-cache",
281
+ "Connection": "keep-alive",
282
+ "Access-Control-Allow-Origin": "*",
283
+ });
284
+ // Send initial connection event
285
+ res.write(`event: connected\ndata: ${JSON.stringify({ clients: sseClients.size + 1, cacheSize: currentFileCache?.size || 0 })}\n\n`);
286
+ sseClients.add(res);
287
+ console.error(`[syke:sse] Client connected (${sseClients.size} total)`);
288
+ _req.on("close", () => {
289
+ sseClients.delete(res);
290
+ console.error(`[syke:sse] Client disconnected (${sseClients.size} total)`);
291
+ });
292
+ });
293
+ // Wire FileCache change events → SSE broadcast + AI analysis
294
+ function wireFileCacheEvents(cache) {
295
+ // Give the FileCache a reference to the current graph for incremental updates
296
+ const graph = getGraphFn();
297
+ cache.setGraph(graph);
298
+ // Listen for incremental graph updates (emitted after file changes update edges)
299
+ cache.on("graph-updated", (result) => {
300
+ if (result.edgesChanged) {
301
+ console.error(`[syke:sse] Graph incrementally updated: ${result.updatedFile} ` +
302
+ `(+${result.addedEdges.length}/-${result.removedEdges.length} edges, ` +
303
+ `${result.affectedFiles.length} affected files)`);
304
+ broadcastSSE("graph-incremental-update", {
305
+ file: path.relative(getGraphFn().sourceDir, result.updatedFile).replace(/\\/g, "/"),
306
+ addedEdges: result.addedEdges.length,
307
+ removedEdges: result.removedEdges.length,
308
+ affectedFiles: result.affectedFiles.length,
309
+ });
310
+ }
311
+ });
312
+ cache.on("change", async (change) => {
313
+ const graph = getGraphFn();
314
+ const absPath = path.normalize(path.join(graph.sourceDir, change.relativePath));
315
+ // Compute affected nodes for visual pulse
316
+ const revDeps = graph.reverse.get(absPath) || [];
317
+ const fwdDeps = graph.forward.get(absPath) || [];
318
+ const connectedNodes = [...new Set([...revDeps, ...fwdDeps])].map(f => path.relative(graph.sourceDir, f).replace(/\\/g, "/"));
319
+ // Send diff lines (capped at 100 for bandwidth)
320
+ const diffLines = change.diff.slice(0, 100).map(d => ({
321
+ line: d.line,
322
+ type: d.type,
323
+ old: d.old,
324
+ new: d.new,
325
+ }));
326
+ // Send new file content (for code crawl display)
327
+ const newLines = change.newContent
328
+ ? change.newContent.split("\n").slice(0, 300)
329
+ : [];
330
+ // Immediately broadcast the file change event (node pulse starts)
331
+ broadcastSSE("file-change", {
332
+ file: change.relativePath,
333
+ type: change.type,
334
+ diffCount: change.diff.length,
335
+ diff: diffLines,
336
+ newContent: newLines,
337
+ connectedNodes,
338
+ timestamp: change.timestamp,
339
+ });
340
+ // Run Gemini real-time analysis (Pro only, when toggle is on)
341
+ if (isProPlan() && realtimeAIEnabled) {
342
+ broadcastSSE("analysis-start", { file: change.relativePath });
343
+ try {
344
+ const analysis = await (0, realtime_analyzer_1.analyzeChangeRealtime)(change, graph, (relPath) => currentFileCache?.getFileByRelPath(relPath) ?? null);
345
+ broadcastSSE("analysis-result", analysis);
346
+ // Store warnings for MCP check_warnings tool
347
+ addWarning(analysis);
348
+ // If graph structure changed (new/deleted files), rebuild
349
+ if (change.type === "added" || change.type === "deleted") {
350
+ broadcastSSE("graph-rebuild", { reason: change.type, file: change.relativePath });
351
+ }
352
+ }
353
+ catch (err) {
354
+ broadcastSSE("analysis-error", {
355
+ file: change.relativePath,
356
+ error: err.message,
357
+ });
358
+ }
359
+ }
360
+ else if (isProPlan() && !realtimeAIEnabled) {
361
+ // Pro but AI toggle is off — log and skip AI, still handle structural changes
362
+ console.error(`[syke:ai] Real-time AI disabled — skipping analysis for ${change.relativePath}`);
363
+ if (change.type === "added" || change.type === "deleted") {
364
+ broadcastSSE("graph-rebuild", { reason: change.type, file: change.relativePath });
365
+ }
366
+ }
367
+ else {
368
+ // Free: still rebuild graph on structural changes, but skip AI
369
+ if (change.type === "added" || change.type === "deleted") {
370
+ broadcastSSE("graph-rebuild", { reason: change.type, file: change.relativePath });
371
+ }
372
+ }
373
+ });
374
+ }
375
+ if (currentFileCache)
376
+ wireFileCacheEvents(currentFileCache);
377
+ /** Replace the FileCache (called after switchProject) */
378
+ function setFileCache(cache) {
379
+ currentFileCache = cache;
380
+ wireFileCacheEvents(cache);
381
+ console.error(`[syke:sse] FileCache re-wired (${cache.size} files)`);
382
+ }
383
+ // GET /api/cache-status — Memory cache stats
384
+ app.get("/api/cache-status", (_req, res) => {
385
+ if (!currentFileCache) {
386
+ return res.json({ enabled: false });
387
+ }
388
+ res.json({
389
+ enabled: true,
390
+ fileCount: currentFileCache.size,
391
+ totalLines: currentFileCache.totalLines,
392
+ sseClients: sseClients.size,
393
+ });
394
+ });
395
+ // POST /api/toggle-realtime-ai — Enable or disable real-time AI analysis
396
+ app.post("/api/toggle-realtime-ai", (req, res) => {
397
+ const { enabled } = req.body;
398
+ if (typeof enabled === "boolean") {
399
+ realtimeAIEnabled = enabled;
400
+ }
401
+ else {
402
+ realtimeAIEnabled = !realtimeAIEnabled;
403
+ }
404
+ console.error(`[syke:ai] Real-time AI analysis ${realtimeAIEnabled ? "ENABLED" : "DISABLED"}`);
405
+ res.json({ realtimeAIEnabled });
406
+ });
407
+ // GET /api/graph — Cytoscape.js compatible JSON
408
+ app.get("/api/graph", (_req, res) => {
409
+ const graph = getGraphFn();
410
+ const isPro = isProPlan();
411
+ const FREE_GRAPH_LIMIT = 50;
412
+ const nodes = [];
413
+ const edges = [];
414
+ // ── Compute depth for each file (BFS from roots) ──
415
+ const depthMap = new Map();
416
+ const roots = [...graph.files].filter(f => {
417
+ const rev = graph.reverse.get(f);
418
+ return !rev || rev.length === 0;
419
+ });
420
+ const queue = roots.map(r => [r, 0]);
421
+ while (queue.length > 0) {
422
+ const [file, d] = queue.shift();
423
+ if (depthMap.has(file))
424
+ continue;
425
+ depthMap.set(file, d);
426
+ const fwdDeps = graph.forward.get(file) || [];
427
+ for (const dep of fwdDeps) {
428
+ if (!depthMap.has(dep))
429
+ queue.push([dep, d + 1]);
430
+ }
431
+ }
432
+ // Free tier: limit to first 50 files sorted alphabetically
433
+ const allFiles = [...graph.files].sort();
434
+ const visibleFiles = isPro ? allFiles : allFiles.slice(0, FREE_GRAPH_LIMIT);
435
+ const visibleSet = new Set(visibleFiles);
436
+ for (const file of visibleFiles) {
437
+ const rel = path.relative(graph.sourceDir, file).replace(/\\/g, "/");
438
+ const revDeps = graph.reverse.get(file) || [];
439
+ const dependentCount = revDeps.length;
440
+ const riskLevel = (0, analyze_impact_1.classifyRisk)(dependentCount);
441
+ const parts = rel.split("/");
442
+ const group = parts.length > 1 ? parts[0] + "/" + parts[1] : parts[0];
443
+ const { layer, action, env } = classifyFile(rel);
444
+ // Count lines
445
+ let lineCount = 0;
446
+ try {
447
+ const content = fs.readFileSync(file, "utf-8");
448
+ lineCount = content.split("\n").length;
449
+ }
450
+ catch (_) { }
451
+ // Imports count (direct forward dependencies)
452
+ const importsCount = (graph.forward.get(file) || []).length;
453
+ // Depth in dependency tree
454
+ const depth = depthMap.get(file) ?? 0;
455
+ nodes.push({
456
+ data: {
457
+ id: rel,
458
+ label: parts[parts.length - 1],
459
+ fullPath: rel,
460
+ riskLevel,
461
+ dependentCount,
462
+ lineCount,
463
+ importsCount,
464
+ depth,
465
+ group,
466
+ layer,
467
+ action,
468
+ env,
469
+ },
470
+ });
471
+ }
472
+ for (const [file, deps] of graph.forward) {
473
+ // Only include edges where both source and target are in the visible set
474
+ if (!visibleSet.has(file))
475
+ continue;
476
+ const from = path.relative(graph.sourceDir, file).replace(/\\/g, "/");
477
+ for (const d of deps) {
478
+ if (!visibleSet.has(d))
479
+ continue;
480
+ const to = path.relative(graph.sourceDir, d).replace(/\\/g, "/");
481
+ edges.push({ data: { source: from, target: to } });
482
+ }
483
+ }
484
+ res.json({ nodes, edges, totalFiles: graph.files.size, limited: !isPro && graph.files.size > FREE_GRAPH_LIMIT });
485
+ });
486
+ // GET /api/impact/:file — Impact analysis for a specific file
487
+ app.get("/api/impact/*splat", async (req, res) => {
488
+ const splat = req.params.splat;
489
+ const fileParam = Array.isArray(splat) ? splat.join("/") : splat;
490
+ if (!fileParam) {
491
+ return res.status(400).json({ error: "File path required" });
492
+ }
493
+ const graph = getGraphFn();
494
+ const resolved = resolveFilePath(fileParam, graph.projectRoot, graph.sourceDir);
495
+ if (!graph.files.has(resolved)) {
496
+ return res.status(404).json({ error: `File not found in graph: ${fileParam}` });
497
+ }
498
+ const result = await (0, analyze_impact_1.analyzeImpact)(resolved, graph);
499
+ res.json(result);
500
+ });
501
+ // POST /api/ai-analyze — AI semantic analysis (Pro or BYOK)
502
+ app.post("/api/ai-analyze", async (req, res) => {
503
+ const isPro = isProPlan();
504
+ const hasKey = hasAIKeyFn?.() || false;
505
+ if (!isPro && !hasKey) {
506
+ return res.status(403).json({
507
+ ...getProFeatureError("AI analysis"),
508
+ hint: "Or set GEMINI_KEY / OPENAI_KEY / ANTHROPIC_KEY to use ai_analyze with your own API key.",
509
+ });
510
+ }
511
+ const { file } = req.body;
512
+ if (!file) {
513
+ return res.status(400).json({ error: "file is required in body" });
514
+ }
515
+ const graph = getGraphFn();
516
+ const resolved = resolveFilePath(file, graph.projectRoot, graph.sourceDir);
517
+ if (!graph.files.has(resolved)) {
518
+ return res.status(404).json({ error: `File not found in graph: ${file}` });
519
+ }
520
+ // Free tier: check file limit
521
+ if (!isPro) {
522
+ const allFiles = [...graph.files].sort();
523
+ const idx = allFiles.indexOf(resolved);
524
+ if (idx < 0 || idx >= 50) {
525
+ return res.status(403).json({ error: "This file exceeds the Free tier limit (50 files). Upgrade to Pro for unlimited analysis.", upgrade: "https://syke.cloud/dashboard/" });
526
+ }
527
+ }
528
+ const impactResult = await (0, analyze_impact_1.analyzeImpact)(resolved, graph);
529
+ try {
530
+ const aiResult = await (0, analyzer_1.analyzeWithAI)(resolved, impactResult, graph);
531
+ const partial = !isPro && graph.files.size > 50;
532
+ res.json({ file: impactResult.relativePath, analysis: aiResult, partial });
533
+ }
534
+ catch (err) {
535
+ res.status(500).json({ error: err.message || "AI analysis failed" });
536
+ }
537
+ });
538
+ // GET /api/hub-files — Top hub files ranking (Pro only)
539
+ app.get("/api/hub-files", (req, res) => {
540
+ if (!isProPlan()) {
541
+ return res.status(403).json(getProFeatureError("Hub files ranking"));
542
+ }
543
+ const requested = parseInt(req.query.top) || 10;
544
+ const graph = getGraphFn();
545
+ const hubs = (0, analyze_impact_1.getHubFiles)(graph, requested);
546
+ res.json({ hubs, totalFiles: graph.files.size, limited: false, plan: "pro" });
547
+ });
548
+ // POST /api/connected-code — Batch load code from file + connected nodes
549
+ app.post("/api/connected-code", (req, res) => {
550
+ const { file, maxFiles = 6, maxLinesPerFile = 80 } = req.body;
551
+ if (!file)
552
+ return res.status(400).json({ error: "file required" });
553
+ const graph = getGraphFn();
554
+ const resolved = resolveFilePath(file, graph.projectRoot, graph.sourceDir);
555
+ const toRel = (f) => path.relative(graph.sourceDir, f).replace(/\\/g, "/");
556
+ if (!graph.files.has(resolved)) {
557
+ return res.status(404).json({ error: `File not found: ${file}` });
558
+ }
559
+ // Gather: selected file + direct dependents + direct imports
560
+ const filesToLoad = [resolved];
561
+ const revDeps = graph.reverse.get(resolved) || [];
562
+ const fwdDeps = graph.forward.get(resolved) || [];
563
+ for (const d of [...revDeps, ...fwdDeps]) {
564
+ if (!filesToLoad.includes(d))
565
+ filesToLoad.push(d);
566
+ if (filesToLoad.length >= maxFiles)
567
+ break;
568
+ }
569
+ const results = [];
570
+ for (const f of filesToLoad) {
571
+ try {
572
+ const content = fs.readFileSync(f, "utf-8");
573
+ const allLines = content.split("\n");
574
+ const rel = toRel(f);
575
+ const { layer } = classifyFile(rel);
576
+ results.push({
577
+ path: rel,
578
+ layer,
579
+ lines: allLines.slice(0, maxLinesPerFile),
580
+ lineCount: allLines.length,
581
+ });
582
+ }
583
+ catch (_) { }
584
+ }
585
+ res.json({ files: results });
586
+ });
587
+ // GET /api/file-content/:file — Source code preview
588
+ app.get("/api/file-content/*splat", (req, res) => {
589
+ const splat = req.params.splat;
590
+ const fileParam = Array.isArray(splat) ? splat.join("/") : splat;
591
+ if (!fileParam)
592
+ return res.status(400).json({ error: "File path required" });
593
+ const graph = getGraphFn();
594
+ const resolved = resolveFilePath(fileParam, graph.projectRoot, graph.sourceDir);
595
+ if (!graph.files.has(resolved)) {
596
+ return res.status(404).json({ error: `File not found: ${fileParam}` });
597
+ }
598
+ try {
599
+ const content = fs.readFileSync(resolved, "utf-8");
600
+ const lines = content.split("\n");
601
+ res.json({
602
+ path: fileParam,
603
+ lineCount: lines.length,
604
+ content: lines.length > 500 ? lines.slice(0, 500).join("\n") + "\n// ... truncated ..." : content,
605
+ truncated: lines.length > 500,
606
+ });
607
+ }
608
+ catch (err) {
609
+ res.status(500).json({ error: err.message });
610
+ }
611
+ });
612
+ // GET /api/cycles — Detect circular dependencies (Pro only)
613
+ app.get("/api/cycles", (_req, res) => {
614
+ if (!isProPlan()) {
615
+ return res.status(403).json(getProFeatureError("Cycle detection"));
616
+ }
617
+ const graph = getGraphFn();
618
+ const toRel = (f) => path.relative(graph.sourceDir, f).replace(/\\/g, "/");
619
+ const cycles = [];
620
+ const visited = new Set();
621
+ const stack = new Set();
622
+ const parent = new Map();
623
+ function dfs(file, pathSoFar) {
624
+ if (cycles.length >= 50)
625
+ return; // cap
626
+ visited.add(file);
627
+ stack.add(file);
628
+ const deps = graph.forward.get(file) || [];
629
+ for (const dep of deps) {
630
+ if (stack.has(dep)) {
631
+ // Found cycle — extract it
632
+ const cycleStart = pathSoFar.indexOf(dep);
633
+ if (cycleStart >= 0) {
634
+ const cycle = pathSoFar.slice(cycleStart).map(toRel);
635
+ cycle.push(toRel(dep)); // close the loop
636
+ cycles.push(cycle);
637
+ }
638
+ }
639
+ else if (!visited.has(dep)) {
640
+ dfs(dep, [...pathSoFar, dep]);
641
+ }
642
+ }
643
+ stack.delete(file);
644
+ }
645
+ for (const file of graph.files) {
646
+ if (!visited.has(file)) {
647
+ dfs(file, [file]);
648
+ }
649
+ }
650
+ res.json({ cycles, count: cycles.length });
651
+ });
652
+ // GET /api/shortest-path?from=X&to=Y — BFS shortest path (follows forward edges)
653
+ app.get("/api/shortest-path", (req, res) => {
654
+ const fromParam = req.query.from;
655
+ const toParam = req.query.to;
656
+ if (!fromParam || !toParam)
657
+ return res.status(400).json({ error: "from and to required" });
658
+ const graph = getGraphFn();
659
+ const toRel = (f) => path.relative(graph.sourceDir, f).replace(/\\/g, "/");
660
+ const fromAbs = resolveFilePath(fromParam, graph.projectRoot, graph.sourceDir);
661
+ const toAbs = resolveFilePath(toParam, graph.projectRoot, graph.sourceDir);
662
+ if (!graph.files.has(fromAbs) || !graph.files.has(toAbs)) {
663
+ return res.status(404).json({ error: "File not found in graph" });
664
+ }
665
+ // BFS on combined forward + reverse (undirected shortest path)
666
+ const prev = new Map();
667
+ const visited = new Set();
668
+ const queue = [fromAbs];
669
+ visited.add(fromAbs);
670
+ let found = false;
671
+ while (queue.length > 0 && !found) {
672
+ const cur = queue.shift();
673
+ const neighbors = new Set();
674
+ (graph.forward.get(cur) || []).forEach(n => neighbors.add(n));
675
+ (graph.reverse.get(cur) || []).forEach(n => neighbors.add(n));
676
+ for (const nb of neighbors) {
677
+ if (!visited.has(nb)) {
678
+ visited.add(nb);
679
+ prev.set(nb, cur);
680
+ if (nb === toAbs) {
681
+ found = true;
682
+ break;
683
+ }
684
+ queue.push(nb);
685
+ }
686
+ }
687
+ }
688
+ if (!found)
689
+ return res.json({ path: [], distance: -1 });
690
+ // Reconstruct path
691
+ const pathResult = [];
692
+ let cur = toAbs;
693
+ while (cur) {
694
+ pathResult.unshift(toRel(cur));
695
+ cur = prev.get(cur);
696
+ }
697
+ res.json({ path: pathResult, distance: pathResult.length - 1 });
698
+ });
699
+ // GET /api/simulate-delete/:file — Simulate file removal (Pro only)
700
+ app.get("/api/simulate-delete/*splat", (req, res) => {
701
+ if (!isProPlan()) {
702
+ return res.status(403).json(getProFeatureError("Delete simulation"));
703
+ }
704
+ const splat = req.params.splat;
705
+ const fileParam = Array.isArray(splat) ? splat.join("/") : splat;
706
+ if (!fileParam)
707
+ return res.status(400).json({ error: "File path required" });
708
+ const graph = getGraphFn();
709
+ const resolved = resolveFilePath(fileParam, graph.projectRoot, graph.sourceDir);
710
+ const toRel = (f) => path.relative(graph.sourceDir, f).replace(/\\/g, "/");
711
+ if (!graph.files.has(resolved)) {
712
+ return res.status(404).json({ error: `File not found: ${fileParam}` });
713
+ }
714
+ // Files that directly import the deleted file → will have broken imports
715
+ const brokenImports = (graph.reverse.get(resolved) || []).map(toRel);
716
+ // Full cascade: all transitively affected files
717
+ const cascadeSet = new Set();
718
+ const queue = [...(graph.reverse.get(resolved) || [])];
719
+ for (const q of queue)
720
+ cascadeSet.add(q);
721
+ while (queue.length > 0) {
722
+ const cur = queue.shift();
723
+ for (const dep of (graph.reverse.get(cur) || [])) {
724
+ if (!cascadeSet.has(dep) && dep !== resolved) {
725
+ cascadeSet.add(dep);
726
+ queue.push(dep);
727
+ }
728
+ }
729
+ }
730
+ // Orphaned files: files that only had forward deps to the deleted file
731
+ const orphaned = [];
732
+ for (const dep of (graph.forward.get(resolved) || [])) {
733
+ const revDeps = graph.reverse.get(dep) || [];
734
+ // If the deleted file is the only one importing this dep
735
+ if (revDeps.length === 1 && revDeps[0] === resolved) {
736
+ orphaned.push(toRel(dep));
737
+ }
738
+ }
739
+ res.json({
740
+ deletedFile: fileParam,
741
+ brokenImports,
742
+ brokenCount: brokenImports.length,
743
+ cascadeFiles: [...cascadeSet].map(toRel),
744
+ cascadeCount: cascadeSet.size,
745
+ orphanedFiles: orphaned,
746
+ orphanedCount: orphaned.length,
747
+ severity: cascadeSet.size >= 20 ? "CRITICAL" : cascadeSet.size >= 10 ? "HIGH" : cascadeSet.size >= 5 ? "MEDIUM" : "LOW",
748
+ });
749
+ });
750
+ // GET /api/warnings — List unresolved warnings (for MCP/dashboard)
751
+ app.get("/api/warnings", (_req, res) => {
752
+ const unacked = getUnacknowledgedWarnings();
753
+ const all = getAllWarnings();
754
+ res.json({
755
+ unresolved: unacked,
756
+ unresolvedCount: unacked.length,
757
+ totalCount: all.length,
758
+ });
759
+ });
760
+ // POST /api/warnings/acknowledge — Mark all warnings as acknowledged
761
+ app.post("/api/warnings/acknowledge", (_req, res) => {
762
+ const count = acknowledgeWarnings();
763
+ res.json({ acknowledged: count });
764
+ });
765
+ // GET /api/project-info — Current project metadata
766
+ app.get("/api/project-info", (_req, res) => {
767
+ const graph = getGraphFn();
768
+ let edgeCount = 0;
769
+ for (const deps of graph.forward.values())
770
+ edgeCount += deps.length;
771
+ const license = getLicenseStatus?.();
772
+ // Read SYKE version from package.json
773
+ let sykeVersion = "unknown";
774
+ try {
775
+ const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, "..", "package.json"), "utf-8"));
776
+ sykeVersion = pkg.version || "unknown";
777
+ }
778
+ catch { }
779
+ // Read current license key (masked for display)
780
+ const rawKey = (0, config_1.getConfig)("licenseKey", "SYKE_LICENSE_KEY") || "";
781
+ const maskedKey = rawKey.length > 10
782
+ ? rawKey.substring(0, 9) + "····" + rawKey.substring(rawKey.length - 4)
783
+ : "";
784
+ const aiInfo = getAIInfoFn ? getAIInfoFn() : { activeProvider: "disabled", configured: { gemini: false, openai: false, anthropic: false }, forced: null };
785
+ res.json({
786
+ projectRoot: getProjectRoot ? getProjectRoot() : graph.projectRoot,
787
+ packageName: getPackageName ? getPackageName() : "",
788
+ languages: graph.languages,
789
+ fileCount: graph.files.size,
790
+ edgeCount,
791
+ plan: license?.plan || "free",
792
+ planSource: license?.source || "default",
793
+ expiresAt: license?.expiresAt || null,
794
+ licenseKey: maskedKey,
795
+ freeFileLimit: 50,
796
+ sykeVersion,
797
+ aiProvider: aiInfo.activeProvider,
798
+ aiKeys: aiInfo.configured,
799
+ aiProviderForced: aiInfo.forced,
800
+ });
801
+ });
802
+ // POST /api/set-license-key — Set or remove license key via dashboard
803
+ app.post("/api/set-license-key", async (req, res) => {
804
+ if (!setLicenseKeyFn) {
805
+ res.status(501).json({ success: false, error: "Not supported" });
806
+ return;
807
+ }
808
+ const { key } = req.body;
809
+ try {
810
+ const result = await setLicenseKeyFn(key || null);
811
+ res.json(result);
812
+ }
813
+ catch (err) {
814
+ res.status(500).json({ success: false, error: err.message || "Unknown error" });
815
+ }
816
+ });
817
+ // POST /api/set-ai-key — Set or remove an AI provider API key
818
+ app.post("/api/set-ai-key", (req, res) => {
819
+ if (!setAIKeyFn) {
820
+ res.status(501).json({ success: false, error: "Not supported" });
821
+ return;
822
+ }
823
+ const { provider, key } = req.body;
824
+ if (!provider || !["gemini", "openai", "anthropic"].includes(provider)) {
825
+ res.status(400).json({ success: false, error: "provider must be gemini, openai, or anthropic" });
826
+ return;
827
+ }
828
+ try {
829
+ const result = setAIKeyFn(provider, key || null);
830
+ res.json(result);
831
+ }
832
+ catch (err) {
833
+ res.status(500).json({ success: false, error: err.message || "Unknown error" });
834
+ }
835
+ });
836
+ // POST /api/set-ai-provider — Set or clear forced AI provider
837
+ app.post("/api/set-ai-provider", (req, res) => {
838
+ if (!setAIProviderFn) {
839
+ res.status(501).json({ success: false, error: "Not supported" });
840
+ return;
841
+ }
842
+ const { provider } = req.body;
843
+ if (!provider || !["gemini", "openai", "anthropic", "auto"].includes(provider)) {
844
+ res.status(400).json({ success: false, error: "provider must be gemini, openai, anthropic, or auto" });
845
+ return;
846
+ }
847
+ try {
848
+ const result = setAIProviderFn(provider);
849
+ res.json(result);
850
+ }
851
+ catch (err) {
852
+ res.status(500).json({ success: false, error: err.message || "Unknown error" });
853
+ }
854
+ });
855
+ // GET /api/browse-dirs — List subdirectories for folder browser
856
+ app.get("/api/browse-dirs", (req, res) => {
857
+ const dirPath = req.query.path || (process.platform === "win32" ? "C:\\" : "/");
858
+ const normalized = path.normalize(dirPath);
859
+ if (!fs.existsSync(normalized) || !fs.statSync(normalized).isDirectory()) {
860
+ return res.status(400).json({ error: `Not a directory: ${normalized}` });
861
+ }
862
+ try {
863
+ const entries = fs.readdirSync(normalized, { withFileTypes: true });
864
+ const dirs = entries
865
+ .filter(e => {
866
+ if (!e.isDirectory())
867
+ return false;
868
+ const name = e.name;
869
+ // Hide system/hidden dirs
870
+ if (name.startsWith(".") || name === "node_modules" || name === "$RECYCLE.BIN" || name === "System Volume Information")
871
+ return false;
872
+ return true;
873
+ })
874
+ .map(e => e.name)
875
+ .sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase()));
876
+ // Check if this looks like a project root (has package.json, pubspec.yaml, etc.)
877
+ const markers = ["package.json", "pubspec.yaml", "Cargo.toml", "go.mod", "pom.xml", "build.gradle", "CMakeLists.txt", "Makefile", "pyproject.toml", "setup.py"];
878
+ const isProject = markers.some(m => fs.existsSync(path.join(normalized, m)));
879
+ const detectedMarker = markers.find(m => fs.existsSync(path.join(normalized, m))) || null;
880
+ res.json({
881
+ current: normalized,
882
+ parent: path.dirname(normalized) !== normalized ? path.dirname(normalized) : null,
883
+ dirs,
884
+ isProject,
885
+ detectedMarker,
886
+ });
887
+ }
888
+ catch (err) {
889
+ res.status(500).json({ error: err.message });
890
+ }
891
+ });
892
+ // POST /api/switch-project — Switch to a different project folder (Pro only)
893
+ app.post("/api/switch-project", (req, res) => {
894
+ const { projectRoot } = req.body;
895
+ if (!projectRoot || typeof projectRoot !== "string") {
896
+ return res.status(400).json({ error: "projectRoot is required" });
897
+ }
898
+ const normalized = path.normalize(projectRoot);
899
+ // Free tier: only 1 project allowed — block switch to a different project
900
+ if (!isProPlan()) {
901
+ const currentRoot = getProjectRoot ? path.normalize(getProjectRoot()) : null;
902
+ if (currentRoot && normalized !== currentRoot) {
903
+ return res.status(403).json({
904
+ error: "Multiple projects require SYKE Pro. Free tier supports 1 project.",
905
+ upgrade: "https://syke.cloud/dashboard/",
906
+ });
907
+ }
908
+ }
909
+ if (!fs.existsSync(normalized) || !fs.statSync(normalized).isDirectory()) {
910
+ return res.status(400).json({ error: `Directory not found: ${normalized}` });
911
+ }
912
+ if (!switchProjectFn) {
913
+ return res.status(500).json({ error: "Switch project not supported" });
914
+ }
915
+ try {
916
+ const result = switchProjectFn(normalized);
917
+ broadcastSSE("project-switched", result);
918
+ res.json(result);
919
+ }
920
+ catch (err) {
921
+ res.status(500).json({ error: err.message || "Failed to switch project" });
922
+ }
923
+ });
924
+ return { app, setFileCache };
925
+ }