tokentracker-cli 0.5.100 → 0.5.101

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.
@@ -135,7 +135,7 @@
135
135
  ]
136
136
  }
137
137
  </script>
138
- <script type="module" crossorigin src="/assets/main-BYMjcXxR.js"></script>
138
+ <script type="module" crossorigin src="/assets/main-Cqn4mbzU.js"></script>
139
139
  <link rel="stylesheet" crossorigin href="/assets/main-HLMqEvtH.css">
140
140
  </head>
141
141
  <body>
@@ -51,7 +51,7 @@
51
51
  "description": "Shareable Token Tracker dashboard snapshot."
52
52
  }
53
53
  </script>
54
- <script type="module" crossorigin src="/assets/main-BYMjcXxR.js"></script>
54
+ <script type="module" crossorigin src="/assets/main-Cqn4mbzU.js"></script>
55
55
  <link rel="stylesheet" crossorigin href="/assets/main-HLMqEvtH.css">
56
56
  </head>
57
57
  <body>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tokentracker-cli",
3
- "version": "0.5.100",
4
- "description": "Token usage tracker for AI agent CLIs (Claude Code, Codex, Cursor, Gemini, Kiro, OpenCode, OpenClaw, Every Code, Hermes, GitHub Copilot, Kimi Code, CodeBuddy, oh-my-pi)",
3
+ "version": "0.5.101",
4
+ "description": "Token usage tracker for AI agent CLIs (Claude Code, Codex, Cursor, Gemini, Kiro, OpenCode, OpenClaw, Every Code, Hermes, GitHub Copilot, Kimi Code, CodeBuddy, oh-my-pi, Craft Agents)",
5
5
  "main": "src/cli.js",
