oc-flight-deck 0.6.7 โ 0.8.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/README.md +19 -9
- package/flight-deck.example.jsonc +25 -8
- package/flight-deck.schema.json +22 -8
- package/package.json +2 -2
- package/src/tui/config.ts +95 -25
- package/src/tui/go-usage.ts +315 -0
- package/src/tui/go.ts +266 -0
- package/src/tui/index.tsx +62 -23
- package/src/tui/presentation.ts +47 -2
- package/src/tui/rows.ts +168 -1
- package/src/tui/stat-fields.ts +15 -0
- package/src/tui/stats.ts +2 -1
- package/src/tui/style.ts +1 -1
package/README.md
CHANGED
|
@@ -27,8 +27,6 @@ Restart OpenCode. **That's the whole setup.** No config file, no options, nothin
|
|
|
27
27
|
## ๐ The panel
|
|
28
28
|
|
|
29
29
|
```text
|
|
30
|
-
โ FLIGHT DECK
|
|
31
|
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
32
30
|
status โ น running
|
|
33
31
|
agent orchestrator
|
|
34
32
|
model deepseek-v4.1-flash ยท high
|
|
@@ -39,17 +37,22 @@ cache 98% hit ยท 32M read
|
|
|
39
37
|
context โโโโโโโโโโ 18%
|
|
40
38
|
elapsed 2h 14m 37s
|
|
41
39
|
tps 18 tok/s
|
|
40
|
+
|
|
41
|
+
โธ FLIGHT DECK
|
|
42
|
+
โโโโโโโโโโโโโโโโโ
|
|
42
43
|
```
|
|
43
44
|
|
|
44
45
|
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.
|
|
45
46
|
|
|
47
|
+
The panel's only fixed text โ `โธ FLIGHT DECK` over a separator โ renders in the sidebar footer slot, a separate host region **below** the rows: the top of the rail starts directly with the live rows. The footer is independent of `sidebar.rows` and `sidebar.maxLines`; it ships the branding pair by default, and `sidebar.footer.lines` replaces or removes it (see โ๏ธ Configure).
|
|
48
|
+
|
|
46
49
|
| Row | What it shows |
|
|
47
50
|
|---|---|
|
|
48
|
-
| `caution` | **The annunciator** โ silent unless something stopped moving |
|
|
51
|
+
| `caution` | **The annunciator** โ silent unless something stopped moving ยท **off by default** |
|
|
49
52
|
| `status` | A spinner while anything is working, a circle while it's idle |
|
|
50
53
|
| `agent` | Which agent you're actually talking to |
|
|
51
54
|
| `model` | The model **and its variant** โ `high` behaves differently |
|
|
52
|
-
| `branch` | The branch you're about to commit to |
|
|
55
|
+
| `branch` | The branch you're about to commit to ยท **off by default** |
|
|
53
56
|
| `cost` | This conversation **plus its subagents**, and the count that explains it; with `total` on the rail, the session figure alone |
|
|
54
57
|
| `total` | The family total and subagent count on a row of its own ยท **off by default** |
|
|
55
58
|
| `project` | Every session in this project, not just the one on screen |
|
|
@@ -63,10 +66,11 @@ Every row is read from the open session at render time โ except `caution`, whi
|
|
|
63
66
|
| `reasoning` | Reasoning tokens, when the model emits them ยท **off by default** |
|
|
64
67
|
| `turns` | How many prompts you've sent this session ยท **off by default** |
|
|
65
68
|
| `guard` | Harness status from oc-harness-guard ยท **off by default** |
|
|
69
|
+
| `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** |
|
|
66
70
|
|
|
67
71
|
`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.
|
|
68
72
|
|
|
69
|
-
The rows marked **off by default** are available but not in the default rail: add any of them to `sidebar.rows`.
|
|
73
|
+
The rows marked **off by default** โ `caution`, `branch`, `total`, `spark`, `reasoning`, `turns`, `guard`, and `go` โ 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.
|
|
70
74
|
|
|
71
75
|
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.
|
|
72
76
|
|
|
@@ -78,6 +82,8 @@ The `guard` row only appears when oc-harness-guard is installed and answering; w
|
|
|
78
82
|
|
|
79
83
|
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".
|
|
80
84
|
|
|
85
|
+
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`.
|
|
86
|
+
|
|
81
87
|
> 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.
|
|
82
88
|
|
|
83
89
|
**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.
|
|
@@ -106,9 +112,13 @@ The file is optional, and a missing file is normal and silent: with no file at a
|
|
|
106
112
|
|
|
107
113
|
> **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.
|
|
108
114
|
|
|
115
|
+
> **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.
|
|
116
|
+
|
|
109
117
|
`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`).
|
|
110
118
|
|
|
111
|
-
|
|
119
|
+
`sidebar.footer.lines` sets the fixed lines in the sidebar footer slot โ the branding pair by default, in a region the host draws below the rows. It is independent of `sidebar.lines`: setting your own top lines keeps the default footer, and an explicitly empty `"lines": []` inside `sidebar.footer` removes the slot entirely. The footer never counts against `sidebar.maxLines`.
|
|
120
|
+
|
|
121
|
+
Optional styling lives under `style`: `style.lines` controls the fixed branding/separator lines (the sidebar footer's default pair, 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.
|
|
112
122
|
|
|
113
123
|
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.
|
|
114
124
|
|
|
@@ -119,7 +129,7 @@ Everything else lives in the example file, documented inline - a typo is never f
|
|
|
119
129
|
"sidebar": {
|
|
120
130
|
"maxLines": 24,
|
|
121
131
|
"rows": [
|
|
122
|
-
"
|
|
132
|
+
"status", "agent", "model", "cost", "project",
|
|
123
133
|
"tokens", "cache", "context", "perms", "elapsed", "tps"
|
|
124
134
|
]
|
|
125
135
|
},
|
|
@@ -185,7 +195,7 @@ Built on the official [OpenCode V2 CLI plugin API](https://opencode.ai/v2/docs/b
|
|
|
185
195
|
|
|
186
196
|
| | |
|
|
187
197
|
|---|---|
|
|
188
|
-
| Built against | `@opencode/plugin` `2.0.
|
|
198
|
+
| Built against | `@opencode/plugin` `2.0.19` โ pin a host version you've tested |
|
|
189
199
|
| Host | OpenCode V2 (`opencode2`) |
|
|
190
200
|
| Building from source | Node โฅ 22 or Bun โฅ 1.4 |
|
|
191
201
|
| Writes | In-memory counters only โ the animation tick, plus the `guard` row's polled status when `guard` is on; nothing to disk |
|
|
@@ -194,7 +204,7 @@ Built on the official [OpenCode V2 CLI plugin API](https://opencode.ai/v2/docs/b
|
|
|
194
204
|
|
|
195
205
|
<div align="center">
|
|
196
206
|
|
|
197
|
-
Built against `@opencode/plugin` 2.0.
|
|
207
|
+
Built against `@opencode/plugin` 2.0.19 ยท Node โฅ 22 / Bun โฅ 1.4 ยท OpenCode V2
|
|
198
208
|
|
|
199
209
|
**MIT ยฉ 2026 nathwn12** ยท For OpenCode. Free.
|
|
200
210
|
|
|
@@ -58,22 +58,33 @@
|
|
|
58
58
|
// false hides the whole panel.
|
|
59
59
|
"enabled": true,
|
|
60
60
|
|
|
61
|
-
// Fixed lines, rendered above the live rows.
|
|
62
|
-
//
|
|
61
|
+
// Fixed lines, rendered above the live rows. EMPTY by default since
|
|
62
|
+
// 0.8.0: the branding pair has moved to `sidebar.footer.lines` below, so
|
|
63
|
+
// the top of the rail starts with the live rows. Put your own words here,
|
|
64
|
+
// or a rule โ an explicit list does NOT suppress the footer default.
|
|
63
65
|
// Fixed lines use style.lines; live rows use their style.rows entry or the
|
|
64
66
|
// wildcard. With no custom style, the shipped theme-native look is kept.
|
|
65
|
-
"lines": [
|
|
67
|
+
"lines": [],
|
|
68
|
+
|
|
69
|
+
// The sidebar footer slot: fixed lines below the rows, in the host's
|
|
70
|
+
// dedicated sidebar-footer area. NEW in 0.8.0 โ the branding pair ships
|
|
71
|
+
// here by default, outside the maxLines budget. An explicitly empty list
|
|
72
|
+
// removes the footer slot entirely. Fixed lines use style.lines.
|
|
73
|
+
"footer": {
|
|
74
|
+
"lines": ["โธ FLIGHT DECK", "โโโโโโโโโโโโโโโโโ"]
|
|
75
|
+
},
|
|
66
76
|
|
|
67
77
|
// The live rows, top to bottom. Every value is read from the open session,
|
|
68
78
|
// so you never type these in. Delete any row you don't want, or reorder
|
|
69
79
|
// them freely โ an unknown name is ignored with a one-time warning, so a
|
|
70
80
|
// typo can never break the panel.
|
|
71
81
|
//
|
|
72
|
-
// caution the annunciator: silent unless something stopped moving
|
|
82
|
+
// caution the annunciator: silent unless something stopped moving.
|
|
83
|
+
// Off by default โ enables its own clock
|
|
73
84
|
// status running or idle โ the glyph turns while anything is working
|
|
74
85
|
// agent which agent is running (orchestrator, build, plan, ...)
|
|
75
86
|
// model model id, plus the variant when there is one
|
|
76
|
-
// branch current git branch
|
|
87
|
+
// branch current git branch. Off by default โ costs a VCS call
|
|
77
88
|
// cost this conversation, plus its subagents when any ran; with
|
|
78
89
|
// `total` on the rail, the session figure alone
|
|
79
90
|
// total the family total and subagent count on a row of its own
|
|
@@ -100,17 +111,18 @@
|
|
|
100
111
|
// turns how many prompts you have sent this session
|
|
101
112
|
// guard harness status from oc-harness-guard: breaches, orphans,
|
|
102
113
|
// findings, or ok. Available, off by default.
|
|
114
|
+
// go Zen Go account usage for the 5h / 1w / 1m windows: a dial and
|
|
115
|
+
// a percent each, turning red as a window approaches its limit.
|
|
116
|
+
// Reads OPENCODE_GO_API_KEY. Available, off by default.
|
|
103
117
|
//
|
|
104
118
|
// Every named row renders persistently, so the rail keeps a stable shape:
|
|
105
119
|
// a row with no data yet shows the placeholder below, in the same label
|
|
106
120
|
// column as a live row. The fixed lines and live rows share the maxLines
|
|
107
121
|
// budget below, and anything past it is dropped.
|
|
108
122
|
"rows": [
|
|
109
|
-
"caution",
|
|
110
123
|
"status",
|
|
111
124
|
"agent",
|
|
112
125
|
"model",
|
|
113
|
-
"branch",
|
|
114
126
|
"cost",
|
|
115
127
|
"project",
|
|
116
128
|
"tokens",
|
|
@@ -119,6 +131,9 @@
|
|
|
119
131
|
"perms",
|
|
120
132
|
"elapsed",
|
|
121
133
|
"tps"
|
|
134
|
+
// ,"go" โ Zen Go account usage (needs OPENCODE_GO_API_KEY)
|
|
135
|
+
// ,"caution" โ the annunciator
|
|
136
|
+
// ,"branch" โ current git branch
|
|
122
137
|
],
|
|
123
138
|
|
|
124
139
|
// Every named row renders persistently: with no data yet it shows the
|
|
@@ -158,7 +173,9 @@
|
|
|
158
173
|
//
|
|
159
174
|
// It never aborts, kills, retries or blocks anything. Read-only.
|
|
160
175
|
"caution": {
|
|
161
|
-
|
|
176
|
+
// Off by default. Turn it on to run the annunciator; while off, the
|
|
177
|
+
// `caution` row never appears and no timer is spent on it.
|
|
178
|
+
"enabled": false,
|
|
162
179
|
|
|
163
180
|
// A tool running longer than this draws a subdued triangle...
|
|
164
181
|
"toolWatchSeconds": 180,
|
package/flight-deck.schema.json
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"sidebar": {
|
|
23
23
|
"type": "object",
|
|
24
24
|
"additionalProperties": false,
|
|
25
|
-
"description": "The rail itself: the
|
|
25
|
+
"description": "The rail itself: the fixed lines, the live rows, and the sidebar footer slot's lines.",
|
|
26
26
|
"properties": {
|
|
27
27
|
"enabled": {
|
|
28
28
|
"type": "boolean",
|
|
@@ -32,14 +32,28 @@
|
|
|
32
32
|
"lines": {
|
|
33
33
|
"type": "array",
|
|
34
34
|
"items": { "type": "string" },
|
|
35
|
-
"default": [
|
|
35
|
+
"default": [],
|
|
36
36
|
"maxItems": 24,
|
|
37
|
-
"description": "Fixed lines rendered above the live rows, in order.
|
|
37
|
+
"description": "Fixed lines rendered above the live rows, in order. Empty by default since 0.8.0 โ the branding pair moved to `sidebar.footer.lines`, so the top of the rail starts with the live rows. Any lines you list here render at full brightness while the live rows below them are dimmed, and they draw from the same 24-line cap as the rows. An explicit list does not suppress the footer default."
|
|
38
|
+
},
|
|
39
|
+
"footer": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"additionalProperties": false,
|
|
42
|
+
"description": "Fixed lines rendered in the sidebar footer slot, a separate host region below the rows that draws outside the 24-line rail cap. The branding pair ships here by default; an explicitly empty `lines` array removes the slot entirely.",
|
|
43
|
+
"properties": {
|
|
44
|
+
"lines": {
|
|
45
|
+
"type": "array",
|
|
46
|
+
"items": { "type": "string" },
|
|
47
|
+
"default": ["โธ FLIGHT DECK", "โโโโโโโโโโโโโโโโโ"],
|
|
48
|
+
"maxItems": 24,
|
|
49
|
+
"description": "The footer's fixed lines, in order. Defaults to the branding pair; independent of `sidebar.lines`, so setting your own top lines keeps the default footer. An explicit empty array opts the footer slot out entirely."
|
|
50
|
+
}
|
|
51
|
+
}
|
|
38
52
|
},
|
|
39
53
|
"rows": {
|
|
40
54
|
"type": "array",
|
|
41
|
-
"items": { "enum": ["caution", "status", "agent", "model", "branch", "cost", "total", "project", "tokens", "cache", "context", "perms", "elapsed", "tps", "spark", "reasoning", "turns", "guard"] },
|
|
42
|
-
"default": ["
|
|
55
|
+
"items": { "enum": ["caution", "status", "agent", "model", "branch", "cost", "total", "project", "tokens", "cache", "context", "perms", "elapsed", "tps", "spark", "reasoning", "turns", "guard", "go"] },
|
|
56
|
+
"default": ["status", "agent", "model", "cost", "project", "tokens", "cache", "context", "perms", "elapsed", "tps"],
|
|
43
57
|
"maxItems": 24,
|
|
44
58
|
"description": "Which live fields to draw, top to bottom. Any subset, any order โ this is the single most useful thing to change. With `sidebar.persist` (the default) every named row always renders, using `sidebar.placeholder` until the host has data; with `persist: false` rows with no data are omitted entirely. Counted together with `sidebar.lines` against a 24-line cap on the whole rail."
|
|
45
59
|
},
|
|
@@ -88,8 +102,8 @@
|
|
|
88
102
|
"properties": {
|
|
89
103
|
"enabled": {
|
|
90
104
|
"type": "boolean",
|
|
91
|
-
"default":
|
|
92
|
-
"description": "Run the annunciator. false means the `caution` row never appears and no timer is spent on it."
|
|
105
|
+
"default": false,
|
|
106
|
+
"description": "Run the annunciator. Off by default. false means the `caution` row never appears and no timer is spent on it."
|
|
93
107
|
},
|
|
94
108
|
"toolWatchSeconds": {
|
|
95
109
|
"type": "integer",
|
|
@@ -254,7 +268,7 @@
|
|
|
254
268
|
}
|
|
255
269
|
},
|
|
256
270
|
"propertyNames": {
|
|
257
|
-
"enum": ["*", "caution", "status", "agent", "model", "branch", "cost", "total", "project", "tokens", "cache", "context", "perms", "elapsed", "tps", "spark", "reasoning", "turns", "guard"]
|
|
271
|
+
"enum": ["*", "caution", "status", "agent", "model", "branch", "cost", "total", "project", "tokens", "cache", "context", "perms", "elapsed", "tps", "spark", "reasoning", "turns", "guard", "go"]
|
|
258
272
|
},
|
|
259
273
|
"default": { "*": { "color": "subdued", "attributes": [] } },
|
|
260
274
|
"description": "Style all live rows under `*`, then optionally override any known row name such as `cost`. A row can change one field and inherit the other from `*`; unknown row names are reported and ignored."
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oc-flight-deck",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.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",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"access": "public"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@opencode/plugin": "2.0.
|
|
56
|
+
"@opencode/plugin": "2.0.19"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@opentui/core": "0.5.12",
|
package/src/tui/config.ts
CHANGED
|
@@ -24,8 +24,13 @@ import {
|
|
|
24
24
|
interface SidebarConfig {
|
|
25
25
|
/** Show the sidebar rail. Default `true`. */
|
|
26
26
|
readonly enabled: boolean;
|
|
27
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Fixed lines rendered above the live rows. Default `DEFAULT_SIDEBAR_LINES`
|
|
29
|
+
* (empty since 0.8.0 โ the branding pair moved to the sidebar footer).
|
|
30
|
+
*/
|
|
28
31
|
readonly lines: readonly string[];
|
|
32
|
+
/** Fixed lines rendered in the sidebar footer slot. Default `DEFAULT_SIDEBAR_FOOTER_LINES`. */
|
|
33
|
+
readonly footer: SidebarFooterConfig;
|
|
29
34
|
/** Live session fields to render, top to bottom. Default `DEFAULT_SIDEBAR_ROWS`. */
|
|
30
35
|
readonly rows: readonly string[];
|
|
31
36
|
/**
|
|
@@ -43,6 +48,18 @@ interface SidebarConfig {
|
|
|
43
48
|
readonly maxLines: number;
|
|
44
49
|
}
|
|
45
50
|
|
|
51
|
+
interface SidebarFooterConfig {
|
|
52
|
+
/**
|
|
53
|
+
* The footer's fixed lines โ the branding pair by default.
|
|
54
|
+
*
|
|
55
|
+
* An explicitly empty list opts the footer slot out entirely. Absent, the
|
|
56
|
+
* default branding comes back regardless of what `sidebar.lines` says: the
|
|
57
|
+
* two lists are independent, and the footer draws outside the rail's
|
|
58
|
+
* `maxLines` budget.
|
|
59
|
+
*/
|
|
60
|
+
readonly lines: readonly string[];
|
|
61
|
+
}
|
|
62
|
+
|
|
46
63
|
interface FooterConfig {
|
|
47
64
|
/**
|
|
48
65
|
* Show the prompt-footer rail. Default `false`.
|
|
@@ -57,7 +74,7 @@ interface FooterConfig {
|
|
|
57
74
|
}
|
|
58
75
|
|
|
59
76
|
interface CautionConfig {
|
|
60
|
-
/** Show the caution annunciator. Default `
|
|
77
|
+
/** Show the caution annunciator. Default `false`. */
|
|
61
78
|
readonly enabled: boolean;
|
|
62
79
|
/** A tool running longer than this is worth noting. Default `180`. */
|
|
63
80
|
readonly toolWatchSeconds: number;
|
|
@@ -93,7 +110,8 @@ export interface FlightDeckConfig {
|
|
|
93
110
|
* The annunciator: the one thing on the rail that is not session state.
|
|
94
111
|
*
|
|
95
112
|
* It exists because a hang emits no events, so nothing else here can see it.
|
|
96
|
-
* Silent when healthy, which is why it costs nothing visually.
|
|
113
|
+
* Silent when healthy, which is why it costs nothing visually. Off by default:
|
|
114
|
+
* it is opt-in, so an install that never asks for it spends no timer on it.
|
|
97
115
|
*/
|
|
98
116
|
readonly caution: CautionConfig;
|
|
99
117
|
/** Geometry of a row. Every value has a sane default. */
|
|
@@ -183,7 +201,7 @@ const DEFAULT_GLYPHS: GlyphConfig = {
|
|
|
183
201
|
};
|
|
184
202
|
|
|
185
203
|
const DEFAULT_CAUTION: CautionConfig = {
|
|
186
|
-
enabled:
|
|
204
|
+
enabled: false,
|
|
187
205
|
toolWatchSeconds: 180,
|
|
188
206
|
toolCautionSeconds: 420,
|
|
189
207
|
turnWatchSeconds: 600,
|
|
@@ -201,13 +219,24 @@ const DEFAULT_CAUTION: CautionConfig = {
|
|
|
201
219
|
};
|
|
202
220
|
|
|
203
221
|
/**
|
|
204
|
-
* Fixed lines shown above the live rows
|
|
222
|
+
* Fixed lines shown above the live rows.
|
|
223
|
+
*
|
|
224
|
+
* Empty since 0.8.0: the branding pair moved to the sidebar footer slot
|
|
225
|
+
* (`DEFAULT_SIDEBAR_FOOTER_LINES`), so the top of the rail starts with the
|
|
226
|
+
* live rows. The rail exists to show session state, so nothing here is
|
|
227
|
+
* filler: there is no placeholder text to delete before it looks finished.
|
|
228
|
+
*/
|
|
229
|
+
export const DEFAULT_SIDEBAR_LINES: readonly string[] = [];
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* The sidebar footer's default fixed lines โ branding only.
|
|
205
233
|
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
234
|
+
* They render in the host's separate `sidebar.footer` slot, below the rows
|
|
235
|
+
* and outside the rail's `maxLines` budget. An explicitly empty
|
|
236
|
+
* `sidebar.footer.lines` from a config file removes the slot entirely.
|
|
208
237
|
*/
|
|
209
|
-
export const
|
|
210
|
-
"
|
|
238
|
+
export const DEFAULT_SIDEBAR_FOOTER_LINES: readonly string[] = [
|
|
239
|
+
"โธ FLIGHT DECK",
|
|
211
240
|
"โโโโโโโโโโโโโโโโโ",
|
|
212
241
|
];
|
|
213
242
|
|
|
@@ -215,14 +244,14 @@ export const DEFAULT_SIDEBAR_LINES: readonly string[] = [
|
|
|
215
244
|
* Live fields shown by default, in reading order.
|
|
216
245
|
*
|
|
217
246
|
* Every one of these is read from the open session at render time, so a fresh
|
|
218
|
-
* install shows real numbers with no configuration file at all.
|
|
247
|
+
* install shows real numbers with no configuration file at all. The rows that
|
|
248
|
+
* need extra machinery or a second source โ `caution` (a clock), `branch` (a
|
|
249
|
+
* VCS call), and `go` (an account-wide poll) โ are opt-in via `sidebar.rows`.
|
|
219
250
|
*/
|
|
220
251
|
export const DEFAULT_SIDEBAR_ROWS: readonly string[] = [
|
|
221
|
-
"caution",
|
|
222
252
|
"status",
|
|
223
253
|
"agent",
|
|
224
254
|
"model",
|
|
225
|
-
"branch",
|
|
226
255
|
"cost",
|
|
227
256
|
"project",
|
|
228
257
|
"tokens",
|
|
@@ -267,6 +296,7 @@ export const DEFAULT_CONFIG: FlightDeckConfig = {
|
|
|
267
296
|
sidebar: {
|
|
268
297
|
enabled: true,
|
|
269
298
|
lines: DEFAULT_SIDEBAR_LINES,
|
|
299
|
+
footer: { lines: DEFAULT_SIDEBAR_FOOTER_LINES },
|
|
270
300
|
rows: DEFAULT_SIDEBAR_ROWS,
|
|
271
301
|
persist: true,
|
|
272
302
|
placeholder: DEFAULT_PLACEHOLDER,
|
|
@@ -330,27 +360,42 @@ function readText(value: unknown, fallback: string, path: string, issues: string
|
|
|
330
360
|
return text;
|
|
331
361
|
}
|
|
332
362
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
363
|
+
/**
|
|
364
|
+
* One fixed-line list, shared by the top rail and the sidebar footer.
|
|
365
|
+
*
|
|
366
|
+
* An explicitly empty list is a real choice for both rails - the top rail's
|
|
367
|
+
* lines default to empty since 0.8.0, and an empty footer list removes the
|
|
368
|
+
* footer slot entirely. A list with no usable entries still falls back to
|
|
369
|
+
* `fallback`, loudly, like every other bad option.
|
|
370
|
+
*/
|
|
371
|
+
function readLineList(
|
|
372
|
+
value: unknown,
|
|
373
|
+
issues: string[],
|
|
374
|
+
maxLines: number,
|
|
375
|
+
fallback: readonly string[],
|
|
376
|
+
path: string,
|
|
377
|
+
): readonly string[] {
|
|
378
|
+
if (value === undefined) return fallback;
|
|
379
|
+
if (!Array.isArray(value)) {
|
|
380
|
+
issues.push(`${path} must be an array of strings; using the default lines`);
|
|
381
|
+
return fallback;
|
|
338
382
|
}
|
|
383
|
+
if (value.length === 0) return [];
|
|
339
384
|
|
|
340
385
|
const lines: string[] = [];
|
|
341
386
|
value.forEach((entry, index) => {
|
|
342
|
-
const
|
|
387
|
+
const entryPath = `${path}[${index}]`;
|
|
343
388
|
if (typeof entry !== "string") {
|
|
344
|
-
issues.push(`${
|
|
389
|
+
issues.push(`${entryPath} must be a string; skipping it`);
|
|
345
390
|
return;
|
|
346
391
|
}
|
|
347
|
-
const text = normalizeText(entry,
|
|
392
|
+
const text = normalizeText(entry, entryPath, issues);
|
|
348
393
|
if (text.length === 0) {
|
|
349
|
-
issues.push(`${
|
|
394
|
+
issues.push(`${entryPath} is empty; skipping it`);
|
|
350
395
|
return;
|
|
351
396
|
}
|
|
352
397
|
if (text.length > MAX_LINE_LENGTH) {
|
|
353
|
-
issues.push(`${
|
|
398
|
+
issues.push(`${entryPath} was longer than ${MAX_LINE_LENGTH} characters; it was shortened`);
|
|
354
399
|
lines.push(text.slice(0, MAX_LINE_LENGTH));
|
|
355
400
|
return;
|
|
356
401
|
}
|
|
@@ -358,16 +403,32 @@ function readLines(value: unknown, issues: string[], maxLines: number): readonly
|
|
|
358
403
|
});
|
|
359
404
|
|
|
360
405
|
if (lines.length === 0) {
|
|
361
|
-
issues.push(
|
|
362
|
-
return
|
|
406
|
+
issues.push(`${path} had no usable entries; using the default lines`);
|
|
407
|
+
return fallback;
|
|
363
408
|
}
|
|
364
409
|
if (lines.length > maxLines) {
|
|
365
|
-
issues.push(
|
|
410
|
+
issues.push(`${path} has ${lines.length} entries; keeping the first ${maxLines}`);
|
|
366
411
|
return lines.slice(0, maxLines);
|
|
367
412
|
}
|
|
368
413
|
return lines;
|
|
369
414
|
}
|
|
370
415
|
|
|
416
|
+
function readLines(value: unknown, issues: string[], maxLines: number): readonly string[] {
|
|
417
|
+
return readLineList(value, issues, maxLines, DEFAULT_SIDEBAR_LINES, "sidebar.lines");
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* The sidebar footer's fixed lines โ the branding pair by default.
|
|
422
|
+
*
|
|
423
|
+
* Unlike the top rail, an explicitly empty list is meaningful: it removes the
|
|
424
|
+
* footer slot entirely. Only a non-empty list with no usable entries falls
|
|
425
|
+
* back to the default, reported like every other bad value, and a runaway
|
|
426
|
+
* footer is capped at `MAX_LINES` the way the top rail is.
|
|
427
|
+
*/
|
|
428
|
+
function readSidebarFooterLines(value: unknown, issues: string[]): readonly string[] {
|
|
429
|
+
return readLineList(value, issues, MAX_LINES, DEFAULT_SIDEBAR_FOOTER_LINES, "sidebar.footer.lines");
|
|
430
|
+
}
|
|
431
|
+
|
|
371
432
|
/**
|
|
372
433
|
* Read the list of live fields to render.
|
|
373
434
|
*
|
|
@@ -808,7 +869,15 @@ export function resolveConfig(options: unknown): ConfigResolution {
|
|
|
808
869
|
const footerConfigured = Object.keys(footer).length > 0;
|
|
809
870
|
|
|
810
871
|
const maxLines = readMaxLines(sidebar.maxLines, issues);
|
|
872
|
+
// The sidebar footer is its own host slot with its own list; a malformed
|
|
873
|
+
// section is reported and the default branding comes back.
|
|
874
|
+
const rawSidebarFooter = sidebar.footer;
|
|
875
|
+
if (rawSidebarFooter !== undefined && !isRecord(rawSidebarFooter)) {
|
|
876
|
+
issues.push("sidebar.footer must be an object; using defaults");
|
|
877
|
+
}
|
|
878
|
+
const sidebarFooter = isRecord(rawSidebarFooter) ? rawSidebarFooter : {};
|
|
811
879
|
const lines = readLines(sidebar.lines, issues, maxLines);
|
|
880
|
+
const footerLines = readSidebarFooterLines(sidebarFooter.lines, issues);
|
|
812
881
|
const rows = readRows(sidebar.rows, issues, maxLines);
|
|
813
882
|
// `railLines` caps the whole rail at `sidebar.maxLines`, so the fixed lines
|
|
814
883
|
// and the live rows draw from one budget. `readLines` already reports its own
|
|
@@ -825,6 +894,7 @@ export function resolveConfig(options: unknown): ConfigResolution {
|
|
|
825
894
|
sidebar: {
|
|
826
895
|
enabled: readBoolean(sidebar.enabled, DEFAULT_CONFIG.sidebar.enabled, "sidebar.enabled", issues),
|
|
827
896
|
lines,
|
|
897
|
+
footer: { lines: footerLines },
|
|
828
898
|
rows,
|
|
829
899
|
persist: readBoolean(sidebar.persist, DEFAULT_CONFIG.sidebar.persist, "sidebar.persist", issues),
|
|
830
900
|
placeholder: readText(
|