@mastra/schema-compat 0.0.0-taofeeq-fix-tool-call-showing-after-message-20250806184630 → 0.0.0-vector-query-tool-provider-options-20250828222356

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 (68) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +62 -1
  3. package/README.md +0 -4
  4. package/dist/chunk-MKYBUMTK.js +27 -0
  5. package/dist/chunk-MKYBUMTK.js.map +1 -0
  6. package/dist/chunk-V7Y3FXBJ.cjs +33 -0
  7. package/dist/chunk-V7Y3FXBJ.cjs.map +1 -0
  8. package/dist/index.cjs +842 -83
  9. package/dist/index.cjs.map +1 -1
  10. package/dist/index.d.ts +10 -8
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +841 -84
  13. package/dist/index.js.map +1 -1
  14. package/dist/provider-compats/anthropic.d.ts +7 -5
  15. package/dist/provider-compats/anthropic.d.ts.map +1 -1
  16. package/dist/provider-compats/deepseek.d.ts +7 -5
  17. package/dist/provider-compats/deepseek.d.ts.map +1 -1
  18. package/dist/provider-compats/google.d.ts +7 -5
  19. package/dist/provider-compats/google.d.ts.map +1 -1
  20. package/dist/provider-compats/meta.d.ts +7 -5
  21. package/dist/provider-compats/meta.d.ts.map +1 -1
  22. package/dist/provider-compats/openai-reasoning.d.ts +7 -5
  23. package/dist/provider-compats/openai-reasoning.d.ts.map +1 -1
  24. package/dist/provider-compats/openai.d.ts +7 -5
  25. package/dist/provider-compats/openai.d.ts.map +1 -1
  26. package/dist/schema-compatibility-v3.d.ts +319 -0
  27. package/dist/schema-compatibility-v3.d.ts.map +1 -0
  28. package/dist/schema-compatibility-v4.d.ts +310 -0
  29. package/dist/schema-compatibility-v4.d.ts.map +1 -0
  30. package/dist/schema-compatibility.d.ts +79 -131
  31. package/dist/schema-compatibility.d.ts.map +1 -1
  32. package/dist/types.d.ts +6 -0
  33. package/dist/types.d.ts.map +1 -0
  34. package/dist/utils-test-suite.d.ts +2 -0
  35. package/dist/utils-test-suite.d.ts.map +1 -0
  36. package/dist/utils.d.ts +17 -5
  37. package/dist/utils.d.ts.map +1 -1
  38. package/dist/zod-to-json.cjs +12 -0
  39. package/dist/zod-to-json.cjs.map +1 -0
  40. package/dist/zod-to-json.d.ts +6 -0
  41. package/dist/zod-to-json.d.ts.map +1 -0
  42. package/dist/zod-to-json.js +3 -0
  43. package/dist/zod-to-json.js.map +1 -0
  44. package/dist/zodTypes.d.ts +21 -0
  45. package/dist/zodTypes.d.ts.map +1 -0
  46. package/package.json +16 -6
  47. package/src/index.ts +4 -3
  48. package/src/provider-compats/anthropic.ts +30 -13
  49. package/src/provider-compats/deepseek.ts +15 -10
  50. package/src/provider-compats/google.ts +19 -33
  51. package/src/provider-compats/meta.ts +16 -11
  52. package/src/provider-compats/openai-reasoning.ts +19 -25
  53. package/src/provider-compats/openai.ts +23 -14
  54. package/src/provider-compats.test.ts +120 -25
  55. package/src/schema-compatibility-v3.ts +664 -0
  56. package/src/schema-compatibility-v4.test.ts +476 -0
  57. package/src/schema-compatibility-v4.ts +706 -0
  58. package/src/schema-compatibility.test.ts +9 -9
  59. package/src/schema-compatibility.ts +266 -383
  60. package/src/types.ts +5 -0
  61. package/src/utils-test-suite.ts +467 -0
  62. package/src/utils-v3.test.ts +9 -0
  63. package/src/utils-v4.test.ts +9 -0
  64. package/src/utils.ts +30 -24
  65. package/src/zod-to-json.ts +28 -0
  66. package/src/zodTypes.ts +56 -0
  67. package/tsup.config.ts +8 -3
  68. package/src/utils.test.ts +0 -434
@@ -1,4 +1,4 @@
1
1
 
2
- > @mastra/schema-compat@0.10.6 build /home/runner/work/mastra/mastra/packages/schema-compat
2
+ > @mastra/schema-compat@0.11.1 build /home/runner/work/mastra/mastra/packages/schema-compat
3
3
  > tsup --silent --config tsup.config.ts
