dsh-completion-reminder 1.0.0 → 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.
package/README.md CHANGED
@@ -3,159 +3,130 @@
3
3
  为 DeepSeek Harness (DSH) Web GUI 增加 **Agent 完成提醒** 功能的插件。
4
4
  当 agent 停止生成(成功 / 主动停止 / 出错)时,弹一个通知给用户。
5
5
 
6
- 默认走 **浏览器原生通知**(`window.Notification`,首次使用需要用户授权),
7
- 并内置 **七种热门的第三方通知渠道** 供切换:
8
-
9
- | 渠道 | 适用人群 | 配置字段 |
10
- |------|----------|----------|
11
- | 🌐 **browser**(默认) | 任何浏览器 | — |
12
- | ✈️ **Telegram** | Telegram 重度用户 | `telegramBotToken` / `telegramChatId` |
13
- | 🍎 **Bark** | iPhone 用户 | `barkKey`(可选 `barkServer`) |
14
- | 📲 **Pushover** | 跨平台推送服务 | `pushoverToken` / `pushoverUserKey` |
15
- | 🐦 **Server酱** | 国内微信推送 | `serverchanSendKey` |
16
- | 🎮 **Discord** | Discord 玩家 / 团队 | `discordWebhookUrl` |
17
- | 💼 **Slack** | 团队工作区 | `slackWebhookUrl` |
18
- | 🔗 **Webhook** | 自建服务 | `webhookUrl` |
19
- | 🛠 **Custom** | 完全自定义 | `customSend(payload)` |
20
-
21
- ## 功能
22
-
23
- - 🛰 **完成即通知**:检测 DSH 输入工具栏的 send ↔ stop 按钮切换,并结合最后一条消息判断成功 / 主动停止 / 出错
24
- - 🔔 **浏览器原生通知**:`Notification` API,首次自动请求权限;未授权时回退为页面内 toast
25
- - 🌍 **七种第三方渠道**:Telegram、Bark、Pushover、Server酱、Discord、Slack、通用 Webhook,外加 Custom 钩子
26
- - 🪟 **智能抑制**:标签页可见且获得焦点时默认不响(避免打断),可通过 `suppressWhenFocused: false` 关闭
27
- - ⏱ **防刷屏**:连续完成之间默认 5 秒冷却,可调
28
- - 🎨 **标题/正文可定制**:`titleTemplate` / `bodyTemplate` 接收上下文返回字符串
29
- - 🪪 **可观测性**:`onNotify` / `onError` 钩子方便调试与对接
30
- - ⚡ **装了即用**:声明 `dsh.bundle.patch`,`dsh plugin add` 时由 DSH 自动加入 profile 层并激活
31
- - 📦 **npm 分发**:CI 自动构建、发布、创建 GitHub Release
6
+ - 🌐 默认走 **浏览器原生通知**(`window.Notification`,首次使用需要用户授权)
7
+ - ⚙️ 直接在 DSH 自己的 **「设置 → 🔔 提醒」** 里配置(与 General / Models / Plugins 同级)
8
+ - 🔒 **凭证按渠道筛选**:选 Telegram 只显示 2 项,选 Bark 只显示 1–2 项,不会一下子蹦出 11 个无关字段
9
+ - 🎨 **暗色 / 亮色主题都正常**(`color-scheme: light dark` + 显式前景色,再无「白底白字」)
10
+ - 💾 配置保存在本浏览器 `localStorage`,不会上传任何服务器
11
+ - 🧪 配置面板自带 **「发送测试通知」** 按钮,方便验证渠道是否通
12
+ - 🪟 标签页可见时默认静默(不打断工作),可通过开关关闭
13
+ - 内置 5 秒冷却,避免连续 agent 完成时刷屏
32
14
 
33
- ## 快速开始
15
+ ## 9 种通知渠道
34
16
 
