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 和評分是快照中的導航訊號。

安裝與排錯 · 專案問題反饋

同類專案