import { t as CreateToolsOptions } from "../shared-g0aFrtd0.js"; import { z } from "zod"; //#region src/tools/tanstack-ai/index.d.ts /** Structurally compatible with `toolDefinition().server()`, declared locally so `@tanstack/ai` is not a build-time dependency. */ interface TanStackTool { name: string; description: string; inputSchema: z.ZodType; outputSchema?: z.ZodType; execute: (input: any, context?: TanStackToolExecutionContext) => Promise; needsApproval?: boolean; lazy?: boolean; /** Phantom marker carrying no runtime value; declaring it satisfies the union `chat({ tools })` accepts. */ readonly "~toolKind"?: undefined; } interface TanStackToolExecutionContext { toolCallId?: string; /** Fires when the chat run's `abortController` aborts; a running `exec` is killed. */ abortSignal?: AbortSignal; emitCustomEvent?: (eventName: string, value: Record) => void; } type TanStackToolList = TanStackTool[]; type TanStackToolSet = Record>; /** `chat()`, `mergeAgentTools` and `createToolRegistry` all take an array, so `"array"` is the default. */ type TanStackToolFormat = "array" | "object"; type TanStackToolsFor = Format extends "object" ? TanStackToolSet : TanStackToolList; interface CreateTanStackToolsOptions extends CreateToolsOptions { format?: Format; /** Tools that pause for approval. `"mutating"` selects every tool that changes workspace state. */ approve?: string[] | "mutating"; /** Forward pre-terminal `exec` snapshots through `emitCustomEvent` under this name; otherwise they are discarded. */ streamEventName?: string; /** Tools withheld from the prompt until TanStack lazy discovery asks for them. */ lazy?: string[] | "all"; } declare function createTanStackTools(options: CreateTanStackToolsOptions): TanStackToolsFor; //#endregion export { CreateTanStackToolsOptions, TanStackTool, TanStackToolExecutionContext, TanStackToolFormat, TanStackToolList, TanStackToolSet, TanStackToolsFor, createTanStackTools }; //# sourceMappingURL=tanstack-ai.d.ts.map