dsh-config-sync-plugin 0.3.74 → 0.3.75
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 +8 -1
- package/README.md +8 -1
- package/client.js +2 -2
- package/index.js +8 -8
- package/package.json +1 -1
- package/runtime/apply.ps1 +6 -4
- package/runtime/capture.ps1 +2 -1
- package/tools/selftest.mjs +4 -0
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.75"` 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
|
|
|
@@ -216,6 +216,12 @@ So "the original machine's location becomes this machine's location" is inferred
|
|
|
216
216
|
|
|
217
217
|
The report produced on push is split into two groups: `scope: config` for paths inside config files, `scope: data` for records under `workspace\` and `conversations\` that still point at the other machine. The panel lists them separately ("Paths inside config files" / "Paths in workspace / session records"), and both can be accepted row by row.
|
|
218
218
|
|
|
219
|
+
### Hidden/archived workspaces no longer reappear on the other machine (0.3.75)
|
|
220
|
+
|
|
221
|
+
Workspaces and sessions you hide/archive from the config-sync panel used to show up again on machine B after a pull. Cause: DSH stores that state separately in `<DshHome>\dsh-session-manager\workspace-archives.v1.json` (`archived:true` plus the related `sessionIds`), which was never part of the sync set; the workspace registry is merged by ID (union), so a locally hidden record gets merged back in.
|
|
222
|
+
|
|
223
|
+
Since 0.3.75 this file is part of the `settings` sync: a push writes it to the repo as `settings\workspace-archives.json`, and a pull restores it to the same path on B. When B starts, DSH reads `archived:true` workspaces and filters them out of the workspace list; their sessions move to the archived group and stop showing. This is whole-file replace semantics — machine A is authoritative. Hiding is not deletion: the workspace/session files remain and can be restored by un-hiding in DSH.
|
|
224
|
+
|
|
219
225
|
## New sessions land in the default workspace (since 0.3.28)
|
|
220
226
|
|
|
221
227
|
A finished sync brings DSH back up, and the client opens a fresh session on startup. Where that session lands is decided by `global.defaultWorkspaceId` in `<DshHome>\storages\workspace.json` — and DSH writes that value only during **first-time initialization**, so after a few syncs it can be left pointing at whatever workspace was used last.
|
|
@@ -576,6 +582,7 @@ The log shows which path ran: `文件比较(快筛):比对 N 个,深哈
|
|
|
576
582
|
|
|
577
583
|
| Date | Version | Summary |
|
|
578
584
|
|---|---|---|
|
|
585
|
+
| 2026-11-21 | 0.3.75 | Sync hidden/archived workspaces across machines (workspace-archives.v1.json into settings); hidden workspaces and sessions stay hidden on B after pull |
|
|
579
586
|
| 2026-11-19 | 0.3.69 | Carry billion-context compaction state across machines (bili-state.mjs); two new notice kinds (plugin-missing / context-state) |
|
|
580
587
|
| 2026-11-19 | 0.3.68 | Session projection-cache guard (fixes agent-busy session creation) |
|
|
581
588
|
| 2026-11-19 | 0.3.67 | Session log seq reconciliation guard (merge by seq, no more whole-file overwrite) |
|
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.75"` 后 `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
|
|
|
@@ -236,6 +236,12 @@ pwsh -File runtime\sync.ps1 pull `
|
|
|
236
236
|
|
|
237
237
|
**边界**:默认工作区(`default-workspace`)**不同步**(目录名按各机 `WorkspaceHome` 编码,目标机认不出,只会留下"历史为空"的空工作区);`models/`、`*.whl`、`*.safetensors` 与任何 >100 MB 的文件也不进仓库。
|
|
238
238
|
|
|
239
|
+
### 隐藏/归档的工作区不再带到另一台机显示(0.3.75)
|
|
240
|
+
|
|
241
|
+
在配置同步面板里「隐藏/归档」的工作区与会话,之前推送到 B 机后仍会原样显示。原因:DSH 把隐藏状态单独存在 `<DshHome>\dsh-session-manager\workspace-archives.v1.json`(记录 `archived:true` 与对应 `sessionIds`),这个文件不在同步清单里;工作区登记表又是按 ID 并集合并,本机被隐藏的记录会被并回来。
|
|
242
|
+
|
|
243
|
+
0.3.75 起把这份状态纳入 `settings` 同步:推送时写进仓库 `settings\workspace-archives.json`,拉取时还原到 B 机同名文件。B 机 DSH 启动后读到 `archived:true` 的工作区,会在工作区列表里过滤掉,它名下的会话也一并归到「已归档」,不再显示。整份覆盖语义——A 机的隐藏状态为准;这是「隐藏」不是删除,工作区与会话文件仍在,随时可以在 DSH 里取消隐藏恢复。
|
|
244
|
+
|
|
239
245
|
## 同步后新会话落在默认工作区
|
|
240
246
|
|
|
241
247
|
`<DshHome>\storages\workspace.json` 的 `global.defaultWorkspaceId` 决定新会话落在哪。DSH 只在本机**首次初始化**写过一次,之后同步几轮就可能停在「上次用的工作区」。`post-exit.ps1` 在**客户端完全退出之后、重新拉起之前**把它校正到默认工作区(早写会被客户端退出时的回写盖掉)。
|
|
@@ -558,6 +564,7 @@ pwsh -File sync.ps1 push -ScanHistory
|
|
|
558
564
|
|
|
559
565
|
| 日期 | 版本 | 要点 |
|
|
560
566
|
|---|---|---|
|
|
567
|
+
| 2026-11-21 | 0.3.75 | 隐藏/归档的工作区跨机同步(workspace-archives.v1.json 纳入 settings),B 机拉取后不再显示已隐藏的工作区与会话 |
|
|
561
568
|
| 2026-11-19 | 0.3.69 | 跨机搬运 billion-context 压缩状态(bili-state.mjs);同步清单新增 plugin-missing / context-state 两类提示 |
|
|
562
569
|
| 2026-11-19 | 0.3.68 | 会话投影缓存守卫,治 agent-busy 建会话失败 |
|
|
563
570
|
| 2026-11-19 | 0.3.67 | 会话日志 seq 对账护栏(跨机写同一会话按 seq 求并集,不再整文件覆盖);.gitattributes 钉 binary;capture hoist |
|
package/client.js
CHANGED
|
@@ -3212,7 +3212,7 @@ window.__ModuleLoader__.load({
|
|
|
3212
3212
|
} catch { /* 插件路由还没起好就静默跳过,面板里仍会显示同一结果 */ }
|
|
3213
3213
|
}
|
|
3214
3214
|
|
|
3215
|
-
// ==================== 0.3.
|
|
3215
|
+
// ==================== 0.3.75:会话缓存守卫(客户端半身) ====================
|
|
3216
3216
|
// 宿主侧没法拦 agent-busy(它是 sessionController 内部抛的 RemoteError),
|
|
3217
3217
|
// 所以在这里包一层 sessions.create:撞上就上报、清缓存、去掉旧 sessionId 重试一次。
|
|
3218
3218
|
const BUSY_RE = /session\/agent-busy|is owned by subagent routing/i
|
|
@@ -3309,7 +3309,7 @@ window.__ModuleLoader__.load({
|
|
|
3309
3309
|
// 界面还没完全起来时 fetch 可能扑空,所以稍等一会儿再查;只查一次,不轮询。
|
|
3310
3310
|
try { setTimeout(announceLastResult, 1500) } catch { }
|
|
3311
3311
|
|
|
3312
|
-
// 0.3.
|
|
3312
|
+
// 0.3.75:给客户端的 sessions 服务套上 agent-busy 自愈钩子。
|
|
3313
3313
|
// 拿不到 sessions(老版本宿主 / 服务还没起来)就静默跳过,面板功能不受影响。
|
|
3314
3314
|
try {
|
|
3315
3315
|
if (typeof ctx.get === 'function') {
|
package/index.js
CHANGED
|
@@ -24,7 +24,7 @@ import { closeSync, existsSync, mkdirSync, mkdtempSync, openSync, readdirSync, r
|
|
|
24
24
|
import { homedir, hostname, tmpdir } from 'node:os'
|
|
25
25
|
import { basename, dirname, isAbsolute, join, relative } from 'node:path'
|
|
26
26
|
import { fileURLToPath } from 'node:url'
|
|
27
|
-
// 0.3.
|
|
27
|
+
// 0.3.75:会话投影缓存守卫(agent-busy 自动清缓存,让缓存按日志重建)
|
|
28
28
|
import { runGuard, clearSessionCaches, appendGuardLog } from './runtime/tools/session-cache-guard.mjs'
|
|
29
29
|
|
|
30
30
|
const pluginRequire = createRequire(import.meta.url)
|
|
@@ -39,7 +39,7 @@ const ROUTE_CONFLICT = '/config-sync/conflict'
|
|
|
39
39
|
// 0.3.30:跨机路径确认(每台机器把自己的根目录报给插件一次)与问题反馈(落仓库 feedback\ 再推 GitHub)
|
|
40
40
|
const ROUTE_ROOTS = '/config-sync/roots'
|
|
41
41
|
const ROUTE_FEEDBACK = '/config-sync/feedback'
|
|
42
|
-
// 0.3.
|
|
42
|
+
// 0.3.75:会话投影缓存守卫(GET 只读扫描 / POST scan|sweep|clear|busy)
|
|
43
43
|
const ROUTE_CACHE_GUARD = '/config-sync/cache-guard'
|
|
44
44
|
const SETTINGS_NAME = 'dsh-config-sync.json'
|
|
45
45
|
/** 本插件自己的安装目录(插件根,含 runtime\ 与 index.js)—— 插件备份还原时的目标。 */
|
|
@@ -237,7 +237,7 @@ function readSettings(dshHome) {
|
|
|
237
237
|
// 同步完成重启前把 DSH 的「默认工作区」校正到谁:
|
|
238
238
|
// 留空 = 自动找名字/路径是 default-workspace 的工作区;可填工作区路径或 ID;填 off 关闭。
|
|
239
239
|
defaultWorkspace: typeof raw.defaultWorkspace === 'string' ? raw.defaultWorkspace : '',
|
|
240
|
-
// 0.3.
|
|
240
|
+
// 0.3.75:会话投影缓存守卫,默认开。关掉后既不定时扫描,也不理会客户端的 agent-busy 上报。
|
|
241
241
|
cacheGuard: raw.cacheGuard !== false,
|
|
242
242
|
}
|
|
243
243
|
}
|
|
@@ -1180,7 +1180,7 @@ async function inspect(config) {
|
|
|
1180
1180
|
const pending = c.items.filter((it) => !it.choice).length
|
|
1181
1181
|
return { exists: true, total: c.items.length, pending, at: c.at || '', backupDir: c.backupDir || '' }
|
|
1182
1182
|
})(),
|
|
1183
|
-
// 0.3.
|
|
1183
|
+
// 0.3.75:会话投影缓存守卫状态(面板「会话缓存守卫」卡用)
|
|
1184
1184
|
cacheGuard: cacheGuardSnapshot(config),
|
|
1185
1185
|
}
|
|
1186
1186
|
}
|
|
@@ -1962,7 +1962,7 @@ async function handleSettings(req, res, config) {
|
|
|
1962
1962
|
const autoPull = has('autoPull') ? body.autoPull === true : before.autoPull
|
|
1963
1963
|
const autoPush = has('autoPush') ? body.autoPush === true : before.autoPush
|
|
1964
1964
|
const autoRestart = has('autoRestart') ? body.autoRestart !== false : before.autoRestart
|
|
1965
|
-
// 0.3.
|
|
1965
|
+
// 0.3.75:会话投影缓存守卫开关,字段没给就沿用原值
|
|
1966
1966
|
const cacheGuard = has('cacheGuard') ? body.cacheGuard !== false : before.cacheGuard
|
|
1967
1967
|
|
|
1968
1968
|
if (!has('repoPath') && !has('remoteUrl') && !has('sshKey') &&
|
|
@@ -4022,7 +4022,7 @@ function newIssueUrl(repo, title, text, config) {
|
|
|
4022
4022
|
return `https://github.com/${repo}/issues/new?${q}`
|
|
4023
4023
|
}
|
|
4024
4024
|
|
|
4025
|
-
// ============================ 0.3.
|
|
4025
|
+
// ============================ 0.3.75:会话投影缓存守卫 ============================
|
|
4026
4026
|
// 背景:UI 点「新建会话」时会挑一条 summary.blank===true 的会话复用,挑中了 origin=subagent
|
|
4027
4027
|
// 的子会话就会被宿主拒绝(session/agent-busy:is owned by subagent routing)。
|
|
4028
4028
|
// 起因是投影缓存停在 session/created 那一刻(blank=true、seq=-1),而会话日志早就推进过,
|
|
@@ -4430,7 +4430,7 @@ export function apply(ctx, config) {
|
|
|
4430
4430
|
path: ROUTE_FEEDBACK,
|
|
4431
4431
|
handler: withLang(handleFeedback),
|
|
4432
4432
|
}))
|
|
4433
|
-
// 0.3.
|
|
4433
|
+
// 0.3.75:会话投影缓存守卫(GET 只读扫描 / POST scan|sweep|clear|busy)
|
|
4434
4434
|
scoped.effect(() => scoped.webServer.register({
|
|
4435
4435
|
kind: 'exact',
|
|
4436
4436
|
path: ROUTE_CACHE_GUARD,
|
|
@@ -4443,7 +4443,7 @@ export function apply(ctx, config) {
|
|
|
4443
4443
|
// status 不用再为首屏那 2.5 秒的 ls-remote 埋单。
|
|
4444
4444
|
typeof setTimeout === 'function' ? setTimeout(() => { try { warmRemoteProbe(config) } catch { } }, 300) : null
|
|
4445
4445
|
installQuitWhenAllWindowsClosed(ctx)
|
|
4446
|
-
// 0.3.
|
|
4446
|
+
// 0.3.75:会话投影缓存守卫的定时扫描(默认开,设置里可关)
|
|
4447
4447
|
scheduleCacheGuard(config)
|
|
4448
4448
|
} catch (error) {
|
|
4449
4449
|
// 不抛:缺 webServer 的 profile 里这个插件静默不激活即可
|
package/package.json
CHANGED
package/runtime/apply.ps1
CHANGED
|
@@ -742,7 +742,8 @@ $settingsMap = @(
|
|
|
742
742
|
@{ Repo = 'settings\redteam-preset-declare.json'; Src = (Join-Path $DshHome 'redteam\preset-declare.json'); Label = '红队预设声明' },
|
|
743
743
|
@{ Repo = 'settings\task-board-ledger.json'; Src = (Join-Path $DshHome 'task-board\ledger-v2.json'); Label = '任务板台账' },
|
|
744
744
|
@{ Repo = 'settings\task-board-scheduler.json'; Src = (Join-Path $DshHome 'task-board\scheduler-v2.json'); Label = '任务板调度' },
|
|
745
|
-
@{ Repo = 'settings\dsh-workspaces.json'; Src = (Join-Path $DshHome 'storages\workspace.json'); Label = 'DSH 工作区登记' }
|
|
745
|
+
@{ Repo = 'settings\dsh-workspaces.json'; Src = (Join-Path $DshHome 'storages\workspace.json'); Label = 'DSH 工作区登记' },
|
|
746
|
+
@{ Repo = 'settings\workspace-archives.json'; Src = (Join-Path $DshHome 'dsh-session-manager\workspace-archives.v1.json'); Label = 'DSH 工作区隐藏状态' }
|
|
746
747
|
)
|
|
747
748
|
|
|
748
749
|
# ---------- 0.5 宿主版本契约(一切动作之前先校验) ----------
|
|
@@ -899,9 +900,10 @@ $localPluginMap = [ordered]@{
|
|
|
899
900
|
'dsh-our-free-model-2.8.0' = 'dsh-our-free-model'
|
|
900
901
|
'dsh-purge-1.4.0' = 'dsh-purge'
|
|
901
902
|
'dsh-config-sync-plugin-0.3.69' = 'dsh-config-sync-plugin'
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
903
|
+
'dsh-config-sync-plugin-0.3.75' = 'dsh-config-sync-plugin'
|
|
904
|
+
'dsh-config-sync-plugin-0.3.74' = 'dsh-config-sync-plugin'
|
|
905
|
+
'dsh-config-sync-plugin-0.3.73' = 'dsh-config-sync-plugin'
|
|
906
|
+
'dsh-config-sync-plugin-0.3.70' = 'dsh-config-sync-plugin'
|
|
905
907
|
'dsh-config-sync-plugin-0.3.68' = 'dsh-config-sync-plugin'
|
|
906
908
|
'dsh-config-sync-plugin-0.3.67' = 'dsh-config-sync-plugin'
|
|
907
909
|
'dsh-config-sync-plugin-0.3.66' = 'dsh-config-sync-plugin'
|
package/runtime/capture.ps1
CHANGED
|
@@ -829,7 +829,8 @@ if (Test-SyncGroupEnabled $Scope 'settings') {
|
|
|
829
829
|
@{ Repo = 'settings\redteam-preset-declare.json'; Src = (Join-Path $DshHome 'redteam\preset-declare.json'); Label = '红队预设声明' },
|
|
830
830
|
@{ Repo = 'settings\task-board-ledger.json'; Src = (Join-Path $DshHome 'task-board\ledger-v2.json'); Label = '任务板台账' },
|
|
831
831
|
@{ Repo = 'settings\task-board-scheduler.json'; Src = (Join-Path $DshHome 'task-board\scheduler-v2.json'); Label = '任务板调度' },
|
|
832
|
-
@{ Repo = 'settings\dsh-workspaces.json'; Src = (Join-Path $DshHome 'storages\workspace.json'); Label = 'DSH 工作区登记' }
|
|
832
|
+
@{ Repo = 'settings\dsh-workspaces.json'; Src = (Join-Path $DshHome 'storages\workspace.json'); Label = 'DSH 工作区登记' },
|
|
833
|
+
@{ Repo = 'settings\workspace-archives.json'; Src = (Join-Path $DshHome 'dsh-session-manager\workspace-archives.v1.json'); Label = 'DSH 工作区隐藏状态' }
|
|
833
834
|
)
|
|
834
835
|
foreach ($m in $settingsMap) {
|
|
835
836
|
if (-not (Test-SyncItemEnabled $Scope 'settings' ($m.Repo -replace '^settings\\', ''))) {
|
package/tools/selftest.mjs
CHANGED
|
@@ -1252,6 +1252,10 @@ console.log('== 跨机路径占位符与问题反馈 ==')
|
|
|
1252
1252
|
check('workspace.json(DSH 工作区登记)进了同步范围',
|
|
1253
1253
|
captureSrc.includes("storages\\workspace.json") && applySrc.includes("storages\\workspace.json"),
|
|
1254
1254
|
'工作区登记表没同步')
|
|
1255
|
+
check('workspace-archives.v1.json(工作区隐藏/归档状态)进了同步范围',
|
|
1256
|
+
captureSrc.includes('settings\\workspace-archives.json') && captureSrc.includes('dsh-session-manager\\workspace-archives.v1.json')
|
|
1257
|
+
&& applySrc.includes('settings\\workspace-archives.json') && applySrc.includes('dsh-session-manager\\workspace-archives.v1.json'),
|
|
1258
|
+
'工作区隐藏状态没纳入 settingsMap(A 机隐藏的工作区会带到 B 机显示)')
|
|
1255
1259
|
check('面板有「本机路径」卡:只读展示 + 「修改」进编辑 + 保存',
|
|
1256
1260
|
cli.includes("M('本机路径', 'Local paths')") && cli.includes("M('修改', 'Edit')")
|
|
1257
1261
|
&& cli.includes('callRoots') && cli.includes('setCustom') && cli.includes('addCustom'),
|