@idoall/dsh-notify 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,37 @@ All notable changes to this project are documented here. The format follows [Kee
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.3.4] - 2026-09-24
8
+
9
+ ### Fixed
10
+
11
+ - **A failure is announced when DSH reports it.** `agent/error` used to only remember the message for the `turn/end` that was expected to follow, so a failure whose turn never ended was never announced at all. The failure now becomes a card at the error itself, and the `turn/end` that does follow derives a record with the same `fail:<session>:<turn>` identity, so it updates that card rather than adding a second one. A subagent failure stays as quiet as a subagent completion.
12
+ - **Work that resumes in the same stack is no longer announced as a finished task.** DSH publishes `agent/status: idle` and resumes queued work in the same synchronous stack. Because every `session/event` is also handled one microtask later, the idle flush found the candidate the preceding `turn/end` had just registered and announced a task that never stopped — the `running` that cancelled it had already run. The flush now re-checks that the session is still `idle` when it runs, so the cancellation wins with no debounce window and no added latency.
13
+ - **A card no longer waits for the next tick when the page already knows better.** The client nudges an immediate `/pull` when `sessions.list` or the Session status snapshot changes (leading-edge throttled to one nudge per 200 ms), and catches up on the spot when a hidden tab becomes visible again; the 1.5 s interval stays as the fallback. A late response can no longer move the delivery cursor backwards.
14
+
15
+ ### Verified
16
+
17
+ - A same-stack `idle -> running` flap emits no completion card, and the turn that really ends last is announced exactly once.
18
+ - A failure with no following `turn/end` is delivered on the error itself; a failure whose turn does end stays one card with one identity; a subagent failure stays silent.
19
+ - Client coverage counts `/pull` requests: both session-store edges and the visible-again edge pull without the interval running.
20
+ - All five behaviour tests were confirmed to fail against the previous implementation before the fix was restored.
21
+ - Full verification passed: static source checks, **92 automated tests**, build, and package precondition checks.
22
+
23
+ ## [0.3.3] - 2026-09-24
24
+
25
+ ### Changed
26
+
27
+ - **Adapted to DeepSeek Harness `0.1.7-rc.1`.** Background-job completions now subscribe to the consolidated `jobs.events` stream (`settled`, unawaited only) instead of the removed `onJobDone` listener. Tool-result settlement reads `message.toolCallId` / `message.isError` on the flattened tool-role message. In-toast answers read the unified `uiSession.sessionStatus` snapshot, where the answerable interaction is nested under `pendingInteraction`.
28
+ - **Declared DSH compatibility as a load-time requirement.** `dsh.manifestVersion`, `dsh.engines.dsh`, and every `@deepseek-ai/dsh-*` peer now state `>=0.1.7-rc.1 <0.2.0`, so DSH 0.1.7-rc.1 can refuse an incompatible bundle at profile load. `@deepseek-ai/schemastery` moves from a plain dependency to a peer (with a matching devDependency) so a `link:` install resolves it from the running installation.
29
+
30
+ ### Verified
31
+
32
+ - Host jobs coverage confirms the 0.1.7 event stream, awaited settlements stay silent, and the pre-0.1.7 `onJobDone` listener remains a fallback.
33
+ - Flattened `tool/result` messages close the matching interaction; a nested pre-0.1.7 `tool-result` block still does.
34
+ - Client pending-interaction coverage reads both the 0.1.7 Session status snapshot and the older map.
35
+ - Live `link:` install on DSH `0.1.7-rc.1` hot-mounted without restarting: Host routes answered, the client bundle registered, **Settings → Notifications** rendered, and a four-tone self-test produced the collapsed overlay stack above the settings modal.
36
+ - Full verification passed: static source checks, **86 automated tests**, build, and package precondition checks.
37
+
7
38
  ## [0.3.2] - 2026-09-20
8
39
 
9
40
  ### Fixed
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.1.6--alpha.1-4B6BFB" alt="DSH 0.1.6-alpha.1">
9
+ <img src="https://img.shields.io/badge/DSH-0.1.7--rc.1-4B6BFB" alt="DSH 0.1.7-rc.1">
10
10
  </p>
