oc-flight-deck 0.23.1 → 0.24.0
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 +10 -5
- package/dist/tui/index.js +9 -7
- package/docs/GUIDE.md +3 -3
- package/flight-deck.example.jsonc +10 -14
- package/flight-deck.schema.json +5 -5
- package/package.json +2 -2
- package/src/tui/config.ts +3 -10
- package/src/tui/rows.ts +7 -4
- package/src/tui/stat-fields.ts +4 -6
package/CHANGELOG.md
CHANGED
|
@@ -7,16 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
-
## [0.
|
|
11
|
-
|
|
12
|
-
### Fixed
|
|
13
|
-
|
|
14
|
-
- The compact Go row shows reset countdowns with the same two-unit precision as the Go panel instead of rounding hours or days up to a single unit.
|
|
10
|
+
## [0.24.0] - 2026-11-17
|
|
15
11
|
|
|
16
12
|
### Added
|
|
17
13
|
|
|
18
14
|
- Opt-in `dex` sidebar row: compact 5h and 1w Codex account dials match the Go row. Windows uses a private authenticated stdio server enclosed in an owned Job Object; no shared daemon, OAuth credential-file access or process-tree kills.
|
|
19
15
|
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- The TPS row defaults to the realtime estimate and includes observed time to first token when available. The settled-turn average remains opt-in.
|
|
19
|
+
- Missing TPS uses the configured placeholder instead of a misleading zero; observed TTFT remains visible between streams.
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- The compact Go row shows reset countdowns with the same two-unit precision as the Go panel instead of rounding hours or days up to a single unit.
|
|
24
|
+
|
|
20
25
|
## [0.22.0] - 2026-11-10
|
|
21
26
|
|
|
22
27
|
### Changed
|
package/dist/tui/index.js
CHANGED
|
@@ -773,7 +773,7 @@ function skeletonValue(field, layout) {
|
|
|
773
773
|
case "elapsed":
|
|
774
774
|
return formatDuration(0, layout.durationStyle);
|
|
775
775
|
case "tps":
|
|
776
|
-
return
|
|
776
|
+
return;
|
|
777
777
|
case "spark":
|
|
778
778
|
return "\u2581".repeat(Math.max(0, Math.floor(layout.sparkWidth ?? DEFAULT_SPARK_WIDTH)));
|
|
779
779
|
case "reasoning":
|
|
@@ -1063,12 +1063,14 @@ function statLine(field, source, layout = {}) {
|
|
|
1063
1063
|
const rt = asCount2(pair?.["rt"]);
|
|
1064
1064
|
const avg = asCount2(pair?.["avg"]);
|
|
1065
1065
|
const ttft = asCount2(pair?.["ttft"]);
|
|
1066
|
-
const display = layout.tpsDisplay ?? "
|
|
1066
|
+
const display = layout.tpsDisplay ?? "rt";
|
|
1067
1067
|
if (display === "rt") {
|
|
1068
1068
|
const rounded = rt === undefined ? undefined : Math.round(rt);
|
|
1069
|
-
if (rounded === undefined || rounded <= 0)
|
|
1070
|
-
return;
|
|
1071
|
-
|
|
1069
|
+
if (rounded === undefined || rounded <= 0) {
|
|
1070
|
+
return ttft === undefined ? undefined : row("tps", `${ttft.toFixed(1)}s ttft`);
|
|
1071
|
+
}
|
|
1072
|
+
const rate = `${rounded} tok/s`;
|
|
1073
|
+
return row("tps", ttft === undefined ? rate : `${rate} \xB7 ${ttft.toFixed(1)}s ttft`);
|
|
1072
1074
|
}
|
|
1073
1075
|
if (display === "both") {
|
|
1074
1076
|
if (avg !== undefined) {
|
|
@@ -1595,7 +1597,7 @@ var DEFAULT_GO_PANEL_LOOK = {
|
|
|
1595
1597
|
blinkMs: 700
|
|
1596
1598
|
};
|
|
1597
1599
|
var DEFAULT_TPS_SCOPE = "family";
|
|
1598
|
-
var DEFAULT_TPS_DISPLAY = "
|
|
1600
|
+
var DEFAULT_TPS_DISPLAY = "rt";
|
|
1599
1601
|
function cautionThresholds(config) {
|
|
1600
1602
|
return {
|
|
1601
1603
|
toolWatchMs: config.toolWatchSeconds * 1000,
|
|
@@ -1865,7 +1867,7 @@ function readTpsDisplay(value, issues) {
|
|
|
1865
1867
|
return DEFAULT_TPS_DISPLAY;
|
|
1866
1868
|
if (value === "avg" || value === "rt" || value === "both")
|
|
1867
1869
|
return value;
|
|
1868
|
-
issues.push(`sidebar.tps.display must be "avg", "rt" or "both"; using "
|
|
1870
|
+
issues.push(`sidebar.tps.display must be "avg", "rt" or "both"; using "${DEFAULT_TPS_DISPLAY}"`);
|
|
1869
1871
|
return DEFAULT_TPS_DISPLAY;
|
|
1870
1872
|
}
|
|
1871
1873
|
function readTps(section, issues) {
|
package/docs/GUIDE.md
CHANGED
|
@@ -98,7 +98,7 @@ One global file: `~/.config/opencode/flight-deck.jsonc`. The `.json` name is als
|
|
|
98
98
|
| **`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. |
|
|
99
99
|
| **`sidebar.maxLines`** | `24` | Whole rail, fixed lines plus rows, 1–24. |
|
|
100
100
|
| **`sidebar.tps.scope`** | `"family"` | `"family"` paces the open session plus subagents; `"session"` paces the open session alone. |
|
|
101
|
-
| **`sidebar.tps.display`** | `"
|
|
101
|
+
| **`sidebar.tps.display`** | `"rt"` | `"rt"` estimated realtime throughput plus observed TTFT, `"avg"` settled-turn average, `"both"` both figures plus TTFT. |
|
|
102
102
|
|
|
103
103
|
**Footer**
|
|
104
104
|
|
|
@@ -184,7 +184,7 @@ Every name `sidebar.rows` accepts, what its number means, and whether it draws b
|
|
|
184
184
|
| `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 |
|
|
185
185
|
| `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 |
|
|
186
186
|
| `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 |
|
|
187
|
-
| `tps` | Session speed. Default `
|
|
187
|
+
| `tps` | Session speed. Default `rt`: estimated realtime throughput from streaming delta bytes and observed mean TTFT after steps settle; TTFT remains visible when no rate is available. `avg` selects the settled-turn average; `both` shows both rates. Scope `family` includes subagents; `session` covers the open session. With neither a rate nor TTFT, `persist: true` draws the placeholder and `persist: false` omits the row. | yes |
|
|
188
188
|
| `spark` | Recent turn sizes as a sparkline; the newest samples are kept. | opt-in |
|
|
189
189
|
| `reasoning` | Reasoning tokens, family scope. | opt-in |
|
|
190
190
|
| `turns` | Prompts sent this session. | opt-in |
|
|
@@ -194,7 +194,7 @@ Every name `sidebar.rows` accepts, what its number means, and whether it draws b
|
|
|
194
194
|
| `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 |
|
|
195
195
|
| `session` | Alias for `ses`; accepted in `sidebar.rows` and folded to it. | opt-in |
|
|
196
196
|
|
|
197
|
-
With `sidebar.persist` (the default)
|
|
197
|
+
With `sidebar.persist` (the default) named rows render even without data. Most draw a zero skeleton: `$0.000` money rows, `0 in · 0 out`, `0 read`, empty gauge plus `~0%`, `0 waiting`, `0s`, flat `▁` spark, `0` reasoning and turns, `○ 0 ○ 0 ○ 0` go, `○ idle`, `none` agent, model, and ses, `no branch`, `unknown` guard. `caution` stays silent; `tps` and `updated` draw `sidebar.placeholder` (`—`) when unavailable. Set `persist: false` to omit rows with no data instead.
|
|
198
198
|
|
|
199
199
|
### Recipes
|
|
200
200
|
|
|
@@ -181,11 +181,8 @@
|
|
|
181
181
|
//
|
|
182
182
|
// Every named row renders persistently, so the rail keeps a stable shape:
|
|
183
183
|
// a row with no data yet draws a real-looking zero — `$0.000` for money
|
|
184
|
-
// rows
|
|
185
|
-
//
|
|
186
|
-
// exceptions: `caution` stays silent until it has something to say, and
|
|
187
|
-
// `updated` draws `sidebar.placeholder` (`—`) until the host records an
|
|
188
|
-
// action, because there is no honest zero timestamp.
|
|
184
|
+
// rows and `0 in · 0 out` for tokens. `caution` stays silent; `tps` and
|
|
185
|
+
// `updated` draw `sidebar.placeholder` (`—`) when data is unavailable.
|
|
189
186
|
// The fixed lines and live rows share the maxLines budget below, and
|
|
190
187
|
// anything past it is dropped.
|
|
191
188
|
"rows": [
|
|
@@ -219,33 +216,32 @@
|
|
|
219
216
|
// while it is idle even when a child is still running). An unknown value
|
|
220
217
|
// falls back to `"family"` and is reported.
|
|
221
218
|
//
|
|
222
|
-
// `"display"` is what draws. `"avg"`
|
|
219
|
+
// `"display"` is what draws. `"avg"` is the settled-turn
|
|
223
220
|
// average: generation tokens over assistant turns that recorded
|
|
224
221
|
// `streamed`, divided by the union of their `streamed - created` spans —
|
|
225
222
|
// in-flight turns excluded, idle gaps never billed. `"rt"` is the
|
|
226
|
-
// realtime estimate from the host's streaming delta events
|
|
227
|
-
//
|
|
228
|
-
// or before the first delta). `"both"` draws both on one line
|
|
223
|
+
// realtime estimate (the default) from the host's streaming delta events.
|
|
224
|
+
// Without a rate, observed TTFT remains visible. `"both"` draws both on one line
|
|
229
225
|
// (`106 rt · 41 avg`), plus the mean time to first token over settled
|
|
230
226
|
// steps (`83 rt · 38 avg · 1.2s ttft`): per step, the earliest
|
|
231
227
|
// text/reasoning delta's event time minus the step's `started` dispatch
|
|
232
228
|
// stamp (request dispatch time, before waiting for provider output),
|
|
233
229
|
// pushed into the scope's ring when the step ends. The mean covers the
|
|
234
230
|
// most recent finalized steps observed while the plugin ran — in-memory,
|
|
235
|
-
// so a restart forgets them.
|
|
231
|
+
// so a restart forgets them. `rt` also shows TTFT when available.
|
|
232
|
+
// An unknown value falls back to `"rt"` and
|
|
236
233
|
// is reported.
|
|
237
|
-
"tps": { "scope": "family", "display": "
|
|
234
|
+
"tps": { "scope": "family", "display": "rt" },
|
|
238
235
|
|
|
239
236
|
// Every named row renders persistently: with no data yet it draws its
|
|
240
|
-
// zero skeleton
|
|
237
|
+
// zero skeleton or placeholder, in the
|
|
241
238
|
// same label column as a live row. Set to false to omit rows with no data
|
|
242
239
|
// instead.
|
|
243
240
|
"persist": true,
|
|
244
241
|
|
|
245
242
|
// Fallback for a persistent row with no data that has no skeleton. Any
|
|
246
243
|
// non-empty string. `caution` never draws it (its silence is the design),
|
|
247
|
-
// and `updated`
|
|
248
|
-
// honest zero timestamp, so this dash is reachable for that one row.
|
|
244
|
+
// and `tps` and `updated` draw it until data is available.
|
|
249
245
|
"placeholder": "—",
|
|
250
246
|
|
|
251
247
|
// Maximum total height, including fixed lines and live rows. Defaults to 24.
|
package/flight-deck.schema.json
CHANGED
|
@@ -153,8 +153,8 @@
|
|
|
153
153
|
"tps": {
|
|
154
154
|
"type": "object",
|
|
155
155
|
"additionalProperties": false,
|
|
156
|
-
"default": { "scope": "family", "display": "
|
|
157
|
-
"description": "The `tps` row: which sessions it paces (`scope`) and which figure it draws (`display`).
|
|
156
|
+
"default": { "scope": "family", "display": "rt" },
|
|
157
|
+
"description": "The `tps` row: which sessions it paces (`scope`) and which figure it draws (`display`). When selected it shows the settled-turn average over the whole family: on hosts that record turn timestamps, generation tokens (output plus reasoning) over assistant turns that recorded `streamed`, divided by the union of their `streamed − created` spans — in-flight turns excluded, idle gaps never billed; on hosts without turn timestamps, generation tokens over the borrowed active clock instead. `display: \"rt\"` draws the realtime figure from the host's streaming events instead — an estimate from delta bytes while a turn streams, reading zero while nothing generates; `\"both\"` draws both figures on one line, plus the mean time to first token over settled steps (`1.2s ttft`) — per step, the earliest delta's event time minus the step's `started` dispatch stamp, pushed into the scope's ring when the step ends and kept in memory for the plugin's lifetime.",
|
|
158
158
|
"properties": {
|
|
159
159
|
"scope": {
|
|
160
160
|
"type": "string",
|
|
@@ -165,15 +165,15 @@
|
|
|
165
165
|
"display": {
|
|
166
166
|
"type": "string",
|
|
167
167
|
"enum": ["avg", "rt", "both"],
|
|
168
|
-
"default": "
|
|
169
|
-
"description": "Which figure the `tps` row draws. `avg`
|
|
168
|
+
"default": "rt",
|
|
169
|
+
"description": "Which figure the `tps` row draws. `avg` is the settled-turn average: on hosts that record turn timestamps, generation tokens over assistant turns with `streamed` recorded, divided by the union of their `streamed - created` spans, in the row's scope; on hosts without them, generation tokens over the borrowed active clock. `rt` is the realtime figure from the host's streaming events — an estimate from delta bytes while a turn streams, reading zero while nothing generates. `both` draws `rt` and `avg` on one line (`106 rt · 41 avg`), plus the mean time to first token over settled steps (`83 rt · 38 avg · 1.2s ttft`): per step, the earliest text/reasoning delta's event time minus the step's `started` dispatch stamp (request dispatch time, before waiting for provider output), pushed into the scope's ring when the step ends — the mean covers the most recent finalized steps observed while the plugin ran (in-memory; a restart forgets them). An unknown value falls back to `rt` and is reported."
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
},
|
|
173
173
|
"persist": {
|
|
174
174
|
"type": "boolean",
|
|
175
175
|
"default": true,
|
|
176
|
-
"description": "Render
|
|
176
|
+
"description": "Render named fields persistently. Most show zero skeletons before data arrives; `tps` and `updated` use `sidebar.placeholder` when unavailable, while `caution` stays silent. False omits fields without data."
|
|
177
177
|
},
|
|
178
178
|
"placeholder": {
|
|
179
179
|
"type": "string",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oc-flight-deck",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
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",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@types/bun": "^1.4.4",
|
|
70
70
|
"solid-js": "1.9.18",
|
|
71
71
|
"string-width": "7.2.0",
|
|
72
|
-
"typescript": "^
|
|
72
|
+
"typescript": "^7.0.2"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"@opentui/core": ">=0.8.0",
|
package/src/tui/config.ts
CHANGED
|
@@ -153,16 +153,9 @@ export type TpsDisplay = "avg" | "rt" | "both";
|
|
|
153
153
|
export const DEFAULT_TPS_SCOPE: TpsScope = "family";
|
|
154
154
|
|
|
155
155
|
/**
|
|
156
|
-
* The shipped `tps` figure: `"
|
|
157
|
-
*
|
|
158
|
-
* The one default for this knob, so flipping the shipped behaviour is one
|
|
159
|
-
* line here. The average ships because it answers the question the row is
|
|
160
|
-
* really asked — how fast is this session producing — instead of what the
|
|
161
|
-
* decoder is doing in this exact poll: an idle gap between turns reads as a
|
|
162
|
-
* steady figure rather than as zero, while `rt` stays one edit away for
|
|
163
|
-
* the moment-to-moment view.
|
|
156
|
+
* The shipped `tps` figure: `"rt"`, an estimate of current throughput.
|
|
164
157
|
*/
|
|
165
|
-
export const DEFAULT_TPS_DISPLAY: TpsDisplay = "
|
|
158
|
+
export const DEFAULT_TPS_DISPLAY: TpsDisplay = "rt";
|
|
166
159
|
|
|
167
160
|
interface TpsConfig {
|
|
168
161
|
/** Which sessions the `tps` row paces. Default `DEFAULT_TPS_SCOPE`. */
|
|
@@ -821,7 +814,7 @@ function readTpsScope(value: unknown, issues: string[]): TpsScope {
|
|
|
821
814
|
function readTpsDisplay(value: unknown, issues: string[]): TpsDisplay {
|
|
822
815
|
if (value === undefined) return DEFAULT_TPS_DISPLAY;
|
|
823
816
|
if (value === "avg" || value === "rt" || value === "both") return value;
|
|
824
|
-
issues.push(`sidebar.tps.display must be "avg", "rt" or "both"; using "
|
|
817
|
+
issues.push(`sidebar.tps.display must be "avg", "rt" or "both"; using "${DEFAULT_TPS_DISPLAY}"`);
|
|
825
818
|
return DEFAULT_TPS_DISPLAY;
|
|
826
819
|
}
|
|
827
820
|
|
package/src/tui/rows.ts
CHANGED
|
@@ -490,20 +490,23 @@ export function statLine(
|
|
|
490
490
|
// `ttft` the mean time to first token in seconds — all unknown at this
|
|
491
491
|
// boundary, so all re-coerced like every other field. Which one draws
|
|
492
492
|
// is `layout.tpsDisplay` (the row's view of `sidebar.tps.display`,
|
|
493
|
-
// default `"
|
|
493
|
+
// default `"rt"`); presentation.ts feeds it from the resolved config.
|
|
494
494
|
const pair = asRecord(source.tps);
|
|
495
495
|
const rt = asCount(pair?.["rt"]);
|
|
496
496
|
const avg = asCount(pair?.["avg"]);
|
|
497
497
|
const ttft = asCount(pair?.["ttft"]);
|
|
498
|
-
const display = layout.tpsDisplay ?? "
|
|
498
|
+
const display = layout.tpsDisplay ?? "rt";
|
|
499
499
|
if (display === "rt") {
|
|
500
500
|
// Whole tokens/second, honestly rounded — the value is already an
|
|
501
501
|
// EWMA over estimated delta samples, so a decimal would fake a
|
|
502
502
|
// precision the samples never had. Anything below half a
|
|
503
503
|
// token/second hides rather than printing "0 tok/s".
|
|
504
504
|
const rounded = rt === undefined ? undefined : Math.round(rt);
|
|
505
|
-
if (rounded === undefined || rounded <= 0)
|
|
506
|
-
|
|
505
|
+
if (rounded === undefined || rounded <= 0) {
|
|
506
|
+
return ttft === undefined ? undefined : row("tps", `${ttft.toFixed(1)}s ttft`);
|
|
507
|
+
}
|
|
508
|
+
const rate = `${rounded} tok/s`;
|
|
509
|
+
return row("tps", ttft === undefined ? rate : `${rate} · ${ttft.toFixed(1)}s ttft`);
|
|
507
510
|
}
|
|
508
511
|
if (display === "both") {
|
|
509
512
|
// Both figures on one line when the average stands — the realtime
|
package/src/tui/stat-fields.ts
CHANGED
|
@@ -204,8 +204,8 @@ export interface LayoutHint {
|
|
|
204
204
|
*/
|
|
205
205
|
readonly labels?: Readonly<Record<string, string>>;
|
|
206
206
|
/**
|
|
207
|
-
* Which figure the `tps` row draws: the settled-turn average (`"avg"
|
|
208
|
-
* default
|
|
207
|
+
* Which figure the `tps` row draws: the settled-turn average (`"avg"`),
|
|
208
|
+
* the default realtime estimate from the host's streaming delta events
|
|
209
209
|
* (`"rt"`), or both on one line (`"both"`). Carried here rather than read
|
|
210
210
|
* from config directly so the row stays a pure function of its inputs,
|
|
211
211
|
* exactly like `labels` above.
|
|
@@ -271,10 +271,8 @@ export function skeletonValue(field: string, layout: LayoutHint): string | undef
|
|
|
271
271
|
case "elapsed":
|
|
272
272
|
return formatDuration(0, layout.durationStyle);
|
|
273
273
|
case "tps":
|
|
274
|
-
//
|
|
275
|
-
|
|
276
|
-
// read as a zero.
|
|
277
|
-
return layout.tpsDisplay === "both" ? "0 rt · 0 avg" : "0 tok/s";
|
|
274
|
+
// An absent rate is not a measured zero.
|
|
275
|
+
return undefined;
|
|
278
276
|
case "spark":
|
|
279
277
|
return "▁".repeat(Math.max(0, Math.floor(layout.sparkWidth ?? DEFAULT_SPARK_WIDTH)));
|
|
280
278
|
case "reasoning":
|