Screens

Agent Console

A team view of agents in production — background runs, a trace, eval results, usage and rate limits.

3 variantsMIT

Preview

Full screen

Installation

Copies the screen into components/ and installs every component it uses, with their dependencies and theme tokens.

pnpm dlx shadcn@latest add https://uilab.tmih06.com/r/agent-console.json

Usage

Pass your own data and wire the callbacks to your agent runtime.

import { AgentConsole } from "@/components/agent-console";

export function ConsoleScreen({ fleet }: { fleet: Fleet }) {
  return (
    <AgentConsole
      data={{
        title: "Agents",
        environment: fleet.env,
        team: fleet.agents.map((a) => ({ id: a.id, name: a.name, status: a.presence })),
        stats: fleet.kpis, // StatGrid items
        agents: fleet.runs, // BackgroundAgents items
        run: { name: fleet.selected.name, spans: fleet.selected.spans, elapsedMs: fleet.selected.ms },
        evals: fleet.latestEval, // EvalResults data
        usage: fleet.usage, // UsageSummary data
        limits: fleet.rateLimits, // RateLimits data
        context: fleet.context, // ContextWindowMeter data
        incident: fleet.incident && {
          title: fleet.incident.title,
          description: fleet.incident.summary,
          approvals: fleet.incident.pendingActions, // ToolApprovalQueue items
        },
      }}
      onSelectAgent={(agent) => openRun(agent.id)}
      onDecide={(requests, decision, scope) => resolve(requests, decision, scope)}
      onAcknowledge={() => acknowledge(fleet.incident.id)}
    />
  );
}

// While the fleet loads, pass null explicitly — the skeleton keeps every region
// of the dashboard in place instead of blanking the shell. Keep stale data and
// set loading when refetching.
export function ConsoleScreenState({ query }: { query: FleetQuery }) {
  return (
    <AgentConsole
      data={query.data ? toConsoleData(query.data) : null}
      loading={query.isRefetching}
      skeleton={{ team: 3, stats: 4, agents: 4 }}
    />
  );
}

// Mount nothing else for toasts: the screen renders its own Toaster, so
// toast("…") calls from anywhere show up inside the console.

Props

PropTypeDefaultDescription
data*AgentConsoleData | null—Everything the console shows: nav team, KPIs, background runs, the selected run's spans, eval results, usage, rate limits, context and an optional incident. Pass null while loading: the screen renders a layout-preserving skeleton instead.
loadingboolean—Force the skeleton while refetching, even when stale data is available. The empty states never flash while this or a null `data` is in effect.
skeleton{ team?: number; stats?: number; agents?: number }—Shape hints for the loading state: how many team rows, KPI cards and agent tiles to draw before the real cardinality is known. Falls back to stale data lengths, then to small defaults.
section"agents" | "runs" | "evals" | "usage" | "settings"—Active nav item. Uncontrolled by default.
onSectionChange(section: ConsoleSection) => void—Called when a nav item is picked.
onSelectAgent(agent: BackgroundAgent) => void—Open a background run, e.g. to load its trace.
onDecide(requests, decision, scope) => void—Forwarded to the incident's ToolApprovalQueue.
onRetryLimits() => void—Forwarded to RateLimits' Retry now.
onAcknowledge() => void—The incident banner's Acknowledge button.
localestring—Intl locale for numbers, money, dates and durations in the widgets.
labelsPartial<AgentConsoleLabels>—Your own UI strings (nav, sidebar, incident banner, the `loading` screen-reader announcement), plus `avatar`, `approvals`, `stats`, `agents`, `runTrace`, `evals`, `usage`, `limits`, `context` and `toasts` for the components inside, for translating. Right-to-left works under `dir="rtl"`: the nav and drawer move to the right, charts and code stay left to right.
classNamestring—Extra classes for the root. The screen fills its parent.
type AgentConsoleData = {
  title: string;
  environment?: string;
  team: { id: string; name: string; status?: "online" | "away" | "busy" | "working" }[];
  stats: Stat[];                 // from stat-grid
  agents: BackgroundAgent[];     // from background-agents
  run: { name: string; spans: TraceSpan[]; elapsedMs: number; failed?: boolean };
  evals: EvalResultsProps["data"];
  usage: UsageSummaryProps["data"];
  limits: RateLimitsProps["data"];
  context: { limit: number; segments: ContextSegment[]; model?: string };
  incident?: { title: string; description: string; approvals: ToolApprovalRequest[] };
};