import { JSONSchema7, JSONSchema7 as JSONSchema7$1 } from "json-schema"; import React$1 from "react"; //#region ../../node_modules/.pnpm/@ai-sdk+provider@3.0.10/node_modules/@ai-sdk/provider/dist/index.d.ts type SharedV3Headers = Record; /** * A JSON value can be a string, number, boolean, object, array, or null. * JSON values can be serialized and deserialized by the JSON.stringify and JSON.parse methods. */ type JSONValue = null | string | number | boolean | JSONObject | JSONArray; type JSONObject = { [key: string]: JSONValue | undefined; }; type JSONArray = JSONValue[]; /** * Additional provider-specific metadata. * Metadata are additional outputs from the provider. * They are passed through to the provider from the AI SDK * and enable provider-specific functionality * that can be fully encapsulated in the provider. * * This enables us to quickly ship provider-specific functionality * without affecting the core AI SDK. * * The outer record is keyed by the provider name, and the inner * record is keyed by the provider-specific metadata key. * * ```ts * { * "anthropic": { * "cacheControl": { "type": "ephemeral" } * } * } * ``` */ type SharedV3ProviderMetadata = Record; /** * Additional provider-specific options. * Options are additional input to the provider. * They are passed through to the provider from the AI SDK * and enable provider-specific functionality * that can be fully encapsulated in the provider. * * This enables us to quickly ship provider-specific functionality * without affecting the core AI SDK. * * The outer record is keyed by the provider name, and the inner * record is keyed by the provider-specific metadata key. * * ```ts * { * "anthropic": { * "cacheControl": { "type": "ephemeral" } * } * } * ``` */ type SharedV3ProviderOptions = Record; /** * Warning from the model. * * For example, that certain features are unsupported or compatibility * functionality is used (which might lead to suboptimal results). */ type SharedV3Warning = { /** * A feature is not supported by the model. */ type: 'unsupported'; /** * The feature that is not supported. */ feature: string; /** * Additional details about the warning. */ details?: string; } | { /** * A compatibility feature is used that might lead to suboptimal results. */ type: 'compatibility'; /** * The feature that is used in a compatibility mode. */ feature: string; /** * Additional details about the warning. */ details?: string; } | { /** * Other warning. */ type: 'other'; /** * The message of the warning. */ message: string; }; type SharedV2Headers = Record; /** * Additional provider-specific metadata. * Metadata are additional outputs from the provider. * They are passed through to the provider from the AI SDK * and enable provider-specific functionality * that can be fully encapsulated in the provider. * * This enables us to quickly ship provider-specific functionality * without affecting the core AI SDK. * * The outer record is keyed by the provider name, and the inner * record is keyed by the provider-specific metadata key. * * ```ts * { * "anthropic": { * "cacheControl": { "type": "ephemeral" } * } * } * ``` */ type EmbeddingModelV3CallOptions = { /** * List of text values to generate embeddings for. */ values: Array; /** * Abort signal for cancelling the operation. */ abortSignal?: AbortSignal; /** * Additional provider-specific options. They are passed through * to the provider from the AI SDK and enable provider-specific * functionality that can be fully encapsulated in the provider. */ providerOptions?: SharedV3ProviderOptions; /** * Additional HTTP headers to be sent with the request. * Only applicable for HTTP-based providers. */ headers?: SharedV3Headers; }; /** * An embedding is a vector, i.e. an array of numbers. * It is e.g. used to represent a text as a vector of word embeddings. */ type EmbeddingModelV3Embedding = Array; /** * The result of a embedding model doEmbed call. */ type EmbeddingModelV3Result = { /** * Generated embeddings. They are in the same order as the input values. */ embeddings: Array; /** * Token usage. We only have input tokens for embeddings. */ usage?: { tokens: number; }; /** * Additional provider-specific metadata. They are passed through * from the provider to the AI SDK and enable provider-specific * results that can be fully encapsulated in the provider. */ providerMetadata?: SharedV3ProviderMetadata; /** * Optional response information for debugging purposes. */ response?: { /** * Response headers. */ headers?: SharedV3Headers; /** * The response body. */ body?: unknown; }; /** * Warnings for the call, e.g. unsupported settings. */ warnings: Array; }; /** * Specification for an embedding model that implements the embedding model * interface version 3. * * It is specific to text embeddings. */ type EmbeddingModelV3 = { /** * The embedding model must specify which embedding model interface * version it implements. This will allow us to evolve the embedding * model interface and retain backwards compatibility. The different * implementation versions can be handled as a discriminated union * on our side. */ readonly specificationVersion: 'v3'; /** * Name of the provider for logging purposes. */ readonly provider: string; /** * Provider-specific model ID for logging purposes. */ readonly modelId: string; /** * Limit of how many embeddings can be generated in a single API call. * * Use Infinity for models that do not have a limit. */ readonly maxEmbeddingsPerCall: PromiseLike | number | undefined; /** * True if the model can handle multiple embedding calls in parallel. */ readonly supportsParallelCalls: PromiseLike | boolean; /** * Generates a list of embeddings for the given input text. * * Naming: "do" prefix to prevent accidental direct usage of the method * by the user. */ doEmbed(options: EmbeddingModelV3CallOptions): PromiseLike; }; /** * An embedding is a vector, i.e. an array of numbers. * It is e.g. used to represent a text as a vector of word embeddings. */ /** * Usage information for an image model call. */ type ImageModelV3Usage = { /** * The number of input (prompt) tokens used. */ inputTokens: number | undefined; /** * The number of output tokens used, if reported by the provider. */ outputTokens: number | undefined; /** * The total number of tokens as reported by the provider. */ totalTokens: number | undefined; }; /** * An image file that can be used for image editing or variation generation. */ type ImageModelV3File = { type: 'file'; /** * The IANA media type of the file, e.g. `image/png`. Any string is supported. * * @see https://www.iana.org/assignments/media-types/media-types.xhtml */ mediaType: string; /** * Generated file data as base64 encoded strings or binary data. * * The file data should be returned without any unnecessary conversion. * If the API returns base64 encoded strings, the file data should be returned * as base64 encoded strings. If the API returns binary data, the file data should * be returned as binary data. */ data: string | Uint8Array; /** * Optional provider-specific metadata for the file part. */ providerOptions?: SharedV3ProviderMetadata; } | { type: 'url'; /** * The URL of the image file. */ url: string; /** * Optional provider-specific metadata for the file part. */ providerOptions?: SharedV3ProviderMetadata; }; type ImageModelV3CallOptions = { /** * Prompt for the image generation. Some operations, like upscaling, may not require a prompt. */ prompt: string | undefined; /** * Number of images to generate. */ n: number; /** * Size of the images to generate. * Must have the format `{width}x{height}`. * `undefined` will use the provider's default size. */ size: `${number}x${number}` | undefined; /** * Aspect ratio of the images to generate. * Must have the format `{width}:{height}`. * `undefined` will use the provider's default aspect ratio. */ aspectRatio: `${number}:${number}` | undefined; /** * Seed for the image generation. * `undefined` will use the provider's default seed. */ seed: number | undefined; /** * Array of images for image editing or variation generation. * The images should be provided as base64 encoded strings or binary data. */ files: ImageModelV3File[] | undefined; /** * Mask image for inpainting operations. * The mask should be provided as base64 encoded strings or binary data. */ mask: ImageModelV3File | undefined; /** * Additional provider-specific options that are passed through to the provider * as body parameters. * * The outer record is keyed by the provider name, and the inner * record is keyed by the provider-specific metadata key. * * ```ts * { * "openai": { * "style": "vivid" * } * } * ``` */ providerOptions: SharedV3ProviderOptions; /** * Abort signal for cancelling the operation. */ abortSignal?: AbortSignal; /** * Additional HTTP headers to be sent with the request. * Only applicable for HTTP-based providers. */ headers?: Record; }; type ImageModelV3ProviderMetadata = Record; type GetMaxImagesPerCallFunction$1 = (options: { modelId: string; }) => PromiseLike | number | undefined; /** * Image generation model specification version 3. */ type ImageModelV3 = { /** * The image model must specify which image model interface * version it implements. This will allow us to evolve the image * model interface and retain backwards compatibility. The different * implementation versions can be handled as a discriminated union * on our side. */ readonly specificationVersion: 'v3'; /** * Name of the provider for logging purposes. */ readonly provider: string; /** * Provider-specific model ID for logging purposes. */ readonly modelId: string; /** * Limit of how many images can be generated in a single API call. * Can be set to a number for a fixed limit, to undefined to use * the global limit, or a function that returns a number or undefined, * optionally as a promise. */ readonly maxImagesPerCall: number | undefined | GetMaxImagesPerCallFunction$1; /** * Generates an array of images. */ doGenerate(options: ImageModelV3CallOptions): PromiseLike<{ /** * Generated images as base64 encoded strings or binary data. * The images should be returned without any unnecessary conversion. * If the API returns base64 encoded strings, the images should be returned * as base64 encoded strings. If the API returns binary data, the images should * be returned as binary data. */ images: Array | Array; /** * Warnings for the call, e.g. unsupported features. */ warnings: Array; /** * Additional provider-specific metadata. They are passed through * from the provider to the AI SDK and enable provider-specific * results that can be fully encapsulated in the provider. * * The outer record is keyed by the provider name, and the inner * record is provider-specific metadata. It always includes an * `images` key with image-specific metadata * * ```ts * { * "openai": { * "images": ["revisedPrompt": "Revised prompt here."] * } * } * ``` */ providerMetadata?: ImageModelV3ProviderMetadata; /** * Response information for telemetry and debugging purposes. */ response: { /** * Timestamp for the start of the generated response. */ timestamp: Date; /** * The ID of the response model that was used to generate the response. */ modelId: string; /** * Response headers. */ headers: Record | undefined; }; /** * Optional token usage for the image generation call (if the provider reports it). */ usage?: ImageModelV3Usage; }>; }; /** * A tool has a name, a description, and a set of parameters. * * Note: this is **not** the user-facing tool definition. The AI SDK methods will * map the user-facing tool definitions to this format. */ type LanguageModelV3FunctionTool = { /** * The type of the tool (always 'function'). */ type: 'function'; /** * The name of the tool. Unique within this model call. */ name: string; /** * A description of the tool. The language model uses this to understand the * tool's purpose and to provide better completion suggestions. */ description?: string; /** * The parameters that the tool expects. The language model uses this to * understand the tool's input requirements and to provide matching suggestions. */ inputSchema: JSONSchema7; /** * An optional list of input examples that show the language * model what the input should look like. */ inputExamples?: Array<{ input: JSONObject; }>; /** * Strict mode setting for the tool. * * Providers that support strict mode will use this setting to determine * how the input should be generated. Strict mode will always produce * valid inputs, but it might limit what input schemas are supported. */ strict?: boolean; /** * The provider-specific options for the tool. */ providerOptions?: SharedV3ProviderOptions; }; /** * Data content. Can be a Uint8Array, base64 encoded data as a string or a URL. */ type LanguageModelV3DataContent = Uint8Array | string | URL; /** * A prompt is a list of messages. * * Note: Not all models and prompt formats support multi-modal inputs and * tool calls. The validation happens at runtime. * * Note: This is not a user-facing prompt. The AI SDK methods will map the * user-facing prompt types such as chat or instruction prompts to this format. */ type LanguageModelV3Prompt = Array; type LanguageModelV3Message = ({ role: 'system'; content: string; } | { role: 'user'; content: Array; } | { role: 'assistant'; content: Array; } | { role: 'tool'; content: Array; }) & { /** * Additional provider-specific options. They are passed through * to the provider from the AI SDK and enable provider-specific * functionality that can be fully encapsulated in the provider. */ providerOptions?: SharedV3ProviderOptions; }; /** * Text content part of a prompt. It contains a string of text. */ interface LanguageModelV3TextPart { type: 'text'; /** * The text content. */ text: string; /** * Additional provider-specific options. They are passed through * to the provider from the AI SDK and enable provider-specific * functionality that can be fully encapsulated in the provider. */ providerOptions?: SharedV3ProviderOptions; } /** * Reasoning content part of a prompt. It contains a string of reasoning text. */ interface LanguageModelV3ReasoningPart { type: 'reasoning'; /** * The reasoning text. */ text: string; /** * Additional provider-specific options. They are passed through * to the provider from the AI SDK and enable provider-specific * functionality that can be fully encapsulated in the provider. */ providerOptions?: SharedV3ProviderOptions; } /** * File content part of a prompt. It contains a file. */ interface LanguageModelV3FilePart { type: 'file'; /** * Optional filename of the file. */ filename?: string; /** * File data. Can be a Uint8Array, base64 encoded data as a string or a URL. */ data: LanguageModelV3DataContent; /** * IANA media type of the file. * * Can support wildcards, e.g. `image/*` (in which case the provider needs to take appropriate action). * * @see https://www.iana.org/assignments/media-types/media-types.xhtml */ mediaType: string; /** * Additional provider-specific options. They are passed through * to the provider from the AI SDK and enable provider-specific * functionality that can be fully encapsulated in the provider. */ providerOptions?: SharedV3ProviderOptions; } /** * Tool call content part of a prompt. It contains a tool call (usually generated by the AI model). */ interface LanguageModelV3ToolCallPart { type: 'tool-call'; /** * ID of the tool call. This ID is used to match the tool call with the tool result. */ toolCallId: string; /** * Name of the tool that is being called. */ toolName: string; /** * Arguments of the tool call. This is a JSON-serializable object that matches the tool's input schema. */ input: unknown; /** * Whether the tool call will be executed by the provider. * If this flag is not set or is false, the tool call will be executed by the client. */ providerExecuted?: boolean; /** * Additional provider-specific options. They are passed through * to the provider from the AI SDK and enable provider-specific * functionality that can be fully encapsulated in the provider. */ providerOptions?: SharedV3ProviderOptions; } /** * Tool result content part of a prompt. It contains the result of the tool call with the matching ID. */ interface LanguageModelV3ToolResultPart { type: 'tool-result'; /** * ID of the tool call that this result is associated with. */ toolCallId: string; /** * Name of the tool that generated this result. */ toolName: string; /** * Result of the tool call. */ output: LanguageModelV3ToolResultOutput; /** * Additional provider-specific options. They are passed through * to the provider from the AI SDK and enable provider-specific * functionality that can be fully encapsulated in the provider. */ providerOptions?: SharedV3ProviderOptions; } /** * Tool approval response content part of a prompt. It contains the user's * decision to approve or deny a provider-executed tool call. */ interface LanguageModelV3ToolApprovalResponsePart { type: 'tool-approval-response'; /** * ID of the approval request that this response refers to. */ approvalId: string; /** * Whether the approval was granted (true) or denied (false). */ approved: boolean; /** * Optional reason for approval or denial. */ reason?: string; /** * Additional provider-specific options. They are passed through * to the provider from the AI SDK and enable provider-specific * functionality that can be fully encapsulated in the provider. */ providerOptions?: SharedV3ProviderOptions; } /** * Result of a tool call. */ type LanguageModelV3ToolResultOutput = { /** * Text tool output that should be directly sent to the API. */ type: 'text'; value: string; /** * Provider-specific options. */ providerOptions?: SharedV3ProviderOptions; } | { type: 'json'; value: JSONValue; /** * Provider-specific options. */ providerOptions?: SharedV3ProviderOptions; } | { /** * Type when the user has denied the execution of the tool call. */ type: 'execution-denied'; /** * Optional reason for the execution denial. */ reason?: string; /** * Provider-specific options. */ providerOptions?: SharedV3ProviderOptions; } | { type: 'error-text'; value: string; /** * Provider-specific options. */ providerOptions?: SharedV3ProviderOptions; } | { type: 'error-json'; value: JSONValue; /** * Provider-specific options. */ providerOptions?: SharedV3ProviderOptions; } | { type: 'content'; value: Array<{ type: 'text'; /** * Text content. */ text: string; /** * Provider-specific options. */ providerOptions?: SharedV3ProviderOptions; } | { type: 'file-data'; /** * Base-64 encoded media data. */ data: string; /** * IANA media type. * @see https://www.iana.org/assignments/media-types/media-types.xhtml */ mediaType: string; /** * Optional filename of the file. */ filename?: string; /** * Provider-specific options. */ providerOptions?: SharedV3ProviderOptions; } | { type: 'file-url'; /** * URL of the file. */ url: string; /** * Provider-specific options. */ providerOptions?: SharedV3ProviderOptions; } | { type: 'file-id'; /** * ID of the file. * * If you use multiple providers, you need to * specify the provider specific ids using * the Record option. The key is the provider * name, e.g. 'openai' or 'anthropic'. */ fileId: string | Record; /** * Provider-specific options. */ providerOptions?: SharedV3ProviderOptions; } | { /** * Images that are referenced using base64 encoded data. */ type: 'image-data'; /** * Base-64 encoded image data. */ data: string; /** * IANA media type. * @see https://www.iana.org/assignments/media-types/media-types.xhtml */ mediaType: string; /** * Provider-specific options. */ providerOptions?: SharedV3ProviderOptions; } | { /** * Images that are referenced using a URL. */ type: 'image-url'; /** * URL of the image. */ url: string; /** * Provider-specific options. */ providerOptions?: SharedV3ProviderOptions; } | { /** * Images that are referenced using a provider file id. */ type: 'image-file-id'; /** * Image that is referenced using a provider file id. * * If you use multiple providers, you need to * specify the provider specific ids using * the Record option. The key is the provider * name, e.g. 'openai' or 'anthropic'. */ fileId: string | Record; /** * Provider-specific options. */ providerOptions?: SharedV3ProviderOptions; } | { /** * Custom content part. This can be used to implement * provider-specific content parts. */ type: 'custom'; /** * Provider-specific options. */ providerOptions?: SharedV3ProviderOptions; }>; }; /** * The configuration of a provider tool. * * Provider tools are tools that are specific to a certain provider. * The input and output schemas are defined be the provider, and * some of the tools are also executed on the provider systems. */ type LanguageModelV3ProviderTool = { /** * The type of the tool (always 'provider'). */ type: 'provider'; /** * The ID of the tool. Should follow the format `.`. */ id: `${string}.${string}`; /** * The name of the tool. Unique within this model call. */ name: string; /** * The arguments for configuring the tool. Must match the expected arguments defined by the provider for this tool. */ args: Record; }; type LanguageModelV3ToolChoice = { type: 'auto'; } | { type: 'none'; } | { type: 'required'; } | { type: 'tool'; toolName: string; }; type LanguageModelV3CallOptions = { /** * A language mode prompt is a standardized prompt type. * * Note: This is **not** the user-facing prompt. The AI SDK methods will map the * user-facing prompt types such as chat or instruction prompts to this format. * That approach allows us to evolve the user facing prompts without breaking * the language model interface. */ prompt: LanguageModelV3Prompt; /** * Maximum number of tokens to generate. */ maxOutputTokens?: number; /** * Temperature setting. The range depends on the provider and model. */ temperature?: number; /** * Stop sequences. * If set, the model will stop generating text when one of the stop sequences is generated. * Providers may have limits on the number of stop sequences. */ stopSequences?: string[]; /** * Nucleus sampling. */ topP?: number; /** * Only sample from the top K options for each subsequent token. * * Used to remove "long tail" low probability responses. * Recommended for advanced use cases only. You usually only need to use temperature. */ topK?: number; /** * Presence penalty setting. It affects the likelihood of the model to * repeat information that is already in the prompt. */ presencePenalty?: number; /** * Frequency penalty setting. It affects the likelihood of the model * to repeatedly use the same words or phrases. */ frequencyPenalty?: number; /** * Response format. The output can either be text or JSON. Default is text. * * If JSON is selected, a schema can optionally be provided to guide the LLM. */ responseFormat?: { type: 'text'; } | { type: 'json'; /** * JSON schema that the generated output should conform to. */ schema?: JSONSchema7; /** * Name of output that should be generated. Used by some providers for additional LLM guidance. */ name?: string; /** * Description of the output that should be generated. Used by some providers for additional LLM guidance. */ description?: string; }; /** * The seed (integer) to use for random sampling. If set and supported * by the model, calls will generate deterministic results. */ seed?: number; /** * The tools that are available for the model. */ tools?: Array; /** * Specifies how the tool should be selected. Defaults to 'auto'. */ toolChoice?: LanguageModelV3ToolChoice; /** * Include raw chunks in the stream. Only applicable for streaming calls. */ includeRawChunks?: boolean; /** * Abort signal for cancelling the operation. */ abortSignal?: AbortSignal; /** * Additional HTTP headers to be sent with the request. * Only applicable for HTTP-based providers. */ headers?: Record; /** * Additional provider-specific options. They are passed through * to the provider from the AI SDK and enable provider-specific * functionality that can be fully encapsulated in the provider. */ providerOptions?: SharedV3ProviderOptions; }; /** * A file that has been generated by the model. * Generated files as base64 encoded strings or binary data. * The files should be returned without any unnecessary conversion. */ type LanguageModelV3File = { type: 'file'; /** * The IANA media type of the file, e.g. `image/png` or `audio/mp3`. * * @see https://www.iana.org/assignments/media-types/media-types.xhtml */ mediaType: string; /** * Generated file data as base64 encoded strings or binary data. * * The file data should be returned without any unnecessary conversion. * If the API returns base64 encoded strings, the file data should be returned * as base64 encoded strings. If the API returns binary data, the file data should * be returned as binary data. */ data: string | Uint8Array; /** * Optional provider-specific metadata for the file part. */ providerMetadata?: SharedV3ProviderMetadata; }; /** * Reasoning that the model has generated. */ type LanguageModelV3Reasoning = { type: 'reasoning'; text: string; /** * Optional provider-specific metadata for the reasoning part. */ providerMetadata?: SharedV3ProviderMetadata; }; /** * A source that has been used as input to generate the response. */ type LanguageModelV3Source = { type: 'source'; /** * The type of source - URL sources reference web content. */ sourceType: 'url'; /** * The ID of the source. */ id: string; /** * The URL of the source. */ url: string; /** * The title of the source. */ title?: string; /** * Additional provider metadata for the source. */ providerMetadata?: SharedV3ProviderMetadata; } | { type: 'source'; /** * The type of source - document sources reference files/documents. */ sourceType: 'document'; /** * The ID of the source. */ id: string; /** * IANA media type of the document (e.g., 'application/pdf'). */ mediaType: string; /** * The title of the document. */ title: string; /** * Optional filename of the document. */ filename?: string; /** * Additional provider metadata for the source. */ providerMetadata?: SharedV3ProviderMetadata; }; /** * Text that the model has generated. */ type LanguageModelV3Text = { type: 'text'; /** * The text content. */ text: string; providerMetadata?: SharedV3ProviderMetadata; }; /** * Tool approval request emitted by a provider for a provider-executed tool call. * * This is used for flows where the provider executes the tool (e.g. MCP tools) * but requires an explicit user approval before continuing. */ type LanguageModelV3ToolApprovalRequest = { type: 'tool-approval-request'; /** * ID of the approval request. This ID is referenced by the subsequent * tool-approval-response (tool message) to approve or deny execution. */ approvalId: string; /** * The tool call ID that this approval request is for. */ toolCallId: string; /** * Additional provider-specific metadata for the approval request. */ providerMetadata?: SharedV3ProviderMetadata; }; /** * Tool calls that the model has generated. */ type LanguageModelV3ToolCall = { type: 'tool-call'; /** * The identifier of the tool call. It must be unique across all tool calls. */ toolCallId: string; /** * The name of the tool that should be called. */ toolName: string; /** * Stringified JSON object with the tool call arguments. Must match the * parameters schema of the tool. */ input: string; /** * Whether the tool call will be executed by the provider. * If this flag is not set or is false, the tool call will be executed by the client. */ providerExecuted?: boolean; /** * Whether the tool is dynamic, i.e. defined at runtime. * For example, MCP (Model Context Protocol) tools that are executed by the provider. */ dynamic?: boolean; /** * Additional provider-specific metadata for the tool call. */ providerMetadata?: SharedV3ProviderMetadata; }; /** * Result of a tool call that has been executed by the provider. */ type LanguageModelV3ToolResult = { type: 'tool-result'; /** * The ID of the tool call that this result is associated with. */ toolCallId: string; /** * Name of the tool that generated this result. */ toolName: string; /** * Result of the tool call. This is a JSON-serializable object. */ result: NonNullable; /** * Optional flag if the result is an error or an error message. */ isError?: boolean; /** * Whether the tool result is preliminary. * * Preliminary tool results replace each other, e.g. image previews. * There always has to be a final, non-preliminary tool result. * * If this flag is set to true, the tool result is preliminary. * If this flag is not set or is false, the tool result is not preliminary. */ preliminary?: boolean; /** * Whether the tool is dynamic, i.e. defined at runtime. * For example, MCP (Model Context Protocol) tools that are executed by the provider. */ dynamic?: boolean; /** * Additional provider-specific metadata for the tool result. */ providerMetadata?: SharedV3ProviderMetadata; }; type LanguageModelV3Content = LanguageModelV3Text | LanguageModelV3Reasoning | LanguageModelV3File | LanguageModelV3ToolApprovalRequest | LanguageModelV3Source | LanguageModelV3ToolCall | LanguageModelV3ToolResult; /** * Reason why a language model finished generating a response. * * Contains both a unified finish reason and a raw finish reason from the provider. * The unified finish reason is used to provide a consistent finish reason across different providers. * The raw finish reason is used to provide the original finish reason from the provider. */ type LanguageModelV3FinishReason = { /** * Unified finish reason. This enables using the same finish reason across different providers. * * Can be one of the following: * - `stop`: model generated stop sequence * - `length`: model generated maximum number of tokens * - `content-filter`: content filter violation stopped the model * - `tool-calls`: model triggered tool calls * - `error`: model stopped because of an error * - `other`: model stopped for other reasons */ unified: 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other'; /** * Raw finish reason from the provider. * This is the original finish reason from the provider. */ raw: string | undefined; }; interface LanguageModelV3ResponseMetadata { /** * ID for the generated response, if the provider sends one. */ id?: string; /** * Timestamp for the start of the generated response, if the provider sends one. */ timestamp?: Date; /** * The ID of the response model that was used to generate the response, if the provider sends one. */ modelId?: string; } /** * Usage information for a language model call. */ type LanguageModelV3Usage = { /** * Information about the input tokens. */ inputTokens: { /** * The total number of input (prompt) tokens used. */ total: number | undefined; /** * The number of non-cached input (prompt) tokens used. */ noCache: number | undefined; /** * The number of cached input (prompt) tokens read. */ cacheRead: number | undefined; /** * The number of cached input (prompt) tokens written. */ cacheWrite: number | undefined; }; /** * Information about the output tokens. */ outputTokens: { /** * The total number of output (completion) tokens used. */ total: number | undefined; /** * The number of text tokens used. */ text: number | undefined; /** * The number of reasoning tokens used. */ reasoning: number | undefined; }; /** * Raw usage information from the provider. * * This is the usage information in the shape that the provider returns. * It can include additional information that is not part of the standard usage information. */ raw?: JSONObject; }; /** * The result of a language model doGenerate call. */ type LanguageModelV3GenerateResult = { /** * Ordered content that the model has generated. */ content: Array; /** * The finish reason. */ finishReason: LanguageModelV3FinishReason; /** * The usage information. */ usage: LanguageModelV3Usage; /** * Additional provider-specific metadata. They are passed through * from the provider to the AI SDK and enable provider-specific * results that can be fully encapsulated in the provider. */ providerMetadata?: SharedV3ProviderMetadata; /** * Optional request information for telemetry and debugging purposes. */ request?: { /** * Request HTTP body that was sent to the provider API. */ body?: unknown; }; /** * Optional response information for telemetry and debugging purposes. */ response?: LanguageModelV3ResponseMetadata & { /** * Response headers. */ headers?: SharedV3Headers; /** * Response HTTP body. */ body?: unknown; }; /** * Warnings for the call, e.g. unsupported settings. */ warnings: Array; }; type LanguageModelV3StreamPart = { type: 'text-start'; providerMetadata?: SharedV3ProviderMetadata; id: string; } | { type: 'text-delta'; id: string; providerMetadata?: SharedV3ProviderMetadata; delta: string; } | { type: 'text-end'; providerMetadata?: SharedV3ProviderMetadata; id: string; } | { type: 'reasoning-start'; providerMetadata?: SharedV3ProviderMetadata; id: string; } | { type: 'reasoning-delta'; id: string; providerMetadata?: SharedV3ProviderMetadata; delta: string; } | { type: 'reasoning-end'; id: string; providerMetadata?: SharedV3ProviderMetadata; } | { type: 'tool-input-start'; id: string; toolName: string; providerMetadata?: SharedV3ProviderMetadata; providerExecuted?: boolean; dynamic?: boolean; title?: string; } | { type: 'tool-input-delta'; id: string; delta: string; providerMetadata?: SharedV3ProviderMetadata; } | { type: 'tool-input-end'; id: string; providerMetadata?: SharedV3ProviderMetadata; } | LanguageModelV3ToolApprovalRequest | LanguageModelV3ToolCall | LanguageModelV3ToolResult | LanguageModelV3File | LanguageModelV3Source | { type: 'stream-start'; warnings: Array; } | ({ type: 'response-metadata'; } & LanguageModelV3ResponseMetadata) | { type: 'finish'; usage: LanguageModelV3Usage; finishReason: LanguageModelV3FinishReason; providerMetadata?: SharedV3ProviderMetadata; } | { type: 'raw'; rawValue: unknown; } | { type: 'error'; error: unknown; }; /** * The result of a language model doStream call. */ type LanguageModelV3StreamResult = { /** * The stream. */ stream: ReadableStream; /** * Optional request information for telemetry and debugging purposes. */ request?: { /** * Request HTTP body that was sent to the provider API. */ body?: unknown; }; /** * Optional response data. */ response?: { /** * Response headers. */ headers?: SharedV3Headers; }; }; /** * Specification for a language model that implements the language model interface version 3. */ type LanguageModelV3 = { /** * The language model must specify which language model interface version it implements. */ readonly specificationVersion: 'v3'; /** * Provider ID. */ readonly provider: string; /** * Provider-specific model ID. */ readonly modelId: string; /** * Supported URL patterns by media type for the provider. * * The keys are media type patterns or full media types (e.g. `*\/*` for everything, `audio/*`, `video/*`, or `application/pdf`). * and the values are arrays of regular expressions that match the URL paths. * * The matching should be against lower-case URLs. * * Matched URLs are supported natively by the model and are not downloaded. * * @returns A map of supported URL patterns by media type (as a promise or a plain object). */ supportedUrls: PromiseLike> | Record; /** * Generates a language model output (non-streaming). * Naming: "do" prefix to prevent accidental direct usage of the method * by the user. */ doGenerate(options: LanguageModelV3CallOptions): PromiseLike; /** * Generates a language model output (streaming). * * Naming: "do" prefix to prevent accidental direct usage of the method * by the user. * * @return A stream of higher-level language model output parts. */ doStream(options: LanguageModelV3CallOptions): PromiseLike; }; /** * Experimental middleware for LanguageModelV3. * This type defines the structure for middleware that can be used to modify * the behavior of LanguageModelV3 operations. */ type RerankingModelV3CallOptions = { /** * Documents to rerank. * Either a list of texts or a list of JSON objects. */ documents: { type: 'text'; values: string[]; } | { type: 'object'; values: JSONObject[]; }; /** * The query is a string that represents the query to rerank the documents against. */ query: string; /** * Optional limit returned documents to the top n documents. */ topN?: number; /** * Abort signal for cancelling the operation. */ abortSignal?: AbortSignal; /** * Additional provider-specific options. They are passed through * to the provider from the AI SDK and enable provider-specific * functionality that can be fully encapsulated in the provider. */ providerOptions?: SharedV3ProviderOptions; /** * Additional HTTP headers to be sent with the request. * Only applicable for HTTP-based providers. */ headers?: SharedV3Headers; }; /** * Specification for a reranking model that implements the reranking model interface version 3. */ type RerankingModelV3 = { /** * The reranking model must specify which reranking model interface version it implements. */ readonly specificationVersion: 'v3'; /** * Provider ID. */ readonly provider: string; /** * Provider-specific model ID. */ readonly modelId: string; /** * Reranking a list of documents using the query. */ doRerank(options: RerankingModelV3CallOptions): PromiseLike<{ /** * Ordered list of reranked documents (via index before reranking). * The documents are sorted by the descending order of relevance scores. */ ranking: Array<{ /** * The index of the document in the original list of documents before reranking. */ index: number; /** * The relevance score of the document after reranking. */ relevanceScore: number; }>; /** * Additional provider-specific metadata. They are passed through * to the provider from the AI SDK and enable provider-specific * functionality that can be fully encapsulated in the provider. */ providerMetadata?: SharedV3ProviderMetadata; /** * Warnings for the call, e.g. unsupported settings. */ warnings?: Array; /** * Optional response information for debugging purposes. */ response?: { /** * ID for the generated response, if the provider sends one. */ id?: string; /** * Timestamp for the start of the generated response, if the provider sends one. */ timestamp?: Date; /** * The ID of the response model that was used to generate the response, if the provider sends one. */ modelId?: string; /** * Response headers. */ headers?: SharedV3Headers; /** * Response body. */ body?: unknown; }; }>; }; type SpeechModelV3ProviderOptions = Record; type SpeechModelV3CallOptions = { /** * Text to convert to speech. */ text: string; /** * The voice to use for speech synthesis. * This is provider-specific and may be a voice ID, name, or other identifier. */ voice?: string; /** * The desired output format for the audio e.g. "mp3", "wav", etc. */ outputFormat?: string; /** * Instructions for the speech generation e.g. "Speak in a slow and steady tone". */ instructions?: string; /** * The speed of the speech generation. */ speed?: number; /** * The language for speech generation. This should be an ISO 639-1 language code (e.g. "en", "es", "fr") * or "auto" for automatic language detection. Provider support varies. */ language?: string; /** * Additional provider-specific options that are passed through to the provider * as body parameters. * * The outer record is keyed by the provider name, and the inner * record is keyed by the provider-specific metadata key. * ```ts * { * "openai": {} * } * ``` */ providerOptions?: SpeechModelV3ProviderOptions; /** * Abort signal for cancelling the operation. */ abortSignal?: AbortSignal; /** * Additional HTTP headers to be sent with the request. * Only applicable for HTTP-based providers. */ headers?: Record; }; /** * Speech model specification version 3. */ type SpeechModelV3 = { /** * The speech model must specify which speech model interface * version it implements. This will allow us to evolve the speech * model interface and retain backwards compatibility. The different * implementation versions can be handled as a discriminated union * on our side. */ readonly specificationVersion: 'v3'; /** * Name of the provider for logging purposes. */ readonly provider: string; /** * Provider-specific model ID for logging purposes. */ readonly modelId: string; /** * Generates speech audio from text. */ doGenerate(options: SpeechModelV3CallOptions): PromiseLike<{ /** * Generated audio as an ArrayBuffer. * The audio should be returned without any unnecessary conversion. * If the API returns base64 encoded strings, the audio should be returned * as base64 encoded strings. If the API returns binary data, the audio * should be returned as binary data. */ audio: string | Uint8Array; /** * Warnings for the call, e.g. unsupported settings. */ warnings: Array; /** * Optional request information for telemetry and debugging purposes. */ request?: { /** * Response body (available only for providers that use HTTP requests). */ body?: unknown; }; /** * Response information for telemetry and debugging purposes. */ response: { /** * Timestamp for the start of the generated response. */ timestamp: Date; /** * The ID of the response model that was used to generate the response. */ modelId: string; /** * Response headers. */ headers?: SharedV2Headers; /** * Response body. */ body?: unknown; }; /** * Additional provider-specific metadata. They are passed through * from the provider to the AI SDK and enable provider-specific * results that can be fully encapsulated in the provider. */ providerMetadata?: Record; }>; }; type TranscriptionModelV3ProviderOptions = Record; type TranscriptionModelV3CallOptions = { /** * Audio data to transcribe. * Accepts a `Uint8Array` or `string`, where `string` is a base64 encoded audio file. */ audio: Uint8Array | string; /** * The IANA media type of the audio data. * * @see https://www.iana.org/assignments/media-types/media-types.xhtml */ mediaType: string; /** * Additional provider-specific options that are passed through to the provider * as body parameters. * * The outer record is keyed by the provider name, and the inner * record is keyed by the provider-specific metadata key. * ```ts * { * "openai": { * "timestampGranularities": ["word"] * } * } * ``` */ providerOptions?: TranscriptionModelV3ProviderOptions; /** * Abort signal for cancelling the operation. */ abortSignal?: AbortSignal; /** * Additional HTTP headers to be sent with the request. * Only applicable for HTTP-based providers. */ headers?: Record; }; /** * Transcription model specification version 3. */ type TranscriptionModelV3 = { /** * The transcription model must specify which transcription model interface * version it implements. This will allow us to evolve the transcription * model interface and retain backwards compatibility. The different * implementation versions can be handled as a discriminated union * on our side. */ readonly specificationVersion: 'v3'; /** * Name of the provider for logging purposes. */ readonly provider: string; /** * Provider-specific model ID for logging purposes. */ readonly modelId: string; /** * Generates a transcript. */ doGenerate(options: TranscriptionModelV3CallOptions): PromiseLike<{ /** * The complete transcribed text from the audio. */ text: string; /** * Array of transcript segments with timing information. * Each segment represents a portion of the transcribed text with start and end times. */ segments: Array<{ /** * The text content of this segment. */ text: string; /** * The start time of this segment in seconds. */ startSecond: number; /** * The end time of this segment in seconds. */ endSecond: number; }>; /** * The detected language of the audio content, as an ISO-639-1 code (e.g., 'en' for English). * May be undefined if the language couldn't be detected. */ language: string | undefined; /** * The total duration of the audio file in seconds. * May be undefined if the duration couldn't be determined. */ durationInSeconds: number | undefined; /** * Warnings for the call, e.g. unsupported settings. */ warnings: Array; /** * Optional request information for telemetry and debugging purposes. */ request?: { /** * Raw request HTTP body that was sent to the provider API as a string (JSON should be stringified). * Non-HTTP(s) providers should not set this. */ body?: string; }; /** * Response information for telemetry and debugging purposes. */ response: { /** * Timestamp for the start of the generated response. */ timestamp: Date; /** * The ID of the response model that was used to generate the response. */ modelId: string; /** * Response headers. */ headers?: SharedV3Headers; /** * Response body. */ body?: unknown; }; /** * Additional provider-specific metadata. They are passed through * from the provider to the AI SDK and enable provider-specific * results that can be fully encapsulated in the provider. */ providerMetadata?: Record; }>; }; /** * Provider for language, text embedding, and image generation models. */ interface ProviderV3 { readonly specificationVersion: 'v3'; /** * Returns the language model with the given id. * The model id is then passed to the provider function to get the model. * * @param {string} modelId - The id of the model to return. * * @returns {LanguageModel} The language model associated with the id * * @throws {NoSuchModelError} If no such model exists. */ languageModel(modelId: string): LanguageModelV3; /** * Returns the text embedding model with the given id. * The model id is then passed to the provider function to get the model. * * @param {string} modelId - The id of the model to return. * * @returns {LanguageModel} The language model associated with the id * * @throws {NoSuchModelError} If no such model exists. */ embeddingModel(modelId: string): EmbeddingModelV3; /** * Returns the text embedding model with the given id. * The model id is then passed to the provider function to get the model. * * @param {string} modelId - The id of the model to return. * * @returns {EmbeddingModel} The embedding model associated with the id * * @throws {NoSuchModelError} If no such model exists. * * @deprecated Use `embeddingModel` instead. */ textEmbeddingModel?(modelId: string): EmbeddingModelV3; /** * Returns the image model with the given id. * The model id is then passed to the provider function to get the model. * * @param {string} modelId - The id of the model to return. * * @returns {ImageModel} The image model associated with the id */ imageModel(modelId: string): ImageModelV3; /** * Returns the transcription model with the given id. * The model id is then passed to the provider function to get the model. * * @param {string} modelId - The id of the model to return. * * @returns {TranscriptionModel} The transcription model associated with the id */ transcriptionModel?(modelId: string): TranscriptionModelV3; /** * Returns the speech model with the given id. * The model id is then passed to the provider function to get the model. * * @param {string} modelId - The id of the model to return. * * @returns {SpeechModel} The speech model associated with the id */ speechModel?(modelId: string): SpeechModelV3; /** * Returns the reranking model with the given id. * The model id is then passed to the provider function to get the model. * * @param {string} modelId - The id of the model to return. * * @returns {RerankingModel} The reranking model associated with the id * * @throws {NoSuchModelError} If no such model exists. */ rerankingModel?(modelId: string): RerankingModelV3; } //#endregion //#region ../../node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.ts /** The Standard Typed interface. This is a base type extended by other specs. */ interface StandardTypedV1$1 { /** The Standard properties. */ readonly "~standard": StandardTypedV1$1.Props; } declare namespace StandardTypedV1$1 { /** The Standard Typed properties interface. */ interface Props { /** The version number of the standard. */ readonly version: 1; /** The vendor name of the schema library. */ readonly vendor: string; /** Inferred types associated with the schema. */ readonly types?: Types | undefined; } /** The Standard Typed types interface. */ interface Types { /** The input type of the schema. */ readonly input: Input; /** The output type of the schema. */ readonly output: Output; } /** Infers the input type of a Standard Typed. */ type InferInput = NonNullable["input"]; /** Infers the output type of a Standard Typed. */ type InferOutput = NonNullable["output"]; } /** The Standard Schema interface. */ interface StandardSchemaV1$2 { /** The Standard Schema properties. */ readonly "~standard": StandardSchemaV1$2.Props; } declare namespace StandardSchemaV1$2 { /** The Standard Schema properties interface. */ interface Props extends StandardTypedV1$1.Props { /** Validates unknown input values. */ readonly validate: (value: unknown, options?: StandardSchemaV1$2.Options | undefined) => Result | Promise>; } /** The result interface of the validate function. */ type Result = SuccessResult | FailureResult; /** The result interface if validation succeeds. */ interface SuccessResult { /** The typed output value. */ readonly value: Output; /** A falsy value for `issues` indicates success. */ readonly issues?: undefined; } interface Options { /** Explicit support for additional vendor-specific parameters, if needed. */ readonly libraryOptions?: Record | undefined; } /** The result interface if validation fails. */ interface FailureResult { /** The issues of failed validation. */ readonly issues: ReadonlyArray; } /** The issue interface of the failure output. */ interface Issue { /** The error message of the issue. */ readonly message: string; /** The path of the issue, if any. */ readonly path?: ReadonlyArray | undefined; } /** The path segment interface of the issue. */ interface PathSegment { /** The key representing a path segment. */ readonly key: PropertyKey; } /** The Standard types interface. */ interface Types extends StandardTypedV1$1.Types {} /** Infers the input type of a Standard. */ type InferInput = StandardTypedV1$1.InferInput; /** Infers the output type of a Standard. */ type InferOutput = StandardTypedV1$1.InferOutput; } /** The Standard JSON Schema interface. */ interface StandardJSONSchemaV1 { /** The Standard JSON Schema properties. */ readonly "~standard": StandardJSONSchemaV1.Props; } declare namespace StandardJSONSchemaV1 { /** The Standard JSON Schema properties interface. */ interface Props extends StandardTypedV1$1.Props { /** Methods for generating the input/output JSON Schema. */ readonly jsonSchema: StandardJSONSchemaV1.Converter; } /** The Standard JSON Schema converter interface. */ interface Converter { /** Converts the input type to JSON Schema. May throw if conversion is not supported. */ readonly input: (options: StandardJSONSchemaV1.Options) => Record; /** Converts the output type to JSON Schema. May throw if conversion is not supported. */ readonly output: (options: StandardJSONSchemaV1.Options) => Record; } /** * The target version of the generated JSON Schema. * * It is *strongly recommended* that implementers support `"draft-2020-12"` and `"draft-07"`, as they are both in wide use. All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target. * * The `"openapi-3.0"` target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema `"draft-04"`. */ type Target = "draft-2020-12" | "draft-07" | "openapi-3.0" | ({} & string); /** The options for the input/output methods. */ interface Options { /** Specifies the target version of the generated JSON Schema. Support for all versions is on a best-effort basis. If a given version is not supported, the library should throw. */ readonly target: Target; /** Explicit support for additional vendor-specific parameters, if needed. */ readonly libraryOptions?: Record | undefined; } /** The Standard types interface. */ interface Types extends StandardTypedV1$1.Types {} /** Infers the input type of a Standard. */ type InferInput = StandardTypedV1$1.InferInput; /** Infers the output type of a Standard. */ type InferOutput = StandardTypedV1$1.InferOutput; } //#endregion //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/helpers/typeAliases.d.cts type Primitive$1 = string | number | symbol | bigint | boolean | null | undefined; //#endregion //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/helpers/util.d.cts declare namespace util { type AssertEqual = (() => V extends T ? 1 : 2) extends (() => V extends U ? 1 : 2) ? true : false; export type isAny = 0 extends 1 & T ? true : false; export const assertEqual: (_: AssertEqual) => void; export function assertIs(_arg: T): void; export function assertNever(_x: never): never; export type Omit = Pick>; export type OmitKeys = Pick>; export type MakePartial = Omit & Partial>; export type Exactly = T & Record, never>; export type InexactPartial = { [k in keyof T]?: T[k] | undefined }; export const arrayToEnum: (items: U) => { [k in U[number]]: k }; export const getValidEnumValues: (obj: any) => any[]; export const objectValues: (obj: any) => any[]; export const objectKeys: ObjectConstructor["keys"]; export const find: (arr: T[], checker: (arg: T) => any) => T | undefined; export type identity = objectUtil.identity; export type flatten = objectUtil.flatten; export type noUndefined = T extends undefined ? never : T; export const isInteger: NumberConstructor["isInteger"]; export function joinValues(array: T, separator?: string): string; export const jsonStringifyReplacer: (_: string, value: any) => any; export {}; } declare namespace objectUtil { export type MergeShapes = keyof U & keyof V extends never ? U & V : { [k in Exclude]: U[k] } & V; type optionalKeys = { [k in keyof T]: undefined extends T[k] ? k : never }[keyof T]; type requiredKeys = { [k in keyof T]: undefined extends T[k] ? never : k }[keyof T]; export type addQuestionMarks = { [K in requiredKeys]: T[K] } & { [K in optionalKeys]?: T[K] } & { [k in keyof T]?: unknown }; export type identity = T; export type flatten = identity<{ [k in keyof T]: T[k] }>; export type noNeverKeys = { [k in keyof T]: [T[k]] extends [never] ? never : k }[keyof T]; export type noNever = identity<{ [k in noNeverKeys]: k extends keyof T ? T[k] : never }>; export const mergeShapes: (first: U, second: T) => T & U; export type extendShape = keyof A & keyof B extends never ? A & B : { [K in keyof A as K extends keyof B ? never : K]: A[K] } & { [K in keyof B]: B[K] }; export {}; } declare const ZodParsedType: { string: "string"; nan: "nan"; number: "number"; integer: "integer"; float: "float"; boolean: "boolean"; date: "date"; bigint: "bigint"; symbol: "symbol"; function: "function"; undefined: "undefined"; null: "null"; array: "array"; object: "object"; unknown: "unknown"; promise: "promise"; void: "void"; never: "never"; map: "map"; set: "set"; }; type ZodParsedType = keyof typeof ZodParsedType; //#endregion //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/ZodError.d.cts type allKeys = T extends any ? keyof T : never; type typeToFlattenedError = { formErrors: U[]; fieldErrors: { [P in allKeys]?: U[] }; }; declare const ZodIssueCode: { custom: "custom"; invalid_type: "invalid_type"; too_big: "too_big"; too_small: "too_small"; not_multiple_of: "not_multiple_of"; unrecognized_keys: "unrecognized_keys"; invalid_union: "invalid_union"; invalid_literal: "invalid_literal"; invalid_union_discriminator: "invalid_union_discriminator"; invalid_enum_value: "invalid_enum_value"; invalid_arguments: "invalid_arguments"; invalid_return_type: "invalid_return_type"; invalid_date: "invalid_date"; invalid_string: "invalid_string"; invalid_intersection_types: "invalid_intersection_types"; not_finite: "not_finite"; }; type ZodIssueCode = keyof typeof ZodIssueCode; type ZodIssueBase = { path: (string | number)[]; message?: string | undefined; }; interface ZodInvalidTypeIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_type; expected: ZodParsedType; received: ZodParsedType; } interface ZodInvalidLiteralIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_literal; expected: unknown; received: unknown; } interface ZodUnrecognizedKeysIssue extends ZodIssueBase { code: typeof ZodIssueCode.unrecognized_keys; keys: string[]; } interface ZodInvalidUnionIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_union; unionErrors: ZodError[]; } interface ZodInvalidUnionDiscriminatorIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_union_discriminator; options: Primitive$1[]; } interface ZodInvalidEnumValueIssue extends ZodIssueBase { received: string | number; code: typeof ZodIssueCode.invalid_enum_value; options: (string | number)[]; } interface ZodInvalidArgumentsIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_arguments; argumentsError: ZodError; } interface ZodInvalidReturnTypeIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_return_type; returnTypeError: ZodError; } interface ZodInvalidDateIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_date; } type StringValidation = "email" | "url" | "emoji" | "uuid" | "nanoid" | "regex" | "cuid" | "cuid2" | "ulid" | "datetime" | "date" | "time" | "duration" | "ip" | "cidr" | "base64" | "jwt" | "base64url" | { includes: string; position?: number | undefined; } | { startsWith: string; } | { endsWith: string; }; interface ZodInvalidStringIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_string; validation: StringValidation; } interface ZodTooSmallIssue extends ZodIssueBase { code: typeof ZodIssueCode.too_small; minimum: number | bigint; inclusive: boolean; exact?: boolean; type: "array" | "string" | "number" | "set" | "date" | "bigint"; } interface ZodTooBigIssue extends ZodIssueBase { code: typeof ZodIssueCode.too_big; maximum: number | bigint; inclusive: boolean; exact?: boolean; type: "array" | "string" | "number" | "set" | "date" | "bigint"; } interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_intersection_types; } interface ZodNotMultipleOfIssue extends ZodIssueBase { code: typeof ZodIssueCode.not_multiple_of; multipleOf: number | bigint; } interface ZodNotFiniteIssue extends ZodIssueBase { code: typeof ZodIssueCode.not_finite; } interface ZodCustomIssue extends ZodIssueBase { code: typeof ZodIssueCode.custom; params?: { [k: string]: any; }; } type ZodIssueOptionalMessage = ZodInvalidTypeIssue | ZodInvalidLiteralIssue | ZodUnrecognizedKeysIssue | ZodInvalidUnionIssue | ZodInvalidUnionDiscriminatorIssue | ZodInvalidEnumValueIssue | ZodInvalidArgumentsIssue | ZodInvalidReturnTypeIssue | ZodInvalidDateIssue | ZodInvalidStringIssue | ZodTooSmallIssue | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue | ZodNotFiniteIssue | ZodCustomIssue; type ZodIssue = ZodIssueOptionalMessage & { fatal?: boolean | undefined; message: string; }; type recursiveZodFormattedError = T extends [any, ...any[]] ? { [K in keyof T]?: ZodFormattedError } : T extends any[] ? { [k: number]: ZodFormattedError; } : T extends object ? { [K in keyof T]?: ZodFormattedError } : unknown; type ZodFormattedError = { _errors: U[]; } & recursiveZodFormattedError>; declare class ZodError extends Error { issues: ZodIssue[]; get errors(): ZodIssue[]; constructor(issues: ZodIssue[]); format(): ZodFormattedError; format(mapper: (issue: ZodIssue) => U): ZodFormattedError; static create: (issues: ZodIssue[]) => ZodError; static assert(value: unknown): asserts value is ZodError; toString(): string; get message(): string; get isEmpty(): boolean; addIssue: (sub: ZodIssue) => void; addIssues: (subs?: ZodIssue[]) => void; flatten(): typeToFlattenedError; flatten(mapper?: (issue: ZodIssue) => U): typeToFlattenedError; get formErrors(): typeToFlattenedError; } type stripPath = T extends any ? util.OmitKeys : never; type IssueData = stripPath & { path?: (string | number)[]; fatal?: boolean | undefined; }; type ErrorMapCtx = { defaultError: string; data: any; }; type ZodErrorMap = (issue: ZodIssueOptionalMessage, _ctx: ErrorMapCtx) => { message: string; }; //#endregion //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/helpers/parseUtil.d.cts type ParseParams = { path: (string | number)[]; errorMap: ZodErrorMap; async: boolean; }; type ParsePathComponent = string | number; type ParsePath = ParsePathComponent[]; interface ParseContext$1 { readonly common: { readonly issues: ZodIssue[]; readonly contextualErrorMap?: ZodErrorMap | undefined; readonly async: boolean; }; readonly path: ParsePath; readonly schemaErrorMap?: ZodErrorMap | undefined; readonly parent: ParseContext$1 | null; readonly data: any; readonly parsedType: ZodParsedType; } type ParseInput = { data: any; path: (string | number)[]; parent: ParseContext$1; }; declare class ParseStatus { value: "aborted" | "dirty" | "valid"; dirty(): void; abort(): void; static mergeArray(status: ParseStatus, results: SyncParseReturnType[]): SyncParseReturnType; static mergeObjectAsync(status: ParseStatus, pairs: { key: ParseReturnType; value: ParseReturnType; }[]): Promise>; static mergeObjectSync(status: ParseStatus, pairs: { key: SyncParseReturnType; value: SyncParseReturnType; alwaysSet?: boolean; }[]): SyncParseReturnType; } type INVALID = { status: "aborted"; }; declare const INVALID: INVALID; type DIRTY = { status: "dirty"; value: T; }; declare const DIRTY: (value: T) => DIRTY; type OK = { status: "valid"; value: T; }; declare const OK: (value: T) => OK; type SyncParseReturnType = OK | DIRTY | INVALID; type AsyncParseReturnType = Promise>; type ParseReturnType = SyncParseReturnType | AsyncParseReturnType; //#endregion //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/helpers/errorUtil.d.cts declare namespace errorUtil { type ErrMessage = string | { message?: string | undefined; }; const errToObj: (message?: ErrMessage) => { message?: string | undefined; }; const toString: (message?: ErrMessage) => string | undefined; } //#endregion //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/standard-schema.d.cts /** * The Standard Schema interface. */ type StandardSchemaV1$1 = { /** * The Standard Schema properties. */ readonly "~standard": StandardSchemaV1$1.Props; }; declare namespace StandardSchemaV1$1 { /** * The Standard Schema properties interface. */ export interface Props { /** * The version number of the standard. */ readonly version: 1; /** * The vendor name of the schema library. */ readonly vendor: string; /** * Validates unknown input values. */ readonly validate: (value: unknown) => Result | Promise>; /** * Inferred types associated with the schema. */ readonly types?: Types | undefined; } /** * The result interface of the validate function. */ export type Result = SuccessResult | FailureResult; /** * The result interface if validation succeeds. */ export interface SuccessResult { /** * The typed output value. */ readonly value: Output; /** * The non-existent issues. */ readonly issues?: undefined; } /** * The result interface if validation fails. */ export interface FailureResult { /** * The issues of failed validation. */ readonly issues: ReadonlyArray; } /** * The issue interface of the failure output. */ export interface Issue { /** * The error message of the issue. */ readonly message: string; /** * The path of the issue, if any. */ readonly path?: ReadonlyArray | undefined; } /** * The path segment interface of the issue. */ export interface PathSegment { /** * The key representing a path segment. */ readonly key: PropertyKey; } /** * The Standard Schema types interface. */ export interface Types { /** * The input type of the schema. */ readonly input: Input; /** * The output type of the schema. */ readonly output: Output; } /** * Infers the input type of a Standard Schema. */ export type InferInput = NonNullable["input"]; /** * Infers the output type of a Standard Schema. */ export type InferOutput = NonNullable["output"]; export {}; } //#endregion //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/types.d.cts interface RefinementCtx { addIssue: (arg: IssueData) => void; path: (string | number)[]; } type ZodTypeAny = ZodType; type input$2> = T["_input"]; type output$1> = T["_output"]; type CustomErrorParams = Partial>; interface ZodTypeDef { errorMap?: ZodErrorMap | undefined; description?: string | undefined; } type RawCreateParams = { errorMap?: ZodErrorMap | undefined; invalid_type_error?: string | undefined; required_error?: string | undefined; message?: string | undefined; description?: string | undefined; } | undefined; type SafeParseSuccess = { success: true; data: Output; error?: never; }; type SafeParseError = { success: false; error: ZodError; data?: never; }; type SafeParseReturnType = SafeParseSuccess | SafeParseError; declare abstract class ZodType { readonly _type: Output; readonly _output: Output; readonly _input: Input; readonly _def: Def; get description(): string | undefined; "~standard": StandardSchemaV1$1.Props; abstract _parse(input: ParseInput): ParseReturnType; _getType(input: ParseInput): string; _getOrReturnCtx(input: ParseInput, ctx?: ParseContext$1 | undefined): ParseContext$1; _processInputParams(input: ParseInput): { status: ParseStatus; ctx: ParseContext$1; }; _parseSync(input: ParseInput): SyncParseReturnType; _parseAsync(input: ParseInput): AsyncParseReturnType; parse(data: unknown, params?: util.InexactPartial): Output; safeParse(data: unknown, params?: util.InexactPartial): SafeParseReturnType; "~validate"(data: unknown): StandardSchemaV1$1.Result | Promise>; parseAsync(data: unknown, params?: util.InexactPartial): Promise; safeParseAsync(data: unknown, params?: util.InexactPartial): Promise>; /** Alias of safeParseAsync */ spa: (data: unknown, params?: util.InexactPartial) => Promise>; refine(check: (arg: Output) => arg is RefinedOutput, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects; refine(check: (arg: Output) => unknown | Promise, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects; refinement(check: (arg: Output) => arg is RefinedOutput, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects; refinement(check: (arg: Output) => boolean, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects; _refinement(refinement: RefinementEffect["refinement"]): ZodEffects; superRefine(refinement: (arg: Output, ctx: RefinementCtx) => arg is RefinedOutput): ZodEffects; superRefine(refinement: (arg: Output, ctx: RefinementCtx) => void): ZodEffects; superRefine(refinement: (arg: Output, ctx: RefinementCtx) => Promise): ZodEffects; constructor(def: Def); optional(): ZodOptional; nullable(): ZodNullable; nullish(): ZodOptional>; array(): ZodArray; promise(): ZodPromise; or(option: T): ZodUnion<[this, T]>; and(incoming: T): ZodIntersection; transform(transform: (arg: Output, ctx: RefinementCtx) => NewOut | Promise): ZodEffects; default(def: util.noUndefined): ZodDefault; default(def: () => util.noUndefined): ZodDefault; brand(brand?: B): ZodBranded; catch(def: Output): ZodCatch; catch(def: (ctx: { error: ZodError; input: Input; }) => Output): ZodCatch; describe(description: string): this; pipe(target: T): ZodPipeline; readonly(): ZodReadonly; isOptional(): boolean; isNullable(): boolean; } interface ZodArrayDef extends ZodTypeDef { type: T; typeName: ZodFirstPartyTypeKind.ZodArray; exactLength: { value: number; message?: string | undefined; } | null; minLength: { value: number; message?: string | undefined; } | null; maxLength: { value: number; message?: string | undefined; } | null; } type ArrayCardinality = "many" | "atleastone"; type arrayOutputType = Cardinality extends "atleastone" ? [T["_output"], ...T["_output"][]] : T["_output"][]; declare class ZodArray extends ZodType, ZodArrayDef, Cardinality extends "atleastone" ? [T["_input"], ...T["_input"][]] : T["_input"][]> { _parse(input: ParseInput): ParseReturnType; get element(): T; min(minLength: number, message?: errorUtil.ErrMessage): this; max(maxLength: number, message?: errorUtil.ErrMessage): this; length(len: number, message?: errorUtil.ErrMessage): this; nonempty(message?: errorUtil.ErrMessage): ZodArray; static create: (schema: El, params?: RawCreateParams) => ZodArray; } type ZodUnionOptions = Readonly<[ZodTypeAny, ...ZodTypeAny[]]>; interface ZodUnionDef> extends ZodTypeDef { options: T; typeName: ZodFirstPartyTypeKind.ZodUnion; } declare class ZodUnion extends ZodType, T[number]["_input"]> { _parse(input: ParseInput): ParseReturnType; get options(): T; static create: >(types: Options, params?: RawCreateParams) => ZodUnion; } interface ZodIntersectionDef extends ZodTypeDef { left: T; right: U; typeName: ZodFirstPartyTypeKind.ZodIntersection; } declare class ZodIntersection extends ZodType, T["_input"] & U["_input"]> { _parse(input: ParseInput): ParseReturnType; static create: (left: TSchema, right: USchema, params?: RawCreateParams) => ZodIntersection; } interface ZodPromiseDef extends ZodTypeDef { type: T; typeName: ZodFirstPartyTypeKind.ZodPromise; } declare class ZodPromise extends ZodType, ZodPromiseDef, Promise> { unwrap(): T; _parse(input: ParseInput): ParseReturnType; static create: (schema: Inner, params?: RawCreateParams) => ZodPromise; } type RefinementEffect = { type: "refinement"; refinement: (arg: T, ctx: RefinementCtx) => any; }; type TransformEffect = { type: "transform"; transform: (arg: T, ctx: RefinementCtx) => any; }; type PreprocessEffect = { type: "preprocess"; transform: (arg: T, ctx: RefinementCtx) => any; }; type Effect = RefinementEffect | TransformEffect | PreprocessEffect; interface ZodEffectsDef extends ZodTypeDef { schema: T; typeName: ZodFirstPartyTypeKind.ZodEffects; effect: Effect; } declare class ZodEffects, Input = input$2> extends ZodType, Input> { innerType(): T; sourceType(): T; _parse(input: ParseInput): ParseReturnType; static create: (schema: I, effect: Effect, params?: RawCreateParams) => ZodEffects; static createWithPreprocess: (preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, schema: I, params?: RawCreateParams) => ZodEffects; } interface ZodOptionalDef extends ZodTypeDef { innerType: T; typeName: ZodFirstPartyTypeKind.ZodOptional; } declare class ZodOptional extends ZodType, T["_input"] | undefined> { _parse(input: ParseInput): ParseReturnType; unwrap(): T; static create: (type: Inner, params?: RawCreateParams) => ZodOptional; } interface ZodNullableDef extends ZodTypeDef { innerType: T; typeName: ZodFirstPartyTypeKind.ZodNullable; } declare class ZodNullable extends ZodType, T["_input"] | null> { _parse(input: ParseInput): ParseReturnType; unwrap(): T; static create: (type: Inner, params?: RawCreateParams) => ZodNullable; } interface ZodDefaultDef extends ZodTypeDef { innerType: T; defaultValue: () => util.noUndefined; typeName: ZodFirstPartyTypeKind.ZodDefault; } declare class ZodDefault extends ZodType, ZodDefaultDef, T["_input"] | undefined> { _parse(input: ParseInput): ParseReturnType; removeDefault(): T; static create: (type: Inner, params: RawCreateParams & { default: Inner["_input"] | (() => util.noUndefined); }) => ZodDefault; } interface ZodCatchDef extends ZodTypeDef { innerType: T; catchValue: (ctx: { error: ZodError; input: unknown; }) => T["_input"]; typeName: ZodFirstPartyTypeKind.ZodCatch; } declare class ZodCatch extends ZodType, unknown> { _parse(input: ParseInput): ParseReturnType; removeCatch(): T; static create: (type: Inner, params: RawCreateParams & { catch: Inner["_output"] | (() => Inner["_output"]); }) => ZodCatch; } interface ZodBrandedDef extends ZodTypeDef { type: T; typeName: ZodFirstPartyTypeKind.ZodBranded; } declare const BRAND: unique symbol; type BRAND = { [BRAND]: { [k in T]: true }; }; declare class ZodBranded extends ZodType, ZodBrandedDef, T["_input"]> { _parse(input: ParseInput): ParseReturnType; unwrap(): T; } interface ZodPipelineDef extends ZodTypeDef { in: A; out: B; typeName: ZodFirstPartyTypeKind.ZodPipeline; } declare class ZodPipeline extends ZodType, A["_input"]> { _parse(input: ParseInput): ParseReturnType; static create(a: ASchema, b: BSchema): ZodPipeline; } type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | { readonly [Symbol.toStringTag]: string; } | Date | Error | Generator | Promise | RegExp; type MakeReadonly = T extends Map ? ReadonlyMap : T extends Set ? ReadonlySet : T extends [infer Head, ...infer Tail] ? readonly [Head, ...Tail] : T extends Array ? ReadonlyArray : T extends BuiltIn ? T : Readonly; interface ZodReadonlyDef extends ZodTypeDef { innerType: T; typeName: ZodFirstPartyTypeKind.ZodReadonly; } declare class ZodReadonly extends ZodType, ZodReadonlyDef, MakeReadonly> { _parse(input: ParseInput): ParseReturnType; static create: (type: Inner, params?: RawCreateParams) => ZodReadonly; unwrap(): T; } declare enum ZodFirstPartyTypeKind { ZodString = "ZodString", ZodNumber = "ZodNumber", ZodNaN = "ZodNaN", ZodBigInt = "ZodBigInt", ZodBoolean = "ZodBoolean", ZodDate = "ZodDate", ZodSymbol = "ZodSymbol", ZodUndefined = "ZodUndefined", ZodNull = "ZodNull", ZodAny = "ZodAny", ZodUnknown = "ZodUnknown", ZodNever = "ZodNever", ZodVoid = "ZodVoid", ZodArray = "ZodArray", ZodObject = "ZodObject", ZodUnion = "ZodUnion", ZodDiscriminatedUnion = "ZodDiscriminatedUnion", ZodIntersection = "ZodIntersection", ZodTuple = "ZodTuple", ZodRecord = "ZodRecord", ZodMap = "ZodMap", ZodSet = "ZodSet", ZodFunction = "ZodFunction", ZodLazy = "ZodLazy", ZodLiteral = "ZodLiteral", ZodEnum = "ZodEnum", ZodEffects = "ZodEffects", ZodNativeEnum = "ZodNativeEnum", ZodOptional = "ZodOptional", ZodNullable = "ZodNullable", ZodDefault = "ZodDefault", ZodCatch = "ZodCatch", ZodPromise = "ZodPromise", ZodBranded = "ZodBranded", ZodPipeline = "ZodPipeline", ZodReadonly = "ZodReadonly" } //#endregion //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema.d.cts type _JSONSchema = boolean | JSONSchema; type JSONSchema = { [k: string]: unknown; $schema?: "https://json-schema.org/draft/2020-12/schema" | "http://json-schema.org/draft-07/schema#" | "http://json-schema.org/draft-04/schema#"; $id?: string; $anchor?: string; $ref?: string; $dynamicRef?: string; $dynamicAnchor?: string; $vocabulary?: Record; $comment?: string; $defs?: Record; type?: "object" | "array" | "string" | "number" | "boolean" | "null" | "integer"; additionalItems?: _JSONSchema; unevaluatedItems?: _JSONSchema; prefixItems?: _JSONSchema[]; items?: _JSONSchema | _JSONSchema[]; contains?: _JSONSchema; additionalProperties?: _JSONSchema; unevaluatedProperties?: _JSONSchema; properties?: Record; patternProperties?: Record; dependentSchemas?: Record; propertyNames?: _JSONSchema; if?: _JSONSchema; then?: _JSONSchema; else?: _JSONSchema; allOf?: JSONSchema[]; anyOf?: JSONSchema[]; oneOf?: JSONSchema[]; not?: _JSONSchema; multipleOf?: number; maximum?: number; exclusiveMaximum?: number | boolean; minimum?: number; exclusiveMinimum?: number | boolean; maxLength?: number; minLength?: number; pattern?: string; maxItems?: number; minItems?: number; uniqueItems?: boolean; maxContains?: number; minContains?: number; maxProperties?: number; minProperties?: number; required?: string[]; dependentRequired?: Record; enum?: Array; const?: string | number | boolean | null; id?: string; title?: string; description?: string; default?: unknown; deprecated?: boolean; readOnly?: boolean; writeOnly?: boolean; nullable?: boolean; examples?: unknown[]; format?: string; contentMediaType?: string; contentEncoding?: string; contentSchema?: JSONSchema; _prefault?: unknown; }; type BaseSchema = JSONSchema; //#endregion //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/standard-schema.d.cts /** The Standard interface. */ interface StandardTypedV1 { /** The Standard properties. */ readonly "~standard": StandardTypedV1.Props; } declare namespace StandardTypedV1 { /** The Standard properties interface. */ interface Props { /** The version number of the standard. */ readonly version: 1; /** The vendor name of the schema library. */ readonly vendor: string; /** Inferred types associated with the schema. */ readonly types?: Types | undefined; } /** The Standard types interface. */ interface Types { /** The input type of the schema. */ readonly input: Input; /** The output type of the schema. */ readonly output: Output; } /** Infers the input type of a Standard. */ type InferInput = NonNullable["input"]; /** Infers the output type of a Standard. */ type InferOutput = NonNullable["output"]; } /** The Standard Schema interface. */ interface StandardSchemaV1 { /** The Standard Schema properties. */ readonly "~standard": StandardSchemaV1.Props; } declare namespace StandardSchemaV1 { /** The Standard Schema properties interface. */ interface Props extends StandardTypedV1.Props { /** Validates unknown input values. */ readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result | Promise>; } /** The result interface of the validate function. */ type Result = SuccessResult | FailureResult; /** The result interface if validation succeeds. */ interface SuccessResult { /** The typed output value. */ readonly value: Output; /** The absence of issues indicates success. */ readonly issues?: undefined; } interface Options { /** Implicit support for additional vendor-specific parameters, if needed. */ readonly libraryOptions?: Record | undefined; } /** The result interface if validation fails. */ interface FailureResult { /** The issues of failed validation. */ readonly issues: ReadonlyArray; } /** The issue interface of the failure output. */ interface Issue { /** The error message of the issue. */ readonly message: string; /** The path of the issue, if any. */ readonly path?: ReadonlyArray | undefined; } /** The path segment interface of the issue. */ interface PathSegment { /** The key representing a path segment. */ readonly key: PropertyKey; } /** The Standard types interface. */ interface Types extends StandardTypedV1.Types {} /** Infers the input type of a Standard. */ type InferInput = StandardTypedV1.InferInput; /** Infers the output type of a Standard. */ type InferOutput = StandardTypedV1.InferOutput; } //#endregion //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.d.cts declare const $output: unique symbol; type $output = typeof $output; declare const $input: unique symbol; type $input = typeof $input; type $replace = Meta extends $output ? output : Meta extends $input ? input$1 : Meta extends (infer M)[] ? $replace[] : Meta extends ((...args: infer P) => infer R) ? (...args: { [K in keyof P]: $replace }) => $replace : Meta extends object ? { [K in keyof Meta]: $replace } : Meta; type MetadataType = object | undefined; declare class $ZodRegistry { _meta: Meta; _schema: Schema; _map: WeakMap>; _idmap: Map; add(schema: S, ..._meta: undefined extends Meta ? [$replace?] : [$replace]): this; clear(): this; remove(schema: Schema): this; get(schema: S): $replace | undefined; has(schema: Schema): boolean; } //#endregion //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.d.cts type Processor = (schema: T, ctx: ToJSONSchemaContext, json: BaseSchema, params: ProcessParams) => void; interface ProcessParams { schemaPath: $ZodType[]; path: (string | number)[]; } interface Seen { /** JSON Schema result for this Zod schema */ schema: BaseSchema; /** A cached version of the schema that doesn't get overwritten during ref resolution */ def?: BaseSchema; defId?: string | undefined; /** Number of times this schema was encountered during traversal */ count: number; /** Cycle path */ cycle?: (string | number)[] | undefined; isParent?: boolean | undefined; /** Schema to inherit JSON Schema properties from (set by processor for wrappers) */ ref?: $ZodType | null; /** JSON Schema property path for this schema */ path?: (string | number)[] | undefined; } interface ToJSONSchemaContext { processors: Record; metadataRegistry: $ZodRegistry>; target: "draft-04" | "draft-07" | "draft-2020-12" | "openapi-3.0" | ({} & string); unrepresentable: "throw" | "any"; override: (ctx: { zodSchema: $ZodType; jsonSchema: BaseSchema; path: (string | number)[]; }) => void; io: "input" | "output"; counter: number; seen: Map<$ZodType, Seen>; cycles: "ref" | "throw"; reused: "ref" | "inline"; external?: { registry: $ZodRegistry<{ id?: string | undefined; }>; uri?: ((id: string) => string) | undefined; defs: Record; } | undefined; } //#endregion //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.d.cts type Omit$1 = Pick>; type MakePartial = Omit$1 & InexactPartial>; type InexactPartial = { [P in keyof T]?: T[P] | undefined }; type Identity = T; type Flatten = Identity<{ [k in keyof T]: T[k] }>; type AnyFunc = (...args: any[]) => any; type MaybeAsync = T | Promise; type Primitive = string | number | symbol | bigint | boolean | null | undefined; type PropValues = Record>; type PrimitiveSet = Set; declare abstract class Class { constructor(..._args: any[]); } //#endregion //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/versions.d.cts declare const version: { readonly major: 4; readonly minor: 4; readonly patch: number; }; //#endregion //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/schemas.d.cts interface ParseContext { /** Customize error messages. */ readonly error?: $ZodErrorMap; /** Include the `input` field in issue objects. Default `false`. */ readonly reportInput?: boolean; /** Skip eval-based fast path. Default `false`. */ readonly jitless?: boolean; } /** @internal */ interface ParseContextInternal extends ParseContext { readonly async?: boolean | undefined; readonly direction?: "forward" | "backward"; readonly skipChecks?: boolean; } interface ParsePayload { value: T; issues: $ZodRawIssue[]; /** A way to mark a whole payload as aborted. Used in codecs/pipes. */ aborted?: boolean; /** @internal Marks a value as a fallback that an outer wrapper (e.g. * $ZodOptional) may override with its own interpretation when input was * undefined. Set by $ZodCatch when catchValue substitutes and by every * $ZodTransform invocation. */ fallback?: boolean | undefined; } interface $ZodTypeDef { type: "string" | "number" | "int" | "boolean" | "bigint" | "symbol" | "null" | "undefined" | "void" | "never" | "any" | "unknown" | "date" | "object" | "record" | "file" | "array" | "tuple" | "union" | "intersection" | "map" | "set" | "enum" | "literal" | "nullable" | "optional" | "nonoptional" | "success" | "transform" | "default" | "prefault" | "catch" | "nan" | "pipe" | "readonly" | "template_literal" | "promise" | "lazy" | "function" | "custom"; error?: $ZodErrorMap | undefined; checks?: $ZodCheck[]; } interface _$ZodTypeInternals { /** The `@zod/core` version of this schema */ version: typeof version; /** Schema definition. */ def: $ZodTypeDef; /** @internal Randomly generated ID for this schema. */ /** @internal List of deferred initializers. */ deferred: AnyFunc[] | undefined; /** @internal Parses input and runs all checks (refinements). */ run(payload: ParsePayload, ctx: ParseContextInternal): MaybeAsync; /** @internal Parses input, doesn't run checks. */ parse(payload: ParsePayload, ctx: ParseContextInternal): MaybeAsync; /** @internal Stores identifiers for the set of traits implemented by this schema. */ traits: Set; /** @internal Indicates that a schema output type should be considered optional inside objects. * @default Required */ /** @internal */ optin?: "optional" | undefined; /** @internal */ optout?: "optional" | undefined; /** @internal The set of literal values that will pass validation. Must be an exhaustive set. Used to determine optionality in z.record(). * * Defined on: enum, const, literal, null, undefined * Passthrough: optional, nullable, branded, default, catch, pipe * Todo: unions? */ values?: PrimitiveSet | undefined; /** Default value bubbled up from */ /** @internal A set of literal discriminators used for the fast path in discriminated unions. */ propValues?: PropValues | undefined; /** @internal This flag indicates that a schema validation can be represented with a regular expression. Used to determine allowable schemas in z.templateLiteral(). */ pattern: RegExp | undefined; /** @internal The constructor function of this schema. */ constr: new (def: any) => $ZodType; /** @internal A catchall object for bag metadata related to this schema. Commonly modified by checks using `onattach`. */ bag: Record; /** @internal The set of issues this schema might throw during type checking. */ isst: $ZodIssueBase; /** @internal Subject to change, not a public API. */ processJSONSchema?: ((ctx: ToJSONSchemaContext, json: BaseSchema, params: ProcessParams) => void) | undefined; /** An optional method used to override `toJSONSchema` logic. */ toJSONSchema?: () => unknown; /** @internal The parent of this schema. Only set during certain clone operations. */ parent?: $ZodType | undefined; } /** @internal */ interface $ZodTypeInternals extends _$ZodTypeInternals { /** @internal The inferred output type */ output: O; /** @internal The inferred input type */ input: I; } type $ZodStandardSchema = StandardSchemaV1.Props, output>; interface $ZodType = $ZodTypeInternals> { _zod: Internals; "~standard": $ZodStandardSchema; } declare const $ZodType: $constructor<$ZodType>; //#endregion //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/checks.d.cts interface $ZodCheckDef { check: string; error?: $ZodErrorMap | undefined; /** If true, no later checks will be executed if this check fails. Default `false`. */ abort?: boolean | undefined; /** If provided, the check runs only when this returns `true`. By default, it is skipped if prior parsing produced aborting issues. */ when?: ((payload: ParsePayload) => boolean) | undefined; } interface $ZodCheckInternals { def: $ZodCheckDef; /** The set of issues this check might throw. */ issc?: $ZodIssueBase; check(payload: ParsePayload): MaybeAsync; onattach: ((schema: $ZodType) => void)[]; } interface $ZodCheck { _zod: $ZodCheckInternals; } declare const $ZodCheck: $constructor<$ZodCheck>; type $ZodStringFormats = "email" | "url" | "emoji" | "uuid" | "guid" | "nanoid" | "cuid" | "cuid2" | "ulid" | "xid" | "ksuid" | "datetime" | "date" | "time" | "duration" | "ipv4" | "ipv6" | "cidrv4" | "cidrv6" | "base64" | "base64url" | "json_string" | "e164" | "lowercase" | "uppercase" | "regex" | "jwt" | "starts_with" | "ends_with" | "includes"; //#endregion //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.d.cts interface $ZodIssueBase { readonly code?: string; readonly input?: unknown; readonly path: PropertyKey[]; readonly message: string; } type $ZodInvalidTypeExpected = "string" | "number" | "int" | "boolean" | "bigint" | "symbol" | "undefined" | "null" | "never" | "void" | "date" | "array" | "object" | "tuple" | "record" | "map" | "set" | "file" | "nonoptional" | "nan" | "function" | (string & {}); interface $ZodIssueInvalidType extends $ZodIssueBase { readonly code: "invalid_type"; readonly expected: $ZodInvalidTypeExpected; readonly input?: Input; } interface $ZodIssueTooBig extends $ZodIssueBase { readonly code: "too_big"; readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {}); readonly maximum: number | bigint; readonly inclusive?: boolean; readonly exact?: boolean; readonly input?: Input; } interface $ZodIssueTooSmall extends $ZodIssueBase { readonly code: "too_small"; readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {}); readonly minimum: number | bigint; /** True if the allowable range includes the minimum */ readonly inclusive?: boolean; /** True if the allowed value is fixed (e.g.` z.length(5)`), not a range (`z.minLength(5)`) */ readonly exact?: boolean; readonly input?: Input; } interface $ZodIssueInvalidStringFormat extends $ZodIssueBase { readonly code: "invalid_format"; readonly format: $ZodStringFormats | (string & {}); readonly pattern?: string; readonly input?: string; } interface $ZodIssueNotMultipleOf extends $ZodIssueBase { readonly code: "not_multiple_of"; readonly divisor: number; readonly input?: Input; } interface $ZodIssueUnrecognizedKeys extends $ZodIssueBase { readonly code: "unrecognized_keys"; readonly keys: string[]; readonly input?: Record; } interface $ZodIssueInvalidUnionNoMatch extends $ZodIssueBase { readonly code: "invalid_union"; readonly errors: $ZodIssue[][]; readonly input?: unknown; readonly discriminator?: string | undefined; readonly options?: Primitive[]; readonly inclusive?: true; } interface $ZodIssueInvalidUnionMultipleMatch extends $ZodIssueBase { readonly code: "invalid_union"; readonly errors: []; readonly input?: unknown; readonly discriminator?: string | undefined; readonly inclusive: false; } type $ZodIssueInvalidUnion = $ZodIssueInvalidUnionNoMatch | $ZodIssueInvalidUnionMultipleMatch; interface $ZodIssueInvalidKey extends $ZodIssueBase { readonly code: "invalid_key"; readonly origin: "map" | "record"; readonly issues: $ZodIssue[]; readonly input?: Input; } interface $ZodIssueInvalidElement extends $ZodIssueBase { readonly code: "invalid_element"; readonly origin: "map" | "set"; readonly key: unknown; readonly issues: $ZodIssue[]; readonly input?: Input; } interface $ZodIssueInvalidValue extends $ZodIssueBase { readonly code: "invalid_value"; readonly values: Primitive[]; readonly input?: Input; } interface $ZodIssueCustom extends $ZodIssueBase { readonly code: "custom"; readonly params?: Record | undefined; readonly input?: unknown; } type $ZodIssue = $ZodIssueInvalidType | $ZodIssueTooBig | $ZodIssueTooSmall | $ZodIssueInvalidStringFormat | $ZodIssueNotMultipleOf | $ZodIssueUnrecognizedKeys | $ZodIssueInvalidUnion | $ZodIssueInvalidKey | $ZodIssueInvalidElement | $ZodIssueInvalidValue | $ZodIssueCustom; type $ZodInternalIssue = T extends any ? RawIssue : never; type RawIssue = T extends any ? Flatten & { /** The input data */readonly input: unknown; /** The schema or check that originated this issue. */ readonly inst?: $ZodType | $ZodCheck; /** If `true`, Zod will continue executing checks/refinements after this issue. */ readonly continue?: boolean | undefined; } & Record> : never; type $ZodRawIssue = $ZodInternalIssue; interface $ZodErrorMap { (issue: $ZodRawIssue): { message: string; } | string | undefined | null; } //#endregion //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.d.cts type ZodTrait = { _zod: { def: any; [k: string]: any; }; }; interface $constructor { new (def: D): T; init(inst: T, def: D): asserts inst is T; } declare function $constructor(name: string, initializer: (inst: T, def: D) => void, params?: { Parent?: typeof Class; }): $constructor; type input$1 = T extends { _zod: { input: any; }; } ? T["_zod"]["input"] : unknown; type output = T extends { _zod: { output: any; }; } ? T["_zod"]["output"] : unknown; //#endregion //#region ../../node_modules/.pnpm/@ai-sdk+provider-utils@4.0.27_zod@4.4.3/node_modules/@ai-sdk/provider-utils/dist/index.d.ts /** * Used to mark schemas so we can support both Zod and custom schemas. */ declare const schemaSymbol: unique symbol; type ValidationResult = { success: true; value: OBJECT; } | { success: false; error: Error; }; type Schema = { /** * Used to mark schemas so we can support both Zod and custom schemas. */ [schemaSymbol]: true; /** * Schema type for inference. */ _type: OBJECT; /** * Optional. Validates that the structure of a value matches this schema, * and returns a typed version of the value if it does. */ readonly validate?: (value: unknown) => ValidationResult | PromiseLike>; /** * The JSON Schema for the schema. It is passed to the providers. */ readonly jsonSchema: JSONSchema7$1 | PromiseLike; }; /** * Creates a schema with deferred creation. * This is important to reduce the startup time of the library * and to avoid initializing unused validators. * * @param createValidator A function that creates a schema. * @returns A function that returns a schema. */ type LazySchema = () => Schema; type ZodSchema = ZodType | $ZodType; type StandardSchema = StandardSchemaV1$2 & StandardJSONSchemaV1; type FlexibleSchema = Schema | LazySchema | ZodSchema | StandardSchema; type InferSchema = SCHEMA extends ZodSchema ? T : SCHEMA extends StandardSchema ? T : SCHEMA extends LazySchema ? T : SCHEMA extends Schema ? T : never; /** * Create a schema using a JSON Schema. * * @param jsonSchema The JSON Schema for the schema. * @param options.validate Optional. A validation function for the schema. */ /** * Data content. Can either be a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer. */ type DataContent = string | Uint8Array | ArrayBuffer | Buffer; /** * Additional provider-specific options. * * They are passed through to the provider from the AI SDK and enable * provider-specific functionality that can be fully encapsulated in the provider. */ type ProviderOptions = SharedV3ProviderOptions; /** * Text content part of a prompt. It contains a string of text. */ interface TextPart { type: 'text'; /** * The text content. */ text: string; /** * Additional provider-specific metadata. They are passed through * to the provider from the AI SDK and enable provider-specific * functionality that can be fully encapsulated in the provider. */ providerOptions?: ProviderOptions; } /** * Image content part of a prompt. It contains an image. */ interface ImagePart { type: 'image'; /** * Image data. Can either be: * * - data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer * - URL: a URL that points to the image */ image: DataContent | URL; /** * Optional IANA media type of the image. * * @see https://www.iana.org/assignments/media-types/media-types.xhtml */ mediaType?: string; /** * Additional provider-specific metadata. They are passed through * to the provider from the AI SDK and enable provider-specific * functionality that can be fully encapsulated in the provider. */ providerOptions?: ProviderOptions; } /** * File content part of a prompt. It contains a file. */ interface FilePart { type: 'file'; /** * File data. Can either be: * * - data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer * - URL: a URL that points to the image */ data: DataContent | URL; /** * Optional filename of the file. */ filename?: string; /** * IANA media type of the file. * * @see https://www.iana.org/assignments/media-types/media-types.xhtml */ mediaType: string; /** * Additional provider-specific metadata. They are passed through * to the provider from the AI SDK and enable provider-specific * functionality that can be fully encapsulated in the provider. */ providerOptions?: ProviderOptions; } /** * Reasoning content part of a prompt. It contains a reasoning. */ interface ReasoningPart { type: 'reasoning'; /** * The reasoning text. */ text: string; /** * Additional provider-specific metadata. They are passed through * to the provider from the AI SDK and enable provider-specific * functionality that can be fully encapsulated in the provider. */ providerOptions?: ProviderOptions; } /** * Tool call content part of a prompt. It contains a tool call (usually generated by the AI model). */ interface ToolCallPart { type: 'tool-call'; /** * ID of the tool call. This ID is used to match the tool call with the tool result. */ toolCallId: string; /** * Name of the tool that is being called. */ toolName: string; /** * Arguments of the tool call. This is a JSON-serializable object that matches the tool's input schema. */ input: unknown; /** * Additional provider-specific metadata. They are passed through * to the provider from the AI SDK and enable provider-specific * functionality that can be fully encapsulated in the provider. */ providerOptions?: ProviderOptions; /** * Whether the tool call was executed by the provider. */ providerExecuted?: boolean; } /** * Tool result content part of a prompt. It contains the result of the tool call with the matching ID. */ interface ToolResultPart { type: 'tool-result'; /** * ID of the tool call that this result is associated with. */ toolCallId: string; /** * Name of the tool that generated this result. */ toolName: string; /** * Result of the tool call. This is a JSON-serializable object. */ output: ToolResultOutput; /** * Additional provider-specific metadata. They are passed through * to the provider from the AI SDK and enable provider-specific * functionality that can be fully encapsulated in the provider. */ providerOptions?: ProviderOptions; } /** * Output of a tool result. */ type ToolResultOutput = { /** * Text tool output that should be directly sent to the API. */ type: 'text'; value: string; /** * Provider-specific options. */ providerOptions?: ProviderOptions; } | { type: 'json'; value: JSONValue; /** * Provider-specific options. */ providerOptions?: ProviderOptions; } | { /** * Type when the user has denied the execution of the tool call. */ type: 'execution-denied'; /** * Optional reason for the execution denial. */ reason?: string; /** * Provider-specific options. */ providerOptions?: ProviderOptions; } | { type: 'error-text'; value: string; /** * Provider-specific options. */ providerOptions?: ProviderOptions; } | { type: 'error-json'; value: JSONValue; /** * Provider-specific options. */ providerOptions?: ProviderOptions; } | { type: 'content'; value: Array<{ type: 'text'; /** * Text content. */ text: string; /** * Provider-specific options. */ providerOptions?: ProviderOptions; } | { /** * @deprecated Use image-data or file-data instead. */ type: 'media'; data: string; mediaType: string; } | { type: 'file-data'; /** * Base-64 encoded media data. */ data: string; /** * IANA media type. * @see https://www.iana.org/assignments/media-types/media-types.xhtml */ mediaType: string; /** * Optional filename of the file. */ filename?: string; /** * Provider-specific options. */ providerOptions?: ProviderOptions; } | { type: 'file-url'; /** * URL of the file. */ url: string; /** * Provider-specific options. */ providerOptions?: ProviderOptions; } | { type: 'file-id'; /** * ID of the file. * * If you use multiple providers, you need to * specify the provider specific ids using * the Record option. The key is the provider * name, e.g. 'openai' or 'anthropic'. */ fileId: string | Record; /** * Provider-specific options. */ providerOptions?: ProviderOptions; } | { /** * Images that are referenced using base64 encoded data. */ type: 'image-data'; /** * Base-64 encoded image data. */ data: string; /** * IANA media type. * @see https://www.iana.org/assignments/media-types/media-types.xhtml */ mediaType: string; /** * Provider-specific options. */ providerOptions?: ProviderOptions; } | { /** * Images that are referenced using a URL. */ type: 'image-url'; /** * URL of the image. */ url: string; /** * Provider-specific options. */ providerOptions?: ProviderOptions; } | { /** * Images that are referenced using a provider file id. */ type: 'image-file-id'; /** * Image that is referenced using a provider file id. * * If you use multiple providers, you need to * specify the provider specific ids using * the Record option. The key is the provider * name, e.g. 'openai' or 'anthropic'. */ fileId: string | Record; /** * Provider-specific options. */ providerOptions?: ProviderOptions; } | { /** * Custom content part. This can be used to implement * provider-specific content parts. */ type: 'custom'; /** * Provider-specific options. */ providerOptions?: ProviderOptions; }>; }; /** * Tool approval request prompt part. */ type ToolApprovalRequest = { type: 'tool-approval-request'; /** * ID of the tool approval. */ approvalId: string; /** * ID of the tool call that the approval request is for. */ toolCallId: string; }; /** * An assistant message. It can contain text, tool calls, or a combination of text and tool calls. */ type AssistantModelMessage = { role: 'assistant'; content: AssistantContent; /** * Additional provider-specific metadata. They are passed through * to the provider from the AI SDK and enable provider-specific * functionality that can be fully encapsulated in the provider. */ providerOptions?: ProviderOptions; }; /** * Content of an assistant message. * It can be a string or an array of text, image, reasoning, redacted reasoning, and tool call parts. */ type AssistantContent = string | Array; /** * A system message. It can contain system information. * * Note: using the "system" part of the prompt is strongly preferred * to increase the resilience against prompt injection attacks, * and because not all providers support several system messages. */ type SystemModelMessage = { role: 'system'; content: string; /** * Additional provider-specific metadata. They are passed through * to the provider from the AI SDK and enable provider-specific * functionality that can be fully encapsulated in the provider. */ providerOptions?: ProviderOptions; }; /** * Tool approval response prompt part. */ type ToolApprovalResponse = { type: 'tool-approval-response'; /** * ID of the tool approval. */ approvalId: string; /** * Flag indicating whether the approval was granted or denied. */ approved: boolean; /** * Optional reason for the approval or denial. */ reason?: string; /** * Flag indicating whether the tool call is provider-executed. * Only provider-executed tool approval responses should be sent to the model. */ providerExecuted?: boolean; }; /** * A tool message. It contains the result of one or more tool calls. */ type ToolModelMessage = { role: 'tool'; content: ToolContent; /** * Additional provider-specific metadata. They are passed through * to the provider from the AI SDK and enable provider-specific * functionality that can be fully encapsulated in the provider. */ providerOptions?: ProviderOptions; }; /** * Content of a tool message. It is an array of tool result parts. */ type ToolContent = Array; /** * A user message. It can contain text or a combination of text and images. */ type UserModelMessage = { role: 'user'; content: UserContent; /** * Additional provider-specific metadata. They are passed through * to the provider from the AI SDK and enable provider-specific * functionality that can be fully encapsulated in the provider. */ providerOptions?: ProviderOptions; }; /** * Content of a user message. It can be a string or an array of text and image parts. */ type UserContent = string | Array; /** * A message that can be used in the `messages` field of a prompt. * It can be a user message, an assistant message, or a tool message. */ type ModelMessage = SystemModelMessage | UserModelMessage | AssistantModelMessage | ToolModelMessage; /** * Additional options that are sent into each tool call. */ interface ToolExecutionOptions { /** * The ID of the tool call. You can use it e.g. when sending tool-call related information with stream data. */ toolCallId: string; /** * Messages that were sent to the language model to initiate the response that contained the tool call. * The messages **do not** include the system prompt nor the assistant response that contained the tool call. */ messages: ModelMessage[]; /** * An optional abort signal that indicates that the overall operation should be aborted. */ abortSignal?: AbortSignal; /** * User-defined context. * * Treat the context object as immutable inside tools. * Mutating the context object can lead to race conditions and unexpected results * when tools are called in parallel. * * If you need to mutate the context, analyze the tool calls and results * in `prepareStep` and update it there. * * Experimental (can break in patch releases). */ experimental_context?: unknown; } /** * Function that is called to determine if the tool needs approval before it can be executed. */ type ToolNeedsApprovalFunction = (input: INPUT, options: { /** * The ID of the tool call. You can use it e.g. when sending tool-call related information with stream data. */ toolCallId: string; /** * Messages that were sent to the language model to initiate the response that contained the tool call. * The messages **do not** include the system prompt nor the assistant response that contained the tool call. */ messages: ModelMessage[]; /** * Additional context. * * Experimental (can break in patch releases). */ experimental_context?: unknown; }) => boolean | PromiseLike; type ToolExecuteFunction = (input: INPUT, options: ToolExecutionOptions) => AsyncIterable | PromiseLike | OUTPUT; type NeverOptional = 0 extends 1 & N ? Partial : [N] extends [never] ? Partial> : T; type ToolOutputProperties = NeverOptional; outputSchema?: FlexibleSchema; } | { outputSchema: FlexibleSchema; execute?: never; }>; /** * A tool contains the description and the schema of the input that the tool expects. * This enables the language model to generate the input. * * The tool can also contain an optional execute function for the actual execution function of the tool. */ type Tool = { /** * An optional description of what the tool does. * Will be used by the language model to decide whether to use the tool. * Not used for provider-defined tools. */ description?: string; /** * An optional title of the tool. */ title?: string; /** * Additional provider-specific metadata. They are passed through * to the provider from the AI SDK and enable provider-specific * functionality that can be fully encapsulated in the provider. */ providerOptions?: ProviderOptions; /** * Optional metadata about the tool itself (e.g. its source). * * Unlike `providerOptions`, this metadata is not sent to the language * model. Instead, it is propagated onto the resulting tool call's * `toolMetadata` so consumers can read it from tool call / result parts * and UI message parts. This is useful for sources of dynamic tools (e.g. * an MCP server) to identify themselves. */ metadata?: JSONObject; /** * The schema of the input that the tool expects. * The language model will use this to generate the input. * It is also used to validate the output of the language model. * * You can use descriptions on the schema properties to make the input understandable for the language model. */ inputSchema: FlexibleSchema; /** * An optional list of input examples that show the language * model what the input should look like. */ inputExamples?: Array<{ input: NoInfer; }>; /** * Whether the tool needs approval before it can be executed. */ needsApproval?: boolean | ToolNeedsApprovalFunction<[INPUT] extends [never] ? unknown : INPUT>; /** * Strict mode setting for the tool. * * Providers that support strict mode will use this setting to determine * how the input should be generated. Strict mode will always produce * valid inputs, but it might limit what input schemas are supported. */ strict?: boolean; /** * Optional function that is called when the argument streaming starts. * Only called when the tool is used in a streaming context. */ onInputStart?: (options: ToolExecutionOptions) => void | PromiseLike; /** * Optional function that is called when an argument streaming delta is available. * Only called when the tool is used in a streaming context. */ onInputDelta?: (options: { inputTextDelta: string; } & ToolExecutionOptions) => void | PromiseLike; /** * Optional function that is called when a tool call can be started, * even if the execute function is not provided. */ onInputAvailable?: (options: { input: [INPUT] extends [never] ? unknown : INPUT; } & ToolExecutionOptions) => void | PromiseLike; } & ToolOutputProperties & { /** * Optional conversion function that maps the tool result to an output that can be used by the language model. * * If not provided, the tool result will be sent as a JSON object. */ toModelOutput?: (options: { /** * The ID of the tool call. You can use it e.g. when sending tool-call related information with stream data. */ toolCallId: string; /** * The input of the tool call. */ input: [INPUT] extends [never] ? unknown : INPUT; /** * The output of the tool call. */ output: 0 extends 1 & OUTPUT ? any : [OUTPUT] extends [never] ? any : NoInfer; }) => ToolResultOutput | PromiseLike; } & ({ /** * Tool with user-defined input and output schemas. */ type?: undefined | 'function'; } | { /** * Tool that is defined at runtime (e.g. an MCP tool). * The types of input and output are not known at development time. */ type: 'dynamic'; } | { /** * Tool with provider-defined input and output schemas. */ type: 'provider'; /** * The ID of the tool. Must follow the format `.`. */ id: `${string}.${string}`; /** * The arguments for configuring the tool. Must match the expected arguments defined by the provider for this tool. */ args: Record; /** * Whether this provider-executed tool supports deferred results. * * When true, the tool result may not be returned in the same turn as the * tool call (e.g., when using programmatic tool calling where a server tool * triggers a client-executed tool, and the server tool's result is deferred * until the client tool is resolved). * * This flag allows the AI SDK to handle tool results that arrive without * a matching tool call in the current response. * * @default false */ supportsDeferredResults?: boolean; }); /** * Infer the input type of a tool. */ type InferToolInput = TOOL extends Tool ? INPUT : never; /** * Infer the output type of a tool. */ type InferToolOutput = TOOL extends Tool ? OUTPUT : never; /** * Helper function for inferring the execute args of a tool. */ //#endregion //#region ../../node_modules/.pnpm/ai@6.0.185_zod@4.4.3/node_modules/ai/dist/index.d.ts declare global { /** * Global interface that can be augmented by third-party packages to register custom model IDs. * * You can register model IDs in two ways: * * 1. Register based on Model IDs from a provider package: * @example * ```typescript * import { openai } from '@ai-sdk/openai'; * type OpenAIResponsesModelId = Parameters[0]; * * declare global { * interface RegisteredProviderModels { * openai: OpenAIResponsesModelId; * } * } * ``` * * 2. Register individual model IDs directly as keys: * @example * ```typescript * declare global { * interface RegisteredProviderModels { * 'my-provider:my-model': any; * 'my-provider:another-model': any; * } * } * ``` */ interface RegisteredProviderModels {} } /** * Global provider model ID type that defaults to GatewayModelId but can be augmented * by third-party packages via declaration merging. */ /** * Reason why a language model finished generating a response. * * Can be one of the following: * - `stop`: model generated stop sequence * - `length`: model generated maximum number of tokens * - `content-filter`: content filter violation stopped the model * - `tool-calls`: model triggered tool calls * - `error`: model stopped because of an error * - `other`: model stopped for other reasons */ type FinishReason = 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other'; /** * Warning from the model provider for this call. The call will proceed, but e.g. * some settings might not be supported, which can lead to suboptimal results. */ type CallWarning = SharedV3Warning; /** * A source that has been used as input to generate the response. */ type Source = LanguageModelV3Source; /** * Tool choice for the generation. It supports the following settings: * * - `auto` (default): the model can choose whether and which tools to call. * - `required`: the model must call a tool. It can choose which tool to call. * - `none`: the model must not call tools * - `{ type: 'tool', toolName: string (typed) }`: the model must call the specified tool */ type ToolChoice> = 'auto' | 'none' | 'required' | { type: 'tool'; toolName: Extract; }; type LanguageModelRequestMetadata = { /** * Request HTTP body that was sent to the provider API. */ body?: unknown; }; type LanguageModelResponseMetadata = { /** * ID for the generated response. */ id: string; /** * Timestamp for the start of the generated response. */ timestamp: Date; /** * The ID of the response model that was used to generate the response. */ modelId: string; /** * Response headers (available only for providers that use HTTP requests). */ headers?: Record; }; /** * Reranking model that is used by the AI SDK. */ /** * Additional provider-specific metadata that is returned from the provider. * * This is needed to enable provider-specific functionality that can be * fully encapsulated in the provider. */ type ProviderMetadata = SharedV3ProviderMetadata; /** * Speech model that is used by the AI SDK. */ /** * Represents the number of tokens used in a prompt and completion. */ type LanguageModelUsage = { /** * The total number of input (prompt) tokens used. */ inputTokens: number | undefined; /** * Detailed information about the input tokens. */ inputTokenDetails: { /** * The number of non-cached input (prompt) tokens used. */ noCacheTokens: number | undefined; /** * The number of cached input (prompt) tokens read. */ cacheReadTokens: number | undefined; /** * The number of cached input (prompt) tokens written. */ cacheWriteTokens: number | undefined; }; /** * The number of total output (completion) tokens used. */ outputTokens: number | undefined; /** * Detailed information about the output tokens. */ outputTokenDetails: { /** * The number of text tokens used. */ textTokens: number | undefined; /** * The number of reasoning tokens used. */ reasoningTokens: number | undefined; }; /** * The total number of tokens used. */ totalTokens: number | undefined; /** * @deprecated Use outputTokenDetails.reasoningTokens instead. */ reasoningTokens?: number | undefined; /** * @deprecated Use inputTokenDetails.cacheReadTokens instead. */ cachedInputTokens?: number | undefined; /** * Raw usage information from the provider. * * This is the usage information in the shape that the provider returns. * It can include additional information that is not part of the standard usage information. */ raw?: JSONObject; }; /** * Represents the number of tokens used in an embedding. */ /** * Warning from the model provider for this call. The call will proceed, but e.g. * some settings might not be supported, which can lead to suboptimal results. */ type Warning = SharedV3Warning; /** * A function for logging warnings. * * You can assign it to the `AI_SDK_LOG_WARNINGS` global variable to use it as the default warning logger. * * @example * ```ts * globalThis.AI_SDK_LOG_WARNINGS = (options) => { * console.log('WARNINGS:', options.warnings, options.provider, options.model); * }; * ``` */ type LogWarningsFunction = (options: { /** * The warnings returned by the model provider. */ warnings: Warning[]; /** * The provider id used for the call. */ provider: string; /** * The model id used for the call. */ model: string; }) => void; /** * Timeout configuration for API calls. Can be specified as: * - A number representing milliseconds * - An object with `totalMs` property for the total timeout in milliseconds * - An object with `stepMs` property for the timeout of each step in milliseconds * - An object with `chunkMs` property for the timeout between stream chunks (streaming only) */ type TimeoutConfiguration = number | { totalMs?: number; stepMs?: number; chunkMs?: number; }; /** * Create a type from an object with all keys and nested keys set to optional. * The helper supports normal objects and schemas (which are resolved automatically). * It always recurses into arrays. * * Adopted from [type-fest](https://github.com/sindresorhus/type-fest/tree/main) PartialDeep. */ type DeepPartial = T extends FlexibleSchema ? DeepPartialInternal> : DeepPartialInternal; type DeepPartialInternal = T extends null | undefined | string | number | boolean | symbol | bigint | void | Date | RegExp | ((...arguments_: any[]) => unknown) | (new (...arguments_: any[]) => unknown) ? T : T extends Map ? PartialMap : T extends Set ? PartialSet : T extends ReadonlyMap ? PartialReadonlyMap : T extends ReadonlySet ? PartialReadonlySet : T extends object ? T extends ReadonlyArray ? ItemType[] extends T ? readonly ItemType[] extends T ? ReadonlyArray> : Array> : PartialObject : PartialObject : unknown; type PartialMap = {} & Map, DeepPartialInternal>; type PartialSet = {} & Set>; type PartialReadonlyMap = {} & ReadonlyMap, DeepPartialInternal>; type PartialReadonlySet = {} & ReadonlySet>; type PartialObject = { [KeyType in keyof ObjectType]?: DeepPartialInternal }; /** * Prompt part of the AI function options. * It contains a system message, a simple text prompt, or a list of messages. */ /** * Reasoning output of a text generation. It contains a reasoning. */ interface ReasoningOutput { type: 'reasoning'; /** * The reasoning text. */ text: string; /** * Additional provider-specific metadata. They are passed through * to the provider from the AI SDK and enable provider-specific * functionality that can be fully encapsulated in the provider. */ providerMetadata?: ProviderMetadata; } /** * A generated file. */ interface GeneratedFile { /** * File as a base64 encoded string. */ readonly base64: string; /** * File as a Uint8Array. */ readonly uint8Array: Uint8Array; /** * The IANA media type of the file. * * @see https://www.iana.org/assignments/media-types/media-types.xhtml */ readonly mediaType: string; } /** * Create a union of the given object's values, and optionally specify which keys to get the values from. * * Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/31438) if you want to have this type as a built-in in TypeScript. * * @example * ``` * // data.json * { * 'foo': 1, * 'bar': 2, * 'biz': 3 * } * * // main.ts * import type {ValueOf} from 'type-fest'; * import data = require('./data.json'); * * export function getData(name: string): ValueOf { * return data[name]; * } * * export function onlyBar(name: string): ValueOf { * return data[name]; * } * * // file.ts * import {getData, onlyBar} from './main'; * * getData('foo'); * //=> 1 * * onlyBar('foo'); * //=> TypeError ... * * onlyBar('bar'); * //=> 2 * ``` * @see https://github.com/sindresorhus/type-fest/blob/main/source/value-of.d.ts */ type ValueOf = ObjectType[ValueType]; type ToolSet = Record | Tool | Tool | Tool) & Pick, 'execute' | 'onInputAvailable' | 'onInputStart' | 'onInputDelta' | 'needsApproval'>>; type BaseToolCall = { type: 'tool-call'; toolCallId: string; providerExecuted?: boolean; providerMetadata?: ProviderMetadata; toolMetadata?: JSONObject; }; type StaticToolCall = ValueOf<{ [NAME in keyof TOOLS]: BaseToolCall & { toolName: NAME & string; input: TOOLS[NAME] extends Tool ? PARAMETERS : never; dynamic?: false | undefined; invalid?: false | undefined; error?: never; title?: string; } }>; type DynamicToolCall = BaseToolCall & { toolName: string; input: unknown; dynamic: true; title?: string; /** * True if this is caused by an unparsable tool call or * a tool that does not exist. */ invalid?: boolean; /** * The error that caused the tool call to be invalid. */ error?: unknown; }; type TypedToolCall = StaticToolCall | DynamicToolCall; /** * Output part that indicates that a tool approval request has been made. * * The tool approval request can be approved or denied in the next tool message. */ type ToolApprovalRequestOutput = { type: 'tool-approval-request'; /** * ID of the tool approval request. */ approvalId: string; /** * Tool call that the approval request is for. */ toolCall: TypedToolCall; }; type StaticToolError = ValueOf<{ [NAME in keyof TOOLS]: { type: 'tool-error'; toolCallId: string; toolName: NAME & string; input: InferToolInput; error: unknown; providerExecuted?: boolean; providerMetadata?: ProviderMetadata; toolMetadata?: JSONObject; dynamic?: false | undefined; title?: string; } }>; type DynamicToolError = { type: 'tool-error'; toolCallId: string; toolName: string; input: unknown; error: unknown; providerExecuted?: boolean; providerMetadata?: ProviderMetadata; toolMetadata?: JSONObject; dynamic: true; title?: string; }; type TypedToolError = StaticToolError | DynamicToolError; type StaticToolResult = ValueOf<{ [NAME in keyof TOOLS]: { type: 'tool-result'; toolCallId: string; toolName: NAME & string; input: InferToolInput; output: InferToolOutput; providerExecuted?: boolean; providerMetadata?: ProviderMetadata; toolMetadata?: JSONObject; dynamic?: false | undefined; preliminary?: boolean; title?: string; } }>; type DynamicToolResult = { type: 'tool-result'; toolCallId: string; toolName: string; input: unknown; output: unknown; providerExecuted?: boolean; providerMetadata?: ProviderMetadata; toolMetadata?: JSONObject; dynamic: true; preliminary?: boolean; title?: string; }; type TypedToolResult = StaticToolResult | DynamicToolResult; type ContentPart = { type: 'text'; text: string; providerMetadata?: ProviderMetadata; } | ReasoningOutput | ({ type: 'source'; } & Source) | { type: 'file'; file: GeneratedFile; providerMetadata?: ProviderMetadata; } | ({ type: 'tool-call'; } & TypedToolCall & { providerMetadata?: ProviderMetadata; }) | ({ type: 'tool-result'; } & TypedToolResult & { providerMetadata?: ProviderMetadata; }) | ({ type: 'tool-error'; } & TypedToolError & { providerMetadata?: ProviderMetadata; }) | ToolApprovalRequestOutput; /** * A message that was generated during the generation process. * It can be either an assistant message or a tool message. */ type ResponseMessage = AssistantModelMessage | ToolModelMessage; /** * The result of a single step in the generation process. */ type StepResult = { /** * Zero-based index of this step. */ readonly stepNumber: number; /** * Information about the model that produced this step. */ readonly model: { /** The provider of the model. */readonly provider: string; /** The ID of the model. */ readonly modelId: string; }; /** * Identifier from telemetry settings for grouping related operations. */ readonly functionId: string | undefined; /** * Additional metadata from telemetry settings. */ readonly metadata: Record | undefined; /** * User-defined context object flowing through the generation. * * Experimental (can break in patch releases). */ readonly experimental_context: unknown; /** * The content that was generated in the last step. */ readonly content: Array>; /** * The generated text. */ readonly text: string; /** * The reasoning that was generated during the generation. */ readonly reasoning: Array; /** * The reasoning text that was generated during the generation. */ readonly reasoningText: string | undefined; /** * The files that were generated during the generation. */ readonly files: Array; /** * The sources that were used to generate the text. */ readonly sources: Array; /** * The tool calls that were made during the generation. */ readonly toolCalls: Array>; /** * The static tool calls that were made in the last step. */ readonly staticToolCalls: Array>; /** * The dynamic tool calls that were made in the last step. */ readonly dynamicToolCalls: Array; /** * The results of the tool calls. */ readonly toolResults: Array>; /** * The static tool results that were made in the last step. */ readonly staticToolResults: Array>; /** * The dynamic tool results that were made in the last step. */ readonly dynamicToolResults: Array; /** * The unified reason why the generation finished. */ readonly finishReason: FinishReason; /** * The raw reason why the generation finished (from the provider). */ readonly rawFinishReason: string | undefined; /** * The token usage of the generated text. */ readonly usage: LanguageModelUsage; /** * Warnings from the model provider (e.g. unsupported settings). */ readonly warnings: CallWarning[] | undefined; /** * Additional request information. */ readonly request: LanguageModelRequestMetadata; /** * Additional response information. */ readonly response: LanguageModelResponseMetadata & { /** * The response messages that were generated during the call. * Response messages can be either assistant messages or tool messages. * They contain a generated id. */ readonly messages: Array; /** * Response body (available only for providers that use HTTP requests). */ body?: unknown; }; /** * Additional provider-specific metadata. They are passed through * from the provider to the AI SDK and enable provider-specific * results that can be fully encapsulated in the provider. */ readonly providerMetadata: ProviderMetadata | undefined; }; /** * Function that you can use to provide different settings for a step. * * @param options - The options for the step. * @param options.steps - The steps that have been executed so far. * @param options.stepNumber - The number of the step that is being executed. * @param options.model - The model that is being used. * @param options.messages - The messages that will be sent to the model for the current step. * @param options.experimental_context - The context passed via the experimental_context setting (experimental). * * @returns An object that contains the settings for the step. * If you return undefined (or for undefined settings), the settings from the outer level will be used. */ type StopCondition = (options: { steps: Array>; }) => PromiseLike | boolean; /** * Tool output when the tool execution has been denied (for static tools). */ type StaticToolOutputDenied = ValueOf<{ [NAME in keyof TOOLS]: { type: 'tool-output-denied'; toolCallId: string; toolName: NAME & string; providerExecuted?: boolean; dynamic?: false | undefined; } }>; /** * Tool output when the tool execution has been denied. */ /** * The data types that can be used in the UI message for the UI message data parts. */ type UIDataTypes = Record; type UITool = { input: unknown; output: unknown | undefined; }; /** * Infer the input and output types of a tool so it can be used as a UI tool. */ type InferUITool = { input: InferToolInput; output: InferToolOutput; }; /** * Infer the input and output types of a tool set so it can be used as a UI tool set. */ type UITools = Record; /** * AI SDK UI Messages. They are used in the client and to communicate between the frontend and the API routes. */ interface UIMessage { /** * A unique identifier for the message. */ id: string; /** * The role of the message. */ role: 'system' | 'user' | 'assistant'; /** * The metadata of the message. */ metadata?: METADATA; /** * The parts of the message. Use this for rendering the message in the UI. * * System messages should be avoided (set the system prompt on the server instead). * They can have text parts. * * User messages can have text parts and file parts. * * Assistant messages can have text, reasoning, tool invocation, and file parts. */ parts: Array>; } type UIMessagePart = TextUIPart | ReasoningUIPart | ToolUIPart | DynamicToolUIPart | SourceUrlUIPart | SourceDocumentUIPart | FileUIPart | DataUIPart | StepStartUIPart; /** * A text part of a message. */ type TextUIPart = { type: 'text'; /** * The text content. */ text: string; /** * The state of the text part. */ state?: 'streaming' | 'done'; /** * The provider metadata. */ providerMetadata?: ProviderMetadata; }; /** * A reasoning part of a message. */ type ReasoningUIPart = { type: 'reasoning'; /** * The reasoning text. */ text: string; /** * The state of the reasoning part. */ state?: 'streaming' | 'done'; /** * The provider metadata. */ providerMetadata?: ProviderMetadata; }; /** * A source part of a message. */ type SourceUrlUIPart = { type: 'source-url'; sourceId: string; url: string; title?: string; providerMetadata?: ProviderMetadata; }; /** * A document source part of a message. */ type SourceDocumentUIPart = { type: 'source-document'; sourceId: string; mediaType: string; title: string; filename?: string; providerMetadata?: ProviderMetadata; }; /** * A file part of a message. */ type FileUIPart = { type: 'file'; /** * IANA media type of the file. * * @see https://www.iana.org/assignments/media-types/media-types.xhtml */ mediaType: string; /** * Optional filename of the file. */ filename?: string; /** * The URL of the file. * It can either be a URL to a hosted file or a [Data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs). */ url: string; /** * The provider metadata. */ providerMetadata?: ProviderMetadata; }; /** * A step boundary part of a message. */ type StepStartUIPart = { type: 'step-start'; }; type DataUIPart = ValueOf<{ [NAME in keyof DATA_TYPES & string]: { type: `data-${NAME}`; id?: string; data: DATA_TYPES[NAME]; } }>; type asUITool = TOOL extends Tool ? InferUITool : TOOL; /** * Check if a message part is a data part. */ /** * A UI tool invocation contains all the information needed to render a tool invocation in the UI. * It can be derived from a tool without knowing the tool name, and can be used to define * UI components for the tool. */ type UIToolInvocation = { /** * ID of the tool call. */ toolCallId: string; title?: string; toolMetadata?: JSONObject; /** * Whether the tool call was executed by the provider. */ providerExecuted?: boolean; } & ({ state: 'input-streaming'; input: DeepPartial['input']> | undefined; output?: never; errorText?: never; callProviderMetadata?: ProviderMetadata; approval?: never; } | { state: 'input-available'; input: asUITool['input']; output?: never; errorText?: never; callProviderMetadata?: ProviderMetadata; approval?: never; } | { state: 'approval-requested'; input: asUITool['input']; output?: never; errorText?: never; callProviderMetadata?: ProviderMetadata; approval: { id: string; approved?: never; reason?: never; }; } | { state: 'approval-responded'; input: asUITool['input']; output?: never; errorText?: never; callProviderMetadata?: ProviderMetadata; approval: { id: string; approved: boolean; reason?: string; }; } | { state: 'output-available'; input: asUITool['input']; output: asUITool['output']; errorText?: never; callProviderMetadata?: ProviderMetadata; resultProviderMetadata?: ProviderMetadata; preliminary?: boolean; approval?: { id: string; approved: true; reason?: string; }; } | { state: 'output-error'; input: asUITool['input'] | undefined; rawInput?: unknown; output?: never; errorText: string; callProviderMetadata?: ProviderMetadata; resultProviderMetadata?: ProviderMetadata; approval?: { id: string; approved: true; reason?: string; }; } | { state: 'output-denied'; input: asUITool['input']; output?: never; errorText?: never; callProviderMetadata?: ProviderMetadata; approval: { id: string; approved: false; reason?: string; }; }); type ToolUIPart = ValueOf<{ [NAME in keyof TOOLS & string]: { type: `tool-${NAME}`; } & UIToolInvocation }>; type DynamicToolUIPart = { type: 'dynamic-tool'; /** * Name of the tool that is being called. */ toolName: string; /** * ID of the tool call. */ toolCallId: string; title?: string; toolMetadata?: JSONObject; /** * Whether the tool call was executed by the provider. */ providerExecuted?: boolean; } & ({ state: 'input-streaming'; input: unknown | undefined; output?: never; errorText?: never; callProviderMetadata?: ProviderMetadata; approval?: never; } | { state: 'input-available'; input: unknown; output?: never; errorText?: never; callProviderMetadata?: ProviderMetadata; approval?: never; } | { state: 'approval-requested'; input: unknown; output?: never; errorText?: never; callProviderMetadata?: ProviderMetadata; approval: { id: string; approved?: never; reason?: never; }; } | { state: 'approval-responded'; input: unknown; output?: never; errorText?: never; callProviderMetadata?: ProviderMetadata; approval: { id: string; approved: boolean; reason?: string; }; } | { state: 'output-available'; input: unknown; output: unknown; errorText?: never; callProviderMetadata?: ProviderMetadata; resultProviderMetadata?: ProviderMetadata; preliminary?: boolean; approval?: { id: string; approved: true; reason?: string; }; } | { state: 'output-error'; input: unknown; output?: never; errorText: string; callProviderMetadata?: ProviderMetadata; resultProviderMetadata?: ProviderMetadata; approval?: { id: string; approved: true; reason?: string; }; } | { state: 'output-denied'; input: unknown; output?: never; errorText?: never; callProviderMetadata?: ProviderMetadata; approval: { id: string; approved: false; reason?: string; }; }); /** * Type guard to check if a message part is a text part. */ type TextStreamPart = { type: 'text-start'; id: string; providerMetadata?: ProviderMetadata; } | { type: 'text-end'; id: string; providerMetadata?: ProviderMetadata; } | { type: 'text-delta'; id: string; providerMetadata?: ProviderMetadata; text: string; } | { type: 'reasoning-start'; id: string; providerMetadata?: ProviderMetadata; } | { type: 'reasoning-end'; id: string; providerMetadata?: ProviderMetadata; } | { type: 'reasoning-delta'; providerMetadata?: ProviderMetadata; id: string; text: string; } | { type: 'tool-input-start'; id: string; toolName: string; providerMetadata?: ProviderMetadata; toolMetadata?: JSONObject; providerExecuted?: boolean; dynamic?: boolean; title?: string; } | { type: 'tool-input-end'; id: string; providerMetadata?: ProviderMetadata; } | { type: 'tool-input-delta'; id: string; delta: string; providerMetadata?: ProviderMetadata; } | ({ type: 'source'; } & Source) | { type: 'file'; file: GeneratedFile; providerMetadata?: ProviderMetadata; } | ({ type: 'tool-call'; } & TypedToolCall) | ({ type: 'tool-result'; } & TypedToolResult) | ({ type: 'tool-error'; } & TypedToolError) | ({ type: 'tool-output-denied'; } & StaticToolOutputDenied) | ToolApprovalRequestOutput | { type: 'start-step'; request: LanguageModelRequestMetadata; warnings: CallWarning[]; } | { type: 'finish-step'; response: LanguageModelResponseMetadata; usage: LanguageModelUsage; finishReason: FinishReason; rawFinishReason: string | undefined; providerMetadata: ProviderMetadata | undefined; } | { type: 'start'; } | { type: 'finish'; finishReason: FinishReason; rawFinishReason: string | undefined; totalUsage: LanguageModelUsage; } | { type: 'abort'; reason?: string; } | { type: 'error'; error: unknown; } | { type: 'raw'; rawValue: unknown; }; /** * A transformation that is applied to the stream. * * @param stopStream - A function that stops the source stream. * @param tools - The tools that are accessible to and can be called by the model. The model needs to support calling tools. */ type EnrichedStreamPart = { part: TextStreamPart; partialOutput: PARTIAL_OUTPUT | undefined; }; interface Output { /** * The name of the output mode. */ name: string; /** * The response format to use for the model. */ responseFormat: PromiseLike; /** * Parses the complete output of the model. */ parseCompleteOutput(options: { text: string; }, context: { response: LanguageModelResponseMetadata; usage: LanguageModelUsage; finishReason: FinishReason; }): Promise; /** * Parses the partial output of the model. */ parsePartialOutput(options: { text: string; }): Promise<{ partial: PARTIAL; } | undefined>; /** * Creates a stream transform that emits individual elements as they complete. */ createElementStreamTransform(): TransformStream, ELEMENT> | undefined; } /** * Output specification for text generation. * This is the default output mode that generates plain text. * * @returns An output specification for generating text. */ /** * Common model information used across callback events. */ interface CallbackModelInfo { /** The provider identifier (e.g., 'openai', 'anthropic'). */ readonly provider: string; /** The specific model identifier (e.g., 'gpt-4o'). */ readonly modelId: string; } /** * Event passed to the `onStart` callback. * * Called when the generation operation begins, before any LLM calls. */ interface OnStartEvent { /** The model being used for generation. */ readonly model: CallbackModelInfo; /** The system message(s) provided to the model. */ readonly system: string | SystemModelMessage | Array | undefined; /** The prompt string or array of messages if using the prompt option. */ readonly prompt: string | Array | undefined; /** The messages array if using the messages option. */ readonly messages: Array | undefined; /** The tools available for this generation. */ readonly tools: TOOLS | undefined; /** The tool choice strategy for this generation. */ readonly toolChoice: ToolChoice> | undefined; /** Limits which tools are available for the model to call. */ readonly activeTools: Array | undefined; /** Maximum number of tokens to generate. */ readonly maxOutputTokens: number | undefined; /** Sampling temperature for generation. */ readonly temperature: number | undefined; /** Top-p (nucleus) sampling parameter. */ readonly topP: number | undefined; /** Top-k sampling parameter. */ readonly topK: number | undefined; /** Presence penalty for generation. */ readonly presencePenalty: number | undefined; /** Frequency penalty for generation. */ readonly frequencyPenalty: number | undefined; /** Sequences that will stop generation. */ readonly stopSequences: string[] | undefined; /** Random seed for reproducible generation. */ readonly seed: number | undefined; /** Maximum number of retries for failed requests. */ readonly maxRetries: number; /** * Timeout configuration for the generation. * Can be a number (milliseconds) or an object with totalMs, stepMs, chunkMs. */ readonly timeout: TimeoutConfiguration | undefined; /** Additional HTTP headers sent with the request. */ readonly headers: Record | undefined; /** Additional provider-specific options. */ readonly providerOptions: ProviderOptions | undefined; /** * Condition(s) for stopping the generation. * When the condition is an array, any of the conditions can be met to stop. */ readonly stopWhen: StopCondition | Array> | undefined; /** The output specification for structured outputs, if configured. */ readonly output: OUTPUT | undefined; /** Abort signal for cancelling the operation. */ readonly abortSignal: AbortSignal | undefined; /** * Settings for controlling what data is included in step results. */ readonly include: INCLUDE | undefined; /** Identifier from telemetry settings for grouping related operations. */ readonly functionId: string | undefined; /** Additional metadata passed to the generation. */ readonly metadata: Record | undefined; /** * User-defined context object that flows through the entire generation lifecycle. * Can be accessed and modified in `prepareStep` and tool `execute` functions. */ readonly experimental_context: unknown; } /** * Event passed to the `onStepStart` callback. * * Called when a step (LLM call) begins, before the provider is called. * Each step represents a single LLM invocation. */ interface OnStepStartEvent { /** Zero-based index of the current step. */ readonly stepNumber: number; /** The model being used for this step. */ readonly model: CallbackModelInfo; /** * The system message for this step. */ readonly system: string | SystemModelMessage | Array | undefined; /** * The messages that will be sent to the model for this step. * Uses the user-facing `ModelMessage` format. * May be overridden by prepareStep. */ readonly messages: Array; /** The tools available for this generation. */ readonly tools: TOOLS | undefined; /** The tool choice configuration for this step. */ readonly toolChoice: LanguageModelV3ToolChoice | undefined; /** Limits which tools are available for this step. */ readonly activeTools: Array | undefined; /** Array of results from previous steps (empty for first step). */ readonly steps: ReadonlyArray>; /** Additional provider-specific options for this step. */ readonly providerOptions: ProviderOptions | undefined; /** * Timeout configuration for the generation. * Can be a number (milliseconds) or an object with totalMs, stepMs, chunkMs. */ readonly timeout: TimeoutConfiguration | undefined; /** Additional HTTP headers sent with the request. */ readonly headers: Record | undefined; /** * Condition(s) for stopping the generation. * When the condition is an array, any of the conditions can be met to stop. */ readonly stopWhen: StopCondition | Array> | undefined; /** The output specification for structured outputs, if configured. */ readonly output: OUTPUT | undefined; /** Abort signal for cancelling the operation. */ readonly abortSignal: AbortSignal | undefined; /** * Settings for controlling what data is included in step results. */ readonly include: INCLUDE | undefined; /** Identifier from telemetry settings for grouping related operations. */ readonly functionId: string | undefined; /** Additional metadata from telemetry settings. */ readonly metadata: Record | undefined; /** * User-defined context object. May be updated from `prepareStep` between steps. */ readonly experimental_context: unknown; } /** * Event passed to the `onToolCallStart` callback. * * Called when a tool execution begins, before the tool's `execute` function is invoked. */ interface OnToolCallStartEvent { /** Zero-based index of the current step where this tool call occurs. */ readonly stepNumber: number | undefined; /** The model being used for this step. */ readonly model: CallbackModelInfo | undefined; /** The full tool call object. */ readonly toolCall: TypedToolCall; /** The conversation messages available at tool execution time. */ readonly messages: Array; /** Signal for cancelling the operation. */ readonly abortSignal: AbortSignal | undefined; /** Identifier from telemetry settings for grouping related operations. */ readonly functionId: string | undefined; /** Additional metadata from telemetry settings. */ readonly metadata: Record | undefined; /** User-defined context object flowing through the generation. */ readonly experimental_context: unknown; } /** * Event passed to the `onToolCallFinish` callback. * * Called when a tool execution completes, either successfully or with an error. * Uses a discriminated union on the `success` field. */ type OnToolCallFinishEvent = { /** Zero-based index of the current step where this tool call occurred. */readonly stepNumber: number | undefined; /** The model being used for this step. */ readonly model: CallbackModelInfo | undefined; /** The full tool call object. */ readonly toolCall: TypedToolCall; /** The conversation messages available at tool execution time. */ readonly messages: Array; /** Signal for cancelling the operation. */ readonly abortSignal: AbortSignal | undefined; /** Execution time of the tool call in milliseconds. */ readonly durationMs: number; /** Identifier from telemetry settings for grouping related operations. */ readonly functionId: string | undefined; /** Additional metadata from telemetry settings. */ readonly metadata: Record | undefined; /** User-defined context object flowing through the generation. */ readonly experimental_context: unknown; } & ({ /** Indicates the tool call succeeded. */readonly success: true; /** The tool's return value. */ readonly output: unknown; readonly error?: never; } | { /** Indicates the tool call failed. */readonly success: false; readonly output?: never; /** The error that occurred during tool execution. */ readonly error: unknown; }); /** * Event passed to the `onStepFinish` callback. * * Called when a step (LLM call) completes. * This is simply the StepResult for that step. */ type OnStepFinishEvent = StepResult; /** * Event passed to the `onFinish` callback. * * Called when the entire generation completes (all steps finished). * Includes the final step's result along with aggregated data from all steps. */ type OnFinishEvent = StepResult & { /** Array containing results from all steps in the generation. */readonly steps: StepResult[]; /** Aggregated token usage across all steps. */ readonly totalUsage: LanguageModelUsage; /** * The final state of the user-defined context object. * * Experimental (can break in patch releases). * * @default undefined */ experimental_context: unknown; /** Identifier from telemetry settings for grouping related operations. */ readonly functionId: string | undefined; /** Additional metadata from telemetry settings. */ readonly metadata: Record | undefined; }; /** * A callback function that can be used to notify listeners. */ type Listener = (event: EVENT) => PromiseLike | void; /** * Implement this interface to create custom telemetry integrations. * Methods can be sync or return a PromiseLike. */ interface TelemetryIntegration { onStart?: Listener>; onStepStart?: Listener>; onToolCallStart?: Listener>; onToolCallFinish?: Listener>; onStepFinish?: Listener>; onFinish?: Listener>; } declare global { /** * The default provider to use for the AI SDK. * String model ids are resolved to the default provider and model id. * * If not set, the default provider is the Vercel AI gateway provider. * * @see https://ai-sdk.dev/docs/ai-sdk-core/provider-management#global-provider-configuration */ var AI_SDK_DEFAULT_PROVIDER: ProviderV3 | undefined; /** * The warning logger to use for the AI SDK. * * If not set, the default logger is the console.warn function. * * If set to false, no warnings are logged. */ var AI_SDK_LOG_WARNINGS: LogWarningsFunction | undefined | false; /** * Globally registered telemetry integrations for the AI SDK. * * Integrations registered here receive lifecycle events (onStart, onStepStart, * etc.) from every `generateText`, `streamText`, and similar call. * * Prefer using `registerTelemetryIntegration()` from `'ai'` instead of * assigning this directly. */ var AI_SDK_TELEMETRY_INTEGRATIONS: TelemetryIntegration[] | undefined; } //#endregion //#region ../../node_modules/.pnpm/@json-render+core@0.16.0_zod@4.4.3/node_modules/@json-render/core/dist/store-utils-D98Czbil.d.ts /** * Confirmation dialog configuration */ interface ActionConfirm { title: string; message: string; confirmLabel?: string; cancelLabel?: string; variant?: "default" | "danger"; } /** * Action success handler */ type ActionOnSuccess = { navigate: string; } | { set: Record; } | { action: string; }; /** * Action error handler */ type ActionOnError = { set: Record; } | { action: string; }; /** * Action binding — maps an event to an action invocation. * * Used inside the `on` field of a UIElement: * ```json * { "on": { "press": { "action": "setState", "params": { "statePath": "/x", "value": 1 } } } } * ``` */ interface ActionBinding { /** Action name (must be in catalog) */ action: string; /** Parameters to pass to the action handler */ params?: Record; /** Confirmation dialog before execution */ confirm?: ActionConfirm; /** Handler after successful execution */ onSuccess?: ActionOnSuccess; /** Handler after failed execution */ onError?: ActionOnError; /** Whether to prevent default browser behavior (e.g. navigation on links) */ preventDefault?: boolean; } /** * @deprecated Use ActionBinding instead */ /** * Dynamic value - can be a literal or a `{ $state }` reference to the state model. * * Used in action params and validation args where values can either be * hardcoded or resolved from state at runtime. */ type DynamicValue = T | { $state: string; }; /** * Dynamic string value */ /** * Base UI element structure for v2 */ interface UIElement> { /** Component type from the catalog */ type: T; /** Component props */ props: P; /** Child element keys (flat structure) */ children?: string[]; /** Visibility condition */ visible?: VisibilityCondition; /** Event bindings — maps event names to action bindings */ on?: Record; /** Repeat children once per item in a state array */ repeat?: { statePath: string; key?: string; }; /** * State watchers — maps JSON Pointer state paths to action bindings. * When the value at a watched path changes, the bound actions fire. * Useful for cascading dependencies (e.g. country → city option loading). */ watch?: Record; } /** * Element with key and parentKey for use with flatToTree. * When elements are in an array (not a keyed map), key and parentKey * are needed to establish identity and parent-child relationships. */ /** * Shared comparison operators for visibility conditions. * * Use at most ONE comparison operator per condition. If multiple are * provided, only the first matching one is evaluated (precedence: * eq > neq > gt > gte > lt > lte). With no operator, truthiness is checked. * * `not` inverts the final result of whichever operator (or truthiness * check) is used. */ type ComparisonOperators = { eq?: unknown; neq?: unknown; gt?: number | { $state: string; }; gte?: number | { $state: string; }; lt?: number | { $state: string; }; lte?: number | { $state: string; }; not?: true; }; /** * A single state-based condition. * Resolves `$state` to a value from the state model, then applies the operator. * Without an operator, checks truthiness. * * When `not` is `true`, the result of the entire condition is inverted. * For example `{ $state: "/count", gt: 5, not: true }` means "NOT greater than 5". */ type StateCondition = { $state: string; } & ComparisonOperators; /** * A condition that resolves `$item` to a field on the current repeat item. * Only meaningful inside a `repeat` scope. * * Use `""` to reference the whole item, or `"field"` for a specific field. */ type ItemCondition = { $item: string; } & ComparisonOperators; /** * A condition that resolves `$index` to the current repeat array index. * Only meaningful inside a `repeat` scope. */ type IndexCondition = { $index: true; } & ComparisonOperators; /** A single visibility condition (state, item, or index). */ type SingleCondition = StateCondition | ItemCondition | IndexCondition; /** * AND wrapper — all child conditions must be true. * This is the explicit form of the implicit array AND (`SingleCondition[]`). * Unlike the implicit form, `$and` supports nested `$or` and `$and` conditions. */ type AndCondition = { $and: VisibilityCondition[]; }; /** * OR wrapper — at least one child condition must be true. */ type OrCondition = { $or: VisibilityCondition[]; }; /** * Visibility condition types. * - `boolean` — always/never * - `SingleCondition` — single condition (`$state`, `$item`, or `$index`) * - `SingleCondition[]` — implicit AND (all must be true) * - `AndCondition` — `{ $and: [...] }`, explicit AND (all must be true) * - `OrCondition` — `{ $or: [...] }`, at least one must be true */ type VisibilityCondition = boolean | SingleCondition | SingleCondition[] | AndCondition | OrCondition; /** * Flat UI tree structure (optimized for LLM generation) */ interface Spec { /** Root element key */ root: string; /** Flat map of elements by key */ elements: Record; /** Optional initial state to seed the state model. * Components using statePath will read from / write to this state. */ state?: Record; } /** * State model type */ /** * JSON patch operation types (RFC 6902) */ type PatchOp = "add" | "remove" | "replace" | "move" | "copy" | "test"; /** * JSON patch operation (RFC 6902) */ interface JsonPatch { op: PatchOp; path: string; /** Required for add, replace, test */ value?: unknown; /** Required for move, copy (source location) */ from?: string; } /** * Resolve a dynamic value against a state model */ /** * The key registered in `AppDataParts` for json-render specs. * The AI SDK automatically prefixes this with `"data-"` on the wire, * so the actual stream chunk type is `"data-spec"` (see {@link SPEC_DATA_PART_TYPE}). * * @example * ```ts * import { SPEC_DATA_PART, type SpecDataPart } from "@json-render/core"; * type AppDataParts = { [SPEC_DATA_PART]: SpecDataPart }; * ``` */ declare const SPEC_DATA_PART: "spec"; /** * The wire-format type string as it appears in stream chunks and message parts. * This is `"data-"` + {@link SPEC_DATA_PART} — i.e. `"data-spec"`. * * Use this constant when filtering message parts or enqueuing stream chunks. */ /** * Discriminated union for the payload of a {@link SPEC_DATA_PART_TYPE} SSE part. * * - `"patch"`: A single RFC 6902 JSON Patch operation (streaming, progressive UI). * - `"flat"`: A complete flat spec with `root`, `elements`, and optional `state`. * - `"nested"`: A complete nested spec (tree structure — schema depends on catalog). */ type SpecDataPart = { type: "patch"; patch: JsonPatch; } | { type: "flat"; spec: Spec; } | { type: "nested"; spec: Record; }; /** * Convenience wrapper that pipes an AI SDK UI message stream through the * json-render transform, classifying text as prose or JSONL patches. * * Eliminates the need for manual `pipeThrough(createJsonRenderTransform())` * and the associated type cast. * * @example * ```ts * import { pipeJsonRender } from "@json-render/core"; * * const stream = createUIMessageStream({ * execute: async ({ writer }) => { * writer.merge(pipeJsonRender(result.toUIMessageStream())); * }, * }); * return createUIMessageStreamResponse({ stream }); * ``` */ //#endregion //#region ../../node_modules/.pnpm/@websolutespa+ask-plugin@1._be8402adddb843fa7fb3e2b62fee89d6/node_modules/@websolutespa/ask-plugin/dist/components-IGSRMzF2.d.mts type PluginOptions = { apiKey?: string; appKey?: string; context?: SystemContext; contexts?: ChatUserContext[]; draft?: boolean; embedded?: boolean; endpoint?: string; initialSpec?: Spec | null; instance?: PluginInstance; mock?: boolean | { contents?: ChatContents; history?: Paginated; messages?: ChatMessage$1[]; stream?: ChatMessage$1[]; }; preview?: boolean; proposition?: boolean; removeSiblings?: boolean; styles?: string; threadId?: string; userId?: string; market?: string; locale?: string; }; type PluginInstance = { opened: () => boolean; setOpened: (opened: boolean) => void; toggle: () => void; send: (message: string) => void; clear: () => void; create: (target?: HTMLElement) => void; }; /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "media". */ interface Media { id: string; alt: string; updatedAt: string; createdAt: string; url?: string | null; thumbnailURL?: string | null; filename?: string | null; mimeType?: string | null; filesize?: number | null; width?: number | null; height?: number | null; focalX?: number | null; focalY?: number | null; } type ChatContents = { intro?: { title?: string | null; background?: (string | null) | Media; }; proposition?: { title?: string | null; background?: (string | null) | Media; }; enableUpload?: boolean | null; enableUserContext?: boolean | null; enableSpeechSynthesis?: boolean | null; enableSpeechRecognition?: boolean | null; enableFeedback?: boolean | null; enableHistory?: boolean | null; enablePoweredBy?: boolean | null; promptPlaceholder?: string | null; /** * The prompt placeholder that appear after first interaction, eg. 'Ask me something else...', leave blank if unsure. */ interactedPromptPlaceholder?: string | null; disclaimer?: string | null; /** * leave blank if unsure. default max file size 1048576 1 MiB. */ maxFileSize?: number | null; /** * leave blank if unsure. default allowed mime types (.jpg, .jpeg, .png, .svg, .webp, .txt, .md, .pdf, .csv, .doc, .xls, .ppt). */ mimeTypes?: string | null; /** * Determine the generation mode of the plugin. standalone for UI generation only, inline for UI and text. */ generationMode?: ('standalone' | 'inline') | null; contextsTitle?: string | null; contexts?: { title?: string | null; context?: Record | unknown[] | string | number | boolean | null; id?: string | null; }[] | null; /** * override app plugin CSS style. */ style?: string | null; }; /** * Log of all AI-generated pages. * * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "ai-histories". */ interface History$1 { id: string; renderTime: number; threadId: string; messageId: string; messages: ChatMessage$1[]; updatedAt: string; createdAt: string; } type Paginated = { docs: T[]; totalDocs: number; limit: number; totalPages: number; page: number; pagingCounter: number; hasPrevPage: boolean; hasNextPage: boolean; prevPage: number | null; nextPage: number | null; }; type DataParts$1 = { [SPEC_DATA_PART]: SpecDataPart; }; type SystemContext = Record; type ChatUserContext = { title: string; context: SystemContext; }; type ChatMessage$1 = UIMessage; //#endregion //#region src/components/plugin.d.ts declare module 'react' { namespace JSX { interface IntrinsicElements { 'ask-plugin': React$1.ComponentProps; } } } //#endregion //#region src/plugin.d.ts declare const askScavolini: (props: PluginOptions) => PluginInstance | undefined; //#endregion export { askScavolini };