11
11
 
12
12
  <p align="center">English | <a href="README.zh.md">中文</a></p>
@@ -45,7 +45,7 @@ Requirements:
45
45
 
46
46
  - DeepSeek Harness with a Web profile
47
47
  - Node.js 20 or newer
48
- - Verified DeepSeek Harness version: `0.1.6-alpha.1`
48
+ - Verified DeepSeek Harness version: `0.1.7-rc.1`
49
49
 
50
50
  Install from npm into your Web profile:
51
51
 
@@ -93,17 +93,23 @@ Custom sounds are stored in `<dataDir>/sounds/` in the profile data directory, n
93
93
 
94
94
  ## Compatibility
95
95
 
96
- Current release target: plugin **`0.3.2`** verified against DeepSeek Harness **`0.1.6-alpha.1`**.
96
+ Current release: plugin **`0.3.4`** is verified against DeepSeek Harness **`0.1.7-rc.1`**.
97
97
 
98
- | Plugin | Verified DeepSeek Harness |
99
- | --- | --- |
100
- | `0.3.2` | `0.1.6-alpha.1` |
101
- | `0.3.1` | `0.1.6-alpha.1` |
102
- | `0.3.0` | `0.1.6-alpha.1` |
103
- | `0.2.2` | `0.1.6-alpha.1` |
104
- | `0.2.1` | `0.1.6-alpha.1` |
105
- | `0.2.0` | `0.1.6-alpha.1` |
106
- | `0.1.2` | `0.1.6-alpha.1` |
98
+ | Plugin | Verified DeepSeek Harness | What that version is |
99
+ | --- | --- | --- |
100
+ | **`0.3.4`** | `0.1.7-rc.1` | Trigger-timing fixes: a failure is delivered at `agent/error` (one card with `turn/end`), a same-stack `idle → running` flap no longer announces a finished task, and the client pulls at once on a session-state change or a visible-again tab (1.5 s interval kept as fallback) |
101
+ | `0.3.3` | `0.1.7-rc.1` | Adapts to DSH 0.1.7: job completions follow `jobs.events.subscribe`, tool results read the flattened tool-role message, in-toast answers read `uiSession.sessionStatus`, and `@deepseek-ai/schemastery` is a peer |
102
+ | `0.3.2` | `0.1.6-alpha.1` | Completion follows native `agent/status: idle`; one green card per continuous task |
103
+ | `0.3.1` | `0.1.6-alpha.1` | Sound matches visible delivery; open interactions recover after overlay remount |
104
+ | `0.3.0` | `0.1.6-alpha.1` | Enhanced/soft styles, collapsed stack, and page-local self-test |
105
+ | `0.2.2` | `0.1.6-alpha.1` | Latest published npm `latest` until `0.3.3` is released |
106
+ | `0.2.1` | `0.1.6-alpha.1` | — |
107
+ | `0.2.0` | `0.1.6-alpha.1` | — |
108
+ | `0.1.2` | `0.1.6-alpha.1` | — |
109
+
110
+ - **`0.3.3` supports the DSH `0.1.7` line only.** DSH `0.1.7` removed `jobs.onJobDone`, flattened tool-result identity onto the tool-role message, and replaced `uiSession.pendingInteractions` with the unified `sessionStatus` snapshot. On an older DSH — including `0.1.6-alpha.1` — stay on plugin **`0.3.2`**.
111
+ - Two declarations make the `0.1.7` line load at all: `dsh.engines.dsh` and every `@deepseek-ai/dsh-*` peer declare `>=0.1.7-rc.1 <0.2.0`. DSH `0.1.7-rc.1` refuses an incompatible bundle at profile load, so a range that excluded the running release would silently drop the plugin.
112
+ - `@deepseek-ai/schemastery` is a **peer**, not a plain dependency: DSH 0.1.7 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.
107
113
 
108
114
  The layout is also checked at a 390px mobile viewport: the settings controls reflow and the toast becomes full-width without falling behind the mobile sidebar.
109
115
 
