trimprompt 1.0.28 → 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 +1 -2
- 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 -1
package/proxy-conv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x40a803=a0_0x2356;(function(_0x1abde1,_0x2da495){const _0x5c9220=a0_0x2356,_0x64d9c2=_0x1abde1();while(!![]){try{const _0x1c108e=parseInt(_0x5c9220(0xfb))/0x1+parseInt(_0x5c9220(0xf7))/0x2*(parseInt(_0x5c9220(0xf2))/0x3)+-parseInt(_0x5c9220(0xfc))/0x4+parseInt(_0x5c9220(0xe6))/0x5+parseInt(_0x5c9220(0x102))/0x6*(-parseInt(_0x5c9220(0xeb))/0x7)+parseInt(_0x5c9220(0xed))/0x8+parseInt(_0x5c9220(0xfe))/0x9*(-parseInt(_0x5c9220(0x100))/0xa);if(_0x1c108e===_0x2da495)break;else _0x64d9c2['push'](_0x64d9c2['shift']());}catch(_0x4883ed){_0x64d9c2['push'](_0x64d9c2['shift']());}}}(a0_0x44bf,0xc690a));Object[a0_0x40a803(0x10c)](exports,'__esModule',{'value':!![]}),exports[a0_0x40a803(0x10a)]=compressConversation;const ROLE_WEIGHT={'system':0x1,'user':0.8,'assistant':0.5,'tool':0.3};function estimateTokens(_0x54165b){const _0x5061e3=a0_0x40a803;return Math[_0x5061e3(0xfa)](_0x54165b[_0x5061e3(0x107)]/0x4);}function blockText(_0x50b6f2){const _0x51fa7b=a0_0x40a803;if(!_0x50b6f2||typeof _0x50b6f2!==_0x51fa7b(0xf4))return'';if(_0x50b6f2[_0x51fa7b(0x103)]===_0x51fa7b(0x105)&&typeof _0x50b6f2[_0x51fa7b(0x105)]===_0x51fa7b(0xf8))return _0x50b6f2[_0x51fa7b(0x105)];if(_0x50b6f2['type']==='tool_result'){if(typeof _0x50b6f2[_0x51fa7b(0xff)]===_0x51fa7b(0xf8))return _0x50b6f2[_0x51fa7b(0xff)];if(Array[_0x51fa7b(0x109)](_0x50b6f2[_0x51fa7b(0xff)]))return _0x50b6f2[_0x51fa7b(0xff)]['map'](blockText)['filter'](Boolean)[_0x51fa7b(0x101)]('\x0a');}return'';}function messageText(_0x7781b4){const _0xb63e8=a0_0x40a803;if(typeof _0x7781b4[_0xb63e8(0xff)]==='string')return _0x7781b4['content'];if(Array[_0xb63e8(0x109)](_0x7781b4[_0xb63e8(0xff)]))return _0x7781b4[_0xb63e8(0xff)]['map'](blockText)[_0xb63e8(0xf5)](Boolean)[_0xb63e8(0x101)]('\x0a');return'';}function summarizeText(_0x9224ac){const _0x4e46ec=a0_0x40a803,_0x474b1c=estimateTokens(_0x9224ac),_0x48e8ce=_0x9224ac[_0x4e46ec(0xe4)]('\x0a');if(_0x474b1c>0x7d0){if(_0x48e8ce[_0x4e46ec(0x107)]>0xa){const _0x33ba46=_0x48e8ce[_0x4e46ec(0x10b)](0x0,0x5)[_0x4e46ec(0x101)]('\x0a'),_0x3bc4b4=_0x48e8ce[_0x4e46ec(0x10b)](-0x5)[_0x4e46ec(0x101)]('\x0a');return _0x33ba46+'\x0a[...\x20'+(_0x48e8ce[_0x4e46ec(0x107)]-0xa)+_0x4e46ec(0x104)+_0x3bc4b4;}return _0x9224ac['slice'](0x0,0x7d0)+(_0x4e46ec(0xe5)+(_0x9224ac[_0x4e46ec(0x107)]-0x7d0)+_0x4e46ec(0xe9));}if(_0x474b1c>0x1f4){if(_0x48e8ce[_0x4e46ec(0x107)]>0xa)return _0x48e8ce[_0x4e46ec(0x10b)](0x0,0xa)['join']('\x0a')+('\x0a[...\x20'+(_0x48e8ce[_0x4e46ec(0x107)]-0xa)+_0x4e46ec(0xea));return _0x9224ac[_0x4e46ec(0x10b)](0x0,0x320)+(_0x4e46ec(0xe5)+(_0x9224ac[_0x4e46ec(0x107)]-0x320)+_0x4e46ec(0xfd));}return _0x9224ac;}function summarizeBlock(_0x1f300e){const _0xb71251=a0_0x40a803;if(!_0x1f300e||typeof _0x1f300e!==_0xb71251(0xf4))return _0x1f300e;if(_0x1f300e[_0xb71251(0x103)]===_0xb71251(0x105)&&typeof _0x1f300e[_0xb71251(0x105)]==='string')return{..._0x1f300e,'text':summarizeText(_0x1f300e[_0xb71251(0x105)])};if(_0x1f300e[_0xb71251(0x103)]===_0xb71251(0xef)){if(typeof _0x1f300e[_0xb71251(0xff)]===_0xb71251(0xf8))return{..._0x1f300e,'content':summarizeText(_0x1f300e[_0xb71251(0xff)])};if(Array[_0xb71251(0x109)](_0x1f300e[_0xb71251(0xff)])){const _0x28cc22=largestBlockIndex(_0x1f300e[_0xb71251(0xff)]);if(_0x28cc22>=0x0){const _0x15d3ce=_0x1f300e[_0xb71251(0xff)]['map']((_0x1c20c8,_0x41e61c)=>_0x41e61c===_0x28cc22?summarizeBlock(_0x1c20c8):_0x1c20c8);return{..._0x1f300e,'content':_0x15d3ce};}}}return _0x1f300e;}function largestBlockIndex(_0x215e8b){const _0x17664a=a0_0x40a803;let _0x395ff5=-0x1,_0x32b25b=-0x1;return _0x215e8b[_0x17664a(0xf0)]((_0x44d6be,_0x3f9945)=>{const _0x15d678=_0x17664a,_0x14d044=blockText(_0x44d6be)[_0x15d678(0x107)];_0x14d044>_0x32b25b&&(_0x32b25b=_0x14d044,_0x395ff5=_0x3f9945);}),_0x32b25b>0x0?_0x395ff5:-0x1;}function scoreMessage(_0x119e55,_0x3f41dc,_0x8e032c){const _0x20be50=a0_0x40a803,_0x5bb801=ROLE_WEIGHT[_0x119e55[_0x20be50(0xf9)]]||0.4,_0xecd89b=(_0x3f41dc+0x1)/_0x8e032c,_0x432c93=messageText(_0x119e55),_0x4672b8=estimateTokens(_0x432c93),_0x3d517b=_0x4672b8>0x7d0?0.6:_0x4672b8>0x1f4?0.8:0x1;return _0x5bb801*(0.3+0.7*_0xecd89b)*_0x3d517b;}function a0_0x44bf(){const _0x452f78=['length','msg','isArray','compressConversation','slice','defineProperty','split','\x0a[...\x20','7139580aAChbL','sort','reduce','\x20chars\x20trimmed\x20by\x20TrimPrompt\x20...]','\x20lines\x20trimmed\x20...]','7iPAdYI','tokens','6621232YTqwJY','originalIndex','tool_result','forEach','map','68733zJRYMJ','indexOf','object','filter','system','10EqXAOd','string','role','ceil','1410612pyUGRK','6451228QJqyLg','\x20chars\x20trimmed\x20...]','192987vqFJNR','content','370aCQmlF','join','3367302aSXwbu','type','\x20lines\x20trimmed\x20by\x20TrimPrompt\x20...]\x0a','text','score'];a0_0x44bf=function(){return _0x452f78;};return a0_0x44bf();}function summarizeMessage(_0x1f3fe4){const _0x31d2f8=a0_0x40a803,_0x2515ab=estimateTokens(messageText(_0x1f3fe4));if(_0x2515ab<=0x1f4)return _0x1f3fe4;if(typeof _0x1f3fe4[_0x31d2f8(0xff)]===_0x31d2f8(0xf8))return{..._0x1f3fe4,'content':summarizeText(_0x1f3fe4['content'])};if(Array[_0x31d2f8(0x109)](_0x1f3fe4[_0x31d2f8(0xff)])){const _0x328cc7=largestBlockIndex(_0x1f3fe4[_0x31d2f8(0xff)]);if(_0x328cc7>=0x0){const _0x174e19=_0x1f3fe4[_0x31d2f8(0xff)]['map']((_0xebe8e1,_0x26ce94)=>_0x26ce94===_0x328cc7?summarizeBlock(_0xebe8e1):_0xebe8e1);return{..._0x1f3fe4,'content':_0x174e19};}}return _0x1f3fe4;}function a0_0x2356(_0x335845,_0x2b2589){_0x335845=_0x335845-0xe4;const _0x44bf77=a0_0x44bf();let _0x2356a2=_0x44bf77[_0x335845];return _0x2356a2;}function compressConversation(_0x5da4ce,_0x1e5a3){const _0x52a81f=a0_0x40a803,_0x3862af={'messages':_0x5da4ce,'trimmedCount':0x0,'savedTokens':0x0};if(!_0x5da4ce||!Array[_0x52a81f(0x109)](_0x5da4ce)||_0x5da4ce[_0x52a81f(0x107)]<=0x6)return _0x3862af;try{return _compressConversation(_0x5da4ce,_0x1e5a3);}catch{return _0x3862af;}}function _compressConversation(_0x2a954d,_0x2ed41a){const _0x1d5101=a0_0x40a803,_0xc8c24e=_0x2ed41a||0x13880,_0x2792a1=0x4,_0x4ec508=_0x2a954d['filter'](_0x4d7485=>_0x4d7485[_0x1d5101(0xf9)]===_0x1d5101(0xf6)),_0xa5b15=_0x2a954d[_0x1d5101(0xf5)](_0x1800e9=>_0x1800e9[_0x1d5101(0xf9)]!==_0x1d5101(0xf6)),_0xc0600e=_0xa5b15[_0x1d5101(0x10b)](-_0x2792a1),_0x2ef206=_0xa5b15['slice'](0x0,-_0x2792a1),_0x1499db=_0x2ef206[_0x1d5101(0xf1)]((_0x2ce095,_0x155d50)=>({'msg':_0x2ce095,'score':scoreMessage(_0x2ce095,_0x155d50,_0x2ef206[_0x1d5101(0x107)]),'tokens':estimateTokens(messageText(_0x2ce095))})),_0x3a43aa=_0x1499db[_0x1d5101(0xe8)]((_0x33cc2a,_0x1dbde3)=>_0x33cc2a+_0x1dbde3[_0x1d5101(0xec)],0x0),_0x482fac=_0xc0600e[_0x1d5101(0xe8)]((_0x235b83,_0x3536a2)=>_0x235b83+estimateTokens(messageText(_0x3536a2)),0x0),_0x3b6b2d=_0x4ec508[_0x1d5101(0xe8)]((_0x481c2e,_0x1d9aa6)=>_0x481c2e+estimateTokens(messageText(_0x1d9aa6)),0x0),_0x3b0e79=_0xc8c24e-_0x482fac-_0x3b6b2d;if(_0x3a43aa<=_0x3b0e79){let _0x12068c=0x0;const _0x1addab=_0x1499db[_0x1d5101(0xf1)](_0x3afadc=>{const _0x156383=_0x1d5101;if(_0x3afadc[_0x156383(0xec)]>0x1f4){const _0x5b9a90=summarizeMessage(_0x3afadc['msg']),_0x4df69d=estimateTokens(messageText(_0x5b9a90));if(_0x4df69d<_0x3afadc[_0x156383(0xec)])return _0x12068c+=_0x3afadc[_0x156383(0xec)]-_0x4df69d,_0x5b9a90;}return _0x3afadc[_0x156383(0x108)];});return{'messages':[..._0x4ec508,..._0x1addab,..._0xc0600e],'trimmedCount':0x0,'savedTokens':_0x12068c};}_0x1499db['sort']((_0x2f5dd3,_0x2ae274)=>_0x2ae274[_0x1d5101(0x106)]-_0x2f5dd3['score']);let _0x4c55fc=0x0,_0x33bd23=0x0,_0x5d61ac=0x0;const _0x53ecdf=[];for(const _0x3ff356 of _0x1499db){if(_0x4c55fc+_0x3ff356['tokens']<=_0x3b0e79){if(_0x3ff356[_0x1d5101(0xec)]>0x3e8){const _0x2822d2=summarizeMessage(_0x3ff356['msg']),_0x2e6a04=estimateTokens(messageText(_0x2822d2));_0x5d61ac+=_0x3ff356[_0x1d5101(0xec)]-_0x2e6a04,_0x4c55fc+=_0x2e6a04,_0x53ecdf['push']({'msg':_0x2822d2,'originalIndex':_0x2ef206[_0x1d5101(0xf3)](_0x3ff356[_0x1d5101(0x108)])});}else _0x4c55fc+=_0x3ff356[_0x1d5101(0xec)],_0x53ecdf['push']({'msg':_0x3ff356[_0x1d5101(0x108)],'originalIndex':_0x2ef206['indexOf'](_0x3ff356[_0x1d5101(0x108)])});}else _0x33bd23++,_0x5d61ac+=_0x3ff356[_0x1d5101(0xec)];}_0x53ecdf[_0x1d5101(0xe7)]((_0x10a511,_0x51fe4e)=>_0x10a511['originalIndex']-_0x51fe4e[_0x1d5101(0xee)]);const _0x2bac10=[..._0x4ec508,..._0x53ecdf[_0x1d5101(0xf1)](_0x1a903a=>_0x1a903a['msg']),..._0xc0600e];return{'messages':_0x2bac10,'trimmedCount':_0x33bd23,'savedTokens':_0x5d61ac};}
|
package/proxy-daemon.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x2799dc=a0_0x351c;(function(_0x6a1ddb,_0x14e372){const _0x4f7afb=a0_0x351c,_0x193c7a=_0x6a1ddb();while(!![]){try{const _0x478f63=-parseInt(_0x4f7afb(0x198))/0x1+-parseInt(_0x4f7afb(0x162))/0x2+parseInt(_0x4f7afb(0x15a))/0x3*(-parseInt(_0x4f7afb(0x1b4))/0x4)+parseInt(_0x4f7afb(0x161))/0x5+parseInt(_0x4f7afb(0x17b))/0x6*(parseInt(_0x4f7afb(0x1c9))/0x7)+-parseInt(_0x4f7afb(0x18b))/0x8+parseInt(_0x4f7afb(0x16f))/0x9*(parseInt(_0x4f7afb(0x199))/0xa);if(_0x478f63===_0x14e372)break;else _0x193c7a['push'](_0x193c7a['shift']());}catch(_0xc1cc0c){_0x193c7a['push'](_0x193c7a['shift']());}}}(a0_0x566e,0x5e0a0));function a0_0x351c(_0xe9ff38,_0x3ce88a){_0xe9ff38=_0xe9ff38-0x152;const _0x566eef=a0_0x566e();let _0x351cd2=_0x566eef[_0xe9ff38];return _0x351cd2;}var __createBinding=this&&this[a0_0x2799dc(0x176)]||(Object['create']?function(_0x3e552c,_0x340771,_0x593810,_0x381fc9){const _0x38dfeb=a0_0x2799dc;if(_0x381fc9===undefined)_0x381fc9=_0x593810;var _0x1d828f=Object['getOwnPropertyDescriptor'](_0x340771,_0x593810);(!_0x1d828f||(_0x38dfeb(0x16c)in _0x1d828f?!_0x340771[_0x38dfeb(0x18d)]:_0x1d828f['writable']||_0x1d828f[_0x38dfeb(0x1cd)]))&&(_0x1d828f={'enumerable':!![],'get':function(){return _0x340771[_0x593810];}}),Object[_0x38dfeb(0x196)](_0x3e552c,_0x381fc9,_0x1d828f);}:function(_0x536ade,_0x17b02e,_0x401f8f,_0x59a402){if(_0x59a402===undefined)_0x59a402=_0x401f8f;_0x536ade[_0x59a402]=_0x17b02e[_0x401f8f];}),__setModuleDefault=this&&this[a0_0x2799dc(0x188)]||(Object['create']?function(_0x2b88a5,_0x54d79d){const _0x59e13e=a0_0x2799dc;Object[_0x59e13e(0x196)](_0x2b88a5,_0x59e13e(0x16b),{'enumerable':!![],'value':_0x54d79d});}:function(_0x2b9b2b,_0x14b50c){const _0x4941a9=a0_0x2799dc;_0x2b9b2b[_0x4941a9(0x16b)]=_0x14b50c;}),__importStar=this&&this[a0_0x2799dc(0x169)]||(function(){var _0x3bfd32=function(_0x3f92f3){const _0x415994=a0_0x351c;return _0x3bfd32=Object[_0x415994(0x156)]||function(_0x5499c6){const _0xbc5319=_0x415994;var _0x47c0a0=[];for(var _0x515ba8 in _0x5499c6)if(Object[_0xbc5319(0x19b)][_0xbc5319(0x1a1)]['call'](_0x5499c6,_0x515ba8))_0x47c0a0[_0x47c0a0['length']]=_0x515ba8;return _0x47c0a0;},_0x3bfd32(_0x3f92f3);};return function(_0x3ca45b){const _0x5dd7c0=a0_0x351c;if(_0x3ca45b&&_0x3ca45b['__esModule'])return _0x3ca45b;var _0x36b9cf={};if(_0x3ca45b!=null){for(var _0x3386d6=_0x3bfd32(_0x3ca45b),_0x59af6d=0x0;_0x59af6d<_0x3386d6[_0x5dd7c0(0x186)];_0x59af6d++)if(_0x3386d6[_0x59af6d]!=='default')__createBinding(_0x36b9cf,_0x3ca45b,_0x3386d6[_0x59af6d]);}return __setModuleDefault(_0x36b9cf,_0x3ca45b),_0x36b9cf;};}());Object['defineProperty'](exports,a0_0x2799dc(0x18d),{'value':!![]}),exports[a0_0x2799dc(0x15c)]=getProxyPort,exports[a0_0x2799dc(0x1b9)]=isProxyRunning,exports[a0_0x2799dc(0x1c2)]=startProxyDaemon,exports[a0_0x2799dc(0x1a3)]=stopProxyDaemon,exports[a0_0x2799dc(0x16d)]=enableAutostart,exports[a0_0x2799dc(0x1d1)]=disableAutostart,exports['setAnthropicBaseUrl']=setAnthropicBaseUrl,exports[a0_0x2799dc(0x163)]=removeAnthropicBaseUrl;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x2799dc(0x183))),os=__importStar(require('os')),child_process_1=require(a0_0x2799dc(0x1a0)),baseDir=path[a0_0x2799dc(0x1d7)](os[a0_0x2799dc(0x18e)](),'.trimprompt'),pidFile=path[a0_0x2799dc(0x1d7)](baseDir,a0_0x2799dc(0x182)),portFile=path[a0_0x2799dc(0x1d7)](baseDir,a0_0x2799dc(0x19a)),DEFAULT_PORT=0x1f90;function ensureDir(){const _0x44ebb8=a0_0x2799dc;if(!fs[_0x44ebb8(0x184)](baseDir))fs[_0x44ebb8(0x193)](baseDir,{'recursive':!![]});}function getProxyPort(){const _0x38a44d=a0_0x2799dc;try{if(fs[_0x38a44d(0x184)](portFile))return parseInt(fs[_0x38a44d(0x1c7)](portFile,_0x38a44d(0x190))['trim']())||DEFAULT_PORT;}catch{}return DEFAULT_PORT;}function isProxyRunning(){const _0x2251ae=a0_0x2799dc,_0x2c5984=getProxyPort();try{if(!fs['existsSync'](pidFile))return{'running':![],'pid':null,'port':_0x2c5984};const _0x3396b7=parseInt(fs[_0x2251ae(0x1c7)](pidFile,_0x2251ae(0x190))[_0x2251ae(0x1bb)]());if(!_0x3396b7)return{'running':![],'pid':null,'port':_0x2c5984};if(process[_0x2251ae(0x1b8)]===_0x2251ae(0x1d5)){const _0x3e87ba=(0x0,child_process_1[_0x2251ae(0x165)])('tasklist\x20/FI\x20\x22PID\x20eq\x20'+_0x3396b7+'\x22\x20/FO\x20CSV\x20/NH',{'encoding':'utf8','timeout':0x1388}),_0x108799='\x22'+_0x3396b7+'\x22';if(_0x3e87ba[_0x2251ae(0x17d)]('\x0a')[_0x2251ae(0x1d6)](_0x2f0ef8=>_0x2f0ef8['includes'](_0x108799)))return{'running':!![],'pid':_0x3396b7,'port':_0x2c5984};}else return process[_0x2251ae(0x178)](_0x3396b7,0x0),{'running':!![],'pid':_0x3396b7,'port':_0x2c5984};}catch{}try{fs['unlinkSync'](pidFile);}catch{}return{'running':![],'pid':null,'port':_0x2c5984};}function startProxyDaemon(_0x3c9922){const _0x1e7f9d=a0_0x2799dc,_0xd9b513=isProxyRunning();if(_0xd9b513[_0x1e7f9d(0x155)])return{'success':!![],'pid':_0xd9b513[_0x1e7f9d(0x192)],'port':_0xd9b513[_0x1e7f9d(0x164)],'message':'Proxy\x20already\x20running\x20(pid\x20'+_0xd9b513[_0x1e7f9d(0x192)]+')\x20on\x20port\x20'+_0xd9b513[_0x1e7f9d(0x164)]};ensureDir();const _0x18202d=_0x3c9922||DEFAULT_PORT;try{const _0x416157=path['join'](__dirname,_0x1e7f9d(0x1b2));if(!fs[_0x1e7f9d(0x184)](_0x416157))return{'success':![],'pid':null,'port':_0x18202d,'message':'CLI\x20not\x20found\x20at\x20'+_0x416157};const _0x5ca6cf=(0x0,child_process_1['spawn'])(process[_0x1e7f9d(0x185)],[_0x416157,_0x1e7f9d(0x1d8),_0x1e7f9d(0x1ab),String(_0x18202d)],{'detached':!![],'stdio':_0x1e7f9d(0x1c3),'env':{...process.env,'TRIMPROMPT_DISABLED':'1'}});_0x5ca6cf[_0x1e7f9d(0x1ca)]();if(_0x5ca6cf[_0x1e7f9d(0x192)])return fs[_0x1e7f9d(0x1d4)](pidFile,String(_0x5ca6cf[_0x1e7f9d(0x192)]),'utf8'),fs[_0x1e7f9d(0x1d4)](portFile,String(_0x18202d),'utf8'),{'success':!![],'pid':_0x5ca6cf[_0x1e7f9d(0x192)],'port':_0x18202d,'message':_0x1e7f9d(0x173)+_0x5ca6cf[_0x1e7f9d(0x192)]+_0x1e7f9d(0x1ae)+_0x18202d};return{'success':![],'pid':null,'port':_0x18202d,'message':_0x1e7f9d(0x1c1)};}catch(_0xfe25eb){return{'success':![],'pid':null,'port':_0x18202d,'message':_0x1e7f9d(0x1a2)+_0xfe25eb[_0x1e7f9d(0x159)]};}}function stopProxyDaemon(){const _0x30c14b=a0_0x2799dc,_0x1e9dd2=isProxyRunning();if(!_0x1e9dd2['running']||!_0x1e9dd2[_0x30c14b(0x192)])return{'success':!![],'message':'Proxy\x20is\x20not\x20running'};try{process[_0x30c14b(0x1b8)]===_0x30c14b(0x1d5)?(0x0,child_process_1[_0x30c14b(0x165)])(_0x30c14b(0x1aa)+_0x1e9dd2[_0x30c14b(0x192)]+_0x30c14b(0x1a4),{'timeout':0x1388}):process[_0x30c14b(0x178)](_0x1e9dd2[_0x30c14b(0x192)],_0x30c14b(0x1cf));}catch{}try{fs[_0x30c14b(0x166)](pidFile);}catch{}return{'success':!![],'message':_0x30c14b(0x17a)+_0x1e9dd2['pid']+')'};}function setClaudeCodeSettings(_0x1f6eb8){const _0x17ff2a=a0_0x2799dc,_0x34a865=path[_0x17ff2a(0x1d7)](os[_0x17ff2a(0x18e)](),_0x17ff2a(0x1af)),_0x137209=path[_0x17ff2a(0x1d7)](_0x34a865,'settings.json');try{if(!fs[_0x17ff2a(0x184)](_0x34a865))fs[_0x17ff2a(0x193)](_0x34a865,{'recursive':!![]});let _0x4cd087={};if(fs[_0x17ff2a(0x184)](_0x137209))try{_0x4cd087=JSON[_0x17ff2a(0x19f)](fs['readFileSync'](_0x137209,'utf8'));}catch{}if(!_0x4cd087['env'])_0x4cd087[_0x17ff2a(0x16a)]={};_0x4cd087[_0x17ff2a(0x16a)][_0x17ff2a(0x1bf)]=_0x1f6eb8,fs[_0x17ff2a(0x1d4)](_0x137209,JSON['stringify'](_0x4cd087,null,0x2),_0x17ff2a(0x190));}catch{}}function removeClaudeCodeSettings(){const _0x4505e2=a0_0x2799dc,_0xbe6f44=path[_0x4505e2(0x1d7)](os[_0x4505e2(0x18e)](),_0x4505e2(0x1af),_0x4505e2(0x153));try{if(fs[_0x4505e2(0x184)](_0xbe6f44)){const _0x2872fb=JSON['parse'](fs['readFileSync'](_0xbe6f44,'utf8'));if(_0x2872fb[_0x4505e2(0x16a)]&&_0x2872fb[_0x4505e2(0x16a)][_0x4505e2(0x1bf)]){delete _0x2872fb[_0x4505e2(0x16a)][_0x4505e2(0x1bf)];if(Object[_0x4505e2(0x1b3)](_0x2872fb[_0x4505e2(0x16a)])[_0x4505e2(0x186)]===0x0)delete _0x2872fb[_0x4505e2(0x16a)];fs['writeFileSync'](_0xbe6f44,JSON[_0x4505e2(0x1a9)](_0x2872fb,null,0x2),_0x4505e2(0x190));}}}catch{}}function a0_0x566e(){const _0x2a8981=['http://127.0.0.1:','readFileSync','pwsh','7PonYAX','unref','cmd\x20=\x20Chr(34)\x20&\x20\x22','\x20-NoProfile\x20-Command\x20\x22$PROFILE\x22','configurable','proxy-autostart.vbs','SIGTERM','</string><string>proxy</string><string>start</string>','disableAutostart','.*\x5cr?\x5cn?','launchctl\x20load\x20\x22','writeFileSync','win32','some','join','proxy','trimprompt-proxy.desktop','settings.json','replace','running','getOwnPropertyNames','<string>','ai.trimprompt.proxy.plist','message','239397fGCHWb','\x27\x20-Force\x20|\x20Out-Null;\x20Set-ItemProperty\x20-Path\x20\x27','getProxyPort','pipe','$env:GOOGLE_AI_BASE_URL\x20=\x20\x22','\x5c$&','[Desktop\x20Entry]\x0a','3009050eBfKdk','124128ZcYolP','removeAnthropicBaseUrl','port','execSync','unlinkSync','includes','trimEnd','__importStar','env','default','get','enableAutostart','<!DOCTYPE\x20plist\x20PUBLIC\x20\x22-//Apple//DTD\x20PLIST\x201.0//EN\x22\x20\x22http://www.apple.com/DTDs/PropertyList-1.0.dtd\x22>\x0a','9dtiItf','$env:OPENAI_BASE_URL\x20=\x20\x22','export\x20ANTHROPIC_BASE_URL=\x22','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a','Proxy\x20started\x20(pid\x20','$env:ANTHROPIC_BASE_URL\x20=\x20\x22','.zshrc','__createBinding','dirname','kill','\x27\x20-Value\x20\x27','Proxy\x20stopped\x20(pid\x20','3544158xUAoeY','\x20\x20<key>ProgramArguments</key><array>','split','launchctl\x20unload\x20\x22','Library','export\x20OPENAI_BASE_URL=\x22','.bashrc','proxy.pid','path','existsSync','execPath','length','HKCU:\x5cSoftware\x5cMicrosoft\x5cWindows\x5cCurrentVersion\x5cRun','__setModuleDefault','.config','autostart','5360200UHmnSo','setx\x20GOOGLE_AI_BASE_URL\x20\x22','__esModule','homedir','darwin','utf8','Set\x20WshShell\x20=\x20CreateObject(\x22WScript.Shell\x22)\x0d\x0a','pid','mkdirSync','$env:GEMINI_BASE_URL\x20=\x20\x22','</array>\x0a','defineProperty','LaunchAgents','722216JrztWg','12055790gAuicI','proxy.port','prototype','export\x20GOOGLE_AI_BASE_URL=\x22','REG\x20DELETE\x20\x22HKCU\x5cEnvironment\x22\x20/V\x20ANTHROPIC_BASE_URL\x20/F','Exec=','parse','child_process','hasOwnProperty','Failed\x20to\x20start\x20proxy:\x20','stopProxyDaemon','\x20/F','WshShell.Run\x20cmd,\x200,\x20False\x0d\x0a','</string><string>','TrimPromptProxy','NoDisplay=true\x0a','stringify','taskkill\x20/PID\x20','--port','\x22\x20&\x20Chr(34)\x20&\x20\x22\x20proxy\x20install\x22\x0d\x0a','#\x20TrimPrompt\x20API\x20Proxy',')\x20on\x20port\x20','.claude','powershell.exe\x20-NoProfile\x20-Command\x20\x22','export\x20GEMINI_BASE_URL=\x22','cli.js','keys','28QwYcwB','\x20\x20<key>RunAtLoad</key><true/>\x0a','powershell','\x22\x20&\x20Chr(34)\x20&\x20\x22\x20\x22\x20&\x20Chr(34)\x20&\x20\x22','platform','isProxyRunning','X-GNOME-Autostart-enabled=true\x0a','trim','.bash_profile','setx\x20ANTHROPIC_BASE_URL\x20\x22','\x20\x20<key>KeepAlive</key><true/>\x0a','ANTHROPIC_BASE_URL','\x27\x20-Name\x20\x27','Spawn\x20returned\x20no\x20PID','startProxyDaemon','ignore','New-Item\x20-Path\x20\x27','setx\x20GEMINI_BASE_URL\x20\x22'];a0_0x566e=function(){return _0x2a8981;};return a0_0x566e();}const RUN_KEY=a0_0x2799dc(0x187),RUN_VALUE_NAME=a0_0x2799dc(0x1a7),vbsLauncher=path[a0_0x2799dc(0x1d7)](baseDir,a0_0x2799dc(0x1ce));function enableAutostart(){const _0x1a61a4=a0_0x2799dc;ensureDir();const _0xa07361=path[_0x1a61a4(0x1d7)](__dirname,_0x1a61a4(0x1b2));if(process[_0x1a61a4(0x1b8)]===_0x1a61a4(0x1d5)){try{const _0x15c5d1=_0x1a61a4(0x191)+_0x1a61a4(0x1cb)+process[_0x1a61a4(0x185)]['replace'](/"/g,'\x22\x22')+_0x1a61a4(0x1b7)+_0xa07361['replace'](/"/g,'\x22\x22')+_0x1a61a4(0x1ac)+_0x1a61a4(0x1a5);fs[_0x1a61a4(0x1d4)](vbsLauncher,_0x15c5d1,'utf8');const _0x3df8dd='wscript.exe\x20\x22'+vbsLauncher+'\x22',_0x2c249e=_0x1a61a4(0x1c4)+RUN_KEY+_0x1a61a4(0x15b)+RUN_KEY+_0x1a61a4(0x1c0)+RUN_VALUE_NAME+_0x1a61a4(0x179)+_0x3df8dd[_0x1a61a4(0x154)](/'/g,'\x27\x27')+'\x27';(0x0,child_process_1[_0x1a61a4(0x165)])('powershell.exe\x20-NoProfile\x20-Command\x20\x22'+_0x2c249e[_0x1a61a4(0x154)](/"/g,'\x5c\x22')+'\x22',{'stdio':_0x1a61a4(0x1c3),'timeout':0x1f40});}catch{}return;}if(process[_0x1a61a4(0x1b8)]===_0x1a61a4(0x18f)){try{const _0x1aafa8=path[_0x1a61a4(0x1d7)](os[_0x1a61a4(0x18e)](),_0x1a61a4(0x17f),_0x1a61a4(0x197));if(!fs[_0x1a61a4(0x184)](_0x1aafa8))fs[_0x1a61a4(0x193)](_0x1aafa8,{'recursive':!![]});const _0x58c3d1=path['join'](_0x1aafa8,'ai.trimprompt.proxy.plist'),_0x2c2ba8=_0x1a61a4(0x172)+_0x1a61a4(0x16e)+'<plist\x20version=\x221.0\x22><dict>\x0a'+'\x20\x20<key>Label</key><string>ai.trimprompt.proxy</string>\x0a'+_0x1a61a4(0x17c)+(_0x1a61a4(0x157)+process['execPath']+_0x1a61a4(0x1a6)+_0xa07361+_0x1a61a4(0x1d0))+_0x1a61a4(0x195)+_0x1a61a4(0x1b5)+_0x1a61a4(0x1be)+'</dict></plist>\x0a';fs['writeFileSync'](_0x58c3d1,_0x2c2ba8,'utf8');try{(0x0,child_process_1['execSync'])(_0x1a61a4(0x17e)+_0x58c3d1+'\x22',{'stdio':_0x1a61a4(0x1c3),'timeout':0x1388});}catch{}(0x0,child_process_1['execSync'])(_0x1a61a4(0x1d3)+_0x58c3d1+'\x22',{'stdio':'ignore','timeout':0x1388});}catch{}return;}try{const _0x3a6caa=path[_0x1a61a4(0x1d7)](os[_0x1a61a4(0x18e)](),'.config',_0x1a61a4(0x18a));if(!fs[_0x1a61a4(0x184)](_0x3a6caa))fs[_0x1a61a4(0x193)](_0x3a6caa,{'recursive':!![]});const _0x428a42=path['join'](_0x3a6caa,_0x1a61a4(0x152)),_0x4cce7a=_0x1a61a4(0x160)+'Type=Application\x0a'+'Name=TrimPrompt\x20Proxy\x0a'+(_0x1a61a4(0x19e)+process[_0x1a61a4(0x185)]+'\x20'+_0xa07361+'\x20proxy\x20install\x0a')+_0x1a61a4(0x1ba)+_0x1a61a4(0x1a8);fs[_0x1a61a4(0x1d4)](_0x428a42,_0x4cce7a,_0x1a61a4(0x190));}catch{}}function disableAutostart(){const _0x4f5dc0=a0_0x2799dc;if(process[_0x4f5dc0(0x1b8)]===_0x4f5dc0(0x1d5)){try{const _0x2ab495='Remove-ItemProperty\x20-Path\x20\x27'+RUN_KEY+_0x4f5dc0(0x1c0)+RUN_VALUE_NAME+'\x27\x20-ErrorAction\x20SilentlyContinue';(0x0,child_process_1[_0x4f5dc0(0x165)])(_0x4f5dc0(0x1b0)+_0x2ab495[_0x4f5dc0(0x154)](/"/g,'\x5c\x22')+'\x22',{'stdio':'ignore','timeout':0x1f40});}catch{}try{if(fs[_0x4f5dc0(0x184)](vbsLauncher))fs[_0x4f5dc0(0x166)](vbsLauncher);}catch{}return;}if(process[_0x4f5dc0(0x1b8)]===_0x4f5dc0(0x18f)){try{const _0x2d2bec=path['join'](os[_0x4f5dc0(0x18e)](),_0x4f5dc0(0x17f),_0x4f5dc0(0x197),_0x4f5dc0(0x158));try{(0x0,child_process_1[_0x4f5dc0(0x165)])('launchctl\x20unload\x20\x22'+_0x2d2bec+'\x22',{'stdio':'ignore','timeout':0x1388});}catch{}if(fs['existsSync'](_0x2d2bec))fs['unlinkSync'](_0x2d2bec);}catch{}return;}try{const _0x514234=path[_0x4f5dc0(0x1d7)](os[_0x4f5dc0(0x18e)](),_0x4f5dc0(0x189),_0x4f5dc0(0x18a),_0x4f5dc0(0x152));if(fs[_0x4f5dc0(0x184)](_0x514234))fs[_0x4f5dc0(0x166)](_0x514234);}catch{}}function setAnthropicBaseUrl(_0x3f4d06){const _0x49fc64=a0_0x2799dc,_0x16c045=_0x49fc64(0x1c6)+_0x3f4d06,_0xe806d8='http://127.0.0.1:'+_0x3f4d06+'/v1';setClaudeCodeSettings(_0x16c045);if(process[_0x49fc64(0x1b8)]===_0x49fc64(0x1d5))try{(0x0,child_process_1[_0x49fc64(0x165)])(_0x49fc64(0x1bd)+_0x16c045+'\x22',{'timeout':0x1388}),(0x0,child_process_1['execSync'])('setx\x20OPENAI_BASE_URL\x20\x22'+_0xe806d8+'\x22',{'timeout':0x1388}),(0x0,child_process_1[_0x49fc64(0x165)])(_0x49fc64(0x1c5)+_0xe806d8+'\x22',{'timeout':0x1388}),(0x0,child_process_1[_0x49fc64(0x165)])(_0x49fc64(0x18c)+_0xe806d8+'\x22',{'timeout':0x1388});}catch{}const _0x4b2e61=os['homedir'](),_0xd4ad25=_0x49fc64(0x1ad),_0x2ecd88=_0x49fc64(0x171)+_0x16c045+'\x22\x20'+_0xd4ad25,_0x645ef4=_0x49fc64(0x180)+_0xe806d8+'\x22\x20'+_0xd4ad25,_0x40377a=_0x49fc64(0x1b1)+_0xe806d8+'\x22\x20'+_0xd4ad25,_0x520759=_0x49fc64(0x19c)+_0xe806d8+'\x22\x20'+_0xd4ad25,_0x5e6211=[path[_0x49fc64(0x1d7)](_0x4b2e61,'.bashrc'),path['join'](_0x4b2e61,_0x49fc64(0x175)),path[_0x49fc64(0x1d7)](_0x4b2e61,'.bash_profile')];for(const _0x20c30a of _0x5e6211){try{if(fs[_0x49fc64(0x184)](_0x20c30a)){let _0x2e0ac9=fs[_0x49fc64(0x1c7)](_0x20c30a,_0x49fc64(0x190));_0x2e0ac9[_0x49fc64(0x167)](_0xd4ad25)&&(_0x2e0ac9=_0x2e0ac9[_0x49fc64(0x154)](new RegExp('.*'+_0xd4ad25[_0x49fc64(0x154)](/[.*+?^${}()|[\]\\]/g,_0x49fc64(0x15f))+'.*\x5cn?','g'),'')),_0x2e0ac9=_0x2e0ac9[_0x49fc64(0x168)]()+'\x0a'+_0x2ecd88+'\x0a'+_0x645ef4+'\x0a'+_0x40377a+'\x0a'+_0x520759+'\x0a',fs[_0x49fc64(0x1d4)](_0x20c30a,_0x2e0ac9,_0x49fc64(0x190));}}catch{}}try{const _0x3dc6d7=[];for(const _0x1bb01e of[_0x49fc64(0x1b6),_0x49fc64(0x1c8)]){try{const _0x210613=(0x0,child_process_1['execSync'])(_0x1bb01e+_0x49fc64(0x1cc),{'encoding':'utf8','timeout':0xbb8,'stdio':[_0x49fc64(0x15d),'pipe','ignore']})[_0x49fc64(0x1bb)]();if(_0x210613&&!_0x3dc6d7[_0x49fc64(0x167)](_0x210613))_0x3dc6d7['push'](_0x210613);}catch{}}const _0xfebc48=_0x49fc64(0x1ad),_0x3315bd=_0x49fc64(0x174)+_0x16c045+'\x22\x20'+_0xfebc48,_0x2b46f2=_0x49fc64(0x170)+_0xe806d8+'\x22\x20'+_0xfebc48,_0x555c9e=_0x49fc64(0x194)+_0xe806d8+'\x22\x20'+_0xfebc48,_0x9a0987=_0x49fc64(0x15e)+_0xe806d8+'\x22\x20'+_0xfebc48;for(const _0x460029 of _0x3dc6d7){try{const _0x322dc6=path[_0x49fc64(0x177)](_0x460029);if(!fs[_0x49fc64(0x184)](_0x322dc6))fs['mkdirSync'](_0x322dc6,{'recursive':!![]});let _0x505689=fs[_0x49fc64(0x184)](_0x460029)?fs[_0x49fc64(0x1c7)](_0x460029,_0x49fc64(0x190)):'';_0x505689[_0x49fc64(0x167)](_0xfebc48)&&(_0x505689=_0x505689[_0x49fc64(0x154)](new RegExp('.*'+_0xfebc48['replace'](/[.*+?^${}()|[\]\\]/g,_0x49fc64(0x15f))+_0x49fc64(0x1d2),'g'),'')),_0x505689=_0x505689[_0x49fc64(0x168)]()+'\x0a'+_0x3315bd+'\x0a'+_0x2b46f2+'\x0a'+_0x555c9e+'\x0a'+_0x9a0987+'\x0a',fs[_0x49fc64(0x1d4)](_0x460029,_0x505689,_0x49fc64(0x190));}catch{}}}catch{}}function removeAnthropicBaseUrl(){const _0x471371=a0_0x2799dc;removeClaudeCodeSettings();if(process[_0x471371(0x1b8)]===_0x471371(0x1d5))try{(0x0,child_process_1[_0x471371(0x165)])(_0x471371(0x19d),{'timeout':0x1388});}catch{}const _0x477945=os[_0x471371(0x18e)](),_0x131586=_0x471371(0x1ad),_0x525ac5=[path['join'](_0x477945,_0x471371(0x181)),path[_0x471371(0x1d7)](_0x477945,_0x471371(0x175)),path[_0x471371(0x1d7)](_0x477945,_0x471371(0x1bc))];for(const _0x411729 of _0x525ac5){try{if(fs[_0x471371(0x184)](_0x411729)){let _0x3aeaf6=fs[_0x471371(0x1c7)](_0x411729,_0x471371(0x190));_0x3aeaf6[_0x471371(0x167)](_0x131586)&&(_0x3aeaf6=_0x3aeaf6[_0x471371(0x154)](new RegExp('.*'+_0x131586[_0x471371(0x154)](/[.*+?^${}()|[\]\\]/g,_0x471371(0x15f))+_0x471371(0x1d2),'g'),''),fs[_0x471371(0x1d4)](_0x411729,_0x3aeaf6,_0x471371(0x190)));}}catch{}}try{for(const _0x3f3ffd of[_0x471371(0x1b6),_0x471371(0x1c8)]){try{const _0x3f2e13=(0x0,child_process_1[_0x471371(0x165)])(_0x3f3ffd+_0x471371(0x1cc),{'encoding':_0x471371(0x190),'timeout':0xbb8,'stdio':['pipe','pipe',_0x471371(0x1c3)]})[_0x471371(0x1bb)]();if(_0x3f2e13&&fs['existsSync'](_0x3f2e13)){let _0x40eb9c=fs['readFileSync'](_0x3f2e13,'utf8');const _0xb4557b='#\x20TrimPrompt\x20API\x20Proxy';_0x40eb9c['includes'](_0xb4557b)&&(_0x40eb9c=_0x40eb9c[_0x471371(0x154)](new RegExp('.*'+_0xb4557b['replace'](/[.*+?^${}()|[\]\\]/g,_0x471371(0x15f))+_0x471371(0x1d2),'g'),''),fs['writeFileSync'](_0x3f2e13,_0x40eb9c,_0x471371(0x190)));}}catch{}}}catch{}}
|
|
1
|
+
'use strict';const a0_0x300d15=a0_0x5282;(function(_0x504385,_0x3af79a){const _0x4e785a=a0_0x5282,_0x45671a=_0x504385();while(!![]){try{const _0x67b999=-parseInt(_0x4e785a(0x163))/0x1*(-parseInt(_0x4e785a(0x18c))/0x2)+-parseInt(_0x4e785a(0x157))/0x3*(parseInt(_0x4e785a(0x153))/0x4)+-parseInt(_0x4e785a(0x161))/0x5+-parseInt(_0x4e785a(0x171))/0x6+parseInt(_0x4e785a(0x1a3))/0x7+parseInt(_0x4e785a(0x17b))/0x8*(parseInt(_0x4e785a(0x1ad))/0x9)+-parseInt(_0x4e785a(0x160))/0xa;if(_0x67b999===_0x3af79a)break;else _0x45671a['push'](_0x45671a['shift']());}catch(_0xe4050d){_0x45671a['push'](_0x45671a['shift']());}}}(a0_0x1703,0xa334f));var __createBinding=this&&this[a0_0x300d15(0x190)]||(Object[a0_0x300d15(0x13f)]?function(_0x3900e0,_0x5ebe33,_0x457539,_0x2c4e32){const _0x309cbd=a0_0x300d15;if(_0x2c4e32===undefined)_0x2c4e32=_0x457539;var _0x2f82b8=Object[_0x309cbd(0x18e)](_0x5ebe33,_0x457539);(!_0x2f82b8||('get'in _0x2f82b8?!_0x5ebe33['__esModule']:_0x2f82b8['writable']||_0x2f82b8['configurable']))&&(_0x2f82b8={'enumerable':!![],'get':function(){return _0x5ebe33[_0x457539];}}),Object[_0x309cbd(0x197)](_0x3900e0,_0x2c4e32,_0x2f82b8);}:function(_0x2fc282,_0x81059a,_0x2bc218,_0x487832){if(_0x487832===undefined)_0x487832=_0x2bc218;_0x2fc282[_0x487832]=_0x81059a[_0x2bc218];}),__setModuleDefault=this&&this[a0_0x300d15(0x1bb)]||(Object[a0_0x300d15(0x13f)]?function(_0x3511ab,_0xb79b20){Object['defineProperty'](_0x3511ab,'default',{'enumerable':!![],'value':_0xb79b20});}:function(_0x56320e,_0xa41307){const _0x412190=a0_0x300d15;_0x56320e[_0x412190(0x19d)]=_0xa41307;}),__importStar=this&&this[a0_0x300d15(0x187)]||(function(){var _0xccdcd1=function(_0x18f1b8){const _0x409471=a0_0x5282;return _0xccdcd1=Object[_0x409471(0x143)]||function(_0x3a2625){const _0x4ab3f3=_0x409471;var _0x4a9e9d=[];for(var _0x4dd81f in _0x3a2625)if(Object['prototype'][_0x4ab3f3(0x1a2)][_0x4ab3f3(0x1a0)](_0x3a2625,_0x4dd81f))_0x4a9e9d[_0x4a9e9d['length']]=_0x4dd81f;return _0x4a9e9d;},_0xccdcd1(_0x18f1b8);};return function(_0x1759ad){const _0x57aa90=a0_0x5282;if(_0x1759ad&&_0x1759ad[_0x57aa90(0x1aa)])return _0x1759ad;var _0xf3e7fe={};if(_0x1759ad!=null){for(var _0x3a8606=_0xccdcd1(_0x1759ad),_0x506dd1=0x0;_0x506dd1<_0x3a8606[_0x57aa90(0x145)];_0x506dd1++)if(_0x3a8606[_0x506dd1]!==_0x57aa90(0x19d))__createBinding(_0xf3e7fe,_0x1759ad,_0x3a8606[_0x506dd1]);}return __setModuleDefault(_0xf3e7fe,_0x1759ad),_0xf3e7fe;};}());Object['defineProperty'](exports,a0_0x300d15(0x1aa),{'value':!![]}),exports[a0_0x300d15(0x1b5)]=getProxyPort,exports['isProxyRunning']=isProxyRunning,exports[a0_0x300d15(0x17a)]=startProxyDaemon,exports[a0_0x300d15(0x179)]=stopProxyDaemon,exports[a0_0x300d15(0x1bf)]=enableAutostart,exports[a0_0x300d15(0x1be)]=disableAutostart,exports[a0_0x300d15(0x16f)]=setAnthropicBaseUrl,exports['removeAnthropicBaseUrl']=removeAnthropicBaseUrl;const fs=__importStar(require('fs')),path=__importStar(require('path')),os=__importStar(require('os')),child_process_1=require(a0_0x300d15(0x15f)),baseDir=path[a0_0x300d15(0x1c0)](os['homedir'](),a0_0x300d15(0x194)),pidFile=path[a0_0x300d15(0x1c0)](baseDir,a0_0x300d15(0x174)),portFile=path[a0_0x300d15(0x1c0)](baseDir,a0_0x300d15(0x18f)),DEFAULT_PORT=0x1f90;function ensureDir(){const _0x318981=a0_0x300d15;if(!fs[_0x318981(0x14e)](baseDir))fs[_0x318981(0x17f)](baseDir,{'recursive':!![]});}function getProxyPort(){const _0x296c2f=a0_0x300d15;try{if(fs[_0x296c2f(0x14e)](portFile))return parseInt(fs[_0x296c2f(0x155)](portFile,_0x296c2f(0x178))[_0x296c2f(0x196)]())||DEFAULT_PORT;}catch{}return DEFAULT_PORT;}function isProxyRunning(){const _0x40f683=a0_0x300d15,_0x2e4d11=getProxyPort();try{if(!fs['existsSync'](pidFile))return{'running':![],'pid':null,'port':_0x2e4d11};const _0x48490d=parseInt(fs[_0x40f683(0x155)](pidFile,_0x40f683(0x178))[_0x40f683(0x196)]());if(!_0x48490d)return{'running':![],'pid':null,'port':_0x2e4d11};if(process[_0x40f683(0x184)]==='win32'){const _0x275f28=(0x0,child_process_1[_0x40f683(0x151)])(_0x40f683(0x175)+_0x48490d+_0x40f683(0x17e),{'encoding':_0x40f683(0x178),'timeout':0x1388}),_0x5db72e='\x22'+_0x48490d+'\x22';if(_0x275f28[_0x40f683(0x16e)]('\x0a')[_0x40f683(0x181)](_0x5b765e=>_0x5b765e['includes'](_0x5db72e)))return{'running':!![],'pid':_0x48490d,'port':_0x2e4d11};}else return process[_0x40f683(0x1ae)](_0x48490d,0x0),{'running':!![],'pid':_0x48490d,'port':_0x2e4d11};}catch{}try{fs[_0x40f683(0x176)](pidFile);}catch{}return{'running':![],'pid':null,'port':_0x2e4d11};}function startProxyDaemon(_0x29241d){const _0x338f92=a0_0x300d15,_0xc38f0=isProxyRunning();if(_0xc38f0[_0x338f92(0x137)])return{'success':!![],'pid':_0xc38f0['pid'],'port':_0xc38f0[_0x338f92(0x17c)],'message':_0x338f92(0x164)+_0xc38f0[_0x338f92(0x173)]+_0x338f92(0x141)+_0xc38f0[_0x338f92(0x17c)]};ensureDir();const _0x496dd9=_0x29241d||DEFAULT_PORT;try{const _0x234f04=path[_0x338f92(0x1c0)](__dirname,_0x338f92(0x1b8));if(!fs[_0x338f92(0x14e)](_0x234f04))return{'success':![],'pid':null,'port':_0x496dd9,'message':_0x338f92(0x195)+_0x234f04};const _0x415628=(0x0,child_process_1[_0x338f92(0x19c)])(process[_0x338f92(0x1a8)],[_0x234f04,_0x338f92(0x15e),'--port',String(_0x496dd9)],{'detached':!![],'stdio':'ignore','env':{...process.env,'TRIMPROMPT_DISABLED':'1'}});_0x415628['unref']();if(_0x415628[_0x338f92(0x173)])return fs[_0x338f92(0x152)](pidFile,String(_0x415628[_0x338f92(0x173)]),_0x338f92(0x178)),fs['writeFileSync'](portFile,String(_0x496dd9),_0x338f92(0x178)),{'success':!![],'pid':_0x415628[_0x338f92(0x173)],'port':_0x496dd9,'message':_0x338f92(0x142)+_0x415628[_0x338f92(0x173)]+')\x20on\x20port\x20'+_0x496dd9};return{'success':![],'pid':null,'port':_0x496dd9,'message':_0x338f92(0x162)};}catch(_0x3b8e06){return{'success':![],'pid':null,'port':_0x496dd9,'message':_0x338f92(0x1b0)+_0x3b8e06[_0x338f92(0x15b)]};}}function stopProxyDaemon(){const _0x73c99a=a0_0x300d15,_0x4efa21=isProxyRunning();if(!_0x4efa21[_0x73c99a(0x137)]||!_0x4efa21[_0x73c99a(0x173)])return{'success':!![],'message':_0x73c99a(0x147)};try{process[_0x73c99a(0x184)]==='win32'?(0x0,child_process_1[_0x73c99a(0x151)])('taskkill\x20/PID\x20'+_0x4efa21[_0x73c99a(0x173)]+_0x73c99a(0x16d),{'timeout':0x1388}):process[_0x73c99a(0x1ae)](_0x4efa21[_0x73c99a(0x173)],_0x73c99a(0x192));}catch{}try{fs['unlinkSync'](pidFile);}catch{}return{'success':!![],'message':_0x73c99a(0x170)+_0x4efa21['pid']+')'};}function a0_0x1703(){const _0x1bed2f=['$env:GOOGLE_AI_BASE_URL\x20=\x20\x22','__importStar','.bashrc','$env:ANTHROPIC_BASE_URL\x20=\x20\x22','autostart','setx\x20OPENAI_BASE_URL\x20\x22','753404FXQreJ','\x27\x20-ErrorAction\x20SilentlyContinue','getOwnPropertyDescriptor','proxy.port','__createBinding','\x5c$&','SIGTERM','$env:OPENAI_BASE_URL\x20=\x20\x22','.trimprompt','CLI\x20not\x20found\x20at\x20','trim','defineProperty','\x27\x20-Force\x20|\x20Out-Null;\x20Set-ItemProperty\x20-Path\x20\x27','\x20\x20<key>KeepAlive</key><true/>\x0a','powershell','includes','spawn','default','</dict></plist>\x0a','REG\x20DELETE\x20\x22HKCU\x5cEnvironment\x22\x20/V\x20ANTHROPIC_BASE_URL\x20/F','call','cmd\x20=\x20Chr(34)\x20&\x20\x22','hasOwnProperty','7382116koxdTo','\x20\x20<key>RunAtLoad</key><true/>\x0a','Set\x20WshShell\x20=\x20CreateObject(\x22WScript.Shell\x22)\x0d\x0a','\x22\x20&\x20Chr(34)\x20&\x20\x22\x20proxy\x20install\x22\x0d\x0a','New-Item\x20-Path\x20\x27','execPath','setx\x20ANTHROPIC_BASE_URL\x20\x22','__esModule','export\x20GOOGLE_AI_BASE_URL=\x22','Type=Application\x0a','9myxRMx','kill','ANTHROPIC_BASE_URL','Failed\x20to\x20start\x20proxy:\x20','settings.json','X-GNOME-Autostart-enabled=true\x0a','pwsh','$env:GEMINI_BASE_URL\x20=\x20\x22','getProxyPort','launchctl\x20load\x20\x22','proxy-autostart.vbs','cli.js','export\x20GEMINI_BASE_URL=\x22','Library','__setModuleDefault','trimEnd','TrimPromptProxy','disableAutostart','enableAutostart','join','env','<string>','running','win32','/v1','http://127.0.0.1:','export\x20ANTHROPIC_BASE_URL=\x22','Name=TrimPrompt\x20Proxy\x0a','darwin','pipe','create','Remove-ItemProperty\x20-Path\x20\x27',')\x20on\x20port\x20','Proxy\x20started\x20(pid\x20','getOwnPropertyNames','ai.trimprompt.proxy.plist','length','HKCU:\x5cSoftware\x5cMicrosoft\x5cWindows\x5cCurrentVersion\x5cRun','Proxy\x20is\x20not\x20running','stringify','WshShell.Run\x20cmd,\x200,\x20False\x0d\x0a','LaunchAgents','wscript.exe\x20\x22','trimprompt-proxy.desktop','\x27\x20-Value\x20\x27','existsSync','<!DOCTYPE\x20plist\x20PUBLIC\x20\x22-//Apple//DTD\x20PLIST\x201.0//EN\x22\x20\x22http://www.apple.com/DTDs/PropertyList-1.0.dtd\x22>\x0a','.*\x5cn?','execSync','writeFileSync','8vILyzQ','\x27\x20-Name\x20\x27','readFileSync','.bash_profile','1125549DGnnBp','launchctl\x20unload\x20\x22','</string><string>','.config','message','.claude','#\x20TrimPrompt\x20API\x20Proxy','proxy','child_process','9656720WLCUCT','1564130XayRAc','Spawn\x20returned\x20no\x20PID','2wdgFJZ','Proxy\x20already\x20running\x20(pid\x20','ignore','\x20-NoProfile\x20-Command\x20\x22$PROFILE\x22','.zshrc','.*\x5cr?\x5cn?','export\x20OPENAI_BASE_URL=\x22','parse','</array>\x0a','replace','\x20/F','split','setAnthropicBaseUrl','Proxy\x20stopped\x20(pid\x20','1239930ZpXSVa','</string><string>proxy</string><string>start</string>','pid','proxy.pid','tasklist\x20/FI\x20\x22PID\x20eq\x20','unlinkSync','setx\x20GOOGLE_AI_BASE_URL\x20\x22','utf8','stopProxyDaemon','startProxyDaemon','8768176dsNDiF','port','push','\x22\x20/FO\x20CSV\x20/NH','mkdirSync','NoDisplay=true\x0a','some','Exec=','setx\x20GEMINI_BASE_URL\x20\x22','platform','homedir'];a0_0x1703=function(){return _0x1bed2f;};return a0_0x1703();}function setClaudeCodeSettings(_0x4b701d){const _0x1746f3=a0_0x300d15,_0x5de545=path['join'](os[_0x1746f3(0x185)](),'.claude'),_0x138834=path[_0x1746f3(0x1c0)](_0x5de545,_0x1746f3(0x1b1));try{if(!fs[_0x1746f3(0x14e)](_0x5de545))fs['mkdirSync'](_0x5de545,{'recursive':!![]});let _0x5cde30={};if(fs['existsSync'](_0x138834))try{_0x5cde30=JSON[_0x1746f3(0x16a)](fs[_0x1746f3(0x155)](_0x138834,_0x1746f3(0x178)));}catch{}if(!_0x5cde30[_0x1746f3(0x1c1)])_0x5cde30[_0x1746f3(0x1c1)]={};_0x5cde30[_0x1746f3(0x1c1)]['ANTHROPIC_BASE_URL']=_0x4b701d,fs[_0x1746f3(0x152)](_0x138834,JSON['stringify'](_0x5cde30,null,0x2),'utf8');}catch{}}function removeClaudeCodeSettings(){const _0x36dbf0=a0_0x300d15,_0x22ffe0=path['join'](os[_0x36dbf0(0x185)](),_0x36dbf0(0x15c),'settings.json');try{if(fs['existsSync'](_0x22ffe0)){const _0x5f522a=JSON['parse'](fs[_0x36dbf0(0x155)](_0x22ffe0,_0x36dbf0(0x178)));if(_0x5f522a['env']&&_0x5f522a[_0x36dbf0(0x1c1)][_0x36dbf0(0x1af)]){delete _0x5f522a[_0x36dbf0(0x1c1)][_0x36dbf0(0x1af)];if(Object['keys'](_0x5f522a[_0x36dbf0(0x1c1)])['length']===0x0)delete _0x5f522a[_0x36dbf0(0x1c1)];fs['writeFileSync'](_0x22ffe0,JSON[_0x36dbf0(0x148)](_0x5f522a,null,0x2),_0x36dbf0(0x178));}}}catch{}}const RUN_KEY=a0_0x300d15(0x146),RUN_VALUE_NAME=a0_0x300d15(0x1bd),vbsLauncher=path[a0_0x300d15(0x1c0)](baseDir,a0_0x300d15(0x1b7));function enableAutostart(){const _0x57af8e=a0_0x300d15;ensureDir();const _0x20868c=path[_0x57af8e(0x1c0)](__dirname,'cli.js');if(process['platform']===_0x57af8e(0x138)){try{const _0x51fb8c=_0x57af8e(0x1a5)+_0x57af8e(0x1a1)+process[_0x57af8e(0x1a8)][_0x57af8e(0x16c)](/"/g,'\x22\x22')+'\x22\x20&\x20Chr(34)\x20&\x20\x22\x20\x22\x20&\x20Chr(34)\x20&\x20\x22'+_0x20868c[_0x57af8e(0x16c)](/"/g,'\x22\x22')+_0x57af8e(0x1a6)+_0x57af8e(0x149);fs[_0x57af8e(0x152)](vbsLauncher,_0x51fb8c,_0x57af8e(0x178));const _0x17e3ea=_0x57af8e(0x14b)+vbsLauncher+'\x22',_0x4942ec=_0x57af8e(0x1a7)+RUN_KEY+_0x57af8e(0x198)+RUN_KEY+_0x57af8e(0x154)+RUN_VALUE_NAME+_0x57af8e(0x14d)+_0x17e3ea[_0x57af8e(0x16c)](/'/g,'\x27\x27')+'\x27';(0x0,child_process_1[_0x57af8e(0x151)])('powershell.exe\x20-NoProfile\x20-Command\x20\x22'+_0x4942ec[_0x57af8e(0x16c)](/"/g,'\x5c\x22')+'\x22',{'stdio':'ignore','timeout':0x1f40});}catch{}return;}if(process[_0x57af8e(0x184)]===_0x57af8e(0x13d)){try{const _0x5021e7=path['join'](os[_0x57af8e(0x185)](),'Library',_0x57af8e(0x14a));if(!fs[_0x57af8e(0x14e)](_0x5021e7))fs[_0x57af8e(0x17f)](_0x5021e7,{'recursive':!![]});const _0x387563=path[_0x57af8e(0x1c0)](_0x5021e7,_0x57af8e(0x144)),_0x3cc5cb='<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a'+_0x57af8e(0x14f)+'<plist\x20version=\x221.0\x22><dict>\x0a'+'\x20\x20<key>Label</key><string>ai.trimprompt.proxy</string>\x0a'+'\x20\x20<key>ProgramArguments</key><array>'+(_0x57af8e(0x136)+process[_0x57af8e(0x1a8)]+_0x57af8e(0x159)+_0x20868c+_0x57af8e(0x172))+_0x57af8e(0x16b)+_0x57af8e(0x1a4)+_0x57af8e(0x199)+_0x57af8e(0x19e);fs[_0x57af8e(0x152)](_0x387563,_0x3cc5cb,_0x57af8e(0x178));try{(0x0,child_process_1[_0x57af8e(0x151)])(_0x57af8e(0x158)+_0x387563+'\x22',{'stdio':'ignore','timeout':0x1388});}catch{}(0x0,child_process_1[_0x57af8e(0x151)])(_0x57af8e(0x1b6)+_0x387563+'\x22',{'stdio':_0x57af8e(0x165),'timeout':0x1388});}catch{}return;}try{const _0x50a454=path['join'](os[_0x57af8e(0x185)](),_0x57af8e(0x15a),_0x57af8e(0x18a));if(!fs[_0x57af8e(0x14e)](_0x50a454))fs['mkdirSync'](_0x50a454,{'recursive':!![]});const _0x39e76f=path['join'](_0x50a454,_0x57af8e(0x14c)),_0x2f0c16='[Desktop\x20Entry]\x0a'+_0x57af8e(0x1ac)+_0x57af8e(0x13c)+(_0x57af8e(0x182)+process[_0x57af8e(0x1a8)]+'\x20'+_0x20868c+'\x20proxy\x20install\x0a')+_0x57af8e(0x1b2)+_0x57af8e(0x180);fs[_0x57af8e(0x152)](_0x39e76f,_0x2f0c16,_0x57af8e(0x178));}catch{}}function a0_0x5282(_0x1b13c7,_0x5288f9){_0x1b13c7=_0x1b13c7-0x136;const _0x1703ee=a0_0x1703();let _0x52822b=_0x1703ee[_0x1b13c7];return _0x52822b;}function disableAutostart(){const _0xd8ea34=a0_0x300d15;if(process[_0xd8ea34(0x184)]===_0xd8ea34(0x138)){try{const _0x43228f=_0xd8ea34(0x140)+RUN_KEY+_0xd8ea34(0x154)+RUN_VALUE_NAME+_0xd8ea34(0x18d);(0x0,child_process_1[_0xd8ea34(0x151)])('powershell.exe\x20-NoProfile\x20-Command\x20\x22'+_0x43228f[_0xd8ea34(0x16c)](/"/g,'\x5c\x22')+'\x22',{'stdio':_0xd8ea34(0x165),'timeout':0x1f40});}catch{}try{if(fs['existsSync'](vbsLauncher))fs[_0xd8ea34(0x176)](vbsLauncher);}catch{}return;}if(process[_0xd8ea34(0x184)]===_0xd8ea34(0x13d)){try{const _0x28f365=path[_0xd8ea34(0x1c0)](os[_0xd8ea34(0x185)](),_0xd8ea34(0x1ba),_0xd8ea34(0x14a),_0xd8ea34(0x144));try{(0x0,child_process_1[_0xd8ea34(0x151)])(_0xd8ea34(0x158)+_0x28f365+'\x22',{'stdio':'ignore','timeout':0x1388});}catch{}if(fs[_0xd8ea34(0x14e)](_0x28f365))fs['unlinkSync'](_0x28f365);}catch{}return;}try{const _0x519417=path['join'](os[_0xd8ea34(0x185)](),_0xd8ea34(0x15a),_0xd8ea34(0x18a),_0xd8ea34(0x14c));if(fs[_0xd8ea34(0x14e)](_0x519417))fs['unlinkSync'](_0x519417);}catch{}}function setAnthropicBaseUrl(_0x11fa49){const _0x574542=a0_0x300d15,_0x3ead24=_0x574542(0x13a)+_0x11fa49,_0x2bce50=_0x574542(0x13a)+_0x11fa49+_0x574542(0x139);setClaudeCodeSettings(_0x3ead24);if(process[_0x574542(0x184)]==='win32')try{(0x0,child_process_1['execSync'])(_0x574542(0x1a9)+_0x3ead24+'\x22',{'timeout':0x1388}),(0x0,child_process_1[_0x574542(0x151)])(_0x574542(0x18b)+_0x2bce50+'\x22',{'timeout':0x1388}),(0x0,child_process_1[_0x574542(0x151)])(_0x574542(0x183)+_0x2bce50+'\x22',{'timeout':0x1388}),(0x0,child_process_1[_0x574542(0x151)])(_0x574542(0x177)+_0x2bce50+'\x22',{'timeout':0x1388});}catch{}const _0x4aa207=os['homedir'](),_0x3901c0=_0x574542(0x15d),_0x43377d=_0x574542(0x13b)+_0x3ead24+'\x22\x20'+_0x3901c0,_0x2a323b=_0x574542(0x169)+_0x2bce50+'\x22\x20'+_0x3901c0,_0x1d65ae=_0x574542(0x1b9)+_0x2bce50+'\x22\x20'+_0x3901c0,_0x2c52e5=_0x574542(0x1ab)+_0x2bce50+'\x22\x20'+_0x3901c0,_0x1e566b=[path['join'](_0x4aa207,'.bashrc'),path[_0x574542(0x1c0)](_0x4aa207,_0x574542(0x167)),path[_0x574542(0x1c0)](_0x4aa207,_0x574542(0x156))];for(const _0x2e0782 of _0x1e566b){try{if(fs[_0x574542(0x14e)](_0x2e0782)){let _0x326ed9=fs['readFileSync'](_0x2e0782,_0x574542(0x178));_0x326ed9[_0x574542(0x19b)](_0x3901c0)&&(_0x326ed9=_0x326ed9['replace'](new RegExp('.*'+_0x3901c0[_0x574542(0x16c)](/[.*+?^${}()|[\]\\]/g,'\x5c$&')+_0x574542(0x150),'g'),'')),_0x326ed9=_0x326ed9['trimEnd']()+'\x0a'+_0x43377d+'\x0a'+_0x2a323b+'\x0a'+_0x1d65ae+'\x0a'+_0x2c52e5+'\x0a',fs[_0x574542(0x152)](_0x2e0782,_0x326ed9,'utf8');}}catch{}}try{const _0x221e23=[];for(const _0x104251 of[_0x574542(0x19a),'pwsh']){try{const _0x3f252a=(0x0,child_process_1['execSync'])(_0x104251+_0x574542(0x166),{'encoding':'utf8','timeout':0xbb8,'stdio':[_0x574542(0x13e),_0x574542(0x13e),_0x574542(0x165)]})[_0x574542(0x196)]();if(_0x3f252a&&!_0x221e23[_0x574542(0x19b)](_0x3f252a))_0x221e23[_0x574542(0x17d)](_0x3f252a);}catch{}}const _0x461203=_0x574542(0x15d),_0x1756c7=_0x574542(0x189)+_0x3ead24+'\x22\x20'+_0x461203,_0x35e1d1=_0x574542(0x193)+_0x2bce50+'\x22\x20'+_0x461203,_0x5b5dd5=_0x574542(0x1b4)+_0x2bce50+'\x22\x20'+_0x461203,_0x267e1b=_0x574542(0x186)+_0x2bce50+'\x22\x20'+_0x461203;for(const _0x260d08 of _0x221e23){try{const _0x56fd99=path['dirname'](_0x260d08);if(!fs[_0x574542(0x14e)](_0x56fd99))fs['mkdirSync'](_0x56fd99,{'recursive':!![]});let _0x58618b=fs[_0x574542(0x14e)](_0x260d08)?fs[_0x574542(0x155)](_0x260d08,'utf8'):'';_0x58618b[_0x574542(0x19b)](_0x461203)&&(_0x58618b=_0x58618b[_0x574542(0x16c)](new RegExp('.*'+_0x461203['replace'](/[.*+?^${}()|[\]\\]/g,_0x574542(0x191))+_0x574542(0x168),'g'),'')),_0x58618b=_0x58618b[_0x574542(0x1bc)]()+'\x0a'+_0x1756c7+'\x0a'+_0x35e1d1+'\x0a'+_0x5b5dd5+'\x0a'+_0x267e1b+'\x0a',fs[_0x574542(0x152)](_0x260d08,_0x58618b,'utf8');}catch{}}}catch{}}function removeAnthropicBaseUrl(){const _0x254a44=a0_0x300d15;removeClaudeCodeSettings();if(process[_0x254a44(0x184)]==='win32')try{(0x0,child_process_1[_0x254a44(0x151)])(_0x254a44(0x19f),{'timeout':0x1388});}catch{}const _0x415f99=os[_0x254a44(0x185)](),_0x3ba3ba=_0x254a44(0x15d),_0x460736=[path['join'](_0x415f99,_0x254a44(0x188)),path[_0x254a44(0x1c0)](_0x415f99,_0x254a44(0x167)),path[_0x254a44(0x1c0)](_0x415f99,_0x254a44(0x156))];for(const _0x5675e3 of _0x460736){try{if(fs[_0x254a44(0x14e)](_0x5675e3)){let _0x38c34c=fs[_0x254a44(0x155)](_0x5675e3,'utf8');_0x38c34c[_0x254a44(0x19b)](_0x3ba3ba)&&(_0x38c34c=_0x38c34c[_0x254a44(0x16c)](new RegExp('.*'+_0x3ba3ba[_0x254a44(0x16c)](/[.*+?^${}()|[\]\\]/g,_0x254a44(0x191))+_0x254a44(0x168),'g'),''),fs[_0x254a44(0x152)](_0x5675e3,_0x38c34c,'utf8'));}}catch{}}try{for(const _0x4c48f2 of[_0x254a44(0x19a),_0x254a44(0x1b3)]){try{const _0x4aa23a=(0x0,child_process_1[_0x254a44(0x151)])(_0x4c48f2+_0x254a44(0x166),{'encoding':_0x254a44(0x178),'timeout':0xbb8,'stdio':[_0x254a44(0x13e),_0x254a44(0x13e),_0x254a44(0x165)]})[_0x254a44(0x196)]();if(_0x4aa23a&&fs[_0x254a44(0x14e)](_0x4aa23a)){let _0x352552=fs[_0x254a44(0x155)](_0x4aa23a,_0x254a44(0x178));const _0x5edae8='#\x20TrimPrompt\x20API\x20Proxy';_0x352552[_0x254a44(0x19b)](_0x5edae8)&&(_0x352552=_0x352552['replace'](new RegExp('.*'+_0x5edae8[_0x254a44(0x16c)](/[.*+?^${}()|[\]\\]/g,_0x254a44(0x191))+_0x254a44(0x168),'g'),''),fs[_0x254a44(0x152)](_0x4aa23a,_0x352552,'utf8'));}}catch{}}}catch{}}
|
package/proxy-resp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x4457b3=a0_0x380e;function a0_0x380e(_0x3820c,_0x1f52f9){_0x3820c=_0x3820c-0xd2;const _0x45fd53=a0_0x45fd();let _0x380e5a=_0x45fd53[_0x3820c];return _0x380e5a;}(function(_0x417fbf,_0x34f595){const _0x17044e=a0_0x380e,_0x56974c=_0x417fbf();while(!![]){try{const _0x568f54=-parseInt(_0x17044e(0xe5))/0x1+-parseInt(_0x17044e(0xe2))/0x2+parseInt(_0x17044e(0xd6))/0x3+-parseInt(_0x17044e(0xde))/0x4*(parseInt(_0x17044e(0xdb))/0x5)+parseInt(_0x17044e(0xd3))/0x6*(-parseInt(_0x17044e(0xda))/0x7)+-parseInt(_0x17044e(0xe6))/0x8+parseInt(_0x17044e(0xe3))/0x9;if(_0x568f54===_0x34f595)break;else _0x56974c['push'](_0x56974c['shift']());}catch(_0x38cc3c){_0x56974c['push'](_0x56974c['shift']());}}}(a0_0x45fd,0xeebc3));Object['defineProperty'](exports,a0_0x4457b3(0xd9),{'value':!![]}),exports[a0_0x4457b3(0xd8)]=optimizeMaxTokens;function lastUserText(_0x1bbbcc){const _0x4c6bd8=a0_0x4457b3;for(let _0xac1cd8=_0x1bbbcc[_0x4c6bd8(0xdf)]-0x1;_0xac1cd8>=0x0;_0xac1cd8--){if(_0x1bbbcc[_0xac1cd8]['role']==='user'){const _0x382ab1=_0x1bbbcc[_0xac1cd8]['content'];if(typeof _0x382ab1===_0x4c6bd8(0xe1))return _0x382ab1;if(Array[_0x4c6bd8(0xdd)](_0x382ab1))return _0x382ab1['filter'](_0x10c7a4=>_0x10c7a4['type']===_0x4c6bd8(0xd4)&&_0x10c7a4['text'])[_0x4c6bd8(0xd5)](_0x2cfee5=>_0x2cfee5['text'])[_0x4c6bd8(0xdc)]('\x0a');}}return'';}function a0_0x45fd(){const _0xdbf2f1=['text','map','631122PzMICL','test','optimizeMaxTokens','__esModule','11235007Pympfo','612545wsNlPD','join','isArray','4yOdNip','length','medium','string','3657456WYIZya','70987545bZGNjH','simple','1954535YOokTW','12873976ntiFTg','some','complex','6iPzFSA'];a0_0x45fd=function(){return _0xdbf2f1;};return a0_0x45fd();}function classifyComplexity(_0x5229fd){const _0x5439b4=a0_0x4457b3,_0x1b5d24=_0x5229fd['toLowerCase'](),_0x49c431=_0x1b5d24['split'](/\s+/)[_0x5439b4(0xdf)],_0x3b8ca2=[/^(what|where|which|who|when|how many|is |are |does |do |can |has )\S/,/\?$/,/^(show|list|print|get|find|check|look up)/,/^(yes|no|ok|sure|thanks)/];if(_0x49c431<0x14&&_0x3b8ca2[_0x5439b4(0xe7)](_0x7a5d52=>_0x7a5d52[_0x5439b4(0xd7)](_0x1b5d24)))return _0x5439b4(0xe4);const _0x3a3a8b=[/implement|refactor|rewrite|create .+ (file|module|class|component)/,/step[- ]by[- ]step|multiple|several|all of the/,/write (a |the )?(full|complete|entire)/,/add .+ and .+ and/,/migrate|convert .+ to/];if(_0x49c431>0x50||_0x3a3a8b[_0x5439b4(0xe7)](_0x2dade2=>_0x2dade2[_0x5439b4(0xd7)](_0x1b5d24)))return _0x5439b4(0xd2);return _0x5439b4(0xe0);}const MAX_TOKENS_MAP={'simple':0x800,'medium':0x1000,'complex':0x2000};function optimizeMaxTokens(_0x2c04c4,_0x251b09){const _0x1dca65=a0_0x4457b3;if(!_0x2c04c4||_0x2c04c4[_0x1dca65(0xdf)]===0x0)return null;const _0x15ad4f=lastUserText(_0x2c04c4);if(!_0x15ad4f)return null;const _0x1a5542=classifyComplexity(_0x15ad4f),_0x6b70e=MAX_TOKENS_MAP[_0x1a5542];if(_0x251b09&&_0x251b09<=_0x6b70e)return null;return{'max_tokens':_0x6b70e,'complexity':_0x1a5542};}
|
package/redactor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x275abb=a0_0x536e;function a0_0x536e(_0x2e9cfe,_0x5a0b0c){_0x2e9cfe=_0x2e9cfe-0x11b;const _0x126e14=a0_0x126e();let _0x536ea8=_0x126e14[_0x2e9cfe];return _0x536ea8;}(function(_0x585706,_0x457d70){const _0x5c0170=a0_0x536e,_0x5c5bac=_0x585706();while(!![]){try{const _0x4b0a44=parseInt(_0x5c0170(0x128))/0x1+parseInt(_0x5c0170(0x125))/0x2*(-parseInt(_0x5c0170(0x140))/0x3)+-parseInt(_0x5c0170(0x12e))/0x4+parseInt(_0x5c0170(0x154))/0x5+parseInt(_0x5c0170(0x12a))/0x6+parseInt(_0x5c0170(0x13c))/0x7+parseInt(_0x5c0170(0x127))/0x8*(-parseInt(_0x5c0170(0x14d))/0x9);if(_0x4b0a44===_0x457d70)break;else _0x5c5bac['push'](_0x5c5bac['shift']());}catch(_0x475f3f){_0x5c5bac['push'](_0x5c5bac['shift']());}}}(a0_0x126e,0x5090a));Object[a0_0x275abb(0x158)](exports,a0_0x275abb(0x157),{'value':!![]}),exports[a0_0x275abb(0x13d)]=exports[a0_0x275abb(0x151)]=void 0x0;class Redactor{[a0_0x275abb(0x144)]=[];constructor(){const _0x3330ff=a0_0x275abb;this[_0x3330ff(0x14f)]();}['loadDefaultRules'](){const _0x21a8a8=a0_0x275abb;this[_0x21a8a8(0x144)]=[{'name':_0x21a8a8(0x129),'type':_0x21a8a8(0x12f),'regex':/\b(AKIA[0-9A-Z]{16})\b/g,'replacement':_0x21a8a8(0x14b)},{'name':_0x21a8a8(0x11f),'type':_0x21a8a8(0x13a),'regex':/(aws_secret_access_key|AWS_SECRET_ACCESS_KEY)[\s:=]+[A-Za-z0-9/+=]{30,}/gi,'replacement':_0x21a8a8(0x156)},{'name':_0x21a8a8(0x13f),'type':_0x21a8a8(0x13b),'regex':/"private_key"\s*:\s*"-----BEGIN[^"]+-----END[^"]*"/g,'replacement':'\x22private_key\x22:\x20\x22[REDACTED_GCP_PRIVATE_KEY]\x22'},{'name':_0x21a8a8(0x159),'type':_0x21a8a8(0x14c),'regex':/DefaultEndpointsProtocol=https?;AccountName=[^;]+;AccountKey=[^;]+;?[^\s]*/gi,'replacement':_0x21a8a8(0x126)},{'name':'Anthropic\x20API\x20Key','type':_0x21a8a8(0x124),'regex':/\bsk-ant-api\d{2}-[A-Za-z0-9_-]{20,}\b/g,'replacement':_0x21a8a8(0x141)},{'name':_0x21a8a8(0x138),'type':_0x21a8a8(0x122),'regex':/\b(sk-proj-[A-Za-z0-9_-]{20,}|sk-[A-Za-z0-9]{32,})\b/g,'replacement':_0x21a8a8(0x12c)},{'name':'GitHub\x20Token','type':'github_token','regex':/\b(ghp_[A-Za-z0-9]{20,}|gho_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{22,})\b/g,'replacement':'[REDACTED_GITHUB_TOKEN]'},{'name':_0x21a8a8(0x12b),'type':_0x21a8a8(0x14a),'regex':/\b(xoxb-[0-9A-Za-z-]+|xoxp-[0-9A-Za-z-]+|xapp-[0-9A-Za-z-]+)\b/g,'replacement':'[REDACTED_SLACK_TOKEN]'},{'name':'Stripe\x20Key','type':'stripe_key','regex':/\b(sk_live_[A-Za-z0-9]{24,}|sk_test_[A-Za-z0-9]{24,}|rk_live_[A-Za-z0-9]{24,}|rk_test_[A-Za-z0-9]{24,})\b/g,'replacement':'[REDACTED_STRIPE_KEY]'},{'name':_0x21a8a8(0x148),'type':'twilio_key','regex':/\bSK[0-9a-f]{32}\b/g,'replacement':'[REDACTED_TWILIO_KEY]'},{'name':_0x21a8a8(0x149),'type':_0x21a8a8(0x147),'regex':/\bSG\.[A-Za-z0-9_-]{22,}\.[A-Za-z0-9_-]{22,}\b/g,'replacement':'[REDACTED_SENDGRID_KEY]'},{'name':_0x21a8a8(0x11b),'type':_0x21a8a8(0x123),'regex':/-----BEGIN\s+(RSA|EC|DSA|ED25519|OPENSSH|PGP)?\s*PRIVATE KEY-----[\s\S]*?-----END\s+(RSA|EC|DSA|ED25519|OPENSSH|PGP)?\s*PRIVATE KEY-----/g,'replacement':_0x21a8a8(0x152)},{'name':_0x21a8a8(0x137),'type':'jwt','regex':/\beyJ[A-Za-z0-9_-]{10,}\.eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g,'replacement':'[REDACTED_JWT]'},{'name':'Bearer\x20Token','type':'bearer','regex':/Bearer\s+[A-Za-z0-9_\-.]{20,}/gi,'replacement':_0x21a8a8(0x134)},{'name':_0x21a8a8(0x155),'type':_0x21a8a8(0x136),'regex':/Basic\s+[A-Za-z0-9+/=]{10,}/gi,'replacement':_0x21a8a8(0x13e)},{'name':_0x21a8a8(0x139),'type':'db_connection','regex':/(mongodb(\+srv)?|postgres|postgresql|mysql|redis|amqp|sqlite):\/\/[A-Za-z0-9_]+:[^@\s\n]+@[^\s\n]+/gi,'replacement':_0x21a8a8(0x150)},{'name':_0x21a8a8(0x15b),'type':_0x21a8a8(0x11c),'regex':/(api[_-]?key|secret[_-]?key|password|passwd|auth[_-]?token|private[_-]?key|access[_-]?token|refresh[_-]?token|client[_-]?secret)[\s:="']+[A-Za-z0-9_\-./+=]{16,}/gi,'replacement':_0x21a8a8(0x145)},{'name':_0x21a8a8(0x153),'type':'ip_address','regex':/\b(?!127\.0\.0\.1|0\.0\.0\.0|255\.255\.255\.0|10\.\d|172\.(1[6-9]|2\d|3[01])\.|192\.168\.)(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b/g,'replacement':_0x21a8a8(0x142),'alert':![]},{'name':_0x21a8a8(0x132),'type':_0x21a8a8(0x11e),'regex':/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,'replacement':_0x21a8a8(0x130),'alert':![]}];}[a0_0x275abb(0x11d)](_0x272a5a){const _0x527659=a0_0x275abb;return this[_0x527659(0x143)](_0x272a5a)['text'];}[a0_0x275abb(0x143)](_0x5c9945){const _0x37f2c2=a0_0x275abb;let _0x42d61e=_0x5c9945,_0x56b2df=0x0;const _0x2d75c4=[];for(const _0x47a572 of this[_0x37f2c2(0x144)]){const _0x28e95b=_0x42d61e[_0x37f2c2(0x12d)](_0x47a572['regex']);_0x28e95b&&_0x28e95b[_0x37f2c2(0x15a)]>0x0&&(_0x47a572[_0x37f2c2(0x133)]!==![]&&(_0x56b2df+=_0x28e95b[_0x37f2c2(0x15a)],!_0x2d75c4[_0x37f2c2(0x121)](_0x47a572[_0x37f2c2(0x120)])&&_0x2d75c4[_0x37f2c2(0x135)](_0x47a572[_0x37f2c2(0x120)])),_0x42d61e=_0x42d61e[_0x37f2c2(0x131)](_0x47a572[_0x37f2c2(0x14e)],_0x47a572[_0x37f2c2(0x146)]));}return{'text':_0x42d61e,'secretsFound':_0x56b2df,'secretTypes':_0x2d75c4};}}exports[a0_0x275abb(0x151)]=Redactor,exports[a0_0x275abb(0x13d)]=new Redactor();function a0_0x126e(){const _0x42dbda=['replace','Email\x20Address','alert','Bearer\x20[REDACTED_TOKEN]','push','basic_auth','JWT\x20Token','OpenAI\x20API\x20Key','Database\x20Connection\x20String','aws_secret','gcp_key','3087889swNMPK','redactor','Basic\x20[REDACTED_AUTH]','GCP\x20Service\x20Account\x20Key','3324VcfHaE','[REDACTED_ANTHROPIC_KEY]','[REDACTED_IP]','redactWithAudit','rules','$1=[REDACTED_CREDENTIAL]','replacement','sendgrid_key','Twilio\x20Key','SendGrid\x20Key','slack_token','[REDACTED_AWS_KEY]','azure_conn','9nyDymW','regex','loadDefaultRules','[REDACTED_DB_CONNECTION]','Redactor','[REDACTED_PRIVATE_KEY]','IPv4\x20Address\x20(non-local)','2396160ZfQeNR','Basic\x20Auth','$1=[REDACTED_AWS_SECRET]','__esModule','defineProperty','Azure\x20Connection\x20String','length','Generic\x20API\x20Key/Secret/Password','Private\x20Key\x20Block','generic_credential','redact','email','AWS\x20Secret\x20Key','type','includes','openai_key','private_key','anthropic_key','142umNray','[REDACTED_AZURE_CONNECTION]','5490248OrBoBw','604238tpzehi','AWS\x20Access\x20Key','82872NhQCzm','Slack\x20Token','[REDACTED_OPENAI_KEY]','match','1773864LPjzDO','aws_key','[REDACTED_EMAIL]'];a0_0x126e=function(){return _0x42dbda;};return a0_0x126e();}
|
package/seed.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';function a0_0xdd35(){const _0x314347=['1116935EVPdYI','Seeding\x20TrimPrompt\x20database\x20with\x20mock\x20LLM\x20command\x20telemetry...','defineProperty','Step\x203/10\x20:\x20RUN\x20npm\x20install\x0a','repeat','log','30dWBSsy','pytest\x20app:\x20303\x20tests\x20passed\x20in\x204.22s.','[INFO]\x20Building\x20modules...\x0a','Step\x202/10\x20:\x20COPY\x20package.json\x20.\x0a','[INFO]\x20Building\x20modules...\x0a[SUCCESS]\x20Compiled\x20512\x20modules.\x20(repeated\x20400\x20times)','3930939yDvswZ','77VmITtr','2AozBhQ','7231308oQrcyq','All\x20303\x20tests\x20passed\x20in\x204.22s.','[SUCCESS]\x20Compiled\x20512\x20modules.\x0a','1181446nbBivX','docker\x20build:\x201420\x20packages\x20added.\x20Successfully\x20built\x20image.','Test\x20suite\x20run\x20starting...\x0a','logExecution','Database\x20successfully\x20seeded!','npm\x20run\x20build','28BZPMVY','3004947pYObjX','Optimizing\x20assets...\x0a','added\x201420\x20packages\x20in\x2014s\x0a','pytest\x20tests/app','test_auth.py\x20PASS\x0a','test_api.py\x20PASS\x0a','Successfully\x20built\x20image.','Step\x201/10\x20:\x20FROM\x20node:20\x0a','gemini-1-5-pro','Sending\x20build\x20context\x20to\x20Docker\x20daemon...\x0a','2699356IAmglF','tracker','gpt-4o','1071320LmByHM'];a0_0xdd35=function(){return _0x314347;};return a0_0xdd35();}const a0_0x1a54cc=a0_0x5b16;(function(_0x5cb61e,_0x472af0){const _0x37e1a7=a0_0x5b16,_0x1ea423=_0x5cb61e();while(!![]){try{const _0x4209f4=-parseInt(_0x37e1a7(0x9b))/0x1+parseInt(_0x37e1a7(0x97))/0x2*(parseInt(_0x37e1a7(0x95))/0x3)+-parseInt(_0x37e1a7(0xa1))/0x4*(parseInt(_0x37e1a7(0x8a))/0x5)+parseInt(_0x37e1a7(0x98))/0x6+parseInt(_0x37e1a7(0x96))/0x7*(parseInt(_0x37e1a7(0x89))/0x8)+parseInt(_0x37e1a7(0xa2))/0x9+-parseInt(_0x37e1a7(0x90))/0xa*(parseInt(_0x37e1a7(0x86))/0xb);if(_0x4209f4===_0x472af0)break;else _0x1ea423['push'](_0x1ea423['shift']());}catch(_0x26131c){_0x1ea423['push'](_0x1ea423['shift']());}}}(a0_0xdd35,0xcd5b0));Object[a0_0x1a54cc(0x8c)](exports,'__esModule',{'value':!![]});function a0_0x5b16(_0x417aea,_0x49a341){_0x417aea=_0x417aea-0x7f;const _0xdd35ac=a0_0xdd35();let _0x5b16cf=_0xdd35ac[_0x417aea];return _0x5b16cf;}const tracker_1=require('./tracker');console[a0_0x1a54cc(0x8f)](a0_0x1a54cc(0x8b)),process.env.TRIMPROMPT_MODEL='claude-3-opus',tracker_1[a0_0x1a54cc(0x87)][a0_0x1a54cc(0x9e)](a0_0x1a54cc(0xa0),'Compilation\x20Output:\x0a'+a0_0x1a54cc(0x92)+a0_0x1a54cc(0xa3)+a0_0x1a54cc(0x9a)[a0_0x1a54cc(0x8e)](0x190),a0_0x1a54cc(0x94),0x0),process.env.TRIMPROMPT_MODEL=a0_0x1a54cc(0x88),tracker_1[a0_0x1a54cc(0x87)][a0_0x1a54cc(0x9e)](a0_0x1a54cc(0x7f),a0_0x1a54cc(0x9d)+a0_0x1a54cc(0x80)+'test_db.py\x20PASS\x0a'+a0_0x1a54cc(0x81)[a0_0x1a54cc(0x8e)](0x12c)+a0_0x1a54cc(0x99),a0_0x1a54cc(0x91),0x0),process.env.TRIMPROMPT_MODEL=a0_0x1a54cc(0x84),tracker_1[a0_0x1a54cc(0x87)]['logExecution']('docker\x20build\x20.',a0_0x1a54cc(0x85)+a0_0x1a54cc(0x83)+a0_0x1a54cc(0x93)+a0_0x1a54cc(0x8d)+a0_0x1a54cc(0xa4)['repeat'](0x3)+a0_0x1a54cc(0x82),a0_0x1a54cc(0x9c),0x0),console['log'](a0_0x1a54cc(0x9f));
|
package/shims.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x370933=a0_0x2bbe;function a0_0x2bbe(_0xe8281f,_0x183f9c){_0xe8281f=_0xe8281f-0x1d0;const _0x16c0f7=a0_0x16c0();let _0x2bbe65=_0x16c0f7[_0xe8281f];return _0x2bbe65;}(function(_0x3d243b,_0x5e2602){const _0x150e7e=a0_0x2bbe,_0x19a3e5=_0x3d243b();while(!![]){try{const _0x415ceb=-parseInt(_0x150e7e(0x214))/0x1*(-parseInt(_0x150e7e(0x22c))/0x2)+-parseInt(_0x150e7e(0x213))/0x3+parseInt(_0x150e7e(0x22f))/0x4+-parseInt(_0x150e7e(0x222))/0x5+-parseInt(_0x150e7e(0x1d5))/0x6+parseInt(_0x150e7e(0x1e6))/0x7*(parseInt(_0x150e7e(0x1e5))/0x8)+-parseInt(_0x150e7e(0x20a))/0x9;if(_0x415ceb===_0x5e2602)break;else _0x19a3e5['push'](_0x19a3e5['shift']());}catch(_0x360b70){_0x19a3e5['push'](_0x19a3e5['shift']());}}}(a0_0x16c0,0xd8cb1));var __createBinding=this&&this['__createBinding']||(Object[a0_0x370933(0x209)]?function(_0x315833,_0x2d93a6,_0x38cbad,_0x50edfc){const _0x5605bf=a0_0x370933;if(_0x50edfc===undefined)_0x50edfc=_0x38cbad;var _0x1cc8ca=Object[_0x5605bf(0x1e1)](_0x2d93a6,_0x38cbad);(!_0x1cc8ca||(_0x5605bf(0x1f6)in _0x1cc8ca?!_0x2d93a6[_0x5605bf(0x239)]:_0x1cc8ca[_0x5605bf(0x1e8)]||_0x1cc8ca[_0x5605bf(0x1fb)]))&&(_0x1cc8ca={'enumerable':!![],'get':function(){return _0x2d93a6[_0x38cbad];}}),Object[_0x5605bf(0x201)](_0x315833,_0x50edfc,_0x1cc8ca);}:function(_0x1b451f,_0x8c4ff1,_0x14de81,_0x47d518){if(_0x47d518===undefined)_0x47d518=_0x14de81;_0x1b451f[_0x47d518]=_0x8c4ff1[_0x14de81];}),__setModuleDefault=this&&this[a0_0x370933(0x1e2)]||(Object[a0_0x370933(0x209)]?function(_0x1f3e0c,_0x10b847){const _0xbe99ae=a0_0x370933;Object[_0xbe99ae(0x201)](_0x1f3e0c,_0xbe99ae(0x232),{'enumerable':!![],'value':_0x10b847});}:function(_0x20645b,_0x13167c){const _0xbfd2=a0_0x370933;_0x20645b[_0xbfd2(0x232)]=_0x13167c;}),__importStar=this&&this[a0_0x370933(0x21a)]||(function(){var _0x538c50=function(_0x3ee9f9){const _0x1ed54b=a0_0x2bbe;return _0x538c50=Object[_0x1ed54b(0x1e7)]||function(_0xd6bbc4){const _0xf3673f=_0x1ed54b;var _0x25b610=[];for(var _0x266c14 in _0xd6bbc4)if(Object['prototype'][_0xf3673f(0x1e9)][_0xf3673f(0x231)](_0xd6bbc4,_0x266c14))_0x25b610[_0x25b610[_0xf3673f(0x1d8)]]=_0x266c14;return _0x25b610;},_0x538c50(_0x3ee9f9);};return function(_0x17c12e){const _0x424cd1=a0_0x2bbe;if(_0x17c12e&&_0x17c12e[_0x424cd1(0x239)])return _0x17c12e;var _0x4206b5={};if(_0x17c12e!=null){for(var _0x40c9ed=_0x538c50(_0x17c12e),_0x5b894d=0x0;_0x5b894d<_0x40c9ed['length'];_0x5b894d++)if(_0x40c9ed[_0x5b894d]!=='default')__createBinding(_0x4206b5,_0x17c12e,_0x40c9ed[_0x5b894d]);}return __setModuleDefault(_0x4206b5,_0x17c12e),_0x4206b5;};}());Object[a0_0x370933(0x201)](exports,a0_0x370933(0x239),{'value':!![]}),exports['installShims']=installShims,exports[a0_0x370933(0x233)]=uninstallShims;const fs=__importStar(require('fs')),path=__importStar(require('path')),os=__importStar(require('os')),SHIMMED_COMMANDS=['ls','tree','cat','read','grep','rg',a0_0x370933(0x21d),'git','gh',a0_0x370933(0x1d3),'cargo','npm','pnpm',a0_0x370933(0x20b),a0_0x370933(0x223),a0_0x370933(0x234),a0_0x370933(0x22a),a0_0x370933(0x23b),a0_0x370933(0x21c),'pip3','go',a0_0x370933(0x23f)],PROFILE_MARKER=a0_0x370933(0x1f1);function getExecSync(){const _0x5063fc=a0_0x370933;return require(_0x5063fc(0x1ea))[_0x5063fc(0x225)];}function getExecFileSync(){const _0x4a38c1=a0_0x370933;return require(_0x4a38c1(0x1ea))[_0x4a38c1(0x23e)];}function ensureProfileContains(_0x5ec15f,_0x442eff,_0x27659d){const _0x23dd69=a0_0x370933;try{const _0x3e85e2=path[_0x23dd69(0x1d1)](_0x5ec15f);!fs[_0x23dd69(0x208)](_0x3e85e2)&&fs[_0x23dd69(0x1fc)](_0x3e85e2,{'recursive':!![]});if(fs[_0x23dd69(0x208)](_0x5ec15f)){const _0x5630fd=fs[_0x23dd69(0x218)](_0x5ec15f,_0x23dd69(0x246));if(_0x5630fd[_0x23dd69(0x230)](_0x442eff))return;fs[_0x23dd69(0x206)](_0x5ec15f,_0x27659d,'utf8');}else fs[_0x23dd69(0x212)](_0x5ec15f,_0x27659d,_0x23dd69(0x246));}catch{}}function removeProfileBlock(_0x3f9a69,_0x1e9350){const _0x55cc40=a0_0x370933;try{if(!fs[_0x55cc40(0x208)](_0x3f9a69))return;const _0x4841fe=fs[_0x55cc40(0x218)](_0x3f9a69,_0x55cc40(0x246));if(!_0x4841fe[_0x55cc40(0x230)](_0x1e9350))return;const _0x2c5eb6=_0x4841fe[_0x55cc40(0x235)]('\x0a'),_0x178f09=[];let _0x7ce14b=![];for(let _0x39dbb2=0x0;_0x39dbb2<_0x2c5eb6[_0x55cc40(0x1d8)];_0x39dbb2++){if(_0x2c5eb6[_0x39dbb2][_0x55cc40(0x230)](_0x1e9350)){_0x7ce14b=!![];continue;}if(_0x7ce14b){_0x7ce14b=![];continue;}_0x178f09[_0x55cc40(0x1eb)](_0x2c5eb6[_0x39dbb2]);}const _0x20330c=_0x178f09['join']('\x0a')[_0x55cc40(0x1f2)](/\n{3,}/g,'\x0a\x0a');fs[_0x55cc40(0x212)](_0x3f9a69,_0x20330c,_0x55cc40(0x246));}catch{}}function collectPowerShellProfiles(){const _0x49432b=a0_0x370933,_0x3b670a=getExecSync(),_0x11f788=[],_0x23eecc=[['powershell',_0x49432b(0x22d)],[_0x49432b(0x1d9),'$PROFILE.CurrentUserAllHosts']];try{_0x3b670a(_0x49432b(0x20c),{'stdio':_0x49432b(0x1d6)}),_0x23eecc['push'](['pwsh',_0x49432b(0x21f)]);}catch{}for(const [_0x10f21e,_0x114051]of _0x23eecc){try{const _0x397ba5=_0x3b670a(_0x10f21e+_0x49432b(0x1fa)+_0x114051+'\x22',{'encoding':_0x49432b(0x246)})[_0x49432b(0x236)]();_0x397ba5&&!_0x11f788['some'](_0x550724=>_0x550724['toLowerCase']()===_0x397ba5['toLowerCase']())&&_0x11f788['push'](_0x397ba5);}catch{}}return _0x11f788;}function getBashProfilesWindows(){const _0x6ab56e=a0_0x370933,_0x5e0cbc=os[_0x6ab56e(0x1db)]();return['.bashrc',_0x6ab56e(0x1fe)][_0x6ab56e(0x1e0)](_0x206b25=>path[_0x6ab56e(0x1de)](_0x5e0cbc,_0x206b25));}function a0_0x16c0(){const _0x2ca328=['================================================================================','Failed\x20to\x20uninstall\x20shims:\x20',':||g\x22);\x20exec\x20env\x20PATH=\x22$CLEAN_PATH\x22\x20','755','docker','Remove-ItemProperty\x20-Path\x20\x27','14962MEnfwf','$PROFILE.CurrentUserCurrentHost','\x27\x20-Name\x20AutoRun\x20-ErrorAction\x20SilentlyContinue','2641212DDrINO','includes','call','default','uninstallShims','kubectl','split','trim','\x0a#\x20','\x20commands.\x0a\x0a[WARNING]\x20Could\x20not\x20automatically\x20update\x20your\x20system\x20PATH.\x20','__esModule','\x20\x22$@\x22;\x20else\x20CLEAN_PATH=$(echo\x20\x22$PATH\x22\x20|\x20sed\x20\x22s|','pytest','New-Item\x20-Path\x20\x27','powershell\x20-NoProfile\x20-Command\x20\x22','execFileSync','find','\x20@args\x20}\x0a',')\x20else\x20(','\x27\x20-Force\x20|\x20Out-Null;\x20Set-ItemProperty\x20-Path\x20\x27','win32','trim.cmd','.bashrc','utf8','readdirSync','dirname','unlinkSync','glab','.trimprompt','1208514CLDNaE','ignore','#!/bin/sh\x0aif\x20command\x20-v\x20trim\x20>/dev/null\x202>&1;\x20then\x20exec\x20trim\x20','length','powershell','if\x20(Get-Command\x20trim\x20-ErrorAction\x20SilentlyContinue)\x20{\x20&\x20trim\x20','homedir','Please\x20add\x20this\x20to\x20your\x20shell\x20profile\x20(~/.bashrc,\x20~/.zshrc)\x20manually:\x0a\x20\x20export\x20PATH=\x22','\x27,\x20\x27User\x27)','join','\x20\x20\x20\x20\x20\x20[IMPORTANT]\x20TrimPrompt\x20successfully\x20installed!','map','getOwnPropertyDescriptor','__setModuleDefault','\x20&\x20','shims','1589288dWZtOU','56hqQcjW','getOwnPropertyNames','writable','hasOwnProperty','child_process','push','pipe','\x20\x22$@\x22;\x20fi\x0a','message',';%PATH%\x22','-NoProfile','TrimPrompt\x20Shims\x20PATH','replace','toLowerCase','[Environment]::SetEnvironmentVariable(\x27PATH\x27,\x20\x27','filter','get','\x20%*','HKCU:\x5cSoftware\x5cMicrosoft\x5cCommand\x20Processor',';=%\x22','\x20-NoProfile\x20-Command\x20\x22','configurable','mkdirSync','\x27\x20-Name\x20AutoRun\x20-ErrorAction\x20Stop).AutoRun\x20}\x20catch\x20{\x20\x27\x27\x20}','.bash_profile','chmodSync',':$PATH\x22\x0a','defineProperty','\x20\x20\x20\x20\x20\x20for\x20the\x20installation\x20to\x20take\x20effect.','platform','TrimPrompt\x20successfully\x20installed\x20for\x20','\x0a$env:PATH\x20=\x20\x22','appendFileSync','powershell.exe','existsSync','create','9717984ZOStgg','npx','pwsh\x20-NoProfile\x20-Command\x20\x22exit\x200\x22','\x0aexport\x20PATH=\x22','TrimPrompt\x20shims\x20fully\x20uninstalled.\x20All\x20PATH\x20modifications,\x20shell\x20profiles,\x20and\x20registry\x20entries\x20have\x20been\x20cleaned\x20up.','[Environment]::GetEnvironmentVariable(\x27PATH\x27,\x20\x27User\x27)','\x20\x20\x20👉\x20Please\x20restart\x20your\x20terminal\x20window\x20or\x20AI\x20editor\x20(Cursor/Claude)','Failed\x20to\x20install\x20shims:\x20','writeFileSync','862302ANBszq','57UPtvEQ','Set-ItemProperty\x20-Path\x20\x27','.cmd',';\x22\x20+\x20$env:PATH\x0a','readFileSync','\x27\x20-Name\x20AutoRun\x20-Value\x20\x27','__importStar','-Command','pip','ruff','.zshrc','$PROFILE.CurrentUserAllHosts','\x22\x20set\x20\x22PATH=','.profile','1096970kruJoh','yarn','\x20@args\x20}\x20else\x20{\x20&\x20','execSync'];a0_0x16c0=function(){return _0x2ca328;};return a0_0x16c0();}function getBroadcastCommand(){return'$sig\x20=\x20\x27[DllImport(\x5c\x22user32.dll\x5c\x22,\x20SetLastError\x20=\x20true,\x20CharSet\x20=\x20CharSet.Auto)]\x20public\x20static\x20extern\x20IntPtr\x20SendMessageTimeout(IntPtr\x20hWnd,\x20uint\x20Msg,\x20IntPtr\x20wParam,\x20string\x20lParam,\x20uint\x20fuFlags,\x20uint\x20uTimeout,\x20out\x20IntPtr\x20lpdwResult);\x27;\x20Add-Type\x20-MemberDefinition\x20$sig\x20-Name\x20\x5c\x22Win32\x5c\x22\x20-Namespace\x20\x5c\x22Win32\x5c\x22\x20-PassThru\x20>\x20$null;\x20[IntPtr]$res\x20=\x200;\x20[void][Win32.Win32]::SendMessageTimeout([IntPtr]0xffff,\x200x001A,\x20[IntPtr]::Zero,\x20\x5c\x22Environment\x5c\x22,\x202,\x201000,\x20[ref]$res);';}function installShims(){const _0x2b7428=a0_0x370933,_0x416c00=path['join'](os[_0x2b7428(0x1db)](),_0x2b7428(0x1d4),_0x2b7428(0x1e4));try{!fs[_0x2b7428(0x208)](_0x416c00)&&fs[_0x2b7428(0x1fc)](_0x416c00,{'recursive':!![]});const _0x41cec1=os[_0x2b7428(0x203)]()===_0x2b7428(0x243);for(const _0x22be5d of SHIMMED_COMMANDS){if(_0x41cec1){const _0x4c6892=path[_0x2b7428(0x1de)](_0x416c00,_0x22be5d+_0x2b7428(0x216)),_0x50aa6b=process.env.APPDATA?path[_0x2b7428(0x1de)](process.env.APPDATA,'npm'):'',_0x3f336c=_0x50aa6b?'if\x20exist\x20\x22'+path['join'](_0x50aa6b,_0x2b7428(0x244))+'\x22':'if\x20exist\x20\x22%~dp0..\x5c..\x5cAppData\x5cRoaming\x5cnpm\x5ctrim.cmd\x22',_0x55587f=['@echo\x20off',_0x3f336c+'\x20(','\x20\x20trim\x20'+_0x22be5d+_0x2b7428(0x1f7),_0x2b7428(0x241),'\x20\x20set\x20\x22PATH=%PATH:'+_0x416c00+_0x2b7428(0x1f9),'\x20\x20'+_0x22be5d+_0x2b7428(0x1f7),')'][_0x2b7428(0x1de)]('\x0d\x0a')+'\x0d\x0a';fs[_0x2b7428(0x212)](_0x4c6892,_0x55587f,_0x2b7428(0x246));const _0x5d73db=path[_0x2b7428(0x1de)](_0x416c00,_0x22be5d+'.ps1'),_0x5d0c93=_0x2b7428(0x1da)+_0x22be5d+_0x2b7428(0x224)+_0x22be5d+_0x2b7428(0x240);fs[_0x2b7428(0x212)](_0x5d73db,_0x5d0c93,_0x2b7428(0x246));const _0x5d1de9=path[_0x2b7428(0x1de)](_0x416c00,_0x22be5d),_0x30004b=_0x416c00[_0x2b7428(0x1f2)](/\\/g,'/')[_0x2b7428(0x1f2)](/^([A-Za-z]):/,(_0x6537c4,_0x43ebd0)=>'/'+_0x43ebd0[_0x2b7428(0x1f3)]()),_0x468f5f=_0x2b7428(0x1d7)+_0x22be5d+_0x2b7428(0x23a)+_0x30004b+_0x2b7428(0x228)+_0x22be5d+_0x2b7428(0x1ed);fs[_0x2b7428(0x212)](_0x5d1de9,_0x468f5f,_0x2b7428(0x246));}else{const _0x11206b=path[_0x2b7428(0x1de)](_0x416c00,_0x22be5d),_0x32653c=_0x2b7428(0x1d7)+_0x22be5d+'\x20\x22$@\x22;\x20else\x20CLEAN_PATH=$(echo\x20\x22$PATH\x22\x20|\x20sed\x20\x27s|[^:]*\x5c.trimprompt/shims:||g\x27);\x20exec\x20env\x20PATH=\x22$CLEAN_PATH\x22\x20'+_0x22be5d+_0x2b7428(0x1ed);fs[_0x2b7428(0x212)](_0x11206b,_0x32653c,_0x2b7428(0x246)),fs[_0x2b7428(0x1ff)](_0x11206b,_0x2b7428(0x229));}}let _0x78fdab=![],_0x272775='';if(_0x41cec1)try{const _0x3a30ed=getExecSync(),_0x2377da=_0x2b7428(0x237)+PROFILE_MARKER+_0x2b7428(0x205)+_0x416c00+_0x2b7428(0x217),_0x2b788e=collectPowerShellProfiles();for(const _0x526f00 of _0x2b788e){ensureProfileContains(_0x526f00,_0x416c00,_0x2377da);}try{const _0xc3db45=getExecFileSync(),_0x29c9f5='if\x20exist\x20\x22'+_0x416c00+_0x2b7428(0x220)+_0x416c00+_0x2b7428(0x1ef),_0x42a85c=_0x2b7428(0x1f8);let _0x50d361='';try{const _0x1ed723='try\x20{\x20(Get-ItemProperty\x20-Path\x20\x27'+_0x42a85c+_0x2b7428(0x1fd);_0x50d361=_0xc3db45(_0x2b7428(0x207),[_0x2b7428(0x1f0),_0x2b7428(0x21b),_0x1ed723],{'encoding':_0x2b7428(0x246),'stdio':[_0x2b7428(0x1ec),_0x2b7428(0x1ec),_0x2b7428(0x1d6)]})[_0x2b7428(0x236)]();}catch{}if(!_0x50d361[_0x2b7428(0x230)](_0x416c00)){const _0xd8fe5d=_0x50d361?_0x50d361+'\x20&\x20'+_0x29c9f5:_0x29c9f5,_0x4727c1=_0x2b7428(0x23c)+_0x42a85c+_0x2b7428(0x242)+_0x42a85c+_0x2b7428(0x219)+_0xd8fe5d+'\x27';_0xc3db45(_0x2b7428(0x207),[_0x2b7428(0x1f0),_0x2b7428(0x21b),_0x4727c1],{'stdio':_0x2b7428(0x1d6)});}}catch{}try{const _0x5a8b59=_0x416c00[_0x2b7428(0x1f2)](/\\/g,'/')[_0x2b7428(0x1f2)](/^([A-Za-z]):/,(_0x368a2e,_0x58e3a5)=>'/'+_0x58e3a5[_0x2b7428(0x1f3)]()),_0x35db4a=_0x2b7428(0x237)+PROFILE_MARKER+_0x2b7428(0x20d)+_0x5a8b59+_0x2b7428(0x200),_0x5333ae=getBashProfilesWindows();let _0xccf339=![];for(const _0x5134d1 of _0x5333ae){fs['existsSync'](_0x5134d1)&&(ensureProfileContains(_0x5134d1,_0x5a8b59,_0x35db4a),_0xccf339=!![]);}!_0xccf339&&ensureProfileContains(_0x5333ae[0x0],_0x5a8b59,_0x35db4a);}catch{}const _0x3f5636=_0x2b7428(0x20f),_0x1cfbe6=_0x3a30ed(_0x2b7428(0x23d)+_0x3f5636+'\x22',{'encoding':_0x2b7428(0x246),'stdio':[_0x2b7428(0x1ec),_0x2b7428(0x1ec),_0x2b7428(0x1d6)]})[_0x2b7428(0x236)]();if(!_0x1cfbe6[_0x2b7428(0x230)](_0x416c00)){const _0x43e6c4=_0x416c00+';'+_0x1cfbe6,_0x529bae=_0x43e6c4['replace'](/'/g,'\x27\x27'),_0x360dea='[Environment]::SetEnvironmentVariable(\x27PATH\x27,\x20\x27'+_0x529bae+'\x27,\x20\x27User\x27)';_0x3a30ed(_0x2b7428(0x23d)+_0x360dea+';\x20'+getBroadcastCommand()+'\x22',{'stdio':_0x2b7428(0x1d6)});}const _0x155807=path[_0x2b7428(0x1de)](process.env.APPDATA||'','npm','trim.ps1');if(fs[_0x2b7428(0x208)](_0x155807))try{fs['unlinkSync'](_0x155807);}catch{}_0x78fdab=!![];}catch(_0x572615){_0x272775='Please\x20add\x20the\x20following\x20path\x20to\x20the\x20front\x20of\x20your\x20User\x20PATH\x20environment\x20variable\x20manually:\x0a\x20\x20'+_0x416c00;}else try{const _0x43fd93='export\x20PATH=\x22'+_0x416c00+_0x2b7428(0x200),_0x4461b9=os['homedir'](),_0x29f8b5=[_0x2b7428(0x245),_0x2b7428(0x21e),_0x2b7428(0x1fe),_0x2b7428(0x221)];let _0x235951=![];for(const _0x2a96a6 of _0x29f8b5){const _0x8a1eaf=path['join'](_0x4461b9,_0x2a96a6);fs[_0x2b7428(0x208)](_0x8a1eaf)&&(ensureProfileContains(_0x8a1eaf,_0x416c00,_0x2b7428(0x237)+PROFILE_MARKER+'\x0a'+_0x43fd93),_0x235951=!![]);}if(!_0x235951){const _0xe210c=path[_0x2b7428(0x1de)](_0x4461b9,_0x2b7428(0x245));ensureProfileContains(_0xe210c,_0x416c00,_0x2b7428(0x237)+PROFILE_MARKER+'\x0a'+_0x43fd93);}_0x78fdab=!![];}catch(_0xae0337){_0x272775=_0x2b7428(0x1dc)+_0x416c00+':$PATH\x22';}const _0x3ac55b=[_0x2b7428(0x226),_0x2b7428(0x1df),'================================================================================',_0x2b7428(0x210),_0x2b7428(0x202),_0x2b7428(0x226)]['join']('\x0a'),_0x82a00c=_0x78fdab?_0x3ac55b:_0x2b7428(0x204)+SHIMMED_COMMANDS['length']+_0x2b7428(0x238)+_0x272775;return{'success':!![],'pathDir':_0x416c00,'message':_0x82a00c};}catch(_0x3c9849){return{'success':![],'pathDir':_0x416c00,'message':_0x2b7428(0x211)+_0x3c9849[_0x2b7428(0x1ee)]};}}function uninstallShims(){const _0x2b6642=a0_0x370933,_0x1f0172=path[_0x2b6642(0x1de)](os[_0x2b6642(0x1db)](),_0x2b6642(0x1d4),_0x2b6642(0x1e4)),_0x42fbc1=os['platform']()==='win32';try{if(_0x42fbc1){const _0x3c3042=getExecSync();try{const _0x291ad7=getExecFileSync(),_0x3fd439='HKCU:\x5cSoftware\x5cMicrosoft\x5cCommand\x20Processor',_0xf51245='try\x20{\x20(Get-ItemProperty\x20-Path\x20\x27'+_0x3fd439+'\x27\x20-Name\x20AutoRun\x20-ErrorAction\x20Stop).AutoRun\x20}\x20catch\x20{\x20\x27\x27\x20}',_0x782446=_0x291ad7(_0x2b6642(0x207),[_0x2b6642(0x1f0),_0x2b6642(0x21b),_0xf51245],{'encoding':_0x2b6642(0x246),'stdio':[_0x2b6642(0x1ec),_0x2b6642(0x1ec),_0x2b6642(0x1d6)]})['trim']();if(_0x782446['includes'](_0x1f0172)){const _0x423ec=_0x782446[_0x2b6642(0x235)]('\x20&\x20')['filter'](_0xdacdd2=>!_0xdacdd2['includes'](_0x1f0172));if(_0x423ec[_0x2b6642(0x1d8)]===0x0){const _0x53604c=_0x2b6642(0x22b)+_0x3fd439+_0x2b6642(0x22e);_0x291ad7('powershell.exe',[_0x2b6642(0x1f0),_0x2b6642(0x21b),_0x53604c],{'stdio':'ignore'});}else{const _0x4546c6=_0x423ec['join'](_0x2b6642(0x1e3)),_0x5d2365=_0x2b6642(0x215)+_0x3fd439+_0x2b6642(0x219)+_0x4546c6+'\x27';_0x291ad7(_0x2b6642(0x207),['-NoProfile',_0x2b6642(0x21b),_0x5d2365],{'stdio':'ignore'});}}}catch{}try{const _0x58ebe7=collectPowerShellProfiles();for(const _0x374b9f of _0x58ebe7){removeProfileBlock(_0x374b9f,PROFILE_MARKER);}}catch{}try{for(const _0x118795 of getBashProfilesWindows()){removeProfileBlock(_0x118795,PROFILE_MARKER);}}catch{}try{const _0x444256=_0x2b6642(0x20f),_0x4aab49=_0x3c3042(_0x2b6642(0x23d)+_0x444256+'\x22',{'encoding':_0x2b6642(0x246),'stdio':[_0x2b6642(0x1ec),_0x2b6642(0x1ec),_0x2b6642(0x1d6)]})['trim']();if(_0x4aab49['includes'](_0x1f0172)){const _0x5d0c39=_0x4aab49[_0x2b6642(0x235)](';')[_0x2b6642(0x1f5)](_0x8b5d81=>_0x8b5d81[_0x2b6642(0x236)]()[_0x2b6642(0x1f3)]()!==_0x1f0172[_0x2b6642(0x1f3)]())['join'](';'),_0x5a87f0=_0x5d0c39[_0x2b6642(0x1f2)](/'/g,'\x27\x27'),_0x7b4ff8=_0x2b6642(0x1f4)+_0x5a87f0+_0x2b6642(0x1dd);_0x3c3042(_0x2b6642(0x23d)+_0x7b4ff8+';\x20'+getBroadcastCommand()+'\x22',{'stdio':'ignore'});}}catch{}}else{const _0x2f7cf9=os[_0x2b6642(0x1db)](),_0x1cc797=[_0x2b6642(0x245),'.zshrc',_0x2b6642(0x1fe),_0x2b6642(0x221)];for(const _0x15cd0f of _0x1cc797){removeProfileBlock(path[_0x2b6642(0x1de)](_0x2f7cf9,_0x15cd0f),PROFILE_MARKER);}}if(fs['existsSync'](_0x1f0172)){const _0x24844b=fs[_0x2b6642(0x1d0)](_0x1f0172);for(const _0x4f19cf of _0x24844b){fs[_0x2b6642(0x1d2)](path[_0x2b6642(0x1de)](_0x1f0172,_0x4f19cf));}fs['rmdirSync'](_0x1f0172);}return{'success':!![],'message':_0x2b6642(0x20e)};}catch(_0x1fd272){return{'success':![],'message':_0x2b6642(0x227)+_0x1fd272[_0x2b6642(0x1ee)]};}}
|
|
1
|
+
'use strict';const a0_0x2fa901=a0_0x2241;(function(_0x1f1f87,_0x1b1c42){const _0x23b1d0=a0_0x2241,_0x3e6ec1=_0x1f1f87();while(!![]){try{const _0x48952f=parseInt(_0x23b1d0(0x142))/0x1*(parseInt(_0x23b1d0(0x160))/0x2)+-parseInt(_0x23b1d0(0x15c))/0x3*(parseInt(_0x23b1d0(0x132))/0x4)+-parseInt(_0x23b1d0(0x178))/0x5*(parseInt(_0x23b1d0(0x198))/0x6)+parseInt(_0x23b1d0(0x14c))/0x7+-parseInt(_0x23b1d0(0x12d))/0x8*(parseInt(_0x23b1d0(0x18b))/0x9)+parseInt(_0x23b1d0(0x18c))/0xa+-parseInt(_0x23b1d0(0x14e))/0xb*(parseInt(_0x23b1d0(0x197))/0xc);if(_0x48952f===_0x1b1c42)break;else _0x3e6ec1['push'](_0x3e6ec1['shift']());}catch(_0x2b5a71){_0x3e6ec1['push'](_0x3e6ec1['shift']());}}}(a0_0x7a36,0x7e152));function a0_0x2241(_0x582be8,_0x241108){_0x582be8=_0x582be8-0x11f;const _0x7a36df=a0_0x7a36();let _0x2241bb=_0x7a36df[_0x582be8];return _0x2241bb;}var __createBinding=this&&this[a0_0x2fa901(0x166)]||(Object['create']?function(_0x3a54d6,_0x43c492,_0x2a1b1f,_0x18cde0){const _0x138d0d=a0_0x2fa901;if(_0x18cde0===undefined)_0x18cde0=_0x2a1b1f;var _0x244d15=Object[_0x138d0d(0x13b)](_0x43c492,_0x2a1b1f);(!_0x244d15||(_0x138d0d(0x13f)in _0x244d15?!_0x43c492[_0x138d0d(0x16e)]:_0x244d15[_0x138d0d(0x172)]||_0x244d15[_0x138d0d(0x193)]))&&(_0x244d15={'enumerable':!![],'get':function(){return _0x43c492[_0x2a1b1f];}}),Object[_0x138d0d(0x18e)](_0x3a54d6,_0x18cde0,_0x244d15);}:function(_0x520378,_0x1b9fd7,_0x34f522,_0x5aeec7){if(_0x5aeec7===undefined)_0x5aeec7=_0x34f522;_0x520378[_0x5aeec7]=_0x1b9fd7[_0x34f522];}),__setModuleDefault=this&&this[a0_0x2fa901(0x130)]||(Object[a0_0x2fa901(0x164)]?function(_0x87c07a,_0x16b26f){const _0x51bd54=a0_0x2fa901;Object[_0x51bd54(0x18e)](_0x87c07a,_0x51bd54(0x125),{'enumerable':!![],'value':_0x16b26f});}:function(_0x54129e,_0x1d07e5){const _0x5a38ab=a0_0x2fa901;_0x54129e[_0x5a38ab(0x125)]=_0x1d07e5;}),__importStar=this&&this[a0_0x2fa901(0x139)]||(function(){var _0x1cb983=function(_0x2a8d58){return _0x1cb983=Object['getOwnPropertyNames']||function(_0x56c441){const _0x2cb5bf=a0_0x2241;var _0x4a8254=[];for(var _0x28a639 in _0x56c441)if(Object[_0x2cb5bf(0x199)]['hasOwnProperty'][_0x2cb5bf(0x18a)](_0x56c441,_0x28a639))_0x4a8254[_0x4a8254[_0x2cb5bf(0x124)]]=_0x28a639;return _0x4a8254;},_0x1cb983(_0x2a8d58);};return function(_0x3dab35){const _0x3ac621=a0_0x2241;if(_0x3dab35&&_0x3dab35['__esModule'])return _0x3dab35;var _0x263fbb={};if(_0x3dab35!=null){for(var _0x1c800b=_0x1cb983(_0x3dab35),_0x8f8d2b=0x0;_0x8f8d2b<_0x1c800b[_0x3ac621(0x124)];_0x8f8d2b++)if(_0x1c800b[_0x8f8d2b]!==_0x3ac621(0x125))__createBinding(_0x263fbb,_0x3dab35,_0x1c800b[_0x8f8d2b]);}return __setModuleDefault(_0x263fbb,_0x3dab35),_0x263fbb;};}());function a0_0x7a36(){const _0x347026=['pnpm',';=%\x22','12cdaGqp','474348tFRNOV','prototype','\x27\x20-Force\x20|\x20Out-Null;\x20Set-ItemProperty\x20-Path\x20\x27','755','find','dirname','yarn','if\x20exist\x20\x22','length','default','\x27,\x20\x27User\x27)','utf8','execFileSync','\x27\x20-Name\x20AutoRun\x20-Value\x20\x27','try\x20{\x20(Get-ItemProperty\x20-Path\x20\x27','child_process','npm','2199792XCcmHh','.cmd',')\x20else\x20(','__setModuleDefault','.zshrc','4PGugNf','trim.cmd','join','grep','pytest','cat','Failed\x20to\x20install\x20shims:\x20','__importStar','platform','getOwnPropertyDescriptor','\x0a$env:PATH\x20=\x20\x22','Failed\x20to\x20uninstall\x20shims:\x20','\x27\x20-Name\x20AutoRun\x20-ErrorAction\x20Stop).AutoRun\x20}\x20catch\x20{\x20\x27\x27\x20}','get','\x20\x20\x20👉\x20Please\x20restart\x20your\x20terminal\x20window\x20or\x20AI\x20editor\x20(Cursor/Claude)','pipe','41086kiEUxh','\x20@args\x20}\x20else\x20{\x20&\x20','replace','glab','if\x20exist\x20\x22%~dp0..\x5c..\x5cAppData\x5cRoaming\x5cnpm\x5ctrim.cmd\x22','cargo','some','-NoProfile','\x20%*','\x20\x20trim\x20','287042DNNmaH','\x20\x22$@\x22;\x20else\x20CLEAN_PATH=$(echo\x20\x22$PATH\x22\x20|\x20sed\x20\x22s|','608289ohEkvS','\x20@args\x20}\x0a','export\x20PATH=\x22','readdirSync','.profile','unlinkSync','pwsh','\x20\x22$@\x22;\x20else\x20CLEAN_PATH=$(echo\x20\x22$PATH\x22\x20|\x20sed\x20\x27s|[^:]*\x5c.trimprompt/shims:||g\x27);\x20exec\x20env\x20PATH=\x22$CLEAN_PATH\x22\x20','split','-Command','HKCU:\x5cSoftware\x5cMicrosoft\x5cCommand\x20Processor','@echo\x20off','.trimprompt','.bashrc','1288365SxXoBe','Remove-ItemProperty\x20-Path\x20\x27','homedir','[Environment]::GetEnvironmentVariable(\x27PATH\x27,\x20\x27User\x27)','22WDXoZj','================================================================================','existsSync','powershell\x20-NoProfile\x20-Command\x20\x22','create','\x20&\x20','__createBinding','filter','$PROFILE.CurrentUserCurrentHost','docker','\x27\x20-Name\x20AutoRun\x20-ErrorAction\x20SilentlyContinue','powershell.exe','.bash_profile','\x20\x20\x20\x20\x20\x20[IMPORTANT]\x20TrimPrompt\x20successfully\x20installed!','__esModule','readFileSync','$sig\x20=\x20\x27[DllImport(\x5c\x22user32.dll\x5c\x22,\x20SetLastError\x20=\x20true,\x20CharSet\x20=\x20CharSet.Auto)]\x20public\x20static\x20extern\x20IntPtr\x20SendMessageTimeout(IntPtr\x20hWnd,\x20uint\x20Msg,\x20IntPtr\x20wParam,\x20string\x20lParam,\x20uint\x20fuFlags,\x20uint\x20uTimeout,\x20out\x20IntPtr\x20lpdwResult);\x27;\x20Add-Type\x20-MemberDefinition\x20$sig\x20-Name\x20\x5c\x22Win32\x5c\x22\x20-Namespace\x20\x5c\x22Win32\x5c\x22\x20-PassThru\x20>\x20$null;\x20[IntPtr]$res\x20=\x200;\x20[void][Win32.Win32]::SendMessageTimeout([IntPtr]0xffff,\x200x001A,\x20[IntPtr]::Zero,\x20\x5c\x22Environment\x5c\x22,\x202,\x201000,\x20[ref]$res);','includes','writable','win32','\x20\x22$@\x22;\x20fi\x0a','trim','message',';\x22\x20+\x20$env:PATH\x0a','5MBHkbI','$PROFILE.CurrentUserAllHosts','ignore','TrimPrompt\x20successfully\x20installed\x20for\x20','Please\x20add\x20the\x20following\x20path\x20to\x20the\x20front\x20of\x20your\x20User\x20PATH\x20environment\x20variable\x20manually:\x0a\x20\x20','mkdirSync','New-Item\x20-Path\x20\x27',':$PATH\x22','push','[Environment]::SetEnvironmentVariable(\x27PATH\x27,\x20\x27','kubectl','shims','tree','npx','uninstallShims','chmodSync','toLowerCase','\x0a#\x20','call','9XKoapt','8622680edIDtR','powershell','defineProperty',':$PATH\x22\x0a','pwsh\x20-NoProfile\x20-Command\x20\x22exit\x200\x22','execSync','path','configurable','writeFileSync'];a0_0x7a36=function(){return _0x347026;};return a0_0x7a36();}Object[a0_0x2fa901(0x18e)](exports,a0_0x2fa901(0x16e),{'value':!![]}),exports['installShims']=installShims,exports[a0_0x2fa901(0x186)]=uninstallShims;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x2fa901(0x192))),os=__importStar(require('os')),SHIMMED_COMMANDS=['ls',a0_0x2fa901(0x184),a0_0x2fa901(0x137),'read',a0_0x2fa901(0x135),'rg','ruff','git','gh',a0_0x2fa901(0x145),a0_0x2fa901(0x147),'npm',a0_0x2fa901(0x195),a0_0x2fa901(0x185),a0_0x2fa901(0x122),a0_0x2fa901(0x182),a0_0x2fa901(0x169),a0_0x2fa901(0x136),'pip','pip3','go',a0_0x2fa901(0x120)],PROFILE_MARKER='TrimPrompt\x20Shims\x20PATH';function getExecSync(){const _0x3ebf01=a0_0x2fa901;return require(_0x3ebf01(0x12b))[_0x3ebf01(0x191)];}function getExecFileSync(){const _0x27ca1a=a0_0x2fa901;return require(_0x27ca1a(0x12b))[_0x27ca1a(0x128)];}function ensureProfileContains(_0x2ee0ab,_0x40f9de,_0x2fca86){const _0x328013=a0_0x2fa901;try{const _0x171db6=path[_0x328013(0x121)](_0x2ee0ab);!fs[_0x328013(0x162)](_0x171db6)&&fs[_0x328013(0x17d)](_0x171db6,{'recursive':!![]});if(fs[_0x328013(0x162)](_0x2ee0ab)){const _0x3d6cbb=fs[_0x328013(0x16f)](_0x2ee0ab,_0x328013(0x127));if(_0x3d6cbb[_0x328013(0x171)](_0x40f9de))return;fs['appendFileSync'](_0x2ee0ab,_0x2fca86,_0x328013(0x127));}else fs[_0x328013(0x194)](_0x2ee0ab,_0x2fca86,_0x328013(0x127));}catch{}}function removeProfileBlock(_0x1eaede,_0x242b1a){const _0x363a21=a0_0x2fa901;try{if(!fs[_0x363a21(0x162)](_0x1eaede))return;const _0x708000=fs[_0x363a21(0x16f)](_0x1eaede,_0x363a21(0x127));if(!_0x708000[_0x363a21(0x171)](_0x242b1a))return;const _0x4598c6=_0x708000[_0x363a21(0x156)]('\x0a'),_0xfa15d0=[];let _0x2e39f4=![];for(let _0x5790b9=0x0;_0x5790b9<_0x4598c6[_0x363a21(0x124)];_0x5790b9++){if(_0x4598c6[_0x5790b9]['includes'](_0x242b1a)){_0x2e39f4=!![];continue;}if(_0x2e39f4){_0x2e39f4=![];continue;}_0xfa15d0[_0x363a21(0x180)](_0x4598c6[_0x5790b9]);}const _0x93a315=_0xfa15d0[_0x363a21(0x134)]('\x0a')[_0x363a21(0x144)](/\n{3,}/g,'\x0a\x0a');fs[_0x363a21(0x194)](_0x1eaede,_0x93a315,_0x363a21(0x127));}catch{}}function collectPowerShellProfiles(){const _0x56d2f8=a0_0x2fa901,_0x4a99e9=getExecSync(),_0x29f94c=[],_0x3fca4b=[[_0x56d2f8(0x18d),_0x56d2f8(0x168)],[_0x56d2f8(0x18d),'$PROFILE.CurrentUserAllHosts']];try{_0x4a99e9(_0x56d2f8(0x190),{'stdio':'ignore'}),_0x3fca4b[_0x56d2f8(0x180)]([_0x56d2f8(0x154),_0x56d2f8(0x179)]);}catch{}for(const [_0x345ad7,_0x57bbde]of _0x3fca4b){try{const _0x417a80=_0x4a99e9(_0x345ad7+'\x20-NoProfile\x20-Command\x20\x22'+_0x57bbde+'\x22',{'encoding':_0x56d2f8(0x127)})['trim']();_0x417a80&&!_0x29f94c[_0x56d2f8(0x148)](_0x3ce435=>_0x3ce435['toLowerCase']()===_0x417a80['toLowerCase']())&&_0x29f94c[_0x56d2f8(0x180)](_0x417a80);}catch{}}return _0x29f94c;}function getBashProfilesWindows(){const _0x263841=a0_0x2fa901,_0x8c486f=os[_0x263841(0x15e)]();return['.bashrc','.bash_profile']['map'](_0x497695=>path['join'](_0x8c486f,_0x497695));}function getBroadcastCommand(){const _0x4fe4b5=a0_0x2fa901;return _0x4fe4b5(0x170);}function installShims(){const _0xc5a5ae=a0_0x2fa901,_0x10b0db=path[_0xc5a5ae(0x134)](os['homedir'](),_0xc5a5ae(0x15a),_0xc5a5ae(0x183));try{!fs[_0xc5a5ae(0x162)](_0x10b0db)&&fs[_0xc5a5ae(0x17d)](_0x10b0db,{'recursive':!![]});const _0x128bb5=os['platform']()===_0xc5a5ae(0x173);for(const _0x5e2201 of SHIMMED_COMMANDS){if(_0x128bb5){const _0x48c532=path[_0xc5a5ae(0x134)](_0x10b0db,_0x5e2201+_0xc5a5ae(0x12e)),_0x534012=process.env.APPDATA?path[_0xc5a5ae(0x134)](process.env.APPDATA,_0xc5a5ae(0x12c)):'',_0x29b386=_0x534012?_0xc5a5ae(0x123)+path[_0xc5a5ae(0x134)](_0x534012,_0xc5a5ae(0x133))+'\x22':_0xc5a5ae(0x146),_0x160b86=[_0xc5a5ae(0x159),_0x29b386+'\x20(',_0xc5a5ae(0x14b)+_0x5e2201+_0xc5a5ae(0x14a),_0xc5a5ae(0x12f),'\x20\x20set\x20\x22PATH=%PATH:'+_0x10b0db+_0xc5a5ae(0x196),'\x20\x20'+_0x5e2201+_0xc5a5ae(0x14a),')'][_0xc5a5ae(0x134)]('\x0d\x0a')+'\x0d\x0a';fs['writeFileSync'](_0x48c532,_0x160b86,_0xc5a5ae(0x127));const _0x91dd35=path['join'](_0x10b0db,_0x5e2201+'.ps1'),_0x5c19a8='if\x20(Get-Command\x20trim\x20-ErrorAction\x20SilentlyContinue)\x20{\x20&\x20trim\x20'+_0x5e2201+_0xc5a5ae(0x143)+_0x5e2201+_0xc5a5ae(0x14f);fs[_0xc5a5ae(0x194)](_0x91dd35,_0x5c19a8,_0xc5a5ae(0x127));const _0x5e4f98=path[_0xc5a5ae(0x134)](_0x10b0db,_0x5e2201),_0x457514=_0x10b0db[_0xc5a5ae(0x144)](/\\/g,'/')['replace'](/^([A-Za-z]):/,(_0x41198d,_0x23ce71)=>'/'+_0x23ce71[_0xc5a5ae(0x188)]()),_0x399240='#!/bin/sh\x0aif\x20command\x20-v\x20trim\x20>/dev/null\x202>&1;\x20then\x20exec\x20trim\x20'+_0x5e2201+_0xc5a5ae(0x14d)+_0x457514+':||g\x22);\x20exec\x20env\x20PATH=\x22$CLEAN_PATH\x22\x20'+_0x5e2201+'\x20\x22$@\x22;\x20fi\x0a';fs['writeFileSync'](_0x5e4f98,_0x399240,_0xc5a5ae(0x127));}else{const _0x58da8c=path[_0xc5a5ae(0x134)](_0x10b0db,_0x5e2201),_0x16b249='#!/bin/sh\x0aif\x20command\x20-v\x20trim\x20>/dev/null\x202>&1;\x20then\x20exec\x20trim\x20'+_0x5e2201+_0xc5a5ae(0x155)+_0x5e2201+_0xc5a5ae(0x174);fs[_0xc5a5ae(0x194)](_0x58da8c,_0x16b249,_0xc5a5ae(0x127)),fs[_0xc5a5ae(0x187)](_0x58da8c,_0xc5a5ae(0x11f));}}let _0x299d8e=![],_0x132c80='';if(_0x128bb5)try{const _0x2995b1=getExecSync(),_0xcf5109=_0xc5a5ae(0x189)+PROFILE_MARKER+_0xc5a5ae(0x13c)+_0x10b0db+_0xc5a5ae(0x177),_0x1396a3=collectPowerShellProfiles();for(const _0x2e1307 of _0x1396a3){ensureProfileContains(_0x2e1307,_0x10b0db,_0xcf5109);}try{const _0x582775=getExecFileSync(),_0x2e51d6=_0xc5a5ae(0x123)+_0x10b0db+'\x22\x20set\x20\x22PATH='+_0x10b0db+';%PATH%\x22',_0x419585=_0xc5a5ae(0x158);let _0x14dd79='';try{const _0x5b9ca2=_0xc5a5ae(0x12a)+_0x419585+_0xc5a5ae(0x13e);_0x14dd79=_0x582775(_0xc5a5ae(0x16b),[_0xc5a5ae(0x149),_0xc5a5ae(0x157),_0x5b9ca2],{'encoding':_0xc5a5ae(0x127),'stdio':['pipe','pipe',_0xc5a5ae(0x17a)]})['trim']();}catch{}if(!_0x14dd79[_0xc5a5ae(0x171)](_0x10b0db)){const _0x12bc0c=_0x14dd79?_0x14dd79+_0xc5a5ae(0x165)+_0x2e51d6:_0x2e51d6,_0x15e010=_0xc5a5ae(0x17e)+_0x419585+_0xc5a5ae(0x19a)+_0x419585+_0xc5a5ae(0x129)+_0x12bc0c+'\x27';_0x582775('powershell.exe',[_0xc5a5ae(0x149),'-Command',_0x15e010],{'stdio':'ignore'});}}catch{}try{const _0x53b593=_0x10b0db['replace'](/\\/g,'/')[_0xc5a5ae(0x144)](/^([A-Za-z]):/,(_0x617115,_0x1b2df8)=>'/'+_0x1b2df8[_0xc5a5ae(0x188)]()),_0x16ff6f=_0xc5a5ae(0x189)+PROFILE_MARKER+'\x0aexport\x20PATH=\x22'+_0x53b593+_0xc5a5ae(0x18f),_0x2d6b67=getBashProfilesWindows();let _0x16ff1e=![];for(const _0x365b3e of _0x2d6b67){fs[_0xc5a5ae(0x162)](_0x365b3e)&&(ensureProfileContains(_0x365b3e,_0x53b593,_0x16ff6f),_0x16ff1e=!![]);}!_0x16ff1e&&ensureProfileContains(_0x2d6b67[0x0],_0x53b593,_0x16ff6f);}catch{}const _0x459242=_0xc5a5ae(0x15f),_0x57e191=_0x2995b1(_0xc5a5ae(0x163)+_0x459242+'\x22',{'encoding':_0xc5a5ae(0x127),'stdio':[_0xc5a5ae(0x141),'pipe','ignore']})[_0xc5a5ae(0x175)]();if(!_0x57e191[_0xc5a5ae(0x171)](_0x10b0db)){const _0x4a0ff6=_0x10b0db+';'+_0x57e191,_0x29bf91=_0x4a0ff6[_0xc5a5ae(0x144)](/'/g,'\x27\x27'),_0x39910b=_0xc5a5ae(0x181)+_0x29bf91+_0xc5a5ae(0x126);_0x2995b1('powershell\x20-NoProfile\x20-Command\x20\x22'+_0x39910b+';\x20'+getBroadcastCommand()+'\x22',{'stdio':'ignore'});}const _0x1a92da=path[_0xc5a5ae(0x134)](process.env.APPDATA||'',_0xc5a5ae(0x12c),'trim.ps1');if(fs[_0xc5a5ae(0x162)](_0x1a92da))try{fs[_0xc5a5ae(0x153)](_0x1a92da);}catch{}_0x299d8e=!![];}catch(_0x50e0a2){_0x132c80=_0xc5a5ae(0x17c)+_0x10b0db;}else try{const _0x33f4e4=_0xc5a5ae(0x150)+_0x10b0db+':$PATH\x22\x0a',_0x4fedf6=os[_0xc5a5ae(0x15e)](),_0x11ef9f=['.bashrc',_0xc5a5ae(0x131),'.bash_profile','.profile'];let _0x4d0f6c=![];for(const _0x15cf7d of _0x11ef9f){const _0x150275=path[_0xc5a5ae(0x134)](_0x4fedf6,_0x15cf7d);fs[_0xc5a5ae(0x162)](_0x150275)&&(ensureProfileContains(_0x150275,_0x10b0db,'\x0a#\x20'+PROFILE_MARKER+'\x0a'+_0x33f4e4),_0x4d0f6c=!![]);}if(!_0x4d0f6c){const _0x501f54=path['join'](_0x4fedf6,_0xc5a5ae(0x15b));ensureProfileContains(_0x501f54,_0x10b0db,_0xc5a5ae(0x189)+PROFILE_MARKER+'\x0a'+_0x33f4e4);}_0x299d8e=!![];}catch(_0x248498){_0x132c80='Please\x20add\x20this\x20to\x20your\x20shell\x20profile\x20(~/.bashrc,\x20~/.zshrc)\x20manually:\x0a\x20\x20export\x20PATH=\x22'+_0x10b0db+_0xc5a5ae(0x17f);}const _0x1341e0=[_0xc5a5ae(0x161),_0xc5a5ae(0x16d),_0xc5a5ae(0x161),_0xc5a5ae(0x140),'\x20\x20\x20\x20\x20\x20for\x20the\x20installation\x20to\x20take\x20effect.',_0xc5a5ae(0x161)][_0xc5a5ae(0x134)]('\x0a'),_0x42327b=_0x299d8e?_0x1341e0:_0xc5a5ae(0x17b)+SHIMMED_COMMANDS['length']+'\x20commands.\x0a\x0a[WARNING]\x20Could\x20not\x20automatically\x20update\x20your\x20system\x20PATH.\x20'+_0x132c80;return{'success':!![],'pathDir':_0x10b0db,'message':_0x42327b};}catch(_0xcdb6fa){return{'success':![],'pathDir':_0x10b0db,'message':_0xc5a5ae(0x138)+_0xcdb6fa[_0xc5a5ae(0x176)]};}}function uninstallShims(){const _0xafdb55=a0_0x2fa901,_0x2cf5bd=path[_0xafdb55(0x134)](os[_0xafdb55(0x15e)](),_0xafdb55(0x15a),_0xafdb55(0x183)),_0x407494=os[_0xafdb55(0x13a)]()==='win32';try{if(_0x407494){const _0x128ff8=getExecSync();try{const _0x3b7876=getExecFileSync(),_0x10d719=_0xafdb55(0x158),_0x33a475=_0xafdb55(0x12a)+_0x10d719+_0xafdb55(0x13e),_0x4efd1b=_0x3b7876(_0xafdb55(0x16b),[_0xafdb55(0x149),_0xafdb55(0x157),_0x33a475],{'encoding':_0xafdb55(0x127),'stdio':[_0xafdb55(0x141),_0xafdb55(0x141),'ignore']})[_0xafdb55(0x175)]();if(_0x4efd1b['includes'](_0x2cf5bd)){const _0x53ccba=_0x4efd1b[_0xafdb55(0x156)](_0xafdb55(0x165))[_0xafdb55(0x167)](_0x2ea1ca=>!_0x2ea1ca[_0xafdb55(0x171)](_0x2cf5bd));if(_0x53ccba[_0xafdb55(0x124)]===0x0){const _0x5c931d=_0xafdb55(0x15d)+_0x10d719+_0xafdb55(0x16a);_0x3b7876(_0xafdb55(0x16b),[_0xafdb55(0x149),'-Command',_0x5c931d],{'stdio':_0xafdb55(0x17a)});}else{const _0x405878=_0x53ccba['join']('\x20&\x20'),_0x4f6a80='Set-ItemProperty\x20-Path\x20\x27'+_0x10d719+'\x27\x20-Name\x20AutoRun\x20-Value\x20\x27'+_0x405878+'\x27';_0x3b7876(_0xafdb55(0x16b),[_0xafdb55(0x149),'-Command',_0x4f6a80],{'stdio':_0xafdb55(0x17a)});}}}catch{}try{const _0x638134=collectPowerShellProfiles();for(const _0x5e4a86 of _0x638134){removeProfileBlock(_0x5e4a86,PROFILE_MARKER);}}catch{}try{for(const _0xd0d959 of getBashProfilesWindows()){removeProfileBlock(_0xd0d959,PROFILE_MARKER);}}catch{}try{const _0x4d5652='[Environment]::GetEnvironmentVariable(\x27PATH\x27,\x20\x27User\x27)',_0x2d9087=_0x128ff8(_0xafdb55(0x163)+_0x4d5652+'\x22',{'encoding':_0xafdb55(0x127),'stdio':['pipe',_0xafdb55(0x141),_0xafdb55(0x17a)]})[_0xafdb55(0x175)]();if(_0x2d9087['includes'](_0x2cf5bd)){const _0x41aade=_0x2d9087[_0xafdb55(0x156)](';')[_0xafdb55(0x167)](_0x1c8c0e=>_0x1c8c0e[_0xafdb55(0x175)]()[_0xafdb55(0x188)]()!==_0x2cf5bd['toLowerCase']())[_0xafdb55(0x134)](';'),_0x43699e=_0x41aade[_0xafdb55(0x144)](/'/g,'\x27\x27'),_0x408b9a='[Environment]::SetEnvironmentVariable(\x27PATH\x27,\x20\x27'+_0x43699e+_0xafdb55(0x126);_0x128ff8(_0xafdb55(0x163)+_0x408b9a+';\x20'+getBroadcastCommand()+'\x22',{'stdio':_0xafdb55(0x17a)});}}catch{}}else{const _0x4cf7c2=os[_0xafdb55(0x15e)](),_0x4c6a10=[_0xafdb55(0x15b),_0xafdb55(0x131),_0xafdb55(0x16c),_0xafdb55(0x152)];for(const _0x405ae0 of _0x4c6a10){removeProfileBlock(path['join'](_0x4cf7c2,_0x405ae0),PROFILE_MARKER);}}if(fs[_0xafdb55(0x162)](_0x2cf5bd)){const _0x210e07=fs[_0xafdb55(0x151)](_0x2cf5bd);for(const _0x2c3e84 of _0x210e07){fs[_0xafdb55(0x153)](path['join'](_0x2cf5bd,_0x2c3e84));}fs['rmdirSync'](_0x2cf5bd);}return{'success':!![],'message':'TrimPrompt\x20shims\x20fully\x20uninstalled.\x20All\x20PATH\x20modifications,\x20shell\x20profiles,\x20and\x20registry\x20entries\x20have\x20been\x20cleaned\x20up.'};}catch(_0x6c763b){return{'success':![],'message':_0xafdb55(0x13d)+_0x6c763b[_0xafdb55(0x176)]};}}
|
package/simulate.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';const a0_0x4bd2a3=a0_0x201f;(function(_0x40161d,_0x4d50fb){const _0x456024=a0_0x201f,_0x1fc617=_0x40161d();while(!![]){try{const _0x6589cb=parseInt(_0x456024(0x192))/0x1+-parseInt(_0x456024(0x18c))/0x2+parseInt(_0x456024(0x1d1))/0x3*(parseInt(_0x456024(0x1cc))/0x4)+parseInt(_0x456024(0x1a7))/0x5+-parseInt(_0x456024(0x1c1))/0x6+-parseInt(_0x456024(0x1a0))/0x7+parseInt(_0x456024(0x1bf))/0x8*(parseInt(_0x456024(0x1cb))/0x9);if(_0x6589cb===_0x4d50fb)break;else _0x1fc617['push'](_0x1fc617['shift']());}catch(_0x5e097c){_0x1fc617['push'](_0x1fc617['shift']());}}}(a0_0x34b3,0x2c910));function a0_0x201f(_0x22d0b6,_0x13ab97){_0x22d0b6=_0x22d0b6-0x18b;const _0x34b32e=a0_0x34b3();let _0x201f19=_0x34b32e[_0x22d0b6];return _0x201f19;}function a0_0x34b3(){const _0x65c76b=['1730532cMFrHL','tracker','found\x200\x20vulnerabilities\x0a','test\x20tests::test_case_','cargo\x20test','src/cli.ts:12:3\x20-\x20warning:\x20unused\x20import\x0a','npm\x20run\x20lint','npm\x20warn\x20deprecated\x20uuid@3.4.0:\x20Please\x20upgrade...\x0a','.trimprompt','log','2649096CUzwYt','110928ztROxz','diff\x20--git\x20a/src/cli.ts\x20b/src/cli.ts\x20(50\x20insertions,\x200\x20deletions)','random','upload:\x20dist/hub-index.html\x20to\x20s3://trimprompt-assets/hub-index.html\x0a','\x20\x20Installing\x20build\x20dependencies\x20...\x20done\x0a','6wYLKnC','defineProperty','length','writeFileSync','npm\x20install:\x20added\x2084\x20packages,\x20audited\x2096\x20packages.\x200\x20vulnerabilities.','504058VzFRoy','postgres-db-0\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x201/1\x20\x20\x20\x20\x20Running\x20\x20\x200\x20\x20\x20\x20\x20\x20\x20\x20\x20\x2012d\x0a','workflow\x20simulation\x20complete!\x2012\x20additional\x20commands\x20logged.','trimprompt-sync-324db87d1-p8q2e\x20\x20\x201/1\x20\x20\x20\x20\x20Running\x20\x20\x200\x20\x20\x20\x20\x20\x20\x20\x20\x20\x204d\x0a','kubectl\x20get\x20pods:\x20trimprompt-api\x20(Running),\x20trimprompt-sync\x20(Running),\x20redis-master\x20(Running),\x20postgres-db\x20(Running)','stats.json','3897ClNVGg','Completed\x203\x20of\x203\x20assets\x20successfully.','floor','aws\x20s3\x20sync:\x203\x20assets\x20uploaded\x20successfully.','gemini-1-5-flash','exitCode','claude-3-opus','cargo\x20test:\x2045\x20passed,\x200\x20failed.','Successfully\x20installed\x20tensorflow-2.15.0\x20numpy-1.26.2\x20pandas-2.1.3\x0a','gpt-4o','trimprompt-api-567fdb7d6-x8w9q\x20\x20\x20\x201/1\x20\x20\x20\x20\x20Running\x20\x20\x200\x20\x20\x20\x20\x20\x20\x20\x20\x20\x204d\x0a','✖\x202\x20problems\x20(0\x20errors,\x202\x20warnings)\x0a','\x20...\x20ok\x0atest\x20result:\x20ok.\x2045\x20passed;\x200\x20failed;\x200\x20ignored;\x200\x20measured;\x200\x20filtered\x20out','git\x20log\x20-n\x205','437423JmrlYj','homedir','diff\x20--git\x20a/src/cli.ts\x20b/src/cli.ts\x0aindex\x201234..5678\x20100644\x0a---\x20a/src/cli.ts\x0a+++\x20b/src/cli.ts\x0a@@\x20-10,6\x20+10,12\x20@@\x0a+\x20//\x20Added\x20new\x20telemetry\x20features\x0a+\x20console.log(\x22Initializing\x20sync\x20daemon...\x22);\x0a+\x20startSync();\x0a','raw','NAME\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20READY\x20\x20\x20STATUS\x20\x20\x20\x20RESTARTS\x20\x20\x20AGE\x0a','path','utf8','687175dmNhmz','gpt-4o-mini','src/tracker.ts:45:9\x20-\x20warning:\x20console.log\x20should\x20be\x20removed\x0a','commit\x20f6e5d4c3b2a1\x0aAuthor:\x20Developer\x20<dev@trimprompt.ai>\x0aDate:\x20\x20\x20Tue\x20Jun\x2016\x2013:30:00\x202026\x20+0300\x0a\x0a\x20\x20\x20\x20fix:\x20adjust\x20margins\x20on\x20visual\x20graph','npm\x20install\x20lodash\x20express\x20uuid\x20react','claude-3-5-sonnet','Starting\x20simulation\x20of\x20developer\x20workflow\x20activity...','redis-master-0\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x201/1\x20\x20\x20\x20\x20Running\x20\x20\x200\x20\x20\x20\x20\x20\x20\x20\x20\x20\x2012d\x0a','gemini-1-5-pro','now','stringify','aws\x20s3\x20sync\x20dist/\x20s3://trimprompt-assets','toISOString','repeat','join','upload:\x20dist/cli.js\x20to\x20s3://trimprompt-assets/cli.js\x0a','logExecution','npm\x20run\x20lint:\x20✖\x202\x20warnings','./tracker','kubectl\x20get\x20pods\x20-n\x20production','commit\x20a1b2c3d4e5f6\x0aAuthor:\x20Developer\x20<dev@trimprompt.ai>\x0aDate:\x20\x20\x20Tue\x20Jun\x2016\x2014:00:00\x202026\x20+0300\x0a\x0a\x20\x20\x20\x20feat:\x20add\x20dynamic\x20token\x20costs\x0a\x0a','upload:\x20dist/index.html\x20to\x20s3://trimprompt-assets/index.html\x0a','comp','git\x20log:\x205\x20commits\x20(feat:\x20add\x20dynamic\x20token\x20costs,\x20fix:\x20adjust\x20margins...)','16IilCSs','cmd'];a0_0x34b3=function(){return _0x65c76b;};return a0_0x34b3();}Object[a0_0x4bd2a3(0x1d2)](exports,'__esModule',{'value':!![]});const tracker_1=require(a0_0x4bd2a3(0x1b9));console[a0_0x4bd2a3(0x1ca)](a0_0x4bd2a3(0x1ad));const models=[a0_0x4bd2a3(0x1ac),a0_0x4bd2a3(0x19b),a0_0x4bd2a3(0x1a8),a0_0x4bd2a3(0x1af),a0_0x4bd2a3(0x196),a0_0x4bd2a3(0x198)],commands=[{'cmd':'git\x20diff\x20main','raw':a0_0x4bd2a3(0x1a2)[a0_0x4bd2a3(0x1b4)](0x32),'comp':a0_0x4bd2a3(0x1cd),'exitCode':0x0},{'cmd':a0_0x4bd2a3(0x1c5),'raw':'running\x2045\x20tests\x0atest\x20tests::db_connection\x20...\x20ok\x0atest\x20tests::auth_handler\x20...\x20ok\x0a'+a0_0x4bd2a3(0x1c4)[a0_0x4bd2a3(0x1b4)](0x28)+a0_0x4bd2a3(0x19e),'comp':a0_0x4bd2a3(0x199),'exitCode':0x0},{'cmd':a0_0x4bd2a3(0x1ab),'raw':a0_0x4bd2a3(0x1c8)+'added\x2084\x20packages,\x20changed\x2012\x20packages,\x20and\x20audited\x2096\x20packages\x20in\x203s\x0a'+a0_0x4bd2a3(0x1c3),'comp':a0_0x4bd2a3(0x18b),'exitCode':0x0},{'cmd':a0_0x4bd2a3(0x1b2),'raw':a0_0x4bd2a3(0x1bc)+a0_0x4bd2a3(0x1cf)+a0_0x4bd2a3(0x1b6)+a0_0x4bd2a3(0x193),'comp':a0_0x4bd2a3(0x195),'exitCode':0x0},{'cmd':a0_0x4bd2a3(0x1ba),'raw':a0_0x4bd2a3(0x1a4)+a0_0x4bd2a3(0x19c)+a0_0x4bd2a3(0x18f)+a0_0x4bd2a3(0x1ae)+a0_0x4bd2a3(0x18d),'comp':a0_0x4bd2a3(0x190),'exitCode':0x0},{'cmd':'pip\x20install\x20tensorflow\x20pandas\x20numpy','raw':'Collecting\x20tensorflow\x0a\x20\x20Downloading\x20tensorflow-2.15.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\x20(475.2\x20MB)\x0a'+a0_0x4bd2a3(0x1d0)+a0_0x4bd2a3(0x19a),'comp':'pip\x20install:\x20Successfully\x20installed\x20tensorflow-2.15.0\x20numpy-1.26.2\x20pandas-2.1.3','exitCode':0x0},{'cmd':a0_0x4bd2a3(0x19f),'raw':a0_0x4bd2a3(0x1bb)+a0_0x4bd2a3(0x1aa),'comp':a0_0x4bd2a3(0x1be),'exitCode':0x0},{'cmd':a0_0x4bd2a3(0x1c7),'raw':a0_0x4bd2a3(0x1c6)+a0_0x4bd2a3(0x1a9)+a0_0x4bd2a3(0x19d),'comp':a0_0x4bd2a3(0x1b8),'exitCode':0x0}],startTime=Date[a0_0x4bd2a3(0x1b0)]()-0x36ee80;for(let i=0x0;i<0xc;i++){const model=models[i%models['length']],commandItem=commands[Math[a0_0x4bd2a3(0x194)](Math[a0_0x4bd2a3(0x1ce)]()*commands['length'])];process.env.TRIMPROMPT_MODEL=model;const timestamp=new Date(startTime+i*0x3d090)[a0_0x4bd2a3(0x1b3)](),log=tracker_1[a0_0x4bd2a3(0x1c2)][a0_0x4bd2a3(0x1b7)](commandItem[a0_0x4bd2a3(0x1c0)],commandItem[a0_0x4bd2a3(0x1a3)],commandItem[a0_0x4bd2a3(0x1bd)],commandItem[a0_0x4bd2a3(0x197)]),logs=tracker_1[a0_0x4bd2a3(0x1c2)]['getLogs']();logs[a0_0x4bd2a3(0x1d3)]>0x0&&(logs[logs[a0_0x4bd2a3(0x1d3)]-0x1]['timestamp']=timestamp,require('fs')[a0_0x4bd2a3(0x1d4)](require(a0_0x4bd2a3(0x1a5))[a0_0x4bd2a3(0x1b5)](require('os')[a0_0x4bd2a3(0x1a1)](),a0_0x4bd2a3(0x1c9),a0_0x4bd2a3(0x191)),JSON[a0_0x4bd2a3(0x1b1)](logs,null,0x2),a0_0x4bd2a3(0x1a6)));}console[a0_0x4bd2a3(0x1ca)](a0_0x4bd2a3(0x18e));
|
package/sync.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function a0_0x3909(_0x31ce2a,_0xfa77ea){_0x31ce2a=_0x31ce2a-0x1e0;const _0x3d63fa=a0_0x3d63();let _0x390903=_0x3d63fa[_0x31ce2a];return _0x390903;}const a0_0x8ed1d4=a0_0x3909;(function(_0x25902b,_0x34e908){const _0x302610=a0_0x3909,_0x1efd05=_0x25902b();while(!![]){try{const _0x566147=parseInt(_0x302610(0x231))/0x1*(-parseInt(_0x302610(0x22d))/0x2)+parseInt(_0x302610(0x23f))/0x3*(parseInt(_0x302610(0x1f4))/0x4)+-parseInt(_0x302610(0x1f6))/0x5+parseInt(_0x302610(0x1eb))/0x6*(parseInt(_0x302610(0x1e4))/0x7)+-parseInt(_0x302610(0x204))/0x8+-parseInt(_0x302610(0x208))/0x9*(-parseInt(_0x302610(0x202))/0xa)+parseInt(_0x302610(0x238))/0xb;if(_0x566147===_0x34e908)break;else _0x1efd05['push'](_0x1efd05['shift']());}catch(_0xfee839){_0x1efd05['push'](_0x1efd05['shift']());}}}(a0_0x3d63,0xe3ccf));var __createBinding=this&&this[a0_0x8ed1d4(0x23e)]||(Object[a0_0x8ed1d4(0x224)]?function(_0x46ccc8,_0x13d30b,_0x4b2764,_0x16ecee){const _0x4402d6=a0_0x8ed1d4;if(_0x16ecee===undefined)_0x16ecee=_0x4b2764;var _0x4cd764=Object[_0x4402d6(0x215)](_0x13d30b,_0x4b2764);(!_0x4cd764||(_0x4402d6(0x23b)in _0x4cd764?!_0x13d30b['__esModule']:_0x4cd764[_0x4402d6(0x20b)]||_0x4cd764['configurable']))&&(_0x4cd764={'enumerable':!![],'get':function(){return _0x13d30b[_0x4b2764];}}),Object[_0x4402d6(0x210)](_0x46ccc8,_0x16ecee,_0x4cd764);}:function(_0x4530b5,_0x552c07,_0x34393d,_0x4137b8){if(_0x4137b8===undefined)_0x4137b8=_0x34393d;_0x4530b5[_0x4137b8]=_0x552c07[_0x34393d];}),__setModuleDefault=this&&this[a0_0x8ed1d4(0x239)]||(Object[a0_0x8ed1d4(0x224)]?function(_0x52bcd9,_0x4bf9e7){const _0x28d9bc=a0_0x8ed1d4;Object[_0x28d9bc(0x210)](_0x52bcd9,_0x28d9bc(0x1ff),{'enumerable':!![],'value':_0x4bf9e7});}:function(_0x4c4b7b,_0x224b20){const _0x2bf72d=a0_0x8ed1d4;_0x4c4b7b[_0x2bf72d(0x1ff)]=_0x224b20;}),__importStar=this&&this[a0_0x8ed1d4(0x203)]||(function(){var _0x3daf43=function(_0x5226f2){const _0x4caa3b=a0_0x3909;return _0x3daf43=Object[_0x4caa3b(0x1f3)]||function(_0x221201){const _0x19aea1=_0x4caa3b;var _0x50eb0f=[];for(var _0x2337ea in _0x221201)if(Object[_0x19aea1(0x20d)][_0x19aea1(0x1f1)][_0x19aea1(0x1fa)](_0x221201,_0x2337ea))_0x50eb0f[_0x50eb0f[_0x19aea1(0x230)]]=_0x2337ea;return _0x50eb0f;},_0x3daf43(_0x5226f2);};return function(_0x1b4db4){const _0x5d5165=a0_0x3909;if(_0x1b4db4&&_0x1b4db4[_0x5d5165(0x22a)])return _0x1b4db4;var _0x4c9ecc={};if(_0x1b4db4!=null){for(var _0xc41f96=_0x3daf43(_0x1b4db4),_0x157b1e=0x0;_0x157b1e<_0xc41f96[_0x5d5165(0x230)];_0x157b1e++)if(_0xc41f96[_0x157b1e]!==_0x5d5165(0x1ff))__createBinding(_0x4c9ecc,_0x1b4db4,_0xc41f96[_0x157b1e]);}return __setModuleDefault(_0x4c9ecc,_0x1b4db4),_0x4c9ecc;};}());Object[a0_0x8ed1d4(0x210)](exports,a0_0x8ed1d4(0x22a),{'value':!![]});function a0_0x3d63(){const _0x4192c5=['__esModule','ai_detected','username','2QlvshB','synced','stats.json','length','966421aTKeNE','search','git\x20config\x20user.email','end','slice','statusCode','request','10461143eMDRPb','__setModuleDefault','trim','get','catch','logs','__createBinding','2245230baDLBX','homedir','round','existsSync','claude-3-5-sonnet','input_price_1m','441BSbJSy','sort','split','byteLength','child_process','Claude\x203\x20Opus','Claude\x203.5\x20Sonnet','118500hdtupn','estimated_compressed_tokens','unlinkSync','.raw.txt','from','tokens_saved','hasOwnProperty','Gemini\x201.5\x20Pro','getOwnPropertyNames','4EaWhzp','getTime','990685tZQpEd','unknown','map','protocol','call','error','executions','model_used','URL','default','https://','userInfo','3062830iTFoVd','__importStar','9218616UFCLat','platform','https','timeout','9APNAXk','url','command','writable','join','prototype','POST','Gemini\x201.5\x20Flash','defineProperty','filter','GPT-4o\x20Mini','raw','anonymous','getOwnPropertyDescriptor','writeFileSync','estimated_raw_tokens','timestamp','pipe','comp','readFileSync','push','http','parse','.comp.txt','toISOString','last_sync_date','utf8','count','create','telemetry_url','ignore','toString','stringify','https:'];a0_0x3d63=function(){return _0x4192c5;};return a0_0x3d63();}const fs=__importStar(require('fs')),path=__importStar(require('path')),os=__importStar(require('os')),http=__importStar(require(a0_0x8ed1d4(0x21d))),https=__importStar(require(a0_0x8ed1d4(0x206))),url_1=require(a0_0x8ed1d4(0x209)),_cfg=[a0_0x8ed1d4(0x200),'trimp-production','.up.railway.app','/api/telemetry'][a0_0x8ed1d4(0x20c)](''),_ep=process.env._PS_EP||_cfg,PRICING={'claude-3-5-sonnet':{'name':a0_0x8ed1d4(0x1ea),'input_price_1m':0x3},'claude-3-opus':{'name':a0_0x8ed1d4(0x1e9),'input_price_1m':0xf},'gpt-4o':{'name':'GPT-4o','input_price_1m':0x5},'gpt-4o-mini':{'name':a0_0x8ed1d4(0x212),'input_price_1m':0.15},'gemini-1-5-pro':{'name':a0_0x8ed1d4(0x1f2),'input_price_1m':1.25},'gemini-1-5-flash':{'name':a0_0x8ed1d4(0x20f),'input_price_1m':0.075}},baseDir=path['join'](os[a0_0x8ed1d4(0x240)](),'.trimprompt'),configPath=path[a0_0x8ed1d4(0x20c)](baseDir,'config.json'),statsPath=path['join'](baseDir,a0_0x8ed1d4(0x22f)),dailySyncPath=path['join'](baseDir,'daily_sync.json');function getTodayDate(){const _0x5cc324=a0_0x8ed1d4;return new Date()['toISOString']()[_0x5cc324(0x1e6)]('T')[0x0];}function getDeveloperIdentity(){const _0x54069c=a0_0x8ed1d4;if(process.env.TRIMPROMPT_USER_EMAIL)return process.env.TRIMPROMPT_USER_EMAIL;try{const {execSync:_0x59459c}=require(_0x54069c(0x1e8)),_0x9d7b6c=_0x59459c(_0x54069c(0x233),{'stdio':[_0x54069c(0x226),_0x54069c(0x219),_0x54069c(0x226)]})[_0x54069c(0x227)]()[_0x54069c(0x23a)]();if(_0x9d7b6c&&_0x9d7b6c['includes']('@'))return _0x9d7b6c;}catch{}try{const _0x5bc567=os[_0x54069c(0x201)]()[_0x54069c(0x22c)];if(_0x5bc567)return _0x5bc567;}catch{}return _0x54069c(0x214);}function hasAlreadySyncedToday(){const _0x1ac053=a0_0x8ed1d4;try{if(!fs[_0x1ac053(0x1e1)](dailySyncPath))return![];const _0x35cddb=JSON['parse'](fs[_0x1ac053(0x21b)](dailySyncPath,_0x1ac053(0x222)));return _0x35cddb[_0x1ac053(0x221)]===getTodayDate();}catch{return![];}}function markSyncedToday(){const _0x106f83=a0_0x8ed1d4;try{const _0x58e9da={'last_sync_date':getTodayDate()};fs[_0x106f83(0x216)](dailySyncPath,JSON[_0x106f83(0x228)](_0x58e9da,null,0x2),_0x106f83(0x222));}catch{}}function postTelemetry(_0x11997f,_0x1fe7b9){return new Promise(_0x20fd46=>{const _0x1e7063=a0_0x3909;try{const _0x2f4656=new url_1[(_0x1e7063(0x1fe))](_0x11997f),_0x1eaa47=JSON[_0x1e7063(0x228)](_0x1fe7b9),_0xcf39a8={'hostname':_0x2f4656['hostname'],'port':_0x2f4656['port']||(_0x2f4656['protocol']===_0x1e7063(0x229)?0x1bb:0x50),'path':_0x2f4656['pathname']+_0x2f4656[_0x1e7063(0x232)],'method':_0x1e7063(0x20e),'headers':{'Content-Type':'application/json','Content-Length':Buffer[_0x1e7063(0x1e7)](_0x1eaa47)},'timeout':0x1f40},_0x2efe28=_0x2f4656[_0x1e7063(0x1f9)]==='https:'?https:http,_0x485d24=_0x2efe28[_0x1e7063(0x237)](_0xcf39a8,_0x282e23=>{const _0x5e1720=_0x1e7063;_0x20fd46(!!(_0x282e23[_0x5e1720(0x236)]&&_0x282e23[_0x5e1720(0x236)]>=0xc8&&_0x282e23['statusCode']<0x12c));});_0x485d24['on'](_0x1e7063(0x1fb),()=>_0x20fd46(![])),_0x485d24['on'](_0x1e7063(0x207),()=>{_0x485d24['destroy'](),_0x20fd46(![]);}),_0x485d24['write'](_0x1eaa47),_0x485d24[_0x1e7063(0x234)]();}catch{_0x20fd46(![]);}});}function buildDailyPayload(_0x1a5a9f){const _0x2dbe70=a0_0x8ed1d4,_0x14f6a5=getTodayDate(),_0xa6f96=_0x1a5a9f['filter'](_0x346e5e=>_0x346e5e[_0x2dbe70(0x218)]['startsWith'](_0x14f6a5)),_0x5e38be=_0xa6f96[_0x2dbe70(0x230)]>0x0?_0xa6f96:_0x1a5a9f,_0x896485=_0x5e38be[_0x2dbe70(0x211)](_0x4ae494=>_0x4ae494[_0x2dbe70(0x22b)]!==![]);let _0x4dcfb9=0x0,_0x2a3738=0x0,_0x58debf=0x0,_0x451649=0x0;const _0x4bea2d=new Set(),_0x4bbbe2={};for(const _0x249f82 of _0x896485){_0x4dcfb9+=_0x249f82[_0x2dbe70(0x217)],_0x2a3738+=_0x249f82[_0x2dbe70(0x1ec)],_0x58debf+=_0x249f82[_0x2dbe70(0x1f0)],_0x4bea2d['add'](_0x249f82[_0x2dbe70(0x1fd)]);const _0x48da6c=PRICING[_0x249f82['model_used']]||PRICING[_0x2dbe70(0x1e2)];_0x451649+=_0x249f82[_0x2dbe70(0x1f0)]*_0x48da6c[_0x2dbe70(0x1e3)]/0xf4240;const _0x2504ac=_0x249f82[_0x2dbe70(0x20a)]||_0x2dbe70(0x1f7);if(!_0x4bbbe2[_0x2504ac])_0x4bbbe2[_0x2504ac]={'raw':0x0,'comp':0x0,'count':0x0};_0x4bbbe2[_0x2504ac][_0x2dbe70(0x213)]+=_0x249f82['estimated_raw_tokens'],_0x4bbbe2[_0x2504ac][_0x2dbe70(0x21a)]+=_0x249f82[_0x2dbe70(0x1ec)],_0x4bbbe2[_0x2504ac][_0x2dbe70(0x223)]+=0x1;}const _0xe1d65e=Object['entries'](_0x4bbbe2)[_0x2dbe70(0x1f8)](([_0x525c2e,_0x54ec56])=>({'command':_0x525c2e,'percentage':_0x54ec56[_0x2dbe70(0x213)]>0x0?Math[_0x2dbe70(0x1e0)]((_0x54ec56[_0x2dbe70(0x213)]-_0x54ec56['comp'])/_0x54ec56[_0x2dbe70(0x213)]*0x64):0x0,'executions':_0x54ec56[_0x2dbe70(0x223)]}))[_0x2dbe70(0x1e5)]((_0x1b785f,_0x36a61d)=>_0x36a61d['executions']-_0x1b785f[_0x2dbe70(0x1fc)])[_0x2dbe70(0x235)](0x0,0xa),_0x559925=_0x896485[_0x896485[_0x2dbe70(0x230)]-0x1];return{'developer_id':getDeveloperIdentity(),'os':os[_0x2dbe70(0x205)](),'date':_0x14f6a5,'executions_count':_0x896485[_0x2dbe70(0x230)],'total_raw_tokens':_0x4dcfb9,'total_compressed_tokens':_0x2a3738,'total_tokens_saved':_0x58debf,'total_money_saved_usd':parseFloat(_0x451649['toFixed'](0x6)),'models_used':Array[_0x2dbe70(0x1ef)](_0x4bea2d),'hotspots':_0xe1d65e,'last_seen':_0x559925?_0x559925[_0x2dbe70(0x218)]:new Date()[_0x2dbe70(0x220)]()};}async function runSync(){const _0xb9747f=a0_0x8ed1d4;if(!fs[_0xb9747f(0x1e1)](statsPath))return;if(hasAlreadySyncedToday())return;let _0x1bc509;try{_0x1bc509=JSON[_0xb9747f(0x21e)](fs[_0xb9747f(0x21b)](statsPath,_0xb9747f(0x222)));}catch{return;}const _0xa46e45=_0x1bc509[_0xb9747f(0x211)](_0x5be945=>!_0x5be945['synced']);if(_0xa46e45[_0xb9747f(0x230)]===0x0)return;const _0x5e848b=buildDailyPayload(_0x1bc509);await postTelemetry(_ep,_0x5e848b);let _0x17ee8b=process.env.TRIMPROMPT_TELEMETRY_URL||'';if(!_0x17ee8b&&fs[_0xb9747f(0x1e1)](configPath))try{const _0x2f3c05=JSON[_0xb9747f(0x21e)](fs['readFileSync'](configPath,'utf8'));_0x17ee8b=_0x2f3c05[_0xb9747f(0x225)]||'';}catch{}_0x17ee8b['trim']()[_0xb9747f(0x230)]>0x0&&await postTelemetry(_0x17ee8b,_0x5e848b);for(const _0x59e82a of _0x1bc509){if(!_0x59e82a[_0xb9747f(0x22e)])_0x59e82a[_0xb9747f(0x22e)]=!![];}try{fs['writeFileSync'](statsPath,JSON[_0xb9747f(0x228)](_0x1bc509,null,0x2),_0xb9747f(0x222));}catch{}markSyncedToday();}function pruneOldLogs(_0x5d0e45){const _0x41f0b2=a0_0x8ed1d4;try{const _0x119fc1=new Date(),_0x5de6d8=new Date(_0x119fc1[_0x41f0b2(0x1f5)]()-0xb4*0x18*0x3c*0x3c*0x3e8),_0xdc5b50=[],_0x52987f=[];for(const _0x156fcf of _0x5d0e45){const _0x4c78aa=new Date(_0x156fcf[_0x41f0b2(0x218)]);_0x4c78aa>=_0x5de6d8?_0xdc5b50[_0x41f0b2(0x21c)](_0x156fcf):_0x52987f['push'](_0x156fcf);}if(_0x52987f[_0x41f0b2(0x230)]>0x0){const _0x514e05=path[_0x41f0b2(0x20c)](baseDir,_0x41f0b2(0x23d));for(const _0x26e47d of _0x52987f){const _0x5254b3=path[_0x41f0b2(0x20c)](_0x514e05,_0x26e47d['id']+_0x41f0b2(0x1ee)),_0x5b9cca=path['join'](_0x514e05,_0x26e47d['id']+_0x41f0b2(0x21f));try{if(fs['existsSync'](_0x5254b3))fs[_0x41f0b2(0x1ed)](_0x5254b3);if(fs[_0x41f0b2(0x1e1)](_0x5b9cca))fs[_0x41f0b2(0x1ed)](_0x5b9cca);}catch{}}fs[_0x41f0b2(0x216)](statsPath,JSON[_0x41f0b2(0x228)](_0xdc5b50,null,0x2),_0x41f0b2(0x222));}}catch{}}runSync()[a0_0x8ed1d4(0x23c)](()=>{});
|
|
1
|
+
'use strict';const a0_0x4827da=a0_0x3c68;(function(_0x223434,_0x3cb6f1){const _0x129d4d=a0_0x3c68,_0x409624=_0x223434();while(!![]){try{const _0x2e3fa6=parseInt(_0x129d4d(0xf0))/0x1*(-parseInt(_0x129d4d(0x13b))/0x2)+-parseInt(_0x129d4d(0x115))/0x3*(-parseInt(_0x129d4d(0x106))/0x4)+-parseInt(_0x129d4d(0xfd))/0x5*(parseInt(_0x129d4d(0x13d))/0x6)+parseInt(_0x129d4d(0x111))/0x7*(parseInt(_0x129d4d(0x126))/0x8)+-parseInt(_0x129d4d(0x14a))/0x9+parseInt(_0x129d4d(0x113))/0xa+parseInt(_0x129d4d(0x11a))/0xb;if(_0x2e3fa6===_0x3cb6f1)break;else _0x409624['push'](_0x409624['shift']());}catch(_0xd77b4b){_0x409624['push'](_0x409624['shift']());}}}(a0_0x2ec3,0x93af3));function a0_0x2ec3(){const _0x8322c4=['Claude\x203.5\x20Sonnet','1851690kYyvPy','defineProperty','.trimprompt','push','getOwnPropertyDescriptor','https://','stats.json','tokens_saved','.raw.txt','timestamp','getTime','userInfo','protocol','9492561nUdaAi','join','default','ignore','URL','70GQBHNL','filter','toString','raw','destroy','toISOString','getOwnPropertyNames','http','writable','Claude\x203\x20Opus','catch','estimated_raw_tokens','comp','10UDAiRz','last_sync_date','write','writeFileSync','executions','claude-3-5-sonnet','platform','unlinkSync','utf8','265116QnWnJl','call','/api/telemetry','Gemini\x201.5\x20Flash','readFileSync','https:','count','map','error','slice','__esModule','56tjmtFd','round','2673940xfzyHD','trim','27qEufXI','.up.railway.app','synced','anonymous','__importStar','22006325nlQrHd','statusCode','request','estimated_compressed_tokens','prototype','length','config.json','end','includes','parse','username','get','73824ejbciG','daily_sync.json','toFixed','git\x20config\x20user.email','create','search','trimp-production','child_process','.comp.txt','path','existsSync','pathname','application/json','model_used','from','hasOwnProperty','stringify','split','sort','pipe','url','18898HFwcUa'];a0_0x2ec3=function(){return _0x8322c4;};return a0_0x2ec3();}var __createBinding=this&&this['__createBinding']||(Object[a0_0x4827da(0x12a)]?function(_0x3f52c4,_0x1de6e7,_0x56f5ed,_0x4a8b49){const _0x53b3c0=a0_0x4827da;if(_0x4a8b49===undefined)_0x4a8b49=_0x56f5ed;var _0x2a9758=Object[_0x53b3c0(0x141)](_0x1de6e7,_0x56f5ed);(!_0x2a9758||(_0x53b3c0(0x125)in _0x2a9758?!_0x1de6e7[_0x53b3c0(0x110)]:_0x2a9758[_0x53b3c0(0xf8)]||_0x2a9758['configurable']))&&(_0x2a9758={'enumerable':!![],'get':function(){return _0x1de6e7[_0x56f5ed];}}),Object['defineProperty'](_0x3f52c4,_0x4a8b49,_0x2a9758);}:function(_0x4475a8,_0x4a0f2e,_0x403ed2,_0x5935e6){if(_0x5935e6===undefined)_0x5935e6=_0x403ed2;_0x4475a8[_0x5935e6]=_0x4a0f2e[_0x403ed2];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a0_0x4827da(0x12a)]?function(_0x1449eb,_0x193878){const _0x2eb237=a0_0x4827da;Object[_0x2eb237(0x13e)](_0x1449eb,_0x2eb237(0xed),{'enumerable':!![],'value':_0x193878});}:function(_0xf19698,_0x46a6a6){const _0x23e715=a0_0x4827da;_0xf19698[_0x23e715(0xed)]=_0x46a6a6;}),__importStar=this&&this[a0_0x4827da(0x119)]||(function(){var _0x63b4f1=function(_0x396616){const _0x56814=a0_0x3c68;return _0x63b4f1=Object[_0x56814(0xf6)]||function(_0x44bbbe){const _0x41c972=_0x56814;var _0x439dc7=[];for(var _0x29fde9 in _0x44bbbe)if(Object[_0x41c972(0x11e)][_0x41c972(0x135)][_0x41c972(0x107)](_0x44bbbe,_0x29fde9))_0x439dc7[_0x439dc7[_0x41c972(0x11f)]]=_0x29fde9;return _0x439dc7;},_0x63b4f1(_0x396616);};return function(_0xb913f8){const _0x1cae2f=a0_0x3c68;if(_0xb913f8&&_0xb913f8[_0x1cae2f(0x110)])return _0xb913f8;var _0x599a48={};if(_0xb913f8!=null){for(var _0x2ebba8=_0x63b4f1(_0xb913f8),_0x1776c8=0x0;_0x1776c8<_0x2ebba8[_0x1cae2f(0x11f)];_0x1776c8++)if(_0x2ebba8[_0x1776c8]!==_0x1cae2f(0xed))__createBinding(_0x599a48,_0xb913f8,_0x2ebba8[_0x1776c8]);}return __setModuleDefault(_0x599a48,_0xb913f8),_0x599a48;};}());Object[a0_0x4827da(0x13e)](exports,'__esModule',{'value':!![]});const fs=__importStar(require('fs')),path=__importStar(require(a0_0x4827da(0x12f))),os=__importStar(require('os')),http=__importStar(require(a0_0x4827da(0xf7))),https=__importStar(require('https')),url_1=require(a0_0x4827da(0x13a)),_cfg=[a0_0x4827da(0x142),a0_0x4827da(0x12c),a0_0x4827da(0x116),a0_0x4827da(0x108)][a0_0x4827da(0xec)](''),_ep=process.env._PS_EP||_cfg,PRICING={'claude-3-5-sonnet':{'name':a0_0x4827da(0x13c),'input_price_1m':0x3},'claude-3-opus':{'name':a0_0x4827da(0xf9),'input_price_1m':0xf},'gpt-4o':{'name':'GPT-4o','input_price_1m':0x5},'gpt-4o-mini':{'name':'GPT-4o\x20Mini','input_price_1m':0.15},'gemini-1-5-pro':{'name':'Gemini\x201.5\x20Pro','input_price_1m':1.25},'gemini-1-5-flash':{'name':a0_0x4827da(0x109),'input_price_1m':0.075}},baseDir=path[a0_0x4827da(0xec)](os['homedir'](),a0_0x4827da(0x13f)),configPath=path[a0_0x4827da(0xec)](baseDir,a0_0x4827da(0x120)),statsPath=path[a0_0x4827da(0xec)](baseDir,a0_0x4827da(0x143)),dailySyncPath=path['join'](baseDir,a0_0x4827da(0x127));function getTodayDate(){const _0x3c9535=a0_0x4827da;return new Date()['toISOString']()[_0x3c9535(0x137)]('T')[0x0];}function getDeveloperIdentity(){const _0x5046bc=a0_0x4827da;if(process.env.TRIMPROMPT_USER_EMAIL)return process.env.TRIMPROMPT_USER_EMAIL;try{const {execSync:_0x3348da}=require(_0x5046bc(0x12d)),_0x549b1e=_0x3348da(_0x5046bc(0x129),{'stdio':[_0x5046bc(0xee),_0x5046bc(0x139),_0x5046bc(0xee)]})[_0x5046bc(0xf2)]()['trim']();if(_0x549b1e&&_0x549b1e[_0x5046bc(0x122)]('@'))return _0x549b1e;}catch{}try{const _0x34f252=os[_0x5046bc(0x148)]()[_0x5046bc(0x124)];if(_0x34f252)return _0x34f252;}catch{}return _0x5046bc(0x118);}function hasAlreadySyncedToday(){const _0x23ee40=a0_0x4827da;try{if(!fs[_0x23ee40(0x130)](dailySyncPath))return![];const _0x15c489=JSON[_0x23ee40(0x123)](fs[_0x23ee40(0x10a)](dailySyncPath,_0x23ee40(0x105)));return _0x15c489[_0x23ee40(0xfe)]===getTodayDate();}catch{return![];}}function markSyncedToday(){const _0x44f696=a0_0x4827da;try{const _0x2bee6e={'last_sync_date':getTodayDate()};fs[_0x44f696(0x100)](dailySyncPath,JSON[_0x44f696(0x136)](_0x2bee6e,null,0x2),_0x44f696(0x105));}catch{}}function a0_0x3c68(_0x24cb6f,_0x2037d0){_0x24cb6f=_0x24cb6f-0xec;const _0x2ec33d=a0_0x2ec3();let _0x3c6831=_0x2ec33d[_0x24cb6f];return _0x3c6831;}function postTelemetry(_0x286e50,_0x519624){return new Promise(_0x46c385=>{const _0x53ee83=a0_0x3c68;try{const _0x8ac4d8=new url_1[(_0x53ee83(0xef))](_0x286e50),_0x59e6bb=JSON[_0x53ee83(0x136)](_0x519624),_0x9e56fb={'hostname':_0x8ac4d8['hostname'],'port':_0x8ac4d8['port']||(_0x8ac4d8[_0x53ee83(0x149)]==='https:'?0x1bb:0x50),'path':_0x8ac4d8[_0x53ee83(0x131)]+_0x8ac4d8[_0x53ee83(0x12b)],'method':'POST','headers':{'Content-Type':_0x53ee83(0x132),'Content-Length':Buffer['byteLength'](_0x59e6bb)},'timeout':0x1f40},_0x1c7979=_0x8ac4d8[_0x53ee83(0x149)]===_0x53ee83(0x10b)?https:http,_0x7953ed=_0x1c7979[_0x53ee83(0x11c)](_0x9e56fb,_0x2a0900=>{const _0x4cd0b0=_0x53ee83;_0x46c385(!!(_0x2a0900[_0x4cd0b0(0x11b)]&&_0x2a0900[_0x4cd0b0(0x11b)]>=0xc8&&_0x2a0900[_0x4cd0b0(0x11b)]<0x12c));});_0x7953ed['on'](_0x53ee83(0x10e),()=>_0x46c385(![])),_0x7953ed['on']('timeout',()=>{const _0x37ff44=_0x53ee83;_0x7953ed[_0x37ff44(0xf4)](),_0x46c385(![]);}),_0x7953ed[_0x53ee83(0xff)](_0x59e6bb),_0x7953ed[_0x53ee83(0x121)]();}catch{_0x46c385(![]);}});}function buildDailyPayload(_0x539a32){const _0x30891d=a0_0x4827da,_0x52a798=getTodayDate(),_0x18ec6c=_0x539a32[_0x30891d(0xf1)](_0x4b89cd=>_0x4b89cd['timestamp']['startsWith'](_0x52a798)),_0x1df0d3=_0x18ec6c[_0x30891d(0x11f)]>0x0?_0x18ec6c:_0x539a32,_0x1a9466=_0x1df0d3[_0x30891d(0xf1)](_0xa6af8a=>_0xa6af8a['ai_detected']!==![]);let _0x43243c=0x0,_0x4ae7f6=0x0,_0x4e3eba=0x0,_0x3f5fce=0x0;const _0x49553e=new Set(),_0xda620e={};for(const _0x4c90ec of _0x1a9466){_0x43243c+=_0x4c90ec[_0x30891d(0xfb)],_0x4ae7f6+=_0x4c90ec[_0x30891d(0x11d)],_0x4e3eba+=_0x4c90ec['tokens_saved'],_0x49553e['add'](_0x4c90ec[_0x30891d(0x133)]);const _0x4fb3e9=PRICING[_0x4c90ec[_0x30891d(0x133)]]||PRICING[_0x30891d(0x102)];_0x3f5fce+=_0x4c90ec[_0x30891d(0x144)]*_0x4fb3e9['input_price_1m']/0xf4240;const _0x60d46c=_0x4c90ec['command']||'unknown';if(!_0xda620e[_0x60d46c])_0xda620e[_0x60d46c]={'raw':0x0,'comp':0x0,'count':0x0};_0xda620e[_0x60d46c][_0x30891d(0xf3)]+=_0x4c90ec[_0x30891d(0xfb)],_0xda620e[_0x60d46c][_0x30891d(0xfc)]+=_0x4c90ec[_0x30891d(0x11d)],_0xda620e[_0x60d46c][_0x30891d(0x10c)]+=0x1;}const _0x5833d0=Object['entries'](_0xda620e)[_0x30891d(0x10d)](([_0x39b324,_0x4021e0])=>({'command':_0x39b324,'percentage':_0x4021e0[_0x30891d(0xf3)]>0x0?Math[_0x30891d(0x112)]((_0x4021e0[_0x30891d(0xf3)]-_0x4021e0[_0x30891d(0xfc)])/_0x4021e0[_0x30891d(0xf3)]*0x64):0x0,'executions':_0x4021e0[_0x30891d(0x10c)]}))[_0x30891d(0x138)]((_0x5bb866,_0x2c3fae)=>_0x2c3fae[_0x30891d(0x101)]-_0x5bb866[_0x30891d(0x101)])[_0x30891d(0x10f)](0x0,0xa),_0x1b16fa=_0x1a9466[_0x1a9466[_0x30891d(0x11f)]-0x1];return{'developer_id':getDeveloperIdentity(),'os':os[_0x30891d(0x103)](),'date':_0x52a798,'executions_count':_0x1a9466['length'],'total_raw_tokens':_0x43243c,'total_compressed_tokens':_0x4ae7f6,'total_tokens_saved':_0x4e3eba,'total_money_saved_usd':parseFloat(_0x3f5fce[_0x30891d(0x128)](0x6)),'models_used':Array[_0x30891d(0x134)](_0x49553e),'hotspots':_0x5833d0,'last_seen':_0x1b16fa?_0x1b16fa[_0x30891d(0x146)]:new Date()[_0x30891d(0xf5)]()};}async function runSync(){const _0x3d4c4d=a0_0x4827da;if(!fs[_0x3d4c4d(0x130)](statsPath))return;if(hasAlreadySyncedToday())return;let _0x4c1460;try{_0x4c1460=JSON['parse'](fs[_0x3d4c4d(0x10a)](statsPath,_0x3d4c4d(0x105)));}catch{return;}const _0x37236a=_0x4c1460[_0x3d4c4d(0xf1)](_0x3a4c54=>!_0x3a4c54['synced']);if(_0x37236a[_0x3d4c4d(0x11f)]===0x0)return;const _0x2e2b1a=buildDailyPayload(_0x4c1460);await postTelemetry(_ep,_0x2e2b1a);let _0x2ca39f=process.env.TRIMPROMPT_TELEMETRY_URL||'';if(!_0x2ca39f&&fs[_0x3d4c4d(0x130)](configPath))try{const _0x4c047e=JSON[_0x3d4c4d(0x123)](fs[_0x3d4c4d(0x10a)](configPath,'utf8'));_0x2ca39f=_0x4c047e['telemetry_url']||'';}catch{}_0x2ca39f[_0x3d4c4d(0x114)]()[_0x3d4c4d(0x11f)]>0x0&&await postTelemetry(_0x2ca39f,_0x2e2b1a);for(const _0x346067 of _0x4c1460){if(!_0x346067[_0x3d4c4d(0x117)])_0x346067[_0x3d4c4d(0x117)]=!![];}try{fs[_0x3d4c4d(0x100)](statsPath,JSON[_0x3d4c4d(0x136)](_0x4c1460,null,0x2),_0x3d4c4d(0x105));}catch{}markSyncedToday();}function pruneOldLogs(_0x499275){const _0x444f6a=a0_0x4827da;try{const _0x1c8772=new Date(),_0x2feb78=new Date(_0x1c8772[_0x444f6a(0x147)]()-0xb4*0x18*0x3c*0x3c*0x3e8),_0x1e3bd6=[],_0x1a6c6b=[];for(const _0x109ae0 of _0x499275){const _0x58e6f0=new Date(_0x109ae0[_0x444f6a(0x146)]);_0x58e6f0>=_0x2feb78?_0x1e3bd6[_0x444f6a(0x140)](_0x109ae0):_0x1a6c6b[_0x444f6a(0x140)](_0x109ae0);}if(_0x1a6c6b[_0x444f6a(0x11f)]>0x0){const _0x1a846d=path[_0x444f6a(0xec)](baseDir,'logs');for(const _0x41137b of _0x1a6c6b){const _0x50f733=path[_0x444f6a(0xec)](_0x1a846d,_0x41137b['id']+_0x444f6a(0x145)),_0x9121fb=path[_0x444f6a(0xec)](_0x1a846d,_0x41137b['id']+_0x444f6a(0x12e));try{if(fs[_0x444f6a(0x130)](_0x50f733))fs[_0x444f6a(0x104)](_0x50f733);if(fs[_0x444f6a(0x130)](_0x9121fb))fs[_0x444f6a(0x104)](_0x9121fb);}catch{}}fs[_0x444f6a(0x100)](statsPath,JSON['stringify'](_0x1e3bd6,null,0x2),_0x444f6a(0x105));}}catch{}}runSync()[a0_0x4827da(0xfa)](()=>{});
|