import * as React from 'react'; import type { AgToolPart } from '../types.js'; import { toolDisplayState } from '../tool-state.js'; import { ToolCallApproval } from './ToolApproval.js'; export interface ApprovalResponseDetail { approvalId: string; toolCallId: string; approved: boolean; reason?: string; } export interface ToolCallLabels { queued?: string; running?: string; needsApproval?: string; succeeded?: string; failed?: string; denied?: string; showAll?: string; approve?: string; deny?: string; denyReason?: string; waitingForApproval?: string; approvalNeeded?: string; /** Announced once on a live transition into `failed`; `{tool}`, `{error}`. */ failedAnnouncement?: string; } type AnyToolPart = AgToolPart | (Omit & { type: 'dynamic-tool'; toolName: string; }); export interface ToolCallProps { /** The tool-call part to render (name, state, input and output). */ part: AnyToolPart; /** Overrides the displayed tool name. */ title?: string | undefined; /** Overrides for the built-in, localizable UI strings. */ labels?: ToolCallLabels | undefined; /** Custom renderer for the tool input; defaults to a JSON block. */ renderInput?: ((input: unknown) => React.ReactNode) | undefined; /** Custom renderer for the tool output; defaults to a JSON block. */ renderOutput?: ((output: unknown) => React.ReactNode) | undefined; /** Called when the user approves or denies a tool call that awaits approval. */ onApprovalResponse?: ((detail: ApprovalResponseDetail) => void) | undefined; /** Initial open state when uncontrolled. */ defaultOpen?: boolean | undefined; /** Characters of JSON input/output shown before "Show all". */ maxPreviewChars?: number | undefined; /** Class name merged onto the root element. */ className?: string | undefined; /** Ref to the rendered root element. */ ref?: React.Ref; } export interface ToolCallComponent { (props: ToolCallProps): React.ReactElement; displayState: typeof toolDisplayState; Approval: typeof ToolCallApproval; } /** REQ-SURF-02 static: `ToolCall.displayState` is the ยง4.5 mapper. */ export declare const ToolCall: ToolCallComponent; export {}; //# sourceMappingURL=ToolCall.d.ts.map