Workspaces and Terminals
This commit is contained in:
+3
-1
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user