@idoall/dsh-notify 0.4.16 → 0.5.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/CHANGELOG.md +40 -0
- package/README.md +14 -12
- package/README.zh.md +14 -12
- package/dist/client.js +44 -11
- package/dist/index.js +19 -5
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,46 @@
|
|
|
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.0] - 2026-11-23
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- **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.
|
|
10
|
+
- 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.
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- `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.
|
|
15
|
+
- The package description and both READMEs describe the new default; the settings hint and the option labels say which position is the default.
|
|
16
|
+
|
|
17
|
+
### Verified
|
|
18
|
+
|
|
19
|
+
- 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.
|
|
20
|
+
- 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.
|
|
21
|
+
|
|
22
|
+
## [0.4.17] - 2026-11-23
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- **Routes survive the removal of `Connection.requestRejection`.** DSH `0.2.3-alpha.1` moved HTTP admission into the WebServer: `register(route)` takes `auth: 'anonymous' | 'required' | 'deny'` (default `required`), the admitted Peer arrives as the handler's third argument, and `Connection.requestRejection` is gone. Every route now declares `auth: 'required'` and calls `requestRejection` only when the service still has it, so the two surfaces coexist. Without this, `0.4.16` threw `connection.requestRejection is not a function` inside the handler on the current host — `/pull`, `/config`, `/sounds`, `/update` and `/health` all failed for authenticated page loads.
|
|
27
|
+
- **Route mounting no longer requires that removed method.** The reflective composition path tested `connection?.requestRejection` before mounting at all, so a host without the method registered no routes and reported `guiAvailable: false`. The guard is now the presence of the connection service, with the route's `auth` owning admission.
|
|
28
|
+
- **In-toast answering follows the split Session status service.** DSH `0.2.3-alpha.1` moved the unified status snapshot to its own `uiSession.sessionStatus` service, which throws `cannot get property "uiSession.sessionStatus" without inject` when a Client plugin reads it without injecting that service. The toast read it first, so the overlay's pending-interaction wiring broke. `resolvePendingSource` now prefers the read-only `uiSession.pendingInteractions` observable (a plain member of the same service, no injection required), keeps the older `sessionStatus` snapshot as the fallback for `0.1.7`–`0.2.2`, returns a bare pre-`0.1.7` map only when nothing better exists, and tolerates either surface throwing.
|
|
29
|
+
|
|
30
|
+
### Changed
|
|
31
|
+
|
|
32
|
+
- Declare DeepSeek Harness `0.2.3-alpha.2` compatible while preserving `>=0.1.7-rc.1 <0.3.0` and every earlier verified release.
|
|
33
|
+
- Read the installed upgrade guides for the whole span: `v0.2.2-rc.5` (14 items, `rc.5` → `0.2.3-alpha.1`) and `v0.2.3-alpha.1` (1 item, `alpha.1` → `alpha.2`). This install also ships a `v0.2.2-rc.2` section (13 items) that earlier installs omitted; two of those items are the breaks fixed above, and the rest name surfaces this plugin never uses (`ctx.root`, package subpaths, ui-primitives search, Python PTC, CUA, tool error codes).
|
|
34
|
+
- **Node.js floor.** DSH now requires Node.js `24.22.3` or newer in the 24.x line, or `26.13.1` or newer; the README states that instead of `24.9.0`. The plugin's own `engines.node` stays `>=20`, which is its own code's floor.
|
|
35
|
+
- **Client bundle.** The client-module metadata change is additive and optional: this plugin keeps its earlier-preset bundle (no `meta`), which still loads. The only consequence is the documented one — Modules no longer removes an earlier preset's `<style data-plugin>` element, so disabling the plugin leaves its styles until the page reloads.
|
|
36
|
+
- Byte comparison of the 17 packages this plugin binds: `dsh-client-ui-slots` changed only by an optional `module` option and a static manifest export, leaving list registration, ordering and shadowing untouched; `dsh-client-ui-settings` still derives section rows from each entry's `{id, order, label}` and still passes `{close}` to the active section through the new `settings.section.view` factory; `dsh-jobs` only reshuffled its error codes and comments; `sessions.open`, `sessions.list` and `uiWorkspace.openSession` are unchanged.
|
|
37
|
+
|
|
38
|
+
### Verified
|
|
39
|
+
|
|
40
|
+
- Booted against the running `0.2.3-alpha.2` installation's own tree: `evaluatePluginCompatibility` reports no unmet requirement, the Host half mounts on Cordis `4.2.0-alpha.1` / schemastery `3.20.0-alpha.1`, registers all seven routes **with `auth: 'required'` on each**, and `/health`, `/config`, `/sounds` and `/update` answer `200` with live JSON against a connection service that has **no** `requestRejection`; disposal returns the fiber to inactive and removes every route.
|
|
41
|
+
- The Client half mounts on the same Cordis and registers `settings.section` and `shell.overlay`; a probe with `sessionStatus` throwing on read confirms the overlay wires through `pendingInteractions` without touching it.
|
|
42
|
+
- Static checks, **120 automated tests** (two new regressions: the dual route-admission seam, and pending-source resolution across all three host shapes), build and package checks pass, and the packed tarball matches this checkout byte for byte. Authenticated live-page verification stays unavailable: the running profile answers HTTP 401 to unauthenticated requests, so no new visual, audio or end-to-end notification claim is made.
|
|
43
|
+
- Release acceptance compares the published npm tarball's files and bytes with this tag, and checks npm `latest` and the GitHub Release.
|
|
44
|
+
|
|
5
45
|
## [0.4.16] - 2026-11-21
|
|
6
46
|
|
|
7
47
|
### Changed
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<a href="https://github.com/idoall/dsh-notify/actions/workflows/ci.yml"><img src="https://github.com/idoall/dsh-notify/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
7
7
|
<a href="https://www.npmjs.com/package/@idoall/dsh-notify"><img src="https://img.shields.io/npm/v/@idoall/dsh-notify?label=npm&color=CB3837" alt="npm version"></a>
|
|
8
8
|
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-0F172A" alt="MIT"></a>
|
|
9
|
-
<img src="https://img.shields.io/badge/DSH-0.2.
|
|
9
|
+
<img src="https://img.shields.io/badge/DSH-0.2.3--alpha.2-4B6BFB" alt="DSH 0.2.3-alpha.2">
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
12
|
<p align="center">English | <a href="README.zh.md">中文</a></p>
|
|
@@ -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">
|
|
@@ -45,8 +45,8 @@ When a session really stops, fails, asks a question, or needs approval, a card a
|
|
|
45
45
|
Requirements:
|
|
46
46
|
|
|
47
47
|
- DeepSeek Harness with a Web profile
|
|
48
|
-
- Node.js 24.
|
|
49
|
-
- Verified DeepSeek Harness version: `0.2.
|
|
48
|
+
- Node.js 24.22.3 or newer in the 24.x line, or 26.13.1 or newer, for current DSH (the plugin itself declares Node.js 20+)
|
|
49
|
+
- Verified DeepSeek Harness version: `0.2.3-alpha.2`
|
|
50
50
|
|
|
51
51
|
Install from npm into your Web profile:
|
|
52
52
|
|
|
@@ -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 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.0 ✓ 最新`, `v0.4.17 ➔ v0.5.0`, or `v0.5.0 · 检查失败`. **检查更新** 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.0`** 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.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. |
|
|
108
|
+
| `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. |
|
|
109
|
+
| `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. |
|
|
108
110
|
| `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. |
|
|
109
111
|
| `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. |
|
|
110
112
|
| `0.4.13` | `0.2.2-rc.1` | Declares the new DSH RC compatible, preserves existing support, and updates bilingual release information and the current DSH Node.js requirement. No notification source changes. |
|
|
@@ -135,7 +137,7 @@ Current release: plugin **`0.4.16`** is verified against DeepSeek Harness **`0.2
|
|
|
135
137
|
- 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.
|
|
136
138
|
- **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.
|
|
137
139
|
- `@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.
|
|
138
|
-
- **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` as of `0.
|
|
140
|
+
- **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.0`) 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.
|
|
139
141
|
|
|
140
142
|
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.
|
|
141
143
|
|
|
@@ -143,7 +145,7 @@ The screenshots below come from earlier browser verification, not a new RC visua
|
|
|
143
145
|
<img src="./assets/mobile.png" width="34%" alt="390 pixel mobile viewport showing a full-width enhanced notification stack with equal coloured edges beneath the newest card">
|
|
144
146
|
</p>
|
|
145
147
|
|
|
146
|
-
At this release, npm DSH `latest` and `next` both point to
|
|
148
|
+
At this release, npm DSH `latest` and `next` both point to `0.2.2-rc.5`, while the running, newly verified `0.2.3-alpha.2` sits on `alpha`. Both are in the verified list, so either channel is safe; `latest` simply has not caught up with the `0.2.3` line yet.
|
|
147
149
|
|
|
148
150
|
## Uninstall
|
|
149
151
|
|
|
@@ -168,8 +170,8 @@ npm run pack:check # publish preconditions + client registration check
|
|
|
168
170
|
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:
|
|
169
171
|
|
|
170
172
|
```sh
|
|
171
|
-
git tag v0.
|
|
172
|
-
git push origin v0.
|
|
173
|
+
git tag v0.5.0
|
|
174
|
+
git push origin v0.5.0
|
|
173
175
|
```
|
|
174
176
|
|
|
175
177
|
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
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<a href="https://github.com/idoall/dsh-notify/actions/workflows/ci.yml"><img src="https://github.com/idoall/dsh-notify/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
7
7
|
<a href="https://www.npmjs.com/package/@idoall/dsh-notify"><img src="https://img.shields.io/npm/v/@idoall/dsh-notify?label=npm&color=CB3837" alt="npm 版本"></a>
|
|
8
8
|
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-0F172A" alt="MIT"></a>
|
|
9
|
-
<img src="https://img.shields.io/badge/DSH-0.2.
|
|
9
|
+
<img src="https://img.shields.io/badge/DSH-0.2.3--alpha.2-4B6BFB" alt="DSH 0.2.3-alpha.2">
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
12
|
<p align="center"><a href="README.md">English</a> | 中文</p>
|
|
@@ -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="增强版通知堆叠:最新的失败通知完整显示,较早的蓝色、橙色和绿色通知等距露出下边缘">
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
环境要求:
|
|
46
46
|
|
|
47
47
|
- 带 Web profile 的 DeepSeek Harness
|
|
48
|
-
- 当前 DSH 需要 Node.js 24.
|
|
49
|
-
- 已验证的 DeepSeek Harness:`0.2.
|
|
48
|
+
- 当前 DSH 需要 24.x 系列中的 Node.js 24.22.3 或更高,或 26.13.1 或更高(插件自身声明 Node.js 20+)
|
|
49
|
+
- 已验证的 DeepSeek Harness:`0.2.3-alpha.2`
|
|
50
50
|
|
|
51
51
|
从 npm 安装:
|
|
52
52
|
|
|
@@ -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.0 ✓ 最新`、`v0.4.17 ➔ v0.5.0` 或 `v0.5.0 · 检查失败`。**检查更新**会强制重新查询(`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.0`** 已在 DeepSeek Harness **`0.2.3-alpha.2`** 上验证。
|
|
104
104
|
|
|
105
105
|
| 插件 | 已验证的 DeepSeek Harness | 这一版是什么 |
|
|
106
106
|
| --- | --- | --- |
|
|
107
|
-
| **`0.
|
|
107
|
+
| **`0.5.0`** | `0.2.3-alpha.2` | 通知浮层默认改到会话区**左上角**——设置页保留「会话区右上」「屏幕右上」「关闭页面通知」作为备选。新增左边缘锚点,并复用同一套跟随侧栏的观察器实时重定位。通知内容、提示音与触发时机均未变。 |
|
|
108
|
+
| `0.4.17` | `0.2.3-alpha.2` | **修复当前宿主上的两处断裂。** DSH 把 HTTP admission 移进 WebServer 并删除了 `Connection.requestRejection`——路由改为声明 `auth: 'required'`,仅在该方法仍存在时才调用;同时把 Session 状态快照移到需要注入的 `uiSession.sessionStatus` 服务,浮层改用无需注入的 `uiSession.pendingInteractions`。在本宿主上 `0.4.16` 的所有插件端点失败,卡片内回答也失效。 |
|
|
109
|
+
| `0.4.16` | `0.2.2-rc.5` | 声明兼容 DSH `0.2.2-rc.5`——第一个进入 npm `latest` 渠道的 RC。`rc.4` 以来唯一的破坏性变更是搜索提供方默认值,与本插件无关。它绑定的 15 个包里,决定接口的六个除自身版本号外逐字节相同;其余改动也只有同一次搜索调整与发布元数据(一个源码位置字符、界面显示的宿主版本号、上报的提交号)。通知源码无改动。 |
|
|
108
110
|
| `0.4.15` | `0.2.2-rc.4` | 声明兼容 DSH `0.2.2-rc.4`。`rc.3` 以来唯一的破坏性变更把 DeepSeek 拒答错误码改为 `CONTENT_REFUSED`,而本插件从不按该错误码分类。它绑定的 15 个包里,除各包 `package.json` 的版本号外全部逐字节相同;运行时只改了设置页显示的版本号与模块加载器上报的提交号。通知源码无改动。 |
|
|
109
111
|
| `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` 与新事件声明都是叠加式的。通知源码无改动。 |
|
|
110
112
|
| `0.4.13` | `0.2.2-rc.1` | 声明兼容新版 DSH RC,保留既有支持,并同步双语发布信息与当前 DSH 的 Node.js 要求。通知源码无改动。 |
|
|
@@ -135,7 +137,7 @@ dsh plugin --profile web add "link:$(pwd)"
|
|
|
135
137
|
- 两处声明决定插件能否加载:`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` 正式版上正是如此。
|
|
136
138
|
- **交互门禁只在「还没等到人回答」时压住完成通知。** DSH 的执行审批与计划审批都是在**提问的那个回合内**解决的(`approval.request()` 必须处于打开的回合中并原地等待结果;`exit_plan_mode` 把结论交回同一回合),所以接着干活的回合就是提问的那个回合,它的结束就是用户任务的完成。`0.4.2` 以此为规则;`0.3.2`–`0.4.1` 压掉了整个回合,于是每个带审批的任务都静默丢失完成通知。
|
|
137
139
|
- `@deepseek-ai/schemastery` 是 **peer**,不是普通依赖:DSH 只会把 **link 形态**插件的 peer 解析到当前安装;若仍写成普通依赖,`link:` 安装的 Host 半会导入失败。
|
|
138
|
-
- **声明的是「实测验证过的版本」,不是语义化猜测。** `dsh.compatibility.dshReleases` 列出真正启动验证过的每个版本(截至 `0.
|
|
140
|
+
- **声明的是「实测验证过的版本」,不是语义化猜测。** `dsh.compatibility.dshReleases` 列出真正启动验证过的每个版本(截至 `0.5.0`:`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` 会直接失败。
|
|
139
141
|
|
|
140
142
|
以下截图来自此前的浏览器验证,并非本次 RC 的新视觉测试;本次验证覆盖接口兼容性、自动化测试与实时浮层注册,不包含新的视觉或声音实测。此前在 390px 手机视口检查:设置控件会重排,Toast 会满宽显示且不会被移动端侧栏遮挡。
|
|
141
143
|
|
|
@@ -143,7 +145,7 @@ dsh plugin --profile web add "link:$(pwd)"
|
|
|
143
145
|
<img src="./assets/mobile.png" width="34%" alt="390px 手机视口:增强版通知栈满宽显示,最新通知下方有等距状态色边缘">
|
|
144
146
|
</p>
|
|
145
147
|
|
|
146
|
-
本次发布时 npm DSH 的 `latest` 与 `next`
|
|
148
|
+
本次发布时 npm DSH 的 `latest` 与 `next` 都指向 `0.2.2-rc.5`,而本次实测的 `0.2.3-alpha.2` 在 `alpha` 渠道。两者都在已验证列表里,跑哪个都安全;只是 `latest` 还没跟上 `0.2.3` 这条线。
|
|
147
149
|
|
|
148
150
|
## 卸载
|
|
149
151
|
|
|
@@ -168,8 +170,8 @@ npm run pack:check # 发布前置条件 + 客户端注册校验
|
|
|
168
170
|
发版由 tag 驱动。更新 `package.json` 与锁文件根版本、同步中英文 README 和 DSH 声明、将对应 CHANGELOG 段落移出 `Unreleased`、编写 `release-notes/v<版本>.md` 后,推送发版提交与 tag:
|
|
169
171
|
|
|
170
172
|
```sh
|
|
171
|
-
git tag v0.
|
|
172
|
-
git push origin v0.
|
|
173
|
+
git tag v0.5.0
|
|
174
|
+
git push origin v0.5.0
|
|
173
175
|
```
|
|
174
176
|
|
|
175
177
|
发版工作流会运行 `npm run verify`、打包插件、通过 npm trusted publishing(OIDC)发布,并创建附带 tarball 与 sha256 的 GitHub Release。
|
package/dist/client.js
CHANGED
|
@@ -72,6 +72,7 @@ window.__ModuleLoader__.load({
|
|
|
72
72
|
pendingInteractionFor: () => pendingInteractionFor,
|
|
73
73
|
publishLocalSelfTest: () => publishLocalSelfTest,
|
|
74
74
|
queueCards: () => queueCards,
|
|
75
|
+
resolvePendingSource: () => resolvePendingSource,
|
|
75
76
|
resultTone: () => resultTone,
|
|
76
77
|
revealSelectedSidebarSession: () => revealSelectedSidebarSession,
|
|
77
78
|
revealTurn: () => revealTurn,
|
|
@@ -81,8 +82,11 @@ window.__ModuleLoader__.load({
|
|
|
81
82
|
statusTone: () => statusTone,
|
|
82
83
|
toastAnchor: () => toastAnchor,
|
|
83
84
|
toastAnchorWatchTargets: () => toastAnchorWatchTargets,
|
|
85
|
+
toastAnchors: () => toastAnchors,
|
|
84
86
|
toastAnswer: () => toastAnswer,
|
|
85
87
|
toastIcon: () => toastIcon,
|
|
88
|
+
toastInsets: () => toastInsets,
|
|
89
|
+
toastLeftAnchor: () => toastLeftAnchor,
|
|
86
90
|
toastOrder: () => toastOrder,
|
|
87
91
|
toastStackPlan: () => toastStackPlan,
|
|
88
92
|
toastTime: () => toastTime,
|
|
@@ -141,6 +145,19 @@ window.__ModuleLoader__.load({
|
|
|
141
145
|
const right = rect && rect.width > 0 ? Math.min(rect.right, innerWidth) : null;
|
|
142
146
|
return right === null ? Math.max(16, (innerWidth - fallbackContentWidth) / 2 + 16) : Math.max(16, innerWidth - right + 16);
|
|
143
147
|
}
|
|
148
|
+
function toastLeftAnchor({ document: doc = globalThis.document, innerWidth = globalThis.innerWidth, fallbackContentWidth = 720 } = {}) {
|
|
149
|
+
const rect = doc?.querySelector?.("[data-conversation-scroll]")?.getBoundingClientRect?.();
|
|
150
|
+
const left = rect && rect.width > 0 && typeof rect.left === "number" ? Math.min(rect.left, innerWidth) : null;
|
|
151
|
+
return left === null ? Math.max(16, (innerWidth - fallbackContentWidth) / 2 + 16) : Math.max(16, left + 16);
|
|
152
|
+
}
|
|
153
|
+
function toastInsets({ narrow = false, position = "conversation-left", anchor = { right: 16, left: 16 } } = {}) {
|
|
154
|
+
if (narrow) return { insetInlineStart: "auto", insetInlineEnd: 12 };
|
|
155
|
+
if (position === "conversation-left") return { insetInlineStart: `${anchor.left}px`, insetInlineEnd: "auto" };
|
|
156
|
+
return { insetInlineStart: "auto", insetInlineEnd: `${position === "viewport" ? 16 : anchor.right}px` };
|
|
157
|
+
}
|
|
158
|
+
function toastAnchors(options = {}) {
|
|
159
|
+
return { right: toastAnchor(options), left: toastLeftAnchor(options) };
|
|
160
|
+
}
|
|
144
161
|
function toastAnchorWatchTargets(doc = globalThis.document) {
|
|
145
162
|
const nodes = [];
|
|
146
163
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -163,7 +180,7 @@ window.__ModuleLoader__.load({
|
|
|
163
180
|
let raf = 0;
|
|
164
181
|
let followingUntil = 0;
|
|
165
182
|
const observed = /* @__PURE__ */ new Set();
|
|
166
|
-
const measure = () => onChange(
|
|
183
|
+
const measure = () => onChange(toastAnchors({ document: doc, innerWidth: win.innerWidth }));
|
|
167
184
|
const tick = () => {
|
|
168
185
|
measure();
|
|
169
186
|
const now = typeof win.performance?.now === "function" ? win.performance.now() : Date.now();
|
|
@@ -560,7 +577,7 @@ window.__ModuleLoader__.load({
|
|
|
560
577
|
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" }));
|
|
561
578
|
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" }));
|
|
562
579
|
}
|
|
563
|
-
var toastConfig = { toastPosition: "conversation", toastEnabled: true, notificationStyle: "strong", stackCollapsed: true, soundEnabled: true, sound: "chime" };
|
|
580
|
+
var toastConfig = { toastPosition: "conversation-left", toastEnabled: true, notificationStyle: "strong", stackCollapsed: true, soundEnabled: true, sound: "chime" };
|
|
564
581
|
function createSoundPlayer({ audio = globalThis, AudioContextClass, AudioElementClass } = {}) {
|
|
565
582
|
let context = null;
|
|
566
583
|
let unlocked = false;
|
|
@@ -780,7 +797,7 @@ window.__ModuleLoader__.load({
|
|
|
780
797
|
const state = useNotificationState({ sessions, pendingInteractions });
|
|
781
798
|
const [, refresh] = import_react.default.useState(0);
|
|
782
799
|
const [cards, setCards] = import_react.default.useState([]);
|
|
783
|
-
const [anchor, setAnchor] = import_react.default.useState(() =>
|
|
800
|
+
const [anchor, setAnchor] = import_react.default.useState(() => toastAnchors());
|
|
784
801
|
const [expanded, setExpanded] = import_react.default.useState(false);
|
|
785
802
|
const [forcedCollapsed, setForcedCollapsed] = import_react.default.useState(false);
|
|
786
803
|
const [, rerender] = import_react.default.useState(0);
|
|
@@ -859,9 +876,9 @@ window.__ModuleLoader__.load({
|
|
|
859
876
|
globalThis.addEventListener?.("dsh-notify:toast-config", onConfig);
|
|
860
877
|
return () => globalThis.removeEventListener?.("dsh-notify:toast-config", onConfig);
|
|
861
878
|
}, []);
|
|
862
|
-
import_react.default.useEffect(() => watchToastAnchor((next) => setAnchor((prev) => prev === next ? prev : next)), []);
|
|
879
|
+
import_react.default.useEffect(() => watchToastAnchor((next) => setAnchor((prev) => prev.right === next.right && prev.left === next.left ? prev : next)), []);
|
|
863
880
|
import_react.default.useEffect(() => {
|
|
864
|
-
setAnchor(
|
|
881
|
+
setAnchor(toastAnchors());
|
|
865
882
|
}, [cards.length]);
|
|
866
883
|
import_react.default.useEffect(() => () => {
|
|
867
884
|
for (const id of exits.current.values()) clearTimeout(id);
|
|
@@ -1115,7 +1132,7 @@ window.__ModuleLoader__.load({
|
|
|
1115
1132
|
ref: frameRef,
|
|
1116
1133
|
popover: "manual",
|
|
1117
1134
|
className: "dsh-notify-frame",
|
|
1118
|
-
style: { inset: "auto",
|
|
1135
|
+
style: { inset: "auto", ...toastInsets({ narrow, position: toastConfig.toastPosition, anchor }), bottom: "auto", top: "calc(env(safe-area-inset-top, 0px) + var(--dsh-toast-top-offset, 56px))", 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" }
|
|
1119
1136
|
},
|
|
1120
1137
|
clearAllVisible ? import_react.default.createElement(
|
|
1121
1138
|
"div",
|
|
@@ -1340,7 +1357,7 @@ window.__ModuleLoader__.load({
|
|
|
1340
1357
|
import_react.default.createElement(
|
|
1341
1358
|
"div",
|
|
1342
1359
|
{ className: "dsh-notify-rows" },
|
|
1343
|
-
import_react.default.createElement("div", { className: "dsh-notify-setting-field" }, copy("\u901A\u77E5\u4F4D\u7F6E", "\u9ED8\u8BA4\u51FA\u73B0\u5728\u4F1A\u8BDD\u533A\
|
|
1360
|
+
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"))),
|
|
1344
1361
|
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")))),
|
|
1345
1362
|
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")
|
|
1346
1363
|
),
|
|
@@ -1358,14 +1375,30 @@ window.__ModuleLoader__.load({
|
|
|
1358
1375
|
);
|
|
1359
1376
|
}
|
|
1360
1377
|
var CLIENT_COMPOSITION = Object.freeze({ service: "slots", modules: Object.freeze(["@deepseek-ai/dsh-client-ui-renderer", "@deepseek-ai/dsh-client-ui-layout", "@deepseek-ai/dsh-client-ui-settings", "@deepseek-ai/dsh-client-ui-settings-general"]), seats: Object.freeze(["settings.section", "shell.overlay"]) });
|
|
1378
|
+
function resolvePendingSource(ui) {
|
|
1379
|
+
if (!ui) return void 0;
|
|
1380
|
+
const observable = (value) => value !== void 0 && value !== null && typeof value.getSnapshot === "function" && typeof value.subscribe === "function";
|
|
1381
|
+
let live;
|
|
1382
|
+
try {
|
|
1383
|
+
live = ui.pendingInteractions;
|
|
1384
|
+
} catch {
|
|
1385
|
+
live = void 0;
|
|
1386
|
+
}
|
|
1387
|
+
if (observable(live)) return live;
|
|
1388
|
+
let status;
|
|
1389
|
+
try {
|
|
1390
|
+
status = ui.sessionStatus;
|
|
1391
|
+
} catch {
|
|
1392
|
+
status = void 0;
|
|
1393
|
+
}
|
|
1394
|
+
if (status !== void 0) return status;
|
|
1395
|
+
return live;
|
|
1396
|
+
}
|
|
1361
1397
|
function mountNotifyClient({ slots, sessions, uiWorkspace, getSessions, getUiSession, getUiWorkspace } = {}) {
|
|
1362
1398
|
const status = { service: slots?.inject && slots?.register ? "available" : "unavailable", seats: {} };
|
|
1363
1399
|
if (status.service === "unavailable") return { status, destroy() {
|
|
1364
1400
|
} };
|
|
1365
|
-
const pendingInteractions = () =>
|
|
1366
|
-
const ui = getUiSession?.();
|
|
1367
|
-
return ui?.sessionStatus ?? ui?.pendingInteractions;
|
|
1368
|
-
};
|
|
1401
|
+
const pendingInteractions = () => resolvePendingSource(getUiSession?.());
|
|
1369
1402
|
const disposers = [installClientStyles(), installAudioUnlock()];
|
|
1370
1403
|
const activate = (name, options, Component) => {
|
|
1371
1404
|
status.seats[name] = "active";
|
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
|
}
|
|
@@ -156,9 +161,15 @@ function registerRoute(ctx, webServer, route) {
|
|
|
156
161
|
function registerSensitive(ctx, webServer, connection, path, methods, handler) {
|
|
157
162
|
const allowed = Array.isArray(methods) ? methods : [methods];
|
|
158
163
|
return registerRoute(ctx, webServer, {
|
|
159
|
-
|
|
164
|
+
// `auth` is the DSH 0.2.3-alpha.1+ route admission contract: omitted means required, and the
|
|
165
|
+
// admitted Peer arrives as the third handler argument. Older hosts do not read the key, so they
|
|
166
|
+
// keep gating through `connection.requestRejection` below.
|
|
167
|
+
kind: 'exact', path: `${BASE}${path}`, auth: 'required',
|
|
160
168
|
handler: async (req, res) => {
|
|
161
|
-
|
|
169
|
+
// DSH 0.2.3-alpha.1 moved admission into the WebServer and removed `Connection.requestRejection`,
|
|
170
|
+
// so a plugin that still called it threw a TypeError on every authenticated request. Older hosts
|
|
171
|
+
// (0.1.7–0.2.2) only have the method, so call it when present and let `auth` own the new host.
|
|
172
|
+
const rejection = typeof connection?.requestRejection === 'function' ? connection.requestRejection(req) : undefined;
|
|
162
173
|
if (rejection !== undefined) { res.statusCode = rejection; res.end(rejection === 401 ? 'unauthorized' : 'forbidden'); return; }
|
|
163
174
|
if (!allowed.includes(req.method)) { res.statusCode = 405; res.setHeader('allow', allowed.join(', ')); res.end(); return; }
|
|
164
175
|
if (req.method !== 'GET' && !sameOriginRequest(req)) { res.statusCode = 403; res.end('forbidden'); return; }
|
|
@@ -650,7 +661,10 @@ export async function apply(ctx, config = {}) {
|
|
|
650
661
|
} else {
|
|
651
662
|
const webServer = contextService(ctx, 'webServer');
|
|
652
663
|
const connection = contextService(ctx, 'connection');
|
|
653
|
-
|
|
664
|
+
// DSH 0.2.3-alpha.1+ dropped `Connection.requestRejection`; there the route-level `auth` owns
|
|
665
|
+
// admission, so the presence of the connection service — not one method on it — is what this
|
|
666
|
+
// fallback may test.
|
|
667
|
+
if (webServer?.register && connection !== undefined && connection !== null) mountWeb(ctx, webServer, connection);
|
|
654
668
|
}
|
|
655
669
|
// Cordis plugins may resolve asynchronously, but an async effect must resolve
|
|
656
670
|
// to a disposer (or null), never an arbitrary runtime object. Keep the
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@idoall/dsh-notify",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
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",
|
|
@@ -52,7 +52,8 @@
|
|
|
52
52
|
"0.2.2-rc.1": "compatible",
|
|
53
53
|
"0.2.2-rc.3": "compatible",
|
|
54
54
|
"0.2.2-rc.4": "compatible",
|
|
55
|
-
"0.2.2-rc.5": "compatible"
|
|
55
|
+
"0.2.2-rc.5": "compatible",
|
|
56
|
+
"0.2.3-alpha.2": "compatible"
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
},
|