omnitrix 0.7.0 → 0.7.1

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 CHANGED
@@ -90,6 +90,24 @@ shasum -a 256 omnitrix.tgz
90
90
 
91
91
  The first command is for Windows and the second for macOS and Linux. The value it prints must match the one in `omnitrix.tgz.sha256`. Then install the file you checked with `npm install -g ./omnitrix.tgz`.
92
92
 
93
+ ### In other MCP apps
94
+
95
+ omnitrix is an ordinary MCP server, so other apps that run local MCP servers can use it as well. `omnitrix mcp-config` prints the entry to add, with the full paths of Node.js and omnitrix on your computer, so the app needs neither your PATH nor the npm command shim. On a Mac with Node.js from nodejs.org, it looks like this:
96
+
97
+ ```json
98
+ {
99
+ "mcpServers": {
100
+ "omnitrix": {
101
+ "type": "stdio",
102
+ "command": "/usr/local/bin/node",
103
+ "args": ["/usr/local/lib/node_modules/omnitrix/dist/cli.js", "mcp"]
104
+ }
105
+ }
106
+ }
107
+ ```
108
+
109
+ Cursor reads this entry from `~/.cursor/mcp.json`, or from `.cursor/mcp.json` inside a project. The GitHub Copilot agent in VS Code reads the same shape from `~/.copilot/mcp-config.json`, while the older `.vscode/mcp.json` file uses the key `servers` instead of `mcpServers`. Other apps keep the file elsewhere, so check their MCP documentation. These apps have not been tested yet; only Claude Code and T3 Code have. In another app, its own model takes Claude's place as the lead, and the figures for Claude's own limit are not available, because they come from the Claude Code status line.
110
+
93
111
  ## Quick start
94
112
 
