Skip to content

[FEAT] OpenCode V2 plugin API support (dual V2/V1 export) #41

Done

Description

@four-bytes-robby

OpenCode V2 (2.4.3) rejects the plugin; it only implements the V1 API (@opencode-ai/plugin).

Port the server part to one default export carrying both Plugin.define({ id, setup(ctx) }) (V2) and the unchanged server() (V1, OpenCode ≥ 1.18.29):

  • Pin @opencode/plugin@2.4.3 alongside @opencode-ai/plugin; keep the id stable across both parts.
  • The V1 server part is a no-op (event: () => {}); add the equivalent V2 setup so V2 accepts the package.
  • The balance row lives in the TUI — ported in a separate issue.

Accept: loads in V2 and V1; tool names byte-identical in both; typecheck + bun test + build green; dist/ current.

Part of epic four-bytes/four-opencode-plugins#78.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions