Workspaces and Terminals

This commit is contained in:
2026-02-19 18:01:08 +00:00
parent 9870fa7ae8
commit 4733a972dd
14 changed files with 402 additions and 57 deletions
+3 -1
View File
@@ -19,6 +19,7 @@ type WSData = {
provider: 'claude' | 'opencode' | 'terminal';
sandboxed: boolean;
sessionId?: string;
cwd?: string;
};
const handlers: Record<string, typeof claudeWebsocket> = {
@@ -45,8 +46,9 @@ async function upgradeWs(req: Request, server: any, provider: 'claude' | 'openco
const url = new URL(req.url);
const sessionId = url.searchParams.get('sessionId') ?? undefined;
const sandboxed = url.searchParams.get('sandboxed') !== 'false';
const cwd = url.searchParams.get('cwd') ?? undefined;
const ok = server.upgrade(req, {
data: { userId: user.id, email: user.email, role: user.role, provider, sandboxed, sessionId },
data: { userId: user.id, email: user.email, role: user.role, provider, sandboxed, sessionId, cwd },
});
if (!ok) return new Response('Upgrade failed', { status: 500 });
} catch {