35
- ### npm 安装(推荐)
17
+ | 渠道 | 适用人群 | 配置字段(按当前渠道只显示需要的) |
18
+ |------|----------|--------------------|
19
+ | 🌐 **browser**(默认) | 任何浏览器 | 无 |
20
+ | ✈️ **Telegram** | Telegram 重度用户 | Bot Token / Chat ID |
21
+ | 🍎 **Bark** | iPhone 用户 | Bark Key / Bark Server(可选) |
22
+ | 📲 **Pushover** | 跨平台推送服务 | App Token / User Key / Device(可选) |
23
+ | 🐦 **Server酱** | 国内微信推送 | SendKey |
24
+ | 🎮 **Discord** | Discord 玩家 / 团队 | Webhook URL |
25
+ | 💼 **Slack** | 团队工作区 | Webhook URL |
26
+ | 🔗 **Webhook** | 自建服务 | URL |
27
+ | 🛠 **Custom** | 完全自定义 | 占位(`customSend(payload)`) |
36
28
 
37
- ```bash
38
- dsh plugin --profile web add dsh-completion-reminder
39
- ```
29
+ ## 工作原理(v1.2)
40
30
 
41
- 插件包内自带 `cordis.patch.yml`(insert 注册项)并在 `package.json` 声明 `dsh.bundle.patch`。
42
- `dsh plugin add` 完成依赖安装后,DSH 会自动把插件加入 profile 的 bundles 层堆栈,重启后即生效。
31
+ ### 1. 完成检测
43
32
 
44
- 如果遇到 `ERR_PNPM_ADDING_TO_ROOT`(profile 目录是 pnpm workspace root),补一个 `-w`:
33
+ DSH composer 卡片 `<div data-composer-card="true">` 内的主按钮 `aria-label` 会在
34
+ `"Stop generating"` / `"Send message"`(中文 UI 是 `"停止生成"` / `"发送消息"`)之间切换。
35
+ 插件用 `MutationObserver` 监听这个属性变化:
45
36
 
46
- ```bash
47
- dsh plugin --profile web add -w dsh-completion-reminder
48
- ```
37
+ - 检测到 `Stop generating` → 记录开始时间
38
+ - 检测到 `Send message` 触发完成事件
39
+ - 根据 `data-phase`(`active` / `settling` / `hero`)和最后一条 `data-role="assistant"`
40
+ 消息的文本/类名,判断 `success` / `stopped` / `error`
41
+ - 派发到当前渠道,调用 `Notification` / `fetch` 发送
49
42
 
50
- 然后重启:
43
+ 所有匹配都用 **稳定属性**(`data-*`、`aria-label`、`type`),不依赖 CSS-modules 哈希后的 class 名。
51
44
 
52
- ```bash
53
- dsh web
54
- ```
45
+ ### 2. 设置面板
55
46
 
56
- 打开任一会话并触发一次 agent 回复,应该会看到「请求通知权限」的浏览器弹窗。
57
- 授权后,等任务结束即可看到通知。
47
+ 通过 DSH 的 `ctx.slots.inject('settings.section', ...)` API,插件把自己注册成
48
+ DSH 设置弹窗里的一节。点击 DSH 侧边栏的「设置」→「🔔 提醒」即可看到:
58
49
 
59
- ## 配置
50
+ - 通知渠道下拉(切换渠道时,凭证区**实时刷新**)
51
+ - 当前渠道**只显示需要的字段**(不需要在 11 个无关字段里翻找)
52
+ - 行为开关(成功 / 停止 / 出错 / 焦点抑制 / 自动请求权限 / 冷却)
53
+ - 「发送测试通知」 / 「重置」 / 「请求权限」三个动作
60
54
 
