opencode2-tps 0.4.0-rc.1 → 0.4.1-rc.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/README.md CHANGED
@@ -12,7 +12,9 @@ When OpenCode reports terminal usage, the token count becomes exact while TPS re
12
12
 
13
13
  ## Install
14
14
 
15
- Built against the OpenCode 2 preview. The earliest known compatible beta is `0.0.0-beta-17595`. The TUI plugin API is still moving, so a much newer or older build may drop the indicator without an error. If the figure never appears, check your version first, then [open an issue](https://github.com/P-Theo/opencode2-tps/issues).
15
+ Built against the OpenCode 2 preview. The earliest known compatible beta is `0.0.0-beta-17595`. If the figure never appears, check your version first, then [open an issue](https://github.com/P-Theo/opencode2-tps/issues).
16
+
17
+ The current plugin release targets the theme API in OpenCode `2.0.10`, using `ctx.theme.text.muted` in place of the old `ctx.theme.text.subdued` field. On older versions that only provide `subdued`, the indicator falls back to pure white (`#ffffff`) instead of the muted theme color.
16
18
 
17
19
  Install it with the CLI's plugin command, which adds the entry to `~/.config/opencode/cli.json` for you:
18
20
 
package/dist/debug.js CHANGED
@@ -2,9 +2,6 @@ import { appendFileSync, lstatSync, mkdirSync, mkdtempSync } from "node:fs";
2
2
  import { tmpdir } from "node:os";
3
3
  import { join } from "node:path";
4
4
 
5
- // ---------------------------------------------------------------------------
6
- // debug
7
- //
8
5
  // Off unless asked for: an unconfigured install must never touch disk.
9
6
  //
10
7
  // The log goes inside an owner-only directory instead of straight into the
package/dist/options.js CHANGED
@@ -1,6 +1,3 @@
1
- // ---------------------------------------------------------------------------
2
- // options
3
- //
4
1
  // `ctx.options` is host-supplied JSON (Record<string, any>), so this is a real
5
2
  // parsing boundary: every value is validated and clamped, and anything invalid
6
3
  // falls back to the default rather than propagating NaN into the arithmetic.
package/dist/tracker.js CHANGED
@@ -1,16 +1,11 @@
1
- // ---------------------------------------------------------------------------
2
- // tracker (UI-free)
3
- //
4
- // Measures the rate of the observable model stream: bytes to a rolling
5
- // estimate while output arrives, exact step usage once the host reports it,
6
- // and a frozen average after the run ends.
1
+ // Measures the rate of the observable model stream (UI-free by design): bytes
2
+ // to a rolling estimate while output arrives, exact step usage once the host
3
+ // reports it, and a frozen average after the run ends.
7
4
 
8
5
  import { mark } from "./debug.js";
9
6
  export const DEFAULT_CONFIG = {
10
7
  bytesPerToken: 4.75
11
8
  };
12
- // The frozen final average stays visible until the next prompt starts a new run.
13
-
14
9
  export const BYTES_PER_TOKEN_MIN = 1;
15
10
  export const BYTES_PER_TOKEN_MAX = 16;
16
11
  const LIVE_WINDOW_MS = 5_000;
package/dist/tui.js CHANGED
@@ -11,9 +11,6 @@ import { configureDebug, isEnvEnabled, mark } from "./debug.js";
11
11
  import { TpsTracker } from "./tracker.js";
12
12
  import { formatLabel, resolveOptions } from "./options.js";
13
13
 
14
- // ---------------------------------------------------------------------------
15
- // plugin
16
-
17
14
  // Event payloads are taken from the SDK's own union (via the non-generic
18
15
  // `data.listen` signature) rather than restated structurally: handlers are
19
16
  // contravariant, so hand-written shapes keep typechecking after a field rename.
@@ -155,7 +152,7 @@ const definition = {
155
152
  _$setProp(_el$, "flexDirection", "row");
156
153
  _$setProp(_el$, "justifyContent", "flex-end");
157
154
  _$insert(_el$2, () => `${text()} `);
158
- _$effect(_$p => _$setProp(_el$2, "fg", ctx.theme.text.subdued, _$p));
155
+ _$effect(_$p => _$setProp(_el$2, "fg", ctx.theme.text.muted, _$p));
159
156
  return _el$;
160
157
  })()
161
158
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode2-tps",
3
- "version": "0.4.0-rc.1",
3
+ "version": "0.4.1-rc.1",
4
4
  "description": "Live token-throughput indicator for the OpenCode 2 TUI prompt composer",
5
5
  "license": "MIT",
6
6
  "author": "P-Theo",
@@ -48,9 +48,9 @@
48
48
  "devDependencies": {
49
49
  "@babel/core": "^7.29.7",
50
50
  "@babel/preset-typescript": "^7.29.7",
51
- "@opencode/cli": "0.0.0-beta-19381",
52
- "@opencode/plugin": "0.0.0-beta-19381",
53
- "@opencode/theme": "0.0.0-beta-19381",
51
+ "@opencode/cli": "2.0.10",
52
+ "@opencode/plugin": "2.0.10",
53
+ "@opencode/theme": "2.0.10",
54
54
  "@opentui/core": "^0.5.10",
55
55
  "@opentui/solid": "^0.5.10",
56
56
  "@oxlint/plugins": "^1.78.0",