claude-bridge-cli 1.2.5 → 1.2.6
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/lib/bridge.js +9 -4
- package/package.json +1 -1
package/lib/bridge.js
CHANGED
|
@@ -362,11 +362,16 @@ function askClaude(config, { prompt, session_id, images, cwd, plan_mode, allow_t
|
|
|
362
362
|
const existing = scanSessionFiles().find(s => s.id === session_id);
|
|
363
363
|
if (existing) {
|
|
364
364
|
args.push("--resume", session_id);
|
|
365
|
-
//
|
|
365
|
+
// Scan JSONL for the first event with a cwd field
|
|
366
366
|
try {
|
|
367
|
-
const
|
|
368
|
-
const
|
|
369
|
-
|
|
367
|
+
const lines = fs.readFileSync(existing.filePath, "utf8").split("\n");
|
|
368
|
+
for (const line of lines) {
|
|
369
|
+
if (!line) continue;
|
|
370
|
+
try {
|
|
371
|
+
const parsed = JSON.parse(line);
|
|
372
|
+
if (parsed.cwd) { resumeCwd = parsed.cwd; break; }
|
|
373
|
+
} catch {}
|
|
374
|
+
}
|
|
370
375
|
} catch {}
|
|
371
376
|
} else {
|
|
372
377
|
args.push("--session-id", session_id);
|
package/package.json
CHANGED