dsh-plugin-snapshot 0.3.5 → 0.3.6
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 +36 -2
- package/README.md +36 -2
- package/package.json +2 -2
package/README.en.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# dsh-plugin-snapshot
|
|
2
2
|
|
|
3
|
-
**
|
|
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
|
|
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
|
|
@@ -32,6 +32,17 @@ It deliberately does **not** install, remove or toggle plugins: that is what the
|
|
|
32
32
|
|
|
33
33
|
---
|
|
34
34
|
|
|
35
|
+
## Settings panel
|
|
36
|
+
|
|
37
|
+
After install, **Settings → Plugin Updates** shows a three-tab panel:
|
|
38
|
+
|
|
39
|
+
| Tab | Contents | Writes |
|
|
40
|
+
| --- | --- | --- |
|
|
41
|
+
| **Updates** | plugins with changes (updatable / major / prerelease / below-local / incompatible), per-row update, update-all | yes |
|
|
42
|
+
| **Snapshots** | list, create, restore | yes |
|
|
43
|
+
| **Diagnostics** | installed / enabled / missing / incompatible / untested / native counts, conflict table, review priority | no |
|
|
44
|
+
|
|
45
|
+
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
46
|
## Usage
|
|
36
47
|
|
|
37
48
|
Just talk to the model:
|
|
@@ -72,6 +83,29 @@ Nothing else is written except the three profile manifests on restore.
|
|
|
72
83
|
|
|
73
84
|
---
|
|
74
85
|
|
|
86
|
+
## Auto-update
|
|
87
|
+
|
|
88
|
+
**Disabled by default.** Set `"autoUpdate": true` explicitly to enable it — installing a snapshot tool should not silently rewrite your dependency tree.
|
|
89
|
+
|
|
90
|
+
When enabled, it runs 45 seconds after DSH starts:
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
checkUpdates -> filter (exclude list + scope)
|
|
94
|
+
-> lock probe: drop packages currently held by DSH
|
|
95
|
+
-> snapshot
|
|
96
|
+
-> per-package install (pnpm add --save-exact --ignore-scripts)
|
|
97
|
+
-> four-state verdict: read the on-disk version, trust no exit code
|
|
98
|
+
-> layered rollback on failure (package-level / full)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
| Mechanism | What it does |
|
|
102
|
+
| --- | --- |
|
|
103
|
+
| **Lock probe** | directory rename + `.node` open probe, removes packages that cannot be replaced |
|
|
104
|
+
| **Four-state verdict** | on-disk version present means success; only NO_MATCHING_VERSION / UNSUPPORTED_ENGINE / FETCH_404 count as failure |
|
|
105
|
+
| **Layered rollback** | partial success reverts only failed items; full failure restores then reinstalls |
|
|
106
|
+
| **Transient retry** | network failures retried at 8s / 30s / 90s; deterministic failures are not retried |
|
|
107
|
+
|
|
108
|
+
Results are written to `~/.dsh-plugin-snapshot/auto-update.json` and shown at the top of the Updates tab.
|
|
75
109
|
## Configuration
|
|
76
110
|
|
|
77
111
|
{
|
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# dsh-plugin-snapshot
|
|
2
2
|
|
|
3
|
-
|
|
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
|
|
@@ -32,6 +32,17 @@
|
|
|
32
32
|
|
|
33
33
|
---
|
|
34
34
|
|
|
35
|
+
## 设置页面板
|
|
36
|
+
|
|
37
|
+
装好后,**设置 → 插件更新** 会出现一个三页签面板:
|
|
38
|
+
|
|
39
|
+
| 页签 | 内容 | 写操作 |
|
|
40
|
+
| --- | --- | --- |
|
|
41
|
+
| **插件更新** | 列出有变化的插件(可更新 / 主版本变更 / 预发布 / 低于本地 / 不兼容),每行可单独更新,右上角可全部更新 | 是 |
|
|
42
|
+
| **快照** | 快照列表、创建、恢复 | 是 |
|
|
43
|
+
| **诊断** | 已装 / 已启用 / 缺失 / 不兼容 / 未验证 / 原生 计数,冲突表与检查优先级 | 否 |
|
|
44
|
+
|
|
45
|
+
面板所有写操作都走同源 HTTP,并带三重守卫:自定义请求头、`application/json`、Origin 校验;同一接口 1.5 秒内只接受一次。
|
|
35
46
|
## 怎么用(对话示例)
|
|
36
47
|
|
|
37
48
|
你不用记命令,直接跟模型说:
|
|
@@ -103,6 +114,29 @@ profile 目录下的三份清单:
|
|
|
103
114
|
|
|
104
115
|
---
|
|
105
116
|
|
|
117
|
+
## 自动更新
|
|
118
|
+
|
|
119
|
+
**默认关闭。** 需要在插件配置里显式写 `"autoUpdate": true` 才会启用——装一个快照工具不应该静默改整个依赖树。
|
|
120
|
+
|
|
121
|
+
启用后,DSH 启动 45 秒执行一次:
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
checkUpdates → 过滤(排除名单 + 档位)
|
|
125
|
+
→ 占用探针:把正被 DSH 锁住的包剔出本轮
|
|
126
|
+
→ 打快照
|
|
127
|
+
→ 逐包安装(pnpm add --save-exact --ignore-scripts)
|
|
128
|
+
→ 四态判定:回读磁盘版本,不信退出码
|
|
129
|
+
→ 失败时分层回退(包级 / 整体)
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
| 机制 | 作用 |
|
|
133
|
+
| --- | --- |
|
|
134
|
+
| **占用探针** | 目录 rename + `.node` 读写探测,提前剔掉装不上的包,避免白跑 |
|
|
135
|
+
| **四态判定** | 磁盘版本到位即判成功;只有 NO_MATCHING_VERSION / UNSUPPORTED_ENGINE / FETCH_404 三个致命码判失败 |
|
|
136
|
+
| **分层回退** | 部分成功只退失败项,全部失败才整体恢复,恢复后补 `pnpm install` |
|
|
137
|
+
| **瞬时重试** | 网络类失败按 8s / 30s / 90s 退避重试三次;确定性失败不重试 |
|
|
138
|
+
|
|
139
|
+
结果写入 `~/.dsh-plugin-snapshot/auto-update.json`,面板「插件更新」页顶部显示上次结果。
|
|
106
140
|
## 配置项
|
|
107
141
|
|
|
108
142
|
在插件配置里可写:
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-snapshot",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "
|
|
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",
|