Skip to content

v1.0.1

Choose a tag to compare

@github-actions github-actions released this 11 Aug 22:46
f2febf7

v1.0.1 — TokenMeter: fix the unloadable TUI package entrypoints

TokenMeter 1.0.0 published dist/tokenmeter.js with no exports map. OpenCode resolves npm TUI plugins exclusively through exports["./tui"], so the published package never loaded: the sidebar never appeared. 1.0.1 ships the contract-compliant entrypoint pair, the regression guard that makes the defect impossible to republish silently, and the plugin skill's now-mandatory entrypoint contract.

What changed

The package loads again: dist/tui.js + dist/tui.d.ts via exports["./tui"]

  • The build now produces exactly dist/tui.js — the same OpenTUI Solid-transform bundle (real effect/insert/insertNode reactive bindings, external host runtimes) — plus a deterministic dist/tui.d.ts declaration emitted from the source entry by the project's own TypeScript during bun run build (no new dependency).
  • package.json declares main/types and an exports map: "./tui" (and ".", pointing at the same pair for legacy resolvers) → dist/tui.js + dist/tui.d.ts.
  • The obsolete dist/tokenmeter.js path is gone. No compatibility alias is kept.
  • Runtime dependencies are unchanged: @opentui/core, @opentui/solid, and solid-js remain external runtime packages provided by the TUI host and shipped in dependencies.

The defect cannot silently return

  • test/artifact.test.ts now asserts the dist surface (exactly tui.js + tui.d.ts, never tokenmeter.js or index.*), the manifest exports shape, the declaration content, and the bun pm pack --dry-run tarball listing. A stale artifact or a missing exports["./tui"] fails CI before any publish.

The plugin skill enforces the entrypoint contract

  • The opencode-plugin skill documents the four possible artifact pairs and when each applies: TUI-only (tui.js/tui.d.tsexports["./tui"], registered in tui.json), server/runtime-only (index.js/index.d.tsexports["."] or exports["./runtime"], registered in opencode.json), dual (both pairs, two configs), and forbids shipping index.* in a TUI-only package.

The panel shows its new version

  • The sidebar title row renders TokenMeter 1.0.1; DESIGN.md, PRD, README, and the render/unit tests now describe the current UI.

Upgrade

From 1.0.0 (unloadable):

  • Pinned users: change the pin to 1.0.1 in your TUI config, then restart OpenCode.
  • Unpinned users: OpenCode resolves latest on launch — restart OpenCode to pick up 1.0.1.

Both cases:

{
  "$schema": "https://opencode.ai/tui.json",
  "plugin": ["opencode-tokenmeter-tui"]
}

OpenCode installs plugin dependencies automatically — there is no npm install step.

Known issues

  • The sidebar glyphs are Nerd Font PUA codepoints: without a Nerd Font active in the terminal they degrade to missing characters. Every number still renders and the panel never crashes.
  • The cache breakdown row (R<read>|W<write>) needs roughly 36 terminal columns of sidebar width; narrower sidebars omit the breakdown row rather than overflow.
  • Project totals include deleted sessions from the first run of 1.0.0 onward; sessions deleted before the plugin's SQLite store existed are not counted retroactively.
  • The opencode-tokenmeter-tui@1.0.0-bootstrap.0 placeholder (if still present on npm under the bootstrap dist-tag) is not loadable and should never be pinned; remove the bootstrap dist-tag after this stable release per docs/release-security.md.

Rollback

There is no functional npm version before 1.0.1: 1.0.0 was publishable but unloadable, and the 1.0.0-bootstrap.0 placeholder is not a usable plugin. If 1.0.1 regresses:

  • Users: unpin or revert to the last working version you actually ran locally, or remove the plugin entry until a fix ships; report the failure so a 1.0.2 can be cut.
  • Maintainer: the release pipeline is tag-driven (v1.0.1 → preflight → publish → verify). A regression in 1.0.1 is corrected by cutting 1.0.2, not by re-pointing 1.0.1 — npm versions are immutable. Keep this document as the single release record until the next tag renames it.