dsh-plugin-snapshot 0.3.5 → 0.3.7

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.
Files changed (3) hide show
  1. package/README.en.md +39 -2
  2. package/README.md +39 -2
  3. package/package.json +6 -11
package/README.en.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # dsh-plugin-snapshot
2
2
 
3
- **Pre-upgrade snapshots, one-step rollback and a static health check for DeepSeek Harness plugins.**
3
+ **Checks and upgrades your installed DSH plugins automatically — a snapshot before every upgrade, automatic rollback on failure, plus one-click rollback and a static health check.**
4
4
 
5
- One plugin, three tools.
5
+ One plugin = automatic upgrades + three tools + a Settings panel.
6
6
 
7
7
  - npm: https://www.npmjs.com/package/dsh-plugin-snapshot
8
8
  - repo: https://github.com/Uesccda/dsh-plugin-snapshot
@@ -22,6 +22,9 @@ It deliberately does **not** install, remove or toggle plugins: that is what the
22
22
 
23
23
  ---
24
24
 
25
+ ![Settings panel preview](https://cdn.jsdelivr.net/gh/Uesccda/dsh-plugin-snapshot@main/docs/panel-preview.svg)
26
+
27
+ > Structural preview of the panel (Settings → Plugin Updates). Not a screenshot.
25
28
  ## The three tools
26
29
 
27
30
  | Tool | Does | Writes |
@@ -32,6 +35,17 @@ It deliberately does **not** install, remove or toggle plugins: that is what the
32
35
 
33
36
  ---
34
37
 
38
+ ## Settings panel
39
+
40
+ After install, **Settings → Plugin Updates** shows a three-tab panel:
41
+
42
+ | Tab | Contents | Writes |
43
+ | --- | --- | --- |
44
+ | **Updates** | plugins with changes (updatable / major / prerelease / below-local / incompatible), per-row update, update-all | yes |
45
+ | **Snapshots** | list, create, restore | yes |
46
+ | **Diagnostics** | installed / enabled / missing / incompatible / untested / native counts, conflict table, review priority | no |
47
+
48
+ All write operations go over same-origin HTTP with three guards: custom header, `application/json`, Origin check; plus a 1.5 s throttle per endpoint.
35
49
  ## Usage
36
50
 
37
51
  Just talk to the model:
@@ -72,6 +86,29 @@ Nothing else is written except the three profile manifests on restore.
72
86
 
73
87
  ---
74
88
 
89
+ ## Auto-update
90
+
91
+ **Disabled by default.** Set `"autoUpdate": true` explicitly to enable it — installing a snapshot tool should not silently rewrite your dependency tree.
92
+
93
+ When enabled, it runs 45 seconds after DSH starts:
94
+
95
+ ```
96
+ checkUpdates -> filter (exclude list + scope)
97
+ -> lock probe: drop packages currently held by DSH
98
+ -> snapshot
99
+ -> per-package install (pnpm add --save-exact --ignore-scripts)
100
+ -> four-state verdict: read the on-disk version, trust no exit code
101
+ -> layered rollback on failure (package-level / full)
102
+ ```
103
+
104
+ | Mechanism | What it does |
105
+ | --- | --- |
106
+ | **Lock probe** | directory rename + `.node` open probe, removes packages that cannot be replaced |
107
+ | **Four-state verdict** | on-disk version present means success; only NO_MATCHING_VERSION / UNSUPPORTED_ENGINE / FETCH_404 count as failure |
108
+ | **Layered rollback** | partial success reverts only failed items; full failure restores then reinstalls |
109
+ | **Transient retry** | network failures retried at 8s / 30s / 90s; deterministic failures are not retried |
110
+
111
+ Results are written to `~/.dsh-plugin-snapshot/auto-update.json` and shown at the top of the Updates tab.
75
112
  ## Configuration
76
113
 
77
114
  {
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # dsh-plugin-snapshot
2
2
 
3
- **给 DeepSeek Harness 的插件做升级前快照、一键回滚和静态体检。**
3
+ **自动检查并升级你安装的 DSH 插件——升级前自动打快照,失败自动回滚;也能一键回滚与静态体检。**
4
4
 
5
- 一个插件,三个工具。
5
+ 一个插件 = 自动升级 + 三个工具 + 一个设置页面板。
6
6
 
7
7
  - npm: https://www.npmjs.com/package/dsh-plugin-snapshot
8
8
  - 仓库: https://github.com/Uesccda/dsh-plugin-snapshot
@@ -22,6 +22,9 @@
22
22
 
23
23
  ---
24
24
 
25
+ ![设置页面板示意](https://cdn.jsdelivr.net/gh/Uesccda/dsh-plugin-snapshot@main/docs/panel-preview.svg)
26
+
27
+ > 上图是面板结构示意(设置 → 插件更新),非真实截图。
25
28
  ## 三个工具
26
29
 
27
30
  | 工具 | 做什么 | 会不会写文件 |
@@ -32,6 +35,17 @@
32
35
 
33
36
  ---
34
37
 
38
+ ## 设置页面板
39
+
40
+ 装好后,**设置 → 插件更新** 会出现一个三页签面板:
41
+
42
+ | 页签 | 内容 | 写操作 |
43
+ | --- | --- | --- |
44
+ | **插件更新** | 列出有变化的插件(可更新 / 主版本变更 / 预发布 / 低于本地 / 不兼容),每行可单独更新,右上角可全部更新 | 是 |
45
+ | **快照** | 快照列表、创建、恢复 | 是 |
46
+ | **诊断** | 已装 / 已启用 / 缺失 / 不兼容 / 未验证 / 原生 计数,冲突表与检查优先级 | 否 |
47
+
48
+ 面板所有写操作都走同源 HTTP,并带三重守卫:自定义请求头、`application/json`、Origin 校验;同一接口 1.5 秒内只接受一次。
35
49
  ## 怎么用(对话示例)
36
50
 
37
51
  你不用记命令,直接跟模型说:
@@ -103,6 +117,29 @@ profile 目录下的三份清单:
103
117
 
104
118
  ---
105
119
 
120
+ ## 自动更新
121
+
122
+ **默认关闭。** 需要在插件配置里显式写 `"autoUpdate": true` 才会启用——装一个快照工具不应该静默改整个依赖树。
123
+
124
+ 启用后,DSH 启动 45 秒执行一次:
125
+
126
+ ```
127
+ checkUpdates → 过滤(排除名单 + 档位)
128
+ → 占用探针:把正被 DSH 锁住的包剔出本轮
129
+ → 打快照
130
+ → 逐包安装(pnpm add --save-exact --ignore-scripts)
131
+ → 四态判定:回读磁盘版本,不信退出码
132
+ → 失败时分层回退(包级 / 整体)
133
+ ```
134
+
135
+ | 机制 | 作用 |
136
+ | --- | --- |
137
+ | **占用探针** | 目录 rename + `.node` 读写探测,提前剔掉装不上的包,避免白跑 |
138
+ | **四态判定** | 磁盘版本到位即判成功;只有 NO_MATCHING_VERSION / UNSUPPORTED_ENGINE / FETCH_404 三个致命码判失败 |
139
+ | **分层回退** | 部分成功只退失败项,全部失败才整体恢复,恢复后补 `pnpm install` |
140
+ | **瞬时重试** | 网络类失败按 8s / 30s / 90s 退避重试三次;确定性失败不重试 |
141
+
142
+ 结果写入 `~/.dsh-plugin-snapshot/auto-update.json`,面板「插件更新」页顶部显示上次结果。
106
143
  ## 配置项
107
144
 
108
145
  在插件配置里可写:
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "dsh-plugin-snapshot",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "type": "module",
5
- "description": "Snapshots, one-step rollback, static diagnostics, auto-update with lock probe and four-state verification for DeepSeek Harness plugins.",
5
+ "description": "Automatically checks and upgrades your installed DSH plugins: snapshot before every upgrade, automatic rollback on failure, plus one-click rollback and static diagnostics.",
6
6
  "keywords": [
7
7
  "deepseek-harness",
8
8
  "dsh",
@@ -49,20 +49,15 @@
49
49
  },
50
50
  "compatibility": {
51
51
  "dshReleases": {
52
+ "0.2.2-rc.5": "compatible",
53
+ "0.2.2-rc.3": "compatible",
52
54
  "0.2.2-rc.1": "compatible",
53
- "0.2.1": "compatible",
54
55
  "0.2.0+": "compatible"
55
56
  }
56
57
  }
57
58
  },
58
- "peerDependencies": {
59
- "@deepseek-ai/dsh-tools": ">=0.1.7-rc.1 <0.4.0"
60
- },
61
- "peerDependenciesMeta": {
62
- "@deepseek-ai/dsh-tools": {
63
- "optional": true
64
- }
65
- },
59
+ "peerDependencies": {},
60
+ "peerDependenciesMeta": {},
66
61
  "engines": {
67
62
  "node": ">=20"
68
63
  },