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/(app)/console/page.tsx

1import Link from "next/link";
2import { Cloud, FolderKanban, Network, Coins, CheckCircle2, Circle } from "lucide-react";
3import { Badge, Card, Empty, MaturityBadge, PageHeader, Stat, ago } from "@/components/ui";
4import { SignInCard, fmtUsd } from "@/components/console-ui";
5import { Pill } from "@/components/console-client";
6import { db } from "@/lib/db";
7import { getCtx } from "@/lib/tenant";
8import { listAudit } from "@/lib/audit";
9import { nodeState, usageSummary } from "@/lib/cloud";
10export const dynamic = "force-dynamic";
11export const metadata = { title: "Overview" };
12export default async function Overview() {
13 const ctx = await getCtx(); if (!ctx) return <SignInCard what="your cloud console" />;
14 const o = ctx.orgId; const u = await usageSummary(o);
15 const insts = await db().prepare("SELECT id,name,target,status FROM instances WHERE org_id=? AND status<>'terminated' ORDER BY created_at DESC LIMIT 5").all(o) as any[];
16 const nodes = (await db().prepare("SELECT id,label,revoked_at,enroll_used_at,last_seen FROM nodes WHERE org_id=? ORDER BY created_at DESC LIMIT 6").all(o) as any[]).map(n => ({ ...n, state: nodeState(n) }));
17 const online = nodes.filter(n => n.state === "online").length; const events = await listAudit("", 6, o);
18 const steps: [string, boolean, string][] = [["Create a cloud instance", u.counts.instances > 0, "/console/instances"], ["Connect a server (external VPS) or request a managed one", u.counts.nodes > 0, "/console/servers"], ["Start an application project", u.counts.projects > 0, "/projects/new"], ["Invite your team", false, "/console/team"]];
19 return <>
20 <PageHeader title="Cloud console" desc={`${ctx.orgName} · you are ${ctx.role}`} badge={<MaturityBadge state="partial" />} />
21 <div className="grid grid-cols-2 gap-3 lg:grid-cols-4"><Stat label="Cloud instances" value={`${u.counts.instances}/${u.quotas.instances}`} sub="active quota" /><Stat label="Servers online" value={`${online}/${nodes.length}`} sub="external agents" />
22 <Stat label="Applications" value={`${u.counts.projects}/${u.quotas.projects}`} sub="projects" /><Stat label="AI spend (month)" value={fmtUsd(u.ai.usd)} sub={`cap $${u.ai.cap_usd}`} /></div>
23 <div className="mt-4 grid gap-4 lg:grid-cols-3">
24 <Card title="Get started" className="lg:col-span-1"><ul className="space-y-2 text-sm">{steps.map(([t, d, h]) => <li key={t}><Link href={h} className="flex items-center gap-2 hover:underline">{d ? <CheckCircle2 size={16} className="text-[var(--ok)]" /> : <Circle size={16} className="text-muted" />}<span className={d ? "text-muted" : ""}>{t}</span></Link></li>)}</ul></Card>
25 <Card title="Cloud instances" className="lg:col-span-2" pad={false} action={<Link href="/console/instances" className="text-xs text-accent hover:underline">Manage</Link>}>
26 {insts.length === 0 ? <Empty title="No cloud instances yet" desc="Create one and choose whether it runs on your own VPS or Zloud Compute (managed)." action={<Link className="btn btn-primary" href="/console/instances">Create instance</Link>} /> :
27 <ul className="divide-y divide-line text-sm">{insts.map(i => <li key={i.id} className="flex items-center justify-between gap-2 px-4 py-3"><div><div className="font-medium">{i.name}</div><div className="text-xs text-muted">{i.target === "managed" ? "Zloud Compute (managed)" : "External VPS"}</div></div><Pill s={i.status} /></li>)}</ul>}</Card>
28 <Card title="Servers" pad={false} action={<Link href="/console/servers" className="text-xs text-accent hover:underline">Open</Link>}>{nodes.length === 0 ? <p className="p-4 text-sm text-muted">No servers connected.</p> : <ul className="divide-y divide-line text-sm">{nodes.map(n => <li key={n.id} className="flex items-center justify-between gap-2 px-4 py-2"><span className="truncate">{n.label}</span><Pill s={n.state} /></li>)}</ul>}</Card>
29 <Card title="Recent activity" className="lg:col-span-2" pad={false}>{events.length === 0 ? <p className="p-4 text-sm text-muted">No activity yet.</p> : <ul className="divide-y divide-line text-sm">{events.map(e => <li key={e.seq} className="flex items-center justify-between gap-2 px-4 py-2"><span className="mono truncate text-xs">{e.action}</span><span className="whitespace-nowrap text-xs text-muted">{ago(e.ts)}</span></li>)}</ul>}</Card></div>
30 <p className="mt-4 text-xs text-muted"><Cloud size={12} className="mr-1 inline" aria-hidden />Everything shown is scoped to <b>{ctx.orgName}</b>. <Badge tone="info">pre-release</Badge> Metering only — nothing is billed.</p></>;
31}
32

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 692573d on master.

Approval requests

None pending.