dsh-macos-notifier 0.1.0 → 0.1.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.en.md +10 -8
- package/README.md +10 -8
- package/client.js +2 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.1] - 2026-11-29
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Corrected both READMEs to state that every eligible session-completion event always publishes an in-app card, regardless of system notification permission: 9 seconds while focused, 60 seconds while unfocused. The card also appears alongside an allowed system banner; notification timing and publication logic are unchanged.
|
|
8
|
+
- Documented macOS permission setup: System Settings → Notifications → DeepSeek Harness → Banners, with Allow Notifications enabled. The system banner title is the session name; clicking it returns to that session.
|
|
9
|
+
- Declared engines: Node `>=20`, DSH `>=0.2.2-rc.1 <0.3.0`.
|
|
10
|
+
- Adapted session snapshot reads to the installed `0.2.2-rc.5` contract: title fallback now includes `displayTitle`, and parent-session filtering includes `parentId`. Legacy `label` and `parentSessionId` fallbacks remain supported. No other client API adaptation was needed.
|
|
11
|
+
- Clarified that polling starts only when remote event subscription is unavailable or throws; an event-name change alone does not activate it.
|
|
12
|
+
|
|
13
|
+
### Compatibility evidence
|
|
14
|
+
|
|
15
|
+
Static inspection of the installed DSH `0.2.2-rc.5` host on 2026-11-29. Paths below are relative to `/opt/homebrew/lib/node_modules/@deepseek-ai/dsh/node_modules/@deepseek-ai/`.
|
|
16
|
+
|
|
17
|
+
| API / contract | Evidence path | Observed contract |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| Module registration | `dsh-client-modules/src/client/manifest.ts` | `ClientBundleRegistration.factory(require)` and `ClientModuleLoaderTarget.load(registration)` remain available. |
|
|
20
|
+
| Session navigation | `dsh-client-ui-workspace/src/client/navigation.ts` | The `uiWorkspace` service still exposes `openSession(target: SessionTarget): void`; `dsh-api-session-controller/src/client/contract/sessions.ts` defines `SessionTarget` to include a session ID. |
|
|
21
|
+
| Session snapshots | `dsh-api-session-controller/src/client/contract/sessions.ts`; `dsh-api-session-controller/src/client/sessions/service.ts` | `sessions.list` is an observable snapshot with `getSnapshot()` and `byId`. Rows contain `title`, `displayTitle`, `running`, `origin`, `parentId`, and `blank`; `label` and `parentSessionId` are not current row fields. Also checked `dsh-api-session-controller/lib/types/client/sessions/service.d.ts`. |
|
|
22
|
+
| Status subscription | `dsh-api-gateway/src/client/index.ts`; `dsh-api-session-controller/src/client/index.ts`; `dsh-api-session-controller/src/types.ts` | `remote.$on(event, listener)` returns a disposer; `api-session/status(sessionId, running)` remains declared and used by the host client. |
|
|
23
|
+
| Slot registration | `dsh-client-ui-renderer/src/client/registry.ts` | The `slots` service retains `inject(key, callback)` and `register(options, component)`, with disposal through Cordis effects. |
|
|
24
|
+
| Translation | `dsh-client-locale/src/client/index.ts` | The `locale` service retains `register(namespace, { zh, en })` returning a disposer and `bind(namespace)` returning a translation function. |
|
|
25
|
+
| Style overlay | `dsh-client-ui-layout/src/client/index.ts`; `dsh-client-ui-layout/src/client/AppFrame.tsx` | `shell.overlay` remains a root-scoped list slot and is rendered by the app frame. |
|
|
26
|
+
| Bell action | `dsh-client-ui-conversation/src/client/contract/slots.ts`; `dsh-client-ui-conversation/src/client/apply.ts` | `conversation.session.header.utilities` remains a session-scoped list slot. Session scope supplies `sessionId` via `dsh-client-ui-session/src/client/index.ts`. |
|
|
27
|
+
| Bundle configuration | `dsh-client-ui-plugin-manager/src/client/slot-contract.ts`; `dsh-client-ui-plugin-manager/src/client/index.ts` | `plugins.bundle.config` still exists as a root-scoped keyed slot, keyed by package name. This plugin does not use it and has no settings page. |
|
|
28
|
+
|
|
29
|
+
This records source and declaration compatibility, not a live macOS banner, click-navigation, or full version-range test.
|
|
30
|
+
|
|
3
31
|
## [0.1.0] - 2026-11-11
|
|
4
32
|
|
|
5
33
|
First public release.
|
package/README.en.md
CHANGED
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|

