插件目录 / UI & Skins / dsh-kill-restart
dsh-kill-restart
已验证 · 实测可装 mozhi5795
功能简介
One-click kill button for the DSH Web GUI – kill the server process without taskkill
可用 — 实测通过,早期项目
One-click kill button for the DSH Web GUI – kill the server process without taskkill 实测能干净安装、正常启动。早期项目,但功能可用。
「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。
README
dsh-kill-restart ☠
DSH Web GUI 的一键杀死按钮。
无需 taskkill 或翻找 PID,一键终止 DSH 服务器进程,方便重启。
工作原理
- 一个 ☠ 骷髅按钮出现在 DSH Web GUI 右下角。
- 点击 → 确认弹窗。
- 浏览器发送
POST /api/kill-dsh。 - 服务器先响应
{ "ok": true },等 200 毫秒让浏览器收到确认,然后调用process.exit(0)。 - 页面显示"DSH 服务器进程已终止 — 请重启 DSH"。
安装
从 npm 安装(推荐)
dsh plugin --profile web add dsh-kill-restart
从 GitHub 安装
dsh plugin --profile web add github:mozhi5795/dsh-kill-restart
注意:Git 安装拉取的是源码而非构建产物。你必须:
- 使用包含预构建
lib/文件的 tag,或- 在 profile 的
pnpm-workspace.yaml中允许prepare脚本:allowBuilds: dsh-kill-restart: true
从本地目录安装
# 在包含 dsh-kill-restart 的目录中执行
dsh plugin --profile web add ./dsh-kill-restart
使用
- 启动包含此组合包的 DSH profile。
- 打开 Web GUI(默认
http://127.0.0.1:3080)。 - 点击右下角的 ☠ 按钮。
- 确认弹窗。
- 服务器退出,手动重启 DSH。
项目结构
dsh-kill-restart/
├── package.json # 组合包清单(dsh.bundle + dsh.client)
├── cordis.patch.yml # Cordis 补丁层 — 插入插件行
├── README.md # 本文件
├── .gitignore
└── lib/
├── index.js # 服务端 — POST /api/kill-dsh 路由
└── client.js # 客户端 — ☠ 按钮 UI
架构
这是一个 DSH 组合包(bundle) — 一个可安装的 npm 包,附带配置层。
| 概念 | 文件 | 作用 |
|---|---|---|
| 组合包清单 | package.json |
声明 dsh.bundle.patch(补丁文件)和 dsh.client(客户端模块注入) |
| 补丁层 | cordis.patch.yml |
当 profile 列出此组合包时被插入;添加 kill-dsh-restart 插件行 |
| 服务端插件 | lib/index.js |
注入 webServer,注册 POST /api/kill-dsh,响应后调用 process.exit(0) |
| 客户端插件 | lib/client.js |
通过 exports["./client"] 注入浏览器;添加浮动 ☠ 按钮及点击处理器 |
加载顺序
根据 DSH 插件开发文档,
生效配置在空根之上按以下顺序逐层组合:
- profile 的
bundles列表中的各组合包补丁(按列表顺序) - profile 自己的
cordis.patch.yml - home 级
$DSH_HOME/cordis.patch.yml - 每个
--patch <路径>覆盖层
此组合包的补丁(cordis.patch.yml)在 profile 列出 dsh-kill-restart 时,于第 1 步被应用。
发布到 npm
此包已准备好发布到 npm:
npm login
npm publish
发布后,用户通过以下命令安装:
dsh plugin --profile web add dsh-kill-restart
开发
这是一个纯 JavaScript(ESM)插件 — 无需构建步骤。
直接在 lib/ 中编辑文件,然后用 --patch 覆盖层或 dsh plugin add ./dsh-kill-restart 本地测试。
许可证
MIT
安装
装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:
dsh plugin add dshbase-catalog 然后对 agent 说「帮我装 dsh-kill-restart」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。
该插件是 GitHub 源码(未发 npm)——直接从仓库装:
Web profile:
dsh plugin --profile web add github:mozhi5795/dsh-kill-restart Headless(CLI)profile:
dsh plugin --profile headless add github:mozhi5795/dsh-kill-restart 实测报告
验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。