Loading component…
Loading component…
An agent run as a timing diagram – a signal line per agent that steps up when it thinks or calls a tool, with hand-offs drawn straight between rows
To reuse this local React demo, copy all files from the Code tab into the same folder, then import AgentTiming from ./agent-timing.
import { AgentTiming, type TimingParticipant, type TimingSegment, type TimingHandoff } from "@/components/ui/agent-timing";
const participants: TimingParticipant[] = [
{ id: "you", name: "You", kind: "person" },
{ id: "lead", name: "Lead" },
{ id: "coder", name: "Coder" },
];
const segments: TimingSegment[] = [
{ who: "lead", state: "thinking", start: 0.5, end: 4, label: "Planning the fix" },
{ who: "lead", state: "tool", start: 4, end: 8, label: "search_code" },
{ who: "coder", state: "tool", start: 9, label: "edit_file" }, // no end – still running
];
const handoffs: TimingHandoff[] = [
{ from: "you", to: "lead", at: 0.2, label: "Fix the cart total bug" },
{ from: "lead", to: "coder", at: 8.6, label: "Fix rounding in cart.ts" },
];
export function Run({ now }: { now: number }) {
return <AgentTiming title="Fix the cart total" participants={participants} segments={segments} handoffs={handoffs} now={now} />;
}| Name | Type | Default | Description |
|---|---|---|---|
| participants | TimingParticipant[] | The rows – { id, name, kind?, color? }. person is the full pixel mark in ink; agents their own mark, the first blue, the others the palette | |
| segments | TimingSegment[] | What each one did – { who, state, start, end?, label?, id? } in seconds from the start. thinking is a low step, tool a high one with its name, waiting a dashed amber step. No end: it still runs and reaches to now | |
| handoffs | TimingHandoff[] | Hand-offs – { from, to, at, label?, id? }. A thin arrow from one row to the other, drawn in as now passes it | |
| now | number | Seconds since the run started – the now line; steps without an end grow to it. Leave it out for a finished run | |
| duration | number | Seconds the axis shows – by default the run's length with a little room | |
| title | string | The run's name in the bar | |
| className | string | Extra class on the root – set the color variables on it, e.g. --ui-atg-gutter |
The time axis fits the width – a tick about every 90px, in seconds, minutes or hours
Narrow: the names and what they do become their pixel marks, the counts go under the title
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"