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
- Internal plugins can declare `enabled: false` to be registered but inactive by default; `plugin_enabled` and runtime KV can still enable them by id.
46
56
-`plugin_enabled` is merged across config layers.
47
57
- Runtime enable/disable state is also stored in KV under `plugin_enabled`; that KV state overrides config on startup.
58
+
-`attention.enabled` disables all `api.attention.notify(...)` delivery when set to `false`.
59
+
-`attention.notifications` and `attention.sound` independently control terminal-mediated desktop notifications and built-in sounds.
60
+
-`attention.volume` sets the default built-in sound volume from `0` to `1`.
61
+
-`attention.sound_pack` selects the initial semantic sound pack. Persisted runtime selection in KV can override it.
62
+
-`attention.sounds` overrides individual semantic sound slots such as `error` or `done`.
48
63
-`leader_timeout` is a top-level TUI setting.
49
64
-`keybinds` is a flat object keyed by command id; values are key binding values (`false`, `"none"`, a key string/object, a binding object, or an array of key strings/objects/binding objects).
50
65
-`keybinds.leader` sets the key used by `<leader>` shortcuts.
@@ -212,6 +227,7 @@ That is what makes local config-scoped plugins able to import `@opencode-ai/plug
212
227
Top-level API groups exposed to `tui(api, options, meta)`:
@@ -246,6 +262,24 @@ Top-level API groups exposed to `tui(api, options, meta)`:
246
262
-`formatBindings(bindings)` formats binding lists and returns `undefined` when there is nothing to show.
247
263
- For generic config-to-bindings helpers, import `createBindingLookup` from `@opencode-ai/plugin/tui`.
248
264
265
+
### Attention
266
+
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
+
-`when: "always"` requests delivery regardless of terminal focus state.
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.
272
+
- Semantic sound names are `"default"`, `"question"`, `"permission"`, `"error"`, and `"done"`.
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.
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.
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`.
277
+
-`api.attention.soundboard.current()` and `list()` expose the active/registered packs for plugin UX.
278
+
- Config `attention.sounds` overrides active-pack sounds by slot. Failed loads fall back to the active pack and then `opencode.default`.
279
+
- The host strips ANSI/control characters and collapses newlines before sending text to the terminal notification API.
280
+
- Terminal and OS settings decide whether a requested notification is visibly displayed.
281
+
- Prefer privacy-safe messages such as `"A question needs your input"`; avoid full commands, paths, prompts, errors, secrets, or file contents unless the plugin intentionally exposes them.
0 commit comments