4
4
 
package/CHANGELOG.md CHANGED
@@ -1,9 +1,70 @@
1
1
  # @mastra/schema-compat
2
2
 
3
- ## 0.0.0-taofeeq-fix-tool-call-showing-after-message-20250806184630
3
+ ## 0.0.0-vector-query-tool-provider-options-20250828222356
4
4
 
5
5
  ### Patch Changes
6
6
 
7
+ - [#7121](https://github.com/mastra-ai/mastra/pull/7121) [`637f323`](https://github.com/mastra-ai/mastra/commit/637f32371d79a8f78c52c0d53411af0915fcec67) Thanks [@DanielSLew](https://github.com/DanielSLew)! - Fix issue with some compilers and calling zod v4's toJSONSchema function
8
+
9
+ ## 0.11.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`c6113ed`](https://github.com/mastra-ai/mastra/commit/c6113ed7f9df297e130d94436ceee310273d6430) Thanks [@wardpeet](https://github.com/wardpeet)! - Fix peerdpes for @mastra/core
14
+
15
+ ## 0.11.0
16
+
17
+ ### Minor Changes
18
+
19
+ - [#7032](https://github.com/mastra-ai/mastra/pull/7032) [`1191ce9`](https://github.com/mastra-ai/mastra/commit/1191ce946b40ed291e7877a349f8388e3cff7e5c) Thanks [@wardpeet](https://github.com/wardpeet)! - Bump zod peerdep to 3.25.0 to support both v3/v4
20
+
21
+ ### Patch Changes
22
+
23
+ - [#7028](https://github.com/mastra-ai/mastra/pull/7028) [`da58ccc`](https://github.com/mastra-ai/mastra/commit/da58ccc1f2ac33da0cb97b00443fc6208b45bdec) Thanks [@wardpeet](https://github.com/wardpeet)! - Fix exportsmap
24
+
25
+ - [#6982](https://github.com/mastra-ai/mastra/pull/6982) [`94e9f54`](https://github.com/mastra-ai/mastra/commit/94e9f547d66ef7cd01d9075ab53b5ca9a1cae100) Thanks [@wardpeet](https://github.com/wardpeet)! - Fix AI peerdeps for NPM install
26
+
27
+ - [#6944](https://github.com/mastra-ai/mastra/pull/6944) [`a93f3ba`](https://github.com/mastra-ai/mastra/commit/a93f3ba05eef4cf17f876d61d29cf0841a9e70b7) Thanks [@wardpeet](https://github.com/wardpeet)! - Add support for zod v4
28
+
29
+ ## 0.11.0-alpha.2
30
+
31
+ ### Minor Changes
32
+
33
+ - [#7032](https://github.com/mastra-ai/mastra/pull/7032) [`1191ce9`](https://github.com/mastra-ai/mastra/commit/1191ce946b40ed291e7877a349f8388e3cff7e5c) Thanks [@wardpeet](https://github.com/wardpeet)! - Bump zod peerdep to 3.25.0 to support both v3/v4
34
+
35
+ ## 0.10.6-alpha.1
36
+
37
+ ### Patch Changes
38
+
39
+ - [#7028](https://github.com/mastra-ai/mastra/pull/7028) [`da58ccc`](https://github.com/mastra-ai/mastra/commit/da58ccc1f2ac33da0cb97b00443fc6208b45bdec) Thanks [@wardpeet](https://github.com/wardpeet)! - Fix exportsmap
40
+
41
+ ## 0.10.6-alpha.0
42
+
43
+ ### Patch Changes
44
+
45
+ - [#6982](https://github.com/mastra-ai/mastra/pull/6982) [`94e9f54`](https://github.com/mastra-ai/mastra/commit/94e9f547d66ef7cd01d9075ab53b5ca9a1cae100) Thanks [@wardpeet](https://github.com/wardpeet)! - Fix AI peerdeps for NPM install
46
+
47
+ - [#6944](https://github.com/mastra-ai/mastra/pull/6944) [`a93f3ba`](https://github.com/mastra-ai/mastra/commit/a93f3ba05eef4cf17f876d61d29cf0841a9e70b7) Thanks [@wardpeet](https://github.com/wardpeet)! - Add support for zod v4
48
+
49
+ ## 0.10.7
50
+
51
+ ### Patch Changes
52
+
53
+ - dd94a26: Dont rely on the full language model for schema compat
54
+ - 2fff911: Fix vnext working memory tool schema when model is incompatible with schema
55
+ - ae2eb63: Handle regex checks better, return description as a string rather than an object with pattern and flags.
56
+
57
+ ## 0.10.7-alpha.1
58
+
59
+ ### Patch Changes
60
+
61
+ - ae2eb63: Handle regex checks better, return description as a string rather than an object with pattern and flags.
62
+
63
+ ## 0.10.7-alpha.0
64
+
65
+ ### Patch Changes
66
+
67
+ - dd94a26: Dont rely on the full language model for schema compat
7
68
  - 2fff911: Fix vnext working memory tool schema when model is incompatible with schema
8
69
 
9
70
  ## 0.10.6
package/README.md CHANGED
@@ -142,7 +142,3 @@ pnpm test
142
142
  # Run tests in watch mode
143
143
  pnpm test --watch
144
144
  ```
145
-
146
- ## License
147
-
148
- Elastic-2.0
@@ -0,0 +1,27 @@
1
+ import { z } from 'zod';
2
+ import zodToJsonSchemaOriginal from 'zod-to-json-schema';
3
+
4
+ // src/zod-to-json.ts
5
+ function zodToJsonSchema(zodSchema, target = "jsonSchema7") {
6
+ if ("toJSONSchema" in z) {
7
+ return z["toJSONSchema"](zodSchema, {
8
+ unrepresentable: "any",
9
+ override: (ctx) => {
10
+ const def = ctx.zodSchema?._zod?.def;
11
+ if (def && def.type === "date") {
12
+ ctx.jsonSchema.type = "string";
13
+ ctx.jsonSchema.format = "date-time";
14
+ }
15
+ }
16
+ });
17
+ } else {
18
+ return zodToJsonSchemaOriginal(zodSchema, {
19
+ $refStrategy: "none",
20
+ target
21
+ });
22
+ }
23
+ }
24
+
25
+ export { zodToJsonSchema };
26
+ //# sourceMappingURL=chunk-MKYBUMTK.js.map
27
+ //# sourceMappingURL=chunk-MKYBUMTK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/zod-to-json.ts"],"names":[],"mappings":";;;;AAOO,SAAS,eAAA,CAAgB,SAAA,EAAsC,MAAA,GAAkB,aAAA,EAAe;AACrG,EAAA,IAAI,kBAAkB,CAAA,EAAG;AAEvB,IAAA,OAAQ,CAAA,CAAU,cAAc,CAAA,CAAE,SAAA,EAAW;AAAA,MAC3C,eAAA,EAAiB,KAAA;AAAA,MACjB,QAAA,EAAU,CAAC,GAAA,KAAa;AAEtB,QAAA,MAAM,GAAA,GAAM,GAAA,CAAI,SAAA,EAAW,IAAA,EAAM,GAAA;AACjC,QAAA,IAAI,GAAA,IAAO,GAAA,CAAI,IAAA,KAAS,MAAA,EAAQ;AAC9B,UAAA,GAAA,CAAI,WAAW,IAAA,GAAO,QAAA;AACtB,UAAA,GAAA,CAAI,WAAW,MAAA,GAAS,WAAA;AAAA,QAC1B;AAAA,MACF;AAAA,KACD,CAAA;AAAA,EACH,CAAA,MAAO;AACL,IAAA,OAAO,wBAAwB,SAAA,EAA0B;AAAA,MACvD,YAAA,EAAc,MAAA;AAAA,MACd;AAAA,KACD,CAAA;AAAA,EACH;AACF","file":"chunk-MKYBUMTK.js","sourcesContent":["import type { JSONSchema7 } from 'json-schema';\nimport { z } from 'zod';\nimport type { ZodSchema as ZodSchemaV3 } from 'zod/v3';\nimport type { ZodType as ZodSchemaV4 } from 'zod/v4';\nimport type { Targets } from 'zod-to-json-schema';\nimport zodToJsonSchemaOriginal from 'zod-to-json-schema';\n\nexport function zodToJsonSchema(zodSchema: ZodSchemaV3 | ZodSchemaV4, target: Targets = 'jsonSchema7') {\n if ('toJSONSchema' in z) {\n // Use dynamic property access to avoid import errors in Zod v3\n return (z as any)['toJSONSchema'](zodSchema, {\n unrepresentable: 'any',\n override: (ctx: any) => {\n // Safe access to handle cases where _zod might be undefined\n const def = ctx.zodSchema?._zod?.def;\n if (def && def.type === 'date') {\n ctx.jsonSchema.type = 'string';\n ctx.jsonSchema.format = 'date-time';\n }\n },\n }) as JSONSchema7;\n } else {\n return zodToJsonSchemaOriginal(zodSchema as ZodSchemaV3, {\n $refStrategy: 'none',\n target,\n }) as JSONSchema7;\n }\n}\n"]}
@@ -0,0 +1,33 @@
1
+ 'use strict';
2
+
3
+ var zod = require('zod');
4
+ var zodToJsonSchemaOriginal = require('zod-to-json-schema');
5
+
6
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
7
+
8
+ var zodToJsonSchemaOriginal__default = /*#__PURE__*/_interopDefault(zodToJsonSchemaOriginal);
9
+
10
+ // src/zod-to-json.ts
11
+ function zodToJsonSchema(zodSchema, target = "jsonSchema7") {
12
+ if ("toJSONSchema" in zod.z) {
13
+ return zod.z["toJSONSchema"](zodSchema, {
14
+ unrepresentable: "any",
15
+ override: (ctx) => {
16
+ const def = ctx.zodSchema?._zod?.def;
17
+ if (def && def.type === "date") {
18
+ ctx.jsonSchema.type = "string";
19
+ ctx.jsonSchema.format = "date-time";
20
+ }
21
+ }
22
+ });
23
+ } else {
24
+ return zodToJsonSchemaOriginal__default.default(zodSchema, {
25
+ $refStrategy: "none",
26
+ target
27
+ });
28
+ }
29
+ }
30
+
31
+ exports.zodToJsonSchema = zodToJsonSchema;
32
+ //# sourceMappingURL=chunk-V7Y3FXBJ.cjs.map
33
+ //# sourceMappingURL=chunk-V7Y3FXBJ.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/zod-to-json.ts"],"names":["z","zodToJsonSchemaOriginal"],"mappings":";;;;;;;;;;AAOO,SAAS,eAAA,CAAgB,SAAA,EAAsC,MAAA,GAAkB,aAAA,EAAe;AACrG,EAAA,IAAI,kBAAkBA,KAAA,EAAG;AAEvB,IAAA,OAAQA,KAAA,CAAU,cAAc,CAAA,CAAE,SAAA,EAAW;AAAA,MAC3C,eAAA,EAAiB,KAAA;AAAA,MACjB,QAAA,EAAU,CAAC,GAAA,KAAa;AAEtB,QAAA,MAAM,GAAA,GAAM,GAAA,CAAI,SAAA,EAAW,IAAA,EAAM,GAAA;AACjC,QAAA,IAAI,GAAA,IAAO,GAAA,CAAI,IAAA,KAAS,MAAA,EAAQ;AAC9B,UAAA,GAAA,CAAI,WAAW,IAAA,GAAO,QAAA;AACtB,UAAA,GAAA,CAAI,WAAW,MAAA,GAAS,WAAA;AAAA,QAC1B;AAAA,MACF;AAAA,KACD,CAAA;AAAA,EACH,CAAA,MAAO;AACL,IAAA,OAAOC,yCAAwB,SAAA,EAA0B;AAAA,MACvD,YAAA,EAAc,MAAA;AAAA,MACd;AAAA,KACD,CAAA;AAAA,EACH;AACF","file":"chunk-V7Y3FXBJ.cjs","sourcesContent":["import type { JSONSchema7 } from 'json-schema';\nimport { z } from 'zod';\nimport type { ZodSchema as ZodSchemaV3 } from 'zod/v3';\nimport type { ZodType as ZodSchemaV4 } from 'zod/v4';\nimport type { Targets } from 'zod-to-json-schema';\nimport zodToJsonSchemaOriginal from 'zod-to-json-schema';\n\nexport function zodToJsonSchema(zodSchema: ZodSchemaV3 | ZodSchemaV4, target: Targets = 'jsonSchema7') {\n if ('toJSONSchema' in z) {\n // Use dynamic property access to avoid import errors in Zod v3\n return (z as any)['toJSONSchema'](zodSchema, {\n unrepresentable: 'any',\n override: (ctx: any) => {\n // Safe access to handle cases where _zod might be undefined\n const def = ctx.zodSchema?._zod?.def;\n if (def && def.type === 'date') {\n ctx.jsonSchema.type = 'string';\n ctx.jsonSchema.format = 'date-time';\n }\n },\n }) as JSONSchema7;\n } else {\n return zodToJsonSchemaOriginal(zodSchema as ZodSchemaV3, {\n $refStrategy: 'none',\n target,\n }) as JSONSchema7;\n }\n}\n"]}