@mastra/schema-compat 0.0.0-netlify-no-bundle-20251127120354 → 0.0.0-partial-response-backport-20251204204441
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/CHANGELOG.md +37 -23
- package/dist/index.cjs +44 -3605
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +45 -3605
- package/dist/index.js.map +1 -1
- package/dist/schema-compatibility-v3.d.ts +3 -2
- package/dist/schema-compatibility-v3.d.ts.map +1 -1
- package/dist/schema-compatibility-v4.d.ts +3 -2
- package/dist/schema-compatibility-v4.d.ts.map +1 -1
- package/dist/schema-compatibility.d.ts +3 -2
- package/dist/schema-compatibility.d.ts.map +1 -1
- package/dist/types.d.ts +0 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils-test-suite.d.ts.map +1 -1
- package/dist/utils.d.ts +2 -2
- package/dist/utils.d.ts.map +1 -1
- package/package.json +13 -10
- package/dist/json-schema.d.ts +0 -4
- package/dist/json-schema.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,26 +1,16 @@
|
|
|
1
1
|
# @mastra/schema-compat
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
4
|
-
|
|
5
|
-
### Major Changes
|
|
6
|
-
|
|
7
|
-
- Bump minimum required Node.js version to 22.13.0 ([#9706](https://github.com/mastra-ai/mastra/pull/9706))
|
|
8
|
-
|
|
9
|
-
- Mark as stable ([`83d5942`](https://github.com/mastra-ai/mastra/commit/83d5942669ce7bba4a6ca4fd4da697a10eb5ebdc))
|
|
3
|
+
## 0.0.0-partial-response-backport-20251204204441
|
|
10
4
|
|
|
11
5
|
### Patch Changes
|
|
12
6
|
|
|
13
|
-
- Fix
|
|
14
|
-
|
|
15
|
-
Zod v4 has a bug in the single-argument form of `z.record(valueSchema)` where it incorrectly assigns the value schema to `keyType` instead of `valueType`, leaving `valueType` undefined. This causes `toJSONSchema()` to throw "Cannot read properties of undefined (reading '\_zod')" when processing schemas containing `z.record()` fields.
|
|
16
|
-
|
|
17
|
-
This fix patches affected schemas before conversion by detecting records with missing `valueType` and correctly assigning the schema to `valueType` while setting `keyType` to `z.string()` (the default). The patch recursively handles nested schemas including those wrapped in `.optional()`, `.nullable()`, arrays, unions, and objects.
|
|
7
|
+
- Fix discriminatedUnion schema information lost when json schema is converted to zod ([#10764](https://github.com/mastra-ai/mastra/pull/10764))
|
|
18
8
|
|
|
19
|
-
|
|
9
|
+
## 0.11.8
|
|
20
10
|
|
|
21
|
-
|
|
11
|
+
### Patch Changes
|
|
22
12
|
|
|
23
|
-
- Fixed OpenAI schema compatibility when using `agent.generate()` or `agent.stream()` with `structuredOutput`. ([#
|
|
13
|
+
- Fixed OpenAI schema compatibility when using `agent.generate()` or `agent.stream()` with `structuredOutput`. ([#10454](https://github.com/mastra-ai/mastra/pull/10454))
|
|
24
14
|
|
|
25
15
|
## Changes
|
|
26
16
|
- **Automatic transformation**: Zod schemas are now automatically transformed for OpenAI strict mode compatibility when using OpenAI models (including reasoning models like o1, o3, o4)
|
|
@@ -52,11 +42,11 @@
|
|
|
52
42
|
// Result: { name: 'John', age: undefined, deletedAt: null }
|
|
53
43
|
```
|
|
54
44
|
|
|
55
|
-
##
|
|
45
|
+
## 0.11.8-alpha.0
|
|
56
46
|
|
|
57
47
|
### Patch Changes
|
|
58
48
|
|
|
59
|
-
- Fixed OpenAI schema compatibility when using `agent.generate()` or `agent.stream()` with `structuredOutput`. ([#
|
|
49
|
+
- Fixed OpenAI schema compatibility when using `agent.generate()` or `agent.stream()` with `structuredOutput`. ([#10454](https://github.com/mastra-ai/mastra/pull/10454))
|
|
60
50
|
|
|
61
51
|
## Changes
|
|
62
52
|
- **Automatic transformation**: Zod schemas are now automatically transformed for OpenAI strict mode compatibility when using OpenAI models (including reasoning models like o1, o3, o4)
|
|
@@ -88,23 +78,47 @@
|
|
|
88
78
|
// Result: { name: 'John', age: undefined, deletedAt: null }
|
|
89
79
|
```
|
|
90
80
|
|
|
91
|
-
##
|
|
81
|
+
## 0.11.7
|
|
82
|
+
|
|
83
|
+
### Patch Changes
|
|
84
|
+
|
|
85
|
+
- update peerdeps ([`5ca1cca`](https://github.com/mastra-ai/mastra/commit/5ca1ccac61ffa7141e6d9fa8f22d3ad4d03bf5dc))
|
|
86
|
+
|
|
87
|
+
## 0.11.7-alpha.0
|
|
88
|
+
|
|
89
|
+
### Patch Changes
|
|
90
|
+
|
|
91
|
+
- update peerdeps ([`5ca1cca`](https://github.com/mastra-ai/mastra/commit/5ca1ccac61ffa7141e6d9fa8f22d3ad4d03bf5dc))
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
## 0.11.6
|
|
94
|
+
|
|
95
|
+
### Patch Changes
|
|
94
96
|
|
|
95
|
-
-
|
|
97
|
+
- Fix Zod v4 toJSONSchema bug with z.record() single-argument form ([#9355](https://github.com/mastra-ai/mastra/pull/9355))
|
|
96
98
|
|
|
97
|
-
-
|
|
99
|
+
Zod v4 has a bug in the single-argument form of `z.record(valueSchema)` where it incorrectly assigns the value schema to `keyType` instead of `valueType`, leaving `valueType` undefined. This causes `toJSONSchema()` to throw "Cannot read properties of undefined (reading '\_zod')" when processing schemas containing `z.record()` fields.
|
|
100
|
+
|
|
101
|
+
This fix patches affected schemas before conversion by detecting records with missing `valueType` and correctly assigning the schema to `valueType` while setting `keyType` to `z.string()` (the default). The patch recursively handles nested schemas including those wrapped in `.optional()`, `.nullable()`, arrays, unions, and objects.
|
|
102
|
+
|
|
103
|
+
- Improved reliability of string field types in tool schema compatibility ([#9362](https://github.com/mastra-ai/mastra/pull/9362))
|
|
104
|
+
|
|
105
|
+
## 0.11.6-alpha.0
|
|
98
106
|
|
|
99
107
|
### Patch Changes
|
|
100
108
|
|
|
101
|
-
- Fix Zod v4 toJSONSchema bug with z.record() single-argument form ([#
|
|
109
|
+
- Fix Zod v4 toJSONSchema bug with z.record() single-argument form ([#9355](https://github.com/mastra-ai/mastra/pull/9355))
|
|
102
110
|
|
|
103
111
|
Zod v4 has a bug in the single-argument form of `z.record(valueSchema)` where it incorrectly assigns the value schema to `keyType` instead of `valueType`, leaving `valueType` undefined. This causes `toJSONSchema()` to throw "Cannot read properties of undefined (reading '\_zod')" when processing schemas containing `z.record()` fields.
|
|
104
112
|
|
|
105
113
|
This fix patches affected schemas before conversion by detecting records with missing `valueType` and correctly assigning the schema to `valueType` while setting `keyType` to `z.string()` (the default). The patch recursively handles nested schemas including those wrapped in `.optional()`, `.nullable()`, arrays, unions, and objects.
|
|
106
114
|
|
|
107
|
-
- Improved reliability of string field types in tool schema compatibility ([#
|
|
115
|
+
- Improved reliability of string field types in tool schema compatibility ([#9362](https://github.com/mastra-ai/mastra/pull/9362))
|
|
116
|
+
|
|
117
|
+
## 0.11.5
|
|
118
|
+
|
|
119
|
+
### Patch Changes
|
|
120
|
+
|
|
121
|
+
- Fix peerdependencies ([`eb7c1c8`](https://github.com/mastra-ai/mastra/commit/eb7c1c8c592d8fb16dfd250e337d9cdc73c8d5de))
|
|
108
122
|
|
|
109
123
|
## 0.11.4
|
|
110
124
|
|