Skip to content
  1. Home
  2. workspace
Checking…
Public 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)/superadmin/central/page.tsx

1import { Badge, Card, Notice, PageHeader } from "@/components/ui";
2import { SignInCard } from "@/components/console-ui";
3import { db } from "@/lib/db";
4import { getCtx } from "@/lib/tenant";
5import { contract, integrationStatus } from "@/lib/central";
6export const dynamic = "force-dynamic"; export const metadata = { title: "Zoo Central integration" };
7const TONE: Record<string, "ok" | "warn" | "err" | "neutral"> = { live: "ok", "ready-untested": "warn", "contract-prepared": "neutral", blocked: "err" };
8const LABEL: Record<string, string> = { live: "Live", "ready-untested": "Endpoint set, untested", "contract-prepared": "Cloud side prepared", blocked: "Blocked" };
9export default async function Central() {
10 const ctx = await getCtx(); if (!ctx) return <SignInCard what="platform administration" />;
11 if (!ctx.platformAdmin) return <Notice tone="err" title="Platform administrators only">Central integration is configured by platform administrators.</Notice>;
12 const items = await integrationStatus(); const c = await contract(); const d = db();
13 const orgs = await d.prepare("SELECT o.id,o.name,o.org_class,(SELECT central_ref FROM org_mappings m WHERE m.org_id=o.id) ref,(SELECT COUNT(*) FROM app_entitlements e WHERE e.org_id=o.id) ents FROM organizations o ORDER BY o.created_at").all() as any[];
14 const outbox = await d.prepare("SELECT status, COUNT(*) n FROM central_outbox GROUP BY status").all() as any[];
15 return (
16 <div className="space-y-6">
17 <PageHeader title="Zoo Central integration" desc="Contracts and adapters between Zloud and the Zoo Bangladesh central ecosystem. Nothing here is live unless it says Live." />
18 <Notice tone="warn" title="No Zoo Central API is documented to this project">Cloud-side contracts are prepared and tested. No Central endpoint has been invented or contacted. Zoo IAM sign-in is implemented and tested against forged-token fixtures; live sign-in needs the <code>zoo-cloud-studio</code> client secret.</Notice>
19 <Card><div className="divide-y divide-border">{items.map(a => (
20 <div key={a.id} className="grid gap-1 p-4 md:grid-cols-[14rem_1fr_11rem] md:items-start">
21 <div className="font-medium">{a.title}</div>
22 <div className="text-sm text-muted-foreground"><div>{a.contract}</div><div className="mt-1">Central side: {a.central}.{a.needs ? <> Needs: {a.needs}.</> : null}</div></div>
23 <div className="md:text-right"><Badge tone={TONE[a.state] ?? "neutral"}>{LABEL[a.state] ?? a.state}</Badge></div>
24 </div>))}</div></Card>
25 <Card><div className="p-4 text-sm"><div className="font-medium">Application identity (domain-independent)</div>
26 <div className="mt-1 break-all font-mono text-xs">{c.application.id}</div>
27 <div className="mt-2 text-muted-foreground">Current public endpoint: {c.endpoints.public}{c.portability.previousEndpoints.length ? <> · previous: {c.portability.previousEndpoints.join(", ")}</> : null}. Registration document: <a className="underline" href="/.well-known/zoo-cloud-registration.json">/.well-known/zoo-cloud-registration.json</a>.</div>
28 <div className="mt-2 text-muted-foreground">Never synchronized: {c.dataPolicy.neverSynchronized.join("; ")}.</div>
29 <div className="mt-2 text-muted-foreground">Outbox (metadata-only, queued, not delivered): {outbox.length ? outbox.map(o => `${o.status} ${o.n}`).join(", ") : "empty"}.</div></div></Card>
30 <Card><div className="overflow-x-auto"><table className="w-full text-sm"><thead><tr className="text-left text-xs text-muted-foreground"><th className="p-3">Organization</th><th className="p-3">Class</th><th className="p-3">Central reference</th><th className="p-3">Internal-app entitlements</th></tr></thead>
31 <tbody>{orgs.map(o => <tr key={o.id} className="border-t border-border"><td className="p-3">{o.name}</td><td className="p-3"><Badge tone={o.org_class === "internal" ? "ok" : "neutral"}>{o.org_class}</Badge></td><td className="p-3 font-mono text-xs">{o.ref ?? "—"}</td><td className="p-3">{o.ents}</td></tr>)}</tbody></table></div></Card>
32 </div>
33 );
34}
35

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 0eebc42 on master.

Approval requests

None pending.