dsh-notify-desktop 0.0.0-stage → 0.1.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/LICENSE +21 -0
  3. package/README.md +167 -2
  4. package/README.zh.md +153 -0
  5. package/THIRD-PARTY-NOTICES.md +55 -0
  6. package/cordis.patch.yml +5 -0
  7. package/dsh.plugin.json +7 -0
  8. package/lib/client.js +2410 -0
  9. package/lib/client.js.map +1 -0
  10. package/lib/index.js +6521 -0
  11. package/lib/index.js.map +1 -0
  12. package/lib/types/client/SettingsSection.d.ts +33 -0
  13. package/lib/types/client/SoundPicker.d.ts +21 -0
  14. package/lib/types/client/decision.d.ts +75 -0
  15. package/lib/types/client/index.d.ts +26 -0
  16. package/lib/types/client/locales.d.ts +203 -0
  17. package/lib/types/client/navigate.d.ts +19 -0
  18. package/lib/types/client/notifier.d.ts +142 -0
  19. package/lib/types/client/questions.d.ts +42 -0
  20. package/lib/types/client/reminder.d.ts +31 -0
  21. package/lib/types/client/runner.d.ts +70 -0
  22. package/lib/types/client/settings.d.ts +47 -0
  23. package/lib/types/client/styles.d.ts +13 -0
  24. package/lib/types/client/summary.d.ts +43 -0
  25. package/lib/types/index.d.ts +19 -0
  26. package/lib/types/projection.d.ts +131 -0
  27. package/lib/types/protocol.d.ts +73 -0
  28. package/lib/types/questions.d.ts +41 -0
  29. package/lib/types/types.d.ts +157 -0
  30. package/package.json +111 -4
  31. package/sounds/1-/344/273/273/345/212/241/346/255/243/345/270/270/347/273/223/346/235/237.wav +0 -0
  32. package/sounds/2-/344/273/273/345/212/241/345/207/272/351/224/231.wav +0 -0
  33. package/sounds/3-/351/234/200/350/246/201/344/275/240/345/244/204/347/220/206.wav +0 -0
  34. package/sounds/4-/350/266/205/346/227/266/345/202/254/345/212/236.wav +0 -0
  35. package/sounds/README.md +29 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,46 @@
