Skip to content
dsh.fish
Bundle

dsh-done-notify

dsh 插件:离开页面时 agent 完成任务/等待审批/提问,弹系统通知,点击跳回会话

Source
Britneycode
stars
1 stars
License
BSD-3-Clause
Updated
Updated yesterday

Readme

# dsh-done-notify

DSH(DeepSeek Harness)插件:**离开页面时,agent 有了动静就弹系统通知,点一下跳回对应会话。**

dsh web 的标签页标题只显示当前会话名——切去别的窗口干活时,agent 完成一轮、
发出审批卡、或者停下来向你提问,你完全无感知;切回来才发现它已经卡了半小时。

## 功能

- **任务完成提醒**:任意会话的 agent 完成一轮(`api-session/status` running 翻转),
  若 dsh 窗口不在前台,弹系统通知(Web Notification)。
- **等待审批提醒**:agent 发出审批卡时提醒——它会一直停在那里等你,这是最不该错过的通知。
- **提问等待回答提醒**:agent 向你提问停下时提醒。
- **点击跳回**:点击通知聚焦 dsh 窗口并打开对应会话。
- **多标签页去重**:多个 dsh 标签页同时开着时,同一事件只弹一次(BroadcastChannel 认领,尽力而为)。
- **子代理不吵**:subagent 会话的完成事件不提醒(父会话会继续产生自己的完成)。
- 同一会话 20 秒内只提醒一次;同一会话+类型的弹窗会被浏览器自动替换不堆叠。

设置入口:**设置 → 离开提醒**。首次使用点「请求系统通知权限」,再点「发送测试通知」验证。

## 可配置项

| 开关 | 默认 | 说明 |
| --- | --- | --- |
| 启用离开提醒 | 开 | 总开关 |
| 仅在窗口未聚焦时提醒 | 开 | 关闭后,dsh 在前台时后台会话完成也会弹(前台内宿主侧栏本就有绿点) |
| 等待审批时提醒 | 开 | |
| 提问等待回答时提醒 | 开 | |

配置存于浏览器 localStorage(键 `dsh-done-notify.config.v1`)。

## 已知边界

- 通知依赖浏览器权限:在系统/浏览器层面全局关闭通知时插件无法弹窗(设置面板会显示权限状态)。
- 审批/提问载荷的文本字段是尽力抽取(未知 schema 下可能只显示类型不显示内容),跳转不受影响。
- 页面完全关闭后没有通知——插件运行在 dsh web 页面内。需要"关掉浏览器也有通知"请配合
  [dsh-attention](https://github.com/Gaq152/dsh-attention)(审批/提问的 Windows 原生 Toast)。

## 开发

```bash
DSH_CHECKOUT=<dsh checkout 路径> npm run typecheck
DSH_CHECKOUT=<dsh checkout 路径> npm run build
npm test
```

纯判定逻辑在 `src/notify-rules.ts`(客户端与测试共用);客户端实现
`src/client/index.ts`;服务端入口为空壳(本插件零服务端行为)。

Install

dsh plugin --profile web add github:Britneycode/dsh-done-notify

Profile: web

  • This package builds from source on install. pnpm will ask you to allow its build script — that is permission to run the package’s code on your machine, outside the agent sandbox. Only allow sources you trust.
  • This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.
Source