@mastra/schema-compat 1.3.5-alpha.0 → 1.3.6-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
@@ -123,7 +123,7 @@ Error message: ${getErrorMessage(cause)}`,
123
123
  _a13$1 = symbol13$1;
124
124
  var TypeValidationError = _TypeValidationError;
125
125
  //#endregion
126
- //#region ../_vendored/ai_v4/dist/dist-e6zV1w-k.js
126
+ //#region ../_vendored/ai_v4/dist/index.js
127
127
  var __create = Object.create;
128
128
  var __defProp$1 = Object.defineProperty;
129
129
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -343,8 +343,6 @@ function safeParseJSON({ text, schema }) {
343
343
  }
344
344
  }
345
345
  var { btoa, atob } = globalThis;
346
- //#endregion
347
- //#region ../_vendored/ai_v4/dist/index.js
348
346
  const ignoreOverride = Symbol("Let zodToJsonSchema decide on which parser to use");
349
347
  const defaultOptions = {
350
348
  name: void 0,
@@ -5663,7 +5661,8 @@ var GoogleSchemaCompatLayer = class extends SchemaCompatLayer {
5663
5661
  s["nullable"] = true;
5664
5662
  } else {
5665
5663
  delete s["type"];
5666
- delete s["nullable"];
5664
+ s["anyOf"] = nonNull.map((t) => ({ type: t }));
5665
+ if (hasNull) s["nullable"] = true;
5667
5666
  }
5668
5667
  }
5669
5668
  if (Array.isArray(s["oneOf"])) {
@@ -5693,6 +5692,25 @@ var GoogleSchemaCompatLayer = class extends SchemaCompatLayer {
5693
5692
  s["nullable"] = true;
5694
5693
  }
5695
5694
  }
5695
+ if (!s["type"] && !s["anyOf"] && !s["oneOf"] && !s["allOf"] && !s["$ref"] && !s["enum"] && !s["const"] && !s["properties"] && !s["items"]) {
5696
+ s["anyOf"] = [...[
5697
+ "string",
5698
+ "number",
5699
+ "integer",
5700
+ "boolean",
5701
+ "object"
5702
+ ].map((t) => ({ type: t })), {
5703
+ type: "array",
5704
+ items: { anyOf: [
5705
+ "string",
5706
+ "number",
5707
+ "integer",
5708
+ "boolean",
5709
+ "object"
5710
+ ].map((t) => ({ type: t })) }
5711
+ }];
5712
+ s["nullable"] = true;
5713
+ }
5696
5714
  }
5697
5715
  #traverse(value, schema) {
5698
5716
  const resolved = this.#resolveAnyOf(schema);