import React from 'react'; import type { AgentActivityStatus } from './agent-status.js'; export interface ToolCallProps extends Omit, 'title'> { /** * What the call did, in the user's language — "Searched the invoice archive". * Required: the tool's function name is not a description of the work. */ title: string; /** The tool's technical name, shown in monospace beside the title. */ name?: string; /** The same vocabulary as AgentActivityStep, so the two never disagree. */ status?: AgentActivityStatus; /** * What the agent passed in. Objects and arrays render as formatted JSON, * strings as they are. Redact secrets before passing it — this renders * exactly what it is given. */ input?: unknown; /** What came back. Rendered as `input` is. */ output?: unknown; /** * Why a `failed` call failed. Shown under the header whether or not the * details are expanded — a failure that takes a click to read is not read. */ errorMessage?: React.ReactNode; /** How long the call took, in milliseconds. */ durationMs?: number; /** Uncontrolled: whether the details start open. */ defaultExpanded?: boolean; /** Controlled: whether the details are open. Pass `onExpandedChange` with it. */ isExpanded?: boolean; onExpandedChange?: (isExpanded: boolean) => void; /** The status in words, as AgentActivityStep's. Pass the translation for `status`. */ statusLabel?: string; /** Every other string the call renders, for translation. English by default. */ labels?: ToolCallLabels; } export interface ToolCallLabels { /** "Input", above what the agent passed in. */ input?: string; /** "Output", above what came back. */ output?: string; /** Names the scrollable input — "Input to search_invoices". */ inputName?: (tool: string) => string; /** Names the scrollable output — "Output from search_invoices". */ outputName?: (tool: string) => string; } /** * ToolCall — the evidence behind one step of an agent run. * * AgentActivityStep says what the agent did in the user's language. ToolCall * is where the person checking that account goes next: which tool, with what * arguments, and what came back. The title is still plain language and still * required, so the technical detail supplements the account rather than * replacing it. * * COLLAPSED BY DEFAULT, EXCEPT THE FAILURE * * A run makes dozens of calls, and a thread of expanded JSON is unreadable. * But `errorMessage` renders outside the disclosure: evidence that takes a * click to reach is evidence nobody reads, and a failure is the one thing in * the call a reader must not miss. * * THE DETAILS ARE UNMOUNTED WHEN CLOSED — unlike Accordion, deliberately. * Accordion keeps collapsed panels for the form state inside them; a tool call * holds no user state, and its payloads can be megabytes of JSON multiplied by * every call in the thread. * * A CALL WITH NOTHING TO SHOW IS NOT A BUTTON. With no input and no output the * header renders as text: a disclosure that discloses nothing announces as * expandable and does nothing. * * THE PAYLOADS ARE FOCUSABLE. Each is a scroll container capped in height, and * a scroll container a keyboard user cannot focus is one they cannot scroll. * * It does not announce status changes. AgentActivity owns the run's live * region; a second one here would talk over it. */ export declare const ToolCall: React.ForwardRefExoticComponent>; //# sourceMappingURL=ToolCall.d.ts.map