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

1import { auditT, platform, tenant } from "@/lib/tenant";
2import { db, setSetting } from "@/lib/db";
3import { engineStatus, loadEngineSettings, opencodeInfo } from "@/lib/engines";
4export const dynamic = "force-dynamic";
5export async function GET() {
6 const g = await tenant("viewer"); if (g.res) return g.res;
7 return Response.json({ engines: await engineStatus(g.ctx.orgId), settings: await loadEngineSettings() });
8}
9const ENGINES = ["opencode", "anthropic", "openai", "mock"];
10export async function POST(req: Request) {
11 const g = await platform({ write: true }); if (g.res) return g.res; const ctx = g.ctx; const b = await req.json().catch(() => ({}));
12 if (b.refresh) { await opencodeInfo(true); return Response.json({ ok: true }); }
13 if (typeof b.default === "string") { if (b.default && !ENGINES.includes(b.default)) return Response.json({ error: "unknown engine" }, { status: 400 }); await setSetting("engine.default", b.default); await auditT(ctx, "engine.default", b.default); }
14 if (typeof b.fallbackEnabled === "boolean") { await setSetting("ai.fallback_enabled", b.fallbackEnabled ? "1" : "0"); await auditT(ctx, "engine.fallback", String(b.fallbackEnabled)); }
15 if (Array.isArray(b.fallbackOrder)) { const o = b.fallbackOrder.map(String).filter((x: string) => ENGINES.includes(x)); await setSetting("ai.fallback_order", JSON.stringify(o)); await auditT(ctx, "engine.fallback_order", o.join(",")); }
16 if (typeof b.consent === "boolean") { if (b.consent && b.confirm !== "I CONSENT") return Response.json({ error: 'type "I CONSENT" to confirm' }, { status: 400 }); await setSetting("engine.opencode.consent", b.consent ? "1" : "0"); await auditT(ctx, "engine.opencode.consent", String(b.consent)); }
17 if (typeof b.authorizeProject === "string") { // explicit, typed, per-project opt-in to file-editing agent runs
18 const p = await db().prepare("SELECT id FROM projects WHERE id=?").get(b.authorizeProject); if (!p) return Response.json({ error: "unknown project" }, { status: 404 });
19 if (b.enabled && b.confirm !== "AUTHORIZE EXPERIMENTAL EXECUTION") return Response.json({ error: 'type "AUTHORIZE EXPERIMENTAL EXECUTION" to confirm' }, { status: 400 });
20 await setSetting(`exec.authorized.${b.authorizeProject}`, b.enabled ? "1" : "0"); await auditT(ctx, "engine.exec_authorize", b.authorizeProject, { enabled: !!b.enabled });
21 }
22 return Response.json({ ok: true });
23}
24

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.