DSH Web 桌面通知插件,任务完成、出错或等待交互时通过浏览器系统通知提醒,并支持按状态开关和关键词过滤。
- 语言
- JavaScript
- License
- MIT
- 分支
- main
安装
$ dsh plugin --profile web add github:omdsh-dev/dsh-notification在终端中运行以上命令,通过 dsh CLI 安装此插件。可在右上角切换 Profile。 第一次用 dsh?看这篇新手教程
对话式安装
帮我安装 DeepSeek Harness 插件 omdsh-dev/dsh-notification:先查看仓库 https://github.com/omdsh-dev/dsh-notification.git 确认安全性,然后执行安装命令并验证插件加载成功。
把这段指令粘贴给 DSH Web GUI 里的助手,由它代你完成安装与验证。
一句话定位
给 DeepSeek Harness 的 Web 端装一个桌面通知能力。当会话结束一轮任务、发生错误,或者需要你审批、回答、评审计划时,浏览器会弹出系统通知,切到别的标签页也能及时知道 DSH 已经完成。
核心能力
- 任务完成或出错时弹出桌面通知,支持五种结束状态(完成、出错、被中止、被阻塞、达 Token 上限)单独开关
- 等待用户交互时单独通知,覆盖审批、提问、计划评审三种等待场景
- 用包含/排除关键词规则过滤通知,支持字面量匹配或正则表达式,可选区分大小写
- 提供「设置 > 通知」面板,可一键申请浏览器权限并发送测试通知
- 偏好存在浏览器本地(localStorage),跨刷新保留;提供 v2 → v4 的平滑迁移
- 仅在任务不在眼前时通知(页面后台或查看其他会话时仍提醒),且同一会话的新通知会替换旧通知
技术实现
- 语言: TypeScript(严格 ESM 主机包,CJS 单文件 client bundle,React 18 JSX)
- 关键依赖: @deepseek-ai/cordis、@deepseek-ai/dsh-session-projection、@deepseek-ai/dsh-session、zod
- 架构模式: 宿主侧注册一个
notification会话投影(纯 fold over 日志),客户端监听 session list 的完成边沿,由浏览器NotificationAPI 弹出;不修改 harness,依赖 profile 已有的 client composition - 入口文件:
src/index.ts(宿主)、src/client/index.ts(浏览器)、src/invariant.ts(诊断伴随)
适用场景
长任务跑起来后你会切到其他标签页或工作区,等 DSH 完成、报错或等你确认时,希望被系统通知拉回来;并且只想关心部分任务(比如只关心含"部署"关键字的完成,或只想屏蔽某些工具调用),其它任务安静完成。
前置依赖与兼容性
| 依赖 | 最低版本 | 说明 |
|---|---|---|
| DSH | 未声明 | 通过 link:../dsh 解析;宿主侧使用 Cordis + session projection 通道,无需额外启用开关 |
| Node.js | >= 22 | 构建目标为 node22(见 build.mjs) |
| 平台 | 跨平台 | 仅作为 Web GUI 客户端插件使用,依赖浏览器 Notification API |
| 原生模块 | 无 | 不引入任何原生依赖 |
| React | ^18.2.0 | client 设置段使用 React,peerDependency |
安装方式
dsh plugin --profile web add github:omdsh-dev/dsh-notification
配置项
宿主侧(写在 cordis.yml 插件行的 config 下):
| 配置 | 类型 | 说明 | 默认值 |
|---|---|---|---|
maxBodyChars | 数字(≥1) | 投影里回复正文的字符预算,超出部分在宿主侧省略号截断 | 400 |
客户端(设置 > 通知 面板里改,存在 localStorage):
| 配置 | 类型 | 说明 | 默认值 |
|---|---|---|---|
| 总开关(启用通知) | 布尔 | 关闭后停止所有通知,规则和偏好保留 | 开 |
| 完成时通知 | 布尔 | 任务正常完成时通知 | 开 |
| 出错时通知 | 布尔 | 任务出错时通知 | 开 |
| 被中止时通知 | 布尔 | 任务被中止时通知 | 关 |
| 被阻塞时通知 | 布尔 | 任务被阻塞时通知 | 关 |
| 达 Token 上限时通知 | 布尔 | 达到 Token 上限时通知 | 关 |
| 等待审批时通知 | 布尔 | DSH 等你审批时通知 | 开 |
| 等待回答问题时通知 | 布尔 | DSH 提问题时通知 | 开 |
| 等待计划评审时通知 | 布尔 | DSH 等你评审计划时通知 | 关 |
| 关键词规则 | 列表 | 包含/排除规则,支持字面量或正则;包含规则至少命中一条才通知,排除规则命中即抑制 | 无 |
| 需要手动关闭 | 布尔 | 通知保持显示直到手动关闭 | 关 |
| 仅在任务不在眼前时通知 | 布尔 | 当前会话正在查看时不弹通知;切到别的会话、工作区或页面隐藏时仍会弹 | 开 |
常见问题
Q: 安装后需要修改 harness 才能用吗?
A: 不需要。宿主侧通过会话投影自动挂载,客户端依赖默认 web profile 已包含的会话列表、设置外壳和 locale,无需改动 harness 配置。
Q: 通知权限被拒绝后还能恢复吗?
A: 页面内无法恢复。被拒绝后必须手动到浏览器地址栏的站点设置里重新开启 Notification 权限,然后再回到设置面板点「请求通知权限」。
Q: 离线期间完成的轮次会在重连后补发通知吗?
A: 不会。重连时会重新拉取 baseline,离线期间的完成边沿不会触发通知。
Q: 通知里点开会跳转到具体那一轮吗?
A: 不会。点击只会聚焦窗口,不会深链到具体轮次。
Q: 后台运行的子会话会通知吗?
A: 不会。插件会跳过 origin 为 subagent 的会话。
Q: 关键词规则匹配的是哪些内容?
A: 匹配会话标题、本轮回复文本以及本轮调用过的工具名(按出现顺序去重),不匹配更早的轮次。
Q: 是否会影响模型调用?
A: 不影响。不新增任何工具,不修改提示词,回复正文只在宿主侧按 maxBodyChars 截断。
上手难度
入门 — 装好后在「设置 > 通知」里授权浏览器即可使用;想要精细控制再加关键词规则,没有必须理解的内部概念。
已知问题与限制
- 通知需要页面处于打开状态(标签页关闭后不再弹);站点权限被拒绝后无法从页面内恢复
- 离线期间发生的完成,重连后不会补发通知
- 关键词规则只匹配会话标题、最近一轮的回复文本和工具名,不匹配更早的轮次
- 通知正文是纯文本摘要;点击只聚焦窗口,不深链到具体轮次
- 宿主侧回复正文会被截断到
maxBodyChars(默认 400 字符),超过部分以省略号结尾 - 同一会话的通知 tag 包含轮次序号,新通知会替换同一会话上一条通知
Desktop notifications for the DeepSeek Harness web GUI. When a session finishes a turn, the browser shows a system notification (via the Notification API), so you can switch tabs and still know when DSH is done. Per-outcome toggles and include/exclude keyword rules control exactly which completions notify.
No harness change is needed: the host contributes a session projection (a bounded summary of each session's last completed turn), and the client watches the session list's completion reminder and applies its own persisted preferences.
host: notification projection (last turn's reason/text/tools) --session/projection--> browser
client: session list completion reminder (live, dedup) + persisted settings
-> permission + current-session visibility gate
-> new Notification("DSH finished", { body: "deploy done" })
Install
dsh plugin --profile web add https://github.com/omdsh-dev/dsh-notification/archive/refs/tags/v0.1.2.tar.gz
Restart the web server so the host half and the served client bundle pick up the plugin. The default dsh web profile has the required client composition (the session list, the settings shell, and locale).
The settings section lives under Settings > Notifications.
Settings
| Setting | Default | Effect |
|---|---|---|
| Enable notifications | on | Master switch; off stops every notification while keeping rules. |
| Notify on completed / error / aborted / blocked / token limit | completed + error on, rest off | Which turn-end reasons notify (the host projection reports the reason). |
| Keyword rules | none | Include/exclude filters matched against the session title, the turn's reply text, and its tool names. Include rules: at least one must match. Exclude rules: a match suppresses. Rules support literal or regex matching with an optional case-sensitive flag. |
| Require manual dismiss | off | The notification stays until dismissed. |
| Only notify when the task is out of view | on | Suppress a notification only when its session is currently in view. A completion still notifies while the page is hidden or while another session/workspace is open. Turn it off to notify even for the session being watched. Notifications for the same session replace each other. |
Preferences persist in the browser (localStorage). The section also grants browser permission and sends a test notification.
Configuration
Host-side tunables live on the plugin row in cordis.yml:
- id: dsh-notification
name: dsh-notification
config:
maxBodyChars: 400 # projection body budget; longer replies are ellipsized host-side
Model experience
| Aspect | Effect |
|---|---|
| Token cost | None — notifications are UI-only and never enter a request. |
| Tool calls | None — the model gets no new tool. |
| Session log | Unchanged — the projection reads the existing log and adds no events. |
| Prompt | Unchanged — no system-prompt section is registered. |
Permission boundary
- The host folds a pure projection over the session log (turn reason, bounded reply text, tool names) and the projection seam delivers it to the browser; the plugin writes nothing to the log and registers no model-facing tools.
- The client watches the session list's completion reminder (a live "finished while not selected" edge the runtime already computes) and shows a notification only when the user has granted Notification permission.
- Rule matching runs client-side against the projected content; the reply body never exceeds
maxBodyChars.
Development
pnpm install # links the sibling dsh checkout for build and tests
pnpm run check # typecheck + tests + build
pnpm run test # vitest (host projection + composition, client decision/runner/helpers/section)
pnpm run build # esbuild host/client/invariant bundles + tsc declarations
The repo expects the harness checkout at ../dsh for the dev-time link: resolutions. The composition spec boots the real SessionStore and SessionProjectionRegistry and proves the fold.
Known limitations
- Notifications require the page to be open (the browser shows them while it is hidden, but not after the tab is closed) and Notification permission granted; a denied site permission cannot be overridden from inside the page.
- Notifications fire once per finished turn (a running→idle edge on any session); a completion that happened while the page was disconnected is not re-notified on reconnect.
- The rule subject is the session title plus the last turn's reply text and tool names — earlier turns are not matched.
- Notification body is a flat text snippet; the click action only focuses the window (no deep link to the turn).
License
MIT
收录徽章
[](https://deepseek-plugin.org/plugins/omdsh-dev/dsh-notification)把这段 markdown 粘贴到你的 GitHub README,链接回本插件详情页。徽章只声明已被本站收录,不代表安全认证。