@mastra/schema-compat 1.1.3 → 1.2.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.
Files changed (81) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/LICENSE.md +15 -0
  3. package/dist/_types/@internal_ai-sdk-v4/dist/index.d.ts +7562 -0
  4. package/dist/_types/@internal_ai-v6/dist/index.d.ts +449 -343
  5. package/dist/chunk-23HDOZLF.js +105 -0
  6. package/dist/chunk-23HDOZLF.js.map +1 -0
  7. package/dist/chunk-3MLZICLP.cjs +94 -0
  8. package/dist/chunk-3MLZICLP.cjs.map +1 -0
  9. package/dist/chunk-3QMIGINL.cjs +123 -0
  10. package/dist/chunk-3QMIGINL.cjs.map +1 -0
  11. package/dist/{chunk-4EY4LZB2.js → chunk-7ZCSAPV3.js} +76 -3
  12. package/dist/chunk-7ZCSAPV3.js.map +1 -0
  13. package/dist/chunk-FKB2Z36H.cjs +68 -0
  14. package/dist/chunk-FKB2Z36H.cjs.map +1 -0
  15. package/dist/chunk-FS3P4V5M.cjs +108 -0
  16. package/dist/chunk-FS3P4V5M.cjs.map +1 -0
  17. package/dist/chunk-I2YUBGXM.js +112 -0
  18. package/dist/chunk-I2YUBGXM.js.map +1 -0
  19. package/dist/chunk-IKQO7EW7.js +62 -0
  20. package/dist/chunk-IKQO7EW7.js.map +1 -0
  21. package/dist/chunk-K7I3YXWP.js +92 -0
  22. package/dist/chunk-K7I3YXWP.js.map +1 -0
  23. package/dist/{chunk-DGOXVQNP.js → chunk-QDRBTCDV.js} +158 -479
  24. package/dist/chunk-QDRBTCDV.js.map +1 -0
  25. package/dist/{chunk-DAVEUCUM.cjs → chunk-ROFMEFEF.cjs} +160 -488
  26. package/dist/chunk-ROFMEFEF.cjs.map +1 -0
  27. package/dist/{chunk-BOGGUXB5.cjs → chunk-UFJG5KPA.cjs} +77 -2
  28. package/dist/chunk-UFJG5KPA.cjs.map +1 -0
  29. package/dist/index.cjs +626 -337
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.d.ts +6 -0
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +580 -325
  34. package/dist/index.js.map +1 -1
  35. package/dist/json-schema/utils.d.ts +8 -0
  36. package/dist/json-schema/utils.d.ts.map +1 -1
  37. package/dist/null-to-undefined.d.ts +24 -0
  38. package/dist/null-to-undefined.d.ts.map +1 -0
  39. package/dist/provider-compats/google.d.ts +3 -0
  40. package/dist/provider-compats/google.d.ts.map +1 -1
  41. package/dist/provider-compats/openai-reasoning.d.ts +5 -5
  42. package/dist/provider-compats/openai-reasoning.d.ts.map +1 -1
  43. package/dist/provider-compats/openai.d.ts +8 -0
  44. package/dist/provider-compats/openai.d.ts.map +1 -1
  45. package/dist/schema-compatibility-v3.d.ts +2 -2
  46. package/dist/schema-compatibility-v3.d.ts.map +1 -1
  47. package/dist/schema-compatibility.d.ts +2 -1
  48. package/dist/schema-compatibility.d.ts.map +1 -1
  49. package/dist/schema.cjs +16 -4
  50. package/dist/schema.d.ts +1 -1
  51. package/dist/schema.d.ts.map +1 -1
  52. package/dist/schema.js +1 -1
  53. package/dist/schema.types.d.ts +4 -2
  54. package/dist/schema.types.d.ts.map +1 -1
  55. package/dist/standard-schema/adapters/ai-sdk.cjs +16 -0
  56. package/dist/standard-schema/adapters/ai-sdk.cjs.map +1 -0
  57. package/dist/standard-schema/adapters/ai-sdk.js +3 -0
  58. package/dist/standard-schema/adapters/ai-sdk.js.map +1 -0
  59. package/dist/standard-schema/adapters/json-schema.cjs +16 -0
  60. package/dist/standard-schema/adapters/json-schema.cjs.map +1 -0
  61. package/dist/standard-schema/adapters/json-schema.d.ts.map +1 -1
  62. package/dist/standard-schema/adapters/json-schema.js +3 -0
  63. package/dist/standard-schema/adapters/json-schema.js.map +1 -0
  64. package/dist/standard-schema/adapters/zod-v3.cjs +12 -0
  65. package/dist/standard-schema/adapters/zod-v3.cjs.map +1 -0
  66. package/dist/standard-schema/adapters/zod-v3.js +3 -0
  67. package/dist/standard-schema/adapters/zod-v3.js.map +1 -0
  68. package/dist/standard-schema/standard-schema.d.ts.map +1 -1
  69. package/dist/standard-schema-compat.d.ts +74 -0
  70. package/dist/standard-schema-compat.d.ts.map +1 -0
  71. package/dist/utils.d.ts +3 -2
  72. package/dist/utils.d.ts.map +1 -1
  73. package/dist/zod-to-json.cjs +10 -2
  74. package/dist/zod-to-json.d.ts +13 -0
  75. package/dist/zod-to-json.d.ts.map +1 -1
  76. package/dist/zod-to-json.js +1 -1
  77. package/package.json +41 -10
  78. package/dist/chunk-4EY4LZB2.js.map +0 -1
  79. package/dist/chunk-BOGGUXB5.cjs.map +0 -1
  80. package/dist/chunk-DAVEUCUM.cjs.map +0 -1
  81. package/dist/chunk-DGOXVQNP.js.map +0 -1
@@ -1,10 +1,9 @@
1
+ import { require_json_schema_traverse } from './chunk-K7I3YXWP.js';
1
2
  import { __commonJS, __toESM } from './chunk-5WRI5ZAA.js';
2
- import z3 from 'zod/v3';
3
- import zodToJsonSchemaOriginal from 'zod-to-json-schema';
4
3
 
