feat: add native opencode plugin (server + TUI)#195
Open
sdeonvacation wants to merge 2 commits intoJuliusBrussee:mainfrom
Open
feat: add native opencode plugin (server + TUI)#195sdeonvacation wants to merge 2 commits intoJuliusBrussee:mainfrom
sdeonvacation wants to merge 2 commits intoJuliusBrussee:mainfrom
Conversation
Adds plugins/caveman/.opencode-plugin/ with: - server.ts: system prompt injection (lite/full/ultra), auto-ultra for subagent sessions - tui.ts: TUI commands (enable/disable/set-level) with dialogs - package.json: exports map pointing server.ts and tui.ts State persisted to XDG_STATE_HOME/opencode/caveman.json β TUI writes, server reads per turn. Mirrors .codex-plugin/ structure convention.
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.
What
Adds a native opencode plugin under
plugins/caveman/.opencode-plugin/:server.tsβ injects caveman system prompt on every turn viaexperimental.chat.system.transform. Reads per-session state (disabled list + level) fromXDG_STATE_HOME/opencode/caveman.json. Tracks subagent sessions via bus events and auto-applies ultra for them.tui.tsβ registers three TUI commands in the/command palette: enable, disable, set-level (lite/full/ultra) with a dialog picker.package.jsonβ manifest withexportsmap pointing./serverβserver.tsand./tuiβtui.ts.Also updates
README.mdto surface opencode as a first-class supported agent (install table row, feature matrix column, dedicated details section, footnote).Before / After
Before: opencode listed only in "Any other agent" section with generic
npx skillsinstall (skill only, no auto-activation).After: opencode has its own plugin with auto-activation every session, per-session enable/disable/level switching via TUI commands, and auto-ultra for subagent sessions.
Structure
Mirrors the existing
.codex-plugin/convention:Notes
experimental.chat.system.transformhook is marked experimental in opencode's API β same as other plugin authors use it todaypackages/opencode/src/plugin/shared.ts) β server/tui must be separate exports per loader constraint