dsh
OpenPetsHQ/openpets将 DeepSeek Harness 的生命周期状态、错误与审批请求,桥接到本地运行的 OpenPets 桌面伙伴。
系统级桌面通知:回合完成 / 工作流完成横幅,需要审批时弹出模态提醒(macOS osascript / Linux notify-send)。
English | 中文
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 位。toolErrorCooldownMs);也可用 toolErrorAllowlist 只提醒关键工具(如 ["bash", "ssh_exec"])。osascript display alert ... as critical,横幅用 display notification;Linux:统一 notify-send,模态场景用 -u critical(紧急级别,常驻直到点击);其他平台:仅记录日志。ask 时,审批请求弹出模态对话框提醒你去 DSH 界面审批;策略为 never 时请求会被自动拒绝,只发一条横幅告知「已自动拒绝」,不会弹模态框打扰你。标准 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'
package.json 的 repository.url 改成实际地址)。dsh-plugin,让全世界的 DSH 用户能搜索到并一键安装。