anweat/dsh-restart 预览 preview

anweat/dsh-restart

Project Overview项目介绍

This is a native plugin built exclusively for DeepSeek Harness (DSH) that enables full process restarts to reload all installed plugins and configuration changes, including updated cordis combinations for your profile and modified system settings. To install the plugin, you add it as a dependency in your profile’s package.json, then add it to the bundles array under the dsh.profile section of that same file. After adding the entry, you complete the initial install by manually restarting DSH once, after which the plugin will be available via multiple trigger entry points.

The plugin offers three main ways to trigger a restart: a restart_harness model tool that lets the agent schedule a restart with an optional delay, a /restart slash command for manual triggering from the UI, and an immediate restart button in the plugin’s settings card. You can edit settings directly via the DSH settings interface, with changes automatically written to your settings.yaml file. Configurable options include enabling the legacy PowerShell/WMI restart method and setting a custom prompt that the agent receives when it resumes after restart.

This plugin is released under the permissive MIT open source license. For security reasons, all restart requests are rejected unless they come from the localhost loopback address (127.0.0.1), so requests from reverse proxies or remote access will return a 403 error. Detached watchdog functionality was removed in version 0.1.3-alpha.4, so you will need to rely on an external process manager like systemd or Windows Services for unexpected DSH process crash recovery. Different versions are published to the npm latest and next channels, matching different DSH baseline versions for compatibility.

这是一款专为 DeepSeek Harness (DSH) 开发的原生插件,核心作用是触发整个 DSH 进程的重启,从而重新加载所有插件和配置,包括 profile 的 cordis 组合、系统设置等内容。该插件同时包含服务端和客户端两部分,只需要将其添加到对应 profile 的 bundle 配置中即可完成安装,支持模型工具调用、斜杠命令、设置按钮等多种触发重启的方式。

开发者在修改 DSH 插件代码、调整自定义 profile 配置后,不需要手动关闭原有进程再重新启动,只需要调用该插件提供的能力即可一键完成整个进程的重启。普通用户也可以通过 DSH 设置页的「DSH 重启」配置卡片里的「立即重启」按钮手动触发,还能在配置页自定义旧 PowerShell/WMI 重启方式、重启后自动继续的提示词等选项。

该插件采用 MIT 许可证开源,目前已针对 DSH 基线版本 dsh-v0.1.1-rc.2 和 dsh-v0.1.5-alpha.1 完成兼容性验证,不同版本分别对应 npm 的 latest 正式通道和 next 候选发布通道。出于安全考虑,远程或反向代理访问时重启请求会被拒绝,仅接受来自本地环回地址的同源请求;内置 detached watchdog 已从 0.1.3-alpha.4 版本起停用,进程异常恢复需依赖 systemd、Windows 服务等外部进程管理器。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 8 stars - very few users, little community feedback星标只有 8,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:anweat/dsh-restart

把 anweat/dsh-restart 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-restart

重启整个 DeepSeek Harness 进程的插件,用于重新加载插件与配置(profile 的 cordis 组合、settings 等)。host + client 双半,装进 profile 的 bundle 后即可用。

DSH 重启插件设置

截图来自真实 web profile 部署,展示当前 DSH 设置页中的重启配置卡片。

功能

  • 模型工具 restart_harness:让 agent 直接安排一次进程重启(可选 delayMs)。
  • /restart 斜杠命令:在 UI 里手动触发重启。
  • 配置卡片(设置 → 插件 → 插件配置 → 「DSH 重启」):可视化编辑以下设置,改动即时写入 settings.yaml:
    • legacyRestart — 旧 PowerShell/WMI/taskkill 重启方式(默认关闭,用 Node 原生方式)。
    • continuePrompt — 重启后自动继续时注入给 agent 的提示词。
  • 「立即重启」按钮:先读取当前进程身份,安排重启后等待新进程恢复并自动刷新页面。只读 GET 返回 { pid, startedAt };出于安全考虑,重启 POST 仍仅接受来自环回地址(127.0.0.1 / localhost)的同源请求,经反向代理/远程访问时会被拒绝(403)。

