import { type ReactNode } from 'react'; import { type AIToolApprover } from '../ToolCalls/AIToolApprover'; import type { AIToolApprovalData, AIToolCallPart } from './types'; /** Where the person's answer to a tool call's question is. */ export type AIToolApprovalState = { /** The answer couldn't be sent, and the person can answer again. */ failed: boolean; /** The answer is on its way, or arrived and the call's step hasn't changed yet. */ isSending: boolean; }; /** The agent's reason, as a sentence, then what allowing it shares. */ export declare const approvalLines: (approval: AIToolApprovalData) => string[]; export type AIToolArgumentsProps = { /** The call's arguments, as the agent sent them. */ args: unknown; className?: string; }; /** * What a tool call will send, as JSON: in full when short, else collapsed under "What it sends", * which the person opens to read it. Renders nothing for a call with no arguments. The default * of `AIToolApprover.argumentsPreview`. */ export declare const AIToolArguments: ({ args, className }: AIToolArgumentsProps) => import("react/jsx-runtime").JSX.Element | null; export type AIToolApprovalCardProps = { approval: AIToolApprovalData; /** Called with the person's answer. */ onDecide: (allowed: boolean) => void; /** * What the call will send, under the question, such as ``. * `AIToolApproval` passes the approver's `argumentsPreview`, else the call's arguments. */ argumentsPreview?: ReactNode; className?: string; state?: AIToolApprovalState; }; /** * Asks the person a tool call's question, such as "Share your location?", with the agent's * reason, what allowing it shares and what the call will send (`argumentsPreview`), and an * Allow and a Don't Allow button. Used inline under a step by `AIToolApproval`, and on its own, * such as on a voice call. The counterpart of `AIToolApprovalCard`. */ export declare const AIToolApprovalCard: ({ approval, argumentsPreview, className, onDecide, state, }: AIToolApprovalCardProps) => import("react/jsx-runtime").JSX.Element; export type AIToolApprovalProps = { part: AIToolCallPart; /** Who answers on this device. Defaults to the one of the nearest `AIToolApproverProvider`. */ approver?: AIToolApprover; /** * Renders the question, instead of `AIToolApprovalCard`. `argumentsPreview` is what the card * would show of the call's arguments (see `AIToolApprover.argumentsPreview`), or `null`. */ children?: (approval: AIToolApprovalData, state: AIToolApprovalState, decide: (allowed: boolean) => void, argumentsPreview: ReactNode) => ReactNode; }; /** * Asks the question of a tool call that waits for this person on this device, and sends their * answer with `approver.decide`. Until the call's step changes the buttons wait; a failed send * lets them answer again. Renders nothing for a call that does not wait for them here. The * counterpart of `AIToolApprovalView`. */ export declare const AIToolApproval: ({ approver: approverProp, children, part, }: AIToolApprovalProps) => import("react/jsx-runtime").JSX.Element | null; //# sourceMappingURL=AIToolApproval.d.ts.map