@mastra/schema-compat 0.10.2-alpha.2 → 0.10.2-alpha.3

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.
@@ -1,23 +1,23 @@
1
1
 
2
- > @mastra/schema-compat@0.10.2-alpha.2 build /home/runner/work/mastra/mastra/packages/schema-compat
2
+ > @mastra/schema-compat@0.10.2-alpha.3 build /home/runner/work/mastra/mastra/packages/schema-compat
3
3
  > tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting
4
4
 
5
5
  CLI Building entry: src/index.ts
6
6
  CLI Using tsconfig: tsconfig.json
7
7
  CLI tsup v8.5.0
8
8
  TSC Build start
9
- TSC ⚡️ Build success in 2215ms
9
+ TSC ⚡️ Build success in 2363ms
10
10
  DTS Build start
11
11
  CLI Target: es2022
12
12
  Analysis will use the bundled TypeScript version 5.8.3
13
13
  Writing package typings: /home/runner/work/mastra/mastra/packages/schema-compat/dist/_tsup-dts-rollup.d.ts
14
14
  Analysis will use the bundled TypeScript version 5.8.3
15
15
  Writing package typings: /home/runner/work/mastra/mastra/packages/schema-compat/dist/_tsup-dts-rollup.d.cts
16
- DTS ⚡️ Build success in 1992ms
16
+ DTS ⚡️ Build success in 1947ms
17
17
  CLI Cleaning output folder
18
18
  ESM Build start
19
19
  CJS Build start
20
- CJS dist/index.cjs 22.96 KB
21
- CJS ⚡️ Build success in 175ms
22
- ESM dist/index.js 22.37 KB
20
+ ESM dist/index.js 21.03 KB
23
21
  ESM ⚡️ Build success in 175ms
22
+ CJS dist/index.cjs 21.65 KB
23
+ CJS ⚡️ Build success in 175ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @mastra/schema-compat
2
2
 
3
+ ## 0.10.2-alpha.3
4
+
5
+ ### Patch Changes
6
+
7
+ - f6fd25f: Updates @mastra/schema-compat to allow all zod schemas. Uses @mastra/schema-compat to apply schema transformations to agent output schema.
8
+
3
9
  ## 0.10.2-alpha.2
4
10
 
5
11
  ### Patch Changes
@@ -3,7 +3,16 @@ import type { LanguageModelV1 } from 'ai';
3
3
  import type { Schema } from 'ai';
4
4
  import type { Targets } from 'zod-to-json-schema';
5
5
  import { z } from 'zod';
6
+ import { ZodArray } from 'zod';
7
+ import { ZodDate } from 'zod';
8
+ import { ZodDefault } from 'zod';
9
+ import { ZodNumber } from 'zod';
10
+ import { ZodObject } from 'zod';
11
+ import { ZodOptional } from 'zod';
6
12
  import type { ZodSchema } from 'zod';
13
+ import { ZodString } from 'zod';
14
+ import type { ZodTypeAny } from 'zod';
15
+ import { ZodUnion } from 'zod';
7
16
 
8
17
  /**
9
18
  * All supported array validation check types that can be processed or converted to descriptions.
@@ -48,7 +57,7 @@ declare class AnthropicSchemaCompatLayer extends SchemaCompatLayer {
48
57
  constructor(model: LanguageModelV1);
49
58
  getSchemaTarget(): Targets | undefined;
50
59
  shouldApply(): boolean;
51
- processZodType<T extends z.AnyZodObject>(value: z.ZodTypeAny): ShapeValue<T>;
60
+ processZodType(value: ZodTypeAny): ZodTypeAny;
52
61
  }
53
62
  export { AnthropicSchemaCompatLayer }
54
63
  export { AnthropicSchemaCompatLayer as AnthropicSchemaCompatLayer_alias_1 }
@@ -63,7 +72,7 @@ export { AnthropicSchemaCompatLayer as AnthropicSchemaCompatLayer_alias_1 }
63
72
  * @returns Processed schema as an AI SDK Schema
64
73
  */
