Skip to content
  1. Home
  2. workspace
Checking…
Public view — sanitized data only. Sign in over HTTPS to create projects and manage the workspace.

AI Engineering Workspace

Partial

Chat, files, terminal and preview in one place. Chat sessions run on a durable Postgres-backed queue (chat only: no tools or shell). Live models need an API key; the terminal is unavailable.

Project files

read-only

app/src/app/api/cloud/org/route.ts

1import { cookies } from "next/headers";
2import { db, asSystem } from "@/lib/db";
3import { getCtx, tenant } from "@/lib/tenant";
4import { auditT } from "@/lib/tenant";
5export const dynamic = "force-dynamic";
6export async function GET() { const c = await getCtx(); if (!c) return Response.json({ error: "authentication required" }, { status: 401 }); return Response.json({ current: c.orgId, orgs: c.orgs }); }
7// Tenant switching: only to an organization the user is a member of (membership re-checked server-side).
8export async function POST(req: Request) {
9 const g = await tenant("viewer", { write: true }); if (g.res) return g.res; const ctx = g.ctx; const b = await req.json().catch(() => ({})); const to = String(b.orgId ?? "");
10 if (!ctx.orgs.some(o => o.id === to)) return Response.json({ error: "not a member of that organization" }, { status: 403 });
11 const sid = (await cookies()).get("zcs_session")?.value; await asSystem(() => db().prepare("UPDATE sessions SET org_id=? WHERE id=? AND user_id=?").run(to, sid, ctx.userId)); // sessions are system-only; scoped to the caller's own session await auditT(ctx, "org.switch", to); return Response.json({ ok: true });
12}
13

Conversation

Partial
Sign in to start AI sessions.

Task checklist

  • Application shell deployed
  • Persistent projects
  • Agent runtime
  • Sandboxed terminal

Execution activity

No agent sessions. Git HEAD 0eebc42 on master.

Approval requests

None pending.