dsh-config-sync-plugin 0.3.73 → 0.3.74

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 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.73"` 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>` |
22
+ | npm | `npm i dsh-config-sync-plugin` | Use it as a dependency, or add `"dsh-config-sync-plugin": "^0.3.74"` 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.73"` 后 `pnpm i`;包名与 `cordis.patch.yml` 里注册的名字、插件目录 `dsh-config-sync-plugin-<ver>` 一致 |
18
+ | npm | `npm i dsh-config-sync-plugin` | 适合把它当依赖管理,或在 profile 的 `package.json` 里写 `"dsh-config-sync-plugin": "^0.3.74"` 后 `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
@@ -3212,7 +3212,7 @@ window.__ModuleLoader__.load({
3212
3212
  } catch { /* 插件路由还没起好就静默跳过,面板里仍会显示同一结果 */ }
3213
3213
  }
3214
3214
 
3215
- // ==================== 0.3.73:会话缓存守卫(客户端半身) ====================
3215
+ // ==================== 0.3.74:会话缓存守卫(客户端半身) ====================
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.73:给客户端的 sessions 服务套上 agent-busy 自愈钩子。
3312
+ // 0.3.74:给客户端的 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.73:会话投影缓存守卫(agent-busy 自动清缓存,让缓存按日志重建)
27
+ // 0.3.74:会话投影缓存守卫(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.73:会话投影缓存守卫(GET 只读扫描 / POST scan|sweep|clear|busy)
42
+ // 0.3.74:会话投影缓存守卫(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.73:会话投影缓存守卫,默认开。关掉后既不定时扫描,也不理会客户端的 agent-busy 上报。
240
+ // 0.3.74:会话投影缓存守卫,默认开。关掉后既不定时扫描,也不理会客户端的 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.73:会话投影缓存守卫状态(面板「会话缓存守卫」卡用)
1183
+ // 0.3.74:会话投影缓存守卫状态(面板「会话缓存守卫」卡用)
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.73:会话投影缓存守卫开关,字段没给就沿用原值
1965
+ // 0.3.74:会话投影缓存守卫开关,字段没给就沿用原值
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.73:会话投影缓存守卫 ============================
4025
+ // ============================ 0.3.74:会话投影缓存守卫 ============================
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.73:会话投影缓存守卫(GET 只读扫描 / POST scan|sweep|clear|busy)
4433
+ // 0.3.74:会话投影缓存守卫(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.73:会话投影缓存守卫的定时扫描(默认开,设置里可关)
4446
+ // 0.3.74:会话投影缓存守卫的定时扫描(默认开,设置里可关)
4447
4447
  scheduleCacheGuard(config)
4448
4448
  } catch (error) {
4449
4449
  // 不抛:缺 webServer 的 profile 里这个插件静默不激活即可
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-config-sync-plugin",
3
- "version": "0.3.73",
3
+ "version": "0.3.74",
4
4
  "type": "module",
5
5
  "description": "在 DSH 设置里查看 dsh-config 仓库与本机的同步状态,并生成退出后执行的 push/pull 脚本。同步动作本身不在应用内执行。面板与文案跟随客户端语言(中文/English)。",
6
6
  "main": "./index.js",
package/runtime/apply.ps1 CHANGED
@@ -1,4 +1,4 @@
1
- <#
1
+ <#
2
2
  DSH 配置同步 —— 应用脚本(把本仓库的配置还原到当前电脑)
3
3
 
4
4
  用法
@@ -900,6 +900,7 @@ $localPluginMap = [ordered]@{
900
900
  'dsh-purge-1.4.0' = 'dsh-purge'
901
901
  'dsh-config-sync-plugin-0.3.69' = 'dsh-config-sync-plugin'
902
902
  'dsh-config-sync-plugin-0.3.70' = 'dsh-config-sync-plugin'
903
+ 'dsh-config-sync-plugin-0.3.74' = 'dsh-config-sync-plugin'
903
904
  'dsh-config-sync-plugin-0.3.73' = 'dsh-config-sync-plugin'
904
905
  'dsh-config-sync-plugin-0.3.68' = 'dsh-config-sync-plugin'
905
906
  'dsh-config-sync-plugin-0.3.67' = 'dsh-config-sync-plugin'