@mastra/schema-compat 0.10.2 → 0.10.3-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.
- package/.turbo/turbo-build.log +7 -7
- package/CHANGELOG.md +6 -0
- package/dist/index.cjs +2 -7
- package/dist/index.js +2 -7
- package/package.json +12 -12
- package/src/provider-compats/anthropic.ts +2 -7
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
|
|
2
|
-
> @mastra/schema-compat@0.10.
|
|
2
|
+
> @mastra/schema-compat@0.10.3-alpha.0 build /home/runner/work/mastra/mastra/packages/schema-compat
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
6
6
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
7
|
[34mCLI[39m tsup v8.5.0
|
|
8
8
|
[34mTSC[39m Build start
|
|
9
|
-
[32mTSC[39m ⚡️ Build success in
|
|
9
|
+
[32mTSC[39m ⚡️ Build success in 2224ms
|
|
10
10
|
[34mDTS[39m Build start
|
|
11
11
|
[34mCLI[39m Target: es2022
|
|
12
12
|
Analysis will use the bundled TypeScript version 5.8.3
|
|
13
13
|
[36mWriting package typings: /home/runner/work/mastra/mastra/packages/schema-compat/dist/_tsup-dts-rollup.d.ts[39m
|
|
14
14
|
Analysis will use the bundled TypeScript version 5.8.3
|
|
15
15
|
[36mWriting package typings: /home/runner/work/mastra/mastra/packages/schema-compat/dist/_tsup-dts-rollup.d.cts[39m
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 1937ms
|
|
17
17
|
[34mCLI[39m Cleaning output folder
|
|
18
18
|
[34mESM[39m Build start
|
|
19
19
|
[34mCJS[39m Build start
|
|
20
|
-
[32mESM[39m [1mdist/index.js [22m[
|
|
21
|
-
[32mESM[39m ⚡️ Build success in
|
|
22
|
-
[32mCJS[39m [1mdist/index.cjs [22m[32m21.
|
|
23
|
-
[32mCJS[39m ⚡️ Build success in
|
|
20
|
+
[32mESM[39m [1mdist/index.js [22m[32m20.79 KB[39m
|
|
21
|
+
[32mESM[39m ⚡️ Build success in 150ms
|
|
22
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m21.42 KB[39m
|
|
23
|
+
[32mCJS[39m ⚡️ Build success in 185ms
|
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -425,9 +425,8 @@ var AnthropicSchemaCompatLayer = class extends SchemaCompatLayer {
|
|
|
425
425
|
}
|
|
426
426
|
processZodType(value) {
|
|
427
427
|
if (isOptional(value)) {
|
|
428
|
-
const handleTypes = ["ZodObject", "ZodArray", "ZodUnion", "ZodNever", "ZodUndefined"];
|
|
428
|
+
const handleTypes = ["ZodObject", "ZodArray", "ZodUnion", "ZodNever", "ZodUndefined", "ZodTuple"];
|
|
429
429
|
if (this.getModel().modelId.includes("claude-3.5-haiku")) handleTypes.push("ZodString");
|
|
430
|
-
if (this.getModel().modelId.includes("claude-3.7")) handleTypes.push("ZodTuple");
|
|
431
430
|
return this.defaultZodOptionalHandler(value, handleTypes);
|
|
432
431
|
} else if (isObj(value)) {
|
|
433
432
|
return this.defaultZodObjectHandler(value);
|
|
@@ -442,11 +441,7 @@ var AnthropicSchemaCompatLayer = class extends SchemaCompatLayer {
|
|
|
442
441
|
return value;
|
|
443
442
|
}
|
|
444
443
|
}
|
|
445
|
-
|
|
446
|
-
return this.defaultUnsupportedZodTypeHandler(value, ["ZodNever", "ZodTuple", "ZodUndefined"]);
|
|
447
|
-
} else {
|
|
448
|
-
return this.defaultUnsupportedZodTypeHandler(value, ["ZodNever", "ZodUndefined"]);
|
|
449
|
-
}
|
|
444
|
+
return this.defaultUnsupportedZodTypeHandler(value, ["ZodNever", "ZodTuple", "ZodUndefined"]);
|
|
450
445
|
}
|
|
451
446
|
};
|
|
452
447
|
|
package/dist/index.js
CHANGED
|
@@ -423,9 +423,8 @@ var AnthropicSchemaCompatLayer = class extends SchemaCompatLayer {
|
|
|
423
423
|
}
|
|
424
424
|
processZodType(value) {
|
|
425
425
|
if (isOptional(value)) {
|
|
426
|
-
const handleTypes = ["ZodObject", "ZodArray", "ZodUnion", "ZodNever", "ZodUndefined"];
|
|
426
|
+
const handleTypes = ["ZodObject", "ZodArray", "ZodUnion", "ZodNever", "ZodUndefined", "ZodTuple"];
|
|
427
427
|
if (this.getModel().modelId.includes("claude-3.5-haiku")) handleTypes.push("ZodString");
|
|
428
|
-
if (this.getModel().modelId.includes("claude-3.7")) handleTypes.push("ZodTuple");
|
|
429
428
|
return this.defaultZodOptionalHandler(value, handleTypes);
|
|
430
429
|
} else if (isObj(value)) {
|
|
431
430
|
return this.defaultZodObjectHandler(value);
|
|
@@ -440,11 +439,7 @@ var AnthropicSchemaCompatLayer = class extends SchemaCompatLayer {
|
|
|
440
439
|
return value;
|
|
441
440
|
}
|
|
442
441
|
}
|
|
443
|
-
|
|
444
|
-
return this.defaultUnsupportedZodTypeHandler(value, ["ZodNever", "ZodTuple", "ZodUndefined"]);
|
|
445
|
-
} else {
|
|
446
|
-
return this.defaultUnsupportedZodTypeHandler(value, ["ZodNever", "ZodUndefined"]);
|
|
447
|
-
}
|
|
442
|
+
return this.defaultUnsupportedZodTypeHandler(value, ["ZodNever", "ZodTuple", "ZodUndefined"]);
|
|
448
443
|
}
|
|
449
444
|
};
|
|
450
445
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/schema-compat",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.3-alpha.0",
|
|
4
4
|
"description": "Tool schema compatibility layer for Mastra.ai",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,24 +28,24 @@
|
|
|
28
28
|
"author": "",
|
|
29
29
|
"license": "Elastic-2.0",
|
|
30
30
|
"dependencies": {
|
|
31
|
+
"json-schema": "^0.4.0",
|
|
31
32
|
"zod-from-json-schema": "^0.0.5",
|
|
32
|
-
"zod-to-json-schema": "^3.24.5"
|
|
33
|
-
"json-schema": "^0.4.0"
|
|
33
|
+
"zod-to-json-schema": "^3.24.5"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"
|
|
37
|
-
"
|
|
36
|
+
"ai": "^4.0.0",
|
|
37
|
+
"zod": "^3.0.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@types/node": "^20.17.57",
|
|
41
40
|
"@types/json-schema": "^7.0.15",
|
|
42
|
-
"
|
|
43
|
-
"tsup": "^8.5.0",
|
|
44
|
-
"typescript": "^5.8.2",
|
|
45
|
-
"vitest": "^3.2.2",
|
|
46
|
-
"zod": "^3.25.56",
|
|
41
|
+
"@types/node": "^20.19.0",
|
|
47
42
|
"ai": "4.3.16",
|
|
48
|
-
"
|
|
43
|
+
"eslint": "^9.29.0",
|
|
44
|
+
"tsup": "^8.5.0",
|
|
45
|
+
"typescript": "^5.8.3",
|
|
46
|
+
"vitest": "^3.2.3",
|
|
47
|
+
"zod": "^3.25.67",
|
|
48
|
+
"@internal/lint": "0.0.13"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting",
|
|
@@ -19,9 +19,8 @@ export class AnthropicSchemaCompatLayer extends SchemaCompatLayer {
|
|
|
19
19
|
|
|
20
20
|
processZodType(value: ZodTypeAny): ZodTypeAny {
|
|
21
21
|
if (isOptional(value)) {
|
|
22
|
-
const handleTypes: AllZodType[] = ['ZodObject', 'ZodArray', 'ZodUnion', 'ZodNever', 'ZodUndefined'];
|
|
22
|
+
const handleTypes: AllZodType[] = ['ZodObject', 'ZodArray', 'ZodUnion', 'ZodNever', 'ZodUndefined', 'ZodTuple'];
|
|
23
23
|
if (this.getModel().modelId.includes('claude-3.5-haiku')) handleTypes.push('ZodString');
|
|
24
|
-
if (this.getModel().modelId.includes('claude-3.7')) handleTypes.push('ZodTuple');
|
|
25
24
|
return this.defaultZodOptionalHandler(value, handleTypes);
|
|
26
25
|
} else if (isObj(value)) {
|
|
27
26
|
return this.defaultZodObjectHandler(value);
|
|
@@ -40,10 +39,6 @@ export class AnthropicSchemaCompatLayer extends SchemaCompatLayer {
|
|
|
40
39
|
}
|
|
41
40
|
}
|
|
42
41
|
|
|
43
|
-
|
|
44
|
-
return this.defaultUnsupportedZodTypeHandler(value, ['ZodNever', 'ZodTuple', 'ZodUndefined']);
|
|
45
|
-
} else {
|
|
46
|
-
return this.defaultUnsupportedZodTypeHandler(value, ['ZodNever', 'ZodUndefined']);
|
|
47
|
-
}
|
|
42
|
+
return this.defaultUnsupportedZodTypeHandler(value, ['ZodNever', 'ZodTuple', 'ZodUndefined']);
|
|
48
43
|
}
|
|
49
44
|
}
|