@xiaoyuyu6420/dsh-backup 0.12.2 → 0.13.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.en.md CHANGED
@@ -137,6 +137,7 @@ Tried it? Tell us what broke, what's missing, what you liked — it directly sha
137
137
  <details>
138
138
  <summary>Recent releases</summary>
139
139
 
140
+ - **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.
140
141
  - **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.
141
142
  - **0.12.1** — Fix client bundle leaking top-level `var module` / `var exports` as globals (#85, thanks @geyonder): the CJS shim now lives inside the `__ModuleLoader__.load` factory body instead of creating `window.module`, which made Monaco's AMD loader (dsh-vscode-mode and friends) misdetect a Node environment and break sibling plugins on the same page. Client smoke suite gains a classic-script global-leak regression assertion (`vm.runInContext`). Client-half only; node-side behavior and archive format unchanged.
142
143
  - **0.12.0** — Migration safety net, round one, aimed at the community-wide "old sessions won't open after upgrade" wave (#6151/#6297/#6355): 1) `/backup migrate-check` statically scans all session logs (v0/v1/v2/v3) before you upgrade and predicts which sessions will refuse to open and under which rule (descriptor v2, permission/preset origin, event types outside the frozen lists, custom source kinds, seq drift, filename/generation mismatch — rules baked from host 0.1.5-rc.2, with the coverage boundary stated in every report), plus a filesystem hardlink probe (the exFAT publish-failure scenario from #6358); 2) a credential sentinel — the legacy flat-layout `.credentials.yaml` gets atomically replaced by the host with an irreversible versioned form, so on detection it is preserved into the vault before the host touches it. 3) configure the GitHub sync token right in the Settings panel (or `/backup github token <token>`) — stored locally as `github.token` (0600) in the backup directory, never archived or synced, taking precedence over environment variables; re-enter after cross-machine restore. Also: `engines.dsh` declaration (read by plugin-market compatibility cards).
package/README.md CHANGED
@@ -137,6 +137,7 @@ dsh plugin --profile web add github:xiaoyuyu6420/dsh-backup
137
137
  <details>
138
138
  <summary>最近的版本</summary>
139
139
 
140
+ - **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 依赖,**运行中热替换(不重启生效)在宿主现行架构下不可行**——一键更新 + 重启是此架构下的最佳形态。
140
141
  - **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 均不变。
141
142
  - **0.12.1** —— 修复 client bundle 顶层 `var module` / `var exports` 泄漏为全局变量(#85,感谢 @geyonder 报告):CJS shim 移入 `__ModuleLoader__.load` factory 体内,不再创建 `window.module`——此前会把 Monaco 的 AMD loader(dsh-vscode-mode 等)误判成 Node 环境并破坏同页插件。冒烟测试新增经典脚本全局泄漏回归断言(`vm.runInContext`)。纯 client 半区修复,node 侧行为与归档格式不变。
142
143
  - **0.12.0** —— 迁移安全网第一弹,对准官方社区集中爆发的「升级后老会话打不开」(#6151/#6297/#6355):① `/backup migrate-check` 迁移预检——升级前静态扫描全部代会话日志(v0/v1/v2/v3),预测哪些会话升完会打不开、挂在哪条规则(descriptor v2、permission/preset origin、冻结清单外事件类型、自定义来源 kind、seq 漂移、文件名代际不一致……规则烤入自宿主 0.1.5-rc.2,摘要如实标注覆盖边界),并探测文件系统硬链接支持(exFAT 上宿主发布会失败的 #6358 场景);② 凭据哨兵——旧扁平布局的 `.credentials.yaml` 会被宿主原子替换成 version:1(不可逆),检测到即先自动存底 vault 再让宿主动它。③ GitHub token 面板直配——设置面板(或 `/backup github token <token>`)直接粘贴保存,存本机备份目录 `github.token`(0600,不进归档、不进 GitHub 同步),优先于环境变量,跨机恢复后重填。另:新增 `engines.dsh` 声明(插件市场的兼容卡片读取它)。