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
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -264,13 +264,14 @@ Top-level API groups exposed to `tui(api, options, meta)`:
264
264
265
265
### Attention
266
266
267
-
-`api.attention.notify({ title?, message, sound?, when? })` requests user attention while keeping terminal focus, notifications, and audio owned by the host.
268
-
-`message` is required; `title` defaults to `"opencode"`; `when` defaults to `"always"`; `sound` defaults to `false`.
267
+
-`api.attention.notify({ title?, message, notification?, sound? })` requests user attention while keeping terminal focus, notifications, and audio owned by the host.
268
+
-`message` is required; `title` defaults to `"opencode"`; `notification` defaults to enabled with `when: "blurred"`; `sound` defaults to enabled with `when: "always"`.
269
269
-`when: "always"` requests delivery regardless of terminal focus state.
270
270
-`when: "focused"` only requests delivery after the terminal is known focused; `when: "blurred"` only requests delivery after the terminal is known blurred.
271
+
- Example: `notification: { when: "blurred" }, sound: { name: "question", when: "always" }` plays sound while focused but only triggers system notifications when blurred.
271
272
- Semantic sound names are `"default"`, `"question"`, `"permission"`, `"error"`, and `"done"`.
272
-
-`sound: true` plays the `"default"` sound; `sound: "question"` or `sound: { name: "question" }` plays a named semantic sound.
273
-
-`sound: { volume }` overrides volume for that call; `sound: { enabled: false }` disables sound for that call.
273
+
-`sound: true` plays the `"default"` sound; `sound: { name: "question" }` plays a named semantic sound.
274
+
-`sound: { volume }` overrides volume for that call; `sound: false` disables sound for that call; `notification: false` disables system notification for that call.
274
275
-`api.attention.soundboard.registerPack({ id, name?, sounds })` registers a sound pack and returns a disposer. Relative paths resolve from the plugin root and are cleaned up on plugin deactivation.
275
276
-`api.attention.soundboard.activate(id, { persist })` selects the active pack. `persist: true` writes the selected pack id to TUI KV state, not `tui.json`.
276
277
-`api.attention.soundboard.current()` and `list()` expose the active/registered packs for plugin UX.
0 commit comments