@uigraph/ai-sdk 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4817 @@
1
+ import { LanguageModel, ToolSet } from "ai";
2
+ import { JSONSchema7 } from "json-schema";
3
+ //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema.d.cts
4
+ type _JSONSchema = boolean | JSONSchema;
5
+ type JSONSchema = {
6
+ [k: string]: unknown;
7
+ $schema?: "https://json-schema.org/draft/2020-12/schema" | "http://json-schema.org/draft-07/schema#" | "http://json-schema.org/draft-04/schema#";
8
+ $id?: string;
9
+ $anchor?: string;
10
+ $ref?: string;
11
+ $dynamicRef?: string;
12
+ $dynamicAnchor?: string;
13
+ $vocabulary?: Record<string, boolean>;
14
+ $comment?: string;
15
+ $defs?: Record<string, JSONSchema>;
16
+ type?: "object" | "array" | "string" | "number" | "boolean" | "null" | "integer";
17
+ additionalItems?: _JSONSchema;
18
+ unevaluatedItems?: _JSONSchema;
19
+ prefixItems?: _JSONSchema[];
20
+ items?: _JSONSchema | _JSONSchema[];
21
+ contains?: _JSONSchema;
22
+ additionalProperties?: _JSONSchema;
23
+ unevaluatedProperties?: _JSONSchema;
24
+ properties?: Record<string, _JSONSchema>;
25
+ patternProperties?: Record<string, _JSONSchema>;
26
+ dependentSchemas?: Record<string, _JSONSchema>;
27
+ propertyNames?: _JSONSchema;
28
+ if?: _JSONSchema;
29
+ then?: _JSONSchema;
30
+ else?: _JSONSchema;
31
+ allOf?: JSONSchema[];
32
+ anyOf?: JSONSchema[];
33
+ oneOf?: JSONSchema[];
34
+ not?: _JSONSchema;
35
+ multipleOf?: number;
36
+ maximum?: number;
37
+ exclusiveMaximum?: number | boolean;
38
+ minimum?: number;
39
+ exclusiveMinimum?: number | boolean;
40
+ maxLength?: number;
41
+ minLength?: number;
42
+ pattern?: string;
43
+ maxItems?: number;
44
+ minItems?: number;
45
+ uniqueItems?: boolean;
46
+ maxContains?: number;
47
+ minContains?: number;
48
+ maxProperties?: number;
49
+ minProperties?: number;
50
+ required?: string[];
51
+ dependentRequired?: Record<string, string[]>;
52
+ enum?: Array<string | number | boolean | null>;
53
+ const?: string | number | boolean | null;
54
+ id?: string;
55
+ title?: string;
56
+ description?: string;
57
+ default?: unknown;
58
+ deprecated?: boolean;
59
+ readOnly?: boolean;
60
+ writeOnly?: boolean;
61
+ nullable?: boolean;
62
+ examples?: unknown[];
63
+ format?: string;
64
+ contentMediaType?: string;
65
+ contentEncoding?: string;
66
+ contentSchema?: JSONSchema;
67
+ _prefault?: unknown;
68
+ };
69
+ type BaseSchema = JSONSchema;
70
+ //#endregion
71
+ //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/standard-schema.d.cts
72
+ /** The Standard interface. */
73
+ interface StandardTypedV1$1<Input = unknown, Output = Input> {
74
+ /** The Standard properties. */
75
+ readonly "~standard": StandardTypedV1$1.Props<Input, Output>;
76
+ }
77
+ declare namespace StandardTypedV1$1 {
78
+ /** The Standard properties interface. */
79
+ interface Props<Input = unknown, Output = Input> {
80
+ /** The version number of the standard. */
81
+ readonly version: 1;
82
+ /** The vendor name of the schema library. */
83
+ readonly vendor: string;
84
+ /** Inferred types associated with the schema. */
85
+ readonly types?: Types<Input, Output> | undefined;
86
+ }
87
+ /** The Standard types interface. */
88
+ interface Types<Input = unknown, Output = Input> {
89
+ /** The input type of the schema. */
90
+ readonly input: Input;
91
+ /** The output type of the schema. */
92
+ readonly output: Output;
93
+ }
94
+ /** Infers the input type of a Standard. */
95
+ type InferInput<Schema extends StandardTypedV1$1> = NonNullable<Schema["~standard"]["types"]>["input"];
96
+ /** Infers the output type of a Standard. */
97
+ type InferOutput<Schema extends StandardTypedV1$1> = NonNullable<Schema["~standard"]["types"]>["output"];
98
+ }
99
+ /** The Standard Schema interface. */
100
+ interface StandardSchemaV1$2<Input = unknown, Output = Input> {
101
+ /** The Standard Schema properties. */
102
+ readonly "~standard": StandardSchemaV1$2.Props<Input, Output>;
103
+ }
104
+ declare namespace StandardSchemaV1$2 {
105
+ /** The Standard Schema properties interface. */
106
+ interface Props<Input = unknown, Output = Input> extends StandardTypedV1$1.Props<Input, Output> {
107
+ /** Validates unknown input values. */
108
+ readonly validate: (value: unknown, options?: StandardSchemaV1$2.Options | undefined) => Result<Output> | Promise<Result<Output>>;
109
+ }
110
+ /** The result interface of the validate function. */
111
+ type Result<Output> = SuccessResult<Output> | FailureResult;
112
+ /** The result interface if validation succeeds. */
113
+ interface SuccessResult<Output> {
114
+ /** The typed output value. */
115
+ readonly value: Output;
116
+ /** The absence of issues indicates success. */
117
+ readonly issues?: undefined;
118
+ }
119
+ interface Options {
120
+ /** Implicit support for additional vendor-specific parameters, if needed. */
121
+ readonly libraryOptions?: Record<string, unknown> | undefined;
122
+ }
123
+ /** The result interface if validation fails. */
124
+ interface FailureResult {
125
+ /** The issues of failed validation. */
126
+ readonly issues: ReadonlyArray<Issue>;
127
+ }
128
+ /** The issue interface of the failure output. */
129
+ interface Issue {
130
+ /** The error message of the issue. */
131
+ readonly message: string;
132
+ /** The path of the issue, if any. */
133
+ readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
134
+ }
135
+ /** The path segment interface of the issue. */
136
+ interface PathSegment {
137
+ /** The key representing a path segment. */
138
+ readonly key: PropertyKey;
139
+ }
140
+ /** The Standard types interface. */
141
+ interface Types<Input = unknown, Output = Input> extends StandardTypedV1$1.Types<Input, Output> {}
142
+ /** Infers the input type of a Standard. */
143
+ type InferInput<Schema extends StandardTypedV1$1> = StandardTypedV1$1.InferInput<Schema>;
144
+ /** Infers the output type of a Standard. */
145
+ type InferOutput<Schema extends StandardTypedV1$1> = StandardTypedV1$1.InferOutput<Schema>;
146
+ }
147
+ /** The Standard JSON Schema interface. */
148
+ interface StandardJSONSchemaV1$1<Input = unknown, Output = Input> {
149
+ /** The Standard JSON Schema properties. */
150
+ readonly "~standard": StandardJSONSchemaV1$1.Props<Input, Output>;
151
+ }
152
+ declare namespace StandardJSONSchemaV1$1 {
153
+ /** The Standard JSON Schema properties interface. */
154
+ interface Props<Input = unknown, Output = Input> extends StandardTypedV1$1.Props<Input, Output> {
155
+ /** Methods for generating the input/output JSON Schema. */
156
+ readonly jsonSchema: Converter;
157
+ }
158
+ /** The Standard JSON Schema converter interface. */
159
+ interface Converter {
160
+ /** Converts the input type to JSON Schema. May throw if conversion is not supported. */
161
+ readonly input: (options: StandardJSONSchemaV1$1.Options) => Record<string, unknown>;
162
+ /** Converts the output type to JSON Schema. May throw if conversion is not supported. */
163
+ readonly output: (options: StandardJSONSchemaV1$1.Options) => Record<string, unknown>;
164
+ }
165
+ /** The target version of the generated JSON Schema.
166
+ *
167
+ * It is *strongly recommended* that implementers support `"draft-2020-12"` and `"draft-07"`, as they are both in wide use.
168
+ *
169
+ * The `"openapi-3.0"` target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema `"draft-04"`.
170
+ *
171
+ * All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target.
172
+ */
173
+ type Target = "draft-2020-12" | "draft-07" | "openapi-3.0" | ({} & string);
174
+ /** The options for the input/output methods. */
175
+ interface Options {
176
+ /** 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. */
177
+ readonly target: Target;
178
+ /** Implicit support for additional vendor-specific parameters, if needed. */
179
+ readonly libraryOptions?: Record<string, unknown> | undefined;
180
+ }
181
+ /** The Standard types interface. */
182
+ interface Types<Input = unknown, Output = Input> extends StandardTypedV1$1.Types<Input, Output> {}
183
+ /** Infers the input type of a Standard. */
184
+ type InferInput<Schema extends StandardTypedV1$1> = StandardTypedV1$1.InferInput<Schema>;
185
+ /** Infers the output type of a Standard. */
186
+ type InferOutput<Schema extends StandardTypedV1$1> = StandardTypedV1$1.InferOutput<Schema>;
187
+ }
188
+ interface StandardSchemaWithJSONProps<Input = unknown, Output = Input> extends StandardSchemaV1$2.Props<Input, Output>, StandardJSONSchemaV1$1.Props<Input, Output> {}
189
+ //#endregion
190
+ //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.d.cts
191
+ declare const $output: unique symbol;
192
+ type $output = typeof $output;
193
+ declare const $input: unique symbol;
194
+ type $input = typeof $input;
195
+ type $replace<Meta, S extends $ZodType> = Meta extends $output ? output$1<S> : Meta extends $input ? input$2<S> : Meta extends (infer M)[] ? $replace<M, S>[] : Meta extends ((...args: infer P) => infer R) ? (...args: { [K in keyof P]: $replace<P[K], S>; }) => $replace<R, S> : Meta extends object ? { [K in keyof Meta]: $replace<Meta[K], S>; } : Meta;
196
+ type MetadataType = object | undefined;
197
+ declare class $ZodRegistry<Meta extends MetadataType = MetadataType, Schema extends $ZodType = $ZodType> {
198
+ _meta: Meta;
199
+ _schema: Schema;
200
+ _map: WeakMap<Schema, $replace<Meta, Schema>>;
201
+ _idmap: Map<string, Schema>;
202
+ add<S extends Schema>(schema: S, ..._meta: undefined extends Meta ? [$replace<Meta, S>?] : [$replace<Meta, S>]): this;
203
+ clear(): this;
204
+ remove(schema: Schema): this;
205
+ get<S extends Schema>(schema: S): $replace<Meta, S> | undefined;
206
+ has(schema: Schema): boolean;
207
+ }
208
+ interface JSONSchemaMeta {
209
+ id?: string | undefined;
210
+ title?: string | undefined;
211
+ description?: string | undefined;
212
+ deprecated?: boolean | undefined;
213
+ [k: string]: unknown;
214
+ }
215
+ interface GlobalMeta extends JSONSchemaMeta {}
216
+ //#endregion
217
+ //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.d.cts
218
+ type Processor<T extends $ZodType = $ZodType> = (schema: T, ctx: ToJSONSchemaContext, json: BaseSchema, params: ProcessParams) => void;
219
+ interface JSONSchemaGeneratorParams {
220
+ processors: Record<string, Processor>;
221
+ /** A registry used to look up metadata for each schema. Any schema with an `id` property will be extracted as a $def.
222
+ * @default globalRegistry */
223
+ metadata?: $ZodRegistry<Record<string, any>>;
224
+ /** The JSON Schema version to target.
225
+ * - `"draft-2020-12"` — Default. JSON Schema Draft 2020-12
226
+ * - `"draft-07"` — JSON Schema Draft 7
227
+ * - `"draft-04"` — JSON Schema Draft 4
228
+ * - `"openapi-3.0"` — OpenAPI 3.0 Schema Object */
229
+ target?: "draft-04" | "draft-07" | "draft-2020-12" | "openapi-3.0" | ({} & string) | undefined;
230
+ /** How to handle unrepresentable types.
231
+ * - `"throw"` — Default. Unrepresentable types throw an error
232
+ * - `"any"` — Unrepresentable types become `{}` */
233
+ unrepresentable?: "throw" | "any";
234
+ /** Arbitrary custom logic that can be used to modify the generated JSON Schema. */
235
+ override?: (ctx: {
236
+ zodSchema: $ZodTypes;
237
+ jsonSchema: BaseSchema;
238
+ path: (string | number)[];
239
+ }) => void;
240
+ /** Whether to extract the `"input"` or `"output"` type. Relevant to transforms, defaults, coerced primitives, etc.
241
+ * - `"output"` — Default. Convert the output schema.
242
+ * - `"input"` — Convert the input schema. */
243
+ io?: "input" | "output";
244
+ cycles?: "ref" | "throw";
245
+ reused?: "ref" | "inline";
246
+ external?: {
247
+ registry: $ZodRegistry<{
248
+ id?: string | undefined;
249
+ }>;
250
+ uri?: ((id: string) => string) | undefined;
251
+ defs: Record<string, BaseSchema>;
252
+ } | undefined;
253
+ }
254
+ /**
255
+ * Parameters for the toJSONSchema function.
256
+ */
257
+ type ToJSONSchemaParams = Omit<JSONSchemaGeneratorParams, "processors" | "external">;
258
+ interface ProcessParams {
259
+ schemaPath: $ZodType[];
260
+ path: (string | number)[];
261
+ }
262
+ interface Seen {
263
+ /** JSON Schema result for this Zod schema */
264
+ schema: BaseSchema;
265
+ /** A cached version of the schema that doesn't get overwritten during ref resolution */
266
+ def?: BaseSchema;
267
+ defId?: string | undefined;
268
+ /** Number of times this schema was encountered during traversal */
269
+ count: number;
270
+ /** Cycle path */
271
+ cycle?: (string | number)[] | undefined;
272
+ isParent?: boolean | undefined;
273
+ /** Schema to inherit JSON Schema properties from (set by processor for wrappers) */
274
+ ref?: $ZodType | null;
275
+ /** JSON Schema property path for this schema */
276
+ path?: (string | number)[] | undefined;
277
+ }
278
+ interface ToJSONSchemaContext {
279
+ processors: Record<string, Processor>;
280
+ metadataRegistry: $ZodRegistry<Record<string, any>>;
281
+ target: "draft-04" | "draft-07" | "draft-2020-12" | "openapi-3.0" | ({} & string);
282
+ unrepresentable: "throw" | "any";
283
+ override: (ctx: {
284
+ zodSchema: $ZodType;
285
+ jsonSchema: BaseSchema;
286
+ path: (string | number)[];
287
+ }) => void;
288
+ io: "input" | "output";
289
+ counter: number;
290
+ seen: Map<$ZodType, Seen>;
291
+ cycles: "ref" | "throw";
292
+ reused: "ref" | "inline";
293
+ external?: {
294
+ registry: $ZodRegistry<{
295
+ id?: string | undefined;
296
+ }>;
297
+ uri?: ((id: string) => string) | undefined;
298
+ defs: Record<string, BaseSchema>;
299
+ } | undefined;
300
+ }
301
+ type ZodStandardSchemaWithJSON$1<T> = StandardSchemaWithJSONProps<input$2<T>, output$1<T>>;
302
+ interface ZodStandardJSONSchemaPayload<T> extends BaseSchema {
303
+ "~standard": ZodStandardSchemaWithJSON$1<T>;
304
+ }
305
+ //#endregion
306
+ //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.d.cts
307
+ type JWTAlgorithm = "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "EdDSA" | (string & {});
308
+ type MimeTypes = "application/json" | "application/xml" | "application/x-www-form-urlencoded" | "application/javascript" | "application/pdf" | "application/zip" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/octet-stream" | "application/graphql" | "text/html" | "text/plain" | "text/css" | "text/javascript" | "text/csv" | "image/png" | "image/jpeg" | "image/gif" | "image/svg+xml" | "image/webp" | "audio/mpeg" | "audio/ogg" | "audio/wav" | "audio/webm" | "video/mp4" | "video/webm" | "video/ogg" | "font/woff" | "font/woff2" | "font/ttf" | "font/otf" | "multipart/form-data" | (string & {});
309
+ type IsAny<T> = 0 extends 1 & T ? true : false;
310
+ type Omit$1<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
311
+ type MakePartial<T, K extends keyof T> = Omit$1<T, K> & InexactPartial<Pick<T, K>>;
312
+ type NoUndefined<T> = T extends undefined ? never : T;
313
+ type LoosePartial<T extends object> = InexactPartial<T> & {
314
+ [k: string]: unknown;
315
+ };
316
+ type Mask<Keys extends PropertyKey> = { [K in Keys]?: true; };
317
+ type Writeable<T> = { -readonly [P in keyof T]: T[P]; } & {};
318
+ type InexactPartial<T> = { [P in keyof T]?: T[P] | undefined; };
319
+ type BuiltIn$1 = (((...args: any[]) => any) | (new (...args: any[]) => any)) | {
320
+ readonly [Symbol.toStringTag]: string;
321
+ } | Date | Error | Generator | Promise<unknown> | RegExp;
322
+ type MakeReadonly$1<T> = T extends Map<infer K, infer V> ? ReadonlyMap<K, V> : T extends Set<infer V> ? ReadonlySet<V> : T extends [infer Head, ...infer Tail] ? readonly [Head, ...Tail] : T extends Array<infer V> ? ReadonlyArray<V> : T extends BuiltIn$1 ? T : Readonly<T>;
323
+ type SomeObject = Record<PropertyKey, any>;
324
+ type Identity<T> = T;
325
+ type Flatten<T> = Identity<{ [k in keyof T]: T[k]; }>;
326
+ type Prettify<T> = { [K in keyof T]: T[K]; } & {};
327
+ type Extend<A extends SomeObject, B extends SomeObject> = Flatten<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]; }>;
328
+ type TupleItems = ReadonlyArray<SomeType>;
329
+ type AnyFunc = (...args: any[]) => any;
330
+ type MaybeAsync<T> = T | Promise<T>;
331
+ type EnumValue = string | number;
332
+ type EnumLike = Readonly<Record<string, EnumValue>>;
333
+ type ToEnum<T extends EnumValue> = Flatten<{ [k in T]: k; }>;
334
+ type Literal = string | number | bigint | boolean | null | undefined;
335
+ type Primitive$1 = string | number | symbol | bigint | boolean | null | undefined;
336
+ type HasLength = {
337
+ length: number;
338
+ };
339
+ type Numeric = number | bigint | Date;
340
+ type PropValues = Record<string, Set<Primitive$1>>;
341
+ type PrimitiveSet = Set<Primitive$1>;
342
+ type EmptyToNever<T> = keyof T extends never ? never : T;
343
+ declare abstract class Class {
344
+ constructor(..._args: any[]);
345
+ }
346
+ //#endregion
347
+ //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/versions.d.cts
348
+ declare const version: {
349
+ readonly major: 4;
350
+ readonly minor: 4;
351
+ readonly patch: number;
352
+ };
353
+ //#endregion
354
+ //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/schemas.d.cts
355
+ interface ParseContext$1<T extends $ZodIssueBase = never> {
356
+ /** Customize error messages. */
357
+ readonly error?: $ZodErrorMap<T>;
358
+ /** Include the `input` field in issue objects. Default `false`. */
359
+ readonly reportInput?: boolean;
360
+ /** Skip eval-based fast path. Default `false`. */
361
+ readonly jitless?: boolean;
362
+ }
363
+ /** @internal */
364
+ interface ParseContextInternal<T extends $ZodIssueBase = never> extends ParseContext$1<T> {
365
+ readonly async?: boolean | undefined;
366
+ readonly direction?: "forward" | "backward";
367
+ readonly skipChecks?: boolean;
368
+ }
369
+ interface ParsePayload<T = unknown> {
370
+ value: T;
371
+ issues: $ZodRawIssue[];
372
+ /** A way to mark a whole payload as aborted. Used in codecs/pipes. */
373
+ aborted?: boolean;
374
+ /** @internal Marks a value as a fallback that an outer wrapper (e.g.
375
+ * $ZodOptional) may override with its own interpretation when input was
376
+ * undefined. Set by $ZodCatch when catchValue substitutes and by every
377
+ * $ZodTransform invocation. */
378
+ fallback?: boolean | undefined;
379
+ }
380
+ type CheckFn<T> = (input: ParsePayload<T>) => MaybeAsync<void>;
381
+ interface $ZodTypeDef {
382
+ 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";
383
+ error?: $ZodErrorMap<never> | undefined;
384
+ checks?: $ZodCheck<never>[];
385
+ }
386
+ interface _$ZodTypeInternals {
387
+ /** The `@zod/core` version of this schema */
388
+ version: typeof version;
389
+ /** Schema definition. */
390
+ def: $ZodTypeDef;
391
+ /** @internal Randomly generated ID for this schema. */
392
+ /** @internal List of deferred initializers. */
393
+ deferred: AnyFunc[] | undefined;
394
+ /** @internal Parses input and runs all checks (refinements). */
395
+ run(payload: ParsePayload<any>, ctx: ParseContextInternal): MaybeAsync<ParsePayload>;
396
+ /** @internal Parses input, doesn't run checks. */
397
+ parse(payload: ParsePayload<any>, ctx: ParseContextInternal): MaybeAsync<ParsePayload>;
398
+ /** @internal Stores identifiers for the set of traits implemented by this schema. */
399
+ traits: Set<string>;
400
+ /** @internal Indicates that a schema output type should be considered optional inside objects.
401
+ * @default Required
402
+ */
403
+ /** @internal */
404
+ optin?: "optional" | undefined;
405
+ /** @internal */
406
+ optout?: "optional" | undefined;
407
+ /** @internal The set of literal values that will pass validation. Must be an exhaustive set. Used to determine optionality in z.record().
408
+ *
409
+ * Defined on: enum, const, literal, null, undefined
410
+ * Passthrough: optional, nullable, branded, default, catch, pipe
411
+ * Todo: unions?
412
+ */
413
+ values?: PrimitiveSet | undefined;
414
+ /** Default value bubbled up from */
415
+ /** @internal A set of literal discriminators used for the fast path in discriminated unions. */
416
+ propValues?: PropValues | undefined;
417
+ /** @internal This flag indicates that a schema validation can be represented with a regular expression. Used to determine allowable schemas in z.templateLiteral(). */
418
+ pattern: RegExp | undefined;
419
+ /** @internal The constructor function of this schema. */
420
+ constr: new (def: any) => $ZodType;
421
+ /** @internal A catchall object for bag metadata related to this schema. Commonly modified by checks using `onattach`. */
422
+ bag: Record<string, unknown>;
423
+ /** @internal The set of issues this schema might throw during type checking. */
424
+ isst: $ZodIssueBase;
425
+ /** @internal Subject to change, not a public API. */
426
+ processJSONSchema?: ((ctx: ToJSONSchemaContext, json: BaseSchema, params: ProcessParams) => void) | undefined;
427
+ /** An optional method used to override `toJSONSchema` logic. */
428
+ toJSONSchema?: () => unknown;
429
+ /** @internal The parent of this schema. Only set during certain clone operations. */
430
+ parent?: $ZodType | undefined;
431
+ }
432
+ /** @internal */
433
+ interface $ZodTypeInternals<out O = unknown, out I = unknown> extends _$ZodTypeInternals {
434
+ /** @internal The inferred output type */
435
+ output: O;
436
+ /** @internal The inferred input type */
437
+ input: I;
438
+ }
439
+ type $ZodStandardSchema<T> = StandardSchemaV1$2.Props<input$2<T>, output$1<T>>;
440
+ type SomeType = {
441
+ _zod: _$ZodTypeInternals;
442
+ };
443
+ interface $ZodType<O = unknown, I = unknown, Internals extends $ZodTypeInternals<O, I> = $ZodTypeInternals<O, I>> {
444
+ _zod: Internals;
445
+ "~standard": $ZodStandardSchema<this>;
446
+ }
447
+ interface _$ZodType<T extends $ZodTypeInternals = $ZodTypeInternals> extends $ZodType<T["output"], T["input"], T> {}
448
+ declare const $ZodType: $constructor<$ZodType>;
449
+ interface $ZodStringDef extends $ZodTypeDef {
450
+ type: "string";
451
+ coerce?: boolean;
452
+ checks?: $ZodCheck<string>[];
453
+ }
454
+ interface $ZodStringInternals<Input> extends $ZodTypeInternals<string, Input> {
455
+ def: $ZodStringDef;
456
+ /** @deprecated Internal API, use with caution (not deprecated) */
457
+ pattern: RegExp;
458
+ /** @deprecated Internal API, use with caution (not deprecated) */
459
+ isst: $ZodIssueInvalidType;
460
+ bag: LoosePartial<{
461
+ minimum: number;
462
+ maximum: number;
463
+ patterns: Set<RegExp>;
464
+ format: string;
465
+ contentEncoding: string;
466
+ }>;
467
+ }
468
+ interface $ZodString<Input = unknown> extends _$ZodType<$ZodStringInternals<Input>> {}
469
+ declare const $ZodString: $constructor<$ZodString>;
470
+ interface $ZodStringFormatDef<Format extends string = string> extends $ZodStringDef, $ZodCheckStringFormatDef<Format> {}
471
+ interface $ZodStringFormatInternals<Format extends string = string> extends $ZodStringInternals<string>, $ZodCheckStringFormatInternals {
472
+ def: $ZodStringFormatDef<Format>;
473
+ }
474
+ interface $ZodStringFormat<Format extends string = string> extends $ZodType {
475
+ _zod: $ZodStringFormatInternals<Format>;
476
+ }
477
+ declare const $ZodStringFormat: $constructor<$ZodStringFormat>;
478
+ interface $ZodGUIDInternals extends $ZodStringFormatInternals<"guid"> {}
479
+ interface $ZodGUID extends $ZodType {
480
+ _zod: $ZodGUIDInternals;
481
+ }
482
+ declare const $ZodGUID: $constructor<$ZodGUID>;
483
+ interface $ZodUUIDDef extends $ZodStringFormatDef<"uuid"> {
484
+ version?: "v1" | "v2" | "v3" | "v4" | "v5" | "v6" | "v7" | "v8";
485
+ }
486
+ interface $ZodUUIDInternals extends $ZodStringFormatInternals<"uuid"> {
487
+ def: $ZodUUIDDef;
488
+ }
489
+ interface $ZodUUID extends $ZodType {
490
+ _zod: $ZodUUIDInternals;
491
+ }
492
+ declare const $ZodUUID: $constructor<$ZodUUID>;
493
+ interface $ZodEmailInternals extends $ZodStringFormatInternals<"email"> {}
494
+ interface $ZodEmail extends $ZodType {
495
+ _zod: $ZodEmailInternals;
496
+ }
497
+ declare const $ZodEmail: $constructor<$ZodEmail>;
498
+ interface $ZodURLDef extends $ZodStringFormatDef<"url"> {
499
+ hostname?: RegExp | undefined;
500
+ protocol?: RegExp | undefined;
501
+ normalize?: boolean | undefined;
502
+ }
503
+ interface $ZodURLInternals extends $ZodStringFormatInternals<"url"> {
504
+ def: $ZodURLDef;
505
+ }
506
+ interface $ZodURL extends $ZodType {
507
+ _zod: $ZodURLInternals;
508
+ }
509
+ declare const $ZodURL: $constructor<$ZodURL>;
510
+ interface $ZodEmojiInternals extends $ZodStringFormatInternals<"emoji"> {}
511
+ interface $ZodEmoji extends $ZodType {
512
+ _zod: $ZodEmojiInternals;
513
+ }
514
+ declare const $ZodEmoji: $constructor<$ZodEmoji>;
515
+ interface $ZodNanoIDInternals extends $ZodStringFormatInternals<"nanoid"> {}
516
+ interface $ZodNanoID extends $ZodType {
517
+ _zod: $ZodNanoIDInternals;
518
+ }
519
+ declare const $ZodNanoID: $constructor<$ZodNanoID>;
520
+ /**
521
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
522
+ * (timestamps embedded in the id). Use {@link $ZodCUID2} instead.
523
+ * See https://github.com/paralleldrive/cuid.
524
+ */
525
+ interface $ZodCUIDInternals extends $ZodStringFormatInternals<"cuid"> {}
526
+ /**
527
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
528
+ * (timestamps embedded in the id). Use {@link $ZodCUID2} instead.
529
+ * See https://github.com/paralleldrive/cuid.
530
+ */
531
+ interface $ZodCUID extends $ZodType {
532
+ _zod: $ZodCUIDInternals;
533
+ }
534
+ /**
535
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
536
+ * (timestamps embedded in the id). Use {@link $ZodCUID2} instead.
537
+ * See https://github.com/paralleldrive/cuid.
538
+ */
539
+ declare const $ZodCUID: $constructor<$ZodCUID>;
540
+ interface $ZodCUID2Internals extends $ZodStringFormatInternals<"cuid2"> {}
541
+ interface $ZodCUID2 extends $ZodType {
542
+ _zod: $ZodCUID2Internals;
543
+ }
544
+ declare const $ZodCUID2: $constructor<$ZodCUID2>;
545
+ interface $ZodULIDInternals extends $ZodStringFormatInternals<"ulid"> {}
546
+ interface $ZodULID extends $ZodType {
547
+ _zod: $ZodULIDInternals;
548
+ }
549
+ declare const $ZodULID: $constructor<$ZodULID>;
550
+ interface $ZodXIDInternals extends $ZodStringFormatInternals<"xid"> {}
551
+ interface $ZodXID extends $ZodType {
552
+ _zod: $ZodXIDInternals;
553
+ }
554
+ declare const $ZodXID: $constructor<$ZodXID>;
555
+ interface $ZodKSUIDInternals extends $ZodStringFormatInternals<"ksuid"> {}
556
+ interface $ZodKSUID extends $ZodType {
557
+ _zod: $ZodKSUIDInternals;
558
+ }
559
+ declare const $ZodKSUID: $constructor<$ZodKSUID>;
560
+ interface $ZodISODateTimeDef extends $ZodStringFormatDef<"datetime"> {
561
+ precision: number | null;
562
+ offset: boolean;
563
+ local: boolean;
564
+ }
565
+ interface $ZodISODateTimeInternals extends $ZodStringFormatInternals {
566
+ def: $ZodISODateTimeDef;
567
+ }
568
+ interface $ZodISODateTime extends $ZodType {
569
+ _zod: $ZodISODateTimeInternals;
570
+ }
571
+ declare const $ZodISODateTime: $constructor<$ZodISODateTime>;
572
+ interface $ZodISODateInternals extends $ZodStringFormatInternals<"date"> {}
573
+ interface $ZodISODate extends $ZodType {
574
+ _zod: $ZodISODateInternals;
575
+ }
576
+ declare const $ZodISODate: $constructor<$ZodISODate>;
577
+ interface $ZodISOTimeDef extends $ZodStringFormatDef<"time"> {
578
+ precision?: number | null;
579
+ }
580
+ interface $ZodISOTimeInternals extends $ZodStringFormatInternals<"time"> {
581
+ def: $ZodISOTimeDef;
582
+ }
583
+ interface $ZodISOTime extends $ZodType {
584
+ _zod: $ZodISOTimeInternals;
585
+ }
586
+ declare const $ZodISOTime: $constructor<$ZodISOTime>;
587
+ interface $ZodISODurationInternals extends $ZodStringFormatInternals<"duration"> {}
588
+ interface $ZodISODuration extends $ZodType {
589
+ _zod: $ZodISODurationInternals;
590
+ }
591
+ declare const $ZodISODuration: $constructor<$ZodISODuration>;
592
+ interface $ZodIPv4Def extends $ZodStringFormatDef<"ipv4"> {
593
+ version?: "v4";
594
+ }
595
+ interface $ZodIPv4Internals extends $ZodStringFormatInternals<"ipv4"> {
596
+ def: $ZodIPv4Def;
597
+ }
598
+ interface $ZodIPv4 extends $ZodType {
599
+ _zod: $ZodIPv4Internals;
600
+ }
601
+ declare const $ZodIPv4: $constructor<$ZodIPv4>;
602
+ interface $ZodIPv6Def extends $ZodStringFormatDef<"ipv6"> {
603
+ version?: "v6";
604
+ }
605
+ interface $ZodIPv6Internals extends $ZodStringFormatInternals<"ipv6"> {
606
+ def: $ZodIPv6Def;
607
+ }
608
+ interface $ZodIPv6 extends $ZodType {
609
+ _zod: $ZodIPv6Internals;
610
+ }
611
+ declare const $ZodIPv6: $constructor<$ZodIPv6>;
612
+ interface $ZodCIDRv4Def extends $ZodStringFormatDef<"cidrv4"> {
613
+ version?: "v4";
614
+ }
615
+ interface $ZodCIDRv4Internals extends $ZodStringFormatInternals<"cidrv4"> {
616
+ def: $ZodCIDRv4Def;
617
+ }
618
+ interface $ZodCIDRv4 extends $ZodType {
619
+ _zod: $ZodCIDRv4Internals;
620
+ }
621
+ declare const $ZodCIDRv4: $constructor<$ZodCIDRv4>;
622
+ interface $ZodCIDRv6Def extends $ZodStringFormatDef<"cidrv6"> {
623
+ version?: "v6";
624
+ }
625
+ interface $ZodCIDRv6Internals extends $ZodStringFormatInternals<"cidrv6"> {
626
+ def: $ZodCIDRv6Def;
627
+ }
628
+ interface $ZodCIDRv6 extends $ZodType {
629
+ _zod: $ZodCIDRv6Internals;
630
+ }
631
+ declare const $ZodCIDRv6: $constructor<$ZodCIDRv6>;
632
+ interface $ZodBase64Internals extends $ZodStringFormatInternals<"base64"> {}
633
+ interface $ZodBase64 extends $ZodType {
634
+ _zod: $ZodBase64Internals;
635
+ }
636
+ declare const $ZodBase64: $constructor<$ZodBase64>;
637
+ interface $ZodBase64URLInternals extends $ZodStringFormatInternals<"base64url"> {}
638
+ interface $ZodBase64URL extends $ZodType {
639
+ _zod: $ZodBase64URLInternals;
640
+ }
641
+ declare const $ZodBase64URL: $constructor<$ZodBase64URL>;
642
+ interface $ZodE164Internals extends $ZodStringFormatInternals<"e164"> {}
643
+ interface $ZodE164 extends $ZodType {
644
+ _zod: $ZodE164Internals;
645
+ }
646
+ declare const $ZodE164: $constructor<$ZodE164>;
647
+ interface $ZodJWTDef extends $ZodStringFormatDef<"jwt"> {
648
+ alg?: JWTAlgorithm | undefined;
649
+ }
650
+ interface $ZodJWTInternals extends $ZodStringFormatInternals<"jwt"> {
651
+ def: $ZodJWTDef;
652
+ }
653
+ interface $ZodJWT extends $ZodType {
654
+ _zod: $ZodJWTInternals;
655
+ }
656
+ declare const $ZodJWT: $constructor<$ZodJWT>;
657
+ interface $ZodNumberDef extends $ZodTypeDef {
658
+ type: "number";
659
+ coerce?: boolean;
660
+ }
661
+ interface $ZodNumberInternals<Input = unknown> extends $ZodTypeInternals<number, Input> {
662
+ def: $ZodNumberDef;
663
+ /** @deprecated Internal API, use with caution (not deprecated) */
664
+ pattern: RegExp;
665
+ /** @deprecated Internal API, use with caution (not deprecated) */
666
+ isst: $ZodIssueInvalidType;
667
+ bag: LoosePartial<{
668
+ minimum: number;
669
+ maximum: number;
670
+ exclusiveMinimum: number;
671
+ exclusiveMaximum: number;
672
+ format: string;
673
+ pattern: RegExp;
674
+ }>;
675
+ }
676
+ interface $ZodNumber<Input = unknown> extends $ZodType {
677
+ _zod: $ZodNumberInternals<Input>;
678
+ }
679
+ declare const $ZodNumber: $constructor<$ZodNumber>;
680
+ interface $ZodBooleanDef extends $ZodTypeDef {
681
+ type: "boolean";
682
+ coerce?: boolean;
683
+ checks?: $ZodCheck<boolean>[];
684
+ }
685
+ interface $ZodBooleanInternals<T = unknown> extends $ZodTypeInternals<boolean, T> {
686
+ pattern: RegExp;
687
+ def: $ZodBooleanDef;
688
+ isst: $ZodIssueInvalidType;
689
+ }
690
+ interface $ZodBoolean<T = unknown> extends $ZodType {
691
+ _zod: $ZodBooleanInternals<T>;
692
+ }
693
+ declare const $ZodBoolean: $constructor<$ZodBoolean>;
694
+ interface $ZodBigIntDef extends $ZodTypeDef {
695
+ type: "bigint";
696
+ coerce?: boolean;
697
+ }
698
+ interface $ZodBigIntInternals<T = unknown> extends $ZodTypeInternals<bigint, T> {
699
+ pattern: RegExp;
700
+ /** @internal Internal API, use with caution */
701
+ def: $ZodBigIntDef;
702
+ isst: $ZodIssueInvalidType;
703
+ bag: LoosePartial<{
704
+ minimum: bigint;
705
+ maximum: bigint;
706
+ format: string;
707
+ }>;
708
+ }
709
+ interface $ZodBigInt<T = unknown> extends $ZodType {
710
+ _zod: $ZodBigIntInternals<T>;
711
+ }
712
+ declare const $ZodBigInt: $constructor<$ZodBigInt>;
713
+ interface $ZodSymbolDef extends $ZodTypeDef {
714
+ type: "symbol";
715
+ }
716
+ interface $ZodSymbolInternals extends $ZodTypeInternals<symbol, symbol> {
717
+ def: $ZodSymbolDef;
718
+ isst: $ZodIssueInvalidType;
719
+ }
720
+ interface $ZodSymbol extends $ZodType {
721
+ _zod: $ZodSymbolInternals;
722
+ }
723
+ declare const $ZodSymbol: $constructor<$ZodSymbol>;
724
+ interface $ZodUndefinedDef extends $ZodTypeDef {
725
+ type: "undefined";
726
+ }
727
+ interface $ZodUndefinedInternals extends $ZodTypeInternals<undefined, undefined> {
728
+ pattern: RegExp;
729
+ def: $ZodUndefinedDef;
730
+ values: PrimitiveSet;
731
+ isst: $ZodIssueInvalidType;
732
+ }
733
+ interface $ZodUndefined extends $ZodType {
734
+ _zod: $ZodUndefinedInternals;
735
+ }
736
+ declare const $ZodUndefined: $constructor<$ZodUndefined>;
737
+ interface $ZodNullDef extends $ZodTypeDef {
738
+ type: "null";
739
+ }
740
+ interface $ZodNullInternals extends $ZodTypeInternals<null, null> {
741
+ pattern: RegExp;
742
+ def: $ZodNullDef;
743
+ values: PrimitiveSet;
744
+ isst: $ZodIssueInvalidType;
745
+ }
746
+ interface $ZodNull extends $ZodType {
747
+ _zod: $ZodNullInternals;
748
+ }
749
+ declare const $ZodNull: $constructor<$ZodNull>;
750
+ interface $ZodAnyDef extends $ZodTypeDef {
751
+ type: "any";
752
+ }
753
+ interface $ZodAnyInternals extends $ZodTypeInternals<any, any> {
754
+ def: $ZodAnyDef;
755
+ isst: never;
756
+ }
757
+ interface $ZodAny extends $ZodType {
758
+ _zod: $ZodAnyInternals;
759
+ }
760
+ declare const $ZodAny: $constructor<$ZodAny>;
761
+ interface $ZodUnknownDef extends $ZodTypeDef {
762
+ type: "unknown";
763
+ }
764
+ interface $ZodUnknownInternals extends $ZodTypeInternals<unknown, unknown> {
765
+ def: $ZodUnknownDef;
766
+ isst: never;
767
+ }
768
+ interface $ZodUnknown extends $ZodType {
769
+ _zod: $ZodUnknownInternals;
770
+ }
771
+ declare const $ZodUnknown: $constructor<$ZodUnknown>;
772
+ interface $ZodNeverDef extends $ZodTypeDef {
773
+ type: "never";
774
+ }
775
+ interface $ZodNeverInternals extends $ZodTypeInternals<never, never> {
776
+ def: $ZodNeverDef;
777
+ isst: $ZodIssueInvalidType;
778
+ }
779
+ interface $ZodNever extends $ZodType {
780
+ _zod: $ZodNeverInternals;
781
+ }
782
+ declare const $ZodNever: $constructor<$ZodNever>;
783
+ interface $ZodVoidDef extends $ZodTypeDef {
784
+ type: "void";
785
+ }
786
+ interface $ZodVoidInternals extends $ZodTypeInternals<void, void> {
787
+ def: $ZodVoidDef;
788
+ isst: $ZodIssueInvalidType;
789
+ }
790
+ interface $ZodVoid extends $ZodType {
791
+ _zod: $ZodVoidInternals;
792
+ }
793
+ declare const $ZodVoid: $constructor<$ZodVoid>;
794
+ interface $ZodDateDef extends $ZodTypeDef {
795
+ type: "date";
796
+ coerce?: boolean;
797
+ }
798
+ interface $ZodDateInternals<T = unknown> extends $ZodTypeInternals<Date, T> {
799
+ def: $ZodDateDef;
800
+ isst: $ZodIssueInvalidType;
801
+ bag: LoosePartial<{
802
+ minimum: Date;
803
+ maximum: Date;
804
+ format: string;
805
+ }>;
806
+ }
807
+ interface $ZodDate<T = unknown> extends $ZodType {
808
+ _zod: $ZodDateInternals<T>;
809
+ }
810
+ declare const $ZodDate: $constructor<$ZodDate>;
811
+ interface $ZodArrayDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
812
+ type: "array";
813
+ element: T;
814
+ }
815
+ interface $ZodArrayInternals<T extends SomeType = $ZodType> extends _$ZodTypeInternals {
816
+ def: $ZodArrayDef<T>;
817
+ isst: $ZodIssueInvalidType;
818
+ output: output$1<T>[];
819
+ input: input$2<T>[];
820
+ }
821
+ interface $ZodArray<T extends SomeType = $ZodType> extends $ZodType<any, any, $ZodArrayInternals<T>> {}
822
+ declare const $ZodArray: $constructor<$ZodArray>;
823
+ type OptionalOutSchema = {
824
+ _zod: {
825
+ optout: "optional";
826
+ };
827
+ };
828
+ type OptionalInSchema = {
829
+ _zod: {
830
+ optin: "optional";
831
+ };
832
+ };
833
+ type $InferObjectOutput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? IsAny<T[keyof T]> extends true ? Record<string, unknown> : Record<string, output$1<T[keyof T]>> : keyof (T & Extra) extends never ? Record<string, never> : Prettify<{ -readonly [k in keyof T as T[k] extends OptionalOutSchema ? never : k]: T[k]["_zod"]["output"]; } & { -readonly [k in keyof T as T[k] extends OptionalOutSchema ? k : never]?: T[k]["_zod"]["output"]; } & Extra>;
834
+ type $InferObjectInput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? IsAny<T[keyof T]> extends true ? Record<string, unknown> : Record<string, input$2<T[keyof T]>> : keyof (T & Extra) extends never ? Record<string, never> : Prettify<{ -readonly [k in keyof T as T[k] extends OptionalInSchema ? never : k]: T[k]["_zod"]["input"]; } & { -readonly [k in keyof T as T[k] extends OptionalInSchema ? k : never]?: T[k]["_zod"]["input"]; } & Extra>;
835
+ type $ZodObjectConfig = {
836
+ out: Record<string, unknown>;
837
+ in: Record<string, unknown>;
838
+ };
839
+ type $loose = {
840
+ out: Record<string, unknown>;
841
+ in: Record<string, unknown>;
842
+ };
843
+ type $strict = {
844
+ out: {};
845
+ in: {};
846
+ };
847
+ type $strip = {
848
+ out: {};
849
+ in: {};
850
+ };
851
+ type $catchall<T extends SomeType> = {
852
+ out: {
853
+ [k: string]: output$1<T>;
854
+ };
855
+ in: {
856
+ [k: string]: input$2<T>;
857
+ };
858
+ };
859
+ type $ZodShape = Readonly<{
860
+ [k: string]: $ZodType;
861
+ }>;
862
+ interface $ZodObjectDef<Shape extends $ZodShape = $ZodShape> extends $ZodTypeDef {
863
+ type: "object";
864
+ shape: Shape;
865
+ catchall?: $ZodType | undefined;
866
+ }
867
+ interface $ZodObjectInternals<
868
+ /** @ts-ignore Cast variance */
869
+ out Shape extends $ZodShape = $ZodShape, out Config extends $ZodObjectConfig = $ZodObjectConfig> extends _$ZodTypeInternals {
870
+ def: $ZodObjectDef<Shape>;
871
+ config: Config;
872
+ isst: $ZodIssueInvalidType | $ZodIssueUnrecognizedKeys;
873
+ propValues: PropValues;
874
+ output: $InferObjectOutput<Shape, Config["out"]>;
875
+ input: $InferObjectInput<Shape, Config["in"]>;
876
+ optin?: "optional" | undefined;
877
+ optout?: "optional" | undefined;
878
+ }
879
+ type $ZodLooseShape = Record<string, any>;
880
+ interface $ZodObject<
881
+ /** @ts-ignore Cast variance */
882
+ out Shape extends Readonly<$ZodShape> = Readonly<$ZodShape>, out Params extends $ZodObjectConfig = $ZodObjectConfig> extends $ZodType<any, any, $ZodObjectInternals<Shape, Params>> {}
883
+ declare const $ZodObject: $constructor<$ZodObject>;
884
+ type $InferUnionOutput<T extends SomeType> = T extends any ? output$1<T> : never;
885
+ type $InferUnionInput<T extends SomeType> = T extends any ? input$2<T> : never;
886
+ interface $ZodUnionDef<Options extends readonly SomeType[] = readonly $ZodType[]> extends $ZodTypeDef {
887
+ type: "union";
888
+ options: Options;
889
+ inclusive?: boolean;
890
+ }
891
+ type IsOptionalIn<T extends SomeType> = T extends OptionalInSchema ? true : false;
892
+ type IsOptionalOut<T extends SomeType> = T extends OptionalOutSchema ? true : false;
893
+ interface $ZodUnionInternals<T extends readonly SomeType[] = readonly $ZodType[]> extends _$ZodTypeInternals {
894
+ def: $ZodUnionDef<T>;
895
+ isst: $ZodIssueInvalidUnion;
896
+ pattern: T[number]["_zod"]["pattern"];
897
+ values: T[number]["_zod"]["values"];
898
+ output: $InferUnionOutput<T[number]>;
899
+ input: $InferUnionInput<T[number]>;
900
+ optin: IsOptionalIn<T[number]> extends false ? "optional" | undefined : "optional";
901
+ optout: IsOptionalOut<T[number]> extends false ? "optional" | undefined : "optional";
902
+ }
903
+ interface $ZodUnion<T extends readonly SomeType[] = readonly $ZodType[]> extends $ZodType<any, any, $ZodUnionInternals<T>> {
904
+ _zod: $ZodUnionInternals<T>;
905
+ }
906
+ declare const $ZodUnion: $constructor<$ZodUnion>;
907
+ interface $ZodIntersectionDef<Left extends SomeType = $ZodType, Right extends SomeType = $ZodType> extends $ZodTypeDef {
908
+ type: "intersection";
909
+ left: Left;
910
+ right: Right;
911
+ }
912
+ interface $ZodIntersectionInternals<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _$ZodTypeInternals {
913
+ def: $ZodIntersectionDef<A, B>;
914
+ isst: never;
915
+ optin: A["_zod"]["optin"] | B["_zod"]["optin"];
916
+ optout: A["_zod"]["optout"] | B["_zod"]["optout"];
917
+ output: output$1<A> & output$1<B>;
918
+ input: input$2<A> & input$2<B>;
919
+ }
920
+ interface $ZodIntersection<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodType {
921
+ _zod: $ZodIntersectionInternals<A, B>;
922
+ }
923
+ declare const $ZodIntersection: $constructor<$ZodIntersection>;
924
+ interface $ZodTupleDef<T extends TupleItems = readonly $ZodType[], Rest extends SomeType | null = $ZodType | null> extends $ZodTypeDef {
925
+ type: "tuple";
926
+ items: T;
927
+ rest: Rest;
928
+ }
929
+ type $InferTupleInputType<T extends TupleItems, Rest extends SomeType | null> = [...TupleInputTypeWithOptionals<T>, ...(Rest extends SomeType ? input$2<Rest>[] : [])];
930
+ type TupleInputTypeNoOptionals<T extends TupleItems> = { [k in keyof T]: input$2<T[k]>; };
931
+ type TupleInputTypeWithOptionals<T extends TupleItems> = T extends readonly [...infer Prefix extends SomeType[], infer Tail extends SomeType] ? Tail["_zod"]["optin"] extends "optional" ? [...TupleInputTypeWithOptionals<Prefix>, input$2<Tail>?] : TupleInputTypeNoOptionals<T> : [];
932
+ type $InferTupleOutputType<T extends TupleItems, Rest extends SomeType | null> = [...TupleOutputTypeWithOptionals<T>, ...(Rest extends SomeType ? output$1<Rest>[] : [])];
933
+ type TupleOutputTypeNoOptionals<T extends TupleItems> = { [k in keyof T]: output$1<T[k]>; };
934
+ type TupleOutputTypeWithOptionals<T extends TupleItems> = T extends readonly [...infer Prefix extends SomeType[], infer Tail extends SomeType] ? Tail["_zod"]["optout"] extends "optional" ? [...TupleOutputTypeWithOptionals<Prefix>, output$1<Tail>?] : TupleOutputTypeNoOptionals<T> : [];
935
+ interface $ZodTupleInternals<T extends TupleItems = readonly $ZodType[], Rest extends SomeType | null = $ZodType | null> extends _$ZodTypeInternals {
936
+ def: $ZodTupleDef<T, Rest>;
937
+ isst: $ZodIssueInvalidType | $ZodIssueTooBig<unknown[]> | $ZodIssueTooSmall<unknown[]>;
938
+ output: $InferTupleOutputType<T, Rest>;
939
+ input: $InferTupleInputType<T, Rest>;
940
+ }
941
+ interface $ZodTuple<T extends TupleItems = readonly $ZodType[], Rest extends SomeType | null = $ZodType | null> extends $ZodType {
942
+ _zod: $ZodTupleInternals<T, Rest>;
943
+ }
944
+ declare const $ZodTuple: $constructor<$ZodTuple>;
945
+ type $ZodRecordKey = $ZodType<string | number | symbol, unknown>;
946
+ interface $ZodRecordDef<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodTypeDef {
947
+ type: "record";
948
+ keyType: Key;
949
+ valueType: Value;
950
+ /** @default "strict" - errors on keys not matching keyType. "loose" passes through non-matching keys unchanged. */
951
+ mode?: "strict" | "loose";
952
+ }
953
+ type $InferZodRecordOutput<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> = Key extends $partial ? Partial<Record<output$1<Key>, output$1<Value>>> : Record<output$1<Key>, output$1<Value>>;
954
+ type $InferZodRecordInput<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> = Key extends $partial ? Partial<Record<input$2<Key> & PropertyKey, input$2<Value>>> : Record<input$2<Key> & PropertyKey, input$2<Value>>;
955
+ interface $ZodRecordInternals<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodTypeInternals<$InferZodRecordOutput<Key, Value>, $InferZodRecordInput<Key, Value>> {
956
+ def: $ZodRecordDef<Key, Value>;
957
+ isst: $ZodIssueInvalidType | $ZodIssueInvalidKey<Record<PropertyKey, unknown>>;
958
+ optin?: "optional" | undefined;
959
+ optout?: "optional" | undefined;
960
+ }
961
+ type $partial = {
962
+ "~~partial": true;
963
+ };
964
+ interface $ZodRecord<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodType {
965
+ _zod: $ZodRecordInternals<Key, Value>;
966
+ }
967
+ declare const $ZodRecord: $constructor<$ZodRecord>;
968
+ interface $ZodMapDef<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends $ZodTypeDef {
969
+ type: "map";
970
+ keyType: Key;
971
+ valueType: Value;
972
+ }
973
+ interface $ZodMapInternals<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends $ZodTypeInternals<Map<output$1<Key>, output$1<Value>>, Map<input$2<Key>, input$2<Value>>> {
974
+ def: $ZodMapDef<Key, Value>;
975
+ isst: $ZodIssueInvalidType | $ZodIssueInvalidKey | $ZodIssueInvalidElement<unknown>;
976
+ optin?: "optional" | undefined;
977
+ optout?: "optional" | undefined;
978
+ }
979
+ interface $ZodMap<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends $ZodType {
980
+ _zod: $ZodMapInternals<Key, Value>;
981
+ }
982
+ declare const $ZodMap: $constructor<$ZodMap>;
983
+ interface $ZodSetDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
984
+ type: "set";
985
+ valueType: T;
986
+ }
987
+ interface $ZodSetInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<Set<output$1<T>>, Set<input$2<T>>> {
988
+ def: $ZodSetDef<T>;
989
+ isst: $ZodIssueInvalidType;
990
+ optin?: "optional" | undefined;
991
+ optout?: "optional" | undefined;
992
+ }
993
+ interface $ZodSet<T extends SomeType = $ZodType> extends $ZodType {
994
+ _zod: $ZodSetInternals<T>;
995
+ }
996
+ declare const $ZodSet: $constructor<$ZodSet>;
997
+ type $InferEnumOutput<T extends EnumLike> = T[keyof T] & {};
998
+ type $InferEnumInput<T extends EnumLike> = T[keyof T] & {};
999
+ interface $ZodEnumDef<T extends EnumLike = EnumLike> extends $ZodTypeDef {
1000
+ type: "enum";
1001
+ entries: T;
1002
+ }
1003
+ interface $ZodEnumInternals<
1004
+ /** @ts-ignore Cast variance */
1005
+ out T extends EnumLike = EnumLike> extends $ZodTypeInternals<$InferEnumOutput<T>, $InferEnumInput<T>> {
1006
+ def: $ZodEnumDef<T>;
1007
+ /** @deprecated Internal API, use with caution (not deprecated) */
1008
+ values: PrimitiveSet;
1009
+ /** @deprecated Internal API, use with caution (not deprecated) */
1010
+ pattern: RegExp;
1011
+ isst: $ZodIssueInvalidValue;
1012
+ }
1013
+ interface $ZodEnum<T extends EnumLike = EnumLike> extends $ZodType {
1014
+ _zod: $ZodEnumInternals<T>;
1015
+ }
1016
+ declare const $ZodEnum: $constructor<$ZodEnum>;
1017
+ interface $ZodLiteralDef<T extends Literal> extends $ZodTypeDef {
1018
+ type: "literal";
1019
+ values: T[];
1020
+ }
1021
+ interface $ZodLiteralInternals<T extends Literal = Literal> extends $ZodTypeInternals<T, T> {
1022
+ def: $ZodLiteralDef<T>;
1023
+ values: Set<T>;
1024
+ pattern: RegExp;
1025
+ isst: $ZodIssueInvalidValue;
1026
+ }
1027
+ interface $ZodLiteral<T extends Literal = Literal> extends $ZodType {
1028
+ _zod: $ZodLiteralInternals<T>;
1029
+ }
1030
+ declare const $ZodLiteral: $constructor<$ZodLiteral>;
1031
+ /** Do not reference this directly. */
1032
+ interface File extends _File {
1033
+ readonly type: string;
1034
+ readonly size: number;
1035
+ }
1036
+ interface $ZodFileDef extends $ZodTypeDef {
1037
+ type: "file";
1038
+ }
1039
+ interface $ZodFileInternals extends $ZodTypeInternals<File, File> {
1040
+ def: $ZodFileDef;
1041
+ isst: $ZodIssueInvalidType;
1042
+ bag: LoosePartial<{
1043
+ minimum: number;
1044
+ maximum: number;
1045
+ mime: MimeTypes[];
1046
+ }>;
1047
+ }
1048
+ interface $ZodFile extends $ZodType {
1049
+ _zod: $ZodFileInternals;
1050
+ }
1051
+ declare const $ZodFile: $constructor<$ZodFile>;
1052
+ interface $ZodTransformDef extends $ZodTypeDef {
1053
+ type: "transform";
1054
+ transform: (input: unknown, payload: ParsePayload<unknown>) => MaybeAsync<unknown>;
1055
+ }
1056
+ interface $ZodTransformInternals<O = unknown, I = unknown> extends $ZodTypeInternals<O, I> {
1057
+ def: $ZodTransformDef;
1058
+ isst: never;
1059
+ }
1060
+ interface $ZodTransform<O = unknown, I = unknown> extends $ZodType {
1061
+ _zod: $ZodTransformInternals<O, I>;
1062
+ }
1063
+ declare const $ZodTransform: $constructor<$ZodTransform>;
1064
+ interface $ZodOptionalDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1065
+ type: "optional";
1066
+ innerType: T;
1067
+ }
1068
+ interface $ZodOptionalInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output$1<T> | undefined, input$2<T> | undefined> {
1069
+ def: $ZodOptionalDef<T>;
1070
+ optin: "optional";
1071
+ optout: "optional";
1072
+ isst: never;
1073
+ values: T["_zod"]["values"];
1074
+ pattern: T["_zod"]["pattern"];
1075
+ }
1076
+ interface $ZodOptional<T extends SomeType = $ZodType> extends $ZodType {
1077
+ _zod: $ZodOptionalInternals<T>;
1078
+ }
1079
+ declare const $ZodOptional: $constructor<$ZodOptional>;
1080
+ interface $ZodExactOptionalDef<T extends SomeType = $ZodType> extends $ZodOptionalDef<T> {}
1081
+ interface $ZodExactOptionalInternals<T extends SomeType = $ZodType> extends $ZodOptionalInternals<T> {
1082
+ def: $ZodExactOptionalDef<T>;
1083
+ output: output$1<T>;
1084
+ input: input$2<T>;
1085
+ }
1086
+ interface $ZodExactOptional<T extends SomeType = $ZodType> extends $ZodType {
1087
+ _zod: $ZodExactOptionalInternals<T>;
1088
+ }
1089
+ declare const $ZodExactOptional: $constructor<$ZodExactOptional>;
1090
+ interface $ZodNullableDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1091
+ type: "nullable";
1092
+ innerType: T;
1093
+ }
1094
+ interface $ZodNullableInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output$1<T> | null, input$2<T> | null> {
1095
+ def: $ZodNullableDef<T>;
1096
+ optin: T["_zod"]["optin"];
1097
+ optout: T["_zod"]["optout"];
1098
+ isst: never;
1099
+ values: T["_zod"]["values"];
1100
+ pattern: T["_zod"]["pattern"];
1101
+ }
1102
+ interface $ZodNullable<T extends SomeType = $ZodType> extends $ZodType {
1103
+ _zod: $ZodNullableInternals<T>;
1104
+ }
1105
+ declare const $ZodNullable: $constructor<$ZodNullable>;
1106
+ interface $ZodDefaultDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1107
+ type: "default";
1108
+ innerType: T;
1109
+ /** The default value. May be a getter. */
1110
+ defaultValue: NoUndefined<output$1<T>>;
1111
+ }
1112
+ interface $ZodDefaultInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output$1<T>>, input$2<T> | undefined> {
1113
+ def: $ZodDefaultDef<T>;
1114
+ optin: "optional";
1115
+ optout?: "optional" | undefined;
1116
+ isst: never;
1117
+ values: T["_zod"]["values"];
1118
+ }
1119
+ interface $ZodDefault<T extends SomeType = $ZodType> extends $ZodType {
1120
+ _zod: $ZodDefaultInternals<T>;
1121
+ }
1122
+ declare const $ZodDefault: $constructor<$ZodDefault>;
1123
+ interface $ZodPrefaultDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1124
+ type: "prefault";
1125
+ innerType: T;
1126
+ /** The default value. May be a getter. */
1127
+ defaultValue: input$2<T>;
1128
+ }
1129
+ interface $ZodPrefaultInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output$1<T>>, input$2<T> | undefined> {
1130
+ def: $ZodPrefaultDef<T>;
1131
+ optin: "optional";
1132
+ optout?: "optional" | undefined;
1133
+ isst: never;
1134
+ values: T["_zod"]["values"];
1135
+ }
1136
+ interface $ZodPrefault<T extends SomeType = $ZodType> extends $ZodType {
1137
+ _zod: $ZodPrefaultInternals<T>;
1138
+ }
1139
+ declare const $ZodPrefault: $constructor<$ZodPrefault>;
1140
+ interface $ZodNonOptionalDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1141
+ type: "nonoptional";
1142
+ innerType: T;
1143
+ }
1144
+ interface $ZodNonOptionalInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output$1<T>>, NoUndefined<input$2<T>>> {
1145
+ def: $ZodNonOptionalDef<T>;
1146
+ isst: $ZodIssueInvalidType;
1147
+ values: T["_zod"]["values"];
1148
+ optin: "optional" | undefined;
1149
+ optout: "optional" | undefined;
1150
+ }
1151
+ interface $ZodNonOptional<T extends SomeType = $ZodType> extends $ZodType {
1152
+ _zod: $ZodNonOptionalInternals<T>;
1153
+ }
1154
+ declare const $ZodNonOptional: $constructor<$ZodNonOptional>;
1155
+ interface $ZodSuccessDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1156
+ type: "success";
1157
+ innerType: T;
1158
+ }
1159
+ interface $ZodSuccessInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<boolean, input$2<T>> {
1160
+ def: $ZodSuccessDef<T>;
1161
+ isst: never;
1162
+ optin: T["_zod"]["optin"];
1163
+ optout: "optional" | undefined;
1164
+ }
1165
+ interface $ZodSuccess<T extends SomeType = $ZodType> extends $ZodType {
1166
+ _zod: $ZodSuccessInternals<T>;
1167
+ }
1168
+ declare const $ZodSuccess: $constructor<$ZodSuccess>;
1169
+ interface $ZodCatchCtx extends ParsePayload {
1170
+ /** @deprecated Use `ctx.issues` */
1171
+ error: {
1172
+ issues: $ZodIssue[];
1173
+ };
1174
+ /** @deprecated Use `ctx.value` */
1175
+ input: unknown;
1176
+ }
1177
+ interface $ZodCatchDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1178
+ type: "catch";
1179
+ innerType: T;
1180
+ catchValue: (ctx: $ZodCatchCtx) => unknown;
1181
+ }
1182
+ interface $ZodCatchInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output$1<T>, input$2<T>> {
1183
+ def: $ZodCatchDef<T>;
1184
+ optin: T["_zod"]["optin"];
1185
+ optout: T["_zod"]["optout"];
1186
+ isst: never;
1187
+ values: T["_zod"]["values"];
1188
+ }
1189
+ interface $ZodCatch<T extends SomeType = $ZodType> extends $ZodType {
1190
+ _zod: $ZodCatchInternals<T>;
1191
+ }
1192
+ declare const $ZodCatch: $constructor<$ZodCatch>;
1193
+ interface $ZodNaNDef extends $ZodTypeDef {
1194
+ type: "nan";
1195
+ }
1196
+ interface $ZodNaNInternals extends $ZodTypeInternals<number, number> {
1197
+ def: $ZodNaNDef;
1198
+ isst: $ZodIssueInvalidType;
1199
+ }
1200
+ interface $ZodNaN extends $ZodType {
1201
+ _zod: $ZodNaNInternals;
1202
+ }
1203
+ declare const $ZodNaN: $constructor<$ZodNaN>;
1204
+ interface $ZodPipeDef<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodTypeDef {
1205
+ type: "pipe";
1206
+ in: A;
1207
+ out: B;
1208
+ /** Only defined inside $ZodCodec instances. */
1209
+ transform?: (value: output$1<A>, payload: ParsePayload<output$1<A>>) => MaybeAsync<input$2<B>>;
1210
+ /** Only defined inside $ZodCodec instances. */
1211
+ reverseTransform?: (value: input$2<B>, payload: ParsePayload<input$2<B>>) => MaybeAsync<output$1<A>>;
1212
+ }
1213
+ interface $ZodPipeInternals<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodTypeInternals<output$1<B>, input$2<A>> {
1214
+ def: $ZodPipeDef<A, B>;
1215
+ isst: never;
1216
+ values: A["_zod"]["values"];
1217
+ optin: A["_zod"]["optin"];
1218
+ optout: B["_zod"]["optout"];
1219
+ propValues: A["_zod"]["propValues"];
1220
+ }
1221
+ interface $ZodPipe<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodType {
1222
+ _zod: $ZodPipeInternals<A, B>;
1223
+ }
1224
+ declare const $ZodPipe: $constructor<$ZodPipe>;
1225
+ interface $ZodReadonlyDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1226
+ type: "readonly";
1227
+ innerType: T;
1228
+ }
1229
+ interface $ZodReadonlyInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<MakeReadonly$1<output$1<T>>, MakeReadonly$1<input$2<T>>> {
1230
+ def: $ZodReadonlyDef<T>;
1231
+ optin: T["_zod"]["optin"];
1232
+ optout: T["_zod"]["optout"];
1233
+ isst: never;
1234
+ propValues: T["_zod"]["propValues"];
1235
+ values: T["_zod"]["values"];
1236
+ }
1237
+ interface $ZodReadonly<T extends SomeType = $ZodType> extends $ZodType {
1238
+ _zod: $ZodReadonlyInternals<T>;
1239
+ }
1240
+ declare const $ZodReadonly: $constructor<$ZodReadonly>;
1241
+ interface $ZodTemplateLiteralDef extends $ZodTypeDef {
1242
+ type: "template_literal";
1243
+ parts: $ZodTemplateLiteralPart[];
1244
+ format?: string | undefined;
1245
+ }
1246
+ interface $ZodTemplateLiteralInternals<Template extends string = string> extends $ZodTypeInternals<Template, Template> {
1247
+ pattern: RegExp;
1248
+ def: $ZodTemplateLiteralDef;
1249
+ isst: $ZodIssueInvalidType;
1250
+ }
1251
+ interface $ZodTemplateLiteral<Template extends string = string> extends $ZodType {
1252
+ _zod: $ZodTemplateLiteralInternals<Template>;
1253
+ }
1254
+ type LiteralPart = Exclude<Literal, symbol>;
1255
+ interface SchemaPartInternals extends $ZodTypeInternals<LiteralPart, LiteralPart> {
1256
+ pattern: RegExp;
1257
+ }
1258
+ interface SchemaPart extends $ZodType {
1259
+ _zod: SchemaPartInternals;
1260
+ }
1261
+ type $ZodTemplateLiteralPart = LiteralPart | SchemaPart;
1262
+ declare const $ZodTemplateLiteral: $constructor<$ZodTemplateLiteral>;
1263
+ type $ZodFunctionArgs = $ZodType<unknown[], unknown[]>;
1264
+ type $ZodFunctionIn = $ZodFunctionArgs;
1265
+ type $ZodFunctionOut = $ZodType;
1266
+ type $InferInnerFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : output$1<Args>) => input$2<Returns>;
1267
+ type $InferInnerFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : output$1<Args>) => MaybeAsync<input$2<Returns>>;
1268
+ type $InferOuterFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : input$2<Args>) => output$1<Returns>;
1269
+ type $InferOuterFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : input$2<Args>) => Promise<output$1<Returns>>;
1270
+ interface $ZodFunctionDef<In extends $ZodFunctionIn = $ZodFunctionIn, Out extends $ZodFunctionOut = $ZodFunctionOut> extends $ZodTypeDef {
1271
+ type: "function";
1272
+ input: In;
1273
+ output: Out;
1274
+ }
1275
+ interface $ZodFunctionInternals<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> extends $ZodTypeInternals<$InferOuterFunctionType<Args, Returns>, $InferInnerFunctionType<Args, Returns>> {
1276
+ def: $ZodFunctionDef<Args, Returns>;
1277
+ isst: $ZodIssueInvalidType;
1278
+ }
1279
+ interface $ZodFunction<Args extends $ZodFunctionIn = $ZodFunctionIn, Returns extends $ZodFunctionOut = $ZodFunctionOut> extends $ZodType<any, any, $ZodFunctionInternals<Args, Returns>> {
1280
+ /** @deprecated */
1281
+ _def: $ZodFunctionDef<Args, Returns>;
1282
+ _input: $InferInnerFunctionType<Args, Returns>;
1283
+ _output: $InferOuterFunctionType<Args, Returns>;
1284
+ implement<F extends $InferInnerFunctionType<Args, Returns>>(func: F): (...args: Parameters<this["_output"]>) => ReturnType<F> extends ReturnType<this["_output"]> ? ReturnType<F> : ReturnType<this["_output"]>;
1285
+ implementAsync<F extends $InferInnerFunctionTypeAsync<Args, Returns>>(func: F): F extends $InferOuterFunctionTypeAsync<Args, Returns> ? F : $InferOuterFunctionTypeAsync<Args, Returns>;
1286
+ input<const Items extends TupleItems, const Rest extends $ZodFunctionOut = $ZodFunctionOut>(args: Items, rest?: Rest): $ZodFunction<$ZodTuple<Items, Rest>, Returns>;
1287
+ input<NewArgs extends $ZodFunctionIn>(args: NewArgs): $ZodFunction<NewArgs, Returns>;
1288
+ input(...args: any[]): $ZodFunction<any, Returns>;
1289
+ output<NewReturns extends $ZodType>(output: NewReturns): $ZodFunction<Args, NewReturns>;
1290
+ }
1291
+ declare const $ZodFunction: $constructor<$ZodFunction>;
1292
+ interface $ZodPromiseDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1293
+ type: "promise";
1294
+ innerType: T;
1295
+ }
1296
+ interface $ZodPromiseInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<Promise<output$1<T>>, MaybeAsync<input$2<T>>> {
1297
+ def: $ZodPromiseDef<T>;
1298
+ isst: never;
1299
+ }
1300
+ interface $ZodPromise<T extends SomeType = $ZodType> extends $ZodType {
1301
+ _zod: $ZodPromiseInternals<T>;
1302
+ }
1303
+ declare const $ZodPromise: $constructor<$ZodPromise>;
1304
+ interface $ZodLazyDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1305
+ type: "lazy";
1306
+ getter: () => T;
1307
+ }
1308
+ interface $ZodLazyInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output$1<T>, input$2<T>> {
1309
+ def: $ZodLazyDef<T>;
1310
+ isst: never;
1311
+ /** Auto-cached way to retrieve the inner schema */
1312
+ innerType: T;
1313
+ pattern: T["_zod"]["pattern"];
1314
+ propValues: T["_zod"]["propValues"];
1315
+ optin: T["_zod"]["optin"];
1316
+ optout: T["_zod"]["optout"];
1317
+ }
1318
+ interface $ZodLazy<T extends SomeType = $ZodType> extends $ZodType {
1319
+ _zod: $ZodLazyInternals<T>;
1320
+ }
1321
+ declare const $ZodLazy: $constructor<$ZodLazy>;
1322
+ interface $ZodCustomDef<O = unknown> extends $ZodTypeDef, $ZodCheckDef {
1323
+ type: "custom";
1324
+ check: "custom";
1325
+ path?: PropertyKey[] | undefined;
1326
+ error?: $ZodErrorMap | undefined;
1327
+ params?: Record<string, any> | undefined;
1328
+ fn: (arg: O) => unknown;
1329
+ }
1330
+ interface $ZodCustomInternals<O = unknown, I = unknown> extends $ZodTypeInternals<O, I>, $ZodCheckInternals<O> {
1331
+ def: $ZodCustomDef;
1332
+ issc: $ZodIssue;
1333
+ isst: never;
1334
+ bag: LoosePartial<{
1335
+ Class: typeof Class;
1336
+ }>;
1337
+ }
1338
+ interface $ZodCustom<O = unknown, I = unknown> extends $ZodType {
1339
+ _zod: $ZodCustomInternals<O, I>;
1340
+ }
1341
+ declare const $ZodCustom: $constructor<$ZodCustom>;
1342
+ type $ZodTypes = $ZodString | $ZodNumber | $ZodBigInt | $ZodBoolean | $ZodDate | $ZodSymbol | $ZodUndefined | $ZodNullable | $ZodNull | $ZodAny | $ZodUnknown | $ZodNever | $ZodVoid | $ZodArray | $ZodObject | $ZodUnion | $ZodIntersection | $ZodTuple | $ZodRecord | $ZodMap | $ZodSet | $ZodLiteral | $ZodEnum | $ZodFunction | $ZodPromise | $ZodLazy | $ZodOptional | $ZodDefault | $ZodPrefault | $ZodTemplateLiteral | $ZodCustom | $ZodTransform | $ZodNonOptional | $ZodReadonly | $ZodNaN | $ZodPipe | $ZodSuccess | $ZodCatch | $ZodFile;
1343
+ //#endregion
1344
+ //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/checks.d.cts
1345
+ interface $ZodCheckDef {
1346
+ check: string;
1347
+ error?: $ZodErrorMap<never> | undefined;
1348
+ /** If true, no later checks will be executed if this check fails. Default `false`. */
1349
+ abort?: boolean | undefined;
1350
+ /** If provided, the check runs only when this returns `true`. By default, it is skipped if prior parsing produced aborting issues. */
1351
+ when?: ((payload: ParsePayload) => boolean) | undefined;
1352
+ }
1353
+ interface $ZodCheckInternals<T> {
1354
+ def: $ZodCheckDef;
1355
+ /** The set of issues this check might throw. */
1356
+ issc?: $ZodIssueBase;
1357
+ check(payload: ParsePayload<T>): MaybeAsync<void>;
1358
+ onattach: ((schema: $ZodType) => void)[];
1359
+ }
1360
+ interface $ZodCheck<in T = never> {
1361
+ _zod: $ZodCheckInternals<T>;
1362
+ }
1363
+ declare const $ZodCheck: $constructor<$ZodCheck<any>>;
1364
+ interface $ZodCheckLessThanDef extends $ZodCheckDef {
1365
+ check: "less_than";
1366
+ value: Numeric;
1367
+ inclusive: boolean;
1368
+ }
1369
+ interface $ZodCheckLessThanInternals<T extends Numeric = Numeric> extends $ZodCheckInternals<T> {
1370
+ def: $ZodCheckLessThanDef;
1371
+ issc: $ZodIssueTooBig<T>;
1372
+ }
1373
+ interface $ZodCheckLessThan<T extends Numeric = Numeric> extends $ZodCheck<T> {
1374
+ _zod: $ZodCheckLessThanInternals<T>;
1375
+ }
1376
+ declare const $ZodCheckLessThan: $constructor<$ZodCheckLessThan>;
1377
+ interface $ZodCheckGreaterThanDef extends $ZodCheckDef {
1378
+ check: "greater_than";
1379
+ value: Numeric;
1380
+ inclusive: boolean;
1381
+ }
1382
+ interface $ZodCheckGreaterThanInternals<T extends Numeric = Numeric> extends $ZodCheckInternals<T> {
1383
+ def: $ZodCheckGreaterThanDef;
1384
+ issc: $ZodIssueTooSmall<T>;
1385
+ }
1386
+ interface $ZodCheckGreaterThan<T extends Numeric = Numeric> extends $ZodCheck<T> {
1387
+ _zod: $ZodCheckGreaterThanInternals<T>;
1388
+ }
1389
+ declare const $ZodCheckGreaterThan: $constructor<$ZodCheckGreaterThan>;
1390
+ interface $ZodCheckMultipleOfDef<T extends number | bigint = number | bigint> extends $ZodCheckDef {
1391
+ check: "multiple_of";
1392
+ value: T;
1393
+ }
1394
+ interface $ZodCheckMultipleOfInternals<T extends number | bigint = number | bigint> extends $ZodCheckInternals<T> {
1395
+ def: $ZodCheckMultipleOfDef<T>;
1396
+ issc: $ZodIssueNotMultipleOf;
1397
+ }
1398
+ interface $ZodCheckMultipleOf<T extends number | bigint = number | bigint> extends $ZodCheck<T> {
1399
+ _zod: $ZodCheckMultipleOfInternals<T>;
1400
+ }
1401
+ declare const $ZodCheckMultipleOf: $constructor<$ZodCheckMultipleOf<number | bigint>>;
1402
+ type $ZodNumberFormats = "int32" | "uint32" | "float32" | "float64" | "safeint";
1403
+ interface $ZodCheckNumberFormatDef extends $ZodCheckDef {
1404
+ check: "number_format";
1405
+ format: $ZodNumberFormats;
1406
+ }
1407
+ interface $ZodCheckNumberFormatInternals extends $ZodCheckInternals<number> {
1408
+ def: $ZodCheckNumberFormatDef;
1409
+ issc: $ZodIssueInvalidType | $ZodIssueTooBig<"number"> | $ZodIssueTooSmall<"number">;
1410
+ }
1411
+ interface $ZodCheckNumberFormat extends $ZodCheck<number> {
1412
+ _zod: $ZodCheckNumberFormatInternals;
1413
+ }
1414
+ declare const $ZodCheckNumberFormat: $constructor<$ZodCheckNumberFormat>;
1415
+ interface $ZodCheckMaxLengthDef extends $ZodCheckDef {
1416
+ check: "max_length";
1417
+ maximum: number;
1418
+ }
1419
+ interface $ZodCheckMaxLengthInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
1420
+ def: $ZodCheckMaxLengthDef;
1421
+ issc: $ZodIssueTooBig<T>;
1422
+ }
1423
+ interface $ZodCheckMaxLength<T extends HasLength = HasLength> extends $ZodCheck<T> {
1424
+ _zod: $ZodCheckMaxLengthInternals<T>;
1425
+ }
1426
+ declare const $ZodCheckMaxLength: $constructor<$ZodCheckMaxLength>;
1427
+ interface $ZodCheckMinLengthDef extends $ZodCheckDef {
1428
+ check: "min_length";
1429
+ minimum: number;
1430
+ }
1431
+ interface $ZodCheckMinLengthInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
1432
+ def: $ZodCheckMinLengthDef;
1433
+ issc: $ZodIssueTooSmall<T>;
1434
+ }
1435
+ interface $ZodCheckMinLength<T extends HasLength = HasLength> extends $ZodCheck<T> {
1436
+ _zod: $ZodCheckMinLengthInternals<T>;
1437
+ }
1438
+ declare const $ZodCheckMinLength: $constructor<$ZodCheckMinLength>;
1439
+ interface $ZodCheckLengthEqualsDef extends $ZodCheckDef {
1440
+ check: "length_equals";
1441
+ length: number;
1442
+ }
1443
+ interface $ZodCheckLengthEqualsInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
1444
+ def: $ZodCheckLengthEqualsDef;
1445
+ issc: $ZodIssueTooBig<T> | $ZodIssueTooSmall<T>;
1446
+ }
1447
+ interface $ZodCheckLengthEquals<T extends HasLength = HasLength> extends $ZodCheck<T> {
1448
+ _zod: $ZodCheckLengthEqualsInternals<T>;
1449
+ }
1450
+ declare const $ZodCheckLengthEquals: $constructor<$ZodCheckLengthEquals>;
1451
+ 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";
1452
+ interface $ZodCheckStringFormatDef<Format extends string = string> extends $ZodCheckDef {
1453
+ check: "string_format";
1454
+ format: Format;
1455
+ pattern?: RegExp | undefined;
1456
+ }
1457
+ interface $ZodCheckStringFormatInternals extends $ZodCheckInternals<string> {
1458
+ def: $ZodCheckStringFormatDef;
1459
+ issc: $ZodIssueInvalidStringFormat;
1460
+ }
1461
+ interface $ZodCheckRegexDef extends $ZodCheckStringFormatDef {
1462
+ format: "regex";
1463
+ pattern: RegExp;
1464
+ }
1465
+ interface $ZodCheckRegexInternals extends $ZodCheckInternals<string> {
1466
+ def: $ZodCheckRegexDef;
1467
+ issc: $ZodIssueInvalidStringFormat;
1468
+ }
1469
+ interface $ZodCheckRegex extends $ZodCheck<string> {
1470
+ _zod: $ZodCheckRegexInternals;
1471
+ }
1472
+ declare const $ZodCheckRegex: $constructor<$ZodCheckRegex>;
1473
+ interface $ZodCheckLowerCaseDef extends $ZodCheckStringFormatDef<"lowercase"> {}
1474
+ interface $ZodCheckLowerCaseInternals extends $ZodCheckInternals<string> {
1475
+ def: $ZodCheckLowerCaseDef;
1476
+ issc: $ZodIssueInvalidStringFormat;
1477
+ }
1478
+ interface $ZodCheckLowerCase extends $ZodCheck<string> {
1479
+ _zod: $ZodCheckLowerCaseInternals;
1480
+ }
1481
+ declare const $ZodCheckLowerCase: $constructor<$ZodCheckLowerCase>;
1482
+ interface $ZodCheckUpperCaseDef extends $ZodCheckStringFormatDef<"uppercase"> {}
1483
+ interface $ZodCheckUpperCaseInternals extends $ZodCheckInternals<string> {
1484
+ def: $ZodCheckUpperCaseDef;
1485
+ issc: $ZodIssueInvalidStringFormat;
1486
+ }
1487
+ interface $ZodCheckUpperCase extends $ZodCheck<string> {
1488
+ _zod: $ZodCheckUpperCaseInternals;
1489
+ }
1490
+ declare const $ZodCheckUpperCase: $constructor<$ZodCheckUpperCase>;
1491
+ interface $ZodCheckIncludesDef extends $ZodCheckStringFormatDef<"includes"> {
1492
+ includes: string;
1493
+ position?: number | undefined;
1494
+ }
1495
+ interface $ZodCheckIncludesInternals extends $ZodCheckInternals<string> {
1496
+ def: $ZodCheckIncludesDef;
1497
+ issc: $ZodIssueInvalidStringFormat;
1498
+ }
1499
+ interface $ZodCheckIncludes extends $ZodCheck<string> {
1500
+ _zod: $ZodCheckIncludesInternals;
1501
+ }
1502
+ declare const $ZodCheckIncludes: $constructor<$ZodCheckIncludes>;
1503
+ interface $ZodCheckStartsWithDef extends $ZodCheckStringFormatDef<"starts_with"> {
1504
+ prefix: string;
1505
+ }
1506
+ interface $ZodCheckStartsWithInternals extends $ZodCheckInternals<string> {
1507
+ def: $ZodCheckStartsWithDef;
1508
+ issc: $ZodIssueInvalidStringFormat;
1509
+ }
1510
+ interface $ZodCheckStartsWith extends $ZodCheck<string> {
1511
+ _zod: $ZodCheckStartsWithInternals;
1512
+ }
1513
+ declare const $ZodCheckStartsWith: $constructor<$ZodCheckStartsWith>;
1514
+ interface $ZodCheckEndsWithDef extends $ZodCheckStringFormatDef<"ends_with"> {
1515
+ suffix: string;
1516
+ }
1517
+ interface $ZodCheckEndsWithInternals extends $ZodCheckInternals<string> {
1518
+ def: $ZodCheckEndsWithDef;
1519
+ issc: $ZodIssueInvalidStringFormat;
1520
+ }
1521
+ interface $ZodCheckEndsWith extends $ZodCheckInternals<string> {
1522
+ _zod: $ZodCheckEndsWithInternals;
1523
+ }
1524
+ declare const $ZodCheckEndsWith: $constructor<$ZodCheckEndsWith>;
1525
+ //#endregion
1526
+ //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.d.cts
1527
+ interface $ZodIssueBase {
1528
+ readonly code?: string;
1529
+ readonly input?: unknown;
1530
+ readonly path: PropertyKey[];
1531
+ readonly message: string;
1532
+ }
1533
+ type $ZodInvalidTypeExpected = "string" | "number" | "int" | "boolean" | "bigint" | "symbol" | "undefined" | "null" | "never" | "void" | "date" | "array" | "object" | "tuple" | "record" | "map" | "set" | "file" | "nonoptional" | "nan" | "function" | (string & {});
1534
+ interface $ZodIssueInvalidType<Input = unknown> extends $ZodIssueBase {
1535
+ readonly code: "invalid_type";
1536
+ readonly expected: $ZodInvalidTypeExpected;
1537
+ readonly input?: Input;
1538
+ }
1539
+ interface $ZodIssueTooBig<Input = unknown> extends $ZodIssueBase {
1540
+ readonly code: "too_big";
1541
+ readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
1542
+ readonly maximum: number | bigint;
1543
+ readonly inclusive?: boolean;
1544
+ readonly exact?: boolean;
1545
+ readonly input?: Input;
1546
+ }
1547
+ interface $ZodIssueTooSmall<Input = unknown> extends $ZodIssueBase {
1548
+ readonly code: "too_small";
1549
+ readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
1550
+ readonly minimum: number | bigint;
1551
+ /** True if the allowable range includes the minimum */
1552
+ readonly inclusive?: boolean;
1553
+ /** True if the allowed value is fixed (e.g.` z.length(5)`), not a range (`z.minLength(5)`) */
1554
+ readonly exact?: boolean;
1555
+ readonly input?: Input;
1556
+ }
1557
+ interface $ZodIssueInvalidStringFormat extends $ZodIssueBase {
1558
+ readonly code: "invalid_format";
1559
+ readonly format: $ZodStringFormats | (string & {});
1560
+ readonly pattern?: string;
1561
+ readonly input?: string;
1562
+ }
1563
+ interface $ZodIssueNotMultipleOf<Input extends number | bigint = number | bigint> extends $ZodIssueBase {
1564
+ readonly code: "not_multiple_of";
1565
+ readonly divisor: number;
1566
+ readonly input?: Input;
1567
+ }
1568
+ interface $ZodIssueUnrecognizedKeys extends $ZodIssueBase {
1569
+ readonly code: "unrecognized_keys";
1570
+ readonly keys: string[];
1571
+ readonly input?: Record<string, unknown>;
1572
+ }
1573
+ interface $ZodIssueInvalidUnionNoMatch extends $ZodIssueBase {
1574
+ readonly code: "invalid_union";
1575
+ readonly errors: $ZodIssue[][];
1576
+ readonly input?: unknown;
1577
+ readonly discriminator?: string | undefined;
1578
+ readonly options?: Primitive$1[];
1579
+ readonly inclusive?: true;
1580
+ }
1581
+ interface $ZodIssueInvalidUnionMultipleMatch extends $ZodIssueBase {
1582
+ readonly code: "invalid_union";
1583
+ readonly errors: [];
1584
+ readonly input?: unknown;
1585
+ readonly discriminator?: string | undefined;
1586
+ readonly inclusive: false;
1587
+ }
1588
+ type $ZodIssueInvalidUnion = $ZodIssueInvalidUnionNoMatch | $ZodIssueInvalidUnionMultipleMatch;
1589
+ interface $ZodIssueInvalidKey<Input = unknown> extends $ZodIssueBase {
1590
+ readonly code: "invalid_key";
1591
+ readonly origin: "map" | "record";
1592
+ readonly issues: $ZodIssue[];
1593
+ readonly input?: Input;
1594
+ }
1595
+ interface $ZodIssueInvalidElement<Input = unknown> extends $ZodIssueBase {
1596
+ readonly code: "invalid_element";
1597
+ readonly origin: "map" | "set";
1598
+ readonly key: unknown;
1599
+ readonly issues: $ZodIssue[];
1600
+ readonly input?: Input;
1601
+ }
1602
+ interface $ZodIssueInvalidValue<Input = unknown> extends $ZodIssueBase {
1603
+ readonly code: "invalid_value";
1604
+ readonly values: Primitive$1[];
1605
+ readonly input?: Input;
1606
+ }
1607
+ interface $ZodIssueCustom extends $ZodIssueBase {
1608
+ readonly code: "custom";
1609
+ readonly params?: Record<string, any> | undefined;
1610
+ readonly input?: unknown;
1611
+ }
1612
+ type $ZodIssue = $ZodIssueInvalidType | $ZodIssueTooBig | $ZodIssueTooSmall | $ZodIssueInvalidStringFormat | $ZodIssueNotMultipleOf | $ZodIssueUnrecognizedKeys | $ZodIssueInvalidUnion | $ZodIssueInvalidKey | $ZodIssueInvalidElement | $ZodIssueInvalidValue | $ZodIssueCustom;
1613
+ type $ZodInternalIssue<T extends $ZodIssueBase = $ZodIssue> = T extends any ? RawIssue$1<T> : never;
1614
+ type RawIssue$1<T extends $ZodIssueBase> = T extends any ? Flatten<MakePartial<T, "message" | "path"> & {
1615
+ /** The input data */
1616
+ readonly input: unknown;
1617
+ /** The schema or check that originated this issue. */
1618
+ readonly inst?: $ZodType | $ZodCheck;
1619
+ /** If `true`, Zod will continue executing checks/refinements after this issue. */
1620
+ readonly continue?: boolean | undefined;
1621
+ } & Record<string, unknown>> : never;
1622
+ type $ZodRawIssue<T extends $ZodIssueBase = $ZodIssue> = $ZodInternalIssue<T>;
1623
+ interface $ZodErrorMap<T extends $ZodIssueBase = $ZodIssue> {
1624
+ (issue: $ZodRawIssue<T>): {
1625
+ message: string;
1626
+ } | string | undefined | null;
1627
+ }
1628
+ interface $ZodError<T = unknown> extends Error {
1629
+ type: T;
1630
+ issues: $ZodIssue[];
1631
+ _zod: {
1632
+ output: T;
1633
+ def: $ZodIssue[];
1634
+ };
1635
+ stack?: string;
1636
+ name: string;
1637
+ }
1638
+ declare const $ZodError: $constructor<$ZodError>;
1639
+ type $ZodFlattenedError<T, U = string> = _FlattenedError<T, U>;
1640
+ type _FlattenedError<T, U = string> = {
1641
+ formErrors: U[];
1642
+ fieldErrors: { [P in keyof T]?: U[]; };
1643
+ };
1644
+ type _ZodFormattedError<T, U = string> = T extends [any, ...any[]] ? { [K in keyof T]?: $ZodFormattedError<T[K], U>; } : T extends any[] ? {
1645
+ [k: number]: $ZodFormattedError<T[number], U>;
1646
+ } : T extends object ? Flatten<{ [K in keyof T]?: $ZodFormattedError<T[K], U>; }> : any;
1647
+ type $ZodFormattedError<T, U = string> = {
1648
+ _errors: U[];
1649
+ } & Flatten<_ZodFormattedError<T, U>>;
1650
+ //#endregion
1651
+ //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.d.cts
1652
+ type ZodTrait = {
1653
+ _zod: {
1654
+ def: any;
1655
+ [k: string]: any;
1656
+ };
1657
+ };
1658
+ interface $constructor<T extends ZodTrait, D = T["_zod"]["def"]> {
1659
+ new (def: D): T;
1660
+ init(inst: T, def: D): asserts inst is T;
1661
+ }
1662
+ declare function $constructor<T extends ZodTrait, D = T["_zod"]["def"]>(name: string, initializer: (inst: T, def: D) => void, params?: {
1663
+ Parent?: typeof Class;
1664
+ }): $constructor<T, D>;
1665
+ declare const $brand: unique symbol;
1666
+ type $brand<T extends string | number | symbol = string | number | symbol> = {
1667
+ [$brand]: { [k in T]: true; };
1668
+ };
1669
+ type $ZodBranded<T extends SomeType, Brand extends string | number | symbol, Dir extends "in" | "out" | "inout" = "out"> = T & (Dir extends "inout" ? {
1670
+ _zod: {
1671
+ input: input$2<T> & $brand<Brand>;
1672
+ output: output$1<T> & $brand<Brand>;
1673
+ };
1674
+ } : Dir extends "in" ? {
1675
+ _zod: {
1676
+ input: input$2<T> & $brand<Brand>;
1677
+ };
1678
+ } : {
1679
+ _zod: {
1680
+ output: output$1<T> & $brand<Brand>;
1681
+ };
1682
+ });
1683
+ type input$2<T> = T extends {
1684
+ _zod: {
1685
+ input: any;
1686
+ };
1687
+ } ? T["_zod"]["input"] : unknown;
1688
+ type output$1<T> = T extends {
1689
+ _zod: {
1690
+ output: any;
1691
+ };
1692
+ } ? T["_zod"]["output"] : unknown;
1693
+ //#endregion
1694
+ //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.d.cts
1695
+ type Params<T extends $ZodType | $ZodCheck, IssueTypes extends $ZodIssueBase, OmitKeys extends keyof T["_zod"]["def"] = never> = Flatten<Partial<EmptyToNever<Omit<T["_zod"]["def"], OmitKeys> & ([IssueTypes] extends [never] ? {} : {
1696
+ error?: string | $ZodErrorMap<IssueTypes> | undefined;
1697
+ /** @deprecated This parameter is deprecated. Use `error` instead. */
1698
+ message?: string | undefined;
1699
+ })>>>;
1700
+ type TypeParams<T extends $ZodType = $ZodType & {
1701
+ _isst: never;
1702
+ }, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "checks" | "error"> = never> = Params<T, NonNullable<T["_zod"]["isst"]>, "type" | "checks" | "error" | AlsoOmit>;
1703
+ type CheckParams<T extends $ZodCheck = $ZodCheck // & { _issc: never },
1704
+ , AlsoOmit extends Exclude<keyof T["_zod"]["def"], "check" | "error"> = never> = Params<T, NonNullable<T["_zod"]["issc"]>, "check" | "error" | AlsoOmit>;
1705
+ type CheckStringFormatParams<T extends $ZodStringFormat = $ZodStringFormat, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "coerce" | "checks" | "error" | "check" | "format"> = never> = Params<T, NonNullable<T["_zod"]["issc"]>, "type" | "coerce" | "checks" | "error" | "check" | "format" | AlsoOmit>;
1706
+ type CheckTypeParams<T extends $ZodType & $ZodCheck = $ZodType & $ZodCheck, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "checks" | "error" | "check"> = never> = Params<T, NonNullable<T["_zod"]["isst"] | T["_zod"]["issc"]>, "type" | "checks" | "error" | "check" | AlsoOmit>;
1707
+ type $ZodCheckEmailParams = CheckStringFormatParams<$ZodEmail, "when">;
1708
+ type $ZodCheckGUIDParams = CheckStringFormatParams<$ZodGUID, "pattern" | "when">;
1709
+ type $ZodCheckUUIDParams = CheckStringFormatParams<$ZodUUID, "pattern" | "when">;
1710
+ type $ZodCheckURLParams = CheckStringFormatParams<$ZodURL, "when">;
1711
+ type $ZodCheckEmojiParams = CheckStringFormatParams<$ZodEmoji, "when">;
1712
+ type $ZodCheckNanoIDParams = CheckStringFormatParams<$ZodNanoID, "when">;
1713
+ /**
1714
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
1715
+ * (timestamps embedded in the id). Use {@link _cuid2} instead.
1716
+ * See https://github.com/paralleldrive/cuid.
1717
+ */
1718
+ type $ZodCheckCUIDParams = CheckStringFormatParams<$ZodCUID, "when">;
1719
+ type $ZodCheckCUID2Params = CheckStringFormatParams<$ZodCUID2, "when">;
1720
+ type $ZodCheckULIDParams = CheckStringFormatParams<$ZodULID, "when">;
1721
+ type $ZodCheckXIDParams = CheckStringFormatParams<$ZodXID, "when">;
1722
+ type $ZodCheckKSUIDParams = CheckStringFormatParams<$ZodKSUID, "when">;
1723
+ type $ZodCheckIPv4Params = CheckStringFormatParams<$ZodIPv4, "pattern" | "when" | "version">;
1724
+ type $ZodCheckIPv6Params = CheckStringFormatParams<$ZodIPv6, "pattern" | "when" | "version">;
1725
+ type $ZodCheckCIDRv4Params = CheckStringFormatParams<$ZodCIDRv4, "pattern" | "when">;
1726
+ type $ZodCheckCIDRv6Params = CheckStringFormatParams<$ZodCIDRv6, "pattern" | "when">;
1727
+ type $ZodCheckBase64Params = CheckStringFormatParams<$ZodBase64, "pattern" | "when">;
1728
+ type $ZodCheckBase64URLParams = CheckStringFormatParams<$ZodBase64URL, "pattern" | "when">;
1729
+ type $ZodCheckE164Params = CheckStringFormatParams<$ZodE164, "when">;
1730
+ type $ZodCheckJWTParams = CheckStringFormatParams<$ZodJWT, "pattern" | "when">;
1731
+ type $ZodCheckISODateTimeParams = CheckStringFormatParams<$ZodISODateTime, "pattern" | "when">;
1732
+ type $ZodCheckISODateParams = CheckStringFormatParams<$ZodISODate, "pattern" | "when">;
1733
+ type $ZodCheckISOTimeParams = CheckStringFormatParams<$ZodISOTime, "pattern" | "when">;
1734
+ type $ZodCheckISODurationParams = CheckStringFormatParams<$ZodISODuration, "when">;
1735
+ type $ZodCheckNumberFormatParams = CheckParams<$ZodCheckNumberFormat, "format" | "when">;
1736
+ type $ZodCheckLessThanParams = CheckParams<$ZodCheckLessThan, "inclusive" | "value" | "when">;
1737
+ type $ZodCheckGreaterThanParams = CheckParams<$ZodCheckGreaterThan, "inclusive" | "value" | "when">;
1738
+ type $ZodCheckMultipleOfParams = CheckParams<$ZodCheckMultipleOf, "value" | "when">;
1739
+ type $ZodCheckMaxLengthParams = CheckParams<$ZodCheckMaxLength, "maximum" | "when">;
1740
+ type $ZodCheckMinLengthParams = CheckParams<$ZodCheckMinLength, "minimum" | "when">;
1741
+ type $ZodCheckLengthEqualsParams = CheckParams<$ZodCheckLengthEquals, "length" | "when">;
1742
+ type $ZodCheckRegexParams = CheckParams<$ZodCheckRegex, "format" | "pattern" | "when">;
1743
+ type $ZodCheckLowerCaseParams = CheckParams<$ZodCheckLowerCase, "format" | "when">;
1744
+ type $ZodCheckUpperCaseParams = CheckParams<$ZodCheckUpperCase, "format" | "when">;
1745
+ type $ZodCheckIncludesParams = CheckParams<$ZodCheckIncludes, "includes" | "format" | "when" | "pattern">;
1746
+ type $ZodCheckStartsWithParams = CheckParams<$ZodCheckStartsWith, "prefix" | "format" | "when" | "pattern">;
1747
+ type $ZodCheckEndsWithParams = CheckParams<$ZodCheckEndsWith, "suffix" | "format" | "pattern" | "when">;
1748
+ type $ZodEnumParams = TypeParams<$ZodEnum, "entries">;
1749
+ type $ZodNonOptionalParams = TypeParams<$ZodNonOptional, "innerType">;
1750
+ type $ZodCustomParams = CheckTypeParams<$ZodCustom, "fn">;
1751
+ type $ZodSuperRefineIssue<T extends $ZodIssueBase = $ZodIssue> = T extends any ? RawIssue<T> : never;
1752
+ type RawIssue<T extends $ZodIssueBase> = T extends any ? Flatten<MakePartial<T, "message" | "path"> & {
1753
+ /** The schema or check that originated this issue. */
1754
+ readonly inst?: $ZodType | $ZodCheck;
1755
+ /** If `true`, Zod will execute subsequent checks/refinements instead of immediately aborting */
1756
+ readonly continue?: boolean | undefined;
1757
+ } & Record<string, unknown>> : never;
1758
+ interface $RefinementCtx<T = unknown> extends ParsePayload<T> {
1759
+ addIssue(arg: string | $ZodSuperRefineIssue): void;
1760
+ }
1761
+ interface $ZodSuperRefineParams {
1762
+ /** If provided, the refinement runs only when this returns `true`. By default, it is skipped if prior parsing produced aborting issues. */
1763
+ when?: ((payload: ParsePayload) => boolean) | undefined;
1764
+ }
1765
+ //#endregion
1766
+ //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/errors.d.cts
1767
+ /** An Error-like class used to store Zod validation issues. */
1768
+ interface ZodError$1<T = unknown> extends $ZodError<T> {
1769
+ /** @deprecated Use the `z.treeifyError(err)` function instead. */
1770
+ format(): $ZodFormattedError<T>;
1771
+ format<U>(mapper: (issue: $ZodIssue) => U): $ZodFormattedError<T, U>;
1772
+ /** @deprecated Use the `z.treeifyError(err)` function instead. */
1773
+ flatten(): $ZodFlattenedError<T>;
1774
+ flatten<U>(mapper: (issue: $ZodIssue) => U): $ZodFlattenedError<T, U>;
1775
+ /** @deprecated Push directly to `.issues` instead. */
1776
+ addIssue(issue: $ZodIssue): void;
1777
+ /** @deprecated Push directly to `.issues` instead. */
1778
+ addIssues(issues: $ZodIssue[]): void;
1779
+ /** @deprecated Check `err.issues.length === 0` instead. */
1780
+ isEmpty: boolean;
1781
+ }
1782
+ declare const ZodError$1: $constructor<ZodError$1>;
1783
+ //#endregion
1784
+ //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/parse.d.cts
1785
+ type ZodSafeParseResult<T> = ZodSafeParseSuccess<T> | ZodSafeParseError<T>;
1786
+ type ZodSafeParseSuccess<T> = {
1787
+ success: true;
1788
+ data: T;
1789
+ error?: never;
1790
+ };
1791
+ type ZodSafeParseError<T> = {
1792
+ success: false;
1793
+ data?: never;
1794
+ error: ZodError$1<T>;
1795
+ };
1796
+ //#endregion
1797
+ //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/schemas.d.cts
1798
+ type ZodStandardSchemaWithJSON<T> = StandardSchemaWithJSONProps<input$2<T>, output$1<T>>;
1799
+ interface ZodType$1<out Output = unknown, out Input = unknown, out Internals extends $ZodTypeInternals<Output, Input> = $ZodTypeInternals<Output, Input>> extends $ZodType<Output, Input, Internals> {
1800
+ def: Internals["def"];
1801
+ type: Internals["def"]["type"];
1802
+ /** @deprecated Use `.def` instead. */
1803
+ _def: Internals["def"];
1804
+ /** @deprecated Use `z.output<typeof schema>` instead. */
1805
+ _output: Internals["output"];
1806
+ /** @deprecated Use `z.input<typeof schema>` instead. */
1807
+ _input: Internals["input"];
1808
+ "~standard": ZodStandardSchemaWithJSON<this>;
1809
+ /** Converts this schema to a JSON Schema representation. */
1810
+ toJSONSchema(params?: ToJSONSchemaParams): ZodStandardJSONSchemaPayload<this>;
1811
+ check(...checks: (CheckFn<output$1<this>> | $ZodCheck<output$1<this>>)[]): this;
1812
+ with(...checks: (CheckFn<output$1<this>> | $ZodCheck<output$1<this>>)[]): this;
1813
+ clone(def?: Internals["def"], params?: {
1814
+ parent: boolean;
1815
+ }): this;
1816
+ register<R extends $ZodRegistry>(registry: R, ...meta: this extends R["_schema"] ? undefined extends R["_meta"] ? [$replace<R["_meta"], this>?] : [$replace<R["_meta"], this>] : ["Incompatible schema"]): this;
1817
+ brand<T extends PropertyKey = PropertyKey, Dir extends "in" | "out" | "inout" = "out">(value?: T): PropertyKey extends T ? this : $ZodBranded<this, T, Dir>;
1818
+ parse(data: unknown, params?: ParseContext$1<$ZodIssue>): output$1<this>;
1819
+ safeParse(data: unknown, params?: ParseContext$1<$ZodIssue>): ZodSafeParseResult<output$1<this>>;
1820
+ parseAsync(data: unknown, params?: ParseContext$1<$ZodIssue>): Promise<output$1<this>>;
1821
+ safeParseAsync(data: unknown, params?: ParseContext$1<$ZodIssue>): Promise<ZodSafeParseResult<output$1<this>>>;
1822
+ spa: (data: unknown, params?: ParseContext$1<$ZodIssue>) => Promise<ZodSafeParseResult<output$1<this>>>;
1823
+ encode(data: output$1<this>, params?: ParseContext$1<$ZodIssue>): input$2<this>;
1824
+ decode(data: input$2<this>, params?: ParseContext$1<$ZodIssue>): output$1<this>;
1825
+ encodeAsync(data: output$1<this>, params?: ParseContext$1<$ZodIssue>): Promise<input$2<this>>;
1826
+ decodeAsync(data: input$2<this>, params?: ParseContext$1<$ZodIssue>): Promise<output$1<this>>;
1827
+ safeEncode(data: output$1<this>, params?: ParseContext$1<$ZodIssue>): ZodSafeParseResult<input$2<this>>;
1828
+ safeDecode(data: input$2<this>, params?: ParseContext$1<$ZodIssue>): ZodSafeParseResult<output$1<this>>;
1829
+ safeEncodeAsync(data: output$1<this>, params?: ParseContext$1<$ZodIssue>): Promise<ZodSafeParseResult<input$2<this>>>;
1830
+ safeDecodeAsync(data: input$2<this>, params?: ParseContext$1<$ZodIssue>): Promise<ZodSafeParseResult<output$1<this>>>;
1831
+ refine<Ch extends (arg: output$1<this>) => unknown | Promise<unknown>>(check: Ch, params?: string | $ZodCustomParams): Ch extends ((arg: any) => arg is infer R) ? this & ZodType$1<R, input$2<this>> : this;
1832
+ superRefine(refinement: (arg: output$1<this>, ctx: $RefinementCtx<output$1<this>>) => void | Promise<void>, params?: $ZodSuperRefineParams): this;
1833
+ overwrite(fn: (x: output$1<this>) => output$1<this>): this;
1834
+ optional(): ZodOptional$1<this>;
1835
+ exactOptional(): ZodExactOptional<this>;
1836
+ nonoptional(params?: string | $ZodNonOptionalParams): ZodNonOptional<this>;
1837
+ nullable(): ZodNullable$1<this>;
1838
+ nullish(): ZodOptional$1<ZodNullable$1<this>>;
1839
+ default(def: NoUndefined<output$1<this>>): ZodDefault$1<this>;
1840
+ default(def: () => NoUndefined<output$1<this>>): ZodDefault$1<this>;
1841
+ prefault(def: () => input$2<this>): ZodPrefault<this>;
1842
+ prefault(def: input$2<this>): ZodPrefault<this>;
1843
+ array(): ZodArray$1<this>;
1844
+ or<T extends SomeType>(option: T): ZodUnion$1<[this, T]>;
1845
+ and<T extends SomeType>(incoming: T): ZodIntersection$1<this, T>;
1846
+ transform<NewOut>(transform: (arg: output$1<this>, ctx: $RefinementCtx<output$1<this>>) => NewOut | Promise<NewOut>): ZodPipe<this, ZodTransform<Awaited<NewOut>, output$1<this>>>;
1847
+ catch(def: output$1<this>): ZodCatch$1<this>;
1848
+ catch(def: (ctx: $ZodCatchCtx) => output$1<this>): ZodCatch$1<this>;
1849
+ pipe<T extends $ZodType<any, output$1<this>>>(target: T | $ZodType<any, output$1<this>>): ZodPipe<this, T>;
1850
+ readonly(): ZodReadonly$1<this>;
1851
+ /** Returns a new instance that has been registered in `z.globalRegistry` with the specified description */
1852
+ describe(description: string): this;
1853
+ description?: string;
1854
+ /** Returns the metadata associated with this instance in `z.globalRegistry` */
1855
+ meta(): $replace<GlobalMeta, this> | undefined;
1856
+ /** Returns a new instance that has been registered in `z.globalRegistry` with the specified metadata */
1857
+ meta(data: $replace<GlobalMeta, this>): this;
1858
+ /** @deprecated Try safe-parsing `undefined` (this is what `isOptional` does internally):
1859
+ *
1860
+ * ```ts
1861
+ * const schema = z.string().optional();
1862
+ * const isOptional = schema.safeParse(undefined).success; // true
1863
+ * ```
1864
+ */
1865
+ isOptional(): boolean;
1866
+ /**
1867
+ * @deprecated Try safe-parsing `null` (this is what `isNullable` does internally):
1868
+ *
1869
+ * ```ts
1870
+ * const schema = z.string().nullable();
1871
+ * const isNullable = schema.safeParse(null).success; // true
1872
+ * ```
1873
+ */
1874
+ isNullable(): boolean;
1875
+ apply<T>(fn: (schema: this) => T): T;
1876
+ }
1877
+ interface _ZodType<out Internals extends $ZodTypeInternals = $ZodTypeInternals> extends ZodType$1<any, any, Internals> {}
1878
+ declare const ZodType$1: $constructor<ZodType$1>;
1879
+ interface _ZodString<T extends $ZodStringInternals<unknown> = $ZodStringInternals<unknown>> extends _ZodType<T> {
1880
+ format: string | null;
1881
+ minLength: number | null;
1882
+ maxLength: number | null;
1883
+ regex(regex: RegExp, params?: string | $ZodCheckRegexParams): this;
1884
+ includes(value: string, params?: string | $ZodCheckIncludesParams): this;
1885
+ startsWith(value: string, params?: string | $ZodCheckStartsWithParams): this;
1886
+ endsWith(value: string, params?: string | $ZodCheckEndsWithParams): this;
1887
+ min(minLength: number, params?: string | $ZodCheckMinLengthParams): this;
1888
+ max(maxLength: number, params?: string | $ZodCheckMaxLengthParams): this;
1889
+ length(len: number, params?: string | $ZodCheckLengthEqualsParams): this;
1890
+ nonempty(params?: string | $ZodCheckMinLengthParams): this;
1891
+ lowercase(params?: string | $ZodCheckLowerCaseParams): this;
1892
+ uppercase(params?: string | $ZodCheckUpperCaseParams): this;
1893
+ trim(): this;
1894
+ normalize(form?: "NFC" | "NFD" | "NFKC" | "NFKD" | (string & {})): this;
1895
+ toLowerCase(): this;
1896
+ toUpperCase(): this;
1897
+ slugify(): this;
1898
+ }
1899
+ /** @internal */
1900
+ declare const _ZodString: $constructor<_ZodString>;
1901
+ interface ZodString extends _ZodString<$ZodStringInternals<string>> {
1902
+ /** @deprecated Use `z.email()` instead. */
1903
+ email(params?: string | $ZodCheckEmailParams): this;
1904
+ /** @deprecated Use `z.url()` instead. */
1905
+ url(params?: string | $ZodCheckURLParams): this;
1906
+ /** @deprecated Use `z.jwt()` instead. */
1907
+ jwt(params?: string | $ZodCheckJWTParams): this;
1908
+ /** @deprecated Use `z.emoji()` instead. */
1909
+ emoji(params?: string | $ZodCheckEmojiParams): this;
1910
+ /** @deprecated Use `z.guid()` instead. */
1911
+ guid(params?: string | $ZodCheckGUIDParams): this;
1912
+ /** @deprecated Use `z.uuid()` instead. */
1913
+ uuid(params?: string | $ZodCheckUUIDParams): this;
1914
+ /** @deprecated Use `z.uuid()` instead. */
1915
+ uuidv4(params?: string | $ZodCheckUUIDParams): this;
1916
+ /** @deprecated Use `z.uuid()` instead. */
1917
+ uuidv6(params?: string | $ZodCheckUUIDParams): this;
1918
+ /** @deprecated Use `z.uuid()` instead. */
1919
+ uuidv7(params?: string | $ZodCheckUUIDParams): this;
1920
+ /** @deprecated Use `z.nanoid()` instead. */
1921
+ nanoid(params?: string | $ZodCheckNanoIDParams): this;
1922
+ /** @deprecated Use `z.guid()` instead. */
1923
+ guid(params?: string | $ZodCheckGUIDParams): this;
1924
+ /**
1925
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
1926
+ * (timestamps embedded in the id). Use `z.cuid2()` instead.
1927
+ * See https://github.com/paralleldrive/cuid.
1928
+ */
1929
+ cuid(params?: string | $ZodCheckCUIDParams): this;
1930
+ /** @deprecated Use `z.cuid2()` instead. */
1931
+ cuid2(params?: string | $ZodCheckCUID2Params): this;
1932
+ /** @deprecated Use `z.ulid()` instead. */
1933
+ ulid(params?: string | $ZodCheckULIDParams): this;
1934
+ /** @deprecated Use `z.base64()` instead. */
1935
+ base64(params?: string | $ZodCheckBase64Params): this;
1936
+ /** @deprecated Use `z.base64url()` instead. */
1937
+ base64url(params?: string | $ZodCheckBase64URLParams): this;
1938
+ /** @deprecated Use `z.xid()` instead. */
1939
+ xid(params?: string | $ZodCheckXIDParams): this;
1940
+ /** @deprecated Use `z.ksuid()` instead. */
1941
+ ksuid(params?: string | $ZodCheckKSUIDParams): this;
1942
+ /** @deprecated Use `z.ipv4()` instead. */
1943
+ ipv4(params?: string | $ZodCheckIPv4Params): this;
1944
+ /** @deprecated Use `z.ipv6()` instead. */
1945
+ ipv6(params?: string | $ZodCheckIPv6Params): this;
1946
+ /** @deprecated Use `z.cidrv4()` instead. */
1947
+ cidrv4(params?: string | $ZodCheckCIDRv4Params): this;
1948
+ /** @deprecated Use `z.cidrv6()` instead. */
1949
+ cidrv6(params?: string | $ZodCheckCIDRv6Params): this;
1950
+ /** @deprecated Use `z.e164()` instead. */
1951
+ e164(params?: string | $ZodCheckE164Params): this;
1952
+ /** @deprecated Use `z.iso.datetime()` instead. */
1953
+ datetime(params?: string | $ZodCheckISODateTimeParams): this;
1954
+ /** @deprecated Use `z.iso.date()` instead. */
1955
+ date(params?: string | $ZodCheckISODateParams): this;
1956
+ /** @deprecated Use `z.iso.time()` instead. */
1957
+ time(params?: string | $ZodCheckISOTimeParams): this;
1958
+ /** @deprecated Use `z.iso.duration()` instead. */
1959
+ duration(params?: string | $ZodCheckISODurationParams): this;
1960
+ }
1961
+ declare const ZodString: $constructor<ZodString>;
1962
+ interface ZodStringFormat<Format extends string = string> extends _ZodString<$ZodStringFormatInternals<Format>> {}
1963
+ declare const ZodStringFormat: $constructor<ZodStringFormat>;
1964
+ interface ZodBase64 extends ZodStringFormat<"base64"> {
1965
+ _zod: $ZodBase64Internals;
1966
+ }
1967
+ declare const ZodBase64: $constructor<ZodBase64>;
1968
+ interface _ZodNumber<Internals extends $ZodNumberInternals = $ZodNumberInternals> extends _ZodType<Internals> {
1969
+ gt(value: number, params?: string | $ZodCheckGreaterThanParams): this;
1970
+ /** Identical to .min() */
1971
+ gte(value: number, params?: string | $ZodCheckGreaterThanParams): this;
1972
+ min(value: number, params?: string | $ZodCheckGreaterThanParams): this;
1973
+ lt(value: number, params?: string | $ZodCheckLessThanParams): this;
1974
+ /** Identical to .max() */
1975
+ lte(value: number, params?: string | $ZodCheckLessThanParams): this;
1976
+ max(value: number, params?: string | $ZodCheckLessThanParams): this;
1977
+ /** Consider `z.int()` instead. This API is considered *legacy*; it will never be removed but a better alternative exists. */
1978
+ int(params?: string | $ZodCheckNumberFormatParams): this;
1979
+ /** @deprecated This is now identical to `.int()`. Only numbers in the safe integer range are accepted. */
1980
+ safe(params?: string | $ZodCheckNumberFormatParams): this;
1981
+ positive(params?: string | $ZodCheckGreaterThanParams): this;
1982
+ nonnegative(params?: string | $ZodCheckGreaterThanParams): this;
1983
+ negative(params?: string | $ZodCheckLessThanParams): this;
1984
+ nonpositive(params?: string | $ZodCheckLessThanParams): this;
1985
+ multipleOf(value: number, params?: string | $ZodCheckMultipleOfParams): this;
1986
+ /** @deprecated Use `.multipleOf()` instead. */
1987
+ step(value: number, params?: string | $ZodCheckMultipleOfParams): this;
1988
+ /** @deprecated In v4 and later, z.number() does not allow infinite values by default. This is a no-op. */
1989
+ finite(params?: unknown): this;
1990
+ minValue: number | null;
1991
+ maxValue: number | null;
1992
+ /** @deprecated Check the `format` property instead. */
1993
+ isInt: boolean;
1994
+ /** @deprecated Number schemas no longer accept infinite values, so this always returns `true`. */
1995
+ isFinite: boolean;
1996
+ format: string | null;
1997
+ }
1998
+ interface ZodNumber extends _ZodNumber<$ZodNumberInternals<number>> {}
1999
+ declare const ZodNumber: $constructor<ZodNumber>;
2000
+ interface _ZodBoolean<T extends $ZodBooleanInternals = $ZodBooleanInternals> extends _ZodType<T> {}
2001
+ interface ZodBoolean extends _ZodBoolean<$ZodBooleanInternals<boolean>> {}
2002
+ declare const ZodBoolean: $constructor<ZodBoolean>;
2003
+ interface ZodAny extends _ZodType<$ZodAnyInternals> {}
2004
+ declare const ZodAny: $constructor<ZodAny>;
2005
+ interface ZodUnknown extends _ZodType<$ZodUnknownInternals> {}
2006
+ declare const ZodUnknown: $constructor<ZodUnknown>;
2007
+ interface ZodArray$1<T extends SomeType = $ZodType> extends _ZodType<$ZodArrayInternals<T>>, $ZodArray<T> {
2008
+ element: T;
2009
+ min(minLength: number, params?: string | $ZodCheckMinLengthParams): this;
2010
+ nonempty(params?: string | $ZodCheckMinLengthParams): this;
2011
+ max(maxLength: number, params?: string | $ZodCheckMaxLengthParams): this;
2012
+ length(len: number, params?: string | $ZodCheckLengthEqualsParams): this;
2013
+ unwrap(): T;
2014
+ "~standard": ZodStandardSchemaWithJSON<this>;
2015
+ }
2016
+ declare const ZodArray$1: $constructor<ZodArray$1>;
2017
+ type SafeExtendShape<Base extends $ZodShape, Ext extends $ZodLooseShape> = { [K in keyof Ext]: K extends keyof Base ? output$1<Ext[K]> extends output$1<Base[K]> ? input$2<Ext[K]> extends input$2<Base[K]> ? Ext[K] : never : never : Ext[K]; };
2018
+ interface ZodObject<
2019
+ /** @ts-ignore Cast variance */
2020
+ out Shape extends $ZodShape = $ZodLooseShape, out Config extends $ZodObjectConfig = $strip> extends _ZodType<$ZodObjectInternals<Shape, Config>>, $ZodObject<Shape, Config> {
2021
+ "~standard": ZodStandardSchemaWithJSON<this>;
2022
+ shape: Shape;
2023
+ keyof(): ZodEnum<ToEnum<keyof Shape & string>>;
2024
+ /** Define a schema to validate all unrecognized keys. This overrides the existing strict/loose behavior. */
2025
+ catchall<T extends SomeType>(schema: T): ZodObject<Shape, $catchall<T>>;
2026
+ /** @deprecated Use `z.looseObject()` or `.loose()` instead. */
2027
+ passthrough(): ZodObject<Shape, $loose>;
2028
+ /** Consider `z.looseObject(A.shape)` instead */
2029
+ loose(): ZodObject<Shape, $loose>;
2030
+ /** Consider `z.strictObject(A.shape)` instead */
2031
+ strict(): ZodObject<Shape, $strict>;
2032
+ /** This is the default behavior. This method call is likely unnecessary. */
2033
+ strip(): ZodObject<Shape, $strip>;
2034
+ extend<U extends $ZodLooseShape>(shape: U): ZodObject<Extend<Shape, Writeable<U>>, Config>;
2035
+ safeExtend<U extends $ZodLooseShape>(shape: SafeExtendShape<Shape, U> & Partial<Record<keyof Shape, SomeType>>): ZodObject<Extend<Shape, Writeable<U>>, Config>;
2036
+ /**
2037
+ * @deprecated Use [`A.extend(B.shape)`](https://zod.dev/api?id=extend) instead.
2038
+ */
2039
+ merge<U extends ZodObject>(other: U): ZodObject<Extend<Shape, U["shape"]>, U["_zod"]["config"]>;
2040
+ pick<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<Flatten<Pick<Shape, Extract<keyof Shape, keyof M>>>, Config>;
2041
+ omit<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<Flatten<Omit<Shape, Extract<keyof Shape, keyof M>>>, Config>;
2042
+ partial(): ZodObject<{ -readonly [k in keyof Shape]: ZodOptional$1<Shape[k]>; }, Config>;
2043
+ partial<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<{ -readonly [k in keyof Shape]: k extends keyof M ? ZodOptional$1<Shape[k]> : Shape[k]; }, Config>;
2044
+ required(): ZodObject<{ -readonly [k in keyof Shape]: ZodNonOptional<Shape[k]>; }, Config>;
2045
+ required<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<{ -readonly [k in keyof Shape]: k extends keyof M ? ZodNonOptional<Shape[k]> : Shape[k]; }, Config>;
2046
+ }
2047
+ declare const ZodObject: $constructor<ZodObject>;
2048
+ interface ZodUnion$1<T extends readonly SomeType[] = readonly $ZodType[]> extends _ZodType<$ZodUnionInternals<T>>, $ZodUnion<T> {
2049
+ "~standard": ZodStandardSchemaWithJSON<this>;
2050
+ options: T;
2051
+ }
2052
+ declare const ZodUnion$1: $constructor<ZodUnion$1>;
2053
+ interface ZodIntersection$1<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _ZodType<$ZodIntersectionInternals<A, B>>, $ZodIntersection<A, B> {
2054
+ "~standard": ZodStandardSchemaWithJSON<this>;
2055
+ }
2056
+ declare const ZodIntersection$1: $constructor<ZodIntersection$1>;
2057
+ interface ZodRecord<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends _ZodType<$ZodRecordInternals<Key, Value>>, $ZodRecord<Key, Value> {
2058
+ "~standard": ZodStandardSchemaWithJSON<this>;
2059
+ keyType: Key;
2060
+ valueType: Value;
2061
+ }
2062
+ declare const ZodRecord: $constructor<ZodRecord>;
2063
+ interface ZodEnum<
2064
+ /** @ts-ignore Cast variance */
2065
+ out T extends EnumLike = EnumLike> extends _ZodType<$ZodEnumInternals<T>>, $ZodEnum<T> {
2066
+ "~standard": ZodStandardSchemaWithJSON<this>;
2067
+ enum: T;
2068
+ options: Array<T[keyof T]>;
2069
+ extract<const U extends readonly (keyof T)[]>(values: U, params?: string | $ZodEnumParams): ZodEnum<Flatten<Pick<T, U[number]>>>;
2070
+ exclude<const U extends readonly (keyof T)[]>(values: U, params?: string | $ZodEnumParams): ZodEnum<Flatten<Omit<T, U[number]>>>;
2071
+ }
2072
+ declare const ZodEnum: $constructor<ZodEnum>;
2073
+ interface ZodLiteral<T extends Literal = Literal> extends _ZodType<$ZodLiteralInternals<T>>, $ZodLiteral<T> {
2074
+ "~standard": ZodStandardSchemaWithJSON<this>;
2075
+ values: Set<T>;
2076
+ /** @legacy Use `.values` instead. Accessing this property will throw an error if the literal accepts multiple values. */
2077
+ value: T;
2078
+ }
2079
+ declare const ZodLiteral: $constructor<ZodLiteral>;
2080
+ interface ZodTransform<O = unknown, I = unknown> extends _ZodType<$ZodTransformInternals<O, I>>, $ZodTransform<O, I> {
2081
+ "~standard": ZodStandardSchemaWithJSON<this>;
2082
+ }
2083
+ declare const ZodTransform: $constructor<ZodTransform>;
2084
+ interface ZodOptional$1<T extends SomeType = $ZodType> extends _ZodType<$ZodOptionalInternals<T>>, $ZodOptional<T> {
2085
+ "~standard": ZodStandardSchemaWithJSON<this>;
2086
+ unwrap(): T;
2087
+ }
2088
+ declare const ZodOptional$1: $constructor<ZodOptional$1>;
2089
+ interface ZodExactOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodExactOptionalInternals<T>>, $ZodExactOptional<T> {
2090
+ "~standard": ZodStandardSchemaWithJSON<this>;
2091
+ unwrap(): T;
2092
+ }
2093
+ declare const ZodExactOptional: $constructor<ZodExactOptional>;
2094
+ interface ZodNullable$1<T extends SomeType = $ZodType> extends _ZodType<$ZodNullableInternals<T>>, $ZodNullable<T> {
2095
+ "~standard": ZodStandardSchemaWithJSON<this>;
2096
+ unwrap(): T;
2097
+ }
2098
+ declare const ZodNullable$1: $constructor<ZodNullable$1>;
2099
+ interface ZodDefault$1<T extends SomeType = $ZodType> extends _ZodType<$ZodDefaultInternals<T>>, $ZodDefault<T> {
2100
+ "~standard": ZodStandardSchemaWithJSON<this>;
2101
+ unwrap(): T;
2102
+ /** @deprecated Use `.unwrap()` instead. */
2103
+ removeDefault(): T;
2104
+ }
2105
+ declare const ZodDefault$1: $constructor<ZodDefault$1>;
2106
+ interface ZodPrefault<T extends SomeType = $ZodType> extends _ZodType<$ZodPrefaultInternals<T>>, $ZodPrefault<T> {
2107
+ "~standard": ZodStandardSchemaWithJSON<this>;
2108
+ unwrap(): T;
2109
+ }
2110
+ declare const ZodPrefault: $constructor<ZodPrefault>;
2111
+ interface ZodNonOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodNonOptionalInternals<T>>, $ZodNonOptional<T> {
2112
+ "~standard": ZodStandardSchemaWithJSON<this>;
2113
+ unwrap(): T;
2114
+ }
2115
+ declare const ZodNonOptional: $constructor<ZodNonOptional>;
2116
+ interface ZodCatch$1<T extends SomeType = $ZodType> extends _ZodType<$ZodCatchInternals<T>>, $ZodCatch<T> {
2117
+ "~standard": ZodStandardSchemaWithJSON<this>;
2118
+ unwrap(): T;
2119
+ /** @deprecated Use `.unwrap()` instead. */
2120
+ removeCatch(): T;
2121
+ }
2122
+ declare const ZodCatch$1: $constructor<ZodCatch$1>;
2123
+ interface ZodPipe<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _ZodType<$ZodPipeInternals<A, B>>, $ZodPipe<A, B> {
2124
+ "~standard": ZodStandardSchemaWithJSON<this>;
2125
+ in: A;
2126
+ out: B;
2127
+ }
2128
+ declare const ZodPipe: $constructor<ZodPipe>;
2129
+ interface ZodReadonly$1<T extends SomeType = $ZodType> extends _ZodType<$ZodReadonlyInternals<T>>, $ZodReadonly<T> {
2130
+ "~standard": ZodStandardSchemaWithJSON<this>;
2131
+ unwrap(): T;
2132
+ }
2133
+ declare const ZodReadonly$1: $constructor<ZodReadonly$1>;
2134
+ //#endregion
2135
+ //#region node_modules/.pnpm/@ai-sdk+provider@4.0.3/node_modules/@ai-sdk/provider/dist/index.d.ts
2136
+ /**
2137
+ * A mapping of provider names to provider-specific file identifiers.
2138
+ *
2139
+ * Provider references allow files to be identified across different
2140
+ * providers without re-uploading, by storing each provider's own
2141
+ * identifier for the same logical file.
2142
+ *
2143
+ * ```ts
2144
+ * {
2145
+ * "openai": "file-abc123",
2146
+ * "anthropic": "file-xyz789"
2147
+ * }
2148
+ * ```
2149
+ *
2150
+ * The `type?: never` constraint excludes any object that has a `type`
2151
+ * property, so a `SharedV4ProviderReference` cannot be confused with a
2152
+ * tagged file-data shape (e.g. `{ type: 'data', data }` or
2153
+ * `{ type: 'reference', reference }`) when both appear in the same union.
2154
+ */
2155
+ type SharedV4ProviderReference = Record<string, string> & {
2156
+ type?: never;
2157
+ };
2158
+ /**
2159
+ * File data variant containing a URL that points to the file.
2160
+ */
2161
+ interface SharedV4FileDataUrl {
2162
+ type: 'url';
2163
+ url: URL;
2164
+ }
2165
+ /**
2166
+ * File data variant containing a provider reference (`{ [provider]: id }`).
2167
+ */
2168
+ interface SharedV4FileDataReference {
2169
+ type: 'reference';
2170
+ reference: SharedV4ProviderReference;
2171
+ }
2172
+ /**
2173
+ * File data variant containing inline text content (e.g. an inline text
2174
+ * document).
2175
+ */
2176
+ interface SharedV4FileDataText {
2177
+ type: 'text';
2178
+ text: string;
2179
+ }
2180
+ /**
2181
+ * A JSON value can be a string, number, boolean, object, array, or null.
2182
+ * JSON values can be serialized and deserialized by the JSON.stringify and JSON.parse methods.
2183
+ */
2184
+ type JSONValue = null | string | number | boolean | JSONObject | JSONArray;
2185
+ type JSONObject = {
2186
+ [key: string]: JSONValue | undefined;
2187
+ };
2188
+ type JSONArray = JSONValue[];
2189
+ /**
2190
+ * Additional provider-specific options.
2191
+ * Options are additional input to the provider.
2192
+ * They are passed through to the provider from the AI SDK
2193
+ * and enable provider-specific functionality
2194
+ * that can be fully encapsulated in the provider.
2195
+ *
2196
+ * This enables us to quickly ship provider-specific functionality
2197
+ * without affecting the core AI SDK.
2198
+ *
2199
+ * The outer record is keyed by the provider name, and the inner
2200
+ * record is keyed by the provider-specific metadata key.
2201
+ *
2202
+ * ```ts
2203
+ * {
2204
+ * "anthropic": {
2205
+ * "cacheControl": { "type": "ephemeral" }
2206
+ * }
2207
+ * }
2208
+ * ```
2209
+ */
2210
+ type SharedV4ProviderOptions = Record<string, JSONObject>;
2211
+ //#endregion
2212
+ //#region node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.ts
2213
+ /** The Standard Typed interface. This is a base type extended by other specs. */
2214
+ interface StandardTypedV1<Input = unknown, Output = Input> {
2215
+ /** The Standard properties. */
2216
+ readonly "~standard": StandardTypedV1.Props<Input, Output>;
2217
+ }
2218
+ declare namespace StandardTypedV1 {
2219
+ /** The Standard Typed properties interface. */
2220
+ interface Props<Input = unknown, Output = Input> {
2221
+ /** The version number of the standard. */
2222
+ readonly version: 1;
2223
+ /** The vendor name of the schema library. */
2224
+ readonly vendor: string;
2225
+ /** Inferred types associated with the schema. */
2226
+ readonly types?: Types<Input, Output> | undefined;
2227
+ }
2228
+ /** The Standard Typed types interface. */
2229
+ interface Types<Input = unknown, Output = Input> {
2230
+ /** The input type of the schema. */
2231
+ readonly input: Input;
2232
+ /** The output type of the schema. */
2233
+ readonly output: Output;
2234
+ }
2235
+ /** Infers the input type of a Standard Typed. */
2236
+ type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
2237
+ /** Infers the output type of a Standard Typed. */
2238
+ type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
2239
+ }
2240
+ /** The Standard Schema interface. */
2241
+ interface StandardSchemaV1$1<Input = unknown, Output = Input> {
2242
+ /** The Standard Schema properties. */
2243
+ readonly "~standard": StandardSchemaV1$1.Props<Input, Output>;
2244
+ }
2245
+ declare namespace StandardSchemaV1$1 {
2246
+ /** The Standard Schema properties interface. */
2247
+ interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
2248
+ /** Validates unknown input values. */
2249
+ readonly validate: (value: unknown, options?: StandardSchemaV1$1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
2250
+ }
2251
+ /** The result interface of the validate function. */
2252
+ type Result<Output> = SuccessResult<Output> | FailureResult;
2253
+ /** The result interface if validation succeeds. */
2254
+ interface SuccessResult<Output> {
2255
+ /** The typed output value. */
2256
+ readonly value: Output;
2257
+ /** A falsy value for `issues` indicates success. */
2258
+ readonly issues?: undefined;
2259
+ }
2260
+ interface Options {
2261
+ /** Explicit support for additional vendor-specific parameters, if needed. */
2262
+ readonly libraryOptions?: Record<string, unknown> | undefined;
2263
+ }
2264
+ /** The result interface if validation fails. */
2265
+ interface FailureResult {
2266
+ /** The issues of failed validation. */
2267
+ readonly issues: ReadonlyArray<Issue>;
2268
+ }
2269
+ /** The issue interface of the failure output. */
2270
+ interface Issue {
2271
+ /** The error message of the issue. */
2272
+ readonly message: string;
2273
+ /** The path of the issue, if any. */
2274
+ readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
2275
+ }
2276
+ /** The path segment interface of the issue. */
2277
+ interface PathSegment {
2278
+ /** The key representing a path segment. */
2279
+ readonly key: PropertyKey;
2280
+ }
2281
+ /** The Standard types interface. */
2282
+ interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
2283
+ /** Infers the input type of a Standard. */
2284
+ type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
2285
+ /** Infers the output type of a Standard. */
2286
+ type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
2287
+ }
2288
+ /** The Standard JSON Schema interface. */
2289
+ interface StandardJSONSchemaV1<Input = unknown, Output = Input> {
2290
+ /** The Standard JSON Schema properties. */
2291
+ readonly "~standard": StandardJSONSchemaV1.Props<Input, Output>;
2292
+ }
2293
+ declare namespace StandardJSONSchemaV1 {
2294
+ /** The Standard JSON Schema properties interface. */
2295
+ interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
2296
+ /** Methods for generating the input/output JSON Schema. */
2297
+ readonly jsonSchema: StandardJSONSchemaV1.Converter;
2298
+ }
2299
+ /** The Standard JSON Schema converter interface. */
2300
+ interface Converter {
2301
+ /** Converts the input type to JSON Schema. May throw if conversion is not supported. */
2302
+ readonly input: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
2303
+ /** Converts the output type to JSON Schema. May throw if conversion is not supported. */
2304
+ readonly output: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
2305
+ }
2306
+ /**
2307
+ * The target version of the generated JSON Schema.
2308
+ *
2309
+ * 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.
2310
+ *
2311
+ * The `"openapi-3.0"` target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema `"draft-04"`.
2312
+ */
2313
+ type Target = "draft-2020-12" | "draft-07" | "openapi-3.0" | ({} & string);
2314
+ /** The options for the input/output methods. */
2315
+ interface Options {
2316
+ /** 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. */
2317
+ readonly target: Target;
2318
+ /** Explicit support for additional vendor-specific parameters, if needed. */
2319
+ readonly libraryOptions?: Record<string, unknown> | undefined;
2320
+ }
2321
+ /** The Standard types interface. */
2322
+ interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
2323
+ /** Infers the input type of a Standard. */
2324
+ type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
2325
+ /** Infers the output type of a Standard. */
2326
+ type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
2327
+ }
2328
+ //#endregion
2329
+ //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/helpers/typeAliases.d.cts
2330
+ type Primitive = string | number | symbol | bigint | boolean | null | undefined;
2331
+ //#endregion
2332
+ //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/helpers/util.d.cts
2333
+ declare namespace util {
2334
+ type AssertEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends (<V>() => V extends U ? 1 : 2) ? true : false;
2335
+ export type isAny<T> = 0 extends 1 & T ? true : false;
2336
+ export const assertEqual: <A, B>(_: AssertEqual<A, B>) => void;
2337
+ export function assertIs<T>(_arg: T): void;
2338
+ export function assertNever(_x: never): never;
2339
+ export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
2340
+ export type OmitKeys<T, K extends string> = Pick<T, Exclude<keyof T, K>>;
2341
+ export type MakePartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
2342
+ export type Exactly<T, X> = T & Record<Exclude<keyof X, keyof T>, never>;
2343
+ export type InexactPartial<T> = { [k in keyof T]?: T[k] | undefined; };
2344
+ export const arrayToEnum: <T extends string, U extends [T, ...T[]]>(items: U) => { [k in U[number]]: k; };
2345
+ export const getValidEnumValues: (obj: any) => any[];
2346
+ export const objectValues: (obj: any) => any[];
2347
+ export const objectKeys: ObjectConstructor["keys"];
2348
+ export const find: <T>(arr: T[], checker: (arg: T) => any) => T | undefined;
2349
+ export type identity<T> = objectUtil.identity<T>;
2350
+ export type flatten<T> = objectUtil.flatten<T>;
2351
+ export type noUndefined<T> = T extends undefined ? never : T;
2352
+ export const isInteger: NumberConstructor["isInteger"];
2353
+ export function joinValues<T extends any[]>(array: T, separator?: string): string;
2354
+ export const jsonStringifyReplacer: (_: string, value: any) => any;
2355
+ export {};
2356
+ }
2357
+ declare namespace objectUtil {
2358
+ export type MergeShapes<U, V> = keyof U & keyof V extends never ? U & V : { [k in Exclude<keyof U, keyof V>]: U[k]; } & V;
2359
+ type optionalKeys<T extends object> = { [k in keyof T]: undefined extends T[k] ? k : never; }[keyof T];
2360
+ type requiredKeys<T extends object> = { [k in keyof T]: undefined extends T[k] ? never : k; }[keyof T];
2361
+ export type addQuestionMarks<T extends object, _O = any> = { [K in requiredKeys<T>]: T[K]; } & { [K in optionalKeys<T>]?: T[K]; } & { [k in keyof T]?: unknown; };
2362
+ export type identity<T> = T;
2363
+ export type flatten<T> = identity<{ [k in keyof T]: T[k]; }>;
2364
+ export type noNeverKeys<T> = { [k in keyof T]: [T[k]] extends [never] ? never : k; }[keyof T];
2365
+ export type noNever<T> = identity<{ [k in noNeverKeys<T>]: k extends keyof T ? T[k] : never; }>;
2366
+ export const mergeShapes: <U, T>(first: U, second: T) => T & U;
2367
+ export type extendShape<A extends object, B extends object> = 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]; };
2368
+ export {};
2369
+ }
2370
+ declare const ZodParsedType: {
2371
+ string: "string";
2372
+ nan: "nan";
2373
+ number: "number";
2374
+ integer: "integer";
2375
+ float: "float";
2376
+ boolean: "boolean";
2377
+ date: "date";
2378
+ bigint: "bigint";
2379
+ symbol: "symbol";
2380
+ function: "function";
2381
+ undefined: "undefined";
2382
+ null: "null";
2383
+ array: "array";
2384
+ object: "object";
2385
+ unknown: "unknown";
2386
+ promise: "promise";
2387
+ void: "void";
2388
+ never: "never";
2389
+ map: "map";
2390
+ set: "set";
2391
+ };
2392
+ type ZodParsedType = keyof typeof ZodParsedType;
2393
+ //#endregion
2394
+ //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/ZodError.d.cts
2395
+ type allKeys<T> = T extends any ? keyof T : never;
2396
+ type typeToFlattenedError<T, U = string> = {
2397
+ formErrors: U[];
2398
+ fieldErrors: { [P in allKeys<T>]?: U[]; };
2399
+ };
2400
+ declare const ZodIssueCode: {
2401
+ custom: "custom";
2402
+ invalid_type: "invalid_type";
2403
+ too_big: "too_big";
2404
+ too_small: "too_small";
2405
+ not_multiple_of: "not_multiple_of";
2406
+ unrecognized_keys: "unrecognized_keys";
2407
+ invalid_union: "invalid_union";
2408
+ invalid_literal: "invalid_literal";
2409
+ invalid_union_discriminator: "invalid_union_discriminator";
2410
+ invalid_enum_value: "invalid_enum_value";
2411
+ invalid_arguments: "invalid_arguments";
2412
+ invalid_return_type: "invalid_return_type";
2413
+ invalid_date: "invalid_date";
2414
+ invalid_string: "invalid_string";
2415
+ invalid_intersection_types: "invalid_intersection_types";
2416
+ not_finite: "not_finite";
2417
+ };
2418
+ type ZodIssueCode = keyof typeof ZodIssueCode;
2419
+ type ZodIssueBase = {
2420
+ path: (string | number)[];
2421
+ message?: string | undefined;
2422
+ };
2423
+ interface ZodInvalidTypeIssue extends ZodIssueBase {
2424
+ code: typeof ZodIssueCode.invalid_type;
2425
+ expected: ZodParsedType;
2426
+ received: ZodParsedType;
2427
+ }
2428
+ interface ZodInvalidLiteralIssue extends ZodIssueBase {
2429
+ code: typeof ZodIssueCode.invalid_literal;
2430
+ expected: unknown;
2431
+ received: unknown;
2432
+ }
2433
+ interface ZodUnrecognizedKeysIssue extends ZodIssueBase {
2434
+ code: typeof ZodIssueCode.unrecognized_keys;
2435
+ keys: string[];
2436
+ }
2437
+ interface ZodInvalidUnionIssue extends ZodIssueBase {
2438
+ code: typeof ZodIssueCode.invalid_union;
2439
+ unionErrors: ZodError[];
2440
+ }
2441
+ interface ZodInvalidUnionDiscriminatorIssue extends ZodIssueBase {
2442
+ code: typeof ZodIssueCode.invalid_union_discriminator;
2443
+ options: Primitive[];
2444
+ }
2445
+ interface ZodInvalidEnumValueIssue extends ZodIssueBase {
2446
+ received: string | number;
2447
+ code: typeof ZodIssueCode.invalid_enum_value;
2448
+ options: (string | number)[];
2449
+ }
2450
+ interface ZodInvalidArgumentsIssue extends ZodIssueBase {
2451
+ code: typeof ZodIssueCode.invalid_arguments;
2452
+ argumentsError: ZodError;
2453
+ }
2454
+ interface ZodInvalidReturnTypeIssue extends ZodIssueBase {
2455
+ code: typeof ZodIssueCode.invalid_return_type;
2456
+ returnTypeError: ZodError;
2457
+ }
2458
+ interface ZodInvalidDateIssue extends ZodIssueBase {
2459
+ code: typeof ZodIssueCode.invalid_date;
2460
+ }
2461
+ type StringValidation = "email" | "url" | "emoji" | "uuid" | "nanoid" | "regex" | "cuid" | "cuid2" | "ulid" | "datetime" | "date" | "time" | "duration" | "ip" | "cidr" | "base64" | "jwt" | "base64url" | {
2462
+ includes: string;
2463
+ position?: number | undefined;
2464
+ } | {
2465
+ startsWith: string;
2466
+ } | {
2467
+ endsWith: string;
2468
+ };
2469
+ interface ZodInvalidStringIssue extends ZodIssueBase {
2470
+ code: typeof ZodIssueCode.invalid_string;
2471
+ validation: StringValidation;
2472
+ }
2473
+ interface ZodTooSmallIssue extends ZodIssueBase {
2474
+ code: typeof ZodIssueCode.too_small;
2475
+ minimum: number | bigint;
2476
+ inclusive: boolean;
2477
+ exact?: boolean;
2478
+ type: "array" | "string" | "number" | "set" | "date" | "bigint";
2479
+ }
2480
+ interface ZodTooBigIssue extends ZodIssueBase {
2481
+ code: typeof ZodIssueCode.too_big;
2482
+ maximum: number | bigint;
2483
+ inclusive: boolean;
2484
+ exact?: boolean;
2485
+ type: "array" | "string" | "number" | "set" | "date" | "bigint";
2486
+ }
2487
+ interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase {
2488
+ code: typeof ZodIssueCode.invalid_intersection_types;
2489
+ }
2490
+ interface ZodNotMultipleOfIssue extends ZodIssueBase {
2491
+ code: typeof ZodIssueCode.not_multiple_of;
2492
+ multipleOf: number | bigint;
2493
+ }
2494
+ interface ZodNotFiniteIssue extends ZodIssueBase {
2495
+ code: typeof ZodIssueCode.not_finite;
2496
+ }
2497
+ interface ZodCustomIssue extends ZodIssueBase {
2498
+ code: typeof ZodIssueCode.custom;
2499
+ params?: {
2500
+ [k: string]: any;
2501
+ };
2502
+ }
2503
+ type ZodIssueOptionalMessage = ZodInvalidTypeIssue | ZodInvalidLiteralIssue | ZodUnrecognizedKeysIssue | ZodInvalidUnionIssue | ZodInvalidUnionDiscriminatorIssue | ZodInvalidEnumValueIssue | ZodInvalidArgumentsIssue | ZodInvalidReturnTypeIssue | ZodInvalidDateIssue | ZodInvalidStringIssue | ZodTooSmallIssue | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue | ZodNotFiniteIssue | ZodCustomIssue;
2504
+ type ZodIssue = ZodIssueOptionalMessage & {
2505
+ fatal?: boolean | undefined;
2506
+ message: string;
2507
+ };
2508
+ type recursiveZodFormattedError<T> = T extends [any, ...any[]] ? { [K in keyof T]?: ZodFormattedError<T[K]>; } : T extends any[] ? {
2509
+ [k: number]: ZodFormattedError<T[number]>;
2510
+ } : T extends object ? { [K in keyof T]?: ZodFormattedError<T[K]>; } : unknown;
2511
+ type ZodFormattedError<T, U = string> = {
2512
+ _errors: U[];
2513
+ } & recursiveZodFormattedError<NonNullable<T>>;
2514
+ declare class ZodError<T = any> extends Error {
2515
+ issues: ZodIssue[];
2516
+ get errors(): ZodIssue[];
2517
+ constructor(issues: ZodIssue[]);
2518
+ format(): ZodFormattedError<T>;
2519
+ format<U>(mapper: (issue: ZodIssue) => U): ZodFormattedError<T, U>;
2520
+ static create: (issues: ZodIssue[]) => ZodError<any>;
2521
+ static assert(value: unknown): asserts value is ZodError;
2522
+ toString(): string;
2523
+ get message(): string;
2524
+ get isEmpty(): boolean;
2525
+ addIssue: (sub: ZodIssue) => void;
2526
+ addIssues: (subs?: ZodIssue[]) => void;
2527
+ flatten(): typeToFlattenedError<T>;
2528
+ flatten<U>(mapper?: (issue: ZodIssue) => U): typeToFlattenedError<T, U>;
2529
+ get formErrors(): typeToFlattenedError<T, string>;
2530
+ }
2531
+ type stripPath<T extends object> = T extends any ? util.OmitKeys<T, "path"> : never;
2532
+ type IssueData = stripPath<ZodIssueOptionalMessage> & {
2533
+ path?: (string | number)[];
2534
+ fatal?: boolean | undefined;
2535
+ };
2536
+ type ErrorMapCtx = {
2537
+ defaultError: string;
2538
+ data: any;
2539
+ };
2540
+ type ZodErrorMap = (issue: ZodIssueOptionalMessage, _ctx: ErrorMapCtx) => {
2541
+ message: string;
2542
+ };
2543
+ //#endregion
2544
+ //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/helpers/parseUtil.d.cts
2545
+ type ParseParams = {
2546
+ path: (string | number)[];
2547
+ errorMap: ZodErrorMap;
2548
+ async: boolean;
2549
+ };
2550
+ type ParsePathComponent = string | number;
2551
+ type ParsePath = ParsePathComponent[];
2552
+ interface ParseContext {
2553
+ readonly common: {
2554
+ readonly issues: ZodIssue[];
2555
+ readonly contextualErrorMap?: ZodErrorMap | undefined;
2556
+ readonly async: boolean;
2557
+ };
2558
+ readonly path: ParsePath;
2559
+ readonly schemaErrorMap?: ZodErrorMap | undefined;
2560
+ readonly parent: ParseContext | null;
2561
+ readonly data: any;
2562
+ readonly parsedType: ZodParsedType;
2563
+ }
2564
+ type ParseInput = {
2565
+ data: any;
2566
+ path: (string | number)[];
2567
+ parent: ParseContext;
2568
+ };
2569
+ declare class ParseStatus {
2570
+ value: "aborted" | "dirty" | "valid";
2571
+ dirty(): void;
2572
+ abort(): void;
2573
+ static mergeArray(status: ParseStatus, results: SyncParseReturnType<any>[]): SyncParseReturnType;
2574
+ static mergeObjectAsync(status: ParseStatus, pairs: {
2575
+ key: ParseReturnType<any>;
2576
+ value: ParseReturnType<any>;
2577
+ }[]): Promise<SyncParseReturnType<any>>;
2578
+ static mergeObjectSync(status: ParseStatus, pairs: {
2579
+ key: SyncParseReturnType<any>;
2580
+ value: SyncParseReturnType<any>;
2581
+ alwaysSet?: boolean;
2582
+ }[]): SyncParseReturnType;
2583
+ }
2584
+ type INVALID = {
2585
+ status: "aborted";
2586
+ };
2587
+ declare const INVALID: INVALID;
2588
+ type DIRTY<T> = {
2589
+ status: "dirty";
2590
+ value: T;
2591
+ };
2592
+ declare const DIRTY: <T>(value: T) => DIRTY<T>;
2593
+ type OK<T> = {
2594
+ status: "valid";
2595
+ value: T;
2596
+ };
2597
+ declare const OK: <T>(value: T) => OK<T>;
2598
+ type SyncParseReturnType<T = any> = OK<T> | DIRTY<T> | INVALID;
2599
+ type AsyncParseReturnType<T> = Promise<SyncParseReturnType<T>>;
2600
+ type ParseReturnType<T> = SyncParseReturnType<T> | AsyncParseReturnType<T>;
2601
+ //#endregion
2602
+ //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/helpers/errorUtil.d.cts
2603
+ declare namespace errorUtil {
2604
+ type ErrMessage = string | {
2605
+ message?: string | undefined;
2606
+ };
2607
+ const errToObj: (message?: ErrMessage) => {
2608
+ message?: string | undefined;
2609
+ };
2610
+ const toString: (message?: ErrMessage) => string | undefined;
2611
+ }
2612
+ //#endregion
2613
+ //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/standard-schema.d.cts
2614
+ /**
2615
+ * The Standard Schema interface.
2616
+ */
2617
+ type StandardSchemaV1<Input = unknown, Output = Input> = {
2618
+ /**
2619
+ * The Standard Schema properties.
2620
+ */
2621
+ readonly "~standard": StandardSchemaV1.Props<Input, Output>;
2622
+ };
2623
+ declare namespace StandardSchemaV1 {
2624
+ /**
2625
+ * The Standard Schema properties interface.
2626
+ */
2627
+ export interface Props<Input = unknown, Output = Input> {
2628
+ /**
2629
+ * The version number of the standard.
2630
+ */
2631
+ readonly version: 1;
2632
+ /**
2633
+ * The vendor name of the schema library.
2634
+ */
2635
+ readonly vendor: string;
2636
+ /**
2637
+ * Validates unknown input values.
2638
+ */
2639
+ readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
2640
+ /**
2641
+ * Inferred types associated with the schema.
2642
+ */
2643
+ readonly types?: Types<Input, Output> | undefined;
2644
+ }
2645
+ /**
2646
+ * The result interface of the validate function.
2647
+ */
2648
+ export type Result<Output> = SuccessResult<Output> | FailureResult;
2649
+ /**
2650
+ * The result interface if validation succeeds.
2651
+ */
2652
+ export interface SuccessResult<Output> {
2653
+ /**
2654
+ * The typed output value.
2655
+ */
2656
+ readonly value: Output;
2657
+ /**
2658
+ * The non-existent issues.
2659
+ */
2660
+ readonly issues?: undefined;
2661
+ }
2662
+ /**
2663
+ * The result interface if validation fails.
2664
+ */
2665
+ export interface FailureResult {
2666
+ /**
2667
+ * The issues of failed validation.
2668
+ */
2669
+ readonly issues: ReadonlyArray<Issue>;
2670
+ }
2671
+ /**
2672
+ * The issue interface of the failure output.
2673
+ */
2674
+ export interface Issue {
2675
+ /**
2676
+ * The error message of the issue.
2677
+ */
2678
+ readonly message: string;
2679
+ /**
2680
+ * The path of the issue, if any.
2681
+ */
2682
+ readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
2683
+ }
2684
+ /**
2685
+ * The path segment interface of the issue.
2686
+ */
2687
+ export interface PathSegment {
2688
+ /**
2689
+ * The key representing a path segment.
2690
+ */
2691
+ readonly key: PropertyKey;
2692
+ }
2693
+ /**
2694
+ * The Standard Schema types interface.
2695
+ */
2696
+ export interface Types<Input = unknown, Output = Input> {
2697
+ /**
2698
+ * The input type of the schema.
2699
+ */
2700
+ readonly input: Input;
2701
+ /**
2702
+ * The output type of the schema.
2703
+ */
2704
+ readonly output: Output;
2705
+ }
2706
+ /**
2707
+ * Infers the input type of a Standard Schema.
2708
+ */
2709
+ export type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["input"];
2710
+ /**
2711
+ * Infers the output type of a Standard Schema.
2712
+ */
2713
+ export type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
2714
+ export {};
2715
+ }
2716
+ //#endregion
2717
+ //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/types.d.cts
2718
+ interface RefinementCtx {
2719
+ addIssue: (arg: IssueData) => void;
2720
+ path: (string | number)[];
2721
+ }
2722
+ type ZodTypeAny = ZodType<any, any, any>;
2723
+ type input$1<T extends ZodType<any, any, any>> = T["_input"];
2724
+ type output<T extends ZodType<any, any, any>> = T["_output"];
2725
+ type CustomErrorParams = Partial<util.Omit<ZodCustomIssue, "code">>;
2726
+ interface ZodTypeDef {
2727
+ errorMap?: ZodErrorMap | undefined;
2728
+ description?: string | undefined;
2729
+ }
2730
+ type RawCreateParams = {
2731
+ errorMap?: ZodErrorMap | undefined;
2732
+ invalid_type_error?: string | undefined;
2733
+ required_error?: string | undefined;
2734
+ message?: string | undefined;
2735
+ description?: string | undefined;
2736
+ } | undefined;
2737
+ type SafeParseSuccess<Output> = {
2738
+ success: true;
2739
+ data: Output;
2740
+ error?: never;
2741
+ };
2742
+ type SafeParseError<Input> = {
2743
+ success: false;
2744
+ error: ZodError<Input>;
2745
+ data?: never;
2746
+ };
2747
+ type SafeParseReturnType<Input, Output> = SafeParseSuccess<Output> | SafeParseError<Input>;
2748
+ declare abstract class ZodType<Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output> {
2749
+ readonly _type: Output;
2750
+ readonly _output: Output;
2751
+ readonly _input: Input;
2752
+ readonly _def: Def;
2753
+ get description(): string | undefined;
2754
+ "~standard": StandardSchemaV1.Props<Input, Output>;
2755
+ abstract _parse(input: ParseInput): ParseReturnType<Output>;
2756
+ _getType(input: ParseInput): string;
2757
+ _getOrReturnCtx(input: ParseInput, ctx?: ParseContext | undefined): ParseContext;
2758
+ _processInputParams(input: ParseInput): {
2759
+ status: ParseStatus;
2760
+ ctx: ParseContext;
2761
+ };
2762
+ _parseSync(input: ParseInput): SyncParseReturnType<Output>;
2763
+ _parseAsync(input: ParseInput): AsyncParseReturnType<Output>;
2764
+ parse(data: unknown, params?: util.InexactPartial<ParseParams>): Output;
2765
+ safeParse(data: unknown, params?: util.InexactPartial<ParseParams>): SafeParseReturnType<Input, Output>;
2766
+ "~validate"(data: unknown): StandardSchemaV1.Result<Output> | Promise<StandardSchemaV1.Result<Output>>;
2767
+ parseAsync(data: unknown, params?: util.InexactPartial<ParseParams>): Promise<Output>;
2768
+ safeParseAsync(data: unknown, params?: util.InexactPartial<ParseParams>): Promise<SafeParseReturnType<Input, Output>>;
2769
+ /** Alias of safeParseAsync */
2770
+ spa: (data: unknown, params?: util.InexactPartial<ParseParams>) => Promise<SafeParseReturnType<Input, Output>>;
2771
+ refine<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, RefinedOutput, Input>;
2772
+ refine(check: (arg: Output) => unknown | Promise<unknown>, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, Output, Input>;
2773
+ refinement<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, RefinedOutput, Input>;
2774
+ refinement(check: (arg: Output) => boolean, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, Output, Input>;
2775
+ _refinement(refinement: RefinementEffect<Output>["refinement"]): ZodEffects<this, Output, Input>;
2776
+ superRefine<RefinedOutput extends Output>(refinement: (arg: Output, ctx: RefinementCtx) => arg is RefinedOutput): ZodEffects<this, RefinedOutput, Input>;
2777
+ superRefine(refinement: (arg: Output, ctx: RefinementCtx) => void): ZodEffects<this, Output, Input>;
2778
+ superRefine(refinement: (arg: Output, ctx: RefinementCtx) => Promise<void>): ZodEffects<this, Output, Input>;
2779
+ constructor(def: Def);
2780
+ optional(): ZodOptional<this>;
2781
+ nullable(): ZodNullable<this>;
2782
+ nullish(): ZodOptional<ZodNullable<this>>;
2783
+ array(): ZodArray<this>;
2784
+ promise(): ZodPromise<this>;
2785
+ or<T extends ZodTypeAny>(option: T): ZodUnion<[this, T]>;
2786
+ and<T extends ZodTypeAny>(incoming: T): ZodIntersection<this, T>;
2787
+ transform<NewOut>(transform: (arg: Output, ctx: RefinementCtx) => NewOut | Promise<NewOut>): ZodEffects<this, NewOut>;
2788
+ default(def: util.noUndefined<Input>): ZodDefault<this>;
2789
+ default(def: () => util.noUndefined<Input>): ZodDefault<this>;
2790
+ brand<B extends string | number | symbol>(brand?: B): ZodBranded<this, B>;
2791
+ catch(def: Output): ZodCatch<this>;
2792
+ catch(def: (ctx: {
2793
+ error: ZodError;
2794
+ input: Input;
2795
+ }) => Output): ZodCatch<this>;
2796
+ describe(description: string): this;
2797
+ pipe<T extends ZodTypeAny>(target: T): ZodPipeline<this, T>;
2798
+ readonly(): ZodReadonly<this>;
2799
+ isOptional(): boolean;
2800
+ isNullable(): boolean;
2801
+ }
2802
+ interface ZodArrayDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
2803
+ type: T;
2804
+ typeName: ZodFirstPartyTypeKind.ZodArray;
2805
+ exactLength: {
2806
+ value: number;
2807
+ message?: string | undefined;
2808
+ } | null;
2809
+ minLength: {
2810
+ value: number;
2811
+ message?: string | undefined;
2812
+ } | null;
2813
+ maxLength: {
2814
+ value: number;
2815
+ message?: string | undefined;
2816
+ } | null;
2817
+ }
2818
+ type ArrayCardinality = "many" | "atleastone";
2819
+ type arrayOutputType<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> = Cardinality extends "atleastone" ? [T["_output"], ...T["_output"][]] : T["_output"][];
2820
+ declare class ZodArray<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> extends ZodType<arrayOutputType<T, Cardinality>, ZodArrayDef<T>, Cardinality extends "atleastone" ? [T["_input"], ...T["_input"][]] : T["_input"][]> {
2821
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
2822
+ get element(): T;
2823
+ min(minLength: number, message?: errorUtil.ErrMessage): this;
2824
+ max(maxLength: number, message?: errorUtil.ErrMessage): this;
2825
+ length(len: number, message?: errorUtil.ErrMessage): this;
2826
+ nonempty(message?: errorUtil.ErrMessage): ZodArray<T, "atleastone">;
2827
+ static create: <El extends ZodTypeAny>(schema: El, params?: RawCreateParams) => ZodArray<El>;
2828
+ }
2829
+ type ZodUnionOptions = Readonly<[ZodTypeAny, ...ZodTypeAny[]]>;
2830
+ interface ZodUnionDef<T extends ZodUnionOptions = Readonly<[ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>> extends ZodTypeDef {
2831
+ options: T;
2832
+ typeName: ZodFirstPartyTypeKind.ZodUnion;
2833
+ }
2834
+ declare class ZodUnion<T extends ZodUnionOptions> extends ZodType<T[number]["_output"], ZodUnionDef<T>, T[number]["_input"]> {
2835
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
2836
+ get options(): T;
2837
+ static create: <Options extends Readonly<[ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>>(types: Options, params?: RawCreateParams) => ZodUnion<Options>;
2838
+ }
2839
+ interface ZodIntersectionDef<T extends ZodTypeAny = ZodTypeAny, U extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
2840
+ left: T;
2841
+ right: U;
2842
+ typeName: ZodFirstPartyTypeKind.ZodIntersection;
2843
+ }
2844
+ declare class ZodIntersection<T extends ZodTypeAny, U extends ZodTypeAny> extends ZodType<T["_output"] & U["_output"], ZodIntersectionDef<T, U>, T["_input"] & U["_input"]> {
2845
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
2846
+ static create: <TSchema extends ZodTypeAny, USchema extends ZodTypeAny>(left: TSchema, right: USchema, params?: RawCreateParams) => ZodIntersection<TSchema, USchema>;
2847
+ }
2848
+ interface ZodPromiseDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
2849
+ type: T;
2850
+ typeName: ZodFirstPartyTypeKind.ZodPromise;
2851
+ }
2852
+ declare class ZodPromise<T extends ZodTypeAny> extends ZodType<Promise<T["_output"]>, ZodPromiseDef<T>, Promise<T["_input"]>> {
2853
+ unwrap(): T;
2854
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
2855
+ static create: <Inner extends ZodTypeAny>(schema: Inner, params?: RawCreateParams) => ZodPromise<Inner>;
2856
+ }
2857
+ type RefinementEffect<T> = {
2858
+ type: "refinement";
2859
+ refinement: (arg: T, ctx: RefinementCtx) => any;
2860
+ };
2861
+ type TransformEffect<T> = {
2862
+ type: "transform";
2863
+ transform: (arg: T, ctx: RefinementCtx) => any;
2864
+ };
2865
+ type PreprocessEffect<T> = {
2866
+ type: "preprocess";
2867
+ transform: (arg: T, ctx: RefinementCtx) => any;
2868
+ };
2869
+ type Effect<T> = RefinementEffect<T> | TransformEffect<T> | PreprocessEffect<T>;
2870
+ interface ZodEffectsDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
2871
+ schema: T;
2872
+ typeName: ZodFirstPartyTypeKind.ZodEffects;
2873
+ effect: Effect<any>;
2874
+ }
2875
+ declare class ZodEffects<T extends ZodTypeAny, Output = output<T>, Input = input$1<T>> extends ZodType<Output, ZodEffectsDef<T>, Input> {
2876
+ innerType(): T;
2877
+ sourceType(): T;
2878
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
2879
+ static create: <I extends ZodTypeAny>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"]>;
2880
+ static createWithPreprocess: <I extends ZodTypeAny>(preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, schema: I, params?: RawCreateParams) => ZodEffects<I, I["_output"], unknown>;
2881
+ }
2882
+ interface ZodOptionalDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
2883
+ innerType: T;
2884
+ typeName: ZodFirstPartyTypeKind.ZodOptional;
2885
+ }
2886
+ declare class ZodOptional<T extends ZodTypeAny> extends ZodType<T["_output"] | undefined, ZodOptionalDef<T>, T["_input"] | undefined> {
2887
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
2888
+ unwrap(): T;
2889
+ static create: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodOptional<Inner>;
2890
+ }
2891
+ interface ZodNullableDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
2892
+ innerType: T;
2893
+ typeName: ZodFirstPartyTypeKind.ZodNullable;
2894
+ }
2895
+ declare class ZodNullable<T extends ZodTypeAny> extends ZodType<T["_output"] | null, ZodNullableDef<T>, T["_input"] | null> {
2896
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
2897
+ unwrap(): T;
2898
+ static create: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodNullable<Inner>;
2899
+ }
2900
+ interface ZodDefaultDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
2901
+ innerType: T;
2902
+ defaultValue: () => util.noUndefined<T["_input"]>;
2903
+ typeName: ZodFirstPartyTypeKind.ZodDefault;
2904
+ }
2905
+ declare class ZodDefault<T extends ZodTypeAny> extends ZodType<util.noUndefined<T["_output"]>, ZodDefaultDef<T>, T["_input"] | undefined> {
2906
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
2907
+ removeDefault(): T;
2908
+ static create: <Inner extends ZodTypeAny>(type: Inner, params: RawCreateParams & {
2909
+ default: Inner["_input"] | (() => util.noUndefined<Inner["_input"]>);
2910
+ }) => ZodDefault<Inner>;
2911
+ }
2912
+ interface ZodCatchDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
2913
+ innerType: T;
2914
+ catchValue: (ctx: {
2915
+ error: ZodError;
2916
+ input: unknown;
2917
+ }) => T["_input"];
2918
+ typeName: ZodFirstPartyTypeKind.ZodCatch;
2919
+ }
2920
+ declare class ZodCatch<T extends ZodTypeAny> extends ZodType<T["_output"], ZodCatchDef<T>, unknown> {
2921
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
2922
+ removeCatch(): T;
2923
+ static create: <Inner extends ZodTypeAny>(type: Inner, params: RawCreateParams & {
2924
+ catch: Inner["_output"] | (() => Inner["_output"]);
2925
+ }) => ZodCatch<Inner>;
2926
+ }
2927
+ interface ZodBrandedDef<T extends ZodTypeAny> extends ZodTypeDef {
2928
+ type: T;
2929
+ typeName: ZodFirstPartyTypeKind.ZodBranded;
2930
+ }
2931
+ declare const BRAND: unique symbol;
2932
+ type BRAND<T extends string | number | symbol> = {
2933
+ [BRAND]: { [k in T]: true; };
2934
+ };
2935
+ declare class ZodBranded<T extends ZodTypeAny, B extends string | number | symbol> extends ZodType<T["_output"] & BRAND<B>, ZodBrandedDef<T>, T["_input"]> {
2936
+ _parse(input: ParseInput): ParseReturnType<any>;
2937
+ unwrap(): T;
2938
+ }
2939
+ interface ZodPipelineDef<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodTypeDef {
2940
+ in: A;
2941
+ out: B;
2942
+ typeName: ZodFirstPartyTypeKind.ZodPipeline;
2943
+ }
2944
+ declare class ZodPipeline<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodType<B["_output"], ZodPipelineDef<A, B>, A["_input"]> {
2945
+ _parse(input: ParseInput): ParseReturnType<any>;
2946
+ static create<ASchema extends ZodTypeAny, BSchema extends ZodTypeAny>(a: ASchema, b: BSchema): ZodPipeline<ASchema, BSchema>;
2947
+ }
2948
+ type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | {
2949
+ readonly [Symbol.toStringTag]: string;
2950
+ } | Date | Error | Generator | Promise<unknown> | RegExp;
2951
+ type MakeReadonly<T> = T extends Map<infer K, infer V> ? ReadonlyMap<K, V> : T extends Set<infer V> ? ReadonlySet<V> : T extends [infer Head, ...infer Tail] ? readonly [Head, ...Tail] : T extends Array<infer V> ? ReadonlyArray<V> : T extends BuiltIn ? T : Readonly<T>;
2952
+ interface ZodReadonlyDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
2953
+ innerType: T;
2954
+ typeName: ZodFirstPartyTypeKind.ZodReadonly;
2955
+ }
2956
+ declare class ZodReadonly<T extends ZodTypeAny> extends ZodType<MakeReadonly<T["_output"]>, ZodReadonlyDef<T>, MakeReadonly<T["_input"]>> {
2957
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
2958
+ static create: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodReadonly<Inner>;
2959
+ unwrap(): T;
2960
+ }
2961
+ declare enum ZodFirstPartyTypeKind {
2962
+ ZodString = "ZodString",
2963
+ ZodNumber = "ZodNumber",
2964
+ ZodNaN = "ZodNaN",
2965
+ ZodBigInt = "ZodBigInt",
2966
+ ZodBoolean = "ZodBoolean",
2967
+ ZodDate = "ZodDate",
2968
+ ZodSymbol = "ZodSymbol",
2969
+ ZodUndefined = "ZodUndefined",
2970
+ ZodNull = "ZodNull",
2971
+ ZodAny = "ZodAny",
2972
+ ZodUnknown = "ZodUnknown",
2973
+ ZodNever = "ZodNever",
2974
+ ZodVoid = "ZodVoid",
2975
+ ZodArray = "ZodArray",
2976
+ ZodObject = "ZodObject",
2977
+ ZodUnion = "ZodUnion",
2978
+ ZodDiscriminatedUnion = "ZodDiscriminatedUnion",
2979
+ ZodIntersection = "ZodIntersection",
2980
+ ZodTuple = "ZodTuple",
2981
+ ZodRecord = "ZodRecord",
2982
+ ZodMap = "ZodMap",
2983
+ ZodSet = "ZodSet",
2984
+ ZodFunction = "ZodFunction",
2985
+ ZodLazy = "ZodLazy",
2986
+ ZodLiteral = "ZodLiteral",
2987
+ ZodEnum = "ZodEnum",
2988
+ ZodEffects = "ZodEffects",
2989
+ ZodNativeEnum = "ZodNativeEnum",
2990
+ ZodOptional = "ZodOptional",
2991
+ ZodNullable = "ZodNullable",
2992
+ ZodDefault = "ZodDefault",
2993
+ ZodCatch = "ZodCatch",
2994
+ ZodPromise = "ZodPromise",
2995
+ ZodBranded = "ZodBranded",
2996
+ ZodPipeline = "ZodPipeline",
2997
+ ZodReadonly = "ZodReadonly"
2998
+ }
2999
+ //#endregion
3000
+ //#region node_modules/.pnpm/@ai-sdk+provider-utils@5.0.9_zod@4.4.3/node_modules/@ai-sdk/provider-utils/dist/index.d.ts
3001
+ /**
3002
+ * Data content. Can either be a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer.
3003
+ */
3004
+ type DataContent = string | Uint8Array | ArrayBuffer | Buffer;
3005
+ /**
3006
+ * File data variant containing raw bytes (`Uint8Array`, `ArrayBuffer`, or
3007
+ * `Buffer`) or a base64-encoded string.
3008
+ *
3009
+ * This is slightly more permissive than `SharedV4FileDataData`.
3010
+ */
3011
+ interface FileDataData {
3012
+ type: 'data';
3013
+ data: DataContent;
3014
+ }
3015
+ /**
3016
+ * File data variant containing a URL that points to the file.
3017
+ */
3018
+ type FileDataUrl = SharedV4FileDataUrl;
3019
+ /**
3020
+ * File data variant containing a provider reference (`{ [provider]: id }`).
3021
+ */
3022
+ type FileDataReference = SharedV4FileDataReference;
3023
+ /**
3024
+ * File data variant containing inline text content (e.g. an inline text
3025
+ * document).
3026
+ */
3027
+ type FileDataText = SharedV4FileDataText;
3028
+ /**
3029
+ * File data as a tagged discriminated union:
3030
+ *
3031
+ * - `{ type: 'data', data }`: raw bytes (`Uint8Array`, `ArrayBuffer`, or
3032
+ * `Buffer`) or a base64-encoded string.
3033
+ * - `{ type: 'url', url }`: a URL that points to the file.
3034
+ * - `{ type: 'reference', reference }`: a provider reference (`{ [provider]: id }`).
3035
+ * - `{ type: 'text', text }`: inline text content (e.g. an inline text document).
3036
+ */
3037
+ type FileData = FileDataData | FileDataUrl | FileDataReference | FileDataText;
3038
+ /**
3039
+ * Additional provider-specific options.
3040
+ *
3041
+ * They are passed through to the provider from the AI SDK and enable
3042
+ * provider-specific functionality that can be fully encapsulated in the provider.
3043
+ */
3044
+ type ProviderOptions = SharedV4ProviderOptions;
3045
+ /**
3046
+ * A mapping of provider names to provider-specific file identifiers.
3047
+ *
3048
+ * Provider references allow files to be identified across different
3049
+ * providers without re-uploading, by storing each provider's own
3050
+ * identifier for the same logical file.
3051
+ */
3052
+ type ProviderReference = SharedV4ProviderReference;
3053
+ /**
3054
+ * Text content part of a prompt. It contains a string of text.
3055
+ */
3056
+ interface TextPart {
3057
+ type: 'text';
3058
+ /**
3059
+ * The text content.
3060
+ */
3061
+ text: string;
3062
+ /**
3063
+ * Additional provider-specific metadata. They are passed through
3064
+ * to the provider from the AI SDK and enable provider-specific
3065
+ * functionality that can be fully encapsulated in the provider.
3066
+ */
3067
+ providerOptions?: ProviderOptions;
3068
+ }
3069
+ /**
3070
+ * Image content part of a prompt. It contains an image.
3071
+ *
3072
+ * @deprecated Use `FilePart` with `mediaType: 'image'` instead:
3073
+ * `{ type: 'file', mediaType: 'image', data: { type: 'data', data } }`.
3074
+ */
3075
+ interface ImagePart {
3076
+ type: 'image';
3077
+ /**
3078
+ * Image data. Can either be:
3079
+ *
3080
+ * - data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer
3081
+ * - URL: a URL that points to the image
3082
+ * - ProviderReference: a provider reference from `uploadFile`
3083
+ */
3084
+ image: DataContent | URL | ProviderReference;
3085
+ /**
3086
+ * Optional IANA media type of the image.
3087
+ *
3088
+ * @see https://www.iana.org/assignments/media-types/media-types.xhtml
3089
+ */
3090
+ mediaType?: string;
3091
+ /**
3092
+ * Additional provider-specific metadata. They are passed through
3093
+ * to the provider from the AI SDK and enable provider-specific
3094
+ * functionality that can be fully encapsulated in the provider.
3095
+ */
3096
+ providerOptions?: ProviderOptions;
3097
+ }
3098
+ /**
3099
+ * File content part of a prompt. It contains a file.
3100
+ */
3101
+ interface FilePart {
3102
+ type: 'file';
3103
+ /**
3104
+ * File data. Either a tagged shape or a bare shorthand:
3105
+ *
3106
+ * - `{ type: 'data', data }` or bare `DataContent`: raw bytes
3107
+ * (base64 string, Uint8Array, ArrayBuffer, Buffer)
3108
+ * - `{ type: 'url', url }` or bare `URL`: a URL that points to the file
3109
+ * - `{ type: 'reference', reference }` or bare `ProviderReference`:
3110
+ * a provider reference from `uploadFile`
3111
+ * - `{ type: 'text', text }`: inline text content (tagged only)
3112
+ */
3113
+ data: FileData | DataContent | URL | ProviderReference;
3114
+ /**
3115
+ * Optional filename of the file.
3116
+ */
3117
+ filename?: string;
3118
+ /**
3119
+ * Either a full IANA media type (`type/subtype`, e.g. `image/png`) or just
3120
+ * the top-level IANA segment (e.g. `image`, `audio`, `video`, `text`).
3121
+ *
3122
+ * `*`-subtype wildcards (e.g. `image/*`) are normalized as equivalent to the
3123
+ * top-level segment alone (e.g. `image`). Providers can use the helpers in
3124
+ * `@ai-sdk/provider-utils` (`isFullMediaType`, `getTopLevelMediaType`,
3125
+ * `detectMediaType`) to resolve the field according to their API
3126
+ * requirements.
3127
+ *
3128
+ * @see https://www.iana.org/assignments/media-types/media-types.xhtml
3129
+ */
3130
+ mediaType: string;
3131
+ /**
3132
+ * Additional provider-specific metadata. They are passed through
3133
+ * to the provider from the AI SDK and enable provider-specific
3134
+ * functionality that can be fully encapsulated in the provider.
3135
+ */
3136
+ providerOptions?: ProviderOptions;
3137
+ }
3138
+ /**
3139
+ * Reasoning content part of a prompt. It contains a reasoning.
3140
+ */
3141
+ interface ReasoningPart {
3142
+ type: 'reasoning';
3143
+ /**
3144
+ * The reasoning text.
3145
+ */
3146
+ text: string;
3147
+ /**
3148
+ * Additional provider-specific metadata. They are passed through
3149
+ * to the provider from the AI SDK and enable provider-specific
3150
+ * functionality that can be fully encapsulated in the provider.
3151
+ */
3152
+ providerOptions?: ProviderOptions;
3153
+ }
3154
+ /**
3155
+ * Custom content part of a prompt. It contains no standardized payload beyond
3156
+ * provider-specific options.
3157
+ */
3158
+ interface CustomPart {
3159
+ type: 'custom';
3160
+ /**
3161
+ * The kind of custom content, in the format `{provider}.{provider-type}`.
3162
+ */
3163
+ kind: `${string}.${string}`;
3164
+ /**
3165
+ * Additional provider-specific metadata. They are passed through
3166
+ * to the provider from the AI SDK and enable provider-specific
3167
+ * functionality that can be fully encapsulated in the provider.
3168
+ */
3169
+ providerOptions?: ProviderOptions;
3170
+ }
3171
+ /**
3172
+ * Reasoning file content part of a prompt. It contains a file generated as part of reasoning.
3173
+ */
3174
+ interface ReasoningFilePart {
3175
+ type: 'reasoning-file';
3176
+ /**
3177
+ * Reasoning file data.
3178
+ *
3179
+ * Reasoning files originate from a model's reasoning output and are always
3180
+ * raw bytes or a fetchable URL. Unlike `FilePart.data`, the `reference` and
3181
+ * `text` shapes are not supported here: provider references describe files
3182
+ * uploaded by the user (not produced as model output), and reasoning text is
3183
+ * carried by `ReasoningPart` rather than as a file.
3184
+ *
3185
+ * Either a tagged shape or a bare shorthand:
3186
+ *
3187
+ * - `{ type: 'data', data }` or bare `DataContent`: raw bytes
3188
+ * (base64 string, Uint8Array, ArrayBuffer, Buffer)
3189
+ * - `{ type: 'url', url }` or bare `URL`: a URL that points to the file
3190
+ */
3191
+ data: FileDataData | FileDataUrl | DataContent | URL;
3192
+ /**
3193
+ * IANA media type of the file.
3194
+ *
3195
+ * @see https://www.iana.org/assignments/media-types/media-types.xhtml
3196
+ */
3197
+ mediaType: string;
3198
+ /**
3199
+ * Additional provider-specific metadata. They are passed through
3200
+ * to the provider from the AI SDK and enable provider-specific
3201
+ * functionality that can be fully encapsulated in the provider.
3202
+ */
3203
+ providerOptions?: ProviderOptions;
3204
+ }
3205
+ /**
3206
+ * Tool call content part of a prompt. It contains a tool call (usually generated by the AI model).
3207
+ */
3208
+ interface ToolCallPart {
3209
+ type: 'tool-call';
3210
+ /**
3211
+ * ID of the tool call. This ID is used to match the tool call with the tool result.
3212
+ */
3213
+ toolCallId: string;
3214
+ /**
3215
+ * Name of the tool that is being called.
3216
+ */
3217
+ toolName: string;
3218
+ /**
3219
+ * Arguments of the tool call. This is a JSON-serializable object that matches the tool's input schema.
3220
+ */
3221
+ input: unknown;
3222
+ /**
3223
+ * Additional provider-specific metadata. They are passed through
3224
+ * to the provider from the AI SDK and enable provider-specific
3225
+ * functionality that can be fully encapsulated in the provider.
3226
+ */
3227
+ providerOptions?: ProviderOptions;
3228
+ /**
3229
+ * Whether the tool call was executed by the provider.
3230
+ */
3231
+ providerExecuted?: boolean;
3232
+ }
3233
+ /**
3234
+ * Tool result content part of a prompt. It contains the result of the tool call with the matching ID.
3235
+ */
3236
+ interface ToolResultPart {
3237
+ type: 'tool-result';
3238
+ /**
3239
+ * ID of the tool call that this result is associated with.
3240
+ */
3241
+ toolCallId: string;
3242
+ /**
3243
+ * Name of the tool that generated this result.
3244
+ */
3245
+ toolName: string;
3246
+ /**
3247
+ * Result of the tool call. This is a JSON-serializable object.
3248
+ */
3249
+ output: ToolResultOutput;
3250
+ /**
3251
+ * Additional provider-specific metadata. They are passed through
3252
+ * to the provider from the AI SDK and enable provider-specific
3253
+ * functionality that can be fully encapsulated in the provider.
3254
+ */
3255
+ providerOptions?: ProviderOptions;
3256
+ }
3257
+ /**
3258
+ * Output of a tool result.
3259
+ */
3260
+ type ToolResultOutput = {
3261
+ /**
3262
+ * Text tool output that should be directly sent to the API.
3263
+ */
3264
+ type: 'text';
3265
+ value: string;
3266
+ /**
3267
+ * Provider-specific options.
3268
+ */
3269
+ providerOptions?: ProviderOptions;
3270
+ } | {
3271
+ type: 'json';
3272
+ value: JSONValue;
3273
+ /**
3274
+ * Provider-specific options.
3275
+ */
3276
+ providerOptions?: ProviderOptions;
3277
+ } | {
3278
+ /**
3279
+ * Type when the user has denied the execution of the tool call.
3280
+ */
3281
+ type: 'execution-denied';
3282
+ /**
3283
+ * Optional reason for the execution denial.
3284
+ */
3285
+ reason?: string;
3286
+ /**
3287
+ * Provider-specific options.
3288
+ */
3289
+ providerOptions?: ProviderOptions;
3290
+ } | {
3291
+ type: 'error-text';
3292
+ value: string;
3293
+ /**
3294
+ * Provider-specific options.
3295
+ */
3296
+ providerOptions?: ProviderOptions;
3297
+ } | {
3298
+ type: 'error-json';
3299
+ value: JSONValue;
3300
+ /**
3301
+ * Provider-specific options.
3302
+ */
3303
+ providerOptions?: ProviderOptions;
3304
+ } | {
3305
+ type: 'content';
3306
+ value: Array<{
3307
+ type: 'text';
3308
+ /**
3309
+ * Text content.
3310
+ */
3311
+ text: string;
3312
+ /**
3313
+ * Provider-specific options.
3314
+ */
3315
+ providerOptions?: ProviderOptions;
3316
+ } | {
3317
+ type: 'file';
3318
+ /**
3319
+ * File data as a tagged discriminated union:
3320
+ *
3321
+ * - `{ type: 'data', data }`: raw bytes
3322
+ * (base64 string, Uint8Array, ArrayBuffer, Buffer)
3323
+ * - `{ type: 'url', url }`: a URL that points to the file
3324
+ * - `{ type: 'reference', reference }`: a provider reference
3325
+ * from `uploadFile`
3326
+ * - `{ type: 'text', text }`: inline text content (e.g. an inline
3327
+ * text document)
3328
+ */
3329
+ data: FileData;
3330
+ /**
3331
+ * Either a full IANA media type (`type/subtype`, e.g. `image/png`) or just
3332
+ * the top-level IANA segment (e.g. `image`, `audio`, `video`, `text`).
3333
+ *
3334
+ * `*`-subtype wildcards (e.g. `image/*`) are normalized as equivalent to the
3335
+ * top-level segment alone (e.g. `image`). Providers can use the helpers in
3336
+ * `@ai-sdk/provider-utils` (`isFullMediaType`, `getTopLevelMediaType`,
3337
+ * `detectMediaType`) to resolve the field according to their API
3338
+ * requirements.
3339
+ *
3340
+ * @see https://www.iana.org/assignments/media-types/media-types.xhtml
3341
+ */
3342
+ mediaType: string;
3343
+ /**
3344
+ * Optional filename of the file.
3345
+ */
3346
+ filename?: string;
3347
+ /**
3348
+ * Provider-specific options.
3349
+ */
3350
+ providerOptions?: ProviderOptions;
3351
+ } | {
3352
+ /**
3353
+ * @deprecated Use 'file' with mediaType + tagged data instead:
3354
+ * `{ type: 'file', mediaType, data: { type: 'data', data } }`.
3355
+ */
3356
+ type: 'file-data';
3357
+ /**
3358
+ * Base-64 encoded media data.
3359
+ */
3360
+ data: string;
3361
+ /**
3362
+ * IANA media type.
3363
+ * @see https://www.iana.org/assignments/media-types/media-types.xhtml
3364
+ */
3365
+ mediaType: string;
3366
+ /**
3367
+ * Optional filename of the file.
3368
+ */
3369
+ filename?: string;
3370
+ /**
3371
+ * Provider-specific options.
3372
+ */
3373
+ providerOptions?: ProviderOptions;
3374
+ } | {
3375
+ /**
3376
+ * @deprecated Use 'file' with mediaType and tagged data instead:
3377
+ * `{ type: 'file', mediaType, data: { type: 'url', url: new URL(url) } }`.
3378
+ */
3379
+ type: 'file-url';
3380
+ /**
3381
+ * URL of the file.
3382
+ */
3383
+ url: string;
3384
+ /**
3385
+ * IANA media type.
3386
+ * @see https://www.iana.org/assignments/media-types/media-types.xhtml
3387
+ */
3388
+ mediaType?: string;
3389
+ /**
3390
+ * Provider-specific options.
3391
+ */
3392
+ providerOptions?: ProviderOptions;
3393
+ } | {
3394
+ /**
3395
+ * @deprecated Use 'file' with tagged data instead:
3396
+ * `{ type: 'file', mediaType, data: { type: 'reference', reference } }`.
3397
+ */
3398
+ type: 'file-id';
3399
+ /**
3400
+ * ID of the file.
3401
+ *
3402
+ * If you use multiple providers, you need to
3403
+ * specify the provider specific ids using
3404
+ * the Record option. The key is the provider
3405
+ * name, e.g. 'openai' or 'anthropic'.
3406
+ */
3407
+ fileId: string | Record<string, string>;
3408
+ /**
3409
+ * Provider-specific options.
3410
+ */
3411
+ providerOptions?: ProviderOptions;
3412
+ } | {
3413
+ /**
3414
+ * @deprecated Use 'file' with tagged data instead:
3415
+ * `{ type: 'file', mediaType, data: { type: 'reference', reference } }`.
3416
+ */
3417
+ type: 'file-reference';
3418
+ /**
3419
+ * Provider-specific references for the file.
3420
+ * The key is the provider name, e.g. 'openai' or 'anthropic'.
3421
+ */
3422
+ providerReference: ProviderReference;
3423
+ /**
3424
+ * Provider-specific options.
3425
+ */
3426
+ providerOptions?: ProviderOptions;
3427
+ } | {
3428
+ /**
3429
+ * @deprecated Use 'file' with mediaType (e.g. 'image' or a specific
3430
+ * `image/*` subtype) and tagged data instead:
3431
+ * `{ type: 'file', mediaType: 'image', data: { type: 'data', data } }`.
3432
+ */
3433
+ type: 'image-data';
3434
+ /**
3435
+ * Base-64 encoded image data.
3436
+ */
3437
+ data: string;
3438
+ /**
3439
+ * IANA media type.
3440
+ * @see https://www.iana.org/assignments/media-types/media-types.xhtml
3441
+ */
3442
+ mediaType: string;
3443
+ /**
3444
+ * Provider-specific options.
3445
+ */
3446
+ providerOptions?: ProviderOptions;
3447
+ } | {
3448
+ /**
3449
+ * @deprecated Use 'file' with `mediaType: 'image'` (or a specific
3450
+ * `image/*` subtype) and tagged data instead:
3451
+ * `{ type: 'file', mediaType: 'image', data: { type: 'url', url: new URL(url) } }`.
3452
+ */
3453
+ type: 'image-url';
3454
+ /**
3455
+ * URL of the image.
3456
+ */
3457
+ url: string;
3458
+ /**
3459
+ * Provider-specific options.
3460
+ */
3461
+ providerOptions?: ProviderOptions;
3462
+ } | {
3463
+ /**
3464
+ * @deprecated Use 'file' with `mediaType: 'image'` (or a specific
3465
+ * `image/*` subtype) and tagged data instead:
3466
+ * `{ type: 'file', mediaType: 'image', data: { type: 'reference', reference } }`.
3467
+ */
3468
+ type: 'image-file-id';
3469
+ /**
3470
+ * Image that is referenced using a provider file id.
3471
+ *
3472
+ * If you use multiple providers, you need to
3473
+ * specify the provider specific ids using
3474
+ * the Record option. The key is the provider
3475
+ * name, e.g. 'openai' or 'anthropic'.
3476
+ */
3477
+ fileId: string | Record<string, string>;
3478
+ /**
3479
+ * Provider-specific options.
3480
+ */
3481
+ providerOptions?: ProviderOptions;
3482
+ } | {
3483
+ /**
3484
+ * @deprecated Use 'file' with `mediaType: 'image'` (or a specific
3485
+ * `image/*` subtype) and tagged data instead:
3486
+ * `{ type: 'file', mediaType: 'image', data: { type: 'reference', reference } }`.
3487
+ */
3488
+ type: 'image-file-reference';
3489
+ /**
3490
+ * Provider-specific references for the image file.
3491
+ * The key is the provider name, e.g. 'openai' or 'anthropic'.
3492
+ */
3493
+ providerReference: ProviderReference;
3494
+ /**
3495
+ * Provider-specific options.
3496
+ */
3497
+ providerOptions?: ProviderOptions;
3498
+ } | {
3499
+ /**
3500
+ * Custom content part. This can be used to implement
3501
+ * provider-specific content parts.
3502
+ */
3503
+ type: 'custom';
3504
+ /**
3505
+ * Provider-specific options.
3506
+ */
3507
+ providerOptions?: ProviderOptions;
3508
+ }>;
3509
+ };
3510
+ /**
3511
+ * Fetch function type (standardizes the version of fetch used).
3512
+ */
3513
+ type FetchFunction = typeof globalThis.fetch;
3514
+ /**
3515
+ * Used to mark schemas so we can support both Zod and custom schemas.
3516
+ */
3517
+ declare const schemaSymbol: unique symbol;
3518
+ type ValidationResult<OBJECT> = {
3519
+ success: true;
3520
+ value: OBJECT;
3521
+ } | {
3522
+ success: false;
3523
+ error: Error;
3524
+ };
3525
+ type Schema<OBJECT = unknown> = {
3526
+ /**
3527
+ * Used to mark schemas so we can support both Zod and custom schemas.
3528
+ */
3529
+ [schemaSymbol]: true;
3530
+ /**
3531
+ * Schema type for inference.
3532
+ */
3533
+ _type: OBJECT;
3534
+ /**
3535
+ * Optional. Validates that the structure of a value matches this schema,
3536
+ * and returns a typed version of the value if it does.
3537
+ */
3538
+ readonly validate?: (value: unknown) => ValidationResult<OBJECT> | PromiseLike<ValidationResult<OBJECT>>;
3539
+ /**
3540
+ * The JSON Schema for the schema. It is passed to the providers.
3541
+ */
3542
+ readonly jsonSchema: JSONSchema7 | PromiseLike<JSONSchema7>;
3543
+ };
3544
+ type LazySchema<SCHEMA> = () => Schema<SCHEMA>;
3545
+ type ZodSchema<SCHEMA = any> = ZodType<SCHEMA, ZodTypeDef, any> | $ZodType<SCHEMA, any>;
3546
+ type StandardSchema<SCHEMA = any> = StandardSchemaV1$1<unknown, SCHEMA> & StandardJSONSchemaV1<unknown, SCHEMA>;
3547
+ type FlexibleSchema<SCHEMA = any> = Schema<SCHEMA> | LazySchema<SCHEMA> | ZodSchema<SCHEMA> | StandardSchema<SCHEMA>;
3548
+ /**
3549
+ * A context object that is passed into tool execution.
3550
+ */
3551
+ type Context = Record<string, unknown>;
3552
+ type NeverOptional<N, T> = 0 extends 1 & N ? Partial<T> : [N] extends [never] ? Partial<Record<keyof T, undefined>> : T;
3553
+ /**
3554
+ * Tool approval request prompt part.
3555
+ */
3556
+ type ToolApprovalRequest = {
3557
+ type: 'tool-approval-request';
3558
+ /**
3559
+ * ID of the tool approval.
3560
+ */
3561
+ approvalId: string;
3562
+ /**
3563
+ * ID of the tool call that the approval request is for.
3564
+ */
3565
+ toolCallId: string;
3566
+ /**
3567
+ * Flag indicating whether the tool was automatically approved or denied.
3568
+ *
3569
+ * @default false
3570
+ */
3571
+ isAutomatic?: boolean;
3572
+ /**
3573
+ * HMAC-SHA256 signature binding this approval to its tool call.
3574
+ * Present only when `experimental_toolApprovalSecret` is configured.
3575
+ */
3576
+ signature?: string;
3577
+ };
3578
+ /**
3579
+ * An assistant message. It can contain text, tool calls, or a combination of text and tool calls.
3580
+ */
3581
+ type AssistantModelMessage = {
3582
+ role: 'assistant';
3583
+ content: AssistantContent;
3584
+ /**
3585
+ * Additional provider-specific metadata. They are passed through
3586
+ * to the provider from the AI SDK and enable provider-specific
3587
+ * functionality that can be fully encapsulated in the provider.
3588
+ */
3589
+ providerOptions?: ProviderOptions;
3590
+ };
3591
+ /**
3592
+ * Content of an assistant message.
3593
+ * It can be a string or an array of text, image, reasoning, redacted reasoning, and tool call parts.
3594
+ */
3595
+ type AssistantContent = string | Array<TextPart | CustomPart | FilePart | ReasoningPart | ReasoningFilePart | ToolCallPart | ToolResultPart | ToolApprovalRequest>;
3596
+ /**
3597
+ * A system message. It can contain system information.
3598
+ *
3599
+ * Note: using the "system" part of the prompt is strongly preferred
3600
+ * to increase the resilience against prompt injection attacks,
3601
+ * and because not all providers support several system messages.
3602
+ */
3603
+ type SystemModelMessage = {
3604
+ role: 'system';
3605
+ content: string;
3606
+ /**
3607
+ * Additional provider-specific metadata. They are passed through
3608
+ * to the provider from the AI SDK and enable provider-specific
3609
+ * functionality that can be fully encapsulated in the provider.
3610
+ */
3611
+ providerOptions?: ProviderOptions;
3612
+ };
3613
+ /**
3614
+ * Tool approval response prompt part.
3615
+ */
3616
+ type ToolApprovalResponse = {
3617
+ type: 'tool-approval-response';
3618
+ /**
3619
+ * ID of the tool approval.
3620
+ */
3621
+ approvalId: string;
3622
+ /**
3623
+ * Flag indicating whether the approval was granted or denied.
3624
+ */
3625
+ approved: boolean;
3626
+ /**
3627
+ * Optional reason for the approval or denial.
3628
+ */
3629
+ reason?: string;
3630
+ /**
3631
+ * Flag indicating whether the tool call is provider-executed.
3632
+ * Only provider-executed tool approval responses should be sent to the model.
3633
+ */
3634
+ providerExecuted?: boolean;
3635
+ };
3636
+ /**
3637
+ * A tool message. It contains the result of one or more tool calls.
3638
+ */
3639
+ type ToolModelMessage = {
3640
+ role: 'tool';
3641
+ content: ToolContent;
3642
+ /**
3643
+ * Additional provider-specific metadata. They are passed through
3644
+ * to the provider from the AI SDK and enable provider-specific
3645
+ * functionality that can be fully encapsulated in the provider.
3646
+ */
3647
+ providerOptions?: ProviderOptions;
3648
+ };
3649
+ /**
3650
+ * Content of a tool message. It is an array of tool result parts.
3651
+ */
3652
+ type ToolContent = Array<ToolResultPart | ToolApprovalResponse>;
3653
+ /**
3654
+ * A user message. It can contain text or a combination of text and images.
3655
+ */
3656
+ type UserModelMessage = {
3657
+ role: 'user';
3658
+ content: UserContent;
3659
+ /**
3660
+ * Additional provider-specific metadata. They are passed through
3661
+ * to the provider from the AI SDK and enable provider-specific
3662
+ * functionality that can be fully encapsulated in the provider.
3663
+ */
3664
+ providerOptions?: ProviderOptions;
3665
+ };
3666
+ /**
3667
+ * Content of a user message. It can be a string or an array of text and image parts.
3668
+ */
3669
+ type UserContent = string | Array<TextPart | ImagePart | FilePart>;
3670
+ /**
3671
+ * A message that can be used in the `messages` field of a prompt.
3672
+ * It can be a user message, an assistant message, or a tool message.
3673
+ */
3674
+ type ModelMessage = SystemModelMessage | UserModelMessage | AssistantModelMessage | ToolModelMessage;
3675
+ /**
3676
+ * Options for executing a command in the sandbox via `run` or `spawn`.
3677
+ */
3678
+ type SandboxProcessOptions = {
3679
+ /**
3680
+ * Command to execute in the sandbox.
3681
+ */
3682
+ command: string;
3683
+ /**
3684
+ * Working directory to execute the command in.
3685
+ */
3686
+ workingDirectory?: string;
3687
+ /**
3688
+ * Environment variables to set for this command. Merged with the
3689
+ * sandbox's default environment; values here take precedence.
3690
+ * Supporting environment variables as an option is preferable from a
3691
+ * security perspective, e.g. to avoid them leaking in logs.
3692
+ */
3693
+ env?: Record<string, string>;
3694
+ /**
3695
+ * Signal that can be used to abort the command. When aborted, the running
3696
+ * process is killed; for `spawn`, `wait()` rejects with the abort reason.
3697
+ */
3698
+ abortSignal?: AbortSignal;
3699
+ };
3700
+ /**
3701
+ * Options for reading a file from the sandbox.
3702
+ */
3703
+ type ReadFileOptions = {
3704
+ /**
3705
+ * Path of the file to read.
3706
+ */
3707
+ path: string;
3708
+ /**
3709
+ * Signal that can be used to abort the read.
3710
+ */
3711
+ abortSignal?: AbortSignal;
3712
+ };
3713
+ /**
3714
+ * Options for writing a file to the sandbox. `CONTENT` is the payload written
3715
+ * to the file: a byte stream, raw bytes, or a string.
3716
+ */
3717
+ type WriteFileOptions<CONTENT> = {
3718
+ /**
3719
+ * Path of the file to write.
3720
+ */
3721
+ path: string;
3722
+ /**
3723
+ * Content to write to the file.
3724
+ */
3725
+ content: CONTENT;
3726
+ /**
3727
+ * Signal that can be used to abort the write.
3728
+ */
3729
+ abortSignal?: AbortSignal;
3730
+ };
3731
+ /**
3732
+ * Sandbox session that can execute commands and read/write files.
3733
+ */
3734
+ type SandboxSession = {
3735
+ /**
3736
+ * Description of the sandbox environment that can be added to the agent's instructions
3737
+ * so that the agent knows about relevant details such as the root directory, exposed
3738
+ * ports, the public hostname, etc.
3739
+ */
3740
+ readonly description: string;
3741
+ /**
3742
+ * Read one file from the sandbox as a stream of bytes. Resolves to `null`
3743
+ * when the file does not exist.
3744
+ *
3745
+ * Relative path handling is implementation-defined. This is the lowest-level
3746
+ * read primitive; prefer `readBinaryFile` or `readTextFile` unless you need
3747
+ * to stream bytes.
3748
+ */
3749
+ readonly readFile: (options: ReadFileOptions) => PromiseLike<ReadableStream<Uint8Array> | null>;
3750
+ /**
3751
+ * Read one file from the sandbox as raw bytes. Resolves to `null` when the
3752
+ * file does not exist.
3753
+ */
3754
+ readonly readBinaryFile: (options: ReadFileOptions) => PromiseLike<Uint8Array | null>;
3755
+ /**
3756
+ * Read one text file from the sandbox, decoded using the requested encoding.
3757
+ * Resolves to `null` when the file does not exist.
3758
+ *
3759
+ * Line ranges are 1-based and inclusive. When `endLine` is past EOF the read
3760
+ * returns through EOF without error.
3761
+ */
3762
+ readonly readTextFile: (options: ReadFileOptions & {
3763
+ /**
3764
+ * Text encoding used to decode the file bytes. Defaults to `"utf-8"`.
3765
+ */
3766
+ encoding?: string;
3767
+ /**
3768
+ * 1-based inclusive start line. Defaults to 1.
3769
+ */
3770
+ startLine?: number;
3771
+ /**
3772
+ * 1-based inclusive end line. When past the file's line count, the read
3773
+ * returns through EOF without error.
3774
+ */
3775
+ endLine?: number;
3776
+ }) => PromiseLike<string | null>;
3777
+ /**
3778
+ * Write one file to the sandbox from a stream of bytes. Creates parent
3779
+ * directories recursively and overwrites any existing file.
3780
+ *
3781
+ * This is the lowest-level write primitive; prefer `writeBinaryFile` or
3782
+ * `writeTextFile` when the full content is already materialized in memory.
3783
+ */
3784
+ readonly writeFile: (options: WriteFileOptions<ReadableStream<Uint8Array>>) => PromiseLike<void>;
3785
+ /**
3786
+ * Write one file to the sandbox from raw bytes. Creates parent directories
3787
+ * recursively and overwrites any existing file.
3788
+ */
3789
+ readonly writeBinaryFile: (options: WriteFileOptions<Uint8Array>) => PromiseLike<void>;
3790
+ /**
3791
+ * Write one file to the sandbox from a string, encoded using the requested
3792
+ * encoding. Creates parent directories recursively and overwrites any
3793
+ * existing file.
3794
+ */
3795
+ readonly writeTextFile: (options: WriteFileOptions<string> & {
3796
+ /**
3797
+ * Text encoding used to encode the string to bytes. Defaults to `"utf-8"`.
3798
+ */
3799
+ encoding?: string;
3800
+ }) => PromiseLike<void>;
3801
+ /**
3802
+ * Spawn a long-running process in the sandbox. Returns immediately with a
3803
+ * handle that streams stdout/stderr, can be waited on, and can be killed.
3804
+ *
3805
+ * `run` is conceptually a thin wrapper over this primitive: spawn,
3806
+ * collect both streams to strings, await `wait()`, return the result.
3807
+ */
3808
+ readonly spawn: (options: SandboxProcessOptions) => PromiseLike<SandboxProcess>;
3809
+ /**
3810
+ * Run a command in the sandbox.
3811
+ */
3812
+ readonly run: (options: SandboxProcessOptions) => PromiseLike<{
3813
+ /**
3814
+ * Exit code returned by the command.
3815
+ */
3816
+ exitCode: number;
3817
+ /**
3818
+ * Standard output produced by the command.
3819
+ */
3820
+ stdout: string;
3821
+ /**
3822
+ * Standard error produced by the command.
3823
+ */
3824
+ stderr: string;
3825
+ }>;
3826
+ };
3827
+ /**
3828
+ * Handle to a long-running process started via `SandboxSession.spawn`.
3829
+ */
3830
+ type SandboxProcess = {
3831
+ /**
3832
+ * Process identifier, if the sandbox implementation exposes one.
3833
+ */
3834
+ readonly pid?: number;
3835
+ /**
3836
+ * Stream of bytes written by the process to standard output.
3837
+ */
3838
+ readonly stdout: ReadableStream<Uint8Array>;
3839
+ /**
3840
+ * Stream of bytes written by the process to standard error.
3841
+ */
3842
+ readonly stderr: ReadableStream<Uint8Array>;
3843
+ /**
3844
+ * Resolve when the process exits, yielding its exit code.
3845
+ */
3846
+ wait(): PromiseLike<{
3847
+ exitCode: number;
3848
+ }>;
3849
+ /**
3850
+ * Terminate the process. Idempotent.
3851
+ */
3852
+ kill(): PromiseLike<void>;
3853
+ };
3854
+ /**
3855
+ * Additional options that are sent into each tool execution.
3856
+ */
3857
+ interface ToolExecutionOptions<CONTEXT extends Context | unknown | never> {
3858
+ /**
3859
+ * The ID of the tool call. You can use it e.g. when sending tool-call related information with stream data.
3860
+ */
3861
+ toolCallId: string;
3862
+ /**
3863
+ * Messages that were sent to the language model to initiate the response that contained the tool call.
3864
+ * The messages **do not** include the system prompt nor the assistant response that contained the tool call.
3865
+ */
3866
+ messages: ModelMessage[];
3867
+ /**
3868
+ * An optional abort signal that indicates that the overall operation should be aborted.
3869
+ */
3870
+ abortSignal?: AbortSignal;
3871
+ /**
3872
+ * Tool context as defined by the tool's context schema.
3873
+ * The tool context is specific to the tool and is passed to the tool execution.
3874
+ *
3875
+ * Treat the context object as immutable inside tools.
3876
+ * Mutating the context object can lead to race conditions and unexpected results
3877
+ * when tools are called in parallel.
3878
+ *
3879
+ * If you need to mutate the context, analyze the tool calls and results
3880
+ * in `prepareStep` and update it there.
3881
+ */
3882
+ context: CONTEXT;
3883
+ /**
3884
+ * The sandbox environment that the tool is operating in.
3885
+ */
3886
+ experimental_sandbox?: SandboxSession;
3887
+ }
3888
+ /**
3889
+ * Function that executes the tool and returns either a single result or a stream of results.
3890
+ */
3891
+ type ToolExecuteFunction<INPUT, OUTPUT, CONTEXT extends Context | unknown | never> = (input: INPUT, options: ToolExecutionOptions<CONTEXT>) => AsyncIterable<OUTPUT> | PromiseLike<OUTPUT> | OUTPUT;
3892
+ /**
3893
+ * Function that is called to determine if the tool needs approval before it can be executed.
3894
+ *
3895
+ * @deprecated Tool approval is handled on a `generateText` / `streamText` level now.
3896
+ */
3897
+ type ToolNeedsApprovalFunction<INPUT, CONTEXT extends Context | unknown | never> = (input: INPUT, options: {
3898
+ /**
3899
+ * The ID of the tool call. You can use it e.g. when sending tool-call related information with stream data.
3900
+ */
3901
+ toolCallId: string;
3902
+ /**
3903
+ * Messages that were sent to the language model to initiate the response that contained the tool call.
3904
+ * The messages **do not** include the system prompt nor the assistant response that contained the tool call.
3905
+ */
3906
+ messages: ModelMessage[];
3907
+ /**
3908
+ * Tool context as defined by the tool's context schema.
3909
+ * The tool context is specific to the tool and is passed to the tool execution.
3910
+ *
3911
+ * Treat the context object as immutable inside tools.
3912
+ * Mutating the context object can lead to race conditions and unexpected results
3913
+ * when tools are called in parallel.
3914
+ *
3915
+ * If you need to mutate the context, analyze the tool calls and results
3916
+ * in `prepareStep` and update it there.
3917
+ */
3918
+ context: CONTEXT;
3919
+ }) => boolean | PromiseLike<boolean>;
3920
+ /**
3921
+ * Helper type to determine the outputSchema and execute function properties of a tool.
3922
+ */
3923
+ type ToolOutputProperties<INPUT, OUTPUT, CONTEXT extends Context | unknown | never> = NeverOptional<OUTPUT, {
3924
+ /**
3925
+ * The optional schema of the output that the tool produces.
3926
+ *
3927
+ * If not provided, the output shape will be inferred from the execute function.
3928
+ */
3929
+ outputSchema?: FlexibleSchema<OUTPUT>;
3930
+ /**
3931
+ * An async function that is called with the arguments from the tool call and produces a result.
3932
+ * If not provided, the tool will not be executed automatically.
3933
+ *
3934
+ * @args is the input of the tool call.
3935
+ * @options.abortSignal is a signal that can be used to abort the tool call.
3936
+ */
3937
+ execute: ToolExecuteFunction<INPUT, OUTPUT, CONTEXT>;
3938
+ } | {
3939
+ /**
3940
+ * The schema of the output that the tool produces.
3941
+ *
3942
+ * Required when no execute function is provided.
3943
+ */
3944
+ outputSchema: FlexibleSchema<OUTPUT>;
3945
+ execute?: never;
3946
+ }>;
3947
+ /**
3948
+ * Common properties shared by all tool kinds.
3949
+ */
3950
+ type BaseTool<INPUT extends JSONValue | unknown | never = any, OUTPUT extends JSONValue | unknown | never = any, CONTEXT extends Context | unknown | never = any> = {
3951
+ /**
3952
+ * An optional title of the tool.
3953
+ *
3954
+ * @deprecated Use `providerMetadata` for source-specific tool display metadata.
3955
+ */
3956
+ title?: string;
3957
+ /**
3958
+ * Additional provider-specific metadata. They are passed through
3959
+ * to the provider from the AI SDK and enable provider-specific
3960
+ * functionality that can be fully encapsulated in the provider.
3961
+ */
3962
+ providerOptions?: ProviderOptions;
3963
+ /**
3964
+ * Optional metadata about the tool itself (e.g. its source).
3965
+ *
3966
+ * Unlike `providerOptions`, this metadata is not sent to the language
3967
+ * model. Instead, it is propagated onto the resulting tool call's
3968
+ * `toolMetadata` so consumers can read it from tool call / result parts
3969
+ * and UI message parts. This is useful for sources of dynamic tools (e.g.
3970
+ * an MCP server) to identify themselves.
3971
+ */
3972
+ metadata?: JSONObject;
3973
+ /**
3974
+ * The schema of the input that the tool expects.
3975
+ * The language model will use this to generate the input.
3976
+ * It is also used to validate the output of the language model.
3977
+ *
3978
+ * You can use descriptions on the schema properties to make the input understandable for the language model.
3979
+ */
3980
+ inputSchema: FlexibleSchema<INPUT>;
3981
+ /**
3982
+ * An optional schema describing the context that the tool expects.
3983
+ *
3984
+ * The context is passed to execute function as part of the execution options.
3985
+ */
3986
+ contextSchema?: FlexibleSchema<CONTEXT>;
3987
+ /**
3988
+ * Whether the tool needs approval before it can be executed.
3989
+ *
3990
+ * @deprecated Tool approval is handled on a `generateText` / `streamText` level now.
3991
+ */
3992
+ needsApproval?: boolean | ToolNeedsApprovalFunction<[INPUT] extends [never] ? unknown : INPUT, NoInfer<CONTEXT>>;
3993
+ /**
3994
+ * Optional function that is called when the argument streaming starts.
3995
+ * Only called when the tool is used in a streaming context.
3996
+ */
3997
+ onInputStart?: (options: ToolExecutionOptions<NoInfer<CONTEXT>>) => void | PromiseLike<void>;
3998
+ /**
3999
+ * Optional function that is called when an argument streaming delta is available.
4000
+ * Only called when the tool is used in a streaming context.
4001
+ */
4002
+ onInputDelta?: (options: {
4003
+ inputTextDelta: string;
4004
+ } & ToolExecutionOptions<NoInfer<CONTEXT>>) => void | PromiseLike<void>;
4005
+ /**
4006
+ * Optional function that is called when a tool call can be started,
4007
+ * even if the execute function is not provided.
4008
+ */
4009
+ onInputAvailable?: (options: {
4010
+ input: [INPUT] extends [never] ? unknown : INPUT;
4011
+ } & ToolExecutionOptions<NoInfer<CONTEXT>>) => void | PromiseLike<void>;
4012
+ /**
4013
+ * Optional conversion function that maps the tool result to an output that can be used by the language model.
4014
+ *
4015
+ * If not provided, the tool result will be sent as a JSON object.
4016
+ *
4017
+ * This function is invoked on the server by `convertToModelMessages`, so ensure that you pass the same "tools" (ToolSet) to both "convertToModelMessages" and "streamText" (or other generation APIs).
4018
+ */
4019
+ toModelOutput?: (options: {
4020
+ /**
4021
+ * The ID of the tool call. You can use it e.g. when sending tool-call related information with stream data.
4022
+ */
4023
+ toolCallId: string;
4024
+ /**
4025
+ * The input of the tool call.
4026
+ */
4027
+ input: [INPUT] extends [never] ? unknown : INPUT;
4028
+ /**
4029
+ * The output of the tool call.
4030
+ */
4031
+ output: 0 extends 1 & OUTPUT ? any : [OUTPUT] extends [never] ? any : NoInfer<OUTPUT>;
4032
+ }) => ToolResultOutput | PromiseLike<ToolResultOutput>;
4033
+ } & ToolOutputProperties<INPUT, OUTPUT, NoInfer<CONTEXT>>;
4034
+ /**
4035
+ * Common properties shared by function-style tools.
4036
+ */
4037
+ type BaseFunctionTool<INPUT extends JSONValue | unknown | never = any, OUTPUT extends JSONValue | unknown | never = any, CONTEXT extends Context | unknown | never = any> = BaseTool<INPUT, OUTPUT, CONTEXT> & {
4038
+ /**
4039
+ * Optional description of what the tool does.
4040
+ *
4041
+ * Included in the tool definition sent to the language model so it can
4042
+ * decide when and how to call the tool.
4043
+ *
4044
+ * Provide a string for a fixed description, or a function that returns a
4045
+ * string from the current `context` (and optional `experimental_sandbox`) when the
4046
+ * description should vary per call.
4047
+ */
4048
+ description?: string | ((options: {
4049
+ context: NoInfer<CONTEXT>;
4050
+ experimental_sandbox?: SandboxSession;
4051
+ }) => string);
4052
+ /**
4053
+ * Strict mode setting for the tool.
4054
+ *
4055
+ * Providers that support strict mode will use this setting to determine
4056
+ * how the input should be generated. Strict mode will always produce
4057
+ * valid inputs, but it might limit what input schemas are supported.
4058
+ */
4059
+ strict?: boolean;
4060
+ /**
4061
+ * An optional list of input examples that show the language
4062
+ * model what the input should look like.
4063
+ */
4064
+ inputExamples?: Array<{
4065
+ input: NoInfer<INPUT>;
4066
+ }>;
4067
+ id?: never;
4068
+ isProviderExecuted?: never;
4069
+ args?: never;
4070
+ supportsDeferredResults?: never;
4071
+ };
4072
+ /**
4073
+ * Tool with user-defined input and output schemas that is executed by the AI SDK.
4074
+ */
4075
+ type FunctionTool<INPUT extends JSONValue | unknown | never = any, OUTPUT extends JSONValue | unknown | never = any, CONTEXT extends Context | unknown | never = any> = BaseFunctionTool<INPUT, OUTPUT, CONTEXT> & {
4076
+ type?: undefined | 'function';
4077
+ };
4078
+ /**
4079
+ * Tool that is defined at runtime.
4080
+ * The types of input and output are not known at development time.
4081
+ *
4082
+ * For example, MCP tools that are not known at development time.
4083
+ */
4084
+ type DynamicTool<INPUT extends JSONValue | unknown | never = any, OUTPUT extends JSONValue | unknown | never = any, CONTEXT extends Context | unknown | never = any> = BaseFunctionTool<INPUT, OUTPUT, CONTEXT> & {
4085
+ type: 'dynamic';
4086
+ };
4087
+ /**
4088
+ * Common properties shared by provider tools.
4089
+ */
4090
+ type BaseProviderTool<INPUT extends JSONValue | unknown | never = any, OUTPUT extends JSONValue | unknown | never = any, CONTEXT extends Context | unknown | never = any> = BaseTool<INPUT, OUTPUT, CONTEXT> & {
4091
+ type: 'provider';
4092
+ /**
4093
+ * The ID of the tool. Must follow the format `<provider-name>.<unique-tool-name>`.
4094
+ */
4095
+ id: `${string}.${string}`;
4096
+ /**
4097
+ * The arguments for configuring the tool. Must match the expected arguments defined by the provider for this tool.
4098
+ */
4099
+ args: Record<string, unknown>;
4100
+ description?: never;
4101
+ strict?: never;
4102
+ inputExamples?: never;
4103
+ };
4104
+ /**
4105
+ * Tool with provider-defined input and output schemas that is executed by the
4106
+ * user.
4107
+ *
4108
+ * For example, shell tools that are executed in a local shell, but have provider-defined input and output schemas.
4109
+ */
4110
+ type ProviderDefinedTool<INPUT extends JSONValue | unknown | never = any, OUTPUT extends JSONValue | unknown | never = any, CONTEXT extends Context | unknown | never = any> = BaseProviderTool<INPUT, OUTPUT, CONTEXT> & {
4111
+ /**
4112
+ * Flag that indicates whether the tool is executed by the provider.
4113
+ */
4114
+ isProviderExecuted: false;
4115
+ supportsDeferredResults?: never;
4116
+ };
4117
+ /**
4118
+ * Tool with provider-defined input and output schemas that is executed by the
4119
+ * provider.
4120
+ *
4121
+ * For example, web search tools and code execution tools that are executed by the provider itself.
4122
+ */
4123
+ type ProviderExecutedTool<INPUT extends JSONValue | unknown | never = any, OUTPUT extends JSONValue | unknown | never = any, CONTEXT extends Context | unknown | never = any> = BaseProviderTool<INPUT, OUTPUT, CONTEXT> & {
4124
+ /**
4125
+ * Flag that indicates whether the tool is executed by the provider.
4126
+ */
4127
+ isProviderExecuted: true;
4128
+ /**
4129
+ * Whether this provider-executed tool supports deferred results.
4130
+ *
4131
+ * When true, the tool result may not be returned in the same turn as the
4132
+ * tool call (e.g., when using programmatic tool calling where a server tool
4133
+ * triggers a client-executed tool, and the server tool's result is deferred
4134
+ * until the client tool is resolved).
4135
+ *
4136
+ * This flag allows the AI SDK to handle tool results that arrive without
4137
+ * a matching tool call in the current response.
4138
+ *
4139
+ * @default false
4140
+ */
4141
+ supportsDeferredResults?: boolean;
4142
+ };
4143
+ /**
4144
+ * A tool can either be user-defined or provider-defined.
4145
+ *
4146
+ * It contains the schemas and metadata needed for the language model to call
4147
+ * the tool and can include an execute function for tools that are executed by
4148
+ * the AI SDK.
4149
+ */
4150
+ type Tool<INPUT extends JSONValue | unknown | never = any, OUTPUT extends JSONValue | unknown | never = any, CONTEXT extends Context | unknown | never = any> = FunctionTool<INPUT, OUTPUT, CONTEXT> | DynamicTool<INPUT, OUTPUT, CONTEXT> | ProviderDefinedTool<INPUT, OUTPUT, CONTEXT> | ProviderExecutedTool<INPUT, OUTPUT, CONTEXT>;
4151
+ //#endregion
4152
+ //#region node_modules/.pnpm/@ai-sdk+mcp@2.0.12_zod@4.4.3/node_modules/@ai-sdk/mcp/dist/index.d.ts
4153
+ declare const JSONRPCMessageSchema: ZodUnion$1<readonly [ZodObject<{
4154
+ jsonrpc: ZodLiteral<"2.0">;
4155
+ id: ZodUnion$1<readonly [ZodString, ZodNumber]>;
4156
+ method: ZodString;
4157
+ params: ZodOptional$1<ZodObject<{
4158
+ _meta: ZodOptional$1<ZodObject<{}, $loose>>;
4159
+ }, $loose>>;
4160
+ }, $strict>, ZodObject<{
4161
+ jsonrpc: ZodLiteral<"2.0">;
4162
+ method: ZodString;
4163
+ params: ZodOptional$1<ZodObject<{
4164
+ _meta: ZodOptional$1<ZodObject<{}, $loose>>;
4165
+ }, $loose>>;
4166
+ }, $strict>, ZodObject<{
4167
+ jsonrpc: ZodLiteral<"2.0">;
4168
+ id: ZodUnion$1<readonly [ZodString, ZodNumber]>;
4169
+ result: ZodObject<{
4170
+ _meta: ZodOptional$1<ZodObject<{}, $loose>>;
4171
+ }, $loose>;
4172
+ }, $strict>, ZodObject<{
4173
+ jsonrpc: ZodLiteral<"2.0">;
4174
+ id: ZodUnion$1<readonly [ZodString, ZodNumber]>;
4175
+ error: ZodObject<{
4176
+ code: ZodNumber;
4177
+ message: ZodString;
4178
+ data: ZodOptional$1<ZodUnknown>;
4179
+ }, $strip>;
4180
+ }, $strict>]>;
4181
+ type JSONRPCMessage = output$1<typeof JSONRPCMessageSchema>;
4182
+ /**
4183
+ * OAuth 2.1 token response
4184
+ */
4185
+ declare const OAuthTokensSchema: ZodObject<{
4186
+ access_token: ZodString;
4187
+ id_token: ZodOptional$1<ZodString>;
4188
+ token_type: ZodString;
4189
+ expires_in: ZodOptional$1<ZodNumber>;
4190
+ scope: ZodOptional$1<ZodString>;
4191
+ refresh_token: ZodOptional$1<ZodString>;
4192
+ authorization_server: ZodOptional$1<ZodString>;
4193
+ token_endpoint: ZodOptional$1<ZodString>;
4194
+ }, $strip>;
4195
+ declare const OAuthMetadataSchema: ZodObject<{
4196
+ issuer: ZodString;
4197
+ authorization_endpoint: ZodString;
4198
+ token_endpoint: ZodString;
4199
+ registration_endpoint: ZodOptional$1<ZodString>;
4200
+ scopes_supported: ZodOptional$1<ZodArray$1<ZodString>>;
4201
+ response_types_supported: ZodArray$1<ZodString>;
4202
+ grant_types_supported: ZodOptional$1<ZodArray$1<ZodString>>;
4203
+ code_challenge_methods_supported: ZodArray$1<ZodString>;
4204
+ token_endpoint_auth_methods_supported: ZodOptional$1<ZodArray$1<ZodString>>;
4205
+ token_endpoint_auth_signing_alg_values_supported: ZodOptional$1<ZodArray$1<ZodString>>;
4206
+ }, $loose>;
4207
+ /**
4208
+ * OpenID Connect Discovery metadata that may include OAuth 2.0 fields
4209
+ * This schema represents the real-world scenario where OIDC providers
4210
+ * return a mix of OpenID Connect and OAuth 2.0 metadata fields
4211
+ */
4212
+ declare const OpenIdProviderDiscoveryMetadataSchema: ZodObject<{
4213
+ issuer: ZodString;
4214
+ authorization_endpoint: ZodString;
4215
+ token_endpoint: ZodString;
4216
+ userinfo_endpoint: ZodOptional$1<ZodString>;
4217
+ jwks_uri: ZodString;
4218
+ registration_endpoint: ZodOptional$1<ZodString>;
4219
+ scopes_supported: ZodOptional$1<ZodArray$1<ZodString>>;
4220
+ response_types_supported: ZodArray$1<ZodString>;
4221
+ grant_types_supported: ZodOptional$1<ZodArray$1<ZodString>>;
4222
+ subject_types_supported: ZodArray$1<ZodString>;
4223
+ id_token_signing_alg_values_supported: ZodArray$1<ZodString>;
4224
+ claims_supported: ZodOptional$1<ZodArray$1<ZodString>>;
4225
+ token_endpoint_auth_methods_supported: ZodOptional$1<ZodArray$1<ZodString>>;
4226
+ code_challenge_methods_supported: ZodArray$1<ZodString>;
4227
+ }, $loose>;
4228
+ declare const OAuthClientInformationSchema: ZodObject<{
4229
+ client_id: ZodString;
4230
+ client_secret: ZodOptional$1<ZodString>;
4231
+ client_id_issued_at: ZodOptional$1<ZodNumber>;
4232
+ client_secret_expires_at: ZodOptional$1<ZodNumber>;
4233
+ authorization_server: ZodOptional$1<ZodString>;
4234
+ token_endpoint: ZodOptional$1<ZodString>;
4235
+ }, $strip>;
4236
+ declare const OAuthClientMetadataSchema: ZodObject<{
4237
+ redirect_uris: ZodArray$1<ZodString>;
4238
+ token_endpoint_auth_method: ZodOptional$1<ZodString>;
4239
+ grant_types: ZodOptional$1<ZodArray$1<ZodString>>;
4240
+ response_types: ZodOptional$1<ZodArray$1<ZodString>>;
4241
+ client_name: ZodOptional$1<ZodString>;
4242
+ client_uri: ZodOptional$1<ZodString>;
4243
+ logo_uri: ZodOptional$1<ZodString>;
4244
+ scope: ZodOptional$1<ZodString>;
4245
+ contacts: ZodOptional$1<ZodArray$1<ZodString>>;
4246
+ tos_uri: ZodOptional$1<ZodString>;
4247
+ policy_uri: ZodOptional$1<ZodString>;
4248
+ jwks_uri: ZodOptional$1<ZodString>;
4249
+ jwks: ZodOptional$1<ZodAny>;
4250
+ software_id: ZodOptional$1<ZodString>;
4251
+ software_version: ZodOptional$1<ZodString>;
4252
+ software_statement: ZodOptional$1<ZodString>;
4253
+ }, $strip>;
4254
+ type OAuthMetadata = output$1<typeof OAuthMetadataSchema>;
4255
+ type OpenIdProviderDiscoveryMetadata = output$1<typeof OpenIdProviderDiscoveryMetadataSchema>;
4256
+ type OAuthTokens = output$1<typeof OAuthTokensSchema>;
4257
+ type OAuthClientInformation = output$1<typeof OAuthClientInformationSchema>;
4258
+ type AuthorizationServerMetadata = OAuthMetadata | OpenIdProviderDiscoveryMetadata;
4259
+ type OAuthClientMetadata = output$1<typeof OAuthClientMetadataSchema>;
4260
+ interface OAuthAuthorizationServerInformation {
4261
+ authorizationServerUrl: string;
4262
+ tokenEndpoint: string;
4263
+ }
4264
+ interface OAuthClientProvider {
4265
+ /**
4266
+ * Returns current access token if present; undefined otherwise.
4267
+ */
4268
+ tokens(): OAuthTokens | undefined | Promise<OAuthTokens | undefined>;
4269
+ saveTokens(tokens: OAuthTokens): void | Promise<void>;
4270
+ redirectToAuthorization(authorizationUrl: URL): void | Promise<void>;
4271
+ saveCodeVerifier(codeVerifier: string): void | Promise<void>;
4272
+ codeVerifier(): string | Promise<string>;
4273
+ /**
4274
+ * Adds custom client authentication to OAuth token requests.
4275
+ *
4276
+ * This optional method allows implementations to customize how client credentials
4277
+ * are included in token exchange and refresh requests. When provided, this method
4278
+ * is called instead of the default authentication logic, giving full control over
4279
+ * the authentication mechanism.
4280
+ *
4281
+ * Common use cases include:
4282
+ * - Supporting authentication methods beyond the standard OAuth 2.0 methods
4283
+ * - Adding custom headers for proprietary authentication schemes
4284
+ * - Implementing client assertion-based authentication (e.g., JWT bearer tokens)
4285
+ *
4286
+ * @param headers - The request headers (can be modified to add authentication)
4287
+ * @param params - The request body parameters (can be modified to add credentials)
4288
+ * @param url - The token endpoint URL being called
4289
+ * @param metadata - Optional OAuth metadata for the server, which may include supported authentication methods
4290
+ */
4291
+ addClientAuthentication?(headers: Headers, params: URLSearchParams, url: string | URL, metadata?: AuthorizationServerMetadata): void | Promise<void>;
4292
+ /**
4293
+ * If implemented, provides a way for the client to invalidate (e.g. delete) the specified
4294
+ * credentials, in the case where the server has indicated that they are no longer valid.
4295
+ * This avoids requiring the user to intervene manually.
4296
+ */
4297
+ invalidateCredentials?(scope: 'all' | 'client' | 'tokens' | 'verifier'): void | Promise<void>;
4298
+ get redirectUrl(): string | URL;
4299
+ get clientMetadata(): OAuthClientMetadata;
4300
+ clientInformation(): OAuthClientInformation | undefined | Promise<OAuthClientInformation | undefined>;
4301
+ saveClientInformation?(clientInformation: OAuthClientInformation): void | Promise<void>;
4302
+ authorizationServerInformation?(): OAuthAuthorizationServerInformation | undefined | Promise<OAuthAuthorizationServerInformation | undefined>;
4303
+ saveAuthorizationServerInformation?(authorizationServerInformation: OAuthAuthorizationServerInformation): void | Promise<void>;
4304
+ /**
4305
+ * Validates an authorization server URL discovered from MCP protected resource
4306
+ * metadata before the client fetches its OAuth metadata.
4307
+ */
4308
+ validateAuthorizationServerURL?(serverUrl: string | URL, authorizationServerUrl: string | URL): void | Promise<void>;
4309
+ state?(): string | Promise<string>;
4310
+ saveState?(state: string): void | Promise<void>;
4311
+ storedState?(): string | undefined | Promise<string | undefined>;
4312
+ validateResourceURL?(serverUrl: string | URL, resource?: string): Promise<URL | undefined>;
4313
+ }
4314
+ /**
4315
+ * Transport interface for MCP (Model Context Protocol) communication.
4316
+ * Maps to the `Transport` interface in the MCP spec.
4317
+ */
4318
+ interface MCPTransport {
4319
+ /**
4320
+ * Initialize and start the transport
4321
+ */
4322
+ start(): Promise<void>;
4323
+ /**
4324
+ * Send a JSON-RPC message through the transport
4325
+ * @param message The JSON-RPC message to send
4326
+ */
4327
+ send(message: JSONRPCMessage): Promise<void>;
4328
+ /**
4329
+ * Clean up and close the transport
4330
+ */
4331
+ close(): Promise<void>;
4332
+ /**
4333
+ * Event handler for transport closure
4334
+ */
4335
+ onclose?: () => void;
4336
+ /**
4337
+ * Event handler for transport errors
4338
+ */
4339
+ onerror?: (error: Error) => void;
4340
+ /**
4341
+ * Event handler for received messages
4342
+ */
4343
+ onmessage?: (message: JSONRPCMessage) => void;
4344
+ /**
4345
+ * The protocol version negotiated during initialization.
4346
+ */
4347
+ protocolVersion?: string;
4348
+ /**
4349
+ * Set the protocol version negotiated during initialization.
4350
+ */
4351
+ setProtocolVersion?(version: string): void;
4352
+ }
4353
+ type MCPTransportConfig = {
4354
+ type: 'sse' | 'http';
4355
+ /**
4356
+ * The URL of the MCP server.
4357
+ */
4358
+ url: string;
4359
+ /**
4360
+ * Additional HTTP headers to be sent with requests.
4361
+ */
4362
+ headers?: Record<string, string>;
4363
+ /**
4364
+ * An optional OAuth client provider to use for authentication for MCP servers.
4365
+ */
4366
+ authProvider?: OAuthClientProvider;
4367
+ /**
4368
+ * Controls how HTTP redirects are handled for transport requests.
4369
+ * - `'follow'`: Follow redirects automatically (standard fetch behavior).
4370
+ * - `'error'`: Reject any redirect response with an error.
4371
+ * @default 'error'
4372
+ */
4373
+ redirect?: 'follow' | 'error';
4374
+ /**
4375
+ * Initial MCP session id to send with resumed Streamable HTTP requests after
4376
+ * initialization.
4377
+ * Only used by the HTTP transport.
4378
+ */
4379
+ initialSessionId?: string;
4380
+ /**
4381
+ * Initial MCP protocol version to send before initialize negotiates one.
4382
+ * Only used by the HTTP transport.
4383
+ */
4384
+ initialProtocolVersion?: string;
4385
+ /**
4386
+ * Called when the Streamable HTTP server creates, changes, or clears the MCP
4387
+ * session id.
4388
+ * Only used by the HTTP transport.
4389
+ */
4390
+ onSessionIdChange?: (sessionId: string | undefined) => void;
4391
+ /**
4392
+ * Called when a Streamable HTTP request returns 404 for an existing MCP
4393
+ * session id. The transport clears the session id before reporting the
4394
+ * underlying HTTP error.
4395
+ * Only used by the HTTP transport.
4396
+ */
4397
+ onSessionExpired?: (sessionId: string) => void;
4398
+ /**
4399
+ * Whether close() should send DELETE for the current MCP session id.
4400
+ * Set to false when the application intends to reattach to the session later.
4401
+ * Only used by the HTTP transport.
4402
+ * @default true
4403
+ */
4404
+ terminateSessionOnClose?: boolean;
4405
+ /**
4406
+ * Optional custom fetch implementation to use for HTTP requests.
4407
+ * Useful for runtimes that need a request-local fetch.
4408
+ * @default globalThis.fetch
4409
+ */
4410
+ fetch?: FetchFunction;
4411
+ };
4412
+ /** MCP tool metadata - keys should follow MCP _meta key format specification */
4413
+ declare const ToolMetaSchema: ZodOptional$1<ZodRecord<ZodString, ZodUnknown>>;
4414
+ type ToolMeta = output$1<typeof ToolMetaSchema>;
4415
+ type ToolSchemas = Record<string, {
4416
+ inputSchema: FlexibleSchema<JSONObject | unknown>;
4417
+ outputSchema?: FlexibleSchema<JSONObject | unknown>;
4418
+ }> | 'automatic' | undefined;
4419
+ /** Base MCP tool type with execute and _meta */
4420
+ type McpToolBase<INPUT = unknown, OUTPUT = CallToolResult> = Tool<INPUT, OUTPUT> & Required<Pick<Tool<INPUT, OUTPUT>, 'execute'>> & {
4421
+ _meta?: ToolMeta;
4422
+ };
4423
+ type McpToolSet<TOOL_SCHEMAS extends ToolSchemas = 'automatic'> = TOOL_SCHEMAS extends Record<string, {
4424
+ inputSchema: FlexibleSchema<any>;
4425
+ outputSchema?: FlexibleSchema<any>;
4426
+ }> ? { [K in keyof TOOL_SCHEMAS]: TOOL_SCHEMAS[K] extends {
4427
+ inputSchema: FlexibleSchema<infer INPUT>;
4428
+ outputSchema: FlexibleSchema<infer OUTPUT>;
4429
+ } ? McpToolBase<INPUT, OUTPUT> : TOOL_SCHEMAS[K] extends {
4430
+ inputSchema: FlexibleSchema<infer INPUT>;
4431
+ } ? McpToolBase<INPUT, CallToolResult> : never; } : Record<string, McpToolBase<unknown, CallToolResult>>;
4432
+ declare const ClientOrServerImplementationSchema: ZodObject<{
4433
+ name: ZodString;
4434
+ version: ZodString;
4435
+ title: ZodOptional$1<ZodString>;
4436
+ }, $loose>;
4437
+ type Configuration = output$1<typeof ClientOrServerImplementationSchema>;
4438
+ declare const BaseParamsSchema: ZodObject<{
4439
+ _meta: ZodOptional$1<ZodObject<{}, $loose>>;
4440
+ }, $loose>;
4441
+ type BaseParams = output$1<typeof BaseParamsSchema>;
4442
+ declare const RequestSchema: ZodObject<{
4443
+ method: ZodString;
4444
+ params: ZodOptional$1<ZodObject<{
4445
+ _meta: ZodOptional$1<ZodObject<{}, $loose>>;
4446
+ }, $loose>>;
4447
+ }, $strip>;
4448
+ type Request = output$1<typeof RequestSchema>;
4449
+ type RequestOptions = {
4450
+ signal?: AbortSignal;
4451
+ timeout?: number;
4452
+ maxTotalTimeout?: number;
4453
+ };
4454
+ declare const ClientCapabilitiesSchema: ZodObject<{
4455
+ elicitation: ZodOptional$1<ZodObject<{
4456
+ applyDefaults: ZodOptional$1<ZodBoolean>;
4457
+ }, $loose>>;
4458
+ }, $loose>;
4459
+ type ClientCapabilities = output$1<typeof ClientCapabilitiesSchema>;
4460
+ declare const InitializeResultSchema: ZodObject<{
4461
+ _meta: ZodOptional$1<ZodObject<{}, $loose>>;
4462
+ protocolVersion: ZodString;
4463
+ capabilities: ZodObject<{
4464
+ experimental: ZodOptional$1<ZodObject<{}, $loose>>;
4465
+ logging: ZodOptional$1<ZodObject<{}, $loose>>;
4466
+ completions: ZodOptional$1<ZodObject<{}, $loose>>;
4467
+ prompts: ZodOptional$1<ZodObject<{
4468
+ listChanged: ZodOptional$1<ZodBoolean>;
4469
+ }, $loose>>;
4470
+ resources: ZodOptional$1<ZodObject<{
4471
+ subscribe: ZodOptional$1<ZodBoolean>;
4472
+ listChanged: ZodOptional$1<ZodBoolean>;
4473
+ }, $loose>>;
4474
+ tools: ZodOptional$1<ZodObject<{
4475
+ listChanged: ZodOptional$1<ZodBoolean>;
4476
+ }, $loose>>;
4477
+ elicitation: ZodOptional$1<ZodObject<{
4478
+ applyDefaults: ZodOptional$1<ZodBoolean>;
4479
+ }, $loose>>;
4480
+ }, $loose>;
4481
+ serverInfo: ZodObject<{
4482
+ name: ZodString;
4483
+ version: ZodString;
4484
+ title: ZodOptional$1<ZodString>;
4485
+ }, $loose>;
4486
+ instructions: ZodOptional$1<ZodString>;
4487
+ }, $loose>;
4488
+ type InitializeResult = output$1<typeof InitializeResultSchema>;
4489
+ type PaginatedRequest = Request & {
4490
+ params?: BaseParams & {
4491
+ cursor?: string;
4492
+ };
4493
+ };
4494
+ declare const ListToolsResultSchema: ZodObject<{
4495
+ _meta: ZodOptional$1<ZodObject<{}, $loose>>;
4496
+ nextCursor: ZodOptional$1<ZodString>;
4497
+ tools: ZodArray$1<ZodObject<{
4498
+ name: ZodString;
4499
+ title: ZodOptional$1<ZodString>;
4500
+ description: ZodOptional$1<ZodString>;
4501
+ inputSchema: ZodObject<{
4502
+ type: ZodLiteral<"object">;
4503
+ properties: ZodOptional$1<ZodObject<{}, $loose>>;
4504
+ }, $loose>;
4505
+ outputSchema: ZodOptional$1<ZodObject<{}, $loose>>;
4506
+ annotations: ZodOptional$1<ZodObject<{
4507
+ title: ZodOptional$1<ZodString>;
4508
+ }, $loose>>;
4509
+ _meta: ZodOptional$1<ZodRecord<ZodString, ZodUnknown>>;
4510
+ }, $loose>>;
4511
+ }, $loose>;
4512
+ type ListToolsResult = output$1<typeof ListToolsResultSchema>;
4513
+ declare const ListResourcesResultSchema: ZodObject<{
4514
+ _meta: ZodOptional$1<ZodObject<{}, $loose>>;
4515
+ nextCursor: ZodOptional$1<ZodString>;
4516
+ resources: ZodArray$1<ZodObject<{
4517
+ uri: ZodString;
4518
+ name: ZodString;
4519
+ title: ZodOptional$1<ZodString>;
4520
+ description: ZodOptional$1<ZodString>;
4521
+ mimeType: ZodOptional$1<ZodString>;
4522
+ size: ZodOptional$1<ZodNumber>;
4523
+ }, $loose>>;
4524
+ }, $loose>;
4525
+ type ListResourcesResult = output$1<typeof ListResourcesResultSchema>;
4526
+ declare const CallToolResultSchema: ZodUnion$1<[ZodObject<{
4527
+ _meta: ZodOptional$1<ZodObject<{}, $loose>>;
4528
+ content: ZodArray$1<ZodUnion$1<readonly [ZodObject<{
4529
+ type: ZodLiteral<"text">;
4530
+ text: ZodString;
4531
+ }, $loose>, ZodObject<{
4532
+ type: ZodLiteral<"image">;
4533
+ data: ZodBase64;
4534
+ mimeType: ZodString;
4535
+ }, $loose>, ZodObject<{
4536
+ type: ZodLiteral<"resource">;
4537
+ resource: ZodUnion$1<readonly [ZodObject<{
4538
+ uri: ZodString;
4539
+ name: ZodOptional$1<ZodString>;
4540
+ title: ZodOptional$1<ZodString>;
4541
+ mimeType: ZodOptional$1<ZodString>;
4542
+ text: ZodString;
4543
+ }, $loose>, ZodObject<{
4544
+ uri: ZodString;
4545
+ name: ZodOptional$1<ZodString>;
4546
+ title: ZodOptional$1<ZodString>;
4547
+ mimeType: ZodOptional$1<ZodString>;
4548
+ blob: ZodBase64;
4549
+ }, $loose>]>;
4550
+ }, $loose>, ZodObject<{
4551
+ type: ZodLiteral<"resource_link">;
4552
+ uri: ZodString;
4553
+ name: ZodString;
4554
+ description: ZodOptional$1<ZodString>;
4555
+ mimeType: ZodOptional$1<ZodString>;
4556
+ }, $loose>]>>;
4557
+ structuredContent: ZodOptional$1<ZodUnknown>;
4558
+ isError: ZodOptional$1<ZodDefault$1<ZodBoolean>>;
4559
+ }, $loose>, ZodObject<{
4560
+ _meta: ZodOptional$1<ZodObject<{}, $loose>>;
4561
+ toolResult: ZodUnknown;
4562
+ }, $loose>]>;
4563
+ type CallToolResult = output$1<typeof CallToolResultSchema>;
4564
+ declare const ListResourceTemplatesResultSchema: ZodObject<{
4565
+ _meta: ZodOptional$1<ZodObject<{}, $loose>>;
4566
+ resourceTemplates: ZodArray$1<ZodObject<{
4567
+ uriTemplate: ZodString;
4568
+ name: ZodString;
4569
+ title: ZodOptional$1<ZodString>;
4570
+ description: ZodOptional$1<ZodString>;
4571
+ mimeType: ZodOptional$1<ZodString>;
4572
+ }, $loose>>;
4573
+ }, $loose>;
4574
+ type ListResourceTemplatesResult = output$1<typeof ListResourceTemplatesResultSchema>;
4575
+ declare const ReadResourceResultSchema: ZodObject<{
4576
+ _meta: ZodOptional$1<ZodObject<{}, $loose>>;
4577
+ contents: ZodArray$1<ZodUnion$1<readonly [ZodObject<{
4578
+ uri: ZodString;
4579
+ name: ZodOptional$1<ZodString>;
4580
+ title: ZodOptional$1<ZodString>;
4581
+ mimeType: ZodOptional$1<ZodString>;
4582
+ text: ZodString;
4583
+ }, $loose>, ZodObject<{
4584
+ uri: ZodString;
4585
+ name: ZodOptional$1<ZodString>;
4586
+ title: ZodOptional$1<ZodString>;
4587
+ mimeType: ZodOptional$1<ZodString>;
4588
+ blob: ZodBase64;
4589
+ }, $loose>]>>;
4590
+ }, $loose>;
4591
+ type ReadResourceResult = output$1<typeof ReadResourceResultSchema>;
4592
+ declare const CompleteRequestParamsSchema: ZodObject<{
4593
+ _meta: ZodOptional$1<ZodObject<{}, $loose>>;
4594
+ ref: ZodUnion$1<readonly [ZodObject<{
4595
+ type: ZodLiteral<"ref/prompt">;
4596
+ name: ZodString;
4597
+ }, $loose>, ZodObject<{
4598
+ type: ZodLiteral<"ref/resource">;
4599
+ uri: ZodString;
4600
+ }, $loose>]>;
4601
+ argument: ZodObject<{
4602
+ name: ZodString;
4603
+ value: ZodString;
4604
+ }, $loose>;
4605
+ context: ZodOptional$1<ZodObject<{
4606
+ arguments: ZodRecord<ZodString, ZodString>;
4607
+ }, $loose>>;
4608
+ }, $loose>;
4609
+ type CompleteRequestParams = output$1<typeof CompleteRequestParamsSchema>;
4610
+ declare const CompleteResultSchema: ZodObject<{
4611
+ _meta: ZodOptional$1<ZodObject<{}, $loose>>;
4612
+ completion: ZodObject<{
4613
+ values: ZodArray$1<ZodString>;
4614
+ total: ZodOptional$1<ZodNumber>;
4615
+ hasMore: ZodOptional$1<ZodBoolean>;
4616
+ }, $loose>;
4617
+ }, $loose>;
4618
+ type CompleteResult = output$1<typeof CompleteResultSchema>;
4619
+ declare const ListPromptsResultSchema: ZodObject<{
4620
+ _meta: ZodOptional$1<ZodObject<{}, $loose>>;
4621
+ nextCursor: ZodOptional$1<ZodString>;
4622
+ prompts: ZodArray$1<ZodObject<{
4623
+ name: ZodString;
4624
+ title: ZodOptional$1<ZodString>;
4625
+ description: ZodOptional$1<ZodString>;
4626
+ arguments: ZodOptional$1<ZodArray$1<ZodObject<{
4627
+ name: ZodString;
4628
+ description: ZodOptional$1<ZodString>;
4629
+ required: ZodOptional$1<ZodBoolean>;
4630
+ }, $loose>>>;
4631
+ }, $loose>>;
4632
+ }, $loose>;
4633
+ type ListPromptsResult = output$1<typeof ListPromptsResultSchema>;
4634
+ declare const GetPromptResultSchema: ZodObject<{
4635
+ _meta: ZodOptional$1<ZodObject<{}, $loose>>;
4636
+ description: ZodOptional$1<ZodString>;
4637
+ messages: ZodArray$1<ZodObject<{
4638
+ role: ZodUnion$1<readonly [ZodLiteral<"user">, ZodLiteral<"assistant">]>;
4639
+ content: ZodUnion$1<readonly [ZodObject<{
4640
+ type: ZodLiteral<"text">;
4641
+ text: ZodString;
4642
+ }, $loose>, ZodObject<{
4643
+ type: ZodLiteral<"image">;
4644
+ data: ZodBase64;
4645
+ mimeType: ZodString;
4646
+ }, $loose>, ZodObject<{
4647
+ type: ZodLiteral<"resource">;
4648
+ resource: ZodUnion$1<readonly [ZodObject<{
4649
+ uri: ZodString;
4650
+ name: ZodOptional$1<ZodString>;
4651
+ title: ZodOptional$1<ZodString>;
4652
+ mimeType: ZodOptional$1<ZodString>;
4653
+ text: ZodString;
4654
+ }, $loose>, ZodObject<{
4655
+ uri: ZodString;
4656
+ name: ZodOptional$1<ZodString>;
4657
+ title: ZodOptional$1<ZodString>;
4658
+ mimeType: ZodOptional$1<ZodString>;
4659
+ blob: ZodBase64;
4660
+ }, $loose>]>;
4661
+ }, $loose>, ZodObject<{
4662
+ type: ZodLiteral<"resource_link">;
4663
+ uri: ZodString;
4664
+ name: ZodString;
4665
+ description: ZodOptional$1<ZodString>;
4666
+ mimeType: ZodOptional$1<ZodString>;
4667
+ }, $loose>]>;
4668
+ }, $loose>>;
4669
+ }, $loose>;
4670
+ type GetPromptResult = output$1<typeof GetPromptResultSchema>;
4671
+ declare const ElicitationRequestSchema: ZodObject<{
4672
+ method: ZodLiteral<"elicitation/create">;
4673
+ params: ZodObject<{
4674
+ _meta: ZodOptional$1<ZodObject<{}, $loose>>;
4675
+ message: ZodString;
4676
+ requestedSchema: ZodUnknown;
4677
+ }, $loose>;
4678
+ }, $strip>;
4679
+ type ElicitationRequest = output$1<typeof ElicitationRequestSchema>;
4680
+ declare const ElicitResultSchema: ZodObject<{
4681
+ _meta: ZodOptional$1<ZodObject<{}, $loose>>;
4682
+ action: ZodUnion$1<readonly [ZodLiteral<"accept">, ZodLiteral<"decline">, ZodLiteral<"cancel">]>;
4683
+ content: ZodOptional$1<ZodRecord<ZodString, ZodUnknown>>;
4684
+ }, $loose>;
4685
+ type ElicitResult = output$1<typeof ElicitResultSchema>;
4686
+ interface MCPClientConfig {
4687
+ /** Transport configuration for connecting to the MCP server */
4688
+ transport: MCPTransportConfig | MCPTransport;
4689
+ /** Optional callback for uncaught errors */
4690
+ onUncaughtError?: (error: unknown) => void;
4691
+ /**
4692
+ * Maximum number of retries for transient MCP tool call failures.
4693
+ *
4694
+ * Set to 0 to disable retries. Retries only apply to tools/call requests.
4695
+ * JSON-RPC application errors, such as invalid params, are not retried.
4696
+ *
4697
+ * @default 0
4698
+ */
4699
+ maxRetries?: number;
4700
+ /**
4701
+ * Initialize result from a previous MCP session. When provided, the client
4702
+ * starts the transport and reuses this metadata without sending a new
4703
+ * initialize request.
4704
+ */
4705
+ initialInitializeResult?: InitializeResult;
4706
+ /** Optional client name, defaults to 'ai-sdk-mcp-client' */
4707
+ clientName?: string;
4708
+ /**
4709
+ * Optional client name, defaults to 'ai-sdk-mcp-client'
4710
+ *
4711
+ * @deprecated Use `clientName` instead.
4712
+ */
4713
+ name?: string;
4714
+ /** Optional client version, defaults to '1.0.0' */
4715
+ version?: string;
4716
+ /**
4717
+ * Optional client capabilities to advertise during initialization
4718
+ *
4719
+ * NOTE: It is up to the client application to handle the requests properly. This parameter just helps surface the request from the server
4720
+ */
4721
+ capabilities?: ClientCapabilities;
4722
+ }
4723
+ declare function createMCPClient(config: MCPClientConfig): Promise<MCPClient>;
4724
+ interface MCPClient {
4725
+ /**
4726
+ * Information about the connected MCP server, as reported during initialization.
4727
+ * @see https://modelcontextprotocol.io/specification/2025-11-25/schema#implementation
4728
+ */
4729
+ readonly serverInfo: Configuration;
4730
+ /**
4731
+ * The full initialize result used by this client, either from the server
4732
+ * during initialization or from `initialInitializeResult`.
4733
+ */
4734
+ readonly initializeResult: InitializeResult;
4735
+ /**
4736
+ * Optional instructions provided by the server during the initialize handshake.
4737
+ *
4738
+ * These describe how to use the server and its features, and can be used by clients
4739
+ * to improve LLM interactions (e.g. by including them in the system prompt).
4740
+ *
4741
+ * @see https://modelcontextprotocol.io/specification/2025-11-25/schema#initializeresult
4742
+ */
4743
+ readonly instructions?: string;
4744
+ tools<TOOL_SCHEMAS extends ToolSchemas = 'automatic'>(options?: {
4745
+ schemas?: TOOL_SCHEMAS;
4746
+ }): Promise<McpToolSet<TOOL_SCHEMAS>>;
4747
+ /**
4748
+ * Lists available tools from the MCP server.
4749
+ */
4750
+ listTools(options?: {
4751
+ params?: PaginatedRequest['params'];
4752
+ options?: RequestOptions;
4753
+ }): Promise<ListToolsResult>;
4754
+ /**
4755
+ * Calls a tool on the MCP server.
4756
+ */
4757
+ callTool(args: {
4758
+ name: string;
4759
+ arguments?: Record<string, unknown>;
4760
+ options?: RequestOptions;
4761
+ }): Promise<CallToolResult>;
4762
+ /**
4763
+ * Creates AI SDK tools from tool definitions.
4764
+ */
4765
+ toolsFromDefinitions<TOOL_SCHEMAS extends ToolSchemas = 'automatic'>(definitions: ListToolsResult, options?: {
4766
+ schemas?: TOOL_SCHEMAS;
4767
+ }): McpToolSet<TOOL_SCHEMAS>;
4768
+ listResources(options?: {
4769
+ params?: PaginatedRequest['params'];
4770
+ options?: RequestOptions;
4771
+ }): Promise<ListResourcesResult>;
4772
+ readResource(args: {
4773
+ uri: string;
4774
+ options?: RequestOptions;
4775
+ }): Promise<ReadResourceResult>;
4776
+ listResourceTemplates(options?: {
4777
+ options?: RequestOptions;
4778
+ }): Promise<ListResourceTemplatesResult>;
4779
+ experimental_listPrompts(options?: {
4780
+ params?: PaginatedRequest['params'];
4781
+ options?: RequestOptions;
4782
+ }): Promise<ListPromptsResult>;
4783
+ experimental_getPrompt(args: {
4784
+ name: string;
4785
+ arguments?: Record<string, unknown>;
4786
+ options?: RequestOptions;
4787
+ }): Promise<GetPromptResult>;
4788
+ complete(args: CompleteRequestParams & {
4789
+ options?: RequestOptions;
4790
+ }): Promise<CompleteResult>;
4791
+ onElicitationRequest(schema: typeof ElicitationRequestSchema, handler: (request: ElicitationRequest) => Promise<ElicitResult> | ElicitResult): void;
4792
+ close: () => Promise<void>;
4793
+ }
4794
+ //#endregion
4795
+ //#region src/mcp/tools.d.ts
4796
+ type McpClient = Awaited<ReturnType<typeof createMCPClient>>;
4797
+ type ConnectMcpToolsConfig = {
4798
+ url: string;
4799
+ orgId: string;
4800
+ accessToken: string;
4801
+ };
4802
+ declare function connectMcpTools(config: ConnectMcpToolsConfig): Promise<{
4803
+ client: McpClient;
4804
+ tools: ToolSet;
4805
+ }>;
4806
+ //#endregion
4807
+ //#region src/provider/resolve-model.d.ts
4808
+ type ResolveAiModelConfig = {
4809
+ npm: string;
4810
+ apiKey: string;
4811
+ model: string;
4812
+ apiUrl?: string;
4813
+ options?: Record<string, unknown>;
4814
+ };
4815
+ declare function resolveAiModel(config: ResolveAiModelConfig): LanguageModel;
4816
+ //#endregion
4817
+ export { type ConnectMcpToolsConfig, type McpClient, type ResolveAiModelConfig, connectMcpTools, resolveAiModel };