opencode-context-indicator 1.5.4 → 1.6.0

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 CHANGED
@@ -4,6 +4,29 @@ Notable user-facing changes per release. Dates are commit days (UTC).
4
4
  The package also ships a dual V1/V2 plugin — see the README for the surface
5
5
  matrix; everything below concerns the V2 path unless stated otherwise.
6
6
 
7
+ ## 1.6.0 — 2026-10-27
8
+
9
+ Host alignment release: opencode 2.2.0 moved TUI plugins to OpenTUI 0.7.
10
+
11
+ - **OpenTUI 0.7.0.** `@opencode/plugin` 2.2.0 declares `@opentui/core` and
12
+ `@opentui/solid` **0.7.0** as peers, and the host release notes state that a
13
+ plugin left on OpenTUI 0.6 no longer installs against it (upstream wording;
14
+ this repo's gates only ever run against the current host). The pinned direct
15
+ dependency is now `@opentui/solid@0.7.0` (dev pins `@opentui/core@0.7.0` and
16
+ `@opencode/plugin@2.2.0`). None of the 0.7 breaking changes apply to this
17
+ plugin: it renders intrinsic OpenTUI elements and registers slots, and defines
18
+ no custom renderables, native integrations or `nativeSceneWorkBudget` options.
19
+ - **Host support.** The server-only V2 path is unchanged and still targets
20
+ opencode 2.0.16+. The TUI module now ships compiled against OpenTUI 0.7, so
21
+ the sidebar and the `/cx` panel require **opencode ≥ 2.2.0** and cannot load on
22
+ an older host. Older-host installation was not re-verified for this release.
23
+ - **Compaction ceiling unchanged.** `calculateCeiling()` in 2.2.0 is identical
24
+ to 2.1.x, so the `0.15 / 16k / 32k` reserve formula and every `%` denominator
25
+ are unaffected. (2.2.0 changed how a *compaction request* is sized - measured
26
+ prompt instead of characters - not the trigger.)
27
+ - Dev: `drift-watch` is green again (host 2.2.0, OpenTUI 0.7.0); `tsc`,
28
+ `prepublish` and the isolated e2e pass against the 2.2.0 CLI.
29
+
7
30
  ## 1.5.4 — 2026-10-27
8
31
 
9
32
  Fix-and-hygiene release after a full-project review. No new commands.
package/README.md CHANGED
@@ -13,7 +13,7 @@ arguments, tool results (the outputs fed back into context) and the residual
13
13
  The package ships a **dual V1 + V2 plugin** (one entry works in both OpenCode
14
14
  generations) plus an optional TUI module (`./tui` entry) that renders a **live
15
15
  sidebar** and a **zero-LLM `/cx` breakdown panel** with measured contributors
16
- and a redacted export. The V2 path is **tested against opencode 2.1.4**; the
16
+ and a redacted export. The V2 path is **tested against opencode 2.2.0**; the
17
17
  V1 path against 1.18.29+.
18
18
 
19
19
  > **V1 is feature-frozen.** It is kept working for compatibility (bug fixes
@@ -70,7 +70,8 @@ For every served request the plugin estimates how the context window is split:
70
70
  duplicate group), reported honestly as *"N redundant tool outputs ≈ X tokens"*
71
71
  — never as "the model wasted effort". Findings are per-session and **path-free
72
72
  in the persisted/exported form**.
73
- * The denominator is the **opencode 2.1.4 compaction ceiling**: `window =
73
+ * The denominator is the **opencode 2.2.0 compaction ceiling** (unchanged since
74
+ 2.1.4): `window =
74
75
  limit.input || limit.context`; `reserve = max(floor(window * 0.15), window >=
75
76
  2 * 16_000 ? 16_000 : 0)`; the ceiling is `window - reserve`. This mirrors
76
77
  `calculateCeiling()` in `packages/core/src/session/compaction.ts`. When opencode
@@ -546,14 +547,17 @@ the sidebar instead.
546
547
  indicator degrades
547
548
  gracefully (the breakdown falls back to throttled `session.messages` fetches
548
549
  and toasts keep working).
549
- * **OpenCode ≥ 2.0.16** for the V2 path (built and verified against
550
- **2.1.4**).
550
+ * **OpenCode ≥ 2.2.0** for the V2 path with the TUI surfaces (built and verified
551
+ against **2.2.0**). The server-only V2 path keeps working on 2.0.16+; the TUI
552
+ module pins the OpenTUI generation it was compiled against, so a host on
553
+ OpenTUI 0.6 (opencode ≤ 2.1.4) will not load the TUI surfaces - neither the
554
+ sidebar nor the `/cx` panel - from a 1.6.x install.
551
555
  * **TUI sidebar**: terminal TUI only, requires the OpenTUI rendering stack that
552
556
  ships with OpenCode. `@opentui/core` and `solid-js` are **optional** peer
553
557
  dependencies resolved by OpenCode at runtime; the main plugin installs and runs
554
558
  fine without them (the sidebar simply is not available). `@opentui/solid` is
555
- instead shipped as a **pinned direct dependency** (exact `0.6.8`, matching
556
- the OpenTUI stack OpenCode 2.1.4 ships): OpenCode's
559
+ instead shipped as a **pinned direct dependency** (exact `0.7.0`, matching
560
+ the OpenTUI stack OpenCode 2.2.0 ships): OpenCode's
557
561
  TUI loader does not expose a host instance of it, so for npm-installed plugins
558
562
  the JSX pragma would otherwise fail to resolve `@opentui/solid/jsx-runtime`
559
563
  (upstream: opencode issue #33884 — `node_modules` plugins are excluded from the
package/index.js CHANGED
@@ -127,7 +127,8 @@
127
127
  *
128
128
  * - Metric: the native opencode overflow count — tokens.total when present,
129
129
  * else input + output + cache.read + cache.write — compared against the
130
- * model's compaction ceiling (opencode 2.1.4 calculateCeiling): window =
130
+ * model's compaction ceiling (opencode calculateCeiling, unchanged since
131
+ * 2.1.4): window =
131
132
  * limit.input || limit.context, reserve = max(15% of window, 16k when
132
133
  * window >= 32k), usable = window - reserve. Percentages are NOT
133
134
  * clamped at 100% - exceeding the ceiling must stay visible.
package/lib/limits.js CHANGED
@@ -7,7 +7,8 @@
7
7
  // hydrateModelLimitsFromState() seeds the maps from the shared state.json
8
8
  // snapshot via ./state.js. Extracted 1:1 (code + WHY comments) from index.js.
9
9
  //
10
- // Compaction ceiling (opencode 2.1.4): opencode's core calculateCeiling() in
10
+ // Compaction ceiling (opencode calculateCeiling, unchanged since 2.1.4 and the
11
+ // same in 2.2.0): opencode's core calculateCeiling() in
11
12
  // packages/core/src/session/compaction.ts derives the auto-compaction trigger
12
13
  // ceiling as window - reserve, where window = limit.input || limit.context
13
14
  // (null/zero falls through to the context window) and
@@ -79,8 +80,9 @@ function getModelLimit(providerID, modelID) {
79
80
  return typeof rec.context === "number" && rec.context > 0 ? rec.context : null;
80
81
  }
81
82
 
82
- // Compute the reserve for a given window, matching opencode 2.1.4
83
- // packages/core/src/session/compaction.ts calculateCeiling(). Returns null when
83
+ // Compute the reserve for a given window, matching opencode's
84
+ // packages/core/src/session/compaction.ts calculateCeiling() (unchanged since
85
+ // 2.1.4). Returns null when
84
86
  // window is not a finite positive number.
85
87
  const RESERVE_SHARE = 0.15; // core: RESERVE_SHARE
86
88
  const RESERVE_MIN = 16_000; // core: RESERVE_MIN
@@ -110,7 +112,7 @@ function reserveFor(window, bufferOverride) {
110
112
  );
111
113
  }
112
114
 
113
- // Native opencode compaction ceiling (2.1.4 calculateCeiling):
115
+ // Native opencode compaction ceiling (calculateCeiling, unchanged since 2.1.4):
114
116
  // window = limit.input || limit.context (zero/null falls through to context)
115
117
  // reserve = reserveFor(window) [or bufferOverride when provided]
116
118
  // usable = window - reserve
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-context-indicator",
3
- "version": "1.5.4",
3
+ "version": "1.6.0",
4
4
  "description": "Real-time context-window usage for OpenCode: per-category token breakdown, /context-diff, a zero-LLM /cx panel with per-session cost and a searchable family-session picker, and a TUI sidebar. Dual V1 + V2 plugin entry.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -62,11 +62,11 @@
62
62
  }
63
63
  },
64
64
  "dependencies": {
65
- "@opentui/solid": "0.6.8"
65
+ "@opentui/solid": "0.7.0"
66
66
  },
67
67
  "devDependencies": {
68
- "@opencode/plugin": "2.1.4",
69
- "@opentui/core": "0.6.8",
68
+ "@opencode/plugin": "2.2.0",
69
+ "@opentui/core": "0.7.0",
70
70
  "@types/node": "26.6.3",
71
71
  "esbuild": "^0.28.2",
72
72
  "node-pty": "^1.1.0",
package/tui.tsx CHANGED
@@ -38,9 +38,11 @@
38
38
  *
39
39
  * Runtime requirements: @opentui/core and solid-js are optional peers resolved
40
40
  * by OpenCode at runtime. @opentui/solid is a pinned direct dependency (exact
41
- * 0.6.8): OpenCode's TUI loader does not expose a host instance of it, so for
42
- * npm-installed plugins the JSX pragma would otherwise fail to resolve
43
- * `@opentui/solid/jsx-runtime` (upstream opencode issue #33884).
41
+ * 0.7.0, the version opencode 2.2.0 ships): OpenCode's TUI loader does not
42
+ * expose a host instance of it, so for npm-installed plugins the JSX pragma
43
+ * would otherwise fail to resolve `@opentui/solid/jsx-runtime` (upstream
44
+ * opencode issue #33884). @opencode/plugin 2.2.0 declares OpenTUI 0.7.0 as its
45
+ * peer, so a plugin left on 0.6.x no longer installs against that host.
44
46
  *
45
47
  * Graceful mode: when this file is loaded from an npm install (its own path is
46
48
  * inside a `node_modules` directory), OpenCode skips the host Solid transform