61
- ```javascript
62
- DSHCompletionReminder.configure({
63
- provider: 'telegram', // 'browser' (default) | 'telegram' | 'bark' | 'pushover'
64
- // | 'serverchan' | 'discord' | 'slack'
65
- // | 'webhook' | 'custom'
66
- autoRequestPermission: true, // 浏览器模式下自动请求 Notification 权限
67
- notifyOnSuccess: true, // 成功完成时通知
68
- notifyOnStopped: true, // 用户主动停止时通知
69
- notifyOnError: true, // agent 出错时通知
70
- suppressWhenFocused: true, // 标签页可见且有焦点时不响
71
- cooldownMs: 5000, // 连续通知之间的最小间隔
72
- titleTemplate: ({ status }) => 'DSH 已结束', // 自定义标题
73
- bodyTemplate: ({ model, durationMs }) => `${model} · 用时 ${durationMs}ms`,
74
- iconUrl: '/favicon.ico',
75
- clickUrl: location.href,
76
-
77
- providers: {
78
- telegramBotToken: '123456:ABC...',
79
- telegramChatId: '987654321',
80
-
81
- // barkKey / pushover* / serverchanSendKey / discordWebhookUrl /
82
- // slackWebhookUrl / webhookUrl 只需按当前 provider 填写。
83
- },
55
+ **没多出任何悬浮按钮**,UI 与 DSH 原生设置完全一致。
84
56
 
85
- onNotify: (payload, provider) => console.log('delivered via', provider, payload),
86
- onError: (err, provider) => console.warn('failed via', provider, err),
87
- });
57
+ ### 3. 降级
88
58
 
89
- DSHCompletionReminder.activate();
90
- DSHCompletionReminder.deactivate();
91
- ```
59
+ 如果加载时 DSH host 不支持 `ctx.slots`(极旧版本或非标准 host),
60
+ 插件会退回到「DOM 检测 + 浏览器通知」基础模式,
61
+ 并显示一条底部提示引导用户去设置面板。
92
62
 
93
- ### 只走「页面内 toast」?
63
+ ## 快速开始
94
64
 
95
- `provider` 设为 `'browser'` 即可。如果用户拒绝浏览器通知权限,插件会自动
96
- 回退为页面内的浮动提示,不需要任何额外配置。
65
+ ### 安装 / 升级
97
66
 
98
- ### 切换到 Telegram?
67
+ ```bash
68
+ dsh plugin --profile web update dsh-completion-reminder
69
+ dsh web # 重启
70
+ ```
71
+
72
+ ### 配置
73
+
74
+ 1. 打开 DSH → 点击左上角「设置」(齿轮图标)
75
+ 2. 在左侧 nav 找到「🔔 提醒」
76
+ 3. 选择通知渠道(如 `Telegram`)
77
+ 4. 填入对应的 token / id(凭证区只显示当前渠道需要的字段)
78
+ 5. 点击「发送测试通知」验证渠道通不通
79
+ 6. 关闭弹窗 → 自动保存到 localStorage
99
80
 
100
- 1. Telegram 中 `@BotFather` 创建 bot,拿到 `telegramBotToken`
101
- 2. 给自己发一条消息,访问 `https://api.telegram.org/bot<TOKEN>/getUpdates` 拿到 `chat.id`
102
- 3. 配置:
81
+ ### 程序化 API
103
82
 
104
83
  ```javascript
105
84
  DSHCompletionReminder.configure({
106
85
  provider: 'telegram',
107
- providers: {
108
- telegramBotToken: '<TOKEN>',
109
- telegramChatId: '<CHAT_ID>',
110
- },
86
+ providers: { telegramBotToken: '...', telegramChatId: '...' },
87
+ suppressWhenFocused: false,
88
+ cooldownMs: 3000,
89
+ onNotify: (payload, provider) => console.log('delivered via', provider, payload),
90
+ onError: (err, provider) => console.warn('failed via', provider, err),
111
91
  });
92
+ DSHCompletionReminder.activate();
93
+ DSHCompletionReminder.deactivate();
94
+ DSHCompletionReminder.requestBrowserPermission();
112
95
  ```
113
96
 
114
97
  ## 公开 API
115
98
 
