@cleocode/adapters 2026.5.87 → 2026.5.88
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 +260 -220
- package/dist/index.js.map +3 -3
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -777,6 +777,45 @@ var init_branch_lock = __esm({
|
|
|
777
777
|
}
|
|
778
778
|
});
|
|
779
779
|
|
|
780
|
+
// packages/contracts/src/changesets.ts
|
|
781
|
+
import { z as z3 } from "zod";
|
|
782
|
+
var CHANGESET_KINDS, TASK_ID_RE, ChangesetEntrySchema;
|
|
783
|
+
var init_changesets = __esm({
|
|
784
|
+
"packages/contracts/src/changesets.ts"() {
|
|
785
|
+
"use strict";
|
|
786
|
+
CHANGESET_KINDS = [
|
|
787
|
+
"feat",
|
|
788
|
+
"fix",
|
|
789
|
+
"perf",
|
|
790
|
+
"refactor",
|
|
791
|
+
"docs",
|
|
792
|
+
"test",
|
|
793
|
+
"chore",
|
|
794
|
+
"breaking"
|
|
795
|
+
];
|
|
796
|
+
TASK_ID_RE = /^(T\d+(-[A-Z][A-Za-z0-9]*)?|E-\d+(-[A-Z][A-Za-z0-9]*)?)$/;
|
|
797
|
+
ChangesetEntrySchema = z3.object({
|
|
798
|
+
/** Filename slug (without the `.md` extension). */
|
|
799
|
+
id: z3.string().min(1, "id must be non-empty").regex(/^[a-z0-9][a-z0-9-]*$/, "id must be kebab-case (lowercase, digits, hyphens)"),
|
|
800
|
+
/** One or more CLEO task IDs this change is anchored to. */
|
|
801
|
+
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"),
|
|
802
|
+
/** Type of change. */
|
|
803
|
+
kind: z3.enum(CHANGESET_KINDS),
|
|
804
|
+
/** Single-line user-facing description. */
|
|
805
|
+
summary: z3.string().min(1, "summary must be non-empty"),
|
|
806
|
+
/** Linked PR numbers, when known. */
|
|
807
|
+
prs: z3.array(z3.number().int().positive()).optional(),
|
|
808
|
+
/** Markdown body — longer-form explanation. */
|
|
809
|
+
notes: z3.string().optional(),
|
|
810
|
+
/** Migration note. Required iff `kind === 'breaking'`. */
|
|
811
|
+
breaking: z3.string().optional()
|
|
812
|
+
}).refine((entry) => entry.kind !== "breaking" || (entry.breaking?.length ?? 0) > 0, {
|
|
813
|
+
message: "breaking entries must include a non-empty `breaking` migration note",
|
|
814
|
+
path: ["breaking"]
|
|
815
|
+
});
|
|
816
|
+
}
|
|
817
|
+
});
|
|
818
|
+
|
|
780
819
|
// packages/contracts/src/credentials.ts
|
|
781
820
|
function parseClaudeCodeCredentials(buf) {
|
|
782
821
|
try {
|
|
@@ -843,58 +882,58 @@ var init_errors = __esm({
|
|
|
843
882
|
});
|
|
844
883
|
|
|
845
884
|
// packages/contracts/src/evidence-record-schema.ts
|
|
846
|
-
import { z as
|
|
885
|
+
import { z as z4 } from "zod";
|
|
847
886
|
var evidenceBaseSchema, implDiffRecordSchema, validateSpecCheckRecordSchema, testOutputRecordSchema, lintReportRecordSchema, commandOutputRecordSchema, evidenceRecordSchema;
|
|
848
887
|
var init_evidence_record_schema = __esm({
|
|
849
888
|
"packages/contracts/src/evidence-record-schema.ts"() {
|
|
850
889
|
"use strict";
|
|
851
|
-
evidenceBaseSchema =
|
|
890
|
+
evidenceBaseSchema = z4.object({
|
|
852
891
|
/** Identity string of the agent that produced this record. */
|
|
853
|
-
agentIdentity:
|
|
892
|
+
agentIdentity: z4.string().min(1),
|
|
854
893
|
/** SHA-256 hex digest (64 chars) of the attached artifact. */
|
|
855
|
-
attachmentSha256:
|
|
894
|
+
attachmentSha256: z4.string().length(64),
|
|
856
895
|
/** ISO 8601 timestamp at which the action ran. */
|
|
857
|
-
ranAt:
|
|
896
|
+
ranAt: z4.string().datetime(),
|
|
858
897
|
/** Wall-clock duration of the action in milliseconds. */
|
|
859
|
-
durationMs:
|
|
898
|
+
durationMs: z4.number().nonnegative()
|
|
860
899
|
});
|
|
861
900
|
implDiffRecordSchema = evidenceBaseSchema.extend({
|
|
862
|
-
kind:
|
|
863
|
-
phase:
|
|
864
|
-
filesChanged:
|
|
865
|
-
linesAdded:
|
|
866
|
-
linesRemoved:
|
|
901
|
+
kind: z4.literal("impl-diff"),
|
|
902
|
+
phase: z4.literal("implement"),
|
|
903
|
+
filesChanged: z4.array(z4.string().min(1)).min(1),
|
|
904
|
+
linesAdded: z4.number().int().nonnegative(),
|
|
905
|
+
linesRemoved: z4.number().int().nonnegative()
|
|
867
906
|
});
|
|
868
907
|
validateSpecCheckRecordSchema = evidenceBaseSchema.extend({
|
|
869
|
-
kind:
|
|
870
|
-
phase:
|
|
871
|
-
reqIdsChecked:
|
|
872
|
-
passed:
|
|
873
|
-
details:
|
|
908
|
+
kind: z4.literal("validate-spec-check"),
|
|
909
|
+
phase: z4.literal("validate"),
|
|
910
|
+
reqIdsChecked: z4.array(z4.string().min(1)).min(1),
|
|
911
|
+
passed: z4.boolean(),
|
|
912
|
+
details: z4.string().min(1)
|
|
874
913
|
});
|
|
875
914
|
testOutputRecordSchema = evidenceBaseSchema.extend({
|
|
876
|
-
kind:
|
|
877
|
-
phase:
|
|
878
|
-
command:
|
|
879
|
-
exitCode:
|
|
880
|
-
testsPassed:
|
|
881
|
-
testsFailed:
|
|
915
|
+
kind: z4.literal("test-output"),
|
|
916
|
+
phase: z4.literal("test"),
|
|
917
|
+
command: z4.string().min(1),
|
|
918
|
+
exitCode: z4.number().int(),
|
|
919
|
+
testsPassed: z4.number().int().nonnegative(),
|
|
920
|
+
testsFailed: z4.number().int().nonnegative()
|
|
882
921
|
});
|
|
883
922
|
lintReportRecordSchema = evidenceBaseSchema.extend({
|
|
884
|
-
kind:
|
|
885
|
-
phase:
|
|
886
|
-
tool:
|
|
887
|
-
passed:
|
|
888
|
-
warnings:
|
|
889
|
-
errors:
|
|
923
|
+
kind: z4.literal("lint-report"),
|
|
924
|
+
phase: z4.enum(["implement", "test"]),
|
|
925
|
+
tool: z4.string().min(1),
|
|
926
|
+
passed: z4.boolean(),
|
|
927
|
+
warnings: z4.number().int().nonnegative(),
|
|
928
|
+
errors: z4.number().int().nonnegative()
|
|
890
929
|
});
|
|
891
930
|
commandOutputRecordSchema = evidenceBaseSchema.extend({
|
|
892
|
-
kind:
|
|
893
|
-
phase:
|
|
894
|
-
cmd:
|
|
895
|
-
exitCode:
|
|
931
|
+
kind: z4.literal("command-output"),
|
|
932
|
+
phase: z4.enum(["implement", "validate", "test"]),
|
|
933
|
+
cmd: z4.string().min(1),
|
|
934
|
+
exitCode: z4.number().int()
|
|
896
935
|
});
|
|
897
|
-
evidenceRecordSchema =
|
|
936
|
+
evidenceRecordSchema = z4.discriminatedUnion("kind", [
|
|
898
937
|
implDiffRecordSchema,
|
|
899
938
|
validateSpecCheckRecordSchema,
|
|
900
939
|
testOutputRecordSchema,
|
|
@@ -1170,7 +1209,7 @@ var init_peer = __esm({
|
|
|
1170
1209
|
});
|
|
1171
1210
|
|
|
1172
1211
|
// packages/contracts/src/release/plan.ts
|
|
1173
|
-
import { z as
|
|
1212
|
+
import { z as z5 } from "zod";
|
|
1174
1213
|
var RELEASE_CHANNEL, RELEASE_SCHEME, RELEASE_KIND, RELEASE_STATUS, GATE_STATUS, GATE_NAME, PLATFORM_TUPLE, PUBLISHER, TASK_KIND, IMPACT, RESOLVED_SOURCE, ReleaseChannelSchema, ReleaseSchemeSchema, ReleaseKindSchema, ReleaseStatusSchema, GateStatusSchema, GateNameSchema, PlatformTupleSchema, PublisherSchema, TaskKindSchema, ImpactSchema, ResolvedSourceSchema, Iso8601, NonEmptyString, ReleasePlanTaskSchema, ReleaseGateSchema, ReleasePlatformMatrixEntrySchema, ReleasePreflightSummarySchema, ReleasePlanChangelogSchema, ReleasePlanMetaSchema, ReleasePlanSchema;
|
|
1175
1214
|
var init_plan = __esm({
|
|
1176
1215
|
"packages/contracts/src/release/plan.ts"() {
|
|
@@ -1213,20 +1252,20 @@ var init_plan = __esm({
|
|
|
1213
1252
|
];
|
|
1214
1253
|
IMPACT = ["major", "minor", "patch"];
|
|
1215
1254
|
RESOLVED_SOURCE = ["project-context", "language-default", "legacy-alias"];
|
|
1216
|
-
ReleaseChannelSchema =
|
|
1217
|
-
ReleaseSchemeSchema =
|
|
1218
|
-
ReleaseKindSchema =
|
|
1219
|
-
ReleaseStatusSchema =
|
|
1220
|
-
GateStatusSchema =
|
|
1221
|
-
GateNameSchema =
|
|
1222
|
-
PlatformTupleSchema =
|
|
1223
|
-
PublisherSchema =
|
|
1224
|
-
TaskKindSchema =
|
|
1225
|
-
ImpactSchema =
|
|
1226
|
-
ResolvedSourceSchema =
|
|
1227
|
-
Iso8601 =
|
|
1228
|
-
NonEmptyString =
|
|
1229
|
-
ReleasePlanTaskSchema =
|
|
1255
|
+
ReleaseChannelSchema = z5.enum(RELEASE_CHANNEL);
|
|
1256
|
+
ReleaseSchemeSchema = z5.enum(RELEASE_SCHEME);
|
|
1257
|
+
ReleaseKindSchema = z5.enum(RELEASE_KIND);
|
|
1258
|
+
ReleaseStatusSchema = z5.enum(RELEASE_STATUS);
|
|
1259
|
+
GateStatusSchema = z5.enum(GATE_STATUS);
|
|
1260
|
+
GateNameSchema = z5.enum(GATE_NAME);
|
|
1261
|
+
PlatformTupleSchema = z5.enum(PLATFORM_TUPLE);
|
|
1262
|
+
PublisherSchema = z5.enum(PUBLISHER);
|
|
1263
|
+
TaskKindSchema = z5.enum(TASK_KIND);
|
|
1264
|
+
ImpactSchema = z5.enum(IMPACT);
|
|
1265
|
+
ResolvedSourceSchema = z5.enum(RESOLVED_SOURCE);
|
|
1266
|
+
Iso8601 = z5.iso.datetime({ offset: true });
|
|
1267
|
+
NonEmptyString = z5.string().min(1);
|
|
1268
|
+
ReleasePlanTaskSchema = z5.object({
|
|
1230
1269
|
/** Task ID (e.g. "T10001"). Format intentionally loose so historical IDs validate. */
|
|
1231
1270
|
id: NonEmptyString,
|
|
1232
1271
|
/** Conventional-commit-aligned task classification. */
|
|
@@ -1234,20 +1273,20 @@ var init_plan = __esm({
|
|
|
1234
1273
|
/** SemVer impact classification. */
|
|
1235
1274
|
impact: ImpactSchema,
|
|
1236
1275
|
/** Human-readable changelog line for this task. */
|
|
1237
|
-
userFacingSummary:
|
|
1276
|
+
userFacingSummary: z5.string(),
|
|
1238
1277
|
/**
|
|
1239
1278
|
* ADR-051 evidence atoms attesting the task's gate results. Format is
|
|
1240
1279
|
* `kind:value` (e.g. `commit:abc123`, `test-run:vitest.json`). The contract
|
|
1241
1280
|
* accepts empty arrays so legacy plans validate; `cleo release plan`
|
|
1242
1281
|
* enforces non-empty via R-301.
|
|
1243
1282
|
*/
|
|
1244
|
-
evidenceAtoms:
|
|
1283
|
+
evidenceAtoms: z5.array(NonEmptyString),
|
|
1245
1284
|
/** IVTR phase at plan time — informational only per R-316. */
|
|
1246
|
-
ivtrPhaseAtPlan:
|
|
1285
|
+
ivtrPhaseAtPlan: z5.string().optional(),
|
|
1247
1286
|
/** Epic this task rolls up to, locked at plan time per R-303. */
|
|
1248
1287
|
epicAncestor: NonEmptyString
|
|
1249
1288
|
});
|
|
1250
|
-
ReleaseGateSchema =
|
|
1289
|
+
ReleaseGateSchema = z5.object({
|
|
1251
1290
|
/** Canonical gate name. */
|
|
1252
1291
|
name: GateNameSchema,
|
|
1253
1292
|
/** ADR-051 atom string identifying the resolved tool (e.g. `tool:test`). */
|
|
@@ -1257,11 +1296,11 @@ var init_plan = __esm({
|
|
|
1257
1296
|
/** ISO-8601 timestamp the gate was last verified. */
|
|
1258
1297
|
lastVerifiedAt: Iso8601,
|
|
1259
1298
|
/** Resolved shell command (e.g. `pnpm run test`). Optional for unresolved gates. */
|
|
1260
|
-
resolvedCommand:
|
|
1299
|
+
resolvedCommand: z5.string().optional(),
|
|
1261
1300
|
/** Provenance of the resolved command. Optional for unresolved gates. */
|
|
1262
1301
|
resolvedSource: ResolvedSourceSchema.optional()
|
|
1263
1302
|
});
|
|
1264
|
-
ReleasePlatformMatrixEntrySchema =
|
|
1303
|
+
ReleasePlatformMatrixEntrySchema = z5.object({
|
|
1265
1304
|
/** Target platform tuple. */
|
|
1266
1305
|
platform: PlatformTupleSchema,
|
|
1267
1306
|
/** Distribution backend. */
|
|
@@ -1269,47 +1308,47 @@ var init_plan = __esm({
|
|
|
1269
1308
|
/** Package identifier on the target backend (e.g. `@cleocode/cleo`). */
|
|
1270
1309
|
package: NonEmptyString,
|
|
1271
1310
|
/** Whether to run the GHA smoke job for this matrix entry. */
|
|
1272
|
-
smoke:
|
|
1311
|
+
smoke: z5.boolean().default(true).optional()
|
|
1273
1312
|
});
|
|
1274
|
-
ReleasePreflightSummarySchema =
|
|
1313
|
+
ReleasePreflightSummarySchema = z5.object({
|
|
1275
1314
|
/** True if esbuild externals are out of sync with package.json. */
|
|
1276
|
-
esbuildExternalsDrift:
|
|
1315
|
+
esbuildExternalsDrift: z5.boolean(),
|
|
1277
1316
|
/** True if `pnpm-lock.yaml` diverges from the workspace manifest. */
|
|
1278
|
-
lockfileDrift:
|
|
1317
|
+
lockfileDrift: z5.boolean(),
|
|
1279
1318
|
/** True if all epic children are in terminal lifecycle states. */
|
|
1280
|
-
epicCompletenessClean:
|
|
1319
|
+
epicCompletenessClean: z5.boolean(),
|
|
1281
1320
|
/** True if no task appears in multiple in-flight release plans. */
|
|
1282
|
-
doubleListingClean:
|
|
1321
|
+
doubleListingClean: z5.boolean(),
|
|
1283
1322
|
/** Non-fatal preflight warnings (e.g. unresolved tools per R-024). */
|
|
1284
|
-
preflightWarnings:
|
|
1323
|
+
preflightWarnings: z5.array(z5.string()).default([]).optional()
|
|
1285
1324
|
});
|
|
1286
|
-
ReleasePlanChangelogSchema =
|
|
1325
|
+
ReleasePlanChangelogSchema = z5.object({
|
|
1287
1326
|
/** `kind=feat` tasks. */
|
|
1288
|
-
features:
|
|
1327
|
+
features: z5.array(NonEmptyString).default([]),
|
|
1289
1328
|
/** `kind=fix` or `kind=hotfix` tasks. */
|
|
1290
|
-
fixes:
|
|
1329
|
+
fixes: z5.array(NonEmptyString).default([]),
|
|
1291
1330
|
/** `kind=chore`, `docs`, `refactor`, `test`, `perf` tasks. */
|
|
1292
|
-
chores:
|
|
1331
|
+
chores: z5.array(NonEmptyString).default([]),
|
|
1293
1332
|
/** `kind=breaking` or `kind=revert` tasks. */
|
|
1294
|
-
breaking:
|
|
1333
|
+
breaking: z5.array(NonEmptyString).default([])
|
|
1295
1334
|
});
|
|
1296
|
-
ReleasePlanMetaSchema =
|
|
1335
|
+
ReleasePlanMetaSchema = z5.object({
|
|
1297
1336
|
/** True if this is the project's first ever release. */
|
|
1298
|
-
firstEverRelease:
|
|
1337
|
+
firstEverRelease: z5.boolean().optional(),
|
|
1299
1338
|
/** Canonical tool names that could not be resolved at plan time. */
|
|
1300
|
-
unresolvedTools:
|
|
1339
|
+
unresolvedTools: z5.array(z5.string()).optional(),
|
|
1301
1340
|
/** Project archetype detected at plan time. */
|
|
1302
|
-
archetype:
|
|
1303
|
-
}).catchall(
|
|
1304
|
-
ReleasePlanSchema =
|
|
1341
|
+
archetype: z5.string().optional()
|
|
1342
|
+
}).catchall(z5.unknown());
|
|
1343
|
+
ReleasePlanSchema = z5.object({
|
|
1305
1344
|
/** Schema URL for this plan version. */
|
|
1306
|
-
$schema:
|
|
1345
|
+
$schema: z5.string().optional(),
|
|
1307
1346
|
/** Requested version string (e.g. "v2026.6.0"). Includes the leading `v`. */
|
|
1308
1347
|
version: NonEmptyString,
|
|
1309
1348
|
/** Resolved version string after suffix application (e.g. "v2026.6.0.2"). */
|
|
1310
1349
|
resolvedVersion: NonEmptyString,
|
|
1311
1350
|
/** True if a `calver-suffix` was applied to disambiguate a same-day hotfix. */
|
|
1312
|
-
suffixApplied:
|
|
1351
|
+
suffixApplied: z5.boolean(),
|
|
1313
1352
|
/** Versioning scheme governing `version` / `resolvedVersion`. */
|
|
1314
1353
|
scheme: ReleaseSchemeSchema,
|
|
1315
1354
|
/** npm dist-tag channel for this release. */
|
|
@@ -1326,27 +1365,27 @@ var init_plan = __esm({
|
|
|
1326
1365
|
* Version of the previous release on the same channel. MUST be `null` only
|
|
1327
1366
|
* for first-ever releases (R-300, enforced at the verb layer).
|
|
1328
1367
|
*/
|
|
1329
|
-
previousVersion:
|
|
1368
|
+
previousVersion: z5.string().nullable(),
|
|
1330
1369
|
/** Git tag of the previous release (typically `previousVersion` prefixed). */
|
|
1331
|
-
previousTag:
|
|
1370
|
+
previousTag: z5.string().nullable(),
|
|
1332
1371
|
/** ISO-8601 timestamp the previous release was published. */
|
|
1333
1372
|
previousShippedAt: Iso8601.nullable(),
|
|
1334
1373
|
/** Tasks rolled into this release. */
|
|
1335
|
-
tasks:
|
|
1374
|
+
tasks: z5.array(ReleasePlanTaskSchema),
|
|
1336
1375
|
/** Bucketed changelog. */
|
|
1337
1376
|
changelog: ReleasePlanChangelogSchema,
|
|
1338
1377
|
/** Per-gate verification status. */
|
|
1339
|
-
gates:
|
|
1378
|
+
gates: z5.array(ReleaseGateSchema),
|
|
1340
1379
|
/** Platform / publisher matrix. */
|
|
1341
|
-
platformMatrix:
|
|
1380
|
+
platformMatrix: z5.array(ReleasePlatformMatrixEntrySchema),
|
|
1342
1381
|
/** Preflight summary from `cleo release plan`. */
|
|
1343
1382
|
preflightSummary: ReleasePreflightSummarySchema,
|
|
1344
1383
|
/** URL of the GHA workflow run (populated by `release-prepare.yml`). */
|
|
1345
|
-
workflowRunUrl:
|
|
1384
|
+
workflowRunUrl: z5.string().nullable(),
|
|
1346
1385
|
/** URL of the bump PR (populated by `cleo release open`). */
|
|
1347
|
-
prUrl:
|
|
1386
|
+
prUrl: z5.string().nullable(),
|
|
1348
1387
|
/** Merge commit SHA on `main` (populated by `release-publish.yml`). */
|
|
1349
|
-
mergeCommitSha:
|
|
1388
|
+
mergeCommitSha: z5.string().nullable(),
|
|
1350
1389
|
/** Current FSM state per R-302. */
|
|
1351
1390
|
status: ReleaseStatusSchema,
|
|
1352
1391
|
/** Informational / forward-compat metadata. */
|
|
@@ -1363,52 +1402,52 @@ var init_session2 = __esm({
|
|
|
1363
1402
|
});
|
|
1364
1403
|
|
|
1365
1404
|
// packages/contracts/src/session-journal.ts
|
|
1366
|
-
import { z as
|
|
1405
|
+
import { z as z6 } from "zod";
|
|
1367
1406
|
var SESSION_JOURNAL_SCHEMA_VERSION, sessionJournalDoctorSummarySchema, sessionJournalDebriefSummarySchema, sessionJournalEntrySchema;
|
|
1368
1407
|
var init_session_journal = __esm({
|
|
1369
1408
|
"packages/contracts/src/session-journal.ts"() {
|
|
1370
1409
|
"use strict";
|
|
1371
1410
|
SESSION_JOURNAL_SCHEMA_VERSION = "1.0";
|
|
1372
|
-
sessionJournalDoctorSummarySchema =
|
|
1411
|
+
sessionJournalDoctorSummarySchema = z6.object({
|
|
1373
1412
|
/** `true` when zero noise patterns were detected. */
|
|
1374
|
-
isClean:
|
|
1413
|
+
isClean: z6.boolean(),
|
|
1375
1414
|
/** Total number of noise findings across all patterns. */
|
|
1376
|
-
findingsCount:
|
|
1415
|
+
findingsCount: z6.number().int().nonnegative(),
|
|
1377
1416
|
/** Pattern names that were detected (empty when isClean). */
|
|
1378
|
-
patterns:
|
|
1417
|
+
patterns: z6.array(z6.string()),
|
|
1379
1418
|
/** Total brain entries scanned. `0` = empty or unavailable. */
|
|
1380
|
-
totalScanned:
|
|
1419
|
+
totalScanned: z6.number().int().nonnegative()
|
|
1381
1420
|
});
|
|
1382
|
-
sessionJournalDebriefSummarySchema =
|
|
1421
|
+
sessionJournalDebriefSummarySchema = z6.object({
|
|
1383
1422
|
/** First 200 characters of the session end note (if provided). */
|
|
1384
|
-
noteExcerpt:
|
|
1423
|
+
noteExcerpt: z6.string().max(200).optional(),
|
|
1385
1424
|
/** Number of tasks completed during the session. */
|
|
1386
|
-
tasksCompletedCount:
|
|
1425
|
+
tasksCompletedCount: z6.number().int().nonnegative(),
|
|
1387
1426
|
/** Up to 5 task IDs (not titles) that were the focus of the session. */
|
|
1388
|
-
tasksFocused:
|
|
1427
|
+
tasksFocused: z6.array(z6.string()).max(5).optional()
|
|
1389
1428
|
});
|
|
1390
|
-
sessionJournalEntrySchema =
|
|
1429
|
+
sessionJournalEntrySchema = z6.object({
|
|
1391
1430
|
// Identity
|
|
1392
1431
|
/** Schema version for forward-compatibility. Always `'1.0'` in this release. */
|
|
1393
|
-
schemaVersion:
|
|
1432
|
+
schemaVersion: z6.literal(SESSION_JOURNAL_SCHEMA_VERSION),
|
|
1394
1433
|
/** ISO 8601 timestamp when the entry was written. */
|
|
1395
|
-
timestamp:
|
|
1434
|
+
timestamp: z6.string(),
|
|
1396
1435
|
/** CLEO session ID (e.g. `ses_20260424055456_ede571`). */
|
|
1397
|
-
sessionId:
|
|
1436
|
+
sessionId: z6.string(),
|
|
1398
1437
|
/** Event type that triggered this journal entry. */
|
|
1399
|
-
eventType:
|
|
1438
|
+
eventType: z6.enum(["session_start", "session_end", "observation", "decision", "error"]),
|
|
1400
1439
|
// Session metadata (set on session_start / session_end)
|
|
1401
1440
|
/** Agent identifier (e.g. `cleo-prime`, `claude-code`). */
|
|
1402
|
-
agentIdentifier:
|
|
1441
|
+
agentIdentifier: z6.string().optional(),
|
|
1403
1442
|
/** Provider adapter ID active for this session. */
|
|
1404
|
-
providerId:
|
|
1443
|
+
providerId: z6.string().optional(),
|
|
1405
1444
|
/** Session scope string (e.g. `'global'` or `'epic:T1263'`). */
|
|
1406
|
-
scope:
|
|
1445
|
+
scope: z6.string().optional(),
|
|
1407
1446
|
// Session-end fields
|
|
1408
1447
|
/** Duration of the session in seconds (session_end only). */
|
|
1409
|
-
duration:
|
|
1448
|
+
duration: z6.number().int().nonnegative().optional(),
|
|
1410
1449
|
/** Task IDs (not titles) completed during the session. */
|
|
1411
|
-
tasksCompleted:
|
|
1450
|
+
tasksCompleted: z6.array(z6.string()).optional(),
|
|
1412
1451
|
// Doctor summary (T1262 absorbed)
|
|
1413
1452
|
/** Compact result of `scanBrainNoise` run at session-end. */
|
|
1414
1453
|
doctorSummary: sessionJournalDoctorSummarySchema.optional(),
|
|
@@ -1417,7 +1456,7 @@ var init_session_journal = __esm({
|
|
|
1417
1456
|
debriefSummary: sessionJournalDebriefSummarySchema.optional(),
|
|
1418
1457
|
// Optional hash chain
|
|
1419
1458
|
/** SHA-256 hex of the previous entry's raw JSON string (for integrity chain). */
|
|
1420
|
-
prevEntryHash:
|
|
1459
|
+
prevEntryHash: z6.string().optional()
|
|
1421
1460
|
});
|
|
1422
1461
|
}
|
|
1423
1462
|
});
|
|
@@ -1437,52 +1476,52 @@ var init_task = __esm({
|
|
|
1437
1476
|
});
|
|
1438
1477
|
|
|
1439
1478
|
// packages/contracts/src/task-evidence.ts
|
|
1440
|
-
import { z as
|
|
1479
|
+
import { z as z7 } from "zod";
|
|
1441
1480
|
var fileEvidenceSchema, logEvidenceSchema, screenshotEvidenceSchema, testOutputEvidenceSchema, commandOutputEvidenceSchema, taskEvidenceSchema;
|
|
1442
1481
|
var init_task_evidence = __esm({
|
|
1443
1482
|
"packages/contracts/src/task-evidence.ts"() {
|
|
1444
1483
|
"use strict";
|
|
1445
|
-
fileEvidenceSchema =
|
|
1446
|
-
kind:
|
|
1447
|
-
sha256:
|
|
1448
|
-
timestamp:
|
|
1449
|
-
path:
|
|
1450
|
-
mime:
|
|
1451
|
-
description:
|
|
1452
|
-
});
|
|
1453
|
-
logEvidenceSchema =
|
|
1454
|
-
kind:
|
|
1455
|
-
sha256:
|
|
1456
|
-
timestamp:
|
|
1457
|
-
source:
|
|
1458
|
-
description:
|
|
1459
|
-
});
|
|
1460
|
-
screenshotEvidenceSchema =
|
|
1461
|
-
kind:
|
|
1462
|
-
sha256:
|
|
1463
|
-
timestamp:
|
|
1464
|
-
mime:
|
|
1465
|
-
description:
|
|
1466
|
-
});
|
|
1467
|
-
testOutputEvidenceSchema =
|
|
1468
|
-
kind:
|
|
1469
|
-
sha256:
|
|
1470
|
-
timestamp:
|
|
1471
|
-
passed:
|
|
1472
|
-
failed:
|
|
1473
|
-
skipped:
|
|
1474
|
-
exitCode:
|
|
1475
|
-
description:
|
|
1476
|
-
});
|
|
1477
|
-
commandOutputEvidenceSchema =
|
|
1478
|
-
kind:
|
|
1479
|
-
sha256:
|
|
1480
|
-
timestamp:
|
|
1481
|
-
cmd:
|
|
1482
|
-
exitCode:
|
|
1483
|
-
description:
|
|
1484
|
-
});
|
|
1485
|
-
taskEvidenceSchema =
|
|
1484
|
+
fileEvidenceSchema = z7.object({
|
|
1485
|
+
kind: z7.literal("file"),
|
|
1486
|
+
sha256: z7.string().length(64),
|
|
1487
|
+
timestamp: z7.string().datetime(),
|
|
1488
|
+
path: z7.string().min(1),
|
|
1489
|
+
mime: z7.string().optional(),
|
|
1490
|
+
description: z7.string().optional()
|
|
1491
|
+
});
|
|
1492
|
+
logEvidenceSchema = z7.object({
|
|
1493
|
+
kind: z7.literal("log"),
|
|
1494
|
+
sha256: z7.string().length(64),
|
|
1495
|
+
timestamp: z7.string().datetime(),
|
|
1496
|
+
source: z7.string().min(1),
|
|
1497
|
+
description: z7.string().optional()
|
|
1498
|
+
});
|
|
1499
|
+
screenshotEvidenceSchema = z7.object({
|
|
1500
|
+
kind: z7.literal("screenshot"),
|
|
1501
|
+
sha256: z7.string().length(64),
|
|
1502
|
+
timestamp: z7.string().datetime(),
|
|
1503
|
+
mime: z7.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
|
|
1504
|
+
description: z7.string().optional()
|
|
1505
|
+
});
|
|
1506
|
+
testOutputEvidenceSchema = z7.object({
|
|
1507
|
+
kind: z7.literal("test-output"),
|
|
1508
|
+
sha256: z7.string().length(64),
|
|
1509
|
+
timestamp: z7.string().datetime(),
|
|
1510
|
+
passed: z7.number().int().nonnegative(),
|
|
1511
|
+
failed: z7.number().int().nonnegative(),
|
|
1512
|
+
skipped: z7.number().int().nonnegative(),
|
|
1513
|
+
exitCode: z7.number().int(),
|
|
1514
|
+
description: z7.string().optional()
|
|
1515
|
+
});
|
|
1516
|
+
commandOutputEvidenceSchema = z7.object({
|
|
1517
|
+
kind: z7.literal("command-output"),
|
|
1518
|
+
sha256: z7.string().length(64),
|
|
1519
|
+
timestamp: z7.string().datetime(),
|
|
1520
|
+
cmd: z7.string().min(1),
|
|
1521
|
+
exitCode: z7.number().int(),
|
|
1522
|
+
description: z7.string().optional()
|
|
1523
|
+
});
|
|
1524
|
+
taskEvidenceSchema = z7.discriminatedUnion("kind", [
|
|
1486
1525
|
fileEvidenceSchema,
|
|
1487
1526
|
logEvidenceSchema,
|
|
1488
1527
|
screenshotEvidenceSchema,
|
|
@@ -1493,12 +1532,12 @@ var init_task_evidence = __esm({
|
|
|
1493
1532
|
});
|
|
1494
1533
|
|
|
1495
1534
|
// packages/contracts/src/tasks/archive.ts
|
|
1496
|
-
import { z as
|
|
1535
|
+
import { z as z8 } from "zod";
|
|
1497
1536
|
var ArchiveReason, ARCHIVE_REASON_VALUES;
|
|
1498
1537
|
var init_archive = __esm({
|
|
1499
1538
|
"packages/contracts/src/tasks/archive.ts"() {
|
|
1500
1539
|
"use strict";
|
|
1501
|
-
ArchiveReason =
|
|
1540
|
+
ArchiveReason = z8.enum([
|
|
1502
1541
|
"verified",
|
|
1503
1542
|
"reconciled",
|
|
1504
1543
|
"superseded",
|
|
@@ -1516,6 +1555,7 @@ var init_src = __esm({
|
|
|
1516
1555
|
init_acceptance_gate_schema();
|
|
1517
1556
|
init_attachment_schema();
|
|
1518
1557
|
init_branch_lock();
|
|
1558
|
+
init_changesets();
|
|
1519
1559
|
init_credentials();
|
|
1520
1560
|
init_engine_result();
|
|
1521
1561
|
init_errors();
|
|
@@ -15555,7 +15595,7 @@ function resolveRef(ref, ctx) {
|
|
|
15555
15595
|
function convertBaseSchema(schema, ctx) {
|
|
15556
15596
|
if (schema.not !== void 0) {
|
|
15557
15597
|
if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
|
|
15558
|
-
return
|
|
15598
|
+
return z9.never();
|
|
15559
15599
|
}
|
|
15560
15600
|
throw new Error("not is not supported in Zod (except { not: {} } for never)");
|
|
15561
15601
|
}
|
|
@@ -15577,7 +15617,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15577
15617
|
return ctx.refs.get(refPath);
|
|
15578
15618
|
}
|
|
15579
15619
|
if (ctx.processing.has(refPath)) {
|
|
15580
|
-
return
|
|
15620
|
+
return z9.lazy(() => {
|
|
15581
15621
|
if (!ctx.refs.has(refPath)) {
|
|
15582
15622
|
throw new Error(`Circular reference not resolved: ${refPath}`);
|
|
15583
15623
|
}
|
|
@@ -15594,25 +15634,25 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15594
15634
|
if (schema.enum !== void 0) {
|
|
15595
15635
|
const enumValues = schema.enum;
|
|
15596
15636
|
if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
|
|
15597
|
-
return
|
|
15637
|
+
return z9.null();
|
|
15598
15638
|
}
|
|
15599
15639
|
if (enumValues.length === 0) {
|
|
15600
|
-
return
|
|
15640
|
+
return z9.never();
|
|
15601
15641
|
}
|
|
15602
15642
|
if (enumValues.length === 1) {
|
|
15603
|
-
return
|
|
15643
|
+
return z9.literal(enumValues[0]);
|
|
15604
15644
|
}
|
|
15605
15645
|
if (enumValues.every((v) => typeof v === "string")) {
|
|
15606
|
-
return
|
|
15646
|
+
return z9.enum(enumValues);
|
|
15607
15647
|
}
|
|
15608
|
-
const literalSchemas = enumValues.map((v) =>
|
|
15648
|
+
const literalSchemas = enumValues.map((v) => z9.literal(v));
|
|
15609
15649
|
if (literalSchemas.length < 2) {
|
|
15610
15650
|
return literalSchemas[0];
|
|
15611
15651
|
}
|
|
15612
|
-
return
|
|
15652
|
+
return z9.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
|
|
15613
15653
|
}
|
|
15614
15654
|
if (schema.const !== void 0) {
|
|
15615
|
-
return
|
|
15655
|
+
return z9.literal(schema.const);
|
|
15616
15656
|
}
|
|
15617
15657
|
const type = schema.type;
|
|
15618
15658
|
if (Array.isArray(type)) {
|
|
@@ -15621,68 +15661,68 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15621
15661
|
return convertBaseSchema(typeSchema, ctx);
|
|
15622
15662
|
});
|
|
15623
15663
|
if (typeSchemas.length === 0) {
|
|
15624
|
-
return
|
|
15664
|
+
return z9.never();
|
|
15625
15665
|
}
|
|
15626
15666
|
if (typeSchemas.length === 1) {
|
|
15627
15667
|
return typeSchemas[0];
|
|
15628
15668
|
}
|
|
15629
|
-
return
|
|
15669
|
+
return z9.union(typeSchemas);
|
|
15630
15670
|
}
|
|
15631
15671
|
if (!type) {
|
|
15632
|
-
return
|
|
15672
|
+
return z9.any();
|
|
15633
15673
|
}
|
|
15634
15674
|
let zodSchema2;
|
|
15635
15675
|
switch (type) {
|
|
15636
15676
|
case "string": {
|
|
15637
|
-
let stringSchema =
|
|
15677
|
+
let stringSchema = z9.string();
|
|
15638
15678
|
if (schema.format) {
|
|
15639
15679
|
const format = schema.format;
|
|
15640
15680
|
if (format === "email") {
|
|
15641
|
-
stringSchema = stringSchema.check(
|
|
15681
|
+
stringSchema = stringSchema.check(z9.email());
|
|
15642
15682
|
} else if (format === "uri" || format === "uri-reference") {
|
|
15643
|
-
stringSchema = stringSchema.check(
|
|
15683
|
+
stringSchema = stringSchema.check(z9.url());
|
|
15644
15684
|
} else if (format === "uuid" || format === "guid") {
|
|
15645
|
-
stringSchema = stringSchema.check(
|
|
15685
|
+
stringSchema = stringSchema.check(z9.uuid());
|
|
15646
15686
|
} else if (format === "date-time") {
|
|
15647
|
-
stringSchema = stringSchema.check(
|
|
15687
|
+
stringSchema = stringSchema.check(z9.iso.datetime());
|
|
15648
15688
|
} else if (format === "date") {
|
|
15649
|
-
stringSchema = stringSchema.check(
|
|
15689
|
+
stringSchema = stringSchema.check(z9.iso.date());
|
|
15650
15690
|
} else if (format === "time") {
|
|
15651
|
-
stringSchema = stringSchema.check(
|
|
15691
|
+
stringSchema = stringSchema.check(z9.iso.time());
|
|
15652
15692
|
} else if (format === "duration") {
|
|
15653
|
-
stringSchema = stringSchema.check(
|
|
15693
|
+
stringSchema = stringSchema.check(z9.iso.duration());
|
|
15654
15694
|
} else if (format === "ipv4") {
|
|
15655
|
-
stringSchema = stringSchema.check(
|
|
15695
|
+
stringSchema = stringSchema.check(z9.ipv4());
|
|
15656
15696
|
} else if (format === "ipv6") {
|
|
15657
|
-
stringSchema = stringSchema.check(
|
|
15697
|
+
stringSchema = stringSchema.check(z9.ipv6());
|
|
15658
15698
|
} else if (format === "mac") {
|
|
15659
|
-
stringSchema = stringSchema.check(
|
|
15699
|
+
stringSchema = stringSchema.check(z9.mac());
|
|
15660
15700
|
} else if (format === "cidr") {
|
|
15661
|
-
stringSchema = stringSchema.check(
|
|
15701
|
+
stringSchema = stringSchema.check(z9.cidrv4());
|
|
15662
15702
|
} else if (format === "cidr-v6") {
|
|
15663
|
-
stringSchema = stringSchema.check(
|
|
15703
|
+
stringSchema = stringSchema.check(z9.cidrv6());
|
|
15664
15704
|
} else if (format === "base64") {
|
|
15665
|
-
stringSchema = stringSchema.check(
|
|
15705
|
+
stringSchema = stringSchema.check(z9.base64());
|
|
15666
15706
|
} else if (format === "base64url") {
|
|
15667
|
-
stringSchema = stringSchema.check(
|
|
15707
|
+
stringSchema = stringSchema.check(z9.base64url());
|
|
15668
15708
|
} else if (format === "e164") {
|
|
15669
|
-
stringSchema = stringSchema.check(
|
|
15709
|
+
stringSchema = stringSchema.check(z9.e164());
|
|
15670
15710
|
} else if (format === "jwt") {
|
|
15671
|
-
stringSchema = stringSchema.check(
|
|
15711
|
+
stringSchema = stringSchema.check(z9.jwt());
|
|
15672
15712
|
} else if (format === "emoji") {
|
|
15673
|
-
stringSchema = stringSchema.check(
|
|
15713
|
+
stringSchema = stringSchema.check(z9.emoji());
|
|
15674
15714
|
} else if (format === "nanoid") {
|
|
15675
|
-
stringSchema = stringSchema.check(
|
|
15715
|
+
stringSchema = stringSchema.check(z9.nanoid());
|
|
15676
15716
|
} else if (format === "cuid") {
|
|
15677
|
-
stringSchema = stringSchema.check(
|
|
15717
|
+
stringSchema = stringSchema.check(z9.cuid());
|
|
15678
15718
|
} else if (format === "cuid2") {
|
|
15679
|
-
stringSchema = stringSchema.check(
|
|
15719
|
+
stringSchema = stringSchema.check(z9.cuid2());
|
|
15680
15720
|
} else if (format === "ulid") {
|
|
15681
|
-
stringSchema = stringSchema.check(
|
|
15721
|
+
stringSchema = stringSchema.check(z9.ulid());
|
|
15682
15722
|
} else if (format === "xid") {
|
|
15683
|
-
stringSchema = stringSchema.check(
|
|
15723
|
+
stringSchema = stringSchema.check(z9.xid());
|
|
15684
15724
|
} else if (format === "ksuid") {
|
|
15685
|
-
stringSchema = stringSchema.check(
|
|
15725
|
+
stringSchema = stringSchema.check(z9.ksuid());
|
|
15686
15726
|
}
|
|
15687
15727
|
}
|
|
15688
15728
|
if (typeof schema.minLength === "number") {
|
|
@@ -15699,7 +15739,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15699
15739
|
}
|
|
15700
15740
|
case "number":
|
|
15701
15741
|
case "integer": {
|
|
15702
|
-
let numberSchema = type === "integer" ?
|
|
15742
|
+
let numberSchema = type === "integer" ? z9.number().int() : z9.number();
|
|
15703
15743
|
if (typeof schema.minimum === "number") {
|
|
15704
15744
|
numberSchema = numberSchema.min(schema.minimum);
|
|
15705
15745
|
}
|
|
@@ -15723,11 +15763,11 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15723
15763
|
break;
|
|
15724
15764
|
}
|
|
15725
15765
|
case "boolean": {
|
|
15726
|
-
zodSchema2 =
|
|
15766
|
+
zodSchema2 = z9.boolean();
|
|
15727
15767
|
break;
|
|
15728
15768
|
}
|
|
15729
15769
|
case "null": {
|
|
15730
|
-
zodSchema2 =
|
|
15770
|
+
zodSchema2 = z9.null();
|
|
15731
15771
|
break;
|
|
15732
15772
|
}
|
|
15733
15773
|
case "object": {
|
|
@@ -15740,14 +15780,14 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15740
15780
|
}
|
|
15741
15781
|
if (schema.propertyNames) {
|
|
15742
15782
|
const keySchema = convertSchema(schema.propertyNames, ctx);
|
|
15743
|
-
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) :
|
|
15783
|
+
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z9.any();
|
|
15744
15784
|
if (Object.keys(shape).length === 0) {
|
|
15745
|
-
zodSchema2 =
|
|
15785
|
+
zodSchema2 = z9.record(keySchema, valueSchema);
|
|
15746
15786
|
break;
|
|
15747
15787
|
}
|
|
15748
|
-
const objectSchema2 =
|
|
15749
|
-
const recordSchema =
|
|
15750
|
-
zodSchema2 =
|
|
15788
|
+
const objectSchema2 = z9.object(shape).passthrough();
|
|
15789
|
+
const recordSchema = z9.looseRecord(keySchema, valueSchema);
|
|
15790
|
+
zodSchema2 = z9.intersection(objectSchema2, recordSchema);
|
|
15751
15791
|
break;
|
|
15752
15792
|
}
|
|
15753
15793
|
if (schema.patternProperties) {
|
|
@@ -15756,28 +15796,28 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15756
15796
|
const looseRecords = [];
|
|
15757
15797
|
for (const pattern of patternKeys) {
|
|
15758
15798
|
const patternValue = convertSchema(patternProps[pattern], ctx);
|
|
15759
|
-
const keySchema =
|
|
15760
|
-
looseRecords.push(
|
|
15799
|
+
const keySchema = z9.string().regex(new RegExp(pattern));
|
|
15800
|
+
looseRecords.push(z9.looseRecord(keySchema, patternValue));
|
|
15761
15801
|
}
|
|
15762
15802
|
const schemasToIntersect = [];
|
|
15763
15803
|
if (Object.keys(shape).length > 0) {
|
|
15764
|
-
schemasToIntersect.push(
|
|
15804
|
+
schemasToIntersect.push(z9.object(shape).passthrough());
|
|
15765
15805
|
}
|
|
15766
15806
|
schemasToIntersect.push(...looseRecords);
|
|
15767
15807
|
if (schemasToIntersect.length === 0) {
|
|
15768
|
-
zodSchema2 =
|
|
15808
|
+
zodSchema2 = z9.object({}).passthrough();
|
|
15769
15809
|
} else if (schemasToIntersect.length === 1) {
|
|
15770
15810
|
zodSchema2 = schemasToIntersect[0];
|
|
15771
15811
|
} else {
|
|
15772
|
-
let result =
|
|
15812
|
+
let result = z9.intersection(schemasToIntersect[0], schemasToIntersect[1]);
|
|
15773
15813
|
for (let i = 2; i < schemasToIntersect.length; i++) {
|
|
15774
|
-
result =
|
|
15814
|
+
result = z9.intersection(result, schemasToIntersect[i]);
|
|
15775
15815
|
}
|
|
15776
15816
|
zodSchema2 = result;
|
|
15777
15817
|
}
|
|
15778
15818
|
break;
|
|
15779
15819
|
}
|
|
15780
|
-
const objectSchema =
|
|
15820
|
+
const objectSchema = z9.object(shape);
|
|
15781
15821
|
if (schema.additionalProperties === false) {
|
|
15782
15822
|
zodSchema2 = objectSchema.strict();
|
|
15783
15823
|
} else if (typeof schema.additionalProperties === "object") {
|
|
@@ -15794,33 +15834,33 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15794
15834
|
const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
|
|
15795
15835
|
const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0;
|
|
15796
15836
|
if (rest) {
|
|
15797
|
-
zodSchema2 =
|
|
15837
|
+
zodSchema2 = z9.tuple(tupleItems).rest(rest);
|
|
15798
15838
|
} else {
|
|
15799
|
-
zodSchema2 =
|
|
15839
|
+
zodSchema2 = z9.tuple(tupleItems);
|
|
15800
15840
|
}
|
|
15801
15841
|
if (typeof schema.minItems === "number") {
|
|
15802
|
-
zodSchema2 = zodSchema2.check(
|
|
15842
|
+
zodSchema2 = zodSchema2.check(z9.minLength(schema.minItems));
|
|
15803
15843
|
}
|
|
15804
15844
|
if (typeof schema.maxItems === "number") {
|
|
15805
|
-
zodSchema2 = zodSchema2.check(
|
|
15845
|
+
zodSchema2 = zodSchema2.check(z9.maxLength(schema.maxItems));
|
|
15806
15846
|
}
|
|
15807
15847
|
} else if (Array.isArray(items)) {
|
|
15808
15848
|
const tupleItems = items.map((item) => convertSchema(item, ctx));
|
|
15809
15849
|
const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : void 0;
|
|
15810
15850
|
if (rest) {
|
|
15811
|
-
zodSchema2 =
|
|
15851
|
+
zodSchema2 = z9.tuple(tupleItems).rest(rest);
|
|
15812
15852
|
} else {
|
|
15813
|
-
zodSchema2 =
|
|
15853
|
+
zodSchema2 = z9.tuple(tupleItems);
|
|
15814
15854
|
}
|
|
15815
15855
|
if (typeof schema.minItems === "number") {
|
|
15816
|
-
zodSchema2 = zodSchema2.check(
|
|
15856
|
+
zodSchema2 = zodSchema2.check(z9.minLength(schema.minItems));
|
|
15817
15857
|
}
|
|
15818
15858
|
if (typeof schema.maxItems === "number") {
|
|
15819
|
-
zodSchema2 = zodSchema2.check(
|
|
15859
|
+
zodSchema2 = zodSchema2.check(z9.maxLength(schema.maxItems));
|
|
15820
15860
|
}
|
|
15821
15861
|
} else if (items !== void 0) {
|
|
15822
15862
|
const element = convertSchema(items, ctx);
|
|
15823
|
-
let arraySchema =
|
|
15863
|
+
let arraySchema = z9.array(element);
|
|
15824
15864
|
if (typeof schema.minItems === "number") {
|
|
15825
15865
|
arraySchema = arraySchema.min(schema.minItems);
|
|
15826
15866
|
}
|
|
@@ -15829,7 +15869,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15829
15869
|
}
|
|
15830
15870
|
zodSchema2 = arraySchema;
|
|
15831
15871
|
} else {
|
|
15832
|
-
zodSchema2 =
|
|
15872
|
+
zodSchema2 = z9.array(z9.any());
|
|
15833
15873
|
}
|
|
15834
15874
|
break;
|
|
15835
15875
|
}
|
|
@@ -15846,37 +15886,37 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15846
15886
|
}
|
|
15847
15887
|
function convertSchema(schema, ctx) {
|
|
15848
15888
|
if (typeof schema === "boolean") {
|
|
15849
|
-
return schema ?
|
|
15889
|
+
return schema ? z9.any() : z9.never();
|
|
15850
15890
|
}
|
|
15851
15891
|
let baseSchema = convertBaseSchema(schema, ctx);
|
|
15852
15892
|
const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
|
|
15853
15893
|
if (schema.anyOf && Array.isArray(schema.anyOf)) {
|
|
15854
15894
|
const options = schema.anyOf.map((s) => convertSchema(s, ctx));
|
|
15855
|
-
const anyOfUnion =
|
|
15856
|
-
baseSchema = hasExplicitType ?
|
|
15895
|
+
const anyOfUnion = z9.union(options);
|
|
15896
|
+
baseSchema = hasExplicitType ? z9.intersection(baseSchema, anyOfUnion) : anyOfUnion;
|
|
15857
15897
|
}
|
|
15858
15898
|
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
15859
15899
|
const options = schema.oneOf.map((s) => convertSchema(s, ctx));
|
|
15860
|
-
const oneOfUnion =
|
|
15861
|
-
baseSchema = hasExplicitType ?
|
|
15900
|
+
const oneOfUnion = z9.xor(options);
|
|
15901
|
+
baseSchema = hasExplicitType ? z9.intersection(baseSchema, oneOfUnion) : oneOfUnion;
|
|
15862
15902
|
}
|
|
15863
15903
|
if (schema.allOf && Array.isArray(schema.allOf)) {
|
|
15864
15904
|
if (schema.allOf.length === 0) {
|
|
15865
|
-
baseSchema = hasExplicitType ? baseSchema :
|
|
15905
|
+
baseSchema = hasExplicitType ? baseSchema : z9.any();
|
|
15866
15906
|
} else {
|
|
15867
15907
|
let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
|
|
15868
15908
|
const startIdx = hasExplicitType ? 0 : 1;
|
|
15869
15909
|
for (let i = startIdx; i < schema.allOf.length; i++) {
|
|
15870
|
-
result =
|
|
15910
|
+
result = z9.intersection(result, convertSchema(schema.allOf[i], ctx));
|
|
15871
15911
|
}
|
|
15872
15912
|
baseSchema = result;
|
|
15873
15913
|
}
|
|
15874
15914
|
}
|
|
15875
15915
|
if (schema.nullable === true && ctx.version === "openapi-3.0") {
|
|
15876
|
-
baseSchema =
|
|
15916
|
+
baseSchema = z9.nullable(baseSchema);
|
|
15877
15917
|
}
|
|
15878
15918
|
if (schema.readOnly === true) {
|
|
15879
|
-
baseSchema =
|
|
15919
|
+
baseSchema = z9.readonly(baseSchema);
|
|
15880
15920
|
}
|
|
15881
15921
|
const extraMeta = {};
|
|
15882
15922
|
const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
|
|
@@ -15903,7 +15943,7 @@ function convertSchema(schema, ctx) {
|
|
|
15903
15943
|
}
|
|
15904
15944
|
function fromJSONSchema(schema, params) {
|
|
15905
15945
|
if (typeof schema === "boolean") {
|
|
15906
|
-
return schema ?
|
|
15946
|
+
return schema ? z9.any() : z9.never();
|
|
15907
15947
|
}
|
|
15908
15948
|
const version2 = detectVersion(schema, params?.defaultTarget);
|
|
15909
15949
|
const defs = schema.$defs || schema.definitions || {};
|
|
@@ -15917,14 +15957,14 @@ function fromJSONSchema(schema, params) {
|
|
|
15917
15957
|
};
|
|
15918
15958
|
return convertSchema(schema, ctx);
|
|
15919
15959
|
}
|
|
15920
|
-
var
|
|
15960
|
+
var z9, RECOGNIZED_KEYS;
|
|
15921
15961
|
var init_from_json_schema = __esm({
|
|
15922
15962
|
"node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/from-json-schema.js"() {
|
|
15923
15963
|
init_registries();
|
|
15924
15964
|
init_checks2();
|
|
15925
15965
|
init_iso();
|
|
15926
15966
|
init_schemas2();
|
|
15927
|
-
|
|
15967
|
+
z9 = {
|
|
15928
15968
|
...schemas_exports2,
|
|
15929
15969
|
...checks_exports2,
|
|
15930
15970
|
iso: iso_exports
|