Loading component…
Loading component…
One agent at work, as a card – its current step with a clock and the bill so far, the finished steps with each tool's logo, and the exact command when it needs your OK.
To reuse this local React demo, copy all files from the Code tab into the same folder, then import AgentMonitor from ./agent-monitor.
import { AgentMonitor } from "@/components/ui/agent-monitor";
<AgentMonitor
state={run.state} // "idle" | "running" | "waiting" | "paused" | "finished" | "failed" | "cancelled"
agent={{ name: "Claude Opus 5.5", role: "Release agent", mark: <ClaudeLogo /> }}
since={run.since}
pausedFor={run.pausedFor}
cost={run.cost}
steps={[
{ id: "issues", label: "Collected 14 issues", icon: <LinearLogo />, state: "done", took: 1700 },
{ id: "notes", label: "Drafting the release notes", icon: <NotionLogo />, state: "running", since: run.stepSince },
{ id: "build", label: "Build the preview", kind: "run", state: "queued" },
]}
ask={{ title: "Ready to ship", command: "gh release create v3.2.0 --latest", icon: <GitHubLogo /> }}
outcome={{ note: "v3.2.0 is live · 14 changes" }}
onPause={() => runs.pause(run.id)}
onResume={() => runs.resume(run.id)}
onCancel={() => runs.cancel(run.id)}
onAllow={() => runs.allow(run.id)}
onDecline={() => runs.decline(run.id)}
onRetry={() => runs.retry(run.id)}
onOpenLog={() => openLog(run.id)}
/>| Name | Type | Default | Description |
|---|---|---|---|
| state | "idle" \| "running" \| "waiting" \| "paused" \| "finished" \| "failed" \| "cancelled" | "idle" | Where the run is – a small pill next to the cost: blue Running, amber Needs you, green Finished, red Failed |
| agent | { name: string; role?: string; mark?: ReactNode } | { name: "Agent" } | Who's working: a name, a role or model, and a 16px logo – without one, the name's first letter |
| icon (step) | ReactNode | The logo of the tool the step used – GitHub, Linear, Slack, Notion… – shown in its row and in the well | |
| tool / detail / output (step) | string | Fill the step's info card: the tool's name, a sentence on what happened, and the command it ran or the place it touched – a click on the row or its bar opens it | |
| kind (step) | "read" \| "search" \| "edit" \| "run" \| "think" \| "web" | A plain icon for steps without a logo | |
| current | { label: string; kind?; icon? } | Overrides what the well says while running – by default it's the running step | |
| since / until | number | When the run began and ended (ms) – the clock counts between them | |
| pausedFor | number | 0 | Time spent paused (ms), left out of the clock so it picks up where it stopped |
| cost | number | USD spent so far – shimmers while the agent is busy | |
| ask | { title: string; command?: string; icon?: ReactNode } | While waiting: a short title, the exact command as code, and the logo of the tool it's about to use | |
| outcome | { added?; removed?; files?; note? } | Once finished: lines added and removed, files touched, or a short note – after "Finished in 19s" | |
| error | string | Once failed: what went wrong, in a few words | |
| onAllow / onDecline | () => void | Allow and Decline while waiting – Enter and Escape do the same while the card has the focus | |
| onPause / onResume / onCancel | () => void | Steer a running or paused run – Pause or Resume and Cancel sit side by side as two small buttons; paused, the clock and the running bar stand still | |
| onRetry | () => void | Try again after a failure | |
| onOpenLog | () => void | Shows Log, to jump to the full trace | |
| defaultFolded | boolean | false | Start folded, as the small bar |
| className | string | Extra class on the root |
372px wide (a white card on a gray tray, the controls on the tray), or narrower with its container – long steps and commands end in an ellipsis
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"