@cleocode/adapters 2026.11.1-canary.9 → 2026.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/.source-stamp.json +1 -1
  2. package/dist/index.js +1691 -1354
  3. package/dist/index.js.map +3 -3
  4. package/dist/orca-execution.d.ts +90 -0
  5. package/dist/orca-execution.d.ts.map +1 -0
  6. package/dist/orca-execution.js +843 -0
  7. package/dist/orca-execution.js.map +6 -0
  8. package/dist/providers/claude-code/index.js +1689 -1357
  9. package/dist/providers/claude-code/index.js.map +3 -3
  10. package/dist/providers/claude-code/lead-session.d.ts +8 -5
  11. package/dist/providers/claude-code/lead-session.d.ts.map +1 -1
  12. package/dist/providers/claude-sdk/index.js +1674 -1352
  13. package/dist/providers/claude-sdk/index.js.map +3 -3
  14. package/dist/providers/claude-sdk/spawn.d.ts.map +1 -1
  15. package/dist/providers/codex/index.js +1540 -1233
  16. package/dist/providers/codex/index.js.map +3 -3
  17. package/dist/providers/gemini-cli/index.js +1540 -1233
  18. package/dist/providers/gemini-cli/index.js.map +3 -3
  19. package/dist/providers/kimi/index.js +1540 -1233
  20. package/dist/providers/kimi/index.js.map +3 -3
  21. package/dist/providers/openai-sdk/index.js +1660 -1353
  22. package/dist/providers/openai-sdk/index.js.map +3 -3
  23. package/dist/providers/opencode/index.js +1540 -1233
  24. package/dist/providers/opencode/index.js.map +3 -3
  25. package/dist/providers/pi/index.js +1540 -1233
  26. package/dist/providers/pi/index.js.map +3 -3
  27. package/package.json +10 -6
  28. package/src/__tests__/orca-execution-fixture.ts +422 -0
  29. package/src/__tests__/orca-execution.test.ts +1357 -0
  30. package/src/__tests__/orca-plugin-panel.test.ts +661 -0
  31. package/src/__tests__/orca-plugin.test.ts +660 -0
  32. package/src/orca-execution.ts +1193 -0
  33. package/src/providers/claude-code/__tests__/lead-mcp.test.ts +27 -2
  34. package/src/providers/claude-code/lead-session.ts +21 -8
  35. package/src/providers/claude-sdk/__tests__/spawn.test.ts +19 -0
  36. package/src/providers/claude-sdk/spawn.ts +14 -0
  37. package/src/providers/shared/__tests__/lead-tool-strip.test.ts +1 -1
@@ -1422,17 +1422,321 @@ var ChangesetEntrySchema = z3.object({
1422
1422
  });
1423
1423
 
1424
1424
  // packages/contracts/src/config/manifest.ts
1425
- import { z as z5 } from "zod";
1425
+ import { z as z6 } from "zod";
1426
1426
 
1427
- // packages/contracts/src/config/worker-policy.ts
1427
+ // packages/contracts/src/orca-execution.ts
1428
1428
  import { z as z4 } from "zod";
