SMWHff/dsh-restart-progress ↗★ 0
dsh-restart-progress
In-page restart overlay + detached restart script for DeepSeek Harness (DSH) Web: shows a full-screen spinner overlay in the current page the moment a restart starts, auto-reloads when the server is back, and notifies the originating session so the agent reports 'restarted' by itself. Esc / close button to bail out.
AI 분석
核心用途是在 DSH 重启时展示全屏加载遮罩,并在服务恢复后自动刷新页面、通知原会话。适合经常需要重启 DSH 服务以应用配置或更新,且希望无缝衔接会话的用户。
설치
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:SMWHff/dsh-restart-progress2. 配置重启脚本
把 scripts/restart-dsh-web.ps1 复制到本机(例如 ~/.dsh/scripts/),按机器实际情况修改以下硬编码路径:
| 变量 | 默认值 | 说明 |
|---|---|---|
$logDir | C:\Users\SMWHff\.dsh\logs | 日志与标志文件目录 |
$env:DSH_HOME | C:\Users\SMWHff\.dsh | DSH 数据目录 |
$node | C:\Program Files\nodejs\node.exe | node.exe 实际路径 |
$bin | …\node_modules\@deepseek-ai\dsh\lib\bin.js | dsh bin.js 实际路径 |
-WorkingDirectory | C:\Users\SMWHff | 启动工作目录 |
使用方式
| 方式 | 说明 |
|---|---|
| agent 在会话内触发(推荐) | agent 执行脚本即可。脚本继承会话环境变量 DSH_SESSION_ID,重启完成后自动向该会话发「已重启」唤醒 agent |
| 终端手动触发 | 无 DSH_SESSION_ID 时仅重启 + 遮罩,不发通知 |
| 退出遮罩 | 按 Esc 或点右上角 ✕;退出只对当前这一轮生效 |
配置与调参
| 参数 | 位置 | 默认值 | 说明 |
|---|---|---|---|
| 杀旧前延迟 | restart-body.ps1 Start-Sleep | 8 秒 | 给外层脚本收尾时间 |
| 健康检查上限 | restart-body.ps1 轮询 | 60 秒 | 超过即报告 FAILED |
| 通知重试 | restart-body.ps1 循环 | 8 次 × 3 秒 | 兜住「端口监听但路由未就绪」 |
| 前端轮询间隔 | lib/client.js PING_INTERVAL_MS | 2000 ms | 遮罩出现延迟与它成正比 |
| 成功连击 | lib/client.js SUCCESS_STREAK | 3 次 | 连续 N 次在线才刷新 |
| 遮罩超时 | lib/client.js TIMEOUT_MS | 5 分钟 | 超时后遮罩提示手动排查 |
| 通知文案 | restart-body.ps1 base64 字符串 | 「已重启」 | 改文案后重新 base64 编码替换 |