SeverusZh/dsh-notify-windows
> DeepSeek Harness(DSH)插件:当 Agent 需要你关注时,向 Windows 发送系统桌面通知。
catalog 简介 / catalog descriptioncatalog description:—
编辑导读Editor's Brief
## 核心特性
- 该插件可在 DeepSeek Harness 中发送 Windows 桌面通知,当 agent 会话完成、失败、达到输出限制、请求审批或向用户提问时触发。
- 它监听 turn/end 事件以识别会话结束,并在通知标题中使用会话标题,同时在正文中显示结束原因和轮次。
- 它监听 approval/asked 事件,并在会话审批策略设置为 never 时自动跳过通知。
- 它会检测 run_code 程序源码中的 tools.ask_user_question( 调用,并提取问题文本用于通知正文。
- 它默认忽略 subagent 会话,并可通过配置选择将其包含在内。
## 使用场景
- 用户可以在 agent 任务运行期间离开屏幕,并在主会话完成或因错误停止时收到通知。
- 用户可以在操作等待审批时收到提醒,而不必持续盯着 DSH 界面。
- 当 agent 提出需要回答的问题时,用户可以收到通知,包括通过 run_code 工具调用发出的问题。
## 技术细节
- 通知通过 Windows PowerShell 5.1 的 WinRT Toast API 发送,插件会在 HKCU 下注册 AppUserModelId,无需管理员权限。
- 安装使用 dsh.bundle 机制,其中 npm 包提供 cordis.patch.yml,在执行 dsh plugin add 后挂载 dsh-notify 条目。
- 配置通过在 profile 的 cordis.patch.yml 中覆盖 dsh-notify 条目来应用,运行中的 DSH 进程会监听该文件。
- 可点击的 toast 可通过 dshnotify:// 协议处理程序打开 DSH Web GUI,在可用时聚焦已有窗口,或回退到默认浏览器。
## 注意事项
- README 标明支持 Windows 10 或 Windows 11 平台,通知送达取决于 Windows 通知设置和 Focus Assist 行为。
- 手动为 dsh-notify 添加 - insert: 条目会导致 loader 条目重复错误。
- DSH 0.1.0-rc.8 前端不会使用 ?session=<id> 参数,因此点击 toast 会打开 DSH 界面,而不是直接定位到目标会话。
## Core Features
- The plugin sends Windows desktop notifications from DeepSeek Harness when an agent session completes, fails, reaches an output limit, requests approval, or asks the user a question.
- It listens to turn/end events for session endings and uses the session title in the notification title while showing the ending reason and round in the body.
- It listens to approval/asked events and skips notifications automatically when the session approval policy is set to never.
- It detects tools.ask_user_question( calls inside run_code program source and extracts the question text for the notification body.
- It ignores subagent sessions by default and can optionally include them through configuration.
## Use Cases
- Users can leave the screen while an agent task runs and receive a notification when the main session finishes or stops with an error.
- Users can receive a prompt when an operation is waiting for approval instead of watching the DSH interface continuously.
- Users can be notified when an agent asks a question that requires an answer, including questions issued through run_code tool calls.
## Technical Details
- Notifications are sent through the Windows PowerShell 5.1 WinRT Toast API, and the plugin registers an AppUserModelId under HKCU without requiring administrator rights.
- Installation uses the dsh.bundle mechanism, where the npm package provides cordis.patch.yml to mount the dsh-notify entry after dsh plugin add.
- Configuration is applied by overriding the dsh-notify entry in the profile cordis.patch.yml, and the file is watched by the running DSH process.
- Clickable toasts can open the DSH Web GUI through a dshnotify:// protocol handler, focus an existing window when available, or fall back to the default browser.
## Notes
- The README identifies Windows 10 or Windows 11 as the platform, and notification delivery depends on Windows notification settings and Focus Assist behavior.
- Manual - insert: entries for dsh-notify cause a duplicate loader entry error.
- DSH 0.1.0-rc.8 front end does not consume the ?session=<id> parameter, so clicking a toast opens the DSH interface rather than directly locating the target session.
安装Install
dsh plugin --profile web add dsh-notify-windows
把 SeverusZh/dsh-notify-windows 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-notify-windows
DeepSeek Harness(DSH)插件:当 Agent 需要你关注时,向 Windows 发送系统桌面通知。
任务完成 ✅ | 等待审批 🔐 | 等待回答 ❓ —— 离开屏幕也不错过任何需要你处理的事。
✨ 功能
- 任务完成提醒:监听会话
turn/end事件,任务完成 / 出错 / 输出超限时立即弹窗,标题自动使用会话标题,正文显示原因与轮次; - 权限审批提醒:监听
approval/asked事件,有操作等待你的审批时立即提醒;会话审批策略为never时自动跳过(此时没有东西在等你); - 提问确认提醒:Agent 调用
ask_user_question向你提问时提醒;本部署下所有工具都经run_code调用,插件会扫描run_code程序源码中的tools.ask_user_question(调用并提取问题文本; - 防打扰:默认忽略子代理(subagent)会话,只提醒主会话;
- 零依赖:通知通过 Windows PowerShell 5.1 的 WinRT Toast API 发送,自动注册 HKCU 的 AppUserModelId(无需管理员权限);
- 可诊断:可选日志(
%TEMP%\dsh-notify\notify.log)与 debug 事件日志。
🚀 安装
项目通过 dsh.bundle 机制安装:npm 包自带的 cordis.patch.yml 会在
dsh plugin add 后自动挂载 dsh-notify 入口,不需要再手动 - insert:。
dsh plugin --profile web add dsh-notify-windows
重启 DSH 并刷新浏览器后生效:
dsh --profile web
注意:不要再用
- insert:手动添加dsh-notify,否则启动会报duplicate loader entry id: dsh-notify。想调整配置,在 profile 的cordis.patch.yml里按 id 覆盖即可(见下节)。
更新 / 卸载
dsh plugin --profile web update dsh-notify-windows
dsh plugin --profile web remove dsh-notify-windows
更新后需重启 DSH 宿主(新增 bundle 层需要重新启动)。
⚙️ 配置项
插件行 config 全字段可选,未填按默认值。需要调整时,在
$DSH_HOME/profiles/web/cordis.patch.yml 里按 id 覆盖主条目即可
(该文件被运行中的 DSH 热监视,改动立即生效,无需重启):
- id: dsh-notify
name: dsh-notify-windows
config:
enabled: true
reasons: [completed, error, max-tokens]
notifyOnStart: true
notifyOnApproval: true
log: true
| 配置 | 默认值 | 说明 |
|---|---|---|
enabled |
true |
总开关 |
reasons |
[completed, error, max-tokens] |
需要提醒的回合结束原因(可选 aborted / interrupted / blocked) |
includeSubagents |
false |
是否也提醒子代理会话 |
notifyOnStart |
false |
插件加载时发一条「已激活」通知 |
notifyOnApproval |
true |
审批请求提醒(策略 never 时自动跳过) |
notifyOnAskUser |
true |
Agent 提问等待回答时提醒 |
notifyOnGoalRounds |
false |
/goal 自动推进回合不提醒(目标完成/阻塞的最终回合除外) |
excerpt |
true |
通知正文附带 Agent 最后回复的摘要 |
excerptMaxChars |
80 |
摘要最大字符数 |
appName |
DeepSeek Harness |
通知来源显示名与兜底标题 |
aumid |
DeepSeekHarness.Notify |
通知 AppUserModelId |
log |
true |
写日志到 %TEMP%\dsh-notify\notify.log |
debug |
false |
把所有会话事件写入日志(排查用,量大) |
openOnClick |
true |
任务完成 / 审批 / 提问 toast 是否可点击(false 回退为旧的无点击 toast) |
preferExisting |
true |
true 走 launcher 优先聚焦已开 DSH 窗口;false 直接用默认浏览器打开 URL |
webUrl |
'' |
覆盖自动发现的基地址(如 http://192.168.1.5:4000),留空自动发现(默认 http://127.0.0.1:3080) |
🔔 触发场景
| 场景 | 会话事件 | 通知示例 |
|---|---|---|
| 任务完成 | turn/end |
「任务已完成(第 N 轮)」 |
| 任务出错 / 超限 | turn/end |
「任务出错」/「输出达到 token 上限」 |
| 等待审批 | approval/asked |
「DeepSeek Harness · 需要审批 / 工具 pwsh:…」 |
| 等待回答 | tool/call(含 run_code 检测) |
「DeepSeek Harness · 需要回答 / 是否继续?」 |
🔗 点击通知跳转
任务完成 / 等待审批 / 等待回答的 toast 可点击 → 打开 DSH Web GUI。优先聚焦已打开的
DSH 浏览器标签或 Chrome Application 窗口;没有已开窗口时在默认浏览器新开标签并打开 GUI。
目标 URL 带 ?session=<id> 参数(rc.8 前端暂不消费,为未来深链预留)。
配置:
openOnClick(默认true,false则关闭可点击,回退为旧的无点击 toast);preferExisting(默认true,true走 launcher 优先复用已开窗口;false直接用默认浏览器打开 URL);webUrl(可选,覆盖自动发现的基地址,如http://192.168.1.5:4000,留空自动发现 / 默认http://127.0.0.1:3080)。
注意事项: 首次点击会自动注册 dshnotify:// 协议处理器(HKCU,无需管理员);故障会静默降级为「默认浏览器打开」。
说明:DSH 0.1.0-rc.8 前端暂不支持按 URL 直达单个会话;点击后打开的是 DSH 界面(首页/会话列表)并聚焦已有窗口,目标会话需在列表中选择。未来 DSH 前端支持深链后
?session=<id>将直接定位。
🧪 验证
node scripts\smoke-test.mjs
独立进程内用 cordis Context 模拟会话事件:应弹出任务完成 / 审批 / 提问三条测试通知,并断言日志记录与过滤行为(子代理、never 策略、无关调用均被过滤)。
❓ 常见问题
- 收不到通知? 检查 Windows「通知与操作」设置是否允许该应用显示通知,以及「专注助手」是否开启;首次发送会自动注册 AUMID。
- /goal 模式会提醒吗? 默认不会:自动推进的中间回合保持静默,只有目标完成(或阻塞)的最终回合才提醒;如需每个回合都提醒,把
notifyOnGoalRounds设为true。 - 为什么审批提醒有时不弹? 会话审批策略为
never时审批会被自动拒绝、不会等待,插件会跳过提醒;策略为ask时才提醒。 - 更新插件代码后如何生效? 执行
dsh plugin --profile web update dsh-notify-windows后重启 DSH 宿主。
📄 许可证
MIT © 2026 SeverusZh
amruthpillai/reactive-resume
tt-a1i/archify
zhu1090093659/dsh-web-ui
strukto-ai/mirage
liustack/modlens
omdsh-dev/DSH-better-sidebar
dsh-market/dsh-market