Repository navigation
v1.2.0 — OpenCode 2.x support (one package, both versions)
Added
- OpenCode 2.x support — one package now loads on both opencode 1.x and 2.x. The default export carries two entrypoints:
tui(V1) andsetup(V2, new plugin API). The measurement core (TPS / AVG / TTFT / thinking stream) is shared and unchanged.
How it works on 2.x
- Events:
session.text.delta/session.reasoning.delta(streaming TPS),session.step.started(TTFT origin),session.step.ended(AVG + calibration),session.step.failed/session.tool.input.started(clear live state). - Render:
ctx.ui.slot({ append: "prompt.footer.status" })— V1'ssession_prompt_rightslot no longer exists in V2. Override with the newslotoption if placement needs adjusting. - Theme: V2 semantic tokens (
text.muted,text.feedback.*.base,hue.accent[500]). - No new dependencies: V2 API types are declared locally; nothing is imported from
@opencode/pluginat runtime.
Install
# opencode 1.x (unchanged)
opencode plugin @jack-yang/opencode-tps-meter -g
# opencode 2.x
opencode plugin add @jack-yang/opencode-tps-meterOn 2.x, terminal-client plugin config lives in ~/.config/opencode/cli.json under plugins (your tui.json is migrated automatically). Options are the same as before; 2.x uses the object form:
{
"plugins": [
{
"package": "@jack-yang/opencode-tps-meter",
"options": { "spinner": { "theme": "tech", "cells": 6 } }
}
]
}Feedback wanted (2.x)
The V2 adapter is verified against the published 2.x type definitions but not yet against a running V2 binary. If the meter shows in an unexpected spot, set the slot option (e.g. "prompt.footer", "session.composer.top") and please open an issue with a screenshot.
opencode 1.x behavior is unchanged (tested on 1.17.20 / 1.18.30).