5
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/codegen/code.js
4
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/code.js
6
5
  var require_code = __commonJS({
7
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/codegen/code.js"(exports$1) {
6
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/code.js"(exports$1) {
8
7
  Object.defineProperty(exports$1, "__esModule", { value: true });
9
8
  exports$1.regexpCode = exports$1.getEsmExportName = exports$1.getProperty = exports$1.safeStringify = exports$1.stringify = exports$1.strConcat = exports$1.addCodeArg = exports$1.str = exports$1._ = exports$1.nil = exports$1._Code = exports$1.Name = exports$1.IDENTIFIER = exports$1._CodeOrName = void 0;
10
9
  var _CodeOrName = class {
@@ -155,9 +154,9 @@ var require_code = __commonJS({
155
154
  }
156
155
  });
157
156
 
158
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/codegen/scope.js
157
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/scope.js
159
158
  var require_scope = __commonJS({
160
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/codegen/scope.js"(exports$1) {
159
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/scope.js"(exports$1) {
161
160
  Object.defineProperty(exports$1, "__esModule", { value: true });
162
161
  exports$1.ValueScope = exports$1.ValueScopeName = exports$1.Scope = exports$1.varKinds = exports$1.UsedValueState = void 0;
163
162
  var code_1 = require_code();
@@ -299,9 +298,9 @@ var require_scope = __commonJS({
299
298
  }
300
299
  });
301
300
 
302
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/codegen/index.js
301
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/index.js
303
302
  var require_codegen = __commonJS({
304
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/codegen/index.js"(exports$1) {
303
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/index.js"(exports$1) {
305
304
  Object.defineProperty(exports$1, "__esModule", { value: true });
306
305
  exports$1.or = exports$1.and = exports$1.not = exports$1.CodeGen = exports$1.operators = exports$1.varKinds = exports$1.ValueScopeName = exports$1.ValueScope = exports$1.Scope = exports$1.Name = exports$1.regexpCode = exports$1.stringify = exports$1.getProperty = exports$1.nil = exports$1.strConcat = exports$1.str = exports$1._ = void 0;
307
306
  var code_1 = require_code();
@@ -1018,9 +1017,9 @@ var require_codegen = __commonJS({
1018
1017
  }
1019
1018
  });
1020
1019
 
1021
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/util.js
1020
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/util.js
1022
1021
  var require_util = __commonJS({
1023
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/util.js"(exports$1) {
1022
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/util.js"(exports$1) {
1024
1023
  Object.defineProperty(exports$1, "__esModule", { value: true });
1025
1024
  exports$1.checkStrictMode = exports$1.getErrorPath = exports$1.Type = exports$1.useFunc = exports$1.setEvaluated = exports$1.evaluatedPropsToName = exports$1.mergeEvaluated = exports$1.eachItem = exports$1.unescapeJsonPointer = exports$1.escapeJsonPointer = exports$1.escapeFragment = exports$1.unescapeFragment = exports$1.schemaRefOrVal = exports$1.schemaHasRulesButRef = exports$1.schemaHasRules = exports$1.checkUnknownRules = exports$1.alwaysValidSchema = exports$1.toHash = void 0;
1026
1025
  var codegen_1 = require_codegen();
@@ -1184,9 +1183,9 @@ var require_util = __commonJS({
1184
1183
  }
1185
1184
  });
1186
1185
 
1187
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/names.js
1186
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/names.js
1188
1187
  var require_names = __commonJS({
1189
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/names.js"(exports$1) {
1188
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/names.js"(exports$1) {
1190
1189
  Object.defineProperty(exports$1, "__esModule", { value: true });
1191
1190
  var codegen_1 = require_codegen();
1192
1191
  var names = {
@@ -1222,9 +1221,9 @@ var require_names = __commonJS({
1222
1221
  }
1223
1222
  });
1224
1223
 
1225
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/errors.js
1224
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/errors.js
1226
1225
  var require_errors = __commonJS({
1227
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/errors.js"(exports$1) {
1226
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/errors.js"(exports$1) {
1228
1227
  Object.defineProperty(exports$1, "__esModule", { value: true });
1229
1228
  exports$1.extendErrors = exports$1.resetErrorsCount = exports$1.reportExtraError = exports$1.reportError = exports$1.keyword$DataError = exports$1.keywordError = void 0;
1230
1229
  var codegen_1 = require_codegen();
@@ -1343,9 +1342,9 @@ var require_errors = __commonJS({
1343
1342
  }
1344
1343
  });
1345
1344
 
1346
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/boolSchema.js
1345
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/boolSchema.js
1347
1346
  var require_boolSchema = __commonJS({
1348
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/boolSchema.js"(exports$1) {
1347
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/boolSchema.js"(exports$1) {
1349
1348
  Object.defineProperty(exports$1, "__esModule", { value: true });
1350
1349
  exports$1.boolOrEmptySchema = exports$1.topBoolOrEmptySchema = void 0;
1351
1350
  var errors_1 = require_errors();
@@ -1393,9 +1392,9 @@ var require_boolSchema = __commonJS({
1393
1392
  }
1394
1393
  });
1395
1394
 
1396
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/rules.js
1395
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/rules.js
1397
1396
  var require_rules = __commonJS({
1398
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/rules.js"(exports$1) {
1397
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/rules.js"(exports$1) {
1399
1398
  Object.defineProperty(exports$1, "__esModule", { value: true });
1400
1399
  exports$1.getRules = exports$1.isJSONType = void 0;
1401
1400
  var _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"];
@@ -1423,9 +1422,9 @@ var require_rules = __commonJS({
1423
1422
  }
1424
1423
  });
1425
1424
 
1426
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/applicability.js
1425
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/applicability.js
1427
1426
  var require_applicability = __commonJS({
1428
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/applicability.js"(exports$1) {
1427
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/applicability.js"(exports$1) {
1429
1428
  Object.defineProperty(exports$1, "__esModule", { value: true });
1430
1429
  exports$1.shouldUseRule = exports$1.shouldUseGroup = exports$1.schemaHasRulesForType = void 0;
1431
1430
  function schemaHasRulesForType({ schema, self }, type) {
@@ -1445,9 +1444,9 @@ var require_applicability = __commonJS({
1445
1444
  }
1446
1445
  });
1447
1446
 
1448
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/dataType.js
1447
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/dataType.js
1449
1448
  var require_dataType = __commonJS({
1450
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/dataType.js"(exports$1) {
1449
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/dataType.js"(exports$1) {
1451
1450
  Object.defineProperty(exports$1, "__esModule", { value: true });
1452
1451
  exports$1.reportTypeError = exports$1.checkDataTypes = exports$1.checkDataType = exports$1.coerceAndCheckDataType = exports$1.getJSONTypes = exports$1.getSchemaTypes = exports$1.DataType = void 0;
1453
1452
  var rules_1 = require_rules();
@@ -1628,9 +1627,9 @@ var require_dataType = __commonJS({
1628
1627
  }
1629
1628
  });
1630
1629
 
1631
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/defaults.js
1630
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/defaults.js
1632
1631
  var require_defaults = __commonJS({
1633
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/defaults.js"(exports$1) {
1632
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/defaults.js"(exports$1) {
1634
1633
  Object.defineProperty(exports$1, "__esModule", { value: true });
1635
1634
  exports$1.assignDefaults = void 0;
1636
1635
  var codegen_1 = require_codegen();
@@ -1664,9 +1663,9 @@ var require_defaults = __commonJS({
1664
1663
  }
1665
1664
  });
1666
1665
 
1667
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/code.js
1666
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/code.js
1668
1667
  var require_code2 = __commonJS({
1669
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/code.js"(exports$1) {
1668
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/code.js"(exports$1) {
1670
1669
  Object.defineProperty(exports$1, "__esModule", { value: true });
1671
1670
  exports$1.validateUnion = exports$1.validateArray = exports$1.usePattern = exports$1.callValidateCode = exports$1.schemaProperties = exports$1.allSchemaProperties = exports$1.noPropertyInData = exports$1.propertyInData = exports$1.isOwnProperty = exports$1.hasPropFunc = exports$1.reportMissingProp = exports$1.checkMissingProp = exports$1.checkReportMissingProp = void 0;
1672
1671
  var codegen_1 = require_codegen();
@@ -1796,9 +1795,9 @@ var require_code2 = __commonJS({
1796
1795
  }
1797
1796
  });
1798
1797
 
1799
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/keyword.js
1798
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/keyword.js
1800
1799
  var require_keyword = __commonJS({
1801
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/keyword.js"(exports$1) {
1800
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/keyword.js"(exports$1) {
1802
1801
  Object.defineProperty(exports$1, "__esModule", { value: true });
1803
1802
  exports$1.validateKeywordUsage = exports$1.validSchemaType = exports$1.funcKeywordCode = exports$1.macroKeywordCode = void 0;
1804
1803
  var codegen_1 = require_codegen();
@@ -1913,9 +1912,9 @@ var require_keyword = __commonJS({
1913
1912
  }
1914
1913
  });
1915
1914
 
1916
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/subschema.js
1915
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/subschema.js
1917
1916
  var require_subschema = __commonJS({
1918
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/subschema.js"(exports$1) {
1917
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/subschema.js"(exports$1) {
1919
1918
  Object.defineProperty(exports$1, "__esModule", { value: true });
1920
1919
  exports$1.extendSubschemaMode = exports$1.extendSubschemaData = exports$1.getSubschema = void 0;
1921
1920
  var codegen_1 = require_codegen();
@@ -2029,96 +2028,9 @@ var require_fast_deep_equal = __commonJS({
2029
2028
  }
2030
2029
  });
2031
2030
 
2032
- // ../../node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js
2033
- var require_json_schema_traverse = __commonJS({
2034
- "../../node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js"(exports$1, module) {
2035
- var traverse2 = module.exports = function(schema, opts, cb) {
2036
- if (typeof opts == "function") {
2037
- cb = opts;
2038
- opts = {};
2039
- }
2040
- cb = opts.cb || cb;
2041
- var pre = typeof cb == "function" ? cb : cb.pre || function() {
2042
- };
2043
- var post = cb.post || function() {
2044
- };
2045
- _traverse(opts, pre, post, schema, "", schema);
2046
- };
2047
- traverse2.keywords = {
2048
- additionalItems: true,
2049
- items: true,
2050
- contains: true,
2051
- additionalProperties: true,
2052
- propertyNames: true,
2053
- not: true,
2054
- if: true,
2055
- then: true,
2056
- else: true
2057
- };
2058
- traverse2.arrayKeywords = {
2059
- items: true,
2060
- allOf: true,
2061
- anyOf: true,
2062
- oneOf: true
2063
- };
2064
- traverse2.propsKeywords = {
2065
- $defs: true,
2066
- definitions: true,
2067
- properties: true,
2068
- patternProperties: true,
2069
- dependencies: true
2070
- };
2071
- traverse2.skipKeywords = {
2072
- default: true,
2073
- enum: true,
2074
- const: true,
2075
- required: true,
2076
- maximum: true,
2077
- minimum: true,
2078
- exclusiveMaximum: true,
2079
- exclusiveMinimum: true,
2080
- multipleOf: true,
2081
- maxLength: true,
2082
- minLength: true,
2083
- pattern: true,
2084
- format: true,
2085
- maxItems: true,
2086
- minItems: true,
2087
- uniqueItems: true,
2088
- maxProperties: true,
2089
- minProperties: true
2090
- };
2091
- function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
2092
- if (schema && typeof schema == "object" && !Array.isArray(schema)) {
2093
- pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
2094
- for (var key in schema) {
2095
- var sch = schema[key];
2096
- if (Array.isArray(sch)) {
2097
- if (key in traverse2.arrayKeywords) {
2098
- for (var i = 0; i < sch.length; i++)
2099
- _traverse(opts, pre, post, sch[i], jsonPtr + "/" + key + "/" + i, rootSchema, jsonPtr, key, schema, i);
2100
- }
2101
- } else if (key in traverse2.propsKeywords) {
2102
- if (sch && typeof sch == "object") {
2103
- for (var prop in sch)
2104
- _traverse(opts, pre, post, sch[prop], jsonPtr + "/" + key + "/" + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);
2105
- }
2106
- } else if (key in traverse2.keywords || opts.allKeys && !(key in traverse2.skipKeywords)) {
2107
- _traverse(opts, pre, post, sch, jsonPtr + "/" + key, rootSchema, jsonPtr, key, schema);
2108
- }
2109
- }
2110
- post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
2111
- }
2112
- }
2113
- function escapeJsonPtr(str) {
2114
- return str.replace(/~/g, "~0").replace(/\//g, "~1");
2115
- }
2116
- }
2117
- });
2118
-
2119
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/resolve.js
2031
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/resolve.js
2120
2032
  var require_resolve = __commonJS({
2121
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/resolve.js"(exports$1) {
2033
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/resolve.js"(exports$1) {
2122
2034
  Object.defineProperty(exports$1, "__esModule", { value: true });
2123
2035
  exports$1.getSchemaRefs = exports$1.resolveUrl = exports$1.normalizeId = exports$1._getFullPath = exports$1.getFullPath = exports$1.inlineRef = void 0;
2124
2036
  var util_1 = require_util();
@@ -2271,9 +2183,9 @@ var require_resolve = __commonJS({
2271
2183
  }
2272
2184
  });
2273
2185
 
2274
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/index.js
2186
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/index.js
2275
2187
  var require_validate = __commonJS({
2276
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/index.js"(exports$1) {
2188
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/index.js"(exports$1) {
2277
2189
  Object.defineProperty(exports$1, "__esModule", { value: true });
2278
2190
  exports$1.getData = exports$1.KeywordCxt = exports$1.validateFunctionCode = void 0;
2279
2191
  var boolSchema_1 = require_boolSchema();
@@ -2777,9 +2689,9 @@ var require_validate = __commonJS({
2777
2689
  }
2778
2690
  });
2779
2691
 
2780
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/validation_error.js
2692
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/validation_error.js
2781
2693
  var require_validation_error = __commonJS({
2782
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/validation_error.js"(exports$1) {
2694
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/validation_error.js"(exports$1) {
2783
2695
  Object.defineProperty(exports$1, "__esModule", { value: true });
2784
2696
  var ValidationError = class extends Error {
2785
2697
  constructor(errors) {
@@ -2792,9 +2704,9 @@ var require_validation_error = __commonJS({
2792
2704
  }
2793
2705
  });
2794
2706
 
2795
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/ref_error.js
2707
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/ref_error.js
2796
2708
  var require_ref_error = __commonJS({
2797
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/ref_error.js"(exports$1) {
2709
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/ref_error.js"(exports$1) {
2798
2710
  Object.defineProperty(exports$1, "__esModule", { value: true });
2799
2711
  var resolve_1 = require_resolve();
2800
2712
  var MissingRefError = class extends Error {
@@ -2808,9 +2720,9 @@ var require_ref_error = __commonJS({
2808
2720
  }
2809
2721
  });
2810
2722
 
2811
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/index.js
2723
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/index.js
2812
2724
  var require_compile = __commonJS({
2813
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/index.js"(exports$1) {
2725
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/index.js"(exports$1) {
2814
2726
  Object.defineProperty(exports$1, "__esModule", { value: true });
2815
2727
  exports$1.resolveSchema = exports$1.getCompilingSchema = exports$1.resolveRef = exports$1.compileSchema = exports$1.SchemaEnv = void 0;
2816
2728
  var codegen_1 = require_codegen();
@@ -3031,9 +2943,9 @@ var require_compile = __commonJS({
3031
2943
  }
3032
2944
  });
3033
2945
 
3034
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/refs/data.json
2946
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/data.json
3035
2947
  var require_data = __commonJS({
3036
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/refs/data.json"(exports$1, module) {
2948
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/data.json"(exports$1, module) {
3037
2949
  module.exports = {
3038
2950
  $id: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
3039
2951
  description: "Meta-schema for $data reference (JSON AnySchema extension proposal)",
@@ -3769,9 +3681,9 @@ var require_fast_uri = __commonJS({
3769
3681
  }
3770
3682
  });
3771
3683
 
3772
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/uri.js
3684
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/uri.js
3773
3685
  var require_uri = __commonJS({
3774
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/uri.js"(exports$1) {
3686
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/uri.js"(exports$1) {
3775
3687
  Object.defineProperty(exports$1, "__esModule", { value: true });
3776
3688
  var uri = require_fast_uri();
3777
3689
  uri.code = 'require("ajv/dist/runtime/uri").default';
@@ -3779,9 +3691,9 @@ var require_uri = __commonJS({
3779
3691
  }
3780
3692
  });
3781
3693
 
3782
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/core.js
3694
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/core.js
3783
3695
  var require_core = __commonJS({
3784
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/core.js"(exports$1) {
3696
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/core.js"(exports$1) {
3785
3697
  Object.defineProperty(exports$1, "__esModule", { value: true });
3786
3698
  exports$1.CodeGen = exports$1.Name = exports$1.nil = exports$1.stringify = exports$1.str = exports$1._ = exports$1.KeywordCxt = void 0;
3787
3699
  var validate_1 = require_validate();
@@ -4389,9 +4301,9 @@ var require_core = __commonJS({
4389
4301
  }
4390
4302
  });
4391
4303
 
4392
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/core/id.js
4304
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/id.js
4393
4305
  var require_id = __commonJS({
4394
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/core/id.js"(exports$1) {
4306
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/id.js"(exports$1) {
4395
4307
  Object.defineProperty(exports$1, "__esModule", { value: true });
4396
4308
  var def = {
4397
4309
  keyword: "id",
@@ -4403,9 +4315,9 @@ var require_id = __commonJS({
4403
4315
  }
4404
4316
  });
4405
4317
 
4406
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/core/ref.js
4318
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/ref.js
4407
4319
  var require_ref = __commonJS({
4408
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/core/ref.js"(exports$1) {
4320
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/ref.js"(exports$1) {
4409
4321
  Object.defineProperty(exports$1, "__esModule", { value: true });
4410
4322
  exports$1.callRef = exports$1.getValidate = void 0;
4411
4323
  var ref_error_1 = require_ref_error();
@@ -4524,9 +4436,9 @@ var require_ref = __commonJS({
4524
4436
  }
4525
4437
  });
4526
4438
 
4527
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/core/index.js
4439
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/index.js
4528
4440
  var require_core2 = __commonJS({
4529
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/core/index.js"(exports$1) {
4441
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/index.js"(exports$1) {
4530
4442
  Object.defineProperty(exports$1, "__esModule", { value: true });
4531
4443
  var id_1 = require_id();
4532
4444
  var ref_1 = require_ref();
@@ -4544,9 +4456,9 @@ var require_core2 = __commonJS({
4544
4456
  }
4545
4457
  });
4546
4458
 
4547
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitNumber.js
4459
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js
4548
4460
  var require_limitNumber = __commonJS({
4549
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitNumber.js"(exports$1) {
4461
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js"(exports$1) {
4550
4462
  Object.defineProperty(exports$1, "__esModule", { value: true });
4551
4463
  var codegen_1 = require_codegen();
4552
4464
  var ops = codegen_1.operators;
@@ -4575,9 +4487,9 @@ var require_limitNumber = __commonJS({
4575
4487
  }
4576
4488
  });
4577
4489
 
4578
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/multipleOf.js
4490
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js
4579
4491
  var require_multipleOf = __commonJS({
4580
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/multipleOf.js"(exports$1) {
4492
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js"(exports$1) {
4581
4493
  Object.defineProperty(exports$1, "__esModule", { value: true });
4582
4494
  var codegen_1 = require_codegen();
4583
4495
  var error = {
@@ -4602,9 +4514,9 @@ var require_multipleOf = __commonJS({
4602
4514
  }
4603
4515
  });
4604
4516
 
4605
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/ucs2length.js
4517
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/ucs2length.js
4606
4518
  var require_ucs2length = __commonJS({
4607
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/ucs2length.js"(exports$1) {
4519
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/ucs2length.js"(exports$1) {
4608
4520
  Object.defineProperty(exports$1, "__esModule", { value: true });
4609
4521
  function ucs2length(str) {
4610
4522
  const len = str.length;
@@ -4627,9 +4539,9 @@ var require_ucs2length = __commonJS({
4627
4539
  }
4628
4540
  });
4629
4541
 
4630
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitLength.js
4542
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js
4631
4543
  var require_limitLength = __commonJS({
4632
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitLength.js"(exports$1) {
4544
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js"(exports$1) {
4633
4545
  Object.defineProperty(exports$1, "__esModule", { value: true });
4634
4546
  var codegen_1 = require_codegen();
4635
4547
  var util_1 = require_util();
@@ -4658,11 +4570,12 @@ var require_limitLength = __commonJS({
4658
4570
  }
4659
4571
  });
4660
4572
 
4661
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/pattern.js
4573
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/pattern.js
4662
4574
  var require_pattern = __commonJS({
4663
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/pattern.js"(exports$1) {
4575
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/pattern.js"(exports$1) {
4664
4576
  Object.defineProperty(exports$1, "__esModule", { value: true });
4665
4577
  var code_1 = require_code2();
4578
+ var util_1 = require_util();
4666
4579
  var codegen_1 = require_codegen();
4667
4580
  var error = {
4668
4581
  message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`,
@@ -4675,19 +4588,27 @@ var require_pattern = __commonJS({
4675
4588
  $data: true,
4676
4589
  error,
4677
4590
  code(cxt) {
4678
- const { data, $data, schema, schemaCode, it } = cxt;
4591
+ const { gen, data, $data, schema, schemaCode, it } = cxt;
4679
4592
  const u = it.opts.unicodeRegExp ? "u" : "";
4680
- const regExp = $data ? (0, codegen_1._)`(new RegExp(${schemaCode}, ${u}))` : (0, code_1.usePattern)(cxt, schema);
4681
- cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);
4593
+ if ($data) {
4594
+ const { regExp } = it.opts.code;
4595
+ const regExpCode = regExp.code === "new RegExp" ? (0, codegen_1._)`new RegExp` : (0, util_1.useFunc)(gen, regExp);
4596
+ const valid = gen.let("valid");
4597
+ gen.try(() => gen.assign(valid, (0, codegen_1._)`${regExpCode}(${schemaCode}, ${u}).test(${data})`), () => gen.assign(valid, false));
4598
+ cxt.fail$data((0, codegen_1._)`!${valid}`);
4599
+ } else {
4600
+ const regExp = (0, code_1.usePattern)(cxt, schema);
4601
+ cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);
4602
+ }
4682
4603
  }
4683
4604
  };
4684
4605
  exports$1.default = def;
4685
4606
  }
4686
4607
  });
4687
4608
 
4688
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitProperties.js
4609
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js
4689
4610
  var require_limitProperties = __commonJS({
4690
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitProperties.js"(exports$1) {
4611
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js"(exports$1) {
4691
4612
  Object.defineProperty(exports$1, "__esModule", { value: true });
4692
4613
  var codegen_1 = require_codegen();
4693
4614
  var error = {
@@ -4713,9 +4634,9 @@ var require_limitProperties = __commonJS({
4713
4634
  }
4714
4635
  });
4715
4636
 
4716
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/required.js
4637
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/required.js
4717
4638
  var require_required = __commonJS({
4718
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/required.js"(exports$1) {
4639
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/required.js"(exports$1) {
4719
4640
  Object.defineProperty(exports$1, "__esModule", { value: true });
4720
4641
  var code_1 = require_code2();
4721
4642
  var codegen_1 = require_codegen();
@@ -4794,9 +4715,9 @@ var require_required = __commonJS({
4794
4715
  }
4795
4716
  });
4796
4717
 
4797
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitItems.js
4718
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js
4798
4719
  var require_limitItems = __commonJS({
4799
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitItems.js"(exports$1) {
4720
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js"(exports$1) {
4800
4721
  Object.defineProperty(exports$1, "__esModule", { value: true });
4801
4722
  var codegen_1 = require_codegen();
4802
4723
  var error = {
@@ -4822,9 +4743,9 @@ var require_limitItems = __commonJS({
4822
4743
  }
4823
4744
  });
4824
4745
 
4825
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/equal.js
4746
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/equal.js
4826
4747
  var require_equal = __commonJS({
4827
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/equal.js"(exports$1) {
4748
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/equal.js"(exports$1) {
4828
4749
  Object.defineProperty(exports$1, "__esModule", { value: true });
4829
4750
  var equal = require_fast_deep_equal();
4830
4751
  equal.code = 'require("ajv/dist/runtime/equal").default';
@@ -4832,9 +4753,9 @@ var require_equal = __commonJS({
4832
4753
  }
4833
4754
  });
4834
4755
 
4835
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js
4756
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js
4836
4757
  var require_uniqueItems = __commonJS({
4837
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js"(exports$1) {
4758
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js"(exports$1) {
4838
4759
  Object.defineProperty(exports$1, "__esModule", { value: true });
4839
4760
  var dataType_1 = require_dataType();
4840
4761
  var codegen_1 = require_codegen();
@@ -4898,9 +4819,9 @@ var require_uniqueItems = __commonJS({
4898
4819
  }
4899
4820
  });
4900
4821
 
4901
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/const.js
4822
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/const.js
4902
4823
  var require_const = __commonJS({
4903
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/const.js"(exports$1) {
4824
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/const.js"(exports$1) {
4904
4825
  Object.defineProperty(exports$1, "__esModule", { value: true });
4905
4826
  var codegen_1 = require_codegen();
4906
4827
  var util_1 = require_util();
@@ -4926,9 +4847,9 @@ var require_const = __commonJS({
4926
4847
  }
4927
4848
  });
4928
4849
 
4929
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/enum.js
4850
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/enum.js
4930
4851
  var require_enum = __commonJS({
4931
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/enum.js"(exports$1) {
4852
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/enum.js"(exports$1) {
4932
4853
  Object.defineProperty(exports$1, "__esModule", { value: true });
4933
4854
  var codegen_1 = require_codegen();
4934
4855
  var util_1 = require_util();
@@ -4974,9 +4895,9 @@ var require_enum = __commonJS({
4974
4895
  }
4975
4896
  });
4976
4897
 
4977
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/index.js
4898
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/index.js
4978
4899
  var require_validation = __commonJS({
4979
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/index.js"(exports$1) {
4900
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/index.js"(exports$1) {
4980
4901
  Object.defineProperty(exports$1, "__esModule", { value: true });
4981
4902
  var limitNumber_1 = require_limitNumber();
4982
4903
  var multipleOf_1 = require_multipleOf();
@@ -5011,9 +4932,9 @@ var require_validation = __commonJS({
5011
4932
  }
5012
4933
  });
5013
4934
 
5014
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js
4935
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js
5015
4936
  var require_additionalItems = __commonJS({
5016
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js"(exports$1) {
4937
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js"(exports$1) {
5017
4938
  Object.defineProperty(exports$1, "__esModule", { value: true });
5018
4939
  exports$1.validateAdditionalItems = void 0;
5019
4940
  var codegen_1 = require_codegen();
@@ -5063,9 +4984,9 @@ var require_additionalItems = __commonJS({
5063
4984
  }
5064
4985
  });
5065
4986
 
5066
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/items.js
4987
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items.js
5067
4988
  var require_items = __commonJS({
5068
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/items.js"(exports$1) {
4989
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items.js"(exports$1) {
5069
4990
  Object.defineProperty(exports$1, "__esModule", { value: true });
5070
4991
  exports$1.validateTuple = void 0;
5071
4992
  var codegen_1 = require_codegen();
@@ -5119,9 +5040,9 @@ var require_items = __commonJS({
5119
5040
  }
5120
5041
  });
5121
5042
 
5122
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js
5043
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js
5123
5044
  var require_prefixItems = __commonJS({
5124
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js"(exports$1) {
5045
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js"(exports$1) {
5125
5046
  Object.defineProperty(exports$1, "__esModule", { value: true });
5126
5047
  var items_1 = require_items();
5127
5048
  var def = {
@@ -5135,9 +5056,9 @@ var require_prefixItems = __commonJS({
5135
5056
  }
5136
5057
  });
5137
5058
 
5138
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/items2020.js
5059
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js
5139
5060
  var require_items2020 = __commonJS({
5140
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/items2020.js"(exports$1) {
5061
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js"(exports$1) {
5141
5062
  Object.defineProperty(exports$1, "__esModule", { value: true });
5142
5063
  var codegen_1 = require_codegen();
5143
5064
  var util_1 = require_util();
@@ -5169,9 +5090,9 @@ var require_items2020 = __commonJS({
5169
5090
  }
5170
5091
  });
5171
5092
 
5172
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/contains.js
5093
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/contains.js
5173
5094
  var require_contains = __commonJS({
5174
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/contains.js"(exports$1) {
5095
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/contains.js"(exports$1) {
5175
5096
  Object.defineProperty(exports$1, "__esModule", { value: true });
5176
5097
  var codegen_1 = require_codegen();
5177
5098
  var util_1 = require_util();
@@ -5262,9 +5183,9 @@ var require_contains = __commonJS({
5262
5183
  }
5263
5184
  });
5264
5185
 
5265
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/dependencies.js
5186
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js
5266
5187
  var require_dependencies = __commonJS({
5267
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/dependencies.js"(exports$1) {
5188
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js"(exports$1) {
5268
5189
  Object.defineProperty(exports$1, "__esModule", { value: true });
5269
5190
  exports$1.validateSchemaDeps = exports$1.validatePropertyDeps = exports$1.error = void 0;
5270
5191
  var codegen_1 = require_codegen();
@@ -5355,9 +5276,9 @@ var require_dependencies = __commonJS({
5355
5276
  }
5356
5277
  });
5357
5278
 
5358
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js
5279
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js
5359
5280
  var require_propertyNames = __commonJS({
5360
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js"(exports$1) {
5281
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js"(exports$1) {
5361
5282
  Object.defineProperty(exports$1, "__esModule", { value: true });
5362
5283
  var codegen_1 = require_codegen();
5363
5284
  var util_1 = require_util();
@@ -5397,9 +5318,9 @@ var require_propertyNames = __commonJS({
5397
5318
  }
5398
5319
  });
5399
5320
 
5400
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js
5321
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js
5401
5322
  var require_additionalProperties = __commonJS({
5402
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js"(exports$1) {
5323
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js"(exports$1) {
5403
5324
  Object.defineProperty(exports$1, "__esModule", { value: true });
5404
5325
  var code_1 = require_code2();
5405
5326
  var codegen_1 = require_codegen();
@@ -5502,9 +5423,9 @@ var require_additionalProperties = __commonJS({
5502
5423
  }
5503
5424
  });
5504
5425
 
5505
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/properties.js
5426
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/properties.js
5506
5427
  var require_properties = __commonJS({
5507
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/properties.js"(exports$1) {
5428
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/properties.js"(exports$1) {
5508
5429
  Object.defineProperty(exports$1, "__esModule", { value: true });
5509
5430
  var validate_1 = require_validate();
5510
5431
  var code_1 = require_code2();
@@ -5559,9 +5480,9 @@ var require_properties = __commonJS({
5559
5480
  }
5560
5481
  });
5561
5482
 
5562
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js
5483
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js
5563
5484
  var require_patternProperties = __commonJS({
5564
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js"(exports$1) {
5485
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js"(exports$1) {
5565
5486
  Object.defineProperty(exports$1, "__esModule", { value: true });
5566
5487
  var code_1 = require_code2();
5567
5488
  var codegen_1 = require_codegen();
@@ -5632,9 +5553,9 @@ var require_patternProperties = __commonJS({
5632
5553
  }
5633
5554
  });
5634
5555
 
5635
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/not.js
5556
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/not.js
5636
5557
  var require_not = __commonJS({
5637
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/not.js"(exports$1) {
5558
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/not.js"(exports$1) {
5638
5559
  Object.defineProperty(exports$1, "__esModule", { value: true });
5639
5560
  var util_1 = require_util();
5640
5561
  var def = {
@@ -5662,9 +5583,9 @@ var require_not = __commonJS({
5662
5583
  }
5663
5584
  });
5664
5585
 
5665
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/anyOf.js
5586
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js
5666
5587
  var require_anyOf = __commonJS({
5667
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/anyOf.js"(exports$1) {
5588
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js"(exports$1) {
5668
5589
  Object.defineProperty(exports$1, "__esModule", { value: true });
5669
5590
  var code_1 = require_code2();
5670
5591
  var def = {
@@ -5678,9 +5599,9 @@ var require_anyOf = __commonJS({
5678
5599
  }
5679
5600
  });
5680
5601
 
5681
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/oneOf.js
5602
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js
5682
5603
  var require_oneOf = __commonJS({
5683
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/oneOf.js"(exports$1) {
5604
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js"(exports$1) {
5684
5605
  Object.defineProperty(exports$1, "__esModule", { value: true });
5685
5606
  var codegen_1 = require_codegen();
5686
5607
  var util_1 = require_util();
@@ -5735,9 +5656,9 @@ var require_oneOf = __commonJS({
5735
5656
  }
5736
5657
  });
5737
5658
 
5738
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/allOf.js
5659
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js
5739
5660
  var require_allOf = __commonJS({
5740
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/allOf.js"(exports$1) {
5661
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js"(exports$1) {
5741
5662
  Object.defineProperty(exports$1, "__esModule", { value: true });
5742
5663
  var util_1 = require_util();
5743
5664
  var def = {
@@ -5761,9 +5682,9 @@ var require_allOf = __commonJS({
5761
5682
  }
5762
5683
  });
5763
5684
 
5764
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/if.js
5685
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/if.js
5765
5686
  var require_if = __commonJS({
5766
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/if.js"(exports$1) {
5687
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/if.js"(exports$1) {
5767
5688
  Object.defineProperty(exports$1, "__esModule", { value: true });
5768
5689
  var codegen_1 = require_codegen();
5769
5690
  var util_1 = require_util();
@@ -5829,9 +5750,9 @@ var require_if = __commonJS({
5829
5750
  }
5830
5751
  });
5831
5752
 
5832
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/thenElse.js
5753
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js
5833
5754
  var require_thenElse = __commonJS({
5834
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/thenElse.js"(exports$1) {
5755
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js"(exports$1) {
5835
5756
  Object.defineProperty(exports$1, "__esModule", { value: true });
5836
5757
  var util_1 = require_util();
5837
5758
  var def = {
@@ -5846,9 +5767,9 @@ var require_thenElse = __commonJS({
5846
5767
  }
5847
5768
  });
5848
5769
 
5849
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/index.js
5770
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/index.js
5850
5771
  var require_applicator = __commonJS({
5851
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/index.js"(exports$1) {
5772
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/index.js"(exports$1) {
5852
5773
  Object.defineProperty(exports$1, "__esModule", { value: true });
5853
5774
  var additionalItems_1 = require_additionalItems();
5854
5775
  var prefixItems_1 = require_prefixItems();
@@ -5893,9 +5814,9 @@ var require_applicator = __commonJS({
5893
5814
  }
5894
5815
  });
5895
5816
 
5896
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/format/format.js
5817
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/format.js
5897
5818
  var require_format = __commonJS({
5898
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/format/format.js"(exports$1) {
5819
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/format.js"(exports$1) {
5899
5820
  Object.defineProperty(exports$1, "__esModule", { value: true });
5900
5821
  var codegen_1 = require_codegen();
5901
5822
  var error = {
@@ -5982,9 +5903,9 @@ var require_format = __commonJS({
5982
5903
  }
5983
5904
  });
5984
5905
 
5985
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/format/index.js
5906
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/index.js
5986
5907
  var require_format2 = __commonJS({
5987
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/format/index.js"(exports$1) {
5908
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/index.js"(exports$1) {
5988
5909
  Object.defineProperty(exports$1, "__esModule", { value: true });
5989
5910
  var format_1 = require_format();
5990
5911
  var format = [format_1.default];
@@ -5992,9 +5913,9 @@ var require_format2 = __commonJS({
5992
5913
  }
5993
5914
  });
5994
5915
 
5995
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/metadata.js
5916
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/metadata.js
5996
5917
  var require_metadata = __commonJS({
5997
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/metadata.js"(exports$1) {
5918
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/metadata.js"(exports$1) {
5998
5919
  Object.defineProperty(exports$1, "__esModule", { value: true });
5999
5920
  exports$1.contentVocabulary = exports$1.metadataVocabulary = void 0;
6000
5921
  exports$1.metadataVocabulary = [
@@ -6014,9 +5935,9 @@ var require_metadata = __commonJS({
6014
5935
  }
6015
5936
  });
6016
5937
 
6017
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/draft7.js
5938
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/draft7.js
6018
5939
  var require_draft7 = __commonJS({
6019
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/draft7.js"(exports$1) {
5940
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/draft7.js"(exports$1) {
6020
5941
  Object.defineProperty(exports$1, "__esModule", { value: true });
6021
5942
  var core_1 = require_core2();
6022
5943
  var validation_1 = require_validation();
@@ -6035,9 +5956,9 @@ var require_draft7 = __commonJS({
6035
5956
  }
6036
5957
  });
6037
5958
 
6038
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/discriminator/types.js
5959
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/types.js
6039
5960
  var require_types = __commonJS({
6040
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/discriminator/types.js"(exports$1) {
5961
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/types.js"(exports$1) {
6041
5962
  Object.defineProperty(exports$1, "__esModule", { value: true });
6042
5963
  exports$1.DiscrError = void 0;
6043
5964
  var DiscrError;
@@ -6048,9 +5969,9 @@ var require_types = __commonJS({
6048
5969
  }
6049
5970
  });
6050
5971
 
6051
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/discriminator/index.js
5972
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/index.js
6052
5973
  var require_discriminator = __commonJS({
6053
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/discriminator/index.js"(exports$1) {
5974
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/index.js"(exports$1) {
6054
5975
  Object.defineProperty(exports$1, "__esModule", { value: true });
6055
5976
  var codegen_1 = require_codegen();
6056
5977
  var types_1 = require_types();
@@ -6152,9 +6073,9 @@ var require_discriminator = __commonJS({
6152
6073
  }
6153
6074
  });
6154
6075
 
6155
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/refs/json-schema-draft-07.json
6076
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-draft-07.json
6156
6077
  var require_json_schema_draft_07 = __commonJS({
6157
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/refs/json-schema-draft-07.json"(exports$1, module) {
6078
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-draft-07.json"(exports$1, module) {
6158
6079
  module.exports = {
6159
6080
  $schema: "http://json-schema.org/draft-07/schema#",
6160
6081
  $id: "http://json-schema.org/draft-07/schema#",
@@ -6309,9 +6230,9 @@ var require_json_schema_draft_07 = __commonJS({
6309
6230
  }
6310
6231
  });
6311
6232
 
6312
- // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/ajv.js
6233
+ // ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/ajv.js
6313
6234
  var require_ajv = __commonJS({
6314
- "../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/ajv.js"(exports$1, module) {
6235
+ "../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/ajv.js"(exports$1, module) {
6315
6236
  Object.defineProperty(exports$1, "__esModule", { value: true });
6316
6237
  exports$1.MissingRefError = exports$1.ValidationError = exports$1.CodeGen = exports$1.Name = exports$1.nil = exports$1.stringify = exports$1.str = exports$1._ = exports$1.KeywordCxt = exports$1.Ajv = void 0;
6317
6238
  var core_1 = require_core();
@@ -6378,111 +6299,10 @@ var require_ajv = __commonJS({
6378
6299
  }
6379
6300
  });
6380
6301
 
6381
- // src/standard-schema/adapters/ai-sdk.ts
6382
- var VENDOR = "ai-sdk";
6383
- var AiSdkSchemaWrapper = class {
6384
- #schema;
6385
- "~standard";
6386
- constructor(schema) {
6387
- this.#schema = schema;
6388
- this["~standard"] = {
6389
- version: 1,
6390
- vendor: VENDOR,
6391
- validate: this.#validate.bind(this),
6392
- jsonSchema: {
6393
- input: this.#toJsonSchema.bind(this),
6394
- output: this.#toJsonSchema.bind(this)
6395
- }
6396
- };
6397
- }
6398
- /**
6399
- * Validates a value against the AI SDK Schema.
6400
- *
6401
- * @param value - The value to validate
6402
- * @returns A result object with either the validated value or validation issues
6403
- */
6404
- #validate(value) {
6405
- if (!this.#schema.validate) {
6406
- return { value };
6407
- }
6408
- try {
6409
- const result = this.#schema.validate(value);
6410
- if (result && typeof result === "object" && "then" in result && typeof result.then === "function") {
6411
- return Promise.resolve(
6412
- result
6413
- ).then((res) => this.#convertValidationResult(res)).catch((error) => {
6414
- const message = error instanceof Error ? error.message : "Unknown validation error";
6415
- return {
6416
- issues: [{ message: `Schema validation error: ${message}` }]
6417
- };
6418
- });
6419
- }
6420
- return this.#convertValidationResult(
6421
- result
6422
- );
6423
- } catch (error) {
6424
- const message = error instanceof Error ? error.message : "Unknown validation error";
6425
- return {
6426
- issues: [{ message: `Schema validation error: ${message}` }]
6427
- };
6428
- }
6429
- }
6430
- /**
6431
- * Converts an AI SDK ValidationResult to a StandardSchemaV1.Result.
6432
- *
6433
- * @param result - The AI SDK validation result
6434
- * @returns A StandardSchemaV1.Result
6435
- */
6436
- #convertValidationResult(result) {
6437
- if (result.success) {
6438
- return { value: result.value };
6439
- }
6440
- const failureResult = result;
6441
- return {
6442
- issues: [{ message: failureResult.error.message }]
6443
- };
6444
- }
6445
- /**
6446
- * Returns the JSON Schema in the requested target format.
6447
- *
6448
- * @param options - Options including the target format
6449
- * @returns The JSON Schema as a Record
6450
- */
6451
- #toJsonSchema(options) {
6452
- const { target } = options;
6453
- const clonedSchema = JSON.parse(JSON.stringify(this.#schema.jsonSchema));
6454
- if (!clonedSchema.$schema) {
6455
- switch (target) {
6456
- case "draft-07":
6457
- clonedSchema.$schema = "http://json-schema.org/draft-07/schema#";
6458
- break;
6459
- case "draft-2020-12":
6460
- clonedSchema.$schema = "https://json-schema.org/draft/2020-12/schema";
6461
- break;
6462
- }
6463
- }
6464
- return clonedSchema;
6465
- }
6466
- /**
6467
- * Returns the original AI SDK Schema.
6468
- */
6469
- getSchema() {
6470
- return this.#schema;
6471
- }
6472
- /**
6473
- * Returns the original JSON Schema from the AI SDK Schema.
6474
- */
6475
- getJsonSchema() {
6476
- return this.#schema.jsonSchema;
6477
- }
6478
- };
6479
- function toStandardSchema(schema) {
6480
- return new AiSdkSchemaWrapper(schema);
6481
- }
6482
-
6483
6302
  // src/standard-schema/adapters/json-schema.ts
6484
6303
  var import_ajv = __toESM(require_ajv(), 1);
6485
- var VENDOR2 = "json-schema";
6304
+ var import_json_schema_traverse = __toESM(require_json_schema_traverse(), 1);
6305
+ var VENDOR = "json-schema";
6486
6306
  var JsonSchemaWrapper = class {
6487
6307
  #schema;
6488
6308
  #options;
@@ -6494,7 +6314,7 @@ var JsonSchemaWrapper = class {
6494
6314
  this.#options = options;
6495
6315
  this["~standard"] = {
6496
6316
  version: 1,
6497
- vendor: VENDOR2,
6317
+ vendor: VENDOR,
6498
6318
  validate: this.#validate.bind(this),
6499
6319
  jsonSchema: {
6500
6320
  input: this.#toJsonSchema.bind(this),
@@ -6578,6 +6398,18 @@ var JsonSchemaWrapper = class {
6578
6398
  break;
6579
6399
  }
6580
6400
  }
6401
+ if (options?.libraryOptions?.override) {
6402
+ const override = options.libraryOptions.override;
6403
+ (0, import_json_schema_traverse.default)(clonedSchema, {
6404
+ cb: {
6405
+ post: (schema) => {
6406
+ override({
6407
+ jsonSchema: schema
6408
+ });
6409
+ }
6410
+ }
6411
+ });
6412
+ }
6581
6413
  return clonedSchema;
6582
6414
  }
6583
6415
  /**
@@ -6612,163 +6444,10 @@ var JsonSchemaWrapper = class {
6612
6444
  return this.#ajvInstance;
6613
6445
  }
6614
6446
  };
6615
- function toStandardSchema2(schema, options) {
6447
+ function toStandardSchema(schema, options) {
6616
6448
  return new JsonSchemaWrapper(schema, options);
6617
6449
  }
6618
6450
 
6619
- // src/standard-schema/adapters/zod-v3.ts
6620
- var import_json_schema_traverse = __toESM(require_json_schema_traverse(), 1);
6621
- var TARGET_MAP = {
6622
- "draft-07": "jsonSchema7",
6623
- "openapi-3.0": "openApi3"
6624
- };
6625
- function convertToJsonSchema(zodSchema, options) {
6626
- const target = TARGET_MAP[options.target];
6627
- if (!target) {
6628
- const supportedTargets = Object.keys(TARGET_MAP);
6629
- throw new Error(
6630
- `Unsupported JSON Schema target: "${options.target}". Supported targets are: ${supportedTargets.join(", ")}`
6631
- );
6632
- }
6633
- const jsonSchema = zodToJsonSchemaOriginal(zodSchema, {
6634
- $refStrategy: "none",
6635
- target
6636
- });
6637
- (0, import_json_schema_traverse.default)(jsonSchema, {
6638
- cb: {
6639
- pre: (schema) => {
6640
- if (schema.type === "string" && schema.format === "email") {
6641
- schema.pattern = `^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$`;
6642
- }
6643
- }
6644
- // post: (schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema) => {
6645
- // this.postProcessJSONNode(schema, parentSchema);
6646
- // },
6647
- }
6648
- });
6649
- return jsonSchema;
6650
- }
6651
- function toStandardSchema3(zodSchema) {
6652
- const wrapper = Object.create(zodSchema);
6653
- const existingStandard = zodSchema["~standard"];
6654
- const jsonSchemaConverter = {
6655
- input: (options) => {
6656
- return convertToJsonSchema(zodSchema, options);
6657
- },
6658
- output: (options) => {
6659
- return convertToJsonSchema(zodSchema, options);
6660
- }
6661
- };
6662
- Object.defineProperty(wrapper, "~standard", {
6663
- value: {
6664
- ...existingStandard,
6665
- jsonSchema: jsonSchemaConverter
6666
- },
6667
- writable: false,
6668
- enumerable: true,
6669
- configurable: false
6670
- });
6671
- return wrapper;
6672
- }
6673
-
6674
- // src/standard-schema/standard-schema.ts
6675
- function jsonSchemaOverride(ctx) {
6676
- const zodSchema = ctx.zodSchema;
6677
- if (zodSchema) {
6678
- if (zodSchema?.type === "date") {
6679
- ctx.jsonSchema.type = "string";
6680
- ctx.jsonSchema.format = "date-time";
6681
- }
6682
- }
6683
- return void 0;
6684
- }
6685
- var JSON_SCHEMA_LIBRARY_OPTIONS = {
6686
- unrepresentable: "any",
6687
- override: jsonSchemaOverride
6688
- };
6689
- function isVercelSchema(schema) {
6690
- return typeof schema === "object" && schema !== null && "_type" in schema && "jsonSchema" in schema && typeof schema.jsonSchema === "object";
6691
- }
6692
- function isZodV4(schema) {
6693
- return typeof schema === "object" && schema !== null && "_zod" in schema;
6694
- }
6695
- function isZodV3(schema) {
6696
- if (schema === null || typeof schema !== "object") {
6697
- return false;
6698
- }
6699
- if (isZodV4(schema)) {
6700
- return false;
6701
- }
6702
- if ("~standard" in schema) {
6703
- const std = schema["~standard"];
6704
- if (typeof std === "object" && std !== null && std.vendor === "zod" && !("jsonSchema" in std)) {
6705
- return true;
6706
- }
6707
- }
6708
- return schema instanceof z3.ZodType;
6709
- }
6710
- function toStandardSchema4(schema) {
6711
- if (isStandardSchemaWithJSON(schema)) {
6712
- return schema;
6713
- }
6714
- if (isZodV3(schema)) {
6715
- return toStandardSchema3(schema);
6716
- }
6717
- if (isVercelSchema(schema)) {
6718
- return toStandardSchema(schema);
6719
- }
6720
- if (schema === null || typeof schema !== "object" && typeof schema !== "function") {
6721
- throw new Error(`Unsupported schema type: ${typeof schema}`);
6722
- }
6723
- if (typeof schema === "function") {
6724
- throw new Error(`Unsupported schema type: function (schema libraries should implement StandardSchemaWithJSON)`);
6725
- }
6726
- return toStandardSchema2(schema);
6727
- }
6728
- function isStandardSchema(value) {
6729
- if (value === null || typeof value !== "object" && typeof value !== "function") {
6730
- return false;
6731
- }
6732
- if (!("~standard" in value)) {
6733
- return false;
6734
- }
6735
- const std = value["~standard"];
6736
- return typeof std === "object" && std !== null && "version" in std && std.version === 1 && "vendor" in std && "validate" in std && typeof std.validate === "function";
6737
- }
6738
- function isStandardJSONSchema(value) {
6739
- if (value === null || typeof value !== "object" && typeof value !== "function") {
6740
- return false;
6741
- }
6742
- if (!("~standard" in value)) {
6743
- return false;
6744
- }
6745
- const std = value["~standard"];
6746
- if (typeof std !== "object" || std === null) {
6747
- return false;
6748
- }
6749
- if (!("version" in std) || std.version !== 1 || !("vendor" in std)) {
6750
- return false;
6751
- }
6752
- if (!("jsonSchema" in std) || typeof std.jsonSchema !== "object") {
6753
- return false;
6754
- }
6755
- return typeof std.jsonSchema.input === "function" && typeof std.jsonSchema.output === "function";
6756
- }
6757
- function isStandardSchemaWithJSON(value) {
6758
- return isStandardSchema(value) && isStandardJSONSchema(value);
6759
- }
6760
- function standardSchemaToJSONSchema(schema, options = {}) {
6761
- const { target = "draft-07", io = "output", override = JSON_SCHEMA_LIBRARY_OPTIONS.override } = options;
6762
- const jsonSchemaFn = schema["~standard"].jsonSchema[io];
6763
- return jsonSchemaFn({
6764
- target,
6765
- libraryOptions: {
6766
- ...JSON_SCHEMA_LIBRARY_OPTIONS,
6767
- override
6768
- }
6769
- });
6770
- }
6771
-
6772
- export { isStandardSchemaWithJSON, require_json_schema_traverse, standardSchemaToJSONSchema, toStandardSchema4 as toStandardSchema };
6773
- //# sourceMappingURL=chunk-DGOXVQNP.js.map
6774
- //# sourceMappingURL=chunk-DGOXVQNP.js.map
6451
+ export { JsonSchemaWrapper, toStandardSchema };
6452
+ //# sourceMappingURL=chunk-QDRBTCDV.js.map
6453
+ //# sourceMappingURL=chunk-QDRBTCDV.js.map