@pixerate/editor 0.44.0 → 0.45.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 (82) hide show
  1. package/README.md +27 -2
  2. package/dist/agent/index.cjs +548 -45
  3. package/dist/agent/index.cjs.map +1 -1
  4. package/dist/agent/index.d.cts +47 -17
  5. package/dist/agent/index.d.ts +47 -17
  6. package/dist/agent/index.js +536 -33
  7. package/dist/agent/index.js.map +1 -1
  8. package/dist/{builtins-BLud97fC.d.cts → builtins-CZW-aYKS.d.cts} +1 -1
  9. package/dist/{builtins-D0BDyAgw.d.ts → builtins-DghNQbT-.d.ts} +1 -1
  10. package/dist/{chunk-I6BZB5ZH.cjs → chunk-EFDCLENW.cjs} +73 -6
  11. package/dist/chunk-EFDCLENW.cjs.map +1 -0
  12. package/dist/chunk-HHQ4XJWT.js +826 -0
  13. package/dist/chunk-HHQ4XJWT.js.map +1 -0
  14. package/dist/chunk-J3R2OWOE.cjs +1465 -0
  15. package/dist/chunk-J3R2OWOE.cjs.map +1 -0
  16. package/dist/chunk-K2LVZ4FA.cjs +826 -0
  17. package/dist/chunk-K2LVZ4FA.cjs.map +1 -0
  18. package/dist/{chunk-6MDQKHRH.cjs → chunk-N4MLNJPO.cjs} +21 -899
  19. package/dist/chunk-N4MLNJPO.cjs.map +1 -0
  20. package/dist/chunk-PQM5W7ZN.js +168 -0
  21. package/dist/chunk-PQM5W7ZN.js.map +1 -0
  22. package/dist/{chunk-DDADOHJW.js → chunk-Q25ZS4F7.js} +5 -883
  23. package/dist/chunk-Q25ZS4F7.js.map +1 -0
  24. package/dist/chunk-TK2XZK6Z.js +1465 -0
  25. package/dist/chunk-TK2XZK6Z.js.map +1 -0
  26. package/dist/commands/index.cjs +3 -2
  27. package/dist/commands/index.cjs.map +1 -1
  28. package/dist/commands/index.d.cts +5 -5
  29. package/dist/commands/index.d.ts +5 -5
  30. package/dist/commands/index.js +2 -1
  31. package/dist/commands/index.js.map +1 -1
  32. package/dist/extensions/index.cjs +4 -4
  33. package/dist/extensions/index.cjs.map +1 -1
  34. package/dist/extensions/index.d.cts +3 -3
  35. package/dist/extensions/index.d.ts +3 -3
  36. package/dist/extensions/index.js +12 -12
  37. package/dist/generation/index.cjs +2 -2
  38. package/dist/generation/index.d.cts +4 -4
  39. package/dist/generation/index.d.ts +4 -4
  40. package/dist/generation/index.js +1 -1
  41. package/dist/image-editor/index.cjs +24 -24
  42. package/dist/image-editor/index.cjs.map +1 -1
  43. package/dist/image-editor/index.d.cts +2 -2
  44. package/dist/image-editor/index.d.ts +2 -2
  45. package/dist/image-editor/index.js +24 -24
  46. package/dist/image-editor/index.js.map +1 -1
  47. package/dist/{index-C6gaQRH0.d.cts → index-CfOQf70b.d.cts} +1 -1
  48. package/dist/{index-DXAv_R08.d.ts → index-jwJ_onWf.d.ts} +1 -1
  49. package/dist/index.cjs +9 -9
  50. package/dist/index.cjs.map +1 -1
  51. package/dist/index.d.cts +4 -4
  52. package/dist/index.d.ts +4 -4
  53. package/dist/index.js +12 -12
  54. package/dist/parameters/index.d.cts +2 -2
  55. package/dist/parameters/index.d.ts +2 -2
  56. package/dist/{registry-DnzpgY27.d.cts → registry-B4l-lYts.d.cts} +1 -1
  57. package/dist/{registry-DhVUZioj.d.ts → registry-BfVD-vVg.d.ts} +1 -1
  58. package/dist/{registry-BDe-vlv3.d.ts → registry-CSlH4iUn.d.ts} +1 -1
  59. package/dist/{registry-D0GADKc7.d.cts → registry-vz6HOiiy.d.cts} +1 -1
  60. package/dist/{schema-DYDGdYL9.d.cts → schema-Di0CS6Pe.d.cts} +26 -2
  61. package/dist/{schema-DYDGdYL9.d.ts → schema-Di0CS6Pe.d.ts} +26 -2
  62. package/dist/tools/index.cjs +37 -3
  63. package/dist/tools/index.cjs.map +1 -1
  64. package/dist/tools/index.d.cts +871 -11
  65. package/dist/tools/index.d.ts +871 -11
  66. package/dist/tools/index.js +36 -2
  67. package/dist/vector/index.d.cts +2 -2
  68. package/dist/vector/index.d.ts +2 -2
  69. package/package.json +1 -1
  70. package/dist/chunk-36BLROHV.js +0 -438
  71. package/dist/chunk-36BLROHV.js.map +0 -1
  72. package/dist/chunk-5H2OPMXZ.js +0 -586
  73. package/dist/chunk-5H2OPMXZ.js.map +0 -1
  74. package/dist/chunk-6MDQKHRH.cjs.map +0 -1
  75. package/dist/chunk-D6S5M7HV.js +0 -101
  76. package/dist/chunk-D6S5M7HV.js.map +0 -1
  77. package/dist/chunk-DDADOHJW.js.map +0 -1
  78. package/dist/chunk-I6BZB5ZH.cjs.map +0 -1
  79. package/dist/chunk-MC2LQN5S.cjs +0 -586
  80. package/dist/chunk-MC2LQN5S.cjs.map +0 -1
  81. package/dist/chunk-V7CC7RZ6.cjs +0 -438
  82. package/dist/chunk-V7CC7RZ6.cjs.map +0 -1
