Repository navigation
feat: dual V2/V1 plugin API support (OpenCode V2) (#9) - #11
Draft
four-bytes-robby wants to merge 1 commit into
Draft
four-bytes-robby wants to merge 1 commit into
four-bytes-robby wants to merge 1 commit into
Conversation
V1 server() unchanged; V2 Plugin.define({ id, setup }) registers go_usage
through ctx.tool.transform. The V2 tool input is zod-derived JSON Schema with
the $schema dialect marker dropped (PR #270 finding).
four-bytes-robby
force-pushed
the
feat/9-v2-dual
branch
from
November 30, 2026 21:51
16a6fe2 to
8dc0c27
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #9
One default export for both generations: OpenCode 1.19.6 keeps reading
serverunchanged, V2 2.4.3 readsid/setupfrom the same export.What changed
serveruntouched: samego_usagetool, byte-identical description, string result.setup:Plugin.define({ id, setup }), tool registered viactx.tool.transform, result normalised to{ content }.tool.schema.toJSONSchema) with the$schemadialect marker dropped (PR #270 finding). One shared zod schema feeds both paths.UsageReaderinjection keeps both tool paths testable without keys or network.Local gate (implementation machine, bun 1.3.14)
bunx tsc --noEmit— 0 errorsbun test— 44 pass / 0 fail (4 files, 93 expects); existing V1 tests unchanged and greenbun run build— ok (dist/four-opencode-go-meter.js5.04 KB, TUI + d.ts regenerated)console.*in plugin codebash scripts/live-check-11.sh— 12/12 contract checks (opencode 1.19.6 on PATH)Not run here: live TUI check.
scripts/live-check-11.shis read-only (--liveoptional) and prints the V1 checklist; a V2 host smoke test still needs a V2 install.Part of epic four-bytes/four-opencode-plugins#78.