TL;DR
Expose a startServer() function on PluginInput so plugins can programmatically start the opencode HTTP server on demand.
More detail
Plugins that need to interact with the opencode server API (e.g. to inject tool results or report status) currently have no way to ensure the server is running. The server is normally only started when the TUI or server CLI command is used.
Adding startServer() to PluginInput lets plugins lazily start the server when they need it. The function is idempotent — calling it multiple times returns the same server instance.
The type is also exported from the @opencode/plugin package.
Part of the plugin primitives work tracked in #20018 (split from #21687).
TL;DR
Expose a
startServer()function onPluginInputso plugins can programmatically start the opencode HTTP server on demand.More detail
Plugins that need to interact with the opencode server API (e.g. to inject tool results or report status) currently have no way to ensure the server is running. The server is normally only started when the TUI or
serverCLI command is used.Adding
startServer()toPluginInputlets plugins lazily start the server when they need it. The function is idempotent — calling it multiple times returns the same server instance.The type is also exported from the
@opencode/pluginpackage.Part of the plugin primitives work tracked in #20018 (split from #21687).