trimprompt 1.0.27 → 1.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-proxy.js +1 -1
- package/cache.js +1 -1
- package/ccr.js +1 -1
- package/cli.js +1 -1
- package/dashboard.js +1 -1
- package/executor.js +1 -1
- package/filters/devops.js +1 -1
- package/filters/generic.js +1 -1
- package/filters/git.js +1 -1
- package/filters/go.js +1 -1
- package/filters/index.js +1 -1
- package/filters/js.js +1 -1
- package/filters/python.js +1 -1
- package/filters/rust.js +1 -1
- package/filters/shell.js +1 -1
- package/index.html +7 -12
- package/mcp.js +1 -1
- package/package.json +1 -1
- package/proxy-conv.js +1 -1
- package/proxy-daemon.js +1 -1
- package/proxy-resp.js +1 -1
- package/redactor.js +1 -1
- package/seed.js +1 -1
- package/shims.js +1 -1
- package/simulate.js +1 -1
- package/sync.js +1 -1
- package/tracker.js +1 -1
- package/traffic-interceptor.js +1 -0
package/api-proxy.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x1af568=a0_0x49c2;(function(_0x5ce77e,_0x6778fb){const _0x1cdc9b=a0_0x49c2,_0xd28d88=_0x5ce77e();while(!![]){try{const _0x105f28=parseInt(_0x1cdc9b(0xa0))/0x1*(-parseInt(_0x1cdc9b(0x7e))/0x2)+-parseInt(_0x1cdc9b(0xdc))/0x3*(parseInt(_0x1cdc9b(0x9f))/0x4)+parseInt(_0x1cdc9b(0x7f))/0x5+-parseInt(_0x1cdc9b(0xe6))/0x6*(parseInt(_0x1cdc9b(0xd4))/0x7)+parseInt(_0x1cdc9b(0xa4))/0x8+-parseInt(_0x1cdc9b(0x7c))/0x9*(parseInt(_0x1cdc9b(0xe2))/0xa)+-parseInt(_0x1cdc9b(0xd1))/0xb*(-parseInt(_0x1cdc9b(0xe5))/0xc);if(_0x105f28===_0x6778fb)break;else _0xd28d88['push'](_0xd28d88['shift']());}catch(_0x22ab05){_0xd28d88['push'](_0xd28d88['shift']());}}}(a0_0x5c50,0xbede7));var __createBinding=this&&this[a0_0x1af568(0x91)]||(Object[a0_0x1af568(0xad)]?function(_0x2bcb9c,_0x346e95,_0x1ecafd,_0x3c6540){const _0x5a0c43=a0_0x1af568;if(_0x3c6540===undefined)_0x3c6540=_0x1ecafd;var _0x25a319=Object['getOwnPropertyDescriptor'](_0x346e95,_0x1ecafd);(!_0x25a319||(_0x5a0c43(0x99)in _0x25a319?!_0x346e95['__esModule']:_0x25a319[_0x5a0c43(0xa5)]||_0x25a319[_0x5a0c43(0x92)]))&&(_0x25a319={'enumerable':!![],'get':function(){return _0x346e95[_0x1ecafd];}}),Object['defineProperty'](_0x2bcb9c,_0x3c6540,_0x25a319);}:function(_0xff6285,_0xa19158,_0x41d785,_0x2a272f){if(_0x2a272f===undefined)_0x2a272f=_0x41d785;_0xff6285[_0x2a272f]=_0xa19158[_0x41d785];}),__setModuleDefault=this&&this[a0_0x1af568(0xd8)]||(Object['create']?function(_0x483848,_0x1c2372){const _0x12da64=a0_0x1af568;Object['defineProperty'](_0x483848,_0x12da64(0x8d),{'enumerable':!![],'value':_0x1c2372});}:function(_0x2951ff,_0x16a55d){const _0x369805=a0_0x1af568;_0x2951ff[_0x369805(0x8d)]=_0x16a55d;}),__importStar=this&&this[a0_0x1af568(0xc5)]||(function(){var _0x7cb1a2=function(_0x347321){const _0x42fb7f=a0_0x49c2;return _0x7cb1a2=Object[_0x42fb7f(0xa7)]||function(_0x252344){const _0x3f5c3c=_0x42fb7f;var _0x50b5c3=[];for(var _0x39187a in _0x252344)if(Object[_0x3f5c3c(0x84)][_0x3f5c3c(0xeb)][_0x3f5c3c(0x95)](_0x252344,_0x39187a))_0x50b5c3[_0x50b5c3[_0x3f5c3c(0xb3)]]=_0x39187a;return _0x50b5c3;},_0x7cb1a2(_0x347321);};return function(_0x503435){const _0x4293dc=a0_0x49c2;if(_0x503435&&_0x503435[_0x4293dc(0xca)])return _0x503435;var _0x5536ff={};if(_0x503435!=null){for(var _0x3ea6bb=_0x7cb1a2(_0x503435),_0x292329=0x0;_0x292329<_0x3ea6bb[_0x4293dc(0xb3)];_0x292329++)if(_0x3ea6bb[_0x292329]!=='default')__createBinding(_0x5536ff,_0x503435,_0x3ea6bb[_0x292329]);}return __setModuleDefault(_0x5536ff,_0x503435),_0x5536ff;};}());Object[a0_0x1af568(0xe8)](exports,a0_0x1af568(0xca),{'value':!![]}),exports[a0_0x1af568(0xc0)]=startApiProxy;const http=__importStar(require('http')),https=__importStar(require('https')),url_1=require(a0_0x1af568(0x9c)),proxy_conv_1=require(a0_0x1af568(0xc8)),proxy_resp_1=require(a0_0x1af568(0x9b)),tracker_1=require('./tracker'),ANTHROPIC_API=a0_0x1af568(0xc9),OPENAI_API=a0_0x1af568(0x9d),COMPRESS_MAX_BYTES=0x4*0x400*0x400,MAX_PORT_RETRIES=0x5;function detectProvider(_0x14ed36,_0x28a6ee){const _0x363f22=a0_0x1af568,_0x326970=_0x14ed36||'';if(_0x326970[_0x363f22(0xcd)](_0x363f22(0xe7)))return _0x363f22(0xec);if(_0x326970[_0x363f22(0xcd)](_0x363f22(0xe3))||_0x326970[_0x363f22(0xcd)](_0x363f22(0xdd))||_0x326970[_0x363f22(0xcd)](_0x363f22(0xac)))return _0x363f22(0x8b);if(_0x28a6ee[_0x363f22(0x80)]||_0x28a6ee['anthropic-version'])return _0x363f22(0xec);if(_0x28a6ee[_0x363f22(0xb1)])return _0x363f22(0x8b);return'anthropic';}function a0_0x5c50(){const _0x1ac0a7=['headers','base','message','__setModuleDefault','entries','role','api.anthropic.com','779658WNNEli','/responses','tracker','content-length','listening','optimizeMaxTokens','20tchPji','/chat/completions','log','436356OvQArV','582PihpeG','/messages','defineProperty','pathname','POST','hasOwnProperty','anthropic','content','5904405mIrNvj','block','2167622cqgnMK','2563290ikdqPc','x-api-key','toLowerCase','stringify','createServer','prototype','statusCode','\x0aPress\x20Ctrl+C\x20to\x20stop.\x0a','\x20\x20-\x20Response\x20optimization:\x20\x20\x20\x20','data','request_error','headersSent','openai','OFF','default','savedTokens','code','\x20\x20-\x20Conversation\x20compression:\x20','__createBinding','configurable','map','unset','call','conv_compress','string','Upstream\x20timeout','get','max_tokens','./proxy-resp','url','https://api.openai.com','EADDRINUSE','12iBPPjD','1Vvmjnh','writeHead','api.openai.com','startsWith','11385304qGihmC','writable','utf8','getOwnPropertyNames','listen','127.0.0.1','type','host','/completions','create','method','push','features_enabled','authorization','[TrimPrompt]\x20Features:','length','timeout','\x0a[TrimPrompt]\x20API\x20proxy\x20running\x20on\x20http://127.0.0.1:','application/json','[TrimPrompt]\x20Proxy\x20failed\x20to\x20start:\x20','toUpperCase','error','compressConversation','max_completion_tokens','end','[TrimPrompt]\x20Set\x20in\x20your\x20environment:\x0a','port','resp_optimize','startApiProxy','text','write','isArray','destroy','__importStar','hostname','GET','./proxy-conv','https://api.anthropic.com','__esModule','logExecution','messages','includes','proxy_error','join','concat','748AdUbdl','/v1\x0a','\x20(Anthropic\x20+\x20OpenAI)','32557GoJMkx'];a0_0x5c50=function(){return _0x1ac0a7;};return a0_0x5c50();}function upstreamFor(_0xd1ec30){const _0x398439=a0_0x1af568;return _0xd1ec30===_0x398439(0x8b)?{'base':OPENAI_API,'host':_0x398439(0xa2)}:{'base':ANTHROPIC_API,'host':_0x398439(0xdb)};}function isChatEndpoint(_0x22b1b4,_0x3d26f4){const _0x28cef9=a0_0x1af568;if(_0x22b1b4!==_0x28cef9(0xea)||!_0x3d26f4)return![];return _0x3d26f4[_0x28cef9(0xa3)]('/v1/messages')||_0x3d26f4[_0x28cef9(0xa3)]('/v1/chat/completions')||_0x3d26f4[_0x28cef9(0xa3)]('/v1/responses');}function serializeMessages(_0x18212b){const _0x181e94=a0_0x1af568;try{return _0x18212b[_0x181e94(0x93)](_0x185d8c=>{const _0x1a871f=_0x181e94,_0x8a364b=typeof _0x185d8c[_0x1a871f(0x7b)]==='string'?_0x185d8c[_0x1a871f(0x7b)]:Array[_0x1a871f(0xc3)](_0x185d8c['content'])?_0x185d8c[_0x1a871f(0x7b)][_0x1a871f(0x93)](_0x3b7a2e=>_0x3b7a2e&&_0x3b7a2e['type']==='text'?_0x3b7a2e[_0x1a871f(0xc1)]||'':'['+(_0x3b7a2e&&_0x3b7a2e[_0x1a871f(0xaa)]?_0x3b7a2e[_0x1a871f(0xaa)]:_0x1a871f(0x7d))+']')[_0x1a871f(0xcf)]('\x0a'):'';return String(_0x185d8c[_0x1a871f(0xda)]||'unknown')[_0x1a871f(0xb8)]()+':\x20'+_0x8a364b;})[_0x181e94(0xcf)]('\x0a\x0a');}catch{return'';}}function isFeatureEnabled(_0x5d4ea8){const _0x3b0db4=a0_0x1af568;try{const _0xd616ca=tracker_1[_0x3b0db4(0xde)]['getConfig'](),_0x33c8a0=_0xd616ca[_0x3b0db4(0xb0)];if(!_0x33c8a0||_0x33c8a0[_0x5d4ea8]===undefined)return!![];return _0x33c8a0[_0x5d4ea8]!==![];}catch{return!![];}}function streamForward(_0x588839,_0x1b366e,_0x269ab5,_0x5d91c5){const _0x1f98f2=a0_0x1af568;let _0x1bbe4e;try{_0x1bbe4e=new url_1['URL'](_0x1b366e);}catch{return!_0x5d91c5[_0x1f98f2(0x8a)]&&(_0x5d91c5[_0x1f98f2(0xa1)](0x190,{'Content-Type':_0x1f98f2(0xb6)}),_0x5d91c5[_0x1f98f2(0xbc)](JSON[_0x1f98f2(0x82)]({'error':{'type':'invalid_url','message':'Bad\x20target\x20URL'}}))),null;}const _0x85450f={'hostname':_0x1bbe4e[_0x1f98f2(0xc6)],'port':_0x1bbe4e[_0x1f98f2(0xbe)]||0x1bb,'path':_0x1bbe4e[_0x1f98f2(0xe9)]+_0x1bbe4e['search'],'method':_0x588839,'headers':_0x269ab5,'timeout':0x1d4c0},_0x176b7b=https['request'](_0x85450f,_0x16cdb6=>{const _0x555d28=_0x1f98f2;try{_0x5d91c5[_0x555d28(0xa1)](_0x16cdb6[_0x555d28(0x85)]||0x1f6,_0x16cdb6[_0x555d28(0xd5)]),_0x16cdb6['pipe'](_0x5d91c5);}catch{try{_0x5d91c5[_0x555d28(0xbc)]();}catch{}}});return _0x176b7b['on'](_0x1f98f2(0xb9),_0x46844c=>{const _0x507fc5=_0x1f98f2;if(!_0x5d91c5[_0x507fc5(0x8a)])_0x5d91c5[_0x507fc5(0xa1)](0x1f6,{'Content-Type':'application/json'}),_0x5d91c5[_0x507fc5(0xbc)](JSON[_0x507fc5(0x82)]({'error':{'type':_0x507fc5(0xce),'message':_0x46844c['message']}}));else try{_0x5d91c5[_0x507fc5(0xbc)]();}catch{}}),_0x176b7b['on'](_0x1f98f2(0xb4),()=>{const _0x57ae18=_0x1f98f2;_0x176b7b[_0x57ae18(0xc4)](),!_0x5d91c5[_0x57ae18(0x8a)]&&(_0x5d91c5[_0x57ae18(0xa1)](0x1f8,{'Content-Type':_0x57ae18(0xb6)}),_0x5d91c5[_0x57ae18(0xbc)](JSON[_0x57ae18(0x82)]({'error':{'type':_0x57ae18(0xb4),'message':_0x57ae18(0x98)}})));}),_0x176b7b;}function a0_0x49c2(_0x2c2d76,_0x64dfc8){_0x2c2d76=_0x2c2d76-0x7b;const _0x5c5059=a0_0x5c50();let _0x49c28d=_0x5c5059[_0x2c2d76];return _0x49c28d;}function forwardRequest(_0x5e4469,_0x242376,_0x321575,_0x4efa42,_0x34fc5e){const _0x24a196=a0_0x1af568,_0x20b9a8=streamForward(_0x5e4469,_0x242376,_0x321575,_0x34fc5e);if(!_0x20b9a8)return;_0x20b9a8[_0x24a196(0xc2)](_0x4efa42),_0x20b9a8[_0x24a196(0xbc)]();}function processChatRequest(_0x36e5c1,_0x450ef7,_0x3ffd16,_0x3e63c1,_0x51f846,_0x1c31cb){const _0x48a54f=a0_0x1af568,_0x5b9eaf=_0x51f846;try{const _0x4defc9=JSON['parse'](_0x51f846['toString'](_0x48a54f(0xa6)));if(Array['isArray'](_0x4defc9[_0x48a54f(0xcc)])&&_0x4defc9[_0x48a54f(0xcc)][_0x48a54f(0xb3)]>0x0){if(isFeatureEnabled(_0x48a54f(0x96)))try{const _0xd1aecc=serializeMessages(_0x4defc9['messages']),_0x1fa3cf=(0x0,proxy_conv_1[_0x48a54f(0xba)])(_0x4defc9['messages']);if(_0x1fa3cf[_0x48a54f(0x8e)]>0x0){const _0x567002=serializeMessages(_0x1fa3cf[_0x48a54f(0xcc)]);_0x4defc9['messages']=_0x1fa3cf[_0x48a54f(0xcc)];try{tracker_1[_0x48a54f(0xde)][_0x48a54f(0xcb)]('proxy:conv-compress',_0xd1aecc,_0x567002,0x0,undefined,[_0x48a54f(0x96),_0x36e5c1]);}catch{}}}catch{}if(isFeatureEnabled(_0x48a54f(0xbf)))try{const _0x1ce817=_0x4defc9[_0x48a54f(0xbb)]!==undefined?_0x48a54f(0xbb):'max_tokens',_0x502dab=(0x0,proxy_resp_1[_0x48a54f(0xe1)])(_0x4defc9[_0x48a54f(0xcc)],_0x4defc9[_0x1ce817]);if(_0x502dab){const _0x2a81e9=_0x4defc9[_0x1ce817];_0x4defc9[_0x1ce817]=_0x502dab[_0x48a54f(0x9a)];try{tracker_1[_0x48a54f(0xde)][_0x48a54f(0xcb)]('proxy:resp-optimize',_0x1ce817+':'+(_0x2a81e9||_0x48a54f(0x94)),_0x1ce817+':'+_0x502dab[_0x48a54f(0x9a)],0x0,undefined,[_0x48a54f(0xbf),_0x36e5c1]);}catch{}}}catch{}try{const _0x2f8ae3=Buffer['from'](JSON['stringify'](_0x4defc9),_0x48a54f(0xa6));_0x3e63c1[_0x48a54f(0xdf)]=String(_0x2f8ae3[_0x48a54f(0xb3)]),forwardRequest(_0x450ef7,_0x3ffd16,_0x3e63c1,_0x2f8ae3,_0x1c31cb);return;}catch{}}}catch{}forwardRequest(_0x450ef7,_0x3ffd16,_0x3e63c1,_0x5b9eaf,_0x1c31cb);}function startApiProxy(_0x3b3fee=0x1f90){let _0xc0f592=0x0;function _0x37d562(_0x206fad){const _0x1c4325=a0_0x49c2,_0x3e59e7=http[_0x1c4325(0x83)]((_0x4c3017,_0x56c805)=>{const _0x3f9803=_0x1c4325,_0x2c52cb=detectProvider(_0x4c3017[_0x3f9803(0x9c)]||'',_0x4c3017[_0x3f9803(0xd5)]),_0x5842a4=upstreamFor(_0x2c52cb),_0x41f33c=''+_0x5842a4[_0x3f9803(0xd6)]+_0x4c3017['url'],_0x1c64b1=()=>{const _0x530399=_0x3f9803,_0x434181={};for(const [_0x314935,_0x11f10c]of Object[_0x530399(0xd9)](_0x4c3017[_0x530399(0xd5)])){if(_0x314935[_0x530399(0x81)]()===_0x530399(0xab))_0x434181[_0x314935]=_0x5842a4[_0x530399(0xab)];else{if(typeof _0x11f10c===_0x530399(0x97))_0x434181[_0x314935]=_0x11f10c;}}return _0x434181;};let _0x523c45=0x0;const _0x26b100=[];let _0x5aeb2e=![],_0x440d64=null;_0x4c3017['on'](_0x3f9803(0x88),_0x51031d=>{const _0xa155ac=_0x3f9803;if(_0x5aeb2e){if(_0x440d64)try{_0x440d64[_0xa155ac(0xc2)](_0x51031d);}catch{}return;}_0x523c45+=_0x51031d[_0xa155ac(0xb3)],_0x26b100[_0xa155ac(0xaf)](_0x51031d);if(_0x523c45>COMPRESS_MAX_BYTES){_0x5aeb2e=!![],_0x440d64=streamForward(_0x4c3017['method']||_0xa155ac(0xea),_0x41f33c,_0x1c64b1(),_0x56c805);if(_0x440d64)for(const _0x110542 of _0x26b100){try{_0x440d64[_0xa155ac(0xc2)](_0x110542);}catch{}}_0x26b100[_0xa155ac(0xb3)]=0x0;}}),_0x4c3017['on'](_0x3f9803(0xbc),()=>{const _0x233c32=_0x3f9803;if(_0x5aeb2e){if(_0x440d64)try{_0x440d64[_0x233c32(0xbc)]();}catch{}return;}if(_0x56c805['writableEnded'])return;const _0x2f0a07=Buffer[_0x233c32(0xd0)](_0x26b100),_0x365aab=_0x1c64b1();isChatEndpoint(_0x4c3017[_0x233c32(0xae)],_0x4c3017[_0x233c32(0x9c)])?processChatRequest(_0x2c52cb,_0x4c3017[_0x233c32(0xae)],_0x41f33c,_0x365aab,_0x2f0a07,_0x56c805):forwardRequest(_0x4c3017['method']||_0x233c32(0xc7),_0x41f33c,_0x365aab,_0x2f0a07,_0x56c805);}),_0x4c3017['on']('error',()=>{const _0x40594a=_0x3f9803;!_0x56c805[_0x40594a(0x8a)]&&(_0x56c805[_0x40594a(0xa1)](0x190,{'Content-Type':_0x40594a(0xb6)}),_0x56c805[_0x40594a(0xbc)](JSON[_0x40594a(0x82)]({'error':{'type':_0x40594a(0x89),'message':'Bad\x20request'}})));});});_0x3e59e7['on'](_0x1c4325(0xe0),()=>{const _0x1a5d6a=_0x1c4325;console[_0x1a5d6a(0xe4)](_0x1a5d6a(0xb5)+_0x206fad+_0x1a5d6a(0xd3)),console[_0x1a5d6a(0xe4)](_0x1a5d6a(0xbd)),console[_0x1a5d6a(0xe4)]('\x20\x20ANTHROPIC_BASE_URL=http://127.0.0.1:'+_0x206fad),console['log']('\x20\x20OPENAI_BASE_URL=http://127.0.0.1:'+_0x206fad+_0x1a5d6a(0xd2)),console['log'](_0x1a5d6a(0xb2)),console[_0x1a5d6a(0xe4)](_0x1a5d6a(0x90)+(isFeatureEnabled('conv_compress')?'ON':_0x1a5d6a(0x8c))),console[_0x1a5d6a(0xe4)](_0x1a5d6a(0x87)+(isFeatureEnabled(_0x1a5d6a(0xbf))?'ON':'OFF')),console[_0x1a5d6a(0xe4)](_0x1a5d6a(0x86));}),_0x3e59e7['on'](_0x1c4325(0xb9),_0x2ee9c9=>{const _0x5dfb50=_0x1c4325;_0x2ee9c9[_0x5dfb50(0x8f)]===_0x5dfb50(0x9e)&&_0xc0f592<MAX_PORT_RETRIES?(_0xc0f592++,_0x37d562(_0x206fad+0x1)):(console[_0x5dfb50(0xb9)](_0x5dfb50(0xb7)+_0x2ee9c9[_0x5dfb50(0xd7)]),process['exit'](0x1));}),_0x3e59e7[_0x1c4325(0xa8)](_0x206fad,_0x1c4325(0xa9));}_0x37d562(_0x3b3fee);}
|
|
1
|
+
'use strict';const a0_0x316650=a0_0x2637;(function(_0x20ed10,_0x1908f2){const _0x2905b2=a0_0x2637,_0x2511b7=_0x20ed10();while(!![]){try{const _0x5ca594=-parseInt(_0x2905b2(0x1eb))/0x1*(parseInt(_0x2905b2(0x20f))/0x2)+-parseInt(_0x2905b2(0x1f4))/0x3+-parseInt(_0x2905b2(0x209))/0x4*(-parseInt(_0x2905b2(0x206))/0x5)+parseInt(_0x2905b2(0x245))/0x6+parseInt(_0x2905b2(0x216))/0x7*(-parseInt(_0x2905b2(0x1e0))/0x8)+parseInt(_0x2905b2(0x223))/0x9*(parseInt(_0x2905b2(0x1ec))/0xa)+parseInt(_0x2905b2(0x205))/0xb;if(_0x5ca594===_0x1908f2)break;else _0x2511b7['push'](_0x2511b7['shift']());}catch(_0x2f811d){_0x2511b7['push'](_0x2511b7['shift']());}}}(a0_0x32b4,0x7eaa0));function a0_0x32b4(){const _0xf01a1d=['312790wqCvDE','end','/v1/messages','from','data','map','headers','features_enabled','2512683bHaOrQ','text','[TrimPrompt]\x20Features:','host','savedTokens','utf8','tracker','toLowerCase','resp_optimize','configurable','proxy:resp-optimize','timeout','[TrimPrompt]\x20Set\x20in\x20your\x20environment:\x0a','method','url','conv_compress','invalid_url','9396211AdcZeB','221500BGNgNj','optimizeMaxTokens','exit','80MjbqQK','isArray','POST','/v1/responses','anthropic-version','api.anthropic.com','302uMfAIy','request_error','message','max_tokens','unknown','concat','http','7sPBZwf','Bad\x20request','content','port','\x20\x20ANTHROPIC_BASE_URL=http://127.0.0.1:','GET','/completions','OFF','/messages','listening','defineProperty','messages','pathname','81vkNzac','startsWith','getOwnPropertyDescriptor','x-api-key','/v1\x0a','destroy','error','./tracker','/responses','./proxy-resp','__esModule','join','\x20\x20OPENAI_BASE_URL=http://127.0.0.1:','get','string','block','writable','application/json','https://api.openai.com','includes','createServer','api.openai.com','__createBinding','\x20\x20-\x20Conversation\x20compression:\x20','stringify','startApiProxy','create','anthropic','type','/chat/completions','authorization','compressConversation','__setModuleDefault','default','5541762sYsDYb','\x20\x20-\x20Response\x20optimization:\x20\x20\x20\x20','writableEnded','__importStar','search','length','writeHead','EADDRINUSE','./proxy-conv','\x0aPress\x20Ctrl+C\x20to\x20stop.\x0a','4527496kKhGTt','/v1/chat/completions','parse','logExecution','headersSent','openai','prototype','Bad\x20target\x20URL','max_completion_tokens','log','listen','6775rDaBXR'];a0_0x32b4=function(){return _0xf01a1d;};return a0_0x32b4();}var __createBinding=this&&this[a0_0x316650(0x239)]||(Object[a0_0x316650(0x23d)]?function(_0x10f023,_0x8cd96e,_0xcc129f,_0x424e9c){const _0xf450a=a0_0x316650;if(_0x424e9c===undefined)_0x424e9c=_0xcc129f;var _0x1cffd2=Object[_0xf450a(0x225)](_0x8cd96e,_0xcc129f);(!_0x1cffd2||(_0xf450a(0x230)in _0x1cffd2?!_0x8cd96e['__esModule']:_0x1cffd2[_0xf450a(0x233)]||_0x1cffd2[_0xf450a(0x1fd)]))&&(_0x1cffd2={'enumerable':!![],'get':function(){return _0x8cd96e[_0xcc129f];}}),Object[_0xf450a(0x220)](_0x10f023,_0x424e9c,_0x1cffd2);}:function(_0x2d4ea8,_0x257a0f,_0x58c8a5,_0x270552){if(_0x270552===undefined)_0x270552=_0x58c8a5;_0x2d4ea8[_0x270552]=_0x257a0f[_0x58c8a5];}),__setModuleDefault=this&&this[a0_0x316650(0x243)]||(Object['create']?function(_0x483112,_0x3bba39){const _0x44d1b3=a0_0x316650;Object[_0x44d1b3(0x220)](_0x483112,'default',{'enumerable':!![],'value':_0x3bba39});}:function(_0x53a225,_0x4db693){const _0x25b979=a0_0x316650;_0x53a225[_0x25b979(0x244)]=_0x4db693;}),__importStar=this&&this[a0_0x316650(0x1d9)]||(function(){var _0x3bd5f1=function(_0xb02609){return _0x3bd5f1=Object['getOwnPropertyNames']||function(_0x35f2c0){const _0x3d43e4=a0_0x2637;var _0x2cb3c8=[];for(var _0x51604f in _0x35f2c0)if(Object[_0x3d43e4(0x1e6)]['hasOwnProperty']['call'](_0x35f2c0,_0x51604f))_0x2cb3c8[_0x2cb3c8[_0x3d43e4(0x1db)]]=_0x51604f;return _0x2cb3c8;},_0x3bd5f1(_0xb02609);};return function(_0x39e432){const _0x450f5c=a0_0x2637;if(_0x39e432&&_0x39e432[_0x450f5c(0x22d)])return _0x39e432;var _0x4bb1cf={};if(_0x39e432!=null){for(var _0x3901d3=_0x3bd5f1(_0x39e432),_0x3de228=0x0;_0x3de228<_0x3901d3['length'];_0x3de228++)if(_0x3901d3[_0x3de228]!==_0x450f5c(0x244))__createBinding(_0x4bb1cf,_0x39e432,_0x3901d3[_0x3de228]);}return __setModuleDefault(_0x4bb1cf,_0x39e432),_0x4bb1cf;};}());Object[a0_0x316650(0x220)](exports,a0_0x316650(0x22d),{'value':!![]}),exports[a0_0x316650(0x23c)]=startApiProxy;const http=__importStar(require(a0_0x316650(0x215))),https=__importStar(require('https')),url_1=require('url'),proxy_conv_1=require(a0_0x316650(0x1de)),proxy_resp_1=require(a0_0x316650(0x22c)),tracker_1=require(a0_0x316650(0x22a)),ANTHROPIC_API='https://api.anthropic.com',OPENAI_API=a0_0x316650(0x235),COMPRESS_MAX_BYTES=0x4*0x400*0x400,MAX_PORT_RETRIES=0x5;function detectProvider(_0x2f646b,_0x2144fb){const _0x4363db=a0_0x316650,_0x500ea7=_0x2f646b||'';if(_0x500ea7[_0x4363db(0x236)](_0x4363db(0x21e)))return _0x4363db(0x23e);if(_0x500ea7[_0x4363db(0x236)](_0x4363db(0x240))||_0x500ea7[_0x4363db(0x236)](_0x4363db(0x22b))||_0x500ea7[_0x4363db(0x236)](_0x4363db(0x21c)))return _0x4363db(0x1e5);if(_0x2144fb[_0x4363db(0x226)]||_0x2144fb[_0x4363db(0x20d)])return _0x4363db(0x23e);if(_0x2144fb[_0x4363db(0x241)])return _0x4363db(0x1e5);return _0x4363db(0x23e);}function upstreamFor(_0x2f6c91){const _0x386d47=a0_0x316650;return _0x2f6c91===_0x386d47(0x1e5)?{'base':OPENAI_API,'host':_0x386d47(0x238)}:{'base':ANTHROPIC_API,'host':_0x386d47(0x20e)};}function isChatEndpoint(_0x376f0f,_0x294bf2){const _0x18377c=a0_0x316650;if(_0x376f0f!==_0x18377c(0x20b)||!_0x294bf2)return![];return _0x294bf2['startsWith'](_0x18377c(0x1ee))||_0x294bf2[_0x18377c(0x224)](_0x18377c(0x1e1))||_0x294bf2[_0x18377c(0x224)](_0x18377c(0x20c));}function serializeMessages(_0x1042d1){const _0x261712=a0_0x316650;try{return _0x1042d1[_0x261712(0x1f1)](_0x4e945d=>{const _0x1aa13e=_0x261712,_0x2983ea=typeof _0x4e945d[_0x1aa13e(0x218)]==='string'?_0x4e945d[_0x1aa13e(0x218)]:Array[_0x1aa13e(0x20a)](_0x4e945d[_0x1aa13e(0x218)])?_0x4e945d[_0x1aa13e(0x218)][_0x1aa13e(0x1f1)](_0x5f4e47=>_0x5f4e47&&_0x5f4e47['type']===_0x1aa13e(0x1f5)?_0x5f4e47[_0x1aa13e(0x1f5)]||'':'['+(_0x5f4e47&&_0x5f4e47['type']?_0x5f4e47[_0x1aa13e(0x23f)]:_0x1aa13e(0x232))+']')['join']('\x0a'):'';return String(_0x4e945d['role']||_0x1aa13e(0x213))['toUpperCase']()+':\x20'+_0x2983ea;})[_0x261712(0x22e)]('\x0a\x0a');}catch{return'';}}function isFeatureEnabled(_0x242953){const _0x5edbe8=a0_0x316650;try{const _0x333a23=tracker_1[_0x5edbe8(0x1fa)]['getConfig'](),_0x586bb9=_0x333a23[_0x5edbe8(0x1f3)];if(!_0x586bb9||_0x586bb9[_0x242953]===undefined)return!![];return _0x586bb9[_0x242953]!==![];}catch{return!![];}}function streamForward(_0x5aef01,_0x413e8f,_0x5632f7,_0x3554c7){const _0x37c64e=a0_0x316650;let _0x27585d;try{_0x27585d=new url_1['URL'](_0x413e8f);}catch{return!_0x3554c7[_0x37c64e(0x1e4)]&&(_0x3554c7['writeHead'](0x190,{'Content-Type':_0x37c64e(0x234)}),_0x3554c7['end'](JSON['stringify']({'error':{'type':_0x37c64e(0x204),'message':_0x37c64e(0x1e7)}}))),null;}const _0x549e57={'hostname':_0x27585d['hostname'],'port':_0x27585d[_0x37c64e(0x219)]||0x1bb,'path':_0x27585d[_0x37c64e(0x222)]+_0x27585d[_0x37c64e(0x1da)],'method':_0x5aef01,'headers':_0x5632f7,'timeout':0x1d4c0},_0x5cb88f=https['request'](_0x549e57,_0x292ced=>{const _0x36ce3d=_0x37c64e;try{_0x3554c7[_0x36ce3d(0x1dc)](_0x292ced['statusCode']||0x1f6,_0x292ced[_0x36ce3d(0x1f2)]),_0x292ced['pipe'](_0x3554c7);}catch{try{_0x3554c7['end']();}catch{}}});return _0x5cb88f['on']('error',_0x22d270=>{const _0x2f804e=_0x37c64e;if(!_0x3554c7[_0x2f804e(0x1e4)])_0x3554c7[_0x2f804e(0x1dc)](0x1f6,{'Content-Type':_0x2f804e(0x234)}),_0x3554c7[_0x2f804e(0x1ed)](JSON[_0x2f804e(0x23b)]({'error':{'type':'proxy_error','message':_0x22d270[_0x2f804e(0x211)]}}));else try{_0x3554c7[_0x2f804e(0x1ed)]();}catch{}}),_0x5cb88f['on'](_0x37c64e(0x1ff),()=>{const _0x2db8c3=_0x37c64e;_0x5cb88f[_0x2db8c3(0x228)](),!_0x3554c7[_0x2db8c3(0x1e4)]&&(_0x3554c7[_0x2db8c3(0x1dc)](0x1f8,{'Content-Type':_0x2db8c3(0x234)}),_0x3554c7[_0x2db8c3(0x1ed)](JSON['stringify']({'error':{'type':_0x2db8c3(0x1ff),'message':'Upstream\x20timeout'}})));}),_0x5cb88f;}function forwardRequest(_0x2a22a0,_0x269ea2,_0x387c8f,_0x18ce28,_0x172c6a){const _0x40fdfd=a0_0x316650,_0x935f18=streamForward(_0x2a22a0,_0x269ea2,_0x387c8f,_0x172c6a);if(!_0x935f18)return;_0x935f18['write'](_0x18ce28),_0x935f18[_0x40fdfd(0x1ed)]();}function processChatRequest(_0x4444e4,_0x148358,_0x2f430d,_0x1955f7,_0x4d842c,_0x561d38){const _0x36ce50=a0_0x316650,_0x361c57=_0x4d842c;try{const _0x4fa3fd=JSON[_0x36ce50(0x1e2)](_0x4d842c['toString'](_0x36ce50(0x1f9)));if(Array[_0x36ce50(0x20a)](_0x4fa3fd[_0x36ce50(0x221)])&&_0x4fa3fd[_0x36ce50(0x221)][_0x36ce50(0x1db)]>0x0){if(isFeatureEnabled(_0x36ce50(0x203)))try{const _0x4a4573=serializeMessages(_0x4fa3fd[_0x36ce50(0x221)]),_0x458005=(0x0,proxy_conv_1[_0x36ce50(0x242)])(_0x4fa3fd[_0x36ce50(0x221)]);if(_0x458005[_0x36ce50(0x1f8)]>0x0){const _0x1c093f=serializeMessages(_0x458005[_0x36ce50(0x221)]);_0x4fa3fd[_0x36ce50(0x221)]=_0x458005[_0x36ce50(0x221)];try{tracker_1[_0x36ce50(0x1fa)]['logExecution']('proxy:conv-compress',_0x4a4573,_0x1c093f,0x0,undefined,['conv_compress',_0x4444e4]);}catch{}}}catch{}if(isFeatureEnabled(_0x36ce50(0x1fc)))try{const _0x1322bb=_0x4fa3fd[_0x36ce50(0x1e8)]!==undefined?_0x36ce50(0x1e8):_0x36ce50(0x212),_0x306e06=(0x0,proxy_resp_1[_0x36ce50(0x207)])(_0x4fa3fd[_0x36ce50(0x221)],_0x4fa3fd[_0x1322bb]);if(_0x306e06){const _0x40ae45=_0x4fa3fd[_0x1322bb];_0x4fa3fd[_0x1322bb]=_0x306e06[_0x36ce50(0x212)];try{tracker_1[_0x36ce50(0x1fa)][_0x36ce50(0x1e3)](_0x36ce50(0x1fe),_0x1322bb+':'+(_0x40ae45||'unset'),_0x1322bb+':'+_0x306e06['max_tokens'],0x0,undefined,[_0x36ce50(0x1fc),_0x4444e4]);}catch{}}}catch{}try{const _0x18630c=Buffer[_0x36ce50(0x1ef)](JSON['stringify'](_0x4fa3fd),_0x36ce50(0x1f9));_0x1955f7['content-length']=String(_0x18630c['length']),forwardRequest(_0x148358,_0x2f430d,_0x1955f7,_0x18630c,_0x561d38);return;}catch{}}}catch{}forwardRequest(_0x148358,_0x2f430d,_0x1955f7,_0x361c57,_0x561d38);}function a0_0x2637(_0x4039b3,_0x53af40){_0x4039b3=_0x4039b3-0x1d8;const _0x32b4d8=a0_0x32b4();let _0x2637a1=_0x32b4d8[_0x4039b3];return _0x2637a1;}function startApiProxy(_0x56e783=0x1f90){let _0x557c94=0x0;function _0x28c500(_0x97797a){const _0x363d55=a0_0x2637,_0xd9a4db=http[_0x363d55(0x237)]((_0x1b9971,_0xdce487)=>{const _0x5cc366=_0x363d55,_0x34a1ba=detectProvider(_0x1b9971['url']||'',_0x1b9971['headers']),_0x28c762=upstreamFor(_0x34a1ba),_0x3f1134=''+_0x28c762['base']+_0x1b9971[_0x5cc366(0x202)],_0xc14f15=()=>{const _0x2d30a5=_0x5cc366,_0x2a7723={};for(const [_0x325c48,_0x1704a2]of Object['entries'](_0x1b9971['headers'])){if(_0x325c48[_0x2d30a5(0x1fb)]()===_0x2d30a5(0x1f7))_0x2a7723[_0x325c48]=_0x28c762['host'];else{if(typeof _0x1704a2===_0x2d30a5(0x231))_0x2a7723[_0x325c48]=_0x1704a2;}}return _0x2a7723;};let _0x42098d=0x0;const _0x400ace=[];let _0x3aeded=![],_0x4b0715=null;_0x1b9971['on'](_0x5cc366(0x1f0),_0x246adb=>{const _0x44f34b=_0x5cc366;if(_0x3aeded){if(_0x4b0715)try{_0x4b0715['write'](_0x246adb);}catch{}return;}_0x42098d+=_0x246adb[_0x44f34b(0x1db)],_0x400ace['push'](_0x246adb);if(_0x42098d>COMPRESS_MAX_BYTES){_0x3aeded=!![],_0x4b0715=streamForward(_0x1b9971[_0x44f34b(0x201)]||_0x44f34b(0x20b),_0x3f1134,_0xc14f15(),_0xdce487);if(_0x4b0715)for(const _0x52e23c of _0x400ace){try{_0x4b0715['write'](_0x52e23c);}catch{}}_0x400ace[_0x44f34b(0x1db)]=0x0;}}),_0x1b9971['on'](_0x5cc366(0x1ed),()=>{const _0x301672=_0x5cc366;if(_0x3aeded){if(_0x4b0715)try{_0x4b0715['end']();}catch{}return;}if(_0xdce487[_0x301672(0x1d8)])return;const _0x362005=Buffer[_0x301672(0x214)](_0x400ace),_0x2a7d8a=_0xc14f15();isChatEndpoint(_0x1b9971[_0x301672(0x201)],_0x1b9971['url'])?processChatRequest(_0x34a1ba,_0x1b9971['method'],_0x3f1134,_0x2a7d8a,_0x362005,_0xdce487):forwardRequest(_0x1b9971[_0x301672(0x201)]||_0x301672(0x21b),_0x3f1134,_0x2a7d8a,_0x362005,_0xdce487);}),_0x1b9971['on'](_0x5cc366(0x229),()=>{const _0x5dcc3e=_0x5cc366;!_0xdce487['headersSent']&&(_0xdce487[_0x5dcc3e(0x1dc)](0x190,{'Content-Type':_0x5dcc3e(0x234)}),_0xdce487[_0x5dcc3e(0x1ed)](JSON[_0x5dcc3e(0x23b)]({'error':{'type':_0x5dcc3e(0x210),'message':_0x5dcc3e(0x217)}})));});});_0xd9a4db['on'](_0x363d55(0x21f),()=>{const _0x27952f=_0x363d55;console[_0x27952f(0x1e9)]('\x0a[TrimPrompt]\x20API\x20proxy\x20running\x20on\x20http://127.0.0.1:'+_0x97797a+'\x20(Anthropic\x20+\x20OpenAI)'),console[_0x27952f(0x1e9)](_0x27952f(0x200)),console[_0x27952f(0x1e9)](_0x27952f(0x21a)+_0x97797a),console['log'](_0x27952f(0x22f)+_0x97797a+_0x27952f(0x227)),console['log'](_0x27952f(0x1f6)),console['log'](_0x27952f(0x23a)+(isFeatureEnabled(_0x27952f(0x203))?'ON':_0x27952f(0x21d))),console['log'](_0x27952f(0x246)+(isFeatureEnabled('resp_optimize')?'ON':_0x27952f(0x21d))),console[_0x27952f(0x1e9)](_0x27952f(0x1df));}),_0xd9a4db['on'](_0x363d55(0x229),_0x1d3764=>{const _0x537648=_0x363d55;_0x1d3764['code']===_0x537648(0x1dd)&&_0x557c94<MAX_PORT_RETRIES?(_0x557c94++,_0x28c500(_0x97797a+0x1)):(console[_0x537648(0x229)]('[TrimPrompt]\x20Proxy\x20failed\x20to\x20start:\x20'+_0x1d3764['message']),process[_0x537648(0x208)](0x1));}),_0xd9a4db[_0x363d55(0x1ea)](_0x97797a,'127.0.0.1');}_0x28c500(_0x56e783);}
|
package/cache.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';function a0_0x47fa(_0x56584f,_0x45908a){_0x56584f=_0x56584f-0x1e4;const _0x1c5a49=a0_0x1c5a();let _0x47faa9=_0x1c5a49[_0x56584f];return _0x47faa9;}const a0_0x369946=a0_0x47fa;(function(_0x941376,_0x32bacf){const _0x28b5d4=a0_0x47fa,_0x695b27=_0x941376();while(!![]){try{const _0x27cc67=-parseInt(_0x28b5d4(0x220))/0x1+-parseInt(_0x28b5d4(0x226))/0x2+-parseInt(_0x28b5d4(0x1f8))/0x3+-parseInt(_0x28b5d4(0x21b))/0x4*(parseInt(_0x28b5d4(0x1ec))/0x5)+-parseInt(_0x28b5d4(0x22c))/0x6+-parseInt(_0x28b5d4(0x22f))/0x7+parseInt(_0x28b5d4(0x22a))/0x8*(parseInt(_0x28b5d4(0x208))/0x9);if(_0x27cc67===_0x32bacf)break;else _0x695b27['push'](_0x695b27['shift']());}catch(_0x167d6f){_0x695b27['push'](_0x695b27['shift']());}}}(a0_0x1c5a,0x92431));var __createBinding=this&&this['__createBinding']||(Object[a0_0x369946(0x228)]?function(_0x3cc345,_0x3ac7d4,_0x594f8b,_0x658f3e){const _0x3e11b0=a0_0x369946;if(_0x658f3e===undefined)_0x658f3e=_0x594f8b;var _0x48d5bd=Object[_0x3e11b0(0x21a)](_0x3ac7d4,_0x594f8b);(!_0x48d5bd||(_0x3e11b0(0x1ff)in _0x48d5bd?!_0x3ac7d4[_0x3e11b0(0x1f5)]:_0x48d5bd[_0x3e11b0(0x201)]||_0x48d5bd[_0x3e11b0(0x207)]))&&(_0x48d5bd={'enumerable':!![],'get':function(){return _0x3ac7d4[_0x594f8b];}}),Object['defineProperty'](_0x3cc345,_0x658f3e,_0x48d5bd);}:function(_0x2e428e,_0x5c0b48,_0x993e5f,_0x5602a7){if(_0x5602a7===undefined)_0x5602a7=_0x993e5f;_0x2e428e[_0x5602a7]=_0x5c0b48[_0x993e5f];}),__setModuleDefault=this&&this[a0_0x369946(0x20e)]||(Object[a0_0x369946(0x228)]?function(_0x580cd1,_0x7b4a8f){const _0x2ac66b=a0_0x369946;Object[_0x2ac66b(0x1f1)](_0x580cd1,_0x2ac66b(0x21d),{'enumerable':!![],'value':_0x7b4a8f});}:function(_0x5796fe,_0x2ac84b){_0x5796fe['default']=_0x2ac84b;}),__importStar=this&&this[a0_0x369946(0x1fb)]||(function(){var _0x2006d2=function(_0xb4d1f7){const _0x2e83d6=a0_0x47fa;return _0x2006d2=Object[_0x2e83d6(0x200)]||function(_0x184fcc){const _0x38eb6b=_0x2e83d6;var _0x1ea273=[];for(var _0x148524 in _0x184fcc)if(Object[_0x38eb6b(0x211)][_0x38eb6b(0x1fc)]['call'](_0x184fcc,_0x148524))_0x1ea273[_0x1ea273[_0x38eb6b(0x216)]]=_0x148524;return _0x1ea273;},_0x2006d2(_0xb4d1f7);};return function(_0x6cb178){const _0x6788bf=a0_0x47fa;if(_0x6cb178&&_0x6cb178[_0x6788bf(0x1f5)])return _0x6cb178;var _0x5d6289={};if(_0x6cb178!=null){for(var _0x4da519=_0x2006d2(_0x6cb178),_0x5648f4=0x0;_0x5648f4<_0x4da519[_0x6788bf(0x216)];_0x5648f4++)if(_0x4da519[_0x5648f4]!=='default')__createBinding(_0x5d6289,_0x6cb178,_0x4da519[_0x5648f4]);}return __setModuleDefault(_0x5d6289,_0x6cb178),_0x5d6289;};}());Object[a0_0x369946(0x1f1)](exports,a0_0x369946(0x1f5),{'value':!![]}),exports[a0_0x369946(0x1e9)]=dedup;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x369946(0x221))),os=__importStar(require('os')),crypto=__importStar(require(a0_0x369946(0x1e5))),CACHE_DIR=path[a0_0x369946(0x1ee)](os[a0_0x369946(0x22e)](),'.trimprompt'),CACHE_FILE=path[a0_0x369946(0x1ee)](CACHE_DIR,a0_0x369946(0x1e4)),MAX_ENTRIES=0x12c,TTL_SECONDS={'file':0x78,'git-status':0x1e,'git-log':0x3c,'git-show':0xe10,'ls':0x3c,'tree':0x3c,'docker-ps':0x1e,'docker-images':0x3c,'kubectl':0x1e,'ruff':0x3c,'go-vet':0x3c};function classifyCommand(_0x3d1588){const _0x3b5010=a0_0x369946,_0xd99bc8=_0x3d1588[_0x3b5010(0x20a)]()[_0x3b5010(0x1ea)]();if(_0xd99bc8[_0x3b5010(0x223)](/^(cat|head|tail|read|bat)\s/))return _0x3b5010(0x205);if(_0xd99bc8['includes'](_0x3b5010(0x224))||_0xd99bc8[_0x3b5010(0x218)](_0x3b5010(0x1fd)))return _0x3b5010(0x215);if(_0xd99bc8[_0x3b5010(0x218)](_0x3b5010(0x204))||_0xd99bc8[_0x3b5010(0x218)](_0x3b5010(0x1f3)))return _0x3b5010(0x219);if(_0xd99bc8[_0x3b5010(0x218)]('git\x20show')||_0xd99bc8[_0x3b5010(0x218)](_0x3b5010(0x225)))return'git-show';if(_0xd99bc8[_0x3b5010(0x223)](/^(ls|dir)(\s|$)/)||_0xd99bc8[_0x3b5010(0x218)](_0x3b5010(0x230))||_0xd99bc8[_0x3b5010(0x22b)](_0x3b5010(0x1f4)))return'ls';if(_0xd99bc8[_0x3b5010(0x223)](/^tree(\s|$)/)||_0xd99bc8[_0x3b5010(0x218)](_0x3b5010(0x20d))||_0xd99bc8[_0x3b5010(0x22b)]('\x20tree'))return'tree';if(_0xd99bc8[_0x3b5010(0x223)](/docker\s+ps/))return _0x3b5010(0x1fa);if(_0xd99bc8[_0x3b5010(0x223)](/docker\s+images/))return _0x3b5010(0x1fe);if(_0xd99bc8[_0x3b5010(0x218)](_0x3b5010(0x212))||_0xd99bc8['includes'](_0x3b5010(0x1f0)))return'kubectl';if(_0xd99bc8[_0x3b5010(0x218)](_0x3b5010(0x22d))||_0xd99bc8[_0x3b5010(0x218)](_0x3b5010(0x202)))return'ruff';if(_0xd99bc8['includes'](_0x3b5010(0x227)))return _0x3b5010(0x213);return'';}function md5(_0x17d7ba){const _0x59ec54=a0_0x369946;return crypto[_0x59ec54(0x1ed)](_0x59ec54(0x1f7))[_0x59ec54(0x214)](_0x17d7ba)[_0x59ec54(0x1f2)](_0x59ec54(0x203));}function loadStore(){const _0x191984=a0_0x369946;try{if(fs['existsSync'](CACHE_FILE))return JSON[_0x191984(0x1e7)](fs['readFileSync'](CACHE_FILE,_0x191984(0x229)));}catch{}return{};}function saveStore(_0x2def3d){const _0x440d48=a0_0x369946;try{if(!fs['existsSync'](CACHE_DIR))fs['mkdirSync'](CACHE_DIR,{'recursive':!![]});const _0x2b5e81=Object['keys'](_0x2def3d);if(_0x2b5e81['length']>MAX_ENTRIES){const _0x4e092a=_0x2b5e81[_0x440d48(0x217)]((_0x2bdb8c,_0x181336)=>_0x2def3d[_0x2bdb8c][_0x440d48(0x1f9)]-_0x2def3d[_0x181336][_0x440d48(0x1f9)]);for(const _0x1a69d5 of _0x4e092a[_0x440d48(0x1f6)](0x0,_0x2b5e81[_0x440d48(0x216)]-MAX_ENTRIES)){delete _0x2def3d[_0x1a69d5];}}fs[_0x440d48(0x21e)](CACHE_FILE,JSON[_0x440d48(0x20f)](_0x2def3d),_0x440d48(0x229));}catch{}}function a0_0x1c5a(){const _0x3c68fa=['\x20lines','1260QBaLTG','createHash','join','[cached\x20—\x20unchanged\x20since\x20','kubectl\x20describe','defineProperty','digest','yadm\x20log','\x20ls','__esModule','slice','md5','2274186uINOwe','timestamp','docker-ps','__importStar','hasOwnProperty','yadm\x20status','docker-images','get','getOwnPropertyNames','writable','ruff\x20','hex','git\x20log','file','hash','configurable','90BeUpif','startsWith','trim','s\x20ago,\x20','round','\x20tree\x20','__setModuleDefault','stringify','cwd','prototype','kubectl\x20get','go-vet','update','git-status','length','sort','includes','git-log','getOwnPropertyDescriptor','5812Byvdej','\x20lines,\x20','default','writeFileSync','split','106555WyUHMQ','path','docker','match','git\x20status','yadm\x20show','1430934UChKZv','go\x20vet','create','utf8','3651864owlPYI','endsWith','5292510xuBuOr','ruff\x20check','homedir','7961912RuVjys','\x20ls\x20','cache.json','crypto','summary','parse','\x20chars','dedup','toLowerCase'];a0_0x1c5a=function(){return _0x3c68fa;};return a0_0x1c5a();}function buildSummary(_0x59fb87,_0x42b36f){const _0x2a09e0=a0_0x369946,_0x5e5d46=_0x59fb87[_0x2a09e0(0x21f)]('\x0a')[_0x2a09e0(0x216)],_0x5f597a=_0x59fb87['length'];if(_0x42b36f===_0x2a09e0(0x205))return _0x5e5d46+_0x2a09e0(0x21c)+_0x5f597a+_0x2a09e0(0x1e8);if(_0x42b36f==='git-status')return _0x5e5d46+_0x2a09e0(0x1eb);if(_0x42b36f===_0x2a09e0(0x219))return _0x5e5d46+'\x20entries';if(_0x42b36f[_0x2a09e0(0x209)](_0x2a09e0(0x222)))return _0x5e5d46+_0x2a09e0(0x1eb);return _0x5e5d46+_0x2a09e0(0x21c)+_0x5f597a+_0x2a09e0(0x1e8);}function dedup(_0x28a973,_0x2e96e3){const _0x44944f=a0_0x369946;try{const _0x2af1c9=classifyCommand(_0x28a973);if(!_0x2af1c9)return null;const _0x190efe=TTL_SECONDS[_0x2af1c9];if(!_0x190efe)return null;const _0x2018d7=process[_0x44944f(0x210)](),_0x34242f=md5(_0x2018d7+'::'+_0x28a973[_0x44944f(0x20a)]()),_0x48b972=md5(_0x2e96e3),_0x35d657=Date['now'](),_0x54f48b=loadStore(),_0x1dae9b=_0x54f48b[_0x34242f];if(_0x1dae9b&&_0x1dae9b[_0x44944f(0x206)]===_0x48b972&&_0x35d657-_0x1dae9b[_0x44944f(0x1f9)]<_0x190efe*0x3e8){const _0x1084d9=Math[_0x44944f(0x20c)]((_0x35d657-_0x1dae9b['timestamp'])/0x3e8);return _0x44944f(0x1ef)+_0x1084d9+_0x44944f(0x20b)+_0x1dae9b[_0x44944f(0x1e6)]+']';}_0x54f48b[_0x34242f]={'hash':_0x48b972,'summary':buildSummary(_0x2e96e3,_0x2af1c9),'timestamp':_0x35d657,'chars':_0x2e96e3['length']},saveStore(_0x54f48b);}catch{}return null;}
|
package/ccr.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x144926=a0_0x32f4;(function(_0x130f7a,_0x59cc61){const _0x409833=a0_0x32f4,_0x1c001d=_0x130f7a();while(!![]){try{const _0x4acce5=parseInt(_0x409833(0xe6))/0x1+-parseInt(_0x409833(0xfc))/0x2*(-parseInt(_0x409833(0xbe))/0x3)+-parseInt(_0x409833(0xbd))/0x4+parseInt(_0x409833(0xf3))/0x5+-parseInt(_0x409833(0xb1))/0x6+-parseInt(_0x409833(0xbf))/0x7+parseInt(_0x409833(0xb9))/0x8*(parseInt(_0x409833(0xbc))/0x9);if(_0x4acce5===_0x59cc61)break;else _0x1c001d['push'](_0x1c001d['shift']());}catch(_0xeaf77a){_0x1c001d['push'](_0x1c001d['shift']());}}}(a0_0x14a2,0x1bdb3));function a0_0x32f4(_0x3661fa,_0x9e2713){_0x3661fa=_0x3661fa-0xb1;const _0x14a2dc=a0_0x14a2();let _0x32f4c7=_0x14a2dc[_0x3661fa];return _0x32f4c7;}function a0_0x14a2(){const _0x3007af=['substring','[TrimPrompt:\x20CCR\x20Active.\x20Body\x20of\x20functions\x20collapsed\x20to\x20save\x20tokens.\x20Hash:\x20','match','pub','trim','568952GDNHlu','class','hasOwnProperty','45QffmNO','718504fvZaFX','5907fPgEYQ','1201368EUYjUB','#\x20...\x20[collapsed]','//\x20...\x20[collapsed]','interface','includes','repeat','.cpp','defineProperty','__createBinding','get','.js','.trimprompt','skeletonize','\x20lines\x20collapsed\x20to\x20save\x20tokens]\x20...\x0a','.tsx','writeFileSync','replace','join','length','ccr','trimStart','call','.go','\x27\x27\x27','crypto','var','.ts','extname','update','writable','import\x20','startsWith','default','export','function','getOwnPropertyDescriptor','endsWith','createHash','from\x20','11063PfCALM','type','__importStar','.py','.java','__esModule','tp_','package','__setModuleDefault','md5','hex','utf8','push','179440RLmjDO','split','runCcr','getOwnPropertyNames','.jsx','pop','let','const','mkdirSync','178TiHrAG','homedir',']\x0a\x0a','existsSync','create','slice','674628ZMzeQG','.rs','\x22\x22\x22'];a0_0x14a2=function(){return _0x3007af;};return a0_0x14a2();}var __createBinding=this&&this[a0_0x144926(0xc7)]||(Object[a0_0x144926(0x100)]?function(_0x29a5c4,_0x2b0751,_0x91d446,_0x410065){const _0x17d821=a0_0x144926;if(_0x410065===undefined)_0x410065=_0x91d446;var _0x5b2676=Object[_0x17d821(0xe2)](_0x2b0751,_0x91d446);(!_0x5b2676||(_0x17d821(0xc8)in _0x5b2676?!_0x2b0751['__esModule']:_0x5b2676[_0x17d821(0xdc)]||_0x5b2676['configurable']))&&(_0x5b2676={'enumerable':!![],'get':function(){return _0x2b0751[_0x91d446];}}),Object[_0x17d821(0xc6)](_0x29a5c4,_0x410065,_0x5b2676);}:function(_0x22daf7,_0x2dcd3d,_0x4a320a,_0x8fd3c5){if(_0x8fd3c5===undefined)_0x8fd3c5=_0x4a320a;_0x22daf7[_0x8fd3c5]=_0x2dcd3d[_0x4a320a];}),__setModuleDefault=this&&this[a0_0x144926(0xee)]||(Object[a0_0x144926(0x100)]?function(_0x65a644,_0x4a3c93){Object['defineProperty'](_0x65a644,'default',{'enumerable':!![],'value':_0x4a3c93});}:function(_0x5e8fcf,_0x1781ce){const _0x1e838b=a0_0x144926;_0x5e8fcf[_0x1e838b(0xdf)]=_0x1781ce;}),__importStar=this&&this[a0_0x144926(0xe8)]||(function(){var _0x1da308=function(_0x2c2315){const _0x481410=a0_0x32f4;return _0x1da308=Object[_0x481410(0xf6)]||function(_0x2e01c2){const _0x466ae9=_0x481410;var _0x491443=[];for(var _0xbfbc99 in _0x2e01c2)if(Object['prototype'][_0x466ae9(0xbb)][_0x466ae9(0xd4)](_0x2e01c2,_0xbfbc99))_0x491443[_0x491443[_0x466ae9(0xd1)]]=_0xbfbc99;return _0x491443;},_0x1da308(_0x2c2315);};return function(_0x37a45f){const _0x5c8f7e=a0_0x32f4;if(_0x37a45f&&_0x37a45f[_0x5c8f7e(0xeb)])return _0x37a45f;var _0x2d30c5={};if(_0x37a45f!=null){for(var _0x37837f=_0x1da308(_0x37a45f),_0x1b5adc=0x0;_0x1b5adc<_0x37837f[_0x5c8f7e(0xd1)];_0x1b5adc++)if(_0x37837f[_0x1b5adc]!==_0x5c8f7e(0xdf))__createBinding(_0x2d30c5,_0x37a45f,_0x37837f[_0x1b5adc]);}return __setModuleDefault(_0x2d30c5,_0x37a45f),_0x2d30c5;};}());Object[a0_0x144926(0xc6)](exports,a0_0x144926(0xeb),{'value':!![]}),exports[a0_0x144926(0xcb)]=skeletonize,exports[a0_0x144926(0xf5)]=runCcr;const crypto=__importStar(require(a0_0x144926(0xd7))),fs=__importStar(require('fs')),path=__importStar(require('path')),os=__importStar(require('os'));function skeletonize(_0x239ba9,_0x113fb1){const _0x4634e1=a0_0x144926,_0x1a5df5=path[_0x4634e1(0xda)](_0x113fb1[_0x4634e1(0xf4)]('\x20')[_0x4634e1(0xf8)]()||'')['toLowerCase'](),_0x3f367b=_0x239ba9[_0x4634e1(0xf4)]('\x0a'),_0x1e9c43=[];if(_0x1a5df5===_0x4634e1(0xe9)){let _0x1095d8=![],_0x3e6ae2='';for(let _0x322a7c=0x0;_0x322a7c<_0x3f367b[_0x4634e1(0xd1)];_0x322a7c++){const _0x16336e=_0x3f367b[_0x322a7c],_0x1b2f94=_0x16336e[_0x4634e1(0xb8)](),_0x27522a=_0x16336e[_0x4634e1(0xd1)]-_0x16336e[_0x4634e1(0xd3)]()[_0x4634e1(0xd1)];if(!_0x1095d8&&(_0x1b2f94['startsWith'](_0x4634e1(0xb3))||_0x1b2f94[_0x4634e1(0xde)](_0x4634e1(0xd6)))){_0x1095d8=!![],_0x3e6ae2=_0x1b2f94[_0x4634e1(0xb4)](0x0,0x3),_0x1e9c43[_0x4634e1(0xf2)](_0x16336e);_0x1b2f94[_0x4634e1(0xe3)](_0x3e6ae2)&&_0x1b2f94['length']>0x3&&(_0x1095d8=![]);continue;}if(_0x1095d8){_0x1e9c43[_0x4634e1(0xf2)](_0x16336e);_0x1b2f94[_0x4634e1(0xe3)](_0x3e6ae2)&&(_0x1095d8=![]);continue;}if(_0x1b2f94[_0x4634e1(0xde)](_0x4634e1(0xdd))||_0x1b2f94[_0x4634e1(0xde)](_0x4634e1(0xe5))||_0x1b2f94[_0x4634e1(0xde)]('class\x20')||_0x1b2f94[_0x4634e1(0xde)]('def\x20')||_0x1b2f94[_0x4634e1(0xde)]('@')||_0x1b2f94[_0x4634e1(0xde)]('#')||_0x1b2f94[_0x4634e1(0xd1)]===0x0)_0x1e9c43[_0x4634e1(0xf2)](_0x16336e);else{const _0x475492=_0x1e9c43[_0x1e9c43[_0x4634e1(0xd1)]-0x1]||'';if(!_0x475492[_0x4634e1(0xb8)]()[_0x4634e1(0xe3)]('#\x20...\x20[collapsed]')){const _0x5dee7a='\x20'[_0x4634e1(0xc4)](_0x27522a);_0x1e9c43['push'](_0x5dee7a+_0x4634e1(0xc0));}}}return _0x1e9c43[_0x4634e1(0xd0)]('\x0a');}if([_0x4634e1(0xc9),_0x4634e1(0xd9),_0x4634e1(0xf7),_0x4634e1(0xcd),_0x4634e1(0xd5),_0x4634e1(0xb2),_0x4634e1(0xea),'.c',_0x4634e1(0xc5),'.h'][_0x4634e1(0xc3)](_0x1a5df5)){let _0x20fe1f=0x0;for(let _0xf3987f=0x0;_0xf3987f<_0x3f367b[_0x4634e1(0xd1)];_0xf3987f++){const _0x5b3192=_0x3f367b[_0xf3987f],_0x1e08d4=_0x5b3192['trim'](),_0x2ace1b=(_0x1e08d4[_0x4634e1(0xb6)](/\{/g)||[])[_0x4634e1(0xd1)],_0x18ea8d=(_0x1e08d4['match'](/\}/g)||[])['length'];if(_0x20fe1f===0x0)(_0x1e08d4[_0x4634e1(0xde)]('import')||_0x1e08d4[_0x4634e1(0xde)](_0x4634e1(0xe0))||_0x1e08d4[_0x4634e1(0xde)](_0x4634e1(0xfa))||_0x1e08d4[_0x4634e1(0xde)](_0x4634e1(0xf9))||_0x1e08d4['startsWith'](_0x4634e1(0xd8))||_0x1e08d4['startsWith'](_0x4634e1(0xba))||_0x1e08d4['startsWith'](_0x4634e1(0xe1))||_0x1e08d4[_0x4634e1(0xde)](_0x4634e1(0xc2))||_0x1e08d4[_0x4634e1(0xde)](_0x4634e1(0xe7))||_0x1e08d4[_0x4634e1(0xde)](_0x4634e1(0xed))||_0x1e08d4['startsWith']('fn')||_0x1e08d4[_0x4634e1(0xde)](_0x4634e1(0xb7))||_0x1e08d4[_0x4634e1(0xd1)]===0x0||_0x1e08d4[_0x4634e1(0xde)]('//')||_0x1e08d4[_0x4634e1(0xde)]('/*')||_0x1e08d4['startsWith']('*'))&&_0x1e9c43[_0x4634e1(0xf2)](_0x5b3192),_0x2ace1b>_0x18ea8d&&(_0x20fe1f+=_0x2ace1b-_0x18ea8d);else{const _0x4f20e9=_0x20fe1f+_0x2ace1b-_0x18ea8d;if(_0x4f20e9<=0x0){const _0x3c40eb=_0x5b3192[_0x4634e1(0xb6)](/^\s*/)?.[0x0]||'';_0x1e9c43['push'](_0x3c40eb+_0x4634e1(0xc1)),_0x1e9c43[_0x4634e1(0xf2)](_0x5b3192),_0x20fe1f=0x0;}else _0x20fe1f=_0x4f20e9;}}return _0x1e9c43[_0x4634e1(0xd0)]('\x0a');}if(_0x3f367b[_0x4634e1(0xd1)]<=0x64)return _0x239ba9;return[..._0x3f367b[_0x4634e1(0x101)](0x0,0x1e),'\x0a...\x20['+(_0x3f367b[_0x4634e1(0xd1)]-0x32)+_0x4634e1(0xcc),..._0x3f367b[_0x4634e1(0x101)](-0x14)]['join']('\x0a');}function runCcr(_0x50ea71,_0x28fe6d){const _0x5b9ca7=a0_0x144926,_0x147728=_0x28fe6d[_0x5b9ca7(0xcf)](/\\/g,'/'),_0x1a6454=_0x5b9ca7(0xec)+crypto[_0x5b9ca7(0xe4)](_0x5b9ca7(0xef))[_0x5b9ca7(0xdb)](_0x50ea71)['digest'](_0x5b9ca7(0xf0))[_0x5b9ca7(0xb4)](0x0,0xa),_0x13d8c6=path[_0x5b9ca7(0xd0)](os[_0x5b9ca7(0xfd)](),_0x5b9ca7(0xca)),_0x426db6=path['join'](_0x13d8c6,_0x5b9ca7(0xd2));!fs[_0x5b9ca7(0xff)](_0x426db6)&&fs[_0x5b9ca7(0xfb)](_0x426db6,{'recursive':!![]});fs[_0x5b9ca7(0xce)](path[_0x5b9ca7(0xd0)](_0x426db6,_0x1a6454+'.txt'),_0x50ea71,_0x5b9ca7(0xf1));const _0x303111=skeletonize(_0x50ea71,_0x147728);return _0x5b9ca7(0xb5)+_0x1a6454+'.\x20To\x20read\x20the\x20full\x20raw\x20content,\x20run\x20the\x20shell\x20command:\x20trim\x20retrieve\x20'+_0x1a6454+_0x5b9ca7(0xfe)+_0x303111;}
|
package/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
'use strict';const a0_0x5af593=a0_0x1ef4;(function(_0x521a35,_0x2e4298){const _0x36621d=a0_0x1ef4,_0x1fc4e4=_0x521a35();while(!![]){try{const _0x567922=parseInt(_0x36621d(0x247))/0x1*(parseInt(_0x36621d(0x21c))/0x2)+-parseInt(_0x36621d(0x267))/0x3+-parseInt(_0x36621d(0x1d1))/0x4+parseInt(_0x36621d(0x1e2))/0x5+parseInt(_0x36621d(0x1e8))/0x6*(parseInt(_0x36621d(0x1e9))/0x7)+-parseInt(_0x36621d(0x1e6))/0x8+-parseInt(_0x36621d(0x262))/0x9;if(_0x567922===_0x2e4298)break;else _0x1fc4e4['push'](_0x1fc4e4['shift']());}catch(_0xeaf9d6){_0x1fc4e4['push'](_0x1fc4e4['shift']());}}}(a0_0x1cb5,0xea066));var __createBinding=this&&this[a0_0x5af593(0x1ec)]||(Object[a0_0x5af593(0x24f)]?function(_0x2cd219,_0x5bd436,_0xb3373a,_0x7ca53c){const _0x45c3c1=a0_0x5af593;if(_0x7ca53c===undefined)_0x7ca53c=_0xb3373a;var _0x317d98=Object[_0x45c3c1(0x26b)](_0x5bd436,_0xb3373a);(!_0x317d98||(_0x45c3c1(0x221)in _0x317d98?!_0x5bd436[_0x45c3c1(0x258)]:_0x317d98[_0x45c3c1(0x1f1)]||_0x317d98[_0x45c3c1(0x240)]))&&(_0x317d98={'enumerable':!![],'get':function(){return _0x5bd436[_0xb3373a];}}),Object[_0x45c3c1(0x25c)](_0x2cd219,_0x7ca53c,_0x317d98);}:function(_0x31485d,_0x3827e4,_0x44931f,_0x5c5b6e){if(_0x5c5b6e===undefined)_0x5c5b6e=_0x44931f;_0x31485d[_0x5c5b6e]=_0x3827e4[_0x44931f];}),__setModuleDefault=this&&this[a0_0x5af593(0x210)]||(Object[a0_0x5af593(0x24f)]?function(_0x128d58,_0x331a08){const _0x7f57ef=a0_0x5af593;Object['defineProperty'](_0x128d58,_0x7f57ef(0x1f9),{'enumerable':!![],'value':_0x331a08});}:function(_0x3f9587,_0x53c460){const _0x1fca66=a0_0x5af593;_0x3f9587[_0x1fca66(0x1f9)]=_0x53c460;}),__importStar=this&&this[a0_0x5af593(0x249)]||(function(){var _0x55c802=function(_0x5653f4){return _0x55c802=Object['getOwnPropertyNames']||function(_0x207bee){const _0x55c28a=a0_0x1ef4;var _0x57d62f=[];for(var _0x5cf55f in _0x207bee)if(Object['prototype'][_0x55c28a(0x24c)]['call'](_0x207bee,_0x5cf55f))_0x57d62f[_0x57d62f['length']]=_0x5cf55f;return _0x57d62f;},_0x55c802(_0x5653f4);};return function(_0x2183cb){const _0x5cabac=a0_0x1ef4;if(_0x2183cb&&_0x2183cb[_0x5cabac(0x258)])return _0x2183cb;var _0x3eb795={};if(_0x2183cb!=null){for(var _0x55afe8=_0x55c802(_0x2183cb),_0x4fc98d=0x0;_0x4fc98d<_0x55afe8[_0x5cabac(0x1e7)];_0x4fc98d++)if(_0x55afe8[_0x4fc98d]!==_0x5cabac(0x1f9))__createBinding(_0x3eb795,_0x2183cb,_0x55afe8[_0x4fc98d]);}return __setModuleDefault(_0x3eb795,_0x2183cb),_0x3eb795;};}());Object['defineProperty'](exports,'__esModule',{'value':!![]});const commander_1=require(a0_0x5af593(0x22c)),executor_1=require('./executor'),filters_1=require(a0_0x5af593(0x273)),tracker_1=require(a0_0x5af593(0x21d)),cache_1=require(a0_0x5af593(0x275)),shims_1=require(a0_0x5af593(0x237)),dashboard_1=require('./dashboard'),program=new commander_1[(a0_0x5af593(0x1d9))]();function isDisabled(){return process.env.TRIMPROMPT_DISABLED==='1';}function adjustCommandArgs(_0x2b811e,_0x544520){const _0x2ea944=a0_0x5af593,_0x3e8a72=_0x2b811e[_0x2ea944(0x232)]();if(_0x3e8a72===_0x2ea944(0x208)||_0x3e8a72===_0x2ea944(0x254)){const _0x8a4c76=_0x544520[0x0];if(_0x8a4c76===_0x2ea944(0x21b)){const _0x40ff09=_0x544520[_0x2ea944(0x20b)](0x1),_0x51a46e=_0x40ff09['length']===0x0||_0x40ff09[_0x2ea944(0x27c)](_0x1d842e=>{const _0x7438e2=_0x2ea944;return _0x1d842e==='-b'||_0x1d842e===_0x7438e2(0x20a)||_0x1d842e===_0x7438e2(0x24b)||_0x1d842e===_0x7438e2(0x20e)||_0x1d842e==='-s'||_0x1d842e===_0x7438e2(0x25e);});if(_0x51a46e)return{'cmd':_0x2b811e,'args':[_0x2ea944(0x21b),_0x2ea944(0x216),'-b']};}else{if(_0x8a4c76==='log'){const _0x271989=_0x544520[_0x2ea944(0x20b)](0x1),_0x29cd96=_0x271989['some'](_0x44883a=>_0x44883a[_0x2ea944(0x1f5)](_0x2ea944(0x1d8))||_0x44883a[_0x2ea944(0x1f5)](_0x2ea944(0x1da))||_0x44883a[_0x2ea944(0x1f5)](_0x2ea944(0x233))),_0x33a7b9=_0x271989['some'](_0xf72bc1=>_0xf72bc1[_0x2ea944(0x1f5)]('-')&&/^\d+$/[_0x2ea944(0x214)](_0xf72bc1[_0x2ea944(0x20b)](0x1))||_0xf72bc1==='-n'||_0xf72bc1[_0x2ea944(0x1f5)](_0x2ea944(0x209))),_0x483c93=[..._0x544520];if(!_0x29cd96){const _0x3a992b=_0x2ea944(0x227);_0x483c93['push'](process[_0x2ea944(0x25f)]==='win32'?'\x22'+_0x3a992b+'\x22':_0x3a992b);}!_0x33a7b9&&(_0x29cd96?_0x483c93['push'](_0x2ea944(0x1d5)):_0x483c93[_0x2ea944(0x26e)](_0x2ea944(0x20c)));const _0x2a0884=_0x271989['some'](_0x3eeff4=>_0x3eeff4===_0x2ea944(0x229)||_0x3eeff4===_0x2ea944(0x266)||_0x3eeff4[_0x2ea944(0x1f5)](_0x2ea944(0x1ef)));return!_0x2a0884&&!_0x33a7b9&&_0x483c93['push']('--no-merges'),{'cmd':_0x2b811e,'args':_0x483c93};}}}return{'cmd':_0x2b811e,'args':_0x544520};}function a0_0x1ef4(_0x385df8,_0x38ac56){_0x385df8=_0x385df8-0x1d1;const _0x1cb517=a0_0x1cb5();let _0x1ef40d=_0x1cb517[_0x385df8];return _0x1ef40d;}function isMcpServerExecution(_0xda7414,_0x270cb5){const _0xf5f011=a0_0x5af593,_0x15d8f2=_0xda7414[_0xf5f011(0x232)](),_0x9a6ebc=_0x270cb5[_0xf5f011(0x202)]('\x20')['toLowerCase']();if(_0x15d8f2[_0xf5f011(0x268)](_0xf5f011(0x257))&&(_0x15d8f2[_0xf5f011(0x268)](_0xf5f011(0x265))||_0x15d8f2['includes'](_0xf5f011(0x1eb))))return!![];if(_0x15d8f2===_0xf5f011(0x25d)||_0x15d8f2===_0xf5f011(0x256)||_0x15d8f2===_0xf5f011(0x215)||_0x15d8f2===_0xf5f011(0x1e3)||_0x15d8f2===_0xf5f011(0x23b)||_0x15d8f2===_0xf5f011(0x1d6)){if(_0x9a6ebc['includes'](_0xf5f011(0x1d7))||_0x9a6ebc['includes'](_0xf5f011(0x280))||_0x9a6ebc['includes'](_0xf5f011(0x207))||_0x9a6ebc['includes']('server-mcp'))return!![];}if(_0x270cb5['some'](_0x5d520b=>{const _0x1ddd7e=_0xf5f011,_0x3219fd=_0x5d520b[_0x1ddd7e(0x232)]();return _0x3219fd[_0x1ddd7e(0x268)](_0x1ddd7e(0x207))||_0x3219fd['includes'](_0x1ddd7e(0x205))||_0x3219fd[_0x1ddd7e(0x268)](_0x1ddd7e(0x1d7))||_0x3219fd===_0x1ddd7e(0x22b)||_0x3219fd===_0x1ddd7e(0x257);}))return!![];return![];}async function runProxy(_0x5d79a1){const _0x2d4447=a0_0x5af593;if(_0x5d79a1[_0x2d4447(0x1e7)]===0x0){program[_0x2d4447(0x251)]();return;}const _0xdce289=_0x5d79a1[0x0],_0x3bf3fe=_0x5d79a1['slice'](0x1),_0x580baf=_0x5d79a1[_0x2d4447(0x202)]('\x20');if(isDisabled()){const _0x1b22fa=await(0x0,executor_1['executeCommand'])(_0xdce289,_0x3bf3fe);process[_0x2d4447(0x21e)][_0x2d4447(0x225)](_0x1b22fa['stdout']),process[_0x2d4447(0x252)][_0x2d4447(0x225)](_0x1b22fa['stderr']),process[_0x2d4447(0x203)](_0x1b22fa[_0x2d4447(0x22f)]);}if(isMcpServerExecution(_0xdce289,_0x3bf3fe)){console['error'](_0x2d4447(0x224));const {runMcpProxy:_0x1268bf}=await Promise['resolve']()[_0x2d4447(0x1fa)](()=>__importStar(require(_0x2d4447(0x277))));_0x1268bf(_0xdce289,_0x3bf3fe);return;}const _0x28bbdb=adjustCommandArgs(_0xdce289,_0x3bf3fe),_0x2b08a8=await(0x0,executor_1[_0x2d4447(0x200)])(_0x28bbdb[_0x2d4447(0x234)],_0x28bbdb['args']),_0x184653=(0x0,filters_1[_0x2d4447(0x1dc)])(_0x580baf,_0x2b08a8[_0x2d4447(0x21e)],_0x2b08a8[_0x2d4447(0x252)],tracker_1[_0x2d4447(0x228)][_0x2d4447(0x253)]()[_0x2d4447(0x1fb)]),_0x232f1d={...filters_1[_0x2d4447(0x23a)]},_0x4747c8=_0x2b08a8['stdout']+(_0x2b08a8[_0x2d4447(0x252)][_0x2d4447(0x279)]()[_0x2d4447(0x1e7)]>0x0?'\x0a'+_0x2b08a8['stderr']:''),_0x220da2=_0x184653[_0x2d4447(0x1e7)]<_0x4747c8['length']?_0x184653:_0x4747c8,_0x200a76=_0x2b08a8[_0x2d4447(0x22f)]===0x0?(0x0,cache_1['dedup'])(_0x580baf,_0x220da2):null;tracker_1[_0x2d4447(0x228)][_0x2d4447(0x22d)](_0x580baf,_0x4747c8,_0x200a76||_0x220da2,_0x2b08a8[_0x2d4447(0x22f)],_0x232f1d,[...filters_1['lastFeatures']]),_0x2b08a8['exitCode']===0x0?process[_0x2d4447(0x21e)][_0x2d4447(0x225)](_0x220da2+'\x0a'):(process[_0x2d4447(0x21e)]['write'](_0x184653+'\x0a'),_0x2b08a8[_0x2d4447(0x252)][_0x2d4447(0x279)]()[_0x2d4447(0x1e7)]>0x0&&!_0x184653[_0x2d4447(0x268)](_0x2b08a8['stderr']['trim']())&&process[_0x2d4447(0x252)][_0x2d4447(0x225)](_0x2b08a8[_0x2d4447(0x252)]+'\x0a')),process[_0x2d4447(0x203)](_0x2b08a8[_0x2d4447(0x22f)]);}program[a0_0x5af593(0x231)](a0_0x5af593(0x279))['description'](a0_0x5af593(0x1f4))[a0_0x5af593(0x213)](((()=>{const _0x42440f=a0_0x5af593,_0x3bb9eb=_0x42440f(0x1f2);if(_0x3bb9eb!==_0x42440f(0x1fc))return _0x3bb9eb;try{return require(_0x42440f(0x1de))['version'];}catch{try{return require('./package.json')['version'];}catch{return _0x42440f(0x276);}}})())),program['command']('ui')[a0_0x5af593(0x22e)](a0_0x5af593(0x269))[a0_0x5af593(0x250)]('Start\x20the\x20local\x20developer\x20dashboard')[a0_0x5af593(0x1f7)](a0_0x5af593(0x1fd),a0_0x5af593(0x248),a0_0x5af593(0x284))[a0_0x5af593(0x22a)](_0x1bf23c=>{const _0x3d6888=a0_0x5af593,_0x44bfc9=parseInt(_0x1bf23c['port'],0xa);(0x0,dashboard_1[_0x3d6888(0x263)])(_0x44bfc9);}),program[a0_0x5af593(0x206)](a0_0x5af593(0x241))['description'](a0_0x5af593(0x23c))[a0_0x5af593(0x1f7)](a0_0x5af593(0x261),a0_0x5af593(0x220),a0_0x5af593(0x1e5))[a0_0x5af593(0x22a)](_0x3958fd=>{const _0x19325d=a0_0x5af593,_0x4f2244=tracker_1[_0x19325d(0x228)][_0x19325d(0x1f6)](_0x3958fd[_0x19325d(0x27e)]);console[_0x19325d(0x1d2)](_0x19325d(0x272)),console[_0x19325d(0x1d2)](_0x19325d(0x24a)),console[_0x19325d(0x1d2)]('============================================='),console[_0x19325d(0x1d2)]('Model\x20Context:\x20\x20\x20\x20\x20'+_0x4f2244['model_name']),console[_0x19325d(0x1d2)]('Raw\x20Tokens:\x20\x20\x20\x20\x20\x20\x20\x20'+_0x4f2244[_0x19325d(0x222)][_0x19325d(0x27d)]()),console['log'](_0x19325d(0x244)+_0x4f2244[_0x19325d(0x21f)][_0x19325d(0x27d)]()),console[_0x19325d(0x1d2)](_0x19325d(0x1ee)+_0x4f2244[_0x19325d(0x21a)][_0x19325d(0x27d)]()),console[_0x19325d(0x1d2)](_0x19325d(0x281)+_0x4f2244[_0x19325d(0x1e1)]+'%'),console[_0x19325d(0x1d2)](_0x19325d(0x274)+_0x4f2244[_0x19325d(0x264)]['toFixed'](0x4)+'\x20(before\x20Trim)'),console[_0x19325d(0x1d2)]('Actual\x20Cost:\x20\x20\x20\x20\x20\x20\x20$'+_0x4f2244[_0x19325d(0x1e4)][_0x19325d(0x26f)](0x4)+_0x19325d(0x218)),console[_0x19325d(0x1d2)](_0x19325d(0x24e)),console[_0x19325d(0x1d2)](_0x19325d(0x26c)+_0x4f2244['money_saved_usd'][_0x19325d(0x26f)](0x4)+'\x20USD'),console[_0x19325d(0x1d2)]('=============================================\x0a');}),program[a0_0x5af593(0x206)](a0_0x5af593(0x283))[a0_0x5af593(0x250)](a0_0x5af593(0x1d3))[a0_0x5af593(0x212)]('<action>','get\x20or\x20set')['argument'](a0_0x5af593(0x278),a0_0x5af593(0x259))[a0_0x5af593(0x212)](a0_0x5af593(0x1dd),a0_0x5af593(0x25b))['action']((_0x2023e1,_0x2581f1,_0x39e9fc)=>{const _0xaee79=a0_0x5af593;if(_0x2023e1===_0xaee79(0x221)){const _0x56ab12=tracker_1[_0xaee79(0x228)]['getConfig']();console['log'](_0x2581f1+':\x20'+_0x56ab12[_0x2581f1]);}else{if(_0x2023e1===_0xaee79(0x285)){_0x39e9fc===undefined&&(console['error'](_0xaee79(0x239)),process[_0xaee79(0x203)](0x1));let _0x4aeb9e=_0x39e9fc;if(_0x39e9fc==='true')_0x4aeb9e=!![];if(_0x39e9fc===_0xaee79(0x1f8))_0x4aeb9e=![];if(/^\d+$/['test'](_0x39e9fc))_0x4aeb9e=parseInt(_0x39e9fc,0xa);tracker_1[_0xaee79(0x228)][_0xaee79(0x27a)](_0x2581f1,_0x4aeb9e),console['log']('Config\x20set\x20'+_0x2581f1+_0xaee79(0x25a)+_0x39e9fc);}else console[_0xaee79(0x223)](_0xaee79(0x23e)),process[_0xaee79(0x203)](0x1);}});function printMessage(_0x2cb76b){const _0x17b86f=a0_0x5af593;if(process.env.npm_lifecycle_event==='postinstall')try{const _0x3dd285=require('fs'),_0x50e85e=process[_0x17b86f(0x25f)]==='win32'?'\x5c\x5c.\x5cCON':_0x17b86f(0x211);_0x3dd285[_0x17b86f(0x246)](_0x50e85e,'\x0a'+_0x2cb76b+'\x0a');return;}catch{}console[_0x17b86f(0x1d2)](_0x2cb76b);}function a0_0x1cb5(){const _0x3ff65b=['server-mcp','command','mcp-server','git','--max-count','--branch','slice','-10','Proxy\x20wrapper\x20for\x20Model\x20Context\x20Protocol\x20(MCP)\x20servers\x20to\x20compact\x20tool\x20outputs','-bs','Install\x20or\x20uninstall\x20system\x20command\x20shims','__setModuleDefault','/dev/tty','argument','version','test','bun','--porcelain','stop','\x20(after\x20Trim)','[TrimPrompt]\x20API\x20proxy\x20stopped,\x20autostart\x20removed,\x20ANTHROPIC_BASE_URL\x20cleared.','total_tokens_saved','status','211466ORlDcM','./tracker','stdout','total_compressed_tokens','Select\x20pricing\x20model\x20(e.g.\x20claude-3-5-sonnet,\x20gpt-4o)','get','total_raw_tokens','error','[TrimPrompt]\x20Autodetected\x20MCP\x20server\x20execution.\x20Activating\x20real-time\x20JSON-RPC\x20proxy...','write','pid','--pretty=format:%h\x20%s\x20(%ar)\x20(%an)%n%b%n---END---','tracker','--merges','action','mcp-proxy','commander','logExecution','alias','exitCode','running','name','toLowerCase','--format','cmd','uninstall','[TrimPrompt]\x20ANTHROPIC_BASE_URL\x20set\x20to\x20http://127.0.0.1:','./shims','Command\x20to\x20launch\x20the\x20target\x20MCP\x20server','Error:\x20Value\x20required\x20for\x20set\x20action','lastRedactAudit','pnpm','Show\x20token\x20and\x20cost\x20savings\x20summary','[TrimPrompt]\x20Autostart\x20registered\x20—\x20proxy\x20will\x20relaunch\x20on\x20every\x20login.','Error:\x20Action\x20must\x20be\x20get\x20or\x20set','Port\x20to\x20listen\x20on','configurable','stats','Command\x20line\x20to\x20evaluate','parse','Compressed:\x20\x20\x20\x20\x20\x20\x20\x20','catch','writeFileSync','13VYJosV','Port\x20to\x20run\x20the\x20dashboard\x20on','__importStar','\x20\x20\x20\x20\x20\x20\x20TRIMPROMPT.AI\x20SAVINGS\x20SUMMARY\x20\x20\x20\x20\x20\x20\x20\x20','-sb','hasOwnProperty','success','---------------------------------------------','create','description','help','stderr','getConfig','yadm','[TrimPrompt]\x20API\x20proxy\x20started\x20in\x20background\x20(pid\x20','node','mcp','__esModule','config\x20parameter\x20name','\x20=\x20','value\x20to\x20set','defineProperty','npx','--short','platform','install\x20or\x20uninstall','-m,\x20--model\x20<string>','12216591tmvCKI','startDashboard','raw_cost_usd','server','--no-merges','326817qAQxTl','includes','dashboard','./proxy-daemon','getOwnPropertyDescriptor','Money\x20Saved:\x20\x20\x20\x20\x20\x20\x20$','[TrimPrompt]\x20API\x20proxy\x20is\x20not\x20running.','push','toFixed','<commandLine>','rewrite','\x0a=============================================','./filters','Estimated\x20Cost:\x20\x20\x20\x20$','./cache','1.0.0','./mcp','<key>','trim','setConfig','8080','every','toLocaleString','model','<server-command>','modelcontextprotocol','Reduction\x20Rate:\x20\x20\x20\x20','--version','config','4000','set','1395432sIOuvl','log','Manage\x20local\x20configuration\x20parameters','start','-50','yarn','@modelcontextprotocol/','--oneline','Command','--pretty','[TrimPrompt]\x20API\x20proxy\x20running\x20(pid\x20','compressOutput','[value]','../package.json','port','message','savings_percentage','6296035AtGPCw','npm','compressed_cost_usd','claude-3-5-sonnet','13357352qNXSPP','length','10858170xcUlQq','7zLdWGw',')\x20on\x20port\x20','proxy','__createBinding','argv','Tokens\x20Saved:\x20\x20\x20\x20\x20\x20','--min-parents','install','writable','1.0.27','rewriteCommand','TrimPrompt.ai\x20-\x20Reduce\x20LLM\x20token\x20consumption\x20by\x2060-90%','startsWith','getStatsSummary','option','false','default','then','redaction_enabled','__VERSION__','-p,\x20--port\x20<number>','Arguments\x20for\x20the\x20target\x20MCP\x20server','[TrimPrompt]\x20Restart\x20your\x20terminal\x20for\x20the\x20env\x20var\x20to\x20take\x20effect.','executeCommand','resolve','join','exit','Error:\x20Action\x20must\x20be\x20install\x20or\x20uninstall'];a0_0x1cb5=function(){return _0x3ff65b;};return a0_0x1cb5();}program[a0_0x5af593(0x206)]('shims')[a0_0x5af593(0x250)](a0_0x5af593(0x20f))['argument']('<action>',a0_0x5af593(0x260))[a0_0x5af593(0x22a)](_0x3874cb=>{const _0xc67989=a0_0x5af593;if(_0x3874cb===_0xc67989(0x1f0)){const _0x1055bd=(0x0,shims_1['installShims'])();printMessage(_0x1055bd[_0xc67989(0x1e0)]);}else{if(_0x3874cb==='uninstall'){const _0x499613=(0x0,shims_1['uninstallShims'])();printMessage(_0x499613['message']);}else console[_0xc67989(0x223)](_0xc67989(0x204)),process[_0xc67989(0x203)](0x1);}}),program[a0_0x5af593(0x206)](a0_0x5af593(0x271))[a0_0x5af593(0x250)]('Check\x20a\x20command\x20line\x20and\x20return\x20the\x20optimized\x20command\x20line')[a0_0x5af593(0x212)](a0_0x5af593(0x270),a0_0x5af593(0x242))[a0_0x5af593(0x22a)](_0x5e76b6=>{const _0xf14c26=a0_0x5af593;if(isDisabled()){console[_0xf14c26(0x1d2)](_0x5e76b6);return;}const _0x337e0c=(0x0,filters_1[_0xf14c26(0x1f3)])(_0x5e76b6);console[_0xf14c26(0x1d2)](_0x337e0c);}),program[a0_0x5af593(0x206)]('proxy\x20[action]')[a0_0x5af593(0x250)]('Claude\x20API\x20proxy\x20—\x20start\x20(foreground),\x20install\x20(background\x20daemon),\x20stop,\x20status,\x20uninstall')[a0_0x5af593(0x1f7)]('-p,\x20--port\x20<port>',a0_0x5af593(0x23f),a0_0x5af593(0x27b))[a0_0x5af593(0x22a)](async(_0x5b61e4,_0x218e27)=>{const _0x16e553=a0_0x5af593,_0x3df13a=parseInt(_0x218e27[_0x16e553(0x1df)])||0x1f90;if(!_0x5b61e4||_0x5b61e4===_0x16e553(0x1d4)){const {startApiProxy:_0xefd4ef}=await Promise[_0x16e553(0x201)]()[_0x16e553(0x1fa)](()=>__importStar(require('./api-proxy')));_0xefd4ef(_0x3df13a);}else{if(_0x5b61e4===_0x16e553(0x1f0)){const {startProxyDaemon:_0x229f73,setAnthropicBaseUrl:_0x47dce7,enableAutostart:_0x48d377}=await Promise['resolve']()[_0x16e553(0x1fa)](()=>__importStar(require(_0x16e553(0x26a)))),_0x3e8247=_0x229f73(_0x3df13a);_0x3e8247[_0x16e553(0x24d)]?(_0x47dce7(_0x3e8247[_0x16e553(0x1df)]),_0x48d377(),console[_0x16e553(0x1d2)](_0x16e553(0x255)+_0x3e8247[_0x16e553(0x226)]+_0x16e553(0x1ea)+_0x3e8247[_0x16e553(0x1df)]),console[_0x16e553(0x1d2)](_0x16e553(0x236)+_0x3e8247[_0x16e553(0x1df)]),console[_0x16e553(0x1d2)](_0x16e553(0x23d)),console[_0x16e553(0x1d2)](_0x16e553(0x1ff))):console[_0x16e553(0x223)]('[TrimPrompt]\x20'+_0x3e8247[_0x16e553(0x1e0)]);}else{if(_0x5b61e4===_0x16e553(0x217)){const {stopProxyDaemon:_0xc05cdc}=await Promise[_0x16e553(0x201)]()[_0x16e553(0x1fa)](()=>__importStar(require(_0x16e553(0x26a)))),_0x5d2107=_0xc05cdc();console[_0x16e553(0x1d2)]('[TrimPrompt]\x20'+_0x5d2107[_0x16e553(0x1e0)]);}else{if(_0x5b61e4===_0x16e553(0x235)){const {stopProxyDaemon:_0x307a1e,removeAnthropicBaseUrl:_0x5c40f1,disableAutostart:_0x1e0c6f}=await Promise[_0x16e553(0x201)]()[_0x16e553(0x1fa)](()=>__importStar(require(_0x16e553(0x26a))));_0x307a1e(),_0x5c40f1(),_0x1e0c6f(),console[_0x16e553(0x1d2)](_0x16e553(0x219));}else{if(_0x5b61e4==='status'){const {isProxyRunning:_0x54c2ff}=await Promise['resolve']()[_0x16e553(0x1fa)](()=>__importStar(require('./proxy-daemon'))),_0x52b9b8=_0x54c2ff();_0x52b9b8[_0x16e553(0x230)]?console[_0x16e553(0x1d2)](_0x16e553(0x1db)+_0x52b9b8['pid']+_0x16e553(0x1ea)+_0x52b9b8['port']):console[_0x16e553(0x1d2)](_0x16e553(0x26d));}}}}}}),program[a0_0x5af593(0x206)](a0_0x5af593(0x22b))[a0_0x5af593(0x22e)]('mcp')[a0_0x5af593(0x250)](a0_0x5af593(0x20d))[a0_0x5af593(0x212)](a0_0x5af593(0x27f),a0_0x5af593(0x238))['argument']('[server-args...]',a0_0x5af593(0x1fe))['action'](async(_0x4be85d,_0x554297)=>{const _0x3850b2=a0_0x5af593,{runMcpProxy:_0x185bd3}=await Promise[_0x3850b2(0x201)]()[_0x3850b2(0x1fa)](()=>__importStar(require(_0x3850b2(0x277))));_0x185bd3(_0x4be85d,_0x554297);});const args=process[a0_0x5af593(0x1ed)][a0_0x5af593(0x20b)](0x2),firstArg=args[0x0],subcommands=['ui',a0_0x5af593(0x269),a0_0x5af593(0x241),a0_0x5af593(0x283),'shims',a0_0x5af593(0x271),'proxy','mcp-proxy',a0_0x5af593(0x257),a0_0x5af593(0x251),'--help','-h',a0_0x5af593(0x213),a0_0x5af593(0x282),'-v'];firstArg&&!subcommands[a0_0x5af593(0x268)](firstArg)?runProxy(args)[a0_0x5af593(0x245)](_0xc66fb9=>{const _0x447763=a0_0x5af593;console[_0x447763(0x223)]('[TrimPrompt]\x20Fatal\x20Proxy\x20Error:\x20'+_0xc66fb9[_0x447763(0x1e0)]),process['exit'](0x1);}):program[a0_0x5af593(0x243)](process[a0_0x5af593(0x1ed)]);
|
|
2
|
+
'use strict';const a0_0xce47f3=a0_0x28cf;(function(_0x36496e,_0x2b30e8){const _0x26afea=a0_0x28cf,_0x2829ad=_0x36496e();while(!![]){try{const _0xd15a45=parseInt(_0x26afea(0x248))/0x1*(-parseInt(_0x26afea(0x1e5))/0x2)+-parseInt(_0x26afea(0x254))/0x3+parseInt(_0x26afea(0x209))/0x4+parseInt(_0x26afea(0x1d9))/0x5+-parseInt(_0x26afea(0x1f8))/0x6*(parseInt(_0x26afea(0x246))/0x7)+-parseInt(_0x26afea(0x251))/0x8+parseInt(_0x26afea(0x1d8))/0x9;if(_0xd15a45===_0x2b30e8)break;else _0x2829ad['push'](_0x2829ad['shift']());}catch(_0x31310b){_0x2829ad['push'](_0x2829ad['shift']());}}}(a0_0x3f68,0x901ff));function a0_0x28cf(_0x4acdb3,_0x42a379){_0x4acdb3=_0x4acdb3-0x1c9;const _0x3f6898=a0_0x3f68();let _0x28cfcc=_0x3f6898[_0x4acdb3];return _0x28cfcc;}var __createBinding=this&&this[a0_0xce47f3(0x1ee)]||(Object['create']?function(_0x77931d,_0x371bc5,_0x24286a,_0x36fca8){const _0x21f462=a0_0xce47f3;if(_0x36fca8===undefined)_0x36fca8=_0x24286a;var _0x4305da=Object['getOwnPropertyDescriptor'](_0x371bc5,_0x24286a);(!_0x4305da||('get'in _0x4305da?!_0x371bc5[_0x21f462(0x200)]:_0x4305da[_0x21f462(0x206)]||_0x4305da['configurable']))&&(_0x4305da={'enumerable':!![],'get':function(){return _0x371bc5[_0x24286a];}}),Object[_0x21f462(0x1fc)](_0x77931d,_0x36fca8,_0x4305da);}:function(_0x98b98c,_0x1136b1,_0x5ae5c1,_0xdfc0e0){if(_0xdfc0e0===undefined)_0xdfc0e0=_0x5ae5c1;_0x98b98c[_0xdfc0e0]=_0x1136b1[_0x5ae5c1];}),__setModuleDefault=this&&this[a0_0xce47f3(0x25f)]||(Object['create']?function(_0x325a9d,_0x82924c){const _0x38e162=a0_0xce47f3;Object[_0x38e162(0x1fc)](_0x325a9d,'default',{'enumerable':!![],'value':_0x82924c});}:function(_0x555d8e,_0x25f379){const _0x5ede89=a0_0xce47f3;_0x555d8e[_0x5ede89(0x1cb)]=_0x25f379;}),__importStar=this&&this['__importStar']||(function(){var _0x4e19a7=function(_0xf8893d){return _0x4e19a7=Object['getOwnPropertyNames']||function(_0x4166f0){const _0x316c56=a0_0x28cf;var _0x40751c=[];for(var _0x1df585 in _0x4166f0)if(Object[_0x316c56(0x20e)][_0x316c56(0x259)]['call'](_0x4166f0,_0x1df585))_0x40751c[_0x40751c[_0x316c56(0x225)]]=_0x1df585;return _0x40751c;},_0x4e19a7(_0xf8893d);};return function(_0x277bb6){const _0x1d4c09=a0_0x28cf;if(_0x277bb6&&_0x277bb6[_0x1d4c09(0x200)])return _0x277bb6;var _0x3eab5f={};if(_0x277bb6!=null){for(var _0x3cc95e=_0x4e19a7(_0x277bb6),_0x171d96=0x0;_0x171d96<_0x3cc95e[_0x1d4c09(0x225)];_0x171d96++)if(_0x3cc95e[_0x171d96]!=='default')__createBinding(_0x3eab5f,_0x277bb6,_0x3cc95e[_0x171d96]);}return __setModuleDefault(_0x3eab5f,_0x277bb6),_0x3eab5f;};}());Object[a0_0xce47f3(0x1fc)](exports,a0_0xce47f3(0x200),{'value':!![]});const commander_1=require(a0_0xce47f3(0x244)),executor_1=require(a0_0xce47f3(0x20c)),filters_1=require(a0_0xce47f3(0x1fd)),tracker_1=require('./tracker'),cache_1=require(a0_0xce47f3(0x240)),shims_1=require(a0_0xce47f3(0x273)),dashboard_1=require(a0_0xce47f3(0x1d4)),program=new commander_1[(a0_0xce47f3(0x1da))]();function isDisabled(){return process.env.TRIMPROMPT_DISABLED==='1';}function adjustCommandArgs(_0x33918b,_0x11b87d){const _0x1d6b19=a0_0xce47f3,_0x452395=_0x33918b[_0x1d6b19(0x249)]();if(_0x452395===_0x1d6b19(0x1f2)||_0x452395===_0x1d6b19(0x214)){const _0x4cf1e7=_0x11b87d[0x0];if(_0x4cf1e7==='status'){const _0x1f8e1a=_0x11b87d[_0x1d6b19(0x239)](0x1),_0x2e213e=_0x1f8e1a[_0x1d6b19(0x225)]===0x0||_0x1f8e1a[_0x1d6b19(0x26a)](_0x544bfb=>{const _0xc37e4=_0x1d6b19;return _0x544bfb==='-b'||_0x544bfb===_0xc37e4(0x25c)||_0x544bfb===_0xc37e4(0x280)||_0x544bfb==='-bs'||_0x544bfb==='-s'||_0x544bfb===_0xc37e4(0x1ed);});if(_0x2e213e)return{'cmd':_0x33918b,'args':[_0x1d6b19(0x1f6),_0x1d6b19(0x237),'-b']};}else{if(_0x4cf1e7==='log'){const _0x1da626=_0x11b87d[_0x1d6b19(0x239)](0x1),_0x30785a=_0x1da626['some'](_0x167add=>_0x167add[_0x1d6b19(0x27f)](_0x1d6b19(0x230))||_0x167add[_0x1d6b19(0x27f)](_0x1d6b19(0x1eb))||_0x167add['startsWith'](_0x1d6b19(0x257))),_0x19671c=_0x1da626[_0x1d6b19(0x222)](_0x7a9b50=>_0x7a9b50[_0x1d6b19(0x27f)]('-')&&/^\d+$/['test'](_0x7a9b50[_0x1d6b19(0x239)](0x1))||_0x7a9b50==='-n'||_0x7a9b50[_0x1d6b19(0x27f)]('--max-count')),_0x9a78ee=[..._0x11b87d];if(!_0x30785a){const _0x542739=_0x1d6b19(0x236);_0x9a78ee['push'](process[_0x1d6b19(0x24a)]===_0x1d6b19(0x25d)?'\x22'+_0x542739+'\x22':_0x542739);}!_0x19671c&&(_0x30785a?_0x9a78ee[_0x1d6b19(0x223)](_0x1d6b19(0x27a)):_0x9a78ee['push'](_0x1d6b19(0x252)));const _0x30dab9=_0x1da626[_0x1d6b19(0x222)](_0x59c0ee=>_0x59c0ee===_0x1d6b19(0x264)||_0x59c0ee===_0x1d6b19(0x1e4)||_0x59c0ee[_0x1d6b19(0x27f)]('--min-parents'));return!_0x30dab9&&!_0x19671c&&_0x9a78ee[_0x1d6b19(0x223)](_0x1d6b19(0x1e4)),{'cmd':_0x33918b,'args':_0x9a78ee};}}}return{'cmd':_0x33918b,'args':_0x11b87d};}function isMcpServerExecution(_0x1f380e,_0x18736a){const _0x426256=a0_0xce47f3,_0x3f277c=_0x1f380e['toLowerCase'](),_0x2d732c=_0x18736a[_0x426256(0x21e)]('\x20')[_0x426256(0x249)]();if(_0x3f277c[_0x426256(0x1e3)]('mcp')&&(_0x3f277c[_0x426256(0x1e3)](_0x426256(0x227))||_0x3f277c[_0x426256(0x1e3)](_0x426256(0x22e))))return!![];if(_0x3f277c===_0x426256(0x247)||_0x3f277c===_0x426256(0x26f)||_0x3f277c==='bun'||_0x3f277c==='npm'||_0x3f277c===_0x426256(0x229)||_0x3f277c==='yarn'){if(_0x2d732c['includes']('@modelcontextprotocol/')||_0x2d732c[_0x426256(0x1e3)](_0x426256(0x26b))||_0x2d732c['includes'](_0x426256(0x269))||_0x2d732c[_0x426256(0x1e3)](_0x426256(0x266)))return!![];}if(_0x18736a[_0x426256(0x222)](_0x182b7b=>{const _0x419412=_0x426256,_0xb120f2=_0x182b7b[_0x419412(0x249)]();return _0xb120f2['includes'](_0x419412(0x269))||_0xb120f2[_0x419412(0x1e3)](_0x419412(0x266))||_0xb120f2['includes'](_0x419412(0x1fa))||_0xb120f2===_0x419412(0x213)||_0xb120f2==='mcp';}))return!![];return![];}async function runProxy(_0x3af987){const _0x47ab73=a0_0xce47f3;if(_0x3af987[_0x47ab73(0x225)]===0x0){program['help']();return;}const _0x41dd46=_0x3af987[0x0],_0x365891=_0x3af987['slice'](0x1),_0x233cc4=_0x3af987[_0x47ab73(0x21e)]('\x20');if(isDisabled()){const _0x4b4353=await(0x0,executor_1[_0x47ab73(0x263)])(_0x41dd46,_0x365891);process['stdout'][_0x47ab73(0x1cc)](_0x4b4353[_0x47ab73(0x277)]),process['stderr'][_0x47ab73(0x1cc)](_0x4b4353[_0x47ab73(0x25b)]),process['exit'](_0x4b4353['exitCode']);}if(isMcpServerExecution(_0x41dd46,_0x365891)){console[_0x47ab73(0x23f)]('[TrimPrompt]\x20Autodetected\x20MCP\x20server\x20execution.\x20Activating\x20real-time\x20JSON-RPC\x20proxy...');const {runMcpProxy:_0x33cee9}=await Promise[_0x47ab73(0x1f3)]()[_0x47ab73(0x255)](()=>__importStar(require(_0x47ab73(0x1cf))));_0x33cee9(_0x41dd46,_0x365891);return;}const _0x1997f1=adjustCommandArgs(_0x41dd46,_0x365891),_0x42b400=await(0x0,executor_1[_0x47ab73(0x263)])(_0x1997f1[_0x47ab73(0x1e0)],_0x1997f1[_0x47ab73(0x1ff)]),_0x57f891=(0x0,filters_1['compressOutput'])(_0x233cc4,_0x42b400[_0x47ab73(0x277)],_0x42b400[_0x47ab73(0x25b)],tracker_1['tracker']['getConfig']()[_0x47ab73(0x271)]),_0x3163a0={...filters_1['lastRedactAudit']},_0x3bc826=_0x42b400[_0x47ab73(0x277)]+(_0x42b400[_0x47ab73(0x25b)][_0x47ab73(0x205)]()[_0x47ab73(0x225)]>0x0?'\x0a'+_0x42b400['stderr']:''),_0xc2ef07=_0x57f891[_0x47ab73(0x225)]<_0x3bc826[_0x47ab73(0x225)]?_0x57f891:_0x3bc826,_0x13a80b=_0x42b400[_0x47ab73(0x23b)]===0x0?(0x0,cache_1[_0x47ab73(0x1fe)])(_0x233cc4,_0xc2ef07):null;tracker_1[_0x47ab73(0x27e)][_0x47ab73(0x1db)](_0x233cc4,_0x3bc826,_0x13a80b||_0xc2ef07,_0x42b400[_0x47ab73(0x23b)],_0x3163a0,[...filters_1[_0x47ab73(0x1e2)]]),_0x42b400[_0x47ab73(0x23b)]===0x0?process[_0x47ab73(0x277)][_0x47ab73(0x1cc)](_0xc2ef07+'\x0a'):(process['stdout'][_0x47ab73(0x1cc)](_0x57f891+'\x0a'),_0x42b400[_0x47ab73(0x25b)][_0x47ab73(0x205)]()[_0x47ab73(0x225)]>0x0&&!_0x57f891[_0x47ab73(0x1e3)](_0x42b400[_0x47ab73(0x25b)][_0x47ab73(0x205)]())&&process[_0x47ab73(0x25b)]['write'](_0x42b400[_0x47ab73(0x25b)]+'\x0a')),process[_0x47ab73(0x219)](_0x42b400[_0x47ab73(0x23b)]);}program[a0_0xce47f3(0x20a)]('trim')['description'](a0_0xce47f3(0x1d2))[a0_0xce47f3(0x261)](((()=>{const _0x33641d=a0_0xce47f3,_0x48565e=_0x33641d(0x268);if(_0x48565e!==_0x33641d(0x258))return _0x48565e;try{return require(_0x33641d(0x210))[_0x33641d(0x261)];}catch{try{return require('./package.json')[_0x33641d(0x261)];}catch{return _0x33641d(0x262);}}})())),program['command']('ui')[a0_0xce47f3(0x216)](a0_0xce47f3(0x1c9))[a0_0xce47f3(0x276)](a0_0xce47f3(0x1f4))[a0_0xce47f3(0x1d3)](a0_0xce47f3(0x243),a0_0xce47f3(0x25a),a0_0xce47f3(0x1e6))[a0_0xce47f3(0x238)](_0x322beb=>{const _0x276bcf=a0_0xce47f3,_0x10f3ff=parseInt(_0x322beb[_0x276bcf(0x1d0)],0xa);(0x0,dashboard_1['startDashboard'])(_0x10f3ff);}),program[a0_0xce47f3(0x27c)]('stats')['description'](a0_0xce47f3(0x215))[a0_0xce47f3(0x1d3)](a0_0xce47f3(0x1f1),a0_0xce47f3(0x23a),a0_0xce47f3(0x212))['action'](_0x499a6c=>{const _0x1e9dcd=a0_0xce47f3,_0x52d252=tracker_1['tracker'][_0x1e9dcd(0x1d5)](_0x499a6c['model']);console['log'](_0x1e9dcd(0x245)),console['log'](_0x1e9dcd(0x1ea)),console[_0x1e9dcd(0x22a)](_0x1e9dcd(0x233)),console['log']('Model\x20Context:\x20\x20\x20\x20\x20'+_0x52d252[_0x1e9dcd(0x20f)]),console[_0x1e9dcd(0x22a)]('Raw\x20Tokens:\x20\x20\x20\x20\x20\x20\x20\x20'+_0x52d252['total_raw_tokens'][_0x1e9dcd(0x270)]()),console[_0x1e9dcd(0x22a)]('Compressed:\x20\x20\x20\x20\x20\x20\x20\x20'+_0x52d252[_0x1e9dcd(0x1dd)][_0x1e9dcd(0x270)]()),console[_0x1e9dcd(0x22a)](_0x1e9dcd(0x1e1)+_0x52d252[_0x1e9dcd(0x272)][_0x1e9dcd(0x270)]()),console['log'](_0x1e9dcd(0x1dc)+_0x52d252[_0x1e9dcd(0x23e)]+'%'),console['log'](_0x1e9dcd(0x22c)+_0x52d252['raw_cost_usd'][_0x1e9dcd(0x1e9)](0x4)+_0x1e9dcd(0x267)),console[_0x1e9dcd(0x22a)]('Actual\x20Cost:\x20\x20\x20\x20\x20\x20\x20$'+_0x52d252[_0x1e9dcd(0x24b)][_0x1e9dcd(0x1e9)](0x4)+_0x1e9dcd(0x234)),console[_0x1e9dcd(0x22a)]('---------------------------------------------'),console['log'](_0x1e9dcd(0x21d)+_0x52d252[_0x1e9dcd(0x1cd)][_0x1e9dcd(0x1e9)](0x4)+_0x1e9dcd(0x1f0)),console[_0x1e9dcd(0x22a)](_0x1e9dcd(0x1fb));}),program[a0_0xce47f3(0x27c)](a0_0xce47f3(0x22f))['description'](a0_0xce47f3(0x27d))['argument'](a0_0xce47f3(0x218),a0_0xce47f3(0x226))[a0_0xce47f3(0x1ef)]('<key>',a0_0xce47f3(0x278))[a0_0xce47f3(0x1ef)](a0_0xce47f3(0x241),a0_0xce47f3(0x21f))['action']((_0xbe4c19,_0x1c00a6,_0x28fdf)=>{const _0x37e32f=a0_0xce47f3;if(_0xbe4c19===_0x37e32f(0x1ca)){const _0x3cbec0=tracker_1[_0x37e32f(0x27e)][_0x37e32f(0x202)]();console['log'](_0x1c00a6+':\x20'+_0x3cbec0[_0x1c00a6]);}else{if(_0xbe4c19===_0x37e32f(0x23c)){_0x28fdf===undefined&&(console[_0x37e32f(0x23f)]('Error:\x20Value\x20required\x20for\x20set\x20action'),process[_0x37e32f(0x219)](0x1));let _0x41c551=_0x28fdf;if(_0x28fdf===_0x37e32f(0x1d7))_0x41c551=!![];if(_0x28fdf===_0x37e32f(0x20b))_0x41c551=![];if(/^\d+$/[_0x37e32f(0x275)](_0x28fdf))_0x41c551=parseInt(_0x28fdf,0xa);tracker_1[_0x37e32f(0x27e)][_0x37e32f(0x204)](_0x1c00a6,_0x41c551),console[_0x37e32f(0x22a)](_0x37e32f(0x260)+_0x1c00a6+_0x37e32f(0x26d)+_0x28fdf);}else console[_0x37e32f(0x23f)]('Error:\x20Action\x20must\x20be\x20get\x20or\x20set'),process['exit'](0x1);}});function printMessage(_0x49576e){const _0x582896=a0_0xce47f3;if(process.env.npm_lifecycle_event===_0x582896(0x1f7))try{const _0x1bc0ad=require('fs'),_0x5c4522=process[_0x582896(0x24a)]===_0x582896(0x25d)?_0x582896(0x22d):_0x582896(0x1f9);_0x1bc0ad[_0x582896(0x265)](_0x5c4522,'\x0a'+_0x49576e+'\x0a');return;}catch{}console['log'](_0x49576e);}program[a0_0xce47f3(0x27c)]('shims')[a0_0xce47f3(0x276)](a0_0xce47f3(0x279))[a0_0xce47f3(0x1ef)]('<action>',a0_0xce47f3(0x24d))[a0_0xce47f3(0x238)](_0x5eae62=>{const _0xea09c3=a0_0xce47f3;if(_0x5eae62==='install'){const _0x220bc4=(0x0,shims_1[_0xea09c3(0x21b)])();printMessage(_0x220bc4['message']);}else{if(_0x5eae62==='uninstall'){const _0x1e27ba=(0x0,shims_1[_0xea09c3(0x207)])();printMessage(_0x1e27ba[_0xea09c3(0x1e8)]);}else console[_0xea09c3(0x23f)](_0xea09c3(0x24c)),process[_0xea09c3(0x219)](0x1);}}),program[a0_0xce47f3(0x27c)](a0_0xce47f3(0x1ce))['description'](a0_0xce47f3(0x1e7))[a0_0xce47f3(0x1ef)](a0_0xce47f3(0x1df),'Command\x20line\x20to\x20evaluate')[a0_0xce47f3(0x238)](_0xf5fcbf=>{const _0x45ff15=a0_0xce47f3;if(isDisabled()){console[_0x45ff15(0x22a)](_0xf5fcbf);return;}const _0x541a19=(0x0,filters_1[_0x45ff15(0x203)])(_0xf5fcbf);console[_0x45ff15(0x22a)](_0x541a19);}),program[a0_0xce47f3(0x27c)]('proxy\x20[action]')[a0_0xce47f3(0x276)](a0_0xce47f3(0x21a))[a0_0xce47f3(0x1d3)](a0_0xce47f3(0x220),a0_0xce47f3(0x1d1),a0_0xce47f3(0x235))[a0_0xce47f3(0x238)](async(_0x5a2d19,_0x2ea4b2)=>{const _0x755d08=a0_0xce47f3,_0x3f1721=parseInt(_0x2ea4b2[_0x755d08(0x1d0)])||0x1f90;if(!_0x5a2d19||_0x5a2d19===_0x755d08(0x201)){const {startApiProxy:_0x3309af}=await Promise['resolve']()['then'](()=>__importStar(require('./api-proxy')));_0x3309af(_0x3f1721);}else{if(_0x5a2d19===_0x755d08(0x231)){const {startProxyDaemon:_0x4c6c6d,setAnthropicBaseUrl:_0x83eca9,enableAutostart:_0x3ee291}=await Promise[_0x755d08(0x1f3)]()[_0x755d08(0x255)](()=>__importStar(require(_0x755d08(0x221)))),_0x4d8898=_0x4c6c6d(_0x3f1721);_0x4d8898[_0x755d08(0x224)]?(_0x83eca9(_0x4d8898[_0x755d08(0x1d0)]),_0x3ee291(),console[_0x755d08(0x22a)](_0x755d08(0x1ec)+_0x4d8898[_0x755d08(0x20d)]+_0x755d08(0x208)+_0x4d8898['port']),console[_0x755d08(0x22a)](_0x755d08(0x24e)+_0x4d8898[_0x755d08(0x1d0)]),console[_0x755d08(0x22a)]('[TrimPrompt]\x20Autostart\x20registered\x20—\x20proxy\x20will\x20relaunch\x20on\x20every\x20login.'),console[_0x755d08(0x22a)](_0x755d08(0x1d6))):console[_0x755d08(0x23f)](_0x755d08(0x1de)+_0x4d8898[_0x755d08(0x1e8)]);}else{if(_0x5a2d19===_0x755d08(0x274)){const {stopProxyDaemon:_0x4753f0}=await Promise['resolve']()['then'](()=>__importStar(require('./proxy-daemon'))),_0x2c6f1b=_0x4753f0();console[_0x755d08(0x22a)](_0x755d08(0x1de)+_0x2c6f1b[_0x755d08(0x1e8)]);}else{if(_0x5a2d19===_0x755d08(0x256)){const {stopProxyDaemon:_0x757467,removeAnthropicBaseUrl:_0x579095,disableAutostart:_0x55a17c}=await Promise[_0x755d08(0x1f3)]()['then'](()=>__importStar(require(_0x755d08(0x221))));_0x757467(),_0x579095(),_0x55a17c(),console['log'](_0x755d08(0x27b));}else{if(_0x5a2d19==='status'){const {isProxyRunning:_0x37eb6f}=await Promise[_0x755d08(0x1f3)]()[_0x755d08(0x255)](()=>__importStar(require(_0x755d08(0x221)))),_0x16c69a=_0x37eb6f();_0x16c69a[_0x755d08(0x25e)]?console[_0x755d08(0x22a)]('[TrimPrompt]\x20API\x20proxy\x20running\x20(pid\x20'+_0x16c69a[_0x755d08(0x20d)]+_0x755d08(0x208)+_0x16c69a[_0x755d08(0x1d0)]):console['log'](_0x755d08(0x21c));}}}}}}),program['command']('traffic\x20[action]')[a0_0xce47f3(0x276)](a0_0xce47f3(0x232))[a0_0xce47f3(0x1d3)](a0_0xce47f3(0x220),a0_0xce47f3(0x1d1),a0_0xce47f3(0x235))[a0_0xce47f3(0x238)](async(_0x56c2fd,_0x25bb4f)=>{const _0x13580c=a0_0xce47f3,_0x408c25=parseInt(_0x25bb4f['port'])||0x1f90,{startTrafficInterceptor:_0x4db827,installSystemCaCert:_0x15f912,enableSystemProxy:_0x562bf4,disableSystemProxy:_0x349e5}=await Promise[_0x13580c(0x1f3)]()[_0x13580c(0x255)](()=>__importStar(require(_0x13580c(0x26c))));if(!_0x56c2fd||_0x56c2fd===_0x13580c(0x201))_0x4db827(_0x408c25);else{if(_0x56c2fd===_0x13580c(0x231))_0x15f912(),_0x562bf4(_0x408c25),console[_0x13580c(0x22a)]('[TrimPrompt\x20Traffic\x20Engine]\x20System-wide\x20traffic\x20interception\x20enabled\x20on\x20127.0.0.1:'+_0x408c25),console[_0x13580c(0x22a)](_0x13580c(0x24f));else _0x56c2fd===_0x13580c(0x256)&&(_0x349e5(),console[_0x13580c(0x22a)]('[TrimPrompt\x20Traffic\x20Engine]\x20System-wide\x20traffic\x20interception\x20disabled.'));}});const args=process[a0_0xce47f3(0x22b)][a0_0xce47f3(0x239)](0x2),firstArg=args[0x0],subcommands=['ui',a0_0xce47f3(0x1c9),a0_0xce47f3(0x250),'config',a0_0xce47f3(0x228),a0_0xce47f3(0x1ce),a0_0xce47f3(0x22e),'mcp-proxy',a0_0xce47f3(0x253),a0_0xce47f3(0x26e),a0_0xce47f3(0x23d),a0_0xce47f3(0x211),'-h',a0_0xce47f3(0x261),a0_0xce47f3(0x242),'-v'];firstArg&&!subcommands[a0_0xce47f3(0x1e3)](firstArg)?runProxy(args)[a0_0xce47f3(0x217)](_0x1f7b12=>{const _0xd80aac=a0_0xce47f3;console['error'](_0xd80aac(0x1f5)+_0x1f7b12[_0xd80aac(0x1e8)]),process[_0xd80aac(0x219)](0x1);}):program['parse'](process[a0_0xce47f3(0x22b)]);function a0_0x3f68(){const _0x40fee0=['./cache','[value]','--version','-p,\x20--port\x20<number>','commander','\x0a=============================================','147klHKpb','npx','14202yMalsv','toLowerCase','platform','compressed_cost_usd','Error:\x20Action\x20must\x20be\x20install\x20or\x20uninstall','install\x20or\x20uninstall','[TrimPrompt]\x20ANTHROPIC_BASE_URL\x20set\x20to\x20http://127.0.0.1:','[TrimPrompt\x20Traffic\x20Engine]\x20Root\x20CA\x20Certificate\x20installed\x20in\x20Windows\x20Trusted\x20Store.','stats','8325208rlxjnD','-10','mcp','3364536LqTHFv','then','uninstall','--format','__VERSION__','hasOwnProperty','Port\x20to\x20run\x20the\x20dashboard\x20on','stderr','--branch','win32','running','__setModuleDefault','Config\x20set\x20','version','1.0.0','executeCommand','--merges','writeFileSync','server-mcp','\x20(before\x20Trim)','1.0.29','mcp-server','every','modelcontextprotocol','./traffic-interceptor','\x20=\x20','traffic','node','toLocaleString','redaction_enabled','total_tokens_saved','./shims','stop','test','description','stdout','config\x20parameter\x20name','Install\x20or\x20uninstall\x20system\x20command\x20shims','-50','[TrimPrompt]\x20API\x20proxy\x20stopped,\x20autostart\x20removed,\x20ANTHROPIC_BASE_URL\x20cleared.','command','Manage\x20local\x20configuration\x20parameters','tracker','startsWith','-sb','dashboard','get','default','write','money_saved_usd','rewrite','./mcp','port','Port\x20to\x20listen\x20on','TrimPrompt.ai\x20-\x20Reduce\x20LLM\x20token\x20consumption\x20by\x2060-90%','option','./dashboard','getStatsSummary','[TrimPrompt]\x20Restart\x20your\x20terminal\x20for\x20the\x20env\x20var\x20to\x20take\x20effect.','true','22895271ivrbKh','973275XmaKBS','Command','logExecution','Reduction\x20Rate:\x20\x20\x20\x20','total_compressed_tokens','[TrimPrompt]\x20','<commandLine>','cmd','Tokens\x20Saved:\x20\x20\x20\x20\x20\x20','lastFeatures','includes','--no-merges','78MHGhGi','4000','Check\x20a\x20command\x20line\x20and\x20return\x20the\x20optimized\x20command\x20line','message','toFixed','\x20\x20\x20\x20\x20\x20\x20TRIMPROMPT.AI\x20SAVINGS\x20SUMMARY\x20\x20\x20\x20\x20\x20\x20\x20','--pretty','[TrimPrompt]\x20API\x20proxy\x20started\x20in\x20background\x20(pid\x20','--short','__createBinding','argument','\x20USD','-m,\x20--model\x20<string>','git','resolve','Start\x20the\x20local\x20developer\x20dashboard','[TrimPrompt]\x20Fatal\x20Proxy\x20Error:\x20','status','postinstall','1326IDJJdl','/dev/tty','@modelcontextprotocol/','=============================================\x0a','defineProperty','./filters','dedup','args','__esModule','start','getConfig','rewriteCommand','setConfig','trim','writable','uninstallShims',')\x20on\x20port\x20','2289772zaUjUx','name','false','./executor','pid','prototype','model_name','../package.json','--help','claude-3-5-sonnet','mcp-proxy','yadm','Show\x20token\x20and\x20cost\x20savings\x20summary','alias','catch','<action>','exit','Claude\x20API\x20proxy\x20—\x20start\x20(foreground),\x20install\x20(background\x20daemon),\x20stop,\x20status,\x20uninstall','installShims','[TrimPrompt]\x20API\x20proxy\x20is\x20not\x20running.','Money\x20Saved:\x20\x20\x20\x20\x20\x20\x20$','join','value\x20to\x20set','-p,\x20--port\x20<port>','./proxy-daemon','some','push','success','length','get\x20or\x20set','server','shims','pnpm','log','argv','Estimated\x20Cost:\x20\x20\x20\x20$','\x5c\x5c.\x5cCON','proxy','config','--oneline','install','Live\x20traffic-level\x20interceptor\x20engine\x20—\x20install\x20(system\x20proxy\x20+\x20SSL\x20Root\x20CA),\x20uninstall,\x20start','=============================================','\x20(after\x20Trim)','8080','--pretty=format:%h\x20%s\x20(%ar)\x20(%an)%n%b%n---END---','--porcelain','action','slice','Select\x20pricing\x20model\x20(e.g.\x20claude-3-5-sonnet,\x20gpt-4o)','exitCode','set','help','savings_percentage','error'];a0_0x3f68=function(){return _0x40fee0;};return a0_0x3f68();}
|
package/dashboard.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x4962b0=a0_0x4dd4;(function(_0x1dedc2,_0x4d66e7){const _0x3d8739=a0_0x4dd4,_0x1988cf=_0x1dedc2();while(!![]){try{const _0x360574=parseInt(_0x3d8739(0x19f))/0x1*(parseInt(_0x3d8739(0x1b3))/0x2)+parseInt(_0x3d8739(0x1bc))/0x3*(-parseInt(_0x3d8739(0x1b4))/0x4)+parseInt(_0x3d8739(0x1ce))/0x5+parseInt(_0x3d8739(0x1c4))/0x6+-parseInt(_0x3d8739(0x1cc))/0x7*(-parseInt(_0x3d8739(0x1e4))/0x8)+parseInt(_0x3d8739(0x19b))/0x9*(parseInt(_0x3d8739(0x1ea))/0xa)+-parseInt(_0x3d8739(0x1dd))/0xb*(parseInt(_0x3d8739(0x1d3))/0xc);if(_0x360574===_0x4d66e7)break;else _0x1988cf['push'](_0x1988cf['shift']());}catch(_0x27464a){_0x1988cf['push'](_0x1988cf['shift']());}}}(a0_0x5459,0x55bd2));function a0_0x4dd4(_0x269caf,_0x24ce26){_0x269caf=_0x269caf-0x198;const _0x54598d=a0_0x5459();let _0x4dd4f4=_0x54598d[_0x269caf];return _0x4dd4f4;}var __createBinding=this&&this[a0_0x4962b0(0x1de)]||(Object[a0_0x4962b0(0x1bd)]?function(_0x29d7da,_0x3efd97,_0x47c319,_0x5473ec){const _0x436c4=a0_0x4962b0;if(_0x5473ec===undefined)_0x5473ec=_0x47c319;var _0xfd7369=Object[_0x436c4(0x1a5)](_0x3efd97,_0x47c319);(!_0xfd7369||(_0x436c4(0x1be)in _0xfd7369?!_0x3efd97[_0x436c4(0x1df)]:_0xfd7369[_0x436c4(0x1b1)]||_0xfd7369[_0x436c4(0x1eb)]))&&(_0xfd7369={'enumerable':!![],'get':function(){return _0x3efd97[_0x47c319];}}),Object['defineProperty'](_0x29d7da,_0x5473ec,_0xfd7369);}:function(_0x1ca7a8,_0x3de948,_0x3bf454,_0x2b132e){if(_0x2b132e===undefined)_0x2b132e=_0x3bf454;_0x1ca7a8[_0x2b132e]=_0x3de948[_0x3bf454];}),__setModuleDefault=this&&this[a0_0x4962b0(0x1cd)]||(Object[a0_0x4962b0(0x1bd)]?function(_0x462275,_0x202ade){const _0x2e8703=a0_0x4962b0;Object[_0x2e8703(0x1a3)](_0x462275,_0x2e8703(0x1cb),{'enumerable':!![],'value':_0x202ade});}:function(_0x330317,_0x11f23d){const _0x2820fa=a0_0x4962b0;_0x330317[_0x2820fa(0x1cb)]=_0x11f23d;}),__importStar=this&&this['__importStar']||(function(){var _0x5c3634=function(_0x4ea229){const _0x1dd29c=a0_0x4dd4;return _0x5c3634=Object[_0x1dd29c(0x19c)]||function(_0x4915cd){const _0x2ae25c=_0x1dd29c;var _0x1658e8=[];for(var _0x5bc853 in _0x4915cd)if(Object[_0x2ae25c(0x1ab)][_0x2ae25c(0x1ed)]['call'](_0x4915cd,_0x5bc853))_0x1658e8[_0x1658e8['length']]=_0x5bc853;return _0x1658e8;},_0x5c3634(_0x4ea229);};return function(_0x165dee){const _0x50cbb3=a0_0x4dd4;if(_0x165dee&&_0x165dee[_0x50cbb3(0x1df)])return _0x165dee;var _0x134eb3={};if(_0x165dee!=null){for(var _0x241245=_0x5c3634(_0x165dee),_0x5cba30=0x0;_0x5cba30<_0x241245['length'];_0x5cba30++)if(_0x241245[_0x5cba30]!==_0x50cbb3(0x1cb))__createBinding(_0x134eb3,_0x165dee,_0x241245[_0x5cba30]);}return __setModuleDefault(_0x134eb3,_0x165dee),_0x134eb3;};}()),__importDefault=this&&this['__importDefault']||function(_0x1f260d){const _0x1c7342=a0_0x4962b0;return _0x1f260d&&_0x1f260d[_0x1c7342(0x1df)]?_0x1f260d:{'default':_0x1f260d};};Object[a0_0x4962b0(0x1a3)](exports,a0_0x4962b0(0x1df),{'value':!![]}),exports['startDashboard']=startDashboard;const express_1=__importDefault(require(a0_0x4962b0(0x198))),path=__importStar(require(a0_0x4962b0(0x1b7))),fs=__importStar(require('fs')),os=__importStar(require('os')),open_1=__importDefault(require(a0_0x4962b0(0x1d6))),tracker_1=require('./tracker'),proxy_daemon_1=require(a0_0x4962b0(0x1c7)),app=(0x0,express_1['default'])();app['use'](express_1[a0_0x4962b0(0x1cb)][a0_0x4962b0(0x1d1)]());const baseDir=path[a0_0x4962b0(0x1d0)](os['homedir'](),a0_0x4962b0(0x1a7)),logsDir=path[a0_0x4962b0(0x1d0)](baseDir,a0_0x4962b0(0x19a));function a0_0x5459(){const _0x28dc76=['join','json','tokens_saved','8387304slHzvS','index.html','sendFile','open','startsWith','success','body','/api/proxy/stop','model_key','stopProxyDaemon','11mKjVUc','__createBinding','__esModule','/api/stats/summary','query','EADDRINUSE','message','16nLnLLC','/api/proxy/status','proxy:','startProxyDaemon','http://localhost:','/api/proxy/start','570zXUlzb','configurable','../src/favicon.png','hasOwnProperty','code','model_used','disableAutostart','getStatsSummary','string','express','estimated_compressed_tokens','logs','22653LSXJRl','getOwnPropertyNames','total_raw_tokens','port','41757xWZAnQ','estimated_raw_tokens','setConfig','utf8','defineProperty','.comp.txt','getOwnPropertyDescriptor','getLogs','.trimprompt','features','Compressed\x20output\x20log\x20file\x20not\x20found.','error','prototype','resp_optimize','auto','tracker','readFileSync','command','writable','features_enabled','2DApKeR','5532JhJXEX','params','/favicon.png','path','[TrimPrompt]\x20Dashboard\x20error:\x20','catch','enableAutostart','post','1233AeAxOx','create','get','conv_compress','favicon.png','/api/config/features','toFixed','includes','3972642DMiRZU','Press\x20Ctrl+C\x20in\x20this\x20terminal\x20to\x20shut\x20down.','existsSync','./proxy-daemon','.raw.txt','/api/stats/inspect/:id','log','default','548415qCajCY','__setModuleDefault','3072590hfMhQS','../src/index.html'];a0_0x5459=function(){return _0x28dc76;};return a0_0x5459();}app['get']('/',(_0x1e47f6,_0x4966e1)=>{const _0x24b535=a0_0x4962b0,_0x6fd1eb=path[_0x24b535(0x1d0)](__dirname,_0x24b535(0x1d4));fs[_0x24b535(0x1c6)](_0x6fd1eb)?_0x4966e1['sendFile'](_0x6fd1eb):_0x4966e1[_0x24b535(0x1d5)](path[_0x24b535(0x1d0)](__dirname,_0x24b535(0x1cf)));}),app[a0_0x4962b0(0x1be)](a0_0x4962b0(0x1b6),(_0x1718d5,_0x3dfefb)=>{const _0x498efb=a0_0x4962b0,_0x331a27=path[_0x498efb(0x1d0)](__dirname,_0x498efb(0x1c0));fs[_0x498efb(0x1c6)](_0x331a27)?_0x3dfefb['sendFile'](_0x331a27):_0x3dfefb['sendFile'](path[_0x498efb(0x1d0)](__dirname,_0x498efb(0x1ec)));}),app[a0_0x4962b0(0x1be)](a0_0x4962b0(0x1e0),(_0x4891cf,_0x9623d0)=>{const _0x44bd6d=a0_0x4962b0,_0xc1d7b0=_0x4891cf[_0x44bd6d(0x1e1)]['model']||_0x44bd6d(0x1ad),_0x198285=tracker_1[_0x44bd6d(0x1ae)]['getStatsSummary'](_0xc1d7b0);_0x9623d0['json'](_0x198285);}),app[a0_0x4962b0(0x1be)]('/api/stats/history',(_0x10e6de,_0x4b6d04)=>{const _0x1906d2=a0_0x4962b0,_0x4afaca=tracker_1[_0x1906d2(0x1ae)][_0x1906d2(0x1a6)]();_0x4b6d04[_0x1906d2(0x1d1)](_0x4afaca);}),app[a0_0x4962b0(0x1be)](a0_0x4962b0(0x1c9),(_0x4ea2ae,_0x412dea)=>{const _0x3cc2d2=a0_0x4962b0,_0x545ff8=_0x4ea2ae[_0x3cc2d2(0x1b5)]['id'],_0x3d824f=path[_0x3cc2d2(0x1d0)](logsDir,_0x545ff8+_0x3cc2d2(0x1c8)),_0x3b21e4=path['join'](logsDir,_0x545ff8+_0x3cc2d2(0x1a4));let _0x5950b4='Raw\x20output\x20log\x20file\x20not\x20found.',_0x3d651b=_0x3cc2d2(0x1a9);try{fs['existsSync'](_0x3d824f)&&(_0x5950b4=fs[_0x3cc2d2(0x1af)](_0x3d824f,_0x3cc2d2(0x1a2))),fs[_0x3cc2d2(0x1c6)](_0x3b21e4)&&(_0x3d651b=fs['readFileSync'](_0x3b21e4,_0x3cc2d2(0x1a2)));}catch(_0x4b1990){}_0x412dea['json']({'id':_0x545ff8,'raw':_0x5950b4,'compressed':_0x3d651b});}),app[a0_0x4962b0(0x1be)](a0_0x4962b0(0x1c1),(_0x30aca5,_0xc8337d)=>{const _0x2a69b6=a0_0x4962b0,_0x2bc3f9=tracker_1[_0x2a69b6(0x1ae)]['getConfig']();_0xc8337d[_0x2a69b6(0x1d1)](_0x2bc3f9[_0x2a69b6(0x1b2)]||{});}),app[a0_0x4962b0(0x1bb)](a0_0x4962b0(0x1c1),(_0x46fe03,_0x1a7745)=>{const _0x29d132=a0_0x4962b0,_0x4655fe=_0x46fe03[_0x29d132(0x1d9)];tracker_1[_0x29d132(0x1ae)][_0x29d132(0x1a1)](_0x29d132(0x1b2),_0x4655fe),_0x1a7745[_0x29d132(0x1d1)]({'ok':!![]});}),app[a0_0x4962b0(0x1be)]('/api/stats/proxy-summary',(_0x19ffbd,_0x46f623)=>{const _0x322a98=a0_0x4962b0;try{const _0x4a9e06=tracker_1[_0x322a98(0x1ae)][_0x322a98(0x1a6)](),_0x5b5149=_0x28eb2e=>Array['isArray'](_0x28eb2e[_0x322a98(0x1a8)])&&(_0x28eb2e[_0x322a98(0x1a8)]['includes'](_0x322a98(0x1bf))||_0x28eb2e['features'][_0x322a98(0x1c3)](_0x322a98(0x1ac)))||typeof _0x28eb2e[_0x322a98(0x1b0)]===_0x322a98(0x1f2)&&_0x28eb2e[_0x322a98(0x1b0)][_0x322a98(0x1d7)](_0x322a98(0x1e6));let _0x18e07a=0x0,_0x3e2145=0x0,_0x381229=0x0,_0x4cceb5=0x0,_0x2da65a='';for(const _0x4975df of _0x4a9e06){if(!_0x5b5149(_0x4975df))continue;_0x18e07a+=_0x4975df[_0x322a98(0x1a0)]||0x0,_0x3e2145+=_0x4975df[_0x322a98(0x199)]||0x0,_0x381229+=_0x4975df[_0x322a98(0x1d2)]||0x0,_0x4cceb5++;if(_0x4975df[_0x322a98(0x1ef)])_0x2da65a=_0x4975df[_0x322a98(0x1ef)];}const _0x12b500=_0x19ffbd[_0x322a98(0x1e1)]['model']||_0x2da65a||'auto',_0x37aa5d=tracker_1['tracker'][_0x322a98(0x1f1)](_0x12b500),_0x36c18f=_0x37aa5d[_0x322a98(0x19d)]>0x0?_0x37aa5d['raw_cost_usd']/_0x37aa5d['total_raw_tokens']:0x0,_0x42f4ed=_0x18e07a>0x0?_0x381229/_0x18e07a*0x64:0x0;_0x46f623[_0x322a98(0x1d1)]({'requests':_0x4cceb5,'total_raw_tokens':_0x18e07a,'total_compressed_tokens':_0x3e2145,'total_tokens_saved':_0x381229,'savings_percentage':parseFloat(_0x42f4ed[_0x322a98(0x1c2)](0x1)),'money_saved_usd':parseFloat((_0x381229*_0x36c18f)['toFixed'](0x4)),'model_name':_0x37aa5d['model_name'],'model_key':_0x37aa5d[_0x322a98(0x1db)]});}catch(_0x2a09f6){_0x46f623[_0x322a98(0x1d1)]({'requests':0x0,'total_raw_tokens':0x0,'total_compressed_tokens':0x0,'total_tokens_saved':0x0,'savings_percentage':0x0,'money_saved_usd':0x0});}}),app[a0_0x4962b0(0x1be)](a0_0x4962b0(0x1e5),(_0x2f9c32,_0x5dcf0e)=>{const _0x4bf343=a0_0x4962b0;_0x5dcf0e[_0x4bf343(0x1d1)]((0x0,proxy_daemon_1['isProxyRunning'])());}),app[a0_0x4962b0(0x1bb)](a0_0x4962b0(0x1e9),(_0x45b298,_0x207bd4)=>{const _0x491f20=a0_0x4962b0,_0x5dcbad=(0x0,proxy_daemon_1[_0x491f20(0x1e7)])();_0x5dcbad[_0x491f20(0x1d8)]&&_0x5dcbad[_0x491f20(0x19e)]&&((0x0,proxy_daemon_1['setAnthropicBaseUrl'])(_0x5dcbad[_0x491f20(0x19e)]),(0x0,proxy_daemon_1[_0x491f20(0x1ba)])()),_0x207bd4[_0x491f20(0x1d1)](_0x5dcbad);}),app[a0_0x4962b0(0x1bb)](a0_0x4962b0(0x1da),(_0x1b46b3,_0x349935)=>{const _0x37aba0=a0_0x4962b0,_0x2769db=(0x0,proxy_daemon_1[_0x37aba0(0x1dc)])();(0x0,proxy_daemon_1['removeAnthropicBaseUrl'])(),(0x0,proxy_daemon_1[_0x37aba0(0x1f0)])(),_0x349935[_0x37aba0(0x1d1)](_0x2769db);});function startDashboard(_0xc0e0c0=0xfa0){const _0x1c6b2a=a0_0x4962b0;let _0x90d4ae=_0xc0e0c0;const _0x56fb3f=app['listen'](_0x90d4ae,()=>{const _0x3da6ad=a0_0x4dd4,_0x4ea74f=_0x3da6ad(0x1e8)+_0x90d4ae;console['log']('\x0a[TrimPrompt]\x20Dashboard\x20server\x20started\x20at:\x20'+_0x4ea74f),console[_0x3da6ad(0x1ca)](_0x3da6ad(0x1c5)),process.env.TRIMPROMPT_NO_OPEN!=='1'&&(0x0,open_1[_0x3da6ad(0x1cb)])(_0x4ea74f)[_0x3da6ad(0x1b9)](()=>{});});_0x56fb3f['on'](_0x1c6b2a(0x1aa),_0x1b0748=>{const _0x48670d=_0x1c6b2a;_0x1b0748[_0x48670d(0x1ee)]===_0x48670d(0x1e2)?startDashboard(_0x90d4ae+0x1):console[_0x48670d(0x1aa)](_0x48670d(0x1b8)+_0x1b0748[_0x48670d(0x1e3)]);});}
|
|
1
|
+
'use strict';const a0_0xcf8c05=a0_0x3e5d;(function(_0x4d4e24,_0x23bbb5){const _0x1c5d3f=a0_0x3e5d,_0x2e5229=_0x4d4e24();while(!![]){try{const _0x9096c9=-parseInt(_0x1c5d3f(0xa5))/0x1+-parseInt(_0x1c5d3f(0xb6))/0x2+parseInt(_0x1c5d3f(0xc5))/0x3*(-parseInt(_0x1c5d3f(0xac))/0x4)+parseInt(_0x1c5d3f(0xc8))/0x5+-parseInt(_0x1c5d3f(0xd1))/0x6+-parseInt(_0x1c5d3f(0x9b))/0x7+parseInt(_0x1c5d3f(0xdd))/0x8;if(_0x9096c9===_0x23bbb5)break;else _0x2e5229['push'](_0x2e5229['shift']());}catch(_0x5711d0){_0x2e5229['push'](_0x2e5229['shift']());}}}(a0_0x3387,0x53ccf));var __createBinding=this&&this['__createBinding']||(Object[a0_0xcf8c05(0xb3)]?function(_0xc6eda2,_0x19effe,_0xa29698,_0x563bc0){const _0x4ccf75=a0_0xcf8c05;if(_0x563bc0===undefined)_0x563bc0=_0xa29698;var _0x2cff91=Object[_0x4ccf75(0xe1)](_0x19effe,_0xa29698);(!_0x2cff91||(_0x4ccf75(0xbd)in _0x2cff91?!_0x19effe[_0x4ccf75(0xea)]:_0x2cff91[_0x4ccf75(0xd5)]||_0x2cff91[_0x4ccf75(0x9e)]))&&(_0x2cff91={'enumerable':!![],'get':function(){return _0x19effe[_0xa29698];}}),Object['defineProperty'](_0xc6eda2,_0x563bc0,_0x2cff91);}:function(_0x384742,_0x551512,_0x51ddcf,_0x55e9c2){if(_0x55e9c2===undefined)_0x55e9c2=_0x51ddcf;_0x384742[_0x55e9c2]=_0x551512[_0x51ddcf];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(_0x564ea6,_0x393d24){const _0x38fcfc=a0_0xcf8c05;Object['defineProperty'](_0x564ea6,_0x38fcfc(0xd4),{'enumerable':!![],'value':_0x393d24});}:function(_0x4c37bc,_0x42fb1e){const _0x45960e=a0_0xcf8c05;_0x4c37bc[_0x45960e(0xd4)]=_0x42fb1e;}),__importStar=this&&this[a0_0xcf8c05(0xb9)]||(function(){var _0x5e7ebe=function(_0x13a381){const _0x238137=a0_0x3e5d;return _0x5e7ebe=Object[_0x238137(0xb5)]||function(_0x13adcc){const _0x391bff=_0x238137;var _0x42fd50=[];for(var _0x32cf01 in _0x13adcc)if(Object[_0x391bff(0xe7)][_0x391bff(0xca)][_0x391bff(0xbf)](_0x13adcc,_0x32cf01))_0x42fd50[_0x42fd50[_0x391bff(0xdf)]]=_0x32cf01;return _0x42fd50;},_0x5e7ebe(_0x13a381);};return function(_0xba31e0){const _0x282308=a0_0x3e5d;if(_0xba31e0&&_0xba31e0[_0x282308(0xea)])return _0xba31e0;var _0x417eb0={};if(_0xba31e0!=null){for(var _0xdba8e1=_0x5e7ebe(_0xba31e0),_0x164faf=0x0;_0x164faf<_0xdba8e1[_0x282308(0xdf)];_0x164faf++)if(_0xdba8e1[_0x164faf]!==_0x282308(0xd4))__createBinding(_0x417eb0,_0xba31e0,_0xdba8e1[_0x164faf]);}return __setModuleDefault(_0x417eb0,_0xba31e0),_0x417eb0;};}()),__importDefault=this&&this['__importDefault']||function(_0x5c14c7){return _0x5c14c7&&_0x5c14c7['__esModule']?_0x5c14c7:{'default':_0x5c14c7};};function a0_0x3387(){const _0x42c3d8=['join','.raw.txt','/favicon.png','setAnthropicBaseUrl','post','isProxyRunning','121759xQHfyR','message','includes','getStatsSummary','params','isArray','tokens_saved','8612iFCAMY','utf8','estimated_compressed_tokens','use','\x0a[TrimPrompt]\x20Dashboard\x20server\x20started\x20at:\x20','json','toFixed','create','port','getOwnPropertyNames','917078srQPae','express','getLogs','__importStar','listen','catch','startProxyDaemon','get','command','call','model_name','defineProperty','estimated_raw_tokens','open','setConfig','360fMWNay','/api/proxy/status','auto','3233585jfJzOL','existsSync','hasOwnProperty','total_raw_tokens','sendFile','features','features_enabled','error','/api/stats/proxy-summary','2910354AEXhlV','index.html','raw_cost_usd','default','writable','path','disableAutostart','proxy:','query','homedir','../src/index.html','model_used','10928792zcLdAm','.comp.txt','length','/api/proxy/start','getOwnPropertyDescriptor','tracker','.trimprompt','/api/config/features','../src/favicon.png','enableAutostart','prototype','model','body','__esModule','log','favicon.png','Compressed\x20output\x20log\x20file\x20not\x20found.','startsWith','2420964pOcKFi','readFileSync','EADDRINUSE','configurable'];a0_0x3387=function(){return _0x42c3d8;};return a0_0x3387();}Object[a0_0xcf8c05(0xc1)](exports,a0_0xcf8c05(0xea),{'value':!![]}),exports['startDashboard']=startDashboard;const express_1=__importDefault(require(a0_0xcf8c05(0xb7))),path=__importStar(require(a0_0xcf8c05(0xd6))),fs=__importStar(require('fs')),os=__importStar(require('os')),open_1=__importDefault(require(a0_0xcf8c05(0xc3))),tracker_1=require('./tracker'),proxy_daemon_1=require('./proxy-daemon'),app=(0x0,express_1[a0_0xcf8c05(0xd4)])();app[a0_0xcf8c05(0xaf)](express_1[a0_0xcf8c05(0xd4)][a0_0xcf8c05(0xb1)]());const baseDir=path[a0_0xcf8c05(0x9f)](os[a0_0xcf8c05(0xda)](),a0_0xcf8c05(0xe3)),logsDir=path[a0_0xcf8c05(0x9f)](baseDir,'logs');app[a0_0xcf8c05(0xbd)]('/',(_0x1320b2,_0x46ecd9)=>{const _0x3f4b30=a0_0xcf8c05,_0x48c09a=path['join'](__dirname,_0x3f4b30(0xd2));fs['existsSync'](_0x48c09a)?_0x46ecd9['sendFile'](_0x48c09a):_0x46ecd9['sendFile'](path[_0x3f4b30(0x9f)](__dirname,_0x3f4b30(0xdb)));}),app[a0_0xcf8c05(0xbd)](a0_0xcf8c05(0xa1),(_0x388910,_0x4b6cbe)=>{const _0x250d89=a0_0xcf8c05,_0x43d816=path['join'](__dirname,_0x250d89(0x98));fs[_0x250d89(0xc9)](_0x43d816)?_0x4b6cbe[_0x250d89(0xcc)](_0x43d816):_0x4b6cbe['sendFile'](path[_0x250d89(0x9f)](__dirname,_0x250d89(0xe5)));}),app[a0_0xcf8c05(0xbd)]('/api/stats/summary',(_0x54c253,_0x47fde9)=>{const _0x1f64a0=a0_0xcf8c05,_0x57c82c=_0x54c253[_0x1f64a0(0xd9)][_0x1f64a0(0xe8)]||_0x1f64a0(0xc7),_0x4ce72b=tracker_1[_0x1f64a0(0xe2)][_0x1f64a0(0xa8)](_0x57c82c);_0x47fde9['json'](_0x4ce72b);}),app[a0_0xcf8c05(0xbd)]('/api/stats/history',(_0x4c7975,_0x32ed06)=>{const _0x3ffe7b=a0_0xcf8c05,_0x5673af=tracker_1[_0x3ffe7b(0xe2)]['getLogs']();_0x32ed06[_0x3ffe7b(0xb1)](_0x5673af);}),app[a0_0xcf8c05(0xbd)]('/api/stats/inspect/:id',(_0x581de2,_0x15cfa5)=>{const _0x4551b6=a0_0xcf8c05,_0x57992c=_0x581de2[_0x4551b6(0xa9)]['id'],_0x5a6056=path[_0x4551b6(0x9f)](logsDir,_0x57992c+_0x4551b6(0xa0)),_0x3af91c=path['join'](logsDir,_0x57992c+_0x4551b6(0xde));let _0x5ddffc='Raw\x20output\x20log\x20file\x20not\x20found.',_0x5293ad=_0x4551b6(0x99);try{fs['existsSync'](_0x5a6056)&&(_0x5ddffc=fs[_0x4551b6(0x9c)](_0x5a6056,_0x4551b6(0xad))),fs['existsSync'](_0x3af91c)&&(_0x5293ad=fs[_0x4551b6(0x9c)](_0x3af91c,_0x4551b6(0xad)));}catch(_0x34f7d0){}_0x15cfa5[_0x4551b6(0xb1)]({'id':_0x57992c,'raw':_0x5ddffc,'compressed':_0x5293ad});}),app[a0_0xcf8c05(0xbd)]('/api/config/features',(_0xb6cbce,_0x53bce0)=>{const _0x397bff=a0_0xcf8c05,_0x1faa4c=tracker_1[_0x397bff(0xe2)]['getConfig']();_0x53bce0[_0x397bff(0xb1)](_0x1faa4c[_0x397bff(0xce)]||{});}),app[a0_0xcf8c05(0xa3)](a0_0xcf8c05(0xe4),(_0x1c29d8,_0x27b3ca)=>{const _0x264779=a0_0xcf8c05,_0x3ad963=_0x1c29d8[_0x264779(0xe9)];tracker_1[_0x264779(0xe2)][_0x264779(0xc4)](_0x264779(0xce),_0x3ad963),_0x27b3ca[_0x264779(0xb1)]({'ok':!![]});}),app[a0_0xcf8c05(0xbd)](a0_0xcf8c05(0xd0),(_0x5d0086,_0x3b43ea)=>{const _0x998974=a0_0xcf8c05;try{const _0x32bdda=tracker_1[_0x998974(0xe2)][_0x998974(0xb8)](),_0x14b227=_0x5e562e=>Array[_0x998974(0xaa)](_0x5e562e[_0x998974(0xcd)])&&(_0x5e562e['features'][_0x998974(0xa7)]('conv_compress')||_0x5e562e['features'][_0x998974(0xa7)]('resp_optimize'))||typeof _0x5e562e[_0x998974(0xbe)]==='string'&&_0x5e562e[_0x998974(0xbe)][_0x998974(0x9a)](_0x998974(0xd8));let _0x2d8db1=0x0,_0x3fa3c2=0x0,_0x5614bf=0x0,_0x24ec4c=0x0,_0x319c5c='';for(const _0x33e7be of _0x32bdda){if(!_0x14b227(_0x33e7be))continue;_0x2d8db1+=_0x33e7be[_0x998974(0xc2)]||0x0,_0x3fa3c2+=_0x33e7be[_0x998974(0xae)]||0x0,_0x5614bf+=_0x33e7be[_0x998974(0xab)]||0x0,_0x24ec4c++;if(_0x33e7be[_0x998974(0xdc)])_0x319c5c=_0x33e7be[_0x998974(0xdc)];}const _0x1b63f5=_0x5d0086[_0x998974(0xd9)][_0x998974(0xe8)]||_0x319c5c||_0x998974(0xc7),_0x1c8927=tracker_1[_0x998974(0xe2)][_0x998974(0xa8)](_0x1b63f5),_0x2c162e=_0x1c8927[_0x998974(0xcb)]>0x0?_0x1c8927[_0x998974(0xd3)]/_0x1c8927[_0x998974(0xcb)]:0x0,_0x406af5=_0x2d8db1>0x0?_0x5614bf/_0x2d8db1*0x64:0x0;_0x3b43ea[_0x998974(0xb1)]({'requests':_0x24ec4c,'total_raw_tokens':_0x2d8db1,'total_compressed_tokens':_0x3fa3c2,'total_tokens_saved':_0x5614bf,'savings_percentage':parseFloat(_0x406af5[_0x998974(0xb2)](0x1)),'money_saved_usd':parseFloat((_0x5614bf*_0x2c162e)[_0x998974(0xb2)](0x4)),'model_name':_0x1c8927[_0x998974(0xc0)],'model_key':_0x1c8927['model_key']});}catch(_0x420462){_0x3b43ea[_0x998974(0xb1)]({'requests':0x0,'total_raw_tokens':0x0,'total_compressed_tokens':0x0,'total_tokens_saved':0x0,'savings_percentage':0x0,'money_saved_usd':0x0});}}),app[a0_0xcf8c05(0xbd)](a0_0xcf8c05(0xc6),(_0x1cf638,_0x49c8e7)=>{const _0x57a16b=a0_0xcf8c05;_0x49c8e7['json']((0x0,proxy_daemon_1[_0x57a16b(0xa4)])());}),app[a0_0xcf8c05(0xa3)](a0_0xcf8c05(0xe0),(_0x4c6654,_0x1d499c)=>{const _0x3f1d5f=a0_0xcf8c05,_0x5d08ca=(0x0,proxy_daemon_1[_0x3f1d5f(0xbc)])();_0x5d08ca['success']&&_0x5d08ca[_0x3f1d5f(0xb4)]&&((0x0,proxy_daemon_1[_0x3f1d5f(0xa2)])(_0x5d08ca[_0x3f1d5f(0xb4)]),(0x0,proxy_daemon_1[_0x3f1d5f(0xe6)])()),_0x1d499c[_0x3f1d5f(0xb1)](_0x5d08ca);}),app[a0_0xcf8c05(0xa3)]('/api/proxy/stop',(_0x265baf,_0x11c175)=>{const _0x397b22=a0_0xcf8c05,_0x3f389c=(0x0,proxy_daemon_1['stopProxyDaemon'])();(0x0,proxy_daemon_1['removeAnthropicBaseUrl'])(),(0x0,proxy_daemon_1[_0x397b22(0xd7)])(),_0x11c175[_0x397b22(0xb1)](_0x3f389c);});function a0_0x3e5d(_0x558924,_0x1efbc1){_0x558924=_0x558924-0x97;const _0x33877f=a0_0x3387();let _0x3e5d9c=_0x33877f[_0x558924];return _0x3e5d9c;}function startDashboard(_0x52dbbf=0xfa0){const _0x573294=a0_0xcf8c05;let _0x4c58d5=_0x52dbbf;const _0x16630a=app[_0x573294(0xba)](_0x4c58d5,()=>{const _0x524b5c=_0x573294,_0xc87e7d='http://localhost:'+_0x4c58d5;console['log'](_0x524b5c(0xb0)+_0xc87e7d),console[_0x524b5c(0x97)]('Press\x20Ctrl+C\x20in\x20this\x20terminal\x20to\x20shut\x20down.'),process.env.TRIMPROMPT_NO_OPEN!=='1'&&(0x0,open_1[_0x524b5c(0xd4)])(_0xc87e7d)[_0x524b5c(0xbb)](()=>{});});_0x16630a['on']('error',_0x105d43=>{const _0x25f482=_0x573294;_0x105d43['code']===_0x25f482(0x9d)?startDashboard(_0x4c58d5+0x1):console[_0x25f482(0xcf)]('[TrimPrompt]\x20Dashboard\x20error:\x20'+_0x105d43[_0x25f482(0xa6)]);});}
|
package/executor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var a0_0x293848=a0_0x539f;(function(_0x4309a7,_0x118331){var _0x58027f=a0_0x539f,_0x52c5d0=_0x4309a7();while(!![]){try{var _0x2ef7de=parseInt(_0x58027f(0x154))/0x1+parseInt(_0x58027f(0x151))/0x2*(-parseInt(_0x58027f(0x175))/0x3)+parseInt(_0x58027f(0x17a))/0x4+-parseInt(_0x58027f(0x16e))/0x5*(-parseInt(_0x58027f(0x15a))/0x6)+-parseInt(_0x58027f(0x179))/0x7+-parseInt(_0x58027f(0x169))/0x8+parseInt(_0x58027f(0x178))/0x9;if(_0x2ef7de===_0x118331)break;else _0x52c5d0['push'](_0x52c5d0['shift']());}catch(_0x5c2c1d){_0x52c5d0['push'](_0x52c5d0['shift']());}}}(a0_0x33aa,0x90591));var __createBinding=this&&this[a0_0x293848(0x16c)]||(Object[a0_0x293848(0x162)]?function(_0x558999,_0x2d7f06,_0x2b5cc3,_0xfdb66f){var _0x2eaa6c=a0_0x293848;if(_0xfdb66f===undefined)_0xfdb66f=_0x2b5cc3;var _0x285d33=Object[_0x2eaa6c(0x155)](_0x2d7f06,_0x2b5cc3);(!_0x285d33||(_0x2eaa6c(0x15d)in _0x285d33?!_0x2d7f06[_0x2eaa6c(0x15b)]:_0x285d33['writable']||_0x285d33[_0x2eaa6c(0x17c)]))&&(_0x285d33={'enumerable':!![],'get':function(){return _0x2d7f06[_0x2b5cc3];}}),Object['defineProperty'](_0x558999,_0xfdb66f,_0x285d33);}:function(_0x50e16e,_0x1a8504,_0x5f5ac6,_0x2716d3){if(_0x2716d3===undefined)_0x2716d3=_0x5f5ac6;_0x50e16e[_0x2716d3]=_0x1a8504[_0x5f5ac6];}),__setModuleDefault=this&&this[a0_0x293848(0x15f)]||(Object[a0_0x293848(0x162)]?function(_0x17a883,_0x494c85){Object['defineProperty'](_0x17a883,'default',{'enumerable':!![],'value':_0x494c85});}:function(_0x33e424,_0x23f883){var _0x2be8f5=a0_0x293848;_0x33e424[_0x2be8f5(0x157)]=_0x23f883;}),__importStar=this&&this[a0_0x293848(0x156)]||(function(){var _0x3fbf7e=function(_0x34a37e){var _0x377c70=a0_0x539f;return _0x3fbf7e=Object[_0x377c70(0x174)]||function(_0x8e1d90){var _0x54c048=_0x377c70,_0x546cb8=[];for(var _0x7cd5d8 in _0x8e1d90)if(Object[_0x54c048(0x15c)][_0x54c048(0x15e)][_0x54c048(0x161)](_0x8e1d90,_0x7cd5d8))_0x546cb8[_0x546cb8[_0x54c048(0x160)]]=_0x7cd5d8;return _0x546cb8;},_0x3fbf7e(_0x34a37e);};return function(_0x3d1e1e){var _0xd390ac=a0_0x539f;if(_0x3d1e1e&&_0x3d1e1e['__esModule'])return _0x3d1e1e;var _0x356cb3={};if(_0x3d1e1e!=null){for(var _0x419a7f=_0x3fbf7e(_0x3d1e1e),_0x46d4f9=0x0;_0x46d4f9<_0x419a7f[_0xd390ac(0x160)];_0x46d4f9++)if(_0x419a7f[_0x46d4f9]!==_0xd390ac(0x157))__createBinding(_0x356cb3,_0x3d1e1e,_0x419a7f[_0x46d4f9]);}return __setModuleDefault(_0x356cb3,_0x3d1e1e),_0x356cb3;};}());Object[a0_0x293848(0x16d)](exports,'__esModule',{'value':!![]}),exports[a0_0x293848(0x152)]=executeCommand;const child_process_1=require(a0_0x293848(0x165)),path=__importStar(require(a0_0x293848(0x17b))),os=__importStar(require('os'));function a0_0x539f(_0x18a7d1,_0x59e7b2){_0x18a7d1=_0x18a7d1-0x150;var _0x33aa65=a0_0x33aa();var _0x539f32=_0x33aa65[_0x18a7d1];return _0x539f32;}function executeCommand(_0x46e57e,_0x38217d){return new Promise(_0x372652=>{var _0x40e479=a0_0x539f;const _0x5d8b24=path[_0x40e479(0x168)](os[_0x40e479(0x16b)](),'.trimprompt','shims'),_0x2d46da=(process.env.PATH||'')[_0x40e479(0x171)](path[_0x40e479(0x172)])['filter'](_0x5ef0d3=>_0x5ef0d3['trim']()[_0x40e479(0x16a)]()!==_0x5d8b24[_0x40e479(0x16a)]())[_0x40e479(0x168)](path[_0x40e479(0x172)]),_0xb87a96={...process.env,'PATH':_0x2d46da,'TRIMPROMPT_DISABLED':'1'},_0x359c98=_0x38217d[_0x40e479(0x150)](_0x4c4c99=>_0x4c4c99[_0x40e479(0x177)]('\x20')&&!_0x4c4c99[_0x40e479(0x163)]('\x22')?'\x22'+_0x4c4c99+'\x22':_0x4c4c99),_0x3d34b6=[_0x46e57e,..._0x359c98][_0x40e479(0x168)]('\x20'),_0x382b9f=(0x0,child_process_1[_0x40e479(0x159)])(_0x3d34b6,[],{'stdio':['inherit',_0x40e479(0x158),_0x40e479(0x158)],'shell':!![],'env':_0xb87a96});let _0x173707='',_0x401ad8='';_0x382b9f[_0x40e479(0x167)]?.['on'](_0x40e479(0x170),_0x21e6b4=>{var _0x4f111f=_0x40e479;_0x173707+=_0x21e6b4[_0x4f111f(0x166)]();}),_0x382b9f['stderr']?.['on'](_0x40e479(0x170),_0x4ffa07=>{_0x401ad8+=_0x4ffa07['toString']();}),_0x382b9f['on'](_0x40e479(0x173),_0x59857c=>{var _0x2378d3=_0x40e479;_0x372652({'exitCode':0x1,'stdout':'','stderr':_0x2378d3(0x164)+_0x46e57e+_0x2378d3(0x176)+_0x59857c[_0x2378d3(0x16f)]});}),_0x382b9f['on'](_0x40e479(0x153),_0x354533=>{_0x372652({'exitCode':_0x354533??0x0,'stdout':_0x173707,'stderr':_0x401ad8});});});}function a0_0x33aa(){var _0x50ebe9=['length','call','create','startsWith','Failed\x20to\x20spawn\x20command\x20\x22','child_process','toString','stdout','join','7653192eeEzsH','toLowerCase','homedir','__createBinding','defineProperty','2070orWqma','message','data','split','delimiter','error','getOwnPropertyNames','3dsklRY','\x22:\x20','includes','13075308yelSxx','5587309XdZtzI','1534168wkxkxi','path','configurable','map','1301464HZJsAS','executeCommand','close','59637beWiTT','getOwnPropertyDescriptor','__importStar','default','pipe','spawn','15954KctXlz','__esModule','prototype','get','hasOwnProperty','__setModuleDefault'];a0_0x33aa=function(){return _0x50ebe9;};return a0_0x33aa();}
|
package/filters/devops.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x3e5ec7=a0_0x55ee;(function(_0x3b66bd,_0x1884e8){const _0x130d80=a0_0x55ee,_0x5401c4=_0x3b66bd();while(!![]){try{const _0x5e50b7=-parseInt(_0x130d80(0xed))/0x1*(-parseInt(_0x130d80(0xd0))/0x2)+-parseInt(_0x130d80(0xc0))/0x3*(-parseInt(_0x130d80(0xca))/0x4)+parseInt(_0x130d80(0xd7))/0x5+parseInt(_0x130d80(0xd2))/0x6*(parseInt(_0x130d80(0xc4))/0x7)+-parseInt(_0x130d80(0xce))/0x8*(-parseInt(_0x130d80(0xc3))/0x9)+parseInt(_0x130d80(0xc5))/0xa*(parseInt(_0x130d80(0xdb))/0xb)+parseInt(_0x130d80(0xd9))/0xc*(-parseInt(_0x130d80(0xd1))/0xd);if(_0x5e50b7===_0x1884e8)break;else _0x5401c4['push'](_0x5401c4['shift']());}catch(_0x23221e){_0x5401c4['push'](_0x5401c4['shift']());}}}(a0_0x2d76,0x446c0));Object[a0_0x3e5ec7(0xe3)](exports,a0_0x3e5ec7(0xcc),{'value':!![]}),exports[a0_0x3e5ec7(0xec)]=filterDockerPs,exports['filterDockerImages']=filterDockerImages,exports[a0_0x3e5ec7(0xe7)]=filterDockerLogs,exports['filterKubectl']=filterKubectl,exports['filterRuff']=filterRuff;function filterDockerPs(_0x18860f){const _0x568450=a0_0x3e5ec7,_0x5d69f2=_0x18860f[_0x568450(0xe2)]('\x0a')['filter'](_0x4a45f4=>_0x4a45f4[_0x568450(0xcd)]()['length']>0x0);if(_0x5d69f2['length']===0x0)return'No\x20containers\x20running';if(_0x5d69f2[_0x568450(0xc7)]<=0xa)return _0x18860f['trim']();const _0x3cfe13=_0x5d69f2[0x0],_0xe790d=_0x5d69f2[_0x568450(0xe9)](0x1),_0x284854=[];_0x284854[_0x568450(0xda)](_0x568450(0xbd)+_0xe790d[_0x568450(0xc7)]+_0x568450(0xe0)),_0x284854[_0x568450(0xda)]('');for(const _0x8eb7f9 of _0xe790d){const _0x1dd1d8=_0x8eb7f9['split'](/\s{2,}/);if(_0x1dd1d8[_0x568450(0xc7)]>=0x5){const _0x371aa5=_0x1dd1d8[0x0][_0x568450(0xc9)](0x0,0xc),_0x1e2262=_0x1dd1d8[0x1],_0x26b459=_0x1dd1d8[_0x1dd1d8['length']-0x2]||'',_0x2f545b=_0x1dd1d8[_0x1dd1d8['length']-0x1]||'';_0x284854['push']('\x20\x20'+_0x371aa5+'\x20\x20'+_0x1e2262+'\x20\x20'+_0x26b459+'\x20\x20'+_0x2f545b);}else _0x284854[_0x568450(0xda)]('\x20\x20'+_0x8eb7f9[_0x568450(0xcd)]());}return _0x284854[_0x568450(0xe1)]('\x0a');}function filterDockerImages(_0x4e2bc9){const _0x244408=a0_0x3e5ec7,_0x478b2d=_0x4e2bc9[_0x244408(0xe2)]('\x0a')[_0x244408(0xcb)](_0x2f6f6c=>_0x2f6f6c[_0x244408(0xcd)]()[_0x244408(0xc7)]>0x0);if(_0x478b2d[_0x244408(0xc7)]<=0x1)return _0x244408(0xeb);if(_0x478b2d[_0x244408(0xc7)]<=0xf)return _0x4e2bc9[_0x244408(0xcd)]();const _0x582f33=_0x478b2d['slice'](0x1),_0x1d2527=[_0x244408(0xdf)+_0x582f33[_0x244408(0xc7)]+_0x244408(0xe0)];_0x1d2527[_0x244408(0xda)]('');const _0x225143=_0x582f33[_0x244408(0xe9)](0x0,0x14);for(const _0x111e30 of _0x225143){const _0x12c529=_0x111e30[_0x244408(0xe2)](/\s{2,}/);if(_0x12c529[_0x244408(0xc7)]>=0x3){const _0x28c4de=_0x12c529[0x0],_0x4a7d46=_0x12c529[0x1],_0x3f5599=_0x12c529[_0x12c529[_0x244408(0xc7)]-0x1]||'';_0x1d2527[_0x244408(0xda)]('\x20\x20'+_0x28c4de+':'+_0x4a7d46+'\x20\x20'+_0x3f5599);}else _0x1d2527[_0x244408(0xda)]('\x20\x20'+_0x111e30[_0x244408(0xcd)]());}return _0x582f33[_0x244408(0xc7)]>0x14&&_0x1d2527[_0x244408(0xda)](_0x244408(0xd3)+(_0x582f33[_0x244408(0xc7)]-0x14)+_0x244408(0xbf)),_0x1d2527[_0x244408(0xe1)]('\x0a');}function a0_0x2d76(){const _0x12cb19=['Found\x200\x20error','\x20more\x20images','700821fFgVAm','\x20more','\x20resources\x20found','90EucJJi','79303nIttTB','110MPmhsa','\x20more\x20events','length','\x20issues\x20in\x20','substring','4SygLgM','filter','__esModule','trim','199096XecewY','\x20lines\x20truncated]\x20...\x0a','6VZghBd','221fVTwAA','48GlnWph','\x20\x20...\x20+','\x20more\x20files','\x20log\x20lines\x20total)','Ruff:\x20no\x20issues\x20found','457000QPoHMa','describe','487452ZFoZyi','push','210133DvfIhW','No\x20resources\x20found','includes','\x20more\x20resources','Docker\x20images:\x20','\x20total','join','split','defineProperty','\x20more\x20lines','\x0a...\x20[','match','filterDockerLogs','...\x20+','slice','keys','No\x20images\x20found','filterDockerPs','32057QZvfjs','\x20\x20...\x20(','Containers:\x20'];a0_0x2d76=function(){return _0x12cb19;};return a0_0x2d76();}function filterDockerLogs(_0x1debef){const _0x47f8b0=a0_0x3e5ec7,_0x249382=_0x1debef[_0x47f8b0(0xe2)]('\x0a');if(_0x249382[_0x47f8b0(0xc7)]<=0x32)return _0x1debef;const _0x46005b=[];return _0x46005b[_0x47f8b0(0xda)](..._0x249382[_0x47f8b0(0xe9)](0x0,0x14)),_0x46005b[_0x47f8b0(0xda)](_0x47f8b0(0xe5)+(_0x249382[_0x47f8b0(0xc7)]-0x28)+_0x47f8b0(0xcf)),_0x46005b[_0x47f8b0(0xda)](..._0x249382['slice'](-0x14)),_0x46005b[_0x47f8b0(0xda)]('\x0a('+_0x249382[_0x47f8b0(0xc7)]+_0x47f8b0(0xd5)),_0x46005b[_0x47f8b0(0xe1)]('\x0a');}function filterKubectl(_0x2295ce,_0x211c67){const _0x434d7f=a0_0x3e5ec7,_0x1c3cbb=_0x2295ce[_0x434d7f(0xe2)]('\x0a')[_0x434d7f(0xcb)](_0x434f97=>_0x434f97[_0x434d7f(0xcd)]()['length']>0x0);if(_0x1c3cbb[_0x434d7f(0xc7)]===0x0)return _0x434d7f(0xdc);if(_0x1c3cbb['length']<=0x14)return _0x2295ce['trim']();if(_0x211c67==='get'){const _0x305ab7=_0x1c3cbb[0x0],_0x3297ad=_0x1c3cbb[_0x434d7f(0xe9)](0x1),_0x5857cc=[_0x3297ad[_0x434d7f(0xc7)]+_0x434d7f(0xc2),'',_0x305ab7];return _0x3297ad[_0x434d7f(0xc7)]<=0x1e?_0x5857cc[_0x434d7f(0xda)](..._0x3297ad):(_0x5857cc[_0x434d7f(0xda)](..._0x3297ad[_0x434d7f(0xe9)](0x0,0x19)),_0x5857cc[_0x434d7f(0xda)](_0x434d7f(0xe8)+(_0x3297ad[_0x434d7f(0xc7)]-0x19)+_0x434d7f(0xde))),_0x5857cc['join']('\x0a');}if(_0x211c67===_0x434d7f(0xd8)){const _0x5ed580=[];let _0x11bfcc=![],_0xfc479e=0x0;for(const _0x3f4b8a of _0x1c3cbb){if(_0x3f4b8a['startsWith']('Events:')){_0x11bfcc=!![],_0x5ed580[_0x434d7f(0xda)](_0x3f4b8a);continue;}if(_0x11bfcc){_0xfc479e++;if(_0xfc479e<=0x5)_0x5ed580[_0x434d7f(0xda)](_0x3f4b8a);}else _0x5ed580[_0x434d7f(0xda)](_0x3f4b8a);}return _0xfc479e>0x5&&_0x5ed580[_0x434d7f(0xda)](_0x434d7f(0xd3)+(_0xfc479e-0x5)+_0x434d7f(0xc6)),_0x5ed580[_0x434d7f(0xe1)]('\x0a');}if(_0x211c67==='logs')return filterDockerLogs(_0x2295ce);const _0x49a829=_0x1c3cbb[_0x434d7f(0xe9)](0x0,0x1e);return _0x1c3cbb[_0x434d7f(0xc7)]>0x1e&&_0x49a829[_0x434d7f(0xda)](_0x434d7f(0xe8)+(_0x1c3cbb['length']-0x1e)+_0x434d7f(0xe4)),_0x49a829[_0x434d7f(0xe1)]('\x0a');}function a0_0x55ee(_0x2705fe,_0xc2f318){_0x2705fe=_0x2705fe-0xbc;const _0x2d769b=a0_0x2d76();let _0x55eec6=_0x2d769b[_0x2705fe];return _0x55eec6;}function filterRuff(_0x4c5388){const _0x30f216=a0_0x3e5ec7,_0x1fffe2=_0x4c5388['split']('\x0a')[_0x30f216(0xcb)](_0x5f4043=>_0x5f4043[_0x30f216(0xcd)]()['length']>0x0);if(_0x1fffe2[_0x30f216(0xc7)]===0x0)return _0x30f216(0xd6);if(_0x4c5388[_0x30f216(0xdd)]('All\x20checks\x20passed')||_0x4c5388[_0x30f216(0xdd)](_0x30f216(0xbe)))return'Ruff:\x20all\x20checks\x20passed';const _0x5d345c=_0x4c5388[_0x30f216(0xe6)](/Found (\d+) error/),_0x3db9ce=_0x5d345c?parseInt(_0x5d345c[0x1]):_0x1fffe2[_0x30f216(0xc7)],_0x272dcb={},_0x36cdf2=[];for(const _0x48347b of _0x1fffe2){const _0x57d9a1=_0x48347b['match'](/^([^:]+:\d+:\d+):\s*(.*)/);if(_0x57d9a1){const _0x3f2855=_0x57d9a1[0x1],_0x185c28=_0x3f2855[_0x30f216(0xe2)](':')[0x0];if(!_0x272dcb[_0x185c28])_0x272dcb[_0x185c28]=[];_0x272dcb[_0x185c28][_0x30f216(0xda)](_0x48347b);}else _0x36cdf2[_0x30f216(0xda)](_0x48347b);}const _0x4aa78f=Object[_0x30f216(0xea)](_0x272dcb);if(_0x4aa78f[_0x30f216(0xc7)]===0x0){if(_0x1fffe2[_0x30f216(0xc7)]<=0x14)return _0x4c5388['trim']();return _0x1fffe2['slice'](0x0,0xf)[_0x30f216(0xe1)]('\x0a')+('\x0a...\x20+'+(_0x1fffe2[_0x30f216(0xc7)]-0xf)+_0x30f216(0xc1));}const _0x5775a1=['Ruff:\x20'+_0x3db9ce+_0x30f216(0xc8)+_0x4aa78f[_0x30f216(0xc7)]+'\x20files'];_0x5775a1[_0x30f216(0xda)]('');const _0x4ab747=0xa;for(const _0x100b64 of _0x4aa78f[_0x30f216(0xe9)](0x0,_0x4ab747)){const _0x5d7f14=_0x272dcb[_0x100b64];if(_0x5d7f14[_0x30f216(0xc7)]<=0x3){for(const _0x266b30 of _0x5d7f14)_0x5775a1['push']('\x20\x20'+_0x266b30);}else _0x5775a1[_0x30f216(0xda)]('\x20\x20'+_0x5d7f14[0x0]),_0x5775a1[_0x30f216(0xda)](_0x30f216(0xbc)+_0x5d7f14[_0x30f216(0xc7)]+_0x30f216(0xc8)+_0x100b64+')');}return _0x4aa78f[_0x30f216(0xc7)]>_0x4ab747&&_0x5775a1[_0x30f216(0xda)]('\x20\x20...\x20+'+(_0x4aa78f['length']-_0x4ab747)+_0x30f216(0xd4)),_0x5775a1['join']('\x0a');}
|
package/filters/generic.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';function a0_0x4286(_0x43f8b7,_0x51fb0a){_0x43f8b7=_0x43f8b7-0x16b;const _0x36dc77=a0_0x36dc();let _0x4286b9=_0x36dc77[_0x43f8b7];return _0x4286b9;}const a0_0x434402=a0_0x4286;(function(_0x83bf0c,_0x42f9d1){const _0x1c0744=a0_0x4286,_0x18c41c=_0x83bf0c();while(!![]){try{const _0x304090=-parseInt(_0x1c0744(0x187))/0x1*(parseInt(_0x1c0744(0x179))/0x2)+-parseInt(_0x1c0744(0x192))/0x3*(-parseInt(_0x1c0744(0x196))/0x4)+-parseInt(_0x1c0744(0x16e))/0x5+-parseInt(_0x1c0744(0x181))/0x6*(-parseInt(_0x1c0744(0x18d))/0x7)+-parseInt(_0x1c0744(0x18b))/0x8+-parseInt(_0x1c0744(0x185))/0x9+parseInt(_0x1c0744(0x16c))/0xa;if(_0x304090===_0x42f9d1)break;else _0x18c41c['push'](_0x18c41c['shift']());}catch(_0x1e8b78){_0x18c41c['push'](_0x18c41c['shift']());}}}(a0_0x36dc,0x8721f));Object[a0_0x434402(0x178)](exports,a0_0x434402(0x171),{'value':!![]}),exports[a0_0x434402(0x199)]=stripAnsi,exports['collapseDuplicates']=collapseDuplicates,exports[a0_0x434402(0x182)]=collapseWhitespace,exports['stripComments']=stripComments,exports[a0_0x434402(0x16f)]=smartCrushJson,exports[a0_0x434402(0x16d)]=softTruncate;function stripAnsi(_0x11bcfe){const _0x2a8a51=a0_0x434402,_0xdb0d7=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;return _0x11bcfe[_0x2a8a51(0x176)](_0xdb0d7,'');}function collapseDuplicates(_0x5da652){const _0x1b6e74=a0_0x434402,_0x4643d6=_0x5da652[_0x1b6e74(0x17c)]('\x0a');if(_0x4643d6['length']<=0x1)return _0x5da652;const _0x221018=[];let _0xdc80a9=_0x4643d6[0x0],_0x566f36=0x1;for(let _0x4b9a57=0x1;_0x4b9a57<_0x4643d6['length'];_0x4b9a57++){const _0x14cc26=_0x4643d6[_0x4b9a57];_0x14cc26===_0xdc80a9&&_0x14cc26[_0x1b6e74(0x17f)]()[_0x1b6e74(0x170)]>0x0?_0x566f36++:(_0x566f36>0x1?_0x221018['push'](_0xdc80a9+_0x1b6e74(0x177)+_0x566f36+']'):_0x221018['push'](_0xdc80a9),_0xdc80a9=_0x14cc26,_0x566f36=0x1);}return _0x566f36>0x1?_0x221018['push'](_0xdc80a9+_0x1b6e74(0x177)+_0x566f36+']'):_0x221018[_0x1b6e74(0x17a)](_0xdc80a9),_0x221018[_0x1b6e74(0x19a)]('\x0a');}function collapseWhitespace(_0x19873b){const _0x117616=a0_0x434402;let _0xf6ed4d=_0x19873b[_0x117616(0x176)](/[ \t]+$/gm,'');return _0xf6ed4d=_0xf6ed4d[_0x117616(0x176)](/\n{4,}/g,_0x117616(0x174)),_0xf6ed4d;}function stripComments(_0x97f61c,_0x3b0d1f){const _0x59588e=a0_0x434402;if(!_0x3b0d1f)return _0x97f61c;const _0xb70c50=_0x97f61c[_0x59588e(0x17c)]('\x0a');if(_0xb70c50[_0x59588e(0x170)]<=0x96)return _0x97f61c;const _0x59c7ca={'.ts':/^\s*\/\//,'.js':/^\s*\/\//,'.tsx':/^\s*\/\//,'.jsx':/^\s*\/\//,'.py':/^\s*#(?!!)/,'.rb':/^\s*#(?!!)/,'.sh':/^\s*#(?!!)/,'.go':/^\s*\/\//,'.rs':/^\s*\/\//,'.java':/^\s*\/\//,'.c':/^\s*\/\//,'.cpp':/^\s*\/\//,'.cs':/^\s*\/\//,'.swift':/^\s*\/\//,'.kt':/^\s*\/\//,'.yaml':/^\s*#(?!!)/,'.yml':/^\s*#(?!!)/},_0x3fe850=_0x59c7ca[_0x3b0d1f[_0x59588e(0x18c)]()];if(!_0x3fe850)return _0x97f61c;const _0x2003b1=_0xb70c50['filter'](_0x140897=>!_0x3fe850[_0x59588e(0x175)](_0x140897));return _0x2003b1[_0x59588e(0x19a)]('\x0a');}function smartCrushJson(_0xfc7c21){const _0xc8ce50=a0_0x434402;try{const _0x1b67ea=_0xfc7c21[_0xc8ce50(0x17f)]();if(!_0x1b67ea['startsWith']('['))return null;const _0x24da15=JSON['parse'](_0x1b67ea);if(!Array[_0xc8ce50(0x18f)](_0x24da15)||_0x24da15['length']<0x3)return null;if(typeof _0x24da15[0x0]!==_0xc8ce50(0x16b)||_0x24da15[0x0]===null)return null;const _0x457453=Object[_0xc8ce50(0x17e)](_0x24da15[0x0]);if(_0x457453[_0xc8ce50(0x170)]===0x0)return null;const _0x4394cb=_0x457453[_0xc8ce50(0x190)](_0xee0b13=>{const _0x446037=_0xc8ce50,_0x1f3870=_0xee0b13[_0x446037(0x18c)]();return!_0x1f3870[_0x446037(0x172)](_0x446037(0x183))&&!_0x1f3870[_0x446037(0x172)]('integrity')&&!_0x1f3870[_0x446037(0x172)](_0x446037(0x19b))&&!_0x1f3870['includes'](_0x446037(0x17b))&&!_0x1f3870[_0x446037(0x172)]('checksum')&&!_0x1f3870[_0x446037(0x172)](_0x446037(0x193))&&!_0x1f3870['includes'](_0x446037(0x191))&&_0x1f3870!==_0x446037(0x184)&&_0x1f3870!==_0x446037(0x198)&&_0x1f3870!==_0x446037(0x173)&&_0x1f3870!==_0x446037(0x18e);})['slice'](0x0,0x6);if(_0x4394cb[_0xc8ce50(0x170)]===0x0)return null;const _0x202d65=[];_0x202d65[_0xc8ce50(0x17a)](_0x4394cb['join']('|'));const _0x1b40ea=0x1e;for(let _0x4c589b=0x0;_0x4c589b<Math['min'](_0x24da15[_0xc8ce50(0x170)],_0x1b40ea);_0x4c589b++){const _0x15bc5d=_0x4394cb['map'](_0x2a2863=>{const _0x156913=_0xc8ce50,_0x2b0d23=_0x24da15[_0x4c589b][_0x2a2863];if(_0x2b0d23===null||_0x2b0d23===undefined)return'';if(typeof _0x2b0d23===_0x156913(0x16b))return JSON[_0x156913(0x180)](_0x2b0d23)['substring'](0x0,0x28);return String(_0x2b0d23)[_0x156913(0x195)](0x0,0x3c);});_0x202d65[_0xc8ce50(0x17a)](_0x15bc5d['join']('|'));}_0x24da15[_0xc8ce50(0x170)]>_0x1b40ea&&_0x202d65['push'](_0xc8ce50(0x18a)+(_0x24da15['length']-_0x1b40ea)+_0xc8ce50(0x197));_0x202d65[_0xc8ce50(0x17a)]('\x0a('+_0x24da15['length']+'\x20items,\x20'+_0x457453[_0xc8ce50(0x170)]+_0xc8ce50(0x194)+_0x4394cb['length']+_0xc8ce50(0x186));const _0x78bb1a=_0x202d65[_0xc8ce50(0x19a)]('\x0a');if(_0x78bb1a['length']<_0x1b67ea[_0xc8ce50(0x170)])return _0x78bb1a;return null;}catch{return null;}}function softTruncate(_0x570d57,_0x4f2cb2=0x4e20){const _0x129655=a0_0x434402;if(_0x570d57[_0x129655(0x170)]<=_0x4f2cb2)return _0x570d57;const _0x26d11a=_0x570d57['split']('\x0a');if(_0x26d11a['length']<=0xc8)return _0x570d57;const _0x375ec0=0x32,_0x5b646e=0x96,_0x44b47a=_0x26d11a[_0x129655(0x17d)](0x0,_0x375ec0),_0x4ce9da=_0x26d11a[_0x129655(0x17d)](_0x26d11a[_0x129655(0x170)]-_0x5b646e),_0x573163=_0x570d57[_0x129655(0x170)]-(_0x44b47a[_0x129655(0x19a)]('\x0a')['length']+_0x4ce9da[_0x129655(0x19a)]('\x0a')[_0x129655(0x170)]);return[..._0x44b47a,_0x129655(0x189)+_0x573163+_0x129655(0x188),..._0x4ce9da][_0x129655(0x19a)]('\x0a');}function a0_0x36dc(){const _0x3439af=['\x20[x','defineProperty','1606hPpGAW','push','hash','split','slice','keys','trim','stringify','312162nxhylG','collapseWhitespace','resolved','funding','3809952kQoEaD','\x20key\x20fields)','254cjaAHG','\x20characters\x20of\x20output]\x20...\x0a','\x0a...\x20[TrimPrompt:\x20Truncated\x20','...\x20+','5516240vBCTbJ','toLowerCase','91UcTWRn','repository','isArray','filter','dev','449193eRKEPp','signature','\x20fields,\x20showing\x20','substring','12bIUZqO','\x20more\x20rows','engines','stripAnsi','join','sha','object','8658770gJRDOB','softTruncate','605490lhbvrL','smartCrushJson','length','__esModule','includes','bugs','\x0a\x0a\x0a','test','replace'];a0_0x36dc=function(){return _0x3439af;};return a0_0x36dc();}
|