deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:Xiaojing-511/dsh-web-restart
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
为 DeepSeek Harness(DSH)Web GUI 提供一键重启服务的能力,由两个插件组成:
| 包 | 角色 | 作用 |
|---|---|---|
dsh-web-restart |
host 插件 | 注册 POST /api/dsh-restart,以 detached 方式执行 ~/.dsh/restart-dsh-web.sh 重启 GUI 进程(仅接受本机回环请求) |
dsh-web-restart-client |
client 插件 | 在浏览器注入一个可拖拽的「重启服务」悬浮按钮;拖拽位置自动记忆(localStorage) |
POST /api/dsh-restart 仅接受 127.0.0.1 / ::1 回环请求,非本机返回 403;单实例保护,同一时间只允许一次重启dsh.bundle.patch(cordis.patch.yml)自动挂载客户端插件,无需手动改 cordis 配置500),避免静默失败浏览器(DSH Web GUI)
└─ dsh-web-restart-client ── 悬浮按钮(可拖拽)
│ 点击 → POST /api/dsh-restart
▼
dsh-web-restart (host, 注入 webServer)
│ spawn("bash", ["~/.dsh/restart-dsh-web.sh"], { detached: true })
▼
~/.dsh/restart-dsh-web.sh
│ 杀旧进程(端口 3080) → 以原方式拉起 `dsh web` → 健康检查(≤90s)
▼
DSH Web 重启完成 → 浏览器刷新页面即可
仓库已打 dsh-plugin topic,被 DSH 插件市场 自动收录后,在 Web GUI 设置 → DSH插件市场 搜索 dsh-web-restart 一键安装。
也可用 dsh CLI 直接安装:
dsh plugin --profile web install Xiaojing-511/dsh-web-restart
git clone https://github.com/Xiaojing-511/dsh-web-restart.git /tmp/dsh-web-restart
cd ~/.dsh/profiles/web # 换成你要挂载的 profile
npm i /tmp/dsh-web-restart/dsh-web-restart
然后把 dsh-web-restart 加入 profile 的 bundles(~/.dsh/profiles/web/package.json):
{
"dependencies": {
"dsh-web-restart": "file:/tmp/dsh-web-restart/dsh-web-restart"
},
"dsh": {
"profile": {
"bundles": [
"@deepseek-ai/dsh-base",
"@deepseek-ai/dsh-web-app",
"dsh-web-restart" // ← 加入
]
}
}
}
重启 DSH Web 后生效。host 包会自动把客户端插件(dsh-web-restart-client)一并挂载。
前提:需要
~/.dsh/restart-dsh-web.sh存在(见下方「重启脚本」),否则接口返回 500。
cd ~/.dsh/profiles/web
npm i /tmp/dsh-web-restart/dsh-web-restart-client
并在 bundles 中加入 dsh-web-restart-client。此时需要你自己提供一个 POST /api/dsh-restart 接口。
host 插件依赖 ~/.dsh/restart-dsh-web.sh。仓库提供了通用模板:
cp scripts/restart-dsh-web.sh.example ~/.dsh/restart-dsh-web.sh
# 然后编辑脚本,把 NODE / DSH_BIN / PORT 改成你机器上的实际值
chmod +x ~/.dsh/restart-dsh-web.sh
脚本职责:杀掉占用端口的旧进程 → 以与原进程等价的方式重新启动 dsh web → 健康检查(最多 90 秒)→ 日志写入 ~/.dsh/web-restart.log。
http://127.0.0.1:3080),左下角出现「重启服务」按钮(默认位置,可拖走)POST /api/dsh-restart,页面显示「已触发,即将断开…」→「请刷新页面」~/.dsh/sessions,刷新后可在历史中恢复POST /api/dsh-restart(仅本机回环可访问)
| 状态码 | 含义 |
|---|---|
200 |
已触发重启({ ok: true, message, script }) |
403 |
非本机回环请求 |
405 |
非 POST 方法 |
409 |
已有一次重启在进行中 |
500 |
重启脚本缺失或 spawn 失败({ error }) |
cloud: false)。插件纯本地运行,不向任何外部服务器发送数据127.0.0.1 / ::1),无出站连接~/.dsh/restart-dsh-web.sh(不存在时返回 500);重启脚本按你的配置写日志localStoragepackage.json → disclosure(DISCLOSURE v0.2 契约)# 客户端插件
cd dsh-web-restart-client && npm i
# host 插件(依赖客户端,file: 方式本地关联)
cd dsh-web-restart && npm i
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。