mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-29 11:42:17 +00:00
Add ui.prompt.suggest so CLI plugins can offer a complete next-message draft without private prompt access. Temporarily replace the empty composer placeholder with a wrapped suggestion; configurable Tab acceptance inserts text without submitting, and Escape, typing, navigation, and plugin cleanup discard the offer. Keep suggestion disposal identity-bound so stale callbacks cannot clear a newer offer. Re-measure native placeholder layout when suggestions change. Document the API and keyboard commands. Verified: root bun run check; full TUI suite (1462 pass, 2 skip); final focused TUI checks (64 pass); website typecheck, generated-contract check and build; live dev:live/termctrl checks for acceptance, draft preservation, dismissal, typing, stale disposal, plugin reload, narrow wrapping, light/dark themes and custom bindings. Session history remained empty after acceptance. |
||
|---|---|---|
| .. | ||
| script | ||
| src | ||
| test | ||
| .gitignore | ||
| AGENTS.md | ||
| package.json | ||
| README.md | ||
| sst-env.d.ts | ||
| tsconfig.build.json | ||
| tsconfig.json | ||
@opencode/plugin
Authoring interfaces and runtime loader support for OpenCode V2 plugins:
@opencode/plugin— Promise plugin API@opencode/plugin/effect— Effect plugin API@opencode/plugin/rpc— portable RPC contract definitions@opencode/plugin/tui— terminal UI plugin API
Packaging And Runtime effect
When the OpenCode CLI loads server or TUI plugins, it resolves imports of effect, exported effect/* subpaths, and @opencode/plugin entrypoints (including imports from dependencies inside a plugin's node_modules) to the host's runtime module instances so fibers, loggers, and Schema parsers share one copy.
- Declare
effectas apeerDependency(anddevDependencyfor local type-checking and testing) rather than a bundled runtime dependency. - Do not bundle
effectinto published plugin files; if you build with a bundler, keepeffectandeffect/*external. Two copies ofeffectdo not share fiber, logger, orSchemainternals. - Plugins and their
node_modulesdependencies always receive OpenCode's hosteffectinstance. UseeffectAPIs and module paths compatible with the OpenCode release you target; dependencies built on anothereffectmajor (such as Effect 3) are not supported. - Only public
effectsubpaths are provided. A plugin that imports one of Effect's privateinternalmodules fails to load with an error naming the path. - The compiled OpenCode binary does not include the Scalar and Swagger UI assets used by Effect's HTTP API docs pages; serving those pages from a plugin shows a notice instead.