@mastra/schema-compat 1.1.3-alpha.0 → 1.2.0-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.
Files changed (81) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/LICENSE.md +15 -0
  3. package/dist/_types/@internal_ai-sdk-v4/dist/index.d.ts +7562 -0
  4. package/dist/_types/@internal_ai-v6/dist/index.d.ts +449 -343
  5. package/dist/chunk-23HDOZLF.js +105 -0
  6. package/dist/chunk-23HDOZLF.js.map +1 -0
  7. package/dist/chunk-3MLZICLP.cjs +94 -0
  8. package/dist/chunk-3MLZICLP.cjs.map +1 -0
  9. package/dist/chunk-3QMIGINL.cjs +123 -0
  10. package/dist/chunk-3QMIGINL.cjs.map +1 -0
  11. package/dist/{chunk-4EY4LZB2.js → chunk-7ZCSAPV3.js} +76 -3
  12. package/dist/chunk-7ZCSAPV3.js.map +1 -0
  13. package/dist/chunk-FKB2Z36H.cjs +68 -0
  14. package/dist/chunk-FKB2Z36H.cjs.map +1 -0
  15. package/dist/chunk-FS3P4V5M.cjs +108 -0
  16. package/dist/chunk-FS3P4V5M.cjs.map +1 -0
  17. package/dist/chunk-I2YUBGXM.js +112 -0
  18. package/dist/chunk-I2YUBGXM.js.map +1 -0
  19. package/dist/chunk-IKQO7EW7.js +62 -0
  20. package/dist/chunk-IKQO7EW7.js.map +1 -0
  21. package/dist/chunk-K7I3YXWP.js +92 -0
  22. package/dist/chunk-K7I3YXWP.js.map +1 -0
  23. package/dist/{chunk-DGOXVQNP.js → chunk-QDRBTCDV.js} +158 -479
  24. package/dist/chunk-QDRBTCDV.js.map +1 -0
  25. package/dist/{chunk-DAVEUCUM.cjs → chunk-ROFMEFEF.cjs} +160 -488
  26. package/dist/chunk-ROFMEFEF.cjs.map +1 -0
  27. package/dist/{chunk-BOGGUXB5.cjs → chunk-UFJG5KPA.cjs} +77 -2
  28. package/dist/chunk-UFJG5KPA.cjs.map +1 -0
  29. package/dist/index.cjs +626 -337
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.d.ts +6 -0
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +580 -325
  34. package/dist/index.js.map +1 -1
  35. package/dist/json-schema/utils.d.ts +8 -0
  36. package/dist/json-schema/utils.d.ts.map +1 -1
  37. package/dist/null-to-undefined.d.ts +24 -0
  38. package/dist/null-to-undefined.d.ts.map +1 -0
  39. package/dist/provider-compats/google.d.ts +3 -0
  40. package/dist/provider-compats/google.d.ts.map +1 -1
  41. package/dist/provider-compats/openai-reasoning.d.ts +5 -5
  42. package/dist/provider-compats/openai-reasoning.d.ts.map +1 -1
  43. package/dist/provider-compats/openai.d.ts +8 -0
  44. package/dist/provider-compats/openai.d.ts.map +1 -1
  45. package/dist/schema-compatibility-v3.d.ts +2 -2
  46. package/dist/schema-compatibility-v3.d.ts.map +1 -1
  47. package/dist/schema-compatibility.d.ts +2 -1
  48. package/dist/schema-compatibility.d.ts.map +1 -1
  49. package/dist/schema.cjs +16 -4
  50. package/dist/schema.d.ts +1 -1
  51. package/dist/schema.d.ts.map +1 -1
  52. package/dist/schema.js +1 -1
  53. package/dist/schema.types.d.ts +4 -2
  54. package/dist/schema.types.d.ts.map +1 -1
  55. package/dist/standard-schema/adapters/ai-sdk.cjs +16 -0
  56. package/dist/standard-schema/adapters/ai-sdk.cjs.map +1 -0
  57. package/dist/standard-schema/adapters/ai-sdk.js +3 -0
  58. package/dist/standard-schema/adapters/ai-sdk.js.map +1 -0
  59. package/dist/standard-schema/adapters/json-schema.cjs +16 -0
  60. package/dist/standard-schema/adapters/json-schema.cjs.map +1 -0
  61. package/dist/standard-schema/adapters/json-schema.d.ts.map +1 -1
  62. package/dist/standard-schema/adapters/json-schema.js +3 -0
  63. package/dist/standard-schema/adapters/json-schema.js.map +1 -0
  64. package/dist/standard-schema/adapters/zod-v3.cjs +12 -0
  65. package/dist/standard-schema/adapters/zod-v3.cjs.map +1 -0
  66. package/dist/standard-schema/adapters/zod-v3.js +3 -0
  67. package/dist/standard-schema/adapters/zod-v3.js.map +1 -0
  68. package/dist/standard-schema/standard-schema.d.ts.map +1 -1
  69. package/dist/standard-schema-compat.d.ts +74 -0
  70. package/dist/standard-schema-compat.d.ts.map +1 -0
  71. package/dist/utils.d.ts +3 -2
  72. package/dist/utils.d.ts.map +1 -1
  73. package/dist/zod-to-json.cjs +10 -2
  74. package/dist/zod-to-json.d.ts +13 -0
  75. package/dist/zod-to-json.d.ts.map +1 -1
  76. package/dist/zod-to-json.js +1 -1
  77. package/package.json +41 -10
  78. package/dist/chunk-4EY4LZB2.js.map +0 -1
  79. package/dist/chunk-BOGGUXB5.cjs.map +0 -1
  80. package/dist/chunk-DAVEUCUM.cjs.map +0 -1
  81. package/dist/chunk-DGOXVQNP.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,45 @@
1
1
  # @mastra/schema-compat
2
2
 
3
+ ## 1.2.0-alpha.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
+
37
+ ## 1.1.3
38
+
39
+ ### Patch Changes
40
+
41
+ - Fix `ZodNull` throwing "does not support zod type: ZodNull" for Anthropic and OpenAI reasoning models. MCP tools with nullable properties in their JSON Schema produce `z.null()` which was unhandled by these provider compat layers. ([#13496](https://github.com/mastra-ai/mastra/pull/13496))
42
+
3
43
  ## 1.1.3-alpha.0
4
44
 
5
45
  ### Patch Changes
package/LICENSE.md CHANGED
@@ -1,3 +1,18 @@
1
+ Portions of this software are licensed as follows:
2
+
3
+ - All content that resides under any directory named "ee/" within this
4
+ repository, including but not limited to:
5
+ - `packages/core/src/auth/ee/`
6
+ - `packages/server/src/server/auth/ee/`
7
+ is licensed under the license defined in `ee/LICENSE`.
8
+
9
+ - All third-party components incorporated into the Mastra Software are
10
+ licensed under the original license provided by the owner of the
11
+ applicable component.
12
+
13
+ - Content outside of the above-mentioned directories or restrictions is
14
+ available under the "Apache License 2.0" as defined below.
15
+
1
16
  # Apache License 2.0
2
17
 
3
18
  Copyright (c) 2025 Kepler Software, Inc.