dsh-profile-config-sync 0.6.41 → 0.6.45
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 +23 -3
- package/README.md +34 -6
- package/docs/CHANGELOG.md +5 -1
- package/index.js +52 -13
- package/package.json +5 -4
package/README.en.md
CHANGED
|
@@ -44,11 +44,31 @@ Package name **`dsh-profile-config-sync`** (the npm package `dsh-config-sync` is
|
|
|
44
44
|
|
|
45
45
|
| Method | Entry |
|
|
46
46
|
|---|---|
|
|
47
|
-
| npm | `npm i dsh-profile-config-sync` — **
|
|
47
|
+
| npm | `npm i dsh-profile-config-sync` — **published at the same version as the GitHub release**; the `latest` tag points at it |
|
|
48
48
|
| Plugin market | Search “Config Backup & Sync” in the client's plugin market (via the git commit registered in `market-index.json`) |
|
|
49
|
-
| Offline tgz | `pnpm add ./dsh-profile-config-sync-0.6.
|
|
49
|
+
| Offline tgz | `pnpm add ./dsh-profile-config-sync-0.6.45.tgz` |
|
|
50
50
|
|
|
51
|
-
**Release status**: the latest release is [`v0.6.
|
|
51
|
+
**Release status**: the latest release is [`v0.6.45`](https://github.com/huanyu-a/dsh-profile-config-sync/releases/tag/v0.6.45) (2026-11-27); the repository is public and the npm package publishes alongside (`npm i dsh-profile-config-sync`).
|
|
52
|
+
|
|
53
|
+
## HTTP route admission
|
|
54
|
+
|
|
55
|
+
Every `/config-sync/*` route asks the Host Connection before the handler runs:
|
|
56
|
+
`ctx.connection.requestRejection(request)` — DSH's own Host/Origin fence plus browser-session authentication,
|
|
57
|
+
the same gate the GUI's `/api` channel uses. Only when the Host offers no `connection` service does the plugin fall
|
|
58
|
+
back to its own `originAllowed` (loopback Host, cross-site and `Sec-Fetch-Site: cross-site` refused).
|
|
59
|
+
|
|
60
|
+
**Why this layer exists**: `webServer.register` is a bare HTTP carrier — the DSH docs say the carrier "owns no
|
|
61
|
+
authentication or Origin policy", so route authentication belongs to the composition. Through 0.6.41 the plugin relied
|
|
62
|
+
only on its own `originAllowed`, which treats a request without an `Origin` header as trustworthy; a bare
|
|
63
|
+
`curl http://127.0.0.1:<port>/config-sync/status` (the Host port changes on every start; read `DSH_WEB_URL`) returned **200** and exposed repo paths, config digests and the pending
|
|
64
|
+
list, and could trigger push or restore. The same request now answers **401**, and a refusal body carries only
|
|
65
|
+
`{ ok: false, error: "unauthorized" | "forbidden" }` — no business fields.
|
|
66
|
+
|
|
67
|
+
Because the gate depends on `requestRejection` / `connection.fetch`, `package.json` declares `engines.dsh: ">=0.2.2-rc.5"`.
|
|
68
|
+
The floor is measured, not guessed: the admission APIs already exist in 0.2.2-rc.5 (`requestRejection` / `admit` in
|
|
69
|
+
`dsh-client-connection/src/rpc-host.ts`), while DSH enforces `engines.dsh` at install and at profile startup — a fake
|
|
70
|
+
plugin declaring `>=99.0.0` is refused with `incompatible-version` on a scratch profile — so `>=0.2.3` would lock out the
|
|
71
|
+
machine currently running 0.2.2-rc.5. Once the runtime moves to 0.2.3+, the floor can be tightened in one line.
|
|
52
72
|
|
|
53
73
|
## Known limits
|
|
54
74
|
|
package/README.md
CHANGED
|
@@ -61,22 +61,46 @@ DSH 的配置散在 `~/.dsh` 的十几处:profile、全局提示、Skills、Ag
|
|
|
61
61
|
|
|
62
62
|
| 方式 | 命令 / 入口 |
|
|
63
63
|
|---|---|
|
|
64
|
-
| npm | `npm i dsh-profile-config-sync
|
|
64
|
+
| npm | `npm i dsh-profile-config-sync`(**已发布到与 GitHub Release 相同的版本**,`latest` 标签指的就是它) |
|
|
65
65
|
| 插件市场 | 客户端「插件市场 → 发现」搜「配置备份与同步」(走 `market-index.json` 登记的 git 提交) |
|
|
66
|
-
| 离线 tgz | `pnpm add ./dsh-profile-config-sync-0.6.
|
|
66
|
+
| 离线 tgz | `pnpm add ./dsh-profile-config-sync-0.6.45.tgz`(内网机器用这个) |
|
|
67
67
|
|
|
68
|
-
**发布状态**:最新 Release 是 [`v0.6.
|
|
68
|
+
**发布状态**:最新 Release 是 [`v0.6.45`](https://github.com/huanyu-a/dsh-profile-config-sync/releases/tag/v0.6.45)(2026-11-27),仓库已公开;npm 上的同名包同步发布(`npm i dsh-profile-config-sync`)。
|
|
69
69
|
|
|
70
70
|
要正式发布时(需要有权限的账号,我不会擅自 push):
|
|
71
71
|
|
|
72
72
|
```bash
|
|
73
|
-
gh release create
|
|
74
|
-
--repo huanyu-a/dsh-profile-config-sync --title
|
|
75
|
-
#
|
|
73
|
+
gh release create v<版本> dsh-profile-config-sync-<版本>.tgz \
|
|
74
|
+
--repo huanyu-a/dsh-profile-config-sync --title "v<版本>" --notes-file <发布说明.md>
|
|
75
|
+
# tag 与包名必须是同一个版本号,别像旧文档那样写成 v0.6.39 配 0.6.44 的包
|
|
76
|
+
git tag -a v<版本> -m "v<版本>" && git push origin v<版本>
|
|
77
|
+
# 发布后把仓库根的 version.json 更新到新版本并推上去:面板的更新检查读的是仓库里那份
|
|
78
|
+
# (version.json 不在 npm 包里,files 字段没有它)
|
|
76
79
|
```
|
|
77
80
|
|
|
78
81
|
装好后插件目录是 `<客户端根>\dsh-profile-config-sync-<ver>`,`appRoot` 留空时由插件位置反推客户端根。
|
|
79
82
|
|
|
83
|
+
## 面板路由的准入
|
|
84
|
+
|
|
85
|
+
13 条 `/config-sync/*` 路由在进入处理器之前,先由宿主 Connection 判定:
|
|
86
|
+
`ctx.connection.requestRejection(request)` —— DSH 官方的 Host/Origin 围栏加浏览器会话鉴权,
|
|
87
|
+
和 GUI 自己的 `/api` 通道是同一套。宿主没有 `connection` 服务时(非 Web 载体),才退回插件自己的
|
|
88
|
+
`originAllowed`(只认本机 Host、拒绝跨站与 `Sec-Fetch-Site: cross-site`)。
|
|
89
|
+
|
|
90
|
+
**为什么要有这一层**:`webServer.register` 只是裸 HTTP 载体,DSH 文档写得很直白——
|
|
91
|
+
「The carrier owns no authentication or Origin policy」,路由鉴权是组合层的责任。
|
|
92
|
+
0.6.41 及之前只靠插件自己写的 `originAllowed`:缺 `Origin` 头的请求(本机任意进程、`curl`)
|
|
93
|
+
会被当成可信来源放行,实测裸 `curl http://127.0.0.1:<端口>/config-sync/status` 返回 **200**(宿主端口每次启动会变,取 `DSH_WEB_URL`),
|
|
94
|
+
能读到仓库路径、配置摘要、待同步清单,也能触发推送与还原。
|
|
95
|
+
现在同一请求得到 **401**,拒绝响应体只有 `{ ok: false, error: "unauthorized" | "forbidden" }`,不含任何业务字段。
|
|
96
|
+
|
|
97
|
+
因为依赖 `requestRejection` / `connection.fetch` 这组准入接口,`package.json` 声明了 `engines.dsh: ">=0.2.2-rc.5"`。
|
|
98
|
+
这个下限是量出来的,不是拍的:准入接口在 0.2.2-rc.5 的源码里已经在(`dsh-client-connection/src/rpc-host.ts` 的 `requestRejection` / `admit`),
|
|
99
|
+
而 DSH 在安装与 profile 启动时都强制检查 `engines.dsh`(拿一个声明 `>=99.0.0` 的假插件在临时 profile 上就能复现 `incompatible-version` 拒绝),
|
|
100
|
+
所以写 `>=0.2.3` 会把正跑着 0.2.2-rc.5 的机器直接挡在门外。等运行时升到 0.2.3+ 之后,这个下限可以一行收紧。
|
|
101
|
+
|
|
102
|
+
自检里有专门的一套(`route-admission`,16 条断言):13 条路由在 403 / 401 / 放行 / 无 connection 四种情形下逐一验证,
|
|
103
|
+
并做结构断言「每条 `webServer.register` 的 handler 都套了准入」,防止以后新增路由时漏掉这一层。
|
|
80
104
|
## 已知限制
|
|
81
105
|
|
|
82
106
|
- **非 Windows 没有互斥**:Windows 的 capture / apply 走 `Lock-SyncRun`(命名 Mutex),同一 `~/.dsh` 并发时后来者以退出码 3 结束;macOS / Linux 的引擎没有这层锁,两个动作同时跑仍可能撞文件。
|
|
@@ -369,6 +393,10 @@ push 失败时会**按真实远端地址归因**:https 走 `ls-remote` 检查
|
|
|
369
393
|
|
|
370
394
|
| 日期 | 版本 | 要点 |
|
|
371
395
|
|---|---|---|
|
|
396
|
+
| 2026-11-27 | 0.6.45 | **文档对齐现实**:① 中英 README 去掉「npm 上只到 0.4.1」的陈旧说法(改为「与 GitHub Release 同版本」,`dist-tags.latest` 即它);② 发布命令块改成同版本占位,修掉「v0.6.39 配 0.6.44 的包」的自相矛盾;③ 写清 `version.json` 不在 npm 包里、面板更新检查读的是仓库里那份。功能代码无改动。验收:64 套隔离夹具共 1061 条断言全绿(不含检查这份 README 的文档对账套件本身;另有 1 条权限断言在 Windows 上标 SKIP,不会假装通过) |
|
|
397
|
+
| 2026-11-27 | 0.6.44 | **一致性**:历史字段 `dsh.engines.dsh` 对齐顶层 `>=0.2.2-rc.5`;README 中英去掉写死的 10297,改 `127.0.0.1:<端口>`(以 `DSH_WEB_URL` 为准);审计补 2 条断言。验收:64 套隔离夹具共 1061 条断言全绿(不含检查这份 README 的文档对账套件本身;另有 1 条权限断言在 Windows 上标 SKIP,不会假装通过) |
|
|
398
|
+
| 2026-11-27 | 0.6.43 | **修正下限**:0.6.42 的 `engines.dsh: ">=0.2.3"` 会在 0.2.2-rc.5 运行时上被 DSH 按兼容性规则拒绝加载,改为 `">=0.2.2-rc.5"`(准入接口在该版本已存在,实测假插件复现拒绝流程);准入代码不变。验收:64 套隔离夹具共 1059 条断言全绿(不含检查这份 README 的文档对账套件本身;另有 1 条权限断言在 Windows 上标 SKIP,不会假装通过) |
|
|
399
|
+
| 2026-11-27 | 0.6.42 | **安全**:13 条 HTTP 路由接进宿主准入(`ctx.connection.requestRejection`),裸 curl 从 200 变 401、拒绝体不含业务字段;补 `engines.dsh: ">=0.2.3"`;新增 `route-admission` 审计套件(16 条,含「每条注册都套准入」的结构断言)。验收:64 套隔离夹具共 1059 条断言全绿(不含检查这份 README 的文档对账套件本身;另有 1 条权限断言在 Windows 上标 SKIP,不会假装通过) |
|
|
372
400
|
| 2026-11-26 | 0.6.41 | WebDAV 模式下面板不再显示「? @ ?」与「落后 ? · 领先 ?」:仓库目录只是普通文件夹(无 .git)时,两行改成「WebDAV 模式:这个目录不是 git 仓库,没有分支」/「WebDAV 模式不比提交前后」,未提交数量照常显示;元信息行的 `branch @ head` 尾巴只在真有分支时追加。顺带把市场索引图标从 1240×1696 整屏长图换成 180×180 图标、撤掉三张旧版截图、README 加六枚徽章。验收:63 套隔离夹具共 1043 条断言全绿(不含检查这份 README 的文档对账套件本身;另有 1 条权限断言在 Windows 上标 SKIP,不会假装通过) |
|
|
373
401
|
| 2026-11-26 | 0.6.40 | 只修工具链,插件行为与 0.6.39 完全一致。① `tools/clientcheck.mjs` 里一条按实现细节写的断言(查 `missing ? null :`),0.6.36 合并「云端仓库」与「同步方式(WebDAV)」两张卡后代码形状变了、行为没变,断言失效让 CI 的 publish 门禁变红;现在盯实际那道门(`(!wdConfigured && !gitConfigured) ? null :` 取消按钮)并补一条 `forced ? null` 断言。② `selftest.mjs` 的留窗断言还钉着字面量 `Start-Sleep -Seconds 360`,而 0.6.37 起停留时长可配(`-HoldSeconds`,默认仍是 360),改成盯默认值与变量。③ `tools/fix-session-cwd.mjs` 镜像副本自 0.6.34 起与 `runtime/tools/` 漂移(9989B vs 10636B),已按正本覆盖,并把提示里不存在的 `sync-plugin-mirror.ps1` 改成真实做法。验收:63 套隔离夹具共 1043 条断言全绿(不含检查这份 README 的文档对账套件本身;另有 1 条权限断言在 Windows 上标 SKIP,不会假装通过) |
|
|
374
402
|
| 2026-11-26 | 0.6.39 | 更名与文档:面板 / 侧栏 / 设置摘要行统一改成「**配置备份与同步**」(Config Backup & Sync),副标题改成「多端配置备份、同步与还原:本机 → 仓库 → 云端 → 另一台机器」,退出后同步窗口标题一起改名(`== DSH 配置同步 / x ==` 这类日志 banner 不动——面板靠它解析结果)。README 重排:定位段 + **主要功能** 10 条 + 四个关键词 + 目录锚点 + 发布状态压成一张表 + 新增**「来源与版权」**(上游 QcWyGm/dsh-config-sync-plugin,MIT,LICENSE 同步列出两行版权);**实测记录改版本倒叙**。**正文从 921 行压到 392 行**:历史细节 → `docs/HISTORY.md`,完整记录 → `docs/CHANGELOG.md`,字段/接口/进程细节 → `docs/REFERENCE.md`(三份随包发布);README 只留当前行为。验收:63 套隔离夹具共 1043 条断言全绿(不含检查这份 README 的文档对账套件本身;另有 1 条权限断言在 Windows 上标 SKIP,不会假装通过) |
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
# 实测记录(按版本倒叙,共
|
|
1
|
+
# 实测记录(按版本倒叙,共 79 条)
|
|
2
2
|
|
|
3
3
|
> README 只留最新 8 条;这里是完整记录。每条都是真跑出来的数字,不是估算;标 `—` 的是早期还没有版本号时的验证。
|
|
4
4
|
|
|
5
5
|
| 日期 | 版本 | 要点 |
|
|
6
6
|
|---|---|---|
|
|
7
|
+
| 2026-11-27 | 0.6.45 | **文档对齐现实**:去掉「npm 上只到 0.4.1」的陈旧说法;发布命令块修掉版本号与包名自相矛盾;写清 `version.json` 不在 npm 包里。 |
|
|
8
|
+
| 2026-11-27 | 0.6.44 | **一致性**:历史字段 `dsh.engines.dsh` 对齐顶层 `>=0.2.2-rc.5`;README 中英去掉写死的 10297;审计补 2 条断言。 |
|
|
9
|
+
| 2026-11-27 | 0.6.43 | **修正下限**:0.6.42 的 `engines.dsh >=0.2.3` 会让 0.2.2-rc.5 运行时拒绝加载,改为 `>=0.2.2-rc.5`(准入接口在该版本已存在,实测复现了拒绝流程)。 |
|
|
10
|
+
| 2026-11-27 | 0.6.42 | **安全修复**:13 条 HTTP 路由接进宿主准入(`requestRejection`),裸 curl 200→401;补 `engines.dsh >=0.2.3`;新增 `route-admission` 套件 16 条。 |
|
|
7
11
|
| 2026-11-26 | 0.6.41 | WebDAV 模式下不再渲染 `? @ ?`:无 .git 的仓库目录改为「WebDAV 模式:这个目录不是 git 仓库,没有分支」/「不比提交前后」,未提交数照常;元信息尾巴只在有分支时追加。市场图标换 180×180、撤 3 张旧截图、README 加 6 枚徽章。 |
|
|
8
12
|
| 2026-11-26 | 0.6.40 | 只修工具链:clientcheck 里一条按实现细节写的断言(`missing ? null :`)在 0.6.36 合并云端卡后失效,使 CI publish 门禁变红;改为盯实际那道门。插件行为与 0.6.39 一致。 |
|
|
9
13
|
| 2026-11-26 | 0.6.39 | 更名与文档:面板 / 侧栏 / 设置摘要行统一改成「**配置备份与同步**」(Config Backup & Sync),副标题改成「多端配置备份、同步与还原:本机 → 仓库 → 云端 → 另一台机器」,包描述改成多端备份/同步/还原口径并补 `backup` / `restore` / `webdav` / `multi-device` 关键词,退出后同步窗口标题一起改名(`== DSH 配置同步 / x ==` 这类日志 banner 不动——面板靠它解析结果;历史小标题保留当时的叫法)。README 重写头部:定位段、四件事表(配置 / 备份 / 同步 / 还原)、一张流程线、目录锚点、发布状态压成一张表、「已知限制」单独列;新增「来源与版权」(上游 QcWyGm/dsh-config-sync-plugin,MIT,LICENSE 同步列出两行版权);**实测记录改成版本倒叙**(同日期按版本号数值倒序);并修掉头部停在 0.6.14 的陈旧数字。验收:63 套隔离夹具共 1043 条断言全绿(不含检查这份 README 的文档对账套件本身;另有 1 条权限断言在 Windows 上标 SKIP,不会假装通过) |
|
package/index.js
CHANGED
|
@@ -1441,6 +1441,42 @@ function originAllowed(req) {
|
|
|
1441
1441
|
try { return new URL(String(origin)).host === host } catch { return false }
|
|
1442
1442
|
}
|
|
1443
1443
|
|
|
1444
|
+
/**
|
|
1445
|
+
* 准入判定:先问宿主 Connection 的围栏,只有在宿主没提供 connection 服务时才退回本地围栏。
|
|
1446
|
+
*
|
|
1447
|
+
* 为什么必须问宿主:`webServer.register` 只是裸 HTTP 载体,官方文档写明「The carrier owns no
|
|
1448
|
+
* authentication or Origin policy」——路由鉴权是组合层的责任。宿主为此提供了
|
|
1449
|
+
* `ctx.connection.requestRejection(request)`(Host/Origin 围栏 + 浏览器会话鉴权,返回
|
|
1450
|
+
* 401/403/undefined)与 `ctx.connection.admit(request)`。不接它,等于只靠自己写的
|
|
1451
|
+
* `originAllowed`:缺 Origin 头的请求(curl、非浏览器进程、部分沙箱 iframe 的 `null`)
|
|
1452
|
+
* 会被当成可信来源放行,本机上任何能发 HTTP 的东西都能读配置、触发推送/还原。
|
|
1453
|
+
*
|
|
1454
|
+
* @returns {0|401|403} 0 表示放行
|
|
1455
|
+
*/
|
|
1456
|
+
function admissionVerdict(ctx, req) {
|
|
1457
|
+
try {
|
|
1458
|
+
const conn = ctx && typeof ctx.get === 'function' ? ctx.get('connection', false) : null
|
|
1459
|
+
if (conn && typeof conn.requestRejection === 'function') {
|
|
1460
|
+
const verdict = conn.requestRejection({ headers: req.headers })
|
|
1461
|
+
if (verdict === 401 || verdict === 403) return verdict
|
|
1462
|
+
return 0
|
|
1463
|
+
}
|
|
1464
|
+
} catch { /* connection 在激活中/不可用:落到下面的本地围栏,不让请求变成 500 */ }
|
|
1465
|
+
return originAllowed(req) ? 0 : 403
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
/** 给一条路由套上准入判定:拒绝时只回状态码与原因,不执行处理器。 */
|
|
1469
|
+
function admitWrap(ctx, handler) {
|
|
1470
|
+
return (req, res) => {
|
|
1471
|
+
const verdict = admissionVerdict(ctx, req)
|
|
1472
|
+
if (verdict) {
|
|
1473
|
+
sendJson(res, verdict, { ok: false, error: verdict === 401 ? 'unauthorized' : 'forbidden' })
|
|
1474
|
+
return undefined
|
|
1475
|
+
}
|
|
1476
|
+
return handler(req, res)
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1444
1480
|
function sendJson(res, code, body) {
|
|
1445
1481
|
try {
|
|
1446
1482
|
res.statusCode = code
|
|
@@ -6148,73 +6184,76 @@ export function apply(ctx, config) {
|
|
|
6148
6184
|
// 每个请求按 accept-language 决定返回中文还是英文:AsyncLocalStorage 让 t() 在
|
|
6149
6185
|
// 任何异步后续里都能读到本次请求的语言,不用把语言参数一层层往下传。
|
|
6150
6186
|
const withLang = (handler) => (req, res) => langStore.run(pickLang(req), () => handler(req, res, config))
|
|
6187
|
+
// 每条路由都过准入:先由宿主 Connection 判定(Host/Origin 围栏 + 浏览器会话鉴权),
|
|
6188
|
+
// 宿主没提供 connection 时退回本地 originAllowed。少套一层就等于本机任何进程都能进来。
|
|
6189
|
+
const guarded = (handler) => admitWrap(ctx, withLang(handler))
|
|
6151
6190
|
scoped.effect(() => scoped.webServer.register({
|
|
6152
6191
|
kind: 'exact',
|
|
6153
6192
|
path: ROUTE_STATUS,
|
|
6154
|
-
handler:
|
|
6193
|
+
handler: guarded(handleStatus),
|
|
6155
6194
|
}))
|
|
6156
6195
|
scoped.effect(() => scoped.webServer.register({
|
|
6157
6196
|
kind: 'exact',
|
|
6158
6197
|
path: ROUTE_PREPARE,
|
|
6159
|
-
handler:
|
|
6198
|
+
handler: guarded(handlePrepare),
|
|
6160
6199
|
}))
|
|
6161
6200
|
scoped.effect(() => scoped.webServer.register({
|
|
6162
6201
|
kind: 'exact',
|
|
6163
6202
|
path: ROUTE_SETTINGS,
|
|
6164
|
-
handler:
|
|
6203
|
+
handler: guarded(handleSettings),
|
|
6165
6204
|
}))
|
|
6166
6205
|
scoped.effect(() => scoped.webServer.register({
|
|
6167
6206
|
kind: 'exact',
|
|
6168
6207
|
path: ROUTE_AUTO,
|
|
6169
|
-
handler:
|
|
6208
|
+
handler: guarded(handleAuto),
|
|
6170
6209
|
}))
|
|
6171
6210
|
scoped.effect(() => scoped.webServer.register({
|
|
6172
6211
|
kind: 'exact',
|
|
6173
6212
|
path: ROUTE_UPDATE,
|
|
6174
|
-
handler:
|
|
6213
|
+
handler: guarded(handleUpdate),
|
|
6175
6214
|
}))
|
|
6176
6215
|
scoped.effect(() => scoped.webServer.register({
|
|
6177
6216
|
kind: 'exact',
|
|
6178
6217
|
path: ROUTE_SCOPE,
|
|
6179
|
-
handler:
|
|
6218
|
+
handler: guarded(handleScope),
|
|
6180
6219
|
}))
|
|
6181
6220
|
scoped.effect(() => scoped.webServer.register({
|
|
6182
6221
|
kind: 'exact',
|
|
6183
6222
|
path: ROUTE_EXTRA_CONFIG,
|
|
6184
|
-
handler:
|
|
6223
|
+
handler: guarded(handleExtraConfig),
|
|
6185
6224
|
}))
|
|
6186
6225
|
scoped.effect(() => scoped.webServer.register({
|
|
6187
6226
|
kind: 'exact',
|
|
6188
6227
|
path: ROUTE_CONFLICT,
|
|
6189
|
-
handler:
|
|
6228
|
+
handler: guarded(handleConflict),
|
|
6190
6229
|
}))
|
|
6191
6230
|
scoped.effect(() => scoped.webServer.register({
|
|
6192
6231
|
kind: 'exact',
|
|
6193
6232
|
path: ROUTE_ROOTS,
|
|
6194
|
-
handler:
|
|
6233
|
+
handler: guarded(handleRoots),
|
|
6195
6234
|
}))
|
|
6196
6235
|
scoped.effect(() => scoped.webServer.register({
|
|
6197
6236
|
kind: 'exact',
|
|
6198
6237
|
path: ROUTE_FEEDBACK,
|
|
6199
|
-
handler:
|
|
6238
|
+
handler: guarded(handleFeedback),
|
|
6200
6239
|
}))
|
|
6201
6240
|
// 0.3.76:会话投影缓存守卫(GET 只读扫描 / POST scan|sweep|clear|busy)
|
|
6202
6241
|
scoped.effect(() => scoped.webServer.register({
|
|
6203
6242
|
kind: 'exact',
|
|
6204
6243
|
path: ROUTE_CACHE_GUARD,
|
|
6205
|
-
handler:
|
|
6244
|
+
handler: guarded(handleCacheGuard),
|
|
6206
6245
|
}))
|
|
6207
6246
|
// 0.3.76:工作区显示状态卡片
|
|
6208
6247
|
scoped.effect(() => scoped.webServer.register({
|
|
6209
6248
|
kind: 'exact',
|
|
6210
6249
|
path: ROUTE_WORKSPACE_VIEW,
|
|
6211
|
-
handler:
|
|
6250
|
+
handler: guarded(handleWorkspaceView),
|
|
6212
6251
|
}))
|
|
6213
6252
|
// 0.4.0:WebDAV 通道(连通性测试 / 立即上传 / 立即下载 / 保存设置)
|
|
6214
6253
|
scoped.effect(() => scoped.webServer.register({
|
|
6215
6254
|
kind: 'exact',
|
|
6216
6255
|
path: ROUTE_WEBDAV,
|
|
6217
|
-
handler:
|
|
6256
|
+
handler: guarded(handleWebdav),
|
|
6218
6257
|
}))
|
|
6219
6258
|
})
|
|
6220
6259
|
// 开关打开才排一次启动检查(默认关 = 什么都不做)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-profile-config-sync",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.45",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "DeepSeek Harness 客户端的多端配置备份、同步与还原插件:把本机配置按 12 组内容抓取成 Git 仓库快照(profile、全局提示、Skills、Agent 预设、插件设置与工作流、插件数据、工作区、会话记录等),可推送到 GitHub / Gitee / GitLab 或上传 WebDAV;换机重装后一条命令拉回并铺开,误改可选档回滚。同步动作在客户端退出后执行(PowerShell on Windows,Node 引擎 on macOS / Linux),面板与文案跟随客户端语言。",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -32,11 +32,12 @@
|
|
|
32
32
|
"dsh-config"
|
|
33
33
|
],
|
|
34
34
|
"engines": {
|
|
35
|
-
"node": ">=22"
|
|
35
|
+
"node": ">=22",
|
|
36
|
+
"dsh": ">=0.2.2-rc.5"
|
|
36
37
|
},
|
|
37
38
|
"dsh": {
|
|
38
39
|
"engines": {
|
|
39
|
-
"dsh": ">=0.2.2-rc.
|
|
40
|
+
"dsh": ">=0.2.2-rc.5"
|
|
40
41
|
},
|
|
41
42
|
"bundle": {
|
|
42
43
|
"patch": "./cordis.patch.yml"
|
|
@@ -65,4 +66,4 @@
|
|
|
65
66
|
"check": "node --check index.js && node --check client.js",
|
|
66
67
|
"verify": "node tools/selftest.mjs && node tools/clientcheck.mjs"
|
|
67
68
|
}
|
|
68
|
-
}
|
|
69
|
+
}
|