@seanxdo/superview 0.1.13

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 ADDED
@@ -0,0 +1,193 @@
1
+ # SuperView
2
+
3
+ [English](README.md) | [简体中文](README.zh-CN.md)
4
+
5
+ ## Quick Start
6
+
7
+ ```bash
8
+ npx @seanxdo/superview
9
+ ```
10
+
11
+ Or install globally:
12
+
13
+ ```bash
14
+ npm install -g @seanxdo/superview
15
+ superview
16
+ ```
17
+
18
+ Then open **http://0.0.0.0:5174** and scan your agent logs.
19
+
20
+ SuperView is a local-first flight recorder for coding agents. It ingests session logs from Codex, Claude Code, and OpenCode, reconstructs every task journey, and surfaces hidden agent work — context snapshots, tool calls, cost, errors, and project telemetry — in a single dashboard.
21
+
22
+ ## Preview
23
+
24
+ <table>
25
+ <tr>
26
+ <td><img src="docs/assets/02.png" width="100%" alt="SuperView screenshot" /></td>
27
+ <td><img src="docs/assets/03.png" width="100%" alt="SuperView screenshot" /></td>
28
+ <td><img src="docs/assets/04.png" width="100%" alt="SuperView screenshot" /></td>
29
+ </tr>
30
+ <tr>
31
+ <td><img src="docs/assets/05.png" width="100%" alt="SuperView screenshot" /></td>
32
+ <td><img src="docs/assets/06.png" width="100%" alt="SuperView screenshot" /></td>
33
+ <td><img src="docs/assets/07.png" width="100%" alt="SuperView screenshot" /></td>
34
+ </tr>
35
+ </table>
36
+
37
+ ## Features
38
+
39
+ ### Session Recap
40
+
41
+ A collapsible black-box readout panel with five sections:
42
+
43
+ - **01 Readout** — Sessions, estimated cost, total tokens, tool calls, errors, most-used model, busiest day, and priciest session.
44
+ - **02 Rhythm** — Daily activity calendar heatmap, hour×weekday clock heatmap, and daily token usage chart.
45
+ - **03 Efficiency** — Cache hit rate, error rate, tokens per session, and cost per session with animated gauges.
46
+ - **04 Spend by Model** — Per-model cost breakdown with editable token pricing.
47
+ - **05 Tool Usage** — Horizontal bar chart of tool call frequency with error indicators.
48
+
49
+ ### Context Replay
50
+
51
+ A snapshot-by-snapshot walkthrough of the agent's context window:
52
+
53
+ - Numbered step rail showing phase, title, and +added/-dropped content per step.
54
+ - Auto-play mode (cycles snapshots every 2.8s).
55
+ - Context blocks grouped by state: carried forward, newly added, changed, dropped.
56
+ - Warning strip for stale context, contradictions, and missing files.
57
+ - **Factory Strip** — A full-width belt view of all snapshots with active blocks and transitions.
58
+
59
+ ### Token Timeline
60
+
61
+ A vertical bar chart of token usage per journey, segmented by input/output/cached/reasoning. Click any bar to jump to that journey. Summary bar with conversation count, total tokens, and per-type breakdown.
62
+
63
+ ### Share Card
64
+
65
+ One-click summary generation for any task journey — hero stat, skills used, verdict (cleared/failed/in-progress), token sparkline, and copy-as-Markdown support.
66
+
67
+ ### Event Tape
68
+
69
+ A horizontal mini-timeline on every journey row showing categorized events (user, assistant, tool, thinking, error) with tooltip details on hover.
70
+
71
+ ### Cost Estimation
72
+
73
+ Built-in pricing table for Claude and GPT models (June 2026 rates). All rates are editable in-place. Costs are computed from raw token usage with cache read/write multipliers. Supports per-model cost aggregation.
74
+
75
+ ### Multi-Provider Support
76
+
77
+ | Provider | Source | Default Path |
78
+ |----------|--------|--------------|
79
+ | Codex CLI | Session JSONL files | `~/.codex/sessions/**/*.jsonl` |
80
+ | Claude Code | Project JSONL files | `~/.claude/projects/**/*.jsonl` |
81
+ | OpenCode | Exported session files | Manual export |
82
+
83
+ ### Theme & Language
84
+
85
+ Four themes: Bright Command Center (default), Dark Command Center, Forest Lab, Plasma Violet. Full bilingual support: English and Simplified Chinese. Preferences persist across sessions.
86
+
87
+ ## Development
88
+
89
+ ```bash
90
+ pnpm install
91
+ pnpm dev # Start API + Vite dev server
92
+ ```
93
+
94
+ Open the app:
95
+
96
+ ```
97
+ http://127.0.0.1:5173/
98
+ ```
99
+
100
+ The API server runs at:
101
+
102
+ ```
103
+ http://127.0.0.1:5174/
104
+ ```
105
+
106
+ ### CLI Ingest
107
+
108
+ ```bash
109
+ pnpm ingest /path/to/.codex
110
+ ```
111
+
112
+ ### API Ingest
113
+
114
+ ```bash
115
+ curl -X POST http://127.0.0.1:5174/api/ingest \
116
+ -H 'Content-Type: application/json' \
117
+ -d '{"sources":[{"provider":"codex"}]}'
118
+ ```
119
+
120
+ Claude Code:
121
+
122
+ ```bash
123
+ curl -X POST http://127.0.0.1:5174/api/ingest \
124
+ -H 'Content-Type: application/json' \
125
+ -d '{"sources":[{"provider":"claude-code","root":"/path/to/.claude"}]}'
126
+ ```
127
+
128
+ OpenCode:
129
+
130
+ ```bash
131
+ curl -X POST http://127.0.0.1:5174/api/ingest \
132
+ -H 'Content-Type: application/json' \
133
+ -d '{"sources":[{"provider":"opencode","path":"/path/to/opencode-export.json"}]}'
134
+ ```
135
+
136
+ Poll job status:
137
+
138
+ ```bash
139
+ curl http://127.0.0.1:5174/api/ingest/jobs/<jobId>
140
+ ```
141
+
142
+ ### Scripts
143
+
144
+ ```bash
145
+ pnpm dev # Start API and Vite client
146
+ pnpm dev:server # Start the Express API only
147
+ pnpm dev:client # Start the Vite client only
148
+ pnpm start # Start production server (single port, serves API + UI)
149
+ pnpm build # Typecheck and build the UI
150
+ pnpm typecheck # Run TypeScript checks
151
+ pnpm test # Run Vitest tests
152
+ pnpm test:e2e # Run Playwright tests
153
+ ```
154
+
155
+ ## API Reference
156
+
157
+ | Endpoint | Method | Description |
158
+ |----------|--------|-------------|
159
+ | `/api/health` | GET | Health check |
160
+ | `/api/ingest` | POST | Start ingest job |
161
+ | `/api/ingest/jobs/:id` | GET | Poll ingest progress |
162
+ | `/api/projects` | GET | List all projects |
163
+ | `/api/projects/:id/timeline` | GET | Get project timeline |
164
+ | `/api/projects/:id/token-usage/daily` | GET | Daily token usage |
165
+ | `/api/task-journeys/:id` | GET | Journey detail |
166
+ | `/api/task-journeys/:id/context-replay` | GET | Context replay data |
167
+ | `/api/events/:id/evidence` | GET | Event evidence |
168
+ | `/api/runs/:id` | GET | Run replay |
169
+ | `/api/reset` | POST | Reset database |
170
+
171
+ ## Architecture
172
+
173
+ ```text
174
+ ui/ React + Vite dashboard
175
+ runtime-node/ Express API, ingest service, worker process, log adapters
176
+ core/ Parser, normalizer, redactor, cost engine, timeline, context replay
177
+ storage/ SQLite database layer and local data paths
178
+ ```
179
+
180
+ The ingest path is intentionally split from the API. The API creates an ingest job and returns immediately. A worker process scans and parses log files, then writes normalized data into SQLite. This keeps the dashboard responsive during large historical scans. Ingest uses single-flight behavior — if one is already active, subsequent requests return the existing job.
181
+
182
+ ## Environment Variables
183
+
184
+ ```bash
185
+ SUPERVIEW_DATA_DIR # Data directory (default: ./.superview)
186
+ SUPERVIEW_CODEX_HOME # Codex log root (default: ~/.codex)
187
+ SUPERVIEW_CLAUDE_HOME # Claude Code log root (default: ~/.claude)
188
+ SUPERVIEW_PORT # Production server port (default: 5174)
189
+ ```
190
+
191
+ ## Privacy
192
+
193
+ SuperView is local-first. No accounts, no cloud sync, no remote backend. Raw agent logs stay on your machine. Normalized records are stored in a local SQLite database. Evidence views expose only redacted payloads with source provenance (path, line, timestamp, hash) — enough for debugging, not raw dumps.
@@ -0,0 +1,193 @@
1
+ # SuperView
2
+
3
+ [English](README.md) | [简体中文](README.zh-CN.md)
4
+
5
+ ## 快速开始
6
+
7
+ ```bash
8
+ npx @seanxdo/superview
9
+ ```
10
+
11
+ 或全局安装:
12
+
13
+ ```bash
14
+ npm install -g @seanxdo/superview
15
+ superview
16
+ ```
17
+
18
+ 然后打开 **http://0.0.0.0:5174**,扫描你的 agent 日志即可。
19
+
20
+ SuperView 是一个本地优先的 coding agent 飞行记录器。它会读取 Codex、Claude Code 和 OpenCode 的 session 日志,重建每一轮任务旅程,并将隐藏的 agent 工作——上下文快照、工具调用、成本、错误和项目遥测——呈现在一个统一的仪表盘中。
21
+
22
+ ## 界面预览
23
+
24
+ <table>
25
+ <tr>
26
+ <td><img src="docs/assets/02.png" width="100%" alt="SuperView 截图" /></td>
27
+ <td><img src="docs/assets/03.png" width="100%" alt="SuperView 截图" /></td>
28
+ <td><img src="docs/assets/04.png" width="100%" alt="SuperView 截图" /></td>
29
+ </tr>
30
+ <tr>
31
+ <td><img src="docs/assets/05.png" width="100%" alt="SuperView 截图" /></td>
32
+ <td><img src="docs/assets/06.png" width="100%" alt="SuperView 截图" /></td>
33
+ <td><img src="docs/assets/07.png" width="100%" alt="SuperView 截图" /></td>
34
+ </tr>
35
+ </table>
36
+
37
+ ## 功能
38
+
39
+ ### 会话概览
40
+
41
+ 可折叠的黑匣子面板,包含五个模块:
42
+
43
+ - **01 总览** — 会话数、预估成本、Token 总量、工具调用次数、错误数、最常用模型、最忙一天和最贵项目。
44
+ - **02 节奏** — 每日活动日历热力图、小时×星期时钟热力图、每日 Token 用量图表。
45
+ - **03 效率** — 缓存命中率、错误率、每次会话 Token 数、每次会话成本,带动画仪表条。
46
+ - **04 模型成本** — 按模型分组的成本明细表,支持自定义 Token 定价。
47
+ - **05 工具用量** — 工具调用频率的横向柱状图,标注错误次数。
48
+
49
+ ### 上下文回放
50
+
51
+ 按快照逐步回溯 agent 的上下文窗口:
52
+
53
+ - 编号步骤栏,显示每步的阶段、标题和 +新增/-丢弃 内容。
54
+ - 自动播放模式(每 2.8 秒切换快照)。
55
+ - 上下文块按状态分组:延续、新增、变更、丢弃。
56
+ - 警告条:过期上下文、矛盾信息、缺失文件。
57
+ - **工厂流水线** — 全宽皮带视图,展示所有快照节点及其活跃上下文块的流转。
58
+
59
+ ### Token 时间线
60
+
61
+ 每次旅程的 Token 用量纵向柱状图,按输入/输出/缓存/推理分段。点击任意柱子跳转到对应旅程。顶部汇总条显示会话总数、Token 总量和分类明细。
62
+
63
+ ### 分享卡片
64
+
65
+ 一键生成任务旅程摘要——关键统计、使用技能、判定结果(完成/失败/进行中)、Token 火花图和 Markdown 格式复制。
66
+
67
+ ### 事件条
68
+
69
+ 每条旅程行上的水平迷你时间线,以颜色区分事件类型(用户、agent、工具、思考、错误),悬停显示详情。
70
+
71
+ ### 成本估算
72
+
73
+ 内置 Claude 和 GPT 模型定价表(2026 年 6 月费率)。所有费率可实时编辑。根据原始 Token 用量计算成本,含缓存读写系数。支持按模型聚合成本。
74
+
75
+ ### 多提供商支持
76
+
77
+ | 提供商 | 数据来源 | 默认路径 |
78
+ |--------|---------|---------|
79
+ | Codex CLI | Session JSONL 文件 | `~/.codex/sessions/**/*.jsonl` |
80
+ | Claude Code | Project JSONL 文件 | `~/.claude/projects/**/*.jsonl` |
81
+ | OpenCode | 导出 session 文件 | 手动导出 |
82
+
83
+ ### 主题与语言
84
+
85
+ 四种主题:明亮指挥中心(默认)、暗色指挥中心、森林实验室、等离子紫。完整双语支持:英文和简体中文。偏好设置跨会话持久保存。
86
+
87
+ ## 本地开发
88
+
89
+ ```bash
90
+ pnpm install
91
+ pnpm dev # 启动 API + Vite 开发服务器
92
+ ```
93
+
94
+ 打开应用:
95
+
96
+ ```
97
+ http://127.0.0.1:5173/
98
+ ```
99
+
100
+ API 服务地址:
101
+
102
+ ```
103
+ http://127.0.0.1:5174/
104
+ ```
105
+
106
+ ### CLI 导入
107
+
108
+ ```bash
109
+ pnpm ingest /path/to/.codex
110
+ ```
111
+
112
+ ### API 导入
113
+
114
+ ```bash
115
+ curl -X POST http://127.0.0.1:5174/api/ingest \
116
+ -H 'Content-Type: application/json' \
117
+ -d '{"sources":[{"provider":"codex"}]}'
118
+ ```
119
+
120
+ Claude Code:
121
+
122
+ ```bash
123
+ curl -X POST http://127.0.0.1:5174/api/ingest \
124
+ -H 'Content-Type: application/json' \
125
+ -d '{"sources":[{"provider":"claude-code","root":"/path/to/.claude"}]}'
126
+ ```
127
+
128
+ OpenCode:
129
+
130
+ ```bash
131
+ curl -X POST http://127.0.0.1:5174/api/ingest \
132
+ -H 'Content-Type: application/json' \
133
+ -d '{"sources":[{"provider":"opencode","path":"/path/to/opencode-export.json"}]}'
134
+ ```
135
+
136
+ 查询任务状态:
137
+
138
+ ```bash
139
+ curl http://127.0.0.1:5174/api/ingest/jobs/<jobId>
140
+ ```
141
+
142
+ ### 常用脚本
143
+
144
+ ```bash
145
+ pnpm dev # 同时启动 API 和 Vite 客户端
146
+ pnpm dev:server # 只启动 Express API
147
+ pnpm dev:client # 只启动 Vite 客户端
148
+ pnpm start # 启动生产服务器(单端口,同时提供 API + UI)
149
+ pnpm build # 类型检查并构建 UI
150
+ pnpm typecheck # 运行 TypeScript 检查
151
+ pnpm test # 运行 Vitest 测试
152
+ pnpm test:e2e # 运行 Playwright 测试
153
+ ```
154
+
155
+ ## API Reference
156
+
157
+ | 端点 | 方法 | 说明 |
158
+ |------|------|------|
159
+ | `/api/health` | GET | 健康检查 |
160
+ | `/api/ingest` | POST | 启动导入任务 |
161
+ | `/api/ingest/jobs/:id` | GET | 查询导入进度 |
162
+ | `/api/projects` | GET | 列出所有项目 |
163
+ | `/api/projects/:id/timeline` | GET | 获取项目时间线 |
164
+ | `/api/projects/:id/token-usage/daily` | GET | 每日 Token 用量 |
165
+ | `/api/task-journeys/:id` | GET | 任务旅程详情 |
166
+ | `/api/task-journeys/:id/context-replay` | GET | 上下文回放数据 |
167
+ | `/api/events/:id/evidence` | GET | 事件证据 |
168
+ | `/api/runs/:id` | GET | 运行回放 |
169
+ | `/api/reset` | POST | 重置数据库 |
170
+
171
+ ## 架构
172
+
173
+ ```text
174
+ ui/ React + Vite 仪表盘
175
+ runtime-node/ Express API、导入服务、工作进程、日志适配器
176
+ core/ 解析器、规范化器、脱敏器、成本引擎、时间线、上下文回放
177
+ storage/ SQLite 数据库层和本地数据路径
178
+ ```
179
+
180
+ 导入路径与 API 路径分离。API 创建导入任务后立即返回,工作进程独立扫描和解析日志文件,将标准化数据写入 SQLite。即使扫描大量历史会话,仪表盘也能保持响应。导入服务采用单飞模式——若已有任务在运行,后续请求返回现有任务而非启动新的全量扫描。
181
+
182
+ ## 环境变量
183
+
184
+ ```bash
185
+ SUPERVIEW_DATA_DIR # 数据目录(默认:./.superview)
186
+ SUPERVIEW_CODEX_HOME # Codex 日志根目录(默认:~/.codex)
187
+ SUPERVIEW_CLAUDE_HOME # Claude Code 日志根目录(默认:~/.claude)
188
+ SUPERVIEW_PORT # 生产服务器端口(默认:5174)
189
+ ```
190
+
191
+ ## 隐私
192
+
193
+ SuperView 完全本地运行。无需账号、云同步或远程后端。原始 agent 日志始终留在你的机器上。标准化记录存储在本地 SQLite 数据库中。证据视图仅暴露脱敏 payload 及来源信息(路径、行号、时间戳、哈希),足以用于调试,但不会泄露原始内容。