95
113
  ```bash
@@ -190,7 +208,7 @@ omnitrix 5/6 ready · codex-main 38% · deepseek 788 left · kimi wait · groq-f
190
208
 
191
209
  Account percentages show the share remaining, and the Claude figures show the share used.
192
210
 
193
- The status line also saves the Claude figures, so `pool_status` can show Claude how much of its own limit is used and when each window resets. When 70% or more of a window is used, `pool_status` asks Claude to delegate more and read less itself. The figures come only from the status line, so they appear once a Claude Code session with the omnitrix status line has run, and `pool_status` marks them as old after 15 minutes without an update.
211
+ The status line also saves the Claude figures, so `pool_status` can show Claude how much of its own limit is used and when each window resets. The dashboard shows them on a card of their own, next to the other accounts. When 70% or more of a window is used, `pool_status` asks Claude to delegate more and read less itself. The figures come only from the status line, so they appear once a Claude Code session with the omnitrix status line has run, and `pool_status` marks them as old after 15 minutes without an update.
194
212
 
195
213
  Most subscriptions neither publish exact limits nor provide a way to query the remaining allowance, so omnitrix states the source of each figure. For a ChatGPT plan, it queries Codex directly and shows the percentage remaining in each window that Codex reports, usually 5 hours and 7 days, along with the time each window resets. This query ignores any API key exported in your environment, so the figures always belong to the account's own plan. When a provider sends rate-limit headers, omnitrix reports the remaining requests in the status line and in `pool_status`. In all other cases, it counts the requests and tokens it has sent against the limits you configured. A `402` response, or a `429` response that mentions quota or billing, marks the account as out of quota until the provider's reset time, or for one hour when the provider gives no time. Any other `429` pauses the account until the time in `Retry-After`, or for 60 seconds, and a `429` that reports `limit: 0` pauses only that model, for 24 hours. These waits never exceed 24 hours, whatever the count shows.
196
214
 
@@ -326,6 +344,7 @@ omnitrix run <prompt> run one task and print the answer (--type, --pri
326
344
  omnitrix settings set the mode, private protection, pins, bans, the job time limit and the preview length
327
345
  omnitrix dashboard open the live dashboard on 127.0.0.1:4590, which runs in the background (--stop, --port, --no-open, --serve)
328
346
  omnitrix setup-claude register with Claude Code (--scope user|project|local, --no-statusline, --dry-run)
347
+ omnitrix mcp-config print the MCP server entry for other apps, such as Cursor or VS Code
329
348
  omnitrix team join, review or leave a team file, and show your spending (join --as, --yes; leave; status)
330
349
  omnitrix usage requests, tokens and cost for the last 30 days (--by person|account|model, --days, --team)
331
350
  omnitrix lockcheck [files] show which packages a regenerated lockfile added, changed or removed (--base, --repo, --json)
package/dist/cli.js CHANGED
@@ -856,6 +856,14 @@ program
856
856
  }
857
857
  console.log('\nCosts are those reported by the provider, or estimated from model prices where they are known.');
858
858
  });
859
+ program
860
+ .command('mcp-config')
861
+ .description('print the MCP server entry for other apps, such as Cursor or VS Code, with the paths on this computer')
862
+ .action(() => {
863
+ // the full paths of node and of this file, so the app needs neither PATH nor the npm shim
864
+ const entry = { type: 'stdio', command: process.execPath, args: [fileURLToPath(import.meta.url), 'mcp'] };
865
+ console.log(JSON.stringify({ mcpServers: { omnitrix: entry } }, null, 2));
866
+ });
859
867
  program
860
868
  .command('setup-claude')
861
869
  .description('register omnitrix in Claude Code and add the status line')
package/dist/dashboard.js CHANGED
@@ -8,6 +8,7 @@ import { refreshQuotas } from './quota.js';
8
8
  import { ensureHome, homeDir, writeJson } from './store.js';
9
9
  import { verifySummary } from './verify.js';
10
10
  import { ICON_SVG } from './icon.js';
11
+ import { leadOut, loadLeadQuota } from './lead.js';
11
12
  import { VERSION } from './version.js';
12
13
  /** The newest jobs for the page. A second check is shown on the job it checks, not as a job of its own. */
13
14
  export function recentJobs(engine, limit = 30) {
@@ -48,7 +49,7 @@ export function startDashboard(port) {
48
49
  let latest = '';
49
50
  let slowAt = 0;
50
51
  let openedAt = 0;
51
- const snapshot = () => JSON.stringify({ version: VERSION, accounts: engine.pool(), jobs: recentJobs(engine), delegated: engine.delegated(7) });
52
+ const snapshot = () => JSON.stringify({ version: VERSION, accounts: engine.pool(), jobs: recentJobs(engine), delegated: engine.delegated(7), lead: leadOut(loadLeadQuota()) });
52
53
  // Quota reads and local server probes run in the background and are throttled; the page never waits for them.
53
54
  const slowChecks = () => {
54
55
  if (Date.now() - slowAt < SLOW_MS)
@@ -135,7 +136,7 @@ export function startDashboard(port) {
135
136
  }
136
137
  if (req.url === '/api/status') {
137
138
  slowChecks();
138
- json(res, { version: VERSION, now: Date.now(), accounts: engine.pool(), jobs: recentJobs(engine), delegated: engine.delegated(7) });
139
+ json(res, { version: VERSION, now: Date.now(), accounts: engine.pool(), jobs: recentJobs(engine), delegated: engine.delegated(7), lead: leadOut(loadLeadQuota()) });
139
140
  return;
140
141
  }
141
142
  if (req.url === '/api/ping') {
@@ -336,6 +337,7 @@ var ago=function(t){var s=Math.round((Date.now()-t)/1000);return s<60?s+' s ago'
336
337
  function icon(name){
337
338
  var p={terminal:'<rect x="3" y="4" width="18" height="16" rx="2.5"/><path d="M7 9l3 3-3 3M12 15h5"/>',
338
339
  cloud:'<path d="M7 18a4.5 4.5 0 0 1-.5-9 6 6 0 0 1 11.5 1.5A3.75 3.75 0 0 1 17.5 18z"/>',
340
+ lead:'<path d="M12 3l2.2 5.6L20 10l-5.8 1.4L12 17l-2.2-5.6L4 10l5.8-1.4z"/><path d="M18 16l.8 2.2L21 19l-2.2.8L18 22l-.8-2.2L15 19l2.2-.8z"/>',
339
341
  chip:'<rect x="6" y="6" width="12" height="12" rx="2"/><path d="M9 2v4M15 2v4M9 18v4M15 18v4M2 9h4M2 15h4M18 9h4M18 15h4"/>'}[name];
340
342
  return '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">'+p+'</svg>';
341
343
  }
@@ -386,6 +388,18 @@ function cardHtml(a,open){
386
388
  +(u.stale&&u.updatedAt?'<div class="note warn">omnitrix could not read these numbers again. They are from '+esc(clock(u.updatedAt))+' and may be out of date.</div>':'')
387
389
  +modelHtml+'</article>';
388
390
  }
391
+ // Claude itself, from the figures the Claude Code status line saved; drawn only when there are some
392
+ function leadHtml(l){
393
+ if(!l||!l.windows||!l.windows.length)return '';
394
+ var high=l.windows.some(function(w){return w.used_percent>=70});
395
+ var wins=l.windows.map(function(w){return windowHtml({name:w.name,unit:'percent',remaining:100-w.used_percent,resetsAt:w.resets_at})}).join('');
396
+ var notes=l.stale?'<div class="note warn">These figures are from '+esc(clock(l.seen_at))+'. They update only while a Claude Code session is open, so they may be out of date.</div>':'';
397
+ if(high)notes+='<div class="note warn">'+(l.stale?'Claude was running low when last seen.':'Claude is running low.')+' omnitrix asks it to hand more work to the other accounts.</div>';
398
+ return '<article class="card" aria-label="Claude, the lead">'
399
+ +'<div class="head"><div class="title">'+icon('lead')+'<div><h3>Claude</h3><div class="sub">The lead: plans the work and checks every result</div></div></div><span class="state s-busy"><i aria-hidden="true"></i>Lead</span></div>'
400
+ +'<div>'+wins+'</div>'+notes
401
+ +'<div class="stats"><span class="prov">From the Claude Code status line'+(l.stale?'':', updated '+esc(ago(l.seen_at)))+'</span></div></article>';
402
+ }
389
403
  var JOB={done:['Done','s-ok'],running:['Running','s-busy'],queued:['Waiting','s-idle'],failed:['Failed','s-bad'],cancelled:['Cancelled','s-idle']};
390
404
  function jobHtml(j,open){
391
405
  var st=JOB[j.status]||[j.status,'s-idle'];
@@ -435,8 +449,8 @@ function draw(d){
435
449
  +(function(g){g=g||{jobs:0,tokens:0,accepted:0};return '<div class="kpi"><span>Done by other accounts, 7 days</span><b>'+g.jobs+' job'+(g.jobs===1?'':'s')+'</b><small>'+esc(fmt(g.tokens))+' tokens'+(g.accepted?', '+g.accepted+' accepted':'')+'</small></div>'})(d.delegated)
436
450
  +'<div class="kpi"><span>Known cost, last 24 h</span><b>'+esc(money(sum('costToday')))+'</b></div>';
437
451
  document.getElementById('acc-sub').textContent=acc.length?acc.length+' connected':'';
438
- document.getElementById('accounts').innerHTML=acc.length?acc.map(function(a){return cardHtml(a,open)}).join('')
439
- :'<div class="empty"><h3>Connect your first account</h3>omnitrix has no accounts yet. In a terminal:<ol><li><code>omnitrix init --apply</code> connects the AI tools, API keys and local models it finds on this PC</li><li><code>omnitrix providers</code> lists what you can connect</li><li><code>omnitrix add ollama</code> adds models on this PC</li><li><code>omnitrix setup-claude</code> connects omnitrix to Claude Code</li></ol></div>';
452
+ document.getElementById('accounts').innerHTML=leadHtml(d.lead)+(acc.length?acc.map(function(a){return cardHtml(a,open)}).join('')
453
+ :'<div class="empty"><h3>Connect your first account</h3>omnitrix has no accounts yet. In a terminal:<ol><li><code>omnitrix init --apply</code> connects the AI tools, API keys and local models it finds on this PC</li><li><code>omnitrix providers</code> lists what you can connect</li><li><code>omnitrix add ollama</code> adds models on this PC</li><li><code>omnitrix setup-claude</code> connects omnitrix to Claude Code</li></ol></div>');
440
454
  document.getElementById('jobs').innerHTML=d.jobs.length?'<ul class="jobs">'+d.jobs.map(function(j){return jobHtml(j,open)}).join('')+'</ul>'
441
455
  :'<div class="empty"><h3>No jobs yet</h3>Ask Claude to hand out a task, and it shows up here.</div>';
442
456
  if(focusKey){var again=document.querySelector('details[data-key="'+focusKey+'"] summary');if(again)again.focus({preventScroll:true})}
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.7.0';
1
+ export const VERSION = '0.7.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnitrix",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Delegate tasks from Claude Code to the AI accounts you already pay for. Claude plans the work, and omnitrix routes each task to Codex, Gemini, DeepSeek, Kimi, GLM, a local model or any OpenAI- or Anthropic-compatible API while tracking each account's usage.",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {