trimprompt 1.0.25 → 1.0.26

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/tracker.js CHANGED
@@ -1 +1 @@
1
- 'use strict';const a0_0x2e0b46=a0_0x450f;(function(_0x37f705,_0x422499){const _0x143669=a0_0x450f,_0x142aad=_0x37f705();while(!![]){try{const _0x4caadd=parseInt(_0x143669(0x239))/0x1+-parseInt(_0x143669(0x21d))/0x2+parseInt(_0x143669(0x214))/0x3*(parseInt(_0x143669(0x231))/0x4)+-parseInt(_0x143669(0x259))/0x5*(parseInt(_0x143669(0x21b))/0x6)+parseInt(_0x143669(0x217))/0x7*(parseInt(_0x143669(0x23d))/0x8)+parseInt(_0x143669(0x251))/0x9*(parseInt(_0x143669(0x226))/0xa)+parseInt(_0x143669(0x1ee))/0xb;if(_0x4caadd===_0x422499)break;else _0x142aad['push'](_0x142aad['shift']());}catch(_0x1fbb7c){_0x142aad['push'](_0x142aad['shift']());}}}(a0_0x1b4d,0xb62ca));var __createBinding=this&&this['__createBinding']||(Object[a0_0x2e0b46(0x25b)]?function(_0x23be52,_0x3f6dc2,_0x4a53ed,_0x147330){const _0x1e7825=a0_0x2e0b46;if(_0x147330===undefined)_0x147330=_0x4a53ed;var _0xf6279a=Object[_0x1e7825(0x204)](_0x3f6dc2,_0x4a53ed);(!_0xf6279a||(_0x1e7825(0x23c)in _0xf6279a?!_0x3f6dc2['__esModule']:_0xf6279a['writable']||_0xf6279a[_0x1e7825(0x230)]))&&(_0xf6279a={'enumerable':!![],'get':function(){return _0x3f6dc2[_0x4a53ed];}}),Object[_0x1e7825(0x21e)](_0x23be52,_0x147330,_0xf6279a);}:function(_0xa5314c,_0x47a243,_0x5cfcab,_0x4de5d0){if(_0x4de5d0===undefined)_0x4de5d0=_0x5cfcab;_0xa5314c[_0x4de5d0]=_0x47a243[_0x5cfcab];}),__setModuleDefault=this&&this[a0_0x2e0b46(0x246)]||(Object[a0_0x2e0b46(0x25b)]?function(_0x307107,_0x365399){const _0x2efb02=a0_0x2e0b46;Object[_0x2efb02(0x21e)](_0x307107,_0x2efb02(0x24b),{'enumerable':!![],'value':_0x365399});}:function(_0x644878,_0x9aa878){const _0x3ec01d=a0_0x2e0b46;_0x644878[_0x3ec01d(0x24b)]=_0x9aa878;}),__importStar=this&&this['__importStar']||(function(){var _0x392b56=function(_0x37a492){return _0x392b56=Object['getOwnPropertyNames']||function(_0x1c608a){const _0x2352c0=a0_0x450f;var _0x5db545=[];for(var _0x561d7b in _0x1c608a)if(Object[_0x2352c0(0x1d1)][_0x2352c0(0x22c)][_0x2352c0(0x1d6)](_0x1c608a,_0x561d7b))_0x5db545[_0x5db545[_0x2352c0(0x264)]]=_0x561d7b;return _0x5db545;},_0x392b56(_0x37a492);};return function(_0x1b5203){const _0x1ee5a8=a0_0x450f;if(_0x1b5203&&_0x1b5203['__esModule'])return _0x1b5203;var _0x135176={};if(_0x1b5203!=null){for(var _0x36f9a6=_0x392b56(_0x1b5203),_0x2f51db=0x0;_0x2f51db<_0x36f9a6[_0x1ee5a8(0x264)];_0x2f51db++)if(_0x36f9a6[_0x2f51db]!==_0x1ee5a8(0x24b))__createBinding(_0x135176,_0x1b5203,_0x36f9a6[_0x2f51db]);}return __setModuleDefault(_0x135176,_0x1b5203),_0x135176;};}());Object[a0_0x2e0b46(0x21e)](exports,'__esModule',{'value':!![]}),exports['tracker']=exports[a0_0x2e0b46(0x1cc)]=exports['PRICING']=void 0x0,exports['detectSessionTool']=detectSessionTool;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x2e0b46(0x216))),os=__importStar(require('os')),child_process_1=require('child_process');exports[a0_0x2e0b46(0x1d0)]={'claude-fable-5':{'name':a0_0x2e0b46(0x261),'input_price_1m':0xa},'claude-mythos-5':{'name':'Claude\x20Mythos\x205','input_price_1m':0xa},'claude-opus-4-8':{'name':a0_0x2e0b46(0x200),'input_price_1m':0x5},'claude-opus-4-7':{'name':a0_0x2e0b46(0x1f7),'input_price_1m':0x5},'claude-opus-4-5':{'name':a0_0x2e0b46(0x244),'input_price_1m':0x5},'claude-opus-4-1':{'name':a0_0x2e0b46(0x1f4),'input_price_1m':0xf},'claude-sonnet-4-6':{'name':a0_0x2e0b46(0x240),'input_price_1m':0x3},'claude-sonnet-4-5':{'name':'Claude\x20Sonnet\x204.5','input_price_1m':0x3},'claude-3-5-sonnet':{'name':'Claude\x203.5\x20Sonnet','input_price_1m':0x3},'claude-haiku-4-5':{'name':a0_0x2e0b46(0x201),'input_price_1m':0x1},'claude-haiku-3-5':{'name':a0_0x2e0b46(0x256),'input_price_1m':0.8},'gpt-5-5':{'name':a0_0x2e0b46(0x254),'input_price_1m':0x5},'gpt-5-4':{'name':a0_0x2e0b46(0x23f),'input_price_1m':2.5},'gpt-4o':{'name':a0_0x2e0b46(0x1cd),'input_price_1m':2.5},'gpt-5-4-mini':{'name':a0_0x2e0b46(0x262),'input_price_1m':0.75},'gpt-5-4-nano':{'name':a0_0x2e0b46(0x1fe),'input_price_1m':0.2},'gpt-4-1-mini':{'name':a0_0x2e0b46(0x265),'input_price_1m':0.4},'gpt-4-1-nano':{'name':a0_0x2e0b46(0x1e4),'input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0x2e0b46(0x22d),'input_price_1m':0.15},'o1':{'name':a0_0x2e0b46(0x1df),'input_price_1m':0xf},'o1-mini':{'name':a0_0x2e0b46(0x233),'input_price_1m':0x3},'o3-mini':{'name':'OpenAI\x20o3-mini','input_price_1m':1.1},'cursor-small':{'name':a0_0x2e0b46(0x234),'input_price_1m':0.1},'gemini-3-1-pro':{'name':'Gemini\x203.1\x20Pro','input_price_1m':0x2},'gemini-3-5-flash':{'name':a0_0x2e0b46(0x20a),'input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':a0_0x2e0b46(0x208),'input_price_1m':0.45},'gemini-3-5-live-translate':{'name':'Gemini\x203.5\x20Live\x20Translate','input_price_1m':3.5}};function a0_0x1b4d(){const _0x40359f=['OpenAI\x20o1','windsurf','antigravity','getConfig','COPILOT_GITHUB_TOKEN','GPT-4.1\x20Nano','config.json','ignore','aider','max','.trimprompt','name',').protocol===\x27https:\x27?\x27https\x27:\x27http\x27);const\x20r=h.request(','github-copilot','username','16189162sJopyP','telemetry_url','auto','configPath','gemini-3-1-pro','getStatsSummary','Claude\x20Opus\x204.1\x20(deprecated)','init','ANTIGRAVITY_AGENT','Claude\x20Opus\x204.7','command','toLowerCase','spawn','platform','claude-opus-4-8','triggerBackgroundSync','GPT-5.4\x20Nano','logs','Claude\x20Opus\x204.8','Claude\x20Haiku\x204.5','claude','secretsFound','getOwnPropertyDescriptor','baseDir','flash','input_price_1m','Gemini\x203.1\x20Flash-Lite','join','Gemini\x203.5\x20Flash','ceil','sync.js','high','timestamp','git\x20config\x20user.email','includes','utf8','replit','replace','3HhWxxH','gemini','path','34664sToXIL','claude-sonnet-4-6','redact','GEMINI_CLI','1460190FoSDkQ','unknown','1070360bSwKPC','defineProperty','devin','CONTINUE_GLOBAL_DIR','claude-sonnet-4-5','estimated_compressed_tokens','toFixed','writeFileSync','REPL_ID','132670CknETY','config','opus','readFileSync','./redactor','push','hasOwnProperty','GPT-4o\x20Mini','toISOString','o3mini','configurable','1407316yRphWr','o3-mini','OpenAI\x20o1-mini','Cursor\x20Small','mkdirSync','COPILOT_MODEL','logsDir','tool','79171AIkRZT','continue','sendSecurityAlert','get','112mPKWtO','cursor','GPT-5.4','Claude\x20Sonnet\x204.6','cline','modelShort','statsPath','Claude\x20Opus\x204.5','copilot','__setModuleDefault','execPath','pipe','AI_AGENT','TRIMPROMPT_MODEL','default','saveLogs','CLAUDECODE','stringify','CLAUDE_EFFORT','AIDER_MODEL','522OQnPLt','pop','existsSync','GPT-5.5','estimated_raw_tokens','Claude\x20Haiku\x203.5','PATH','secretTypes','30GyCuLF','default_model','create','/api/security/alert','setConfig','model','CURSOR_AGENT','gemini-3-5-flash','Claude\x20Fable\x205','GPT-5.4\x20Mini','tracker','length','GPT-4.1\x20Mini','Tracker','GPT-4o','.comp.txt','parse','PRICING','prototype','unref','codex','stats.json','getLogs','call','split','sonnet','model_used','.raw.txt','saveConfig','REPLIT_ENVIRONMENT','trim',',{method:\x27POST\x27,headers:{\x27Content-Type\x27:\x27application/json\x27}},()=>{});r.on(\x27error\x27,()=>{});r.end('];a0_0x1b4d=function(){return _0x40359f;};return a0_0x1b4d();}function a0_0x450f(_0x2f3cbc,_0x532069){_0x2f3cbc=_0x2f3cbc-0x1cc;const _0x1b4da8=a0_0x1b4d();let _0x450fd3=_0x1b4da8[_0x2f3cbc];return _0x450fd3;}function detectSessionTool(){const _0x3cb464=a0_0x2e0b46,_0x1ea208=process.env,_0x5a5aaa={'tool':'','model':_0x3cb464(0x218),'modelShort':''};if(_0x1ea208['TRIMPROMPT_MODEL']&&exports['PRICING'][_0x1ea208[_0x3cb464(0x24a)]])return{'tool':'','model':_0x1ea208['TRIMPROMPT_MODEL'],'modelShort':''};const _0x4f06c7=(_0x1ea208[_0x3cb464(0x249)]||'')[_0x3cb464(0x1f9)]();if(_0x4f06c7){if(_0x4f06c7[_0x3cb464(0x210)]('claude-code')||_0x4f06c7[_0x3cb464(0x210)]('claude_code')){const _0x333f48=_0x1ea208[_0x3cb464(0x24f)]==='high'?_0x3cb464(0x228):_0x3cb464(0x1d8),_0x3c2278=_0x1ea208[_0x3cb464(0x24f)]===_0x3cb464(0x20d)?'claude-opus-4-8':_0x3cb464(0x218);return{'tool':_0x3cb464(0x202),'model':_0x3c2278,'modelShort':_0x333f48};}if(_0x4f06c7['includes'](_0x3cb464(0x23e)))return{'tool':_0x3cb464(0x23e),'model':_0x3cb464(0x218),'modelShort':_0x3cb464(0x1d8)};if(_0x4f06c7['includes'](_0x3cb464(0x1ec))||_0x4f06c7[_0x3cb464(0x210)](_0x3cb464(0x245))){const _0x120e5f=_0x1ea208['COPILOT_MODEL']||'';if(_0x120e5f&&exports['PRICING'][_0x120e5f])return{'tool':_0x3cb464(0x245),'model':_0x120e5f,'modelShort':_0x120e5f['split']('-')['pop']()||''};return{'tool':_0x3cb464(0x245),'model':_0x3cb464(0x221),'modelShort':_0x3cb464(0x1d8)};}if(_0x4f06c7[_0x3cb464(0x210)](_0x3cb464(0x215)))return{'tool':_0x3cb464(0x215),'model':_0x3cb464(0x260),'modelShort':'flash'};if(_0x4f06c7[_0x3cb464(0x210)](_0x3cb464(0x1d3)))return{'tool':'codex','model':_0x3cb464(0x232),'modelShort':_0x3cb464(0x22f)};if(_0x4f06c7[_0x3cb464(0x210)]('devin'))return{'tool':_0x3cb464(0x21f),'model':_0x3cb464(0x218),'modelShort':''};if(_0x4f06c7[_0x3cb464(0x210)]('antigravity'))return{'tool':'antigravity','model':_0x3cb464(0x1f2),'modelShort':_0x3cb464(0x215)};if(_0x4f06c7[_0x3cb464(0x210)](_0x3cb464(0x212))||_0x1ea208[_0x3cb464(0x225)])return{'tool':_0x3cb464(0x212),'model':_0x3cb464(0x218),'modelShort':''};return{'tool':_0x4f06c7[_0x3cb464(0x1d7)]('_')[0x0][_0x3cb464(0x1d7)]('-')[0x0],'model':_0x3cb464(0x218),'modelShort':''};}if(_0x1ea208[_0x3cb464(0x24d)]==='1'||_0x1ea208['CLAUDE_CODE']==='1'){const _0x29e4d7=_0x1ea208[_0x3cb464(0x24f)]===_0x3cb464(0x20d)?'opus':_0x3cb464(0x1d8),_0x1c3a2f=_0x1ea208['CLAUDE_EFFORT']===_0x3cb464(0x20d)?_0x3cb464(0x1fc):_0x3cb464(0x218);return{'tool':'claude','model':_0x1c3a2f,'modelShort':_0x29e4d7};}if(_0x1ea208[_0x3cb464(0x25f)]==='1')return{'tool':_0x3cb464(0x23e),'model':'claude-sonnet-4-6','modelShort':'sonnet'};if(_0x1ea208[_0x3cb464(0x21a)]==='1')return{'tool':_0x3cb464(0x215),'model':_0x3cb464(0x260),'modelShort':_0x3cb464(0x206)};if(_0x1ea208['COPILOT_MODEL']||_0x1ea208[_0x3cb464(0x1e3)]){const _0x4d2cfc=_0x1ea208[_0x3cb464(0x236)]||'';if(_0x4d2cfc&&exports['PRICING'][_0x4d2cfc])return{'tool':_0x3cb464(0x245),'model':_0x4d2cfc,'modelShort':_0x4d2cfc[_0x3cb464(0x1d7)]('-')[_0x3cb464(0x252)]()||''};return{'tool':'copilot','model':_0x3cb464(0x221),'modelShort':_0x3cb464(0x1d8)};}if(_0x1ea208[_0x3cb464(0x225)]||_0x1ea208[_0x3cb464(0x1dc)])return{'tool':'replit','model':_0x3cb464(0x218),'modelShort':''};if(_0x1ea208['CLINE_DATA_DIR'])return{'tool':_0x3cb464(0x241),'model':_0x3cb464(0x218),'modelShort':''};if(_0x1ea208[_0x3cb464(0x220)])return{'tool':_0x3cb464(0x23a),'model':'claude-sonnet-4-6','modelShort':''};if(_0x1ea208[_0x3cb464(0x1f6)]==='1')return{'tool':_0x3cb464(0x1e1),'model':_0x3cb464(0x1f2),'modelShort':_0x3cb464(0x215)};if(_0x1ea208[_0x3cb464(0x24f)]){const _0x42c361=_0x1ea208[_0x3cb464(0x24f)]===_0x3cb464(0x20d)?_0x3cb464(0x228):'sonnet',_0xc6f04=_0x1ea208[_0x3cb464(0x24f)]==='high'?'claude-opus-4-8':_0x3cb464(0x218);return{'tool':'','model':_0xc6f04,'modelShort':''};}if(_0x1ea208[_0x3cb464(0x250)]&&exports[_0x3cb464(0x1d0)][_0x1ea208['AIDER_MODEL']])return{'tool':_0x3cb464(0x1e7),'model':_0x1ea208[_0x3cb464(0x250)],'modelShort':''};if(_0x1ea208['VSCODE_PID']){const _0x3efaee=(_0x1ea208[_0x3cb464(0x257)]||'')[_0x3cb464(0x1f9)]();if(_0x3efaee[_0x3cb464(0x210)](_0x3cb464(0x23e)))return{'tool':'cursor','model':'claude-sonnet-4-6','modelShort':_0x3cb464(0x1d8)};if(_0x3efaee[_0x3cb464(0x210)](_0x3cb464(0x1e0)))return{'tool':_0x3cb464(0x1e0),'model':_0x3cb464(0x218),'modelShort':_0x3cb464(0x1d8)};}const _0x59c42b=process.env.TRIMPROMPT_MODEL||'';if(_0x59c42b&&exports[_0x3cb464(0x1d0)][_0x59c42b])return{'tool':'','model':_0x59c42b,'modelShort':''};return _0x5a5aaa;}class Tracker{['baseDir'];[a0_0x2e0b46(0x1f1)];[a0_0x2e0b46(0x243)];['logsDir'];[a0_0x2e0b46(0x227)];constructor(){const _0x424758=a0_0x2e0b46;this[_0x424758(0x205)]=path['join'](os['homedir'](),_0x424758(0x1e9)),this[_0x424758(0x1f1)]=path[_0x424758(0x209)](this[_0x424758(0x205)],_0x424758(0x1e5)),this['statsPath']=path['join'](this[_0x424758(0x205)],_0x424758(0x1d4)),this['logsDir']=path['join'](this[_0x424758(0x205)],_0x424758(0x1ff)),this[_0x424758(0x1f5)]();}[a0_0x2e0b46(0x1f5)](){const _0x4d409a=a0_0x2e0b46;!fs[_0x4d409a(0x253)](this[_0x4d409a(0x205)])&&fs['mkdirSync'](this[_0x4d409a(0x205)],{'recursive':!![]});!fs['existsSync'](this['logsDir'])&&fs[_0x4d409a(0x235)](this[_0x4d409a(0x237)],{'recursive':!![]});const _0x1941b1={'version':'1.0','telemetry_url':process.env.TRIMPROMPT_TELEMETRY_URL||'','max_output_tokens':0x1388,'redaction_enabled':!![],'default_model':'claude-opus-4-8'};if(fs[_0x4d409a(0x253)](this[_0x4d409a(0x1f1)]))try{const _0x5b43c3=fs[_0x4d409a(0x229)](this[_0x4d409a(0x1f1)],_0x4d409a(0x211));this[_0x4d409a(0x227)]={..._0x1941b1,...JSON[_0x4d409a(0x1cf)](_0x5b43c3)};}catch(_0x3103e2){this[_0x4d409a(0x227)]=_0x1941b1;}else this[_0x4d409a(0x227)]=_0x1941b1,this[_0x4d409a(0x1db)]();!fs[_0x4d409a(0x253)](this[_0x4d409a(0x243)])&&fs['writeFileSync'](this['statsPath'],JSON[_0x4d409a(0x24e)]([]),_0x4d409a(0x211));}['getConfig'](){const _0x34387d=a0_0x2e0b46;return process.env.TRIMPROMPT_TELEMETRY_URL&&(this['config'][_0x34387d(0x1ef)]=process.env.TRIMPROMPT_TELEMETRY_URL),this[_0x34387d(0x227)];}[a0_0x2e0b46(0x25d)](_0xbe754c,_0x11eee2){const _0x3aad3b=a0_0x2e0b46;this[_0x3aad3b(0x227)][_0xbe754c]=_0x11eee2,this[_0x3aad3b(0x1db)]();}[a0_0x2e0b46(0x1db)](){const _0x569e2a=a0_0x2e0b46;fs[_0x569e2a(0x224)](this[_0x569e2a(0x1f1)],JSON[_0x569e2a(0x24e)](this[_0x569e2a(0x227)],null,0x2),_0x569e2a(0x211));}['getLogs'](){const _0x25a4e8=a0_0x2e0b46;try{if(!fs['existsSync'](this[_0x25a4e8(0x243)]))return[];const _0x62358c=fs[_0x25a4e8(0x229)](this[_0x25a4e8(0x243)],_0x25a4e8(0x211));return JSON['parse'](_0x62358c);}catch{return[];}}[a0_0x2e0b46(0x24c)](_0x30504c){const _0x23e88f=a0_0x2e0b46;fs[_0x23e88f(0x224)](this[_0x23e88f(0x243)],JSON[_0x23e88f(0x24e)](_0x30504c,null,0x2),_0x23e88f(0x211));}['logExecution'](_0x438fdc,_0x2fb6b0,_0x3d7396,_0x1e277e,_0x37dd45){const _0x3aaee8=a0_0x2e0b46,_0x503cc2=this[_0x3aaee8(0x1d5)](),_0x3c3939=_0x2fb6b0[_0x3aaee8(0x264)],_0x56ab75=_0x3d7396[_0x3aaee8(0x264)],_0x17f8f3=Math[_0x3aaee8(0x20b)](_0x3c3939/0x4),_0x53f103=Math[_0x3aaee8(0x20b)](_0x56ab75/0x4),_0x487d24=Math[_0x3aaee8(0x1e8)](0x0,_0x17f8f3-_0x53f103),_0xb21a3e=detectSessionTool(),_0x431573=_0xb21a3e[_0x3aaee8(0x25e)],_0x56dbd2=Math['random']()['toString'](0x24)['substring'](0x2,0xb);try{const {redactor:_0x43bd41}=require(_0x3aaee8(0x22a)),_0x3ba955=_0x43bd41?_0x43bd41[_0x3aaee8(0x219)](_0x2fb6b0):_0x2fb6b0;fs[_0x3aaee8(0x224)](path['join'](this[_0x3aaee8(0x237)],_0x56dbd2+_0x3aaee8(0x1da)),_0x3ba955,_0x3aaee8(0x211)),fs[_0x3aaee8(0x224)](path[_0x3aaee8(0x209)](this[_0x3aaee8(0x237)],_0x56dbd2+_0x3aaee8(0x1ce)),_0x3d7396,'utf8');}catch{}const _0x3f15da=_0x438fdc['split']('\x20')[0x0]||_0x3aaee8(0x21c),_0xb7cf4=_0xb21a3e['tool']?_0xb21a3e[_0x3aaee8(0x242)]?_0xb21a3e['tool']+'-'+_0xb21a3e['modelShort']+'-'+_0x3f15da:_0xb21a3e[_0x3aaee8(0x238)]+'-'+_0x3f15da:_0x3f15da,_0x400f36={'id':_0x56dbd2,'timestamp':new Date()[_0x3aaee8(0x22e)](),'command':_0xb7cf4,'raw_chars':_0x3c3939,'compressed_chars':_0x56ab75,'estimated_raw_tokens':_0x17f8f3,'estimated_compressed_tokens':_0x53f103,'tokens_saved':_0x487d24,'model_used':_0x431573,'exit_code':_0x1e277e,'synced':![],'ai_detected':!!_0xb21a3e['tool'],'secrets_found':_0x37dd45?.[_0x3aaee8(0x203)]||0x0,'secret_types':_0x37dd45?.[_0x3aaee8(0x258)]||[]};_0x503cc2[_0x3aaee8(0x22b)](_0x400f36),this[_0x3aaee8(0x24c)](_0x503cc2);const _0x3db6a6=this[_0x3aaee8(0x1e2)]()[_0x3aaee8(0x1ef)];return _0x3db6a6&&_0x3db6a6['trim']()[_0x3aaee8(0x264)]>0x0&&this['triggerBackgroundSync'](),_0x37dd45&&_0x37dd45[_0x3aaee8(0x203)]>0x0&&this[_0x3aaee8(0x23b)](_0x400f36,_0x37dd45),_0x400f36;}[a0_0x2e0b46(0x23b)](_0x562e20,_0x22d04e){const _0x4483b5=a0_0x2e0b46;try{let _0x4c5638=this[_0x4483b5(0x1e2)]()[_0x4483b5(0x1ef)]||'';if(!_0x4c5638)return;_0x4c5638=_0x4c5638[_0x4483b5(0x213)](/\/api\/telemetry\/?$/,_0x4483b5(0x25c));if(!_0x4c5638[_0x4483b5(0x210)]('/api/security/alert'))_0x4c5638+=_0x4483b5(0x25c);const {execSync:_0x3ea305}=require('child_process');let _0x26caa6=_0x4483b5(0x21c);try{_0x26caa6=require('child_process')['execSync'](_0x4483b5(0x20f),{'stdio':[_0x4483b5(0x1e6),_0x4483b5(0x248),'ignore']})['toString']()[_0x4483b5(0x1dd)]();}catch{}if(!_0x26caa6||!_0x26caa6[_0x4483b5(0x210)]('@'))try{_0x26caa6=require('os')['userInfo']()[_0x4483b5(0x1ed)];}catch{}const _0x25f547=JSON[_0x4483b5(0x24e)]({'developer_id':_0x26caa6,'timestamp':_0x562e20[_0x4483b5(0x20e)],'command':_0x562e20[_0x4483b5(0x1f8)],'secrets_found':_0x22d04e[_0x4483b5(0x203)],'secret_types':_0x22d04e['secretTypes'],'os':require('os')[_0x4483b5(0x1fb)]()}),_0x4a24c9='const\x20h=require(require(\x27url\x27).parse('+JSON[_0x4483b5(0x24e)](_0x4c5638)+_0x4483b5(0x1eb)+JSON['stringify'](_0x4c5638)+_0x4483b5(0x1de)+JSON[_0x4483b5(0x24e)](_0x25f547)+')',_0x2d392d=(0x0,child_process_1['spawn'])(process['execPath'],['-e',_0x4a24c9],{'detached':!![],'stdio':_0x4483b5(0x1e6)});_0x2d392d[_0x4483b5(0x1d2)]();}catch{}}[a0_0x2e0b46(0x1fd)](){const _0x1a60b7=a0_0x2e0b46;try{const _0x2359c7=path[_0x1a60b7(0x209)](__dirname,_0x1a60b7(0x20c));if(fs[_0x1a60b7(0x253)](_0x2359c7)){const _0x3ebd37=(0x0,child_process_1[_0x1a60b7(0x1fa)])(process[_0x1a60b7(0x247)],[_0x2359c7],{'detached':!![],'stdio':_0x1a60b7(0x1e6)});_0x3ebd37[_0x1a60b7(0x1d2)]();}}catch{}}[a0_0x2e0b46(0x1f3)](_0x4c9468='auto'){const _0xb84fcc=a0_0x2e0b46,_0x285dec=this[_0xb84fcc(0x1d5)]();let _0x4d98d7=0x0,_0xc94ae6=0x0,_0x536efa=0x0;for(const _0x323c8b of _0x285dec){_0x4d98d7+=_0x323c8b[_0xb84fcc(0x255)],_0xc94ae6+=_0x323c8b[_0xb84fcc(0x222)],_0x536efa+=_0x323c8b['tokens_saved'];}let _0x11a925=_0x4c9468;(!_0x11a925||_0x11a925===_0xb84fcc(0x1f0)||!exports[_0xb84fcc(0x1d0)][_0x11a925])&&(_0x285dec[_0xb84fcc(0x264)]>0x0&&_0x285dec[_0x285dec[_0xb84fcc(0x264)]-0x1][_0xb84fcc(0x1d9)]?_0x11a925=_0x285dec[_0x285dec['length']-0x1]['model_used']:_0x11a925=this['getConfig']()[_0xb84fcc(0x25a)]||'claude-3-5-sonnet');const _0x42d51e=exports[_0xb84fcc(0x1d0)][_0x11a925]||exports[_0xb84fcc(0x1d0)]['claude-3-5-sonnet'],_0xb63097=_0x536efa*_0x42d51e['input_price_1m']/0xf4240,_0x23bd04=_0x4d98d7*_0x42d51e[_0xb84fcc(0x207)]/0xf4240,_0x2f39d2=_0xc94ae6*_0x42d51e[_0xb84fcc(0x207)]/0xf4240,_0x2faca3=_0x4d98d7>0x0?_0x536efa/_0x4d98d7*0x64:0x0;return{'total_raw_tokens':_0x4d98d7,'total_compressed_tokens':_0xc94ae6,'total_tokens_saved':_0x536efa,'savings_percentage':parseFloat(_0x2faca3[_0xb84fcc(0x223)](0x1)),'money_saved_usd':parseFloat(_0xb63097[_0xb84fcc(0x223)](0x4)),'raw_cost_usd':parseFloat(_0x23bd04['toFixed'](0x4)),'compressed_cost_usd':parseFloat(_0x2f39d2[_0xb84fcc(0x223)](0x4)),'model_name':_0x42d51e[_0xb84fcc(0x1ea)],'model_key':_0x11a925};}}exports['Tracker']=Tracker,exports[a0_0x2e0b46(0x263)]=new Tracker();
1
+ 'use strict';const a0_0x4bdcb1=a0_0x2adf;(function(_0x39143f,_0x5db0e4){const _0x28b6d6=a0_0x2adf,_0x3f46c7=_0x39143f();while(!![]){try{const _0x5ccb8c=parseInt(_0x28b6d6(0xca))/0x1*(-parseInt(_0x28b6d6(0x9d))/0x2)+parseInt(_0x28b6d6(0xb3))/0x3+-parseInt(_0x28b6d6(0x112))/0x4*(-parseInt(_0x28b6d6(0xc5))/0x5)+parseInt(_0x28b6d6(0xee))/0x6+-parseInt(_0x28b6d6(0x8c))/0x7*(parseInt(_0x28b6d6(0x106))/0x8)+parseInt(_0x28b6d6(0xec))/0x9*(-parseInt(_0x28b6d6(0xf9))/0xa)+parseInt(_0x28b6d6(0xbf))/0xb;if(_0x5ccb8c===_0x5db0e4)break;else _0x3f46c7['push'](_0x3f46c7['shift']());}catch(_0x3a10ea){_0x3f46c7['push'](_0x3f46c7['shift']());}}}(a0_0x5f3c,0x8d1e0));function a0_0x2adf(_0x4aec5d,_0x5693c5){_0x4aec5d=_0x4aec5d-0x86;const _0x5f3c90=a0_0x5f3c();let _0x2adf1d=_0x5f3c90[_0x4aec5d];return _0x2adf1d;}function a0_0x5f3c(){const _0x4a1d80=['ceil','CLAUDE_CODE','GPT-4.1\x20Mini','CLAUDECODE','aider','COPILOT_GITHUB_TOKEN','existsSync','getLogs','VSCODE_PID','timestamp','logs','command','__esModule','default_model','secretTypes','pop','o3mini','configPath','__createBinding','replace','setConfig','detectSessionTool','stats.json','gemini-3-5-flash','ANTIGRAVITY_AGENT','execSync','username','AIDER_MODEL','3776319Ixaouj','stringify','420102gTplca','tokens_saved','max','claude-3-5-sonnet','claude_code','Gemini\x203.1\x20Pro','saveConfig','const\x20h=require(require(\x27url\x27).parse(','./redactor','CONTINUE_GLOBAL_DIR','getConfig','10ewbFXM','Claude\x20Mythos\x205','GPT-4o','CLINE_DATA_DIR','Claude\x20Opus\x204.8','call','model_used','/api/security/alert','userInfo','parse','readFileSync','claude-sonnet-4-6','join','16304YhPxpr','telemetry_url','input_price_1m','opus','path','Claude\x20Haiku\x203.5','platform','github-copilot','cline','git\x20config\x20user.email','auto','create','4rFgXKW','redact','prototype','get','antigravity','pipe','GEMINI_CLI','defineProperty','triggerBackgroundSync','baseDir','estimated_compressed_tokens','sendSecurityAlert','writeFileSync','includes','mkdirSync','gemini-3-1-pro','logExecution','writable','getOwnPropertyNames','config','GPT-5.4','length','o3-mini','copilot','AI_AGENT','homedir','cursor','GPT-4.1\x20Nano','claude','COPILOT_MODEL','split','217rgKFIZ',',{method:\x27POST\x27,headers:{\x27Content-Type\x27:\x27application/json\x27}},()=>{});r.on(\x27error\x27,()=>{});r.end(','Claude\x20Sonnet\x204.6','OpenAI\x20o3-mini','toFixed','random','name','.raw.txt','GPT-5.4\x20Nano','Claude\x20Haiku\x204.5','CURSOR_AGENT','spawn','REPL_ID','gemini','continue','utf8','init','6UPxWpz','modelShort','1.0','replit','substring','claude-opus-4-8','devin','toLowerCase','statsPath','claude-sonnet-4-5','child_process','TRIMPROMPT_MODEL','CLAUDE_EFFORT','Claude\x20Fable\x205','tool','.trimprompt','execPath','Claude\x20Opus\x204.7','default','flash','logsDir','PATH','463713adGWTr','toString','Tracker','sonnet','Claude\x203.5\x20Sonnet','config.json','.comp.txt','Claude\x20Opus\x204.1\x20(deprecated)','Cursor\x20Small','__importStar','push','configurable','15103869vZNrcQ','ignore','PRICING','model','getOwnPropertyDescriptor','Gemini\x203.5\x20Flash','2941115RyymhX','high','saveLogs','unknown','Claude\x20Opus\x204.5','375035VrAiPi','estimated_raw_tokens','codex','trim','unref','Gemini\x203.1\x20Flash-Lite'];a0_0x5f3c=function(){return _0x4a1d80;};return a0_0x5f3c();}var __createBinding=this&&this[a0_0x4bdcb1(0xe2)]||(Object[a0_0x4bdcb1(0x111)]?function(_0x50f252,_0x1f65ae,_0x39b54d,_0x1b9627){const _0x2e8832=a0_0x4bdcb1;if(_0x1b9627===undefined)_0x1b9627=_0x39b54d;var _0x529a81=Object[_0x2e8832(0xc3)](_0x1f65ae,_0x39b54d);(!_0x529a81||(_0x2e8832(0x115)in _0x529a81?!_0x1f65ae[_0x2e8832(0xdc)]:_0x529a81[_0x2e8832(0x123)]||_0x529a81[_0x2e8832(0xbe)]))&&(_0x529a81={'enumerable':!![],'get':function(){return _0x1f65ae[_0x39b54d];}}),Object[_0x2e8832(0x119)](_0x50f252,_0x1b9627,_0x529a81);}:function(_0x30d4a6,_0x4392cd,_0x4b6e74,_0x4898f6){if(_0x4898f6===undefined)_0x4898f6=_0x4b6e74;_0x30d4a6[_0x4898f6]=_0x4392cd[_0x4b6e74];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a0_0x4bdcb1(0x111)]?function(_0x45bfd3,_0x2cfd93){Object['defineProperty'](_0x45bfd3,'default',{'enumerable':!![],'value':_0x2cfd93});}:function(_0x2ff884,_0x4abe8b){const _0xb017cc=a0_0x4bdcb1;_0x2ff884[_0xb017cc(0xaf)]=_0x4abe8b;}),__importStar=this&&this[a0_0x4bdcb1(0xbc)]||(function(){var _0x4a33f5=function(_0x4eb840){const _0x220de8=a0_0x2adf;return _0x4a33f5=Object[_0x220de8(0x124)]||function(_0x255771){const _0x162942=_0x220de8;var _0x1be52d=[];for(var _0x5769fc in _0x255771)if(Object[_0x162942(0x114)]['hasOwnProperty'][_0x162942(0xfe)](_0x255771,_0x5769fc))_0x1be52d[_0x1be52d[_0x162942(0x127)]]=_0x5769fc;return _0x1be52d;},_0x4a33f5(_0x4eb840);};return function(_0x3a6c08){const _0x5105b7=a0_0x2adf;if(_0x3a6c08&&_0x3a6c08['__esModule'])return _0x3a6c08;var _0x24c934={};if(_0x3a6c08!=null){for(var _0x545c5e=_0x4a33f5(_0x3a6c08),_0x2a75ad=0x0;_0x2a75ad<_0x545c5e[_0x5105b7(0x127)];_0x2a75ad++)if(_0x545c5e[_0x2a75ad]!=='default')__createBinding(_0x24c934,_0x3a6c08,_0x545c5e[_0x2a75ad]);}return __setModuleDefault(_0x24c934,_0x3a6c08),_0x24c934;};}());Object[a0_0x4bdcb1(0x119)](exports,a0_0x4bdcb1(0xdc),{'value':!![]}),exports['tracker']=exports['Tracker']=exports[a0_0x4bdcb1(0xc1)]=void 0x0,exports[a0_0x4bdcb1(0xe5)]=detectSessionTool;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x4bdcb1(0x10a))),os=__importStar(require('os')),child_process_1=require('child_process');exports[a0_0x4bdcb1(0xc1)]={'claude-fable-5':{'name':a0_0x4bdcb1(0xaa),'input_price_1m':0xa},'claude-mythos-5':{'name':a0_0x4bdcb1(0xfa),'input_price_1m':0xa},'claude-opus-4-8':{'name':a0_0x4bdcb1(0xfd),'input_price_1m':0x5},'claude-opus-4-7':{'name':a0_0x4bdcb1(0xae),'input_price_1m':0x5},'claude-opus-4-5':{'name':a0_0x4bdcb1(0xc9),'input_price_1m':0x5},'claude-opus-4-1':{'name':a0_0x4bdcb1(0xba),'input_price_1m':0xf},'claude-sonnet-4-6':{'name':a0_0x4bdcb1(0x8e),'input_price_1m':0x3},'claude-sonnet-4-5':{'name':'Claude\x20Sonnet\x204.5','input_price_1m':0x3},'claude-3-5-sonnet':{'name':a0_0x4bdcb1(0xb7),'input_price_1m':0x3},'claude-haiku-4-5':{'name':a0_0x4bdcb1(0x95),'input_price_1m':0x1},'claude-haiku-3-5':{'name':a0_0x4bdcb1(0x10b),'input_price_1m':0.8},'gpt-5-5':{'name':'GPT-5.5','input_price_1m':0x5},'gpt-5-4':{'name':a0_0x4bdcb1(0x126),'input_price_1m':2.5},'gpt-4o':{'name':a0_0x4bdcb1(0xfb),'input_price_1m':2.5},'gpt-5-4-mini':{'name':'GPT-5.4\x20Mini','input_price_1m':0.75},'gpt-5-4-nano':{'name':a0_0x4bdcb1(0x94),'input_price_1m':0.2},'gpt-4-1-mini':{'name':a0_0x4bdcb1(0xd2),'input_price_1m':0.4},'gpt-4-1-nano':{'name':a0_0x4bdcb1(0x88),'input_price_1m':0.1},'gpt-4o-mini':{'name':'GPT-4o\x20Mini','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_0x4bdcb1(0x8f),'input_price_1m':1.1},'cursor-small':{'name':a0_0x4bdcb1(0xbb),'input_price_1m':0.1},'gemini-3-1-pro':{'name':a0_0x4bdcb1(0xf3),'input_price_1m':0x2},'gemini-3-5-flash':{'name':a0_0x4bdcb1(0xc4),'input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':a0_0x4bdcb1(0xcf),'input_price_1m':0.45},'gemini-3-5-live-translate':{'name':'Gemini\x203.5\x20Live\x20Translate','input_price_1m':3.5}};function detectSessionTool(){const _0x4ac3a4=a0_0x4bdcb1,_0x783566=process.env,_0x1172fb={'tool':'','model':'claude-sonnet-4-6','modelShort':''};if(_0x783566[_0x4ac3a4(0xa8)]&&exports['PRICING'][_0x783566[_0x4ac3a4(0xa8)]])return{'tool':'','model':_0x783566[_0x4ac3a4(0xa8)],'modelShort':''};const _0xd6cea9=(_0x783566[_0x4ac3a4(0x12a)]||'')[_0x4ac3a4(0xa4)]();if(_0xd6cea9){if(_0xd6cea9[_0x4ac3a4(0x11f)]('claude-code')||_0xd6cea9['includes'](_0x4ac3a4(0xf2))){const _0x528b52=_0x783566[_0x4ac3a4(0xa9)]===_0x4ac3a4(0xc6)?'opus':'sonnet',_0x580521=_0x783566['CLAUDE_EFFORT']===_0x4ac3a4(0xc6)?_0x4ac3a4(0xa2):_0x4ac3a4(0x104);return{'tool':_0x4ac3a4(0x89),'model':_0x580521,'modelShort':_0x528b52};}if(_0xd6cea9[_0x4ac3a4(0x11f)]('cursor'))return{'tool':'cursor','model':_0x4ac3a4(0x104),'modelShort':_0x4ac3a4(0xb6)};if(_0xd6cea9[_0x4ac3a4(0x11f)](_0x4ac3a4(0x10d))||_0xd6cea9[_0x4ac3a4(0x11f)](_0x4ac3a4(0x129))){const _0xeb4089=_0x783566[_0x4ac3a4(0x8a)]||'';if(_0xeb4089&&exports[_0x4ac3a4(0xc1)][_0xeb4089])return{'tool':'copilot','model':_0xeb4089,'modelShort':_0xeb4089[_0x4ac3a4(0x8b)]('-')[_0x4ac3a4(0xdf)]()||''};return{'tool':_0x4ac3a4(0x129),'model':_0x4ac3a4(0xa6),'modelShort':_0x4ac3a4(0xb6)};}if(_0xd6cea9[_0x4ac3a4(0x11f)](_0x4ac3a4(0x99)))return{'tool':'gemini','model':_0x4ac3a4(0xe7),'modelShort':_0x4ac3a4(0xb0)};if(_0xd6cea9[_0x4ac3a4(0x11f)](_0x4ac3a4(0xcc)))return{'tool':_0x4ac3a4(0xcc),'model':_0x4ac3a4(0x128),'modelShort':_0x4ac3a4(0xe0)};if(_0xd6cea9[_0x4ac3a4(0x11f)]('devin'))return{'tool':_0x4ac3a4(0xa3),'model':_0x4ac3a4(0x104),'modelShort':''};if(_0xd6cea9[_0x4ac3a4(0x11f)](_0x4ac3a4(0x116)))return{'tool':'antigravity','model':_0x4ac3a4(0x121),'modelShort':_0x4ac3a4(0x99)};if(_0xd6cea9[_0x4ac3a4(0x11f)](_0x4ac3a4(0xa0))||_0x783566[_0x4ac3a4(0x98)])return{'tool':_0x4ac3a4(0xa0),'model':'claude-sonnet-4-6','modelShort':''};return{'tool':_0xd6cea9[_0x4ac3a4(0x8b)]('_')[0x0][_0x4ac3a4(0x8b)]('-')[0x0],'model':_0x4ac3a4(0x104),'modelShort':''};}if(_0x783566[_0x4ac3a4(0xd3)]==='1'||_0x783566[_0x4ac3a4(0xd1)]==='1'){const _0x4e399f=_0x783566['CLAUDE_EFFORT']===_0x4ac3a4(0xc6)?_0x4ac3a4(0x109):_0x4ac3a4(0xb6),_0x5924fa=_0x783566[_0x4ac3a4(0xa9)]===_0x4ac3a4(0xc6)?_0x4ac3a4(0xa2):_0x4ac3a4(0x104);return{'tool':'claude','model':_0x5924fa,'modelShort':_0x4e399f};}if(_0x783566[_0x4ac3a4(0x96)]==='1')return{'tool':'cursor','model':'claude-sonnet-4-6','modelShort':_0x4ac3a4(0xb6)};if(_0x783566[_0x4ac3a4(0x118)]==='1')return{'tool':_0x4ac3a4(0x99),'model':'gemini-3-5-flash','modelShort':'flash'};if(_0x783566[_0x4ac3a4(0x8a)]||_0x783566[_0x4ac3a4(0xd5)]){const _0x2e54c5=_0x783566[_0x4ac3a4(0x8a)]||'';if(_0x2e54c5&&exports['PRICING'][_0x2e54c5])return{'tool':_0x4ac3a4(0x129),'model':_0x2e54c5,'modelShort':_0x2e54c5['split']('-')['pop']()||''};return{'tool':_0x4ac3a4(0x129),'model':_0x4ac3a4(0xa6),'modelShort':'sonnet'};}if(_0x783566['REPL_ID']||_0x783566['REPLIT_ENVIRONMENT'])return{'tool':'replit','model':_0x4ac3a4(0x104),'modelShort':''};if(_0x783566[_0x4ac3a4(0xfc)])return{'tool':_0x4ac3a4(0x10e),'model':_0x4ac3a4(0x104),'modelShort':''};if(_0x783566[_0x4ac3a4(0xf7)])return{'tool':_0x4ac3a4(0x9a),'model':_0x4ac3a4(0x104),'modelShort':''};if(_0x783566[_0x4ac3a4(0xe8)]==='1')return{'tool':_0x4ac3a4(0x116),'model':_0x4ac3a4(0x121),'modelShort':_0x4ac3a4(0x99)};if(_0x783566[_0x4ac3a4(0xa9)]){const _0x477944=_0x783566[_0x4ac3a4(0xa9)]===_0x4ac3a4(0xc6)?_0x4ac3a4(0x109):_0x4ac3a4(0xb6),_0x9820bd=_0x783566[_0x4ac3a4(0xa9)]===_0x4ac3a4(0xc6)?'claude-opus-4-8':_0x4ac3a4(0x104);return{'tool':'','model':_0x9820bd,'modelShort':''};}if(_0x783566['AIDER_MODEL']&&exports[_0x4ac3a4(0xc1)][_0x783566[_0x4ac3a4(0xeb)]])return{'tool':_0x4ac3a4(0xd4),'model':_0x783566[_0x4ac3a4(0xeb)],'modelShort':''};if(_0x783566[_0x4ac3a4(0xd8)]){const _0x174cb9=(_0x783566[_0x4ac3a4(0xb2)]||'')[_0x4ac3a4(0xa4)]();if(_0x174cb9[_0x4ac3a4(0x11f)](_0x4ac3a4(0x87)))return{'tool':'cursor','model':_0x4ac3a4(0x104),'modelShort':'sonnet'};if(_0x174cb9[_0x4ac3a4(0x11f)]('windsurf'))return{'tool':'windsurf','model':_0x4ac3a4(0x104),'modelShort':_0x4ac3a4(0xb6)};}const _0x235998=process.env.TRIMPROMPT_MODEL||'';if(_0x235998&&exports['PRICING'][_0x235998])return{'tool':'','model':_0x235998,'modelShort':''};return _0x1172fb;}class Tracker{[a0_0x4bdcb1(0x11b)];[a0_0x4bdcb1(0xe1)];[a0_0x4bdcb1(0xa5)];['logsDir'];[a0_0x4bdcb1(0x125)];constructor(){const _0x14d695=a0_0x4bdcb1;this[_0x14d695(0x11b)]=path['join'](os[_0x14d695(0x86)](),_0x14d695(0xac)),this[_0x14d695(0xe1)]=path[_0x14d695(0x105)](this[_0x14d695(0x11b)],_0x14d695(0xb8)),this[_0x14d695(0xa5)]=path[_0x14d695(0x105)](this[_0x14d695(0x11b)],_0x14d695(0xe6)),this['logsDir']=path[_0x14d695(0x105)](this[_0x14d695(0x11b)],_0x14d695(0xda)),this[_0x14d695(0x9c)]();}[a0_0x4bdcb1(0x9c)](){const _0x386b3b=a0_0x4bdcb1;!fs[_0x386b3b(0xd6)](this[_0x386b3b(0x11b)])&&fs[_0x386b3b(0x120)](this['baseDir'],{'recursive':!![]});!fs[_0x386b3b(0xd6)](this[_0x386b3b(0xb1)])&&fs[_0x386b3b(0x120)](this[_0x386b3b(0xb1)],{'recursive':!![]});const _0x20f9ae={'version':_0x386b3b(0x9f),'telemetry_url':process.env.TRIMPROMPT_TELEMETRY_URL||'','max_output_tokens':0x1388,'redaction_enabled':!![],'default_model':'claude-opus-4-8'};if(fs[_0x386b3b(0xd6)](this[_0x386b3b(0xe1)]))try{const _0x3b0c11=fs[_0x386b3b(0x103)](this[_0x386b3b(0xe1)],'utf8');this[_0x386b3b(0x125)]={..._0x20f9ae,...JSON[_0x386b3b(0x102)](_0x3b0c11)};}catch(_0x166e5a){this['config']=_0x20f9ae;}else this[_0x386b3b(0x125)]=_0x20f9ae,this['saveConfig']();!fs['existsSync'](this[_0x386b3b(0xa5)])&&fs['writeFileSync'](this[_0x386b3b(0xa5)],JSON[_0x386b3b(0xed)]([]),_0x386b3b(0x9b));}[a0_0x4bdcb1(0xf8)](){const _0x3a5474=a0_0x4bdcb1;return process.env.TRIMPROMPT_TELEMETRY_URL&&(this[_0x3a5474(0x125)]['telemetry_url']=process.env.TRIMPROMPT_TELEMETRY_URL),this[_0x3a5474(0x125)];}[a0_0x4bdcb1(0xe4)](_0x1ff7c4,_0x1b40b8){const _0xe725f7=a0_0x4bdcb1;this[_0xe725f7(0x125)][_0x1ff7c4]=_0x1b40b8,this[_0xe725f7(0xf4)]();}['saveConfig'](){const _0x5c7adb=a0_0x4bdcb1;fs[_0x5c7adb(0x11e)](this[_0x5c7adb(0xe1)],JSON[_0x5c7adb(0xed)](this[_0x5c7adb(0x125)],null,0x2),'utf8');}['getLogs'](){const _0x5ce9ff=a0_0x4bdcb1;try{if(!fs[_0x5ce9ff(0xd6)](this[_0x5ce9ff(0xa5)]))return[];const _0x25cf7b=fs[_0x5ce9ff(0x103)](this['statsPath'],_0x5ce9ff(0x9b));return JSON[_0x5ce9ff(0x102)](_0x25cf7b);}catch{return[];}}[a0_0x4bdcb1(0xc7)](_0x25e8c3){const _0x1c5777=a0_0x4bdcb1;fs[_0x1c5777(0x11e)](this[_0x1c5777(0xa5)],JSON[_0x1c5777(0xed)](_0x25e8c3,null,0x2),_0x1c5777(0x9b));}[a0_0x4bdcb1(0x122)](_0x3617c6,_0x632d1f,_0xa14903,_0x3fa2e6,_0x2de340){const _0x4eb7ea=a0_0x4bdcb1,_0x568a12=this[_0x4eb7ea(0xd7)](),_0x5e675f=_0x632d1f[_0x4eb7ea(0x127)],_0x23ea9f=_0xa14903[_0x4eb7ea(0x127)],_0x1d482a=Math[_0x4eb7ea(0xd0)](_0x5e675f/0x4),_0x17c3cb=Math[_0x4eb7ea(0xd0)](_0x23ea9f/0x4),_0x465c22=Math[_0x4eb7ea(0xf0)](0x0,_0x1d482a-_0x17c3cb),_0x1a2691=detectSessionTool(),_0x39a64a=_0x1a2691[_0x4eb7ea(0xc2)],_0x1bc2ce=Math[_0x4eb7ea(0x91)]()['toString'](0x24)[_0x4eb7ea(0xa1)](0x2,0xb);try{const {redactor:_0x5b3709}=require(_0x4eb7ea(0xf6)),_0x502ddb=_0x5b3709?_0x5b3709[_0x4eb7ea(0x113)](_0x632d1f):_0x632d1f;fs[_0x4eb7ea(0x11e)](path[_0x4eb7ea(0x105)](this['logsDir'],_0x1bc2ce+_0x4eb7ea(0x93)),_0x502ddb,_0x4eb7ea(0x9b)),fs['writeFileSync'](path['join'](this['logsDir'],_0x1bc2ce+_0x4eb7ea(0xb9)),_0xa14903,'utf8');}catch{}const _0x220883=_0x3617c6[_0x4eb7ea(0x8b)]('\x20')[0x0]||'unknown',_0x4648bb=_0x1a2691[_0x4eb7ea(0xab)]?_0x1a2691[_0x4eb7ea(0x9e)]?_0x1a2691[_0x4eb7ea(0xab)]+'-'+_0x1a2691['modelShort']+'-'+_0x220883:_0x1a2691[_0x4eb7ea(0xab)]+'-'+_0x220883:_0x220883,_0x270d96={'id':_0x1bc2ce,'timestamp':new Date()['toISOString'](),'command':_0x4648bb,'raw_chars':_0x5e675f,'compressed_chars':_0x23ea9f,'estimated_raw_tokens':_0x1d482a,'estimated_compressed_tokens':_0x17c3cb,'tokens_saved':_0x465c22,'model_used':_0x39a64a,'exit_code':_0x3fa2e6,'synced':![],'ai_detected':!!_0x1a2691[_0x4eb7ea(0xab)],'secrets_found':_0x2de340?.['secretsFound']||0x0,'secret_types':_0x2de340?.[_0x4eb7ea(0xde)]||[]};_0x568a12[_0x4eb7ea(0xbd)](_0x270d96),this[_0x4eb7ea(0xc7)](_0x568a12);const _0x551744=this[_0x4eb7ea(0xf8)]()[_0x4eb7ea(0x107)];return _0x551744&&_0x551744[_0x4eb7ea(0xcd)]()[_0x4eb7ea(0x127)]>0x0&&this[_0x4eb7ea(0x11a)](),_0x2de340&&_0x2de340['secretsFound']>0x0&&this[_0x4eb7ea(0x11d)](_0x270d96,_0x2de340),_0x270d96;}[a0_0x4bdcb1(0x11d)](_0x4d9df4,_0x2d047e){const _0x485923=a0_0x4bdcb1;try{let _0x403a10=this['getConfig']()[_0x485923(0x107)]||'';if(!_0x403a10)return;_0x403a10=_0x403a10[_0x485923(0xe3)](/\/api\/telemetry\/?$/,'/api/security/alert');if(!_0x403a10[_0x485923(0x11f)](_0x485923(0x100)))_0x403a10+=_0x485923(0x100);const {execSync:_0x2f0e2e}=require('child_process');let _0x495ad7=_0x485923(0xc8);try{_0x495ad7=require(_0x485923(0xa7))[_0x485923(0xe9)](_0x485923(0x10f),{'stdio':['ignore',_0x485923(0x117),_0x485923(0xc0)]})[_0x485923(0xb4)]()[_0x485923(0xcd)]();}catch{}if(!_0x495ad7||!_0x495ad7['includes']('@'))try{_0x495ad7=require('os')[_0x485923(0x101)]()[_0x485923(0xea)];}catch{}const _0x435261=JSON[_0x485923(0xed)]({'developer_id':_0x495ad7,'timestamp':_0x4d9df4[_0x485923(0xd9)],'command':_0x4d9df4[_0x485923(0xdb)],'secrets_found':_0x2d047e['secretsFound'],'secret_types':_0x2d047e[_0x485923(0xde)],'os':require('os')[_0x485923(0x10c)]()}),_0x1c5fea=_0x485923(0xf5)+JSON[_0x485923(0xed)](_0x403a10)+').protocol===\x27https:\x27?\x27https\x27:\x27http\x27);const\x20r=h.request('+JSON['stringify'](_0x403a10)+_0x485923(0x8d)+JSON[_0x485923(0xed)](_0x435261)+')',_0x48f44b=(0x0,child_process_1['spawn'])(process[_0x485923(0xad)],['-e',_0x1c5fea],{'detached':!![],'stdio':'ignore'});_0x48f44b[_0x485923(0xce)]();}catch{}}[a0_0x4bdcb1(0x11a)](){const _0xd6c579=a0_0x4bdcb1;try{const _0x1ecc5d=path[_0xd6c579(0x105)](__dirname,'sync.js');if(fs['existsSync'](_0x1ecc5d)){const _0x35e078=(0x0,child_process_1[_0xd6c579(0x97)])(process['execPath'],[_0x1ecc5d],{'detached':!![],'stdio':_0xd6c579(0xc0)});_0x35e078[_0xd6c579(0xce)]();}}catch{}}['getStatsSummary'](_0x27881d=a0_0x4bdcb1(0x110)){const _0x1ea0ef=a0_0x4bdcb1,_0x1526f0=this['getLogs']();let _0x4673c2=0x0,_0x154456=0x0,_0x6b1f85=0x0;for(const _0x5cbc14 of _0x1526f0){_0x4673c2+=_0x5cbc14[_0x1ea0ef(0xcb)],_0x154456+=_0x5cbc14[_0x1ea0ef(0x11c)],_0x6b1f85+=_0x5cbc14[_0x1ea0ef(0xef)];}let _0x4b6eca=_0x27881d;(!_0x4b6eca||_0x4b6eca===_0x1ea0ef(0x110)||!exports['PRICING'][_0x4b6eca])&&(_0x1526f0[_0x1ea0ef(0x127)]>0x0&&_0x1526f0[_0x1526f0[_0x1ea0ef(0x127)]-0x1]['model_used']?_0x4b6eca=_0x1526f0[_0x1526f0[_0x1ea0ef(0x127)]-0x1][_0x1ea0ef(0xff)]:_0x4b6eca=this['getConfig']()[_0x1ea0ef(0xdd)]||_0x1ea0ef(0xf1));const _0x2060e0=exports[_0x1ea0ef(0xc1)][_0x4b6eca]||exports['PRICING']['claude-3-5-sonnet'],_0x468357=_0x6b1f85*_0x2060e0['input_price_1m']/0xf4240,_0x333de5=_0x4673c2*_0x2060e0[_0x1ea0ef(0x108)]/0xf4240,_0xdddae9=_0x154456*_0x2060e0[_0x1ea0ef(0x108)]/0xf4240,_0x266682=_0x4673c2>0x0?_0x6b1f85/_0x4673c2*0x64:0x0;return{'total_raw_tokens':_0x4673c2,'total_compressed_tokens':_0x154456,'total_tokens_saved':_0x6b1f85,'savings_percentage':parseFloat(_0x266682[_0x1ea0ef(0x90)](0x1)),'money_saved_usd':parseFloat(_0x468357['toFixed'](0x4)),'raw_cost_usd':parseFloat(_0x333de5[_0x1ea0ef(0x90)](0x4)),'compressed_cost_usd':parseFloat(_0xdddae9[_0x1ea0ef(0x90)](0x4)),'model_name':_0x2060e0[_0x1ea0ef(0x92)],'model_key':_0x4b6eca};}}exports[a0_0x4bdcb1(0xb5)]=Tracker,exports['tracker']=new Tracker();