dsh-plugin-notify-sounds 0.0.0-stage → 1.5.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 +162 -3
- package/README.zh.md +162 -0
- package/cordis.patch.yml +12 -0
- package/lib/client.js +2035 -0
- package/lib/index.js +521 -0
- package/package.json +62 -6
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 BillCx330
|
|
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,162 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# dsh-plugin-notify-sounds
|
|
2
|
+
|
|
3
|
+
[](LICENSE)
|
|
4
|
+
[](https://github.com/deepseek-ai/deepseek-harness)
|
|
5
|
+
|
|
6
|
+
English | [中文](README.zh.md)
|
|
7
|
+
|
|
8
|
+
**A soft chime when the agent is waiting for you — or when it is done.**
|
|
9
|
+
|
|
10
|
+
Walk away from the window without missing anything: an OS notification in the background (**click it to jump back**), and a "Waiting for you" / "Finished" mark on the taskbar title. Once you have seen it, the plugin goes quiet — it will not nag you like an alarm clock.
|
|
11
|
+
|
|
12
|
+
**Install**: DSH → Settings → Plugins → Add plugin, paste the line below and press **Install**:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
https://github.com/BillCx330/dsh-plugin-notify-sounds
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## What it does
|
|
21
|
+
|
|
22
|
+
| What | What you get |
|
|
23
|
+
|---|---|
|
|
24
|
+
| **Your decision is needed** | A chime when the agent raises an approval, a plan review, or a question — separate sounds for approvals and questions |
|
|
25
|
+
| **Task finished** | A chime when a session goes from running to idle |
|
|
26
|
+
| **Aware even when you are away** | An OS notification in the background (body is the approval reason or the question itself; **click to return to the window**) plus a taskbar title mark |
|
|
27
|
+
| **Missed it? It reminds again** | Unanswered decisions re-ping every 1/5/15/30 minutes — and **stop for good once you have seen them**, even if you switch away again |
|
|
28
|
+
| **Only what you care about** | Sub-agents (background tasks) are completely silent by default — only your own conversation is announced |
|
|
29
|
+
| **Quiet when it should be** | Quiet hours (e.g. 22:00–08:00, wrapping past midnight), notify-only-when-hidden, and a master switch |
|
|
30
|
+
| **Your sound, your way** | Nine built-in sounds, custom ringtone upload, volume — each feature with its own toggle |
|
|
31
|
+
|
|
32
|
+
## Why
|
|
33
|
+
|
|
34
|
+
DSH tells you things visually — status dots, sidebar marks. The moment you switch to another window, you can neither see nor hear anything, while the agent may be stuck waiting for one sentence from you.
|
|
35
|
+
|
|
36
|
+
This plugin turns "it is waiting for you" and "it is done" into sound. With system notifications and the title mark you know what happened even while away; and once you come back and see it, it goes quiet — the repeat reminder only chases decisions you have **never** seen.
|
|
37
|
+
|
|
38
|
+
## Sounds
|
|
39
|
+
|
|
40
|
+
Nine Web Audio synthesized sounds — no audio files, no network requests:
|
|
41
|
+
|
|
42
|
+
Bell · Chime · Ding · Drop · Pulse · Arc · Coin · Success · Knock
|
|
43
|
+
|
|
44
|
+
Or upload your own ringtone (mp3/wav/ogg, ≤512KB, validated and volume-normalized automatically), or pick "None" for notifications only. Each trigger (approval / question / completion) can use a different sound, with preview right in the settings.
|
|
45
|
+
|
|
46
|
+
## Settings
|
|
47
|
+
|
|
48
|
+
Settings → **Sounds** (between General and Models). Every feature has its own toggle, styled exactly like DSH's own preference pages:
|
|
49
|
+
|
|
50
|
+
master switch and volume · per-trigger sounds with preview · sub-agent alerts · system notifications · window title alert · repeat interval · quiet hours · hidden-only mode · custom ringtone upload
|
|
51
|
+
|
|
52
|
+
Everything applies immediately — no restart needed.
|
|
53
|
+
|
|
54
|
+
## Install
|
|
55
|
+
|
|
56
|
+
### Simplest: two clicks inside DSH (recommended)
|
|
57
|
+
|
|
58
|
+
1. In DSH open **Settings → Plugins** and press **Add plugin**;
|
|
59
|
+
2. Paste this into the box:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
https://github.com/BillCx330/dsh-plugin-notify-sounds
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
(that is the "GitHub repository address" the box asks for; `github:BillCx330/dsh-plugin-notify-sounds` or a local directory path work too)
|
|
66
|
+
3. Press **Install**, then **restart DSH** once.
|
|
67
|
+
|
|
68
|
+
The "install source" dropdown above the box picks the download mirror (mainland China mirror by default; leave it alone unless downloads are slow). DSH warns that a plugin runs with your permissions — this one only reads session state and plays sounds locally; its single request goes to **your own DSH** to raise the window when you click a notification, and nothing is sent anywhere else.
|
|
69
|
+
|
|
70
|
+
### Upgrading
|
|
71
|
+
|
|
72
|
+
**There is no auto-update**: to upgrade, **uninstall** the old version from the same place first, then install the new one as above.
|
|
73
|
+
|
|
74
|
+
### Other ways
|
|
75
|
+
|
|
76
|
+
**Command line** — one command against the profile you actually use:
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
dsh plugin --profile <your profile> add github:BillCx330/dsh-plugin-notify-sounds
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Release archive** — download the `.tgz` from [Releases](https://github.com/BillCx330/dsh-plugin-notify-sounds/releases) and hand it to `dsh plugin add`.
|
|
83
|
+
|
|
84
|
+
**Local directory** — for development or trying unreleased changes:
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
dsh plugin --profile <your profile> add ./dsh-plugin-notify-sounds
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**By hand** — add `"dsh-plugin-notify-sounds": "github:BillCx330/dsh-plugin-notify-sounds"` to `dependencies` in the profile's `package.json`, append `"dsh-plugin-notify-sounds"` to `dsh.profile.bundles`, then run a package install (e.g. `pnpm install`) in the profile directory so the dependency lands in `node_modules`.
|
|
91
|
+
|
|
92
|
+
The command line writes `dsh.profile.bundles` and installs the dependency for you. The package ships prebuilt artifacts and declares no lifecycle scripts, so nothing is built at install time. **Restart DSH** after installing (everyday upgrades that touch only the client half hot-reload).
|
|
93
|
+
|
|
94
|
+
## Known limitations
|
|
95
|
+
|
|
96
|
+
- **Hand-edited config**: preferences live in the profile's `cordis.patch.yml`; values must match the schema (volume 0–100, a preset id, `HH:MM` times) or the plugin declines to load — just fix the value. The settings UI only ever writes valid values.
|
|
97
|
+
- **Multiple windows** fire independently: the same event may chime once per window; turn on notify-only-when-hidden to avoid it.
|
|
98
|
+
- **Quiet hours hold reminders, they do not drop them**: a repeat reminder that becomes due during the quiet range fires right after it ends, and several pending decisions can fire at once then.
|
|
99
|
+
- **Click-to-return** is fully implemented and tested on Windows; macOS / Linux fall back to the system deep link and are unverified.
|
|
100
|
+
- **The window is found by its title** — deliberately without inspecting other processes (that trips security software). If DSH ever changes its title format, click-to-return silently stops working; sounds and notifications are unaffected.
|
|
101
|
+
- **The nav glyph** depends on the settings panel's DOM structure and silently falls back to the official gear after a DSH redesign — cosmetic only.
|
|
102
|
+
- **Notification permission** is granted on the Desktop; under restrictive policies the row shows how to allow it manually, everything else keeps working.
|
|
103
|
+
- **Upgrading from v1.0.0**: since v1.1.0 approvals and questions are separate tracks, so questions default to "Chime" instead of "Bell" — change it back in settings if you prefer.
|
|
104
|
+
|
|
105
|
+
## Design notes
|
|
106
|
+
|
|
107
|
+
For anyone hacking on the code (exact details live in the source comments):
|
|
108
|
+
|
|
109
|
+
- **Triggers never touch the event waterfall**: approval/question requests are waterfall events that a late listener can miss, so this plugin reads `uiSession.sessionStatus` (the same aggregated pending/running facts the sidebar status dots use) and just observes.
|
|
110
|
+
- **Repeat cadence**: unanswered decisions are checked every 15s; **seen means done** — appearing while you are at the window, or coming back to it, ends the reminders for good (switching away does not re-arm); a new question replacing an old one resets the timer.
|
|
111
|
+
- **Click-to-return**: a renderer cannot raise an OS window, so a click POSTs to the Host's fenced `/notify-sounds/focus` route and the Host raises it. On Windows the Host calls `user32.dll` through DSH's own bundled `koffi` (no new dependency, window calls only, no PowerShell — that shape trips security software and gets blamed on DSH); Desktop vs browser is derived from the `Origin` header, so a browser click never drags the Desktop window forward.
|
|
112
|
+
- **Notification collapsing**: the `tag` is not handed to the platform (a superseded toast swallows clicks aimed at it); the plugin closes the old notification itself and holds every generation's object so a late click always has a handler.
|
|
113
|
+
- **Title mark**: prefix add/remove only, so DSH's own title management is untouched; the written prefix is remembered verbatim, so a language switch neither stacks nor leaks it. "Finished" is unread news — set by a finish that happens while the page is hidden, retired when you return — not a standing idle fact, so it does not reappear on every later switch-away.
|
|
114
|
+
- **Cooldown and robustness**: the same trigger does not fire twice within 2s for the same session (a second conversation's decision still rings); volume is guarded with `Number.isFinite` (a hand-edited `.nan` falls back to the default); a refused write snaps the control back and shows an error row; toggles disable mid-write against double-tap races.
|
|
115
|
+
- **The volume slider** is uncontrolled: dragging paints one CSS custom property and only the release commits, so it never stutters or snaps back.
|
|
116
|
+
- **Theme and layout**: `--dsw-alias-*` tokens throughout, section and row geometry copied from the official preference pages; sound pickers use the official `Menu` dropdown so nothing scrolls sideways.
|
|
117
|
+
|
|
118
|
+
## Changelog
|
|
119
|
+
|
|
120
|
+
- **v1.5.0** (2026-10-08) The "finished" title mark is unread news now — set by a finish that happens while you are away, cleared when you return — instead of reappearing on every switch-away. The retrigger cooldown is per session, so two conversations deciding within 2 seconds both ring. The Host half gained tests (Config schema, focus route, title matching) that cross-check the shared constants between the halves; the sessions provider is now an explicit load prerequisite, and quiet-hours catch-up is documented.
|
|
121
|
+
|
|
122
|
+
- **v1.4.4** (2026-10-08) Quiet hours now suppress the taskbar title alert too, and the title refreshes as the quiet-hours window begins or ends. Custom-sound upload/removal writes are ordered and roll back on refusal; synchronous config-write errors are handled as save failures.
|
|
123
|
+
- **v1.4.3** (2026-10-08) Three fixes: an upload is no longer accepted when the environment cannot decode audio (it could never play anyway); a synchronous throw from the notification-permission request is handled like a denial instead of escaping; quiet hours only accept valid `HH:MM`, and a throwing native window raise now falls through to the deep-link fallback. Plus two regression tests and a decode-error message that names both causes.
|
|
124
|
+
- **v1.4.2** (2026-10-07) Clean release point: the `v1.4.1` tag was re-pinned during publishing, so this republishes under a tag downstream can trust. No behaviour change.
|
|
125
|
+
- **v1.4.1** (2026-10-07) Removed the "could not raise the window" notice — it misfired even when the window came back, and success is its own feedback; a notification click is now fully silent. Also: the READMEs are rewritten as a release page.
|
|
126
|
+
- **v1.4.0** (2026-10-07) Seen once, never repeated; fixed notification clicks doing nothing (root cause: platform `tag` replacement swallowing the click); new **Sub-agent alerts** toggle; plus five smaller fixes.
|
|
127
|
+
- **v1.3.3** (2026-10-07) Repeat reminders no longer interrupt you while you are looking at the window; the title alert uses words.
|
|
128
|
+
- **v1.3.2** (2026-10-05) Fixes from two code reviews: malformed base64 aborting the tracker, notification objects collected, repeat pings eating the cooldown, backwards clock muting, `titleFlash` applying immediately.
|
|
129
|
+
- **v1.3.1** (2026-10-05) Fixed the intermittent window raise (Windows foreground lock).
|
|
130
|
+
- **v1.3.0** (2026-10-05) The raise runs in-process over FFI; Desktop vs browser derived automatically.
|
|
131
|
+
- **v1.2.1** (2026-10-05) Fixed the click doing nothing.
|
|
132
|
+
- **v1.2.0** (2026-10-05) Added the Host focus route (clicks did not work in this release; fixed in v1.3.x).
|
|
133
|
+
- **v1.1.2** (2026-10-05) Fixed blank dropdown rows.
|
|
134
|
+
- **v1.1.1** (2026-10-05) Layout and copy fixes.
|
|
135
|
+
- **v1.1.0** (2026-10-05) Custom ringtones, system notifications, per-trigger sounds, repeat reminders, quiet hours, three new sounds.
|
|
136
|
+
- **v1.0.0** (2026-10-04) Initial release.
|
|
137
|
+
|
|
138
|
+
## Development
|
|
139
|
+
|
|
140
|
+
```powershell
|
|
141
|
+
npm install # once: the Host tests need the schemastery devDependency
|
|
142
|
+
node test/smoke.mjs # client half: assembly, triggers, cooldown, quiet hours, repeat reminders, notification clicks, sub-agent filtering
|
|
143
|
+
node test/host.mjs # host half: config schema, focus route, title matching, cross-half contracts
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
dsh-plugin-notify-sounds/
|
|
148
|
+
├── package.json # dsh.bundle.patch + dsh.client
|
|
149
|
+
├── cordis.patch.yml # Loader row: id: notify-sounds
|
|
150
|
+
├── lib/
|
|
151
|
+
│ ├── index.js # Host half: config schema + click-to-return route
|
|
152
|
+
│ └── client.js # Client half: sound engine, status watcher, settings section
|
|
153
|
+
└── test/
|
|
154
|
+
├── smoke.mjs # client half
|
|
155
|
+
└── host.mjs # host half
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
`package.json` is publishable as-is (`files` carries runtime artifacts only, `@deepseek-ai/schemastery` is a peerDependency plus a devDependency copy for the Host tests, pure ESM with no build step) — `npm publish` whenever you want it on npm.
|
|
159
|
+
|
|
160
|
+
## License
|
|
161
|
+
|
|
162
|
+
[MIT](LICENSE) © BillCx330
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# dsh-plugin-notify-sounds
|
|
2
|
+
|
|
3
|
+
[](LICENSE)
|
|
4
|
+
[](https://github.com/deepseek-ai/deepseek-harness)
|
|
5
|
+
|
|
6
|
+
[English](README.md) | 中文
|
|
7
|
+
|
|
8
|
+
**智能体在等你、或干完活时,轻轻响一声。**
|
|
9
|
+
|
|
10
|
+
人不在窗口前也不怕:后台弹系统通知(**点击即回到窗口**),任务栏标题亮出「待处理 / 已完成」;你回来看过一眼之后,它就闭嘴——不会像闹钟一样反复催你。
|
|
11
|
+
|
|
12
|
+
**安装**:DSH → 设置 → 插件 → 添加插件,粘贴下面这行,点「安装」:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
https://github.com/BillCx330/dsh-plugin-notify-sounds
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 它做什么
|
|
21
|
+
|
|
22
|
+
| 提醒什么 | 效果 |
|
|
23
|
+
|---|---|
|
|
24
|
+
| **需要你决策** | 智能体发起审批、计划确认、提问时提示音;审批与提问可分别设音效 |
|
|
25
|
+
| **任务完成** | 会话由运行转为空闲时提示音 |
|
|
26
|
+
| **人不在窗口前也能感知** | 后台弹系统通知(正文就是审批理由或提问原文,点击回到窗口);任务栏标题显示「待处理 / 已完成」 |
|
|
27
|
+
| **没看到会再提醒** | 未处理决策按 1/5/15/30 分钟重复提醒;**你看过一眼就永久停止**,切走也不再来 |
|
|
28
|
+
| **只提醒你关心的** | 子智能体(后台任务)默认完全静默,只提醒主对话,可开关 |
|
|
29
|
+
| **该安静时安静** | 静音时段(如 22:00–08:00,可跨午夜)、仅页面不可见时提示、总开关一键全静音 |
|
|
30
|
+
| **声音随你** | 九种内置音效、自定义铃声上传、音量调节,每项独立开关 |
|
|
31
|
+
|
|
32
|
+
## 为什么需要它
|
|
33
|
+
|
|
34
|
+
DSH 的状态提示只有视觉——状态点、侧栏标记。你一切到别的窗口,就既看不到也听不到,智能体却可能正卡在那里等你一句话。
|
|
35
|
+
|
|
36
|
+
这个插件把「在等你」和「干完了」变成声音。配合系统通知与标题标记,人走开也知道发生了什么;而你回来处理过之后它就安静——重复提醒也只针对你**从没看过**的决策。
|
|
37
|
+
|
|
38
|
+
## 声音
|
|
39
|
+
|
|
40
|
+
九种 Web Audio 合成音效,不含任何音频文件、不发网络请求:
|
|
41
|
+
|
|
42
|
+
双音铃 · 风铃 · 单音叮 · 水滴 · 脉冲 · 上行琶音 · 金币 · 达成 · 敲门
|
|
43
|
+
|
|
44
|
+
另可上传自己的铃声(mp3/wav/ogg,≤512KB,自动校验与音量归一化),或选「无声」只留通知。三种触发(审批 / 提问 / 完成)可各选各的音效,设置里直接试听。
|
|
45
|
+
|
|
46
|
+
## 设置
|
|
47
|
+
|
|
48
|
+
设置 → **提示音**(位于「通用设置」与「模型」之间),每项功能都有独立开关,界面与 DSH 原生设置完全一致:
|
|
49
|
+
|
|
50
|
+
总开关与音量 · 三种触发各自的音效(含试听)· 子智能体提醒 · 系统通知 · 窗口标题提醒 · 重复提醒间隔 · 静音时段 · 仅后台提示 · 自定义铃声上传
|
|
51
|
+
|
|
52
|
+
改动即时生效,无需重启。
|
|
53
|
+
|
|
54
|
+
## 安装
|
|
55
|
+
|
|
56
|
+
### 最简单:在 DSH 里点两下(推荐)
|
|
57
|
+
|
|
58
|
+
1. 打开 DSH → **设置 → 插件**,点**添加插件**;
|
|
59
|
+
2. 在输入框粘贴:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
https://github.com/BillCx330/dsh-plugin-notify-sounds
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
(粘贴的就是「GitHub 仓库地址」;填 `github:BillCx330/dsh-plugin-notify-sounds` 或本地目录路径也可以)
|
|
66
|
+
3. 点**安装**,装完**重启 DSH** 一次。
|
|
67
|
+
|
|
68
|
+
输入框上方的「安装源」是下载源,默认中国大陆镜像源,国内一般不用改。DSH 会提示「插件以你的权限运行」——本插件只读会话状态、在本地发声;唯一的请求是点击系统通知时发给**本机 DSH** 的唤窗请求,不向外部发送任何数据。
|
|
69
|
+
|
|
70
|
+
### 升级
|
|
71
|
+
|
|
72
|
+
**装完不支持自动更新**:要升级请先在同一处**卸载**旧版,再按上面的步骤装新版。
|
|
73
|
+
|
|
74
|
+
### 其他安装方式
|
|
75
|
+
|
|
76
|
+
**命令行** —— 对你实际使用的 profile 一条命令:
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
dsh plugin --profile <你的 profile> add github:BillCx330/dsh-plugin-notify-sounds
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Release 压缩包** —— 从 [Releases](https://github.com/BillCx330/dsh-plugin-notify-sounds/releases) 下载 `.tgz`,交给 `dsh plugin add`。
|
|
83
|
+
|
|
84
|
+
**本地目录** —— 开发或试用未发布的改动:
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
dsh plugin --profile <你的 profile> add ./dsh-plugin-notify-sounds
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**手工编辑** —— 在 profile 的 `package.json` 的 `dependencies` 加 `"dsh-plugin-notify-sounds": "github:BillCx330/dsh-plugin-notify-sounds"`,在 `dsh.profile.bundles` 追加 `"dsh-plugin-notify-sounds"`,然后在 profile 目录跑一次包安装(如 `pnpm install`)把依赖装进 `node_modules`。
|
|
91
|
+
|
|
92
|
+
命令行方式会自动写入 `dsh.profile.bundles` 并装好依赖,无需手工编辑。包内直接带预构建产物、不声明任何生命周期脚本,安装过程不执行构建脚本。安装后**重启 DSH**(日常升级仅客户端改动时,可热更生效)。
|
|
93
|
+
|
|
94
|
+
## 已知边界
|
|
95
|
+
|
|
96
|
+
- **手改配置**:偏好写在 profile 的 `cordis.patch.yml`,值必须符合 schema(音量 0–100、音效为预设之一、时间 `HH:MM`);写错会让插件不加载,改回即可。设置界面只会写入合法值。
|
|
97
|
+
- **多窗口**:各窗口独立触发,同一事件可能各响一次;打开「仅在页面不可见时提示」即可避免。
|
|
98
|
+
- **静音时段是「挂起」不是「丢弃」**:静音期间到期的重复提醒会在时段结束后立即补发,多个待决策可能同时补响。
|
|
99
|
+
- **点击通知回到窗口**:Windows 完整实现并实测;macOS / Linux 走系统深链,未验证。
|
|
100
|
+
- **唤窗按窗口标题定位主窗口**:刻意不读取其他进程信息(那会触发杀软主动防御)。若将来 DSH 改变标题格式,唤窗会静默失效——提示音与通知本身不受影响。
|
|
101
|
+
- **导航小图标**:依赖设置面板的 DOM 结构,DSH 改版后自动回落为官方齿轮,仅影响外观。
|
|
102
|
+
- **通知权限**:桌面端放行;受限环境(某些浏览器策略)下被拒时,行内会引导手动允许,其余功能不受影响。
|
|
103
|
+
- **从 v1.0.0 升级**:v1.1.0 起提问与审批分轨,提问默认音效从「双音铃」变为「风铃」,如需保持一致可在设置里改回。
|
|
104
|
+
|
|
105
|
+
## 设计与实现
|
|
106
|
+
|
|
107
|
+
给想改代码的人看的要点(实现细节以源码注释为准):
|
|
108
|
+
|
|
109
|
+
- **触发不碰事件瀑布**:审批/提问的请求是 waterfall 事件,UI 应答后晚注册的监听器收不到。本插件改读 `uiSession.sessionStatus`(DSH 自己聚合的 pending/running 事实,与侧栏状态点同源),纯观察、零侵入。
|
|
110
|
+
- **重复提醒的节拍**:15 秒粒度检查未处理决策;**看过即除名**(决策出现时你正在窗口、或之后回到窗口,都算看过),切走不重新武装;新问题替换旧问题会重置计时。
|
|
111
|
+
- **通知点击回到窗口**:渲染进程唤不起 OS 窗口,点击时 POST 到宿主半边的 `/notify-sounds/focus`(带 connection 围栏),由宿主唤起。Windows 用 DSH 自带的 `koffi` 直接调 `user32.dll`(不引新依赖、只操作窗口、不启动 PowerShell——那会触发杀软主动防御并归因到 DSH);桌面端/浏览器端按 `Origin` 头自动区分,浏览器端不误唤桌面窗口。
|
|
112
|
+
- **通知折叠**:不把 `tag` 交给平台(平台替换旧通知时会吞掉指向它的点击),由插件自己关旧发新,并持有每一代通知对象的引用,避免点击回调被回收成死按钮。
|
|
113
|
+
- **标题标记**:只做前缀加/删,与 DSH 自身的标题管理互不干扰;前缀按实际写入的文字记录,语言切换不叠加、不残留。「已完成」是未读消息——离开期间发生的完成才标记,回到页面即清除——不是常驻的「空闲」状态,看过的完成不会在每次切走时重新出现。
|
|
114
|
+
- **冷却与健壮性**:同一会话的同类触发 2 秒内不重复响(另一个会话的决策照常响);音量经 `Number.isFinite` 防护(手改 YAML 的非法值回落默认);写入被拒时控件回弹到已接受值并显示错误行;开关写入中禁用,防双击竞写。
|
|
115
|
+
- **音量滑杆**:非受控输入,拖动只写 CSS 自定义属性,松手才提交一次,不卡顿、不回弹。
|
|
116
|
+
- **主题与排版**:全部使用 `--dsw-alias-*` 令牌,分区与行几何复刻官方设置页;音效选择用官方 `Menu` 下拉,不会撑出横向滚动。
|
|
117
|
+
|
|
118
|
+
## 更新记录
|
|
119
|
+
|
|
120
|
+
- **v1.5.0**(2026-10-08)「已完成」标题标记改为未读语义——离开期间发生的完成才标记,回到页面即清除,不再每次切走都重新出现;触发冷却按会话独立,2 秒内两个会话先后需要决策时都会响。补齐宿主半测试(配置 schema、唤窗路由、标题匹配)并交叉校验两半共享常量;`dsh.client.inject` 显式声明 sessions 提供包;静音时段结束后的补发行为写入文档。
|
|
121
|
+
|
|
122
|
+
- **v1.4.4**(2026-10-08)静音时段现在也会屏蔽任务栏标题提醒;进入或离开静音时段时,标题标记会自动刷新。自定义音效上传/移除按顺序写入配置,写入被拒时回滚;配置写入同步抛错也会按保存失败处理。
|
|
123
|
+
- **v1.4.3**(2026-10-08)三处修复:环境不支持音频解码时,上传自定义铃声不再被误判为有效(反正也播不出来);通知权限请求**同步抛错**也走拒绝处理,不留未处理异常;静音时段只接受合法 `HH:MM`(`99:99` 之类会被拒),Windows 原生唤窗抛错时继续走深链兜底。另补两条回归测试,并把解码失败的提示改准确(文件损坏与环境不支持解码两种情况都说清)。
|
|
124
|
+
- **v1.4.2**(2026-10-07)干净发布点:`v1.4.1` 的标签发布时被重钉过一次,本版重新发布,让下游拿到确定的标签;无行为变更。
|
|
125
|
+
- **v1.4.1**(2026-10-07)移除「没能唤回窗口」提示——判据会误报(窗口明明回来了还弹),而成功本身就是反馈;点通知现在全程静默,不再有任何跟点击弹出的通知。另:README 改版为发布页风格。
|
|
126
|
+
- **v1.4.0**(2026-10-07)看过就不再重复提醒;修复通知点击没反应(根因:平台 `tag` 替换吞掉点击);新增「子智能体的提醒」开关;另修标题前缀叠加等 5 项。
|
|
127
|
+
- **v1.3.3**(2026-10-07)重复提醒不再打扰正在看窗口的你;标题提醒改用文字(待处理 / 已完成)。
|
|
128
|
+
- **v1.3.2**(2026-10-05)两轮代码审查修复:非法 base64 中断跟踪器、通知对象回收、重复提醒吃冷却、时钟回拨静音、titleFlash 即时生效。
|
|
129
|
+
- **v1.3.1**(2026-10-05)修复唤窗时好时坏(Windows 前台锁)。
|
|
130
|
+
- **v1.3.0**(2026-10-05)唤窗改为进程内 FFI;桌面端/浏览器端自动区分。
|
|
131
|
+
- **v1.2.1**(2026-10-05)修复点击无反应。
|
|
132
|
+
- **v1.2.0**(2026-10-05)新增宿主 focus 路由(该版本点击无效,v1.3.x 修正)。
|
|
133
|
+
- **v1.1.2**(2026-10-05)修复下拉列表空白。
|
|
134
|
+
- **v1.1.1**(2026-10-05)排版与文案修复。
|
|
135
|
+
- **v1.1.0**(2026-10-05)自定义铃声、系统通知、分轨音效、重复提醒、静音时段、三种新音效。
|
|
136
|
+
- **v1.0.0**(2026-10-04)首个版本。
|
|
137
|
+
|
|
138
|
+
## 开发
|
|
139
|
+
|
|
140
|
+
```powershell
|
|
141
|
+
npm install # 一次性:宿主测试需要 schemastery 开发依赖
|
|
142
|
+
node test/smoke.mjs # 客户端半:装配、触发、冷却、静音、重复提醒、通知点击、子智能体过滤
|
|
143
|
+
node test/host.mjs # 宿主半:配置 schema、唤窗路由、标题匹配、两半契约交叉校验
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
dsh-plugin-notify-sounds/
|
|
148
|
+
├── package.json # dsh.bundle.patch + dsh.client
|
|
149
|
+
├── cordis.patch.yml # Loader 行:id: notify-sounds
|
|
150
|
+
├── lib/
|
|
151
|
+
│ ├── index.js # Host 半:配置模式 + 点通知唤窗路由
|
|
152
|
+
│ └── client.js # Client 半:音效引擎、状态监听、设置分区
|
|
153
|
+
└── test/
|
|
154
|
+
├── smoke.mjs # 客户端半
|
|
155
|
+
└── host.mjs # 宿主半
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
`package.json` 已按可发布形态声明(`files` 只带运行时产物,`@deepseek-ai/schemastery` 为 peerDependency、另有一份 devDependency 供宿主测试,纯 ESM、无构建步骤),日后发 npm 直接 `npm publish` 即可。
|
|
159
|
+
|
|
160
|
+
## License
|
|
161
|
+
|
|
162
|
+
[MIT](LICENSE) © BillCx330
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# dsh-plugin-notify-sounds — dsh bundle patch.
|
|
2
|
+
#
|
|
3
|
+
# One row: this package's own Host half. The row declares the volatile Config
|
|
4
|
+
# schema the Settings document serves under the `notify-sounds` namespace, and
|
|
5
|
+
# mounting it is what makes the package discoverable by the client-module
|
|
6
|
+
# scanner (`dsh.client` is read from the manifest of the package a Loader row
|
|
7
|
+
# mounts), so the browser half — the notification sounds and the Settings
|
|
8
|
+
# section — is served with it.
|
|
9
|
+
|
|
10
|
+
- insert:
|
|
11
|
+
- id: notify-sounds
|
|
12
|
+
name: 'dsh-plugin-notify-sounds'
|