claude-terminal-prism 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,9 +1,54 @@
1
1
  # claude-terminal-prism
2
2
 
3
+ ```
4
+ ██████╗ ██████╗ ██╗███████╗███╗ ███╗
5
+ ██╔══██╗██╔══██╗██║██╔════╝████╗ ████║
6
+ ██████╔╝██████╔╝██║███████╗██╔████╔██║
7
+ ██╔═══╝ ██╔══██╗██║╚════██║██║╚██╔╝██║
8
+ ██║ ██║ ██║██║███████║██║ ╚═╝ ██║
9
+ ╚═╝ ╚═╝ ╚═╝╚═╝╚══════╝╚═╝ ╚═╝
10
+ ```
11
+
3
12
  **PRISM** — Agentic visibility layer for Claude. Intercept, record, and debug multi-agent sessions in a real-time dashboard.
4
13
 
5
14
  ---
6
15
 
16
+ ## What's new in 1.1.0
17
+
18
+ - **Cost dedup** — `parseTranscript` now collapses duplicate turn entries (same token tuple within 30s) that Claude Code writes under distinct UUIDs during tool-use round-trips and `--resume` replays. Previously these inflated session cost by ~30%.
19
+ - **Opus 4.7 pricing** — Added to the pricing table. Prior releases fell back to Sonnet rates, undercounting Opus cost by ~5×.
20
+ - **Session totals are event-sourced** — Top-bar and Cost Analytics now SUM per-turn `cost.update` events instead of relying on a stale `sessions.total_cost` column.
21
+ - **Idempotent ingest** — `insertEvent` uses `INSERT OR IGNORE` and returns a boolean; session mutations only fire on real inserts, so collector restarts no longer double-count.
22
+
23
+ ### Upgrade from v1.0.x (existing data)
24
+
25
+ v1.1.0 changes how cost is aggregated. Sessions recorded with v1.0.x will show **inflated costs** (2-3×) in the dashboard unless you reset or migrate your database.
26
+
27
+ **Option A — wipe (recommended, loses session history):**
28
+
29
+ ```bash
30
+ npm update -g claude-terminal-prism
31
+ prism reset-db --restart
32
+ ```
33
+
34
+ **Option B — migrate (keeps history, surgically fixes cost data):**
35
+
36
+ ```bash
37
+ npm update -g claude-terminal-prism
38
+ prism reset-db --migrate --restart
39
+ ```
40
+
41
+ `--migrate` requires Node.js 22.5+. It removes duplicate hook cost events from v1.0.x so that SUM-ing them gives the correct session total. New sessions recorded after the upgrade are unaffected regardless of which option you choose.
42
+
43
+ ### Fresh install / already on v1.1.0
44
+
45
+ ```bash
46
+ npm update -g claude-terminal-prism
47
+ prism stop && prism start
48
+ ```
49
+
50
+ ---
51
+
7
52
  ## Install
8
53
 
9
54
  ```bash
@@ -12,18 +57,16 @@ npm install -g claude-terminal-prism
12
57
 
13
58
  ---
14
59
 
15
- ## Getting started — two commands
60
+ ## Setup
16
61
 
17
62
  ```bash
18
63
  prism setup
19
64
  source ~/.zshrc
20
65
  ```
21
66
 
22
- `prism setup` starts the collector + dashboard daemon, adds a shell alias so every `claude` session is auto-captured, and opens the browser at `http://localhost:4700`.
23
-
24
- ---
67
+ `prism setup` starts the collector + dashboard daemon, adds a shell alias so every `claude` session is auto-captured, and opens the browser at **http://localhost:4700**.
25
68
 
26
- ## Global setup (all Claude sessions on this machine)
69
+ For more control, run the steps individually:
27
70
 
28
71
  ```bash
29
72
  prism start # Start collector + dashboard → http://localhost:4700
@@ -45,10 +88,11 @@ prism uninit # Remove shell integration and hooks
45
88
  prism start [--port N] [--no-open] # Start collector + dashboard daemon
46
89
  prism stop # Stop the daemon
47
90
  prism status # Show running state
48
- prism init # Global: shell integration + hooks
49
- prism init --local [--port N] # Local: project hooks only (default port: 4701)
50
- prism uninit # Remove global shell integration
51
- prism uninit --local # Remove local project hooks
91
+ prism init # Add shell integration + Claude Code hooks
92
+ prism uninit # Remove shell integration and hooks
93
+ prism reset-db # Wipe local database (v1.0.x upgrade fix)
94
+ prism reset-db --migrate # Surgical fix keep history, dedupe cost events
95
+ prism reset-db --restart # Wipe + restart in one step
52
96
  prism tui # Inline terminal dashboard
53
97
  prism exec <cmd> # Run a command with full capture
54
98
  prism shell # Spawn a captured interactive shell