|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
>
|
|
7
|
+
> Always shows an in-app notice when a session finishes its turn (9 seconds in the foreground / 60 seconds in the background), alongside a macOS banner once the user allows system notifications. The banner title is the session name; clicking it returns to that session. Notifications are posted by the DSH renderer itself: no child process, no osascript, no state file.
|
|
8
8
|
|
|
9
9
|
## What it does
|
|
10
10
|
|
|
11
11
|
- Fires one macOS notification when a session goes from **running** to **stopped** — `onStatus()` only lets through the `prev === true && isRunning === false` edge, so mid-turn status flapping does not notify.
|
|
12
|
-
- The notification title is the **session name**: `byId[id].title` from the `sessions` snapshot, falling back to `label
|
|
12
|
+
- The notification title is the **session name**: `byId[id].title` from the `sessions` snapshot, falling back to `displayTitle` (with legacy `label` support), then to `DSH`.
|
|
13
13
|
- **Clicking the notification returns to that session**: `uiWorkspace.openSession(sessionId)`.
|
|
14
14
|
- Notifications for the same session replace each other instead of stacking: `tag` is always `dsh-session-<sessionId>`, and the same session is throttled for 2 seconds (`THROTTLE_MS = 2000`).
|
|
15
|
-
-
|
|
15
|
+
- Every session-completion event **always** shows an in-app notice, regardless of system notification permission; once system banners are allowed, both channels fire together. The notice disappears after 9 seconds in the foreground and 60 seconds in the background, with at most 3 on screen; clicking it also returns to that session.
|
|
16
16
|
- A **small bell** in the session header utilities posts a test notification, to confirm the channel works.
|
|
17
17
|
- Subagent sessions, sessions with a parent session, and blank sessions are skipped (`isNotifiable()`).
|
|
18
18
|
|
|
@@ -24,8 +24,8 @@ All the logic lives in `client.js` and runs inside the DSH renderer; `index.js`
|
|
|
24
24
|
| --- | --- |
|
|
25
25
|
| Trigger | `ctx.get('remote').$on('api-session/status', (sessionId, isRunning) => …)`, then `onStatus()` decides the edge |
|
|
26
26
|
| Poll fallback | When `remote.$on` is unavailable it degrades to `setInterval(…, 800)` comparing the `running` field of the snapshot |
|
|
27
|
-
| Session filter | `isNotifiable()` skips `origin === 'subagent'`, entries with `parentSessionId
|
|
28
|
-
| Title | `ctx.get('sessions')` snapshot `byId[sessionId].title` →
|
|
27
|
+
| Session filter | `isNotifiable()` skips `origin === 'subagent'`, entries with `parentId` (or legacy `parentSessionId`), and `blank === true` |
|
|
28
|
+
| Title | `ctx.get('sessions')` snapshot `byId[sessionId].title` → `displayTitle` → legacy `label` → `'DSH'` |
|
|
29
29
|
| System notification | `new Notification(title, { body, tag: 'dsh-session-' + sessionId, silent: false })` |
|
|
30
30
|
| Throttle | `THROTTLE_MS = 2000`, keyed by `sessionId`; inside the window it returns `false` |
|
|
31
31
|
| Click (main) | `n.onclick` → `ctx.get('uiWorkspace').openSession(sessionId)` |
|
|
@@ -74,7 +74,9 @@ Ask the agent in DSH to install `dsh-macos-notifier`; it calls `plugin_manager`:
|
|
|
74
74
|
|
|
75
75
|
### Allow notifications after installing
|
|
76
76
|
|
|
77
|
-
System Settings → Notifications → DeepSeek Harness → turn on **Allow Notifications
|
|
77
|
+
On macOS, open **System Settings → Notifications → DeepSeek Harness → Banners** and turn on **Allow Notifications**. System banners require the user to grant notification permission to DeepSeek Harness; the banner title is the session name, and clicking it returns to that session.
|
|
78
|
+
|
|
79
|
+
The in-app notice always appears, regardless of system notification permission: it stays for 9 seconds while the DSH window is in the foreground and focused, or 60 seconds while it is in the background or unfocused. It still appears alongside an allowed system banner; without permission, only the in-app notice appears.
|
|
78
80
|
|
|
79
81
|
## Configuration
|
|
80
82
|
|
|
@@ -94,9 +96,9 @@ There is **no settings page**: `apply()` in `index.js` is empty and there is no
|
|
|
94
96
|
## Known limitations
|
|
95
97
|
|
|
96
98
|
- **macOS only, in practice**: this uses the renderer's web `Notification`. Opening the same web GUI in a normal browser sends notifications through that browser with its own permission, and this plugin does not take over.
|
|
97
|
-
- **No banner without permission**: `systemNotify()` returns `false` straight away when `Notification.permission !== 'granted'
|
|
99
|
+
- **No banner without permission**: `systemNotify()` returns `false` straight away when `Notification.permission !== 'granted'`; the in-app notice appears whether permission is granted or not, for 9 seconds in the foreground / 60 seconds in the background.
|
|
98
100
|
- **The user has to grant permission once**: it is requested only from the bell's click gesture (a request on page load is rejected by the system). When the state is `denied` or `default`, clicking the bell opens the system notification settings rather than a permission dialog.
|
|
99
|
-
- **Two host contracts**: the event name `api-session/status`, and the `
|
|
101
|
+
- **Two host contracts**: the event name `api-session/status`, and the `byId[]` fields in `sessions.list.getSnapshot()` (`title` / `displayTitle` / `running` / `origin` / `parentId` / `blank`, with legacy `label` / `parentSessionId` support). Polling every 800 ms starts only when `remote.$on` is unavailable or subscription throws; renaming the event alone does not switch to polling if subscription still succeeds. Statically checked against DSH `0.2.2-rc.5`; evidence paths are in `CHANGELOG.md`. The declared compatibility range is `>=0.2.2-rc.1 <0.3.0`; not every version in that range has been run.
|
|
100
102
|
- **The click fallback expires after 90 seconds**: if clicking the banner only brings the window forward without firing `onclick`, the `focus` handler jumps once; past `PENDING_TTL_MS` it does not.
|
|
101
103
|
- **Not a notification centre**: no history, no grouping, nothing adjustable from the UI; the in-app notice is fixed to the bottom-right of the page (`z-index: 2147483000`).
|
|
102
104
|
- **Throttle is hard-coded**: `THROTTLE_MS = 2000` lives in `client.js`; a second turn ending within 2 seconds for the same session does not notify again.
|
package/README.md
CHANGED
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|