@@ -134,8 +140,8 @@ npm run pack:check # publish preconditions + client registration check
134
140
  Releases are tag-driven. Bump `package.json`, move the matching CHANGELOG section out of `Unreleased`, write `release-notes/v<version>.md`, then push the release commit and tag:
135
141
 
136
142
  ```sh
137
- git tag v0.3.2
138
- git push origin v0.3.2
143
+ git tag v0.3.4
144
+ git push origin v0.3.3
139
145
  ```
140
146
 
141
147
  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.1.6--alpha.1-4B6BFB" alt="DSH 0.1.6-alpha.1">
9
+ <img src="https://img.shields.io/badge/DSH-0.1.7--rc.1-4B6BFB" alt="DSH 0.1.7-rc.1">
10
10
  </p>
11
11
 
12
12
  <p align="center"><a href="README.md">English</a> | 中文</p>
@@ -45,7 +45,7 @@
45
45
 
46
46
  - 带 Web profile 的 DeepSeek Harness
47
47
  - Node.js 20 或更新
48
- - 已验证的 DeepSeek Harness:`0.1.6-alpha.1`
48
+ - 已验证的 DeepSeek Harness:`0.1.7-rc.1`
49
49
 
50
50
  从 npm 安装:
51
51
 
@@ -93,17 +93,23 @@ dsh plugin --profile web add "link:$(pwd)"
93
93
 
94
94
  ## 兼容性
95
95
 
96
- 当前发布目标:插件 **`0.3.2`** 已在 DeepSeek Harness **`0.1.6-alpha.1`** 上验证。
96
+ 当前发布:插件 **`0.3.4`** 已在 DeepSeek Harness **`0.1.7-rc.1`** 上验证。
97
97
 
98
- | 插件 | 已验证的 DeepSeek Harness |
99
- | --- | --- |
100
- | `0.3.2` | `0.1.6-alpha.1` |
101
- | `0.3.1` | `0.1.6-alpha.1` |
102
- | `0.3.0` | `0.1.6-alpha.1` |
103
- | `0.2.2` | `0.1.6-alpha.1` |
104
- | `0.2.1` | `0.1.6-alpha.1` |
105
- | `0.2.0` | `0.1.6-alpha.1` |
106
- | `0.1.2` | `0.1.6-alpha.1` |
98
+ | 插件 | 已验证的 DeepSeek Harness | 这一版是什么 |
99
+ | --- | --- | --- |
100
+ | **`0.3.4`** | `0.1.7-rc.1` | 触发时序修复:失败在 `agent/error` 时即投递(与 `turn/end` 共用同一张卡)、同栈 `idle → running` 抖动不再误报完成、客户端在会话状态变化与标签页重新可见时立即拉取(保留 1.5s 兜底) |
101
+ | `0.3.3` | `0.1.7-rc.1` | 适配 DSH 0.1.7:后台任务完成走 `jobs.events.subscribe`,工具结果读取扁平化后的 tool-role 消息,卡片内回答读取 `uiSession.sessionStatus`,`@deepseek-ai/schemastery` 改为 peer |
102
+ | `0.3.2` | `0.1.6-alpha.1` | 完成通知跟随原生 `agent/status: idle`;连续任务只发一张绿色卡 |
103
+ | `0.3.1` | `0.1.6-alpha.1` | 提示音与可见投递对齐;浮层重挂载后恢复未处理交互 |
104
+ | `0.3.0` | `0.1.6-alpha.1` | 增强/柔和样式、折叠堆叠、页内自测 |
105
+ | `0.2.2` | `0.1.6-alpha.1` | 在 `0.3.3` 发布前仍是 npm `latest` |
106
+ | `0.2.1` | `0.1.6-alpha.1` | — |
107
+ | `0.2.0` | `0.1.6-alpha.1` | — |
108
+ | `0.1.2` | `0.1.6-alpha.1` | — |
109
+
110
+ - **`0.3.3` 只支持 DSH `0.1.7` 线。** DSH `0.1.7` 移除了 `jobs.onJobDone`,把工具结果身份扁平化到 tool-role 消息上,并用统一的 `sessionStatus` 快照替换了 `uiSession.pendingInteractions`。更早的 DSH(含 `0.1.6-alpha.1`)请继续用插件 **`0.3.2`**。
111
+ - 两处声明决定 `0.1.7` 线能否加载:`dsh.engines.dsh` 与每一个 `@deepseek-ai/dsh-*` peer 都声明 `>=0.1.7-rc.1 <0.2.0`。DSH `0.1.7-rc.1` 会在 profile 加载时拒绝不兼容的 bundle,范围写错就会静默丢掉插件。
112
+ - `@deepseek-ai/schemastery` 是 **peer**,不是普通依赖:DSH 0.1.7 只会把 **link 形态**插件的 peer 解析到当前安装;若仍写成普通依赖,`link:` 安装的 Host 半会导入失败。
107
113
 
