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- ..
- assets
- basic-languages
- editor
- language
- nls
- abap-D-t0cyap.js
- apex-CcIm7xu6.js
- azcli-BA0tQDCg.js
- bat-C397hTD6.js
- bicep-DF5aW17k.js
- cameligo-plsz8qhj.js
- clojure-Y2auQMzK.js
- coffee-Bu45yuWE.js
- cpp-CkKPQIni.js
- csharp-CX28MZyh.js
- csp-D8uWnyxW.js
- css-CaeNmE3S.js
- css.worker-C7XcYe5x.js
- cssMode-DpEkhVlW.js
- cypher-DVThT8BS.js
- dart-CmGfCvrO.js
- dockerfile-CZqqYdch.js
- ecl-30fUercY.js
- editor-CG9c2pE-.js
- editor.js
- elixir-O3PRlgxO.js
- flow9-DqtmStfK.js
- freemarker2-DTUDMAl2.js
- fsharp-BOMdg4U1.js
- go-D_hbi-Jt.js
- graphql-CKUU4kLG.js
- handlebars-qLqoXa-4.js
- hcl-DTaboeZW.js
- html-DTxBj26n.js
- html.worker-VIR_LTyv.js
- htmlMode-DFBg6CMj.js
- index-BVflv2uG.js
- index.js
- ini--YXggpAu.js
- java-CI4ZMsH9.js
- javascript-BiL3JN6i.js
- json.worker-DzWXGkG8.js
- jsonMode-Dz4r0pwo.js
- julia-BwzEvaQw.js
- kotlin-IUYPiTV8.js
- less-C0eDYdqa.js
- lexon-iON-Kj97.js
- liquid-lXEUQRVn.js
- loader.js
- lspLanguageFeatures-IeRAvoKK.js
- lua-DtygF91M.js
- m3-CsR4AuFi.js
- markdown-C_rD0bIw.js
- mdx-Dtr248s4.js
- mips-CiYP61RB.js
- monaco.contribution-BRs4bdz5.js
- monaco.contribution-ChoOM5Gg.js
- monaco.contribution-DbKqsbmO.js
- monaco.contribution-DKFaWvum.js
- msdax-C38-sJlp.js
- mysql-CdtbpvbG.js
- nls.messages-loader.js
- objective-c-CntZFaHX.js
- pascal-r6kuqfl_.js
- pascaligo-BiXoTmXh.js
- perl-DABw_TcH.js
- pgsql-me_jFXeX.js
- php-D_kh-9LK.js
- pla-VfZjczW0.js
- postiats-BBSzz8Pk.js
- powerquery-Dt-g_2cc.js
- powershell-B-7ap1zc.js
- protobuf-BmtuEB1A.js
- pug-BRpRNeEb.js
- python-Cma5OvNe.js
- qsharp-BzsFaUU9.js
- r-f8dDdrp4.js
- razor-C8pOqqry.js
- redis-fvZQY4PI.js
- redshift-45Et0LQi.js
- restructuredtext-C7UUFKFD.js
- ruby-CZO8zYTz.js
- rust-Bfetafyc.js
- sb-3GYllVck.js
- scala-foMgrKo1.js
- scheme-CHdMtr7p.js
- scss-C1cmLt9V.js
- shell-ClXCKCEW.js
- solidity-MZ6ExpPy.js
- sophia-DWkuSsPQ.js
- sparql-AUGFYSyk.js
- sql-32GpJSV2.js
- st-CuDFIVZ_.js
- swift-t-PfMj7W.js
- systemverilog-Ch4vA8Yt.js
- tcl-D74tq1nH.js
- toggleHighContrast-CmI6H2gJ.js
- ts.worker-Dp2_QI6H.js
- tsMode-DgC3tGu_.js
- twig-C6taOxMV.js
- typescript-PjDChiYw.js
- typespec-D-PIh9Xw.js
- vb-Dyb2648j.js
- wgsl-BhLXMOR0.js
- workers-B_Zs9c54.js
- xml-BgCkTIhY.js
- yaml-D0tu26m-.js
app/src/app/(app)/workspace/page.tsx
1import Link from "next/link";2import { Send, Paperclip, Pause, Play, Square, Maximize2, FileCode2, Folder, CheckCircle2, Circle } from "lucide-react";3import { Badge, Card, MaturityBadge, Notice, PageHeader } from "@/components/ui";4import { list, read, gitInfo } from "@/lib/files";5import { isSecure } from "@/lib/auth";6import { getCtx } from "@/lib/tenant";7import { credentialStatus, mockAllowed } from "@/lib/providers";8import { opencodeInfo, loadEngineSettings } from "@/lib/engines";9import { ProjectEditor } from "@/components/project-editor";10import { db } from "@/lib/db";11import { AiChat } from "@/components/ai-chat";12export const dynamic = "force-dynamic";13export const metadata = { title: "AI Workspace" };14const VIEWS = ["Design", "Code", "Editor", "Terminal", "Preview", "Testing", "Deployment"] as const;1516export default async function Workspace({ searchParams }: { searchParams: Promise<{ view?: string; file?: string; dir?: string; full?: string }> }) {17 const sp = await searchParams; const view = (VIEWS as readonly string[]).includes(sp.view ?? "") ? sp.view! : "Code";18 const dir = sp.dir ?? "app/src"; const nodes = list(dir) ?? []; const file = sp.file ?? "app/src/lib/modules.ts"; const f = read(file); const git = gitInfo();19 const q = (o: Record<string, string>) => "?" + new URLSearchParams({ view, dir, file, ...o }).toString();20 const full = sp.full;21 const ctx = await getCtx(); const authed = !!ctx, secure = await isSecure(); const cs = ctx ? Object.keys(await credentialStatus(ctx.orgId)).filter(k => k === "anthropic" || k === "openai") : [];22 const oc = await opencodeInfo(), es = await loadEngineSettings();23 const projList = ctx ? (await db().prepare("SELECT id,name,data FROM projects WHERE org_id=? ORDER BY created_at DESC").all(ctx.orgId)).map(p => { let e = ""; try { e = JSON.parse(String(p.data)).engine ?? ""; } catch {} return { id: String(p.id), name: String(p.name), engine: String(e) }; }) : [];24 const Chat = <Card title="Conversation" pad={false} action={<MaturityBadge state={cs.length || es.consent ? "partial" : mockAllowed() ? "partial" : "awaiting"} />} className="flex flex-col"><AiChat configured={cs} mock={mockAllowed()} signedIn={authed} secure={secure} ocModels={authed && es.consent ? oc.freeModels : []} defaultEngine={es.default} projects={authed ? projList : []} /></Card>;25 const Tree = <Card title="Project files" pad={false} action={<Badge tone="ok">read-only</Badge>}>26 <ul className="max-h-80 overflow-auto p-1.5 text-sm">{dir !== "." && dir !== "" && <li><Link className="flex items-center gap-2 rounded px-2 py-1 text-muted hover:bg-surface2" href={q({ dir: dir.split("/").slice(0, -1).join("/") || "." })}>..</Link></li>}27 {nodes.map(n => <li key={n.path}><Link href={n.dir ? q({ dir: n.path }) : q({ file: n.path })} className={`flex items-center gap-2 rounded px-2 py-1 hover:bg-surface2 ${n.path === file ? "bg-accentsoft text-accent" : ""}`}>28 {n.dir ? <Folder size={14} aria-hidden /> : <FileCode2 size={14} aria-hidden />}<span className="truncate">{n.name}</span></Link></li>)}</ul></Card>;29 const Editor = <Card title={<span className="mono">{file}</span>} pad={false} action={<Link className="btn btn-sm" href={q({ full: full === "editor" ? "" : "editor" })} aria-label="Toggle full screen"><Maximize2 size={13} /></Link>}>30 {f ? <pre className={`mono overflow-auto p-3 leading-relaxed ${full === "editor" ? "max-h-[70vh]" : "max-h-80"}`}>{f.text.split("\n").map((l, i) => <div key={i} className="flex"><span className="w-9 shrink-0 select-none pr-3 text-right text-muted">{i + 1}</span><span className="whitespace-pre">{l}</span></div>)}</pre> : <div className="p-4 text-sm text-muted">File not viewable.</div>}</Card>;31 return <>32 <PageHeader title="AI Engineering Workspace" desc="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." badge={<MaturityBadge state="partial" />} />33 <div role="tablist" aria-label="Workspace views" className="mb-4 flex gap-1 overflow-x-auto">{VIEWS.map(v => <Link key={v} role="tab" aria-selected={v === view} href={q({ view: v, full: "" })} className={`btn btn-sm ${v === view ? "btn-primary" : ""}`}>{v}</Link>)}</div>34 {view === "Code" && (full === "editor" ? Editor : <div className="grid gap-4 xl:grid-cols-[18rem_1fr_24rem]">{Tree}{Editor}{Chat}</div>)}35 {view === "Editor" && <div className="grid gap-4 xl:grid-cols-[1fr_24rem]"><Card title="Project editor" pad={false} action={<Badge tone="ok">per-project sandboxed files</Badge>}><ProjectEditor signedIn={authed} secure={secure} projects={ctx ? (await db().prepare("SELECT id,name FROM projects WHERE org_id=? ORDER BY created_at DESC").all(ctx.orgId)).map(p => ({ id: String(p.id), name: String(p.name) })) : []} /></Card>{Chat}</div>}36 {view === "Design" && <div className="grid gap-4 lg:grid-cols-2"><Card title="Design context"><p className="text-sm text-muted">Tokens, screenshots and visual QA live in the Design Studio.</p><Link className="btn mt-3" href="/design">Open Design Studio</Link></Card>{Chat}</div>}37 {view === "Terminal" && <Notice tone="err" title="Terminal unavailable">A secure, sandboxed terminal needs a rootless container runtime, which requires administrator access on this VPS. No shell is exposed. See Blockers.</Notice>}38 {view === "Preview" && <Card title="Live application preview"><p className="text-sm text-muted">Preview of generated projects appears here once the agent builds an app inside a sandbox. This product's own deployed UI is the page you are viewing.</p></Card>}39 {view === "Testing" && <Card title="Testing"><p className="text-sm text-muted">Latest browser QA results are published on the evidence page.</p><Link className="btn mt-3" href="/progress">Open evidence</Link></Card>}40 {view === "Deployment" && <Card title="Deployment"><p className="text-sm text-muted">Release history and health evidence are in the Deployment Center.</p><Link className="btn mt-3" href="/deployments">Open Deployment Center</Link></Card>}41 <div className="mt-4 grid gap-4 md:grid-cols-3">42 <Card title="Task checklist"><ul className="space-y-1.5 text-sm">{[["Application shell deployed", true], ["Persistent projects", true], ["Agent runtime", false], ["Sandboxed terminal", false]].map(([t, d]) => <li key={String(t)} className="flex items-center gap-2">{d ? <CheckCircle2 size={15} className="text-[var(--ok)]" /> : <Circle size={15} className="text-muted" />}<span className={d ? "" : "text-muted"}>{t}</span></li>)}</ul></Card>43 <Card title="Execution activity"><p className="text-sm text-muted">No agent sessions. Git HEAD <span className="mono">{git.head || "n/a"}</span> on <span className="mono">{git.branch || "n/a"}</span>.</p></Card>44 <Card title="Approval requests"><p className="text-sm text-muted">None pending.</p></Card></div></>;45}46
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 0eebc42 on master.
Approval requests
None pending.