|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
>
|
|
7
|
+
> 会话干完这一轮时,始终显示应用内提示卡(前台 9 秒 / 后台 60 秒),并在用户允许系统通知后同时发送 macOS 横幅。横幅标题是会话名,点击回到该会话。通知由 DSH 自己的渲染层发出:不起子进程、不调用 osascript、不写状态文件。
|
|
8
8
|
|
|
9
9
|
## 它做什么
|
|
10
10
|
|
|
11
11
|
- 会话从「运行中」变成「已停止」时发一条 macOS 系统通知——`onStatus()` 只放行 `prev === true && isRunning === false` 这一条边沿,运行中途的状态抖动不弹。
|
|
12
|
-
- 通知标题是**会话名**:取 `sessions` 快照里的 `byId[id].title`,读不到时回退 `label
|
|
12
|
+
- 通知标题是**会话名**:取 `sessions` 快照里的 `byId[id].title`,读不到时回退 `displayTitle`(兼容旧字段 `label`),再读不到用 `DSH`。
|
|
13
13
|
- **点通知回到那个会话**:`uiWorkspace.openSession(sessionId)`。
|
|
14
14
|
- 同一会话的通知互相替换,不堆成一列:`tag` 固定为 `dsh-session-<sessionId>`;同一会话 2 秒内不重复发(`THROTTLE_MS = 2000`)。
|
|
15
|
-
-
|
|
15
|
+
- 每次会话结束事件**始终**显示一张应用内提示卡,与系统通知权限无关;允许系统横幅后,两条通道同时发送。提示卡前台 9 秒、后台 60 秒后自动消失,同屏最多 3 张,点击同样回到该会话。
|
|
16
16
|
- 会话头部工具区有一个**小铃铛**:点一下发一条测试通知,用来确认通道通不通。
|
|
17
17
|
- 子代理会话、带父会话的会话、空白会话不发通知(`isNotifiable()` 过滤)。
|
|
18
18
|
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
| --- | --- |
|
|
25
25
|
| 触发 | `ctx.get('remote').$on('api-session/status', (sessionId, isRunning) => …)`,交给 `onStatus()` 判断边沿 |
|
|
26
26
|
| 兜底轮询 | `remote.$on` 不可用时退化为 `setInterval(…, 800)`,比对快照里的 `running` 字段 |
|
|
27
|
-
| 会话过滤 | `isNotifiable()` 跳过 `origin === 'subagent'`、带 `parentSessionId
|
|
28
|
-
| 标题 | `ctx.get('sessions')` 快照的 `byId[sessionId].title` →
|
|
27
|
+
| 会话过滤 | `isNotifiable()` 跳过 `origin === 'subagent'`、带 `parentId`(兼容旧字段 `parentSessionId`)、`blank === true` 的会话 |
|
|
28
|
+
| 标题 | `ctx.get('sessions')` 快照的 `byId[sessionId].title` → `displayTitle` → 旧字段 `label` → `'DSH'` |
|
|
29
29
|
| 系统通知 | `new Notification(title, { body, tag: 'dsh-session-' + sessionId, silent: false })` |
|
|
30
30
|
| 节流 | `THROTTLE_MS = 2000`,按 `sessionId` 记时,窗口内直接返回 `false` |
|
|
31
31
|
| 点击(主路径) | `n.onclick` → `ctx.get('uiWorkspace').openSession(sessionId)` |
|
|
@@ -74,7 +74,9 @@
|
|
|
74
74
|
|
|
75
75
|
### 装完先开系统通知
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
在 macOS 中打开**系统设置 → 通知 → DeepSeek Harness → 横幅**(System Settings → Notifications → DeepSeek Harness → Banners),并打开「允许通知」。系统横幅需要用户授予 DeepSeek Harness 通知权限;横幅标题是会话名,点击回到该会话。
|
|
78
|
+
|
|
79
|
+
应用内提示卡始终显示,与系统通知权限无关:DSH 窗口在前台并获得焦点时保留 9 秒,后台或失去焦点时保留 60 秒。允许系统横幅后仍会同时显示提示卡;未授权时只有提示卡。
|
|
78
80
|
|
|
79
81
|
## 配置
|
|
80
82
|
|
|
@@ -94,9 +96,9 @@
|
|
|
94
96
|
## 已知限制
|
|
95
97
|
|
|
96
98
|
- **仅 macOS 有意义**:用的是渲染层的 Web `Notification`。在普通浏览器里打开同一个 Web GUI 时,通知由浏览器自己发、权限另算,插件不接管。
|
|
97
|
-
- **系统通知未授权时没有横幅**:`systemNotify()` 在 `Notification.permission !== 'granted'` 时直接返回 `false
|
|
99
|
+
- **系统通知未授权时没有横幅**:`systemNotify()` 在 `Notification.permission !== 'granted'` 时直接返回 `false`;应用内提示卡无论是否授权都会显示,前台 9 秒 / 后台 60 秒。
|
|
98
100
|
- **首次授权要用户动手**:权限只在点击小铃铛的手势里请求(页面加载时自动请求会被系统拒绝)。`denied` / `default` 时点铃铛打开的是系统通知设置,不是权限对话框。
|
|
99
|
-
- **依赖宿主两个契约**:事件名 `api-session/status`,以及 `sessions`
|
|
101
|
+
- **依赖宿主两个契约**:事件名 `api-session/status`,以及 `sessions.list.getSnapshot()` 的 `byId[]` 字段(`title` / `displayTitle` / `running` / `origin` / `parentId` / `blank`;兼容旧字段 `label` / `parentSessionId`)。仅当 `remote.$on` 不可用或订阅抛错时才启用每 800 ms 轮询;只改事件名但订阅仍成功时不会自动切换。已静态核对 DSH `0.2.2-rc.5`,证据路径见 `CHANGELOG.md`;声明兼容范围为 `>=0.2.2-rc.1 <0.3.0`,未逐一运行验证范围内的所有版本。
|
|
100
102
|
- **补跳只有 90 秒窗口**:点横幅若只把窗口拉到前台、没触发 `onclick`,靠 `window` 的 `focus` 事件补跳;超过 `PENDING_TTL_MS` 不再跳。
|
|
101
103
|
- **不是通知中心**:不保存历史、不分组、UI 里不可调;应用内提示固定盖在页面右下角(`z-index: 2147483000`)。
|
|
102
104
|
- **节流写死**:`THROTTLE_MS = 2000` 硬编码在 `client.js`,同一会话 2 秒内的第二次结束不会重复弹。
|
package/client.js
CHANGED
|
@@ -214,7 +214,7 @@ window.__ModuleLoader__.load({
|
|
|
214
214
|
try {
|
|
215
215
|
const snap = readSessions(ctx);
|
|
216
216
|
const row = snap && snap.byId && snap.byId[sessionId];
|
|
217
|
-
const title = row && (row.title || row.label);
|
|
217
|
+
const title = row && (row.title || row.displayTitle || row.label);
|
|
218
218
|
return typeof title === 'string' && title.trim() ? title.trim() : null;
|
|
219
219
|
} catch (err) {
|
|
220
220
|
return null;
|
|
@@ -226,7 +226,7 @@ window.__ModuleLoader__.load({
|
|
|
226
226
|
const snap = readSessions(ctx);
|
|
227
227
|
const row = snap && snap.byId && snap.byId[sessionId];
|
|
228
228
|
if (!row) return true;
|
|
229
|
-
if (row.origin === 'subagent' || row.parentSessionId) return false;
|
|
229
|
+
if (row.origin === 'subagent' || row.parentId || row.parentSessionId) return false;
|
|
230
230
|
if (row.blank === true) return false;
|
|
231
231
|
return true;
|
|
232
232
|
} catch (err) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-macos-notifier",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Posts a macOS notification titled with the session name when that session finishes a turn; clicking the notification returns to the session.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|
|
28
28
|
"node": ">=20",
|
|
29
|
-
"dsh": ">=0.2.2-rc.1"
|
|
29
|
+
"dsh": ">=0.2.2-rc.1 <0.3.0"
|
|
30
30
|
},
|
|
31
31
|
"icon": "./icon.svg",
|
|
32
32
|
"exports": {
|