1
+ # Changelog
2
+
3
+ All notable changes to this plugin are recorded here.
4
+ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
5
+ and the project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ### Added
10
+
11
+ - npm distribution: `dsh-notify-desktop` is published on npm and can be installed without cloning —
12
+ `dsh.cmd plugin --profile desktop add dsh-notify-desktop`. Local `link:` installs remain supported
13
+ for development.
14
+
15
+ ### Verified
16
+
17
+ - Compatibility with DSH desktop **0.2.1-rc.1** verified end to end on 2026-10-17: version gate, plugin
18
+ loading, session-projection delivery, host toast / sound / silence channels, and an unfocused
19
+ end-to-end notification all passed. See `docs/acceptance/2026-10-17-dsh-0.2.1-rc.1-compat.md`.
20
+
21
+ ## [0.1.0] - 2026-10-10
22
+
23
+ First release, verified end to end on DSH desktop 0.2.0-rc.2 (see
24
+ `docs/acceptance/2026-10-10-desktop-e2e.md`).
25
+
26
+ ### Added
27
+
28
+ - Windows toast notifications for five turn-end reasons (completed, error,
29
+ aborted, blocked, max-tokens), for approval requests, for questions
30
+ (including `run_code` PTC questions) and for plan reviews.
31
+ - Edge-triggered notifications with a 3-second de-duplication key, suppressed
32
+ while the DSH window is focused.
33
+ - Click raises the DSH window through the app's own `dsh://open` protocol
34
+ handler; it deliberately does not jump to the session.
35
+ - One reminder for a blocking interaction that stays unanswered (10 minutes by
36
+ default, configurable).
37
+ - Per-situation sounds in four groups (finished / error / waiting-on-you /
38
+ reminder), picked from a library with three sections: the twenty Windows
39
+ sounds, the four author sounds shipped in `sounds/`, and the user's own
40
+ imports (`.wav` / `.mp3` / `.m4a` / `.aac` / `.wma` / `.flac` /
41
+ `.ogg` / `.opus`, copied into a folder and transcoded once with ffmpeg).
42
+ - File sounds are capped at eight seconds, and stop immediately when the sound
43
+ switch is turned off or the DSH window regains focus.
44
+ - A settings section (settings → 通知 / Notifications) with every switch, the
45
+ sound pickers with preview, the custom file entry and a transcode-cache
46
+ readout with a clear button.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 paleech0
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,168 @@
1
- # Temporary Holding Version
1
+ # dsh-notify-desktop
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
+ [![npm](https://img.shields.io/npm/v/dsh-notify-desktop.svg)](https://www.npmjs.com/package/dsh-notify-desktop) · [中文文档](README.zh.md) · English
4
+
5
+ Windows toast notifications for the DSH desktop app. A session finishes, fails, or stops to ask you
6
+ something — you get a native notification with a sound chosen for that situation, and clicking it brings
7
+ the DSH window back to the front.
8
+
9
+ <img src="https://raw.githubusercontent.com/paleech0/dsh-notify-desktop/main/docs/images/settings.png" width="460" alt="Notification settings">
10
+
11
+ ## What you get
12
+
13
+ - **Told when it matters** — turn ends (completed, error, aborted, blocked, max-tokens), approval
14
+ requests, questions, plan reviews, and one nudge for a wait that drags on.
15
+ - **Quiet when you are there** — nothing pops while the DSH window has focus, and each event notifies
16
+ once (three-second de-duplication).
17
+ - **A sound per situation** — four groups (finished, error, waiting on you, still waiting), each picked
18
+ from the Windows sounds, the author sounds shipped in [`sounds/`](sounds/), or your own files.
19
+ - **Your own sounds** — *Add sound…* copies the file you pick into the plugin's folder, so several can
20
+ coexist and each can be removed later.
21
+ - **Never a long ring** — a file sound stops after eight seconds, and stops at once when you mute
22
+ notifications or come back to the window.
23
+ - **Click to come back** — the toast raises the DSH window; it deliberately does not jump to the session.
24
+
25
+ Requirements: Windows and the DSH desktop app (profile `desktop`), runtime 0.2.x. `ffmpeg` on `PATH` is
26
+ optional and only used to transcode custom sounds that are not `.wav`.
27
+
28
+ ## Install
29
+
30
+ ### From npm
31
+
32
+ ```powershell
33
+ & "<DSH desktop install>\resources\runtime\cli\bin\dsh.cmd" plugin --profile desktop add dsh-notify-desktop
34
+ ```
35
+
36
+ Then restart the DSH desktop app and open **Settings → Notifications** (`Ctrl+,` while focused).
37
+
38
+ ### From a local checkout
39
+
40
+ 1. Clone this repository somewhere permanent — the profile links to that folder.
41
+ 2. Register it with the desktop app's own CLI:
42
+
43
+ ```powershell
44
+ & "<DSH desktop install>\resources\runtime\cli\bin\dsh.cmd" plugin --profile desktop add "link:<path-to-this-repo>"
45
+ ```
46
+
47
+ 3. Restart the DSH desktop app, then open **Settings → Notifications** (`Ctrl+,` while focused).
48
+
49
+ ## Settings
50
+
51
+ Every switch lives in one section of the settings page. Preferences are stored in the renderer's
52
+ `localStorage` and apply immediately.
53
+
54
+ | Control | What it does |
55
+ |---|---|
56
+ | Enable notifications | Master switch; nothing else fires while it is off |
57
+ | Sound | Mutes every situation group at once |
58
+ | Sounds | One picker per group, each with a preview button |
59
+ | Custom sounds | Add, list and remove your own files |
60
+ | Transcode cache | Shows what transcoded wavs occupy, and clears them |
61
+ | When to notify | One switch per turn-end reason |
62
+ | Waiting on you | One switch per interaction kind |
63
+ | Reminder | Minutes before the single nudge, plus a test button |
64
+
65
+ ## Sounds
66
+
67
+ **Three sections.** Every picker opens a two-level list: the source first, that source's sounds second.
68
+
69
+ - *Windows sounds* — twenty built-in choices: the five toast events plus the media library
70
+ (`chimes`, `ding`, `tada`, `Windows Error`, `Critical Stop`, `Alarm0x`, `Ring0x`, …).
71
+ - *Author sounds* — the four `.wav` files in [`sounds/`](sounds/). Drop another file in that folder and
72
+ it appears; no code change is involved.
73
+ - *Custom sounds* — your own imports.
74
+
75
+ **Your own files.** *Add sound…* copies the file into `%LOCALAPPDATA%\dsh-notify\custom`, so the
76
+ original can move or be deleted afterwards. Accepted formats are `.wav`, `.mp3`, `.m4a`, `.aac`,
77
+ `.wma`, `.flac`, `.ogg` and `.opus`.
78
+
79
+ **When a sound stops.** A `.wav` plays directly. Anything else is transcoded once with the `ffmpeg` on
80
+ your `PATH` and lands in the transcode cache below the list, which reports its size and can clear it. File
81
+ sounds are capped at eight seconds, and a sound already playing stops immediately when you switch sound
82
+ off or when the DSH window regains focus. Without ffmpeg, wav files and the two shipped libraries still
83
+ work; the diagnostics route reports `media.ffmpeg: null`.
84
+
85
+ **Why custom sounds exist.** A toast can only reference five `ms-winsoundevent` values, and on Windows 11
86
+ those resolve to four very similar chimes — `Notification.IM` and `Notification.SMS` are literally the
87
+ same file. Playing the audio from the host is the only way to get sounds that are actually distinguishable.
88
+
89
+ ## Compatibility
90
+
91
+ | | |
92
+ |---|---|
93
+ | Verified on | DSH desktop **0.2.1-rc.1** (2026-10-17): version gate, plugin loading, projection delivery, host toast / sound / silence channels and an unfocused end-to-end notification all pass ([evidence](docs/acceptance/2026-10-17-dsh-0.2.1-rc.1-compat.md)); 0.2.0-rc.2 remains the original end-to-end run ([evidence](docs/acceptance/2026-10-10-desktop-e2e.md)) |
94
+ | Declared range | `>=0.2.0-rc.2 <0.3.0-0` — the whole 0.2 line, prereleases included; the loader checks it with `includePrerelease`, so 0.2.1-rc.1 passes |
95
+ | Platform | Windows desktop profile only; the web profile has no toast channel and is untested |
96
+ | 0.2.1 seam check | The 0.2.1-rc.1 runtime image ships no `.d.ts`; every seam used here was checked against its compiled JS and still matches |
97
+
98
+ The profile loader reads the `peerDependencies` entries named `@deepseek-ai/dsh` or `@deepseek-ai/dsh-*`
99
+ and checks them with `semver.satisfies(runtime, range, { includePrerelease: true })`. A mismatch makes it
100
+ skip the plugin rather than load it. On another runtime, grant an exemption:
101
+
102
+ ```powershell
103
+ dsh.cmd plugin --profile desktop allow-version dsh-notify-desktop@0.1.0 --dsh-version <your-version> --accept-risk
104
+ ```
105
+
106
+ ## How it works
107
+
108
+ Two halves, and no harness code is modified.
109
+
110
+ - The **host half** registers one session projection (`notify`) and a few same-origin routes.
111
+ - The **client half** reads that projection from the session list, decides whether a notification is
112
+ warranted, and sends it: a host PowerShell toast while the window is unfocused, the renderer's own
113
+ notification as the fallback.
114
+
115
+ Questions arrive from two places on purpose, and neither can be dropped. Questions asked as tool calls
116
+ reach the projection; service-level asks such as the plan review never enter the session log, so the host
117
+ observes the `user-questions/request` waterfall with `{ global: true }` and hands them to the client over
118
+ a bounded queue. A cross-source key keeps the two copies from double-toasting.
119
+
120
+ | Route | Purpose |
121
+ |---|---|
122
+ | `GET /dsh-notify/debug` | Projection state, recent client reports, ffmpeg and player status |
123
+ | `POST /dsh-notify/toast` | Raise one toast (title, body, sound id) |
124
+ | `POST /dsh-notify/focus` | Raise the window through `dsh://open` |
125
+ | `POST /dsh-notify/silence` | Stop the sound that is playing |
126
+ | `GET/POST /dsh-notify/sound-library` | List the two library folders |
127
+ | `POST /dsh-notify/import-sound`, `/delete-sound` | Add or remove a custom sound |
128
+ | `GET/POST /dsh-notify/sound-cache` | Report or clear the transcode cache |
129
+ | `POST /dsh-notify/pick-file`, `GET /dsh-notify/foreground` | Windows file picker; OS-level focus answer |
130
+ | `GET /dsh-notify/questions` | Poll the host-side question queue |
131
+
132
+ ## Troubleshooting
133
+
134
+ Windows toasts never reach the Action Center, so the diagnostics route is the only evidence channel:
135
+
136
+ ```powershell
137
+ Invoke-WebRequest http://127.0.0.1:19387/dsh-notify/debug
138
+ ```
139
+
140
+ It returns the projection registration state, the last 40 client reports (every decision, channel choice
141
+ and platform result), and the sound plumbing (`media.ffmpeg`, `media.soundPlayers`).
142
+
143
+ ## Development
144
+
145
+ ```powershell
146
+ pnpm install
147
+ pnpm run check # typecheck + vitest + build
148
+ ```
149
+
150
+ `lib/` is committed on purpose: the profile links to this folder, so the built bundles ship with the
151
+ source. [AGENTS.md](AGENTS.md) holds the repository rules and the measured constraints that must not be
152
+ "optimised" away — the host bundle stays self-contained, the toast spawn keeps piped stdio, and audio goes
153
+ through `System.Media.SoundPlayer` only.
154
+
155
+ ## Known limits
156
+
157
+ - No tray badge, taskbar badge or window flashing; those need main-process APIs a plugin cannot reach.
158
+ - Clicking a toast raises the window, it does not navigate to the session.
159
+ - The `error` and `max-tokens` turn ends are covered by unit tests only; they were never reproduced live.
160
+ - A toast cannot be observed being dismissed, so file sounds are capped rather than tied to the toast.
161
+ - Windows desktop profile only.
162
+
163
+ ## License
164
+
165
+ [MIT](LICENSE) · third-party notices in [THIRD-PARTY-NOTICES.md](THIRD-PARTY-NOTICES.md).
166
+
167
+ Unofficial plugin: not affiliated with, endorsed by, or sponsored by DeepSeek. "DeepSeek", "DSH" and
168
+ "DeepSeek Harness" are used descriptively, to say what this plugin plugs into.
package/README.zh.md ADDED
@@ -0,0 +1,153 @@
1
+ # dsh-notify-desktop
2
+
3
+ [![npm](https://img.shields.io/npm/v/dsh-notify-desktop.svg)](https://www.npmjs.com/package/dsh-notify-desktop) · [English](README.md) · 中文
4
+
5
+ 给 **DSH 桌面端** 加 Windows 原生通知:会话跑完、出错、或停下来等你确认时弹一条系统通知,并播放**为这种情况挑好的音效**;
6
+ 点通知把 DSH 窗口拉回前台。
7
+
8
+ <img src="https://raw.githubusercontent.com/paleech0/dsh-notify-desktop/main/docs/images/settings.png" width="460" alt="通知设置">
9
+
10
+ ## 它能给你什么
11
+
12
+ - **该提醒时提醒** —— 回合结束(正常完成 / 出错 / 被中止 / 被阻塞 / Token 上限)、等待审批、等待回答、计划评审,
13
+ 以及等待过久时的一条催办。
14
+ - **你在看就不吵** —— DSH 窗口有焦点时一律不弹;同一件事只弹一次(3 秒去重)。
15
+ - **每种情况一个声音** —— 四组(正常结束 / 出错 / 需要你处理 / 超时催办),可选的来源有三类:Windows 音效、
16
+ 随插件发布的作者音效([`sounds/`](sounds/))、以及你自己导入的文件。
17
+ - **可以用自己的音效** —— 点「添加音效…」会把选中的文件**复制**进插件目录,可以同时放多个,之后也能逐个删除。
18
+ - **不会一直响** —— 文件类音效最长 8 秒;关掉提示音、或切回 DSH 窗口,正在响的会**立刻停**。
19
+ - **点击回前台** —— 通知只把窗口拉回前台,**刻意不跳转会话**(更可预测)。
20
+
21
+ **环境要求**:Windows + DSH 桌面端(profile `desktop`),运行时 0.2.x。`ffmpeg` 可选(仅用于把非 `.wav` 的自定义音效转码),
22
+ 放在 `PATH` 里即可。
23
+
24
+ ## 安装
25
+
26
+ ### 从 npm 安装
27
+
28
+ ```powershell
29
+ & "<DSH 桌面端安装目录>\resources\runtime\cli\bin\dsh.cmd" plugin --profile desktop add dsh-notify-desktop
30
+ ```
31
+
32
+ 然后重启 DSH 桌面端,打开 **设置 → 通知**(窗口有焦点时按 `Ctrl+,`)。
33
+
34
+ ### 从本地仓库安装
35
+
36
+ 1. 把本仓库 clone 到一个**固定目录**(profile 以链接方式指向它,之后别挪动)。
37
+ 2. 用桌面端自带 CLI 注册:
38
+
39
+ ```powershell
40
+ & "<DSH 桌面端安装目录>\resources\runtime\cli\bin\dsh.cmd" plugin --profile desktop add "link:<本仓库路径>"
41
+ ```
42
+
43
+ 3. 重启 DSH 桌面端,然后打开 **设置 → 通知**(窗口有焦点时按 `Ctrl+,`)。
44
+
45
+ ## 设置项
46
+
47
+ 所有开关都在设置页的同一个「通知」段里。偏好存在渲染层 `localStorage`,改完立即生效。
48
+
49
+ | 控件 | 作用 |
50
+ |---|---|
51
+ | 启用通知 | 总开关;关掉后一律不弹 |
52
+ | 提示音 | 一次性静音所有音效组 |
53
+ | 音效 | 四类情况各一个选择器,带「试听」 |
54
+ | 自定义音效 | 添加 / 列出 / 删除你自己的文件 |
55
+ | 转换缓存 | 显示转码 wav 的占用,并可一键清理 |
56
+ | 结束提醒 | 每种回合结束原因一个开关 |
57
+ | 等待确认 | 每种阻塞交互一个开关 |
58
+ | 催办 | 多少分钟后补一条;另有测试按钮 |
59
+
60
+ ## 音效
61
+
62
+ **三个分区。** 每个选择器都是两级:先选**来源**,再选该来源下的具体音效。
63
+
64
+ - *Windows 音效* —— 内置 20 个:5 个通知事件 + 系统媒体库(`chimes`、`ding`、`tada`、`Windows Error`、
65
+ `Critical Stop`、`Alarm0x`、`Ring0x` 等)。
66
+ - *作者音效* —— 本仓库 [`sounds/`](sounds/) 里的 4 个 `.wav`。**往那个文件夹再丢文件就等于加音效**,不用改代码。
67
+ - *自定义音效* —— 你自己导入的。
68
+
69
+ **用自己的文件。** 点「添加音效…」会把文件**复制**到 `%LOCALAPPDATA%\dsh-notify\custom`,所以原文件之后移动或删除都不影响。
70
+ 支持 `.wav`、`.mp3`、`.m4a`、`.aac`、`.wma`、`.flac`、`.ogg`、`.opus`。
71
+
72
+ **声音什么时候停。** `.wav` 直接播放;其他格式首次播放时用 `PATH` 上的 `ffmpeg` 转码一次,占用计入列表下面的
73
+ **「转换缓存」**(在那里查看与清理)。文件类音效最长 8 秒;关掉提示音或窗口重获焦点时,正在响的**立刻停**。
74
+ 没有 ffmpeg 时,wav 与随插件发布的音效照常可用,诊断接口会显示 `media.ffmpeg: null`。
75
+
76
+ **为什么需要自定义音效。** Toast 只能引用 5 个 `ms-winsoundevent` 值,而在 Windows 11 上它们只对应 4 个**彼此很像**的
77
+ 「叮」—— `Notification.IM` 与 `Notification.SMS` 甚至是同一个文件。想让四类情况真的听得出差别,只能由宿主自己播放音频。
78
+
79
+ ## 兼容性
80
+
81
+ | | |
82
+ |---|---|
83
+ | 实测版本 | DSH 桌面端 **0.2.1-rc.1**(2026-10-17):版本闸门、插件加载、投影送达、宿主 Toast/音效/静音通道以及一次失焦端到端通知全部通过([证据](docs/acceptance/2026-10-17-dsh-0.2.1-rc.1-compat.md));0.2.0-rc.2 仍是最早的端到端验收([证据](docs/acceptance/2026-10-10-desktop-e2e.md))|
84
+ | 声明范围 | `>=0.2.0-rc.2 <0.3.0-0` —— 即整条 0.2 线,含预发布版;加载器按 `includePrerelease` 判定,0.2.1-rc.1 在范围内 |
85
+ | 平台 | 仅 Windows 桌面端 profile;web profile 没有 Toast 通道,未验证 |
86
+ | 0.2.1 seam 核对 | 0.2.1-rc.1 运行时镜像不带 `.d.ts`;本插件用到的全部 seam 均按其编译 JS 复核通过 |
87
+
88
+ profile 加载器只看 `peerDependencies` 里名为 `@deepseek-ai/dsh` 或 `@deepseek-ai/dsh-*` 的条目,
89
+ 用 `semver.satisfies(runtime, range, { includePrerelease: true })` 判定;**不匹配会直接跳过该插件**(不加载)。
90
+ 运行时不在范围内时,可以显式豁免:
91
+
92
+ ```powershell
93
+ dsh.cmd plugin --profile desktop allow-version dsh-notify-desktop@0.1.0 --dsh-version <你的版本> --accept-risk
94
+ ```
95
+
96
+ ## 工作原理
97
+
98
+ 两半组成,**不改任何 harness 代码**。
99
+
100
+ - **宿主半侧**:注册一个会话投影(`notify`)和若干同源路由。
101
+ - **客户端半侧**:从会话列表读那个投影,判断该不该通知,然后发出去 —— 窗口失焦时走宿主 PowerShell Toast,
102
+ 路由不可达时退回渲染层通知。
103
+
104
+ 提问**故意有两个来源,都不能删**:工具调用式提问能进投影;而服务级提问(计划评审)根本不进会话日志,
105
+ 所以宿主用 `{ global: true }` 监听 `user-questions/request` 瀑布,经有界队列交给客户端。跨源去重键保证不会重复弹两条。
106
+
107
+ | 路由 | 用途 |
108
+ |---|---|
109
+ | `GET /dsh-notify/debug` | 投影状态 + 客户端最近上报 + ffmpeg/播放器状态 |
110
+ | `POST /dsh-notify/toast` | 弹一条通知(标题、正文、音效 id)|
111
+ | `POST /dsh-notify/focus` | 通过 `dsh://open` 把窗口拉回前台 |
112
+ | `POST /dsh-notify/silence` | 停掉正在播放的声音 |
113
+ | `GET/POST /dsh-notify/sound-library` | 列出两个音效目录 |
114
+ | `POST /dsh-notify/import-sound`、`/delete-sound` | 添加 / 删除自定义音效 |
115
+ | `GET/POST /dsh-notify/sound-cache` | 查询 / 清理转码缓存 |
116
+ | `POST /dsh-notify/pick-file`、`GET /dsh-notify/foreground` | Windows 选文件框;OS 级焦点判定 |
117
+ | `GET /dsh-notify/questions` | 轮询宿主侧提问队列 |
118
+
119
+ ## 排查
120
+
121
+ Windows 通知**不进操作中心**,所以诊断接口是唯一的证据通道:
122
+
123
+ ```powershell
124
+ Invoke-WebRequest http://127.0.0.1:19387/dsh-notify/debug
125
+ ```
126
+
127
+ 返回投影注册状态、客户端最近 40 条上报(每条决定、通道选择、平台结果),以及音效链路状态
128
+ (`media.ffmpeg`、`media.soundPlayers`)。
129
+
130
+ ## 开发
131
+
132
+ ```powershell
133
+ pnpm install
134
+ pnpm run check # typecheck + vitest + build
135
+ ```
136
+
137
+ `lib/` 是**故意提交**的:profile 链接的就是这个目录,构建产物随源码一起走。[AGENTS.md](AGENTS.md) 里是仓库规则,
138
+ 以及那些**不许"优化"掉**的实测约束 —— 宿主 bundle 必须自包含、Toast 子进程必须保留管道 stdio、音频只能走
139
+ `System.Media.SoundPlayer`。
140
+
141
+ ## 已知限制
142
+
143
+ - 没有托盘角标 / 任务栏角标 / 窗口闪烁;那些需要主进程 API,插件够不到。
144
+ - 部分场景下点通知只把窗口拉回前台,不跳转会话。
145
+ - `error` 与 `max-tokens` 两个结束态只有单测覆盖,没有真机构造过。
146
+ - 插件无法感知通知被关闭,所以文件类音效用「封顶 8 秒」代替跟随通知生命周期。
147
+ - 仅支持 Windows 桌面端 profile。
148
+
149
+ ## 许可证
150
+
151
+ [MIT](LICENSE) · 第三方许可见 [THIRD-PARTY-NOTICES.md](THIRD-PARTY-NOTICES.md)。
152
+
153
+ 非官方插件:与 DeepSeek 官方无关,未获其背书或赞助。「DeepSeek」「DSH」「DeepSeek Harness」仅用于说明本插件接入的对象。
@@ -0,0 +1,55 @@
1
+ # Third-party notices
2
+
3
+ This plugin is MIT licensed (see [LICENSE](LICENSE)). It ships no runtime
4
+ dependencies: the host bundle is self-contained apart from Node's own built-in
5
+ modules, and the client bundle is a single file that uses the host's React.
6
+
7
+ The one piece of third-party code compiled into `lib/index.js` is listed below,
8
+ with the notice its licence requires.
9
+
10
+ ## zod 4.6.5 — MIT
11
+
12
+ Compiled into `lib/index.js` (used for the projection payload schema).
13
+
14
+ ```text
15
+ MIT License
16
+
17
+ Copyright (c) 2025 Colin McDonnell
18
+
19
+ Permission is hereby granted, free of charge, to any person obtaining a copy
20
+ of this software and associated documentation files (the "Software"), to deal
21
+ in the Software without restriction, including without limitation the rights
22
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
23
+ copies of the Software, and to permit persons to whom the Software is
24
+ furnished to do so, subject to the following conditions:
25
+
26
+ The above copyright notice and this permission notice shall be included in all
27
+ copies or substantial portions of the Software.
28
+
29
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35
+ SOFTWARE.
36
+ ```
37
+
38
+ ## Things that are referenced but not distributed
39
+
40
+ - **Windows sounds.** The built-in "Windows sounds" are played by asking Windows
41
+ to play the files in `%SystemRoot%\Media`; no sound file from Windows is
42
+ copied into this repository.
43
+ - **Author sounds.** The four `.wav` files in [`sounds/`](sounds/) are original
44
+ works by the repository owner, released under the same MIT licence as the rest
45
+ of this project.
46
+ - **Dev dependencies.** TypeScript, Vitest, Rolldown, jsdom and the
47
+ `@deepseek-ai/*` packages are used to build and test only; none of them is
48
+ redistributed here.
49
+
50
+ ## Trademarks
51
+
52
+ This is an **unofficial** plugin. It is not affiliated with, endorsed by, or
53
+ sponsored by DeepSeek. "DeepSeek", "DSH" and "DeepSeek Harness" are used
54
+ descriptively, to say what this plugin plugs into. "Windows" is a trademark of
55
+ Microsoft Corporation.
@@ -0,0 +1,5 @@
1
+ # dsh-notify-desktop bundle patch: mount the host plugin under its package name,
2
+ # resolved through the profile's node_modules.
3
+ - insert:
4
+ - id: dsh-notify-desktop
5
+ name: dsh-notify-desktop
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "dsh-notify-desktop",
3
+ "description": "Windows native notifications and click-to-focus for DSH desktop sessions",
4
+ "version": "0.1.0",
5
+ "entry": { "name": "dsh-notify-desktop", "inject": [] },
6
+ "client": { "platform": "web" }
7
+ }