oc-flight-deck 0.11.0 → 0.19.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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,79 @@ All notable changes to this project are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.19.1] - 2026-10-16
9
+
10
+ ### Changed
11
+
12
+ - The TUI entrypoint now consumes the host renderer instead of shipping its own `@opentui/*` copy: `@opentui/core` and `@opentui/solid` moved from `dependencies` to `peerDependencies`-only (`>=0.5.17`, matching the host), per the official CLI plugin contract. Opencode v2.0.30 refuses to load a plugin that ships and value-imports its own `@opentui/core`, so the vendored value imports are gone: the OSC52 fallback calls the host renderer's `copyToClipboardOSC52` structurally (same capability gating as before), and the text-attribute bits are pinned as local literals asserted against the vendored enum in tests. There is no sanctioned host clipboard surface, so without a renderer fallback the copy path reports `no-backend` instead of throwing. `@opencode/plugin` is pinned to the current host version `2.0.30`.
13
+
14
+ ### Added
15
+
16
+ - `layout.labels`: rename any rail row's label, keyed by the row name exactly as `sidebar.rows` spells it (`session` is folded to `ses`). `{ "cost": "session", "total": "lifetime" }` draws the session's own cost under `session` and the family total under `lifetime`; every row left out keeps its built-in label, so an install that never sets the key renders byte-identically to before. An unknown row name, a non-string value, or an empty label is reported as a config issue naming its path (`layout.labels.<name>`) and that row falls back to its default label. Both renderers resolve a row's label from the same map, so the plain-string view and the segmented (`style.rows`) view never disagree.
17
+ - `sidebar.tps.scope` (`"family"` or `"session"`, default `"family"`): which sessions the `tps` row paces. `family` sums generation tokens (output plus reasoning) across the open session and its subagent sessions over the union of all their streaming spans — concurrent decoders share wall clock, so overlapping spans merge instead of adding, and a root that is idle while its child decodes still reads live. `session` restores the previous per-session figure: the open session's own tokens over its own spans. An unknown value falls back to `"family"` and is reported.
18
+
19
+ ### Changed
20
+
21
+ - The `total` row draws the real family figure for a childless session: its own cost with `0 subagents`, instead of the persist layer's live-shaped `$0.000`. `treeTotals` now records a family of one as the session's own cost against a count of zero rather than returning nothing, and the row renders whenever a family figure exists — so a session that spawned no subagents still reads its lifetime figure under that row. `total` stays absent, and the unchanged skeleton draws, only when there is genuinely no tree or cost data at all (a session with no record yet), and a child session still has no `total` of its own. A session with subagents sums them exactly as before.
22
+
23
+ ### Fixed
24
+
25
+ - Opencode 2.0.30 compatibility: the shipped entries are now plain compiled JS in `dist/` (`bun run compile`), not raw source. A raw `.tsx` entry under `node_modules` falls back to Bun's native JSX transform on this host, whose injected `jsx-dev-runtime` import bypasses the rewrite loader and fails to resolve — so the TUI entry ships with explicit `jsx`/`jsxs` imports from `@opentui/solid/jsx-runtime` and no raw JSX. `package.json` `exports` (`"."` and `"./tui"`) and `files` point at `dist/` (`src` stays for types and dev), `@opentui/*` and `solid-js`/`solid-js/store` stay external with nothing bundled or copied.
26
+
27
+ ## [0.19.0] - 2026-10-11
28
+
29
+ ### Added
30
+
31
+ - `session` is accepted as an alias for the `ses` row in `sidebar.rows` and `style.rows`, normalized to `ses`. The row's rail label is now `session`: an 18-cell clipped preview of the id (never the full id), with the click still copying the full id to the terminal clipboard. The preview budget shrinks by however much the `session` label overflows `layout.labelWidth`, floored at 8 cells, so the row's total width is unchanged by the rename at every `layout.labelWidth` (at the default width 10 the budget is the full 18; at 6 it is 17).
32
+ - Zero skeletons for data-less rows under `sidebar.persist`: a row with no data draws a real-looking zero instead of the `—` placeholder — `$0.000` for `cost`/`total`/`project`, `0 in · 0 out` for `tokens`, `0 read` for `cache`, an empty bar plus `~0%` for `context`, `0 waiting` for `perms`, `0s` for `elapsed`, `0 tok/s` for `tps`, a flat `▁` bar for `spark`, `0` for `reasoning`, `0` for `turns`, `○ 0 ○ 0 ○ 0` for `go`, `○ idle` for `status`, `none` for `agent`/`model`/`ses`, `no branch` for `branch`, `unknown` for `guard`. `caution` is the one row that never draws a skeleton: the annunciator stays silent until there is something to announce. `sidebar.placeholder` is now only the fallback for a field with no skeleton, so the dash is unreachable in practice.
33
+
34
+ ### Changed
35
+
36
+ - `tokens`, `cache` and `reasoning` read the same family scope as `cost`: this conversation plus its subagent sessions when any exist, the session alone when there are none.
37
+ - `elapsed` is recomputed from the assistant-turn spans the host itself recorded for this session and its subagents, a turn still in flight ending at "now". A restart comes back with the same value instead of resetting, it cannot step backwards while the host still reports those turns, it freezes the instant everything settles, and it is NOT wall-clock since the session began.
38
+ - `tps` is directly per-session — subagents excluded: the displayed session's own generation tokens (output + reasoning) over its own generating time. It shows `0 tok/s` whenever the session is not generating (idle, between turns, or before the first sample), and it never seeds itself from a lifetime average.
39
+ - The `cost` row documents its limit plainly: the rollup follows the host's `parentID` link only (`family()`), so a session spawned as an independent top-level session — a `commander` spawning captains — carries no `parentID`, and the host returned no `metadata` field for the sessions probed during this work, so there is no automatic creator link today. A creator-supplied attribution link is a possible future extension, not a shipped feature. The `project` row is the surface that covers every session in the project, spawned sessions included.
40
+
41
+ ### Fixed
42
+
43
+ - The `tps` row no longer claims subagents are included: the figure never covered them, and the docs said it did.
44
+
45
+ ## [0.17.0] - 2026-10-10
46
+
47
+ ### Added
48
+
49
+ - `sidebar.footer.go` accepts `align` (`left`, `right`, `center`, default `right`): where each trailing value sits inside its own fixed-width percent (4) and reset (6) cell. `right` pins the value to the cell's right edge, so the digits stay put as values change length; `left` hugs the bar with the padding trailing; `center` splits the padding. Both trailing cells use the same setting, and the cell widths never move.
50
+
51
+ ### Removed
52
+
53
+ - The `OPENCODE_GO_API_KEY` environment fallback is gone: the `go` row and the footer Go panel resolve the Zen Go key only from OpenCode's own credential sources (the credential store, then the provider catalog's resolved `settings.apiKey`). With no usable entry the bridge stores null and reports the `no-key` reason without making a request.
54
+
55
+ ## [0.15.0] - 2026-10-11
56
+
57
+ ### Changed
58
+
59
+ - The footer Go panel draws three strict fixed-width columns - label (6, `ROLL`/`WEEK`/`MONTH`), meter (14), right-aligned percent (4) and right-aligned reset (6) with one space between columns - so the percent and the countdown share one axis and the bar starts and ends on the same columns on every row. The longest line stays within the sidebar width and never wraps.
60
+ - The `◈ OPENCODE GO` header no longer draws by default; the panel is three lines unless `header: true` opts it back in.
61
+ - `sidebar.footer.go` accepts `true`/`false` or a look object (`header`, `barWidth`, `labelWidth`, `percent`, `reset`, `sweep`, each falling back to its default). `true` keeps the default look (no header, 14-cell bar, 6-wide labels, both columns, static meter). The meter is static by default and changes only when the percentage itself changes; `sweep: true` opts the travelling highlight back in.
62
+
63
+ ## [0.14.0] - 2026-10-11
64
+
65
+ ### Changed
66
+
67
+ - The `go` row and the footer Go panel now resolve the Zen Go key from OpenCode's own credential store. The pinned `@opencode/plugin` client declares `credential.list()`, so the bridge calls it directly on every poll and uses the `key`-type entry for the `opencode-go` integration, preferring the `active` one. `OPENCODE_GO_API_KEY` becomes an optional fallback, read only when the store holds no usable entry. A host whose client predates `credential.list`, a rejected call, or a malformed payload degrades to the env var and then to the row's "no key" dash without making a request. The key is never logged and never leaves the Authorization header.
68
+
69
+ ## [0.13.0] - 2026-10-11
70
+
71
+ ### Added
72
+
73
+ - A live Go usage panel in the sidebar footer slot, enabled with `sidebar.footer.go`. It draws three lines - `Rolling` (`5h`), `Weekly` (`1w`), `Monthly` (`1m`) - each with a ten-cell bar, a whole-number percent and a reset countdown, using the `context` row's bar glyphs and the `go` row's error tone (90% or more, or a non-`ok` window status). It is off by default, claims the footer slot even when `sidebar.footer.lines` is empty, and shares the `go` row's single account-wide poll of `OPENCODE_GO_API_KEY` rather than starting a second one. With no data yet it draws three dim resting lines, never a blank slot.
74
+
75
+ ## [0.12.0] - 2026-10-09
76
+
77
+ ### Changed
78
+
79
+ - The `tps` numerator now counts generation tokens - output plus reasoning - over the same streaming-span union, so a thinking-heavy turn reads as speed instead of idle time with no output yet. Tool settlement is still excluded, the denominator still ends at `streamed`, and the `reasoning` row itself is unchanged.
80
+
8
81
  ## [0.11.0] - 2026-10-08
