dsh-config-sync-plugin 0.3.58 → 0.3.60
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 +1 -1
- package/README.md +1 -1
- package/client.js +1 -1
- package/index.js +4 -4
- package/package.json +1 -1
- package/runtime/apply.ps1 +25 -2
package/README.en.md
CHANGED
|
@@ -19,7 +19,7 @@ The package name is **`dsh-config-sync-plugin`** (the `dsh-config-sync` name on
|
|
|
19
19
|
|
|
20
20
|
| Way | Command / entry | Notes |
|
|
21
21
|
|---|---|---|
|
|
22
|
-
| npm | `npm i dsh-config-sync-plugin` | Use it as a dependency, or add `"dsh-config-sync-plugin": "^0.3.
|
|
22
|
+
| npm | `npm i dsh-config-sync-plugin` | Use it as a dependency, or add `"dsh-config-sync-plugin": "^0.3.60"` to the profile's `package.json` and run `pnpm i`. The name matches the `cordis.patch.yml` insert name and the install folder `dsh-config-sync-plugin-<ver>` |
|
|
23
23
|
| Marketplace | client → Plugins → Discover → “Config Sync” | Installs from the git commit registered in `market-index.json` |
|
|
24
24
|
| Offline tgz | `releases\dsh-config-sync-plugin-<ver>.tgz` | GitHub Release asset for air-gapped machines; the panel's Update button downloads the same file |
|
|
25
25
|
|
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ DSH 插件:左侧栏多一行「配置同步」,点开是整页体检面板
|
|
|
15
15
|
|
|
16
16
|
| 方式 | 命令 / 入口 | 说明 |
|
|
17
17
|
|---|---|---|
|
|
18
|
-
| npm | `npm i dsh-config-sync-plugin` | 适合把它当依赖管理,或在 profile 的 `package.json` 里写 `"dsh-config-sync-plugin": "^0.3.
|
|
18
|
+
| npm | `npm i dsh-config-sync-plugin` | 适合把它当依赖管理,或在 profile 的 `package.json` 里写 `"dsh-config-sync-plugin": "^0.3.60"` 后 `pnpm i`;包名与 `cordis.patch.yml` 里注册的名字、插件目录 `dsh-config-sync-plugin-<ver>` 一致 |
|
|
19
19
|
| 插件市场 | 客户端「插件市场 → 发现」搜「配置同步」 | 走 `market-index.json` 登记的 git 提交,版本与 README 对齐 |
|
|
20
20
|
| 离线 tgz | `releases\dsh-config-sync-plugin-<ver>.tgz` | GitHub Release 附件,适合内网机器;面板「更新」按钮下载的也是它 |
|
|
21
21
|
|
package/client.js
CHANGED
|
@@ -921,7 +921,7 @@ window.__ModuleLoader__.load({
|
|
|
921
921
|
}
|
|
922
922
|
// 「手动还原」指引里的目标位置:认不出类型时按内容猜不到,索性把三类常见落点都摆出来
|
|
923
923
|
const manualTargets = () => [
|
|
924
|
-
M('插件本体 → 插件安装目录(如 D:\\DeepSeekHarness\\dsh-config-sync-plugin-0.3.
|
|
924
|
+
M('插件本体 → 插件安装目录(如 D:\\DeepSeekHarness\\dsh-config-sync-plugin-0.3.60)', 'Plugin files → the plugin install folder (e.g. D:\\DeepSeekHarness\\dsh-config-sync-plugin-0.3.60)'),
|
|
925
925
|
M('会话目录(--xxx--)→ ~\\.dsh\\sessions', 'Session folders (--xxx--) → ~\\.dsh\\sessions'),
|
|
926
926
|
M('配置五件套(package.json / pnpm-lock.yaml / cordis.yml…)→ ~\\.dsh\\profiles\\desktop', 'Config files (package.json / pnpm-lock.yaml / cordis.yml…) → ~\\.dsh\\profiles\\desktop'),
|
|
927
927
|
]
|
package/index.js
CHANGED
|
@@ -976,9 +976,9 @@ async function inspect(config) {
|
|
|
976
976
|
const remoteFiles = remoteProbe ? remoteProbe.files : null
|
|
977
977
|
if (!appRoot) {
|
|
978
978
|
advice.push(t(
|
|
979
|
-
'定位不到客户端根目录:插件不在 <客户端根> 下(如 D:\\DeepSeekHarness\\dsh-config-sync-plugin-0.3.
|
|
979
|
+
'定位不到客户端根目录:插件不在 <客户端根> 下(如 D:\\DeepSeekHarness\\dsh-config-sync-plugin-0.3.60),'
|
|
980
980
|
+ '或客户端是打包版(resources\\app.asar)而这里没认出来 —— 三份同步脚本会因此生成不了',
|
|
981
|
-
'Cannot locate the client root: the plugin is not under <client root> (e.g. D:\\DeepSeekHarness\\dsh-config-sync-plugin-0.3.
|
|
981
|
+
'Cannot locate the client root: the plugin is not under <client root> (e.g. D:\\DeepSeekHarness\\dsh-config-sync-plugin-0.3.60), '
|
|
982
982
|
+ 'or this is a packaged build (resources\\app.asar) that was not recognized — the three sync scripts cannot be generated.',
|
|
983
983
|
))
|
|
984
984
|
}
|
|
@@ -3477,9 +3477,9 @@ async function handlePrepare(req, res, config) {
|
|
|
3477
3477
|
if (!appRoot) {
|
|
3478
3478
|
throw new Error(t(
|
|
3479
3479
|
'定位不到客户端根目录(要能找到 resources\\app\\package.json 或 resources\\app.asar):'
|
|
3480
|
-
+ '请确认插件装在 <客户端根> 下(例如 D:\\DeepSeekHarness\\dsh-config-sync-plugin-0.3.
|
|
3480
|
+
+ '请确认插件装在 <客户端根> 下(例如 D:\\DeepSeekHarness\\dsh-config-sync-plugin-0.3.60),或在设置里填客户端根 appRoot',
|
|
3481
3481
|
'Cannot locate the client root (needs resources\\app\\package.json or resources\\app.asar): '
|
|
3482
|
-
+ 'make sure the plugin is installed under <client root> (e.g. D:\\DeepSeekHarness\\dsh-config-sync-plugin-0.3.
|
|
3482
|
+
+ 'make sure the plugin is installed under <client root> (e.g. D:\\DeepSeekHarness\\dsh-config-sync-plugin-0.3.60), or set appRoot in the settings',
|
|
3483
3483
|
))
|
|
3484
3484
|
}
|
|
3485
3485
|
const state = {...await repoState(repo), message}
|
package/package.json
CHANGED
package/runtime/apply.ps1
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<#
|
|
1
|
+
<#
|
|
2
2
|
DSH 配置同步 —— 应用脚本(把本仓库的配置还原到当前电脑)
|
|
3
3
|
|
|
4
4
|
用法
|
|
@@ -112,6 +112,21 @@ function Expand-AppRootTree([string]$dir, [string]$rootFwd) {
|
|
|
112
112
|
|
|
113
113
|
function Sync-WorkspaceApply {
|
|
114
114
|
$wsDir = Join-Path $RepoRoot 'workspace'
|
|
115
|
+
# 登记表 sessionIds 常常滞后于实际会话目录(会话是后来新建的、capture 只抄了当时的快照)。
|
|
116
|
+
# DSH 归属权威就是这里的 sessionIds 成员:没登记的会话即便 cwd 改对也不会挂到工作区。
|
|
117
|
+
# 按 conversations\sessions\--ws-<workspaceId>--\<sessionId>\ 反推补齐,与会话还原段同源。
|
|
118
|
+
$sidByWsDir = @{}
|
|
119
|
+
$convSessionsDir = Join-Path $RepoRoot 'conversations\sessions'
|
|
120
|
+
if (Test-Path -LiteralPath $convSessionsDir) {
|
|
121
|
+
foreach ($wd in @(Get-ChildItem -LiteralPath $convSessionsDir -Directory -Force)) {
|
|
122
|
+
if ($wd.Name -notmatch '^--ws-(?<id>.+)--$') { continue }
|
|
123
|
+
$wid = $Matches['id']
|
|
124
|
+
if (-not $sidByWsDir.ContainsKey($wid)) { $sidByWsDir[$wid] = @() }
|
|
125
|
+
foreach ($sd in @(Get-ChildItem -LiteralPath $wd.FullName -Directory -Force)) {
|
|
126
|
+
$sidByWsDir[$wid] += [string]$sd.Name
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
115
130
|
$manifestPath = Join-Path $wsDir 'workspace-registry.json'
|
|
116
131
|
if (-not (Test-Path -LiteralPath $manifestPath)) {
|
|
117
132
|
Warn ('仓库里没有 {0},跳过工作区还原(仓库里没有工作区资料)' -f $manifestPath)
|
|
@@ -258,6 +273,11 @@ function Sync-WorkspaceApply {
|
|
|
258
273
|
foreach ($e in $plan) {
|
|
259
274
|
# 运行时字段取「仓库 + 本机」并集:既把 A 机历史会话带过来,也不丢 B 机自建会话
|
|
260
275
|
$repoSess = @($e.SessionIds)
|
|
276
|
+
# 补进按会话目录反推出来的 sid(登记表快照里没有的那些),让 DSH 把这些历史会话
|
|
277
|
+
# 显式登记到本工作区;会话组未勾选同步时不补,尊重同步范围选择。
|
|
278
|
+
if ($sidByWsDir.ContainsKey($e.Id) -and (Test-SyncItemEnabled $Scope 'conversations' $e.Id)) {
|
|
279
|
+
$repoSess += @($sidByWsDir[$e.Id])
|
|
280
|
+
}
|
|
261
281
|
$repoArch = @($e.ArchivedSessionIds)
|
|
262
282
|
$repoPin = @($e.PinnedSessionIds)
|
|
263
283
|
$created = $e.CreatedAt; $updated = $e.UpdatedAt
|
|
@@ -820,6 +840,8 @@ if ($dropped.Count -gt 0) { Ok "已剔除 $($dropped.Count) 个实验性 bundle
|
|
|
820
840
|
$localPluginMap = [ordered]@{
|
|
821
841
|
'dsh-our-free-model-2.8.0' = 'dsh-our-free-model'
|
|
822
842
|
'dsh-purge-1.4.0' = 'dsh-purge'
|
|
843
|
+
'dsh-config-sync-plugin-0.3.60' = 'dsh-config-sync-plugin'
|
|
844
|
+
'dsh-config-sync-plugin-0.3.59' = 'dsh-config-sync-plugin'
|
|
823
845
|
'dsh-config-sync-plugin-0.3.58' = 'dsh-config-sync-plugin'
|
|
824
846
|
'dsh-config-sync-plugin-0.3.57' = 'dsh-config-sync-plugin'
|
|
825
847
|
'dsh-config-sync-plugin-0.3.56' = 'dsh-config-sync-plugin'
|
|
@@ -921,7 +943,8 @@ $pendingItems = New-Object System.Collections.ArrayList
|
|
|
921
943
|
$overwriteItems = New-Object System.Collections.ArrayList
|
|
922
944
|
if (Test-SyncGroupEnabled $Scope 'settings') {
|
|
923
945
|
foreach ($m in $settingsMap) {
|
|
924
|
-
if (-not (Test-SyncItemEnabled $Scope 'settings' ($m.Repo -replace '^settings\\', ''))) { continue }
|
|
946
|
+
if (-not (Test-SyncItemEnabled $Scope 'settings' ($m.Repo -replace '^settings\\', ''))) { continue }
|
|
947
|
+
if ($m.Repo -eq 'settings\dsh-workspaces.json' -and (Test-SyncGroupEnabled $Scope 'workspace')) { continue } # workspace registry merged by Sync-WorkspaceApply; do not overwrite with stale repo snapshot
|
|
925
948
|
$srcRepo = Join-Path $RepoRoot $m.Repo
|
|
926
949
|
if (-not (Test-Path -LiteralPath $srcRepo)) { Warn ("仓库里没有 " + $m.Repo + ",跳过"); continue }
|
|
927
950
|
$txt = [IO.File]::ReadAllText($srcRepo)
|