dsh-speak 1.4.0 → 1.7.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/README.md +166 -72
- package/README.zh-CN.md +160 -71
- package/adapters/dsh/speech-hook.js +498 -102
- package/client/client.js +304 -0
- package/docs/DESIGN.md +122 -30
- package/docs/DESIGN.zh-CN.md +108 -25
- package/engine/speak.ps1 +88 -14
- package/engine/speak.sh +66 -52
- package/package.json +36 -3
package/README.zh-CN.md
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
# dsh-speak 🔊 — 为 AI 编程 harness 提供语音播报
|
|
2
2
|
|
|
3
|
+
**中文** · [English](README.md)
|
|
4
|
+
|
|
3
5
|

|
|
4
6
|
|
|
5
7
|
[](https://awesome-dsh-plugin.com)
|
|
6
8
|
|
|
9
|
+
[](https://www.npmjs.com/package/dsh-speak)
|
|
10
|
+
|
|
7
11
|
让 Agent 在长任务完成时**开口告诉你**——不用再盯着屏幕等。
|
|
8
12
|
|
|
9
13
|
dsh-speak 通过系统语音合成把 Agent 的最终回复朗读出来——Windows 上优先使用自然
|
|
@@ -13,51 +17,25 @@ dsh-speak 通过系统语音合成把 Agent 的最终回复朗读出来——Win
|
|
|
13
17
|
[DeepSeek Harness](https://github.com/deepseek-ai/dsh) 而生,但结构上
|
|
14
18
|
任何 harness 都能接入。
|
|
15
19
|
|
|
16
|
-
> **项目定位**:本项目只是为了给想让 harness 开口说话的用户提供一种**已经验证过的方案**;
|
|
17
|
-
> 没有意外的话,后续不会再更新。
|
|
18
|
-
|
|
19
|
-
## 三分钟安装 — DSH
|
|
20
|
-
|
|
21
|
-
1. 把包装进你的 web profile(二选一):
|
|
22
|
-
|
|
23
|
-
```powershell
|
|
24
|
-
dsh plugin --profile web add dsh-speak
|
|
25
|
-
# 或(没有 pnpm 时):
|
|
26
|
-
npm install --prefix "$env:USERPROFILE\.dsh\profiles\web" dsh-speak
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
macOS 上(bash):
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
npm install --prefix "$HOME/.dsh/profiles/web" dsh-speak
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
2. 在 `~/.dsh/profiles/web/cordis.patch.yml` 末尾追加:
|
|
36
|
-
|
|
37
|
-
```yaml
|
|
38
|
-
- insert:
|
|
39
|
-
- id: speech-hook
|
|
40
|
-
name: 'dsh-speak'
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
3. 重启 DSH web 应用——之后回复就会被朗读出来。
|
|
44
|
-
|
|
45
|
-
> **想让 Agent 帮你装?** 把本仓库地址(`https://github.com/Alan2Z/dsh-speak`)
|
|
46
|
-
> 丢给你的 DSH 会话,让它照着这份 README 安装即可——它读的就是你正在看的这份文档。
|
|
47
|
-
> 只需要同意它对 `~/.dsh`(工作区外)的写入审批。
|
|
48
|
-
|
|
49
|
-
```
|
|
50
|
-
harness 事件(DSH 会话事件 / Claude Code Stop hook / 任意方式)
|
|
51
|
-
│
|
|
52
|
-
▼ adapters/… (harness 专属触发器:过滤、节流、取消)
|
|
53
|
-
▼ engine/speak.ps1 / speak.sh (与 harness 无关:清洗文本 → SAPI5 / say)
|
|
54
|
-
▼ 🔊 你听到最终回复
|
|
55
|
-
```
|
|
56
|
-
|
|
57
20
|
## 特性
|
|
58
21
|
|
|
59
22
|
- **全自动**:DSH web 插件监听会话事件流,自动播报最终回复
|
|
60
23
|
(跳过 reasoning/工具调用旁白,合并同一回复的多步消息)。
|
|
24
|
+
- **提醒你**:审批请求(Agent 等你操作时会播"需要你的审批")和 Agent 通过
|
|
25
|
+
`ask_user_question` 提出的问题都会播报。
|
|
26
|
+
- **最终回复重播**(1.7.0):每条最终回复(回合尾部)操作栏有 🔊 按钮——点击
|
|
27
|
+
重播该条回复、再点停止、点另一条切换。语音执行完全由 DSH host 拥有(浏览器
|
|
28
|
+
关掉也继续读)。
|
|
29
|
+
- **host 语音队列**(1.7.0):同一时间只运行一个语音进程,队列自动串行;
|
|
30
|
+
WebSocket 实时同步"正在读哪条、队列长度"到 UI。
|
|
31
|
+
- **多事件可选播报**(1.6.0):回合结束、命令完成、目标变更、工具出错、
|
|
32
|
+
待办更新等事件都可选播报,各自独立开/关(默认关)。
|
|
33
|
+
- **可视化配置**(1.7.0):设置 → dsh-speak 设置独立设置页,所有配置项(总开关、
|
|
34
|
+
自动朗读、Markdown 清洗、代码块、事件开关、固定提示语…)直接改,无需手写
|
|
35
|
+
YAML。
|
|
36
|
+
- **总开关**(1.6.0):一键静音所有播报。
|
|
37
|
+
- **Bundle 自动注册**(1.3.0):把包声明进 `dsh.profile.bundles`,插件通过包内
|
|
38
|
+
自带的 `cordis.patch.yml` 自动注册,无需手动写 patch 条目。
|
|
61
39
|
- **尽力而为**:绝不抛错、绝不阻塞 harness、绝不破坏会话。
|
|
62
40
|
- **自然语音**:Windows 优先使用自然语音——Windows 11 内置语音包,或 Windows 10
|
|
63
41
|
上经 NaturalVoiceSAPIAdapter 注册的语音(如晓晓);macOS 使用系统朗读声音
|
|
@@ -67,9 +45,22 @@ harness 事件(DSH 会话事件 / Claude Code Stop hook / 任意方式)
|
|
|
67
45
|
- **引擎可移植**:任意进程一行即可朗读:
|
|
68
46
|
Windows `powershell -File speak.ps1 -Text "你好"` / macOS `./speak.sh -t "你好"`。
|
|
69
47
|
|
|
48
|
+
## 工作原理
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
harness 事件(DSH 会话事件 / Claude Code Stop hook / 任意方式)
|
|
52
|
+
│
|
|
53
|
+
▼ adapters/… (harness 专属触发器:过滤、节流、取消)
|
|
54
|
+
▼ engine/speak.ps1 / speak.sh (与 harness 无关:清洗文本 → SAPI5 / say)
|
|
55
|
+
▼ 🔊 你听到最终回复
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
适配器负责把 harness 专属事件转成引擎调用;引擎负责清洗文本并朗读,
|
|
59
|
+
与 harness 完全解耦。完整设计见 [docs/DESIGN.zh-CN.md](docs/DESIGN.zh-CN.md)。
|
|
60
|
+
|
|
70
61
|
## 前置条件
|
|
71
62
|
|
|
72
|
-
Windows
|
|
63
|
+
### Windows
|
|
73
64
|
|
|
74
65
|
- Windows 10 或 11,任意较新的 PowerShell。
|
|
75
66
|
- 自然语音:
|
|
@@ -80,14 +71,14 @@ Windows:
|
|
|
80
71
|
并用它的 VoiceDownloader 手动下载你需要的中文或其他语言的自然语音包。
|
|
81
72
|
- 没有自然语音时,引擎回退到系统自带语音(如 Huihui)。
|
|
82
73
|
|
|
83
|
-
macOS
|
|
74
|
+
### macOS 要求
|
|
84
75
|
|
|
85
76
|
- macOS(Apple Silicon / Intel 均可),系统自带 `say` 命令,**无需安装任何软件**。
|
|
86
|
-
-
|
|
77
|
+
- 中文音色与 Siri 音色的选择入口/坑见 [macOS](#macos) 一节。
|
|
87
78
|
|
|
88
|
-
##
|
|
79
|
+
## 安装与快速开始
|
|
89
80
|
|
|
90
|
-
### 方式 A
|
|
81
|
+
### DSH — 方式 A:npm 插件(推荐)
|
|
91
82
|
|
|
92
83
|
```powershell
|
|
93
84
|
# 1. 把插件装进你的 web profile(会写入 ~/.dsh/profiles/web/package.json 的 dependencies)
|
|
@@ -107,10 +98,20 @@ dsh plugin --profile web add dsh-speak
|
|
|
107
98
|
> ```powershell
|
|
108
99
|
> npm install --prefix "$env:USERPROFILE\.dsh\profiles\web" dsh-speak
|
|
109
100
|
> ```
|
|
101
|
+
>
|
|
102
|
+
> macOS(bash):
|
|
103
|
+
>
|
|
104
|
+
> ```bash
|
|
105
|
+
> npm install --prefix "$HOME/.dsh/profiles/web" dsh-speak
|
|
106
|
+
> ```
|
|
110
107
|
|
|
111
108
|
引擎随包分发(`node_modules/dsh-speak/engine/`),无需额外拷贝。
|
|
112
109
|
|
|
113
|
-
|
|
110
|
+
> **想让 Agent 帮你装?** 把本仓库地址(`https://github.com/Alan2Z/dsh-speak`)
|
|
111
|
+
> 丢给你的 DSH 会话,让它照着这份 README 安装即可——它读的就是你正在看的这份文档。
|
|
112
|
+
> 只需要同意它对 `~/.dsh`(工作区外)的写入审批。
|
|
113
|
+
|
|
114
|
+
### DSH — 方式 B:文件安装(不需要 npm)
|
|
114
115
|
|
|
115
116
|
```powershell
|
|
116
117
|
# 1. 克隆
|
|
@@ -134,14 +135,12 @@ powershell -NoProfile -ExecutionPolicy Bypass -File "$env:USERPROFILE\.dsh\hooks
|
|
|
134
135
|
| `adapters/dsh/speech-hook.js` | `%USERPROFILE%\.dsh\profiles\web\plugins\` |
|
|
135
136
|
| 注册条目 | 追加到 `%USERPROFILE%\.dsh\profiles\web\cordis.patch.yml`(先备份) |
|
|
136
137
|
|
|
137
|
-
|
|
138
|
+
### macOS
|
|
138
139
|
|
|
139
140
|
同一套适配层原生支持 macOS——插件自动检测平台,改调 `engine/speak.sh`
|
|
140
141
|
(系统自带的 `say` 命令)而不是 `speak.ps1`。**自 1.2.0 起 macOS 引擎随 npm 包
|
|
141
142
|
正式分发**,无需安装任何额外软件。
|
|
142
143
|
|
|
143
|
-
### 安装(npm 方式,与 Windows 等价)
|
|
144
|
-
|
|
145
144
|
```bash
|
|
146
145
|
# 1. 装进你的 web profile(没有 pnpm 也能装——dsh plugin 才依赖 pnpm)
|
|
147
146
|
npm install --prefix "$HOME/.dsh/profiles/web" dsh-speak
|
|
@@ -151,13 +150,13 @@ npm install --prefix "$HOME/.dsh/profiles/web" dsh-speak
|
|
|
151
150
|
# - id: speech-hook
|
|
152
151
|
# name: 'dsh-speak'
|
|
153
152
|
|
|
154
|
-
# 3. 无需重启——patch
|
|
155
|
-
#
|
|
153
|
+
# 3. 无需重启——patch 监视器会热更新;回复在节流后(约 1.5 秒)自动播报;
|
|
154
|
+
# 带工具调用的回复会在回合结束时补播最终回复
|
|
156
155
|
```
|
|
157
156
|
|
|
158
157
|
> 装过 pnpm 也可以 `dsh plugin --profile web add dsh-speak`,效果相同。
|
|
159
158
|
|
|
160
|
-
|
|
159
|
+
#### 音色(重要,有两个坑)
|
|
161
160
|
|
|
162
161
|
- 默认跟随**系统朗读声音**(系统设置 → 辅助功能 → 朗读内容 → 系统朗读声音)。
|
|
163
162
|
**macOS 26** 上该选择框旁有个 **ⓘ 圆圈图标**,点开才是完整音色列表——普通
|
|
@@ -172,7 +171,7 @@ npm install --prefix "$HOME/.dsh/profiles/web" dsh-speak
|
|
|
172
171
|
- 想强制指定音色用 `-v Eddy|Flo|Tingting`(`say -v '?'` 列出可用音色)。
|
|
173
172
|
- `say` 没有音量参数——音量跟随系统输出音量。
|
|
174
173
|
|
|
175
|
-
|
|
174
|
+
#### 单独测试引擎(不装 DSH 也行)
|
|
176
175
|
|
|
177
176
|
```bash
|
|
178
177
|
curl -sfL -o ~/speak.sh "https://cdn.jsdelivr.net/gh/Alan2Z/dsh-speak@main/engine/speak.sh"
|
|
@@ -181,7 +180,7 @@ chmod +x ~/speak.sh
|
|
|
181
180
|
~/speak.sh -t "测试" -v Eddy -r 200 # 指定音色 + 语速
|
|
182
181
|
```
|
|
183
182
|
|
|
184
|
-
|
|
183
|
+
### Claude Code
|
|
185
184
|
|
|
186
185
|
在 `~/.claude/settings.json` 注册 Stop hook:
|
|
187
186
|
|
|
@@ -202,7 +201,7 @@ chmod +x ~/speak.sh
|
|
|
202
201
|
}
|
|
203
202
|
```
|
|
204
203
|
|
|
205
|
-
|
|
204
|
+
### 其他任何 harness
|
|
206
205
|
|
|
207
206
|
直接从你的 Agent / 包装脚本 / 工具里调用引擎:
|
|
208
207
|
|
|
@@ -219,18 +218,101 @@ powershell -NoProfile -ExecutionPolicy Bypass -File engine\speech-prompt.ps1 -Te
|
|
|
219
218
|
|
|
220
219
|
## 配置
|
|
221
220
|
|
|
222
|
-
|
|
221
|
+
### 引擎参数
|
|
222
|
+
|
|
223
|
+
详见 [docs/DESIGN.zh-CN.md §5 配置参考](docs/DESIGN.zh-CN.md#5-配置参考):
|
|
223
224
|
|
|
224
225
|
```powershell
|
|
225
226
|
speak.ps1 -Text "…" -Volume 50 -Rate 1 -MaxChars 300 -LongTextMessage "本次播报内容较长,请自行阅读。"
|
|
226
227
|
```
|
|
227
228
|
|
|
228
|
-
DSH
|
|
229
|
+
### DSH 插件配置
|
|
230
|
+
|
|
231
|
+
**两种改法,任选其一**(改 UI 或改 YAML 都写进同一个 settings 文档,彼此同步):
|
|
232
|
+
|
|
233
|
+
1. **Web UI(1.7.0,推荐)**:设置 → dsh-speak 设置独立设置页。所有配置项都能直接改并
|
|
234
|
+
保存(`dsh --dump-config` 可见、按 profile 隔离、升级不丢)。
|
|
235
|
+
2. **profile patch 的 `config` 块**(等效):
|
|
236
|
+
|
|
237
|
+
```yaml
|
|
238
|
+
# ~/.dsh/profiles/web/cordis.patch.yml
|
|
239
|
+
- insert:
|
|
240
|
+
- id: speech-hook
|
|
241
|
+
name: 'dsh-speak'
|
|
242
|
+
config:
|
|
243
|
+
enabled: true # 总开关:false 时完全不播报
|
|
244
|
+
automaticSpeech: true # 自动朗读最终回复
|
|
245
|
+
queueAllMessages: false # true = 所有 assistant 消息立即入队朗读(中间消息也读)
|
|
246
|
+
replayFullRead: false # true = 手动重播跳过超长文本截断,完整朗读
|
|
247
|
+
cleanMarkdownFormatting: true # Markdown 转自然语音
|
|
248
|
+
readInlineCode: true # 朗读行内代码(去掉反引号)
|
|
249
|
+
codeBlocks: smart # all | smart | replace(围栏代码块)
|
|
250
|
+
codeBlockMaxChars: 300 # smart 模式下的代码块字数上限
|
|
251
|
+
codeBlockReplacementText: 'You can see the code in our history.' # replace 时的替代文本
|
|
252
|
+
throttleMs: 1500 # 播报前的合并延迟(毫秒)
|
|
253
|
+
engine: '' # 引擎路径覆盖;'' = 自动解析
|
|
254
|
+
announceApprovals: true # 播报审批请求
|
|
255
|
+
announceQuestions: true # 播报 ask_user_question 提问内容
|
|
256
|
+
stripApprovalPrefix: true # 剥离审批原因里的 "escalate sandbox to ...: " 前缀
|
|
257
|
+
questionGapMs: 2000 # 多个提问播报之间的停顿(毫秒)
|
|
258
|
+
longTextMode: message # message | heading(念最大字号 markdown 标题)
|
|
259
|
+
longTextMessage: '本次播报内容较长,请自行阅读。' # message 模式下的固定提示语
|
|
260
|
+
maxChars: 300 # 引擎单次朗读字数上限(macOS 默认 0 = 不限)
|
|
261
|
+
volume: 50 # 仅 Windows
|
|
262
|
+
rate: 0 # 0 = 引擎默认(Windows SAPI 刻度 / macOS wpm)
|
|
263
|
+
# —— 可选事件播报(1.6.0,默认全关)——
|
|
264
|
+
announceTurnEnd: false # 回合结束("第 N 轮对话完成")
|
|
265
|
+
announceCommandDone: false # 命令完成/失败(command/done)
|
|
266
|
+
announceGoalChange: false # 目标创建/更新/完成(goal/change)
|
|
267
|
+
announceToolErrors: false # 工具调用出错时播报(英文详情截掉,tool/result)
|
|
268
|
+
announceTodoWrite: false # 待办列表更新(todo/write)
|
|
269
|
+
```
|
|
229
270
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
271
|
+
> 解析顺序:schema 默认值 → patch `config` → UI 用户设置。写进 YAML 的字段
|
|
272
|
+
> 同样出现在 UI 中。平台差异:`maxChars` 在 macOS 默认 0(`say` 无上限),
|
|
273
|
+
> Windows 默认 300(SAPI 安全上限)。
|
|
274
|
+
|
|
275
|
+
#### 选项说明
|
|
276
|
+
|
|
277
|
+
| 选项 | 默认值 | 效果 |
|
|
278
|
+
| ---- | ------ | ---- |
|
|
279
|
+
| `enabled` | `true` | **总开关**:关闭后所有播报都不触发(最终回复/审批/提问/可选事件/重播) |
|
|
280
|
+
| `automaticSpeech` | `true` | 自动朗读最终回复;手动重播始终可用 |
|
|
281
|
+
| `queueAllMessages` | `false` | `true` 时每条 assistant 消息立即入队朗读(中间消息也读,FIFO);默认只读节流后的最终回复 |
|
|
282
|
+
| `replayFullRead` | `false` | `true` 时手动重播跳过超长文本的标题截断(`longTextMode: heading`),完整分段朗读 |
|
|
283
|
+
| `cleanMarkdownFormatting` | `true` | 把 Markdown 转成自然语音文本(链接保留文字去 URL、标题/强调符号清理) |
|
|
284
|
+
| `readInlineCode` | `true` | 朗读行内代码(去掉反引号标记) |
|
|
285
|
+
| `codeBlocks` | `smart` | 围栏代码块处理:`all` 全读 / `smart`(≤`codeBlockMaxChars` 才读)/ `replace` 用替代文本 |
|
|
286
|
+
| `codeBlockMaxChars` | `300` | `smart` 模式下的代码块字数上限 |
|
|
287
|
+
| `codeBlockReplacementText` | `You can see the code in our history.` | `replace` 模式(或超限的 `smart`)下朗读的替代文本 |
|
|
288
|
+
| `throttleMs` | `1500` | 回复文本等待多久才播报(合并同一回复的多步消息) |
|
|
289
|
+
| `engine` | `''` | 显式引擎脚本路径;`''` 自动解析:包内 `engine/<平台>` → `~/.dsh/hooks/<平台>` |
|
|
290
|
+
| `announceApprovals` | `true` | 播报 `approval/asked` 事件(审批原因,或固定提示语) |
|
|
291
|
+
| `announceQuestions` | `true` | 播报 `ask_user_question`:每个问题单独朗读,带"问题N"序号(多问题时)与"选项N"序号(与 UI 编号一致);多个问题之间停顿 `questionGapMs` |
|
|
292
|
+
| `questionGapMs` | `2000` | 多个提问播报之间的停顿(毫秒),0 = 不停顿 |
|
|
293
|
+
| `stripApprovalPrefix` | `true` | 剥离审批原因里的固定英文模板前缀(`escalate sandbox to danger-full-access: `),保留中文说明 |
|
|
294
|
+
| `longTextMode` | `message` | `message` = 超长念固定提示语;`heading` = 改念最大字号 markdown 标题(规则见下) |
|
|
295
|
+
| `longTextMessage` | `本次播报内容较长,请自行阅读。` | `message` 模式下超长文本改念的固定提示语(UI 可编辑) |
|
|
296
|
+
| `maxChars` | 平台相关 | 引擎单次朗读上限。**macOS 默认 0(`say` 无上限);Windows 默认 300**(SAPI 超过约 375-470 字会静默失败) |
|
|
297
|
+
| `volume` | `50` | 仅 Windows(0-100);macOS 音量跟随系统 |
|
|
298
|
+
| `rate` | `0` | `0` = 引擎默认(Windows SAPI 刻度如 1;macOS words-per-minute 如 175) |
|
|
299
|
+
| `announceTurnEnd` | `false` | 回合结束时播报"第 N 轮对话完成/中断/异常结束"(`turn/end`) |
|
|
300
|
+
| `announceCommandDone` | `false` | 命令执行完成/失败时播报(`command/done`) |
|
|
301
|
+
| `announceGoalChange` | `false` | 目标创建/更新/完成/暂停/恢复时播报(`goal/change`,含目标标题前 40 字) |
|
|
302
|
+
| `announceToolErrors` | `false` | 工具调用返回错误时播报"工具调用出错"(英文错误详情/技术 code 截掉,只保留中文详情;`tool/result` 带 `error` 或 `isError` 内容块时) |
|
|
303
|
+
| `announceTodoWrite` | `false` | agent 更新待办列表时播报"待办已更新:n/m 完成"(`todo/write`) |
|
|
304
|
+
|
|
305
|
+
#### 超长文本模式
|
|
306
|
+
|
|
307
|
+
清洗后文本超过 `maxChars` 时:
|
|
308
|
+
|
|
309
|
+
- **`message`**(默认):念 `longTextMessage`(`本次播报内容较长,请自行阅读。`,
|
|
310
|
+
可在 UI 或 YAML 里编辑)。
|
|
311
|
+
- **`heading`**:在原始文本里挑**最大字号**的 markdown 标题——`#` 数量最少者优先,
|
|
312
|
+
并列取第一个;没有标题行则取第一个非空行。选中的候选仍会清洗并受 `maxChars`
|
|
313
|
+
上限约束,若其本身仍超长则回退提示语。
|
|
314
|
+
|
|
315
|
+
完整架构与设计取舍见 [docs/DESIGN.zh-CN.md](docs/DESIGN.zh-CN.md)。
|
|
234
316
|
|
|
235
317
|
## 自定义(升级不丢)
|
|
236
318
|
|
|
@@ -243,19 +325,24 @@ DSH 插件环境变量:
|
|
|
243
325
|
Copy-Item "$env:USERPROFILE\.dsh\profiles\web\node_modules\dsh-speak\engine\speak.ps1" "$env:USERPROFILE\.dsh\hooks\my-speak.ps1"
|
|
244
326
|
# macOS
|
|
245
327
|
cp ~/.dsh/profiles/web/node_modules/dsh-speak/engine/speak.sh ~/.dsh/hooks/my-speak.sh
|
|
246
|
-
# 按喜好编辑 my-speak.ps1 / my-speak.sh,然后让插件指向它:
|
|
247
|
-
setx DSH_SPEAK_ENGINE "$env:USERPROFILE\.dsh\hooks\my-speak.ps1" # Windows
|
|
248
|
-
echo 'export DSH_SPEAK_ENGINE=~/.dsh/hooks/my-speak.sh' >> ~/.zshrc # macOS
|
|
249
328
|
```
|
|
250
329
|
|
|
251
|
-
|
|
252
|
-
优先生效;`npm update` 只动包本身,你的引擎安然无恙。
|
|
330
|
+
然后在 config 块里指向你的副本:
|
|
253
331
|
|
|
254
|
-
|
|
332
|
+
```yaml
|
|
333
|
+
- insert:
|
|
334
|
+
- id: speech-hook
|
|
335
|
+
name: 'dsh-speak'
|
|
336
|
+
config:
|
|
337
|
+
engine: 'C:/Users/<你>/.dsh/hooks/my-speak.ps1' # macOS 用 ~/.dsh/hooks/my-speak.sh
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
插件按 `config.engine` → 包内引擎 → `~/.dsh/hooks/` 的顺序解析引擎,所以你的副本
|
|
341
|
+
优先生效;`npm update` 只动包本身,你的引擎安然无恙。
|
|
255
342
|
|
|
256
|
-
|
|
343
|
+
2. **直接改 `node_modules` 里的文件**——能改,但下次 `npm update` 会被覆盖。
|
|
257
344
|
|
|
258
|
-
|
|
345
|
+
3. **fork 仓库**——完全掌控,想发自己的包也行。
|
|
259
346
|
|
|
260
347
|
## 排障
|
|
261
348
|
|
|
@@ -279,10 +366,12 @@ engine/ 与 harness 无关的语音引擎(PowerShell + SAPI5
|
|
|
279
366
|
speech-summary.ps1 阻塞式回复总结播报
|
|
280
367
|
adapters/
|
|
281
368
|
dsh/ DSH web 插件 + 一键安装脚本
|
|
282
|
-
speech-hook.js
|
|
369
|
+
speech-hook.js 会话事件触发器(节流/取消 + 可选事件 + FIFO 语音队列 + WebSocket + settings 注册)
|
|
283
370
|
install.ps1 拷贝 + 注册 + 备份
|
|
284
371
|
claude-code/
|
|
285
372
|
stop-hook.ps1 Claude Code Stop hook 触发器
|
|
373
|
+
client/
|
|
374
|
+
client.js DSH 浏览器端 bundle:回合尾部 Speak/Stop 按钮 + 设置 → dsh-speak 设置页
|
|
286
375
|
docs/
|
|
287
376
|
DESIGN.zh-CN.md 完整设计文档:设计取舍、踩坑记录、扩展指南
|
|
288
377
|
```
|