oc-flight-deck 0.20.2 → 0.20.3
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/CHANGELOG.md +6 -0
- package/INSTALL.md +1 -1
- package/README.md +15 -212
- package/docs/GUIDE.md +229 -0
- package/package.json +10 -5
- package/src/tui/go.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.20.3] - 2026-10-23
|
|
4
|
+
|
|
5
|
+
- `@opencode/plugin` is no longer a runtime dependency. It moves to an optional peer range (`>=2.1.1 <3`), with 2.1.3 as a dev dependency for types, so an install no longer carries its own copy of the host module.
|
|
6
|
+
- Rationale: the host serves `@opencode/plugin` and its subpaths from its own package tree at load time and refuses a copy loaded from a plugin's `node_modules`, so the bundled copy was never used - it only added a duplicate install tree (a clean `npm install @opencode/plugin@2.1.3` measures 127 MB across 167 packages) beside every plugin.
|
|
7
|
+
- No behaviour change; hosts on 2.1.1 and 2.1.3 are both supported.
|
|
8
|
+
|
|
3
9
|
## [0.20.2] - 2026-10-22
|
|
4
10
|
|
|
5
11
|
- Version bump for the monorepo release; no runtime change.
|
package/INSTALL.md
CHANGED
package/README.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
<h1 align="center">oc-flight-deck</h1>
|
|
5
|
-
<p align="center"><strong>See live cost, tokens, and context for every OpenCode session, right in your sidebar.</strong></p>
|
|
1
|
+
# oc-flight-deck
|
|
2
|
+
|
|
3
|
+
Live cost, token, cache, and context telemetry for every OpenCode session, drawn in your sidebar.
|
|
6
4
|
|
|
7
5
|
## Install
|
|
8
6
|
|
|
@@ -12,218 +10,23 @@ Add the entry to the `plugins` array in your `opencode.jsonc`, then restart Open
|
|
|
12
10
|
{ "plugins": ["oc-flight-deck"] }
|
|
13
11
|
```
|
|
14
12
|
|
|
15
|
-
The panel renders beside your next open session with defaults and no config file.
|
|
16
|
-
You need OpenCode `2.1.1` already installed, on Node 22+ or Bun 1.4+.
|
|
17
|
-
|
|
18
|
-
### Or let your AI install it
|
|
19
|
-
|
|
20
|
-
```text
|
|
21
|
-
Install the oc-flight-deck plugin: add "oc-flight-deck" to the plugins array in my opencode.jsonc, restart OpenCode, then open a session and confirm the telemetry panel renders in the sidebar. Report which of the default rows you see: status, agent, model, cost, project, tokens, cache, context, perms, elapsed, tps.
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
### Offline or pinned
|
|
25
|
-
|
|
26
|
-
The registry is the only install route: tagged releases only.
|
|
27
|
-
|
|
28
|
-
```json
|
|
29
|
-
{ "plugins": ["oc-flight-deck"] }
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
The bare name tracks the newest release and never names a version that does not exist between a bump and its publish. To pin an exact published version, append `@<version>`; the pin then stays put.
|
|
33
|
-
|
|
34
|
-
## Use it
|
|
35
|
-
|
|
36
|
-
Open a session and read the rail. Three scopes shape the numbers you see. `cost`, `tokens`, `cache`, and `reasoning` roll up this conversation plus the subagent sessions linked by the host's parentID. `project` covers every session in the project. `elapsed` counts active turn time, not wall clock.
|
|
37
|
-
|
|
38
|
-
A session with subagents, defaults, 200k window:
|
|
39
|
-
|
|
40
|
-
```text
|
|
41
|
-
status ⠙ running
|
|
42
|
-
agent build
|
|
43
|
-
model claude-sonnet-4-5 · high
|
|
44
|
-
cost $1.84 · 3 subagents
|
|
45
|
-
project $12.40 · 21 sessions
|
|
46
|
-
tokens 1.2M in · 84k out
|
|
47
|
-
cache 92% hit · 1.1M read
|
|
48
|
-
context ████████░░ ~78%
|
|
49
|
-
perms 1 waiting · bash
|
|
50
|
-
elapsed 2h 14m 07s
|
|
51
|
-
tps 41 tok/s
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
Add `"ses"` to `sidebar.rows`, then click the `session` row to copy the full id. Add `"go"` to `sidebar.rows` for quota.
|
|
55
|
-
|
|
56
|
-
## What you get
|
|
57
|
-
|
|
58
|
-
- One money row that rolls up this conversation plus its subagent tree
|
|
59
|
-
- A stable rail: every named row draws its zero skeleton until data arrives
|
|
60
|
-
- Elapsed time that survives a restart, recomputed from recorded turn spans
|
|
61
|
-
- Speed as a settled-turn average, a realtime estimate, or both with ttft
|
|
62
|
-
- An opt-in watchdog row that stays silent until something stops moving
|
|
63
|
-
- One `notifications` section that silences every toast, together or by kind
|
|
64
|
-
- One global config file, and nothing per project
|
|
65
|
-
|
|
66
|
-
## Configure it
|
|
67
|
-
|
|
68
|
-
You configure one global file: `~/.config/opencode/flight-deck.jsonc`. The `.json` name is also read, and `.jsonc` is tried first. When `$XDG_CONFIG_HOME` holds an absolute path, the file lives at `$XDG_CONFIG_HOME/opencode/flight-deck.jsonc` instead. There is no per-project lookup, so a copy left in a project root configures nothing. A missing file is normal and silent: you get the defaults below. If the file does not exist, create it; the snippet below is a complete file. Where the host forwards plugin options, those win key by key. Comments and trailing commas are accepted by the Bun-hosted TUI. A bad value restores its default with a one-time toast naming the key; silence that toast with `notifications.config: false`.
|
|
69
|
-
|
|
70
|
-
```jsonc
|
|
71
|
-
{
|
|
72
|
-
"sidebar": { "rows": ["status", "cost", "context", "elapsed"] }
|
|
73
|
-
}
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### What each row shows
|
|
77
|
-
|
|
78
|
-
| Row | What it shows | Default |
|
|
79
|
-
| --- | --- | --- |
|
|
80
|
-
| `caution` | Annunciator, opt-in with `caution.enabled`. Silent unless a tool or turn stops moving. Reports observations, never verdicts (`shell running 8m41s`). Never aborts, kills, retries, or blocks. `▲` watch, `●` caution, `○` reserved and not drawn. | opt-in |
|
|
81
|
-
| `status` | `⠙ running` while anything works (this session, a subagent, or a shell); `○ idle` otherwise. | yes |
|
|
82
|
-
| `agent` | Active agent name. | yes |
|
|
83
|
-
| `model` | Model id, plus ` · variant` when one is present. | yes |
|
|
84
|
-
| `branch` | Current git branch. Costs a VCS call. | opt-in |
|
|
85
|
-
| `cost` | Money for this conversation plus its subagent tree. With `total` on the rail, this row shows the session's own figure. Merged shape `$1.84 · 3 subagents`; childless shows `$1.84`. Follows the host's parentID link only: an independently spawned top-level session is not counted, and `project` is the surface for that. | yes |
|
|
86
|
-
| `total` | Family total plus subagent count, `$1.84 · 0 subagents` when childless. | opt-in |
|
|
87
|
-
| `project` | Every session in the project: `$12.40 · 21 sessions` when more than one, else just the figure. | yes |
|
|
88
|
-
| `tokens` | `1.2M in · 84k out`, same family scope as `cost`. | yes |
|
|
89
|
-
| `cache` | `92% hit · 1.1M read`, family scope. The hit-rate denominator is cache read plus input; cache write is excluded because a write is not a lookup. A zero read is drawn (`0 read`, or `0% hit · 0 read` when input exists), never hidden. | yes |
|
|
90
|
-
| `context` | Occupancy proxy (last request input plus cache read plus cache write), drawn as a `layout.barWidth`-cell gauge (10 by default) plus `~78%`, or `~N used` when no limit is known. The `~` is deliberate: this is an estimate. | yes |
|
|
91
|
-
| `perms` | Pending approvals. One names the action plus an 18-cell clipped resource (`bash · src/tui…`); several lead with the count (`3 waiting · bash`). | yes |
|
|
92
|
-
| `elapsed` | Active generation time, recomputed from the assistant-turn spans the host recorded for this session and its subagents. Survives a restart, never steps backwards while the host reports those turns, and is not wall-clock since the session began. | yes |
|
|
93
|
-
| `tps` | Session speed. Default `avg`: generation tokens (output plus reasoning) over the union of settled turns' `streamed − created` spans; idle gaps never billed. `rt`: realtime estimate from streaming deltas, zero while nothing generates. `both`: `106 rt · 41 avg`, plus `1.2s ttft` once a step settles. Scope `family` (default; open session plus subagents, overlapping spans merged) or `session`. Below half a token per second no figure is drawn; with `persist: true` the row falls back to its `0 tok/s` skeleton, and `persist: false` omits it. | yes |
|
|
94
|
-
| `spark` | Recent turn sizes as a sparkline; the newest samples are kept. | opt-in |
|
|
95
|
-
| `reasoning` | Reasoning tokens, family scope. | opt-in |
|
|
96
|
-
| `turns` | Prompts sent this session. | opt-in |
|
|
97
|
-
| `guard` | Harness status when a guard bridge supplies it (breaches, orphans, findings, or ok). Without the bridge the row has no data. | opt-in |
|
|
98
|
-
| `go` | Zen Go usage: three dials (`○ ◔ ◑ ◕ ●`) plus percent for 5h, 1w, 1m, read from OpenCode's own active opencode-go credential store; no env var. A window at 90% or more, or non-ok, turns red; only the worst flagged window carries a reset countdown. | opt-in |
|
|
99
|
-
| `ses` | Clipped 18-cell preview of the session id (less when the label column is narrow, floored at 8), labelled `session`. Click copies the full id. A verified copy is silent: the host write reports `written`, or an exact clipboard read-back confirms an OSC52 dispatch. An unconfirmed dispatch is an advisory warning (paste to verify). Gate the failure toast with `notifications.copy`. | opt-in |
|
|
100
|
-
| `session` | Alias for `ses`; accepted in `sidebar.rows` and folded to it. | opt-in |
|
|
101
|
-
|
|
102
|
-
With `sidebar.persist` (the default) every named row renders, drawing its zero skeleton until data arrives: `$0.000` money rows, `0 in · 0 out`, `0 read`, empty gauge plus `~0%`, `0 waiting`, `0s`, `0 tok/s` (`0 rt · 0 avg` in both), flat `▁` spark, `0` reasoning and turns, `○ 0 ○ 0 ○ 0` go, `○ idle`, `none` agent, model, and ses, `no branch`, `unknown` guard. `caution` never draws a skeleton. Set `persist: false` to omit rows with no data instead.
|
|
103
|
-
|
|
104
|
-
### Settings
|
|
105
|
-
|
|
106
|
-
**Refresh**
|
|
107
|
-
|
|
108
|
-
- **`refresh`** (default `100`) — ms between ticks, 0–60000. Values 1–15 clamp to 16; `0` turns the ticker off, so clock-derived rows move only on host events. While idle the tick backs off to about 1s.
|
|
109
|
-
|
|
110
|
-
**Sidebar**
|
|
111
|
-
|
|
112
|
-
- **`sidebar.enabled`** (default `true`) — `false` leaves the plugin loaded but invisible.
|
|
113
|
-
- **`sidebar.rows`** (default `["status","agent","model","cost","project","tokens","cache","context","perms","elapsed","tps"]`) — live rows, top to bottom, any subset in any order. Max 24 names; unknown names are ignored with a one-time warning.
|
|
114
|
-
- **`sidebar.lines`** (default `[]`) — fixed lines above the rows. Max 24. These plus rows share the rail cap (`maxLines`, default 24); fixed lines render at full brightness while live rows are dimmed.
|
|
115
|
-
- **`sidebar.footer.lines`** (default `[]`) — fixed lines in the host footer slot, outside the rail cap; max 24. The documented branding pair is `["▸ FLIGHT DECK","─────────────────"]`.
|
|
116
|
-
- **`sidebar.footer.go`** (default `false`) — `true` or an object draws the live Go usage panel: three fixed-width lines above the host location row, sharing one account-wide poll with the `go` row. Object keys: `header` (`false`), `barWidth` (`10`, 1–40), `labelWidth` (`6`, 5–24, auto-widens), `percent` (`true`), `reset` (`true`), `align` (`"right"`, left, right, or center), `sweep` (`false`), `labels` (`{rolling,weekly,monthly}`, each 1–24 chars), `blink` (`true`), `blinkMs` (`700`, 200–5000).
|
|
117
|
-
- **`sidebar.persist`** (default `true`) — every named row renders, drawing its zero skeleton until data arrives; `false` omits rows with no data.
|
|
118
|
-
- **`sidebar.placeholder`** (default `"—"`) — non-empty string; only for a data-less row with no skeleton, unreachable for shipped fields.
|
|
119
|
-
- **`sidebar.maxLines`** (default `24`) — whole rail, fixed lines plus rows, 1–24.
|
|
120
|
-
- **`sidebar.tps.scope`** (default `"family"`) — `"family"` paces the open session plus subagents; `"session"` paces the open session alone.
|
|
121
|
-
- **`sidebar.tps.display`** (default `"avg"`) — `"avg"` settled-turn average, `"rt"` realtime estimate, `"both"` both figures plus ttft.
|
|
13
|
+
OpenCode resolves the plugin from the registry, so there is no separate install command. The panel renders beside your next open session with defaults and no config file. After the restart, open a session and check that the rail draws.
|
|
122
14
|
|
|
123
|
-
|
|
15
|
+
## What it does
|
|
124
16
|
|
|
125
|
-
-
|
|
126
|
-
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
- **`caution.enabled`** (default `false`) — run the annunciator; off means no row and no timer.
|
|
131
|
-
- **`caution.toolWatchSeconds`** (default `180`) — a tool running longer draws `▲`.
|
|
132
|
-
- **`caution.toolCautionSeconds`** (default `420`) — a tool running longer becomes `●`; raised to the watch value if lower.
|
|
133
|
-
- **`caution.turnWatchSeconds`** (default `600`) — a running session producing nothing draws `▲`; suppressed while a tool or shell runs.
|
|
134
|
-
- **`caution.turnCautionSeconds`** (default `1200`) — quiet session becomes `●`; same raise rule. All four thresholds take 0 or more.
|
|
135
|
-
- **`caution.repeatThreshold`** (default `3`, min 2) — identical consecutive calls before a loop is reported; applies to successes and failures.
|
|
136
|
-
- **`caution.exemptTools`** (default `["question","task","subagent","agent","delegate","delegate_many","delegate_task","tools.delegate","tools.delegate_many","tools.subagent","tools.task"]`) — matched by exact name. Calibrated against 54,218 settled calls: 307 exceed 180s and 200 of those are these tools; `subagent` alone crossed 152 times, p99 14.7 min.
|
|
137
|
-
- **`caution.toast`** (default `false`) — toast once per distinct problem, re-arming when the session goes quiet.
|
|
138
|
-
|
|
139
|
-
**Notifications**
|
|
140
|
-
|
|
141
|
-
- **`notifications.enabled`** (default `true`) — the one-key off switch; `false` silences every toast.
|
|
142
|
-
- **`notifications.config`** (default `true`) — the one-time toast naming a bad config key.
|
|
143
|
-
- **`notifications.copy`** (default `true`) — the toast for an unverified copy.
|
|
144
|
-
- **`notifications.caution`** (default `true`) — the opt-in caution toast. Every flag only silences.
|
|
145
|
-
|
|
146
|
-
**Layout**
|
|
147
|
-
|
|
148
|
-
- **`layout.labelWidth`** (default `10`, 6–24) — label column width.
|
|
149
|
-
- **`layout.barWidth`** (default `10`, 1–40) — context gauge cells.
|
|
150
|
-
- **`layout.sparkWidth`** (default `12`, 2–64) — sparkline samples.
|
|
151
|
-
- **`layout.labels`** (default `{}`) — rename any row by its canonical key, for example `{ "cost": "session", "total": "lifetime" }`. A label wider than the column still gets a space before its value.
|
|
152
|
-
|
|
153
|
-
**Format**
|
|
154
|
-
|
|
155
|
-
- **`format.duration`** (default `"spaced"`, `2h 14m 37s`) — or `"compact"` (`2h14m37s`). Zero-padding is the same either way (`14m 07s`, never `14m 7s`).
|
|
156
|
-
|
|
157
|
-
**Glyphs**
|
|
158
|
-
|
|
159
|
-
- **`glyphs.watch`** (default `"▲"`), **`glyphs.caution`** (default `"●"`), **`glyphs.clear`** (default `"○"`, reserved, not drawn today) — 1–2 chars each.
|
|
160
|
-
|
|
161
|
-
**Style**
|
|
162
|
-
|
|
163
|
-
- **`style.lines`** (default `{color:"default", attributes:[]}`) — fixed-line look.
|
|
164
|
-
- **`style.rows`** — wildcard `"*": {color:"subdued", attributes:[]}` plus per-row overrides. Colors are theme roles: default, subdued, warning, error, success, info. Attributes: bold, dim, italic, underline, blink, inverse, hidden, strikethrough.
|
|
165
|
-
|
|
166
|
-
Config precedence: host plugin options beat `flight-deck.jsonc`, which beats defaults, merged key by key.
|
|
167
|
-
|
|
168
|
-
### Recipes
|
|
169
|
-
|
|
170
|
-
Quota, session id, and branch:
|
|
171
|
-
|
|
172
|
-
```jsonc
|
|
173
|
-
{ "sidebar": { "rows": ["status", "cost", "project", "go", "ses", "branch", "elapsed"] } }
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
Split the money rows: session and lifetime:
|
|
177
|
-
|
|
178
|
-
```jsonc
|
|
179
|
-
{
|
|
180
|
-
"sidebar": { "rows": ["status", "cost", "total", "elapsed"] },
|
|
181
|
-
"layout": { "labels": { "cost": "session", "total": "lifetime" } }
|
|
182
|
-
}
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
With `total` on the rail, `cost` draws the session's own figure, so this reads `session $1.00` and `lifetime $2.00 · 1 subagent`.
|
|
186
|
-
|
|
187
|
-
Realtime speed plus time to first token:
|
|
188
|
-
|
|
189
|
-
```jsonc
|
|
190
|
-
{ "sidebar": { "rows": ["status", "tps", "elapsed"], "tps": { "display": "both" } } }
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
Silence every toast with one key:
|
|
194
|
-
|
|
195
|
-
```jsonc
|
|
196
|
-
{ "notifications": { "enabled": false } }
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
Watchdog on for long runs:
|
|
200
|
-
|
|
201
|
-
```jsonc
|
|
202
|
-
{ "sidebar": { "rows": ["status", "caution", "cost", "elapsed"] }, "caution": { "enabled": true } }
|
|
203
|
-
```
|
|
17
|
+
- Shows cost and tokens for the open session plus its subagent tree, with project-wide spend alongside.
|
|
18
|
+
- Draws a context gauge that says out loud that it is an estimate.
|
|
19
|
+
- Survives a restart: elapsed time is recomputed from the turn spans the host recorded.
|
|
20
|
+
- Adds opt-in rows for branch, quota, session id, turn spark, and a watchdog that stays silent until something stops moving.
|
|
21
|
+
- Keeps every setting in one global file, and nothing per project.
|
|
204
22
|
|
|
205
23
|
## Requirements
|
|
206
24
|
|
|
207
|
-
|
|
208
|
-
- Node `>=22` or Bun `>=1.4.0`
|
|
25
|
+
Any platform OpenCode V2 runs on, with OpenCode 2.1.1 or newer, and Node 22 or Bun 1.4 or newer.
|
|
209
26
|
|
|
210
|
-
##
|
|
27
|
+
## Full documentation
|
|
211
28
|
|
|
212
|
-
-
|
|
213
|
-
- Package: https://www.npmjs.com/package/oc-flight-deck
|
|
214
|
-
- Issues: https://github.com/nathwn12/oc-collections/issues
|
|
215
|
-
- OpenCode V2 plugin API: https://opencode.ai/v2/docs/build/plugins/cli
|
|
216
|
-
- Example config: [flight-deck.example.jsonc](flight-deck.example.jsonc)
|
|
217
|
-
- Config schema: [flight-deck.schema.json](flight-deck.schema.json)
|
|
218
|
-
- Install: [INSTALL.md](INSTALL.md)
|
|
219
|
-
- Changelog: [CHANGELOG.md](CHANGELOG.md)
|
|
220
|
-
- Releases: https://github.com/nathwn12/oc-collections/releases
|
|
221
|
-
- Licence: MIT, see [LICENSE](LICENSE)
|
|
29
|
+
- Guide: <https://github.com/nathwn12/oc-collections/blob/main/packages/oc-flight-deck/docs/GUIDE.md>
|
|
30
|
+
- Package: <https://www.npmjs.com/package/oc-flight-deck>
|
|
222
31
|
|
|
223
|
-
|
|
224
|
-
<p align="center">
|
|
225
|
-
<a href="https://github.com/nathwn12"><img src="assets/signature.svg" width="96" alt="nathwn12" /></a>
|
|
226
|
-
</p>
|
|
227
|
-
<p align="center">
|
|
228
|
-
<sub>Built by <a href="https://github.com/nathwn12">nathwn12</a> · <a href="https://github.com/nathwn12?tab=repositories">All projects</a></sub>
|
|
229
|
-
</p>
|
|
32
|
+
The guide covers every row, every setting and its default, config precedence, and worked recipes. It also links the example config, the JSON schema, the install notes, the changelog, and the licence.
|
package/docs/GUIDE.md
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="../assets/icon.svg" width="120" height="120" alt="oc-flight-deck icon" />
|
|
3
|
+
</p>
|
|
4
|
+
<h1 align="center">oc-flight-deck</h1>
|
|
5
|
+
<p align="center"><strong>See live cost, tokens, and context for every OpenCode session, right in your sidebar.</strong></p>
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
Add the entry to the `plugins` array in your `opencode.jsonc`, then restart OpenCode:
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{ "plugins": ["oc-flight-deck"] }
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The panel renders beside your next open session with defaults and no config file.
|
|
16
|
+
You need OpenCode `2.1.1` or newer (2.x) already installed, on Node 22+ or Bun 1.4+.
|
|
17
|
+
|
|
18
|
+
### Or let your AI install it
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
Install the oc-flight-deck plugin: add "oc-flight-deck" to the plugins array in my opencode.jsonc, restart OpenCode, then open a session and confirm the telemetry panel renders in the sidebar. Report which of the default rows you see: status, agent, model, cost, project, tokens, cache, context, perms, elapsed, tps.
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Offline or pinned
|
|
25
|
+
|
|
26
|
+
The registry is the only install route: tagged releases only.
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{ "plugins": ["oc-flight-deck"] }
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The bare name tracks the newest release and never names a version that does not exist between a bump and its publish. To pin an exact published version, append `@<version>`; the pin then stays put.
|
|
33
|
+
|
|
34
|
+
## Use it
|
|
35
|
+
|
|
36
|
+
Open a session and read the rail. Three scopes shape the numbers you see. `cost`, `tokens`, `cache`, and `reasoning` roll up this conversation plus the subagent sessions linked by the host's parentID. `project` covers every session in the project. `elapsed` counts active turn time, not wall clock.
|
|
37
|
+
|
|
38
|
+
A session with subagents, defaults, 200k window:
|
|
39
|
+
|
|
40
|
+
```text
|
|
41
|
+
status ⠙ running
|
|
42
|
+
agent build
|
|
43
|
+
model claude-sonnet-4-5 · high
|
|
44
|
+
cost $1.84 · 3 subagents
|
|
45
|
+
project $12.40 · 21 sessions
|
|
46
|
+
tokens 1.2M in · 84k out
|
|
47
|
+
cache 92% hit · 1.1M read
|
|
48
|
+
context ████████░░ ~78%
|
|
49
|
+
perms 1 waiting · bash
|
|
50
|
+
elapsed 2h 14m 07s
|
|
51
|
+
tps 41 tok/s
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Add `"ses"` to `sidebar.rows`, then click the `session` row to copy the full id. Add `"go"` to `sidebar.rows` for quota.
|
|
55
|
+
|
|
56
|
+
## What you get
|
|
57
|
+
|
|
58
|
+
- One money row that rolls up this conversation plus its subagent tree
|
|
59
|
+
- A stable rail: every named row draws its zero skeleton until data arrives
|
|
60
|
+
- Elapsed time that survives a restart, recomputed from recorded turn spans
|
|
61
|
+
- Speed as a settled-turn average, a realtime estimate, or both with ttft
|
|
62
|
+
- An opt-in watchdog row that stays silent until something stops moving
|
|
63
|
+
- One `notifications` section that silences every toast, together or by kind
|
|
64
|
+
- One global config file, and nothing per project
|
|
65
|
+
|
|
66
|
+
## Configure it
|
|
67
|
+
|
|
68
|
+
You configure one global file: `~/.config/opencode/flight-deck.jsonc`. The `.json` name is also read, and `.jsonc` is tried first. When `$XDG_CONFIG_HOME` holds an absolute path, the file lives at `$XDG_CONFIG_HOME/opencode/flight-deck.jsonc` instead. There is no per-project lookup, so a copy left in a project root configures nothing. A missing file is normal and silent: you get the defaults below. If the file does not exist, create it; the snippet below is a complete file. Where the host forwards plugin options, those win key by key. Comments and trailing commas are accepted by the Bun-hosted TUI. A bad value restores its default with a one-time toast naming the key; silence that toast with `notifications.config: false`.
|
|
69
|
+
|
|
70
|
+
```jsonc
|
|
71
|
+
{
|
|
72
|
+
"sidebar": { "rows": ["status", "cost", "context", "elapsed"] }
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### What each row shows
|
|
77
|
+
|
|
78
|
+
| Row | What it shows | Default |
|
|
79
|
+
| --- | --- | --- |
|
|
80
|
+
| `caution` | Annunciator, opt-in with `caution.enabled`. Silent unless a tool or turn stops moving. Reports observations, never verdicts (`shell running 8m41s`). Never aborts, kills, retries, or blocks. `▲` watch, `●` caution, `○` reserved and not drawn. | opt-in |
|
|
81
|
+
| `status` | `⠙ running` while anything works (this session, a subagent, or a shell); `○ idle` otherwise. | yes |
|
|
82
|
+
| `agent` | Active agent name. | yes |
|
|
83
|
+
| `model` | Model id, plus ` · variant` when one is present. | yes |
|
|
84
|
+
| `branch` | Current git branch. Costs a VCS call. | opt-in |
|
|
85
|
+
| `cost` | Money for this conversation plus its subagent tree. With `total` on the rail, this row shows the session's own figure. Merged shape `$1.84 · 3 subagents`; childless shows `$1.84`. Follows the host's parentID link only: an independently spawned top-level session is not counted, and `project` is the surface for that. | yes |
|
|
86
|
+
| `total` | Family total plus subagent count, `$1.84 · 0 subagents` when childless. | opt-in |
|
|
87
|
+
| `project` | Every session in the project: `$12.40 · 21 sessions` when more than one, else just the figure. | yes |
|
|
88
|
+
| `tokens` | `1.2M in · 84k out`, same family scope as `cost`. | yes |
|
|
89
|
+
| `cache` | `92% hit · 1.1M read`, family scope. The hit-rate denominator is cache read plus input; cache write is excluded because a write is not a lookup. A zero read is drawn (`0 read`, or `0% hit · 0 read` when input exists), never hidden. | yes |
|
|
90
|
+
| `context` | Occupancy proxy (last request input plus cache read plus cache write), drawn as a `layout.barWidth`-cell gauge (10 by default) plus `~78%`, or `~N used` when no limit is known. The `~` is deliberate: this is an estimate. | yes |
|
|
91
|
+
| `perms` | Pending approvals. One names the action plus an 18-cell clipped resource (`bash · src/tui…`); several lead with the count (`3 waiting · bash`). | yes |
|
|
92
|
+
| `elapsed` | Active generation time, recomputed from the assistant-turn spans the host recorded for this session and its subagents. Survives a restart, never steps backwards while the host reports those turns, and is not wall-clock since the session began. | yes |
|
|
93
|
+
| `tps` | Session speed. Default `avg`: generation tokens (output plus reasoning) over the union of settled turns' `streamed − created` spans; idle gaps never billed. `rt`: realtime estimate from streaming deltas, zero while nothing generates. `both`: `106 rt · 41 avg`, plus `1.2s ttft` once a step settles. Scope `family` (default; open session plus subagents, overlapping spans merged) or `session`. Below half a token per second no figure is drawn; with `persist: true` the row falls back to its `0 tok/s` skeleton, and `persist: false` omits it. | yes |
|
|
94
|
+
| `spark` | Recent turn sizes as a sparkline; the newest samples are kept. | opt-in |
|
|
95
|
+
| `reasoning` | Reasoning tokens, family scope. | opt-in |
|
|
96
|
+
| `turns` | Prompts sent this session. | opt-in |
|
|
97
|
+
| `guard` | Harness status when a guard bridge supplies it (breaches, orphans, findings, or ok). Without the bridge the row has no data. | opt-in |
|
|
98
|
+
| `go` | Zen Go usage: three dials (`○ ◔ ◑ ◕ ●`) plus percent for 5h, 1w, 1m, read from OpenCode's own active opencode-go credential store; no env var. A window at 90% or more, or non-ok, turns red; only the worst flagged window carries a reset countdown. | opt-in |
|
|
99
|
+
| `ses` | Clipped 18-cell preview of the session id (less when the label column is narrow, floored at 8), labelled `session`. Click copies the full id. A verified copy is silent: the host write reports `written`, or an exact clipboard read-back confirms an OSC52 dispatch. An unconfirmed dispatch is an advisory warning (paste to verify). Gate the failure toast with `notifications.copy`. | opt-in |
|
|
100
|
+
| `session` | Alias for `ses`; accepted in `sidebar.rows` and folded to it. | opt-in |
|
|
101
|
+
|
|
102
|
+
With `sidebar.persist` (the default) every named row renders, drawing its zero skeleton until data arrives: `$0.000` money rows, `0 in · 0 out`, `0 read`, empty gauge plus `~0%`, `0 waiting`, `0s`, `0 tok/s` (`0 rt · 0 avg` in both), flat `▁` spark, `0` reasoning and turns, `○ 0 ○ 0 ○ 0` go, `○ idle`, `none` agent, model, and ses, `no branch`, `unknown` guard. `caution` never draws a skeleton. Set `persist: false` to omit rows with no data instead.
|
|
103
|
+
|
|
104
|
+
### Settings
|
|
105
|
+
|
|
106
|
+
**Refresh**
|
|
107
|
+
|
|
108
|
+
- **`refresh`** (default `100`) — ms between ticks, 0–60000. Values 1–15 clamp to 16; `0` turns the ticker off, so clock-derived rows move only on host events. While idle the tick backs off to about 1s.
|
|
109
|
+
|
|
110
|
+
**Sidebar**
|
|
111
|
+
|
|
112
|
+
- **`sidebar.enabled`** (default `true`) — `false` leaves the plugin loaded but invisible.
|
|
113
|
+
- **`sidebar.rows`** (default `["status","agent","model","cost","project","tokens","cache","context","perms","elapsed","tps"]`) — live rows, top to bottom, any subset in any order. Max 24 names; unknown names are ignored with a one-time warning.
|
|
114
|
+
- **`sidebar.lines`** (default `[]`) — fixed lines above the rows. Max 24. These plus rows share the rail cap (`maxLines`, default 24); fixed lines render at full brightness while live rows are dimmed.
|
|
115
|
+
- **`sidebar.footer.lines`** (default `[]`) — fixed lines in the host footer slot, outside the rail cap; max 24. The documented branding pair is `["▸ FLIGHT DECK","─────────────────"]`.
|
|
116
|
+
- **`sidebar.footer.go`** (default `false`) — `true` or an object draws the live Go usage panel: three fixed-width lines above the host location row, sharing one account-wide poll with the `go` row. Object keys: `header` (`false`), `barWidth` (`10`, 1–40), `labelWidth` (`6`, 5–24, auto-widens), `percent` (`true`), `reset` (`true`), `align` (`"right"`, left, right, or center), `sweep` (`false`), `labels` (`{rolling,weekly,monthly}`, each 1–24 chars), `blink` (`true`), `blinkMs` (`700`, 200–5000).
|
|
117
|
+
- **`sidebar.persist`** (default `true`) — every named row renders, drawing its zero skeleton until data arrives; `false` omits rows with no data.
|
|
118
|
+
- **`sidebar.placeholder`** (default `"—"`) — non-empty string; only for a data-less row with no skeleton, unreachable for shipped fields.
|
|
119
|
+
- **`sidebar.maxLines`** (default `24`) — whole rail, fixed lines plus rows, 1–24.
|
|
120
|
+
- **`sidebar.tps.scope`** (default `"family"`) — `"family"` paces the open session plus subagents; `"session"` paces the open session alone.
|
|
121
|
+
- **`sidebar.tps.display`** (default `"avg"`) — `"avg"` settled-turn average, `"rt"` realtime estimate, `"both"` both figures plus ttft.
|
|
122
|
+
|
|
123
|
+
**Footer**
|
|
124
|
+
|
|
125
|
+
- **`footer.enabled`** (default `true` when any other footer key is present, `false` when the section is absent) — writing any footer key turns it on.
|
|
126
|
+
- **`footer.text`** (default `"Flight Deck"`) — max 120 chars; control chars become spaces.
|
|
127
|
+
|
|
128
|
+
**Caution**
|
|
129
|
+
|
|
130
|
+
- **`caution.enabled`** (default `false`) — run the annunciator; off means no row and no timer.
|
|
131
|
+
- **`caution.toolWatchSeconds`** (default `180`) — a tool running longer draws `▲`.
|
|
132
|
+
- **`caution.toolCautionSeconds`** (default `420`) — a tool running longer becomes `●`; raised to the watch value if lower.
|
|
133
|
+
- **`caution.turnWatchSeconds`** (default `600`) — a running session producing nothing draws `▲`; suppressed while a tool or shell runs.
|
|
134
|
+
- **`caution.turnCautionSeconds`** (default `1200`) — quiet session becomes `●`; same raise rule. All four thresholds take 0 or more.
|
|
135
|
+
- **`caution.repeatThreshold`** (default `3`, min 2) — identical consecutive calls before a loop is reported; applies to successes and failures.
|
|
136
|
+
- **`caution.exemptTools`** (default `["question","task","subagent","agent","delegate","delegate_many","delegate_task","tools.delegate","tools.delegate_many","tools.subagent","tools.task"]`) — matched by exact name. Calibrated against 54,218 settled calls: 307 exceed 180s and 200 of those are these tools; `subagent` alone crossed 152 times, p99 14.7 min.
|
|
137
|
+
- **`caution.toast`** (default `false`) — toast once per distinct problem, re-arming when the session goes quiet.
|
|
138
|
+
|
|
139
|
+
**Notifications**
|
|
140
|
+
|
|
141
|
+
- **`notifications.enabled`** (default `true`) — the one-key off switch; `false` silences every toast.
|
|
142
|
+
- **`notifications.config`** (default `true`) — the one-time toast naming a bad config key.
|
|
143
|
+
- **`notifications.copy`** (default `true`) — the toast for an unverified copy.
|
|
144
|
+
- **`notifications.caution`** (default `true`) — the opt-in caution toast. Every flag only silences.
|
|
145
|
+
|
|
146
|
+
**Layout**
|
|
147
|
+
|
|
148
|
+
- **`layout.labelWidth`** (default `10`, 6–24) — label column width.
|
|
149
|
+
- **`layout.barWidth`** (default `10`, 1–40) — context gauge cells.
|
|
150
|
+
- **`layout.sparkWidth`** (default `12`, 2–64) — sparkline samples.
|
|
151
|
+
- **`layout.labels`** (default `{}`) — rename any row by its canonical key, for example `{ "cost": "session", "total": "lifetime" }`. A label wider than the column still gets a space before its value.
|
|
152
|
+
|
|
153
|
+
**Format**
|
|
154
|
+
|
|
155
|
+
- **`format.duration`** (default `"spaced"`, `2h 14m 37s`) — or `"compact"` (`2h14m37s`). Zero-padding is the same either way (`14m 07s`, never `14m 7s`).
|
|
156
|
+
|
|
157
|
+
**Glyphs**
|
|
158
|
+
|
|
159
|
+
- **`glyphs.watch`** (default `"▲"`), **`glyphs.caution`** (default `"●"`), **`glyphs.clear`** (default `"○"`, reserved, not drawn today) — 1–2 chars each.
|
|
160
|
+
|
|
161
|
+
**Style**
|
|
162
|
+
|
|
163
|
+
- **`style.lines`** (default `{color:"default", attributes:[]}`) — fixed-line look.
|
|
164
|
+
- **`style.rows`** — wildcard `"*": {color:"subdued", attributes:[]}` plus per-row overrides. Colors are theme roles: default, subdued, warning, error, success, info. Attributes: bold, dim, italic, underline, blink, inverse, hidden, strikethrough.
|
|
165
|
+
|
|
166
|
+
Config precedence: host plugin options beat `flight-deck.jsonc`, which beats defaults, merged key by key.
|
|
167
|
+
|
|
168
|
+
### Recipes
|
|
169
|
+
|
|
170
|
+
Quota, session id, and branch:
|
|
171
|
+
|
|
172
|
+
```jsonc
|
|
173
|
+
{ "sidebar": { "rows": ["status", "cost", "project", "go", "ses", "branch", "elapsed"] } }
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Split the money rows: session and lifetime:
|
|
177
|
+
|
|
178
|
+
```jsonc
|
|
179
|
+
{
|
|
180
|
+
"sidebar": { "rows": ["status", "cost", "total", "elapsed"] },
|
|
181
|
+
"layout": { "labels": { "cost": "session", "total": "lifetime" } }
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
With `total` on the rail, `cost` draws the session's own figure, so this reads `session $1.00` and `lifetime $2.00 · 1 subagent`.
|
|
186
|
+
|
|
187
|
+
Realtime speed plus time to first token:
|
|
188
|
+
|
|
189
|
+
```jsonc
|
|
190
|
+
{ "sidebar": { "rows": ["status", "tps", "elapsed"], "tps": { "display": "both" } } }
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Silence every toast with one key:
|
|
194
|
+
|
|
195
|
+
```jsonc
|
|
196
|
+
{ "notifications": { "enabled": false } }
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Watchdog on for long runs:
|
|
200
|
+
|
|
201
|
+
```jsonc
|
|
202
|
+
{ "sidebar": { "rows": ["status", "caution", "cost", "elapsed"] }, "caution": { "enabled": true } }
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Requirements
|
|
206
|
+
|
|
207
|
+
- OpenCode `2.1.1` or newer (2.x)
|
|
208
|
+
- Node `>=22` or Bun `>=1.4.0`
|
|
209
|
+
|
|
210
|
+
## Links
|
|
211
|
+
|
|
212
|
+
- Source: https://github.com/nathwn12/oc-collections/tree/main/packages/oc-flight-deck — the npm package remains individually installable.
|
|
213
|
+
- Package: https://www.npmjs.com/package/oc-flight-deck
|
|
214
|
+
- Issues: https://github.com/nathwn12/oc-collections/issues
|
|
215
|
+
- OpenCode V2 plugin API: https://opencode.ai/v2/docs/build/plugins/cli
|
|
216
|
+
- Example config: [flight-deck.example.jsonc](../flight-deck.example.jsonc)
|
|
217
|
+
- Config schema: [flight-deck.schema.json](../flight-deck.schema.json)
|
|
218
|
+
- Install: [INSTALL.md](../INSTALL.md)
|
|
219
|
+
- Changelog: [CHANGELOG.md](../CHANGELOG.md)
|
|
220
|
+
- Releases: https://github.com/nathwn12/oc-collections/releases
|
|
221
|
+
- Licence: MIT, see [LICENSE](../LICENSE)
|
|
222
|
+
|
|
223
|
+
<!-- nathwn12 house footer: identical in every repo. Do not edit. -->
|
|
224
|
+
<p align="center">
|
|
225
|
+
<a href="https://github.com/nathwn12"><img src="../assets/signature.svg" width="96" alt="nathwn12" /></a>
|
|
226
|
+
</p>
|
|
227
|
+
<p align="center">
|
|
228
|
+
<sub>Built by <a href="https://github.com/nathwn12">nathwn12</a> · <a href="https://github.com/nathwn12?tab=repositories">All projects</a></sub>
|
|
229
|
+
</p>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oc-flight-deck",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.3",
|
|
4
4
|
"description": "Live OpenCode V2 session telemetry — agent, model, branch, cost, tokens, cache hit rate and context usage in your sidebar.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"opencode",
|
|
@@ -41,7 +41,8 @@
|
|
|
41
41
|
"LICENSE",
|
|
42
42
|
"CHANGELOG.md",
|
|
43
43
|
"INSTALL.md",
|
|
44
|
-
"assets"
|
|
44
|
+
"assets",
|
|
45
|
+
"docs/GUIDE.md"
|
|
45
46
|
],
|
|
46
47
|
"engines": {
|
|
47
48
|
"node": ">=22",
|
|
@@ -58,10 +59,8 @@
|
|
|
58
59
|
"publishConfig": {
|
|
59
60
|
"access": "public"
|
|
60
61
|
},
|
|
61
|
-
"dependencies": {
|
|
62
|
-
"@opencode/plugin": "2.1.1"
|
|
63
|
-
},
|
|
64
62
|
"devDependencies": {
|
|
63
|
+
"@opencode/plugin": "2.1.3",
|
|
65
64
|
"@opentui/core": "0.6.6",
|
|
66
65
|
"@opentui/solid": "0.6.6",
|
|
67
66
|
"@types/bun": "^1.4.2",
|
|
@@ -70,8 +69,14 @@
|
|
|
70
69
|
"typescript": "^5.9.3"
|
|
71
70
|
},
|
|
72
71
|
"peerDependencies": {
|
|
72
|
+
"@opencode/plugin": ">=2.1.1 <3",
|
|
73
73
|
"@opentui/core": ">=0.6.6",
|
|
74
74
|
"@opentui/solid": ">=0.6.6",
|
|
75
75
|
"solid-js": ">=1.9.0"
|
|
76
|
+
},
|
|
77
|
+
"peerDependenciesMeta": {
|
|
78
|
+
"@opencode/plugin": {
|
|
79
|
+
"optional": true
|
|
80
|
+
}
|
|
76
81
|
}
|
|
77
82
|
}
|
package/src/tui/go.ts
CHANGED
|
@@ -84,7 +84,7 @@ type GoUpdate = (mutation: (draft: GoStoreState) => void) => void;
|
|
|
84
84
|
* Minimal on purpose, like `storage` above: the bridge needs one capability, so
|
|
85
85
|
* it names one capability and stays trivially stubbable. It is no longer a
|
|
86
86
|
* stand-in for a declaration the pin lacked - the pinned `@opencode/plugin`
|
|
87
|
-
* client (`@opencode/client` 2.
|
|
87
|
+
* client (`@opencode/client` 2.1.3) declares `credential.list()`, so the call
|
|
88
88
|
* below is direct and type-checked. The runtime `typeof list === "function"`
|
|
89
89
|
* check stays because the host binary is what actually answers: a host whose
|
|
90
90
|
* client predates the method yields no key instead of throwing.
|