@xiaoyuyu6420/dsh-backup 0.13.2 → 0.13.4
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.en.md +4 -1
- package/README.md +4 -1
- package/lib/client.js +5 -5
- package/lib/index.js +240 -67
- package/package.json +14 -2
- package/rescue/rescue.mjs +38 -10
package/README.en.md
CHANGED
|
@@ -48,7 +48,7 @@ Prefer clicking? There's a visual panel in `dsh web` → Settings → Plugins
|
|
|
48
48
|
|
|
49
49
|
## Install
|
|
50
50
|
|
|
51
|
-
Requires macOS / Linux / Windows 10+ (ships `tar`) and DSH `0.1.1-rc.2`+ (the 0.1.1 / 0.1.2 / 0.1.5 / 0.1.6 / 0.1.7 trains are all tested; the 0.2.0 train is
|
|
51
|
+
Requires macOS / Linux / Windows 10+ (ships `tar`) and DSH `0.1.1-rc.2`+ (the 0.1.1 / 0.1.2 / 0.1.5 / 0.1.6 / 0.1.7 trains are all tested; the 0.2.0 train is supported since 0.13.2 — see the [compatibility matrix](docs/compatibility.md) for the current status).
|
|
52
52
|
|
|
53
53
|
```sh
|
|
54
54
|
dsh plugin --profile web add @xiaoyuyu6420/dsh-backup
|
|
@@ -138,6 +138,9 @@ Tried it? Tell us what broke, what's missing, what you liked — it directly sha
|
|
|
138
138
|
<details>
|
|
139
139
|
<summary>Recent releases</summary>
|
|
140
140
|
|
|
141
|
+
- **0.13.4** — Metadata-only release (**no code or behavior change**): the npm description and keywords now carry the terms people actually search for — migration, moving to a new machine, plugins, MCP, skills, sessions, workspace — so dsh-backup shows up for "upgrade went wrong" and "moving my DSH setup" queries. Features, archive format, settings and RPC are identical to 0.13.3; staying on 0.13.3 behaves exactly the same.
|
|
142
|
+
- **0.13.3** — Three fixes from real user reports plus two self-found defects, all re-verified on four host trains (0.1.5-rc.3 / 0.1.7-rc.2 / 0.2.0-rc.2 / 0.2.1-alpha.1) with e2e 41/41 each: ① **archives containing attachments could not be restored at all** (#112, @zevs281): DSH's attachment store uses hard links (tar typeflag `h`) while the restore validator only allowed `-`/`d` — full restore, dry-run, typed merge and doctor repair all refused on 0.13.2 and earlier. Hard links are now allowed when both the entry and its target stay inside the backup root (symlinks/devices still rejected). ② **large archives were falsely rejected on restore** (#119, @Yoshino-JF): when the `tar -tvzf` listing exceeds the host subprocess spill cap the host discards the spill file and only the last 8 KB remain; the validator then treats a mid-filename fragment as an unsafe entry and refuses the whole archive (backup succeeds, verify passes, only restore fails). The listing is now consumed as a raw stream line by line (no cap; terminate on the first violation). ③ **doctor/migrate were blind to v4 session logs** (#117, @xiuwufangoc-design): the host moved to format v4 (`session.v4.jsonl.zstd`) in 0.1.7 while filenames and the calibrated generation were hardcoded to generation 0/v3 — scans found nothing. Filenames are now matched by the host's own pattern, the calibrated generation moved to v4, and newer generations only warn. ④ **one-click update could not cross minors** (#115): pnpm `update` only upgrades within the declared range and the receipt claimed success regardless — now `update --latest`, with the actually-installed version read back and verified. ⑤ **migration precheck false alarms** (#113, @zevs281): unknown `source.kind` values are hints now instead of "will not open" verdicts, and the known set is aligned with the host's authoritative tables.
|
|
143
|
+
- **0.13.2** — dsh **0.2.0 train** adaptation: peers/engines gain `^0.2.0-rc.1` (the host rejects incompatible peers at install time since 0.1.7-rc.1); **settings form fixed for 0.1.7+** (the host derives forms from the entry's Config schema and only honors `volatile` fields — the plugin exports `Config` with per-field `.volatile()`); Windows scheduler boot hang fixed (#103: streaming hash + boot grace + persisted attempt anchor); review P2 debt cleared and an in-product Star entry.
|
|
141
144
|
- **0.13.1** — Two panel fixes, both from user reports: ① **the panel tab silently disappears on host 0.1.6+** (#94, @jackovibe): since 0.1.6 the host requires a `create()` lazy factory on strict codecs in client Remote contributions (older hosts only read `schema`); without it `$mount` throws during validation with only a console log, so the tab is never registered. Fix: `strictCodec()` now provides both `schema` and `create()` sharing one zod instance; `$mount` waits declaratively for the `remote` service (0.1.6 settles client modules by dependency graph); and a new `BackupTabFallback` **degraded tab** shows a visible hint plus command pointers if the mount ever fails — no more silent disappearance. peers/engines gain `^0.1.6-alpha.1 || ^0.1.7-alpha.1` (verified on real hosts 0.1.6-alpha.2 / 0.1.7-alpha.2 / 0.1.7-rc.1 / 0.1.7-rc.2). ② **the "GitHub Token" save button errored** (#97, @CheeseTJ): the client `panel` proxy never re-exported `setGithubToken` (that RPC landed in the host half in 0.12.0 and the omission lay dormant while no UI called it). Fix: wire it up, plus a new smoke-client assertion that the panel surface must mirror the contribution descriptors one-for-one.
|
|
142
145
|
- **0.13.0** — Update awareness + one-command self-update: ① `/backup check-update` and a new "Plugin updates" card in the panel — checks the npm registry for a newer version (8s timeout, degrades silently offline, never blocks the plugin); when a newer version exists an "Update to x.y.z" button appears; the `updateCheck` setting (default off) silently checks on panel open. ② `/backup update [--profile <name>]` — takes a `dsh-pre-upgrade-` snapshot automatically before updating (roll back with `/backup restore`), then runs the official `dsh plugin --profile <name> update` (pnpm semantics; the plugin never rewrites its own dependency files), and tells you to restart dsh web afterwards. Note: the host settles the plugin Loader tree at startup and plugins are pnpm dependencies of the profile, so true hot-swap (no restart) is not possible in the current host architecture — one-command update + restart is the best form it can take.
|
|
143
146
|
- **0.12.2** — Fix a Windows data-safety hazard (#88, thanks @Liuyeyuyangy0 for the outstanding report): when `DSH_HOME` sits directly under a drive root (e.g. `D:\dsh_data`), the string-slice parent computation degrades to the bare drive letter `D:`, and `tar -C D:` fails on both bsdtar and GNU tar — worse, tar creates the `-f` target before writing, leaving a 29-byte empty shell that the panel lists as a normal backup (no `.sha256`/`.meta.json`; silently zero usable backups, and the restore / doctor repair / rescue channels are hit by the same bug). All 7 tar `-C` call sites (backup, typed & full restore, doctor point-repair, rescue snapshot/restore/repair) now receive a separator-completed parent; `paths()` normalizes trailing slashes off `DSH_HOME` like `HOME` (a trailing slash used to empty the tar positional and produce 0-byte archives); failed tar runs now delete the empty shell before rethrowing, so failures are visible. Smoke gains scenario 28 (four path-layout assertions + a trailing-slash real-backup e2e). Archive format, settings and RPC unchanged.
|
package/README.md
CHANGED
|
@@ -50,7 +50,7 @@ sha256: 8f9ae6322ef782d21554981cf4547220d5bb3e64d7964a883317415ad54e3cbb
|
|
|
50
50
|
|
|
51
51
|
## 安装
|
|
52
52
|
|
|
53
|
-
要求:macOS / Linux / Windows 10+(自带 `tar`),DSH `0.1.1-rc.2`+(0.1.1 / 0.1.2 / 0.1.5 / 0.1.6 / 0.1.7 列车均已实测,0.2.0
|
|
53
|
+
要求:macOS / Linux / Windows 10+(自带 `tar`),DSH `0.1.1-rc.2`+(0.1.1 / 0.1.2 / 0.1.5 / 0.1.6 / 0.1.7 列车均已实测,0.2.0 列车自 0.13.2 起支持;当前兼容状态见 [兼容性矩阵](docs/compatibility.md))。
|
|
54
54
|
|
|
55
55
|
```sh
|
|
56
56
|
dsh plugin --profile web add @xiaoyuyu6420/dsh-backup
|
|
@@ -140,6 +140,9 @@ dsh plugin --profile web add github:xiaoyuyu6420/dsh-backup
|
|
|
140
140
|
<details>
|
|
141
141
|
<summary>最近的版本</summary>
|
|
142
142
|
|
|
143
|
+
- **0.13.4** —— 元数据版(**无代码与行为变更**):npm 描述与关键词对齐检索用词——补入「迁移 / 换机 / 插件 / MCP / 技能 / 会话 / 工作区」等,让"搬家换机、升级翻车"场景的人在 npm 搜索里能找到本插件。功能、归档格式、设置项、RPC 与 0.13.3 完全一致;升级到本版与停留在 0.13.3 在行为上没有任何区别。
|
|
144
|
+
- **0.13.3** —— 三条真实用户报障的修复 + 两个自建缺陷修复,全部在四条宿主列车(0.1.5-rc.3 / 0.1.7-rc.2 / 0.2.0-rc.2 / 0.2.1-alpha.1)真机 e2e 各 41/41 复验:① **含附件的归档恢复全链路不可用**(#112,@zevs281):DSH 附件库用硬链接(tar 记为 `h` 条目),而恢复校验器只放行 `-`/`d`——0.13.2 及更早对这类归档的完整恢复/dry-run/分类型合并/doctor 修复一律拒绝。修法:条目与目标都在备份根内的硬链接放行(符号链接、设备仍拒)。② **大归档恢复被误拒**(#119,@Yoshino-JF):归档清单超过宿主 subprocess 的 spill 上限时宿主会**丢弃 spill 文件**、只留 8 KB 尾窗,校验器把"断在文件名中间的碎片"当成不安全条目 → 整包拒绝(备份成功、verify 报完整、只在恢复时炸)。修法:清单改走原始流逐行校验(无上限,发现违规立即终止)。③ **doctor/migrate 看不见 v4 会话日志**(#117,@xiuwufangoc-design):宿主 0.1.7 起会话格式为 v4(`session.v4.jsonl.zstd`),而文件名与校准代写死到第 0 代/v3——体检与迁移预检一份都扫不到。修法:按宿主同源形态匹配文件名、校准代推进到 v4、更新代只提示。④ **一键更新跨不过 minor**(#115):pnpm `update` 只在声明范围内升级,跨 minor 停在旧版且回执谎报成功。修法:`update --latest` + 跑完读回 profile 内真实版本核对。⑤ **迁移预检误报**(#113,@zevs281):未知 `source.kind` 从"判打不开"降级为提示,名单对齐宿主权威集合(真机曾把 81/82 份健康日志误报)。
|
|
145
|
+
- **0.13.2** —— 适配 dsh **0.2.0 列车**:peers/engines 追加 `^0.2.0-rc.1`(宿主自 0.1.7-rc.1 起有安装期兼容闸门,不覆盖会被拒绝安装);**修复 0.1.7 起失效的设置表单**(宿主改从条目 Config schema 派生表单且只认 `volatile` 字段——本插件导出 `Config` 并逐字段 `.volatile()`,设置卡片恢复可读可写);修复 Windows 调度器启动卡死(#103:流式哈希 + 启动宽限 + 尝试锚点落盘);review P2 债清偿与产品内 Star 入口。
|
|
143
146
|
- **0.13.1** —— 修复两个面板问题(均感谢用户报告):① **0.1.6+ 宿主上面板标签静默消失**(#94,@jackovibe):宿主 0.1.6 起要求客户端 Remote 贡献的 strict codec 带 `create()` 惰性工厂(旧版只读 `schema`),缺失时 `$mount` 在校验阶段抛错且只有 console 日志——标签页因此永不注册。修法:`strictCodec()` 同时提供 `schema` 与 `create()`,两代宿主共用同一 zod 实例;`$mount` 改为声明式等待 `remote` 服务就绪(0.1.6 客户端模块按依赖图结算);并新增 `BackupTabFallback` **降级标签页**——万一挂载失败会在面板位置给出可见提示与命令指路,不再静默消失。peers/engines 追加 `^0.1.6-alpha.1 || ^0.1.7-alpha.1`(0.1.6-alpha.2 / 0.1.7-alpha.2 / 0.1.7-rc.1 / 0.1.7-rc.2 实机验证通过)。② **「GitHub Token」保存按钮报错**(#97,@CheeseTJ):客户端 `panel` 代理漏接了 `setGithubToken`(该 RPC 0.12.0 加入宿主半时即漏,因当时面板无入口而潜伏两版)。修法:补接该行,并给 smoke-client 加「panel 面必须与贡献 descriptors 一一对应」的防漏断言。
|
|
144
147
|
- **0.13.0** —— 更新感知 + 一键更新(#A+B):① `/backup check-update` 与面板「插件更新」卡——查 npm 最新版(8s 超时、断网静默降级,绝不阻断运行),发现新版即出现「更新到 x.y.z」按钮;设置项 `updateCheck`(默认关)开启后打开面板自动静默检查一次(本插件不联网上报,检查只读 registry)。② `/backup update [--profile 名]` 一键更新——更新前自动留 `dsh-pre-upgrade-` 升级前快照(失败可 `/backup restore` 回滚),再走官方 `dsh plugin --profile <名> update`(pnpm 语义,插件不自己覆写依赖文件),完成提示重启 dsh web 生效。说明:宿主在启动时结算插件 Loader 树、插件是 profile 的 pnpm 依赖,**运行中热替换(不重启生效)在宿主现行架构下不可行**——一键更新 + 重启是此架构下的最佳形态。
|
|
145
148
|
- **0.12.2** —— 修复 Windows 数据安全隐患(#88,感谢 @Liuyeyuyangy0 出色的报告):`DSH_HOME` 位于盘符根目录(如 `D:\dsh_data`)时,求父目录的字符串截取退化成裸盘符 `D:`,`tar -C D:` 在 bsdtar/GNU tar 下必然失败——而 tar 失败前已创建归档文件,留下 29 字节空壳被面板当正常备份列出(无 `.sha256`/`.meta.json`,静默零可用备份;恢复、doctor 修复、rescue 救援通道同样中招)。备份/恢复/修复/救援共 7 处 tar `-C` 统一改传补过分隔符的父目录;`paths()` 对 `DSH_HOME` 补上与 HOME 一致的尾斜杠归一化(尾斜杠曾让 tar 位置参数变空串、产出 0 字节坏包);tar 失败路径删除空壳归档再抛错,失败不再静默。smoke 新增场景 28(四种路径布局断言 + 尾斜杠真实备份 e2e)。归档格式、设置项、RPC 均不变。
|