trimprompt 1.0.47 → 1.0.48
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/cache-manager.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/file-watcher.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/hooks/claude-hook.js +1 -1
- package/mcp.js +1 -1
- package/package.json +1 -1
- package/postinstall.js +18 -12
- package/proxy-conv.js +1 -1
- package/proxy-resp.js +1 -1
- package/redactor.js +1 -1
- package/seed.js +1 -1
- package/simulate.js +1 -1
- package/sync.js +1 -1
- package/tracker.js +1 -1
package/tracker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x2cc95b=a0_0xd0b3;(function(_0x7390e0,_0x1793bb){const _0x5d16f6=a0_0xd0b3,_0x3caaa5=_0x7390e0();while(!![]){try{const _0xd34ad3=parseInt(_0x5d16f6(0x191))/0x1+parseInt(_0x5d16f6(0x190))/0x2*(parseInt(_0x5d16f6(0xfb))/0x3)+-parseInt(_0x5d16f6(0x148))/0x4*(-parseInt(_0x5d16f6(0x130))/0x5)+parseInt(_0x5d16f6(0x118))/0x6+-parseInt(_0x5d16f6(0x126))/0x7+parseInt(_0x5d16f6(0xf7))/0x8+-parseInt(_0x5d16f6(0x185))/0x9*(parseInt(_0x5d16f6(0x110))/0xa);if(_0xd34ad3===_0x1793bb)break;else _0x3caaa5['push'](_0x3caaa5['shift']());}catch(_0x1b5ee1){_0x3caaa5['push'](_0x3caaa5['shift']());}}}(a0_0x3430,0xf1243));var __createBinding=this&&this[a0_0x2cc95b(0x147)]||(Object[a0_0x2cc95b(0x100)]?function(_0x4bde2d,_0x5e431f,_0x52be40,_0x54324b){const _0x445176=a0_0x2cc95b;if(_0x54324b===undefined)_0x54324b=_0x52be40;var _0x446d8c=Object[_0x445176(0xf3)](_0x5e431f,_0x52be40);(!_0x446d8c||(_0x445176(0x18f)in _0x446d8c?!_0x5e431f[_0x445176(0x194)]:_0x446d8c[_0x445176(0x14a)]||_0x446d8c[_0x445176(0x17e)]))&&(_0x446d8c={'enumerable':!![],'get':function(){return _0x5e431f[_0x52be40];}}),Object['defineProperty'](_0x4bde2d,_0x54324b,_0x446d8c);}:function(_0x58f051,_0x1fd784,_0x165f73,_0x24bc94){if(_0x24bc94===undefined)_0x24bc94=_0x165f73;_0x58f051[_0x24bc94]=_0x1fd784[_0x165f73];}),__setModuleDefault=this&&this[a0_0x2cc95b(0x10b)]||(Object['create']?function(_0x40b60f,_0x4cb8f8){const _0x1324b3=a0_0x2cc95b;Object[_0x1324b3(0x131)](_0x40b60f,_0x1324b3(0x13e),{'enumerable':!![],'value':_0x4cb8f8});}:function(_0x257a86,_0x35e41d){const _0x316029=a0_0x2cc95b;_0x257a86[_0x316029(0x13e)]=_0x35e41d;}),__importStar=this&&this[a0_0x2cc95b(0x133)]||(function(){var _0x3ce707=function(_0xd4de0a){const _0xd98946=a0_0xd0b3;return _0x3ce707=Object[_0xd98946(0x125)]||function(_0x14dc96){const _0x2e1fa6=_0xd98946;var _0x362d15=[];for(var _0x3c2201 in _0x14dc96)if(Object['prototype'][_0x2e1fa6(0x139)][_0x2e1fa6(0x10d)](_0x14dc96,_0x3c2201))_0x362d15[_0x362d15[_0x2e1fa6(0x165)]]=_0x3c2201;return _0x362d15;},_0x3ce707(_0xd4de0a);};return function(_0x5ac2bc){const _0x141725=a0_0xd0b3;if(_0x5ac2bc&&_0x5ac2bc['__esModule'])return _0x5ac2bc;var _0x1519cc={};if(_0x5ac2bc!=null){for(var _0x108d0e=_0x3ce707(_0x5ac2bc),_0x23fc65=0x0;_0x23fc65<_0x108d0e[_0x141725(0x165)];_0x23fc65++)if(_0x108d0e[_0x23fc65]!==_0x141725(0x13e))__createBinding(_0x1519cc,_0x5ac2bc,_0x108d0e[_0x23fc65]);}return __setModuleDefault(_0x1519cc,_0x5ac2bc),_0x1519cc;};}());Object[a0_0x2cc95b(0x131)](exports,a0_0x2cc95b(0x194),{'value':!![]}),exports[a0_0x2cc95b(0x107)]=exports[a0_0x2cc95b(0x132)]=exports[a0_0x2cc95b(0x178)]=void 0x0,exports[a0_0x2cc95b(0x10a)]=detectSessionTool;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x2cc95b(0xe8))),os=__importStar(require('os')),child_process_1=require(a0_0x2cc95b(0x13a));exports[a0_0x2cc95b(0x178)]={'claude-fable-5':{'name':a0_0x2cc95b(0x106),'input_price_1m':0xa},'claude-mythos-5':{'name':'Claude\x20Mythos\x205','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_0x2cc95b(0x143),'input_price_1m':0x5},'claude-opus-4-1':{'name':a0_0x2cc95b(0x155),'input_price_1m':0xf},'claude-sonnet-4-6':{'name':a0_0x2cc95b(0x129),'input_price_1m':0x3},'claude-sonnet-4-5':{'name':a0_0x2cc95b(0x113),'input_price_1m':0x3},'claude-3-5-sonnet':{'name':'Claude\x203.5\x20Sonnet','input_price_1m':0x3},'claude-haiku-4-5':{'name':a0_0x2cc95b(0xf8),'input_price_1m':0x1},'claude-haiku-3-5':{'name':a0_0x2cc95b(0x169),'input_price_1m':0.8},'gpt-5-5':{'name':'GPT-5.5','input_price_1m':0x5},'gpt-5-4':{'name':a0_0x2cc95b(0x15f),'input_price_1m':2.5},'gpt-4o':{'name':a0_0x2cc95b(0x11c),'input_price_1m':2.5},'gpt-5-4-mini':{'name':a0_0x2cc95b(0x12a),'input_price_1m':0.75},'gpt-5-4-nano':{'name':a0_0x2cc95b(0xec),'input_price_1m':0.2},'gpt-4-1-mini':{'name':'GPT-4.1\x20Mini','input_price_1m':0.4},'gpt-4-1-nano':{'name':a0_0x2cc95b(0x14b),'input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0x2cc95b(0x180),'input_price_1m':0.15},'o1':{'name':a0_0x2cc95b(0x149),'input_price_1m':0xf},'o1-mini':{'name':a0_0x2cc95b(0x159),'input_price_1m':0x3},'o3-mini':{'name':'OpenAI\x20o3-mini','input_price_1m':1.1},'cursor-small':{'name':a0_0x2cc95b(0x168),'input_price_1m':0.1},'gemini-3-1-pro':{'name':a0_0x2cc95b(0x109),'input_price_1m':0x2},'gemini-3-5-flash':{'name':a0_0x2cc95b(0x13d),'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':'Gemini\x203.5\x20Live\x20Translate','input_price_1m':3.5}};function detectSessionTool(){const _0x43156d=a0_0x2cc95b,_0x45abb6=process.env,_0x123764={'tool':'','model':_0x43156d(0x101),'modelShort':''};if(_0x45abb6[_0x43156d(0x166)]&&exports['PRICING'][_0x45abb6[_0x43156d(0x166)]])return{'tool':'','model':_0x45abb6['TRIMPROMPT_MODEL'],'modelShort':''};const _0x2a5331=(_0x45abb6[_0x43156d(0x116)]||'')['toLowerCase']();if(_0x2a5331){if(_0x2a5331[_0x43156d(0x16f)](_0x43156d(0x18e))||_0x2a5331[_0x43156d(0x16f)](_0x43156d(0x184))){const _0x3041ad=_0x45abb6['CLAUDE_EFFORT']===_0x43156d(0x188)?_0x43156d(0xf9):'sonnet',_0x2b1a1d=_0x45abb6['CLAUDE_EFFORT']==='high'?_0x43156d(0xed):'claude-sonnet-4-6';return{'tool':_0x43156d(0xfc),'model':_0x2b1a1d,'modelShort':_0x3041ad};}if(_0x2a5331[_0x43156d(0x16f)](_0x43156d(0x16c)))return{'tool':_0x43156d(0x16c),'model':_0x43156d(0x101),'modelShort':'sonnet'};if(_0x2a5331['includes']('github-copilot')||_0x2a5331[_0x43156d(0x16f)](_0x43156d(0x16d))){const _0x70f64c=_0x45abb6[_0x43156d(0x140)]||'';if(_0x70f64c&&exports[_0x43156d(0x178)][_0x70f64c])return{'tool':'copilot','model':_0x70f64c,'modelShort':_0x70f64c['split']('-')[_0x43156d(0x193)]()||''};return{'tool':_0x43156d(0x16d),'model':_0x43156d(0x137),'modelShort':'sonnet'};}if(_0x2a5331[_0x43156d(0x16f)]('gemini'))return{'tool':_0x43156d(0x112),'model':_0x43156d(0x120),'modelShort':_0x43156d(0x15e)};if(_0x2a5331[_0x43156d(0x16f)](_0x43156d(0x15b)))return{'tool':_0x43156d(0x15b),'model':_0x43156d(0x160),'modelShort':_0x43156d(0x173)};if(_0x2a5331[_0x43156d(0x16f)](_0x43156d(0x176)))return{'tool':_0x43156d(0x176),'model':_0x43156d(0x101),'modelShort':''};if(_0x2a5331['includes'](_0x43156d(0x14e)))return{'tool':_0x43156d(0x14e),'model':_0x43156d(0x10f),'modelShort':_0x43156d(0x112)};if(_0x2a5331[_0x43156d(0x16f)](_0x43156d(0x179))||_0x45abb6['REPL_ID'])return{'tool':_0x43156d(0x179),'model':_0x43156d(0x101),'modelShort':''};return{'tool':_0x2a5331['split']('_')[0x0][_0x43156d(0xf4)]('-')[0x0],'model':_0x43156d(0x101),'modelShort':''};}if(_0x45abb6[_0x43156d(0x122)]==='1'||_0x45abb6[_0x43156d(0x117)]==='1'){const _0x3d8f26=_0x45abb6[_0x43156d(0x104)]===_0x43156d(0x188)?'opus':'sonnet',_0x493a9f=_0x45abb6['CLAUDE_EFFORT']===_0x43156d(0x188)?_0x43156d(0xed):_0x43156d(0x101);return{'tool':_0x43156d(0xfc),'model':_0x493a9f,'modelShort':_0x3d8f26};}if(_0x45abb6['CURSOR_AGENT']==='1')return{'tool':'cursor','model':_0x43156d(0x101),'modelShort':'sonnet'};if(_0x45abb6[_0x43156d(0x121)]==='1')return{'tool':_0x43156d(0x112),'model':_0x43156d(0x120),'modelShort':_0x43156d(0x15e)};if(_0x45abb6['COPILOT_MODEL']||_0x45abb6['COPILOT_GITHUB_TOKEN']){const _0x1d9285=_0x45abb6['COPILOT_MODEL']||'';if(_0x1d9285&&exports['PRICING'][_0x1d9285])return{'tool':'copilot','model':_0x1d9285,'modelShort':_0x1d9285[_0x43156d(0xf4)]('-')[_0x43156d(0x193)]()||''};return{'tool':'copilot','model':_0x43156d(0x137),'modelShort':'sonnet'};}if(_0x45abb6['REPL_ID']||_0x45abb6[_0x43156d(0x11b)])return{'tool':_0x43156d(0x179),'model':_0x43156d(0x101),'modelShort':''};if(_0x45abb6[_0x43156d(0x11f)])return{'tool':'cline','model':_0x43156d(0x101),'modelShort':''};if(_0x45abb6[_0x43156d(0x15a)])return{'tool':_0x43156d(0x11e),'model':_0x43156d(0x101),'modelShort':''};if(_0x45abb6[_0x43156d(0x154)]==='1')return{'tool':_0x43156d(0x14e),'model':'gemini-3-1-pro','modelShort':'gemini'};if(_0x45abb6[_0x43156d(0x104)]){const _0x1a6d5d=_0x45abb6[_0x43156d(0x104)]===_0x43156d(0x188)?_0x43156d(0xf9):_0x43156d(0x16b),_0x882ad3=_0x45abb6[_0x43156d(0x104)]===_0x43156d(0x188)?_0x43156d(0xed):'claude-sonnet-4-6';return{'tool':'','model':_0x882ad3,'modelShort':''};}if(_0x45abb6['AIDER_MODEL']&&exports[_0x43156d(0x178)][_0x45abb6['AIDER_MODEL']])return{'tool':'aider','model':_0x45abb6[_0x43156d(0xf2)],'modelShort':''};if(_0x45abb6['VSCODE_PID']){const _0x193044=(_0x45abb6[_0x43156d(0x192)]||'')[_0x43156d(0xe7)]();if(_0x193044[_0x43156d(0x16f)](_0x43156d(0x16c)))return{'tool':_0x43156d(0x16c),'model':_0x43156d(0x101),'modelShort':_0x43156d(0x16b)};if(_0x193044[_0x43156d(0x16f)]('windsurf'))return{'tool':'windsurf','model':_0x43156d(0x101),'modelShort':_0x43156d(0x16b)};}const _0x47e573=process.env.TRIMPROMPT_MODEL||'';if(_0x47e573&&exports['PRICING'][_0x47e573])return{'tool':'','model':_0x47e573,'modelShort':''};return _0x123764;}const MAX_LOGS_PER_TOOL=0x32;function a0_0x3430(){const _0x3eba77=['PATH','pop','__esModule','mtimeMs','toLowerCase','path','command','compact:','stringify','GPT-5.4\x20Nano','claude-opus-4-8','config','./file-watcher','trim','lifetime_savings','AIDER_MODEL','getOwnPropertyDescriptor','split','unknown','estimated_raw_tokens','11157560hqLeyi','Claude\x20Haiku\x204.5','opus','/api/security/alert','569979REtFaE','claude','saveConfig','auto','sync.js','create','claude-sonnet-4-6','readFileSync','getDevIdentity','CLAUDE_EFFORT','statsPath','Claude\x20Fable\x205','tracker','pruneLogsPerTool','Gemini\x203.1\x20Pro','detectSessionTool','__setModuleDefault','secretsFound','call','model_used','gemini-3-1-pro','21151330HnFGNj','secretTypes','gemini','Claude\x20Sonnet\x204.5','other','telemetry_url','AI_AGENT','CLAUDE_CODE','8779608VHMsDW','parse','\x20Compaction','REPLIT_ENVIRONMENT','GPT-4o','join','continue','CLINE_DATA_DIR','gemini-3-5-flash','GEMINI_CLI','CLAUDECODE','getLogs','unref','getOwnPropertyNames','47698RldiCN','conv:','ignore','Claude\x20Sonnet\x204.6','GPT-5.4\x20Mini','redact','startsWith','substring','tool','add','15825GFHKQt','defineProperty','Tracker','__importStar','username','toFixed','configPath','claude-sonnet-4-5','activeSavedTokens','hasOwnProperty','child_process','stats.json','triggerBackgroundSync','Gemini\x203.5\x20Flash','default','logExecution','COPILOT_MODEL','input_price_1m','getConfig','Claude\x20Opus\x204.5','renameSync','tokens_saved','homedir','__createBinding','644LYglpD','OpenAI\x20o1','writable','GPT-4.1\x20Nano','.comp.txt','max','antigravity','writeFileSync','\x20Chat\x20','estimated_compressed_tokens','spawn','set','ANTIGRAVITY_AGENT','Claude\x20Opus\x204.1\x20(deprecated)','init','logsDir','default_model','OpenAI\x20o1-mini','CONTINUE_GLOBAL_DIR','codex','baseDir','push','flash','GPT-5.4','o3-mini','raw_tokens','claude-3-5-sonnet','mkdirSync','sendSecurityAlert','length','TRIMPROMPT_MODEL','setConfig','Cursor\x20Small','Claude\x20Haiku\x203.5','timestamp','sonnet','cursor','copilot','random','includes','statSync','fullPath','execSync','o3mini','compressed_tokens','toUpperCase','devin','modelShort','PRICING','replit','utf8','has','cachedDevId','.trimprompt','configurable','config.json','GPT-4o\x20Mini','execPath',').protocol===\x27https:\x27?\x27https\x27:\x27http\x27);const\x20r=h.request(','existsSync','claude_code','18neTnPr','ceil','getStatsSummary','high','toString','name','saveLogs','slice','userInfo','claude-code','get','18WzSieP','147330SkQDFQ'];a0_0x3430=function(){return _0x3eba77;};return a0_0x3430();}let globalLogsMemoryCache=[],globalLogsCacheMtime=-0x1;function a0_0xd0b3(_0x3b754f,_0x23f297){_0x3b754f=_0x3b754f-0xe6;const _0x343018=a0_0x3430();let _0xd0b37a=_0x343018[_0x3b754f];return _0xd0b37a;}class Tracker{[a0_0x2cc95b(0x15c)];['configPath'];[a0_0x2cc95b(0x105)];[a0_0x2cc95b(0x157)];[a0_0x2cc95b(0xee)];constructor(){const _0x4ac27f=a0_0x2cc95b;this['baseDir']=path[_0x4ac27f(0x11d)](os[_0x4ac27f(0x146)](),_0x4ac27f(0x17d)),this[_0x4ac27f(0x136)]=path[_0x4ac27f(0x11d)](this[_0x4ac27f(0x15c)],_0x4ac27f(0x17f)),this['statsPath']=path[_0x4ac27f(0x11d)](this['baseDir'],_0x4ac27f(0x13b)),this[_0x4ac27f(0x157)]=path[_0x4ac27f(0x11d)](this[_0x4ac27f(0x15c)],'logs'),this[_0x4ac27f(0x156)]();}[a0_0x2cc95b(0x156)](){const _0x4c15d0=a0_0x2cc95b;!fs[_0x4c15d0(0x183)](this[_0x4c15d0(0x15c)])&&fs[_0x4c15d0(0x163)](this['baseDir'],{'recursive':!![]});!fs['existsSync'](this['logsDir'])&&fs['mkdirSync'](this[_0x4c15d0(0x157)],{'recursive':!![]});const _0x432506={'version':'1.0','telemetry_url':process.env.TRIMPROMPT_TELEMETRY_URL||'','max_output_tokens':0x1388,'redaction_enabled':!![],'default_model':'claude-opus-4-8'};if(fs[_0x4c15d0(0x183)](this[_0x4c15d0(0x136)]))try{const _0x32bf57=fs['readFileSync'](this[_0x4c15d0(0x136)],_0x4c15d0(0x17a));this['config']={..._0x432506,...JSON[_0x4c15d0(0x119)](_0x32bf57)};}catch(_0x47d839){this[_0x4c15d0(0xee)]=_0x432506;}else this['config']=_0x432506,this['saveConfig']();!fs[_0x4c15d0(0x183)](this['statsPath'])&&fs[_0x4c15d0(0x14f)](this[_0x4c15d0(0x105)],JSON[_0x4c15d0(0xeb)]([]),_0x4c15d0(0x17a));}[a0_0x2cc95b(0x142)](){const _0x5aa6e6=a0_0x2cc95b;return process.env.TRIMPROMPT_TELEMETRY_URL&&(this['config'][_0x5aa6e6(0x115)]=process.env.TRIMPROMPT_TELEMETRY_URL),this[_0x5aa6e6(0xee)];}[a0_0x2cc95b(0x167)](_0x2397d9,_0x5f001e){const _0x1bb112=a0_0x2cc95b;this[_0x1bb112(0xee)][_0x2397d9]=_0x5f001e,this[_0x1bb112(0xfd)]();}['saveConfig'](){const _0x5ab2d9=a0_0x2cc95b;fs[_0x5ab2d9(0x14f)](this['configPath'],JSON[_0x5ab2d9(0xeb)](this[_0x5ab2d9(0xee)],null,0x2),'utf8');}[a0_0x2cc95b(0x123)](){const _0x3ad918=a0_0x2cc95b;try{if(!fs[_0x3ad918(0x183)](this[_0x3ad918(0x105)]))return globalLogsMemoryCache;const _0x169d0b=fs[_0x3ad918(0x170)](this['statsPath'])[_0x3ad918(0xe6)];if(_0x169d0b===globalLogsCacheMtime&&globalLogsMemoryCache['length']>0x0)return globalLogsMemoryCache;const _0x30584e=fs[_0x3ad918(0x102)](this['statsPath'],'utf8'),_0x44d46a=JSON[_0x3ad918(0x119)](_0x30584e);if(Array['isArray'](_0x44d46a))return globalLogsMemoryCache=_0x44d46a,globalLogsCacheMtime=_0x169d0b,_0x44d46a;}catch{}return globalLogsMemoryCache;}['saveLogs'](_0x1c24e1){const _0x235de4=a0_0x2cc95b;globalLogsMemoryCache=_0x1c24e1;const _0x2249d9=this[_0x235de4(0x105)]+'.tmp';try{fs[_0x235de4(0x14f)](_0x2249d9,JSON['stringify'](_0x1c24e1,null,0x2),_0x235de4(0x17a)),fs[_0x235de4(0x144)](_0x2249d9,this['statsPath']);}catch{try{fs[_0x235de4(0x14f)](this[_0x235de4(0x105)],JSON['stringify'](_0x1c24e1,null,0x2),'utf8');}catch{}}}[a0_0x2cc95b(0x108)](_0x1b776b){const _0x595b59=a0_0x2cc95b,_0x5a1061=new Map();for(const _0x568088 of _0x1b776b){const _0x365524=_0x568088[_0x595b59(0x12e)]&&_0x568088['tool'][_0x595b59(0xf0)]()||_0x568088[_0x595b59(0x10e)]||_0x595b59(0x114);let _0xedaeae=_0x5a1061[_0x595b59(0x18f)](_0x365524);!_0xedaeae&&(_0xedaeae=[],_0x5a1061[_0x595b59(0x153)](_0x365524,_0xedaeae)),_0xedaeae[_0x595b59(0x15d)](_0x568088);}const _0x34d01a=new Set();for(const _0x1337fd of _0x5a1061['values']()){const _0x8d5633=_0x1337fd[_0x595b59(0x165)]-MAX_LOGS_PER_TOOL;for(let _0x33843c=0x0;_0x33843c<_0x8d5633;_0x33843c++)_0x34d01a[_0x595b59(0x12f)](_0x1337fd[_0x33843c]['id']);}if(_0x34d01a['size']===0x0)return _0x1b776b;let _0x5d6d7c={};try{_0x5d6d7c=JSON[_0x595b59(0x119)](fs[_0x595b59(0x102)](this[_0x595b59(0x136)],'utf8'))||{};}catch{}const _0x53b2f7=_0x5d6d7c[_0x595b59(0xf1)]||{'raw_tokens':0x0,'compressed_tokens':0x0,'tokens_saved':0x0};for(const _0x4d1ad0 of _0x1b776b){if(!_0x34d01a[_0x595b59(0x17b)](_0x4d1ad0['id']))continue;_0x53b2f7[_0x595b59(0x161)]+=_0x4d1ad0[_0x595b59(0xf6)]||0x0,_0x53b2f7['compressed_tokens']+=_0x4d1ad0[_0x595b59(0x151)]||0x0,_0x53b2f7[_0x595b59(0x145)]+=_0x4d1ad0[_0x595b59(0x145)]||0x0;}_0x5d6d7c[_0x595b59(0xf1)]=_0x53b2f7,this[_0x595b59(0xee)]={...this[_0x595b59(0xee)],..._0x5d6d7c};try{this[_0x595b59(0xfd)]();}catch{}for(const _0x46feb4 of _0x34d01a){try{fs['unlinkSync'](path[_0x595b59(0x11d)](this['logsDir'],_0x46feb4+'.raw.txt'));}catch{}try{fs['unlinkSync'](path[_0x595b59(0x11d)](this['logsDir'],_0x46feb4+_0x595b59(0x14c)));}catch{}}return _0x1b776b['filter'](_0x1fd7a8=>!_0x34d01a[_0x595b59(0x17b)](_0x1fd7a8['id']));}[a0_0x2cc95b(0x13f)](_0xcd4c73,_0x2ad380,_0x20c5a9,_0x1a113d,_0x3dff6a,_0x11f7dc){const _0x6d7a81=a0_0x2cc95b,_0xa472cc=this[_0x6d7a81(0x123)](),_0x5b497c=_0x2ad380[_0x6d7a81(0x165)],_0x13c6f0=_0x20c5a9['length'],_0x30bf1a=detectSessionTool(),_0x2f0796=_0x30bf1a['model'],_0x4b2298=_0x30bf1a[_0x6d7a81(0x12e)]==='antigravity'?_0x6d7a81(0x112):_0x30bf1a[_0x6d7a81(0x12e)];let _0x2911ed=0x0;if(_0x4b2298&&!_0xcd4c73['startsWith']('compact:'))try{const {getLatestSessionFile:_0x4bd419,loadSessionsState:_0x2c0ea5}=require(_0x6d7a81(0xef)),_0x243330=_0x4bd419(_0x4b2298);if(_0x243330&&_0x243330[_0x6d7a81(0x171)]){const _0x29d004=_0x2c0ea5();_0x29d004[_0x243330[_0x6d7a81(0x171)]]&&(_0x2911ed=_0x29d004[_0x243330[_0x6d7a81(0x171)]][_0x6d7a81(0x138)]||0x0);}}catch{}const _0x3fd521=Math['ceil'](_0x5b497c/0x4)+_0x2911ed,_0x39d1a3=Math[_0x6d7a81(0x186)](_0x13c6f0/0x4),_0x3ef64e=Math[_0x6d7a81(0x14d)](0x0,_0x3fd521-_0x39d1a3),_0x5e599d=Math[_0x6d7a81(0x16e)]()[_0x6d7a81(0x189)](0x24)[_0x6d7a81(0x12d)](0x2,0xb);try{const {redactor:_0x3e2494}=require('./redactor'),_0x5764db=_0x3e2494?_0x3e2494[_0x6d7a81(0x12b)](_0x2ad380):_0x2ad380;fs[_0x6d7a81(0x14f)](path[_0x6d7a81(0x11d)](this['logsDir'],_0x5e599d+'.raw.txt'),_0x5764db,_0x6d7a81(0x17a)),fs['writeFileSync'](path[_0x6d7a81(0x11d)](this[_0x6d7a81(0x157)],_0x5e599d+_0x6d7a81(0x14c)),_0x20c5a9,_0x6d7a81(0x17a));}catch{}let _0x223e36=_0xcd4c73;if(_0xcd4c73[_0x6d7a81(0x12c)](_0x6d7a81(0xea))){const _0x218bd8=_0xcd4c73[_0x6d7a81(0xf4)](':')[0x1]||_0x6d7a81(0xfc),_0x3fa042=_0x218bd8['charAt'](0x0)[_0x6d7a81(0x175)]()+_0x218bd8[_0x6d7a81(0x18c)](0x1);_0x223e36=_0x3fa042+_0x6d7a81(0x11a);}else{if(_0xcd4c73[_0x6d7a81(0x12c)](_0x6d7a81(0x127))){const _0x6b514=_0xcd4c73[_0x6d7a81(0xf4)]('\x20'),_0x36c52a=_0x6b514[0x0][_0x6d7a81(0xf4)](':')[0x1]||_0x6d7a81(0xfc),_0x59e639=_0x36c52a['charAt'](0x0)[_0x6d7a81(0x175)]()+_0x36c52a[_0x6d7a81(0x18c)](0x1),_0x449bd9=_0x6b514[_0x6d7a81(0x18c)](0x1)[_0x6d7a81(0x11d)]('\x20');_0x223e36=_0x59e639+_0x6d7a81(0x150)+_0x449bd9;}else{const _0xddcbec=_0xcd4c73[_0x6d7a81(0xf4)]('\x20')[0x0]||_0x6d7a81(0xf5);_0x223e36=_0x30bf1a[_0x6d7a81(0x12e)]?_0x30bf1a[_0x6d7a81(0x177)]?_0x30bf1a[_0x6d7a81(0x12e)]+'-'+_0x30bf1a['modelShort']+'-'+_0xddcbec:_0x30bf1a[_0x6d7a81(0x12e)]+'-'+_0xddcbec:_0xddcbec;}}const _0x16e462={'id':_0x5e599d,'timestamp':new Date()['toISOString'](),'command':_0x223e36,'raw_chars':_0x5b497c,'compressed_chars':_0x13c6f0,'estimated_raw_tokens':_0x3fd521,'estimated_compressed_tokens':_0x39d1a3,'tokens_saved':_0x3ef64e,'model_used':_0x2f0796,'tool':_0x4b2298||_0x30bf1a[_0x6d7a81(0x12e)]||'','exit_code':_0x1a113d,'synced':![],'ai_detected':!!_0x30bf1a[_0x6d7a81(0x12e)],'secrets_found':_0x3dff6a?.[_0x6d7a81(0x10c)]||0x0,'secret_types':_0x3dff6a?.['secretTypes']||[],'features':_0x11f7dc||[]};_0xa472cc[_0x6d7a81(0x15d)](_0x16e462),this[_0x6d7a81(0x18b)](this[_0x6d7a81(0x108)](_0xa472cc));const _0x36ab77=this[_0x6d7a81(0x142)]()['telemetry_url'];return _0x36ab77&&_0x36ab77[_0x6d7a81(0xf0)]()[_0x6d7a81(0x165)]>0x0&&this[_0x6d7a81(0x13c)](),_0x3dff6a&&_0x3dff6a[_0x6d7a81(0x10c)]>0x0&&this['sendSecurityAlert'](_0x16e462,_0x3dff6a),_0x16e462;}[a0_0x2cc95b(0x17c)]=null;['getDevIdentity'](){const _0x2c11d7=a0_0x2cc95b;if(this[_0x2c11d7(0x17c)])return this[_0x2c11d7(0x17c)];try{const _0x29a8e7=require('child_process')[_0x2c11d7(0x172)]('git\x20config\x20user.email',{'stdio':['ignore','pipe',_0x2c11d7(0x128)],'windowsHide':!![]})[_0x2c11d7(0x189)]()[_0x2c11d7(0xf0)]();if(_0x29a8e7&&_0x29a8e7[_0x2c11d7(0x16f)]('@'))return this[_0x2c11d7(0x17c)]=_0x29a8e7,_0x29a8e7;}catch{}try{const _0x42e3db=require('os')[_0x2c11d7(0x18d)]()[_0x2c11d7(0x134)];return this[_0x2c11d7(0x17c)]=_0x42e3db,_0x42e3db;}catch{}return this[_0x2c11d7(0x17c)]=_0x2c11d7(0xf5),_0x2c11d7(0xf5);}[a0_0x2cc95b(0x164)](_0x29f6a5,_0x500074){const _0x4d5368=a0_0x2cc95b;try{let _0x1ae1d6=this[_0x4d5368(0x142)]()[_0x4d5368(0x115)]||'';if(!_0x1ae1d6)return;_0x1ae1d6=_0x1ae1d6['replace'](/\/api\/telemetry\/?$/,_0x4d5368(0xfa));if(!_0x1ae1d6[_0x4d5368(0x16f)]('/api/security/alert'))_0x1ae1d6+=_0x4d5368(0xfa);const _0x73adbf=this[_0x4d5368(0x103)](),_0x3c494f=JSON[_0x4d5368(0xeb)]({'developer_id':_0x73adbf,'timestamp':_0x29f6a5[_0x4d5368(0x16a)],'command':_0x29f6a5[_0x4d5368(0xe9)],'secrets_found':_0x500074[_0x4d5368(0x10c)],'secret_types':_0x500074[_0x4d5368(0x111)],'os':require('os')['platform']()}),_0x16b457='const\x20h=require(require(\x27url\x27).parse('+JSON['stringify'](_0x1ae1d6)+_0x4d5368(0x182)+JSON[_0x4d5368(0xeb)](_0x1ae1d6)+',{method:\x27POST\x27,headers:{\x27Content-Type\x27:\x27application/json\x27}},()=>{});r.on(\x27error\x27,()=>{});r.end('+JSON[_0x4d5368(0xeb)](_0x3c494f)+')',_0x14b678=(0x0,child_process_1[_0x4d5368(0x152)])(process[_0x4d5368(0x181)],['-e',_0x16b457],{'detached':!![],'stdio':_0x4d5368(0x128),'windowsHide':!![]});_0x14b678[_0x4d5368(0x124)]();}catch{}}[a0_0x2cc95b(0x13c)](){const _0x300b33=a0_0x2cc95b;try{const _0x25cb9b=path['join'](__dirname,_0x300b33(0xff));if(fs[_0x300b33(0x183)](_0x25cb9b)){const _0x2993d2=(0x0,child_process_1[_0x300b33(0x152)])(process[_0x300b33(0x181)],[_0x25cb9b],{'detached':!![],'stdio':_0x300b33(0x128),'windowsHide':!![]});_0x2993d2['unref']();}}catch{}}[a0_0x2cc95b(0x187)](_0x2821ff=a0_0x2cc95b(0xfe)){const _0x19791f=a0_0x2cc95b,_0x1b465f=this[_0x19791f(0x123)]();let _0x576691=0x0,_0x2d781b=0x0,_0x1acac8=0x0;for(const _0x557149 of _0x1b465f){_0x576691+=_0x557149[_0x19791f(0xf6)],_0x2d781b+=_0x557149[_0x19791f(0x151)],_0x1acac8+=_0x557149[_0x19791f(0x145)];}const _0x5ecefe=this[_0x19791f(0x142)]()[_0x19791f(0xf1)];_0x5ecefe&&(_0x576691+=_0x5ecefe[_0x19791f(0x161)]||0x0,_0x2d781b+=_0x5ecefe[_0x19791f(0x174)]||0x0,_0x1acac8+=_0x5ecefe['tokens_saved']||0x0);let _0x1914a8=_0x2821ff;(!_0x1914a8||_0x1914a8===_0x19791f(0xfe)||!exports[_0x19791f(0x178)][_0x1914a8])&&(_0x1b465f[_0x19791f(0x165)]>0x0&&_0x1b465f[_0x1b465f[_0x19791f(0x165)]-0x1][_0x19791f(0x10e)]?_0x1914a8=_0x1b465f[_0x1b465f[_0x19791f(0x165)]-0x1][_0x19791f(0x10e)]:_0x1914a8=this['getConfig']()[_0x19791f(0x158)]||_0x19791f(0x162));const _0x137b64=exports[_0x19791f(0x178)][_0x1914a8]||exports[_0x19791f(0x178)][_0x19791f(0x162)],_0x540e8e=_0x1acac8*_0x137b64['input_price_1m']/0xf4240,_0x5ab517=_0x576691*_0x137b64[_0x19791f(0x141)]/0xf4240,_0x2a946f=_0x2d781b*_0x137b64['input_price_1m']/0xf4240,_0x204373=_0x576691>0x0?_0x1acac8/_0x576691*0x64:0x0;return{'total_raw_tokens':_0x576691,'total_compressed_tokens':_0x2d781b,'total_tokens_saved':_0x1acac8,'savings_percentage':parseFloat(_0x204373['toFixed'](0x1)),'money_saved_usd':parseFloat(_0x540e8e['toFixed'](0x4)),'raw_cost_usd':parseFloat(_0x5ab517[_0x19791f(0x135)](0x4)),'compressed_cost_usd':parseFloat(_0x2a946f[_0x19791f(0x135)](0x4)),'model_name':_0x137b64[_0x19791f(0x18a)],'model_key':_0x1914a8};}}exports[a0_0x2cc95b(0x132)]=Tracker,exports[a0_0x2cc95b(0x107)]=new Tracker();
|
|
1
|
+
'use strict';const a0_0x2fc432=a0_0x858d;(function(_0x534ce2,_0x492faf){const _0x2a43c4=a0_0x858d,_0x262568=_0x534ce2();while(!![]){try{const _0x3ad4f3=-parseInt(_0x2a43c4(0x21a))/0x1*(-parseInt(_0x2a43c4(0x1ef))/0x2)+-parseInt(_0x2a43c4(0x1a1))/0x3*(-parseInt(_0x2a43c4(0x214))/0x4)+-parseInt(_0x2a43c4(0x1cc))/0x5*(parseInt(_0x2a43c4(0x1e1))/0x6)+parseInt(_0x2a43c4(0x24e))/0x7*(parseInt(_0x2a43c4(0x1c9))/0x8)+parseInt(_0x2a43c4(0x255))/0x9+parseInt(_0x2a43c4(0x1fd))/0xa+-parseInt(_0x2a43c4(0x1ac))/0xb*(parseInt(_0x2a43c4(0x1a8))/0xc);if(_0x3ad4f3===_0x492faf)break;else _0x262568['push'](_0x262568['shift']());}catch(_0x5baa07){_0x262568['push'](_0x262568['shift']());}}}(a0_0x5cb0,0xc5847));var __createBinding=this&&this[a0_0x2fc432(0x1d1)]||(Object[a0_0x2fc432(0x20b)]?function(_0x1d6bfa,_0x490fb5,_0x17b462,_0x3bb0d7){const _0x3d0ee4=a0_0x2fc432;if(_0x3bb0d7===undefined)_0x3bb0d7=_0x17b462;var _0x11ce8b=Object['getOwnPropertyDescriptor'](_0x490fb5,_0x17b462);(!_0x11ce8b||(_0x3d0ee4(0x1ad)in _0x11ce8b?!_0x490fb5[_0x3d0ee4(0x1b7)]:_0x11ce8b['writable']||_0x11ce8b['configurable']))&&(_0x11ce8b={'enumerable':!![],'get':function(){return _0x490fb5[_0x17b462];}}),Object['defineProperty'](_0x1d6bfa,_0x3bb0d7,_0x11ce8b);}:function(_0x375840,_0x27b153,_0x9cf2ee,_0x1f3113){if(_0x1f3113===undefined)_0x1f3113=_0x9cf2ee;_0x375840[_0x1f3113]=_0x27b153[_0x9cf2ee];}),__setModuleDefault=this&&this[a0_0x2fc432(0x1fe)]||(Object[a0_0x2fc432(0x20b)]?function(_0x2721ec,_0x16a1ad){const _0x4542b6=a0_0x2fc432;Object[_0x4542b6(0x22b)](_0x2721ec,_0x4542b6(0x1b4),{'enumerable':!![],'value':_0x16a1ad});}:function(_0x46e73b,_0x2fb93e){_0x46e73b['default']=_0x2fb93e;}),__importStar=this&&this[a0_0x2fc432(0x1bf)]||(function(){var _0x1f76cf=function(_0x2bd9d9){const _0x542eff=a0_0x858d;return _0x1f76cf=Object[_0x542eff(0x206)]||function(_0x24b542){const _0x58afc1=_0x542eff;var _0x4767e1=[];for(var _0x2f4bb5 in _0x24b542)if(Object[_0x58afc1(0x252)]['hasOwnProperty'][_0x58afc1(0x1bd)](_0x24b542,_0x2f4bb5))_0x4767e1[_0x4767e1[_0x58afc1(0x223)]]=_0x2f4bb5;return _0x4767e1;},_0x1f76cf(_0x2bd9d9);};return function(_0x51fe4d){const _0x5a988d=a0_0x858d;if(_0x51fe4d&&_0x51fe4d[_0x5a988d(0x1b7)])return _0x51fe4d;var _0xe3844d={};if(_0x51fe4d!=null){for(var _0x84b737=_0x1f76cf(_0x51fe4d),_0x4c103e=0x0;_0x4c103e<_0x84b737[_0x5a988d(0x223)];_0x4c103e++)if(_0x84b737[_0x4c103e]!==_0x5a988d(0x1b4))__createBinding(_0xe3844d,_0x51fe4d,_0x84b737[_0x4c103e]);}return __setModuleDefault(_0xe3844d,_0x51fe4d),_0xe3844d;};}());Object['defineProperty'](exports,a0_0x2fc432(0x1b7),{'value':!![]}),exports[a0_0x2fc432(0x22d)]=exports['Tracker']=exports[a0_0x2fc432(0x221)]=void 0x0,exports['detectSessionTool']=detectSessionTool;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x2fc432(0x1cf))),os=__importStar(require('os')),child_process_1=require('child_process');exports['PRICING']={'claude-fable-5':{'name':a0_0x2fc432(0x1ab),'input_price_1m':0xa},'claude-mythos-5':{'name':a0_0x2fc432(0x1f5),'input_price_1m':0xa},'claude-opus-4-8':{'name':a0_0x2fc432(0x245),'input_price_1m':0x5},'claude-opus-4-7':{'name':a0_0x2fc432(0x1c0),'input_price_1m':0x5},'claude-opus-4-5':{'name':a0_0x2fc432(0x24b),'input_price_1m':0x5},'claude-opus-4-1':{'name':a0_0x2fc432(0x1e4),'input_price_1m':0xf},'claude-sonnet-4-6':{'name':a0_0x2fc432(0x23d),'input_price_1m':0x3},'claude-sonnet-4-5':{'name':a0_0x2fc432(0x1da),'input_price_1m':0x3},'claude-3-5-sonnet':{'name':a0_0x2fc432(0x222),'input_price_1m':0x3},'claude-haiku-4-5':{'name':a0_0x2fc432(0x1f7),'input_price_1m':0x1},'claude-haiku-3-5':{'name':a0_0x2fc432(0x1b6),'input_price_1m':0.8},'gpt-5-5':{'name':a0_0x2fc432(0x1c7),'input_price_1m':0x5},'gpt-5-4':{'name':a0_0x2fc432(0x251),'input_price_1m':2.5},'gpt-4o':{'name':a0_0x2fc432(0x1a6),'input_price_1m':2.5},'gpt-5-4-mini':{'name':a0_0x2fc432(0x1b5),'input_price_1m':0.75},'gpt-5-4-nano':{'name':a0_0x2fc432(0x1a0),'input_price_1m':0.2},'gpt-4-1-mini':{'name':a0_0x2fc432(0x253),'input_price_1m':0.4},'gpt-4-1-nano':{'name':a0_0x2fc432(0x23e),'input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0x2fc432(0x1af),'input_price_1m':0.15},'o1':{'name':a0_0x2fc432(0x1d7),'input_price_1m':0xf},'o1-mini':{'name':a0_0x2fc432(0x249),'input_price_1m':0x3},'o3-mini':{'name':a0_0x2fc432(0x234),'input_price_1m':1.1},'cursor-small':{'name':a0_0x2fc432(0x1ae),'input_price_1m':0.1},'gemini-3-1-pro':{'name':'Gemini\x203.1\x20Pro','input_price_1m':0x2},'gemini-3-5-flash':{'name':'Gemini\x203.5\x20Flash','input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':a0_0x2fc432(0x1ba),'input_price_1m':0.45},'gemini-3-5-live-translate':{'name':a0_0x2fc432(0x209),'input_price_1m':3.5}};function a0_0x858d(_0xf4926b,_0x1b1952){_0xf4926b=_0xf4926b-0x19f;const _0x5cb0b5=a0_0x5cb0();let _0x858d10=_0x5cb0b5[_0xf4926b];return _0x858d10;}function detectSessionTool(){const _0x4355ff=a0_0x2fc432,_0x206865=process.env,_0x13dd20={'tool':'','model':_0x4355ff(0x1ea),'modelShort':''};if(_0x206865[_0x4355ff(0x237)]&&exports[_0x4355ff(0x221)][_0x206865[_0x4355ff(0x237)]])return{'tool':'','model':_0x206865['TRIMPROMPT_MODEL'],'modelShort':''};const _0x436c2e=(_0x206865[_0x4355ff(0x200)]||'')['toLowerCase']();if(_0x436c2e){if(_0x436c2e[_0x4355ff(0x241)]('claude-code')||_0x436c2e['includes'](_0x4355ff(0x1f3))){const _0x2ad4c9=_0x206865['CLAUDE_EFFORT']===_0x4355ff(0x226)?_0x4355ff(0x20e):_0x4355ff(0x23c),_0x265eb4=_0x206865[_0x4355ff(0x1ce)]===_0x4355ff(0x226)?_0x4355ff(0x217):_0x4355ff(0x1ea);return{'tool':'claude','model':_0x265eb4,'modelShort':_0x2ad4c9};}if(_0x436c2e['includes'](_0x4355ff(0x23f)))return{'tool':_0x4355ff(0x23f),'model':'claude-sonnet-4-6','modelShort':_0x4355ff(0x23c)};if(_0x436c2e[_0x4355ff(0x241)](_0x4355ff(0x1de))||_0x436c2e[_0x4355ff(0x241)](_0x4355ff(0x1d3))){const _0x5beb89=_0x206865[_0x4355ff(0x227)]||'';if(_0x5beb89&&exports[_0x4355ff(0x221)][_0x5beb89])return{'tool':'copilot','model':_0x5beb89,'modelShort':_0x5beb89[_0x4355ff(0x1ee)]('-')[_0x4355ff(0x1a9)]()||''};return{'tool':_0x4355ff(0x1d3),'model':'claude-sonnet-4-5','modelShort':_0x4355ff(0x23c)};}if(_0x436c2e[_0x4355ff(0x241)](_0x4355ff(0x1a3)))return{'tool':_0x4355ff(0x1a3),'model':'gemini-3-5-flash','modelShort':_0x4355ff(0x1fa)};if(_0x436c2e[_0x4355ff(0x241)](_0x4355ff(0x1d5)))return{'tool':'codex','model':'o3-mini','modelShort':_0x4355ff(0x1cd)};if(_0x436c2e[_0x4355ff(0x241)](_0x4355ff(0x1fc)))return{'tool':_0x4355ff(0x1fc),'model':_0x4355ff(0x1ea),'modelShort':''};if(_0x436c2e['includes'](_0x4355ff(0x243)))return{'tool':_0x4355ff(0x243),'model':'gemini-3-1-pro','modelShort':_0x4355ff(0x1a3)};if(_0x436c2e[_0x4355ff(0x241)](_0x4355ff(0x1e5))||_0x206865[_0x4355ff(0x1e2)])return{'tool':'replit','model':_0x4355ff(0x1ea),'modelShort':''};return{'tool':_0x436c2e['split']('_')[0x0][_0x4355ff(0x1ee)]('-')[0x0],'model':_0x4355ff(0x1ea),'modelShort':''};}if(_0x206865[_0x4355ff(0x1fb)]==='1'||_0x206865['CLAUDE_CODE']==='1'){const _0x4bf330=_0x206865[_0x4355ff(0x1ce)]===_0x4355ff(0x226)?'opus':_0x4355ff(0x23c),_0x26c480=_0x206865[_0x4355ff(0x1ce)]===_0x4355ff(0x226)?_0x4355ff(0x217):'claude-sonnet-4-6';return{'tool':'claude','model':_0x26c480,'modelShort':_0x4bf330};}if(_0x206865[_0x4355ff(0x239)]==='1')return{'tool':'cursor','model':'claude-sonnet-4-6','modelShort':_0x4355ff(0x23c)};if(_0x206865[_0x4355ff(0x210)]==='1')return{'tool':_0x4355ff(0x1a3),'model':_0x4355ff(0x1a2),'modelShort':_0x4355ff(0x1fa)};if(_0x206865[_0x4355ff(0x227)]||_0x206865[_0x4355ff(0x1e9)]){const _0x392151=_0x206865[_0x4355ff(0x227)]||'';if(_0x392151&&exports[_0x4355ff(0x221)][_0x392151])return{'tool':'copilot','model':_0x392151,'modelShort':_0x392151[_0x4355ff(0x1ee)]('-')[_0x4355ff(0x1a9)]()||''};return{'tool':'copilot','model':_0x4355ff(0x233),'modelShort':_0x4355ff(0x23c)};}if(_0x206865[_0x4355ff(0x1e2)]||_0x206865['REPLIT_ENVIRONMENT'])return{'tool':_0x4355ff(0x1e5),'model':_0x4355ff(0x1ea),'modelShort':''};if(_0x206865[_0x4355ff(0x1a5)])return{'tool':_0x4355ff(0x225),'model':'claude-sonnet-4-6','modelShort':''};if(_0x206865['CONTINUE_GLOBAL_DIR'])return{'tool':_0x4355ff(0x1f2),'model':'claude-sonnet-4-6','modelShort':''};if(_0x206865[_0x4355ff(0x1ff)]==='1')return{'tool':_0x4355ff(0x243),'model':_0x4355ff(0x1c5),'modelShort':_0x4355ff(0x1a3)};if(_0x206865[_0x4355ff(0x1ce)]){const _0x111e51=_0x206865['CLAUDE_EFFORT']===_0x4355ff(0x226)?_0x4355ff(0x20e):_0x4355ff(0x23c),_0x5af05e=_0x206865[_0x4355ff(0x1ce)]===_0x4355ff(0x226)?_0x4355ff(0x217):'claude-sonnet-4-6';return{'tool':'','model':_0x5af05e,'modelShort':''};}if(_0x206865['AIDER_MODEL']&&exports[_0x4355ff(0x221)][_0x206865['AIDER_MODEL']])return{'tool':'aider','model':_0x206865[_0x4355ff(0x213)],'modelShort':''};if(_0x206865['VSCODE_PID']){const _0x5892a3=(_0x206865[_0x4355ff(0x1dc)]||'')[_0x4355ff(0x1f4)]();if(_0x5892a3[_0x4355ff(0x241)]('cursor'))return{'tool':'cursor','model':_0x4355ff(0x1ea),'modelShort':'sonnet'};if(_0x5892a3[_0x4355ff(0x241)](_0x4355ff(0x204)))return{'tool':_0x4355ff(0x204),'model':'claude-sonnet-4-6','modelShort':_0x4355ff(0x23c)};}const _0x5b4049=process.env.TRIMPROMPT_MODEL||'';if(_0x5b4049&&exports['PRICING'][_0x5b4049])return{'tool':'','model':_0x5b4049,'modelShort':''};return _0x13dd20;}const MAX_LOGS_PER_TOOL=0x32;let globalLogsMemoryCache=[],globalLogsCacheMtime=-0x1;class Tracker{[a0_0x2fc432(0x229)];[a0_0x2fc432(0x231)];[a0_0x2fc432(0x247)];[a0_0x2fc432(0x1e0)];[a0_0x2fc432(0x21d)];constructor(){const _0x1f959c=a0_0x2fc432;this['baseDir']=path[_0x1f959c(0x1be)](os['homedir'](),_0x1f959c(0x22a)),this[_0x1f959c(0x231)]=path[_0x1f959c(0x1be)](this[_0x1f959c(0x229)],_0x1f959c(0x1c4)),this[_0x1f959c(0x247)]=path[_0x1f959c(0x1be)](this[_0x1f959c(0x229)],_0x1f959c(0x21b)),this[_0x1f959c(0x1e0)]=path[_0x1f959c(0x1be)](this[_0x1f959c(0x229)],_0x1f959c(0x211)),this[_0x1f959c(0x244)]();}[a0_0x2fc432(0x244)](){const _0x472ed7=a0_0x2fc432;!fs[_0x472ed7(0x1b0)](this[_0x472ed7(0x229)])&&fs[_0x472ed7(0x24f)](this[_0x472ed7(0x229)],{'recursive':!![]});!fs[_0x472ed7(0x1b0)](this['logsDir'])&&fs[_0x472ed7(0x24f)](this[_0x472ed7(0x1e0)],{'recursive':!![]});const _0x2472c2={'version':'1.0','telemetry_url':process.env.TRIMPROMPT_TELEMETRY_URL||'','max_output_tokens':0x1388,'redaction_enabled':!![],'default_model':_0x472ed7(0x217)};if(fs[_0x472ed7(0x1b0)](this[_0x472ed7(0x231)]))try{const _0x5b3e78=fs[_0x472ed7(0x232)](this[_0x472ed7(0x231)],_0x472ed7(0x248));this[_0x472ed7(0x21d)]={..._0x2472c2,...JSON[_0x472ed7(0x250)](_0x5b3e78)};}catch(_0x158a63){this[_0x472ed7(0x21d)]=_0x2472c2;}else this[_0x472ed7(0x21d)]=_0x2472c2,this[_0x472ed7(0x254)]();!fs['existsSync'](this[_0x472ed7(0x247)])&&fs[_0x472ed7(0x256)](this[_0x472ed7(0x247)],JSON['stringify']([]),'utf8');}[a0_0x2fc432(0x1d8)](){const _0x1d27b8=a0_0x2fc432;return process.env.TRIMPROMPT_TELEMETRY_URL&&(this[_0x1d27b8(0x21d)][_0x1d27b8(0x22c)]=process.env.TRIMPROMPT_TELEMETRY_URL),this[_0x1d27b8(0x21d)];}[a0_0x2fc432(0x218)](_0x45ca7e,_0x4a4f8a){const _0x49a820=a0_0x2fc432;this[_0x49a820(0x21d)][_0x45ca7e]=_0x4a4f8a,this[_0x49a820(0x254)]();}[a0_0x2fc432(0x254)](){const _0x12c669=a0_0x2fc432;fs[_0x12c669(0x256)](this[_0x12c669(0x231)],JSON[_0x12c669(0x22e)](this[_0x12c669(0x21d)],null,0x2),_0x12c669(0x248));}[a0_0x2fc432(0x1bc)](){const _0x4c6b8e=a0_0x2fc432;try{if(!fs[_0x4c6b8e(0x1b0)](this[_0x4c6b8e(0x247)]))return globalLogsMemoryCache;const _0x4152c2=fs[_0x4c6b8e(0x216)](this[_0x4c6b8e(0x247)])[_0x4c6b8e(0x23b)];if(_0x4152c2===globalLogsCacheMtime&&globalLogsMemoryCache[_0x4c6b8e(0x223)]>0x0)return globalLogsMemoryCache;const _0x234806=fs[_0x4c6b8e(0x232)](this[_0x4c6b8e(0x247)],_0x4c6b8e(0x248)),_0x152ac6=JSON['parse'](_0x234806);if(Array[_0x4c6b8e(0x1e6)](_0x152ac6))return globalLogsMemoryCache=_0x152ac6,globalLogsCacheMtime=_0x4152c2,_0x152ac6;}catch{}return globalLogsMemoryCache;}[a0_0x2fc432(0x1d0)](_0x11310e){const _0x49ae34=a0_0x2fc432;globalLogsMemoryCache=_0x11310e;const _0x200a1f=this['statsPath']+_0x49ae34(0x20a);try{fs[_0x49ae34(0x256)](_0x200a1f,JSON[_0x49ae34(0x22e)](_0x11310e,null,0x2),_0x49ae34(0x248)),fs['renameSync'](_0x200a1f,this[_0x49ae34(0x247)]);}catch{try{fs[_0x49ae34(0x256)](this['statsPath'],JSON[_0x49ae34(0x22e)](_0x11310e,null,0x2),'utf8');}catch{}}}[a0_0x2fc432(0x1c1)](_0x4069ce){const _0x359e08=a0_0x2fc432,_0x4b9e16=new Map();for(const _0x5589d1 of _0x4069ce){const _0x566fd3=_0x5589d1[_0x359e08(0x203)]&&_0x5589d1[_0x359e08(0x203)]['trim']()||_0x5589d1[_0x359e08(0x1aa)]||'other';let _0xdea91c=_0x4b9e16[_0x359e08(0x1ad)](_0x566fd3);!_0xdea91c&&(_0xdea91c=[],_0x4b9e16[_0x359e08(0x21e)](_0x566fd3,_0xdea91c)),_0xdea91c[_0x359e08(0x1ca)](_0x5589d1);}const _0x440835=new Set();for(const _0x54e8c0 of _0x4b9e16['values']()){const _0x5cfd28=_0x54e8c0[_0x359e08(0x223)]-MAX_LOGS_PER_TOOL;for(let _0x55683f=0x0;_0x55683f<_0x5cfd28;_0x55683f++)_0x440835[_0x359e08(0x24d)](_0x54e8c0[_0x55683f]['id']);}if(_0x440835['size']===0x0)return _0x4069ce;let _0x13e247={};try{_0x13e247=JSON[_0x359e08(0x250)](fs[_0x359e08(0x232)](this[_0x359e08(0x231)],_0x359e08(0x248)))||{};}catch{}const _0x10a162=_0x13e247['lifetime_savings']||{'raw_tokens':0x0,'compressed_tokens':0x0,'tokens_saved':0x0};for(const _0x57b7e2 of _0x4069ce){if(!_0x440835[_0x359e08(0x1a7)](_0x57b7e2['id']))continue;_0x10a162[_0x359e08(0x230)]+=_0x57b7e2[_0x359e08(0x212)]||0x0,_0x10a162['compressed_tokens']+=_0x57b7e2[_0x359e08(0x1eb)]||0x0,_0x10a162[_0x359e08(0x235)]+=_0x57b7e2['tokens_saved']||0x0;}_0x13e247['lifetime_savings']=_0x10a162,this[_0x359e08(0x21d)]={...this[_0x359e08(0x21d)],..._0x13e247};try{this[_0x359e08(0x254)]();}catch{}for(const _0xc698ab of _0x440835){try{fs[_0x359e08(0x242)](path[_0x359e08(0x1be)](this[_0x359e08(0x1e0)],_0xc698ab+_0x359e08(0x1a4)));}catch{}try{fs[_0x359e08(0x242)](path[_0x359e08(0x1be)](this[_0x359e08(0x1e0)],_0xc698ab+_0x359e08(0x1dd)));}catch{}}return _0x4069ce[_0x359e08(0x240)](_0x3d0623=>!_0x440835['has'](_0x3d0623['id']));}[a0_0x2fc432(0x202)](_0x4b0ed9,_0x2a803c,_0x2c3a35,_0x8f461,_0x36a74c,_0x342c9b){const _0x57ea25=a0_0x2fc432,_0x204211=this['getLogs'](),_0x5d59cd=_0x2a803c['length'],_0x164ca4=_0x2c3a35[_0x57ea25(0x223)],_0x22a9c3=detectSessionTool(),_0x20f604=_0x22a9c3[_0x57ea25(0x1f9)],_0x5476d4=_0x22a9c3[_0x57ea25(0x203)]==='antigravity'?_0x57ea25(0x1a3):_0x22a9c3[_0x57ea25(0x203)];let _0x2b6c5f=0x0;if(_0x5476d4&&!_0x4b0ed9[_0x57ea25(0x1c6)](_0x57ea25(0x201)))try{const {getLatestSessionFile:_0x2544a0,loadSessionsState:_0x112cf3}=require(_0x57ea25(0x1b2)),_0x56e5d7=_0x2544a0(_0x5476d4);if(_0x56e5d7&&_0x56e5d7['fullPath']){const _0x3ae36c=_0x112cf3();_0x3ae36c[_0x56e5d7['fullPath']]&&(_0x2b6c5f=_0x3ae36c[_0x56e5d7[_0x57ea25(0x1f0)]][_0x57ea25(0x1e3)]||0x0);}}catch{}const _0x3b7087=Math['ceil'](_0x5d59cd/0x4)+_0x2b6c5f,_0x29f382=Math['ceil'](_0x164ca4/0x4),_0x4cebe3=Math['max'](0x0,_0x3b7087-_0x29f382),_0x567b88=Math[_0x57ea25(0x1e7)]()[_0x57ea25(0x238)](0x24)[_0x57ea25(0x24c)](0x2,0xb);try{const {redactor:_0x215f68}=require('./redactor'),_0x5e69b7=_0x215f68?_0x215f68[_0x57ea25(0x246)](_0x2a803c):_0x2a803c;fs[_0x57ea25(0x256)](path['join'](this[_0x57ea25(0x1e0)],_0x567b88+_0x57ea25(0x1a4)),_0x5e69b7,'utf8'),fs[_0x57ea25(0x256)](path[_0x57ea25(0x1be)](this['logsDir'],_0x567b88+_0x57ea25(0x1dd)),_0x2c3a35,_0x57ea25(0x248));}catch{}let _0xb9f6a6=_0x4b0ed9;if(_0x4b0ed9[_0x57ea25(0x1c6)](_0x57ea25(0x201))){const _0x3f8d07=_0x4b0ed9[_0x57ea25(0x1ee)](':')[0x1]||'claude',_0x48f9fa=_0x3f8d07[_0x57ea25(0x1f1)](0x0)[_0x57ea25(0x220)]()+_0x3f8d07[_0x57ea25(0x22f)](0x1);_0xb9f6a6=_0x48f9fa+_0x57ea25(0x1d9);}else{if(_0x4b0ed9[_0x57ea25(0x1c6)](_0x57ea25(0x219))){const _0x1c4889=_0x4b0ed9[_0x57ea25(0x1ee)]('\x20'),_0x3906a4=_0x1c4889[0x0][_0x57ea25(0x1ee)](':')[0x1]||'claude',_0x36173a=_0x3906a4[_0x57ea25(0x1f1)](0x0)[_0x57ea25(0x220)]()+_0x3906a4[_0x57ea25(0x22f)](0x1),_0x1a0791=_0x1c4889[_0x57ea25(0x22f)](0x1)['join']('\x20');_0xb9f6a6=_0x36173a+'\x20Chat\x20'+_0x1a0791;}else{const _0x4d3c85=_0x4b0ed9[_0x57ea25(0x1ee)]('\x20')[0x0]||'unknown';_0xb9f6a6=_0x22a9c3['tool']?_0x22a9c3[_0x57ea25(0x1d2)]?_0x22a9c3[_0x57ea25(0x203)]+'-'+_0x22a9c3[_0x57ea25(0x1d2)]+'-'+_0x4d3c85:_0x22a9c3['tool']+'-'+_0x4d3c85:_0x4d3c85;}}const _0x299b88={'id':_0x567b88,'timestamp':new Date()['toISOString'](),'command':_0xb9f6a6,'raw_chars':_0x5d59cd,'compressed_chars':_0x164ca4,'estimated_raw_tokens':_0x3b7087,'estimated_compressed_tokens':_0x29f382,'tokens_saved':_0x4cebe3,'model_used':_0x20f604,'tool':_0x5476d4||_0x22a9c3['tool']||'','exit_code':_0x8f461,'synced':![],'ai_detected':!!_0x22a9c3[_0x57ea25(0x203)],'secrets_found':_0x36a74c?.[_0x57ea25(0x207)]||0x0,'secret_types':_0x36a74c?.['secretTypes']||[],'features':_0x342c9b||[]};_0x204211[_0x57ea25(0x1ca)](_0x299b88),this[_0x57ea25(0x1d0)](this[_0x57ea25(0x1c1)](_0x204211));const _0x21e8b9=this['getConfig']()['telemetry_url'];return _0x21e8b9&&_0x21e8b9[_0x57ea25(0x20d)]()['length']>0x0&&this[_0x57ea25(0x1ed)](),_0x36a74c&&_0x36a74c[_0x57ea25(0x207)]>0x0&&this['sendSecurityAlert'](_0x299b88,_0x36a74c),_0x299b88;}[a0_0x2fc432(0x1bb)]=null;[a0_0x2fc432(0x224)](){const _0x36433f=a0_0x2fc432;if(this['cachedDevId'])return this[_0x36433f(0x1bb)];try{const _0x5624d1=require(_0x36433f(0x1f8))[_0x36433f(0x1df)](_0x36433f(0x1c8),{'stdio':[_0x36433f(0x228),_0x36433f(0x236),_0x36433f(0x228)],'windowsHide':!![]})[_0x36433f(0x238)]()[_0x36433f(0x20d)]();if(_0x5624d1&&_0x5624d1[_0x36433f(0x241)]('@'))return this[_0x36433f(0x1bb)]=_0x5624d1,_0x5624d1;}catch{}try{const _0x36982a=require('os')['userInfo']()[_0x36433f(0x215)];return this[_0x36433f(0x1bb)]=_0x36982a,_0x36982a;}catch{}return this[_0x36433f(0x1bb)]=_0x36433f(0x1e8),_0x36433f(0x1e8);}[a0_0x2fc432(0x1f6)](_0x4794dd,_0x40b1e8){const _0x66fd4d=a0_0x2fc432;try{let _0x41ca64=this[_0x66fd4d(0x1d8)]()['telemetry_url']||'';if(!_0x41ca64)return;_0x41ca64=_0x41ca64[_0x66fd4d(0x1b8)](/\/api\/telemetry\/?$/,'/api/security/alert');if(!_0x41ca64['includes'](_0x66fd4d(0x21c)))_0x41ca64+=_0x66fd4d(0x21c);const _0x322989=this[_0x66fd4d(0x224)](),_0x28dded=JSON[_0x66fd4d(0x22e)]({'developer_id':_0x322989,'timestamp':_0x4794dd[_0x66fd4d(0x205)],'command':_0x4794dd[_0x66fd4d(0x20f)],'secrets_found':_0x40b1e8[_0x66fd4d(0x207)],'secret_types':_0x40b1e8[_0x66fd4d(0x24a)],'os':require('os')[_0x66fd4d(0x1b3)]()}),_0x53223b=_0x66fd4d(0x1b9)+JSON[_0x66fd4d(0x22e)](_0x41ca64)+_0x66fd4d(0x1c3)+JSON['stringify'](_0x41ca64)+_0x66fd4d(0x19f)+JSON['stringify'](_0x28dded)+')',_0xf551b8=(0x0,child_process_1['spawn'])(process[_0x66fd4d(0x1b1)],['-e',_0x53223b],{'detached':!![],'stdio':_0x66fd4d(0x228),'windowsHide':!![]});_0xf551b8[_0x66fd4d(0x1c2)]();}catch{}}[a0_0x2fc432(0x1ed)](){const _0x39926c=a0_0x2fc432;try{const _0x55c2ec=path[_0x39926c(0x1be)](__dirname,_0x39926c(0x1cb));if(fs[_0x39926c(0x1b0)](_0x55c2ec)){const _0x337fc7=(0x0,child_process_1[_0x39926c(0x20c)])(process[_0x39926c(0x1b1)],[_0x55c2ec],{'detached':!![],'stdio':'ignore','windowsHide':!![]});_0x337fc7[_0x39926c(0x1c2)]();}}catch{}}['getStatsSummary'](_0x42034f='auto'){const _0x4f7f5e=a0_0x2fc432,_0x2b9e9f=this[_0x4f7f5e(0x1bc)]();let _0x1022c6=0x0,_0x2dd6b7=0x0,_0x3f2b97=0x0;for(const _0x29f8d0 of _0x2b9e9f){_0x1022c6+=_0x29f8d0[_0x4f7f5e(0x212)],_0x2dd6b7+=_0x29f8d0[_0x4f7f5e(0x1eb)],_0x3f2b97+=_0x29f8d0[_0x4f7f5e(0x235)];}const _0x2eb106=this[_0x4f7f5e(0x1d8)]()['lifetime_savings'];_0x2eb106&&(_0x1022c6+=_0x2eb106['raw_tokens']||0x0,_0x2dd6b7+=_0x2eb106[_0x4f7f5e(0x23a)]||0x0,_0x3f2b97+=_0x2eb106['tokens_saved']||0x0);let _0x3ce75c=_0x42034f;(!_0x3ce75c||_0x3ce75c===_0x4f7f5e(0x208)||!exports['PRICING'][_0x3ce75c])&&(_0x2b9e9f[_0x4f7f5e(0x223)]>0x0&&_0x2b9e9f[_0x2b9e9f['length']-0x1][_0x4f7f5e(0x1aa)]?_0x3ce75c=_0x2b9e9f[_0x2b9e9f[_0x4f7f5e(0x223)]-0x1][_0x4f7f5e(0x1aa)]:_0x3ce75c=this[_0x4f7f5e(0x1d8)]()[_0x4f7f5e(0x1db)]||'claude-3-5-sonnet');const _0x276873=exports['PRICING'][_0x3ce75c]||exports[_0x4f7f5e(0x221)][_0x4f7f5e(0x1d4)],_0x506737=_0x3f2b97*_0x276873[_0x4f7f5e(0x1d6)]/0xf4240,_0x1f8333=_0x1022c6*_0x276873[_0x4f7f5e(0x1d6)]/0xf4240,_0x4bc7c8=_0x2dd6b7*_0x276873[_0x4f7f5e(0x1d6)]/0xf4240,_0x2d52df=_0x1022c6>0x0?_0x3f2b97/_0x1022c6*0x64:0x0;return{'total_raw_tokens':_0x1022c6,'total_compressed_tokens':_0x2dd6b7,'total_tokens_saved':_0x3f2b97,'savings_percentage':parseFloat(_0x2d52df[_0x4f7f5e(0x21f)](0x1)),'money_saved_usd':parseFloat(_0x506737[_0x4f7f5e(0x21f)](0x4)),'raw_cost_usd':parseFloat(_0x1f8333['toFixed'](0x4)),'compressed_cost_usd':parseFloat(_0x4bc7c8[_0x4f7f5e(0x21f)](0x4)),'model_name':_0x276873['name'],'model_key':_0x3ce75c};}}function a0_0x5cb0(){const _0x593850=['estimated_compressed_tokens','Tracker','triggerBackgroundSync','split','15270kjFRPT','fullPath','charAt','continue','claude_code','toLowerCase','Claude\x20Mythos\x205','sendSecurityAlert','Claude\x20Haiku\x204.5','child_process','model','flash','CLAUDECODE','devin','2464840JYxgZE','__setModuleDefault','ANTIGRAVITY_AGENT','AI_AGENT','compact:','logExecution','tool','windsurf','timestamp','getOwnPropertyNames','secretsFound','auto','Gemini\x203.5\x20Live\x20Translate','.tmp','create','spawn','trim','opus','command','GEMINI_CLI','logs','estimated_raw_tokens','AIDER_MODEL','4bKkTXh','username','statSync','claude-opus-4-8','setConfig','conv:','115etLirX','stats.json','/api/security/alert','config','set','toFixed','toUpperCase','PRICING','Claude\x203.5\x20Sonnet','length','getDevIdentity','cline','high','COPILOT_MODEL','ignore','baseDir','.trimprompt','defineProperty','telemetry_url','tracker','stringify','slice','raw_tokens','configPath','readFileSync','claude-sonnet-4-5','OpenAI\x20o3-mini','tokens_saved','pipe','TRIMPROMPT_MODEL','toString','CURSOR_AGENT','compressed_tokens','mtimeMs','sonnet','Claude\x20Sonnet\x204.6','GPT-4.1\x20Nano','cursor','filter','includes','unlinkSync','antigravity','init','Claude\x20Opus\x204.8','redact','statsPath','utf8','OpenAI\x20o1-mini','secretTypes','Claude\x20Opus\x204.5','substring','add','63266xSFUyl','mkdirSync','parse','GPT-5.4','prototype','GPT-4.1\x20Mini','saveConfig','10489932wGAYyy','writeFileSync',',{method:\x27POST\x27,headers:{\x27Content-Type\x27:\x27application/json\x27}},()=>{});r.on(\x27error\x27,()=>{});r.end(','GPT-5.4\x20Nano','3927675zKtwYW','gemini-3-5-flash','gemini','.raw.txt','CLINE_DATA_DIR','GPT-4o','has','168rvCTpr','pop','model_used','Claude\x20Fable\x205','2787290kUNQHY','get','Cursor\x20Small','GPT-4o\x20Mini','existsSync','execPath','./file-watcher','platform','default','GPT-5.4\x20Mini','Claude\x20Haiku\x203.5','__esModule','replace','const\x20h=require(require(\x27url\x27).parse(','Gemini\x203.1\x20Flash-Lite','cachedDevId','getLogs','call','join','__importStar','Claude\x20Opus\x204.7','pruneLogsPerTool','unref',').protocol===\x27https:\x27?\x27https\x27:\x27http\x27);const\x20r=h.request(','config.json','gemini-3-1-pro','startsWith','GPT-5.5','git\x20config\x20user.email','848vjxFgn','push','sync.js','2045rjHUWK','o3mini','CLAUDE_EFFORT','path','saveLogs','__createBinding','modelShort','copilot','claude-3-5-sonnet','codex','input_price_1m','OpenAI\x20o1','getConfig','\x20Compaction','Claude\x20Sonnet\x204.5','default_model','PATH','.comp.txt','github-copilot','execSync','logsDir','2946OjDYlH','REPL_ID','activeSavedTokens','Claude\x20Opus\x204.1\x20(deprecated)','replit','isArray','random','unknown','COPILOT_GITHUB_TOKEN','claude-sonnet-4-6'];a0_0x5cb0=function(){return _0x593850;};return a0_0x5cb0();}exports[a0_0x2fc432(0x1ec)]=Tracker,exports['tracker']=new Tracker();
|