oc-flight-deck 0.20.0 → 0.20.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 +13 -0
- package/README.md +2 -2
- package/dist/tui/index.js +12 -2
- package/package.json +6 -6
- package/src/tui/format.ts +23 -6
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,19 @@ 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
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- 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`).
|
|
13
|
+
|
|
14
|
+
## [0.20.1] - 2026-10-21
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- 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`).
|
|
19
|
+
- 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.
|
|
20
|
+
|
|
8
21
|
## [0.20.0] - 2026-10-17
|
|
9
22
|
|
|
10
23
|
### Added
|
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ Add the entry to the `plugins` array in your `opencode.jsonc`, then restart Open
|
|
|
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
|
|
|
@@ -204,7 +204,7 @@ 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
|
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.1",
|
|
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",
|
|
@@ -58,19 +58,19 @@
|
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@opencode/plugin": "2.
|
|
61
|
+
"@opencode/plugin": "2.1.1"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@opentui/core": "0.
|
|
65
|
-
"@opentui/solid": "0.
|
|
64
|
+
"@opentui/core": "0.6.6",
|
|
65
|
+
"@opentui/solid": "0.6.6",
|
|
66
66
|
"@types/bun": "^1.4.2",
|
|
67
67
|
"solid-js": "1.9.12",
|
|
68
68
|
"string-width": "7.2.0",
|
|
69
69
|
"typescript": "^5.9.3"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
|
-
"@opentui/core": ">=0.
|
|
73
|
-
"@opentui/solid": ">=0.
|
|
72
|
+
"@opentui/core": ">=0.6.6",
|
|
73
|
+
"@opentui/solid": ">=0.6.6",
|
|
74
74
|
"solid-js": ">=1.9.0"
|
|
75
75
|
}
|
|
76
76
|
}
|
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`. */
|