@idoall/dsh-notify 0.4.17 → 0.5.1
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/CHANGELOG.md +28 -0
- package/README.md +10 -8
- package/README.zh.md +10 -8
- package/dist/client.js +39 -7
- package/dist/index.js +7 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); this project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html). GitHub Releases use the same bilingual layout as [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness/releases/tag/dsh-v0.1.6-alpha.1).
|
|
4
4
|
|
|
5
|
+
## [0.5.1] - 2026-11-24
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- **The window no longer covers the session toolbar above the chat.** Its vertical start was still the hardcoded `56px` offset, so in a window whose header is taller than that — or at a non-100% page zoom — the card landed on the 轨迹 / 上下文 / 费用 / 统计 row. `toastTopAnchor` now measures the conversation body (`[data-conversation-content]`, falling back to `[data-conversation-scroll]`) and starts 8px below its top edge, with the old `56px` kept as the floor for a host without the hook. Because it is measured, it follows a resized header, a collapsed sidebar and a zoom change through the same observer that already re-anchored the horizontal gutter.
|
|
10
|
+
- The screen-corner placement keeps its host-aware `--dsh-toast-top-offset` variable, so 屏幕右上 still means the top of the screen rather than the top of the chat.
|
|
11
|
+
|
|
12
|
+
### Verified
|
|
13
|
+
|
|
14
|
+
- Static checks, **123 automated tests**, build and package checks pass, and the packed tarball matches this checkout byte for byte. New coverage measures the body top at 120px → a 128px start, keeps the 56px floor for a short layout and for a host without the hook, falls back to the scroll body, and the DOM test now asserts `style.top === '136px'` on the rendered frame for a body top of 128px.
|
|
15
|
+
|
|
16
|
+
## [0.5.0] - 2026-11-23
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- **The notification window now defaults to the conversation's top-left corner.** A fresh profile gets `toastPosition: 'conversation-left'`; the settings page lists it first as 会话区左上(默认), and keeps 会话区右上, 屏幕右上 and 关闭页面通知 as alternatives, so an existing choice is never rewritten. The left placement uses a new `toastLeftAnchor`, which measures the conversation column's left edge (already clear of the left sidebar) plus the same 16px gutter, with the centred-content guess as the no-hook fallback. `toastInsets` owns the edge decision: the left placement pins the inline start and clears the inline end, the other positions stay right-pinned, and a phone keeps the full-width gutter it always had.
|
|
21
|
+
- One anchor measurement (`toastAnchors`) now serves both sides, so the existing sidebar-following observer — ResizeObserver, MutationObserver, transitionend and the ~450 ms rAF follow — re-anchors the left placement exactly as it re-anchored the right one.
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- `TOAST_POSITIONS` is the single list the Host validates against, so an unknown position in a stored file or a config POST is still dropped rather than adopted.
|
|
26
|
+
- The package description and both READMEs describe the new default; the settings hint and the option labels say which position is the default.
|
|
27
|
+
|
|
28
|
+
### Verified
|
|
29
|
+
|
|
30
|
+
- Static checks, **122 automated tests**, build and package checks pass, and the packed tarball matches this checkout byte for byte. New coverage: left/right anchor measurement and fallbacks, the inset decision for all four positions plus narrow, the settings menu's option order and default, and a DOM test that renders the overlay and reads `insetInlineStart: 296px` / `insetInlineEnd: auto` off the real frame element before re-anchoring it to `376px` through a sidebar transition.
|
|
31
|
+
- Authenticated live-page verification stays unavailable: the running profile answers HTTP 401 to unauthenticated requests, so no new visual claim is made beyond the DOM assertions above.
|
|
32
|
+
|
|
5
33
|
## [0.4.17] - 2026-11-23
|
|
6
34
|
|
|
7
35
|
### Fixed
|
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
> DSH Notify is a DeepSeek Harness community plugin. It registers only a settings section and an in-page overlay; it does not modify DSH source.
|
|
24
24
|
|
|
25
|
-
When a session really stops, fails, asks a question, or needs approval, a card appears in the top-
|
|
25
|
+
When a session really stops, fails, asks a question, or needs approval, a card appears in the conversation's top-left corner of the current page. A green **Task completed** card follows DSH's native `agent/status: idle` transition — the same state that stops the session-tree spinner — rather than the earlier moment when text first looks complete. Intermediate goal rounds and queued follow-up turns stay quiet. Everything happens in the page you already have open: there is no service worker, web push, host OS notification, or notification history.
|
|
26
26
|
|
|
27
27
|
<p align="center">
|
|
28
28
|
<img src="./assets/toast.png" width="70%" alt="Enhanced notification stack: the newest error card is fully visible and earlier blue, amber and green cards expose equal lower edges">
|
|
@@ -83,7 +83,7 @@ Reload the profile or restart DSH only when its plugin host has not hot-reloaded
|
|
|
83
83
|
|
|
84
84
|
| Setting | Default | What it does |
|
|
85
85
|
| --- | --- | --- |
|
|
86
|
-
| Toast position | conversation top-
|
|
86
|
+
| Toast position | conversation top-left (default) | Anchors the overlay to the chat column's left edge, starts just below the conversation body so the session toolbar above it stays clear, and follows sidebar layout changes; top-right, screen top-right and off are the alternatives. |
|
|
87
87
|
| Notification style | **Enhanced** | Enhanced uses clear status colours and a short attention bar; Soft uses a quieter presentation. |
|
|
88
88
|
| Collapse multiple notifications | **on** | From two cards onward, show the newest card fully and stack older cards below it; hover or focus expands them. |
|
|
89
89
|
| In-page sound | **on** | Plays one cue when a polling batch admits one or more new visible Toasts, including while DSH is in a background tab. Built-ins: chime, ping, alert, silent; custom uploads are supported. |
|
|
@@ -92,7 +92,7 @@ Reload the profile or restart DSH only when its plugin host has not hot-reloaded
|
|
|
92
92
|
|
|
93
93
|
Custom sounds are stored in `<dataDir>/sounds/` in the profile data directory, not the plugin installation. Uploads are limited to 1 MB and `mp3 / m4a / aac / wav / ogg / flac`; names must be a single path segment.
|
|
94
94
|
|
|
95
|
-
Above the cards, the page shows the running version against the newest one on npm: `v0.
|
|
95
|
+
Above the cards, the page shows the running version against the newest one on npm: `v0.5.1 ✓ 最新`, `v0.5.0 ➔ v0.5.1`, or `v0.5.1 · 检查失败`. **检查更新** forces a fresh lookup (`GET /plugins/dsh-notify/update?force=1`, authenticated); a page load reuses the host's six-hour cache. When a newer version exists the row reveals `dsh plugin --profile web add @idoall/dsh-notify@<version>` with a copy button — installing it, and restarting DSH afterwards, stays your decision.
|
|
96
96
|
|
|
97
97
|
<p align="center">
|
|
98
98
|
<img src="./assets/version-check.png" width="60%" alt="DSH notification settings with the version row: v0.4.0 newest, Check for updates, GitHub, Changelog and Issues links">
|
|
@@ -100,11 +100,13 @@ Above the cards, the page shows the running version against the newest one on np
|
|
|
100
100
|
|
|
101
101
|
## Compatibility
|
|
102
102
|
|
|
103
|
-
Current release: plugin **`0.
|
|
103
|
+
Current release: plugin **`0.5.1`** is verified against DeepSeek Harness **`0.2.3-alpha.2`**.
|
|
104
104
|
|
|
105
105
|
| Plugin | Verified DeepSeek Harness | What that version is |
|
|
106
106
|
| --- | --- | --- |
|
|
107
|
-
| **`0.
|
|
107
|
+
| **`0.5.1`** | `0.2.3-alpha.2` | Fixes the window covering the session toolbar: its vertical start is now measured from the conversation body (8px below it, 56px floor) instead of a hardcoded 56px offset, and follows resizes and zoom. The screen-corner placement keeps its own variable. |
|
|
108
|
+
| `0.5.0` | `0.2.3-alpha.2` | Puts the notification window in the conversation's **top-left** corner by default — the settings page keeps the top-right corner, the screen corner and off as alternatives. Adds the left-edge anchor and re-anchors it through the same sidebar-following observer. Notification content, sounds and triggers are unchanged. |
|
|
109
|
+
| `0.4.17` | `0.2.3-alpha.2` | **Fixes two breaks on the current host.** DSH moved HTTP admission into the WebServer and removed `Connection.requestRejection` — routes now declare `auth: 'required'` and call the method only when it still exists — and moved the Session status snapshot behind a `uiSession.sessionStatus` service that throws unless injected, so the toast reads the injection-free `uiSession.pendingInteractions` source instead. `0.4.16` failed every plugin endpoint and lost in-toast answering on this host. |
|
|
108
110
|
| `0.4.16` | `0.2.2-rc.5` | Declares DSH `0.2.2-rc.5` compatible — the first RC on npm `latest`. The one break since `rc.4` is a search-provider default this plugin never touches. Of the 15 packages it binds, the six that own its interfaces are byte-identical apart from their own versions; the only other changes are the same search work and release metadata (one source-location character, the displayed host version, the reported commit). No notification source changes. |
|
|
109
111
|
| `0.4.15` | `0.2.2-rc.4` | Declares DSH `0.2.2-rc.4` compatible. The one break since `rc.3` moves the DeepSeek refusal code to `CONTENT_REFUSED`, which this plugin never classifies. Of the 15 packages it binds, everything is byte-identical apart from each `package.json`'s version; only the general-settings display version and the module loader's reported commit changed at runtime. No notification source changes. |
|
|
110
112
|
| `0.4.14` | `0.2.2-rc.3` | Declares DSH `0.2.2-rc.3` compatible and reviews every break between it and `rc.1`. Of the 15 packages it binds, nothing on its call path moved: `dsh-host-webserver`'s `register(route)` half and `dsh-client-connection`'s host half are byte-identical, and the `hoc` slot kind, `JobError` and one `web/providers-changed` declaration are all additive. No notification source changes. |
|
|
@@ -136,7 +138,7 @@ Current release: plugin **`0.4.17`** is verified against DeepSeek Harness **`0.2
|
|
|
136
138
|
- Two declarations decide whether the plugin loads at all: `dsh.engines.dsh` and every `@deepseek-ai/dsh-*` peer state the same requirement, `>=0.1.7-rc.1 <0.3.0` as of `0.4.1`. DSH refuses an incompatible bundle at profile load, so a range that excluded the running release would silently drop the plugin — which is exactly what the old `<0.2.0` ceiling would have done on the `0.2.0` release.
|
|
137
139
|
- **An interactive gate only withholds a completion while it is unanswered.** DSH resolves an execution approval and a plan review *inside* the turn that asked them (`approval.request()` awaits its outcome under an open turn; `exit_plan_mode` returns its verdict to the same turn), so the turn that resumes is the turn that asked, and its end is the user's task finishing. `0.4.2` makes that the rule; `0.3.2`–`0.4.1` suppressed the whole turn, which silently dropped the completion of every approval-gated task.
|
|
138
140
|
- `@deepseek-ai/schemastery` is a **peer**, not a plain dependency: DSH resolves only a linked plugin's peer dependencies from the running installation, so a `link:` install of this directory would otherwise fail to import the Host half.
|
|
139
|
-
- **Verified releases are listed, not just matched.** `dsh.compatibility.dshReleases` names every release this plugin was actually booted on (`0.1.7-rc.1`, `0.1.7-rc.2`, `0.2.0-rc.1`, `0.2.0-rc.2`, `0.2.1-alpha.1`, `0.2.1-alpha.3`, `0.2.1-alpha.4`, `0.2.1-alpha.5`, `0.2.1-rc.2`, `0.2.1-rc.3`, `0.2.1-rc.4`, `0.2.2-alpha.2`, `0.2.2-alpha.3`, `0.2.2-rc.1`, `0.2.2-rc.3`, `0.2.2-rc.4`, `0.2.2-rc.5`, `0.2.3-alpha.2` as of `0.
|
|
141
|
+
- **Verified releases are listed, not just matched.** `dsh.compatibility.dshReleases` names every release this plugin was actually booted on (`0.1.7-rc.1`, `0.1.7-rc.2`, `0.2.0-rc.1`, `0.2.0-rc.2`, `0.2.1-alpha.1`, `0.2.1-alpha.3`, `0.2.1-alpha.4`, `0.2.1-alpha.5`, `0.2.1-rc.2`, `0.2.1-rc.3`, `0.2.1-rc.4`, `0.2.2-alpha.2`, `0.2.2-alpha.3`, `0.2.2-rc.1`, `0.2.2-rc.3`, `0.2.2-rc.4`, `0.2.2-rc.5`, `0.2.3-alpha.2` as of `0.5.1`) and `npm run pack:check` fails when one of them falls outside the declared range. Each entry means a real boot, not a semver guess.
|
|
140
142
|
|
|
141
143
|
The screenshots below come from earlier browser verification, not a new RC visual test. This check covers interface compatibility, automated tests and live overlay registration, not a fresh visual or audio test. The layout was checked at a 390px mobile viewport: the settings controls reflow and the toast becomes full-width without falling behind the mobile sidebar.
|
|
142
144
|
|
|
@@ -169,8 +171,8 @@ npm run pack:check # publish preconditions + client registration check
|
|
|
169
171
|
Releases are tag-driven. Bump `package.json` and the lockfile root versions, synchronize both READMEs and the DSH declarations, move the matching CHANGELOG section out of `Unreleased`, write `release-notes/v<version>.md`, then push the release commit and tag:
|
|
170
172
|
|
|
171
173
|
```sh
|
|
172
|
-
git tag v0.
|
|
173
|
-
git push origin v0.
|
|
174
|
+
git tag v0.5.1
|
|
175
|
+
git push origin v0.5.1
|
|
174
176
|
```
|
|
175
177
|
|
|
176
178
|
The release workflow runs `npm run verify`, packs the plugin, publishes through npm trusted publishing (OIDC), and creates a GitHub Release with the package tarball and sha256.
|
package/README.zh.md
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
> DSH Notify 是 DeepSeek Harness 社区插件,只注册设置区块与页内浮层,不修改 DSH 源码。
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
会话真正停下、运行失败、向你提问或请求审批时,当前页面会话区的左上角会出现通知卡片。绿色**任务完成**卡以 DSH 原生 `agent/status: idle` 为准——这与左侧会话树转圈停止是同一个状态——而不是以右侧文字看起来已经结束的时刻推测。goal 自动续跑和排队的下一轮保持安静。一切发生在你已打开的页面内:没有 Service Worker、Web Push、宿主机系统通知或通知历史。
|
|
26
26
|
|
|
27
27
|
<p align="center">
|
|
28
28
|
<img src="./assets/toast.png" width="70%" alt="增强版通知堆叠:最新的失败通知完整显示,较早的蓝色、橙色和绿色通知等距露出下边缘">
|
|
@@ -83,7 +83,7 @@ dsh plugin --profile web add "link:$(pwd)"
|
|
|
83
83
|
|
|
84
84
|
| 设置项 | 默认 | 作用 |
|
|
85
85
|
| --- | --- | --- |
|
|
86
|
-
| Toast 位置 |
|
|
86
|
+
| Toast 位置 | 会话区左上(默认) | 浮层贴在聊天区左边缘,起点位于会话正文上沿下方,不遮挡上方的会话工具栏,并跟随左右侧栏布局变化;会话区右上、屏幕右上与关闭页面通知为备选。 |
|
|
87
87
|
| 通知样式 | **增强版** | 增强版使用清晰状态色和短提醒条;柔和版更克制。 |
|
|
88
88
|
| 多条通知折叠显示 | **开** | 从两条开始完整显示最新一条,旧卡叠在下方;悬停或聚焦即可展开。 |
|
|
89
89
|
| 页内提示音 | **开** | 一轮轮询只要有一条或多条新 Toast 成功进入可视队列,就播放一次提示音,即使 DSH 标签在后台。内置 chime / ping / alert / 静音,也可上传自定义声音。 |
|
|
@@ -92,7 +92,7 @@ dsh plugin --profile web add "link:$(pwd)"
|
|
|
92
92
|
|
|
93
93
|
自定义提示音保存在 profile 数据目录的 `<dataDir>/sounds/`,而非插件安装目录。上传限制 1 MB,支持 `mp3 / m4a / aac / wav / ogg / flac`,文件名必须是单段路径。
|
|
94
94
|
|
|
95
|
-
卡片上方是版本检测行:显示当前版本与 npm 上最新版本的关系——`v0.
|
|
95
|
+
卡片上方是版本检测行:显示当前版本与 npm 上最新版本的关系——`v0.5.1 ✓ 最新`、`v0.5.0 ➔ v0.5.1` 或 `v0.5.1 · 检查失败`。**检查更新**会强制重新查询(`GET /plugins/dsh-notify/update?force=1`,需通过鉴权);页面加载则复用宿主 6 小时缓存。检测到新版本时,行下方会展开 `dsh plugin --profile web add @idoall/dsh-notify@<版本>` 与复制按钮——是否安装、以及随后是否重启 DSH,都由你决定。
|
|
96
96
|
|
|
97
97
|
<p align="center">
|
|
98
98
|
<img src="./assets/version-check.png" width="60%" alt="DSH 通知设置中的版本检测行:v0.4.0 已是最新、检查更新、GitHub、更新日志与反馈 Issue 入口">
|
|
@@ -100,11 +100,13 @@ dsh plugin --profile web add "link:$(pwd)"
|
|
|
100
100
|
|
|
101
101
|
## 兼容性
|
|
102
102
|
|
|
103
|
-
当前发布:插件 **`0.
|
|
103
|
+
当前发布:插件 **`0.5.1`** 已在 DeepSeek Harness **`0.2.3-alpha.2`** 上验证。
|
|
104
104
|
|
|
105
105
|
| 插件 | 已验证的 DeepSeek Harness | 这一版是什么 |
|
|
106
106
|
| --- | --- | --- |
|
|
107
|
-
| **`0.
|
|
107
|
+
| **`0.5.1`** | `0.2.3-alpha.2` | 修复浮层盖住会话工具栏的问题:起点改为量取会话正文上沿(再下移 8px,56px 为下限),不再是写死的 56px 偏移,并随窗口尺寸与缩放跟随。屏幕右上仍用自己的变量定位。 |
|
|
108
|
+
| `0.5.0` | `0.2.3-alpha.2` | 通知浮层默认改到会话区**左上角**——设置页保留「会话区右上」「屏幕右上」「关闭页面通知」作为备选。新增左边缘锚点,并复用同一套跟随侧栏的观察器实时重定位。通知内容、提示音与触发时机均未变。 |
|
|
109
|
+
| `0.4.17` | `0.2.3-alpha.2` | **修复当前宿主上的两处断裂。** DSH 把 HTTP admission 移进 WebServer 并删除了 `Connection.requestRejection`——路由改为声明 `auth: 'required'`,仅在该方法仍存在时才调用;同时把 Session 状态快照移到需要注入的 `uiSession.sessionStatus` 服务,浮层改用无需注入的 `uiSession.pendingInteractions`。在本宿主上 `0.4.16` 的所有插件端点失败,卡片内回答也失效。 |
|
|
108
110
|
| `0.4.16` | `0.2.2-rc.5` | 声明兼容 DSH `0.2.2-rc.5`——第一个进入 npm `latest` 渠道的 RC。`rc.4` 以来唯一的破坏性变更是搜索提供方默认值,与本插件无关。它绑定的 15 个包里,决定接口的六个除自身版本号外逐字节相同;其余改动也只有同一次搜索调整与发布元数据(一个源码位置字符、界面显示的宿主版本号、上报的提交号)。通知源码无改动。 |
|
|
109
111
|
| `0.4.15` | `0.2.2-rc.4` | 声明兼容 DSH `0.2.2-rc.4`。`rc.3` 以来唯一的破坏性变更把 DeepSeek 拒答错误码改为 `CONTENT_REFUSED`,而本插件从不按该错误码分类。它绑定的 15 个包里,除各包 `package.json` 的版本号外全部逐字节相同;运行时只改了设置页显示的版本号与模块加载器上报的提交号。通知源码无改动。 |
|
|
110
112
|
| `0.4.14` | `0.2.2-rc.3` | 声明兼容 DSH `0.2.2-rc.3`,并逐条核对它与 `rc.1` 之间的全部破坏性变更。它绑定的 15 个包里,没有一处落在通知调用路径上:`dsh-host-webserver` 的 `register(route)` 半边与 `dsh-client-connection` 宿主半边逐字节相同,`hoc` 槽类型、`JobError` 与新事件声明都是叠加式的。通知源码无改动。 |
|
|
@@ -136,7 +138,7 @@ dsh plugin --profile web add "link:$(pwd)"
|
|
|
136
138
|
- 两处声明决定插件能否加载:`dsh.engines.dsh` 与每一个 `@deepseek-ai/dsh-*` peer 都写同一条要求,自 `0.4.1` 起为 `>=0.1.7-rc.1 <0.3.0`。DSH 会在 profile 加载时拒绝不兼容的 bundle,范围写错就会静默丢掉插件——旧的 `<0.2.0` 上限在 `0.2.0` 正式版上正是如此。
|
|
137
139
|
- **交互门禁只在「还没等到人回答」时压住完成通知。** DSH 的执行审批与计划审批都是在**提问的那个回合内**解决的(`approval.request()` 必须处于打开的回合中并原地等待结果;`exit_plan_mode` 把结论交回同一回合),所以接着干活的回合就是提问的那个回合,它的结束就是用户任务的完成。`0.4.2` 以此为规则;`0.3.2`–`0.4.1` 压掉了整个回合,于是每个带审批的任务都静默丢失完成通知。
|
|
138
140
|
- `@deepseek-ai/schemastery` 是 **peer**,不是普通依赖:DSH 只会把 **link 形态**插件的 peer 解析到当前安装;若仍写成普通依赖,`link:` 安装的 Host 半会导入失败。
|
|
139
|
-
- **声明的是「实测验证过的版本」,不是语义化猜测。** `dsh.compatibility.dshReleases` 列出真正启动验证过的每个版本(截至 `0.
|
|
141
|
+
- **声明的是「实测验证过的版本」,不是语义化猜测。** `dsh.compatibility.dshReleases` 列出真正启动验证过的每个版本(截至 `0.5.1`:`0.1.7-rc.1`、`0.1.7-rc.2`、`0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-alpha.1`、`0.2.1-alpha.3`、`0.2.1-alpha.4`、`0.2.1-alpha.5`、`0.2.1-rc.2`、`0.2.1-rc.3`、`0.2.1-rc.4`、`0.2.2-alpha.2`、`0.2.2-alpha.3`、`0.2.2-rc.1`、`0.2.2-rc.3`、`0.2.2-rc.4`、`0.2.2-rc.5`、`0.2.3-alpha.2`),一旦其中某个落在声明范围之外,`npm run pack:check` 会直接失败。
|
|
140
142
|
|
|
141
143
|
以下截图来自此前的浏览器验证,并非本次 RC 的新视觉测试;本次验证覆盖接口兼容性、自动化测试与实时浮层注册,不包含新的视觉或声音实测。此前在 390px 手机视口检查:设置控件会重排,Toast 会满宽显示且不会被移动端侧栏遮挡。
|
|
142
144
|
|
|
@@ -169,8 +171,8 @@ npm run pack:check # 发布前置条件 + 客户端注册校验
|
|
|
169
171
|
发版由 tag 驱动。更新 `package.json` 与锁文件根版本、同步中英文 README 和 DSH 声明、将对应 CHANGELOG 段落移出 `Unreleased`、编写 `release-notes/v<版本>.md` 后,推送发版提交与 tag:
|
|
170
172
|
|
|
171
173
|
```sh
|
|
172
|
-
git tag v0.
|
|
173
|
-
git push origin v0.
|
|
174
|
+
git tag v0.5.1
|
|
175
|
+
git push origin v0.5.1
|
|
174
176
|
```
|
|
175
177
|
|
|
176
178
|
发版工作流会运行 `npm run verify`、打包插件、通过 npm trusted publishing(OIDC)发布,并创建附带 tarball 与 sha256 的 GitHub Release。
|
package/dist/client.js
CHANGED
|
@@ -82,12 +82,17 @@ window.__ModuleLoader__.load({
|
|
|
82
82
|
statusTone: () => statusTone,
|
|
83
83
|
toastAnchor: () => toastAnchor,
|
|
84
84
|
toastAnchorWatchTargets: () => toastAnchorWatchTargets,
|
|
85
|
+
toastAnchors: () => toastAnchors,
|
|
85
86
|
toastAnswer: () => toastAnswer,
|
|
86
87
|
toastIcon: () => toastIcon,
|
|
88
|
+
toastInsets: () => toastInsets,
|
|
89
|
+
toastLeftAnchor: () => toastLeftAnchor,
|
|
87
90
|
toastOrder: () => toastOrder,
|
|
88
91
|
toastStackPlan: () => toastStackPlan,
|
|
89
92
|
toastTime: () => toastTime,
|
|
90
93
|
toastTone: () => toastTone,
|
|
94
|
+
toastTop: () => toastTop,
|
|
95
|
+
toastTopAnchor: () => toastTopAnchor,
|
|
91
96
|
updateChipText: () => updateChipText,
|
|
92
97
|
updateCommand: () => updateCommand,
|
|
93
98
|
updateTone: () => updateTone,
|
|
@@ -142,6 +147,33 @@ window.__ModuleLoader__.load({
|
|
|
142
147
|
const right = rect && rect.width > 0 ? Math.min(rect.right, innerWidth) : null;
|
|
143
148
|
return right === null ? Math.max(16, (innerWidth - fallbackContentWidth) / 2 + 16) : Math.max(16, innerWidth - right + 16);
|
|
144
149
|
}
|
|
150
|
+
function toastLeftAnchor({ document: doc = globalThis.document, innerWidth = globalThis.innerWidth, fallbackContentWidth = 720 } = {}) {
|
|
151
|
+
const rect = doc?.querySelector?.("[data-conversation-scroll]")?.getBoundingClientRect?.();
|
|
152
|
+
const left = rect && rect.width > 0 && typeof rect.left === "number" ? Math.min(rect.left, innerWidth) : null;
|
|
153
|
+
return left === null ? Math.max(16, (innerWidth - fallbackContentWidth) / 2 + 16) : Math.max(16, left + 16);
|
|
154
|
+
}
|
|
155
|
+
var TOAST_TOP_FLOOR = 56;
|
|
156
|
+
var TOAST_TOP_GAP = 8;
|
|
157
|
+
function toastTopAnchor({ document: doc = globalThis.document, minimum = TOAST_TOP_FLOOR, gap = TOAST_TOP_GAP } = {}) {
|
|
158
|
+
const rectOf = (selector) => {
|
|
159
|
+
const rect2 = doc?.querySelector?.(selector)?.getBoundingClientRect?.();
|
|
160
|
+
return rect2 && rect2.height > 0 && typeof rect2.top === "number" ? rect2 : null;
|
|
161
|
+
};
|
|
162
|
+
const rect = rectOf("[data-conversation-content]") ?? rectOf("[data-conversation-scroll]");
|
|
163
|
+
return rect === null ? minimum : Math.max(minimum, Math.round(rect.top) + gap);
|
|
164
|
+
}
|
|
165
|
+
function toastTop({ position = "conversation-left", anchor = { top: TOAST_TOP_FLOOR } } = {}) {
|
|
166
|
+
if (position === "viewport") return "calc(env(safe-area-inset-top, 0px) + var(--dsh-toast-top-offset, 56px))";
|
|
167
|
+
return `${anchor.top ?? TOAST_TOP_FLOOR}px`;
|
|
168
|
+
}
|
|
169
|
+
function toastInsets({ narrow = false, position = "conversation-left", anchor = { right: 16, left: 16 } } = {}) {
|
|
170
|
+
if (narrow) return { insetInlineStart: "auto", insetInlineEnd: 12 };
|
|
171
|
+
if (position === "conversation-left") return { insetInlineStart: `${anchor.left}px`, insetInlineEnd: "auto" };
|
|
172
|
+
return { insetInlineStart: "auto", insetInlineEnd: `${position === "viewport" ? 16 : anchor.right}px` };
|
|
173
|
+
}
|
|
174
|
+
function toastAnchors(options = {}) {
|
|
175
|
+
return { right: toastAnchor(options), left: toastLeftAnchor(options), top: toastTopAnchor(options) };
|
|
176
|
+
}
|
|
145
177
|
function toastAnchorWatchTargets(doc = globalThis.document) {
|
|
146
178
|
const nodes = [];
|
|
147
179
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -164,7 +196,7 @@ window.__ModuleLoader__.load({
|
|
|
164
196
|
let raf = 0;
|
|
165
197
|
let followingUntil = 0;
|
|
166
198
|
const observed = /* @__PURE__ */ new Set();
|
|
167
|
-
const measure = () => onChange(
|
|
199
|
+
const measure = () => onChange(toastAnchors({ document: doc, innerWidth: win.innerWidth }));
|
|
168
200
|
const tick = () => {
|
|
169
201
|
measure();
|
|
170
202
|
const now = typeof win.performance?.now === "function" ? win.performance.now() : Date.now();
|
|
@@ -561,7 +593,7 @@ window.__ModuleLoader__.load({
|
|
|
561
593
|
if (tone === "info") return import_react.default.createElement("svg", shared, import_react.default.createElement("circle", { cx: 10, cy: 10, r: 7 }), import_react.default.createElement("path", { d: "M10 9.2v4M10 6.7h.01" }));
|
|
562
594
|
return import_react.default.createElement("svg", shared, import_react.default.createElement("path", { d: "M10 3.2a4.3 4.3 0 0 0-4.3 4.3c0 3.2-1.2 4.2-1.2 4.2h11s-1.2-1-1.2-4.2A4.3 4.3 0 0 0 10 3.2z" }), import_react.default.createElement("path", { d: "M8.6 14.4a1.6 1.6 0 0 0 2.8 0" }));
|
|
563
595
|
}
|
|
564
|
-
var toastConfig = { toastPosition: "conversation", toastEnabled: true, notificationStyle: "strong", stackCollapsed: true, soundEnabled: true, sound: "chime" };
|
|
596
|
+
var toastConfig = { toastPosition: "conversation-left", toastEnabled: true, notificationStyle: "strong", stackCollapsed: true, soundEnabled: true, sound: "chime" };
|
|
565
597
|
function createSoundPlayer({ audio = globalThis, AudioContextClass, AudioElementClass } = {}) {
|
|
566
598
|
let context = null;
|
|
567
599
|
let unlocked = false;
|
|
@@ -781,7 +813,7 @@ window.__ModuleLoader__.load({
|
|
|
781
813
|
const state = useNotificationState({ sessions, pendingInteractions });
|
|
782
814
|
const [, refresh] = import_react.default.useState(0);
|
|
783
815
|
const [cards, setCards] = import_react.default.useState([]);
|
|
784
|
-
const [anchor, setAnchor] = import_react.default.useState(() =>
|
|
816
|
+
const [anchor, setAnchor] = import_react.default.useState(() => toastAnchors());
|
|
785
817
|
const [expanded, setExpanded] = import_react.default.useState(false);
|
|
786
818
|
const [forcedCollapsed, setForcedCollapsed] = import_react.default.useState(false);
|
|
787
819
|
const [, rerender] = import_react.default.useState(0);
|
|
@@ -860,9 +892,9 @@ window.__ModuleLoader__.load({
|
|
|
860
892
|
globalThis.addEventListener?.("dsh-notify:toast-config", onConfig);
|
|
861
893
|
return () => globalThis.removeEventListener?.("dsh-notify:toast-config", onConfig);
|
|
862
894
|
}, []);
|
|
863
|
-
import_react.default.useEffect(() => watchToastAnchor((next) => setAnchor((prev) => prev === next ? prev : next)), []);
|
|
895
|
+
import_react.default.useEffect(() => watchToastAnchor((next) => setAnchor((prev) => prev.right === next.right && prev.left === next.left && prev.top === next.top ? prev : next)), []);
|
|
864
896
|
import_react.default.useEffect(() => {
|
|
865
|
-
setAnchor(
|
|
897
|
+
setAnchor(toastAnchors());
|
|
866
898
|
}, [cards.length]);
|
|
867
899
|
import_react.default.useEffect(() => () => {
|
|
868
900
|
for (const id of exits.current.values()) clearTimeout(id);
|
|
@@ -1116,7 +1148,7 @@ window.__ModuleLoader__.load({
|
|
|
1116
1148
|
ref: frameRef,
|
|
1117
1149
|
popover: "manual",
|
|
1118
1150
|
className: "dsh-notify-frame",
|
|
1119
|
-
style: { inset: "auto",
|
|
1151
|
+
style: { inset: "auto", ...toastInsets({ narrow, position: toastConfig.toastPosition, anchor }), bottom: "auto", top: toastTop({ position: toastConfig.toastPosition, anchor }), width: narrow ? "calc(100vw - 24px)" : "min(360px, calc(100vw - 32px))", height: `${frame.windowHeight + (clearAllVisible ? clearAllStrip : 0)}px`, margin: 0, padding: 0, border: 0, background: "transparent", overflow: "visible" }
|
|
1120
1152
|
},
|
|
1121
1153
|
clearAllVisible ? import_react.default.createElement(
|
|
1122
1154
|
"div",
|
|
@@ -1341,7 +1373,7 @@ window.__ModuleLoader__.load({
|
|
|
1341
1373
|
import_react.default.createElement(
|
|
1342
1374
|
"div",
|
|
1343
1375
|
{ className: "dsh-notify-rows" },
|
|
1344
|
-
import_react.default.createElement("div", { className: "dsh-notify-setting-field" }, copy("\u901A\u77E5\u4F4D\u7F6E", "\u9ED8\u8BA4\u51FA\u73B0\u5728\u4F1A\u8BDD\u533A\
|
|
1376
|
+
import_react.default.createElement("div", { className: "dsh-notify-setting-field" }, copy("\u901A\u77E5\u4F4D\u7F6E", "\u9ED8\u8BA4\u51FA\u73B0\u5728\u4F1A\u8BDD\u533A\u5DE6\u4E0A\u89D2\uFF1B\u4E5F\u53EF\u4EE5\u6362\u6210\u53F3\u4E0A\u3001\u5C4F\u5E55\u53F3\u4E0A\uFF0C\u6216\u53EA\u4FDD\u7559\u58F0\u97F3\u3002"), import_react.default.createElement("select", { className: "dsh-notify-select", "aria-label": "\u901A\u77E5\u4F4D\u7F6E", value: config.toastPosition || "conversation-left", onChange: (event) => update({ toastPosition: event.target.value }) }, import_react.default.createElement("option", { value: "conversation-left" }, "\u4F1A\u8BDD\u533A\u5DE6\u4E0A\uFF08\u9ED8\u8BA4\uFF09"), import_react.default.createElement("option", { value: "conversation" }, "\u4F1A\u8BDD\u533A\u53F3\u4E0A"), import_react.default.createElement("option", { value: "viewport" }, "\u5C4F\u5E55\u53F3\u4E0A"), import_react.default.createElement("option", { value: "off" }, "\u5173\u95ED\u9875\u9762\u901A\u77E5"))),
|
|
1345
1377
|
import_react.default.createElement("div", { className: "dsh-notify-setting-field" }, copy("\u901A\u77E5\u6837\u5F0F", "\u589E\u5F3A\u7248\u4F7F\u7528\u6E05\u6670\u72B6\u6001\u8272\u4E0E\u77ED\u6682\u63D0\u9192\u6761\uFF1B\u67D4\u548C\u7248\u66F4\u63A5\u8FD1\u5F53\u524D\u98CE\u683C\u3002"), import_react.default.createElement("div", { className: "dsh-notify-segmented", role: "group", "aria-label": "\u901A\u77E5\u6837\u5F0F" }, ...["strong", "soft"].map((value) => import_react.default.createElement("button", { key: value, type: "button", "data-active": style === value ? "true" : "false", onClick: () => update({ notificationStyle: value }) }, value === "strong" ? "\u589E\u5F3A\u7248" : "\u67D4\u548C\u7248")))),
|
|
1346
1378
|
toggle("\u591A\u6761\u901A\u77E5\u6298\u53E0\u663E\u793A", "\u6709\u591A\u6761\u672A\u5173\u95ED\u901A\u77E5\u65F6\uFF0C\u6700\u65B0\u4E00\u6761\u5B8C\u6574\u663E\u793A\uFF0C\u5176\u4F59\u901A\u77E5\u5728\u4E0B\u65B9\u7B49\u8DDD\u9732\u8FB9\uFF1B\u79FB\u5165\u540E\u5C55\u5F00\u3002", collapsed, (event) => update({ stackCollapsed: event.target.checked }), "\u591A\u6761\u901A\u77E5\u6298\u53E0\u663E\u793A")
|
|
1347
1379
|
),
|
package/dist/index.js
CHANGED
|
@@ -37,7 +37,12 @@ export function jobNotification(snapshot = {}) {
|
|
|
37
37
|
const outcome = JOB_STATUS_LABEL[status] ?? status;
|
|
38
38
|
return { title: failed ? '后台任务失败' : '后台任务结束', body: readable ? label : (outcome || undefined) };
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Notification positions, in the order the settings page offers them: the conversation's top-left
|
|
42
|
+
* corner is the default, and the right corner, the screen corner and off stay as alternatives.
|
|
43
|
+
*/
|
|
44
|
+
export const TOAST_POSITIONS = Object.freeze(['conversation-left', 'conversation', 'viewport', 'off']);
|
|
45
|
+
const DEFAULT_SETTINGS = Object.freeze({ verbosity: 'normal', toastPosition: 'conversation-left', toastEnabled: true, notificationStyle: 'strong', stackCollapsed: true, subtaskNotify: false, soundEnabled: true, sound: 'chime' });
|
|
41
46
|
const SETTING_KEYS = Object.freeze(Object.keys(DEFAULT_SETTINGS));
|
|
42
47
|
/**
|
|
43
48
|
* Only the settings this version knows about are adopted — or written back. A file left by an older
|
|
@@ -52,7 +57,7 @@ function validSettingsPatch(value = {}) {
|
|
|
52
57
|
if ('subtaskNotify' in value && typeof value.subtaskNotify !== 'boolean') return false;
|
|
53
58
|
if ('soundEnabled' in value && typeof value.soundEnabled !== 'boolean') return false;
|
|
54
59
|
if ('verbosity' in value && !['normal', 'detailed'].includes(value.verbosity)) return false;
|
|
55
|
-
if ('toastPosition' in value && !
|
|
60
|
+
if ('toastPosition' in value && !TOAST_POSITIONS.includes(value.toastPosition)) return false;
|
|
56
61
|
if ('sound' in value && (typeof value.sound !== 'string' || value.sound.length > 96)) return false;
|
|
57
62
|
return true;
|
|
58
63
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@idoall/dsh-notify",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "DSH web plugin: in-page task notifications for DeepSeek Harness — enhanced or soft status toasts, a collapsible top-
|
|
5
|
+
"description": "DSH web plugin: in-page task notifications for DeepSeek Harness — enhanced or soft status toasts, a collapsible stack in the conversation top-left corner, answer buttons, background-tab attention, and a WebAudio cue that also plays while the page is hidden. Live delivery only: no history, no service worker, no web push, no OS notification matrix.",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./dist/index.js",
|