@xiaoyuyu6420/dsh-backup 0.9.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -1
- package/README.zh.md +20 -1
- package/lib/client.js +39 -17
- package/lib/index.js +473 -91
- package/package.json +2 -1
- package/rescue/rescue.mjs +54 -14
package/README.md
CHANGED
|
@@ -53,7 +53,11 @@ dsh plugin --profile web add @xiaoyuyu6420/dsh-backup
|
|
|
53
53
|
dsh plugin --profile web add github:xiaoyuyu6420/dsh-backup
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
Restart `dsh web` afterwards.
|
|
56
|
+
Restart `dsh web` afterwards — the plugin only takes effect after a restart.
|
|
57
|
+
|
|
58
|
+
> The installer may print `✕ missing peer @deepseek-ai/...` warnings. These are
|
|
59
|
+
> expected: the peer packages are provided by the DSH host at runtime. As long
|
|
60
|
+
> as the command ends with `Done`, the plugin is installed.
|
|
57
61
|
|
|
58
62
|
## Quickstart
|
|
59
63
|
|
|
@@ -68,15 +72,27 @@ Want it on a schedule? `/backup auto 12` (every 12 hours; `off` stops it, `statu
|
|
|
68
72
|
| Task | Command |
|
|
69
73
|
|---|---|
|
|
70
74
|
| Back up now | `/backup` |
|
|
75
|
+
| Typed backup (selected types only) | `/backup --types skills,sessions` (types: `credentials`·`mcp`·`skills`·`sessions`·`settings`·`profiles`; `--only` works too) |
|
|
71
76
|
| Schedule (survives restarts) | `/backup auto 12` · `off` · `status` |
|
|
72
77
|
| Restore (preview first) | `/backup restore latest --dry-run` |
|
|
73
78
|
| Restore for real | `/backup restore latest` |
|
|
79
|
+
| Typed restore (merge, other types untouched) | `/backup restore <archive> --types skills` |
|
|
74
80
|
| List backups | `/backup list` |
|
|
75
81
|
| Verify integrity | `/backup verify [prefix\|all]` |
|
|
76
82
|
| Check & repair session logs | `/backup doctor` · `--repair [prefix\|latest]` |
|
|
77
83
|
| **Rescue when DSH won't boot** | double-click「点我恢复」in the backup dir, or `dsh-rescue` / `node rescue.mjs` |
|
|
78
84
|
| Delete / retention | `/backup delete <prefix\|latest>` · `/backup --keep N` (default 7) |
|
|
79
85
|
|
|
86
|
+
## Typed backup
|
|
87
|
+
|
|
88
|
+
Only need certain kinds of data? Use `--types` (or `--only`) to operate on a subset. Available types: `credentials` (API keys), `mcp` (MCP config), `skills`, `sessions`, `settings`, `profiles`.
|
|
89
|
+
|
|
90
|
+
- **Back up**: `/backup --types skills,sessions` creates a `dsh-t-` subset archive; rotation is tracked separately from full backups
|
|
91
|
+
- **Restore**: `/backup restore <archive> --types skills` merges only skills back into your existing `~/.dsh` (preview with `--dry-run`; overwritten files are kept aside as `.pre-merge-*`). Everything else stays untouched.
|
|
92
|
+
- **Credentials caveat**: `--types credentials` puts API keys into the archive **in plaintext** (full backups redact them). Such archives never go to GitHub sync — keep them local or copy them to a new machine yourself.
|
|
93
|
+
- **Guardrail**: restoring a typed archive without `--types` is rejected (prevents accidental data loss); the rescue channel likewise won't list or fully restore them.
|
|
94
|
+
- The Settings panel supports this too: check types under the backup button; typed archives get their own section.
|
|
95
|
+
|
|
80
96
|
## New machine
|
|
81
97
|
|
|
82
98
|
Prerequisite: GitHub sync was configured on the old one ([setup](docs/advanced.zh.md#github-同步可选), Chinese).
|
|
@@ -115,6 +131,9 @@ Tried it? Tell us what broke, what's missing, what you liked — it directly sha
|
|
|
115
131
|
<details>
|
|
116
132
|
<summary>Recent releases</summary>
|
|
117
133
|
|
|
134
|
+
- **0.11.0** — doctor container-contract check: the first zstd frame must decode to exactly one header line, byte-precise (non-empty, first newline at the last byte — aligned with the host reader). Single-frame rewrites, stray blank lines in the first frame, a missing trailing newline and skippable frames are now flagged corrupt (previously reported healthy while the host refused to load them); the rescue console checks in sync. Found via a community audit on deepseek-harness #1047.
|
|
135
|
+
- **0.10.0** — typed backups: back up just what you need (`/backup --types skills,sessions`) and merge-restore a subset (`/backup restore <archive> --types skills`); per-type archives rotate in their own bucket. Credential-type archives stay out of GitHub sync; cross-machine guardrails unchanged.
|
|
136
|
+
- **0.9.1** — feedback entry point in the panel; README overhaul. UX hardening from a six-agent review: restore-confirm button made visible again (missing theme fallback), snapshot self-deletion during snapshot-restore fixed, node discovery for the double-click rescue launcher, friendlier error messages with concrete next steps.
|
|
118
137
|
- **0.9.0** — `/backup doctor` session-log health check with targeted repair; out-of-process rescue channel (`dsh-rescue` / launcher in the backup dir) that works even when the host won't boot; restore auto-rollback with a result-oriented receipt; smart backup: pre-upgrade snapshots on host train changes, quarantine of corrupt session logs before they rotate away, tiered daily/weekly retention.
|
|
119
138
|
- **0.8.0** — edit backup settings right in the panel (destination, retention, exclude patterns), saved instantly to `settings.yaml`, no restart; stale edits get a conflict warning instead of silent overwrite.
|
|
120
139
|
- **0.7.x** — credential redaction with a local vault; cross-machine restore.
|
package/README.zh.md
CHANGED
|
@@ -53,7 +53,11 @@ dsh plugin --profile web add @xiaoyuyu6420/dsh-backup
|
|
|
53
53
|
dsh plugin --profile web add github:xiaoyuyu6420/dsh-backup
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
装完重启 `dsh web
|
|
56
|
+
装完重启 `dsh web` 后插件才生效。
|
|
57
|
+
|
|
58
|
+
> 安装时可能刷出 `✕ missing peer @deepseek-ai/...` 警告,属预期现象:这些
|
|
59
|
+
> peer 包由 DSH 宿主在运行时提供,不装在 profile 目录里。只要命令以
|
|
60
|
+
> `Done` 结尾就是装成功了。
|
|
57
61
|
|
|
58
62
|
## 快速上手
|
|
59
63
|
|
|
@@ -68,15 +72,27 @@ dsh plugin --profile web add github:xiaoyuyu6420/dsh-backup
|
|
|
68
72
|
| 场景 | 命令 |
|
|
69
73
|
|---|---|
|
|
70
74
|
| 立即备份 | `/backup` |
|
|
75
|
+
| 分类型备份(只备份选中类型) | `/backup --types skills,sessions`(可选:`credentials`·`mcp`·`skills`·`sessions`·`settings`·`profiles`;`--only` 同义) |
|
|
71
76
|
| 定时备份(重启不中断) | `/backup auto 12` · `off` · `status` |
|
|
72
77
|
| 恢复(先预览) | `/backup restore latest --dry-run` |
|
|
73
78
|
| 正式恢复 | `/backup restore latest` |
|
|
79
|
+
| 分类型恢复(merge,不动其他类型) | `/backup restore <归档> --types skills` |
|
|
74
80
|
| 列出备份 | `/backup list` |
|
|
75
81
|
| 校验完整性 | `/backup verify [前缀\|all]` |
|
|
76
82
|
| 会话日志体检/修复 | `/backup doctor` · `--repair [前缀\|latest]` |
|
|
77
83
|
| **DSH 起不来时自救** | 双击备份目录里的「点我恢复」,或 `dsh-rescue` / `node rescue.mjs` |
|
|
78
84
|
| 删除 / 保留策略 | `/backup delete <前缀\|latest>` · `/backup --keep N`(默认 7) |
|
|
79
85
|
|
|
86
|
+
## 分类型备份
|
|
87
|
+
|
|
88
|
+
只想备份/恢复某几类数据?`--types`(或 `--only`)按内容类型子集操作,可选类型:`credentials`(凭据/api key)、`mcp`(MCP 配置)、`skills`(技能)、`sessions`(会话)、`settings`(设置)、`profiles`(插件 profiles)。
|
|
89
|
+
|
|
90
|
+
- **备份**:`/backup --types skills,sessions` 生成 `dsh-t-` 前缀的子集归档,与全量备份分开轮换、互不挤占保留份数
|
|
91
|
+
- **恢复**:`/backup restore <归档名> --types skills` 只把 skills 合并回现有 `~/.dsh`(先 `--dry-run` 预览;覆盖的现有文件自动留档 `.pre-merge-*`),其他类型完全不碰
|
|
92
|
+
- **凭据类型特殊**:`--types credentials` 会把 api key **明文**打进归档(默认全量备份是脱敏的)——这类归档绝不进 GitHub 同步,仅建议本机保存或手动拷到新机
|
|
93
|
+
- **安全护栏**:分类型归档不带 `--types` 直接整包恢复会被拒绝(防止误覆盖丢数据);rescue 救援通道同样不列、不整包恢复它们
|
|
94
|
+
- 面板(Settings → 插件 → 备份)同样支持:备份按钮下方勾选类型;分类型归档在独立分区展示与恢复
|
|
95
|
+
|
|
80
96
|
## 换新电脑
|
|
81
97
|
|
|
82
98
|
前提:旧电脑配过 GitHub 同步([配置方法](docs/advanced.zh.md#github-同步可选))。
|
|
@@ -115,6 +131,9 @@ dsh plugin --profile web add github:xiaoyuyu6420/dsh-backup
|
|
|
115
131
|
<details>
|
|
116
132
|
<summary>最近的版本</summary>
|
|
117
133
|
|
|
134
|
+
- **0.11.0** —— doctor 容器契约校验:首帧必须解出「恰好一行 header、单个换行结尾」(字节精确,对齐宿主读端)。单帧重写、首帧多余空行、缺行尾、skippable 帧现在都会判损坏(此前报健康但宿主拒载);救援台同步。来自 deepseek-harness 官方讨论区 #1047 的社区审计。
|
|
135
|
+
- **0.10.0** —— 分类型备份:只备份需要的部分(`/backup --types skills,sessions`),按类型 merge 恢复(`/backup restore <归档> --types skills`);类型归档独立轮换不挤全量配额。含凭据的类型归档永不进 GitHub 同步,跨机护栏不变。
|
|
136
|
+
- **0.9.1** —— 面板新增反馈入口;README 重做。六路 agent UX 深审后的加固:恢复确认按钮补主题色兜底重新可见、修复恢复快照时自毁目标快照的 bug、双击救援启动器自动探测 node、报错文案全面改为"人话 + 下一步"。
|
|
118
137
|
- **0.9.0** —— `/backup doctor` 会话日志体检与定点修复;宿主起不来也能用的进程外救援通道(备份目录里的 dsh-rescue / 双击启动器);恢复失败自动回滚与结果导向回执;智能备份:宿主升级前自动快照、损坏会话先隔离再入档、每日/每周分级保留。
|
|
119
138
|
- **0.8.0** —— 面板里直接改备份设置(目录、保留份数、排除模式),立即生效写入 settings.yaml 不用重启;两处同时改有冲突提示,不会静默覆盖。
|
|
120
139
|
- **0.7.x** —— 凭据脱敏(本机 vault)、跨机恢复。
|