dsh-live-voice 0.2.3 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/CHANGELOG.md +19 -1
  2. package/DEVELOPMENT.md +13 -0
  3. package/LICENSE +201 -674
  4. package/PLAN.md +28 -0
  5. package/README.md +65 -107
  6. package/docs/ARCHITECTURE.md +40 -0
  7. package/docs/CHOOSING-AN-ENGINE.md +120 -0
  8. package/docs/CONFIGURATION.md +149 -0
  9. package/docs/REVIEW.md +35 -0
  10. package/docs/VOICE-LIFECYCLE.md +59 -0
  11. package/lib/client.js +3581 -1691
  12. package/lib/server.js +641 -453
  13. package/package.json +16 -6
  14. package/scripts/build.ts +7 -3
  15. package/scripts/preview-ui.ts +1 -1
  16. package/src/{client/index.ts → app/client/apply.tsx} +152 -59
  17. package/src/app/client/i18n/DshLanguageBoundary.tsx +42 -0
  18. package/src/app/client/i18n/catalogs/base.ts +231 -0
  19. package/src/app/client/i18n/catalogs/en.ts +258 -0
  20. package/src/app/client/i18n/catalogs/es.ts +279 -0
  21. package/src/app/client/i18n/catalogs/fr.ts +281 -0
  22. package/src/app/client/i18n/catalogs/hi.ts +263 -0
  23. package/src/app/client/i18n/catalogs/index.ts +18 -0
  24. package/src/app/client/i18n/catalogs/pt-BR.ts +270 -0
  25. package/src/app/client/i18n/catalogs/zh.ts +248 -0
  26. package/src/app/client/i18n/index.ts +4 -0
  27. package/src/app/client/i18n/registerDshLocales.ts +43 -0
  28. package/src/app/client/i18n/runtime.tsx +58 -0
  29. package/src/app/client/index.ts +3 -0
  30. package/src/app/client/registerSlots.tsx +30 -0
  31. package/src/app/client/slotDefinitions.ts +32 -0
  32. package/src/app/server/apply.ts +479 -0
  33. package/src/app/server/index.ts +2 -0
  34. package/src/app/server/registerRoutes.ts +11 -0
  35. package/src/modules/conversation/components/ConversationControls.tsx +40 -0
  36. package/src/modules/conversation/components/ConversationStatusBar.tsx +155 -0
  37. package/src/modules/conversation/components/DeliveryModeButton.tsx +43 -0
  38. package/src/modules/conversation/components/MicrophoneButton.tsx +6 -0
  39. package/src/modules/conversation/components/PlaybackControls.tsx +41 -0
  40. package/src/modules/conversation/components/SpeakButton.tsx +30 -0
  41. package/src/modules/conversation/components/Waveform.tsx +68 -0
  42. package/src/modules/conversation/components/conversationStatus.ts +17 -0
  43. package/src/modules/conversation/components/createConversationComponents.tsx +505 -0
  44. package/src/modules/conversation/components/index.ts +8 -0
  45. package/src/modules/conversation/hooks/index.ts +2 -0
  46. package/src/modules/conversation/hooks/useConversationActions.ts +27 -0
  47. package/src/modules/conversation/hooks/useConversationController.ts +15 -0
  48. package/src/modules/conversation/index.ts +3 -0
  49. package/src/{client → modules/conversation/models}/chat.ts +2 -1
  50. package/src/modules/conversation/models/index.ts +1 -0
  51. package/src/{core → modules/core}/coordinator.ts +133 -7
  52. package/src/modules/core/index.ts +6 -0
  53. package/src/{engines/qwen-http-host.ts → modules/core/qwen/QwenHttpHost.ts} +2 -2
  54. package/src/modules/core/qwen/QwenSettings.tsx +148 -0
  55. package/src/{core → modules/core}/settings.ts +23 -0
  56. package/src/modules/recognition/components/RecognitionCapabilityStatus.tsx +19 -0
  57. package/src/{engines/recognition/qwen-http.ts → modules/recognition/engines/qwen/QwenRecognitionEngine.ts} +1 -1
  58. package/src/{engines/recognition/whisper-http.ts → modules/recognition/engines/whisper/WhisperRecognitionEngine.ts} +1 -1
  59. package/src/modules/recognition/engines/whisper/WhisperSettings.tsx +150 -0
  60. package/src/modules/recognition/index.ts +4 -0
  61. package/src/modules/recognition/qwen/QwenRecognitionSettings.tsx +4 -0
  62. package/src/modules/settings/components/LiveVoiceSettings.tsx +72 -0
  63. package/src/modules/settings/components/SettingsHeader.tsx +49 -0
  64. package/src/modules/settings/components/VersionBadges.tsx +39 -0
  65. package/src/modules/settings/components/createLiveVoiceSettings.tsx +8 -0
  66. package/src/modules/settings/components/index.ts +4 -0
  67. package/src/modules/settings/hooks/index.ts +3 -0
  68. package/src/modules/settings/hooks/useAudioDevices.ts +38 -0
  69. package/src/modules/settings/hooks/useLiveVoiceSettings.ts +4 -0
  70. package/src/modules/settings/hooks/useReleaseStatus.ts +17 -0
  71. package/src/modules/settings/index.ts +4 -0
  72. package/src/modules/settings/models/index.ts +1 -0
  73. package/src/modules/settings/models/settingsStorage.ts +14 -0
  74. package/src/modules/settings/sections/conversation/ConversationDelaySettings.tsx +24 -0
  75. package/src/modules/settings/sections/conversation/ConversationSettingsSection.tsx +23 -0
  76. package/src/modules/settings/sections/conversation/DeliverySettings.tsx +38 -0
  77. package/src/modules/settings/sections/conversation/HoldToTalkSettings.tsx +20 -0
  78. package/src/modules/settings/sections/conversation/VoiceModeSettings.tsx +31 -0
  79. package/src/modules/settings/sections/conversation/index.ts +5 -0
  80. package/src/modules/settings/sections/index.ts +3 -0
  81. package/src/modules/settings/sections/recognition/RecognitionEngineSettings.tsx +109 -0
  82. package/src/modules/settings/sections/recognition/RecognitionFilterSettings.tsx +33 -0
  83. package/src/modules/settings/sections/recognition/RecognitionSettingsSection.tsx +20 -0
  84. package/src/modules/settings/sections/recognition/RecognitionStatus.tsx +19 -0
  85. package/src/modules/settings/sections/recognition/SilenceDetectionSettings.tsx +58 -0
  86. package/src/modules/settings/sections/recognition/VoiceCommandSettings.tsx +41 -0
  87. package/src/modules/settings/sections/recognition/index.ts +5 -0
  88. package/src/modules/settings/sections/speak/OutputFilterSettings.tsx +39 -0
  89. package/src/modules/settings/sections/speak/PlaybackPolicySettings.tsx +26 -0
  90. package/src/modules/settings/sections/speak/SpeakSettingsSection.tsx +16 -0
  91. package/src/modules/settings/sections/speak/SpeechAdvancedSettings.tsx +81 -0
  92. package/src/modules/settings/sections/speak/SpeechEngineSettings.tsx +80 -0
  93. package/src/modules/settings/sections/speak/index.ts +4 -0
  94. package/src/modules/speak/engines/audio/HostAudioEngine.ts +167 -0
  95. package/src/modules/speak/engines/audio/M4aAacTranscoder.ts +58 -0
  96. package/src/modules/speak/engines/qwen/QwenSpeakingEngine.ts +14 -0
  97. package/src/{engines/speaking/say.ts → modules/speak/engines/say/SaySpeakingEngine.ts} +26 -4
  98. package/src/modules/speak/index.ts +5 -0
  99. package/src/modules/speak/qwen/QwenSpeakingSettings.tsx +4 -0
  100. package/src/modules/speak/services/speechQueue.ts +2 -0
  101. package/src/server.ts +9 -365
  102. package/src/shared/design-system/buttons/IconButton.tsx +33 -0
  103. package/src/shared/design-system/buttons/PillButton.tsx +11 -0
  104. package/src/shared/design-system/buttons/ToggleButton.tsx +6 -0
  105. package/src/shared/design-system/buttons/index.ts +3 -0
  106. package/src/shared/design-system/feedback/ErrorMessage.tsx +27 -0
  107. package/src/shared/design-system/feedback/StatusBadge.tsx +9 -0
  108. package/src/shared/design-system/feedback/StatusMessage.tsx +4 -0
  109. package/src/shared/design-system/feedback/index.ts +3 -0
  110. package/src/shared/design-system/forms/CheckboxField.tsx +20 -0
  111. package/src/shared/design-system/forms/NumberField.tsx +12 -0
  112. package/src/shared/design-system/forms/SelectField.tsx +20 -0
  113. package/src/shared/design-system/forms/TextAreaField.tsx +12 -0
  114. package/src/shared/design-system/forms/TextField.tsx +12 -0
  115. package/src/shared/design-system/forms/index.ts +5 -0
  116. package/src/shared/design-system/icons/Icon.tsx +20 -0
  117. package/src/shared/design-system/icons/icons.ts +16 -0
  118. package/src/shared/design-system/icons/index.ts +2 -0
  119. package/src/shared/design-system/index.ts +5 -0
  120. package/src/shared/design-system/layout/SettingsCard.tsx +9 -0
  121. package/src/shared/design-system/layout/SettingsSection.tsx +9 -0
  122. package/src/shared/design-system/layout/SettingsSubcard.tsx +14 -0
  123. package/src/shared/design-system/layout/SettingsTabs.tsx +54 -0
  124. package/src/shared/design-system/layout/index.ts +4 -0
  125. package/src/client/components.ts +0 -1189
  126. package/src/client/qwen-settings.ts +0 -144
  127. package/src/client/whisper-settings.ts +0 -147
  128. package/src/engines/speaking/qwen-http.ts +0 -124
  129. /package/src/{core → modules/core}/filters.ts +0 -0
  130. /package/src/{core → modules/core}/microphone.ts +0 -0
  131. /package/src/{core → modules/core}/ownership.ts +0 -0
  132. /package/src/{core → modules/core}/transcript.ts +0 -0
  133. /package/src/{engines/recognition/browser.ts → modules/recognition/engines/browser/BrowserRecognitionEngine.ts} +0 -0
  134. /package/src/{engines/recognition/whisper-http-host.ts → modules/recognition/engines/whisper/whisperRecognitionHost.ts} +0 -0
  135. /package/src/{client → modules/settings/services}/releases.ts +0 -0
  136. /package/src/{engines/speaking/browser.ts → modules/speak/engines/browser/BrowserSpeakingEngine.ts} +0 -0
  137. /package/src/{engines/speaking/say-client.ts → modules/speak/engines/say/sayClient.ts} +0 -0
  138. /package/src/{client/styles.ts → styles/index.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  All notable changes to DSH Live Voice are documented in this file.
4
4
 
5
+ ## [0.3.0] - Unreleased
6
+
7
+ ### Features
8
+
9
+ - Add a configurable, session-scoped Live Voice context for agent responses. During an active voice conversation with automatic spoken responses enabled, the agent receives editable guidance that its user-facing response will be spoken aloud.
10
+ - Add an English Live Voice context editor and Restore default action to Speaking settings; interface labels and help remain localized.
11
+ - Standardize host speech as compact AAC/M4A played in the browser: macOS `say` and Qwen synthesize internally to WAV, the DSH host transcodes it before transport, and up to three upcoming segments are synthesized ahead to reduce gaps.
12
+ - Add a configurable pause between consecutive spoken segments, with a 400 ms default for more natural pacing.
13
+ - Add a Next speech control that skips only the current spoken segment, immediately starts the next queued segment, and keeps queued and incoming streaming speech intact.
14
+
15
+ ### Bug Fixes
16
+
17
+ - Preserve spaces and in-progress edits in text settings until the field loses focus, then normalize and save the value.
18
+ - Make automatic Steer delivery use DSH's Ctrl/Cmd+Enter accelerated composer gesture instead of the public normal-submit action, so messages are sent to the running agent rather than silently added to its queue. Add a lifecycle regression for the gesture.
19
+ - Deduplicate voice-context synchronization so the PUT request fires only when the payload actually changes, instead of on every coordinator state update.
20
+ - Prevent automatic assistant speech in speaker mode from overtaking the user's turn. Playback now waits for all pending backend transcriptions to finish and for the automatic-send countdown and delivery attempt to complete, avoiding canceled recognition, discarded transcripts, and interrupted automatic delivery.
21
+
5
22
  ## [0.2.3] - 2026-09-21
6
23
 
7
24
  ### Features
@@ -125,7 +142,8 @@ This release expands conversation control, audio routing, speech filtering, and
125
142
  - Support browser speech synthesis and native macOS `say` output.
126
143
  - Add Live Voice controls, Whisper settings, build and browser-preview scripts, and an initial test suite.
127
144
 
128
- [0.2.3]: https://github.com/victorwads/dsh-live-voice/compare/v0.2.2...HEAD
145
+ [0.3.0]: https://github.com/victorwads/dsh-live-voice/compare/v0.2.3...HEAD
146
+ [0.2.3]: https://github.com/victorwads/dsh-live-voice/compare/v0.2.2...v0.2.3
129
147
  [0.2.2]: https://github.com/victorwads/dsh-live-voice/compare/v0.2.1...v0.2.2
130
148
  [0.2.1]: https://github.com/victorwads/dsh-live-voice/compare/v0.2.0...v0.2.1
131
149
  [0.2.0]: https://github.com/victorwads/dsh-live-voice/compare/v0.1.0...v0.2.0
package/DEVELOPMENT.md CHANGED
@@ -9,6 +9,19 @@ npm run build
9
9
 
10
10
  Implementation, test, and build-script source is TypeScript (`.ts`). `npm run typecheck` compiles the TypeScript project; `npm test` typechecks, builds the browser and host bundles, transpiles the TypeScript tests, then runs them. Tests exercise engines, coordination, transcript edits, RPC, configuration, and UI contracts, but do not record the microphone. `npm run dev` watches the browser and host bundles only; it is not a replacement DSH server.
11
11
 
12
+ ## Component previews
13
+
14
+ [Preview.js](https://previewjs.com/docs/guides/react) runs the plugin UI in isolation from DSH. Install dependencies and start the local preview workspace:
15
+
16
+ ```sh
17
+ npm ci
18
+ npm run preview
19
+ ```
20
+
21
+ The Preview.js component list includes `VoiceBarPreview` and `SettingsScreenPreview` from `__previewjs__/LiveVoicePreviews.tsx`. The voice-bar preview accepts the scenarios `listening`, `processing`, `speaking`, `paused`, and `queued`; its controls update an in-memory controller only. The settings preview uses the same mock controller and the real translation provider. The shared wrapper injects the production plugin CSS plus a small set of DSH-like theme tokens. It never starts microphone capture, speech recognition, speech synthesis, or a DSH server.
22
+
23
+ Preview-only state belongs under `__previewjs__/`; production components must not import it. The next planned preview target is a DevInfo screen that subscribes to the controller snapshot and displays state-machine transitions in real time.
24
+
12
25
  ## Qwen3 HTTP engine contract
13
26
 
14
27
  The plugin can connect to a separately managed Qwen3 speech service on an unauthenticated loopback HTTP base URL. The service lifecycle and weights are deliberately outside this repository. It must expose `GET /health`, `POST /v1/audio/transcriptions`, and `POST /v1/audio/speech`. Standard OpenAI multipart transcription and OminiX-API's JSON/base64 transcription contract are detected automatically. Host configuration is stored at `~/.dsh/dsh-live-voice-qwen.json` with owner-only permissions and rejects non-loopback URLs.