65
74
  declare function applyCompatLayer(options: {
66
- schema: Schema | z.AnyZodObject;
75
+ schema: Schema | z.ZodSchema;
67
76
  compatLayers: SchemaCompatLayer[];
68
77
  mode: 'aiSdkSchema';
69
78
  }): Schema;
@@ -78,7 +87,7 @@ declare function applyCompatLayer(options: {
78
87
  * @returns Processed schema as a JSONSchema7
79
88
  */
80
89
  declare function applyCompatLayer(options: {
81
- schema: Schema | z.AnyZodObject;
90
+ schema: Schema | z.ZodSchema;
82
91
  compatLayers: SchemaCompatLayer[];
83
92
  mode: 'jsonSchema';
84
93
  }): JSONSchema7;
@@ -164,7 +173,7 @@ declare class DeepSeekSchemaCompatLayer extends SchemaCompatLayer {
164
173
  constructor(model: LanguageModelV1);
165
174
  getSchemaTarget(): Targets | undefined;
166
175
  shouldApply(): boolean;
167
- processZodType<T extends z.AnyZodObject>(value: z.ZodTypeAny): ShapeValue<T>;
176
+ processZodType(value: ZodTypeAny): ZodTypeAny;
168
177
  }
169
178
  export { DeepSeekSchemaCompatLayer }
170
179
  export { DeepSeekSchemaCompatLayer as DeepSeekSchemaCompatLayer_alias_1 }
@@ -173,16 +182,44 @@ declare class GoogleSchemaCompatLayer extends SchemaCompatLayer {
173
182
  constructor(model: LanguageModelV1);
174
183
  getSchemaTarget(): Targets | undefined;
175
184
  shouldApply(): boolean;
176
- processZodType<T extends z.AnyZodObject>(value: z.ZodTypeAny): ShapeValue<T>;
185
+ processZodType(value: ZodTypeAny): ZodTypeAny;
177
186
  }
178
187
  export { GoogleSchemaCompatLayer }
179
188
  export { GoogleSchemaCompatLayer as GoogleSchemaCompatLayer_alias_1 }
180
189
 
190
+ declare const isArr: (v: ZodTypeAny) => v is ZodArray<any, any>;
191
+ export { isArr }
192
+ export { isArr as isArr_alias_1 }
193
+
194
+ export declare const isDate: (v: ZodTypeAny) => v is ZodDate;
195
+
196
+ export declare const isDefault: (v: ZodTypeAny) => v is ZodDefault<any>;
197
+
198
+ declare const isNumber: (v: ZodTypeAny) => v is ZodNumber;
199
+ export { isNumber }
200
+ export { isNumber as isNumber_alias_1 }
201
+
202
+ declare const isObj: (v: ZodTypeAny) => v is ZodObject<any, any, any>;
203
+ export { isObj }
204
+ export { isObj as isObj_alias_1 }
205
+
206
+ declare const isOptional: (v: ZodTypeAny) => v is ZodOptional<any>;
207
+ export { isOptional }
208
+ export { isOptional as isOptional_alias_1 }
209
+
210
+ declare const isString: (v: ZodTypeAny) => v is ZodString;
211
+ export { isString }
212
+ export { isString as isString_alias_1 }
213
+
214
+ declare const isUnion: (v: ZodTypeAny) => v is ZodUnion<[ZodTypeAny, ...ZodTypeAny[]]>;
215
+ export { isUnion }
216
+ export { isUnion as isUnion_alias_1 }
217
+
181
218
  declare class MetaSchemaCompatLayer extends SchemaCompatLayer {
182
219
  constructor(model: LanguageModelV1);
183
220
  getSchemaTarget(): Targets | undefined;
184
221
  shouldApply(): boolean;
185
- processZodType<T extends z.AnyZodObject>(value: z.ZodTypeAny): ShapeValue<T>;
222
+ processZodType(value: ZodTypeAny): ZodTypeAny;
186
223
  }
187
224
  export { MetaSchemaCompatLayer }
188
225
  export { MetaSchemaCompatLayer as MetaSchemaCompatLayer_alias_1 }
@@ -207,7 +244,7 @@ declare class OpenAIReasoningSchemaCompatLayer extends SchemaCompatLayer {
207
244
  getSchemaTarget(): Targets | undefined;
208
245
  isReasoningModel(): boolean;
209
246
  shouldApply(): boolean;
210
- processZodType<T extends z.AnyZodObject>(value: z.ZodTypeAny): ShapeValue<T>;
247
+ processZodType(value: ZodTypeAny): ZodTypeAny;
211
248
  }
212
249
  export { OpenAIReasoningSchemaCompatLayer }
213
250
  export { OpenAIReasoningSchemaCompatLayer as OpenAIReasoningSchemaCompatLayer_alias_1 }
@@ -216,7 +253,7 @@ declare class OpenAISchemaCompatLayer extends SchemaCompatLayer {
216
253
  constructor(model: LanguageModelV1);
217
254
  getSchemaTarget(): Targets | undefined;
218
255
  shouldApply(): boolean;
219
- processZodType<T extends z.AnyZodObject>(value: z.ZodTypeAny): ShapeValue<T>;
256
+ processZodType(value: ZodTypeAny): ZodTypeAny;
220
257
  }
221
258
  export { OpenAISchemaCompatLayer }
222
259
  export { OpenAISchemaCompatLayer as OpenAISchemaCompatLayer_alias_1 }
@@ -295,22 +332,14 @@ declare abstract class SchemaCompatLayer {
295
332
  * @returns The processed Zod type
296
333
  * @abstract
297
334
  */
298
- abstract processZodType<T extends z.AnyZodObject>(value: z.ZodTypeAny): ShapeValue<T>;
299
- /**
300
- * Applies compatibility transformations to a Zod object schema.
301
- *
302
- * @param zodSchema - The Zod object schema to transform
303
- * @returns Object containing the transformed schema
304
- * @private
305
- */
306
- private applyZodSchemaCompatibility;
335
+ abstract processZodType(value: ZodTypeAny): ZodTypeAny;
307
336
  /**
308
337
  * Default handler for Zod object types. Recursively processes all properties in the object.
309
338
  *
310
339
  * @param value - The Zod object to process
311
340
  * @returns The processed Zod object
312
341
  */
313
- defaultZodObjectHandler<T extends z.AnyZodObject>(value: z.ZodTypeAny): ShapeValue<T>;
342
+ defaultZodObjectHandler(value: ZodObject<any, any, any>): ZodObject<any, any, any>;
314
343
  /**
315
344
  * Merges validation constraints into a parameter description.
316
345
  *
@@ -340,7 +369,7 @@ declare abstract class SchemaCompatLayer {
340
369
  * @param handleChecks - Array constraints to convert to descriptions vs keep as validation
341
370
  * @returns The processed Zod array
342
371
  */
343
- defaultZodArrayHandler<T extends z.AnyZodObject>(value: z.ZodTypeAny, handleChecks?: readonly ArrayCheckType[]): ShapeValue<T>;
372
+ defaultZodArrayHandler(value: ZodArray<any, any>, handleChecks?: readonly ArrayCheckType[]): ZodArray<any, any>;
344
373
  /**
345
374
  * Default handler for Zod union types. Processes all union options.
346
375
  *
@@ -348,7 +377,7 @@ declare abstract class SchemaCompatLayer {
348
377
  * @returns The processed Zod union
349
378
  * @throws Error if union has fewer than 2 options
350
379
  */
351
- defaultZodUnionHandler<T extends z.AnyZodObject>(value: z.ZodTypeAny): ShapeValue<T>;
380
+ defaultZodUnionHandler(value: ZodUnion<[ZodTypeAny, ...ZodTypeAny[]]>): ZodTypeAny;
352
381
  /**
353
382
  * Default handler for Zod string types. Processes string validation constraints.
354
383
  *
@@ -356,7 +385,7 @@ declare abstract class SchemaCompatLayer {
356
385
  * @param handleChecks - String constraints to convert to descriptions vs keep as validation
357
386
  * @returns The processed Zod string
358
387
  */
359
- defaultZodStringHandler<T extends z.AnyZodObject>(value: z.ZodTypeAny, handleChecks?: readonly StringCheckType[]): ShapeValue<T>;
388
+ defaultZodStringHandler(value: ZodString, handleChecks?: readonly StringCheckType[]): ZodString;
360
389
  /**
361
390
  * Default handler for Zod number types. Processes number validation constraints.
362
391
  *
@@ -364,14 +393,14 @@ declare abstract class SchemaCompatLayer {
364
393
  * @param handleChecks - Number constraints to convert to descriptions vs keep as validation
365
394
  * @returns The processed Zod number
366
395
  */
367
- defaultZodNumberHandler<T extends z.AnyZodObject>(value: z.ZodTypeAny, handleChecks?: readonly NumberCheckType[]): ShapeValue<T>;
396
+ defaultZodNumberHandler(value: ZodNumber, handleChecks?: readonly NumberCheckType[]): ZodNumber;
368
397
  /**
369
398
  * Default handler for Zod date types. Converts dates to ISO strings with constraint descriptions.
370
399
  *
371
400
  * @param value - The Zod date to process
372
401
  * @returns A Zod string schema representing the date in ISO format
373
402
  */
374
- defaultZodDateHandler<T extends z.AnyZodObject>(value: z.ZodTypeAny): ShapeValue<T>;
403
+ defaultZodDateHandler(value: ZodDate): ZodString;
375
404
  /**
376
405
  * Default handler for Zod optional types. Processes the inner type and maintains optionality.
377
406
  *
@@ -379,21 +408,21 @@ declare abstract class SchemaCompatLayer {
379
408
  * @param handleTypes - Types that should be processed vs passed through
380
409
  * @returns The processed Zod optional
381
410
  */
382
- defaultZodOptionalHandler<T extends z.AnyZodObject>(value: z.ZodTypeAny, handleTypes?: readonly AllZodType[]): ShapeValue<T>;
411
+ defaultZodOptionalHandler(value: ZodOptional<any>, handleTypes?: readonly AllZodType[]): ZodTypeAny;
383
412
  /**
384
413
  * Processes a Zod object schema and converts it to an AI SDK Schema.
385
414
  *
386
415
  * @param zodSchema - The Zod object schema to process
387
416
  * @returns An AI SDK Schema with provider-specific compatibility applied
388
417
  */
389
- processToAISDKSchema(zodSchema: z.AnyZodObject): Schema;
418
+ processToAISDKSchema(zodSchema: z.ZodSchema): Schema;
390
419
  /**
391
420
  * Processes a Zod object schema and converts it to a JSON Schema.
392
421
  *
393
422
  * @param zodSchema - The Zod object schema to process
394
423
  * @returns A JSONSchema7 object with provider-specific compatibility applied
395
424
  */
396
- processToJSONSchema(zodSchema: z.AnyZodObject): JSONSchema7;
425
+ processToJSONSchema(zodSchema: z.ZodSchema): JSONSchema7;
397
426
  }
398
427
  export { SchemaCompatLayer }
399
428
  export { SchemaCompatLayer as SchemaCompatLayer_alias_1 }
@@ -3,7 +3,16 @@ import type { LanguageModelV1 } from 'ai';
3
3
  import type { Schema } from 'ai';
4
4
  import type { Targets } from 'zod-to-json-schema';
5
5
  import { z } from 'zod';
6
+ import { ZodArray } from 'zod';
7
+ import { ZodDate } from 'zod';
8
+ import { ZodDefault } from 'zod';
9
+ import { ZodNumber } from 'zod';
10
+ import { ZodObject } from 'zod';
11
+ import { ZodOptional } from 'zod';
6
12
  import type { ZodSchema } from 'zod';
13
+ import { ZodString } from 'zod';
14
+ import type { ZodTypeAny } from 'zod';
15
+ import { ZodUnion } from 'zod';
7
16
 
8
17
  /**
9
18
  * All supported array validation check types that can be processed or converted to descriptions.
@@ -48,7 +57,7 @@ declare class AnthropicSchemaCompatLayer extends SchemaCompatLayer {
48
57
  constructor(model: LanguageModelV1);
49
58
  getSchemaTarget(): Targets | undefined;
50
59
  shouldApply(): boolean;
51
- processZodType<T extends z.AnyZodObject>(value: z.ZodTypeAny): ShapeValue<T>;
60
+ processZodType(value: ZodTypeAny): ZodTypeAny;
52
61
  }
53
62
  export { AnthropicSchemaCompatLayer }
54
63
  export { AnthropicSchemaCompatLayer as AnthropicSchemaCompatLayer_alias_1 }
@@ -63,7 +72,7 @@ export { AnthropicSchemaCompatLayer as AnthropicSchemaCompatLayer_alias_1 }
63
72
  * @returns Processed schema as an AI SDK Schema
64
73
  */
65
74
  declare function applyCompatLayer(options: {
66
- schema: Schema | z.AnyZodObject;
75
+ schema: Schema | z.ZodSchema;
67
76
  compatLayers: SchemaCompatLayer[];
68
77
  mode: 'aiSdkSchema';
69
78
  }): Schema;
@@ -78,7 +87,7 @@ declare function applyCompatLayer(options: {
78
87
  * @returns Processed schema as a JSONSchema7
79
88
  */
80
89
  declare function applyCompatLayer(options: {
81
- schema: Schema | z.AnyZodObject;
90
+ schema: Schema | z.ZodSchema;
82
91
  compatLayers: SchemaCompatLayer[];
83
92
  mode: 'jsonSchema';
84
93
  }): JSONSchema7;
@@ -164,7 +173,7 @@ declare class DeepSeekSchemaCompatLayer extends SchemaCompatLayer {
164
173
  constructor(model: LanguageModelV1);
165
174
  getSchemaTarget(): Targets | undefined;
166
175
  shouldApply(): boolean;
167
- processZodType<T extends z.AnyZodObject>(value: z.ZodTypeAny): ShapeValue<T>;
176
+ processZodType(value: ZodTypeAny): ZodTypeAny;
168
177
  }
169
178
  export { DeepSeekSchemaCompatLayer }
170
179
  export { DeepSeekSchemaCompatLayer as DeepSeekSchemaCompatLayer_alias_1 }
@@ -173,16 +182,44 @@ declare class GoogleSchemaCompatLayer extends SchemaCompatLayer {
173
182
  constructor(model: LanguageModelV1);
174
183
  getSchemaTarget(): Targets | undefined;
175
184
  shouldApply(): boolean;
176
- processZodType<T extends z.AnyZodObject>(value: z.ZodTypeAny): ShapeValue<T>;
185
+ processZodType(value: ZodTypeAny): ZodTypeAny;
177
186
  }
178
187
  export { GoogleSchemaCompatLayer }
179
188
  export { GoogleSchemaCompatLayer as GoogleSchemaCompatLayer_alias_1 }
180
189
 
190
+ declare const isArr: (v: ZodTypeAny) => v is ZodArray<any, any>;
191
+ export { isArr }
192
+ export { isArr as isArr_alias_1 }
193
+
194
+ export declare const isDate: (v: ZodTypeAny) => v is ZodDate;
195
+
196
+ export declare const isDefault: (v: ZodTypeAny) => v is ZodDefault<any>;
197
+
198
+ declare const isNumber: (v: ZodTypeAny) => v is ZodNumber;
199
+ export { isNumber }
200
+ export { isNumber as isNumber_alias_1 }
201
+
202
+ declare const isObj: (v: ZodTypeAny) => v is ZodObject<any, any, any>;
203
+ export { isObj }
204
+ export { isObj as isObj_alias_1 }
205
+
206
+ declare const isOptional: (v: ZodTypeAny) => v is ZodOptional<any>;
207
+ export { isOptional }
208
+ export { isOptional as isOptional_alias_1 }
209
+
210
+ declare const isString: (v: ZodTypeAny) => v is ZodString;
211
+ export { isString }
212
+ export { isString as isString_alias_1 }
213
+
214
+ declare const isUnion: (v: ZodTypeAny) => v is ZodUnion<[ZodTypeAny, ...ZodTypeAny[]]>;
215
+ export { isUnion }
216
+ export { isUnion as isUnion_alias_1 }
217
+
181
218
  declare class MetaSchemaCompatLayer extends SchemaCompatLayer {
182
219
  constructor(model: LanguageModelV1);
183
220
  getSchemaTarget(): Targets | undefined;
184
221
  shouldApply(): boolean;
185
- processZodType<T extends z.AnyZodObject>(value: z.ZodTypeAny): ShapeValue<T>;
222
+ processZodType(value: ZodTypeAny): ZodTypeAny;
186
223
  }
187
224
  export { MetaSchemaCompatLayer }
188
225
  export { MetaSchemaCompatLayer as MetaSchemaCompatLayer_alias_1 }
@@ -207,7 +244,7 @@ declare class OpenAIReasoningSchemaCompatLayer extends SchemaCompatLayer {
207
244
  getSchemaTarget(): Targets | undefined;
208
245
  isReasoningModel(): boolean;
209
246
  shouldApply(): boolean;
210
- processZodType<T extends z.AnyZodObject>(value: z.ZodTypeAny): ShapeValue<T>;
247
+ processZodType(value: ZodTypeAny): ZodTypeAny;
211
248
  }
212
249
  export { OpenAIReasoningSchemaCompatLayer }
213
250
  export { OpenAIReasoningSchemaCompatLayer as OpenAIReasoningSchemaCompatLayer_alias_1 }
@@ -216,7 +253,7 @@ declare class OpenAISchemaCompatLayer extends SchemaCompatLayer {
216
253
  constructor(model: LanguageModelV1);
217
254
  getSchemaTarget(): Targets | undefined;
218
255
  shouldApply(): boolean;
219
- processZodType<T extends z.AnyZodObject>(value: z.ZodTypeAny): ShapeValue<T>;
256
+ processZodType(value: ZodTypeAny): ZodTypeAny;
220
257
  }
221
258
  export { OpenAISchemaCompatLayer }
222
259
  export { OpenAISchemaCompatLayer as OpenAISchemaCompatLayer_alias_1 }
@@ -295,22 +332,14 @@ declare abstract class SchemaCompatLayer {
295
332
  * @returns The processed Zod type
296
333
  * @abstract
297
334
  */
298
- abstract processZodType<T extends z.AnyZodObject>(value: z.ZodTypeAny): ShapeValue<T>;
299
- /**
300
- * Applies compatibility transformations to a Zod object schema.
301
- *
302
- * @param zodSchema - The Zod object schema to transform
303
- * @returns Object containing the transformed schema
304
- * @private
305
- */
306
- private applyZodSchemaCompatibility;
335
+ abstract processZodType(value: ZodTypeAny): ZodTypeAny;
307
336
  /**
308
337
  * Default handler for Zod object types. Recursively processes all properties in the object.
309
338
  *
310
339
  * @param value - The Zod object to process
311
340
  * @returns The processed Zod object
312
341
  */
313
- defaultZodObjectHandler<T extends z.AnyZodObject>(value: z.ZodTypeAny): ShapeValue<T>;
342
+ defaultZodObjectHandler(value: ZodObject<any, any, any>): ZodObject<any, any, any>;
314
343
  /**
315
344
  * Merges validation constraints into a parameter description.
316
345
  *
@@ -340,7 +369,7 @@ declare abstract class SchemaCompatLayer {
340
369
  * @param handleChecks - Array constraints to convert to descriptions vs keep as validation
341
370
  * @returns The processed Zod array
342
371
  */
343
- defaultZodArrayHandler<T extends z.AnyZodObject>(value: z.ZodTypeAny, handleChecks?: readonly ArrayCheckType[]): ShapeValue<T>;
372
+ defaultZodArrayHandler(value: ZodArray<any, any>, handleChecks?: readonly ArrayCheckType[]): ZodArray<any, any>;
344
373
  /**
345
374
  * Default handler for Zod union types. Processes all union options.
346
375
  *
@@ -348,7 +377,7 @@ declare abstract class SchemaCompatLayer {
348
377
  * @returns The processed Zod union
349
378
  * @throws Error if union has fewer than 2 options
350
379
  */
351
- defaultZodUnionHandler<T extends z.AnyZodObject>(value: z.ZodTypeAny): ShapeValue<T>;
380
+ defaultZodUnionHandler(value: ZodUnion<[ZodTypeAny, ...ZodTypeAny[]]>): ZodTypeAny;
352
381
  /**
353
382
  * Default handler for Zod string types. Processes string validation constraints.
354
383
  *
@@ -356,7 +385,7 @@ declare abstract class SchemaCompatLayer {
356
385
  * @param handleChecks - String constraints to convert to descriptions vs keep as validation
357
386
  * @returns The processed Zod string
358
387
  */
359
- defaultZodStringHandler<T extends z.AnyZodObject>(value: z.ZodTypeAny, handleChecks?: readonly StringCheckType[]): ShapeValue<T>;
388
+ defaultZodStringHandler(value: ZodString, handleChecks?: readonly StringCheckType[]): ZodString;
360
389
  /**
361
390
  * Default handler for Zod number types. Processes number validation constraints.
362
391
  *
@@ -364,14 +393,14 @@ declare abstract class SchemaCompatLayer {
364
393
  * @param handleChecks - Number constraints to convert to descriptions vs keep as validation
365
394
  * @returns The processed Zod number
366
395
  */
367
- defaultZodNumberHandler<T extends z.AnyZodObject>(value: z.ZodTypeAny, handleChecks?: readonly NumberCheckType[]): ShapeValue<T>;
396
+ defaultZodNumberHandler(value: ZodNumber, handleChecks?: readonly NumberCheckType[]): ZodNumber;
368
397
  /**
369
398
  * Default handler for Zod date types. Converts dates to ISO strings with constraint descriptions.
370
399
  *
371
400
  * @param value - The Zod date to process
372
401
  * @returns A Zod string schema representing the date in ISO format
373
402
  */
374
- defaultZodDateHandler<T extends z.AnyZodObject>(value: z.ZodTypeAny): ShapeValue<T>;
403
+ defaultZodDateHandler(value: ZodDate): ZodString;
375
404
  /**
376
405
  * Default handler for Zod optional types. Processes the inner type and maintains optionality.
377
406
  *
@@ -379,21 +408,21 @@ declare abstract class SchemaCompatLayer {
379
408
  * @param handleTypes - Types that should be processed vs passed through
380
409
  * @returns The processed Zod optional
381
410
  */
382
- defaultZodOptionalHandler<T extends z.AnyZodObject>(value: z.ZodTypeAny, handleTypes?: readonly AllZodType[]): ShapeValue<T>;
411
+ defaultZodOptionalHandler(value: ZodOptional<any>, handleTypes?: readonly AllZodType[]): ZodTypeAny;
383
412
  /**
384
413
  * Processes a Zod object schema and converts it to an AI SDK Schema.
385
414
  *
386
415
  * @param zodSchema - The Zod object schema to process
387
416
  * @returns An AI SDK Schema with provider-specific compatibility applied
388
417
  */
389
- processToAISDKSchema(zodSchema: z.AnyZodObject): Schema;
418
+ processToAISDKSchema(zodSchema: z.ZodSchema): Schema;
390
419
  /**
391
420
  * Processes a Zod object schema and converts it to a JSON Schema.
392
421
  *
393
422
  * @param zodSchema - The Zod object schema to process
394
423
  * @returns A JSONSchema7 object with provider-specific compatibility applied
395
424
  */
396
- processToJSONSchema(zodSchema: z.AnyZodObject): JSONSchema7;
425
+ processToJSONSchema(zodSchema: z.ZodSchema): JSONSchema7;
397
426
  }
398
427
  export { SchemaCompatLayer }
399
428
  export { SchemaCompatLayer as SchemaCompatLayer_alias_1 }