@mastra/schema-compat 1.1.2 → 1.1.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/dist/index.js CHANGED
@@ -4994,6 +4994,36 @@ var SchemaCompatLayer3 = class {
4994
4994
  return jsonSchema2;
4995
4995
  }
4996
4996
  };
4997
+ function isOptional2(z11) {
4998
+ return (v) => v instanceof z11["ZodOptional"];
4999
+ }
5000
+ function isObj2(z11) {
5001
+ return (v) => v instanceof z11["ZodObject"];
5002
+ }
5003
+ function isNull(z11) {
5004
+ return (v) => v instanceof z11["ZodNull"];
5005
+ }
5006
+ function isArr2(z11) {
5007
+ return (v) => v instanceof z11["ZodArray"];
5008
+ }
5009
+ function isUnion2(z11) {
5010
+ return (v) => v instanceof z11["ZodUnion"];
5011
+ }
5012
+ function isString2(z11) {
5013
+ return (v) => v instanceof z11["ZodString"];
5014
+ }
5015
+ function isNumber2(z11) {
5016
+ return (v) => v instanceof z11["ZodNumber"];
5017
+ }
5018
+ function isDate(z11) {
5019
+ return (v) => v instanceof z11["ZodDate"];
5020
+ }
5021
+ function isDefault(z11) {
5022
+ return (v) => v instanceof z11["ZodDefault"];
5023
+ }
5024
+ function isNullable(z11) {
5025
+ return (v) => v instanceof z11["ZodNullable"];
5026
+ }
4997
5027
 
4998
5028
  // src/provider-compats/anthropic.ts
4999
5029
  var AnthropicSchemaCompatLayer = class extends SchemaCompatLayer3 {
@@ -5023,6 +5053,8 @@ var AnthropicSchemaCompatLayer = class extends SchemaCompatLayer3 {
5023
5053
  } else {
5024
5054
  return value;
5025
5055
  }
5056
+ } else if (isNull(z)(value)) {
5057
+ return z.any().refine((v) => v === null, { message: "must be null" }).describe(value.description || "must be null");
5026
5058
  }
5027
5059
  return this.defaultUnsupportedZodTypeHandler(value);
5028
5060
  }
@@ -5051,38 +5083,6 @@ var AnthropicSchemaCompatLayer = class extends SchemaCompatLayer3 {
5051
5083
  }
5052
5084
  }
5053
5085
  };
5054
- function isOptional2(z10) {
5055
- return (v) => v instanceof z10["ZodOptional"];
5056
- }
5057
- function isObj2(z10) {
5058
- return (v) => v instanceof z10["ZodObject"];
5059
- }
5060
- function isNull(z10) {
5061
- return (v) => v instanceof z10["ZodNull"];
5062
- }
5063
- function isArr2(z10) {
5064
- return (v) => v instanceof z10["ZodArray"];
5065
- }
5066
- function isUnion2(z10) {
5067
- return (v) => v instanceof z10["ZodUnion"];
5068
- }
5069
- function isString2(z10) {
5070
- return (v) => v instanceof z10["ZodString"];
5071
- }
5072
- function isNumber2(z10) {
5073
- return (v) => v instanceof z10["ZodNumber"];
5074
- }
5075
- function isDate(z10) {
5076
- return (v) => v instanceof z10["ZodDate"];
5077
- }
5078
- function isDefault(z10) {
5079
- return (v) => v instanceof z10["ZodDefault"];
5080
- }
5081
- function isNullable(z10) {
5082
- return (v) => v instanceof z10["ZodNullable"];
5083
- }
5084
-
5085
- // src/provider-compats/deepseek.ts
5086
5086
  var DeepSeekSchemaCompatLayer = class extends SchemaCompatLayer3 {
5087
5087
  constructor(model) {
5088
5088
  super(model);
@@ -5453,6 +5453,8 @@ var OpenAIReasoningSchemaCompatLayer = class extends SchemaCompatLayer3 {
5453
5453
  return this.defaultZodStringHandler(value);
5454
5454
  } else if (isDate(z)(value)) {
5455
5455
  return this.defaultZodDateHandler(value);
5456
+ } else if (isNull(z)(value)) {
5457
+ return z.any().refine((v) => v === null, { message: "must be null" }).describe(value.description || "must be null");
5456
5458
  } else if (value.constructor.name === "ZodAny") {
5457
5459
  return z.string().describe(
5458
5460
  (value.description ?? "") + `