Skip to content

v1.2.0 — OpenCode 2.x support (one package, both versions)

Choose a tag to compare

@yangwudong yangwudong released this 21 Sep 06:29
· 4 commits to main since this release

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) and setup (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's session_prompt_right slot no longer exists in V2. Override with the new slot option 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/plugin at runtime.

Install

# opencode 1.x (unchanged)
opencode plugin @jack-yang/opencode-tps-meter -g

# opencode 2.x
opencode plugin add @jack-yang/opencode-tps-meter

On 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).