DeepSHPlugins
dsh-power 项目预览
GITHUB / COMMUNITY PROJECT

dsh-power

生态与开发JavaScriptMIT

DSH Web 悬浮电源坞:一键重启或优雅关机,仅限环回访问,零依赖。

2 Starsmangomt 更新时间 2026-08-20
访问 GitHub 仓库
dsh-power 项目预览

项目介绍

中文

DSH Web 悬浮电源坞:一键重启或优雅关机,仅限环回访问,零依赖。

English

Floating power dock for the DSH web GUI: one-click restart or graceful shutdown of the dsh host, loopback-guarded and dependency-free.

项目信息与收录信号

快照 2026-09-11
作者 / 组织
mangomt
仓库
mangomt/dsh-power
GitHub Stars
2
Forks
0
开发语言
JavaScript
许可证
MIT
最近推送
2026-08-20
Manifest
数据中检测到声明

公开仓库不自动等于可商用;许可证与当前兼容性以原项目文档为准。Manifest 和数据评分不构成安装安全认证。

数据评分

56/ 100
维护活跃
85
文档与实用信息
100
生态关注度
14
安装便捷信号
75
项目声明信号
85

近 22 天仍在更新;README 含完整安装与使用说明;关注度尚低(2)。

评分来自已有数据快照的五维模型,仅作浏览参考,不是实际使用评测或安全检测结论。

安装与使用

所有项目资料与许可均以对应 GitHub 仓库为准。

dsh plugin --profile web add github:mangomt/dsh-power

复制命令不会自动执行。请先阅读仓库文档,确认环境要求与许可证。

项目截图

仓库 README

GitHub 原文

已保存的仓库文档快照;文档抓取时间未记录,可能与上方目录介绍处于不同版本。安装前请核对当前仓库说明。

dsh-power

Floating power dock for the DeepSeek Harness web GUI: one-click restart or graceful shutdown of the dsh web host, right from the page — no terminal, no settings menu, no session-management baggage.

中文说明

Features

  • Floating power dock pinned to the window's bottom-right corner (shell overlay, theme-aware): a restart button stacked above the power button, sharing one visual language and one confirm-flow.
  • Click → confirm → act: each button opens the shared primitives Modal (取消 / 确认). Shutting down disposes the root fiber (session logs are flushed) and exits cleanly, with a hard-timer fallback. Restarting hands off to a detached helper that waits for the port to free, relaunches the *exact* dsh invocation (same argv, same cwd), verifies it binds, and logs a diagnosis under tmpdir when anything fails — then the page polls /dsh-power/health and reloads itself once the replacement host is back.
  • Same-origin loopback guard on every process-control route (identical discipline to dshmarket's trustedRestartRequest): loopback socket only, no forwarding headers, Origin must equal Host. A random website cannot restart or shut down your local dsh.
  • Zero runtime dependencies — the host half runs on node: built-ins; the client half only requires react and the host-injected ui-primitives.
  • Bilingual (简体中文 / English), following the DSH client locale conventions.

Requirements

  • DeepSeek Harness dsh ≥ 0.1.0-rc.6 (the web profile).
  • Node.js ≥ 20.

Install

dsh plugin --profile web add dsh-power

or from a local checkout:

dsh plugin --profile web add link:/path/to/dsh-power

Restart dsh web. The power dock appears at the bottom-right of the page.

Usage

  • Restart: click the ⟳ button, confirm, and wait — the dialog shows progress, and the page reloads itself when the service is back.
  • Shut down: click the ⏻ button, confirm. The service exits gracefully; start it again with dsh web (or your launcher).

How it works

The browser has no OS access, so it cannot kill a process directly. Instead the *server* acts on itself: the page POSTs to the loopback-guarded route, the host answers the request first (so the page can show the result), then teardown runs:

browser                      dsh host (Node)                        helper (detached)
  │  POST /dsh-power/restart       │                                     │
  ├───────────────────────────────>│  guard: loopback + same-origin       │
  │  200 {restarting: true}        │                                     │
  │<───────────────────────────────│                                     │
  │                                │ spawn -e helper, unref              │
  │                                │ wait restartDelayMs (response out)  │
  │                                │ dispose root fiber → flush logs     │
  │                                │ process.exit(0)  ✝                  │
  │  GET /dsh-power/health (poll)  │                                     │
  │  ×  connection refused         │                                     │
  │                                │               wait until port quiet │
  │                                │               spawn same dsh argv   │
  │                                │               confirm port bound    │
  │  ✓  health 200 → reload        │                                     │

Shutdown is the same without the helper: respond, delay, dispose the root fiber, exit.

Routes

MethodPathEffect
POST/dsh-power/restart{restarting: true} → detached relaunch + exit
POST/dsh-power/shutdown{shuttingDown: true} → graceful exit
GET/dsh-power/health{ok: true} (liveness probe the page polls)

Non-matching methods get 405; requests failing the loopback/same-origin guard get 403; a disabled restart also gets 403.

Configuration

Row config in cordis.patch.yml (defaults shown):

config:
  shutdownDelayMs: 1000   # shutdown: response → graceful self-exit
  restartDelayMs: 1000    # restart: response → helper handoff + self-exit
  allowRestart: true      # false under systemd/launchd/pm2 — the supervisor owns restarts

License

MIT

使用前核对

安装步骤、兼容版本与授权范围以原项目当前文档为准。Stars 和评分是快照中的导航信号。

安装与排错 · 项目问题反馈

同类项目