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-onlyapp/src/components/ui.tsx
1import Link from "next/link";2import { MATURITY_LABEL, type Maturity } from "@/lib/modules";3import type { ReactNode } from "react";45const TONE: Record<string, string> = {6 ok: "bg-[var(--ok-bg)] text-[var(--ok)]", warn: "bg-[var(--warn-bg)] text-[var(--warn)]", err: "bg-[var(--err-bg)] text-[var(--err)]",7 info: "bg-[var(--info-bg)] text-[var(--info)]", neutral: "bg-[var(--neutral-bg)] text-muted" };8export function Badge({ tone = "neutral", children, dot }: { tone?: keyof typeof TONE; children: ReactNode; dot?: boolean }) {9 return <span className={`inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap ${TONE[tone]}`}>10 {dot && <span className="h-1.5 w-1.5 rounded-full bg-current" aria-hidden />}{children}</span>;11}12const M_TONE: Record<Maturity, keyof typeof TONE> = { functional: "ok", partial: "info", demo: "warn", awaiting: "warn", blocked: "err", notstarted: "neutral" };13export const MaturityBadge = ({ state }: { state: Maturity }) => <Badge tone={M_TONE[state]} dot>{MATURITY_LABEL[state]}</Badge>;1415export function PageHeader({ title, desc, actions, badge }: { title: string; desc?: string; actions?: ReactNode; badge?: ReactNode }) {16 return <div className="mb-6 flex flex-wrap items-start justify-between gap-3">17 <div className="min-w-0"><div className="flex flex-wrap items-center gap-2"><h1 className="text-xl font-semibold tracking-tight sm:text-2xl">{title}</h1>{badge}</div>18 {desc && <p className="mt-1 max-w-2xl text-muted">{desc}</p>}</div>19 {actions && <div className="flex flex-wrap items-center gap-2">{actions}</div>}</div>;20}21export const Card = ({ title, action, children, className = "", pad = true }: { title?: ReactNode; action?: ReactNode; children: ReactNode; className?: string; pad?: boolean }) =>22 <section className={`card ${className}`}>23 {title && <header className="flex items-center justify-between gap-2 border-b border-line px-4 py-3"><h2 className="text-sm font-semibold">{title}</h2>{action}</header>}24 <div className={pad ? "p-4" : ""}>{children}</div></section>;2526export function Stat({ label, value, sub, tone }: { label: string; value: ReactNode; sub?: ReactNode; tone?: string }) {27 return <div className="card p-4"><div className="text-xs text-muted">{label}</div>28 <div className={`mt-1 text-2xl font-semibold tabular-nums tracking-tight ${tone ?? ""}`}>{value}</div>{sub && <div className="mt-0.5 text-xs text-muted">{sub}</div>}</div>;29}30export function Bar({ pct, tone = "var(--accent)", label }: { pct: number; tone?: string; label?: string }) {31 const p = Math.max(0, Math.min(100, pct));32 return <div role="progressbar" aria-valuenow={Math.round(p)} aria-valuemin={0} aria-valuemax={100} aria-label={label}33 className="h-2 w-full overflow-hidden rounded-full bg-[var(--neutral-bg)]"><div className="h-full rounded-full" style={{ width: `${p}%`, background: tone }} /></div>;34}35export function Empty({ title, desc, action }: { title: string; desc?: string; action?: ReactNode }) {36 return <div className="flex flex-col items-center justify-center gap-2 px-6 py-12 text-center">37 <div className="text-base font-medium">{title}</div>{desc && <p className="max-w-md text-muted">{desc}</p>}{action}</div>;38}39export function Notice({ tone = "warn", title, children }: { tone?: "warn" | "err" | "info"; title: string; children?: ReactNode }) {40 return <div role="note" className={`rounded-lg border border-line px-4 py-3 ${TONE[tone]}`}><div className="font-medium">{title}</div>{children && <div className="mt-0.5 text-sm opacity-90">{children}</div>}</div>;41}42export const LinkBtn = ({ href, children, primary }: { href: string; children: ReactNode; primary?: boolean }) =>43 <Link href={href} className={`btn ${primary ? "btn-primary" : ""}`}>{children}</Link>;4445export const fmtBytes = (n: number) => { const u = ["B", "KB", "MB", "GB", "TB"]; let i = 0; while (n >= 1024 && i < 4) { n /= 1024; i++; } return `${n.toFixed(n >= 100 || i === 0 ? 0 : 1)} ${u[i]}`; };46export const fmtUptime = (s: number) => { const d = Math.floor(s / 86400), h = Math.floor((s % 86400) / 3600), m = Math.floor((s % 3600) / 60); return d ? `${d}d ${h}h` : h ? `${h}h ${m}m` : `${m}m`; };47export const ago = (iso: string) => { const s = (Date.now() - new Date(iso).getTime()) / 1000; return s < 60 ? "just now" : s < 3600 ? `${Math.floor(s / 60)}m ago` : s < 86400 ? `${Math.floor(s / 3600)}h ago` : `${Math.floor(s / 86400)}d ago`; };48
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 1c27633 on master.
Approval requests
None pending.