trimprompt 1.0.41 → 1.0.43

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/seed.js CHANGED
@@ -1 +1 @@
1
- 'use strict';function a0_0x3c4a(_0x4e79d2,_0x3e39af){_0x4e79d2=_0x4e79d2-0x11d;const _0x28f139=a0_0x28f1();let _0x3c4a7d=_0x28f139[_0x4e79d2];return _0x3c4a7d;}const a0_0x3d0423=a0_0x3c4a;(function(_0x456d50,_0x4393bd){const _0xbd23e2=a0_0x3c4a,_0x5d52e4=_0x456d50();while(!![]){try{const _0x6e653a=-parseInt(_0xbd23e2(0x127))/0x1*(-parseInt(_0xbd23e2(0x13f))/0x2)+parseInt(_0xbd23e2(0x122))/0x3+-parseInt(_0xbd23e2(0x123))/0x4+parseInt(_0xbd23e2(0x121))/0x5+parseInt(_0xbd23e2(0x13d))/0x6+-parseInt(_0xbd23e2(0x135))/0x7*(-parseInt(_0xbd23e2(0x12d))/0x8)+-parseInt(_0xbd23e2(0x12f))/0x9;if(_0x6e653a===_0x4393bd)break;else _0x5d52e4['push'](_0x5d52e4['shift']());}catch(_0x439126){_0x5d52e4['push'](_0x5d52e4['shift']());}}}(a0_0x28f1,0x7f7c2));Object[a0_0x3d0423(0x132)](exports,a0_0x3d0423(0x126),{'value':!![]});function a0_0x28f1(){const _0x352710=['Database\x20successfully\x20seeded!','Step\x203/10\x20:\x20RUN\x20npm\x20install\x0a','defineProperty','docker\x20build:\x201420\x20packages\x20added.\x20Successfully\x20built\x20image.','gemini-1-5-pro','133nQnXkA','added\x201420\x20packages\x20in\x2014s\x0a','[INFO]\x20Building\x20modules...\x0a[SUCCESS]\x20Compiled\x20512\x20modules.\x20(repeated\x20400\x20times)','logExecution','[INFO]\x20Building\x20modules...\x0a','pytest\x20app:\x20303\x20tests\x20passed\x20in\x204.22s.','[SUCCESS]\x20Compiled\x20512\x20modules.\x0a','log','4005090PMyTCK','Step\x202/10\x20:\x20COPY\x20package.json\x20.\x0a','2ZtJduT','All\x20303\x20tests\x20passed\x20in\x204.22s.','tracker','Test\x20suite\x20run\x20starting...\x0a','Compilation\x20Output:\x0a','5092035ZkPCtg','544254FJWhNP','321912Cydshl','./tracker','test_api.py\x20PASS\x0a','__esModule','902121GoNULb','Step\x201/10\x20:\x20FROM\x20node:20\x0a','gpt-4o','Sending\x20build\x20context\x20to\x20Docker\x20daemon...\x0a','repeat','docker\x20build\x20.','288592fxuKkK','claude-3-opus','25669899tyTPOk'];a0_0x28f1=function(){return _0x352710;};return a0_0x28f1();}const tracker_1=require(a0_0x3d0423(0x124));console[a0_0x3d0423(0x13c)]('Seeding\x20TrimPrompt\x20database\x20with\x20mock\x20LLM\x20command\x20telemetry...'),process.env.TRIMPROMPT_MODEL=a0_0x3d0423(0x12e),tracker_1[a0_0x3d0423(0x11e)][a0_0x3d0423(0x138)]('npm\x20run\x20build',a0_0x3d0423(0x120)+a0_0x3d0423(0x139)+'Optimizing\x20assets...\x0a'+a0_0x3d0423(0x13b)[a0_0x3d0423(0x12b)](0x190),a0_0x3d0423(0x137),0x0),process.env.TRIMPROMPT_MODEL=a0_0x3d0423(0x129),tracker_1[a0_0x3d0423(0x11e)][a0_0x3d0423(0x138)]('pytest\x20tests/app',a0_0x3d0423(0x11f)+'test_auth.py\x20PASS\x0a'+'test_db.py\x20PASS\x0a'+a0_0x3d0423(0x125)['repeat'](0x12c)+a0_0x3d0423(0x11d),a0_0x3d0423(0x13a),0x0),process.env.TRIMPROMPT_MODEL=a0_0x3d0423(0x134),tracker_1[a0_0x3d0423(0x11e)][a0_0x3d0423(0x138)](a0_0x3d0423(0x12c),a0_0x3d0423(0x12a)+a0_0x3d0423(0x128)+a0_0x3d0423(0x13e)+a0_0x3d0423(0x131)+a0_0x3d0423(0x136)[a0_0x3d0423(0x12b)](0x3)+'Successfully\x20built\x20image.',a0_0x3d0423(0x133),0x0),console[a0_0x3d0423(0x13c)](a0_0x3d0423(0x130));
1
+ 'use strict';const a0_0x229abe=a0_0x59d0;(function(_0x9fa570,_0x58c88f){const _0xe651bf=a0_0x59d0,_0x1b8973=_0x9fa570();while(!![]){try{const _0x319cd3=-parseInt(_0xe651bf(0x11f))/0x1+-parseInt(_0xe651bf(0x11c))/0x2+-parseInt(_0xe651bf(0x12f))/0x3*(parseInt(_0xe651bf(0x126))/0x4)+-parseInt(_0xe651bf(0x11b))/0x5*(parseInt(_0xe651bf(0x132))/0x6)+-parseInt(_0xe651bf(0x11a))/0x7*(-parseInt(_0xe651bf(0x11d))/0x8)+parseInt(_0xe651bf(0x12a))/0x9+parseInt(_0xe651bf(0x128))/0xa;if(_0x319cd3===_0x58c88f)break;else _0x1b8973['push'](_0x1b8973['shift']());}catch(_0x1e57a8){_0x1b8973['push'](_0x1b8973['shift']());}}}(a0_0x3b2a,0x61279));function a0_0x59d0(_0x58a043,_0x91a543){_0x58a043=_0x58a043-0x110;const _0x3b2af4=a0_0x3b2a();let _0x59d093=_0x3b2af4[_0x58a043];return _0x59d093;}Object['defineProperty'](exports,a0_0x229abe(0x114),{'value':!![]});const tracker_1=require(a0_0x229abe(0x125));function a0_0x3b2a(){const _0x16d2e5=['181053acnpuo','[INFO]\x20Building\x20modules...\x0a','All\x20303\x20tests\x20passed\x20in\x204.22s.','logExecution','[INFO]\x20Building\x20modules...\x0a[SUCCESS]\x20Compiled\x20512\x20modules.\x20(repeated\x20400\x20times)','345fopasz','Seeding\x20TrimPrompt\x20database\x20with\x20mock\x20LLM\x20command\x20telemetry...','[SUCCESS]\x20Compiled\x20512\x20modules.\x0a','6nXBVOE','Successfully\x20built\x20image.','repeat','Database\x20successfully\x20seeded!','test_api.py\x20PASS\x0a','__esModule','tracker','log','claude-3-opus','Step\x203/10\x20:\x20RUN\x20npm\x20install\x0a','npm\x20run\x20build','2328879mprQRu','3418015xKNBJZ','1267156wODYrk','16MgFNdP','test_auth.py\x20PASS\x0a','632340vGNMLG','Optimizing\x20assets...\x0a','docker\x20build:\x201420\x20packages\x20added.\x20Successfully\x20built\x20image.','Step\x202/10\x20:\x20COPY\x20package.json\x20.\x0a','Test\x20suite\x20run\x20starting...\x0a','pytest\x20app:\x20303\x20tests\x20passed\x20in\x204.22s.','./tracker','19708lyQpJt','Step\x201/10\x20:\x20FROM\x20node:20\x0a','22285600mlZSFb','docker\x20build\x20.'];a0_0x3b2a=function(){return _0x16d2e5;};return a0_0x3b2a();}console[a0_0x229abe(0x116)](a0_0x229abe(0x130)),process.env.TRIMPROMPT_MODEL=a0_0x229abe(0x117),tracker_1[a0_0x229abe(0x115)][a0_0x229abe(0x12d)](a0_0x229abe(0x119),'Compilation\x20Output:\x0a'+a0_0x229abe(0x12b)+a0_0x229abe(0x120)+a0_0x229abe(0x131)['repeat'](0x190),a0_0x229abe(0x12e),0x0),process.env.TRIMPROMPT_MODEL='gpt-4o',tracker_1[a0_0x229abe(0x115)][a0_0x229abe(0x12d)]('pytest\x20tests/app',a0_0x229abe(0x123)+a0_0x229abe(0x11e)+'test_db.py\x20PASS\x0a'+a0_0x229abe(0x113)[a0_0x229abe(0x111)](0x12c)+a0_0x229abe(0x12c),a0_0x229abe(0x124),0x0),process.env.TRIMPROMPT_MODEL='gemini-1-5-pro',tracker_1[a0_0x229abe(0x115)][a0_0x229abe(0x12d)](a0_0x229abe(0x129),'Sending\x20build\x20context\x20to\x20Docker\x20daemon...\x0a'+a0_0x229abe(0x127)+a0_0x229abe(0x122)+a0_0x229abe(0x118)+'added\x201420\x20packages\x20in\x2014s\x0a'['repeat'](0x3)+a0_0x229abe(0x110),a0_0x229abe(0x121),0x0),console[a0_0x229abe(0x116)](a0_0x229abe(0x112));
package/shims.js CHANGED
@@ -1 +1,387 @@
1
- 'use strict';function a0_0x189c(_0x2ab92d,_0x3df0ab){_0x2ab92d=_0x2ab92d-0x125;const _0x34c5e5=a0_0x34c5();let _0x189cbb=_0x34c5e5[_0x2ab92d];return _0x189cbb;}const a0_0x1d1927=a0_0x189c;(function(_0xf54e6f,_0x259261){const _0x31b159=a0_0x189c,_0x3ec0c2=_0xf54e6f();while(!![]){try{const _0x569ca9=parseInt(_0x31b159(0x146))/0x1+parseInt(_0x31b159(0x187))/0x2*(parseInt(_0x31b159(0x173))/0x3)+-parseInt(_0x31b159(0x1a3))/0x4*(-parseInt(_0x31b159(0x152))/0x5)+parseInt(_0x31b159(0x15c))/0x6*(-parseInt(_0x31b159(0x12f))/0x7)+parseInt(_0x31b159(0x135))/0x8*(-parseInt(_0x31b159(0x177))/0x9)+-parseInt(_0x31b159(0x181))/0xa+parseInt(_0x31b159(0x144))/0xb*(parseInt(_0x31b159(0x1a6))/0xc);if(_0x569ca9===_0x259261)break;else _0x3ec0c2['push'](_0x3ec0c2['shift']());}catch(_0x11bc39){_0x3ec0c2['push'](_0x3ec0c2['shift']());}}}(a0_0x34c5,0x257a0));var __createBinding=this&&this[a0_0x1d1927(0x19b)]||(Object[a0_0x1d1927(0x16a)]?function(_0x12fb06,_0x501a49,_0x1281ed,_0x5cc8a9){const _0x5a5e66=a0_0x1d1927;if(_0x5cc8a9===undefined)_0x5cc8a9=_0x1281ed;var _0x568159=Object['getOwnPropertyDescriptor'](_0x501a49,_0x1281ed);(!_0x568159||(_0x5a5e66(0x14d)in _0x568159?!_0x501a49[_0x5a5e66(0x18f)]:_0x568159[_0x5a5e66(0x14b)]||_0x568159[_0x5a5e66(0x13e)]))&&(_0x568159={'enumerable':!![],'get':function(){return _0x501a49[_0x1281ed];}}),Object[_0x5a5e66(0x12a)](_0x12fb06,_0x5cc8a9,_0x568159);}:function(_0xa581f,_0x145299,_0x49f0d4,_0x248eb2){if(_0x248eb2===undefined)_0x248eb2=_0x49f0d4;_0xa581f[_0x248eb2]=_0x145299[_0x49f0d4];}),__setModuleDefault=this&&this[a0_0x1d1927(0x18e)]||(Object[a0_0x1d1927(0x16a)]?function(_0x2337f7,_0x335885){const _0x1091e4=a0_0x1d1927;Object[_0x1091e4(0x12a)](_0x2337f7,_0x1091e4(0x186),{'enumerable':!![],'value':_0x335885});}:function(_0x56951c,_0x5d69a7){const _0xe8d0a4=a0_0x1d1927;_0x56951c[_0xe8d0a4(0x186)]=_0x5d69a7;}),__importStar=this&&this[a0_0x1d1927(0x197)]||(function(){var _0x29e3ea=function(_0xed9ca){const _0x47ae44=a0_0x189c;return _0x29e3ea=Object[_0x47ae44(0x17c)]||function(_0x5b3d80){const _0x475dc0=_0x47ae44;var _0x2ab3bc=[];for(var _0x543510 in _0x5b3d80)if(Object[_0x475dc0(0x154)]['hasOwnProperty'][_0x475dc0(0x16c)](_0x5b3d80,_0x543510))_0x2ab3bc[_0x2ab3bc[_0x475dc0(0x15e)]]=_0x543510;return _0x2ab3bc;},_0x29e3ea(_0xed9ca);};return function(_0xed335){const _0x36212e=a0_0x189c;if(_0xed335&&_0xed335[_0x36212e(0x18f)])return _0xed335;var _0x3c39fa={};if(_0xed335!=null){for(var _0x142b23=_0x29e3ea(_0xed335),_0x28ca5c=0x0;_0x28ca5c<_0x142b23['length'];_0x28ca5c++)if(_0x142b23[_0x28ca5c]!==_0x36212e(0x186))__createBinding(_0x3c39fa,_0xed335,_0x142b23[_0x28ca5c]);}return __setModuleDefault(_0x3c39fa,_0xed335),_0x3c39fa;};}());Object['defineProperty'](exports,a0_0x1d1927(0x18f),{'value':!![]}),exports[a0_0x1d1927(0x163)]=installShims,exports[a0_0x1d1927(0x17b)]=uninstallShims;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x1d1927(0x13c))),os=__importStar(require('os')),SHIMMED_COMMANDS=['ls','tree','cat',a0_0x1d1927(0x1a5),a0_0x1d1927(0x18a),'rg',a0_0x1d1927(0x1a2),a0_0x1d1927(0x171),'gh','glab',a0_0x1d1927(0x125),'npm',a0_0x1d1927(0x169),a0_0x1d1927(0x18d),a0_0x1d1927(0x156),a0_0x1d1927(0x1a7),a0_0x1d1927(0x132),a0_0x1d1927(0x14e),'pip',a0_0x1d1927(0x166),'go',a0_0x1d1927(0x159)],PROFILE_MARKER='TrimPrompt\x20Shims\x20PATH';function getExecSync(){const _0x1bd1c9=a0_0x1d1927;return require(_0x1bd1c9(0x19d))[_0x1bd1c9(0x14a)];}function getExecFileSync(){const _0x3e05e5=a0_0x1d1927;return require(_0x3e05e5(0x19d))['execFileSync'];}function ensureProfileContains(_0x332733,_0x425cad,_0x51964d){const _0x59d409=a0_0x1d1927;try{const _0x83cbd=path['dirname'](_0x332733);!fs[_0x59d409(0x196)](_0x83cbd)&&fs[_0x59d409(0x141)](_0x83cbd,{'recursive':!![]});if(fs['existsSync'](_0x332733)){const _0xd8bd0f=fs['readFileSync'](_0x332733,_0x59d409(0x12d));if(_0xd8bd0f['includes'](_0x425cad))return;fs[_0x59d409(0x174)](_0x332733,_0x51964d,_0x59d409(0x12d));}else fs[_0x59d409(0x193)](_0x332733,_0x51964d,_0x59d409(0x12d));}catch{}}function removeProfileBlock(_0x33b1a7,_0xd045b6){const _0x529cb2=a0_0x1d1927;try{if(!fs['existsSync'](_0x33b1a7))return;const _0x314462=fs[_0x529cb2(0x165)](_0x33b1a7,_0x529cb2(0x12d));if(!_0x314462[_0x529cb2(0x16d)](_0xd045b6))return;const _0xe394ae=_0x314462['split']('\x0a'),_0x5326a1=[];let _0x453ea1=![];for(let _0x5bdf57=0x0;_0x5bdf57<_0xe394ae[_0x529cb2(0x15e)];_0x5bdf57++){if(_0xe394ae[_0x5bdf57]['includes'](_0xd045b6)){_0x453ea1=!![];continue;}if(_0x453ea1){_0x453ea1=![];continue;}_0x5326a1[_0x529cb2(0x149)](_0xe394ae[_0x5bdf57]);}const _0x218bf0=_0x5326a1[_0x529cb2(0x157)]('\x0a')[_0x529cb2(0x180)](/\n{3,}/g,'\x0a\x0a');fs['writeFileSync'](_0x33b1a7,_0x218bf0,_0x529cb2(0x12d));}catch{}}function collectPowerShellProfiles(){const _0x23b346=a0_0x1d1927,_0x1414dc=getExecSync(),_0x4701dc=[],_0x5ba137=[[_0x23b346(0x19c),_0x23b346(0x145)],[_0x23b346(0x19c),_0x23b346(0x172)]];try{_0x1414dc(_0x23b346(0x134),{'stdio':_0x23b346(0x129)}),_0x5ba137['push'](['pwsh','$PROFILE.CurrentUserAllHosts']);}catch{}for(const [_0x44b06b,_0xfd6e12]of _0x5ba137){try{const _0x25cc86=_0x1414dc(_0x44b06b+_0x23b346(0x194)+_0xfd6e12+'\x22',{'encoding':'utf8'})[_0x23b346(0x164)]();_0x25cc86&&!_0x4701dc['some'](_0x1e31ed=>_0x1e31ed[_0x23b346(0x195)]()===_0x25cc86['toLowerCase']())&&_0x4701dc[_0x23b346(0x149)](_0x25cc86);}catch{}}return _0x4701dc;}function getBashProfilesWindows(){const _0xe4be8e=a0_0x1d1927,_0x59cec8=os['homedir']();return[_0xe4be8e(0x168),'.bash_profile'][_0xe4be8e(0x15f)](_0x473f88=>path['join'](_0x59cec8,_0x473f88));}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 _0x12988d=a0_0x1d1927,_0x120152=path[_0x12988d(0x157)](os[_0x12988d(0x150)](),'.trimprompt','shims');try{const _0x1a8fab=path['join'](os[_0x12988d(0x150)](),_0x12988d(0x19a),'.welcomed');fs[_0x12988d(0x196)](_0x1a8fab)&&fs[_0x12988d(0x176)](_0x1a8fab);}catch{}try{!fs['existsSync'](_0x120152)&&fs[_0x12988d(0x141)](_0x120152,{'recursive':!![]});const _0x3e8354=os[_0x12988d(0x17f)]()===_0x12988d(0x12b);for(const _0x12d142 of SHIMMED_COMMANDS){if(_0x3e8354){const _0x14c10f=path[_0x12988d(0x157)](_0x120152,_0x12d142+_0x12988d(0x188)),_0x519a1b=process.env.APPDATA?path[_0x12988d(0x157)](process.env.APPDATA,_0x12988d(0x19f)):'',_0x1ae4dc=_0x519a1b?path[_0x12988d(0x157)](_0x519a1b,_0x12988d(0x140)):_0x12988d(0x155),_0x12f54d=[_0x12988d(0x138),_0x12988d(0x167),_0x12988d(0x17d)+_0x120152+';=%\x22','\x20\x20'+_0x12d142+_0x12988d(0x15a),_0x12988d(0x182),')',_0x12988d(0x158)+_0x1ae4dc+'\x22\x20(','\x20\x20trim\x20'+_0x12d142+_0x12988d(0x15a),_0x12988d(0x162),_0x12988d(0x17d)+_0x120152+_0x12988d(0x192),'\x20\x20'+_0x12d142+_0x12988d(0x15a),')'][_0x12988d(0x157)]('\x0d\x0a')+'\x0d\x0a';fs[_0x12988d(0x193)](_0x14c10f,_0x12f54d,'utf8');const _0x2b8244=path['join'](_0x120152,_0x12d142+_0x12988d(0x185)),_0x2f5cb1=_0x12988d(0x18c)+_0x12d142+'\x20@args\x20}\x20else\x20{\x20&\x20'+_0x12d142+_0x12988d(0x147)+_0x12d142+_0x12988d(0x131);fs[_0x12988d(0x193)](_0x2b8244,_0x2f5cb1,_0x12988d(0x12d));const _0xadd698=path['join'](_0x120152,_0x12d142),_0x5c7fcf=_0x120152[_0x12988d(0x180)](/\\/g,'/')[_0x12988d(0x180)](/^([A-Za-z]):/,(_0x2f9db6,_0x1f2bec)=>'/'+_0x1f2bec[_0x12988d(0x195)]()),_0x502137=_0x12988d(0x184)+_0x12d142+_0x12988d(0x178)+_0x5c7fcf+_0x12988d(0x133)+_0x12d142+'\x20\x22$@\x22;\x20fi\x0aelse\x0a\x20\x20CLEAN_PATH=$(echo\x20\x22$PATH\x22\x20|\x20sed\x20\x22s|'+_0x5c7fcf+':||g\x22)\x0a\x20\x20exec\x20env\x20PATH=\x22$CLEAN_PATH\x22\x20'+_0x12d142+_0x12988d(0x13b);fs[_0x12988d(0x193)](_0xadd698,_0x502137,_0x12988d(0x12d));}else{const _0x2d2df4=path[_0x12988d(0x157)](_0x120152,_0x12d142),_0x5e6e4b=_0x12988d(0x19e)+_0x12d142+_0x12988d(0x137)+_0x12d142+_0x12988d(0x15b);fs[_0x12988d(0x193)](_0x2d2df4,_0x5e6e4b,'utf8'),fs[_0x12988d(0x199)](_0x2d2df4,_0x12988d(0x161));}}let _0x47a0a8=![],_0x4187f4='';if(_0x3e8354)try{const _0x56975a=getExecSync(),_0x250956=_0x12988d(0x17a)+PROFILE_MARKER+'\x0a$env:PATH\x20=\x20\x22'+_0x120152+_0x12988d(0x130),_0x5bf4d4=collectPowerShellProfiles();for(const _0x241002 of _0x5bf4d4){ensureProfileContains(_0x241002,_0x120152,_0x250956);}try{const _0xadca50=_0x120152[_0x12988d(0x180)](/\\/g,'/')[_0x12988d(0x180)](/^([A-Za-z]):/,(_0x551b4a,_0x4005b8)=>'/'+_0x4005b8[_0x12988d(0x195)]()),_0x3b569b=_0x12988d(0x17a)+PROFILE_MARKER+'\x0aexport\x20PATH=\x22'+_0xadca50+_0x12988d(0x175),_0x14550b=getBashProfilesWindows();let _0x2e7123=![];for(const _0x307c72 of _0x14550b){fs['existsSync'](_0x307c72)&&(ensureProfileContains(_0x307c72,_0xadca50,_0x3b569b),_0x2e7123=!![]);}!_0x2e7123&&ensureProfileContains(_0x14550b[0x0],_0xadca50,_0x3b569b);}catch{}const _0x1b378b=_0x12988d(0x170),_0x48c08a=_0x56975a(_0x12988d(0x179)+_0x1b378b+'\x22',{'encoding':_0x12988d(0x12d),'stdio':[_0x12988d(0x13f),_0x12988d(0x13f),_0x12988d(0x129)]})[_0x12988d(0x164)]();if(!_0x48c08a['includes'](_0x120152)){const _0xa7c01c=_0x120152+';'+_0x48c08a,_0x1bce87=_0xa7c01c['replace'](/'/g,'\x27\x27'),_0x4b8817=_0x12988d(0x14c)+_0x1bce87+_0x12988d(0x16f);_0x56975a(_0x12988d(0x179)+_0x4b8817+';\x20'+getBroadcastCommand()+'\x22',{'stdio':_0x12988d(0x129)});}const _0x127a3d=path[_0x12988d(0x157)](process.env.APPDATA||'',_0x12988d(0x19f),'trim.ps1');if(fs[_0x12988d(0x196)](_0x127a3d))try{fs['unlinkSync'](_0x127a3d);}catch{}_0x47a0a8=!![];}catch(_0x585610){_0x4187f4='Please\x20add\x20the\x20following\x20path\x20to\x20the\x20front\x20of\x20your\x20User\x20PATH\x20environment\x20variable\x20manually:\x0a\x20\x20'+_0x120152;}else try{const _0x34fb50=_0x12988d(0x139)+_0x120152+_0x12988d(0x175),_0xcd119=os[_0x12988d(0x150)](),_0x4cd27a=[_0x12988d(0x168),_0x12988d(0x13d),_0x12988d(0x142),_0x12988d(0x12c)];let _0x5874ad=![];for(const _0x32a993 of _0x4cd27a){const _0x5681dc=path['join'](_0xcd119,_0x32a993);fs[_0x12988d(0x196)](_0x5681dc)&&(ensureProfileContains(_0x5681dc,_0x120152,'\x0a#\x20'+PROFILE_MARKER+'\x0a'+_0x34fb50),_0x5874ad=!![]);}if(!_0x5874ad){const _0x3af5d2=path[_0x12988d(0x157)](_0xcd119,'.bashrc');ensureProfileContains(_0x3af5d2,_0x120152,_0x12988d(0x17a)+PROFILE_MARKER+'\x0a'+_0x34fb50);}_0x47a0a8=!![];}catch(_0x1ca15c){_0x4187f4=_0x12988d(0x151)+_0x120152+_0x12988d(0x148);}const _0x830c21=['================================================================================',_0x12988d(0x189),_0x12988d(0x1a4),_0x12988d(0x15d),_0x12988d(0x18b),_0x12988d(0x1a4)][_0x12988d(0x157)]('\x0a'),_0x42ca74=_0x47a0a8?_0x830c21:'TrimPrompt\x20successfully\x20installed\x20for\x20'+SHIMMED_COMMANDS[_0x12988d(0x15e)]+_0x12988d(0x153)+_0x4187f4;return{'success':!![],'pathDir':_0x120152,'message':_0x42ca74};}catch(_0x3ba784){return{'success':![],'pathDir':_0x120152,'message':_0x12988d(0x12e)+_0x3ba784[_0x12988d(0x127)]};}}function a0_0x34c5(){const _0x1621b5=['[Environment]::GetEnvironmentVariable(\x27PATH\x27,\x20\x27User\x27)','git','$PROFILE.CurrentUserAllHosts','18gtiiCK','appendFileSync',':$PATH\x22\x0a','unlinkSync','15957YipnfM','\x20\x22$@\x22;\x20else\x20CLEAN_PATH=$(echo\x20\x22$PATH\x22\x20|\x20sed\x20\x22s|','powershell\x20-NoProfile\x20-Command\x20\x22','\x0a#\x20','uninstallShims','getOwnPropertyNames','\x20\x20set\x20\x22PATH=%PATH:','try\x20{\x20(Get-ItemProperty\x20-Path\x20\x27','platform','replace','1907310HxRagz','\x20\x20exit\x20/b\x20%ERRORLEVEL%','-NoProfile','#!/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','.ps1','default','762uPSKzD','.cmd','\x20\x20\x20\x20\x20\x20[IMPORTANT]\x20TrimPrompt\x20successfully\x20installed!','grep','\x20\x20\x20\x20\x20\x20for\x20the\x20installation\x20to\x20take\x20effect.','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','npx','__setModuleDefault','__esModule','Set-ItemProperty\x20-Path\x20\x27','Failed\x20to\x20uninstall\x20shims:\x20',';=%\x22','writeFileSync','\x20-NoProfile\x20-Command\x20\x22','toLowerCase','existsSync','__importStar','\x27\x20-Name\x20AutoRun\x20-ErrorAction\x20SilentlyContinue','chmodSync','.trimprompt','__createBinding','powershell','child_process','#!/bin/sh\x0aif\x20command\x20-v\x20trim\x20>/dev/null\x202>&1;\x20then\x20exec\x20trim\x20','npm','split','.welcomed','ruff','88lFXauX','================================================================================','read','5309520GgFDbe','kubectl','cargo','readdirSync','message','HKCU:\x5cSoftware\x5cMicrosoft\x5cCommand\x20Processor','ignore','defineProperty','win32','.profile','utf8','Failed\x20to\x20install\x20shims:\x20','1391047FfGDZE',';\x22\x20+\x20$env:PATH\x0a','\x20@args\x0a}\x0a','docker',':||g\x22);\x20exec\x20env\x20PATH=\x22$CLEAN_PATH\x22\x20','pwsh\x20-NoProfile\x20-Command\x20\x22exit\x200\x22','840tnPCSk','\x20&\x20','\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','@echo\x20off','export\x20PATH=\x22','\x27\x20-Name\x20AutoRun\x20-ErrorAction\x20Stop).AutoRun\x20}\x20catch\x20{\x20\x27\x27\x20}','\x20\x22$@\x22\x0afi\x0a','path','.zshrc','configurable','pipe','trim.cmd','mkdirSync','.bash_profile','filter','11HOwKyu','$PROFILE.CurrentUserCurrentHost','177367UrKWDK','\x20@args\x20}\x0a}\x20else\x20{\x0a\x20\x20&\x20',':$PATH\x22','push','execSync','writable','[Environment]::SetEnvironmentVariable(\x27PATH\x27,\x20\x27','get','pytest','-Command','homedir','Please\x20add\x20this\x20to\x20your\x20shell\x20profile\x20(~/.bashrc,\x20~/.zshrc)\x20manually:\x0a\x20\x20export\x20PATH=\x22','24320TOgery','\x20commands.\x0a\x0a[WARNING]\x20Could\x20not\x20automatically\x20update\x20your\x20system\x20PATH.\x20','prototype','%~dp0..\x5c..\x5cAppData\x5cRoaming\x5cnpm\x5ctrim.cmd','yarn','join','if\x20exist\x20\x22','find','\x20%*','\x20\x22$@\x22;\x20fi\x0a','6xUBZTp','\x20\x20\x20👉\x20Please\x20restart\x20your\x20terminal\x20window\x20or\x20AI\x20editor\x20(Cursor/Claude)','length','map','shims','755',')\x20else\x20(','installShims','trim','readFileSync','pip3','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(','.bashrc','pnpm','create','powershell.exe','call','includes','TrimPrompt\x20shims\x20fully\x20uninstalled.\x20All\x20PATH\x20modifications,\x20shell\x20profiles,\x20and\x20registry\x20entries\x20have\x20been\x20cleaned\x20up.','\x27,\x20\x27User\x27)'];a0_0x34c5=function(){return _0x1621b5;};return a0_0x34c5();}function uninstallShims(){const _0x32811d=a0_0x1d1927,_0x30fbd6=path[_0x32811d(0x157)](os[_0x32811d(0x150)](),_0x32811d(0x19a),_0x32811d(0x160)),_0x567d1a=os['platform']()===_0x32811d(0x12b);try{const _0x2e59e5=path[_0x32811d(0x157)](os['homedir'](),_0x32811d(0x19a),_0x32811d(0x1a1));fs['existsSync'](_0x2e59e5)&&fs['unlinkSync'](_0x2e59e5);}catch{}try{if(_0x567d1a){const _0x167773=getExecSync();try{const _0x3616d5=getExecFileSync(),_0x1c0b96=_0x32811d(0x128),_0xf39179=_0x32811d(0x17e)+_0x1c0b96+_0x32811d(0x13a),_0x4854f9=_0x3616d5('powershell.exe',[_0x32811d(0x183),_0x32811d(0x14f),_0xf39179],{'encoding':_0x32811d(0x12d),'stdio':[_0x32811d(0x13f),_0x32811d(0x13f),_0x32811d(0x129)]})[_0x32811d(0x164)]();if(_0x4854f9[_0x32811d(0x16d)](_0x30fbd6)){const _0xf268c5=_0x4854f9['split']('\x20&\x20')['filter'](_0x2d2907=>!_0x2d2907[_0x32811d(0x16d)](_0x30fbd6));if(_0xf268c5[_0x32811d(0x15e)]===0x0){const _0x4fb9a8='Remove-ItemProperty\x20-Path\x20\x27'+_0x1c0b96+_0x32811d(0x198);_0x3616d5(_0x32811d(0x16b),[_0x32811d(0x183),'-Command',_0x4fb9a8],{'stdio':_0x32811d(0x129)});}else{const _0x25e738=_0xf268c5[_0x32811d(0x157)](_0x32811d(0x136)),_0x4c46c4=_0x32811d(0x190)+_0x1c0b96+'\x27\x20-Name\x20AutoRun\x20-Value\x20\x27'+_0x25e738+'\x27';_0x3616d5('powershell.exe',[_0x32811d(0x183),_0x32811d(0x14f),_0x4c46c4],{'stdio':_0x32811d(0x129)});}}}catch{}try{const _0x197166=collectPowerShellProfiles();for(const _0x3c3389 of _0x197166){removeProfileBlock(_0x3c3389,PROFILE_MARKER);}}catch{}try{for(const _0x20c370 of getBashProfilesWindows()){removeProfileBlock(_0x20c370,PROFILE_MARKER);}}catch{}try{const _0x2713ed=_0x32811d(0x170),_0x2f607a=_0x167773(_0x32811d(0x179)+_0x2713ed+'\x22',{'encoding':_0x32811d(0x12d),'stdio':[_0x32811d(0x13f),_0x32811d(0x13f),_0x32811d(0x129)]})['trim']();if(_0x2f607a[_0x32811d(0x16d)](_0x30fbd6)){const _0x1226ac=_0x2f607a[_0x32811d(0x1a0)](';')[_0x32811d(0x143)](_0x29470a=>_0x29470a[_0x32811d(0x164)]()[_0x32811d(0x195)]()!==_0x30fbd6[_0x32811d(0x195)]())[_0x32811d(0x157)](';'),_0x589065=_0x1226ac[_0x32811d(0x180)](/'/g,'\x27\x27'),_0xfb3461=_0x32811d(0x14c)+_0x589065+_0x32811d(0x16f);_0x167773(_0x32811d(0x179)+_0xfb3461+';\x20'+getBroadcastCommand()+'\x22',{'stdio':_0x32811d(0x129)});}}catch{}}else{const _0x57e992=os[_0x32811d(0x150)](),_0x28271a=[_0x32811d(0x168),'.zshrc',_0x32811d(0x142),_0x32811d(0x12c)];for(const _0x5e019f of _0x28271a){removeProfileBlock(path[_0x32811d(0x157)](_0x57e992,_0x5e019f),PROFILE_MARKER);}}if(fs['existsSync'](_0x30fbd6)){const _0x1cf469=fs[_0x32811d(0x126)](_0x30fbd6);for(const _0x416324 of _0x1cf469){fs[_0x32811d(0x176)](path['join'](_0x30fbd6,_0x416324));}fs['rmdirSync'](_0x30fbd6);}return{'success':!![],'message':_0x32811d(0x16e)};}catch(_0x26aa6c){return{'success':![],'message':_0x32811d(0x191)+_0x26aa6c[_0x32811d(0x127)]};}}
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.installShims = installShims;
37
+ exports.uninstallShims = uninstallShims;
38
+ const fs = __importStar(require("fs"));
39
+ const path = __importStar(require("path"));
40
+ const os = __importStar(require("os"));
41
+ const SHIMMED_COMMANDS = [
42
+ 'ls',
43
+ 'tree',
44
+ 'cat',
45
+ 'read',
46
+ 'grep',
47
+ 'rg',
48
+ 'ruff',
49
+ 'git',
50
+ 'gh',
51
+ 'glab',
52
+ 'cargo',
53
+ 'npm',
54
+ 'pnpm',
55
+ 'npx',
56
+ 'yarn',
57
+ 'kubectl',
58
+ 'docker',
59
+ 'pytest',
60
+ 'pip',
61
+ 'pip3',
62
+ 'go',
63
+ 'find'
64
+ ];
65
+ const PROFILE_MARKER = 'TrimPrompt Shims PATH';
66
+ function getExecSync() {
67
+ return require('child_process').execSync;
68
+ }
69
+ function getExecFileSync() {
70
+ return require('child_process').execFileSync;
71
+ }
72
+ function ensureProfileContains(filePath, marker, contentToAppend) {
73
+ try {
74
+ const dir = path.dirname(filePath);
75
+ if (!fs.existsSync(dir)) {
76
+ fs.mkdirSync(dir, { recursive: true });
77
+ }
78
+ if (fs.existsSync(filePath)) {
79
+ const existing = fs.readFileSync(filePath, 'utf8');
80
+ if (existing.includes(marker))
81
+ return;
82
+ fs.appendFileSync(filePath, contentToAppend, 'utf8');
83
+ }
84
+ else {
85
+ fs.writeFileSync(filePath, contentToAppend, 'utf8');
86
+ }
87
+ }
88
+ catch {
89
+ }
90
+ }
91
+ function removeProfileBlock(filePath, marker) {
92
+ try {
93
+ if (!fs.existsSync(filePath))
94
+ return;
95
+ const content = fs.readFileSync(filePath, 'utf8');
96
+ if (!content.includes(marker))
97
+ return;
98
+ const lines = content.split('\n');
99
+ const filtered = [];
100
+ let skipNext = false;
101
+ for (let i = 0; i < lines.length; i++) {
102
+ if (lines[i].includes(marker)) {
103
+ skipNext = true;
104
+ continue;
105
+ }
106
+ if (skipNext) {
107
+ skipNext = false;
108
+ continue;
109
+ }
110
+ filtered.push(lines[i]);
111
+ }
112
+ const cleaned = filtered.join('\n').replace(/\n{3,}/g, '\n\n');
113
+ fs.writeFileSync(filePath, cleaned, 'utf8');
114
+ }
115
+ catch {
116
+ }
117
+ }
118
+ function collectPowerShellProfiles() {
119
+ const execSync = getExecSync();
120
+ const profiles = [];
121
+ const queries = [
122
+ ['powershell', '$PROFILE.CurrentUserCurrentHost'],
123
+ ['powershell', '$PROFILE.CurrentUserAllHosts'],
124
+ ];
125
+ try {
126
+ execSync('pwsh -NoProfile -Command "exit 0"', { stdio: 'ignore' });
127
+ queries.push(['pwsh', '$PROFILE.CurrentUserAllHosts']);
128
+ }
129
+ catch {
130
+ }
131
+ for (const [shell, profileVar] of queries) {
132
+ try {
133
+ const p = execSync(`${shell} -NoProfile -Command "${profileVar}"`, { encoding: 'utf8' }).trim();
134
+ if (p && !profiles.some(existing => existing.toLowerCase() === p.toLowerCase())) {
135
+ profiles.push(p);
136
+ }
137
+ }
138
+ catch {
139
+ }
140
+ }
141
+ return profiles;
142
+ }
143
+ function getBashProfilesWindows() {
144
+ const homeDir = os.homedir();
145
+ return ['.bashrc', '.bash_profile'].map(f => path.join(homeDir, f));
146
+ }
147
+ function getBroadcastCommand() {
148
+ return `$sig = '[DllImport(\\"user32.dll\\", SetLastError = true, CharSet = CharSet.Auto)] public static extern IntPtr SendMessageTimeout(IntPtr hWnd, uint Msg, IntPtr wParam, string lParam, uint fuFlags, uint uTimeout, out IntPtr lpdwResult);'; Add-Type -MemberDefinition $sig -Name \\"Win32\\" -Namespace \\"Win32\\" -PassThru > $null; [IntPtr]$res = 0; [void][Win32.Win32]::SendMessageTimeout([IntPtr]0xffff, 0x001A, [IntPtr]::Zero, \\"Environment\\", 2, 1000, [ref]$res);`;
149
+ }
150
+ function installShims() {
151
+ const shimsDir = path.join(os.homedir(), '.trimprompt', 'shims');
152
+ try {
153
+ const welcomedPath = path.join(os.homedir(), '.trimprompt', '.welcomed');
154
+ if (fs.existsSync(welcomedPath)) {
155
+ fs.unlinkSync(welcomedPath);
156
+ }
157
+ }
158
+ catch {
159
+ }
160
+ try {
161
+ if (!fs.existsSync(shimsDir)) {
162
+ fs.mkdirSync(shimsDir, { recursive: true });
163
+ }
164
+ const isWindows = os.platform() === 'win32';
165
+ for (const cmd of SHIMMED_COMMANDS) {
166
+ if (isWindows) {
167
+ const cmdPath = path.join(shimsDir, `${cmd}.cmd`);
168
+ const npmBin = process.env.APPDATA ? path.join(process.env.APPDATA, 'npm') : '';
169
+ const trimCmdPath = npmBin ? path.join(npmBin, 'trim.cmd') : '%~dp0..\\..\\AppData\\Roaming\\npm\\trim.cmd';
170
+ const cmdContent = [
171
+ '@echo off',
172
+ 'if "%AI_AGENT%"=="" if "%CURSOR_AGENT%"=="" if "%CLAUDECODE%"=="" if "%CLAUDE_CODE%"=="" if "%ANTIGRAVITY_AGENT%"=="" if "%GEMINI_CLI%"=="" if "%TRIMPROMPT_ACTIVE%"=="" (',
173
+ ` set "PATH=%PATH:${shimsDir};=%"`,
174
+ ` ${cmd} %*`,
175
+ ' exit /b %ERRORLEVEL%',
176
+ ')',
177
+ `if exist "${trimCmdPath}" (`,
178
+ ` trim ${cmd} %*`,
179
+ ') else (',
180
+ ` set "PATH=%PATH:${shimsDir};=%"`,
181
+ ` ${cmd} %*`,
182
+ ')',
183
+ ].join('\r\n') + '\r\n';
184
+ fs.writeFileSync(cmdPath, cmdContent, 'utf8');
185
+ const ps1Path = path.join(shimsDir, `${cmd}.ps1`);
186
+ const ps1Content = `if ($env:AI_AGENT -or $env:CURSOR_AGENT -or $env:CLAUDECODE -or $env:CLAUDE_CODE -or $env:ANTIGRAVITY_AGENT -or $env:GEMINI_CLI -or $env:TRIMPROMPT_ACTIVE) {\n if (Get-Command trim -ErrorAction SilentlyContinue) { & trim ${cmd} @args } else { & ${cmd} @args }\n} else {\n & ${cmd} @args\n}\n`;
187
+ fs.writeFileSync(ps1Path, ps1Content, 'utf8');
188
+ const shPath = path.join(shimsDir, cmd);
189
+ const shimsDirPosix = shimsDir.replace(/\\/g, '/').replace(/^([A-Za-z]):/, (_, d) => '/' + d.toLowerCase());
190
+ const shContent = `#!/bin/sh\nif [ -n "$AI_AGENT" ] || [ -n "$CURSOR_AGENT" ] || [ -n "$CLAUDECODE" ] || [ -n "$CLAUDE_CODE" ] || [ -n "$ANTIGRAVITY_AGENT" ] || [ -n "$GEMINI_CLI" ] || [ -n "$TRIMPROMPT_ACTIVE" ]; then\n if command -v trim >/dev/null 2>&1; then exec trim ${cmd} "$@"; else CLEAN_PATH=$(echo "$PATH" | sed "s|${shimsDirPosix}:||g"); exec env PATH="$CLEAN_PATH" ${cmd} "$@"; fi\nelse\n CLEAN_PATH=$(echo "$PATH" | sed "s|${shimsDirPosix}:||g")\n exec env PATH="$CLEAN_PATH" ${cmd} "$@"\nfi\n`;
191
+ fs.writeFileSync(shPath, shContent, 'utf8');
192
+ }
193
+ else {
194
+ const scriptPath = path.join(shimsDir, cmd);
195
+ const shContent = `#!/bin/sh\nif command -v trim >/dev/null 2>&1; then exec trim ${cmd} "$@"; else CLEAN_PATH=$(echo "$PATH" | sed 's|[^:]*\\.trimprompt/shims:||g'); exec env PATH="$CLEAN_PATH" ${cmd} "$@"; fi\n`;
196
+ fs.writeFileSync(scriptPath, shContent, 'utf8');
197
+ fs.chmodSync(scriptPath, '755');
198
+ }
199
+ }
200
+ let pathUpdatedAutomatically = false;
201
+ let pathInstruction = '';
202
+ if (isWindows) {
203
+ try {
204
+ const execSync = getExecSync();
205
+ const psProfileContent = `\n# ${PROFILE_MARKER}\n$env:PATH = "${shimsDir};" + $env:PATH\n`;
206
+ const psProfiles = collectPowerShellProfiles();
207
+ for (const profilePath of psProfiles) {
208
+ ensureProfileContains(profilePath, shimsDir, psProfileContent);
209
+ }
210
+ try {
211
+ const shimsDirPosix = shimsDir.replace(/\\/g, '/').replace(/^([A-Za-z]):/, (_, d) => '/' + d.toLowerCase());
212
+ const bashContent = `\n# ${PROFILE_MARKER}\nexport PATH="${shimsDirPosix}:$PATH"\n`;
213
+ const bashProfiles = getBashProfilesWindows();
214
+ let wroteAny = false;
215
+ for (const bp of bashProfiles) {
216
+ if (fs.existsSync(bp)) {
217
+ ensureProfileContains(bp, shimsDirPosix, bashContent);
218
+ wroteAny = true;
219
+ }
220
+ }
221
+ if (!wroteAny) {
222
+ ensureProfileContains(bashProfiles[0], shimsDirPosix, bashContent);
223
+ }
224
+ }
225
+ catch {
226
+ }
227
+ const getPathCmd = `[Environment]::GetEnvironmentVariable('PATH', 'User')`;
228
+ const currentPath = execSync(`powershell -NoProfile -Command "${getPathCmd}"`, { encoding: 'utf8', stdio: ['pipe', 'pipe', 'ignore'] }).trim();
229
+ if (!currentPath.includes(shimsDir)) {
230
+ const newPath = `${shimsDir};${currentPath}`;
231
+ const escapedPath = newPath.replace(/'/g, "''");
232
+ const setPathCmd = `[Environment]::SetEnvironmentVariable('PATH', '${escapedPath}', 'User')`;
233
+ execSync(`powershell -NoProfile -Command "${setPathCmd}; ${getBroadcastCommand()}"`, { stdio: 'ignore' });
234
+ }
235
+ const globalTrimPs1 = path.join(process.env.APPDATA || '', 'npm', 'trim.ps1');
236
+ if (fs.existsSync(globalTrimPs1)) {
237
+ try {
238
+ fs.unlinkSync(globalTrimPs1);
239
+ }
240
+ catch {
241
+ }
242
+ }
243
+ pathUpdatedAutomatically = true;
244
+ }
245
+ catch (err) {
246
+ pathInstruction = `Please add the following path to the front of your User PATH environment variable manually:\n ${shimsDir}`;
247
+ }
248
+ }
249
+ else {
250
+ try {
251
+ const exportLine = `export PATH="${shimsDir}:$PATH"\n`;
252
+ const homeDir = os.homedir();
253
+ const profiles = ['.bashrc', '.zshrc', '.bash_profile', '.profile'];
254
+ let updatedAny = false;
255
+ for (const profile of profiles) {
256
+ const profilePath = path.join(homeDir, profile);
257
+ if (fs.existsSync(profilePath)) {
258
+ ensureProfileContains(profilePath, shimsDir, `\n# ${PROFILE_MARKER}\n${exportLine}`);
259
+ updatedAny = true;
260
+ }
261
+ }
262
+ if (!updatedAny) {
263
+ const bashrcPath = path.join(homeDir, '.bashrc');
264
+ ensureProfileContains(bashrcPath, shimsDir, `\n# ${PROFILE_MARKER}\n${exportLine}`);
265
+ }
266
+ pathUpdatedAutomatically = true;
267
+ }
268
+ catch (err) {
269
+ pathInstruction = `Please add this to your shell profile (~/.bashrc, ~/.zshrc) manually:\n export PATH="${shimsDir}:$PATH"`;
270
+ }
271
+ }
272
+ const banner = [
273
+ '================================================================================',
274
+ ' [IMPORTANT] TrimPrompt successfully installed!',
275
+ '================================================================================',
276
+ ' 👉 Please restart your terminal window or AI editor (Cursor/Claude)',
277
+ ' for the installation to take effect.',
278
+ '================================================================================'
279
+ ].join('\n');
280
+ const message = pathUpdatedAutomatically
281
+ ? banner
282
+ : `TrimPrompt successfully installed for ${SHIMMED_COMMANDS.length} commands.\n\n[WARNING] Could not automatically update your system PATH. ${pathInstruction}`;
283
+ return {
284
+ success: true,
285
+ pathDir: shimsDir,
286
+ message
287
+ };
288
+ }
289
+ catch (err) {
290
+ return {
291
+ success: false,
292
+ pathDir: shimsDir,
293
+ message: `Failed to install shims: ${err.message}`
294
+ };
295
+ }
296
+ }
297
+ function uninstallShims() {
298
+ const shimsDir = path.join(os.homedir(), '.trimprompt', 'shims');
299
+ const isWindows = os.platform() === 'win32';
300
+ try {
301
+ const welcomedPath = path.join(os.homedir(), '.trimprompt', '.welcomed');
302
+ if (fs.existsSync(welcomedPath)) {
303
+ fs.unlinkSync(welcomedPath);
304
+ }
305
+ }
306
+ catch {
307
+ }
308
+ try {
309
+ if (isWindows) {
310
+ const execSync = getExecSync();
311
+ try {
312
+ const execFileSync = getExecFileSync();
313
+ const regPath = 'HKCU:\\Software\\Microsoft\\Command Processor';
314
+ const psGet = `try { (Get-ItemProperty -Path '${regPath}' -Name AutoRun -ErrorAction Stop).AutoRun } catch { '' }`;
315
+ const currentAutoRun = execFileSync('powershell.exe', ['-NoProfile', '-Command', psGet], { encoding: 'utf8', stdio: ['pipe', 'pipe', 'ignore'] }).trim();
316
+ if (currentAutoRun.includes(shimsDir)) {
317
+ const parts = currentAutoRun.split(' & ').filter((part) => !part.includes(shimsDir));
318
+ if (parts.length === 0) {
319
+ const psRemove = `Remove-ItemProperty -Path '${regPath}' -Name AutoRun -ErrorAction SilentlyContinue`;
320
+ execFileSync('powershell.exe', ['-NoProfile', '-Command', psRemove], { stdio: 'ignore' });
321
+ }
322
+ else {
323
+ const cleaned = parts.join(' & ');
324
+ const psSet = `Set-ItemProperty -Path '${regPath}' -Name AutoRun -Value '${cleaned}'`;
325
+ execFileSync('powershell.exe', ['-NoProfile', '-Command', psSet], { stdio: 'ignore' });
326
+ }
327
+ }
328
+ }
329
+ catch {
330
+ }
331
+ try {
332
+ const psProfiles = collectPowerShellProfiles();
333
+ for (const profilePath of psProfiles) {
334
+ removeProfileBlock(profilePath, PROFILE_MARKER);
335
+ }
336
+ }
337
+ catch {
338
+ }
339
+ try {
340
+ for (const bp of getBashProfilesWindows()) {
341
+ removeProfileBlock(bp, PROFILE_MARKER);
342
+ }
343
+ }
344
+ catch {
345
+ }
346
+ try {
347
+ const getPathCmd = `[Environment]::GetEnvironmentVariable('PATH', 'User')`;
348
+ const currentPath = execSync(`powershell -NoProfile -Command "${getPathCmd}"`, { encoding: 'utf8', stdio: ['pipe', 'pipe', 'ignore'] }).trim();
349
+ if (currentPath.includes(shimsDir)) {
350
+ const newPath = currentPath
351
+ .split(';')
352
+ .filter((p) => p.trim().toLowerCase() !== shimsDir.toLowerCase())
353
+ .join(';');
354
+ const escapedPath = newPath.replace(/'/g, "''");
355
+ const setPathCmd = `[Environment]::SetEnvironmentVariable('PATH', '${escapedPath}', 'User')`;
356
+ execSync(`powershell -NoProfile -Command "${setPathCmd}; ${getBroadcastCommand()}"`, { stdio: 'ignore' });
357
+ }
358
+ }
359
+ catch {
360
+ }
361
+ }
362
+ else {
363
+ const homeDir = os.homedir();
364
+ const profiles = ['.bashrc', '.zshrc', '.bash_profile', '.profile'];
365
+ for (const profile of profiles) {
366
+ removeProfileBlock(path.join(homeDir, profile), PROFILE_MARKER);
367
+ }
368
+ }
369
+ if (fs.existsSync(shimsDir)) {
370
+ const files = fs.readdirSync(shimsDir);
371
+ for (const file of files) {
372
+ fs.unlinkSync(path.join(shimsDir, file));
373
+ }
374
+ fs.rmdirSync(shimsDir);
375
+ }
376
+ return {
377
+ success: true,
378
+ message: "TrimPrompt shims fully uninstalled. All PATH modifications, shell profiles, and registry entries have been cleaned up."
379
+ };
380
+ }
381
+ catch (err) {
382
+ return {
383
+ success: false,
384
+ message: `Failed to uninstall shims: ${err.message}`
385
+ };
386
+ }
387
+ }
package/simulate.js CHANGED
@@ -1 +1 @@
1
- 'use strict';const a0_0x1e7d22=a0_0x3496;(function(_0x595474,_0x2fedbd){const _0x1b4064=a0_0x3496,_0x4f1133=_0x595474();while(!![]){try{const _0x576847=-parseInt(_0x1b4064(0x17e))/0x1+-parseInt(_0x1b4064(0x189))/0x2*(parseInt(_0x1b4064(0x15c))/0x3)+parseInt(_0x1b4064(0x17f))/0x4*(-parseInt(_0x1b4064(0x17b))/0x5)+parseInt(_0x1b4064(0x181))/0x6+parseInt(_0x1b4064(0x160))/0x7+parseInt(_0x1b4064(0x169))/0x8*(-parseInt(_0x1b4064(0x158))/0x9)+parseInt(_0x1b4064(0x196))/0xa;if(_0x576847===_0x2fedbd)break;else _0x4f1133['push'](_0x4f1133['shift']());}catch(_0x2b8e03){_0x4f1133['push'](_0x4f1133['shift']());}}}(a0_0x56e9,0xe1f50));function a0_0x3496(_0x26cea6,_0x5dfa3a){_0x26cea6=_0x26cea6-0x156;const _0x56e925=a0_0x56e9();let _0x34965d=_0x56e925[_0x26cea6];return _0x34965d;}Object['defineProperty'](exports,a0_0x1e7d22(0x166),{'value':!![]});const tracker_1=require(a0_0x1e7d22(0x16e));console['log'](a0_0x1e7d22(0x168));function a0_0x56e9(){const _0x38d6a2=['git\x20log:\x205\x20commits\x20(feat:\x20add\x20dynamic\x20token\x20costs,\x20fix:\x20adjust\x20margins...)','kubectl\x20get\x20pods\x20-n\x20production','logExecution','added\x2084\x20packages,\x20changed\x2012\x20packages,\x20and\x20audited\x2096\x20packages\x20in\x203s\x0a','24aMoFeL','floor','gemini-1-5-pro','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','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','cargo\x20test','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','src/cli.ts:12:3\x20-\x20warning:\x20unused\x20import\x0a','path','gemini-1-5-flash','gpt-4o','pip\x20install:\x20Successfully\x20installed\x20tensorflow-2.15.0\x20numpy-1.26.2\x20pandas-2.1.3','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','29518770SjQkxz','getLogs','utf8','2097fstITr','log','Successfully\x20installed\x20tensorflow-2.15.0\x20numpy-1.26.2\x20pandas-2.1.3\x0a','diff\x20--git\x20a/src/cli.ts\x20b/src/cli.ts\x20(50\x20insertions,\x200\x20deletions)','53871QjYtgA','now','kubectl\x20get\x20pods:\x20trimprompt-api\x20(Running),\x20trimprompt-sync\x20(Running),\x20redis-master\x20(Running),\x20postgres-db\x20(Running)','gpt-4o-mini','9712129fLxTei','repeat','npm\x20install:\x20added\x2084\x20packages,\x20audited\x2096\x20packages.\x200\x20vulnerabilities.','found\x200\x20vulnerabilities\x0a','homedir','\x20...\x20ok\x0atest\x20result:\x20ok.\x2045\x20passed;\x200\x20failed;\x200\x20ignored;\x200\x20measured;\x200\x20filtered\x20out','__esModule','length','Starting\x20simulation\x20of\x20developer\x20workflow\x20activity...','35384dSYwZI','✖\x202\x20problems\x20(0\x20errors,\x202\x20warnings)\x0a','npm\x20install\x20lodash\x20express\x20uuid\x20react','npm\x20run\x20lint:\x20✖\x202\x20warnings','cargo\x20test:\x2045\x20passed,\x200\x20failed.','./tracker','comp','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','stringify','git\x20log\x20-n\x205','timestamp','upload:\x20dist/cli.js\x20to\x20s3://trimprompt-assets/cli.js\x0a','claude-3-5-sonnet','stats.json','writeFileSync','cmd','join','npm\x20warn\x20deprecated\x20uuid@3.4.0:\x20Please\x20upgrade...\x0a','5fUFYej','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','aws\x20s3\x20sync:\x203\x20assets\x20uploaded\x20successfully.','750822CvLXHH','6846204vZRnFi','npm\x20run\x20lint','1767672OLmBlH','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','test\x20tests::test_case_','raw'];a0_0x56e9=function(){return _0x38d6a2;};return a0_0x56e9();}const models=[a0_0x1e7d22(0x175),a0_0x1e7d22(0x193),a0_0x1e7d22(0x15f),a0_0x1e7d22(0x18b),a0_0x1e7d22(0x192),'claude-3-opus'],commands=[{'cmd':'git\x20diff\x20main','raw':'diff\x20--git\x20a/src/cli.ts\x20b/src/cli.ts\x0aindex\x201234..5678\x20100644\x0a---\x20a/src/cli.ts\x0a+++\x20b/src/cli.ts\x0a@@\x20-10,6\x20+10,12\x20@@\x0a+\x20//\x20Added\x20new\x20telemetry\x20features\x0a+\x20console.log(\x22Initializing\x20sync\x20daemon...\x22);\x0a+\x20startSync();\x0a'[a0_0x1e7d22(0x161)](0x32),'comp':a0_0x1e7d22(0x15b),'exitCode':0x0},{'cmd':a0_0x1e7d22(0x18e),'raw':'running\x2045\x20tests\x0atest\x20tests::db_connection\x20...\x20ok\x0atest\x20tests::auth_handler\x20...\x20ok\x0a'+a0_0x1e7d22(0x183)[a0_0x1e7d22(0x161)](0x28)+a0_0x1e7d22(0x165),'comp':a0_0x1e7d22(0x16d),'exitCode':0x0},{'cmd':a0_0x1e7d22(0x16b),'raw':a0_0x1e7d22(0x17a)+a0_0x1e7d22(0x188)+a0_0x1e7d22(0x163),'comp':a0_0x1e7d22(0x162),'exitCode':0x0},{'cmd':'aws\x20s3\x20sync\x20dist/\x20s3://trimprompt-assets','raw':'upload:\x20dist/index.html\x20to\x20s3://trimprompt-assets/index.html\x0a'+'upload:\x20dist/hub-index.html\x20to\x20s3://trimprompt-assets/hub-index.html\x0a'+a0_0x1e7d22(0x174)+'Completed\x203\x20of\x203\x20assets\x20successfully.','comp':a0_0x1e7d22(0x17d),'exitCode':0x0},{'cmd':a0_0x1e7d22(0x186),'raw':a0_0x1e7d22(0x18d)+a0_0x1e7d22(0x18f)+a0_0x1e7d22(0x182)+a0_0x1e7d22(0x195)+'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','comp':a0_0x1e7d22(0x15e),'exitCode':0x0},{'cmd':'pip\x20install\x20tensorflow\x20pandas\x20numpy','raw':a0_0x1e7d22(0x17c)+'\x20\x20Installing\x20build\x20dependencies\x20...\x20done\x0a'+a0_0x1e7d22(0x15a),'comp':a0_0x1e7d22(0x194),'exitCode':0x0},{'cmd':a0_0x1e7d22(0x172),'raw':a0_0x1e7d22(0x170)+a0_0x1e7d22(0x18c),'comp':a0_0x1e7d22(0x185),'exitCode':0x0},{'cmd':a0_0x1e7d22(0x180),'raw':a0_0x1e7d22(0x190)+'src/tracker.ts:45:9\x20-\x20warning:\x20console.log\x20should\x20be\x20removed\x0a'+a0_0x1e7d22(0x16a),'comp':a0_0x1e7d22(0x16c),'exitCode':0x0}],startTime=Date[a0_0x1e7d22(0x15d)]()-0x36ee80;for(let i=0x0;i<0xc;i++){const model=models[i%models[a0_0x1e7d22(0x167)]],commandItem=commands[Math[a0_0x1e7d22(0x18a)](Math['random']()*commands[a0_0x1e7d22(0x167)])];process.env.TRIMPROMPT_MODEL=model;const timestamp=new Date(startTime+i*0x3d090)['toISOString'](),log=tracker_1['tracker'][a0_0x1e7d22(0x187)](commandItem[a0_0x1e7d22(0x178)],commandItem[a0_0x1e7d22(0x184)],commandItem[a0_0x1e7d22(0x16f)],commandItem['exitCode']),logs=tracker_1['tracker'][a0_0x1e7d22(0x156)]();logs['length']>0x0&&(logs[logs[a0_0x1e7d22(0x167)]-0x1][a0_0x1e7d22(0x173)]=timestamp,require('fs')[a0_0x1e7d22(0x177)](require(a0_0x1e7d22(0x191))[a0_0x1e7d22(0x179)](require('os')[a0_0x1e7d22(0x164)](),'.trimprompt',a0_0x1e7d22(0x176)),JSON[a0_0x1e7d22(0x171)](logs,null,0x2),a0_0x1e7d22(0x157)));}console[a0_0x1e7d22(0x159)]('workflow\x20simulation\x20complete!\x2012\x20additional\x20commands\x20logged.');
1
+ 'use strict';const a0_0x238488=a0_0xe90f;function a0_0xe90f(_0x3746b4,_0x29d76c){_0x3746b4=_0x3746b4-0x1cb;const _0x10568d=a0_0x1056();let _0xe90f1a=_0x10568d[_0x3746b4];return _0xe90f1a;}(function(_0xfcf86e,_0x37c62d){const _0x52b14d=a0_0xe90f,_0x2bb1b7=_0xfcf86e();while(!![]){try{const _0x31f88f=-parseInt(_0x52b14d(0x1f9))/0x1*(-parseInt(_0x52b14d(0x1d4))/0x2)+-parseInt(_0x52b14d(0x1d3))/0x3+parseInt(_0x52b14d(0x1fa))/0x4+-parseInt(_0x52b14d(0x1e7))/0x5*(parseInt(_0x52b14d(0x209))/0x6)+-parseInt(_0x52b14d(0x206))/0x7*(-parseInt(_0x52b14d(0x1cd))/0x8)+parseInt(_0x52b14d(0x1fe))/0x9+-parseInt(_0x52b14d(0x1d1))/0xa;if(_0x31f88f===_0x37c62d)break;else _0x2bb1b7['push'](_0x2bb1b7['shift']());}catch(_0x17e018){_0x2bb1b7['push'](_0x2bb1b7['shift']());}}}(a0_0x1056,0xe3d4a));Object[a0_0x238488(0x1cb)](exports,a0_0x238488(0x1eb),{'value':!![]});const tracker_1=require(a0_0x238488(0x1d0));console[a0_0x238488(0x1e3)](a0_0x238488(0x1da));const models=[a0_0x238488(0x1f2),'gpt-4o',a0_0x238488(0x1f3),a0_0x238488(0x1f0),'gemini-1-5-flash',a0_0x238488(0x1d8)],commands=[{'cmd':'git\x20diff\x20main','raw':a0_0x238488(0x1cf)[a0_0x238488(0x1d6)](0x32),'comp':a0_0x238488(0x1fc),'exitCode':0x0},{'cmd':'cargo\x20test','raw':a0_0x238488(0x1f5)+a0_0x238488(0x1e8)[a0_0x238488(0x1d6)](0x28)+a0_0x238488(0x1e9),'comp':a0_0x238488(0x1f1),'exitCode':0x0},{'cmd':'npm\x20install\x20lodash\x20express\x20uuid\x20react','raw':a0_0x238488(0x1ed)+a0_0x238488(0x1e6)+a0_0x238488(0x1e5),'comp':a0_0x238488(0x208),'exitCode':0x0},{'cmd':a0_0x238488(0x1de),'raw':a0_0x238488(0x1d2)+a0_0x238488(0x1ff)+'upload:\x20dist/cli.js\x20to\x20s3://trimprompt-assets/cli.js\x0a'+a0_0x238488(0x200),'comp':a0_0x238488(0x1f6),'exitCode':0x0},{'cmd':a0_0x238488(0x202),'raw':a0_0x238488(0x1db)+'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'+a0_0x238488(0x1df)+'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'+a0_0x238488(0x1e1),'comp':a0_0x238488(0x205),'exitCode':0x0},{'cmd':a0_0x238488(0x204),'raw':a0_0x238488(0x201)+'\x20\x20Installing\x20build\x20dependencies\x20...\x20done\x0a'+a0_0x238488(0x203),'comp':a0_0x238488(0x1d5),'exitCode':0x0},{'cmd':a0_0x238488(0x1cc),'raw':a0_0x238488(0x1dc)+a0_0x238488(0x1ec),'comp':a0_0x238488(0x1dd),'exitCode':0x0},{'cmd':a0_0x238488(0x1ce),'raw':a0_0x238488(0x1f4)+'src/tracker.ts:45:9\x20-\x20warning:\x20console.log\x20should\x20be\x20removed\x0a'+a0_0x238488(0x20b),'comp':'npm\x20run\x20lint:\x20✖\x202\x20warnings','exitCode':0x0}],startTime=Date['now']()-0x36ee80;function a0_0x1056(){const _0x140746=['running\x2045\x20tests\x0atest\x20tests::db_connection\x20...\x20ok\x0atest\x20tests::auth_handler\x20...\x20ok\x0a','aws\x20s3\x20sync:\x203\x20assets\x20uploaded\x20successfully.','exitCode','path','388813nCVJQI','56992XYSkXX','homedir','diff\x20--git\x20a/src/cli.ts\x20b/src/cli.ts\x20(50\x20insertions,\x200\x20deletions)','comp','12244671lDmFjB','upload:\x20dist/hub-index.html\x20to\x20s3://trimprompt-assets/hub-index.html\x0a','Completed\x203\x20of\x203\x20assets\x20successfully.','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','kubectl\x20get\x20pods\x20-n\x20production','Successfully\x20installed\x20tensorflow-2.15.0\x20numpy-1.26.2\x20pandas-2.1.3\x0a','pip\x20install\x20tensorflow\x20pandas\x20numpy','kubectl\x20get\x20pods:\x20trimprompt-api\x20(Running),\x20trimprompt-sync\x20(Running),\x20redis-master\x20(Running),\x20postgres-db\x20(Running)','7GOrvVJ','stats.json','npm\x20install:\x20added\x2084\x20packages,\x20audited\x2096\x20packages.\x200\x20vulnerabilities.','678PHRIiw','getLogs','✖\x202\x20problems\x20(0\x20errors,\x202\x20warnings)\x0a','defineProperty','git\x20log\x20-n\x205','13957416slJeiz','npm\x20run\x20lint','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','./tracker','12368440QUmQqT','upload:\x20dist/index.html\x20to\x20s3://trimprompt-assets/index.html\x0a','5082048vFXOMJ','6DhUFvS','pip\x20install:\x20Successfully\x20installed\x20tensorflow-2.15.0\x20numpy-1.26.2\x20pandas-2.1.3','repeat','tracker','claude-3-opus','utf8','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','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','git\x20log:\x205\x20commits\x20(feat:\x20add\x20dynamic\x20token\x20costs,\x20fix:\x20adjust\x20margins...)','aws\x20s3\x20sync\x20dist/\x20s3://trimprompt-assets','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','stringify','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','length','log','cmd','found\x200\x20vulnerabilities\x0a','added\x2084\x20packages,\x20changed\x2012\x20packages,\x20and\x20audited\x2096\x20packages\x20in\x203s\x0a','18665uiiyLd','test\x20tests::test_case_','\x20...\x20ok\x0atest\x20result:\x20ok.\x2045\x20passed;\x200\x20failed;\x200\x20ignored;\x200\x20measured;\x200\x20filtered\x20out','raw','__esModule','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','join','toISOString','gemini-1-5-pro','cargo\x20test:\x2045\x20passed,\x200\x20failed.','claude-3-5-sonnet','gpt-4o-mini','src/cli.ts:12:3\x20-\x20warning:\x20unused\x20import\x0a'];a0_0x1056=function(){return _0x140746;};return a0_0x1056();}for(let i=0x0;i<0xc;i++){const model=models[i%models['length']],commandItem=commands[Math['floor'](Math['random']()*commands[a0_0x238488(0x1e2)])];process.env.TRIMPROMPT_MODEL=model;const timestamp=new Date(startTime+i*0x3d090)[a0_0x238488(0x1ef)](),log=tracker_1['tracker']['logExecution'](commandItem[a0_0x238488(0x1e4)],commandItem[a0_0x238488(0x1ea)],commandItem[a0_0x238488(0x1fd)],commandItem[a0_0x238488(0x1f7)]),logs=tracker_1[a0_0x238488(0x1d7)][a0_0x238488(0x20a)]();logs['length']>0x0&&(logs[logs['length']-0x1]['timestamp']=timestamp,require('fs')['writeFileSync'](require(a0_0x238488(0x1f8))[a0_0x238488(0x1ee)](require('os')[a0_0x238488(0x1fb)](),'.trimprompt',a0_0x238488(0x207)),JSON[a0_0x238488(0x1e0)](logs,null,0x2),a0_0x238488(0x1d9)));}console[a0_0x238488(0x1e3)]('workflow\x20simulation\x20complete!\x2012\x20additional\x20commands\x20logged.');
package/sync.js CHANGED
@@ -1 +1 @@
1
- 'use strict';const a0_0x4b466e=a0_0x1a02;(function(_0x3bee49,_0x2265fb){const _0x13e5c7=a0_0x1a02,_0x392988=_0x3bee49();while(!![]){try{const _0x15996c=parseInt(_0x13e5c7(0x136))/0x1*(-parseInt(_0x13e5c7(0xe3))/0x2)+parseInt(_0x13e5c7(0x133))/0x3+-parseInt(_0x13e5c7(0x105))/0x4+-parseInt(_0x13e5c7(0xe1))/0x5*(-parseInt(_0x13e5c7(0xfc))/0x6)+parseInt(_0x13e5c7(0x11b))/0x7*(-parseInt(_0x13e5c7(0xdb))/0x8)+parseInt(_0x13e5c7(0xf0))/0x9+-parseInt(_0x13e5c7(0xe9))/0xa;if(_0x15996c===_0x2265fb)break;else _0x392988['push'](_0x392988['shift']());}catch(_0x19cb87){_0x392988['push'](_0x392988['shift']());}}}(a0_0x170e,0xcde54));function a0_0x1a02(_0x5809d3,_0x40b841){_0x5809d3=_0x5809d3-0xbb;const _0x170eb5=a0_0x170e();let _0x1a02cd=_0x170eb5[_0x5809d3];return _0x1a02cd;}var __createBinding=this&&this[a0_0x4b466e(0xcc)]||(Object['create']?function(_0x523292,_0x31c40a,_0x2ce372,_0x2f817b){const _0x23589a=a0_0x4b466e;if(_0x2f817b===undefined)_0x2f817b=_0x2ce372;var _0x5b31b4=Object[_0x23589a(0xc7)](_0x31c40a,_0x2ce372);(!_0x5b31b4||(_0x23589a(0xd8)in _0x5b31b4?!_0x31c40a['__esModule']:_0x5b31b4[_0x23589a(0xd3)]||_0x5b31b4[_0x23589a(0x100)]))&&(_0x5b31b4={'enumerable':!![],'get':function(){return _0x31c40a[_0x2ce372];}}),Object[_0x23589a(0x109)](_0x523292,_0x2f817b,_0x5b31b4);}:function(_0x411ffa,_0x58ee42,_0x1aa5ce,_0x1ea40d){if(_0x1ea40d===undefined)_0x1ea40d=_0x1aa5ce;_0x411ffa[_0x1ea40d]=_0x58ee42[_0x1aa5ce];}),__setModuleDefault=this&&this[a0_0x4b466e(0xf7)]||(Object[a0_0x4b466e(0xf9)]?function(_0x93e11f,_0x4ee736){const _0x2ec0b9=a0_0x4b466e;Object[_0x2ec0b9(0x109)](_0x93e11f,_0x2ec0b9(0x125),{'enumerable':!![],'value':_0x4ee736});}:function(_0x3b4814,_0x1d9130){const _0x366de1=a0_0x4b466e;_0x3b4814[_0x366de1(0x125)]=_0x1d9130;}),__importStar=this&&this[a0_0x4b466e(0xf2)]||(function(){var _0x10636b=function(_0x1e1d30){const _0x384298=a0_0x1a02;return _0x10636b=Object[_0x384298(0xc1)]||function(_0x5b69af){const _0x34b3f7=_0x384298;var _0x16fef7=[];for(var _0x59c5fd in _0x5b69af)if(Object[_0x34b3f7(0xdf)][_0x34b3f7(0xd0)][_0x34b3f7(0xd1)](_0x5b69af,_0x59c5fd))_0x16fef7[_0x16fef7[_0x34b3f7(0x135)]]=_0x59c5fd;return _0x16fef7;},_0x10636b(_0x1e1d30);};return function(_0x24dae9){const _0x91e15b=a0_0x1a02;if(_0x24dae9&&_0x24dae9[_0x91e15b(0x12e)])return _0x24dae9;var _0x26749d={};if(_0x24dae9!=null){for(var _0x55a5ec=_0x10636b(_0x24dae9),_0x41dcdd=0x0;_0x41dcdd<_0x55a5ec[_0x91e15b(0x135)];_0x41dcdd++)if(_0x55a5ec[_0x41dcdd]!==_0x91e15b(0x125))__createBinding(_0x26749d,_0x24dae9,_0x55a5ec[_0x41dcdd]);}return __setModuleDefault(_0x26749d,_0x24dae9),_0x26749d;};}());Object[a0_0x4b466e(0x109)](exports,a0_0x4b466e(0x12e),{'value':!![]});const fs=__importStar(require('fs')),path=__importStar(require(a0_0x4b466e(0xe6))),os=__importStar(require('os')),http=__importStar(require(a0_0x4b466e(0xd9))),https=__importStar(require('https')),url_1=require('url'),_cfg=[a0_0x4b466e(0x107),a0_0x4b466e(0x117),'.up.railway.app',a0_0x4b466e(0xbc)][a0_0x4b466e(0xca)](''),_ep=process.env._PS_EP||_cfg;function hasSyncedRecently(){const _0x3d4d90=a0_0x4b466e;try{if(!fs[_0x3d4d90(0x123)](dailySyncPath))return![];const _0x2731d5=JSON[_0x3d4d90(0x106)](fs[_0x3d4d90(0x10b)](dailySyncPath,_0x3d4d90(0xbe)));if(!_0x2731d5[_0x3d4d90(0x116)])return![];return Date[_0x3d4d90(0x11e)]()-_0x2731d5['last_sync_time']<0x8*0x3c*0x3c*0x3e8;}catch{return![];}}function markSyncedNow(){const _0x202f8c=a0_0x4b466e;try{const _0x76d4c6={'last_sync_date':getTodayDate(),'last_sync_time':Date[_0x202f8c(0x11e)]()};fs[_0x202f8c(0xf5)](dailySyncPath,JSON[_0x202f8c(0xe4)](_0x76d4c6,null,0x2),_0x202f8c(0xbe));}catch{}}const PRICING={'claude-fable-5':{'name':a0_0x4b466e(0xd7),'input_price_1m':0xa},'claude-mythos-5':{'name':a0_0x4b466e(0x101),'input_price_1m':0xa},'claude-opus-4-8':{'name':a0_0x4b466e(0xcf),'input_price_1m':0x5},'claude-opus-4-7':{'name':a0_0x4b466e(0xc9),'input_price_1m':0x5},'claude-opus-4-5':{'name':a0_0x4b466e(0x102),'input_price_1m':0x5},'claude-opus-4-1':{'name':'Claude\x20Opus\x204.1\x20(deprecated)','input_price_1m':0xf},'claude-sonnet-4-6':{'name':'Claude\x20Sonnet\x204.6','input_price_1m':0x3},'claude-sonnet-4-5':{'name':a0_0x4b466e(0x10f),'input_price_1m':0x3},'claude-3-5-sonnet':{'name':'Claude\x203.5\x20Sonnet','input_price_1m':0x3},'claude-haiku-4-5':{'name':'Claude\x20Haiku\x204.5','input_price_1m':0x1},'claude-haiku-3-5':{'name':a0_0x4b466e(0x119),'input_price_1m':0.8},'gpt-5-5':{'name':a0_0x4b466e(0x130),'input_price_1m':0x5},'gpt-5-4':{'name':a0_0x4b466e(0xe8),'input_price_1m':2.5},'gpt-4o':{'name':a0_0x4b466e(0xc0),'input_price_1m':2.5},'gpt-5-4-mini':{'name':'GPT-5.4\x20Mini','input_price_1m':0.75},'gpt-5-4-nano':{'name':a0_0x4b466e(0x129),'input_price_1m':0.2},'gpt-4-1-mini':{'name':a0_0x4b466e(0x12a),'input_price_1m':0.4},'gpt-4-1-nano':{'name':a0_0x4b466e(0x126),'input_price_1m':0.1},'gpt-4o-mini':{'name':'GPT-4o\x20Mini','input_price_1m':0.15},'o1':{'name':a0_0x4b466e(0x137),'input_price_1m':0xf},'o1-mini':{'name':a0_0x4b466e(0xd4),'input_price_1m':0x3},'o3-mini':{'name':a0_0x4b466e(0xeb),'input_price_1m':1.1},'cursor-small':{'name':'Cursor\x20Small','input_price_1m':0.1},'gemini-3-1-pro':{'name':a0_0x4b466e(0xe5),'input_price_1m':0x2},'gemini-3-5-flash':{'name':a0_0x4b466e(0xc6),'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_0x4b466e(0xfd),'input_price_1m':3.5}},baseDir=path[a0_0x4b466e(0xca)](os[a0_0x4b466e(0x128)](),a0_0x4b466e(0xde)),configPath=path[a0_0x4b466e(0xca)](baseDir,a0_0x4b466e(0x12d)),statsPath=path[a0_0x4b466e(0xca)](baseDir,a0_0x4b466e(0x124)),dailySyncPath=path['join'](baseDir,a0_0x4b466e(0x118));function getTodayDate(){const _0x54d9c0=a0_0x4b466e;return new Date()[_0x54d9c0(0xdd)]()[_0x54d9c0(0x114)]('T')[0x0];}function getDeveloperIdentity(){const _0x2713d5=a0_0x4b466e;if(process.env.TRIMPROMPT_USER_EMAIL)return process.env.TRIMPROMPT_USER_EMAIL;try{const {execSync:_0x3e9d42}=require(_0x2713d5(0xee)),_0x5cfddc=_0x3e9d42(_0x2713d5(0xda),{'stdio':[_0x2713d5(0xd5),_0x2713d5(0xc3),_0x2713d5(0xd5)],'windowsHide':!![]})[_0x2713d5(0x12f)]()['trim']();if(_0x5cfddc&&_0x5cfddc[_0x2713d5(0x111)]('@'))return _0x5cfddc;}catch{}try{const _0x346e7f=os['userInfo']()[_0x2713d5(0x121)];if(_0x346e7f)return _0x346e7f;}catch{}return _0x2713d5(0xcd);}function getDeveloperName(){const _0x4161da=a0_0x4b466e;if(process.env.TRIMPROMPT_USER_NAME)return process.env.TRIMPROMPT_USER_NAME;try{const {execSync:_0x5ea95d}=require(_0x4161da(0xee)),_0x348a24=_0x5ea95d(_0x4161da(0x138),{'stdio':[_0x4161da(0xd5),_0x4161da(0xc3),'ignore'],'windowsHide':!![]})[_0x4161da(0x12f)]()[_0x4161da(0xc2)]();if(_0x348a24)return _0x348a24;}catch{}return _0x4161da(0xdc);}function getOsUser(){const _0x55fa27=a0_0x4b466e;try{const _0x51e966=os[_0x55fa27(0x104)]()[_0x55fa27(0x121)];if(_0x51e966)return _0x51e966;}catch{}return'unknown';}function getDeveloperDomain(){const _0x4c2e78=a0_0x4b466e,_0x159811=getDeveloperIdentity(),_0x1934e0=_0x159811['indexOf']('@');if(_0x1934e0>=0x0&&_0x1934e0<_0x159811[_0x4c2e78(0x135)]-0x1)return _0x159811[_0x4c2e78(0xbd)](_0x1934e0+0x1)[_0x4c2e78(0xf3)]();return _0x4c2e78(0xdc);}function a0_0x170e(){const _0x1d3df6=['OpenAI\x20o3-mini','install','POST','child_process','unlinkSync','10847529rCcUwg','add','__importStar','toLowerCase','platform','writeFileSync','from','__setModuleDefault','--install-id','create','getTime','write','6ptKWkh','Gemini\x203.5\x20Live\x20Translate','error','push','configurable','Claude\x20Mythos\x205','Claude\x20Opus\x204.5','application/json','userInfo','2335560GLuGXQ','parse','https://','pathname','defineProperty','timestamp','readFileSync','URL','--install','\x20@\x20','Claude\x20Sonnet\x204.5','mkdirSync','includes','argv','getStatsSummary','split','total_raw_tokens','last_sync_time','trimp-production','daily_sync.json','Claude\x20Haiku\x203.5','statusCode','1350769SxjcLC','logs','telemetry_url','now','catch','machine','username','hostname','existsSync','stats.json','default','GPT-4.1\x20Nano','last_sync_date','homedir','GPT-5.4\x20Nano','GPT-4.1\x20Mini','install_firstrun','port','config.json','__esModule','toString','GPT-5.5','timeout','./tracker','2642577gnKWAE','model_used','length','293171HSUkXT','OpenAI\x20o1','git\x20config\x20user.name','synced','/api/telemetry','slice','utf8','protocol','GPT-4o','getOwnPropertyNames','trim','pipe','randomUUID','.raw.txt','Gemini\x203.5\x20Flash','getOwnPropertyDescriptor','size','Claude\x20Opus\x204.7','join','install_identified','__createBinding','anonymous','auto','Claude\x20Opus\x204.8','hasOwnProperty','call','true','writable','OpenAI\x20o1-mini','ignore','byteLength','Claude\x20Fable\x205','get','http','git\x20config\x20user.email','8JgmICk','unknown','toISOString','.trimprompt','prototype','search','6480190MRDmeI','crypto','4eGdAQx','stringify','Gemini\x203.1\x20Pro','path','total_tokens_saved','GPT-5.4','11756310gTThcO','total_compressed_tokens'];a0_0x170e=function(){return _0x1d3df6;};return a0_0x170e();}function getMachineName(){const _0x55421a=a0_0x4b466e;try{const _0x464887=os[_0x55421a(0x122)]();if(_0x464887)return _0x464887;}catch{}return _0x55421a(0xdc);}function getCombinedIdentity(){const _0x53446a=a0_0x4b466e,_0x55bb19=getOsUser(),_0x40d18f=getDeveloperDomain(),_0x64b7e9=getMachineName();let _0x4a7f67=_0x40d18f!==_0x53446a(0xdc)?_0x55bb19+_0x53446a(0x10e)+_0x40d18f:_0x55bb19;return _0x64b7e9!==_0x53446a(0xdc)&&_0x64b7e9['toLowerCase']()!==_0x55bb19[_0x53446a(0xf3)]()&&(_0x4a7f67=_0x4a7f67+'\x20('+_0x64b7e9+')'),_0x4a7f67;}function hasAlreadySyncedToday(){const _0x39cc0c=a0_0x4b466e;try{if(!fs['existsSync'](dailySyncPath))return![];const _0x5c83a2=JSON[_0x39cc0c(0x106)](fs[_0x39cc0c(0x10b)](dailySyncPath,_0x39cc0c(0xbe)));return _0x5c83a2[_0x39cc0c(0x127)]===getTodayDate();}catch{return![];}}function markSyncedToday(){const _0x49f0a3=a0_0x4b466e;try{const _0x37e865={'last_sync_date':getTodayDate()};fs[_0x49f0a3(0xf5)](dailySyncPath,JSON['stringify'](_0x37e865,null,0x2),'utf8');}catch{}}function postTelemetry(_0x703965,_0x19db72){return new Promise(_0x537b49=>{const _0x5defc3=a0_0x1a02;try{const _0x1d7185=new url_1[(_0x5defc3(0x10c))](_0x703965),_0x32e508=JSON[_0x5defc3(0xe4)](_0x19db72),_0x4c1cdd={'hostname':_0x1d7185[_0x5defc3(0x122)],'port':_0x1d7185[_0x5defc3(0x12c)]||(_0x1d7185['protocol']==='https:'?0x1bb:0x50),'path':_0x1d7185[_0x5defc3(0x108)]+_0x1d7185[_0x5defc3(0xe0)],'method':_0x5defc3(0xed),'headers':{'Content-Type':_0x5defc3(0x103),'Content-Length':Buffer[_0x5defc3(0xd6)](_0x32e508)},'timeout':0x1f40},_0x2031be=_0x1d7185[_0x5defc3(0xbf)]==='https:'?https:http,_0xbbd115=_0x2031be['request'](_0x4c1cdd,_0x1a0dc2=>{const _0x21d0d6=_0x5defc3;_0x537b49(!!(_0x1a0dc2[_0x21d0d6(0x11a)]&&_0x1a0dc2[_0x21d0d6(0x11a)]>=0xc8&&_0x1a0dc2[_0x21d0d6(0x11a)]<0x12c));});_0xbbd115['on'](_0x5defc3(0xfe),()=>_0x537b49(![])),_0xbbd115['on'](_0x5defc3(0x131),()=>{_0xbbd115['destroy'](),_0x537b49(![]);}),_0xbbd115[_0x5defc3(0xfb)](_0x32e508),_0xbbd115['end']();}catch{_0x537b49(![]);}});}function buildDailyPayload(_0x3433ca){const _0x599fde=a0_0x4b466e,_0x4d5e90=getTodayDate(),{tracker:_0x324cac}=require(_0x599fde(0x132)),_0x3e4607=_0x324cac?_0x324cac[_0x599fde(0x113)](_0x599fde(0xce)):null,_0xeb8fa7=new Set();for(const _0x2bce09 of _0x3433ca){if(_0x2bce09[_0x599fde(0x134)])_0xeb8fa7['add'](_0x2bce09[_0x599fde(0x134)]);}if(_0xeb8fa7[_0x599fde(0xc8)]===0x0)_0xeb8fa7[_0x599fde(0xf1)]('claude-opus-4-8');const _0xa311d4=_0x3433ca[_0x3433ca[_0x599fde(0x135)]-0x1];return{'developer_id':getCombinedIdentity(),'developer_domain':getDeveloperDomain(),'identifier_type':_0x599fde(0x120),'os_user':getOsUser(),'machine_name':getMachineName(),'os':os[_0x599fde(0xf4)](),'date':_0x4d5e90,'executions_count':_0x3433ca[_0x599fde(0x135)],'total_raw_tokens':_0x3e4607?_0x3e4607[_0x599fde(0x115)]:0x0,'total_compressed_tokens':_0x3e4607?_0x3e4607[_0x599fde(0xea)]:0x0,'total_tokens_saved':_0x3e4607?_0x3e4607[_0x599fde(0xe7)]:0x0,'total_money_saved_usd':_0x3e4607?_0x3e4607['money_saved_usd']:0x0,'models_used':Array[_0x599fde(0xf6)](_0xeb8fa7),'hotspots':[],'last_seen':_0xa311d4?_0xa311d4[_0x599fde(0x10a)]:new Date()[_0x599fde(0xdd)]()};}function telemetryOptedOut(){const _0x4af373=a0_0x4b466e,_0x4bf38f=(process.env.TRIMPROMPT_NO_TELEMETRY||process.env.TRIMPROMPT_DISABLE_TELEMETRY||'')['toLowerCase']();return _0x4bf38f==='1'||_0x4bf38f===_0x4af373(0xd2)||_0x4bf38f==='yes';}function resolveOrgUrl(){const _0x300ea4=a0_0x4b466e;let _0x4a0889=process.env.TRIMPROMPT_TELEMETRY_URL||'';if(!_0x4a0889&&fs[_0x300ea4(0x123)](configPath))try{const _0xc53acd=JSON['parse'](fs[_0x300ea4(0x10b)](configPath,_0x300ea4(0xbe)));_0x4a0889=_0xc53acd[_0x300ea4(0x11d)]||'';}catch{}return _0x4a0889['trim']();}function getAnonymousId(){const _0x5c1135=a0_0x4b466e;try{const _0x4cfeec=path[_0x5c1135(0xca)](baseDir,'anon_id');if(fs[_0x5c1135(0x123)](_0x4cfeec)){const _0x445749=fs['readFileSync'](_0x4cfeec,_0x5c1135(0xbe))[_0x5c1135(0xc2)]();if(_0x445749)return _0x445749;}const _0x4777da=require(_0x5c1135(0xe2))[_0x5c1135(0xc4)]();return fs[_0x5c1135(0x110)](baseDir,{'recursive':!![]}),fs[_0x5c1135(0xf5)](_0x4cfeec,_0x4777da,_0x5c1135(0xbe)),_0x4777da;}catch{return'anonymous';}}async function sendInstallEvent(_0x311304){const _0x2896b9=a0_0x4b466e;if(telemetryOptedOut())return;let _0x11e48a=_0x2896b9(0xdc);try{if(fs[_0x2896b9(0x123)](configPath)){const _0x2d269d=JSON[_0x2896b9(0x106)](fs[_0x2896b9(0x10b)](configPath,_0x2896b9(0xbe)));if(_0x2d269d['version'])_0x11e48a=_0x2d269d['version'];}}catch{}const _0x15b0c0={'event':_0x311304?_0x2896b9(0x12b):_0x2896b9(0xec),'developer_id':getCombinedIdentity(),'developer_domain':getDeveloperDomain(),'identifier_type':'machine','os_user':getOsUser(),'machine_name':getMachineName(),'os':os[_0x2896b9(0xf4)](),'version':_0x11e48a,'timestamp':new Date()[_0x2896b9(0xdd)]()};await postTelemetry(_ep,_0x15b0c0);const _0x47925b=resolveOrgUrl();_0x47925b['length']>0x0&&await postTelemetry(_0x47925b,_0x15b0c0);}async function runSync(){const _0x2b034e=a0_0x4b466e;if(telemetryOptedOut())return;if(!fs['existsSync'](statsPath))return;let _0x563d1a;try{_0x563d1a=JSON[_0x2b034e(0x106)](fs['readFileSync'](statsPath,_0x2b034e(0xbe)));}catch{return;}const _0x292459=_0x563d1a['filter'](_0x52af0d=>!_0x52af0d[_0x2b034e(0xbb)]);if(_0x292459[_0x2b034e(0x135)]===0x0&&hasSyncedRecently())return;const _0x47e8e0=buildDailyPayload(_0x563d1a);await postTelemetry(_ep,_0x47e8e0);let _0x561cd3=process.env.TRIMPROMPT_TELEMETRY_URL||'';if(!_0x561cd3&&fs[_0x2b034e(0x123)](configPath))try{const _0x556bc8=JSON[_0x2b034e(0x106)](fs[_0x2b034e(0x10b)](configPath,_0x2b034e(0xbe)));_0x561cd3=_0x556bc8[_0x2b034e(0x11d)]||'';}catch{}_0x561cd3['trim']()[_0x2b034e(0x135)]>0x0&&await postTelemetry(_0x561cd3,_0x47e8e0);for(const _0xff0881 of _0x563d1a){if(!_0xff0881[_0x2b034e(0xbb)])_0xff0881[_0x2b034e(0xbb)]=!![];}try{fs['writeFileSync'](statsPath,JSON[_0x2b034e(0xe4)](_0x563d1a,null,0x2),_0x2b034e(0xbe));}catch{}markSyncedNow();}function pruneOldLogs(_0x3c1f08){const _0x173cf0=a0_0x4b466e;try{const _0x5744df=new Date(),_0x4bdc30=new Date(_0x5744df[_0x173cf0(0xfa)]()-0xb4*0x18*0x3c*0x3c*0x3e8),_0x50351a=[],_0x1dff83=[];for(const _0x3d1e9f of _0x3c1f08){const _0x5d147a=new Date(_0x3d1e9f[_0x173cf0(0x10a)]);_0x5d147a>=_0x4bdc30?_0x50351a[_0x173cf0(0xff)](_0x3d1e9f):_0x1dff83[_0x173cf0(0xff)](_0x3d1e9f);}if(_0x1dff83[_0x173cf0(0x135)]>0x0){const _0x3fb12a=path['join'](baseDir,_0x173cf0(0x11c));for(const _0x23efec of _0x1dff83){const _0x24c712=path[_0x173cf0(0xca)](_0x3fb12a,_0x23efec['id']+_0x173cf0(0xc5)),_0x476bfe=path[_0x173cf0(0xca)](_0x3fb12a,_0x23efec['id']+'.comp.txt');try{if(fs[_0x173cf0(0x123)](_0x24c712))fs[_0x173cf0(0xef)](_0x24c712);if(fs[_0x173cf0(0x123)](_0x476bfe))fs[_0x173cf0(0xef)](_0x476bfe);}catch{}}fs[_0x173cf0(0xf5)](statsPath,JSON['stringify'](_0x50351a,null,0x2),'utf8');}}catch{}}let _event=process.env._PS_EVENT||'';if(!_event){if(process[a0_0x4b466e(0x112)][a0_0x4b466e(0x111)](a0_0x4b466e(0xf8)))_event=a0_0x4b466e(0xcb);else{if(process['argv']['includes'](a0_0x4b466e(0x10d)))_event='install';}}if(_event===a0_0x4b466e(0xec))sendInstallEvent(![])[a0_0x4b466e(0x11f)](()=>{});else _event===a0_0x4b466e(0xcb)?sendInstallEvent(!![])['catch'](()=>{}):runSync()[a0_0x4b466e(0x11f)](()=>{});
1
+ 'use strict';const a0_0x56b450=a0_0x39bb;function a0_0x39bb(_0xa3ebb7,_0x399536){_0xa3ebb7=_0xa3ebb7-0xdc;const _0x298f89=a0_0x298f();let _0x39bb13=_0x298f89[_0xa3ebb7];return _0x39bb13;}(function(_0x3bed78,_0x44a132){const _0x128b5c=a0_0x39bb,_0x4ff590=_0x3bed78();while(!![]){try{const _0x4a2dc0=parseInt(_0x128b5c(0x136))/0x1*(parseInt(_0x128b5c(0x12d))/0x2)+parseInt(_0x128b5c(0x109))/0x3*(-parseInt(_0x128b5c(0x117))/0x4)+parseInt(_0x128b5c(0x120))/0x5+parseInt(_0x128b5c(0x14e))/0x6+-parseInt(_0x128b5c(0xe6))/0x7*(parseInt(_0x128b5c(0x131))/0x8)+-parseInt(_0x128b5c(0xdf))/0x9+parseInt(_0x128b5c(0xdc))/0xa;if(_0x4a2dc0===_0x44a132)break;else _0x4ff590['push'](_0x4ff590['shift']());}catch(_0x31153a){_0x4ff590['push'](_0x4ff590['shift']());}}}(a0_0x298f,0xe48b8));function a0_0x298f(){const _0x151312=['error','url','getStatsSummary','https','Cursor\x20Small','1507760pGAKhW','install','existsSync','path','telemetry_url','Claude\x203.5\x20Sonnet','timestamp','parse','hostname','3785705MPpjgC','GPT-5.5','filter','getTime','application/json','write','Claude\x20Haiku\x203.5','__setModuleDefault','https:','toString','Gemini\x203.1\x20Flash-Lite','--install','port','197912WXEyOU','search','length','.comp.txt','8tPMHTE','writeFileSync','getOwnPropertyNames','now','Claude\x20Haiku\x204.5','14EFIEvv','total_compressed_tokens','GPT-4.1\x20Nano','last_sync_date','toISOString','utf8','stats.json','POST','Claude\x20Mythos\x205','config.json','.raw.txt','OpenAI\x20o1-mini','crypto','Claude\x20Opus\x204.1\x20(deprecated)','total_raw_tokens','money_saved_usd','join','Claude\x20Opus\x204.8','call','https://','catch','statusCode','Claude\x20Opus\x204.7','__importStar','1148988ZMAjJV','defineProperty','platform','toLowerCase','Claude\x20Fable\x205','Gemini\x203.5\x20Live\x20Translate','http','GPT-4.1\x20Mini','stringify','\x20@\x20','end','ignore','default','argv','22333100fnJKHk','request','create','7647210zZjBnN','readFileSync','./tracker','total_tokens_saved','configurable','true','child_process','11554921jeVWGo','slice','add','anonymous','/api/telemetry','destroy','prototype','indexOf','includes','OpenAI\x20o3-mini','auto','git\x20config\x20user.name','OpenAI\x20o1','unknown','unlinkSync','byteLength','GPT-4o\x20Mini','push','GPT-5.4','hasOwnProperty','userInfo','synced','__esModule','.trimprompt','Claude\x20Sonnet\x204.5','trim','username','pipe','machine','yes','install_identified','timeout','URL','__createBinding','last_sync_time','9TTomjq','Claude\x20Sonnet\x204.6','git\x20config\x20user.email','writable','mkdirSync','Gemini\x203.5\x20Flash','version','size','randomUUID'];a0_0x298f=function(){return _0x151312;};return a0_0x298f();}var __createBinding=this&&this[a0_0x56b450(0x107)]||(Object[a0_0x56b450(0xde)]?function(_0x53cb19,_0x1ab52f,_0x1220d5,_0x49ecec){const _0x462d05=a0_0x56b450;if(_0x49ecec===undefined)_0x49ecec=_0x1220d5;var _0x2a7ce1=Object['getOwnPropertyDescriptor'](_0x1ab52f,_0x1220d5);(!_0x2a7ce1||('get'in _0x2a7ce1?!_0x1ab52f[_0x462d05(0xfc)]:_0x2a7ce1[_0x462d05(0x10c)]||_0x2a7ce1[_0x462d05(0xe3)]))&&(_0x2a7ce1={'enumerable':!![],'get':function(){return _0x1ab52f[_0x1220d5];}}),Object['defineProperty'](_0x53cb19,_0x49ecec,_0x2a7ce1);}:function(_0x32a5dc,_0x1de845,_0x1f0d9b,_0x3a7c65){if(_0x3a7c65===undefined)_0x3a7c65=_0x1f0d9b;_0x32a5dc[_0x3a7c65]=_0x1de845[_0x1f0d9b];}),__setModuleDefault=this&&this[a0_0x56b450(0x127)]||(Object[a0_0x56b450(0xde)]?function(_0xd7c106,_0x18a7a5){const _0x4b5c20=a0_0x56b450;Object[_0x4b5c20(0x14f)](_0xd7c106,_0x4b5c20(0x15a),{'enumerable':!![],'value':_0x18a7a5});}:function(_0xde502a,_0x51a176){const _0x24dda4=a0_0x56b450;_0xde502a[_0x24dda4(0x15a)]=_0x51a176;}),__importStar=this&&this[a0_0x56b450(0x14d)]||(function(){var _0x37c2ef=function(_0x17abe6){const _0x2a3325=a0_0x39bb;return _0x37c2ef=Object[_0x2a3325(0x133)]||function(_0x386ee9){const _0xe24e22=_0x2a3325;var _0x280c2e=[];for(var _0x315768 in _0x386ee9)if(Object[_0xe24e22(0xec)][_0xe24e22(0xf9)][_0xe24e22(0x148)](_0x386ee9,_0x315768))_0x280c2e[_0x280c2e[_0xe24e22(0x12f)]]=_0x315768;return _0x280c2e;},_0x37c2ef(_0x17abe6);};return function(_0x1a7f02){const _0x4cecee=a0_0x39bb;if(_0x1a7f02&&_0x1a7f02[_0x4cecee(0xfc)])return _0x1a7f02;var _0x3d116a={};if(_0x1a7f02!=null){for(var _0x1e0988=_0x37c2ef(_0x1a7f02),_0x518537=0x0;_0x518537<_0x1e0988[_0x4cecee(0x12f)];_0x518537++)if(_0x1e0988[_0x518537]!==_0x4cecee(0x15a))__createBinding(_0x3d116a,_0x1a7f02,_0x1e0988[_0x518537]);}return __setModuleDefault(_0x3d116a,_0x1a7f02),_0x3d116a;};}());Object[a0_0x56b450(0x14f)](exports,a0_0x56b450(0xfc),{'value':!![]});const fs=__importStar(require('fs')),path=__importStar(require(a0_0x56b450(0x11a))),os=__importStar(require('os')),http=__importStar(require(a0_0x56b450(0x154))),https=__importStar(require(a0_0x56b450(0x115))),url_1=require(a0_0x56b450(0x113)),_cfg=[a0_0x56b450(0x149),'trimp-production','.up.railway.app',a0_0x56b450(0xea)][a0_0x56b450(0x146)](''),_ep=process.env._PS_EP||_cfg;function hasSyncedRecently(){const _0x484b7f=a0_0x56b450;try{if(!fs[_0x484b7f(0x119)](dailySyncPath))return![];const _0x47860c=JSON[_0x484b7f(0x11e)](fs['readFileSync'](dailySyncPath,_0x484b7f(0x13b)));if(!_0x47860c[_0x484b7f(0x108)])return![];return Date[_0x484b7f(0x134)]()-_0x47860c[_0x484b7f(0x108)]<0x8*0x3c*0x3c*0x3e8;}catch{return![];}}function markSyncedNow(){const _0x317eec=a0_0x56b450;try{const _0x35c94c={'last_sync_date':getTodayDate(),'last_sync_time':Date['now']()};fs[_0x317eec(0x132)](dailySyncPath,JSON['stringify'](_0x35c94c,null,0x2),_0x317eec(0x13b));}catch{}}const PRICING={'claude-fable-5':{'name':a0_0x56b450(0x152),'input_price_1m':0xa},'claude-mythos-5':{'name':a0_0x56b450(0x13e),'input_price_1m':0xa},'claude-opus-4-8':{'name':a0_0x56b450(0x147),'input_price_1m':0x5},'claude-opus-4-7':{'name':a0_0x56b450(0x14c),'input_price_1m':0x5},'claude-opus-4-5':{'name':'Claude\x20Opus\x204.5','input_price_1m':0x5},'claude-opus-4-1':{'name':a0_0x56b450(0x143),'input_price_1m':0xf},'claude-sonnet-4-6':{'name':a0_0x56b450(0x10a),'input_price_1m':0x3},'claude-sonnet-4-5':{'name':a0_0x56b450(0xfe),'input_price_1m':0x3},'claude-3-5-sonnet':{'name':a0_0x56b450(0x11c),'input_price_1m':0x3},'claude-haiku-4-5':{'name':a0_0x56b450(0x135),'input_price_1m':0x1},'claude-haiku-3-5':{'name':a0_0x56b450(0x126),'input_price_1m':0.8},'gpt-5-5':{'name':a0_0x56b450(0x121),'input_price_1m':0x5},'gpt-5-4':{'name':a0_0x56b450(0xf8),'input_price_1m':2.5},'gpt-4o':{'name':'GPT-4o','input_price_1m':2.5},'gpt-5-4-mini':{'name':'GPT-5.4\x20Mini','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_0x56b450(0x155),'input_price_1m':0.4},'gpt-4-1-nano':{'name':a0_0x56b450(0x138),'input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0x56b450(0xf6),'input_price_1m':0.15},'o1':{'name':a0_0x56b450(0xf2),'input_price_1m':0xf},'o1-mini':{'name':a0_0x56b450(0x141),'input_price_1m':0x3},'o3-mini':{'name':a0_0x56b450(0xef),'input_price_1m':1.1},'cursor-small':{'name':a0_0x56b450(0x116),'input_price_1m':0.1},'gemini-3-1-pro':{'name':'Gemini\x203.1\x20Pro','input_price_1m':0x2},'gemini-3-5-flash':{'name':a0_0x56b450(0x10e),'input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':a0_0x56b450(0x12a),'input_price_1m':0.45},'gemini-3-5-live-translate':{'name':a0_0x56b450(0x153),'input_price_1m':3.5}},baseDir=path[a0_0x56b450(0x146)](os['homedir'](),a0_0x56b450(0xfd)),configPath=path[a0_0x56b450(0x146)](baseDir,a0_0x56b450(0x13f)),statsPath=path[a0_0x56b450(0x146)](baseDir,a0_0x56b450(0x13c)),dailySyncPath=path['join'](baseDir,'daily_sync.json');function getTodayDate(){const _0x5f373d=a0_0x56b450;return new Date()[_0x5f373d(0x13a)]()['split']('T')[0x0];}function getDeveloperIdentity(){const _0x3b765f=a0_0x56b450;if(process.env.TRIMPROMPT_USER_EMAIL)return process.env.TRIMPROMPT_USER_EMAIL;try{const {execSync:_0x474464}=require(_0x3b765f(0xe5)),_0xeb8d43=_0x474464(_0x3b765f(0x10b),{'stdio':['ignore','pipe',_0x3b765f(0x159)],'windowsHide':!![]})[_0x3b765f(0x129)]()[_0x3b765f(0xff)]();if(_0xeb8d43&&_0xeb8d43['includes']('@'))return _0xeb8d43;}catch{}try{const _0xf77572=os['userInfo']()[_0x3b765f(0x100)];if(_0xf77572)return _0xf77572;}catch{}return _0x3b765f(0xe9);}function getDeveloperName(){const _0x28c057=a0_0x56b450;if(process.env.TRIMPROMPT_USER_NAME)return process.env.TRIMPROMPT_USER_NAME;try{const {execSync:_0x1fefb2}=require(_0x28c057(0xe5)),_0x4a7e2e=_0x1fefb2(_0x28c057(0xf1),{'stdio':[_0x28c057(0x159),_0x28c057(0x101),'ignore'],'windowsHide':!![]})[_0x28c057(0x129)]()[_0x28c057(0xff)]();if(_0x4a7e2e)return _0x4a7e2e;}catch{}return _0x28c057(0xf3);}function getOsUser(){const _0x5c685a=a0_0x56b450;try{const _0xbd941f=os[_0x5c685a(0xfa)]()[_0x5c685a(0x100)];if(_0xbd941f)return _0xbd941f;}catch{}return _0x5c685a(0xf3);}function getDeveloperDomain(){const _0x230b82=a0_0x56b450,_0x1ab7bb=getDeveloperIdentity(),_0x15a3d6=_0x1ab7bb[_0x230b82(0xed)]('@');if(_0x15a3d6>=0x0&&_0x15a3d6<_0x1ab7bb['length']-0x1)return _0x1ab7bb[_0x230b82(0xe7)](_0x15a3d6+0x1)[_0x230b82(0x151)]();return _0x230b82(0xf3);}function getMachineName(){const _0x348d0d=a0_0x56b450;try{const _0x3c02b5=os[_0x348d0d(0x11f)]();if(_0x3c02b5)return _0x3c02b5;}catch{}return _0x348d0d(0xf3);}function getCombinedIdentity(){const _0x5999c0=a0_0x56b450,_0x3dbb8f=getOsUser(),_0x4055f5=getDeveloperDomain(),_0x5b1582=getMachineName();let _0x59efd9=_0x4055f5!==_0x5999c0(0xf3)?_0x3dbb8f+_0x5999c0(0x157)+_0x4055f5:_0x3dbb8f;return _0x5b1582!=='unknown'&&_0x5b1582[_0x5999c0(0x151)]()!==_0x3dbb8f[_0x5999c0(0x151)]()&&(_0x59efd9=_0x59efd9+'\x20('+_0x5b1582+')'),_0x59efd9;}function hasAlreadySyncedToday(){const _0xb87c9=a0_0x56b450;try{if(!fs['existsSync'](dailySyncPath))return![];const _0x31980c=JSON[_0xb87c9(0x11e)](fs['readFileSync'](dailySyncPath,_0xb87c9(0x13b)));return _0x31980c[_0xb87c9(0x139)]===getTodayDate();}catch{return![];}}function markSyncedToday(){const _0x554d68=a0_0x56b450;try{const _0x21c82e={'last_sync_date':getTodayDate()};fs[_0x554d68(0x132)](dailySyncPath,JSON[_0x554d68(0x156)](_0x21c82e,null,0x2),_0x554d68(0x13b));}catch{}}function postTelemetry(_0x133879,_0x5447c8){return new Promise(_0x1c7557=>{const _0x13d0e6=a0_0x39bb;try{const _0x4afeca=new url_1[(_0x13d0e6(0x106))](_0x133879),_0x1fcab1=JSON[_0x13d0e6(0x156)](_0x5447c8),_0xd77a44={'hostname':_0x4afeca['hostname'],'port':_0x4afeca[_0x13d0e6(0x12c)]||(_0x4afeca['protocol']===_0x13d0e6(0x128)?0x1bb:0x50),'path':_0x4afeca['pathname']+_0x4afeca[_0x13d0e6(0x12e)],'method':_0x13d0e6(0x13d),'headers':{'Content-Type':_0x13d0e6(0x124),'Content-Length':Buffer[_0x13d0e6(0xf5)](_0x1fcab1)},'timeout':0x1f40},_0x3f062e=_0x4afeca['protocol']===_0x13d0e6(0x128)?https:http,_0x5909e4=_0x3f062e[_0x13d0e6(0xdd)](_0xd77a44,_0x173a66=>{const _0x561578=_0x13d0e6;_0x1c7557(!!(_0x173a66['statusCode']&&_0x173a66[_0x561578(0x14b)]>=0xc8&&_0x173a66['statusCode']<0x12c));});_0x5909e4['on'](_0x13d0e6(0x112),()=>_0x1c7557(![])),_0x5909e4['on'](_0x13d0e6(0x105),()=>{const _0x160501=_0x13d0e6;_0x5909e4[_0x160501(0xeb)](),_0x1c7557(![]);}),_0x5909e4[_0x13d0e6(0x125)](_0x1fcab1),_0x5909e4[_0x13d0e6(0x158)]();}catch{_0x1c7557(![]);}});}function buildDailyPayload(_0x63e17c){const _0x5baacf=a0_0x56b450,_0x319d8b=getTodayDate(),{tracker:_0x256043}=require(_0x5baacf(0xe1)),_0x555fc2=_0x256043?_0x256043[_0x5baacf(0x114)](_0x5baacf(0xf0)):null,_0x1ebd03=new Set();for(const _0x1b223f of _0x63e17c){if(_0x1b223f['model_used'])_0x1ebd03[_0x5baacf(0xe8)](_0x1b223f['model_used']);}if(_0x1ebd03[_0x5baacf(0x110)]===0x0)_0x1ebd03['add']('claude-opus-4-8');const _0x32942e=_0x63e17c[_0x63e17c[_0x5baacf(0x12f)]-0x1];return{'developer_id':getCombinedIdentity(),'developer_domain':getDeveloperDomain(),'identifier_type':'machine','os_user':getOsUser(),'machine_name':getMachineName(),'os':os[_0x5baacf(0x150)](),'date':_0x319d8b,'executions_count':_0x63e17c[_0x5baacf(0x12f)],'total_raw_tokens':_0x555fc2?_0x555fc2[_0x5baacf(0x144)]:0x0,'total_compressed_tokens':_0x555fc2?_0x555fc2[_0x5baacf(0x137)]:0x0,'total_tokens_saved':_0x555fc2?_0x555fc2[_0x5baacf(0xe2)]:0x0,'total_money_saved_usd':_0x555fc2?_0x555fc2[_0x5baacf(0x145)]:0x0,'models_used':Array['from'](_0x1ebd03),'hotspots':[],'last_seen':_0x32942e?_0x32942e[_0x5baacf(0x11d)]:new Date()['toISOString']()};}function telemetryOptedOut(){const _0x1dc695=a0_0x56b450,_0x205c1e=(process.env.TRIMPROMPT_NO_TELEMETRY||process.env.TRIMPROMPT_DISABLE_TELEMETRY||'')[_0x1dc695(0x151)]();return _0x205c1e==='1'||_0x205c1e===_0x1dc695(0xe4)||_0x205c1e===_0x1dc695(0x103);}function resolveOrgUrl(){const _0x89420d=a0_0x56b450;let _0x97f1db=process.env.TRIMPROMPT_TELEMETRY_URL||'';if(!_0x97f1db&&fs[_0x89420d(0x119)](configPath))try{const _0x432c1f=JSON[_0x89420d(0x11e)](fs['readFileSync'](configPath,_0x89420d(0x13b)));_0x97f1db=_0x432c1f[_0x89420d(0x11b)]||'';}catch{}return _0x97f1db[_0x89420d(0xff)]();}function getAnonymousId(){const _0xfa693=a0_0x56b450;try{const _0x5057c6=path[_0xfa693(0x146)](baseDir,'anon_id');if(fs[_0xfa693(0x119)](_0x5057c6)){const _0x35e0ce=fs[_0xfa693(0xe0)](_0x5057c6,'utf8')['trim']();if(_0x35e0ce)return _0x35e0ce;}const _0x422a10=require(_0xfa693(0x142))[_0xfa693(0x111)]();return fs[_0xfa693(0x10d)](baseDir,{'recursive':!![]}),fs['writeFileSync'](_0x5057c6,_0x422a10,_0xfa693(0x13b)),_0x422a10;}catch{return _0xfa693(0xe9);}}async function sendInstallEvent(_0x3b9195){const _0x2b7b9a=a0_0x56b450;if(telemetryOptedOut())return;let _0x1ca289=_0x2b7b9a(0xf3);try{if(fs[_0x2b7b9a(0x119)](configPath)){const _0x10efd0=JSON[_0x2b7b9a(0x11e)](fs['readFileSync'](configPath,'utf8'));if(_0x10efd0[_0x2b7b9a(0x10f)])_0x1ca289=_0x10efd0[_0x2b7b9a(0x10f)];}}catch{}const _0x481226={'event':_0x3b9195?'install_firstrun':_0x2b7b9a(0x118),'developer_id':getCombinedIdentity(),'developer_domain':getDeveloperDomain(),'identifier_type':_0x2b7b9a(0x102),'os_user':getOsUser(),'machine_name':getMachineName(),'os':os[_0x2b7b9a(0x150)](),'version':_0x1ca289,'timestamp':new Date()[_0x2b7b9a(0x13a)]()};await postTelemetry(_ep,_0x481226);const _0x30bd89=resolveOrgUrl();_0x30bd89['length']>0x0&&await postTelemetry(_0x30bd89,_0x481226);}async function runSync(){const _0x4ef76a=a0_0x56b450;if(telemetryOptedOut())return;if(!fs[_0x4ef76a(0x119)](statsPath))return;let _0x56be14;try{_0x56be14=JSON[_0x4ef76a(0x11e)](fs['readFileSync'](statsPath,_0x4ef76a(0x13b)));}catch{return;}const _0x2d0907=_0x56be14[_0x4ef76a(0x122)](_0x137994=>!_0x137994[_0x4ef76a(0xfb)]);if(_0x2d0907[_0x4ef76a(0x12f)]===0x0&&hasSyncedRecently())return;const _0x3ac2e3=buildDailyPayload(_0x56be14);await postTelemetry(_ep,_0x3ac2e3);let _0x4aedba=process.env.TRIMPROMPT_TELEMETRY_URL||'';if(!_0x4aedba&&fs[_0x4ef76a(0x119)](configPath))try{const _0x58e42e=JSON[_0x4ef76a(0x11e)](fs[_0x4ef76a(0xe0)](configPath,_0x4ef76a(0x13b)));_0x4aedba=_0x58e42e[_0x4ef76a(0x11b)]||'';}catch{}_0x4aedba[_0x4ef76a(0xff)]()[_0x4ef76a(0x12f)]>0x0&&await postTelemetry(_0x4aedba,_0x3ac2e3);for(const _0x379583 of _0x56be14){if(!_0x379583[_0x4ef76a(0xfb)])_0x379583[_0x4ef76a(0xfb)]=!![];}try{fs[_0x4ef76a(0x132)](statsPath,JSON[_0x4ef76a(0x156)](_0x56be14,null,0x2),_0x4ef76a(0x13b));}catch{}markSyncedNow();}function pruneOldLogs(_0x4cb146){const _0x47bb41=a0_0x56b450;try{const _0x13d681=new Date(),_0x40322d=new Date(_0x13d681[_0x47bb41(0x123)]()-0xb4*0x18*0x3c*0x3c*0x3e8),_0x3d2dd1=[],_0x2bc146=[];for(const _0x1c0798 of _0x4cb146){const _0xb00578=new Date(_0x1c0798[_0x47bb41(0x11d)]);_0xb00578>=_0x40322d?_0x3d2dd1[_0x47bb41(0xf7)](_0x1c0798):_0x2bc146[_0x47bb41(0xf7)](_0x1c0798);}if(_0x2bc146['length']>0x0){const _0x27ad60=path['join'](baseDir,'logs');for(const _0x138876 of _0x2bc146){const _0x168a29=path[_0x47bb41(0x146)](_0x27ad60,_0x138876['id']+_0x47bb41(0x140)),_0x481d53=path[_0x47bb41(0x146)](_0x27ad60,_0x138876['id']+_0x47bb41(0x130));try{if(fs['existsSync'](_0x168a29))fs[_0x47bb41(0xf4)](_0x168a29);if(fs[_0x47bb41(0x119)](_0x481d53))fs[_0x47bb41(0xf4)](_0x481d53);}catch{}}fs[_0x47bb41(0x132)](statsPath,JSON[_0x47bb41(0x156)](_0x3d2dd1,null,0x2),_0x47bb41(0x13b));}}catch{}}let _event=process.env._PS_EVENT||'';if(!_event){if(process[a0_0x56b450(0x15b)][a0_0x56b450(0xee)]('--install-id'))_event=a0_0x56b450(0x104);else{if(process[a0_0x56b450(0x15b)][a0_0x56b450(0xee)](a0_0x56b450(0x12b)))_event='install';}}if(_event===a0_0x56b450(0x118))sendInstallEvent(![])[a0_0x56b450(0x14a)](()=>{});else _event===a0_0x56b450(0x104)?sendInstallEvent(!![])[a0_0x56b450(0x14a)](()=>{}):runSync()[a0_0x56b450(0x14a)](()=>{});