mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-07 16:17:25 +03:00
1.5 KiB
1.5 KiB
Plugin Package Guide
- The server SDK has two versions: Effect and Promise.
src/tui/is the TUI SDK andsrc/gui/the GUI SDK. - In the Effect version, every domain must extend the corresponding Effect API client interface from
@opencode/client/effect/api. - Do not redefine functions that already exist on the Effect API client interface.
- Plugin domains add only the additional functions that make sense in the plugin context.
- The GUI SDK never loads in the server or the TUI, so
runtime-modules.tsskipsgui/and the CLI bundle does not grow. src/gui/followspackages/gui-plugins/AGENTS.md: the built-ins there are its main users, andbun run lintfrom the repository root checks its TSDoc (script/sdk-docs.ts). Runbun run generatehere after the app's icon catalog changes.src/gui/host.ts(@opencode/plugin/gui/host) is the app's and desktop's internal protocol, for workspace imports only:tsconfig.build.jsonleaves it out ofdistandscript/pack.tsexports it asnull. Keep public SDK modules from importing it.src/gui/builtin.ts(@opencode/plugin/gui/builtin, the API only the app's built-in plugins use) andsrc/gui/updater.ts(@opencode/plugin/gui/updater, the app's own updater contract) are workspace-only the same way, and neither is a module a plugin bundle may require.src/gui/internal.tsholds the window host's internals the public helpers read;gui/hostre-exports them. The./gui/*export isnull, so only the listedguisubpaths resolve.