Skip to content

v0.9.0 — OpenCode V2 support

Latest

Choose a tag to compare

@vheins vheins released this 22 Sep 07:41
· 7 commits to main since this release

OpenCode V2 support (dual V1 + V2)

One package now works on both OpenCode V2 (Plugin.define({ id, setup })) and OpenCode V1 (1.18.29+, via the server hook). The discovery core is shared; only the entrypoint differs.

Highlights

  • New V2 plugin (src/v2.ts) built with Plugin.define({ id: "9router", setup }), registering providers/models through ctx.provider.transform(...) and refreshing via ctx.provider.reload()
  • New src/v2-map.ts mapping the discovered ModelConfig onto V2 Model.Info (capabilities, required limit.context/limit.output, variants)
  • New src/index.ts dual entrypoint: default export merges the V2 definition with server: NineRouterPlugin (V1 1.18.29+); named NineRouterPlugin export retained for older V1
  • Package entry (exports, main, types) now points at dist/index.js / dist/index.d.ts
  • @opencode/plugin@^2.0.12 added as a runtime dependency; @opencode-ai/plugin / @opencode-ai/sdk kept for V1 types

Install

{
  "$schema": "https://opencode.ai/config.json",
  "plugins": ["@vheins/opencode-9router@latest"]
}

Config for V2 uses "plugins": [...]; custom providers use package: "@opencode/ai/providers/openai-compatible" + settings.baseURL under the providers key. See README "OpenCode V2" section for full config.

Compatibility & notes

  • V1 behavior unchanged; discovery/capability/cache algorithms untouched (no V1 regression).

Changelog

  • f3ac6ca feat(plugin): add OpenCode V2 support with dual V1/V2 entrypoint
  • d2a46d2 chore(release): bump to 0.9.0 for OpenCode V2 support
  • c978af5 docs: document OpenCode V2 configuration and dual V1/V2 support