@cleocode/adapters 2026.5.120 → 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 +210 -79
- package/dist/index.js.map +3 -3
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -786,7 +786,7 @@ var init_branch_lock = __esm({
|
|
|
786
786
|
|
|
787
787
|
// packages/contracts/src/changesets.ts
|
|
788
788
|
import { z as z3 } from "zod";
|
|
789
|
-
var CHANGESET_KINDS, TASK_ID_RE, ChangesetEntrySchema;
|
|
789
|
+
var CHANGESET_KINDS, CHANGESET_RELEASE_NOTE_SECTIONS, CHANGESET_RELEASE_NOTE_AUDIENCES, CHANGESET_RELEASE_NOTE_SCOPES, nonEmptyReleaseNoteText, nonEmptyReleaseNoteList, ChangesetReleaseNotesMetadataSchema, TASK_ID_RE, ChangesetEntrySchema;
|
|
790
790
|
var init_changesets = __esm({
|
|
791
791
|
"packages/contracts/src/changesets.ts"() {
|
|
792
792
|
"use strict";
|
|
@@ -800,10 +800,60 @@ var init_changesets = __esm({
|
|
|
800
800
|
"chore",
|
|
801
801
|
"breaking"
|
|
802
802
|
];
|
|
803
|
+
CHANGESET_RELEASE_NOTE_SECTIONS = [
|
|
804
|
+
"added",
|
|
805
|
+
"changed",
|
|
806
|
+
"fixed",
|
|
807
|
+
"deprecated",
|
|
808
|
+
"removed",
|
|
809
|
+
"security",
|
|
810
|
+
"breaking"
|
|
811
|
+
];
|
|
812
|
+
CHANGESET_RELEASE_NOTE_AUDIENCES = [
|
|
813
|
+
"users",
|
|
814
|
+
"operators",
|
|
815
|
+
"developers",
|
|
816
|
+
"maintainers"
|
|
817
|
+
];
|
|
818
|
+
CHANGESET_RELEASE_NOTE_SCOPES = [
|
|
819
|
+
"project",
|
|
820
|
+
"package",
|
|
821
|
+
"component",
|
|
822
|
+
"docs",
|
|
823
|
+
"ops",
|
|
824
|
+
"security"
|
|
825
|
+
];
|
|
826
|
+
nonEmptyReleaseNoteText = z3.string().min(1, "release-note metadata text must be non-empty");
|
|
827
|
+
nonEmptyReleaseNoteList = z3.array(nonEmptyReleaseNoteText).min(1, "release-note metadata list must contain at least one item");
|
|
828
|
+
ChangesetReleaseNotesMetadataSchema = z3.object({
|
|
829
|
+
/** Keep-a-Changelog style section/category override. */
|
|
830
|
+
section: z3.enum(CHANGESET_RELEASE_NOTE_SECTIONS).optional(),
|
|
831
|
+
/** Intended readers for the note. */
|
|
832
|
+
audience: z3.array(z3.enum(CHANGESET_RELEASE_NOTE_AUDIENCES)).min(1).optional(),
|
|
833
|
+
/** Release-note scope. */
|
|
834
|
+
scope: z3.enum(CHANGESET_RELEASE_NOTE_SCOPES).optional(),
|
|
835
|
+
/** Package/project/component targets affected by this entry. */
|
|
836
|
+
targets: nonEmptyReleaseNoteList.optional(),
|
|
837
|
+
/** User- or operator-visible impact statement. */
|
|
838
|
+
impact: nonEmptyReleaseNoteText.optional(),
|
|
839
|
+
/** Deterministic migration/action text, separate from breaking changes. */
|
|
840
|
+
migration: nonEmptyReleaseNoteText.optional(),
|
|
841
|
+
/** Deprecation detail for Deprecated sections. */
|
|
842
|
+
deprecation: nonEmptyReleaseNoteText.optional(),
|
|
843
|
+
/** Security detail for Security sections. */
|
|
844
|
+
security: nonEmptyReleaseNoteText.optional(),
|
|
845
|
+
/** Operator-facing rollout/verification note. */
|
|
846
|
+
operatorNotes: nonEmptyReleaseNoteText.optional(),
|
|
847
|
+
/** Explicit inclusion toggle for future release-scope filters. */
|
|
848
|
+
includeInChangelog: z3.boolean().optional()
|
|
849
|
+
}).strict();
|
|
803
850
|
TASK_ID_RE = /^(T\d+(-[A-Z][A-Za-z0-9]*)?|E-\d+(-[A-Z][A-Za-z0-9]*)?)$/;
|
|
804
851
|
ChangesetEntrySchema = z3.object({
|
|
805
|
-
/** Filename
|
|
806
|
-
id: z3.string().min(1, "id must be non-empty").regex(
|
|
852
|
+
/** Filename identifier (without the `.md` extension); lowercase kebab-case for new files, legacy uppercase task IDs accepted. */
|
|
853
|
+
id: z3.string().min(1, "id must be non-empty").regex(
|
|
854
|
+
/^[A-Za-z0-9][A-Za-z0-9-]*$/,
|
|
855
|
+
"id must contain only ASCII letters, digits, and hyphens"
|
|
856
|
+
),
|
|
807
857
|
/** One or more CLEO task IDs this change is anchored to. */
|
|
808
858
|
tasks: z3.array(z3.string().regex(TASK_ID_RE, "task ID must match T#### or E-#### format")).min(1, "tasks must contain at least one task ID"),
|
|
809
859
|
/** Type of change. */
|
|
@@ -815,7 +865,9 @@ var init_changesets = __esm({
|
|
|
815
865
|
/** Markdown body — longer-form explanation. */
|
|
816
866
|
notes: z3.string().optional(),
|
|
817
867
|
/** Migration note. Required iff `kind === 'breaking'`. */
|
|
818
|
-
breaking: z3.string().optional()
|
|
868
|
+
breaking: z3.string().optional(),
|
|
869
|
+
/** Structured author-provided metadata for deterministic release notes. */
|
|
870
|
+
releaseNotes: ChangesetReleaseNotesMetadataSchema.optional()
|
|
819
871
|
}).refine((entry) => entry.kind !== "breaking" || (entry.breaking?.length ?? 0) > 0, {
|
|
820
872
|
message: "breaking entries must include a non-empty `breaking` migration note",
|
|
821
873
|
path: ["breaking"]
|
|
@@ -1359,7 +1411,7 @@ var init_errors = __esm({
|
|
|
1359
1411
|
|
|
1360
1412
|
// packages/contracts/src/evidence-atom-schema.ts
|
|
1361
1413
|
import { z as z6 } from "zod";
|
|
1362
|
-
var commitAtomSchema, filesAtomSchema, testRunAtomSchema, toolAtomSchema, urlAtomSchema, noteAtomSchema, decisionAtomSchema, prAtomSchema, locDropAtomSchema, callsiteCoverageAtomSchema, EvidenceAtomSchema, GATE_EVIDENCE_REQUIREMENTS;
|
|
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;
|
|
1363
1415
|
var init_evidence_atom_schema = __esm({
|
|
1364
1416
|
"packages/contracts/src/evidence-atom-schema.ts"() {
|
|
1365
1417
|
"use strict";
|
|
@@ -1405,6 +1457,24 @@ var init_evidence_atom_schema = __esm({
|
|
|
1405
1457
|
symbolName: z6.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
|
|
1406
1458
|
relativeSourcePath: z6.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
|
|
1407
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
|
+
});
|
|
1408
1478
|
EvidenceAtomSchema = z6.discriminatedUnion("kind", [
|
|
1409
1479
|
commitAtomSchema,
|
|
1410
1480
|
filesAtomSchema,
|
|
@@ -1415,7 +1485,8 @@ var init_evidence_atom_schema = __esm({
|
|
|
1415
1485
|
decisionAtomSchema,
|
|
1416
1486
|
prAtomSchema,
|
|
1417
1487
|
locDropAtomSchema,
|
|
1418
|
-
callsiteCoverageAtomSchema
|
|
1488
|
+
callsiteCoverageAtomSchema,
|
|
1489
|
+
satisfiesAtomSchema
|
|
1419
1490
|
]);
|
|
1420
1491
|
GATE_EVIDENCE_REQUIREMENTS = Object.freeze({
|
|
1421
1492
|
implemented: {
|
|
@@ -1434,6 +1505,19 @@ var init_evidence_atom_schema = __esm({
|
|
|
1434
1505
|
cleanupDone: { oneOf: [["note"]] },
|
|
1435
1506
|
nexusImpact: { oneOf: [["tool"], ["note"]] }
|
|
1436
1507
|
});
|
|
1508
|
+
ATOM_EXAMPLES = Object.freeze({
|
|
1509
|
+
commit: "commit:<sha>",
|
|
1510
|
+
files: "files:path/a.ts,path/b.ts",
|
|
1511
|
+
"test-run": "test-run:/tmp/vitest-out.json",
|
|
1512
|
+
tool: "tool:test",
|
|
1513
|
+
url: "url:https://example.com/docs",
|
|
1514
|
+
note: "note:<short description>",
|
|
1515
|
+
decision: "decision:D-arch-001",
|
|
1516
|
+
pr: "pr:357",
|
|
1517
|
+
"loc-drop": "loc-drop:<fromLines>:<toLines>",
|
|
1518
|
+
"callsite-coverage": "callsite-coverage:<symbolName>:<relativeSourcePath>",
|
|
1519
|
+
satisfies: "satisfies:T1234#AC2"
|
|
1520
|
+
});
|
|
1437
1521
|
}
|
|
1438
1522
|
});
|
|
1439
1523
|
|
|
@@ -2710,6 +2794,52 @@ var init_manifest2 = __esm({
|
|
|
2710
2794
|
}
|
|
2711
2795
|
});
|
|
2712
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
|
+
|
|
2713
2843
|
// packages/contracts/src/index.ts
|
|
2714
2844
|
var init_src = __esm({
|
|
2715
2845
|
"packages/contracts/src/index.ts"() {
|
|
@@ -2753,6 +2883,7 @@ var init_src = __esm({
|
|
|
2753
2883
|
init_task_evidence();
|
|
2754
2884
|
init_archive();
|
|
2755
2885
|
init_manifest2();
|
|
2886
|
+
init_validator();
|
|
2756
2887
|
}
|
|
2757
2888
|
});
|
|
2758
2889
|
|
|
@@ -16772,7 +16903,7 @@ function resolveRef(ref, ctx) {
|
|
|
16772
16903
|
function convertBaseSchema(schema, ctx) {
|
|
16773
16904
|
if (schema.not !== void 0) {
|
|
16774
16905
|
if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
|
|
16775
|
-
return
|
|
16906
|
+
return z15.never();
|
|
16776
16907
|
}
|
|
16777
16908
|
throw new Error("not is not supported in Zod (except { not: {} } for never)");
|
|
16778
16909
|
}
|
|
@@ -16794,7 +16925,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
16794
16925
|
return ctx.refs.get(refPath);
|
|
16795
16926
|
}
|
|
16796
16927
|
if (ctx.processing.has(refPath)) {
|
|
16797
|
-
return
|
|
16928
|
+
return z15.lazy(() => {
|
|
16798
16929
|
if (!ctx.refs.has(refPath)) {
|
|
16799
16930
|
throw new Error(`Circular reference not resolved: ${refPath}`);
|
|
16800
16931
|
}
|
|
@@ -16811,25 +16942,25 @@ function convertBaseSchema(schema, ctx) {
|
|
|
16811
16942
|
if (schema.enum !== void 0) {
|
|
16812
16943
|
const enumValues = schema.enum;
|
|
16813
16944
|
if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
|
|
16814
|
-
return
|
|
16945
|
+
return z15.null();
|
|
16815
16946
|
}
|
|
16816
16947
|
if (enumValues.length === 0) {
|
|
16817
|
-
return
|
|
16948
|
+
return z15.never();
|
|
16818
16949
|
}
|
|
16819
16950
|
if (enumValues.length === 1) {
|
|
16820
|
-
return
|
|
16951
|
+
return z15.literal(enumValues[0]);
|
|
16821
16952
|
}
|
|
16822
16953
|
if (enumValues.every((v) => typeof v === "string")) {
|
|
16823
|
-
return
|
|
16954
|
+
return z15.enum(enumValues);
|
|
16824
16955
|
}
|
|
16825
|
-
const literalSchemas = enumValues.map((v) =>
|
|
16956
|
+
const literalSchemas = enumValues.map((v) => z15.literal(v));
|
|
16826
16957
|
if (literalSchemas.length < 2) {
|
|
16827
16958
|
return literalSchemas[0];
|
|
16828
16959
|
}
|
|
16829
|
-
return
|
|
16960
|
+
return z15.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
|
|
16830
16961
|
}
|
|
16831
16962
|
if (schema.const !== void 0) {
|
|
16832
|
-
return
|
|
16963
|
+
return z15.literal(schema.const);
|
|
16833
16964
|
}
|
|
16834
16965
|
const type = schema.type;
|
|
16835
16966
|
if (Array.isArray(type)) {
|
|
@@ -16838,68 +16969,68 @@ function convertBaseSchema(schema, ctx) {
|
|
|
16838
16969
|
return convertBaseSchema(typeSchema, ctx);
|
|
16839
16970
|
});
|
|
16840
16971
|
if (typeSchemas.length === 0) {
|
|
16841
|
-
return
|
|
16972
|
+
return z15.never();
|
|
16842
16973
|
}
|
|
16843
16974
|
if (typeSchemas.length === 1) {
|
|
16844
16975
|
return typeSchemas[0];
|
|
16845
16976
|
}
|
|
16846
|
-
return
|
|
16977
|
+
return z15.union(typeSchemas);
|
|
16847
16978
|
}
|
|
16848
16979
|
if (!type) {
|
|
16849
|
-
return
|
|
16980
|
+
return z15.any();
|
|
16850
16981
|
}
|
|
16851
16982
|
let zodSchema2;
|
|
16852
16983
|
switch (type) {
|
|
16853
16984
|
case "string": {
|
|
16854
|
-
let stringSchema =
|
|
16985
|
+
let stringSchema = z15.string();
|
|
16855
16986
|
if (schema.format) {
|
|
16856
16987
|
const format = schema.format;
|
|
16857
16988
|
if (format === "email") {
|
|
16858
|
-
stringSchema = stringSchema.check(
|
|
16989
|
+
stringSchema = stringSchema.check(z15.email());
|
|
16859
16990
|
} else if (format === "uri" || format === "uri-reference") {
|
|
16860
|
-
stringSchema = stringSchema.check(
|
|
16991
|
+
stringSchema = stringSchema.check(z15.url());
|
|
16861
16992
|
} else if (format === "uuid" || format === "guid") {
|
|
16862
|
-
stringSchema = stringSchema.check(
|
|
16993
|
+
stringSchema = stringSchema.check(z15.uuid());
|
|
16863
16994
|
} else if (format === "date-time") {
|
|
16864
|
-
stringSchema = stringSchema.check(
|
|
16995
|
+
stringSchema = stringSchema.check(z15.iso.datetime());
|
|
16865
16996
|
} else if (format === "date") {
|
|
16866
|
-
stringSchema = stringSchema.check(
|
|
16997
|
+
stringSchema = stringSchema.check(z15.iso.date());
|
|
16867
16998
|
} else if (format === "time") {
|
|
16868
|
-
stringSchema = stringSchema.check(
|
|
16999
|
+
stringSchema = stringSchema.check(z15.iso.time());
|
|
16869
17000
|
} else if (format === "duration") {
|
|
16870
|
-
stringSchema = stringSchema.check(
|
|
17001
|
+
stringSchema = stringSchema.check(z15.iso.duration());
|
|
16871
17002
|
} else if (format === "ipv4") {
|
|
16872
|
-
stringSchema = stringSchema.check(
|
|
17003
|
+
stringSchema = stringSchema.check(z15.ipv4());
|
|
16873
17004
|
} else if (format === "ipv6") {
|
|
16874
|
-
stringSchema = stringSchema.check(
|
|
17005
|
+
stringSchema = stringSchema.check(z15.ipv6());
|
|
16875
17006
|
} else if (format === "mac") {
|
|
16876
|
-
stringSchema = stringSchema.check(
|
|
17007
|
+
stringSchema = stringSchema.check(z15.mac());
|
|
16877
17008
|
} else if (format === "cidr") {
|
|
16878
|
-
stringSchema = stringSchema.check(
|
|
17009
|
+
stringSchema = stringSchema.check(z15.cidrv4());
|
|
16879
17010
|
} else if (format === "cidr-v6") {
|
|
16880
|
-
stringSchema = stringSchema.check(
|
|
17011
|
+
stringSchema = stringSchema.check(z15.cidrv6());
|
|
16881
17012
|
} else if (format === "base64") {
|
|
16882
|
-
stringSchema = stringSchema.check(
|
|
17013
|
+
stringSchema = stringSchema.check(z15.base64());
|
|
16883
17014
|
} else if (format === "base64url") {
|
|
16884
|
-
stringSchema = stringSchema.check(
|
|
17015
|
+
stringSchema = stringSchema.check(z15.base64url());
|
|
16885
17016
|
} else if (format === "e164") {
|
|
16886
|
-
stringSchema = stringSchema.check(
|
|
17017
|
+
stringSchema = stringSchema.check(z15.e164());
|
|
16887
17018
|
} else if (format === "jwt") {
|
|
16888
|
-
stringSchema = stringSchema.check(
|
|
17019
|
+
stringSchema = stringSchema.check(z15.jwt());
|
|
16889
17020
|
} else if (format === "emoji") {
|
|
16890
|
-
stringSchema = stringSchema.check(
|
|
17021
|
+
stringSchema = stringSchema.check(z15.emoji());
|
|
16891
17022
|
} else if (format === "nanoid") {
|
|
16892
|
-
stringSchema = stringSchema.check(
|
|
17023
|
+
stringSchema = stringSchema.check(z15.nanoid());
|
|
16893
17024
|
} else if (format === "cuid") {
|
|
16894
|
-
stringSchema = stringSchema.check(
|
|
17025
|
+
stringSchema = stringSchema.check(z15.cuid());
|
|
16895
17026
|
} else if (format === "cuid2") {
|
|
16896
|
-
stringSchema = stringSchema.check(
|
|
17027
|
+
stringSchema = stringSchema.check(z15.cuid2());
|
|
16897
17028
|
} else if (format === "ulid") {
|
|
16898
|
-
stringSchema = stringSchema.check(
|
|
17029
|
+
stringSchema = stringSchema.check(z15.ulid());
|
|
16899
17030
|
} else if (format === "xid") {
|
|
16900
|
-
stringSchema = stringSchema.check(
|
|
17031
|
+
stringSchema = stringSchema.check(z15.xid());
|
|
16901
17032
|
} else if (format === "ksuid") {
|
|
16902
|
-
stringSchema = stringSchema.check(
|
|
17033
|
+
stringSchema = stringSchema.check(z15.ksuid());
|
|
16903
17034
|
}
|
|
16904
17035
|
}
|
|
16905
17036
|
if (typeof schema.minLength === "number") {
|
|
@@ -16916,7 +17047,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
16916
17047
|
}
|
|
16917
17048
|
case "number":
|
|
16918
17049
|
case "integer": {
|
|
16919
|
-
let numberSchema = type === "integer" ?
|
|
17050
|
+
let numberSchema = type === "integer" ? z15.number().int() : z15.number();
|
|
16920
17051
|
if (typeof schema.minimum === "number") {
|
|
16921
17052
|
numberSchema = numberSchema.min(schema.minimum);
|
|
16922
17053
|
}
|
|
@@ -16940,11 +17071,11 @@ function convertBaseSchema(schema, ctx) {
|
|
|
16940
17071
|
break;
|
|
16941
17072
|
}
|
|
16942
17073
|
case "boolean": {
|
|
16943
|
-
zodSchema2 =
|
|
17074
|
+
zodSchema2 = z15.boolean();
|
|
16944
17075
|
break;
|
|
16945
17076
|
}
|
|
16946
17077
|
case "null": {
|
|
16947
|
-
zodSchema2 =
|
|
17078
|
+
zodSchema2 = z15.null();
|
|
16948
17079
|
break;
|
|
16949
17080
|
}
|
|
16950
17081
|
case "object": {
|
|
@@ -16957,14 +17088,14 @@ function convertBaseSchema(schema, ctx) {
|
|
|
16957
17088
|
}
|
|
16958
17089
|
if (schema.propertyNames) {
|
|
16959
17090
|
const keySchema = convertSchema(schema.propertyNames, ctx);
|
|
16960
|
-
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();
|
|
16961
17092
|
if (Object.keys(shape).length === 0) {
|
|
16962
|
-
zodSchema2 =
|
|
17093
|
+
zodSchema2 = z15.record(keySchema, valueSchema);
|
|
16963
17094
|
break;
|
|
16964
17095
|
}
|
|
16965
|
-
const objectSchema2 =
|
|
16966
|
-
const recordSchema =
|
|
16967
|
-
zodSchema2 =
|
|
17096
|
+
const objectSchema2 = z15.object(shape).passthrough();
|
|
17097
|
+
const recordSchema = z15.looseRecord(keySchema, valueSchema);
|
|
17098
|
+
zodSchema2 = z15.intersection(objectSchema2, recordSchema);
|
|
16968
17099
|
break;
|
|
16969
17100
|
}
|
|
16970
17101
|
if (schema.patternProperties) {
|
|
@@ -16973,28 +17104,28 @@ function convertBaseSchema(schema, ctx) {
|
|
|
16973
17104
|
const looseRecords = [];
|
|
16974
17105
|
for (const pattern of patternKeys) {
|
|
16975
17106
|
const patternValue = convertSchema(patternProps[pattern], ctx);
|
|
16976
|
-
const keySchema =
|
|
16977
|
-
looseRecords.push(
|
|
17107
|
+
const keySchema = z15.string().regex(new RegExp(pattern));
|
|
17108
|
+
looseRecords.push(z15.looseRecord(keySchema, patternValue));
|
|
16978
17109
|
}
|
|
16979
17110
|
const schemasToIntersect = [];
|
|
16980
17111
|
if (Object.keys(shape).length > 0) {
|
|
16981
|
-
schemasToIntersect.push(
|
|
17112
|
+
schemasToIntersect.push(z15.object(shape).passthrough());
|
|
16982
17113
|
}
|
|
16983
17114
|
schemasToIntersect.push(...looseRecords);
|
|
16984
17115
|
if (schemasToIntersect.length === 0) {
|
|
16985
|
-
zodSchema2 =
|
|
17116
|
+
zodSchema2 = z15.object({}).passthrough();
|
|
16986
17117
|
} else if (schemasToIntersect.length === 1) {
|
|
16987
17118
|
zodSchema2 = schemasToIntersect[0];
|
|
16988
17119
|
} else {
|
|
16989
|
-
let result =
|
|
17120
|
+
let result = z15.intersection(schemasToIntersect[0], schemasToIntersect[1]);
|
|
16990
17121
|
for (let i = 2; i < schemasToIntersect.length; i++) {
|
|
16991
|
-
result =
|
|
17122
|
+
result = z15.intersection(result, schemasToIntersect[i]);
|
|
16992
17123
|
}
|
|
16993
17124
|
zodSchema2 = result;
|
|
16994
17125
|
}
|
|
16995
17126
|
break;
|
|
16996
17127
|
}
|
|
16997
|
-
const objectSchema =
|
|
17128
|
+
const objectSchema = z15.object(shape);
|
|
16998
17129
|
if (schema.additionalProperties === false) {
|
|
16999
17130
|
zodSchema2 = objectSchema.strict();
|
|
17000
17131
|
} else if (typeof schema.additionalProperties === "object") {
|
|
@@ -17011,33 +17142,33 @@ function convertBaseSchema(schema, ctx) {
|
|
|
17011
17142
|
const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
|
|
17012
17143
|
const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0;
|
|
17013
17144
|
if (rest) {
|
|
17014
|
-
zodSchema2 =
|
|
17145
|
+
zodSchema2 = z15.tuple(tupleItems).rest(rest);
|
|
17015
17146
|
} else {
|
|
17016
|
-
zodSchema2 =
|
|
17147
|
+
zodSchema2 = z15.tuple(tupleItems);
|
|
17017
17148
|
}
|
|
17018
17149
|
if (typeof schema.minItems === "number") {
|
|
17019
|
-
zodSchema2 = zodSchema2.check(
|
|
17150
|
+
zodSchema2 = zodSchema2.check(z15.minLength(schema.minItems));
|
|
17020
17151
|
}
|
|
17021
17152
|
if (typeof schema.maxItems === "number") {
|
|
17022
|
-
zodSchema2 = zodSchema2.check(
|
|
17153
|
+
zodSchema2 = zodSchema2.check(z15.maxLength(schema.maxItems));
|
|
17023
17154
|
}
|
|
17024
17155
|
} else if (Array.isArray(items)) {
|
|
17025
17156
|
const tupleItems = items.map((item) => convertSchema(item, ctx));
|
|
17026
17157
|
const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : void 0;
|
|
17027
17158
|
if (rest) {
|
|
17028
|
-
zodSchema2 =
|
|
17159
|
+
zodSchema2 = z15.tuple(tupleItems).rest(rest);
|
|
17029
17160
|
} else {
|
|
17030
|
-
zodSchema2 =
|
|
17161
|
+
zodSchema2 = z15.tuple(tupleItems);
|
|
17031
17162
|
}
|
|
17032
17163
|
if (typeof schema.minItems === "number") {
|
|
17033
|
-
zodSchema2 = zodSchema2.check(
|
|
17164
|
+
zodSchema2 = zodSchema2.check(z15.minLength(schema.minItems));
|
|
17034
17165
|
}
|
|
17035
17166
|
if (typeof schema.maxItems === "number") {
|
|
17036
|
-
zodSchema2 = zodSchema2.check(
|
|
17167
|
+
zodSchema2 = zodSchema2.check(z15.maxLength(schema.maxItems));
|
|
17037
17168
|
}
|
|
17038
17169
|
} else if (items !== void 0) {
|
|
17039
17170
|
const element = convertSchema(items, ctx);
|
|
17040
|
-
let arraySchema =
|
|
17171
|
+
let arraySchema = z15.array(element);
|
|
17041
17172
|
if (typeof schema.minItems === "number") {
|
|
17042
17173
|
arraySchema = arraySchema.min(schema.minItems);
|
|
17043
17174
|
}
|
|
@@ -17046,7 +17177,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
17046
17177
|
}
|
|
17047
17178
|
zodSchema2 = arraySchema;
|
|
17048
17179
|
} else {
|
|
17049
|
-
zodSchema2 =
|
|
17180
|
+
zodSchema2 = z15.array(z15.any());
|
|
17050
17181
|
}
|
|
17051
17182
|
break;
|
|
17052
17183
|
}
|
|
@@ -17063,37 +17194,37 @@ function convertBaseSchema(schema, ctx) {
|
|
|
17063
17194
|
}
|
|
17064
17195
|
function convertSchema(schema, ctx) {
|
|
17065
17196
|
if (typeof schema === "boolean") {
|
|
17066
|
-
return schema ?
|
|
17197
|
+
return schema ? z15.any() : z15.never();
|
|
17067
17198
|
}
|
|
17068
17199
|
let baseSchema = convertBaseSchema(schema, ctx);
|
|
17069
17200
|
const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
|
|
17070
17201
|
if (schema.anyOf && Array.isArray(schema.anyOf)) {
|
|
17071
17202
|
const options = schema.anyOf.map((s) => convertSchema(s, ctx));
|
|
17072
|
-
const anyOfUnion =
|
|
17073
|
-
baseSchema = hasExplicitType ?
|
|
17203
|
+
const anyOfUnion = z15.union(options);
|
|
17204
|
+
baseSchema = hasExplicitType ? z15.intersection(baseSchema, anyOfUnion) : anyOfUnion;
|
|
17074
17205
|
}
|
|
17075
17206
|
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
17076
17207
|
const options = schema.oneOf.map((s) => convertSchema(s, ctx));
|
|
17077
|
-
const oneOfUnion =
|
|
17078
|
-
baseSchema = hasExplicitType ?
|
|
17208
|
+
const oneOfUnion = z15.xor(options);
|
|
17209
|
+
baseSchema = hasExplicitType ? z15.intersection(baseSchema, oneOfUnion) : oneOfUnion;
|
|
17079
17210
|
}
|
|
17080
17211
|
if (schema.allOf && Array.isArray(schema.allOf)) {
|
|
17081
17212
|
if (schema.allOf.length === 0) {
|
|
17082
|
-
baseSchema = hasExplicitType ? baseSchema :
|
|
17213
|
+
baseSchema = hasExplicitType ? baseSchema : z15.any();
|
|
17083
17214
|
} else {
|
|
17084
17215
|
let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
|
|
17085
17216
|
const startIdx = hasExplicitType ? 0 : 1;
|
|
17086
17217
|
for (let i = startIdx; i < schema.allOf.length; i++) {
|
|
17087
|
-
result =
|
|
17218
|
+
result = z15.intersection(result, convertSchema(schema.allOf[i], ctx));
|
|
17088
17219
|
}
|
|
17089
17220
|
baseSchema = result;
|
|
17090
17221
|
}
|
|
17091
17222
|
}
|
|
17092
17223
|
if (schema.nullable === true && ctx.version === "openapi-3.0") {
|
|
17093
|
-
baseSchema =
|
|
17224
|
+
baseSchema = z15.nullable(baseSchema);
|
|
17094
17225
|
}
|
|
17095
17226
|
if (schema.readOnly === true) {
|
|
17096
|
-
baseSchema =
|
|
17227
|
+
baseSchema = z15.readonly(baseSchema);
|
|
17097
17228
|
}
|
|
17098
17229
|
const extraMeta = {};
|
|
17099
17230
|
const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
|
|
@@ -17120,7 +17251,7 @@ function convertSchema(schema, ctx) {
|
|
|
17120
17251
|
}
|
|
17121
17252
|
function fromJSONSchema(schema, params) {
|
|
17122
17253
|
if (typeof schema === "boolean") {
|
|
17123
|
-
return schema ?
|
|
17254
|
+
return schema ? z15.any() : z15.never();
|
|
17124
17255
|
}
|
|
17125
17256
|
const version2 = detectVersion(schema, params?.defaultTarget);
|
|
17126
17257
|
const defs = schema.$defs || schema.definitions || {};
|
|
@@ -17134,14 +17265,14 @@ function fromJSONSchema(schema, params) {
|
|
|
17134
17265
|
};
|
|
17135
17266
|
return convertSchema(schema, ctx);
|
|
17136
17267
|
}
|
|
17137
|
-
var
|
|
17268
|
+
var z15, RECOGNIZED_KEYS;
|
|
17138
17269
|
var init_from_json_schema = __esm({
|
|
17139
17270
|
"node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/from-json-schema.js"() {
|
|
17140
17271
|
init_registries();
|
|
17141
17272
|
init_checks2();
|
|
17142
17273
|
init_iso();
|
|
17143
17274
|
init_schemas2();
|
|
17144
|
-
|
|
17275
|
+
z15 = {
|
|
17145
17276
|
...schemas_exports2,
|
|
17146
17277
|
...checks_exports2,
|
|
17147
17278
|
iso: iso_exports
|