You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/opencode/specs/tui-plugins.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,12 +84,18 @@ export default plugin
84
84
- TUI shape is `default export { id?, tui }`; including `server` is rejected.
85
85
- A single module cannot export both `server` and `tui`.
86
86
-`tui` signature is `(api, options, meta) => Promise<void>`.
87
-
- If package `exports` contains `./tui`, the loader resolves that entrypoint. Otherwise it uses the resolved package target.
87
+
- If package `exports` contains `./tui`, the loader resolves that entrypoint.
88
+
- If package `exports` exists, loader only resolves `./tui` or `./server`; it never falls back to `exports["."]`.
89
+
- For npm package specs, TUI does not use `package.json``main` as a fallback entry.
90
+
-`package.json``main` is only used for server plugin entrypoint resolution.
88
91
- If a package supports both server and TUI, use separate files and package `exports` (`./server` and `./tui`) so each target resolves to a target-only module.
89
92
- File/path plugins must export a non-empty `id`.
90
93
- npm plugins may omit `id`; package `name` is used.
91
94
- Runtime identity is the resolved plugin id. Later plugins with the same id are rejected, including collisions with internal plugin ids.
92
-
- If a path spec points at a directory, that directory must have `package.json` with `main`.
95
+
- If a path spec points at a directory, server loading can use `package.json``main`.
96
+
- TUI path loading never uses `package.json``main`.
97
+
- Legacy compatibility: path specs like `./plugin` can resolve to `./plugin/index.ts` (or `index.js`) when `package.json` is missing.
98
+
- The `./plugin -> ./plugin/index.*` fallback applies to both server and TUI v1 loading.
93
99
- There is no directory auto-discovery for TUI plugins; they must be listed in `tui.json`.
0 commit comments