github-router 0.3.23 → 0.3.25
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/dist/main.js +17 -13
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -65,6 +65,9 @@ const CLAUDE_HOME_POLICY = new Map([
|
|
|
65
65
|
["cache", "ISOLATED"],
|
|
66
66
|
["logs", "ISOLATED"],
|
|
67
67
|
["paste-cache", "ISOLATED"],
|
|
68
|
+
["jobs", "ISOLATED"],
|
|
69
|
+
["daemon", "ISOLATED"],
|
|
70
|
+
["daemon.log", "ISOLATED"],
|
|
68
71
|
["projects", "SHARED"],
|
|
69
72
|
["sessions", "SHARED"],
|
|
70
73
|
["tasks", "SHARED"],
|
|
@@ -324,7 +327,7 @@ async function ensureSharedSymlink(name$1, sourceDir, mirrorDir) {
|
|
|
324
327
|
try {
|
|
325
328
|
await fs.mkdir(sourcePath, { recursive: true });
|
|
326
329
|
} catch (err) {
|
|
327
|
-
consola.
|
|
330
|
+
consola.warn(`ensureSharedSymlink(${name$1}): cannot mkdir source ${sourcePath}:`, err);
|
|
328
331
|
return;
|
|
329
332
|
}
|
|
330
333
|
let existing = null;
|
|
@@ -332,22 +335,22 @@ async function ensureSharedSymlink(name$1, sourceDir, mirrorDir) {
|
|
|
332
335
|
existing = await fs.lstat(mirrorPath);
|
|
333
336
|
} catch (err) {
|
|
334
337
|
if (err.code !== "ENOENT") {
|
|
335
|
-
consola.
|
|
338
|
+
consola.warn(`ensureSharedSymlink(${name$1}): cannot lstat ${mirrorPath}:`, err);
|
|
336
339
|
return;
|
|
337
340
|
}
|
|
338
341
|
}
|
|
339
342
|
if (existing?.isSymbolicLink()) {
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
consola.debug(`ensureSharedSymlink(${name$1}): cannot readlink ${mirrorPath}:`, err);
|
|
343
|
+
const sourceReal = await fs.realpath(sourcePath).catch(() => null);
|
|
344
|
+
if (sourceReal === null) {
|
|
345
|
+
consola.warn(`ensureSharedSymlink(${name$1}): cannot resolve source ${sourcePath} — skipping junction creation to avoid silent every-startup churn. Inspect the source dir's permissions / OneDrive sync state and re-launch.`);
|
|
346
|
+
return;
|
|
345
347
|
}
|
|
346
|
-
|
|
348
|
+
const currentReal = await fs.realpath(mirrorPath).catch(() => null);
|
|
349
|
+
if (currentReal !== null && currentReal === sourceReal) return;
|
|
347
350
|
} else if (existing?.isDirectory()) try {
|
|
348
351
|
await fs.rmdir(mirrorPath);
|
|
349
352
|
} catch (err) {
|
|
350
|
-
consola.warn(`ensureClaudeConfigMirror: ${mirrorPath} is a non-empty real directory from an older github-router version; refusing to clobber. If you want chat-history continuity for "${name$1}", move its contents into ${sourcePath}/ then delete ${mirrorPath}; the mirror will create a symlink on next launch. (rmdir error: ${err.code ?? "unknown"})`);
|
|
353
|
+
consola.warn(`ensureClaudeConfigMirror: ${mirrorPath} is a non-empty real directory from an older github-router version; refusing to clobber. If you want chat-history continuity for "${name$1}", move its contents into ${sourcePath}/ then delete ${mirrorPath}; the mirror will create a symlink (junction on Windows) on next launch. (rmdir error: ${err.code ?? "unknown"})`);
|
|
351
354
|
return;
|
|
352
355
|
}
|
|
353
356
|
else if (existing) {
|
|
@@ -356,15 +359,16 @@ async function ensureSharedSymlink(name$1, sourceDir, mirrorDir) {
|
|
|
356
359
|
}
|
|
357
360
|
const tempPath = `${mirrorPath}.tmp.${process.pid}.${randomBytes(4).toString("hex")}`;
|
|
358
361
|
try {
|
|
359
|
-
await fs.symlink(sourcePath, tempPath);
|
|
362
|
+
await fs.symlink(sourcePath, tempPath, process.platform === "win32" ? "junction" : "dir");
|
|
360
363
|
} catch (err) {
|
|
361
|
-
consola.
|
|
364
|
+
consola.warn(`ensureSharedSymlink(${name$1}): symlink ${tempPath} failed:`, err);
|
|
362
365
|
return;
|
|
363
366
|
}
|
|
367
|
+
if (process.platform === "win32" && existing?.isSymbolicLink()) await fs.unlink(mirrorPath).catch(() => {});
|
|
364
368
|
try {
|
|
365
369
|
await fs.rename(tempPath, mirrorPath);
|
|
366
370
|
} catch (err) {
|
|
367
|
-
consola.
|
|
371
|
+
consola.warn(`ensureSharedSymlink(${name$1}): rename ${tempPath} → ${mirrorPath} failed:`, err);
|
|
368
372
|
await fs.unlink(tempPath).catch(() => {});
|
|
369
373
|
}
|
|
370
374
|
}
|
|
@@ -2651,7 +2655,7 @@ function initProxyFromEnv() {
|
|
|
2651
2655
|
//#endregion
|
|
2652
2656
|
//#region package.json
|
|
2653
2657
|
var name = "github-router";
|
|
2654
|
-
var version = "0.3.
|
|
2658
|
+
var version = "0.3.25";
|
|
2655
2659
|
|
|
2656
2660
|
//#endregion
|
|
2657
2661
|
//#region src/lib/approval.ts
|