dsh-meow-notifier 0.0.0-stage → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +138 -2
- package/client.js +606 -0
- package/cordis.patch.yml +5 -0
- package/host.js +1083 -0
- package/icon.svg +13 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +56 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Oliver-314
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,139 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-meow-notifier
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://github.com/Oliver-314/dsh-meow-notifier/actions/workflows/test.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/dsh-meow-notifier)
|
|
5
|
+
[](https://github.com/Oliver-314/dsh-meow-notifier/blob/main/LICENSE)
|
|
6
|
+
|
|
7
|
+
把 DeepSeek Harness 的关键状态推送到手机,离开电脑时也能收到项目的最新消息。支持 [MeoW](https://www.chuckfang.com/MeoW/api_doc.html)、[Bark](https://bark.day.app)(iOS)和 [ntfy](https://docs.ntfy.sh/publish/)(Android / 跨平台),**填写多个渠道会同时发送**。
|
|
8
|
+
|
|
9
|
+
- **任务完成 / 出错 / 中止**:一轮工作结束、Agent 回到空闲时发送。
|
|
10
|
+
- **等待你确认**:工具调用需要批准且等待超过 2 秒时发送(自动批准或秒答不会打扰)。
|
|
11
|
+
- **AI 向你提问**:`ask_user_question` 等待回答时发送。
|
|
12
|
+
- 插件挂在 profile 层,**所有工作区、所有会话**(含新开会话)都生效。
|
|
13
|
+
|
|
14
|
+
## 推送渠道
|
|
15
|
+
|
|
16
|
+
| 渠道 | 平台 | 需要填写 | 可选 |
|
|
17
|
+
|---|---|---|---|
|
|
18
|
+
| MeoW | 国内可用 | 昵称 | 通知分类 |
|
|
19
|
+
| Bark | iOS | 设备 key | 自建服务器地址 |
|
|
20
|
+
| ntfy | Android / 跨平台 | 主题 | 自建服务器地址、访问令牌 |
|
|
21
|
+
|
|
22
|
+
只填一个渠道也能用;填几个就向几个渠道发送。某个渠道失败不会影响其他渠道,设置页会逐个显示结果。
|
|
23
|
+
|
|
24
|
+
## 安装
|
|
25
|
+
|
|
26
|
+
要求:DeepSeek Harness 0.2.x,Node 22+。
|
|
27
|
+
|
|
28
|
+
从 npm 安装:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
dsh plugin add dsh-meow-notifier
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
从源码安装(本地目录会被链接,修改后需重启 Harness 加载 Host 代码):
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
git clone https://github.com/Oliver-314/dsh-meow-notifier.git
|
|
38
|
+
dsh plugin add ./dsh-meow-notifier
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
也可以在 Web 界面的 **插件(Plugins) → Add plugin** 里填包名或本地目录,安装后启用 **推送通知(Push Notifications)**。
|
|
42
|
+
|
|
43
|
+
## 配置
|
|
44
|
+
|
|
45
|
+
1. 打开侧边栏 **插件(Plugins) → Installed plugins → 推送通知**。
|
|
46
|
+
2. 按需填写推送渠道:
|
|
47
|
+
- **MeoW**:MeoW App 里注册的昵称。昵称需完全一致,多次输错可能导致 IP 被封禁。
|
|
48
|
+
- **Bark(iOS)**:Bark App 里的设备 key。也可以直接粘贴 App 显示的 `https://api.day.app/<key>`,会自动识别。
|
|
49
|
+
- **ntfy(Android / 跨平台)**:在 ntfy App 里订阅的主题名。主题相当于密码,请使用不易猜到的随机名字;受保护的主题再填访问令牌(`tk_...`)。
|
|
50
|
+
3. 可选:修改通知分类(最多 10 个字,Bark 用它作为通知分组)、三类通知开关和消息格式。
|
|
51
|
+
4. 点 **保存**,再点 **发送测试通知** 确认手机能收到;会向所有已填写的渠道发送。
|
|
52
|
+
5. 页面底部会显示“最近一次通知”的逐渠道结果,便于排查。
|
|
53
|
+
|
|
54
|
+
### 消息格式
|
|
55
|
+
|
|
56
|
+
手机通知大约能显示 180 个字符,页面提供三档:
|
|
57
|
+
|
|
58
|
+
| 格式 | 内容 | 长度 |
|
|
59
|
+
|---|---|---|
|
|
60
|
+
| 完整版 | 会话、项目 + 完整回复摘要 | 最长 260 字,可能被客户端截断 |
|
|
61
|
+
| 精简版(默认) | `已完成 · 会话` + 项目 + 一句话摘要 | 正文 ≤ 160 字 |
|
|
62
|
+
| 仅状态 | `已完成 · 会话` | 约 10–20 字 |
|
|
63
|
+
|
|
64
|
+
状态词包括:`已完成 / 出错 / 已中止 / 超出长度上限 / 被阻断 / 等待确认 / 需要回答`。精简版的摘要是本地取回复的第一句话,不调用模型,不产生额外费用。
|
|
65
|
+
|
|
66
|
+
设置保存在 `$DSH_HOME/meow-notify/state.json`(默认 `~/.dsh/meow-notify/state.json`),包含昵称、Bark 设备 key、ntfy 主题与令牌;除各渠道自身的接口外不会上传任何内容。
|
|
67
|
+
|
|
68
|
+
## 工作原理
|
|
69
|
+
|
|
70
|
+
插件是一个 DSH bundle,包含两部分:
|
|
71
|
+
|
|
72
|
+
| 部分 | 文件 | 职责 |
|
|
73
|
+
|---|---|---|
|
|
74
|
+
| Host 半 | `host.js` | 监听 `agent/status`、`approval/request`、`user-questions/request`,组装消息并发送到各渠道;在 `/meow-notify/api/` 下提供设置读写和测试发送的路由 |
|
|
75
|
+
| 浏览器半 | `client.js` | 在插件页注册 `plugins.bundle.config`,渲染设置表单(React 来自浏览器模块表,样式使用 `--dsw-alias-*` 主题变量) |
|
|
76
|
+
|
|
77
|
+
Host 半是纯 ESM,浏览器半是 `window.__ModuleLoader__` 工厂格式,**没有构建步骤,也没有运行时依赖**。
|
|
78
|
+
|
|
79
|
+
发送队列串行执行:最小间隔 4.5 秒,避免触发渠道限流;MeoW 另有每小时 60 条、每天 1000 条的上限。推送不是幂等操作,超时、断连或服务端错误都不自动重试。仅当 Harness 对外公布的地址不是 `127.0.0.1` / `localhost` 时,通知才附带打开链接。
|
|
80
|
+
|
|
81
|
+
各渠道的请求形状:
|
|
82
|
+
|
|
83
|
+
| 渠道 | 请求 | 成功判定 |
|
|
84
|
+
|---|---|---|
|
|
85
|
+
| MeoW | `POST https://api.chuckfang.com/<昵称>`,JSON `{title,msg,url?,category?}` | 业务 JSON 中 `status=200` 且 `data=true` |
|
|
86
|
+
| Bark | `POST <服务器>/push`,JSON `{device_key,title,body,group,level,url?}` | `code=200`;等待确认用 `timeSensitive` |
|
|
87
|
+
| ntfy | `POST <服务器>/`,JSON `{topic,title,message,priority,tags,click?}`,令牌走 `Authorization: Bearer` | 返回带 `id` 的 JSON;等待确认 priority 4,其余 3 |
|
|
88
|
+
|
|
89
|
+
## 已知限制
|
|
90
|
+
|
|
91
|
+
- MeoW 每天允许输错昵称 3 次,超过会封禁 IP 一天;昵称务必与 App 中完全一致。
|
|
92
|
+
- 尽量避免通过多人共享的公共出口 IP 发送:同一 IP 向多个昵称推送可能被判定为攻击流量。
|
|
93
|
+
- ntfy.sh 免费额度约为每天 250 条、每秒 1 次请求,且同一出口 IP 共享额度;量大时建议自建服务器。
|
|
94
|
+
- Bark 设备 key 和 ntfy 主题都相当于密码:拿到 key 的人可以向你推送,拿到主题的人可以订阅你的消息。不要把它们提交到仓库或发给他人。
|
|
95
|
+
- 当前会话审批策略为 `never` 时工具调用会被自动拒绝,不会产生“等待确认”提醒;需要把权限策略调到会询问的模式。
|
|
96
|
+
- 所有渠道都只发送纯文本,不支持 Markdown。
|
|
97
|
+
|
|
98
|
+
## 开发
|
|
99
|
+
|
|
100
|
+
没有依赖需要安装。克隆后直接跑测试:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
npm test
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
或者分别运行:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
node test/host.test.mjs # 事件、消息组装、限流、发送队列
|
|
110
|
+
node test/style.test.mjs # 三种消息格式的长度与内容
|
|
111
|
+
node test/channels.test.mjs # 多渠道分发、优先级与失败聚合
|
|
112
|
+
node test/client.test.mjs # 设置页渲染冒烟
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
修改 Host 代码后需要重启 Harness 才会加载新模块(Node ESM 缓存);浏览器半由客户端按文件变更刷新。
|
|
116
|
+
|
|
117
|
+
发布说明见 [RELEASING.md](https://github.com/Oliver-314/dsh-meow-notifier/blob/main/RELEASING.md),贡献指南见 [CONTRIBUTING.md](https://github.com/Oliver-314/dsh-meow-notifier/blob/main/CONTRIBUTING.md),安全问题见 [SECURITY.md](https://github.com/Oliver-314/dsh-meow-notifier/blob/main/SECURITY.md)。
|
|
118
|
+
|
|
119
|
+
## English
|
|
120
|
+
|
|
121
|
+
Push DeepSeek Harness task completion, approval, and question alerts to your phone through MeoW, Bark (iOS), or ntfy (Android / cross-platform). Every configured channel receives each notification.
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
dsh plugin add dsh-meow-notifier
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Open **Plugins → Push Notifications** and fill in at least one channel:
|
|
128
|
+
|
|
129
|
+
- **MeoW**: the nickname registered in the MeoW app.
|
|
130
|
+
- **Bark**: the device key from the Bark app; a full `https://api.day.app/<key>` URL is accepted too.
|
|
131
|
+
- **ntfy**: the topic you subscribed to in the ntfy app. Topics act like passwords, so pick an unguessable name; add an access token for protected topics.
|
|
132
|
+
|
|
133
|
+
Save, then send a test notification. Completion messages carry the session title, project folder, and the last reply; approvals and questions wait 2 and 1.5 seconds so instant answers stay quiet.
|
|
134
|
+
|
|
135
|
+
Phone clients show roughly 180 characters, so the page offers three formats: **Full**, **Compact** (default, one sentence, ≤ 160 characters), and **Status only** (for example `已完成 · 重构登录页`). The summary is local text processing and never calls a model. Pushes are spaced 4.5 seconds apart and capped at 60 per hour for MeoW; a failing channel never blocks the others.
|
|
136
|
+
|
|
137
|
+
## License
|
|
138
|
+
|
|
139
|
+
[MIT](https://github.com/Oliver-314/dsh-meow-notifier/blob/main/LICENSE)
|