@lifeaitools/clauth 1.5.53 → 1.5.54
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/cli/commands/serve.js +31 -0
- package/package.json +1 -1
package/cli/commands/serve.js
CHANGED
|
@@ -3655,6 +3655,37 @@ function createServer(initPassword, whitelist, port, tunnelHostnameInit = null,
|
|
|
3655
3655
|
return;
|
|
3656
3656
|
}
|
|
3657
3657
|
|
|
3658
|
+
// GET /chitchat/:id — session status (used by clauth chitchat CLI to verify session exists)
|
|
3659
|
+
const chitchatStatusMatch = reqPath.match(/^\/chitchat\/([^/]+)$/);
|
|
3660
|
+
if (method === "GET" && chitchatStatusMatch) {
|
|
3661
|
+
const sid = chitchatStatusMatch[1];
|
|
3662
|
+
const s = terminalSessions.get(sid);
|
|
3663
|
+
if (!s || !s.is_chitchat) {
|
|
3664
|
+
res.writeHead(404, { "Content-Type": "application/json", ...CORS });
|
|
3665
|
+
return res.end(JSON.stringify({ error: "not_found" }));
|
|
3666
|
+
}
|
|
3667
|
+
res.writeHead(200, { "Content-Type": "application/json", ...CORS });
|
|
3668
|
+
return res.end(JSON.stringify({ session_id: sid, status: s.status, name: s.name, turn: s.turn }));
|
|
3669
|
+
}
|
|
3670
|
+
|
|
3671
|
+
// POST /chitchat/start — start a chitchat collab session (local REST, same as MCP chitchat_start)
|
|
3672
|
+
if (method === "POST" && reqPath === "/chitchat/start") {
|
|
3673
|
+
let body = "";
|
|
3674
|
+
req.on("data", d => body += d);
|
|
3675
|
+
req.on("end", async () => {
|
|
3676
|
+
try {
|
|
3677
|
+
const { name } = JSON.parse(body || "{}");
|
|
3678
|
+
const result = await startChitchatSession(name || "collab");
|
|
3679
|
+
res.writeHead(200, { "Content-Type": "application/json", ...CORS });
|
|
3680
|
+
res.end(JSON.stringify(result));
|
|
3681
|
+
} catch (e) {
|
|
3682
|
+
res.writeHead(500, { "Content-Type": "application/json", ...CORS });
|
|
3683
|
+
res.end(JSON.stringify({ error: e.message }));
|
|
3684
|
+
}
|
|
3685
|
+
});
|
|
3686
|
+
return;
|
|
3687
|
+
}
|
|
3688
|
+
|
|
3658
3689
|
// POST /terminal/start — start a named terminal session
|
|
3659
3690
|
if (method === "POST" && reqPath === "/terminal/start") {
|
|
3660
3691
|
let body = "";
|