dsh-live-voice 0.0.1-developing → 0.1.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.
- package/DEVELOPMENT.md +70 -0
- package/HISTORY.md +10 -85
- package/PLAN.md +244 -0
- package/README.md +88 -96
- package/cordis.patch.yml +3 -0
- package/lib/client.js +3015 -0
- package/lib/server.js +1006 -0
- package/package.json +69 -6
- package/scripts/build.ts +50 -0
- package/scripts/check-dist.mjs +38 -0
- package/scripts/preview-ui.ts +31 -0
- package/scripts/probe-browser.ts +46 -0
- package/src/client/chat.ts +40 -0
- package/src/client/components.ts +778 -0
- package/src/client/index.ts +430 -0
- package/src/client/qwen-settings.ts +144 -0
- package/src/client/styles.ts +36 -0
- package/src/client/whisper-settings.ts +147 -0
- package/src/core/coordinator.ts +564 -0
- package/src/core/microphone.ts +171 -0
- package/src/core/ownership.ts +31 -0
- package/src/core/settings.ts +113 -0
- package/src/core/transcript.ts +48 -0
- package/src/engines/qwen-http-host.ts +240 -0
- package/src/engines/recognition/browser.ts +314 -0
- package/src/engines/recognition/qwen-http.ts +36 -0
- package/src/engines/recognition/whisper-http-host.ts +210 -0
- package/src/engines/recognition/whisper-http.ts +191 -0
- package/src/engines/speaking/browser.ts +136 -0
- package/src/engines/speaking/qwen-http.ts +119 -0
- package/src/engines/speaking/say-client.ts +96 -0
- package/src/engines/speaking/say.ts +271 -0
- package/src/server.ts +365 -0
- package/AGENTS.md +0 -52
package/README.md
CHANGED
|
@@ -1,119 +1,111 @@
|
|
|
1
1
|
# DSH Live Voice
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/dsh-live-voice)
|
|
4
|
+
[](https://dsh.pub/en/plugins/dsh-live-voice/)
|
|
5
|
+
[](LICENSE)
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
**Local-first speech recognition, voice output, and continuous voice conversations for DSH.**
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
DSH Live Voice coordinates the microphone, composer, assistant messages, and speech output in one plugin — without letting listening and speaking compete with each other.
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
## Install
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
Install the public repository through dsh.pub into your DSH web profile:
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
DSH Live Voice aims to own the conversational state of both directions. The experience should approach a natural conversation: listen, speak, yield, pause, and resume when appropriate. It does not promise human-level timing or perfect echo suppression.
|
|
18
|
-
|
|
19
|
-
## Acknowledgments
|
|
20
|
-
|
|
21
|
-
A heartfelt thank you to [GooDAnDReaDY](https://github.com/GooDAnDReaDY), creator of [dsh-voice](https://github.com/GooDAnDReaDY/dsh-voice), and [Alan2Z](https://github.com/Alan2Z), creator of [dsh-speak](https://github.com/Alan2Z/dsh-speak).
|
|
22
|
-
|
|
23
|
-
Your projects solved my voice needs in DSH for a long time, and I am genuinely grateful for the work you shared. I forked both repositories, built my own versions, and adapted behaviors that mattered to my workflow. Those projects were useful in their own right and helped me understand what I needed next.
|
|
24
|
-
|
|
25
|
-
Eventually, I reached a point where I needed one codebase to coordinate both listening and speaking. In my setup, the independent plugins could overlap or interfere with each other because they did not share a conversation coordinator. That is why I am starting DSH Live Voice from scratch—not because their work lacked value, but because my next step requires a unified approach.
|
|
26
|
-
|
|
27
|
-
My goal is a user-focused voice experience: less mandatory configuration, sensible defaults, and a simple way to switch speech recognition and speech synthesis engines without having to understand the internals. These are goals for this new project, not claims about features already available.
|
|
28
|
-
|
|
29
|
-
If you only need one side of the experience—voice input or spoken output—please explore and support their projects. They may be exactly what you need. Thank you both for making DSH more useful to me and for sharing your work with the community.
|
|
30
|
-
|
|
31
|
-
## Local-first, provider-optional
|
|
32
|
-
|
|
33
|
-
- Prioritize local speech recognition and local speech synthesis.
|
|
34
|
-
- Keep external speech providers optional, with explicit configuration.
|
|
35
|
-
- Explain which capabilities, models, dependencies, and permissions are required by each available option.
|
|
36
|
-
- Make capture, recognition, and external audio transmission states visible.
|
|
37
|
-
- Do not equate local voice processing with a fully offline assistant: the DSH language model may still use a remote service.
|
|
38
|
-
|
|
39
|
-
Specific engines, supported operating systems, hardware requirements, and installation steps have not been selected or verified yet. Local execution is the product priority, not a claim that the current package runs everywhere.
|
|
40
|
-
|
|
41
|
-
## Planned conversation experience
|
|
42
|
-
|
|
43
|
-
### Speaker mode
|
|
44
|
-
|
|
45
|
-
While the assistant is speaking, microphone audio should not enter speech recognition, to reduce feedback from speaker output. A user-triggered shortcut should stop or pause playback and let the user speak. Whether capture stays active while recognition is gated remains a technical decision; the UI must distinguish those states.
|
|
46
|
-
|
|
47
|
-
### Headphone mode
|
|
48
|
-
|
|
49
|
-
The microphone may remain available during assistant playback. Detecting user speech should pause the assistant. Voice activity detection can respond faster, while recognized words provide stronger evidence with additional latency. The exact interruption policy is not decided yet.
|
|
50
|
-
|
|
51
|
-
Users should be able to choose the conversation mode explicitly. A detected output device alone is not reliable evidence of acoustic isolation.
|
|
52
|
-
|
|
53
|
-
### Pause, resume, and cancel
|
|
54
|
-
|
|
55
|
-
These are separate operations:
|
|
56
|
-
|
|
57
|
-
- **Pause:** suspend playback while preserving the remaining content and playback position where supported.
|
|
58
|
-
- **Resume:** continue preserved speech when it is still relevant.
|
|
59
|
-
- **Cancel:** discard obsolete speech so it cannot play later.
|
|
60
|
-
|
|
61
|
-
A brief interruption may mean “wait, then continue” or may introduce a new request. Silence alone must not force an old answer to resume. How users signal these intentions remains an open design question. Exact resume may require plugin-owned audio buffering and is not guaranteed by every TTS engine.
|
|
62
|
-
|
|
63
|
-
### Speaking during response streaming
|
|
64
|
-
|
|
65
|
-
The user should be able to speak while DSH is still streaming a response. Text generation, speech synthesis, audio playback, and microphone recognition must be coordinated but tracked separately. Pausing playback need not stop text generation. Sending a new request or stopping generation depends on the actual DSH integration APIs.
|
|
66
|
-
|
|
67
|
-
A future speech queue should synthesize suitable text segments in order and prevent delayed audio from canceled answers from playing.
|
|
68
|
-
|
|
69
|
-
## Environment and capabilities
|
|
70
|
-
|
|
71
|
-
The planned interface should explain available options based on capabilities, not only an operating-system label. Relevant checks include microphone permission, audio devices, local engine availability, playback controls, and shortcut scope.
|
|
72
|
-
|
|
73
|
-
The DSH host and the browser may run on different machines. Detection must distinguish the host environment from the machine with the microphone and speakers. Global shortcuts and browser-focused shortcuts must not be presented as equivalent.
|
|
15
|
+
```sh
|
|
16
|
+
npx dshpub add victorwads/dsh-live-voice --profile web
|
|
17
|
+
```
|
|
74
18
|
|
|
75
|
-
|
|
19
|
+
The installer resolves the public repository to an exact commit before adding the bundle. Open **DSH Settings → Live Voice** after the next normal DSH startup.
|
|
20
|
+
|
|
21
|
+
## Why this project exists and Acknowledgments
|
|
22
|
+
|
|
23
|
+
Listening and speaking should work together, so you can interrupt and be heard without the assistant’s voice getting in the way. [Read the story behind the project](HISTORY.md).
|
|
24
|
+
|
|
25
|
+
A heartfelt thank you to [GooDAnDReaDY](https://github.com/GooDAnDReaDY) for [dsh-voice](https://github.com/GooDAnDReaDY/dsh-voice) and [Alan2Z](https://github.com/Alan2Z) for [dsh-speak](https://github.com/Alan2Z/dsh-speak). Your projects solved my voice needs in DSH for a while, and I am grateful for the work you shared. Eventually, I reached a point where I needed one codebase to coordinate both listening and speaking. [Read the full story](HISTORY.md).
|
|
26
|
+
|
|
27
|
+
## Features
|
|
28
|
+
|
|
29
|
+
| | Capability |
|
|
30
|
+
|---|---|
|
|
31
|
+
| 🎙️ | Voice typing directly into the DSH composer |
|
|
32
|
+
| 💬 | Continuous voice conversations with automatic assistant speech |
|
|
33
|
+
| 🧠 | Browser SpeechRecognition, local loopback whisper.cpp, or Qwen3-ASR on Apple MLX |
|
|
34
|
+
| 🔊 | Browser speech synthesis, native macOS `say`, or Qwen3-TTS on Apple MLX |
|
|
35
|
+
| ⏱️ | Manual or automatic sending after configurable silence |
|
|
36
|
+
| 🫁 | Stable-silence delay prevents breathing pauses from starting assistant speech |
|
|
37
|
+
| 🎧 | Open-microphone mode for headphones |
|
|
38
|
+
| 🔒 | Gated microphone mode for speakers |
|
|
39
|
+
| ✋ | Pause, resume, stop, and manual interruption controls |
|
|
40
|
+
| 🔈 | Play individual assistant messages on demand |
|
|
41
|
+
| 🏠 | Whisper audio reaches the local server only through the authenticated DSH host |
|
|
42
|
+
|
|
43
|
+
## Conversation flow
|
|
44
|
+
|
|
45
|
+
The assistant never starts automatic playback while you are speaking. If a response is already waiting — including another assistant message — it waits until you finish and the configured continuous-silence delay has passed.
|
|
46
|
+
|
|
47
|
+
### Speakers — gated listening (default)
|
|
48
|
+
|
|
49
|
+
Listening and playback take turns so the assistant does not hear its own voice.
|
|
50
|
+
|
|
51
|
+
```mermaid
|
|
52
|
+
sequenceDiagram
|
|
53
|
+
participant Interface
|
|
54
|
+
actor Você
|
|
55
|
+
actor Assistente
|
|
56
|
+
|
|
57
|
+
Note over Interface,Assistente: Aguardando você falar…
|
|
58
|
+
activate Você
|
|
59
|
+
Você->>Assistente: Começa a falar
|
|
60
|
+
Assistente-->>Você: Escuta enquanto você fala
|
|
61
|
+
Note over Interface,Assistente: Você parou de falar
|
|
62
|
+
opt Envio manual
|
|
63
|
+
Você->>Interface: Revisa a mensagem reconhecida
|
|
64
|
+
Interface-->>Você: Envia quando estiver pronto
|
|
65
|
+
end
|
|
66
|
+
opt Envio automático
|
|
67
|
+
Note over Você,Assistente: Envia após a contagem de silêncio
|
|
68
|
+
end
|
|
69
|
+
deactivate Você
|
|
70
|
+
Você->>Assistente: Entrega sua mensagem
|
|
71
|
+
Assistente-->>Você: Resposta pronta — aguarda silêncio contínuo
|
|
72
|
+
Assistente-->>Você: Para de escutar
|
|
73
|
+
activate Assistente
|
|
74
|
+
Assistente->>Você: Fala a resposta em voz alta
|
|
75
|
+
deactivate Assistente
|
|
76
|
+
Note over Interface,Assistente: Escutando novamente — aguardando você falar…
|
|
77
|
+
```
|
|
76
78
|
|
|
77
|
-
|
|
79
|
+
### Headphones — open microphone
|
|
78
80
|
|
|
79
|
-
|
|
80
|
-
| --- | --- |
|
|
81
|
-
| Environment and capabilities | Detect available features and explain limitations. |
|
|
82
|
-
| Conversation coordinator | Manage turns, interruptions, pause, resume, and cancellation. |
|
|
83
|
-
| Voice input | Capture audio, detect speech, and integrate STT engines. |
|
|
84
|
-
| Voice output | Integrate TTS engines and manage buffering, queues, and playback. |
|
|
85
|
-
| DSH integration | Connect messages, response streaming, and session lifecycle. |
|
|
86
|
-
| Interface and controls | Expose modes, devices, permissions, state, and shortcuts. |
|
|
81
|
+
The microphone remains open during playback, allowing your voice to pause the assistant.
|
|
87
82
|
|
|
88
|
-
Input, output, and generation need separate states because listening and speaking may overlap. One plugin may support multiple engines. Reusing existing DSH plugins versus integrating engines directly requires inspection of the actual extension APIs first.
|
|
89
83
|
|
|
90
|
-
|
|
84
|
+
### Other conversation settings
|
|
91
85
|
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
86
|
+
- **Sending mode:** review and send manually by default, or send automatically after a configurable silence countdown.
|
|
87
|
+
- **Assistant response delay:** choose how long you must remain silent before automatic playback starts; speaking again restarts the wait.
|
|
88
|
+
- **Automatic assistant speech:** turn automatic playback of new assistant messages on or off.
|
|
89
|
+
- **Sent-message interruption:** sending another message does not stop current audio by default, but you can enable that behavior.
|
|
90
|
+
- **Manual playback:** play any individual assistant message on demand without waiting for the automatic-playback delay.
|
|
96
91
|
|
|
97
|
-
##
|
|
92
|
+
## Local-first architecture
|
|
98
93
|
|
|
99
|
-
|
|
94
|
+
- **Recognition:** Browser SpeechRecognition, loopback whisper.cpp HTTP, or Qwen3-ASR through a host-local Apple MLX server.
|
|
95
|
+
- **Speech output:** browser/device audio, native macOS `say`, or host-local Qwen3-TTS with WAV playback in the browser.
|
|
96
|
+
- **Whisper transport:** complete WAV utterances through authenticated same-origin DSH routes.
|
|
97
|
+
- **Privacy:** raw audio and transcripts are not logged by default.
|
|
100
98
|
|
|
101
|
-
|
|
99
|
+
Speech processing can run locally, but the DSH language model may still be remote.
|
|
102
100
|
|
|
103
|
-
|
|
104
|
-
npm publish --dry-run --tag developing
|
|
105
|
-
```
|
|
101
|
+
## Qwen3 HTTP engine
|
|
106
102
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
## Keywords
|
|
110
|
-
|
|
111
|
-
`dsh`, `local-first`, `local-voice`, `voice-conversation`, `speech-to-text`, `text-to-speech`, `speech-recognition`, `speech-synthesis`, `stt`, `tts`, `turn-taking`, `voice-interruption`
|
|
103
|
+
When a compatible Qwen3 speech API is already running on the DSH host, choose **Qwen3 ASR — local MLX server** under Speech recognition and **Qwen3 TTS — local MLX server** under Speech output. Configure its base URL in **DSH Settings → Live Voice**. The Qwen server may use any HTTP or HTTPS base URL reachable from the DSH host. The plugin supports the OminiX-API contract and standard OpenAI-style speech endpoints at `GET /health`, `POST /v1/audio/transcriptions`, and `POST /v1/audio/speech`; it does not install, start, stop, or manage that external service or its model weights.
|
|
112
104
|
|
|
113
105
|
## License
|
|
114
106
|
|
|
115
|
-
|
|
107
|
+
[GPL-3.0-only](LICENSE). Commercial use and redistribution are allowed subject to the GPL. Third-party speech engines and models may have separate licenses.
|
|
116
108
|
|
|
117
|
-
|
|
109
|
+
## Keywords
|
|
118
110
|
|
|
119
|
-
|
|
111
|
+
`dsh`, `dsh-plugin`, `deepseek-harness`, `local-first`, `local-voice`, `voice-assistant`, `voice-conversation`, `continuous-conversation`, `voice-dictation`, `speech-to-text`, `text-to-speech`, `speech-recognition`, `speech-synthesis`, `stt`, `tts`, `whisper`, `whisper-cpp`, `web-speech-api`, `macos-say`, `turn-taking`, `voice-interruption`, `silence-detection`
|
package/cordis.patch.yml
ADDED