feat(desktop): expose guarded composer voice ownership controller - #100666
Open
TheAngryPit wants to merge 1 commit into
Open
feat(desktop): expose guarded composer voice ownership controller#100666TheAngryPit wants to merge 1 commit into
TheAngryPit wants to merge 1 commit into
Conversation
Contributor
Substantial refactor: voice-context epoch identity + a module-global mic lease + a
|
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.
What changed
Hermes Desktop already owns the composer microphone, wake-word pause/resume lifecycle, canonical message submission, and assistant state. A Desktop plugin action can render beside the composer, but it cannot safely coordinate those resources without either bypassing the canonical chat path or racing the built-in voice controller.
This PR adds a narrow, renderer-only controller to the existing
composer.actionscontribution context. A plugin can:The controller is guarded by session and epoch fencing before and after asynchronous boundaries. Navigation, stale controllers, overlapping acquisition, aborted pause operations, and unmount disposal therefore fail closed instead of mutating the next session.
The SDK exposes only the controller contract. It does not add provider code, credentials, a voice-provider registry, transport logic, or a second chat authority to Core.
Why this shape
A concrete external Desktop consumer needs ownership coordination, not a competing Realtime provider stack inside Hermes Core. Core remains authoritative for microphone/wake/composer state. The plugin remains authoritative for its provider transport and audio lifecycle.
This advances the extension seam discussed in #77111. It is intentionally separate from the broader provider abstraction in #95147 and the built-in controller lifetime work in #95180.
A companion plugin PR will consume this contract once this Core seam is available: TheSmokeDev/hermes-talk#80.
Type
Files changed
apps/desktop/src/app/chat/composer/hooks/use-composer-voice.tsapps/desktop/src/app/chat/composer/index.tsxcomposer.actionsrender context;apps/desktop/src/sdk/index.tsapps/desktop/src/app/chat/composer/hooks/use-composer-voice.test.tsTesting
On the rebased candidate against frozen base
ab9866bc64df48281a2d929dfb1dfd1001973d24:npm run test:ui— 702 files, 6938 tests passed;npm run typecheck— passed;npm run buildandnode scripts/assert-dist-built.mjs— passed;git diff --check origin/main...HEAD— passed.Checklist