oc-flight-deck 0.25.2 → 0.25.3
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 +1 -1
- package/README.md +3 -1
- package/dist/tui/index.js +4 -5
- package/package.json +6 -6
- package/src/tui/index.tsx +6 -5
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -20,7 +20,9 @@ Add the entry to the `plugins` array in your `opencode.jsonc`, then restart Open
|
|
|
20
20
|
{ "plugins": ["oc-flight-deck"] }
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
##
|
|
23
|
+
## First use
|
|
24
|
+
|
|
25
|
+
Open a session and check that the telemetry panel appears beside it.
|
|
24
26
|
|
|
25
27
|
The rail draws up to 22 named fields in the order you choose; `MAX_LINES` (24) caps fixed lines plus live rows together. Among the fields:
|
|
26
28
|
|
package/dist/tui/index.js
CHANGED
|
@@ -4708,6 +4708,7 @@ function createTpsReader(context, live, scope = DEFAULT_TPS_SCOPE, realtime) {
|
|
|
4708
4708
|
|
|
4709
4709
|
// src/tui/index.tsx
|
|
4710
4710
|
import { jsx, jsxs } from "@opentui/solid/jsx-runtime";
|
|
4711
|
+
var observe = (..._reads) => {};
|
|
4711
4712
|
var tui_default = Plugin.define({
|
|
4712
4713
|
id: "oc-flight-deck",
|
|
4713
4714
|
setup(context) {
|
|
@@ -4923,9 +4924,7 @@ var tui_default = Plugin.define({
|
|
|
4923
4924
|
render: ({ sessionID }) => {
|
|
4924
4925
|
watchedSession = sessionID;
|
|
4925
4926
|
bridge?.follow(sessionID);
|
|
4926
|
-
ticker?.frame;
|
|
4927
|
-
bridge?.status;
|
|
4928
|
-
goBridge?.usage;
|
|
4927
|
+
observe(ticker?.frame, bridge?.status, goBridge?.usage);
|
|
4929
4928
|
const source = snapshot(sessionID);
|
|
4930
4929
|
const lines = railLines(config, source);
|
|
4931
4930
|
if (lines.length === 0)
|
|
@@ -4941,10 +4940,10 @@ var tui_default = Plugin.define({
|
|
|
4941
4940
|
releases.push(context.ui.slot({
|
|
4942
4941
|
prepend: "sidebar.footer",
|
|
4943
4942
|
render: () => {
|
|
4944
|
-
ticker?.frame;
|
|
4943
|
+
const frame = ticker?.frame;
|
|
4945
4944
|
const goUsage = goBridge?.usage;
|
|
4946
4945
|
const goReason = goBridge === undefined ? "no-bridge" : goBridge.reason ?? (goUsage === undefined ? "pending" : undefined);
|
|
4947
|
-
const panel = goPanelEnabled ? goPanelLines(goUsage, Date.now(), goLook.current(),
|
|
4946
|
+
const panel = goPanelEnabled ? goPanelLines(goUsage, Date.now(), goLook.current(), frame ?? 0, goReason) : [];
|
|
4948
4947
|
return /* @__PURE__ */ jsxs("box", {
|
|
4949
4948
|
flexDirection: "column",
|
|
4950
4949
|
children: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oc-flight-deck",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.3",
|
|
4
4
|
"description": "Live cost, token, cache and context telemetry for every OpenCode session in your sidebar.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"opencode",
|
|
@@ -62,13 +62,13 @@
|
|
|
62
62
|
"access": "public"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@opencode/plugin": "^2.3.
|
|
65
|
+
"@opencode/plugin": "^2.3.2"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@opencode/plugin": "2.3.
|
|
69
|
-
"@opentui/core": "^0.9.
|
|
70
|
-
"@opentui/solid": "^0.9.
|
|
71
|
-
"@types/bun": "^1.4.
|
|
68
|
+
"@opencode/plugin": "2.3.2",
|
|
69
|
+
"@opentui/core": "^0.9.7",
|
|
70
|
+
"@opentui/solid": "^0.9.7",
|
|
71
|
+
"@types/bun": "^1.4.5",
|
|
72
72
|
"solid-js": "1.9.19",
|
|
73
73
|
"string-width": "7.2.0",
|
|
74
74
|
"typescript": "^7.0.2"
|
package/src/tui/index.tsx
CHANGED
|
@@ -28,6 +28,9 @@ import { createRealtimeTps } from "./realtime-tps.js";
|
|
|
28
28
|
import { createSessionReads, locationOf } from "./session-reads.js";
|
|
29
29
|
import { createTpsReader } from "./session-tps.js";
|
|
30
30
|
|
|
31
|
+
/** Reading a host-store getter inside a render subscribes that render to it. */
|
|
32
|
+
const observe = (..._reads: unknown[]): void => {};
|
|
33
|
+
|
|
31
34
|
// Flight Deck is a read-only instrument panel for the OpenCode V2 CLI/TUI. It
|
|
32
35
|
// shows the open session's agent, model, branch, cost, tokens, and cache hit
|
|
33
36
|
// rate in the sidebar. It uses only the official CLI plugin boundary —
|
|
@@ -453,9 +456,7 @@ export default Plugin.define({
|
|
|
453
456
|
// immediately on change, and the status read below subscribes this
|
|
454
457
|
// render to the bridge's host store, so polls re-run the rail.
|
|
455
458
|
bridge?.follow(sessionID);
|
|
456
|
-
|
|
457
|
-
void bridge?.status;
|
|
458
|
-
void goBridge?.usage;
|
|
459
|
+
observe(ticker?.frame, bridge?.status, goBridge?.usage);
|
|
459
460
|
|
|
460
461
|
const source = snapshot(sessionID);
|
|
461
462
|
const lines = railLines(config, source);
|
|
@@ -497,7 +498,7 @@ export default Plugin.define({
|
|
|
497
498
|
// clock-derived, and the read is what registers the dependency so
|
|
498
499
|
// a poll re-runs this slot. `goBridge` is absent when neither
|
|
499
500
|
// surface asked for it, so both reads are safe to skip.
|
|
500
|
-
|
|
501
|
+
const frame = ticker?.frame;
|
|
501
502
|
const goUsage = goBridge?.usage;
|
|
502
503
|
// A blank panel must name its cause. `goBridge` absent means
|
|
503
504
|
// `startGoBridge` found no usable host store - distinct from a
|
|
@@ -509,7 +510,7 @@ export default Plugin.define({
|
|
|
509
510
|
? "no-bridge"
|
|
510
511
|
: (goBridge.reason ?? (goUsage === undefined ? "pending" : undefined));
|
|
511
512
|
const panel = goPanelEnabled
|
|
512
|
-
? goPanelLines(goUsage, Date.now(), goLook.current(),
|
|
513
|
+
? goPanelLines(goUsage, Date.now(), goLook.current(), frame ?? 0, goReason)
|
|
513
514
|
: [];
|
|
514
515
|
return (
|
|
515
516
|
<box flexDirection="column">
|