@@ -0,0 +1,168 @@
1
+ // src/tools/schema.ts
2
+ function typeOf(value) {
3
+ if (value === null) return "null";
4
+ if (Array.isArray(value)) return "array";
5
+ if (typeof value === "number") return Number.isInteger(value) ? "integer" : "number";
6
+ if (typeof value === "string" || typeof value === "boolean" || typeof value === "object") {
7
+ return typeof value;
8
+ }
9
+ return "undefined";
10
+ }
11
+ function matchesType(value, type) {
12
+ const actual = typeOf(value);
13
+ if (type === "number") return actual === "number" || actual === "integer";
14
+ return actual === type;
15
+ }
16
+ var isEqual = (a, b) => a === b || JSON.stringify(a) === JSON.stringify(b);
17
+ function resolveRef(ref, root) {
18
+ if (ref === "#") return root;
19
+ if (!ref.startsWith("#/")) return void 0;
20
+ let node = root;
21
+ for (const raw of ref.slice(2).split("/")) {
22
+ const key = decodeURIComponent(raw).replace(/~1/g, "/").replace(/~0/g, "~");
23
+ if (!node || typeof node !== "object") return void 0;
24
+ node = node[key];
25
+ }
26
+ return node && typeof node === "object" ? node : void 0;
27
+ }
28
+ var MAX_REF_DEPTH = 32;
29
+ function validateJsonSchema(value, schema, path = "", root = schema, refDepth = 0) {
30
+ if (!schema || typeof schema !== "object") return [];
31
+ const errors = [];
32
+ const at = path || "/";
33
+ const recurse = (child, childSchema, childPath) => validateJsonSchema(child, childSchema, childPath, root, refDepth);
34
+ if (typeof schema.$ref === "string") {
35
+ const target = root ? resolveRef(schema.$ref, root) : void 0;
36
+ if (!target) {
37
+ errors.push({ path: at, message: `Unresolvable schema reference ${schema.$ref}.` });
38
+ } else if (refDepth >= MAX_REF_DEPTH) {
39
+ errors.push({ path: at, message: `Schema reference ${schema.$ref} is nested too deeply.` });
40
+ } else {
41
+ errors.push(...validateJsonSchema(value, target, path, root, refDepth + 1));
42
+ }
43
+ }
44
+ if (schema.allOf) {
45
+ for (const branch of schema.allOf) errors.push(...recurse(value, branch, path));
46
+ }
47
+ if (schema.anyOf || schema.oneOf) {
48
+ const branches = schema.anyOf ?? schema.oneOf;
49
+ const results = branches.map((branch) => recurse(value, branch, path));
50
+ const matching = results.filter((r) => r.length === 0).length;
51
+ if (matching === 0 && results.length > 0) {
52
+ const closest = results.reduce((best, r) => r.length < best.length ? r : best);
53
+ errors.push(
54
+ { path: at, message: `Does not match any allowed shape (${branches.length} options); closest match failed with:` },
55
+ ...closest
56
+ );
57
+ } else if (schema.oneOf && !schema.anyOf && matching > 1) {
58
+ errors.push({ path: at, message: `Matches ${matching} shapes; exactly one is allowed.` });
59
+ }
60
+ }
61
+ if (schema.not && recurse(value, schema.not, path).length === 0) {
62
+ errors.push({ path: at, message: "Matches a disallowed shape." });
63
+ }
64
+ if (schema.type !== void 0) {
65
+ const types = Array.isArray(schema.type) ? schema.type : [schema.type];
66
+ if (!types.some((t) => matchesType(value, t))) {
67
+ errors.push({ path: at, message: `Expected ${types.join(" | ")}, got ${typeOf(value)}.` });
68
+ return errors;
69
+ }
70
+ }
71
+ if (schema.const !== void 0 && !isEqual(value, schema.const)) {
72
+ errors.push({ path: at, message: `Expected ${JSON.stringify(schema.const)}.` });
73
+ }
74
+ if (schema.enum && !schema.enum.some((option) => isEqual(value, option))) {
75
+ errors.push({
76
+ path: at,
77
+ message: `Expected one of ${schema.enum.map((o) => JSON.stringify(o)).join(", ")}, got ${JSON.stringify(value)}.`
78
+ });
79
+ }
80
+ if (typeof value === "string") {
81
+ if (schema.minLength !== void 0 && value.length < schema.minLength) {
82
+ errors.push({ path: at, message: `Must be at least ${schema.minLength} characters.` });
83
+ }
84
+ if (schema.maxLength !== void 0 && value.length > schema.maxLength) {
85
+ errors.push({ path: at, message: `Must be at most ${schema.maxLength} characters.` });
86
+ }
87
+ if (schema.pattern !== void 0) {
88
+ let regex = null;
89
+ try {
90
+ regex = new RegExp(schema.pattern, "u");
91
+ } catch {
92
+ }
93
+ if (regex && !regex.test(value)) {
94
+ errors.push({ path: at, message: `Must match pattern ${schema.pattern}.` });
95
+ }
96
+ }
97
+ }
98
+ if (typeof value === "number") {
99
+ if (schema.minimum !== void 0 && value < schema.minimum) {
100
+ errors.push({ path: at, message: `Must be >= ${schema.minimum}.` });
101
+ }
102
+ if (schema.maximum !== void 0 && value > schema.maximum) {
103
+ errors.push({ path: at, message: `Must be <= ${schema.maximum}.` });
104
+ }
105
+ if (typeof schema.exclusiveMinimum === "number" && value <= schema.exclusiveMinimum) {
106
+ errors.push({ path: at, message: `Must be > ${schema.exclusiveMinimum}.` });
107
+ }
108
+ if (typeof schema.exclusiveMaximum === "number" && value >= schema.exclusiveMaximum) {
109
+ errors.push({ path: at, message: `Must be < ${schema.exclusiveMaximum}.` });
110
+ }
111
+ if (schema.multipleOf !== void 0 && schema.multipleOf > 0) {
112
+ const quotient = value / schema.multipleOf;
113
+ if (Math.abs(quotient - Math.round(quotient)) > 1e-9) {
114
+ errors.push({ path: at, message: `Must be a multiple of ${schema.multipleOf}.` });
115
+ }
116
+ }
117
+ }
118
+ if (Array.isArray(value)) {
119
+ if (schema.minItems !== void 0 && value.length < schema.minItems) {
120
+ errors.push({ path: at, message: `Must have at least ${schema.minItems} items.` });
121
+ }
122
+ if (schema.maxItems !== void 0 && value.length > schema.maxItems) {
123
+ errors.push({ path: at, message: `Must have at most ${schema.maxItems} items.` });
124
+ }
125
+ if (schema.uniqueItems) {
126
+ const seen = /* @__PURE__ */ new Set();
127
+ value.forEach((item, index) => {
128
+ const key = JSON.stringify(item);
129
+ if (seen.has(key)) errors.push({ path: `${path}/${index}`, message: "Duplicate item; items must be unique." });
130
+ seen.add(key);
131
+ });
132
+ }
133
+ if (schema.items) {
134
+ value.forEach((item, index) => {
135
+ errors.push(...recurse(item, schema.items, `${path}/${index}`));
136
+ });
137
+ }
138
+ }
139
+ if (typeOf(value) === "object") {
140
+ const obj = value;
141
+ for (const key of schema.required ?? []) {
142
+ if (obj[key] === void 0) {
143
+ errors.push({ path: `${path}/${key}`, message: `Missing required property "${key}".` });
144
+ }
145
+ }
146
+ const properties = schema.properties ?? {};
147
+ for (const [key, child] of Object.entries(obj)) {
148
+ if (child === void 0) continue;
149
+ if (key in properties) {
150
+ errors.push(...recurse(child, properties[key], `${path}/${key}`));
151
+ } else if (schema.additionalProperties === false) {
152
+ const known = Object.keys(properties);
153
+ errors.push({
154
+ path: `${path}/${key}`,
155
+ message: `Unknown property "${key}".${known.length ? ` Allowed: ${known.join(", ")}.` : ""}`
156
+ });
157
+ } else if (typeof schema.additionalProperties === "object") {
158
+ errors.push(...recurse(child, schema.additionalProperties, `${path}/${key}`));
159
+ }
160
+ }
161
+ }
162
+ return errors;
163
+ }
164
+
165
+ export {
166
+ validateJsonSchema
167
+ };
168
+ //# sourceMappingURL=chunk-PQM5W7ZN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/tools/schema.ts"],"sourcesContent":["/**\n * JSON-Schema-lite: the subset of JSON Schema used by MCP tool `inputSchema`s,\n * plus a small validator for tool-call arguments. Unknown keywords are ignored.\n */\nexport type JsonSchemaType = 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array' | 'null';\n\nexport interface JsonSchema {\n\ttype?: JsonSchemaType | readonly JsonSchemaType[];\n\tdescription?: string;\n\ttitle?: string;\n\tenum?: readonly unknown[];\n\tconst?: unknown;\n\tdefault?: unknown;\n\tproperties?: { readonly [key: string]: JsonSchema };\n\trequired?: readonly string[];\n\tadditionalProperties?: boolean | JsonSchema;\n\titems?: JsonSchema;\n\tminItems?: number;\n\tmaxItems?: number;\n\tminimum?: number;\n\tmaximum?: number;\n\texclusiveMinimum?: number;\n\texclusiveMaximum?: number;\n\tmultipleOf?: number;\n\tuniqueItems?: boolean;\n\tanyOf?: readonly JsonSchema[];\n\toneOf?: readonly JsonSchema[];\n\tallOf?: readonly JsonSchema[];\n\tnot?: JsonSchema;\n\t/** Local reference only: `#`, `#/$defs/<name>` or `#/definitions/<name>`. */\n\t$ref?: string;\n\t$defs?: { readonly [key: string]: JsonSchema };\n\tdefinitions?: { readonly [key: string]: JsonSchema };\n\tminLength?: number;\n\tmaxLength?: number;\n\tpattern?: string;\n\t[keyword: string]: unknown;\n}\n\nexport interface SchemaValidationError {\n\t/** JSON-pointer-like path to the offending value, e.g. `/node/id` (`\"\"` is the root). */\n\tpath: string;\n\tmessage: string;\n}\n\nfunction typeOf(value: unknown): JsonSchemaType | 'undefined' {\n\tif (value === null) return 'null';\n\tif (Array.isArray(value)) return 'array';\n\tif (typeof value === 'number') return Number.isInteger(value) ? 'integer' : 'number';\n\tif (typeof value === 'string' || typeof value === 'boolean' || typeof value === 'object') {\n\t\treturn typeof value as JsonSchemaType;\n\t}\n\treturn 'undefined';\n}\n\nfunction matchesType(value: unknown, type: JsonSchemaType): boolean {\n\tconst actual = typeOf(value);\n\tif (type === 'number') return actual === 'number' || actual === 'integer';\n\treturn actual === type;\n}\n\nconst isEqual = (a: unknown, b: unknown) => a === b || JSON.stringify(a) === JSON.stringify(b);\n\n/** Resolves a local `$ref` (`#`, `#/$defs/a`, `#/definitions/a/properties/b`, ...) against `root`. */\nfunction resolveRef(ref: string, root: JsonSchema): JsonSchema | undefined {\n\tif (ref === '#') return root;\n\tif (!ref.startsWith('#/')) return undefined;\n\tlet node: unknown = root;\n\tfor (const raw of ref.slice(2).split('/')) {\n\t\tconst key = decodeURIComponent(raw).replace(/~1/g, '/').replace(/~0/g, '~');\n\t\tif (!node || typeof node !== 'object') return undefined;\n\t\tnode = (node as Record<string, unknown>)[key];\n\t}\n\treturn node && typeof node === 'object' ? (node as JsonSchema) : undefined;\n}\n\n/** Most `$ref` hops followed before a reference cycle is reported. */\nconst MAX_REF_DEPTH = 32;\n\n/**\n * Validates `value` against `schema` and returns every error found (an empty\n * array means valid). Supports `type` (incl. arrays of types), `enum`, `const`,\n * `properties`, `required`, `additionalProperties`, `items`, `minItems`,\n * `maxItems`, `uniqueItems`, `minimum`, `maximum`, `exclusiveMinimum`,\n * `exclusiveMaximum`, `multipleOf`, `minLength`, `maxLength`, `pattern`,\n * `anyOf`, `oneOf`, `allOf`, `not` and local `$ref`s (`#/$defs/...`).\n * Other keywords (`format`, `if`/`then`, `patternProperties`, remote refs...)\n * are ignored.\n *\n * When no `anyOf` / `oneOf` branch matches, the errors of the closest branch\n * (the one with the fewest errors) are reported, so a caller sees what to fix\n * rather than only \"no branch matched\".\n */\nexport function validateJsonSchema(\n\tvalue: unknown,\n\tschema: JsonSchema | undefined,\n\tpath = '',\n\troot: JsonSchema | undefined = schema,\n\trefDepth = 0\n): SchemaValidationError[] {\n\tif (!schema || typeof schema !== 'object') return [];\n\tconst errors: SchemaValidationError[] = [];\n\tconst at = path || '/';\n\tconst recurse = (child: unknown, childSchema: JsonSchema | undefined, childPath: string) =>\n\t\tvalidateJsonSchema(child, childSchema, childPath, root, refDepth);\n\n\tif (typeof schema.$ref === 'string') {\n\t\tconst target = root ? resolveRef(schema.$ref, root) : undefined;\n\t\tif (!target) {\n\t\t\terrors.push({ path: at, message: `Unresolvable schema reference ${schema.$ref}.` });\n\t\t} else if (refDepth >= MAX_REF_DEPTH) {\n\t\t\terrors.push({ path: at, message: `Schema reference ${schema.$ref} is nested too deeply.` });\n\t\t} else {\n\t\t\terrors.push(...validateJsonSchema(value, target, path, root, refDepth + 1));\n\t\t}\n\t\t// Sibling keywords still apply (2019-09+ semantics).\n\t}\n\n\tif (schema.allOf) {\n\t\tfor (const branch of schema.allOf) errors.push(...recurse(value, branch, path));\n\t}\n\tif (schema.anyOf || schema.oneOf) {\n\t\tconst branches = (schema.anyOf ?? schema.oneOf)!;\n\t\tconst results = branches.map((branch) => recurse(value, branch, path));\n\t\tconst matching = results.filter((r) => r.length === 0).length;\n\t\tif (matching === 0 && results.length > 0) {\n\t\t\tconst closest = results.reduce((best, r) => (r.length < best.length ? r : best));\n\t\t\terrors.push(\n\t\t\t\t{ path: at, message: `Does not match any allowed shape (${branches.length} options); closest match failed with:` },\n\t\t\t\t...closest\n\t\t\t);\n\t\t} else if (schema.oneOf && !schema.anyOf && matching > 1) {\n\t\t\terrors.push({ path: at, message: `Matches ${matching} shapes; exactly one is allowed.` });\n\t\t}\n\t}\n\tif (schema.not && recurse(value, schema.not, path).length === 0) {\n\t\terrors.push({ path: at, message: 'Matches a disallowed shape.' });\n\t}\n\n\tif (schema.type !== undefined) {\n\t\tconst types = (Array.isArray(schema.type) ? schema.type : [schema.type]) as JsonSchemaType[];\n\t\tif (!types.some((t) => matchesType(value, t))) {\n\t\t\terrors.push({ path: at, message: `Expected ${types.join(' | ')}, got ${typeOf(value)}.` });\n\t\t\treturn errors;\n\t\t}\n\t}\n\tif (schema.const !== undefined && !isEqual(value, schema.const)) {\n\t\terrors.push({ path: at, message: `Expected ${JSON.stringify(schema.const)}.` });\n\t}\n\tif (schema.enum && !schema.enum.some((option) => isEqual(value, option))) {\n\t\terrors.push({\n\t\t\tpath: at,\n\t\t\tmessage: `Expected one of ${schema.enum.map((o) => JSON.stringify(o)).join(', ')}, got ${JSON.stringify(value)}.`\n\t\t});\n\t}\n\n\tif (typeof value === 'string') {\n\t\tif (schema.minLength !== undefined && value.length < schema.minLength) {\n\t\t\terrors.push({ path: at, message: `Must be at least ${schema.minLength} characters.` });\n\t\t}\n\t\tif (schema.maxLength !== undefined && value.length > schema.maxLength) {\n\t\t\terrors.push({ path: at, message: `Must be at most ${schema.maxLength} characters.` });\n\t\t}\n\t\tif (schema.pattern !== undefined) {\n\t\t\tlet regex: RegExp | null = null;\n\t\t\ttry {\n\t\t\t\tregex = new RegExp(schema.pattern, 'u');\n\t\t\t} catch {\n\t\t\t\t// An invalid pattern in the schema is not the caller's fault.\n\t\t\t}\n\t\t\tif (regex && !regex.test(value)) {\n\t\t\t\terrors.push({ path: at, message: `Must match pattern ${schema.pattern}.` });\n\t\t\t}\n\t\t}\n\t}\n\n\tif (typeof value === 'number') {\n\t\tif (schema.minimum !== undefined && value < schema.minimum) {\n\t\t\terrors.push({ path: at, message: `Must be >= ${schema.minimum}.` });\n\t\t}\n\t\tif (schema.maximum !== undefined && value > schema.maximum) {\n\t\t\terrors.push({ path: at, message: `Must be <= ${schema.maximum}.` });\n\t\t}\n\t\tif (typeof schema.exclusiveMinimum === 'number' && value <= schema.exclusiveMinimum) {\n\t\t\terrors.push({ path: at, message: `Must be > ${schema.exclusiveMinimum}.` });\n\t\t}\n\t\tif (typeof schema.exclusiveMaximum === 'number' && value >= schema.exclusiveMaximum) {\n\t\t\terrors.push({ path: at, message: `Must be < ${schema.exclusiveMaximum}.` });\n\t\t}\n\t\tif (schema.multipleOf !== undefined && schema.multipleOf > 0) {\n\t\t\tconst quotient = value / schema.multipleOf;\n\t\t\tif (Math.abs(quotient - Math.round(quotient)) > 1e-9) {\n\t\t\t\terrors.push({ path: at, message: `Must be a multiple of ${schema.multipleOf}.` });\n\t\t\t}\n\t\t}\n\t}\n\n\tif (Array.isArray(value)) {\n\t\tif (schema.minItems !== undefined && value.length < schema.minItems) {\n\t\t\terrors.push({ path: at, message: `Must have at least ${schema.minItems} items.` });\n\t\t}\n\t\tif (schema.maxItems !== undefined && value.length > schema.maxItems) {\n\t\t\terrors.push({ path: at, message: `Must have at most ${schema.maxItems} items.` });\n\t\t}\n\t\tif (schema.uniqueItems) {\n\t\t\tconst seen = new Set<string>();\n\t\t\tvalue.forEach((item, index) => {\n\t\t\t\tconst key = JSON.stringify(item);\n\t\t\t\tif (seen.has(key)) errors.push({ path: `${path}/${index}`, message: 'Duplicate item; items must be unique.' });\n\t\t\t\tseen.add(key);\n\t\t\t});\n\t\t}\n\t\tif (schema.items) {\n\t\t\tvalue.forEach((item, index) => {\n\t\t\t\terrors.push(...recurse(item, schema.items, `${path}/${index}`));\n\t\t\t});\n\t\t}\n\t}\n\n\tif (typeOf(value) === 'object') {\n\t\tconst obj = value as Record<string, unknown>;\n\t\tfor (const key of schema.required ?? []) {\n\t\t\tif (obj[key] === undefined) {\n\t\t\t\terrors.push({ path: `${path}/${key}`, message: `Missing required property \"${key}\".` });\n\t\t\t}\n\t\t}\n\t\tconst properties = schema.properties ?? {};\n\t\tfor (const [key, child] of Object.entries(obj)) {\n\t\t\tif (child === undefined) continue;\n\t\t\tif (key in properties) {\n\t\t\t\terrors.push(...recurse(child, properties[key], `${path}/${key}`));\n\t\t\t} else if (schema.additionalProperties === false) {\n\t\t\t\tconst known = Object.keys(properties);\n\t\t\t\terrors.push({\n\t\t\t\t\tpath: `${path}/${key}`,\n\t\t\t\t\tmessage: `Unknown property \"${key}\".${known.length ? ` Allowed: ${known.join(', ')}.` : ''}`\n\t\t\t\t});\n\t\t\t} else if (typeof schema.additionalProperties === 'object') {\n\t\t\t\terrors.push(...recurse(child, schema.additionalProperties, `${path}/${key}`));\n\t\t\t}\n\t\t}\n\t}\n\n\treturn errors;\n}\n"],"mappings":";AA6CA,SAAS,OAAO,OAA8C;AAC7D,MAAI,UAAU,KAAM,QAAO;AAC3B,MAAI,MAAM,QAAQ,KAAK,EAAG,QAAO;AACjC,MAAI,OAAO,UAAU,SAAU,QAAO,OAAO,UAAU,KAAK,IAAI,YAAY;AAC5E,MAAI,OAAO,UAAU,YAAY,OAAO,UAAU,aAAa,OAAO,UAAU,UAAU;AACzF,WAAO,OAAO;AAAA,EACf;AACA,SAAO;AACR;AAEA,SAAS,YAAY,OAAgB,MAA+B;AACnE,QAAM,SAAS,OAAO,KAAK;AAC3B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