oc-flight-deck 0.20.7 → 0.21.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 (4) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +23 -14
  3. package/docs/GUIDE.md +147 -114
  4. package/package.json +11 -14
package/CHANGELOG.md CHANGED
@@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.21.1] - 2026-11-01
11
+
12
+ ### Fixed
13
+
14
+ - `@opencode/plugin` is a runtime dependency; as an optional peer it was absent from the published install, so both entrypoints threw ERR_MODULE_NOT_FOUND.
15
+
16
+ ## [0.21.0] - 2026-10-31
17
+
18
+ ### Changed
19
+
20
+ - The `@opencode/plugin` development pin is `2.2.4`, exact rather than a caret or `latest`: the fixture requires a concrete version, and the types and the build read exactly one SDK. No source change and no peer-range change: `@opencode/plugin` stays `>=2.1.1 <3`.
21
+
22
+ ### Breaking, relative to 0.20.7
23
+
24
+ - `@opentui/core` and `@opentui/solid` peer ranges are `>=0.8.0`, up from `>=0.6.6`. A host below 0.8.0 is outside the declared range.
25
+
10
26
  ## [0.20.7] - 2026-10-30
11
27
 
12
28
  ### Changed
package/README.md CHANGED
@@ -10,23 +10,32 @@ Add the entry to the `plugins` array in your `opencode.jsonc`, then restart Open
10
10
  { "plugins": ["oc-flight-deck"] }
11
11
  ```
12
12
 
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.
14
-
15
- ## What it does
16
-
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.
13
+ ## What you get
14
+
15
+ | Capability | What it does for you |
16
+ | --- | --- |
17
+ | Session rail | Draws up to 18 named rows beside the session, each one live, in the order you choose. |
18
+ | Money | Rolls up this conversation plus its subagent tree, with project-wide spend on its own row. |
19
+ | Tokens and cache | Shows input and output tokens, and a cache hit rate whose denominator excludes writes, because a write is not a lookup. |
20
+ | Context gauge | Draws occupancy as a bar plus a percentage, and says out loud with a `~` that it is an estimate. |
21
+ | Elapsed time | Counts active turn time, recomputed from the turn spans the host recorded, so it survives a restart and never steps backwards. |
22
+ | Speed | Reports a settled-turn average, a realtime estimate, or both plus time to first token. |
23
+ | Caution annunciator | An opt-in watchdog row that stays silent until a tool or a turn stops moving, then reports what it observed without killing anything. |
24
+ | Quota and session rows | Draws the Go usage dials, and a session id row that copies the full id on click. |
25
+ | One config file | Keeps every setting in one global file, and nothing per project. |
22
26
 
23
27
  ## Requirements
24
28
 
25
- Any platform OpenCode V2 runs on, with OpenCode 2.1.1 or newer, and Node 22 or Bun 1.4 or newer.
29
+ OpenCode 2.1.1 or newer, with Node 22 or Bun 1.4 or newer, on any platform the host runs on.
26
30
 
27
- ## Full documentation
31
+ ## Going deeper
28
32
 
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>
33
+ The manual at <https://github.com/nathwn12/oc-collections/blob/main/packages/oc-flight-deck/docs/GUIDE.md> covers every row and what its number means, every setting with its default, the refresh behaviour, and worked config recipes.
31
34
 
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.
35
+ <!-- nathwn12 house footer: identical in every repo. Do not edit. -->
36
+ <p align="center">
37
+ <a href="https://github.com/nathwn12"><img src="assets/signature.svg" width="96" alt="nathwn12" /></a>
38
+ </p>
39
+ <p align="center">
40
+ <sub>Built by <a href="https://github.com/nathwn12">nathwn12</a> · <a href="https://github.com/nathwn12?tab=repositories">All projects</a></sub>
41
+ </p>
package/docs/GUIDE.md CHANGED
@@ -1,41 +1,23 @@
1
1
  <p align="center">
2
2
  <img src="../assets/icon.svg" width="120" height="120" alt="oc-flight-deck icon" />
3
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>
4
+ <h1 align="center">oc-flight-deck guide</h1>
6
5
 
7
- ## Install
6
+ ## How it works
8
7
 
9
- Add the entry to the `plugins` array in your `opencode.jsonc`, then restart OpenCode:
8
+ The plugin registers one sidebar rail and one ticker. On every tick it reads what the host already recorded and redraws the rows that changed; it never writes to the session and never blocks a turn.
10
9
 
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
10
+ **Three scopes decide which numbers you see.** `cost`, `tokens`, `cache`, `reasoning` and `tps` roll up the open conversation plus the subagent sessions the host links to it by `parentID`. `project` covers every session in the project. `elapsed` counts active turn time, not wall clock. The link is the host's own: an independently spawned top-level session is not counted as a child, and `project` is the surface for that.
19
11
 
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
- ```
12
+ **Refresh behaviour.** The rail ticks every `refresh` milliseconds (default `100`, allowed range 0–60000; values 1–15 clamp up to 16). While nothing is happening the tick backs off to about one second, so an idle session costs almost nothing. `refresh: 0` turns the ticker off entirely: clock-derived rows then move only when the host fires an event, and a row that needs a tick to change its number simply stops moving. Host events always redraw immediately, whatever the interval.
23
13
 
