zhengjy01
dsh-notify
System-level desktop notifications for DeepSeek Harness: turn-completion / workflow-end banners and a modal approval alert (macOS osascript, Linux notify-send)
- Stars
- 0
- Language
- JavaScript
- Created
- Aug 15, 2026
- Updated
- Aug 15, 2026
Introduction
dsh-notify — 系统级弹窗提示插件
DSH 服务端插件:在操作系统层面弹出系统通知,提醒你 DSH 里的重要事件,这样你不需要一直盯着浏览器页面。
触发时机
| 事件 | 弹窗类型 | 默认 |
|---|---|---|
主会话任务回复完成(turn/end completed,非子代理会话) | 系统横幅「会话名 · 任务完成」 | 开 |
主会话任务出错(turn/end reason=error) | 模态弹窗「会话名 · 任务失败」+ 提示音 | 开 |
主会话任务中断(turn/end reason=aborted / max-tokens / blocked) | 系统横幅「会话名 · 任务中断」 | 开 |
单个工具调用失败(tools/result isError) | 系统横幅「会话名 · 工具失败」 | 开 |
目标完成(goal/changed phase=complete) | 系统横幅「会话名 · 目标已完成」 | 开 |
目标受阻(goal/changed phase=blocked) | 模态弹窗「会话名 · 目标受阻」 | 开 |
工作流执行完成(tool-workflow/run-end) | 系统横幅「会话名 · 工作流执行完成」 | 开 |
需要人工确认:工具请求权限(approval/asked) | 模态弹窗「会话名 · 需要人工确认」+ 提示音 | 开 |
权限请求被自动拒绝(策略为 never) | 系统横幅「会话名 · 权限请求(已自动拒绝)」 | 开(随上项) |
子代理(后台子任务)回合结束(turn/end,子代理会话) | 系统横幅「会话名 · 子任务完成」 | 关 |
说明:
- 标题带会话名:所有弹窗标题使用对应会话的名称(取自会话的
session/title事件),超长自动截断(18 字符 + …);没有标题时回退到会话 ID 前 8 位。 - 工具失败防刷屏:同一会话内两次工具失败提醒默认至少间隔 60 秒(
toolErrorCooldownMs);也可用toolErrorAllowlist只提醒关键工具(如["bash", "ssh_exec"])。 - 严重度分级:真正失败(出错)、目标受阻和需要人工审批 → 模态弹窗(必须点击确认)并播放提示音;完成、中断、自动拒绝等 → 通知中心横幅(不打断操作)。
- macOS:模态用
osascript display alert ... as critical,横幅用display notification;Linux:统一notify-send,模态场景用-u critical(紧急级别,常驻直到点击);其他平台:仅记录日志。 - 权限策略为
ask时,审批请求弹出模态对话框提醒你去 DSH 界面审批;策略为never时请求会被自动拒绝,只发一条横幅告知「已自动拒绝」,不会弹模态框打扰你。 - 弹窗随进程 detached 执行、不阻塞 DSH 服务器。
安装
标准 DSH 插件包安装方式(任选其一),安装后重启 dsh web 生效:
# 本地开发(link 方式,指向本仓库路径)
dsh plugin --profile web add link:/Users/zhengjunyao/Documents/DSH-test/dsh-notify
# 发布到 GitHub 之后(仓库需打上 dsh-plugin topic)
dsh plugin --profile web add github:<your-account>/dsh-notify
备选:仓库内自带 scripts/install.mjs(拷贝到 ~/.dsh/profiles/node_modules/dsh-notify),但推荐使用上面的标准方式。
配置
插件的 cordis.patch.yml 提供默认配置;安装后可在 profile 的 patch 层覆盖(例如 ~/.dsh/profiles/web/cordis.patch.yml):
- patch:
- id: notify
config:
notifyTurnEnd: true # 主会话任务完成横幅
notifyTurnError: true # 主会话任务失败:error→模态弹窗,中止/超限/受阻→横幅
notifySubagentEnd: false # 子任务完成横幅(默认关,避免刷屏)
notifyWorkflowEnd: true # 工作流完成横幅
notifyApproval: true # 需要人工确认弹窗 / 自动拒绝横幅
notifyToolError: true # 单个工具调用失败横幅(每会话冷却 + 可选白名单防刷屏)
toolErrorAllowlist: [] # 只提醒这些工具名,空 = 全部(如 ["bash", "ssh_exec"])
toolErrorCooldownMs: 60000 # 同一会话两次工具失败提醒的最小间隔(毫秒)
notifyGoalComplete: true # 目标完成横幅
notifyGoalBlocked: true # 目标受阻模态弹窗
sound: true # 弹窗时播放提示音
改完配置后同样需要重启 dsh web。
手动验证
不需要重启也能验证弹窗本身是否可用:
osascript -e 'display notification "测试" with title "DSH" sound name "Glass"'
osascript -e 'display alert "DSH" message "测试" as critical'
发布到社区
- 将本仓库推到你的 GitHub(记得把
package.json的repository.url改成实际地址)。 - 在仓库设置 → Topics 添加
dsh-plugin,让全世界的 DSH 用户能搜索到并一键安装。 - (可选)登记到社区市场/列表,如 dsh-market、awesome-dsh-plugin。
- (可选)官方插件脚手架仍在讨论中,可到 deepseek-ai/deepseek-harness Discussion #1629 留言反馈,推动官方发布通道落地。