Repository navigation
v0.4.0 - OpenCode v2 support (stable)
v0.4.0 — OpenCode v2 support (stable)
Promotes v0.4.0-beta.1 to stable with loader fixes verified end to end against
OpenCode 2.0.2: the server reports
"features":{"server":true,"tui":true},"state":{"status":"active"} for the
plugin, and the meter renders in the TUI prompt footer. Install with
opencode-tps-meter@latest. Everything in the beta.1 notes below carries over.
🐞 Fixed since beta.1
- Removed the
tui: trueflag from the server plugin definition. The loader
treats anytuikey as a legacy handler and throws
Plugin <spec> has invalid tui exporton a non-function, aborting the whole
plugin load with no meter. ./serverresolves to the dual-hostdist/index.mjsagain ({ id, server, setup }), the only shape valid on both loaders. The v2-only
dist/v2/server.mjs({ id, setup }) fails the v1server()requirement.
The/v2exports remain for programmaticimportonly.- Local
file://installs must target<package>/dist, not the repo root.
The 2.0.2 resolver handles local directories by file path (<dir>/server,
<dir>/index,<dir>/tui) and ignorespackage.json#exportsthere, so the
repo root (no rootindex.*) is silently skipped.dist/contains both
index.mjs(server) andtui.mjs(TUI). - A build-invariants regression test now locks both entrypoints against both
loaders, including a direct guard ondist/v2/server.mjs.
📝 Notes
- OpenCode 2.x ships its own per-message
tok/sreadout next to each assistant
reply. To show only this plugin's meter, set"tps": falseundersessionin
cli.json. To keep the built-in readout instead, run/tps hidden. - Local installs should register
file:///<path>/opencode-tps-meter/distin
opencode.json(plugin),cli.json(plugins), andtui.json(plugin).