@ai-sdk/gateway 4.0.141 → 4.0.142

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.
package/src/zod.ts CHANGED
@@ -2,34 +2,76 @@ import {
2
2
  any,
3
3
  array,
4
4
  boolean,
5
+ catchall,
5
6
  discriminatedUnion,
6
7
  enum as enumType,
8
+ extend,
7
9
  instanceof as instanceOf,
8
- literal,
10
+ int,
9
11
  json,
12
+ length,
13
+ literal,
14
+ maxLength,
15
+ maximum,
16
+ minLength,
17
+ minimum,
18
+ never,
19
+ nullable,
20
+ nullish,
10
21
  number,
11
22
  object,
23
+ optional,
24
+ pipe,
12
25
  record,
26
+ refine,
13
27
  string,
28
+ transform,
14
29
  union,
15
30
  unknown,
16
- } from 'zod/v4';
31
+ url,
32
+ globalRegistry,
33
+ type ZodMiniType,
34
+ } from 'zod/v4/mini';
17
35
 
18
- // Import individual Zod factories so bundlers do not retain the full `z`
19
- // namespace and all of its locale exports.
36
+ // Import individual Mini factories so bundlers retain only the schemas in use.
20
37
  export const z = {
21
38
  any,
22
39
  array,
23
40
  boolean,
41
+ catchall,
42
+ describe,
24
43
  discriminatedUnion,
25
44
  enum: enumType,
45
+ extend,
26
46
  instanceof: instanceOf,
27
- literal,
47
+ int,
28
48
  json,
49
+ length,
50
+ literal,
51
+ maxLength,
52
+ maximum,
53
+ minLength,
54
+ minimum,
55
+ never,
56
+ nullable,
57
+ nullish,
29
58
  number,
30
59
  object,
60
+ optional,
61
+ pipe,
31
62
  record,
63
+ refine,
32
64
  string,
65
+ transform,
33
66
  union,
34
67
  unknown,
68
+ url,
35
69
  };
70
+
71
+ // Zod 3.25.76 bundles Mini without a describe helper. Register on a clone to
72
+ // preserve descriptions without raising the minimum supported Zod version.
73
+ function describe<T extends ZodMiniType>(schema: T, description: string): T {
74
+ const clone = schema.clone();
75
+ globalRegistry.add(clone, { description });
76
+ return clone;
77
+ }