24
- ### Offline or pinned
14
+ **Restart safety.** Elapsed time and speed are recomputed from the assistant-turn spans the host recorded, not accumulated in memory, so a restart does not reset the clock and elapsed time never steps backwards while the host still reports those turns.
25
15
 
26
- The registry is the only install route: tagged releases only.
16
+ **Config precedence.** Host plugin options beat `flight-deck.jsonc`, which beats the defaults, merged key by key. A bad value restores its default and raises a one-time toast naming the key.
27
17
 
28
- ```json
29
- { "plugins": ["oc-flight-deck"] }
30
- ```
18
+ ## Panels
31
19
 
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:
20
+ One rail, in the order you list the rows, dimmed under any fixed lines. A session with subagents, defaults, a 200k window:
39
21
 
40
22
  ```text
41
23
  status ⠙ running
@@ -51,21 +33,15 @@ elapsed 2h 14m 07s
51
33
  tps 41 tok/s
52
34
  ```
53
35
 
54
- Add `"ses"` to `sidebar.rows`, then click the `session` row to copy the full id. Add `"go"` to `sidebar.rows` for quota.
36
+ Which rows draw is `sidebar.rows`; what each row's number means is the Rows table under Configure it.
55
37
 
56
- ## What you get
38
+ **The footer.** `sidebar.footer.lines` puts fixed text in the host footer slot, outside the rail cap; the documented branding pair is `["▸ FLIGHT DECK","─────────────────"]`.
57
39
 
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
40
+ **The Go panel.** `sidebar.footer.go` adds the live Go usage panel: three fixed-width lines above the host location row, sharing one account-wide poll with the `go` row.
65
41
 
66
42
  ## Configure it
67
43
 
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`.
44
+ 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. Comments and trailing commas are accepted by the Bun-hosted TUI.
69
45
 
70
46
  ```jsonc
