dsh-notice-center 1.2.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.
Files changed (52) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +165 -0
  3. package/assets/audio/README.md +25 -0
  4. package/assets/audio/alert-01.mp3 +0 -0
  5. package/assets/audio/alert-02.mp3 +0 -0
  6. package/assets/audio/alert-03.mp3 +0 -0
  7. package/assets/audio/alert-04.mp3 +0 -0
  8. package/assets/audio/alert-05.mp3 +0 -0
  9. package/assets/audio/alert-06.mp3 +0 -0
  10. package/assets/audio/alert-07.mp3 +0 -0
  11. package/assets/audio/alert-08.mp3 +0 -0
  12. package/assets/audio/alert-09.mp3 +0 -0
  13. package/assets/audio/alert-10.mp3 +0 -0
  14. package/assets/audio/bip-bop-01.mp3 +0 -0
  15. package/assets/audio/bip-bop-02.mp3 +0 -0
  16. package/assets/audio/bip-bop-03.mp3 +0 -0
  17. package/assets/audio/bip-bop-04.mp3 +0 -0
  18. package/assets/audio/bip-bop-05.mp3 +0 -0
  19. package/assets/audio/bip-bop-06.mp3 +0 -0
  20. package/assets/audio/bip-bop-07.mp3 +0 -0
  21. package/assets/audio/bip-bop-08.mp3 +0 -0
  22. package/assets/audio/bip-bop-09.mp3 +0 -0
  23. package/assets/audio/bip-bop-10.mp3 +0 -0
  24. package/assets/audio/nope-01.mp3 +0 -0
  25. package/assets/audio/nope-02.mp3 +0 -0
  26. package/assets/audio/nope-03.mp3 +0 -0
  27. package/assets/audio/nope-04.mp3 +0 -0
  28. package/assets/audio/nope-05.mp3 +0 -0
  29. package/assets/audio/nope-06.mp3 +0 -0
  30. package/assets/audio/nope-07.mp3 +0 -0
  31. package/assets/audio/nope-08.mp3 +0 -0
  32. package/assets/audio/nope-09.mp3 +0 -0
  33. package/assets/audio/nope-10.mp3 +0 -0
  34. package/assets/audio/nope-11.mp3 +0 -0
  35. package/assets/audio/nope-12.mp3 +0 -0
  36. package/assets/audio/staplebops-01.mp3 +0 -0
  37. package/assets/audio/staplebops-02.mp3 +0 -0
  38. package/assets/audio/staplebops-03.mp3 +0 -0
  39. package/assets/audio/staplebops-04.mp3 +0 -0
  40. package/assets/audio/staplebops-05.mp3 +0 -0
  41. package/assets/audio/staplebops-06.mp3 +0 -0
  42. package/assets/audio/staplebops-07.mp3 +0 -0
  43. package/assets/audio/yup-01.mp3 +0 -0
  44. package/assets/audio/yup-02.mp3 +0 -0
  45. package/assets/audio/yup-03.mp3 +0 -0
  46. package/assets/audio/yup-04.mp3 +0 -0
  47. package/assets/audio/yup-05.mp3 +0 -0
  48. package/assets/audio/yup-06.mp3 +0 -0
  49. package/cordis.patch.yml +9 -0
  50. package/lib/client.cjs +1157 -0
  51. package/lib/index.mjs +126 -0
  52. package/package.json +71 -0
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 dsh-done-whale contributors
4
+ Copyright (c) 2026 dsh-notice-center contributors (derived work, MIT)
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,165 @@
1
+ # dsh-notice-center 🔔🐋
2
+
3
+ [![test](https://github.com/SCP-QQ/dsh-notice-center/actions/workflows/test.yml/badge.svg)](https://github.com/SCP-QQ/dsh-notice-center/actions/workflows/test.yml)
4
+
5
+ DeepSeek Harness 的**通知中心**:把标签页鲸鱼图标变成状态灯,并在你不在看的时候主动提醒你 —— 会话跑完了,或者有事情等你拍板。
6
+
7
+ 包名 `dsh-notice-center`、插件实例 id `notice-center`、设置命名空间 `notice-center`。
8
+
9
+ ## 界面
10
+
11
+ 设置 → **通知中心**(侧栏导航项):
12
+
13
+ <img src="docs/images/settings.png" width="440" alt="通知中心设置页">
14
+
15
+ ## 功能
16
+
17
+ ### 1. 鲸鱼状态灯(favicon 状态机)
18
+
19
+ | 鲸鱼颜色 | 含义 | 什么时候恢复 |
20
+ |---|---|---|
21
+ | 🟢 绿色 | 有会话在您没看它的时候**跑完了** | 点开该会话后自动恢复;全部看完回黑 |
22
+ | 🟠 琥珀色 | 有会话**有事等您处理**:提问 / 审批 / 计划审核 | 处理完后自动消失 |
23
+ | ⚫ 黑色 | 一切正常(官方原版图标) | 默认状态 |
24
+
25
+ 标签页上的样子(绿 = 有会话跑完了):
26
+
27
+ ![标签页状态灯](docs/images/tab-status-light.png)
28
+
29
+ 颜色与侧边栏的绿点、琥珀点**用的是同一份官方信号**,永远同步。只响应主会话,子代理不影响。绿色与琥珀同时存在时显示绿色。
30
+
31
+ 三种颜色都可以在设置页改(含「默认色」,不配置则沿用官方原版图标)。
32
+
33
+ ### 2. 系统通知
34
+
35
+ - **完成通知**:会话 `completed` 由 false → true 时触发
36
+ - **待处理通知**:出现新的待处理交互时触发
37
+ - **通知文案**:标题=会话名(多条聚合时补 `+N`),正文=通知类型(完成=「会话已完成」;待处理=「待审批 / 向你提问 / 计划待审核」,未知类型回退到「有交互等待处理」)
38
+ - **只在你不看的时候弹**(固定策略)——「前台」= 标签页可见**且**窗口有焦点;切到别的标签页、最小化、被别的应用压在后面时都会提醒,只有你正看着 DSH 时才不打扰
39
+ - **聚合与去重**:300ms 窗口合并,同一会话同一类型只弹一次;多条合并为「标题 +N」
40
+ - **点击通知** = 聚焦窗口并打开对应会话
41
+ - **提示音**:完成 / 待处理各自可下拉选音效(**悬浮即试听**),音量可调;开启提示音时会静音系统提示音,改用插件自带音
42
+ - **常驻可选**:可关闭「自动隐藏」,通知就一直留在屏幕上,直到你点击或手动关闭(默认开启自动隐藏,由系统自行收起)
43
+ - 通知图标跟随你配置的状态灯颜色
44
+
45
+ | 完成通知(绿) | 待处理通知(琥珀) |
46
+ |---|---|
47
+ | ![完成通知](docs/images/notification-done.png) | ![待处理通知](docs/images/notification-pending.png) |
48
+
49
+ > 通知由浏览器发出(本机是 Chrome),所以卡片上显示的是浏览器与站点 `127.0.0.1:3080`。
50
+
51
+ ### 3. 音效库
52
+
53
+ 完成提示音与待处理提示音各有一个下拉,共 **47 个条目**:45 个 opencode 内置音效 + 2 个插件自带的合成音。
54
+
55
+ | 音效包 | 条目 |
56
+ |---|---|
57
+ | 内置(合成音) | Chime Up(完成默认,上行双音)、Chime Down(待处理默认,下行双音) |
58
+ | Alert | Alert 01–10 |
59
+ | Bip-bop | Bip-bop 01–10 |
60
+ | Staplebops | Staplebops 01–07 |
61
+ | Nope | Nope 01–12 |
62
+ | Yup | Yup 01–06 |
63
+
64
+ - **悬浮即试听**:鼠标划过下拉里的条目就播该音效(120ms 防抖,扫过整列不会连成一片)
65
+ - **点选即生效**:选中后该类型通知就播这个音,当前项打 `✓`
66
+ - **样式照官方**:触发按钮=官方语言下拉的 `.selector`(36px 高、18px 圆角胶囊);面板=官方 `Menu`(`bg-layer-3` + 0.5px 描边 + 6px 圆角),条目标高用官方的 hover 填充色
67
+ - 音效由宿主半在 `/notice-center-sounds/<id>.mp3` 提供;路由不可用时**自动回退内置合成音**,不会变哑
68
+ - 老配置无需迁移:没配过音效时仍用 Chime Up / Chime Down
69
+
70
+ ## 使用
71
+
72
+ 1. **打开设置页** —— 设置 → **通知中心**
73
+ 2. **开启系统通知** —— 打开「系统通知」总开关,浏览器会弹出授权请求,选「允许」(被拒绝时设置页会提示,需要到浏览器的站点设置里恢复)
74
+ 3. **调音量 / 选音效** —— 展开「更多通知设置」:拖音量条;在「完成提示音 / 待处理提示音」下拉里**鼠标划过即可试听**,点一下选中
75
+ 4. **改颜色(可选)** —— 展开「鲸鱼状态灯」:点色块或直接填 `#RRGGBB`,行尾 ↺ 恢复默认
76
+ 5. **就这样** —— 之后你切走或最小化时,会话跑完 / 有事等你都会收到通知;点通知直接跳回那个会话
77
+
78
+ ## 安装
79
+
80
+ `dsh plugin` 是 **pnpm 的转发器**(在 profile 目录里跑 pnpm,再把新装的 bundle 补进
81
+ `dsh.profile.bundles`),所以 registry 包名、git 仓库、tarball、本地路径都能直接装。
82
+
83
+ ### 1. 从 npm 安装(推荐)
84
+
85
+ ```sh
86
+ dsh plugin --profile web add dsh-notice-center
87
+ ```
88
+
89
+ ### 2. 直接从 GitHub 装(无需先发布)
90
+
91
+ ```sh
92
+ dsh plugin --profile web add github:SCP-QQ/dsh-notice-center
93
+ # 或走 SSH(本机 HTTPS 受代理影响时)
94
+ dsh plugin --profile web add git+ssh://git@github.com/SCP-QQ/dsh-notice-center.git
95
+ ```
96
+
97
+ ### 3. 从 tarball 装(离线 / 内网分发)
98
+
99
+ ```sh
100
+ npm pack # 生成 dsh-notice-center-1.2.0.tgz
101
+ dsh plugin --profile web add ./dsh-notice-center-1.2.0.tgz
102
+ ```
103
+
104
+ ### 4. 本地 link(改代码时用)
105
+
106
+ profile 的 `dependencies` 加
107
+ `"dsh-notice-center": "link:<项目目录>/dsh-notice-center"`,
108
+ `dsh.profile.bundles` 加 `"dsh-notice-center"`。
109
+
110
+ > 前三种装完都要**重启 Harness**;宿主半的依赖只有 `@deepseek-ai/schemastery`(npm 上有),
111
+ > 不需要 profile 额外提供任何 `@deepseek-ai/*` 包。
112
+
113
+ **重启要求分两半**:改浏览器半 `lib/client.cjs` 免重启(HMR 会 stat-poll 并通知浏览器重载该插件 bundle,刷新页面可确保干净重载);**改宿主半 `lib/index.mjs` 必须重启 Harness**(宿主半热重载依赖 `cordis-plugin-hmr`,需 loader 带 `--expose-internals`,实测未生效)。首次安装与任何改名也必须重启。
114
+
115
+ ## 要求
116
+
117
+ - 官方版本 DeepSeek Harness(本机实测:Harness 0.1.5-rc.1 + 客户端包 0.1.5-rc.2,适配范围 0.1.2-rc.1+)
118
+ - 系统通知需要**安全上下文**:`http://127.0.0.1:3080` 或 `localhost` 可用;用**局域网 IP** 访问时浏览器 Notification API 不可用
119
+
120
+ ## 卸载
121
+
122
+ ```sh
123
+ dsh plugin --profile web remove dsh-notice-center
124
+ ```
125
+
126
+ 移除依赖与 `dsh.profile.bundles` 条目后重启即无残留。
127
+
128
+ ## 已知限制
129
+
130
+ - 浏览器**标签页关闭后收不到通知**(Web Push 需要服务端 + HTTPS,本地插件场景不现实;要覆盖需宿主 Toast 方案)
131
+ - 非安全上下文(局域网 IP)下 Notification API 不可用
132
+ - 刷新页面后绿色状态丢失:这是官方「已完成通知」的内存态语义,属正常现象
133
+ - 系统级勿扰模式(Windows 专注助手等)会吞掉通知,插件无法感知
134
+
135
+ ## 开发
136
+
137
+ ```sh
138
+ npm test # 宿主半 + 浏览器半冒烟测试
139
+ npm run test:host # 只跑宿主半
140
+ npm run test:client # 只跑浏览器半
141
+ ```
142
+
143
+ CI 在 push / PR 时跑同一套(`.github/workflows/test.yml`)。
144
+
145
+ ## 目录结构
146
+
147
+ ```
148
+ package.json 包元数据(dsh-notice-center)
149
+ cordis.patch.yml bundle patch 层(insert id: notice-center)
150
+ lib/index.mjs 宿主半:settings schema + /notice-center-sounds 音效路由
151
+ lib/client.cjs 浏览器半:favicon 状态机 + 系统通知 + 音效库 + 设置页
152
+ assets/audio/*.mp3 45 个 opencode 音效(MIT;来源见 assets/audio/README.md)
153
+ docs/images/*.png README 用的截图
154
+ test/host-half.smoke.mjs 宿主半冒烟测试
155
+ test/client-half.smoke.mjs 浏览器半冒烟测试(npm test 跑两个)
156
+ .github/workflows/test.yml CI:push / PR 时跑 pnpm test
157
+ ```
158
+
159
+ ## License
160
+
161
+ MIT,完整许可文本见 [`LICENSE`](./LICENSE)。
162
+
163
+ 音效素材(`assets/audio/*.mp3`,45 个)取自 [anomalyco/opencode](https://github.com/anomalyco/opencode)
164
+ 的 `packages/ui/src/assets/audio/`,上游以 MIT 许可发布,这里保留同样的许可与署名;
165
+ 若上游调整授权,请同步替换或移除本目录(详见 [`assets/audio/README.md`](./assets/audio/README.md))。
@@ -0,0 +1,25 @@
1
+ # 音效素材(45 个 mp3)
2
+
3
+ 本目录的 `*.mp3` 不是本项目原创,来源如下:
4
+
5
+ - 上游仓库:[anomalyco/opencode](https://github.com/anomalyco/opencode)
6
+ - 上游路径:`packages/ui/src/assets/audio/`
7
+ - 上游许可:MIT(与本插件一致)
8
+ - 抓取时间:2026-09-19(取自 opencode 的 web 端构建产物,文件名即插件音效 id)
9
+
10
+ 音效包与条目(文件名 = `<包>-<序号>.mp3`):
11
+
12
+ | 包 | 条目 | 个数 |
13
+ |---|---|---|
14
+ | alert | alert-01 … alert-10 | 10 |
15
+ | bip-bop | bip-bop-01 … bip-bop-10 | 10 |
16
+ | staplebops | staplebops-01 … staplebops-07 | 7 |
17
+ | nope | nope-01 … nope-12 | 12 |
18
+ | yup | yup-01 … yup-06 | 6 |
19
+
20
+ 浏览器半把它们当作「音效库」列在下拉里(显示名与 opencode 官方设置页一致),
21
+ 宿主半通过 `/notice-center-sounds/<文件名>` 提供读取。
22
+
23
+ **替换/新增音效**:把 mp3 放进本目录后,同步两处即可 ——
24
+ `lib/client.cjs` 的 `SOUND_PACKS`(决定下拉里出现什么)与
25
+ `test/client-half.smoke.mjs` 的 `SOUND_PACKS`(守住「库与文件一一对应」)。
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,9 @@
1
+ # dsh-notice-center bundle patch layer.
2
+ #
3
+ # 插入一行宿主插件:Loader 解析到 dsh-notice-center(profile node_modules),
4
+ # 运行宿主半(最小 cordis 插件);client-modules 同时扫到本包的 dsh.client
5
+ # 元数据,把浏览器半挂进 /plugins/dsh-notice-center/client.js。
6
+ #
7
+ - insert:
8
+ - id: notice-center
9
+ name: 'dsh-notice-center'