跳到主要内容

dsh-plugin-restart-notify

已验证

dsh-plugin-restart-notify · v0.3.1 · MIT · Web 界面

Desktop notification for dsh web telling the user to restart after a rebuild the running server has not loaded

安装

dsh plugin add dsh-plugin-restart-notify

用 dsh --profile default --dump-config 确认 layer 已生效 —— 参见安装指南。

源码

发布到 npm 但没有公开仓库。安装前请检查包内容。

标签

说明文档

dsh-plugin-restart-notify

检测到"新构建已落地但服务器未重启"时弹出系统桌面通知的 dsh web 插件(dsh-plugin 社区插件)。

功能

  • host 半(src/host/):检测 .dsh-build/client-build-environment.json 的写入时间晚于服务器启动时间 → 向页面注入 __DSH_BUILD_STALE__
  • client 半:读到 stale 标志 → 弹出系统通知「检测到新构建,请手动重启 dsh web」
  • 权限在用户首次交互时请求(浏览器要求手势);被拒则静默

组成

半 文件 职责
host src/host/index.ts 构建记录检测 + webserver/index-inject 注入标志
client src/client/index.ts 读标志 + 桌面通知

依赖

peer 依赖(npm 已发布):

  • @deepseek-ai/cordis
  • @deepseek-ai/dsh-client-locale
  • @deepseek-ai/dsh-client-runtime
  • @deepseek-ai/dsh-client-ui-slots
  • @deepseek-ai/dsh-host-webserver(host 半的 index-inject 类型)
  • @deepseek-ai/schemastery(host 半 Config schema)

构建

pnpm install
pnpm run build

产物:lib/index.js(host 半)、lib/client.js(浏览器半)。

安装

插件是 dsh.bundle 形态(声明配置层),一条命令即可安装进 profile:

dsh plugin --profile web add dsh-plugin-restart-notify

dsh plugin add 自动把包加入 dsh.profile.bundles 配置层并安装依赖。完成后重启 profile 生效:

dsh web   # 或 dsh --profile <name>

root 配置(指向含 .dsh-build/client-build-environment.json 的仓库根)默认取 process.env.DSH_REPO_ROOT,回退到 D:\deepseek-harness。仓库在其他位置时,在 profile 的 cordis.patch.yml 覆盖:

- id: restart-notify
  config:
    root: !!js process.env.DSH_REPO_ROOT ?? '/path/to/repo'

无 checkout 场景没有构建记录,检测自然跳过。手动挂载(不通过 dsh plugin add)时在 profile 的 cordis.patch.yml 加:

- insert:
    - id: restart-notify
      name: dsh-plugin-restart-notify

发布

npm publish

GitHub 仓库添加 dsh-plugin 话题。

已知限制

  • 仅源码 checkout 检测:构建记录来自仓库根;无 checkout 则无信号
  • 页面加载时静态读取:标志只在启动时读取一次;需刷新页面触发
  • 需要通知权限:首次交互时请求;被拒则静默