108
114
  同时在 390px 手机视口检查:设置控件会重排,Toast 会满宽显示且不会被移动端侧栏遮挡。
109
115
 
@@ -134,8 +140,8 @@ npm run pack:check # 发布前置条件 + 客户端注册校验
134
140
  发版由 tag 驱动。更新 `package.json`、将对应 CHANGELOG 段落移出 `Unreleased`、编写 `release-notes/v<版本>.md` 后,推送发版提交与 tag:
135
141
 
136
142
  ```sh
137
- git tag v0.3.2
138
- git push origin v0.3.2
143
+ git tag v0.3.4
144
+ git push origin v0.3.3
139
145
  ```
140
146
 
141
147
  发版工作流会运行 `npm run verify`、打包插件、通过 npm trusted publishing(OIDC)发布,并创建附带 tarball 与 sha256 的 GitHub Release。
package/dist/client.js CHANGED
@@ -459,7 +459,8 @@ window.__ModuleLoader__.load({
459
459
  return [...merged.values()].sort((a, b) => Number(b.at || 0) - Number(a.at || 0)).slice(0, RECORD_MEMORY);
460
460
  }
461
461
  var RECORD_MEMORY = 60;
462
- function useNotificationState() {
462
+ var NUDGE_GAP_MS = 200;
463
+ function useNotificationState({ sessions, pendingInteractions } = {}) {
463
464
  const [state, setState] = import_react.default.useState({ records: [], seq: 0, primed: false, offline: false, revision: 0 });
464
465
  const warned = import_react.default.useRef(false);
465
466
  import_react.default.useEffect(() => {
@@ -481,18 +482,34 @@ window.__ModuleLoader__.load({
481
482
  globalThis.console?.warn?.("[dsh-notify] the host did not report a delivery sequence \u2014 restart DSH so the current plugin is loaded; until then this page only sees records it has not seen before.");
482
483
  }
483
484
  const seq = Number.isSafeInteger(data?.seq) ? data.seq : state.seq;
484
- setState((old) => ({ records: mergeRecords(old.records, Array.isArray(data?.items) ? data.items : []), seq, primed: true, offline: false, revision: old.revision + 1 }));
485
+ setState((old) => ({ records: mergeRecords(old.records, Array.isArray(data?.items) ? data.items : []), seq: Math.max(old.seq, seq), primed: true, offline: false, revision: old.revision + 1 }));
485
486
  } catch {
486
487
  if (alive) setState((old) => ({ ...old, offline: true }));
487
488
  }
488
489
  };
489
490
  pull();
490
491
  const timer = setInterval(pull, 1500);
492
+ let lastNudge = 0;
493
+ const nudge = () => {
494
+ const now = Date.now();
495
+ if (now - lastNudge < NUDGE_GAP_MS) return;
496
+ lastNudge = now;
497
+ void pull();
498
+ };
499
+ const offList = sessions?.list?.subscribe?.(nudge);
500
+ const offStatus = pendingInteractions?.subscribe?.(nudge);
501
+ const onVisible = () => {
502
+ if (!globalThis.document?.hidden) void pull();
503
+ };
504
+ globalThis.document?.addEventListener?.("visibilitychange", onVisible);
491
505
  return () => {
492
506
  alive = false;
493
507
  clearInterval(timer);
508
+ offList?.();
509
+ offStatus?.();
510
+ globalThis.document?.removeEventListener?.("visibilitychange", onVisible);
494
511
  };
495
- }, [state.seq]);
512
+ }, [state.seq, sessions, pendingInteractions]);
496
513
  return state;
