Skip to content

Add TUI notifications and attention sounds (disabled by default)#26980

Open
kommander wants to merge 18 commits into
devfrom
notifications-aha
Open

Add TUI notifications and attention sounds (disabled by default)#26980
kommander wants to merge 18 commits into
devfrom
notifications-aha

Conversation

@kommander
Copy link
Copy Markdown
Collaborator

@kommander kommander commented May 12, 2026

  • Added TUI attention API for notifications, sounds, sound packs, and per-call focus behavior.
  • Added internal notifications plugin for questions, permissions, session completion, and session errors.
  • Added built-in audio assets and sound playback support.
  • Added plugin sound pack registration with scoped cleanup and relative path resolution.
  • Added TUI config for attention, with notifications disabled by default in v1.
  • Added tests for attention behavior, notifications, config defaults, runtime boot, and plugin sound packs.
  • Added v2 spec noting notifications should default to enabled in v2.

@kommander kommander changed the title tui notifications tui notifications (WIP) May 12, 2026
@kommander kommander added the beta label May 12, 2026
@kommander kommander force-pushed the notifications-aha branch from df006c8 to 3212f8c Compare May 12, 2026 02:58
opencode-agent Bot added a commit that referenced this pull request May 12, 2026
opencode-agent Bot added a commit that referenced this pull request May 12, 2026
opencode-agent Bot added a commit that referenced this pull request May 12, 2026
opencode-agent Bot added a commit that referenced this pull request May 12, 2026
opencode-agent Bot added a commit that referenced this pull request May 12, 2026
@simonklee simonklee requested a review from Copilot May 12, 2026 09:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 attention configuration (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 internal notifications plugin.

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)]),
opencode-agent Bot added a commit that referenced this pull request May 12, 2026
opencode-agent Bot added a commit that referenced this pull request May 12, 2026
opencode-agent Bot added a commit that referenced this pull request May 12, 2026
@kommander kommander force-pushed the notifications-aha branch from 3212f8c to a35ad5f Compare May 12, 2026 13:46
opencode-agent Bot added a commit that referenced this pull request May 12, 2026
opencode-agent Bot added a commit that referenced this pull request May 12, 2026
opencode-agent Bot added a commit that referenced this pull request May 12, 2026
opencode-agent Bot added a commit that referenced this pull request May 12, 2026
opencode-agent Bot added a commit that referenced this pull request May 12, 2026
opencode-agent Bot added a commit that referenced this pull request May 12, 2026
@kommander kommander force-pushed the notifications-aha branch from a35ad5f to bd7e641 Compare May 12, 2026 20:29
@kommander kommander force-pushed the notifications-aha branch from 142e1cb to 2187de6 Compare May 12, 2026 20:51
@kommander kommander changed the title tui notifications (WIP) Add TUI notifications and attention sounds (disabled by default) May 12, 2026
opencode-agent Bot added a commit that referenced this pull request May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants