dsh-notify-chime 0.0.0-stage → 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/LICENSE +21 -0
- package/README.md +169 -2
- package/assets/approval.wav +0 -0
- package/assets/chime/approval.wav +0 -0
- package/assets/chime/error.wav +0 -0
- package/assets/chime/finished.wav +0 -0
- package/assets/chime/goal-blocked.wav +0 -0
- package/assets/chime/interrupted.wav +0 -0
- package/assets/chime/job-failed.wav +0 -0
- package/assets/chime/plan-review.wav +0 -0
- package/assets/chime/question.wav +0 -0
- package/assets/digital/approval.wav +0 -0
- package/assets/digital/error.wav +0 -0
- package/assets/digital/finished.wav +0 -0
- package/assets/digital/goal-blocked.wav +0 -0
- package/assets/digital/interrupted.wav +0 -0
- package/assets/digital/job-failed.wav +0 -0
- package/assets/digital/plan-review.wav +0 -0
- package/assets/digital/question.wav +0 -0
- package/assets/error.wav +0 -0
- package/assets/finished.wav +0 -0
- package/assets/goal-blocked.wav +0 -0
- package/assets/interrupted.wav +0 -0
- package/assets/job-failed.wav +0 -0
- package/assets/plan-review.wav +0 -0
- package/assets/question.wav +0 -0
- package/assets/retro/approval.wav +0 -0
- package/assets/retro/error.wav +0 -0
- package/assets/retro/finished.wav +0 -0
- package/assets/retro/goal-blocked.wav +0 -0
- package/assets/retro/interrupted.wav +0 -0
- package/assets/retro/job-failed.wav +0 -0
- package/assets/retro/plan-review.wav +0 -0
- package/assets/retro/question.wav +0 -0
- package/assets/soft/approval.wav +0 -0
- package/assets/soft/error.wav +0 -0
- package/assets/soft/finished.wav +0 -0
- package/assets/soft/goal-blocked.wav +0 -0
- package/assets/soft/interrupted.wav +0 -0
- package/assets/soft/job-failed.wav +0 -0
- package/assets/soft/plan-review.wav +0 -0
- package/assets/soft/question.wav +0 -0
- package/assets/wood/approval.wav +0 -0
- package/assets/wood/error.wav +0 -0
- package/assets/wood/finished.wav +0 -0
- package/assets/wood/goal-blocked.wav +0 -0
- package/assets/wood/interrupted.wav +0 -0
- package/assets/wood/job-failed.wav +0 -0
- package/assets/wood/plan-review.wav +0 -0
- package/assets/wood/question.wav +0 -0
- package/client.js +706 -0
- package/cordis.patch.yml +27 -0
- package/icon.svg +4 -0
- package/lib/host.js +1086 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +55 -4
- package/tools/make_sounds.py +265 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dixie_with_heart
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,170 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-notify-chime(提示音)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
回合**完成 / 中断 / 出错 / Agent 提问**时播放音效,可另弹系统通知。
|
|
4
|
+
|
|
5
|
+
| 场景 | kind | 默认音色 |
|
|
6
|
+
| --- | --- | --- |
|
|
7
|
+
| 回合正常结束 | `finished` | 上行三音 |
|
|
8
|
+
| 中断(停止、归档、取消) | `interrupted` | 下行两音 |
|
|
9
|
+
| 出错结束 | `error` | 低频双响 |
|
|
10
|
+
| Agent 提问(等回答) | `question` | 三声高音 |
|
|
11
|
+
| 等待审批(`approval/asked`) | `approval` | 上行双音,稍急 |
|
|
12
|
+
| 计划评审(`exit_plan_mode`) | `plan-review` | 三音上行 |
|
|
13
|
+
| 目标受阻(`goal/change` → `phase: blocked`) | `goal-blocked` | 低频下行 |
|
|
14
|
+
| 后台任务失败(`job/settled` → `failed`) | `job-failed` | 短促双音 |
|
|
15
|
+
|
|
16
|
+
计划评审以前混在「提问」里,1.5.0 起单独分类。目标受阻只在「非 blocked → blocked」那一次跃迁发声;后台任务失败按会话 3 秒窗口去抖,多个任务同时失败只响一次。
|
|
17
|
+
|
|
18
|
+
应用退出、会话分叉、被阻断,以及默认被过滤的 subagent 会话不发声。
|
|
19
|
+
|
|
20
|
+
## 安装
|
|
21
|
+
|
|
22
|
+
```powershell
|
|
23
|
+
dsh plugin add dsh-notify-chime
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
包自带 `cordis.patch.yml`,装完自动插入宿主行。刷新页面后在「设置 → 提示音」里调。
|
|
27
|
+
|
|
28
|
+
## 设置页
|
|
29
|
+
|
|
30
|
+
三组,保存即生效,不重启:
|
|
31
|
+
|
|
32
|
+
| 组 | 内容 |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| 声音 | 总开关、音色、八类事件各自开关与试听、正在看的会话完成时不响、同类事件最小间隔、子会话提醒 |
|
|
35
|
+
| 通知 | 通知总开关、哪些事件弹、标题前缀、正文是否带会话名 |
|
|
36
|
+
| 高级 | 设置文件 / 音效 / 自定义 / 轨迹目录(只读)、恢复默认 |
|
|
37
|
+
|
|
38
|
+
总开关关闭后不发声也不弹通知,事件照常记账,随时能开回来。
|
|
39
|
+
|
|
40
|
+
设置存 `~/.dsh/dsh-notify-chime.json`,只记改过的项。
|
|
41
|
+
|
|
42
|
+
## 音色
|
|
43
|
+
|
|
44
|
+
六套内置,只换音色,不改触发规则:
|
|
45
|
+
|
|
46
|
+
| 套 | 听感 |
|
|
47
|
+
| --- | --- |
|
|
48
|
+
| `default` | 明亮三音,1.0 起的出厂音效 |
|
|
49
|
+
| `soft` | 低八度、慢起音、谐波少,适合安静环境 |
|
|
50
|
+
| `chime` | 长尾泛音,风铃感 |
|
|
51
|
+
| `retro` | 方波短促,8-bit 味 |
|
|
52
|
+
| `digital` | 硬起音脉冲,设备提示音 |
|
|
53
|
+
| `wood` | 低频敲击,不刺耳 |
|
|
54
|
+
|
|
55
|
+
每套保持同一语义:完成上行、中断下行、出错低频双响、提问高音催问。
|
|
56
|
+
|
|
57
|
+
顶部选的是全局默认。某类事件要单配:点该行音色名(默认「跟随全局 ▾」)展开面板选,点「跟随全局」还原。
|
|
58
|
+
|
|
59
|
+
## 自定义音效
|
|
60
|
+
|
|
61
|
+
音色为「自定义」的行会出现「上传」按钮:
|
|
62
|
+
|
|
63
|
+
- 支持 **WAV / MP3 / M4A / AAC**,单文件 ≤ 5 MB;WAV 走 `SoundPlayer`,其它走 WPF `MediaPlayer`(借系统解码器)
|
|
64
|
+
- 存 `~/.dsh/dsh-notify-chime-sounds/<kind>.wav`,卸载插件不丢
|
|
65
|
+
- 上传后该行切到「自定义」,其它事件的音色不变;没传的类仍用内置音效
|
|
66
|
+
- 上传即生效,可直接点「试听」确认
|
|
67
|
+
|
|
68
|
+
## 配置初值
|
|
69
|
+
|
|
70
|
+
`cordis.patch.yml` 的 `config` 只是初值;设置页保存过的项以设置文件为准。
|
|
71
|
+
|
|
72
|
+
```yaml
|
|
73
|
+
- id: dsh-notify-chime
|
|
74
|
+
config:
|
|
75
|
+
enabled: true
|
|
76
|
+
soundset: default
|
|
77
|
+
minIntervalMs: 700
|
|
78
|
+
includeSubagents: false
|
|
79
|
+
kinds:
|
|
80
|
+
finished: true
|
|
81
|
+
interrupted: true
|
|
82
|
+
error: true
|
|
83
|
+
question: true
|
|
84
|
+
approval: true
|
|
85
|
+
plan-review: true
|
|
86
|
+
goal-blocked: true
|
|
87
|
+
job-failed: true
|
|
88
|
+
toast: { enabled: true, kinds: [question], includeSession: true }
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
| 字段 | 默认 | 说明 |
|
|
92
|
+
| --- | --- | --- |
|
|
93
|
+
| `enabled` | `true` | 总开关初值。`false` 时插件照常加载,设置页仍可用 |
|
|
94
|
+
| `soundset` | `default` | 全局音色:`default` / `soft` / `chime` / `retro` / `digital` / `wood` / `custom` |
|
|
95
|
+
| `minIntervalMs` | `700` | 同类事件最小间隔,防连响 |
|
|
96
|
+
| `includeSubagents` | `false` | 是否也为子会话发声 |
|
|
97
|
+
| `quietCurrent` | `false` | 正在查看的那个会话完成时不发声(只影响完成,审批/提问/出错照响) |
|
|
98
|
+
| `kinds.<kind>` | `true` | 该类事件是否发声 |
|
|
99
|
+
| `sounds.<kind>` | 内置 wav | 单类音效路径;`false` 或 `null` 表示不响 |
|
|
100
|
+
| `player` | `auto` | `auto` / `powershell` / `pwsh` / `wpf` / `none` / 播放器路径。`auto` 时 wav 用 `SoundPlayer`、其它格式用 WPF `MediaPlayer` |
|
|
101
|
+
| `questionTools` | `["ask_user_question"]` | 只决定谁触发 `question` 音。`exit_plan_mode` 固定归 `plan-review`,想静音它请关 `kinds.plan-review` |
|
|
102
|
+
| `toast.enabled` | `false` | 是否弹系统通知(本包初值为 `true`) |
|
|
103
|
+
| `toast.kinds` | `null` | 只对哪些 kind 弹,`null` 为全部 |
|
|
104
|
+
| `toast.title` | `DeepSeek Harness` | 通知标题前缀,最长 60 字符 |
|
|
105
|
+
| `toast.includeSession` | `true` | 正文附带会话标题 |
|
|
106
|
+
| `toast.appId` | `com.deepseek.dsh` | Windows AppUserModelID,须为已注册 ID |
|
|
107
|
+
| `traceFile` | `null` | 调试用,每次触发追加一行 JSON |
|
|
108
|
+
|
|
109
|
+
相对路径按插件目录解析,未知字段直接报错。
|
|
110
|
+
|
|
111
|
+
单类音效也可以在 patch 里写死:
|
|
112
|
+
|
|
113
|
+
```yaml
|
|
114
|
+
- id: dsh-notify-chime
|
|
115
|
+
config:
|
|
116
|
+
sounds:
|
|
117
|
+
finished: C:/Windows/Media/Windows Print complete.wav
|
|
118
|
+
error: false
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## 系统通知
|
|
122
|
+
|
|
123
|
+
Windows 走 WinRT Toast,macOS 用 `osascript`,Linux 用 `notify-send`。
|
|
124
|
+
|
|
125
|
+
`appId` 必须是系统已注册的 AppUserModelID,否则只进通知中心、不弹横幅。默认 `com.deepseek.dsh` 是 DSH 桌面版注册的 ID。
|
|
126
|
+
|
|
127
|
+
进了通知中心却没横幅时:
|
|
128
|
+
|
|
129
|
+
```powershell
|
|
130
|
+
python tools/check-notifications.py 6
|
|
131
|
+
Get-ChildItem "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings" | Where-Object PSChildName -match "deepseek"
|
|
132
|
+
node tools/try.mjs toast
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
再查系统「设置 → 系统 → 通知」里该来源的开关与勿扰模式。
|
|
136
|
+
|
|
137
|
+
## 调试
|
|
138
|
+
|
|
139
|
+
```powershell
|
|
140
|
+
node tools/try.mjs all # 试听四种音效
|
|
141
|
+
node tools/try.mjs toast # 试弹通知
|
|
142
|
+
node tools/smoke-test.mjs # 契约冒烟,临时目录里跑,不碰真实设置、不发声
|
|
143
|
+
node tools/smoke-test.mjs --verbose
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
查「刚才到底响没响」:patch 里给 `traceFile` 指个路径,每次触发追加一行 JSON。默认不配就不落文件。
|
|
147
|
+
|
|
148
|
+
## 停用
|
|
149
|
+
|
|
150
|
+
- 暂停:设置页总开关,插件照常加载。
|
|
151
|
+
- 卸载:`dsh plugin remove dsh-notify-chime`,设置文件可留可删。
|
|
152
|
+
|
|
153
|
+
## 限制
|
|
154
|
+
|
|
155
|
+
- 监听会话日志的追加流,冷启动打开历史会话不补响。
|
|
156
|
+
- 每次提醒 spawn 独立子进程播放,不阻塞 Host。PowerShell 冷启动约 200 ms,延迟约 0.3 s。
|
|
157
|
+
- 无音量调节,跟随系统默认播放设备;默认设备是虚拟声卡时人耳可能听不到。
|
|
158
|
+
- 自定义音效支持 WAV / MP3 / M4A / AAC;WMA、FLAC 不支持(系统虽有解码器,但没有接)。
|
|
159
|
+
- 目录:`lib/`(宿主)、`client.js`(设置页)、`assets/`(音效)、`tools/`(脚本)。
|
|
160
|
+
|
|
161
|
+
## 音效来源
|
|
162
|
+
|
|
163
|
+
`assets/` 下全部 WAV 由 `tools/make_sounds.py` 合成(正弦叠加 + 指数包络),无第三方采样素材,随包以 MIT 分发。
|
|
164
|
+
|
|
165
|
+
```powershell
|
|
166
|
+
python tools/make_sounds.py # 全部重生成
|
|
167
|
+
python tools/make_sounds.py chime # 只重生成一套
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
`default` 套的合成参数与浮点运算顺序保持不变,重跑后哈希不变。
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/assets/error.wav
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|