9
82
 
10
83
  ### Changed
@@ -52,6 +125,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
52
125
 
53
126
  - Opt-in `ses` sidebar row: shows the full session id (the rail wraps it), and a mouse click copies that same full id and reports the outcome - a confirmation naming the id when the copy was sent, a distinct failure message when the terminal cannot take it. Off by default, and degrades gracefully when the terminal cannot copy.
54
127
 
128
+ [0.15.0]: https://github.com/nathwn12/oc-flight-deck/compare/v0.14.0...v0.15.0
129
+ [0.14.0]: https://github.com/nathwn12/oc-flight-deck/compare/v0.13.0...v0.14.0
130
+ [0.13.0]: https://github.com/nathwn12/oc-flight-deck/compare/v0.12.0...v0.13.0
131
+ [0.12.0]: https://github.com/nathwn12/oc-flight-deck/compare/v0.11.0...v0.12.0
55
132
  [0.11.0]: https://github.com/nathwn12/oc-flight-deck/compare/v0.10.4...v0.11.0
56
133
  [0.10.4]: https://github.com/nathwn12/oc-flight-deck/compare/v0.10.3...v0.10.4
57
134
  [0.10.3]: https://github.com/nathwn12/oc-flight-deck/compare/v0.10.2...v0.10.3
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 nathwn12
3
+ Copyright (c) 2026 nathan <137482711+nathwn12@users.noreply.github.com>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,138 +1,60 @@
1
- <div align="center">
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>Render live session telemetry for OpenCode users — TypeScript.</strong></p>
6
+ <p align="center">
7
+ <a href="LICENSE"><img src="https://img.shields.io/github/license/nathwn12/oc-flight-deck" alt="License" /></a>
8
+ <img src="https://img.shields.io/github/languages/top/nathwn12/oc-flight-deck" alt="Language" />
9
+ <img src="https://img.shields.io/badge/platform-windows--linux-2b3137" alt="Platform" />
10
+ </p>
2
11
 
