🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@mastra/schema-compat

Package Overview
Dependencies
Maintainers
7
Versions
293
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mastra/schema-compat - npm Package Compare versions

Comparing version
1.3.4-alpha.2
to
1.3.4
+28
-0
CHANGELOG.md
# @mastra/schema-compat
## 1.3.4
### Patch Changes
- test(schema-compat): fix 'successful' typo in provider e2e test descriptions ([#19167](https://github.com/mastra-ai/mastra/pull/19167))
- 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))
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.
Fixes [#17051](https://github.com/mastra-ai/mastra/issues/17051).
- 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))
**Before** (Meta/DeepSeek, `z.object({ age: z.number().min(0).max(120) })`):
```json
{ "age": { "type": "number", "minimum": 0, "maximum": 120 } }
```
**After**:
```json
{ "age": { "type": "number", "description": "constraints: greater than or equal to 0, lower than or equal to 120" } }
```
Closes #19072.
## 1.3.4-alpha.2

@@ -4,0 +32,0 @@

+9
-9
{
"name": "@mastra/schema-compat",
"version": "1.3.4-alpha.2",
"version": "1.3.4",
"description": "Tool schema compatibility layer for Mastra.ai",

@@ -109,3 +109,3 @@ "type": "module",

"@types/json-schema": "^7.0.15",
"@types/node": "22.19.21",
"@types/node": "22.20.1",
"@vitest/coverage-v8": "4.1.10",

@@ -122,9 +122,9 @@ "@vitest/ui": "4.1.10",

"zod-v3": "npm:zod@^3.25.76",
"@internal/ai-sdk-v4": "0.0.60",
"@internal/ai-sdk-v5": "0.0.60",
"@internal/ai-v6": "0.0.60",
"@internal/lint": "0.0.113",
"@internal/test-utils": "0.0.49",
"@internal/types-builder": "0.0.88",
"@internal/llm-recorder": "0.0.49"
"@internal/ai-sdk-v4": "0.0.61",
"@internal/ai-sdk-v5": "0.0.61",
"@internal/ai-v6": "0.0.61",
"@internal/llm-recorder": "0.0.50",
"@internal/lint": "0.0.114",
"@internal/test-utils": "0.0.50",
"@internal/types-builder": "0.0.89"
},

@@ -131,0 +131,0 @@ "homepage": "https://mastra.ai",