Loading component…
Loading component…
This component has not been implemented locally yet.
To reuse this local React demo, copy all files from the Code tab into the same folder, then import Agent/ToolCalls from ./agent-tool-calls.
import { AgentToolCallsScreen } from "@/components/ui/agent-tool-calls";
export default function Page() {
return (
<AgentToolCallsScreen
agent={agent}
tools={agent.tools}
calls={calls}
now={Date.now()}
onResolve={(call, answer) => api.answer(call.id, answer)}
onModeChange={(tool, mode) => api.setMode(agent.id, tool.id, mode)}
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 |
| agent | { id; name; task; model; maker? } | The agent in the middle – its pixel mark comes from its id; maker (anthropic, openai, google) picks the model's mark | |
| tools | { id; name; fn; logo?; icon?; source; description; mode?: "auto" \| "ask" \| "off"; params?: { name; type; required? }[] }[] | Its tools – logo is the app's own mark (any node; the sample has Chrome, a macOS folder, Notion, Stripe, Linear, Slack and Gmail), icon a Hugeicons glyph for tools without one. source is the small tag (Built-in, MCP · Notion), fn the function the model calls; mode is how it may run: on its own, after someone approves each call, or not at all | |
| calls | { id; tool; at; ms?; status: "running" \| "waiting" \| "done" \| "failed" \| "rejected"; input; output?; error?; tokens?; run? }[] | Every call, in any order – at is a timestamp in ms, input the arguments as an object, tokens what the result added to the agent's context. A running call counts up; a waiting one can be approved or rejected in its panel | |
| now | number | Today, 09:41 | What now is when the screen opens – times, "today" and the time range are counted from it |
| live | boolean | true | Whether the clock runs on – running calls count up; with the sample data the agent keeps making calls |
| defaultRange | "today" \| "7d" \| "30d" | "today" | The time range in the path – cards, numbers and the table count the calls in it |
| onSelect | (selection: { kind: "agent" \| "tool" \| "call"; id } \| null) => void | Called when the agent, a tool or a call opens on the right, and with null when it closes | |
| onResolve | (call, answer: "approve" \| "reject") => void | An answer to a call that waits for you | |
| onModeChange | (tool, mode: "auto" \| "ask" \| "off") => void | A tool's access changed in its panel – Allowed (auto), Ask first (ask) or Paused (off) | |
| onDisconnect | (tool) => void | Disconnect at the foot of a tool's panel, after a second click to confirm – the card and its line go, its calls stay in the table | |
| onAddTool | () => void | Connect tool – at the top right, in the agent's panel and in the empty state | |
| onPause | (paused: boolean) => void | Pause agent and Resume | |
| loading | boolean | Gray cards where the agent and its tools land, the lines gray and still, gray rows in the table and no figures | |
| empty | boolean | An agent without tools: its card alone with a dashed place for the first tool, and an empty table that offers Connect tool | |
| layout | "canvas" \| "compact" \| "org" | "org" | org: the agent on top, its tools in two rows below it on one line, like an org chart. compact: small cards left and right of the agent. canvas: a dotted canvas to pan and zoom with full cards |
| className | string | Extra class on the root |
The tools sit in two rows; when the room runs short they wrap, and the line runs down between two cards to the next row
The table takes up to half the screen – drag its top edge like a sidebar; the chart keeps the rest and stays centred in it
Narrower screens drop the run column, then the tokens; on phones the table keeps time, tool, status and duration, the buttons turn into icons and the panel becomes a sheet from the bottom
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"