@lingda-ai/dsh-plugin-vault 0.1.0 → 0.1.1
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 +23 -6
- package/lib/client.js +3 -3
- package/lib/route.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,23 +25,40 @@
|
|
|
25
25
|
- **不做云端同步**:备份只在本机 `~/.dsh/ops/vault/`。要异地容灾,自己 `rsync` 那个目录。
|
|
26
26
|
- **不从网页触发写操作**:见下面「为什么回滚只在终端」。
|
|
27
27
|
|
|
28
|
+
## 安装
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# 作为插件装进 profile(重启宿主即生效,不用手改 bundles —— 插件的 cordis.patch.yml 会自动组合)
|
|
32
|
+
dsh plugin add @lingda-ai/dsh-plugin-vault --profile <你的 profile>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
只要 CLI、不要面板也行:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx @lingda-ai/dsh-plugin-vault create
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
想直接用短命令 `dsh-vault`,全局装一份:`npm i -g @lingda-ai/dsh-plugin-vault`。
|
|
42
|
+
|
|
43
|
+
> 前提:profile 里已有宿主壳(`@deepseek-ai/dsh-base` + `dsh-acp-app` 或 `dsh-web-app`)。空白 profile 先装壳,否则插件没有可挂载的位置。
|
|
44
|
+
|
|
28
45
|
## 四道使用动作
|
|
29
46
|
|
|
30
47
|
```bash
|
|
31
48
|
# 装插件前拍一张(之后每次装前跑一次就够)
|
|
32
|
-
npx dsh-vault create --note "装 X 之前"
|
|
49
|
+
npx @lingda-ai/dsh-plugin-vault create --note "装 X 之前"
|
|
33
50
|
|
|
34
51
|
# 出事了:先看有哪些
|
|
35
|
-
npx dsh-vault list
|
|
52
|
+
npx @lingda-ai/dsh-plugin-vault list
|
|
36
53
|
|
|
37
54
|
# 校验某份是否完整、当前配置有没有被改过
|
|
38
|
-
npx dsh-vault verify 20261129-2230
|
|
55
|
+
npx @lingda-ai/dsh-plugin-vault verify 20261129-2230
|
|
39
56
|
|
|
40
57
|
# 到底差在哪:已改 / 缺失 / 新增
|
|
41
|
-
npx dsh-vault diff 20261129-2230
|
|
58
|
+
npx @lingda-ai/dsh-plugin-vault diff 20261129-2230
|
|
42
59
|
|
|
43
60
|
# 退回
|
|
44
|
-
npx dsh-vault restore 20261129-2230
|
|
61
|
+
npx @lingda-ai/dsh-plugin-vault restore 20261129-2230
|
|
45
62
|
```
|
|
46
63
|
|
|
47
64
|
`restore` 支持 `--dry-run`(只列出将恢复哪些文件,不动盘),也支持 `--no-pre-backup`(默认关闭:回滚前**自动**把当前状态再备一份,所以点错了还能退回来)。
|
|
@@ -82,7 +99,7 @@ npx dsh-vault restore 20261129-2230
|
|
|
82
99
|
- 需要 Node ≥ 22.6(用了 `node:test` 与 ESM 原生能力)。
|
|
83
100
|
- 零运行时依赖;不发起任何外部网络请求。
|
|
84
101
|
- 读权限:`DSH_HOME`(默认 `~`)下的配置类文件;写权限:`~/.dsh/ops/vault/` 与 `restore` 时的目标配置文件。
|
|
85
|
-
- 仅在用户显式执行 `dsh-vault restore` 时写配置;插件加载本身**从不写任何文件**。
|
|
102
|
+
- 仅在用户显式执行 `dsh-vault restore`(或 `npx @lingda-ai/dsh-plugin-vault restore`) 时写配置;插件加载本身**从不写任何文件**。
|
|
86
103
|
- Web 端只暴露 `GET /dsh-vault/api`(`list` / `verify` / `diff` / `manifest`),列表返回里不含文件内容,只有路径、字节数与哈希。
|
|
87
104
|
|
|
88
105
|
## 落盘结构
|
package/lib/client.js
CHANGED
|
@@ -32,7 +32,7 @@ window.__ModuleLoader__.load({
|
|
|
32
32
|
loading: '正在读机库…',
|
|
33
33
|
empty: '机库还是空的',
|
|
34
34
|
emptyBody: '先给现在这份能用的配置拍一张。终端执行一次即可,之后每次装插件前跑一次更稳妥。',
|
|
35
|
-
emptyCmd: 'dsh-vault create',
|
|
35
|
+
emptyCmd: 'npx @lingda-ai/dsh-plugin-vault create',
|
|
36
36
|
errTitle: '机库读不出来',
|
|
37
37
|
latest: '最近一份',
|
|
38
38
|
intact: '完整',
|
|
@@ -56,7 +56,7 @@ window.__ModuleLoader__.load({
|
|
|
56
56
|
loading: 'Reading hangar…',
|
|
57
57
|
empty: 'The hangar is empty',
|
|
58
58
|
emptyBody: 'Snapshot the config that works today. One command in the terminal; run it again before installing plugins.',
|
|
59
|
-
emptyCmd: 'dsh-vault create',
|
|
59
|
+
emptyCmd: 'npx @lingda-ai/dsh-plugin-vault create',
|
|
60
60
|
errTitle: 'Hangar unavailable',
|
|
61
61
|
latest: 'Latest',
|
|
62
62
|
intact: 'intact',
|
|
@@ -297,7 +297,7 @@ window.__ModuleLoader__.load({
|
|
|
297
297
|
|
|
298
298
|
h('div', { style: { padding: '10px 14px 4px' } },
|
|
299
299
|
h('div', { style: { fontSize: 11, fontWeight: 600, color: C.t1, borderTop: '1px solid ' + C.hair, paddingTop: 8 } }, T.restore),
|
|
300
|
-
h(Code, { text: picked ? 'dsh-vault restore ' + picked : 'dsh-vault list' }),
|
|
300
|
+
h(Code, { text: picked ? 'npx @lingda-ai/dsh-plugin-vault restore ' + picked : 'npx @lingda-ai/dsh-plugin-vault list' }),
|
|
301
301
|
h('div', { style: { marginTop: 5, fontSize: 10.5, color: C.t4, lineHeight: 1.6 } }, T.restoreNote)))
|
|
302
302
|
}
|
|
303
303
|
|
package/lib/route.js
CHANGED
|
@@ -45,7 +45,7 @@ export function handleRequest(api, req, res) {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
if (req.method !== 'GET' && req.method !== 'HEAD') {
|
|
48
|
-
send({ ok: false, error: '机库只提供只读查询;回滚请在终端执行 dsh-vault restore <id>' })
|
|
48
|
+
send({ ok: false, error: '机库只提供只读查询;回滚请在终端执行 npx @lingda-ai/dsh-plugin-vault restore <id>' })
|
|
49
49
|
return
|
|
50
50
|
}
|
|
51
51
|
|