@cleocode/adapters 2026.5.121 → 2026.5.122
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 +143 -76
- package/dist/index.js.map +3 -3
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1411,7 +1411,7 @@ var init_errors = __esm({
|
|
|
1411
1411
|
|
|
1412
1412
|
// packages/contracts/src/evidence-atom-schema.ts
|
|
1413
1413
|
import { z as z6 } from "zod";
|
|
1414
|
-
var commitAtomSchema, filesAtomSchema, testRunAtomSchema, toolAtomSchema, urlAtomSchema, noteAtomSchema, decisionAtomSchema, prAtomSchema, locDropAtomSchema, callsiteCoverageAtomSchema, EvidenceAtomSchema, GATE_EVIDENCE_REQUIREMENTS, ATOM_EXAMPLES;
|
|
1414
|
+
var commitAtomSchema, filesAtomSchema, testRunAtomSchema, toolAtomSchema, urlAtomSchema, noteAtomSchema, decisionAtomSchema, prAtomSchema, locDropAtomSchema, callsiteCoverageAtomSchema, AC_UUID_REGEX, AC_ALIAS_REGEX, SATISFIES_TASK_ID_REGEX, SATISFIES_VERSION_PIN_REGEX, satisfiesAtomSchema, EvidenceAtomSchema, GATE_EVIDENCE_REQUIREMENTS, ATOM_EXAMPLES;
|
|
1415
1415
|
var init_evidence_atom_schema = __esm({
|
|
1416
1416
|
"packages/contracts/src/evidence-atom-schema.ts"() {
|
|
1417
1417
|
"use strict";
|
|
@@ -1457,6 +1457,24 @@ var init_evidence_atom_schema = __esm({
|
|
|
1457
1457
|
symbolName: z6.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
|
|
1458
1458
|
relativeSourcePath: z6.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
|
|
1459
1459
|
});
|
|
1460
|
+
AC_UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
|
|
1461
|
+
AC_ALIAS_REGEX = /^AC[0-9]{1,4}$/;
|
|
1462
|
+
SATISFIES_TASK_ID_REGEX = /^T[0-9]{1,7}$/;
|
|
1463
|
+
SATISFIES_VERSION_PIN_REGEX = /^[0-9]{14}$/;
|
|
1464
|
+
satisfiesAtomSchema = z6.object({
|
|
1465
|
+
kind: z6.literal("satisfies"),
|
|
1466
|
+
/** Target task ID — `T<1-7 digits>` per ADR-079-r2 §2.1. */
|
|
1467
|
+
targetTaskId: z6.string().regex(SATISFIES_TASK_ID_REGEX, "satisfies atom targetTaskId must match /^T[0-9]{1,7}$/"),
|
|
1468
|
+
/** Lowercase UUIDv4 — populated for the canonical form; undefined for alias form. */
|
|
1469
|
+
targetAcId: z6.string().regex(AC_UUID_REGEX, "satisfies atom targetAcId must be a lowercase UUIDv4").optional(),
|
|
1470
|
+
/** Positional alias `AC<1-4 digits>` — populated for alias form; undefined for UUID form. */
|
|
1471
|
+
targetAcAlias: z6.string().regex(AC_ALIAS_REGEX, "satisfies atom targetAcAlias must match /^AC[0-9]{1,4}$/").optional(),
|
|
1472
|
+
/** Optional `@<14-digit YYYYMMDDhhmmss>` pin captured at mint time. */
|
|
1473
|
+
versionPin: z6.string().regex(
|
|
1474
|
+
SATISFIES_VERSION_PIN_REGEX,
|
|
1475
|
+
"satisfies atom versionPin must be 14 digits (YYYYMMDDhhmmss)"
|
|
1476
|
+
).optional()
|
|
1477
|
+
});
|
|
1460
1478
|
EvidenceAtomSchema = z6.discriminatedUnion("kind", [
|
|
1461
1479
|
commitAtomSchema,
|
|
1462
1480
|
filesAtomSchema,
|
|
@@ -1467,7 +1485,8 @@ var init_evidence_atom_schema = __esm({
|
|
|
1467
1485
|
decisionAtomSchema,
|
|
1468
1486
|
prAtomSchema,
|
|
1469
1487
|
locDropAtomSchema,
|
|
1470
|
-
callsiteCoverageAtomSchema
|
|
1488
|
+
callsiteCoverageAtomSchema,
|
|
1489
|
+
satisfiesAtomSchema
|
|
1471
1490
|
]);
|
|
1472
1491
|
GATE_EVIDENCE_REQUIREMENTS = Object.freeze({
|
|
1473
1492
|
implemented: {
|
|
@@ -1496,7 +1515,8 @@ var init_evidence_atom_schema = __esm({
|
|
|
1496
1515
|
decision: "decision:D-arch-001",
|
|
1497
1516
|
pr: "pr:357",
|
|
1498
1517
|
"loc-drop": "loc-drop:<fromLines>:<toLines>",
|
|
1499
|
-
"callsite-coverage": "callsite-coverage:<symbolName>:<relativeSourcePath>"
|
|
1518
|
+
"callsite-coverage": "callsite-coverage:<symbolName>:<relativeSourcePath>",
|
|
1519
|
+
satisfies: "satisfies:T1234#AC2"
|
|
1500
1520
|
});
|
|
1501
1521
|
}
|
|
1502
1522
|
});
|
|
@@ -2774,6 +2794,52 @@ var init_manifest2 = __esm({
|
|
|
2774
2794
|
}
|
|
2775
2795
|
});
|
|
2776
2796
|
|
|
2797
|
+
// packages/contracts/src/validator/index.ts
|
|
2798
|
+
import { z as z14 } from "zod";
|
|
2799
|
+
var VALIDATOR_ID_REGEX, validatorFindingSchema, validatorAttestationSchema, validatorRejectionSchema, validatorVerdictSchema;
|
|
2800
|
+
var init_validator = __esm({
|
|
2801
|
+
"packages/contracts/src/validator/index.ts"() {
|
|
2802
|
+
"use strict";
|
|
2803
|
+
VALIDATOR_ID_REGEX = /^validator-[a-z0-9][a-z0-9-]*$/;
|
|
2804
|
+
validatorFindingSchema = z14.object({
|
|
2805
|
+
acId: z14.string().min(1, "acId must be non-empty"),
|
|
2806
|
+
status: z14.enum(["pass", "fail", "inconclusive"]),
|
|
2807
|
+
reasoning: z14.string().min(1, "reasoning must be non-empty"),
|
|
2808
|
+
evidenceRefs: z14.array(z14.string()).optional(),
|
|
2809
|
+
checkedAt: z14.string().min(1, "checkedAt must be a non-empty ISO-8601 string")
|
|
2810
|
+
});
|
|
2811
|
+
validatorAttestationSchema = z14.object({
|
|
2812
|
+
verdict: z14.literal("attest"),
|
|
2813
|
+
taskId: z14.string().min(1),
|
|
2814
|
+
validatorId: z14.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
|
|
2815
|
+
findings: z14.array(validatorFindingSchema).min(1, "attestation must contain at least one finding").refine(
|
|
2816
|
+
(findings) => findings.every((f) => f.status === "pass"),
|
|
2817
|
+
'attestation requires every finding to have status="pass"'
|
|
2818
|
+
),
|
|
2819
|
+
summary: z14.string().optional(),
|
|
2820
|
+
attestedAt: z14.string().min(1),
|
|
2821
|
+
schemaVersion: z14.literal("1")
|
|
2822
|
+
});
|
|
2823
|
+
validatorRejectionSchema = z14.object({
|
|
2824
|
+
verdict: z14.literal("reject"),
|
|
2825
|
+
taskId: z14.string().min(1),
|
|
2826
|
+
validatorId: z14.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
|
|
2827
|
+
findings: z14.array(validatorFindingSchema).min(1, "rejection must contain at least one finding").refine(
|
|
2828
|
+
(findings) => findings.some((f) => f.status !== "pass"),
|
|
2829
|
+
'rejection requires at least one finding with status "fail" or "inconclusive"'
|
|
2830
|
+
),
|
|
2831
|
+
summary: z14.string().min(1, "rejection summary must be non-empty"),
|
|
2832
|
+
remediationHints: z14.array(z14.string()).optional(),
|
|
2833
|
+
rejectedAt: z14.string().min(1),
|
|
2834
|
+
schemaVersion: z14.literal("1")
|
|
2835
|
+
});
|
|
2836
|
+
validatorVerdictSchema = z14.discriminatedUnion("verdict", [
|
|
2837
|
+
validatorAttestationSchema,
|
|
2838
|
+
validatorRejectionSchema
|
|
2839
|
+
]);
|
|
2840
|
+
}
|
|
2841
|
+
});
|
|
2842
|
+
|
|
2777
2843
|
// packages/contracts/src/index.ts
|
|
2778
2844
|
var init_src = __esm({
|
|
2779
2845
|
"packages/contracts/src/index.ts"() {
|
|
@@ -2817,6 +2883,7 @@ var init_src = __esm({
|
|
|
2817
2883
|
init_task_evidence();
|
|
2818
2884
|
init_archive();
|
|
2819
2885
|
init_manifest2();
|
|
2886
|
+
init_validator();
|
|
2820
2887
|
}
|
|
2821
2888
|
});
|
|
2822
2889
|
|
|
@@ -16836,7 +16903,7 @@ function resolveRef(ref, ctx) {
|
|
|
16836
16903
|
function convertBaseSchema(schema, ctx) {
|
|
16837
16904
|
if (schema.not !== void 0) {
|
|
16838
16905
|
if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
|
|
16839
|
-
return
|
|
16906
|
+
return z15.never();
|
|
16840
16907
|
}
|
|
16841
16908
|
throw new Error("not is not supported in Zod (except { not: {} } for never)");
|
|
16842
16909
|
}
|
|
@@ -16858,7 +16925,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
16858
16925
|
return ctx.refs.get(refPath);
|
|
16859
16926
|
}
|
|
16860
16927
|
if (ctx.processing.has(refPath)) {
|
|
16861
|
-
return
|
|
16928
|
+
return z15.lazy(() => {
|
|
16862
16929
|
if (!ctx.refs.has(refPath)) {
|
|
16863
16930
|
throw new Error(`Circular reference not resolved: ${refPath}`);
|
|
16864
16931
|
}
|
|
@@ -16875,25 +16942,25 @@ function convertBaseSchema(schema, ctx) {
|
|
|
16875
16942
|
if (schema.enum !== void 0) {
|
|
16876
16943
|
const enumValues = schema.enum;
|
|
16877
16944
|
if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
|
|
16878
|
-
return
|
|
16945
|
+
return z15.null();
|
|
16879
16946
|
}
|
|
16880
16947
|
if (enumValues.length === 0) {
|
|
16881
|
-
return
|
|
16948
|
+
return z15.never();
|
|
16882
16949
|
}
|
|
16883
16950
|
if (enumValues.length === 1) {
|
|
16884
|
-
return
|
|
16951
|
+
return z15.literal(enumValues[0]);
|
|
16885
16952
|
}
|
|
16886
16953
|
if (enumValues.every((v) => typeof v === "string")) {
|
|
16887
|
-
return
|
|
16954
|
+
return z15.enum(enumValues);
|
|
16888
16955
|
}
|
|
16889
|
-
const literalSchemas = enumValues.map((v) =>
|
|
16956
|
+
const literalSchemas = enumValues.map((v) => z15.literal(v));
|
|
16890
16957
|
if (literalSchemas.length < 2) {
|
|
16891
16958
|
return literalSchemas[0];
|
|
16892
16959
|
}
|
|
16893
|
-
return
|
|
16960
|
+
return z15.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
|
|
16894
16961
|
}
|
|
16895
16962
|
if (schema.const !== void 0) {
|
|
16896
|
-
return
|
|
16963
|
+
return z15.literal(schema.const);
|
|
16897
16964
|
}
|
|
16898
16965
|
const type = schema.type;
|
|
16899
16966
|
if (Array.isArray(type)) {
|
|
@@ -16902,68 +16969,68 @@ function convertBaseSchema(schema, ctx) {
|
|
|
16902
16969
|
return convertBaseSchema(typeSchema, ctx);
|
|
16903
16970
|
});
|
|
16904
16971
|
if (typeSchemas.length === 0) {
|
|
16905
|
-
return
|
|
16972
|
+
return z15.never();
|
|
16906
16973
|
}
|
|
16907
16974
|
if (typeSchemas.length === 1) {
|
|
16908
16975
|
return typeSchemas[0];
|
|
16909
16976
|
}
|
|
16910
|
-
return
|
|
16977
|
+
return z15.union(typeSchemas);
|
|
16911
16978
|
}
|
|
16912
16979
|
if (!type) {
|
|
16913
|
-
return
|
|
16980
|
+
return z15.any();
|
|
16914
16981
|
}
|
|
16915
16982
|
let zodSchema2;
|
|
16916
16983
|
switch (type) {
|
|
16917
16984
|
case "string": {
|
|
16918
|
-
let stringSchema =
|
|
16985
|
+
let stringSchema = z15.string();
|
|
16919
16986
|
if (schema.format) {
|
|
16920
16987
|
const format = schema.format;
|
|
16921
16988
|
if (format === "email") {
|
|
16922
|
-
stringSchema = stringSchema.check(
|
|
16989
|
+
stringSchema = stringSchema.check(z15.email());
|
|
16923
16990
|
} else if (format === "uri" || format === "uri-reference") {
|
|
16924
|
-
stringSchema = stringSchema.check(
|
|
16991
|
+
stringSchema = stringSchema.check(z15.url());
|
|
16925
16992
|
} else if (format === "uuid" || format === "guid") {
|
|
16926
|
-
stringSchema = stringSchema.check(
|
|
16993
|
+
stringSchema = stringSchema.check(z15.uuid());
|
|
16927
16994
|
} else if (format === "date-time") {
|
|
16928
|
-
stringSchema = stringSchema.check(
|
|
16995
|
+
stringSchema = stringSchema.check(z15.iso.datetime());
|
|
16929
16996
|
} else if (format === "date") {
|
|
16930
|
-
stringSchema = stringSchema.check(
|
|
16997
|
+
stringSchema = stringSchema.check(z15.iso.date());
|
|
16931
16998
|
} else if (format === "time") {
|
|
16932
|
-
stringSchema = stringSchema.check(
|
|
16999
|
+
stringSchema = stringSchema.check(z15.iso.time());
|
|
16933
17000
|
} else if (format === "duration") {
|
|
16934
|
-
stringSchema = stringSchema.check(
|
|
17001
|
+
stringSchema = stringSchema.check(z15.iso.duration());
|
|
16935
17002
|
} else if (format === "ipv4") {
|
|
16936
|
-
stringSchema = stringSchema.check(
|
|
17003
|
+
stringSchema = stringSchema.check(z15.ipv4());
|
|
16937
17004
|
} else if (format === "ipv6") {
|
|
16938
|
-
stringSchema = stringSchema.check(
|
|
17005
|
+
stringSchema = stringSchema.check(z15.ipv6());
|
|
16939
17006
|
} else if (format === "mac") {
|
|
16940
|
-
stringSchema = stringSchema.check(
|
|
17007
|
+
stringSchema = stringSchema.check(z15.mac());
|
|
16941
17008
|
} else if (format === "cidr") {
|
|
16942
|
-
stringSchema = stringSchema.check(
|
|
17009
|
+
stringSchema = stringSchema.check(z15.cidrv4());
|
|
16943
17010
|
} else if (format === "cidr-v6") {
|
|
16944
|
-
stringSchema = stringSchema.check(
|
|
17011
|
+
stringSchema = stringSchema.check(z15.cidrv6());
|
|
16945
17012
|
} else if (format === "base64") {
|
|
16946
|
-
stringSchema = stringSchema.check(
|
|
17013
|
+
stringSchema = stringSchema.check(z15.base64());
|
|
16947
17014
|
} else if (format === "base64url") {
|
|
16948
|
-
stringSchema = stringSchema.check(
|
|
17015
|
+
stringSchema = stringSchema.check(z15.base64url());
|
|
16949
17016
|
} else if (format === "e164") {
|
|
16950
|
-
stringSchema = stringSchema.check(
|
|
17017
|
+
stringSchema = stringSchema.check(z15.e164());
|
|
16951
17018
|
} else if (format === "jwt") {
|
|
16952
|
-
stringSchema = stringSchema.check(
|
|
17019
|
+
stringSchema = stringSchema.check(z15.jwt());
|
|
16953
17020
|
} else if (format === "emoji") {
|
|
16954
|
-
stringSchema = stringSchema.check(
|
|
17021
|
+
stringSchema = stringSchema.check(z15.emoji());
|
|
16955
17022
|
} else if (format === "nanoid") {
|
|
16956
|
-
stringSchema = stringSchema.check(
|
|
17023
|
+
stringSchema = stringSchema.check(z15.nanoid());
|
|
16957
17024
|
} else if (format === "cuid") {
|
|
16958
|
-
stringSchema = stringSchema.check(
|
|
17025
|
+
stringSchema = stringSchema.check(z15.cuid());
|
|
16959
17026
|
} else if (format === "cuid2") {
|
|
16960
|
-
stringSchema = stringSchema.check(
|
|
17027
|
+
stringSchema = stringSchema.check(z15.cuid2());
|
|
16961
17028
|
} else if (format === "ulid") {
|
|
16962
|
-
stringSchema = stringSchema.check(
|
|
17029
|
+
stringSchema = stringSchema.check(z15.ulid());
|
|
16963
17030
|
} else if (format === "xid") {
|
|
16964
|
-
stringSchema = stringSchema.check(
|
|
17031
|
+
stringSchema = stringSchema.check(z15.xid());
|
|
16965
17032
|
} else if (format === "ksuid") {
|
|
16966
|
-
stringSchema = stringSchema.check(
|
|
17033
|
+
stringSchema = stringSchema.check(z15.ksuid());
|
|
16967
17034
|
}
|
|
16968
17035
|
}
|
|
16969
17036
|
if (typeof schema.minLength === "number") {
|
|
@@ -16980,7 +17047,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
16980
17047
|
}
|
|
16981
17048
|
case "number":
|
|
16982
17049
|
case "integer": {
|
|
16983
|
-
let numberSchema = type === "integer" ?
|
|
17050
|
+
let numberSchema = type === "integer" ? z15.number().int() : z15.number();
|
|
16984
17051
|
if (typeof schema.minimum === "number") {
|
|
16985
17052
|
numberSchema = numberSchema.min(schema.minimum);
|
|
16986
17053
|
}
|
|
@@ -17004,11 +17071,11 @@ function convertBaseSchema(schema, ctx) {
|
|
|
17004
17071
|
break;
|
|
17005
17072
|
}
|
|
17006
17073
|
case "boolean": {
|
|
17007
|
-
zodSchema2 =
|
|
17074
|
+
zodSchema2 = z15.boolean();
|
|
17008
17075
|
break;
|
|
17009
17076
|
}
|
|
17010
17077
|
case "null": {
|
|
17011
|
-
zodSchema2 =
|
|
17078
|
+
zodSchema2 = z15.null();
|
|
17012
17079
|
break;
|
|
17013
17080
|
}
|
|
17014
17081
|
case "object": {
|
|
@@ -17021,14 +17088,14 @@ function convertBaseSchema(schema, ctx) {
|
|
|
17021
17088
|
}
|
|
17022
17089
|
if (schema.propertyNames) {
|
|
17023
17090
|
const keySchema = convertSchema(schema.propertyNames, ctx);
|
|
17024
|
-
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) :
|
|
17091
|
+
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z15.any();
|
|
17025
17092
|
if (Object.keys(shape).length === 0) {
|
|
17026
|
-
zodSchema2 =
|
|
17093
|
+
zodSchema2 = z15.record(keySchema, valueSchema);
|
|
17027
17094
|
break;
|
|
17028
17095
|
}
|
|
17029
|
-
const objectSchema2 =
|
|
17030
|
-
const recordSchema =
|
|
17031
|
-
zodSchema2 =
|
|
17096
|
+
const objectSchema2 = z15.object(shape).passthrough();
|
|
17097
|
+
const recordSchema = z15.looseRecord(keySchema, valueSchema);
|
|
17098
|
+
zodSchema2 = z15.intersection(objectSchema2, recordSchema);
|
|
17032
17099
|
break;
|
|
17033
17100
|
}
|
|
17034
17101
|
if (schema.patternProperties) {
|
|
@@ -17037,28 +17104,28 @@ function convertBaseSchema(schema, ctx) {
|
|
|
17037
17104
|
const looseRecords = [];
|
|
17038
17105
|
for (const pattern of patternKeys) {
|
|
17039
17106
|
const patternValue = convertSchema(patternProps[pattern], ctx);
|
|
17040
|
-
const keySchema =
|
|
17041
|
-
looseRecords.push(
|
|
17107
|
+
const keySchema = z15.string().regex(new RegExp(pattern));
|
|
17108
|
+
looseRecords.push(z15.looseRecord(keySchema, patternValue));
|
|
17042
17109
|
}
|
|
17043
17110
|
const schemasToIntersect = [];
|
|
17044
17111
|
if (Object.keys(shape).length > 0) {
|
|
17045
|
-
schemasToIntersect.push(
|
|
17112
|
+
schemasToIntersect.push(z15.object(shape).passthrough());
|
|
17046
17113
|
}
|
|
17047
17114
|
schemasToIntersect.push(...looseRecords);
|
|
17048
17115
|
if (schemasToIntersect.length === 0) {
|
|
17049
|
-
zodSchema2 =
|
|
17116
|
+
zodSchema2 = z15.object({}).passthrough();
|
|
17050
17117
|
} else if (schemasToIntersect.length === 1) {
|
|
17051
17118
|
zodSchema2 = schemasToIntersect[0];
|
|
17052
17119
|
} else {
|
|
17053
|
-
let result =
|
|
17120
|
+
let result = z15.intersection(schemasToIntersect[0], schemasToIntersect[1]);
|
|
17054
17121
|
for (let i = 2; i < schemasToIntersect.length; i++) {
|
|
17055
|
-
result =
|
|
17122
|
+
result = z15.intersection(result, schemasToIntersect[i]);
|
|
17056
17123
|
}
|
|
17057
17124
|
zodSchema2 = result;
|
|
17058
17125
|
}
|
|
17059
17126
|
break;
|
|
17060
17127
|
}
|
|
17061
|
-
const objectSchema =
|
|
17128
|
+
const objectSchema = z15.object(shape);
|
|
17062
17129
|
if (schema.additionalProperties === false) {
|
|
17063
17130
|
zodSchema2 = objectSchema.strict();
|
|
17064
17131
|
} else if (typeof schema.additionalProperties === "object") {
|
|
@@ -17075,33 +17142,33 @@ function convertBaseSchema(schema, ctx) {
|
|
|
17075
17142
|
const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
|
|
17076
17143
|
const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0;
|
|
17077
17144
|
if (rest) {
|
|
17078
|
-
zodSchema2 =
|
|
17145
|
+
zodSchema2 = z15.tuple(tupleItems).rest(rest);
|
|
17079
17146
|
} else {
|
|
17080
|
-
zodSchema2 =
|
|
17147
|
+
zodSchema2 = z15.tuple(tupleItems);
|
|
17081
17148
|
}
|
|
17082
17149
|
if (typeof schema.minItems === "number") {
|
|
17083
|
-
zodSchema2 = zodSchema2.check(
|
|
17150
|
+
zodSchema2 = zodSchema2.check(z15.minLength(schema.minItems));
|
|
17084
17151
|
}
|
|
17085
17152
|
if (typeof schema.maxItems === "number") {
|
|
17086
|
-
zodSchema2 = zodSchema2.check(
|
|
17153
|
+
zodSchema2 = zodSchema2.check(z15.maxLength(schema.maxItems));
|
|
17087
17154
|
}
|
|
17088
17155
|
} else if (Array.isArray(items)) {
|
|
17089
17156
|
const tupleItems = items.map((item) => convertSchema(item, ctx));
|
|
17090
17157
|
const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : void 0;
|
|
17091
17158
|
if (rest) {
|
|
17092
|
-
zodSchema2 =
|
|
17159
|
+
zodSchema2 = z15.tuple(tupleItems).rest(rest);
|
|
17093
17160
|
} else {
|
|
17094
|
-
zodSchema2 =
|
|
17161
|
+
zodSchema2 = z15.tuple(tupleItems);
|
|
17095
17162
|
}
|
|
17096
17163
|
if (typeof schema.minItems === "number") {
|
|
17097
|
-
zodSchema2 = zodSchema2.check(
|
|
17164
|
+
zodSchema2 = zodSchema2.check(z15.minLength(schema.minItems));
|
|
17098
17165
|
}
|
|
17099
17166
|
if (typeof schema.maxItems === "number") {
|
|
17100
|
-
zodSchema2 = zodSchema2.check(
|
|
17167
|
+
zodSchema2 = zodSchema2.check(z15.maxLength(schema.maxItems));
|
|
17101
17168
|
}
|
|
17102
17169
|
} else if (items !== void 0) {
|
|
17103
17170
|
const element = convertSchema(items, ctx);
|
|
17104
|
-
let arraySchema =
|
|
17171
|
+
let arraySchema = z15.array(element);
|
|
17105
17172
|
if (typeof schema.minItems === "number") {
|
|
17106
17173
|
arraySchema = arraySchema.min(schema.minItems);
|
|
17107
17174
|
}
|
|
@@ -17110,7 +17177,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
17110
17177
|
}
|
|
17111
17178
|
zodSchema2 = arraySchema;
|
|
17112
17179
|
} else {
|
|
17113
|
-
zodSchema2 =
|
|
17180
|
+
zodSchema2 = z15.array(z15.any());
|
|
17114
17181
|
}
|
|
17115
17182
|
break;
|
|
17116
17183
|
}
|
|
@@ -17127,37 +17194,37 @@ function convertBaseSchema(schema, ctx) {
|
|
|
17127
17194
|
}
|
|
17128
17195
|
function convertSchema(schema, ctx) {
|
|
17129
17196
|
if (typeof schema === "boolean") {
|
|
17130
|
-
return schema ?
|
|
17197
|
+
return schema ? z15.any() : z15.never();
|
|
17131
17198
|
}
|
|
17132
17199
|
let baseSchema = convertBaseSchema(schema, ctx);
|
|
17133
17200
|
const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
|
|
17134
17201
|
if (schema.anyOf && Array.isArray(schema.anyOf)) {
|
|
17135
17202
|
const options = schema.anyOf.map((s) => convertSchema(s, ctx));
|
|
17136
|
-
const anyOfUnion =
|
|
17137
|
-
baseSchema = hasExplicitType ?
|
|
17203
|
+
const anyOfUnion = z15.union(options);
|
|
17204
|
+
baseSchema = hasExplicitType ? z15.intersection(baseSchema, anyOfUnion) : anyOfUnion;
|
|
17138
17205
|
}
|
|
17139
17206
|
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
17140
17207
|
const options = schema.oneOf.map((s) => convertSchema(s, ctx));
|
|
17141
|
-
const oneOfUnion =
|
|
17142
|
-
baseSchema = hasExplicitType ?
|
|
17208
|
+
const oneOfUnion = z15.xor(options);
|
|
17209
|
+
baseSchema = hasExplicitType ? z15.intersection(baseSchema, oneOfUnion) : oneOfUnion;
|
|
17143
17210
|
}
|
|
17144
17211
|
if (schema.allOf && Array.isArray(schema.allOf)) {
|
|
17145
17212
|
if (schema.allOf.length === 0) {
|
|
17146
|
-
baseSchema = hasExplicitType ? baseSchema :
|
|
17213
|
+
baseSchema = hasExplicitType ? baseSchema : z15.any();
|
|
17147
17214
|
} else {
|
|
17148
17215
|
let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
|
|
17149
17216
|
const startIdx = hasExplicitType ? 0 : 1;
|
|
17150
17217
|
for (let i = startIdx; i < schema.allOf.length; i++) {
|
|
17151
|
-
result =
|
|
17218
|
+
result = z15.intersection(result, convertSchema(schema.allOf[i], ctx));
|
|
17152
17219
|
}
|
|
17153
17220
|
baseSchema = result;
|
|
17154
17221
|
}
|
|
17155
17222
|
}
|
|
17156
17223
|
if (schema.nullable === true && ctx.version === "openapi-3.0") {
|
|
17157
|
-
baseSchema =
|
|
17224
|
+
baseSchema = z15.nullable(baseSchema);
|
|
17158
17225
|
}
|
|
17159
17226
|
if (schema.readOnly === true) {
|
|
17160
|
-
baseSchema =
|
|
17227
|
+
baseSchema = z15.readonly(baseSchema);
|
|
17161
17228
|
}
|
|
17162
17229
|
const extraMeta = {};
|
|
17163
17230
|
const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
|
|
@@ -17184,7 +17251,7 @@ function convertSchema(schema, ctx) {
|
|
|
17184
17251
|
}
|
|
17185
17252
|
function fromJSONSchema(schema, params) {
|
|
17186
17253
|
if (typeof schema === "boolean") {
|
|
17187
|
-
return schema ?
|
|
17254
|
+
return schema ? z15.any() : z15.never();
|
|
17188
17255
|
}
|
|
17189
17256
|
const version2 = detectVersion(schema, params?.defaultTarget);
|
|
17190
17257
|
const defs = schema.$defs || schema.definitions || {};
|
|
@@ -17198,14 +17265,14 @@ function fromJSONSchema(schema, params) {
|
|
|
17198
17265
|
};
|
|
17199
17266
|
return convertSchema(schema, ctx);
|
|
17200
17267
|
}
|
|
17201
|
-
var
|
|
17268
|
+
var z15, RECOGNIZED_KEYS;
|
|
17202
17269
|
var init_from_json_schema = __esm({
|
|
17203
17270
|
"node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/from-json-schema.js"() {
|
|
17204
17271
|
init_registries();
|
|
17205
17272
|
init_checks2();
|
|
17206
17273
|
init_iso();
|
|
17207
17274
|
init_schemas2();
|
|
17208
|
-
|
|
17275
|
+
z15 = {
|
|
17209
17276
|
...schemas_exports2,
|
|
17210
17277
|
...checks_exports2,
|
|
17211
17278
|
iso: iso_exports
|