@cleocode/adapters 2026.5.110 → 2026.5.112

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 CHANGED
@@ -1196,59 +1196,139 @@ var init_errors = __esm({
1196
1196
  }
1197
1197
  });
1198
1198
 
1199
- // packages/contracts/src/evidence-record-schema.ts
1199
+ // packages/contracts/src/evidence-atom-schema.ts
1200
1200
  import { z as z4 } from "zod";
1201
+ var commitAtomSchema, filesAtomSchema, testRunAtomSchema, toolAtomSchema, urlAtomSchema, noteAtomSchema, decisionAtomSchema, prAtomSchema, locDropAtomSchema, callsiteCoverageAtomSchema, EvidenceAtomSchema, GATE_EVIDENCE_REQUIREMENTS;
1202
+ var init_evidence_atom_schema = __esm({
1203
+ "packages/contracts/src/evidence-atom-schema.ts"() {
1204
+ "use strict";
1205
+ commitAtomSchema = z4.object({
1206
+ kind: z4.literal("commit"),
1207
+ sha: z4.string().regex(/^[0-9a-f]{7,40}$/i, "commit sha must be 7-40 hex characters")
1208
+ });
1209
+ filesAtomSchema = z4.object({
1210
+ kind: z4.literal("files"),
1211
+ paths: z4.array(z4.string().min(1)).min(1, "files atom requires at least one path")
1212
+ });
1213
+ testRunAtomSchema = z4.object({
1214
+ kind: z4.literal("test-run"),
1215
+ path: z4.string().min(1, "test-run atom requires a non-empty path")
1216
+ });
1217
+ toolAtomSchema = z4.object({
1218
+ kind: z4.literal("tool"),
1219
+ tool: z4.string().min(1, "tool atom requires a non-empty tool name")
1220
+ });
1221
+ urlAtomSchema = z4.object({
1222
+ kind: z4.literal("url"),
1223
+ url: z4.string().min(1).regex(/^https?:\/\//, "url atom must start with http:// or https://")
1224
+ });
1225
+ noteAtomSchema = z4.object({
1226
+ kind: z4.literal("note"),
1227
+ note: z4.string().min(1, "note atom must be non-empty").max(512, "note atom is too long (max 512 chars)")
1228
+ });
1229
+ decisionAtomSchema = z4.object({
1230
+ kind: z4.literal("decision"),
1231
+ decisionId: z4.string().min(1, "decision atom requires a non-empty decision ID")
1232
+ });
1233
+ prAtomSchema = z4.object({
1234
+ kind: z4.literal("pr"),
1235
+ prNumber: z4.number().int().positive("pr atom requires a positive integer PR number")
1236
+ });
1237
+ locDropAtomSchema = z4.object({
1238
+ kind: z4.literal("loc-drop"),
1239
+ fromLines: z4.number().int().nonnegative("loc-drop fromLines must be \u2265 0"),
1240
+ toLines: z4.number().int().nonnegative("loc-drop toLines must be \u2265 0")
1241
+ });
1242
+ callsiteCoverageAtomSchema = z4.object({
1243
+ kind: z4.literal("callsite-coverage"),
1244
+ symbolName: z4.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
1245
+ relativeSourcePath: z4.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
1246
+ });
1247
+ EvidenceAtomSchema = z4.discriminatedUnion("kind", [
1248
+ commitAtomSchema,
1249
+ filesAtomSchema,
1250
+ testRunAtomSchema,
1251
+ toolAtomSchema,
1252
+ urlAtomSchema,
1253
+ noteAtomSchema,
1254
+ decisionAtomSchema,
1255
+ prAtomSchema,
1256
+ locDropAtomSchema,
1257
+ callsiteCoverageAtomSchema
1258
+ ]);
1259
+ GATE_EVIDENCE_REQUIREMENTS = Object.freeze({
1260
+ implemented: {
1261
+ oneOf: [
1262
+ ["commit", "files"],
1263
+ ["commit", "note"],
1264
+ ["decision", "files"],
1265
+ ["decision", "note"],
1266
+ ["pr"]
1267
+ ]
1268
+ },
1269
+ testsPassed: { oneOf: [["test-run"], ["tool"], ["pr"]] },
1270
+ qaPassed: { oneOf: [["tool"], ["pr"]] },
1271
+ documented: { oneOf: [["files"], ["url"]] },
1272
+ securityPassed: { oneOf: [["tool"], ["note"]] },
1273
+ cleanupDone: { oneOf: [["note"]] },
1274
+ nexusImpact: { oneOf: [["tool"], ["note"]] }
1275
+ });
1276
+ }
1277
+ });
1278
+
1279
+ // packages/contracts/src/evidence-record-schema.ts
1280
+ import { z as z5 } from "zod";
1201
1281
  var evidenceBaseSchema, implDiffRecordSchema, validateSpecCheckRecordSchema, testOutputRecordSchema, lintReportRecordSchema, commandOutputRecordSchema, evidenceRecordSchema;
1202
1282
  var init_evidence_record_schema = __esm({
1203
1283
  "packages/contracts/src/evidence-record-schema.ts"() {
1204
1284
  "use strict";
1205
- evidenceBaseSchema = z4.object({
1285
+ evidenceBaseSchema = z5.object({
1206
1286
  /** Identity string of the agent that produced this record. */
1207
- agentIdentity: z4.string().min(1),
1287
+ agentIdentity: z5.string().min(1),
1208
1288
  /** SHA-256 hex digest (64 chars) of the attached artifact. */
1209
- attachmentSha256: z4.string().length(64),
1289
+ attachmentSha256: z5.string().length(64),
1210
1290
  /** ISO 8601 timestamp at which the action ran. */
1211
- ranAt: z4.string().datetime(),
1291
+ ranAt: z5.string().datetime(),
1212
1292
  /** Wall-clock duration of the action in milliseconds. */
1213
- durationMs: z4.number().nonnegative()
1293
+ durationMs: z5.number().nonnegative()
1214
1294
  });
1215
1295
  implDiffRecordSchema = evidenceBaseSchema.extend({
1216
- kind: z4.literal("impl-diff"),
1217
- phase: z4.literal("implement"),
1218
- filesChanged: z4.array(z4.string().min(1)).min(1),
1219
- linesAdded: z4.number().int().nonnegative(),
1220
- linesRemoved: z4.number().int().nonnegative()
1296
+ kind: z5.literal("impl-diff"),
1297
+ phase: z5.literal("implement"),
1298
+ filesChanged: z5.array(z5.string().min(1)).min(1),
1299
+ linesAdded: z5.number().int().nonnegative(),
1300
+ linesRemoved: z5.number().int().nonnegative()
1221
1301
  });
1222
1302
  validateSpecCheckRecordSchema = evidenceBaseSchema.extend({
1223
- kind: z4.literal("validate-spec-check"),
1224
- phase: z4.literal("validate"),
1225
- reqIdsChecked: z4.array(z4.string().min(1)).min(1),
1226
- passed: z4.boolean(),
1227
- details: z4.string().min(1)
1303
+ kind: z5.literal("validate-spec-check"),
1304
+ phase: z5.literal("validate"),
1305
+ reqIdsChecked: z5.array(z5.string().min(1)).min(1),
1306
+ passed: z5.boolean(),
1307
+ details: z5.string().min(1)
1228
1308
  });
1229
1309
  testOutputRecordSchema = evidenceBaseSchema.extend({
1230
- kind: z4.literal("test-output"),
1231
- phase: z4.literal("test"),
1232
- command: z4.string().min(1),
1233
- exitCode: z4.number().int(),
1234
- testsPassed: z4.number().int().nonnegative(),
1235
- testsFailed: z4.number().int().nonnegative()
1310
+ kind: z5.literal("test-output"),
1311
+ phase: z5.literal("test"),
1312
+ command: z5.string().min(1),
1313
+ exitCode: z5.number().int(),
1314
+ testsPassed: z5.number().int().nonnegative(),
1315
+ testsFailed: z5.number().int().nonnegative()
1236
1316
  });
1237
1317
  lintReportRecordSchema = evidenceBaseSchema.extend({
1238
- kind: z4.literal("lint-report"),
1239
- phase: z4.enum(["implement", "test"]),
1240
- tool: z4.string().min(1),
1241
- passed: z4.boolean(),
1242
- warnings: z4.number().int().nonnegative(),
1243
- errors: z4.number().int().nonnegative()
1318
+ kind: z5.literal("lint-report"),
1319
+ phase: z5.enum(["implement", "test"]),
1320
+ tool: z5.string().min(1),
1321
+ passed: z5.boolean(),
1322
+ warnings: z5.number().int().nonnegative(),
1323
+ errors: z5.number().int().nonnegative()
1244
1324
  });
1245
1325
  commandOutputRecordSchema = evidenceBaseSchema.extend({
1246
- kind: z4.literal("command-output"),
1247
- phase: z4.enum(["implement", "validate", "test"]),
1248
- cmd: z4.string().min(1),
1249
- exitCode: z4.number().int()
1326
+ kind: z5.literal("command-output"),
1327
+ phase: z5.enum(["implement", "validate", "test"]),
1328
+ cmd: z5.string().min(1),
1329
+ exitCode: z5.number().int()
1250
1330
  });
1251
- evidenceRecordSchema = z4.discriminatedUnion("kind", [
1331
+ evidenceRecordSchema = z5.discriminatedUnion("kind", [
1252
1332
  implDiffRecordSchema,
1253
1333
  validateSpecCheckRecordSchema,
1254
1334
  testOutputRecordSchema,
@@ -1272,6 +1352,154 @@ var init_graph = __esm({
1272
1352
  }
1273
1353
  });
1274
1354
 
1355
+ // packages/contracts/src/invariants/adr-073-saga.ts
1356
+ var SAGA_ENFORCEMENT_MODULE, SAGA_ENFORCEMENT_TESTS, ADR_073_INVARIANTS;
1357
+ var init_adr_073_saga = __esm({
1358
+ "packages/contracts/src/invariants/adr-073-saga.ts"() {
1359
+ "use strict";
1360
+ SAGA_ENFORCEMENT_MODULE = "packages/core/src/sagas/enforcement.ts";
1361
+ SAGA_ENFORCEMENT_TESTS = "packages/core/src/sagas/__tests__/enforcement.test.ts";
1362
+ ADR_073_INVARIANTS = Object.freeze([
1363
+ {
1364
+ adr: "ADR-073",
1365
+ code: "I1",
1366
+ name: "Storage uniformity",
1367
+ description: 'All task IDs are stored as T#### and the type column is the canonical tier discriminator. There is no separate ID space for Sagas, Epics, Tasks, or Subtasks; label="saga" elevates a type="epic" row to Saga semantics.',
1368
+ severity: "info",
1369
+ // I1 is enforced by the DB CHECK constraints introduced in W1.B (T10329)
1370
+ // and by TASK_ID_PATTERN in packages/core/src/tasks/id-generator.ts —
1371
+ // not by a single runtime function.
1372
+ runtimeGate: null,
1373
+ lintRule: null,
1374
+ doctorAudit: null,
1375
+ tests: ["packages/core/src/tasks/__tests__/id-generator.test.ts"]
1376
+ },
1377
+ {
1378
+ adr: "ADR-073",
1379
+ code: "I2",
1380
+ name: "Conceptual prefixes are display + import only",
1381
+ description: "SG-, E-, T- (and Subtask's implicit absence) are documentation, CLI display, and import-mapping conventions only. They MUST NOT be used as DB primary keys \u2014 display-only with no runtime enforcement.",
1382
+ severity: "info",
1383
+ // I2 is a display convention; the SG- prefix preservation snapshot
1384
+ // (T10333) protects the display contract but there is no runtime guard.
1385
+ runtimeGate: null,
1386
+ lintRule: null,
1387
+ doctorAudit: null,
1388
+ tests: []
1389
+ },
1390
+ {
1391
+ adr: "ADR-073",
1392
+ code: "I3",
1393
+ name: "Tier promotion mandatory when scope outgrows the tier",
1394
+ description: "A Subtask whose change exceeds 2 files or crosses a module boundary MUST be split or promoted to a sibling Task. A Task that requires more than one PR or wave MUST be split. An Epic that spans more than one release MUST be regrouped under a Saga.",
1395
+ severity: "error",
1396
+ runtimeGate: {
1397
+ module: SAGA_ENFORCEMENT_MODULE,
1398
+ functionName: "assertSagaInvariantI3"
1399
+ },
1400
+ lintRule: null,
1401
+ doctorAudit: null,
1402
+ tests: [SAGA_ENFORCEMENT_TESTS]
1403
+ },
1404
+ {
1405
+ adr: "ADR-073",
1406
+ code: "I4",
1407
+ name: "Ownership non-overlapping",
1408
+ description: "A single tier maps to a single orchestration role (per ADR-070). Workers MUST NOT spawn other Workers. Phase Leads MUST NOT own multiple Epics simultaneously. The Orchestrator MUST NOT spawn Workers directly when fan-out exceeds the ADR-070 migration threshold.",
1409
+ severity: "warning",
1410
+ // I4 is partially covered by ADR-070 spawn guards but the unification
1411
+ // with the registry happens in R2 (T10336 — ORC codes). For now this
1412
+ // entry stays warning + runtimeGate:null to mark the gap explicitly.
1413
+ runtimeGate: null,
1414
+ lintRule: null,
1415
+ doctorAudit: null,
1416
+ tests: []
1417
+ },
1418
+ {
1419
+ adr: "ADR-073",
1420
+ code: "I5",
1421
+ name: "Sagas link via groups, not parent",
1422
+ description: `task_relations.type="groups" is the ONLY relation type that links a Saga to its member Epics. The Saga row's parent_id MUST be NULL. Enforced at runtime by assertSagaInvariantI5 AND by the DB CHECK constraint from W1.B (T10329) on label="saga" rows.`,
1423
+ severity: "error",
1424
+ runtimeGate: {
1425
+ module: SAGA_ENFORCEMENT_MODULE,
1426
+ functionName: "assertSagaInvariantI5"
1427
+ },
1428
+ lintRule: null,
1429
+ doctorAudit: null,
1430
+ tests: [SAGA_ENFORCEMENT_TESTS]
1431
+ },
1432
+ {
1433
+ adr: "ADR-073",
1434
+ code: "I6",
1435
+ name: "Acceptance criteria required at every tier",
1436
+ description: 'Per ADR-066 \xA7"Ownership Matrix" invariant #5, all tasks regardless of type or kind MUST have --acceptance set at creation time. No tier exemption exists. Delegated to the ADR-066 --acceptance requirement on cleo add/add-batch.',
1437
+ severity: "warning",
1438
+ // I6 is enforced by ADR-066's CLI requirement, not by a saga runtime
1439
+ // function. UNENFORCED in the saga module — left as a warning so R6
1440
+ // doctor audit reminds operators of the upstream guard's location.
1441
+ runtimeGate: null,
1442
+ lintRule: null,
1443
+ doctorAudit: null,
1444
+ tests: []
1445
+ },
1446
+ {
1447
+ adr: "ADR-073",
1448
+ code: "I7",
1449
+ name: "Maximum parent depth is 3",
1450
+ description: "The parent ladder Subtask \u2192 Task \u2192 Epic is fixed at depth 3 (hierarchy.maxDepth=3). Sagas do NOT consume depth \u2014 they attach via groups relations, not parent edges. Enforced at runtime by assertSagaInvariantI7.",
1451
+ severity: "error",
1452
+ runtimeGate: {
1453
+ module: SAGA_ENFORCEMENT_MODULE,
1454
+ functionName: "assertSagaInvariantI7"
1455
+ },
1456
+ lintRule: null,
1457
+ doctorAudit: null,
1458
+ tests: [SAGA_ENFORCEMENT_TESTS]
1459
+ },
1460
+ {
1461
+ adr: "ADR-073",
1462
+ code: "I8",
1463
+ name: "Subtask-to-PR aggregation rule",
1464
+ description: "A Task ships as exactly one PR. The PR's commit history is the union of the Task's Subtask commits. A Subtask never produces its own PR; if a unit of work warrants its own PR, it is a Task, not a Subtask. UNENFORCED at runtime today \u2014 load-bearing convention enforced via code review and the lifecycle decision table.",
1465
+ severity: "warning",
1466
+ // I8 is explicitly "UNENFORCED, load-bearing" — there is no automated
1467
+ // gate. R6 doctor audit surfaces this entry so it stays visible.
1468
+ runtimeGate: null,
1469
+ lintRule: null,
1470
+ doctorAudit: null,
1471
+ tests: []
1472
+ }
1473
+ ]);
1474
+ }
1475
+ });
1476
+
1477
+ // packages/contracts/src/invariants/index.ts
1478
+ function buildKey(invariant) {
1479
+ return `${invariant.adr}.${invariant.code}`;
1480
+ }
1481
+ function buildRegistry() {
1482
+ const entries = [...ADR_073_INVARIANTS];
1483
+ const record2 = {};
1484
+ for (const entry of entries) {
1485
+ const key = buildKey(entry);
1486
+ if (record2[key] !== void 0) {
1487
+ throw new Error(`Duplicate invariant key registered: ${key}`);
1488
+ }
1489
+ record2[key] = entry;
1490
+ }
1491
+ return Object.freeze(record2);
1492
+ }
1493
+ var INVARIANTS_REGISTRY;
1494
+ var init_invariants = __esm({
1495
+ "packages/contracts/src/invariants/index.ts"() {
1496
+ "use strict";
1497
+ init_adr_073_saga();
1498
+ init_adr_073_saga();
1499
+ INVARIANTS_REGISTRY = buildRegistry();
1500
+ }
1501
+ });
1502
+
1275
1503
  // packages/contracts/src/lafs.ts
1276
1504
  var init_lafs = __esm({
1277
1505
  "packages/contracts/src/lafs.ts"() {
@@ -1540,31 +1768,31 @@ var init_peer = __esm({
1540
1768
  });
1541
1769
 
1542
1770
  // packages/contracts/src/release/evidence-atoms.ts
1543
- import { z as z5 } from "zod";
1771
+ import { z as z6 } from "zod";
1544
1772
  var parsedPrEvidenceAtomSchema, prEvidenceStateModifierSchema, ghPrViewSchema, PR_REQUIRED_WORKFLOWS;
1545
1773
  var init_evidence_atoms = __esm({
1546
1774
  "packages/contracts/src/release/evidence-atoms.ts"() {
1547
1775
  "use strict";
1548
- parsedPrEvidenceAtomSchema = z5.object({
1549
- kind: z5.literal("pr"),
1550
- prNumber: z5.number().int().positive()
1551
- });
1552
- prEvidenceStateModifierSchema = z5.object({
1553
- kind: z5.literal("state"),
1554
- value: z5.literal("MERGED")
1555
- });
1556
- ghPrViewSchema = z5.object({
1557
- state: z5.enum(["OPEN", "CLOSED", "MERGED"]),
1558
- mergedAt: z5.string().nullable(),
1559
- headRefOid: z5.string().optional(),
1560
- mergeable: z5.string().optional(),
1561
- statusCheckRollup: z5.array(
1562
- z5.object({
1563
- __typename: z5.string().optional(),
1564
- name: z5.string().optional(),
1565
- workflowName: z5.string().optional(),
1566
- conclusion: z5.string().nullable().optional(),
1567
- status: z5.string().optional()
1776
+ parsedPrEvidenceAtomSchema = z6.object({
1777
+ kind: z6.literal("pr"),
1778
+ prNumber: z6.number().int().positive()
1779
+ });
1780
+ prEvidenceStateModifierSchema = z6.object({
1781
+ kind: z6.literal("state"),
1782
+ value: z6.literal("MERGED")
1783
+ });
1784
+ ghPrViewSchema = z6.object({
1785
+ state: z6.enum(["OPEN", "CLOSED", "MERGED"]),
1786
+ mergedAt: z6.string().nullable(),
1787
+ headRefOid: z6.string().optional(),
1788
+ mergeable: z6.string().optional(),
1789
+ statusCheckRollup: z6.array(
1790
+ z6.object({
1791
+ __typename: z6.string().optional(),
1792
+ name: z6.string().optional(),
1793
+ workflowName: z6.string().optional(),
1794
+ conclusion: z6.string().nullable().optional(),
1795
+ status: z6.string().optional()
1568
1796
  }).passthrough()
1569
1797
  ).optional().default([])
1570
1798
  }).passthrough();
@@ -1577,7 +1805,7 @@ var init_evidence_atoms = __esm({
1577
1805
  });
1578
1806
 
1579
1807
  // packages/contracts/src/release/plan.ts
1580
- import { z as z6 } from "zod";
1808
+ import { z as z7 } from "zod";
1581
1809
  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;
1582
1810
  var init_plan = __esm({
1583
1811
  "packages/contracts/src/release/plan.ts"() {
@@ -1620,20 +1848,20 @@ var init_plan = __esm({
1620
1848
  ];
1621
1849
  IMPACT = ["major", "minor", "patch"];
1622
1850
  RESOLVED_SOURCE = ["project-context", "language-default", "legacy-alias"];
1623
- ReleaseChannelSchema = z6.enum(RELEASE_CHANNEL);
1624
- ReleaseSchemeSchema = z6.enum(RELEASE_SCHEME);
1625
- ReleaseKindSchema = z6.enum(RELEASE_KIND);
1626
- ReleaseStatusSchema = z6.enum(RELEASE_STATUS);
1627
- GateStatusSchema = z6.enum(GATE_STATUS);
1628
- GateNameSchema = z6.enum(GATE_NAME);
1629
- PlatformTupleSchema = z6.enum(PLATFORM_TUPLE);
1630
- PublisherSchema = z6.enum(PUBLISHER);
1631
- TaskKindSchema = z6.enum(TASK_KIND);
1632
- ImpactSchema = z6.enum(IMPACT);
1633
- ResolvedSourceSchema = z6.enum(RESOLVED_SOURCE);
1634
- Iso8601 = z6.iso.datetime({ offset: true });
1635
- NonEmptyString = z6.string().min(1);
1636
- ReleasePlanTaskSchema = z6.object({
1851
+ ReleaseChannelSchema = z7.enum(RELEASE_CHANNEL);
1852
+ ReleaseSchemeSchema = z7.enum(RELEASE_SCHEME);
1853
+ ReleaseKindSchema = z7.enum(RELEASE_KIND);
1854
+ ReleaseStatusSchema = z7.enum(RELEASE_STATUS);
1855
+ GateStatusSchema = z7.enum(GATE_STATUS);
1856
+ GateNameSchema = z7.enum(GATE_NAME);
1857
+ PlatformTupleSchema = z7.enum(PLATFORM_TUPLE);
1858
+ PublisherSchema = z7.enum(PUBLISHER);
1859
+ TaskKindSchema = z7.enum(TASK_KIND);
1860
+ ImpactSchema = z7.enum(IMPACT);
1861
+ ResolvedSourceSchema = z7.enum(RESOLVED_SOURCE);
1862
+ Iso8601 = z7.iso.datetime({ offset: true });
1863
+ NonEmptyString = z7.string().min(1);
1864
+ ReleasePlanTaskSchema = z7.object({
1637
1865
  /** Task ID (e.g. "T10001"). Format intentionally loose so historical IDs validate. */
1638
1866
  id: NonEmptyString,
1639
1867
  /** Conventional-commit-aligned task classification. */
@@ -1641,20 +1869,20 @@ var init_plan = __esm({
1641
1869
  /** SemVer impact classification. */
1642
1870
  impact: ImpactSchema,
1643
1871
  /** Human-readable changelog line for this task. */
1644
- userFacingSummary: z6.string(),
1872
+ userFacingSummary: z7.string(),
1645
1873
  /**
1646
1874
  * ADR-051 evidence atoms attesting the task's gate results. Format is
1647
1875
  * `kind:value` (e.g. `commit:abc123`, `test-run:vitest.json`). The contract
1648
1876
  * accepts empty arrays so legacy plans validate; `cleo release plan`
1649
1877
  * enforces non-empty via R-301.
1650
1878
  */
1651
- evidenceAtoms: z6.array(NonEmptyString),
1879
+ evidenceAtoms: z7.array(NonEmptyString),
1652
1880
  /** IVTR phase at plan time — informational only per R-316. */
1653
- ivtrPhaseAtPlan: z6.string().optional(),
1881
+ ivtrPhaseAtPlan: z7.string().optional(),
1654
1882
  /** Epic this task rolls up to, locked at plan time per R-303. */
1655
1883
  epicAncestor: NonEmptyString
1656
1884
  });
1657
- ReleaseGateSchema = z6.object({
1885
+ ReleaseGateSchema = z7.object({
1658
1886
  /** Canonical gate name. */
1659
1887
  name: GateNameSchema,
1660
1888
  /** ADR-051 atom string identifying the resolved tool (e.g. `tool:test`). */
@@ -1664,11 +1892,11 @@ var init_plan = __esm({
1664
1892
  /** ISO-8601 timestamp the gate was last verified. */
1665
1893
  lastVerifiedAt: Iso8601,
1666
1894
  /** Resolved shell command (e.g. `pnpm run test`). Optional for unresolved gates. */
1667
- resolvedCommand: z6.string().optional(),
1895
+ resolvedCommand: z7.string().optional(),
1668
1896
  /** Provenance of the resolved command. Optional for unresolved gates. */
1669
1897
  resolvedSource: ResolvedSourceSchema.optional()
1670
1898
  });
1671
- ReleasePlatformMatrixEntrySchema = z6.object({
1899
+ ReleasePlatformMatrixEntrySchema = z7.object({
1672
1900
  /** Target platform tuple. */
1673
1901
  platform: PlatformTupleSchema,
1674
1902
  /** Distribution backend. */
@@ -1676,47 +1904,47 @@ var init_plan = __esm({
1676
1904
  /** Package identifier on the target backend (e.g. `@cleocode/cleo`). */
1677
1905
  package: NonEmptyString,
1678
1906
  /** Whether to run the GHA smoke job for this matrix entry. */
1679
- smoke: z6.boolean().default(true).optional()
1907
+ smoke: z7.boolean().default(true).optional()
1680
1908
  });
1681
- ReleasePreflightSummarySchema = z6.object({
1909
+ ReleasePreflightSummarySchema = z7.object({
1682
1910
  /** True if esbuild externals are out of sync with package.json. */
1683
- esbuildExternalsDrift: z6.boolean(),
1911
+ esbuildExternalsDrift: z7.boolean(),
1684
1912
  /** True if `pnpm-lock.yaml` diverges from the workspace manifest. */
1685
- lockfileDrift: z6.boolean(),
1913
+ lockfileDrift: z7.boolean(),
1686
1914
  /** True if all epic children are in terminal lifecycle states. */
1687
- epicCompletenessClean: z6.boolean(),
1915
+ epicCompletenessClean: z7.boolean(),
1688
1916
  /** True if no task appears in multiple in-flight release plans. */
1689
- doubleListingClean: z6.boolean(),
1917
+ doubleListingClean: z7.boolean(),
1690
1918
  /** Non-fatal preflight warnings (e.g. unresolved tools per R-024). */
1691
- preflightWarnings: z6.array(z6.string()).default([]).optional()
1919
+ preflightWarnings: z7.array(z7.string()).default([]).optional()
1692
1920
  });
1693
- ReleasePlanChangelogSchema = z6.object({
1921
+ ReleasePlanChangelogSchema = z7.object({
1694
1922
  /** `kind=feat` tasks. */
1695
- features: z6.array(NonEmptyString).default([]),
1923
+ features: z7.array(NonEmptyString).default([]),
1696
1924
  /** `kind=fix` or `kind=hotfix` tasks. */
1697
- fixes: z6.array(NonEmptyString).default([]),
1925
+ fixes: z7.array(NonEmptyString).default([]),
1698
1926
  /** `kind=chore`, `docs`, `refactor`, `test`, `perf` tasks. */
1699
- chores: z6.array(NonEmptyString).default([]),
1927
+ chores: z7.array(NonEmptyString).default([]),
1700
1928
  /** `kind=breaking` or `kind=revert` tasks. */
1701
- breaking: z6.array(NonEmptyString).default([])
1929
+ breaking: z7.array(NonEmptyString).default([])
1702
1930
  });
1703
- ReleasePlanMetaSchema = z6.object({
1931
+ ReleasePlanMetaSchema = z7.object({
1704
1932
  /** True if this is the project's first ever release. */
1705
- firstEverRelease: z6.boolean().optional(),
1933
+ firstEverRelease: z7.boolean().optional(),
1706
1934
  /** Canonical tool names that could not be resolved at plan time. */
1707
- unresolvedTools: z6.array(z6.string()).optional(),
1935
+ unresolvedTools: z7.array(z7.string()).optional(),
1708
1936
  /** Project archetype detected at plan time. */
1709
- archetype: z6.string().optional()
1710
- }).catchall(z6.unknown());
1711
- ReleasePlanSchema = z6.object({
1937
+ archetype: z7.string().optional()
1938
+ }).catchall(z7.unknown());
1939
+ ReleasePlanSchema = z7.object({
1712
1940
  /** Schema URL for this plan version. */
1713
- $schema: z6.string().optional(),
1941
+ $schema: z7.string().optional(),
1714
1942
  /** Requested version string (e.g. "v2026.6.0"). Includes the leading `v`. */
1715
1943
  version: NonEmptyString,
1716
1944
  /** Resolved version string after suffix application (e.g. "v2026.6.0.2"). */
1717
1945
  resolvedVersion: NonEmptyString,
1718
1946
  /** True if a `calver-suffix` was applied to disambiguate a same-day hotfix. */
1719
- suffixApplied: z6.boolean(),
1947
+ suffixApplied: z7.boolean(),
1720
1948
  /** Versioning scheme governing `version` / `resolvedVersion`. */
1721
1949
  scheme: ReleaseSchemeSchema,
1722
1950
  /** npm dist-tag channel for this release. */
@@ -1733,27 +1961,27 @@ var init_plan = __esm({
1733
1961
  * Version of the previous release on the same channel. MUST be `null` only
1734
1962
  * for first-ever releases (R-300, enforced at the verb layer).
1735
1963
  */
1736
- previousVersion: z6.string().nullable(),
1964
+ previousVersion: z7.string().nullable(),
1737
1965
  /** Git tag of the previous release (typically `previousVersion` prefixed). */
1738
- previousTag: z6.string().nullable(),
1966
+ previousTag: z7.string().nullable(),
1739
1967
  /** ISO-8601 timestamp the previous release was published. */
1740
1968
  previousShippedAt: Iso8601.nullable(),
1741
1969
  /** Tasks rolled into this release. */
1742
- tasks: z6.array(ReleasePlanTaskSchema),
1970
+ tasks: z7.array(ReleasePlanTaskSchema),
1743
1971
  /** Bucketed changelog. */
1744
1972
  changelog: ReleasePlanChangelogSchema,
1745
1973
  /** Per-gate verification status. */
1746
- gates: z6.array(ReleaseGateSchema),
1974
+ gates: z7.array(ReleaseGateSchema),
1747
1975
  /** Platform / publisher matrix. */
1748
- platformMatrix: z6.array(ReleasePlatformMatrixEntrySchema),
1976
+ platformMatrix: z7.array(ReleasePlatformMatrixEntrySchema),
1749
1977
  /** Preflight summary from `cleo release plan`. */
1750
1978
  preflightSummary: ReleasePreflightSummarySchema,
1751
1979
  /** URL of the GHA workflow run (populated by `release-prepare.yml`). */
1752
- workflowRunUrl: z6.string().nullable(),
1980
+ workflowRunUrl: z7.string().nullable(),
1753
1981
  /** URL of the bump PR (populated by `cleo release open`). */
1754
- prUrl: z6.string().nullable(),
1982
+ prUrl: z7.string().nullable(),
1755
1983
  /** Merge commit SHA on `main` (populated by `release-publish.yml`). */
1756
- mergeCommitSha: z6.string().nullable(),
1984
+ mergeCommitSha: z7.string().nullable(),
1757
1985
  /** Current FSM state per R-302. */
1758
1986
  status: ReleaseStatusSchema,
1759
1987
  /** Informational / forward-compat metadata. */
@@ -1809,52 +2037,52 @@ var init_session2 = __esm({
1809
2037
  });
1810
2038
 
1811
2039
  // packages/contracts/src/session-journal.ts
1812
- import { z as z7 } from "zod";
2040
+ import { z as z8 } from "zod";
1813
2041
  var SESSION_JOURNAL_SCHEMA_VERSION, sessionJournalDoctorSummarySchema, sessionJournalDebriefSummarySchema, sessionJournalEntrySchema;
1814
2042
  var init_session_journal = __esm({
1815
2043
  "packages/contracts/src/session-journal.ts"() {
1816
2044
  "use strict";
1817
2045
  SESSION_JOURNAL_SCHEMA_VERSION = "1.0";
1818
- sessionJournalDoctorSummarySchema = z7.object({
2046
+ sessionJournalDoctorSummarySchema = z8.object({
1819
2047
  /** `true` when zero noise patterns were detected. */
1820
- isClean: z7.boolean(),
2048
+ isClean: z8.boolean(),
1821
2049
  /** Total number of noise findings across all patterns. */
1822
- findingsCount: z7.number().int().nonnegative(),
2050
+ findingsCount: z8.number().int().nonnegative(),
1823
2051
  /** Pattern names that were detected (empty when isClean). */
1824
- patterns: z7.array(z7.string()),
2052
+ patterns: z8.array(z8.string()),
1825
2053
  /** Total brain entries scanned. `0` = empty or unavailable. */
1826
- totalScanned: z7.number().int().nonnegative()
2054
+ totalScanned: z8.number().int().nonnegative()
1827
2055
  });
1828
- sessionJournalDebriefSummarySchema = z7.object({
2056
+ sessionJournalDebriefSummarySchema = z8.object({
1829
2057
  /** First 200 characters of the session end note (if provided). */
1830
- noteExcerpt: z7.string().max(200).optional(),
2058
+ noteExcerpt: z8.string().max(200).optional(),
1831
2059
  /** Number of tasks completed during the session. */
1832
- tasksCompletedCount: z7.number().int().nonnegative(),
2060
+ tasksCompletedCount: z8.number().int().nonnegative(),
1833
2061
  /** Up to 5 task IDs (not titles) that were the focus of the session. */
1834
- tasksFocused: z7.array(z7.string()).max(5).optional()
2062
+ tasksFocused: z8.array(z8.string()).max(5).optional()
1835
2063
  });
1836
- sessionJournalEntrySchema = z7.object({
2064
+ sessionJournalEntrySchema = z8.object({
1837
2065
  // Identity
1838
2066
  /** Schema version for forward-compatibility. Always `'1.0'` in this release. */
1839
- schemaVersion: z7.literal(SESSION_JOURNAL_SCHEMA_VERSION),
2067
+ schemaVersion: z8.literal(SESSION_JOURNAL_SCHEMA_VERSION),
1840
2068
  /** ISO 8601 timestamp when the entry was written. */
1841
- timestamp: z7.string(),
2069
+ timestamp: z8.string(),
1842
2070
  /** CLEO session ID (e.g. `ses_20260424055456_ede571`). */
1843
- sessionId: z7.string(),
2071
+ sessionId: z8.string(),
1844
2072
  /** Event type that triggered this journal entry. */
1845
- eventType: z7.enum(["session_start", "session_end", "observation", "decision", "error"]),
2073
+ eventType: z8.enum(["session_start", "session_end", "observation", "decision", "error"]),
1846
2074
  // Session metadata (set on session_start / session_end)
1847
2075
  /** Agent identifier (e.g. `cleo-prime`, `claude-code`). */
1848
- agentIdentifier: z7.string().optional(),
2076
+ agentIdentifier: z8.string().optional(),
1849
2077
  /** Provider adapter ID active for this session. */
1850
- providerId: z7.string().optional(),
2078
+ providerId: z8.string().optional(),
1851
2079
  /** Session scope string (e.g. `'global'` or `'epic:T1263'`). */
1852
- scope: z7.string().optional(),
2080
+ scope: z8.string().optional(),
1853
2081
  // Session-end fields
1854
2082
  /** Duration of the session in seconds (session_end only). */
1855
- duration: z7.number().int().nonnegative().optional(),
2083
+ duration: z8.number().int().nonnegative().optional(),
1856
2084
  /** Task IDs (not titles) completed during the session. */
1857
- tasksCompleted: z7.array(z7.string()).optional(),
2085
+ tasksCompleted: z8.array(z8.string()).optional(),
1858
2086
  // Doctor summary (T1262 absorbed)
1859
2087
  /** Compact result of `scanBrainNoise` run at session-end. */
1860
2088
  doctorSummary: sessionJournalDoctorSummarySchema.optional(),
@@ -1863,7 +2091,7 @@ var init_session_journal = __esm({
1863
2091
  debriefSummary: sessionJournalDebriefSummarySchema.optional(),
1864
2092
  // Optional hash chain
1865
2093
  /** SHA-256 hex of the previous entry's raw JSON string (for integrity chain). */
1866
- prevEntryHash: z7.string().optional()
2094
+ prevEntryHash: z8.string().optional()
1867
2095
  });
1868
2096
  }
1869
2097
  });
@@ -1883,52 +2111,52 @@ var init_task = __esm({
1883
2111
  });
1884
2112
 
1885
2113
  // packages/contracts/src/task-evidence.ts
1886
- import { z as z8 } from "zod";
2114
+ import { z as z9 } from "zod";
1887
2115
  var fileEvidenceSchema, logEvidenceSchema, screenshotEvidenceSchema, testOutputEvidenceSchema, commandOutputEvidenceSchema, taskEvidenceSchema;
1888
2116
  var init_task_evidence = __esm({
1889
2117
  "packages/contracts/src/task-evidence.ts"() {
1890
2118
  "use strict";
1891
- fileEvidenceSchema = z8.object({
1892
- kind: z8.literal("file"),
1893
- sha256: z8.string().length(64),
1894
- timestamp: z8.string().datetime(),
1895
- path: z8.string().min(1),
1896
- mime: z8.string().optional(),
1897
- description: z8.string().optional()
1898
- });
1899
- logEvidenceSchema = z8.object({
1900
- kind: z8.literal("log"),
1901
- sha256: z8.string().length(64),
1902
- timestamp: z8.string().datetime(),
1903
- source: z8.string().min(1),
1904
- description: z8.string().optional()
1905
- });
1906
- screenshotEvidenceSchema = z8.object({
1907
- kind: z8.literal("screenshot"),
1908
- sha256: z8.string().length(64),
1909
- timestamp: z8.string().datetime(),
1910
- mime: z8.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
1911
- description: z8.string().optional()
1912
- });
1913
- testOutputEvidenceSchema = z8.object({
1914
- kind: z8.literal("test-output"),
1915
- sha256: z8.string().length(64),
1916
- timestamp: z8.string().datetime(),
1917
- passed: z8.number().int().nonnegative(),
1918
- failed: z8.number().int().nonnegative(),
1919
- skipped: z8.number().int().nonnegative(),
1920
- exitCode: z8.number().int(),
1921
- description: z8.string().optional()
1922
- });
1923
- commandOutputEvidenceSchema = z8.object({
1924
- kind: z8.literal("command-output"),
1925
- sha256: z8.string().length(64),
1926
- timestamp: z8.string().datetime(),
1927
- cmd: z8.string().min(1),
1928
- exitCode: z8.number().int(),
1929
- description: z8.string().optional()
1930
- });
1931
- taskEvidenceSchema = z8.discriminatedUnion("kind", [
2119
+ fileEvidenceSchema = z9.object({
2120
+ kind: z9.literal("file"),
2121
+ sha256: z9.string().length(64),
2122
+ timestamp: z9.string().datetime(),
2123
+ path: z9.string().min(1),
2124
+ mime: z9.string().optional(),
2125
+ description: z9.string().optional()
2126
+ });
2127
+ logEvidenceSchema = z9.object({
2128
+ kind: z9.literal("log"),
2129
+ sha256: z9.string().length(64),
2130
+ timestamp: z9.string().datetime(),
2131
+ source: z9.string().min(1),
2132
+ description: z9.string().optional()
2133
+ });
2134
+ screenshotEvidenceSchema = z9.object({
2135
+ kind: z9.literal("screenshot"),
2136
+ sha256: z9.string().length(64),
2137
+ timestamp: z9.string().datetime(),
2138
+ mime: z9.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
2139
+ description: z9.string().optional()
2140
+ });
2141
+ testOutputEvidenceSchema = z9.object({
2142
+ kind: z9.literal("test-output"),
2143
+ sha256: z9.string().length(64),
2144
+ timestamp: z9.string().datetime(),
2145
+ passed: z9.number().int().nonnegative(),
2146
+ failed: z9.number().int().nonnegative(),
2147
+ skipped: z9.number().int().nonnegative(),
2148
+ exitCode: z9.number().int(),
2149
+ description: z9.string().optional()
2150
+ });
2151
+ commandOutputEvidenceSchema = z9.object({
2152
+ kind: z9.literal("command-output"),
2153
+ sha256: z9.string().length(64),
2154
+ timestamp: z9.string().datetime(),
2155
+ cmd: z9.string().min(1),
2156
+ exitCode: z9.number().int(),
2157
+ description: z9.string().optional()
2158
+ });
2159
+ taskEvidenceSchema = z9.discriminatedUnion("kind", [
1932
2160
  fileEvidenceSchema,
1933
2161
  logEvidenceSchema,
1934
2162
  screenshotEvidenceSchema,
@@ -1939,12 +2167,12 @@ var init_task_evidence = __esm({
1939
2167
  });
1940
2168
 
1941
2169
  // packages/contracts/src/tasks/archive.ts
1942
- import { z as z9 } from "zod";
2170
+ import { z as z10 } from "zod";
1943
2171
  var ArchiveReason, ARCHIVE_REASON_VALUES;
1944
2172
  var init_archive = __esm({
1945
2173
  "packages/contracts/src/tasks/archive.ts"() {
1946
2174
  "use strict";
1947
- ArchiveReason = z9.enum([
2175
+ ArchiveReason = z10.enum([
1948
2176
  "verified",
1949
2177
  "reconciled",
1950
2178
  "superseded",
@@ -1973,10 +2201,12 @@ var init_src = __esm({
1973
2201
  init_engine_result();
1974
2202
  init_enums();
1975
2203
  init_errors();
2204
+ init_evidence_atom_schema();
1976
2205
  init_evidence_record_schema();
1977
2206
  init_exit_codes();
1978
2207
  init_facade();
1979
2208
  init_graph();
2209
+ init_invariants();
1980
2210
  init_lafs();
1981
2211
  init_plugin_llm();
1982
2212
  init_observe();
@@ -16012,7 +16242,7 @@ function resolveRef(ref, ctx) {
16012
16242
  function convertBaseSchema(schema, ctx) {
16013
16243
  if (schema.not !== void 0) {
16014
16244
  if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
16015
- return z10.never();
16245
+ return z11.never();
16016
16246
  }
16017
16247
  throw new Error("not is not supported in Zod (except { not: {} } for never)");
16018
16248
  }
@@ -16034,7 +16264,7 @@ function convertBaseSchema(schema, ctx) {
16034
16264
  return ctx.refs.get(refPath);
16035
16265
  }
16036
16266
  if (ctx.processing.has(refPath)) {
16037
- return z10.lazy(() => {
16267
+ return z11.lazy(() => {
16038
16268
  if (!ctx.refs.has(refPath)) {
16039
16269
  throw new Error(`Circular reference not resolved: ${refPath}`);
16040
16270
  }
@@ -16051,25 +16281,25 @@ function convertBaseSchema(schema, ctx) {
16051
16281
  if (schema.enum !== void 0) {
16052
16282
  const enumValues = schema.enum;
16053
16283
  if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
16054
- return z10.null();
16284
+ return z11.null();
16055
16285
  }
16056
16286
  if (enumValues.length === 0) {
16057
- return z10.never();
16287
+ return z11.never();
16058
16288
  }
16059
16289
  if (enumValues.length === 1) {
16060
- return z10.literal(enumValues[0]);
16290
+ return z11.literal(enumValues[0]);
16061
16291
  }
16062
16292
  if (enumValues.every((v) => typeof v === "string")) {
16063
- return z10.enum(enumValues);
16293
+ return z11.enum(enumValues);
16064
16294
  }
16065
- const literalSchemas = enumValues.map((v) => z10.literal(v));
16295
+ const literalSchemas = enumValues.map((v) => z11.literal(v));
16066
16296
  if (literalSchemas.length < 2) {
16067
16297
  return literalSchemas[0];
16068
16298
  }
16069
- return z10.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
16299
+ return z11.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
16070
16300
  }
16071
16301
  if (schema.const !== void 0) {
16072
- return z10.literal(schema.const);
16302
+ return z11.literal(schema.const);
16073
16303
  }
16074
16304
  const type = schema.type;
16075
16305
  if (Array.isArray(type)) {
@@ -16078,68 +16308,68 @@ function convertBaseSchema(schema, ctx) {
16078
16308
  return convertBaseSchema(typeSchema, ctx);
16079
16309
  });
16080
16310
  if (typeSchemas.length === 0) {
16081
- return z10.never();
16311
+ return z11.never();
16082
16312
  }
16083
16313
  if (typeSchemas.length === 1) {
16084
16314
  return typeSchemas[0];
16085
16315
  }
16086
- return z10.union(typeSchemas);
16316
+ return z11.union(typeSchemas);
16087
16317
  }
16088
16318
  if (!type) {
16089
- return z10.any();
16319
+ return z11.any();
16090
16320
  }
16091
16321
  let zodSchema2;
16092
16322
  switch (type) {
16093
16323
  case "string": {
16094
- let stringSchema = z10.string();
16324
+ let stringSchema = z11.string();
16095
16325
  if (schema.format) {
16096
16326
  const format = schema.format;
16097
16327
  if (format === "email") {
16098
- stringSchema = stringSchema.check(z10.email());
16328
+ stringSchema = stringSchema.check(z11.email());
16099
16329
  } else if (format === "uri" || format === "uri-reference") {
16100
- stringSchema = stringSchema.check(z10.url());
16330
+ stringSchema = stringSchema.check(z11.url());
16101
16331
  } else if (format === "uuid" || format === "guid") {
16102
- stringSchema = stringSchema.check(z10.uuid());
16332
+ stringSchema = stringSchema.check(z11.uuid());
16103
16333
  } else if (format === "date-time") {
16104
- stringSchema = stringSchema.check(z10.iso.datetime());
16334
+ stringSchema = stringSchema.check(z11.iso.datetime());
16105
16335
  } else if (format === "date") {
16106
- stringSchema = stringSchema.check(z10.iso.date());
16336
+ stringSchema = stringSchema.check(z11.iso.date());
16107
16337
  } else if (format === "time") {
16108
- stringSchema = stringSchema.check(z10.iso.time());
16338
+ stringSchema = stringSchema.check(z11.iso.time());
16109
16339
  } else if (format === "duration") {
16110
- stringSchema = stringSchema.check(z10.iso.duration());
16340
+ stringSchema = stringSchema.check(z11.iso.duration());
16111
16341
  } else if (format === "ipv4") {
16112
- stringSchema = stringSchema.check(z10.ipv4());
16342
+ stringSchema = stringSchema.check(z11.ipv4());
16113
16343
  } else if (format === "ipv6") {
16114
- stringSchema = stringSchema.check(z10.ipv6());
16344
+ stringSchema = stringSchema.check(z11.ipv6());
16115
16345
  } else if (format === "mac") {
16116
- stringSchema = stringSchema.check(z10.mac());
16346
+ stringSchema = stringSchema.check(z11.mac());
16117
16347
  } else if (format === "cidr") {
16118
- stringSchema = stringSchema.check(z10.cidrv4());
16348
+ stringSchema = stringSchema.check(z11.cidrv4());
16119
16349
  } else if (format === "cidr-v6") {
16120
- stringSchema = stringSchema.check(z10.cidrv6());
16350
+ stringSchema = stringSchema.check(z11.cidrv6());
16121
16351
  } else if (format === "base64") {
16122
- stringSchema = stringSchema.check(z10.base64());
16352
+ stringSchema = stringSchema.check(z11.base64());
16123
16353
  } else if (format === "base64url") {
16124
- stringSchema = stringSchema.check(z10.base64url());
16354
+ stringSchema = stringSchema.check(z11.base64url());
16125
16355
  } else if (format === "e164") {
16126
- stringSchema = stringSchema.check(z10.e164());
16356
+ stringSchema = stringSchema.check(z11.e164());
16127
16357
  } else if (format === "jwt") {
16128
- stringSchema = stringSchema.check(z10.jwt());
16358
+ stringSchema = stringSchema.check(z11.jwt());
16129
16359
  } else if (format === "emoji") {
16130
- stringSchema = stringSchema.check(z10.emoji());
16360
+ stringSchema = stringSchema.check(z11.emoji());
16131
16361
  } else if (format === "nanoid") {
16132
- stringSchema = stringSchema.check(z10.nanoid());
16362
+ stringSchema = stringSchema.check(z11.nanoid());
16133
16363
  } else if (format === "cuid") {
16134
- stringSchema = stringSchema.check(z10.cuid());
16364
+ stringSchema = stringSchema.check(z11.cuid());
16135
16365
  } else if (format === "cuid2") {
16136
- stringSchema = stringSchema.check(z10.cuid2());
16366
+ stringSchema = stringSchema.check(z11.cuid2());
16137
16367
  } else if (format === "ulid") {
16138
- stringSchema = stringSchema.check(z10.ulid());
16368
+ stringSchema = stringSchema.check(z11.ulid());
16139
16369
  } else if (format === "xid") {
16140
- stringSchema = stringSchema.check(z10.xid());
16370
+ stringSchema = stringSchema.check(z11.xid());
16141
16371
  } else if (format === "ksuid") {
16142
- stringSchema = stringSchema.check(z10.ksuid());
16372
+ stringSchema = stringSchema.check(z11.ksuid());
16143
16373
  }
16144
16374
  }
16145
16375
  if (typeof schema.minLength === "number") {
@@ -16156,7 +16386,7 @@ function convertBaseSchema(schema, ctx) {
16156
16386
  }
16157
16387
  case "number":
16158
16388
  case "integer": {
16159
- let numberSchema = type === "integer" ? z10.number().int() : z10.number();
16389
+ let numberSchema = type === "integer" ? z11.number().int() : z11.number();
16160
16390
  if (typeof schema.minimum === "number") {
16161
16391
  numberSchema = numberSchema.min(schema.minimum);
16162
16392
  }
@@ -16180,11 +16410,11 @@ function convertBaseSchema(schema, ctx) {
16180
16410
  break;
16181
16411
  }
16182
16412
  case "boolean": {
16183
- zodSchema2 = z10.boolean();
16413
+ zodSchema2 = z11.boolean();
16184
16414
  break;
16185
16415
  }
16186
16416
  case "null": {
16187
- zodSchema2 = z10.null();
16417
+ zodSchema2 = z11.null();
16188
16418
  break;
16189
16419
  }
16190
16420
  case "object": {
@@ -16197,14 +16427,14 @@ function convertBaseSchema(schema, ctx) {
16197
16427
  }
16198
16428
  if (schema.propertyNames) {
16199
16429
  const keySchema = convertSchema(schema.propertyNames, ctx);
16200
- const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z10.any();
16430
+ const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z11.any();
16201
16431
  if (Object.keys(shape).length === 0) {
16202
- zodSchema2 = z10.record(keySchema, valueSchema);
16432
+ zodSchema2 = z11.record(keySchema, valueSchema);
16203
16433
  break;
16204
16434
  }
16205
- const objectSchema2 = z10.object(shape).passthrough();
16206
- const recordSchema = z10.looseRecord(keySchema, valueSchema);
16207
- zodSchema2 = z10.intersection(objectSchema2, recordSchema);
16435
+ const objectSchema2 = z11.object(shape).passthrough();
16436
+ const recordSchema = z11.looseRecord(keySchema, valueSchema);
16437
+ zodSchema2 = z11.intersection(objectSchema2, recordSchema);
16208
16438
  break;
16209
16439
  }
16210
16440
  if (schema.patternProperties) {
@@ -16213,28 +16443,28 @@ function convertBaseSchema(schema, ctx) {
16213
16443
  const looseRecords = [];
16214
16444
  for (const pattern of patternKeys) {
16215
16445
  const patternValue = convertSchema(patternProps[pattern], ctx);
16216
- const keySchema = z10.string().regex(new RegExp(pattern));
16217
- looseRecords.push(z10.looseRecord(keySchema, patternValue));
16446
+ const keySchema = z11.string().regex(new RegExp(pattern));
16447
+ looseRecords.push(z11.looseRecord(keySchema, patternValue));
16218
16448
  }
16219
16449
  const schemasToIntersect = [];
16220
16450
  if (Object.keys(shape).length > 0) {
16221
- schemasToIntersect.push(z10.object(shape).passthrough());
16451
+ schemasToIntersect.push(z11.object(shape).passthrough());
16222
16452
  }
16223
16453
  schemasToIntersect.push(...looseRecords);
16224
16454
  if (schemasToIntersect.length === 0) {
16225
- zodSchema2 = z10.object({}).passthrough();
16455
+ zodSchema2 = z11.object({}).passthrough();
16226
16456
  } else if (schemasToIntersect.length === 1) {
16227
16457
  zodSchema2 = schemasToIntersect[0];
16228
16458
  } else {
16229
- let result = z10.intersection(schemasToIntersect[0], schemasToIntersect[1]);
16459
+ let result = z11.intersection(schemasToIntersect[0], schemasToIntersect[1]);
16230
16460
  for (let i = 2; i < schemasToIntersect.length; i++) {
16231
- result = z10.intersection(result, schemasToIntersect[i]);
16461
+ result = z11.intersection(result, schemasToIntersect[i]);
16232
16462
  }
16233
16463
  zodSchema2 = result;
16234
16464
  }
16235
16465
  break;
16236
16466
  }
16237
- const objectSchema = z10.object(shape);
16467
+ const objectSchema = z11.object(shape);
16238
16468
  if (schema.additionalProperties === false) {
16239
16469
  zodSchema2 = objectSchema.strict();
16240
16470
  } else if (typeof schema.additionalProperties === "object") {
@@ -16251,33 +16481,33 @@ function convertBaseSchema(schema, ctx) {
16251
16481
  const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
16252
16482
  const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0;
16253
16483
  if (rest) {
16254
- zodSchema2 = z10.tuple(tupleItems).rest(rest);
16484
+ zodSchema2 = z11.tuple(tupleItems).rest(rest);
16255
16485
  } else {
16256
- zodSchema2 = z10.tuple(tupleItems);
16486
+ zodSchema2 = z11.tuple(tupleItems);
16257
16487
  }
16258
16488
  if (typeof schema.minItems === "number") {
16259
- zodSchema2 = zodSchema2.check(z10.minLength(schema.minItems));
16489
+ zodSchema2 = zodSchema2.check(z11.minLength(schema.minItems));
16260
16490
  }
16261
16491
  if (typeof schema.maxItems === "number") {
16262
- zodSchema2 = zodSchema2.check(z10.maxLength(schema.maxItems));
16492
+ zodSchema2 = zodSchema2.check(z11.maxLength(schema.maxItems));
16263
16493
  }
16264
16494
  } else if (Array.isArray(items)) {
16265
16495
  const tupleItems = items.map((item) => convertSchema(item, ctx));
16266
16496
  const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : void 0;
16267
16497
  if (rest) {
16268
- zodSchema2 = z10.tuple(tupleItems).rest(rest);
16498
+ zodSchema2 = z11.tuple(tupleItems).rest(rest);
16269
16499
  } else {
16270
- zodSchema2 = z10.tuple(tupleItems);
16500
+ zodSchema2 = z11.tuple(tupleItems);
16271
16501
  }
16272
16502
  if (typeof schema.minItems === "number") {
16273
- zodSchema2 = zodSchema2.check(z10.minLength(schema.minItems));
16503
+ zodSchema2 = zodSchema2.check(z11.minLength(schema.minItems));
16274
16504
  }
16275
16505
  if (typeof schema.maxItems === "number") {
16276
- zodSchema2 = zodSchema2.check(z10.maxLength(schema.maxItems));
16506
+ zodSchema2 = zodSchema2.check(z11.maxLength(schema.maxItems));
16277
16507
  }
16278
16508
  } else if (items !== void 0) {
16279
16509
  const element = convertSchema(items, ctx);
16280
- let arraySchema = z10.array(element);
16510
+ let arraySchema = z11.array(element);
16281
16511
  if (typeof schema.minItems === "number") {
16282
16512
  arraySchema = arraySchema.min(schema.minItems);
16283
16513
  }
@@ -16286,7 +16516,7 @@ function convertBaseSchema(schema, ctx) {
16286
16516
  }
16287
16517
  zodSchema2 = arraySchema;
16288
16518
  } else {
16289
- zodSchema2 = z10.array(z10.any());
16519
+ zodSchema2 = z11.array(z11.any());
16290
16520
  }
16291
16521
  break;
16292
16522
  }
@@ -16303,37 +16533,37 @@ function convertBaseSchema(schema, ctx) {
16303
16533
  }
16304
16534
  function convertSchema(schema, ctx) {
16305
16535
  if (typeof schema === "boolean") {
16306
- return schema ? z10.any() : z10.never();
16536
+ return schema ? z11.any() : z11.never();
16307
16537
  }
16308
16538
  let baseSchema = convertBaseSchema(schema, ctx);
16309
16539
  const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
16310
16540
  if (schema.anyOf && Array.isArray(schema.anyOf)) {
16311
16541
  const options = schema.anyOf.map((s) => convertSchema(s, ctx));
16312
- const anyOfUnion = z10.union(options);
16313
- baseSchema = hasExplicitType ? z10.intersection(baseSchema, anyOfUnion) : anyOfUnion;
16542
+ const anyOfUnion = z11.union(options);
16543
+ baseSchema = hasExplicitType ? z11.intersection(baseSchema, anyOfUnion) : anyOfUnion;
16314
16544
  }
16315
16545
  if (schema.oneOf && Array.isArray(schema.oneOf)) {
16316
16546
  const options = schema.oneOf.map((s) => convertSchema(s, ctx));
16317
- const oneOfUnion = z10.xor(options);
16318
- baseSchema = hasExplicitType ? z10.intersection(baseSchema, oneOfUnion) : oneOfUnion;
16547
+ const oneOfUnion = z11.xor(options);
16548
+ baseSchema = hasExplicitType ? z11.intersection(baseSchema, oneOfUnion) : oneOfUnion;
16319
16549
  }
16320
16550
  if (schema.allOf && Array.isArray(schema.allOf)) {
16321
16551
  if (schema.allOf.length === 0) {
16322
- baseSchema = hasExplicitType ? baseSchema : z10.any();
16552
+ baseSchema = hasExplicitType ? baseSchema : z11.any();
16323
16553
  } else {
16324
16554
  let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
16325
16555
  const startIdx = hasExplicitType ? 0 : 1;
16326
16556
  for (let i = startIdx; i < schema.allOf.length; i++) {
16327
- result = z10.intersection(result, convertSchema(schema.allOf[i], ctx));
16557
+ result = z11.intersection(result, convertSchema(schema.allOf[i], ctx));
16328
16558
  }
16329
16559
  baseSchema = result;
16330
16560
  }
16331
16561
  }
16332
16562
  if (schema.nullable === true && ctx.version === "openapi-3.0") {
16333
- baseSchema = z10.nullable(baseSchema);
16563
+ baseSchema = z11.nullable(baseSchema);
16334
16564
  }
16335
16565
  if (schema.readOnly === true) {
16336
- baseSchema = z10.readonly(baseSchema);
16566
+ baseSchema = z11.readonly(baseSchema);
16337
16567
  }
16338
16568
  const extraMeta = {};
16339
16569
  const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
@@ -16360,7 +16590,7 @@ function convertSchema(schema, ctx) {
16360
16590
  }
16361
16591
  function fromJSONSchema(schema, params) {
16362
16592
  if (typeof schema === "boolean") {
16363
- return schema ? z10.any() : z10.never();
16593
+ return schema ? z11.any() : z11.never();
16364
16594
  }
16365
16595
  const version2 = detectVersion(schema, params?.defaultTarget);
16366
16596
  const defs = schema.$defs || schema.definitions || {};
@@ -16374,14 +16604,14 @@ function fromJSONSchema(schema, params) {
16374
16604
  };
16375
16605
  return convertSchema(schema, ctx);
16376
16606
  }
16377
- var z10, RECOGNIZED_KEYS;
16607
+ var z11, RECOGNIZED_KEYS;
16378
16608
  var init_from_json_schema = __esm({
16379
16609
  "node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/from-json-schema.js"() {
16380
16610
  init_registries();
16381
16611
  init_checks2();
16382
16612
  init_iso();
16383
16613
  init_schemas2();
16384
- z10 = {
16614
+ z11 = {
16385
16615
  ...schemas_exports2,
16386
16616
  ...checks_exports2,
16387
16617
  iso: iso_exports