会话完成、需要工具授权、需要回答时提醒: - 窗口不在前台走系统通知(Windows / macOS / Linux 同一条渲染进程通知通道,无平台分支),点击回到 DSH 并跳到该会话; - 窗口在前台走应用内轻弹窗(右上角、6 秒自动消失、可悬停暂停、Esc 关闭、点「查看」跳转); - 正在看的那个会话完成时不打扰。 触发与去重:只对「运行中 → 空闲」的转变提醒,同一会话同一轮只报一次,同一待处理请求只报一次; 子智能体会话与空白会话跳过;打开应用时已在运行的会话只建基线不补发; 多个会话同时完成有 1.5 秒节流,完成提醒前有 400ms 确认窗口(那一轮又跑起来就不报)。 设置 → 通用 → 会话通知:权限状态、请求权限、测试通知、完成/授权/提问三个开关, 以及观察器自身的健康状态(收不到会话状态时直接显示,不会静默失效)。 实现形态遵循 DSH 插件规范:dsh.manifestVersion 1、dsh.bundle.patch 声明宿主行、 dsh.client 声明 platform: web 的浏览器半;宿主半为空壳,不注册任何服务与路由。 会话状态只通过 slot 的标准 props(useSessions / useSessionStatus)读取, 只往 settings.general.item 与 shell.overlay 注册,样式只用主题 token,不 import 客户端包。 修复:观察器原先挂在 sidebar.panellist,而该 slot 的宿主会把每个条目的 id 当作一个 左侧面板按钮(label 取 options.label ?? options.id,条目作为图标内联渲染), 导致左侧多出一行空面板并挤坏侧边栏;现改挂通用浮层 shell.overlay。
30 lines
1.2 KiB
JavaScript
30 lines
1.2 KiB
JavaScript
/**
|
|
* Host half of the session-notify bundle.
|
|
*
|
|
* Every notification in this plugin is produced by the browser half: the page
|
|
* owns the DOM (the in-app light popup) and is the only place a Web
|
|
* `Notification` can be constructed, which is the one system-notification
|
|
* channel that behaves the same on Windows, macOS, and Linux inside the Harness
|
|
* Desktop shell. The Host half therefore owns no state, registers no service,
|
|
* no route, and no event listener — it exists so the bundle has the ordinary
|
|
* profile-level plugin row its patch declares, and so a future Host-side
|
|
* capability (for example persisting the per-kind switches into this profile's
|
|
* patch) has a place to live.
|
|
*
|
|
* The export form is the documented one — `export function apply(ctx, config)`
|
|
* with no `inject` and no `Config` — and it is deliberately the only export
|
|
* form this package uses.
|
|
*
|
|
* @module @dsh-plugin/session-notify
|
|
*/
|
|
|
|
/**
|
|
* Mount the Host row.
|
|
* @param ctx - Host context; no service is required, so this never blocks activation.
|
|
*/
|
|
export function apply(ctx) {
|
|
ctx.logger?.debug?.(
|
|
'session-notify: host half idle by design — notifications run in the browser half',
|
|
)
|
|
}
|