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/contact/route.ts

1import { asSystem, db, now } from "@/lib/db";
2import { isSecure, sameOrigin } from "@/lib/auth";
3// Public contact form. HTTPS only (it carries an email address), same-origin, validated, globally rate-limited. Stored; no email is sent.
4export const POST = (req: Request) => asSystem(() => handle(req)); // anonymous public form: explicit system scope, input validated + rate limited below
5async function handle(req: Request) {
6 if (!(await isSecure())) return Response.json({ error: "HTTPS required" }, { status: 403 });
7 if (!(await sameOrigin())) return Response.json({ error: "cross-origin rejected" }, { status: 403 });
8 const b = await req.json().catch(() => ({})); const name = String(b.name ?? "").trim(), email = String(b.email ?? "").trim(), message = String(b.message ?? "").trim();
9 if (name.length < 2 || name.length > 80 || !/^[^\s@]{1,64}@[^\s@]{1,190}\.[^\s@]{2,}$/.test(email) || message.length < 10 || message.length > 2000) return Response.json({ error: "Please provide a name, a valid email and a message of 10–2000 characters." }, { status: 422 });
10 const recent = await db().prepare("SELECT COUNT(*) n FROM contact_requests WHERE created_at > ?").get(new Date(Date.now() - 3_600_000).toISOString()) as any;
11 if (recent.n >= 20) return Response.json({ error: "Too many requests right now; try again later." }, { status: 429 });
12 await db().prepare("INSERT INTO contact_requests(name,email,message,created_at) VALUES(?,?,?,?)").run(name, email, message, now()); return Response.json({ ok: true });
13}
14

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.