dsh-config-sync-plugin 0.4.9 → 0.4.10
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 +2 -2
- package/README.en.md.bak-0410 +830 -0
- package/README.md +2 -2
- package/README.md.bak-0410 +822 -0
- package/client.js +3 -11
- package/index.js +6 -4
- package/package.json +1 -1
- package/runtime/apply.ps1 +9 -16
- package/runtime/apply.ps1.bak-0410 +1646 -0
- package/runtime/sync.ps1 +3 -3
- package/runtime/sync.ps1.bak-0410 +1117 -0
- package/tools/selftest.mjs +42 -22
- package/tools/selftest.mjs.bak-0410 +2045 -0
package/client.js
CHANGED
|
@@ -257,15 +257,7 @@ window.__ModuleLoader__.load({
|
|
|
257
257
|
? { kind: 'init', text: M('本机与云端都还没有内容:待「初始化推送」', 'Local repo and cloud are both empty — Initialize push') }
|
|
258
258
|
: { kind: 'pull', text: M('本机仓库还没有内容:待从云端「拉取」', 'Local repo has no content yet — pull it from the cloud') }
|
|
259
259
|
}
|
|
260
|
-
|
|
261
|
-
return {
|
|
262
|
-
kind: 'warn',
|
|
263
|
-
text: M(
|
|
264
|
-
`版本不一致(本机 ${version.local} ≠ 契约 ${version.contract})`,
|
|
265
|
-
`Version mismatch (local ${version.local} ≠ contract ${version.contract})`,
|
|
266
|
-
),
|
|
267
|
-
}
|
|
268
|
-
}
|
|
260
|
+
// 0.4.10 起:本机/契约版本不一致不再算告警——拉取不再因版本不一致被阻断,只保留左上角信息条展示。
|
|
269
261
|
if (repo.behind === null) return { kind: 'idle', text: M('读不到本机 git 状态(git 不可用或没 upstream)', 'Cannot read local git state (git missing or no upstream)') }
|
|
270
262
|
if (repo.dirty > 0) return { kind: 'warn', text: M(`本机有 ${repo.dirty} 处未提交改动,建议推送`, `${repo.dirty} uncommitted change(s) — consider pushing`) }
|
|
271
263
|
if (repo.ahead > 0) return { kind: 'warn', text: M(`本机有 ${repo.ahead} 个提交还没推送`, `${repo.ahead} local commit(s) not pushed yet`) }
|
|
@@ -2638,9 +2630,9 @@ window.__ModuleLoader__.load({
|
|
|
2638
2630
|
)
|
|
2639
2631
|
const versionText = !data ? '…'
|
|
2640
2632
|
: `${data.version.local || '?'} / ${data.version.contract || '?'}`
|
|
2633
|
+
// 0.4.10 起:版本不一致不再标红/标黄(拉取已不因版本差异阻断),信息条仅作展示。
|
|
2641
2634
|
const metrics = h('div', { style: S.strip },
|
|
2642
|
-
metric(M('本机 / 契约', 'App / contract'), versionText,
|
|
2643
|
-
data && data.version.local && data.version.contract && !data.version.match ? 'warn' : 'ok'),
|
|
2635
|
+
metric(M('本机 / 契约', 'App / contract'), versionText, 'ok'),
|
|
2644
2636
|
metric('bundle',
|
|
2645
2637
|
!data ? '…' : (data.bundles.unresolved.length
|
|
2646
2638
|
? M(`缺 ${data.bundles.unresolved.length} / ${data.bundles.total}`, `${data.bundles.unresolved.length} missing / ${data.bundles.total}`)
|
package/index.js
CHANGED
|
@@ -1051,10 +1051,12 @@ async function inspect(config) {
|
|
|
1051
1051
|
`Cannot read the client version (${appRoot ? `${appRoot}\\resources\\app\\package.json or resources\\app.asar` : 'AppRoot not found'})`,
|
|
1052
1052
|
))
|
|
1053
1053
|
}
|
|
1054
|
+
// 0.4.10 起:本机/契约版本不同只是提示信息,不再当作「要处理的问题」——拉取不再因版本不一致被阻断。
|
|
1055
|
+
// version 字段仍带 local/contract/match,仅供面板左上角的「本机 / 契约」信息条展示,不构成待办。
|
|
1054
1056
|
if (localVersion && contractVersion && !versionMatch) {
|
|
1055
1057
|
advice.push(t(
|
|
1056
|
-
|
|
1057
|
-
`
|
|
1058
|
+
`本机与仓库客户端版本不同(本机 ${localVersion},契约 ${contractVersion}):0.4.10 起不影响拉取,配置照常同步(实验性 bundle 会剔除)`,
|
|
1059
|
+
`Local and repo client versions differ (local ${localVersion}, contract ${contractVersion}): since 0.4.10 this no longer blocks pull — configs sync as usual (experimental bundles are dropped).`,
|
|
1058
1060
|
))
|
|
1059
1061
|
}
|
|
1060
1062
|
if (unresolved.length) {
|
|
@@ -2909,8 +2911,8 @@ function writeScope(dshHome, scope) {
|
|
|
2909
2911
|
}
|
|
2910
2912
|
|
|
2911
2913
|
// 必需组:不许取消勾选 —— 因为不勾就会报错,而不是"少同步一点"。
|
|
2912
|
-
// profile 里的 package.json / cordis.patch.yml 是 apply 的前置条件(仓库里缺它们 apply.ps1 直接 Die
|
|
2913
|
-
// host-contract.json
|
|
2914
|
+
// profile 里的 package.json / cordis.patch.yml 是 apply 的前置条件(仓库里缺它们 apply.ps1 直接 Die)。
|
|
2915
|
+
// host-contract.json 自 0.4.10 起只用于「本机/契约」信息条展示,版本不同不再阻断拉取。
|
|
2914
2916
|
const SCOPE_REQUIRED_GROUPS = ['profile']
|
|
2915
2917
|
function scopeGroupRequired(id) { return SCOPE_REQUIRED_GROUPS.includes(id) }
|
|
2916
2918
|
|
package/package.json
CHANGED
package/runtime/apply.ps1
CHANGED
|
@@ -808,14 +808,12 @@ $settingsMap = @(
|
|
|
808
808
|
@{ Repo = 'settings\workspace-archives.json'; Src = (Join-Path $DshHome 'dsh-session-manager\workspace-archives.v1.json'); Label = 'DSH 工作区隐藏状态' }
|
|
809
809
|
)
|
|
810
810
|
|
|
811
|
-
# ---------- 0.5
|
|
812
|
-
#
|
|
813
|
-
#
|
|
814
|
-
#
|
|
815
|
-
#
|
|
816
|
-
#
|
|
817
|
-
# 现在的规则:版本对不上 → 直接拒绝(可显式 -AllowVersionDrift 放行,但实验性 bundle 一律剔除),
|
|
818
|
-
# 拒绝发生在备份、还原、写文件之前。
|
|
811
|
+
# ---------- 0.5 宿主版本契约(只提示、不阻断拉取;0.4.10 起) ----------
|
|
812
|
+
# 0.4.09 及以前:版本对不上直接 Die,pull 必须加 -AllowVersionDrift 才能继续。
|
|
813
|
+
# 0.4.10 起:配置同步拉取不再校验「本机 app / 仓库契约」是否一致——版本不一致只写一条提示,
|
|
814
|
+
# 拉取照常进行(等价于自动带上 -AllowVersionDrift)。版本差异本身不该阻断配置/技能/资料同步。
|
|
815
|
+
# 实验性 bundle(@deepseek-ai/dsh-experimental-*,宿主自带、按版本强绑定)仍按下面的门控剔除,
|
|
816
|
+
# 避免把为别的客户端构建准备的 bundle 铺到本机、启动期 entry loading 崩溃。
|
|
819
817
|
$contractPath = Join-Path $RepoRoot 'profile\host-contract.json'
|
|
820
818
|
$hostAppVersion = Get-HostAppVersion $AppRoot
|
|
821
819
|
$contractVersion = $null
|
|
@@ -824,17 +822,12 @@ if (Test-Path -LiteralPath $contractPath) {
|
|
|
824
822
|
}
|
|
825
823
|
$versionDrift = $false
|
|
826
824
|
if (-not $hostAppVersion) {
|
|
827
|
-
Warn "读不到客户端 app 版本($AppRoot\resources\app\package.json 与 resources\app.asar
|
|
825
|
+
Warn "读不到客户端 app 版本($AppRoot\resources\app\package.json 与 resources\app.asar 都没读到)——跳过版本提示,拉取照常进行"
|
|
828
826
|
} elseif (-not $contractVersion) {
|
|
829
|
-
Warn "仓库缺少 profile\host-contract.json(或里面没有 appVersion
|
|
827
|
+
Warn "仓库缺少 profile\host-contract.json(或里面没有 appVersion)——跳过版本提示,拉取照常进行"
|
|
830
828
|
} elseif ($hostAppVersion -ne $contractVersion) {
|
|
831
829
|
$versionDrift = $true
|
|
832
|
-
Warn "宿主版本不一致:本机 app = $hostAppVersion,仓库契约 = $contractVersion"
|
|
833
|
-
if (-not $AllowVersionDrift) {
|
|
834
|
-
Die ("两端客户端不是同一版,未改动任何文件。请先把两台升到同一版;" +
|
|
835
|
-
"或加 -AllowVersionDrift 只同步配置/技能/资料(会剔除全部实验性 bundle,避免启动期崩溃)。")
|
|
836
|
-
}
|
|
837
|
-
Warn "已加 -AllowVersionDrift:继续同步,但剔除实验性 bundle"
|
|
830
|
+
Warn "宿主版本不一致:本机 app = $hostAppVersion,仓库契约 = $contractVersion —— 0.4.10 起不再阻断拉取,继续同步(实验性 bundle 会剔除)"
|
|
838
831
|
} else {
|
|
839
832
|
Ok "宿主版本一致(app = $hostAppVersion)"
|
|
840
833
|
}
|