@mastra/schema-compat 1.3.4-alpha.2 → 1.3.4

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 +28 -0
  2. package/package.json +9 -9
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @mastra/schema-compat
2
2
 
3
+ ## 1.3.4
4
+
5
+ ### Patch Changes
6
+
7
+ - test(schema-compat): fix 'successful' typo in provider e2e test descriptions ([#19167](https://github.com/mastra-ai/mastra/pull/19167))
8
+
9
+ - Fixed a crash when converting Zod v4 schemas containing `z.record(...)` through `applyCompatLayer` with any provider compat layer attached (e.g. `GoogleSchemaCompatLayer`, `OpenAISchemaCompatLayer`). ([#17052](https://github.com/mastra-ai/mastra/pull/17052))
10
+
11
+ The record patch is now applied in `toStandardSchema` before the `StandardSchemaWithJSON` short-circuit, so it covers Zod >= 4.2 (which natively exposes `~standard.jsonSchema` and bypasses the Zod v4 adapter) as well as older Zod v4 versions that go through the adapter. Affects Zod 4.0.0–4.3.x; the underlying `z.record()` bug is fixed upstream in Zod 4.4.0.
12
+
13
+ Fixes [#17051](https://github.com/mastra-ai/mastra/issues/17051).
14
+
15
+ - Fixed Meta (Llama) and DeepSeek schemas leaking raw number bounds to the model. A field like `z.number().int()` was sent to the model with bogus `minimum: -9007199254740991` / `maximum: 9007199254740991` values, and `z.number().min(1).max(50)` leaked `minimum`/`maximum` keywords, even though OpenAI, Google, and Anthropic already strip these. Numeric constraints are now moved into the field description for Meta and DeepSeek too, matching the other providers. ([#19073](https://github.com/mastra-ai/mastra/pull/19073))
16
+
17
+ **Before** (Meta/DeepSeek, `z.object({ age: z.number().min(0).max(120) })`):
18
+
19
+ ```json
20
+ { "age": { "type": "number", "minimum": 0, "maximum": 120 } }
21
+ ```
22
+
23
+ **After**:
24
+
25
+ ```json
26
+ { "age": { "type": "number", "description": "constraints: greater than or equal to 0, lower than or equal to 120" } }
27
+ ```
28
+
29
+ Closes #19072.
30
+
3
31
  ## 1.3.4-alpha.2
4
32
 
5
33
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/schema-compat",
3
- "version": "1.3.4-alpha.2",
3
+ "version": "1.3.4",
4
4
  "description": "Tool schema compatibility layer for Mastra.ai",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -106,7 +106,7 @@
106
106
  "@ai-sdk/openai": "^3.0.84",
107
107
  "@standard-schema/spec": "^1.1.0",
108
108
  "@types/json-schema": "^7.0.15",
109
- "@types/node": "22.19.21",
109
+ "@types/node": "22.20.1",
110
110
  "@vitest/coverage-v8": "4.1.10",
111
111
  "@vitest/ui": "4.1.10",
112
112
  "ajv": "^8.20.0",
@@ -118,13 +118,13 @@
118
118
  "vitest": "4.1.10",
119
119
  "zod": "^4.4.3",
120
120
  "zod-v3": "npm:zod@^3.25.76",
121
- "@internal/ai-sdk-v4": "0.0.60",
122
- "@internal/ai-sdk-v5": "0.0.60",
123
- "@internal/ai-v6": "0.0.60",
124
- "@internal/lint": "0.0.113",
125
- "@internal/test-utils": "0.0.49",
126
- "@internal/types-builder": "0.0.88",
127
- "@internal/llm-recorder": "0.0.49"
121
+ "@internal/ai-sdk-v4": "0.0.61",
122
+ "@internal/ai-sdk-v5": "0.0.61",
123
+ "@internal/ai-v6": "0.0.61",
124
+ "@internal/llm-recorder": "0.0.50",
125
+ "@internal/lint": "0.0.114",
126
+ "@internal/test-utils": "0.0.50",
127
+ "@internal/types-builder": "0.0.89"
128
128
  },
129
129
  "homepage": "https://mastra.ai",
130
130
  "repository": {