dsh-config-sync-plugin 0.4.17 → 0.4.18
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 +24 -16
- package/README.md +8 -0
- package/package.json +1 -1
- package/runtime/sync.ps1 +32 -10
- package/tools/selftest.mjs +53 -48
package/README.en.md
CHANGED
|
@@ -257,22 +257,30 @@ Two display fixes on top of 0.3.77:
|
|
|
257
257
|
|
|
258
258
|
The "Plugin update" card now shows an **npm download URL** line with the actual fallback addresses (domestic mirror `registry.npmmirror.com` + official `registry.npmjs.org`). When the GitHub release download is unreachable (common in mainland China), the update package automatically falls back to npm. It is still verified against the authoritative sha256 in `version.json` — switching source never relaxes verification. The two sources back each other up: the mirror can briefly 404 during its first-sync window, and the official source takes over. The npm tarball is byte-identical to the GitHub release tgz (same sha256).
|
|
259
259
|
|
|
260
|
-
###
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
- **
|
|
265
|
-
- **
|
|
266
|
-
- **
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
- **
|
|
274
|
-
- **
|
|
275
|
-
|
|
260
|
+
### Fix over-strict pull preflight (0.4.18)
|
|
261
|
+
|
|
262
|
+
This release fixes the 0.4.17 preflight false-failure that rolled back pulls on the target machine:
|
|
263
|
+
|
|
264
|
+
- **link archive false-missing**: preflight only looked for `.tgz` archives, but `dsh-our-free-model-2.8.0` / `dsh-purge-1.4.0` are `.zip` in the repo. Archives existed but were reported missing, blocking the pull. Now accepts both `.tgz` and `.zip`, matching apply's extraction.
|
|
265
|
+
- **workspaceHome false-fail**: on a fresh machine the workspace root does not exist yet — normal, apply creates it. Now auto-creates the directory and uses the default `~/Documents/deepseek-harness` when unset, instead of blocking.
|
|
266
|
+
- **Effect**: first pull on the second machine no longer fails preflight and rolls back; workspace and sessions land normally.
|
|
267
|
+
|
|
268
|
+
### Pull landing hardening: usable right after pull on a second machine (0.4.17)
|
|
269
|
+
|
|
270
|
+
Fixes "workspace and conversations both empty after pulling sync on another machine":
|
|
271
|
+
|
|
272
|
+
- **Root cause**: workspace/conversations groups could be unchecked; unconfirmed local roots, missing `link:` plugin directories or unresolved bundles made apply exit mid-way or DSH read an empty registry; an unresolved bundle also made the script exit non-zero and triggered post-exit rollback, wiping already-landed data.
|
|
273
|
+
- **Preflight**: before apply, pull checks the workspace/conversations groups, `-SkipWorkspace`, local appRoot/workspaceHome and `link:` plugin targets; missing prerequisites produce a clear diagnosis in sync-notices.json instead of a silent empty result.
|
|
274
|
+
- **No rollback**: unresolved bundles now record a notice and continue instead of Die, so landed workspace/session data is kept; `-ForceBundles` keeps the strict check.
|
|
275
|
+
- **Landing verification**: after apply, verify non-empty `workspaceIds`, a non-dangling default workspace, no duplicate paths, session directories restored, no leftover projcache tokens and complete `link:` plugins; result goes to `pull-landing-check.json`.
|
|
276
|
+
- **Required groups**: workspace files and conversations join profile as required sync groups and cannot be unchecked in the panel.
|
|
277
|
+
### Fix cross-machine pull bundle resolution failure (0.4.16)
|
|
278
|
+
|
|
279
|
+
This release fixes `cannot resolve profile bundle "dsh-config-sync-plugin"` on the target machine after pulling config:
|
|
280
|
+
|
|
281
|
+
- **Root cause**: locally `dsh-config-sync-plugin` is a `link:` dev dependency; capture wrote `link:{{APP_ROOT}}/dsh-config-sync-plugin-xxx` into the repo. The target machine has no such source dir and no matching archive in `local-plugins`, so pnpm install fails and bundle resolution fails at startup.
|
|
282
|
+
- **Fix**: capture normalizes the link dependency to an npm version (reads the installed plugin's real version); apply backfills leftover `link:` in old repos (both package.json and pnpm-lock.yaml), so pnpm install works from registry and DSH starts normally.
|
|
283
|
+
|
|
276
284
|
### MCP connector sync fix (0.4.15)
|
|
277
285
|
|
|
278
286
|
This release fixes the MCP connector sync failures caused by missing group in PowerShell runtime scripts:
|
package/README.md
CHANGED
|
@@ -277,6 +277,14 @@ pwsh -File runtime\sync.ps1 pull `
|
|
|
277
277
|
|
|
278
278
|
「插件更新」卡新增一行 **npm 下载路径**,直接显示实际兜底地址(国内镜像 `registry.npmmirror.com` + 官方 `registry.npmjs.org` 两个源)。GitHub release 整段不通时(国内常见),更新包会自动兜底从 npm 下载;仍按 `version.json` 里的权威 sha256 校验,换源不放宽校验。两个源互为备份:镜像首发同步窗口期会短暂 404,官方源随即兜上。实测 npm tarball 与 GitHub release tgz 是同一份产物、sha256 完全一致。
|
|
279
279
|
|
|
280
|
+
### 修复拉取前置检查过严(0.4.18)
|
|
281
|
+
|
|
282
|
+
本版修复 0.4.17 新增的拉取前置检查在目标机误报失败、导致拉取被回滚的问题:
|
|
283
|
+
|
|
284
|
+
- **link 归档误报**:前置检查只找 `.tgz` 归档,但仓库里 `dsh-our-free-model-2.8.0` / `dsh-purge-1.4.0` 实际是 `.zip`。明明归档存在却报「缺失」,直接拦死拉取。本版改为同时认 `.tgz` 与 `.zip`,与 apply 的解压逻辑一致。
|
|
285
|
+
- **workspaceHome 误判**:全新机器首次拉取时工作区资料根还不存在是正常的(apply 落地时会自动建)。本版改为目录不存在就自动补建、路径未确认就用默认 `~/Documents/deepseek-harness`,不再因此拦死拉取。
|
|
286
|
+
- **效果**:目标机首次拉取不再因前置检查失败而回滚,工作区与会话能正常落地。
|
|
287
|
+
|
|
280
288
|
### 拉取落地加固:另一台机器拉取即可用(0.4.17)
|
|
281
289
|
|
|
282
290
|
本版修复「另一台机器拉取同步后,左侧工作区与会话同时为空」的问题:
|
package/package.json
CHANGED
package/runtime/sync.ps1
CHANGED
|
@@ -86,14 +86,29 @@ function Test-PullPreflight {
|
|
|
86
86
|
Add-SyncNotice -Kind 'landing' -Path 'switch/SkipWorkspace' -Reason '本次带了 -SkipWorkspace,会整段跳过工作区与会话。'
|
|
87
87
|
$fail += '-SkipWorkspace'
|
|
88
88
|
}
|
|
89
|
-
# 2) 根路径:
|
|
89
|
+
# 2) 根路径:
|
|
90
|
+
# appRoot —— DSH 安装目录,开头 Resolve-DshAppRoot 已确认,这里再挡一道(必须存在)。
|
|
91
|
+
# workspaceHome —— 工作区资料根,全新机器第一次拉取时还不存在是正常的:apply 铺资料时会
|
|
92
|
+
# 自动建目录。所以"目录不存在"不拦,只有"根本没确认出路径值"才给提示,
|
|
93
|
+
# 而且也不拦拉取(否则 B 机永远卡在第一次拉取,工作区一个都落不了地)。
|
|
90
94
|
$roots = Get-SyncRoots $DshHome $AppRoot $WorkspaceHome
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
$rvApp = [string]$roots.appRoot
|
|
96
|
+
if (-not $rvApp -or -not (Test-Path -LiteralPath $rvApp)) {
|
|
97
|
+
Add-SyncNotice -Kind 'landing' -Path 'roots/appRoot' -Reason ("本机 appRoot 未确认或目录不存在:" + $rvApp + "。")
|
|
98
|
+
$fail += 'appRoot 未确认'
|
|
99
|
+
}
|
|
100
|
+
$rvWs = [string]$roots.workspaceHome
|
|
101
|
+
if (-not $rvWs) {
|
|
102
|
+
# 没有工作区根值时给个可自动落地默认值,并写回 roots 供后续 capture 归一使用
|
|
103
|
+
$rvWs = Join-Path $env:USERPROFILE 'Documents\deepseek-harness'
|
|
104
|
+
$roots.workspaceHome = $rvWs
|
|
105
|
+
Save-SyncRoots $DshHome $roots
|
|
106
|
+
Warn ("workspaceHome 未确认,已用默认值:$rvWs(目录会在拉取落地时自动建)")
|
|
107
|
+
}
|
|
108
|
+
if (-not (Test-Path -LiteralPath $rvWs)) {
|
|
109
|
+
# 目录尚不存在:直接补建,不当成失败条件
|
|
110
|
+
try { New-Item -ItemType Directory -Path $rvWs -Force | Out-Null; Ok "已补建 workspaceHome 目录:$rvWs" }
|
|
111
|
+
catch { Warn "补建 workspaceHome 失败(不拦拉取):$rvWs — $($_.Exception.Message)" }
|
|
97
112
|
}
|
|
98
113
|
if (@($roots.confirmed).Count -eq 0) {
|
|
99
114
|
Add-SyncNotice -Kind 'landing' -Path 'config-sync-roots.json' -Reason 'confirmed 为空,请在面板确认本机路径。'
|
|
@@ -108,10 +123,17 @@ function Test-PullPreflight {
|
|
|
108
123
|
if ($v -like 'link:*' -and $nm -ne 'dsh-config-sync-plugin') {
|
|
109
124
|
$leaf = [IO.Path]::GetFileName(($v -replace '^link:', ''))
|
|
110
125
|
if ($leaf -and -not (Test-Path -LiteralPath (Join-Path ([string]$roots.appRoot) $leaf))) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
126
|
+
# apply.ps1 的 local-plugins 解压同时认 .tgz 与 .zip(见 apply.ps1:1371-1445),
|
|
127
|
+
# 前置检查必须一致:两种归档任一存在就算齐备。旧版只查 .tgz,把仓库里实际存在的
|
|
128
|
+
# dsh-our-free-model-2.8.0.zip / dsh-purge-1.4.0.zip 误报成缺失,直接拦死拉取。
|
|
129
|
+
$archTgz = Join-Path $RepoRoot ("local-plugins\" + $leaf + ".tgz")
|
|
130
|
+
$archZip = Join-Path $RepoRoot ("local-plugins\" + $leaf + ".zip")
|
|
131
|
+
$hasArch = (Test-Path -LiteralPath $archTgz) -or (Test-Path -LiteralPath $archZip)
|
|
132
|
+
if (-not $hasArch) {
|
|
133
|
+
Add-SyncNotice -Kind 'landing' -Path $nm -Reason ("link 目标 " + $leaf + " 不在 AppRoot 下、仓库也无 .tgz/.zip 归档,pnpm install 会失败。")
|
|
114
134
|
$fail += ("link:" + $leaf + " 缺失")
|
|
135
|
+
} else {
|
|
136
|
+
Ok ("link 目标 " + $leaf + " 本地目录缺失,但仓库有归档,apply 会解压部署")
|
|
115
137
|
}
|
|
116
138
|
}
|
|
117
139
|
}
|
package/tools/selftest.mjs
CHANGED
|
@@ -2066,53 +2066,58 @@ console.log('== 0.4.10:拉取不再因本机/契约版本不一致而阻断 ==
|
|
|
2066
2066
|
!/版本不一致(本机 \$\{version\.local\}/.test(cliSrc)
|
|
2067
2067
|
&& cliSrc.includes("metric(M('本机 / 契约', 'App / contract'), versionText, 'ok')"), 'client.js 去告警')
|
|
2068
2068
|
}
|
|
2069
|
-
console.log('')
|
|
2070
|
-
console.log('== 0.4.17:拉取落地加固(前置检查 + 自愈 + 落地验证)==')
|
|
2071
|
-
{
|
|
2072
|
-
const syncS = readFileSync(join(pluginRootSelf, 'runtime', 'sync.ps1'), 'utf8')
|
|
2073
|
-
const comS = readFileSync(join(pluginRootSelf, 'runtime', 'dsh-sync-common.ps1'), 'utf8')
|
|
2074
|
-
const appS = readFileSync(join(pluginRootSelf, 'runtime', 'apply.ps1'), 'utf8')
|
|
2075
|
-
const idxS = readFileSync(join(pluginRootSelf, 'index.js'), 'utf8')
|
|
2076
|
-
const cliS = readFileSync(join(pluginRootSelf, 'client.js'), 'utf8')
|
|
2077
|
-
|
|
2078
|
-
// 必需组扩到三项(ps1 / 宿主 / 面板三处联动)
|
|
2079
|
-
check('必需组含 profile/workspace/conversations(ps1 侧)',
|
|
2080
|
-
/\$SyncRequiredGroups\s*=\s*@\('profile'\s*,\s*'workspace'\s*,\s*'conversations'\)/.test(comS), 'dsh-sync-common.ps1')
|
|
2081
|
-
check('必需组含三项(宿主侧 SCOPE_REQUIRED_GROUPS)',
|
|
2082
|
-
/const SCOPE_REQUIRED_GROUPS\s*=\s*\['profile'\s*,\s*'workspace'\s*,\s*'conversations'\]/.test(idxS), 'index.js')
|
|
2083
|
-
check('工作区/会话组在面板标 required(不可取消)',
|
|
2084
|
-
(idxS.match(/required: true/g) || []).length >= 3 && cliS.includes('g.required === true'), 'index.js/client.js')
|
|
2085
|
-
|
|
2086
|
-
// 前置检查:sync.ps1 在 Initialize-RepoIfNeeded 之后、apply 之前调用
|
|
2087
|
-
check('sync.ps1 pull 调 Test-PullPreflight(repo 初始化后、apply 前)',
|
|
2088
|
-
appS !== '' && syncS.includes('function Test-PullPreflight')
|
|
2089
|
-
&& syncS.lastIndexOf('Test-PullPreflight') > syncS.indexOf('Initialize-RepoIfNeeded')
|
|
2090
|
-
&& syncS.lastIndexOf('Test-PullPreflight') < syncS.lastIndexOf("& (Join-Path $PSScriptRoot 'apply.ps1')"), 'sync.ps1')
|
|
2091
|
-
check('前置检查覆盖 scope/root/link 三类',
|
|
2092
|
-
syncS.includes("Test-SyncGroupEnabled $scopeNow $g") && syncS.includes("@('workspace', 'conversations')")
|
|
2093
|
-
&& syncS.includes('Get-SyncRoots') && syncS.includes("link:*"), 'sync.ps1')
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
&&
|
|
2099
|
-
|
|
2100
|
-
//
|
|
2101
|
-
check('
|
|
2102
|
-
appS.includes('
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
check('
|
|
2107
|
-
appS.includes('
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
check('
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2069
|
+
console.log('')
|
|
2070
|
+
console.log('== 0.4.17:拉取落地加固(前置检查 + 自愈 + 落地验证)==')
|
|
2071
|
+
{
|
|
2072
|
+
const syncS = readFileSync(join(pluginRootSelf, 'runtime', 'sync.ps1'), 'utf8')
|
|
2073
|
+
const comS = readFileSync(join(pluginRootSelf, 'runtime', 'dsh-sync-common.ps1'), 'utf8')
|
|
2074
|
+
const appS = readFileSync(join(pluginRootSelf, 'runtime', 'apply.ps1'), 'utf8')
|
|
2075
|
+
const idxS = readFileSync(join(pluginRootSelf, 'index.js'), 'utf8')
|
|
2076
|
+
const cliS = readFileSync(join(pluginRootSelf, 'client.js'), 'utf8')
|
|
2077
|
+
|
|
2078
|
+
// 必需组扩到三项(ps1 / 宿主 / 面板三处联动)
|
|
2079
|
+
check('必需组含 profile/workspace/conversations(ps1 侧)',
|
|
2080
|
+
/\$SyncRequiredGroups\s*=\s*@\('profile'\s*,\s*'workspace'\s*,\s*'conversations'\)/.test(comS), 'dsh-sync-common.ps1')
|
|
2081
|
+
check('必需组含三项(宿主侧 SCOPE_REQUIRED_GROUPS)',
|
|
2082
|
+
/const SCOPE_REQUIRED_GROUPS\s*=\s*\['profile'\s*,\s*'workspace'\s*,\s*'conversations'\]/.test(idxS), 'index.js')
|
|
2083
|
+
check('工作区/会话组在面板标 required(不可取消)',
|
|
2084
|
+
(idxS.match(/required: true/g) || []).length >= 3 && cliS.includes('g.required === true'), 'index.js/client.js')
|
|
2085
|
+
|
|
2086
|
+
// 前置检查:sync.ps1 在 Initialize-RepoIfNeeded 之后、apply 之前调用
|
|
2087
|
+
check('sync.ps1 pull 调 Test-PullPreflight(repo 初始化后、apply 前)',
|
|
2088
|
+
appS !== '' && syncS.includes('function Test-PullPreflight')
|
|
2089
|
+
&& syncS.lastIndexOf('Test-PullPreflight') > syncS.indexOf('Initialize-RepoIfNeeded')
|
|
2090
|
+
&& syncS.lastIndexOf('Test-PullPreflight') < syncS.lastIndexOf("& (Join-Path $PSScriptRoot 'apply.ps1')"), 'sync.ps1')
|
|
2091
|
+
check('前置检查覆盖 scope/root/link 三类',
|
|
2092
|
+
syncS.includes("Test-SyncGroupEnabled $scopeNow $g") && syncS.includes("@('workspace', 'conversations')")
|
|
2093
|
+
&& syncS.includes('Get-SyncRoots') && syncS.includes("link:*"), 'sync.ps1')
|
|
2094
|
+
// 0.4.18:link 归档必须同时认 .tgz/.zip;workspaceHome 目录不存在时补建而非拦死
|
|
2095
|
+
check('前置检查 link 归档同时认 .tgz/.zip(不误报仓库里存在的 .zip)',
|
|
2096
|
+
syncS.includes('$archTgz') && syncS.includes('$archZip') && syncS.includes('$hasArch'), 'sync.ps1')
|
|
2097
|
+
check('前置检查 workspaceHome 缺目录时自动补建而非失败',
|
|
2098
|
+
syncS.includes("已补建 workspaceHome") && syncS.includes("Documents\\deepseek-harness"), 'sync.ps1')
|
|
2099
|
+
|
|
2100
|
+
// bundle 不再 Die/回滚
|
|
2101
|
+
check('bundle 未解析不再 Die(记 notice + 继续落地)',
|
|
2102
|
+
appS.includes('bundle 未全解析,但工作区/会话已落地')
|
|
2103
|
+
&& !/bundle 清单[\s\S]{0,400}已停止,先别启动/.test(appS), 'apply.ps1')
|
|
2104
|
+
|
|
2105
|
+
// 落地验证函数存在且被调用,覆盖 DSH 登记表判据
|
|
2106
|
+
check('apply.ps1 有 Test-PullLanding 且被调用',
|
|
2107
|
+
appS.includes('function Test-PullLanding') && appS.includes('$null = Test-PullLanding'), 'apply.ps1')
|
|
2108
|
+
check('落地验证覆盖 workspaceIds/defaultWorkspaceId/duplicate/session 目录',
|
|
2109
|
+
appS.includes('workspaceIds-empty') && appS.includes('defaultWorkspaceId-dangling')
|
|
2110
|
+
&& appS.includes('duplicate-path') && appS.includes('session-dirs-0'), 'apply.ps1')
|
|
2111
|
+
check('落地验证覆盖 projcache/bundle/link 且写 pull-landing-check.json',
|
|
2112
|
+
appS.includes('projcache-token') && appS.includes('pull-landing-check.json')
|
|
2113
|
+
&& appS.includes('link:$d'), 'apply.ps1')
|
|
2114
|
+
|
|
2115
|
+
// notice 白名单与面板文案同步
|
|
2116
|
+
check('index.js notice KINDS 含 landing',
|
|
2117
|
+
/KINDS = \[[^\]]*'landing'/.test(idxS), 'index.js')
|
|
2118
|
+
check('client.js notice 文案含 landing 标签',
|
|
2119
|
+
cliS.includes("landing: M('落地检查', 'Landing check')"), 'client.js')
|
|
2120
|
+
}
|
|
2121
|
+
|
|
2117
2122
|
process.exit(failures === 0 ? 0 : 1)
|
|
2118
2123
|
|