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/instances/[id]/route.ts

1import { db } from "@/lib/db";
2import { auditT, instanceOf, notFound, tenant } from "@/lib/tenant";
3import { TRANSITIONS } from "@/lib/cloud";
4// Lifecycle transitions only; terminating never deletes data and never touches billing (there is none).
5export async function PATCH(req: Request, { params }: { params: Promise<{ id: string }> }) {
6 const g = await tenant("admin", { write: true }); if (g.res) return g.res; const ctx = g.ctx; const { id } = await params;
7 const inst = await instanceOf(ctx, id); if (!inst) return notFound(); const b = await req.json().catch(() => ({})); const to = String(b.status ?? "");
8 if (!(TRANSITIONS[inst.status] ?? []).includes(to as any)) return Response.json({ error: `cannot move an instance from ${inst.status} to ${to}` }, { status: 409 });
9 if (to === "active" && inst.target === "managed" && !(await db().prepare("SELECT 1 FROM managed_inventory WHERE assigned_instance_id=?").get(id))) return Response.json({ error: "a managed instance needs an assigned server first (request provisioning)" }, { status: 409 });
10 await db().prepare("UPDATE instances SET status=? WHERE id=? AND org_id=?").run(to, id, ctx.orgId); await auditT(ctx, "instance.lifecycle", id, { from: inst.status, to }); return Response.json({ ok: true });
11}
12

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.