jcfung1122 / dsh-power

Listed

给 DeepSeek Harness Web 界面加一个电源按钮:一键关闭 DSH 或重启 Web UI。Power controls for the DeepSeek Harness Web GUI: shut down or restart DSH from the sidebar.

mainTool View source

Installation

npx -y @deepseek-ai/dsh plugin --profile web add github:jcfung1122/dsh-power

This installation command is an unverified starting point generated from the GitHub repository address.

README

Maintainer-authored documentation snapshot.

View on GitHub ↗
Commit 4ffa719Synced Aug 18, 2026

dsh-power

License DSH

English | 中文

DeepSeek Harness Web 界面加一个电源按钮:在侧边栏「设置」上方悬停,即可关闭 DSH重启 Web UI

特性

  • 🚫 绝不误关其他浏览器窗口 —— 页面通过 window.close() 自行关闭,宿主进程从不杀 Chrome。
  • 🧭 环境自适应 —— 无硬编码路径或端口。重启命令由当前进程重建,重开地址跟随实际监听端口。
  • 🌍 跨平台 —— Windows(无窗口 wscript 辅助进程)、macOS(open)、Linux(xdg-open)。
  • 零配置 —— 装完即可用。

快速安装

需要 DeepSeek Harness web profile(@deepseek-ai/dsh >= 0.1.0-rc.6)。

dsh plugin --profile web add "github:jcfung1122/dsh-power"

重启已经在跑的 dsh web,浏览器硬刷新,侧边栏「设置」上方就会出现电源图标。

卸载:

dsh plugin --profile web remove dsh-power

用法

悬停电源图标,选择:

电源按钮悬浮菜单

  • 关闭 DSH —— 只关闭本页面并优雅停止服务,其他浏览器窗口不受影响。
  • 重启 Web UI —— 重新拉起服务并自动重新打开页面。

每一项都先弹确认,确认后才执行。

配置

通常不需要任何配置。需要覆盖时写进 cordis.patch.yml

- id: power
  config:
    restartWaitMs: 7000     # 重新拉起前等待旧进程释放端口的时长(毫秒)
    restartCommand: ""      # supervisor 管理的部署可填完整重启命令
    reopenUrl: ""           # 覆盖自动推导的重开地址
默认值说明
restartWaitMs7000等待旧进程释放端口后再拉起。
restartCommand(自动)完整重启命令;默认从当前进程重建。
reopenUrl(自动)重开地址;默认 http://127.0.0.1:<端口>

工作原理

宿主半边注册两个仅限回环的 POST 接口:/api/power/shutdown/api/power/restartshutdown 请求启动器提供的 appExit 优雅退出;restart 先从 process.argv 重建启动命令、读 webServer.port 得到重开地址,再 detach 一个 跨平台辅助进程(Windows 用无窗口 VBS 脱离父进程 job,macOS/Linux 用 sh + open/xdg-open)后退出。浏览器收到确认后 window.close() 关闭本页。

隐私与安全

  • 两个接口都是 exact 路由,位于 RPC 信任边界之外,处理器自己设防:仅 POST、仅回环 peer 地址。
  • 不读取任何会话、提示词或模型数据。

开发

npm test           # 纯 JS,无构建步骤;浏览器半边也能在 Node 里物化和测试
npm pack --dry-run

浏览器半边没有构建步骤:它是一个手写的 __ModuleLoader__ bundle,React 由宿主作为 peer 提供。

License

MIT

Project files and signals

Shown items are public repository signals detected in the directory snapshot.

TestsDetected

Repository information

Language
JavaScript
License
MIT
Last updated
Aug 17, 2026, 2:01 PM

Install deliberately

Review source code, permissions, lifecycle hooks, dependencies and network access. Test untrusted plugins in an isolated environment.