116
- ```javascript
117
- DSHCompletionReminder.DEFAULTS // 默认配置
118
- DSHCompletionReminder.configure(opts) // 合并配置(多次调用累加)
119
- DSHCompletionReminder.activate() // 启动 DOM 观察与通知
120
- DSHCompletionReminder.deactivate() // 停止一切
121
- DSHCompletionReminder.requestBrowserPermission() // 手动触发 Notification 权限请求
122
- ```
123
-
124
- `apply(ctx, opts)` DSH Cordis Loader 调用的入口,等价于 `configure(opts); activate()`。
125
-
126
- ## 工作原理
127
-
128
- - `src/index.ts` 是宿主侧(node)入口,导出空 `apply`,让 Loader 能挂载本包
129
- - `src/client.ts` 是浏览器侧真正的逻辑,被打包成 `window.__ModuleLoader__.load({ factory })` 格式
130
- - 一个 `MutationObserver` 监听 `document.body`:
131
- - 关注工具栏按钮的 `aria-label` / `class` / `textContent` 变化
132
- - 检测到「running」(如 `停止` / `Stop`)→ 记录开始时间
133
- - 检测到「idle」→ 触发 `completeRun(status, durationMs)`
134
- - 读最后一条 `data-role="assistant"` 消息粗略判断 success / stopped / error
135
- - 根据 `provider` 派发到不同的通知渠道,全部走 `fetch` / `Notification`
99
+ | 方法 / 属性 | 说明 |
100
+ |------|------|
101
+ | `DSHCompletionReminder.configure(opts)` | 合并配置(与 localStorage 持久值叠加) |
102
+ | `DSHCompletionReminder.activate()` | 启动 DOM 观察 + 注册设置节 |
103
+ | `DSHCompletionReminder.deactivate()` | 停止一切,清理 UI |
104
+ | `DSHCompletionReminder.requestBrowserPermission()` | 手动触发浏览器通知权限请求 |
105
+ | `DSHCompletionReminder.apply(ctx, opts)` | DSH Cordis Loader 入口 |
106
+ | `DSHCompletionReminder.renderPanelInto(hostEl)` | 把配置面板渲染到任意 DOM 容器(主要用于测试) |
107
+ | `DSHCompletionReminder.DEFAULTS` | 默认配置(只读) |
136
108
 
137
109
  ## 项目结构
138
110
 
139
111
  ```
140
112
  dsh-completion-reminder/
141
113
  ├── package.json # npm 包配置,含 dsh.bundle.patch 与 dsh.client 声明
142
- ├── cordis.patch.yml # 包自带的 loader 注册 patch(insert 本插件)
114
+ ├── cordis.patch.yml # 包自带的 loader 注册 patch
143
115
  ├── tsconfig.json # TypeScript 配置
144
116
  ├── src/
145
117
  │ ├── index.ts # 服务端入口(桩)
146
- │ ├── client.ts # 客户端插件 TypeScript 源码
118
+ │ ├── client.ts # 客户端插件(DOM 检测 + 9 渠道 + 设置面板)
119
+ │ ├── react.d.ts # 极简 React 类型(运行时通过 DSH module 系统 require('react'))
147
120
  │ └── types.ts # 类型定义 & 默认值
148
121
  ├── lib/
149
- │ ├── index.js # 编译后的服务端入口(纯载体)
122
+ │ ├── index.js # 服务端入口
150
123
  │ └── client.js # DSH __ModuleLoader__ 格式的客户端插件
151
124
  ├── dist/
152
125
  │ └── dsh-completion-reminder.js # 独立脚本(可直接 <script> 加载)
153
126
  ├── scripts/
154
- │ ├── build-plugin.js # 构建脚本(tsc 产物 ModuleLoader 包装)
127
+ │ ├── build-plugin.js # 构建脚本(tsc + import 转换为 require + ModuleLoader 包装)
155
128
  │ └── clean.js # 清理 lib/ 和 dist/
156
- ├── .github/workflows/
157
- │ └── publish.yml # tag 推送 → 构建 → npm 发布 → GitHub Release
158
- └── test.html # 测试页面(模拟 send ↔ stop 切换)
129
+ └── probes/ # 离线 smoke test(jsdom)
159
130
  ```
160
131
 
161
132
  ## 发布流程
@@ -165,8 +136,18 @@ npm version patch # 或 minor / major
165
136
  git push origin main --tags
