dsh-config-sync-plugin 0.4.21 → 0.4.22
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 +4 -0
- package/README.md +8 -4
- package/package.json +1 -1
- package/runtime/apply.ps1 +34 -0
package/README.en.md
CHANGED
|
@@ -257,6 +257,10 @@ 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
|
+
### 0.4.22 (2026-11-28)
|
|
261
|
+
|
|
262
|
+
- **Cross-machine default-workspace convergence**: fixes "after pulling on the other machine, the registry contains two default-workspace entries, one a ghost pointing to C:\Users\...\Documents\deepseek-harness\default-workspace which does not exist locally, with its 2 sessions having no landing directory". Legacy repo snapshots carry the default-workspace entry expanded from the obsolete `{{ROOT:userHome}}` token; when the local Documents folder is redirected (e.g. `D:\Backup\Documents\...`) the two paths differ, so the existing same-path convergence misses it. apply now merges the repo entry's session id sets into the local default-workspace entry by slot/title semantics and drops the ghost; the repo entry is kept when the machine has no default-workspace entry yet (first migration unaffected). After upgrading, click "Pull now" once and the ghost entry disappears automatically.
|
|
263
|
+
|
|
260
264
|
### 0.4.21 (2026-11-27)
|
|
261
265
|
|
|
262
266
|
- Fix plugin update installation: 0.4.20 switched to pnpm publish, whose repacked tarball has a top-level <name>/ directory instead of npm's standard package/. The installer only accepted package/ and failed with 'unexpected package structure'. The updater now accepts both layouts (post-exit / install-plugin / apply extraction points).
|
package/README.md
CHANGED
|
@@ -277,10 +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.
|
|
281
|
-
|
|
282
|
-
-
|
|
283
|
-
|
|
280
|
+
### 0.4.22(2026-11-28)
|
|
281
|
+
|
|
282
|
+
- **默认工作区跨机收敛**:修复「另一台机器拉取后登记表里出现两个 default-workspace(幽灵条目指向本机不存在的 C:\Users\... 路径,其 2 个会话没有落点目录)」。老仓库快照里 default-workspace 条目带着已废弃的 `{{ROOT:userHome}}` 展开产物,而本机 Documents 重定向后默认工作区实际在别处(如 `D:\Backup\Documents\...`),两条 path 不同 → 原有的同路径收敛认不出来。apply 现按 slot/title=default-workspace 语义把仓库条目的三组会话 id 并入本机默认工作区条目后丢弃仓库条目;本机没有默认工作区条目时保留仓库条目(首次迁移不受影响)。升级后重新点「立即拉取」即自动收敛,幽灵条目消失、默认工作区会话数变为「本机 + 仓库」之和。
|
|
283
|
+
|
|
284
|
+
### 0.4.21(2026-11-27)
|
|
285
|
+
|
|
286
|
+
- 修复插件更新安装失败:0.4.20 起改用 pnpm publish 发包,npm 兜底源下到的包顶层是「包名/」目录,旧安装器只认 npm 标准的「package/」,报「安装包结构不对」。更新器现兼容两种结构(post-exit / install-plugin / apply 三处解包点)。
|
|
287
|
+
|
|
284
288
|
### 拉取崩溃修复:int+字符串拼接改 -f 格式化(0.4.20)
|
|
285
289
|
|
|
286
290
|
本版修复 0.4.19 在另一台机器上拉取崩溃、随后自动回滚导致「拉取成功但工作区/会话是空的」的问题:
|
package/package.json
CHANGED
package/runtime/apply.ps1
CHANGED
|
@@ -351,6 +351,40 @@ function Sync-WorkspaceApply {
|
|
|
351
351
|
$localTable.Remove($other)
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
|
+
# 默认工作区跨机收敛(0.4.22):老仓库快照里 default-workspace 条目可能带着
|
|
355
|
+
# 已废弃的 {{ROOT:userHome}} 展开产物(如 C:\Users\<user>\Documents\...),而本机
|
|
356
|
+
# Documents 重定向后默认工作区实际在别处(如 D:\Backup\Documents\...)。两条 path
|
|
357
|
+
# 不同 → 上面的同路径收敛认不出来 → 本机出现两个「default-workspace」,其中一条
|
|
358
|
+
# 指向本机不存在的目录(幽灵条目,会话落点也缺失)。这里按 slot/title=default-workspace
|
|
359
|
+
# 语义收敛:仓库条目并入本机已有的默认工作区条目后丢弃;本机没有任何
|
|
360
|
+
# default-workspace 条目时保留仓库条目(首次迁移场景)。
|
|
361
|
+
$isDefaultWsPath = {
|
|
362
|
+
param($p)
|
|
363
|
+
if (-not $p) { return $false }
|
|
364
|
+
$leaf = ($p -replace '/', '\').TrimEnd('\') -split '\\' | Select-Object -Last 1
|
|
365
|
+
return ([string]$leaf -ieq 'default-workspace')
|
|
366
|
+
}
|
|
367
|
+
$repoDefaultIds = @()
|
|
368
|
+
foreach ($e in $plan) {
|
|
369
|
+
if (([string]$e.Slot -ieq 'default-workspace') -or ([string]$e.Title -ieq 'default-workspace')) { $repoDefaultIds += $e.Id }
|
|
370
|
+
}
|
|
371
|
+
$localDefaultCands = @()
|
|
372
|
+
foreach ($id in @($localTable.Keys)) {
|
|
373
|
+
if ($localIdSet.ContainsKey([string]$id) -and (& $isDefaultWsPath ([string]$localTable[$id]['path'])) -and -not $mfIdSet.ContainsKey([string]$id)) {
|
|
374
|
+
$localDefaultCands += [string]$id
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
foreach ($rid in $repoDefaultIds) {
|
|
378
|
+
if (-not $localTable.Contains($rid)) { continue }
|
|
379
|
+
$target = @($localDefaultCands | Where-Object { $_ -ne $rid }) | Select-Object -First 1
|
|
380
|
+
if (-not $target) { continue } # 本机没有自己的默认工作区 → 保留仓库条目(首次迁移)
|
|
381
|
+
$localTable[$target]['sessionIds'] = @(@($localTable[$target]['sessionIds']) + @($localTable[$rid]['sessionIds']) | Where-Object { $_ -ne '' } | Sort-Object -Unique)
|
|
382
|
+
$localTable[$target]['archivedSessionIds'] = @(@($localTable[$target]['archivedSessionIds']) + @($localTable[$rid]['archivedSessionIds']) | Where-Object { $_ -ne '' } | Sort-Object -Unique)
|
|
383
|
+
$localTable[$target]['pinnedSessionIds'] = @(@($localTable[$target]['pinnedSessionIds']) + @($localTable[$rid]['pinnedSessionIds']) | Where-Object { $_ -ne '' } | Sort-Object -Unique)
|
|
384
|
+
Warn ('默认工作区跨机收敛:仓库条目 {0}(path {1},本机不存在)已并入本机默认工作区 {2}(path {3}),丢弃仓库条目' -f $rid, $localTable[$rid]['path'], $target, $localTable[$target]['path'])
|
|
385
|
+
$dropped[$rid] = $true
|
|
386
|
+
$localTable.Remove($rid)
|
|
387
|
+
}
|
|
354
388
|
$ids = @($localTable.Keys | ForEach-Object { [string]$_ } | Where-Object { -not $dropped.ContainsKey($_) })
|
|
355
389
|
$mfDefault = if ($mf.global) { [string]$mf.global.defaultWorkspaceId } else { '' }
|
|
356
390
|
$localDefault = if ($localGlobal.Contains('defaultWorkspaceId')) { [string]$localGlobal['defaultWorkspaceId'] } else { '' }
|