/// import type { IMessage, FunctionCall } from "./"; /** * 工具调用渲染类型 * - approval: 需要用户确认的调用(如危险操作确认) * - handoff: 任务转交给其他 Agent * - default: 普通工具调用 */ export type ToolRenderKind = "approval" | "handoff" | "default"; /** * 默认的工具名 → 渲染类型推导策略 */ export declare const defaultToolKindResolver: (_name: string | undefined) => ToolRenderKind; export interface FunctionCallRenderProps { msg: IMessage; showDetail?: boolean; onConfirm?: (fnCall: FunctionCall, confirmed: boolean) => void; /** * 工具渲染类型,不传则使用 toolKindResolver 自动推导 */ kind?: ToolRenderKind; /** * 工具名 → 渲染类型的解析策略,默认使用中立的 defaultToolKindResolver。 * 业务协议可通过 XAdkProvider preset/strategies 自动下发,或局部传入覆盖。 */ toolKindResolver?: (name: string | undefined) => ToolRenderKind; /** * 自定义 approval 场景渲染,返回 null 则使用默认渲染 */ renderApproval?: (msg: IMessage, onConfirm?: (fnCall: FunctionCall, confirmed: boolean) => void) => React.ReactNode | null; /** * 自定义 handoff 场景渲染,返回 null 则使用默认渲染 */ renderHandoff?: (msg: IMessage) => React.ReactNode | null; }