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- ..
- apple-touch-icon.png
- brand-guidelines-v2.md
- brand-manifest-v2.json
- favicon-16.png
- favicon-32.png
- favicon-48.png
- favicon.ico
- icon-192.png
- icon-512.png
- maskable-192.png
- maskable-512.png
- source-brand-board.png
- source-crop-icon-fullcolor.png
- source-crop-lockup-dark.png
- source-crop-wordmark-light.png
- zloud-app-icon-1024.png
- zloud-app-icon.svg
- zloud-favicon.svg
- zloud-mark-1024.png
- zloud-mark-512.png
- zloud-mark-mono-512.png
- zloud-mark-mono.svg
- zloud-mark-reversed.svg
- zloud-mark-white-512.png
- zloud-mark-white.svg
- zloud-mark.svg
- zloud-maskable.svg
- zloud-wordmark-dark.svg
- zloud-wordmark-light.svg
- zloud-wordmark-mono.svg
app/src/app/(app)/projects/new/page.tsx
1"use client";2import { useEffect, useState } from "react";3import { useRouter } from "next/navigation";4import { Check } from "lucide-react";5import { Card, Notice, PageHeader, MaturityBadge } from "@/components/ui";6import { APP_TYPES, FEATURES, STACKS, draftRequirements, type WizardData } from "@/lib/requirements";78const STEPS = ["Idea", "Scope", "Design", "Delivery", "Review"];9const empty: WizardData = { description: "", appType: APP_TYPES[0], audience: "", features: [], design: "", refs: "", env: "Experimental VPS", domain: "", budgetUsd: 20, autonomy: "L2 Supervised" };1011export default function Wizard() {12 const router = useRouter(); const [step, setStep] = useState(0); const [d, setD] = useState<WizardData>(empty); const [name, setName] = useState("");13 const [err, setErr] = useState(""); const [busy, setBusy] = useState(false); const [saved, setSaved] = useState(false); const [id, setId] = useState<string | undefined>();14 useEffect(() => { try { const s = localStorage.getItem("zcs-wizard"); if (s) { const j = JSON.parse(s); setD({ ...empty, ...j.d }); setName(j.name ?? ""); setStep(j.step ?? 0); setId(j.id); } } catch {} }, []);15 useEffect(() => { try { localStorage.setItem("zcs-wizard", JSON.stringify({ d, name, step, id })); setSaved(true); } catch {} }, [d, name, step, id]);16 const set = <K extends keyof WizardData>(k: K, v: WizardData[K]) => setD(p => ({ ...p, [k]: v }));17 const valid = step === 0 ? name.trim().length >= 2 && d.description.trim().length >= 10 : true;1819 async function save(status: "draft" | "active") {20 setBusy(true); setErr("");21 const r = await fetch("/api/projects", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ id, name, status, wizard: d }) });22 const j = await r.json().catch(() => ({}));23 if (r.status === 401) { setErr("Sign in to save projects. Your draft is kept in this browser."); setBusy(false); return; }24 if (!r.ok) { setErr(j.error || "Save failed"); setBusy(false); return; }25 setId(j.id); try { localStorage.removeItem("zcs-wizard"); } catch {} router.push(`/projects/${j.id}`);26 }27 const L = ({ t, children, htmlFor }: { t: string; children: React.ReactNode; htmlFor?: string }) => <div className="space-y-1.5"><label className="text-sm font-medium" htmlFor={htmlFor}>{t}</label>{children}</div>;2829 return <>30 <PageHeader title="New project" desc="Describe what you want built. Progress is saved in this browser until you create the project." badge={<MaturityBadge state="partial" />} />31 <ol className="mb-5 flex gap-1 overflow-x-auto" aria-label="Wizard steps">{STEPS.map((s, i) => <li key={s} className={i === step ? "flex-[2] sm:flex-1" : "flex-1"}><button onClick={() => setStep(i)} aria-current={i === step ? "step" : undefined}32 className={`flex w-full items-center gap-2 rounded-lg border px-2.5 py-2 text-sm ${i === step ? "border-accent bg-accentsoft text-accent" : "border-line text-muted"}`}>33 <span className="grid h-5 w-5 place-items-center rounded-full border border-current text-[11px]">{i < step ? <Check size={11} /> : i + 1}</span><span className={i === step ? "" : "hidden sm:inline"}>{s}</span></button></li>)}</ol>34 <div className="grid gap-4 lg:grid-cols-3"><div className="lg:col-span-2"><Card>35 <div className="space-y-5">36 {step === 0 && <>37 <L t="Project name" htmlFor="pn"><input id="pn" className="input" value={name} onChange={e => setName(e.target.value)} maxLength={80} placeholder="e.g. Field Survey Tracker" /></L>38 <L t="What should it do? (natural language)" htmlFor="pd"><textarea id="pd" className="input min-h-36" value={d.description} onChange={e => set("description", e.target.value)} maxLength={5000} placeholder="Describe the product, who uses it and the main outcomes…" />39 <div className="text-xs text-muted">{d.description.length}/5000 · at least 10 characters</div></L></>}40 {step === 1 && <>41 <L t="Application type" htmlFor="at"><select id="at" className="input" value={d.appType} onChange={e => set("appType", e.target.value)}>{APP_TYPES.map(a => <option key={a}>{a}</option>)}</select></L>42 <L t="Target audience" htmlFor="au"><input id="au" className="input" value={d.audience} onChange={e => set("audience", e.target.value)} placeholder="e.g. field officers, internal finance team" /></L>43 <fieldset><legend className="mb-1.5 text-sm font-medium">Features</legend><div className="grid gap-2 sm:grid-cols-2">{FEATURES.map(f => <label key={f} className="flex items-center gap-2 rounded-lg border border-line px-3 py-2 text-sm">44 <input type="checkbox" className="h-4 w-4 accent-[var(--accent)]" checked={d.features.includes(f)} onChange={e => set("features", e.target.checked ? [...d.features, f] : d.features.filter(x => x !== f))} />{f}</label>)}</div></fieldset></>}45 {step === 2 && <>46 <L t="Design preferences" htmlFor="dp"><textarea id="dp" className="input min-h-24" value={d.design} onChange={e => set("design", e.target.value)} placeholder="Tone, colours, density, dark/light…" /></L>47 <L t="Reference URLs" htmlFor="rf"><input id="rf" className="input" value={d.refs} onChange={e => set("refs", e.target.value)} placeholder="https://… (treated as untrusted until reviewed)" /></L>48 <Notice tone="info" title="Uploads not available yet">Document and image attachments are not implemented; use reference URLs for now.</Notice></>}49 {step === 3 && <>50 <div className="grid gap-4 sm:grid-cols-2">51 <L t="Environment" htmlFor="ev"><select id="ev" className="input" value={d.env} onChange={e => set("env", e.target.value)}><option>Experimental VPS</option><option disabled>Staging (not provisioned)</option><option disabled>Production (not provisioned)</option></select></L>52 <L t="Domain (optional)" htmlFor="dm"><input id="dm" className="input" value={d.domain} onChange={e => set("domain", e.target.value)} placeholder="app.example.com" /></L>53 <L t="Budget cap (USD / month)" htmlFor="bd"><input id="bd" className="input" type="number" min={0} max={10000} value={d.budgetUsd} onChange={e => set("budgetUsd", Math.max(0, Number(e.target.value) || 0))} /></L>54 <L t="AI engine" htmlFor="en"><select id="en" className="input" value={d.engine ?? ""} onChange={e => set("engine", e.target.value)}><option value="">Workspace default</option><option value="opencode">OpenCode (free models, needs owner consent)</option><option value="anthropic">Direct Anthropic API (needs key)</option><option value="openai">Direct OpenAI API (needs key)</option></select></L>55 <L t="Autonomy policy" htmlFor="ap"><select id="ap" className="input" value={d.autonomy} onChange={e => set("autonomy", e.target.value)}><option>L0 Manual</option><option>L1 Assisted</option><option>L2 Supervised</option></select></L></div>56 <p className="text-xs text-muted">L3 Autonomous is intentionally unavailable until the policy engine and sandbox exist. Purchases, deletions and credential changes always require approval.</p></>}57 {step === 4 && <><L t="Final project specification (rule-based draft)"><pre className="mono max-h-96 overflow-auto whitespace-pre-wrap rounded-lg border border-line bg-surface2 p-3">{`Name: ${name || "(unnamed)"}\n\n` + draftRequirements(d)}</pre></L>58 <Notice tone="warn" title="Not AI-generated">This draft is built from your answers by a fixed template. LLM-generated requirements need a connected provider.</Notice></>}59 {err && <div role="alert" className="rounded-lg bg-[var(--err-bg)] px-3 py-2 text-sm text-[var(--err)]">{err}</div>}60 <div className="flex flex-wrap items-center justify-between gap-2 border-t border-line pt-4">61 <button className="btn" disabled={step === 0} onClick={() => setStep(step - 1)}>Back</button>62 <div className="flex gap-2">{step === 4 && <button className="btn" disabled={busy || name.trim().length < 2} onClick={() => save("draft")}>Save as draft</button>}63 {step < 4 ? <button className="btn btn-primary" disabled={!valid} onClick={() => setStep(step + 1)}>Continue</button> : <button className="btn btn-primary" disabled={busy || name.trim().length < 2} onClick={() => save("active")}>{busy ? "Creating…" : "Create project"}</button>}</div></div>64 </div></Card></div>65 <Card title="Recommendation"><div className="space-y-3 text-sm"><div><div className="text-xs text-muted">Suggested stack</div><div className="font-medium">{STACKS[d.appType]}</div></div>66 <div><div className="text-xs text-muted">Features selected</div><div>{d.features.length || "none"}</div></div>67 <div className="text-xs text-muted">{saved ? "Draft autosaved in this browser." : ""}</div></div></Card></div></>;68}69
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.