Skip to content
  1. Home
  2. workspace
Checking…
Demo 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/acceptance/route.ts

1import { db, now, uid } from "@/lib/db";
2import { platform, auditT } from "@/lib/tenant";
3import { MODULES } from "@/lib/modules";
4export const dynamic = "force-dynamic";
5// Manual acceptance is recorded ONLY from a signed-in platform owner; nothing else can mark a module accepted.
6const STATUSES = ["accepted", "rejected", "pending"];
7export async function GET() { const g = await platform(); if (g.res) return g.res; return Response.json({ acceptance: await db().prepare("SELECT * FROM acceptance").all(), bugs: await db().prepare("SELECT * FROM acceptance_bugs ORDER BY created_at DESC").all() }); }
8export async function POST(req: Request) {
9 const g = await platform({ write: true }); if (g.res) return g.res; const ctx = g.ctx; const b = await req.json().catch(() => ({})); const d = db();
10 if (b.action === "decide") {
11 const key = String(b.moduleKey ?? ""); if (!MODULES.some(m => m.id === key)) return Response.json({ error: "unknown module" }, { status: 422 });
12 if (!STATUSES.includes(b.status)) return Response.json({ error: "invalid status" }, { status: 422 });
13 await d.prepare("INSERT INTO acceptance(module_key,status,note,updated_by,updated_at) VALUES(?,?,?,?,?) ON CONFLICT(module_key) DO UPDATE SET status=excluded.status,note=excluded.note,updated_by=excluded.updated_by,updated_at=excluded.updated_at").run(key, b.status, String(b.note ?? "").slice(0, 500), ctx.email, now());
14 await auditT(ctx, "acceptance.decide", key, { status: b.status }); return Response.json({ ok: true });
15 }
16 if (b.action === "bug") {
17 const title = String(b.title ?? "").trim().slice(0, 140); if (title.length < 4) return Response.json({ error: "title required" }, { status: 422 });
18 const sev = ["minor", "major", "blocker"].includes(b.severity) ? b.severity : "minor"; const mk = b.moduleKey && MODULES.some(m => m.id === b.moduleKey) ? String(b.moduleKey) : null;
19 const id = uid("bug_"); await d.prepare("INSERT INTO acceptance_bugs(id,module_key,title,detail,severity,reported_by,created_at) VALUES(?,?,?,?,?,?,?)").run(id, mk, title, String(b.detail ?? "").slice(0, 2000), sev, ctx.email, now());
20 await auditT(ctx, "acceptance.bug", id, { severity: sev }); return Response.json({ ok: true, id });
21 }
22 if (b.action === "closeBug") { await d.prepare("UPDATE acceptance_bugs SET status='closed' WHERE id=?").run(String(b.id)); await auditT(ctx, "acceptance.bug.close", String(b.id)); return Response.json({ ok: true }); }
23 return Response.json({ error: "unknown action" }, { status: 422 });
24}
25

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 fb22adb on master.

Approval requests

None pending.