@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.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +62 -1
- package/README.md +0 -4
- package/dist/chunk-MKYBUMTK.js +27 -0
- package/dist/chunk-MKYBUMTK.js.map +1 -0
- package/dist/chunk-V7Y3FXBJ.cjs +33 -0
- package/dist/chunk-V7Y3FXBJ.cjs.map +1 -0
- package/dist/index.cjs +842 -83
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +10 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +841 -84
- package/dist/index.js.map +1 -1
- package/dist/provider-compats/anthropic.d.ts +7 -5
- package/dist/provider-compats/anthropic.d.ts.map +1 -1
- package/dist/provider-compats/deepseek.d.ts +7 -5
- package/dist/provider-compats/deepseek.d.ts.map +1 -1
- package/dist/provider-compats/google.d.ts +7 -5
- package/dist/provider-compats/google.d.ts.map +1 -1
- package/dist/provider-compats/meta.d.ts +7 -5
- package/dist/provider-compats/meta.d.ts.map +1 -1
- package/dist/provider-compats/openai-reasoning.d.ts +7 -5
- package/dist/provider-compats/openai-reasoning.d.ts.map +1 -1
- package/dist/provider-compats/openai.d.ts +7 -5
- package/dist/provider-compats/openai.d.ts.map +1 -1
- package/dist/schema-compatibility-v3.d.ts +319 -0
- package/dist/schema-compatibility-v3.d.ts.map +1 -0
- package/dist/schema-compatibility-v4.d.ts +310 -0
- package/dist/schema-compatibility-v4.d.ts.map +1 -0
- package/dist/schema-compatibility.d.ts +79 -131
- package/dist/schema-compatibility.d.ts.map +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils-test-suite.d.ts +2 -0
- package/dist/utils-test-suite.d.ts.map +1 -0
- package/dist/utils.d.ts +17 -5
- package/dist/utils.d.ts.map +1 -1
- package/dist/zod-to-json.cjs +12 -0
- package/dist/zod-to-json.cjs.map +1 -0
- package/dist/zod-to-json.d.ts +6 -0
- package/dist/zod-to-json.d.ts.map +1 -0
- package/dist/zod-to-json.js +3 -0
- package/dist/zod-to-json.js.map +1 -0
- package/dist/zodTypes.d.ts +21 -0
- package/dist/zodTypes.d.ts.map +1 -0
- package/package.json +16 -6
- package/src/index.ts +4 -3
- package/src/provider-compats/anthropic.ts +30 -13
- package/src/provider-compats/deepseek.ts +15 -10
- package/src/provider-compats/google.ts +19 -33
- package/src/provider-compats/meta.ts +16 -11
- package/src/provider-compats/openai-reasoning.ts +19 -25
- package/src/provider-compats/openai.ts +23 -14
- package/src/provider-compats.test.ts +120 -25
- package/src/schema-compatibility-v3.ts +664 -0
- package/src/schema-compatibility-v4.test.ts +476 -0
- package/src/schema-compatibility-v4.ts +706 -0
- package/src/schema-compatibility.test.ts +9 -9
- package/src/schema-compatibility.ts +266 -383
- package/src/types.ts +5 -0
- package/src/utils-test-suite.ts +467 -0
- package/src/utils-v3.test.ts +9 -0
- package/src/utils-v4.test.ts +9 -0
- package/src/utils.ts +30 -24
- package/src/zod-to-json.ts +28 -0
- package/src/zodTypes.ts +56 -0
- package/tsup.config.ts +8 -3
- package/src/utils.test.ts +0 -434
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { LanguageModelV1 } from 'ai';
|
|
2
1
|
import { MockLanguageModelV1 } from 'ai/test';
|
|
3
2
|
import { describe, it, expect, beforeEach } from 'vitest';
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
import {
|
|
3
|
+
import { z } from 'zod/v3';
|
|
4
|
+
import { SchemaCompatLayer } from './schema-compatibility';
|
|
5
|
+
import type { ModelInformation } from './types';
|
|
6
6
|
|
|
7
7
|
class MockSchemaCompatibility extends SchemaCompatLayer {
|
|
8
|
-
constructor(model:
|
|
8
|
+
constructor(model: ModelInformation) {
|
|
9
9
|
super(model);
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -18,16 +18,16 @@ class MockSchemaCompatibility extends SchemaCompatLayer {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
processZodType(value: z.ZodTypeAny): z.ZodTypeAny {
|
|
21
|
-
if (isObj(value)) {
|
|
21
|
+
if (this.isObj(value)) {
|
|
22
22
|
return this.defaultZodObjectHandler(value);
|
|
23
|
-
} else if (isArr(value)) {
|
|
23
|
+
} else if (this.isArr(value)) {
|
|
24
24
|
// For these tests, we will handle all checks by converting them to descriptions.
|
|
25
25
|
return this.defaultZodArrayHandler(value, ['min', 'max', 'length']);
|
|
26
|
-
} else if (isOptional(value)) {
|
|
26
|
+
} else if (this.isOptional(value)) {
|
|
27
27
|
return this.defaultZodOptionalHandler(value);
|
|
28
|
-
} else if (isUnion(value)) {
|
|
28
|
+
} else if (this.isUnion(value)) {
|
|
29
29
|
return this.defaultZodUnionHandler(value);
|
|
30
|
-
} else if (isString(value)) {
|
|
30
|
+
} else if (this.isString(value)) {
|
|
31
31
|
// Add a marker to confirm it was processed
|
|
32
32
|
return z.string().describe(`${value.description || 'string'}:processed`);
|
|
33
33
|
} else {
|