huasheng33991/dsh-power-button

DeepSeek Harness的一键启动/停止(重启)按钮,固定在窗口右下角。/ DSH 一键启停按钮。

Project Overview项目介绍

huasheng33991/dsh-power-button is a native plugin built exclusively for DeepSeek Harness (DSH). It adds a floating one-click restart and stop power button pinned to the bottom-right corner of the DSH window. Clicking the main button triggers a full restart of DSH, which automatically terminates the old running process, spawns a new one, and reconnects the frontend page. Hovering over the main button reveals a smaller secondary button that only stops DSH without automatically restarting it, and the button includes a color-coded status indicator.

The plugin exposes three HTTP routes for its core functionality. The /dsh-power/health GET route returns a simple { ok: true } response for health checks. The /dsh-power/restart POST route triggers the full restart workflow, and the /dsh-power/stop POST route triggers a stop-only action. For security, the restart endpoint only accepts same-origin requests from localhost, and any requests from proxies or forged origins are rejected with a 403 error.

To install the plugin, you first copy the repository into your DSH user-level plugins directory at ~/.dsh/plugins/, then add it as a file dependency to your web profile. Next, add the plugin name to the dsh.profile.bundles array in your profile's package.json. After completing these steps, restart the DSH web process and refresh the page to see the button. To uninstall, you just remove the dependency and delete the plugin entry from the dsh.profile.bundles array.

这是一款专为DeepSeek Harness开发的原生插件,会在DSH窗口右下角固定一个悬浮的一键启停电源按钮。点击主按钮即可一键重启DeepSeek Harness,自动停止旧进程、拉起新进程并重连页面;悬停主按钮会出现次级小按钮,点击可仅停止进程不自动重启。按钮自带状态指示:绿色代表运行中,红色代表离线,琥珀色脉冲代表正在重启中。

插件提供三个HTTP路由接口,分别是健康检查、重启和停止接口。为了保障安全,重启接口仅接受本机同源请求,拒绝任何代理转发,伪造来源的请求会直接返回403错误。重启机制会通过一个分离的node帮助进程等待端口释放,再按照原入口、参数、环境变量和工作目录完全重新拉起DSH,随后旧进程收到SIGTERM信号优雅退出。

安装需要先将本包放入DSH用户级插件目录,接着在profile层添加依赖,最后在profile的package.json中dsh.profile.bundles列表追加本插件名称,重启DSH web后刷新页面即可看到右下角的按钮。卸载需要移除依赖并从bundles列表中删除项目,整个流程不需要手动修改cordis.patch.yml,避免出现重复加载错误。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 2 warnings2 项注意
  • No license declared - all rights reserved by default; ask the author before commercial use or redistribution未声明开源许可证 —— 默认「保留所有权利」,商用或再分发前先问作者
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
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:huasheng33991/dsh-power-button

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

READMEREADME

dsh-power-button

DeepSeek Harness 一键启停按钮 —— 固定在窗口右下角的悬浮电源键。

单击主按钮即可重启 DeepSeek Harness(停旧启新,自动拉起新进程并重连页面);悬停出现的小按钮可仅停止(不自动重启)。

  • 状态点:绿 = 运行中 / 红 = 离线 / 琥珀脉冲 = 重启中
  • 重启接口仅接受本机同源请求(拒绝代理转发),伪造来源一律 403
  • 持久化安装:本体放 ~/.dsh/plugins/dsh-power-button/,通过 profile package.json 的 dsh.profile.bundles 自动加载,重启后依然存在

路由

路由 方法 说明
/dsh-power/health GET 健康检查 { ok: true }
/dsh-power/restart POST 一键启停:detached helper 等端口释放后按原入口/参数/环境/cwd 重启
/dsh-power/stop POST 仅停止,不自动重启

安装(profile 层)

# 1. 把本包放入 DSH 用户级插件目录
mkdir -p ~/.dsh/plugins
cp -r dsh-power-button ~/.dsh/plugins/

# 2. 加入 profile 依赖并安装
cd ~/.dsh/profiles/web
pnpm add file:~/.dsh/plugins/dsh-power-button

# 3. 在 package.json 的 dsh.profile.bundles 列表追加 "dsh-power-button"
#    (注意:不要再在 cordis.patch.yml 手动 insert,避免 duplicate loader entry id)

# 4. 重启 dsh web 后刷新页面即可看到右下角按钮

卸载

cd ~/.dsh/profiles/web
pnpm remove dsh-power-button
# 并从 package.json 的 dsh.profile.bundles 移除 "dsh-power-button"

技术说明

重启机制:POST /dsh-power/restart 会派发一个 detached node helper,helper 等待 HTTP 端口释放后,用 process.execPath + execArgv + 原始 argv + cwd + 环境变量 重新拉起完全相同的 dsh 启动命令,随后旧进程收到 SIGTERM 优雅退出。新进程脱离原终端独立运行。

踩坑记录:helper 代码中 }) 换行后紧跟 (async 必须加前导分号(;(async),否则 ASI 会把 IIFE 吞进上一条语句,helper 静默不执行导致自启失败。

← 上一个 Prev dsh-unidoc 下一个 Next dsh-eyecare →