dsh-notify-chime 0.0.0-stage → 1.4.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 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,155 @@
1
- # Temporary Holding Version
1
+ # dsh-notify-chime(提示音)
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 回合**完成 / 中断 / 出错 / Agent 提问**时播放音效,可另弹系统通知。
4
+
5
+ | 场景 | kind | 默认音色 |
6
+ | --- | --- | --- |
7
+ | 回合正常结束 | `finished` | 上行三音 |
8
+ | 中断(停止、归档、取消) | `interrupted` | 下行两音 |
9
+ | 出错结束 | `error` | 低频双响 |
10
+ | Agent 提问(等回答 / 等批计划) | `question` | 三声高音 |
11
+
12
+ 应用退出、会话分叉、被阻断,以及默认被过滤的 subagent 会话不发声。
13
+
14
+ ## 安装
15
+
16
+ ```powershell
17
+ dsh plugin add dsh-notify-chime
18
+ ```
19
+
20
+ 包自带 `cordis.patch.yml`,装完自动插入宿主行。刷新页面后在「设置 → 提示音」里调。
21
+
22
+ ## 设置页
23
+
24
+ 三组,保存即生效,不重启:
25
+
26
+ | 组 | 内容 |
27
+ | --- | --- |
28
+ | 声音 | 总开关、音色、四类事件各自开关与试听、最小间隔、子会话提醒 |
29
+ | 通知 | 通知总开关、哪些事件弹、标题前缀、正文是否带会话名 |
30
+ | 高级 | 设置文件 / 音效 / 自定义 / 轨迹目录(只读)、恢复默认 |
31
+
32
+ 总开关关闭后不发声也不弹通知,事件照常记账,随时能开回来。
33
+
34
+ 设置存 `~/.dsh/dsh-notify-chime.json`,只记改过的项。
35
+
36
+ ## 音色
37
+
38
+ 六套内置,只换音色,不改触发规则:
39
+
40
+ | 套 | 听感 |
41
+ | --- | --- |
42
+ | `default` | 明亮三音,1.0 起的出厂音效 |
43
+ | `soft` | 低八度、慢起音、谐波少,适合安静环境 |
44
+ | `chime` | 长尾泛音,风铃感 |
45
+ | `retro` | 方波短促,8-bit 味 |
46
+ | `digital` | 硬起音脉冲,设备提示音 |
47
+ | `wood` | 低频敲击,不刺耳 |
48
+
49
+ 每套保持同一语义:完成上行、中断下行、出错低频双响、提问高音催问。
50
+
51
+ 顶部选的是全局默认。某类事件要单配:点该行音色名(默认「跟随全局 ▾」)展开面板选,点「跟随全局」还原。
52
+
53
+ ## 自定义音效
54
+
55
+ 音色为「自定义」的行会出现「上传」按钮:
56
+
57
+ - 只收 WAV(`System.Media.SoundPlayer` 的限制),单文件 ≤ 5 MB
58
+ - 存 `~/.dsh/dsh-notify-chime-sounds/<kind>.wav`,卸载插件不丢
59
+ - 上传后该行切到「自定义」,其它事件的音色不变;没传的类仍用内置音效
60
+ - 上传即生效,可直接点「试听」确认
61
+
62
+ ## 配置初值
63
+
64
+ `cordis.patch.yml` 的 `config` 只是初值;设置页保存过的项以设置文件为准。
65
+
66
+ ```yaml
67
+ - id: dsh-notify-chime
68
+ config:
69
+ enabled: true
70
+ soundset: default
71
+ minIntervalMs: 700
72
+ includeSubagents: false
73
+ kinds: { finished: true, interrupted: true, error: true, question: true }
74
+ toast: { enabled: true, kinds: [question], includeSession: true }
75
+ ```
76
+
77
+ | 字段 | 默认 | 说明 |
78
+ | --- | --- | --- |
79
+ | `enabled` | `true` | 总开关初值。`false` 时插件照常加载,设置页仍可用 |
80
+ | `soundset` | `default` | 全局音色:`default` / `soft` / `chime` / `retro` / `digital` / `wood` / `custom` |
81
+ | `minIntervalMs` | `700` | 同类事件最小间隔,防连响 |
82
+ | `includeSubagents` | `false` | 是否也为子会话发声 |
83
+ | `kinds.<kind>` | `true` | 该类事件是否发声 |
84
+ | `sounds.<kind>` | 内置 wav | 单类音效路径;`false` 或 `null` 表示不响 |
85
+ | `player` | `auto` | `auto` / `powershell` / `pwsh` / `none` / 播放器路径 |
86
+ | `questionTools` | `["ask_user_question", "exit_plan_mode"]` | 视为提问的工具名 |
87
+ | `toast.enabled` | `false` | 是否弹系统通知(本包初值为 `true`) |
88
+ | `toast.kinds` | `null` | 只对哪些 kind 弹,`null` 为全部 |
89
+ | `toast.title` | `DeepSeek Harness` | 通知标题前缀,最长 60 字符 |
90
+ | `toast.includeSession` | `true` | 正文附带会话标题 |
91
+ | `toast.appId` | `com.deepseek.dsh` | Windows AppUserModelID,须为已注册 ID |
92
+ | `traceFile` | `null` | 调试用,每次触发追加一行 JSON |
93
+
94
+ 相对路径按插件目录解析,未知字段直接报错。
95
+
96
+ 单类音效也可以在 patch 里写死:
97
+
98
+ ```yaml
99
+ - id: dsh-notify-chime
100
+ config:
101
+ sounds:
102
+ finished: C:/Windows/Media/Windows Print complete.wav
103
+ error: false
104
+ ```
105
+
106
+ ## 系统通知
107
+
108
+ Windows 走 WinRT Toast,macOS 用 `osascript`,Linux 用 `notify-send`。
109
+
110
+ `appId` 必须是系统已注册的 AppUserModelID,否则只进通知中心、不弹横幅。默认 `com.deepseek.dsh` 是 DSH 桌面版注册的 ID。
111
+
112
+ 进了通知中心却没横幅时:
113
+
114
+ ```powershell
115
+ python tools/check-notifications.py 6
116
+ Get-ChildItem "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings" | Where-Object PSChildName -match "deepseek"
117
+ node tools/try.mjs toast
118
+ ```
119
+
120
+ 再查系统「设置 → 系统 → 通知」里该来源的开关与勿扰模式。
121
+
122
+ ## 调试
123
+
124
+ ```powershell
125
+ node tools/try.mjs all # 试听四种音效
126
+ node tools/try.mjs toast # 试弹通知
127
+ node tools/smoke-test.mjs # 契约冒烟,临时目录里跑,不碰真实设置、不发声
128
+ node tools/smoke-test.mjs --verbose
129
+ ```
130
+
131
+ 查「刚才到底响没响」:patch 里给 `traceFile` 指个路径,每次触发追加一行 JSON。默认不配就不落文件。
132
+
133
+ ## 停用
134
+
135
+ - 暂停:设置页总开关,插件照常加载。
136
+ - 卸载:`dsh plugin remove dsh-notify-chime`,设置文件可留可删。
137
+
138
+ ## 限制
139
+
140
+ - 监听会话日志的追加流,冷启动打开历史会话不补响。
141
+ - 每次提醒 spawn 独立子进程播放,不阻塞 Host。PowerShell 冷启动约 200 ms,延迟约 0.3 s。
142
+ - 无音量调节,跟随系统默认播放设备;默认设备是虚拟声卡时人耳可能听不到。
143
+ - 自定义音效只支持 WAV,不支持 mp3 / flac。
144
+ - 目录:`lib/`(宿主)、`client.js`(设置页)、`assets/`(音效)、`tools/`(脚本)。
145
+
146
+ ## 音效来源
147
+
148
+ `assets/` 下全部 WAV 由 `tools/make_sounds.py` 合成(正弦叠加 + 指数包络),无第三方采样素材,随包以 MIT 分发。
149
+
150
+ ```powershell
151
+ python tools/make_sounds.py # 全部重生成
152
+ python tools/make_sounds.py chime # 只重生成一套
153
+ ```
154
+
155
+ `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
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file