oc-flight-deck 0.20.0 → 0.20.2
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 +18 -0
- package/INSTALL.md +15 -0
- package/README.md +11 -11
- package/assets/icon.svg +7 -0
- package/assets/signature.svg +7 -0
- package/dist/tui/index.js +12 -2
- package/package.json +13 -12
- package/src/tui/format.ts +23 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.20.2] - 2026-10-22
|
|
4
|
+
|
|
5
|
+
- Version bump for the monorepo release; no runtime change.
|
|
6
|
+
- npm is the only documented install route; the git and local-clone routes were removed from the docs.
|
|
7
|
+
|
|
3
8
|
All notable changes to this project are documented in this file.
|
|
4
9
|
|
|
5
10
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
11
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
12
|
|
|
13
|
+
## [Unreleased]
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- The rail's count formatter now steps past millions: a 1,769,100,000 cache read draws as `1.8B` instead of `1769.1M`, and the 999,950,000 boundary draws as `1B` instead of `1000M`. The `B` and `T` steps carry the same one-decimal shape as `M`, and the round-before-unit rule holds at every boundary up to the deliberate `T` ceiling (a token count at ~999.95T would still read `1000T`).
|
|
18
|
+
|
|
19
|
+
## [0.20.1] - 2026-10-21
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- Host SDK `@opencode/plugin` 2.0.30 → 2.1.1; opentui peers `@opentui/core` and `@opentui/solid` 0.5.17 → 0.6.6 (`peerDependencies >=0.6.6`).
|
|
24
|
+
- No behaviour change: `src/` has no use of the removed `session.compacted` event or the renamed provider replay fields (`providerState`, `providerResultState`, `resultState`, `providerContext`), so nothing else moved.
|
|
25
|
+
|
|
8
26
|
## [0.20.0] - 2026-10-17
|
|
9
27
|
|
|
10
28
|
### Added
|
package/INSTALL.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Install - oc-flight-deck
|
|
2
|
+
|
|
3
|
+
Compatible with opencode 2.1.1.
|
|
4
|
+
|
|
5
|
+
One route: the npm registry. Plugin entries are bare strings in the `plugins` array of `opencode.jsonc`.
|
|
6
|
+
|
|
7
|
+
```jsonc
|
|
8
|
+
{ "plugins": ["oc-flight-deck"] }
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Use the package name (`"oc-flight-deck"`): it resolves through npm and honours the package's `exports`. A local directory path will not work — OpenCode looks for `index.js`/`index.ts` at the directory root, ignores `exports`, and drops the entry silently (no load, no error, no log line). This is a real limitation, not a supported route.
|
|
12
|
+
|
|
13
|
+
The bare name tracks the newest release; append `@<version>` to pin an exact published version. The npm tarball ships the compiled `dist/` (the `prepublishOnly` step builds it before packing), so the registry entry always has a working entry point. Restart OpenCode after editing the config.
|
|
14
|
+
|
|
15
|
+
The TUI half has no direct observation surface in this build; verify it by its visible effect (the sidebar rendering).
|
package/README.md
CHANGED
|
@@ -9,27 +9,27 @@
|
|
|
9
9
|
Add the entry to the `plugins` array in your `opencode.jsonc`, then restart OpenCode:
|
|
10
10
|
|
|
11
11
|
```json
|
|
12
|
-
{ "plugins": ["oc-flight-deck
|
|
12
|
+
{ "plugins": ["oc-flight-deck"] }
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
The panel renders beside your next open session with defaults and no config file.
|
|
16
|
-
You need OpenCode `2.
|
|
16
|
+
You need OpenCode `2.1.1` already installed, on Node 22+ or Bun 1.4+.
|
|
17
17
|
|
|
18
18
|
### Or let your AI install it
|
|
19
19
|
|
|
20
20
|
```text
|
|
21
|
-
Install the oc-flight-deck plugin: add "oc-flight-deck
|
|
21
|
+
Install the oc-flight-deck plugin: add "oc-flight-deck" to the plugins array in my opencode.jsonc, restart OpenCode, then open a session and confirm the telemetry panel renders in the sidebar. Report which of the default rows you see: status, agent, model, cost, project, tokens, cache, context, perms, elapsed, tps.
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
### Offline or pinned
|
|
25
25
|
|
|
26
|
-
The registry is the
|
|
26
|
+
The registry is the only install route: tagged releases only.
|
|
27
27
|
|
|
28
28
|
```json
|
|
29
|
-
{ "plugins": ["oc-flight-deck
|
|
29
|
+
{ "plugins": ["oc-flight-deck"] }
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
The
|
|
32
|
+
The bare name tracks the newest release and never names a version that does not exist between a bump and its publish. To pin an exact published version, append `@<version>`; the pin then stays put.
|
|
33
33
|
|
|
34
34
|
## Use it
|
|
35
35
|
|
|
@@ -204,20 +204,20 @@ Watchdog on for long runs:
|
|
|
204
204
|
|
|
205
205
|
## Requirements
|
|
206
206
|
|
|
207
|
-
- OpenCode `2.
|
|
207
|
+
- OpenCode `2.1.1`
|
|
208
208
|
- Node `>=22` or Bun `>=1.4.0`
|
|
209
209
|
|
|
210
210
|
## Links
|
|
211
211
|
|
|
212
|
-
-
|
|
212
|
+
- Source: https://github.com/nathwn12/oc-collections/tree/main/packages/oc-flight-deck — the npm package remains individually installable.
|
|
213
213
|
- Package: https://www.npmjs.com/package/oc-flight-deck
|
|
214
|
-
- Issues: https://github.com/nathwn12/oc-
|
|
214
|
+
- Issues: https://github.com/nathwn12/oc-collections/issues
|
|
215
215
|
- OpenCode V2 plugin API: https://opencode.ai/v2/docs/build/plugins/cli
|
|
216
216
|
- Example config: [flight-deck.example.jsonc](flight-deck.example.jsonc)
|
|
217
217
|
- Config schema: [flight-deck.schema.json](flight-deck.schema.json)
|
|
218
|
-
-
|
|
218
|
+
- Install: [INSTALL.md](INSTALL.md)
|
|
219
219
|
- Changelog: [CHANGELOG.md](CHANGELOG.md)
|
|
220
|
-
- Releases: https://github.com/nathwn12/oc-
|
|
220
|
+
- Releases: https://github.com/nathwn12/oc-collections/releases
|
|
221
221
|
- Licence: MIT, see [LICENSE](LICENSE)
|
|
222
222
|
|
|
223
223
|
<!-- nathwn12 house footer: identical in every repo. Do not edit. -->
|
package/assets/icon.svg
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
2
|
+
<rect x="16" y="16" width="480" height="480" rx="112" fill="#0B0F14"/>
|
|
3
|
+
<path d="M146,280 A110,110 0 0 1 366,280 L318,280 A62,62 0 0 0 194,280 Z" fill="#4DD4E8"/>
|
|
4
|
+
<polygon points="238,267 322,186 274,293" fill="#4DD4E8"/>
|
|
5
|
+
<circle cx="256" cy="280" r="34" fill="#EEF3F6"/>
|
|
6
|
+
<rect x="136" y="336" width="240" height="44" rx="22" fill="#4DD4E8"/>
|
|
7
|
+
</svg>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
2
|
+
<style>html,body{margin:0;padding:0}svg{display:block;width:100vw;height:100vh}</style>
|
|
3
|
+
<!-- Direction A: "cursor-n" — rounded lowercase n + terminal block cursor, near-black ground -->
|
|
4
|
+
<rect x="16" y="16" width="480" height="480" rx="112" fill="#0B0F14"/>
|
|
5
|
+
<path d="M136 384 L136 264 C136 196 180 164 234 164 C288 164 328 198 328 264 L328 384 L264 384 L264 270 C264 242 250 230 234 230 C218 230 200 242 200 270 L200 384 Z" fill="#EEF3F6"/>
|
|
6
|
+
<rect x="352" y="312" width="52" height="72" rx="8" fill="#4DD4E8"/>
|
|
7
|
+
</svg>
|
package/dist/tui/index.js
CHANGED
|
@@ -367,14 +367,24 @@ function copyFeedback(result, id) {
|
|
|
367
367
|
}
|
|
368
368
|
|
|
369
369
|
// src/tui/format.ts
|
|
370
|
+
var COUNT_UNITS = [
|
|
371
|
+
["M", 1e6],
|
|
372
|
+
["B", 1e9],
|
|
373
|
+
["T", 1000000000000]
|
|
374
|
+
];
|
|
370
375
|
function formatCount(value) {
|
|
371
376
|
if (value < 1000)
|
|
372
377
|
return String(Math.round(value));
|
|
373
378
|
const thousands = Math.round(value / 1000);
|
|
374
379
|
if (thousands < 1000)
|
|
375
380
|
return `${thousands}k`;
|
|
376
|
-
const
|
|
377
|
-
|
|
381
|
+
for (const [index, [suffix, size]] of COUNT_UNITS.entries()) {
|
|
382
|
+
const text = (value / size).toFixed(1);
|
|
383
|
+
if (index === COUNT_UNITS.length - 1 || Number(text) < 1000) {
|
|
384
|
+
return `${text.endsWith(".0") ? text.slice(0, -2) : text}${suffix}`;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
throw new Error("unreachable: T is the terminal unit");
|
|
378
388
|
}
|
|
379
389
|
function formatCost(value) {
|
|
380
390
|
return `$${value.toFixed(value < 1 ? 3 : 2)}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oc-flight-deck",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.2",
|
|
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",
|
|
@@ -16,12 +16,11 @@
|
|
|
16
16
|
"author": "nathwn12",
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
19
|
-
"url": "git+https://github.com/nathwn12/oc-
|
|
20
|
-
|
|
21
|
-
"homepage": "https://github.com/nathwn12/oc-flight-deck#readme",
|
|
22
|
-
"bugs": {
|
|
23
|
-
"url": "https://github.com/nathwn12/oc-flight-deck/issues"
|
|
19
|
+
"url": "git+https://github.com/nathwn12/oc-collections.git",
|
|
20
|
+
"directory": "packages/oc-flight-deck"
|
|
24
21
|
},
|
|
22
|
+
"homepage": "https://github.com/nathwn12/oc-collections/tree/main/packages/oc-flight-deck",
|
|
23
|
+
"bugs": "https://github.com/nathwn12/oc-collections/issues",
|
|
25
24
|
"type": "module",
|
|
26
25
|
"exports": {
|
|
27
26
|
".": {
|
|
@@ -40,7 +39,9 @@
|
|
|
40
39
|
"flight-deck.schema.json",
|
|
41
40
|
"README.md",
|
|
42
41
|
"LICENSE",
|
|
43
|
-
"CHANGELOG.md"
|
|
42
|
+
"CHANGELOG.md",
|
|
43
|
+
"INSTALL.md",
|
|
44
|
+
"assets"
|
|
44
45
|
],
|
|
45
46
|
"engines": {
|
|
46
47
|
"node": ">=22",
|
|
@@ -58,19 +59,19 @@
|
|
|
58
59
|
"access": "public"
|
|
59
60
|
},
|
|
60
61
|
"dependencies": {
|
|
61
|
-
"@opencode/plugin": "2.
|
|
62
|
+
"@opencode/plugin": "2.1.1"
|
|
62
63
|
},
|
|
63
64
|
"devDependencies": {
|
|
64
|
-
"@opentui/core": "0.
|
|
65
|
-
"@opentui/solid": "0.
|
|
65
|
+
"@opentui/core": "0.6.6",
|
|
66
|
+
"@opentui/solid": "0.6.6",
|
|
66
67
|
"@types/bun": "^1.4.2",
|
|
67
68
|
"solid-js": "1.9.12",
|
|
68
69
|
"string-width": "7.2.0",
|
|
69
70
|
"typescript": "^5.9.3"
|
|
70
71
|
},
|
|
71
72
|
"peerDependencies": {
|
|
72
|
-
"@opentui/core": ">=0.
|
|
73
|
-
"@opentui/solid": ">=0.
|
|
73
|
+
"@opentui/core": ">=0.6.6",
|
|
74
|
+
"@opentui/solid": ">=0.6.6",
|
|
74
75
|
"solid-js": ">=1.9.0"
|
|
75
76
|
}
|
|
76
77
|
}
|
package/src/tui/format.ts
CHANGED
|
@@ -6,16 +6,33 @@
|
|
|
6
6
|
// ten-cell fuel gauge, and a sparkline shaped from recent turn sizes. All pure
|
|
7
7
|
// and dependency-free, so the formatting is trivial to test.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// Unit ladder, smallest first.
|
|
10
|
+
const COUNT_UNITS = [
|
|
11
|
+
["M", 1_000_000],
|
|
12
|
+
["B", 1_000_000_000],
|
|
13
|
+
["T", 1_000_000_000_000],
|
|
14
|
+
] as const;
|
|
15
|
+
|
|
16
|
+
/** `518k`, `29.2M`, `1.8B`, `940` — short enough for a narrow rail, precise enough to read. Units `k`, `M`, `B` and `T` with one decimal and trailing `.0` dropped; `T` is the last unit, so values at and above ~999.95T render as `1000T`. */
|
|
10
17
|
export function formatCount(value: number): string {
|
|
11
18
|
if (value < 1_000) return String(Math.round(value));
|
|
12
|
-
// Round *before* choosing the unit. Rounding only inside the
|
|
13
|
-
// anything from 999,500 to 999,999 print as `1000k` — a
|
|
14
|
-
// magnitudes in it, and one an agent reads as a different
|
|
19
|
+
// Round *before* choosing the unit, at every step. Rounding only inside the
|
|
20
|
+
// `k` branch made anything from 999,500 to 999,999 print as `1000k` — a
|
|
21
|
+
// number with two magnitudes in it, and one an agent reads as a different
|
|
22
|
+
// size entirely. Stopping at `M` did the same at the next boundary
|
|
23
|
+
// (999,950,000 rendering as `1000M` instead of `1B`), so each larger unit is
|
|
24
|
+
// tried in turn.
|
|
15
25
|
const thousands = Math.round(value / 1_000);
|
|
16
26
|
if (thousands < 1_000) return `${thousands}k`;
|
|
17
|
-
const
|
|
18
|
-
|
|
27
|
+
for (const [index, [suffix, size]] of COUNT_UNITS.entries()) {
|
|
28
|
+
const text = (value / size).toFixed(1);
|
|
29
|
+
if (index === COUNT_UNITS.length - 1 || Number(text) < 1_000) {
|
|
30
|
+
return `${text.endsWith(".0") ? text.slice(0, -2) : text}${suffix}`;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// Unreachable: the `T` escape above always returns. A throw, not a fallback
|
|
34
|
+
// return, so no second path can ever render a count string.
|
|
35
|
+
throw new Error("unreachable: T is the terminal unit");
|
|
19
36
|
}
|
|
20
37
|
|
|
21
38
|
/** Sub-dollar sessions keep a third decimal so a cheap run never reads `$0.00`. */
|