trimprompt 1.0.30 → 1.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/api-proxy.js +1 -1
- package/cache-manager.js +1 -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 +99 -1
- package/filters/index.js +185 -1
- package/filters/js.js +78 -1
- package/filters/python.js +130 -1
- package/filters/rust.js +115 -1
- package/filters/shell.js +395 -1
- package/hooks/claude-hook.js +79 -1
- package/mcp.js +132 -1
- package/package.json +1 -4
- package/proxy-conv.js +181 -1
- package/proxy-daemon.js +382 -1
- package/proxy-resp.js +1 -1
- package/redactor.js +1 -1
- package/seed.js +1 -1
- package/shims.js +1 -1
- package/simulate.js +1 -1
- package/sync.js +1 -1
- package/tracker.js +1 -1
- package/traffic-interceptor.js +1 -1
package/proxy-daemon.js
CHANGED
|
@@ -1 +1,382 @@
|
|
|
1
|
-
'use strict';const a0_0x40fd32=a0_0x53cb;(function(_0x388cbe,_0xc844b8){const _0x18d5e0=a0_0x53cb,_0x38e39e=_0x388cbe();while(!![]){try{const _0x4a7f1e=parseInt(_0x18d5e0(0x12f))/0x1+parseInt(_0x18d5e0(0x134))/0x2*(-parseInt(_0x18d5e0(0x131))/0x3)+parseInt(_0x18d5e0(0x142))/0x4*(-parseInt(_0x18d5e0(0x119))/0x5)+-parseInt(_0x18d5e0(0x144))/0x6*(parseInt(_0x18d5e0(0x147))/0x7)+-parseInt(_0x18d5e0(0x178))/0x8+parseInt(_0x18d5e0(0x135))/0x9*(-parseInt(_0x18d5e0(0x122))/0xa)+parseInt(_0x18d5e0(0x133))/0xb;if(_0x4a7f1e===_0xc844b8)break;else _0x38e39e['push'](_0x38e39e['shift']());}catch(_0xf24030){_0x38e39e['push'](_0x38e39e['shift']());}}}(a0_0xd5a2,0xac99e));var __createBinding=this&&this[a0_0x40fd32(0x153)]||(Object['create']?function(_0x5a8327,_0x1716e7,_0x27e070,_0x106287){const _0x2884e3=a0_0x40fd32;if(_0x106287===undefined)_0x106287=_0x27e070;var _0x12bed8=Object['getOwnPropertyDescriptor'](_0x1716e7,_0x27e070);(!_0x12bed8||(_0x2884e3(0x167)in _0x12bed8?!_0x1716e7[_0x2884e3(0x148)]:_0x12bed8[_0x2884e3(0x10f)]||_0x12bed8[_0x2884e3(0x172)]))&&(_0x12bed8={'enumerable':!![],'get':function(){return _0x1716e7[_0x27e070];}}),Object[_0x2884e3(0x143)](_0x5a8327,_0x106287,_0x12bed8);}:function(_0x5510e5,_0x415ca8,_0x5209ba,_0x16ef7f){if(_0x16ef7f===undefined)_0x16ef7f=_0x5209ba;_0x5510e5[_0x16ef7f]=_0x415ca8[_0x5209ba];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a0_0x40fd32(0x112)]?function(_0x37ec6a,_0x17b0e4){const _0x2fcdbb=a0_0x40fd32;Object[_0x2fcdbb(0x143)](_0x37ec6a,_0x2fcdbb(0x12d),{'enumerable':!![],'value':_0x17b0e4});}:function(_0x5e6568,_0x40c23d){const _0x53bef8=a0_0x40fd32;_0x5e6568[_0x53bef8(0x12d)]=_0x40c23d;}),__importStar=this&&this['__importStar']||(function(){var _0x4daf40=function(_0xa7ce8d){const _0x3fa863=a0_0x53cb;return _0x4daf40=Object[_0x3fa863(0x18f)]||function(_0x26811d){const _0x5687fe=_0x3fa863;var _0x326f3b=[];for(var _0x1b6cd3 in _0x26811d)if(Object['prototype'][_0x5687fe(0x14c)][_0x5687fe(0x118)](_0x26811d,_0x1b6cd3))_0x326f3b[_0x326f3b[_0x5687fe(0x145)]]=_0x1b6cd3;return _0x326f3b;},_0x4daf40(_0xa7ce8d);};return function(_0x987d35){const _0xbae4ff=a0_0x53cb;if(_0x987d35&&_0x987d35[_0xbae4ff(0x148)])return _0x987d35;var _0x5eae0f={};if(_0x987d35!=null){for(var _0x326baf=_0x4daf40(_0x987d35),_0x2328e5=0x0;_0x2328e5<_0x326baf[_0xbae4ff(0x145)];_0x2328e5++)if(_0x326baf[_0x2328e5]!==_0xbae4ff(0x12d))__createBinding(_0x5eae0f,_0x987d35,_0x326baf[_0x2328e5]);}return __setModuleDefault(_0x5eae0f,_0x987d35),_0x5eae0f;};}());Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a0_0x40fd32(0x185)]=getProxyPort,exports[a0_0x40fd32(0x111)]=isProxyRunning,exports[a0_0x40fd32(0x165)]=startProxyDaemon,exports[a0_0x40fd32(0x163)]=stopProxyDaemon,exports[a0_0x40fd32(0x155)]=enableAutostart,exports[a0_0x40fd32(0x188)]=disableAutostart,exports[a0_0x40fd32(0x179)]=setAnthropicBaseUrl,exports[a0_0x40fd32(0x14e)]=removeAnthropicBaseUrl;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x40fd32(0x13b))),os=__importStar(require('os')),child_process_1=require(a0_0x40fd32(0x158)),baseDir=path[a0_0x40fd32(0x180)](os['homedir'](),'.trimprompt'),pidFile=path[a0_0x40fd32(0x180)](baseDir,'proxy.pid'),portFile=path['join'](baseDir,a0_0x40fd32(0x10d)),DEFAULT_PORT=0x1f90;function ensureDir(){const _0x139a63=a0_0x40fd32;if(!fs[_0x139a63(0x166)](baseDir))fs[_0x139a63(0x169)](baseDir,{'recursive':!![]});}function getProxyPort(){const _0x331bc5=a0_0x40fd32;try{if(fs[_0x331bc5(0x166)](portFile))return parseInt(fs[_0x331bc5(0x113)](portFile,_0x331bc5(0x136))[_0x331bc5(0x17e)]())||DEFAULT_PORT;}catch{}return DEFAULT_PORT;}function isProxyRunning(){const _0xc8929f=a0_0x40fd32,_0x180cd6=getProxyPort();try{if(!fs[_0xc8929f(0x166)](pidFile))return{'running':![],'pid':null,'port':_0x180cd6};const _0x420ed3=parseInt(fs[_0xc8929f(0x113)](pidFile,_0xc8929f(0x136))['trim']());if(!_0x420ed3)return{'running':![],'pid':null,'port':_0x180cd6};if(process[_0xc8929f(0x15c)]===_0xc8929f(0x129)){const _0x59f230=(0x0,child_process_1[_0xc8929f(0x146)])('tasklist\x20/FI\x20\x22PID\x20eq\x20'+_0x420ed3+_0xc8929f(0x193),{'encoding':_0xc8929f(0x136),'timeout':0x1388}),_0x15585d='\x22'+_0x420ed3+'\x22';if(_0x59f230[_0xc8929f(0x132)]('\x0a')[_0xc8929f(0x161)](_0x768272=>_0x768272[_0xc8929f(0x186)](_0x15585d)))return{'running':!![],'pid':_0x420ed3,'port':_0x180cd6};}else return process[_0xc8929f(0x156)](_0x420ed3,0x0),{'running':!![],'pid':_0x420ed3,'port':_0x180cd6};}catch{}try{fs[_0xc8929f(0x15f)](pidFile);}catch{}return{'running':![],'pid':null,'port':_0x180cd6};}function startProxyDaemon(_0x12c736){const _0x54b810=a0_0x40fd32,_0x143523=isProxyRunning();if(_0x143523[_0x54b810(0x17c)])return{'success':!![],'pid':_0x143523[_0x54b810(0x13d)],'port':_0x143523['port'],'message':'Proxy\x20already\x20running\x20(pid\x20'+_0x143523[_0x54b810(0x13d)]+_0x54b810(0x127)+_0x143523[_0x54b810(0x181)]};ensureDir();const _0x34c209=_0x12c736||DEFAULT_PORT;try{const _0xd3e415=path[_0x54b810(0x180)](__dirname,_0x54b810(0x15b));if(!fs[_0x54b810(0x166)](_0xd3e415))return{'success':![],'pid':null,'port':_0x34c209,'message':_0x54b810(0x138)+_0xd3e415};const _0x4be287=(0x0,child_process_1['spawn'])(process[_0x54b810(0x13f)],[_0xd3e415,_0x54b810(0x14b),_0x54b810(0x117),String(_0x34c209)],{'detached':!![],'stdio':_0x54b810(0x187),'env':{...process.env,'TRIMPROMPT_DISABLED':'1'}});_0x4be287[_0x54b810(0x192)]();if(_0x4be287[_0x54b810(0x13d)])return fs['writeFileSync'](pidFile,String(_0x4be287[_0x54b810(0x13d)]),'utf8'),fs[_0x54b810(0x15e)](portFile,String(_0x34c209),_0x54b810(0x136)),{'success':!![],'pid':_0x4be287[_0x54b810(0x13d)],'port':_0x34c209,'message':'Proxy\x20started\x20(pid\x20'+_0x4be287[_0x54b810(0x13d)]+_0x54b810(0x127)+_0x34c209};return{'success':![],'pid':null,'port':_0x34c209,'message':_0x54b810(0x18a)};}catch(_0x32b01f){return{'success':![],'pid':null,'port':_0x34c209,'message':_0x54b810(0x17a)+_0x32b01f[_0x54b810(0x13c)]};}}function stopProxyDaemon(){const _0x40a783=a0_0x40fd32,_0x3d10a2=isProxyRunning();if(!_0x3d10a2[_0x40a783(0x17c)]||!_0x3d10a2['pid'])return{'success':!![],'message':'Proxy\x20is\x20not\x20running'};try{process[_0x40a783(0x15c)]==='win32'?(0x0,child_process_1[_0x40a783(0x146)])(_0x40a783(0x16f)+_0x3d10a2[_0x40a783(0x13d)]+_0x40a783(0x175),{'timeout':0x1388}):process[_0x40a783(0x156)](_0x3d10a2[_0x40a783(0x13d)],_0x40a783(0x14f));}catch{}try{fs[_0x40a783(0x15f)](pidFile);}catch{}return{'success':!![],'message':'Proxy\x20stopped\x20(pid\x20'+_0x3d10a2['pid']+')'};}function setClaudeCodeSettings(_0x3d62f9){const _0x59961f=a0_0x40fd32,_0x116d54=path[_0x59961f(0x180)](os[_0x59961f(0x16a)](),'.claude'),_0x55e60b=path['join'](_0x116d54,_0x59961f(0x174));try{if(!fs[_0x59961f(0x166)](_0x116d54))fs[_0x59961f(0x169)](_0x116d54,{'recursive':!![]});let _0xa3298b={};if(fs[_0x59961f(0x166)](_0x55e60b))try{_0xa3298b=JSON[_0x59961f(0x173)](fs[_0x59961f(0x113)](_0x55e60b,_0x59961f(0x136)));}catch{}if(!_0xa3298b[_0x59961f(0x123)])_0xa3298b[_0x59961f(0x123)]={};_0xa3298b[_0x59961f(0x123)][_0x59961f(0x121)]=_0x3d62f9,fs[_0x59961f(0x15e)](_0x55e60b,JSON[_0x59961f(0x12e)](_0xa3298b,null,0x2),_0x59961f(0x136));}catch{}}function a0_0x53cb(_0x209653,_0x2bd384){_0x209653=_0x209653-0x10d;const _0xd5a20f=a0_0xd5a2();let _0x53cb7d=_0xd5a20f[_0x209653];return _0x53cb7d;}function removeClaudeCodeSettings(){const _0x34006a=a0_0x40fd32,_0x4a0f6d=path[_0x34006a(0x180)](os['homedir'](),_0x34006a(0x190),_0x34006a(0x174));try{if(fs['existsSync'](_0x4a0f6d)){const _0x12d921=JSON[_0x34006a(0x173)](fs[_0x34006a(0x113)](_0x4a0f6d,_0x34006a(0x136)));if(_0x12d921[_0x34006a(0x123)]&&_0x12d921['env'][_0x34006a(0x121)]){delete _0x12d921[_0x34006a(0x123)]['ANTHROPIC_BASE_URL'];if(Object[_0x34006a(0x18d)](_0x12d921['env'])[_0x34006a(0x145)]===0x0)delete _0x12d921['env'];fs[_0x34006a(0x15e)](_0x4a0f6d,JSON[_0x34006a(0x12e)](_0x12d921,null,0x2),_0x34006a(0x136));}}}catch{}}const RUN_KEY='HKCU:\x5cSoftware\x5cMicrosoft\x5cWindows\x5cCurrentVersion\x5cRun',RUN_VALUE_NAME=a0_0x40fd32(0x11b),vbsLauncher=path['join'](baseDir,a0_0x40fd32(0x12b));function enableAutostart(){const _0x218a9e=a0_0x40fd32;ensureDir();const _0x5818ea=path['join'](__dirname,_0x218a9e(0x15b));if(process[_0x218a9e(0x15c)]==='win32'){try{const _0xaf1152=_0x218a9e(0x160)+'cmd\x20=\x20Chr(34)\x20&\x20\x22'+process[_0x218a9e(0x13f)]['replace'](/"/g,'\x22\x22')+_0x218a9e(0x159)+_0x5818ea['replace'](/"/g,'\x22\x22')+_0x218a9e(0x16b)+_0x218a9e(0x191);fs['writeFileSync'](vbsLauncher,_0xaf1152,_0x218a9e(0x136));const _0x1558f5='wscript.exe\x20\x22'+vbsLauncher+'\x22',_0x272a9f=_0x218a9e(0x151)+RUN_KEY+'\x27\x20-Force\x20|\x20Out-Null;\x20Set-ItemProperty\x20-Path\x20\x27'+RUN_KEY+'\x27\x20-Name\x20\x27'+RUN_VALUE_NAME+'\x27\x20-Value\x20\x27'+_0x1558f5[_0x218a9e(0x12c)](/'/g,'\x27\x27')+'\x27';(0x0,child_process_1[_0x218a9e(0x146)])(_0x218a9e(0x14a)+_0x272a9f['replace'](/"/g,'\x5c\x22')+'\x22',{'stdio':_0x218a9e(0x187),'timeout':0x1f40});}catch{}return;}if(process['platform']==='darwin'){try{const _0x2379f0=path[_0x218a9e(0x180)](os[_0x218a9e(0x16a)](),'Library',_0x218a9e(0x16d));if(!fs[_0x218a9e(0x166)](_0x2379f0))fs[_0x218a9e(0x169)](_0x2379f0,{'recursive':!![]});const _0x43095d=path[_0x218a9e(0x180)](_0x2379f0,_0x218a9e(0x139)),_0x20e491=_0x218a9e(0x11f)+_0x218a9e(0x137)+_0x218a9e(0x13e)+_0x218a9e(0x183)+'\x20\x20<key>ProgramArguments</key><array>'+('<string>'+process[_0x218a9e(0x13f)]+_0x218a9e(0x168)+_0x5818ea+_0x218a9e(0x18c))+_0x218a9e(0x16c)+_0x218a9e(0x17b)+_0x218a9e(0x154)+_0x218a9e(0x12a);fs[_0x218a9e(0x15e)](_0x43095d,_0x20e491,_0x218a9e(0x136));try{(0x0,child_process_1[_0x218a9e(0x146)])(_0x218a9e(0x184)+_0x43095d+'\x22',{'stdio':_0x218a9e(0x187),'timeout':0x1388});}catch{}(0x0,child_process_1[_0x218a9e(0x146)])(_0x218a9e(0x124)+_0x43095d+'\x22',{'stdio':_0x218a9e(0x187),'timeout':0x1388});}catch{}return;}try{const _0x153790=path['join'](os[_0x218a9e(0x16a)](),_0x218a9e(0x120),_0x218a9e(0x130));if(!fs[_0x218a9e(0x166)](_0x153790))fs[_0x218a9e(0x169)](_0x153790,{'recursive':!![]});const _0x16895c=path['join'](_0x153790,_0x218a9e(0x125)),_0x21615c=_0x218a9e(0x141)+_0x218a9e(0x157)+_0x218a9e(0x15a)+(_0x218a9e(0x150)+process['execPath']+'\x20'+_0x5818ea+_0x218a9e(0x11a))+'X-GNOME-Autostart-enabled=true\x0a'+_0x218a9e(0x114);fs['writeFileSync'](_0x16895c,_0x21615c,'utf8');}catch{}}function disableAutostart(){const _0x42c503=a0_0x40fd32;if(process[_0x42c503(0x15c)]===_0x42c503(0x129)){try{const _0x4dce71='Remove-ItemProperty\x20-Path\x20\x27'+RUN_KEY+_0x42c503(0x115)+RUN_VALUE_NAME+_0x42c503(0x177);(0x0,child_process_1[_0x42c503(0x146)])(_0x42c503(0x14a)+_0x4dce71[_0x42c503(0x12c)](/"/g,'\x5c\x22')+'\x22',{'stdio':_0x42c503(0x187),'timeout':0x1f40});}catch{}try{if(fs['existsSync'](vbsLauncher))fs[_0x42c503(0x15f)](vbsLauncher);}catch{}return;}if(process[_0x42c503(0x15c)]===_0x42c503(0x10e)){try{const _0x4ad579=path[_0x42c503(0x180)](os[_0x42c503(0x16a)](),_0x42c503(0x17f),_0x42c503(0x16d),_0x42c503(0x139));try{(0x0,child_process_1[_0x42c503(0x146)])(_0x42c503(0x184)+_0x4ad579+'\x22',{'stdio':_0x42c503(0x187),'timeout':0x1388});}catch{}if(fs[_0x42c503(0x166)](_0x4ad579))fs['unlinkSync'](_0x4ad579);}catch{}return;}try{const _0xda1b87=path[_0x42c503(0x180)](os[_0x42c503(0x16a)](),_0x42c503(0x120),_0x42c503(0x130),_0x42c503(0x125));if(fs['existsSync'](_0xda1b87))fs['unlinkSync'](_0xda1b87);}catch{}}function a0_0xd5a2(){const _0x53a020=['\x5c$&','Spawn\x20returned\x20no\x20PID','push','</string><string>proxy</string><string>start</string>','keys','export\x20GOOGLE_AI_BASE_URL=\x22','getOwnPropertyNames','.claude','WshShell.Run\x20cmd,\x200,\x20False\x0d\x0a','unref','\x22\x20/FO\x20CSV\x20/NH','proxy.port','darwin','writable','powershell','isProxyRunning','create','readFileSync','NoDisplay=true\x0a','\x27\x20-Name\x20\x27','REG\x20DELETE\x20\x22HKCU\x5cEnvironment\x22\x20/V\x20ANTHROPIC_BASE_URL\x20/F','--port','call','2005dsExCa','\x20proxy\x20install\x0a','TrimPromptProxy','#\x20TrimPrompt\x20API\x20Proxy','setx\x20GOOGLE_AI_BASE_URL\x20\x22','$env:GOOGLE_AI_BASE_URL\x20=\x20\x22','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a','.config','ANTHROPIC_BASE_URL','10TdaQky','env','launchctl\x20load\x20\x22','trimprompt-proxy.desktop','.zshrc',')\x20on\x20port\x20','/v1','win32','</dict></plist>\x0a','proxy-autostart.vbs','replace','default','stringify','235891SInSpP','autostart','4254ECbtJB','split','46909687PdXXPY','562mMWLoI','7475859vYeKQx','utf8','<!DOCTYPE\x20plist\x20PUBLIC\x20\x22-//Apple//DTD\x20PLIST\x201.0//EN\x22\x20\x22http://www.apple.com/DTDs/PropertyList-1.0.dtd\x22>\x0a','CLI\x20not\x20found\x20at\x20','ai.trimprompt.proxy.plist','setx\x20OPENAI_BASE_URL\x20\x22','path','message','pid','<plist\x20version=\x221.0\x22><dict>\x0a','execPath','setx\x20GEMINI_BASE_URL\x20\x22','[Desktop\x20Entry]\x0a','8984WCyNdl','defineProperty','6QFhZdU','length','execSync','7013587mCeIBV','__esModule','.*\x5cn?','powershell.exe\x20-NoProfile\x20-Command\x20\x22','proxy','hasOwnProperty','.*\x5cr?\x5cn?','removeAnthropicBaseUrl','SIGTERM','Exec=','New-Item\x20-Path\x20\x27','pwsh','__createBinding','\x20\x20<key>KeepAlive</key><true/>\x0a','enableAutostart','kill','Type=Application\x0a','child_process','\x22\x20&\x20Chr(34)\x20&\x20\x22\x20\x22\x20&\x20Chr(34)\x20&\x20\x22','Name=TrimPrompt\x20Proxy\x0a','cli.js','platform','pipe','writeFileSync','unlinkSync','Set\x20WshShell\x20=\x20CreateObject(\x22WScript.Shell\x22)\x0d\x0a','some','export\x20OPENAI_BASE_URL=\x22','stopProxyDaemon','export\x20ANTHROPIC_BASE_URL=\x22','startProxyDaemon','existsSync','get','</string><string>','mkdirSync','homedir','\x22\x20&\x20Chr(34)\x20&\x20\x22\x20proxy\x20install\x22\x0d\x0a','</array>\x0a','LaunchAgents','http://127.0.0.1:','taskkill\x20/PID\x20','.bashrc','trimEnd','configurable','parse','settings.json','\x20/F','export\x20GEMINI_BASE_URL=\x22','\x27\x20-ErrorAction\x20SilentlyContinue','5293904kaTGVy','setAnthropicBaseUrl','Failed\x20to\x20start\x20proxy:\x20','\x20\x20<key>RunAtLoad</key><true/>\x0a','running','setx\x20ANTHROPIC_BASE_URL\x20\x22','trim','Library','join','port','\x20-NoProfile\x20-Command\x20\x22$PROFILE\x22','\x20\x20<key>Label</key><string>ai.trimprompt.proxy</string>\x0a','launchctl\x20unload\x20\x22','getProxyPort','includes','ignore','disableAutostart'];a0_0xd5a2=function(){return _0x53a020;};return a0_0xd5a2();}function setAnthropicBaseUrl(_0x4ae722){const _0x3e1f3c=a0_0x40fd32,_0x42c281=_0x3e1f3c(0x16e)+_0x4ae722,_0x103399=_0x3e1f3c(0x16e)+_0x4ae722+_0x3e1f3c(0x128);setClaudeCodeSettings(_0x42c281);if(process[_0x3e1f3c(0x15c)]===_0x3e1f3c(0x129))try{(0x0,child_process_1['execSync'])(_0x3e1f3c(0x17d)+_0x42c281+'\x22',{'timeout':0x1388}),(0x0,child_process_1[_0x3e1f3c(0x146)])(_0x3e1f3c(0x13a)+_0x103399+'\x22',{'timeout':0x1388}),(0x0,child_process_1['execSync'])(_0x3e1f3c(0x140)+_0x103399+'\x22',{'timeout':0x1388}),(0x0,child_process_1['execSync'])(_0x3e1f3c(0x11d)+_0x103399+'\x22',{'timeout':0x1388});}catch{}const _0x559621=os[_0x3e1f3c(0x16a)](),_0x1d82d7=_0x3e1f3c(0x11c),_0x16a411=_0x3e1f3c(0x164)+_0x42c281+'\x22\x20'+_0x1d82d7,_0x53680d=_0x3e1f3c(0x162)+_0x103399+'\x22\x20'+_0x1d82d7,_0xcad98f=_0x3e1f3c(0x176)+_0x103399+'\x22\x20'+_0x1d82d7,_0x4d5481=_0x3e1f3c(0x18e)+_0x103399+'\x22\x20'+_0x1d82d7,_0x27457a=[path[_0x3e1f3c(0x180)](_0x559621,_0x3e1f3c(0x170)),path['join'](_0x559621,_0x3e1f3c(0x126)),path[_0x3e1f3c(0x180)](_0x559621,'.bash_profile')];for(const _0x1ccdf5 of _0x27457a){try{if(fs[_0x3e1f3c(0x166)](_0x1ccdf5)){let _0xc6bc4a=fs['readFileSync'](_0x1ccdf5,_0x3e1f3c(0x136));_0xc6bc4a['includes'](_0x1d82d7)&&(_0xc6bc4a=_0xc6bc4a[_0x3e1f3c(0x12c)](new RegExp('.*'+_0x1d82d7['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&')+_0x3e1f3c(0x149),'g'),'')),_0xc6bc4a=_0xc6bc4a[_0x3e1f3c(0x171)]()+'\x0a'+_0x16a411+'\x0a'+_0x53680d+'\x0a'+_0xcad98f+'\x0a'+_0x4d5481+'\x0a',fs['writeFileSync'](_0x1ccdf5,_0xc6bc4a,_0x3e1f3c(0x136));}}catch{}}try{const _0x49be8e=[];for(const _0x2e473d of[_0x3e1f3c(0x110),_0x3e1f3c(0x152)]){try{const _0x28b0c9=(0x0,child_process_1[_0x3e1f3c(0x146)])(_0x2e473d+'\x20-NoProfile\x20-Command\x20\x22$PROFILE\x22',{'encoding':'utf8','timeout':0xbb8,'stdio':[_0x3e1f3c(0x15d),_0x3e1f3c(0x15d),'ignore']})[_0x3e1f3c(0x17e)]();if(_0x28b0c9&&!_0x49be8e[_0x3e1f3c(0x186)](_0x28b0c9))_0x49be8e[_0x3e1f3c(0x18b)](_0x28b0c9);}catch{}}const _0x491146=_0x3e1f3c(0x11c),_0x87e6b3='$env:ANTHROPIC_BASE_URL\x20=\x20\x22'+_0x42c281+'\x22\x20'+_0x491146,_0x7dac4c='$env:OPENAI_BASE_URL\x20=\x20\x22'+_0x103399+'\x22\x20'+_0x491146,_0x1620e2='$env:GEMINI_BASE_URL\x20=\x20\x22'+_0x103399+'\x22\x20'+_0x491146,_0x138373=_0x3e1f3c(0x11e)+_0x103399+'\x22\x20'+_0x491146;for(const _0x47ace5 of _0x49be8e){try{const _0x456e8e=path['dirname'](_0x47ace5);if(!fs['existsSync'](_0x456e8e))fs[_0x3e1f3c(0x169)](_0x456e8e,{'recursive':!![]});let _0x5ef3b9=fs['existsSync'](_0x47ace5)?fs[_0x3e1f3c(0x113)](_0x47ace5,'utf8'):'';_0x5ef3b9[_0x3e1f3c(0x186)](_0x491146)&&(_0x5ef3b9=_0x5ef3b9[_0x3e1f3c(0x12c)](new RegExp('.*'+_0x491146[_0x3e1f3c(0x12c)](/[.*+?^${}()|[\]\\]/g,_0x3e1f3c(0x189))+'.*\x5cr?\x5cn?','g'),'')),_0x5ef3b9=_0x5ef3b9[_0x3e1f3c(0x171)]()+'\x0a'+_0x87e6b3+'\x0a'+_0x7dac4c+'\x0a'+_0x1620e2+'\x0a'+_0x138373+'\x0a',fs['writeFileSync'](_0x47ace5,_0x5ef3b9,_0x3e1f3c(0x136));}catch{}}}catch{}}function removeAnthropicBaseUrl(){const _0x1c1bcc=a0_0x40fd32;removeClaudeCodeSettings();if(process[_0x1c1bcc(0x15c)]===_0x1c1bcc(0x129))try{(0x0,child_process_1[_0x1c1bcc(0x146)])(_0x1c1bcc(0x116),{'timeout':0x1388});}catch{}const _0x3e793d=os[_0x1c1bcc(0x16a)](),_0x2c3955=_0x1c1bcc(0x11c),_0x307695=[path['join'](_0x3e793d,_0x1c1bcc(0x170)),path[_0x1c1bcc(0x180)](_0x3e793d,_0x1c1bcc(0x126)),path[_0x1c1bcc(0x180)](_0x3e793d,'.bash_profile')];for(const _0xdd9aaa of _0x307695){try{if(fs[_0x1c1bcc(0x166)](_0xdd9aaa)){let _0x2ef245=fs[_0x1c1bcc(0x113)](_0xdd9aaa,'utf8');_0x2ef245[_0x1c1bcc(0x186)](_0x2c3955)&&(_0x2ef245=_0x2ef245[_0x1c1bcc(0x12c)](new RegExp('.*'+_0x2c3955[_0x1c1bcc(0x12c)](/[.*+?^${}()|[\]\\]/g,_0x1c1bcc(0x189))+_0x1c1bcc(0x14d),'g'),''),fs[_0x1c1bcc(0x15e)](_0xdd9aaa,_0x2ef245,_0x1c1bcc(0x136)));}}catch{}}try{for(const _0x3497e2 of['powershell',_0x1c1bcc(0x152)]){try{const _0x2f445a=(0x0,child_process_1['execSync'])(_0x3497e2+_0x1c1bcc(0x182),{'encoding':_0x1c1bcc(0x136),'timeout':0xbb8,'stdio':['pipe',_0x1c1bcc(0x15d),_0x1c1bcc(0x187)]})['trim']();if(_0x2f445a&&fs[_0x1c1bcc(0x166)](_0x2f445a)){let _0x20b17e=fs['readFileSync'](_0x2f445a,_0x1c1bcc(0x136));const _0x4b7e80=_0x1c1bcc(0x11c);_0x20b17e[_0x1c1bcc(0x186)](_0x4b7e80)&&(_0x20b17e=_0x20b17e[_0x1c1bcc(0x12c)](new RegExp('.*'+_0x4b7e80[_0x1c1bcc(0x12c)](/[.*+?^${}()|[\]\\]/g,'\x5c$&')+_0x1c1bcc(0x14d),'g'),''),fs['writeFileSync'](_0x2f445a,_0x20b17e,_0x1c1bcc(0x136)));}}catch{}}}catch{}}
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.getProxyPort = getProxyPort;
|
|
37
|
+
exports.isProxyRunning = isProxyRunning;
|
|
38
|
+
exports.startProxyDaemon = startProxyDaemon;
|
|
39
|
+
exports.stopProxyDaemon = stopProxyDaemon;
|
|
40
|
+
exports.enableAutostart = enableAutostart;
|
|
41
|
+
exports.disableAutostart = disableAutostart;
|
|
42
|
+
exports.setAnthropicBaseUrl = setAnthropicBaseUrl;
|
|
43
|
+
exports.removeAnthropicBaseUrl = removeAnthropicBaseUrl;
|
|
44
|
+
const fs = __importStar(require("fs"));
|
|
45
|
+
const path = __importStar(require("path"));
|
|
46
|
+
const os = __importStar(require("os"));
|
|
47
|
+
const child_process_1 = require("child_process");
|
|
48
|
+
const baseDir = path.join(os.homedir(), '.trimprompt');
|
|
49
|
+
const pidFile = path.join(baseDir, 'proxy.pid');
|
|
50
|
+
const portFile = path.join(baseDir, 'proxy.port');
|
|
51
|
+
const DEFAULT_PORT = 8080;
|
|
52
|
+
function ensureDir() {
|
|
53
|
+
if (!fs.existsSync(baseDir))
|
|
54
|
+
fs.mkdirSync(baseDir, { recursive: true });
|
|
55
|
+
}
|
|
56
|
+
function getProxyPort() {
|
|
57
|
+
try {
|
|
58
|
+
if (fs.existsSync(portFile))
|
|
59
|
+
return parseInt(fs.readFileSync(portFile, 'utf8').trim()) || DEFAULT_PORT;
|
|
60
|
+
}
|
|
61
|
+
catch { }
|
|
62
|
+
return DEFAULT_PORT;
|
|
63
|
+
}
|
|
64
|
+
function isProxyRunning() {
|
|
65
|
+
const port = getProxyPort();
|
|
66
|
+
try {
|
|
67
|
+
if (!fs.existsSync(pidFile))
|
|
68
|
+
return { running: false, pid: null, port };
|
|
69
|
+
const pid = parseInt(fs.readFileSync(pidFile, 'utf8').trim());
|
|
70
|
+
if (!pid)
|
|
71
|
+
return { running: false, pid: null, port };
|
|
72
|
+
if (process.platform === 'win32') {
|
|
73
|
+
const result = (0, child_process_1.execSync)(`tasklist /FI "PID eq ${pid}" /FO CSV /NH`, { encoding: 'utf8', timeout: 5000 });
|
|
74
|
+
const pidStr = `"${pid}"`;
|
|
75
|
+
if (result.split('\n').some(line => line.includes(pidStr)))
|
|
76
|
+
return { running: true, pid, port };
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
process.kill(pid, 0);
|
|
80
|
+
return { running: true, pid, port };
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
catch { }
|
|
84
|
+
try {
|
|
85
|
+
fs.unlinkSync(pidFile);
|
|
86
|
+
}
|
|
87
|
+
catch { }
|
|
88
|
+
return { running: false, pid: null, port };
|
|
89
|
+
}
|
|
90
|
+
function startProxyDaemon(port) {
|
|
91
|
+
const status = isProxyRunning();
|
|
92
|
+
if (status.running) {
|
|
93
|
+
return { success: true, pid: status.pid, port: status.port, message: `Proxy already running (pid ${status.pid}) on port ${status.port}` };
|
|
94
|
+
}
|
|
95
|
+
ensureDir();
|
|
96
|
+
const usePort = port || DEFAULT_PORT;
|
|
97
|
+
try {
|
|
98
|
+
const cliPath = path.join(__dirname, 'cli.js');
|
|
99
|
+
if (!fs.existsSync(cliPath)) {
|
|
100
|
+
return { success: false, pid: null, port: usePort, message: `CLI not found at ${cliPath}` };
|
|
101
|
+
}
|
|
102
|
+
const child = (0, child_process_1.spawn)(process.execPath, [cliPath, 'proxy', '--port', String(usePort)], {
|
|
103
|
+
detached: true,
|
|
104
|
+
stdio: 'ignore',
|
|
105
|
+
env: { ...process.env, TRIMPROMPT_DISABLED: '1' },
|
|
106
|
+
});
|
|
107
|
+
child.unref();
|
|
108
|
+
if (child.pid) {
|
|
109
|
+
fs.writeFileSync(pidFile, String(child.pid), 'utf8');
|
|
110
|
+
fs.writeFileSync(portFile, String(usePort), 'utf8');
|
|
111
|
+
return { success: true, pid: child.pid, port: usePort, message: `Proxy started (pid ${child.pid}) on port ${usePort}` };
|
|
112
|
+
}
|
|
113
|
+
return { success: false, pid: null, port: usePort, message: 'Spawn returned no PID' };
|
|
114
|
+
}
|
|
115
|
+
catch (err) {
|
|
116
|
+
return { success: false, pid: null, port: usePort, message: `Failed to start proxy: ${err.message}` };
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function stopProxyDaemon() {
|
|
120
|
+
const status = isProxyRunning();
|
|
121
|
+
if (!status.running || !status.pid) {
|
|
122
|
+
return { success: true, message: 'Proxy is not running' };
|
|
123
|
+
}
|
|
124
|
+
try {
|
|
125
|
+
if (process.platform === 'win32') {
|
|
126
|
+
(0, child_process_1.execSync)(`taskkill /PID ${status.pid} /F`, { timeout: 5000 });
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
process.kill(status.pid, 'SIGTERM');
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
catch { }
|
|
133
|
+
try {
|
|
134
|
+
fs.unlinkSync(pidFile);
|
|
135
|
+
}
|
|
136
|
+
catch { }
|
|
137
|
+
return { success: true, message: `Proxy stopped (pid ${status.pid})` };
|
|
138
|
+
}
|
|
139
|
+
function setClaudeCodeSettings(url) {
|
|
140
|
+
const claudeDir = path.join(os.homedir(), '.claude');
|
|
141
|
+
const settingsPath = path.join(claudeDir, 'settings.json');
|
|
142
|
+
try {
|
|
143
|
+
if (!fs.existsSync(claudeDir))
|
|
144
|
+
fs.mkdirSync(claudeDir, { recursive: true });
|
|
145
|
+
let settings = {};
|
|
146
|
+
if (fs.existsSync(settingsPath)) {
|
|
147
|
+
try {
|
|
148
|
+
settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8'));
|
|
149
|
+
}
|
|
150
|
+
catch { }
|
|
151
|
+
}
|
|
152
|
+
if (!settings.env)
|
|
153
|
+
settings.env = {};
|
|
154
|
+
settings.env.ANTHROPIC_BASE_URL = url;
|
|
155
|
+
fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2), 'utf8');
|
|
156
|
+
}
|
|
157
|
+
catch { }
|
|
158
|
+
}
|
|
159
|
+
function removeClaudeCodeSettings() {
|
|
160
|
+
const settingsPath = path.join(os.homedir(), '.claude', 'settings.json');
|
|
161
|
+
try {
|
|
162
|
+
if (fs.existsSync(settingsPath)) {
|
|
163
|
+
const settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8'));
|
|
164
|
+
if (settings.env && settings.env.ANTHROPIC_BASE_URL) {
|
|
165
|
+
delete settings.env.ANTHROPIC_BASE_URL;
|
|
166
|
+
if (Object.keys(settings.env).length === 0)
|
|
167
|
+
delete settings.env;
|
|
168
|
+
fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2), 'utf8');
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
catch { }
|
|
173
|
+
}
|
|
174
|
+
const RUN_KEY = 'HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Run';
|
|
175
|
+
const RUN_VALUE_NAME = 'TrimPromptProxy';
|
|
176
|
+
const vbsLauncher = path.join(baseDir, 'proxy-autostart.vbs');
|
|
177
|
+
function enableAutostart() {
|
|
178
|
+
ensureDir();
|
|
179
|
+
const cliPath = path.join(__dirname, 'cli.js');
|
|
180
|
+
if (process.platform === 'win32') {
|
|
181
|
+
try {
|
|
182
|
+
const vbs = 'Set WshShell = CreateObject("WScript.Shell")\r\n' +
|
|
183
|
+
'cmd = Chr(34) & "' + process.execPath.replace(/"/g, '""') + '" & Chr(34) & " " & Chr(34) & "' +
|
|
184
|
+
cliPath.replace(/"/g, '""') + '" & Chr(34) & " proxy install"\r\n' +
|
|
185
|
+
'WshShell.Run cmd, 0, False\r\n';
|
|
186
|
+
fs.writeFileSync(vbsLauncher, vbs, 'utf8');
|
|
187
|
+
const runValue = `wscript.exe "${vbsLauncher}"`;
|
|
188
|
+
const psSet = `New-Item -Path '${RUN_KEY}' -Force | Out-Null; Set-ItemProperty -Path '${RUN_KEY}' -Name '${RUN_VALUE_NAME}' -Value '${runValue.replace(/'/g, "''")}'`;
|
|
189
|
+
(0, child_process_1.execSync)(`powershell.exe -NoProfile -Command "${psSet.replace(/"/g, '\\"')}"`, { stdio: 'ignore', timeout: 8000 });
|
|
190
|
+
}
|
|
191
|
+
catch { }
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
if (process.platform === 'darwin') {
|
|
195
|
+
try {
|
|
196
|
+
const agentsDir = path.join(os.homedir(), 'Library', 'LaunchAgents');
|
|
197
|
+
if (!fs.existsSync(agentsDir))
|
|
198
|
+
fs.mkdirSync(agentsDir, { recursive: true });
|
|
199
|
+
const plistPath = path.join(agentsDir, 'ai.trimprompt.proxy.plist');
|
|
200
|
+
const plist = '<?xml version="1.0" encoding="UTF-8"?>\n' +
|
|
201
|
+
'<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n' +
|
|
202
|
+
'<plist version="1.0"><dict>\n' +
|
|
203
|
+
' <key>Label</key><string>ai.trimprompt.proxy</string>\n' +
|
|
204
|
+
' <key>ProgramArguments</key><array>' +
|
|
205
|
+
`<string>${process.execPath}</string><string>${cliPath}</string><string>proxy</string><string>start</string>` +
|
|
206
|
+
'</array>\n' +
|
|
207
|
+
' <key>RunAtLoad</key><true/>\n' +
|
|
208
|
+
' <key>KeepAlive</key><true/>\n' +
|
|
209
|
+
'</dict></plist>\n';
|
|
210
|
+
fs.writeFileSync(plistPath, plist, 'utf8');
|
|
211
|
+
try {
|
|
212
|
+
(0, child_process_1.execSync)(`launchctl unload "${plistPath}"`, { stdio: 'ignore', timeout: 5000 });
|
|
213
|
+
}
|
|
214
|
+
catch { }
|
|
215
|
+
(0, child_process_1.execSync)(`launchctl load "${plistPath}"`, { stdio: 'ignore', timeout: 5000 });
|
|
216
|
+
}
|
|
217
|
+
catch { }
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
try {
|
|
221
|
+
const autostartDir = path.join(os.homedir(), '.config', 'autostart');
|
|
222
|
+
if (!fs.existsSync(autostartDir))
|
|
223
|
+
fs.mkdirSync(autostartDir, { recursive: true });
|
|
224
|
+
const desktopPath = path.join(autostartDir, 'trimprompt-proxy.desktop');
|
|
225
|
+
const entry = '[Desktop Entry]\n' +
|
|
226
|
+
'Type=Application\n' +
|
|
227
|
+
'Name=TrimPrompt Proxy\n' +
|
|
228
|
+
`Exec=${process.execPath} ${cliPath} proxy install\n` +
|
|
229
|
+
'X-GNOME-Autostart-enabled=true\n' +
|
|
230
|
+
'NoDisplay=true\n';
|
|
231
|
+
fs.writeFileSync(desktopPath, entry, 'utf8');
|
|
232
|
+
}
|
|
233
|
+
catch { }
|
|
234
|
+
}
|
|
235
|
+
function disableAutostart() {
|
|
236
|
+
if (process.platform === 'win32') {
|
|
237
|
+
try {
|
|
238
|
+
const psRemove = `Remove-ItemProperty -Path '${RUN_KEY}' -Name '${RUN_VALUE_NAME}' -ErrorAction SilentlyContinue`;
|
|
239
|
+
(0, child_process_1.execSync)(`powershell.exe -NoProfile -Command "${psRemove.replace(/"/g, '\\"')}"`, { stdio: 'ignore', timeout: 8000 });
|
|
240
|
+
}
|
|
241
|
+
catch { }
|
|
242
|
+
try {
|
|
243
|
+
if (fs.existsSync(vbsLauncher))
|
|
244
|
+
fs.unlinkSync(vbsLauncher);
|
|
245
|
+
}
|
|
246
|
+
catch { }
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
if (process.platform === 'darwin') {
|
|
250
|
+
try {
|
|
251
|
+
const plistPath = path.join(os.homedir(), 'Library', 'LaunchAgents', 'ai.trimprompt.proxy.plist');
|
|
252
|
+
try {
|
|
253
|
+
(0, child_process_1.execSync)(`launchctl unload "${plistPath}"`, { stdio: 'ignore', timeout: 5000 });
|
|
254
|
+
}
|
|
255
|
+
catch { }
|
|
256
|
+
if (fs.existsSync(plistPath))
|
|
257
|
+
fs.unlinkSync(plistPath);
|
|
258
|
+
}
|
|
259
|
+
catch { }
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
try {
|
|
263
|
+
const desktopPath = path.join(os.homedir(), '.config', 'autostart', 'trimprompt-proxy.desktop');
|
|
264
|
+
if (fs.existsSync(desktopPath))
|
|
265
|
+
fs.unlinkSync(desktopPath);
|
|
266
|
+
}
|
|
267
|
+
catch { }
|
|
268
|
+
}
|
|
269
|
+
function setAnthropicBaseUrl(port) {
|
|
270
|
+
const url = `http://127.0.0.1:${port}`;
|
|
271
|
+
const openAiUrl = `http://127.0.0.1:${port}/v1`;
|
|
272
|
+
setClaudeCodeSettings(url);
|
|
273
|
+
if (process.platform === 'win32') {
|
|
274
|
+
try {
|
|
275
|
+
(0, child_process_1.execSync)(`setx ANTHROPIC_BASE_URL "${url}"`, { timeout: 5000 });
|
|
276
|
+
(0, child_process_1.execSync)(`setx OPENAI_BASE_URL "${openAiUrl}"`, { timeout: 5000 });
|
|
277
|
+
(0, child_process_1.execSync)(`setx GEMINI_BASE_URL "${openAiUrl}"`, { timeout: 5000 });
|
|
278
|
+
(0, child_process_1.execSync)(`setx GOOGLE_AI_BASE_URL "${openAiUrl}"`, { timeout: 5000 });
|
|
279
|
+
}
|
|
280
|
+
catch { }
|
|
281
|
+
}
|
|
282
|
+
const homeDir = os.homedir();
|
|
283
|
+
const marker = '# TrimPrompt API Proxy';
|
|
284
|
+
const line1 = `export ANTHROPIC_BASE_URL="${url}" ${marker}`;
|
|
285
|
+
const line2 = `export OPENAI_BASE_URL="${openAiUrl}" ${marker}`;
|
|
286
|
+
const line3 = `export GEMINI_BASE_URL="${openAiUrl}" ${marker}`;
|
|
287
|
+
const line4 = `export GOOGLE_AI_BASE_URL="${openAiUrl}" ${marker}`;
|
|
288
|
+
const profiles = [
|
|
289
|
+
path.join(homeDir, '.bashrc'),
|
|
290
|
+
path.join(homeDir, '.zshrc'),
|
|
291
|
+
path.join(homeDir, '.bash_profile'),
|
|
292
|
+
];
|
|
293
|
+
for (const profile of profiles) {
|
|
294
|
+
try {
|
|
295
|
+
if (fs.existsSync(profile)) {
|
|
296
|
+
let content = fs.readFileSync(profile, 'utf8');
|
|
297
|
+
if (content.includes(marker)) {
|
|
298
|
+
content = content.replace(new RegExp(`.*${marker.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}.*\\n?`, 'g'), '');
|
|
299
|
+
}
|
|
300
|
+
content = content.trimEnd() + '\n' + line1 + '\n' + line2 + '\n' + line3 + '\n' + line4 + '\n';
|
|
301
|
+
fs.writeFileSync(profile, content, 'utf8');
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
catch { }
|
|
305
|
+
}
|
|
306
|
+
try {
|
|
307
|
+
const psProfilePaths = [];
|
|
308
|
+
for (const shell of ['powershell', 'pwsh']) {
|
|
309
|
+
try {
|
|
310
|
+
const p = (0, child_process_1.execSync)(`${shell} -NoProfile -Command "$PROFILE"`, { encoding: 'utf8', timeout: 3000, stdio: ['pipe', 'pipe', 'ignore'] }).trim();
|
|
311
|
+
if (p && !psProfilePaths.includes(p))
|
|
312
|
+
psProfilePaths.push(p);
|
|
313
|
+
}
|
|
314
|
+
catch { }
|
|
315
|
+
}
|
|
316
|
+
const psMarker = '# TrimPrompt API Proxy';
|
|
317
|
+
const psLine1 = `$env:ANTHROPIC_BASE_URL = "${url}" ${psMarker}`;
|
|
318
|
+
const psLine2 = `$env:OPENAI_BASE_URL = "${openAiUrl}" ${psMarker}`;
|
|
319
|
+
const psLine3 = `$env:GEMINI_BASE_URL = "${openAiUrl}" ${psMarker}`;
|
|
320
|
+
const psLine4 = `$env:GOOGLE_AI_BASE_URL = "${openAiUrl}" ${psMarker}`;
|
|
321
|
+
for (const pp of psProfilePaths) {
|
|
322
|
+
try {
|
|
323
|
+
const dir = path.dirname(pp);
|
|
324
|
+
if (!fs.existsSync(dir))
|
|
325
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
326
|
+
let content = fs.existsSync(pp) ? fs.readFileSync(pp, 'utf8') : '';
|
|
327
|
+
if (content.includes(psMarker)) {
|
|
328
|
+
content = content.replace(new RegExp(`.*${psMarker.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}.*\\r?\\n?`, 'g'), '');
|
|
329
|
+
}
|
|
330
|
+
content = content.trimEnd() + '\n' + psLine1 + '\n' + psLine2 + '\n' + psLine3 + '\n' + psLine4 + '\n';
|
|
331
|
+
fs.writeFileSync(pp, content, 'utf8');
|
|
332
|
+
}
|
|
333
|
+
catch { }
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
catch { }
|
|
337
|
+
}
|
|
338
|
+
function removeAnthropicBaseUrl() {
|
|
339
|
+
removeClaudeCodeSettings();
|
|
340
|
+
if (process.platform === 'win32') {
|
|
341
|
+
try {
|
|
342
|
+
(0, child_process_1.execSync)('REG DELETE "HKCU\\Environment" /V ANTHROPIC_BASE_URL /F', { timeout: 5000 });
|
|
343
|
+
}
|
|
344
|
+
catch { }
|
|
345
|
+
}
|
|
346
|
+
const homeDir = os.homedir();
|
|
347
|
+
const marker = '# TrimPrompt API Proxy';
|
|
348
|
+
const profiles = [
|
|
349
|
+
path.join(homeDir, '.bashrc'),
|
|
350
|
+
path.join(homeDir, '.zshrc'),
|
|
351
|
+
path.join(homeDir, '.bash_profile'),
|
|
352
|
+
];
|
|
353
|
+
for (const profile of profiles) {
|
|
354
|
+
try {
|
|
355
|
+
if (fs.existsSync(profile)) {
|
|
356
|
+
let content = fs.readFileSync(profile, 'utf8');
|
|
357
|
+
if (content.includes(marker)) {
|
|
358
|
+
content = content.replace(new RegExp(`.*${marker.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}.*\\r?\\n?`, 'g'), '');
|
|
359
|
+
fs.writeFileSync(profile, content, 'utf8');
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
catch { }
|
|
364
|
+
}
|
|
365
|
+
try {
|
|
366
|
+
for (const shell of ['powershell', 'pwsh']) {
|
|
367
|
+
try {
|
|
368
|
+
const p = (0, child_process_1.execSync)(`${shell} -NoProfile -Command "$PROFILE"`, { encoding: 'utf8', timeout: 3000, stdio: ['pipe', 'pipe', 'ignore'] }).trim();
|
|
369
|
+
if (p && fs.existsSync(p)) {
|
|
370
|
+
let content = fs.readFileSync(p, 'utf8');
|
|
371
|
+
const psMarker = '# TrimPrompt API Proxy';
|
|
372
|
+
if (content.includes(psMarker)) {
|
|
373
|
+
content = content.replace(new RegExp(`.*${psMarker.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}.*\\r?\\n?`, 'g'), '');
|
|
374
|
+
fs.writeFileSync(p, content, 'utf8');
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
catch { }
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
catch { }
|
|
382
|
+
}
|
package/proxy-resp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';const a0_0x313271=a0_0x5ba9;(function(_0xfc4f0f,_0x549aae){const _0xa11487=a0_0x5ba9,_0x1b53ad=_0xfc4f0f();while(!![]){try{const _0x120c35=-parseInt(_0xa11487(0x1ef))/0x1+parseInt(_0xa11487(0x1ec))/0x2+parseInt(_0xa11487(0x1f0))/0x3*(-parseInt(_0xa11487(0x1d8))/0x4)+parseInt(_0xa11487(0x1e0))/0x5*(-parseInt(_0xa11487(0x1da))/0x6)+parseInt(_0xa11487(0x1eb))/0x7*(parseInt(_0xa11487(0x1df))/0x8)+-parseInt(_0xa11487(0x1de))/0x9*(-parseInt(_0xa11487(0x1d7))/0xa)+parseInt(_0xa11487(0x1ee))/0xb;if(_0x120c35===_0x549aae)break;else _0x1b53ad['push'](_0x1b53ad['shift']());}catch(_0x794c1b){_0x1b53ad['push'](_0x1b53ad['shift']());}}}(a0_0x4184,0x4a35d));function a0_0x4184(){const _0xaaf1d2=['test','text','__esModule','role','length','simple','toLowerCase','isArray','21MmPAEJ','988668MKcmtJ','complex','6695304tnpLrN','446377GXGtlY','1395453cjbpFp','medium','some','optimizeMaxTokens','content','map','defineProperty','30190cmREjQ','4viCnmc','user','12GrTWCT','split','type','join','1206MKFoFW','563544EPigZW','1258450NtlvXj','filter','string'];a0_0x4184=function(){return _0xaaf1d2;};return a0_0x4184();}Object[a0_0x313271(0x1d6)](exports,a0_0x313271(0x1e5),{'value':!![]}),exports[a0_0x313271(0x1d3)]=optimizeMaxTokens;function a0_0x5ba9(_0x164398,_0x30945e){const _0x41845c=a0_0x4184();return a0_0x5ba9=function(_0x5ba959,_0xe503cf){_0x5ba959=_0x5ba959-0x1d1;let _0x4ebbe6=_0x41845c[_0x5ba959];return _0x4ebbe6;},a0_0x5ba9(_0x164398,_0x30945e);}function lastUserText(_0x1a1db7){const _0x2f163d=a0_0x313271;for(let _0x41233c=_0x1a1db7[_0x2f163d(0x1e7)]-0x1;_0x41233c>=0x0;_0x41233c--){if(_0x1a1db7[_0x41233c][_0x2f163d(0x1e6)]===_0x2f163d(0x1d9)){const _0x14ecbe=_0x1a1db7[_0x41233c][_0x2f163d(0x1d4)];if(typeof _0x14ecbe===_0x2f163d(0x1e2))return _0x14ecbe;if(Array[_0x2f163d(0x1ea)](_0x14ecbe))return _0x14ecbe[_0x2f163d(0x1e1)](_0x147f41=>_0x147f41[_0x2f163d(0x1dc)]==='text'&&_0x147f41[_0x2f163d(0x1e4)])[_0x2f163d(0x1d5)](_0x4cf04f=>_0x4cf04f[_0x2f163d(0x1e4)])[_0x2f163d(0x1dd)]('\x0a');}}return'';}function classifyComplexity(_0x38c0ed){const _0x2773be=a0_0x313271,_0x369b58=_0x38c0ed[_0x2773be(0x1e9)](),_0x16b283=_0x369b58[_0x2773be(0x1db)](/\s+/)['length'],_0x511d43=[/^(what|where|which|who|when|how many|is |are |does |do |can |has )\S/,/\?$/,/^(show|list|print|get|find|check|look up)/,/^(yes|no|ok|sure|thanks)/];if(_0x16b283<0x14&&_0x511d43['some'](_0x41f6f5=>_0x41f6f5[_0x2773be(0x1e3)](_0x369b58)))return _0x2773be(0x1e8);const _0x37e1e9=[/implement|refactor|rewrite|create .+ (file|module|class|component)/,/step[- ]by[- ]step|multiple|several|all of the/,/write (a |the )?(full|complete|entire)/,/add .+ and .+ and/,/migrate|convert .+ to/];if(_0x16b283>0x50||_0x37e1e9[_0x2773be(0x1d2)](_0x53d13f=>_0x53d13f['test'](_0x369b58)))return _0x2773be(0x1ed);return _0x2773be(0x1d1);}const MAX_TOKENS_MAP={'simple':0x800,'medium':0x1000,'complex':0x2000};function optimizeMaxTokens(_0x4ae1b2,_0x218a11){const _0x95e183=a0_0x313271;if(!_0x4ae1b2||_0x4ae1b2[_0x95e183(0x1e7)]===0x0)return null;const _0x19b8f8=lastUserText(_0x4ae1b2);if(!_0x19b8f8)return null;const _0x25b13a=classifyComplexity(_0x19b8f8),_0x1159a8=MAX_TOKENS_MAP[_0x25b13a];if(_0x218a11&&_0x218a11<=_0x1159a8)return null;return{'max_tokens':_0x1159a8,'complexity':_0x25b13a};}
|
package/redactor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';const a0_0x456b86=a0_0x27c2;(function(_0x36d1ed,_0x3e69f5){const _0x1d0e10=a0_0x27c2,_0x59012e=_0x36d1ed();while(!![]){try{const _0x5347a4=parseInt(_0x1d0e10(0x123))/0x1*(-parseInt(_0x1d0e10(0x12c))/0x2)+-parseInt(_0x1d0e10(0x144))/0x3*(parseInt(_0x1d0e10(0x150))/0x4)+parseInt(_0x1d0e10(0x137))/0x5+-parseInt(_0x1d0e10(0x132))/0x6+-parseInt(_0x1d0e10(0x110))/0x7+-parseInt(_0x1d0e10(0x122))/0x8+parseInt(_0x1d0e10(0x127))/0x9;if(_0x5347a4===_0x3e69f5)break;else _0x59012e['push'](_0x59012e['shift']());}catch(_0x1d1f3c){_0x59012e['push'](_0x59012e['shift']());}}}(a0_0x1302,0xf2875));Object[a0_0x456b86(0x10e)](exports,a0_0x456b86(0x114),{'value':!![]}),exports[a0_0x456b86(0x12d)]=exports['Redactor']=void 0x0;class Redactor{[a0_0x456b86(0x116)]=[];constructor(){const _0x18210b=a0_0x456b86;this[_0x18210b(0x130)]();}['loadDefaultRules'](){const _0x3bab1f=a0_0x456b86;this[_0x3bab1f(0x116)]=[{'name':'AWS\x20Access\x20Key','type':_0x3bab1f(0x11a),'regex':/\b(AKIA[0-9A-Z]{16})\b/g,'replacement':_0x3bab1f(0x133)},{'name':'AWS\x20Secret\x20Key','type':'aws_secret','regex':/(aws_secret_access_key|AWS_SECRET_ACCESS_KEY)[\s:=]+[A-Za-z0-9/+=]{30,}/gi,'replacement':_0x3bab1f(0x13e)},{'name':_0x3bab1f(0x118),'type':_0x3bab1f(0x113),'regex':/"private_key"\s*:\s*"-----BEGIN[^"]+-----END[^"]*"/g,'replacement':_0x3bab1f(0x143)},{'name':_0x3bab1f(0x125),'type':_0x3bab1f(0x13d),'regex':/DefaultEndpointsProtocol=https?;AccountName=[^;]+;AccountKey=[^;]+;?[^\s]*/gi,'replacement':_0x3bab1f(0x148)},{'name':_0x3bab1f(0x13f),'type':_0x3bab1f(0x140),'regex':/\bsk-ant-api\d{2}-[A-Za-z0-9_-]{20,}\b/g,'replacement':_0x3bab1f(0x14e)},{'name':_0x3bab1f(0x14d),'type':_0x3bab1f(0x14c),'regex':/\b(sk-proj-[A-Za-z0-9_-]{20,}|sk-[A-Za-z0-9]{32,})\b/g,'replacement':'[REDACTED_OPENAI_KEY]'},{'name':_0x3bab1f(0x124),'type':_0x3bab1f(0x139),'regex':/\b(ghp_[A-Za-z0-9]{20,}|gho_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{22,})\b/g,'replacement':_0x3bab1f(0x11c)},{'name':'Slack\x20Token','type':'slack_token','regex':/\b(xoxb-[0-9A-Za-z-]+|xoxp-[0-9A-Za-z-]+|xapp-[0-9A-Za-z-]+)\b/g,'replacement':'[REDACTED_SLACK_TOKEN]'},{'name':_0x3bab1f(0x129),'type':_0x3bab1f(0x126),'regex':/\b(sk_live_[A-Za-z0-9]{24,}|sk_test_[A-Za-z0-9]{24,}|rk_live_[A-Za-z0-9]{24,}|rk_test_[A-Za-z0-9]{24,})\b/g,'replacement':_0x3bab1f(0x146)},{'name':'Twilio\x20Key','type':_0x3bab1f(0x11d),'regex':/\bSK[0-9a-f]{32}\b/g,'replacement':_0x3bab1f(0x111)},{'name':_0x3bab1f(0x120),'type':_0x3bab1f(0x11e),'regex':/\bSG\.[A-Za-z0-9_-]{22,}\.[A-Za-z0-9_-]{22,}\b/g,'replacement':_0x3bab1f(0x12e)},{'name':'Private\x20Key\x20Block','type':'private_key','regex':/-----BEGIN\s+(RSA|EC|DSA|ED25519|OPENSSH|PGP)?\s*PRIVATE KEY-----[\s\S]*?-----END\s+(RSA|EC|DSA|ED25519|OPENSSH|PGP)?\s*PRIVATE KEY-----/g,'replacement':_0x3bab1f(0x135)},{'name':_0x3bab1f(0x151),'type':_0x3bab1f(0x13a),'regex':/\beyJ[A-Za-z0-9_-]{10,}\.eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g,'replacement':_0x3bab1f(0x142)},{'name':_0x3bab1f(0x10f),'type':'bearer','regex':/Bearer\s+[A-Za-z0-9_\-.]{20,}/gi,'replacement':_0x3bab1f(0x112)},{'name':'Basic\x20Auth','type':'basic_auth','regex':/Basic\s+[A-Za-z0-9+/=]{10,}/gi,'replacement':_0x3bab1f(0x141)},{'name':'Database\x20Connection\x20String','type':_0x3bab1f(0x131),'regex':/(mongodb(\+srv)?|postgres|postgresql|mysql|redis|amqp|sqlite):\/\/[A-Za-z0-9_]+:[^@\s\n]+@[^\s\n]+/gi,'replacement':_0x3bab1f(0x147)},{'name':_0x3bab1f(0x13b),'type':_0x3bab1f(0x11b),'regex':/(api[_-]?key|secret[_-]?key|password|passwd|auth[_-]?token|private[_-]?key|access[_-]?token|refresh[_-]?token|client[_-]?secret)[\s:="']+[A-Za-z0-9_\-./+=]{16,}/gi,'replacement':_0x3bab1f(0x13c)},{'name':_0x3bab1f(0x12a),'type':_0x3bab1f(0x117),'regex':/\b(?!127\.0\.0\.1|0\.0\.0\.0|255\.255\.255\.0|10\.\d|172\.(1[6-9]|2\d|3[01])\.|192\.168\.)(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b/g,'replacement':_0x3bab1f(0x138),'alert':![]},{'name':_0x3bab1f(0x136),'type':_0x3bab1f(0x121),'regex':/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,'replacement':_0x3bab1f(0x14f),'alert':![]}];}[a0_0x456b86(0x119)](_0x7114bb){const _0x4c6620=a0_0x456b86;return this[_0x4c6620(0x12b)](_0x7114bb)[_0x4c6620(0x128)];}[a0_0x456b86(0x12b)](_0x2a7ae5){const _0x266f1d=a0_0x456b86;let _0x4791d0=_0x2a7ae5,_0x576cbf=0x0;const _0x41e4dc=[];for(const _0x352e1f of this[_0x266f1d(0x116)]){const _0x3477e0=_0x4791d0[_0x266f1d(0x145)](_0x352e1f[_0x266f1d(0x134)]);_0x3477e0&&_0x3477e0[_0x266f1d(0x14b)]>0x0&&(_0x352e1f[_0x266f1d(0x14a)]!==![]&&(_0x576cbf+=_0x3477e0[_0x266f1d(0x14b)],!_0x41e4dc[_0x266f1d(0x149)](_0x352e1f['type'])&&_0x41e4dc[_0x266f1d(0x152)](_0x352e1f['type'])),_0x4791d0=_0x4791d0[_0x266f1d(0x12f)](_0x352e1f['regex'],_0x352e1f[_0x266f1d(0x11f)]));}return{'text':_0x4791d0,'secretsFound':_0x576cbf,'secretTypes':_0x41e4dc};}}function a0_0x27c2(_0x563c51,_0x3d9c03){const _0x1302fe=a0_0x1302();return a0_0x27c2=function(_0x27c2e4,_0x14f5c1){_0x27c2e4=_0x27c2e4-0x10e;let _0x2aee94=_0x1302fe[_0x27c2e4];return _0x2aee94;},a0_0x27c2(_0x563c51,_0x3d9c03);}exports[a0_0x456b86(0x115)]=Redactor,exports[a0_0x456b86(0x12d)]=new Redactor();function a0_0x1302(){const _0x2db64e=['\x22private_key\x22:\x20\x22[REDACTED_GCP_PRIVATE_KEY]\x22','4934091vgMwEe','match','[REDACTED_STRIPE_KEY]','[REDACTED_DB_CONNECTION]','[REDACTED_AZURE_CONNECTION]','includes','alert','length','openai_key','OpenAI\x20API\x20Key','[REDACTED_ANTHROPIC_KEY]','[REDACTED_EMAIL]','4mRpiAo','JWT\x20Token','push','defineProperty','Bearer\x20Token','6898199mZnASI','[REDACTED_TWILIO_KEY]','Bearer\x20[REDACTED_TOKEN]','gcp_key','__esModule','Redactor','rules','ip_address','GCP\x20Service\x20Account\x20Key','redact','aws_key','generic_credential','[REDACTED_GITHUB_TOKEN]','twilio_key','sendgrid_key','replacement','SendGrid\x20Key','email','15085104GlSRSu','7UPQPQQ','GitHub\x20Token','Azure\x20Connection\x20String','stripe_key','56127951eVAoEC','text','Stripe\x20Key','IPv4\x20Address\x20(non-local)','redactWithAudit','31562DBCMKL','redactor','[REDACTED_SENDGRID_KEY]','replace','loadDefaultRules','db_connection','5460984WAncRA','[REDACTED_AWS_KEY]','regex','[REDACTED_PRIVATE_KEY]','Email\x20Address','1466905rzAoCU','[REDACTED_IP]','github_token','jwt','Generic\x20API\x20Key/Secret/Password','$1=[REDACTED_CREDENTIAL]','azure_conn','$1=[REDACTED_AWS_SECRET]','Anthropic\x20API\x20Key','anthropic_key','Basic\x20[REDACTED_AUTH]','[REDACTED_JWT]'];a0_0x1302=function(){return _0x2db64e;};return a0_0x1302();}
|
package/seed.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x124cf0=a0_0x3f70;function a0_0x3f70(_0x49fb23,_0x226f1a){const _0x10fd5b=a0_0x10fd();return a0_0x3f70=function(_0x3f70b2,_0x11ef57){_0x3f70b2=_0x3f70b2-0x154;let _0x37acc9=_0x10fd5b[_0x3f70b2];return _0x37acc9;},a0_0x3f70(_0x49fb23,_0x226f1a);}(function(_0xd8d347,_0x26adb4){const _0x3fa899=a0_0x3f70,_0x5313e9=_0xd8d347();while(!![]){try{const _0x12ac68=-parseInt(_0x3fa899(0x16a))/0x1*(parseInt(_0x3fa899(0x176))/0x2)+parseInt(_0x3fa899(0x171))/0x3*(parseInt(_0x3fa899(0x169))/0x4)+parseInt(_0x3fa899(0x165))/0x5+parseInt(_0x3fa899(0x16b))/0x6+-parseInt(_0x3fa899(0x172))/0x7+-parseInt(_0x3fa899(0x16f))/0x8*(parseInt(_0x3fa899(0x177))/0x9)+parseInt(_0x3fa899(0x160))/0xa;if(_0x12ac68===_0x26adb4)break;else _0x5313e9['push'](_0x5313e9['shift']());}catch(_0x270693){_0x5313e9['push'](_0x5313e9['shift']());}}}(a0_0x10fd,0xec045));function a0_0x10fd(){const _0x41aa0c=['test_api.py\x20PASS\x0a','Optimizing\x20assets...\x0a','220svkrhT','6489MztYtS','8163360GXOaQJ','Compilation\x20Output:\x0a','Step\x201/10\x20:\x20FROM\x20node:20\x0a','Seeding\x20TrimPrompt\x20database\x20with\x20mock\x20LLM\x20command\x20telemetry...','8brQjYU','log','39363gQdETO','4033736TgIlHK','test_db.py\x20PASS\x0a','All\x20303\x20tests\x20passed\x20in\x204.22s.','[INFO]\x20Building\x20modules...\x0a[SUCCESS]\x20Compiled\x20512\x20modules.\x20(repeated\x20400\x20times)','534MsxUnL','6505362TXZGkj','TRIMPROMPT_MODEL','docker\x20build:\x201420\x20packages\x20added.\x20Successfully\x20built\x20image.','logExecution','Sending\x20build\x20context\x20to\x20Docker\x20daemon...\x0a','repeat','pytest\x20tests/app','Step\x203/10\x20:\x20RUN\x20npm\x20install\x0a','pytest\x20app:\x20303\x20tests\x20passed\x20in\x204.22s.','tracker','[INFO]\x20Building\x20modules...\x0a','Successfully\x20built\x20image.','gpt-4o','added\x201420\x20packages\x20in\x2014s\x0a','14105040LEJGkI','Test\x20suite\x20run\x20starting...\x0a','defineProperty','test_auth.py\x20PASS\x0a','docker\x20build\x20.','2528175oYysSX','env'];a0_0x10fd=function(){return _0x41aa0c;};return a0_0x10fd();}Object[a0_0x124cf0(0x162)](exports,'__esModule',{'value':!![]});const tracker_1=require('./tracker');console[a0_0x124cf0(0x170)](a0_0x124cf0(0x16e)),process[a0_0x124cf0(0x166)][a0_0x124cf0(0x178)]='claude-3-opus',tracker_1[a0_0x124cf0(0x15b)]['logExecution']('npm\x20run\x20build',a0_0x124cf0(0x16c)+a0_0x124cf0(0x15c)+a0_0x124cf0(0x168)+'[SUCCESS]\x20Compiled\x20512\x20modules.\x0a'[a0_0x124cf0(0x157)](0x190),a0_0x124cf0(0x175),0x0),process[a0_0x124cf0(0x166)][a0_0x124cf0(0x178)]=a0_0x124cf0(0x15e),tracker_1['tracker'][a0_0x124cf0(0x155)](a0_0x124cf0(0x158),a0_0x124cf0(0x161)+a0_0x124cf0(0x163)+a0_0x124cf0(0x173)+a0_0x124cf0(0x167)['repeat'](0x12c)+a0_0x124cf0(0x174),a0_0x124cf0(0x15a),0x0),process[a0_0x124cf0(0x166)]['TRIMPROMPT_MODEL']='gemini-1-5-pro',tracker_1[a0_0x124cf0(0x15b)][a0_0x124cf0(0x155)](a0_0x124cf0(0x164),a0_0x124cf0(0x156)+a0_0x124cf0(0x16d)+'Step\x202/10\x20:\x20COPY\x20package.json\x20.\x0a'+a0_0x124cf0(0x159)+a0_0x124cf0(0x15f)[a0_0x124cf0(0x157)](0x3)+a0_0x124cf0(0x15d),a0_0x124cf0(0x154),0x0),console['log']('Database\x20successfully\x20seeded!');
|
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_0x570c5c=a0_0x2c83;(function(_0x27041e,_0xdec1e6){const _0x5e0d00=a0_0x2c83,_0x17cb52=_0x27041e();while(!![]){try{const _0x13d250=-parseInt(_0x5e0d00(0x12f))/0x1*(parseInt(_0x5e0d00(0xec))/0x2)+parseInt(_0x5e0d00(0xff))/0x3*(-parseInt(_0x5e0d00(0x11a))/0x4)+parseInt(_0x5e0d00(0x103))/0x5*(-parseInt(_0x5e0d00(0x126))/0x6)+-parseInt(_0x5e0d00(0xb9))/0x7*(parseInt(_0x5e0d00(0xf2))/0x8)+parseInt(_0x5e0d00(0xe9))/0x9+parseInt(_0x5e0d00(0xf6))/0xa+parseInt(_0x5e0d00(0x11b))/0xb*(parseInt(_0x5e0d00(0xb2))/0xc);if(_0x13d250===_0xdec1e6)break;else _0x17cb52['push'](_0x17cb52['shift']());}catch(_0x490489){_0x17cb52['push'](_0x17cb52['shift']());}}}(a0_0x4930,0x83845));var __createBinding=this&&this[a0_0x570c5c(0x102)]||(Object['create']?function(_0x26176a,_0x55258e,_0x3a202c,_0x1d9dc6){const _0x511b60=a0_0x570c5c;if(_0x1d9dc6===undefined)_0x1d9dc6=_0x3a202c;var _0x419a0c=Object[_0x511b60(0x104)](_0x55258e,_0x3a202c);(!_0x419a0c||(_0x511b60(0x114)in _0x419a0c?!_0x55258e['__esModule']:_0x419a0c[_0x511b60(0x101)]||_0x419a0c[_0x511b60(0xce)]))&&(_0x419a0c={'enumerable':!![],'get':function(){return _0x55258e[_0x3a202c];}}),Object[_0x511b60(0x117)](_0x26176a,_0x1d9dc6,_0x419a0c);}:function(_0x466908,_0x57e80b,_0x336281,_0xc2a5c1){if(_0xc2a5c1===undefined)_0xc2a5c1=_0x336281;_0x466908[_0xc2a5c1]=_0x57e80b[_0x336281];}),__setModuleDefault=this&&this[a0_0x570c5c(0xfc)]||(Object[a0_0x570c5c(0xf1)]?function(_0x17b3a8,_0x46ca01){const _0x27d22c=a0_0x570c5c;Object[_0x27d22c(0x117)](_0x17b3a8,_0x27d22c(0x131),{'enumerable':!![],'value':_0x46ca01});}:function(_0x20f7df,_0x19e2fd){const _0x537c73=a0_0x570c5c;_0x20f7df[_0x537c73(0x131)]=_0x19e2fd;}),__importStar=this&&this['__importStar']||(function(){var _0xe5d00e=function(_0x1f6f28){const _0x22048e=a0_0x2c83;return _0xe5d00e=Object[_0x22048e(0x107)]||function(_0x405501){const _0x2d0869=_0x22048e;var _0x2820e8=[];for(var _0x22f662 in _0x405501)if(Object[_0x2d0869(0x132)]['hasOwnProperty'][_0x2d0869(0xfa)](_0x405501,_0x22f662))_0x2820e8[_0x2820e8[_0x2d0869(0xd4)]]=_0x22f662;return _0x2820e8;},_0xe5d00e(_0x1f6f28);};return function(_0x324c05){const _0x237498=a0_0x2c83;if(_0x324c05&&_0x324c05['__esModule'])return _0x324c05;var _0x1f77c3={};if(_0x324c05!=null){for(var _0x2adb35=_0xe5d00e(_0x324c05),_0x423086=0x0;_0x423086<_0x2adb35[_0x237498(0xd4)];_0x423086++)if(_0x2adb35[_0x423086]!==_0x237498(0x131))__createBinding(_0x1f77c3,_0x324c05,_0x2adb35[_0x423086]);}return __setModuleDefault(_0x1f77c3,_0x324c05),_0x1f77c3;};}());Object[a0_0x570c5c(0x117)](exports,a0_0x570c5c(0x128),{'value':!![]}),exports[a0_0x570c5c(0x121)]=installShims,exports[a0_0x570c5c(0xea)]=uninstallShims;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x570c5c(0xe2))),os=__importStar(require('os')),SHIMMED_COMMANDS=['ls',a0_0x570c5c(0xfd),'cat',a0_0x570c5c(0x122),a0_0x570c5c(0x106),'rg',a0_0x570c5c(0x124),a0_0x570c5c(0xe3),'gh','glab','cargo','npm',a0_0x570c5c(0xc8),'npx',a0_0x570c5c(0xeb),a0_0x570c5c(0xb7),a0_0x570c5c(0x11f),a0_0x570c5c(0x12b),a0_0x570c5c(0xb4),a0_0x570c5c(0x115),'go',a0_0x570c5c(0xe1)],PROFILE_MARKER=a0_0x570c5c(0xb8);function getExecSync(){const _0x5336d1=a0_0x570c5c;return require(_0x5336d1(0xde))[_0x5336d1(0xc0)];}function getExecFileSync(){const _0x3b863a=a0_0x570c5c;return require(_0x3b863a(0xde))[_0x3b863a(0xdc)];}function ensureProfileContains(_0x1e9ce2,_0x3b8e75,_0x1ce77f){const _0x105609=a0_0x570c5c;try{const _0x5be0a9=path['dirname'](_0x1e9ce2);!fs['existsSync'](_0x5be0a9)&&fs[_0x105609(0x116)](_0x5be0a9,{'recursive':!![]});if(fs[_0x105609(0xaf)](_0x1e9ce2)){const _0x48e7a1=fs['readFileSync'](_0x1e9ce2,_0x105609(0xb6));if(_0x48e7a1['includes'](_0x3b8e75))return;fs[_0x105609(0xb5)](_0x1e9ce2,_0x1ce77f,_0x105609(0xb6));}else fs['writeFileSync'](_0x1e9ce2,_0x1ce77f,'utf8');}catch{}}function removeProfileBlock(_0x48a2b3,_0x29698e){const _0x2798c8=a0_0x570c5c;try{if(!fs[_0x2798c8(0xaf)](_0x48a2b3))return;const _0x13e558=fs['readFileSync'](_0x48a2b3,'utf8');if(!_0x13e558[_0x2798c8(0x12e)](_0x29698e))return;const _0xa5b92a=_0x13e558['split']('\x0a'),_0x4134e5=[];let _0x35c148=![];for(let _0x5accdd=0x0;_0x5accdd<_0xa5b92a['length'];_0x5accdd++){if(_0xa5b92a[_0x5accdd][_0x2798c8(0x12e)](_0x29698e)){_0x35c148=!![];continue;}if(_0x35c148){_0x35c148=![];continue;}_0x4134e5['push'](_0xa5b92a[_0x5accdd]);}const _0x233f61=_0x4134e5[_0x2798c8(0xbe)]('\x0a')[_0x2798c8(0x10d)](/\n{3,}/g,'\x0a\x0a');fs['writeFileSync'](_0x48a2b3,_0x233f61,_0x2798c8(0xb6));}catch{}}function a0_0x2c83(_0x192a5c,_0x1c8c88){const _0x49301b=a0_0x4930();return a0_0x2c83=function(_0x2c831d,_0x34ffe6){_0x2c831d=_0x2c831d-0xaf;let _0x151ede=_0x49301b[_0x2c831d];return _0x151ede;},a0_0x2c83(_0x192a5c,_0x1c8c88);}function a0_0x4930(){const _0x30b45c=['execFileSync','Please\x20add\x20the\x20following\x20path\x20to\x20the\x20front\x20of\x20your\x20User\x20PATH\x20environment\x20variable\x20manually:\x0a\x20\x20','child_process','\x20\x22$@\x22\x0afi\x0a','.ps1','find','path','git','\x20%*','\x20\x22$@\x22;\x20fi\x0aelse\x0a\x20\x20CLEAN_PATH=$(echo\x20\x22$PATH\x22\x20|\x20sed\x20\x22s|','#!/bin/sh\x0aif\x20command\x20-v\x20trim\x20>/dev/null\x202>&1;\x20then\x20exec\x20trim\x20','if\x20\x22%AI_AGENT%\x22==\x22\x22\x20if\x20\x22%CURSOR_AGENT%\x22==\x22\x22\x20if\x20\x22%CLAUDECODE%\x22==\x22\x22\x20if\x20\x22%CLAUDE_CODE%\x22==\x22\x22\x20if\x20\x22%ANTIGRAVITY_AGENT%\x22==\x22\x22\x20if\x20\x22%GEMINI_CLI%\x22==\x22\x22\x20if\x20\x22%TRIMPROMPT_ACTIVE%\x22==\x22\x22\x20(','unlinkSync','7473528mqvAYc','uninstallShims','yarn','58452hbBZjk','\x20&\x20','$PROFILE.CurrentUserAllHosts','powershell.exe','readdirSync','create','3768rjIXIC','rmdirSync','TrimPrompt\x20shims\x20fully\x20uninstalled.\x20All\x20PATH\x20modifications,\x20shell\x20profiles,\x20and\x20registry\x20entries\x20have\x20been\x20cleaned\x20up.','trim.cmd','10299890cHhJcC','APPDATA','.bashrc','.cmd','call','Remove-ItemProperty\x20-Path\x20\x27','__setModuleDefault','tree','homedir','114FhCcbM','@echo\x20off','writable','__createBinding','56495mAOilF','getOwnPropertyDescriptor','HKCU:\x5cSoftware\x5cMicrosoft\x5cCommand\x20Processor','grep','getOwnPropertyNames',':$PATH\x22','#!/bin/sh\x0aif\x20[\x20-n\x20\x22$AI_AGENT\x22\x20]\x20||\x20[\x20-n\x20\x22$CURSOR_AGENT\x22\x20]\x20||\x20[\x20-n\x20\x22$CLAUDECODE\x22\x20]\x20||\x20[\x20-n\x20\x22$CLAUDE_CODE\x22\x20]\x20||\x20[\x20-n\x20\x22$ANTIGRAVITY_AGENT\x22\x20]\x20||\x20[\x20-n\x20\x22$GEMINI_CLI\x22\x20]\x20||\x20[\x20-n\x20\x22$TRIMPROMPT_ACTIVE\x22\x20];\x20then\x0a\x20\x20if\x20command\x20-v\x20trim\x20>/dev/null\x202>&1;\x20then\x20exec\x20trim\x20','Failed\x20to\x20install\x20shims:\x20','pipe','-NoProfile','replace',':||g\x22);\x20exec\x20env\x20PATH=\x22$CLEAN_PATH\x22\x20','%~dp0..\x5c..\x5cAppData\x5cRoaming\x5cnpm\x5ctrim.cmd','.bash_profile','\x20@args\x0a}\x0a','\x20\x20\x20\x20\x20\x20[IMPORTANT]\x20TrimPrompt\x20successfully\x20installed!','.trimprompt','get','pip3','mkdirSync','defineProperty','\x20\x20set\x20\x22PATH=%PATH:','.zshrc','53764ySjJff','11cCvwcM','pwsh\x20-NoProfile\x20-Command\x20\x22exit\x200\x22','Please\x20add\x20this\x20to\x20your\x20shell\x20profile\x20(~/.bashrc,\x20~/.zshrc)\x20manually:\x0a\x20\x20export\x20PATH=\x22','================================================================================','docker','pwsh','installShims','read','map','ruff',')\x20else\x20(','6JQglhH','shims','__esModule','\x20\x20\x20👉\x20Please\x20restart\x20your\x20terminal\x20window\x20or\x20AI\x20editor\x20(Cursor/Claude)','[Environment]::SetEnvironmentVariable(\x27PATH\x27,\x20\x27','pytest',':$PATH\x22\x0a','TrimPrompt\x20successfully\x20installed\x20for\x20','includes','30HQXkvg','\x20\x20exit\x20/b\x20%ERRORLEVEL%','default','prototype','\x20@args\x20}\x20else\x20{\x20&\x20','\x0aexport\x20PATH=\x22','existsSync','trim.ps1','\x20\x20\x20\x20\x20\x20for\x20the\x20installation\x20to\x20take\x20effect.','10862004AGEVAA','\x27,\x20\x27User\x27)','pip','appendFileSync','utf8','kubectl','TrimPrompt\x20Shims\x20PATH','12306fFVBWv','message','\x20\x22$@\x22;\x20else\x20CLEAN_PATH=$(echo\x20\x22$PATH\x22\x20|\x20sed\x20\x27s|[^:]*\x5c.trimprompt/shims:||g\x27);\x20exec\x20env\x20PATH=\x22$CLEAN_PATH\x22\x20','\x0a#\x20','ignore','join','\x0a$env:PATH\x20=\x20\x22','execSync','if\x20exist\x20\x22','npm','writeFileSync','\x27\x20-Name\x20AutoRun\x20-Value\x20\x27','split','\x22\x20(','\x20-NoProfile\x20-Command\x20\x22','pnpm','toLowerCase','.profile','$sig\x20=\x20\x27[DllImport(\x5c\x22user32.dll\x5c\x22,\x20SetLastError\x20=\x20true,\x20CharSet\x20=\x20CharSet.Auto)]\x20public\x20static\x20extern\x20IntPtr\x20SendMessageTimeout(IntPtr\x20hWnd,\x20uint\x20Msg,\x20IntPtr\x20wParam,\x20string\x20lParam,\x20uint\x20fuFlags,\x20uint\x20uTimeout,\x20out\x20IntPtr\x20lpdwResult);\x27;\x20Add-Type\x20-MemberDefinition\x20$sig\x20-Name\x20\x5c\x22Win32\x5c\x22\x20-Namespace\x20\x5c\x22Win32\x5c\x22\x20-PassThru\x20>\x20$null;\x20[IntPtr]$res\x20=\x200;\x20[void][Win32.Win32]::SendMessageTimeout([IntPtr]0xffff,\x200x001A,\x20[IntPtr]::Zero,\x20\x5c\x22Environment\x5c\x22,\x202,\x201000,\x20[ref]$res);','powershell\x20-NoProfile\x20-Command\x20\x22','env','configurable','export\x20PATH=\x22','push','\x27\x20-Name\x20AutoRun\x20-ErrorAction\x20SilentlyContinue','trim','try\x20{\x20(Get-ItemProperty\x20-Path\x20\x27','length','win32','if\x20($env:AI_AGENT\x20-or\x20$env:CURSOR_AGENT\x20-or\x20$env:CLAUDECODE\x20-or\x20$env:CLAUDE_CODE\x20-or\x20$env:ANTIGRAVITY_AGENT\x20-or\x20$env:GEMINI_CLI\x20-or\x20$env:TRIMPROMPT_ACTIVE)\x20{\x0a\x20\x20if\x20(Get-Command\x20trim\x20-ErrorAction\x20SilentlyContinue)\x20{\x20&\x20trim\x20','platform','-Command','filter',';=%\x22',':||g\x22)\x0a\x20\x20exec\x20env\x20PATH=\x22$CLEAN_PATH\x22\x20'];a0_0x4930=function(){return _0x30b45c;};return a0_0x4930();}function collectPowerShellProfiles(){const _0xbe34c6=a0_0x570c5c,_0x82fdff=getExecSync(),_0x233ce0=[],_0x1202c2=[['powershell','$PROFILE.CurrentUserCurrentHost'],['powershell',_0xbe34c6(0xee)]];try{_0x82fdff(_0xbe34c6(0x11c),{'stdio':_0xbe34c6(0xbd)}),_0x1202c2[_0xbe34c6(0xd0)]([_0xbe34c6(0x120),_0xbe34c6(0xee)]);}catch{}for(const [_0x3bc370,_0x5190d7]of _0x1202c2){try{const _0x223f1f=_0x82fdff(_0x3bc370+_0xbe34c6(0xc7)+_0x5190d7+'\x22',{'encoding':_0xbe34c6(0xb6)})[_0xbe34c6(0xd2)]();_0x223f1f&&!_0x233ce0['some'](_0x373387=>_0x373387['toLowerCase']()===_0x223f1f[_0xbe34c6(0xc9)]())&&_0x233ce0['push'](_0x223f1f);}catch{}}return _0x233ce0;}function getBashProfilesWindows(){const _0x5294c2=a0_0x570c5c,_0x1e4ef2=os[_0x5294c2(0xfe)]();return[_0x5294c2(0xf8),'.bash_profile'][_0x5294c2(0x123)](_0x4ddebc=>path['join'](_0x1e4ef2,_0x4ddebc));}function getBroadcastCommand(){const _0x5064e7=a0_0x570c5c;return _0x5064e7(0xcb);}function installShims(){const _0x475982=a0_0x570c5c,_0x5477b1=path[_0x475982(0xbe)](os[_0x475982(0xfe)](),_0x475982(0x113),_0x475982(0x127));try{!fs['existsSync'](_0x5477b1)&&fs[_0x475982(0x116)](_0x5477b1,{'recursive':!![]});const _0xd196c1=os[_0x475982(0xd7)]()===_0x475982(0xd5);for(const _0x418cc2 of SHIMMED_COMMANDS){if(_0xd196c1){const _0x3d64cd=path['join'](_0x5477b1,_0x418cc2+_0x475982(0xf9)),_0x1eb99e=process[_0x475982(0xcd)][_0x475982(0xf7)]?path[_0x475982(0xbe)](process[_0x475982(0xcd)][_0x475982(0xf7)],_0x475982(0xc2)):'',_0xb41b02=_0x1eb99e?path['join'](_0x1eb99e,_0x475982(0xf5)):_0x475982(0x10f),_0x16244f=[_0x475982(0x100),_0x475982(0xe7),_0x475982(0x118)+_0x5477b1+_0x475982(0xda),'\x20\x20'+_0x418cc2+_0x475982(0xe4),_0x475982(0x130),')',_0x475982(0xc1)+_0xb41b02+_0x475982(0xc6),'\x20\x20trim\x20'+_0x418cc2+_0x475982(0xe4),_0x475982(0x125),_0x475982(0x118)+_0x5477b1+_0x475982(0xda),'\x20\x20'+_0x418cc2+_0x475982(0xe4),')'][_0x475982(0xbe)]('\x0d\x0a')+'\x0d\x0a';fs['writeFileSync'](_0x3d64cd,_0x16244f,_0x475982(0xb6));const _0x14f6c9=path[_0x475982(0xbe)](_0x5477b1,_0x418cc2+_0x475982(0xe0)),_0x739d5=_0x475982(0xd6)+_0x418cc2+_0x475982(0x133)+_0x418cc2+'\x20@args\x20}\x0a}\x20else\x20{\x0a\x20\x20&\x20'+_0x418cc2+_0x475982(0x111);fs[_0x475982(0xc3)](_0x14f6c9,_0x739d5,_0x475982(0xb6));const _0x124940=path[_0x475982(0xbe)](_0x5477b1,_0x418cc2),_0x41aca7=_0x5477b1['replace'](/\\/g,'/')[_0x475982(0x10d)](/^([A-Za-z]):/,(_0x2157f2,_0x5d7fe0)=>'/'+_0x5d7fe0[_0x475982(0xc9)]()),_0x11d943=_0x475982(0x109)+_0x418cc2+'\x20\x22$@\x22;\x20else\x20CLEAN_PATH=$(echo\x20\x22$PATH\x22\x20|\x20sed\x20\x22s|'+_0x41aca7+_0x475982(0x10e)+_0x418cc2+_0x475982(0xe5)+_0x41aca7+_0x475982(0xdb)+_0x418cc2+_0x475982(0xdf);fs[_0x475982(0xc3)](_0x124940,_0x11d943,_0x475982(0xb6));}else{const _0x2e3919=path[_0x475982(0xbe)](_0x5477b1,_0x418cc2),_0x192151=_0x475982(0xe6)+_0x418cc2+_0x475982(0xbb)+_0x418cc2+'\x20\x22$@\x22;\x20fi\x0a';fs[_0x475982(0xc3)](_0x2e3919,_0x192151,_0x475982(0xb6)),fs['chmodSync'](_0x2e3919,'755');}}let _0x56059a=![],_0x171cee='';if(_0xd196c1)try{const _0x2662b6=getExecSync(),_0x1fb50a=_0x475982(0xbc)+PROFILE_MARKER+_0x475982(0xbf)+_0x5477b1+';\x22\x20+\x20$env:PATH\x0a',_0x2a8228=collectPowerShellProfiles();for(const _0x3399ae of _0x2a8228){ensureProfileContains(_0x3399ae,_0x5477b1,_0x1fb50a);}try{const _0x5b50f0=_0x5477b1[_0x475982(0x10d)](/\\/g,'/')[_0x475982(0x10d)](/^([A-Za-z]):/,(_0x2992b3,_0x13abef)=>'/'+_0x13abef[_0x475982(0xc9)]()),_0x18744d=_0x475982(0xbc)+PROFILE_MARKER+_0x475982(0x134)+_0x5b50f0+':$PATH\x22\x0a',_0x352bfb=getBashProfilesWindows();let _0x504ca6=![];for(const _0x37ce7a of _0x352bfb){fs[_0x475982(0xaf)](_0x37ce7a)&&(ensureProfileContains(_0x37ce7a,_0x5b50f0,_0x18744d),_0x504ca6=!![]);}!_0x504ca6&&ensureProfileContains(_0x352bfb[0x0],_0x5b50f0,_0x18744d);}catch{}const _0x1f422a='[Environment]::GetEnvironmentVariable(\x27PATH\x27,\x20\x27User\x27)',_0x1fbc4e=_0x2662b6('powershell\x20-NoProfile\x20-Command\x20\x22'+_0x1f422a+'\x22',{'encoding':_0x475982(0xb6),'stdio':[_0x475982(0x10b),'pipe',_0x475982(0xbd)]})[_0x475982(0xd2)]();if(!_0x1fbc4e['includes'](_0x5477b1)){const _0x44307d=_0x5477b1+';'+_0x1fbc4e,_0x2c50e1=_0x44307d[_0x475982(0x10d)](/'/g,'\x27\x27'),_0x35c7a0=_0x475982(0x12a)+_0x2c50e1+_0x475982(0xb3);_0x2662b6('powershell\x20-NoProfile\x20-Command\x20\x22'+_0x35c7a0+';\x20'+getBroadcastCommand()+'\x22',{'stdio':_0x475982(0xbd)});}const _0x45640c=path[_0x475982(0xbe)](process[_0x475982(0xcd)][_0x475982(0xf7)]||'','npm',_0x475982(0xb0));if(fs['existsSync'](_0x45640c))try{fs[_0x475982(0xe8)](_0x45640c);}catch{}_0x56059a=!![];}catch(_0x2738d1){_0x171cee=_0x475982(0xdd)+_0x5477b1;}else try{const _0x1527ae=_0x475982(0xcf)+_0x5477b1+_0x475982(0x12c),_0x344a6d=os[_0x475982(0xfe)](),_0x54d9bf=['.bashrc','.zshrc',_0x475982(0x110),_0x475982(0xca)];let _0x41da55=![];for(const _0x2c8f90 of _0x54d9bf){const _0xc90ec5=path[_0x475982(0xbe)](_0x344a6d,_0x2c8f90);fs['existsSync'](_0xc90ec5)&&(ensureProfileContains(_0xc90ec5,_0x5477b1,_0x475982(0xbc)+PROFILE_MARKER+'\x0a'+_0x1527ae),_0x41da55=!![]);}if(!_0x41da55){const _0x2bc575=path[_0x475982(0xbe)](_0x344a6d,_0x475982(0xf8));ensureProfileContains(_0x2bc575,_0x5477b1,'\x0a#\x20'+PROFILE_MARKER+'\x0a'+_0x1527ae);}_0x56059a=!![];}catch(_0x3f4c50){_0x171cee=_0x475982(0x11d)+_0x5477b1+_0x475982(0x108);}const _0x54abb8=[_0x475982(0x11e),_0x475982(0x112),'================================================================================',_0x475982(0x129),_0x475982(0xb1),_0x475982(0x11e)][_0x475982(0xbe)]('\x0a'),_0x2c6306=_0x56059a?_0x54abb8:_0x475982(0x12d)+SHIMMED_COMMANDS[_0x475982(0xd4)]+'\x20commands.\x0a\x0a[WARNING]\x20Could\x20not\x20automatically\x20update\x20your\x20system\x20PATH.\x20'+_0x171cee;return{'success':!![],'pathDir':_0x5477b1,'message':_0x2c6306};}catch(_0x435361){return{'success':![],'pathDir':_0x5477b1,'message':_0x475982(0x10a)+_0x435361['message']};}}function uninstallShims(){const _0x44b785=a0_0x570c5c,_0x524806=path[_0x44b785(0xbe)](os[_0x44b785(0xfe)](),'.trimprompt','shims'),_0x349521=os[_0x44b785(0xd7)]()==='win32';try{if(_0x349521){const _0x498d7f=getExecSync();try{const _0x3f03f0=getExecFileSync(),_0xe106ec=_0x44b785(0x105),_0xf8e9db=_0x44b785(0xd3)+_0xe106ec+'\x27\x20-Name\x20AutoRun\x20-ErrorAction\x20Stop).AutoRun\x20}\x20catch\x20{\x20\x27\x27\x20}',_0x24ae76=_0x3f03f0(_0x44b785(0xef),[_0x44b785(0x10c),_0x44b785(0xd8),_0xf8e9db],{'encoding':'utf8','stdio':['pipe','pipe',_0x44b785(0xbd)]})[_0x44b785(0xd2)]();if(_0x24ae76['includes'](_0x524806)){const _0x3784bb=_0x24ae76['split'](_0x44b785(0xed))[_0x44b785(0xd9)](_0x91ca79=>!_0x91ca79[_0x44b785(0x12e)](_0x524806));if(_0x3784bb[_0x44b785(0xd4)]===0x0){const _0x2fa05d=_0x44b785(0xfb)+_0xe106ec+_0x44b785(0xd1);_0x3f03f0('powershell.exe',['-NoProfile','-Command',_0x2fa05d],{'stdio':_0x44b785(0xbd)});}else{const _0x302dbd=_0x3784bb[_0x44b785(0xbe)]('\x20&\x20'),_0x33cec3='Set-ItemProperty\x20-Path\x20\x27'+_0xe106ec+_0x44b785(0xc4)+_0x302dbd+'\x27';_0x3f03f0(_0x44b785(0xef),[_0x44b785(0x10c),_0x44b785(0xd8),_0x33cec3],{'stdio':_0x44b785(0xbd)});}}}catch{}try{const _0x4b2d4f=collectPowerShellProfiles();for(const _0xc5ac5f of _0x4b2d4f){removeProfileBlock(_0xc5ac5f,PROFILE_MARKER);}}catch{}try{for(const _0x3df17e of getBashProfilesWindows()){removeProfileBlock(_0x3df17e,PROFILE_MARKER);}}catch{}try{const _0x2848fa='[Environment]::GetEnvironmentVariable(\x27PATH\x27,\x20\x27User\x27)',_0x4f993f=_0x498d7f(_0x44b785(0xcc)+_0x2848fa+'\x22',{'encoding':_0x44b785(0xb6),'stdio':[_0x44b785(0x10b),_0x44b785(0x10b),'ignore']})[_0x44b785(0xd2)]();if(_0x4f993f[_0x44b785(0x12e)](_0x524806)){const _0x140e70=_0x4f993f[_0x44b785(0xc5)](';')[_0x44b785(0xd9)](_0x58af69=>_0x58af69['trim']()['toLowerCase']()!==_0x524806[_0x44b785(0xc9)]())[_0x44b785(0xbe)](';'),_0x41c1e9=_0x140e70['replace'](/'/g,'\x27\x27'),_0xdeda26=_0x44b785(0x12a)+_0x41c1e9+_0x44b785(0xb3);_0x498d7f('powershell\x20-NoProfile\x20-Command\x20\x22'+_0xdeda26+';\x20'+getBroadcastCommand()+'\x22',{'stdio':_0x44b785(0xbd)});}}catch{}}else{const _0x57fa1d=os[_0x44b785(0xfe)](),_0x392e81=[_0x44b785(0xf8),_0x44b785(0x119),_0x44b785(0x110),_0x44b785(0xca)];for(const _0x109fd8 of _0x392e81){removeProfileBlock(path['join'](_0x57fa1d,_0x109fd8),PROFILE_MARKER);}}if(fs['existsSync'](_0x524806)){const _0x30c567=fs[_0x44b785(0xf0)](_0x524806);for(const _0x2f396a of _0x30c567){fs[_0x44b785(0xe8)](path[_0x44b785(0xbe)](_0x524806,_0x2f396a));}fs[_0x44b785(0xf3)](_0x524806);}return{'success':!![],'message':_0x44b785(0xf4)};}catch(_0x35a495){return{'success':![],'message':'Failed\x20to\x20uninstall\x20shims:\x20'+_0x35a495[_0x44b785(0xba)]};}}
|