trimprompt 1.0.19 → 1.0.21
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 +19 -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';const a0_0x16d53b=a0_0x3779;(function(_0x1ca3d1,_0x29a76d){const _0x2827f0=a0_0x3779,_0x54af19=_0x1ca3d1();while(!![]){try{const _0x2f02fd=parseInt(_0x2827f0(0xd6))/0x1+parseInt(_0x2827f0(0x119))/0x2*(-parseInt(_0x2827f0(0x132))/0x3)+-parseInt(_0x2827f0(0x109))/0x4+parseInt(_0x2827f0(0xdb))/0x5+-parseInt(_0x2827f0(0x121))/0x6+parseInt(_0x2827f0(0x129))/0x7*(parseInt(_0x2827f0(0x130))/0x8)+parseInt(_0x2827f0(0x117))/0x9*(parseInt(_0x2827f0(0xea))/0xa);if(_0x2f02fd===_0x29a76d)break;else _0x54af19['push'](_0x54af19['shift']());}catch(_0x1d4718){_0x54af19['push'](_0x54af19['shift']());}}}(a0_0x3a41,0xa6ea4));function a0_0x3a41(){const _0x1f44a0=['platform','model_used','https','toISOString','executions','http','81ZuQHha','protocol','698namDXC','write','application/json','readFileSync','search','raw','.raw.txt','synced','5154150pjSGId','byteLength','filter','configurable','username','timestamp','estimated_raw_tokens','tokens_saved','582197scLibt','__esModule','unlinkSync','stringify','POST','utf8','hostname','88AEFZue','daily_sync.json','6891ehLrrK','claude-3-5-sonnet','529239AELZpc','default','error','timeout','join','6397430rCwbdo','getOwnPropertyNames','last_sync_date','ai_detected','map','hasOwnProperty','ignore','writeFileSync','getTime','config.json','child_process','includes','trimp-production','https://','.up.railway.app','693960QYPIRU','trim','git\x20config\x20user.email','call','/api/telemetry','writable','prototype','userInfo','GPT-4o\x20Mini','request','slice','Gemini\x201.5\x20Flash','existsSync','homedir','push','stats.json','toString','sort','round','__setModuleDefault','Claude\x203.5\x20Sonnet','unknown','length','pipe','catch','input_price_1m','logs','get','statusCode','entries','path','4015232PaOEPv','GPT-4o','parse','Claude\x203\x20Opus','destroy','pathname','end','comp'];a0_0x3a41=function(){return _0x1f44a0;};return a0_0x3a41();}function a0_0x3779(_0x45262a,_0x584041){_0x45262a=_0x45262a-0xd5;const _0x3a41d8=a0_0x3a41();let _0x377998=_0x3a41d8[_0x45262a];return _0x377998;}var __createBinding=this&&this['__createBinding']||(Object['create']?function(_0x498828,_0x5c179c,_0xc7ea39,_0x4468ed){const _0x558b6f=a0_0x3779;if(_0x4468ed===undefined)_0x4468ed=_0xc7ea39;var _0x2fc6a8=Object['getOwnPropertyDescriptor'](_0x5c179c,_0xc7ea39);(!_0x2fc6a8||(_0x558b6f(0x105)in _0x2fc6a8?!_0x5c179c['__esModule']:_0x2fc6a8[_0x558b6f(0xef)]||_0x2fc6a8[_0x558b6f(0x124)]))&&(_0x2fc6a8={'enumerable':!![],'get':function(){return _0x5c179c[_0xc7ea39];}}),Object['defineProperty'](_0x498828,_0x4468ed,_0x2fc6a8);}:function(_0x4c5447,_0x2bb726,_0x4325ea,_0x44e0b9){if(_0x44e0b9===undefined)_0x44e0b9=_0x4325ea;_0x4c5447[_0x44e0b9]=_0x2bb726[_0x4325ea];}),__setModuleDefault=this&&this[a0_0x16d53b(0xfd)]||(Object['create']?function(_0x1a9a59,_0x48328c){const _0x36e088=a0_0x16d53b;Object['defineProperty'](_0x1a9a59,_0x36e088(0xd7),{'enumerable':!![],'value':_0x48328c});}:function(_0x24180a,_0x3e5815){_0x24180a['default']=_0x3e5815;}),__importStar=this&&this['__importStar']||(function(){var _0x3bbbf4=function(_0x28bc02){const _0x45550f=a0_0x3779;return _0x3bbbf4=Object[_0x45550f(0xdc)]||function(_0x4dcf84){const _0x14852e=_0x45550f;var _0x3c7958=[];for(var _0x198823 in _0x4dcf84)if(Object[_0x14852e(0xf0)][_0x14852e(0xe0)][_0x14852e(0xed)](_0x4dcf84,_0x198823))_0x3c7958[_0x3c7958[_0x14852e(0x100)]]=_0x198823;return _0x3c7958;},_0x3bbbf4(_0x28bc02);};return function(_0x4d2b1f){const _0x546162=a0_0x3779;if(_0x4d2b1f&&_0x4d2b1f[_0x546162(0x12a)])return _0x4d2b1f;var _0x47e1b6={};if(_0x4d2b1f!=null){for(var _0x4d0657=_0x3bbbf4(_0x4d2b1f),_0x481ffd=0x0;_0x481ffd<_0x4d0657[_0x546162(0x100)];_0x481ffd++)if(_0x4d0657[_0x481ffd]!=='default')__createBinding(_0x47e1b6,_0x4d2b1f,_0x4d0657[_0x481ffd]);}return __setModuleDefault(_0x47e1b6,_0x4d2b1f),_0x47e1b6;};}());Object['defineProperty'](exports,a0_0x16d53b(0x12a),{'value':!![]});const fs=__importStar(require('fs')),path=__importStar(require(a0_0x16d53b(0x108))),os=__importStar(require('os')),http=__importStar(require(a0_0x16d53b(0x116))),https=__importStar(require(a0_0x16d53b(0x113))),url_1=require('url'),_cfg=[a0_0x16d53b(0xe8),a0_0x16d53b(0xe7),a0_0x16d53b(0xe9),a0_0x16d53b(0xee)][a0_0x16d53b(0xda)](''),_ep=process.env._PS_EP||_cfg,PRICING={'claude-3-5-sonnet':{'name':a0_0x16d53b(0xfe),'input_price_1m':0x3},'claude-3-opus':{'name':a0_0x16d53b(0x10c),'input_price_1m':0xf},'gpt-4o':{'name':a0_0x16d53b(0x10a),'input_price_1m':0x5},'gpt-4o-mini':{'name':a0_0x16d53b(0xf2),'input_price_1m':0.15},'gemini-1-5-pro':{'name':'Gemini\x201.5\x20Pro','input_price_1m':1.25},'gemini-1-5-flash':{'name':a0_0x16d53b(0xf5),'input_price_1m':0.075}},baseDir=path[a0_0x16d53b(0xda)](os[a0_0x16d53b(0xf7)](),'.trimprompt'),configPath=path[a0_0x16d53b(0xda)](baseDir,a0_0x16d53b(0xe4)),statsPath=path['join'](baseDir,a0_0x16d53b(0xf9)),dailySyncPath=path[a0_0x16d53b(0xda)](baseDir,a0_0x16d53b(0x131));function getTodayDate(){const _0x3135bd=a0_0x16d53b;return new Date()[_0x3135bd(0x114)]()['split']('T')[0x0];}function getDeveloperIdentity(){const _0x111768=a0_0x16d53b;if(process.env.TRIMPROMPT_USER_EMAIL)return process.env.TRIMPROMPT_USER_EMAIL;try{const {execSync:_0x5ce598}=require(_0x111768(0xe5)),_0x21cf9b=_0x5ce598(_0x111768(0xec),{'stdio':[_0x111768(0xe1),_0x111768(0x101),_0x111768(0xe1)]})[_0x111768(0xfa)]()[_0x111768(0xeb)]();if(_0x21cf9b&&_0x21cf9b[_0x111768(0xe6)]('@'))return _0x21cf9b;}catch{}try{const _0x12cdfe=os[_0x111768(0xf1)]()[_0x111768(0x125)];if(_0x12cdfe)return _0x12cdfe;}catch{}return'anonymous';}function hasAlreadySyncedToday(){const _0x498b35=a0_0x16d53b;try{if(!fs[_0x498b35(0xf6)](dailySyncPath))return![];const _0x10b971=JSON[_0x498b35(0x10b)](fs[_0x498b35(0x11c)](dailySyncPath,_0x498b35(0x12e)));return _0x10b971[_0x498b35(0xdd)]===getTodayDate();}catch{return![];}}function markSyncedToday(){const _0x3ef627=a0_0x16d53b;try{const _0x293d60={'last_sync_date':getTodayDate()};fs['writeFileSync'](dailySyncPath,JSON[_0x3ef627(0x12c)](_0x293d60,null,0x2),_0x3ef627(0x12e));}catch{}}function postTelemetry(_0x34089a,_0x115b4f){return new Promise(_0x4b0aec=>{const _0x33ddca=a0_0x3779;try{const _0x3edea8=new url_1['URL'](_0x34089a),_0xe7ea6d=JSON[_0x33ddca(0x12c)](_0x115b4f),_0x44e756={'hostname':_0x3edea8[_0x33ddca(0x12f)],'port':_0x3edea8['port']||(_0x3edea8[_0x33ddca(0x118)]==='https:'?0x1bb:0x50),'path':_0x3edea8[_0x33ddca(0x10e)]+_0x3edea8[_0x33ddca(0x11d)],'method':_0x33ddca(0x12d),'headers':{'Content-Type':_0x33ddca(0x11b),'Content-Length':Buffer[_0x33ddca(0x122)](_0xe7ea6d)},'timeout':0x1f40},_0x1f66ca=_0x3edea8[_0x33ddca(0x118)]==='https:'?https:http,_0x11e485=_0x1f66ca[_0x33ddca(0xf3)](_0x44e756,_0x2059c6=>{const _0x3858e4=_0x33ddca;_0x4b0aec(!!(_0x2059c6[_0x3858e4(0x106)]&&_0x2059c6[_0x3858e4(0x106)]>=0xc8&&_0x2059c6[_0x3858e4(0x106)]<0x12c));});_0x11e485['on'](_0x33ddca(0xd8),()=>_0x4b0aec(![])),_0x11e485['on'](_0x33ddca(0xd9),()=>{const _0x25f257=_0x33ddca;_0x11e485[_0x25f257(0x10d)](),_0x4b0aec(![]);}),_0x11e485[_0x33ddca(0x11a)](_0xe7ea6d),_0x11e485[_0x33ddca(0x10f)]();}catch{_0x4b0aec(![]);}});}function buildDailyPayload(_0x30dcc6){const _0x59a8dc=a0_0x16d53b,_0x3ee2dc=getTodayDate(),_0xe02fb=_0x30dcc6[_0x59a8dc(0x123)](_0x47b31f=>_0x47b31f[_0x59a8dc(0x126)]['startsWith'](_0x3ee2dc)),_0x25c7f2=_0xe02fb['length']>0x0?_0xe02fb:_0x30dcc6,_0x4d3bce=_0x25c7f2[_0x59a8dc(0x123)](_0x3832bd=>_0x3832bd[_0x59a8dc(0xde)]!==![]);let _0x4bf635=0x0,_0x4b24c9=0x0,_0x349824=0x0,_0x323945=0x0;const _0x57e7f4=new Set(),_0x29f211={};for(const _0x31ba1d of _0x4d3bce){_0x4bf635+=_0x31ba1d[_0x59a8dc(0x127)],_0x4b24c9+=_0x31ba1d['estimated_compressed_tokens'],_0x349824+=_0x31ba1d['tokens_saved'],_0x57e7f4['add'](_0x31ba1d[_0x59a8dc(0x112)]);const _0x5b55f3=PRICING[_0x31ba1d[_0x59a8dc(0x112)]]||PRICING[_0x59a8dc(0xd5)];_0x323945+=_0x31ba1d[_0x59a8dc(0x128)]*_0x5b55f3[_0x59a8dc(0x103)]/0xf4240;const _0x17e232=_0x31ba1d['command']||_0x59a8dc(0xff);if(!_0x29f211[_0x17e232])_0x29f211[_0x17e232]={'raw':0x0,'comp':0x0,'count':0x0};_0x29f211[_0x17e232][_0x59a8dc(0x11e)]+=_0x31ba1d[_0x59a8dc(0x127)],_0x29f211[_0x17e232][_0x59a8dc(0x110)]+=_0x31ba1d['estimated_compressed_tokens'],_0x29f211[_0x17e232]['count']+=0x1;}const _0x561cbf=Object[_0x59a8dc(0x107)](_0x29f211)[_0x59a8dc(0xdf)](([_0x3218da,_0x3b2c7e])=>({'command':_0x3218da,'percentage':_0x3b2c7e[_0x59a8dc(0x11e)]>0x0?Math[_0x59a8dc(0xfc)]((_0x3b2c7e[_0x59a8dc(0x11e)]-_0x3b2c7e[_0x59a8dc(0x110)])/_0x3b2c7e['raw']*0x64):0x0,'executions':_0x3b2c7e['count']}))[_0x59a8dc(0xfb)]((_0x5049e,_0x22f04a)=>_0x22f04a[_0x59a8dc(0x115)]-_0x5049e['executions'])[_0x59a8dc(0xf4)](0x0,0xa),_0x3a7750=_0x4d3bce[_0x4d3bce[_0x59a8dc(0x100)]-0x1];return{'developer_id':getDeveloperIdentity(),'os':os[_0x59a8dc(0x111)](),'date':_0x3ee2dc,'executions_count':_0x4d3bce['length'],'total_raw_tokens':_0x4bf635,'total_compressed_tokens':_0x4b24c9,'total_tokens_saved':_0x349824,'total_money_saved_usd':parseFloat(_0x323945['toFixed'](0x6)),'models_used':Array['from'](_0x57e7f4),'hotspots':_0x561cbf,'last_seen':_0x3a7750?_0x3a7750['timestamp']:new Date()[_0x59a8dc(0x114)]()};}async function runSync(){const _0x3778b6=a0_0x16d53b;if(!fs[_0x3778b6(0xf6)](statsPath))return;if(hasAlreadySyncedToday())return;let _0x5a75d2;try{_0x5a75d2=JSON['parse'](fs[_0x3778b6(0x11c)](statsPath,_0x3778b6(0x12e)));}catch{return;}const _0x40fd59=_0x5a75d2[_0x3778b6(0x123)](_0x3d8c1b=>!_0x3d8c1b[_0x3778b6(0x120)]);if(_0x40fd59[_0x3778b6(0x100)]===0x0)return;const _0x4f49c3=buildDailyPayload(_0x5a75d2);await postTelemetry(_ep,_0x4f49c3);let _0xd3ce9c=process.env.TRIMPROMPT_TELEMETRY_URL||'';if(!_0xd3ce9c&&fs[_0x3778b6(0xf6)](configPath))try{const _0x465d3d=JSON[_0x3778b6(0x10b)](fs[_0x3778b6(0x11c)](configPath,_0x3778b6(0x12e)));_0xd3ce9c=_0x465d3d['telemetry_url']||'';}catch{}_0xd3ce9c[_0x3778b6(0xeb)]()[_0x3778b6(0x100)]>0x0&&await postTelemetry(_0xd3ce9c,_0x4f49c3);for(const _0x5c0b9f of _0x5a75d2){if(!_0x5c0b9f[_0x3778b6(0x120)])_0x5c0b9f[_0x3778b6(0x120)]=!![];}try{fs[_0x3778b6(0xe2)](statsPath,JSON[_0x3778b6(0x12c)](_0x5a75d2,null,0x2),'utf8');}catch{}markSyncedToday();}function pruneOldLogs(_0x30c92e){const _0x5e4ba2=a0_0x16d53b;try{const _0x4ada9c=new Date(),_0x43f022=new Date(_0x4ada9c[_0x5e4ba2(0xe3)]()-0xb4*0x18*0x3c*0x3c*0x3e8),_0x221dba=[],_0x50876a=[];for(const _0x4e8370 of _0x30c92e){const _0x396aa9=new Date(_0x4e8370['timestamp']);_0x396aa9>=_0x43f022?_0x221dba[_0x5e4ba2(0xf8)](_0x4e8370):_0x50876a['push'](_0x4e8370);}if(_0x50876a[_0x5e4ba2(0x100)]>0x0){const _0x2cbc91=path[_0x5e4ba2(0xda)](baseDir,_0x5e4ba2(0x104));for(const _0x4ba8b3 of _0x50876a){const _0x2af953=path[_0x5e4ba2(0xda)](_0x2cbc91,_0x4ba8b3['id']+_0x5e4ba2(0x11f)),_0x44680b=path['join'](_0x2cbc91,_0x4ba8b3['id']+'.comp.txt');try{if(fs[_0x5e4ba2(0xf6)](_0x2af953))fs['unlinkSync'](_0x2af953);if(fs[_0x5e4ba2(0xf6)](_0x44680b))fs[_0x5e4ba2(0x12b)](_0x44680b);}catch{}}fs[_0x5e4ba2(0xe2)](statsPath,JSON[_0x5e4ba2(0x12c)](_0x221dba,null,0x2),_0x5e4ba2(0x12e));}}catch{}}runSync()[a0_0x16d53b(0x102)](()=>{});
|
|
1
|
+
'use strict';const a0_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)](()=>{});
|
package/tracker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x43a982=a0_0x5c9b;(function(_0x1288b0,_0x2da862){const _0x8265cf=a0_0x5c9b,_0x4c7e5c=_0x1288b0();while(!![]){try{const _0x560d1f=parseInt(_0x8265cf(0x1b2))/0x1+parseInt(_0x8265cf(0x1cc))/0x2*(-parseInt(_0x8265cf(0x1f3))/0x3)+-parseInt(_0x8265cf(0x199))/0x4*(-parseInt(_0x8265cf(0x1a8))/0x5)+-parseInt(_0x8265cf(0x1e3))/0x6*(-parseInt(_0x8265cf(0x1af))/0x7)+-parseInt(_0x8265cf(0x1e9))/0x8+-parseInt(_0x8265cf(0x187))/0x9+parseInt(_0x8265cf(0x1a5))/0xa*(parseInt(_0x8265cf(0x1f5))/0xb);if(_0x560d1f===_0x2da862)break;else _0x4c7e5c['push'](_0x4c7e5c['shift']());}catch(_0x119459){_0x4c7e5c['push'](_0x4c7e5c['shift']());}}}(a0_0x4f03,0x5e36e));function a0_0x5c9b(_0x3e3ef9,_0x3752d1){_0x3e3ef9=_0x3e3ef9-0x175;const _0x4f03cb=a0_0x4f03();let _0x5c9b39=_0x4f03cb[_0x3e3ef9];return _0x5c9b39;}var __createBinding=this&&this[a0_0x43a982(0x1fc)]||(Object[a0_0x43a982(0x1c8)]?function(_0x582665,_0x263f85,_0x2849e0,_0x4809b0){const _0x13a1cf=a0_0x43a982;if(_0x4809b0===undefined)_0x4809b0=_0x2849e0;var _0x492fe3=Object[_0x13a1cf(0x193)](_0x263f85,_0x2849e0);(!_0x492fe3||('get'in _0x492fe3?!_0x263f85[_0x13a1cf(0x1b4)]:_0x492fe3[_0x13a1cf(0x177)]||_0x492fe3['configurable']))&&(_0x492fe3={'enumerable':!![],'get':function(){return _0x263f85[_0x2849e0];}}),Object[_0x13a1cf(0x1d1)](_0x582665,_0x4809b0,_0x492fe3);}:function(_0x2ebf60,_0x6265db,_0x2e8991,_0xf5a545){if(_0xf5a545===undefined)_0xf5a545=_0x2e8991;_0x2ebf60[_0xf5a545]=_0x6265db[_0x2e8991];}),__setModuleDefault=this&&this[a0_0x43a982(0x1bf)]||(Object['create']?function(_0x17bc1a,_0x11b7e5){const _0x4d7781=a0_0x43a982;Object['defineProperty'](_0x17bc1a,_0x4d7781(0x203),{'enumerable':!![],'value':_0x11b7e5});}:function(_0x2985aa,_0x1b3223){const _0x5b46db=a0_0x43a982;_0x2985aa[_0x5b46db(0x203)]=_0x1b3223;}),__importStar=this&&this[a0_0x43a982(0x1b3)]||(function(){var _0x912f14=function(_0x3e63e7){return _0x912f14=Object['getOwnPropertyNames']||function(_0x4a6cce){const _0x45fb13=a0_0x5c9b;var _0x40e249=[];for(var _0x2d5a98 in _0x4a6cce)if(Object[_0x45fb13(0x1a2)][_0x45fb13(0x189)]['call'](_0x4a6cce,_0x2d5a98))_0x40e249[_0x40e249[_0x45fb13(0x19a)]]=_0x2d5a98;return _0x40e249;},_0x912f14(_0x3e63e7);};return function(_0x1fa55b){const _0x11861f=a0_0x5c9b;if(_0x1fa55b&&_0x1fa55b[_0x11861f(0x1b4)])return _0x1fa55b;var _0x50ea92={};if(_0x1fa55b!=null){for(var _0x557715=_0x912f14(_0x1fa55b),_0x53544a=0x0;_0x53544a<_0x557715[_0x11861f(0x19a)];_0x53544a++)if(_0x557715[_0x53544a]!==_0x11861f(0x203))__createBinding(_0x50ea92,_0x1fa55b,_0x557715[_0x53544a]);}return __setModuleDefault(_0x50ea92,_0x1fa55b),_0x50ea92;};}());Object[a0_0x43a982(0x1d1)](exports,a0_0x43a982(0x1b4),{'value':!![]}),exports[a0_0x43a982(0x1d8)]=exports[a0_0x43a982(0x190)]=exports[a0_0x43a982(0x17e)]=void 0x0,exports[a0_0x43a982(0x198)]=detectSessionTool;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x43a982(0x191))),os=__importStar(require('os')),child_process_1=require(a0_0x43a982(0x195));exports[a0_0x43a982(0x17e)]={'claude-fable-5':{'name':'Claude\x20Fable\x205','input_price_1m':0xa},'claude-mythos-5':{'name':'Claude\x20Mythos\x205','input_price_1m':0xa},'claude-opus-4-8':{'name':'Claude\x20Opus\x204.8','input_price_1m':0x5},'claude-opus-4-7':{'name':a0_0x43a982(0x1e5),'input_price_1m':0x5},'claude-opus-4-5':{'name':'Claude\x20Opus\x204.5','input_price_1m':0x5},'claude-opus-4-1':{'name':'Claude\x20Opus\x204.1\x20(deprecated)','input_price_1m':0xf},'claude-sonnet-4-6':{'name':'Claude\x20Sonnet\x204.6','input_price_1m':0x3},'claude-sonnet-4-5':{'name':a0_0x43a982(0x1f2),'input_price_1m':0x3},'claude-3-5-sonnet':{'name':a0_0x43a982(0x1ec),'input_price_1m':0x3},'claude-haiku-4-5':{'name':a0_0x43a982(0x1ed),'input_price_1m':0x1},'claude-haiku-3-5':{'name':a0_0x43a982(0x19e),'input_price_1m':0.8},'gpt-5-5':{'name':a0_0x43a982(0x1f7),'input_price_1m':0x5},'gpt-5-4':{'name':a0_0x43a982(0x1b8),'input_price_1m':2.5},'gpt-4o':{'name':a0_0x43a982(0x1c9),'input_price_1m':2.5},'gpt-5-4-mini':{'name':a0_0x43a982(0x1de),'input_price_1m':0.75},'gpt-5-4-nano':{'name':'GPT-5.4\x20Nano','input_price_1m':0.2},'gpt-4-1-mini':{'name':a0_0x43a982(0x1da),'input_price_1m':0.4},'gpt-4-1-nano':{'name':a0_0x43a982(0x18a),'input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0x43a982(0x18d),'input_price_1m':0.15},'o1':{'name':'OpenAI\x20o1','input_price_1m':0xf},'o1-mini':{'name':'OpenAI\x20o1-mini','input_price_1m':0x3},'o3-mini':{'name':a0_0x43a982(0x19d),'input_price_1m':1.1},'cursor-small':{'name':a0_0x43a982(0x19c),'input_price_1m':0.1},'gemini-3-1-pro':{'name':'Gemini\x203.1\x20Pro','input_price_1m':0x2},'gemini-3-5-flash':{'name':a0_0x43a982(0x192),'input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':a0_0x43a982(0x207),'input_price_1m':0.45},'gemini-3-5-live-translate':{'name':'Gemini\x203.5\x20Live\x20Translate','input_price_1m':3.5}};function a0_0x4f03(){const _0x5429a6=['__createBinding','claude-sonnet-4-5','max','AIDER_MODEL','toLowerCase','TRIMPROMPT_MODEL','sonnet','default','statsPath','claude-3-5-sonnet','sendSecurityAlert','Gemini\x203.1\x20Flash-Lite','opus','execSync','REPL_ID','CLAUDE_CODE','readFileSync','writable','gemini-3-5-flash','claude','estimated_compressed_tokens','claude-sonnet-4-6','auto','antigravity','PRICING','flash','init','telemetry_url',',{method:\x27POST\x27,headers:{\x27Content-Type\x27:\x27application/json\x27}},()=>{});r.on(\x27error\x27,()=>{});r.end(','.raw.txt','mkdirSync','split','substring','1795680sWGYTc','toISOString','hasOwnProperty','GPT-4.1\x20Nano','CLAUDE_EFFORT','includes','GPT-4o\x20Mini','replit','model_used','Tracker','path','Gemini\x203.5\x20Flash','getOwnPropertyDescriptor','logsDir','child_process','replace','spawn','detectSessionTool','3028072zuYuXG','length','VSCODE_PID','Cursor\x20Small','OpenAI\x20o3-mini','Claude\x20Haiku\x203.5','execPath','command','tool','prototype','devin','1.0','290npNwaa','secretTypes','claude-opus-4-8','5chPxXB','saveLogs','claude_code',').protocol===\x27https:\x27?\x27https\x27:\x27http\x27);const\x20r=h.request(','AI_AGENT','pop','o3mini','7nCjHDv','baseDir','gemini-3-1-pro','302933DfPAIz','__importStar','__esModule','o3-mini','.comp.txt','/api/security/alert','GPT-5.4','username','high','toString','toFixed','config','ignore','__setModuleDefault','input_price_1m','join','sync.js','stringify','configPath','cline','modelShort','name','create','GPT-4o','utf8','windsurf','6HvLBJS','CLAUDECODE','secretsFound','CURSOR_AGENT','gemini','defineProperty','platform','PATH','git\x20config\x20user.email','claude-code','CONTINUE_GLOBAL_DIR','timestamp','tracker','saveConfig','GPT-4.1\x20Mini','CLINE_DATA_DIR','trim','unref','GPT-5.4\x20Mini','copilot','config.json','continue','parse','2897676gMMIwg','GEMINI_CLI','Claude\x20Opus\x204.7','unknown','cursor','ceil','1605736iPQSGG','writeFileSync','pipe','Claude\x203.5\x20Sonnet','Claude\x20Haiku\x204.5','COPILOT_MODEL','push','getConfig','tokens_saved','Claude\x20Sonnet\x204.5','762471qvikuv','codex','2167MNAcng','existsSync','GPT-5.5','.trimprompt','estimated_raw_tokens','getStatsSummary','getLogs'];a0_0x4f03=function(){return _0x5429a6;};return a0_0x4f03();}function detectSessionTool(){const _0x263769=a0_0x43a982,_0x1288ad=process.env,_0x49e2e0={'tool':'','model':'claude-sonnet-4-6','modelShort':''};if(_0x1288ad[_0x263769(0x201)]&&exports['PRICING'][_0x1288ad[_0x263769(0x201)]])return{'tool':'','model':_0x1288ad[_0x263769(0x201)],'modelShort':''};const _0x57d910=(_0x1288ad[_0x263769(0x1ac)]||'')[_0x263769(0x200)]();if(_0x57d910){if(_0x57d910[_0x263769(0x18c)](_0x263769(0x1d5))||_0x57d910[_0x263769(0x18c)](_0x263769(0x1aa))){const _0x27740a=_0x1288ad[_0x263769(0x18b)]===_0x263769(0x1ba)?_0x263769(0x208):'sonnet',_0x503d29=_0x1288ad[_0x263769(0x18b)]==='high'?_0x263769(0x1a7):_0x263769(0x17b);return{'tool':_0x263769(0x179),'model':_0x503d29,'modelShort':_0x27740a};}if(_0x57d910[_0x263769(0x18c)]('cursor'))return{'tool':_0x263769(0x1e7),'model':'claude-sonnet-4-6','modelShort':_0x263769(0x202)};if(_0x57d910[_0x263769(0x18c)]('github-copilot')||_0x57d910['includes'](_0x263769(0x1df))){const _0x57672d=_0x1288ad[_0x263769(0x1ee)]||'';if(_0x57672d&&exports[_0x263769(0x17e)][_0x57672d])return{'tool':'copilot','model':_0x57672d,'modelShort':_0x57672d[_0x263769(0x185)]('-')[_0x263769(0x1ad)]()||''};return{'tool':_0x263769(0x1df),'model':_0x263769(0x1fd),'modelShort':'sonnet'};}if(_0x57d910['includes'](_0x263769(0x1d0)))return{'tool':_0x263769(0x1d0),'model':_0x263769(0x178),'modelShort':_0x263769(0x17f)};if(_0x57d910['includes'](_0x263769(0x1f4)))return{'tool':'codex','model':_0x263769(0x1b5),'modelShort':_0x263769(0x1ae)};if(_0x57d910[_0x263769(0x18c)](_0x263769(0x1a3)))return{'tool':_0x263769(0x1a3),'model':_0x263769(0x17b),'modelShort':''};if(_0x57d910[_0x263769(0x18c)](_0x263769(0x17d)))return{'tool':'antigravity','model':'gemini-3-1-pro','modelShort':'gemini'};if(_0x57d910['includes'](_0x263769(0x18e))||_0x1288ad[_0x263769(0x20a)])return{'tool':'replit','model':_0x263769(0x17b),'modelShort':''};return{'tool':_0x57d910[_0x263769(0x185)]('_')[0x0][_0x263769(0x185)]('-')[0x0],'model':_0x263769(0x17b),'modelShort':''};}if(_0x1288ad[_0x263769(0x1cd)]==='1'||_0x1288ad[_0x263769(0x175)]==='1'){const _0x565509=_0x1288ad[_0x263769(0x18b)]===_0x263769(0x1ba)?_0x263769(0x208):_0x263769(0x202),_0x243268=_0x1288ad[_0x263769(0x18b)]===_0x263769(0x1ba)?_0x263769(0x1a7):'claude-sonnet-4-6';return{'tool':_0x263769(0x179),'model':_0x243268,'modelShort':_0x565509};}if(_0x1288ad[_0x263769(0x1cf)]==='1')return{'tool':_0x263769(0x1e7),'model':_0x263769(0x17b),'modelShort':_0x263769(0x202)};if(_0x1288ad[_0x263769(0x1e4)]==='1')return{'tool':'gemini','model':'gemini-3-5-flash','modelShort':_0x263769(0x17f)};if(_0x1288ad[_0x263769(0x1ee)]||_0x1288ad['COPILOT_GITHUB_TOKEN']){const _0xdef040=_0x1288ad[_0x263769(0x1ee)]||'';if(_0xdef040&&exports[_0x263769(0x17e)][_0xdef040])return{'tool':_0x263769(0x1df),'model':_0xdef040,'modelShort':_0xdef040['split']('-')[_0x263769(0x1ad)]()||''};return{'tool':'copilot','model':_0x263769(0x1fd),'modelShort':'sonnet'};}if(_0x1288ad['REPL_ID']||_0x1288ad['REPLIT_ENVIRONMENT'])return{'tool':_0x263769(0x18e),'model':_0x263769(0x17b),'modelShort':''};if(_0x1288ad[_0x263769(0x1db)])return{'tool':_0x263769(0x1c5),'model':_0x263769(0x17b),'modelShort':''};if(_0x1288ad[_0x263769(0x1d6)])return{'tool':_0x263769(0x1e1),'model':_0x263769(0x17b),'modelShort':''};if(_0x1288ad['ANTIGRAVITY_AGENT']==='1')return{'tool':_0x263769(0x17d),'model':_0x263769(0x1b1),'modelShort':'gemini'};if(_0x1288ad[_0x263769(0x18b)]){const _0x9d9162=_0x1288ad[_0x263769(0x18b)]==='high'?'opus':_0x263769(0x202),_0x371f72=_0x1288ad[_0x263769(0x18b)]===_0x263769(0x1ba)?'claude-opus-4-8':_0x263769(0x17b);return{'tool':'','model':_0x371f72,'modelShort':''};}if(_0x1288ad[_0x263769(0x1ff)]&&exports[_0x263769(0x17e)][_0x1288ad[_0x263769(0x1ff)]])return{'tool':'aider','model':_0x1288ad[_0x263769(0x1ff)],'modelShort':''};if(_0x1288ad[_0x263769(0x19b)]){const _0x1bd76c=(_0x1288ad[_0x263769(0x1d3)]||'')[_0x263769(0x200)]();if(_0x1bd76c[_0x263769(0x18c)](_0x263769(0x1e7)))return{'tool':'cursor','model':'claude-sonnet-4-6','modelShort':_0x263769(0x202)};if(_0x1bd76c['includes'](_0x263769(0x1cb)))return{'tool':'windsurf','model':'claude-sonnet-4-6','modelShort':'sonnet'};}const _0x9b85db=process.env.TRIMPROMPT_MODEL||'';if(_0x9b85db&&exports[_0x263769(0x17e)][_0x9b85db])return{'tool':'','model':_0x9b85db,'modelShort':''};return _0x49e2e0;}class Tracker{['baseDir'];['configPath'];['statsPath'];['logsDir'];[a0_0x43a982(0x1bd)];constructor(){const _0x5bcdc3=a0_0x43a982;this[_0x5bcdc3(0x1b0)]=path[_0x5bcdc3(0x1c1)](os['homedir'](),_0x5bcdc3(0x1f8)),this[_0x5bcdc3(0x1c4)]=path['join'](this[_0x5bcdc3(0x1b0)],_0x5bcdc3(0x1e0)),this[_0x5bcdc3(0x204)]=path[_0x5bcdc3(0x1c1)](this[_0x5bcdc3(0x1b0)],'stats.json'),this['logsDir']=path[_0x5bcdc3(0x1c1)](this[_0x5bcdc3(0x1b0)],'logs'),this[_0x5bcdc3(0x180)]();}[a0_0x43a982(0x180)](){const _0x2f0d66=a0_0x43a982;!fs[_0x2f0d66(0x1f6)](this[_0x2f0d66(0x1b0)])&&fs[_0x2f0d66(0x184)](this[_0x2f0d66(0x1b0)],{'recursive':!![]});!fs['existsSync'](this['logsDir'])&&fs[_0x2f0d66(0x184)](this[_0x2f0d66(0x194)],{'recursive':!![]});const _0x43392a={'version':_0x2f0d66(0x1a4),'telemetry_url':process.env.TRIMPROMPT_TELEMETRY_URL||'','max_output_tokens':0x1388,'redaction_enabled':!![],'default_model':_0x2f0d66(0x1a7)};if(fs[_0x2f0d66(0x1f6)](this[_0x2f0d66(0x1c4)]))try{const _0x5bebf0=fs['readFileSync'](this[_0x2f0d66(0x1c4)],_0x2f0d66(0x1ca));this[_0x2f0d66(0x1bd)]={..._0x43392a,...JSON[_0x2f0d66(0x1e2)](_0x5bebf0)};}catch(_0x30a654){this['config']=_0x43392a;}else this[_0x2f0d66(0x1bd)]=_0x43392a,this[_0x2f0d66(0x1d9)]();!fs[_0x2f0d66(0x1f6)](this[_0x2f0d66(0x204)])&&fs['writeFileSync'](this[_0x2f0d66(0x204)],JSON[_0x2f0d66(0x1c3)]([]),'utf8');}['getConfig'](){const _0x571d0c=a0_0x43a982;return process.env.TRIMPROMPT_TELEMETRY_URL&&(this['config'][_0x571d0c(0x181)]=process.env.TRIMPROMPT_TELEMETRY_URL),this['config'];}['setConfig'](_0x410627,_0x2593bd){const _0x24307f=a0_0x43a982;this['config'][_0x410627]=_0x2593bd,this[_0x24307f(0x1d9)]();}[a0_0x43a982(0x1d9)](){const _0x27ede2=a0_0x43a982;fs[_0x27ede2(0x1ea)](this[_0x27ede2(0x1c4)],JSON[_0x27ede2(0x1c3)](this[_0x27ede2(0x1bd)],null,0x2),_0x27ede2(0x1ca));}['getLogs'](){const _0xe6e10=a0_0x43a982;try{if(!fs[_0xe6e10(0x1f6)](this[_0xe6e10(0x204)]))return[];const _0xc49b73=fs[_0xe6e10(0x176)](this[_0xe6e10(0x204)],'utf8');return JSON[_0xe6e10(0x1e2)](_0xc49b73);}catch{return[];}}['saveLogs'](_0x1e3c28){const _0x2f3572=a0_0x43a982;fs[_0x2f3572(0x1ea)](this[_0x2f3572(0x204)],JSON[_0x2f3572(0x1c3)](_0x1e3c28,null,0x2),_0x2f3572(0x1ca));}['logExecution'](_0x401b8c,_0x428507,_0xc32f1a,_0x1f225f,_0x4331d0){const _0x1ab520=a0_0x43a982,_0xfe0c1=this[_0x1ab520(0x1fb)](),_0x294285=_0x428507[_0x1ab520(0x19a)],_0x4d4c75=_0xc32f1a[_0x1ab520(0x19a)],_0x12b34e=Math[_0x1ab520(0x1e8)](_0x294285/0x4),_0x4582ff=Math[_0x1ab520(0x1e8)](_0x4d4c75/0x4),_0x1d2b6c=Math[_0x1ab520(0x1fe)](0x0,_0x12b34e-_0x4582ff),_0xf51bff=detectSessionTool(),_0x3139ca=_0xf51bff['model'],_0x21d633=Math['random']()[_0x1ab520(0x1bb)](0x24)[_0x1ab520(0x186)](0x2,0xb);try{const {redactor:_0x2dfea9}=require('./redactor'),_0xf0167e=_0x2dfea9?_0x2dfea9['redact'](_0x428507):_0x428507;fs[_0x1ab520(0x1ea)](path[_0x1ab520(0x1c1)](this['logsDir'],_0x21d633+_0x1ab520(0x183)),_0xf0167e,'utf8'),fs[_0x1ab520(0x1ea)](path['join'](this['logsDir'],_0x21d633+_0x1ab520(0x1b6)),_0xc32f1a,_0x1ab520(0x1ca));}catch{}const _0x52e815=_0x401b8c['split']('\x20')[0x0]||'unknown',_0x52cc7a=_0xf51bff[_0x1ab520(0x1a1)]?_0xf51bff['modelShort']?_0xf51bff[_0x1ab520(0x1a1)]+'-'+_0xf51bff[_0x1ab520(0x1c6)]+'-'+_0x52e815:_0xf51bff['tool']+'-'+_0x52e815:_0x52e815,_0x287358={'id':_0x21d633,'timestamp':new Date()[_0x1ab520(0x188)](),'command':_0x52cc7a,'raw_chars':_0x294285,'compressed_chars':_0x4d4c75,'estimated_raw_tokens':_0x12b34e,'estimated_compressed_tokens':_0x4582ff,'tokens_saved':_0x1d2b6c,'model_used':_0x3139ca,'exit_code':_0x1f225f,'synced':![],'ai_detected':!!_0xf51bff[_0x1ab520(0x1a1)],'secrets_found':_0x4331d0?.[_0x1ab520(0x1ce)]||0x0,'secret_types':_0x4331d0?.[_0x1ab520(0x1a6)]||[]};_0xfe0c1[_0x1ab520(0x1ef)](_0x287358),this[_0x1ab520(0x1a9)](_0xfe0c1);const _0x1f8b8c=this[_0x1ab520(0x1f0)]()[_0x1ab520(0x181)];return _0x1f8b8c&&_0x1f8b8c['trim']()[_0x1ab520(0x19a)]>0x0&&this['triggerBackgroundSync'](),_0x4331d0&&_0x4331d0[_0x1ab520(0x1ce)]>0x0&&this['sendSecurityAlert'](_0x287358,_0x4331d0),_0x287358;}[a0_0x43a982(0x206)](_0x21d916,_0x363479){const _0x268c9d=a0_0x43a982;try{let _0x24d883=this['getConfig']()['telemetry_url']||'';if(!_0x24d883)return;_0x24d883=_0x24d883[_0x268c9d(0x196)](/\/api\/telemetry\/?$/,_0x268c9d(0x1b7));if(!_0x24d883[_0x268c9d(0x18c)](_0x268c9d(0x1b7)))_0x24d883+=_0x268c9d(0x1b7);const {execSync:_0x1c6343}=require(_0x268c9d(0x195));let _0x2d76cf=_0x268c9d(0x1e6);try{_0x2d76cf=require(_0x268c9d(0x195))[_0x268c9d(0x209)](_0x268c9d(0x1d4),{'stdio':[_0x268c9d(0x1be),_0x268c9d(0x1eb),_0x268c9d(0x1be)]})[_0x268c9d(0x1bb)]()[_0x268c9d(0x1dc)]();}catch{}if(!_0x2d76cf||!_0x2d76cf[_0x268c9d(0x18c)]('@'))try{_0x2d76cf=require('os')['userInfo']()[_0x268c9d(0x1b9)];}catch{}const _0x483a5e=JSON['stringify']({'developer_id':_0x2d76cf,'timestamp':_0x21d916[_0x268c9d(0x1d7)],'command':_0x21d916[_0x268c9d(0x1a0)],'secrets_found':_0x363479['secretsFound'],'secret_types':_0x363479['secretTypes'],'os':require('os')[_0x268c9d(0x1d2)]()}),_0x39d849='const\x20h=require(require(\x27url\x27).parse('+JSON[_0x268c9d(0x1c3)](_0x24d883)+_0x268c9d(0x1ab)+JSON[_0x268c9d(0x1c3)](_0x24d883)+_0x268c9d(0x182)+JSON[_0x268c9d(0x1c3)](_0x483a5e)+')',_0xc6d27d=(0x0,child_process_1[_0x268c9d(0x197)])(process[_0x268c9d(0x19f)],['-e',_0x39d849],{'detached':!![],'stdio':_0x268c9d(0x1be)});_0xc6d27d[_0x268c9d(0x1dd)]();}catch{}}['triggerBackgroundSync'](){const _0x399e65=a0_0x43a982;try{const _0x50728d=path[_0x399e65(0x1c1)](__dirname,_0x399e65(0x1c2));if(fs['existsSync'](_0x50728d)){const _0xe0a3ee=(0x0,child_process_1[_0x399e65(0x197)])(process[_0x399e65(0x19f)],[_0x50728d],{'detached':!![],'stdio':_0x399e65(0x1be)});_0xe0a3ee[_0x399e65(0x1dd)]();}}catch{}}[a0_0x43a982(0x1fa)](_0x4d3b58=a0_0x43a982(0x17c)){const _0x500847=a0_0x43a982,_0x405ae5=this[_0x500847(0x1fb)]();let _0xebb56c=0x0,_0x5a0bc4=0x0,_0x1c4c80=0x0;for(const _0x5919e8 of _0x405ae5){_0xebb56c+=_0x5919e8[_0x500847(0x1f9)],_0x5a0bc4+=_0x5919e8[_0x500847(0x17a)],_0x1c4c80+=_0x5919e8[_0x500847(0x1f1)];}let _0x4ec82e=_0x4d3b58;(!_0x4ec82e||_0x4ec82e===_0x500847(0x17c)||!exports[_0x500847(0x17e)][_0x4ec82e])&&(_0x405ae5['length']>0x0&&_0x405ae5[_0x405ae5[_0x500847(0x19a)]-0x1][_0x500847(0x18f)]?_0x4ec82e=_0x405ae5[_0x405ae5[_0x500847(0x19a)]-0x1]['model_used']:_0x4ec82e=this[_0x500847(0x1f0)]()['default_model']||_0x500847(0x205));const _0x4adb17=exports['PRICING'][_0x4ec82e]||exports['PRICING']['claude-3-5-sonnet'],_0x4150cf=_0x1c4c80*_0x4adb17[_0x500847(0x1c0)]/0xf4240,_0x399e3e=_0xebb56c*_0x4adb17[_0x500847(0x1c0)]/0xf4240,_0xdd7646=_0x5a0bc4*_0x4adb17[_0x500847(0x1c0)]/0xf4240,_0x25dd55=_0xebb56c>0x0?_0x1c4c80/_0xebb56c*0x64:0x0;return{'total_raw_tokens':_0xebb56c,'total_compressed_tokens':_0x5a0bc4,'total_tokens_saved':_0x1c4c80,'savings_percentage':parseFloat(_0x25dd55[_0x500847(0x1bc)](0x1)),'money_saved_usd':parseFloat(_0x4150cf['toFixed'](0x4)),'raw_cost_usd':parseFloat(_0x399e3e['toFixed'](0x4)),'compressed_cost_usd':parseFloat(_0xdd7646[_0x500847(0x1bc)](0x4)),'model_name':_0x4adb17[_0x500847(0x1c7)],'model_key':_0x4ec82e};}}exports[a0_0x43a982(0x190)]=Tracker,exports['tracker']=new Tracker();
|
|
1
|
+
'use strict';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();}
|