3
- # ✈️ oc-flight-deck
12
+ ## What it is
4
13
 
5
- **Live session telemetry for your OpenCode terminal.**
6
- *The numbers where you're already looking — because your agent is spending money right now.*
14
+ oc-flight-deck is an OpenCode V2 plugin that renders live session telemetry in the sidebar: status, agent, model, cost, project, tokens, cache, context, permissions, elapsed time and throughput, every row read from the open session at render time. Cost, tokens, cache and reasoning roll up the subagent tree through the host's parentID link, falling back to the session alone when there is none. It is for anyone running agent sessions who wants the numbers where they are already looking.
7
15
 
8
- [![npm version](https://img.shields.io/npm/v/oc-flight-deck)](https://www.npmjs.com/package/oc-flight-deck) [![license: MIT](https://img.shields.io/badge/license-MIT-blue)](./LICENSE) [![node >=22](https://img.shields.io/badge/node-%E2%89%A522-green)](https://nodejs.org) [![opencode v2](https://img.shields.io/badge/opencode-v2-blueviolet)](https://opencode.ai) [![npm weekly downloads](https://img.shields.io/npm/dw/oc-flight-deck)](https://www.npmjs.com/package/oc-flight-deck) [![CI](https://github.com/nathwn12/oc-flight-deck/actions/workflows/check.yml/badge.svg)](https://github.com/nathwn12/oc-flight-deck/actions/workflows/check.yml)
16
+ ## Why
9
17
 
10
- </div>
18
+ A session's own cost excludes its subagents, so the reported figure understates real spend — on the session this was built against, a reported $0.2246 against true spend of $0.2447, 9% low on money and 54% low on tokens. One money row tells the truth.
11
19
 
12
- ---
20
+ ## Features
13
21
 
14
- ## ⚡ Quick start
22
+ - Live rows for `status`, `agent`, `model`, `cost`, `project`, `tokens`, `cache`, `context`, `perms`, `elapsed` and `tps`, plus opt-in rows: `caution`, `branch`, `total`, `spark`, `reasoning`, `turns`, `guard`, `go` and `ses`. `layout.labels` renames any of them — `{ "cost": "session", "total": "lifetime" }` draws your own cost under `session` and the family total under `lifetime`.
23
+ - Family-scoped money: cost, tokens, cache and reasoning cover the conversation plus every subagent session in its tree; the project row covers every session in the project.
24
+ - Elapsed time recomputed from the assistant-turn spans the host recorded, so a restart returns the same value instead of resetting.
25
+ - Live throughput over `sidebar.tps.scope` (`family` or `session`, default `family`), reading `0 tok/s` whenever the scope is not generating.
26
+ - Stable rail: with `sidebar.persist` every named row draws a zero skeleton until the host has data, while caution stays silent until something stops moving.
27
+ - Reads only while the opt-in guard and go surfaces stay off: no telemetry, nothing on disk, no network calls; the single write is a click on the opt-in ses row sending the full session id to the terminal clipboard as a best-effort OSC52 request — terminal-dependent (the terminal may ignore it) and never reported as a confirmed copy. Enabling the opt-in `go` row or `sidebar.footer.go` panel polls `https://opencode.ai/zen/go/v1/usage` every 60 seconds, and only with `FLIGHT_DECK_GO_LOG=1` appends one observation line per poll to `tmpdir()/opencode/flight-deck-go.log` (never the key).
28
+ - A bad config value is ignored with its default restored and a one-time toast naming the key, so a typo never breaks the TUI.
15
29
 
16
- ```text
17
- Install the oc-flight-deck OpenCode plugin:
18
- 1. Add "oc-flight-deck" to the "plugins" array in ~/.config/opencode/opencode.jsonc.
19
- 2. Restart OpenCode.
20
- 3. Verify: the panel appears beside an open session.
21
- ```
22
-
23
- Add the plugin to your `opencode.jsonc`:
24
-
25
- ```jsonc
26
- // opencode.jsonc
27
- { "plugins": ["oc-flight-deck"] }
28
- ```
29
-
30
- Restart OpenCode. **That's the whole setup.** No config file, no options, nothing to learn. The panel appears beside an open session and starts reading.
31
-
32
- ---
33
-
34
- ## 📊 The panel
35
-
36
- ```text
37
- status ⠹ running
38
- agent orchestrator
39
- model deepseek-v4.1-flash · high
40
- branch main
41
- cost $0.245 · 2 subagents
42
- tokens 533k in · 91k out
43
- cache 98% hit · 32M read
44
- context ██░░░░░░░░ ~18%
45
- elapsed 2h 14m 37s
46
- tps 18 tok/s
47
- ```
48
-
49
- Every row is read from the open session at render time — except `caution`, which watches a clock rather than events (a hang emits none); `elapsed`, which is seeded once from the session's own recorded assistant turn spans and then accumulates the busy windows this run observes, rather than a value the session reports; and the opt-in `guard` row, which is polled from the local guard RPC.
50
-
51
- The panel's only fixed text — `▸ FLIGHT DECK` over a separator — is **opt-in**. It renders in the sidebar footer slot, a separate host region **below** the rows: the top of the rail starts directly with the live rows. Since 0.8.1 the footer is empty by default, so a fresh install draws the live rows and nothing else; set `sidebar.footer.lines` to the pair to re-enable it (see ⚙️ Configure). The footer is independent of `sidebar.rows` and `sidebar.maxLines`.
52
-
53
- | Row | What it shows |
54
- |---|---|
55
- | `caution` | **The annunciator** — silent unless something stopped moving · **off by default** |
56
- | `status` | A spinner while anything is working, a circle while it's idle |
57
- | `agent` | Which agent you're actually talking to |
58
- | `model` | The model **and its variant** — `high` behaves differently |
59
- | `branch` | The branch you're about to commit to · **off by default** |
60
- | `cost` | This conversation **plus its subagents**, and the count that explains it; with `total` on the rail, the session figure alone |
61
- | `total` | The family total and subagent count on a row of its own · **off by default** |
62
- | `project` | Every session in this project, not just the one on screen |
63
- | `tokens` | Input and output, cumulative |
64
- | `cache` | Hit rate first - `read / (read + input)` - then cache reads. Cache writes are excluded from the rate (creating an entry is not a lookup) but counted in `context` occupancy (a written entry still occupies the window) |
65
- | `context` | An estimated (`~`) gauge of how full the window is - occupancy is a proxy from the last request's `input + cache.read + cache.write`, not a host-reported figure |
66
- | `perms` | What is waiting for approval, not just how many |
67
- | `elapsed` | Active time — the clock runs only while this session, a subagent in its tree, or one of its shells is working, and freezes when everything settles. It is seeded once from the assistant turn spans the host already recorded for that session, so it survives a restart instead of resetting to `—`; work observed live after that keeps counting in memory. It measures active time, not wall-clock since the session began |
68
- | `tps` | Live speed **while generating**: the output-token delta between polls over the generating-time delta (streaming spans, or the busy-gated active clock), smoothed and drawn whole - no decimals. Reasoning has its own row and is out of the numerator. Idle is never divided: the figure freezes when everything settles and hides until ~2 s of generating time and ~10 tokens are on record. Not configurable |
69
- | `spark` | Recent turn sizes as a shape · **off by default** |
70
- | `reasoning` | Reasoning tokens, when the model emits them · **off by default** |
71
- | `turns` | How many prompts you've sent this session · **off by default** |
72
- | `guard` | Harness status from oc-harness-guard · **off by default** |
73
- | `go` | Zen Go account usage — a dial and a whole-number percent for the **5h**, **1w**, and **1m** windows, in that fixed order; a window at 90% or more turns its dial and number red, and the reset hint appears only then · **off by default** |
74
- | `ses` | An 18-wide clipped preview of the open session id (never the full id on the rail); **click the row** to copy the full id to the terminal clipboard . **off by default** (requires the host's mouse) |
75
-
76
- `project` matches on the host's **project id**, not on a directory, so a worktree counts as part of the same project. A host that reports no project id leaves nothing to match on, and the row then totals every session that host knows about.
77
-
78
- The rows marked **off by default** — `caution`, `branch`, `total`, `spark`, `reasoning`, `turns`, `guard`, `go`, and `ses` — are available but not in the default rail: add any of them to `sidebar.rows`. `caution` also needs `caution.enabled: true`; `go` needs `OPENCODE_GO_API_KEY` in the environment; `ses` needs the host's mouse enabled to click-copy.
79
-
80
- Every field named in `sidebar.rows` renders exactly one row, in order. With `sidebar.persist` (the default), a row with no data yet shows the `sidebar.placeholder` value (default `—`) in the same label column as a live row — so the rail keeps a stable shape instead of growing rows as the session produces data. Set `"persist": false` to restore omission: rows with no data are left out entirely.
81
-
82
- The `guard` row only appears when oc-harness-guard is installed and answering; without it the row stays on the placeholder. Flight Deck never installs or requires the other plugin — each side works alone.
83
-
84
- ### 🚨 `caution` — calibrated, not guessed
85
-
86
- A hang emits no events — its only signature is *absence*. So `caution` watches a clock, stays silent on healthy sessions, and when it speaks it reports what it saw, never what it means: `shell running 8m41s`, not "stuck".
87
-
88
- The annunciator ships **off by default** — it is the one row that runs a clock of its own, so an install that never asks for it spends nothing on it. To use it, add `caution` to `sidebar.rows` **and** set `caution.enabled: true`.
89
-
90
- > Measured over **54,218 real settled tool calls**: 0.57% ran past three minutes — with the exempt list, **0.20%** light the row. A ten-minute build is not a hang.
91
-
92
- **Why cost carries the subagents:** subagents run as separate sessions; a session's own cost excludes them. On the session this was built against: reported `$0.2246`, true spend `$0.2447` — **9% low on money, 54% low on tokens.** One money row tells the truth.
93
-
94
- | It fires when | Threshold | Config |
95
- |---|---|---|
96
- | a tool has a start time and no completion | watch at 3m, caution at 7m | `toolWatchSeconds` / `toolCautionSeconds` |
97
- | a shell is still running after its tool call returned | watch at 3m, caution at 7m | `toolWatchSeconds` / `toolCautionSeconds` |
98
- | the same call repeats with identical input | caution at 3 | `repeatThreshold` |
99
- | the same call fails with identical input | caution at 3 | `repeatThreshold` |
100
- | a running session stops producing anything | watch at 10m, caution at 20m | `turnWatchSeconds` / `turnCautionSeconds` |
101
-
102
- The toast is **off by default**. The rail is the signal; a notification is an interruption.
103
-
104
- ---
30
+ ## Install
105
31
 
106
- ## ⚙️ Configure
32
+ Compatible with opencode 2.0.30. The package is not published to npm, so install from git:
107
33
 
108
- **You don't need any.** Install it and the panel works. But every knob is available in a commented JSONC file.
109
-
110
- Copy [`flight-deck.example.jsonc`](./flight-deck.example.jsonc) to `~/.config/opencode/flight-deck.jsonc`, then edit. Comments and trailing commas are fine. `flight-deck.schema.json` validates it.
111
-
112
- There is **one** config file, global to your user, so the same values apply to every project. Flight Deck does not read a `flight-deck.jsonc` from a project root or from a project's `.opencode/` directory — a copy left there configures nothing. If `$XDG_CONFIG_HOME` holds an absolute path, the config path is `$XDG_CONFIG_HOME/opencode/flight-deck.jsonc` instead; a relative value is ignored, so the lookup cannot resolve against the host's working directory. A `.json` name works too; the `.jsonc` name is tried first.
113
-
114
- The file is optional, and a missing file is normal and silent: with no file at all you get exactly the defaults the example file writes out.
115
-
116
- > **Upgrading from 0.4.0 — the config file moved.** The per-project search is gone. A `flight-deck.jsonc` in a project root or in `.opencode/` is no longer read; move it to `~/.config/opencode/flight-deck.jsonc` (or the `$XDG_CONFIG_HOME` path above) to keep your settings.
117
-
118
- > **Upgrading from 0.7.0 — the branding moved.** The `▸ FLIGHT DECK` pair now renders in the sidebar footer slot, and `sidebar.lines` defaults to empty, so the top of the rail starts with the live rows. An explicit `sidebar.lines` is kept — it does not suppress the footer default; `sidebar.footer.lines: []` is the way to drop the footer entirely.
119
-
120
- > **Upgrading from 0.8.0 — the branding is opt-in since 0.8.1.** The footer slot no longer ships the `▸ FLIGHT DECK` pair by default: with `sidebar.footer.lines` empty (the new default) nothing renders below the rows and no footer slot is claimed. Set `sidebar.footer.lines` back to the pair to get the footer exactly as it was.
121
-
122
- `sidebar.rows` picks the rows and their order; `sidebar.maxLines` caps the whole rail (fixed lines plus rows, default 24, configurable from 1 to 24); `layout.labelWidth` fits your terminal; `format.duration` switches the `elapsed` row between `spaced` (`2h 14m 37s`, the default) and `compact` (`2h14m37s`).
34
+ 1. Add the plugin to the `plugins` array in your `opencode.jsonc`:
35
+ ```jsonc
36
+ { "plugins": ["oc-flight-deck@git+https://github.com/nathwn12/oc-flight-deck.git#<full sha>"] }
37
+ ```
38
+ Pin a full commit sha, not a branch name, so the install stays put.
39
+ 2. Restart OpenCode.
40
+ 3. Verify: the panel appears beside an open session.
123
41
 
124
- `sidebar.footer.lines` sets the fixed lines in the sidebar footer slot — empty by default since 0.8.1, in a region the host draws below the rows. Set it to the documented pair to re-enable the branding:
42
+ See [INSTALL.md](INSTALL.md) for the two routes: the git package spec above, and a no-npm local directory entry. To uninstall, remove the entry from `opencode.jsonc`, restart, and delete your `flight-deck.jsonc` if you made one.
125
43
 
126
- ```jsonc
127
- // inside "sidebar":
128
- "footer": { "lines": ["▸ FLIGHT DECK", "─────────────────"] }
129
- ```
44
+ ## Usage
130
45
 
131
- It is independent of `sidebar.lines`: setting your own top lines does not turn the footer on, and an explicitly empty `"lines": []` inside `sidebar.footer` keeps the slot off entirely. The footer never counts against `sidebar.maxLines`.
46
+ Copy [flight-deck.example.jsonc](flight-deck.example.jsonc) to the one global path, `~/.config/opencode/flight-deck.jsonc` (`$XDG_CONFIG_HOME/opencode/flight-deck.jsonc` when that variable holds an absolute path), then edit. A `.json` name works too; the `.jsonc` name is tried first. The file is optional: with no file at all you get exactly the defaults the example file writes out. There is no per-project lookup.
132
47
 
133
- Optional styling lives under `style`: `style.lines` controls the fixed branding/separator lines (the opt-in footer pair when you set `sidebar.footer.lines`, or whatever `sidebar.lines` you set), `style.rows."*"` sets every live row, and `style.rows.cost` (or another row name) overrides one field while inheriting omitted values from the wildcard. Colors are theme roles - `default`, `subdued`, `warning`, `error`, `success`, `info` - and attributes are OpenTUI descriptors: `bold`, `dim`, `italic`, `underline`, `blink`, `inverse`, `hidden`, `strikethrough`. Defaults keep the existing theme-native look; no ANSI escapes or raw colors are needed. Invalid colors, attributes, and row names are reported and safely ignored.
48
+ Every key is optional. The real config keys, taken from [flight-deck.schema.json](flight-deck.schema.json):
134
49
 
135
- Everything else lives in the example file, documented inline - a typo is never fatal: the bad value is ignored, the default comes back, and you get a one-time toast naming the key to fix.
50
+ - `refresh` (default `100`): milliseconds between ticks; `0` turns the ticker off.
51
+ - `sidebar.enabled`, `sidebar.lines`, `sidebar.rows`, `sidebar.tps.scope` (`family` or `session`), `sidebar.persist`, `sidebar.placeholder`, `sidebar.maxLines` (default `24`), `sidebar.footer.lines`, `sidebar.footer.go`.
52
+ - `footer.enabled` / `footer.text`: a single line in the prompt footer, off unless configured.
53
+ - `caution.enabled` (default `false`), `toolWatchSeconds` (`180`), `toolCautionSeconds` (`420`), `turnWatchSeconds` (`600`), `turnCautionSeconds` (`1200`), `repeatThreshold` (`3`), `exemptTools`, `toast` (`false`). To use the annunciator, add `caution` to `sidebar.rows` and set `caution.enabled: true`.
54
+ - `layout.labelWidth` (`10`), `layout.barWidth` (`10`), `layout.sparkWidth` (`12`), `layout.labels` (per-row label renames, e.g. `{ "cost": "session", "total": "lifetime" }`; every other row keeps its built-in label).
55
+ - `format.duration` (`spaced` or `compact`).
56
+ - `glyphs.watch`, `glyphs.caution`, `glyphs.clear`.
57
+ - `style.lines` and `style.rows.*`: theme color roles with OpenTUI text attributes.
136
58
 
137
59
  ```jsonc
138
60
  // ~/.config/opencode/flight-deck.jsonc
@@ -158,42 +80,16 @@ Everything else lives in the example file, documented inline - a typo is never f
158
80
  }
159
81
  ```
160
82
 
161
- ---
162
-
163
- ## 🔒 Safety
164
-
165
- **It reads. It writes almost nothing.**
166
-
167
- Flight Deck shows what OpenCode already knows.
83
+ ## Build from source
168
84
 
169
- - **One clipboard write, and only on a click.** With the opt-in `ses` row on the rail, a mouse click on that row copies the full session id to the terminal clipboard. Nothing is copied on render, in the background, or without that gesture; a terminal that cannot take the write simply does nothing.
170
-
171
- - **No network calls while the opt-in `guard` row stays off.** Nothing is fetched, nothing is sent. With `guard` enabled, the panel polls the local guard RPC — same machine, no telemetry — about every ten seconds, plus right away when the rendered session changes.
172
- - **No telemetry.** Nothing is collected or phoned home.
173
- - **Nothing on disk.** The one thing it normally writes is an animation counter in the host's in-memory plugin state, so the spinner and a running `elapsed` clock keep moving between host events. It is scoped to this plugin and dies with the TUI; it is never persisted, and `"refresh": 0` removes even that. With `"refresh": 0` the rail re-reads only on host events, so a busy stretch that produces few events can undercount `elapsed` — no unobserved gap bills beyond its bound, and a longer gap banks nothing. With `guard` enabled there is a second in-memory write — that row's polled status — and `"refresh": 0` does not remove it; dropping `guard` from `sidebar.rows` does.
174
- - **No polling of your session while `guard` stays off.** Cost, tokens, and permissions update from the host's own events. The timer only re-reads state the host already holds in memory, so the clock-derived rows keep moving.
175
- - **Theme-native.** Every line uses your active theme's text tokens, so it blends with whatever look you already run.
176
-
177
- Delete the plugin and the stock sidebar is back, exactly as it was.
178
-
179
- ---
180
-
181
- ## 🧹 Uninstall
182
-
183
- Remove the entry from `opencode.jsonc`, restart, done. Delete your `~/.config/opencode/flight-deck.jsonc` too if you made one.
184
-
185
- ---
186
-
187
- ## 🛠 Development
85
+ Prerequisites: Node 22 or newer, or Bun 1.4 or newer.
188
86
 
189
87
  ```sh
190
88
  bun install
191
89
  bun run check
192
90
  ```
193
91
 
194
- `bun run check` typechecks and runs the suite, including headless OpenTUI render tests that mount the panel in a real renderer and assert the exact characters that come out. A guard test parses the shipped example config and asserts it still matches the real defaults, and a schema test validates that parsed example against the shipped schema — defaults, types, and allowed values — so the documentation can't drift from the code on either side.
195
-
196
- To load the plugin **from this checkout** while working on it, add it to the `opencode.jsonc` of the project you run OpenCode in. A `plugins` entry is a package specifier, not a file path — a bare path is ignored silently — so the checkout has to be named as a git file URL:
92
+ `bun run check` typechecks and runs the suite, including headless OpenTUI render tests that mount the panel in a real renderer and assert the exact characters that come out. The shipped entries are compiled, not raw source: `bun run compile` emits plain JS to `dist/` with explicit `jsx-runtime` imports for the host (required on opencode 2.0.30, which cannot resolve a raw `.tsx` entry under `node_modules`). `dist/` is committed, since the git install route loads the entry from the clone. To load the plugin from a checkout while working on it, name the checkout as a git file URL in the `opencode.jsonc` of the project you run OpenCode in:
197
93
 
198
94
  ```jsonc
199
95
  {
@@ -201,33 +97,27 @@ To load the plugin **from this checkout** while working on it, add it to the `op
201
97
  }
202
98
  ```
203
99
 
204
- That installs a **copy, not a symlink**, so re-run the install after editing the checkout. This file is deliberately **not** committed: if the plugin is also installed globally, declaring it in both places registers the same plugin id twice and the host's plugin list shows one of them as failed.
205
-
206
- Built on the official [OpenCode V2 CLI plugin API](https://opencode.ai/v2/docs/build/plugins/cli).
207
-
208
- ---
209
-
210
- ## 🧭 Compatibility
211
-
212
- | | |
213
- |---|---|
214
- | Built against | `@opencode/plugin` `2.0.19` — pin a host version you've tested |
215
- | Host | OpenCode V2 (`opencode2`) |
216
- | Building from source | Node ≥ 22 or Bun ≥ 1.4 |
217
- | Writes | In-memory counters only — the animation tick, plus the `guard` row's polled status when `guard` is on; with the opt-in `ses` row, a click copies the id to the terminal clipboard (never automatic); nothing to disk |
218
-
219
- ---
100
+ That installs a copy, not a symlink, so re-run the install after editing the checkout. Built against `@opencode/plugin` 2.0.30 on the official [OpenCode V2 CLI plugin API](https://opencode.ai/v2/docs/build/plugins/cli).
220
101
 
221
- ## 📄 License
102
+ ## Docs
222
103
 
223
- MIT © 2026 nathwn12 — see [LICENSE](./LICENSE).
104
+ - [INSTALL.md](INSTALL.md) — the two install routes.
105
+ - [flight-deck.example.jsonc](flight-deck.example.jsonc) — every option, documented inline.
106
+ - [flight-deck.schema.json](flight-deck.schema.json) — types, defaults and allowed values.
107
+ - [CHANGELOG.md](CHANGELOG.md) — release history.
224
108
 
225
- ---
109
+ ## Status
226
110
 
227
- <div align="center">
111
+ **Active** — maintained, issues welcome.
228
112
 
229
- Built against `@opencode/plugin` 2.0.19 · Node ≥ 22 / Bun ≥ 1.4 · OpenCode V2
113
+ ## License
230
114
 
231
- **MIT © 2026 nathwn12** · For OpenCode. Free.
115
+ MIT — see [LICENSE](LICENSE).
232
116
 
233
- </div>
117
+ <!-- nathwn12 house footer: identical in every repo. Do not edit. -->
118
+ <p align="center">
119
+ <a href="https://github.com/nathwn12"><img src="assets/signature.svg" width="96" alt="nathwn12" /></a>
120
+ </p>
121
+ <p align="center">
122
+ <sub>Built by <a href="https://github.com/nathwn12">nathwn12</a> · <a href="https://github.com/nathwn12?tab=repositories">All projects</a></sub>
123
+ </p>
package/dist/index.js ADDED
@@ -0,0 +1,10 @@
1
+ // @bun
2
+ // src/index.ts
3
+ import { Plugin } from "@opencode/plugin";
4
+ var src_default = Plugin.define({
5
+ id: "flight-deck.host",
6
+ setup() {}
7
+ });
8
+ export {
9
+ src_default as default
10
+ };