Add TUI notifications and attention sounds (disabled by default)#26980
Open
kommander wants to merge 18 commits into
Open
Add TUI notifications and attention sounds (disabled by default)#26980kommander wants to merge 18 commits into
kommander wants to merge 18 commits into
Conversation
df006c8 to
3212f8c
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a host-owned “attention” subsystem to the TUI plugin API to support desktop notifications and semantic sounds, plus a new internal notifications plugin that uses it (e.g., question/permission/session done/error).
Changes:
- Introduces
api.attention(notify + soundboard) in the plugin API types and wiring. - Adds TUI
attentionconfiguration (schema, resolution, path handling) and updates docs/fixtures/tests accordingly. - Implements the host attention engine (
createTuiAttention) with focus-aware delivery, sound packs, and built-in sounds; adds an internalnotificationsplugin.
Reviewed changes
Copilot reviewed 20 out of 67 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/plugin/src/tui.ts | Adds attention-related types and exposes attention on TuiPluginApi. |
| packages/plugin/package.json | Bumps @opentui/* peer dependency minimums to >=0.2.7. |
| packages/opencode/test/fixture/tui-runtime.ts | Updates resolved TUI config fixture to include attention defaults/overrides. |
| packages/opencode/test/fixture/tui-plugin.ts | Extends test plugin API fixture with attention stub. |
| packages/opencode/test/config/tui.test.ts | Adds coverage for attention config defaults + overrides + path resolution. |
| packages/opencode/test/cli/tui/plugin-loader.test.ts | Adds coverage for scoped attention sound pack registration disposal + relative path resolution. |
| packages/opencode/test/cli/run/runtime.boot.test.ts | Updates boot config helper to include attention settings. |
| packages/opencode/test/cli/cmd/tui/notifications.test.ts | Adds tests for the internal notifications plugin behavior and deduping logic. |
| packages/opencode/test/cli/cmd/tui/attention.test.ts | Adds extensive tests for createTuiAttention behavior (focus gating, sanitization, sound packs, failures, disposal). |
| packages/opencode/src/cli/cmd/tui/plugin/runtime.ts | Adds scoped attention API + plugin-relative file resolution and disposes host attention on runtime dispose. |
| packages/opencode/src/cli/cmd/tui/plugin/internal.ts | Registers the new internal notifications plugin. |
| packages/opencode/src/cli/cmd/tui/plugin/api.tsx | Threads attention into the TUI plugin API factory. |
| packages/opencode/src/cli/cmd/tui/feature-plugins/system/notifications.ts | Implements internal TUI notifications via api.attention.notify. |
| packages/opencode/src/cli/cmd/tui/config/tui.ts | Adds attention config resolution, defaults, and relative-path resolution for sound overrides. |
| packages/opencode/src/cli/cmd/tui/config/tui-schema.ts | Adds attention config schema and allowed semantic sound names. |
| packages/opencode/src/cli/cmd/tui/attention.ts | Implements host attention engine (notifications + audio + soundboard + sanitization). |
| packages/opencode/src/cli/cmd/tui/app.tsx | Instantiates attention host and passes it to plugin API + runtime. |
| packages/opencode/src/audio.d.ts | Adds *.mp3 module typing for audio imports. |
| packages/opencode/specs/tui-plugins.md | Documents attention config and api.attention usage. |
| packages/opencode/package.json | Adds @opencode-ai/ui workspace dependency for bundled audio assets. |
| package.json | Bumps root @opentui/* versions to 0.2.7. |
| bun.lock | Lockfile updates for the new dependency and @opentui/* version bump. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| attention.soundboard.registerPack({ | ||
| ...pack, | ||
| sounds: Object.fromEntries( | ||
| Object.entries(pack.sounds).map(([name, file]) => [name, resolvePluginFile(root, file)]), |
3212f8c to
a35ad5f
Compare
6 tasks
a35ad5f to
bd7e641
Compare
142e1cb to
2187de6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.