166
137
  ```
167
138
 
168
- 推送 `v*` tag 后 CI 自动完成构建、npm 发布和 GitHub Release。
169
- `NPM_TOKEN` 与 `GITHUB_TOKEN` 在仓库 Settings → Secrets 中配置。
139
+ CI 自动完成构建、npm 发布、GitHub Release。
140
+
141
+ ## 版本历史
142
+
143
+ - **v1.2.0** — 设置面板进入 DSH 设置弹窗 + 凭证按渠道筛选 + 暗色主题修复:
144
+ - 通过 `ctx.slots.inject('settings.section', ...)` 注册为 DSH 设置弹窗里的一节
145
+ - 凭证字段按所选渠道过滤(Telegram 2 项 / Bark 1–2 项 / Pushover 2–3 项 / 其余 1 项)
146
+ - `<select>` 与 `<input>` 强制 `color-scheme: light dark` + 显式前景色,修复暗色主题下「白底白字」看不到选项的 bug
147
+ - 不再在右下角放浮动按钮(影响美观)
148
+ - 降级路径:host 不支持 slots 时显示一次性底部提示
149
+ - **v1.1.0** — 真实 DSH DOM 锚点 + 浮动按钮 + 11 凭证字段全显示
150
+ - **v1.0.0** — 初始版本(class 名匹配,实际 DSH 上不可用)
170
151
 
171
152
  ## 许可
172
153
 
@@ -29,6 +29,7 @@
29
29
  providers: {},
30
30
  clickUrl: '',
31
31
  iconUrl: '',
32
+ showSettingsPanel: true,
32
33
  onNotify: function () { return undefined; },
33
34
  onError: function (err) { try { console.warn('[dsh-completion-reminder]', err); } catch (_e) {} },
34
35
  titleTemplate: function (ctx) {
package/install.md CHANGED
@@ -5,10 +5,10 @@
5
5
  - DeepSeek Harness (DSH) 已安装
6
6
  - 浏览器允许 `http://127.0.0.1:3080` 发送通知(首次使用时会弹权限请求)
7
7
 
8
- ## 安装(npm,推荐)
8
+ ## 安装 / 升级
9
9
 
10
10
  ```bash
11
- dsh plugin --profile web add dsh-completion-reminder
11
+ dsh plugin --profile web update dsh-completion-reminder
12
12
  ```
13
13
 
14
14
  > 如果报 `ERR_PNPM_ADDING_TO_ROOT`,说明 profile 目录是 pnpm workspace root,补一个 `-w`:
@@ -17,72 +17,58 @@ dsh plugin --profile web add dsh-completion-reminder
17
17
  > dsh plugin --profile web add -w dsh-completion-reminder
18
18
  > ```
19
19
 
20
- 插件包内自带 `cordis.patch.yml` 并声明 `dsh.bundle.patch`,
21
- `dsh plugin add` 时 DSH 会**自动**把插件加入 profile 的 bundles 层——无需手动编辑任何配置文件。
22
-
23
20
  然后重启:
24
21
 
25
22
  ```bash
26
23
  dsh web
27
24
  ```
28
25
 
29
- 启动后,浏览器地址栏左侧应该会出现「🔔 想显示通知吗?」的权限询问。
30
- 点击「允许」即可启用浏览器原生通知。
31
-
32
- ### 升级
33
-
34
- ```bash
35
- dsh plugin --profile web update dsh-completion-reminder
36
- dsh web # 重启生效
37
- ```
26
+ ## 配置通知渠道
38
27
 
39
- ## 验证安装
28
+ 1. 打开 DSH → 点击左上角「⚙ 设置」
29
+ 2. 在左侧 nav 找到「🔔 提醒」
30
+ 3. 选择通知渠道(默认 `🌐 浏览器通知`)
31
+ 4. 填入对应凭证(**凭证区只显示当前渠道需要的字段**)
32
+ 5. 调整「行为」选项(成功 / 主动停止 / 出错 是否通知、是否在标签页可见时静默、冷却时长)
33
+ 6. 点击「发送测试通知」验证渠道
34
+ 7. 关闭弹窗 → 自动保存到 localStorage
40
35
 
41
- 1. 打开或强制刷新 DSH Web GUI(http://127.0.0.1:3080,Ctrl+Shift+R)
42
- 2. 给 agent 发任意一条消息
43
- 3. 等任务结束 → 系统右下角(或顶部)出现通知:「✅ DSH Agent 已完成 · 用时 Xs」
36
+ 如果使用浏览器原生通知,第一次会弹权限询问;如果拒绝,插件会自动改用页面内浮动 toast,**不会**完全失效。
44
37
 
45
- 如果浏览器拒绝了通知权限,插件会自动改用页面内浮动 toast,**不会**完全失效。
38
+ ## 切换渠道示例
46
39
 
47
- ## 切换到第三方通知
40
+ ### Telegram
48
41
 
49
- DSH 页面打开 DevTools 控制台,运行:
42
+ 1. Telegram `@BotFather` 创建 bot,拿到 `telegramBotToken`
43
+ 2. 给自己发一条消息,访问 `https://api.telegram.org/bot<TOKEN>/getUpdates` 拿到 `chat.id`
44
+ 3. 设置面板选 `Telegram`,凭证区出现 2 个字段,填入
50
45
 
