claude-bridge-cli 1.2.1 → 1.2.3
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 +15 -3
- package/package.json +1 -1
package/lib/bridge.js
CHANGED
|
@@ -347,8 +347,16 @@ function askClaude(config, { prompt, session_id, images, cwd, plan_mode, allow_t
|
|
|
347
347
|
const tmpFile = path.join(os.tmpdir(), `claude-prompt-${Date.now()}-${Math.random().toString(36).slice(2)}.txt`);
|
|
348
348
|
fs.writeFileSync(tmpFile, finalPrompt, "utf8");
|
|
349
349
|
|
|
350
|
+
const settings = JSON.stringify({
|
|
351
|
+
permissions: {
|
|
352
|
+
defaultMode: "acceptEdits",
|
|
353
|
+
allow: ["Read", "Write", "Edit", "Bash", "Grep", "Glob", "WebFetch", "WebSearch",
|
|
354
|
+
"Task", "TaskCreate", "TaskList", "TaskGet", "TaskUpdate", "NotebookEdit"],
|
|
355
|
+
deny: ["AskUserQuestion"],
|
|
356
|
+
}
|
|
357
|
+
});
|
|
350
358
|
const args = ["-p", `@${tmpFile}`, "--output-format", "json",
|
|
351
|
-
"--permission-mode", "acceptEdits"];
|
|
359
|
+
"--settings", settings, "--permission-mode", "acceptEdits"];
|
|
352
360
|
if (session_id) {
|
|
353
361
|
const sessionExists = scanSessionFiles().some(s => s.id === session_id);
|
|
354
362
|
args.push(sessionExists ? "--resume" : "--session-id", session_id);
|
|
@@ -532,8 +540,12 @@ function startBridge(config) {
|
|
|
532
540
|
if (req.method === "PATCH" || req.method === "POST") {
|
|
533
541
|
const body = await readBody(req);
|
|
534
542
|
const sess = allMarks[m[1]] || {};
|
|
535
|
-
|
|
536
|
-
sess[
|
|
543
|
+
if (body.key && body.mark) {
|
|
544
|
+
sess[body.key] = { ...(sess[body.key] || {}), ...body.mark };
|
|
545
|
+
} else {
|
|
546
|
+
for (const [k, v] of Object.entries(body)) {
|
|
547
|
+
sess[k] = { ...(sess[k] || {}), ...v };
|
|
548
|
+
}
|
|
537
549
|
}
|
|
538
550
|
allMarks[m[1]] = sess;
|
|
539
551
|
writeJson(marksFile, allMarks);
|
package/package.json
CHANGED