@mastra/schema-compat 1.2.6-alpha.1 → 1.2.7-alpha.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.
- package/CHANGELOG.md +27 -0
- package/dist/schema.d.ts +1 -1
- package/dist/schema.d.ts.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @mastra/schema-compat
|
|
2
2
|
|
|
3
|
+
## 1.2.7-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fix Zod v3 and Zod v4 compatibility across public structured-output APIs. ([#14464](https://github.com/mastra-ai/mastra/pull/14464))
|
|
8
|
+
|
|
9
|
+
Mastra agent and client APIs accept schemas from either `zod/v3` or `zod/v4`, matching the documented peer dependency range and preserving TypeScript compatibility for both Zod versions.
|
|
10
|
+
|
|
11
|
+
## 1.2.6
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- fix(schema-compat): map Mastra draft target names to Zod v4 format ([#14401](https://github.com/mastra-ai/mastra/pull/14401))
|
|
16
|
+
|
|
17
|
+
Zod v4's `z.toJSONSchema()` expects `"draft-7"` / `"draft-4"` while
|
|
18
|
+
Mastra uses `"draft-07"` / `"draft-04"`. The mismatch caused repeated
|
|
19
|
+
`Invalid target: draft-07` console warnings and suppressed the `$schema`
|
|
20
|
+
field in generated JSON Schemas.
|
|
21
|
+
|
|
22
|
+
Adds `ZOD_V4_TARGET_MAP` in the zod-v4 adapter to translate target names
|
|
23
|
+
before calling `z.toJSONSchema()`. `"draft-2020-12"` is unchanged as both
|
|
24
|
+
sides already agree on that name.
|
|
25
|
+
|
|
26
|
+
Fixes `#14399`
|
|
27
|
+
|
|
28
|
+
- Add support for `draft-2020-12` and `draft-04` JSON Schema targets in the Zod v3 adapter, and fix the `toJSONSchema` target mapping to properly translate all `zod-to-json-schema` target names (like `openApi3`) to standard-schema target names. Fixes "Unsupported JSON Schema target" errors when serializing tool schemas. ([#14471](https://github.com/mastra-ai/mastra/pull/14471))
|
|
29
|
+
|
|
3
30
|
## 1.2.6-alpha.1
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
package/dist/schema.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type { StandardSchemaWithJSON, InferOutput as InferStandardSchemaOutput, InferInput as InferStandardSchemaInput, StandardSchemaIssue, StandardSchemaWithJSONProps, } from './standard-schema/standard-schema.types.js';
|
|
2
|
-
export type { PublicSchema, InferPublicSchema } from './schema.types.js';
|
|
2
|
+
export type { PublicSchema, InferPublicSchema, ZodType } from './schema.types.js';
|
|
3
3
|
export { toStandardSchema, isStandardSchema, isStandardJSONSchema, isStandardSchemaWithJSON, standardSchemaToJSONSchema, JSON_SCHEMA_LIBRARY_OPTIONS, } from './standard-schema/standard-schema.js';
|
|
4
4
|
//# sourceMappingURL=schema.d.ts.map
|
package/dist/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,sBAAsB,EACtB,WAAW,IAAI,yBAAyB,EACxC,UAAU,IAAI,wBAAwB,EACtC,mBAAmB,EACnB,2BAA2B,GAC5B,MAAM,yCAAyC,CAAC;AAEjD,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,sBAAsB,EACtB,WAAW,IAAI,yBAAyB,EACxC,UAAU,IAAI,wBAAwB,EACtC,mBAAmB,EACnB,2BAA2B,GAC5B,MAAM,yCAAyC,CAAC;AAEjD,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE/E,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,wBAAwB,EACxB,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,mCAAmC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/schema-compat",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.7-alpha.0",
|
|
4
4
|
"description": "Tool schema compatibility layer for Mastra.ai",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -115,11 +115,11 @@
|
|
|
115
115
|
"vitest": "4.0.18",
|
|
116
116
|
"zod": "^4.3.6",
|
|
117
117
|
"zod-v3": "npm:zod@^3.25.76",
|
|
118
|
-
"@internal/ai-sdk-v4": "0.0.
|
|
119
|
-
"@internal/ai-
|
|
120
|
-
"@internal/
|
|
121
|
-
"@internal/
|
|
122
|
-
"@internal/types-builder": "0.0.
|
|
118
|
+
"@internal/ai-sdk-v4": "0.0.20",
|
|
119
|
+
"@internal/ai-sdk-v5": "0.0.20",
|
|
120
|
+
"@internal/lint": "0.0.73",
|
|
121
|
+
"@internal/ai-v6": "0.0.20",
|
|
122
|
+
"@internal/types-builder": "0.0.48"
|
|
123
123
|
},
|
|
124
124
|
"homepage": "https://mastra.ai",
|
|
125
125
|
"repository": {
|