opencode-dashboard-client 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/README.md +47 -0
  2. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # opencode-dashboard-client
2
+
3
+ Front end for [opencode-dashboard](https://github.com/GCS-ZHN/opencode-dashboard) — a live, hierarchical
4
+ view of opencode token usage (server → project → session → model), with input / output / reasoning /
5
+ cache tokens and cost at every level.
6
+
7
+ The npm package ships the **built SPA** plus the **front-end server**, which is the single entry point
8
+ for browsers: it serves the SPA and proxies `/api/s/{i}/*` to the configured aggregation backends.
9
+ Real backends stay hidden from the client's network.
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ npm install opencode-dashboard-client
15
+ ```
16
+
17
+ Requires Node ≥ 22 and [bun](https://bun.sh) (the front-end server runs on bun).
18
+
19
+ ## Usage
20
+
21
+ 1. Point the front-end server at your backends — edit `src/config.ts`:
22
+ ```ts
23
+ export const servers = [
24
+ { name: "main", url: "http://127.0.0.1:8791" },
25
+ { name: "backup", url: "http://127.0.0.1:8792" },
26
+ ];
27
+ ```
28
+ 2. Run the front-end server (serves the built SPA + proxies `/api/s/{i}/*`):
29
+ ```bash
30
+ bun server.ts # PORT env, default 5173 → open http://localhost:5173/
31
+ ```
32
+
33
+ Each configured backend is one tab (with an **Overall** tab showing all of them in a grid). Sessions
34
+ render as parent/child trees — subagents are collapsed by default and a parent's totals include all
35
+ descendants. Live updates come over SSE, so the page refreshes itself as opencode writes.
36
+
37
+ ## Development
38
+
39
+ ```bash
40
+ bun install # install dev deps (typescript, vite)
41
+ bun run dev # Vite dev server (same /api/s/{i} proxy from config.ts) → :5173
42
+ bun run build # typecheck (tsc) + bundle (vite)
43
+ bun mock-server.ts # serve canned API data for frontend-only work
44
+ ```
45
+
46
+ Full project docs (architecture, API contract, publishing) live in the repo
47
+ [README](https://github.com/GCS-ZHN/opencode-dashboard).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-dashboard-client",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "description": "Front-end for the opencode token-usage dashboard. Ships the built SPA plus the front-end server (bun server.ts) that proxies to dashboard backends.",
6
6
  "files": [