@lifeaitools/clauth 1.5.66 → 1.5.68
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 +14 -2
- package/package.json +1 -1
package/cli/commands/serve.js
CHANGED
|
@@ -3178,7 +3178,7 @@ function createServer(initPassword, whitelist, port, tunnelHostnameInit = null,
|
|
|
3178
3178
|
}
|
|
3179
3179
|
|
|
3180
3180
|
// ── MCP Streamable HTTP transport ──
|
|
3181
|
-
// POST /sse, /mcp, /
|
|
3181
|
+
// POST /sse, /mcp, /clauth — JSON-RPC over HTTP
|
|
3182
3182
|
// claude.ai requires text/event-stream SSE format (like regen-media/Express).
|
|
3183
3183
|
if (method === "POST" && (reqPath === "/sse" || isMcpPath)) {
|
|
3184
3184
|
let body;
|
|
@@ -3251,7 +3251,7 @@ function createServer(initPassword, whitelist, port, tunnelHostnameInit = null,
|
|
|
3251
3251
|
}
|
|
3252
3252
|
|
|
3253
3253
|
// ── MCP SSE transport — /sse and namespaced paths ────
|
|
3254
|
-
// GET /sse|/
|
|
3254
|
+
// GET /sse|/clauth — open SSE stream, receive endpoint event
|
|
3255
3255
|
// Remote clients (claude.ai) arrive with a Bearer token via OAuth.
|
|
3256
3256
|
// They use Streamable HTTP (POST only) — return 405 on GET so claude.ai
|
|
3257
3257
|
// knows to POST directly. Local clients have no Bearer token and use SSE.
|
|
@@ -5530,6 +5530,18 @@ function stopTerminalSession(session_id) {
|
|
|
5530
5530
|
// Pure in-memory. No files. No CLI spawning on send/recv.
|
|
5531
5531
|
|
|
5532
5532
|
const CHITCHAT_CWD = 'C:/Dev/regen-root';
|
|
5533
|
+
const CHITCHAT_FALLBACK_CWD = CHITCHAT_CWD;
|
|
5534
|
+
|
|
5535
|
+
// Resolve the working directory for Claude CLI tasks.
|
|
5536
|
+
// Uses the first fileserver mount from vault (if unlocked and configured),
|
|
5537
|
+
// falling back to CHITCHAT_CWD so the daemon always has a usable cwd.
|
|
5538
|
+
async function resolveChitchatRoot(vault) {
|
|
5539
|
+
try {
|
|
5540
|
+
const { mounts } = await getFileserverMounts(vault);
|
|
5541
|
+
if (mounts && mounts.length > 0 && mounts[0].path) return mounts[0].path;
|
|
5542
|
+
} catch {}
|
|
5543
|
+
return CHITCHAT_CWD;
|
|
5544
|
+
}
|
|
5533
5545
|
|
|
5534
5546
|
async function startChitchatSession(name) {
|
|
5535
5547
|
const session_id = generateSessionId();
|