@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
@@ -1342,17 +1342,321 @@ var ChangesetEntrySchema = z3.object({
1342
1342
  });
1343
1343
 
1344
1344
  // packages/contracts/src/config/manifest.ts
1345
- import { z as z5 } from "zod";
1345
+ import { z as z6 } from "zod";
1346
1346
 
1347
- // packages/contracts/src/config/worker-policy.ts
1347
+ // packages/contracts/src/orca-execution.ts
1348
1348
  import { z as z4 } from "zod";
1349
- var projectWorkerPolicySchema = z4.object({
1350
- verification: z4.object({
1351
- full: z4.enum(["local", "ci"]),
1352
- local: z4.enum(["single-file", "affected"])
1349
+ var identifier = z4.string().min(1);
1350
+ var orcaAgentSchema = z4.enum(["codex", "opencode2", "claude", "grok"]);
1351
+ var DEFAULT_ORCA_AGENTS = ["codex", "opencode2", "claude"];
1352
+ var orchestrateOrcaConfigSchema = z4.object({
1353
+ agents: z4.array(orcaAgentSchema).min(1).refine((agents) => new Set(agents).size === agents.length, "Agent ids must be unique.").default(DEFAULT_ORCA_AGENTS)
1354
+ });
1355
+ var orcaContextSchema = z4.object({
1356
+ runtimeId: identifier,
1357
+ coordinatorHandle: identifier,
1358
+ executionHostId: z4.literal("local")
1359
+ });
1360
+ var orcaRoutingRunSchema = z4.object({
1361
+ runId: identifier.nullable(),
1362
+ unconfiguredAgents: z4.array(orcaAgentSchema)
1363
+ });
1364
+ var orcaLaunchSchema = z4.object({
1365
+ projectId: identifier,
1366
+ projectRoot: identifier,
1367
+ taskId: identifier,
1368
+ instanceId: identifier,
1369
+ workerSessionId: identifier,
1370
+ agentId: identifier,
1371
+ role: z4.enum(["worker", "lead"]),
1372
+ protocol: identifier,
1373
+ worktreePath: identifier,
1374
+ worktreeBranch: identifier,
1375
+ projectHash: identifier,
1376
+ lockToken: identifier,
1377
+ prompt: identifier,
1378
+ harness: z4.enum(["claude-code", "codex", "opencode", "grok", "kimi"]),
1379
+ leadMailbox: identifier.nullable(),
1380
+ model: identifier.optional(),
1381
+ effort: identifier.optional(),
1382
+ accountId: identifier.optional()
1383
+ });
1384
+ var orcaStartBindingSchema = z4.object({
1385
+ runId: identifier.nullable(),
1386
+ orcaTaskId: identifier.nullable(),
1387
+ retryOf: identifier.nullable()
1388
+ });
1389
+ var orcaAttemptSchema = z4.object({
1390
+ backend: z4.literal("orca"),
1391
+ version: z4.literal(1),
1392
+ /** Monotonic local CAS revision; repeated identical observations still serialize. */
1393
+ revision: z4.number().int().nonnegative(),
1394
+ context: orcaContextSchema,
1395
+ launch: orcaLaunchSchema,
1396
+ promptDigest: z4.string().regex(/^[a-f0-9]{64}$/),
1397
+ workspaceId: identifier,
1398
+ workspaceSelector: identifier,
1399
+ state: z4.enum([
1400
+ "prepared",
1401
+ "launching",
1402
+ "ready",
1403
+ "turn_unobserved",
1404
+ "outcome_unknown",
1405
+ "stop_pending",
1406
+ "stop_unknown",
1407
+ "stopped",
1408
+ "failed",
1409
+ "circuit_broken"
1410
+ ]),
1411
+ runId: identifier.nullable(),
1412
+ orcaTaskId: identifier.nullable(),
1413
+ dispatchId: identifier.nullable(),
1414
+ retryOf: identifier.nullable(),
1415
+ /** Absent on legacy records, whose original argv cannot safely be reconstructed. */
1416
+ startBinding: orcaStartBindingSchema.optional(),
1417
+ /** UUID reserved before committing a retry; its first send and every replay use this key. */
1418
+ startRequestKey: z4.string().uuid().optional(),
1419
+ startRequestId: identifier.nullable(),
1420
+ /** UUID reserved before committing a stop; its first send and every replay use this key. */
1421
+ stopRequestKey: z4.string().uuid().optional(),
1422
+ /** Orca-issued stop request id, retained only when the stop receipt was received. */
1423
+ stopRequestId: identifier.nullable(),
1424
+ /**
1425
+ * Set when the worker-stop reply came from a runtime that proved it enumerates
1426
+ * every helper it stopped, so an omitted helper list means the worker had none.
1427
+ */
1428
+ stopHelperEvidence: z4.literal("enumerated").optional(),
1429
+ failureCount: z4.number().int().nonnegative(),
1430
+ resourceState: z4.string(),
1431
+ /** Full receipts retain effects, residual resources and recovery advice. */
1432
+ lastReceipt: z4.string().nullable(),
1433
+ lastError: z4.string().nullable(),
1434
+ /** Confirmed pre-dispatch refusal; never inferred from a process exit. */
1435
+ startRefusal: z4.literal("agent_unconfigured").optional(),
1436
+ observedAt: z4.string()
1437
+ });
1438
+ var orcaWorkerDoneSchema = z4.object({
1439
+ messageId: identifier,
1440
+ runtimeId: identifier,
1441
+ runId: identifier,
1442
+ orcaTaskId: identifier,
1443
+ dispatchId: identifier,
1444
+ senderHandle: identifier,
1445
+ outcome: z4.enum(["succeeded", "failed"]),
1446
+ body: z4.string(),
1447
+ reportPath: identifier
1448
+ });
1449
+ var orcaWorkerReportSchema = z4.object({
1450
+ event: orcaWorkerDoneSchema,
1451
+ manifestId: identifier,
1452
+ manifestDigest: z4.string().regex(/^[a-f0-9]{64}$/),
1453
+ reportText: z4.string().min(1).max(65536),
1454
+ reportDigest: z4.string().regex(/^[a-f0-9]{64}$/),
1455
+ ingestedAt: z4.string().datetime()
1456
+ });
1457
+ var orcaReportDeliverySchema = z4.object({
1458
+ key: identifier,
1459
+ mailbox: identifier.nullable(),
1460
+ state: z4.enum(["pending", "delivered"]),
1461
+ messageId: identifier.nullable(),
1462
+ deliveredAt: z4.string().datetime().nullable(),
1463
+ lastError: z4.string().nullable()
1464
+ });
1465
+ var orcaWorkerSettlementSchema = z4.object({
1466
+ resourceRelease: z4.object({
1467
+ dispatchId: identifier,
1468
+ releasedAt: z4.string().datetime(),
1469
+ receiptDigest: z4.string().regex(/^[a-f0-9]{64}$/),
1470
+ receipt: identifier
1471
+ }).optional(),
1472
+ retiredAt: z4.string().datetime().optional(),
1473
+ reportDelivery: orcaReportDeliverySchema.optional()
1474
+ });
1475
+ var orcaReportMessageSchema = z4.object({
1476
+ id: identifier,
1477
+ run_id: z4.string().nullable(),
1478
+ delivery_contract: z4.string(),
1479
+ from_handle: z4.string(),
1480
+ to_handle: z4.string(),
1481
+ type: z4.string(),
1482
+ body: z4.string(),
1483
+ payload: z4.string().nullable(),
1484
+ sender_pane_key: z4.string().nullable()
1485
+ });
1486
+ var orcaReportSourceSchema = z4.object({
1487
+ ok: z4.literal(true),
1488
+ _meta: z4.object({ runtimeId: identifier }),
1489
+ result: z4.object({
1490
+ messages: z4.array(z4.json()).optional(),
1491
+ dispatch: z4.object({
1492
+ id: identifier,
1493
+ run_id: identifier,
1494
+ task_id: identifier,
1495
+ assignee_handle: identifier,
1496
+ assignee_pane_key: z4.string().nullable(),
1497
+ status: z4.string()
1498
+ }).optional()
1499
+ })
1500
+ });
1501
+ var orcaWorkerDonePayloadSchema = z4.object({
1502
+ taskId: identifier,
1503
+ dispatchId: identifier,
1504
+ outcome: z4.enum(["succeeded", "failed"]),
1505
+ reportPath: identifier
1506
+ });
1507
+ var orcaWorkerRequestSchema = z4.object({
1508
+ action: z4.enum([
1509
+ "show",
1510
+ "read",
1511
+ "recover-start",
1512
+ "recover-stop",
1513
+ "retry",
1514
+ "stop",
1515
+ "ingest-report",
1516
+ "relay-report"
1517
+ ]),
1518
+ recordId: identifier,
1519
+ cursor: identifier.optional(),
1520
+ messageId: identifier.optional()
1521
+ }).refine(({ action, cursor }) => cursor === void 0 || action === "read", {
1522
+ message: "A source-pinned cursor is accepted only for read.",
1523
+ path: ["cursor"]
1524
+ }).refine(({ action, messageId }) => action === "ingest-report" === (messageId !== void 0), {
1525
+ message: "ingest-report requires an exact message id; other actions do not accept one.",
1526
+ path: ["messageId"]
1527
+ });
1528
+ var effectSchema = z4.object({
1529
+ kind: z4.string(),
1530
+ role: z4.string().optional(),
1531
+ action: z4.string().optional(),
1532
+ id: z4.string().optional()
1533
+ });
1534
+ var selectionSchema = z4.object({
1535
+ agent: z4.string().nullable().optional(),
1536
+ model: z4.string().nullable().optional(),
1537
+ effort: z4.string().nullable().optional()
1538
+ });
1539
+ var orcaReplySchema = z4.object({
1540
+ ok: z4.boolean(),
1541
+ _meta: z4.object({ runtimeId: z4.string().nullable() }).optional(),
1542
+ error: z4.object({
1543
+ code: z4.string(),
1544
+ message: z4.string(),
1545
+ data: z4.object({
1546
+ requestId: identifier.optional(),
1547
+ orchestrationRequestId: identifier.optional(),
1548
+ dispatchId: identifier.optional()
1549
+ }).optional()
1550
+ }).optional(),
1551
+ result: z4.object({
1552
+ state: z4.string().optional(),
1553
+ requestId: identifier.optional(),
1554
+ /**
1555
+ * Mutation ledger identity Orca stamps on every successful mutation result.
1556
+ * @remarks Installed Orca 1.4.255 attaches `{ requestId, replayed }` to the
1557
+ * result it records (`Jy` in the retained source), so a successful stop can
1558
+ * be bound to the request key this attempt issued.
1559
+ */
1560
+ mutation: z4.object({
1561
+ requestId: identifier.optional(),
1562
+ replayed: z4.boolean().optional()
1563
+ }).optional(),
1564
+ stage: z4.string().optional(),
1565
+ turnStart: z4.string().optional(),
1566
+ runId: identifier.optional(),
1567
+ run: z4.object({ id: identifier }).nullable().optional(),
1568
+ taskId: identifier.optional(),
1569
+ dispatchId: identifier.optional(),
1570
+ failureCount: z4.number().int().nonnegative().optional(),
1571
+ effects: z4.array(effectSchema).optional(),
1572
+ residualResources: z4.array(effectSchema).optional(),
1573
+ launch: z4.object({ effective: selectionSchema.optional() }).optional(),
1574
+ lastError: z4.string().nullable().optional(),
1575
+ processAction: z4.string().optional(),
1576
+ helpers: z4.array(
1577
+ z4.object({
1578
+ dispatchId: identifier.optional(),
1579
+ creatorDispatchId: identifier.optional(),
1580
+ outcome: z4.string(),
1581
+ keptOpenBy: identifier.optional(),
1582
+ state: z4.string().optional(),
1583
+ lastError: z4.string().nullable().optional()
1584
+ })
1585
+ ).optional(),
1586
+ helperStopError: z4.string().nullable().optional(),
1587
+ status: z4.string().optional(),
1588
+ terminal: z4.object({
1589
+ handle: identifier,
1590
+ connected: z4.boolean(),
1591
+ writable: z4.boolean(),
1592
+ executionHostId: identifier
1593
+ }).optional(),
1594
+ runtime: z4.object({
1595
+ runtimeId: identifier,
1596
+ reachable: z4.boolean(),
1597
+ state: z4.string(),
1598
+ capabilities: z4.array(z4.string())
1599
+ }).optional(),
1600
+ worktree: z4.object({
1601
+ id: identifier,
1602
+ path: identifier,
1603
+ branch: identifier,
1604
+ hostId: identifier,
1605
+ address: z4.object({ worktree: identifier }).optional()
1606
+ }).optional(),
1607
+ dispatch: z4.object({
1608
+ id: identifier,
1609
+ runId: identifier,
1610
+ taskId: identifier,
1611
+ /** Direct creator Dispatch that started this one; null for a Run root. */
1612
+ creatorDispatchId: identifier.nullable().optional(),
1613
+ failureCount: z4.number().int().nonnegative()
1614
+ }).optional(),
1615
+ worker: z4.object({
1616
+ dispatchId: identifier,
1617
+ runtimeEpoch: identifier,
1618
+ state: z4.string(),
1619
+ stage: z4.string(),
1620
+ worktreeId: identifier.nullable()
1621
+ }).optional(),
1622
+ observation: z4.object({ status: z4.string(), exactWorker: z4.boolean().optional() }).optional(),
1623
+ projection: z4.object({
1624
+ resource: z4.object({
1625
+ state: z4.string(),
1626
+ terminalState: z4.string(),
1627
+ ownerDispatchId: identifier.optional(),
1628
+ releaseState: z4.string().optional()
1629
+ }).optional()
1630
+ }).optional()
1631
+ }).optional()
1632
+ });
1633
+ var orcaCommandRegistrySchema = z4.object({
1634
+ schemaVersion: z4.number().int().positive(),
1635
+ commands: z4.array(z4.object({ command: identifier, flags: z4.array(z4.string()) }))
1636
+ });
1637
+ var accountProviderSchema = z4.object({
1638
+ accounts: z4.array(z4.object({})),
1639
+ activeAccountId: identifier.nullable()
1640
+ });
1641
+ var orcaAccountReplySchema = z4.object({
1642
+ ok: z4.literal(true),
1643
+ _meta: z4.object({ runtimeId: identifier }),
1644
+ result: z4.object({
1645
+ codex: accountProviderSchema,
1646
+ opencode: accountProviderSchema,
1647
+ claude: accountProviderSchema
1648
+ })
1649
+ });
1650
+
1651
+ // packages/contracts/src/config/worker-policy.ts
1652
+ import { z as z5 } from "zod";
1653
+ var projectWorkerPolicySchema = z5.object({
1654
+ verification: z5.object({
1655
+ full: z5.enum(["local", "ci"]),
1656
+ local: z5.enum(["single-file", "affected"])
1353
1657
  }).strict().optional(),
1354
- instructions: z4.array(
1355
- z4.string().min(1).max(512).regex(/\S/).regex(
1658
+ instructions: z5.array(
1659
+ z5.string().min(1).max(512).regex(/\S/).regex(
1356
1660
  /^(?!\s*#)[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+$/u,
1357
1661
  "Instructions must be single-line text without control characters or a leading #"
1358
1662
  )
@@ -1380,8 +1684,11 @@ var CLEO_CONFIG_MANIFEST = {
1380
1684
  path: ".cleo/config.json",
1381
1685
  mergePrecedence: 20,
1382
1686
  driftDetection: "schema-validate",
1383
- schema: z5.object({
1384
- orchestrate: z5.object({ workerPolicy: projectWorkerPolicySchema.optional() }).passthrough().optional()
1687
+ schema: z6.object({
1688
+ orchestrate: z6.object({
1689
+ workerPolicy: projectWorkerPolicySchema.optional(),
1690
+ orca: orchestrateOrcaConfigSchema.optional()
1691
+ }).passthrough().optional()
1385
1692
  }).passthrough()
1386
1693
  };
1387
1694
  var GLOBAL_CLEO_CONFIG_MANIFEST = {
@@ -1397,139 +1704,139 @@ var CONFIG_MANIFEST_ENTRIES = Object.freeze([
1397
1704
  GLOBAL_CLEO_CONFIG_MANIFEST,
1398
1705
  CLEO_CONFIG_MANIFEST
1399
1706
  ]);
1400
- var configManifestEntrySchema = z5.object({
1401
- id: z5.string().min(1),
1402
- scope: z5.union([z5.literal("global"), z5.literal("project"), z5.literal("metadata")]),
1403
- path: z5.string().min(1),
1404
- schema: z5.unknown().optional(),
1405
- mergePrecedence: z5.number().int().nonnegative(),
1406
- driftDetection: z5.union([
1407
- z5.literal("schema-validate"),
1408
- z5.literal("staleness-gate"),
1409
- z5.literal("value-diff"),
1410
- z5.literal("none")
1707
+ var configManifestEntrySchema = z6.object({
1708
+ id: z6.string().min(1),
1709
+ scope: z6.union([z6.literal("global"), z6.literal("project"), z6.literal("metadata")]),
1710
+ path: z6.string().min(1),
1711
+ schema: z6.unknown().optional(),
1712
+ mergePrecedence: z6.number().int().nonnegative(),
1713
+ driftDetection: z6.union([
1714
+ z6.literal("schema-validate"),
1715
+ z6.literal("staleness-gate"),
1716
+ z6.literal("value-diff"),
1717
+ z6.literal("none")
1411
1718
  ]),
1412
- defaults: z5.record(z5.string(), z5.unknown()).optional()
1719
+ defaults: z6.record(z6.string(), z6.unknown()).optional()
1413
1720
  });
1414
1721
 
1415
1722
  // packages/contracts/src/daemon/health.ts
1416
- import { z as z7 } from "zod";
1723
+ import { z as z8 } from "zod";
1417
1724
 
1418
1725
  // packages/contracts/src/supervisor-ipc/messages.ts
1419
- import { z as z6 } from "zod";
1420
- var EnvPairSchema = z6.object({
1726
+ import { z as z7 } from "zod";
1727
+ var EnvPairSchema = z7.object({
1421
1728
  /** Environment variable name. */
1422
- key: z6.string().min(1),
1729
+ key: z7.string().min(1),
1423
1730
  /** Environment variable value. */
1424
- value: z6.string()
1731
+ value: z7.string()
1425
1732
  }).strict();
1426
- var ChildStateSchema = z6.enum(["running", "restarting", "stopped"]);
1427
- var ChildStatusSchema = z6.object({
1733
+ var ChildStateSchema = z7.enum(["running", "restarting", "stopped"]);
1734
+ var ChildStatusSchema = z7.object({
1428
1735
  /** Logical id of the child (stable across restarts). */
1429
- child_id: z6.string().min(1),
1736
+ child_id: z7.string().min(1),
1430
1737
  /** Current OS pid (0 when not currently running). */
1431
- pid: z6.number().int().nonnegative(),
1738
+ pid: z7.number().int().nonnegative(),
1432
1739
  /** Current liveness state. */
1433
1740
  state: ChildStateSchema,
1434
1741
  /** Total restarts observed for this child. */
1435
- restart_count: z6.number().int().nonnegative()
1742
+ restart_count: z7.number().int().nonnegative()
1436
1743
  }).strict();
1437
- var SpawnRequestSchema = z6.object({
1744
+ var SpawnRequestSchema = z7.object({
1438
1745
  /** Tag discriminating this request variant. */
1439
- kind: z6.literal("spawn"),
1746
+ kind: z7.literal("spawn"),
1440
1747
  /** Caller-chosen logical id for the child (stable across restarts). */
1441
- child_id: z6.string().min(1),
1748
+ child_id: z7.string().min(1),
1442
1749
  /** Absolute path to the program to execute. */
1443
- program: z6.string().min(1),
1750
+ program: z7.string().min(1),
1444
1751
  /** Arguments passed to the program. */
1445
- args: z6.array(z6.string()).default([]),
1752
+ args: z7.array(z7.string()).default([]),
1446
1753
  /** Environment overrides applied on top of the supervisor's environment. */
1447
- env: z6.array(EnvPairSchema).default([]),
1754
+ env: z7.array(EnvPairSchema).default([]),
1448
1755
  /** Optional working directory for the child. */
1449
- cwd: z6.string().optional()
1756
+ cwd: z7.string().optional()
1450
1757
  }).strict();
1451
- var RestartRequestSchema = z6.object({
1758
+ var RestartRequestSchema = z7.object({
1452
1759
  /** Tag discriminating this request variant. */
1453
- kind: z6.literal("restart"),
1760
+ kind: z7.literal("restart"),
1454
1761
  /** Logical id of the child to restart. */
1455
- child_id: z6.string().min(1)
1762
+ child_id: z7.string().min(1)
1456
1763
  }).strict();
1457
- var MonitorRequestSchema = z6.object({
1764
+ var MonitorRequestSchema = z7.object({
1458
1765
  /** Tag discriminating this request variant. */
1459
- kind: z6.literal("monitor"),
1766
+ kind: z7.literal("monitor"),
1460
1767
  /** Specific child id to monitor; omit to request all children. */
1461
- child_id: z6.string().optional()
1768
+ child_id: z7.string().optional()
1462
1769
  }).strict();
1463
- var HealthRequestSchema = z6.object({
1770
+ var HealthRequestSchema = z7.object({
1464
1771
  /** Tag discriminating this request variant. */
1465
- kind: z6.literal("health")
1772
+ kind: z7.literal("health")
1466
1773
  }).strict();
1467
- var SupervisorIpcRequestSchema = z6.discriminatedUnion("kind", [
1774
+ var SupervisorIpcRequestSchema = z7.discriminatedUnion("kind", [
1468
1775
  SpawnRequestSchema,
1469
1776
  RestartRequestSchema,
1470
1777
  MonitorRequestSchema,
1471
1778
  HealthRequestSchema
1472
1779
  ]);
1473
- var SpawnedResponseSchema = z6.object({
1780
+ var SpawnedResponseSchema = z7.object({
1474
1781
  /** Tag discriminating this response variant. */
1475
- kind: z6.literal("spawned"),
1782
+ kind: z7.literal("spawned"),
1476
1783
  /** Logical id of the spawned child. */
1477
- child_id: z6.string().min(1),
1784
+ child_id: z7.string().min(1),
1478
1785
  /** OS pid assigned to the spawned child. */
1479
- pid: z6.number().int().nonnegative()
1786
+ pid: z7.number().int().nonnegative()
1480
1787
  }).strict();
1481
- var RestartedResponseSchema = z6.object({
1788
+ var RestartedResponseSchema = z7.object({
1482
1789
  /** Tag discriminating this response variant. */
1483
- kind: z6.literal("restarted"),
1790
+ kind: z7.literal("restarted"),
1484
1791
  /** Logical id of the restarted child. */
1485
- child_id: z6.string().min(1),
1792
+ child_id: z7.string().min(1),
1486
1793
  /** New OS pid after the restart. */
1487
- pid: z6.number().int().nonnegative(),
1794
+ pid: z7.number().int().nonnegative(),
1488
1795
  /** Number of times this child has been restarted in total. */
1489
- restart_count: z6.number().int().nonnegative()
1796
+ restart_count: z7.number().int().nonnegative()
1490
1797
  }).strict();
1491
- var MonitorResponseSchema = z6.object({
1798
+ var MonitorResponseSchema = z7.object({
1492
1799
  /** Tag discriminating this response variant. */
1493
- kind: z6.literal("monitor"),
1800
+ kind: z7.literal("monitor"),
1494
1801
  /** One row per monitored child. */
1495
- children: z6.array(ChildStatusSchema)
1802
+ children: z7.array(ChildStatusSchema)
1496
1803
  }).strict();
1497
- var HealthResponseSchema = z6.object({
1804
+ var HealthResponseSchema = z7.object({
1498
1805
  /** Tag discriminating this response variant. */
1499
- kind: z6.literal("health"),
1806
+ kind: z7.literal("health"),
1500
1807
  /** Supervisor process pid. */
1501
- pid: z6.number().int().nonnegative(),
1808
+ pid: z7.number().int().nonnegative(),
1502
1809
  /** Number of children currently tracked. */
1503
- child_count: z6.number().int().nonnegative(),
1810
+ child_count: z7.number().int().nonnegative(),
1504
1811
  /** Seconds the supervisor has been running. */
1505
- uptime_secs: z6.number().int().nonnegative(),
1812
+ uptime_secs: z7.number().int().nonnegative(),
1506
1813
  /** Frozen protocol version the supervisor speaks. */
1507
- protocol_version: z6.string()
1814
+ protocol_version: z7.string()
1508
1815
  }).strict();
1509
- var LifecycleEventKindSchema = z6.enum(["child_exited", "child_restarted"]);
1510
- var LifecycleEventResponseSchema = z6.object({
1816
+ var LifecycleEventKindSchema = z7.enum(["child_exited", "child_restarted"]);
1817
+ var LifecycleEventResponseSchema = z7.object({
1511
1818
  /** Tag discriminating this response variant. */
1512
- kind: z6.literal("event"),
1819
+ kind: z7.literal("event"),
1513
1820
  /** What happened. */
1514
1821
  event: LifecycleEventKindSchema,
1515
1822
  /** Logical id of the affected child. */
1516
- child_id: z6.string().min(1),
1823
+ child_id: z7.string().min(1),
1517
1824
  /** Exit code, when the OS reported one. */
1518
- exit_code: z6.number().int().optional(),
1825
+ exit_code: z7.number().int().optional(),
1519
1826
  /** Terminating signal name, when the child was signalled (Unix). */
1520
- signal: z6.string().optional(),
1827
+ signal: z7.string().optional(),
1521
1828
  /** Backoff delay (ms) before the pending restart, when applicable. */
1522
- restart_delay_ms: z6.number().int().nonnegative().optional()
1829
+ restart_delay_ms: z7.number().int().nonnegative().optional()
1523
1830
  }).strict();
1524
- var ErrorResponseSchema = z6.object({
1831
+ var ErrorResponseSchema = z7.object({
1525
1832
  /** Tag discriminating this response variant. */
1526
- kind: z6.literal("error"),
1833
+ kind: z7.literal("error"),
1527
1834
  /** Machine-readable error code (e.g. `E_UNKNOWN_CHILD`). */
1528
- code: z6.string().min(1),
1835
+ code: z7.string().min(1),
1529
1836
  /** Human-readable error message. */
1530
- message: z6.string()
1837
+ message: z7.string()
1531
1838
  }).strict();
1532
- var SupervisorIpcResponseSchema = z6.discriminatedUnion("kind", [
1839
+ var SupervisorIpcResponseSchema = z7.discriminatedUnion("kind", [
1533
1840
  SpawnedResponseSchema,
1534
1841
  RestartedResponseSchema,
1535
1842
  MonitorResponseSchema,
@@ -1537,27 +1844,27 @@ var SupervisorIpcResponseSchema = z6.discriminatedUnion("kind", [
1537
1844
  LifecycleEventResponseSchema,
1538
1845
  ErrorResponseSchema
1539
1846
  ]);
1540
- var SupervisorIpcRequestEnvelopeSchema = z6.object({
1847
+ var SupervisorIpcRequestEnvelopeSchema = z7.object({
1541
1848
  /** Frozen protocol version. */
1542
- protocol_version: z6.string(),
1849
+ protocol_version: z7.string(),
1543
1850
  /** Correlation id echoed back on the matching response. */
1544
- id: z6.string().min(1),
1851
+ id: z7.string().min(1),
1545
1852
  /** Direction discriminator. */
1546
- direction: z6.literal("request"),
1853
+ direction: z7.literal("request"),
1547
1854
  /** The request body. */
1548
1855
  request: SupervisorIpcRequestSchema
1549
1856
  }).strict();
1550
- var SupervisorIpcResponseEnvelopeSchema = z6.object({
1857
+ var SupervisorIpcResponseEnvelopeSchema = z7.object({
1551
1858
  /** Frozen protocol version. */
1552
- protocol_version: z6.string(),
1859
+ protocol_version: z7.string(),
1553
1860
  /** Correlation id echoed from the originating request (or a fresh id for events). */
1554
- id: z6.string().min(1),
1861
+ id: z7.string().min(1),
1555
1862
  /** Direction discriminator. */
1556
- direction: z6.literal("response"),
1863
+ direction: z7.literal("response"),
1557
1864
  /** The response body. */
1558
1865
  response: SupervisorIpcResponseSchema
1559
1866
  }).strict();
1560
- var SupervisorIpcEnvelopeSchema = z6.discriminatedUnion("direction", [
1867
+ var SupervisorIpcEnvelopeSchema = z7.discriminatedUnion("direction", [
1561
1868
  SupervisorIpcRequestEnvelopeSchema,
1562
1869
  SupervisorIpcResponseEnvelopeSchema
1563
1870
  ]);
@@ -1581,17 +1888,17 @@ var SubsystemHealthSchema = ChildStatusSchema.extend({
1581
1888
  * Optional human-readable detail (e.g. last error message, queue depth).
1582
1889
  * Diagnostic only — not part of the supervisor wire contract.
1583
1890
  */
1584
- detail: z7.string().optional()
1891
+ detail: z8.string().optional()
1585
1892
  }).strict();
1586
- var HealthStatusSchema = z7.object({
1893
+ var HealthStatusSchema = z8.object({
1587
1894
  /** One health row per registered subsystem. */
1588
- subsystems: z7.array(SubsystemHealthSchema),
1895
+ subsystems: z8.array(SubsystemHealthSchema),
1589
1896
  /**
1590
1897
  * `true` iff every subsystem is in the `running` state. A convenience roll-up
1591
1898
  * derived from {@link HealthStatusSchema.shape.subsystems}; recomputed by
1592
1899
  * {@link summarizeHealth} so producers cannot desync it.
1593
1900
  */
1594
- allHealthy: z7.boolean()
1901
+ allHealthy: z8.boolean()
1595
1902
  }).strict();
1596
1903
 
1597
1904
  // packages/contracts/src/db-inventory.json
@@ -13520,7 +13827,7 @@ var OPERATIONS = [
13520
13827
  ];
13521
13828
 
13522
13829
  // packages/contracts/src/docs/modernize.ts
13523
- import { z as z8 } from "zod";
13830
+ import { z as z9 } from "zod";
13524
13831
  var DOCS_MODERNIZE_DISPOSITIONS = ["keep", "rename", "merge-into", "delete"];
13525
13832
  var DOCS_MODERNIZE_OPS = [
13526
13833
  "ingest",
@@ -13534,105 +13841,105 @@ var DOCS_MODERNIZE_OPS = [
13534
13841
  "reslug",
13535
13842
  "link-task"
13536
13843
  ];
13537
- var judgmentSchema = z8.object({
13538
- question: z8.enum(["classify", "merge"]),
13539
- site: z8.string(),
13540
- mode: z8.enum(["off", "shadow", "on"]),
13541
- ruleAnswer: z8.string(),
13542
- decidedAnswer: z8.string().nullable(),
13543
- decidedConfidence: z8.number().nullable(),
13544
- source: z8.enum(["provider", "cache", "fallback"]),
13545
- acted: z8.string()
13844
+ var judgmentSchema = z9.object({
13845
+ question: z9.enum(["classify", "merge"]),
13846
+ site: z9.string(),
13847
+ mode: z9.enum(["off", "shadow", "on"]),
13848
+ ruleAnswer: z9.string(),
13849
+ decidedAnswer: z9.string().nullable(),
13850
+ decidedConfidence: z9.number().nullable(),
13851
+ source: z9.enum(["provider", "cache", "fallback"]),
13852
+ acted: z9.string()
13546
13853
  });
13547
- var relPath = z8.string().min(1).max(1024);
13548
- var docsModernizePlanSchema = z8.object({
13549
- root: z8.string().min(1),
13550
- generatedAt: z8.string(),
13551
- mode: z8.enum(["tree", "store-only"]),
13552
- counts: z8.record(z8.enum(DOCS_MODERNIZE_DISPOSITIONS), z8.number()),
13553
- rows: z8.array(
13554
- z8.object({
13854
+ var relPath = z9.string().min(1).max(1024);
13855
+ var docsModernizePlanSchema = z9.object({
13856
+ root: z9.string().min(1),
13857
+ generatedAt: z9.string(),
13858
+ mode: z9.enum(["tree", "store-only"]),
13859
+ counts: z9.record(z9.enum(DOCS_MODERNIZE_DISPOSITIONS), z9.number()),
13860
+ rows: z9.array(
13861
+ z9.object({
13555
13862
  path: relPath,
13556
- sha256: z8.string().regex(/^[0-9a-f]{64}$/),
13557
- kind: z8.string().min(1),
13558
- slug: z8.string().regex(/^[a-z0-9][a-z0-9-]*$/),
13559
- title: z8.string(),
13560
- disposition: z8.enum(DOCS_MODERNIZE_DISPOSITIONS),
13561
- target: z8.string().min(1).max(1024).nullable(),
13562
- reasons: z8.array(z8.string()),
13563
- judgments: z8.array(judgmentSchema),
13564
- ownerTasks: z8.array(z8.string().regex(/^[TD]\d+$/)),
13565
- category: z8.string(),
13566
- refs: z8.array(z8.string()),
13567
- overridden: z8.boolean(),
13568
- covers: z8.array(z8.string()),
13569
- baselineRemove: z8.boolean()
13863
+ sha256: z9.string().regex(/^[0-9a-f]{64}$/),
13864
+ kind: z9.string().min(1),
13865
+ slug: z9.string().regex(/^[a-z0-9][a-z0-9-]*$/),
13866
+ title: z9.string(),
13867
+ disposition: z9.enum(DOCS_MODERNIZE_DISPOSITIONS),
13868
+ target: z9.string().min(1).max(1024).nullable(),
13869
+ reasons: z9.array(z9.string()),
13870
+ judgments: z9.array(judgmentSchema),
13871
+ ownerTasks: z9.array(z9.string().regex(/^[TD]\d+$/)),
13872
+ category: z9.string(),
13873
+ refs: z9.array(z9.string()),
13874
+ overridden: z9.boolean(),
13875
+ covers: z9.array(z9.string()),
13876
+ baselineRemove: z9.boolean()
13570
13877
  })
13571
13878
  ),
13572
- linkFixes: z8.array(
13573
- z8.object({
13574
- kind: z8.literal("link-fix"),
13879
+ linkFixes: z9.array(
13880
+ z9.object({
13881
+ kind: z9.literal("link-fix"),
13575
13882
  path: relPath,
13576
- href: z8.string().min(1).max(2048),
13577
- newHref: z8.string().min(1).max(2048),
13578
- base: z8.literal("repo").optional(),
13579
- sha256: z8.string().regex(/^[0-9a-f]{64}$/).optional()
13883
+ href: z9.string().min(1).max(2048),
13884
+ newHref: z9.string().min(1).max(2048),
13885
+ base: z9.literal("repo").optional(),
13886
+ sha256: z9.string().regex(/^[0-9a-f]{64}$/).optional()
13580
13887
  })
13581
13888
  ).optional(),
13582
- repoRoot: z8.string().min(1).optional()
13889
+ repoRoot: z9.string().min(1).optional()
13583
13890
  });
13584
- var docsModernizeOverridesSchema = z8.record(
13891
+ var docsModernizeOverridesSchema = z9.record(
13585
13892
  relPath,
13586
- z8.object({
13587
- disposition: z8.enum(DOCS_MODERNIZE_DISPOSITIONS),
13588
- target: z8.string().min(1).max(1024).nullable().optional(),
13589
- reason: z8.string().min(1),
13590
- kind: z8.string().min(1).optional(),
13591
- slug: z8.string().regex(/^[a-z0-9][a-z0-9-]*$/).optional(),
13592
- covers: z8.array(z8.string()).optional()
13893
+ z9.object({
13894
+ disposition: z9.enum(DOCS_MODERNIZE_DISPOSITIONS),
13895
+ target: z9.string().min(1).max(1024).nullable().optional(),
13896
+ reason: z9.string().min(1),
13897
+ kind: z9.string().min(1).optional(),
13898
+ slug: z9.string().regex(/^[a-z0-9][a-z0-9-]*$/).optional(),
13899
+ covers: z9.array(z9.string()).optional()
13593
13900
  })
13594
13901
  );
13595
- var receiptOpSchema = z8.object({
13596
- op: z8.enum(DOCS_MODERNIZE_OPS),
13597
- state: z8.enum(["pending", "done", "reversed"]),
13598
- slug: z8.string().nullable(),
13902
+ var receiptOpSchema = z9.object({
13903
+ op: z9.enum(DOCS_MODERNIZE_OPS),
13904
+ state: z9.enum(["pending", "done", "reversed"]),
13905
+ slug: z9.string().nullable(),
13599
13906
  path: relPath.nullable(),
13600
- target: z8.string().nullable(),
13601
- attachmentId: z8.string().nullable(),
13602
- ownerId: z8.string().nullable(),
13603
- beforeSha256: z8.string().regex(/^[0-9a-f]{64}$/).nullable(),
13604
- afterSha256: z8.string().regex(/^[0-9a-f]{64}$/).nullable(),
13605
- prior: z8.object({
13606
- lifecycleStatus: z8.string().nullable().optional(),
13607
- supersededBy: z8.string().nullable().optional(),
13608
- supersedes: z8.string().nullable().optional(),
13609
- previousAttachmentId: z8.string().nullable().optional(),
13610
- newAttachmentId: z8.string().nullable().optional(),
13611
- linkTargets: z8.array(z8.string()).optional(),
13612
- kind: z8.string().nullable().optional()
13907
+ target: z9.string().nullable(),
13908
+ attachmentId: z9.string().nullable(),
13909
+ ownerId: z9.string().nullable(),
13910
+ beforeSha256: z9.string().regex(/^[0-9a-f]{64}$/).nullable(),
13911
+ afterSha256: z9.string().regex(/^[0-9a-f]{64}$/).nullable(),
13912
+ prior: z9.object({
13913
+ lifecycleStatus: z9.string().nullable().optional(),
13914
+ supersededBy: z9.string().nullable().optional(),
13915
+ supersedes: z9.string().nullable().optional(),
13916
+ previousAttachmentId: z9.string().nullable().optional(),
13917
+ newAttachmentId: z9.string().nullable().optional(),
13918
+ linkTargets: z9.array(z9.string()).optional(),
13919
+ kind: z9.string().nullable().optional()
13613
13920
  }).optional(),
13614
- base: z8.literal("repo").optional()
13921
+ base: z9.literal("repo").optional()
13615
13922
  });
13616
13923
  var docsModernizeJournalLineSchema = receiptOpSchema.extend({
13617
- i: z8.number().int().min(0)
13924
+ i: z9.number().int().min(0)
13618
13925
  });
13619
- var docsModernizeReceiptSchema = z8.object({
13620
- runId: z8.string().regex(/^dm-[\w-]+$/),
13621
- root: z8.string().min(1),
13622
- appliedAt: z8.string(),
13623
- planSha256: z8.string(),
13624
- edgeCount: z8.number(),
13625
- rolledBackAt: z8.string().nullable(),
13626
- blobs: z8.array(z8.object({ path: relPath, sha256: z8.string() })),
13627
- moves: z8.array(z8.object({ from: relPath, to: relPath })),
13628
- deleted: z8.array(relPath),
13629
- ops: z8.array(receiptOpSchema),
13630
- durationMs: z8.number().optional(),
13631
- repoRoot: z8.string().min(1).optional()
13926
+ var docsModernizeReceiptSchema = z9.object({
13927
+ runId: z9.string().regex(/^dm-[\w-]+$/),
13928
+ root: z9.string().min(1),
13929
+ appliedAt: z9.string(),
13930
+ planSha256: z9.string(),
13931
+ edgeCount: z9.number(),
13932
+ rolledBackAt: z9.string().nullable(),
13933
+ blobs: z9.array(z9.object({ path: relPath, sha256: z9.string() })),
13934
+ moves: z9.array(z9.object({ from: relPath, to: relPath })),
13935
+ deleted: z9.array(relPath),
13936
+ ops: z9.array(receiptOpSchema),
13937
+ durationMs: z9.number().optional(),
13938
+ repoRoot: z9.string().min(1).optional()
13632
13939
  });
13633
13940
 
13634
13941
  // packages/contracts/src/docs/provenance.ts
13635
- import { z as z9 } from "zod";
13942
+ import { z as z10 } from "zod";
13636
13943
  var PROVENANCE_NODE_KINDS = [
13637
13944
  "doc",
13638
13945
  "task",
@@ -13655,96 +13962,96 @@ var DOC_LIFECYCLE_STATUSES = [
13655
13962
  "archived",
13656
13963
  "draft"
13657
13964
  ];
13658
- var provenanceNodeKindSchema = z9.enum(PROVENANCE_NODE_KINDS);
13659
- var provenanceEdgeRelationSchema = z9.enum(PROVENANCE_EDGE_RELATIONS);
13660
- var docLifecycleStatusSchema = z9.enum(DOC_LIFECYCLE_STATUSES);
13965
+ var provenanceNodeKindSchema = z10.enum(PROVENANCE_NODE_KINDS);
13966
+ var provenanceEdgeRelationSchema = z10.enum(PROVENANCE_EDGE_RELATIONS);
13967
+ var docLifecycleStatusSchema = z10.enum(DOC_LIFECYCLE_STATUSES);
13661
13968
  var provenanceNodeBaseFields = {
13662
- id: z9.string().min(1),
13663
- title: z9.string().min(1),
13664
- metadata: z9.record(z9.string(), z9.unknown()).optional()
13969
+ id: z10.string().min(1),
13970
+ title: z10.string().min(1),
13971
+ metadata: z10.record(z10.string(), z10.unknown()).optional()
13665
13972
  };
13666
- var provenanceDocNodeSchema = z9.object({
13973
+ var provenanceDocNodeSchema = z10.object({
13667
13974
  ...provenanceNodeBaseFields,
13668
- kind: z9.literal("doc"),
13669
- slug: z9.string().min(1),
13670
- docKind: z9.string().min(1),
13975
+ kind: z10.literal("doc"),
13976
+ slug: z10.string().min(1),
13977
+ docKind: z10.string().min(1),
13671
13978
  lifecycleStatus: docLifecycleStatusSchema,
13672
- publishedAt: z9.string().min(1),
13673
- supersededAt: z9.string().min(1).optional(),
13674
- summary: z9.string().optional()
13979
+ publishedAt: z10.string().min(1),
13980
+ supersededAt: z10.string().min(1).optional(),
13981
+ summary: z10.string().optional()
13675
13982
  });
13676
- var provenanceTaskNodeSchema = z9.object({
13983
+ var provenanceTaskNodeSchema = z10.object({
13677
13984
  ...provenanceNodeBaseFields,
13678
- kind: z9.literal("task"),
13679
- taskType: z9.enum(["saga", "epic", "task", "subtask"]),
13680
- status: z9.enum(["pending", "in_progress", "done", "blocked", "cancelled", "archived"])
13985
+ kind: z10.literal("task"),
13986
+ taskType: z10.enum(["saga", "epic", "task", "subtask"]),
13987
+ status: z10.enum(["pending", "in_progress", "done", "blocked", "cancelled", "archived"])
13681
13988
  });
13682
- var provenanceDecisionNodeSchema = z9.object({
13989
+ var provenanceDecisionNodeSchema = z10.object({
13683
13990
  ...provenanceNodeBaseFields,
13684
- kind: z9.literal("decision"),
13685
- outcome: z9.enum(["proposed", "accepted", "rejected", "superseded"]),
13686
- decidedAt: z9.string().min(1)
13991
+ kind: z10.literal("decision"),
13992
+ outcome: z10.enum(["proposed", "accepted", "rejected", "superseded"]),
13993
+ decidedAt: z10.string().min(1)
13687
13994
  });
13688
- var provenanceSessionNodeSchema = z9.object({
13995
+ var provenanceSessionNodeSchema = z10.object({
13689
13996
  ...provenanceNodeBaseFields,
13690
- kind: z9.literal("session"),
13691
- startedAt: z9.string().min(1),
13692
- endedAt: z9.string().min(1).optional()
13997
+ kind: z10.literal("session"),
13998
+ startedAt: z10.string().min(1),
13999
+ endedAt: z10.string().min(1).optional()
13693
14000
  });
13694
- var provenanceMemoryNodeSchema = z9.object({
14001
+ var provenanceMemoryNodeSchema = z10.object({
13695
14002
  ...provenanceNodeBaseFields,
13696
- kind: z9.literal("memory"),
13697
- memoryType: z9.enum(["observation", "pattern", "decision", "diary"]),
13698
- recordedAt: z9.string().min(1)
14003
+ kind: z10.literal("memory"),
14004
+ memoryType: z10.enum(["observation", "pattern", "decision", "diary"]),
14005
+ recordedAt: z10.string().min(1)
13699
14006
  });
13700
- var provenanceNodeSchema = z9.discriminatedUnion("kind", [
14007
+ var provenanceNodeSchema = z10.discriminatedUnion("kind", [
13701
14008
  provenanceDocNodeSchema,
13702
14009
  provenanceTaskNodeSchema,
13703
14010
  provenanceDecisionNodeSchema,
13704
14011
  provenanceSessionNodeSchema,
13705
14012
  provenanceMemoryNodeSchema
13706
14013
  ]);
13707
- var provenanceEdgeSchema = z9.object({
14014
+ var provenanceEdgeSchema = z10.object({
13708
14015
  relation: provenanceEdgeRelationSchema,
13709
- from: z9.string().min(1),
14016
+ from: z10.string().min(1),
13710
14017
  fromKind: provenanceNodeKindSchema,
13711
- to: z9.string().min(1),
14018
+ to: z10.string().min(1),
13712
14019
  toKind: provenanceNodeKindSchema,
13713
- addedAt: z9.string().min(1),
13714
- summary: z9.string().optional()
14020
+ addedAt: z10.string().min(1),
14021
+ summary: z10.string().optional()
13715
14022
  });
13716
- var docProvenanceResponseSchema = z9.object({
13717
- nodes: z9.array(provenanceNodeSchema).readonly(),
13718
- edges: z9.array(provenanceEdgeSchema).readonly(),
13719
- totalNodes: z9.number().int().nonnegative(),
13720
- totalEdges: z9.number().int().nonnegative()
14023
+ var docProvenanceResponseSchema = z10.object({
14024
+ nodes: z10.array(provenanceNodeSchema).readonly(),
14025
+ edges: z10.array(provenanceEdgeSchema).readonly(),
14026
+ totalNodes: z10.number().int().nonnegative(),
14027
+ totalEdges: z10.number().int().nonnegative()
13721
14028
  });
13722
14029
 
13723
14030
  // packages/contracts/src/docs/read.ts
13724
- import { z as z10 } from "zod";
13725
- var docFrontmatterSchema = z10.object({
13726
- slug: z10.string(),
13727
- kind: z10.string().nullable(),
13728
- title: z10.string().nullable(),
13729
- summary: z10.string().nullable(),
13730
- lifecycleStatus: z10.string(),
13731
- docVersion: z10.number().int(),
13732
- ownerVersion: z10.string().nullable(),
13733
- supersedes: z10.string().nullable(),
13734
- supersededBy: z10.string().nullable(),
13735
- topics: z10.array(z10.string()).readonly(),
13736
- relatedTasks: z10.array(z10.string()).readonly(),
13737
- sha256: z10.string(),
13738
- createdAt: z10.string()
14031
+ import { z as z11 } from "zod";
14032
+ var docFrontmatterSchema = z11.object({
14033
+ slug: z11.string(),
14034
+ kind: z11.string().nullable(),
14035
+ title: z11.string().nullable(),
14036
+ summary: z11.string().nullable(),
14037
+ lifecycleStatus: z11.string(),
14038
+ docVersion: z11.number().int(),
14039
+ ownerVersion: z11.string().nullable(),
14040
+ supersedes: z11.string().nullable(),
14041
+ supersededBy: z11.string().nullable(),
14042
+ topics: z11.array(z11.string()).readonly(),
14043
+ relatedTasks: z11.array(z11.string()).readonly(),
14044
+ sha256: z11.string(),
14045
+ createdAt: z11.string()
13739
14046
  });
13740
- var docBodySchema = z10.object({
13741
- encoding: z10.enum(["utf-8", "base64"]),
13742
- text: z10.string().optional(),
13743
- base64: z10.string().optional(),
13744
- sizeBytes: z10.number().int().nonnegative(),
13745
- mimeType: z10.string().nullable()
14047
+ var docBodySchema = z11.object({
14048
+ encoding: z11.enum(["utf-8", "base64"]),
14049
+ text: z11.string().optional(),
14050
+ base64: z11.string().optional(),
14051
+ sizeBytes: z11.number().int().nonnegative(),
14052
+ mimeType: z11.string().nullable()
13746
14053
  });
13747
- var docReadResponseSchema = z10.object({
14054
+ var docReadResponseSchema = z11.object({
13748
14055
  frontmatter: docFrontmatterSchema,
13749
14056
  body: docBodySchema
13750
14057
  });
@@ -13917,7 +14224,7 @@ function getErrorMessage(error, fallback = "Unknown error") {
13917
14224
  }
13918
14225
 
13919
14226
  // packages/contracts/src/evidence-atom-schema.ts
13920
- import { z as z11 } from "zod";
14227
+ import { z as z12 } from "zod";
13921
14228
  var EVIDENCE_ATOM_KINDS = [
13922
14229
  "commit",
13923
14230
  "files",
@@ -13939,96 +14246,96 @@ var PARSER_PREFIXES = [...EVIDENCE_ATOM_KINDS, "state"];
13939
14246
  var KIND_BOUNDARY_REGEX = new RegExp(`;(?=\\s*(?:${PARSER_PREFIXES.join("|")})\\s*:)`, "g");
13940
14247
  var DEPLOY_PROVIDER_REGEX = /^[a-z0-9][a-z0-9._-]*$/;
13941
14248
  var DEPLOY_ID_REGEX = /^[^\s@|]+$/;
13942
- var commitAtomSchema = z11.object({
13943
- kind: z11.literal("commit"),
13944
- sha: z11.string().regex(/^[0-9a-f]{7,40}$/i, "commit sha must be 7-40 hex characters")
14249
+ var commitAtomSchema = z12.object({
14250
+ kind: z12.literal("commit"),
14251
+ sha: z12.string().regex(/^[0-9a-f]{7,40}$/i, "commit sha must be 7-40 hex characters")
13945
14252
  });
13946
- var filesAtomSchema = z11.object({
13947
- kind: z11.literal("files"),
13948
- paths: z11.array(z11.string().min(1)).min(1, "files atom requires at least one path")
14253
+ var filesAtomSchema = z12.object({
14254
+ kind: z12.literal("files"),
14255
+ paths: z12.array(z12.string().min(1)).min(1, "files atom requires at least one path")
13949
14256
  });
13950
- var testRunAtomSchema = z11.object({
13951
- kind: z11.literal("test-run"),
13952
- path: z11.string().min(1, "test-run atom requires a non-empty path")
14257
+ var testRunAtomSchema = z12.object({
14258
+ kind: z12.literal("test-run"),
14259
+ path: z12.string().min(1, "test-run atom requires a non-empty path")
13953
14260
  });
13954
- var qaRunAtomSchema = z11.object({
13955
- kind: z11.literal("qa-run"),
13956
- path: z11.string().min(1, "qa-run atom requires a non-empty path")
14261
+ var qaRunAtomSchema = z12.object({
14262
+ kind: z12.literal("qa-run"),
14263
+ path: z12.string().min(1, "qa-run atom requires a non-empty path")
13957
14264
  });
13958
- var toolAtomSchema = z11.object({
13959
- kind: z11.literal("tool"),
13960
- tool: z11.string().min(1, "tool atom requires a non-empty tool name")
14265
+ var toolAtomSchema = z12.object({
14266
+ kind: z12.literal("tool"),
14267
+ tool: z12.string().min(1, "tool atom requires a non-empty tool name")
13961
14268
  });
13962
- var urlAtomSchema = z11.object({
13963
- kind: z11.literal("url"),
13964
- url: z11.string().min(1).regex(/^https?:\/\//, "url atom must start with http:// or https://")
14269
+ var urlAtomSchema = z12.object({
14270
+ kind: z12.literal("url"),
14271
+ url: z12.string().min(1).regex(/^https?:\/\//, "url atom must start with http:// or https://")
13965
14272
  });
13966
- var noteAtomSchema = z11.object({
13967
- kind: z11.literal("note"),
13968
- note: z11.string().min(1, "note atom must be non-empty").max(512, "note atom is too long (max 512 chars)")
14273
+ var noteAtomSchema = z12.object({
14274
+ kind: z12.literal("note"),
14275
+ note: z12.string().min(1, "note atom must be non-empty").max(512, "note atom is too long (max 512 chars)")
13969
14276
  });
13970
- var decisionAtomSchema = z11.object({
13971
- kind: z11.literal("decision"),
13972
- decisionId: z11.string().min(1, "decision atom requires a non-empty decision ID")
14277
+ var decisionAtomSchema = z12.object({
14278
+ kind: z12.literal("decision"),
14279
+ decisionId: z12.string().min(1, "decision atom requires a non-empty decision ID")
13973
14280
  });
13974
- var prAtomSchema = z11.object({
13975
- kind: z11.literal("pr"),
13976
- prNumber: z11.number().int().positive("pr atom requires a positive integer PR number"),
13977
- componentPrNumber: z11.number().int().positive().optional(),
14281
+ var prAtomSchema = z12.object({
14282
+ kind: z12.literal("pr"),
14283
+ prNumber: z12.number().int().positive("pr atom requires a positive integer PR number"),
14284
+ componentPrNumber: z12.number().int().positive().optional(),
13978
14285
  /**
13979
14286
  * `pr:<owner>/<repo>#<n>` (T13912): the GitHub repository the PR number
13980
14287
  * belongs to, lowercased. Validated against the evidence git root's
13981
14288
  * `origin`, since PR numbers are only unique per repository.
13982
14289
  */
13983
- repo: z11.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
14290
+ repo: z12.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
13984
14291
  });
13985
- var ciAtomSchema = z11.object({
13986
- kind: z11.literal("ci"),
13987
- prNumber: z11.number().int().positive("ci atom requires a positive integer PR number"),
13988
- componentPrNumber: z11.number().int().positive().optional(),
14292
+ var ciAtomSchema = z12.object({
14293
+ kind: z12.literal("ci"),
14294
+ prNumber: z12.number().int().positive("ci atom requires a positive integer PR number"),
14295
+ componentPrNumber: z12.number().int().positive().optional(),
13989
14296
  /** `ci:<owner>/<repo>#<n>`, as for `pr:` (T13912). */
13990
- repo: z11.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
14297
+ repo: z12.string().regex(/^[a-z0-9._-]+\/[a-z0-9._-]+$/).optional()
13991
14298
  });
13992
- var ciRunAtomSchema = z11.object({
13993
- kind: z11.literal("ci-run"),
13994
- runId: z11.number().int().positive("ci-run atom requires a positive integer run id")
14299
+ var ciRunAtomSchema = z12.object({
14300
+ kind: z12.literal("ci-run"),
14301
+ runId: z12.number().int().positive("ci-run atom requires a positive integer run id")
13995
14302
  });
13996
- var deployAtomSchema = z11.object({
13997
- kind: z11.literal("deploy"),
13998
- provider: z11.string().regex(DEPLOY_PROVIDER_REGEX, "deploy atom provider must be a lowercase name"),
13999
- deploymentId: z11.string().regex(DEPLOY_ID_REGEX, "deploy atom requires a deployment id"),
14000
- sha: z11.string().regex(/^[0-9a-f]{7,40}$/, "deploy atom sha must be 7-40 lowercase hex chars"),
14001
- probeUrl: z11.string().regex(/^https?:\/\/\S+$/, "deploy atom probe url must start with http:// or https://")
14303
+ var deployAtomSchema = z12.object({
14304
+ kind: z12.literal("deploy"),
14305
+ provider: z12.string().regex(DEPLOY_PROVIDER_REGEX, "deploy atom provider must be a lowercase name"),
14306
+ deploymentId: z12.string().regex(DEPLOY_ID_REGEX, "deploy atom requires a deployment id"),
14307
+ sha: z12.string().regex(/^[0-9a-f]{7,40}$/, "deploy atom sha must be 7-40 lowercase hex chars"),
14308
+ probeUrl: z12.string().regex(/^https?:\/\/\S+$/, "deploy atom probe url must start with http:// or https://")
14002
14309
  });
14003
- var locDropAtomSchema = z11.object({
14004
- kind: z11.literal("loc-drop"),
14005
- fromLines: z11.number().int().nonnegative("loc-drop fromLines must be \u2265 0"),
14006
- toLines: z11.number().int().nonnegative("loc-drop toLines must be \u2265 0")
14310
+ var locDropAtomSchema = z12.object({
14311
+ kind: z12.literal("loc-drop"),
14312
+ fromLines: z12.number().int().nonnegative("loc-drop fromLines must be \u2265 0"),
14313
+ toLines: z12.number().int().nonnegative("loc-drop toLines must be \u2265 0")
14007
14314
  });
14008
- var callsiteCoverageAtomSchema = z11.object({
14009
- kind: z11.literal("callsite-coverage"),
14010
- symbolName: z11.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
14011
- relativeSourcePath: z11.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
14315
+ var callsiteCoverageAtomSchema = z12.object({
14316
+ kind: z12.literal("callsite-coverage"),
14317
+ symbolName: z12.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
14318
+ relativeSourcePath: z12.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
14012
14319
  });
14013
14320
  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}$/;
14014
14321
  var AC_ALIAS_REGEX = /^AC[0-9]{1,4}$/;
14015
14322
  var SATISFIES_TASK_ID_REGEX = /^T[0-9]{1,7}$/;
14016
14323
  var SATISFIES_VERSION_PIN_REGEX = /^[0-9]{14}$/;
14017
- var satisfiesAtomSchema = z11.object({
14018
- kind: z11.literal("satisfies"),
14324
+ var satisfiesAtomSchema = z12.object({
14325
+ kind: z12.literal("satisfies"),
14019
14326
  /** Target task ID — `T<1-7 digits>` per ADR-079-r2 §2.1. */
14020
- targetTaskId: z11.string().regex(SATISFIES_TASK_ID_REGEX, "satisfies atom targetTaskId must match /^T[0-9]{1,7}$/"),
14327
+ targetTaskId: z12.string().regex(SATISFIES_TASK_ID_REGEX, "satisfies atom targetTaskId must match /^T[0-9]{1,7}$/"),
14021
14328
  /** Lowercase UUIDv4/v5 — populated for the canonical form; undefined for alias form. */
14022
- targetAcId: z11.string().regex(AC_UUID_REGEX, "satisfies atom targetAcId must be a lowercase UUIDv4/v5").optional(),
14329
+ targetAcId: z12.string().regex(AC_UUID_REGEX, "satisfies atom targetAcId must be a lowercase UUIDv4/v5").optional(),
14023
14330
  /** Positional alias `AC<1-4 digits>` — populated for alias form; undefined for UUID form. */
14024
- targetAcAlias: z11.string().regex(AC_ALIAS_REGEX, "satisfies atom targetAcAlias must match /^AC[0-9]{1,4}$/").optional(),
14331
+ targetAcAlias: z12.string().regex(AC_ALIAS_REGEX, "satisfies atom targetAcAlias must match /^AC[0-9]{1,4}$/").optional(),
14025
14332
  /** Optional `@<14-digit YYYYMMDDhhmmss>` pin captured at mint time. */
14026
- versionPin: z11.string().regex(
14333
+ versionPin: z12.string().regex(
14027
14334
  SATISFIES_VERSION_PIN_REGEX,
14028
14335
  "satisfies atom versionPin must be 14 digits (YYYYMMDDhhmmss)"
14029
14336
  ).optional()
14030
14337
  });
14031
- var EvidenceAtomSchema = z11.discriminatedUnion("kind", [
14338
+ var EvidenceAtomSchema = z12.discriminatedUnion("kind", [
14032
14339
  commitAtomSchema,
14033
14340
  filesAtomSchema,
14034
14341
  testRunAtomSchema,
@@ -14090,54 +14397,54 @@ var ATOM_EXAMPLES = Object.freeze({
14090
14397
  });
14091
14398
 
14092
14399
  // packages/contracts/src/evidence-record-schema.ts
14093
- import { z as z12 } from "zod";
14094
- var evidenceBaseSchema = z12.object({
14400
+ import { z as z13 } from "zod";
14401
+ var evidenceBaseSchema = z13.object({
14095
14402
  /** Identity string of the agent that produced this record. */
14096
- agentIdentity: z12.string().min(1),
14403
+ agentIdentity: z13.string().min(1),
14097
14404
  /** SHA-256 hex digest (64 chars) of the attached artifact. */
14098
- attachmentSha256: z12.string().length(64),
14405
+ attachmentSha256: z13.string().length(64),
14099
14406
  /** ISO 8601 timestamp at which the action ran. */
14100
- ranAt: z12.string().datetime(),
14407
+ ranAt: z13.string().datetime(),
14101
14408
  /** Wall-clock duration of the action in milliseconds. */
14102
- durationMs: z12.number().nonnegative()
14409
+ durationMs: z13.number().nonnegative()
14103
14410
  });
14104
14411
  var implDiffRecordSchema = evidenceBaseSchema.extend({
14105
- kind: z12.literal("impl-diff"),
14106
- phase: z12.literal("implement"),
14107
- filesChanged: z12.array(z12.string().min(1)).min(1),
14108
- linesAdded: z12.number().int().nonnegative(),
14109
- linesRemoved: z12.number().int().nonnegative()
14412
+ kind: z13.literal("impl-diff"),
14413
+ phase: z13.literal("implement"),
14414
+ filesChanged: z13.array(z13.string().min(1)).min(1),
14415
+ linesAdded: z13.number().int().nonnegative(),
14416
+ linesRemoved: z13.number().int().nonnegative()
14110
14417
  });
14111
14418
  var validateSpecCheckRecordSchema = evidenceBaseSchema.extend({
14112
- kind: z12.literal("validate-spec-check"),
14113
- phase: z12.literal("validate"),
14114
- reqIdsChecked: z12.array(z12.string().min(1)).min(1),
14115
- passed: z12.boolean(),
14116
- details: z12.string().min(1)
14419
+ kind: z13.literal("validate-spec-check"),
14420
+ phase: z13.literal("validate"),
14421
+ reqIdsChecked: z13.array(z13.string().min(1)).min(1),
14422
+ passed: z13.boolean(),
14423
+ details: z13.string().min(1)
14117
14424
  });
14118
14425
  var testOutputRecordSchema = evidenceBaseSchema.extend({
14119
- kind: z12.literal("test-output"),
14120
- phase: z12.literal("test"),
14121
- command: z12.string().min(1),
14122
- exitCode: z12.number().int(),
14123
- testsPassed: z12.number().int().nonnegative(),
14124
- testsFailed: z12.number().int().nonnegative()
14426
+ kind: z13.literal("test-output"),
14427
+ phase: z13.literal("test"),
14428
+ command: z13.string().min(1),
14429
+ exitCode: z13.number().int(),
14430
+ testsPassed: z13.number().int().nonnegative(),
14431
+ testsFailed: z13.number().int().nonnegative()
14125
14432
  });
14126
14433
  var lintReportRecordSchema = evidenceBaseSchema.extend({
14127
- kind: z12.literal("lint-report"),
14128
- phase: z12.enum(["implement", "test"]),
14129
- tool: z12.string().min(1),
14130
- passed: z12.boolean(),
14131
- warnings: z12.number().int().nonnegative(),
14132
- errors: z12.number().int().nonnegative()
14434
+ kind: z13.literal("lint-report"),
14435
+ phase: z13.enum(["implement", "test"]),
14436
+ tool: z13.string().min(1),
14437
+ passed: z13.boolean(),
14438
+ warnings: z13.number().int().nonnegative(),
14439
+ errors: z13.number().int().nonnegative()
14133
14440
  });
14134
14441
  var commandOutputRecordSchema = evidenceBaseSchema.extend({
14135
- kind: z12.literal("command-output"),
14136
- phase: z12.enum(["implement", "validate", "test"]),
14137
- cmd: z12.string().min(1),
14138
- exitCode: z12.number().int()
14442
+ kind: z13.literal("command-output"),
14443
+ phase: z13.enum(["implement", "validate", "test"]),
14444
+ cmd: z13.string().min(1),
14445
+ exitCode: z13.number().int()
14139
14446
  });
14140
- var evidenceRecordSchema = z12.discriminatedUnion("kind", [
14447
+ var evidenceRecordSchema = z13.discriminatedUnion("kind", [
14141
14448
  implDiffRecordSchema,
14142
14449
  validateSpecCheckRecordSchema,
14143
14450
  testOutputRecordSchema,
@@ -15072,107 +15379,107 @@ var KIND_LIFECYCLE_REQUIREMENTS = Object.freeze({
15072
15379
  });
15073
15380
 
15074
15381
  // packages/contracts/src/lease-ipc/messages.ts
15075
- import { z as z13 } from "zod";
15076
- var LeaseScopeSchema = z13.enum(["project", "global"]);
15077
- var LeaseLaneSchema = z13.enum(["tasks", "brain", "bulk"]);
15078
- var LeaseAcquireRequestSchema = z13.object({
15382
+ import { z as z14 } from "zod";
15383
+ var LeaseScopeSchema = z14.enum(["project", "global"]);
15384
+ var LeaseLaneSchema = z14.enum(["tasks", "brain", "bulk"]);
15385
+ var LeaseAcquireRequestSchema = z14.object({
15079
15386
  /** Tag discriminating this request variant. */
15080
- kind: z13.literal("lease_acquire"),
15387
+ kind: z14.literal("lease_acquire"),
15081
15388
  /** The cleo.db scope being arbitrated. */
15082
15389
  scope: LeaseScopeSchema,
15083
15390
  /** The write lane within the scope. */
15084
15391
  lane: LeaseLaneSchema,
15085
15392
  /** Process+lane holder identity. */
15086
- holder_id: z13.string().min(1),
15393
+ holder_id: z14.string().min(1),
15087
15394
  /** Advisory priority — lower acquires sooner. `0` = highest. */
15088
- priority: z13.number().int().min(0).max(255),
15395
+ priority: z14.number().int().min(0).max(255),
15089
15396
  /** Lease time-to-live in milliseconds. */
15090
- ttl_ms: z13.number().int().nonnegative(),
15397
+ ttl_ms: z14.number().int().nonnegative(),
15091
15398
  /** When true, a same-holder acquire re-enters (refcount++) rather than queuing. */
15092
- reentrant: z13.boolean()
15399
+ reentrant: z14.boolean()
15093
15400
  }).strict();
15094
- var LeaseReleaseRequestSchema = z13.object({
15401
+ var LeaseReleaseRequestSchema = z14.object({
15095
15402
  /** Tag discriminating this request variant. */
15096
- kind: z13.literal("lease_release"),
15403
+ kind: z14.literal("lease_release"),
15097
15404
  /** The cleo.db scope being arbitrated. */
15098
15405
  scope: LeaseScopeSchema,
15099
15406
  /** The write lane within the scope. */
15100
15407
  lane: LeaseLaneSchema,
15101
15408
  /** Process+lane holder identity. */
15102
- holder_id: z13.string().min(1),
15409
+ holder_id: z14.string().min(1),
15103
15410
  /** The epoch fence the holder acquired — a stale epoch no-ops. */
15104
- epoch: z13.number().int().nonnegative()
15411
+ epoch: z14.number().int().nonnegative()
15105
15412
  }).strict();
15106
- var LeaseRenewRequestSchema = z13.object({
15413
+ var LeaseRenewRequestSchema = z14.object({
15107
15414
  /** Tag discriminating this request variant. */
15108
- kind: z13.literal("lease_renew"),
15415
+ kind: z14.literal("lease_renew"),
15109
15416
  /** The cleo.db scope being arbitrated. */
15110
15417
  scope: LeaseScopeSchema,
15111
15418
  /** The write lane within the scope. */
15112
15419
  lane: LeaseLaneSchema,
15113
15420
  /** Process+lane holder identity. */
15114
- holder_id: z13.string().min(1),
15421
+ holder_id: z14.string().min(1),
15115
15422
  /** The epoch fence the holder acquired (epoch-guarded renew). */
15116
- epoch: z13.number().int().nonnegative()
15423
+ epoch: z14.number().int().nonnegative()
15117
15424
  }).strict();
15118
- var RateCheckRequestSchema = z13.object({
15425
+ var RateCheckRequestSchema = z14.object({
15119
15426
  /** Tag discriminating this request variant. */
15120
- kind: z13.literal("rate_check"),
15427
+ kind: z14.literal("rate_check"),
15121
15428
  /** The cleo.db scope being checked. */
15122
15429
  scope: LeaseScopeSchema,
15123
15430
  /** The write lane within the scope. */
15124
15431
  lane: LeaseLaneSchema,
15125
15432
  /** Estimated bytes the caller intends to write. */
15126
- est_bytes: z13.number().int().nonnegative()
15433
+ est_bytes: z14.number().int().nonnegative()
15127
15434
  }).strict();
15128
- var ToolGrantRequestSchema = z13.object({
15435
+ var ToolGrantRequestSchema = z14.object({
15129
15436
  /** Tag discriminating this request variant. */
15130
- kind: z13.literal("tool_grant"),
15437
+ kind: z14.literal("tool_grant"),
15131
15438
  /** The tool name being requested. */
15132
- tool: z13.string().min(1),
15439
+ tool: z14.string().min(1),
15133
15440
  /** The requesting holder identity. */
15134
- holder_id: z13.string().min(1)
15441
+ holder_id: z14.string().min(1)
15135
15442
  }).strict();
15136
- var QueuePriorityClassSchema = z13.enum(["lead", "worker", "background"]);
15137
- var QueueAdmitRequestSchema = z13.object({
15443
+ var QueuePriorityClassSchema = z14.enum(["lead", "worker", "background"]);
15444
+ var QueueAdmitRequestSchema = z14.object({
15138
15445
  /** Tag discriminating this request variant. */
15139
- kind: z13.literal("queue_admit"),
15446
+ kind: z14.literal("queue_admit"),
15140
15447
  /** The LLM provider id the call targets (rate budget is per-provider). */
15141
- provider: z13.string().min(1),
15448
+ provider: z14.string().min(1),
15142
15449
  /** The caller's priority class (lead > worker > background). */
15143
15450
  priority_class: QueuePriorityClassSchema,
15144
15451
  /** The caller's estimate of the request's token cost (debited on admit). */
15145
- est_tokens: z13.number().int().nonnegative(),
15452
+ est_tokens: z14.number().int().nonnegative(),
15146
15453
  /** The child the call belongs to (in-flight tracking — the watchdog seam). */
15147
- child_id: z13.string().min(1)
15454
+ child_id: z14.string().min(1)
15148
15455
  }).strict();
15149
- var WorkerHeartbeatRequestSchema = z13.object({
15456
+ var WorkerHeartbeatRequestSchema = z14.object({
15150
15457
  /** Tag discriminating this request variant. */
15151
- kind: z13.literal("worker_heartbeat"),
15458
+ kind: z14.literal("worker_heartbeat"),
15152
15459
  /** The logical id of the heartbeating child (matches the registry key). */
15153
- child_id: z13.string().min(1),
15460
+ child_id: z14.string().min(1),
15154
15461
  /** The worker's own view of whether it is currently inside an LLM call. */
15155
- in_flight_llm: z13.boolean()
15462
+ in_flight_llm: z14.boolean()
15156
15463
  }).strict();
15157
- var ResourceAdmitRequestSchema = z13.object({
15464
+ var ResourceAdmitRequestSchema = z14.object({
15158
15465
  /** Tag discriminating this request variant. */
15159
- kind: z13.literal("resource_admit"),
15466
+ kind: z14.literal("resource_admit"),
15160
15467
  /** The resource class (e.g. `"db-heavy"`, `"full-build"`, `"test-run"`). */
15161
- class: z13.string().min(1),
15468
+ class: z14.string().min(1),
15162
15469
  /** The caller holding the slot — process/worktree-unique; the release key. */
15163
- holder_id: z13.string().min(1),
15470
+ holder_id: z14.string().min(1),
15164
15471
  /** The client-computed budget: the max concurrent holders for this class. */
15165
- budget: z13.number().int().nonnegative()
15472
+ budget: z14.number().int().nonnegative()
15166
15473
  }).strict();
15167
- var ResourceReleaseRequestSchema = z13.object({
15474
+ var ResourceReleaseRequestSchema = z14.object({
15168
15475
  /** Tag discriminating this request variant. */
15169
- kind: z13.literal("resource_release"),
15476
+ kind: z14.literal("resource_release"),
15170
15477
  /** The resource class the slot belongs to. */
15171
- class: z13.string().min(1),
15478
+ class: z14.string().min(1),
15172
15479
  /** The holder that was admitted (matches the admit `holder_id`). */
15173
- holder_id: z13.string().min(1)
15480
+ holder_id: z14.string().min(1)
15174
15481
  }).strict();
15175
- var LeaseIpcRequestSchema = z13.discriminatedUnion("kind", [
15482
+ var LeaseIpcRequestSchema = z14.discriminatedUnion("kind", [
15176
15483
  LeaseAcquireRequestSchema,
15177
15484
  LeaseReleaseRequestSchema,
15178
15485
  LeaseRenewRequestSchema,
@@ -15183,133 +15490,133 @@ var LeaseIpcRequestSchema = z13.discriminatedUnion("kind", [
15183
15490
  ResourceAdmitRequestSchema,
15184
15491
  ResourceReleaseRequestSchema
15185
15492
  ]);
15186
- var LeaseGrantedResponseSchema = z13.object({
15493
+ var LeaseGrantedResponseSchema = z14.object({
15187
15494
  /** Tag discriminating this response variant. */
15188
- kind: z13.literal("lease_granted"),
15495
+ kind: z14.literal("lease_granted"),
15189
15496
  /** The granted cleo.db scope. */
15190
15497
  scope: LeaseScopeSchema,
15191
15498
  /** The granted write lane. */
15192
15499
  lane: LeaseLaneSchema,
15193
15500
  /** The holder the lease was granted to. */
15194
- holder_id: z13.string().min(1),
15501
+ holder_id: z14.string().min(1),
15195
15502
  /** The monotonic epoch fence assigned to this grant. */
15196
- epoch: z13.number().int().nonnegative(),
15503
+ epoch: z14.number().int().nonnegative(),
15197
15504
  /** The lease TTL in milliseconds. */
15198
- ttl_ms: z13.number().int().nonnegative(),
15505
+ ttl_ms: z14.number().int().nonnegative(),
15199
15506
  /** Absolute expiry timestamp (epoch ms) for this grant. */
15200
- expires_at_ms: z13.number().int().nonnegative()
15507
+ expires_at_ms: z14.number().int().nonnegative()
15201
15508
  }).strict();
15202
- var LeaseQueuedResponseSchema = z13.object({
15509
+ var LeaseQueuedResponseSchema = z14.object({
15203
15510
  /** Tag discriminating this response variant. */
15204
- kind: z13.literal("lease_queued"),
15511
+ kind: z14.literal("lease_queued"),
15205
15512
  /** The queued cleo.db scope. */
15206
15513
  scope: LeaseScopeSchema,
15207
15514
  /** The queued write lane. */
15208
15515
  lane: LeaseLaneSchema,
15209
15516
  /** The monotonic ticket assigned for FIFO tiebreak. */
15210
- ticket: z13.number().int().nonnegative(),
15517
+ ticket: z14.number().int().nonnegative(),
15211
15518
  /** Number of waiters ahead of this one. */
15212
- ahead: z13.number().int().nonnegative()
15519
+ ahead: z14.number().int().nonnegative()
15213
15520
  }).strict();
15214
- var LeaseDeniedResponseSchema = z13.object({
15521
+ var LeaseDeniedResponseSchema = z14.object({
15215
15522
  /** Tag discriminating this response variant. */
15216
- kind: z13.literal("lease_denied"),
15523
+ kind: z14.literal("lease_denied"),
15217
15524
  /** The denied cleo.db scope. */
15218
15525
  scope: LeaseScopeSchema,
15219
15526
  /** Machine-readable denial code (e.g. `E_LEASE_UNAVAILABLE`). */
15220
- code: z13.string().min(1),
15527
+ code: z14.string().min(1),
15221
15528
  /** Human-readable denial message. */
15222
- message: z13.string()
15529
+ message: z14.string()
15223
15530
  }).strict();
15224
- var RateResultResponseSchema = z13.object({
15531
+ var RateResultResponseSchema = z14.object({
15225
15532
  /** Tag discriminating this response variant. */
15226
- kind: z13.literal("rate_result"),
15533
+ kind: z14.literal("rate_result"),
15227
15534
  /** The checked cleo.db scope. */
15228
15535
  scope: LeaseScopeSchema,
15229
15536
  /** Whether the write is within budget. */
15230
- ok: z13.boolean(),
15537
+ ok: z14.boolean(),
15231
15538
  /** Suggested back-off in milliseconds when `ok` is false. */
15232
- retry_after_ms: z13.number().int().nonnegative(),
15539
+ retry_after_ms: z14.number().int().nonnegative(),
15233
15540
  /** Remaining token budget for the scope. */
15234
- tokens_remaining: z13.number().int().nonnegative()
15541
+ tokens_remaining: z14.number().int().nonnegative()
15235
15542
  }).strict();
15236
- var ToolGrantedResponseSchema = z13.object({
15543
+ var ToolGrantedResponseSchema = z14.object({
15237
15544
  /** Tag discriminating this response variant. */
15238
- kind: z13.literal("tool_granted"),
15545
+ kind: z14.literal("tool_granted"),
15239
15546
  /** The granted tool name. */
15240
- tool: z13.string().min(1),
15547
+ tool: z14.string().min(1),
15241
15548
  /** The holder the tool grant was issued to. */
15242
- holder_id: z13.string().min(1)
15549
+ holder_id: z14.string().min(1)
15243
15550
  }).strict();
15244
- var LeaseRevokedResponseSchema = z13.object({
15551
+ var LeaseRevokedResponseSchema = z14.object({
15245
15552
  /** Tag discriminating this response variant. */
15246
- kind: z13.literal("lease_revoked"),
15553
+ kind: z14.literal("lease_revoked"),
15247
15554
  /** The revoked cleo.db scope. */
15248
15555
  scope: LeaseScopeSchema,
15249
15556
  /** The revoked write lane. */
15250
15557
  lane: LeaseLaneSchema,
15251
15558
  /** The holder whose lease was revoked. */
15252
- holder_id: z13.string().min(1),
15559
+ holder_id: z14.string().min(1),
15253
15560
  /** Human-readable reason for the revocation. */
15254
- reason: z13.string()
15561
+ reason: z14.string()
15255
15562
  }).strict();
15256
- var ChildKilledUnresponsiveResponseSchema = z13.object({
15563
+ var ChildKilledUnresponsiveResponseSchema = z14.object({
15257
15564
  /** Tag discriminating this response variant. */
15258
- kind: z13.literal("child_killed_unresponsive"),
15565
+ kind: z14.literal("child_killed_unresponsive"),
15259
15566
  /** Logical id of the killed child. */
15260
- child_id: z13.string().min(1),
15567
+ child_id: z14.string().min(1),
15261
15568
  /** The holder identity the killed child held the lease as. */
15262
- holder_id: z13.string().min(1),
15569
+ holder_id: z14.string().min(1),
15263
15570
  /** The cleo.db scope the killed child held the lease in. */
15264
15571
  scope: LeaseScopeSchema,
15265
15572
  /** Human-readable reason for the kill. */
15266
- reason: z13.string()
15573
+ reason: z14.string()
15267
15574
  }).strict();
15268
- var QueueAdmitDispositionSchema = z13.enum(["admitted", "deferred"]);
15269
- var QueueAdmitResultResponseSchema = z13.object({
15575
+ var QueueAdmitDispositionSchema = z14.enum(["admitted", "deferred"]);
15576
+ var QueueAdmitResultResponseSchema = z14.object({
15270
15577
  /** Tag discriminating this response variant. */
15271
- kind: z13.literal("queue_admit_result"),
15578
+ kind: z14.literal("queue_admit_result"),
15272
15579
  /** Whether the LLM call was admitted or deferred. */
15273
15580
  disposition: QueueAdmitDispositionSchema,
15274
15581
  /** Back-off in ms before re-requesting (0 when admitted). */
15275
- retry_after_ms: z13.number().int().nonnegative(),
15582
+ retry_after_ms: z14.number().int().nonnegative(),
15276
15583
  /** Remaining provider token budget after this decision. */
15277
- tokens_remaining: z13.number().int().nonnegative(),
15584
+ tokens_remaining: z14.number().int().nonnegative(),
15278
15585
  /** Number of higher/equal-priority waiters ahead (0 when admitted). */
15279
- queue_position: z13.number().int().nonnegative()
15586
+ queue_position: z14.number().int().nonnegative()
15280
15587
  }).strict();
15281
- var HeartbeatAckResponseSchema = z13.object({
15588
+ var HeartbeatAckResponseSchema = z14.object({
15282
15589
  /** Tag discriminating this response variant. */
15283
- kind: z13.literal("heartbeat_ack")
15590
+ kind: z14.literal("heartbeat_ack")
15284
15591
  }).strict();
15285
- var ResourceAdmitDispositionSchema = z13.enum(["admitted", "deferred"]);
15286
- var ResourceAdmitResultResponseSchema = z13.object({
15592
+ var ResourceAdmitDispositionSchema = z14.enum(["admitted", "deferred"]);
15593
+ var ResourceAdmitResultResponseSchema = z14.object({
15287
15594
  /** Tag discriminating this response variant. */
15288
- kind: z13.literal("resource_admit_result"),
15595
+ kind: z14.literal("resource_admit_result"),
15289
15596
  /** Whether the heavy op was admitted or deferred. */
15290
15597
  disposition: ResourceAdmitDispositionSchema,
15291
15598
  /** Back-off in ms before re-requesting (0 when admitted). */
15292
- retry_after_ms: z13.number().int().nonnegative(),
15599
+ retry_after_ms: z14.number().int().nonnegative(),
15293
15600
  /** Remaining slots for the class after this decision. */
15294
- slots_remaining: z13.number().int().nonnegative()
15601
+ slots_remaining: z14.number().int().nonnegative()
15295
15602
  }).strict();
15296
- var ResourceReleaseResultResponseSchema = z13.object({
15603
+ var ResourceReleaseResultResponseSchema = z14.object({
15297
15604
  /** Tag discriminating this response variant. */
15298
- kind: z13.literal("resource_release_result"),
15605
+ kind: z14.literal("resource_release_result"),
15299
15606
  /** Whether a held slot was actually released (false = no such holder). */
15300
- released: z13.boolean(),
15607
+ released: z14.boolean(),
15301
15608
  /** Remaining in-flight holders for the class after the release. */
15302
- slots_remaining: z13.number().int().nonnegative()
15609
+ slots_remaining: z14.number().int().nonnegative()
15303
15610
  }).strict();
15304
- var LeaseErrorResponseSchema = z13.object({
15611
+ var LeaseErrorResponseSchema = z14.object({
15305
15612
  /** Tag discriminating this response variant. */
15306
- kind: z13.literal("error"),
15613
+ kind: z14.literal("error"),
15307
15614
  /** Machine-readable error code (e.g. `E_LEASE_BAD_VERSION`, `E_LEASE_UNIMPLEMENTED`). */
15308
- code: z13.string().min(1),
15615
+ code: z14.string().min(1),
15309
15616
  /** Human-readable error message. */
15310
- message: z13.string()
15617
+ message: z14.string()
15311
15618
  }).strict();
15312
- var LeaseIpcResponseSchema = z13.discriminatedUnion("kind", [
15619
+ var LeaseIpcResponseSchema = z14.discriminatedUnion("kind", [
15313
15620
  LeaseGrantedResponseSchema,
15314
15621
  LeaseQueuedResponseSchema,
15315
15622
  LeaseDeniedResponseSchema,
@@ -15323,27 +15630,27 @@ var LeaseIpcResponseSchema = z13.discriminatedUnion("kind", [
15323
15630
  ResourceReleaseResultResponseSchema,
15324
15631
  LeaseErrorResponseSchema
15325
15632
  ]);
15326
- var LeaseIpcRequestEnvelopeSchema = z13.object({
15633
+ var LeaseIpcRequestEnvelopeSchema = z14.object({
15327
15634
  /** Parallel protocol version. */
15328
- protocol_version: z13.string(),
15635
+ protocol_version: z14.string(),
15329
15636
  /** Correlation id echoed back on the matching response. */
15330
- id: z13.string().min(1),
15637
+ id: z14.string().min(1),
15331
15638
  /** Direction discriminator. */
15332
- direction: z13.literal("request"),
15639
+ direction: z14.literal("request"),
15333
15640
  /** The request body. */
15334
15641
  request: LeaseIpcRequestSchema
15335
15642
  }).strict();
15336
- var LeaseIpcResponseEnvelopeSchema = z13.object({
15643
+ var LeaseIpcResponseEnvelopeSchema = z14.object({
15337
15644
  /** Parallel protocol version. */
15338
- protocol_version: z13.string(),
15645
+ protocol_version: z14.string(),
15339
15646
  /** Correlation id echoed from the originating request (or a fresh id for events). */
15340
- id: z13.string().min(1),
15647
+ id: z14.string().min(1),
15341
15648
  /** Direction discriminator. */
15342
- direction: z13.literal("response"),
15649
+ direction: z14.literal("response"),
15343
15650
  /** The response body. */
15344
15651
  response: LeaseIpcResponseSchema
15345
15652
  }).strict();
15346
- var LeaseIpcEnvelopeSchema = z13.discriminatedUnion("direction", [
15653
+ var LeaseIpcEnvelopeSchema = z14.discriminatedUnion("direction", [
15347
15654
  LeaseIpcRequestEnvelopeSchema,
15348
15655
  LeaseIpcResponseEnvelopeSchema
15349
15656
  ]);
@@ -15378,7 +15685,7 @@ var LEASE_IPC_MESSAGE_KINDS = [
15378
15685
  ];
15379
15686
 
15380
15687
  // packages/contracts/src/llm/catalog-schema.ts
15381
- import { z as z14 } from "zod";
15688
+ import { z as z15 } from "zod";
15382
15689
  var CATALOG_MODEL_STATUSES = [
15383
15690
  "stable",
15384
15691
  "beta",
@@ -15387,78 +15694,78 @@ var CATALOG_MODEL_STATUSES = [
15387
15694
  "retired"
15388
15695
  ];
15389
15696
  var CATALOG_AUTH_TYPES = ["api_key", "oauth", "bedrock", "vertex"];
15390
- var isoDate = z14.string().regex(/^\d{4}-\d{2}-\d{2}$/, "must be an ISO date (YYYY-MM-DD)");
15391
- var semver = z14.string().regex(/^\d+\.\d+\.\d+$/, "must be semver (MAJOR.MINOR.PATCH)");
15392
- var catalogModalitiesSchema = z14.object({
15393
- input: z14.array(z14.string()),
15394
- output: z14.array(z14.string())
15697
+ var isoDate = z15.string().regex(/^\d{4}-\d{2}-\d{2}$/, "must be an ISO date (YYYY-MM-DD)");
15698
+ var semver = z15.string().regex(/^\d+\.\d+\.\d+$/, "must be semver (MAJOR.MINOR.PATCH)");
15699
+ var catalogModalitiesSchema = z15.object({
15700
+ input: z15.array(z15.string()),
15701
+ output: z15.array(z15.string())
15395
15702
  }).strict();
15396
- var catalogCostSchema = z14.object({
15397
- input: z14.number().optional(),
15398
- output: z14.number().optional(),
15399
- cache_read: z14.number().optional(),
15400
- cache_write: z14.number().optional(),
15401
- context_over_200k: z14.number().optional()
15703
+ var catalogCostSchema = z15.object({
15704
+ input: z15.number().optional(),
15705
+ output: z15.number().optional(),
15706
+ cache_read: z15.number().optional(),
15707
+ cache_write: z15.number().optional(),
15708
+ context_over_200k: z15.number().optional()
15402
15709
  }).strict();
15403
- var catalogLimitSchema = z14.object({
15404
- context: z14.number(),
15405
- output: z14.number()
15710
+ var catalogLimitSchema = z15.object({
15711
+ context: z15.number(),
15712
+ output: z15.number()
15406
15713
  }).strict();
15407
- var catalogModelProviderSchema = z14.object({
15408
- npm: z14.string(),
15409
- api: z14.string()
15714
+ var catalogModelProviderSchema = z15.object({
15715
+ npm: z15.string(),
15716
+ api: z15.string()
15410
15717
  }).strict();
15411
- var catalogModelEntrySchema = z14.object({
15412
- id: z14.string(),
15413
- name: z14.string(),
15414
- family: z14.string(),
15415
- attachment: z14.boolean(),
15416
- reasoning: z14.boolean(),
15417
- temperature: z14.boolean(),
15418
- interleaved: z14.boolean(),
15419
- tool_call: z14.boolean(),
15718
+ var catalogModelEntrySchema = z15.object({
15719
+ id: z15.string(),
15720
+ name: z15.string(),
15721
+ family: z15.string(),
15722
+ attachment: z15.boolean(),
15723
+ reasoning: z15.boolean(),
15724
+ temperature: z15.boolean(),
15725
+ interleaved: z15.boolean(),
15726
+ tool_call: z15.boolean(),
15420
15727
  modalities: catalogModalitiesSchema,
15421
15728
  cost: catalogCostSchema,
15422
15729
  limit: catalogLimitSchema,
15423
- status: z14.enum(CATALOG_MODEL_STATUSES),
15730
+ status: z15.enum(CATALOG_MODEL_STATUSES),
15424
15731
  release_date: isoDate,
15425
15732
  provider: catalogModelProviderSchema
15426
15733
  }).strict();
15427
- var catalogProviderSchema = z14.object({
15428
- id: z14.string(),
15429
- endpoint: z14.string(),
15430
- authTypes: z14.array(z14.enum(CATALOG_AUTH_TYPES)).min(1),
15431
- npm: z14.string().optional()
15734
+ var catalogProviderSchema = z15.object({
15735
+ id: z15.string(),
15736
+ endpoint: z15.string(),
15737
+ authTypes: z15.array(z15.enum(CATALOG_AUTH_TYPES)).min(1),
15738
+ npm: z15.string().optional()
15432
15739
  }).strict();
15433
- var curatedCatalogSchema = z14.object({
15434
- $schema: z14.string().optional(),
15740
+ var curatedCatalogSchema = z15.object({
15741
+ $schema: z15.string().optional(),
15435
15742
  version: semver,
15436
15743
  lastUpdated: isoDate,
15437
- providers: z14.record(z14.string(), catalogProviderSchema),
15438
- models: z14.record(z14.string(), z14.record(z14.string(), catalogModelEntrySchema))
15744
+ providers: z15.record(z15.string(), catalogProviderSchema),
15745
+ models: z15.record(z15.string(), z15.record(z15.string(), catalogModelEntrySchema))
15439
15746
  }).strict();
15440
- var modelsCatalogRowInsertSchema = z14.object({
15441
- id: z14.string(),
15442
- providerId: z14.string(),
15443
- name: z14.string(),
15444
- family: z14.string(),
15445
- attachment: z14.boolean(),
15446
- reasoning: z14.boolean(),
15447
- temperature: z14.boolean(),
15448
- interleaved: z14.boolean(),
15449
- toolCall: z14.boolean(),
15450
- modalities: z14.string(),
15451
- cost: z14.string(),
15452
- contextLimit: z14.number().nullable().optional(),
15453
- outputLimit: z14.number().nullable().optional(),
15454
- status: z14.enum(CATALOG_MODEL_STATUSES),
15747
+ var modelsCatalogRowInsertSchema = z15.object({
15748
+ id: z15.string(),
15749
+ providerId: z15.string(),
15750
+ name: z15.string(),
15751
+ family: z15.string(),
15752
+ attachment: z15.boolean(),
15753
+ reasoning: z15.boolean(),
15754
+ temperature: z15.boolean(),
15755
+ interleaved: z15.boolean(),
15756
+ toolCall: z15.boolean(),
15757
+ modalities: z15.string(),
15758
+ cost: z15.string(),
15759
+ contextLimit: z15.number().nullable().optional(),
15760
+ outputLimit: z15.number().nullable().optional(),
15761
+ status: z15.enum(CATALOG_MODEL_STATUSES),
15455
15762
  releaseDate: isoDate,
15456
- modelsDevId: z14.string(),
15457
- source: z14.string(),
15458
- seededAt: z14.string().optional()
15763
+ modelsDevId: z15.string(),
15764
+ source: z15.string(),
15765
+ seededAt: z15.string().optional()
15459
15766
  }).strict();
15460
15767
  var modelsCatalogRowSelectSchema = modelsCatalogRowInsertSchema.extend({
15461
- seededAt: z14.string()
15768
+ seededAt: z15.string()
15462
15769
  });
15463
15770
 
15464
15771
  // packages/contracts/src/llm/system-of-use.ts
@@ -15506,7 +15813,7 @@ var BUILTIN_SYSTEMS_OF_USE = [
15506
15813
  ];
15507
15814
 
15508
15815
  // packages/contracts/src/workgraph.ts
15509
- import { z as z15 } from "zod";
15816
+ import { z as z16 } from "zod";
15510
15817
 
15511
15818
  // packages/contracts/src/status-registry.ts
15512
15819
  var TASK_STATUSES = [
@@ -15521,10 +15828,10 @@ var TASK_STATUSES = [
15521
15828
 
15522
15829
  // packages/contracts/src/workgraph.ts
15523
15830
  var E_WORKGRAPH_PARENT_TYPE_MATRIX = "E_WORKGRAPH_PARENT_TYPE_MATRIX";
15524
- var taskTypeSchema = z15.enum(["saga", "epic", "task", "subtask"]);
15525
- var taskPrioritySchema = z15.enum(["critical", "high", "medium", "low"]);
15526
- var taskStatusSchema = z15.enum(TASK_STATUSES);
15527
- var verificationGateSchema = z15.enum([
15831
+ var taskTypeSchema = z16.enum(["saga", "epic", "task", "subtask"]);
15832
+ var taskPrioritySchema = z16.enum(["critical", "high", "medium", "low"]);
15833
+ var taskStatusSchema = z16.enum(TASK_STATUSES);
15834
+ var verificationGateSchema = z16.enum([
15528
15835
  "implemented",
15529
15836
  "testsPassed",
15530
15837
  "qaPassed",
@@ -15533,7 +15840,7 @@ var verificationGateSchema = z15.enum([
15533
15840
  "documented",
15534
15841
  "nexusImpact"
15535
15842
  ]);
15536
- var workGraphRelationKindSchema = z15.enum([
15843
+ var workGraphRelationKindSchema = z16.enum([
15537
15844
  "contains",
15538
15845
  "depends_on",
15539
15846
  "blocks",
@@ -15541,317 +15848,317 @@ var workGraphRelationKindSchema = z15.enum([
15541
15848
  "groups",
15542
15849
  "satisfies"
15543
15850
  ]);
15544
- var workGraphTraversalDirectionSchema = z15.enum([
15851
+ var workGraphTraversalDirectionSchema = z16.enum([
15545
15852
  "ancestors",
15546
15853
  "descendants",
15547
15854
  "upstream",
15548
15855
  "downstream"
15549
15856
  ]);
15550
- var workGraphEdgeDirectionSchema = z15.enum(["out", "in", "both"]);
15551
- var paginationParamsSchema = z15.object({
15552
- cursor: z15.string().min(1).optional(),
15553
- limit: z15.number().int().positive().max(500).optional()
15857
+ var workGraphEdgeDirectionSchema = z16.enum(["out", "in", "both"]);
15858
+ var paginationParamsSchema = z16.object({
15859
+ cursor: z16.string().min(1).optional(),
15860
+ limit: z16.number().int().positive().max(500).optional()
15554
15861
  });
15555
- var workGraphNodeSchema = z15.object({
15556
- id: z15.string().min(1),
15862
+ var workGraphNodeSchema = z16.object({
15863
+ id: z16.string().min(1),
15557
15864
  type: taskTypeSchema,
15558
- title: z15.string(),
15865
+ title: z16.string(),
15559
15866
  status: taskStatusSchema,
15560
15867
  priority: taskPrioritySchema,
15561
- parentId: z15.string().min(1).optional()
15868
+ parentId: z16.string().min(1).optional()
15562
15869
  });
15563
- var workGraphEdgeSchema = z15.object({
15564
- fromId: z15.string().min(1),
15565
- toId: z15.string().min(1),
15870
+ var workGraphEdgeSchema = z16.object({
15871
+ fromId: z16.string().min(1),
15872
+ toId: z16.string().min(1),
15566
15873
  kind: workGraphRelationKindSchema
15567
15874
  });
15568
- var workGraphHierarchyEdgeSchema = z15.object({
15569
- fromId: z15.string().min(1),
15570
- toId: z15.string().min(1),
15571
- kind: z15.literal("contains")
15875
+ var workGraphHierarchyEdgeSchema = z16.object({
15876
+ fromId: z16.string().min(1),
15877
+ toId: z16.string().min(1),
15878
+ kind: z16.literal("contains")
15572
15879
  }).strict();
15573
- var workGraphPageInfoSchema = z15.object({
15574
- nextCursor: z15.string().min(1).optional(),
15575
- hasMore: z15.boolean()
15880
+ var workGraphPageInfoSchema = z16.object({
15881
+ nextCursor: z16.string().min(1).optional(),
15882
+ hasMore: z16.boolean()
15576
15883
  });
15577
- var workGraphRollupCountsSchema = z15.object({
15578
- total: z15.number().int().nonnegative(),
15579
- byStatus: z15.partialRecord(taskStatusSchema, z15.number().int().nonnegative()),
15580
- byType: z15.partialRecord(taskTypeSchema, z15.number().int().nonnegative())
15884
+ var workGraphRollupCountsSchema = z16.object({
15885
+ total: z16.number().int().nonnegative(),
15886
+ byStatus: z16.partialRecord(taskStatusSchema, z16.number().int().nonnegative()),
15887
+ byType: z16.partialRecord(taskTypeSchema, z16.number().int().nonnegative())
15581
15888
  });
15582
- var workGraphSubtreePercentagesSchema = z15.object({
15583
- done: z15.number().nonnegative(),
15584
- active: z15.number().nonnegative(),
15585
- blocked: z15.number().nonnegative(),
15586
- pending: z15.number().nonnegative(),
15587
- cancelled: z15.number().nonnegative()
15889
+ var workGraphSubtreePercentagesSchema = z16.object({
15890
+ done: z16.number().nonnegative(),
15891
+ active: z16.number().nonnegative(),
15892
+ blocked: z16.number().nonnegative(),
15893
+ pending: z16.number().nonnegative(),
15894
+ cancelled: z16.number().nonnegative()
15588
15895
  });
15589
- var workGraphProjectionMismatchSchema = z15.object({
15590
- field: z15.string().min(1),
15591
- expected: z15.number().int().nonnegative(),
15592
- actual: z15.number().int().nonnegative()
15896
+ var workGraphProjectionMismatchSchema = z16.object({
15897
+ field: z16.string().min(1),
15898
+ expected: z16.number().int().nonnegative(),
15899
+ actual: z16.number().int().nonnegative()
15593
15900
  });
15594
15901
  var workGraphReadyFrontierTaskSchema = workGraphNodeSchema.extend({
15595
- role: z15.string().min(1).optional(),
15596
- dependencyBlockers: z15.array(z15.object({ taskId: z15.string().min(1), status: taskStatusSchema })),
15597
- gateBlockers: z15.array(z15.object({ gate: verificationGateSchema }))
15902
+ role: z16.string().min(1).optional(),
15903
+ dependencyBlockers: z16.array(z16.object({ taskId: z16.string().min(1), status: taskStatusSchema })),
15904
+ gateBlockers: z16.array(z16.object({ gate: verificationGateSchema }))
15598
15905
  });
15599
15906
  var workGraphRelationEdgeSchema = workGraphEdgeSchema.extend({
15600
- source: z15.literal("relation"),
15601
- relationType: z15.enum(TASK_RELATION_TYPES),
15602
- reason: z15.string().min(1).optional()
15907
+ source: z16.literal("relation"),
15908
+ relationType: z16.enum(TASK_RELATION_TYPES),
15909
+ reason: z16.string().min(1).optional()
15603
15910
  });
15604
15911
  var workGraphDependencyEdgeSchema = workGraphEdgeSchema.extend({
15605
- source: z15.literal("dependency"),
15606
- kind: z15.literal("depends_on")
15912
+ source: z16.literal("dependency"),
15913
+ kind: z16.literal("depends_on")
15607
15914
  });
15608
- var workGraphOmissionReasonSchema = z15.enum([
15915
+ var workGraphOmissionReasonSchema = z16.enum([
15609
15916
  "budget_exceeded",
15610
15917
  "not_requested",
15611
15918
  "not_available",
15612
15919
  "redacted",
15613
15920
  "truncated"
15614
15921
  ]);
15615
- var workGraphContextBudgetSchema = z15.object({
15616
- tokenBudget: z15.number().int().nonnegative(),
15617
- estimatedTokens: z15.number().int().nonnegative(),
15618
- remainingTokens: z15.number().int().nonnegative(),
15619
- truncated: z15.boolean()
15922
+ var workGraphContextBudgetSchema = z16.object({
15923
+ tokenBudget: z16.number().int().nonnegative(),
15924
+ estimatedTokens: z16.number().int().nonnegative(),
15925
+ remainingTokens: z16.number().int().nonnegative(),
15926
+ truncated: z16.boolean()
15620
15927
  });
15621
- var workGraphOmissionSchema = z15.object({
15622
- path: z15.string().min(1),
15928
+ var workGraphOmissionSchema = z16.object({
15929
+ path: z16.string().min(1),
15623
15930
  reason: workGraphOmissionReasonSchema,
15624
- message: z15.string().min(1),
15625
- estimatedTokens: z15.number().int().nonnegative().optional()
15931
+ message: z16.string().min(1),
15932
+ estimatedTokens: z16.number().int().nonnegative().optional()
15626
15933
  });
15627
- var workGraphDirectEdgeSchema = z15.discriminatedUnion("source", [
15934
+ var workGraphDirectEdgeSchema = z16.discriminatedUnion("source", [
15628
15935
  workGraphRelationEdgeSchema,
15629
15936
  workGraphDependencyEdgeSchema
15630
15937
  ]);
15631
15938
  var workGraphContextPackParamsSchema = paginationParamsSchema.extend({
15632
- rootId: z15.string().min(1),
15633
- tokenBudget: z15.number().int().positive().optional(),
15634
- includeRelations: z15.boolean().optional(),
15635
- includeReadiness: z15.boolean().optional(),
15636
- includeRollup: z15.boolean().optional()
15939
+ rootId: z16.string().min(1),
15940
+ tokenBudget: z16.number().int().positive().optional(),
15941
+ includeRelations: z16.boolean().optional(),
15942
+ includeReadiness: z16.boolean().optional(),
15943
+ includeRollup: z16.boolean().optional()
15637
15944
  });
15638
15945
  var workGraphSliceParamsSchema = paginationParamsSchema.extend({
15639
- rootId: z15.string().min(1),
15946
+ rootId: z16.string().min(1),
15640
15947
  direction: workGraphTraversalDirectionSchema.optional(),
15641
- maxDepth: z15.number().int().nonnegative().optional(),
15642
- includeRelations: z15.boolean().optional()
15948
+ maxDepth: z16.number().int().nonnegative().optional(),
15949
+ includeRelations: z16.boolean().optional()
15643
15950
  });
15644
- var workGraphSliceSchema = z15.object({
15645
- rootId: z15.string().min(1),
15951
+ var workGraphSliceSchema = z16.object({
15952
+ rootId: z16.string().min(1),
15646
15953
  direction: workGraphTraversalDirectionSchema,
15647
- nodes: z15.array(workGraphNodeSchema),
15648
- edges: z15.array(workGraphEdgeSchema),
15954
+ nodes: z16.array(workGraphNodeSchema),
15955
+ edges: z16.array(workGraphEdgeSchema),
15649
15956
  pageInfo: workGraphPageInfoSchema,
15650
- omissions: z15.array(workGraphOmissionSchema).optional()
15957
+ omissions: z16.array(workGraphOmissionSchema).optional()
15651
15958
  });
15652
- var workGraphReadinessParamsSchema = z15.object({
15653
- rootId: z15.string().min(1),
15654
- role: z15.string().min(1).optional(),
15655
- includeGateBlockers: z15.boolean().optional()
15959
+ var workGraphReadinessParamsSchema = z16.object({
15960
+ rootId: z16.string().min(1),
15961
+ role: z16.string().min(1).optional(),
15962
+ includeGateBlockers: z16.boolean().optional()
15656
15963
  });
15657
- var workGraphReadinessResultSchema = z15.object({
15658
- rootId: z15.string().min(1),
15659
- role: z15.string().min(1).optional(),
15660
- ready: z15.boolean(),
15661
- warnings: z15.array(z15.string()),
15662
- groups: z15.object({
15663
- ready: z15.array(workGraphReadyFrontierTaskSchema),
15664
- blocked: z15.array(workGraphReadyFrontierTaskSchema),
15665
- blockedBy: z15.array(
15666
- z15.discriminatedUnion("kind", [
15667
- z15.object({
15668
- kind: z15.literal("dependency"),
15669
- blockerId: z15.string().min(1),
15670
- blocks: z15.array(z15.string().min(1))
15964
+ var workGraphReadinessResultSchema = z16.object({
15965
+ rootId: z16.string().min(1),
15966
+ role: z16.string().min(1).optional(),
15967
+ ready: z16.boolean(),
15968
+ warnings: z16.array(z16.string()),
15969
+ groups: z16.object({
15970
+ ready: z16.array(workGraphReadyFrontierTaskSchema),
15971
+ blocked: z16.array(workGraphReadyFrontierTaskSchema),
15972
+ blockedBy: z16.array(
15973
+ z16.discriminatedUnion("kind", [
15974
+ z16.object({
15975
+ kind: z16.literal("dependency"),
15976
+ blockerId: z16.string().min(1),
15977
+ blocks: z16.array(z16.string().min(1))
15671
15978
  }),
15672
- z15.object({
15673
- kind: z15.literal("gate"),
15979
+ z16.object({
15980
+ kind: z16.literal("gate"),
15674
15981
  gate: verificationGateSchema,
15675
- blocks: z15.array(z15.string().min(1))
15982
+ blocks: z16.array(z16.string().min(1))
15676
15983
  })
15677
15984
  ])
15678
15985
  )
15679
15986
  })
15680
15987
  });
15681
- var workGraphContextPackSchema = z15.object({
15682
- rootId: z15.string().min(1),
15683
- generatedAt: z15.string().min(1),
15988
+ var workGraphContextPackSchema = z16.object({
15989
+ rootId: z16.string().min(1),
15990
+ generatedAt: z16.string().min(1),
15684
15991
  budget: workGraphContextBudgetSchema,
15685
15992
  slice: workGraphSliceSchema,
15686
- relationEdges: z15.object({
15687
- rootId: z15.string().min(1),
15993
+ relationEdges: z16.object({
15994
+ rootId: z16.string().min(1),
15688
15995
  direction: workGraphEdgeDirectionSchema,
15689
- edges: z15.array(workGraphDirectEdgeSchema)
15996
+ edges: z16.array(workGraphDirectEdgeSchema)
15690
15997
  }).optional(),
15691
15998
  readiness: workGraphReadinessResultSchema.optional(),
15692
- rollup: z15.lazy(() => tasksRollupResultSchema).optional(),
15693
- omissions: z15.array(workGraphOmissionSchema)
15999
+ rollup: z16.lazy(() => tasksRollupResultSchema).optional(),
16000
+ omissions: z16.array(workGraphOmissionSchema)
15694
16001
  });
15695
- var workGraphScaffoldValidateParamsSchema = z15.object({
15696
- rootId: z15.string().min(1),
15697
- nodes: z15.array(
15698
- z15.object({
15699
- id: z15.string().min(1),
16002
+ var workGraphScaffoldValidateParamsSchema = z16.object({
16003
+ rootId: z16.string().min(1),
16004
+ nodes: z16.array(
16005
+ z16.object({
16006
+ id: z16.string().min(1),
15700
16007
  type: taskTypeSchema,
15701
- parentId: z15.string().min(1).nullable().optional()
16008
+ parentId: z16.string().min(1).nullable().optional()
15702
16009
  })
15703
16010
  ),
15704
- edges: z15.array(workGraphDirectEdgeSchema).optional(),
15705
- dryRun: z15.boolean().optional()
16011
+ edges: z16.array(workGraphDirectEdgeSchema).optional(),
16012
+ dryRun: z16.boolean().optional()
15706
16013
  });
15707
- var workGraphScaffoldValidationIssueSchema = z15.object({
15708
- code: z15.string().min(1),
15709
- message: z15.string().min(1),
15710
- taskId: z15.string().min(1).optional(),
15711
- severity: z15.enum(["error", "warning"])
16014
+ var workGraphScaffoldValidationIssueSchema = z16.object({
16015
+ code: z16.string().min(1),
16016
+ message: z16.string().min(1),
16017
+ taskId: z16.string().min(1).optional(),
16018
+ severity: z16.enum(["error", "warning"])
15712
16019
  });
15713
- var workGraphScaffoldValidateResultSchema = z15.object({
15714
- rootId: z15.string().min(1),
15715
- valid: z15.boolean(),
15716
- dryRun: z15.boolean(),
15717
- issues: z15.array(workGraphScaffoldValidationIssueSchema),
15718
- hierarchy: z15.object({
15719
- valid: z15.boolean(),
15720
- violations: z15.array(
15721
- z15.object({
15722
- code: z15.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
15723
- taskId: z15.string().min(1),
16020
+ var workGraphScaffoldValidateResultSchema = z16.object({
16021
+ rootId: z16.string().min(1),
16022
+ valid: z16.boolean(),
16023
+ dryRun: z16.boolean(),
16024
+ issues: z16.array(workGraphScaffoldValidationIssueSchema),
16025
+ hierarchy: z16.object({
16026
+ valid: z16.boolean(),
16027
+ violations: z16.array(
16028
+ z16.object({
16029
+ code: z16.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
16030
+ taskId: z16.string().min(1),
15724
16031
  taskType: taskTypeSchema,
15725
- parentId: z15.string().min(1).nullable(),
16032
+ parentId: z16.string().min(1).nullable(),
15726
16033
  parentType: taskTypeSchema.optional(),
15727
- message: z15.string().min(1)
16034
+ message: z16.string().min(1)
15728
16035
  })
15729
16036
  )
15730
16037
  })
15731
16038
  });
15732
16039
  var workGraphScaffoldApplyParamsSchema = workGraphScaffoldValidateParamsSchema.extend({
15733
- apply: z15.boolean().optional()
16040
+ apply: z16.boolean().optional()
15734
16041
  });
15735
16042
  var workGraphScaffoldApplyResultSchema = workGraphScaffoldValidateResultSchema.extend({
15736
- applied: z15.boolean(),
15737
- nodesChanged: z15.number().int().nonnegative(),
15738
- edgesChanged: z15.number().int().nonnegative()
16043
+ applied: z16.boolean(),
16044
+ nodesChanged: z16.number().int().nonnegative(),
16045
+ edgesChanged: z16.number().int().nonnegative()
15739
16046
  });
15740
- var workGraphPlanningDocParamsSchema = z15.object({
15741
- rootId: z15.string().min(1),
15742
- audience: z15.enum(["agent", "maintainer"]),
15743
- tokenBudget: z15.number().int().positive().optional(),
15744
- includeRelations: z15.boolean().optional(),
15745
- includeReadiness: z15.boolean().optional(),
15746
- includeRollup: z15.boolean().optional()
16047
+ var workGraphPlanningDocParamsSchema = z16.object({
16048
+ rootId: z16.string().min(1),
16049
+ audience: z16.enum(["agent", "maintainer"]),
16050
+ tokenBudget: z16.number().int().positive().optional(),
16051
+ includeRelations: z16.boolean().optional(),
16052
+ includeReadiness: z16.boolean().optional(),
16053
+ includeRollup: z16.boolean().optional()
15747
16054
  });
15748
- var workGraphPlanningDocSchema = z15.object({
15749
- rootId: z15.string().min(1),
15750
- generatedAt: z15.string().min(1),
15751
- audience: z15.enum(["agent", "maintainer"]),
15752
- title: z15.string().min(1),
15753
- content: z15.string(),
15754
- sections: z15.array(z15.string().min(1)),
15755
- estimatedTokens: z15.number().int().nonnegative(),
15756
- budget: z15.object({
15757
- tokenBudget: z15.number().int().positive(),
15758
- truncated: z15.boolean()
16055
+ var workGraphPlanningDocSchema = z16.object({
16056
+ rootId: z16.string().min(1),
16057
+ generatedAt: z16.string().min(1),
16058
+ audience: z16.enum(["agent", "maintainer"]),
16059
+ title: z16.string().min(1),
16060
+ content: z16.string(),
16061
+ sections: z16.array(z16.string().min(1)),
16062
+ estimatedTokens: z16.number().int().nonnegative(),
16063
+ budget: z16.object({
16064
+ tokenBudget: z16.number().int().positive(),
16065
+ truncated: z16.boolean()
15759
16066
  }).optional()
15760
16067
  });
15761
16068
  var tasksTraverseParamsSchema = paginationParamsSchema.extend({
15762
- rootId: z15.string().min(1),
16069
+ rootId: z16.string().min(1),
15763
16070
  direction: workGraphTraversalDirectionSchema,
15764
- maxDepth: z15.number().int().nonnegative().optional(),
15765
- includeRelations: z15.boolean().optional()
16071
+ maxDepth: z16.number().int().nonnegative().optional(),
16072
+ includeRelations: z16.boolean().optional()
15766
16073
  });
15767
- var tasksTraverseResultSchema = z15.object({
15768
- rootId: z15.string().min(1),
16074
+ var tasksTraverseResultSchema = z16.object({
16075
+ rootId: z16.string().min(1),
15769
16076
  direction: workGraphTraversalDirectionSchema,
15770
- nodes: z15.array(workGraphNodeSchema),
15771
- edges: z15.array(workGraphEdgeSchema),
16077
+ nodes: z16.array(workGraphNodeSchema),
16078
+ edges: z16.array(workGraphEdgeSchema),
15772
16079
  pageInfo: workGraphPageInfoSchema
15773
16080
  });
15774
16081
  var tasksTreeParamsSchema = paginationParamsSchema.extend({
15775
- rootId: z15.string().min(1),
15776
- maxDepth: z15.number().int().nonnegative().optional()
16082
+ rootId: z16.string().min(1),
16083
+ maxDepth: z16.number().int().nonnegative().optional()
15777
16084
  });
15778
- var tasksTreeResultSchema = z15.object({
15779
- rootId: z15.string().min(1),
15780
- nodes: z15.array(workGraphNodeSchema.extend({ depth: z15.number().int().positive() })),
15781
- edges: z15.array(workGraphHierarchyEdgeSchema),
16085
+ var tasksTreeResultSchema = z16.object({
16086
+ rootId: z16.string().min(1),
16087
+ nodes: z16.array(workGraphNodeSchema.extend({ depth: z16.number().int().positive() })),
16088
+ edges: z16.array(workGraphHierarchyEdgeSchema),
15782
16089
  pageInfo: workGraphPageInfoSchema
15783
16090
  });
15784
- var tasksRollupParamsSchema = z15.object({
15785
- rootId: z15.string().min(1),
16091
+ var tasksRollupParamsSchema = z16.object({
16092
+ rootId: z16.string().min(1),
15786
16093
  expectedDirectRollup: workGraphRollupCountsSchema.optional()
15787
16094
  });
15788
- var tasksRollupResultSchema = z15.object({
15789
- rootId: z15.string().min(1),
16095
+ var tasksRollupResultSchema = z16.object({
16096
+ rootId: z16.string().min(1),
15790
16097
  direct: workGraphRollupCountsSchema,
15791
16098
  subtree: workGraphRollupCountsSchema,
15792
- percentDenominator: z15.object({
15793
- basis: z15.literal("subtree-total"),
15794
- total: z15.number().int().nonnegative(),
15795
- description: z15.string().min(1)
16099
+ percentDenominator: z16.object({
16100
+ basis: z16.literal("subtree-total"),
16101
+ total: z16.number().int().nonnegative(),
16102
+ description: z16.string().min(1)
15796
16103
  }),
15797
16104
  percentages: workGraphSubtreePercentagesSchema,
15798
- staleProjection: z15.boolean(),
15799
- projectionMismatches: z15.array(workGraphProjectionMismatchSchema)
16105
+ staleProjection: z16.boolean(),
16106
+ projectionMismatches: z16.array(workGraphProjectionMismatchSchema)
15800
16107
  });
15801
- var tasksFrontierParamsSchema = z15.object({
15802
- rootId: z15.string().min(1),
15803
- role: z15.string().min(1).optional()
16108
+ var tasksFrontierParamsSchema = z16.object({
16109
+ rootId: z16.string().min(1),
16110
+ role: z16.string().min(1).optional()
15804
16111
  });
15805
- var tasksFrontierResultSchema = z15.object({
15806
- rootId: z15.string().min(1),
15807
- role: z15.string().min(1).optional(),
15808
- groups: z15.object({
15809
- ready: z15.array(workGraphReadyFrontierTaskSchema),
15810
- blocked: z15.array(workGraphReadyFrontierTaskSchema),
15811
- blockedBy: z15.array(
15812
- z15.discriminatedUnion("kind", [
15813
- z15.object({
15814
- kind: z15.literal("dependency"),
15815
- blockerId: z15.string().min(1),
15816
- blocks: z15.array(z15.string().min(1))
16112
+ var tasksFrontierResultSchema = z16.object({
16113
+ rootId: z16.string().min(1),
16114
+ role: z16.string().min(1).optional(),
16115
+ groups: z16.object({
16116
+ ready: z16.array(workGraphReadyFrontierTaskSchema),
16117
+ blocked: z16.array(workGraphReadyFrontierTaskSchema),
16118
+ blockedBy: z16.array(
16119
+ z16.discriminatedUnion("kind", [
16120
+ z16.object({
16121
+ kind: z16.literal("dependency"),
16122
+ blockerId: z16.string().min(1),
16123
+ blocks: z16.array(z16.string().min(1))
15817
16124
  }),
15818
- z15.object({
15819
- kind: z15.literal("gate"),
16125
+ z16.object({
16126
+ kind: z16.literal("gate"),
15820
16127
  gate: verificationGateSchema,
15821
- blocks: z15.array(z15.string().min(1))
16128
+ blocks: z16.array(z16.string().min(1))
15822
16129
  })
15823
16130
  ])
15824
16131
  )
15825
16132
  })
15826
16133
  });
15827
16134
  var tasksWorkGraphAuditParamsSchema = paginationParamsSchema.extend({
15828
- rootId: z15.string().min(1),
15829
- maxDepth: z15.number().int().nonnegative().optional(),
15830
- includeRelations: z15.boolean().optional()
16135
+ rootId: z16.string().min(1),
16136
+ maxDepth: z16.number().int().nonnegative().optional(),
16137
+ includeRelations: z16.boolean().optional()
15831
16138
  });
15832
- var tasksWorkGraphAuditResultSchema = z15.object({
15833
- rootId: z15.string().min(1),
15834
- hierarchy: z15.object({
15835
- valid: z15.boolean(),
15836
- violations: z15.array(
15837
- z15.object({
15838
- code: z15.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
15839
- taskId: z15.string().min(1),
16139
+ var tasksWorkGraphAuditResultSchema = z16.object({
16140
+ rootId: z16.string().min(1),
16141
+ hierarchy: z16.object({
16142
+ valid: z16.boolean(),
16143
+ violations: z16.array(
16144
+ z16.object({
16145
+ code: z16.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
16146
+ taskId: z16.string().min(1),
15840
16147
  taskType: taskTypeSchema,
15841
- parentId: z15.string().min(1).nullable(),
16148
+ parentId: z16.string().min(1).nullable(),
15842
16149
  parentType: taskTypeSchema.optional(),
15843
- message: z15.string().min(1)
16150
+ message: z16.string().min(1)
15844
16151
  })
15845
16152
  )
15846
16153
  }),
15847
16154
  traversal: tasksTraverseResultSchema,
15848
16155
  frontier: tasksFrontierResultSchema,
15849
16156
  rollup: tasksRollupResultSchema,
15850
- relationEdges: z15.object({
15851
- rootId: z15.string().min(1),
16157
+ relationEdges: z16.object({
16158
+ rootId: z16.string().min(1),
15852
16159
  direction: workGraphEdgeDirectionSchema,
15853
- edges: z15.array(
15854
- z15.discriminatedUnion("source", [
16160
+ edges: z16.array(
16161
+ z16.discriminatedUnion("source", [
15855
16162
  workGraphRelationEdgeSchema,
15856
16163
  workGraphDependencyEdgeSchema
15857
16164
  ])
@@ -15860,60 +16167,60 @@ var tasksWorkGraphAuditResultSchema = z15.object({
15860
16167
  });
15861
16168
 
15862
16169
  // packages/contracts/src/operations/docs.ts
15863
- import { z as z16 } from "zod";
15864
- var DOCS_PROJECTION_PROPOSAL_SCHEMA = z16.object({
15865
- version: z16.literal(1),
15866
- operation: z16.literal("docs.projection"),
15867
- identity: z16.object({
15868
- projectId: z16.string().min(1),
15869
- projectRoot: z16.string().min(1),
15870
- actor: z16.string().min(1),
15871
- operation: z16.literal("docs.projection"),
15872
- idempotencyKey: z16.string().min(1)
16170
+ import { z as z17 } from "zod";
16171
+ var DOCS_PROJECTION_PROPOSAL_SCHEMA = z17.object({
16172
+ version: z17.literal(1),
16173
+ operation: z17.literal("docs.projection"),
16174
+ identity: z17.object({
16175
+ projectId: z17.string().min(1),
16176
+ projectRoot: z17.string().min(1),
16177
+ actor: z17.string().min(1),
16178
+ operation: z17.literal("docs.projection"),
16179
+ idempotencyKey: z17.string().min(1)
15873
16180
  }).strict(),
15874
- source: z16.object({
15875
- attachmentId: z16.string().min(1),
15876
- sha256: z16.string().regex(/^[a-f0-9]{64}$/),
15877
- ownerId: z16.string().min(1),
15878
- ownerType: z16.enum(["task", "session", "observation", "decision", "learning", "pattern"]),
15879
- label: z16.string().min(1)
16181
+ source: z17.object({
16182
+ attachmentId: z17.string().min(1),
16183
+ sha256: z17.string().regex(/^[a-f0-9]{64}$/),
16184
+ ownerId: z17.string().min(1),
16185
+ ownerType: z17.enum(["task", "session", "observation", "decision", "learning", "pattern"]),
16186
+ label: z17.string().min(1)
15880
16187
  }).strict(),
15881
- observation: z16.object({
15882
- kind: z16.literal("doc-attachment"),
15883
- attachmentId: z16.string().min(1),
15884
- ownerId: z16.string().min(1),
15885
- addedAt: z16.string().min(1),
15886
- slug: z16.string().optional(),
15887
- type: z16.string().optional()
16188
+ observation: z17.object({
16189
+ kind: z17.literal("doc-attachment"),
16190
+ attachmentId: z17.string().min(1),
16191
+ ownerId: z17.string().min(1),
16192
+ addedAt: z17.string().min(1),
16193
+ slug: z17.string().optional(),
16194
+ type: z17.string().optional()
15888
16195
  }).strict()
15889
16196
  }).strict();
15890
- var DOCS_PROJECTION_RECEIPT_SCHEMA = z16.object({
15891
- version: z16.literal(1),
15892
- sourceHash: z16.string().regex(/^[a-f0-9]{64}$/),
15893
- graph: z16.enum(["completed", "disabled"]),
16197
+ var DOCS_PROJECTION_RECEIPT_SCHEMA = z17.object({
16198
+ version: z17.literal(1),
16199
+ sourceHash: z17.string().regex(/^[a-f0-9]{64}$/),
16200
+ graph: z17.enum(["completed", "disabled"]),
15894
16201
  /** Legacy receipts (before T13985): the "Doc attached" observation the projection wrote. */
15895
- observationId: z16.string().min(1).optional(),
16202
+ observationId: z17.string().min(1).optional(),
15896
16203
  /** T13985 (D11180): the canonical `llmtxt --documents--> owner` edge was written. */
15897
- documents: z16.literal(true).optional(),
15898
- verifiedAt: z16.string().min(1),
15899
- actor: z16.string().min(1)
16204
+ documents: z17.literal(true).optional(),
16205
+ verifiedAt: z17.string().min(1),
16206
+ actor: z17.string().min(1)
15900
16207
  }).strict().refine((receipt) => receipt.observationId !== void 0 || receipt.documents === true, {
15901
16208
  message: "A projection receipt records its documents edge or, for legacy jobs, its observation"
15902
16209
  });
15903
16210
 
15904
16211
  // packages/contracts/src/operations/ensures-schema-registry.ts
15905
- import { z as z17 } from "zod";
15906
- var taskTreeEntrySchema = z17.object({
15907
- 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" }),
15908
- 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), {
16212
+ import { z as z18 } from "zod";
16213
+ var taskTreeEntrySchema = z18.object({
16214
+ 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" }),
16215
+ 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), {
15909
16216
  message: "acceptance array contains no non-empty strings"
15910
16217
  }),
15911
- id: z17.string().optional(),
15912
- parentId: z17.string().optional(),
15913
- depends: z17.array(z17.string()).optional()
16218
+ id: z18.string().optional(),
16219
+ parentId: z18.string().optional(),
16220
+ depends: z18.array(z18.string()).optional()
15914
16221
  });
15915
- 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" });
15916
- var evidenceSchema = z17.unknown().superRefine((value, ctx) => {
16222
+ 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" });
16223
+ var evidenceSchema = z18.unknown().superRefine((value, ctx) => {
15917
16224
  if (value === null || value === void 0) {
15918
16225
  ctx.addIssue({
15919
16226
  code: "custom",
@@ -15947,7 +16254,7 @@ var evidenceSchema = z17.unknown().superRefine((value, ctx) => {
15947
16254
  message: `evidence must be a string, array, or object (got ${typeof value})`
15948
16255
  });
15949
16256
  });
15950
- var passthroughSchema = z17.unknown();
16257
+ var passthroughSchema = z18.unknown();
15951
16258
  var LEGACY_PASSTHROUGH_SCHEMA_NAMES = [
15952
16259
  // release.cantbook
15953
16260
  "version_bump_report",
@@ -15980,44 +16287,44 @@ var LEAD_RUNNER_TOOL_NAME = "cleo_run";
15980
16287
  var LEAD_RUNNER_TOOL = `mcp__${LEAD_RUNNER_MCP_SERVER}__${LEAD_RUNNER_TOOL_NAME}`;
15981
16288
 
15982
16289
  // packages/contracts/src/release/evidence-atoms.ts
15983
- import { z as z18 } from "zod";
15984
- var parsedPrEvidenceAtomSchema = z18.object({
15985
- kind: z18.literal("pr"),
15986
- prNumber: z18.number().int().positive()
16290
+ import { z as z19 } from "zod";
16291
+ var parsedPrEvidenceAtomSchema = z19.object({
16292
+ kind: z19.literal("pr"),
16293
+ prNumber: z19.number().int().positive()
15987
16294
  });
15988
- var prEvidenceStateModifierSchema = z18.object({
15989
- kind: z18.literal("state"),
15990
- value: z18.literal("MERGED")
16295
+ var prEvidenceStateModifierSchema = z19.object({
16296
+ kind: z19.literal("state"),
16297
+ value: z19.literal("MERGED")
15991
16298
  });
15992
- var ghPrViewSchema = z18.object({
15993
- state: z18.enum(["OPEN", "CLOSED", "MERGED"]),
15994
- mergedAt: z18.string().nullable(),
15995
- headRefOid: z18.string().optional(),
15996
- mergeCommit: z18.object({ oid: z18.string() }).nullable().optional(),
15997
- title: z18.string().optional(),
15998
- body: z18.string().optional(),
15999
- headRefName: z18.string().optional(),
16000
- files: z18.array(z18.object({ path: z18.string() })).optional(),
16001
- changedFiles: z18.number().int().nonnegative().optional(),
16002
- mergeable: z18.string().optional(),
16003
- statusCheckRollup: z18.array(
16004
- z18.object({
16005
- __typename: z18.string().optional(),
16006
- name: z18.string().optional(),
16007
- workflowName: z18.string().optional(),
16008
- conclusion: z18.string().nullable().optional(),
16009
- status: z18.string().optional(),
16299
+ var ghPrViewSchema = z19.object({
16300
+ state: z19.enum(["OPEN", "CLOSED", "MERGED"]),
16301
+ mergedAt: z19.string().nullable(),
16302
+ headRefOid: z19.string().optional(),
16303
+ mergeCommit: z19.object({ oid: z19.string() }).nullable().optional(),
16304
+ title: z19.string().optional(),
16305
+ body: z19.string().optional(),
16306
+ headRefName: z19.string().optional(),
16307
+ files: z19.array(z19.object({ path: z19.string() })).optional(),
16308
+ changedFiles: z19.number().int().nonnegative().optional(),
16309
+ mergeable: z19.string().optional(),
16310
+ statusCheckRollup: z19.array(
16311
+ z19.object({
16312
+ __typename: z19.string().optional(),
16313
+ name: z19.string().optional(),
16314
+ workflowName: z19.string().optional(),
16315
+ conclusion: z19.string().nullable().optional(),
16316
+ status: z19.string().optional(),
16010
16317
  /** ISO start time of a CheckRun; orders re-runs of one check (T13506). */
16011
- startedAt: z18.string().nullable().optional(),
16318
+ startedAt: z19.string().nullable().optional(),
16012
16319
  /** ISO completion time of a CheckRun; orders re-runs of one check (T13506). */
16013
- completedAt: z18.string().nullable().optional()
16320
+ completedAt: z19.string().nullable().optional()
16014
16321
  }).passthrough()
16015
16322
  ).optional().default([])
16016
16323
  }).passthrough();
16017
16324
  var PR_REQUIRED_WORKFLOWS = Object.freeze(["CI", "Contracts Dep Lint"]);
16018
16325
 
16019
16326
  // packages/contracts/src/release/plan.ts
16020
- import { z as z19 } from "zod";
16327
+ import { z as z20 } from "zod";
16021
16328
  var RELEASE_CHANNEL = ["latest", "beta", "alpha", "rc", "canary"];
16022
16329
  var RELEASE_SCHEME = ["calver", "semver", "calver-suffix"];
16023
16330
  var RELEASE_KIND = ["regular", "hotfix", "prerelease"];
@@ -16061,20 +16368,20 @@ var RESOLVED_SOURCE = [
16061
16368
  "language-default",
16062
16369
  "legacy-alias"
16063
16370
  ];
16064
- var ReleaseChannelSchema = z19.enum(RELEASE_CHANNEL);
16065
- var ReleaseSchemeSchema = z19.enum(RELEASE_SCHEME);
16066
- var ReleaseKindSchema = z19.enum(RELEASE_KIND);
16067
- var ReleaseStatusSchema = z19.enum(RELEASE_STATUS);
16068
- var GateStatusSchema = z19.enum(GATE_STATUS);
16069
- var GateNameSchema = z19.enum(GATE_NAME);
16070
- var PlatformTupleSchema = z19.enum(PLATFORM_TUPLE);
16071
- var PublisherSchema = z19.enum(PUBLISHER);
16072
- var TaskKindSchema = z19.enum(TASK_KIND);
16073
- var ImpactSchema = z19.enum(IMPACT);
16074
- var ResolvedSourceSchema = z19.enum(RESOLVED_SOURCE);
16075
- var Iso8601 = z19.iso.datetime({ offset: true });
16076
- var NonEmptyString = z19.string().min(1);
16077
- var ReleasePlanTaskSchema = z19.object({
16371
+ var ReleaseChannelSchema = z20.enum(RELEASE_CHANNEL);
16372
+ var ReleaseSchemeSchema = z20.enum(RELEASE_SCHEME);
16373
+ var ReleaseKindSchema = z20.enum(RELEASE_KIND);
16374
+ var ReleaseStatusSchema = z20.enum(RELEASE_STATUS);
16375
+ var GateStatusSchema = z20.enum(GATE_STATUS);
16376
+ var GateNameSchema = z20.enum(GATE_NAME);
16377
+ var PlatformTupleSchema = z20.enum(PLATFORM_TUPLE);
16378
+ var PublisherSchema = z20.enum(PUBLISHER);
16379
+ var TaskKindSchema = z20.enum(TASK_KIND);
16380
+ var ImpactSchema = z20.enum(IMPACT);
16381
+ var ResolvedSourceSchema = z20.enum(RESOLVED_SOURCE);
16382
+ var Iso8601 = z20.iso.datetime({ offset: true });
16383
+ var NonEmptyString = z20.string().min(1);
16384
+ var ReleasePlanTaskSchema = z20.object({
16078
16385
  /** Task ID (e.g. "T10001"). Format intentionally loose so historical IDs validate. */
16079
16386
  id: NonEmptyString,
16080
16387
  /** Conventional-commit-aligned task classification. */
@@ -16082,20 +16389,20 @@ var ReleasePlanTaskSchema = z19.object({
16082
16389
  /** SemVer impact classification. */
16083
16390
  impact: ImpactSchema,
16084
16391
  /** Human-readable changelog line for this task. */
16085
- userFacingSummary: z19.string(),
16392
+ userFacingSummary: z20.string(),
16086
16393
  /**
16087
16394
  * ADR-051 evidence atoms attesting the task's gate results. Format is
16088
16395
  * `kind:value` (e.g. `commit:abc123`, `test-run:vitest.json`). The contract
16089
16396
  * accepts empty arrays so legacy plans validate; `cleo release plan`
16090
16397
  * enforces non-empty via R-301.
16091
16398
  */
16092
- evidenceAtoms: z19.array(NonEmptyString),
16399
+ evidenceAtoms: z20.array(NonEmptyString),
16093
16400
  /** IVTR phase at plan time — informational only per R-316. */
16094
- ivtrPhaseAtPlan: z19.string().optional(),
16401
+ ivtrPhaseAtPlan: z20.string().optional(),
16095
16402
  /** Epic this task rolls up to, locked at plan time per R-303. */
16096
16403
  epicAncestor: NonEmptyString
16097
16404
  });
16098
- var ReleaseGateSchema = z19.object({
16405
+ var ReleaseGateSchema = z20.object({
16099
16406
  /** Canonical gate name. */
16100
16407
  name: GateNameSchema,
16101
16408
  /** ADR-051 atom string identifying the resolved tool (e.g. `tool:test`). */
@@ -16105,11 +16412,11 @@ var ReleaseGateSchema = z19.object({
16105
16412
  /** ISO-8601 timestamp the gate was last verified. */
16106
16413
  lastVerifiedAt: Iso8601,
16107
16414
  /** Resolved shell command (e.g. `pnpm run test`). Optional for unresolved gates. */
16108
- resolvedCommand: z19.string().optional(),
16415
+ resolvedCommand: z20.string().optional(),
16109
16416
  /** Provenance of the resolved command. Optional for unresolved gates. */
16110
16417
  resolvedSource: ResolvedSourceSchema.optional()
16111
16418
  });
16112
- var ReleasePlatformMatrixEntrySchema = z19.object({
16419
+ var ReleasePlatformMatrixEntrySchema = z20.object({
16113
16420
  /** Target platform tuple. */
16114
16421
  platform: PlatformTupleSchema,
16115
16422
  /** Distribution backend. */
@@ -16117,47 +16424,47 @@ var ReleasePlatformMatrixEntrySchema = z19.object({
16117
16424
  /** Package identifier on the target backend (e.g. `@cleocode/cleo`). */
16118
16425
  package: NonEmptyString,
16119
16426
  /** Whether to run the GHA smoke job for this matrix entry. */
16120
- smoke: z19.boolean().default(true).optional()
16427
+ smoke: z20.boolean().default(true).optional()
16121
16428
  });
16122
- var ReleasePreflightSummarySchema = z19.object({
16429
+ var ReleasePreflightSummarySchema = z20.object({
16123
16430
  /** True if esbuild externals are out of sync with package.json. */
16124
- esbuildExternalsDrift: z19.boolean(),
16431
+ esbuildExternalsDrift: z20.boolean(),
16125
16432
  /** True if `pnpm-lock.yaml` diverges from the workspace manifest. */
16126
- lockfileDrift: z19.boolean(),
16433
+ lockfileDrift: z20.boolean(),
16127
16434
  /** True if all epic children are in terminal lifecycle states. */
16128
- epicCompletenessClean: z19.boolean(),
16435
+ epicCompletenessClean: z20.boolean(),
16129
16436
  /** True if no task appears in multiple in-flight release plans. */
16130
- doubleListingClean: z19.boolean(),
16437
+ doubleListingClean: z20.boolean(),
16131
16438
  /** Non-fatal preflight warnings (e.g. unresolved tools per R-024). */
16132
- preflightWarnings: z19.array(z19.string()).default([]).optional()
16439
+ preflightWarnings: z20.array(z20.string()).default([]).optional()
16133
16440
  });
16134
- var ReleasePlanChangelogSchema = z19.object({
16441
+ var ReleasePlanChangelogSchema = z20.object({
16135
16442
  /** `kind=feat` tasks. */
16136
- features: z19.array(NonEmptyString).default([]),
16443
+ features: z20.array(NonEmptyString).default([]),
16137
16444
  /** `kind=fix` or `kind=hotfix` tasks. */
16138
- fixes: z19.array(NonEmptyString).default([]),
16445
+ fixes: z20.array(NonEmptyString).default([]),
16139
16446
  /** `kind=chore`, `docs`, `refactor`, `test`, `perf` tasks. */
16140
- chores: z19.array(NonEmptyString).default([]),
16447
+ chores: z20.array(NonEmptyString).default([]),
16141
16448
  /** `kind=breaking` or `kind=revert` tasks. */
16142
- breaking: z19.array(NonEmptyString).default([])
16449
+ breaking: z20.array(NonEmptyString).default([])
16143
16450
  });
16144
- var ReleasePlanMetaSchema = z19.object({
16451
+ var ReleasePlanMetaSchema = z20.object({
16145
16452
  /** True if this is the project's first ever release. */
16146
- firstEverRelease: z19.boolean().optional(),
16453
+ firstEverRelease: z20.boolean().optional(),
16147
16454
  /** Canonical tool names that could not be resolved at plan time. */
16148
- unresolvedTools: z19.array(z19.string()).optional(),
16455
+ unresolvedTools: z20.array(z20.string()).optional(),
16149
16456
  /** Project archetype detected at plan time. */
16150
- archetype: z19.string().optional()
16151
- }).catchall(z19.unknown());
16152
- var ReleasePlanSchema = z19.object({
16457
+ archetype: z20.string().optional()
16458
+ }).catchall(z20.unknown());
16459
+ var ReleasePlanSchema = z20.object({
16153
16460
  /** Schema URL for this plan version. */
16154
- $schema: z19.string().optional(),
16461
+ $schema: z20.string().optional(),
16155
16462
  /** Requested version string (e.g. "v2026.6.0"). Includes the leading `v`. */
16156
16463
  version: NonEmptyString,
16157
16464
  /** Resolved version string after suffix application (e.g. "v2026.6.0.2"). */
16158
16465
  resolvedVersion: NonEmptyString,
16159
16466
  /** True if a `calver-suffix` was applied to disambiguate a same-day hotfix. */
16160
- suffixApplied: z19.boolean(),
16467
+ suffixApplied: z20.boolean(),
16161
16468
  /** Versioning scheme governing `version` / `resolvedVersion`. */
16162
16469
  scheme: ReleaseSchemeSchema,
16163
16470
  /** npm dist-tag channel for this release. */
@@ -16171,7 +16478,7 @@ var ReleasePlanSchema = z19.object({
16171
16478
  /** Release-kind classification. */
16172
16479
  releaseKind: ReleaseKindSchema,
16173
16480
  /** Explicit hooks-v1 stable promotion; ordinary and hotfix releases are exempt. */
16174
- hooksV1Promotion: z19.boolean().optional(),
16481
+ hooksV1Promotion: z20.boolean().optional(),
16175
16482
  /** Audited reason for shipping a source change that opens the hooks-v1 gate without the promotion (T13555). */
16176
16483
  hooksV1Waiver: NonEmptyString.optional(),
16177
16484
  /** ISO-8601 timestamp the plan was written. */
@@ -16182,27 +16489,27 @@ var ReleasePlanSchema = z19.object({
16182
16489
  * Version of the previous release on the same channel. MUST be `null` only
16183
16490
  * for first-ever releases (R-300, enforced at the verb layer).
16184
16491
  */
16185
- previousVersion: z19.string().nullable(),
16492
+ previousVersion: z20.string().nullable(),
16186
16493
  /** Git tag of the previous release (typically `previousVersion` prefixed). */
16187
- previousTag: z19.string().nullable(),
16494
+ previousTag: z20.string().nullable(),
16188
16495
  /** ISO-8601 timestamp the previous release was published. */
16189
16496
  previousShippedAt: Iso8601.nullable(),
16190
16497
  /** Tasks rolled into this release. */
16191
- tasks: z19.array(ReleasePlanTaskSchema),
16498
+ tasks: z20.array(ReleasePlanTaskSchema),
16192
16499
  /** Bucketed changelog. */
16193
16500
  changelog: ReleasePlanChangelogSchema,
16194
16501
  /** Per-gate verification status. */
16195
- gates: z19.array(ReleaseGateSchema),
16502
+ gates: z20.array(ReleaseGateSchema),
16196
16503
  /** Platform / publisher matrix. */
16197
- platformMatrix: z19.array(ReleasePlatformMatrixEntrySchema),
16504
+ platformMatrix: z20.array(ReleasePlatformMatrixEntrySchema),
16198
16505
  /** Preflight summary from `cleo release plan`. */
16199
16506
  preflightSummary: ReleasePreflightSummarySchema,
16200
16507
  /** URL of the GHA workflow run (populated by `release-prepare.yml`). */
16201
- workflowRunUrl: z19.string().nullable(),
16508
+ workflowRunUrl: z20.string().nullable(),
16202
16509
  /** URL of the bump PR (populated by `cleo release open`). */
16203
- prUrl: z19.string().nullable(),
16510
+ prUrl: z20.string().nullable(),
16204
16511
  /** Merge commit SHA on `main` (populated by `release-publish.yml`). */
16205
- mergeCommitSha: z19.string().nullable(),
16512
+ mergeCommitSha: z20.string().nullable(),
16206
16513
  /** Current FSM state per R-302. */
16207
16514
  status: ReleaseStatusSchema,
16208
16515
  /** Informational / forward-compat metadata. */
@@ -16232,48 +16539,48 @@ var RESOURCE_CLASSES = Object.freeze([
16232
16539
  ]);
16233
16540
 
16234
16541
  // packages/contracts/src/session-journal.ts
16235
- import { z as z20 } from "zod";
16542
+ import { z as z21 } from "zod";
16236
16543
  var SESSION_JOURNAL_SCHEMA_VERSION = "1.0";
16237
- var sessionJournalDoctorSummarySchema = z20.object({
16544
+ var sessionJournalDoctorSummarySchema = z21.object({
16238
16545
  /** `true` when zero noise patterns were detected. */
16239
- isClean: z20.boolean(),
16546
+ isClean: z21.boolean(),
16240
16547
  /** Total number of noise findings across all patterns. */
16241
- findingsCount: z20.number().int().nonnegative(),
16548
+ findingsCount: z21.number().int().nonnegative(),
16242
16549
  /** Pattern names that were detected (empty when isClean). */
16243
- patterns: z20.array(z20.string()),
16550
+ patterns: z21.array(z21.string()),
16244
16551
  /** Total brain entries scanned. `0` = empty or unavailable. */
16245
- totalScanned: z20.number().int().nonnegative()
16552
+ totalScanned: z21.number().int().nonnegative()
16246
16553
  });
16247
- var sessionJournalDebriefSummarySchema = z20.object({
16554
+ var sessionJournalDebriefSummarySchema = z21.object({
16248
16555
  /** First 200 characters of the session end note (if provided). */
16249
- noteExcerpt: z20.string().max(200).optional(),
16556
+ noteExcerpt: z21.string().max(200).optional(),
16250
16557
  /** Number of tasks completed during the session. */
16251
- tasksCompletedCount: z20.number().int().nonnegative(),
16558
+ tasksCompletedCount: z21.number().int().nonnegative(),
16252
16559
  /** Up to 5 task IDs (not titles) that were the focus of the session. */
16253
- tasksFocused: z20.array(z20.string()).max(5).optional()
16560
+ tasksFocused: z21.array(z21.string()).max(5).optional()
16254
16561
  });
16255
- var sessionJournalEntrySchema = z20.object({
16562
+ var sessionJournalEntrySchema = z21.object({
16256
16563
  // Identity
16257
16564
  /** Schema version for forward-compatibility. Always `'1.0'` in this release. */
16258
- schemaVersion: z20.literal(SESSION_JOURNAL_SCHEMA_VERSION),
16565
+ schemaVersion: z21.literal(SESSION_JOURNAL_SCHEMA_VERSION),
16259
16566
  /** ISO 8601 timestamp when the entry was written. */
16260
- timestamp: z20.string(),
16567
+ timestamp: z21.string(),
16261
16568
  /** CLEO session ID (e.g. `ses_20260424055456_ede571`). */
16262
- sessionId: z20.string(),
16569
+ sessionId: z21.string(),
16263
16570
  /** Event type that triggered this journal entry. */
16264
- eventType: z20.enum(["session_start", "session_end", "observation", "decision", "error"]),
16571
+ eventType: z21.enum(["session_start", "session_end", "observation", "decision", "error"]),
16265
16572
  // Session metadata (set on session_start / session_end)
16266
16573
  /** Agent identifier (e.g. `cleo-prime`, `claude-code`). */
16267
- agentIdentifier: z20.string().optional(),
16574
+ agentIdentifier: z21.string().optional(),
16268
16575
  /** Provider adapter ID active for this session. */
16269
- providerId: z20.string().optional(),
16576
+ providerId: z21.string().optional(),
16270
16577
  /** Session scope string (e.g. `'global'` or `'epic:T1263'`). */
16271
- scope: z20.string().optional(),
16578
+ scope: z21.string().optional(),
16272
16579
  // Session-end fields
16273
16580
  /** Duration of the session in seconds (session_end only). */
16274
- duration: z20.number().int().nonnegative().optional(),
16581
+ duration: z21.number().int().nonnegative().optional(),
16275
16582
  /** Task IDs (not titles) completed during the session. */
16276
- tasksCompleted: z20.array(z20.string()).optional(),
16583
+ tasksCompleted: z21.array(z21.string()).optional(),
16277
16584
  // Doctor summary (T1262 absorbed)
16278
16585
  /**
16279
16586
  * Compact result of `scanBrainNoise` run at session-end.
@@ -16288,52 +16595,52 @@ var sessionJournalEntrySchema = z20.object({
16288
16595
  debriefSummary: sessionJournalDebriefSummarySchema.optional(),
16289
16596
  // Optional hash chain
16290
16597
  /** SHA-256 hex of the previous entry's raw JSON string (for integrity chain). */
16291
- prevEntryHash: z20.string().optional()
16598
+ prevEntryHash: z21.string().optional()
16292
16599
  });
16293
16600
 
16294
16601
  // packages/contracts/src/task-evidence.ts
16295
- import { z as z21 } from "zod";
16296
- var fileEvidenceSchema = z21.object({
16297
- kind: z21.literal("file"),
16298
- sha256: z21.string().length(64),
16299
- timestamp: z21.string().datetime(),
16300
- path: z21.string().min(1),
16301
- mime: z21.string().optional(),
16302
- description: z21.string().optional()
16602
+ import { z as z22 } from "zod";
16603
+ var fileEvidenceSchema = z22.object({
16604
+ kind: z22.literal("file"),
16605
+ sha256: z22.string().length(64),
16606
+ timestamp: z22.string().datetime(),
16607
+ path: z22.string().min(1),
16608
+ mime: z22.string().optional(),
16609
+ description: z22.string().optional()
16303
16610
  });
16304
- var logEvidenceSchema = z21.object({
16305
- kind: z21.literal("log"),
16306
- sha256: z21.string().length(64),
16307
- timestamp: z21.string().datetime(),
16308
- source: z21.string().min(1),
16309
- description: z21.string().optional()
16611
+ var logEvidenceSchema = z22.object({
16612
+ kind: z22.literal("log"),
16613
+ sha256: z22.string().length(64),
16614
+ timestamp: z22.string().datetime(),
16615
+ source: z22.string().min(1),
16616
+ description: z22.string().optional()
16310
16617
  });
16311
- var screenshotEvidenceSchema = z21.object({
16312
- kind: z21.literal("screenshot"),
16313
- sha256: z21.string().length(64),
16314
- timestamp: z21.string().datetime(),
16315
- mime: z21.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
16316
- description: z21.string().optional()
16618
+ var screenshotEvidenceSchema = z22.object({
16619
+ kind: z22.literal("screenshot"),
16620
+ sha256: z22.string().length(64),
16621
+ timestamp: z22.string().datetime(),
16622
+ mime: z22.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
16623
+ description: z22.string().optional()
16317
16624
  });
16318
- var testOutputEvidenceSchema = z21.object({
16319
- kind: z21.literal("test-output"),
16320
- sha256: z21.string().length(64),
16321
- timestamp: z21.string().datetime(),
16322
- passed: z21.number().int().nonnegative(),
16323
- failed: z21.number().int().nonnegative(),
16324
- skipped: z21.number().int().nonnegative(),
16325
- exitCode: z21.number().int(),
16326
- description: z21.string().optional()
16625
+ var testOutputEvidenceSchema = z22.object({
16626
+ kind: z22.literal("test-output"),
16627
+ sha256: z22.string().length(64),
16628
+ timestamp: z22.string().datetime(),
16629
+ passed: z22.number().int().nonnegative(),
16630
+ failed: z22.number().int().nonnegative(),
16631
+ skipped: z22.number().int().nonnegative(),
16632
+ exitCode: z22.number().int(),
16633
+ description: z22.string().optional()
16327
16634
  });
16328
- var commandOutputEvidenceSchema = z21.object({
16329
- kind: z21.literal("command-output"),
16330
- sha256: z21.string().length(64),
16331
- timestamp: z21.string().datetime(),
16332
- cmd: z21.string().min(1),
16333
- exitCode: z21.number().int(),
16334
- description: z21.string().optional()
16635
+ var commandOutputEvidenceSchema = z22.object({
16636
+ kind: z22.literal("command-output"),
16637
+ sha256: z22.string().length(64),
16638
+ timestamp: z22.string().datetime(),
16639
+ cmd: z22.string().min(1),
16640
+ exitCode: z22.number().int(),
16641
+ description: z22.string().optional()
16335
16642
  });
16336
- var taskEvidenceSchema = z21.discriminatedUnion("kind", [
16643
+ var taskEvidenceSchema = z22.discriminatedUnion("kind", [
16337
16644
  fileEvidenceSchema,
16338
16645
  logEvidenceSchema,
16339
16646
  screenshotEvidenceSchema,
@@ -16342,8 +16649,8 @@ var taskEvidenceSchema = z21.discriminatedUnion("kind", [
16342
16649
  ]);
16343
16650
 
16344
16651
  // packages/contracts/src/tasks/archive.ts
16345
- import { z as z22 } from "zod";
16346
- var ArchiveReason = z22.enum([
16652
+ import { z as z23 } from "zod";
16653
+ var ArchiveReason = z23.enum([
16347
16654
  "verified",
16348
16655
  "reconciled",
16349
16656
  "superseded",
@@ -16354,42 +16661,42 @@ var ArchiveReason = z22.enum([
16354
16661
  var ARCHIVE_REASON_VALUES = ArchiveReason.options;
16355
16662
 
16356
16663
  // packages/contracts/src/tasks/index.ts
16357
- import { z as z23 } from "zod";
16358
- var taskMutationWarningSeveritySchema = z23.enum(["info", "warning"]);
16359
- var taskMutationWarningSchema = z23.object({
16360
- code: z23.string().min(1),
16361
- message: z23.string().min(1),
16664
+ import { z as z24 } from "zod";
16665
+ var taskMutationWarningSeveritySchema = z24.enum(["info", "warning"]);
16666
+ var taskMutationWarningSchema = z24.object({
16667
+ code: z24.string().min(1),
16668
+ message: z24.string().min(1),
16362
16669
  severity: taskMutationWarningSeveritySchema.optional(),
16363
- taskId: z23.string().min(1).optional(),
16364
- field: z23.string().min(1).optional(),
16365
- index: z23.number().int().nonnegative().optional()
16670
+ taskId: z24.string().min(1).optional(),
16671
+ field: z24.string().min(1).optional(),
16672
+ index: z24.number().int().nonnegative().optional()
16366
16673
  });
16367
- var taskMutationDryRunSummarySchema = z23.object({
16368
- dryRun: z23.literal(true),
16369
- wouldCreate: z23.number().int().nonnegative(),
16370
- wouldUpdate: z23.number().int().nonnegative(),
16371
- wouldDelete: z23.number().int().nonnegative(),
16372
- wouldAffect: z23.number().int().nonnegative(),
16373
- validatedCount: z23.number().int().nonnegative(),
16374
- insertedCount: z23.literal(0),
16375
- updatedCount: z23.literal(0),
16376
- deletedCount: z23.literal(0),
16377
- warnings: z23.array(taskMutationWarningSchema)
16674
+ var taskMutationDryRunSummarySchema = z24.object({
16675
+ dryRun: z24.literal(true),
16676
+ wouldCreate: z24.number().int().nonnegative(),
16677
+ wouldUpdate: z24.number().int().nonnegative(),
16678
+ wouldDelete: z24.number().int().nonnegative(),
16679
+ wouldAffect: z24.number().int().nonnegative(),
16680
+ validatedCount: z24.number().int().nonnegative(),
16681
+ insertedCount: z24.literal(0),
16682
+ updatedCount: z24.literal(0),
16683
+ deletedCount: z24.literal(0),
16684
+ warnings: z24.array(taskMutationWarningSchema)
16378
16685
  });
16379
- var taskMutationTaskRecordSchema = z23.object({ id: z23.string().min(1) }).passthrough();
16380
- var taskMutationEnvelopeSchema = z23.object({
16381
- dryRun: z23.boolean().optional(),
16382
- created: z23.array(taskMutationTaskRecordSchema),
16383
- updated: z23.array(taskMutationTaskRecordSchema),
16384
- deleted: z23.array(taskMutationTaskRecordSchema),
16385
- affectedCount: z23.number().int().nonnegative(),
16386
- mutationWarnings: z23.array(taskMutationWarningSchema),
16686
+ var taskMutationTaskRecordSchema = z24.object({ id: z24.string().min(1) }).passthrough();
16687
+ var taskMutationEnvelopeSchema = z24.object({
16688
+ dryRun: z24.boolean().optional(),
16689
+ created: z24.array(taskMutationTaskRecordSchema),
16690
+ updated: z24.array(taskMutationTaskRecordSchema),
16691
+ deleted: z24.array(taskMutationTaskRecordSchema),
16692
+ affectedCount: z24.number().int().nonnegative(),
16693
+ mutationWarnings: z24.array(taskMutationWarningSchema),
16387
16694
  dryRunSummary: taskMutationDryRunSummarySchema.optional()
16388
16695
  });
16389
- var completionTaskStatusSchema = z23.enum(TASK_STATUSES);
16390
- var completionCriterionKindSchema = z23.enum(["text", "evidence_bound", "child_task"]);
16391
- var completionCriterionStatusSchema = z23.enum(["satisfied", "unsatisfied", "waived", "replaced"]);
16392
- var completionBlockerReasonSchema = z23.enum([
16696
+ var completionTaskStatusSchema = z24.enum(TASK_STATUSES);
16697
+ var completionCriterionKindSchema = z24.enum(["text", "evidence_bound", "child_task"]);
16698
+ var completionCriterionStatusSchema = z24.enum(["satisfied", "unsatisfied", "waived", "replaced"]);
16699
+ var completionBlockerReasonSchema = z24.enum([
16393
16700
  "missing_evidence_binding",
16394
16701
  "child_not_done",
16395
16702
  "child_cancelled_requires_waiver",
@@ -16397,68 +16704,68 @@ var completionBlockerReasonSchema = z23.enum([
16397
16704
  "child_missing",
16398
16705
  "done_parent_stale"
16399
16706
  ]);
16400
- var completionStaleReasonSchema = z23.enum(["done_parent_has_unsatisfied_criteria"]);
16401
- var completionProjectionRepairErrorCodeSchema = z23.enum([
16707
+ var completionStaleReasonSchema = z24.enum(["done_parent_has_unsatisfied_criteria"]);
16708
+ var completionProjectionRepairErrorCodeSchema = z24.enum([
16402
16709
  "projection_not_stale",
16403
16710
  "criteria_missing",
16404
16711
  "binding_target_missing",
16405
16712
  "repair_conflict"
16406
16713
  ]);
16407
- var completionCriterionWaiverSchema = z23.object({
16408
- criterionAcId: z23.string().min(1),
16409
- childTaskId: z23.string().min(1),
16410
- reason: z23.string().min(1),
16411
- actor: z23.string().min(1),
16412
- waivedAt: z23.string().min(1)
16714
+ var completionCriterionWaiverSchema = z24.object({
16715
+ criterionAcId: z24.string().min(1),
16716
+ childTaskId: z24.string().min(1),
16717
+ reason: z24.string().min(1),
16718
+ actor: z24.string().min(1),
16719
+ waivedAt: z24.string().min(1)
16413
16720
  });
16414
- var completionCriterionReplacementSchema = z23.object({
16415
- criterionAcId: z23.string().min(1),
16416
- originalChildTaskId: z23.string().min(1),
16417
- replacementChildTaskId: z23.string().min(1),
16418
- reason: z23.string().min(1),
16419
- actor: z23.string().min(1),
16420
- replacedAt: z23.string().min(1)
16721
+ var completionCriterionReplacementSchema = z24.object({
16722
+ criterionAcId: z24.string().min(1),
16723
+ originalChildTaskId: z24.string().min(1),
16724
+ replacementChildTaskId: z24.string().min(1),
16725
+ reason: z24.string().min(1),
16726
+ actor: z24.string().min(1),
16727
+ replacedAt: z24.string().min(1)
16421
16728
  });
16422
- var completionCriterionEvaluationSchema = z23.object({
16423
- acId: z23.string().min(1),
16424
- alias: z23.string().min(1),
16425
- text: z23.string(),
16729
+ var completionCriterionEvaluationSchema = z24.object({
16730
+ acId: z24.string().min(1),
16731
+ alias: z24.string().min(1),
16732
+ text: z24.string(),
16426
16733
  kind: completionCriterionKindSchema,
16427
16734
  status: completionCriterionStatusSchema,
16428
16735
  reason: completionBlockerReasonSchema.optional(),
16429
- targetTaskId: z23.string().min(1).optional(),
16736
+ targetTaskId: z24.string().min(1).optional(),
16430
16737
  targetTaskStatus: completionTaskStatusSchema.optional(),
16431
16738
  waiver: completionCriterionWaiverSchema.optional(),
16432
16739
  replacement: completionCriterionReplacementSchema.optional(),
16433
16740
  replacementTaskStatus: completionTaskStatusSchema.optional(),
16434
- evidenceBindings: z23.number().int().nonnegative()
16741
+ evidenceBindings: z24.number().int().nonnegative()
16435
16742
  });
16436
16743
  var unsatisfiedCompletionCriterionSchema = completionCriterionEvaluationSchema.extend({
16437
- status: z23.literal("unsatisfied"),
16744
+ status: z24.literal("unsatisfied"),
16438
16745
  reason: completionBlockerReasonSchema
16439
16746
  });
16440
- var completionTotalsSchema = z23.object({
16441
- criteria: z23.number().int().nonnegative(),
16442
- satisfied: z23.number().int().nonnegative(),
16443
- unsatisfied: z23.number().int().nonnegative(),
16444
- waived: z23.number().int().nonnegative(),
16445
- replaced: z23.number().int().nonnegative()
16747
+ var completionTotalsSchema = z24.object({
16748
+ criteria: z24.number().int().nonnegative(),
16749
+ satisfied: z24.number().int().nonnegative(),
16750
+ unsatisfied: z24.number().int().nonnegative(),
16751
+ waived: z24.number().int().nonnegative(),
16752
+ replaced: z24.number().int().nonnegative()
16446
16753
  });
16447
- var completionContextPackSchema = z23.object({
16448
- taskId: z23.string().min(1),
16449
- generatedAt: z23.string().min(1),
16450
- source: z23.literal("audit_log"),
16451
- window: z23.object({
16452
- limit: z23.number().int().positive(),
16453
- since: z23.string().min(1).optional(),
16454
- relationDepth: z23.number().int().nonnegative(),
16455
- relatedTaskIds: z23.array(z23.string().min(1))
16754
+ var completionContextPackSchema = z24.object({
16755
+ taskId: z24.string().min(1),
16756
+ generatedAt: z24.string().min(1),
16757
+ source: z24.literal("audit_log"),
16758
+ window: z24.object({
16759
+ limit: z24.number().int().positive(),
16760
+ since: z24.string().min(1).optional(),
16761
+ relationDepth: z24.number().int().nonnegative(),
16762
+ relatedTaskIds: z24.array(z24.string().min(1))
16456
16763
  }),
16457
- events: z23.array(
16458
- z23.object({
16459
- id: z23.string().min(1),
16460
- timestamp: z23.string().min(1),
16461
- action: z23.enum([
16764
+ events: z24.array(
16765
+ z24.object({
16766
+ id: z24.string().min(1),
16767
+ timestamp: z24.string().min(1),
16768
+ action: z24.enum([
16462
16769
  "task_completed",
16463
16770
  "task_reopened",
16464
16771
  "task_cancelled",
@@ -16466,77 +16773,77 @@ var completionContextPackSchema = z23.object({
16466
16773
  "task_reparented",
16467
16774
  "ac_projection_rebuilt"
16468
16775
  ]),
16469
- taskId: z23.string().min(1),
16470
- relation: z23.enum(["self", "parent", "child", "sibling", "related"]),
16471
- actor: z23.string().min(1),
16472
- details: z23.record(z23.string(), z23.unknown()).optional(),
16473
- before: z23.record(z23.string(), z23.unknown()).optional(),
16474
- after: z23.record(z23.string(), z23.unknown()).optional()
16776
+ taskId: z24.string().min(1),
16777
+ relation: z24.enum(["self", "parent", "child", "sibling", "related"]),
16778
+ actor: z24.string().min(1),
16779
+ details: z24.record(z24.string(), z24.unknown()).optional(),
16780
+ before: z24.record(z24.string(), z24.unknown()).optional(),
16781
+ after: z24.record(z24.string(), z24.unknown()).optional()
16475
16782
  })
16476
16783
  ),
16477
- summary: z23.object({
16478
- totalEvents: z23.number().int().nonnegative(),
16479
- byAction: z23.record(z23.string(), z23.number().int().nonnegative()),
16480
- byRelation: z23.record(z23.string(), z23.number().int().nonnegative()),
16481
- latestEventAt: z23.string().nullable()
16784
+ summary: z24.object({
16785
+ totalEvents: z24.number().int().nonnegative(),
16786
+ byAction: z24.record(z24.string(), z24.number().int().nonnegative()),
16787
+ byRelation: z24.record(z24.string(), z24.number().int().nonnegative()),
16788
+ latestEventAt: z24.string().nullable()
16482
16789
  })
16483
16790
  });
16484
- var completionEvaluationSchema = z23.object({
16485
- taskId: z23.string().min(1),
16791
+ var completionEvaluationSchema = z24.object({
16792
+ taskId: z24.string().min(1),
16486
16793
  taskStatus: completionTaskStatusSchema,
16487
- ready: z23.boolean(),
16488
- stale: z23.boolean(),
16489
- staleReasons: z23.array(completionStaleReasonSchema),
16794
+ ready: z24.boolean(),
16795
+ stale: z24.boolean(),
16796
+ staleReasons: z24.array(completionStaleReasonSchema),
16490
16797
  contextPack: completionContextPackSchema.optional(),
16491
- satisfied: z23.array(completionCriterionEvaluationSchema),
16492
- unsatisfied: z23.array(unsatisfiedCompletionCriterionSchema),
16493
- waived: z23.array(completionCriterionEvaluationSchema),
16494
- replaced: z23.array(completionCriterionEvaluationSchema),
16798
+ satisfied: z24.array(completionCriterionEvaluationSchema),
16799
+ unsatisfied: z24.array(unsatisfiedCompletionCriterionSchema),
16800
+ waived: z24.array(completionCriterionEvaluationSchema),
16801
+ replaced: z24.array(completionCriterionEvaluationSchema),
16495
16802
  totals: completionTotalsSchema
16496
16803
  });
16497
- var completionExplanationSchema = z23.object({
16498
- taskId: z23.string().min(1),
16499
- ready: z23.boolean(),
16500
- stale: z23.boolean(),
16501
- summary: z23.string(),
16804
+ var completionExplanationSchema = z24.object({
16805
+ taskId: z24.string().min(1),
16806
+ ready: z24.boolean(),
16807
+ stale: z24.boolean(),
16808
+ summary: z24.string(),
16502
16809
  contextPack: completionContextPackSchema.optional(),
16503
- blockers: z23.array(completionCriterionEvaluationSchema)
16810
+ blockers: z24.array(completionCriterionEvaluationSchema)
16504
16811
  });
16505
- var completionListParamsSchema = z23.object({
16506
- taskId: z23.string().min(1),
16812
+ var completionListParamsSchema = z24.object({
16813
+ taskId: z24.string().min(1),
16507
16814
  status: completionCriterionStatusSchema.optional(),
16508
16815
  kind: completionCriterionKindSchema.optional()
16509
16816
  });
16510
- var completionListResultSchema = z23.object({
16511
- taskId: z23.string().min(1),
16512
- criteria: z23.array(completionCriterionEvaluationSchema),
16817
+ var completionListResultSchema = z24.object({
16818
+ taskId: z24.string().min(1),
16819
+ criteria: z24.array(completionCriterionEvaluationSchema),
16513
16820
  totals: completionTotalsSchema
16514
16821
  });
16515
- var completionEvaluateParamsSchema = z23.object({
16516
- taskId: z23.string().min(1),
16517
- includeContext: z23.boolean().optional(),
16518
- limit: z23.number().int().positive().optional(),
16519
- since: z23.string().min(1).optional(),
16520
- relationDepth: z23.number().int().nonnegative().optional()
16822
+ var completionEvaluateParamsSchema = z24.object({
16823
+ taskId: z24.string().min(1),
16824
+ includeContext: z24.boolean().optional(),
16825
+ limit: z24.number().int().positive().optional(),
16826
+ since: z24.string().min(1).optional(),
16827
+ relationDepth: z24.number().int().nonnegative().optional()
16521
16828
  });
16522
- var completionProjectionRepairErrorSchema = z23.object({
16829
+ var completionProjectionRepairErrorSchema = z24.object({
16523
16830
  code: completionProjectionRepairErrorCodeSchema,
16524
- message: z23.string().min(1),
16525
- taskId: z23.string().min(1),
16526
- acId: z23.string().min(1).optional(),
16527
- evidenceAtomId: z23.string().min(1).optional()
16831
+ message: z24.string().min(1),
16832
+ taskId: z24.string().min(1),
16833
+ acId: z24.string().min(1).optional(),
16834
+ evidenceAtomId: z24.string().min(1).optional()
16528
16835
  });
16529
- var completionProjectionRepairParamsSchema = z23.object({
16530
- taskId: z23.string().min(1),
16531
- dryRun: z23.boolean().optional()
16836
+ var completionProjectionRepairParamsSchema = z24.object({
16837
+ taskId: z24.string().min(1),
16838
+ dryRun: z24.boolean().optional()
16532
16839
  });
16533
- var completionProjectionRepairResultSchema = z23.object({
16534
- taskId: z23.string().min(1),
16535
- repaired: z23.boolean(),
16536
- dryRun: z23.boolean(),
16537
- staleBefore: z23.boolean(),
16538
- staleAfter: z23.boolean(),
16539
- errors: z23.array(completionProjectionRepairErrorSchema)
16840
+ var completionProjectionRepairResultSchema = z24.object({
16841
+ taskId: z24.string().min(1),
16842
+ repaired: z24.boolean(),
16843
+ dryRun: z24.boolean(),
16844
+ staleBefore: z24.boolean(),
16845
+ staleAfter: z24.boolean(),
16846
+ errors: z24.array(completionProjectionRepairErrorSchema)
16540
16847
  });
16541
16848
 
16542
16849
  // packages/contracts/src/taxonomy.ts
@@ -17039,7 +17346,7 @@ var TaxonomyRegistry = class _TaxonomyRegistry {
17039
17346
  };
17040
17347
 
17041
17348
  // packages/contracts/src/templates/manifest.ts
17042
- import { z as z24 } from "zod";
17349
+ import { z as z25 } from "zod";
17043
17350
  var TEMPLATE_KINDS = ["workflow", "config", "agent", "skill", "provider", "doc"];
17044
17351
  var TEMPLATE_SUBSTITUTIONS = ["regex-tmpl", "static", "json-merge"];
17045
17352
  var TEMPLATE_UPDATE_STRATEGIES = [
@@ -17056,79 +17363,79 @@ var PLACEHOLDER_SOURCES = [
17056
17363
  "tool-resolver",
17057
17364
  "literal"
17058
17365
  ];
17059
- var PlaceholderSpecSchema = z24.object({
17366
+ var PlaceholderSpecSchema = z25.object({
17060
17367
  /**
17061
17368
  * Placeholder identifier as it appears in the template body
17062
17369
  * (e.g. `NODE_VERSION` matches `{{NODE_VERSION}}`).
17063
17370
  */
17064
- name: z24.string().min(1, "placeholder name must be non-empty"),
17371
+ name: z25.string().min(1, "placeholder name must be non-empty"),
17065
17372
  /** Resolver source the installer consults for this placeholder. */
17066
- source: z24.enum(PLACEHOLDER_SOURCES),
17373
+ source: z25.enum(PLACEHOLDER_SOURCES),
17067
17374
  /**
17068
17375
  * Path expression evaluated against `source` (e.g. `engines.node` against
17069
17376
  * `project-context`, `defaults.branchModel` against `.cleo/config`).
17070
17377
  * For `literal` source, this MAY be the literal value's identifier.
17071
17378
  */
17072
- sourcePath: z24.string().min(1, "placeholder sourcePath must be non-empty"),
17379
+ sourcePath: z25.string().min(1, "placeholder sourcePath must be non-empty"),
17073
17380
  /**
17074
17381
  * Fallback value used when `source[sourcePath]` resolves to `undefined`.
17075
17382
  * `null` is permitted to explicitly mark "no default — failure required".
17076
17383
  */
17077
- defaultValue: z24.union([z24.string(), z24.number(), z24.boolean(), z24.null()]).optional()
17384
+ defaultValue: z25.union([z25.string(), z25.number(), z25.boolean(), z25.null()]).optional()
17078
17385
  });
17079
- var TemplateManifestEntrySchema = z24.object({
17386
+ var TemplateManifestEntrySchema = z25.object({
17080
17387
  /** Stable identifier for this template entry. */
17081
- id: z24.string().min(1, "id must be non-empty"),
17388
+ id: z25.string().min(1, "id must be non-empty"),
17082
17389
  /** Category of file this template represents. */
17083
- kind: z24.enum(TEMPLATE_KINDS),
17390
+ kind: z25.enum(TEMPLATE_KINDS),
17084
17391
  /** Repo-relative path of the template source file. */
17085
- sourcePath: z24.string().min(1, "sourcePath must be non-empty"),
17392
+ sourcePath: z25.string().min(1, "sourcePath must be non-empty"),
17086
17393
  /** Project-relative path where the rendered template installs. */
17087
- installPath: z24.string().min(1, "installPath must be non-empty"),
17394
+ installPath: z25.string().min(1, "installPath must be non-empty"),
17088
17395
  /** Substitution strategy the installer applies to `sourcePath`. */
17089
- substitution: z24.enum(TEMPLATE_SUBSTITUTIONS),
17396
+ substitution: z25.enum(TEMPLATE_SUBSTITUTIONS),
17090
17397
  /** Declared placeholders this template requires. May be empty. */
17091
- placeholders: z24.array(PlaceholderSpecSchema),
17398
+ placeholders: z25.array(PlaceholderSpecSchema),
17092
17399
  /** Reconciliation policy on upgrade. */
17093
- updateStrategy: z24.enum(TEMPLATE_UPDATE_STRATEGIES)
17400
+ updateStrategy: z25.enum(TEMPLATE_UPDATE_STRATEGIES)
17094
17401
  });
17095
17402
 
17096
17403
  // packages/contracts/src/validator/index.ts
17097
- import { z as z25 } from "zod";
17404
+ import { z as z26 } from "zod";
17098
17405
  var VALIDATOR_ID_REGEX = /^validator-[a-z0-9][a-z0-9-]*$/;
17099
- var validatorFindingSchema = z25.object({
17100
- acId: z25.string().min(1, "acId must be non-empty"),
17101
- status: z25.enum(["pass", "fail", "inconclusive"]),
17102
- reasoning: z25.string().min(1, "reasoning must be non-empty"),
17103
- evidenceRefs: z25.array(z25.string()).optional(),
17104
- checkedAt: z25.string().min(1, "checkedAt must be a non-empty ISO-8601 string")
17406
+ var validatorFindingSchema = z26.object({
17407
+ acId: z26.string().min(1, "acId must be non-empty"),
17408
+ status: z26.enum(["pass", "fail", "inconclusive"]),
17409
+ reasoning: z26.string().min(1, "reasoning must be non-empty"),
17410
+ evidenceRefs: z26.array(z26.string()).optional(),
17411
+ checkedAt: z26.string().min(1, "checkedAt must be a non-empty ISO-8601 string")
17105
17412
  });
17106
- var validatorAttestationSchema = z25.object({
17107
- verdict: z25.literal("attest"),
17108
- taskId: z25.string().min(1),
17109
- validatorId: z25.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
17110
- findings: z25.array(validatorFindingSchema).min(1, "attestation must contain at least one finding").refine(
17413
+ var validatorAttestationSchema = z26.object({
17414
+ verdict: z26.literal("attest"),
17415
+ taskId: z26.string().min(1),
17416
+ validatorId: z26.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
17417
+ findings: z26.array(validatorFindingSchema).min(1, "attestation must contain at least one finding").refine(
17111
17418
  (findings) => findings.every((f) => f.status === "pass"),
17112
17419
  'attestation requires every finding to have status="pass"'
17113
17420
  ),
17114
- summary: z25.string().optional(),
17115
- attestedAt: z25.string().min(1),
17116
- schemaVersion: z25.literal("1")
17421
+ summary: z26.string().optional(),
17422
+ attestedAt: z26.string().min(1),
17423
+ schemaVersion: z26.literal("1")
17117
17424
  });
17118
- var validatorRejectionSchema = z25.object({
17119
- verdict: z25.literal("reject"),
17120
- taskId: z25.string().min(1),
17121
- validatorId: z25.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
17122
- findings: z25.array(validatorFindingSchema).min(1, "rejection must contain at least one finding").refine(
17425
+ var validatorRejectionSchema = z26.object({
17426
+ verdict: z26.literal("reject"),
17427
+ taskId: z26.string().min(1),
17428
+ validatorId: z26.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
17429
+ findings: z26.array(validatorFindingSchema).min(1, "rejection must contain at least one finding").refine(
17123
17430
  (findings) => findings.some((f) => f.status !== "pass"),
17124
17431
  'rejection requires at least one finding with status "fail" or "inconclusive"'
17125
17432
  ),
17126
- summary: z25.string().min(1, "rejection summary must be non-empty"),
17127
- remediationHints: z25.array(z25.string()).optional(),
17128
- rejectedAt: z25.string().min(1),
17129
- schemaVersion: z25.literal("1")
17433
+ summary: z26.string().min(1, "rejection summary must be non-empty"),
17434
+ remediationHints: z26.array(z26.string()).optional(),
17435
+ rejectedAt: z26.string().min(1),
17436
+ schemaVersion: z26.literal("1")
17130
17437
  });
17131
- var validatorVerdictSchema = z25.discriminatedUnion("verdict", [
17438
+ var validatorVerdictSchema = z26.discriminatedUnion("verdict", [
17132
17439
  validatorAttestationSchema,
17133
17440
  validatorRejectionSchema
17134
17441
  ]);
@@ -17878,7 +18185,7 @@ var CAAMP_DAMAGED_START_PATTERN_SOURCE = damagedMarkerSource("START");
17878
18185
  var CAAMP_DAMAGED_END_PATTERN_SOURCE = damagedMarkerSource("END");
17879
18186
 
17880
18187
  // packages/contracts/src/decide.ts
17881
- import { z as z26 } from "zod";
18188
+ import { z as z27 } from "zod";
17882
18189
  var DECISION_QUESTION_TYPES = ["noul", "choice", "score"];
17883
18190
  var DECISION_OUTCOME_SOURCES = ["provider", "cache", "fallback"];
17884
18191
  var DECISION_REQUEST_LIMITS = {
@@ -17900,11 +18207,11 @@ var DECISION_REQUEST_LIMITS = {
17900
18207
  maxScoreLevels: 10
17901
18208
  };
17902
18209
  var DECISION_PROVIDER_KINDS = ["layahost", "jev"];
17903
- var decisionQuestionTypeSchema = z26.enum(DECISION_QUESTION_TYPES);
17904
- var decisionOutcomeSourceSchema = z26.enum(DECISION_OUTCOME_SOURCES);
17905
- var decisionInstructionsSchema = z26.union([z26.string(), z26.record(z26.string(), z26.json())]);
17906
- var unitIntervalSchema = z26.number().min(0).max(1);
17907
- var decisionStateSchema = z26.union([z26.string(), z26.array(z26.json()), z26.record(z26.string(), z26.json())]).superRefine((state, context) => {
18210
+ var decisionQuestionTypeSchema = z27.enum(DECISION_QUESTION_TYPES);
18211
+ var decisionOutcomeSourceSchema = z27.enum(DECISION_OUTCOME_SOURCES);
18212
+ var decisionInstructionsSchema = z27.union([z27.string(), z27.record(z27.string(), z27.json())]);
18213
+ var unitIntervalSchema = z27.number().min(0).max(1);
18214
+ var decisionStateSchema = z27.union([z27.string(), z27.array(z27.json()), z27.record(z27.string(), z27.json())]).superRefine((state, context) => {
17908
18215
  const size = typeof state === "string" ? state.length : JSON.stringify(state).length;
17909
18216
  if (size > DECISION_REQUEST_LIMITS.maxStateChars) {
17910
18217
  context.addIssue({
@@ -17913,34 +18220,34 @@ var decisionStateSchema = z26.union([z26.string(), z26.array(z26.json()), z26.re
17913
18220
  });
17914
18221
  }
17915
18222
  });
17916
- var noulDecisionQuestionSchema = z26.object({
17917
- type: z26.literal("noul"),
18223
+ var noulDecisionQuestionSchema = z27.object({
18224
+ type: z27.literal("noul"),
17918
18225
  instructions: decisionInstructionsSchema.optional(),
17919
- criteria: z26.string().min(1)
18226
+ criteria: z27.string().min(1)
17920
18227
  });
17921
- var choiceDecisionQuestionSchema = z26.object({
17922
- type: z26.literal("choice"),
18228
+ var choiceDecisionQuestionSchema = z27.object({
18229
+ type: z27.literal("choice"),
17923
18230
  instructions: decisionInstructionsSchema.optional(),
17924
- criteria: z26.record(z26.string().min(1), z26.string()).refine((options) => Object.keys(options).length >= DECISION_REQUEST_LIMITS.minChoiceOptions, {
18231
+ criteria: z27.record(z27.string().min(1), z27.string()).refine((options) => Object.keys(options).length >= DECISION_REQUEST_LIMITS.minChoiceOptions, {
17925
18232
  message: `a choice question needs at least ${DECISION_REQUEST_LIMITS.minChoiceOptions} options`
17926
18233
  })
17927
18234
  });
17928
- var scoreDecisionQuestionSchema = z26.object({
17929
- type: z26.literal("score"),
18235
+ var scoreDecisionQuestionSchema = z27.object({
18236
+ type: z27.literal("score"),
17930
18237
  instructions: decisionInstructionsSchema.optional(),
17931
- criteria: z26.array(z26.string()).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels)
18238
+ criteria: z27.array(z27.string()).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels)
17932
18239
  });
17933
- var decisionQuestionSchema = z26.discriminatedUnion("type", [
18240
+ var decisionQuestionSchema = z27.discriminatedUnion("type", [
17934
18241
  noulDecisionQuestionSchema,
17935
18242
  choiceDecisionQuestionSchema,
17936
18243
  scoreDecisionQuestionSchema
17937
18244
  ]);
17938
- var decisionRequestSchema = z26.object({
17939
- model: z26.string().min(1).optional(),
17940
- lang: z26.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$/).optional(),
17941
- cache: z26.boolean().optional(),
18245
+ var decisionRequestSchema = z27.object({
18246
+ model: z27.string().min(1).optional(),
18247
+ lang: z27.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$/).optional(),
18248
+ cache: z27.boolean().optional(),
17942
18249
  state: decisionStateSchema,
17943
- questions: z26.record(z26.string().min(1), decisionQuestionSchema).refine(
18250
+ questions: z27.record(z27.string().min(1), decisionQuestionSchema).refine(
17944
18251
  (questions) => {
17945
18252
  const count = Object.keys(questions).length;
17946
18253
  return count >= DECISION_REQUEST_LIMITS.minQuestions && count <= DECISION_REQUEST_LIMITS.maxQuestions;
@@ -17950,139 +18257,139 @@ var decisionRequestSchema = z26.object({
17950
18257
  }
17951
18258
  )
17952
18259
  });
17953
- var noulDecisionAnswerSchema = z26.object({
17954
- type: z26.literal("noul"),
17955
- value: z26.boolean(),
18260
+ var noulDecisionAnswerSchema = z27.object({
18261
+ type: z27.literal("noul"),
18262
+ value: z27.boolean(),
17956
18263
  probability: unitIntervalSchema,
17957
18264
  confidence: unitIntervalSchema
17958
18265
  });
17959
- var choiceDecisionAnswerSchema = z26.object({
17960
- type: z26.literal("choice"),
17961
- value: z26.string().min(1),
17962
- probabilities: z26.record(z26.string().min(1), unitIntervalSchema),
18266
+ var choiceDecisionAnswerSchema = z27.object({
18267
+ type: z27.literal("choice"),
18268
+ value: z27.string().min(1),
18269
+ probabilities: z27.record(z27.string().min(1), unitIntervalSchema),
17963
18270
  confidence: unitIntervalSchema
17964
18271
  });
17965
- var scoreDecisionAnswerSchema = z26.object({
17966
- type: z26.literal("score"),
17967
- value: z26.number().int().nonnegative(),
17968
- probabilities: z26.array(unitIntervalSchema).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels),
18272
+ var scoreDecisionAnswerSchema = z27.object({
18273
+ type: z27.literal("score"),
18274
+ value: z27.number().int().nonnegative(),
18275
+ probabilities: z27.array(unitIntervalSchema).min(DECISION_REQUEST_LIMITS.minScoreLevels).max(DECISION_REQUEST_LIMITS.maxScoreLevels),
17969
18276
  confidence: unitIntervalSchema
17970
18277
  });
17971
- var decisionAnswerSchema = z26.discriminatedUnion("type", [
18278
+ var decisionAnswerSchema = z27.discriminatedUnion("type", [
17972
18279
  noulDecisionAnswerSchema,
17973
18280
  choiceDecisionAnswerSchema,
17974
18281
  scoreDecisionAnswerSchema
17975
18282
  ]);
17976
- var decisionOutcomeSchema = z26.object({
17977
- answers: z26.record(z26.string().min(1), decisionAnswerSchema),
18283
+ var decisionOutcomeSchema = z27.object({
18284
+ answers: z27.record(z27.string().min(1), decisionAnswerSchema),
17978
18285
  source: decisionOutcomeSourceSchema,
17979
- requestId: z26.string().min(1).optional(),
17980
- latencyMs: z26.number().nonnegative(),
17981
- costUsd: z26.number().nonnegative().optional(),
17982
- costMicros: z26.number().int().nonnegative().optional(),
17983
- balanceMicros: z26.number().int().optional(),
17984
- checkpoint: z26.string().min(1).optional(),
17985
- inputTokens: z26.number().int().nonnegative().optional()
18286
+ requestId: z27.string().min(1).optional(),
18287
+ latencyMs: z27.number().nonnegative(),
18288
+ costUsd: z27.number().nonnegative().optional(),
18289
+ costMicros: z27.number().int().nonnegative().optional(),
18290
+ balanceMicros: z27.number().int().optional(),
18291
+ checkpoint: z27.string().min(1).optional(),
18292
+ inputTokens: z27.number().int().nonnegative().optional()
17986
18293
  });
17987
- var decisionProviderKindSchema = z26.enum(DECISION_PROVIDER_KINDS);
17988
- var decisionProviderConfigSchema = z26.object({
17989
- baseUrl: z26.url(),
18294
+ var decisionProviderKindSchema = z27.enum(DECISION_PROVIDER_KINDS);
18295
+ var decisionProviderConfigSchema = z27.object({
18296
+ baseUrl: z27.url(),
17990
18297
  provider: decisionProviderKindSchema.optional()
17991
18298
  });
17992
18299
 
17993
18300
  // packages/contracts/src/nexus-account.ts
17994
- import { z as z27 } from "zod";
17995
- var nexusAccountUserSchema = z27.object({
17996
- id: z27.string(),
17997
- email: z27.string(),
17998
- name: z27.string().nullable().optional()
18301
+ import { z as z28 } from "zod";
18302
+ var nexusAccountUserSchema = z28.object({
18303
+ id: z28.string(),
18304
+ email: z28.string(),
18305
+ name: z28.string().nullable().optional()
17999
18306
  });
18000
- var nexusAccountOrganizationSchema = z27.object({
18001
- id: z27.string(),
18002
- name: z27.string(),
18003
- slug: z27.string().nullable().optional(),
18004
- role: z27.string().optional(),
18307
+ var nexusAccountOrganizationSchema = z28.object({
18308
+ id: z28.string(),
18309
+ name: z28.string(),
18310
+ slug: z28.string().nullable().optional(),
18311
+ role: z28.string().optional(),
18005
18312
  /** `true` for the personal organization created at sign-up. */
18006
- personal: z27.boolean().optional()
18313
+ personal: z28.boolean().optional()
18007
18314
  });
18008
- var nexusAccountMeSchema = z27.object({
18315
+ var nexusAccountMeSchema = z28.object({
18009
18316
  user: nexusAccountUserSchema,
18010
- organizations: z27.array(nexusAccountOrganizationSchema).default([])
18317
+ organizations: z28.array(nexusAccountOrganizationSchema).default([])
18011
18318
  });
18012
18319
 
18013
18320
  // packages/contracts/src/nexus-cloud.ts
18014
- import { z as z28 } from "zod";
18321
+ import { z as z29 } from "zod";
18015
18322
  var NEXUS_DEVICE_STATES = ["active", "signed-out", "revoked"];
18016
18323
  var NEXUS_CLOUD_PROFILES = ["device", "read-only"];
18017
18324
  var NEXUS_DEVICE_STATE_UNKNOWN = "unknown";
18018
- var isoTime = z28.iso.datetime({ offset: true });
18019
- var profile = z28.enum(NEXUS_CLOUD_PROFILES).nullable().catch(null);
18020
- var deviceState = z28.enum([...NEXUS_DEVICE_STATES, NEXUS_DEVICE_STATE_UNKNOWN]).catch(NEXUS_DEVICE_STATE_UNKNOWN);
18021
- var nexusCloudCredentialSchema = z28.object({
18022
- kind: z28.enum(["device", "session"]),
18023
- credentialId: z28.string().nullable().optional(),
18325
+ var isoTime = z29.iso.datetime({ offset: true });
18326
+ var profile = z29.enum(NEXUS_CLOUD_PROFILES).nullable().catch(null);
18327
+ var deviceState = z29.enum([...NEXUS_DEVICE_STATES, NEXUS_DEVICE_STATE_UNKNOWN]).catch(NEXUS_DEVICE_STATE_UNKNOWN);
18328
+ var nexusCloudCredentialSchema = z29.object({
18329
+ kind: z29.enum(["device", "session"]),
18330
+ credentialId: z29.string().nullable().optional(),
18024
18331
  profile: profile.optional(),
18025
- scopes: z28.array(z28.string()).default([]),
18332
+ scopes: z29.array(z29.string()).default([]),
18026
18333
  createdAt: isoTime.nullable().optional(),
18027
18334
  lastUsedAt: isoTime.nullable().optional(),
18028
18335
  /** When the credential expires if it is not used again; null for sessions. */
18029
18336
  idleExpiresAt: isoTime.nullable().optional()
18030
18337
  });
18031
- var nexusCloudDeviceSchema = z28.object({
18032
- deviceId: z28.string(),
18033
- name: z28.string(),
18034
- platform: z28.string().optional(),
18035
- arch: z28.string().nullable().optional(),
18036
- cliVersion: z28.string().nullable().optional(),
18338
+ var nexusCloudDeviceSchema = z29.object({
18339
+ deviceId: z29.string(),
18340
+ name: z29.string(),
18341
+ platform: z29.string().optional(),
18342
+ arch: z29.string().nullable().optional(),
18343
+ cliVersion: z29.string().nullable().optional(),
18037
18344
  createdAt: isoTime.optional(),
18038
18345
  lastSeenAt: isoTime.nullable().optional(),
18039
18346
  state: deviceState,
18040
18347
  signedOutAt: isoTime.nullable().optional(),
18041
18348
  /** Base64 device certificate; null until the device holds a key grant. */
18042
- certificate: z28.string().nullable().optional(),
18349
+ certificate: z29.string().nullable().optional(),
18043
18350
  /** The current credential's profile, or null with none (signed out or revoked). */
18044
18351
  profile: profile.optional(),
18045
18352
  /** True for the device whose credential made this request. */
18046
- current: z28.boolean().default(false),
18047
- projects: z28.number().int().nonnegative().optional(),
18048
- replicas: z28.number().int().nonnegative().optional(),
18353
+ current: z29.boolean().default(false),
18354
+ projects: z29.number().int().nonnegative().optional(),
18355
+ replicas: z29.number().int().nonnegative().optional(),
18049
18356
  lastSyncAt: isoTime.nullable().optional(),
18050
18357
  lastPresenceAt: isoTime.nullable().optional()
18051
18358
  });
18052
- var nexusCloudOrganizationSchema = z28.object({
18053
- id: z28.string(),
18054
- name: z28.string(),
18055
- slug: z28.string().nullable().optional(),
18056
- role: z28.string().optional(),
18057
- personal: z28.boolean().optional()
18359
+ var nexusCloudOrganizationSchema = z29.object({
18360
+ id: z29.string(),
18361
+ name: z29.string(),
18362
+ slug: z29.string().nullable().optional(),
18363
+ role: z29.string().optional(),
18364
+ personal: z29.boolean().optional()
18058
18365
  });
18059
- var nexusCloudUserSchema = z28.object({
18060
- id: z28.string(),
18061
- email: z28.string(),
18062
- name: z28.string().nullable().optional()
18366
+ var nexusCloudUserSchema = z29.object({
18367
+ id: z29.string(),
18368
+ email: z29.string(),
18369
+ name: z29.string().nullable().optional()
18063
18370
  });
18064
- var nexusCloudWhoamiSchema = z28.object({
18371
+ var nexusCloudWhoamiSchema = z29.object({
18065
18372
  serverTime: isoTime.optional(),
18066
18373
  user: nexusCloudUserSchema,
18067
- organizations: z28.array(nexusCloudOrganizationSchema).default([]),
18374
+ organizations: z29.array(nexusCloudOrganizationSchema).default([]),
18068
18375
  credential: nexusCloudCredentialSchema,
18069
18376
  /** The calling device; null for a session caller. */
18070
18377
  device: nexusCloudDeviceSchema.nullable()
18071
18378
  });
18072
- var nexusCloudDevicePageSchema = z28.object({
18073
- devices: z28.array(nexusCloudDeviceSchema),
18074
- nextCursor: z28.string().max(512).nullable().default(null),
18075
- truncated: z28.boolean().default(false)
18379
+ var nexusCloudDevicePageSchema = z29.object({
18380
+ devices: z29.array(nexusCloudDeviceSchema),
18381
+ nextCursor: z29.string().max(512).nullable().default(null),
18382
+ truncated: z29.boolean().default(false)
18076
18383
  });
18077
- var nexusCloudPresenceSchema = z28.looseObject({
18384
+ var nexusCloudPresenceSchema = z29.looseObject({
18078
18385
  observedAt: isoTime.optional(),
18079
- sync: z28.object({ enabled: z28.boolean() }).optional()
18386
+ sync: z29.object({ enabled: z29.boolean() }).optional()
18080
18387
  });
18081
- var nexusCloudReplicaSchema = z28.object({
18082
- projectId: z28.string(),
18083
- replicaId: z28.string(),
18084
- deviceId: z28.string(),
18085
- deviceName: z28.string(),
18388
+ var nexusCloudReplicaSchema = z29.object({
18389
+ projectId: z29.string(),
18390
+ replicaId: z29.string(),
18391
+ deviceId: z29.string(),
18392
+ deviceName: z29.string(),
18086
18393
  deviceState: deviceState.optional(),
18087
18394
  attachedAt: isoTime.optional(),
18088
18395
  lastSyncAt: isoTime.nullable(),
@@ -18091,72 +18398,72 @@ var nexusCloudReplicaSchema = z28.object({
18091
18398
  /** When the replica was retired (cleo-nexus T123), else null. Absent from servers older than retirement. */
18092
18399
  retiredAt: isoTime.nullable().optional(),
18093
18400
  /** The retired replica's named successor, else null (not retired, or retired with none). */
18094
- successor: z28.string().nullable().optional()
18401
+ successor: z29.string().nullable().optional()
18095
18402
  });
18096
- var nexusCloudDeviceCountsSchema = z28.object({
18097
- active: z28.number().int().nonnegative(),
18098
- total: z28.number().int().nonnegative()
18403
+ var nexusCloudDeviceCountsSchema = z29.object({
18404
+ active: z29.number().int().nonnegative(),
18405
+ total: z29.number().int().nonnegative()
18099
18406
  });
18100
18407
  var projectFields = {
18101
- projectId: z28.string(),
18102
- label: z28.string().nullable(),
18103
- organizationId: z28.string(),
18104
- organizationName: z28.string().optional(),
18105
- remoteUrl: z28.string().nullable().optional(),
18408
+ projectId: z29.string(),
18409
+ label: z29.string().nullable(),
18410
+ organizationId: z29.string(),
18411
+ organizationName: z29.string().optional(),
18412
+ remoteUrl: z29.string().nullable().optional(),
18106
18413
  createdAt: isoTime.optional()
18107
18414
  };
18108
- var nexusCloudProjectListItemSchema = z28.object({
18415
+ var nexusCloudProjectListItemSchema = z29.object({
18109
18416
  ...projectFields,
18110
- role: z28.string(),
18417
+ role: z29.string(),
18111
18418
  /**
18112
18419
  * The project name sealed with the project data key (`Project.encryptedName`), base64;
18113
18420
  * only a holder of the account key can open it (T13102).
18114
18421
  */
18115
- encryptedName: z28.string().nullable().optional(),
18116
- streamId: z28.string().optional(),
18117
- headSeq: z28.number().int().nonnegative().nullable().optional(),
18422
+ encryptedName: z29.string().nullable().optional(),
18423
+ streamId: z29.string().optional(),
18424
+ headSeq: z29.number().int().nonnegative().nullable().optional(),
18118
18425
  /** The stream's head snapshot; null when nothing was ever pushed (T13102: restorable or not). */
18119
- headCheckpointId: z28.string().nullable().optional(),
18120
- openConflicts: z28.number().int().nonnegative().optional(),
18121
- replicas: z28.array(nexusCloudReplicaSchema).default([]),
18426
+ headCheckpointId: z29.string().nullable().optional(),
18427
+ openConflicts: z29.number().int().nonnegative().optional(),
18428
+ replicas: z29.array(nexusCloudReplicaSchema).default([]),
18122
18429
  devices: nexusCloudDeviceCountsSchema.optional(),
18123
- replicaCount: z28.number().int().nonnegative().optional(),
18430
+ replicaCount: z29.number().int().nonnegative().optional(),
18124
18431
  lastSyncAt: isoTime.nullable().optional(),
18125
18432
  lastPresenceAt: isoTime.nullable().optional(),
18126
18433
  /** This project's replica list was cut at 50 (T12858). */
18127
- replicasTruncated: z28.boolean().default(false)
18434
+ replicasTruncated: z29.boolean().default(false)
18128
18435
  });
18129
- var nexusCloudProjectPageSchema = z28.object({
18130
- projects: z28.array(nexusCloudProjectListItemSchema),
18131
- nextCursor: z28.string().max(512).nullable().default(null),
18436
+ var nexusCloudProjectPageSchema = z29.object({
18437
+ projects: z29.array(nexusCloudProjectListItemSchema),
18438
+ nextCursor: z29.string().max(512).nullable().default(null),
18132
18439
  /** Anything in the page was cut (the project list or a replica list). */
18133
- truncated: z28.boolean().default(false),
18440
+ truncated: z29.boolean().default(false),
18134
18441
  /** The project list itself was cut at 1000 (T12858). */
18135
- projectsTruncated: z28.boolean().default(false)
18442
+ projectsTruncated: z29.boolean().default(false)
18136
18443
  });
18137
- var nexusCloudProjectDetailSchema = z28.object({
18138
- project: z28.object({ ...projectFields, deletedAt: isoTime.nullable().optional() }),
18139
- role: z28.string(),
18140
- canTrash: z28.boolean().optional(),
18141
- openConflicts: z28.number().int().nonnegative(),
18444
+ var nexusCloudProjectDetailSchema = z29.object({
18445
+ project: z29.object({ ...projectFields, deletedAt: isoTime.nullable().optional() }),
18446
+ role: z29.string(),
18447
+ canTrash: z29.boolean().optional(),
18448
+ openConflicts: z29.number().int().nonnegative(),
18142
18449
  /** At most 50, oldest attachment first. */
18143
- replicas: z28.array(nexusCloudReplicaSchema),
18450
+ replicas: z29.array(nexusCloudReplicaSchema),
18144
18451
  devices: nexusCloudDeviceCountsSchema,
18145
- replicaCount: z28.number().int().nonnegative().optional(),
18452
+ replicaCount: z29.number().int().nonnegative().optional(),
18146
18453
  lastSyncAt: isoTime.nullable().optional(),
18147
18454
  /** `replicas` was cut at 50. */
18148
- truncated: z28.boolean().default(false),
18149
- stream: z28.object({
18150
- streamId: z28.string(),
18151
- headSeq: z28.number().int().nonnegative(),
18152
- headCheckpointId: z28.string().nullable()
18455
+ truncated: z29.boolean().default(false),
18456
+ stream: z29.object({
18457
+ streamId: z29.string(),
18458
+ headSeq: z29.number().int().nonnegative(),
18459
+ headCheckpointId: z29.string().nullable()
18153
18460
  }).nullable()
18154
18461
  });
18155
- var nexusCloudReplicaPageSchema = z28.object({
18156
- replicas: z28.array(nexusCloudReplicaSchema),
18462
+ var nexusCloudReplicaPageSchema = z29.object({
18463
+ replicas: z29.array(nexusCloudReplicaSchema),
18157
18464
  devices: nexusCloudDeviceCountsSchema.optional(),
18158
- nextCursor: z28.string().max(512).nullable().default(null),
18159
- truncated: z28.boolean().default(false)
18465
+ nextCursor: z29.string().max(512).nullable().default(null),
18466
+ truncated: z29.boolean().default(false)
18160
18467
  });
18161
18468
  var NEXUS_STATUS_CHECK_IDS = [
18162
18469
  "credential.valid",
@@ -18172,56 +18479,56 @@ var NEXUS_STATUS_CHECK_IDS = [
18172
18479
  ];
18173
18480
  var NEXUS_STATUS_VERDICTS = ["ok", "attention", "not-linked", "not-registered"];
18174
18481
  var CLOUD_STATUS_VERDICTS = [...NEXUS_STATUS_VERDICTS, "not-signed-in"];
18175
- var knownCheckId = z28.enum(NEXUS_STATUS_CHECK_IDS);
18176
- var nexusCloudStatusCheckSchema = z28.object({
18177
- id: z28.enum(NEXUS_STATUS_CHECK_IDS),
18178
- ok: z28.boolean(),
18179
- required: z28.boolean(),
18180
- detail: z28.string()
18482
+ var knownCheckId = z29.enum(NEXUS_STATUS_CHECK_IDS);
18483
+ var nexusCloudStatusCheckSchema = z29.object({
18484
+ id: z29.enum(NEXUS_STATUS_CHECK_IDS),
18485
+ ok: z29.boolean(),
18486
+ required: z29.boolean(),
18487
+ detail: z29.string()
18181
18488
  });
18182
- var nexusCloudStatusSchema = z28.object({
18489
+ var nexusCloudStatusSchema = z29.object({
18183
18490
  serverTime: isoTime.optional(),
18184
- apiVersion: z28.string().optional(),
18491
+ apiVersion: z29.string().optional(),
18185
18492
  /**
18186
18493
  * Optional server features (e.g. {@link NEXUS_FEATURE_PROJECT_INITIAL_KEY}). Absent from servers older
18187
18494
  * than the list, which therefore support none of them.
18188
18495
  */
18189
- features: z28.array(z28.string()).optional(),
18496
+ features: z29.array(z29.string()).optional(),
18190
18497
  user: nexusCloudUserSchema,
18191
18498
  credential: nexusCloudCredentialSchema,
18192
18499
  device: nexusCloudDeviceSchema.nullable(),
18193
- project: z28.object({
18194
- projectId: z28.string(),
18195
- registered: z28.boolean(),
18196
- organizationId: z28.string().nullable(),
18197
- organizationName: z28.string().nullable(),
18198
- role: z28.string().nullable()
18500
+ project: z29.object({
18501
+ projectId: z29.string(),
18502
+ registered: z29.boolean(),
18503
+ organizationId: z29.string().nullable(),
18504
+ organizationName: z29.string().nullable(),
18505
+ role: z29.string().nullable()
18199
18506
  }).nullable(),
18200
- replica: z28.object({
18201
- replicaId: z28.string(),
18202
- attached: z28.boolean(),
18203
- attachedElsewhere: z28.boolean(),
18507
+ replica: z29.object({
18508
+ replicaId: z29.string(),
18509
+ attached: z29.boolean(),
18510
+ attachedElsewhere: z29.boolean(),
18204
18511
  attachedAt: isoTime.nullable(),
18205
18512
  lastSyncAt: isoTime.nullable(),
18206
18513
  presenceAt: isoTime.nullable(),
18207
- lastReplicaSeq: z28.number().int().nonnegative().nullable().optional()
18514
+ lastReplicaSeq: z29.number().int().nonnegative().nullable().optional()
18208
18515
  }).nullable(),
18209
- stream: z28.object({
18210
- streamId: z28.string(),
18211
- headSeq: z28.number().int().nonnegative(),
18212
- headCheckpointId: z28.string().nullable(),
18213
- openConflicts: z28.number().int().nonnegative(),
18516
+ stream: z29.object({
18517
+ streamId: z29.string(),
18518
+ headSeq: z29.number().int().nonnegative(),
18519
+ headCheckpointId: z29.string().nullable(),
18520
+ openConflicts: z29.number().int().nonnegative(),
18214
18521
  devices: nexusCloudDeviceCountsSchema
18215
18522
  }).nullable(),
18216
18523
  /** Check ids added by a newer server are dropped, never a parse failure. */
18217
- checks: z28.array(nexusCloudStatusCheckSchema.extend({ id: z28.string() })).transform(
18524
+ checks: z29.array(nexusCloudStatusCheckSchema.extend({ id: z29.string() })).transform(
18218
18525
  (list) => list.flatMap((c) => {
18219
18526
  const id = knownCheckId.safeParse(c.id);
18220
18527
  return id.success ? [{ ...c, id: id.data }] : [];
18221
18528
  })
18222
18529
  ),
18223
18530
  /** A verdict added by a newer server reads as `attention`: never `ok` by accident. */
18224
- verdict: z28.enum(NEXUS_STATUS_VERDICTS).catch("attention")
18531
+ verdict: z29.enum(NEXUS_STATUS_VERDICTS).catch("attention")
18225
18532
  });
18226
18533
  var LOGIN = "run `cleo login nexus`";
18227
18534
  var SESSION_EXPIRED_LOGIN = {
@@ -18266,50 +18573,50 @@ var NEXUS_FORBIDDEN_ERRORS = {
18266
18573
  };
18267
18574
 
18268
18575
  // packages/contracts/src/nexus-vault.ts
18269
- import { z as z29 } from "zod";
18270
- var isoTime2 = z29.iso.datetime({ offset: true });
18271
- 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);
18272
- var nexusUserKeysSchema = z29.looseObject({
18273
- keyVersion: z29.number().int().positive(),
18274
- masterKeyVerifier: z29.string()
18576
+ import { z as z30 } from "zod";
18577
+ var isoTime2 = z30.iso.datetime({ offset: true });
18578
+ 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);
18579
+ var nexusUserKeysSchema = z30.looseObject({
18580
+ keyVersion: z30.number().int().positive(),
18581
+ masterKeyVerifier: z30.string()
18275
18582
  });
18276
- var nexusProjectKeysSchema = z29.looseObject({
18277
- keys: z29.array(
18278
- z29.looseObject({ wrappedProjectKey: z29.string(), keyVersion: z29.number().int().positive() })
18583
+ var nexusProjectKeysSchema = z30.looseObject({
18584
+ keys: z30.array(
18585
+ z30.looseObject({ wrappedProjectKey: z30.string(), keyVersion: z30.number().int().positive() })
18279
18586
  )
18280
18587
  });
18281
- var nexusLeaseSchema = z29.looseObject({
18282
- streamId: z29.string(),
18283
- role: z29.string(),
18588
+ var nexusLeaseSchema = z30.looseObject({
18589
+ streamId: z30.string(),
18590
+ role: z30.string(),
18284
18591
  replicaId: uuid,
18285
18592
  expiresAt: isoTime2,
18286
18593
  forkedFromReplicaId: uuid.nullable().optional()
18287
18594
  });
18288
- var nexusLeaseAcquireSchema = z29.looseObject({ lease: nexusLeaseSchema });
18289
- var nexusStreamHeadSchema = z29.looseObject({
18290
- streamId: z29.string(),
18291
- kind: z29.string().optional(),
18292
- headSeq: z29.number().int().nonnegative(),
18293
- headCheckpointId: z29.string().nullable(),
18595
+ var nexusLeaseAcquireSchema = z30.looseObject({ lease: nexusLeaseSchema });
18596
+ var nexusStreamHeadSchema = z30.looseObject({
18597
+ streamId: z30.string(),
18598
+ kind: z30.string().optional(),
18599
+ headSeq: z30.number().int().nonnegative(),
18600
+ headCheckpointId: z30.string().nullable(),
18294
18601
  /**
18295
18602
  * The highest segment `schemaVersion` the stream holds (the server raises it on every append).
18296
18603
  * Absent from an older server.
18297
18604
  */
18298
- maxSchemaVersion: z29.number().int().nonnegative().optional()
18605
+ maxSchemaVersion: z30.number().int().nonnegative().optional()
18299
18606
  });
18300
- var nexusActivityEventSchema = z29.looseObject({
18301
- id: z29.union([z29.string(), z29.number()]),
18607
+ var nexusActivityEventSchema = z30.looseObject({
18608
+ id: z30.union([z30.string(), z30.number()]),
18302
18609
  at: isoTime2,
18303
- actorUserId: z29.string().nullable().optional(),
18304
- actorDeviceId: z29.string().nullable().optional(),
18305
- requestId: z29.string().nullable().optional(),
18306
- action: z29.string(),
18307
- target: z29.string().nullable().optional(),
18308
- detail: z29.unknown().optional()
18610
+ actorUserId: z30.string().nullable().optional(),
18611
+ actorDeviceId: z30.string().nullable().optional(),
18612
+ requestId: z30.string().nullable().optional(),
18613
+ action: z30.string(),
18614
+ target: z30.string().nullable().optional(),
18615
+ detail: z30.unknown().optional()
18309
18616
  });
18310
- var nexusActivityPageSchema = z29.looseObject({
18311
- events: z29.array(nexusActivityEventSchema),
18312
- nextBefore: z29.union([z29.string(), z29.number()]).nullable().optional()
18617
+ var nexusActivityPageSchema = z30.looseObject({
18618
+ events: z30.array(nexusActivityEventSchema),
18619
+ nextBefore: z30.union([z30.string(), z30.number()]).nullable().optional()
18313
18620
  });
18314
18621
 
18315
18622
  // packages/adapters/src/providers/kimi/spawn.ts