71
47
  {
@@ -73,103 +49,123 @@ You configure one global file: `~/.config/opencode/flight-deck.jsonc`. The `.jso
73
49
  }
74
50
  ```
75
51
 
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
- | `updated` | Absolute timestamp of the newest action the host recorded: the latest message's `completed`, else `streamed`, else `created` stamp. The host locale and time zone apply by default; `format.timestamp` sets the locale, date and time styles, the 12/24-hour clock, and an IANA zone or UTC offset. A Windows zone id is rejected and the host zone is used. | opt-in |
94
- | `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 |
95
- | `spark` | Recent turn sizes as a sparkline; the newest samples are kept. | opt-in |
96
- | `reasoning` | Reasoning tokens, family scope. | opt-in |
97
- | `turns` | Prompts sent this session. | opt-in |
98
- | `guard` | Harness status when a guard bridge supplies it (breaches, orphans, findings, or ok). Without the bridge the row has no data. | opt-in |
99
- | `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 |
100
- | `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 |
101
- | `session` | Alias for `ses`; accepted in `sidebar.rows` and folded to it. | opt-in |
102
-
103
- 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, and `updated` has none either: it draws `sidebar.placeholder` (`—`) until the host records an action, because there is no honest zero timestamp. Set `persist: false` to omit rows with no data instead.
104
-
105
52
  ### Settings
106
53
 
107
54
  **Refresh**
108
55
 
109
- - **`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.
56
+ | Key | Default | Effect |
57
+ | --- | --- | --- |
58
+ | **`refresh`** | `100` | Milliseconds 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. |
110
59
 
111
60
  **Sidebar**
112
61
 
113
- - **`sidebar.enabled`** (default `true`) — `false` leaves the plugin loaded but invisible.
114
- - **`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.
115
- - **`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.
116
- - **`sidebar.footer.lines`** (default `[]`) — fixed lines in the host footer slot, outside the rail cap; max 24. The documented branding pair is `["▸ FLIGHT DECK","─────────────────"]`.
117
- - **`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).
118
- - **`sidebar.persist`** (default `true`) — every named row renders, drawing its zero skeleton until data arrives; `false` omits rows with no data.
119
- - **`sidebar.placeholder`** (default `"—"`) — non-empty string; only for a data-less row with no skeleton. `caution` never draws it, and `updated` draws it until the host records an action.
120
- - **`sidebar.maxLines`** (default `24`) — whole rail, fixed lines plus rows, 1–24.
121
- - **`sidebar.tps.scope`** (default `"family"`) — `"family"` paces the open session plus subagents; `"session"` paces the open session alone.
122
- - **`sidebar.tps.display`** (default `"avg"`) — `"avg"` settled-turn average, `"rt"` realtime estimate, `"both"` both figures plus ttft.
62
+ | Key | Default | Effect |
63
+ | --- | --- | --- |
64
+ | **`sidebar.enabled`** | `true` | `false` leaves the plugin loaded but invisible. |
65
+ | **`sidebar.rows`** | `["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. |
66
+ | **`sidebar.lines`** | `[]` | Fixed lines above the rows. Max 24. These plus rows share the rail cap (`maxLines`); fixed lines render at full brightness while live rows are dimmed. |
67
+ | **`sidebar.footer.lines`** | `[]` | Fixed lines in the host footer slot, outside the rail cap; max 24. |
68
+ | **`sidebar.footer.go`** | `false` | `true` or an object draws the live Go usage panel. 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). |
69
+ | **`sidebar.persist`** | `true` | Every named row renders, drawing its zero skeleton until data arrives; `false` omits rows with no data. |
70
+ | **`sidebar.placeholder`** | `"—"` | Non-empty string; only for a data-less row with no skeleton. `caution` never draws it, and `updated` draws it until the host records an action. |
71
+ | **`sidebar.maxLines`** | `24` | Whole rail, fixed lines plus rows, 1–24. |
72
+ | **`sidebar.tps.scope`** | `"family"` | `"family"` paces the open session plus subagents; `"session"` paces the open session alone. |
73
+ | **`sidebar.tps.display`** | `"avg"` | `"avg"` settled-turn average, `"rt"` realtime estimate, `"both"` both figures plus ttft. |
123
74
 
124
75
  **Footer**
125
76
 
126
- - **`footer.enabled`** (default `true` when any other footer key is present, `false` when the section is absent) — writing any footer key turns it on.
127
- - **`footer.text`** (default `"Flight Deck"`) — max 120 chars; control chars become spaces.
77
+ | Key | Default | Effect |
78
+ | --- | --- | --- |
79
+ | **`footer.enabled`** | `true` when any other footer key is present, `false` when the section is absent | Writing any footer key turns it on. |
80
+ | **`footer.text`** | `"Flight Deck"` | Max 120 chars; control chars become spaces. |
128
81
 
129
82
  **Caution**
130
83
 
131
- - **`caution.enabled`** (default `false`) — run the annunciator; off means no row and no timer.
132
- - **`caution.toolWatchSeconds`** (default `180`) — a tool running longer draws `▲`.
133
- - **`caution.toolCautionSeconds`** (default `420`) — a tool running longer becomes `●`; raised to the watch value if lower.
134
- - **`caution.turnWatchSeconds`** (default `600`) — a running session producing nothing draws `▲`; suppressed while a tool or shell runs.
135
- - **`caution.turnCautionSeconds`** (default `1200`) — quiet session becomes `●`; same raise rule. All four thresholds take 0 or more.
136
- - **`caution.repeatThreshold`** (default `3`, min 2) — identical consecutive calls before a loop is reported; applies to successes and failures.
137
- - **`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.
138
- - **`caution.toast`** (default `false`) — toast once per distinct problem, re-arming when the session goes quiet.
84
+ | Key | Default | Effect |
85
+ | --- | --- | --- |
86
+ | **`caution.enabled`** | `false` | Run the annunciator; off means no row and no timer. |
87
+ | **`caution.toolWatchSeconds`** | `180` | A tool running longer draws `▲`. |
88
+ | **`caution.toolCautionSeconds`** | `420` | A tool running longer becomes `●`; raised to the watch value if lower. |
89
+ | **`caution.turnWatchSeconds`** | `600` | A running session producing nothing draws `▲`; suppressed while a tool or shell runs. |
90
+ | **`caution.turnCautionSeconds`** | `1200` | Quiet session becomes `●`; same raise rule. All four thresholds take 0 or more. |
91
+ | **`caution.repeatThreshold`** | `3` (min 2) | Identical consecutive calls before a loop is reported; applies to successes and failures. |
92
+ | **`caution.exemptTools`** | `["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. |
93
+ | **`caution.toast`** | `false` | Toast once per distinct problem, re-arming when the session goes quiet. |
139
94
 
140
95
  **Notifications**
141
96
 
142
- - **`notifications.enabled`** (default `true`) — the one-key off switch; `false` silences every toast.
143
- - **`notifications.config`** (default `true`) — the one-time toast naming a bad config key.
144
- - **`notifications.copy`** (default `true`) — the toast for an unverified copy.
145
- - **`notifications.caution`** (default `true`) — the opt-in caution toast. Every flag only silences.
97
+ | Key | Default | Effect |
98
+ | --- | --- | --- |
99
+ | **`notifications.enabled`** | `true` | The one-key off switch; `false` silences every toast. |
100
+ | **`notifications.config`** | `true` | The one-time toast naming a bad config key. |
101
+ | **`notifications.copy`** | `true` | The toast for an unverified copy. |
102
+ | **`notifications.caution`** | `true` | The opt-in caution toast. Every flag only silences. |
146
103
 
147
104
  **Layout**
148
105
 
149
- - **`layout.labelWidth`** (default `10`, 6–24) — label column width.
150
- - **`layout.barWidth`** (default `10`, 1–40) — context gauge cells.
151
- - **`layout.sparkWidth`** (default `12`, 2–64) — sparkline samples.
152
- - **`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.
106
+ | Key | Default | Effect |
107
+ | --- | --- | --- |
108
+ | **`layout.labelWidth`** | `10` (6–24) | Label column width. |
109
+ | **`layout.barWidth`** | `10` (1–40) | Context gauge cells. |
110
+ | **`layout.sparkWidth`** | `12` (2–64) | Sparkline samples. |
111
+ | **`layout.labels`** | `{}` | 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. |
153
112
 
154
113
  **Format**
155
114
 
156
- - **`format.duration`** (default `"spaced"`, `2h 14m 37s`) — or `"compact"` (`2h14m37s`). Zero-padding is the same either way (`14m 07s`, never `14m 7s`).
157
- - **`format.timestamp.locale`** (default the host locale) — BCP-47 locale for the `updated` row, for example `"en-GB"`. A malformed locale is reported and the host locale is used.
158
- - **`format.timestamp.dateStyle`** (default `"short"`) — `"short"` (locale numeric date), `"medium"` (spelled month, wider), or `"none"` (time only).
159
- - **`format.timestamp.timeStyle`** (default `"medium"`) — `"medium"` keeps seconds, `"short"` drops them, `"none"` leaves a date-only row. Both halves cannot be `"none"`: the pair falls back to the defaults with a warning.
160
- - **`format.timestamp.hour12`** (default: the locale's own clock) — `true` forces `2:32:07 PM`, `false` forces `14:32:07`.
161
- - **`format.timestamp.timeZone`** (default the host zone) — an IANA name (`"Asia/Tokyo"`) or UTC offset (`"+05:30"`). Omit it to follow the host through daylight-saving changes; a Windows zone id is not valid and is reported, with the host zone used.
115
+ | Key | Default | Effect |
116
+ | --- | --- | --- |
117
+ | **`format.duration`** | `"spaced"` (`2h 14m 37s`) | Or `"compact"` (`2h14m37s`). Zero-padding is the same either way (`14m 07s`, never `14m 7s`). |
118
+ | **`format.timestamp.locale`** | the host locale | BCP-47 locale for the `updated` row, for example `"en-GB"`. A malformed locale is reported and the host locale is used. |
119
+ | **`format.timestamp.dateStyle`** | `"short"` | `"short"` (locale numeric date), `"medium"` (spelled month, wider), or `"none"` (time only). |
120
+ | **`format.timestamp.timeStyle`** | `"medium"` | `"medium"` keeps seconds, `"short"` drops them, `"none"` leaves a date-only row. Both halves cannot be `"none"`: the pair falls back to the defaults with a warning. |
121
+ | **`format.timestamp.hour12`** | the locale's own clock | `true` forces `2:32:07 PM`, `false` forces `14:32:07`. |
122
+ | **`format.timestamp.timeZone`** | the host zone | An IANA name (`"Asia/Tokyo"`) or UTC offset (`"+05:30"`). Omit it to follow the host through daylight-saving changes; a Windows zone id is not valid and is reported, with the host zone used. |
162
123
 
163
124
  **Glyphs**
164
125
 
165
- - **`glyphs.watch`** (default `"▲"`), **`glyphs.caution`** (default `"●"`), **`glyphs.clear`** (default `"○"`, reserved, not drawn today) — 1–2 chars each.
126
+ | Key | Default | Effect |
127
+ | --- | --- | --- |
128
+ | **`glyphs.watch`** | `"▲"` | The watch glyph, 1–2 chars. |
129
+ | **`glyphs.caution`** | `"●"` | The caution glyph, 1–2 chars. |
130
+ | **`glyphs.clear`** | `"○"` | Reserved, not drawn today. |
166
131
 
167
132
  **Style**
168
133
 
169
- - **`style.lines`** (default `{color:"default", attributes:[]}`) — fixed-line look.
170
- - **`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.
134
+ | Key | Default | Effect |
135
+ | --- | --- | --- |
136
+ | **`style.lines`** | `{color:"default", attributes:[]}` | Fixed-line look. |
137
+ | **`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. |
138
+
139
+ ### Rows
140
+
141
+ Every name `sidebar.rows` accepts, what its number means, and whether it draws by default.
142
+
143
+ | Row | What it shows | Default |
144
+ | --- | --- | --- |
145
+ | `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 |
146
+ | `status` | `⠙ running` while anything works (this session, a subagent, or a shell); `○ idle` otherwise. | yes |
147
+ | `agent` | Active agent name. | yes |
148
+ | `model` | Model id, plus ` · variant` when one is present. | yes |
149
+ | `branch` | Current git branch. Costs a VCS call. | opt-in |
150
+ | `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`. | yes |
151
+ | `total` | Family total plus subagent count, `$1.84 · 0 subagents` when childless. | opt-in |
152
+ | `project` | Every session in the project: `$12.40 · 21 sessions` when more than one, else just the figure. | yes |
153
+ | `tokens` | `1.2M in · 84k out`, same family scope as `cost`. | yes |
154
+ | `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 |
155
+ | `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 |
156
+ | `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 |
157
+ | `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 |
158
+ | `updated` | Absolute timestamp of the newest action the host recorded: the latest message's `completed`, else `streamed`, else `created` stamp. The host locale and time zone apply by default; `format.timestamp` sets the locale, date and time styles, the 12/24-hour clock, and an IANA zone or UTC offset. A Windows zone id is rejected and the host zone is used. | opt-in |
159
+ | `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 |
160
+ | `spark` | Recent turn sizes as a sparkline; the newest samples are kept. | opt-in |
161
+ | `reasoning` | Reasoning tokens, family scope. | opt-in |
162
+ | `turns` | Prompts sent this session. | opt-in |
163
+ | `guard` | Harness status when a guard bridge supplies it (breaches, orphans, findings, or ok). Without the bridge the row has no data. | opt-in |
164
+ | `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 |
165
+ | `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 |
166
+ | `session` | Alias for `ses`; accepted in `sidebar.rows` and folded to it. | opt-in |
171
167
 
172
- Config precedence: host plugin options beat `flight-deck.jsonc`, which beats defaults, merged key by key.
168
+ 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, and `updated` has none either: it draws `sidebar.placeholder` (`—`) until the host records an action, because there is no honest zero timestamp. Set `persist: false` to omit rows with no data instead.
173
169
 
174
170
  ### Recipes
175
171
 
@@ -179,7 +175,7 @@ Quota, session id, and branch:
179
175
  { "sidebar": { "rows": ["status", "cost", "project", "go", "ses", "branch", "elapsed"] } }
180
176
  ```
181
177
 
182
- Split the money rows: session and lifetime:
178
+ Split the money rows into session and lifetime:
183
179
 
184
180
  ```jsonc
185
181
  {
@@ -208,22 +204,59 @@ Watchdog on for long runs:
208
204
  { "sidebar": { "rows": ["status", "caution", "cost", "elapsed"] }, "caution": { "enabled": true } }
209
205
  ```
210
206
 
211
- ## Requirements
207
+ ## Commands
208
+
209
+ The plugin exposes no tools and no CLI: it draws, and the host owns the session. The read-only host commands below are how you check it, and how you find the file this guide names.
210
+
211
+ | Command | What it returns |
212
+ | --- | --- |
213
+ | `opencode plugin check` | Whether every configured plugin loads. Run it first when the rail does not draw. |
214
+ | `opencode plugin list` | The loaded plugins, including `oc-flight-deck`. |
215
+ | `opencode debug paths` | The config root that holds `flight-deck.jsonc`. |
216
+
217
+ The shipped `flight-deck.example.jsonc` is a complete starting file, and `flight-deck.schema.json` validates your own against every key above.
218
+
219
+ ## Troubleshooting
220
+
221
+ **The rail does not draw.** Run `opencode plugin check`, confirm `oc-flight-deck` is in the loaded list, then restart. A rail with `sidebar.enabled: false` is loaded but invisible by design.
222
+
223
+ **A row is missing.** Only rows named in `sidebar.rows` draw, and the default list is 11 of them; add the rest by name. Unknown names are ignored with a one-time warning. With `persist: false`, a row with no data yet is omitted rather than drawn as a zero.
224
+
225
+ **A number looks wrong after a restart.** Cost, tokens, and context come from what the host recorded; elapsed and speed are recomputed from turn spans. If the host did not record the turns — a session restored from elsewhere — those rows start from what exists rather than inventing the gap.
226
+
227
+ **`cost` and `project` disagree.** They answer different questions. `cost` is this conversation plus its subagent tree; `project` is every session in the project, including sessions that were never children of this one.
228
+
229
+ **The `context` gauge is not exact.** It is an occupancy proxy, drawn with a `~` on purpose. It is not the model's own token count.
230
+
231
+ **A config value is ignored.** A bad value restores its default and toasts once naming the key; silence that toast with `notifications.config: false`. A file in a project root configures nothing — the only file read is the global one.
232
+
233
+ **The `go` row is blank.** It reads OpenCode's active opencode-go credential store. With no such credential there is nothing to read, and no environment variable sets it.
234
+
235
+ **Toasts are noisy.** `notifications.enabled: false` silences every kind at once. The four flags under it only ever silence.
236
+
237
+ ## Limitations
212
238
 
213
- - OpenCode `2.1.1` or newer (2.x)
214
- - Node `>=22` or Bun `>=1.4.0`
239
+ - The context gauge is an estimate derived from recorded request sizes, not a measurement from the model.
240
+ - Cache hit rate excludes cache writes from the denominator by design; a figure that includes them would be a different metric, not a more accurate one.
241
+ - `cost` follows the host's `parentID` link only. Work done in an unrelated top-level session shows in `project` and nowhere else.
242
+ - `branch` costs a VCS call per read, which is why it is off by default.
243
+ - `guard` has no data unless a guard bridge supplies it.
244
+ - `go` depends on an active opencode-go credential; it cannot report quota for any other provider.
245
+ - The caution annunciator only reports. It never aborts, kills, retries, or blocks a turn.
246
+ - One global config file, no per-project override: a per-repo look is a non-feature here.
247
+ - No tools are registered, so nothing in this package is callable by an agent.
215
248
 
216
249
  ## Links
217
250
 
218
- - Source: https://github.com/nathwn12/oc-collections/tree/main/packages/oc-flight-deck — the npm package remains individually installable.
219
- - Package: https://www.npmjs.com/package/oc-flight-deck
220
- - Issues: https://github.com/nathwn12/oc-collections/issues
221
- - OpenCode V2 plugin API: https://opencode.ai/v2/docs/build/plugins/cli
251
+ - Source: <https://github.com/nathwn12/oc-collections/tree/main/packages/oc-flight-deck>
252
+ - Package: <https://www.npmjs.com/package/oc-flight-deck>
253
+ - Issues: <https://github.com/nathwn12/oc-collections/issues>
254
+ - OpenCode V2 plugin API: <https://opencode.ai/v2/docs/build/plugins/cli>
222
255
  - Example config: [flight-deck.example.jsonc](../flight-deck.example.jsonc)
223
256
  - Config schema: [flight-deck.schema.json](../flight-deck.schema.json)
224
257
  - Install: [INSTALL.md](../INSTALL.md)
225
258
  - Changelog: [CHANGELOG.md](../CHANGELOG.md)
226
- - Releases: https://github.com/nathwn12/oc-collections/releases
259
+ - Releases: <https://github.com/nathwn12/oc-collections/releases>
227
260
  - Licence: MIT, see [LICENSE](../LICENSE)
228
261
 
229
262
  <!-- nathwn12 house footer: identical in every repo. Do not edit. -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oc-flight-deck",
3
- "version": "0.20.7",
3
+ "version": "0.21.1",
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",
@@ -59,24 +59,21 @@
59
59
  "publishConfig": {
60
60
  "access": "public"
61
61
  },
62
+ "dependencies": {
63
+ "@opencode/plugin": "^2.2.5"
64
+ },
62
65
  "devDependencies": {
63
- "@opencode/plugin": "2.2.2",
64
- "@opentui/core": "0.7.0",
65
- "@opentui/solid": "0.7.0",
66
- "@types/bun": "^1.4.2",
67
- "solid-js": "1.9.12",
66
+ "@opencode/plugin": "2.2.5",
67
+ "@opentui/core": "^0.8.0",
68
+ "@opentui/solid": "^0.8.0",
69
+ "@types/bun": "^1.4.4",
70
+ "solid-js": "1.9.18",
68
71
  "string-width": "7.2.0",
69
72
  "typescript": "^5.9.3"
70
73
  },
71
74
  "peerDependencies": {
72
- "@opencode/plugin": ">=2.1.1 <3",
73
- "@opentui/core": ">=0.6.6",
74
- "@opentui/solid": ">=0.6.6",
75
+ "@opentui/core": ">=0.8.0",
76
+ "@opentui/solid": ">=0.8.0",
75
77
  "solid-js": ">=1.9.0"
76
- },
77
- "peerDependenciesMeta": {
78
- "@opencode/plugin": {
79
- "optional": true
80
- }
81
78
  }
82
79
  }