dsh-notify
baka-world
DeepSeek Harness desktop notification plugin (notify-send / D-Bus)
PROJECT TOPICS
PROJECT README
DeepSeek Harness Web GUI 的消息提醒插件:任务回合执行结束、或执行到需要用户确认时,按配置向所选渠道发送提醒,并在设置面板提供「消息提醒」菜单页。
| 渠道 | 位置 | 说明 |
|---|---|---|
| 浏览器通知(页面内横幅)+ 系统原生通知(可选) | 客户端 | 两个独立设置项:「浏览器通知」在页面可见时于右上角弹出文字横幅;「系统原生通知」通过浏览器 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}}。
turn/end:回合结束,按 triggers.turnEndKinds 过滤(completed/blocked/aborted/error,默认 completed+blocked)。approval/asked:工具调用等待用户审批(宿主机渠道)。tool/call(name 为 ask_user_question):模型通过提问工具向用户提问,等待用户回答(宿主机渠道)。宿主机的系统/Webhook 渠道覆盖所有会话;浏览器渠道跟随当前打开的会话。
从 GitHub 安装到 web profile(需要 pnpm 在 PATH 上;没有则用下面的 corepack 方式):
npx @deepseek-ai/dsh plugin --profile web add "github:c-ling/dsh-plugin-notify#v1.2.0"
或使用已有的 dsh 命令:
dsh plugin --profile web add "github:c-ling/dsh-plugin-notify#v1.2.0"
pnpm 不在 PATH 上时:
cd ~/.dsh/profiles/web
corepack pnpm add "github:c-ling/dsh-plugin-notify#v1.2.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;设置页「设置 → 消息提醒」可配置并逐渠道发送测试消息。
dsh plugin --profile web add "github:c-ling/dsh-plugin-notify#v1.2.0"
# 或:npx @deepseek-ai/dsh plugin --profile web add "github:c-ling/dsh-plugin-notify#v1.2.0"
# 或:cd ~/.dsh/profiles/web && corepack pnpm add "github:c-ling/dsh-plugin-notify#v1.2.0"
用新的 #v1.2.0 重新执行安装命令即可升级依赖;cordis.patch.yml 中的 loader 行保持不变。
重启 dsh web,然后硬刷新页面。
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.section 与 shell.overlay 插槽注册。宿主端为纯 Node 内置模块实现(无 @deepseek-ai/* 依赖),通过 webServer 服务注册三条路由并订阅 session/event 事件流。
接口:
GET /dsh-plugin-notify/config — 脱敏后的当前配置 + secretSetPOST /dsh-plugin-notify/config — { config, clearSecrets? } 整体替换用户可编辑配置POST /dsh-plugin-notify/test — { channel: "system" | "feishu" | "dingtalk" | "wecom" | "generic", genericId? } 发送测试消息ask_user_question 提问通知:模型调用 ask_user_question 时,系统通知与飞书/钉钉/企业微信/通用 Webhook 会发送「等待回答」提醒;修复浏览器原生通知因固定 tag 导致连续审批/提问只显示首条的问题。README.md 改为中文,英文文档移至 README-en.md(删除 README-ZH.md),安装命令统一固定到 #v1.1.3。README.md + 中文 README-ZH.md(顶部互相切换),补充 npx @deepseek-ai/dsh plugin ... 安装方式与「更新」章节,安装命令统一固定到 #v1.1.2。--dsw-alias-* 设计变量,跟随明暗主题。config.json 中但未加密;请勿在通用 Webhook 的地址或请求头中放置其他敏感凭据。CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。