Skip to content

Releases: G57651/dsh-one-click-restart

v0.1.2 — 修复桌面端重启 unauthorized(同源取令牌)

Choose a tag to compare

@G57651 G57651 released this 28 Sep 20:31

🐛 修复

  • 桌面端「重启失败:unauthorized」根因修复:桌面窗口的 index 来自应用包内静态 dist,webserver/index-inject 注入的 __DSH_RESTART_TOKEN__ 只在 Host 启动时经 IPC 快照一次,永远到不了桌面页面 → 无令牌 POST 被插件自身 401。改为客户端从同源 GET /api/restart-harness 获取令牌(同源请求自带 Host 认证),注入行降级为 Web 端零往返快路径
  • 网络错误不再误报成功:仅「已持有令牌、POST 确已发出」后的连接中断才视为成功;无法到达宿主时返回显式失败与可操作提示
  • 端点安全加固:exact 路由优先于宿主 /api 准入栅栏,handler 内补 loopback Host 白名单 + 拒绝 sec-fetch-site: cross-site
  • Config 全字段 .volatile():HMR / 配置热更后令牌与设置不再钉死旧值;读取统一走 configValue / readConfig 快照
  • 服务名命名空间化:restartHarnessToken → oneClickRestart.token
  • watchdog 加固:appName 白名单校验;枚举 PID + ps 复核归属后按 PID 发信号,不再 pkill -f 子串误杀
  • dsh.client.inject 补 @deepseek-ai/dsh-client-ui-renderer(slots 服务真实提供者);devDependencies 对齐 0.2.0-rc.1;从 sourcemap 补回客户端源码 src/client/index.tsx

📦 安装

CLI(推荐)

dsh plugin --profile desktop add github:G57651/dsh-one-click-restart

升级已有安装

dsh plugin --profile desktop add https://github.com/G57651/dsh-one-click-restart/releases/download/v0.1.2/dsh-restart-one-click-restart-0.1.2.tgz

Web UI:Plugins 页 → Git 填 github:G57651/dsh-one-click-restart;或下载本页附件 tarball 后 dsh plugin --profile desktop add ./dsh-restart-one-click-restart-0.1.2.tgz

v0.1.1 — 兼容 DSH 0.2.0-rc.1(dsh-tools peer 放宽)

Choose a tag to compare

@G57651 G57651 released this 28 Sep 17:04

🐛 修复

  • 兼容 DSH 0.2.0-rc.1:peerDependencies 的 @deepseek-ai/dsh-tools 由 ^0.1.7-rc.1 放宽为 ^0.1.7-rc.1 || ^0.2.0-rc.1——0.2.0 新增插件 peer 兼容性预检,旧范围在 0.2.0-rc.1 下判定不满足,会被宿主禁用
  • 范围写法说明:^0.2.0 对 0.2.0-rc.1 为 false(预检以 includePrerelease:true 求 satisfies),必须显式写出 -rc.1 段
  • 代码零改动;README「兼容性」一节重写 + 变更记录

📦 安装

CLI(推荐)

dsh plugin --profile desktop add github:G57651/dsh-one-click-restart

升级已有安装

dsh plugin --profile desktop add https://github.com/G57651/dsh-one-click-restart/releases/download/v0.1.1/dsh-restart-one-click-restart-0.1.1.tgz

Web UI:Plugins 页 → Git 填 github:G57651/dsh-one-click-restart;或下载本页附件后:

dsh plugin --profile desktop add ./dsh-restart-one-click-restart-0.1.1.tgz

✅ 验证

  • 真实宿主框架(cordis 4.0.4)+ 宿主内联 dsh-tools(0.1.7-rc.2)台架:restart_harness 工具注册成功、/api/restart-harness(exact)注册、webserver/index-inject 事件落表 __DSH_RESTART_TOKEN__;GET → 405、错 token → 401;dispose 后 active routes 0
  • 0.2.0-rc.1 源码五项契约复核:defineTool 签名、appExit provide、webServer 注入与槽位、relaunch 进程模型全部未变
  • 宿主预检算法实测(runtime 0.2.0-rc.1):新范围 ALLOW,旧范围 DENY(对照确认)

📝 说明

  • 不修改宿主 main.js、不依赖 app.relaunch、无联网上报
  • 配置项(appName / relaunchDelayMs / maxRelaunchAttempts / restartToken 等)见 README

v0.1.0 — 一键重启(侧边栏按钮 + 模型工具 + 独立 watchdog)

Choose a tag to compare

@G57651 G57651 released this 26 Sep 14:59

✨ 功能

  • 侧边栏「重启 Harness」按钮:宽窄栏自适应(图标+文字 / 圆形图标),pending / 失败反馈
  • restart_harness 模型工具:agent 可直接调用,可传 delayMs
  • 独立 watchdog 进程:Harness 完全退出后仍能重新拉起(detached + unref + open -a,重试次数 / 延迟可配)
  • 双运行面优雅退出:桌面端 AppleScript quit 整个应用;web / headless 走 ctx.appExit(0) + 6 秒硬退出兜底
  • HTTP 路由:loopback + 共享令牌鉴权(POST /api/restart-harness)

📦 安装

CLI(推荐)

dsh plugin --profile desktop add github:G57651/dsh-one-click-restart

Web UI:Plugins 页 → Git 填 github:G57651/dsh-one-click-restart;或下载本页附件后:

dsh plugin --profile desktop add ./dsh-restart-one-click-restart-0.1.0.tgz

📝 说明

  • 不修改宿主 main.js、不依赖 app.relaunch、无联网上报
  • 配置项(appName / relaunchDelayMs / maxRelaunchAttempts / restartToken 等)见 README
  • 本 release 与仓库 README 同步创建(面向访客的安装说明已重写)