dsh-notify 0.1.2 → 0.1.4

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/README.md CHANGED
@@ -1,8 +1,26 @@
1
1
  # dsh-notify
2
2
 
3
- > ⚠️ **AI 生成项目**:代码与文档由 AI 辅助生成,仅供学习参考,使用前请自行审查。
3
+ ![npm version](https://img.shields.io/npm/v/dsh-notify)
4
+ ![License](https://img.shields.io/github/license/Pasumao/dsh-plugin-notify)
5
+ ![AI Assisted](https://img.shields.io/badge/AI-Assisted-8A2BE2)
4
6
 
5
- dsh Windows 通知插件:agent 不再运行时(完成 / 停止 / 出错 / 等你选择 / 会话关闭)弹原生 Toast 提醒,正文标注「工作区 · 会话」,托盘常驻鲸鱼图标。
7
+ **唯一带系统托盘的 Windows 原生通知插件**:agent 不再运行时(完成 / 停止 / 出错 / 等你选择 / 会话关闭)自动弹原生 Toast,正文标注「工作区 · 会话」,任务栏托盘常驻鲸鱼图标——跑长任务时切走窗口,瞄一眼托盘就知道跑完了没。
8
+
9
+ 零运行时依赖、零构建,`dsh plugin add` 一条命令装完即用。
10
+
11
+ ## 功能
12
+
13
+ - **Windows 原生 Toast 通知**:agent 不再运行时(完成 / 停止 / 出错 / 达到输出上限 / 等你选择 / 会话关闭)自动弹系统通知,正文标注「工作区 · 会话」,一眼知道哪个会话跑完了;
14
+ - **系统托盘常驻图标**:任务栏托盘鲸鱼图标常驻,右键菜单可唤起 dsh web 页面 / 退出后台(竞品均明确不做托盘,本插件是 dsh 生态唯一);
15
+ - **防刷屏**:`rootsOnly` 默认仅根会话通知,子代理不刷屏;`cooldownMs` 同会话同类型两次通知最小间隔;
16
+ - **零运行时依赖、零构建**,`dsh plugin add` 一条命令装完即用。
17
+
18
+ ## 使用场景
19
+
20
+ - **跑长任务时切走窗口**:LLM 长生成 / 批处理跑着,切到别的应用,任务结束托盘弹通知,瞄一眼就知道结果;
21
+ - **挂机批量任务**:一晚上跑多轮任务,全部结束后收到 Toast,不用守着页面;
22
+ - **会话多开**:同时跑多个工作区会话,通知正文带「工作区 · 会话」标注,不会搞混;
23
+ - **子代理观察**:希望只关注根会话结果时保持 `rootsOnly: true` 默认值,需要观察子代理时再关掉。
6
24
 
7
25
  ## 安装
8
26
 
@@ -12,6 +30,15 @@ dsh plugin --profile web add dsh-notify
12
30
 
13
31
  GitHub 安装:`dsh plugin --profile web add github:Pasumao/dsh-plugin-notify`
14
32
 
33
+ 源码安装(本地开发 / 调试):
34
+
35
+ ```bash
36
+ git clone https://github.com/Pasumao/dsh-plugin-notify.git
37
+ cd dsh-plugin-notify
38
+ npm install
39
+ # 以 link: 方式挂载进 profile(包名 dsh-notify)
40
+ ```
41
+
15
42
  装完重启 `dsh web`,任务栏出现鲸鱼图标即生效。
16
43
 
17
44
  ## 触发时机
@@ -35,6 +62,37 @@ GitHub 安装:`dsh plugin --profile web add github:Pasumao/dsh-plugin-notify`
35
62
  node scripts/test-harness.mjs # 弹三条真实 Toast 自测
36
63
  ```
37
64
 
65
+ ## 常见问题
66
+
67
+ - **收不到通知?** 检查 Windows「设置 → 系统 → 通知」是否允许 PowerShell 显示通知,
68
+ 以及是否处于专注助手 / 勿扰时段;
69
+ - **只想根会话通知?** 保持默认 `rootsOnly: true`;需要观察子代理时再改为 `false`;
70
+ - **通知太频繁?** 调大 `cooldownMs`(默认 10000ms)即可;
71
+ - **托盘图标不见了?** 重启 dsh web;仍无则检查 `tray: true` 配置项是否被覆盖。
72
+
38
73
  ## 排障
39
74
 
40
75
  Toast 不出现:检查 Windows「通知与操作」是否允许 PowerShell 显示通知。
76
+
77
+ ## 相关插件
78
+
79
+ 本插件属于 **Pasumao 的 dsh 插件生态**,同系列已发布插件可搭配使用:
80
+
81
+ | 插件(npm) | GitHub | 说明 |
82
+ |---|---|---|
83
+ | [dsh-plugin-choice-refresh](https://www.npmjs.com/package/dsh-plugin-choice-refresh) | [GitHub 仓库](https://github.com/Pasumao/dsh-plugin-choice-refresh) | 选择增强:重新生成选项 / 更多选项 |
84
+ | [dsh-plugin-dev-kb](https://www.npmjs.com/package/dsh-plugin-dev-kb) | [GitHub 仓库](https://github.com/Pasumao/dsh-plugin-dev-kb) | 插件开发知识库(官方文档完整镜像 + 技能) |
85
+ | [dsh-plugin-image-tools](https://www.npmjs.com/package/dsh-plugin-image-tools) | [GitHub 仓库](https://github.com/Pasumao/dsh-plugin-image-tools) | 图片选择卡 + 回复内嵌图片 + 盲模型收图 |
86
+ | [dsh-plugin-table-zoom](https://www.npmjs.com/package/dsh-plugin-table-zoom) | [GitHub 仓库](https://github.com/Pasumao/dsh-plugin-table-zoom) | 聊天长表格浮窗查看 + 一键复制 Markdown |
87
+ | [dsh-plugin-workbench](https://www.npmjs.com/package/dsh-plugin-workbench) | [GitHub 仓库](https://github.com/Pasumao/dsh-plugin-workbench) | VS Code 风格文件浏览器 + 可编辑预览 |
88
+
89
+ > 本系列其余插件见 [Pasumao · dsh 插件](https://github.com/Pasumao);觉得好用欢迎到 GitHub 点 ⭐。
90
+
91
+ ## AI 生成声明
92
+
93
+ 代码与文档由 AI 辅助生成(DeepSeek Harness),均经人工审查与实机验证
94
+ (`scripts/test-harness.mjs` 弹真实 Toast 自测)。
95
+
96
+ ## License
97
+
98
+ [MIT](./LICENSE)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-notify",
3
3
  "description": "DeepSeek Harness (dsh) Windows notification plugin: a native toast when the agent stops running (finished / aborted / error / waiting for your choice / session closed), plus a system-tray icon. Pure host-side, zero dependencies, zero build.",
4
- "version": "0.1.2",
4
+ "version": "0.1.4",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -14,7 +14,8 @@
14
14
  "scripts",
15
15
  "cordis.patch.yml",
16
16
  "README.md",
17
- "设计文稿.md"
17
+ "设计文稿.md",
18
+ "LICENSE"
18
19
  ],
19
20
  "scripts": {
20
21
  "smoke": "powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/smoke-notice.ps1",
@@ -0,0 +1,30 @@
1
+ // 最小自检:发布前验证结构完整(离线、零依赖)。node scripts/selfcheck.mjs
2
+ import { readFileSync, existsSync } from "node:fs";
3
+ import { join, dirname } from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+
6
+ const root = join(dirname(fileURLToPath(import.meta.url)), "..");
7
+ const failures = [];
8
+
9
+ const pkgPath = join(root, "package.json");
10
+ if (!existsSync(pkgPath)) failures.push("缺 package.json");
11
+ else {
12
+ let pkg;
13
+ try { pkg = JSON.parse(readFileSync(pkgPath, "utf8")); }
14
+ catch { failures.push("package.json 解析失败"); pkg = {}; }
15
+ if (pkg.name && pkg.main && !existsSync(join(root, pkg.main)))
16
+ failures.push(`入口不存在: ${pkg.main}`);
17
+ if (pkg.dsh?.bundle?.patch && !existsSync(join(root, pkg.dsh.bundle.patch)))
18
+ failures.push(`bundle patch 不存在: ${pkg.dsh.bundle.patch}`);
19
+ }
20
+
21
+ for (const f of ["README.md", "LICENSE"]) {
22
+ if (!existsSync(join(root, f))) failures.push(`缺 ${f}`);
23
+ }
24
+
25
+ if (failures.length) {
26
+ for (const f of failures) console.error(`[FAIL] ${f}`);
27
+ console.error(`${failures.length} 项失败`);
28
+ process.exit(1);
29
+ }
30
+ console.log("[PASS] 结构完整,可发布");
@@ -24,7 +24,7 @@ const ctx = {
24
24
  list: () => [
25
25
  {
26
26
  id: 'ws-1',
27
- path: 'C:\\Users\\18303\\Desktop\\dsh-plugin-notify',
27
+ path: 'D:\\dsh\\plugins\\dsh-plugin-notify',
28
28
  title: 'dsh-plugin-notify',
29
29
  sessionIds: ['test-session'],
30
30
  },
@@ -55,7 +55,7 @@ const emit = (name, ...args) => {
55
55
 
56
56
  const session = {
57
57
  id: 'test-session',
58
- header: { cwd: 'C:\\Users\\18303\\Desktop\\dsh-plugin-notify' }, // 无 delegationDepth = 根会话
58
+ header: { cwd: 'D:\\dsh\\plugins\\dsh-plugin-notify' }, // 无 delegationDepth = 根会话
59
59
  // 会话日志(与真实 dsh Session.events 同形):含 session/title 事件。
60
60
  events: [{ type: 'session/title', data: { title: '画一只赛博朋克猫' } }],
61
61
  }
@@ -25,7 +25,7 @@
25
25
  ## 3. 架构
26
26
 
27
27
  ```
28
- C:\Users\18303\Desktop\dsh-plugin-notify\
28
+ D:\dsh\plugins\dsh-plugin-notify\
29
29
  ├── package.json # dsh-notify;main: lib/index.js;dsh.bundle.patch: ./cordis.patch.yml
30
30
  ├── cordis.patch.yml # bundle 补丁:- insert 注册 dsh-plugin-notify 行
31
31
  ├── lib/index.js # host 半区:事件订阅 + 状态机 + Toast 派发 + 托盘图标
@@ -94,8 +94,8 @@ patch 条目 `config`(全部有默认值,见 `README.md` 表格)。核心
94
94
 
95
95
  1. **npm**(推荐):`dsh plugin --profile web add dsh-notify`。
96
96
  2. **GitHub**:`dsh plugin --profile web add github:Pasumao/dsh-plugin-notify`(零构建,一般无需 allowBuilds)。
97
- 3. **本地路径**:`dsh plugin --profile web add C:/Users/18303/Desktop/dsh-plugin-notify`。
98
- 4. **手动 link**(旧版流程):dependencies 加 `"dsh-notify": "link:C:/Users/18303/Desktop/dsh-plugin-notify"` 后 `pnpm install`。
97
+ 3. **本地路径**:`dsh plugin --profile web add D:/dsh/plugins/dsh-plugin-notify`。
98
+ 4. **手动 link**(旧版流程):dependencies 加 `"dsh-notify": "link:D:/dsh/plugins/dsh-plugin-notify"` 后 `pnpm install`。
99
99
 
100
100
  装完重启 `dsh web`(托盘图标出现即加载成功)。调整行为时在用户层 `cordis.patch.yml` 按 id 覆盖 config。
101
101