@mastra/schema-compat 1.2.0-alpha.0 → 1.2.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.
Files changed (2) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/package.json +6 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # @mastra/schema-compat
2
2
 
3
+ ## 1.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add Zod v4 and Standard Schema support ([#12238](https://github.com/mastra-ai/mastra/pull/12238))
8
+
9
+ ## Zod v4 Breaking Changes
10
+ - Fix all `z.record()` calls to use 2-argument form (key + value schema) as required by Zod v4
11
+ - Update `ZodError.errors` to `ZodError.issues` (Zod v4 API change)
12
+ - Update `@ai-sdk/provider` versions for Zod v4 compatibility
13
+
14
+ ## Standard Schema Integration
15
+ - Add `packages/core/src/schema/` module that re-exports from `@mastra/schema-compat`
16
+ - Migrate codebase to use `PublicSchema` type for schema parameters
17
+ - Use `toStandardSchema()` for normalizing schemas across Zod v3, Zod v4, AI SDK Schema, and JSON Schema
18
+ - Use `standardSchemaToJSONSchema()` for JSON Schema conversion
19
+
20
+ ## Schema Compatibility (@mastra/schema-compat)
21
+ - Add new adapter exports: `@mastra/schema-compat/adapters/ai-sdk`, `@mastra/schema-compat/adapters/zod-v3`, `@mastra/schema-compat/adapters/json-schema`
22
+ - Enhance test coverage with separate v3 and v4 test suites
23
+ - Improve zod-to-json conversion with `unrepresentable: 'any'` support
24
+
25
+ ## TypeScript Fixes
26
+ - Resolve deep instantiation errors in client-js and model.ts
27
+ - Add proper type assertions where Zod v4 inference differs
28
+
29
+ **BREAKING CHANGE**: Minimum Zod version is now `^3.25.0` for v3 compatibility or `^4.0.0` for v4
30
+
31
+ ### Patch Changes
32
+
33
+ - Fixed Gemini supervisor agent tool calls failing with `INVALID_ARGUMENT` when delegated tool schemas include nullable fields. Fixes `#13988`. ([#14012](https://github.com/mastra-ai/mastra/pull/14012))
34
+
35
+ - Fixed OpenAI and OpenAI Reasoning compat layers to ensure all properties appear in the JSON Schema required array when using processToJSONSchema. This prevents OpenAI strict mode rejections for schemas with optional, default, or nullish fields. (Fixes #12284) ([#13695](https://github.com/mastra-ai/mastra/pull/13695))
36
+
3
37
  ## 1.2.0-alpha.0
4
38
 
5
39
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/schema-compat",
3
- "version": "1.2.0-alpha.0",
3
+ "version": "1.2.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.0.0",
118
- "@internal/ai-sdk-v4": "0.0.13",
119
- "@internal/lint": "0.0.66",
120
- "@internal/ai-v6": "0.0.13",
121
- "@internal/types-builder": "0.0.41",
122
- "@internal/ai-sdk-v5": "0.0.13"
118
+ "@internal/ai-sdk-v4": "0.0.14",
119
+ "@internal/ai-v6": "0.0.14",
120
+ "@internal/lint": "0.0.67",
121
+ "@internal/ai-sdk-v5": "0.0.14",
122
+ "@internal/types-builder": "0.0.42"
123
123
  },
124
124
  "homepage": "https://mastra.ai",
125
125
  "repository": {