Loading component…
Loading component…
Steer an agent while it works – queue a note for the next step and watch it glide into the plan when the agent picks it up, or interrupt right away
To reuse this local React demo, copy all files from the Code tab into the same folder, then import AgentSteering from ./agent-steering.
import { useState } from "react";
import { AgentSteering, type SteerNote, type SteerStep } from "@/components/ui/agent-steering";
export function Run({ run }: { run: AgentRun }) {
const [steps, setSteps] = useState<SteerStep[]>(run.steps);
const [queue, setQueue] = useState<SteerNote[]>([]);
// Your agent takes the queue in at the start of each step: move the notes into that step – the glide is automatic
run.on("step", (index) => {
setSteps((list) => list.map((s, i) => (i === index ? { ...s, status: "active", notes: queue.map((n) => ({ ...n, picked: "next" })) } : s)));
setQueue([]);
});
return (
<AgentSteering
title="Migrate users table"
agent="Opus 5.5"
steps={steps}
queue={queue}
startedAt={run.startedAt}
onQueue={(text) => setQueue((q) => [...q, { id: crypto.randomUUID(), text }])}
onInterrupt={(text, id) => run.interrupt(text, id)}
onRemove={(id) => setQueue((q) => q.filter((n) => n.id !== id))}
onPause={() => run.pause()}
onResume={() => run.resume()}
/>
);
}| Name | Type | Default | Description |
|---|---|---|---|
| title | string | What the agent is working on, shown as the heading | |
| agent | string | Name of the agent or model, shown under the title | |
| steps | SteerStep[] | The plan: { id, title, status?, duration?, startedAt?, notes? }. status is "done", "active" or "pending" | |
| queue | SteerNote[] | Notes waiting for the next step: { id, text }. Move one into a step's notes (same id, picked set) and it glides over | |
| status | "running" \| "paused" \| "done" | "running" | The run. Clocks tick while running; when done the field closes |
| startedAt | number \| Date | When the run started – the header clock ticks from here | |
| onQueue | (text: string) => void | ↵ in the field: add the note to your queue | |
| onInterrupt | (text: string, queuedId?: string) => void | ⌘↵ (Ctrl ↵) in the field, or "Now" on a queued note. Shows the shortcut hint and the Now buttons | |
| onRemove | (id: string) => void | ✕ on a queued note | |
| onPause / onResume | () => void | Shows Pause while running and Resume while paused | |
| draft / onDraftChange | string / (text: string) => void | Controlled field text, e.g. to prefill a suggestion | |
| placeholder | string | "Steer the agent…" | Text in the empty field |
| className | string | Extra class on the root |
Fills its container up to 460px
Below 380px the padding gets tighter
Touch screens get larger buttons
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"