dsh-self-update
为 Git 源码安装的 DeepSeek Harness 提供应用内自更新、回滚与重启,并可选配原生 macOS Shell。
shane-jay
@shane-jay
⬇ 2
★ 1
main
安装
dsh plugin --profile web add github:shane-jay/dsh-self-update
需要可复现安装时,可在仓库后追加 #commit 固定提交。
为 Git 源码安装的 DeepSeek Harness 提供应用内自更新、回滚与重启,并可选配原生 macOS Shell。
该插件未提供要点说明,请参考仓库 README。
deepseek-harnessdshdsh-pluginmacosself-update
- 安装并启动 DeepSeek Harness:
npx @deepseek-ai/dsh web - 在终端执行上面的安装命令(CLI 会解析插件并核验来源)
- 用 dsh plugins list 确认已安装,必要时重启 Harness 生效
插件以当前 dsh 进程的权限运行,安装时可能执行代码。请先通读仓库源码与许可证,确认无破坏性命令与越权访问;本站只做索引,不对第三方插件安全性作担保。
| 代码仓库 | github.com/shane-jay/dsh-self-update |
| 许可证 | MIT |
| 主要语言 | main |
| 下载量 | 2 |
| GitHub 星标 | 1 |
| 最近推送 | 2026-08-20 |
| 收录日期 | 2026-09-19 |
| 分类 | 开发与运行时 |
事实信息来自公开插件目录快照(2026-10-01),介绍文案由本站再加工。
以下为插件仓库 README 全文(原始内容,由公开目录抓取整理)。
# dsh-self-update
**English** | [简体中文](README.zh-CN.md)
In-app self-update for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) git-source installs — with an optional native macOS shell.
[](https://www.npmjs.com/package/dsh-self-update)
[](LICENSE)
[](https://www.npmjs.com/package/@deepseek-ai/dsh)
[图片: Update panel: current vs. new version, the three steps about to run, and a one-click Update button]
## What is this?
If you run DeepSeek Harness **from a git checkout** (`git clone` + `pnpm dsh web`) — the way most self-hosted setups do — there is no built-in way to update it. Every release means manually running `git pull`, `pnpm install`, `pnpm build`, then restarting the service, and if anything breaks you dig out the old commit by hand.
**dsh-self-update turns that whole cycle into a button.** It is a harness plugin that:
- **checks quietly in the background** (every 6 h by default) and on demand, from the settings page or the macOS menu bar;
- shows a **"new version" entry in the sidebar** when there is something to install — clicking it opens an update panel with a version comparison and exactly the three commands about to run;
- **installs in one click**: `git pull --ff-only` → `pnpm install` → `pnpm build`, with live per-step progress;
- **refuses to touch a dirty or diverged working tree** — it will never discard your local changes;
- **rolls back in one click** if a step fails (and ships a CLI fallback for when the UI itself is down);
- **restarts the service** through a simple contract: the process exits with **code 75**, and your supervisor — systemd, PM2, or the bundled macOS shell — brings it back up.
**Not for you if** you installed dsh via `npm i -g @deepseek-ai/dsh`: there is no git working copy to update, so this plugin hides itself entirely. Use an npm-based updater such as `dsh-update-checker` instead.
## Install (any platform)
```bash
cd
pnpm dsh plugin --profile web add dsh-self-update
```
Restart the dsh service once and you are done. No configuration needed — the plugin uses the process working directory as the harness checkout (override with the plugin config `repoRoot` if yours differs).
### Closing the restart loop
The **Restart now** button makes the process exit with **code 75** ("please restart me"). Teach your supervisor to honor it:
| Runner | Config |
|---|---|
| systemd | `RestartForceExitStatus=75` |
| PM2 | `autorestart: true` (the default) |
| macOS shell (below) | built in |
| bare terminal | just run `pnpm dsh web` again |
## macOS shell (optional)
A native Swift + WKWebView app (no Electron) that owns the dsh service: click the icon to open the UI, closing the window keeps the service running, ⌘Q stops it. It adds a **"Check for Updates…"** menu item that opens the in-app update panel, and it automatically relaunches the service when it exits with code 75.
```bash
node macapp/build-mac-app.mjs # requires Xcode command line tools
# outputs ~/Applications/DSH.app
```
First launch: right-click → Open (the app is ad-hoc signed, not notarized).
## How it compares
| | Updates | Platforms | Auto-restart |
|---|---|---|---|
| `dsh-update-checker` | npm packages | restart is Windows-only | ✅ (Win) |
| `dsh-update-copilot` | plugins; core is report-only | all | ❌ |
| **`dsh-self-update`** | **the harness git checkout itself** | **all (restart incl. macOS/Linux)** | **✅ (exit-code 75 contract)** |
The exit-code-75 restart contract is the piece the community has been asking the harness core for (see upstream discussions [#1231](https://github.com/deepseek-ai/deepseek-harness/discussions/1231) and [#2717](https://github.com/deepseek-ai/deepseek-harness/discussions/2717)) — this plugin is a working implementation of it.
## Interface contract
- **HTTP** — `/self-update/api/update/{status,check,install,rollback,restart}`. Write routes require `Content-Type: application/json` and a local `Origin` (CSRF line of defense).
- **Panel event** — dispatch `dsh-self-update:open` on `window` (`detail: { check: true }` to check immediately). This is exactly what the macOS menu item does via `evaluateJavaScript`.
- **Restart** — process exit code **75** means "restart requested". Anything else is a crash.
- **State** — persisted at `~/.dsh-self-update/update-state.json`.
## When the UI is gone
If an update leaves dsh unable to boot (plugin/core seam breakage), the Web UI — rollback button included — is gone with it. Fall back to the CLI:
```bash
node scripts/rollback-harness.mjs # target = previousSha from the state file
node scripts/rollback-harness.mjs --sha # or pick a commit yourself
```
The updater records `previousSha` before every install precisely for this moment.
## Development
Sibling layout, same as the rest of the dsh plugin ecosystem: this repo must be checked out **next to** `deepseek-harness` — the `@deepseek-ai/*` dev dependencies are `link:../deepseek-harness/...`.
```bash
pnpm install
pnpm typecheck && pnpm test && pnpm build
```
The updater test suite runs against real (offline) git repositories; only the install/build commands are stubbed.
## License
[MIT](LICENSE)
---
[](https://github.com/deepseek-ai/deepseek-harness)
数据来源:公开的 DeepSeek Harness 插件目录与各插件 GitHub 仓库。本站为独立第三方目录,与 DeepSeek、幻方(High-Flyer)及插件作者均无隶属或背书关系。