Loading component…
Loading component…
A live multi-agent run as a tree on a canvas – watch work flow to the running agents, follow every call in the trace below and open an agent for its tasks, context and cost
To reuse this local React demo, copy all files from the Code tab into the same folder, then import Agent/Orchestration from ./agent-orchestration.
import { AgentOrchestrationScreen } from "@/components/ui/agent-orchestration";
export default function Page() {
return (
<AgentOrchestrationScreen
project="Market research"
runId={run.id}
agents={run.agents}
events={run.events}
elapsed={run.elapsed}
onResolve={(agent, answer) => api.answer(run.id, agent.id, answer)}
onRunControl={(action) => api.control(run.id, action)}
onNavigate={(label) => router.push(routes[label])}
/>
);
}| Name | Type | Default | Description |
|---|---|---|---|
| onNavigate | (label: string) => void | Called with the label of a sidebar item | |
| workspace | string | "Northwind" | The workspace in the sidebar |
| project | string | "Market research" | Project in the path |
| runId | string | "run_8f3a2c" | The run in the path – its menu lists earlier runs, Compare, Copy run ID and Download trace |
| agents | { id; parent?; name; role; task; model; maker?; mark?; tools?; status; start?; end?; tokensIn?; tokensOut?; tokensCached?; cost?; rate?; ask?; error?; retryOf?; tasks?; context? }[] | Every agent – the one without a parent is the orchestrator on top. status is queued, running, waiting, done, failed or stopped; start and end in ms from the start of the run; cost is its own, the branch is summed up; rate { tokens, cost } per second keeps a running agent ticking; ask is what a waiting agent asks you, error what failed, retryOf the agent it retries; tasks are the items of its task list | |
| tools | { id; label; icon }[] | The tools agents call – the icons are the tiles on the cards and the rows in the panel | |
| spans | { id; agent; name; kind: "agent" \| "llm" \| "tool"; start; end?; status; detail? }[] | The trace's bars – made up from each agent's tasks when left out (an LLM call, then the tool call, per task) | |
| events | { id; at; agent; type: "start" \| "handoff" \| "tool" \| "approval" \| "error" \| "retry" \| "done"; text }[] | What happened – each one shows under Events once the run's clock reaches its at | |
| elapsed | number | 94000 | How far the run is when the screen opens, in ms – the figures in agents describe this moment |
| live | boolean | true | Whether the clock runs on – running agents keep adding time, tokens and cost; false opens it paused |
| defaultTab | "Trace" \| "Tokens & cost" \| "Events" | "Trace" | The run panel's tab when the screen opens |
| onSelect | (agent: AoAgent \| null) => void | Called when an agent's panel opens, and with null when it closes | |
| onResolve | (agent: AoAgent, answer: "approve" \| "reject") => void | An answer to an agent that waits for you – Approve lets it go on, Reject stops its branch | |
| onRunControl | (action: "start" \| "pause" \| "resume" \| "stop" \| "restart") => void | Start run (in the empty state), Pause run, Resume, Stop and Run again on the top right | |
| labels | { start?; pause?; resume?; stop?; restart? } | Labels, e.g. for a translation | |
| user | { name: string; avatar?: string } | { name: "Alex Morgan" } | Account at the bottom of the sidebar |
| loading | boolean | While the run loads: gray cards on the canvas in the tree's shape – the same sizes, places and gray lines – gray rows in the run panel's open tab and no figures in its head (the shared Skeleton); the clock waits and nothing flows, then the run starts from elapsed | |
| empty | boolean | A run that hasn't started: an empty canvas with one centered “Start the run” and a Start run button (also on the top right, in place of Pause and Stop), the run panel's own empty states and a clock that waits at zero | |
| className | string | Extra class on the root |
Fills its container – give it the full viewport height in your app
The tree opens at 80% or more and starts at the top when it's taller than the canvas; Fit to view never zooms past 100%
Pan by dragging, with a plain wheel or two fingers; zoom with the toolbar, ⌘/Ctrl + wheel or a pinch. A plain wheel pans right away when the canvas fills a page that doesn't scroll; in a longer page, once you've clicked into it
The run panel stays open under the canvas – drag its top edge, or fold it to a slim bar; the canvas keeps its zoom and place either way
Below 640px the agent's panel becomes a sheet from the bottom, the run controls and tabs turn into icons, the trace and the cost table keep the columns that matter; touch targets grow to 36px
Beside the open panel, when the top bar runs short, the run controls turn into icons too, so the path keeps its words
The trace's axis grows with the run – seconds, minutes, then hours and days – and keeps as many ticks as it has room for
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"