oc-flight-deck 0.10.0 → 0.10.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 +8 -1
- package/README.md +1 -1
- package/flight-deck.example.jsonc +4 -4
- package/flight-deck.schema.json +1 -1
- package/package.json +1 -1
- package/src/tui/clipboard.ts +26 -0
- package/src/tui/index.tsx +39 -5
- package/src/tui/rows.ts +3 -4
- package/src/tui/stat-fields.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,10 +5,17 @@ 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.10.1] - 2026-10-02
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- The opt-in `ses` row is now usable as an identifier. It draws the full session id (the rail wraps it) instead of only its first 8 characters, and a click reports the outcome instead of copying silently: a confirmation naming the id when the copy was sent, and a distinct failure message when the terminal cannot take it.
|
|
13
|
+
|
|
8
14
|
## [0.10.0] - 2026-10-02
|
|
9
15
|
|
|
10
16
|
### Added
|
|
11
17
|
|
|
12
|
-
- Opt-in `ses` sidebar row: shows the session id
|
|
18
|
+
- 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.
|
|
13
19
|
|
|
20
|
+
[0.10.1]: https://github.com/nathwn12/oc-flight-deck/compare/v0.10.0...v0.10.1
|
|
14
21
|
[0.10.0]: https://github.com/nathwn12/oc-flight-deck/compare/v0.9.0...v0.10.0
|
package/README.md
CHANGED
|
@@ -64,7 +64,7 @@ The panel's only fixed text — `▸ FLIGHT DECK` over a separator — is **opt-
|
|
|
64
64
|
| `turns` | How many prompts you've sent this session · **off by default** |
|
|
65
65
|
| `guard` | Harness status from oc-harness-guard · **off by default** |
|
|
66
66
|
| `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** |
|
|
67
|
-
| `ses` | The open session id,
|
|
67
|
+
| `ses` | The open session id, which the rail wraps; **click the row** to copy the full id to the terminal clipboard · **off by default** (requires the host's mouse) |
|
|
68
68
|
|
|
69
69
|
`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.
|
|
70
70
|
|
|
@@ -120,9 +120,9 @@
|
|
|
120
120
|
// go Zen Go account usage for the 5h / 1w / 1m windows: a dial and
|
|
121
121
|
// a percent each, turning red as a window approaches its limit.
|
|
122
122
|
// Reads OPENCODE_GO_API_KEY. Available, off by default.
|
|
123
|
-
// ses the
|
|
124
|
-
//
|
|
125
|
-
//
|
|
123
|
+
// ses the full session id (the rail wraps it). A mouse click on the
|
|
124
|
+
// row copies the full id to the terminal clipboard. Off by
|
|
125
|
+
// default; needs the host's mouse enabled.
|
|
126
126
|
//
|
|
127
127
|
// Every named row renders persistently, so the rail keeps a stable shape:
|
|
128
128
|
// a row with no data yet shows the placeholder below, in the same label
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
// ,"go" — Zen Go account usage (needs OPENCODE_GO_API_KEY)
|
|
144
144
|
// ,"caution" — the annunciator
|
|
145
145
|
// ,"branch" — current git branch
|
|
146
|
-
// ,"ses"
|
|
146
|
+
// ,"ses" - current session id (full, wrapped); click to copy the full id
|
|
147
147
|
],
|
|
148
148
|
|
|
149
149
|
// Every named row renders persistently: with no data yet it shows the
|
package/flight-deck.schema.json
CHANGED
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"items": { "enum": ["caution", "status", "agent", "model", "branch", "cost", "total", "project", "tokens", "cache", "context", "perms", "elapsed", "tps", "spark", "reasoning", "turns", "guard", "go", "ses"] },
|
|
56
56
|
"default": ["status", "agent", "model", "cost", "project", "tokens", "cache", "context", "perms", "elapsed", "tps"],
|
|
57
57
|
"maxItems": 24,
|
|
58
|
-
"description": "Which live fields to draw, top to bottom. Any subset, any order
|
|
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. The opt-in `ses` row shows the full session id (the rail wraps it); a mouse click on that row copies the full id to the terminal clipboard."
|
|
59
59
|
},
|
|
60
60
|
"persist": {
|
|
61
61
|
"type": "boolean",
|
package/package.json
CHANGED
package/src/tui/clipboard.ts
CHANGED
|
@@ -35,3 +35,29 @@ export function copyToClipboard(renderer: unknown, text: string): boolean {
|
|
|
35
35
|
return false;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The confirmation for a copy gesture, as a host-toast description.
|
|
41
|
+
*
|
|
42
|
+
* Split from {@link copyToClipboard} so the success and failure wordings are
|
|
43
|
+
* pure and tested directly: a click must always report what actually happened,
|
|
44
|
+
* and the two outcomes must never read alike. `ok` mirrors the attempted write.
|
|
45
|
+
* The success text names the full `id` and says the copy was *sent* - an
|
|
46
|
+
* `attempted` status only confirms the local dispatch to the terminal, not that
|
|
47
|
+
* the terminal then copied - so a message never claims a write that was not
|
|
48
|
+
* guaranteed. The failure text names the terminal's inability and carries no id
|
|
49
|
+
* at all, because nothing was copied, so a silent no-op can never masquerade as
|
|
50
|
+
* a success.
|
|
51
|
+
*/
|
|
52
|
+
export function copyFeedback(
|
|
53
|
+
attempted: boolean,
|
|
54
|
+
id: string,
|
|
55
|
+
): {
|
|
56
|
+
readonly ok: boolean;
|
|
57
|
+
readonly variant: "success" | "error";
|
|
58
|
+
readonly message: string;
|
|
59
|
+
} {
|
|
60
|
+
return attempted
|
|
61
|
+
? { ok: true, variant: "success", message: `Sent the full session id ${id} to the clipboard.` }
|
|
62
|
+
: { ok: false, variant: "error", message: "This terminal cannot copy to the clipboard." };
|
|
63
|
+
}
|
package/src/tui/index.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsxImportSource @opentui/solid */
|
|
2
2
|
import { Plugin } from "@opencode/plugin/tui";
|
|
3
3
|
import { cautionDetail, cautionText, detectCautions, worstCaution, type Caution } from "./caution.js";
|
|
4
|
-
import { copyToClipboard } from "./clipboard.js";
|
|
4
|
+
import { copyFeedback, copyToClipboard } from "./clipboard.js";
|
|
5
5
|
import { cautionThresholds, mergeOptions, resolveConfig } from "./config.js";
|
|
6
6
|
import { loadConfigFile } from "./file-config.js";
|
|
7
7
|
import { footerLine, railLineSpans, railLines, railLineStyle, type RailLine } from "./presentation.js";
|
|
@@ -79,7 +79,17 @@ export default Plugin.define({
|
|
|
79
79
|
// window is red" decision is tested directly. All this renderer does is
|
|
80
80
|
// resolve each role to a theme colour and pass `fg`, never ANSI.
|
|
81
81
|
const text = (
|
|
82
|
-
<text
|
|
82
|
+
<text
|
|
83
|
+
fg={lineFg}
|
|
84
|
+
attributes={attributeMask(style.attributes) ?? 0}
|
|
85
|
+
// Only the `ses` row breaks on character boundaries. Its value is one
|
|
86
|
+
// unbroken 30-character id with no word boundary; pinning `char`
|
|
87
|
+
// guarantees that token breaks deterministically at a character
|
|
88
|
+
// boundary, rather than depending on how the renderer's word-break
|
|
89
|
+
// handles a token it cannot break. Every other line keeps the
|
|
90
|
+
// renderer's own `word` default.
|
|
91
|
+
wrapMode={line.field === "ses" ? "char" : undefined}
|
|
92
|
+
>
|
|
83
93
|
{railLineSpans(line, style).map((span) => (
|
|
84
94
|
<span style={{ fg: themeColor(span.color, context.theme) as string | undefined }}>
|
|
85
95
|
{span.text}
|
|
@@ -90,10 +100,34 @@ export default Plugin.define({
|
|
|
90
100
|
// The `ses` row is the one live row with a second gesture: a click copies
|
|
91
101
|
// the full session id. The handler wraps the line in a box so it fires
|
|
92
102
|
// wherever the row is clicked (mouse events bubble up, never down), and
|
|
93
|
-
// it closes over the id from THIS render
|
|
94
|
-
// is never cached.
|
|
103
|
+
// it closes over the id from THIS render - see `snapshot` for why the id
|
|
104
|
+
// is never cached. The confirmation is a host toast, not an on-row glyph:
|
|
105
|
+
// a signal from this plugin's own Solid is invisible to the host's
|
|
106
|
+
// renderer (`./ticker.ts`), so the one host-reactive surface is used
|
|
107
|
+
// instead. The toast is wrapped so a failure in it can never throw out of
|
|
108
|
+
// the mouse handler.
|
|
95
109
|
if (copyId === undefined) return text;
|
|
96
|
-
return
|
|
110
|
+
return (
|
|
111
|
+
<box
|
|
112
|
+
onMouseUp={() => {
|
|
113
|
+
const attempted = copyToClipboard(context.renderer, copyId);
|
|
114
|
+
const fb = copyFeedback(attempted, copyId);
|
|
115
|
+
try {
|
|
116
|
+
context.ui.toast.show({
|
|
117
|
+
title: "Flight Deck",
|
|
118
|
+
message: fb.message,
|
|
119
|
+
variant: fb.variant,
|
|
120
|
+
duration: 1500,
|
|
121
|
+
});
|
|
122
|
+
} catch {
|
|
123
|
+
// A confirmation must never be able to break the click that
|
|
124
|
+
// produced it, nor the panel it confirms.
|
|
125
|
+
}
|
|
126
|
+
}}
|
|
127
|
+
>
|
|
128
|
+
{text}
|
|
129
|
+
</box>
|
|
130
|
+
);
|
|
97
131
|
};
|
|
98
132
|
|
|
99
133
|
// Bound a bankable window to a few ticks: `min(60s, max(5s, 4 * refreshMs))`,
|
package/src/tui/rows.ts
CHANGED
|
@@ -385,10 +385,9 @@ export function statLine(
|
|
|
385
385
|
}
|
|
386
386
|
case "ses": {
|
|
387
387
|
const id = asText(source.sessionId);
|
|
388
|
-
//
|
|
389
|
-
//
|
|
390
|
-
|
|
391
|
-
return id === undefined ? undefined : row("ses", id.slice(0, 8));
|
|
388
|
+
// The full id is drawn: it is the only usable form of the value, and the
|
|
389
|
+
// rail wraps it on character boundaries rather than clipping it.
|
|
390
|
+
return id === undefined ? undefined : row("ses", id);
|
|
392
391
|
}
|
|
393
392
|
case "go": {
|
|
394
393
|
// The plain string is the exact join of the coloured segments, so the
|
package/src/tui/stat-fields.ts
CHANGED
|
@@ -24,8 +24,8 @@ export interface StatSource {
|
|
|
24
24
|
readonly branch?: unknown;
|
|
25
25
|
/**
|
|
26
26
|
* The open session id, straight from the slot render props. Untrusted like
|
|
27
|
-
* every other field: the `ses` row draws
|
|
28
|
-
*
|
|
27
|
+
* every other field: the `ses` row draws the FULL id (the rail wraps it), and
|
|
28
|
+
* that same full value is what the row's copy gesture writes.
|
|
29
29
|
*/
|
|
30
30
|
readonly sessionId?: unknown;
|
|
31
31
|
readonly tree?: unknown;
|