import { InferSchemaOutput, StandardSchemaV1 } from "@copilotkitnext/shared"; //#region src/hooks/use-render-tool.d.ts interface RenderToolInProgressProps { name: string; parameters: Partial>; status: "inProgress"; result: undefined; } interface RenderToolExecutingProps { name: string; parameters: InferSchemaOutput; status: "executing"; result: undefined; } interface RenderToolCompleteProps { name: string; parameters: InferSchemaOutput; status: "complete"; result: string; } type RenderToolProps = RenderToolInProgressProps | RenderToolExecutingProps | RenderToolCompleteProps; /** * Registers a wildcard (`"*"`) renderer for tool calls. * * The wildcard renderer is used as a fallback when no exact name-matched * renderer is registered for a tool call. * * @param config - Wildcard renderer configuration. * @param deps - Optional dependencies to refresh registration. * * @example * ```tsx * useRenderTool( * { * name: "*", * render: ({ name, status }) => ( *
* {status === "complete" ? "✓" : "⏳"} {name} *
* ), * }, * [], * ); * ``` */ declare function useRenderTool(config: { name: "*"; render: (props: any) => React.ReactElement; agentId?: string; }, deps?: ReadonlyArray): void; /** * Registers a name-scoped renderer for tool calls. * * The provided `parameters` schema defines the typed shape of `props.parameters` * in `render` for `executing` and `complete` states. Accepts any Standard Schema V1 * compatible library (Zod, Valibot, ArkType, etc.). * * @typeParam S - Schema type describing tool call parameters. * @param config - Named renderer configuration. * @param deps - Optional dependencies to refresh registration. * * @example * ```tsx * useRenderTool( * { * name: "searchDocs", * parameters: z.object({ query: z.string() }), * render: ({ status, parameters, result }) => { * if (status === "inProgress") return
Preparing...
; * if (status === "executing") return
Searching {parameters.query}
; * return
{result}
; * }, * }, * [], * ); * ``` */ declare function useRenderTool(config: { name: string; parameters: S; render: (props: RenderToolProps) => React.ReactElement; agentId?: string; }, deps?: ReadonlyArray): void; //#endregion export { useRenderTool }; //# sourceMappingURL=use-render-tool.d.cts.map