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- ..
- ai.ts
- apps.ts
- audit.ts
- auth.ts
- central-core.d.mts
- central-core.mjs
- central.ts
- cloud.ts
- config.ts
- crypto.ts
- db.ts
- design.ts
- engines.ts
- files.ts
- gates.ts
- gateway.ts
- marketplace-core.d.mts
- marketplace-core.mjs
- metrics.ts
- modules.ts
- motion.ts
- nexus-core.d.mts
- nexus-core.mjs
- oidc-core.d.mts
- oidc-core.mjs
- oidc.ts
- providers.ts
- proxy-core.d.mts
- proxy-core.mjs
- pwauth-core.d.mts
- pwauth-core.mjs
- requirements.ts
- rls.sql.d.mts
- rls.sql.mjs
- services-content.ts
- ssrf.ts
- status.ts
- tenant.ts
- tlsgate.ts
- workspace.ts
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 below5async 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
PartialSign 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.