Bundle
@dsh-external/dsh-notify
dsh 任务完成时推送手机通知(Bark / Server酱 / 任意 webhook)
- Source
- NkhszkQAQ
- stars
- 1 stars
- Updated
- Updated 14 days ago
Readme
# dsh-notify 🔔
dsh 任务完成时推送手机通知。监听 `turn/end` 事件(一轮任务结束),通过 Bark(iPhone)/ Server酱(微信)/ 任意 webhook 提醒你。
## 1. 准备推送通道(二选一)
**方案 A:Bark(iPhone,推荐)**
1. App Store 装 Bark
2. 打开 App,复制你的推送地址,形如:`https://api.day.app/xxxxxxxxxxxx`
**方案 B:Server酱(微信)**
1. 打开 sct.ftqq.com,微信扫码登录
2. 复制 SendKey,拼接成:`https://sctapi.ftqq.com/<SendKey>.send`
## 2. 配置 webhook
```bash
export DSH_NOTIFY_WEBHOOK="https://api.day.app/xxxxxxxxxxxx"
```
或在 cordis.patch.yml 的插件条目里加 config(效果相同):
```yaml
- insert:
- id: dsh-notify
name: '@dsh-external/dsh-notify'
config:
webhook: 'https://api.day.app/xxxxxxxxxxxx'
```
## 3. 挂载插件
```bash
dsh plugin --profile web add link:/Users/nkhszk/.openclaw/workspace/dsh-notify
```
## 4. 重启生效
```bash
dsh web
```
## 5. 验证
在 dsh 里随便跑一个任务,完成后手机应该收到"✅ dsh 任务完成"推送。
没有收到?看终端日志:`[dsh-notify] 发送失败: ...` 会告诉你原因。
## 可选配置
| 字段 | 默认值 | 说明 |
| --- | --- | --- |
| `webhook` | 环境变量 `DSH_NOTIFY_WEBHOOK` | 推送地址 |
| `title` | `✅ dsh 任务完成` | 通知标题 |
| `debounceMs` | `10000` | 防抖毫秒数,10 秒内只发一条 |
## 备注
- 插件是纯 ESM 的 `.js`,无需 TypeScript 编译,`link:` 挂载后直接用
- dsh 目前是 v0.1 预览版,事件名/API 可能变动;若 `turn/end` 失效,检查官方事件目录 `packages/core/session/src/known-event-types.ts`
Install
dsh plugin --profile web add github:NkhszkQAQ/dsh-notify
Profile: web
With the hub plugin installed, ask your agent to install it by name — it resolves the same plan shown here.
dsh plugin --profile web add github:stvlynn/dsh.fish#path:packages/dsh-plugin-hub
install dsh-external-dsh-notify from the hub
- This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.