1429
- var projectWorkerPolicySchema = z4.object({
1430
- verification: z4.object({
1431
- full: z4.enum(["local", "ci"]),
1432
- local: z4.enum(["single-file", "affected"])
1429
+ var identifier = z4.string().min(1);
1430
+ var orcaAgentSchema = z4.enum(["codex", "opencode2", "claude", "grok"]);
1431
+ var DEFAULT_ORCA_AGENTS = ["codex", "opencode2", "claude"];
1432
+ var orchestrateOrcaConfigSchema = z4.object({
1433
+ agents: z4.array(orcaAgentSchema).min(1).refine((agents) => new Set(agents).size === agents.length, "Agent ids must be unique.").default(DEFAULT_ORCA_AGENTS)
1434
+ });
1435
+ var orcaContextSchema = z4.object({
1436
+ runtimeId: identifier,
1437
+ coordinatorHandle: identifier,
1438
+ executionHostId: z4.literal("local")
1439
+ });
1440
+ var orcaRoutingRunSchema = z4.object({
1441
+ runId: identifier.nullable(),
1442
+ unconfiguredAgents: z4.array(orcaAgentSchema)
1443
+ });
1444
+ var orcaLaunchSchema = z4.object({
1445
+ projectId: identifier,
1446
+ projectRoot: identifier,
1447
+ taskId: identifier,
1448
+ instanceId: identifier,
1449
+ workerSessionId: identifier,
1450
+ agentId: identifier,
1451
+ role: z4.enum(["worker", "lead"]),
1452
+ protocol: identifier,
1453
+ worktreePath: identifier,
1454
+ worktreeBranch: identifier,
1455
+ projectHash: identifier,
1456
+ lockToken: identifier,
1457
+ prompt: identifier,
1458
+ harness: z4.enum(["claude-code", "codex", "opencode", "grok", "kimi"]),
1459
+ leadMailbox: identifier.nullable(),
1460
+ model: identifier.optional(),
1461
+ effort: identifier.optional(),
1462
+ accountId: identifier.optional()
1463
+ });
1464
+ var orcaStartBindingSchema = z4.object({
1465
+ runId: identifier.nullable(),
1466
+ orcaTaskId: identifier.nullable(),
1467
+ retryOf: identifier.nullable()
1468
+ });
1469
+ var orcaAttemptSchema = z4.object({
1470
+ backend: z4.literal("orca"),
1471
+ version: z4.literal(1),
1472
+ /** Monotonic local CAS revision; repeated identical observations still serialize. */
1473
+ revision: z4.number().int().nonnegative(),
1474
+ context: orcaContextSchema,
1475
+ launch: orcaLaunchSchema,
1476
+ promptDigest: z4.string().regex(/^[a-f0-9]{64}$/),
1477
+ workspaceId: identifier,
1478
+ workspaceSelector: identifier,
1479
+ state: z4.enum([
1480
+ "prepared",
1481
+ "launching",
1482
+ "ready",
1483
+ "turn_unobserved",
1484
+ "outcome_unknown",
1485
+ "stop_pending",
1486
+ "stop_unknown",
1487
+ "stopped",
1488
+ "failed",
1489
+ "circuit_broken"
1490
+ ]),
1491
+ runId: identifier.nullable(),
1492
+ orcaTaskId: identifier.nullable(),
1493
+ dispatchId: identifier.nullable(),
1494
+ retryOf: identifier.nullable(),
1495
+ /** Absent on legacy records, whose original argv cannot safely be reconstructed. */
1496
+ startBinding: orcaStartBindingSchema.optional(),
1497
+ /** UUID reserved before committing a retry; its first send and every replay use this key. */
1498
+ startRequestKey: z4.string().uuid().optional(),
1499
+ startRequestId: identifier.nullable(),
1500
+ /** UUID reserved before committing a stop; its first send and every replay use this key. */
1501
+ stopRequestKey: z4.string().uuid().optional(),
1502
+ /** Orca-issued stop request id, retained only when the stop receipt was received. */
1503
+ stopRequestId: identifier.nullable(),
1504
+ /**
1505
+ * Set when the worker-stop reply came from a runtime that proved it enumerates
1506
+ * every helper it stopped, so an omitted helper list means the worker had none.
1507
+ */
1508
+ stopHelperEvidence: z4.literal("enumerated").optional(),
1509
+ failureCount: z4.number().int().nonnegative(),
1510
+ resourceState: z4.string(),
1511
+ /** Full receipts retain effects, residual resources and recovery advice. */
1512
+ lastReceipt: z4.string().nullable(),
1513
+ lastError: z4.string().nullable(),
1514
+ /** Confirmed pre-dispatch refusal; never inferred from a process exit. */
1515
+ startRefusal: z4.literal("agent_unconfigured").optional(),
1516
+ observedAt: z4.string()
1517
+ });
1518
+ var orcaWorkerDoneSchema = z4.object({
1519
+ messageId: identifier,
1520
+ runtimeId: identifier,
1521
+ runId: identifier,
1522
+ orcaTaskId: identifier,
1523
+ dispatchId: identifier,
1524
+ senderHandle: identifier,
1525
+ outcome: z4.enum(["succeeded", "failed"]),
1526
+ body: z4.string(),
1527
+ reportPath: identifier
1528
+ });
1529
+ var orcaWorkerReportSchema = z4.object({
1530
+ event: orcaWorkerDoneSchema,
1531
+ manifestId: identifier,
1532
+ manifestDigest: z4.string().regex(/^[a-f0-9]{64}$/),
1533
+ reportText: z4.string().min(1).max(65536),
1534
+ reportDigest: z4.string().regex(/^[a-f0-9]{64}$/),
1535
+ ingestedAt: z4.string().datetime()
1536
+ });
1537
+ var orcaReportDeliverySchema = z4.object({
1538
+ key: identifier,
1539
+ mailbox: identifier.nullable(),
1540
+ state: z4.enum(["pending", "delivered"]),
1541
+ messageId: identifier.nullable(),
1542
+ deliveredAt: z4.string().datetime().nullable(),
1543
+ lastError: z4.string().nullable()
1544
+ });
1545
+ var orcaWorkerSettlementSchema = z4.object({
1546
+ resourceRelease: z4.object({
1547
+ dispatchId: identifier,
1548
+ releasedAt: z4.string().datetime(),
1549
+ receiptDigest: z4.string().regex(/^[a-f0-9]{64}$/),
1550
+ receipt: identifier
1551
+ }).optional(),
1552
+ retiredAt: z4.string().datetime().optional(),
1553
+ reportDelivery: orcaReportDeliverySchema.optional()
1554
+ });
1555
+ var orcaReportMessageSchema = z4.object({
1556
+ id: identifier,
1557
+ run_id: z4.string().nullable(),
1558
+ delivery_contract: z4.string(),
1559
+ from_handle: z4.string(),
1560
+ to_handle: z4.string(),
1561
+ type: z4.string(),
1562
+ body: z4.string(),
1563
+ payload: z4.string().nullable(),
1564
+ sender_pane_key: z4.string().nullable()
1565
+ });
1566
+ var orcaReportSourceSchema = z4.object({
1567
+ ok: z4.literal(true),
1568
+ _meta: z4.object({ runtimeId: identifier }),
1569
+ result: z4.object({
1570
+ messages: z4.array(z4.json()).optional(),
1571
+ dispatch: z4.object({
1572
+ id: identifier,
1573
+ run_id: identifier,
1574
+ task_id: identifier,
1575
+ assignee_handle: identifier,
1576
+ assignee_pane_key: z4.string().nullable(),
1577
+ status: z4.string()
1578
+ }).optional()
1579
+ })
1580
+ });
1581
+ var orcaWorkerDonePayloadSchema = z4.object({
1582
+ taskId: identifier,
1583
+ dispatchId: identifier,
1584
+ outcome: z4.enum(["succeeded", "failed"]),
1585
+ reportPath: identifier
1586
+ });
1587
+ var orcaWorkerRequestSchema = z4.object({
1588
+ action: z4.enum([
1589
+ "show",
1590
+ "read",
1591
+ "recover-start",
1592
+ "recover-stop",
1593
+ "retry",
1594
+ "stop",
1595
+ "ingest-report",
1596
+ "relay-report"
1597
+ ]),
1598
+ recordId: identifier,
1599
+ cursor: identifier.optional(),
1600
+ messageId: identifier.optional()
1601
+ }).refine(({ action, cursor }) => cursor === void 0 || action === "read", {
1602
+ message: "A source-pinned cursor is accepted only for read.",
1603
+ path: ["cursor"]
1604
+ }).refine(({ action, messageId }) => action === "ingest-report" === (messageId !== void 0), {
1605
+ message: "ingest-report requires an exact message id; other actions do not accept one.",
1606
+ path: ["messageId"]
1607
+ });
1608
+ var effectSchema = z4.object({
1609
+ kind: z4.string(),
1610
+ role: z4.string().optional(),
1611
+ action: z4.string().optional(),
1612
+ id: z4.string().optional()
1613
+ });
1614
+ var selectionSchema = z4.object({
1615
+ agent: z4.string().nullable().optional(),
1616
+ model: z4.string().nullable().optional(),
1617
+ effort: z4.string().nullable().optional()
1618
+ });
1619
+ var orcaReplySchema = z4.object({
1620
+ ok: z4.boolean(),
1621
+ _meta: z4.object({ runtimeId: z4.string().nullable() }).optional(),
1622
+ error: z4.object({
1623
+ code: z4.string(),
1624
+ message: z4.string(),
1625
+ data: z4.object({
1626
+ requestId: identifier.optional(),
1627
+ orchestrationRequestId: identifier.optional(),
1628
+ dispatchId: identifier.optional()
1629
+ }).optional()
1630
+ }).optional(),
1631
+ result: z4.object({
1632
+ state: z4.string().optional(),
1633
+ requestId: identifier.optional(),
1634
+ /**
1635
+ * Mutation ledger identity Orca stamps on every successful mutation result.
1636
+ * @remarks Installed Orca 1.4.255 attaches `{ requestId, replayed }` to the
1637
+ * result it records (`Jy` in the retained source), so a successful stop can
1638
+ * be bound to the request key this attempt issued.
1639
+ */
1640
+ mutation: z4.object({
1641
+ requestId: identifier.optional(),
1642
+ replayed: z4.boolean().optional()
1643
+ }).optional(),
1644
+ stage: z4.string().optional(),
1645
+ turnStart: z4.string().optional(),
1646
+ runId: identifier.optional(),
1647
+ run: z4.object({ id: identifier }).nullable().optional(),
1648
+ taskId: identifier.optional(),
1649
+ dispatchId: identifier.optional(),
1650
+ failureCount: z4.number().int().nonnegative().optional(),
1651
+ effects: z4.array(effectSchema).optional(),
1652
+ residualResources: z4.array(effectSchema).optional(),
1653
+ launch: z4.object({ effective: selectionSchema.optional() }).optional(),
1654
+ lastError: z4.string().nullable().optional(),
1655
+ processAction: z4.string().optional(),
1656
+ helpers: z4.array(
1657
+ z4.object({
1658
+ dispatchId: identifier.optional(),
1659
+ creatorDispatchId: identifier.optional(),
1660
+ outcome: z4.string(),
1661
+ keptOpenBy: identifier.optional(),
1662
+ state: z4.string().optional(),
1663
+ lastError: z4.string().nullable().optional()
1664
+ })
1665
+ ).optional(),
1666
+ helperStopError: z4.string().nullable().optional(),
1667
+ status: z4.string().optional(),
1668
+ terminal: z4.object({
1669
+ handle: identifier,
1670
+ connected: z4.boolean(),
1671
+ writable: z4.boolean(),
1672
+ executionHostId: identifier
1673
+ }).optional(),
1674
+ runtime: z4.object({
1675
+ runtimeId: identifier,
1676
+ reachable: z4.boolean(),
1677
+ state: z4.string(),
1678
+ capabilities: z4.array(z4.string())
1679
+ }).optional(),
1680
+ worktree: z4.object({
1681
+ id: identifier,
1682
+ path: identifier,
1683
+ branch: identifier,
1684
+ hostId: identifier,
1685
+ address: z4.object({ worktree: identifier }).optional()
1686
+ }).optional(),
1687
+ dispatch: z4.object({
1688
+ id: identifier,
1689
+ runId: identifier,
1690
+ taskId: identifier,
1691
+ /** Direct creator Dispatch that started this one; null for a Run root. */
1692
+ creatorDispatchId: identifier.nullable().optional(),
1693
+ failureCount: z4.number().int().nonnegative()
1694
+ }).optional(),
1695
+ worker: z4.object({
1696
+ dispatchId: identifier,
1697
+ runtimeEpoch: identifier,
1698
+ state: z4.string(),
1699
+ stage: z4.string(),
1700
+ worktreeId: identifier.nullable()
1701
+ }).optional(),
1702
+ observation: z4.object({ status: z4.string(), exactWorker: z4.boolean().optional() }).optional(),
1703
+ projection: z4.object({
1704
+ resource: z4.object({
1705
+ state: z4.string(),
1706
+ terminalState: z4.string(),
1707
+ ownerDispatchId: identifier.optional(),
1708
+ releaseState: z4.string().optional()
1709
+ }).optional()
1710
+ }).optional()
1711
+ }).optional()
1712
+ });
1713
+ var orcaCommandRegistrySchema = z4.object({
1714
+ schemaVersion: z4.number().int().positive(),
1715
+ commands: z4.array(z4.object({ command: identifier, flags: z4.array(z4.string()) }))
1716
+ });
1717
+ var accountProviderSchema = z4.object({
1718
+ accounts: z4.array(z4.object({})),
1719
+ activeAccountId: identifier.nullable()
1720
+ });
1721
+ var orcaAccountReplySchema = z4.object({
1722
+ ok: z4.literal(true),
1723
+ _meta: z4.object({ runtimeId: identifier }),
1724
+ result: z4.object({
1725
+ codex: accountProviderSchema,
1726
+ opencode: accountProviderSchema,
1727
+ claude: accountProviderSchema
1728
+ })
1729
+ });
1730
+
1731
+ // packages/contracts/src/config/worker-policy.ts
1732
+ import { z as z5 } from "zod";
1733
+ var projectWorkerPolicySchema = z5.object({
1734
+ verification: z5.object({
1735
+ full: z5.enum(["local", "ci"]),
1736
+ local: z5.enum(["single-file", "affected"])
1433
1737
  }).strict().optional(),
1434
- instructions: z4.array(
1435
- z4.string().min(1).max(512).regex(/\S/).regex(
1738
+ instructions: z5.array(
1739
+ z5.string().min(1).max(512).regex(/\S/).regex(
1436
1740
  /^(?!\s*#)[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+$/u,
1437
1741
  "Instructions must be single-line text without control characters or a leading #"
1438
1742
  )
@@ -1460,8 +1764,11 @@ var CLEO_CONFIG_MANIFEST = {
1460
1764
  path: ".cleo/config.json",
1461
1765
  mergePrecedence: 20,
1462
1766
  driftDetection: "schema-validate",
1463
- schema: z5.object({
1464
- orchestrate: z5.object({ workerPolicy: projectWorkerPolicySchema.optional() }).passthrough().optional()
1767
+ schema: z6.object({
1768
+ orchestrate: z6.object({
1769
+ workerPolicy: projectWorkerPolicySchema.optional(),
1770
+ orca: orchestrateOrcaConfigSchema.optional()
1771
+ }).passthrough().optional()
1465
1772
  }).passthrough()
1466
1773
  };
1467
1774
  var GLOBAL_CLEO_CONFIG_MANIFEST = {
@@ -1477,139 +1784,139 @@ var CONFIG_MANIFEST_ENTRIES = Object.freeze([
1477
1784
  GLOBAL_CLEO_CONFIG_MANIFEST,
1478
1785
  CLEO_CONFIG_MANIFEST
1479
1786
  ]);
1480
- var configManifestEntrySchema = z5.object({
1481
- id: z5.string().min(1),
1482
- scope: z5.union([z5.literal("global"), z5.literal("project"), z5.literal("metadata")]),
1483
- path: z5.string().min(1),
1484
- schema: z5.unknown().optional(),
1485
- mergePrecedence: z5.number().int().nonnegative(),
1486
- driftDetection: z5.union([
1487
- z5.literal("schema-validate"),
1488
- z5.literal("staleness-gate"),
1489
- z5.literal("value-diff"),
1490
- z5.literal("none")
1787
+ var configManifestEntrySchema = z6.object({
1788
+ id: z6.string().min(1),
1789
+ scope: z6.union([z6.literal("global"), z6.literal("project"), z6.literal("metadata")]),
1790
+ path: z6.string().min(1),
1791
+ schema: z6.unknown().optional(),
1792
+ mergePrecedence: z6.number().int().nonnegative(),
1793
+ driftDetection: z6.union([
1794
+ z6.literal("schema-validate"),
1795
+ z6.literal("staleness-gate"),
1796
+ z6.literal("value-diff"),
1797
+ z6.literal("none")
1491
1798
  ]),
1492
- defaults: z5.record(z5.string(), z5.unknown()).optional()
1799
+ defaults: z6.record(z6.string(), z6.unknown()).optional()
1493
1800
  });
1494
1801
 
1495
1802
  // packages/contracts/src/daemon/health.ts
1496
- import { z as z7 } from "zod";
1803
+ import { z as z8 } from "zod";
1497
1804
 
1498
1805
  // packages/contracts/src/supervisor-ipc/messages.ts
1499
- import { z as z6 } from "zod";
1500
- var EnvPairSchema = z6.object({
1806
+ import { z as z7 } from "zod";
1807
+ var EnvPairSchema = z7.object({
1501
1808
  /** Environment variable name. */
1502
- key: z6.string().min(1),
1809
+ key: z7.string().min(1),
1503
1810
  /** Environment variable value. */
1504
- value: z6.string()
1811
+ value: z7.string()
1505
1812
  }).strict();
1506
- var ChildStateSchema = z6.enum(["running", "restarting", "stopped"]);
1507
- var ChildStatusSchema = z6.object({
1813
+ var ChildStateSchema = z7.enum(["running", "restarting", "stopped"]);
1814
+ var ChildStatusSchema = z7.object({
1508
1815
  /** Logical id of the child (stable across restarts). */
1509
- child_id: z6.string().min(1),
1816
+ child_id: z7.string().min(1),
1510
1817
  /** Current OS pid (0 when not currently running). */
1511
- pid: z6.number().int().nonnegative(),
1818
+ pid: z7.number().int().nonnegative(),
1512
1819
  /** Current liveness state. */
1513
1820
  state: ChildStateSchema,
1514
1821
  /** Total restarts observed for this child. */
1515
- restart_count: z6.number().int().nonnegative()
1822
+ restart_count: z7.number().int().nonnegative()
1516
1823
  }).strict();
1517
- var SpawnRequestSchema = z6.object({
1824
+ var SpawnRequestSchema = z7.object({
1518
1825
  /** Tag discriminating this request variant. */
1519
- kind: z6.literal("spawn"),
1826
+ kind: z7.literal("spawn"),
1520
1827
  /** Caller-chosen logical id for the child (stable across restarts). */
1521
- child_id: z6.string().min(1),
1828
+ child_id: z7.string().min(1),
1522
1829
  /** Absolute path to the program to execute. */
1523
- program: z6.string().min(1),
1830
+ program: z7.string().min(1),
1524
1831
  /** Arguments passed to the program. */
1525
- args: z6.array(z6.string()).default([]),
1832
+ args: z7.array(z7.string()).default([]),
1526
1833
  /** Environment overrides applied on top of the supervisor's environment. */
1527
- env: z6.array(EnvPairSchema).default([]),
1834
+ env: z7.array(EnvPairSchema).default([]),
1528
1835
  /** Optional working directory for the child. */
1529
- cwd: z6.string().optional()
1836
+ cwd: z7.string().optional()
1530
1837
  }).strict();
1531
- var RestartRequestSchema = z6.object({
1838
+ var RestartRequestSchema = z7.object({
1532
1839
  /** Tag discriminating this request variant. */
1533
- kind: z6.literal("restart"),
1840
+ kind: z7.literal("restart"),
1534
1841
  /** Logical id of the child to restart. */
1535
- child_id: z6.string().min(1)
1842
+ child_id: z7.string().min(1)
1536
1843
  }).strict();
1537
- var MonitorRequestSchema = z6.object({
1844
+ var MonitorRequestSchema = z7.object({
1538
1845
  /** Tag discriminating this request variant. */
1539
- kind: z6.literal("monitor"),
1846
+ kind: z7.literal("monitor"),
1540
1847
  /** Specific child id to monitor; omit to request all children. */
1541
- child_id: z6.string().optional()
1848
+ child_id: z7.string().optional()
1542
1849
  }).strict();
1543
- var HealthRequestSchema = z6.object({
1850
+ var HealthRequestSchema = z7.object({
1544
1851
  /** Tag discriminating this request variant. */
1545
- kind: z6.literal("health")
1852
+ kind: z7.literal("health")
1546
1853
  }).strict();
1547
- var SupervisorIpcRequestSchema = z6.discriminatedUnion("kind", [
1854
+ var SupervisorIpcRequestSchema = z7.discriminatedUnion("kind", [
1548
1855
  SpawnRequestSchema,
1549
1856
  RestartRequestSchema,
1550
1857
  MonitorRequestSchema,
1551
1858
  HealthRequestSchema
1552
1859
  ]);
1553
- var SpawnedResponseSchema = z6.object({
1860
+ var SpawnedResponseSchema = z7.object({
1554
1861
  /** Tag discriminating this response variant. */
1555
- kind: z6.literal("spawned"),
1862
+ kind: z7.literal("spawned"),
1556
1863
  /** Logical id of the spawned child. */
1557
- child_id: z6.string().min(1),
1864
+ child_id: z7.string().min(1),
1558
1865
  /** OS pid assigned to the spawned child. */
1559
- pid: z6.number().int().nonnegative()
1866
+ pid: z7.number().int().nonnegative()
1560
1867
  }).strict();
1561
- var RestartedResponseSchema = z6.object({
1868
+ var RestartedResponseSchema = z7.object({
1562
1869
  /** Tag discriminating this response variant. */
1563
- kind: z6.literal("restarted"),
1870
+ kind: z7.literal("restarted"),
1564
1871
  /** Logical id of the restarted child. */
1565
- child_id: z6.string().min(1),
1872
+ child_id: z7.string().min(1),
1566
1873
  /** New OS pid after the restart. */
1567
- pid: z6.number().int().nonnegative(),
1874
+ pid: z7.number().int().nonnegative(),
1568
1875
  /** Number of times this child has been restarted in total. */
1569
- restart_count: z6.number().int().nonnegative()
1876
+ restart_count: z7.number().int().nonnegative()
1570
1877
  }).strict();
1571
- var MonitorResponseSchema = z6.object({
1878
+ var MonitorResponseSchema = z7.object({
1572
1879
  /** Tag discriminating this response variant. */
1573
- kind: z6.literal("monitor"),
1880
+ kind: z7.literal("monitor"),
1574
1881
  /** One row per monitored child. */
1575
- children: z6.array(ChildStatusSchema)
1882
+ children: z7.array(ChildStatusSchema)
1576
1883
  }).strict();
1577
- var HealthResponseSchema = z6.object({
1884
+ var HealthResponseSchema = z7.object({
1578
1885
  /** Tag discriminating this response variant. */
1579
- kind: z6.literal("health"),
1886
+ kind: z7.literal("health"),
1580
1887
  /** Supervisor process pid. */
1581
- pid: z6.number().int().nonnegative(),
1888
+ pid: z7.number().int().nonnegative(),
1582
1889
  /** Number of children currently tracked. */
1583
- child_count: z6.number().int().nonnegative(),
1890
+ child_count: z7.number().int().nonnegative(),
1584
1891
  /** Seconds the supervisor has been running. */
1585
- uptime_secs: z6.number().int().nonnegative(),
1892
+ uptime_secs: z7.number().int().nonnegative(),
1586
1893
  /** Frozen protocol version the supervisor speaks. */
1587
- protocol_version: z6.string()
1894
+ protocol_version: z7.string()
1588
1895
  }).strict();
1589
- var LifecycleEventKindSchema = z6.enum(["child_exited", "child_restarted"]);
1590
- var LifecycleEventResponseSchema = z6.object({
1896
+ var LifecycleEventKindSchema = z7.enum(["child_exited", "child_restarted"]);
1897
+ var LifecycleEventResponseSchema = z7.object({
1591
1898
  /** Tag discriminating this response variant. */
1592
- kind: z6.literal("event"),
1899
+ kind: z7.literal("event"),
1593
1900
  /** What happened. */
1594
1901
  event: LifecycleEventKindSchema,
1595
1902
  /** Logical id of the affected child. */
1596
- child_id: z6.string().min(1),
1903
+ child_id: z7.string().min(1),
1597
1904
  /** Exit code, when the OS reported one. */
1598
- exit_code: z6.number().int().optional(),
1905
+ exit_code: z7.number().int().optional(),
1599
1906
  /** Terminating signal name, when the child was signalled (Unix). */
1600
- signal: z6.string().optional(),
1907
+ signal: z7.string().optional(),
1601
1908
  /** Backoff delay (ms) before the pending restart, when applicable. */
1602
- restart_delay_ms: z6.number().int().nonnegative().optional()
1909
+ restart_delay_ms: z7.number().int().nonnegative().optional()
1603
1910
  }).strict();
1604
- var ErrorResponseSchema = z6.object({
1911
+ var ErrorResponseSchema = z7.object({
1605
1912
  /** Tag discriminating this response variant. */
1606
- kind: z6.literal("error"),
1913
+ kind: z7.literal("error"),
1607
1914
  /** Machine-readable error code (e.g. `E_UNKNOWN_CHILD`). */
1608
- code: z6.string().min(1),
1915
+ code: z7.string().min(1),
1609
1916
  /** Human-readable error message. */
1610
- message: z6.string()
1917
+ message: z7.string()
1611
1918
  }).strict();
1612
- var SupervisorIpcResponseSchema = z6.discriminatedUnion("kind", [
1919
+ var SupervisorIpcResponseSchema = z7.discriminatedUnion("kind", [
1613
1920
  SpawnedResponseSchema,
1614
1921
  RestartedResponseSchema,
1615
1922
  MonitorResponseSchema,
@@ -1617,27 +1924,27 @@ var SupervisorIpcResponseSchema = z6.discriminatedUnion("kind", [
1617
1924
  LifecycleEventResponseSchema,
1618
1925
  ErrorResponseSchema
1619
1926
  ]);
1620
- var SupervisorIpcRequestEnvelopeSchema = z6.object({
1927
+ var SupervisorIpcRequestEnvelopeSchema = z7.object({
1621
1928
  /** Frozen protocol version. */
1622
- protocol_version: z6.string(),
1929
+ protocol_version: z7.string(),
1623
1930
  /** Correlation id echoed back on the matching response. */
1624
- id: z6.string().min(1),
1931
+ id: z7.string().min(1),
1625
1932
  /** Direction discriminator. */
1626
- direction: z6.literal("request"),
1933
+ direction: z7.literal("request"),
1627
1934
  /** The request body. */
1628
1935
  request: SupervisorIpcRequestSchema
1629
1936
  }).strict();
1630
- var SupervisorIpcResponseEnvelopeSchema = z6.object({
1937
+ var SupervisorIpcResponseEnvelopeSchema = z7.object({
1631
1938
  /** Frozen protocol version. */
1632
- protocol_version: z6.string(),
1939
+ protocol_version: z7.string(),
1633
1940
  /** Correlation id echoed from the originating request (or a fresh id for events). */
1634
- id: z6.string().min(1),
1941
+ id: z7.string().min(1),
1635
1942
  /** Direction discriminator. */
1636
- direction: z6.literal("response"),
1943
+ direction: z7.literal("response"),
1637
1944
  /** The response body. */
1638
1945
  response: SupervisorIpcResponseSchema
1639
1946
  }).strict();
1640
- var SupervisorIpcEnvelopeSchema = z6.discriminatedUnion("direction", [
1947
+ var SupervisorIpcEnvelopeSchema = z7.discriminatedUnion("direction", [
1641
1948
  SupervisorIpcRequestEnvelopeSchema,
1642
1949
  SupervisorIpcResponseEnvelopeSchema
1643
1950
  ]);
@@ -1661,17 +1968,17 @@ var SubsystemHealthSchema = ChildStatusSchema.extend({
1661
1968
  * Optional human-readable detail (e.g. last error message, queue depth).
1662
1969
  * Diagnostic only — not part of the supervisor wire contract.
1663
1970
  */
1664
- detail: z7.string().optional()
1971
+ detail: z8.string().optional()
1665
1972
  }).strict();
1666
- var HealthStatusSchema = z7.object({
1973
+ var HealthStatusSchema = z8.object({
1667
1974
  /** One health row per registered subsystem. */
1668
- subsystems: z7.array(SubsystemHealthSchema),
1975
+ subsystems: z8.array(SubsystemHealthSchema),
1669
1976
  /**
1670
1977
  * `true` iff every subsystem is in the `running` state. A convenience roll-up
1671
1978
  * derived from {@link HealthStatusSchema.shape.subsystems}; recomputed by
1672
1979
  * {@link summarizeHealth} so producers cannot desync it.
1673
1980
  */
1674
- allHealthy: z7.boolean()
1981
+ allHealthy: z8.boolean()
1675
1982
  }).strict();
1676
1983
 
1677
1984
  // packages/contracts/src/db-inventory.json
@@ -13600,7 +13907,7 @@ var OPERATIONS = [
13600
13907
  ];
13601
13908
 
13602
13909
  // packages/contracts/src/docs/modernize.ts
13603
- import { z as z8 } from "zod";
13910
+ import { z as z9 } from "zod";
13604
13911
  var DOCS_MODERNIZE_DISPOSITIONS = ["keep", "rename", "merge-into", "delete"];
13605
13912
  var DOCS_MODERNIZE_OPS = [
13606
13913
  "ingest",
@@ -13614,105 +13921,105 @@ var DOCS_MODERNIZE_OPS = [
13614
13921
  "reslug",
13615
13922
  "link-task"
13616
13923
  ];
13617
- var judgmentSchema = z8.object({
13618
- question: z8.enum(["classify", "merge"]),
13619
- site: z8.string(),
13620
- mode: z8.enum(["off", "shadow", "on"]),
13621
- ruleAnswer: z8.string(),
13622
- decidedAnswer: z8.string().nullable(),
13623
- decidedConfidence: z8.number().nullable(),
13624
- source: z8.enum(["provider", "cache", "fallback"]),
13625
- acted: z8.string()
13924
+ var judgmentSchema = z9.object({
13925
+ question: z9.enum(["classify", "merge"]),
13926
+ site: z9.string(),
13927
+ mode: z9.enum(["off", "shadow", "on"]),
13928
+ ruleAnswer: z9.string(),
13929
+ decidedAnswer: z9.string().nullable(),
13930
+ decidedConfidence: z9.number().nullable(),
13931
+ source: z9.enum(["provider", "cache", "fallback"]),
13932
+ acted: z9.string()
13626
13933
  });
13627
- var relPath = z8.string().min(1).max(1024);
13628
- var docsModernizePlanSchema = z8.object({
13629
- root: z8.string().min(1),
13630
- generatedAt: z8.string(),
13631
- mode: z8.enum(["tree", "store-only"]),
13632
- counts: z8.record(z8.enum(DOCS_MODERNIZE_DISPOSITIONS), z8.number()),
13633
- rows: z8.array(
13634
- z8.object({
13934
+ var relPath = z9.string().min(1).max(1024);
13935
+ var docsModernizePlanSchema = z9.object({
13936
+ root: z9.string().min(1),
13937
+ generatedAt: z9.string(),
13938
+ mode: z9.enum(["tree", "store-only"]),
13939
+ counts: z9.record(z9.enum(DOCS_MODERNIZE_DISPOSITIONS), z9.number()),
13940
+ rows: z9.array(
13941
+ z9.object({
13635
13942
  path: relPath,
13636
- sha256: z8.string().regex(/^[0-9a-f]{64}$/),
13637
- kind: z8.string().min(1),
13638
- slug: z8.string().regex(/^[a-z0-9][a-z0-9-]*$/),
13639
- title: z8.string(),
13640
- disposition: z8.enum(DOCS_MODERNIZE_DISPOSITIONS),
13641
- target: z8.string().min(1).max(1024).nullable(),
13642
- reasons: z8.array(z8.string()),
13643
- judgments: z8.array(judgmentSchema),
13644
- ownerTasks: z8.array(z8.string().regex(/^[TD]\d+$/)),
13645
- category: z8.string(),
13646
- refs: z8.array(z8.string()),
13647
- overridden: z8.boolean(),
13648
- covers: z8.array(z8.string()),
13649
- baselineRemove: z8.boolean()
13943
+ sha256: z9.string().regex(/^[0-9a-f]{64}$/),
13944
+ kind: z9.string().min(1),
13945
+ slug: z9.string().regex(/^[a-z0-9][a-z0-9-]*$/),
13946
+ title: z9.string(),
13947
+ disposition: z9.enum(DOCS_MODERNIZE_DISPOSITIONS),
13948
+ target: z9.string().min(1).max(1024).nullable(),
13949
+ reasons: z9.array(z9.string()),
13950
+ judgments: z9.array(judgmentSchema),
13951
+ ownerTasks: z9.array(z9.string().regex(/^[TD]\d+$/)),
13952
+ category: z9.string(),
13953
+ refs: z9.array(z9.string()),
13954
+ overridden: z9.boolean(),
13955
+ covers: z9.array(z9.string()),
13956
+ baselineRemove: z9.boolean()
13650
13957
  })
13651
13958
  ),
13652
- linkFixes: z8.array(
13653
- z8.object({
13654
- kind: z8.literal("link-fix"),
13959
+ linkFixes: z9.array(
13960
+ z9.object({
13961
+ kind: z9.literal("link-fix"),
13655
13962
  path: relPath,
13656
- href: z8.string().min(1).max(2048),
13657
- newHref: z8.string().min(1).max(2048),
13658
- base: z8.literal("repo").optional(),
13659
- sha256: z8.string().regex(/^[0-9a-f]{64}$/).optional()
13963
+ href: z9.string().min(1).max(2048),
13964
+ newHref: z9.string().min(1).max(2048),
13965
+ base: z9.literal("repo").optional(),
13966
+ sha256: z9.string().regex(/^[0-9a-f]{64}$/).optional()
13660
13967
  })
13661
13968
  ).optional(),
13662
- repoRoot: z8.string().min(1).optional()
13969
+ repoRoot: z9.string().min(1).optional()
13663
13970
  });
13664
- var docsModernizeOverridesSchema = z8.record(
13971
+ var docsModernizeOverridesSchema = z9.record(
13665
13972
  relPath,
13666
- z8.object({
13667
- disposition: z8.enum(DOCS_MODERNIZE_DISPOSITIONS),
13668
- target: z8.string().min(1).max(1024).nullable().optional(),
13669
- reason: z8.string().min(1),
13670
- kind: z8.string().min(1).optional(),
13671
- slug: z8.string().regex(/^[a-z0-9][a-z0-9-]*$/).optional(),
13672
- covers: z8.array(z8.string()).optional()
13973
+ z9.object({
13974
+ disposition: z9.enum(DOCS_MODERNIZE_DISPOSITIONS),
13975
+ target: z9.string().min(1).max(1024).nullable().optional(),
13976
+ reason: z9.string().min(1),
13977
+ kind: z9.string().min(1).optional(),
13978
+ slug: z9.string().regex(/^[a-z0-9][a-z0-9-]*$/).optional(),
13979
+ covers: z9.array(z9.string()).optional()
13673
13980
  })
13674
13981
  );
13675
- var receiptOpSchema = z8.object({
13676
- op: z8.enum(DOCS_MODERNIZE_OPS),
13677
- state: z8.enum(["pending", "done", "reversed"]),
13678
- slug: z8.string().nullable(),
13982
+ var receiptOpSchema = z9.object({
13983
+ op: z9.enum(DOCS_MODERNIZE_OPS),
13984
+ state: z9.enum(["pending", "done", "reversed"]),
13985
+ slug: z9.string().nullable(),
13679
13986
  path: relPath.nullable(),
13680
- target: z8.string().nullable(),
13681
- attachmentId: z8.string().nullable(),
13682
- ownerId: z8.string().nullable(),
13683
- beforeSha256: z8.string().regex(/^[0-9a-f]{64}$/).nullable(),
13684
- afterSha256: z8.string().regex(/^[0-9a-f]{64}$/).nullable(),
13685
- prior: z8.object({
13686
- lifecycleStatus: z8.string().nullable().optional(),
13687
- supersededBy: z8.string().nullable().optional(),
13688
- supersedes: z8.string().nullable().optional(),
13689
- previousAttachmentId: z8.string().nullable().optional(),
13690
- newAttachmentId: z8.string().nullable().optional(),
13691
- linkTargets: z8.array(z8.string()).optional(),
13692
- kind: z8.string().nullable().optional()
13987
+ target: z9.string().nullable(),
13988
+ attachmentId: z9.string().nullable(),
13989
+ ownerId: z9.string().nullable(),
13990
+ beforeSha256: z9.string().regex(/^[0-9a-f]{64}$/).nullable(),
13991
+ afterSha256: z9.string().regex(/^[0-9a-f]{64}$/).nullable(),
13992
+ prior: z9.object({
13993
+ lifecycleStatus: z9.string().nullable().optional(),
13994
+ supersededBy: z9.string().nullable().optional(),
13995
+ supersedes: z9.string().nullable().optional(),
13996
+ previousAttachmentId: z9.string().nullable().optional(),
13997
+ newAttachmentId: z9.string().nullable().optional(),
13998
+ linkTargets: z9.array(z9.string()).optional(),
13999
+ kind: z9.string().nullable().optional()
13693
14000
  }).optional(),
13694
- base: z8.literal("repo").optional()
14001
+ base: z9.literal("repo").optional()
13695
14002
  });
13696
14003
  var docsModernizeJournalLineSchema = receiptOpSchema.extend({
13697
- i: z8.number().int().min(0)
14004
+ i: z9.number().int().min(0)
13698
14005
  });
13699
- var docsModernizeReceiptSchema = z8.object({
13700
- runId: z8.string().regex(/^dm-[\w-]+$/),
13701
- root: z8.string().min(1),
13702
- appliedAt: z8.string(),
13703
- planSha256: z8.string(),
13704
- edgeCount: z8.number(),
13705
- rolledBackAt: z8.string().nullable(),
13706
- blobs: z8.array(z8.object({ path: relPath, sha256: z8.string() })),
13707
- moves: z8.array(z8.object({ from: relPath, to: relPath })),
13708
- deleted: z8.array(relPath),
13709
- ops: z8.array(receiptOpSchema),
13710
- durationMs: z8.number().optional(),
13711
- repoRoot: z8.string().min(1).optional()
14006
+ var docsModernizeReceiptSchema = z9.object({
14007
+ runId: z9.string().regex(/^dm-[\w-]+$/),
14008
+ root: z9.string().min(1),
14009
+ appliedAt: z9.string(),
14010
+ planSha256: z9.string(),
14011
+ edgeCount: z9.number(),
14012
+ rolledBackAt: z9.string().nullable(),
14013
+ blobs: z9.array(z9.object({ path: relPath, sha256: z9.string() })),
14014
+ moves: z9.array(z9.object({ from: relPath, to: relPath })),
14015
+ deleted: z9.array(relPath),
14016
+ ops: z9.array(receiptOpSchema),
14017
+ durationMs: z9.number().optional(),
14018
+ repoRoot: z9.string().min(1).optional()
13712
14019
  });
13713
14020
 
13714
14021
  // packages/contracts/src/docs/provenance.ts
13715
- import { z as z9 } from "zod";
14022
+ import { z as z10 } from "zod";
13716
14023
  var PROVENANCE_NODE_KINDS = [
13717
14024
  "doc",
13718
14025
  "task",
@@ -13735,96 +14042,96 @@ var DOC_LIFECYCLE_STATUSES = [
13735
14042
  "archived",
13736
14043
  "draft"
13737
14044
  ];
13738
- var provenanceNodeKindSchema = z9.enum(PROVENANCE_NODE_KINDS);
13739
- var provenanceEdgeRelationSchema = z9.enum(PROVENANCE_EDGE_RELATIONS);
13740
- var docLifecycleStatusSchema = z9.enum(DOC_LIFECYCLE_STATUSES);
14045
+ var provenanceNodeKindSchema = z10.enum(PROVENANCE_NODE_KINDS);
14046
+ var provenanceEdgeRelationSchema = z10.enum(PROVENANCE_EDGE_RELATIONS);
14047
+ var docLifecycleStatusSchema = z10.enum(DOC_LIFECYCLE_STATUSES);
13741
14048
  var provenanceNodeBaseFields = {
13742
- id: z9.string().min(1),
13743
- title: z9.string().min(1),
13744
- metadata: z9.record(z9.string(), z9.unknown()).optional()
14049
+ id: z10.string().min(1),
14050
+ title: z10.string().min(1),
14051
+ metadata: z10.record(z10.string(), z10.unknown()).optional()
13745
14052
  };
13746
- var provenanceDocNodeSchema = z9.object({
14053
+ var provenanceDocNodeSchema = z10.object({
13747
14054
  ...provenanceNodeBaseFields,
13748
- kind: z9.literal("doc"),
13749
- slug: z9.string().min(1),
13750
- docKind: z9.string().min(1),
14055
+ kind: z10.literal("doc"),
14056
+ slug: z10.string().min(1),
14057
+ docKind: z10.string().min(1),
13751
14058
  lifecycleStatus: docLifecycleStatusSchema,
13752
- publishedAt: z9.string().min(1),
13753
- supersededAt: z9.string().min(1).optional(),
13754
- summary: z9.string().optional()
14059
+ publishedAt: z10.string().min(1),
14060
+ supersededAt: z10.string().min(1).optional(),
14061
+ summary: z10.string().optional()
13755
14062
  });
13756
- var provenanceTaskNodeSchema = z9.object({
14063
+ var provenanceTaskNodeSchema = z10.object({
13757
14064
  ...provenanceNodeBaseFields,
13758
- kind: z9.literal("task"),
13759
- taskType: z9.enum(["saga", "epic", "task", "subtask"]),
13760
- status: z9.enum(["pending", "in_progress", "done", "blocked", "cancelled", "archived"])
14065
+ kind: z10.literal("task"),
14066
+ taskType: z10.enum(["saga", "epic", "task", "subtask"]),
14067
+ status: z10.enum(["pending", "in_progress", "done", "blocked", "cancelled", "archived"])
13761
14068
  });
13762
- var provenanceDecisionNodeSchema = z9.object({
14069
+ var provenanceDecisionNodeSchema = z10.object({
13763
14070
  ...provenanceNodeBaseFields,
13764
- kind: z9.literal("decision"),
13765
- outcome: z9.enum(["proposed", "accepted", "rejected", "superseded"]),
13766
- decidedAt: z9.string().min(1)
14071
+ kind: z10.literal("decision"),
14072
+ outcome: z10.enum(["proposed", "accepted", "rejected", "superseded"]),
14073
+ decidedAt: z10.string().min(1)
13767
14074
  });
13768
- var provenanceSessionNodeSchema = z9.object({
14075
+ var provenanceSessionNodeSchema = z10.object({
13769
14076
  ...provenanceNodeBaseFields,
13770
- kind: z9.literal("session"),
13771
- startedAt: z9.string().min(1),
13772
- endedAt: z9.string().min(1).optional()
14077
+ kind: z10.literal("session"),
14078
+ startedAt: z10.string().min(1),
14079
+ endedAt: z10.string().min(1).optional()
13773
14080
  });
13774
- var provenanceMemoryNodeSchema = z9.object({
14081
+ var provenanceMemoryNodeSchema = z10.object({
13775
14082
  ...provenanceNodeBaseFields,
13776
- kind: z9.literal("memory"),
13777
- memoryType: z9.enum(["observation", "pattern", "decision", "diary"]),
13778
- recordedAt: z9.string().min(1)
14083
+ kind: z10.literal("memory"),
14084
+ memoryType: z10.enum(["observation", "pattern", "decision", "diary"]),
14085
+ recordedAt: z10.string().min(1)
13779
14086
  });
13780
- var provenanceNodeSchema = z9.discriminatedUnion("kind", [
14087
+ var provenanceNodeSchema = z10.discriminatedUnion("kind", [
13781
14088
  provenanceDocNodeSchema,
13782
14089
  provenanceTaskNodeSchema,
13783
14090
  provenanceDecisionNodeSchema,
13784
14091
  provenanceSessionNodeSchema,
13785
14092
  provenanceMemoryNodeSchema
13786
14093
  ]);
13787
- var provenanceEdgeSchema = z9.object({
14094
+ var provenanceEdgeSchema = z10.object({
13788
14095
  relation: provenanceEdgeRelationSchema,
13789
- from: z9.string().min(1),
14096
+ from: z10.string().min(1),
13790
14097
  fromKind: provenanceNodeKindSchema,
13791
- to: z9.string().min(1),
14098
+ to: z10.string().min(1),
13792
14099
  toKind: provenanceNodeKindSchema,
13793
- addedAt: z9.string().min(1),
13794
- summary: z9.string().optional()
14100
+ addedAt: z10.string().min(1),
14101
+ summary: z10.string().optional()
13795
14102
  });
13796
- var docProvenanceResponseSchema = z9.object({
13797
- nodes: z9.array(provenanceNodeSchema).readonly(),
13798
- edges: z9.array(provenanceEdgeSchema).readonly(),
13799
- totalNodes: z9.number().int().nonnegative(),
13800
- totalEdges: z9.number().int().nonnegative()
14103
+ var docProvenanceResponseSchema = z10.object({
14104
+ nodes: z10.array(provenanceNodeSchema).readonly(),
14105
+ edges: z10.array(provenanceEdgeSchema).readonly(),
14106
+ totalNodes: z10.number().int().nonnegative(),
14107
+ totalEdges: z10.number().int().nonnegative()
13801
14108
  });
13802
14109
 
13803
14110
  // packages/contracts/src/docs/read.ts
13804
- import { z as z10 } from "zod";
13805
- var docFrontmatterSchema = z10.object({
13806
- slug: z10.string(),
13807
- kind: z10.string().nullable(),
13808
- title: z10.string().nullable(),
13809
- summary: z10.string().nullable(),
13810
- lifecycleStatus: z10.string(),
13811
- docVersion: z10.number().int(),
13812
- ownerVersion: z10.string().nullable(),
13813
- supersedes: z10.string().nullable(),
13814
- supersededBy: z10.string().nullable(),
13815
- topics: z10.array(z10.string()).readonly(),
13816
- relatedTasks: z10.array(z10.string()).readonly(),
13817
- sha256: z10.string(),
13818
- createdAt: z10.string()
14111
+ import { z as z11 } from "zod";
14112
+ var docFrontmatterSchema = z11.object({
14113
+ slug: z11.string(),
14114
+ kind: z11.string().nullable(),
14115
+ title: z11.string().nullable(),
14116
+ summary: z11.string().nullable(),
14117
+ lifecycleStatus: z11.string(),
14118
+ docVersion: z11.number().int(),
14119
+ ownerVersion: z11.string().nullable(),
14120
+ supersedes: z11.string().nullable(),
14121
+ supersededBy: z11.string().nullable(),
14122
+ topics: z11.array(z11.string()).readonly(),
14123
+ relatedTasks: z11.array(z11.string()).readonly(),
14124
+ sha256: z11.string(),
14125
+ createdAt: z11.string()
13819
14126
  });
13820
- var docBodySchema = z10.object({
13821
- encoding: z10.enum(["utf-8", "base64"]),
13822
- text: z10.string().optional(),
13823
- base64: z10.string().optional(),
13824
- sizeBytes: z10.number().int().nonnegative(),
13825
- mimeType: z10.string().nullable()
14127
+ var docBodySchema = z11.object({
14128
+ encoding: z11.enum(["utf-8", "base64"]),
14129
+ text: z11.string().optional(),
14130
+ base64: z11.string().optional(),
14131
+ sizeBytes: z11.number().int().nonnegative(),
14132
+ mimeType: z11.string().nullable()
13826
14133
  });
13827
- var docReadResponseSchema = z10.object({
14134
+ var docReadResponseSchema = z11.object({
13828
14135
  frontmatter: docFrontmatterSchema,
13829
14136
  body: docBodySchema
13830
14137
  });
@@ -13997,7 +14304,7 @@ function getErrorMessage(error, fallback = "Unknown error") {
13997
14304
  }
13998
14305
 
13999
14306
  // packages/contracts/src/evidence-atom-schema.ts
14000
- import { z as z11 } from "zod";
14307
+ import { z as z12 } from "zod";
14001
14308
  var EVIDENCE_ATOM_KINDS = [
14002
14309
  "commit",
14003
14310
  "files",
@@ -14019,96 +14326,96 @@ var PARSER_PREFIXES = [...EVIDENCE_ATOM_KINDS, "state"];
14019
14326
  var KIND_BOUNDARY_REGEX = new RegExp(`;(?=\\s*(?:${PARSER_PREFIXES.join("|")})\\s*:)`, "g");
14020
14327
  var DEPLOY_PROVIDER_REGEX = /^[a-z0-9][a-z0-9._-]*$/;
14021
14328
  var DEPLOY_ID_REGEX = /^[^\s@|]+$/;
14022
- var commitAtomSchema = z11.object({
14023
- kind: z11.literal("commit"),
14024
- sha: z11.string().regex(/^[0-9a-f]{7,40}$/i, "commit sha must be 7-40 hex characters")
14329
+ var commitAtomSchema = z12.object({
14330
+ kind: z12.literal("commit"),
14331
+ sha: z12.string().regex(/^[0-9a-f]{7,40}$/i, "commit sha must be 7-40 hex characters")
14025
14332
  });
14026
- var filesAtomSchema = z11.object({
14027
- kind: z11.literal("files"),
14028
- paths: z11.array(z11.string().min(1)).min(1, "files atom requires at least one path")
14333
+ var filesAtomSchema = z12.object({
14334
+ kind: z12.literal("files"),
14335
+ paths: z12.array(z12.string().min(1)).min(1, "files atom requires at least one path")
14029
14336
  });
14030
- var testRunAtomSchema = z11.object({
14031
- kind: z11.literal("test-run"),
14032
- path: z11.string().min(1, "test-run atom requires a non-empty path")
14337
+ var testRunAtomSchema = z12.object({
14338
+ kind: z12.literal("test-run"),
14339
+ path: z12.string().min(1, "test-run atom requires a non-empty path")
14033
14340
  });
14034
- var qaRunAtomSchema = z11.object({
14035
- kind: z11.literal("qa-run"),
14036
- path: z11.string().min(1, "qa-run atom requires a non-empty path")
14341
+ var qaRunAtomSchema = z12.object({
14342
+ kind: z12.literal("qa-run"),
14343
+ path: z12.string().min(1, "qa-run atom requires a non-empty path")
14037
14344
  });
14038
- var toolAtomSchema = z11.object({
14039
- kind: z11.literal("tool"),
14040
- tool: z11.string().min(1, "tool atom requires a non-empty tool name")
14345
+ var toolAtomSchema = z12.object({
14346
+ kind: z12.literal("tool"),
14347
+ tool: z12.string().min(1, "tool atom requires a non-empty tool name")
14041
14348
  });
14042
- var urlAtomSchema = z11.object({
14043
- kind: z11.literal("url"),
14044
- url: z11.string().min(1).regex(/^https?:\/\//, "url atom must start with http:// or https://")
14349
+ var urlAtomSchema = z12.object({
14350
+ kind: z12.literal("url"),
14351
+ url: z12.string().min(1).regex(/^https?:\/\//, "url atom must start with http:// or https://")
14045
14352
  });
14046
- var noteAtomSchema = z11.object({
14047
- kind: z11.literal("note"),
14048
- note: z11.string().min(1, "note atom must be non-empty").max(512, "note atom is too long (max 512 chars)")
14353
+ var noteAtomSchema = z12.object({
14354
+ kind: z12.literal("note"),
14355
+ note: z12.string().min(1, "note atom must be non-empty").max(512, "note atom is too long (max 512 chars)")
14049
14356
  });
14050
- var decisionAtomSchema = z11.object({
14051
- kind: z11.literal("decision"),
14052
- decisionId: z11.string().min(1, "decision atom requires a non-empty decision ID")
14357
+ var decisionAtomSchema = z12.object({
14358
+ kind: z12.literal("decision"),
14359
+ decisionId: z12.string().min(1, "decision atom requires a non-empty decision ID")
14053
14360
  });
14054
- var prAtomSchema = z11.object({
14055
- kind: z11.literal("pr"),
14056
- prNumber: z11.number().int().positive("pr atom requires a positive integer PR number"),
14057
- componentPrNumber: z11.number().int().positive().optional(),
14361
+ var prAtomSchema = z12.object({
14362
+ kind: z12.literal("pr"),
14363
+ prNumber: z12.number().int().positive("pr atom requires a positive integer PR number"),
14364
+ componentPrNumber: z12.number().int().positive().optional(),
14058
14365
  /**
14059
14366
  * `pr:<owner>/<repo>#<n>` (T13912): the GitHub repository the PR number
14060
14367
  * belongs to, lowercased. Validated against the evidence git root's
14061
14368
  * `origin`, since PR numbers are only unique per repository.
14062
14369
  */
14063
- repo: z11.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
14370
+ repo: z12.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
14064
14371
  });
14065
- var ciAtomSchema = z11.object({
14066
- kind: z11.literal("ci"),
14067
- prNumber: z11.number().int().positive("ci atom requires a positive integer PR number"),
14068
- componentPrNumber: z11.number().int().positive().optional(),
14372
+ var ciAtomSchema = z12.object({
14373
+ kind: z12.literal("ci"),
14374
+ prNumber: z12.number().int().positive("ci atom requires a positive integer PR number"),
14375
+ componentPrNumber: z12.number().int().positive().optional(),
14069
14376
  /** `ci:<owner>/<repo>#<n>`, as for `pr:` (T13912). */
14070
- repo: z11.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
14377
+ repo: z12.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
14071
14378
  });
14072
- var ciRunAtomSchema = z11.object({
14073
- kind: z11.literal("ci-run"),
14074
- runId: z11.number().int().positive("ci-run atom requires a positive integer run id")
14379
+ var ciRunAtomSchema = z12.object({
14380
+ kind: z12.literal("ci-run"),
14381
+ runId: z12.number().int().positive("ci-run atom requires a positive integer run id")
14075
14382
  });
14076
- var deployAtomSchema = z11.object({
14077
- kind: z11.literal("deploy"),
14078
- provider: z11.string().regex(DEPLOY_PROVIDER_REGEX, "deploy atom provider must be a lowercase name"),
14079
- deploymentId: z11.string().regex(DEPLOY_ID_REGEX, "deploy atom requires a deployment id"),
14080
- sha: z11.string().regex(/^[0-9a-f]{7,40}$/, "deploy atom sha must be 7-40 lowercase hex chars"),
14081
- probeUrl: z11.string().regex(/^https?:\/\/\S+$/, "deploy atom probe url must start with http:// or https://")
14383
+ var deployAtomSchema = z12.object({
14384
+ kind: z12.literal("deploy"),
14385
+ provider: z12.string().regex(DEPLOY_PROVIDER_REGEX, "deploy atom provider must be a lowercase name"),
14386
+ deploymentId: z12.string().regex(DEPLOY_ID_REGEX, "deploy atom requires a deployment id"),
14387
+ sha: z12.string().regex(/^[0-9a-f]{7,40}$/, "deploy atom sha must be 7-40 lowercase hex chars"),
14388
+ probeUrl: z12.string().regex(/^https?:\/\/\S+$/, "deploy atom probe url must start with http:// or https://")
14082
14389
  });
14083
- var locDropAtomSchema = z11.object({
14084
- kind: z11.literal("loc-drop"),
14085
- fromLines: z11.number().int().nonnegative("loc-drop fromLines must be \u2265 0"),
14086
- toLines: z11.number().int().nonnegative("loc-drop toLines must be \u2265 0")
14390
+ var locDropAtomSchema = z12.object({
14391
+ kind: z12.literal("loc-drop"),
14392
+ fromLines: z12.number().int().nonnegative("loc-drop fromLines must be \u2265 0"),
14393
+ toLines: z12.number().int().nonnegative("loc-drop toLines must be \u2265 0")
14087
14394
  });
14088
- var callsiteCoverageAtomSchema = z11.object({
14089
- kind: z11.literal("callsite-coverage"),
14090
- symbolName: z11.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
14091
- relativeSourcePath: z11.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
14395
+ var callsiteCoverageAtomSchema = z12.object({
14396
+ kind: z12.literal("callsite-coverage"),
14397
+ symbolName: z12.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
14398
+ relativeSourcePath: z12.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
14092
14399
  });
14093
14400
  var AC_UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[45][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
14094
14401
  var AC_ALIAS_REGEX = /^AC[0-9]{1,4}$/;
14095
14402
  var SATISFIES_TASK_ID_REGEX = /^T[0-9]{1,7}$/;
14096
14403
  var SATISFIES_VERSION_PIN_REGEX = /^[0-9]{14}$/;
14097
- var satisfiesAtomSchema = z11.object({
14098
- kind: z11.literal("satisfies"),
14404
+ var satisfiesAtomSchema = z12.object({
14405
+ kind: z12.literal("satisfies"),
14099
14406
  /** Target task ID — `T<1-7 digits>` per ADR-079-r2 §2.1. */
14100
- targetTaskId: z11.string().regex(SATISFIES_TASK_ID_REGEX, "satisfies atom targetTaskId must match /^T[0-9]{1,7}$/"),
14407
+ targetTaskId: z12.string().regex(SATISFIES_TASK_ID_REGEX, "satisfies atom targetTaskId must match /^T[0-9]{1,7}$/"),
14101
14408
  /** Lowercase UUIDv4/v5 — populated for the canonical form; undefined for alias form. */
14102
- targetAcId: z11.string().regex(AC_UUID_REGEX, "satisfies atom targetAcId must be a lowercase UUIDv4/v5").optional(),
14409
+ targetAcId: z12.string().regex(AC_UUID_REGEX, "satisfies atom targetAcId must be a lowercase UUIDv4/v5").optional(),
14103
14410
  /** Positional alias `AC<1-4 digits>` — populated for alias form; undefined for UUID form. */
14104
- targetAcAlias: z11.string().regex(AC_ALIAS_REGEX, "satisfies atom targetAcAlias must match /^AC[0-9]{1,4}$/").optional(),
14411
+ targetAcAlias: z12.string().regex(AC_ALIAS_REGEX, "satisfies atom targetAcAlias must match /^AC[0-9]{1,4}$/").optional(),
14105
14412
  /** Optional `@<14-digit YYYYMMDDhhmmss>` pin captured at mint time. */
14106
- versionPin: z11.string().regex(
14413
+ versionPin: z12.string().regex(
14107
14414
  SATISFIES_VERSION_PIN_REGEX,
14108
14415
  "satisfies atom versionPin must be 14 digits (YYYYMMDDhhmmss)"
14109
14416
  ).optional()
14110
14417
  });
14111
- var EvidenceAtomSchema = z11.discriminatedUnion("kind", [
14418
+ var EvidenceAtomSchema = z12.discriminatedUnion("kind", [
14112
14419
  commitAtomSchema,
14113
14420
  filesAtomSchema,
14114
14421
  testRunAtomSchema,
@@ -14170,54 +14477,54 @@ var ATOM_EXAMPLES = Object.freeze({
14170
14477
  });
14171
14478
 
14172
14479
  // packages/contracts/src/evidence-record-schema.ts
14173
- import { z as z12 } from "zod";
14174
- var evidenceBaseSchema = z12.object({
14480
+ import { z as z13 } from "zod";
14481
+ var evidenceBaseSchema = z13.object({
14175
14482
  /** Identity string of the agent that produced this record. */
14176
- agentIdentity: z12.string().min(1),
14483
+ agentIdentity: z13.string().min(1),
14177
14484
  /** SHA-256 hex digest (64 chars) of the attached artifact. */
14178
- attachmentSha256: z12.string().length(64),
14485
+ attachmentSha256: z13.string().length(64),
14179
14486
  /** ISO 8601 timestamp at which the action ran. */
14180
- ranAt: z12.string().datetime(),
14487
+ ranAt: z13.string().datetime(),
14181
14488
  /** Wall-clock duration of the action in milliseconds. */
14182
- durationMs: z12.number().nonnegative()
14489
+ durationMs: z13.number().nonnegative()
14183
14490
  });
14184
14491
  var implDiffRecordSchema = evidenceBaseSchema.extend({
14185
- kind: z12.literal("impl-diff"),
14186
- phase: z12.literal("implement"),
14187
- filesChanged: z12.array(z12.string().min(1)).min(1),
14188
- linesAdded: z12.number().int().nonnegative(),
14189
- linesRemoved: z12.number().int().nonnegative()
14492
+ kind: z13.literal("impl-diff"),
14493
+ phase: z13.literal("implement"),
14494
+ filesChanged: z13.array(z13.string().min(1)).min(1),
14495
+ linesAdded: z13.number().int().nonnegative(),
14496
+ linesRemoved: z13.number().int().nonnegative()
14190
14497
  });
14191
14498
  var validateSpecCheckRecordSchema = evidenceBaseSchema.extend({
14192
- kind: z12.literal("validate-spec-check"),
14193
- phase: z12.literal("validate"),
14194
- reqIdsChecked: z12.array(z12.string().min(1)).min(1),
14195
- passed: z12.boolean(),
14196
- details: z12.string().min(1)
14499
+ kind: z13.literal("validate-spec-check"),
14500
+ phase: z13.literal("validate"),
14501
+ reqIdsChecked: z13.array(z13.string().min(1)).min(1),
14502
+ passed: z13.boolean(),
14503
+ details: z13.string().min(1)
14197
14504
  });
14198
14505
  var testOutputRecordSchema = evidenceBaseSchema.extend({
14199
- kind: z12.literal("test-output"),
14200
- phase: z12.literal("test"),
14201
- command: z12.string().min(1),
14202
- exitCode: z12.number().int(),
14203
- testsPassed: z12.number().int().nonnegative(),
14204
- testsFailed: z12.number().int().nonnegative()
14506
+ kind: z13.literal("test-output"),
14507
+ phase: z13.literal("test"),
14508
+ command: z13.string().min(1),
14509
+ exitCode: z13.number().int(),
14510
+ testsPassed: z13.number().int().nonnegative(),
14511
+ testsFailed: z13.number().int().nonnegative()
14205
14512
  });
14206
14513
  var lintReportRecordSchema = evidenceBaseSchema.extend({
14207
- kind: z12.literal("lint-report"),
14208
- phase: z12.enum(["implement", "test"]),
14209
- tool: z12.string().min(1),
14210
- passed: z12.boolean(),
14211
- warnings: z12.number().int().nonnegative(),
14212
- errors: z12.number().int().nonnegative()
14514
+ kind: z13.literal("lint-report"),
14515
+ phase: z13.enum(["implement", "test"]),
14516
+ tool: z13.string().min(1),
14517
+ passed: z13.boolean(),
14518
+ warnings: z13.number().int().nonnegative(),
14519
+ errors: z13.number().int().nonnegative()
14213
14520
  });
14214
14521
  var commandOutputRecordSchema = evidenceBaseSchema.extend({
14215
- kind: z12.literal("command-output"),
14216
- phase: z12.enum(["implement", "validate", "test"]),
14217
- cmd: z12.string().min(1),
14218
- exitCode: z12.number().int()
14522
+ kind: z13.literal("command-output"),
14523
+ phase: z13.enum(["implement", "validate", "test"]),
14524
+ cmd: z13.string().min(1),
14525
+ exitCode: z13.number().int()
14219
14526
  });
14220
- var evidenceRecordSchema = z12.discriminatedUnion("kind", [
14527
+ var evidenceRecordSchema = z13.discriminatedUnion("kind", [
14221
14528
  implDiffRecordSchema,
14222
14529
  validateSpecCheckRecordSchema,
14223
14530
  testOutputRecordSchema,
@@ -15152,107 +15459,107 @@ var KIND_LIFECYCLE_REQUIREMENTS = Object.freeze({
15152
15459
  });
15153
15460
 
15154
15461
  // packages/contracts/src/lease-ipc/messages.ts
15155
- import { z as z13 } from "zod";
15156
- var LeaseScopeSchema = z13.enum(["project", "global"]);
15157
- var LeaseLaneSchema = z13.enum(["tasks", "brain", "bulk"]);
15158
- var LeaseAcquireRequestSchema = z13.object({
15462
+ import { z as z14 } from "zod";
15463
+ var LeaseScopeSchema = z14.enum(["project", "global"]);
15464
+ var LeaseLaneSchema = z14.enum(["tasks", "brain", "bulk"]);
15465
+ var LeaseAcquireRequestSchema = z14.object({
15159
15466
  /** Tag discriminating this request variant. */
15160
- kind: z13.literal("lease_acquire"),
15467
+ kind: z14.literal("lease_acquire"),
15161
15468
  /** The cleo.db scope being arbitrated. */
15162
15469
  scope: LeaseScopeSchema,
15163
15470
  /** The write lane within the scope. */
15164
15471
  lane: LeaseLaneSchema,
15165
15472
  /** Process+lane holder identity. */
15166
- holder_id: z13.string().min(1),
15473
+ holder_id: z14.string().min(1),
15167
15474
  /** Advisory priority — lower acquires sooner. `0` = highest. */
15168
- priority: z13.number().int().min(0).max(255),
15475
+ priority: z14.number().int().min(0).max(255),
15169
15476
  /** Lease time-to-live in milliseconds. */
15170
- ttl_ms: z13.number().int().nonnegative(),
15477
+ ttl_ms: z14.number().int().nonnegative(),
15171
15478
  /** When true, a same-holder acquire re-enters (refcount++) rather than queuing. */
15172
- reentrant: z13.boolean()
15479
+ reentrant: z14.boolean()
15173
15480
  }).strict();
15174
- var LeaseReleaseRequestSchema = z13.object({
15481
+ var LeaseReleaseRequestSchema = z14.object({
15175
15482
  /** Tag discriminating this request variant. */
15176
- kind: z13.literal("lease_release"),
15483
+ kind: z14.literal("lease_release"),
15177
15484
  /** The cleo.db scope being arbitrated. */
15178
15485
  scope: LeaseScopeSchema,
15179
15486
  /** The write lane within the scope. */
15180
15487
  lane: LeaseLaneSchema,
15181
15488
  /** Process+lane holder identity. */
15182
- holder_id: z13.string().min(1),
15489
+ holder_id: z14.string().min(1),
15183
15490
  /** The epoch fence the holder acquired — a stale epoch no-ops. */
15184
- epoch: z13.number().int().nonnegative()
15491
+ epoch: z14.number().int().nonnegative()
15185
15492
  }).strict();
15186
- var LeaseRenewRequestSchema = z13.object({
15493
+ var LeaseRenewRequestSchema = z14.object({
15187
15494
  /** Tag discriminating this request variant. */
15188
- kind: z13.literal("lease_renew"),
15495
+ kind: z14.literal("lease_renew"),
15189
15496
  /** The cleo.db scope being arbitrated. */
15190
15497
  scope: LeaseScopeSchema,
15191
15498
  /** The write lane within the scope. */
15192
15499
  lane: LeaseLaneSchema,
15193
15500
  /** Process+lane holder identity. */
15194
- holder_id: z13.string().min(1),
15501
+ holder_id: z14.string().min(1),
15195
15502
  /** The epoch fence the holder acquired (epoch-guarded renew). */
15196
- epoch: z13.number().int().nonnegative()
15503
+ epoch: z14.number().int().nonnegative()
15197
15504
  }).strict();
15198
- var RateCheckRequestSchema = z13.object({
15505
+ var RateCheckRequestSchema = z14.object({
15199
15506
  /** Tag discriminating this request variant. */
15200
- kind: z13.literal("rate_check"),
15507
+ kind: z14.literal("rate_check"),
15201
15508
  /** The cleo.db scope being checked. */
15202
15509
  scope: LeaseScopeSchema,
15203
15510
  /** The write lane within the scope. */
15204
15511
  lane: LeaseLaneSchema,
15205
15512
  /** Estimated bytes the caller intends to write. */
15206
- est_bytes: z13.number().int().nonnegative()
15513
+ est_bytes: z14.number().int().nonnegative()
15207
15514
  }).strict();
15208
- var ToolGrantRequestSchema = z13.object({
15515
+ var ToolGrantRequestSchema = z14.object({
15209
15516
  /** Tag discriminating this request variant. */
15210
- kind: z13.literal("tool_grant"),
15517
+ kind: z14.literal("tool_grant"),
15211
15518
  /** The tool name being requested. */
15212
- tool: z13.string().min(1),
15519
+ tool: z14.string().min(1),
15213
15520
  /** The requesting holder identity. */
15214
- holder_id: z13.string().min(1)
15521
+ holder_id: z14.string().min(1)
15215
15522
  }).strict();
15216
- var QueuePriorityClassSchema = z13.enum(["lead", "worker", "background"]);
15217
- var QueueAdmitRequestSchema = z13.object({
15523
+ var QueuePriorityClassSchema = z14.enum(["lead", "worker", "background"]);
15524
+ var QueueAdmitRequestSchema = z14.object({
15218
15525
  /** Tag discriminating this request variant. */
15219
- kind: z13.literal("queue_admit"),
15526
+ kind: z14.literal("queue_admit"),
15220
15527
  /** The LLM provider id the call targets (rate budget is per-provider). */
15221
- provider: z13.string().min(1),
15528
+ provider: z14.string().min(1),
15222
15529
  /** The caller's priority class (lead > worker > background). */
15223
15530
  priority_class: QueuePriorityClassSchema,
15224
15531
  /** The caller's estimate of the request's token cost (debited on admit). */
15225
- est_tokens: z13.number().int().nonnegative(),
15532
+ est_tokens: z14.number().int().nonnegative(),
15226
15533
  /** The child the call belongs to (in-flight tracking — the watchdog seam). */
15227
- child_id: z13.string().min(1)
15534
+ child_id: z14.string().min(1)
15228
15535
  }).strict();
15229
- var WorkerHeartbeatRequestSchema = z13.object({
15536
+ var WorkerHeartbeatRequestSchema = z14.object({
15230
15537
  /** Tag discriminating this request variant. */
15231
- kind: z13.literal("worker_heartbeat"),
15538
+ kind: z14.literal("worker_heartbeat"),
15232
15539
  /** The logical id of the heartbeating child (matches the registry key). */
15233
- child_id: z13.string().min(1),
15540
+ child_id: z14.string().min(1),
15234
15541
  /** The worker's own view of whether it is currently inside an LLM call. */
15235
- in_flight_llm: z13.boolean()
15542
+ in_flight_llm: z14.boolean()
15236
15543
  }).strict();
15237
- var ResourceAdmitRequestSchema = z13.object({
15544
+ var ResourceAdmitRequestSchema = z14.object({
15238
15545
  /** Tag discriminating this request variant. */
15239
- kind: z13.literal("resource_admit"),
15546
+ kind: z14.literal("resource_admit"),
15240
15547
  /** The resource class (e.g. `"db-heavy"`, `"full-build"`, `"test-run"`). */
15241
- class: z13.string().min(1),
15548
+ class: z14.string().min(1),
15242
15549
  /** The caller holding the slot — process/worktree-unique; the release key. */
15243
- holder_id: z13.string().min(1),
15550
+ holder_id: z14.string().min(1),
15244
15551
  /** The client-computed budget: the max concurrent holders for this class. */
15245
- budget: z13.number().int().nonnegative()
15552
+ budget: z14.number().int().nonnegative()
15246
15553
  }).strict();
15247
- var ResourceReleaseRequestSchema = z13.object({
15554
+ var ResourceReleaseRequestSchema = z14.object({
15248
15555
  /** Tag discriminating this request variant. */
15249
- kind: z13.literal("resource_release"),
15556
+ kind: z14.literal("resource_release"),
15250
15557
  /** The resource class the slot belongs to. */
15251
- class: z13.string().min(1),
15558
+ class: z14.string().min(1),
15252
15559
  /** The holder that was admitted (matches the admit `holder_id`). */
15253
- holder_id: z13.string().min(1)
15560
+ holder_id: z14.string().min(1)
15254
15561
  }).strict();
15255
- var LeaseIpcRequestSchema = z13.discriminatedUnion("kind", [
15562
+ var LeaseIpcRequestSchema = z14.discriminatedUnion("kind", [
15256
15563
  LeaseAcquireRequestSchema,
15257
15564
  LeaseReleaseRequestSchema,
15258
15565
  LeaseRenewRequestSchema,
@@ -15263,133 +15570,133 @@ var LeaseIpcRequestSchema = z13.discriminatedUnion("kind", [
15263
15570
  ResourceAdmitRequestSchema,
15264
15571
  ResourceReleaseRequestSchema
15265
15572
  ]);
15266
- var LeaseGrantedResponseSchema = z13.object({
15573
+ var LeaseGrantedResponseSchema = z14.object({
15267
15574
  /** Tag discriminating this response variant. */
15268
- kind: z13.literal("lease_granted"),
15575
+ kind: z14.literal("lease_granted"),
15269
15576
  /** The granted cleo.db scope. */
15270
15577
  scope: LeaseScopeSchema,
15271
15578
  /** The granted write lane. */
15272
15579
  lane: LeaseLaneSchema,
15273
15580
  /** The holder the lease was granted to. */
15274
- holder_id: z13.string().min(1),
15581
+ holder_id: z14.string().min(1),
15275
15582
  /** The monotonic epoch fence assigned to this grant. */
15276
- epoch: z13.number().int().nonnegative(),
15583
+ epoch: z14.number().int().nonnegative(),
15277
15584
  /** The lease TTL in milliseconds. */
15278
- ttl_ms: z13.number().int().nonnegative(),
15585
+ ttl_ms: z14.number().int().nonnegative(),
15279
15586
  /** Absolute expiry timestamp (epoch ms) for this grant. */
15280
- expires_at_ms: z13.number().int().nonnegative()
15587
+ expires_at_ms: z14.number().int().nonnegative()
15281
15588
  }).strict();
15282
- var LeaseQueuedResponseSchema = z13.object({
15589
+ var LeaseQueuedResponseSchema = z14.object({
15283
15590
  /** Tag discriminating this response variant. */
15284
- kind: z13.literal("lease_queued"),
15591
+ kind: z14.literal("lease_queued"),
15285
15592
  /** The queued cleo.db scope. */
15286
15593
  scope: LeaseScopeSchema,
15287
15594
  /** The queued write lane. */
15288
15595
  lane: LeaseLaneSchema,
15289
15596
  /** The monotonic ticket assigned for FIFO tiebreak. */
15290
- ticket: z13.number().int().nonnegative(),
15597
+ ticket: z14.number().int().nonnegative(),
15291
15598
  /** Number of waiters ahead of this one. */
15292
- ahead: z13.number().int().nonnegative()
15599
+ ahead: z14.number().int().nonnegative()
15293
15600
  }).strict();
15294
- var LeaseDeniedResponseSchema = z13.object({
15601
+ var LeaseDeniedResponseSchema = z14.object({
15295
15602
  /** Tag discriminating this response variant. */
15296
- kind: z13.literal("lease_denied"),
15603
+ kind: z14.literal("lease_denied"),
15297
15604
  /** The denied cleo.db scope. */
15298
15605
  scope: LeaseScopeSchema,
15299
15606
  /** Machine-readable denial code (e.g. `E_LEASE_UNAVAILABLE`). */
15300
- code: z13.string().min(1),
15607
+ code: z14.string().min(1),
15301
15608
  /** Human-readable denial message. */
15302
- message: z13.string()
15609
+ message: z14.string()
15303
15610
  }).strict();
15304
- var RateResultResponseSchema = z13.object({
15611
+ var RateResultResponseSchema = z14.object({
15305
15612
  /** Tag discriminating this response variant. */
15306
- kind: z13.literal("rate_result"),
15613
+ kind: z14.literal("rate_result"),
15307
15614
  /** The checked cleo.db scope. */
15308
15615
  scope: LeaseScopeSchema,
15309
15616
  /** Whether the write is within budget. */
15310
- ok: z13.boolean(),
15617
+ ok: z14.boolean(),
15311
15618
  /** Suggested back-off in milliseconds when `ok` is false. */
15312
- retry_after_ms: z13.number().int().nonnegative(),
15619
+ retry_after_ms: z14.number().int().nonnegative(),
15313
15620
  /** Remaining token budget for the scope. */
15314
- tokens_remaining: z13.number().int().nonnegative()
15621
+ tokens_remaining: z14.number().int().nonnegative()
15315
15622
  }).strict();
15316
- var ToolGrantedResponseSchema = z13.object({
15623
+ var ToolGrantedResponseSchema = z14.object({
15317
15624
  /** Tag discriminating this response variant. */
15318
- kind: z13.literal("tool_granted"),
15625
+ kind: z14.literal("tool_granted"),
15319
15626
  /** The granted tool name. */
15320
- tool: z13.string().min(1),
15627
+ tool: z14.string().min(1),
15321
15628
  /** The holder the tool grant was issued to. */
15322
- holder_id: z13.string().min(1)
15629
+ holder_id: z14.string().min(1)
15323
15630
  }).strict();
15324
- var LeaseRevokedResponseSchema = z13.object({
15631
+ var LeaseRevokedResponseSchema = z14.object({
15325
15632
  /** Tag discriminating this response variant. */
15326
- kind: z13.literal("lease_revoked"),
15633
+ kind: z14.literal("lease_revoked"),
15327
15634
  /** The revoked cleo.db scope. */
15328
15635
  scope: LeaseScopeSchema,
15329
15636
  /** The revoked write lane. */
15330
15637
  lane: LeaseLaneSchema,
15331
15638
  /** The holder whose lease was revoked. */
15332
- holder_id: z13.string().min(1),
15639
+ holder_id: z14.string().min(1),
15333
15640
  /** Human-readable reason for the revocation. */
15334
- reason: z13.string()
15641
+ reason: z14.string()
15335
15642
  }).strict();
15336
- var ChildKilledUnresponsiveResponseSchema = z13.object({
15643
+ var ChildKilledUnresponsiveResponseSchema = z14.object({
15337
15644
  /** Tag discriminating this response variant. */
15338
- kind: z13.literal("child_killed_unresponsive"),
15645
+ kind: z14.literal("child_killed_unresponsive"),
15339
15646
  /** Logical id of the killed child. */
15340
- child_id: z13.string().min(1),
15647
+ child_id: z14.string().min(1),
15341
15648
  /** The holder identity the killed child held the lease as. */
15342
- holder_id: z13.string().min(1),
15649
+ holder_id: z14.string().min(1),
15343
15650
  /** The cleo.db scope the killed child held the lease in. */
15344
15651
  scope: LeaseScopeSchema,
15345
15652
  /** Human-readable reason for the kill. */
15346
- reason: z13.string()
15653
+ reason: z14.string()
15347
15654
  }).strict();
15348
- var QueueAdmitDispositionSchema = z13.enum(["admitted", "deferred"]);
15349
- var QueueAdmitResultResponseSchema = z13.object({
15655
+ var QueueAdmitDispositionSchema = z14.enum(["admitted", "deferred"]);
15656
+ var QueueAdmitResultResponseSchema = z14.object({
15350
15657
  /** Tag discriminating this response variant. */
15351
- kind: z13.literal("queue_admit_result"),
15658
+ kind: z14.literal("queue_admit_result"),
15352
15659
  /** Whether the LLM call was admitted or deferred. */
15353
15660
  disposition: QueueAdmitDispositionSchema,
15354
15661
  /** Back-off in ms before re-requesting (0 when admitted). */
15355
- retry_after_ms: z13.number().int().nonnegative(),
15662
+ retry_after_ms: z14.number().int().nonnegative(),
15356
15663
  /** Remaining provider token budget after this decision. */
15357
- tokens_remaining: z13.number().int().nonnegative(),
15664
+ tokens_remaining: z14.number().int().nonnegative(),
15358
15665
  /** Number of higher/equal-priority waiters ahead (0 when admitted). */
15359
- queue_position: z13.number().int().nonnegative()
15666
+ queue_position: z14.number().int().nonnegative()
15360
15667
  }).strict();
15361
- var HeartbeatAckResponseSchema = z13.object({
15668
+ var HeartbeatAckResponseSchema = z14.object({
15362
15669
  /** Tag discriminating this response variant. */
15363
- kind: z13.literal("heartbeat_ack")
15670
+ kind: z14.literal("heartbeat_ack")
15364
15671
  }).strict();
15365
- var ResourceAdmitDispositionSchema = z13.enum(["admitted", "deferred"]);
15366
- var ResourceAdmitResultResponseSchema = z13.object({
15672
+ var ResourceAdmitDispositionSchema = z14.enum(["admitted", "deferred"]);
15673
+ var ResourceAdmitResultResponseSchema = z14.object({
15367
15674
  /** Tag discriminating this response variant. */
15368
- kind: z13.literal("resource_admit_result"),
15675
+ kind: z14.literal("resource_admit_result"),
15369
15676
  /** Whether the heavy op was admitted or deferred. */
15370
15677
  disposition: ResourceAdmitDispositionSchema,
15371
15678
  /** Back-off in ms before re-requesting (0 when admitted). */
15372
- retry_after_ms: z13.number().int().nonnegative(),
15679
+ retry_after_ms: z14.number().int().nonnegative(),
15373
15680
  /** Remaining slots for the class after this decision. */
15374
- slots_remaining: z13.number().int().nonnegative()
15681
+ slots_remaining: z14.number().int().nonnegative()
15375
15682
  }).strict();
15376
- var ResourceReleaseResultResponseSchema = z13.object({
15683
+ var ResourceReleaseResultResponseSchema = z14.object({
15377
15684
  /** Tag discriminating this response variant. */
15378
- kind: z13.literal("resource_release_result"),
15685
+ kind: z14.literal("resource_release_result"),
15379
15686
  /** Whether a held slot was actually released (false = no such holder). */
15380
- released: z13.boolean(),
15687
+ released: z14.boolean(),
15381
15688
  /** Remaining in-flight holders for the class after the release. */
15382
- slots_remaining: z13.number().int().nonnegative()
15689
+ slots_remaining: z14.number().int().nonnegative()
15383
15690
  }).strict();
15384
- var LeaseErrorResponseSchema = z13.object({
15691
+ var LeaseErrorResponseSchema = z14.object({
15385
15692
  /** Tag discriminating this response variant. */
15386
- kind: z13.literal("error"),
15693
+ kind: z14.literal("error"),
15387
15694
  /** Machine-readable error code (e.g. `E_LEASE_BAD_VERSION`, `E_LEASE_UNIMPLEMENTED`). */
15388
- code: z13.string().min(1),
15695
+ code: z14.string().min(1),
15389
15696
  /** Human-readable error message. */
15390
- message: z13.string()
15697
+ message: z14.string()
15391
15698
  }).strict();
15392
- var LeaseIpcResponseSchema = z13.discriminatedUnion("kind", [
15699
+ var LeaseIpcResponseSchema = z14.discriminatedUnion("kind", [
15393
15700
  LeaseGrantedResponseSchema,
15394
15701
  LeaseQueuedResponseSchema,
15395
15702
  LeaseDeniedResponseSchema,
@@ -15403,27 +15710,27 @@ var LeaseIpcResponseSchema = z13.discriminatedUnion("kind", [
15403
15710
  ResourceReleaseResultResponseSchema,
15404
15711
  LeaseErrorResponseSchema
15405
15712
  ]);
15406
- var LeaseIpcRequestEnvelopeSchema = z13.object({
15713
+ var LeaseIpcRequestEnvelopeSchema = z14.object({
15407
15714
  /** Parallel protocol version. */
15408
- protocol_version: z13.string(),
15715
+ protocol_version: z14.string(),
15409
15716
  /** Correlation id echoed back on the matching response. */
15410
- id: z13.string().min(1),
15717
+ id: z14.string().min(1),
15411
15718
  /** Direction discriminator. */
15412
- direction: z13.literal("request"),
15719
+ direction: z14.literal("request"),
15413
15720
  /** The request body. */
15414
15721
  request: LeaseIpcRequestSchema
15415
15722
  }).strict();
15416
- var LeaseIpcResponseEnvelopeSchema = z13.object({
15723
+ var LeaseIpcResponseEnvelopeSchema = z14.object({
15417
15724
  /** Parallel protocol version. */
15418
- protocol_version: z13.string(),
15725
+ protocol_version: z14.string(),
15419
15726
  /** Correlation id echoed from the originating request (or a fresh id for events). */
15420
- id: z13.string().min(1),
15727
+ id: z14.string().min(1),
15421
15728
  /** Direction discriminator. */
15422
- direction: z13.literal("response"),
15729
+ direction: z14.literal("response"),
15423
15730
  /** The response body. */
15424
15731
  response: LeaseIpcResponseSchema
15425
15732
  }).strict();
15426
- var LeaseIpcEnvelopeSchema = z13.discriminatedUnion("direction", [
15733
+ var LeaseIpcEnvelopeSchema = z14.discriminatedUnion("direction", [
15427
15734
  LeaseIpcRequestEnvelopeSchema,
15428
15735
  LeaseIpcResponseEnvelopeSchema
15429
15736
  ]);
@@ -15458,7 +15765,7 @@ var LEASE_IPC_MESSAGE_KINDS = [
15458
15765
  ];
15459
15766
 
15460
15767
  // packages/contracts/src/llm/catalog-schema.ts
15461
- import { z as z14 } from "zod";
15768
+ import { z as z15 } from "zod";
15462
15769
  var CATALOG_MODEL_STATUSES = [
15463
15770
  "stable",
15464
15771
  "beta",
@@ -15467,78 +15774,78 @@ var CATALOG_MODEL_STATUSES = [
15467
15774
  "retired"
15468
15775
  ];
15469
15776
  var CATALOG_AUTH_TYPES = ["api_key", "oauth", "bedrock", "vertex"];
15470
- var isoDate = z14.string().regex(/^\d{4}-\d{2}-\d{2}$/, "must be an ISO date (YYYY-MM-DD)");
15471
- var semver = z14.string().regex(/^\d+\.\d+\.\d+$/, "must be semver (MAJOR.MINOR.PATCH)");
15472
- var catalogModalitiesSchema = z14.object({
15473
- input: z14.array(z14.string()),
15474
- output: z14.array(z14.string())
15777
+ var isoDate = z15.string().regex(/^\d{4}-\d{2}-\d{2}$/, "must be an ISO date (YYYY-MM-DD)");
15778
+ var semver = z15.string().regex(/^\d+\.\d+\.\d+$/, "must be semver (MAJOR.MINOR.PATCH)");
15779
+ var catalogModalitiesSchema = z15.object({
15780
+ input: z15.array(z15.string()),
15781
+ output: z15.array(z15.string())
15475
15782
  }).strict();
15476
- var catalogCostSchema = z14.object({
15477
- input: z14.number().optional(),
15478
- output: z14.number().optional(),
15479
- cache_read: z14.number().optional(),
15480
- cache_write: z14.number().optional(),
15481
- context_over_200k: z14.number().optional()
15783
+ var catalogCostSchema = z15.object({
15784
+ input: z15.number().optional(),
15785
+ output: z15.number().optional(),
15786
+ cache_read: z15.number().optional(),
15787
+ cache_write: z15.number().optional(),
15788
+ context_over_200k: z15.number().optional()
15482
15789
  }).strict();
15483
- var catalogLimitSchema = z14.object({
15484
- context: z14.number(),
15485
- output: z14.number()
15790
+ var catalogLimitSchema = z15.object({
15791
+ context: z15.number(),
15792
+ output: z15.number()
15486
15793
  }).strict();
15487
- var catalogModelProviderSchema = z14.object({
15488
- npm: z14.string(),
15489
- api: z14.string()
15794
+ var catalogModelProviderSchema = z15.object({
15795
+ npm: z15.string(),
15796
+ api: z15.string()
15490
15797
  }).strict();
15491
- var catalogModelEntrySchema = z14.object({
15492
- id: z14.string(),
15493
- name: z14.string(),
15494
- family: z14.string(),
15495
- attachment: z14.boolean(),
15496
- reasoning: z14.boolean(),
15497
- temperature: z14.boolean(),
15498
- interleaved: z14.boolean(),
15499
- tool_call: z14.boolean(),
15798
+ var catalogModelEntrySchema = z15.object({
15799
+ id: z15.string(),
15800
+ name: z15.string(),
15801
+ family: z15.string(),
15802
+ attachment: z15.boolean(),
15803
+ reasoning: z15.boolean(),
15804
+ temperature: z15.boolean(),
15805
+ interleaved: z15.boolean(),
15806
+ tool_call: z15.boolean(),
15500
15807
  modalities: catalogModalitiesSchema,
15501
15808
  cost: catalogCostSchema,
15502
15809
  limit: catalogLimitSchema,
15503
- status: z14.enum(CATALOG_MODEL_STATUSES),
15810
+ status: z15.enum(CATALOG_MODEL_STATUSES),
15504
15811
  release_date: isoDate,
15505
15812
  provider: catalogModelProviderSchema
15506
15813
  }).strict();
15507
- var catalogProviderSchema = z14.object({
15508
- id: z14.string(),
15509
- endpoint: z14.string(),
15510
- authTypes: z14.array(z14.enum(CATALOG_AUTH_TYPES)).min(1),
15511
- npm: z14.string().optional()
15814
+ var catalogProviderSchema = z15.object({
15815
+ id: z15.string(),
15816
+ endpoint: z15.string(),
15817
+ authTypes: z15.array(z15.enum(CATALOG_AUTH_TYPES)).min(1),
15818
+ npm: z15.string().optional()
15512
15819
  }).strict();
15513
- var curatedCatalogSchema = z14.object({
15514
- $schema: z14.string().optional(),
15820
+ var curatedCatalogSchema = z15.object({
15821
+ $schema: z15.string().optional(),
15515
15822
  version: semver,
15516
15823
  lastUpdated: isoDate,
15517
- providers: z14.record(z14.string(), catalogProviderSchema),
15518
- models: z14.record(z14.string(), z14.record(z14.string(), catalogModelEntrySchema))
15824
+ providers: z15.record(z15.string(), catalogProviderSchema),
15825
+ models: z15.record(z15.string(), z15.record(z15.string(), catalogModelEntrySchema))
15519
15826
  }).strict();
15520
- var modelsCatalogRowInsertSchema = z14.object({
15521
- id: z14.string(),
15522
- providerId: z14.string(),
15523
- name: z14.string(),
15524
- family: z14.string(),
15525
- attachment: z14.boolean(),
15526
- reasoning: z14.boolean(),
15527
- temperature: z14.boolean(),
15528
- interleaved: z14.boolean(),
15529
- toolCall: z14.boolean(),
15530
- modalities: z14.string(),
15531
- cost: z14.string(),
15532
- contextLimit: z14.number().nullable().optional(),
15533
- outputLimit: z14.number().nullable().optional(),
15534
- status: z14.enum(CATALOG_MODEL_STATUSES),
15827
+ var modelsCatalogRowInsertSchema = z15.object({
15828
+ id: z15.string(),
15829
+ providerId: z15.string(),
15830
+ name: z15.string(),
15831
+ family: z15.string(),
15832
+ attachment: z15.boolean(),
15833
+ reasoning: z15.boolean(),
15834
+ temperature: z15.boolean(),
15835
+ interleaved: z15.boolean(),
15836
+ toolCall: z15.boolean(),
15837
+ modalities: z15.string(),
15838
+ cost: z15.string(),
15839
+ contextLimit: z15.number().nullable().optional(),
15840
+ outputLimit: z15.number().nullable().optional(),
15841
+ status: z15.enum(CATALOG_MODEL_STATUSES),
15535
15842
  releaseDate: isoDate,
15536
- modelsDevId: z14.string(),
15537
- source: z14.string(),
15538
- seededAt: z14.string().optional()
15843
+ modelsDevId: z15.string(),
15844
+ source: z15.string(),
15845
+ seededAt: z15.string().optional()
15539
15846
  }).strict();
15540
15847
  var modelsCatalogRowSelectSchema = modelsCatalogRowInsertSchema.extend({
15541
- seededAt: z14.string()
15848
+ seededAt: z15.string()
15542
15849
  });
15543
15850
 
15544
15851
  // packages/contracts/src/llm/system-of-use.ts
@@ -15586,7 +15893,7 @@ var BUILTIN_SYSTEMS_OF_USE = [
15586
15893
  ];
15587
15894
 
15588
15895
  // packages/contracts/src/workgraph.ts
15589
- import { z as z15 } from "zod";
15896
+ import { z as z16 } from "zod";
15590
15897
 
15591
15898
  // packages/contracts/src/status-registry.ts
15592
15899
  var TASK_STATUSES = [
@@ -15601,10 +15908,10 @@ var TASK_STATUSES = [
15601
15908
 
15602
15909
  // packages/contracts/src/workgraph.ts
15603
15910
  var E_WORKGRAPH_PARENT_TYPE_MATRIX = "E_WORKGRAPH_PARENT_TYPE_MATRIX";
15604
- var taskTypeSchema = z15.enum(["saga", "epic", "task", "subtask"]);
15605
- var taskPrioritySchema = z15.enum(["critical", "high", "medium", "low"]);
15606
- var taskStatusSchema = z15.enum(TASK_STATUSES);
15607
- var verificationGateSchema = z15.enum([
15911
+ var taskTypeSchema = z16.enum(["saga", "epic", "task", "subtask"]);
15912
+ var taskPrioritySchema = z16.enum(["critical", "high", "medium", "low"]);
15913
+ var taskStatusSchema = z16.enum(TASK_STATUSES);
15914
+ var verificationGateSchema = z16.enum([
15608
15915
  "implemented",
15609
15916
  "testsPassed",
15610
15917
  "qaPassed",
@@ -15613,7 +15920,7 @@ var verificationGateSchema = z15.enum([
15613
15920
  "documented",
15614
15921
  "nexusImpact"
15615
15922
  ]);
15616
- var workGraphRelationKindSchema = z15.enum([
15923
+ var workGraphRelationKindSchema = z16.enum([
15617
15924
  "contains",
15618
15925
  "depends_on",
15619
15926
  "blocks",
@@ -15621,317 +15928,317 @@ var workGraphRelationKindSchema = z15.enum([
15621
15928
  "groups",
15622
15929
  "satisfies"
15623
15930
  ]);
15624
- var workGraphTraversalDirectionSchema = z15.enum([
15931
+ var workGraphTraversalDirectionSchema = z16.enum([
15625
15932
  "ancestors",
15626
15933
  "descendants",
15627
15934
  "upstream",
15628
15935
  "downstream"
15629
15936
  ]);
15630
- var workGraphEdgeDirectionSchema = z15.enum(["out", "in", "both"]);
15631
- var paginationParamsSchema = z15.object({
15632
- cursor: z15.string().min(1).optional(),
15633
- limit: z15.number().int().positive().max(500).optional()
15937
+ var workGraphEdgeDirectionSchema = z16.enum(["out", "in", "both"]);
15938
+ var paginationParamsSchema = z16.object({
15939
+ cursor: z16.string().min(1).optional(),
15940
+ limit: z16.number().int().positive().max(500).optional()
15634
15941
  });
15635
- var workGraphNodeSchema = z15.object({
15636
- id: z15.string().min(1),
15942
+ var workGraphNodeSchema = z16.object({
15943
+ id: z16.string().min(1),
15637
15944
  type: taskTypeSchema,
15638
- title: z15.string(),
15945
+ title: z16.string(),
15639
15946
  status: taskStatusSchema,
15640
15947
  priority: taskPrioritySchema,
15641
- parentId: z15.string().min(1).optional()
15948
+ parentId: z16.string().min(1).optional()
15642
15949
  });
15643
- var workGraphEdgeSchema = z15.object({
15644
- fromId: z15.string().min(1),
15645
- toId: z15.string().min(1),
15950
+ var workGraphEdgeSchema = z16.object({
15951
+ fromId: z16.string().min(1),
15952
+ toId: z16.string().min(1),
15646
15953
  kind: workGraphRelationKindSchema
15647
15954
  });
15648
- var workGraphHierarchyEdgeSchema = z15.object({
15649
- fromId: z15.string().min(1),
15650
- toId: z15.string().min(1),
15651
- kind: z15.literal("contains")
15955
+ var workGraphHierarchyEdgeSchema = z16.object({
15956
+ fromId: z16.string().min(1),
15957
+ toId: z16.string().min(1),
15958
+ kind: z16.literal("contains")
15652
15959
  }).strict();
15653
- var workGraphPageInfoSchema = z15.object({
15654
- nextCursor: z15.string().min(1).optional(),
15655
- hasMore: z15.boolean()
15960
+ var workGraphPageInfoSchema = z16.object({
15961
+ nextCursor: z16.string().min(1).optional(),
15962
+ hasMore: z16.boolean()
15656
15963
  });
15657
- var workGraphRollupCountsSchema = z15.object({
15658
- total: z15.number().int().nonnegative(),
15659
- byStatus: z15.partialRecord(taskStatusSchema, z15.number().int().nonnegative()),
15660
- byType: z15.partialRecord(taskTypeSchema, z15.number().int().nonnegative())
15964
+ var workGraphRollupCountsSchema = z16.object({
15965
+ total: z16.number().int().nonnegative(),
15966
+ byStatus: z16.partialRecord(taskStatusSchema, z16.number().int().nonnegative()),
15967
+ byType: z16.partialRecord(taskTypeSchema, z16.number().int().nonnegative())
15661
15968
  });
15662
- var workGraphSubtreePercentagesSchema = z15.object({
15663
- done: z15.number().nonnegative(),
15664
- active: z15.number().nonnegative(),
15665
- blocked: z15.number().nonnegative(),
15666
- pending: z15.number().nonnegative(),
15667
- cancelled: z15.number().nonnegative()
15969
+ var workGraphSubtreePercentagesSchema = z16.object({
15970
+ done: z16.number().nonnegative(),
15971
+ active: z16.number().nonnegative(),
15972
+ blocked: z16.number().nonnegative(),
15973
+ pending: z16.number().nonnegative(),
15974
+ cancelled: z16.number().nonnegative()
15668
15975
  });
15669
- var workGraphProjectionMismatchSchema = z15.object({
15670
- field: z15.string().min(1),
15671
- expected: z15.number().int().nonnegative(),
15672
- actual: z15.number().int().nonnegative()
15976
+ var workGraphProjectionMismatchSchema = z16.object({
15977
+ field: z16.string().min(1),
15978
+ expected: z16.number().int().nonnegative(),
15979
+ actual: z16.number().int().nonnegative()
15673
15980
  });
15674
15981
  var workGraphReadyFrontierTaskSchema = workGraphNodeSchema.extend({
15675
- role: z15.string().min(1).optional(),
15676
- dependencyBlockers: z15.array(z15.object({ taskId: z15.string().min(1), status: taskStatusSchema })),
15677
- gateBlockers: z15.array(z15.object({ gate: verificationGateSchema }))
15982
+ role: z16.string().min(1).optional(),
15983
+ dependencyBlockers: z16.array(z16.object({ taskId: z16.string().min(1), status: taskStatusSchema })),
15984
+ gateBlockers: z16.array(z16.object({ gate: verificationGateSchema }))
15678
15985
  });
15679
15986
  var workGraphRelationEdgeSchema = workGraphEdgeSchema.extend({
15680
- source: z15.literal("relation"),
15681
- relationType: z15.enum(TASK_RELATION_TYPES),
15682
- reason: z15.string().min(1).optional()
15987
+ source: z16.literal("relation"),
15988
+ relationType: z16.enum(TASK_RELATION_TYPES),
15989
+ reason: z16.string().min(1).optional()
15683
15990
  });
15684
15991
  var workGraphDependencyEdgeSchema = workGraphEdgeSchema.extend({
15685
- source: z15.literal("dependency"),
15686
- kind: z15.literal("depends_on")
15992
+ source: z16.literal("dependency"),
15993
+ kind: z16.literal("depends_on")
15687
15994
  });
15688
- var workGraphOmissionReasonSchema = z15.enum([
15995
+ var workGraphOmissionReasonSchema = z16.enum([
15689
15996
  "budget_exceeded",
15690
15997
  "not_requested",
15691
15998
  "not_available",
15692
15999
  "redacted",
15693
16000
  "truncated"
15694
16001
  ]);
15695
- var workGraphContextBudgetSchema = z15.object({
15696
- tokenBudget: z15.number().int().nonnegative(),
15697
- estimatedTokens: z15.number().int().nonnegative(),
15698
- remainingTokens: z15.number().int().nonnegative(),
15699
- truncated: z15.boolean()
16002
+ var workGraphContextBudgetSchema = z16.object({
16003
+ tokenBudget: z16.number().int().nonnegative(),
16004
+ estimatedTokens: z16.number().int().nonnegative(),
16005
+ remainingTokens: z16.number().int().nonnegative(),
16006
+ truncated: z16.boolean()
15700
16007
  });
15701
- var workGraphOmissionSchema = z15.object({
15702
- path: z15.string().min(1),
16008
+ var workGraphOmissionSchema = z16.object({
16009
+ path: z16.string().min(1),
15703
16010
  reason: workGraphOmissionReasonSchema,
15704
- message: z15.string().min(1),
15705
- estimatedTokens: z15.number().int().nonnegative().optional()
16011
+ message: z16.string().min(1),
16012
+ estimatedTokens: z16.number().int().nonnegative().optional()
15706
16013
  });
15707
- var workGraphDirectEdgeSchema = z15.discriminatedUnion("source", [
16014
+ var workGraphDirectEdgeSchema = z16.discriminatedUnion("source", [
15708
16015
  workGraphRelationEdgeSchema,
15709
16016
  workGraphDependencyEdgeSchema
15710
16017
  ]);
15711
16018
  var workGraphContextPackParamsSchema = paginationParamsSchema.extend({
15712
- rootId: z15.string().min(1),
15713
- tokenBudget: z15.number().int().positive().optional(),
15714
- includeRelations: z15.boolean().optional(),
15715
- includeReadiness: z15.boolean().optional(),
15716
- includeRollup: z15.boolean().optional()
16019
+ rootId: z16.string().min(1),
16020
+ tokenBudget: z16.number().int().positive().optional(),
16021
+ includeRelations: z16.boolean().optional(),
16022
+ includeReadiness: z16.boolean().optional(),
16023
+ includeRollup: z16.boolean().optional()
15717
16024
  });
15718
16025
  var workGraphSliceParamsSchema = paginationParamsSchema.extend({
15719
- rootId: z15.string().min(1),
16026
+ rootId: z16.string().min(1),
15720
16027
  direction: workGraphTraversalDirectionSchema.optional(),
15721
- maxDepth: z15.number().int().nonnegative().optional(),
15722
- includeRelations: z15.boolean().optional()
16028
+ maxDepth: z16.number().int().nonnegative().optional(),
16029
+ includeRelations: z16.boolean().optional()
15723
16030
  });
15724
- var workGraphSliceSchema = z15.object({
15725
- rootId: z15.string().min(1),
16031
+ var workGraphSliceSchema = z16.object({
16032
+ rootId: z16.string().min(1),
15726
16033
  direction: workGraphTraversalDirectionSchema,
15727
- nodes: z15.array(workGraphNodeSchema),
15728
- edges: z15.array(workGraphEdgeSchema),
16034
+ nodes: z16.array(workGraphNodeSchema),
16035
+ edges: z16.array(workGraphEdgeSchema),
15729
16036
  pageInfo: workGraphPageInfoSchema,
15730
- omissions: z15.array(workGraphOmissionSchema).optional()
16037
+ omissions: z16.array(workGraphOmissionSchema).optional()
15731
16038
  });
15732
- var workGraphReadinessParamsSchema = z15.object({
15733
- rootId: z15.string().min(1),
15734
- role: z15.string().min(1).optional(),
15735
- includeGateBlockers: z15.boolean().optional()
16039
+ var workGraphReadinessParamsSchema = z16.object({
16040
+ rootId: z16.string().min(1),
16041
+ role: z16.string().min(1).optional(),
16042
+ includeGateBlockers: z16.boolean().optional()
15736
16043
  });
15737
- var workGraphReadinessResultSchema = z15.object({
15738
- rootId: z15.string().min(1),
15739
- role: z15.string().min(1).optional(),
15740
- ready: z15.boolean(),
15741
- warnings: z15.array(z15.string()),
15742
- groups: z15.object({
15743
- ready: z15.array(workGraphReadyFrontierTaskSchema),
15744
- blocked: z15.array(workGraphReadyFrontierTaskSchema),
15745
- blockedBy: z15.array(
15746
- z15.discriminatedUnion("kind", [
15747
- z15.object({
15748
- kind: z15.literal("dependency"),
15749
- blockerId: z15.string().min(1),
15750
- blocks: z15.array(z15.string().min(1))
16044
+ var workGraphReadinessResultSchema = z16.object({
16045
+ rootId: z16.string().min(1),
16046
+ role: z16.string().min(1).optional(),
16047
+ ready: z16.boolean(),
16048
+ warnings: z16.array(z16.string()),
16049
+ groups: z16.object({
16050
+ ready: z16.array(workGraphReadyFrontierTaskSchema),
16051
+ blocked: z16.array(workGraphReadyFrontierTaskSchema),
16052
+ blockedBy: z16.array(
16053
+ z16.discriminatedUnion("kind", [
16054
+ z16.object({
16055
+ kind: z16.literal("dependency"),
16056
+ blockerId: z16.string().min(1),
16057
+ blocks: z16.array(z16.string().min(1))
15751
16058
  }),
15752
- z15.object({
15753
- kind: z15.literal("gate"),
16059
+ z16.object({
16060
+ kind: z16.literal("gate"),
15754
16061
  gate: verificationGateSchema,
15755
- blocks: z15.array(z15.string().min(1))
16062
+ blocks: z16.array(z16.string().min(1))
15756
16063
  })
15757
16064
  ])
15758
16065
  )
15759
16066
  })
15760
16067
  });
15761
- var workGraphContextPackSchema = z15.object({
15762
- rootId: z15.string().min(1),
15763
- generatedAt: z15.string().min(1),
16068
+ var workGraphContextPackSchema = z16.object({
16069
+ rootId: z16.string().min(1),
16070
+ generatedAt: z16.string().min(1),
15764
16071
  budget: workGraphContextBudgetSchema,
15765
16072
  slice: workGraphSliceSchema,
15766
- relationEdges: z15.object({
15767
- rootId: z15.string().min(1),
16073
+ relationEdges: z16.object({
16074
+ rootId: z16.string().min(1),
15768
16075
  direction: workGraphEdgeDirectionSchema,
15769
- edges: z15.array(workGraphDirectEdgeSchema)
16076
+ edges: z16.array(workGraphDirectEdgeSchema)
15770
16077
  }).optional(),
15771
16078
  readiness: workGraphReadinessResultSchema.optional(),
15772
- rollup: z15.lazy(() => tasksRollupResultSchema).optional(),
15773
- omissions: z15.array(workGraphOmissionSchema)
16079
+ rollup: z16.lazy(() => tasksRollupResultSchema).optional(),
16080
+ omissions: z16.array(workGraphOmissionSchema)
15774
16081
  });
15775
- var workGraphScaffoldValidateParamsSchema = z15.object({
15776
- rootId: z15.string().min(1),
15777
- nodes: z15.array(
15778
- z15.object({
15779
- id: z15.string().min(1),
16082
+ var workGraphScaffoldValidateParamsSchema = z16.object({
16083
+ rootId: z16.string().min(1),
16084
+ nodes: z16.array(
16085
+ z16.object({
16086
+ id: z16.string().min(1),
15780
16087
  type: taskTypeSchema,
15781
- parentId: z15.string().min(1).nullable().optional()
16088
+ parentId: z16.string().min(1).nullable().optional()
15782
16089
  })
15783
16090
  ),
15784
- edges: z15.array(workGraphDirectEdgeSchema).optional(),
15785
- dryRun: z15.boolean().optional()
16091
+ edges: z16.array(workGraphDirectEdgeSchema).optional(),
16092
+ dryRun: z16.boolean().optional()
15786
16093
  });
15787
- var workGraphScaffoldValidationIssueSchema = z15.object({
15788
- code: z15.string().min(1),
15789
- message: z15.string().min(1),
15790
- taskId: z15.string().min(1).optional(),
15791
- severity: z15.enum(["error", "warning"])
16094
+ var workGraphScaffoldValidationIssueSchema = z16.object({
16095
+ code: z16.string().min(1),
16096
+ message: z16.string().min(1),
16097
+ taskId: z16.string().min(1).optional(),
16098
+ severity: z16.enum(["error", "warning"])
15792
16099
  });
15793
- var workGraphScaffoldValidateResultSchema = z15.object({
15794
- rootId: z15.string().min(1),
15795
- valid: z15.boolean(),
15796
- dryRun: z15.boolean(),
15797
- issues: z15.array(workGraphScaffoldValidationIssueSchema),
15798
- hierarchy: z15.object({
15799
- valid: z15.boolean(),
15800
- violations: z15.array(
15801
- z15.object({
15802
- code: z15.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
15803
- taskId: z15.string().min(1),
16100
+ var workGraphScaffoldValidateResultSchema = z16.object({
16101
+ rootId: z16.string().min(1),
16102
+ valid: z16.boolean(),
16103
+ dryRun: z16.boolean(),
16104
+ issues: z16.array(workGraphScaffoldValidationIssueSchema),
16105
+ hierarchy: z16.object({
16106
+ valid: z16.boolean(),
16107
+ violations: z16.array(
16108
+ z16.object({
16109
+ code: z16.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
16110
+ taskId: z16.string().min(1),
15804
16111
  taskType: taskTypeSchema,
15805
- parentId: z15.string().min(1).nullable(),
16112
+ parentId: z16.string().min(1).nullable(),
15806
16113
  parentType: taskTypeSchema.optional(),
15807
- message: z15.string().min(1)
16114
+ message: z16.string().min(1)
15808
16115
  })
15809
16116
  )
15810
16117
  })
15811
16118
  });
15812
16119
  var workGraphScaffoldApplyParamsSchema = workGraphScaffoldValidateParamsSchema.extend({
15813
- apply: z15.boolean().optional()
16120
+ apply: z16.boolean().optional()
15814
16121
  });
15815
16122
  var workGraphScaffoldApplyResultSchema = workGraphScaffoldValidateResultSchema.extend({
15816
- applied: z15.boolean(),
15817
- nodesChanged: z15.number().int().nonnegative(),
15818
- edgesChanged: z15.number().int().nonnegative()
16123
+ applied: z16.boolean(),
16124
+ nodesChanged: z16.number().int().nonnegative(),
16125
+ edgesChanged: z16.number().int().nonnegative()
15819
16126
  });
15820
- var workGraphPlanningDocParamsSchema = z15.object({
15821
- rootId: z15.string().min(1),
15822
- audience: z15.enum(["agent", "maintainer"]),
15823
- tokenBudget: z15.number().int().positive().optional(),
15824
- includeRelations: z15.boolean().optional(),
15825
- includeReadiness: z15.boolean().optional(),
15826
- includeRollup: z15.boolean().optional()
16127
+ var workGraphPlanningDocParamsSchema = z16.object({
16128
+ rootId: z16.string().min(1),
16129
+ audience: z16.enum(["agent", "maintainer"]),
16130
+ tokenBudget: z16.number().int().positive().optional(),
16131
+ includeRelations: z16.boolean().optional(),
16132
+ includeReadiness: z16.boolean().optional(),
16133
+ includeRollup: z16.boolean().optional()
15827
16134
  });
15828
- var workGraphPlanningDocSchema = z15.object({
15829
- rootId: z15.string().min(1),
15830
- generatedAt: z15.string().min(1),
15831
- audience: z15.enum(["agent", "maintainer"]),
15832
- title: z15.string().min(1),
15833
- content: z15.string(),
15834
- sections: z15.array(z15.string().min(1)),
15835
- estimatedTokens: z15.number().int().nonnegative(),
15836
- budget: z15.object({
15837
- tokenBudget: z15.number().int().positive(),
15838
- truncated: z15.boolean()
16135
+ var workGraphPlanningDocSchema = z16.object({
16136
+ rootId: z16.string().min(1),
16137
+ generatedAt: z16.string().min(1),
16138
+ audience: z16.enum(["agent", "maintainer"]),
16139
+ title: z16.string().min(1),
16140
+ content: z16.string(),
16141
+ sections: z16.array(z16.string().min(1)),
16142
+ estimatedTokens: z16.number().int().nonnegative(),
16143
+ budget: z16.object({
16144
+ tokenBudget: z16.number().int().positive(),
16145
+ truncated: z16.boolean()
15839
16146
  }).optional()
15840
16147
  });
15841
16148
  var tasksTraverseParamsSchema = paginationParamsSchema.extend({
15842
- rootId: z15.string().min(1),
16149
+ rootId: z16.string().min(1),
15843
16150
  direction: workGraphTraversalDirectionSchema,
15844
- maxDepth: z15.number().int().nonnegative().optional(),
15845
- includeRelations: z15.boolean().optional()
16151
+ maxDepth: z16.number().int().nonnegative().optional(),
16152
+ includeRelations: z16.boolean().optional()
15846
16153
  });
15847
- var tasksTraverseResultSchema = z15.object({
15848
- rootId: z15.string().min(1),
16154
+ var tasksTraverseResultSchema = z16.object({
16155
+ rootId: z16.string().min(1),
15849
16156
  direction: workGraphTraversalDirectionSchema,
15850
- nodes: z15.array(workGraphNodeSchema),
15851
- edges: z15.array(workGraphEdgeSchema),
16157
+ nodes: z16.array(workGraphNodeSchema),
16158
+ edges: z16.array(workGraphEdgeSchema),
15852
16159
  pageInfo: workGraphPageInfoSchema
15853
16160
  });
15854
16161
  var tasksTreeParamsSchema = paginationParamsSchema.extend({
15855
- rootId: z15.string().min(1),
15856
- maxDepth: z15.number().int().nonnegative().optional()
16162
+ rootId: z16.string().min(1),
16163
+ maxDepth: z16.number().int().nonnegative().optional()
15857
16164
  });
15858
- var tasksTreeResultSchema = z15.object({
15859
- rootId: z15.string().min(1),
15860
- nodes: z15.array(workGraphNodeSchema.extend({ depth: z15.number().int().positive() })),
15861
- edges: z15.array(workGraphHierarchyEdgeSchema),
16165
+ var tasksTreeResultSchema = z16.object({
16166
+ rootId: z16.string().min(1),
16167
+ nodes: z16.array(workGraphNodeSchema.extend({ depth: z16.number().int().positive() })),
16168
+ edges: z16.array(workGraphHierarchyEdgeSchema),
15862
16169
  pageInfo: workGraphPageInfoSchema
15863
16170
  });
15864
- var tasksRollupParamsSchema = z15.object({
15865
- rootId: z15.string().min(1),
16171
+ var tasksRollupParamsSchema = z16.object({
16172
+ rootId: z16.string().min(1),
15866
16173
  expectedDirectRollup: workGraphRollupCountsSchema.optional()
15867
16174
  });
15868
- var tasksRollupResultSchema = z15.object({
15869
- rootId: z15.string().min(1),
16175
+ var tasksRollupResultSchema = z16.object({
16176
+ rootId: z16.string().min(1),
15870
16177
  direct: workGraphRollupCountsSchema,
15871
16178
  subtree: workGraphRollupCountsSchema,
15872
- percentDenominator: z15.object({
15873
- basis: z15.literal("subtree-total"),
15874
- total: z15.number().int().nonnegative(),
15875
- description: z15.string().min(1)
16179
+ percentDenominator: z16.object({
16180
+ basis: z16.literal("subtree-total"),
16181
+ total: z16.number().int().nonnegative(),
16182
+ description: z16.string().min(1)
15876
16183
  }),
15877
16184
  percentages: workGraphSubtreePercentagesSchema,
15878
- staleProjection: z15.boolean(),
15879
- projectionMismatches: z15.array(workGraphProjectionMismatchSchema)
16185
+ staleProjection: z16.boolean(),
16186
+ projectionMismatches: z16.array(workGraphProjectionMismatchSchema)
15880
16187
  });
15881
- var tasksFrontierParamsSchema = z15.object({
15882
- rootId: z15.string().min(1),
15883
- role: z15.string().min(1).optional()
16188
+ var tasksFrontierParamsSchema = z16.object({
16189
+ rootId: z16.string().min(1),
16190
+ role: z16.string().min(1).optional()
15884
16191
  });
15885
- var tasksFrontierResultSchema = z15.object({
15886
- rootId: z15.string().min(1),
15887
- role: z15.string().min(1).optional(),
15888
- groups: z15.object({
15889
- ready: z15.array(workGraphReadyFrontierTaskSchema),
15890
- blocked: z15.array(workGraphReadyFrontierTaskSchema),
15891
- blockedBy: z15.array(
15892
- z15.discriminatedUnion("kind", [
15893
- z15.object({
15894
- kind: z15.literal("dependency"),
15895
- blockerId: z15.string().min(1),
15896
- blocks: z15.array(z15.string().min(1))
16192
+ var tasksFrontierResultSchema = z16.object({
16193
+ rootId: z16.string().min(1),
16194
+ role: z16.string().min(1).optional(),
16195
+ groups: z16.object({
16196
+ ready: z16.array(workGraphReadyFrontierTaskSchema),
16197
+ blocked: z16.array(workGraphReadyFrontierTaskSchema),
16198
+ blockedBy: z16.array(
16199
+ z16.discriminatedUnion("kind", [
16200
+ z16.object({
16201
+ kind: z16.literal("dependency"),
16202
+ blockerId: z16.string().min(1),
16203
+ blocks: z16.array(z16.string().min(1))
15897
16204
  }),
15898
- z15.object({
15899
- kind: z15.literal("gate"),
16205
+ z16.object({
16206
+ kind: z16.literal("gate"),
15900
16207
  gate: verificationGateSchema,
15901
- blocks: z15.array(z15.string().min(1))
16208
+ blocks: z16.array(z16.string().min(1))
15902
16209
  })
15903
16210
  ])
15904
16211
  )
15905
16212
  })
15906
16213
  });
15907
16214
  var tasksWorkGraphAuditParamsSchema = paginationParamsSchema.extend({
15908
- rootId: z15.string().min(1),
15909
- maxDepth: z15.number().int().nonnegative().optional(),
15910
- includeRelations: z15.boolean().optional()
16215
+ rootId: z16.string().min(1),
16216
+ maxDepth: z16.number().int().nonnegative().optional(),
16217
+ includeRelations: z16.boolean().optional()
15911
16218
  });
15912
- var tasksWorkGraphAuditResultSchema = z15.object({
15913
- rootId: z15.string().min(1),
15914
- hierarchy: z15.object({
15915
- valid: z15.boolean(),
15916
- violations: z15.array(
15917
- z15.object({
15918
- code: z15.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
15919
- taskId: z15.string().min(1),
16219
+ var tasksWorkGraphAuditResultSchema = z16.object({
16220
+ rootId: z16.string().min(1),
16221
+ hierarchy: z16.object({
16222
+ valid: z16.boolean(),
16223
+ violations: z16.array(
16224
+ z16.object({
16225
+ code: z16.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
16226
+ taskId: z16.string().min(1),
15920
16227
  taskType: taskTypeSchema,
15921
- parentId: z15.string().min(1).nullable(),
16228
+ parentId: z16.string().min(1).nullable(),
15922
16229
  parentType: taskTypeSchema.optional(),
15923
- message: z15.string().min(1)
16230
+ message: z16.string().min(1)
15924
16231
  })
15925
16232
  )
15926
16233
  }),
15927
16234
  traversal: tasksTraverseResultSchema,
15928
16235
  frontier: tasksFrontierResultSchema,
15929
16236
  rollup: tasksRollupResultSchema,
15930
- relationEdges: z15.object({
15931
- rootId: z15.string().min(1),
16237
+ relationEdges: z16.object({
16238
+ rootId: z16.string().min(1),
15932
16239
  direction: workGraphEdgeDirectionSchema,
15933
- edges: z15.array(
15934
- z15.discriminatedUnion("source", [
16240
+ edges: z16.array(
16241
+ z16.discriminatedUnion("source", [
15935
16242
  workGraphRelationEdgeSchema,
15936
16243
  workGraphDependencyEdgeSchema
15937
16244
  ])
@@ -15940,60 +16247,60 @@ var tasksWorkGraphAuditResultSchema = z15.object({
15940
16247
  });
15941
16248
 
15942
16249
  // packages/contracts/src/operations/docs.ts
15943
- import { z as z16 } from "zod";
15944
- var DOCS_PROJECTION_PROPOSAL_SCHEMA = z16.object({
15945
- version: z16.literal(1),
15946
- operation: z16.literal("docs.projection"),
15947
- identity: z16.object({
15948
- projectId: z16.string().min(1),
15949
- projectRoot: z16.string().min(1),
15950
- actor: z16.string().min(1),
15951
- operation: z16.literal("docs.projection"),
15952
- idempotencyKey: z16.string().min(1)
16250
+ import { z as z17 } from "zod";
16251
+ var DOCS_PROJECTION_PROPOSAL_SCHEMA = z17.object({
16252
+ version: z17.literal(1),
16253
+ operation: z17.literal("docs.projection"),
16254
+ identity: z17.object({
16255
+ projectId: z17.string().min(1),
16256
+ projectRoot: z17.string().min(1),
16257
+ actor: z17.string().min(1),
16258
+ operation: z17.literal("docs.projection"),
16259
+ idempotencyKey: z17.string().min(1)
15953
16260
  }).strict(),
15954
- source: z16.object({
15955
- attachmentId: z16.string().min(1),
15956
- sha256: z16.string().regex(/^[a-f0-9]{64}$/),
15957
- ownerId: z16.string().min(1),
15958
- ownerType: z16.enum(["task", "session", "observation", "decision", "learning", "pattern"]),
15959
- label: z16.string().min(1)
16261
+ source: z17.object({
16262
+ attachmentId: z17.string().min(1),
16263
+ sha256: z17.string().regex(/^[a-f0-9]{64}$/),
16264
+ ownerId: z17.string().min(1),
16265
+ ownerType: z17.enum(["task", "session", "observation", "decision", "learning", "pattern"]),
16266
+ label: z17.string().min(1)
15960
16267
  }).strict(),
15961
- observation: z16.object({
15962
- kind: z16.literal("doc-attachment"),
15963
- attachmentId: z16.string().min(1),
15964
- ownerId: z16.string().min(1),
15965
- addedAt: z16.string().min(1),
15966
- slug: z16.string().optional(),
15967
- type: z16.string().optional()
16268
+ observation: z17.object({
16269
+ kind: z17.literal("doc-attachment"),
16270
+ attachmentId: z17.string().min(1),
16271
+ ownerId: z17.string().min(1),
16272
+ addedAt: z17.string().min(1),
16273
+ slug: z17.string().optional(),
16274
+ type: z17.string().optional()
15968
16275
  }).strict()
15969
16276
  }).strict();
15970
- var DOCS_PROJECTION_RECEIPT_SCHEMA = z16.object({
15971
- version: z16.literal(1),
15972
- sourceHash: z16.string().regex(/^[a-f0-9]{64}$/),
15973
- graph: z16.enum(["completed", "disabled"]),
16277
+ var DOCS_PROJECTION_RECEIPT_SCHEMA = z17.object({
16278
+ version: z17.literal(1),
16279
+ sourceHash: z17.string().regex(/^[a-f0-9]{64}$/),
16280
+ graph: z17.enum(["completed", "disabled"]),
15974
16281
  /** Legacy receipts (before T13985): the "Doc attached" observation the projection wrote. */
15975
- observationId: z16.string().min(1).optional(),
16282
+ observationId: z17.string().min(1).optional(),
15976
16283
  /** T13985 (D11180): the canonical `llmtxt --documents--> owner` edge was written. */
15977
- documents: z16.literal(true).optional(),
15978
- verifiedAt: z16.string().min(1),
15979
- actor: z16.string().min(1)
16284
+ documents: z17.literal(true).optional(),
16285
+ verifiedAt: z17.string().min(1),
16286
+ actor: z17.string().min(1)
15980
16287
  }).strict().refine((receipt) => receipt.observationId !== void 0 || receipt.documents === true, {
15981
16288
  message: "A projection receipt records its documents edge or, for legacy jobs, its observation"
15982
16289
  });
15983
16290
 
15984
16291
  // packages/contracts/src/operations/ensures-schema-registry.ts
15985
- import { z as z17 } from "zod";
15986
- var taskTreeEntrySchema = z17.object({
15987
- title: z17.string({ message: "title must be a non-empty string" }).refine((s) => s.trim().length > 0, { message: "title must be a non-empty string" }),
15988
- acceptance: z17.array(z17.unknown(), { message: "must have a non-empty acceptance array" }).min(1, { message: "must have a non-empty acceptance array" }).refine((arr) => arr.some((s) => typeof s === "string" && s.trim().length > 0), {
16292
+ import { z as z18 } from "zod";
16293
+ var taskTreeEntrySchema = z18.object({
16294
+ title: z18.string({ message: "title must be a non-empty string" }).refine((s) => s.trim().length > 0, { message: "title must be a non-empty string" }),
16295
+ acceptance: z18.array(z18.unknown(), { message: "must have a non-empty acceptance array" }).min(1, { message: "must have a non-empty acceptance array" }).refine((arr) => arr.some((s) => typeof s === "string" && s.trim().length > 0), {
15989
16296
  message: "acceptance array contains no non-empty strings"
15990
16297
  }),
15991
- id: z17.string().optional(),
15992
- parentId: z17.string().optional(),
15993
- depends: z17.array(z17.string()).optional()
16298
+ id: z18.string().optional(),
16299
+ parentId: z18.string().optional(),
16300
+ depends: z18.array(z18.string()).optional()
15994
16301
  });
15995
- var taskTreeSchema = z17.array(taskTreeEntrySchema, { message: "task_tree must be a non-empty array" }).min(1, { message: "task_tree is an empty array \u2014 decomposition produced no tasks" });
15996
- var evidenceSchema = z17.unknown().superRefine((value, ctx) => {
16302
+ var taskTreeSchema = z18.array(taskTreeEntrySchema, { message: "task_tree must be a non-empty array" }).min(1, { message: "task_tree is an empty array \u2014 decomposition produced no tasks" });
16303
+ var evidenceSchema = z18.unknown().superRefine((value, ctx) => {
15997
16304
  if (value === null || value === void 0) {
15998
16305
  ctx.addIssue({
15999
16306
  code: "custom",
@@ -16027,7 +16334,7 @@ var evidenceSchema = z17.unknown().superRefine((value, ctx) => {
16027
16334
  message: `evidence must be a string, array, or object (got ${typeof value})`
16028
16335
  });
16029
16336
  });
16030
- var passthroughSchema = z17.unknown();
16337
+ var passthroughSchema = z18.unknown();
16031
16338
  var LEGACY_PASSTHROUGH_SCHEMA_NAMES = [
16032
16339
  // release.cantbook
16033
16340
  "version_bump_report",
@@ -16060,44 +16367,44 @@ var LEAD_RUNNER_TOOL_NAME = "cleo_run";
16060
16367
  var LEAD_RUNNER_TOOL = `mcp__${LEAD_RUNNER_MCP_SERVER}__${LEAD_RUNNER_TOOL_NAME}`;
16061
16368
 
16062
16369
  // packages/contracts/src/release/evidence-atoms.ts
16063
- import { z as z18 } from "zod";
16064
- var parsedPrEvidenceAtomSchema = z18.object({
16065
- kind: z18.literal("pr"),
16066
- prNumber: z18.number().int().positive()
16370
+ import { z as z19 } from "zod";
16371
+ var parsedPrEvidenceAtomSchema = z19.object({
16372
+ kind: z19.literal("pr"),
16373
+ prNumber: z19.number().int().positive()
16067
16374
  });
16068
- var prEvidenceStateModifierSchema = z18.object({
16069
- kind: z18.literal("state"),
16070
- value: z18.literal("MERGED")
16375
+ var prEvidenceStateModifierSchema = z19.object({
16376
+ kind: z19.literal("state"),
16377
+ value: z19.literal("MERGED")
16071
16378
  });
16072
- var ghPrViewSchema = z18.object({
16073
- state: z18.enum(["OPEN", "CLOSED", "MERGED"]),
16074
- mergedAt: z18.string().nullable(),
16075
- headRefOid: z18.string().optional(),
16076
- mergeCommit: z18.object({ oid: z18.string() }).nullable().optional(),
16077
- title: z18.string().optional(),
16078
- body: z18.string().optional(),
16079
- headRefName: z18.string().optional(),
16080
- files: z18.array(z18.object({ path: z18.string() })).optional(),
16081
- changedFiles: z18.number().int().nonnegative().optional(),
16082
- mergeable: z18.string().optional(),
16083
- statusCheckRollup: z18.array(
16084
- z18.object({
16085
- __typename: z18.string().optional(),
16086
- name: z18.string().optional(),
16087
- workflowName: z18.string().optional(),
16088
- conclusion: z18.string().nullable().optional(),
16089
- status: z18.string().optional(),
16379
+ var ghPrViewSchema = z19.object({
16380
+ state: z19.enum(["OPEN", "CLOSED", "MERGED"]),
16381
+ mergedAt: z19.string().nullable(),
16382
+ headRefOid: z19.string().optional(),
16383
+ mergeCommit: z19.object({ oid: z19.string() }).nullable().optional(),
16384
+ title: z19.string().optional(),
16385
+ body: z19.string().optional(),
16386
+ headRefName: z19.string().optional(),
16387
+ files: z19.array(z19.object({ path: z19.string() })).optional(),
16388
+ changedFiles: z19.number().int().nonnegative().optional(),
16389
+ mergeable: z19.string().optional(),
16390
+ statusCheckRollup: z19.array(
16391
+ z19.object({
16392
+ __typename: z19.string().optional(),
16393
+ name: z19.string().optional(),
16394
+ workflowName: z19.string().optional(),
16395
+ conclusion: z19.string().nullable().optional(),
16396
+ status: z19.string().optional(),
16090
16397
  /** ISO start time of a CheckRun; orders re-runs of one check (T13506). */
16091
- startedAt: z18.string().nullable().optional(),
16398
+ startedAt: z19.string().nullable().optional(),
16092
16399
  /** ISO completion time of a CheckRun; orders re-runs of one check (T13506). */
16093
- completedAt: z18.string().nullable().optional()
16400
+ completedAt: z19.string().nullable().optional()
16094
16401
  }).passthrough()
16095
16402
  ).optional().default([])
16096
16403
  }).passthrough();
16097
16404
  var PR_REQUIRED_WORKFLOWS = Object.freeze(["CI", "Contracts Dep Lint"]);
16098
16405
 
16099
16406
  // packages/contracts/src/release/plan.ts
16100
- import { z as z19 } from "zod";
16407
+ import { z as z20 } from "zod";
16101
16408
  var RELEASE_CHANNEL = ["latest", "beta", "alpha", "rc", "canary"];
16102
16409
  var RELEASE_SCHEME = ["calver", "semver", "calver-suffix"];
16103
16410
  var RELEASE_KIND = ["regular", "hotfix", "prerelease"];
@@ -16141,20 +16448,20 @@ var RESOLVED_SOURCE = [
16141
16448
  "language-default",
16142
16449
  "legacy-alias"
16143
16450
  ];
16144
- var ReleaseChannelSchema = z19.enum(RELEASE_CHANNEL);
16145
- var ReleaseSchemeSchema = z19.enum(RELEASE_SCHEME);
16146
- var ReleaseKindSchema = z19.enum(RELEASE_KIND);
16147
- var ReleaseStatusSchema = z19.enum(RELEASE_STATUS);
16148
- var GateStatusSchema = z19.enum(GATE_STATUS);
16149
- var GateNameSchema = z19.enum(GATE_NAME);
16150
- var PlatformTupleSchema = z19.enum(PLATFORM_TUPLE);
16151
- var PublisherSchema = z19.enum(PUBLISHER);
16152
- var TaskKindSchema = z19.enum(TASK_KIND);
16153
- var ImpactSchema = z19.enum(IMPACT);
16154
- var ResolvedSourceSchema = z19.enum(RESOLVED_SOURCE);
16155
- var Iso8601 = z19.iso.datetime({ offset: true });
16156
- var NonEmptyString = z19.string().min(1);
16157
- var ReleasePlanTaskSchema = z19.object({
16451
+ var ReleaseChannelSchema = z20.enum(RELEASE_CHANNEL);
16452
+ var ReleaseSchemeSchema = z20.enum(RELEASE_SCHEME);
16453
+ var ReleaseKindSchema = z20.enum(RELEASE_KIND);
16454
+ var ReleaseStatusSchema = z20.enum(RELEASE_STATUS);
16455
+ var GateStatusSchema = z20.enum(GATE_STATUS);
16456
+ var GateNameSchema = z20.enum(GATE_NAME);
16457
+ var PlatformTupleSchema = z20.enum(PLATFORM_TUPLE);
16458
+ var PublisherSchema = z20.enum(PUBLISHER);
16459
+ var TaskKindSchema = z20.enum(TASK_KIND);
16460
+ var ImpactSchema = z20.enum(IMPACT);
16461
+ var ResolvedSourceSchema = z20.enum(RESOLVED_SOURCE);
16462
+ var Iso8601 = z20.iso.datetime({ offset: true });
16463
+ var NonEmptyString = z20.string().min(1);
16464
+ var ReleasePlanTaskSchema = z20.object({
16158
16465
  /** Task ID (e.g. "T10001"). Format intentionally loose so historical IDs validate. */
16159
16466
  id: NonEmptyString,
16160
16467
  /** Conventional-commit-aligned task classification. */
@@ -16162,20 +16469,20 @@ var ReleasePlanTaskSchema = z19.object({
16162
16469
  /** SemVer impact classification. */
16163
16470
  impact: ImpactSchema,
16164
16471
  /** Human-readable changelog line for this task. */
16165
- userFacingSummary: z19.string(),
16472
+ userFacingSummary: z20.string(),
16166
16473
  /**
16167
16474
  * ADR-051 evidence atoms attesting the task's gate results. Format is
16168
16475
  * `kind:value` (e.g. `commit:abc123`, `test-run:vitest.json`). The contract
16169
16476
  * accepts empty arrays so legacy plans validate; `cleo release plan`
16170
16477
  * enforces non-empty via R-301.
16171
16478
  */
16172
- evidenceAtoms: z19.array(NonEmptyString),
16479
+ evidenceAtoms: z20.array(NonEmptyString),
16173
16480
  /** IVTR phase at plan time — informational only per R-316. */
16174
- ivtrPhaseAtPlan: z19.string().optional(),
16481
+ ivtrPhaseAtPlan: z20.string().optional(),
16175
16482
  /** Epic this task rolls up to, locked at plan time per R-303. */
16176
16483
  epicAncestor: NonEmptyString
16177
16484
  });
16178
- var ReleaseGateSchema = z19.object({
16485
+ var ReleaseGateSchema = z20.object({
16179
16486
  /** Canonical gate name. */
16180
16487
  name: GateNameSchema,
16181
16488
  /** ADR-051 atom string identifying the resolved tool (e.g. `tool:test`). */
@@ -16185,11 +16492,11 @@ var ReleaseGateSchema = z19.object({
16185
16492
  /** ISO-8601 timestamp the gate was last verified. */
16186
16493
  lastVerifiedAt: Iso8601,
16187
16494
  /** Resolved shell command (e.g. `pnpm run test`). Optional for unresolved gates. */
16188
- resolvedCommand: z19.string().optional(),
16495
+ resolvedCommand: z20.string().optional(),
16189
16496
  /** Provenance of the resolved command. Optional for unresolved gates. */
16190
16497
  resolvedSource: ResolvedSourceSchema.optional()
16191
16498
  });
16192
- var ReleasePlatformMatrixEntrySchema = z19.object({
16499
+ var ReleasePlatformMatrixEntrySchema = z20.object({
16193
16500
  /** Target platform tuple. */
16194
16501
  platform: PlatformTupleSchema,
16195
16502
  /** Distribution backend. */
@@ -16197,47 +16504,47 @@ var ReleasePlatformMatrixEntrySchema = z19.object({
16197
16504
  /** Package identifier on the target backend (e.g. `@cleocode/cleo`). */
16198
16505
  package: NonEmptyString,
16199
16506
  /** Whether to run the GHA smoke job for this matrix entry. */
16200
- smoke: z19.boolean().default(true).optional()
16507
+ smoke: z20.boolean().default(true).optional()
16201
16508
  });
16202
- var ReleasePreflightSummarySchema = z19.object({
16509
+ var ReleasePreflightSummarySchema = z20.object({
16203
16510
  /** True if esbuild externals are out of sync with package.json. */
16204
- esbuildExternalsDrift: z19.boolean(),
16511
+ esbuildExternalsDrift: z20.boolean(),
16205
16512
  /** True if `pnpm-lock.yaml` diverges from the workspace manifest. */
16206
- lockfileDrift: z19.boolean(),
16513
+ lockfileDrift: z20.boolean(),
16207
16514
  /** True if all epic children are in terminal lifecycle states. */
16208
- epicCompletenessClean: z19.boolean(),
16515
+ epicCompletenessClean: z20.boolean(),
16209
16516
  /** True if no task appears in multiple in-flight release plans. */
16210
- doubleListingClean: z19.boolean(),
16517
+ doubleListingClean: z20.boolean(),
16211
16518
  /** Non-fatal preflight warnings (e.g. unresolved tools per R-024). */
16212
- preflightWarnings: z19.array(z19.string()).default([]).optional()
16519
+ preflightWarnings: z20.array(z20.string()).default([]).optional()
16213
16520
  });
16214
- var ReleasePlanChangelogSchema = z19.object({
16521
+ var ReleasePlanChangelogSchema = z20.object({
16215
16522
  /** `kind=feat` tasks. */
16216
- features: z19.array(NonEmptyString).default([]),
16523
+ features: z20.array(NonEmptyString).default([]),
16217
16524
  /** `kind=fix` or `kind=hotfix` tasks. */
16218
- fixes: z19.array(NonEmptyString).default([]),
16525
+ fixes: z20.array(NonEmptyString).default([]),
16219
16526
  /** `kind=chore`, `docs`, `refactor`, `test`, `perf` tasks. */
16220
- chores: z19.array(NonEmptyString).default([]),
16527
+ chores: z20.array(NonEmptyString).default([]),
16221
16528
  /** `kind=breaking` or `kind=revert` tasks. */
16222
- breaking: z19.array(NonEmptyString).default([])
16529
+ breaking: z20.array(NonEmptyString).default([])
16223
16530
  });
16224
- var ReleasePlanMetaSchema = z19.object({
16531
+ var ReleasePlanMetaSchema = z20.object({
16225
16532
  /** True if this is the project's first ever release. */
16226
- firstEverRelease: z19.boolean().optional(),
16533
+ firstEverRelease: z20.boolean().optional(),
16227
16534
  /** Canonical tool names that could not be resolved at plan time. */
16228
- unresolvedTools: z19.array(z19.string()).optional(),
16535
+ unresolvedTools: z20.array(z20.string()).optional(),
16229
16536
  /** Project archetype detected at plan time. */
16230
- archetype: z19.string().optional()
16231
- }).catchall(z19.unknown());
16232
- var ReleasePlanSchema = z19.object({
16537
+ archetype: z20.string().optional()
16538
+ }).catchall(z20.unknown());
16539
+ var ReleasePlanSchema = z20.object({
16233
16540
  /** Schema URL for this plan version. */
16234
- $schema: z19.string().optional(),
16541
+ $schema: z20.string().optional(),
16235
16542
  /** Requested version string (e.g. "v2026.6.0"). Includes the leading `v`. */
16236
16543
  version: NonEmptyString,
16237
16544
  /** Resolved version string after suffix application (e.g. "v2026.6.0.2"). */
16238
16545
  resolvedVersion: NonEmptyString,
16239
16546
  /** True if a `calver-suffix` was applied to disambiguate a same-day hotfix. */
16240
- suffixApplied: z19.boolean(),
16547
+ suffixApplied: z20.boolean(),
16241
16548
  /** Versioning scheme governing `version` / `resolvedVersion`. */
16242
16549
  scheme: ReleaseSchemeSchema,
16243
16550
  /** npm dist-tag channel for this release. */
@@ -16251,7 +16558,7 @@ var ReleasePlanSchema = z19.object({
16251
16558
  /** Release-kind classification. */
16252
16559
  releaseKind: ReleaseKindSchema,
16253
16560
  /** Explicit hooks-v1 stable promotion; ordinary and hotfix releases are exempt. */
16254
- hooksV1Promotion: z19.boolean().optional(),
16561
+ hooksV1Promotion: z20.boolean().optional(),
16255
16562
  /** Audited reason for shipping a source change that opens the hooks-v1 gate without the promotion (T13555). */
16256
16563
  hooksV1Waiver: NonEmptyString.optional(),
16257
16564
  /** ISO-8601 timestamp the plan was written. */
@@ -16262,27 +16569,27 @@ var ReleasePlanSchema = z19.object({
16262
16569
  * Version of the previous release on the same channel. MUST be `null` only
16263
16570
  * for first-ever releases (R-300, enforced at the verb layer).
16264
16571
  */
16265
- previousVersion: z19.string().nullable(),
16572
+ previousVersion: z20.string().nullable(),
16266
16573
  /** Git tag of the previous release (typically `previousVersion` prefixed). */
16267
- previousTag: z19.string().nullable(),
16574
+ previousTag: z20.string().nullable(),
16268
16575
  /** ISO-8601 timestamp the previous release was published. */
16269
16576
  previousShippedAt: Iso8601.nullable(),
16270
16577
  /** Tasks rolled into this release. */
16271
- tasks: z19.array(ReleasePlanTaskSchema),
16578
+ tasks: z20.array(ReleasePlanTaskSchema),
16272
16579
  /** Bucketed changelog. */
16273
16580
  changelog: ReleasePlanChangelogSchema,
16274
16581
  /** Per-gate verification status. */
16275
- gates: z19.array(ReleaseGateSchema),
16582
+ gates: z20.array(ReleaseGateSchema),
16276
16583
  /** Platform / publisher matrix. */
16277
- platformMatrix: z19.array(ReleasePlatformMatrixEntrySchema),
16584
+ platformMatrix: z20.array(ReleasePlatformMatrixEntrySchema),
16278
16585
  /** Preflight summary from `cleo release plan`. */
16279
16586
  preflightSummary: ReleasePreflightSummarySchema,
16280
16587
  /** URL of the GHA workflow run (populated by `release-prepare.yml`). */
16281
- workflowRunUrl: z19.string().nullable(),
16588
+ workflowRunUrl: z20.string().nullable(),
16282
16589
  /** URL of the bump PR (populated by `cleo release open`). */
16283
- prUrl: z19.string().nullable(),
16590
+ prUrl: z20.string().nullable(),
16284
16591
  /** Merge commit SHA on `main` (populated by `release-publish.yml`). */
16285
- mergeCommitSha: z19.string().nullable(),
16592
+ mergeCommitSha: z20.string().nullable(),
16286
16593
  /** Current FSM state per R-302. */
16287
16594
  status: ReleaseStatusSchema,
16288
16595
  /** Informational / forward-compat metadata. */
@@ -16312,48 +16619,48 @@ var RESOURCE_CLASSES = Object.freeze([
16312
16619
  ]);
16313
16620
 
16314
16621
  // packages/contracts/src/session-journal.ts
16315
- import { z as z20 } from "zod";
16622
+ import { z as z21 } from "zod";
16316
16623
  var SESSION_JOURNAL_SCHEMA_VERSION = "1.0";
16317
- var sessionJournalDoctorSummarySchema = z20.object({
16624
+ var sessionJournalDoctorSummarySchema = z21.object({
16318
16625
  /** `true` when zero noise patterns were detected. */
16319
- isClean: z20.boolean(),
16626
+ isClean: z21.boolean(),
16320
16627
  /** Total number of noise findings across all patterns. */
16321
- findingsCount: z20.number().int().nonnegative(),
16628
+ findingsCount: z21.number().int().nonnegative(),
16322
16629
  /** Pattern names that were detected (empty when isClean). */
16323
- patterns: z20.array(z20.string()),
16630
+ patterns: z21.array(z21.string()),
16324
16631
  /** Total brain entries scanned. `0` = empty or unavailable. */
16325
- totalScanned: z20.number().int().nonnegative()
16632
+ totalScanned: z21.number().int().nonnegative()
16326
16633
  });
16327
- var sessionJournalDebriefSummarySchema = z20.object({
16634
+ var sessionJournalDebriefSummarySchema = z21.object({
16328
16635
  /** First 200 characters of the session end note (if provided). */
16329
- noteExcerpt: z20.string().max(200).optional(),
16636
+ noteExcerpt: z21.string().max(200).optional(),
16330
16637
  /** Number of tasks completed during the session. */
16331
- tasksCompletedCount: z20.number().int().nonnegative(),
16638
+ tasksCompletedCount: z21.number().int().nonnegative(),
16332
16639
  /** Up to 5 task IDs (not titles) that were the focus of the session. */
16333
- tasksFocused: z20.array(z20.string()).max(5).optional()
16640
+ tasksFocused: z21.array(z21.string()).max(5).optional()
16334
16641
  });
16335
- var sessionJournalEntrySchema = z20.object({
16642
+ var sessionJournalEntrySchema = z21.object({
16336
16643
  // Identity
16337
16644
  /** Schema version for forward-compatibility. Always `'1.0'` in this release. */
16338
- schemaVersion: z20.literal(SESSION_JOURNAL_SCHEMA_VERSION),
16645
+ schemaVersion: z21.literal(SESSION_JOURNAL_SCHEMA_VERSION),
16339
16646
  /** ISO 8601 timestamp when the entry was written. */
16340
- timestamp: z20.string(),
16647
+ timestamp: z21.string(),
16341
16648
  /** CLEO session ID (e.g. `ses_20260424055456_ede571`). */
16342
- sessionId: z20.string(),
16649
+ sessionId: z21.string(),
16343
16650
  /** Event type that triggered this journal entry. */
16344
- eventType: z20.enum(["session_start", "session_end", "observation", "decision", "error"]),
16651
+ eventType: z21.enum(["session_start", "session_end", "observation", "decision", "error"]),
16345
16652
  // Session metadata (set on session_start / session_end)
16346
16653
  /** Agent identifier (e.g. `cleo-prime`, `claude-code`). */
16347
- agentIdentifier: z20.string().optional(),
16654
+ agentIdentifier: z21.string().optional(),
16348
16655
  /** Provider adapter ID active for this session. */
16349
- providerId: z20.string().optional(),
16656
+ providerId: z21.string().optional(),
16350
16657
  /** Session scope string (e.g. `'global'` or `'epic:T1263'`). */
16351
- scope: z20.string().optional(),
16658
+ scope: z21.string().optional(),
16352
16659
  // Session-end fields
16353
16660
  /** Duration of the session in seconds (session_end only). */
16354
- duration: z20.number().int().nonnegative().optional(),
16661
+ duration: z21.number().int().nonnegative().optional(),
16355
16662
  /** Task IDs (not titles) completed during the session. */
16356
- tasksCompleted: z20.array(z20.string()).optional(),
16663
+ tasksCompleted: z21.array(z21.string()).optional(),
16357
16664
  // Doctor summary (T1262 absorbed)
16358
16665
  /**
16359
16666
  * Compact result of `scanBrainNoise` run at session-end.
@@ -16368,52 +16675,52 @@ var sessionJournalEntrySchema = z20.object({
16368
16675
  debriefSummary: sessionJournalDebriefSummarySchema.optional(),
16369
16676
  // Optional hash chain
16370
16677
  /** SHA-256 hex of the previous entry's raw JSON string (for integrity chain). */
16371
- prevEntryHash: z20.string().optional()
16678
+ prevEntryHash: z21.string().optional()
16372
16679
  });
16373
16680
 
16374
16681
  // packages/contracts/src/task-evidence.ts
16375
- import { z as z21 } from "zod";
16376
- var fileEvidenceSchema = z21.object({
16377
- kind: z21.literal("file"),
16378
- sha256: z21.string().length(64),
16379
- timestamp: z21.string().datetime(),
16380
- path: z21.string().min(1),
16381
- mime: z21.string().optional(),
16382
- description: z21.string().optional()
16682
+ import { z as z22 } from "zod";
16683
+ var fileEvidenceSchema = z22.object({
16684
+ kind: z22.literal("file"),
16685
+ sha256: z22.string().length(64),
16686
+ timestamp: z22.string().datetime(),
16687
+ path: z22.string().min(1),
16688
+ mime: z22.string().optional(),
16689
+ description: z22.string().optional()
16383
16690
  });
16384
- var logEvidenceSchema = z21.object({
16385
- kind: z21.literal("log"),
16386
- sha256: z21.string().length(64),
16387
- timestamp: z21.string().datetime(),
16388
- source: z21.string().min(1),
16389
- description: z21.string().optional()
16691
+ var logEvidenceSchema = z22.object({
16692
+ kind: z22.literal("log"),
16693
+ sha256: z22.string().length(64),
16694
+ timestamp: z22.string().datetime(),
16695
+ source: z22.string().min(1),
16696
+ description: z22.string().optional()
16390
16697
  });
16391
- var screenshotEvidenceSchema = z21.object({
16392
- kind: z21.literal("screenshot"),
16393
- sha256: z21.string().length(64),
16394
- timestamp: z21.string().datetime(),
16395
- mime: z21.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
16396
- description: z21.string().optional()
16698
+ var screenshotEvidenceSchema = z22.object({
16699
+ kind: z22.literal("screenshot"),
16700
+ sha256: z22.string().length(64),
16701
+ timestamp: z22.string().datetime(),
16702
+ mime: z22.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
16703
+ description: z22.string().optional()
16397
16704
  });
16398
- var testOutputEvidenceSchema = z21.object({
16399
- kind: z21.literal("test-output"),
16400
- sha256: z21.string().length(64),
16401
- timestamp: z21.string().datetime(),
16402
- passed: z21.number().int().nonnegative(),
16403
- failed: z21.number().int().nonnegative(),
16404
- skipped: z21.number().int().nonnegative(),
16405
- exitCode: z21.number().int(),
16406
- description: z21.string().optional()
16705
+ var testOutputEvidenceSchema = z22.object({
16706
+ kind: z22.literal("test-output"),
16707
+ sha256: z22.string().length(64),
16708
+ timestamp: z22.string().datetime(),
16709
+ passed: z22.number().int().nonnegative(),
16710
+ failed: z22.number().int().nonnegative(),
16711
+ skipped: z22.number().int().nonnegative(),
16712
+ exitCode: z22.number().int(),
16713
+ description: z22.string().optional()
16407
16714
  });
16408
- var commandOutputEvidenceSchema = z21.object({
16409
- kind: z21.literal("command-output"),
16410
- sha256: z21.string().length(64),
16411
- timestamp: z21.string().datetime(),
16412
- cmd: z21.string().min(1),
16413
- exitCode: z21.number().int(),
16414
- description: z21.string().optional()
16715
+ var commandOutputEvidenceSchema = z22.object({
16716
+ kind: z22.literal("command-output"),
16717
+ sha256: z22.string().length(64),
16718
+ timestamp: z22.string().datetime(),
16719
+ cmd: z22.string().min(1),
16720
+ exitCode: z22.number().int(),
16721
+ description: z22.string().optional()
16415
16722
  });
16416
- var taskEvidenceSchema = z21.discriminatedUnion("kind", [
16723
+ var taskEvidenceSchema = z22.discriminatedUnion("kind", [
16417
16724
  fileEvidenceSchema,
16418
16725
  logEvidenceSchema,
16419
16726
  screenshotEvidenceSchema,
@@ -16422,8 +16729,8 @@ var taskEvidenceSchema = z21.discriminatedUnion("kind", [
16422
16729
  ]);
16423
16730
 
16424
16731
  // packages/contracts/src/tasks/archive.ts
16425
- import { z as z22 } from "zod";
16426
- var ArchiveReason = z22.enum([
16732
+ import { z as z23 } from "zod";
16733
+ var ArchiveReason = z23.enum([
16427
16734
  "verified",
16428
16735
  "reconciled",
16429
16736
  "superseded",
@@ -16434,42 +16741,42 @@ var ArchiveReason = z22.enum([
16434
16741
  var ARCHIVE_REASON_VALUES = ArchiveReason.options;
16435
16742
 
16436
16743
  // packages/contracts/src/tasks/index.ts
16437
- import { z as z23 } from "zod";
16438
- var taskMutationWarningSeveritySchema = z23.enum(["info", "warning"]);
16439
- var taskMutationWarningSchema = z23.object({
16440
- code: z23.string().min(1),
16441
- message: z23.string().min(1),
16744
+ import { z as z24 } from "zod";
16745
+ var taskMutationWarningSeveritySchema = z24.enum(["info", "warning"]);
16746
+ var taskMutationWarningSchema = z24.object({
16747
+ code: z24.string().min(1),
16748
+ message: z24.string().min(1),
16442
16749
  severity: taskMutationWarningSeveritySchema.optional(),
16443
- taskId: z23.string().min(1).optional(),
16444
- field: z23.string().min(1).optional(),
16445
- index: z23.number().int().nonnegative().optional()
16750
+ taskId: z24.string().min(1).optional(),
16751
+ field: z24.string().min(1).optional(),
16752
+ index: z24.number().int().nonnegative().optional()
16446
16753
  });
16447
- var taskMutationDryRunSummarySchema = z23.object({
16448
- dryRun: z23.literal(true),
16449
- wouldCreate: z23.number().int().nonnegative(),
16450
- wouldUpdate: z23.number().int().nonnegative(),
16451
- wouldDelete: z23.number().int().nonnegative(),
16452
- wouldAffect: z23.number().int().nonnegative(),
16453
- validatedCount: z23.number().int().nonnegative(),
16454
- insertedCount: z23.literal(0),
16455
- updatedCount: z23.literal(0),
16456
- deletedCount: z23.literal(0),
16457
- warnings: z23.array(taskMutationWarningSchema)
16754
+ var taskMutationDryRunSummarySchema = z24.object({
16755
+ dryRun: z24.literal(true),
16756
+ wouldCreate: z24.number().int().nonnegative(),
16757
+ wouldUpdate: z24.number().int().nonnegative(),
16758
+ wouldDelete: z24.number().int().nonnegative(),
16759
+ wouldAffect: z24.number().int().nonnegative(),
16760
+ validatedCount: z24.number().int().nonnegative(),
16761
+ insertedCount: z24.literal(0),
16762
+ updatedCount: z24.literal(0),
16763
+ deletedCount: z24.literal(0),
16764
+ warnings: z24.array(taskMutationWarningSchema)
16458
16765
  });
16459
- var taskMutationTaskRecordSchema = z23.object({ id: z23.string().min(1) }).passthrough();
16460
- var taskMutationEnvelopeSchema = z23.object({
16461
- dryRun: z23.boolean().optional(),
16462
- created: z23.array(taskMutationTaskRecordSchema),
16463
- updated: z23.array(taskMutationTaskRecordSchema),
16464
- deleted: z23.array(taskMutationTaskRecordSchema),
16465
- affectedCount: z23.number().int().nonnegative(),
16466
- mutationWarnings: z23.array(taskMutationWarningSchema),
16766
+ var taskMutationTaskRecordSchema = z24.object({ id: z24.string().min(1) }).passthrough();
16767
+ var taskMutationEnvelopeSchema = z24.object({
16768
+ dryRun: z24.boolean().optional(),
16769
+ created: z24.array(taskMutationTaskRecordSchema),
16770
+ updated: z24.array(taskMutationTaskRecordSchema),
16771
+ deleted: z24.array(taskMutationTaskRecordSchema),
16772
+ affectedCount: z24.number().int().nonnegative(),
16773
+ mutationWarnings: z24.array(taskMutationWarningSchema),
16467
16774
  dryRunSummary: taskMutationDryRunSummarySchema.optional()
16468
16775
  });
16469
- var completionTaskStatusSchema = z23.enum(TASK_STATUSES);
16470
- var completionCriterionKindSchema = z23.enum(["text", "evidence_bound", "child_task"]);
16471
- var completionCriterionStatusSchema = z23.enum(["satisfied", "unsatisfied", "waived", "replaced"]);
16472
- var completionBlockerReasonSchema = z23.enum([
16776
+ var completionTaskStatusSchema = z24.enum(TASK_STATUSES);
16777
+ var completionCriterionKindSchema = z24.enum(["text", "evidence_bound", "child_task"]);
16778
+ var completionCriterionStatusSchema = z24.enum(["satisfied", "unsatisfied", "waived", "replaced"]);
16779
+ var completionBlockerReasonSchema = z24.enum([
16473
16780
  "missing_evidence_binding",
16474
16781
  "child_not_done",
16475
16782
  "child_cancelled_requires_waiver",
@@ -16477,68 +16784,68 @@ var completionBlockerReasonSchema = z23.enum([
16477
16784
  "child_missing",
16478
16785
  "done_parent_stale"
16479
16786
  ]);
16480
- var completionStaleReasonSchema = z23.enum(["done_parent_has_unsatisfied_criteria"]);
16481
- var completionProjectionRepairErrorCodeSchema = z23.enum([
16787
+ var completionStaleReasonSchema = z24.enum(["done_parent_has_unsatisfied_criteria"]);
16788
+ var completionProjectionRepairErrorCodeSchema = z24.enum([
16482
16789
  "projection_not_stale",
16483
16790
  "criteria_missing",
16484
16791
  "binding_target_missing",
16485
16792
  "repair_conflict"
16486
16793
  ]);
16487
- var completionCriterionWaiverSchema = z23.object({
16488
- criterionAcId: z23.string().min(1),
16489
- childTaskId: z23.string().min(1),
16490
- reason: z23.string().min(1),
16491
- actor: z23.string().min(1),
16492
- waivedAt: z23.string().min(1)
16794
+ var completionCriterionWaiverSchema = z24.object({
16795
+ criterionAcId: z24.string().min(1),
16796
+ childTaskId: z24.string().min(1),
16797
+ reason: z24.string().min(1),
16798
+ actor: z24.string().min(1),
16799
+ waivedAt: z24.string().min(1)
16493
16800
  });
16494
- var completionCriterionReplacementSchema = z23.object({
16495
- criterionAcId: z23.string().min(1),
16496
- originalChildTaskId: z23.string().min(1),
16497
- replacementChildTaskId: z23.string().min(1),
16498
- reason: z23.string().min(1),
16499
- actor: z23.string().min(1),
16500
- replacedAt: z23.string().min(1)
16801
+ var completionCriterionReplacementSchema = z24.object({
16802
+ criterionAcId: z24.string().min(1),
16803
+ originalChildTaskId: z24.string().min(1),
16804
+ replacementChildTaskId: z24.string().min(1),
16805
+ reason: z24.string().min(1),
16806
+ actor: z24.string().min(1),
16807
+ replacedAt: z24.string().min(1)
16501
16808
  });
16502
- var completionCriterionEvaluationSchema = z23.object({
16503
- acId: z23.string().min(1),
16504
- alias: z23.string().min(1),
16505
- text: z23.string(),
16809
+ var completionCriterionEvaluationSchema = z24.object({
16810
+ acId: z24.string().min(1),
16811
+ alias: z24.string().min(1),
16812
+ text: z24.string(),
16506
16813
  kind: completionCriterionKindSchema,
16507
16814
  status: completionCriterionStatusSchema,
16508
16815
  reason: completionBlockerReasonSchema.optional(),
16509
- targetTaskId: z23.string().min(1).optional(),
16816
+ targetTaskId: z24.string().min(1).optional(),
16510
16817
  targetTaskStatus: completionTaskStatusSchema.optional(),
16511
16818
  waiver: completionCriterionWaiverSchema.optional(),
16512
16819
  replacement: completionCriterionReplacementSchema.optional(),
16513
16820
  replacementTaskStatus: completionTaskStatusSchema.optional(),
16514
- evidenceBindings: z23.number().int().nonnegative()
16821
+ evidenceBindings: z24.number().int().nonnegative()
16515
16822
  });
16516
16823
  var unsatisfiedCompletionCriterionSchema = completionCriterionEvaluationSchema.extend({
16517
- status: z23.literal("unsatisfied"),
16824
+ status: z24.literal("unsatisfied"),
16518
16825
  reason: completionBlockerReasonSchema
16519
16826
  });
16520
- var completionTotalsSchema = z23.object({
16521
- criteria: z23.number().int().nonnegative(),
16522
- satisfied: z23.number().int().nonnegative(),
16523
- unsatisfied: z23.number().int().nonnegative(),
16524
- waived: z23.number().int().nonnegative(),
16525
- replaced: z23.number().int().nonnegative()
16827
+ var completionTotalsSchema = z24.object({
16828
+ criteria: z24.number().int().nonnegative(),
16829
+ satisfied: z24.number().int().nonnegative(),
16830
+ unsatisfied: z24.number().int().nonnegative(),
16831
+ waived: z24.number().int().nonnegative(),
16832
+ replaced: z24.number().int().nonnegative()
16526
16833
  });
16527
- var completionContextPackSchema = z23.object({
16528
- taskId: z23.string().min(1),
16529
- generatedAt: z23.string().min(1),
16530
- source: z23.literal("audit_log"),
16531
- window: z23.object({
16532
- limit: z23.number().int().positive(),
16533
- since: z23.string().min(1).optional(),
16534
- relationDepth: z23.number().int().nonnegative(),
16535
- relatedTaskIds: z23.array(z23.string().min(1))
16834
+ var completionContextPackSchema = z24.object({
16835
+ taskId: z24.string().min(1),
16836
+ generatedAt: z24.string().min(1),
16837
+ source: z24.literal("audit_log"),
16838
+ window: z24.object({
16839
+ limit: z24.number().int().positive(),
16840
+ since: z24.string().min(1).optional(),
16841
+ relationDepth: z24.number().int().nonnegative(),
16842
+ relatedTaskIds: z24.array(z24.string().min(1))
16536
16843
  }),
16537
- events: z23.array(
16538
- z23.object({
16539
- id: z23.string().min(1),
16540
- timestamp: z23.string().min(1),
16541
- action: z23.enum([
16844
+ events: z24.array(
16845
+ z24.object({
16846
+ id: z24.string().min(1),
16847
+ timestamp: z24.string().min(1),
16848
+ action: z24.enum([
16542
16849
  "task_completed",
16543
16850
  "task_reopened",
16544
16851
  "task_cancelled",
@@ -16546,77 +16853,77 @@ var completionContextPackSchema = z23.object({
16546
16853
  "task_reparented",
16547
16854
  "ac_projection_rebuilt"
16548
16855
  ]),
16549
- taskId: z23.string().min(1),
16550
- relation: z23.enum(["self", "parent", "child", "sibling", "related"]),
16551
- actor: z23.string().min(1),
16552
- details: z23.record(z23.string(), z23.unknown()).optional(),
16553
- before: z23.record(z23.string(), z23.unknown()).optional(),
16554
- after: z23.record(z23.string(), z23.unknown()).optional()
16856
+ taskId: z24.string().min(1),
16857
+ relation: z24.enum(["self", "parent", "child", "sibling", "related"]),
16858
+ actor: z24.string().min(1),
16859
+ details: z24.record(z24.string(), z24.unknown()).optional(),
16860
+ before: z24.record(z24.string(), z24.unknown()).optional(),
16861
+ after: z24.record(z24.string(), z24.unknown()).optional()
16555
16862
  })
16556
16863
  ),
16557
- summary: z23.object({
16558
- totalEvents: z23.number().int().nonnegative(),
16559
- byAction: z23.record(z23.string(), z23.number().int().nonnegative()),
16560
- byRelation: z23.record(z23.string(), z23.number().int().nonnegative()),
16561
- latestEventAt: z23.string().nullable()
16864
+ summary: z24.object({
16865
+ totalEvents: z24.number().int().nonnegative(),
16866
+ byAction: z24.record(z24.string(), z24.number().int().nonnegative()),
16867
+ byRelation: z24.record(z24.string(), z24.number().int().nonnegative()),
16868
+ latestEventAt: z24.string().nullable()
16562
16869
  })
16563
16870
  });
16564
- var completionEvaluationSchema = z23.object({
16565
- taskId: z23.string().min(1),
16871
+ var completionEvaluationSchema = z24.object({
16872
+ taskId: z24.string().min(1),
16566
16873
  taskStatus: completionTaskStatusSchema,
16567
- ready: z23.boolean(),
16568
- stale: z23.boolean(),
16569
- staleReasons: z23.array(completionStaleReasonSchema),
16874
+ ready: z24.boolean(),
16875
+ stale: z24.boolean(),
16876
+ staleReasons: z24.array(completionStaleReasonSchema),
16570
16877
  contextPack: completionContextPackSchema.optional(),
16571
- satisfied: z23.array(completionCriterionEvaluationSchema),
16572
- unsatisfied: z23.array(unsatisfiedCompletionCriterionSchema),
16573
- waived: z23.array(completionCriterionEvaluationSchema),
16574
- replaced: z23.array(completionCriterionEvaluationSchema),
16878
+ satisfied: z24.array(completionCriterionEvaluationSchema),
16879
+ unsatisfied: z24.array(unsatisfiedCompletionCriterionSchema),
16880
+ waived: z24.array(completionCriterionEvaluationSchema),
16881
+ replaced: z24.array(completionCriterionEvaluationSchema),
16575
16882
  totals: completionTotalsSchema
16576
16883
  });
16577
- var completionExplanationSchema = z23.object({
16578
- taskId: z23.string().min(1),
16579
- ready: z23.boolean(),
16580
- stale: z23.boolean(),
16581
- summary: z23.string(),
16884
+ var completionExplanationSchema = z24.object({
16885
+ taskId: z24.string().min(1),
16886
+ ready: z24.boolean(),
16887
+ stale: z24.boolean(),
16888
+ summary: z24.string(),
16582
16889
  contextPack: completionContextPackSchema.optional(),
16583
- blockers: z23.array(completionCriterionEvaluationSchema)
16890
+ blockers: z24.array(completionCriterionEvaluationSchema)
16584
16891
  });
16585
- var completionListParamsSchema = z23.object({
16586
- taskId: z23.string().min(1),
16892
+ var completionListParamsSchema = z24.object({
16893
+ taskId: z24.string().min(1),
16587
16894
  status: completionCriterionStatusSchema.optional(),
16588
16895
  kind: completionCriterionKindSchema.optional()
16589
16896
  });
16590
- var completionListResultSchema = z23.object({
16591
- taskId: z23.string().min(1),
16592
- criteria: z23.array(completionCriterionEvaluationSchema),
16897
+ var completionListResultSchema = z24.object({
16898
+ taskId: z24.string().min(1),
16899
+ criteria: z24.array(completionCriterionEvaluationSchema),
16593
16900
  totals: completionTotalsSchema
16594
16901
  });
16595
- var completionEvaluateParamsSchema = z23.object({
16596
- taskId: z23.string().min(1),
16597
- includeContext: z23.boolean().optional(),
16598
- limit: z23.number().int().positive().optional(),
16599
- since: z23.string().min(1).optional(),
16600
- relationDepth: z23.number().int().nonnegative().optional()
16902
+ var completionEvaluateParamsSchema = z24.object({
16903
+ taskId: z24.string().min(1),
16904
+ includeContext: z24.boolean().optional(),
16905
+ limit: z24.number().int().positive().optional(),
16906
+ since: z24.string().min(1).optional(),
16907
+ relationDepth: z24.number().int().nonnegative().optional()
16601
16908
  });
16602
- var completionProjectionRepairErrorSchema = z23.object({
16909
+ var completionProjectionRepairErrorSchema = z24.object({
16603
16910
  code: completionProjectionRepairErrorCodeSchema,
16604
- message: z23.string().min(1),
16605
- taskId: z23.string().min(1),
16606
- acId: z23.string().min(1).optional(),
16607
- evidenceAtomId: z23.string().min(1).optional()
16911
+ message: z24.string().min(1),
16912
+ taskId: z24.string().min(1),
16913
+ acId: z24.string().min(1).optional(),
16914
+ evidenceAtomId: z24.string().min(1).optional()
16608
16915
  });
16609
- var completionProjectionRepairParamsSchema = z23.object({
16610
- taskId: z23.string().min(1),
16611
- dryRun: z23.boolean().optional()
16916
+ var completionProjectionRepairParamsSchema = z24.object({
16917
+ taskId: z24.string().min(1),
16918
+ dryRun: z24.boolean().optional()
16612
16919
  });
16613
- var completionProjectionRepairResultSchema = z23.object({
16614
- taskId: z23.string().min(1),
16615
- repaired: z23.boolean(),
16616
- dryRun: z23.boolean(),
16617
- staleBefore: z23.boolean(),
16618
- staleAfter: z23.boolean(),
16619
- errors: z23.array(completionProjectionRepairErrorSchema)
16920
+ var completionProjectionRepairResultSchema = z24.object({
16921
+ taskId: z24.string().min(1),
16922
+ repaired: z24.boolean(),
16923
+ dryRun: z24.boolean(),
16924
+ staleBefore: z24.boolean(),
16925
+ staleAfter: z24.boolean(),
16926
+ errors: z24.array(completionProjectionRepairErrorSchema)
16620
16927
  });
16621
16928
 
16622
16929
  // packages/contracts/src/taxonomy.ts
@@ -17119,7 +17426,7 @@ var TaxonomyRegistry = class _TaxonomyRegistry {
17119
17426
  };
17120
17427
 
17121
17428
  // packages/contracts/src/templates/manifest.ts
17122
- import { z as z24 } from "zod";
17429
+ import { z as z25 } from "zod";
17123
17430
  var TEMPLATE_KINDS = ["workflow", "config", "agent", "skill", "provider", "doc"];
17124
17431
  var TEMPLATE_SUBSTITUTIONS = ["regex-tmpl", "static", "json-merge"];
17125
17432
  var TEMPLATE_UPDATE_STRATEGIES = [
@@ -17136,79 +17443,79 @@ var PLACEHOLDER_SOURCES = [
17136
17443
  "tool-resolver",
17137
17444
  "literal"
17138
17445
  ];
17139
- var PlaceholderSpecSchema = z24.object({
17446
+ var PlaceholderSpecSchema = z25.object({
17140
17447
  /**
17141
17448
  * Placeholder identifier as it appears in the template body
17142
17449
  * (e.g. `NODE_VERSION` matches `{{NODE_VERSION}}`).
17143
17450
  */
17144
- name: z24.string().min(1, "placeholder name must be non-empty"),
17451
+ name: z25.string().min(1, "placeholder name must be non-empty"),
17145
17452
  /** Resolver source the installer consults for this placeholder. */
17146
- source: z24.enum(PLACEHOLDER_SOURCES),
17453
+ source: z25.enum(PLACEHOLDER_SOURCES),
17147
17454
  /**
17148
17455
  * Path expression evaluated against `source` (e.g. `engines.node` against
17149
17456
  * `project-context`, `defaults.branchModel` against `.cleo/config`).
17150
17457
  * For `literal` source, this MAY be the literal value's identifier.
17151
17458
  */
17152
- sourcePath: z24.string().min(1, "placeholder sourcePath must be non-empty"),
17459
+ sourcePath: z25.string().min(1, "placeholder sourcePath must be non-empty"),
17153
17460
  /**
17154
17461
  * Fallback value used when `source[sourcePath]` resolves to `undefined`.
17155
17462
  * `null` is permitted to explicitly mark "no default — failure required".
17156
17463
  */
17157
- defaultValue: z24.union([z24.string(), z24.number(), z24.boolean(), z24.null()]).optional()
17464
+ defaultValue: z25.union([z25.string(), z25.number(), z25.boolean(), z25.null()]).optional()
17158
17465
  });
17159
- var TemplateManifestEntrySchema = z24.object({
17466
+ var TemplateManifestEntrySchema = z25.object({
17160
17467
  /** Stable identifier for this template entry. */
17161
- id: z24.string().min(1, "id must be non-empty"),
17468
+ id: z25.string().min(1, "id must be non-empty"),
17162
17469
  /** Category of file this template represents. */
17163
- kind: z24.enum(TEMPLATE_KINDS),
17470
+ kind: z25.enum(TEMPLATE_KINDS),
17164
17471
  /** Repo-relative path of the template source file. */
17165
- sourcePath: z24.string().min(1, "sourcePath must be non-empty"),
17472
+ sourcePath: z25.string().min(1, "sourcePath must be non-empty"),
17166
17473
  /** Project-relative path where the rendered template installs. */
17167
- installPath: z24.string().min(1, "installPath must be non-empty"),
17474
+ installPath: z25.string().min(1, "installPath must be non-empty"),
17168
17475
  /** Substitution strategy the installer applies to `sourcePath`. */
17169
- substitution: z24.enum(TEMPLATE_SUBSTITUTIONS),
17476
+ substitution: z25.enum(TEMPLATE_SUBSTITUTIONS),
17170
17477
  /** Declared placeholders this template requires. May be empty. */
17171
- placeholders: z24.array(PlaceholderSpecSchema),
17478
+ placeholders: z25.array(PlaceholderSpecSchema),
17172
17479
  /** Reconciliation policy on upgrade. */
17173
- updateStrategy: z24.enum(TEMPLATE_UPDATE_STRATEGIES)
17480
+ updateStrategy: z25.enum(TEMPLATE_UPDATE_STRATEGIES)
17174
17481
  });
17175
17482
 
17176
17483
  // packages/contracts/src/validator/index.ts
17177
- import { z as z25 } from "zod";
17484
+ import { z as z26 } from "zod";
17178
17485
  var VALIDATOR_ID_REGEX = /^validator-[a-z0-9][a-z0-9-]*$/;
17179
- var validatorFindingSchema = z25.object({
17180
- acId: z25.string().min(1, "acId must be non-empty"),
17181
- status: z25.enum(["pass", "fail", "inconclusive"]),
17182
- reasoning: z25.string().min(1, "reasoning must be non-empty"),
17183
- evidenceRefs: z25.array(z25.string()).optional(),
17184
- checkedAt: z25.string().min(1, "checkedAt must be a non-empty ISO-8601 string")
17486
+ var validatorFindingSchema = z26.object({
17487
+ acId: z26.string().min(1, "acId must be non-empty"),
17488
+ status: z26.enum(["pass", "fail", "inconclusive"]),
17489
+ reasoning: z26.string().min(1, "reasoning must be non-empty"),
17490
+ evidenceRefs: z26.array(z26.string()).optional(),
17491
+ checkedAt: z26.string().min(1, "checkedAt must be a non-empty ISO-8601 string")
17185
17492
  });
17186
- var validatorAttestationSchema = z25.object({
17187
- verdict: z25.literal("attest"),
17188
- taskId: z25.string().min(1),
17189
- validatorId: z25.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
17190
- findings: z25.array(validatorFindingSchema).min(1, "attestation must contain at least one finding").refine(
17493
+ var validatorAttestationSchema = z26.object({
17494
+ verdict: z26.literal("attest"),
17495
+ taskId: z26.string().min(1),
17496
+ validatorId: z26.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
17497
+ findings: z26.array(validatorFindingSchema).min(1, "attestation must contain at least one finding").refine(
17191
17498
  (findings) => findings.every((f) => f.status === "pass"),
17192
17499
  'attestation requires every finding to have status="pass"'
17193
17500
  ),
17194
- summary: z25.string().optional(),
17195
- attestedAt: z25.string().min(1),
17196
- schemaVersion: z25.literal("1")
17501
+ summary: z26.string().optional(),
17502
+ attestedAt: z26.string().min(1),
17503
+ schemaVersion: z26.literal("1")
17197
17504
  });
17198
- var validatorRejectionSchema = z25.object({
17199
- verdict: z25.literal("reject"),
17200
- taskId: z25.string().min(1),
17201
- validatorId: z25.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
17202
- findings: z25.array(validatorFindingSchema).min(1, "rejection must contain at least one finding").refine(
17505
+ var validatorRejectionSchema = z26.object({
17506
+ verdict: z26.literal("reject"),
17507
+ taskId: z26.string().min(1),
17508
+ validatorId: z26.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
17509
+ findings: z26.array(validatorFindingSchema).min(1, "rejection must contain at least one finding").refine(
17203
17510
  (findings) => findings.some((f) => f.status !== "pass"),
17204
17511
  'rejection requires at least one finding with status "fail" or "inconclusive"'
17205
17512
  ),
17206
- summary: z25.string().min(1, "rejection summary must be non-empty"),
17207
- remediationHints: z25.array(z25.string()).optional(),
17208
- rejectedAt: z25.string().min(1),
17209
- schemaVersion: z25.literal("1")
17513
+ summary: z26.string().min(1, "rejection summary must be non-empty"),
17514
+ remediationHints: z26.array(z26.string()).optional(),
17515
+ rejectedAt: z26.string().min(1),
17516
+ schemaVersion: z26.literal("1")
17210
17517
  });
17211
- var validatorVerdictSchema = z25.discriminatedUnion("verdict", [
17518
+ var validatorVerdictSchema = z26.discriminatedUnion("verdict", [
17212
17519
  validatorAttestationSchema,
17213
17520
  validatorRejectionSchema
17214
17521
  ]);
@@ -17958,7 +18265,7 @@ var CAAMP_DAMAGED_START_PATTERN_SOURCE = damagedMarkerSource("START");
17958
18265
  var CAAMP_DAMAGED_END_PATTERN_SOURCE = damagedMarkerSource("END");
17959
18266
 
17960
18267
  // packages/contracts/src/decide.ts
17961
- import { z as z26 } from "zod";
18268
+ import { z as z27 } from "zod";
17962
18269
  var DECISION_QUESTION_TYPES = ["noul", "choice", "score"];
17963
18270
  var DECISION_OUTCOME_SOURCES = ["provider", "cache", "fallback"];
17964
18271
  var DECISION_REQUEST_LIMITS = {
@@ -17980,11 +18287,11 @@ var DECISION_REQUEST_LIMITS = {
17980
18287
  maxScoreLevels: 10
17981
18288
  };
17982
18289
  var DECISION_PROVIDER_KINDS = ["layahost", "jev"];
17983
- var decisionQuestionTypeSchema = z26.enum(DECISION_QUESTION_TYPES);
17984
- var decisionOutcomeSourceSchema = z26.enum(DECISION_OUTCOME_SOURCES);
17985
- var decisionInstructionsSchema = z26.union([z26.string(), z26.record(z26.string(), z26.json())]);
17986
- var unitIntervalSchema = z26.number().min(0).max(1);
17987
- var decisionStateSchema = z26.union([z26.string(), z26.array(z26.json()), z26.record(z26.string(), z26.json())]).superRefine((state, context) => {
18290
+ var decisionQuestionTypeSchema = z27.enum(DECISION_QUESTION_TYPES);
18291
+ var decisionOutcomeSourceSchema = z27.enum(DECISION_OUTCOME_SOURCES);
18292
+ var decisionInstructionsSchema = z27.union([z27.string(), z27.record(z27.string(), z27.json())]);
18293
+ var unitIntervalSchema = z27.number().min(0).max(1);
18294
+ var decisionStateSchema = z27.union([z27.string(), z27.array(z27.json()), z27.record(z27.string(), z27.json())]).superRefine((state, context) => {
17988
18295
  const size = typeof state === "string" ? state.length : JSON.stringify(state).length;
17989
18296
  if (size > DECISION_REQUEST_LIMITS.maxStateChars) {
17990
18297
  context.addIssue({
@@ -17993,34 +18300,34 @@ var decisionStateSchema = z26.union([z26.string(), z26.array(z26.json()), z26.re
17993
18300
  });
17994
18301
  }
17995
18302
  });
17996
- var noulDecisionQuestionSchema = z26.object({
17997
- type: z26.literal("noul"),
18303
+ var noulDecisionQuestionSchema = z27.object({
18304
+ type: z27.literal("noul"),
17998
18305
  instructions: decisionInstructionsSchema.optional(),
17999
- criteria: z26.string().min(1)
18306
+ criteria: z27.string().min(1)
18000
18307
  });
18001
- var choiceDecisionQuestionSchema = z26.object({
18002
- type: z26.literal("choice"),
18308
+ var choiceDecisionQuestionSchema = z27.object({
18309
+ type: z27.literal("choice"),
18003
18310
  instructions: decisionInstructionsSchema.optional(),
18004
- criteria: z26.record(z26.string().min(1), z26.string()).refine((options) => Object.keys(options).length >= DECISION_REQUEST_LIMITS.minChoiceOptions, {
18311
+ criteria: z27.record(z27.string().min(1), z27.string()).refine((options) => Object.keys(options).length >= DECISION_REQUEST_LIMITS.minChoiceOptions, {
18005
18312
  message: `a choice question needs at least ${DECISION_REQUEST_LIMITS.minChoiceOptions} options`
18006
18313
  })
18007
18314
  });
18008
- var scoreDecisionQuestionSchema = z26.object({
18009
- type: z26.literal("score"),
18315
+ var scoreDecisionQuestionSchema = z27.object({
18316
+ type: z27.literal("score"),
18010
18317
  instructions: decisionInstructionsSchema.optional(),
18011
- criteria: z26.array(z26.string()).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels)
18318
+ criteria: z27.array(z27.string()).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels)
18012
18319
  });
18013
- var decisionQuestionSchema = z26.discriminatedUnion("type", [
18320
+ var decisionQuestionSchema = z27.discriminatedUnion("type", [
18014
18321
  noulDecisionQuestionSchema,
18015
18322
  choiceDecisionQuestionSchema,
18016
18323
  scoreDecisionQuestionSchema
18017
18324
  ]);
18018
- var decisionRequestSchema = z26.object({
18019
- model: z26.string().min(1).optional(),
18020
- lang: z26.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$/).optional(),
18021
- cache: z26.boolean().optional(),
18325
+ var decisionRequestSchema = z27.object({
18326
+ model: z27.string().min(1).optional(),
18327
+ lang: z27.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$/).optional(),
18328
+ cache: z27.boolean().optional(),
18022
18329
  state: decisionStateSchema,
18023
- questions: z26.record(z26.string().min(1), decisionQuestionSchema).refine(
18330
+ questions: z27.record(z27.string().min(1), decisionQuestionSchema).refine(
18024
18331
  (questions) => {
18025
18332
  const count = Object.keys(questions).length;
18026
18333
  return count >= DECISION_REQUEST_LIMITS.minQuestions && count <= DECISION_REQUEST_LIMITS.maxQuestions;
@@ -18030,139 +18337,139 @@ var decisionRequestSchema = z26.object({
18030
18337
  }
18031
18338
  )
18032
18339
  });
18033
- var noulDecisionAnswerSchema = z26.object({
18034
- type: z26.literal("noul"),
18035
- value: z26.boolean(),
18340
+ var noulDecisionAnswerSchema = z27.object({
18341
+ type: z27.literal("noul"),
18342
+ value: z27.boolean(),
18036
18343
  probability: unitIntervalSchema,
18037
18344
  confidence: unitIntervalSchema
18038
18345
  });
18039
- var choiceDecisionAnswerSchema = z26.object({
18040
- type: z26.literal("choice"),
18041
- value: z26.string().min(1),
18042
- probabilities: z26.record(z26.string().min(1), unitIntervalSchema),
18346
+ var choiceDecisionAnswerSchema = z27.object({
18347
+ type: z27.literal("choice"),
18348
+ value: z27.string().min(1),
18349
+ probabilities: z27.record(z27.string().min(1), unitIntervalSchema),
18043
18350
  confidence: unitIntervalSchema
18044
18351
  });
18045
- var scoreDecisionAnswerSchema = z26.object({
18046
- type: z26.literal("score"),
18047
- value: z26.number().int().nonnegative(),
18048
- probabilities: z26.array(unitIntervalSchema).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels),
18352
+ var scoreDecisionAnswerSchema = z27.object({
18353
+ type: z27.literal("score"),
18354
+ value: z27.number().int().nonnegative(),
18355
+ probabilities: z27.array(unitIntervalSchema).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels),
18049
18356
  confidence: unitIntervalSchema
18050
18357
  });
18051
- var decisionAnswerSchema = z26.discriminatedUnion("type", [
18358
+ var decisionAnswerSchema = z27.discriminatedUnion("type", [
18052
18359
  noulDecisionAnswerSchema,
18053
18360
  choiceDecisionAnswerSchema,
18054
18361
  scoreDecisionAnswerSchema
18055
18362
  ]);
18056
- var decisionOutcomeSchema = z26.object({
18057
- answers: z26.record(z26.string().min(1), decisionAnswerSchema),
18363
+ var decisionOutcomeSchema = z27.object({
18364
+ answers: z27.record(z27.string().min(1), decisionAnswerSchema),
18058
18365
  source: decisionOutcomeSourceSchema,
18059
- requestId: z26.string().min(1).optional(),
18060
- latencyMs: z26.number().nonnegative(),
18061
- costUsd: z26.number().nonnegative().optional(),
18062
- costMicros: z26.number().int().nonnegative().optional(),
18063
- balanceMicros: z26.number().int().optional(),
18064
- checkpoint: z26.string().min(1).optional(),
18065
- inputTokens: z26.number().int().nonnegative().optional()
18366
+ requestId: z27.string().min(1).optional(),
18367
+ latencyMs: z27.number().nonnegative(),
18368
+ costUsd: z27.number().nonnegative().optional(),
18369
+ costMicros: z27.number().int().nonnegative().optional(),
18370
+ balanceMicros: z27.number().int().optional(),
18371
+ checkpoint: z27.string().min(1).optional(),
18372
+ inputTokens: z27.number().int().nonnegative().optional()
18066
18373
  });
18067
- var decisionProviderKindSchema = z26.enum(DECISION_PROVIDER_KINDS);
18068
- var decisionProviderConfigSchema = z26.object({
18069
- baseUrl: z26.url(),
18374
+ var decisionProviderKindSchema = z27.enum(DECISION_PROVIDER_KINDS);
18375
+ var decisionProviderConfigSchema = z27.object({
18376
+ baseUrl: z27.url(),
18070
18377
  provider: decisionProviderKindSchema.optional()
18071
18378
  });
18072
18379
 
18073
18380
  // packages/contracts/src/nexus-account.ts
18074
- import { z as z27 } from "zod";
18075
- var nexusAccountUserSchema = z27.object({
18076
- id: z27.string(),
18077
- email: z27.string(),
18078
- name: z27.string().nullable().optional()
18381
+ import { z as z28 } from "zod";
18382
+ var nexusAccountUserSchema = z28.object({
18383
+ id: z28.string(),
18384
+ email: z28.string(),
18385
+ name: z28.string().nullable().optional()
18079
18386
  });
18080
- var nexusAccountOrganizationSchema = z27.object({
18081
- id: z27.string(),
18082
- name: z27.string(),
18083
- slug: z27.string().nullable().optional(),
18084
- role: z27.string().optional(),
18387
+ var nexusAccountOrganizationSchema = z28.object({
18388
+ id: z28.string(),
18389
+ name: z28.string(),
18390
+ slug: z28.string().nullable().optional(),
18391
+ role: z28.string().optional(),
18085
18392
  /** `true` for the personal organization created at sign-up. */
18086
- personal: z27.boolean().optional()
18393
+ personal: z28.boolean().optional()
18087
18394
  });
18088
- var nexusAccountMeSchema = z27.object({
18395
+ var nexusAccountMeSchema = z28.object({
18089
18396
  user: nexusAccountUserSchema,
18090
- organizations: z27.array(nexusAccountOrganizationSchema).default([])
18397
+ organizations: z28.array(nexusAccountOrganizationSchema).default([])
18091
18398
  });
18092
18399
 
18093
18400
  // packages/contracts/src/nexus-cloud.ts
18094
- import { z as z28 } from "zod";
18401
+ import { z as z29 } from "zod";
18095
18402
  var NEXUS_DEVICE_STATES = ["active", "signed-out", "revoked"];
18096
18403
  var NEXUS_CLOUD_PROFILES = ["device", "read-only"];
18097
18404
  var NEXUS_DEVICE_STATE_UNKNOWN = "unknown";
18098
- var isoTime = z28.iso.datetime({ offset: true });
18099
- var profile = z28.enum(NEXUS_CLOUD_PROFILES).nullable().catch(null);
18100
- var deviceState = z28.enum([...NEXUS_DEVICE_STATES, NEXUS_DEVICE_STATE_UNKNOWN]).catch(NEXUS_DEVICE_STATE_UNKNOWN);
18101
- var nexusCloudCredentialSchema = z28.object({
18102
- kind: z28.enum(["device", "session"]),
18103
- credentialId: z28.string().nullable().optional(),
18405
+ var isoTime = z29.iso.datetime({ offset: true });
18406
+ var profile = z29.enum(NEXUS_CLOUD_PROFILES).nullable().catch(null);
18407
+ var deviceState = z29.enum([...NEXUS_DEVICE_STATES, NEXUS_DEVICE_STATE_UNKNOWN]).catch(NEXUS_DEVICE_STATE_UNKNOWN);
18408
+ var nexusCloudCredentialSchema = z29.object({
18409
+ kind: z29.enum(["device", "session"]),
18410
+ credentialId: z29.string().nullable().optional(),
18104
18411
  profile: profile.optional(),
18105
- scopes: z28.array(z28.string()).default([]),
18412
+ scopes: z29.array(z29.string()).default([]),
18106
18413
  createdAt: isoTime.nullable().optional(),
18107
18414
  lastUsedAt: isoTime.nullable().optional(),
18108
18415
  /** When the credential expires if it is not used again; null for sessions. */
18109
18416
  idleExpiresAt: isoTime.nullable().optional()
18110
18417
  });
18111
- var nexusCloudDeviceSchema = z28.object({
18112
- deviceId: z28.string(),
18113
- name: z28.string(),
18114
- platform: z28.string().optional(),
18115
- arch: z28.string().nullable().optional(),
18116
- cliVersion: z28.string().nullable().optional(),
18418
+ var nexusCloudDeviceSchema = z29.object({
18419
+ deviceId: z29.string(),
18420
+ name: z29.string(),
18421
+ platform: z29.string().optional(),
18422
+ arch: z29.string().nullable().optional(),
18423
+ cliVersion: z29.string().nullable().optional(),
18117
18424
  createdAt: isoTime.optional(),
18118
18425
  lastSeenAt: isoTime.nullable().optional(),
18119
18426
  state: deviceState,
18120
18427
  signedOutAt: isoTime.nullable().optional(),
18121
18428
  /** Base64 device certificate; null until the device holds a key grant. */
18122
- certificate: z28.string().nullable().optional(),
18429
+ certificate: z29.string().nullable().optional(),
18123
18430
  /** The current credential's profile, or null with none (signed out or revoked). */
18124
18431
  profile: profile.optional(),
18125
18432
  /** True for the device whose credential made this request. */
18126
- current: z28.boolean().default(false),
18127
- projects: z28.number().int().nonnegative().optional(),
18128
- replicas: z28.number().int().nonnegative().optional(),
18433
+ current: z29.boolean().default(false),
18434
+ projects: z29.number().int().nonnegative().optional(),
18435
+ replicas: z29.number().int().nonnegative().optional(),
18129
18436
  lastSyncAt: isoTime.nullable().optional(),
18130
18437
  lastPresenceAt: isoTime.nullable().optional()
18131
18438
  });
18132
- var nexusCloudOrganizationSchema = z28.object({
18133
- id: z28.string(),
18134
- name: z28.string(),
18135
- slug: z28.string().nullable().optional(),
18136
- role: z28.string().optional(),
18137
- personal: z28.boolean().optional()
18439
+ var nexusCloudOrganizationSchema = z29.object({
18440
+ id: z29.string(),
18441
+ name: z29.string(),
18442
+ slug: z29.string().nullable().optional(),
18443
+ role: z29.string().optional(),
18444
+ personal: z29.boolean().optional()
18138
18445
  });
18139
- var nexusCloudUserSchema = z28.object({
18140
- id: z28.string(),
18141
- email: z28.string(),
18142
- name: z28.string().nullable().optional()
18446
+ var nexusCloudUserSchema = z29.object({
18447
+ id: z29.string(),
18448
+ email: z29.string(),
18449
+ name: z29.string().nullable().optional()
18143
18450
  });
18144
- var nexusCloudWhoamiSchema = z28.object({
18451
+ var nexusCloudWhoamiSchema = z29.object({
18145
18452
  serverTime: isoTime.optional(),
18146
18453
  user: nexusCloudUserSchema,
18147
- organizations: z28.array(nexusCloudOrganizationSchema).default([]),
18454
+ organizations: z29.array(nexusCloudOrganizationSchema).default([]),
18148
18455
  credential: nexusCloudCredentialSchema,
18149
18456
  /** The calling device; null for a session caller. */
18150
18457
  device: nexusCloudDeviceSchema.nullable()
18151
18458
  });
18152
- var nexusCloudDevicePageSchema = z28.object({
18153
- devices: z28.array(nexusCloudDeviceSchema),
18154
- nextCursor: z28.string().max(512).nullable().default(null),
18155
- truncated: z28.boolean().default(false)
18459
+ var nexusCloudDevicePageSchema = z29.object({
18460
+ devices: z29.array(nexusCloudDeviceSchema),
18461
+ nextCursor: z29.string().max(512).nullable().default(null),
18462
+ truncated: z29.boolean().default(false)
18156
18463
  });
18157
- var nexusCloudPresenceSchema = z28.looseObject({
18464
+ var nexusCloudPresenceSchema = z29.looseObject({
18158
18465
  observedAt: isoTime.optional(),
18159
- sync: z28.object({ enabled: z28.boolean() }).optional()
18466
+ sync: z29.object({ enabled: z29.boolean() }).optional()
18160
18467
  });
18161
- var nexusCloudReplicaSchema = z28.object({
18162
- projectId: z28.string(),
18163
- replicaId: z28.string(),
18164
- deviceId: z28.string(),
18165
- deviceName: z28.string(),
18468
+ var nexusCloudReplicaSchema = z29.object({
18469
+ projectId: z29.string(),
18470
+ replicaId: z29.string(),
18471
+ deviceId: z29.string(),
18472
+ deviceName: z29.string(),
18166
18473
  deviceState: deviceState.optional(),
18167
18474
  attachedAt: isoTime.optional(),
18168
18475
  lastSyncAt: isoTime.nullable(),
@@ -18171,72 +18478,72 @@ var nexusCloudReplicaSchema = z28.object({
18171
18478
  /** When the replica was retired (cleo-nexus T123), else null. Absent from servers older than retirement. */
18172
18479
  retiredAt: isoTime.nullable().optional(),
18173
18480
  /** The retired replica's named successor, else null (not retired, or retired with none). */
18174
- successor: z28.string().nullable().optional()
18481
+ successor: z29.string().nullable().optional()
18175
18482
  });
18176
- var nexusCloudDeviceCountsSchema = z28.object({
18177
- active: z28.number().int().nonnegative(),
18178
- total: z28.number().int().nonnegative()
18483
+ var nexusCloudDeviceCountsSchema = z29.object({
18484
+ active: z29.number().int().nonnegative(),
18485
+ total: z29.number().int().nonnegative()
18179
18486
  });
18180
18487
  var projectFields = {
18181
- projectId: z28.string(),
18182
- label: z28.string().nullable(),
18183
- organizationId: z28.string(),
18184
- organizationName: z28.string().optional(),
18185
- remoteUrl: z28.string().nullable().optional(),
18488
+ projectId: z29.string(),
18489
+ label: z29.string().nullable(),
18490
+ organizationId: z29.string(),
18491
+ organizationName: z29.string().optional(),
18492
+ remoteUrl: z29.string().nullable().optional(),
18186
18493
  createdAt: isoTime.optional()
18187
18494
  };
18188
- var nexusCloudProjectListItemSchema = z28.object({
18495
+ var nexusCloudProjectListItemSchema = z29.object({
18189
18496
  ...projectFields,
18190
- role: z28.string(),
18497
+ role: z29.string(),
18191
18498
  /**
18192
18499
  * The project name sealed with the project data key (`Project.encryptedName`), base64;
18193
18500
  * only a holder of the account key can open it (T13102).
18194
18501
  */
18195
- encryptedName: z28.string().nullable().optional(),
18196
- streamId: z28.string().optional(),
18197
- headSeq: z28.number().int().nonnegative().nullable().optional(),
18502
+ encryptedName: z29.string().nullable().optional(),
18503
+ streamId: z29.string().optional(),
18504
+ headSeq: z29.number().int().nonnegative().nullable().optional(),
18198
18505
  /** The stream's head snapshot; null when nothing was ever pushed (T13102: restorable or not). */
18199
- headCheckpointId: z28.string().nullable().optional(),
18200
- openConflicts: z28.number().int().nonnegative().optional(),
18201
- replicas: z28.array(nexusCloudReplicaSchema).default([]),
18506
+ headCheckpointId: z29.string().nullable().optional(),
18507
+ openConflicts: z29.number().int().nonnegative().optional(),
18508
+ replicas: z29.array(nexusCloudReplicaSchema).default([]),
18202
18509
  devices: nexusCloudDeviceCountsSchema.optional(),
18203
- replicaCount: z28.number().int().nonnegative().optional(),
18510
+ replicaCount: z29.number().int().nonnegative().optional(),
18204
18511
  lastSyncAt: isoTime.nullable().optional(),
18205
18512
  lastPresenceAt: isoTime.nullable().optional(),
18206
18513
  /** This project's replica list was cut at 50 (T12858). */
18207
- replicasTruncated: z28.boolean().default(false)
18514
+ replicasTruncated: z29.boolean().default(false)
18208
18515
  });
18209
- var nexusCloudProjectPageSchema = z28.object({
18210
- projects: z28.array(nexusCloudProjectListItemSchema),
18211
- nextCursor: z28.string().max(512).nullable().default(null),
18516
+ var nexusCloudProjectPageSchema = z29.object({
18517
+ projects: z29.array(nexusCloudProjectListItemSchema),
18518
+ nextCursor: z29.string().max(512).nullable().default(null),
18212
18519
  /** Anything in the page was cut (the project list or a replica list). */
18213
- truncated: z28.boolean().default(false),
18520
+ truncated: z29.boolean().default(false),
18214
18521
  /** The project list itself was cut at 1000 (T12858). */
18215
- projectsTruncated: z28.boolean().default(false)
18522
+ projectsTruncated: z29.boolean().default(false)
18216
18523
  });
18217
- var nexusCloudProjectDetailSchema = z28.object({
18218
- project: z28.object({ ...projectFields, deletedAt: isoTime.nullable().optional() }),
18219
- role: z28.string(),
18220
- canTrash: z28.boolean().optional(),
18221
- openConflicts: z28.number().int().nonnegative(),
18524
+ var nexusCloudProjectDetailSchema = z29.object({
18525
+ project: z29.object({ ...projectFields, deletedAt: isoTime.nullable().optional() }),
18526
+ role: z29.string(),
18527
+ canTrash: z29.boolean().optional(),
18528
+ openConflicts: z29.number().int().nonnegative(),
18222
18529
  /** At most 50, oldest attachment first. */
18223
- replicas: z28.array(nexusCloudReplicaSchema),
18530
+ replicas: z29.array(nexusCloudReplicaSchema),
18224
18531
  devices: nexusCloudDeviceCountsSchema,
18225
- replicaCount: z28.number().int().nonnegative().optional(),
18532
+ replicaCount: z29.number().int().nonnegative().optional(),
18226
18533
  lastSyncAt: isoTime.nullable().optional(),
18227
18534
  /** `replicas` was cut at 50. */
18228
- truncated: z28.boolean().default(false),
18229
- stream: z28.object({
18230
- streamId: z28.string(),
18231
- headSeq: z28.number().int().nonnegative(),
18232
- headCheckpointId: z28.string().nullable()
18535
+ truncated: z29.boolean().default(false),
18536
+ stream: z29.object({
18537
+ streamId: z29.string(),
18538
+ headSeq: z29.number().int().nonnegative(),
18539
+ headCheckpointId: z29.string().nullable()
18233
18540
  }).nullable()
18234
18541
  });
18235
- var nexusCloudReplicaPageSchema = z28.object({
18236
- replicas: z28.array(nexusCloudReplicaSchema),
18542
+ var nexusCloudReplicaPageSchema = z29.object({
18543
+ replicas: z29.array(nexusCloudReplicaSchema),
18237
18544
  devices: nexusCloudDeviceCountsSchema.optional(),
18238
- nextCursor: z28.string().max(512).nullable().default(null),
18239
- truncated: z28.boolean().default(false)
18545
+ nextCursor: z29.string().max(512).nullable().default(null),
18546
+ truncated: z29.boolean().default(false)
18240
18547
  });
18241
18548
  var NEXUS_STATUS_CHECK_IDS = [
18242
18549
  "credential.valid",
@@ -18252,56 +18559,56 @@ var NEXUS_STATUS_CHECK_IDS = [
18252
18559
  ];
18253
18560
  var NEXUS_STATUS_VERDICTS = ["ok", "attention", "not-linked", "not-registered"];
18254
18561
  var CLOUD_STATUS_VERDICTS = [...NEXUS_STATUS_VERDICTS, "not-signed-in"];
18255
- var knownCheckId = z28.enum(NEXUS_STATUS_CHECK_IDS);
18256
- var nexusCloudStatusCheckSchema = z28.object({
18257
- id: z28.enum(NEXUS_STATUS_CHECK_IDS),
18258
- ok: z28.boolean(),
18259
- required: z28.boolean(),
18260
- detail: z28.string()
18562
+ var knownCheckId = z29.enum(NEXUS_STATUS_CHECK_IDS);
18563
+ var nexusCloudStatusCheckSchema = z29.object({
18564
+ id: z29.enum(NEXUS_STATUS_CHECK_IDS),
18565
+ ok: z29.boolean(),
18566
+ required: z29.boolean(),
18567
+ detail: z29.string()
18261
18568
  });
18262
- var nexusCloudStatusSchema = z28.object({
18569
+ var nexusCloudStatusSchema = z29.object({
18263
18570
  serverTime: isoTime.optional(),
18264
- apiVersion: z28.string().optional(),
18571
+ apiVersion: z29.string().optional(),
18265
18572
  /**
18266
18573
  * Optional server features (e.g. {@link NEXUS_FEATURE_PROJECT_INITIAL_KEY}). Absent from servers older
18267
18574
  * than the list, which therefore support none of them.
18268
18575
  */
18269
- features: z28.array(z28.string()).optional(),
18576
+ features: z29.array(z29.string()).optional(),
18270
18577
  user: nexusCloudUserSchema,
18271
18578
  credential: nexusCloudCredentialSchema,
18272
18579
  device: nexusCloudDeviceSchema.nullable(),
18273
- project: z28.object({
18274
- projectId: z28.string(),
18275
- registered: z28.boolean(),
18276
- organizationId: z28.string().nullable(),
18277
- organizationName: z28.string().nullable(),
18278
- role: z28.string().nullable()
18580
+ project: z29.object({
18581
+ projectId: z29.string(),
18582
+ registered: z29.boolean(),
18583
+ organizationId: z29.string().nullable(),
18584
+ organizationName: z29.string().nullable(),
18585
+ role: z29.string().nullable()
18279
18586
  }).nullable(),
18280
- replica: z28.object({
18281
- replicaId: z28.string(),
18282
- attached: z28.boolean(),
18283
- attachedElsewhere: z28.boolean(),
18587
+ replica: z29.object({
18588
+ replicaId: z29.string(),
18589
+ attached: z29.boolean(),
18590
+ attachedElsewhere: z29.boolean(),
18284
18591
  attachedAt: isoTime.nullable(),
18285
18592
  lastSyncAt: isoTime.nullable(),
18286
18593
  presenceAt: isoTime.nullable(),
18287
- lastReplicaSeq: z28.number().int().nonnegative().nullable().optional()
18594
+ lastReplicaSeq: z29.number().int().nonnegative().nullable().optional()
18288
18595
  }).nullable(),
18289
- stream: z28.object({
18290
- streamId: z28.string(),
18291
- headSeq: z28.number().int().nonnegative(),
18292
- headCheckpointId: z28.string().nullable(),
18293
- openConflicts: z28.number().int().nonnegative(),
18596
+ stream: z29.object({
18597
+ streamId: z29.string(),
18598
+ headSeq: z29.number().int().nonnegative(),
18599
+ headCheckpointId: z29.string().nullable(),
18600
+ openConflicts: z29.number().int().nonnegative(),
18294
18601
  devices: nexusCloudDeviceCountsSchema
18295
18602
  }).nullable(),
18296
18603
  /** Check ids added by a newer server are dropped, never a parse failure. */
18297
- checks: z28.array(nexusCloudStatusCheckSchema.extend({ id: z28.string() })).transform(
18604
+ checks: z29.array(nexusCloudStatusCheckSchema.extend({ id: z29.string() })).transform(
18298
18605
  (list) => list.flatMap((c) => {
18299
18606
  const id = knownCheckId.safeParse(c.id);
18300
18607
  return id.success ? [{ ...c, id: id.data }] : [];
18301
18608
  })
18302
18609
  ),
18303
18610
  /** A verdict added by a newer server reads as `attention`: never `ok` by accident. */
18304
- verdict: z28.enum(NEXUS_STATUS_VERDICTS).catch("attention")
18611
+ verdict: z29.enum(NEXUS_STATUS_VERDICTS).catch("attention")
18305
18612
  });
18306
18613
  var LOGIN = "run `cleo login nexus`";
18307
18614
  var SESSION_EXPIRED_LOGIN = {
@@ -18346,50 +18653,50 @@ var NEXUS_FORBIDDEN_ERRORS = {
18346
18653
  };
18347
18654
 
18348
18655
  // packages/contracts/src/nexus-vault.ts
18349
- import { z as z29 } from "zod";
18350
- var isoTime2 = z29.iso.datetime({ offset: true });
18351
- var uuid = z29.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i);
18352
- var nexusUserKeysSchema = z29.looseObject({
18353
- keyVersion: z29.number().int().positive(),
18354
- masterKeyVerifier: z29.string()
18656
+ import { z as z30 } from "zod";
18657
+ var isoTime2 = z30.iso.datetime({ offset: true });
18658
+ var uuid = z30.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i);
18659
+ var nexusUserKeysSchema = z30.looseObject({
18660
+ keyVersion: z30.number().int().positive(),
18661
+ masterKeyVerifier: z30.string()
18355
18662
  });
18356
- var nexusProjectKeysSchema = z29.looseObject({
18357
- keys: z29.array(
18358
- z29.looseObject({ wrappedProjectKey: z29.string(), keyVersion: z29.number().int().positive() })
18663
+ var nexusProjectKeysSchema = z30.looseObject({
18664
+ keys: z30.array(
18665
+ z30.looseObject({ wrappedProjectKey: z30.string(), keyVersion: z30.number().int().positive() })
18359
18666
  )
18360
18667
  });
18361
- var nexusLeaseSchema = z29.looseObject({
18362
- streamId: z29.string(),
18363
- role: z29.string(),
18668
+ var nexusLeaseSchema = z30.looseObject({
18669
+ streamId: z30.string(),
18670
+ role: z30.string(),
18364
18671
  replicaId: uuid,
18365
18672
  expiresAt: isoTime2,
18366
18673
  forkedFromReplicaId: uuid.nullable().optional()
18367
18674
  });
18368
- var nexusLeaseAcquireSchema = z29.looseObject({ lease: nexusLeaseSchema });
18369
- var nexusStreamHeadSchema = z29.looseObject({
18370
- streamId: z29.string(),
18371
- kind: z29.string().optional(),
18372
- headSeq: z29.number().int().nonnegative(),
18373
- headCheckpointId: z29.string().nullable(),
18675
+ var nexusLeaseAcquireSchema = z30.looseObject({ lease: nexusLeaseSchema });
18676
+ var nexusStreamHeadSchema = z30.looseObject({
18677
+ streamId: z30.string(),
18678
+ kind: z30.string().optional(),
18679
+ headSeq: z30.number().int().nonnegative(),
18680
+ headCheckpointId: z30.string().nullable(),
18374
18681
  /**
18375
18682
  * The highest segment `schemaVersion` the stream holds (the server raises it on every append).
18376
18683
  * Absent from an older server.
18377
18684
  */
18378
- maxSchemaVersion: z29.number().int().nonnegative().optional()
18685
+ maxSchemaVersion: z30.number().int().nonnegative().optional()
18379
18686
  });
18380
- var nexusActivityEventSchema = z29.looseObject({
18381
- id: z29.union([z29.string(), z29.number()]),
18687
+ var nexusActivityEventSchema = z30.looseObject({
18688
+ id: z30.union([z30.string(), z30.number()]),
18382
18689
  at: isoTime2,
18383
- actorUserId: z29.string().nullable().optional(),
18384
- actorDeviceId: z29.string().nullable().optional(),
18385
- requestId: z29.string().nullable().optional(),
18386
- action: z29.string(),
18387
- target: z29.string().nullable().optional(),
18388
- detail: z29.unknown().optional()
18690
+ actorUserId: z30.string().nullable().optional(),
18691
+ actorDeviceId: z30.string().nullable().optional(),
18692
+ requestId: z30.string().nullable().optional(),
18693
+ action: z30.string(),
18694
+ target: z30.string().nullable().optional(),
18695
+ detail: z30.unknown().optional()
18389
18696
  });
18390
- var nexusActivityPageSchema = z29.looseObject({
18391
- events: z29.array(nexusActivityEventSchema),
18392
- nextBefore: z29.union([z29.string(), z29.number()]).nullable().optional()
18697
+ var nexusActivityPageSchema = z30.looseObject({
18698
+ events: z30.array(nexusActivityEventSchema),
18699
+ nextBefore: z30.union([z30.string(), z30.number()]).nullable().optional()
18393
18700
  });
18394
18701
 
18395
18702
  // packages/adapters/src/providers/gemini-cli/spawn.ts