claude-bridge-cli 2.0.2 → 2.0.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 +21 -0
- package/package.json +1 -1
package/lib/bridge.js
CHANGED
|
@@ -710,6 +710,27 @@ function startBridge(config) {
|
|
|
710
710
|
}
|
|
711
711
|
}
|
|
712
712
|
|
|
713
|
+
// AutoMode cross-device state + single-runner lease (per session, like marks)
|
|
714
|
+
m = url.pathname.match(/^\/sessions\/([A-Za-z0-9._-]+)\/automode$/);
|
|
715
|
+
if (m) {
|
|
716
|
+
const amFile = path.join(dd, "automode-state.json");
|
|
717
|
+
const allAm = readJson(amFile, {});
|
|
718
|
+
if (req.method === "GET") {
|
|
719
|
+
send(200, { automode: allAm[m[1]] || {} });
|
|
720
|
+
return;
|
|
721
|
+
}
|
|
722
|
+
if (req.method === "PATCH" || req.method === "POST") {
|
|
723
|
+
const body = await readBody(req);
|
|
724
|
+
const allowed = ["to_claude", "to_gpt", "gpt_ready", "claude_ready", "active_client", "active_ts"];
|
|
725
|
+
const cur = allAm[m[1]] || {};
|
|
726
|
+
for (const k of allowed) if (k in body) cur[k] = body[k];
|
|
727
|
+
allAm[m[1]] = cur;
|
|
728
|
+
writeJson(amFile, allAm);
|
|
729
|
+
send(200, { automode: cur });
|
|
730
|
+
return;
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
|
|
713
734
|
// Title rename
|
|
714
735
|
m = url.pathname.match(/^\/sessions\/([A-Za-z0-9._-]+)\/title$/);
|
|
715
736
|
if (m && (req.method === "PATCH" || req.method === "POST")) {
|
package/package.json
CHANGED