trimprompt 1.0.29 → 1.0.30
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-manager.js +1 -0
- 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/file-watcher.js +1 -0
- 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/hooks/claude-hook.js +1 -0
- package/index.html +339 -119
- 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/mcp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';const a0_0x39f816=a0_0x1e90;(function(_0x325918,_0x4f3c0f){const _0x4beab2=a0_0x1e90,_0x1339da=_0x325918();while(!![]){try{const _0x47ac28=parseInt(_0x4beab2(0x1e8))/0x1*(-parseInt(_0x4beab2(0x21c))/0x2)+parseInt(_0x4beab2(0x20c))/0x3+-parseInt(_0x4beab2(0x203))/0x4*(parseInt(_0x4beab2(0x214))/0x5)+parseInt(_0x4beab2(0x227))/0x6*(parseInt(_0x4beab2(0x21b))/0x7)+-parseInt(_0x4beab2(0x1ee))/0x8+parseInt(_0x4beab2(0x1ed))/0x9*(-parseInt(_0x4beab2(0x1f1))/0xa)+parseInt(_0x4beab2(0x1f2))/0xb*(-parseInt(_0x4beab2(0x1ec))/0xc);if(_0x47ac28===_0x4f3c0f)break;else _0x1339da['push'](_0x1339da['shift']());}catch(_0x67d1bf){_0x1339da['push'](_0x1339da['shift']());}}}(a0_0x1aaa,0x8863d));var __createBinding=this&&this[a0_0x39f816(0x1ea)]||(Object[a0_0x39f816(0x221)]?function(_0x43d500,_0x124459,_0xc24552,_0x26f9d6){const _0x20fd68=a0_0x39f816;if(_0x26f9d6===undefined)_0x26f9d6=_0xc24552;var _0x3bba64=Object[_0x20fd68(0x20e)](_0x124459,_0xc24552);(!_0x3bba64||(_0x20fd68(0x225)in _0x3bba64?!_0x124459[_0x20fd68(0x20f)]:_0x3bba64[_0x20fd68(0x1e3)]||_0x3bba64[_0x20fd68(0x202)]))&&(_0x3bba64={'enumerable':!![],'get':function(){return _0x124459[_0xc24552];}}),Object[_0x20fd68(0x20b)](_0x43d500,_0x26f9d6,_0x3bba64);}:function(_0x1b5491,_0x465222,_0x4d49e3,_0x3c6592){if(_0x3c6592===undefined)_0x3c6592=_0x4d49e3;_0x1b5491[_0x3c6592]=_0x465222[_0x4d49e3];}),__setModuleDefault=this&&this[a0_0x39f816(0x211)]||(Object[a0_0x39f816(0x221)]?function(_0x2c703e,_0x44abba){const _0xc11ce9=a0_0x39f816;Object[_0xc11ce9(0x20b)](_0x2c703e,_0xc11ce9(0x213),{'enumerable':!![],'value':_0x44abba});}:function(_0x298f66,_0x5ea884){const _0x2c42d5=a0_0x39f816;_0x298f66[_0x2c42d5(0x213)]=_0x5ea884;}),__importStar=this&&this[a0_0x39f816(0x1e6)]||(function(){var _0x32330c=function(_0x5af01a){return _0x32330c=Object['getOwnPropertyNames']||function(_0x2c542d){const _0x4aab8f=a0_0x1e90;var _0x5a4d79=[];for(var _0x265f67 in _0x2c542d)if(Object[_0x4aab8f(0x1e7)][_0x4aab8f(0x1fd)][_0x4aab8f(0x218)](_0x2c542d,_0x265f67))_0x5a4d79[_0x5a4d79['length']]=_0x265f67;return _0x5a4d79;},_0x32330c(_0x5af01a);};return function(_0x161a03){const _0x135f70=a0_0x1e90;if(_0x161a03&&_0x161a03['__esModule'])return _0x161a03;var _0x47cd18={};if(_0x161a03!=null){for(var _0x104405=_0x32330c(_0x161a03),_0x42e25e=0x0;_0x42e25e<_0x104405['length'];_0x42e25e++)if(_0x104405[_0x42e25e]!==_0x135f70(0x213))__createBinding(_0x47cd18,_0x161a03,_0x104405[_0x42e25e]);}return __setModuleDefault(_0x47cd18,_0x161a03),_0x47cd18;};}());Object[a0_0x39f816(0x20b)](exports,a0_0x39f816(0x20f),{'value':!![]}),exports[a0_0x39f816(0x1f9)]=runMcpProxy;function a0_0x1e90(_0x270b79,_0x18a4b0){_0x270b79=_0x270b79-0x1e3;const _0x1aaa7c=a0_0x1aaa();let _0x1e9063=_0x1aaa7c[_0x270b79];return _0x1e9063;}const child_process_1=require(a0_0x39f816(0x1f0)),readline=__importStar(require('readline')),filters_1=require('./filters'),tracker_1=require('./tracker'),proxy_conv_1=require(a0_0x39f816(0x20d)),proxy_resp_1=require(a0_0x39f816(0x1f5));function a0_0x1aaa(){const _0x345081=['messages','logExecution','savedTokens','max_tokens','stdout','defineProperty','1262292WIqdaR','./proxy-conv','getOwnPropertyDescriptor','__esModule','inherit','__setModuleDefault','result','default','263700PncXhm','mcp-tool-call','isArray','features_enabled','call','trim','stringify','4193CIPmxU','166aTQNen','trimmedCount','stdin','compressConversation','complexity','create','2.0','exit','content','get','length','10074LtYXVa','writable','resp_optimize','params','__importStar','prototype','1619ORIMzb','line','__createBinding','jsonrpc','162156eFRjxH','32949lvjQfq','589200jmqBDV','mcp\x20tool\x20(id:\x20','child_process','820sMViOo','121oUpJGF','createInterface','proxy:conv-compress','./proxy-resp','text','spawn','method','runMcpProxy','optimizeMaxTokens','redaction_enabled','error','hasOwnProperty','tracker','\x20messages\x20(','close','type','configurable','16EBhXPm','write','getConfig'];a0_0x1aaa=function(){return _0x345081;};return a0_0x1aaa();}function runMcpProxy(_0x676797,_0x723cdd){const _0x20057d=a0_0x39f816,_0x42bc01=(0x0,child_process_1[_0x20057d(0x1f7)])(_0x676797,_0x723cdd,{'stdio':['pipe','pipe',_0x20057d(0x210)]}),_0x327a82=tracker_1['tracker'][_0x20057d(0x205)](),_0x56625b=_0x327a82[_0x20057d(0x217)]||{},_0x3c9f8c=_0x56625b['conv_compress']!==![],_0x3744c4=_0x56625b[_0x20057d(0x1e4)]!==![],_0x42ca0c=readline[_0x20057d(0x1f3)]({'input':process[_0x20057d(0x21e)],'terminal':![]});_0x42ca0c['on'](_0x20057d(0x1e9),_0x2bb7c4=>{const _0x51d234=_0x20057d;try{const _0x2a9e9d=JSON['parse'](_0x2bb7c4);if(_0x2a9e9d&&_0x2a9e9d[_0x51d234(0x1eb)]===_0x51d234(0x222)&&_0x2a9e9d[_0x51d234(0x1f8)]&&_0x2a9e9d[_0x51d234(0x1e5)]){const _0xeac1b8=_0x2a9e9d['params'];if(Array['isArray'](_0xeac1b8[_0x51d234(0x206)])&&_0xeac1b8[_0x51d234(0x206)][_0x51d234(0x226)]>0x0){if(_0x3c9f8c){const _0x12ace0=(0x0,proxy_conv_1[_0x51d234(0x21f)])(_0xeac1b8[_0x51d234(0x206)]);(_0x12ace0[_0x51d234(0x21d)]>0x0||_0x12ace0[_0x51d234(0x208)]>0x0)&&(_0xeac1b8[_0x51d234(0x206)]=_0x12ace0[_0x51d234(0x206)],tracker_1[_0x51d234(0x1fe)]['logExecution'](_0x51d234(0x1f4),_0x12ace0[_0x51d234(0x21d)]+_0x12ace0[_0x51d234(0x206)][_0x51d234(0x226)]+'\x20messages',_0x12ace0[_0x51d234(0x206)][_0x51d234(0x226)]+_0x51d234(0x1ff)+_0x12ace0[_0x51d234(0x21d)]+'\x20trimmed,\x20~'+_0x12ace0['savedTokens']+'\x20tokens\x20saved)',0x0,undefined,['conv_compress']));}if(_0x3744c4){const _0x512955=(0x0,proxy_resp_1[_0x51d234(0x1fa)])(_0xeac1b8['messages'],_0xeac1b8[_0x51d234(0x209)]);if(_0x512955){const _0x154385=_0xeac1b8[_0x51d234(0x209)]||_0x51d234(0x213);_0xeac1b8[_0x51d234(0x209)]=_0x512955[_0x51d234(0x209)],tracker_1[_0x51d234(0x1fe)][_0x51d234(0x207)]('proxy:resp-optimize','max_tokens:\x20'+_0x154385,'max_tokens:\x20'+_0x512955['max_tokens']+'\x20('+_0x512955[_0x51d234(0x220)]+')',0x0,undefined,[_0x51d234(0x1e4)]);}}}_0x42bc01[_0x51d234(0x21e)][_0x51d234(0x204)](JSON[_0x51d234(0x21a)](_0x2a9e9d)+'\x0a');}else _0x42bc01[_0x51d234(0x21e)][_0x51d234(0x204)](_0x2bb7c4+'\x0a');}catch{_0x42bc01[_0x51d234(0x21e)][_0x51d234(0x204)](_0x2bb7c4+'\x0a');}}),_0x42ca0c['on'](_0x20057d(0x200),()=>{try{_0x42bc01['stdin']['end']();}catch{}});const _0x12e818=readline[_0x20057d(0x1f3)]({'input':_0x42bc01['stdout'],'terminal':![]});_0x12e818['on']('line',_0x335672=>{const _0x37e2b5=_0x20057d;try{const _0x46f819=JSON['parse'](_0x335672);if(_0x46f819&&_0x46f819[_0x37e2b5(0x1eb)]===_0x37e2b5(0x222)&&_0x46f819['id']!==undefined&&_0x46f819[_0x37e2b5(0x212)]&&Array[_0x37e2b5(0x216)](_0x46f819[_0x37e2b5(0x212)][_0x37e2b5(0x224)])){let _0x3030ed=![];for(const _0x509a12 of _0x46f819[_0x37e2b5(0x212)][_0x37e2b5(0x224)]){if(_0x509a12[_0x37e2b5(0x201)]===_0x37e2b5(0x1f6)&&typeof _0x509a12[_0x37e2b5(0x1f6)]==='string'&&_0x509a12['text'][_0x37e2b5(0x219)]()[_0x37e2b5(0x226)]>0x0){const _0x302b6e=_0x509a12[_0x37e2b5(0x1f6)],_0x58d6d3=(0x0,filters_1['compressOutput'])(_0x37e2b5(0x215),_0x302b6e,'',tracker_1[_0x37e2b5(0x1fe)][_0x37e2b5(0x205)]()[_0x37e2b5(0x1fb)]);tracker_1[_0x37e2b5(0x1fe)][_0x37e2b5(0x207)](_0x37e2b5(0x1ef)+_0x46f819['id']+')',_0x302b6e,_0x58d6d3,0x0),_0x509a12[_0x37e2b5(0x1f6)]=_0x58d6d3,_0x3030ed=!![];}}_0x3030ed?process[_0x37e2b5(0x20a)][_0x37e2b5(0x204)](JSON[_0x37e2b5(0x21a)](_0x46f819)+'\x0a'):process[_0x37e2b5(0x20a)][_0x37e2b5(0x204)](_0x335672+'\x0a');}else process[_0x37e2b5(0x20a)][_0x37e2b5(0x204)](_0x335672+'\x0a');}catch{process[_0x37e2b5(0x20a)][_0x37e2b5(0x204)](_0x335672+'\x0a');}}),_0x42bc01['on'](_0x20057d(0x200),_0xba9385=>{const _0x531b39=_0x20057d;process[_0x531b39(0x223)](_0xba9385||0x0);}),_0x42bc01['on']('error',_0x145388=>{const _0x17dc2d=_0x20057d;console[_0x17dc2d(0x1fc)]('[TrimPrompt]\x20MCP\x20Server\x20Spawn\x20Error:\x20'+_0x145388['message']),process[_0x17dc2d(0x223)](0x1);});}
|
package/package.json
CHANGED
package/proxy-conv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';function a0_0x5e51(_0x3355e4,_0x1b2e5e){_0x3355e4=_0x3355e4-0x1ef;const _0x2cd10e=a0_0x2cd1();let _0x5e51ab=_0x2cd10e[_0x3355e4];return _0x5e51ab;}const a0_0x362709=a0_0x5e51;(function(_0x349dbf,_0x3688b1){const _0x488f75=a0_0x5e51,_0x3f5a01=_0x349dbf();while(!![]){try{const _0xd5e438=-parseInt(_0x488f75(0x206))/0x1+-parseInt(_0x488f75(0x1fe))/0x2*(-parseInt(_0x488f75(0x1f6))/0x3)+parseInt(_0x488f75(0x1f5))/0x4+-parseInt(_0x488f75(0x214))/0x5+parseInt(_0x488f75(0x1f4))/0x6+parseInt(_0x488f75(0x1f7))/0x7+-parseInt(_0x488f75(0x1f0))/0x8;if(_0xd5e438===_0x3688b1)break;else _0x3f5a01['push'](_0x3f5a01['shift']());}catch(_0x2b7b2a){_0x3f5a01['push'](_0x3f5a01['shift']());}}}(a0_0x2cd1,0x981ae));Object[a0_0x362709(0x1f2)](exports,a0_0x362709(0x1f8),{'value':!![]}),exports[a0_0x362709(0x215)]=compressConversation;const ROLE_WEIGHT={'system':0x1,'user':0.8,'assistant':0.5,'tool':0.3};function a0_0x2cd1(){const _0x31a5ca=['string','role','slice','\x20lines\x20trimmed\x20by\x20TrimPrompt\x20...]\x0a','sort','map','forEach','tokens','push','isArray','tool_result','\x20chars\x20trimmed\x20...]','4717680HfRpnJ','compressConversation','type','3051632CqFTUm','system','defineProperty','originalIndex','3092352igTgWC','3118604rLUojB','476472diFMbj','8616993MilPEN','__esModule','reduce','\x20lines\x20trimmed\x20...]','content','score','\x20chars\x20trimmed\x20by\x20TrimPrompt\x20...]','2xWhWqc','filter','indexOf','msg','object','length','\x0a[...\x20','text','736854lbyMcY','join'];a0_0x2cd1=function(){return _0x31a5ca;};return a0_0x2cd1();}function estimateTokens(_0x14d85d){const _0x4e14c5=a0_0x362709;return Math['ceil'](_0x14d85d[_0x4e14c5(0x203)]/0x4);}function blockText(_0x371b06){const _0x399d58=a0_0x362709;if(!_0x371b06||typeof _0x371b06!==_0x399d58(0x202))return'';if(_0x371b06['type']===_0x399d58(0x205)&&typeof _0x371b06[_0x399d58(0x205)]===_0x399d58(0x208))return _0x371b06[_0x399d58(0x205)];if(_0x371b06[_0x399d58(0x1ef)]===_0x399d58(0x212)){if(typeof _0x371b06[_0x399d58(0x1fb)]===_0x399d58(0x208))return _0x371b06['content'];if(Array[_0x399d58(0x211)](_0x371b06[_0x399d58(0x1fb)]))return _0x371b06[_0x399d58(0x1fb)][_0x399d58(0x20d)](blockText)['filter'](Boolean)[_0x399d58(0x207)]('\x0a');}return'';}function messageText(_0x5dc84d){const _0xd89db4=a0_0x362709;if(typeof _0x5dc84d[_0xd89db4(0x1fb)]===_0xd89db4(0x208))return _0x5dc84d[_0xd89db4(0x1fb)];if(Array[_0xd89db4(0x211)](_0x5dc84d['content']))return _0x5dc84d[_0xd89db4(0x1fb)]['map'](blockText)[_0xd89db4(0x1ff)](Boolean)[_0xd89db4(0x207)]('\x0a');return'';}function summarizeText(_0x2781e9){const _0xdd7d9a=a0_0x362709,_0x4f2c19=estimateTokens(_0x2781e9),_0x496ecf=_0x2781e9['split']('\x0a');if(_0x4f2c19>0x7d0){if(_0x496ecf[_0xdd7d9a(0x203)]>0xa){const _0x690b8b=_0x496ecf[_0xdd7d9a(0x20a)](0x0,0x5)[_0xdd7d9a(0x207)]('\x0a'),_0x59a15d=_0x496ecf['slice'](-0x5)[_0xdd7d9a(0x207)]('\x0a');return _0x690b8b+_0xdd7d9a(0x204)+(_0x496ecf['length']-0xa)+_0xdd7d9a(0x20b)+_0x59a15d;}return _0x2781e9[_0xdd7d9a(0x20a)](0x0,0x7d0)+(_0xdd7d9a(0x204)+(_0x2781e9[_0xdd7d9a(0x203)]-0x7d0)+_0xdd7d9a(0x1fd));}if(_0x4f2c19>0x1f4){if(_0x496ecf[_0xdd7d9a(0x203)]>0xa)return _0x496ecf[_0xdd7d9a(0x20a)](0x0,0xa)[_0xdd7d9a(0x207)]('\x0a')+(_0xdd7d9a(0x204)+(_0x496ecf[_0xdd7d9a(0x203)]-0xa)+_0xdd7d9a(0x1fa));return _0x2781e9[_0xdd7d9a(0x20a)](0x0,0x320)+('\x0a[...\x20'+(_0x2781e9[_0xdd7d9a(0x203)]-0x320)+_0xdd7d9a(0x213));}return _0x2781e9;}function summarizeBlock(_0x321029){const _0x1f7dd5=a0_0x362709;if(!_0x321029||typeof _0x321029!==_0x1f7dd5(0x202))return _0x321029;if(_0x321029[_0x1f7dd5(0x1ef)]==='text'&&typeof _0x321029[_0x1f7dd5(0x205)]===_0x1f7dd5(0x208))return{..._0x321029,'text':summarizeText(_0x321029[_0x1f7dd5(0x205)])};if(_0x321029['type']===_0x1f7dd5(0x212)){if(typeof _0x321029['content']===_0x1f7dd5(0x208))return{..._0x321029,'content':summarizeText(_0x321029[_0x1f7dd5(0x1fb)])};if(Array[_0x1f7dd5(0x211)](_0x321029[_0x1f7dd5(0x1fb)])){const _0x28ecda=largestBlockIndex(_0x321029['content']);if(_0x28ecda>=0x0){const _0x4e524f=_0x321029['content'][_0x1f7dd5(0x20d)]((_0x5d8ea1,_0x52ba2b)=>_0x52ba2b===_0x28ecda?summarizeBlock(_0x5d8ea1):_0x5d8ea1);return{..._0x321029,'content':_0x4e524f};}}}return _0x321029;}function largestBlockIndex(_0x5c6dd7){const _0x7ad24e=a0_0x362709;let _0x51af54=-0x1,_0x4ef777=-0x1;return _0x5c6dd7[_0x7ad24e(0x20e)]((_0x2ac5fb,_0x4f6f7f)=>{const _0x53eab0=_0x7ad24e,_0x3d4686=blockText(_0x2ac5fb)[_0x53eab0(0x203)];_0x3d4686>_0x4ef777&&(_0x4ef777=_0x3d4686,_0x51af54=_0x4f6f7f);}),_0x4ef777>0x0?_0x51af54:-0x1;}function scoreMessage(_0x337a4d,_0x37bacb,_0x27449c){const _0x5392e1=ROLE_WEIGHT[_0x337a4d['role']]||0.4,_0x154b45=(_0x37bacb+0x1)/_0x27449c,_0x2c1648=messageText(_0x337a4d),_0x22e5a4=estimateTokens(_0x2c1648),_0x5ed6bb=_0x22e5a4>0x7d0?0.6:_0x22e5a4>0x1f4?0.8:0x1;return _0x5392e1*(0.3+0.7*_0x154b45)*_0x5ed6bb;}function summarizeMessage(_0x2ee05a){const _0x36d2fd=a0_0x362709,_0x3f36f5=estimateTokens(messageText(_0x2ee05a));if(_0x3f36f5<=0x1f4)return _0x2ee05a;if(typeof _0x2ee05a[_0x36d2fd(0x1fb)]==='string')return{..._0x2ee05a,'content':summarizeText(_0x2ee05a[_0x36d2fd(0x1fb)])};if(Array[_0x36d2fd(0x211)](_0x2ee05a[_0x36d2fd(0x1fb)])){const _0x7da060=largestBlockIndex(_0x2ee05a['content']);if(_0x7da060>=0x0){const _0x427a0b=_0x2ee05a[_0x36d2fd(0x1fb)][_0x36d2fd(0x20d)]((_0x24cb14,_0x15ea5c)=>_0x15ea5c===_0x7da060?summarizeBlock(_0x24cb14):_0x24cb14);return{..._0x2ee05a,'content':_0x427a0b};}}return _0x2ee05a;}function compressConversation(_0x37129e,_0xf3542e){const _0x2386ec=a0_0x362709,_0x5a03eb={'messages':_0x37129e,'trimmedCount':0x0,'savedTokens':0x0};if(!_0x37129e||!Array[_0x2386ec(0x211)](_0x37129e)||_0x37129e[_0x2386ec(0x203)]<=0x6)return _0x5a03eb;try{return _compressConversation(_0x37129e,_0xf3542e);}catch{return _0x5a03eb;}}function _compressConversation(_0x3a5ac7,_0x11c21a){const _0x5c2c95=a0_0x362709,_0x46d170=_0x11c21a||0x13880,_0xbb82fe=0x4,_0x185c77=_0x3a5ac7['filter'](_0xcb5362=>_0xcb5362['role']===_0x5c2c95(0x1f1)),_0x59478c=_0x3a5ac7[_0x5c2c95(0x1ff)](_0x322038=>_0x322038[_0x5c2c95(0x209)]!=='system'),_0x504cbf=_0x59478c[_0x5c2c95(0x20a)](-_0xbb82fe),_0x575b39=_0x59478c[_0x5c2c95(0x20a)](0x0,-_0xbb82fe),_0x2ab68d=_0x575b39[_0x5c2c95(0x20d)]((_0x18d02f,_0x461fb6)=>({'msg':_0x18d02f,'score':scoreMessage(_0x18d02f,_0x461fb6,_0x575b39[_0x5c2c95(0x203)]),'tokens':estimateTokens(messageText(_0x18d02f))})),_0x193538=_0x2ab68d[_0x5c2c95(0x1f9)]((_0xb9893f,_0x59a45e)=>_0xb9893f+_0x59a45e[_0x5c2c95(0x20f)],0x0),_0x7c06f9=_0x504cbf[_0x5c2c95(0x1f9)]((_0x295fed,_0x5ea4dd)=>_0x295fed+estimateTokens(messageText(_0x5ea4dd)),0x0),_0x7fa775=_0x185c77[_0x5c2c95(0x1f9)]((_0x2587bc,_0x261a32)=>_0x2587bc+estimateTokens(messageText(_0x261a32)),0x0),_0x27141e=_0x46d170-_0x7c06f9-_0x7fa775;if(_0x193538<=_0x27141e){let _0x3a8436=0x0;const _0x8ea163=_0x2ab68d[_0x5c2c95(0x20d)](_0x480287=>{const _0x40cf8a=_0x5c2c95;if(_0x480287[_0x40cf8a(0x20f)]>0x1f4){const _0x44a55f=summarizeMessage(_0x480287[_0x40cf8a(0x201)]),_0xb0a237=estimateTokens(messageText(_0x44a55f));if(_0xb0a237<_0x480287['tokens'])return _0x3a8436+=_0x480287[_0x40cf8a(0x20f)]-_0xb0a237,_0x44a55f;}return _0x480287[_0x40cf8a(0x201)];});return{'messages':[..._0x185c77,..._0x8ea163,..._0x504cbf],'trimmedCount':0x0,'savedTokens':_0x3a8436};}_0x2ab68d[_0x5c2c95(0x20c)]((_0x18c24d,_0x49955e)=>_0x49955e[_0x5c2c95(0x1fc)]-_0x18c24d[_0x5c2c95(0x1fc)]);let _0xb4d244=0x0,_0x47a26c=0x0,_0x2cba12=0x0;const _0x11e267=[];for(const _0x333236 of _0x2ab68d){if(_0xb4d244+_0x333236[_0x5c2c95(0x20f)]<=_0x27141e){if(_0x333236[_0x5c2c95(0x20f)]>0x3e8){const _0x5b9d28=summarizeMessage(_0x333236['msg']),_0x100d6a=estimateTokens(messageText(_0x5b9d28));_0x2cba12+=_0x333236['tokens']-_0x100d6a,_0xb4d244+=_0x100d6a,_0x11e267[_0x5c2c95(0x210)]({'msg':_0x5b9d28,'originalIndex':_0x575b39[_0x5c2c95(0x200)](_0x333236[_0x5c2c95(0x201)])});}else _0xb4d244+=_0x333236[_0x5c2c95(0x20f)],_0x11e267[_0x5c2c95(0x210)]({'msg':_0x333236[_0x5c2c95(0x201)],'originalIndex':_0x575b39[_0x5c2c95(0x200)](_0x333236[_0x5c2c95(0x201)])});}else _0x47a26c++,_0x2cba12+=_0x333236[_0x5c2c95(0x20f)];}_0x11e267[_0x5c2c95(0x20c)]((_0x40bba0,_0x232bde)=>_0x40bba0[_0x5c2c95(0x1f3)]-_0x232bde['originalIndex']);const _0x1ef78a=[..._0x185c77,..._0x11e267['map'](_0x274039=>_0x274039['msg']),..._0x504cbf];return{'messages':_0x1ef78a,'trimmedCount':_0x47a26c,'savedTokens':_0x2cba12};}
|
package/proxy-daemon.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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{}}
|
|
1
|
+
'use strict';const a0_0x40fd32=a0_0x53cb;(function(_0x388cbe,_0xc844b8){const _0x18d5e0=a0_0x53cb,_0x38e39e=_0x388cbe();while(!![]){try{const _0x4a7f1e=parseInt(_0x18d5e0(0x12f))/0x1+parseInt(_0x18d5e0(0x134))/0x2*(-parseInt(_0x18d5e0(0x131))/0x3)+parseInt(_0x18d5e0(0x142))/0x4*(-parseInt(_0x18d5e0(0x119))/0x5)+-parseInt(_0x18d5e0(0x144))/0x6*(parseInt(_0x18d5e0(0x147))/0x7)+-parseInt(_0x18d5e0(0x178))/0x8+parseInt(_0x18d5e0(0x135))/0x9*(-parseInt(_0x18d5e0(0x122))/0xa)+parseInt(_0x18d5e0(0x133))/0xb;if(_0x4a7f1e===_0xc844b8)break;else _0x38e39e['push'](_0x38e39e['shift']());}catch(_0xf24030){_0x38e39e['push'](_0x38e39e['shift']());}}}(a0_0xd5a2,0xac99e));var __createBinding=this&&this[a0_0x40fd32(0x153)]||(Object['create']?function(_0x5a8327,_0x1716e7,_0x27e070,_0x106287){const _0x2884e3=a0_0x40fd32;if(_0x106287===undefined)_0x106287=_0x27e070;var _0x12bed8=Object['getOwnPropertyDescriptor'](_0x1716e7,_0x27e070);(!_0x12bed8||(_0x2884e3(0x167)in _0x12bed8?!_0x1716e7[_0x2884e3(0x148)]:_0x12bed8[_0x2884e3(0x10f)]||_0x12bed8[_0x2884e3(0x172)]))&&(_0x12bed8={'enumerable':!![],'get':function(){return _0x1716e7[_0x27e070];}}),Object[_0x2884e3(0x143)](_0x5a8327,_0x106287,_0x12bed8);}:function(_0x5510e5,_0x415ca8,_0x5209ba,_0x16ef7f){if(_0x16ef7f===undefined)_0x16ef7f=_0x5209ba;_0x5510e5[_0x16ef7f]=_0x415ca8[_0x5209ba];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a0_0x40fd32(0x112)]?function(_0x37ec6a,_0x17b0e4){const _0x2fcdbb=a0_0x40fd32;Object[_0x2fcdbb(0x143)](_0x37ec6a,_0x2fcdbb(0x12d),{'enumerable':!![],'value':_0x17b0e4});}:function(_0x5e6568,_0x40c23d){const _0x53bef8=a0_0x40fd32;_0x5e6568[_0x53bef8(0x12d)]=_0x40c23d;}),__importStar=this&&this['__importStar']||(function(){var _0x4daf40=function(_0xa7ce8d){const _0x3fa863=a0_0x53cb;return _0x4daf40=Object[_0x3fa863(0x18f)]||function(_0x26811d){const _0x5687fe=_0x3fa863;var _0x326f3b=[];for(var _0x1b6cd3 in _0x26811d)if(Object['prototype'][_0x5687fe(0x14c)][_0x5687fe(0x118)](_0x26811d,_0x1b6cd3))_0x326f3b[_0x326f3b[_0x5687fe(0x145)]]=_0x1b6cd3;return _0x326f3b;},_0x4daf40(_0xa7ce8d);};return function(_0x987d35){const _0xbae4ff=a0_0x53cb;if(_0x987d35&&_0x987d35[_0xbae4ff(0x148)])return _0x987d35;var _0x5eae0f={};if(_0x987d35!=null){for(var _0x326baf=_0x4daf40(_0x987d35),_0x2328e5=0x0;_0x2328e5<_0x326baf[_0xbae4ff(0x145)];_0x2328e5++)if(_0x326baf[_0x2328e5]!==_0xbae4ff(0x12d))__createBinding(_0x5eae0f,_0x987d35,_0x326baf[_0x2328e5]);}return __setModuleDefault(_0x5eae0f,_0x987d35),_0x5eae0f;};}());Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a0_0x40fd32(0x185)]=getProxyPort,exports[a0_0x40fd32(0x111)]=isProxyRunning,exports[a0_0x40fd32(0x165)]=startProxyDaemon,exports[a0_0x40fd32(0x163)]=stopProxyDaemon,exports[a0_0x40fd32(0x155)]=enableAutostart,exports[a0_0x40fd32(0x188)]=disableAutostart,exports[a0_0x40fd32(0x179)]=setAnthropicBaseUrl,exports[a0_0x40fd32(0x14e)]=removeAnthropicBaseUrl;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x40fd32(0x13b))),os=__importStar(require('os')),child_process_1=require(a0_0x40fd32(0x158)),baseDir=path[a0_0x40fd32(0x180)](os['homedir'](),'.trimprompt'),pidFile=path[a0_0x40fd32(0x180)](baseDir,'proxy.pid'),portFile=path['join'](baseDir,a0_0x40fd32(0x10d)),DEFAULT_PORT=0x1f90;function ensureDir(){const _0x139a63=a0_0x40fd32;if(!fs[_0x139a63(0x166)](baseDir))fs[_0x139a63(0x169)](baseDir,{'recursive':!![]});}function getProxyPort(){const _0x331bc5=a0_0x40fd32;try{if(fs[_0x331bc5(0x166)](portFile))return parseInt(fs[_0x331bc5(0x113)](portFile,_0x331bc5(0x136))[_0x331bc5(0x17e)]())||DEFAULT_PORT;}catch{}return DEFAULT_PORT;}function isProxyRunning(){const _0xc8929f=a0_0x40fd32,_0x180cd6=getProxyPort();try{if(!fs[_0xc8929f(0x166)](pidFile))return{'running':![],'pid':null,'port':_0x180cd6};const _0x420ed3=parseInt(fs[_0xc8929f(0x113)](pidFile,_0xc8929f(0x136))['trim']());if(!_0x420ed3)return{'running':![],'pid':null,'port':_0x180cd6};if(process[_0xc8929f(0x15c)]===_0xc8929f(0x129)){const _0x59f230=(0x0,child_process_1[_0xc8929f(0x146)])('tasklist\x20/FI\x20\x22PID\x20eq\x20'+_0x420ed3+_0xc8929f(0x193),{'encoding':_0xc8929f(0x136),'timeout':0x1388}),_0x15585d='\x22'+_0x420ed3+'\x22';if(_0x59f230[_0xc8929f(0x132)]('\x0a')[_0xc8929f(0x161)](_0x768272=>_0x768272[_0xc8929f(0x186)](_0x15585d)))return{'running':!![],'pid':_0x420ed3,'port':_0x180cd6};}else return process[_0xc8929f(0x156)](_0x420ed3,0x0),{'running':!![],'pid':_0x420ed3,'port':_0x180cd6};}catch{}try{fs[_0xc8929f(0x15f)](pidFile);}catch{}return{'running':![],'pid':null,'port':_0x180cd6};}function startProxyDaemon(_0x12c736){const _0x54b810=a0_0x40fd32,_0x143523=isProxyRunning();if(_0x143523[_0x54b810(0x17c)])return{'success':!![],'pid':_0x143523[_0x54b810(0x13d)],'port':_0x143523['port'],'message':'Proxy\x20already\x20running\x20(pid\x20'+_0x143523[_0x54b810(0x13d)]+_0x54b810(0x127)+_0x143523[_0x54b810(0x181)]};ensureDir();const _0x34c209=_0x12c736||DEFAULT_PORT;try{const _0xd3e415=path[_0x54b810(0x180)](__dirname,_0x54b810(0x15b));if(!fs[_0x54b810(0x166)](_0xd3e415))return{'success':![],'pid':null,'port':_0x34c209,'message':_0x54b810(0x138)+_0xd3e415};const _0x4be287=(0x0,child_process_1['spawn'])(process[_0x54b810(0x13f)],[_0xd3e415,_0x54b810(0x14b),_0x54b810(0x117),String(_0x34c209)],{'detached':!![],'stdio':_0x54b810(0x187),'env':{...process.env,'TRIMPROMPT_DISABLED':'1'}});_0x4be287[_0x54b810(0x192)]();if(_0x4be287[_0x54b810(0x13d)])return fs['writeFileSync'](pidFile,String(_0x4be287[_0x54b810(0x13d)]),'utf8'),fs[_0x54b810(0x15e)](portFile,String(_0x34c209),_0x54b810(0x136)),{'success':!![],'pid':_0x4be287[_0x54b810(0x13d)],'port':_0x34c209,'message':'Proxy\x20started\x20(pid\x20'+_0x4be287[_0x54b810(0x13d)]+_0x54b810(0x127)+_0x34c209};return{'success':![],'pid':null,'port':_0x34c209,'message':_0x54b810(0x18a)};}catch(_0x32b01f){return{'success':![],'pid':null,'port':_0x34c209,'message':_0x54b810(0x17a)+_0x32b01f[_0x54b810(0x13c)]};}}function stopProxyDaemon(){const _0x40a783=a0_0x40fd32,_0x3d10a2=isProxyRunning();if(!_0x3d10a2[_0x40a783(0x17c)]||!_0x3d10a2['pid'])return{'success':!![],'message':'Proxy\x20is\x20not\x20running'};try{process[_0x40a783(0x15c)]==='win32'?(0x0,child_process_1[_0x40a783(0x146)])(_0x40a783(0x16f)+_0x3d10a2[_0x40a783(0x13d)]+_0x40a783(0x175),{'timeout':0x1388}):process[_0x40a783(0x156)](_0x3d10a2[_0x40a783(0x13d)],_0x40a783(0x14f));}catch{}try{fs[_0x40a783(0x15f)](pidFile);}catch{}return{'success':!![],'message':'Proxy\x20stopped\x20(pid\x20'+_0x3d10a2['pid']+')'};}function setClaudeCodeSettings(_0x3d62f9){const _0x59961f=a0_0x40fd32,_0x116d54=path[_0x59961f(0x180)](os[_0x59961f(0x16a)](),'.claude'),_0x55e60b=path['join'](_0x116d54,_0x59961f(0x174));try{if(!fs[_0x59961f(0x166)](_0x116d54))fs[_0x59961f(0x169)](_0x116d54,{'recursive':!![]});let _0xa3298b={};if(fs[_0x59961f(0x166)](_0x55e60b))try{_0xa3298b=JSON[_0x59961f(0x173)](fs[_0x59961f(0x113)](_0x55e60b,_0x59961f(0x136)));}catch{}if(!_0xa3298b[_0x59961f(0x123)])_0xa3298b[_0x59961f(0x123)]={};_0xa3298b[_0x59961f(0x123)][_0x59961f(0x121)]=_0x3d62f9,fs[_0x59961f(0x15e)](_0x55e60b,JSON[_0x59961f(0x12e)](_0xa3298b,null,0x2),_0x59961f(0x136));}catch{}}function a0_0x53cb(_0x209653,_0x2bd384){_0x209653=_0x209653-0x10d;const _0xd5a20f=a0_0xd5a2();let _0x53cb7d=_0xd5a20f[_0x209653];return _0x53cb7d;}function removeClaudeCodeSettings(){const _0x34006a=a0_0x40fd32,_0x4a0f6d=path[_0x34006a(0x180)](os['homedir'](),_0x34006a(0x190),_0x34006a(0x174));try{if(fs['existsSync'](_0x4a0f6d)){const _0x12d921=JSON[_0x34006a(0x173)](fs[_0x34006a(0x113)](_0x4a0f6d,_0x34006a(0x136)));if(_0x12d921[_0x34006a(0x123)]&&_0x12d921['env'][_0x34006a(0x121)]){delete _0x12d921[_0x34006a(0x123)]['ANTHROPIC_BASE_URL'];if(Object[_0x34006a(0x18d)](_0x12d921['env'])[_0x34006a(0x145)]===0x0)delete _0x12d921['env'];fs[_0x34006a(0x15e)](_0x4a0f6d,JSON[_0x34006a(0x12e)](_0x12d921,null,0x2),_0x34006a(0x136));}}}catch{}}const RUN_KEY='HKCU:\x5cSoftware\x5cMicrosoft\x5cWindows\x5cCurrentVersion\x5cRun',RUN_VALUE_NAME=a0_0x40fd32(0x11b),vbsLauncher=path['join'](baseDir,a0_0x40fd32(0x12b));function enableAutostart(){const _0x218a9e=a0_0x40fd32;ensureDir();const _0x5818ea=path['join'](__dirname,_0x218a9e(0x15b));if(process[_0x218a9e(0x15c)]==='win32'){try{const _0xaf1152=_0x218a9e(0x160)+'cmd\x20=\x20Chr(34)\x20&\x20\x22'+process[_0x218a9e(0x13f)]['replace'](/"/g,'\x22\x22')+_0x218a9e(0x159)+_0x5818ea['replace'](/"/g,'\x22\x22')+_0x218a9e(0x16b)+_0x218a9e(0x191);fs['writeFileSync'](vbsLauncher,_0xaf1152,_0x218a9e(0x136));const _0x1558f5='wscript.exe\x20\x22'+vbsLauncher+'\x22',_0x272a9f=_0x218a9e(0x151)+RUN_KEY+'\x27\x20-Force\x20|\x20Out-Null;\x20Set-ItemProperty\x20-Path\x20\x27'+RUN_KEY+'\x27\x20-Name\x20\x27'+RUN_VALUE_NAME+'\x27\x20-Value\x20\x27'+_0x1558f5[_0x218a9e(0x12c)](/'/g,'\x27\x27')+'\x27';(0x0,child_process_1[_0x218a9e(0x146)])(_0x218a9e(0x14a)+_0x272a9f['replace'](/"/g,'\x5c\x22')+'\x22',{'stdio':_0x218a9e(0x187),'timeout':0x1f40});}catch{}return;}if(process['platform']==='darwin'){try{const _0x2379f0=path[_0x218a9e(0x180)](os[_0x218a9e(0x16a)](),'Library',_0x218a9e(0x16d));if(!fs[_0x218a9e(0x166)](_0x2379f0))fs[_0x218a9e(0x169)](_0x2379f0,{'recursive':!![]});const _0x43095d=path[_0x218a9e(0x180)](_0x2379f0,_0x218a9e(0x139)),_0x20e491=_0x218a9e(0x11f)+_0x218a9e(0x137)+_0x218a9e(0x13e)+_0x218a9e(0x183)+'\x20\x20<key>ProgramArguments</key><array>'+('<string>'+process[_0x218a9e(0x13f)]+_0x218a9e(0x168)+_0x5818ea+_0x218a9e(0x18c))+_0x218a9e(0x16c)+_0x218a9e(0x17b)+_0x218a9e(0x154)+_0x218a9e(0x12a);fs[_0x218a9e(0x15e)](_0x43095d,_0x20e491,_0x218a9e(0x136));try{(0x0,child_process_1[_0x218a9e(0x146)])(_0x218a9e(0x184)+_0x43095d+'\x22',{'stdio':_0x218a9e(0x187),'timeout':0x1388});}catch{}(0x0,child_process_1[_0x218a9e(0x146)])(_0x218a9e(0x124)+_0x43095d+'\x22',{'stdio':_0x218a9e(0x187),'timeout':0x1388});}catch{}return;}try{const _0x153790=path['join'](os[_0x218a9e(0x16a)](),_0x218a9e(0x120),_0x218a9e(0x130));if(!fs[_0x218a9e(0x166)](_0x153790))fs[_0x218a9e(0x169)](_0x153790,{'recursive':!![]});const _0x16895c=path['join'](_0x153790,_0x218a9e(0x125)),_0x21615c=_0x218a9e(0x141)+_0x218a9e(0x157)+_0x218a9e(0x15a)+(_0x218a9e(0x150)+process['execPath']+'\x20'+_0x5818ea+_0x218a9e(0x11a))+'X-GNOME-Autostart-enabled=true\x0a'+_0x218a9e(0x114);fs['writeFileSync'](_0x16895c,_0x21615c,'utf8');}catch{}}function disableAutostart(){const _0x42c503=a0_0x40fd32;if(process[_0x42c503(0x15c)]===_0x42c503(0x129)){try{const _0x4dce71='Remove-ItemProperty\x20-Path\x20\x27'+RUN_KEY+_0x42c503(0x115)+RUN_VALUE_NAME+_0x42c503(0x177);(0x0,child_process_1[_0x42c503(0x146)])(_0x42c503(0x14a)+_0x4dce71[_0x42c503(0x12c)](/"/g,'\x5c\x22')+'\x22',{'stdio':_0x42c503(0x187),'timeout':0x1f40});}catch{}try{if(fs['existsSync'](vbsLauncher))fs[_0x42c503(0x15f)](vbsLauncher);}catch{}return;}if(process[_0x42c503(0x15c)]===_0x42c503(0x10e)){try{const _0x4ad579=path[_0x42c503(0x180)](os[_0x42c503(0x16a)](),_0x42c503(0x17f),_0x42c503(0x16d),_0x42c503(0x139));try{(0x0,child_process_1[_0x42c503(0x146)])(_0x42c503(0x184)+_0x4ad579+'\x22',{'stdio':_0x42c503(0x187),'timeout':0x1388});}catch{}if(fs[_0x42c503(0x166)](_0x4ad579))fs['unlinkSync'](_0x4ad579);}catch{}return;}try{const _0xda1b87=path[_0x42c503(0x180)](os[_0x42c503(0x16a)](),_0x42c503(0x120),_0x42c503(0x130),_0x42c503(0x125));if(fs['existsSync'](_0xda1b87))fs['unlinkSync'](_0xda1b87);}catch{}}function a0_0xd5a2(){const _0x53a020=['\x5c$&','Spawn\x20returned\x20no\x20PID','push','</string><string>proxy</string><string>start</string>','keys','export\x20GOOGLE_AI_BASE_URL=\x22','getOwnPropertyNames','.claude','WshShell.Run\x20cmd,\x200,\x20False\x0d\x0a','unref','\x22\x20/FO\x20CSV\x20/NH','proxy.port','darwin','writable','powershell','isProxyRunning','create','readFileSync','NoDisplay=true\x0a','\x27\x20-Name\x20\x27','REG\x20DELETE\x20\x22HKCU\x5cEnvironment\x22\x20/V\x20ANTHROPIC_BASE_URL\x20/F','--port','call','2005dsExCa','\x20proxy\x20install\x0a','TrimPromptProxy','#\x20TrimPrompt\x20API\x20Proxy','setx\x20GOOGLE_AI_BASE_URL\x20\x22','$env:GOOGLE_AI_BASE_URL\x20=\x20\x22','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a','.config','ANTHROPIC_BASE_URL','10TdaQky','env','launchctl\x20load\x20\x22','trimprompt-proxy.desktop','.zshrc',')\x20on\x20port\x20','/v1','win32','</dict></plist>\x0a','proxy-autostart.vbs','replace','default','stringify','235891SInSpP','autostart','4254ECbtJB','split','46909687PdXXPY','562mMWLoI','7475859vYeKQx','utf8','<!DOCTYPE\x20plist\x20PUBLIC\x20\x22-//Apple//DTD\x20PLIST\x201.0//EN\x22\x20\x22http://www.apple.com/DTDs/PropertyList-1.0.dtd\x22>\x0a','CLI\x20not\x20found\x20at\x20','ai.trimprompt.proxy.plist','setx\x20OPENAI_BASE_URL\x20\x22','path','message','pid','<plist\x20version=\x221.0\x22><dict>\x0a','execPath','setx\x20GEMINI_BASE_URL\x20\x22','[Desktop\x20Entry]\x0a','8984WCyNdl','defineProperty','6QFhZdU','length','execSync','7013587mCeIBV','__esModule','.*\x5cn?','powershell.exe\x20-NoProfile\x20-Command\x20\x22','proxy','hasOwnProperty','.*\x5cr?\x5cn?','removeAnthropicBaseUrl','SIGTERM','Exec=','New-Item\x20-Path\x20\x27','pwsh','__createBinding','\x20\x20<key>KeepAlive</key><true/>\x0a','enableAutostart','kill','Type=Application\x0a','child_process','\x22\x20&\x20Chr(34)\x20&\x20\x22\x20\x22\x20&\x20Chr(34)\x20&\x20\x22','Name=TrimPrompt\x20Proxy\x0a','cli.js','platform','pipe','writeFileSync','unlinkSync','Set\x20WshShell\x20=\x20CreateObject(\x22WScript.Shell\x22)\x0d\x0a','some','export\x20OPENAI_BASE_URL=\x22','stopProxyDaemon','export\x20ANTHROPIC_BASE_URL=\x22','startProxyDaemon','existsSync','get','</string><string>','mkdirSync','homedir','\x22\x20&\x20Chr(34)\x20&\x20\x22\x20proxy\x20install\x22\x0d\x0a','</array>\x0a','LaunchAgents','http://127.0.0.1:','taskkill\x20/PID\x20','.bashrc','trimEnd','configurable','parse','settings.json','\x20/F','export\x20GEMINI_BASE_URL=\x22','\x27\x20-ErrorAction\x20SilentlyContinue','5293904kaTGVy','setAnthropicBaseUrl','Failed\x20to\x20start\x20proxy:\x20','\x20\x20<key>RunAtLoad</key><true/>\x0a','running','setx\x20ANTHROPIC_BASE_URL\x20\x22','trim','Library','join','port','\x20-NoProfile\x20-Command\x20\x22$PROFILE\x22','\x20\x20<key>Label</key><string>ai.trimprompt.proxy</string>\x0a','launchctl\x20unload\x20\x22','getProxyPort','includes','ignore','disableAutostart'];a0_0xd5a2=function(){return _0x53a020;};return a0_0xd5a2();}function setAnthropicBaseUrl(_0x4ae722){const _0x3e1f3c=a0_0x40fd32,_0x42c281=_0x3e1f3c(0x16e)+_0x4ae722,_0x103399=_0x3e1f3c(0x16e)+_0x4ae722+_0x3e1f3c(0x128);setClaudeCodeSettings(_0x42c281);if(process[_0x3e1f3c(0x15c)]===_0x3e1f3c(0x129))try{(0x0,child_process_1['execSync'])(_0x3e1f3c(0x17d)+_0x42c281+'\x22',{'timeout':0x1388}),(0x0,child_process_1[_0x3e1f3c(0x146)])(_0x3e1f3c(0x13a)+_0x103399+'\x22',{'timeout':0x1388}),(0x0,child_process_1['execSync'])(_0x3e1f3c(0x140)+_0x103399+'\x22',{'timeout':0x1388}),(0x0,child_process_1['execSync'])(_0x3e1f3c(0x11d)+_0x103399+'\x22',{'timeout':0x1388});}catch{}const _0x559621=os[_0x3e1f3c(0x16a)](),_0x1d82d7=_0x3e1f3c(0x11c),_0x16a411=_0x3e1f3c(0x164)+_0x42c281+'\x22\x20'+_0x1d82d7,_0x53680d=_0x3e1f3c(0x162)+_0x103399+'\x22\x20'+_0x1d82d7,_0xcad98f=_0x3e1f3c(0x176)+_0x103399+'\x22\x20'+_0x1d82d7,_0x4d5481=_0x3e1f3c(0x18e)+_0x103399+'\x22\x20'+_0x1d82d7,_0x27457a=[path[_0x3e1f3c(0x180)](_0x559621,_0x3e1f3c(0x170)),path['join'](_0x559621,_0x3e1f3c(0x126)),path[_0x3e1f3c(0x180)](_0x559621,'.bash_profile')];for(const _0x1ccdf5 of _0x27457a){try{if(fs[_0x3e1f3c(0x166)](_0x1ccdf5)){let _0xc6bc4a=fs['readFileSync'](_0x1ccdf5,_0x3e1f3c(0x136));_0xc6bc4a['includes'](_0x1d82d7)&&(_0xc6bc4a=_0xc6bc4a[_0x3e1f3c(0x12c)](new RegExp('.*'+_0x1d82d7['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&')+_0x3e1f3c(0x149),'g'),'')),_0xc6bc4a=_0xc6bc4a[_0x3e1f3c(0x171)]()+'\x0a'+_0x16a411+'\x0a'+_0x53680d+'\x0a'+_0xcad98f+'\x0a'+_0x4d5481+'\x0a',fs['writeFileSync'](_0x1ccdf5,_0xc6bc4a,_0x3e1f3c(0x136));}}catch{}}try{const _0x49be8e=[];for(const _0x2e473d of[_0x3e1f3c(0x110),_0x3e1f3c(0x152)]){try{const _0x28b0c9=(0x0,child_process_1[_0x3e1f3c(0x146)])(_0x2e473d+'\x20-NoProfile\x20-Command\x20\x22$PROFILE\x22',{'encoding':'utf8','timeout':0xbb8,'stdio':[_0x3e1f3c(0x15d),_0x3e1f3c(0x15d),'ignore']})[_0x3e1f3c(0x17e)]();if(_0x28b0c9&&!_0x49be8e[_0x3e1f3c(0x186)](_0x28b0c9))_0x49be8e[_0x3e1f3c(0x18b)](_0x28b0c9);}catch{}}const _0x491146=_0x3e1f3c(0x11c),_0x87e6b3='$env:ANTHROPIC_BASE_URL\x20=\x20\x22'+_0x42c281+'\x22\x20'+_0x491146,_0x7dac4c='$env:OPENAI_BASE_URL\x20=\x20\x22'+_0x103399+'\x22\x20'+_0x491146,_0x1620e2='$env:GEMINI_BASE_URL\x20=\x20\x22'+_0x103399+'\x22\x20'+_0x491146,_0x138373=_0x3e1f3c(0x11e)+_0x103399+'\x22\x20'+_0x491146;for(const _0x47ace5 of _0x49be8e){try{const _0x456e8e=path['dirname'](_0x47ace5);if(!fs['existsSync'](_0x456e8e))fs[_0x3e1f3c(0x169)](_0x456e8e,{'recursive':!![]});let _0x5ef3b9=fs['existsSync'](_0x47ace5)?fs[_0x3e1f3c(0x113)](_0x47ace5,'utf8'):'';_0x5ef3b9[_0x3e1f3c(0x186)](_0x491146)&&(_0x5ef3b9=_0x5ef3b9[_0x3e1f3c(0x12c)](new RegExp('.*'+_0x491146[_0x3e1f3c(0x12c)](/[.*+?^${}()|[\]\\]/g,_0x3e1f3c(0x189))+'.*\x5cr?\x5cn?','g'),'')),_0x5ef3b9=_0x5ef3b9[_0x3e1f3c(0x171)]()+'\x0a'+_0x87e6b3+'\x0a'+_0x7dac4c+'\x0a'+_0x1620e2+'\x0a'+_0x138373+'\x0a',fs['writeFileSync'](_0x47ace5,_0x5ef3b9,_0x3e1f3c(0x136));}catch{}}}catch{}}function removeAnthropicBaseUrl(){const _0x1c1bcc=a0_0x40fd32;removeClaudeCodeSettings();if(process[_0x1c1bcc(0x15c)]===_0x1c1bcc(0x129))try{(0x0,child_process_1[_0x1c1bcc(0x146)])(_0x1c1bcc(0x116),{'timeout':0x1388});}catch{}const _0x3e793d=os[_0x1c1bcc(0x16a)](),_0x2c3955=_0x1c1bcc(0x11c),_0x307695=[path['join'](_0x3e793d,_0x1c1bcc(0x170)),path[_0x1c1bcc(0x180)](_0x3e793d,_0x1c1bcc(0x126)),path[_0x1c1bcc(0x180)](_0x3e793d,'.bash_profile')];for(const _0xdd9aaa of _0x307695){try{if(fs[_0x1c1bcc(0x166)](_0xdd9aaa)){let _0x2ef245=fs[_0x1c1bcc(0x113)](_0xdd9aaa,'utf8');_0x2ef245[_0x1c1bcc(0x186)](_0x2c3955)&&(_0x2ef245=_0x2ef245[_0x1c1bcc(0x12c)](new RegExp('.*'+_0x2c3955[_0x1c1bcc(0x12c)](/[.*+?^${}()|[\]\\]/g,_0x1c1bcc(0x189))+_0x1c1bcc(0x14d),'g'),''),fs[_0x1c1bcc(0x15e)](_0xdd9aaa,_0x2ef245,_0x1c1bcc(0x136)));}}catch{}}try{for(const _0x3497e2 of['powershell',_0x1c1bcc(0x152)]){try{const _0x2f445a=(0x0,child_process_1['execSync'])(_0x3497e2+_0x1c1bcc(0x182),{'encoding':_0x1c1bcc(0x136),'timeout':0xbb8,'stdio':['pipe',_0x1c1bcc(0x15d),_0x1c1bcc(0x187)]})['trim']();if(_0x2f445a&&fs[_0x1c1bcc(0x166)](_0x2f445a)){let _0x20b17e=fs['readFileSync'](_0x2f445a,_0x1c1bcc(0x136));const _0x4b7e80=_0x1c1bcc(0x11c);_0x20b17e[_0x1c1bcc(0x186)](_0x4b7e80)&&(_0x20b17e=_0x20b17e[_0x1c1bcc(0x12c)](new RegExp('.*'+_0x4b7e80[_0x1c1bcc(0x12c)](/[.*+?^${}()|[\]\\]/g,'\x5c$&')+_0x1c1bcc(0x14d),'g'),''),fs['writeFileSync'](_0x2f445a,_0x20b17e,_0x1c1bcc(0x136)));}}catch{}}}catch{}}
|
package/proxy-resp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';function a0_0x5712(_0x44ba64,_0x2d49d){_0x44ba64=_0x44ba64-0x19c;const _0x1b3d48=a0_0x1b3d();let _0x5712be=_0x1b3d48[_0x44ba64];return _0x5712be;}const a0_0x4977c5=a0_0x5712;(function(_0x262040,_0x4e5b6a){const _0x544a01=a0_0x5712,_0x1be68b=_0x262040();while(!![]){try{const _0x114699=-parseInt(_0x544a01(0x1ac))/0x1+parseInt(_0x544a01(0x1b0))/0x2*(-parseInt(_0x544a01(0x1af))/0x3)+parseInt(_0x544a01(0x19e))/0x4+-parseInt(_0x544a01(0x1b3))/0x5+parseInt(_0x544a01(0x1a2))/0x6*(parseInt(_0x544a01(0x1a6))/0x7)+parseInt(_0x544a01(0x1a9))/0x8*(-parseInt(_0x544a01(0x1a3))/0x9)+-parseInt(_0x544a01(0x1b1))/0xa*(-parseInt(_0x544a01(0x1ad))/0xb);if(_0x114699===_0x4e5b6a)break;else _0x1be68b['push'](_0x1be68b['shift']());}catch(_0x354ebe){_0x1be68b['push'](_0x1be68b['shift']());}}}(a0_0x1b3d,0xc0881));function a0_0x1b3d(){const _0x1926da=['test','512TIzolc','user','text','1401293BpzBFk','15579729icYNKR','optimizeMaxTokens','1609548VjrCYf','2WdRIfD','10EGZtRc','some','611440dqhrDP','split','__esModule','simple','filter','map','5763148pabgMz','length','role','defineProperty','12QnCxxf','172098nLZdCI','string','type','4253858yOtLVP','join'];a0_0x1b3d=function(){return _0x1926da;};return a0_0x1b3d();}Object[a0_0x4977c5(0x1a1)](exports,a0_0x4977c5(0x1b5),{'value':!![]}),exports[a0_0x4977c5(0x1ae)]=optimizeMaxTokens;function lastUserText(_0x1bf8b7){const _0x48c316=a0_0x4977c5;for(let _0x2bd645=_0x1bf8b7[_0x48c316(0x19f)]-0x1;_0x2bd645>=0x0;_0x2bd645--){if(_0x1bf8b7[_0x2bd645][_0x48c316(0x1a0)]===_0x48c316(0x1aa)){const _0x1a6bd5=_0x1bf8b7[_0x2bd645]['content'];if(typeof _0x1a6bd5===_0x48c316(0x1a4))return _0x1a6bd5;if(Array['isArray'](_0x1a6bd5))return _0x1a6bd5[_0x48c316(0x19c)](_0x23adad=>_0x23adad[_0x48c316(0x1a5)]===_0x48c316(0x1ab)&&_0x23adad['text'])[_0x48c316(0x19d)](_0x38c394=>_0x38c394['text'])[_0x48c316(0x1a7)]('\x0a');}}return'';}function classifyComplexity(_0x13b2ce){const _0x4af025=a0_0x4977c5,_0x33f689=_0x13b2ce['toLowerCase'](),_0x53c4aa=_0x33f689[_0x4af025(0x1b4)](/\s+/)[_0x4af025(0x19f)],_0x1d1d6e=[/^(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(_0x53c4aa<0x14&&_0x1d1d6e[_0x4af025(0x1b2)](_0x108ab6=>_0x108ab6[_0x4af025(0x1a8)](_0x33f689)))return _0x4af025(0x1b6);const _0x42d342=[/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(_0x53c4aa>0x50||_0x42d342[_0x4af025(0x1b2)](_0x149495=>_0x149495[_0x4af025(0x1a8)](_0x33f689)))return'complex';return'medium';}const MAX_TOKENS_MAP={'simple':0x800,'medium':0x1000,'complex':0x2000};function optimizeMaxTokens(_0xeba3fc,_0x25872b){if(!_0xeba3fc||_0xeba3fc['length']===0x0)return null;const _0x5b573c=lastUserText(_0xeba3fc);if(!_0x5b573c)return null;const _0x3f7732=classifyComplexity(_0x5b573c),_0x36e4e8=MAX_TOKENS_MAP[_0x3f7732];if(_0x25872b&&_0x25872b<=_0x36e4e8)return null;return{'max_tokens':_0x36e4e8,'complexity':_0x3f7732};}
|
package/redactor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';function a0_0xa253(){const _0x5beaf5=['private_key','13564914bZBGEJ','\x22private_key\x22:\x20\x22[REDACTED_GCP_PRIVATE_KEY]\x22','regex','includes','[REDACTED_JWT]','aws_key','redactor','ip_address','basic_auth','Database\x20Connection\x20String','sendgrid_key','[REDACTED_STRIPE_KEY]','email','Slack\x20Token','$1=[REDACTED_CREDENTIAL]','text','GCP\x20Service\x20Account\x20Key','446048GWHDeG','azure_conn','github_token','513438AnKeGf','30SehkQB','length','[REDACTED_GITHUB_TOKEN]','slack_token','AWS\x20Access\x20Key','Basic\x20Auth','Generic\x20API\x20Key/Secret/Password','defineProperty','loadDefaultRules','Basic\x20[REDACTED_AUTH]','stripe_key','214254PhVDcv','openai_key','[REDACTED_TWILIO_KEY]','[REDACTED_PRIVATE_KEY]','aws_secret','939164ACbOPs','anthropic_key','[REDACTED_AZURE_CONNECTION]','425354hkYnfh','335781ZWVRbL','GitHub\x20Token','OpenAI\x20API\x20Key','Bearer\x20Token','$1=[REDACTED_AWS_SECRET]','Anthropic\x20API\x20Key','twilio_key','type','bearer','Twilio\x20Key','replacement','12daxSAh','[REDACTED_SENDGRID_KEY]','generic_credential','db_connection','70YjTBYw','Bearer\x20[REDACTED_TOKEN]','SendGrid\x20Key','match','redact','Email\x20Address','1SYpMFj','Azure\x20Connection\x20String','[REDACTED_OPENAI_KEY]','Redactor','[REDACTED_SLACK_TOKEN]','[REDACTED_AWS_KEY]','7cnCFOI','rules'];a0_0xa253=function(){return _0x5beaf5;};return a0_0xa253();}const a0_0x5b3783=a0_0x1a24;(function(_0x48310d,_0x397020){const _0x101d14=a0_0x1a24,_0x49035a=_0x48310d();while(!![]){try{const _0x39ab7d=-parseInt(_0x101d14(0xe4))/0x1*(parseInt(_0x101d14(0x115))/0x2)+-parseInt(_0x101d14(0x101))/0x3+-parseInt(_0x101d14(0x112))/0x4+parseInt(_0x101d14(0x102))/0x5*(-parseInt(_0x101d14(0x10d))/0x6)+parseInt(_0x101d14(0xea))/0x7*(parseInt(_0x101d14(0xfe))/0x8)+parseInt(_0x101d14(0x116))/0x9*(-parseInt(_0x101d14(0xde))/0xa)+parseInt(_0x101d14(0xed))/0xb*(parseInt(_0x101d14(0xda))/0xc);if(_0x39ab7d===_0x397020)break;else _0x49035a['push'](_0x49035a['shift']());}catch(_0x38a35f){_0x49035a['push'](_0x49035a['shift']());}}}(a0_0xa253,0x2f953));Object[a0_0x5b3783(0x109)](exports,'__esModule',{'value':!![]}),exports['redactor']=exports[a0_0x5b3783(0xe7)]=void 0x0;function a0_0x1a24(_0x12fdef,_0x1bd5df){_0x12fdef=_0x12fdef-0xd9;const _0xa253bd=a0_0xa253();let _0x1a24e9=_0xa253bd[_0x12fdef];return _0x1a24e9;}class Redactor{['rules']=[];constructor(){const _0x51422c=a0_0x5b3783;this[_0x51422c(0x10a)]();}['loadDefaultRules'](){const _0x382f31=a0_0x5b3783;this[_0x382f31(0xeb)]=[{'name':_0x382f31(0x106),'type':_0x382f31(0xf2),'regex':/\b(AKIA[0-9A-Z]{16})\b/g,'replacement':_0x382f31(0xe9)},{'name':'AWS\x20Secret\x20Key','type':_0x382f31(0x111),'regex':/(aws_secret_access_key|AWS_SECRET_ACCESS_KEY)[\s:=]+[A-Za-z0-9/+=]{30,}/gi,'replacement':_0x382f31(0x11a)},{'name':_0x382f31(0xfd),'type':'gcp_key','regex':/"private_key"\s*:\s*"-----BEGIN[^"]+-----END[^"]*"/g,'replacement':_0x382f31(0xee)},{'name':_0x382f31(0xe5),'type':_0x382f31(0xff),'regex':/DefaultEndpointsProtocol=https?;AccountName=[^;]+;AccountKey=[^;]+;?[^\s]*/gi,'replacement':_0x382f31(0x114)},{'name':_0x382f31(0x11b),'type':_0x382f31(0x113),'regex':/\bsk-ant-api\d{2}-[A-Za-z0-9_-]{20,}\b/g,'replacement':'[REDACTED_ANTHROPIC_KEY]'},{'name':_0x382f31(0x118),'type':_0x382f31(0x10e),'regex':/\b(sk-proj-[A-Za-z0-9_-]{20,}|sk-[A-Za-z0-9]{32,})\b/g,'replacement':_0x382f31(0xe6)},{'name':_0x382f31(0x117),'type':_0x382f31(0x100),'regex':/\b(ghp_[A-Za-z0-9]{20,}|gho_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{22,})\b/g,'replacement':_0x382f31(0x104)},{'name':_0x382f31(0xfa),'type':_0x382f31(0x105),'regex':/\b(xoxb-[0-9A-Za-z-]+|xoxp-[0-9A-Za-z-]+|xapp-[0-9A-Za-z-]+)\b/g,'replacement':_0x382f31(0xe8)},{'name':'Stripe\x20Key','type':_0x382f31(0x10c),'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':_0x382f31(0xf8)},{'name':_0x382f31(0x11f),'type':_0x382f31(0x11c),'regex':/\bSK[0-9a-f]{32}\b/g,'replacement':_0x382f31(0x10f)},{'name':_0x382f31(0xe0),'type':_0x382f31(0xf7),'regex':/\bSG\.[A-Za-z0-9_-]{22,}\.[A-Za-z0-9_-]{22,}\b/g,'replacement':_0x382f31(0xdb)},{'name':'Private\x20Key\x20Block','type':_0x382f31(0xec),'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':_0x382f31(0x110)},{'name':'JWT\x20Token','type':'jwt','regex':/\beyJ[A-Za-z0-9_-]{10,}\.eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g,'replacement':_0x382f31(0xf1)},{'name':_0x382f31(0x119),'type':_0x382f31(0x11e),'regex':/Bearer\s+[A-Za-z0-9_\-.]{20,}/gi,'replacement':_0x382f31(0xdf)},{'name':_0x382f31(0x107),'type':_0x382f31(0xf5),'regex':/Basic\s+[A-Za-z0-9+/=]{10,}/gi,'replacement':_0x382f31(0x10b)},{'name':_0x382f31(0xf6),'type':_0x382f31(0xdd),'regex':/(mongodb(\+srv)?|postgres|postgresql|mysql|redis|amqp|sqlite):\/\/[A-Za-z0-9_]+:[^@\s\n]+@[^\s\n]+/gi,'replacement':'[REDACTED_DB_CONNECTION]'},{'name':_0x382f31(0x108),'type':_0x382f31(0xdc),'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':_0x382f31(0xfb)},{'name':'IPv4\x20Address\x20(non-local)','type':_0x382f31(0xf4),'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':'[REDACTED_IP]','alert':![]},{'name':_0x382f31(0xe3),'type':_0x382f31(0xf9),'regex':/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,'replacement':'[REDACTED_EMAIL]','alert':![]}];}[a0_0x5b3783(0xe2)](_0x405290){const _0x100349=a0_0x5b3783;return this['redactWithAudit'](_0x405290)[_0x100349(0xfc)];}['redactWithAudit'](_0x15d530){const _0x465107=a0_0x5b3783;let _0x254571=_0x15d530,_0x57c385=0x0;const _0x1668aa=[];for(const _0x4232dc of this[_0x465107(0xeb)]){const _0xac771=_0x254571[_0x465107(0xe1)](_0x4232dc['regex']);_0xac771&&_0xac771[_0x465107(0x103)]>0x0&&(_0x4232dc['alert']!==![]&&(_0x57c385+=_0xac771[_0x465107(0x103)],!_0x1668aa[_0x465107(0xf0)](_0x4232dc[_0x465107(0x11d)])&&_0x1668aa['push'](_0x4232dc[_0x465107(0x11d)])),_0x254571=_0x254571['replace'](_0x4232dc[_0x465107(0xef)],_0x4232dc[_0x465107(0xd9)]));}return{'text':_0x254571,'secretsFound':_0x57c385,'secretTypes':_0x1668aa};}}exports[a0_0x5b3783(0xe7)]=Redactor,exports[a0_0x5b3783(0xf3)]=new Redactor();
|
package/seed.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';const a0_0x556acc=a0_0x1630;function a0_0x1630(_0x52d481,_0x26749a){_0x52d481=_0x52d481-0x1ee;const _0x22b694=a0_0x22b6();let _0x163062=_0x22b694[_0x52d481];return _0x163062;}(function(_0x1fa584,_0x294e9d){const _0x3a2005=a0_0x1630,_0x135e84=_0x1fa584();while(!![]){try{const _0xec5dbf=parseInt(_0x3a2005(0x1fa))/0x1+parseInt(_0x3a2005(0x1f4))/0x2*(-parseInt(_0x3a2005(0x205))/0x3)+-parseInt(_0x3a2005(0x207))/0x4+parseInt(_0x3a2005(0x20b))/0x5*(parseInt(_0x3a2005(0x1fc))/0x6)+-parseInt(_0x3a2005(0x1fb))/0x7*(-parseInt(_0x3a2005(0x1f3))/0x8)+parseInt(_0x3a2005(0x20f))/0x9*(-parseInt(_0x3a2005(0x20d))/0xa)+parseInt(_0x3a2005(0x1ee))/0xb;if(_0xec5dbf===_0x294e9d)break;else _0x135e84['push'](_0x135e84['shift']());}catch(_0xf060fe){_0x135e84['push'](_0x135e84['shift']());}}}(a0_0x22b6,0x8200f));Object[a0_0x556acc(0x210)](exports,a0_0x556acc(0x1f6),{'value':!![]});const tracker_1=require(a0_0x556acc(0x1fd));function a0_0x22b6(){const _0x10bb80=['Successfully\x20built\x20image.','13528BrWIqN','2rAacuN','test_db.py\x20PASS\x0a','__esModule','docker\x20build\x20.','[INFO]\x20Building\x20modules...\x0a','tracker','185430KhGXPQ','4291RWEwWx','842862FDsxtm','./tracker','repeat','claude-3-opus','logExecution','added\x201420\x20packages\x20in\x2014s\x0a','Seeding\x20TrimPrompt\x20database\x20with\x20mock\x20LLM\x20command\x20telemetry...','test_auth.py\x20PASS\x0a','[SUCCESS]\x20Compiled\x20512\x20modules.\x0a','897459jHXMnu','Test\x20suite\x20run\x20starting...\x0a','2611992nXKFKn','Sending\x20build\x20context\x20to\x20Docker\x20daemon...\x0a','All\x20303\x20tests\x20passed\x20in\x204.22s.','pytest\x20tests/app','30plTIpN','gpt-4o','20VmchyJ','Database\x20successfully\x20seeded!','3972762WYDWyy','defineProperty','3328677rjKQOQ','Optimizing\x20assets...\x0a','[INFO]\x20Building\x20modules...\x0a[SUCCESS]\x20Compiled\x20512\x20modules.\x20(repeated\x20400\x20times)','Step\x202/10\x20:\x20COPY\x20package.json\x20.\x0a'];a0_0x22b6=function(){return _0x10bb80;};return a0_0x22b6();}console['log'](a0_0x556acc(0x202)),process.env.TRIMPROMPT_MODEL=a0_0x556acc(0x1ff),tracker_1[a0_0x556acc(0x1f9)]['logExecution']('npm\x20run\x20build','Compilation\x20Output:\x0a'+a0_0x556acc(0x1f8)+a0_0x556acc(0x1ef)+a0_0x556acc(0x204)['repeat'](0x190),a0_0x556acc(0x1f0),0x0),process.env.TRIMPROMPT_MODEL=a0_0x556acc(0x20c),tracker_1[a0_0x556acc(0x1f9)]['logExecution'](a0_0x556acc(0x20a),a0_0x556acc(0x206)+a0_0x556acc(0x203)+a0_0x556acc(0x1f5)+'test_api.py\x20PASS\x0a'['repeat'](0x12c)+a0_0x556acc(0x209),'pytest\x20app:\x20303\x20tests\x20passed\x20in\x204.22s.',0x0),process.env.TRIMPROMPT_MODEL='gemini-1-5-pro',tracker_1[a0_0x556acc(0x1f9)][a0_0x556acc(0x200)](a0_0x556acc(0x1f7),a0_0x556acc(0x208)+'Step\x201/10\x20:\x20FROM\x20node:20\x0a'+a0_0x556acc(0x1f1)+'Step\x203/10\x20:\x20RUN\x20npm\x20install\x0a'+a0_0x556acc(0x201)[a0_0x556acc(0x1fe)](0x3)+a0_0x556acc(0x1f2),'docker\x20build:\x201420\x20packages\x20added.\x20Successfully\x20built\x20image.',0x0),console['log'](a0_0x556acc(0x20e));
|
package/shims.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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)]};}}
|
|
1
|
+
'use strict';const a0_0x3c886e=a0_0x33d6;(function(_0x585440,_0x2619e0){const _0x5772bc=a0_0x33d6,_0x4b06ec=_0x585440();while(!![]){try{const _0x2b514e=parseInt(_0x5772bc(0x7b))/0x1*(-parseInt(_0x5772bc(0xde))/0x2)+-parseInt(_0x5772bc(0xb2))/0x3+-parseInt(_0x5772bc(0xa0))/0x4+-parseInt(_0x5772bc(0x90))/0x5*(-parseInt(_0x5772bc(0x6f))/0x6)+-parseInt(_0x5772bc(0xa4))/0x7+-parseInt(_0x5772bc(0xe2))/0x8*(parseInt(_0x5772bc(0xeb))/0x9)+parseInt(_0x5772bc(0xaf))/0xa;if(_0x2b514e===_0x2619e0)break;else _0x4b06ec['push'](_0x4b06ec['shift']());}catch(_0x232fa1){_0x4b06ec['push'](_0x4b06ec['shift']());}}}(a0_0x2e01,0xe213b));var __createBinding=this&&this[a0_0x3c886e(0xe1)]||(Object[a0_0x3c886e(0x9b)]?function(_0x27a04b,_0x3ce690,_0x4b2c93,_0xead2cf){const _0x4ce157=a0_0x3c886e;if(_0xead2cf===undefined)_0xead2cf=_0x4b2c93;var _0x30ef03=Object[_0x4ce157(0xbd)](_0x3ce690,_0x4b2c93);(!_0x30ef03||('get'in _0x30ef03?!_0x3ce690['__esModule']:_0x30ef03[_0x4ce157(0x9d)]||_0x30ef03['configurable']))&&(_0x30ef03={'enumerable':!![],'get':function(){return _0x3ce690[_0x4b2c93];}}),Object['defineProperty'](_0x27a04b,_0xead2cf,_0x30ef03);}:function(_0x337f9f,_0x3b43d5,_0x3c848c,_0x34b6b6){if(_0x34b6b6===undefined)_0x34b6b6=_0x3c848c;_0x337f9f[_0x34b6b6]=_0x3b43d5[_0x3c848c];}),__setModuleDefault=this&&this[a0_0x3c886e(0x86)]||(Object[a0_0x3c886e(0x9b)]?function(_0x2696aa,_0x5b4a34){const _0x1fa77d=a0_0x3c886e;Object[_0x1fa77d(0xd5)](_0x2696aa,'default',{'enumerable':!![],'value':_0x5b4a34});}:function(_0x1996ec,_0x1416c4){const _0x2b13eb=a0_0x3c886e;_0x1996ec[_0x2b13eb(0x7e)]=_0x1416c4;}),__importStar=this&&this[a0_0x3c886e(0xc2)]||(function(){var _0x12988c=function(_0x316682){const _0x3e419c=a0_0x33d6;return _0x12988c=Object[_0x3e419c(0xdf)]||function(_0x3c2418){const _0x4f78ff=_0x3e419c;var _0x3b1728=[];for(var _0x436157 in _0x3c2418)if(Object[_0x4f78ff(0xea)][_0x4f78ff(0x79)][_0x4f78ff(0x8b)](_0x3c2418,_0x436157))_0x3b1728[_0x3b1728[_0x4f78ff(0x94)]]=_0x436157;return _0x3b1728;},_0x12988c(_0x316682);};return function(_0x3bc3f6){const _0x5979fd=a0_0x33d6;if(_0x3bc3f6&&_0x3bc3f6[_0x5979fd(0xdd)])return _0x3bc3f6;var _0x13831f={};if(_0x3bc3f6!=null){for(var _0x22480b=_0x12988c(_0x3bc3f6),_0x2d0b73=0x0;_0x2d0b73<_0x22480b[_0x5979fd(0x94)];_0x2d0b73++)if(_0x22480b[_0x2d0b73]!==_0x5979fd(0x7e))__createBinding(_0x13831f,_0x3bc3f6,_0x22480b[_0x2d0b73]);}return __setModuleDefault(_0x13831f,_0x3bc3f6),_0x13831f;};}());Object[a0_0x3c886e(0xd5)](exports,a0_0x3c886e(0xdd),{'value':!![]}),exports[a0_0x3c886e(0x71)]=installShims,exports[a0_0x3c886e(0x7a)]=uninstallShims;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x3c886e(0xcc))),os=__importStar(require('os')),SHIMMED_COMMANDS=['ls','tree',a0_0x3c886e(0x70),a0_0x3c886e(0xe9),a0_0x3c886e(0xa8),'rg','ruff','git','gh',a0_0x3c886e(0xe7),a0_0x3c886e(0xa1),a0_0x3c886e(0xb0),'pnpm',a0_0x3c886e(0xc1),'yarn','kubectl',a0_0x3c886e(0x99),a0_0x3c886e(0x92),a0_0x3c886e(0xe8),a0_0x3c886e(0xad),'go',a0_0x3c886e(0xdb)],PROFILE_MARKER='TrimPrompt\x20Shims\x20PATH';function getExecSync(){const _0x385145=a0_0x3c886e;return require('child_process')[_0x385145(0xd6)];}function getExecFileSync(){const _0x10181f=a0_0x3c886e;return require(_0x10181f(0x9e))[_0x10181f(0xe3)];}function ensureProfileContains(_0x3094ea,_0x883947,_0x18880e){const _0x338e09=a0_0x3c886e;try{const _0x478213=path[_0x338e09(0xa2)](_0x3094ea);!fs[_0x338e09(0xcd)](_0x478213)&&fs[_0x338e09(0xa6)](_0x478213,{'recursive':!![]});if(fs['existsSync'](_0x3094ea)){const _0x40fb55=fs[_0x338e09(0xab)](_0x3094ea,_0x338e09(0x77));if(_0x40fb55[_0x338e09(0xc6)](_0x883947))return;fs[_0x338e09(0xc8)](_0x3094ea,_0x18880e,_0x338e09(0x77));}else fs[_0x338e09(0x84)](_0x3094ea,_0x18880e,_0x338e09(0x77));}catch{}}function removeProfileBlock(_0x130307,_0x16c88c){const _0x5976d6=a0_0x3c886e;try{if(!fs[_0x5976d6(0xcd)](_0x130307))return;const _0x9c0a07=fs[_0x5976d6(0xab)](_0x130307,'utf8');if(!_0x9c0a07[_0x5976d6(0xc6)](_0x16c88c))return;const _0x1a6f8c=_0x9c0a07[_0x5976d6(0x8c)]('\x0a'),_0x6fc57a=[];let _0x3a0f04=![];for(let _0x39a4c8=0x0;_0x39a4c8<_0x1a6f8c[_0x5976d6(0x94)];_0x39a4c8++){if(_0x1a6f8c[_0x39a4c8][_0x5976d6(0xc6)](_0x16c88c)){_0x3a0f04=!![];continue;}if(_0x3a0f04){_0x3a0f04=![];continue;}_0x6fc57a[_0x5976d6(0xd0)](_0x1a6f8c[_0x39a4c8]);}const _0x21b166=_0x6fc57a[_0x5976d6(0xb1)]('\x0a')[_0x5976d6(0xcb)](/\n{3,}/g,'\x0a\x0a');fs[_0x5976d6(0x84)](_0x130307,_0x21b166,_0x5976d6(0x77));}catch{}}function a0_0x33d6(_0x35d5c1,_0x105eb9){_0x35d5c1=_0x35d5c1-0x6d;const _0x2e01f1=a0_0x2e01();let _0x33d63a=_0x2e01f1[_0x35d5c1];return _0x33d63a;}function a0_0x2e01(){const _0x58da6a=['__setModuleDefault','filter','\x20\x20\x20\x20\x20\x20for\x20the\x20installation\x20to\x20take\x20effect.','.trimprompt','message','call','split','-NoProfile','readdirSync','try\x20{\x20(Get-ItemProperty\x20-Path\x20\x27','1476725QBSPMO','[Environment]::GetEnvironmentVariable(\x27PATH\x27,\x20\x27User\x27)','pytest','Please\x20add\x20the\x20following\x20path\x20to\x20the\x20front\x20of\x20your\x20User\x20PATH\x20environment\x20variable\x20manually:\x0a\x20\x20','length','\x0aexport\x20PATH=\x22',')\x20else\x20(','\x20\x20set\x20\x22PATH=%PATH:','\x22\x20set\x20\x22PATH=','docker','toLowerCase','create','homedir','writable','child_process','win32','4638944NfDKDS','cargo','dirname',':$PATH\x22','12380655qxhkUX','trim.cmd','mkdirSync','\x20\x20\x20\x20\x20\x20[IMPORTANT]\x20TrimPrompt\x20successfully\x20installed!','grep','\x20-NoProfile\x20-Command\x20\x22','-Command','readFileSync','powershell','pip3','$PROFILE.CurrentUserAllHosts','57713150gmErME','npm','join','1140708AynxvN','HKCU:\x5cSoftware\x5cMicrosoft\x5cCommand\x20Processor','\x20@args\x20}\x20else\x20{\x20&\x20','\x0a#\x20','pipe','shims','rmdirSync','platform','.cmd','chmodSync','.bashrc','getOwnPropertyDescriptor','$PROFILE.CurrentUserCurrentHost','powershell.exe','Please\x20add\x20this\x20to\x20your\x20shell\x20profile\x20(~/.bashrc,\x20~/.zshrc)\x20manually:\x0a\x20\x20export\x20PATH=\x22','npx','__importStar','$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);','#!/bin/sh\x0aif\x20command\x20-v\x20trim\x20>/dev/null\x202>&1;\x20then\x20exec\x20trim\x20',':||g\x22);\x20exec\x20env\x20PATH=\x22$CLEAN_PATH\x22\x20','includes','trim','appendFileSync','unlinkSync','TrimPrompt\x20successfully\x20installed\x20for\x20','replace','path','existsSync','755','\x20@args\x20}\x0a','push','export\x20PATH=\x22','Remove-ItemProperty\x20-Path\x20\x27','.ps1','New-Item\x20-Path\x20\x27','defineProperty','execSync','\x20commands.\x0a\x0a[WARNING]\x20Could\x20not\x20automatically\x20update\x20your\x20system\x20PATH.\x20','\x27\x20-Name\x20AutoRun\x20-ErrorAction\x20SilentlyContinue','powershell\x20-NoProfile\x20-Command\x20\x22','\x20\x22$@\x22;\x20fi\x0a','find','\x27\x20-Name\x20AutoRun\x20-Value\x20\x27','__esModule','2721146XGKLGB','getOwnPropertyNames','map','__createBinding','8jMGYbe','execFileSync','ignore','if\x20exist\x20\x22%~dp0..\x5c..\x5cAppData\x5cRoaming\x5cnpm\x5ctrim.cmd\x22','\x20&\x20','glab','pip','read','prototype','4242951hlCRfq','Failed\x20to\x20install\x20shims:\x20','Failed\x20to\x20uninstall\x20shims:\x20',';%PATH%\x22','6FXjriN','cat','installShims','Set-ItemProperty\x20-Path\x20\x27','\x27\x20-Force\x20|\x20Out-Null;\x20Set-ItemProperty\x20-Path\x20\x27','.zshrc',':$PATH\x22\x0a',';=%\x22','utf8','TrimPrompt\x20shims\x20fully\x20uninstalled.\x20All\x20PATH\x20modifications,\x20shell\x20profiles,\x20and\x20registry\x20entries\x20have\x20been\x20cleaned\x20up.','hasOwnProperty','uninstallShims','1deNElr','\x20\x20\x20👉\x20Please\x20restart\x20your\x20terminal\x20window\x20or\x20AI\x20editor\x20(Cursor/Claude)','\x27,\x20\x27User\x27)','default','.profile','some','@echo\x20off','================================================================================','.bash_profile','writeFileSync','\x20%*'];a0_0x2e01=function(){return _0x58da6a;};return a0_0x2e01();}function collectPowerShellProfiles(){const _0x51cf52=a0_0x3c886e,_0xc437f2=getExecSync(),_0x4608e7=[],_0x35cb0b=[[_0x51cf52(0xac),_0x51cf52(0xbe)],[_0x51cf52(0xac),_0x51cf52(0xae)]];try{_0xc437f2('pwsh\x20-NoProfile\x20-Command\x20\x22exit\x200\x22',{'stdio':_0x51cf52(0xe4)}),_0x35cb0b[_0x51cf52(0xd0)](['pwsh',_0x51cf52(0xae)]);}catch{}for(const [_0x58d9b4,_0x3958d6]of _0x35cb0b){try{const _0x182a23=_0xc437f2(_0x58d9b4+_0x51cf52(0xa9)+_0x3958d6+'\x22',{'encoding':'utf8'})[_0x51cf52(0xc7)]();_0x182a23&&!_0x4608e7[_0x51cf52(0x80)](_0xcdff02=>_0xcdff02['toLowerCase']()===_0x182a23[_0x51cf52(0x9a)]())&&_0x4608e7[_0x51cf52(0xd0)](_0x182a23);}catch{}}return _0x4608e7;}function getBashProfilesWindows(){const _0x4cac8b=a0_0x3c886e,_0xfe75c0=os[_0x4cac8b(0x9c)]();return[_0x4cac8b(0xbc),'.bash_profile'][_0x4cac8b(0xe0)](_0x725e8a=>path[_0x4cac8b(0xb1)](_0xfe75c0,_0x725e8a));}function getBroadcastCommand(){const _0x4f002c=a0_0x3c886e;return _0x4f002c(0xc3);}function installShims(){const _0x38ebe2=a0_0x3c886e,_0x414a59=path[_0x38ebe2(0xb1)](os[_0x38ebe2(0x9c)](),_0x38ebe2(0x89),'shims');try{!fs[_0x38ebe2(0xcd)](_0x414a59)&&fs['mkdirSync'](_0x414a59,{'recursive':!![]});const _0x3719e6=os['platform']()===_0x38ebe2(0x9f);for(const _0x4283f1 of SHIMMED_COMMANDS){if(_0x3719e6){const _0x4658e6=path['join'](_0x414a59,_0x4283f1+_0x38ebe2(0xba)),_0x4ee3f8=process.env.APPDATA?path[_0x38ebe2(0xb1)](process.env.APPDATA,_0x38ebe2(0xb0)):'',_0x4be3b2=_0x4ee3f8?'if\x20exist\x20\x22'+path['join'](_0x4ee3f8,_0x38ebe2(0xa5))+'\x22':_0x38ebe2(0xe5),_0x30f26c=[_0x38ebe2(0x81),_0x4be3b2+'\x20(','\x20\x20trim\x20'+_0x4283f1+_0x38ebe2(0x85),_0x38ebe2(0x96),_0x38ebe2(0x97)+_0x414a59+_0x38ebe2(0x76),'\x20\x20'+_0x4283f1+_0x38ebe2(0x85),')'][_0x38ebe2(0xb1)]('\x0d\x0a')+'\x0d\x0a';fs[_0x38ebe2(0x84)](_0x4658e6,_0x30f26c,_0x38ebe2(0x77));const _0x3a9b05=path[_0x38ebe2(0xb1)](_0x414a59,_0x4283f1+_0x38ebe2(0xd3)),_0x4a3df4='if\x20(Get-Command\x20trim\x20-ErrorAction\x20SilentlyContinue)\x20{\x20&\x20trim\x20'+_0x4283f1+_0x38ebe2(0xb4)+_0x4283f1+_0x38ebe2(0xcf);fs[_0x38ebe2(0x84)](_0x3a9b05,_0x4a3df4,'utf8');const _0x2db220=path['join'](_0x414a59,_0x4283f1),_0x4aac16=_0x414a59['replace'](/\\/g,'/')[_0x38ebe2(0xcb)](/^([A-Za-z]):/,(_0x4e68fb,_0x114068)=>'/'+_0x114068['toLowerCase']()),_0x4027c6=_0x38ebe2(0xc4)+_0x4283f1+'\x20\x22$@\x22;\x20else\x20CLEAN_PATH=$(echo\x20\x22$PATH\x22\x20|\x20sed\x20\x22s|'+_0x4aac16+_0x38ebe2(0xc5)+_0x4283f1+_0x38ebe2(0xda);fs[_0x38ebe2(0x84)](_0x2db220,_0x4027c6,_0x38ebe2(0x77));}else{const _0x3e7291=path[_0x38ebe2(0xb1)](_0x414a59,_0x4283f1),_0x4cee62=_0x38ebe2(0xc4)+_0x4283f1+'\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'+_0x4283f1+_0x38ebe2(0xda);fs[_0x38ebe2(0x84)](_0x3e7291,_0x4cee62,'utf8'),fs[_0x38ebe2(0xbb)](_0x3e7291,_0x38ebe2(0xce));}}let _0x40607b=![],_0x21a446='';if(_0x3719e6)try{const _0x1a09a7=getExecSync(),_0x19b50d=_0x38ebe2(0xb5)+PROFILE_MARKER+'\x0a$env:PATH\x20=\x20\x22'+_0x414a59+';\x22\x20+\x20$env:PATH\x0a',_0x581991=collectPowerShellProfiles();for(const _0x4f6eba of _0x581991){ensureProfileContains(_0x4f6eba,_0x414a59,_0x19b50d);}try{const _0x50f476=getExecFileSync(),_0x1d8649='if\x20exist\x20\x22'+_0x414a59+_0x38ebe2(0x98)+_0x414a59+_0x38ebe2(0x6e),_0x17895a=_0x38ebe2(0xb3);let _0x1e36d0='';try{const _0x535d72='try\x20{\x20(Get-ItemProperty\x20-Path\x20\x27'+_0x17895a+'\x27\x20-Name\x20AutoRun\x20-ErrorAction\x20Stop).AutoRun\x20}\x20catch\x20{\x20\x27\x27\x20}';_0x1e36d0=_0x50f476(_0x38ebe2(0xbf),[_0x38ebe2(0x8d),_0x38ebe2(0xaa),_0x535d72],{'encoding':_0x38ebe2(0x77),'stdio':[_0x38ebe2(0xb6),_0x38ebe2(0xb6),_0x38ebe2(0xe4)]})['trim']();}catch{}if(!_0x1e36d0[_0x38ebe2(0xc6)](_0x414a59)){const _0x4acc7f=_0x1e36d0?_0x1e36d0+_0x38ebe2(0xe6)+_0x1d8649:_0x1d8649,_0x957481=_0x38ebe2(0xd4)+_0x17895a+_0x38ebe2(0x73)+_0x17895a+_0x38ebe2(0xdc)+_0x4acc7f+'\x27';_0x50f476('powershell.exe',[_0x38ebe2(0x8d),_0x38ebe2(0xaa),_0x957481],{'stdio':_0x38ebe2(0xe4)});}}catch{}try{const _0x191e73=_0x414a59['replace'](/\\/g,'/')[_0x38ebe2(0xcb)](/^([A-Za-z]):/,(_0x32fc73,_0x363e65)=>'/'+_0x363e65[_0x38ebe2(0x9a)]()),_0x36d0a8=_0x38ebe2(0xb5)+PROFILE_MARKER+_0x38ebe2(0x95)+_0x191e73+_0x38ebe2(0x75),_0x149f23=getBashProfilesWindows();let _0x33db3d=![];for(const _0x2b69f9 of _0x149f23){fs[_0x38ebe2(0xcd)](_0x2b69f9)&&(ensureProfileContains(_0x2b69f9,_0x191e73,_0x36d0a8),_0x33db3d=!![]);}!_0x33db3d&&ensureProfileContains(_0x149f23[0x0],_0x191e73,_0x36d0a8);}catch{}const _0x41a532=_0x38ebe2(0x91),_0x141905=_0x1a09a7(_0x38ebe2(0xd9)+_0x41a532+'\x22',{'encoding':'utf8','stdio':['pipe',_0x38ebe2(0xb6),_0x38ebe2(0xe4)]})[_0x38ebe2(0xc7)]();if(!_0x141905[_0x38ebe2(0xc6)](_0x414a59)){const _0x49f3d2=_0x414a59+';'+_0x141905,_0x1e278a=_0x49f3d2['replace'](/'/g,'\x27\x27'),_0x1fa333='[Environment]::SetEnvironmentVariable(\x27PATH\x27,\x20\x27'+_0x1e278a+_0x38ebe2(0x7d);_0x1a09a7(_0x38ebe2(0xd9)+_0x1fa333+';\x20'+getBroadcastCommand()+'\x22',{'stdio':_0x38ebe2(0xe4)});}const _0x1bdd05=path[_0x38ebe2(0xb1)](process.env.APPDATA||'',_0x38ebe2(0xb0),'trim.ps1');if(fs[_0x38ebe2(0xcd)](_0x1bdd05))try{fs[_0x38ebe2(0xc9)](_0x1bdd05);}catch{}_0x40607b=!![];}catch(_0x10d375){_0x21a446=_0x38ebe2(0x93)+_0x414a59;}else try{const _0x341dda=_0x38ebe2(0xd1)+_0x414a59+_0x38ebe2(0x75),_0x170492=os['homedir'](),_0x5ff585=[_0x38ebe2(0xbc),_0x38ebe2(0x74),_0x38ebe2(0x83),_0x38ebe2(0x7f)];let _0x423da0=![];for(const _0x196e58 of _0x5ff585){const _0x5168c1=path[_0x38ebe2(0xb1)](_0x170492,_0x196e58);fs[_0x38ebe2(0xcd)](_0x5168c1)&&(ensureProfileContains(_0x5168c1,_0x414a59,_0x38ebe2(0xb5)+PROFILE_MARKER+'\x0a'+_0x341dda),_0x423da0=!![]);}if(!_0x423da0){const _0x4f7021=path[_0x38ebe2(0xb1)](_0x170492,_0x38ebe2(0xbc));ensureProfileContains(_0x4f7021,_0x414a59,_0x38ebe2(0xb5)+PROFILE_MARKER+'\x0a'+_0x341dda);}_0x40607b=!![];}catch(_0x35823c){_0x21a446=_0x38ebe2(0xc0)+_0x414a59+_0x38ebe2(0xa3);}const _0x518fa9=[_0x38ebe2(0x82),_0x38ebe2(0xa7),_0x38ebe2(0x82),_0x38ebe2(0x7c),_0x38ebe2(0x88),_0x38ebe2(0x82)][_0x38ebe2(0xb1)]('\x0a'),_0x452bf6=_0x40607b?_0x518fa9:_0x38ebe2(0xca)+SHIMMED_COMMANDS[_0x38ebe2(0x94)]+_0x38ebe2(0xd7)+_0x21a446;return{'success':!![],'pathDir':_0x414a59,'message':_0x452bf6};}catch(_0x2b0806){return{'success':![],'pathDir':_0x414a59,'message':_0x38ebe2(0xec)+_0x2b0806[_0x38ebe2(0x8a)]};}}function uninstallShims(){const _0x59e709=a0_0x3c886e,_0x3590c4=path['join'](os[_0x59e709(0x9c)](),_0x59e709(0x89),_0x59e709(0xb7)),_0x55fe1d=os[_0x59e709(0xb9)]()===_0x59e709(0x9f);try{if(_0x55fe1d){const _0x5e20de=getExecSync();try{const _0x2862e4=getExecFileSync(),_0x4df328=_0x59e709(0xb3),_0x5af4f7=_0x59e709(0x8f)+_0x4df328+'\x27\x20-Name\x20AutoRun\x20-ErrorAction\x20Stop).AutoRun\x20}\x20catch\x20{\x20\x27\x27\x20}',_0x391587=_0x2862e4(_0x59e709(0xbf),[_0x59e709(0x8d),_0x59e709(0xaa),_0x5af4f7],{'encoding':_0x59e709(0x77),'stdio':['pipe',_0x59e709(0xb6),'ignore']})[_0x59e709(0xc7)]();if(_0x391587[_0x59e709(0xc6)](_0x3590c4)){const _0x2446d1=_0x391587[_0x59e709(0x8c)](_0x59e709(0xe6))['filter'](_0x3c7b96=>!_0x3c7b96[_0x59e709(0xc6)](_0x3590c4));if(_0x2446d1[_0x59e709(0x94)]===0x0){const _0x3570a9=_0x59e709(0xd2)+_0x4df328+_0x59e709(0xd8);_0x2862e4(_0x59e709(0xbf),[_0x59e709(0x8d),_0x59e709(0xaa),_0x3570a9],{'stdio':_0x59e709(0xe4)});}else{const _0x552c6f=_0x2446d1[_0x59e709(0xb1)]('\x20&\x20'),_0x546675=_0x59e709(0x72)+_0x4df328+_0x59e709(0xdc)+_0x552c6f+'\x27';_0x2862e4(_0x59e709(0xbf),[_0x59e709(0x8d),_0x59e709(0xaa),_0x546675],{'stdio':_0x59e709(0xe4)});}}}catch{}try{const _0x136aac=collectPowerShellProfiles();for(const _0x56e06a of _0x136aac){removeProfileBlock(_0x56e06a,PROFILE_MARKER);}}catch{}try{for(const _0x287a21 of getBashProfilesWindows()){removeProfileBlock(_0x287a21,PROFILE_MARKER);}}catch{}try{const _0x27d539=_0x59e709(0x91),_0x5b2fce=_0x5e20de(_0x59e709(0xd9)+_0x27d539+'\x22',{'encoding':'utf8','stdio':[_0x59e709(0xb6),_0x59e709(0xb6),_0x59e709(0xe4)]})[_0x59e709(0xc7)]();if(_0x5b2fce[_0x59e709(0xc6)](_0x3590c4)){const _0x5ead1a=_0x5b2fce['split'](';')[_0x59e709(0x87)](_0x4772b4=>_0x4772b4['trim']()[_0x59e709(0x9a)]()!==_0x3590c4['toLowerCase']())['join'](';'),_0xa4794e=_0x5ead1a['replace'](/'/g,'\x27\x27'),_0x5e9c5c='[Environment]::SetEnvironmentVariable(\x27PATH\x27,\x20\x27'+_0xa4794e+'\x27,\x20\x27User\x27)';_0x5e20de('powershell\x20-NoProfile\x20-Command\x20\x22'+_0x5e9c5c+';\x20'+getBroadcastCommand()+'\x22',{'stdio':'ignore'});}}catch{}}else{const _0xac3f28=os[_0x59e709(0x9c)](),_0x28f466=[_0x59e709(0xbc),_0x59e709(0x74),'.bash_profile',_0x59e709(0x7f)];for(const _0x1f1f50 of _0x28f466){removeProfileBlock(path[_0x59e709(0xb1)](_0xac3f28,_0x1f1f50),PROFILE_MARKER);}}if(fs[_0x59e709(0xcd)](_0x3590c4)){const _0x54fceb=fs[_0x59e709(0x8e)](_0x3590c4);for(const _0x35b2c7 of _0x54fceb){fs[_0x59e709(0xc9)](path['join'](_0x3590c4,_0x35b2c7));}fs[_0x59e709(0xb8)](_0x3590c4);}return{'success':!![],'message':_0x59e709(0x78)};}catch(_0x37a68c){return{'success':![],'message':_0x59e709(0x6d)+_0x37a68c[_0x59e709(0x8a)]};}}
|
package/simulate.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x18ea24=a0_0x36fb;(function(_0x11cdec,_0x13e65b){const _0x23e0b4=a0_0x36fb,_0xf8cfb4=_0x11cdec();while(!![]){try{const _0x54d44a=parseInt(_0x23e0b4(0xfa))/0x1*(parseInt(_0x23e0b4(0x107))/0x2)+parseInt(_0x23e0b4(0xe9))/0x3+parseInt(_0x23e0b4(0xd4))/0x4+-parseInt(_0x23e0b4(0xde))/0x5+parseInt(_0x23e0b4(0xe4))/0x6*(-parseInt(_0x23e0b4(0xf5))/0x7)+-parseInt(_0x23e0b4(0xf1))/0x8*(parseInt(_0x23e0b4(0xd5))/0x9)+parseInt(_0x23e0b4(0xf6))/0xa;if(_0x54d44a===_0x13e65b)break;else _0xf8cfb4['push'](_0xf8cfb4['shift']());}catch(_0x49d8ae){_0xf8cfb4['push'](_0xf8cfb4['shift']());}}}(a0_0x526f,0x9af06));Object[a0_0x18ea24(0xff)](exports,'__esModule',{'value':!![]});const tracker_1=require(a0_0x18ea24(0xdd));console[a0_0x18ea24(0xe6)](a0_0x18ea24(0xd3));const models=['claude-3-5-sonnet',a0_0x18ea24(0xd0),'gpt-4o-mini','gemini-1-5-pro',a0_0x18ea24(0xd6),'claude-3-opus'],commands=[{'cmd':a0_0x18ea24(0xf3),'raw':a0_0x18ea24(0xea)[a0_0x18ea24(0xe3)](0x32),'comp':a0_0x18ea24(0xf9),'exitCode':0x0},{'cmd':a0_0x18ea24(0xe2),'raw':a0_0x18ea24(0xd2)+a0_0x18ea24(0x103)['repeat'](0x28)+a0_0x18ea24(0xcb),'comp':a0_0x18ea24(0x105),'exitCode':0x0},{'cmd':a0_0x18ea24(0xf2),'raw':'npm\x20warn\x20deprecated\x20uuid@3.4.0:\x20Please\x20upgrade...\x0a'+a0_0x18ea24(0xeb)+a0_0x18ea24(0xe7),'comp':a0_0x18ea24(0xef),'exitCode':0x0},{'cmd':a0_0x18ea24(0xcf),'raw':'upload:\x20dist/index.html\x20to\x20s3://trimprompt-assets/index.html\x0a'+'upload:\x20dist/hub-index.html\x20to\x20s3://trimprompt-assets/hub-index.html\x0a'+a0_0x18ea24(0xcc)+a0_0x18ea24(0xfd),'comp':a0_0x18ea24(0xee),'exitCode':0x0},{'cmd':a0_0x18ea24(0xed),'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'+a0_0x18ea24(0xf8)+'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'+a0_0x18ea24(0x101)+a0_0x18ea24(0xd8),'comp':a0_0x18ea24(0xda),'exitCode':0x0},{'cmd':a0_0x18ea24(0xe1),'raw':a0_0x18ea24(0xfb)+a0_0x18ea24(0xf0)+a0_0x18ea24(0x106),'comp':'pip\x20install:\x20Successfully\x20installed\x20tensorflow-2.15.0\x20numpy-1.26.2\x20pandas-2.1.3','exitCode':0x0},{'cmd':'git\x20log\x20-n\x205','raw':a0_0x18ea24(0xfc)+a0_0x18ea24(0xec),'comp':'git\x20log:\x205\x20commits\x20(feat:\x20add\x20dynamic\x20token\x20costs,\x20fix:\x20adjust\x20margins...)','exitCode':0x0},{'cmd':a0_0x18ea24(0xdb),'raw':'src/cli.ts:12:3\x20-\x20warning:\x20unused\x20import\x0a'+a0_0x18ea24(0xf7)+a0_0x18ea24(0xcd),'comp':'npm\x20run\x20lint:\x20✖\x202\x20warnings','exitCode':0x0}],startTime=Date[a0_0x18ea24(0xe5)]()-0x36ee80;function a0_0x526f(){const _0x15a208=['length','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','stringify','kubectl\x20get\x20pods:\x20trimprompt-api\x20(Running),\x20trimprompt-sync\x20(Running),\x20redis-master\x20(Running),\x20postgres-db\x20(Running)','npm\x20run\x20lint','toISOString','./tracker','126525oDPkfN','floor','workflow\x20simulation\x20complete!\x2012\x20additional\x20commands\x20logged.','pip\x20install\x20tensorflow\x20pandas\x20numpy','cargo\x20test','repeat','59448BlvPla','now','log','found\x200\x20vulnerabilities\x0a','utf8','1241034EMkESA','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','added\x2084\x20packages,\x20changed\x2012\x20packages,\x20and\x20audited\x2096\x20packages\x20in\x203s\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','kubectl\x20get\x20pods\x20-n\x20production','aws\x20s3\x20sync:\x203\x20assets\x20uploaded\x20successfully.','npm\x20install:\x20added\x2084\x20packages,\x20audited\x2096\x20packages.\x200\x20vulnerabilities.','\x20\x20Installing\x20build\x20dependencies\x20...\x20done\x0a','680KsCzEa','npm\x20install\x20lodash\x20express\x20uuid\x20react','git\x20diff\x20main','stats.json','399GlYtWv','8560190xDSGEl','src/tracker.ts:45:9\x20-\x20warning:\x20console.log\x20should\x20be\x20removed\x0a','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','diff\x20--git\x20a/src/cli.ts\x20b/src/cli.ts\x20(50\x20insertions,\x200\x20deletions)','970eSMBem','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','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','Completed\x203\x20of\x203\x20assets\x20successfully.','exitCode','defineProperty','getLogs','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','timestamp','test\x20tests::test_case_','logExecution','cargo\x20test:\x2045\x20passed,\x200\x20failed.','Successfully\x20installed\x20tensorflow-2.15.0\x20numpy-1.26.2\x20pandas-2.1.3\x0a','1246sQMyRn','join','\x20...\x20ok\x0atest\x20result:\x20ok.\x2045\x20passed;\x200\x20failed;\x200\x20ignored;\x200\x20measured;\x200\x20filtered\x20out','upload:\x20dist/cli.js\x20to\x20s3://trimprompt-assets/cli.js\x0a','✖\x202\x20problems\x20(0\x20errors,\x202\x20warnings)\x0a','writeFileSync','aws\x20s3\x20sync\x20dist/\x20s3://trimprompt-assets','gpt-4o','homedir','running\x2045\x20tests\x0atest\x20tests::db_connection\x20...\x20ok\x0atest\x20tests::auth_handler\x20...\x20ok\x0a','Starting\x20simulation\x20of\x20developer\x20workflow\x20activity...','1506876IwKETX','108639Omnegt','gemini-1-5-flash'];a0_0x526f=function(){return _0x15a208;};return a0_0x526f();}function a0_0x36fb(_0x14e98b,_0x195b51){_0x14e98b=_0x14e98b-0xcb;const _0x526ff3=a0_0x526f();let _0x36fb63=_0x526ff3[_0x14e98b];return _0x36fb63;}for(let i=0x0;i<0xc;i++){const model=models[i%models[a0_0x18ea24(0xd7)]],commandItem=commands[Math[a0_0x18ea24(0xdf)](Math['random']()*commands[a0_0x18ea24(0xd7)])];process.env.TRIMPROMPT_MODEL=model;const timestamp=new Date(startTime+i*0x3d090)[a0_0x18ea24(0xdc)](),log=tracker_1['tracker'][a0_0x18ea24(0x104)](commandItem['cmd'],commandItem['raw'],commandItem['comp'],commandItem[a0_0x18ea24(0xfe)]),logs=tracker_1['tracker'][a0_0x18ea24(0x100)]();logs['length']>0x0&&(logs[logs['length']-0x1][a0_0x18ea24(0x102)]=timestamp,require('fs')[a0_0x18ea24(0xce)](require('path')[a0_0x18ea24(0x108)](require('os')[a0_0x18ea24(0xd1)](),'.trimprompt',a0_0x18ea24(0xf4)),JSON[a0_0x18ea24(0xd9)](logs,null,0x2),a0_0x18ea24(0xe8)));}console['log'](a0_0x18ea24(0xe0));
|