dsh-voice-mode 0.7.27 → 0.7.29
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/README.en.md +19 -14
- package/README.md +21 -16
- package/THIRD_PARTY_NOTICES.md +2 -2
- package/lib/client.js +948 -102
- package/lib/index.js +659 -214
- package/lib/msedge-tts.cjs +11 -5
- package/package.json +4 -3
package/README.en.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](./LICENSE)
|
|
4
4
|
[](https://github.com/qishuilalala/dsh-voice-mode/releases)
|
|
5
5
|
[](https://www.npmjs.com/package/dsh-voice-mode)
|
|
6
|
-
[](https://github.com/qishuilalala/dsh-voice-mode/blob/main/docs/rules/STATE.md)
|
|
7
7
|
|
|
8
8
|
Full-duplex voice conversation mode for DeepSeek Harness (dsh): speak, get a
|
|
9
9
|
spoken answer. Streamed zipformer2 ASR → editable draft → auto send → the
|
|
@@ -16,7 +16,7 @@ interrupts playback and the running turn. No API key.
|
|
|
16
16
|
|
|
17
17
|

|
|
18
18
|
|
|
19
|
-
> **Latest releases**: **v0.7.
|
|
19
|
+
> **Latest releases**: **v0.7.29** — adversarial-verification fix batch: long utterances no longer dropped, long read-aloud no longer cut by idle exit, Edge TTS no longer skips sentences containing `&`/`<`, Kokoro works offline, stalled downloads switch mirrors, tap again while connecting to cancel, screen readers no longer flooded by the status bar (20 fixes); **v0.7.28** — `Alt/Option+Enter` inside the composer toggles voice mode, a "Shortcuts" settings group with click-to-record, settings that apply immediately, hold-to-talk that starts from idle and exits after the reply, the mic button no longer steals composer focus, better read-aloud chunking for long text (PR #17 by @dyguests). Full history in the [CHANGELOG](https://github.com/qishuilalala/dsh-voice-mode/blob/main/CHANGELOG.md).
|
|
20
20
|
>
|
|
21
21
|
> **Runtime changes (v0.7.18 – v0.7.24)**: (1) **Settings work on every dsh version** — fixed the settings page and persistence on dsh 0.1.7+ (Settings → Voice Mode page, writes survive restarts); (2) **i18n rebuilt** — the UI follows dsh's official language setting, zh/en fully consistent, switching needs no refresh; (3) **fixed fresh npm/pnpm installs and the dsh ≥0.1.7 installed-form "failed to import"** (0.7.17 and earlier are affected — upgrade to ≥0.7.18); (4) **local Kokoro fixed under the official desktop (Electron) app** — needs Node.js ≥18 on PATH (or set `DSHVM_NODE`); (5) **v0.7.24: Edge cloud read-aloud restored** — since 2026-10-15 Microsoft's service rejects the old handshake (v0.7.23 and earlier are silent on the default Edge engine; local VITS / Kokoro are unaffected), so the inlined msedge-tts is bumped to 2.1.0; when read-aloud **fails several sentences in a row** the plugin now suggests switching to a local engine; plus host hardening (`/models/retry` is same-origin POST only, model-tree path checks, raw error strings no longer sent downstream). Compatible with dsh up to 0.2.1-rc.2 (from 0.2.1-alpha.4/5 the Settings entry moved into the "Account menu" popover at the bottom of the sidebar; both of this plugin's entry points still work).
|
|
22
22
|
|
|
@@ -37,10 +37,10 @@ interrupts playback and the running turn. No API key.
|
|
|
37
37
|
|
|
38
38
|
## ✨ Features
|
|
39
39
|
|
|
40
|
-
- **Voice mode**: toggle with the microphone button in the input toolbar or the global shortcut `Ctrl+Shift+V`; globally single-active (only one session is in voice mode at a time; switching sessions yields automatically)
|
|
40
|
+
- **Voice mode**: toggle with the microphone button in the input toolbar or the global shortcut `Ctrl+Shift+V`; with the caret in the composer, `Alt+Enter` (`Option+Enter` on Mac) toggles it too, without inserting a newline; globally single-active (only one session is in voice mode at a time; switching sessions yields automatically)
|
|
41
41
|
- **Three interaction modes (switchable in settings or by right-clicking the mic)**:
|
|
42
42
|
- `toggle` (default) continuous listening: RMS VAD segmentation → streaming zipformer2 ASR (words appear as you speak, live caption preview) → automatic sentence split after 1500 ms of silence into the draft, consecutive segments joined into one message, then auto-sent after ~1.2 s more of silence (≈2.7 s total); hold `Ctrl` to force an immediate send
|
|
43
|
-
- `hold` push-to-talk:
|
|
43
|
+
- `hold` push-to-talk: from idle, **just hold the mic button to start recording and release to send** (no need to tap in first; a short tap still enters/exits); after sending, voice mode exits on its own once the reply finishes (read aloud, if on); with auto-send off, releasing only leaves the text in the composer (not sent) and exits; if you hold without speaking it exits after ~25 s; (swipe up to cancel, `Esc`/blur abandons the segment; pauses do not split while held, up to 10 min); hold `Ctrl` to record-by-keyboard, release to send
|
|
44
44
|
- `once` one-shot: talk like `toggle`; after sending, the mic turns off and voice mode exits once the reply has been read aloud (with auto-send off: exits after the utterance, text stays in the draft)
|
|
45
45
|
- **Read-aloud scope** (`readAloud`): `voice` (default) only replies in voice mode; `always` every reply in the visible session, typed ones included (with the session open in several tabs, only the last-viewed tab plays); `off` never
|
|
46
46
|
- **The mic button is the status panel** (PR #16 by [@dyguests](https://github.com/dyguests)): green bars follow your voice while listening, blue bars follow playback while reading, a spinner while `once` waits for the reply, a check mark before it exits; orange dot = speech detected, red dot = error (hover for details). Right-click (or the keyboard menu key) for quick settings; touch long-press stays push-to-talk. Turn off the status bar and captions to keep all voice UI on the button
|
|
@@ -61,10 +61,11 @@ interrupts playback and the running turn. No API key.
|
|
|
61
61
|
|
|
62
62
|
| Gesture | Behaviour |
|
|
63
63
|
| --- | --- |
|
|
64
|
-
| Click the mic button / `Ctrl+Shift+V` | Enter / exit voice mode |
|
|
64
|
+
| Click the mic button / `Ctrl+Shift+V` | Enter / exit voice mode (clicking the button does not steal composer focus; while waiting for a reply or reading, one click stops reading and exits completely) |
|
|
65
|
+
| `Alt+Enter` (`Option+Enter` on Mac) in the composer | Toggle voice mode with the caret in the input, no newline inserted; holding the key does not re-toggle; the settings card's own inputs are not intercepted; `Cmd/Ctrl+Enter` is left alone (the host uses it to send) |
|
|
65
66
|
| Just speak, pause ~1500 ms (toggle) | Accumulate into draft, auto-send after ~2.7 s of quiet |
|
|
66
67
|
| Hold `Ctrl` (toggle, ≥250 ms speech) | Force-send the current segment immediately |
|
|
67
|
-
| **Hold the mic button (hold)** |
|
|
68
|
+
| **Hold the mic button (hold)** | From idle, hold to start recording right away, release to send and exit after the reply ends; swipe up / `Esc` / blur abandons the segment; <250 ms tap enters/exits; right-click only opens the quick menu |
|
|
68
69
|
| Hold `Ctrl` (hold, ≥600 ms) | Keyboard push-to-talk, release to send |
|
|
69
70
|
| Speak the wake word first (if configured) | Activate from standby into listening (then recognition and sending begin) |
|
|
70
71
|
| Speak while AI is reading | Interrupt playback and cancel the running turn |
|
|
@@ -145,7 +146,8 @@ If a wake word is configured, you land in standby first (the status bar prompts
|
|
|
145
146
|
| `showStatusBar` | `true` | Voice status bar above the composer; when off, status lives on the mic button (timer below it, notices beside it) |
|
|
146
147
|
| `showCaptions` | `true` | Floating caption while reading aloud |
|
|
147
148
|
| `autoResume` | `false` | Auto-restore voice mode when switching back to your last voice session (off by default). When on: the next time you enter that session it auto-enters voice mode and restores it; when off, press `Ctrl+Shift+V` manually |
|
|
148
|
-
| `shortcut` | `Ctrl+Shift+V` | Shortcut to enter / exit voice mode (modifiers Ctrl/Shift/Alt/Meta + one letter key); **empty = disabled**, use the mic button instead |
|
|
149
|
+
| `shortcut` | `Ctrl+Shift+V` | Shortcut to enter / exit voice mode (modifiers Ctrl/Shift/Alt/Meta + one letter / digit / Enter / Space / Tab). In the "Shortcuts" group of the settings page, click "Record" and press the combo (`Esc` cancels, `Backspace` clears; a missing modifier or an unsupported key such as arrows / F-keys is flagged); **empty = disabled**, use the mic button instead; **applies immediately** |
|
|
150
|
+
| `composerShortcut` | `Alt+Enter` | Shortcut that toggles voice mode while the caret is in the composer (Option+Enter on Mac), no newline inserted; same format and recording as `shortcut`; **empty = disabled**; the settings card's own inputs are not intercepted; `Cmd/Ctrl+Enter` is not used; **applies immediately**. "Restore defaults" resets both shortcuts to `Ctrl+Shift+V` and `Alt+Enter` |
|
|
149
151
|
| `wakeWord` | empty (off) | Wake word (e.g. `你好小D`): speak it after entering to activate; empty = off. **May be said together with your command** — the wake word is stripped and never sent; fault-tolerant matching (edit distance ≤1 + a 3-char leading window absorbs homophones/fillers); **3-4 characters recommended** (single-char words get no tolerance; a 2-char word also absorbs any same-first-char 2-char word); must be repeated after each utterance split or barge-in; **toggle mode only**; not triggered while the agent is reading |
|
|
150
152
|
| `spokenFormat` | `true` | Spoken-format system prompt: inject "short natural sentences, no Markdown decoration" into voice-mode replies only, **applies live** |
|
|
151
153
|
| `senseVoice` | `true` | Re-transcribe the finalized utterance with SenseVoice (punctuation + number normalization, more accurate; on by default). **Turning it off saves ~228 MB of models** and uses streaming recognition only (faster, less accurate) |
|
|
@@ -155,10 +157,10 @@ If a wake word is configured, you land in standby first (the status bar prompts
|
|
|
155
157
|
| `captionMaxWidth` | `1` | Caption width tier 0=50vw / 1=70vw / 2=90vw |
|
|
156
158
|
| `backchannelYield` | `true` | Yield semantics (ADR-0008); saying `嗯 / 对` while reading auto-pauses for 1.5 s; genuine speech still triggers hard barge-in; off = behavior identical to pre-change |
|
|
157
159
|
| `bargeInSalvage` | `true` | Barge-in salvage (Issue #15 batch 1 / ADR-0012): when you speak to interrupt while the agent is reading aloud, keep what you said from speech onset to break confirmation and merge it into recognition (fixes swallowed break-in speech; off = discard pre-break audio; recommended off only on speakers without echo cancellation) |
|
|
158
|
-
| `llmCorrect` | `false` | LLM correction (Issue #15 batch 4, off by default): before sending, run one LLM pass over the whole transcribed text (typos/homophones/punctuation only, meaning preserved; reuses the host configured model). On = about one extra second per message; falls back to the original text if correction fails |
|
|
160
|
+
| `llmCorrect` | `false` | LLM correction (Issue #15 batch 4, off by default): before sending, run one LLM pass over the whole transcribed text (typos/homophones/punctuation only, meaning preserved; reuses the host configured model). On = about one extra second per message; falls back to the original text if correction fails or the model answers you instead of correcting |
|
|
159
161
|
| `yieldMs` | `1500` | Yield-window length (ms, 500-3000): how long TTS frames are dropped after `backchannelYield` triggers; if you really want to speak in the window the normal `hardBreak` takes over, and playback resumes when the window ends |
|
|
160
162
|
|
|
161
|
-
Effect timing, in four tiers: ① immediately — engine / voice / rate / spoken format (applies to later replies) / model mirror (next download attempt); ② next recognition — finalization re-transcription (SenseVoice) / ITN; ③ next utterance — silence threshold (endpoint; the send wait stays a fixed 1.2 s); ④ next time you enter voice mode — interrupt sensitivity / barge-in mode / echo gate /
|
|
163
|
+
Effect timing, in four tiers: ① immediately — shortcut / composer shortcut / interaction mode / read-aloud scope / auto-send / captions / status bar / engine / voice / rate / spoken format (applies to later replies) / model mirror (next download attempt); ② next recognition — finalization re-transcription (SenseVoice) / ITN; ③ next utterance — silence threshold (endpoint; the send wait stays a fixed 1.2 s); ④ next time you enter voice mode — interrupt sensitivity / barge-in mode / echo gate / auto-resume / wake word / tool beep / caption font / caption width / backchannel yielding / yield window / barge-in salvage / LLM correction / idle timeout. Saved-but-not-yet-effective items are listed at the top of the settings card with their current effective values. Defaults come from the plugin config (`base` layer) — they follow the config unless explicitly changed.
|
|
162
164
|
|
|
163
165
|
### Common voices (full list: `node scripts/list-voices.mjs`)
|
|
164
166
|
|
|
@@ -232,7 +234,9 @@ You can also edit the `voice-mode:` section of `~/.dsh/settings.yaml` directly (
|
|
|
232
234
|
- **Windows**: `%LOCALAPPDATA%\dsh-voice-mode\models`
|
|
233
235
|
- **macOS / Linux**: `~/.cache/dsh-voice-mode/models`
|
|
234
236
|
- both overridable via `cacheDir`
|
|
235
|
-
- Downloads use `.part` resume; `huggingface.co` falls back to `hf-mirror.com` on failure (configurable via `modelHost`)
|
|
237
|
+
- Downloads use `.part` resume (single-file models only); `huggingface.co` falls back to `hf-mirror.com` on failure (configurable via `modelHost`)
|
|
238
|
+
- A 120 s idle watchdog guards downloads: any received bytes reset it, a stalled upstream is aborted and the next source tried, and closing the panel aborts in-flight downloads
|
|
239
|
+
- Main model files are SHA256-pinned; within one process a file whose size+inode+ctime is unchanged is not re-verified (the cache is in memory only, so the first run after a restart verifies in full); the Kokoro espeak-ng-data tree is judged complete by manifest file sizes / file count, and once first downloaded Kokoro works fully offline
|
|
236
240
|
|
|
237
241
|
---
|
|
238
242
|
|
|
@@ -316,7 +320,7 @@ Also: the on-device recording fixture used for debugging is **off by default**;
|
|
|
316
320
|
|
|
317
321
|
### Compatibility declaration (what the plugin market's version filter reads)
|
|
318
322
|
|
|
319
|
-
`package.json` declares `engines.dsh = ">=0.1.1-rc.2 <0.3.0"` (the market uses it for "filter by host version"; from dsh 0.2.1-alpha.4 the next/alpha channels enforce `engines.dsh` alone as a hard check and refuse to load a plugin outside the range, so the upper bound is capped at 0.3.0 — an unverified new major is cleanly refused instead of silently broken). Verified range: **0.1.1-rc.2 → 0.2.1-rc.2** (including an Electron host equivalent to the official desktop app). A weekly CI check watches upstream releases and opens an issue for any uncovered version. `peerDependencies` only lists `@deepseek-ai/cordis` and `react` (provided by the host).
|
|
323
|
+
`package.json` declares `engines.dsh = ">=0.1.1-rc.2 <0.3.0-0"` (the market uses it for "filter by host version"; from dsh 0.2.1-alpha.4 the next/alpha channels enforce `engines.dsh` alone as a hard check and refuse to load a plugin outside the range, so the upper bound is capped at 0.3.0 (written `<0.3.0-0` so 0.3.0 alpha/rc prereleases are excluded too) — an unverified new major is cleanly refused instead of silently broken). Verified range: **0.1.1-rc.2 → 0.2.1-rc.2** (including an Electron host equivalent to the official desktop app). A weekly CI check watches upstream releases and opens an issue for any uncovered version. `peerDependencies` only lists `@deepseek-ai/cordis` and `react` (provided by the host).
|
|
320
324
|
|
|
321
325
|
## 🚧 Known limitations
|
|
322
326
|
|
|
@@ -327,7 +331,7 @@ Also: the on-device recording fixture used for debugging is **off by default**;
|
|
|
327
331
|
- **The wake word is a lightweight implementation** (text matching on the streaming transcript, not a dedicated KWS engine): it may lag or misfire in noisy environments; the wake word itself never enters the chat (the buffer is dropped on hit)
|
|
328
332
|
- In hold mode, switching windows/tabs while holding **abandons the segment** (prevents continuous recording); come back and hold again
|
|
329
333
|
- The hero (new-session empty state) has no voice entry: voice mode is a session-level feature; enter a session first and use the mic button in the input toolbar
|
|
330
|
-
-
|
|
334
|
+
- Entering/exiting voice mode, reading/writing settings and preview all rely on `AbortSignal.timeout` (Chrome 103+ / Firefox 100+ / Safari 16+); on older browsers these actions immediately show a failure hint — an expected degradation
|
|
331
335
|
- **Cloud read-aloud (Edge) depends on a Microsoft online service**: the server side may change its handshake or limits at any time (it did on 2026-10-15 — see CHANGELOG 0.7.24). If several sentences in a row fail, the status bar/toast suggests switching to local VITS / Kokoro, which the settings panel does in one click
|
|
332
336
|
- `spokenFormat` is injected through the official `system-prompt/assemble` waterfall; if the current session uses a **complete prompt** (persona `complete: true` agent preset) it is not injected (the official `complete` contract wins)
|
|
333
337
|
- Local Kokoro needs about 1 s to rebuild its engine before the next sentence after a barge-in (the price of killing in-flight synthesis)
|
|
@@ -353,7 +357,8 @@ Also: the on-device recording fixture used for debugging is **off by default**;
|
|
|
353
357
|
| Caption is hidden behind the input box | Default `captionMaxWidth=1` (70vw) + `captionFontSize=0` (12px) can overlap the bottom input on narrow viewports; raise the tier or click the caption's `×` to dismiss |
|
|
354
358
|
| Yield behavior is wrong (saying `嗯` doesn't pause / real speech gets hard-barge) | Short backchannel words (`嗯 / 对`) auto-pause 1.5 s then reading resumes; continuing to speak triggers hard barge-in; disable `backchannelYield` to restore pre-change behavior (ADR-0008) |
|
|
355
359
|
| Says `嗯` but no yield happens | Confirm `backchannelYield=true` (default on); in hold mode, continuing to talk within 1.5 s of release triggers hard barge-in |
|
|
356
|
-
| Auto-exits after 5 minutes idle (don't want) | Raise `idleTimeoutMinutes` (default 5 min
|
|
360
|
+
| Auto-exits after 5 minutes idle (don't want) | Raise `idleTimeoutMinutes` (default 5 min; reading, the AI speaking and a running turn all count as activity, and background tabs renew too; it still exits 2 hours after your last real action) |
|
|
361
|
+
| Mic button spins forever | The host not answering times out after 8 s; click the mic again while it spins to cancel entering, leaving no voice session behind |
|
|
357
362
|
|
|
358
363
|
---
|
|
359
364
|
|
|
@@ -384,7 +389,7 @@ After changing dependencies run `npm pack --dry-run`, `npm test` and `bash scrip
|
|
|
384
389
|
|
|
385
390
|
```sh
|
|
386
391
|
pnpm install && pnpm build # esbuild: lib/index.js (host) + lib/client.js (browser) + lib/msedge-tts.cjs
|
|
387
|
-
pnpm test #
|
|
392
|
+
pnpm test # 53 test files chained: unit tests + harnesses (fake browser driving the real engine) + structure guards + pre-release self-check (no network)
|
|
388
393
|
bash scripts/smoke-runtime.sh <dsh-core-bin.js> <port> # boot an isolated dsh core: endpoints, mic button, settings page, i18n
|
|
389
394
|
bash scripts/full-e2e.sh <dsh-core-bin.js> <port> # real-LLM end to end: create → toggle → prompt → SSE audio frames
|
|
390
395
|
systemctl restart dsh # Linux; restart the dsh process on other platforms
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](LICENSE)
|
|
4
4
|
[](https://github.com/qishuilalala/dsh-voice-mode/releases)
|
|
5
5
|
[](https://www.npmjs.com/package/dsh-voice-mode)
|
|
6
|
-
[](https://github.com/qishuilalala/dsh-voice-mode/blob/main/docs/rules/STATE.md)
|
|
7
7
|
|
|
8
8
|
DeepSeek Harness 语音双工对话模式:会话内一键进入 → 边说边出字的流式识别 → 停顿自动发送 → 最终答复按句流式朗读 + 实时字幕,开口即可打断(真 barge-in)。无需 API Key,识别模型在本地宿主端推理。
|
|
9
9
|
|
|
@@ -24,12 +24,12 @@ dsh ≥0.1.7 上按钮挂在发送键左侧(`conversation.input.activity`)
|
|
|
24
24
|
- **聆听**:绿色三根竖条,随麦克风音量跳动;**朗读中**:蓝色五根竖条,随播放音量跳动;**按住说话**:红色
|
|
25
25
|
- **说完就关**(`mode: once`):发出后关麦、转圈等回复,读完显示对勾并自动退出
|
|
26
26
|
- **检测到说话**:右上角橙点;**出错**:左上角红点(悬停看原因)
|
|
27
|
-
- **点击**:平时进入/退出;不在语音模式但正在朗读(`readAloud: always`)时点一下 =
|
|
27
|
+
- **点击**:平时进入/退出;不在语音模式但正在朗读(`readAloud: always`)时点一下 = 停止朗读;等待回复或朗读期间单击 = 停止朗读并完全退出。点按钮不会抢走输入框的光标
|
|
28
28
|
- **右键菜单**(鼠标右键或键盘菜单键;触屏长按仍是按住说话):交互模式、朗读回复范围、字幕浮层、状态条、自动发送
|
|
29
29
|
- 状态条与字幕默认开启;两项都关掉即上图的「全部收进按钮」形态,此时录音计时显示在按钮下方、提示文字显示在按钮旁
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
> **最近两版**:**v0.7.
|
|
32
|
+
> **最近两版**:**v0.7.29** 对抗验证修复批:长句定稿不丢、长朗读不被空闲退出、Edge 朗读 `&`/`<` 不再跳句、Kokoro 可离线、下载卡死自动换源、进入中再点即取消、读屏不再被状态条刷屏等 20 项;**v0.7.28** 输入框内 `Alt/Option+Enter` 切换语音模式 + 快捷键分组与「录制」录入 + 设置即时生效 + 按住说话空闲即录、回复后自动退出 + 点按钮不抢输入框焦点 + 长文本朗读分段改进(PR #17,@dyguests 贡献)。完整记录见 [CHANGELOG](https://github.com/qishuilalala/dsh-voice-mode/blob/main/CHANGELOG.md)。
|
|
33
33
|
>
|
|
34
34
|
> **运行时变更(v0.7.18 ~ v0.7.24)**:① **设置面全版本打通**——dsh 0.1.7+ 上设置页与持久化修复(Settings → 语音模式 专属页、写入与重启保留);② **国际化重做**——界面语言跟随 dsh 官方语言设置,中/英文完整一致、切换无需刷新;③ **修复 npm/pnpm 全新安装失败与 dsh ≥0.1.7 已安装形态「failed to import」**(0.7.17 及更早版本受影响,请升级到 ≥0.7.18);④ **官方桌面端(Electron)下本地 Kokoro 修复**——需系统 PATH 上有 Node.js ≥18(或设 `DSHVM_NODE`);⑤ **v0.7.24:恢复 Edge 云端朗读**——微软服务端自 2026-10-15 起拒绝旧版握手(v0.7.23 及更早的默认 Edge 朗读无声,本地 VITS / Kokoro 不受影响),内联的 msedge-tts 升到 2.1.0;朗读**连续失败时**会提示切换本地引擎;另有 host 加固(`/models/retry` 仅同源 POST、模型树路径校验、错误原文不下行)。兼容 dsh 至 0.2.1-rc.2(0.2.1-alpha.4/5 起设置入口移入侧栏底部「Account menu」弹出层,本插件两处入口仍有效)。
|
|
35
35
|
|
|
@@ -56,10 +56,10 @@ dsh ≥0.1.7 上按钮挂在发送键左侧(`conversation.input.activity`)
|
|
|
56
56
|
|
|
57
57
|
## ✨ 功能
|
|
58
58
|
|
|
59
|
-
- **语音模式**:输入框工具排麦克风按钮或全局快捷键 `Ctrl+Shift+V`
|
|
59
|
+
- **语音模式**:输入框工具排麦克风按钮或全局快捷键 `Ctrl+Shift+V` 进入/退出;光标在输入框里时还可按 `Alt+Enter`(Mac 为 `Option+Enter`)切换(不插入换行);全局单活(同一时刻仅一个会话处于语音模式,切换会话自动让出)
|
|
60
60
|
- **三种交互模式(右键麦克风或设置可切换,切换即持久化)**:
|
|
61
61
|
- `toggle`(默认)持续聆听:RMS VAD 分段 → zipformer2 流式识别(边说边出字,实时字幕预览)→ 静音约 1500 毫秒断句进草稿,连续多段拼成一条消息,再静音约 1.2 秒(合计约 2.7 秒)自动发送;按住 `Ctrl` 强制立即发送
|
|
62
|
-
- `hold`
|
|
62
|
+
- `hold` 按住说话:空闲时**直接按住麦克风按钮就开始录音、松手即发**(不必先点一下进入;短按仍是进入/退出);发出后等回复结束(开朗读则读完)自动退出语音模式;关闭自动发送时松手只把文字留在输入框、不发送并直接退出;按住时没说话约 25 秒后兜底退出;滑出取消、`Esc`/失焦放弃本段;按住期间停顿不断句(上限 10 分钟);`Ctrl` 按住即录、松开即发
|
|
63
63
|
- `once` 说完就关:像 `toggle` 一样说一段,发出后关麦,等回复朗读完自动退出语音模式(关闭自动发送时:说完这一段即退出,文字留在草稿)
|
|
64
64
|
- **朗读范围**(`readAloud`):`voice`(默认)只朗读语音模式下的回复;`always` 当前可见会话的所有回复都朗读(含打字发的;同一会话开多个标签页只在最后看的那个上播);`off` 从不朗读
|
|
65
65
|
- **唤醒词(可选,默认关)**:设置 `wakeWord` 后进入待机态,说出唤醒词才开始识别(如「你好小D」)。**可直接与命令连说**(「你好小D,帮我查天气」)——唤醒词会在定稿/字幕里自动剥掉、不进消息;匹配带容错(同音字替换「小莫→小墨」、首字错、前置语气词「呃/喂/我说」),建议 3-4 字;待机态状态条实时显示「说『x』开始 · 它听到的转写」,唤醒成败可自查。边界(重要):**仅 `toggle` 模式生效**(`hold` / 手动打断下唤醒词静默失效);**说完整一句后回到待机态需重说唤醒词**(只喊唤醒词、还没说命令时保持聆听,可停顿想好再说);**朗读期说唤醒词不触发**(打断由 VAD 开口即触发,与唤醒词无关)
|
|
@@ -71,7 +71,7 @@ dsh ≥0.1.7 上按钮挂在发送键左侧(`conversation.input.activity`)
|
|
|
71
71
|
- **设置**:入口随 dsh 版本而不同(见下方「设置」),可调朗读引擎/音色/语速/打断灵敏度/静音停顿/空闲超时/模型镜像/自动发送/交互模式/唤醒词/口语化提示词/字幕档位/让位语义/让位窗口/打断语音抢救/LLM 纠错;**音色可试听**(按当前音色+语速即时合成预览,自定义 ShortName 亦可)
|
|
72
72
|
- **界面语言**:跟随 dsh 的语言设置(设置 → 通用 → 语言),**切换即时生效、无需刷新**——设置页、语音状态条、字幕、音色名称/性别/口音、错误提示全部随之变化;LLM 口语化提示词也按界面语言选中/英文版。插件词典注册在 dsh 官方 locale 服务的 `voice-mode` 命名空间,社区语言包可据此补充其它语言,缺失的语言回落英文。插件名称与描述在「插件」页同样按语言显示。
|
|
73
73
|
- **容错与诊断**:麦克风被拒红点提示、模型下载失败可见提示、TTS 连接失败状态条提示(自动退避重试)、提交失败文字留在草稿、SSE 断线自动重连;识别/打断检测通道连续失败、状态同步断连时状态条给出提示(可自愈的瞬时失败不打扰);SenseVoice 定稿超过 2 秒时状态条显示「识别中… Ns」递增(看得见它在工作);「复制诊断」一键复制版本/运行状态/设置快照/阶段耗时——**不含任何转写原文**(隐私口径)
|
|
74
|
-
- **空闲退出**:5
|
|
74
|
+
- **空闲退出**:5 分钟无活动自动退出并释放麦克风。朗读、AI 说话、回合运行均计为活动,后台标签页同样续期;但距最后一次真实操作(说话 / 打断 / 进入语音)满 2 小时仍会退出
|
|
75
75
|
|
|
76
76
|
---
|
|
77
77
|
|
|
@@ -95,9 +95,10 @@ bundle 插件安装后需重启 dsh 生效(Linux:`systemctl restart dsh`;
|
|
|
95
95
|
|
|
96
96
|
| 手势 | 作用 |
|
|
97
97
|
| --- | --- |
|
|
98
|
-
| `Ctrl+Shift+V` | 进入 /
|
|
98
|
+
| `Ctrl+Shift+V` | 进入 / 退出语音模式(应用内) |
|
|
99
|
+
| 输入框内 `Alt+Enter`(Mac 为 `Option+Enter`) | 光标在输入框里时进入 / 退出语音模式,不插入换行;长按不重复切换;设置卡片自己的输入框不拦截;`Cmd/Ctrl+Enter` 不占用(宿主用来发送) |
|
|
99
100
|
| 直接说话 | `toggle`:边说边出字,停顿约 1500 毫秒断句进草稿、再静音约 1.2 秒(合计约 2.7 秒)自动发送;按住 `Ctrl` 强制立即发送 |
|
|
100
|
-
| 按住麦克风按钮 | `hold
|
|
101
|
+
| 按住麦克风按钮 | `hold`:空闲时直接按住即开始录音,松手发送并在回复结束后自动退出;短按仍是进入 / 退出;滑出 / `Esc` / 失焦放弃本段;右键只开快捷菜单 |
|
|
101
102
|
| 点输入框旁模式按钮 | 在「持续聆听 ⇄ 按住说」间切换(保存到设置) |
|
|
102
103
|
| 说唤醒词 | 待机态激活识别(配置后) |
|
|
103
104
|
| AI 朗读时开口说话 | 打断朗读并取消当前回合 |
|
|
@@ -133,7 +134,8 @@ bundle 插件安装后需重启 dsh 生效(Linux:`systemctl restart dsh`;
|
|
|
133
134
|
| `readAloud` | `voice` | 朗读范围:`voice` 仅语音模式下的回复;`always` 当前可见会话的所有回复(含打字发送);`off` 从不朗读 |
|
|
134
135
|
| `showStatusBar` | `true` | 输入框上方的语音状态条;关闭后状态只显示在麦克风按钮上(计时在按钮下方、提示在按钮旁) |
|
|
135
136
|
| `showCaptions` | `true` | 朗读时的字幕浮层 |
|
|
136
|
-
| `shortcut` | `Ctrl+Shift+V` | 进入 / 退出语音模式的快捷键(修饰键 Ctrl/Shift/Alt/Meta +
|
|
137
|
+
| `shortcut` | `Ctrl+Shift+V` | 进入 / 退出语音模式的快捷键(修饰键 Ctrl/Shift/Alt/Meta + 一个字母 / 数字 / Enter / Space / Tab);设置页「快捷键」分组里可点「录制」直接按组合键录入(`Esc` 取消、`Backspace` 清空,缺修饰键或方向键 / F 键等不支持的键会提示);**留空 = 禁用快捷键**,改用麦克风按钮;**即时生效** |
|
|
138
|
+
| `composerShortcut` | `Alt+Enter` | 光标在输入框里时切换语音模式的快捷键(Mac 上即 Option+Enter),不插入换行;格式与录制方式同 `shortcut`;**留空 = 禁用**;设置卡片自己的输入框不拦截;`Cmd/Ctrl+Enter` 不占用;**即时生效**。「恢复默认」把两项快捷键恢复为 `Ctrl+Shift+V` 与 `Alt+Enter` |
|
|
137
139
|
| `wakeWord` | 空(关) | 唤醒词(如「你好小D」):进入后先说唤醒词激活,避免误触;空 = 关闭。**可与命令连说**,词头自动剥掉不进消息;匹配带容错(编辑距离 ≤1 + 前 3 字符前导窗口,吸收同音字/语气词);**建议 3-4 字**——单字词无容错、2 字词的容错会连带吸收所有同首字的 2 字词(如「小莫」也会唤醒「小张」),介意误唤醒用 3 字以上;每句断句或打断后回待机需重说;**仅 toggle 模式生效**(hold / 手动打断下不生效);朗读期说唤醒词不触发 |
|
|
138
140
|
| `toolBeep` | `false` | 工具调用提示音(默认关):开启后 AI 调用工具时「滴」一声;关闭则全程静默 |
|
|
139
141
|
| `spokenFormat` | `true` | 语音会话注入口语化提示词:开启后**仅当前语音会话**的回复被注入「口语化短句、不用 Markdown 排版符号」提示词(朗读更顺),**即时生效** |
|
|
@@ -143,10 +145,10 @@ bundle 插件安装后需重启 dsh 生效(Linux:`systemctl restart dsh`;
|
|
|
143
145
|
| `captionMaxWidth` | `1` | 字幕宽度档位 0=50vw / 1=70vw / 2=90vw(视口 <686px 窄于 480px,≈686px 接近 480px,>686px 宽于 480px) |
|
|
144
146
|
| `backchannelYield` | `true` | 让位语义(ADR-0008);朗读期说「嗯/对」自动让位 1.5s + 真要说走硬打断;关 = 行为等同改造前 |
|
|
145
147
|
| `bargeInSalvage` | `true` | 打断语音抢救(Issue #15 批 1 / ADR-0012):AI 朗读时你开口打断,自动保留从开口到打断生效之间你说的话,并入识别继续发送(修「打断吃句」;关 = 丢弃打断前语音——仅外放且无回声消除的环境建议关) |
|
|
146
|
-
| `llmCorrect` | `false` | LLM 纠错(Issue #15 批 4,默认关):发送前用大模型对整条语音文本做一次纠错(只改错别字/同音字/标点,保持原意;复用宿主已配置模型。开 = 每条消息多一次约 1
|
|
148
|
+
| `llmCorrect` | `false` | LLM 纠错(Issue #15 批 4,默认关):发送前用大模型对整条语音文本做一次纠错(只改错别字/同音字/标点,保持原意;复用宿主已配置模型。开 = 每条消息多一次约 1 秒的纠错等待;纠错失败自动用原文;模型改成回答你而非纠错时同样回退原文) |
|
|
147
149
|
| `yieldMs` | `1500` | 让位窗口时长(ms,500-3000):`backchannelYield` 命中后 TTS 丢帧持续时长;窗口内用户真要说则由原 `hardBreak` 接管,窗口到点自动恢复播放 |
|
|
148
150
|
|
|
149
|
-
生效时机分四档:①
|
|
151
|
+
生效时机分四档:① 即时——快捷键 / 输入框快捷键 / 交互模式 / 朗读范围 / 自动发送 / 字幕浮层 / 状态条 / 朗读引擎 / 音色 / 语速 / 口语化提示词(对后续回复生效)/ 模型镜像(下次下载尝试即生效);② 下次识别时——定稿重译(SenseVoice)/ 逆文本归一化;③ 下一段话——静音判定时长(断句端点;发送等待固定 1.2 秒不受影响);④ 下次进入语音模式——打断灵敏度 / 打断方式 / 回声门控 / 自动恢复 / 唤醒词 / 工具提示音 / 字幕字号 / 字幕宽度 / 短应答让位 / 让位窗口 / 打断语音抢救 / LLM 纠错 / 空闲时长。已保存但未生效的项会列在设置卡片顶部(含当前生效值)。设置项默认值由插件配置(`base` 层)提供。
|
|
150
152
|
|
|
151
153
|
### 本地音色(VITS / Kokoro)
|
|
152
154
|
|
|
@@ -221,7 +223,9 @@ bundle 插件安装后需重启 dsh 生效(Linux:`systemctl restart dsh`;
|
|
|
221
223
|
- **Windows**:`%LOCALAPPDATA%\dsh-voice-mode\models`
|
|
222
224
|
- **macOS / Linux**:`~/.cache/dsh-voice-mode/models`
|
|
223
225
|
- 两者都可用 `cacheDir` 覆盖
|
|
224
|
-
- 下载用 `.part`
|
|
226
|
+
- 下载用 `.part` 断点续传(仅单文件模型);`huggingface.co` 失败时回退 `hf-mirror.com`(可用 `modelHost` 配置)
|
|
227
|
+
- 下载有 120 秒空闲看门狗:收到字节即重置,上游卡死超时会中止并换源;关闭面板会中止在途下载
|
|
228
|
+
- 模型主文件 SHA256 固定;同一进程内文件 size+inode+ctime 未变则不重复校验(缓存只在内存,重启后首次全量校验);Kokoro 的 espeak-ng-data 目录树按清单文件大小 / 文件数判完整,首次下载完成后可完全离线使用
|
|
225
229
|
|
|
226
230
|
---
|
|
227
231
|
|
|
@@ -305,7 +309,7 @@ flowchart LR
|
|
|
305
309
|
|
|
306
310
|
### 兼容声明(插件市场的版本筛选依据)
|
|
307
311
|
|
|
308
|
-
`package.json` 声明 `engines.dsh = ">=0.1.1-rc.2 <0.3.0"`(插件市场据此在「按宿主版本筛选」时判定兼容;dsh 0.2.1-alpha.4 起 next/alpha 通道由 `engines.dsh` 单独硬校验,不满足即拒绝加载,故上界封在 0.3.0
|
|
312
|
+
`package.json` 声明 `engines.dsh = ">=0.1.1-rc.2 <0.3.0-0"`(插件市场据此在「按宿主版本筛选」时判定兼容;dsh 0.2.1-alpha.4 起 next/alpha 通道由 `engines.dsh` 单独硬校验,不满足即拒绝加载,故上界封在 0.3.0(写作 `<0.3.0-0`,连 0.3.0 的 alpha/rc 预发布一并排除)——未验证的新大版本会被干净拒绝而非静默破损)。已实测范围 **0.1.1-rc.2 → 0.2.1-rc.2**(含官方桌面端等价的 Electron 宿主);由每周 CI 巡检上游新版本并复验,出现未覆盖版本会自动开 issue。`peerDependencies` 仅声明 `@deepseek-ai/cordis` 与 `react`(宿主提供)。
|
|
309
313
|
|
|
310
314
|
## 🚧 已知限制
|
|
311
315
|
|
|
@@ -313,7 +317,7 @@ flowchart LR
|
|
|
313
317
|
- 发声打断依赖浏览器回声消除(`echoCancellation`);扬声器音量过大时可能漏声到麦克风
|
|
314
318
|
- `Ctrl+Shift+V` 会覆盖浏览器「粘贴纯文本」快捷键(普通粘贴仍可用 `Ctrl+V`)
|
|
315
319
|
- 识别质量受环境噪声影响;zipformer2 中文流式 + SenseVoice 多语(中英日韩粤)定稿
|
|
316
|
-
-
|
|
320
|
+
- 浏览器自动播放策略:朗读需要页面已有用户交互(点击麦克风即满足);进入 / 退出、设置读写、「试听」均依赖 `AbortSignal.timeout`(Safari 16+ / Chrome 103+ / Firefox 100+;老浏览器上这些操作会立即提示失败,属预期降级)
|
|
317
321
|
- **唤醒词为轻量实现**(流式文本匹配,非专用 KWS 引擎):嘈杂环境可能延迟或误激活;唤醒词本身不会进入聊天
|
|
318
322
|
- hold 模式按住时切换窗口/标签页会**放弃本段**(防持续收音)
|
|
319
323
|
- hero(新会话空态)无语音入口:请先进入会话使用麦克风按钮
|
|
@@ -346,7 +350,8 @@ flowchart LR
|
|
|
346
350
|
| 字幕被输入框挡住 | 默认 `captionMaxWidth=1`(70vw)+ `captionFontSize=0`(12px)在窄屏可能与底部输入框重叠;调高档位或点字幕浮层「×」收起 |
|
|
347
351
|
| 让位行为异常(朗读期说「嗯」不停 / 真话被打断) | 「嗯/对」类短词触发让位 1.5s 后继续朗读;继续说真话会走硬打断;不要时关 `backchannelYield` 即可恢复改造前行为(ADR-0008) |
|
|
348
352
|
| 朗读期说「嗯」没让位 | 确认 `backchannelYield=true`(默认开);hold 模式松手后让位 1.5s 内继续说话会变硬打断 |
|
|
349
|
-
| 空闲 5 分钟自动退出(不想退) | 调高 `idleTimeoutMinutes`(默认 5
|
|
353
|
+
| 空闲 5 分钟自动退出(不想退) | 调高 `idleTimeoutMinutes`(默认 5 分钟;朗读 / AI 说话 / 回合运行均计为活动,后台标签页同样续期;距最后一次真实操作满 2 小时仍会退出) |
|
|
354
|
+
| 点麦克风一直转圈 | 宿主不应答时 8 秒超时;转圈时再点一次麦克风即取消进入,不会残留语音会话 |
|
|
350
355
|
|
|
351
356
|
---
|
|
352
357
|
|
|
@@ -366,7 +371,7 @@ flowchart LR
|
|
|
366
371
|
|
|
367
372
|
```sh
|
|
368
373
|
pnpm install && pnpm build # esbuild:lib/index.js(host)+ lib/client.js(browser)
|
|
369
|
-
pnpm test #
|
|
374
|
+
pnpm test # 75 个测试文件串联:单测 + 台架(假浏览器驱动真引擎)+ 结构守卫 + 发布前自检(无需网络)
|
|
370
375
|
systemctl restart dsh # 本机加载新 host 代码;其他平台重启 dsh 进程
|
|
371
376
|
```
|
|
372
377
|
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -19,7 +19,7 @@ comment in `build.mjs` for why). Their licenses are reproduced below. Generated
|
|
|
19
19
|
| es-errors | 1.3.0 | MIT |
|
|
20
20
|
| es-object-atoms | 1.1.2 | MIT |
|
|
21
21
|
| es-set-tostringtag | 2.1.0 | MIT |
|
|
22
|
-
| follow-redirects | 1.16.
|
|
22
|
+
| follow-redirects | 1.16.1 | MIT |
|
|
23
23
|
| form-data | 4.0.6 | MIT |
|
|
24
24
|
| function-bind | 1.1.2 | MIT |
|
|
25
25
|
| get-intrinsic | 1.3.0 | MIT |
|
|
@@ -404,7 +404,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
404
404
|
SOFTWARE.
|
|
405
405
|
```
|
|
406
406
|
|
|
407
|
-
## follow-redirects 1.16.
|
|
407
|
+
## follow-redirects 1.16.1
|
|
408
408
|
|
|
409
409
|
- License: MIT
|
|
410
410
|
- Source: ssh://git@github.com/follow-redirects/follow-redirects.git
|