zen-gitsync 2.16.38 → 2.16.39

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.
@@ -10,7 +10,7 @@
10
10
  <link rel="preconnect" href="https://fonts.googleapis.com" />
11
11
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
12
12
  <link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
13
- <script type="module" crossorigin src="/assets/index-D-n9_1ON.js"></script>
13
+ <script type="module" crossorigin src="/assets/index-hyzLLFKf.js"></script>
14
14
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-BM3Ffeng.js">
15
15
  <link rel="modulepreload" crossorigin href="/assets/monaco-43aputPh.js">
16
16
  <link rel="modulepreload" crossorigin href="/assets/element-plus-Cchqf1s7.js">
@@ -48,7 +48,7 @@ import { registerInstancesRoutes } from './routes/instances.js';
48
48
  import { registerMonitorRoutes } from './routes/monitor.js';
49
49
  import { registerMindmapRoutes } from './routes/mindmap.js';
50
50
  import { registerAgentRoutes } from './routes/workbench/agentRoutes.js';
51
- import { createInstanceRegistry } from './utils/instanceRegistry.js';
51
+ import { createInstanceRegistry, getRegistryPath } from './utils/instanceRegistry.js';
52
52
  import { createSavePortToFile } from './utils/createSavePortToFile.js';
53
53
  import { createOriginGuard, createOriginCheckerFromEnv } from './middleware/originGuard.js';
54
54
  import { startServerOnAvailablePort } from './utils/startServerOnAvailablePort.js';
@@ -229,12 +229,15 @@ async function startUIServer(noOpen = false, savePort = false) {
229
229
  registerSocketIO(io);
230
230
 
231
231
  // 构建实例注册表(用于跨进程共享"当前运行中的 GUI"信息)
232
- // 注册表文件位于用户主目录,所有 g ui 进程共享写入
232
+ // 8b725c5c 起改为"每实例一个文件"目录方案:register/heartbeat/unregister
233
+ // 只读写 *自己* 的 <pid>.json,跨进程并发永不互相覆盖。路径用 instanceRegistry
234
+ // 暴露的 getRegistryPath() 统一,避免再次出现"硬编码 .json 路径传给目录方案"
235
+ // 这种错配(8b725c5c 漏改 server/index.js 导致的 ENOTDIR scandir 报错)。
233
236
  const instanceRegistry = createInstanceRegistry({
234
237
  fs,
235
238
  path,
236
239
  os,
237
- registryPath: path.join(os.homedir(), '.zen-gitsync-instances.json')
240
+ registryPath: getRegistryPath()
238
241
  });
239
242
 
240
243
  // 注册全局错误处理器:任意未捕获异常/拒绝都会触发 fatalExit,