自 0.1.3-alpha.4 起,内置 detached watchdog 已停用并从设置卡片移除。旧 watchdog* 配置仍可被读取但不会执行;进程异常恢复请交给 systemd、Windows 服务或其他拥有完整进程生命周期的外部管理器。插件启动时会保留 $DSH_HOME/dsh-stop.flag,让旧版本遗留的 detached watchdog 自行退出。

兼容与发布通道

插件发布通道 DSH 基线 兼容承诺
npm latest(当前正式发布插件) dsh-v0.1.1-rc.2 已验证维护基线
npm next 候选(0.1.3-alpha.5) dsh-v0.1.5-alpha.1 精确依赖与真实 profile 验收目标
后续 DSH 正式版 尚未发布 发布并完成真实 profile 门禁后再声明兼容

开发版不会覆盖 npm latest。0.1.5-alpha.1 依赖按精确版本锁定;该版本已移除 @deepseek-ai/dsh-client-runtime,客户端契约分别迁移到 Cordis、 dsh-client-store 与 dsh-client-ui-settings,不会混装 rc.2 运行时。

0.1.3-alpha.4 变更

  • 禁用并移除内置 detached watchdog;旧配置保留为无操作兼容项。
  • Windows 重启通过隐藏控制台拉起,保留完整 argv,避免后续 sandbox 命令闪窗。
  • 新进程 PID 变化后继续等待带认证的前端首页返回成功,再刷新页面,避免源码部署 重启期间因静态前端尚未挂载而停留在 HTTP 404。
  • 防止并发请求重复安排 helper;helper 创建失败时保留旧进程,并记录失败日志。
  • 自动继续投递失败时保留恢复标记;Web 路由随 Cordis 生命周期正确释放。

源码部署排错

  • 本开发分支只对齐官方标签 dsh-v0.1.5-alpha.1。源码 checkout 先执行 corepack pnpm install --frozen-lockfile 和 corepack pnpm run build,再把本地插件 重新加入隔离 profile;只安装依赖但没有构建 workspace,会表现为缺少 @deepseek-ai/*/lib,并不是 restart 拉起失败。
  • 如果页面显示 list slot "settings.plugin.item" requires options.id,说明 Harness 与插件客户端落在不同的开发期 slot 契约。0.1.5-alpha.1 的官方契约是 keyed slot, 本插件必须使用 options.key;不要直接改成 id,应统一 Harness 标签、插件分支 和 profile 锁文件后重装。
  • pnpm 首次安装 profile 依赖时可能把原生包写成待决的 allowBuilds 项。逐项确认 true 或 false 后重跑 dsh plugin --profile <name> add ...,不要用全局放行绕过。
  • 若旧版本重启后已经停在浏览器 HTTP 错误页,请手工打开新进程日志打印的当前 dsh web: URL 完成一次恢复;升级到本版本后,设置卡片会等待首页真正就绪再刷新。

安装

  1. 把包加入 profile 依赖并挂进 bundle:
// profiles/<profile>/package.json
{
  "dependencies": { "dsh-restart": "..." },
  "dsh": { "profile": { "bundles": ["...", "dsh-restart"] } }
}
  1. 重启 DSH(/restart 或 restart_harness),刷新页面后即可看到卡片;之后通过卡片重启时会自动等待并恢复页面。

构建

pnpm install
node scripts/link-dsh-workspace.mjs --source <path-to-deepseek-harness>
pnpm run build

host 半由 tsc 输出到 lib/index.js(@deepseek-ai/* 保持外部依赖);client 半由 tsdown 打成单文件 lib/client.js。

← 上一个 Prev dsh-literature 下一个 Next ybkk-AIOS →