trimprompt 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -0
- package/cli.js +1 -1
- package/dashboard.js +1 -1
- package/executor.js +1 -1
- package/filters/generic.js +1 -1
- package/filters/git.js +1 -1
- package/filters/index.js +1 -1
- package/filters/js.js +1 -1
- package/filters/python.js +1 -1
- package/mcp.js +1 -1
- package/package.json +4 -1
- package/redactor.js +1 -1
- package/seed.js +1 -1
- package/shims.js +1 -1
- package/simulate.js +1 -1
- package/sync.js +1 -1
- package/tracker.js +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# TrimPrompt.ai — Client CLI & Local Developer Dashboard
|
|
2
|
+
|
|
3
|
+
**TrimPrompt** is an intelligent, zero-configuration local proxy and telemetry client designed to reduce LLM token consumption for AI coding assistants (such as Claude Code, Cursor, GitHub Copilot, and Windsurf) by **60% to 90%**.
|
|
4
|
+
|
|
5
|
+
It intercepts common shell tool executions, strips ANSI coloring, removes redundant boilerplate, collapses duplicate logs, and applies specialized filters for `git`, `npm`/`pnpm`/`yarn`, `pytest`, `jest`, `pip`, and more—all before the outputs reach your AI agent's context window.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
* **Zero-Config Interception:** Automatically injects custom PATH shims during installation so that all agent-triggered tools run through the optimizer transparently.
|
|
11
|
+
* **Real-time MCP Proxy:** Intercepts Model Context Protocol (MCP) tool response JSON-RPC streams on the fly to compress large tool outputs.
|
|
12
|
+
* **Developer Dashboard:** Visualizes token savings, original vs. shaved cost estimates, and provides a line-by-line diff inspector.
|
|
13
|
+
* **Log Rotation Policy:** Automatically prunes local log text files and database entries older than **180 days** in the background to prevent disk bloat.
|
|
14
|
+
* **Central Sync:** Option to stream aggregated daily savings metrics to a centralized self-hosted Enterprise Hub.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Installation & Setup
|
|
19
|
+
|
|
20
|
+
Install the package globally via NPM:
|
|
21
|
+
```bash
|
|
22
|
+
npm install -g trimprompt
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
> [!IMPORTANT]
|
|
26
|
+
> Restart your active terminal window or AI editor (Cursor/Claude Code) after installation for the changes to take effect.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
### 1. Transparent Interception
|
|
33
|
+
Since TrimPrompt intercepts commands at the OS `PATH` level, your AI assistants will automatically benefit from prompt optimization without changing their workflow.
|
|
34
|
+
When Claude Code runs `git status`, it triggers `trim git status` behind the scenes, outputting a compacted representation.
|
|
35
|
+
|
|
36
|
+
### 2. Manual CLI Commands
|
|
37
|
+
You can also run commands manually:
|
|
38
|
+
* Show stats summary:
|
|
39
|
+
```bash
|
|
40
|
+
trim stats
|
|
41
|
+
```
|
|
42
|
+
* View/Set local configurations (e.g. set telemetry sync endpoint):
|
|
43
|
+
```bash
|
|
44
|
+
trim config set telemetry_url "http://your-company-hub:5000/api/telemetry"
|
|
45
|
+
```
|
|
46
|
+
* Inspect a dry-run command rewrite:
|
|
47
|
+
```bash
|
|
48
|
+
trim rewrite "git status"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 3. Model Context Protocol (MCP) Proxying
|
|
52
|
+
If you run interactive, streaming MCP servers, wrap them with the `mcp-proxy` command:
|
|
53
|
+
```bash
|
|
54
|
+
trim mcp-proxy <server-command> [server-args...]
|
|
55
|
+
```
|
|
56
|
+
Example:
|
|
57
|
+
```bash
|
|
58
|
+
trim mcp-proxy npx -y @modelcontextprotocol/server-postgres postgres://localhost:5432
|
|
59
|
+
```
|
|
60
|
+
TrimPrompt will parse the stdin/stdout JSON-RPC stream, extract the tool response text blocks, compress them, log metrics, and forward the stream in real-time.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Local Developer Dashboard
|
|
65
|
+
|
|
66
|
+
Start the local dashboard web UI:
|
|
67
|
+
```bash
|
|
68
|
+
trim ui
|
|
69
|
+
# or trim dashboard
|
|
70
|
+
```
|
|
71
|
+
Options:
|
|
72
|
+
* `-p, --port <number>`: Port to run the server on (default: `4000`).
|
|
73
|
+
|
|
74
|
+
The command will boot the dashboard web server and automatically open your default browser pointing to:
|
|
75
|
+
👉 **`http://localhost:4000`**
|
|
76
|
+
|
|
77
|
+
### Inside the Dashboard:
|
|
78
|
+
* **Analytics Cards:** See your Shaved Cost, Reduction Rate, Estimated Savings, and Original Cost.
|
|
79
|
+
* **Savings Timeline:** A Chart.js graph tracking your daily raw vs. compressed token counts.
|
|
80
|
+
* **Execution Logs:** Click on any past command to open the visual side-by-side diff inspector showing the exact raw vs. compacted output.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## 180-Day Log Rotation Policy
|
|
85
|
+
To keep your disk usage lightweight, TrimPrompt runs a background cleanup process. Every calendar day you use the CLI, a detached background process unlinks all log files (`.raw.txt` and `.comp.txt`) inside `~/.trimprompt/logs/` and removes metadata records from `stats.json` that are older than **180 days**.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## License
|
|
90
|
+
Proprietary — TrimPrompt.ai
|
package/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
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']);
|
|
2
|
+
'use strict';function a0_0x2805(_0x4e4a75,_0x24e687){_0x4e4a75=_0x4e4a75-0x1b5;const _0x534ee7=a0_0x534e();let _0x2805a3=_0x534ee7[_0x4e4a75];return _0x2805a3;}const a0_0x392b81=a0_0x2805;(function(_0x534f9f,_0x2722d1){const _0x19e46c=a0_0x2805,_0x4bdb88=_0x534f9f();while(!![]){try{const _0x49b6d2=parseInt(_0x19e46c(0x23a))/0x1*(-parseInt(_0x19e46c(0x21e))/0x2)+-parseInt(_0x19e46c(0x23b))/0x3+parseInt(_0x19e46c(0x218))/0x4*(parseInt(_0x19e46c(0x24b))/0x5)+parseInt(_0x19e46c(0x1b6))/0x6+parseInt(_0x19e46c(0x255))/0x7+parseInt(_0x19e46c(0x223))/0x8*(parseInt(_0x19e46c(0x1d4))/0x9)+parseInt(_0x19e46c(0x1cf))/0xa*(-parseInt(_0x19e46c(0x252))/0xb);if(_0x49b6d2===_0x2722d1)break;else _0x4bdb88['push'](_0x4bdb88['shift']());}catch(_0x6d971f){_0x4bdb88['push'](_0x4bdb88['shift']());}}}(a0_0x534e,0xe3655));var __createBinding=this&&this[a0_0x392b81(0x1ca)]||(Object['create']?function(_0xc2bfb9,_0x473778,_0x3cb4e5,_0x3f2dcb){const _0x1d670d=a0_0x392b81;if(_0x3f2dcb===undefined)_0x3f2dcb=_0x3cb4e5;var _0x116fda=Object[_0x1d670d(0x244)](_0x473778,_0x3cb4e5);(!_0x116fda||(_0x1d670d(0x1e8)in _0x116fda?!_0x473778['__esModule']:_0x116fda[_0x1d670d(0x1be)]||_0x116fda['configurable']))&&(_0x116fda={'enumerable':!![],'get':function(){return _0x473778[_0x3cb4e5];}}),Object[_0x1d670d(0x1f4)](_0xc2bfb9,_0x3f2dcb,_0x116fda);}:function(_0x28841c,_0x2272bf,_0x1736d4,_0x26ade1){if(_0x26ade1===undefined)_0x26ade1=_0x1736d4;_0x28841c[_0x26ade1]=_0x2272bf[_0x1736d4];}),__setModuleDefault=this&&this[a0_0x392b81(0x1dd)]||(Object[a0_0x392b81(0x238)]?function(_0x5409c0,_0x4af604){const _0x420015=a0_0x392b81;Object[_0x420015(0x1f4)](_0x5409c0,_0x420015(0x1f8),{'enumerable':!![],'value':_0x4af604});}:function(_0x22c1a2,_0x10e527){_0x22c1a2['default']=_0x10e527;}),__importStar=this&&this[a0_0x392b81(0x1d0)]||(function(){var _0x42a412=function(_0x4eb6ce){const _0x57486b=a0_0x2805;return _0x42a412=Object[_0x57486b(0x220)]||function(_0x1b0374){const _0x296808=_0x57486b;var _0x1d2651=[];for(var _0x4a9d6d in _0x1b0374)if(Object[_0x296808(0x1c8)][_0x296808(0x1dc)][_0x296808(0x20d)](_0x1b0374,_0x4a9d6d))_0x1d2651[_0x1d2651[_0x296808(0x1eb)]]=_0x4a9d6d;return _0x1d2651;},_0x42a412(_0x4eb6ce);};return function(_0x1c1264){const _0x228aed=a0_0x2805;if(_0x1c1264&&_0x1c1264[_0x228aed(0x1c4)])return _0x1c1264;var _0x1673f0={};if(_0x1c1264!=null){for(var _0x3d804f=_0x42a412(_0x1c1264),_0x788c4d=0x0;_0x788c4d<_0x3d804f[_0x228aed(0x1eb)];_0x788c4d++)if(_0x3d804f[_0x788c4d]!==_0x228aed(0x1f8))__createBinding(_0x1673f0,_0x1c1264,_0x3d804f[_0x788c4d]);}return __setModuleDefault(_0x1673f0,_0x1c1264),_0x1673f0;};}());Object[a0_0x392b81(0x1f4)](exports,a0_0x392b81(0x1c4),{'value':!![]});const commander_1=require(a0_0x392b81(0x1fa)),executor_1=require(a0_0x392b81(0x209)),filters_1=require(a0_0x392b81(0x254)),tracker_1=require('./tracker'),shims_1=require(a0_0x392b81(0x1ee)),dashboard_1=require(a0_0x392b81(0x216)),program=new commander_1[(a0_0x392b81(0x1cd))]();function isDisabled(){return process.env.TRIMPROMPT_DISABLED==='1';}function adjustCommandArgs(_0x30a047,_0x569214){const _0xca2273=a0_0x392b81,_0x4b377d=_0x30a047[_0xca2273(0x1c7)]();if(_0x4b377d==='git'||_0x4b377d==='yadm'){const _0xcad4f=_0x569214[0x0];if(_0xcad4f==='status'){const _0x2700f1=_0x569214[_0xca2273(0x231)](0x1),_0x429567=_0x2700f1['length']===0x0||_0x2700f1[_0xca2273(0x1d8)](_0x19b84e=>{const _0x539012=_0xca2273;return _0x19b84e==='-b'||_0x19b84e===_0x539012(0x215)||_0x19b84e===_0x539012(0x22a)||_0x19b84e===_0x539012(0x235)||_0x19b84e==='-s'||_0x19b84e===_0x539012(0x20a);});if(_0x429567)return{'cmd':_0x30a047,'args':[_0xca2273(0x251),_0xca2273(0x248),'-b']};}else{if(_0xcad4f===_0xca2273(0x1f0)){const _0x22730e=_0x569214[_0xca2273(0x231)](0x1),_0x2148b5=_0x22730e[_0xca2273(0x1c3)](_0x2ad408=>_0x2ad408[_0xca2273(0x208)](_0xca2273(0x1b9))||_0x2ad408['startsWith'](_0xca2273(0x241))||_0x2ad408[_0xca2273(0x208)](_0xca2273(0x214))),_0x46bf36=_0x22730e[_0xca2273(0x1c3)](_0x5059f0=>_0x5059f0[_0xca2273(0x208)]('-')&&/^\d+$/[_0xca2273(0x24e)](_0x5059f0[_0xca2273(0x231)](0x1))||_0x5059f0==='-n'||_0x5059f0[_0xca2273(0x208)](_0xca2273(0x224))),_0xbe3a34=[..._0x569214];if(!_0x2148b5){const _0x538350='--pretty=format:%h\x20%s\x20(%ar)\x20(%an)%n%b%n---END---';_0xbe3a34['push'](process[_0xca2273(0x1bf)]===_0xca2273(0x20f)?'\x22'+_0x538350+'\x22':_0x538350);}!_0x46bf36&&(_0x2148b5?_0xbe3a34[_0xca2273(0x239)](_0xca2273(0x1bd)):_0xbe3a34[_0xca2273(0x239)]('-10'));const _0x40a711=_0x22730e[_0xca2273(0x1c3)](_0x11b9ad=>_0x11b9ad===_0xca2273(0x1e0)||_0x11b9ad===_0xca2273(0x237)||_0x11b9ad['startsWith']('--min-parents'));return!_0x40a711&&!_0x46bf36&&_0xbe3a34['push'](_0xca2273(0x237)),{'cmd':_0x30a047,'args':_0xbe3a34};}}}return{'cmd':_0x30a047,'args':_0x569214};}function isMcpServerExecution(_0x7a49ad,_0x3dfd28){const _0x54c473=a0_0x392b81,_0x150131=_0x7a49ad[_0x54c473(0x1c7)](),_0x3e83ea=_0x3dfd28[_0x54c473(0x217)]('\x20')[_0x54c473(0x1c7)]();if(_0x150131['includes']('mcp')&&(_0x150131[_0x54c473(0x1c0)](_0x54c473(0x1d3))||_0x150131['includes'](_0x54c473(0x1f5))))return!![];if(_0x150131===_0x54c473(0x1d6)||_0x150131===_0x54c473(0x1e9)||_0x150131===_0x54c473(0x226)||_0x150131==='npm'||_0x150131===_0x54c473(0x1d2)||_0x150131===_0x54c473(0x22f)){if(_0x3e83ea[_0x54c473(0x1c0)](_0x54c473(0x1fd))||_0x3e83ea[_0x54c473(0x1c0)](_0x54c473(0x1d1))||_0x3e83ea[_0x54c473(0x1c0)](_0x54c473(0x1f1))||_0x3e83ea[_0x54c473(0x1c0)](_0x54c473(0x221)))return!![];}if(_0x3dfd28[_0x54c473(0x1c3)](_0x2a66d0=>{const _0x3e3a25=_0x54c473,_0xa4a65b=_0x2a66d0[_0x3e3a25(0x1c7)]();return _0xa4a65b[_0x3e3a25(0x1c0)](_0x3e3a25(0x1f1))||_0xa4a65b[_0x3e3a25(0x1c0)]('server-mcp')||_0xa4a65b['includes'](_0x3e3a25(0x1fd))||_0xa4a65b===_0x3e3a25(0x1c2)||_0xa4a65b===_0x3e3a25(0x233);}))return!![];return![];}async function runProxy(_0x5c32b6){const _0x262e3b=a0_0x392b81;if(_0x5c32b6[_0x262e3b(0x1eb)]===0x0){program[_0x262e3b(0x24a)]();return;}const _0x4ddbdf=_0x5c32b6[0x0],_0x1add13=_0x5c32b6[_0x262e3b(0x231)](0x1),_0x3352ea=_0x5c32b6[_0x262e3b(0x217)]('\x20');if(isDisabled()){const _0x31f0c5=await(0x0,executor_1[_0x262e3b(0x1ff)])(_0x4ddbdf,_0x1add13);process['stdout']['write'](_0x31f0c5['stdout']),process[_0x262e3b(0x240)][_0x262e3b(0x1cb)](_0x31f0c5[_0x262e3b(0x240)]),process['exit'](_0x31f0c5[_0x262e3b(0x236)]);}if(isMcpServerExecution(_0x4ddbdf,_0x1add13)){console[_0x262e3b(0x1ce)](_0x262e3b(0x1ec));const {runMcpProxy:_0x51c931}=await Promise[_0x262e3b(0x1c9)]()['then'](()=>__importStar(require(_0x262e3b(0x21f))));_0x51c931(_0x4ddbdf,_0x1add13);return;}const _0x3e1d4a=adjustCommandArgs(_0x4ddbdf,_0x1add13),_0xff2fbb=await(0x0,executor_1[_0x262e3b(0x1ff)])(_0x3e1d4a[_0x262e3b(0x21d)],_0x3e1d4a['args']),_0x3608ea=(0x0,filters_1[_0x262e3b(0x1e5)])(_0x3352ea,_0xff2fbb['stdout'],_0xff2fbb['stderr'],tracker_1[_0x262e3b(0x1fe)][_0x262e3b(0x1bc)]()[_0x262e3b(0x1ef)]),_0x31067b=_0xff2fbb['stdout']+(_0xff2fbb[_0x262e3b(0x240)][_0x262e3b(0x1e2)]()[_0x262e3b(0x1eb)]>0x0?'\x0a'+_0xff2fbb[_0x262e3b(0x240)]:'');tracker_1[_0x262e3b(0x1fe)][_0x262e3b(0x201)](_0x3352ea,_0x31067b,_0x3608ea,_0xff2fbb[_0x262e3b(0x236)]),_0xff2fbb[_0x262e3b(0x236)]===0x0?process[_0x262e3b(0x1c6)][_0x262e3b(0x1cb)](_0x3608ea+'\x0a'):(process[_0x262e3b(0x1c6)][_0x262e3b(0x1cb)](_0x3608ea+'\x0a'),_0xff2fbb[_0x262e3b(0x240)][_0x262e3b(0x1e2)]()[_0x262e3b(0x1eb)]>0x0&&!_0x3608ea[_0x262e3b(0x1c0)](_0xff2fbb[_0x262e3b(0x240)]['trim']())&&process[_0x262e3b(0x240)][_0x262e3b(0x1cb)](_0xff2fbb[_0x262e3b(0x240)]+'\x0a')),process[_0x262e3b(0x204)](_0xff2fbb[_0x262e3b(0x236)]);}function a0_0x534e(){const _0x1fcb6b=['executeCommand','-p,\x20--port\x20<number>','logExecution','Money\x20Saved:\x20\x20\x20\x20\x20\x20\x20$','set','exit','shims','then','install','startsWith','./executor','--short','\x20\x20\x20\x20\x20\x20\x20TRIMPROMPT.AI\x20SAVINGS\x20SUMMARY\x20\x20\x20\x20\x20\x20\x20\x20','=============================================','call','stats','win32','message','option','Install\x20or\x20uninstall\x20system\x20command\x20shims','Start\x20the\x20local\x20developer\x20dashboard','--format','--branch','./dashboard','join','6180PKAMKK','[server-args...]','1.0.0','parse','name','cmd','2iEaenJ','./mcp','getOwnPropertyNames','server-mcp','description','5745224AqeHNY','--max-count','uninstallShims','bun','-m,\x20--model\x20<string>','argument','Proxy\x20wrapper\x20for\x20Model\x20Context\x20Protocol\x20(MCP)\x20servers\x20to\x20compact\x20tool\x20outputs','-sb','[TrimPrompt]\x20Fatal\x20Proxy\x20Error:\x20','alias','savings_percentage','port','yarn','Select\x20pricing\x20model\x20(e.g.\x20claude-3-5-sonnet,\x20gpt-4o)','slice','Reduction\x20Rate:\x20\x20\x20\x20','mcp','\x20(after\x20Shave)','-bs','exitCode','--no-merges','create','push','264736ZXmHJn','620793bbzKTT','argv','Raw\x20Tokens:\x20\x20\x20\x20\x20\x20\x20\x20','Config\x20set\x20','toLocaleString','stderr','--pretty','Error:\x20Action\x20must\x20be\x20install\x20or\x20uninstall','model','getOwnPropertyDescriptor','Command\x20line\x20to\x20evaluate','Check\x20a\x20command\x20line\x20and\x20return\x20the\x20optimized\x20command\x20line','=============================================\x0a','--porcelain','toFixed','help','4870evGNgL','action','--version','test','install\x20or\x20uninstall','config','status','16222657IGOMIG','--help','./filters','12697545UfSpxX','<key>','Command\x20to\x20launch\x20the\x20target\x20MCP\x20server','config\x20parameter\x20name','10743138KjdjZb','startDashboard','false','--oneline','model_name','<action>','getConfig','-50','writable','platform','includes','[value]','mcp-proxy','some','__esModule','\x20USD','stdout','toLowerCase','prototype','resolve','__createBinding','write','total_compressed_tokens','Command','error','30DIhxZu','__importStar','modelcontextprotocol','pnpm','server','9DViOMH','rewriteCommand','npx','claude-3-5-sonnet','every','TrimPrompt.ai\x20-\x20Reduce\x20LLM\x20token\x20consumption\x20by\x2060-90%','Compressed:\x20\x20\x20\x20\x20\x20\x20\x20','Estimated\x20Cost:\x20\x20\x20\x20$','hasOwnProperty','__setModuleDefault','command','rewrite','--merges','\x20(before\x20Shave)','trim','total_raw_tokens','<server-command>','compressOutput','Arguments\x20for\x20the\x20target\x20MCP\x20server','Show\x20token\x20and\x20cost\x20savings\x20summary','get','node','true','length','[TrimPrompt]\x20Autodetected\x20MCP\x20server\x20execution.\x20Activating\x20real-time\x20JSON-RPC\x20proxy...','value\x20to\x20set','./shims','redaction_enabled','log','mcp-server','---------------------------------------------','4000','defineProperty','proxy','raw_cost_usd','\x0a=============================================','default','total_tokens_saved','commander','<commandLine>','dashboard','@modelcontextprotocol/','tracker'];a0_0x534e=function(){return _0x1fcb6b;};return a0_0x534e();}program[a0_0x392b81(0x21c)](a0_0x392b81(0x1e2))[a0_0x392b81(0x222)](a0_0x392b81(0x1d9))['version'](a0_0x392b81(0x21a)),program['command']('ui')[a0_0x392b81(0x22c)](a0_0x392b81(0x1fc))['description'](a0_0x392b81(0x213))[a0_0x392b81(0x211)](a0_0x392b81(0x200),'Port\x20to\x20run\x20the\x20dashboard\x20on',a0_0x392b81(0x1f3))['action'](_0x471ff2=>{const _0x50dd9c=a0_0x392b81,_0x171522=parseInt(_0x471ff2[_0x50dd9c(0x22e)],0xa);(0x0,dashboard_1[_0x50dd9c(0x1b7)])(_0x171522);}),program[a0_0x392b81(0x1de)](a0_0x392b81(0x20e))[a0_0x392b81(0x222)](a0_0x392b81(0x1e7))['option'](a0_0x392b81(0x227),a0_0x392b81(0x230),a0_0x392b81(0x1d7))['action'](_0xb7f1f3=>{const _0x528d2b=a0_0x392b81,_0x5ad87f=tracker_1[_0x528d2b(0x1fe)]['getStatsSummary'](_0xb7f1f3[_0x528d2b(0x243)]);console[_0x528d2b(0x1f0)](_0x528d2b(0x1f7)),console[_0x528d2b(0x1f0)](_0x528d2b(0x20b)),console[_0x528d2b(0x1f0)](_0x528d2b(0x20c)),console[_0x528d2b(0x1f0)]('Model\x20Context:\x20\x20\x20\x20\x20'+_0x5ad87f[_0x528d2b(0x1ba)]),console[_0x528d2b(0x1f0)](_0x528d2b(0x23d)+_0x5ad87f[_0x528d2b(0x1e3)][_0x528d2b(0x23f)]()),console[_0x528d2b(0x1f0)](_0x528d2b(0x1da)+_0x5ad87f[_0x528d2b(0x1cc)][_0x528d2b(0x23f)]()),console[_0x528d2b(0x1f0)]('Tokens\x20Saved:\x20\x20\x20\x20\x20\x20'+_0x5ad87f[_0x528d2b(0x1f9)][_0x528d2b(0x23f)]()),console[_0x528d2b(0x1f0)](_0x528d2b(0x232)+_0x5ad87f[_0x528d2b(0x22d)]+'%'),console[_0x528d2b(0x1f0)](_0x528d2b(0x1db)+_0x5ad87f[_0x528d2b(0x1f6)][_0x528d2b(0x249)](0x4)+_0x528d2b(0x1e1)),console[_0x528d2b(0x1f0)]('Actual\x20Cost:\x20\x20\x20\x20\x20\x20\x20$'+_0x5ad87f['compressed_cost_usd'][_0x528d2b(0x249)](0x4)+_0x528d2b(0x234)),console[_0x528d2b(0x1f0)](_0x528d2b(0x1f2)),console['log'](_0x528d2b(0x202)+_0x5ad87f['money_saved_usd'][_0x528d2b(0x249)](0x4)+_0x528d2b(0x1c5)),console[_0x528d2b(0x1f0)](_0x528d2b(0x247));}),program[a0_0x392b81(0x1de)]('config')[a0_0x392b81(0x222)]('Manage\x20local\x20configuration\x20parameters')['argument'](a0_0x392b81(0x1bb),'get\x20or\x20set')['argument'](a0_0x392b81(0x256),a0_0x392b81(0x1b5))[a0_0x392b81(0x228)](a0_0x392b81(0x1c1),a0_0x392b81(0x1ed))[a0_0x392b81(0x24c)]((_0x28a742,_0x3a2be5,_0x34a0ca)=>{const _0x2ea809=a0_0x392b81;if(_0x28a742===_0x2ea809(0x1e8)){const _0x2449f4=tracker_1[_0x2ea809(0x1fe)]['getConfig']();console[_0x2ea809(0x1f0)](_0x3a2be5+':\x20'+_0x2449f4[_0x3a2be5]);}else{if(_0x28a742===_0x2ea809(0x203)){_0x34a0ca===undefined&&(console[_0x2ea809(0x1ce)]('Error:\x20Value\x20required\x20for\x20set\x20action'),process[_0x2ea809(0x204)](0x1));let _0x4fc53a=_0x34a0ca;if(_0x34a0ca===_0x2ea809(0x1ea))_0x4fc53a=!![];if(_0x34a0ca===_0x2ea809(0x1b8))_0x4fc53a=![];if(/^\d+$/[_0x2ea809(0x24e)](_0x34a0ca))_0x4fc53a=parseInt(_0x34a0ca,0xa);tracker_1[_0x2ea809(0x1fe)]['setConfig'](_0x3a2be5,_0x4fc53a),console[_0x2ea809(0x1f0)](_0x2ea809(0x23e)+_0x3a2be5+'\x20=\x20'+_0x34a0ca);}else console[_0x2ea809(0x1ce)]('Error:\x20Action\x20must\x20be\x20get\x20or\x20set'),process[_0x2ea809(0x204)](0x1);}}),program[a0_0x392b81(0x1de)](a0_0x392b81(0x205))['description'](a0_0x392b81(0x212))['argument'](a0_0x392b81(0x1bb),a0_0x392b81(0x24f))[a0_0x392b81(0x24c)](_0x940d24=>{const _0x357c21=a0_0x392b81;if(_0x940d24===_0x357c21(0x207)){const _0xd31e91=(0x0,shims_1['installShims'])();console[_0x357c21(0x1f0)](_0xd31e91['message']);}else{if(_0x940d24==='uninstall'){const _0x1f9891=(0x0,shims_1[_0x357c21(0x225)])();console['log'](_0x1f9891['message']);}else console[_0x357c21(0x1ce)](_0x357c21(0x242)),process[_0x357c21(0x204)](0x1);}}),program['command'](a0_0x392b81(0x1df))[a0_0x392b81(0x222)](a0_0x392b81(0x246))[a0_0x392b81(0x228)](a0_0x392b81(0x1fb),a0_0x392b81(0x245))['action'](_0x10bb9c=>{const _0x5c15ea=a0_0x392b81;if(isDisabled()){console[_0x5c15ea(0x1f0)](_0x10bb9c);return;}const _0x4926e9=(0x0,filters_1[_0x5c15ea(0x1d5)])(_0x10bb9c);console[_0x5c15ea(0x1f0)](_0x4926e9);}),program[a0_0x392b81(0x1de)](a0_0x392b81(0x1c2))[a0_0x392b81(0x22c)]('mcp')['description'](a0_0x392b81(0x229))[a0_0x392b81(0x228)](a0_0x392b81(0x1e4),a0_0x392b81(0x257))[a0_0x392b81(0x228)](a0_0x392b81(0x219),a0_0x392b81(0x1e6))[a0_0x392b81(0x24c)](async(_0xdcb598,_0x5e7405)=>{const _0x224ac2=a0_0x392b81,{runMcpProxy:_0x2efa43}=await Promise[_0x224ac2(0x1c9)]()[_0x224ac2(0x206)](()=>__importStar(require(_0x224ac2(0x21f))));_0x2efa43(_0xdcb598,_0x5e7405);});const args=process[a0_0x392b81(0x23c)][a0_0x392b81(0x231)](0x2),firstArg=args[0x0],subcommands=['ui',a0_0x392b81(0x1fc),a0_0x392b81(0x20e),a0_0x392b81(0x250),a0_0x392b81(0x205),'rewrite',a0_0x392b81(0x1c2),a0_0x392b81(0x233),a0_0x392b81(0x24a),a0_0x392b81(0x253),'-h','version',a0_0x392b81(0x24d),'-v'];firstArg&&!subcommands[a0_0x392b81(0x1c0)](firstArg)?runProxy(args)['catch'](_0xc51379=>{const _0x5d2b61=a0_0x392b81;console['error'](_0x5d2b61(0x22b)+_0xc51379[_0x5d2b61(0x210)]),process[_0x5d2b61(0x204)](0x1);}):program[a0_0x392b81(0x21b)](process[a0_0x392b81(0x23c)]);
|
package/dashboard.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x2f3a67=a0_0x2931;function a0_0x2931(_0x45cd2d,_0x28ea9d){_0x45cd2d=_0x45cd2d-0x88;const _0x3f73c7=a0_0x3f73();let _0x29315e=_0x3f73c7[_0x45cd2d];return _0x29315e;}(function(_0x29e29d,_0x211d89){const _0x5e064d=a0_0x2931,_0x80f877=_0x29e29d();while(!![]){try{const _0x10ca4e=parseInt(_0x5e064d(0xbb))/0x1+parseInt(_0x5e064d(0x88))/0x2*(-parseInt(_0x5e064d(0xa4))/0x3)+-parseInt(_0x5e064d(0xb9))/0x4*(-parseInt(_0x5e064d(0x97))/0x5)+parseInt(_0x5e064d(0x98))/0x6*(parseInt(_0x5e064d(0x9c))/0x7)+parseInt(_0x5e064d(0xae))/0x8+-parseInt(_0x5e064d(0xb3))/0x9+-parseInt(_0x5e064d(0xa2))/0xa;if(_0x10ca4e===_0x211d89)break;else _0x80f877['push'](_0x80f877['shift']());}catch(_0x59757f){_0x80f877['push'](_0x80f877['shift']());}}}(a0_0x3f73,0x35cf3));var __createBinding=this&&this[a0_0x2f3a67(0xb0)]||(Object[a0_0x2f3a67(0xa0)]?function(_0x55c564,_0x27fa31,_0x4d4703,_0x59cb28){const _0x74d132=a0_0x2f3a67;if(_0x59cb28===undefined)_0x59cb28=_0x4d4703;var _0x115e0b=Object[_0x74d132(0x8c)](_0x27fa31,_0x4d4703);(!_0x115e0b||('get'in _0x115e0b?!_0x27fa31[_0x74d132(0x8e)]:_0x115e0b[_0x74d132(0xb5)]||_0x115e0b[_0x74d132(0xb8)]))&&(_0x115e0b={'enumerable':!![],'get':function(){return _0x27fa31[_0x4d4703];}}),Object[_0x74d132(0xa7)](_0x55c564,_0x59cb28,_0x115e0b);}:function(_0x581ac6,_0xdcc1cf,_0x5ec8d4,_0x4091d8){if(_0x4091d8===undefined)_0x4091d8=_0x5ec8d4;_0x581ac6[_0x4091d8]=_0xdcc1cf[_0x5ec8d4];}),__setModuleDefault=this&&this[a0_0x2f3a67(0x9a)]||(Object[a0_0x2f3a67(0xa0)]?function(_0x221679,_0x3890d6){const _0x4f4d7e=a0_0x2f3a67;Object[_0x4f4d7e(0xa7)](_0x221679,_0x4f4d7e(0xa9),{'enumerable':!![],'value':_0x3890d6});}:function(_0x5c72d7,_0x35d3ab){_0x5c72d7['default']=_0x35d3ab;}),__importStar=this&&this['__importStar']||(function(){var _0x2e160c=function(_0x38399d){const _0x561a43=a0_0x2931;return _0x2e160c=Object[_0x561a43(0x91)]||function(_0x40f0a1){const _0x2755e0=_0x561a43;var _0x1d3e40=[];for(var _0x2c9985 in _0x40f0a1)if(Object[_0x2755e0(0xb4)]['hasOwnProperty']['call'](_0x40f0a1,_0x2c9985))_0x1d3e40[_0x1d3e40[_0x2755e0(0xa5)]]=_0x2c9985;return _0x1d3e40;},_0x2e160c(_0x38399d);};return function(_0x44dd3e){const _0x34a5ac=a0_0x2931;if(_0x44dd3e&&_0x44dd3e[_0x34a5ac(0x8e)])return _0x44dd3e;var _0x5ae8f3={};if(_0x44dd3e!=null){for(var _0x4cd826=_0x2e160c(_0x44dd3e),_0x2aa082=0x0;_0x2aa082<_0x4cd826[_0x34a5ac(0xa5)];_0x2aa082++)if(_0x4cd826[_0x2aa082]!==_0x34a5ac(0xa9))__createBinding(_0x5ae8f3,_0x44dd3e,_0x4cd826[_0x2aa082]);}return __setModuleDefault(_0x5ae8f3,_0x44dd3e),_0x5ae8f3;};}()),__importDefault=this&&this[a0_0x2f3a67(0x96)]||function(_0x21aec6){const _0x529108=a0_0x2f3a67;return _0x21aec6&&_0x21aec6[_0x529108(0x8e)]?_0x21aec6:{'default':_0x21aec6};};Object[a0_0x2f3a67(0xa7)](exports,a0_0x2f3a67(0x8e),{'value':!![]}),exports[a0_0x2f3a67(0x90)]=startDashboard;const express_1=__importDefault(require(a0_0x2f3a67(0xbc))),path=__importStar(require(a0_0x2f3a67(0x89))),fs=__importStar(require('fs')),os=__importStar(require('os')),open_1=__importDefault(require('open')),tracker_1=require('./tracker'),app=(0x0,express_1['default'])(),baseDir=path['join'](os[a0_0x2f3a67(0xbd)](),'.trimprompt'),logsDir=path['join'](baseDir,a0_0x2f3a67(0x9f));app[a0_0x2f3a67(0x8b)]('/',(_0x16715f,_0x5a44c9)=>{const _0x5cb9af=a0_0x2f3a67,_0x5d88a2=path[_0x5cb9af(0x94)](__dirname,_0x5cb9af(0xbe));fs[_0x5cb9af(0x9b)](_0x5d88a2)?_0x5a44c9['sendFile'](_0x5d88a2):_0x5a44c9['sendFile'](path[_0x5cb9af(0x94)](__dirname,_0x5cb9af(0xac)));}),app[a0_0x2f3a67(0x8b)]('/api/stats/summary',(_0x366d61,_0x11883d)=>{const _0x21bb4f=a0_0x2f3a67,_0x4d9ea5=_0x366d61[_0x21bb4f(0xa8)]['model']||_0x21bb4f(0x9e),_0x163391=tracker_1[_0x21bb4f(0x9d)][_0x21bb4f(0x8f)](_0x4d9ea5);_0x11883d[_0x21bb4f(0x95)](_0x163391);}),app['get'](a0_0x2f3a67(0xb6),(_0x5d2245,_0x3f2c8d)=>{const _0x2bceab=a0_0x2f3a67,_0x5aa42a=tracker_1[_0x2bceab(0x9d)][_0x2bceab(0xa1)]();_0x3f2c8d[_0x2bceab(0x95)](_0x5aa42a);}),app[a0_0x2f3a67(0x8b)](a0_0x2f3a67(0x8d),(_0x2354a9,_0x418287)=>{const _0x36a7ab=a0_0x2f3a67,_0x1a4e34=_0x2354a9[_0x36a7ab(0x8a)]['id'],_0x2d6375=path['join'](logsDir,_0x1a4e34+_0x36a7ab(0x99)),_0x3a040e=path[_0x36a7ab(0x94)](logsDir,_0x1a4e34+_0x36a7ab(0x92));let _0x4bffc9=_0x36a7ab(0xaf),_0x57e342='Compressed\x20output\x20log\x20file\x20not\x20found.';try{fs[_0x36a7ab(0x9b)](_0x2d6375)&&(_0x4bffc9=fs[_0x36a7ab(0xb2)](_0x2d6375,_0x36a7ab(0xba))),fs[_0x36a7ab(0x9b)](_0x3a040e)&&(_0x57e342=fs[_0x36a7ab(0xb2)](_0x3a040e,_0x36a7ab(0xba)));}catch(_0x199094){}_0x418287[_0x36a7ab(0x95)]({'id':_0x1a4e34,'raw':_0x4bffc9,'compressed':_0x57e342});});function startDashboard(_0x1fe7f8=0xfa0){const _0x4ed799=a0_0x2f3a67;let _0x4f692b=_0x1fe7f8;const _0x3d0154=app[_0x4ed799(0x93)](_0x4f692b,()=>{const _0x5102bd=_0x4ed799,_0x4dd568=_0x5102bd(0xaa)+_0x4f692b;console[_0x5102bd(0xab)](_0x5102bd(0xad)+_0x4dd568),console['log'](_0x5102bd(0xb7)),(0x0,open_1[_0x5102bd(0xa9)])(_0x4dd568)[_0x5102bd(0xa3)](()=>{});});_0x3d0154['on']('error',_0x191587=>{const _0x27fe03=_0x4ed799;_0x191587[_0x27fe03(0xa6)]==='EADDRINUSE'?startDashboard(_0x4f692b+0x1):console['error']('[TrimPrompt]\x20Dashboard\x20error:\x20'+_0x191587[_0x27fe03(0xb1)]);});}function a0_0x3f73(){const _0x3d1326=['1594MNqfZO','path','params','get','getOwnPropertyDescriptor','/api/stats/inspect/:id','__esModule','getStatsSummary','startDashboard','getOwnPropertyNames','.comp.txt','listen','join','json','__importDefault','90siDvxi','6oEXUQc','.raw.txt','__setModuleDefault','existsSync','3057677bZzRTb','tracker','auto','logs','create','getLogs','9248660UtDEjQ','catch','741eBQxxD','length','code','defineProperty','query','default','http://localhost:','log','../src/index.html','\x0a[TrimPrompt]\x20Dashboard\x20server\x20started\x20at:\x20','3475184IZTegd','Raw\x20output\x20log\x20file\x20not\x20found.','__createBinding','message','readFileSync','1889541gQvdSz','prototype','writable','/api/stats/history','Press\x20Ctrl+C\x20in\x20this\x20terminal\x20to\x20shut\x20down.','configurable','85056stprKZ','utf8','298116UQGsOo','express','homedir','index.html'];a0_0x3f73=function(){return _0x3d1326;};return a0_0x3f73();}
|
package/executor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var a0_0x424952=a0_0x6437;(function(_0x150ebb,_0x29e9f7){var _0x48b531=a0_0x6437,_0x45484d=_0x150ebb();while(!![]){try{var _0x181ba1=parseInt(_0x48b531(0x14b))/0x1+-parseInt(_0x48b531(0x14e))/0x2+-parseInt(_0x48b531(0x146))/0x3*(parseInt(_0x48b531(0x148))/0x4)+parseInt(_0x48b531(0x13d))/0x5*(parseInt(_0x48b531(0x140))/0x6)+parseInt(_0x48b531(0x153))/0x7+parseInt(_0x48b531(0x157))/0x8+parseInt(_0x48b531(0x147))/0x9*(-parseInt(_0x48b531(0x159))/0xa);if(_0x181ba1===_0x29e9f7)break;else _0x45484d['push'](_0x45484d['shift']());}catch(_0x297522){_0x45484d['push'](_0x45484d['shift']());}}}(a0_0xa1bb,0x3930b));function a0_0x6437(_0xf34e9b,_0x287de7){_0xf34e9b=_0xf34e9b-0x132;var _0xa1bb36=a0_0xa1bb();var _0x6437d9=_0xa1bb36[_0xf34e9b];return _0x6437d9;}function a0_0xa1bb(){var _0x5262d5=['default','error','213478DPainl','inherit','toString','close','trim','1817039lzbGMi','filter','getOwnPropertyDescriptor','length','1479432nOecFl','toLowerCase','47950NkJOtu','Failed\x20to\x20spawn\x20command\x20\x22','create','homedir','__esModule','message','join','getOwnPropertyNames','path','writable','pipe','__setModuleDefault','executeCommand','spawn','split','20VRPzbg','data','configurable','440934ZhfGWq','delimiter','.trimprompt','defineProperty','call','child_process','18btOOBy','1206xqsTWB','65388JHsmnA','__createBinding','shims','343140uesRde'];a0_0xa1bb=function(){return _0x5262d5;};return a0_0xa1bb();}var __createBinding=this&&this[a0_0x424952(0x149)]||(Object['create']?function(_0x5553c8,_0x30ad57,_0x240b8c,_0x4d01ca){var _0x3eed66=a0_0x424952;if(_0x4d01ca===undefined)_0x4d01ca=_0x240b8c;var _0x52c18d=Object[_0x3eed66(0x155)](_0x30ad57,_0x240b8c);(!_0x52c18d||('get'in _0x52c18d?!_0x30ad57[_0x3eed66(0x132)]:_0x52c18d[_0x3eed66(0x137)]||_0x52c18d[_0x3eed66(0x13f)]))&&(_0x52c18d={'enumerable':!![],'get':function(){return _0x30ad57[_0x240b8c];}}),Object[_0x3eed66(0x143)](_0x5553c8,_0x4d01ca,_0x52c18d);}:function(_0x1cf4e7,_0x44cf1e,_0xe2c905,_0x55c496){if(_0x55c496===undefined)_0x55c496=_0xe2c905;_0x1cf4e7[_0x55c496]=_0x44cf1e[_0xe2c905];}),__setModuleDefault=this&&this[a0_0x424952(0x139)]||(Object[a0_0x424952(0x15b)]?function(_0xd4cf26,_0x5661bf){var _0x1832e4=a0_0x424952;Object['defineProperty'](_0xd4cf26,_0x1832e4(0x14c),{'enumerable':!![],'value':_0x5661bf});}:function(_0x5a2866,_0x468767){var _0x4bc3a0=a0_0x424952;_0x5a2866[_0x4bc3a0(0x14c)]=_0x468767;}),__importStar=this&&this['__importStar']||(function(){var _0x1d55e9=function(_0x41c1e6){var _0x4c8b2f=a0_0x6437;return _0x1d55e9=Object[_0x4c8b2f(0x135)]||function(_0x375de1){var _0x2b2250=_0x4c8b2f,_0x5b216d=[];for(var _0x54ac5e in _0x375de1)if(Object['prototype']['hasOwnProperty'][_0x2b2250(0x144)](_0x375de1,_0x54ac5e))_0x5b216d[_0x5b216d[_0x2b2250(0x156)]]=_0x54ac5e;return _0x5b216d;},_0x1d55e9(_0x41c1e6);};return function(_0x2d8a49){var _0x3812cb=a0_0x6437;if(_0x2d8a49&&_0x2d8a49[_0x3812cb(0x132)])return _0x2d8a49;var _0x30a314={};if(_0x2d8a49!=null){for(var _0x43ff5b=_0x1d55e9(_0x2d8a49),_0x2adeca=0x0;_0x2adeca<_0x43ff5b['length'];_0x2adeca++)if(_0x43ff5b[_0x2adeca]!==_0x3812cb(0x14c))__createBinding(_0x30a314,_0x2d8a49,_0x43ff5b[_0x2adeca]);}return __setModuleDefault(_0x30a314,_0x2d8a49),_0x30a314;};}());Object[a0_0x424952(0x143)](exports,a0_0x424952(0x132),{'value':!![]}),exports[a0_0x424952(0x13a)]=executeCommand;const child_process_1=require(a0_0x424952(0x145)),path=__importStar(require(a0_0x424952(0x136))),os=__importStar(require('os'));function executeCommand(_0x462aee,_0x446ed9){return new Promise(_0x5c33f1=>{var _0x38f71a=a0_0x6437;const _0x5cbd94=path['join'](os[_0x38f71a(0x15c)](),_0x38f71a(0x142),_0x38f71a(0x14a)),_0x2e8ab2=(process.env.PATH||'')[_0x38f71a(0x13c)](path[_0x38f71a(0x141)])[_0x38f71a(0x154)](_0xabb033=>_0xabb033[_0x38f71a(0x152)]()[_0x38f71a(0x158)]()!==_0x5cbd94[_0x38f71a(0x158)]())[_0x38f71a(0x134)](path['delimiter']),_0x2f4e36={...process.env,'PATH':_0x2e8ab2,'TRIMPROMPT_DISABLED':'1'},_0x138943=(0x0,child_process_1[_0x38f71a(0x13b)])(_0x462aee,_0x446ed9,{'stdio':[_0x38f71a(0x14f),_0x38f71a(0x138),_0x38f71a(0x138)],'shell':!![],'env':_0x2f4e36});let _0x59a529='',_0xea7476='';_0x138943['stdout']?.['on'](_0x38f71a(0x13e),_0x387bec=>{_0x59a529+=_0x387bec['toString']();}),_0x138943['stderr']?.['on'](_0x38f71a(0x13e),_0x3bc7fc=>{var _0x2b4118=_0x38f71a;_0xea7476+=_0x3bc7fc[_0x2b4118(0x150)]();}),_0x138943['on'](_0x38f71a(0x14d),_0x570dbb=>{var _0x540e7c=_0x38f71a;_0x5c33f1({'exitCode':0x1,'stdout':'','stderr':_0x540e7c(0x15a)+_0x462aee+'\x22:\x20'+_0x570dbb[_0x540e7c(0x133)]});}),_0x138943['on'](_0x38f71a(0x151),_0xdc9052=>{_0x5c33f1({'exitCode':_0xdc9052??0x0,'stdout':_0x59a529,'stderr':_0xea7476});});});}
|
package/filters/generic.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x1ac277=a0_0x2d06;(function(_0x1cc00e,_0x404c1e){const _0x1499b5=a0_0x2d06,_0x1cccdf=_0x1cc00e();while(!![]){try{const _0x20d64d=-parseInt(_0x1499b5(0x137))/0x1+parseInt(_0x1499b5(0x140))/0x2*(-parseInt(_0x1499b5(0x142))/0x3)+-parseInt(_0x1499b5(0x14b))/0x4+-parseInt(_0x1499b5(0x147))/0x5+parseInt(_0x1499b5(0x13a))/0x6+parseInt(_0x1499b5(0x145))/0x7+parseInt(_0x1499b5(0x144))/0x8;if(_0x20d64d===_0x404c1e)break;else _0x1cccdf['push'](_0x1cccdf['shift']());}catch(_0x22fb18){_0x1cccdf['push'](_0x1cccdf['shift']());}}}(a0_0x328f,0xacb64));Object[a0_0x1ac277(0x148)](exports,a0_0x1ac277(0x149),{'value':!![]}),exports[a0_0x1ac277(0x14a)]=stripAnsi,exports[a0_0x1ac277(0x139)]=collapseDuplicates,exports['softTruncate']=softTruncate;function stripAnsi(_0x16bfbf){const _0x4e7b20=a0_0x1ac277,_0x431d92=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;return _0x16bfbf[_0x4e7b20(0x146)](_0x431d92,'');}function collapseDuplicates(_0x277449){const _0x4f846c=a0_0x1ac277,_0x467adc=_0x277449[_0x4f846c(0x13e)]('\x0a');if(_0x467adc[_0x4f846c(0x13c)]<=0x1)return _0x277449;const _0x40765d=[];let _0x2ba99a=_0x467adc[0x0],_0xcb3e46=0x1;for(let _0x3a9dea=0x1;_0x3a9dea<_0x467adc['length'];_0x3a9dea++){const _0x20ebbd=_0x467adc[_0x3a9dea];_0x20ebbd===_0x2ba99a&&_0x20ebbd[_0x4f846c(0x141)]()[_0x4f846c(0x13c)]>0x0?_0xcb3e46++:(_0xcb3e46>0x1?_0x40765d[_0x4f846c(0x143)](_0x2ba99a+_0x4f846c(0x136)+_0xcb3e46+']'):_0x40765d[_0x4f846c(0x143)](_0x2ba99a),_0x2ba99a=_0x20ebbd,_0xcb3e46=0x1);}return _0xcb3e46>0x1?_0x40765d[_0x4f846c(0x143)](_0x2ba99a+_0x4f846c(0x136)+_0xcb3e46+']'):_0x40765d[_0x4f846c(0x143)](_0x2ba99a),_0x40765d['join']('\x0a');}function a0_0x2d06(_0x11b799,_0x5b103e){_0x11b799=_0x11b799-0x136;const _0x328ff6=a0_0x328f();let _0x2d06cb=_0x328ff6[_0x11b799];return _0x2d06cb;}function a0_0x328f(){const _0x581728=['collapseDuplicates','4763376figfqL','slice','length','join','split','\x20characters\x20of\x20output]\x20...\x0a','176044MSAKPA','trim','30GJqrtu','push','14528808mBGeIR','1235892nysYcv','replace','139190AShFah','defineProperty','__esModule','stripAnsi','2622776pUlWwo','\x20[x','515373YzInhr','\x0a...\x20[TrimPrompt:\x20Truncated\x20'];a0_0x328f=function(){return _0x581728;};return a0_0x328f();}function softTruncate(_0x8f264b,_0x44291f=0x4e20){const _0x220fb9=a0_0x1ac277;if(_0x8f264b[_0x220fb9(0x13c)]<=_0x44291f)return _0x8f264b;const _0x438ec5=_0x8f264b['split']('\x0a');if(_0x438ec5[_0x220fb9(0x13c)]<=0xc8)return _0x8f264b;const _0x121f26=0x32,_0x28b510=0x96,_0x2cf481=_0x438ec5['slice'](0x0,_0x121f26),_0x1f257d=_0x438ec5[_0x220fb9(0x13b)](_0x438ec5[_0x220fb9(0x13c)]-_0x28b510),_0x23876a=_0x8f264b['length']-(_0x2cf481['join']('\x0a')['length']+_0x1f257d[_0x220fb9(0x13d)]('\x0a')[_0x220fb9(0x13c)]);return[..._0x2cf481,_0x220fb9(0x138)+_0x23876a+_0x220fb9(0x13f),..._0x1f257d][_0x220fb9(0x13d)]('\x0a');}
|
package/filters/git.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';function a0_0x127a(){const _0x5e6505=['\x0aChanges:','length','*\x20Branch:\x20','configurable','4385892gbpcJc','split','match','---END---','+++','\x20untracked\x20files)','\x20\x20...\x20+','\x20more\x20modifications','trim','filterGitDiff','/\x20(','startsWith','---','unknown_file','map','168Zqtitd','__setModuleDefault','filterGitLog','defineProperty','call','\x20(+','getOwnPropertyDescriptor','534513RbXTPq','312507akiVsd','30qgTXAM','slice','__esModule','Clean\x20working\x20tree','basename','diff\x20--git','310538EHcwIX','writable','prototype','__createBinding','filter','hasOwnProperty','2811411poubEE','__importStar','17205260lNVLjD','substring','\x0aUntracked\x20files:','[file]\x20','entries','\x20\x20??\x20','join','dirname','create','replace','push','132084sfrSrK','get','245VFNliL','default'];a0_0x127a=function(){return _0x5e6505;};return a0_0x127a();}const a0_0x24433a=a0_0x1d68;(function(_0x24d651,_0x34578f){const _0xb6ddb8=a0_0x1d68,_0x4f4797=_0x24d651();while(!![]){try{const _0x138006=-parseInt(_0xb6ddb8(0x136))/0x1+-parseInt(_0xb6ddb8(0x13d))/0x2*(parseInt(_0xb6ddb8(0x137))/0x3)+parseInt(_0xb6ddb8(0x150))/0x4*(-parseInt(_0xb6ddb8(0x152))/0x5)+parseInt(_0xb6ddb8(0x11f))/0x6+parseInt(_0xb6ddb8(0x135))/0x7*(parseInt(_0xb6ddb8(0x12e))/0x8)+parseInt(_0xb6ddb8(0x143))/0x9+parseInt(_0xb6ddb8(0x145))/0xa;if(_0x138006===_0x34578f)break;else _0x4f4797['push'](_0x4f4797['shift']());}catch(_0x126a4a){_0x4f4797['push'](_0x4f4797['shift']());}}}(a0_0x127a,0xd7de8));var __createBinding=this&&this[a0_0x24433a(0x140)]||(Object['create']?function(_0x4a37c2,_0x112ffd,_0x20c426,_0x4590f1){const _0x2b6dfb=a0_0x24433a;if(_0x4590f1===undefined)_0x4590f1=_0x20c426;var _0x37b397=Object[_0x2b6dfb(0x134)](_0x112ffd,_0x20c426);(!_0x37b397||(_0x2b6dfb(0x151)in _0x37b397?!_0x112ffd[_0x2b6dfb(0x139)]:_0x37b397[_0x2b6dfb(0x13e)]||_0x37b397[_0x2b6dfb(0x11e)]))&&(_0x37b397={'enumerable':!![],'get':function(){return _0x112ffd[_0x20c426];}}),Object[_0x2b6dfb(0x131)](_0x4a37c2,_0x4590f1,_0x37b397);}:function(_0x47d0ac,_0x58a18e,_0x2a912e,_0x307cef){if(_0x307cef===undefined)_0x307cef=_0x2a912e;_0x47d0ac[_0x307cef]=_0x58a18e[_0x2a912e];}),__setModuleDefault=this&&this[a0_0x24433a(0x12f)]||(Object[a0_0x24433a(0x14d)]?function(_0x114d13,_0x280515){const _0x16389e=a0_0x24433a;Object[_0x16389e(0x131)](_0x114d13,'default',{'enumerable':!![],'value':_0x280515});}:function(_0x276c9a,_0x39ed11){_0x276c9a['default']=_0x39ed11;}),__importStar=this&&this[a0_0x24433a(0x144)]||(function(){var _0x286ba8=function(_0x24db84){return _0x286ba8=Object['getOwnPropertyNames']||function(_0x63de29){const _0x4f00d9=a0_0x1d68;var _0x4dda9c=[];for(var _0x10138b in _0x63de29)if(Object[_0x4f00d9(0x13f)][_0x4f00d9(0x142)][_0x4f00d9(0x132)](_0x63de29,_0x10138b))_0x4dda9c[_0x4dda9c[_0x4f00d9(0x11c)]]=_0x10138b;return _0x4dda9c;},_0x286ba8(_0x24db84);};return function(_0x29a287){const _0x407582=a0_0x1d68;if(_0x29a287&&_0x29a287[_0x407582(0x139)])return _0x29a287;var _0x598097={};if(_0x29a287!=null){for(var _0x1ca2b6=_0x286ba8(_0x29a287),_0x873bc5=0x0;_0x873bc5<_0x1ca2b6['length'];_0x873bc5++)if(_0x1ca2b6[_0x873bc5]!==_0x407582(0x153))__createBinding(_0x598097,_0x29a287,_0x1ca2b6[_0x873bc5]);}return __setModuleDefault(_0x598097,_0x29a287),_0x598097;};}());Object[a0_0x24433a(0x131)](exports,a0_0x24433a(0x139),{'value':!![]}),exports['filterGitStatus']=filterGitStatus,exports[a0_0x24433a(0x130)]=filterGitLog,exports[a0_0x24433a(0x128)]=filterGitDiff;const path=__importStar(require('path'));function filterGitStatus(_0x5d598b){const _0x399a7c=a0_0x24433a,_0xe7fb0a=_0x5d598b[_0x399a7c(0x120)]('\x0a')[_0x399a7c(0x12d)](_0x4d4766=>_0x4d4766[_0x399a7c(0x127)]())['filter'](_0x473a11=>_0x473a11['length']>0x0);if(_0xe7fb0a['length']===0x0)return _0x399a7c(0x13a);const _0x49c043=[],_0x4aac05=[],_0x2882b9=[];for(const _0x40e98a of _0xe7fb0a){if(_0x40e98a[_0x399a7c(0x12a)]('##')){const _0x1768c8=_0x40e98a[_0x399a7c(0x14e)](/^##\s*/,'');_0x49c043[_0x399a7c(0x14f)](_0x399a7c(0x11d)+_0x1768c8);}else _0x40e98a[_0x399a7c(0x12a)]('??')?_0x4aac05['push'](_0x40e98a[_0x399a7c(0x146)](0x3)[_0x399a7c(0x127)]()):_0x2882b9[_0x399a7c(0x14f)](_0x40e98a);}_0x2882b9[_0x399a7c(0x11c)]>0x0&&(_0x49c043['push'](_0x399a7c(0x11b)),_0x49c043['push'](..._0x2882b9[_0x399a7c(0x12d)](_0x36ecd0=>'\x20\x20'+_0x36ecd0)));if(_0x4aac05[_0x399a7c(0x11c)]>0x0){_0x49c043[_0x399a7c(0x14f)](_0x399a7c(0x147));const _0x3164f7={},_0x4cf652=[];for(const _0x5b50d8 of _0x4aac05){const _0x38f4c3=path[_0x399a7c(0x14c)](_0x5b50d8);_0x38f4c3==='.'||_0x38f4c3===''?_0x4cf652[_0x399a7c(0x14f)](_0x5b50d8):(!_0x3164f7[_0x38f4c3]&&(_0x3164f7[_0x38f4c3]=[]),_0x3164f7[_0x38f4c3][_0x399a7c(0x14f)](path[_0x399a7c(0x13b)](_0x5b50d8)));}for(const [_0x430a10,_0x57fb12]of Object[_0x399a7c(0x149)](_0x3164f7)){if(_0x57fb12['length']>0x5)_0x49c043[_0x399a7c(0x14f)](_0x399a7c(0x14a)+_0x430a10+_0x399a7c(0x129)+_0x57fb12['length']+_0x399a7c(0x124));else for(const _0x17d985 of _0x57fb12){_0x49c043['push']('\x20\x20??\x20'+path[_0x399a7c(0x14b)](_0x430a10,_0x17d985));}}for(const _0x4e5a18 of _0x4cf652){_0x49c043[_0x399a7c(0x14f)]('\x20\x20??\x20'+_0x4e5a18);}}return _0x49c043[_0x399a7c(0x14b)]('\x0a');}function a0_0x1d68(_0x1cd893,_0x325b33){_0x1cd893=_0x1cd893-0x11b;const _0x127aa8=a0_0x127a();let _0x1d688d=_0x127aa8[_0x1cd893];return _0x1d688d;}function filterGitLog(_0x20bf1b){const _0x172e5a=a0_0x24433a,_0x48376a=_0x20bf1b[_0x172e5a(0x120)](_0x172e5a(0x122))['map'](_0x3a1817=>_0x3a1817[_0x172e5a(0x127)]())[_0x172e5a(0x141)](_0x439d0e=>_0x439d0e['length']>0x0);if(_0x48376a[_0x172e5a(0x11c)]===0x0)return _0x20bf1b;const _0x4692ef=[];for(const _0x1a016f of _0x48376a){const _0x57ccc4=_0x1a016f[_0x172e5a(0x120)]('\x0a'),_0x144e5c=_0x57ccc4[0x0]||'',_0x389062=_0x57ccc4['slice'](0x1)['map'](_0x419679=>_0x419679[_0x172e5a(0x127)]())[_0x172e5a(0x141)](_0x3ea273=>_0x3ea273[_0x172e5a(0x11c)]>0x0);_0x4692ef[_0x172e5a(0x14f)]('-\x20'+_0x144e5c),_0x389062[_0x172e5a(0x11c)]>0x0&&(_0x4692ef['push']('\x20\x20'+_0x389062[0x0]),_0x389062['length']>0x1&&_0x4692ef[_0x172e5a(0x14f)]('\x20\x20...\x20(+'+(_0x389062[_0x172e5a(0x11c)]-0x1)+'\x20lines\x20of\x20description)'));}return _0x4692ef['join']('\x0a');}function filterGitDiff(_0x35e03d){const _0xd7dd0f=a0_0x24433a,_0x55a511=_0x35e03d[_0xd7dd0f(0x120)]('\x0a'),_0x34d0cb=[];let _0x8a4014='',_0x46b350=0x0,_0xa404ac=0x0,_0x1f503f=[];const _0x313fe2=()=>{const _0x3c2f1c=_0xd7dd0f;if(_0x8a4014&&(_0x46b350>0x0||_0xa404ac>0x0)){_0x34d0cb[_0x3c2f1c(0x14f)](_0x3c2f1c(0x148)+_0x8a4014+_0x3c2f1c(0x133)+_0x46b350+'\x20-'+_0xa404ac+')');const _0x475fe9=0xa,_0x5c7dd8=_0x1f503f[_0x3c2f1c(0x138)](0x0,_0x475fe9);for(const _0x39848a of _0x5c7dd8){_0x34d0cb[_0x3c2f1c(0x14f)]('\x20\x20'+_0x39848a);}const _0x4dbe1d=_0x46b350+_0xa404ac-_0x475fe9;_0x4dbe1d>0x0&&_0x34d0cb['push'](_0x3c2f1c(0x125)+_0x4dbe1d+_0x3c2f1c(0x126));}_0x46b350=0x0,_0xa404ac=0x0,_0x1f503f=[];};for(const _0x26a78d of _0x55a511){if(_0x26a78d[_0xd7dd0f(0x12a)](_0xd7dd0f(0x13c))){_0x313fe2();const _0xbc5ae=_0x26a78d[_0xd7dd0f(0x121)](/\sb\/(.+)$/);_0x8a4014=_0xbc5ae?_0xbc5ae[0x1]:_0xd7dd0f(0x12c);}else{if(_0x26a78d[_0xd7dd0f(0x12a)]('+')&&!_0x26a78d[_0xd7dd0f(0x12a)](_0xd7dd0f(0x123)))_0x46b350++,_0x1f503f[_0xd7dd0f(0x14f)](_0x26a78d);else _0x26a78d[_0xd7dd0f(0x12a)]('-')&&!_0x26a78d[_0xd7dd0f(0x12a)](_0xd7dd0f(0x12b))&&(_0xa404ac++,_0x1f503f[_0xd7dd0f(0x14f)](_0x26a78d));}}_0x313fe2();const _0x513d89=_0x34d0cb['join']('\x0a');return _0x513d89['length']>0x0?_0x513d89:'No\x20modifications';}
|
package/filters/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x1a24f5=a0_0x352f;function a0_0x352f(_0x17d94a,_0x2026a5){_0x17d94a=_0x17d94a-0xba;const _0x4e1baf=a0_0x4e1b();let _0x352f7=_0x4e1baf[_0x17d94a];return _0x352f7;}(function(_0x37f9e8,_0x2ebc26){const _0x4e6157=a0_0x352f,_0x43a4f4=_0x37f9e8();while(!![]){try{const _0x2f72a5=-parseInt(_0x4e6157(0xdc))/0x1*(-parseInt(_0x4e6157(0xd7))/0x2)+-parseInt(_0x4e6157(0xd3))/0x3*(parseInt(_0x4e6157(0xce))/0x4)+parseInt(_0x4e6157(0xde))/0x5+parseInt(_0x4e6157(0xeb))/0x6*(-parseInt(_0x4e6157(0xcb))/0x7)+parseInt(_0x4e6157(0xca))/0x8*(-parseInt(_0x4e6157(0xbe))/0x9)+-parseInt(_0x4e6157(0xe5))/0xa*(parseInt(_0x4e6157(0xe4))/0xb)+-parseInt(_0x4e6157(0xe7))/0xc*(-parseInt(_0x4e6157(0xec))/0xd);if(_0x2f72a5===_0x2ebc26)break;else _0x43a4f4['push'](_0x43a4f4['shift']());}catch(_0x32ab55){_0x43a4f4['push'](_0x43a4f4['shift']());}}}(a0_0x4e1b,0x1e7d5));function a0_0x4e1b(){const _0x1abcb1=['trim\x20grep','1355148JLtZFg','vitest','npm\x20i','trim\x20pytest','filterPytest','git\x20status','pip3\x20install','softTruncate','length','trim\x20glab','redactor','trim\x20kubectl','8LDNIeX','7JOgKmE','filterGitLog','redact','4268hawmOx','trim','yadm\x20diff','pattern','rewriteCommand','234ekFLYp','git\x20show','trim\x20go','startsWith','42022xhmLTT','pytest','yarn\x20install','trim\x20docker','__esModule','10BkwWQB','jest','1079720SsaiiE','trim\x20pip','pnpm\x20install','collapseDuplicates','yadm\x20log','trim\x20','88Xxqgvt','254550hkBEbn','./generic','15828BQxJaD','trim\x20npm','stripAnsi','trim\x20ls','765186gFTmVr','2600gGnHAS','pip\x20install','filterNpmInstall','git\x20diff','trim\x20gh','filterGitDiff','compressOutput','trim\x20cargo','toLowerCase','includes','trim\x20git'];a0_0x4e1b=function(){return _0x1abcb1;};return a0_0x4e1b();}Object['defineProperty'](exports,a0_0x1a24f5(0xdb),{'value':!![]}),exports[a0_0x1a24f5(0xf2)]=compressOutput,exports[a0_0x1a24f5(0xd2)]=rewriteCommand;const generic_1=require(a0_0x1a24f5(0xe6)),git_1=require('./git'),python_1=require('./python'),js_1=require('./js'),redactor_1=require('../redactor');function compressOutput(_0x4a3fe6,_0x76fe8b,_0x452d4b,_0xc8bd5c=!![]){const _0x45b0fb=a0_0x1a24f5,_0x416d11=_0x4a3fe6[_0x45b0fb(0xcf)]();let _0x571125=_0x76fe8b;_0x452d4b[_0x45b0fb(0xcf)]()[_0x45b0fb(0xc6)]>0x0&&(_0x571125=_0x76fe8b+'\x0a'+_0x452d4b);let _0x245d8a=(0x0,generic_1[_0x45b0fb(0xe9)])(_0x571125);_0xc8bd5c&&(_0x245d8a=redactor_1[_0x45b0fb(0xc8)][_0x45b0fb(0xcd)](_0x245d8a));const _0x2ffeeb=_0x416d11[_0x45b0fb(0xba)]();try{if(_0x2ffeeb[_0x45b0fb(0xbb)](_0x45b0fb(0xc3))||_0x2ffeeb['includes']('yadm\x20status'))return(0x0,git_1['filterGitStatus'])(_0x245d8a);if(_0x2ffeeb[_0x45b0fb(0xbb)]('git\x20log')||_0x2ffeeb[_0x45b0fb(0xbb)](_0x45b0fb(0xe2)))return(0x0,git_1[_0x45b0fb(0xcc)])(_0x245d8a);if(_0x2ffeeb[_0x45b0fb(0xbb)](_0x45b0fb(0xef))||_0x2ffeeb[_0x45b0fb(0xbb)](_0x45b0fb(0xd4))||_0x2ffeeb[_0x45b0fb(0xbb)](_0x45b0fb(0xd0)))return(0x0,git_1[_0x45b0fb(0xf1)])(_0x245d8a);if(_0x2ffeeb[_0x45b0fb(0xbb)](_0x45b0fb(0xd8)))return(0x0,python_1[_0x45b0fb(0xc2)])(_0x245d8a);if(_0x2ffeeb['includes']('npm\x20install')||_0x2ffeeb[_0x45b0fb(0xbb)]('npm\x20i\x20')||_0x2ffeeb['endsWith'](_0x45b0fb(0xc0))||_0x2ffeeb['includes'](_0x45b0fb(0xe0))||_0x2ffeeb[_0x45b0fb(0xbb)](_0x45b0fb(0xd9)))return(0x0,js_1[_0x45b0fb(0xee)])(_0x245d8a);if(_0x2ffeeb['includes'](_0x45b0fb(0xed))||_0x2ffeeb[_0x45b0fb(0xbb)](_0x45b0fb(0xc4)))return(0x0,python_1['filterPipInstall'])(_0x245d8a);if(_0x2ffeeb[_0x45b0fb(0xbb)](_0x45b0fb(0xdd))||_0x2ffeeb[_0x45b0fb(0xbb)](_0x45b0fb(0xbf)))return(0x0,js_1['filterJestVitest'])(_0x245d8a);}catch(_0x4cb703){}return _0x245d8a=(0x0,generic_1[_0x45b0fb(0xe1)])(_0x245d8a),_0x245d8a=(0x0,generic_1[_0x45b0fb(0xc5)])(_0x245d8a,0x4e20),_0x245d8a;}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_0x1a24f5(0xbc)},{'pattern':/^gh\s+(pr|issue|run|repo|api|release)/,'prefix':a0_0x1a24f5(0xf0)},{'pattern':/^glab\s+(mr|issue|ci|pipeline|api|release)/,'prefix':a0_0x1a24f5(0xc7)},{'pattern':/^cargo\s+(build|test|clippy|check|fmt|install)/,'prefix':a0_0x1a24f5(0xf3)},{'pattern':/^pnpm\s+(exec|i|install|list|ls|outdated|run|run-script)/,'prefix':'trim\x20pnpm'},{'pattern':/^npm\s+(exec|run|run-script|rum|urn|x)(\s|$)/,'prefix':a0_0x1a24f5(0xe8)},{'pattern':/^npx\s+/,'prefix':'trim\x20npx'},{'pattern':/^(cat|head|tail)\s+/,'prefix':'trim\x20read'},{'pattern':/^(rg|grep)\s+/,'prefix':a0_0x1a24f5(0xbd)},{'pattern':/^ls(\s|$)/,'prefix':a0_0x1a24f5(0xea)},{'pattern':/^find\s+/,'prefix':'trim\x20find'},{'pattern':/^docker\s+(ps|images|logs|run|exec|build|compose)/,'prefix':a0_0x1a24f5(0xda)},{'pattern':/^kubectl\s+(get|logs|describe|apply)/,'prefix':a0_0x1a24f5(0xc9)},{'pattern':/^(python3?\s+-m\s+)?pytest(\s|$)/,'prefix':a0_0x1a24f5(0xc1)},{'pattern':/^(pip3?|uv\s+pip)\s+(list|outdated|install|show)/,'prefix':a0_0x1a24f5(0xdf)},{'pattern':/^go\s+(test|build|vet)/,'prefix':a0_0x1a24f5(0xd5)}];function rewriteCommand(_0x428d15){const _0x3182d5=a0_0x1a24f5,_0x2f231b=_0x428d15[_0x3182d5(0xcf)]();if(_0x2f231b[_0x3182d5(0xd6)](_0x3182d5(0xe3)))return _0x2f231b;for(const _0x17693d of REWRITE_RULES){if(_0x17693d[_0x3182d5(0xd1)]['test'](_0x2f231b))return _0x3182d5(0xe3)+_0x2f231b;}return _0x2f231b;}
|
package/filters/js.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';function a0_0x4701(){const _0x45b59b=['includes','168xYVHWl','slice','NPM:\x20Packages\x20verified/installed\x20successfully','1207604nnIAce','Tests:','added\x20','\x20\x20...\x20(','144GlmMbl','split','1131217sqOBHE','2099215lqJtaZ','FAIL\x20\x20','11XMmbyD','push','8doFKSu','Test\x20Runner:\x20','9972084Qfljlo','removed\x20','startsWith','found\x20','\x20passed,\x20','2008137MRaACL','12EdIoKL','up\x20to\x20date','\x20failed\x20(','filterNpmInstall','filterJestVitest','Test\x20Files:','length','all','trim','Test\x20Suites:','__esModule','\x20passed','PASS','92722cwFSOK','765620TmvLxW','match','FAIL'];a0_0x4701=function(){return _0x45b59b;};return a0_0x4701();}function a0_0x49ef(_0x4f5d14,_0x2af55e){_0x4f5d14=_0x4f5d14-0xe6;const _0x470171=a0_0x4701();let _0x49ef8b=_0x470171[_0x4f5d14];return _0x49ef8b;}const a0_0x1abf68=a0_0x49ef;(function(_0x4e4fd3,_0xcc8be){const _0x3c9b51=a0_0x49ef,_0x50bc7c=_0x4e4fd3();while(!![]){try{const _0xb5b816=-parseInt(_0x3c9b51(0x104))/0x1+parseInt(_0x3c9b51(0xfe))/0x2+parseInt(_0x3c9b51(0xe8))/0x3*(-parseInt(_0x3c9b51(0x109))/0x4)+parseInt(_0x3c9b51(0x105))/0x5*(parseInt(_0x3c9b51(0xe9))/0x6)+parseInt(_0x3c9b51(0xf6))/0x7*(-parseInt(_0x3c9b51(0xfb))/0x8)+-parseInt(_0x3c9b51(0x102))/0x9*(-parseInt(_0x3c9b51(0xf7))/0xa)+-parseInt(_0x3c9b51(0x107))/0xb*(-parseInt(_0x3c9b51(0x10b))/0xc);if(_0xb5b816===_0xcc8be)break;else _0x50bc7c['push'](_0x50bc7c['shift']());}catch(_0x1a8e46){_0x50bc7c['push'](_0x50bc7c['shift']());}}}(a0_0x4701,0xb76f2));Object['defineProperty'](exports,a0_0x1abf68(0xf3),{'value':!![]}),exports[a0_0x1abf68(0xec)]=filterNpmInstall,exports[a0_0x1abf68(0xed)]=filterJestVitest;function filterNpmInstall(_0x299eac){const _0x188d31=a0_0x1abf68,_0x486c91=_0x299eac['replace'](/\r/g,'\x0a'),_0x3c20a1=_0x486c91['split']('\x0a'),_0x14017f=[];for(const _0x4dc244 of _0x3c20a1){const _0x297958=_0x4dc244['trim']();(_0x297958[_0x188d31(0xfa)](_0x188d31(0x100))||_0x297958[_0x188d31(0xfa)](_0x188d31(0x10c))||_0x297958[_0x188d31(0xfa)]('audited\x20')||_0x297958[_0x188d31(0xfa)](_0x188d31(0xea))||_0x297958[_0x188d31(0xfa)](_0x188d31(0xe6)))&&(!_0x297958[_0x188d31(0xfa)]('%')&&!_0x297958[_0x188d31(0x10d)]('⠋')&&!_0x297958['startsWith']('⠙')&&_0x14017f[_0x188d31(0x108)](_0x297958));}const _0x5b79ea=_0x14017f['join']('\x0a')[_0x188d31(0xf1)]();return _0x5b79ea[_0x188d31(0xef)]>0x0?_0x5b79ea:_0x188d31(0xfd);}function filterJestVitest(_0x37f847){const _0x20596c=a0_0x1abf68,_0x3af3e1=_0x37f847[_0x20596c(0x103)]('\x0a');let _0x5c951e=0x0,_0x1aa3ab=0x0,_0x1c1f9b=0x0;const _0x3821e8=[];let _0xb7fa7a=![];for(const _0x396c6a of _0x3af3e1){const _0x17796c=_0x396c6a[_0x20596c(0xf1)]();if(_0x17796c[_0x20596c(0x10d)](_0x20596c(0xff))||_0x17796c[_0x20596c(0xfa)](_0x20596c(0xee))){const _0x1f6ee1=_0x17796c[_0x20596c(0xf8)](/(\d+)\s+passed/),_0x5980ed=_0x17796c[_0x20596c(0xf8)](/(\d+)\s+failed/),_0x294c48=_0x17796c[_0x20596c(0xf8)](/(\d+)\s+total/);if(_0x1f6ee1)_0x5c951e=parseInt(_0x1f6ee1[0x1]);if(_0x5980ed)_0x1aa3ab=parseInt(_0x5980ed[0x1]);if(_0x294c48)_0x1c1f9b=parseInt(_0x294c48[0x1]);continue;}(_0x17796c['startsWith']('❯')||_0x17796c[_0x20596c(0x10d)]('●')||_0x17796c[_0x20596c(0x10d)](_0x20596c(0x106)))&&(_0xb7fa7a=!![]),_0xb7fa7a&&(_0x17796c['length']>0x0&&!_0x17796c[_0x20596c(0x10d)](_0x20596c(0xf2))&&!_0x17796c[_0x20596c(0x10d)](_0x20596c(0xff))&&_0x3821e8[_0x20596c(0x108)](_0x396c6a));}if(_0x1c1f9b===0x0&&_0x5c951e===0x0&&_0x1aa3ab===0x0){if(_0x37f847[_0x20596c(0xfa)](_0x20596c(0xf5))&&!_0x37f847[_0x20596c(0xfa)](_0x20596c(0xf9))){const _0x2df726=_0x37f847[_0x20596c(0xf8)](/(\d+)\s+passed/),_0x40c5c0=_0x2df726?_0x2df726[0x1]:_0x20596c(0xf0);return _0x20596c(0x10a)+_0x40c5c0+_0x20596c(0xf4);}return _0x37f847;}if(_0x1aa3ab===0x0&&_0x5c951e>0x0)return _0x20596c(0x10a)+_0x5c951e+_0x20596c(0xf4);const _0x4cbba3=[_0x20596c(0x10a)+_0x5c951e+_0x20596c(0xe7)+_0x1aa3ab+_0x20596c(0xeb)+_0x1c1f9b+'\x20total)'];if(_0x3821e8[_0x20596c(0xef)]>0x0){_0x4cbba3[_0x20596c(0x108)]('\x0aFailures:');const _0x135b95=0x19,_0x34ab27=_0x3821e8[_0x20596c(0xfc)](0x0,_0x135b95);for(const _0x499aa1 of _0x34ab27){_0x4cbba3[_0x20596c(0x108)]('\x20\x20'+_0x499aa1);}_0x3821e8[_0x20596c(0xef)]>_0x135b95&&_0x4cbba3[_0x20596c(0x108)](_0x20596c(0x101)+(_0x3821e8[_0x20596c(0xef)]-_0x135b95)+'\x20lines\x20of\x20trace\x20details\x20truncated)');}return _0x4cbba3['join']('\x0a');}
|
package/filters/python.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';const a0_0x154a57=a0_0x181b;(function(_0x160bcc,_0x83f282){const _0x53d181=a0_0x181b,_0x4b7810=_0x160bcc();while(!![]){try{const _0x1a7549=-parseInt(_0x53d181(0x97))/0x1*(parseInt(_0x53d181(0x80))/0x2)+-parseInt(_0x53d181(0x79))/0x3*(-parseInt(_0x53d181(0x6e))/0x4)+parseInt(_0x53d181(0x8a))/0x5*(parseInt(_0x53d181(0x83))/0x6)+parseInt(_0x53d181(0x94))/0x7*(parseInt(_0x53d181(0x8c))/0x8)+-parseInt(_0x53d181(0x78))/0x9*(parseInt(_0x53d181(0x95))/0xa)+parseInt(_0x53d181(0x84))/0xb*(parseInt(_0x53d181(0x75))/0xc)+-parseInt(_0x53d181(0x89))/0xd;if(_0x1a7549===_0x83f282)break;else _0x4b7810['push'](_0x4b7810['shift']());}catch(_0xb57352){_0x4b7810['push'](_0x4b7810['shift']());}}}(a0_0x453e,0xec414));function a0_0x181b(_0x5a00a3,_0x411296){_0x5a00a3=_0x5a00a3-0x6e;const _0x453e5c=a0_0x453e();let _0x181bd2=_0x453e5c[_0x5a00a3];return _0x181bd2;}function a0_0x453e(){const _0x2e8578=['failed','___','4jHdLlG','slice','includes','\x20\x20...\x20+','Successfully\x20installed','match','\x20\x20\x20\x20...\x20(','532332dDGsRi','startsWith','E\x20\x20\x20','9TTqZJV','350976jrohiw','replace','Requirement\x20already\x20satisfied','length','===\x20short\x20test\x20summary\x20info\x20===','===\x20ERRORS\x20===','\x20xfailed','386ZBFrCd','split','.py:','12mTvNSb','132IkcFZP','\x20more\x20failures\x20truncated','\x20passed','Collecting','Downloading','24215074ZSBKzY','3810565dauLWf','\x20failed','6595576VFTKkZ','push','AssertionError:','Using\x20cached','\x20xpassed\x20(warning!)','.\x20[FAIL]\x20','Pytest:\x20','trim','7ClWAdp','1172260PrCISL','filterPytest','261rHtXAq','\x20in\x20','===','join','passed','filter','\x20\x20\x20\x20'];a0_0x453e=function(){return _0x2e8578;};return a0_0x453e();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a0_0x154a57(0x96)]=filterPytest,exports['filterPipInstall']=filterPipInstall;function filterPytest(_0x2ea612){const _0x655ca4=a0_0x154a57,_0x1fd485=_0x2ea612['split']('\x0a');let _0x3603b0=0x0,_0x59059e=0x0,_0x342876=0x0,_0x56380c=0x0,_0xab70de=0x0;const _0x298911=[];let _0x2d1985=[],_0x5de16a=![];for(const _0x4ab5ef of _0x1fd485){const _0x24fb27=_0x4ab5ef[_0x655ca4(0x93)]();if(_0x24fb27['startsWith']('===\x20FAILURES\x20===')||_0x24fb27[_0x655ca4(0x76)](_0x655ca4(0x7e))){_0x5de16a=!![];continue;}else(_0x24fb27[_0x655ca4(0x76)](_0x655ca4(0x7d))||_0x24fb27['startsWith'](_0x655ca4(0x99))&&_0x24fb27[_0x655ca4(0x70)](_0x655ca4(0x9b)))&&(_0x5de16a=![],_0x2d1985[_0x655ca4(0x7c)]>0x0&&(_0x298911[_0x655ca4(0x8d)](_0x2d1985),_0x2d1985=[]));if(_0x5de16a){if(_0x24fb27[_0x655ca4(0x76)](_0x655ca4(0x9f)))_0x2d1985[_0x655ca4(0x7c)]>0x0&&(_0x298911['push'](_0x2d1985),_0x2d1985=[]),_0x2d1985['push'](_0x24fb27);else _0x24fb27['length']>0x0&&_0x2d1985[_0x655ca4(0x8d)](_0x4ab5ef);continue;}if(_0x24fb27[_0x655ca4(0x76)](_0x655ca4(0x99))&&_0x24fb27[_0x655ca4(0x70)](_0x655ca4(0x98))){const _0x337707=_0x24fb27['match'](/(\d+)\s+passed/),_0x5749a5=_0x24fb27[_0x655ca4(0x73)](/(\d+)\s+failed/),_0x2ba780=_0x24fb27[_0x655ca4(0x73)](/(\d+)\s+skipped/),_0x149b3c=_0x24fb27[_0x655ca4(0x73)](/(\d+)\s+xfailed/),_0x29b839=_0x24fb27[_0x655ca4(0x73)](/(\d+)\s+xpassed/);if(_0x337707)_0x3603b0=parseInt(_0x337707[0x1]);if(_0x5749a5)_0x59059e=parseInt(_0x5749a5[0x1]);if(_0x2ba780)_0x342876=parseInt(_0x2ba780[0x1]);if(_0x149b3c)_0x56380c=parseInt(_0x149b3c[0x1]);if(_0x29b839)_0xab70de=parseInt(_0x29b839[0x1]);}}_0x2d1985[_0x655ca4(0x7c)]>0x0&&_0x298911[_0x655ca4(0x8d)](_0x2d1985);if(_0x3603b0===0x0&&_0x59059e===0x0&&_0x342876===0x0&&_0x56380c===0x0&&_0xab70de===0x0){if(_0x2ea612[_0x655ca4(0x70)](_0x655ca4(0x9b))&&!_0x2ea612[_0x655ca4(0x70)](_0x655ca4(0x9e)))return'Pytest:\x20All\x20tests\x20passed';return _0x2ea612;}if(_0x59059e===0x0&&_0x3603b0>0x0&&_0x342876===0x0&&_0x56380c===0x0&&_0xab70de===0x0)return _0x655ca4(0x92)+_0x3603b0+_0x655ca4(0x86);const _0x36b20d=[];_0x36b20d[_0x655ca4(0x8d)](_0x655ca4(0x92)+_0x3603b0+_0x655ca4(0x86));if(_0x59059e>0x0)_0x36b20d[_0x655ca4(0x8d)](_0x59059e+_0x655ca4(0x8b));if(_0x342876>0x0)_0x36b20d[_0x655ca4(0x8d)](_0x342876+'\x20skipped');if(_0x56380c>0x0)_0x36b20d[_0x655ca4(0x8d)](_0x56380c+_0x655ca4(0x7f));if(_0xab70de>0x0)_0x36b20d[_0x655ca4(0x8d)](_0xab70de+_0x655ca4(0x90));const _0x461c60=[_0x36b20d[_0x655ca4(0x9a)](',\x20')];if(_0x298911['length']>0x0){_0x461c60[_0x655ca4(0x8d)]('\x0aFailures:');const _0x2afa73=0x3,_0x48a9db=_0x298911['slice'](0x0,_0x2afa73);for(let _0x4cd06d=0x0;_0x4cd06d<_0x48a9db['length'];_0x4cd06d++){const _0xceb07=_0x48a9db[_0x4cd06d],_0x590708=_0xceb07[0x0][_0x655ca4(0x7a)](/_/g,'')['trim']();_0x461c60['push']('\x20\x20'+(_0x4cd06d+0x1)+_0x655ca4(0x91)+_0x590708);const _0x449189=_0xceb07['slice'](0x1),_0x5d5477=_0x449189[_0x655ca4(0x9c)](_0x47ca41=>{const _0x313e4a=_0x655ca4,_0x135216=_0x47ca41[_0x313e4a(0x93)]();return _0x135216[_0x313e4a(0x76)]('>')||_0x135216['startsWith'](_0x313e4a(0x77))||_0x135216[_0x313e4a(0x70)](_0x313e4a(0x82))||_0x135216[_0x313e4a(0x70)](_0x313e4a(0x8e));});for(const _0xb30f13 of _0x5d5477[_0x655ca4(0x6f)](0x0,0x8)){_0x461c60[_0x655ca4(0x8d)](_0x655ca4(0x9d)+_0xb30f13);}_0x5d5477['length']>0x8&&_0x461c60[_0x655ca4(0x8d)](_0x655ca4(0x74)+(_0x5d5477['length']-0x8)+'\x20lines\x20of\x20stacktrace\x20truncated)');}_0x298911['length']>_0x2afa73&&_0x461c60['push'](_0x655ca4(0x71)+(_0x298911[_0x655ca4(0x7c)]-_0x2afa73)+_0x655ca4(0x85));}return _0x461c60['join']('\x0a');}function filterPipInstall(_0x5d6cdd){const _0x3bb8f5=a0_0x154a57,_0x251e29=_0x5d6cdd[_0x3bb8f5(0x81)]('\x0a'),_0x218eb9=[];for(const _0x15ab09 of _0x251e29){const _0x2a6566=_0x15ab09[_0x3bb8f5(0x93)]();_0x2a6566[_0x3bb8f5(0x76)](_0x3bb8f5(0x72))&&_0x218eb9[_0x3bb8f5(0x8d)](_0x2a6566);}if(_0x218eb9[_0x3bb8f5(0x7c)]>0x0)return _0x218eb9['join']('\x0a');return _0x251e29['filter'](_0x3635a0=>{const _0x4744a3=_0x3bb8f5,_0x2b5b3b=_0x3635a0[_0x4744a3(0x93)]();return!_0x2b5b3b[_0x4744a3(0x76)](_0x4744a3(0x87))&&!_0x2b5b3b['startsWith'](_0x4744a3(0x88))&&!_0x2b5b3b[_0x4744a3(0x70)](_0x4744a3(0x8f))&&!_0x2b5b3b[_0x4744a3(0x76)](_0x4744a3(0x7b));})[_0x3bb8f5(0x9a)]('\x0a')[_0x3bb8f5(0x93)]();}
|
package/mcp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x36e3c8=a0_0x5ae4;function a0_0x5ae4(_0x58656c,_0x199860){_0x58656c=_0x58656c-0x1b2;const _0x314fc6=a0_0x314f();let _0x5ae4eb=_0x314fc6[_0x58656c];return _0x5ae4eb;}(function(_0x436220,_0xacc0fb){const _0x19398c=a0_0x5ae4,_0x42bb6e=_0x436220();while(!![]){try{const _0x35677f=parseInt(_0x19398c(0x1b7))/0x1*(-parseInt(_0x19398c(0x1c1))/0x2)+parseInt(_0x19398c(0x1dc))/0x3*(parseInt(_0x19398c(0x1b4))/0x4)+parseInt(_0x19398c(0x1c3))/0x5*(parseInt(_0x19398c(0x1b2))/0x6)+parseInt(_0x19398c(0x1b5))/0x7+parseInt(_0x19398c(0x1cb))/0x8+-parseInt(_0x19398c(0x1d2))/0x9+-parseInt(_0x19398c(0x1b6))/0xa;if(_0x35677f===_0xacc0fb)break;else _0x42bb6e['push'](_0x42bb6e['shift']());}catch(_0x2c74d1){_0x42bb6e['push'](_0x42bb6e['shift']());}}}(a0_0x314f,0xaf46f));var __createBinding=this&&this['__createBinding']||(Object[a0_0x36e3c8(0x1de)]?function(_0x196236,_0x42cf0f,_0x5491d8,_0x502089){const _0x4a16b1=a0_0x36e3c8;if(_0x502089===undefined)_0x502089=_0x5491d8;var _0x147a5d=Object['getOwnPropertyDescriptor'](_0x42cf0f,_0x5491d8);(!_0x147a5d||(_0x4a16b1(0x1c5)in _0x147a5d?!_0x42cf0f[_0x4a16b1(0x1b9)]:_0x147a5d[_0x4a16b1(0x1d6)]||_0x147a5d['configurable']))&&(_0x147a5d={'enumerable':!![],'get':function(){return _0x42cf0f[_0x5491d8];}}),Object[_0x4a16b1(0x1c2)](_0x196236,_0x502089,_0x147a5d);}:function(_0x28a6cd,_0x58f50f,_0x5d9b3b,_0x740fbb){if(_0x740fbb===undefined)_0x740fbb=_0x5d9b3b;_0x28a6cd[_0x740fbb]=_0x58f50f[_0x5d9b3b];}),__setModuleDefault=this&&this[a0_0x36e3c8(0x1c6)]||(Object[a0_0x36e3c8(0x1de)]?function(_0x3385fc,_0x126d3c){const _0x5a7cb6=a0_0x36e3c8;Object[_0x5a7cb6(0x1c2)](_0x3385fc,'default',{'enumerable':!![],'value':_0x126d3c});}:function(_0x1ff4b8,_0x168921){const _0x1c3757=a0_0x36e3c8;_0x1ff4b8[_0x1c3757(0x1d4)]=_0x168921;}),__importStar=this&&this[a0_0x36e3c8(0x1d0)]||(function(){var _0x44e817=function(_0x256285){const _0x5b65cf=a0_0x5ae4;return _0x44e817=Object[_0x5b65cf(0x1e0)]||function(_0x179e25){const _0x387e42=_0x5b65cf;var _0x2fea9a=[];for(var _0x288c01 in _0x179e25)if(Object[_0x387e42(0x1bd)]['hasOwnProperty'][_0x387e42(0x1ca)](_0x179e25,_0x288c01))_0x2fea9a[_0x2fea9a[_0x387e42(0x1df)]]=_0x288c01;return _0x2fea9a;},_0x44e817(_0x256285);};return function(_0x816d89){const _0x242eaa=a0_0x5ae4;if(_0x816d89&&_0x816d89[_0x242eaa(0x1b9)])return _0x816d89;var _0x2d51d4={};if(_0x816d89!=null){for(var _0x5d17d6=_0x44e817(_0x816d89),_0x58a16c=0x0;_0x58a16c<_0x5d17d6['length'];_0x58a16c++)if(_0x5d17d6[_0x58a16c]!==_0x242eaa(0x1d4))__createBinding(_0x2d51d4,_0x816d89,_0x5d17d6[_0x58a16c]);}return __setModuleDefault(_0x2d51d4,_0x816d89),_0x2d51d4;};}());Object[a0_0x36e3c8(0x1c2)](exports,a0_0x36e3c8(0x1b9),{'value':!![]}),exports[a0_0x36e3c8(0x1dd)]=runMcpProxy;const child_process_1=require(a0_0x36e3c8(0x1b8)),readline=__importStar(require(a0_0x36e3c8(0x1d8))),filters_1=require(a0_0x36e3c8(0x1c8)),tracker_1=require(a0_0x36e3c8(0x1e1));function runMcpProxy(_0x4ee5c4,_0x8df5f){const _0x10e2c6=a0_0x36e3c8,_0x272938=(0x0,child_process_1[_0x10e2c6(0x1c9)])(_0x4ee5c4,_0x8df5f,{'stdio':[_0x10e2c6(0x1d7),_0x10e2c6(0x1d7),_0x10e2c6(0x1ba)]});process['stdin']['pipe'](_0x272938['stdin']);const _0x1e1118=readline[_0x10e2c6(0x1e4)]({'input':_0x272938[_0x10e2c6(0x1d5)],'terminal':![]});_0x1e1118['on'](_0x10e2c6(0x1ce),_0x445b76=>{const _0x400604=_0x10e2c6;try{const _0x4f08a1=JSON[_0x400604(0x1b3)](_0x445b76);if(_0x4f08a1&&_0x4f08a1[_0x400604(0x1cc)]==='2.0'&&_0x4f08a1['id']!==undefined&&_0x4f08a1['result']&&Array['isArray'](_0x4f08a1['result'][_0x400604(0x1bf)])){let _0x10b414=![];for(const _0x3c2b29 of _0x4f08a1[_0x400604(0x1db)][_0x400604(0x1bf)]){if(_0x3c2b29['type']===_0x400604(0x1be)&&typeof _0x3c2b29['text']==='string'&&_0x3c2b29[_0x400604(0x1be)][_0x400604(0x1e3)]()['length']>0x0){const _0x14a99c=_0x3c2b29[_0x400604(0x1be)],_0x21a56e=(0x0,filters_1[_0x400604(0x1c0)])(_0x400604(0x1e2),_0x14a99c,'',tracker_1[_0x400604(0x1d1)]['getConfig']()[_0x400604(0x1c7)]);tracker_1[_0x400604(0x1d1)][_0x400604(0x1bc)]('mcp\x20tool\x20(id:\x20'+_0x4f08a1['id']+')',_0x14a99c,_0x21a56e,0x0),_0x3c2b29[_0x400604(0x1be)]=_0x21a56e,_0x10b414=!![];}}_0x10b414?process[_0x400604(0x1d5)][_0x400604(0x1c4)](JSON[_0x400604(0x1cf)](_0x4f08a1)+'\x0a'):process[_0x400604(0x1d5)]['write'](_0x445b76+'\x0a');}else process[_0x400604(0x1d5)]['write'](_0x445b76+'\x0a');}catch{process['stdout']['write'](_0x445b76+'\x0a');}}),_0x272938['on'](_0x10e2c6(0x1cd),_0x44e71b=>{const _0x1d7ea5=_0x10e2c6;process[_0x1d7ea5(0x1da)](_0x44e71b||0x0);}),_0x272938['on'](_0x10e2c6(0x1d3),_0x351a33=>{const _0x10cade=_0x10e2c6;console['error'](_0x10cade(0x1bb)+_0x351a33[_0x10cade(0x1d9)]),process['exit'](0x1);});}function a0_0x314f(){const _0x33838d=['12IsQkPZ','defineProperty','160895sCwXgh','write','get','__setModuleDefault','redaction_enabled','./filters','spawn','call','9449576atJOmW','jsonrpc','close','line','stringify','__importStar','tracker','3401991Djhbeg','error','default','stdout','writable','pipe','readline','message','exit','result','7806xNRZBD','runMcpProxy','create','length','getOwnPropertyNames','./tracker','mcp-tool-call','trim','createInterface','84COOFoy','parse','1572CwPIqZ','7059031XCPveR','22081920wCaSxL','59766wTZFPi','child_process','__esModule','inherit','[TrimPrompt]\x20MCP\x20Server\x20Spawn\x20Error:\x20','logExecution','prototype','text','content','compressOutput'];a0_0x314f=function(){return _0x33838d;};return a0_0x314f();}
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trimprompt",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "TrimPrompt.ai Client CLI & Local Developer Dashboard",
|
|
5
5
|
"main": "cli.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"trim": "cli.js"
|
|
8
8
|
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"postinstall": "node cli.js shims install || true"
|
|
11
|
+
},
|
|
9
12
|
"dependencies": {
|
|
10
13
|
"commander": "^11.1.0",
|
|
11
14
|
"express": "^4.18.2",
|
package/redactor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';function a0_0x2cd0(){const _0x34737b=['rules','16370622IsgwPA','API\x20Key\x20or\x20Password','14096864xNlJWt','IPv4\x20Address','51755XKgbTG','replacement','[REDACTED_EMAIL]','defineProperty','redactor','77202gVGyTv','Email\x20Address','Database\x20Connection\x20String','9006606FTfsFK','10490980PumMpV','$1:\x20[REDACTED_CREDENTIAL]','__esModule','[REDACTED_IP]','Redactor','32AhYISi','52DMWlKv','7qRfVzp','loadDefaultRules','834291iuvZFC','replace'];a0_0x2cd0=function(){return _0x34737b;};return a0_0x2cd0();}const a0_0x1cb4df=a0_0x1e2b;(function(_0x20dab0,_0x1d2d49){const _0x38187c=a0_0x1e2b,_0x107ae5=_0x20dab0();while(!![]){try{const _0x59206f=-parseInt(_0x38187c(0x195))/0x1*(parseInt(_0x38187c(0x18c))/0x2)+-parseInt(_0x38187c(0x199))/0x3+parseInt(_0x38187c(0x196))/0x4*(-parseInt(_0x38187c(0x187))/0x5)+parseInt(_0x38187c(0x18f))/0x6+-parseInt(_0x38187c(0x197))/0x7*(parseInt(_0x38187c(0x185))/0x8)+parseInt(_0x38187c(0x19c))/0x9+parseInt(_0x38187c(0x190))/0xa;if(_0x59206f===_0x1d2d49)break;else _0x107ae5['push'](_0x107ae5['shift']());}catch(_0x2fc1c7){_0x107ae5['push'](_0x107ae5['shift']());}}}(a0_0x2cd0,0xea2b5));Object[a0_0x1cb4df(0x18a)](exports,a0_0x1cb4df(0x192),{'value':!![]}),exports['redactor']=exports[a0_0x1cb4df(0x194)]=void 0x0;class Redactor{['rules']=[];constructor(){const _0x3e7630=a0_0x1cb4df;this[_0x3e7630(0x198)]();}[a0_0x1cb4df(0x198)](){const _0x475157=a0_0x1cb4df;this[_0x475157(0x19b)]=[{'name':_0x475157(0x18e),'regex':/(mongodb|postgres|postgresql|mysql|redis|sqlite):\/\/[a-zA-Z0-9_]+:[^@\s\n]+@[^\s\n]+/gi,'replacement':'[REDACTED_DB_CONNECTION_STRING]'},{'name':_0x475157(0x184),'regex':/(api[_-]?key|secret|password|passwd|auth|token|private[_-]?key)[\s:=]+[a-zA-Z0-9_-]{16,}/gi,'replacement':_0x475157(0x191)},{'name':_0x475157(0x186),'regex':/\b(?!127\.0\.0\.1|255\.255\.255\.0)(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b/g,'replacement':_0x475157(0x193)},{'name':_0x475157(0x18d),'regex':/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,'replacement':_0x475157(0x189)}];}['redact'](_0x5da526){const _0x5f9dd7=a0_0x1cb4df;let _0x1e06bb=_0x5da526;for(const _0x238bd9 of this['rules']){_0x1e06bb=_0x1e06bb[_0x5f9dd7(0x19a)](_0x238bd9['regex'],_0x238bd9[_0x5f9dd7(0x188)]);}return _0x1e06bb;}}function a0_0x1e2b(_0x4ad3da,_0x1d6bde){_0x4ad3da=_0x4ad3da-0x184;const _0x2cd088=a0_0x2cd0();let _0x1e2be3=_0x2cd088[_0x4ad3da];return _0x1e2be3;}exports[a0_0x1cb4df(0x194)]=Redactor,exports[a0_0x1cb4df(0x18b)]=new Redactor();
|
package/seed.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x159136=a0_0x3905;function a0_0x3905(_0x543d4c,_0x316964){_0x543d4c=_0x543d4c-0x7e;const _0x79a90e=a0_0x79a9();let _0x3905f4=_0x79a90e[_0x543d4c];return _0x3905f4;}(function(_0x55d7b7,_0x4cf148){const _0x2b1fa1=a0_0x3905,_0x2e61f3=_0x55d7b7();while(!![]){try{const _0xa9d319=parseInt(_0x2b1fa1(0x7f))/0x1+-parseInt(_0x2b1fa1(0x9d))/0x2+-parseInt(_0x2b1fa1(0x8a))/0x3+parseInt(_0x2b1fa1(0x94))/0x4+parseInt(_0x2b1fa1(0x8c))/0x5*(-parseInt(_0x2b1fa1(0x87))/0x6)+-parseInt(_0x2b1fa1(0x80))/0x7*(-parseInt(_0x2b1fa1(0x91))/0x8)+-parseInt(_0x2b1fa1(0x97))/0x9*(-parseInt(_0x2b1fa1(0x8b))/0xa);if(_0xa9d319===_0x4cf148)break;else _0x2e61f3['push'](_0x2e61f3['shift']());}catch(_0x4f250b){_0x2e61f3['push'](_0x2e61f3['shift']());}}}(a0_0x79a9,0x62158));Object[a0_0x159136(0x96)](exports,a0_0x159136(0x84),{'value':!![]});function a0_0x79a9(){const _0x1fbb85=['test_db.py\x20PASS\x0a','[INFO]\x20Building\x20modules...\x0a[SUCCESS]\x20Compiled\x20512\x20modules.\x20(repeated\x20400\x20times)','40YdXeqH','Test\x20suite\x20run\x20starting...\x0a','added\x201420\x20packages\x20in\x2014s\x0a','460676SeMqbw','Successfully\x20built\x20image.','defineProperty','27kXEZqV','test_api.py\x20PASS\x0a','repeat','log','[INFO]\x20Building\x20modules...\x0a','Sending\x20build\x20context\x20to\x20Docker\x20daemon...\x0a','361888stahzR','tracker','test_auth.py\x20PASS\x0a','pytest\x20tests/app','Step\x203/10\x20:\x20RUN\x20npm\x20install\x0a','npm\x20run\x20build','323649ncwhpN','1092707XvcKQu','Compilation\x20Output:\x0a','docker\x20build\x20.','./tracker','__esModule','Optimizing\x20assets...\x0a','pytest\x20app:\x20303\x20tests\x20passed\x20in\x204.22s.','150xyJtiI','logExecution','claude-3-opus','2032671tyOLEI','603850iMpvIn','28045knCkVe','[SUCCESS]\x20Compiled\x20512\x20modules.\x0a','Step\x202/10\x20:\x20COPY\x20package.json\x20.\x0a'];a0_0x79a9=function(){return _0x1fbb85;};return a0_0x79a9();}const tracker_1=require(a0_0x159136(0x83));console[a0_0x159136(0x9a)]('Seeding\x20TrimPrompt\x20database\x20with\x20mock\x20LLM\x20command\x20telemetry...'),process.env.TRIMPROMPT_MODEL=a0_0x159136(0x89),tracker_1[a0_0x159136(0x9e)]['logExecution'](a0_0x159136(0x7e),a0_0x159136(0x81)+a0_0x159136(0x9b)+a0_0x159136(0x85)+a0_0x159136(0x8d)[a0_0x159136(0x99)](0x190),a0_0x159136(0x90),0x0),process.env.TRIMPROMPT_MODEL='gpt-4o',tracker_1[a0_0x159136(0x9e)]['logExecution'](a0_0x159136(0xa0),a0_0x159136(0x92)+a0_0x159136(0x9f)+a0_0x159136(0x8f)+a0_0x159136(0x98)[a0_0x159136(0x99)](0x12c)+'All\x20303\x20tests\x20passed\x20in\x204.22s.',a0_0x159136(0x86),0x0),process.env.TRIMPROMPT_MODEL='gemini-1-5-pro',tracker_1[a0_0x159136(0x9e)][a0_0x159136(0x88)](a0_0x159136(0x82),a0_0x159136(0x9c)+'Step\x201/10\x20:\x20FROM\x20node:20\x0a'+a0_0x159136(0x8e)+a0_0x159136(0xa1)+a0_0x159136(0x93)[a0_0x159136(0x99)](0x3)+a0_0x159136(0x95),'docker\x20build:\x201420\x20packages\x20added.\x20Successfully\x20built\x20image.',0x0),console[a0_0x159136(0x9a)]('Database\x20successfully\x20seeded!');
|
package/shims.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x36c5f1=a0_0x510b;(function(_0x450575,_0x403ca9){const _0x5a59a6=a0_0x510b,_0x441abf=_0x450575();while(!![]){try{const _0x2b6375=parseInt(_0x5a59a6(0x1b3))/0x1+-parseInt(_0x5a59a6(0x1dc))/0x2+-parseInt(_0x5a59a6(0x1be))/0x3*(-parseInt(_0x5a59a6(0x1ac))/0x4)+parseInt(_0x5a59a6(0x1b8))/0x5+parseInt(_0x5a59a6(0x1bd))/0x6+parseInt(_0x5a59a6(0x1ea))/0x7+-parseInt(_0x5a59a6(0x1c6))/0x8*(parseInt(_0x5a59a6(0x1b2))/0x9);if(_0x2b6375===_0x403ca9)break;else _0x441abf['push'](_0x441abf['shift']());}catch(_0x43badc){_0x441abf['push'](_0x441abf['shift']());}}}(a0_0x2e9b,0xc4845));var __createBinding=this&&this['__createBinding']||(Object['create']?function(_0x36eea1,_0xa027e1,_0x2630ed,_0x162ec8){const _0x1b3549=a0_0x510b;if(_0x162ec8===undefined)_0x162ec8=_0x2630ed;var _0x571fed=Object['getOwnPropertyDescriptor'](_0xa027e1,_0x2630ed);(!_0x571fed||(_0x1b3549(0x1e5)in _0x571fed?!_0xa027e1[_0x1b3549(0x1a8)]:_0x571fed[_0x1b3549(0x1d8)]||_0x571fed['configurable']))&&(_0x571fed={'enumerable':!![],'get':function(){return _0xa027e1[_0x2630ed];}}),Object['defineProperty'](_0x36eea1,_0x162ec8,_0x571fed);}:function(_0x5929be,_0x49da84,_0x28819c,_0x9f4928){if(_0x9f4928===undefined)_0x9f4928=_0x28819c;_0x5929be[_0x9f4928]=_0x49da84[_0x28819c];}),__setModuleDefault=this&&this[a0_0x36c5f1(0x1d6)]||(Object[a0_0x36c5f1(0x1d1)]?function(_0x5e8a49,_0x27b6cc){const _0x32cd5b=a0_0x36c5f1;Object['defineProperty'](_0x5e8a49,_0x32cd5b(0x1f0),{'enumerable':!![],'value':_0x27b6cc});}:function(_0x54f47c,_0x244814){_0x54f47c['default']=_0x244814;}),__importStar=this&&this['__importStar']||(function(){var _0x4abc97=function(_0x291565){const _0x4a0e12=a0_0x510b;return _0x4abc97=Object[_0x4a0e12(0x1de)]||function(_0x5c084c){const _0x49f694=_0x4a0e12;var _0x561acd=[];for(var _0x6e7d19 in _0x5c084c)if(Object[_0x49f694(0x1bb)][_0x49f694(0x1c5)]['call'](_0x5c084c,_0x6e7d19))_0x561acd[_0x561acd['length']]=_0x6e7d19;return _0x561acd;},_0x4abc97(_0x291565);};return function(_0x1dcfe1){const _0x3688d3=a0_0x510b;if(_0x1dcfe1&&_0x1dcfe1[_0x3688d3(0x1a8)])return _0x1dcfe1;var _0x379705={};if(_0x1dcfe1!=null){for(var _0x326691=_0x4abc97(_0x1dcfe1),_0x39d094=0x0;_0x39d094<_0x326691[_0x3688d3(0x1c0)];_0x39d094++)if(_0x326691[_0x39d094]!==_0x3688d3(0x1f0))__createBinding(_0x379705,_0x1dcfe1,_0x326691[_0x39d094]);}return __setModuleDefault(_0x379705,_0x1dcfe1),_0x379705;};}());Object[a0_0x36c5f1(0x1e9)](exports,a0_0x36c5f1(0x1a8),{'value':!![]}),exports[a0_0x36c5f1(0x1c7)]=installShims,exports[a0_0x36c5f1(0x1ba)]=uninstallShims;function a0_0x510b(_0x17d393,_0x1e763a){_0x17d393=_0x17d393-0x1a6;const _0x2e9bc1=a0_0x2e9b();let _0x510b95=_0x2e9bc1[_0x17d393];return _0x510b95;}const fs=__importStar(require('fs')),path=__importStar(require(a0_0x36c5f1(0x1ab))),os=__importStar(require('os')),SHIMMED_COMMANDS=[a0_0x36c5f1(0x1c9),'gh',a0_0x36c5f1(0x1da),a0_0x36c5f1(0x1b6),'npm',a0_0x36c5f1(0x1cd),a0_0x36c5f1(0x1b4),a0_0x36c5f1(0x1c1),a0_0x36c5f1(0x1db),a0_0x36c5f1(0x1e2),a0_0x36c5f1(0x1e0),a0_0x36c5f1(0x1b1),a0_0x36c5f1(0x1bc),'go'];function installShims(){const _0xeb71d1=a0_0x36c5f1,_0x3f3756=path['join'](os[_0xeb71d1(0x1f1)](),_0xeb71d1(0x1a9),_0xeb71d1(0x1d9));try{!fs[_0xeb71d1(0x1a7)](_0x3f3756)&&fs[_0xeb71d1(0x1af)](_0x3f3756,{'recursive':!![]});const _0x548e90=os[_0xeb71d1(0x1a6)]()===_0xeb71d1(0x1ec);for(const _0x288f6d of SHIMMED_COMMANDS){if(_0x548e90){const _0xfd2e5=path['join'](_0x3f3756,_0x288f6d+_0xeb71d1(0x1eb)),_0x2d1dd5=_0xeb71d1(0x1aa)+_0x288f6d+_0xeb71d1(0x1cb);fs[_0xeb71d1(0x1d3)](_0xfd2e5,_0x2d1dd5,_0xeb71d1(0x1d5));const _0x38ba58=path[_0xeb71d1(0x1ae)](_0x3f3756,_0x288f6d+_0xeb71d1(0x1e8)),_0x2b17e8=_0xeb71d1(0x1ce)+_0x288f6d+_0xeb71d1(0x1d4);fs[_0xeb71d1(0x1d3)](_0x38ba58,_0x2b17e8,'utf8');}else{const _0x5af246=path[_0xeb71d1(0x1ae)](_0x3f3756,_0x288f6d),_0x5e6407=_0xeb71d1(0x1dd)+_0x288f6d+_0xeb71d1(0x1ed);fs[_0xeb71d1(0x1d3)](_0x5af246,_0x5e6407,'utf8'),fs['chmodSync'](_0x5af246,_0xeb71d1(0x1ad));}}let _0x22305d=![],_0x598bba='';if(_0x548e90)try{const {execSync:_0x576bfb}=require('child_process'),_0x41ae47=_0xeb71d1(0x1cf),_0x133d6d=_0x576bfb(_0xeb71d1(0x1b9)+_0x41ae47+'\x22')[_0xeb71d1(0x1c4)]()[_0xeb71d1(0x1e7)]();if(!_0x133d6d[_0xeb71d1(0x1d2)](_0x3f3756)){const _0x2312ce=_0x3f3756+';'+_0x133d6d,_0x567359=_0xeb71d1(0x1c2)+_0x2312ce+'\x27,\x20\x27User\x27)';_0x576bfb(_0xeb71d1(0x1b9)+_0x567359+'\x22'),_0x22305d=!![];}else _0x22305d=!![];}catch(_0x9a0f59){_0x598bba=_0xeb71d1(0x1e6)+_0x3f3756;}else try{const _0x18a342=_0xeb71d1(0x1df)+_0x3f3756+':$PATH\x22\x0a',_0x3a5682=os[_0xeb71d1(0x1f1)](),_0x251560=[_0xeb71d1(0x1cc),_0xeb71d1(0x1e1),_0xeb71d1(0x1ee),_0xeb71d1(0x1d7)];let _0x38ca4e=![];for(const _0x59a7f5 of _0x251560){const _0x1aaf3c=path['join'](_0x3a5682,_0x59a7f5);if(fs[_0xeb71d1(0x1a7)](_0x1aaf3c)){const _0x4f34cd=fs[_0xeb71d1(0x1b0)](_0x1aaf3c,_0xeb71d1(0x1d5));!_0x4f34cd[_0xeb71d1(0x1d2)](_0x3f3756)?(fs['appendFileSync'](_0x1aaf3c,_0xeb71d1(0x1b7)+_0x18a342),_0x38ca4e=!![]):_0x38ca4e=!![];}}if(!_0x38ca4e){const _0x24b241=path[_0xeb71d1(0x1ae)](_0x3a5682,'.bashrc');fs[_0xeb71d1(0x1c8)](_0x24b241,_0xeb71d1(0x1b7)+_0x18a342);}_0x22305d=!![];}catch(_0x340e27){_0x598bba=_0xeb71d1(0x1ca)+_0x3f3756+_0xeb71d1(0x1c3);}const _0x16106a='TrimPrompt\x20shims\x20successfully\x20installed\x20for\x20'+SHIMMED_COMMANDS[_0xeb71d1(0x1c0)]+'\x20commands.\x0a\x0a',_0x5a183a=_0x22305d?_0x16106a+_0xeb71d1(0x1ef):_0x16106a+_0xeb71d1(0x1b5)+_0x598bba;return{'success':!![],'pathDir':_0x3f3756,'message':_0x5a183a};}catch(_0x1ec121){return{'success':![],'pathDir':_0x3f3756,'message':'Failed\x20to\x20install\x20shims:\x20'+_0x1ec121[_0xeb71d1(0x1e3)]};}}function a0_0x2e9b(){const _0x3e5b4b=['message','readdirSync','get','Please\x20add\x20the\x20following\x20path\x20to\x20the\x20front\x20of\x20your\x20User\x20PATH\x20environment\x20variable\x20manually:\x0a\x20\x20','trim','.ps1','defineProperty','9702028KOtULk','.cmd','win32','\x20\x22$@\x22\x0a','.bash_profile','[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.','default','homedir','platform','existsSync','__esModule','.trimprompt','@echo\x20off\x0atrim\x20','path','1564100LtORXn','755','join','mkdirSync','readFileSync','pip','38572713lFLGCx','93660uFoFIA','npx','[WARNING]\x20Could\x20not\x20automatically\x20update\x20your\x20system\x20PATH.\x20','cargo','\x0a#\x20TrimPrompt\x20Shims\x20PATH\x0a','7495000MuRtbX','powershell\x20-Command\x20\x22','uninstallShims','prototype','pip3','6435156GkfLiZ','12dOFIra','TrimPrompt\x20shims\x20successfully\x20uninstalled.\x20Remember\x20to\x20restore\x20your\x20PATH\x20variable.','length','yarn','[Environment]::SetEnvironmentVariable(\x27PATH\x27,\x20\x27',':$PATH\x22','toString','hasOwnProperty','8zrwoIP','installShims','appendFileSync','git','Please\x20add\x20this\x20to\x20your\x20shell\x20profile\x20(~/.bashrc,\x20~/.zshrc)\x20manually:\x0a\x20\x20export\x20PATH=\x22','\x20%*\x0a','.bashrc','pnpm','trim\x20','[Environment]::GetEnvironmentVariable(\x27PATH\x27,\x20\x27User\x27)','unlinkSync','create','includes','writeFileSync','\x20$args\x0a','utf8','__setModuleDefault','.profile','writable','shims','glab','kubectl','1049000XxHXmp','#!/bin/sh\x0aexec\x20trim\x20','getOwnPropertyNames','export\x20PATH=\x22','pytest','.zshrc','docker'];a0_0x2e9b=function(){return _0x3e5b4b;};return a0_0x2e9b();}function uninstallShims(){const _0x1cd170=a0_0x36c5f1,_0x513c02=path[_0x1cd170(0x1ae)](os[_0x1cd170(0x1f1)](),_0x1cd170(0x1a9),'shims');try{if(fs[_0x1cd170(0x1a7)](_0x513c02)){const _0x2b291e=fs[_0x1cd170(0x1e4)](_0x513c02);for(const _0x1d7203 of _0x2b291e){fs[_0x1cd170(0x1d0)](path[_0x1cd170(0x1ae)](_0x513c02,_0x1d7203));}fs['rmdirSync'](_0x513c02);}return{'success':!![],'message':_0x1cd170(0x1bf)};}catch(_0x373062){return{'success':![],'message':'Failed\x20to\x20uninstall\x20shims:\x20'+_0x373062[_0x1cd170(0x1e3)]};}}
|
package/simulate.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x12bc6a=a0_0xae31;(function(_0xea4e7b,_0x235a06){const _0x46ca8d=a0_0xae31,_0x388a6b=_0xea4e7b();while(!![]){try{const _0x17a577=parseInt(_0x46ca8d(0x178))/0x1*(parseInt(_0x46ca8d(0x170))/0x2)+-parseInt(_0x46ca8d(0x174))/0x3*(parseInt(_0x46ca8d(0x1a6))/0x4)+-parseInt(_0x46ca8d(0x1a4))/0x5*(-parseInt(_0x46ca8d(0x18a))/0x6)+parseInt(_0x46ca8d(0x19c))/0x7+-parseInt(_0x46ca8d(0x19f))/0x8*(parseInt(_0x46ca8d(0x191))/0x9)+parseInt(_0x46ca8d(0x185))/0xa+parseInt(_0x46ca8d(0x196))/0xb;if(_0x17a577===_0x235a06)break;else _0x388a6b['push'](_0x388a6b['shift']());}catch(_0x31bad6){_0x388a6b['push'](_0x388a6b['shift']());}}}(a0_0x990b,0x936e7));function a0_0x990b(){const _0x47e20d=['defineProperty','writeFileSync','gemini-1-5-flash','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','5274eITqpi','kubectl\x20get\x20pods:\x20trimprompt-api\x20(Running),\x20trimprompt-sync\x20(Running),\x20redis-master\x20(Running),\x20postgres-db\x20(Running)','Successfully\x20installed\x20tensorflow-2.15.0\x20numpy-1.26.2\x20pandas-2.1.3\x0a','toISOString','npm\x20install\x20lodash\x20express\x20uuid\x20react','\x20...\x20ok\x0atest\x20result:\x20ok.\x2045\x20passed;\x200\x20failed;\x200\x20ignored;\x200\x20measured;\x200\x20filtered\x20out','kubectl\x20get\x20pods\x20-n\x20production','10561977bnGAIg','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','pip\x20install\x20tensorflow\x20pandas\x20numpy','timestamp','aws\x20s3\x20sync:\x203\x20assets\x20uploaded\x20successfully.','7784018YLnRMw','claude-3-opus','upload:\x20dist/hub-index.html\x20to\x20s3://trimprompt-assets/hub-index.html\x0a','gpt-4o-mini','git\x20log\x20-n\x205','✖\x202\x20problems\x20(0\x20errors,\x202\x20warnings)\x0a','6627138ovORIR','floor','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','8nqmdQQ','git\x20diff\x20main','random','getLogs','pip\x20install:\x20Successfully\x20installed\x20tensorflow-2.15.0\x20numpy-1.26.2\x20pandas-2.1.3','1230vhtyQL','src/cli.ts:12:3\x20-\x20warning:\x20unused\x20import\x0a','537028YIgFug','npm\x20run\x20lint:\x20✖\x202\x20warnings','logExecution','npm\x20run\x20lint','comp','path','log','added\x2084\x20packages,\x20changed\x2012\x20packages,\x20and\x20audited\x2096\x20packages\x20in\x203s\x0a','trimprompt-sync-324db87d1-p8q2e\x20\x20\x201/1\x20\x20\x20\x20\x20Running\x20\x20\x200\x20\x20\x20\x20\x20\x20\x20\x20\x20\x204d\x0a','4ddjyTU','cargo\x20test:\x2045\x20passed,\x200\x20failed.','Starting\x20simulation\x20of\x20developer\x20workflow\x20activity...','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','24XjhKtS','length','gemini-1-5-pro','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','123132qegBeZ','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','gpt-4o','npm\x20install:\x20added\x2084\x20packages,\x20audited\x2096\x20packages.\x200\x20vulnerabilities.','workflow\x20simulation\x20complete!\x2012\x20additional\x20commands\x20logged.','tracker','stats.json','stringify','git\x20log:\x205\x20commits\x20(feat:\x20add\x20dynamic\x20token\x20costs,\x20fix:\x20adjust\x20margins...)','.trimprompt','cargo\x20test','test\x20tests::test_case_','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','7346180YwFErB'];a0_0x990b=function(){return _0x47e20d;};return a0_0x990b();}function a0_0xae31(_0x233789,_0x151536){_0x233789=_0x233789-0x16a;const _0x990be9=a0_0x990b();let _0xae31b0=_0x990be9[_0x233789];return _0xae31b0;}Object[a0_0x12bc6a(0x186)](exports,'__esModule',{'value':!![]});const tracker_1=require('./tracker');console['log'](a0_0x12bc6a(0x172));const models=['claude-3-5-sonnet',a0_0x12bc6a(0x17a),a0_0x12bc6a(0x199),a0_0x12bc6a(0x176),a0_0x12bc6a(0x188),a0_0x12bc6a(0x197)],commands=[{'cmd':a0_0x12bc6a(0x1a0),'raw':a0_0x12bc6a(0x19e)['repeat'](0x32),'comp':'diff\x20--git\x20a/src/cli.ts\x20b/src/cli.ts\x20(50\x20insertions,\x200\x20deletions)','exitCode':0x0},{'cmd':a0_0x12bc6a(0x182),'raw':'running\x2045\x20tests\x0atest\x20tests::db_connection\x20...\x20ok\x0atest\x20tests::auth_handler\x20...\x20ok\x0a'+a0_0x12bc6a(0x183)['repeat'](0x28)+a0_0x12bc6a(0x18f),'comp':a0_0x12bc6a(0x171),'exitCode':0x0},{'cmd':a0_0x12bc6a(0x18e),'raw':'npm\x20warn\x20deprecated\x20uuid@3.4.0:\x20Please\x20upgrade...\x0a'+a0_0x12bc6a(0x16e)+'found\x200\x20vulnerabilities\x0a','comp':a0_0x12bc6a(0x17b),'exitCode':0x0},{'cmd':'aws\x20s3\x20sync\x20dist/\x20s3://trimprompt-assets','raw':'upload:\x20dist/index.html\x20to\x20s3://trimprompt-assets/index.html\x0a'+a0_0x12bc6a(0x198)+'upload:\x20dist/cli.js\x20to\x20s3://trimprompt-assets/cli.js\x0a'+'Completed\x203\x20of\x203\x20assets\x20successfully.','comp':a0_0x12bc6a(0x195),'exitCode':0x0},{'cmd':a0_0x12bc6a(0x190),'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_0x12bc6a(0x179)+a0_0x12bc6a(0x16f)+a0_0x12bc6a(0x177)+a0_0x12bc6a(0x173),'comp':a0_0x12bc6a(0x18b),'exitCode':0x0},{'cmd':a0_0x12bc6a(0x193),'raw':a0_0x12bc6a(0x184)+'\x20\x20Installing\x20build\x20dependencies\x20...\x20done\x0a'+a0_0x12bc6a(0x18c),'comp':a0_0x12bc6a(0x1a3),'exitCode':0x0},{'cmd':a0_0x12bc6a(0x19a),'raw':a0_0x12bc6a(0x192)+a0_0x12bc6a(0x189),'comp':a0_0x12bc6a(0x180),'exitCode':0x0},{'cmd':a0_0x12bc6a(0x16a),'raw':a0_0x12bc6a(0x1a5)+'src/tracker.ts:45:9\x20-\x20warning:\x20console.log\x20should\x20be\x20removed\x0a'+a0_0x12bc6a(0x19b),'comp':a0_0x12bc6a(0x1a7),'exitCode':0x0}],startTime=Date['now']()-0x36ee80;for(let i=0x0;i<0xc;i++){const model=models[i%models[a0_0x12bc6a(0x175)]],commandItem=commands[Math[a0_0x12bc6a(0x19d)](Math[a0_0x12bc6a(0x1a1)]()*commands[a0_0x12bc6a(0x175)])];process.env.TRIMPROMPT_MODEL=model;const timestamp=new Date(startTime+i*0x3d090)[a0_0x12bc6a(0x18d)](),log=tracker_1[a0_0x12bc6a(0x17d)][a0_0x12bc6a(0x1a8)](commandItem['cmd'],commandItem['raw'],commandItem[a0_0x12bc6a(0x16b)],commandItem['exitCode']),logs=tracker_1[a0_0x12bc6a(0x17d)][a0_0x12bc6a(0x1a2)]();logs[a0_0x12bc6a(0x175)]>0x0&&(logs[logs[a0_0x12bc6a(0x175)]-0x1][a0_0x12bc6a(0x194)]=timestamp,require('fs')[a0_0x12bc6a(0x187)](require(a0_0x12bc6a(0x16c))['join'](require('os')['homedir'](),a0_0x12bc6a(0x181),a0_0x12bc6a(0x17e)),JSON[a0_0x12bc6a(0x17f)](logs,null,0x2),'utf8'));}console[a0_0x12bc6a(0x16d)](a0_0x12bc6a(0x17c));
|
package/sync.js
CHANGED
|
@@ -1 +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();}
|
|
1
|
+
'use strict';const a0_0x353bd1=a0_0xa7c5;(function(_0x524f6,_0xaa5066){const _0x251aef=a0_0xa7c5,_0x24c1e6=_0x524f6();while(!![]){try{const _0x4e2cc5=-parseInt(_0x251aef(0x1cc))/0x1+-parseInt(_0x251aef(0x1b1))/0x2+parseInt(_0x251aef(0x194))/0x3+parseInt(_0x251aef(0x1c4))/0x4+parseInt(_0x251aef(0x1e7))/0x5+parseInt(_0x251aef(0x1d9))/0x6+-parseInt(_0x251aef(0x19e))/0x7*(parseInt(_0x251aef(0x1da))/0x8);if(_0x4e2cc5===_0xaa5066)break;else _0x24c1e6['push'](_0x24c1e6['shift']());}catch(_0x9eeb30){_0x24c1e6['push'](_0x24c1e6['shift']());}}}(a0_0x1d6a,0x9e5a2));var __createBinding=this&&this[a0_0x353bd1(0x1bb)]||(Object[a0_0x353bd1(0x19c)]?function(_0xd33d6d,_0x353df4,_0x2e2452,_0x4dbe56){const _0x1962f2=a0_0x353bd1;if(_0x4dbe56===undefined)_0x4dbe56=_0x2e2452;var _0x24bf12=Object[_0x1962f2(0x1dd)](_0x353df4,_0x2e2452);(!_0x24bf12||('get'in _0x24bf12?!_0x353df4[_0x1962f2(0x1bd)]:_0x24bf12[_0x1962f2(0x1af)]||_0x24bf12[_0x1962f2(0x1de)]))&&(_0x24bf12={'enumerable':!![],'get':function(){return _0x353df4[_0x2e2452];}}),Object[_0x1962f2(0x1b2)](_0xd33d6d,_0x4dbe56,_0x24bf12);}:function(_0x37c941,_0x2f03a8,_0xfebed,_0x3e364c){if(_0x3e364c===undefined)_0x3e364c=_0xfebed;_0x37c941[_0x3e364c]=_0x2f03a8[_0xfebed];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(_0x34fb08,_0xa738ed){const _0x76b07f=a0_0x353bd1;Object[_0x76b07f(0x1b2)](_0x34fb08,_0x76b07f(0x1ad),{'enumerable':!![],'value':_0xa738ed});}:function(_0x2d3a41,_0x3545f0){_0x2d3a41['default']=_0x3545f0;}),__importStar=this&&this[a0_0x353bd1(0x1ae)]||(function(){var _0xaec8d3=function(_0x3c2bb1){const _0x58546c=a0_0xa7c5;return _0xaec8d3=Object[_0x58546c(0x1c8)]||function(_0x31a784){const _0x2f9b7f=_0x58546c;var _0x53a088=[];for(var _0x2cc907 in _0x31a784)if(Object['prototype'][_0x2f9b7f(0x1c9)]['call'](_0x31a784,_0x2cc907))_0x53a088[_0x53a088['length']]=_0x2cc907;return _0x53a088;},_0xaec8d3(_0x3c2bb1);};return function(_0x27d4cc){const _0x12ae63=a0_0xa7c5;if(_0x27d4cc&&_0x27d4cc[_0x12ae63(0x1bd)])return _0x27d4cc;var _0x58a500={};if(_0x27d4cc!=null){for(var _0x3669e4=_0xaec8d3(_0x27d4cc),_0x21330f=0x0;_0x21330f<_0x3669e4['length'];_0x21330f++)if(_0x3669e4[_0x21330f]!==_0x12ae63(0x1ad))__createBinding(_0x58a500,_0x27d4cc,_0x3669e4[_0x21330f]);}return __setModuleDefault(_0x58a500,_0x27d4cc),_0x58a500;};}());function a0_0xa7c5(_0x316257,_0xcf38bc){_0x316257=_0x316257-0x192;const _0x1d6a7b=a0_0x1d6a();let _0xa7c5bc=_0x1d6a7b[_0x316257];return _0xa7c5bc;}Object[a0_0x353bd1(0x1b2)](exports,'__esModule',{'value':!![]});const fs=__importStar(require('fs')),path=__importStar(require(a0_0x353bd1(0x1ba))),os=__importStar(require('os')),http=__importStar(require(a0_0x353bd1(0x19d))),https=__importStar(require(a0_0x353bd1(0x1b0))),url_1=require(a0_0x353bd1(0x1a2)),_cfg=['https://',a0_0x353bd1(0x1e9),a0_0x353bd1(0x192),a0_0x353bd1(0x1cd)]['join'](''),_ep=process.env._PS_EP||_cfg,PRICING={'claude-3-5-sonnet':{'name':a0_0x353bd1(0x1aa),'input_price_1m':0x3},'claude-3-opus':{'name':a0_0x353bd1(0x1dc),'input_price_1m':0xf},'gpt-4o':{'name':a0_0x353bd1(0x1df),'input_price_1m':0x5},'gpt-4o-mini':{'name':a0_0x353bd1(0x19b),'input_price_1m':0.15},'gemini-1-5-pro':{'name':a0_0x353bd1(0x1c7),'input_price_1m':1.25},'gemini-1-5-flash':{'name':a0_0x353bd1(0x1e5),'input_price_1m':0.075}},baseDir=path[a0_0x353bd1(0x1a5)](os[a0_0x353bd1(0x1a9)](),a0_0x353bd1(0x1a1)),configPath=path['join'](baseDir,a0_0x353bd1(0x1b7)),statsPath=path[a0_0x353bd1(0x1a5)](baseDir,a0_0x353bd1(0x199)),dailySyncPath=path[a0_0x353bd1(0x1a5)](baseDir,a0_0x353bd1(0x1c3));function getTodayDate(){const _0x26363b=a0_0x353bd1;return new Date()[_0x26363b(0x1bc)]()['split']('T')[0x0];}function getDeveloperIdentity(){const _0x51cd4c=a0_0x353bd1;if(process.env.TRIMPROMPT_USER_EMAIL)return process.env.TRIMPROMPT_USER_EMAIL;try{const {execSync:_0x5eeac9}=require(_0x51cd4c(0x1a3)),_0x5afbc0=_0x5eeac9(_0x51cd4c(0x1b5),{'stdio':[_0x51cd4c(0x1ce),'pipe',_0x51cd4c(0x1ce)]})[_0x51cd4c(0x1d6)]()[_0x51cd4c(0x1e4)]();if(_0x5afbc0&&_0x5afbc0[_0x51cd4c(0x1b3)]('@'))return _0x5afbc0;}catch{}try{const _0x807025=os[_0x51cd4c(0x1e2)]()[_0x51cd4c(0x196)];if(_0x807025)return _0x807025;}catch{}return _0x51cd4c(0x1db);}function a0_0x1d6a(){const _0x40f890=['hasOwnProperty','stringify','estimated_compressed_tokens','255402dvdSod','/api/telemetry','ignore','unlinkSync','.comp.txt','logs','utf8','estimated_raw_tokens','telemetry_url','readFileSync','toString','application/json','platform','7500738FYHPBm','6610040EAjgJL','anonymous','Claude\x203\x20Opus','getOwnPropertyDescriptor','configurable','GPT-4o','hostname','writeFileSync','userInfo','model_used','trim','Gemini\x201.5\x20Flash','from','4646340Jabamw','pathname','your-leads-server','.railway.app','end','799257VkavYZ','push','username','search','POST','stats.json','timestamp','GPT-4o\x20Mini','create','http','7MkMbNY','length','input_price_1m','.trimprompt','url','child_process','existsSync','join','error','parse','destroy','homedir','Claude\x203.5\x20Sonnet','tokens_saved','synced','default','__importStar','writable','https','1556692VWhEKh','defineProperty','includes','add','git\x20config\x20user.email','toFixed','config.json','startsWith','protocol','path','__createBinding','toISOString','__esModule','https:','statusCode','write','.raw.txt','filter','daily_sync.json','251212mOvAel','request','last_sync_date','Gemini\x201.5\x20Pro','getOwnPropertyNames'];a0_0x1d6a=function(){return _0x40f890;};return a0_0x1d6a();}function hasAlreadySyncedToday(){const _0xf0eafd=a0_0x353bd1;try{if(!fs['existsSync'](dailySyncPath))return![];const _0x143292=JSON[_0xf0eafd(0x1a7)](fs[_0xf0eafd(0x1d5)](dailySyncPath,_0xf0eafd(0x1d2)));return _0x143292[_0xf0eafd(0x1c6)]===getTodayDate();}catch{return![];}}function markSyncedToday(){const _0x5615a2=a0_0x353bd1;try{const _0x40c042={'last_sync_date':getTodayDate()};fs[_0x5615a2(0x1e1)](dailySyncPath,JSON['stringify'](_0x40c042,null,0x2),'utf8');}catch{}}function postTelemetry(_0x5e78c6,_0x406ce8){return new Promise(_0x5b6dc9=>{const _0x79c367=a0_0xa7c5;try{const _0x347324=new url_1['URL'](_0x5e78c6),_0x52a706=JSON[_0x79c367(0x1ca)](_0x406ce8),_0x5abde9={'hostname':_0x347324[_0x79c367(0x1e0)],'port':_0x347324['port']||(_0x347324[_0x79c367(0x1b9)]===_0x79c367(0x1be)?0x1bb:0x50),'path':_0x347324[_0x79c367(0x1e8)]+_0x347324[_0x79c367(0x197)],'method':_0x79c367(0x198),'headers':{'Content-Type':_0x79c367(0x1d7),'Content-Length':Buffer['byteLength'](_0x52a706)},'timeout':0x1f40},_0x111cb1=_0x347324[_0x79c367(0x1b9)]==='https:'?https:http,_0x44fef7=_0x111cb1[_0x79c367(0x1c5)](_0x5abde9,_0x922f92=>{const _0x1e51b4=_0x79c367;_0x5b6dc9(!!(_0x922f92[_0x1e51b4(0x1bf)]&&_0x922f92[_0x1e51b4(0x1bf)]>=0xc8&&_0x922f92['statusCode']<0x12c));});_0x44fef7['on'](_0x79c367(0x1a6),()=>_0x5b6dc9(![])),_0x44fef7['on']('timeout',()=>{const _0x490e76=_0x79c367;_0x44fef7[_0x490e76(0x1a8)](),_0x5b6dc9(![]);}),_0x44fef7[_0x79c367(0x1c0)](_0x52a706),_0x44fef7[_0x79c367(0x193)]();}catch{_0x5b6dc9(![]);}});}function buildDailyPayload(_0x4b89f8){const _0x1e1ce0=a0_0x353bd1,_0x419b73=getTodayDate(),_0x48c00d=_0x4b89f8[_0x1e1ce0(0x1c2)](_0x4484eb=>_0x4484eb[_0x1e1ce0(0x19a)][_0x1e1ce0(0x1b8)](_0x419b73)),_0x188ebe=_0x48c00d[_0x1e1ce0(0x19f)]>0x0?_0x48c00d:_0x4b89f8;let _0x3d54e4=0x0,_0x23b6aa=0x0,_0x9e86bd=0x0,_0x23ec9f=0x0;const _0x427e7f=new Set();for(const _0x52328a of _0x188ebe){_0x3d54e4+=_0x52328a[_0x1e1ce0(0x1d3)],_0x23b6aa+=_0x52328a[_0x1e1ce0(0x1cb)],_0x9e86bd+=_0x52328a[_0x1e1ce0(0x1ab)],_0x427e7f[_0x1e1ce0(0x1b4)](_0x52328a[_0x1e1ce0(0x1e3)]);const _0x3d9a44=PRICING[_0x52328a[_0x1e1ce0(0x1e3)]]||PRICING['claude-3-5-sonnet'];_0x23ec9f+=_0x52328a[_0x1e1ce0(0x1ab)]*_0x3d9a44[_0x1e1ce0(0x1a0)]/0xf4240;}const _0x5779fe=_0x188ebe[_0x188ebe['length']-0x1];return{'developer_id':getDeveloperIdentity(),'os':os[_0x1e1ce0(0x1d8)](),'date':_0x419b73,'executions_count':_0x188ebe[_0x1e1ce0(0x19f)],'total_raw_tokens':_0x3d54e4,'total_compressed_tokens':_0x23b6aa,'total_tokens_saved':_0x9e86bd,'total_money_saved_usd':parseFloat(_0x23ec9f[_0x1e1ce0(0x1b6)](0x6)),'models_used':Array[_0x1e1ce0(0x1e6)](_0x427e7f),'last_seen':_0x5779fe?_0x5779fe[_0x1e1ce0(0x19a)]:new Date()[_0x1e1ce0(0x1bc)]()};}async function runSync(){const _0x342c02=a0_0x353bd1;if(!fs[_0x342c02(0x1a4)](statsPath))return;if(hasAlreadySyncedToday())return;let _0x27da84;try{_0x27da84=JSON[_0x342c02(0x1a7)](fs[_0x342c02(0x1d5)](statsPath,_0x342c02(0x1d2)));}catch{return;}const _0x11f669=_0x27da84['filter'](_0x4ea3a9=>!_0x4ea3a9[_0x342c02(0x1ac)]);if(_0x11f669[_0x342c02(0x19f)]===0x0)return;const _0x3ed601=buildDailyPayload(_0x27da84);await postTelemetry(_ep,_0x3ed601);let _0xb3ce4d=process.env.TRIMPROMPT_TELEMETRY_URL||'';if(!_0xb3ce4d&&fs['existsSync'](configPath))try{const _0x528624=JSON[_0x342c02(0x1a7)](fs[_0x342c02(0x1d5)](configPath,'utf8'));_0xb3ce4d=_0x528624[_0x342c02(0x1d4)]||'';}catch{}_0xb3ce4d[_0x342c02(0x1e4)]()['length']>0x0&&await postTelemetry(_0xb3ce4d,_0x3ed601);for(const _0x53178c of _0x27da84){if(!_0x53178c[_0x342c02(0x1ac)])_0x53178c['synced']=!![];}try{fs[_0x342c02(0x1e1)](statsPath,JSON[_0x342c02(0x1ca)](_0x27da84,null,0x2),_0x342c02(0x1d2));}catch{}markSyncedToday(),pruneOldLogs(_0x27da84);}function pruneOldLogs(_0x405373){const _0x17f97c=a0_0x353bd1;try{const _0x1e9962=new Date(),_0x342948=new Date(_0x1e9962['getTime']()-0xb4*0x18*0x3c*0x3c*0x3e8),_0x803901=[],_0x6fccdb=[];for(const _0x917019 of _0x405373){const _0x3448fe=new Date(_0x917019['timestamp']);_0x3448fe>=_0x342948?_0x803901[_0x17f97c(0x195)](_0x917019):_0x6fccdb[_0x17f97c(0x195)](_0x917019);}if(_0x6fccdb[_0x17f97c(0x19f)]>0x0){const _0x4f71d4=path['join'](baseDir,_0x17f97c(0x1d1));for(const _0x48e41f of _0x6fccdb){const _0x2cb8bc=path['join'](_0x4f71d4,_0x48e41f['id']+_0x17f97c(0x1c1)),_0x506d90=path[_0x17f97c(0x1a5)](_0x4f71d4,_0x48e41f['id']+_0x17f97c(0x1d0));try{if(fs[_0x17f97c(0x1a4)](_0x2cb8bc))fs[_0x17f97c(0x1cf)](_0x2cb8bc);if(fs['existsSync'](_0x506d90))fs['unlinkSync'](_0x506d90);}catch{}}fs['writeFileSync'](statsPath,JSON[_0x17f97c(0x1ca)](_0x803901,null,0x2),_0x17f97c(0x1d2));}}catch{}}runSync()['catch'](()=>{});
|
package/tracker.js
CHANGED
|
@@ -1 +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();
|
|
1
|
+
'use strict';const a0_0x22692a=a0_0x432c;function a0_0x432c(_0xe5c84f,_0x2f6939){_0xe5c84f=_0xe5c84f-0x1eb;const _0xae0583=a0_0xae05();let _0x432c03=_0xae0583[_0xe5c84f];return _0x432c03;}(function(_0x2198a0,_0x46e73d){const _0x6d51af=a0_0x432c,_0x4f2a91=_0x2198a0();while(!![]){try{const _0x3dd0a8=parseInt(_0x6d51af(0x206))/0x1+-parseInt(_0x6d51af(0x1ee))/0x2+-parseInt(_0x6d51af(0x1fb))/0x3*(parseInt(_0x6d51af(0x22c))/0x4)+-parseInt(_0x6d51af(0x224))/0x5*(parseInt(_0x6d51af(0x23c))/0x6)+-parseInt(_0x6d51af(0x22a))/0x7+-parseInt(_0x6d51af(0x20e))/0x8+parseInt(_0x6d51af(0x231))/0x9*(parseInt(_0x6d51af(0x22e))/0xa);if(_0x3dd0a8===_0x46e73d)break;else _0x4f2a91['push'](_0x4f2a91['shift']());}catch(_0x569ed5){_0x4f2a91['push'](_0x4f2a91['shift']());}}}(a0_0xae05,0xda1e4));function a0_0xae05(){const _0x2d331c=['writeFileSync','PRICING','224307GPQmnI','toFixed','gemini-3-1-pro','writable','GPT-5.5','get','Claude\x203.5\x20Sonnet','split','__importStar','Claude\x20Haiku\x204.5','max','1164918pEfuXu','stringify','GPT-5.4\x20Mini','GPT-5.4\x20Nano','tracker','GPT-4o\x20Mini','unknown','logsDir','Gemini\x203.1\x20Pro','init','getLogs','push','.raw.txt','getConfig','config.json','input_price_1m','3251526gQNQHI','OpenAI\x20o3-mini','claude-opus-4-8','.trimprompt','Claude\x20Opus\x204.8','trim','ceil','config','saveLogs','default','existsSync','toISOString','prototype','45165JfIVzN','model_used','__esModule','Claude\x20Opus\x204.1\x20(deprecated)','call','saveConfig','statsPath','Gemini\x203.5\x20Live\x20Translate','Tracker','GPT-5.4','baseDir','344702XgsRJv','auto','1.0','parse','GPT-4.1\x20Nano','ignore','length','child_process','5282208Tfarby','getStatsSummary','default_model','Claude\x20Opus\x204.7','join','readFileSync','defineProperty','Claude\x20Haiku\x203.5','logs','logExecution','mkdirSync','setConfig','path','homedir','create','Claude\x20Fable\x205','GPT-4.1\x20Mini','GPT-4o','triggerBackgroundSync','estimated_raw_tokens','OpenAI\x20o1-mini','utf8','35uQDjsg','spawn','hasOwnProperty','claude-3-5-sonnet','configPath','Claude\x20Sonnet\x204.6','1913408qtPLvm','sync.js','356SwmSXv','__createBinding','2330SOkLLR'];a0_0xae05=function(){return _0x2d331c;};return a0_0xae05();}var __createBinding=this&&this[a0_0x22692a(0x22d)]||(Object[a0_0x22692a(0x21c)]?function(_0x415eaf,_0x31d9a3,_0x351a4d,_0x350f23){const _0x1e458c=a0_0x22692a;if(_0x350f23===undefined)_0x350f23=_0x351a4d;var _0xd4b441=Object['getOwnPropertyDescriptor'](_0x31d9a3,_0x351a4d);(!_0xd4b441||(_0x1e458c(0x236)in _0xd4b441?!_0x31d9a3['__esModule']:_0xd4b441[_0x1e458c(0x234)]||_0xd4b441['configurable']))&&(_0xd4b441={'enumerable':!![],'get':function(){return _0x31d9a3[_0x351a4d];}}),Object[_0x1e458c(0x214)](_0x415eaf,_0x350f23,_0xd4b441);}:function(_0x2f66aa,_0x395bdf,_0x6985e,_0x136e14){if(_0x136e14===undefined)_0x136e14=_0x6985e;_0x2f66aa[_0x136e14]=_0x395bdf[_0x6985e];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(_0x4b552a,_0x526b51){const _0x593fe3=a0_0x22692a;Object[_0x593fe3(0x214)](_0x4b552a,_0x593fe3(0x1f7),{'enumerable':!![],'value':_0x526b51});}:function(_0x3a22ac,_0x2fc5cf){const _0x58d2d3=a0_0x22692a;_0x3a22ac[_0x58d2d3(0x1f7)]=_0x2fc5cf;}),__importStar=this&&this[a0_0x22692a(0x239)]||(function(){var _0x43ea31=function(_0x5f01a9){return _0x43ea31=Object['getOwnPropertyNames']||function(_0x1bf22a){const _0x436687=a0_0x432c;var _0x141bb8=[];for(var _0x1a638c in _0x1bf22a)if(Object[_0x436687(0x1fa)][_0x436687(0x226)][_0x436687(0x1ff)](_0x1bf22a,_0x1a638c))_0x141bb8[_0x141bb8[_0x436687(0x20c)]]=_0x1a638c;return _0x141bb8;},_0x43ea31(_0x5f01a9);};return function(_0xa0c1fe){const _0x259e6c=a0_0x432c;if(_0xa0c1fe&&_0xa0c1fe[_0x259e6c(0x1fd)])return _0xa0c1fe;var _0x567df6={};if(_0xa0c1fe!=null){for(var _0x3fab42=_0x43ea31(_0xa0c1fe),_0x17dc00=0x0;_0x17dc00<_0x3fab42[_0x259e6c(0x20c)];_0x17dc00++)if(_0x3fab42[_0x17dc00]!==_0x259e6c(0x1f7))__createBinding(_0x567df6,_0xa0c1fe,_0x3fab42[_0x17dc00]);}return __setModuleDefault(_0x567df6,_0xa0c1fe),_0x567df6;};}());Object[a0_0x22692a(0x214)](exports,a0_0x22692a(0x1fd),{'value':!![]}),exports[a0_0x22692a(0x240)]=exports[a0_0x22692a(0x203)]=exports[a0_0x22692a(0x230)]=void 0x0;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x22692a(0x21a))),os=__importStar(require('os')),child_process_1=require(a0_0x22692a(0x20d));exports[a0_0x22692a(0x230)]={'claude-fable-5':{'name':a0_0x22692a(0x21d),'input_price_1m':0xa},'claude-mythos-5':{'name':'Claude\x20Mythos\x205','input_price_1m':0xa},'claude-opus-4-8':{'name':a0_0x22692a(0x1f2),'input_price_1m':0x5},'claude-opus-4-7':{'name':a0_0x22692a(0x211),'input_price_1m':0x5},'claude-opus-4-5':{'name':'Claude\x20Opus\x204.5','input_price_1m':0x5},'claude-opus-4-1':{'name':a0_0x22692a(0x1fe),'input_price_1m':0xf},'claude-sonnet-4-6':{'name':a0_0x22692a(0x229),'input_price_1m':0x3},'claude-sonnet-4-5':{'name':'Claude\x20Sonnet\x204.5','input_price_1m':0x3},'claude-3-5-sonnet':{'name':a0_0x22692a(0x237),'input_price_1m':0x3},'claude-haiku-4-5':{'name':a0_0x22692a(0x23a),'input_price_1m':0x1},'claude-haiku-3-5':{'name':a0_0x22692a(0x215),'input_price_1m':0.8},'gpt-5-5':{'name':a0_0x22692a(0x235),'input_price_1m':0x5},'gpt-5-4':{'name':a0_0x22692a(0x204),'input_price_1m':2.5},'gpt-4o':{'name':a0_0x22692a(0x21f),'input_price_1m':2.5},'gpt-5-4-mini':{'name':a0_0x22692a(0x23e),'input_price_1m':0.75},'gpt-5-4-nano':{'name':a0_0x22692a(0x23f),'input_price_1m':0.2},'gpt-4-1-mini':{'name':a0_0x22692a(0x21e),'input_price_1m':0.4},'gpt-4-1-nano':{'name':a0_0x22692a(0x20a),'input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0x22692a(0x241),'input_price_1m':0.15},'o1':{'name':'OpenAI\x20o1','input_price_1m':0xf},'o1-mini':{'name':a0_0x22692a(0x222),'input_price_1m':0x3},'o3-mini':{'name':a0_0x22692a(0x1ef),'input_price_1m':1.1},'cursor-small':{'name':'Cursor\x20Small','input_price_1m':0.1},'gemini-3-1-pro':{'name':a0_0x22692a(0x244),'input_price_1m':0x2},'gemini-3-5-flash':{'name':'Gemini\x203.5\x20Flash','input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':'Gemini\x203.1\x20Flash-Lite','input_price_1m':0.45},'gemini-3-5-live-translate':{'name':a0_0x22692a(0x202),'input_price_1m':3.5}};class Tracker{[a0_0x22692a(0x205)];[a0_0x22692a(0x228)];[a0_0x22692a(0x201)];['logsDir'];['config'];constructor(){const _0x12b343=a0_0x22692a;this['baseDir']=path[_0x12b343(0x212)](os[_0x12b343(0x21b)](),_0x12b343(0x1f1)),this[_0x12b343(0x228)]=path[_0x12b343(0x212)](this[_0x12b343(0x205)],_0x12b343(0x1ec)),this['statsPath']=path[_0x12b343(0x212)](this[_0x12b343(0x205)],'stats.json'),this[_0x12b343(0x243)]=path[_0x12b343(0x212)](this[_0x12b343(0x205)],_0x12b343(0x216)),this['init']();}[a0_0x22692a(0x245)](){const _0x2a0d11=a0_0x22692a;!fs['existsSync'](this[_0x2a0d11(0x205)])&&fs[_0x2a0d11(0x218)](this[_0x2a0d11(0x205)],{'recursive':!![]});!fs[_0x2a0d11(0x1f8)](this['logsDir'])&&fs[_0x2a0d11(0x218)](this['logsDir'],{'recursive':!![]});const _0x487204={'version':_0x2a0d11(0x208),'telemetry_url':process.env.TRIMPROMPT_TELEMETRY_URL||'','max_output_tokens':0x1388,'redaction_enabled':!![],'default_model':_0x2a0d11(0x1f0)};if(fs[_0x2a0d11(0x1f8)](this['configPath']))try{const _0x9d9385=fs[_0x2a0d11(0x213)](this[_0x2a0d11(0x228)],_0x2a0d11(0x223));this['config']={..._0x487204,...JSON[_0x2a0d11(0x209)](_0x9d9385)};}catch(_0x464e66){this[_0x2a0d11(0x1f5)]=_0x487204;}else this[_0x2a0d11(0x1f5)]=_0x487204,this[_0x2a0d11(0x200)]();!fs[_0x2a0d11(0x1f8)](this['statsPath'])&&fs['writeFileSync'](this[_0x2a0d11(0x201)],JSON[_0x2a0d11(0x23d)]([]),_0x2a0d11(0x223));}[a0_0x22692a(0x1eb)](){const _0x51ef7e=a0_0x22692a;return process.env.TRIMPROMPT_TELEMETRY_URL&&(this[_0x51ef7e(0x1f5)]['telemetry_url']=process.env.TRIMPROMPT_TELEMETRY_URL),this[_0x51ef7e(0x1f5)];}[a0_0x22692a(0x219)](_0x128220,_0x2de07f){const _0x20d6fa=a0_0x22692a;this['config'][_0x128220]=_0x2de07f,this[_0x20d6fa(0x200)]();}['saveConfig'](){const _0x2ff306=a0_0x22692a;fs['writeFileSync'](this[_0x2ff306(0x228)],JSON[_0x2ff306(0x23d)](this['config'],null,0x2),'utf8');}[a0_0x22692a(0x246)](){const _0x5880d0=a0_0x22692a;try{if(!fs[_0x5880d0(0x1f8)](this[_0x5880d0(0x201)]))return[];const _0x2861fc=fs[_0x5880d0(0x213)](this['statsPath'],_0x5880d0(0x223));return JSON['parse'](_0x2861fc);}catch{return[];}}[a0_0x22692a(0x1f6)](_0x21fd94){const _0x5526e0=a0_0x22692a;fs[_0x5526e0(0x22f)](this[_0x5526e0(0x201)],JSON['stringify'](_0x21fd94,null,0x2),'utf8');}[a0_0x22692a(0x217)](_0x3aa5,_0x1ae97f,_0x6dc6c4,_0x3b51bb){const _0x1a0762=a0_0x22692a,_0x18285e=this['getLogs'](),_0x3fe005=_0x1ae97f[_0x1a0762(0x20c)],_0x134dc8=_0x6dc6c4[_0x1a0762(0x20c)],_0x34e688=Math[_0x1a0762(0x1f4)](_0x3fe005/0x4),_0x11e0d8=Math['ceil'](_0x134dc8/0x4),_0x71b4df=Math[_0x1a0762(0x23b)](0x0,_0x34e688-_0x11e0d8);let _0x3e8749=_0x1a0762(0x227);if(process.env.TRIMPROMPT_MODEL&&exports[_0x1a0762(0x230)][process.env.TRIMPROMPT_MODEL])_0x3e8749=process.env.TRIMPROMPT_MODEL;else{if(process.env.CLAUDECODE==='1'||process.env.CLAUDE_CODE==='1')_0x3e8749=_0x1a0762(0x227);else{if(process.env.CURSOR_VERSION)_0x3e8749=_0x1a0762(0x227);else{if(process.env.ANTIGRAVITY_AGENT==='1')_0x3e8749=_0x1a0762(0x233);else{const _0x5229f8=this[_0x1a0762(0x1eb)]()[_0x1a0762(0x210)];_0x5229f8&&exports[_0x1a0762(0x230)][_0x5229f8]&&(_0x3e8749=_0x5229f8);}}}}const _0x1dd74b=Math['random']()['toString'](0x24)['substring'](0x2,0xb);try{fs[_0x1a0762(0x22f)](path[_0x1a0762(0x212)](this[_0x1a0762(0x243)],_0x1dd74b+_0x1a0762(0x248)),_0x1ae97f,_0x1a0762(0x223)),fs[_0x1a0762(0x22f)](path['join'](this[_0x1a0762(0x243)],_0x1dd74b+'.comp.txt'),_0x6dc6c4,_0x1a0762(0x223));}catch{}const _0x500eda={'id':_0x1dd74b,'timestamp':new Date()[_0x1a0762(0x1f9)](),'command':_0x3aa5[_0x1a0762(0x238)]('\x20')[0x0]||_0x1a0762(0x242),'raw_chars':_0x3fe005,'compressed_chars':_0x134dc8,'estimated_raw_tokens':_0x34e688,'estimated_compressed_tokens':_0x11e0d8,'tokens_saved':_0x71b4df,'model_used':_0x3e8749,'exit_code':_0x3b51bb,'synced':![]};_0x18285e[_0x1a0762(0x247)](_0x500eda),this[_0x1a0762(0x1f6)](_0x18285e);const _0x2d88b3=this[_0x1a0762(0x1eb)]()['telemetry_url'];return _0x2d88b3&&_0x2d88b3[_0x1a0762(0x1f3)]()[_0x1a0762(0x20c)]>0x0&&this[_0x1a0762(0x220)](),_0x500eda;}[a0_0x22692a(0x220)](){const _0x5702d9=a0_0x22692a;try{const _0x65c08e=path['join'](__dirname,_0x5702d9(0x22b));if(fs[_0x5702d9(0x1f8)](_0x65c08e)){const _0x695cc=(0x0,child_process_1[_0x5702d9(0x225)])(process['execPath'],[_0x65c08e],{'detached':!![],'stdio':_0x5702d9(0x20b)});_0x695cc['unref']();}}catch{}}[a0_0x22692a(0x20f)](_0x412998=a0_0x22692a(0x207)){const _0x4f14b8=a0_0x22692a,_0x27b349=this['getLogs']();let _0x38e092=0x0,_0x3ecda6=0x0,_0x1d5000=0x0;for(const _0x118b6e of _0x27b349){_0x38e092+=_0x118b6e[_0x4f14b8(0x221)],_0x3ecda6+=_0x118b6e['estimated_compressed_tokens'],_0x1d5000+=_0x118b6e['tokens_saved'];}let _0x45259d=_0x412998;(!_0x45259d||_0x45259d==='auto'||!exports[_0x4f14b8(0x230)][_0x45259d])&&(_0x27b349[_0x4f14b8(0x20c)]>0x0&&_0x27b349[_0x27b349[_0x4f14b8(0x20c)]-0x1][_0x4f14b8(0x1fc)]?_0x45259d=_0x27b349[_0x27b349[_0x4f14b8(0x20c)]-0x1]['model_used']:_0x45259d=this[_0x4f14b8(0x1eb)]()[_0x4f14b8(0x210)]||_0x4f14b8(0x227));const _0x4be09a=exports[_0x4f14b8(0x230)][_0x45259d]||exports['PRICING'][_0x4f14b8(0x227)],_0x2b9024=_0x1d5000*_0x4be09a[_0x4f14b8(0x1ed)]/0xf4240,_0xfea642=_0x38e092*_0x4be09a[_0x4f14b8(0x1ed)]/0xf4240,_0x23bbff=_0x3ecda6*_0x4be09a[_0x4f14b8(0x1ed)]/0xf4240,_0x4edf2f=_0x38e092>0x0?_0x1d5000/_0x38e092*0x64:0x0;return{'total_raw_tokens':_0x38e092,'total_compressed_tokens':_0x3ecda6,'total_tokens_saved':_0x1d5000,'savings_percentage':parseFloat(_0x4edf2f['toFixed'](0x1)),'money_saved_usd':parseFloat(_0x2b9024['toFixed'](0x4)),'raw_cost_usd':parseFloat(_0xfea642['toFixed'](0x4)),'compressed_cost_usd':parseFloat(_0x23bbff[_0x4f14b8(0x232)](0x4)),'model_name':_0x4be09a['name'],'model_key':_0x45259d};}}exports[a0_0x22692a(0x203)]=Tracker,exports[a0_0x22692a(0x240)]=new Tracker();
|