6
6
  "bin": {
7
7
  "tokentracker-cli": "bin/tracker.js",
@@ -437,6 +437,16 @@ async function applyIntegrationSetup({ home, trackerDir, notifyPath, notifyOrigi
437
437
  }
438
438
  }
439
439
 
440
+ // Craft Agents: passive reader — no hook installation needed.
441
+ // TokenTracker reads ~/.craft-agent/workspaces/<id>/sessions/**/session.jsonl
442
+ // (and any user-relocated workspace listed in ~/.craft-agent/config.json).
443
+ {
444
+ const craftConfigDir = process.env.CRAFT_CONFIG_DIR || path.join(home, ".craft-agent");
445
+ if (fssync.existsSync(craftConfigDir)) {
446
+ summary.push({ label: "Craft Agents", status: "detected", detail: "Passive reader (no hook needed)" });
447
+ }
448
+ }
449
+
440
450
  // CodeBuddy: Claude-Code fork. Install the SessionEnd hook so finished
441
451
  // sessions trigger notify.cjs → tracker sync; passive scan still runs as a
442
452
  // safety net for sessions that don't fire SessionEnd cleanly.
@@ -41,6 +41,8 @@ const {
41
41
  resolveCodebuddyProjectFiles,
42
42
  resolveOmpSessionFiles,
43
43
  resolveOmpAgentDir,
44
+ resolveCraftSessionFiles,
45
+ resolveCraftConfigDir,
44
46
  } = require("../lib/rollout");
45
47
 
46
48
  async function cmdStatus(argv = []) {
@@ -183,6 +185,11 @@ async function cmdStatus(argv = []) {
183
185
  const ompInstalled = fssync.existsSync(path.join(ompAgentDir, "sessions"));
184
186
  const ompFiles = ompInstalled ? resolveOmpSessionFiles(process.env) : [];
185
187
 
188
+ // Craft Agents — passive scan only (no hooks).
189
+ const craftConfigDir = resolveCraftConfigDir(process.env);
190
+ const craftInstalled = fssync.existsSync(craftConfigDir);
191
+ const craftFiles = craftInstalled ? resolveCraftSessionFiles(process.env) : [];
192
+
186
193
  const copilotToken = readCopilotOauthToken({ home });
187
194
  const copilotOtel = describeCopilotOtelStatus({ home, env: process.env });
188
195
  const copilotLines = formatCopilotLines({
@@ -224,6 +231,9 @@ async function cmdStatus(argv = []) {
224
231
  ompInstalled
225
232
  ? `- oh-my-pi: passive reader (${ompFiles.length} session jsonl file${ompFiles.length !== 1 ? "s" : ""} found)`
226
233
  : null,
234
+ craftInstalled
235
+ ? `- Craft Agents: passive reader (${craftFiles.length} session jsonl file${craftFiles.length !== 1 ? "s" : ""} found)`
236
+ : null,
227
237
  ...copilotLines,
228
238
  ...subscriptionLines,
229
239
  "",
@@ -29,6 +29,8 @@ const {
29
29
  parseKimiIncremental,
30
30
  resolveOmpSessionFiles,
31
31
  parseOmpIncremental,
32
+ resolveCraftSessionFiles,
33
+ parseCraftIncremental,
32
34
  resolveCodebuddyProjectFiles,
33
35
  parseCodebuddyIncremental,
34
36
  resolveKiroCliSessionFiles,
@@ -471,6 +473,28 @@ async function cmdSync(argv) {
471
473
  });
472
474
  }
473
475
 
476
+ // ── Craft Agents (passive ~/.craft-agent + workspaces session.jsonl reader) ──
477
+ let craftResult = { recordsProcessed: 0, eventsAggregated: 0, bucketsQueued: 0 };
478
+ const craftFiles = resolveCraftSessionFiles(process.env);
479
+ if (craftFiles.length > 0) {
480
+ if (progress?.enabled) {
481
+ progress.start(`Parsing Craft ${renderBar(0)} | buckets 0`);
482
+ }
483
+ craftResult = await parseCraftIncremental({
484
+ sessionFiles: craftFiles,
485
+ cursors,
486
+ queuePath,
487
+ env: process.env,
488
+ onProgress: (p) => {
489
+ if (!progress?.enabled) return;
490
+ const pct = p.total > 0 ? p.index / p.total : 1;
491
+ progress.update(
492
+ `Parsing Craft ${renderBar(pct)} ${formatNumber(p.index)}/${formatNumber(p.total)} files | buckets ${formatNumber(p.bucketsQueued)}`,
493
+ );
494
+ },
495
+ });
496
+ }
497
+
474
498
  // ── GitHub Copilot CLI (OTEL JSONL files) ──
475
499
  let copilotResult = { recordsProcessed: 0, eventsAggregated: 0, bucketsQueued: 0 };
476
500
  const copilotPaths = resolveCopilotOtelPaths(process.env);
@@ -591,6 +615,7 @@ async function cmdSync(argv) {
591
615
  kimiResult.recordsProcessed +
592
616
  codebuddyResult.recordsProcessed +
593
617
  ompResult.recordsProcessed +
618
+ craftResult.recordsProcessed +
594
619
  copilotResult.recordsProcessed;
595
620
  const totalBuckets =
596
621
  parseResult.bucketsQueued +
@@ -605,6 +630,7 @@ async function cmdSync(argv) {
605
630
  kimiResult.bucketsQueued +
606
631
  codebuddyResult.bucketsQueued +
607
632
  ompResult.bucketsQueued +
633
+ craftResult.bucketsQueued +
608
634
  copilotResult.bucketsQueued;
609
635
  process.stdout.write(
610
636
  [
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "_meta": {
3
3
  "note": "Curated price overrides. Always wins over LiteLLM. Two reasons to live here: (1) self-defined alias names that LiteLLM will never carry (kiro-*, hy3-*, composer-*, kimi-for-coding, free-tier OpenRouter routes); (2) prices we want to pin even if LiteLLM has the model (e.g. cache_write fields LiteLLM often omits). Units: USD per million tokens. Edit this file to override pricing without redeploying.",
4
- "units": "usd_per_million_tokens"
4
+ "units": "usd_per_million_tokens",
5
+ "deepseek_v4_pro_discount_expiry": "2026-05-31T15:59:00Z — DeepSeek v4-pro is currently at a 75% promotional discount. After expiry the prices revert to 4x: input $1.74/M, output $3.48/M, cache_read $0.0145/M, cache_write $1.74/M. Update this file before the cutover."
5
6
  },
6
7
  "exact": {
7
8
  "kiro-agent": { "input": 3, "output": 15, "cache_read": 0.3, "cache_write": 3.75 },
@@ -16,6 +17,8 @@
16
17
  "MiniMax-M2.7-highspeed":{ "input": 0.6, "output": 2.4, "cache_read": 0.06, "cache_write": 0.375 },
17
18
  "deepseek-v4-flash":{ "input": 0.14, "output": 0.28, "cache_read": 0.0028, "cache_write": 0.14 },
18
19
  "deepseek-v4-pro": { "input": 0.435,"output": 0.87, "cache_read": 0.003625, "cache_write": 0.435 },
20
+ "deepseek-chat": { "input": 0.14, "output": 0.28, "cache_read": 0.0028, "cache_write": 0.14 },
21
+ "deepseek-reasoner":{ "input": 0.14, "output": 0.28, "cache_read": 0.0028, "cache_write": 0.14 },
19
22
  "kimi-for-coding": { "input": 0.6, "output": 2, "cache_read": 0.15 },
20
23
  "kimi-k2.5": { "input": 0.6, "output": 2, "cache_read": 0.15 },
21
24
  "kimi-k2.5-free": { "input": 0, "output": 0, "cache_read": 0 },