51
- ```javascript
52
- DSHCompletionReminder.configure({
53
- provider: 'telegram',
54
- providers: {
55
- telegramBotToken: '123456:ABC...',
56
- telegramChatId: '987654321',
57
- },
58
- });
59
- ```
46
+ ### Bark (iPhone)
60
47
 
61
- 随后任意一次 agent 完成都会通过 Telegram 推送到你的手机。
48
+ 1. App Store Bark
49
+ 2. 打开 Bark,记下你的设备 Key
50
+ 3. 面板里选 `Bark`,凭证区出现 2 个字段(Key + 可选 Server),填入 Key
62
51
 
63
- 可用的 provider:
52
+ ### Server酱 (微信)
64
53
 
65
- - `browser` — 浏览器原生通知(默认)
66
- - `telegram` — Telegram Bot
67
- - `bark` iPhone Bark
68
- - `pushover` — Pushover
69
- - `serverchan` — Server酱 (sct.ftqq.com)
70
- - `discord` — Discord Webhook
71
- - `slack` — Slack Webhook
72
- - `webhook` — 通用 JSON POST Webhook
73
- - `custom` — 自定义 `customSend(payload)` 函数
54
+ 1. 微信扫码登录 [sct.ftqq.com](https://sct.ftqq.com)
55
+ 2. 拿到 SendKey(以 `SCT` 开头)
56
+ 3. 面板里选 `Server酱`,凭证区出现 1 个字段
74
57
 
75
58
  ## 故障排除
76
59
 
77
60
  | 问题 | 原因 | 解决方法 |
78
61
  |------|------|----------|
79
62
  | 安装报 `ERR_PNPM_ADDING_TO_ROOT` | profile 是 pnpm workspace root | 加 `-w` 标志重新执行 |
80
- | 装了但没有通知 | 未重启 `dsh web` | 重启后强刷页面 |
63
+ | 找不到「🔔 提醒」入口 | 装的是 < v1.2.0 | `dsh plugin --profile web update dsh-completion-reminder && dsh web` |
64
+ | 设置弹窗里看不到我的字段 | 切到对应渠道才会出现 | 在下拉里选 Telegram / Bark / 其他 |
81
65
  | 浏览器没弹权限询问 | 之前已「阻止」该网站 | 浏览器地址栏左侧锁形图标 → 通知 → 允许 |
82
66
  | Telegram 报 401/400 | `telegramBotToken` / `telegramChatId` 配错 | 用 `@BotFather` 重新获取 token;用 `getUpdates` 找 chat id |
83
- | 通知频率太高 | 多个 agent 接连完成 | 调大 `cooldownMs`(默认 5000) |
84
- | 切回浏览器通知 | 想撤销 Telegram 配置 | `DSHCompletionReminder.configure({ provider: 'browser' })` |
67
+ | 测试按钮提示「Telegram provider requires…」 | 凭证未填 | 凭证区填入对应字段 |
68
+ | 通知频率太高 | 多个 agent 接连完成 | 调大「冷却(ms)」,默认 5000 |
69
+ | 切回浏览器通知 | 想撤销 Telegram 配置 | 面板顶部下拉切回 `浏览器通知` |
85
70
  | 完全停用 | — | `DSHCompletionReminder.deactivate()` |
71
+ | 重置所有配置 | — | 设置面板里点「重置」按钮 |
86
72
 
87
73
  ## 卸载
88
74
 
package/lib/client.d.ts CHANGED
@@ -1,21 +1,22 @@
1
1
  /**
2
- * DSH Completion Reminder — client half.
2
+ * DSH Completion Reminder — client half (v1.2).
3
3
  *
4
- * A DOM-based DSH client plugin that fires a notification when the agent
5
- * stops generating. The plugin watches the input toolbar (send vs stop
6
- * button) and the conversation stream to detect three terminal states:
7
- * success, user-stopped, and error.
4
+ * Strategy:
5
+ * 1. Detect agent-completion lifecycle by watching the DSH composer
6
+ * primary button's `aria-label` (which flips between "Stop
7
+ * generating" / "停止生成" and "Send message" / "发送消息") inside
8
+ * `[data-composer-card]`. The `data-phase` attribute on the
9
+ * conversation root helps disambiguate active / settling / hero.
8
10
  *
9
- * Delivery channels:
10
- * - browser : window.Notification (default; user-gated permission)
11
- * - telegram : Telegram Bot API
12
- * - bark : Apple Push (Bark) HTTP API
13
- * - pushover : Pushover REST API
14
- * - serverchan: Server酱 (sct.ftqq.com) popular in CN
15
- * - discord : Discord incoming webhook
16
- * - slack : Slack incoming webhook
17
- * - webhook : generic JSON POST webhook
18
- * - custom : user-supplied function
11
+ * 2. Register a settings section in DSH's own settings dialog via
12
+ * `ctx.slots.inject('settings.section', ...)` so the user finds the
13
+ * configuration alongside General / Models / Plugins rather than as
14
+ * an extra floating widget.
15
+ *
16
+ * 3. Filter credential fields by the currently selected provider so the
17
+ * panel stays compact (Telegram shows 2 fields, Bark shows 1, etc.).
18
+ *
19
+ * 4. Persist configuration to `localStorage` and re-load on activation.
19
20
  *
20
21
  * The plugin is packaged as a DSH client plugin (`dsh.client` in
21
22
  * package.json) and loaded through `window.__ModuleLoader__`.
@@ -27,8 +28,13 @@ declare function activate(): void;
27
28
  declare function deactivate(): void;
28
29
  declare function requestBrowserPermission(): Promise<NotificationPermission | 'unsupported'>;
29
30
  /**
30
- * DSH client plugin entry called by the Cordis Loader.
31
+ * Plugin entry point invoked by the DSH Cordis Loader.
32
+ *
33
+ * In DSH v1.x the host invokes the plugin's exported `apply(ctx, opts)`
34
+ * after the module system has been bootstrapped. We use the context
35
+ * to register a settings section.
31
36
  */
32
- declare function apply(ctx: unknown, opts?: CompletionReminderOptions): void;
33
- export { configure, activate, deactivate, apply, requestBrowserPermission, DEFAULT_OPTIONS };
37
+ declare function apply(ctx: any, opts?: CompletionReminderOptions): void;
38
+ declare function renderPanelInto(host: HTMLElement): void;
39
+ export { configure, activate, deactivate, apply, requestBrowserPermission, DEFAULT_OPTIONS, renderPanelInto };
34
40
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAEV,yBAAyB,EAK1B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,eAAe,EAGhB,MAAM,YAAY,CAAC;AA8EpB,iBAAS,SAAS,CAAC,IAAI,CAAC,EAAE,yBAAyB,GAAG,IAAI,CAUzD;AAED,iBAAS,QAAQ,IAAI,IAAI,CAcxB;AAED,iBAAS,UAAU,IAAI,IAAI,CAQ1B;AAWD,iBAAe,wBAAwB,IAAI,OAAO,CAAC,sBAAsB,GAAG,aAAa,CAAC,CAczF;AA2jBD;;GAEG;AACH,iBAAS,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,yBAAyB,GAAG,IAAI,CAGnE;AAED,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,wBAAwB,EAAE,eAAe,EAAE,CAAA"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAKH,OAAO,KAAK,EAEV,yBAAyB,EAM1B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,eAAe,EAIhB,MAAM,YAAY,CAAC;AAsDpB,iBAAS,SAAS,CAAC,IAAI,CAAC,EAAE,yBAAyB,GAAG,IAAI,CAezD;AAED,iBAAS,QAAQ,IAAI,IAAI,CAexB;AAED,iBAAS,UAAU,IAAI,IAAI,CAe1B;AA4CD,iBAAe,wBAAwB,IAAI,OAAO,CAAC,sBAAsB,GAAG,aAAa,CAAC,CAczF;AAqjBD;;;;;;GAMG;AACH,iBAAS,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,yBAAyB,GAAG,IAAI,CA2C/D;AAmGD,iBAAS,eAAe,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAIhD;AA+WD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,wBAAwB,EAAE,eAAe,EAAE,eAAe,EAAE,CAAA"}