497
514
  }
498
515
  function toastOrder(records = []) {
@@ -728,7 +745,7 @@ window.__ModuleLoader__.load({
728
745
  return { total: list.length, hidden, windowHeight: windowHeight + (hidden > 0 ? peek : 0), contentHeight: sum(list), overflow: hidden > 0 };
729
746
  }
730
747
  function ToastOverlay({ sessions, uiWorkspace, pendingInteractions } = {}) {
731
- const state = useNotificationState();
748
+ const state = useNotificationState({ sessions, pendingInteractions });
732
749
  const [, refresh] = import_react.default.useState(0);
733
750
  const [cards, setCards] = import_react.default.useState([]);
734
751
  const [anchor, setAnchor] = import_react.default.useState(() => toastAnchor());
@@ -1094,7 +1111,10 @@ window.__ModuleLoader__.load({
1094
1111
  }
1095
1112
  function pendingInteractionFor(pending, sessionId) {
1096
1113
  if (!pending || typeof pending.get !== "function" || typeof sessionId !== "string") return null;
1097
- return pending.get(sessionId) ?? null;
1114
+ const entry = pending.get(sessionId) ?? null;
1115
+ if (!entry) return null;
1116
+ if ("pendingInteraction" in entry) return entry.pendingInteraction ?? null;
1117
+ return typeof entry.answer === "function" ? entry : null;
1098
1118
  }
1099
1119
  function toastAnswer(record, interaction) {
1100
1120
  if (!interaction || typeof interaction.answer !== "function") return null;
@@ -1238,7 +1258,10 @@ window.__ModuleLoader__.load({
1238
1258
  const status = { service: slots?.inject && slots?.register ? "available" : "unavailable", seats: {} };
1239
1259
  if (status.service === "unavailable") return { status, destroy() {
1240
1260
  } };
1241
- const pendingInteractions = () => getUiSession?.()?.pendingInteractions;
1261
+ const pendingInteractions = () => {
1262
+ const ui = getUiSession?.();
1263
+ return ui?.sessionStatus ?? ui?.pendingInteractions;
1264
+ };
1242
1265
  const disposers = [installClientStyles(), installAudioUnlock()];
1243
1266
  const activate = (name, options, Component) => {
1244
1267
  status.seats[name] = "active";
package/dist/index.js CHANGED
@@ -318,7 +318,13 @@ export async function apply(ctx, config = {}) {
318
318
  statusCapable.add(sessionId);
319
319
  agentStatuses.set(sessionId, status);
320
320
  if (status === 'running') { cancelCompletion(sessionId); return; }
321
- safely(() => flushCompletion(sessionId));
321
+ // Re-check the status when the deferred flush actually runs. Every `session/event` is handled
322
+ // through `safely` too, so a synchronous `idle -> running` flap — DSH resumes queued work in the
323
+ // same stack right after the idle transition — queues this flush BEFORE the turn/end handler has
324
+ // registered its candidate. The flush would then find that candidate and announce a task that
325
+ // never stopped, because the `running` that cancelled it had already run. Reading the current
326
+ // status here is what makes that cancellation win, with no debounce window and no added latency.
327
+ safely(() => { if (agentStatuses.get(sessionId) === 'idle') return flushCompletion(sessionId); });
322
328
  });
323
329
 
324
330
  ctx?.on?.('session/event', (session, event) => {
@@ -333,12 +339,17 @@ export async function apply(ctx, config = {}) {
333
339
  return;
334
340
  }
335
341
  if (event?.type === 'tool/result') {
336
- const result = data.message?.content?.find?.((block) => block?.type === 'tool-result');
337
- const callId = result?.toolCallId;
342
+ // DSH 0.1.7 flattened the tool result onto the tool-role message (`message.toolCallId` and
343
+ // `message.isError`); the nested `tool-result` content block this used to read is gone. The message
344
+ // is the authoritative shape, and the old nested block stays only as a fallback so an older host
345
+ // keeps settling its interactions.
346
+ const message = data.message ?? {};
347
+ const nested = message.content?.find?.((block) => block?.type === 'tool-result');
348
+ const callId = message.toolCallId ?? nested?.toolCallId;
338
349
  if (!callId) return; // Unlinked records cannot be guessed closed by an uncorrelated result.
339
350
  removePending(sessionId, callId);
340
- const outcome = result?.isError || data.outcome === 'abort' ? 'abort' : 'settled';
341
- const existing = reducer.questionResult({ sessionId, callId, outcome });
351
+ const failed = message.isError === true || nested?.isError === true || data.outcome === 'abort';
352
+ const existing = reducer.questionResult({ sessionId, callId, outcome: failed ? 'abort' : 'settled' });
342
353
  if (existing) safely(() => dispatch(existing));
343
354
  return;
344
355
  }
@@ -415,7 +426,22 @@ export async function apply(ctx, config = {}) {
415
426
  async (error) => { await bounded(() => settle(signal?.aborted || error?.code === 'ASK_ABORTED' ? 'abort' : 'error'), 10_000); throw error; },
416
427
  ).finally(() => signal?.removeEventListener?.('abort', abort));
417
428
  });
418
- ctx?.on?.('agent/error', ({ agent, turn, error }) => { pendingErrors.set(`${sessionIdOf(agent)}:${turn}`, error); });
429
+ /**
430
+ * A failure is announced when DSH reports it, not when a later `turn/end` happens to arrive.
431
+ * `turn/end` was the only path before, so a failure whose turn never ended was never announced at
432
+ * all. The immediate record and the one `turn/end` derives (reason `error`) share the mergeKey
433
+ * `fail:<session>:<turn>`, so the second arrival updates the same card instead of adding one — and
434
+ * the error message is still carried onto that update through `pendingErrors`.
435
+ *
436
+ * A subtask failure stays as quiet as a subtask completion: `turn/end` already skips subagents.
437
+ */
438
+ ctx?.on?.('agent/error', ({ agent, turn, error }) => {
439
+ const sessionId = sessionIdOf(agent);
440
+ if (typeof sessionId !== 'string' || sessionId === '') return;
441
+ pendingErrors.set(`${sessionId}:${turn}`, error);
442
+ if (originOf(agent?.session) === 'subagent') return;
443
+ safely(() => dispatch(reducer.agentError({ sessionId, turn, error: error ?? '', message: error?.message })));
444
+ });
419
445
  // v1 user preference: subagent completion is intentionally silent. Keep the
420
446
  // historical kind schema for stored legacy records, but do not create records
421
447
  // or dispatch A/B/C/D for new subagent/end events.
@@ -448,6 +474,17 @@ export async function apply(ctx, config = {}) {
448
474
  workflowOwners.delete(info.id);
449
475
  safely(() => dispatch(reducer.upsert({ kind: 'workflow-end', mergeKey: `wf:${info.id}`, ...(sessionId ? { sessionId } : {}), title: info.meta?.name || '工作流结束', body: result.error || result.stopReason, phase: 'settled', outcome: result.stopReason })));
450
476
  });
477
+ /**
478
+ * One settled job becomes one card. DSH 0.1.7 consolidated the registry into a single event stream whose
479
+ * terminal event is `settled`, and a settlement that released a live waiter was already handed to that
480
+ * caller, so only the unawaited ones are news for a human. The older `onJobDone` listener, which delivered
481
+ * the terminal snapshot with its owning Agent, is kept for a host that still has it.
482
+ */
483
+ const onJobSettled = (job) => {
484
+ if (!subtasksWanted() || !job) return;
485
+ if (job.status === 'running' || job.status === 'stopping') return;
486
+ safely(() => dispatch(reducer.upsert({ kind: 'job-end', mergeKey: `job:${job.id}`, ...(typeof job.owner === 'string' && job.owner !== '' ? { sessionId: job.owner } : {}), ...jobNotification(job), phase: 'settled', outcome: job.status })));
487
+ };
451
488
  const onJobDone = (snapshot, owner) => {
452
489
  if (!subtasksWanted()) return;
453
490
  safely(() => dispatch(reducer.upsert({ kind: 'job-end', mergeKey: `job:${snapshot?.id}`, sessionId: snapshot?.ownerSession ?? sessionIdOf(owner), ...jobNotification(snapshot ?? {}), phase: 'settled', outcome: snapshot?.status })));
@@ -462,10 +499,22 @@ export async function apply(ctx, config = {}) {
462
499
  */
463
500
  let jobListenerAttached = false;
464
501
  const attachJobs = (registry) => {
465
- if (jobListenerAttached || typeof registry?.onJobDone !== 'function') return false;
502
+ if (jobListenerAttached) return false;
503
+ // Current DSH: one lifecycle stream, subscribed with an explicit owner filter. This plugin observes
504
+ // every owner because a profile-level mount is the only composition that can see all sessions.
505
+ if (typeof registry?.events?.subscribe === 'function') {
506
+ jobListenerAttached = true;
507
+ registry.events.subscribe({ owners: 'all' }, (event) => {
508
+ if (event?.type !== 'settled' || event.awaited === true) return;
509
+ onJobSettled(event.job);
510
+ });
511
+ diagnostics.services.jobs = 'events';
512
+ return true;
513
+ }
514
+ if (typeof registry?.onJobDone !== 'function') return false;
466
515
  jobListenerAttached = true;
467
516
  registry.onJobDone(onJobDone);
468
- diagnostics.services.jobs = 'injected';
517
+ diagnostics.services.jobs = 'onJobDone';
469
518
  return true;
470
519
  };
471
520
  if (typeof ctx?.inject === 'function') { try { ctx.inject(['jobs'], (jobCtx) => { attachJobs(jobCtx?.jobs); }); } catch { /* no registry in this composition */ } }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idoall/dsh-notify",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "type": "module",
5
5
  "description": "DSH web plugin: in-page task notifications for DeepSeek Harness — enhanced or soft status toasts, a collapsible top-right stack, 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",
@@ -18,6 +18,10 @@
18
18
  "LICENSE"
19
19
  ],
20
20
  "dsh": {
21
+ "manifestVersion": 1,
22
+ "engines": {
23
+ "dsh": ">=0.1.7-rc.1 <0.2.0"
24
+ },
21
25
  "bundle": {
22
26
  "patch": "./cordis.patch.yml"
23
27
  },
@@ -29,6 +33,11 @@
29
33
  "@deepseek-ai/dsh-client-ui-settings",
30
34
  "@deepseek-ai/dsh-client-ui-settings-general"
31
35
  ]
36
+ },
37
+ "compatibility": {
38
+ "dshReleases": {
39
+ "0.1.7-rc.1": "compatible"
40
+ }
32
41
  }
33
42
  },
34
43
  "scripts": {
@@ -43,14 +52,18 @@
43
52
  "publishConfig": {
44
53
  "access": "public"
45
54
  },
46
- "dependencies": {
47
- "@deepseek-ai/schemastery": "^3.18.2"
48
- },
49
55
  "peerDependencies": {
56
+ "@deepseek-ai/cordis": "^4.0.4",
57
+ "@deepseek-ai/dsh-client-connection": ">=0.1.7-rc.1 <0.2.0",
58
+ "@deepseek-ai/dsh-client-ui-session": ">=0.1.7-rc.1 <0.2.0",
59
+ "@deepseek-ai/dsh-host-webserver": ">=0.1.7-rc.1 <0.2.0",
60
+ "@deepseek-ai/dsh-jobs": ">=0.1.7-rc.1 <0.2.0",
61
+ "@deepseek-ai/schemastery": "^3.18.4",
50
62
  "react": "^18.2.0"
51
63
  },
52
64
  "devDependencies": {
53
- "@deepseek-ai/cordis": "4.0.2",
65
+ "@deepseek-ai/cordis": "^4.0.4",
66
+ "@deepseek-ai/schemastery": "^3.18.4",
54
67
  "@types/node": "^22.15.29",
55
68
  "@types/react": "^18.3.23",
56
69
  "esbuild": "^0.25.5",