AI Engineering Workspace
PartialChat, 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- ..
- apple-touch-icon.png
- brand-guidelines-v2.md
- brand-manifest-v2.json
- favicon-16.png
- favicon-32.png
- favicon-48.png
- favicon.ico
- icon-192.png
- icon-512.png
- maskable-192.png
- maskable-512.png
- source-brand-board.png
- source-crop-icon-fullcolor.png
- source-crop-lockup-dark.png
- source-crop-wordmark-light.png
- zloud-app-icon-1024.png
- zloud-app-icon.svg
- zloud-favicon.svg
- zloud-mark-1024.png
- zloud-mark-512.png
- zloud-mark-mono-512.png
- zloud-mark-mono.svg
- zloud-mark-reversed.svg
- zloud-mark-white-512.png
- zloud-mark-white.svg
- zloud-mark.svg
- zloud-maskable.svg
- zloud-wordmark-dark.svg
- zloud-wordmark-light.svg
- zloud-wordmark-mono.svg
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
PartialSign in to start AI sessions.
Task checklist
- Application shell deployed
- Persistent projects
- Agent runtime
- Sandboxed terminal
Execution activity
No agent sessions. Git HEAD 692573d on master.
Approval requests
None pending.