DSH Plugin Store
Back to home

c-ling

dsh-plugin-notify

DeepSeek Harness 消息提醒插件:回合结束或等待确认时向浏览器、系统、飞书/钉钉/企业微信/通用 Webhook 发送通知

Stars
1
Language
JavaScript
Created
Aug 14, 2026
Updated
Aug 14, 2026
Web UI
GitHub repoHomepage

Introduction

dsh-plugin-notify

DeepSeek Harness Web GUI 的消息提醒插件:任务回合执行结束、或执行到需要用户确认时,按配置向所选渠道发送提醒,并在设置面板提供「消息提醒」菜单页。

dsh-plugin topic license

渠道

渠道位置说明
浏览器通知(页面内横幅)+ 系统原生通知(可选)客户端两个独立设置项:「浏览器通知」在页面可见时于右上角弹出文字横幅;「系统原生通知」通过浏览器 Notification API 弹出操作系统通知,标签页在后台/最小化时也能收到(需浏览器通知权限);完全离开页面时请配合系统通知使用
系统通知宿主机macOS osascript / Linux notify-send / Windows PowerShell 原生 toast(Windows 10/11 操作中心),浏览器关闭也能收到;可选系统提示音(macOS afplay / Windows 系统内置提示音)
飞书群机器人宿主机文本消息,可选签名密钥(timestamp + HMAC-SHA256),可选自定义消息模板
钉钉群机器人宿主机文本消息,可选加签(timestamp + sign),可选自定义消息模板
企业微信群机器人宿主机文本消息,可选自定义消息模板
通用 Webhook宿主机自定义 URL + headers + JSON/文本模板,占位符 {{title}} {{body}} {{kind}} {{sessionId}} {{turn}} {{toolName}} {{reason}} {{time}},可对接 Slack / Discord / ntfy / Bark / Server酱 / PushPlus 等

消息格式

所有 Webhook 渠道共用同一套占位符:{{title}} {{body}} {{kind}} {{sessionId}} {{turn}} {{toolName}} {{reason}} {{time}}

  • 飞书/钉钉/企业微信默认使用统一格式(标题 + 详情 + 会话 + 本地时间),在设置页的「消息模板」留空即用默认;填写后按你的模板渲染。
  • 通用 Webhook 的模板留空时发送纯文本消息正文。

触发

  • turn/end:回合结束,按 triggers.turnEndKinds 过滤(completed/blocked/aborted/error,默认 completed+blocked)。
  • approval/asked:工具调用等待用户审批(宿主机渠道)。
  • 浏览器渠道额外覆盖等待用户确认的交互(审批/提问,来自会话快照的 pending 列表)。

宿主机的系统/Webhook 渠道覆盖所有会话;浏览器渠道跟随当前打开的会话。

安装

从 GitHub 安装到 web profile(需要 pnpmPATH 上;没有则用下面的 corepack 方式):

dsh plugin --profile web add "github:c-ling/dsh-plugin-notify#v1.1.0"

pnpm 不在 PATH 上时:

cd ~/.dsh/profiles/web
corepack pnpm add "github:c-ling/dsh-plugin-notify#v1.1.0"

dsh plugin 把参数原样转发给 pnpm,直接从本仓库拉取包(pnpm 9+,本机需装有 git)。 安装时若看到 declares no dsh.bundle — installed as a plain dependency 的提示属正常现象: 本插件不是 profile bundle 层,而是通过下面的 loader 行激活。

然后在 ~/.dsh/profiles/web/cordis.patch.yml 增加一行插入:

- insert:
    - id: notify
      name: 'dsh-plugin-notify'

重启 dsh web(client-modules 按进程缓存包裁决,新包必须重启宿主),然后硬刷新页面。 设置页位于「设置 → 消息提醒」。

验证

curl -s http://127.0.0.1:3080/plugins/dsh-plugin-notify/client.js | head -c 60

应输出 window.__ModuleLoader__.load({ 开头的 factory bundle;设置页「设置 → 消息提醒」可配置并逐渠道发送测试消息。

卸载

cd ~/.dsh/profiles/web
corepack pnpm remove dsh-plugin-notify   # 或 dsh plugin --profile web remove dsh-plugin-notify

同时删除 cordis.patch.yml 中对应的 insert 行,然后重启 dsh web。 配置数据保留在 $DSH_HOME/storages/dsh-plugin-notify/config.json,删除该目录即可彻底清除。

配置存储

配置保存在 $DSH_HOME/storages/dsh-plugin-notify/config.json(可通过插件行的 config.directory 覆盖)。Webhook 签名密钥为只写字段:接口读回空串并用 secretSet 标记是否已配置,写入时空串表示保持不变,clearSecrets 列出要清除的路径。Webhook 地址与通用请求头以明文保存,请勿在其中放置敏感凭据(除飞书/钉钉签名密钥外)。

开发

node --check lib/index.js lib/client.js
node --test

客户端为手写 factory-CJS bundle(window.__ModuleLoader__.load({ id: "dsh-plugin-notify", factory })),无构建步骤;UI 通过 settings.sectionshell.overlay 插槽注册。宿主端为纯 Node 内置模块实现(无 @deepseek-ai/* 依赖),通过 webServer 服务注册三条路由并订阅 session/event 事件流。

接口:

  • GET /dsh-plugin-notify/config — 脱敏后的当前配置 + secretSet
  • POST /dsh-plugin-notify/config{ config, clearSecrets? } 整体替换用户可编辑配置
  • POST /dsh-plugin-notify/test{ channel: "system" | "feishu" | "dingtalk" | "wecom" | "generic", genericId? } 发送测试消息

已知限制

  • 浏览器渠道默认是页面内文字横幅;开启「系统原生通知」后,标签页在后台或窗口最小化时也会通过浏览器 Notification API 弹出系统通知(需要浏览器通知权限,且浏览器必须保持运行)。浏览器完全关闭时请使用宿主机系统通知渠道。
  • 飞书/钉钉签名密钥仅做「只写 + 读回脱敏」,保存在本地 config.json 中但未加密;请勿在通用 Webhook 的地址或请求头中放置其他敏感凭据。

License

MIT