Run theatre
A React component in Beamline's AI & agents category.
One agent run as a theatre: the Run trace's waterfall under a transport (play, scrub, speed) that replays the run as it happened. Pick a step and re-run it with one change (another model, a prompt version, a tool off) and the ghost run plays under the real one on the same time axis: reused steps marked same, each pair with its time and cost difference, the critical path redrawn for both, and a verdict at the end with total time and cost, the checks on both and the answer's word differences.
Use it for
- Reviewing one agent or workflow run that was slow, expensive or wrong, and testing a change to one step against it.
- The host keeps the run's steps and runs the ghost (reusing recorded results up to the change); the part replays, aligns and compares.
Not for
- A live run or a plain trace with no what-if → run-trace.
- Comparing many runs or an eval matrix → a table or chart.
Anatomy
- transport: play/pause, the scrub bar over the run's time, speed (1×, 2×, 4×)
- verdict (when a ghost exists): the step and option, then while it plays "The ghost plays under the real run", at its end the total time and cost difference (costs estimated), each check on both, the answer with the ghost's new words marked, Use for this step / Try another / Discard; a ghost that failed says why
- trace: the Run trace waterfall with the playhead; with a ghost each step from the change on has a dashed ghost bar under its bar and its difference under its time; reused steps say same, steps the ghost didn't run say not run, steps only the ghost ran say ghost only; the critical path is a hairline under its bars
- step detail: the Run trace's detail with "Re-run from here with…" and the host's options; an option that can't run says why
States
- finished (whole run shown)
- playing
- paused
- step selected
- ghost running
- ghost playing
- verdict
- ghost failed
- option unavailable (side effects)
- recorded or dry-run steps
- no difference
Keyboard
- Play is a button; the scrub bar is a slider (←/→ half a second, Home/End, Space plays and pauses); speed is a segmented control
- The trace is the Run trace's tree grid: ↑/↓ steps, Enter shows a step's detail, where Tab reaches the re-run options
- Each row reads its real and ghost time together ("Draft the answer… 14.2 s, ghost 8.1 s"); the verdict is polite live
Motion
Playback ticks ten times a second while playing and the bars and the scrub bar glide between ticks on the fast linear duration; nothing renders per frame and the clock stops at the end. Reduced motion shows the run whole: Play jumps to the end.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
spans (required) | TraceSpan[] | — | The real run, finished: every step with its start and end (ms from the run's start). |
title | ReactNode | — | |
output | string | — | The real run's final answer, for the ghost's word differences. |
rerunOptions | ((span: TraceSpan) => RerunOption[]) | — | What a step may be re-run with; none for steps that can't. |
onRerun | ((stepId: string, optionId: string) => void) | — | Re-run from this step with this option: the host runs the ghost and passes it back as `ghost`. |
ghost | RunGhost | null | — | The ghost re-run, controlled by the host (null or omitted: none). |
onUse | ((ghost: RunGhost) => void) | — | Keep the ghost's change for this step (open the config change as a draft). |
onDiscard | (() => void) | — | Throw the ghost away (Try another and Discard both call this). |
currency | string | — | |
autoPlay | boolean | — | Play the run once when it first appears. |
defaultSelected | string | null | — | |
className | string | — | Classes on the documented visual root; no override by default. |
classNames | Partial<Record<"root" | "verdict" | "trace" | "picker" | "transport", string>> | — | Classes for the named visual parts; no overrides by default. |
style | CSSProperties | — | Inline styles on the documented visual root; no overrides by default. |
ref | Ref<HTMLDivElement> | — | Receives the documented native target or imperative handle; omitted by default. |
Built from
Dependencies
lucide-react
Import
import { RunTheatre } from "@beamline/run-theatre";
Get it
Run theatre is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Get Beamline · Connect your agent
More in AI & agents
- Image generation: The frame an AI image is generated into: a field of brand-hued pixels breathes with the progress while the model works, then the image arrives —…
- Flowchart: A workflow as steps on a dotted canvas: a trigger, conditions that branch into paths side by side, actions and waits, read top to bottom; during a run…
- Run trace: One agent run as a waterfall: every step (model calls, tools, retrieval, checks, sub-agents) nested under the step that started it, each a bar on a…
- Answer compare: Two answers to the same prompt side by side, and a person's verdict: A is better, a tie, B is better, or both are bad, with the reasons that decided it…
- Branch navigator: The versions of an assistant conversation that forked when a message was edited or an answer regenerated: a “‹ 2 / 3 ›” switch on each message that has…
- Response: An assistant's answer as streamed markdown in the system's reading type: bursty tokens flow in at an even pace, each new word fades in through a short…
- Chat thread: People talking to people: messages grouped by person and day, reactions, delivery and read receipts that glide to the newest message read, who is typing…
- Model picker: Choose the AI model for a request by what it can do and what it costs: a trigger with the model's name opens a searchable list grouped by provider, with…
- Task rows: Background work an agent is doing, one row per task: status as a glyph and a word, what it produced, how long it has run or took, a progress bar while…
- Conversation: The scrolling column of a conversation: follows new content while you are at the bottom, stops when you scroll up to read, and offers a way back; shared…
- Context cards: The knowledge an agent retrieved before it answered: one card per chunk with what it is about, the text it read with the search words marked, how…
- Prompt suggestions: Ready-made prompts a person can start from or follow up with: chips, cards or a list; a picked one lifts off and flies into the composer as its text…
- Plan: An agent's plan: numbered steps with live status, progress, and Approve / Edit / Reject when it needs sign-off; approving shows progress, and a refusal…
- Approval card: The agent stops and asks before it acts: what it wants to do, exactly what that changes, any choices it needs, and Approve or Reject; both run your…
- Tool call: One tool call in an agent's run: status, what it did and a short result on one quiet row that opens to the exact input and output; stops for permission…
- Recommendation card: One suggestion from the agent that the person may take or leave: what it suggests, why, the expected effect and how sure it is (a meter and a word…
- Citations: Inline numbered citations that preview their source on hover or focus, plus a numbered source list; streamed answers flow in at an even pace with the…
- Reasoning: The agent's trace, fed by your stream: a shimmering label and the seconds so far while it works, then "Thought for N seconds"; steps that check off…
- Attachment: A file tile: preview or typed glyph with the type named, name, size, upload progress, error with retry, and a keyboard-reachable remove.
- Prompt bar: The agent composer: a field that grows, @ to add a source, / for a command, a model picker, files and dictation, and one button that sends with progress…
- Selection actions: Select a passage and hand it to the agent: a bar over the selection with quick actions, your own instruction and More; while the agent works it says so…
- Message: One turn in a conversation with an agent: the person's words in a quiet bubble, the agent's answer on the page with its orb mark, trace, tool calls and…