dsh-plugin-guard
DeepSeek Harness 插件安装安全网,提供安装前自动快照、一键或自动回退、守护启动以及事故报告自动触发 Agent 分析等功能。
AI 分析
核心用途是保障 DSH 插件生态的安装与运行安全。适合经常尝试新插件、担心系统崩溃的用户。强烈推荐启用其提供的守护启动脚本以获得最佳防护。
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:lxzy-7/dsh-plugin-guard说明文档
阅读完整 README ↗Usage
Settings panel — 备份管理 (Backup Manager). In the web UI, open 设置 (Settings) → 备份管理: per-environment snapshot lists, load a specific backup, create a manual snapshot, and set how many snapshots each environment keeps (minimum 2).
Agent tools (registered for every session in the profile):
| Tool | Purpose |
|---|---|
dsh_snapshot | Manually snapshot one profile or all profiles |
dsh_rollback | list / rollback / status / incident (Node-based, cross-platform) |
incident_resolved | Mark a pending incident as resolved after analysis/fix |
CLI (dsh-guard, usable even when the app will not start):
snapshot [--profile X] [--tag T] [--reason R] [--force]
list [--profile X]
rollback [--profile X] [--id I | --good] [--skip-install]
keep [N] # show or set the per-profile cap (min 2)
health [--port N]
incident [--kind K] [--no-marker]
resolve
profiles
Configuration
$DSH_HOME/guard/config.json (auto-created on first write; all optional):
{
"keepSnapshots": 10,
"port": 3080
}
keepSnapshots— how many snapshots each profile retains (clamped to 2–100, default 10). Pruning removes older ones.port— web port used by health checks / incident reports (default 3080). Set it if yourdsh webruns on another port. You can also pass--portto the CLI.
Every path is anchored at $DSH_HOME (defaults to ~/.dsh when the env var is unset):
$DSH_HOME/rollbacks/
// snapshots (4 config files + manifest.json)
$DSH_HOME/guard/logs/ boot/server logs, incident reports, last-boot.txt
$DSH_HOME/guard/pending-incident.json pending incident marker
$DSH_HOME/guard/config.json guard settings (keepSnapshots, port)
使用
设置面板 — 备份管理。 网页界面里打开 设置 → 备份管理:按环境列出快照、加载指定备份、手动存档、设置每个环境保留的快照数量(最少 2)。
Agent 工具(profile 内每个会话都会注册):
| 工具 | 作用 |
|---|---|
dsh_snapshot | 手动快照一个或全部环境 |
dsh_rollback | list / rollback / status / incident(跨平台 Node 实现) |
incident_resolved | 分析并修复后标记事故已处理 |
CLI(dsh-guard,应用起不来时也能用):
snapshot [--profile X] [--tag T] [--reason R] [--force]
list [--profile X]
rollback [--profile X] [--id I | --good] [--skip-install]
keep [N] # 查看或设置保留快照数(最少 2)
health [--port N]
incident [--kind K] [--no-marker]
resolve
profiles
配置
$DSH_HOME/guard/config.json(首次写入时自动创建;全部可选):
{
"keepSnapshots": 10,
"port": 3080
}
keepSnapshots— 每个环境保留多少份快照(钳制 2–100,默认 10),超出的旧快照会被清理。port— 健康检查/事故报告用的 web 端口(默认 3080)。如果你的dsh web跑在其他端口,改成实际值即可;CLI 也可用--port覆盖。
所有路径都锚定 $DSH_HOME(未设置时默认 ~/.dsh):
$DSH_HOME/rollbacks/
// 快照(4 个配置文件 + manifest.json)
$DSH_HOME/guard/logs/ 启动/服务器日志、事故报告、last-boot.txt
$DSH_HOME/guard/pending-incident.json 待处理事故标记
$DSH_HOME/guard/config.json 备份设置(keepSnapshots, port)