@hearsay-tools/squawk 0.18.0-pr3883.7308 → 0.18.0-pr3885.7316

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 (69) hide show
  1. package/README.md +3 -2
  2. package/dist/contract/index.d.ts +1 -0
  3. package/dist/contract/index.js +1584 -1578
  4. package/dist/contract/queued-messages.d.ts +31 -0
  5. package/dist/contract/runs.d.ts +3 -29
  6. package/dist/delegation/conversations.d.ts +2 -0
  7. package/dist/delegation/transport.d.ts +66 -66
  8. package/dist/runs/run-exits.d.ts +6 -0
  9. package/dist/runs/store.d.ts +2 -0
  10. package/dist/runs/store.js +2 -1
  11. package/dist/runs/store.js.map +1 -1
  12. package/dist/server/activity-routes.d.ts +23 -23
  13. package/dist/server/reports-api.d.ts +2 -2
  14. package/dist/server/server.d.ts +1720 -1702
  15. package/dist/workflows/continuation-admission.d.ts +3 -1
  16. package/dist/workflows/continuation-admission.js +4 -2
  17. package/dist/workflows/continuation-admission.js.map +1 -1
  18. package/dist/workflows/run/continuation-acceptance.js +1 -1
  19. package/dist/workflows/run/continuation-acceptance.js.map +1 -1
  20. package/dist/workflows/run/launch-read-resolver.js +20 -8
  21. package/dist/workflows/run/launch-read-resolver.js.map +1 -1
  22. package/dist/workflows/run/prompts.d.ts +3 -0
  23. package/dist/workflows/run/prompts.js +11 -5
  24. package/dist/workflows/run/prompts.js.map +1 -1
  25. package/dist/workflows/run/wait-engine.d.ts +73 -72
  26. package/package.json +4 -4
  27. package/scripts/mock-nudge.mjs +3 -1
  28. package/web/dist/assets/{activity-motion-YMvJpfC8.js → activity-motion-Ctg50eXm.js} +1 -1
  29. package/web/dist/assets/{activity-route-C3nuQQR-.js → activity-route-CIrBgiGz.js} +1 -1
  30. package/web/dist/assets/{agent-accounts-C1IZE0uf.js → agent-accounts-Bxqcccek.js} +1 -1
  31. package/web/dist/assets/attention-D15PtJnc.js +1 -0
  32. package/web/dist/assets/{commit-diff-panel-B78xqBBB.js → commit-diff-panel-OWVorWVw.js} +1 -1
  33. package/web/dist/assets/{diff-CuoNLz3Q.js → diff-BvBs4Gxp.js} +2 -2
  34. package/web/dist/assets/{diff-view-Dxt-xGXY.js → diff-view-CSrp8jyv.js} +1 -1
  35. package/web/dist/assets/{file-preview-D6fgR7rc.js → file-preview-B6mM_dbK.js} +1 -1
  36. package/web/dist/assets/{git-toolbar-B4gNpVK8.js → git-toolbar-CvG0gvVf.js} +1 -1
  37. package/web/dist/assets/{github-D4IdDmEF.js → github-Dra1J1Oi.js} +1 -1
  38. package/web/dist/assets/{global-activity-route-BQW6XCBZ.js → global-activity-route-8H2KkpXH.js} +1 -1
  39. package/web/dist/assets/{index-CZSDjjxd.js → index-aCWAgBiE.js} +4 -4
  40. package/web/dist/assets/{markdown-CFpzsarc.js → markdown-D4ZGAuSC.js} +1 -1
  41. package/web/dist/assets/{picker-pill-AQuDoa6t.js → picker-pill-B6QPSEUZ.js} +1 -1
  42. package/web/dist/assets/{preview-pane-connected-Divki4iS.js → preview-pane-connected-Bhb5eJ5Z.js} +1 -1
  43. package/web/dist/assets/{project-router-CuXiyyHq.js → project-router-0DHZ1s8l.js} +1 -1
  44. package/web/dist/assets/project-scope-context-qMCI2vmR.js +4 -0
  45. package/web/dist/assets/{prompt-template-menu-DttDghYr.js → prompt-template-menu-_WK10gNW.js} +1 -1
  46. package/web/dist/assets/{queries-M7QM2Z_B.js → queries-DFchmPfl.js} +1 -1
  47. package/web/dist/assets/{reference-chip-C2uR5keT.js → reference-chip-BJe4UIpL.js} +1 -1
  48. package/web/dist/assets/{repo-git-Dl6O3hGA.js → repo-git-DAhDX80l.js} +1 -1
  49. package/web/dist/assets/{report-reader-MmUDUBB6.js → report-reader-DsYm5b9J.js} +1 -1
  50. package/web/dist/assets/{reports-D5N5f1oD.js → reports-BosE8lj8.js} +1 -1
  51. package/web/dist/assets/{run-header-CWSg_ZYo.js → run-header-DBbM_xNy.js} +1 -1
  52. package/web/dist/assets/{skills-UhbdEQES.js → skills-BHAGfLNq.js} +1 -1
  53. package/web/dist/assets/{tab-link-Bz7Tn_PW.js → tab-link-lVQ2eOeD.js} +1 -1
  54. package/web/dist/assets/{task-changes-Ciq3wQdC.js → task-changes-Jg7Xzrfa.js} +1 -1
  55. package/web/dist/assets/{task-commits-BYZEw7j8.js → task-commits-DecgF6zx.js} +1 -1
  56. package/web/dist/assets/{task-files-zvZu7yvk.js → task-files-D7N-vFyz.js} +1 -1
  57. package/web/dist/assets/{task-github-item-BYzml2gD.js → task-github-item-C8fBdico.js} +1 -1
  58. package/web/dist/assets/{task-thread-DSdn2fYx.js → task-thread-DifTEOeK.js} +1 -1
  59. package/web/dist/assets/{thread-state-BU_1o8aR.js → thread-state-i29D-4yN.js} +1 -1
  60. package/web/dist/assets/{use-desktop-Dc0-ZSdE.js → use-desktop-CdWXLHne.js} +1 -1
  61. package/web/dist/assets/{use-hand-to-agent-state-C8jp_mTB.js → use-hand-to-agent-state-CPxNdj4_.js} +1 -1
  62. package/web/dist/assets/{useInfiniteQuery-BzvShKMo.js → useInfiniteQuery-Bn5hIzUm.js} +1 -1
  63. package/web/dist/assets/useQuery-DjkTL27e.js +1 -0
  64. package/web/dist/assets/{workflows-BdBF5bnk.js → workflows-CflCv_rB.js} +1 -1
  65. package/web/dist/assets/{ws-BQRkvdhO.js → ws-DfKMAUWf.js} +1 -1
  66. package/web/dist/index.html +13 -13
  67. package/web/dist/assets/attention-SAsrxB3a.js +0 -1
  68. package/web/dist/assets/project-scope-context-TjMvUo_E.js +0 -4
  69. package/web/dist/assets/useQuery-BJvp3XYr.js +0 -1
@@ -1159,7 +1159,7 @@ function runnerModelListName(runner) {
1159
1159
  }
1160
1160
 
1161
1161
  // ../contract/src/runs.ts
1162
- import { z as z19 } from "zod";
1162
+ import { z as z20 } from "zod";
1163
1163
 
1164
1164
  // ../contract/src/github.ts
1165
1165
  import { z as z12 } from "zod";
@@ -1702,30 +1702,57 @@ function runWorkflowLabel(run) {
1702
1702
  var ARCHIVED_RUNS_PAGE_DEFAULT = 50;
1703
1703
  var ARCHIVED_RUNS_PAGE_MAX = 200;
1704
1704
 
1705
- // ../contract/src/workflows.ts
1705
+ // ../contract/src/queued-messages.ts
1706
1706
  import { z as z14 } from "zod";
1707
- var workflowStepDefSchema = z14.object({
1708
- id: z14.string().min(1),
1709
- name: z14.string().optional(),
1707
+ var queuedMessageSchema = z14.object({
1708
+ replayAfterOpen: z14.literal(true).optional(),
1709
+ // NativeSkillInputQueue sets; launch hydration excludes; QueuedInput replays after open.
1710
+ id: z14.string(),
1711
+ text: z14.string(),
1712
+ /** `/api/v1/runs/:id/images/…` URLs — attachments are persisted, never inlined. Images and
1713
+ * files share this one list; read `isImageAttachmentName` on the file name to tell them apart. */
1714
+ images: z14.array(z14.string()).optional(),
1715
+ createdAt: z14.string()
1716
+ });
1717
+ var continuationMessageSchema = queuedMessageSchema.extend({
1718
+ origin: z14.enum(["human", "lifecycle"]).optional(),
1719
+ /** An attributed parent message used as the opening prompt, never a human answer. */
1720
+ agentInputId: z14.uuid().optional(),
1721
+ /** The run's task when this Continue was accepted. A queued Continue repeats the task only
1722
+ * when the human edited it while waiting (hearsay-tools/squawk#3882). */
1723
+ task: z14.string().optional(),
1724
+ /** Captured before clearing the run error. Keep generated context separate from human
1725
+ * text so repeated restart recovery never accumulates diagnostic prefixes. */
1726
+ resumeContext: z14.object({
1727
+ failure: z14.object({ stepId: z14.string().optional(), error: z14.string() }).optional(),
1728
+ restarted: z14.literal(true).optional()
1729
+ }).optional()
1730
+ });
1731
+
1732
+ // ../contract/src/workflows.ts
1733
+ import { z as z15 } from "zod";
1734
+ var workflowStepDefSchema = z15.object({
1735
+ id: z15.string().min(1),
1736
+ name: z15.string().optional(),
1710
1737
  // agent step
1711
- prompt: z14.string().optional(),
1712
- skill: z14.string().optional(),
1713
- model: z14.string().optional(),
1714
- effort: z14.string().max(32).optional(),
1738
+ prompt: z15.string().optional(),
1739
+ skill: z15.string().optional(),
1740
+ model: z15.string().optional(),
1741
+ effort: z15.string().max(32).optional(),
1715
1742
  /** Authored agent-step wall-clock limit in ms. Omitted or 0 means no limit.
1716
1743
  * Bound to Node's timer range so a larger value cannot become a 1ms kill. */
1717
- timeoutMs: z14.number().int().min(0).max(2147483647).optional(),
1744
+ timeoutMs: z15.number().int().min(0).max(2147483647).optional(),
1718
1745
  /** Per-step agent backend override (falls back to the task / config default). */
1719
1746
  runner: runnerSchema.optional(),
1720
1747
  /** Agent account id for this step (spec 2026-07-29-agent-profiles); resolved per step for owned workers (#452). */
1721
- agentProfile: z14.string().min(1).max(64).optional(),
1722
- allowedTools: z14.array(z14.string()).optional(),
1723
- bashAllowlist: z14.array(z14.string()).optional(),
1748
+ agentProfile: z15.string().min(1).max(64).optional(),
1749
+ allowedTools: z15.array(z15.string()).optional(),
1750
+ bashAllowlist: z15.array(z15.string()).optional(),
1724
1751
  // check step
1725
- command: z14.string().optional(),
1726
- onFail: z14.object({
1727
- retry: z14.string().min(1),
1728
- max: z14.number().int().positive().default(2)
1752
+ command: z15.string().optional(),
1753
+ onFail: z15.object({
1754
+ retry: z15.string().min(1),
1755
+ max: z15.number().int().positive().default(2)
1729
1756
  }).optional()
1730
1757
  }).refine((s) => Boolean(s.command) !== Boolean(s.prompt ?? s.skill), {
1731
1758
  message: "a step is either an agent step (prompt/skill) or a check step (command), not both"
@@ -1733,13 +1760,13 @@ var workflowStepDefSchema = z14.object({
1733
1760
  message: "timeoutMs applies only to agent steps",
1734
1761
  path: ["timeoutMs"]
1735
1762
  });
1736
- var workflowDefSchema = z14.object({
1737
- name: z14.string(),
1738
- description: z14.string().optional(),
1739
- steps: z14.array(workflowStepDefSchema),
1740
- source: z14.enum(["built-in", "file"]),
1763
+ var workflowDefSchema = z15.object({
1764
+ name: z15.string(),
1765
+ description: z15.string().optional(),
1766
+ steps: z15.array(workflowStepDefSchema),
1767
+ source: z15.enum(["built-in", "file"]),
1741
1768
  /** Absent on built-ins — which is exactly what makes them undeletable. */
1742
- path: z14.string().optional()
1769
+ path: z15.string().optional()
1743
1770
  });
1744
1771
  function providersRequiredByWorkflow(workflow, fallback) {
1745
1772
  const required = /* @__PURE__ */ new Set();
@@ -1748,73 +1775,73 @@ function providersRequiredByWorkflow(workflow, fallback) {
1748
1775
  }
1749
1776
  return runnerSchema.options.filter((provider) => required.has(provider));
1750
1777
  }
1751
- var workflowLoadIssueSchema = z14.object({
1752
- path: z14.string(),
1753
- message: z14.string()
1778
+ var workflowLoadIssueSchema = z15.object({
1779
+ path: z15.string(),
1780
+ message: z15.string()
1754
1781
  });
1755
- var workflowsResponseSchema = z14.object({
1756
- workflows: z14.array(workflowDefSchema),
1757
- issues: z14.array(workflowLoadIssueSchema)
1782
+ var workflowsResponseSchema = z15.object({
1783
+ workflows: z15.array(workflowDefSchema),
1784
+ issues: z15.array(workflowLoadIssueSchema)
1758
1785
  });
1759
- var saveWorkflowInputSchema = z14.object({
1760
- name: z14.string().trim().min(1).max(80),
1761
- description: z14.string().max(2e3, "must be at most 2000 characters").optional(),
1762
- steps: z14.array(workflowStepDefSchema).min(1).max(8).optional(),
1763
- skills: z14.array(z14.string().trim().min(1)).min(1).max(8).optional(),
1764
- overwrite: z14.boolean().optional()
1786
+ var saveWorkflowInputSchema = z15.object({
1787
+ name: z15.string().trim().min(1).max(80),
1788
+ description: z15.string().max(2e3, "must be at most 2000 characters").optional(),
1789
+ steps: z15.array(workflowStepDefSchema).min(1).max(8).optional(),
1790
+ skills: z15.array(z15.string().trim().min(1)).min(1).max(8).optional(),
1791
+ overwrite: z15.boolean().optional()
1765
1792
  }).refine((b) => Boolean(b.steps) !== Boolean(b.skills), {
1766
1793
  message: 'provide either "steps" or "skills", not both'
1767
1794
  });
1768
- var saveWorkflowResponseSchema = z14.object({
1769
- path: z14.string(),
1770
- name: z14.string()
1795
+ var saveWorkflowResponseSchema = z15.object({
1796
+ path: z15.string(),
1797
+ name: z15.string()
1771
1798
  });
1772
- var parsedWorkflowSchema = z14.object({
1773
- name: z14.string(),
1774
- description: z14.string().optional(),
1775
- steps: z14.array(workflowStepDefSchema)
1799
+ var parsedWorkflowSchema = z15.object({
1800
+ name: z15.string(),
1801
+ description: z15.string().optional(),
1802
+ steps: z15.array(workflowStepDefSchema)
1776
1803
  });
1777
- var deleteWorkflowResponseSchema = z14.object({
1778
- ok: z14.literal(true),
1779
- path: z14.string()
1804
+ var deleteWorkflowResponseSchema = z15.object({
1805
+ ok: z15.literal(true),
1806
+ path: z15.string()
1780
1807
  });
1781
- var planResponseSchema = z14.object({
1808
+ var planResponseSchema = z15.object({
1782
1809
  /** The kebab-case workflow title the planner proposed. Absent on the degraded fallback. */
1783
- name: z14.string().optional(),
1784
- steps: z14.array(workflowStepDefSchema),
1785
- rationale: z14.string(),
1786
- fallback: z14.boolean()
1810
+ name: z15.string().optional(),
1811
+ steps: z15.array(workflowStepDefSchema),
1812
+ rationale: z15.string(),
1813
+ fallback: z15.boolean()
1787
1814
  });
1788
1815
 
1789
1816
  // ../contract/src/waits.ts
1790
- import { z as z16 } from "zod";
1817
+ import { z as z17 } from "zod";
1791
1818
 
1792
1819
  // ../contract/src/ci-wait.ts
1793
- import { z as z15 } from "zod";
1820
+ import { z as z16 } from "zod";
1794
1821
  var CI_WAIT_LIMITATION = "Passing reported checks does not prove that every expected workflow has appeared or that the PR is merge-ready. This observation is not merge approval.";
1795
1822
  var CI_WAIT_RECEIPT_INSTRUCTION = "End your turn to wait for CI; no marker is needed. " + CI_WAIT_LIMITATION;
1796
1823
  var prPattern = /^https:\/\/([a-zA-Z0-9](?:[a-zA-Z0-9.-]*[a-zA-Z0-9])?)\/([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+)\/pull\/([1-9][0-9]*)$/;
1797
- var ciPrUrlSchema = z15.string().max(2048).regex(prPattern).refine((value) => {
1824
+ var ciPrUrlSchema = z16.string().max(2048).regex(prPattern).refine((value) => {
1798
1825
  const match = prPattern.exec(value);
1799
1826
  return !!match && Number.isSafeInteger(Number(match[4])) && match[3] !== "." && match[3] !== "..";
1800
1827
  }, "Expected an HTTPS GitHub PR URL with a positive integer PR number");
1801
- var prWaitUntilSchema = z15.enum(["checks", "merge", "merge_or_blocked"]);
1802
- var ciWaitRequestSchema = z15.object({
1828
+ var prWaitUntilSchema = z16.enum(["checks", "merge", "merge_or_blocked"]);
1829
+ var ciWaitRequestSchema = z16.object({
1803
1830
  pr: ciPrUrlSchema,
1804
1831
  until: prWaitUntilSchema.default("checks"),
1805
1832
  /** False keeps a conflicting PR from ending the wait: for a PR the agent does not own. */
1806
- wake_on_conflict: z15.boolean().default(true),
1807
- timeout_seconds: z15.number().int().min(1).max(7200).default(1800)
1833
+ wake_on_conflict: z16.boolean().default(true),
1834
+ timeout_seconds: z16.number().int().min(1).max(7200).default(1800)
1808
1835
  }).strict();
1809
- var sha = z15.string().regex(/^[0-9a-f]{40}$/i);
1810
- var ciPrIdentitySchema = z15.object({
1836
+ var sha = z16.string().regex(/^[0-9a-f]{40}$/i);
1837
+ var ciPrIdentitySchema = z16.object({
1811
1838
  prUrl: ciPrUrlSchema,
1812
- repository: z15.string().max(2048).regex(/^[a-zA-Z0-9_-]+\/[a-zA-Z0-9_.-]+$/),
1813
- prNumber: z15.number().int().positive().max(Number.MAX_SAFE_INTEGER),
1839
+ repository: z16.string().max(2048).regex(/^[a-zA-Z0-9_-]+\/[a-zA-Z0-9_.-]+$/),
1840
+ prNumber: z16.number().int().positive().max(Number.MAX_SAFE_INTEGER),
1814
1841
  headSha: sha
1815
1842
  }).strict();
1816
- var ciWaitOutcomeSchema = z15.enum(["passed", "failed", "cancelled", "skipped", "no_checks", "head_changed", "conflicting", "deadline", "error", "merged", "closed", "blocked"]);
1817
- var ciWaitErrorCodeSchema = z15.enum([
1843
+ var ciWaitOutcomeSchema = z16.enum(["passed", "failed", "cancelled", "skipped", "no_checks", "head_changed", "conflicting", "deadline", "error", "merged", "closed", "blocked"]);
1844
+ var ciWaitErrorCodeSchema = z16.enum([
1818
1845
  "invalid_request",
1819
1846
  "unsupported_host",
1820
1847
  "gh_missing",
@@ -1845,7 +1872,7 @@ var ciWaitErrorCodeSchema = z15.enum([
1845
1872
  "registration_aborted",
1846
1873
  "turn_changed"
1847
1874
  ]);
1848
- var ciWaitErrorSchema = z15.object({ code: ciWaitErrorCodeSchema, message: z15.string().max(4096) }).strict();
1875
+ var ciWaitErrorSchema = z16.object({ code: ciWaitErrorCodeSchema, message: z16.string().max(4096) }).strict();
1849
1876
  function utf8Bytes(value) {
1850
1877
  let bytes = 0;
1851
1878
  for (const char of value) {
@@ -1854,54 +1881,54 @@ function utf8Bytes(value) {
1854
1881
  }
1855
1882
  return bytes;
1856
1883
  }
1857
- var mergeBlockSchema = z15.object({
1858
- reason: z15.enum(["conflict", "no_pending_merge"]),
1859
- isInMergeQueue: z15.boolean(),
1860
- autoMergeEnabled: z15.boolean(),
1861
- event: z15.object({
1862
- kind: z15.enum(["queue_removal", "auto_merge_disabled"]),
1863
- createdAt: z15.iso.datetime({ offset: true }),
1864
- reason: z15.string().max(256).optional(),
1865
- reasonCode: z15.string().max(256).optional()
1884
+ var mergeBlockSchema = z16.object({
1885
+ reason: z16.enum(["conflict", "no_pending_merge"]),
1886
+ isInMergeQueue: z16.boolean(),
1887
+ autoMergeEnabled: z16.boolean(),
1888
+ event: z16.object({
1889
+ kind: z16.enum(["queue_removal", "auto_merge_disabled"]),
1890
+ createdAt: z16.iso.datetime({ offset: true }),
1891
+ reason: z16.string().max(256).optional(),
1892
+ reasonCode: z16.string().max(256).optional()
1866
1893
  }).strict().optional()
1867
1894
  }).strict();
1868
- var ciWaitResultSchema = z15.object({
1895
+ var ciWaitResultSchema = z16.object({
1869
1896
  outcome: ciWaitOutcomeSchema,
1870
1897
  headSha: sha,
1871
1898
  observedHeadSha: sha.optional(),
1872
- mergeable: z15.enum(["MERGEABLE", "CONFLICTING", "UNKNOWN"]).optional(),
1873
- mergeStateStatus: z15.string().max(64).optional(),
1899
+ mergeable: z16.enum(["MERGEABLE", "CONFLICTING", "UNKNOWN"]).optional(),
1900
+ mergeStateStatus: z16.string().max(64).optional(),
1874
1901
  /** A merge wait's `merged` outcome: when, and as which commit, GitHub merged the PR. */
1875
- mergedAt: z15.iso.datetime({ offset: true }).optional(),
1902
+ mergedAt: z16.iso.datetime({ offset: true }).optional(),
1876
1903
  mergeCommitSha: sha.optional(),
1877
1904
  mergeBlock: mergeBlockSchema.optional(),
1878
- observedAt: z15.iso.datetime(),
1879
- checks: z15.array(z15.object({ name: z15.string().max(256), state: z15.string().max(256), link: z15.string().max(2048) }).strict()).max(100),
1880
- totalChecks: z15.number().int().nonnegative(),
1881
- truncated: z15.boolean(),
1882
- diagnostic: z15.string().max(4096).refine((value) => utf8Bytes(value) <= 4096).optional()
1905
+ observedAt: z16.iso.datetime(),
1906
+ checks: z16.array(z16.object({ name: z16.string().max(256), state: z16.string().max(256), link: z16.string().max(2048) }).strict()).max(100),
1907
+ totalChecks: z16.number().int().nonnegative(),
1908
+ truncated: z16.boolean(),
1909
+ diagnostic: z16.string().max(4096).refine((value) => utf8Bytes(value) <= 4096).optional()
1883
1910
  }).strict().refine((value) => {
1884
1911
  return value.outcome === "blocked" === (value.mergeBlock !== void 0);
1885
1912
  }, "Only blocked outcomes require mergeBlock").refine((value) => utf8Bytes(JSON.stringify(value)) <= 32 * 1024, "CI result exceeds 32 KiB");
1886
1913
  var ciWaitSchema = ciPrIdentitySchema.extend({
1887
- id: z15.uuid(),
1888
- generation: z15.string().min(1).max(256),
1889
- turnId: z15.string().min(1).max(256),
1890
- timeoutSeconds: z15.number().int().min(1).max(7200),
1914
+ id: z16.uuid(),
1915
+ generation: z16.string().min(1).max(256),
1916
+ turnId: z16.string().min(1).max(256),
1917
+ timeoutSeconds: z16.number().int().min(1).max(7200),
1891
1918
  // Legacy `ciWait` rows predate the target (hearsay-tools/cezarion#1425): they waited for checks.
1892
1919
  until: prWaitUntilSchema.default("checks"),
1893
- wakeOnConflict: z15.boolean().default(true),
1894
- registeredAt: z15.iso.datetime(),
1895
- deadline: z15.iso.datetime(),
1896
- phase: z15.enum(["registered", "parked", "wake-pending", "delivered", "withdrawn"]),
1920
+ wakeOnConflict: z16.boolean().default(true),
1921
+ registeredAt: z16.iso.datetime(),
1922
+ deadline: z16.iso.datetime(),
1923
+ phase: z16.enum(["registered", "parked", "wake-pending", "delivered", "withdrawn"]),
1897
1924
  result: ciWaitResultSchema.optional(),
1898
- wakeId: z15.string().min(1).max(256).optional(),
1899
- deliveredAt: z15.iso.datetime().optional()
1925
+ wakeId: z16.string().min(1).max(256).optional(),
1926
+ deliveredAt: z16.iso.datetime().optional()
1900
1927
  }).strict();
1901
1928
  var ciWaitReceiptSchema = ciPrIdentitySchema.extend({
1902
- waitId: z15.uuid(),
1903
- registeredAt: z15.iso.datetime(),
1904
- deadline: z15.iso.datetime(),
1929
+ waitId: z16.uuid(),
1930
+ registeredAt: z16.iso.datetime(),
1931
+ deadline: z16.iso.datetime(),
1905
1932
  phase: ciWaitSchema.shape.phase
1906
1933
  }).strict();
1907
1934
 
@@ -1924,9 +1951,9 @@ var PEER_WAIT_MAX_SECONDS = 7200;
1924
1951
  var SUBAGENT_WAIT_DEADLINE_SECONDS = 1800;
1925
1952
  var SUBAGENT_WAIT_GRACE_SECONDS = 15;
1926
1953
  var SUBAGENT_WAIT_CHILD_LIMIT = 32;
1927
- var pidSchema = z16.number().int().min(2);
1928
- var waitPhaseSchema = z16.enum(["open", "resolved", "delivered", "cancelled"]);
1929
- var waitViaSchema = z16.enum([
1954
+ var pidSchema = z17.number().int().min(2);
1955
+ var waitPhaseSchema = z17.enum(["open", "resolved", "delivered", "cancelled"]);
1956
+ var waitViaSchema = z17.enum([
1930
1957
  // `cezar_wait_for_ci` is kept for stored rows only: the tool was removed (hearsay-tools/cezarion#1236).
1931
1958
  "cezar_wait",
1932
1959
  "cezar_wait_for_ci",
@@ -1943,74 +1970,74 @@ var waitViaSchema = z16.enum([
1943
1970
  "native-subagents"
1944
1971
  ]);
1945
1972
  var waitBaseShape = {
1946
- id: z16.uuid(),
1947
- source: z16.enum(["agent", "cezar"]),
1973
+ id: z17.uuid(),
1974
+ source: z17.enum(["agent", "cezar"]),
1948
1975
  via: waitViaSchema,
1949
- registeredAt: z16.iso.datetime(),
1976
+ registeredAt: z17.iso.datetime(),
1950
1977
  phase: waitPhaseSchema,
1951
- resolvedAt: z16.iso.datetime().optional(),
1952
- deliveredAt: z16.iso.datetime().optional(),
1953
- cancelledAt: z16.iso.datetime().optional(),
1954
- turnId: z16.string().min(1).max(256)
1978
+ resolvedAt: z17.iso.datetime().optional(),
1979
+ deliveredAt: z17.iso.datetime().optional(),
1980
+ cancelledAt: z17.iso.datetime().optional(),
1981
+ turnId: z17.string().min(1).max(256)
1955
1982
  };
1956
- var prWaitEntrySchema = z16.object({
1983
+ var prWaitEntrySchema = z17.object({
1957
1984
  ...waitBaseShape,
1958
- kind: z16.literal("pr"),
1959
- deadline: z16.iso.datetime(),
1985
+ kind: z17.literal("pr"),
1986
+ deadline: z17.iso.datetime(),
1960
1987
  ...ciPrIdentitySchema.shape,
1961
- generation: z16.string().min(1).max(256),
1962
- timeoutSeconds: z16.number().int().min(1).max(7200),
1988
+ generation: z17.string().min(1).max(256),
1989
+ timeoutSeconds: z17.number().int().min(1).max(7200),
1963
1990
  until: prWaitUntilSchema,
1964
- wakeOnConflict: z16.boolean(),
1991
+ wakeOnConflict: z17.boolean(),
1965
1992
  result: ciWaitResultSchema.optional()
1966
1993
  }).strict();
1967
- var timerWaitEntrySchema = z16.object({
1994
+ var timerWaitEntrySchema = z17.object({
1968
1995
  ...waitBaseShape,
1969
- kind: z16.literal("timer"),
1970
- deadline: z16.iso.datetime(),
1971
- seconds: z16.number().int().min(TIMER_MIN_SECONDS).max(TIMER_MAX_SECONDS),
1972
- note: z16.string().max(NOTE_MAX).optional()
1996
+ kind: z17.literal("timer"),
1997
+ deadline: z17.iso.datetime(),
1998
+ seconds: z17.number().int().min(TIMER_MIN_SECONDS).max(TIMER_MAX_SECONDS),
1999
+ note: z17.string().max(NOTE_MAX).optional()
1973
2000
  }).strict();
1974
- var processWaitResultSchema = z16.object({
1975
- outcome: z16.enum(["exit_file", "exited", "deadline", "error"]),
1976
- observedAt: z16.iso.datetime(),
1977
- exitCode: z16.number().int().min(-2147483648).max(2147483647).optional(),
1978
- exitFileNote: z16.literal("not-an-exit-code").optional(),
1979
- diagnostic: z16.string().max(512).optional()
2001
+ var processWaitResultSchema = z17.object({
2002
+ outcome: z17.enum(["exit_file", "exited", "deadline", "error"]),
2003
+ observedAt: z17.iso.datetime(),
2004
+ exitCode: z17.number().int().min(-2147483648).max(2147483647).optional(),
2005
+ exitFileNote: z17.literal("not-an-exit-code").optional(),
2006
+ diagnostic: z17.string().max(512).optional()
1980
2007
  }).strict();
1981
- var processWaitEntrySchema = z16.object({
2008
+ var processWaitEntrySchema = z17.object({
1982
2009
  ...waitBaseShape,
1983
- kind: z16.literal("process"),
1984
- deadline: z16.iso.datetime(),
1985
- timeoutSeconds: z16.number().int().min(1).max(PROCESS_TIMEOUT_MAX_SECONDS),
2010
+ kind: z17.literal("process"),
2011
+ deadline: z17.iso.datetime(),
2012
+ timeoutSeconds: z17.number().int().min(1).max(PROCESS_TIMEOUT_MAX_SECONDS),
1986
2013
  pid: pidSchema,
1987
- startToken: z16.string().min(1).max(256).optional(),
1988
- exitFile: z16.string().min(1).max(PROCESS_EXIT_FILE_MAX).optional(),
1989
- note: z16.string().max(NOTE_MAX).optional(),
2014
+ startToken: z17.string().min(1).max(256).optional(),
2015
+ exitFile: z17.string().min(1).max(PROCESS_EXIT_FILE_MAX).optional(),
2016
+ note: z17.string().max(NOTE_MAX).optional(),
1990
2017
  result: processWaitResultSchema.optional()
1991
2018
  }).strict();
1992
- var humanWaitEntrySchema = z16.object({
2019
+ var humanWaitEntrySchema = z17.object({
1993
2020
  ...waitBaseShape,
1994
- kind: z16.literal("human"),
2021
+ kind: z17.literal("human"),
1995
2022
  questions: askRequestSchema.shape.questions.optional(),
1996
2023
  /** The card's Markdown context (hearsay-tools/cezarion#1458); absent on waits recorded before it. */
1997
2024
  context: askContextSchema.optional(),
1998
- askSeq: z16.number().int().nonnegative().optional()
2025
+ askSeq: z17.number().int().nonnegative().optional()
1999
2026
  }).strict();
2000
- var workerWaitEntrySchema = z16.object({
2027
+ var workerWaitEntrySchema = z17.object({
2001
2028
  ...waitBaseShape,
2002
- kind: z16.literal("worker"),
2029
+ kind: z17.literal("worker"),
2003
2030
  // Squawk's completion wait has neither: it ends when its workers settle (hearsay-tools/cezarion#1301).
2004
- deadline: z16.iso.datetime().optional(),
2005
- timeoutSeconds: z16.number().int().min(1).max(PEER_WAIT_MAX_SECONDS).optional(),
2031
+ deadline: z17.iso.datetime().optional(),
2032
+ timeoutSeconds: z17.number().int().min(1).max(PEER_WAIT_MAX_SECONDS).optional(),
2006
2033
  mode: workerWaitModeSchema.optional(),
2007
2034
  workerIds: workerIdsSchema.optional(),
2008
- revisions: z16.array(z16.object({ workerId: z16.uuid(), revision: z16.number().int().nonnegative() }).strict()).max(32).optional(),
2009
- outcomes: z16.array(workerOutcomeSchema).max(32).optional(),
2035
+ revisions: z17.array(z17.object({ workerId: z17.uuid(), revision: z17.number().int().nonnegative() }).strict()).max(32).optional(),
2036
+ outcomes: z17.array(workerOutcomeSchema).max(32).optional(),
2010
2037
  requestIds: workerIdsSchema.optional(),
2011
- requestOutcomes: z16.array(requestOutcomeSchema).max(32).optional(),
2012
- result: z16.object({ reason: z16.enum(["outcome", "timeout"]) }).strict().optional(),
2013
- wakeInputId: z16.uuid().optional()
2038
+ requestOutcomes: z17.array(requestOutcomeSchema).max(32).optional(),
2039
+ result: z17.object({ reason: z17.enum(["outcome", "timeout"]) }).strict().optional(),
2040
+ wakeInputId: z17.uuid().optional()
2014
2041
  }).strict().superRefine((wait, ctx) => {
2015
2042
  const hasDeadline = wait.deadline !== void 0;
2016
2043
  const hasTimeout = wait.timeoutSeconds !== void 0;
@@ -2039,84 +2066,84 @@ var workerWaitEntrySchema = z16.object({
2039
2066
  }
2040
2067
  });
2041
2068
  var hasWorkerDeadline = (entry) => entry.deadline !== void 0;
2042
- var peerWaitEntrySchema = z16.object({
2069
+ var peerWaitEntrySchema = z17.object({
2043
2070
  ...waitBaseShape,
2044
- kind: z16.literal("peer"),
2045
- deadline: z16.iso.datetime(),
2046
- timeoutSeconds: z16.number().int().min(1).max(PEER_WAIT_MAX_SECONDS),
2071
+ kind: z17.literal("peer"),
2072
+ deadline: z17.iso.datetime(),
2073
+ timeoutSeconds: z17.number().int().min(1).max(PEER_WAIT_MAX_SECONDS),
2047
2074
  peerIds: workerIdsSchema,
2048
2075
  result: peerWaitResultSchema.optional()
2049
2076
  }).strict().superRefine(refinePeerWaitResult);
2050
2077
  function peerWaitView(entry) {
2051
2078
  return { id: entry.id, peerIds: entry.peerIds, deadline: entry.deadline, phase: entry.phase, ...entry.result ? { result: entry.result } : {} };
2052
2079
  }
2053
- var subagentChildSchema = z16.object({
2054
- id: z16.string().min(1).max(256),
2055
- status: z16.enum(["running", "completed", "failed", "cancelled"])
2080
+ var subagentChildSchema = z17.object({
2081
+ id: z17.string().min(1).max(256),
2082
+ status: z17.enum(["running", "completed", "failed", "cancelled"])
2056
2083
  }).strict();
2057
- var subagentWaitResultSchema = z16.object({ reason: z16.enum(["settled", "timeout", "interrupted", "superseded"]) }).strict();
2058
- var subagentWaitEntrySchema = z16.object({
2084
+ var subagentWaitResultSchema = z17.object({ reason: z17.enum(["settled", "timeout", "interrupted", "superseded"]) }).strict();
2085
+ var subagentWaitEntrySchema = z17.object({
2059
2086
  ...waitBaseShape,
2060
- kind: z16.literal("subagent"),
2061
- source: z16.literal("cezar"),
2062
- via: z16.literal("native-subagents"),
2063
- deadline: z16.iso.datetime(),
2064
- children: z16.array(subagentChildSchema).min(1).max(SUBAGENT_WAIT_CHILD_LIMIT),
2087
+ kind: z17.literal("subagent"),
2088
+ source: z17.literal("cezar"),
2089
+ via: z17.literal("native-subagents"),
2090
+ deadline: z17.iso.datetime(),
2091
+ children: z17.array(subagentChildSchema).min(1).max(SUBAGENT_WAIT_CHILD_LIMIT),
2065
2092
  result: subagentWaitResultSchema.optional()
2066
2093
  }).strict();
2067
2094
  function runningSubagents(wait) {
2068
2095
  return wait.children.filter((child) => child.status === "running").length;
2069
2096
  }
2070
- var waitSchema = z16.discriminatedUnion("kind", [prWaitEntrySchema, timerWaitEntrySchema, humanWaitEntrySchema, workerWaitEntrySchema, processWaitEntrySchema, peerWaitEntrySchema, subagentWaitEntrySchema]);
2097
+ var waitSchema = z17.discriminatedUnion("kind", [prWaitEntrySchema, timerWaitEntrySchema, humanWaitEntrySchema, workerWaitEntrySchema, processWaitEntrySchema, peerWaitEntrySchema, subagentWaitEntrySchema]);
2071
2098
  var oneModeTakesOneId = (ids, mode, ctx) => {
2072
2099
  if (mode === "one" && ids.length !== 1) ctx.addIssue({ code: "custom", message: "one mode requires exactly one id", path: ["mode"] });
2073
2100
  };
2074
- var waitTimeoutSeconds = z16.number().int().min(1).max(PEER_WAIT_MAX_SECONDS).default(PEER_WAIT_DEFAULT_SECONDS);
2075
- var registrationFields = { operation_id: z16.uuid().optional() };
2076
- var squawkWaitRequestSchema = z16.discriminatedUnion("kind", [
2077
- ciWaitRequestSchema.extend({ kind: z16.literal("pr"), ...registrationFields }).strict(),
2078
- z16.object({
2079
- kind: z16.literal("worker"),
2101
+ var waitTimeoutSeconds = z17.number().int().min(1).max(PEER_WAIT_MAX_SECONDS).default(PEER_WAIT_DEFAULT_SECONDS);
2102
+ var registrationFields = { operation_id: z17.uuid().optional() };
2103
+ var squawkWaitRequestSchema = z17.discriminatedUnion("kind", [
2104
+ ciWaitRequestSchema.extend({ kind: z17.literal("pr"), ...registrationFields }).strict(),
2105
+ z17.object({
2106
+ kind: z17.literal("worker"),
2080
2107
  ...registrationFields,
2081
2108
  worker_ids: workerIdsSchema,
2082
2109
  mode: workerWaitModeSchema.optional(),
2083
2110
  timeout_seconds: waitTimeoutSeconds
2084
2111
  }).strict().superRefine((request, ctx) => oneModeTakesOneId(request.worker_ids, request.mode, ctx)),
2085
- z16.object({
2086
- kind: z16.literal("request"),
2112
+ z17.object({
2113
+ kind: z17.literal("request"),
2087
2114
  ...registrationFields,
2088
2115
  request_ids: workerIdsSchema,
2089
2116
  mode: workerWaitModeSchema.optional(),
2090
2117
  timeout_seconds: waitTimeoutSeconds
2091
2118
  }).strict().superRefine((request, ctx) => oneModeTakesOneId(request.request_ids, request.mode, ctx)),
2092
- z16.object({
2093
- kind: z16.literal("peer"),
2119
+ z17.object({
2120
+ kind: z17.literal("peer"),
2094
2121
  ...registrationFields,
2095
2122
  peer_ids: workerIdsSchema,
2096
2123
  timeout_seconds: waitTimeoutSeconds
2097
2124
  }).strict(),
2098
- z16.object({
2099
- kind: z16.literal("timer"),
2125
+ z17.object({
2126
+ kind: z17.literal("timer"),
2100
2127
  ...registrationFields,
2101
- seconds: z16.number().int().min(TIMER_MIN_SECONDS).max(TIMER_MAX_SECONDS),
2102
- note: z16.string().max(NOTE_MAX).optional()
2128
+ seconds: z17.number().int().min(TIMER_MIN_SECONDS).max(TIMER_MAX_SECONDS),
2129
+ note: z17.string().max(NOTE_MAX).optional()
2103
2130
  }).strict(),
2104
- z16.object({
2105
- kind: z16.literal("process"),
2131
+ z17.object({
2132
+ kind: z17.literal("process"),
2106
2133
  ...registrationFields,
2107
2134
  pid: pidSchema,
2108
- exit_file: z16.string().min(1).max(PROCESS_EXIT_FILE_MAX).optional(),
2109
- timeout_seconds: z16.number().int().min(1).max(PROCESS_TIMEOUT_MAX_SECONDS).default(PROCESS_TIMEOUT_DEFAULT_SECONDS),
2110
- note: z16.string().max(NOTE_MAX).optional()
2135
+ exit_file: z17.string().min(1).max(PROCESS_EXIT_FILE_MAX).optional(),
2136
+ timeout_seconds: z17.number().int().min(1).max(PROCESS_TIMEOUT_MAX_SECONDS).default(PROCESS_TIMEOUT_DEFAULT_SECONDS),
2137
+ note: z17.string().max(NOTE_MAX).optional()
2111
2138
  }).strict()
2112
2139
  ]);
2113
- var squawkCancelWaitRequestSchema = z16.object({ wait_id: z16.uuid() }).strict();
2114
- var openWaitFields = { wait_id: z16.uuid(), summary: z16.string().max(256) };
2115
- var openWaitSchema = z16.discriminatedUnion("kind", [
2116
- z16.object({ ...openWaitFields, kind: z16.enum(["pr", "timer", "worker", "process", "peer", "subagent"]), deadline: z16.iso.datetime() }).strict(),
2117
- z16.object({ ...openWaitFields, kind: z16.literal("human") }).strict()
2140
+ var squawkCancelWaitRequestSchema = z17.object({ wait_id: z17.uuid() }).strict();
2141
+ var openWaitFields = { wait_id: z17.uuid(), summary: z17.string().max(256) };
2142
+ var openWaitSchema = z17.discriminatedUnion("kind", [
2143
+ z17.object({ ...openWaitFields, kind: z17.enum(["pr", "timer", "worker", "process", "peer", "subagent"]), deadline: z17.iso.datetime() }).strict(),
2144
+ z17.object({ ...openWaitFields, kind: z17.literal("human") }).strict()
2118
2145
  ]);
2119
- var waitErrorCodeSchema = z16.enum([
2146
+ var waitErrorCodeSchema = z17.enum([
2120
2147
  ...ciWaitErrorCodeSchema.options,
2121
2148
  "timers_disabled",
2122
2149
  "wake_budget_spent",
@@ -2131,42 +2158,42 @@ var waitErrorCodeSchema = z16.enum([
2131
2158
  "messaging_off"
2132
2159
  ]);
2133
2160
  var WAIT_MESSAGE_MAX = 4096;
2134
- var message = z16.string().max(WAIT_MESSAGE_MAX);
2135
- var waitRegistrationReceiptSchema = z16.object({
2136
- operationId: z16.uuid(),
2137
- requestHash: z16.string().regex(/^[0-9a-f]{64}$/),
2161
+ var message = z17.string().max(WAIT_MESSAGE_MAX);
2162
+ var waitRegistrationReceiptSchema = z17.object({
2163
+ operationId: z17.uuid(),
2164
+ requestHash: z17.string().regex(/^[0-9a-f]{64}$/),
2138
2165
  wait: waitSchema,
2139
- deduplicated: z16.boolean()
2166
+ deduplicated: z17.boolean()
2140
2167
  }).strict();
2141
2168
  var registrationAnswerFields = {
2142
- operation_id: z16.uuid().optional()
2169
+ operation_id: z17.uuid().optional()
2143
2170
  };
2144
- var squawkWaitAnswerSchema = z16.discriminatedUnion("ok", [
2145
- z16.object({
2146
- ok: z16.literal(true),
2171
+ var squawkWaitAnswerSchema = z17.discriminatedUnion("ok", [
2172
+ z17.object({
2173
+ ok: z17.literal(true),
2147
2174
  ...registrationAnswerFields,
2148
- effect: z16.enum(["applied", "unchanged"]).optional(),
2149
- deduplicated: z16.boolean().optional(),
2150
- replayed: z16.boolean().optional(),
2151
- wait_phase: z16.enum([...waitPhaseSchema.options, "unavailable"]).optional(),
2152
- wait_id: z16.uuid(),
2175
+ effect: z17.enum(["applied", "unchanged"]).optional(),
2176
+ deduplicated: z17.boolean().optional(),
2177
+ replayed: z17.boolean().optional(),
2178
+ wait_phase: z17.enum([...waitPhaseSchema.options, "unavailable"]).optional(),
2179
+ wait_id: z17.uuid(),
2153
2180
  /** The kind the call asked for: a `request` wait is stored as a `worker` entry. */
2154
- kind: z16.enum(["pr", "timer", "worker", "request", "process", "peer"]),
2155
- deadline: z16.iso.datetime(),
2156
- open_waits: z16.array(openWaitSchema).max(WAIT_LIMIT)
2181
+ kind: z17.enum(["pr", "timer", "worker", "request", "process", "peer"]),
2182
+ deadline: z17.iso.datetime(),
2183
+ open_waits: z17.array(openWaitSchema).max(WAIT_LIMIT)
2157
2184
  }).strict(),
2158
- z16.object({
2159
- ok: z16.literal(false),
2185
+ z17.object({
2186
+ ok: z17.literal(false),
2160
2187
  ...registrationAnswerFields,
2161
- effect: z16.enum(["refused", "unknown"]).optional(),
2188
+ effect: z17.enum(["refused", "unknown"]).optional(),
2162
2189
  retained_wait: openWaitSchema.optional(),
2163
2190
  code: waitErrorCodeSchema,
2164
2191
  message,
2165
- open_waits: z16.array(openWaitSchema).max(WAIT_LIMIT).optional()
2192
+ open_waits: z17.array(openWaitSchema).max(WAIT_LIMIT).optional()
2166
2193
  }).strict()
2167
2194
  ]);
2168
2195
  var squawkAskRequestSchema = askRequestSchema.extend({ context: askContextSchema });
2169
- var askErrorCodeSchema = z16.enum([
2196
+ var askErrorCodeSchema = z17.enum([
2170
2197
  "invalid_request",
2171
2198
  "capacity",
2172
2199
  "persistence",
@@ -2187,30 +2214,30 @@ var askErrorCodeSchema = z16.enum([
2187
2214
  "worker_execution_stopped",
2188
2215
  "root_finish_pending"
2189
2216
  ]);
2190
- var squawkAskAnswerSchema = z16.discriminatedUnion("ok", [
2191
- z16.object({ ok: z16.literal(true), wait_id: z16.uuid(), open_waits: z16.array(openWaitSchema).max(WAIT_LIMIT) }).strict(),
2192
- z16.object({
2193
- ok: z16.literal(false),
2217
+ var squawkAskAnswerSchema = z17.discriminatedUnion("ok", [
2218
+ z17.object({ ok: z17.literal(true), wait_id: z17.uuid(), open_waits: z17.array(openWaitSchema).max(WAIT_LIMIT) }).strict(),
2219
+ z17.object({
2220
+ ok: z17.literal(false),
2194
2221
  code: askErrorCodeSchema,
2195
2222
  message,
2196
- open_waits: z16.array(openWaitSchema).max(WAIT_LIMIT).optional()
2223
+ open_waits: z17.array(openWaitSchema).max(WAIT_LIMIT).optional()
2197
2224
  }).strict()
2198
2225
  ]);
2199
- var squawkCancelWaitAnswerSchema = z16.discriminatedUnion("cancelled", [
2200
- z16.object({
2201
- cancelled: z16.literal(true),
2202
- wait_id: z16.uuid(),
2203
- open_waits: z16.array(openWaitSchema).max(WAIT_LIMIT)
2226
+ var squawkCancelWaitAnswerSchema = z17.discriminatedUnion("cancelled", [
2227
+ z17.object({
2228
+ cancelled: z17.literal(true),
2229
+ wait_id: z17.uuid(),
2230
+ open_waits: z17.array(openWaitSchema).max(WAIT_LIMIT)
2204
2231
  }).strict(),
2205
- z16.object({
2206
- cancelled: z16.literal(false),
2207
- code: z16.enum(["not_found", "already_resolved", "human_question", "invalid_request", "unavailable"]),
2232
+ z17.object({
2233
+ cancelled: z17.literal(false),
2234
+ code: z17.enum(["not_found", "already_resolved", "human_question", "invalid_request", "unavailable"]),
2208
2235
  message,
2209
- open_waits: z16.array(openWaitSchema).max(WAIT_LIMIT).optional()
2236
+ open_waits: z17.array(openWaitSchema).max(WAIT_LIMIT).optional()
2210
2237
  }).strict()
2211
2238
  ]);
2212
- var squawkDoneRequestSchema = z16.object({ summary: z16.string().max(2e3).optional() }).strict();
2213
- var doneErrorCodeSchema = z16.enum([
2239
+ var squawkDoneRequestSchema = z17.object({ summary: z17.string().max(2e3).optional() }).strict();
2240
+ var doneErrorCodeSchema = z17.enum([
2214
2241
  "workers_outstanding",
2215
2242
  "workers_uncollected",
2216
2243
  "worker_questions",
@@ -2234,65 +2261,65 @@ var doneErrorCodeSchema = z16.enum([
2234
2261
  "unavailable",
2235
2262
  "input_pending"
2236
2263
  ]);
2237
- var doneOwedInputSchema = z16.discriminatedUnion("kind", [
2238
- z16.object({ kind: z16.literal("wait_result"), wait_id: z16.string(), wait_kind: z16.string() }).strict(),
2239
- z16.object({ kind: z16.literal("queued"), input_id: z16.string().optional(), source: z16.string() }).strict(),
2240
- z16.object({ kind: z16.literal("in_flight"), input_id: z16.string() }).strict(),
2241
- z16.object({ kind: z16.literal("unread"), input_id: z16.string() }).strict()
2264
+ var doneOwedInputSchema = z17.discriminatedUnion("kind", [
2265
+ z17.object({ kind: z17.literal("wait_result"), wait_id: z17.string(), wait_kind: z17.string() }).strict(),
2266
+ z17.object({ kind: z17.literal("queued"), input_id: z17.string().optional(), source: z17.string() }).strict(),
2267
+ z17.object({ kind: z17.literal("in_flight"), input_id: z17.string() }).strict(),
2268
+ z17.object({ kind: z17.literal("unread"), input_id: z17.string() }).strict()
2242
2269
  ]);
2243
2270
  var doneAccepted = {
2244
- ok: z16.literal(true),
2245
- finishes: z16.literal("at_turn_end"),
2246
- open_waits: z16.array(openWaitSchema).max(WAIT_LIMIT)
2271
+ ok: z17.literal(true),
2272
+ finishes: z17.literal("at_turn_end"),
2273
+ open_waits: z17.array(openWaitSchema).max(WAIT_LIMIT)
2247
2274
  };
2248
- var squawkDoneAnswerSchema = z16.discriminatedUnion("ok", [
2249
- z16.discriminatedUnion("completes", [
2250
- z16.object({ ...doneAccepted, completes: z16.literal("task") }).strict(),
2251
- z16.object({ ...doneAccepted, completes: z16.literal("step"), next_step: z16.string().min(1) }).strict()
2275
+ var squawkDoneAnswerSchema = z17.discriminatedUnion("ok", [
2276
+ z17.discriminatedUnion("completes", [
2277
+ z17.object({ ...doneAccepted, completes: z17.literal("task") }).strict(),
2278
+ z17.object({ ...doneAccepted, completes: z17.literal("step"), next_step: z17.string().min(1) }).strict()
2252
2279
  ]),
2253
- z16.object({
2254
- ok: z16.literal(false),
2280
+ z17.object({
2281
+ ok: z17.literal(false),
2255
2282
  code: doneErrorCodeSchema,
2256
2283
  message,
2257
2284
  /** The workers that block the finish, and why each one does. */
2258
- workers: z16.array(z16.object({
2259
- worker_id: z16.string(),
2260
- reason: z16.enum(["outstanding", "uncollected", "question"])
2285
+ workers: z17.array(z17.object({
2286
+ worker_id: z17.string(),
2287
+ reason: z17.enum(["outstanding", "uncollected", "question"])
2261
2288
  }).strict()).max(64).optional(),
2262
- open_waits: z16.array(openWaitSchema).max(WAIT_LIMIT).optional(),
2289
+ open_waits: z17.array(openWaitSchema).max(WAIT_LIMIT).optional(),
2263
2290
  /** `input_pending` (hearsay-tools/squawk#2587): what the run still owes the agent. */
2264
- owed: z16.array(doneOwedInputSchema).max(64).optional()
2291
+ owed: z17.array(doneOwedInputSchema).max(64).optional()
2265
2292
  }).strict()
2266
2293
  ]);
2267
- var waitingOnUnionSchema = z16.discriminatedUnion("kind", [
2294
+ var waitingOnUnionSchema = z17.discriminatedUnion("kind", [
2268
2295
  /** `shown` once the user sees the question (its `askSeq`): attention reads that as Needs you at
2269
2296
  * any status, a wake turn's included (phase 4b, hearsay-tools/cezarion#1236). */
2270
- z16.object({ kind: z16.literal("human"), shown: z16.literal(true).optional() }),
2297
+ z17.object({ kind: z17.literal("human"), shown: z17.literal(true).optional() }),
2271
2298
  // `autoResumeAt` is free text on the record, so the instant it carries is too.
2272
- z16.object({ kind: z16.literal("usage-limit"), at: z16.string() }),
2299
+ z17.object({ kind: z17.literal("usage-limit"), at: z17.string() }),
2273
2300
  /** The workers still owed an outcome, or the replies awaited; 0 when the row cannot count.
2274
2301
  * `replies` when every open worker entry waits on request replies, so a summary, which carries
2275
2302
  * no `waits`, can still say so (hearsay-tools/cezarion#1235). `peers` when one of those
2276
2303
  * requests went to a peer task (hearsay-tools/cezarion#1995). */
2277
- z16.object({ kind: z16.literal("workers"), count: z16.number().int().nonnegative(), replies: z16.literal(true).optional(), peers: z16.literal(true).optional() }),
2304
+ z17.object({ kind: z17.literal("workers"), count: z17.number().int().nonnegative(), replies: z17.literal(true).optional(), peers: z17.literal(true).optional() }),
2278
2305
  /** The peer tasks the open peer waits name, counted once each (hearsay-tools/cezarion#1995). */
2279
- z16.object({ kind: z16.literal("peers"), count: z16.number().int().nonnegative() }),
2306
+ z17.object({ kind: z17.literal("peers"), count: z17.number().int().nonnegative() }),
2280
2307
  /** The native subagents still running, over every open subagent wait (hearsay-tools/cezarion#2431). */
2281
- z16.object({ kind: z16.literal("subagents"), count: z16.number().int().nonnegative() }),
2282
- z16.object({
2283
- kind: z16.literal("pr"),
2308
+ z17.object({ kind: z17.literal("subagents"), count: z17.number().int().nonnegative() }),
2309
+ z17.object({
2310
+ kind: z17.literal("pr"),
2284
2311
  until: prWaitUntilSchema,
2285
- waitId: z16.uuid(),
2312
+ waitId: z17.uuid(),
2286
2313
  prUrl: ciPrIdentitySchema.shape.prUrl,
2287
2314
  repository: ciPrIdentitySchema.shape.repository,
2288
2315
  prNumber: ciPrIdentitySchema.shape.prNumber,
2289
- deadline: z16.iso.datetime()
2316
+ deadline: z17.iso.datetime()
2290
2317
  }),
2291
2318
  /** A background command (hearsay-tools/cezarion#1446). */
2292
- z16.object({ kind: z16.literal("process"), waitId: z16.uuid(), pid: pidSchema, deadline: z16.iso.datetime(), note: z16.string().max(NOTE_MAX).optional() }),
2293
- z16.object({ kind: z16.literal("timer"), waitId: z16.uuid(), at: z16.iso.datetime(), note: z16.string().max(NOTE_MAX).optional() })
2319
+ z17.object({ kind: z17.literal("process"), waitId: z17.uuid(), pid: pidSchema, deadline: z17.iso.datetime(), note: z17.string().max(NOTE_MAX).optional() }),
2320
+ z17.object({ kind: z17.literal("timer"), waitId: z17.uuid(), at: z17.iso.datetime(), note: z17.string().max(NOTE_MAX).optional() })
2294
2321
  ]);
2295
- var waitingOnSchema = z16.preprocess(
2322
+ var waitingOnSchema = z17.preprocess(
2296
2323
  (value) => value && typeof value === "object" && value.kind === "ci" ? { ...value, kind: "pr", until: "checks" } : value,
2297
2324
  waitingOnUnionSchema
2298
2325
  );
@@ -2421,19 +2448,19 @@ function workerWaitEntryToLegacy(entry) {
2421
2448
  }
2422
2449
 
2423
2450
  // ../contract/src/handoff.ts
2424
- import { z as z17 } from "zod";
2451
+ import { z as z18 } from "zod";
2425
2452
  var HANDOFF_AUTOSAVE_RECORDS_MAX = 20;
2426
- var handoffAutosaveRecordSchema = z17.object({
2427
- at: z17.string(),
2428
- note: z17.string(),
2429
- periodic: z17.object({
2430
- branch: z17.string().nullable(),
2431
- count: z17.number().int().positive(),
2432
- first: z17.string().nullable(),
2433
- latest: z17.string().nullable()
2453
+ var handoffAutosaveRecordSchema = z18.object({
2454
+ at: z18.string(),
2455
+ note: z18.string(),
2456
+ periodic: z18.object({
2457
+ branch: z18.string().nullable(),
2458
+ count: z18.number().int().positive(),
2459
+ first: z18.string().nullable(),
2460
+ latest: z18.string().nullable()
2434
2461
  }).optional()
2435
2462
  });
2436
- var handoffRecordsSchema = z17.object({ autosave: z17.array(handoffAutosaveRecordSchema) });
2463
+ var handoffRecordsSchema = z18.object({ autosave: z18.array(handoffAutosaveRecordSchema) });
2437
2464
  function exactLineIndex(text, line) {
2438
2465
  const padded = `
2439
2466
  ${text}
@@ -2452,46 +2479,46 @@ function nextLineIndex(text, index) {
2452
2479
  }
2453
2480
 
2454
2481
  // ../contract/src/task-options.ts
2455
- import { z as z18 } from "zod";
2482
+ import { z as z19 } from "zod";
2456
2483
  var completionControlsShape = {
2457
- archiveWhenDone: z18.boolean().optional(),
2458
- autoMergePr: z18.boolean().optional()
2484
+ archiveWhenDone: z19.boolean().optional(),
2485
+ autoMergePr: z19.boolean().optional()
2459
2486
  };
2460
2487
  var taskAccessShape = {
2461
- allowWorkers: z18.boolean().optional(),
2462
- allowMessaging: z18.boolean().optional()
2488
+ allowWorkers: z19.boolean().optional(),
2489
+ allowMessaging: z19.boolean().optional()
2463
2490
  };
2464
2491
  var workersAllowed = (run) => run.allowWorkers !== false;
2465
2492
  var messagingAllowed = (run) => run.allowMessaging !== false;
2466
2493
 
2467
2494
  // ../contract/src/runs.ts
2468
- var archivePullRequestIdentitySchema = z19.object({
2469
- owner: z19.string().min(1),
2470
- repo: z19.string().min(1),
2471
- number: z19.number().int().positive()
2472
- });
2473
- var mergedPullRequestSchema = archivePullRequestIdentitySchema.extend({ mergedAt: z19.string().datetime() });
2474
- var autoArchiveReceiptSchema = z19.object({
2475
- reason: z19.literal("pull-requests-merged"),
2476
- archivedAt: z19.string().datetime(),
2477
- fingerprint: z19.string(),
2478
- pullRequests: z19.array(mergedPullRequestSchema)
2479
- });
2480
- var completionActionSchema = z19.object({
2481
- id: z19.string().uuid(),
2482
- phase: z19.enum(["pending", "blocked", "complete"]),
2483
- message: z19.string().optional()
2484
- });
2485
- var usageCounterSchema = z19.number().finite().nonnegative();
2486
- var stepStateSchema = z19.object({
2487
- id: z19.string(),
2488
- name: z19.string(),
2495
+ var archivePullRequestIdentitySchema = z20.object({
2496
+ owner: z20.string().min(1),
2497
+ repo: z20.string().min(1),
2498
+ number: z20.number().int().positive()
2499
+ });
2500
+ var mergedPullRequestSchema = archivePullRequestIdentitySchema.extend({ mergedAt: z20.string().datetime() });
2501
+ var autoArchiveReceiptSchema = z20.object({
2502
+ reason: z20.literal("pull-requests-merged"),
2503
+ archivedAt: z20.string().datetime(),
2504
+ fingerprint: z20.string(),
2505
+ pullRequests: z20.array(mergedPullRequestSchema)
2506
+ });
2507
+ var completionActionSchema = z20.object({
2508
+ id: z20.string().uuid(),
2509
+ phase: z20.enum(["pending", "blocked", "complete"]),
2510
+ message: z20.string().optional()
2511
+ });
2512
+ var usageCounterSchema = z20.number().finite().nonnegative();
2513
+ var stepStateSchema = z20.object({
2514
+ id: z20.string(),
2515
+ name: z20.string(),
2489
2516
  kind: stepKindSchema,
2490
2517
  status: stepStatusSchema,
2491
- iterations: z19.number(),
2518
+ iterations: z20.number(),
2492
2519
  /** Durable count of onFail retry loops consumed by this check. */
2493
- retriesUsed: z19.number().int().nonnegative().optional(),
2494
- tokensUsed: z19.number(),
2520
+ retriesUsed: z20.number().int().nonnegative().optional(),
2521
+ tokensUsed: z20.number(),
2495
2522
  inputTokens: usageCounterSchema.optional(),
2496
2523
  outputTokens: usageCounterSchema.optional(),
2497
2524
  usageInvocationsStarted: usageCounterSchema.optional(),
@@ -2499,113 +2526,92 @@ var stepStateSchema = z19.object({
2499
2526
  usageTurnsStarted: usageCounterSchema.optional(),
2500
2527
  usageTurnsRecorded: usageCounterSchema.optional(),
2501
2528
  usageInvocationEpoch: usageCounterSchema.optional(),
2502
- startedAt: z19.string().optional(),
2503
- finishedAt: z19.string().optional(),
2504
- error: z19.string().optional(),
2529
+ startedAt: z20.string().optional(),
2530
+ finishedAt: z20.string().optional(),
2531
+ error: z20.string().optional(),
2505
2532
  /** Latest agent session id — `claude --resume <id>` and friends. */
2506
- sessionId: z19.string().optional(),
2533
+ sessionId: z20.string().optional(),
2507
2534
  /** Backend that owns `sessionId`; absent on records written before backend affinity. */
2508
2535
  backend: runnerSchema.optional(),
2509
2536
  /** A runner Squawk no longer ships that this step ran on; its session is gone (hearsay-tools/squawk#3715). */
2510
- removedBackend: z19.string().optional(),
2537
+ removedBackend: z20.string().optional(),
2511
2538
  /** Agent account (spec 2026-07-29-agent-profiles) that owns `sessionId` — `default`, or a
2512
2539
  * stored profile id. The two are a PAIR: a session id only resolves inside the config dir
2513
2540
  * that created it, so resume and Continue read this rather than the project's current
2514
2541
  * selection. Absent on records written before accounts existed. */
2515
- profileId: z19.string().optional(),
2516
- skillPath: z19.string().min(1).optional(),
2542
+ profileId: z20.string().optional(),
2543
+ skillPath: z20.string().min(1).optional(),
2517
2544
  // Host-local copy; project skills are relative to the step's working folder.
2518
- costUsd: z19.number().optional(),
2545
+ costUsd: z20.number().optional(),
2519
2546
  /** Explicit provenance for engine-generated continuation steps. */
2520
- synthetic: z19.literal("continuation").optional(),
2547
+ synthetic: z20.literal("continuation").optional(),
2521
2548
  /** On a `synthetic` continuation: the workflow step it continues, recorded once at admission
2522
2549
  * (ADR 0064). It names the step a later Continue of this session runs as, never the workflow
2523
2550
  * position. Absent on steps saved before it; those resolve to the chain's last agent step. */
2524
- continuesStepId: z19.string().optional()
2551
+ continuesStepId: z20.string().optional()
2525
2552
  });
2526
- var diffStatSchema = z19.object({
2527
- adds: z19.number(),
2528
- dels: z19.number(),
2529
- files: z19.number(),
2553
+ var diffStatSchema = z20.object({
2554
+ adds: z20.number(),
2555
+ dels: z20.number(),
2556
+ files: z20.number(),
2530
2557
  /** Additive since #751, and present ONLY when true: the numbers were measured against a
2531
2558
  * branch the agent checked out into the task's worktree, as the run found it, because the
2532
2559
  * worktree's HEAD had been repointed off the task's own branch (every review/QA run does
2533
2560
  * this) and the merge-base anchor would otherwise have reported that branch's entire diff
2534
2561
  * as this task's. Absent on every normal run and on every record written before #751 — a
2535
2562
  * consumer that ignores it sees exactly the old shape. */
2536
- repointed: z19.boolean().optional()
2537
- });
2538
- var queuedMessageSchema = z19.object({
2539
- replayAfterOpen: z19.literal(true).optional(),
2540
- // NativeSkillInputQueue sets; launch hydration excludes; QueuedInput replays after open.
2541
- id: z19.string(),
2542
- text: z19.string(),
2543
- /** `/api/v1/runs/:id/images/…` URLs — attachments are persisted, never inlined. Images and
2544
- * files share this one list; read `isImageAttachmentName` on the file name to tell them apart. */
2545
- images: z19.array(z19.string()).optional(),
2546
- createdAt: z19.string()
2563
+ repointed: z20.boolean().optional()
2547
2564
  });
2548
- var continuationMessageSchema = queuedMessageSchema.extend({
2549
- origin: z19.enum(["human", "lifecycle"]).optional(),
2550
- /** An attributed parent message used as the opening prompt, never a human answer. */
2551
- agentInputId: z19.uuid().optional(),
2552
- /** Captured before clearing the run error. Keep generated context separate from human
2553
- * text so repeated restart recovery never accumulates diagnostic prefixes. */
2554
- resumeContext: z19.object({
2555
- failure: z19.object({ stepId: z19.string().optional(), error: z19.string() }).optional(),
2556
- restarted: z19.literal(true).optional()
2557
- }).optional()
2558
- });
2559
- var processUsageSchema = z19.object({
2565
+ var processUsageSchema = z20.object({
2560
2566
  /** Sum of `%cpu` across the tree — can exceed 100 on multi-core work. */
2561
- cpuPct: z19.number(),
2562
- rssBytes: z19.number(),
2563
- procCount: z19.number()
2564
- });
2565
- var runWebhookOutcomeSchema = z19.object({
2566
- lastDeliveredAt: z19.string().optional(),
2567
- lastError: z19.string().max(1024).optional(),
2568
- lastErrorWebhookId: z19.string().optional()
2569
- });
2570
- var runWorktreeSetupSchema = z19.object({
2571
- status: z19.enum(["running", "done", "failed"]),
2572
- startedAt: z19.string(),
2573
- finishedAt: z19.string().optional(),
2574
- durationMs: z19.number().optional(),
2567
+ cpuPct: z20.number(),
2568
+ rssBytes: z20.number(),
2569
+ procCount: z20.number()
2570
+ });
2571
+ var runWebhookOutcomeSchema = z20.object({
2572
+ lastDeliveredAt: z20.string().optional(),
2573
+ lastError: z20.string().max(1024).optional(),
2574
+ lastErrorWebhookId: z20.string().optional()
2575
+ });
2576
+ var runWorktreeSetupSchema = z20.object({
2577
+ status: z20.enum(["running", "done", "failed"]),
2578
+ startedAt: z20.string(),
2579
+ finishedAt: z20.string().optional(),
2580
+ durationMs: z20.number().optional(),
2575
2581
  /** One line: "`npm ci` exited 1", "`npm ci` timed out after 900s", "invalid config: …". */
2576
- error: z19.string().optional()
2582
+ error: z20.string().optional()
2577
2583
  });
2578
- var runPullRequestSchema = z19.object({
2579
- number: z19.number().int().positive().lt(1e7),
2580
- url: z19.string().regex(/^https?:\/\/github\.com\/[a-z0-9_.-]+\/[a-z0-9_.-]+\/pull\/\d+\/?(?:[?#][^\s]*)?$/i).optional(),
2581
- source: z19.enum(["declared", "created"])
2584
+ var runPullRequestSchema = z20.object({
2585
+ number: z20.number().int().positive().lt(1e7),
2586
+ url: z20.string().regex(/^https?:\/\/github\.com\/[a-z0-9_.-]+\/[a-z0-9_.-]+\/pull\/\d+\/?(?:[?#][^\s]*)?$/i).optional(),
2587
+ source: z20.enum(["declared", "created"])
2582
2588
  }).refine((entry) => entry.url === void 0 || Number(/\/pull\/(\d+)/i.exec(entry.url)?.[1]) === entry.number, { message: "PR URL and number must agree" });
2583
- var workflowCursorSchema = z19.object({ stepId: z19.string(), mode: z19.enum(["resume", "start"]) });
2584
- var doneAcceptedSchema = z19.object({
2585
- session: z19.string(),
2586
- at: z19.string(),
2587
- seq: z19.number().int().nonnegative(),
2588
- openWaits: z19.array(z19.string()).max(32),
2589
- settledWaits: z19.array(z19.string()).max(32),
2590
- lastInput: z19.string().optional(),
2591
- summary: z19.string().optional(),
2592
- freeTurn: z19.literal(true).optional()
2593
- });
2594
- var runRecordSchema = z19.object({
2595
- id: z19.string(),
2596
- title: z19.string(),
2589
+ var workflowCursorSchema = z20.object({ stepId: z20.string(), mode: z20.enum(["resume", "start"]) });
2590
+ var doneAcceptedSchema = z20.object({
2591
+ session: z20.string(),
2592
+ at: z20.string(),
2593
+ seq: z20.number().int().nonnegative(),
2594
+ openWaits: z20.array(z20.string()).max(32),
2595
+ settledWaits: z20.array(z20.string()).max(32),
2596
+ lastInput: z20.string().optional(),
2597
+ summary: z20.string().optional(),
2598
+ freeTurn: z20.literal(true).optional()
2599
+ });
2600
+ var runRecordSchema = z20.object({
2601
+ id: z20.string(),
2602
+ title: z20.string(),
2597
2603
  /** Display title (#389): auto-derived from the first agent turn, or the user's inline edit
2598
2604
  * (`PATCH /runs/:id` sets it together with `title`). Show `titleSummary ?? title`. */
2599
- titleSummary: z19.string().optional(),
2605
+ titleSummary: z20.string().optional(),
2600
2606
  /** Refreshed on every turn-end; absent until the first turn ends (and on worktree-less runs). */
2601
2607
  diffStat: diffStatSchema.optional(),
2602
- workflow: z19.string(),
2603
- task: z19.string(),
2608
+ workflow: z20.string(),
2609
+ task: z20.string(),
2604
2610
  /** Prompt messages stacked onto the run while it waited for a free agent slot (#472). Folded
2605
2611
  * into the prompt at dequeue — never delivered as their own turns. Absent on pre-#472 runs. */
2606
- queuedMessages: z19.array(queuedMessageSchema).optional(),
2612
+ queuedMessages: z20.array(queuedMessageSchema).optional(),
2607
2613
  /** Stop was accepted; execution termination is still pending. */
2608
- stopping: z19.boolean().optional(),
2614
+ stopping: z20.boolean().optional(),
2609
2615
  /** Opening Continue message, retained until its first completed turn for crash recovery. */
2610
2616
  continuationMessage: continuationMessageSchema.optional(),
2611
2617
  /** The workflow step the run goes on from (ADR 0064): `resume` continues that step's session (a
@@ -2616,54 +2622,54 @@ var runRecordSchema = z19.object({
2616
2622
  * `turn-settler.ts` decides at each turn end whether it holds and retires it. */
2617
2623
  doneAccepted: doneAcceptedSchema.optional(),
2618
2624
  /** The last turn carried a malformed explicit structured question. */
2619
- invalidAsk: z19.boolean().optional(),
2625
+ invalidAsk: z20.boolean().optional(),
2620
2626
  /** Owned-run authority; absence is legacy, invalid is explicitly quarantined. */
2621
2627
  delegation: delegationStateSchema.optional(),
2622
2628
  /** Durable non-human input, kept separate from human prompt/answer queues. */
2623
- agentInputs: z19.array(agentInputSchema).optional(),
2629
+ agentInputs: z20.array(agentInputSchema).optional(),
2624
2630
  /** Open and recently resolved waits (spec 2026-10-17-unified-waits): CI, timers and the user. */
2625
- waits: z19.array(waitSchema).optional(),
2626
- waitRegistrations: z19.array(waitRegistrationReceiptSchema).optional(),
2631
+ waits: z20.array(waitSchema).optional(),
2632
+ waitRegistrations: z20.array(waitRegistrationReceiptSchema).optional(),
2627
2633
  /** Settled waits, newest last, capped at `LAST_WAITS_LIMIT`. */
2628
- lastWaits: z19.array(waitSchema).optional(),
2634
+ lastWaits: z20.array(waitSchema).optional(),
2629
2635
  /** Retained recovery observation when previous wait metadata cannot be trusted. */
2630
- lastWaitsError: z19.string().max(256).optional(),
2636
+ lastWaitsError: z20.string().max(256).optional(),
2631
2637
  /** Automatic wakes (timers and nudges) spent since the user last wrote; the budget survives
2632
2638
  * a restart and a scheduler continuation (hearsay-tools/cezarion#1234). */
2633
- automaticWakes: z19.number().int().nonnegative().optional(),
2639
+ automaticWakes: z20.number().int().nonnegative().optional(),
2634
2640
  /** Consecutive wake deliveries that failed; at the bound the run settles `failed` and keeps
2635
2641
  * its results (hearsay-tools/cezarion#1234). */
2636
- waitDeliveryFailures: z19.number().int().nonnegative().optional(),
2642
+ waitDeliveryFailures: z20.number().int().nonnegative().optional(),
2637
2643
  /** Dev servers the agent registered with `cezar_preview_serve` (#781). Salvaged per entry on load. */
2638
- previewServers: z19.array(previewServerSchema).optional(),
2644
+ previewServers: z20.array(previewServerSchema).optional(),
2639
2645
  /** URLs of images and document attachments on the initial task prompt; branch on isImageAttachmentName. */
2640
- taskImages: z19.array(z19.string()).optional(),
2641
- model: z19.string().optional(),
2646
+ taskImages: z20.array(z20.string()).optional(),
2647
+ model: z20.string().optional(),
2642
2648
  /** Reasoning-effort pin (#45). Canonical `low`/`medium`/`high`/`xhigh`/`max`.
2643
2649
  * Absent = harness default. Additive: pre-#45 records omit it and still parse. */
2644
- effort: z19.string().max(32).optional(),
2650
+ effort: z20.string().max(32).optional(),
2645
2651
  /** Normalized provider/model identity used for attribution and reproducible replay. */
2646
- modelIdentity: z19.string().optional(),
2652
+ modelIdentity: z20.string().optional(),
2647
2653
  runner: runnerSchema.optional(),
2648
2654
  /** A runner Squawk no longer ships that this run ran on; it continues only on a named runner (hearsay-tools/squawk#3715). */
2649
- removedRunner: z19.string().optional(),
2655
+ removedRunner: z20.string().optional(),
2650
2656
  /** The composer's per-task agent account (spec 2026-07-29-agent-profiles), applying to steps
2651
2657
  * on `runner`. Absent = the run follows the project's own selection. */
2652
- agentProfile: z19.string().optional(),
2658
+ agentProfile: z20.string().optional(),
2653
2659
  /** Echo of the extra system prompt the run used (POST override or config default). */
2654
- systemPrompt: z19.string().optional(),
2660
+ systemPrompt: z20.string().optional(),
2655
2661
  /** Legacy generated-inbox preference, retained only to read historical run records. */
2656
- generateFollowups: z19.boolean().optional(),
2662
+ generateFollowups: z20.boolean().optional(),
2657
2663
  /** Autonomous mode (#autonomous): the run never parks at `waiting` or the terminal `review`
2658
2664
  * gate. Absent = falsy = not autonomous. */
2659
- autonomous: z19.boolean().optional(),
2665
+ autonomous: z20.boolean().optional(),
2660
2666
  ...completionControlsShape,
2661
2667
  ...taskAccessShape,
2662
2668
  completionAction: completionActionSchema.optional(),
2663
- archiveBlocker: z19.object({
2664
- message: z19.string(),
2665
- runId: z19.string().optional(),
2666
- pullRequestUrl: z19.string().optional()
2669
+ archiveBlocker: z20.object({
2670
+ message: z20.string(),
2671
+ runId: z20.string().optional(),
2672
+ pullRequestUrl: z20.string().optional()
2667
2673
  }).optional(),
2668
2674
  /**
2669
2675
  * Provenance for a task a project GitHub automation launched (#694). Absent on every ordinary
@@ -2674,25 +2680,25 @@ var runRecordSchema = z19.object({
2674
2680
  * launching definition matched, recorded on the run for the audit trail, and `src/runs/store.ts`
2675
2681
  * persists it as free text so an older Squawk can still read a record written by a newer one.
2676
2682
  */
2677
- automation: z19.object({
2678
- automationId: z19.string(),
2679
- automationRevision: z19.number(),
2680
- receiptId: z19.string(),
2681
- event: z19.string(),
2682
- githubUrl: z19.string()
2683
+ automation: z20.object({
2684
+ automationId: z20.string(),
2685
+ automationRevision: z20.number(),
2686
+ receiptId: z20.string(),
2687
+ event: z20.string(),
2688
+ githubUrl: z20.string()
2683
2689
  }).optional(),
2684
2690
  /**
2685
2691
  * Provenance for a task a SCHEDULED automation launched. A separate optional key rather than a
2686
2692
  * loosened `automation`: `runs.json` is parsed as one array, so a downgraded Squawk meeting a
2687
2693
  * record without `githubUrl` would drop every run, whereas an unknown key it simply strips.
2688
2694
  */
2689
- automationTrigger: z19.object({
2690
- automationId: z19.string(),
2691
- automationRevision: z19.number(),
2692
- receiptId: z19.string(),
2693
- trigger: z19.enum(["schedule", "catch-up", "manual"]),
2695
+ automationTrigger: z20.object({
2696
+ automationId: z20.string(),
2697
+ automationRevision: z20.number(),
2698
+ receiptId: z20.string(),
2699
+ trigger: z20.enum(["schedule", "catch-up", "manual"]),
2694
2700
  /** The scheduled instant (UTC ISO); for `manual`, the launch time. */
2695
- occurrenceAt: z19.string()
2701
+ occurrenceAt: z20.string()
2696
2702
  }).optional(),
2697
2703
  /** A pending worker destroy's automatic retry state (hearsay-tools/cezarion#879). Here, not in
2698
2704
  * the strict worker `delegation`, so an older Squawk strips it instead of quarantining the worker,
@@ -2701,102 +2707,102 @@ var runRecordSchema = z19.object({
2701
2707
  /** Task webhook opt-in (#589): the project's webhook receives this run's status changes.
2702
2708
  * Absent = off. Changes after start through `POST /runs/:id/notify`, which is why it is not
2703
2709
  * part of the idempotent-start hash. */
2704
- notify: z19.boolean().optional(),
2710
+ notify: z20.boolean().optional(),
2705
2711
  /** The last webhook delivery's outcome (#589). Absent until a delivery was attempted. */
2706
2712
  webhook: runWebhookOutcomeSchema.optional(),
2707
2713
  status: runStatusSchema,
2708
2714
  /** Live native approval attention; grants themselves never persist. */
2709
- hasPendingPermission: z19.boolean().optional(),
2715
+ hasPendingPermission: z20.boolean().optional(),
2710
2716
  /** Exact ISO-8601 instant this run resumes itself after a provider usage limit stopped it
2711
2717
  * (spec 2026-08-03-auto-resume-after-usage-limit). Present only on a `waiting` run with a
2712
2718
  * pending automatic resume (hearsay-tools/cezarion#1236; a `failed` one before) — its absence
2713
2719
  * is what "no resume is scheduled" looks like. */
2714
- autoResumeAt: z19.string().optional(),
2720
+ autoResumeAt: z20.string().optional(),
2715
2721
  /** Consecutive automatic resumes since the last human turn, against the safety cap. */
2716
- autoResumeAttempts: z19.number().optional(),
2722
+ autoResumeAttempts: z20.number().optional(),
2717
2723
  /** Why the hold waits: `usage-limit`, or a `provider-error` retried with back-off (hearsay-tools/squawk#3337). */
2718
- autoResumeReason: z19.enum(["usage-limit", "provider-error"]).optional(),
2724
+ autoResumeReason: z20.enum(["usage-limit", "provider-error"]).optional(),
2719
2725
  /** Why a `waiting` run parked (ADR 0064): its own turn (`turn`), an automatic-resume hold
2720
2726
  * (`hold`), or a session that closed while it held wakes (`closing-wakes`). The exit that parks
2721
2727
  * the run writes it (`runs/run-exits.ts`); a run that leaves `waiting` keeps it unread. A row
2722
2728
  * saved before the fact has none. */
2723
- parkReason: z19.enum(["turn", "hold", "closing-wakes"]).optional(),
2724
- createdAt: z19.string(),
2725
- startedAt: z19.string().optional(),
2726
- finishedAt: z19.string().optional(),
2727
- tokensUsed: z19.number(),
2729
+ parkReason: z20.enum(["turn", "hold", "closing-wakes"]).optional(),
2730
+ createdAt: z20.string(),
2731
+ startedAt: z20.string().optional(),
2732
+ finishedAt: z20.string().optional(),
2733
+ tokensUsed: z20.number(),
2728
2734
  inputTokens: usageCounterSchema.optional(),
2729
2735
  outputTokens: usageCounterSchema.optional(),
2730
- costUsd: z19.number().optional(),
2731
- pullRequestUrl: z19.string().optional(),
2732
- pullRequests: z19.array(runPullRequestSchema).optional(),
2736
+ costUsd: z20.number().optional(),
2737
+ pullRequestUrl: z20.string().optional(),
2738
+ pullRequests: z20.array(runPullRequestSchema).optional(),
2733
2739
  /** The PR this task is ABOUT (#407) — auto-discovered from conversation references. Display
2734
2740
  * tier only: `pullRequestUrl` (the PR this task CREATED) wins, and the action gates ignore it. */
2735
- referencedPullRequestUrl: z19.string().optional(),
2741
+ referencedPullRequestUrl: z20.string().optional(),
2736
2742
  /** The PR/issue number this task is ABOUT (task auto-naming spec) — display tier only. */
2737
- prNumber: z19.number().optional(),
2738
- issueNumber: z19.number().optional(),
2743
+ prNumber: z20.number().optional(),
2744
+ issueNumber: z20.number().optional(),
2739
2745
  /** Server-side provenance: referenced-issue discovery currently owns `issueNumber`. */
2740
- referencedIssueNumberSeeded: z19.boolean().optional(),
2746
+ referencedIssueNumberSeeded: z20.boolean().optional(),
2741
2747
  /** 'user' = renamed via PATCH, never auto-overwritten; 'marker' = agent-declared via
2742
2748
  * CEZ:TITLE (spec 2026-07-18-task-ref-markers); 'auto' = namer-owned. */
2743
- titleOrigin: z19.enum(["user", "auto", "marker"]).optional(),
2749
+ titleOrigin: z20.enum(["user", "auto", "marker"]).optional(),
2744
2750
  /** References the agent declared via CEZ:PR/CEZ:ISSUE markers — authoritative over the namer
2745
2751
  * for the matching kind. */
2746
- markerRefs: z19.object({ pr: z19.number().optional(), issue: z19.number().optional() }).optional(),
2752
+ markerRefs: z20.object({ pr: z20.number().optional(), issue: z20.number().optional() }).optional(),
2747
2753
  /** The referenced tier's working set (distinct PR URLs spotted, capped server-side). */
2748
- referencedPrCandidates: z19.array(z19.string()).optional(),
2754
+ referencedPrCandidates: z20.array(z20.string()).optional(),
2749
2755
  /** The issue this task is ABOUT (spec 2026-07-21-report-ref-discovery). Display-only. */
2750
- referencedIssueUrl: z19.string().optional(),
2756
+ referencedIssueUrl: z20.string().optional(),
2751
2757
  /** The referenced-issue working set, persisted like `referencedPrCandidates`. Capped. */
2752
- referencedIssueCandidates: z19.array(z19.string()).optional(),
2758
+ referencedIssueCandidates: z20.array(z20.string()).optional(),
2753
2759
  /** Explicit execution policy. `false` means the run intentionally uses the repo root;
2754
2760
  * absent on older runs and for the default isolated-worktree mode. */
2755
- worktree: z19.literal(false).optional(),
2761
+ worktree: z20.literal(false).optional(),
2756
2762
  /** Absent for in-place runs and after an isolated worktree is removed. */
2757
- worktreePath: z19.string().optional(),
2758
- branch: z19.string().optional(),
2763
+ worktreePath: z20.string().optional(),
2764
+ branch: z20.string().optional(),
2759
2765
  /** Stable baseline for session git views: a worktree's fork ref, or an in-place run's starting commit. */
2760
- baseBranch: z19.string().optional(),
2766
+ baseBranch: z20.string().optional(),
2761
2767
  /** Set when count-based retention (#483) reclaimed the worktree DIRECTORY (the branch is
2762
2768
  * kept): the dir is gone but recoverable. */
2763
- worktreeReclaimedAt: z19.string().optional(),
2769
+ worktreeReclaimedAt: z20.string().optional(),
2764
2770
  /** The worktree setup this run's isolated worktree got (#917). Absent when none ran. */
2765
2771
  worktreeSetup: runWorktreeSetupSchema.optional(),
2766
2772
  /** Historical parallel variants (retired): runs sharing a groupId are one group. */
2767
- groupId: z19.string().optional(),
2773
+ groupId: z20.string().optional(),
2768
2774
  /** Variant letter within the group — 'A' | 'B' | 'C'. */
2769
- variant: z19.string().optional(),
2775
+ variant: z20.string().optional(),
2770
2776
  /** Idempotent start (#504): the caller's request id and the hash of the start payload it
2771
2777
  * named (`src/runs/client-request.ts`). Absent on every run started without one. */
2772
- clientRequestId: z19.string().optional(),
2773
- clientRequestHash: z19.string().optional(),
2774
- peakRssBytes: z19.number().optional(),
2775
- peakProcCount: z19.number().optional(),
2776
- archived: z19.boolean(),
2777
- archivedAt: z19.string().optional(),
2778
+ clientRequestId: z20.string().optional(),
2779
+ clientRequestHash: z20.string().optional(),
2780
+ peakRssBytes: z20.number().optional(),
2781
+ peakProcCount: z20.number().optional(),
2782
+ archived: z20.boolean(),
2783
+ archivedAt: z20.string().optional(),
2778
2784
  autoArchive: autoArchiveReceiptSchema.optional(),
2779
- manualUnarchivedAt: z19.string().datetime().optional(),
2785
+ manualUnarchivedAt: z20.string().datetime().optional(),
2780
2786
  /** Pinned to the top of this project's task list (#935) — the `Pinned` group above
2781
2787
  * `Needs you`. Optional, unlike `archived`: absent IS "not pinned", which is what every
2782
2788
  * record written before this carries, and the store never writes `false`. Archiving
2783
2789
  * clears it, because archiving is how a user resigns from a task. */
2784
- pinned: z19.boolean().optional(),
2790
+ pinned: z20.boolean().optional(),
2785
2791
  /** When the pin was set. Deliberately WRITE-ONLY today, like the `archivedAt` above it:
2786
2792
  * ordering inside `Pinned` uses the ordinary status/recency rules, so nothing reads this
2787
2793
  * yet. It is here because a field on the saved run record is far cheaper to add now than to
2788
2794
  * add later — "pinned oldest first" and "unpin what you pinned a month ago" both need it,
2789
2795
  * and neither can be reconstructed after the fact. */
2790
- pinnedAt: z19.string().optional(),
2796
+ pinnedAt: z20.string().optional(),
2791
2797
  /** Read receipt (#unread-done-items): ISO time the cockpit last opened this run's
2792
2798
  * thread. A finished (`done`/`failed`) run reads as *unread* until seen since it
2793
2799
  * finished — see `isUnread()` in the cockpit's `lib/read-state.ts`. Absent on old
2794
2800
  * runs, on any run not yet opened, and on one deliberately put back to unread via
2795
2801
  * `POST /runs/:id/unread` (#775) — all three count as unread. */
2796
- seenAt: z19.string().optional(),
2797
- currentStepId: z19.string().optional(),
2798
- error: z19.string().optional(),
2799
- steps: z19.array(stepStateSchema),
2802
+ seenAt: z20.string().optional(),
2803
+ currentStepId: z20.string().optional(),
2804
+ error: z20.string().optional(),
2805
+ steps: z20.array(stepStateSchema),
2800
2806
  /**
2801
2807
  * The persisted workflow definition, so a `queued` run survives a restart — including the ad-hoc
2802
2808
  * "(planned)" chains that exist nowhere else.
@@ -2816,17 +2822,17 @@ var runRecordSchema = z19.object({
2816
2822
  var apiRunSchema = runRecordSchema.extend({
2817
2823
  /** Read-only GET /runs/:id verdict: null permits Finish, a string explains refusal.
2818
2824
  * Absent on lists, stored records and mutation responses; absence is not permission. */
2819
- finishBlocked: z19.string().nullable().optional(),
2825
+ finishBlocked: z20.string().nullable().optional(),
2820
2826
  /** The server's take-over command for the run's latest session, with the executable the server
2821
2827
  * resolves. Absent without a session or for an id the server refuses. Never persisted. */
2822
- cliResumeCommand: z19.string().optional(),
2828
+ cliResumeCommand: z20.string().optional(),
2823
2829
  usage: processUsageSchema.optional()
2824
2830
  });
2825
- var runSummarySchema = z19.object({
2826
- id: z19.string(),
2827
- title: z19.string(),
2828
- titleSummary: z19.string().optional(),
2829
- titleOrigin: z19.enum(["user", "auto", "marker"]).optional(),
2831
+ var runSummarySchema = z20.object({
2832
+ id: z20.string(),
2833
+ title: z20.string(),
2834
+ titleSummary: z20.string().optional(),
2835
+ titleOrigin: z20.enum(["user", "auto", "marker"]).optional(),
2830
2836
  status: runStatusSchema,
2831
2837
  hasPendingPermission: runRecordSchema.shape.hasPendingPermission,
2832
2838
  /** The run's top open wait (`computeWaitingOn`), which `deriveAttention` reads. The wait list
@@ -2834,35 +2840,35 @@ var runSummarySchema = z19.object({
2834
2840
  waitingOn: waitingOnSchema.optional(),
2835
2841
  /** Present when a wait has resolved and its wake turn has not started (`hasResolvedWait`):
2836
2842
  * attention's "waiting for capacity" rung. */
2837
- waitWakePending: z19.literal(true).optional(),
2843
+ waitWakePending: z20.literal(true).optional(),
2838
2844
  /** Only the relationship role and wait phase used by list attention. */
2839
2845
  delegation: runDelegationSummarySchema.optional(),
2840
- createdAt: z19.string(),
2841
- finishedAt: z19.string().optional(),
2846
+ createdAt: z20.string(),
2847
+ finishedAt: z20.string().optional(),
2842
2848
  /** With `status`/`finishedAt`/`archived`, the four inputs `isUnread` reads — what lets the
2843
2849
  * palette lead with "finished while you weren't looking" across every project, not just the
2844
2850
  * one you happen to be standing in. */
2845
- seenAt: z19.string().optional(),
2851
+ seenAt: z20.string().optional(),
2846
2852
  /** Always present, like `RunRecord.archived`: absent would read as "not archived", and the
2847
2853
  * unread rule treats archiving as a stronger "done with this" than reading. */
2848
- archived: z19.boolean(),
2854
+ archived: z20.boolean(),
2849
2855
  /** A run parked by a provider usage limit is `failed` on the record with a resume booked
2850
2856
  * (spec 2026-08-03-auto-resume-after-usage-limit). Both `deriveAttention` and `isUnread` read
2851
2857
  * it, so without it here a cross-project row would show a red "failed" dot and land in
2852
2858
  * Recently finished for work that is simply waiting for its appointment. */
2853
- autoResumeAt: z19.string().optional(),
2859
+ autoResumeAt: z20.string().optional(),
2854
2860
  /** Which hold it is (hearsay-tools/squawk#3337): the row names a provider error instead of a usage limit. */
2855
2861
  autoResumeReason: runRecordSchema.shape.autoResumeReason,
2856
2862
  /** The workflow the run executes — the global Tasks page shows it in a column and groups by
2857
2863
  * it. Always present on the record (`RunRecord.workflow`), so required here. The display
2858
2864
  * name, which reads a `(planned)` chain as its first agent's name, is `workflowLabel` below. */
2859
- workflow: z19.string(),
2865
+ workflow: z20.string(),
2860
2866
  /** The task's branch, when it has one — a column on the global page, and the one field that
2861
2867
  * makes a cross-project row identifiable at a glance without opening it. */
2862
- branch: z19.string().optional(),
2868
+ branch: z20.string().optional(),
2863
2869
  /** When the agent actually started, as opposed to when the task was created. The global page's
2864
2870
  * age column prefers it and falls back to `createdAt`, exactly as the per-project table does. */
2865
- startedAt: z19.string().optional(),
2871
+ startedAt: z20.string().optional(),
2866
2872
  /**
2867
2873
  * The six fields `taskReference()` (`web/src/lib/tasks-table.ts`) reads to decide a task's PR
2868
2874
  * or issue chip. Carried verbatim rather than pre-resolved into a `{kind, number, url}` on the
@@ -2874,21 +2880,21 @@ var runSummarySchema = z19.object({
2874
2880
  * Six scalars is still the slim row this schema exists to keep: `steps[]` and `workflowDef`,
2875
2881
  * the expensive half, stay off it.
2876
2882
  */
2877
- pullRequestUrl: z19.string().optional(),
2878
- pullRequests: z19.array(runPullRequestSchema).optional(),
2879
- referencedPullRequestUrl: z19.string().optional(),
2880
- prNumber: z19.number().optional(),
2881
- issueNumber: z19.number().optional(),
2882
- referencedIssueUrl: z19.string().optional(),
2883
- markerRefs: z19.object({ pr: z19.number().optional(), issue: z19.number().optional() }).optional(),
2883
+ pullRequestUrl: z20.string().optional(),
2884
+ pullRequests: z20.array(runPullRequestSchema).optional(),
2885
+ referencedPullRequestUrl: z20.string().optional(),
2886
+ prNumber: z20.number().optional(),
2887
+ issueNumber: z20.number().optional(),
2888
+ referencedIssueUrl: z20.string().optional(),
2889
+ markerRefs: z20.object({ pr: z20.number().optional(), issue: z20.number().optional() }).optional(),
2884
2890
  /** What the run has cost so far. Absent means nothing was recorded, which is NOT `$0` — the
2885
2891
  * cockpit prints an em dash rather than claiming a measurement that never happened. */
2886
- costUsd: z19.number().optional(),
2892
+ costUsd: z20.number().optional(),
2887
2893
  /** The persisted high-water marks a FINISHED run leaves behind. `usage` below stops existing
2888
2894
  * the moment the process tree does, so without these a finished row could say nothing at all
2889
2895
  * about what it took to run. */
2890
- peakRssBytes: z19.number().optional(),
2891
- peakProcCount: z19.number().optional(),
2896
+ peakRssBytes: z20.number().optional(),
2897
+ peakProcCount: z20.number().optional(),
2892
2898
  /**
2893
2899
  * The live CPU/RSS sample of this run's process tree, attached on the way out exactly as
2894
2900
  * `GET /runs` attaches it (`withUsage`) — never persisted.
@@ -2902,34 +2908,34 @@ var runSummarySchema = z19.object({
2902
2908
  /** The Workflow column's text (#817): for a `(planned)` or `(inbox)` chain, its first agent
2903
2909
  * step's name when it has one, otherwise `workflow`. Derived here because it is the one thing
2904
2910
  * a list row ever read off `steps[]`. */
2905
- workflowLabel: z19.string(),
2911
+ workflowLabel: z20.string(),
2906
2912
  /** Historical variant group membership (spec 010, retired): the list shows each run as its own row. */
2907
- groupId: z19.string().optional(),
2908
- variant: z19.string().optional(),
2909
- pinned: z19.boolean().optional(),
2913
+ groupId: z20.string().optional(),
2914
+ variant: z20.string().optional(),
2915
+ pinned: z20.boolean().optional(),
2910
2916
  /** The automation that launched this task (hearsay-tools/cezarion#1332), from `automation`
2911
2917
  * (GitHub-triggered) or `automationTrigger` (scheduled, catch-up or Run now). Absent on every
2912
2918
  * task no automation launched; the sidebar files the task under Automations when present. */
2913
- automationId: z19.string().optional(),
2919
+ automationId: z20.string().optional(),
2914
2920
  runner: runRecordSchema.shape.runner,
2915
2921
  removedRunner: runRecordSchema.shape.removedRunner,
2916
- model: z19.string().optional(),
2917
- notify: z19.boolean().optional(),
2922
+ model: z20.string().optional(),
2923
+ notify: z20.boolean().optional(),
2918
2924
  diffStat: diffStatSchema.optional(),
2919
- tokensUsed: z19.number(),
2925
+ tokensUsed: z20.number(),
2920
2926
  inputTokens: runRecordSchema.shape.inputTokens,
2921
2927
  outputTokens: runRecordSchema.shape.outputTokens,
2922
- currentStepId: z19.string().optional(),
2928
+ currentStepId: z20.string().optional(),
2923
2929
  /** The backend of the step `currentStepId` names, when it recorded one — the conversation view
2924
2930
  * labels a delegated peer by the agent actually running it, which can differ from `runner`. */
2925
2931
  currentStepBackend: runnerSchema.optional(),
2926
- error: z19.string().optional(),
2932
+ error: z20.string().optional(),
2927
2933
  /** Present while the run's isolated worktree exists — the breadcrumb says "Isolated worktree". */
2928
- worktreePath: z19.string().optional()
2934
+ worktreePath: z20.string().optional()
2929
2935
  });
2930
2936
  var runIndexEntrySchema = runSummarySchema.extend({
2931
2937
  /** The registered project this run belongs to. Joins against `GET /projects`. */
2932
- projectId: z19.string()
2938
+ projectId: z20.string()
2933
2939
  });
2934
2940
  var SUMMARY_OPTIONAL_KEYS = [
2935
2941
  "titleSummary",
@@ -2999,159 +3005,159 @@ function automationIdOf(run) {
2999
3005
  function isAutomationTask(run) {
3000
3006
  return run.automationId !== void 0;
3001
3007
  }
3002
- var referenceStatusesByProjectSchema = z19.record(z19.string(), z19.object({
3003
- prs: z19.record(z19.number(), referenceStatusSchema),
3004
- issues: z19.record(z19.number(), referenceStatusSchema)
3008
+ var referenceStatusesByProjectSchema = z20.record(z20.string(), z20.object({
3009
+ prs: z20.record(z20.number(), referenceStatusSchema),
3010
+ issues: z20.record(z20.number(), referenceStatusSchema)
3005
3011
  }));
3006
- var runSummariesQuerySchema = z19.object({
3007
- archived: z19.enum(["recent", "all"]).optional()
3012
+ var runSummariesQuerySchema = z20.object({
3013
+ archived: z20.enum(["recent", "all"]).optional()
3008
3014
  });
3009
- var archivedRunsQuerySchema = z19.object({
3015
+ var archivedRunsQuerySchema = z20.object({
3010
3016
  /** `nextCursor` from the previous page. Opaque: a malformed one answers 400. */
3011
- before: z19.string().optional(),
3012
- limit: z19.coerce.number().int().min(1).max(ARCHIVED_RUNS_PAGE_MAX).optional(),
3017
+ before: z20.string().optional(),
3018
+ limit: z20.coerce.number().int().min(1).max(ARCHIVED_RUNS_PAGE_MAX).optional(),
3013
3019
  /** Only runs that match (`matchesRunSearch`): title, id, branch, workflow, PR or issue. */
3014
- q: z19.string().optional()
3020
+ q: z20.string().optional()
3015
3021
  });
3016
- var archivedRunsResponseSchema = z19.object({
3017
- runs: z19.array(runSummarySchema),
3022
+ var archivedRunsResponseSchema = z20.object({
3023
+ runs: z20.array(runSummarySchema),
3018
3024
  /** The `before` of the next page, or null on the last one. */
3019
- nextCursor: z19.string().nullable(),
3025
+ nextCursor: z20.string().nullable(),
3020
3026
  /** How many archived root runs match, across every page. */
3021
- total: z19.number().int().nonnegative()
3027
+ total: z20.number().int().nonnegative()
3022
3028
  });
3023
3029
  var RUNS_SEARCH_PER_PROJECT_MAX = 50;
3024
- var runsSearchQuerySchema = z19.object({
3030
+ var runsSearchQuerySchema = z20.object({
3025
3031
  /** Every whitespace-separated token must match (`matchesRunSearch`). At least two characters:
3026
3032
  * one matches nearly every run. */
3027
- q: z19.string().trim().min(2),
3028
- limit: z19.coerce.number().int().min(1).max(RUNS_SEARCH_PER_PROJECT_MAX).optional()
3033
+ q: z20.string().trim().min(2),
3034
+ limit: z20.coerce.number().int().min(1).max(RUNS_SEARCH_PER_PROJECT_MAX).optional()
3029
3035
  });
3030
- var runsSearchResponseSchema = z19.object({
3036
+ var runsSearchResponseSchema = z20.object({
3031
3037
  /** Root runs, archived or not, newest first across every registered project. */
3032
- runs: z19.array(runIndexEntrySchema),
3038
+ runs: z20.array(runIndexEntrySchema),
3033
3039
  /** Ids of the projects that had more matches than `limit`. */
3034
- truncated: z19.array(z19.string())
3040
+ truncated: z20.array(z20.string())
3035
3041
  });
3036
3042
  var createRunResponseSchema = runRecordSchema;
3037
- var cancelResponseSchema = z19.object({ cancelled: z19.boolean() });
3038
- var cancelAutoResumeResponseSchema = z19.object({ cancelled: z19.literal(true) });
3039
- var archiveFinishedScopeSchema = z19.enum(["unpinned", "pinned"]);
3040
- var archiveFinishedRequestSchema = z19.object({
3043
+ var cancelResponseSchema = z20.object({ cancelled: z20.boolean() });
3044
+ var cancelAutoResumeResponseSchema = z20.object({ cancelled: z20.literal(true) });
3045
+ var archiveFinishedScopeSchema = z20.enum(["unpinned", "pinned"]);
3046
+ var archiveFinishedRequestSchema = z20.object({
3041
3047
  scope: archiveFinishedScopeSchema.optional(),
3042
- automation: z19.boolean().optional()
3043
- });
3044
- var archiveFinishedResponseSchema = z19.object({
3045
- archived: z19.number(),
3046
- ids: z19.array(z19.string()),
3047
- pinnedIds: z19.array(z19.string())
3048
- });
3049
- var markAllReadRequestSchema = z19.object({ automation: z19.boolean().optional() });
3050
- var markAllReadResponseSchema = z19.object({ read: z19.number() });
3051
- var deleteRunResponseSchema = z19.object({ deleted: z19.literal(true) });
3052
- var finishResponseSchema = z19.object({ finished: z19.literal(true) });
3053
- var continueResponseSchema = z19.object({ continued: z19.literal(true) });
3054
- var createPrResponseSchema = z19.object({
3055
- url: z19.string(),
3056
- dryRun: z19.boolean()
3057
- });
3058
- var messageResponseSchema = z19.union([
3059
- z19.object({ delivered: z19.literal(true) }),
3060
- z19.object({ queued: z19.literal(true), message: queuedMessageSchema }),
3061
- z19.object({ deferred: z19.literal(true) })
3048
+ automation: z20.boolean().optional()
3049
+ });
3050
+ var archiveFinishedResponseSchema = z20.object({
3051
+ archived: z20.number(),
3052
+ ids: z20.array(z20.string()),
3053
+ pinnedIds: z20.array(z20.string())
3054
+ });
3055
+ var markAllReadRequestSchema = z20.object({ automation: z20.boolean().optional() });
3056
+ var markAllReadResponseSchema = z20.object({ read: z20.number() });
3057
+ var deleteRunResponseSchema = z20.object({ deleted: z20.literal(true) });
3058
+ var finishResponseSchema = z20.object({ finished: z20.literal(true) });
3059
+ var continueResponseSchema = z20.object({ continued: z20.literal(true) });
3060
+ var createPrResponseSchema = z20.object({
3061
+ url: z20.string(),
3062
+ dryRun: z20.boolean()
3063
+ });
3064
+ var messageResponseSchema = z20.union([
3065
+ z20.object({ delivered: z20.literal(true) }),
3066
+ z20.object({ queued: z20.literal(true), message: queuedMessageSchema }),
3067
+ z20.object({ deferred: z20.literal(true) })
3062
3068
  ]);
3063
- var editQueuedMessageResponseSchema = z19.object({ message: queuedMessageSchema });
3064
- var removeQueuedMessageResponseSchema = z19.object({ removed: z19.literal(true) });
3065
- var openInCliResponseSchema = z19.object({
3066
- opened: z19.literal(true),
3067
- command: z19.string()
3068
- });
3069
- var removeWorktreeResponseSchema = z19.object({ removed: z19.literal(true) });
3070
- var gitCommitResponseSchema = z19.object({
3071
- committed: z19.literal(true),
3072
- sha: z19.string()
3073
- });
3074
- var gitPushResponseSchema = z19.object({
3075
- pushed: z19.literal(true),
3076
- branch: z19.string(),
3077
- remote: z19.string(),
3078
- upstreamSet: z19.boolean()
3079
- });
3080
- var runCommitSchema = z19.object({
3081
- sha: z19.string(),
3082
- subject: z19.string(),
3083
- author: z19.string(),
3069
+ var editQueuedMessageResponseSchema = z20.object({ message: queuedMessageSchema });
3070
+ var removeQueuedMessageResponseSchema = z20.object({ removed: z20.literal(true) });
3071
+ var openInCliResponseSchema = z20.object({
3072
+ opened: z20.literal(true),
3073
+ command: z20.string()
3074
+ });
3075
+ var removeWorktreeResponseSchema = z20.object({ removed: z20.literal(true) });
3076
+ var gitCommitResponseSchema = z20.object({
3077
+ committed: z20.literal(true),
3078
+ sha: z20.string()
3079
+ });
3080
+ var gitPushResponseSchema = z20.object({
3081
+ pushed: z20.literal(true),
3082
+ branch: z20.string(),
3083
+ remote: z20.string(),
3084
+ upstreamSet: z20.boolean()
3085
+ });
3086
+ var runCommitSchema = z20.object({
3087
+ sha: z20.string(),
3088
+ subject: z20.string(),
3089
+ author: z20.string(),
3084
3090
  /** Relative time ("3 hours ago") — git's `%cr`. */
3085
- when: z19.string()
3091
+ when: z20.string()
3086
3092
  });
3087
- var runCommitsResponseSchema = z19.object({ commits: z19.array(runCommitSchema) });
3088
- var attachmentFileParamSchema = z19.object({
3089
- id: z19.string().min(1),
3090
- file: z19.string().regex(/^[A-Za-z0-9_-][A-Za-z0-9._-]*$/).refine((name) => !name.includes(".."))
3093
+ var runCommitsResponseSchema = z20.object({ commits: z20.array(runCommitSchema) });
3094
+ var attachmentFileParamSchema = z20.object({
3095
+ id: z20.string().min(1),
3096
+ file: z20.string().regex(/^[A-Za-z0-9_-][A-Za-z0-9._-]*$/).refine((name) => !name.includes(".."))
3091
3097
  });
3092
- var attachmentInputSchema = z19.object({
3093
- mediaType: z19.string().refine(isAttachmentMediaType, {
3098
+ var attachmentInputSchema = z20.object({
3099
+ mediaType: z20.string().refine(isAttachmentMediaType, {
3094
3100
  message: "unsupported attachment type \u2014 images, plain text, markdown and PDF only"
3095
3101
  }),
3096
- data: z19.string().min(1).max(7e6)
3102
+ data: z20.string().min(1).max(7e6)
3097
3103
  });
3098
3104
  var imageInputSchema = attachmentInputSchema;
3099
- var createRunInputBaseSchema = z19.object({
3100
- workflow: z19.string().min(1).optional(),
3105
+ var createRunInputBaseSchema = z20.object({
3106
+ workflow: z20.string().min(1).optional(),
3101
3107
  /** An inline chain (spec 008 — an approved plan runs as an ad-hoc workflow, never written to
3102
3108
  * a file). The catalog's own step shape, not a copy of it. */
3103
- steps: z19.array(workflowStepDefSchema).min(1).max(8).optional(),
3104
- task: z19.string().min(1).max(1e5, "must be at most 100000 characters"),
3105
- model: z19.string().optional(),
3109
+ steps: z20.array(workflowStepDefSchema).min(1).max(8).optional(),
3110
+ task: z20.string().min(1).max(1e5, "must be at most 100000 characters"),
3111
+ model: z20.string().optional(),
3106
3112
  /** Reasoning-effort pin (#45). Omit for the harness default; empty/`auto` stay implicit. */
3107
- effort: z19.string().max(32).optional(),
3113
+ effort: z20.string().max(32).optional(),
3108
3114
  runner: runnerSchema.optional(),
3109
3115
  /** Agent account for this task (spec 2026-07-29-agent-profiles). Omit to follow the
3110
3116
  * project's own selection; an id that no longer exists is a 400, not a silent default. */
3111
- agentProfile: z19.string().max(64).optional(),
3117
+ agentProfile: z20.string().max(64).optional(),
3112
3118
  /** false → run in the repo working tree instead of an isolated worktree (read-only skills).
3113
3119
  * Omit for the default. */
3114
- worktree: z19.boolean().optional(),
3120
+ worktree: z20.boolean().optional(),
3115
3121
  /** true → autonomous run: never parks at "waiting"; auto-continues until done. */
3116
- autonomous: z19.boolean().optional(),
3122
+ autonomous: z20.boolean().optional(),
3117
3123
  ...completionControlsShape,
3118
3124
  ...taskAccessShape,
3119
3125
  /** Per-run system-prompt override. Wins over the config default; whitespace-only is absent. */
3120
- systemPrompt: z19.string().trim().max(2e4, "must be at most 20000 characters").optional().transform((s) => s ? s : void 0),
3126
+ systemPrompt: z20.string().trim().max(2e4, "must be at most 20000 characters").optional().transform((s) => s ? s : void 0),
3121
3127
  /** Attachments pasted into the new-task form — screenshots, and since #950 PDF/TXT/MD files
3122
3128
  * too; delivered with the first agent step. The key keeps its name: the wire contract widened
3123
3129
  * in place rather than growing a second list. */
3124
- images: z19.array(attachmentInputSchema).max(4).optional()
3130
+ images: z20.array(attachmentInputSchema).max(4).optional()
3125
3131
  });
3126
3132
  var createRunInputSchema = createRunInputBaseSchema.extend({
3127
- steps: z19.array(workflowStepDefSchema.safeExtend({ skillPath: z19.string().min(1).optional() })).min(1).max(8).optional(),
3133
+ steps: z20.array(workflowStepDefSchema.safeExtend({ skillPath: z20.string().min(1).optional() })).min(1).max(8).optional(),
3128
3134
  /** Idempotent start (#504): a retry with the same id and payload answers `200` with the run
3129
3135
  * the first request created; a different payload answers `409`. Scoped to the project. Not
3130
3136
  * on the base schema, so an automation's task definition cannot carry one. */
3131
- clientRequestId: z19.string().uuid().optional(),
3137
+ clientRequestId: z20.string().uuid().optional(),
3132
3138
  /** Task webhook opt-in (#589). Absent = off. `true` on a project with no webhook is a 400.
3133
3139
  * Not on the base schema, and not part of the idempotent-start hash: it can change later. */
3134
- notify: z19.boolean().optional()
3140
+ notify: z20.boolean().optional()
3135
3141
  }).refine(
3136
3142
  (b) => Boolean(b.workflow) !== Boolean(b.steps),
3137
3143
  { message: 'provide either "workflow" or "steps", not both' }
3138
3144
  );
3139
- var messageInputSchema = z19.object({
3140
- text: z19.string().max(1e5).default(""),
3141
- images: z19.array(attachmentInputSchema).max(4).default([])
3145
+ var messageInputSchema = z20.object({
3146
+ text: z20.string().max(1e5).default(""),
3147
+ images: z20.array(attachmentInputSchema).max(4).default([])
3142
3148
  }).refine((m) => m.text.trim().length > 0 || m.images.length > 0, {
3143
3149
  message: "message needs text or at least one attachment"
3144
3150
  });
3145
- var patchRunInputSchema = z19.object({
3146
- title: z19.string().trim().min(1).max(300).optional(),
3147
- task: z19.string().trim().min(1).max(1e5).optional(),
3151
+ var patchRunInputSchema = z20.object({
3152
+ title: z20.string().trim().min(1).max(300).optional(),
3153
+ task: z20.string().trim().min(1).max(1e5).optional(),
3148
3154
  ...completionControlsShape,
3149
3155
  ...taskAccessShape
3150
3156
  });
3151
- var pinRunInputSchema = z19.object({ pinned: z19.boolean().optional() });
3152
- var notifyRunInputSchema = z19.object({
3153
- notify: z19.boolean(),
3154
- message: z19.string().trim().max(1e5).optional().transform((text) => text ? text : void 0)
3157
+ var pinRunInputSchema = z20.object({ pinned: z20.boolean().optional() });
3158
+ var notifyRunInputSchema = z20.object({
3159
+ notify: z20.boolean(),
3160
+ message: z20.string().trim().max(1e5).optional().transform((text) => text ? text : void 0)
3155
3161
  });
3156
3162
 
3157
3163
  // ../contract/src/attention.ts
@@ -3339,192 +3345,192 @@ function deriveWebhookState(run) {
3339
3345
  }
3340
3346
 
3341
3347
  // ../contract/src/repo.ts
3342
- import { z as z20 } from "zod";
3343
- var statusEntrySchema = z20.object({
3344
- status: z20.string(),
3345
- path: z20.string()
3346
- });
3347
- var logEntrySourceSchema = z20.object({
3348
- runId: z20.string(),
3349
- title: z20.string(),
3350
- prNumber: z20.number().nullable()
3351
- });
3352
- var logEntrySchema = z20.object({
3353
- hash: z20.string(),
3354
- subject: z20.string(),
3355
- author: z20.string(),
3356
- when: z20.string(),
3357
- at: z20.string(),
3348
+ import { z as z21 } from "zod";
3349
+ var statusEntrySchema = z21.object({
3350
+ status: z21.string(),
3351
+ path: z21.string()
3352
+ });
3353
+ var logEntrySourceSchema = z21.object({
3354
+ runId: z21.string(),
3355
+ title: z21.string(),
3356
+ prNumber: z21.number().nullable()
3357
+ });
3358
+ var logEntrySchema = z21.object({
3359
+ hash: z21.string(),
3360
+ subject: z21.string(),
3361
+ author: z21.string(),
3362
+ when: z21.string(),
3363
+ at: z21.string(),
3358
3364
  source: logEntrySourceSchema.optional()
3359
3365
  });
3360
- var repoTrackingSchema = z20.object({
3361
- ref: z20.string(),
3362
- ahead: z20.number(),
3363
- behind: z20.number(),
3364
- fetchedAt: z20.string().nullable()
3365
- });
3366
- var repoResponseSchema = z20.union([
3367
- z20.object({
3368
- info: z20.null(),
3369
- status: z20.array(z20.never()),
3370
- log: z20.array(z20.never()),
3371
- branches: z20.array(z20.never()),
3372
- baseBranch: z20.null(),
3373
- tracking: z20.null()
3366
+ var repoTrackingSchema = z21.object({
3367
+ ref: z21.string(),
3368
+ ahead: z21.number(),
3369
+ behind: z21.number(),
3370
+ fetchedAt: z21.string().nullable()
3371
+ });
3372
+ var repoResponseSchema = z21.union([
3373
+ z21.object({
3374
+ info: z21.null(),
3375
+ status: z21.array(z21.never()),
3376
+ log: z21.array(z21.never()),
3377
+ branches: z21.array(z21.never()),
3378
+ baseBranch: z21.null(),
3379
+ tracking: z21.null()
3374
3380
  }),
3375
- z20.object({
3381
+ z21.object({
3376
3382
  info: repoInfoSchema,
3377
- status: z20.array(statusEntrySchema),
3378
- log: z20.array(logEntrySchema),
3379
- branches: z20.array(z20.string()),
3380
- baseBranch: z20.string().nullable(),
3383
+ status: z21.array(statusEntrySchema),
3384
+ log: z21.array(logEntrySchema),
3385
+ branches: z21.array(z21.string()),
3386
+ baseBranch: z21.string().nullable(),
3381
3387
  tracking: repoTrackingSchema.nullable()
3382
3388
  })
3383
3389
  ]);
3384
- var repoBranchResponseSchema = z20.object({
3385
- branch: z20.string(),
3386
- created: z20.boolean()
3390
+ var repoBranchResponseSchema = z21.object({
3391
+ branch: z21.string(),
3392
+ created: z21.boolean()
3387
3393
  });
3388
- var branchClassSchema = z20.enum(["active", "not-landed", "orphan", "merged", "empty", "other"]);
3389
- var branchPrStateSchema = z20.enum(["open", "draft", "merged", "closed"]);
3390
- var repoBranchEntrySchema = z20.object({
3391
- name: z20.string(),
3394
+ var branchClassSchema = z21.enum(["active", "not-landed", "orphan", "merged", "empty", "other"]);
3395
+ var branchPrStateSchema = z21.enum(["open", "draft", "merged", "closed"]);
3396
+ var repoBranchEntrySchema = z21.object({
3397
+ name: z21.string(),
3392
3398
  class: branchClassSchema,
3393
- runId: z20.string().nullable(),
3394
- title: z20.string().nullable(),
3399
+ runId: z21.string().nullable(),
3400
+ title: z21.string().nullable(),
3395
3401
  runStatus: runStatusSchema.nullable(),
3396
3402
  /** Commits on the branch that are not reachable from the base. */
3397
- ahead: z20.number(),
3398
- lastCommit: z20.object({ sha: z20.string(), subject: z20.string(), at: z20.string() }),
3403
+ ahead: z21.number(),
3404
+ lastCommit: z21.object({ sha: z21.string(), subject: z21.string(), at: z21.string() }),
3399
3405
  /** `--shortstat <base>...<branch>`, for `not-landed` and `orphan` rows only. */
3400
- diffStat: z20.object({ additions: z20.number(), deletions: z20.number() }).nullable(),
3401
- pr: z20.object({ number: z20.number(), url: z20.string(), state: branchPrStateSchema }).nullable(),
3406
+ diffStat: z21.object({ additions: z21.number(), deletions: z21.number() }).nullable(),
3407
+ pr: z21.object({ number: z21.number(), url: z21.string(), state: branchPrStateSchema }).nullable(),
3402
3408
  /** Why a branch that might be merged is kept: present only when GitHub did not return its full
3403
3409
  * PR history, so no merged PR could be ruled in. */
3404
- keptReason: z20.string().optional(),
3410
+ keptReason: z21.string().optional(),
3405
3411
  /** The parent task of a worker's branch (hearsay-tools/squawk#911). Absent for any other run. */
3406
- parentRunId: z20.string().optional()
3407
- });
3408
- var repoBranchesResponseSchema = z20.object({
3409
- base: z20.string(),
3410
- prStateKnown: z20.boolean(),
3411
- branches: z20.array(repoBranchEntrySchema),
3412
- counts: z20.object({ notLanded: z20.number(), cleanup: z20.number() })
3413
- });
3414
- var repoBranchCountsResponseSchema = repoBranchesResponseSchema.pick({ base: true, prStateKnown: true, counts: true }).extend({ allBranches: z20.number() });
3415
- var deleteBranchesInputSchema = z20.object({
3416
- names: z20.array(z20.string().trim().min(1).max(250)).min(1).max(500),
3417
- confirm: z20.string().optional()
3418
- });
3419
- var branchRefusalSchema = z20.object({ name: z20.string(), reason: z20.string() });
3420
- var deleteBranchesResponseSchema = z20.object({
3421
- deleted: z20.array(z20.string()),
3422
- refused: z20.array(branchRefusalSchema),
3423
- dropped: z20.array(z20.object({ sha: z20.string(), subject: z20.string() })).optional()
3424
- });
3425
- var deleteBranchesErrorSchema = z20.object({
3426
- error: z20.string(),
3427
- refused: z20.array(branchRefusalSchema)
3428
- });
3429
- var repoPullBranchesResponseSchema = z20.object({ branches: z20.array(z20.string()) });
3430
- var repoPullInputSchema = z20.object({
3431
- branch: z20.string().trim().min(1).max(200).optional(),
3432
- confirm: z20.boolean().optional()
3433
- });
3434
- var repoPullResponseSchema = z20.object({
3435
- branch: z20.string(),
3436
- pulled: z20.literal(true),
3437
- summary: z20.string()
3438
- });
3439
- var repoPullConfirmationSchema = z20.object({
3440
- error: z20.string(),
3441
- branch: z20.string(),
3442
- risks: z20.array(z20.enum(["active_runs", "dirty_tree"]))
3443
- });
3444
- var repoPullErrorSchema = z20.union([
3412
+ parentRunId: z21.string().optional()
3413
+ });
3414
+ var repoBranchesResponseSchema = z21.object({
3415
+ base: z21.string(),
3416
+ prStateKnown: z21.boolean(),
3417
+ branches: z21.array(repoBranchEntrySchema),
3418
+ counts: z21.object({ notLanded: z21.number(), cleanup: z21.number() })
3419
+ });
3420
+ var repoBranchCountsResponseSchema = repoBranchesResponseSchema.pick({ base: true, prStateKnown: true, counts: true }).extend({ allBranches: z21.number() });
3421
+ var deleteBranchesInputSchema = z21.object({
3422
+ names: z21.array(z21.string().trim().min(1).max(250)).min(1).max(500),
3423
+ confirm: z21.string().optional()
3424
+ });
3425
+ var branchRefusalSchema = z21.object({ name: z21.string(), reason: z21.string() });
3426
+ var deleteBranchesResponseSchema = z21.object({
3427
+ deleted: z21.array(z21.string()),
3428
+ refused: z21.array(branchRefusalSchema),
3429
+ dropped: z21.array(z21.object({ sha: z21.string(), subject: z21.string() })).optional()
3430
+ });
3431
+ var deleteBranchesErrorSchema = z21.object({
3432
+ error: z21.string(),
3433
+ refused: z21.array(branchRefusalSchema)
3434
+ });
3435
+ var repoPullBranchesResponseSchema = z21.object({ branches: z21.array(z21.string()) });
3436
+ var repoPullInputSchema = z21.object({
3437
+ branch: z21.string().trim().min(1).max(200).optional(),
3438
+ confirm: z21.boolean().optional()
3439
+ });
3440
+ var repoPullResponseSchema = z21.object({
3441
+ branch: z21.string(),
3442
+ pulled: z21.literal(true),
3443
+ summary: z21.string()
3444
+ });
3445
+ var repoPullConfirmationSchema = z21.object({
3446
+ error: z21.string(),
3447
+ branch: z21.string(),
3448
+ risks: z21.array(z21.enum(["active_runs", "dirty_tree"]))
3449
+ });
3450
+ var repoPullErrorSchema = z21.union([
3445
3451
  repoPullConfirmationSchema,
3446
- z20.object({ error: z20.string() })
3452
+ z21.object({ error: z21.string() })
3447
3453
  ]);
3448
- var diffStatSchema2 = z20.object({
3449
- adds: z20.number(),
3450
- dels: z20.number(),
3451
- files: z20.number()
3454
+ var diffStatSchema2 = z21.object({
3455
+ adds: z21.number(),
3456
+ dels: z21.number(),
3457
+ files: z21.number()
3452
3458
  });
3453
- var changedFileSchema = z20.object({
3454
- path: z20.string(),
3459
+ var changedFileSchema = z21.object({
3460
+ path: z21.string(),
3455
3461
  /** Rename/copy source — present only when `status` is renamed/copied. */
3456
- oldPath: z20.string().optional(),
3457
- status: z20.enum(["added", "modified", "deleted", "renamed", "copied"]),
3458
- adds: z20.number(),
3459
- dels: z20.number(),
3462
+ oldPath: z21.string().optional(),
3463
+ status: z21.enum(["added", "modified", "deleted", "renamed", "copied"]),
3464
+ adds: z21.number(),
3465
+ dels: z21.number(),
3460
3466
  /** Binary per numstat — there is no text patch to render. */
3461
- binary: z20.boolean(),
3467
+ binary: z21.boolean(),
3462
3468
  /** True when the path is one the raw-bytes route serves as an `<img>` (#365) — present only
3463
3469
  * when true, so old clients that never read it stay correct. */
3464
- image: z20.boolean().optional(),
3470
+ image: z21.boolean().optional(),
3465
3471
  /** This file's unified-diff section; possibly `… (patch truncated)`, possibly empty. */
3466
- patch: z20.string()
3472
+ patch: z21.string()
3467
3473
  });
3468
- var changesPayloadSchema = z20.object({
3469
- files: z20.array(changedFileSchema),
3474
+ var changesPayloadSchema = z21.object({
3475
+ files: z21.array(changedFileSchema),
3470
3476
  stat: diffStatSchema2,
3471
3477
  /** Additive context for review tasks whose worktree HEAD no longer matches their own branch. */
3472
- repointedHead: z20.object({ headBranch: z20.string(), taskBranch: z20.string() }).optional()
3478
+ repointedHead: z21.object({ headBranch: z21.string(), taskBranch: z21.string() }).optional()
3473
3479
  });
3474
- var repoCommitPayloadSchema = z20.object({
3475
- sha: z20.string(),
3476
- subject: z20.string(),
3477
- author: z20.string(),
3480
+ var repoCommitPayloadSchema = z21.object({
3481
+ sha: z21.string(),
3482
+ subject: z21.string(),
3483
+ author: z21.string(),
3478
3484
  /** Relative time ("3 hours ago") — same `%cr` format as the /api/v1/repo log. */
3479
- when: z20.string(),
3480
- files: z20.array(changedFileSchema),
3485
+ when: z21.string(),
3486
+ files: z21.array(changedFileSchema),
3481
3487
  stat: diffStatSchema2
3482
3488
  });
3483
- var worktreeDirEntrySchema = z20.object({
3484
- name: z20.string(),
3485
- type: z20.enum(["dir", "file"]),
3486
- size: z20.number().optional()
3487
- });
3488
- var worktreeEntrySchema = z20.discriminatedUnion("type", [
3489
- z20.object({
3490
- type: z20.literal("dir"),
3491
- path: z20.string(),
3492
- entries: z20.array(worktreeDirEntrySchema)
3489
+ var worktreeDirEntrySchema = z21.object({
3490
+ name: z21.string(),
3491
+ type: z21.enum(["dir", "file"]),
3492
+ size: z21.number().optional()
3493
+ });
3494
+ var worktreeEntrySchema = z21.discriminatedUnion("type", [
3495
+ z21.object({
3496
+ type: z21.literal("dir"),
3497
+ path: z21.string(),
3498
+ entries: z21.array(worktreeDirEntrySchema)
3493
3499
  }),
3494
- z20.object({
3495
- type: z20.literal("file"),
3496
- path: z20.string(),
3497
- size: z20.number(),
3498
- binary: z20.boolean(),
3499
- tooLarge: z20.boolean(),
3500
- content: z20.string().optional()
3500
+ z21.object({
3501
+ type: z21.literal("file"),
3502
+ path: z21.string(),
3503
+ size: z21.number(),
3504
+ binary: z21.boolean(),
3505
+ tooLarge: z21.boolean(),
3506
+ content: z21.string().optional()
3501
3507
  })
3502
3508
  ]);
3503
- var worktreeInfoSchema = z20.object({
3504
- runId: z20.string(),
3505
- title: z20.string(),
3509
+ var worktreeInfoSchema = z21.object({
3510
+ runId: z21.string(),
3511
+ title: z21.string(),
3506
3512
  status: runStatusSchema,
3507
- branch: z20.string().nullable(),
3508
- sizeBytes: z20.number().nullable(),
3509
- finishedAt: z20.string().nullable(),
3510
- reclaimable: z20.boolean(),
3511
- pastKeep: z20.boolean()
3513
+ branch: z21.string().nullable(),
3514
+ sizeBytes: z21.number().nullable(),
3515
+ finishedAt: z21.string().nullable(),
3516
+ reclaimable: z21.boolean(),
3517
+ pastKeep: z21.boolean()
3512
3518
  });
3513
- var worktreesResponseSchema = z20.object({
3514
- worktrees: z20.array(worktreeInfoSchema),
3515
- totalBytes: z20.number().nullable(),
3516
- keep: z20.number()
3519
+ var worktreesResponseSchema = z21.object({
3520
+ worktrees: z21.array(worktreeInfoSchema),
3521
+ totalBytes: z21.number().nullable(),
3522
+ keep: z21.number()
3517
3523
  });
3518
- var reclaimWorktreeResponseSchema = z20.object({
3519
- runId: z20.string(),
3520
- worktreeReclaimedAt: z20.string()
3524
+ var reclaimWorktreeResponseSchema = z21.object({
3525
+ runId: z21.string(),
3526
+ worktreeReclaimedAt: z21.string()
3521
3527
  });
3522
- var reclaimWorktreesResponseSchema = z20.object({
3523
- reclaimed: z20.array(z20.string())
3528
+ var reclaimWorktreesResponseSchema = z21.object({
3529
+ reclaimed: z21.array(z21.string())
3524
3530
  });
3525
3531
 
3526
3532
  // ../contract/src/projects.ts
3527
- import { z as z21 } from "zod";
3533
+ import { z as z22 } from "zod";
3528
3534
 
3529
3535
  // ../contract/src/project-limits.ts
3530
3536
  var PROJECT_TAG_MAX_LENGTH = 32;
@@ -3541,32 +3547,32 @@ var AGENT_REPORT_TITLE_MAX_LENGTH = 200;
3541
3547
  var AGENT_REPORT_MESSAGE_MAX_LENGTH = 64 * 1024;
3542
3548
 
3543
3549
  // ../contract/src/projects.ts
3544
- var webhookTriggerSchema = z21.enum(WEBHOOK_TRIGGERS);
3545
- var projectWebhookSchema = z21.object({
3546
- id: z21.string(),
3547
- name: z21.string(),
3548
- description: z21.string().optional(),
3549
- url: z21.string(),
3550
- tokenSet: z21.boolean(),
3551
- tasks: z21.boolean(),
3552
- triggers: z21.array(webhookTriggerSchema).optional(),
3553
- agent: z21.boolean()
3554
- });
3555
- var projectListEntrySchema = z21.object({
3556
- id: z21.string(),
3557
- name: z21.string(),
3550
+ var webhookTriggerSchema = z22.enum(WEBHOOK_TRIGGERS);
3551
+ var projectWebhookSchema = z22.object({
3552
+ id: z22.string(),
3553
+ name: z22.string(),
3554
+ description: z22.string().optional(),
3555
+ url: z22.string(),
3556
+ tokenSet: z22.boolean(),
3557
+ tasks: z22.boolean(),
3558
+ triggers: z22.array(webhookTriggerSchema).optional(),
3559
+ agent: z22.boolean()
3560
+ });
3561
+ var projectListEntrySchema = z22.object({
3562
+ id: z22.string(),
3563
+ name: z22.string(),
3558
3564
  /** Absolute, realpath-normalized repo root. */
3559
- root: z21.string(),
3560
- addedAt: z21.string(),
3561
- lastOpenedAt: z21.string(),
3562
- source: z21.enum(["local", "checkout"]),
3565
+ root: z22.string(),
3566
+ addedAt: z22.string(),
3567
+ lastOpenedAt: z22.string(),
3568
+ source: z22.enum(["local", "checkout"]),
3563
3569
  /** `not-git` is fully usable (degraded single-queue mode); only `missing` blocks. */
3564
- status: z21.enum(["ok", "missing", "not-git"]),
3570
+ status: z22.enum(["ok", "missing", "not-git"]),
3565
3571
  /** Current branch when cheaply available (omitted e.g. on an unborn HEAD). */
3566
- branch: z21.string().optional(),
3572
+ branch: z22.string().optional(),
3567
3573
  /** Which forge this project's remote belongs to (#698) — classified server-side from the
3568
3574
  * remote URL alone. Gates the project group's GitHub nav item; omitted = no forge remote. */
3569
- forge: z21.literal("github").optional(),
3575
+ forge: z22.literal("github").optional(),
3570
3576
  /**
3571
3577
  * The remote's web root, `https://github.com/owner/repo`. Rebuilt server-side from the parsed
3572
3578
  * remote rather than passed through, so a remote carrying credentials cannot leak into the
@@ -3576,10 +3582,10 @@ var projectListEntrySchema = z21.object({
3576
3582
  * the global Tasks page has one row per project, so it cannot use any single repo's base the
3577
3583
  * way a project-scoped view can. With this, every reference it shows is a link.
3578
3584
  */
3579
- repoUrl: z21.string().optional(),
3585
+ repoUrl: z22.string().optional(),
3580
3586
  /** Per-project cap on concurrently running tasks (spec 2026-07-22). Omitted = inherit the
3581
3587
  * workspace `resources.maxParallel`; a number pins this project. */
3582
- maxParallel: z21.number().optional(),
3588
+ maxParallel: z22.number().optional(),
3583
3589
  /**
3584
3590
  * Free-form labels grouping CONNECTED repositories — a `storefront` tag on the API, the web
3585
3591
  * app and the design system says those three are one piece of work spread over three repos.
@@ -3591,105 +3597,105 @@ var projectListEntrySchema = z21.object({
3591
3597
  * server-side (trimmed, deduped case-insensitively, sorted), so a consumer may compare them
3592
3598
  * directly.
3593
3599
  */
3594
- tags: z21.array(z21.string()).optional(),
3600
+ tags: z22.array(z22.string()).optional(),
3595
3601
  /** The task webhook (#589). The token is write-only: the wire says only whether one is set.
3596
3602
  * `triggers` is the stored state selection (hearsay-tools/cezarion#1356); absent means
3597
3603
  * `DEFAULT_WEBHOOK_TRIGGERS`, and `[]` means no state sends. */
3598
- webhook: z21.object({ url: z21.string(), tokenSet: z21.boolean(), triggers: z21.array(webhookTriggerSchema).optional() }).optional(),
3604
+ webhook: z22.object({ url: z22.string(), tokenSet: z22.boolean(), triggers: z22.array(webhookTriggerSchema).optional() }).optional(),
3599
3605
  /** Every project webhook, in the order they were added (hearsay-tools/cezarion#1576). Omitted
3600
3606
  * when the project has none. `webhook` above stays the first one with task notifications on,
3601
3607
  * for clients that know one webhook only. */
3602
- webhooks: z21.array(projectWebhookSchema).optional()
3608
+ webhooks: z22.array(projectWebhookSchema).optional()
3603
3609
  });
3604
- var projectsResponseSchema = z21.object({
3605
- projects: z21.array(projectListEntrySchema),
3606
- bootProject: z21.string(),
3607
- projectsDir: z21.string()
3610
+ var projectsResponseSchema = z22.object({
3611
+ projects: z22.array(projectListEntrySchema),
3612
+ bootProject: z22.string(),
3613
+ projectsDir: z22.string()
3608
3614
  });
3609
- var registerProjectResponseSchema = z21.object({
3615
+ var registerProjectResponseSchema = z22.object({
3610
3616
  project: projectListEntrySchema,
3611
- error: z21.string().optional()
3617
+ error: z22.string().optional()
3612
3618
  });
3613
- var removeProjectResponseSchema = z21.object({
3614
- removed: z21.literal(true),
3615
- id: z21.string()
3619
+ var removeProjectResponseSchema = z22.object({
3620
+ removed: z22.literal(true),
3621
+ id: z22.string()
3616
3622
  });
3617
- var updateProjectResponseSchema = z21.object({
3623
+ var updateProjectResponseSchema = z22.object({
3618
3624
  project: projectListEntrySchema
3619
3625
  });
3620
- var projectWebhookUrlSchema = z21.string().trim().max(PROJECT_WEBHOOK_URL_MAX_LENGTH).pipe(z21.url({ protocol: /^https?$/, error: "webhook url must be an http(s) URL" })).refine((value) => !/^https?:\/\/[^/?#]*@/i.test(value), "webhook url must not contain credentials; put the secret in the token");
3621
- var projectWebhookInputSchema = z21.object({
3626
+ var projectWebhookUrlSchema = z22.string().trim().max(PROJECT_WEBHOOK_URL_MAX_LENGTH).pipe(z22.url({ protocol: /^https?$/, error: "webhook url must be an http(s) URL" })).refine((value) => !/^https?:\/\/[^/?#]*@/i.test(value), "webhook url must not contain credentials; put the secret in the token");
3627
+ var projectWebhookInputSchema = z22.object({
3622
3628
  url: projectWebhookUrlSchema,
3623
- token: z21.string().trim().max(PROJECT_WEBHOOK_TOKEN_MAX_LENGTH).optional(),
3629
+ token: z22.string().trim().max(PROJECT_WEBHOOK_TOKEN_MAX_LENGTH).optional(),
3624
3630
  /** The states that send a delivery (hearsay-tools/cezarion#1356). Omitted keeps the stored
3625
3631
  * selection; `[]` stores "none". Each value at most once. */
3626
- triggers: z21.array(webhookTriggerSchema).refine((values) => new Set(values).size === values.length, "webhook triggers must not repeat").optional()
3632
+ triggers: z22.array(webhookTriggerSchema).refine((values) => new Set(values).size === values.length, "webhook triggers must not repeat").optional()
3627
3633
  });
3628
- var webhookTriggersInputSchema = z21.array(webhookTriggerSchema).refine((values) => new Set(values).size === values.length, "webhook triggers must not repeat");
3629
- var projectWebhookNameSchema = z21.string().trim().min(1, "webhook name is required").max(PROJECT_WEBHOOK_NAME_MAX_LENGTH);
3630
- var projectWebhookDescriptionSchema = z21.string().trim().max(PROJECT_WEBHOOK_DESCRIPTION_MAX_LENGTH);
3631
- var projectWebhookTokenSchema = z21.string().trim().max(PROJECT_WEBHOOK_TOKEN_MAX_LENGTH);
3632
- var createProjectWebhookInputSchema = z21.object({
3634
+ var webhookTriggersInputSchema = z22.array(webhookTriggerSchema).refine((values) => new Set(values).size === values.length, "webhook triggers must not repeat");
3635
+ var projectWebhookNameSchema = z22.string().trim().min(1, "webhook name is required").max(PROJECT_WEBHOOK_NAME_MAX_LENGTH);
3636
+ var projectWebhookDescriptionSchema = z22.string().trim().max(PROJECT_WEBHOOK_DESCRIPTION_MAX_LENGTH);
3637
+ var projectWebhookTokenSchema = z22.string().trim().max(PROJECT_WEBHOOK_TOKEN_MAX_LENGTH);
3638
+ var createProjectWebhookInputSchema = z22.object({
3633
3639
  name: projectWebhookNameSchema,
3634
3640
  description: projectWebhookDescriptionSchema.optional(),
3635
3641
  url: projectWebhookUrlSchema,
3636
3642
  token: projectWebhookTokenSchema.optional(),
3637
- tasks: z21.boolean().optional(),
3643
+ tasks: z22.boolean().optional(),
3638
3644
  triggers: webhookTriggersInputSchema.optional(),
3639
- agent: z21.boolean().optional()
3645
+ agent: z22.boolean().optional()
3640
3646
  });
3641
- var updateProjectWebhookInputSchema = z21.object({
3647
+ var updateProjectWebhookInputSchema = z22.object({
3642
3648
  name: projectWebhookNameSchema.optional(),
3643
3649
  description: projectWebhookDescriptionSchema.optional(),
3644
3650
  url: projectWebhookUrlSchema.optional(),
3645
3651
  token: projectWebhookTokenSchema.optional(),
3646
- tasks: z21.boolean().optional(),
3652
+ tasks: z22.boolean().optional(),
3647
3653
  triggers: webhookTriggersInputSchema.optional(),
3648
- agent: z21.boolean().optional()
3654
+ agent: z22.boolean().optional()
3649
3655
  }).refine((body) => Object.values(body).some((value) => value !== void 0), "specify at least one webhook field");
3650
- var projectWebhookParamsSchema = z21.object({
3651
- projectId: z21.string(),
3652
- webhookId: z21.string().regex(PROJECT_WEBHOOK_ID_PATTERN, "unknown webhook")
3656
+ var projectWebhookParamsSchema = z22.object({
3657
+ projectId: z22.string(),
3658
+ webhookId: z22.string().regex(PROJECT_WEBHOOK_ID_PATTERN, "unknown webhook")
3653
3659
  });
3654
- var projectWebhookResponseSchema = z21.object({
3660
+ var projectWebhookResponseSchema = z22.object({
3655
3661
  project: projectListEntrySchema,
3656
3662
  webhook: projectWebhookSchema
3657
3663
  });
3658
- var agentWebhookSchema = z21.object({
3659
- id: z21.string(),
3660
- name: z21.string(),
3661
- description: z21.string().optional()
3664
+ var agentWebhookSchema = z22.object({
3665
+ id: z22.string(),
3666
+ name: z22.string(),
3667
+ description: z22.string().optional()
3662
3668
  });
3663
- var agentWebhooksResponseSchema = z21.object({ webhooks: z21.array(agentWebhookSchema) });
3664
- var agentWebhookParamsSchema = z21.object({
3665
- projectId: z21.string(),
3669
+ var agentWebhooksResponseSchema = z22.object({ webhooks: z22.array(agentWebhookSchema) });
3670
+ var agentWebhookParamsSchema = z22.object({
3671
+ projectId: z22.string(),
3666
3672
  /** The webhook's id, or its name (case-insensitive). */
3667
- webhook: z21.string().min(1).max(PROJECT_WEBHOOK_NAME_MAX_LENGTH)
3673
+ webhook: z22.string().min(1).max(PROJECT_WEBHOOK_NAME_MAX_LENGTH)
3668
3674
  });
3669
- var sendAgentReportInputSchema = z21.object({
3670
- runId: z21.string().min(1).max(128).optional(),
3671
- title: z21.string().trim().min(1).max(AGENT_REPORT_TITLE_MAX_LENGTH).optional(),
3672
- message: z21.string().trim().min(1, "message is required").max(AGENT_REPORT_MESSAGE_MAX_LENGTH),
3673
- data: z21.record(z21.string(), z21.unknown()).optional()
3675
+ var sendAgentReportInputSchema = z22.object({
3676
+ runId: z22.string().min(1).max(128).optional(),
3677
+ title: z22.string().trim().min(1).max(AGENT_REPORT_TITLE_MAX_LENGTH).optional(),
3678
+ message: z22.string().trim().min(1, "message is required").max(AGENT_REPORT_MESSAGE_MAX_LENGTH),
3679
+ data: z22.record(z22.string(), z22.unknown()).optional()
3674
3680
  });
3675
- var sendAgentReportResponseSchema = z21.object({
3676
- ok: z21.boolean(),
3681
+ var sendAgentReportResponseSchema = z22.object({
3682
+ ok: z22.boolean(),
3677
3683
  webhook: agentWebhookSchema.pick({ id: true, name: true }),
3678
- deliveryId: z21.string(),
3679
- attempts: z21.number(),
3680
- status: z21.number().optional(),
3681
- error: z21.string().optional(),
3682
- dryRun: z21.boolean().optional()
3683
- });
3684
- var testProjectWebhookResponseSchema = z21.object({
3685
- ok: z21.boolean(),
3686
- status: z21.number().optional(),
3687
- error: z21.string().optional(),
3688
- dryRun: z21.boolean().optional()
3689
- });
3690
- var updateProjectInputSchema = z21.object({
3691
- maxParallel: z21.number().int().min(1).max(16).nullable().optional(),
3692
- tags: z21.array(z21.string().trim().min(1).max(PROJECT_TAG_MAX_LENGTH)).max(PROJECT_TAGS_MAX).nullable().optional(),
3684
+ deliveryId: z22.string(),
3685
+ attempts: z22.number(),
3686
+ status: z22.number().optional(),
3687
+ error: z22.string().optional(),
3688
+ dryRun: z22.boolean().optional()
3689
+ });
3690
+ var testProjectWebhookResponseSchema = z22.object({
3691
+ ok: z22.boolean(),
3692
+ status: z22.number().optional(),
3693
+ error: z22.string().optional(),
3694
+ dryRun: z22.boolean().optional()
3695
+ });
3696
+ var updateProjectInputSchema = z22.object({
3697
+ maxParallel: z22.number().int().min(1).max(16).nullable().optional(),
3698
+ tags: z22.array(z22.string().trim().min(1).max(PROJECT_TAG_MAX_LENGTH)).max(PROJECT_TAGS_MAX).nullable().optional(),
3693
3699
  /**
3694
3700
  * The task webhook (#589). `null` removes it. An omitted `token` keeps the stored one, so the
3695
3701
  * settings form can change the URL without asking for a secret it never shows again; `''`
@@ -3700,158 +3706,158 @@ var updateProjectInputSchema = z21.object({
3700
3706
  (body) => body.maxParallel !== void 0 || body.tags !== void 0 || body.webhook !== void 0,
3701
3707
  "specify maxParallel, tags or webhook"
3702
3708
  );
3703
- var checkoutProjectInputSchema = z21.object({
3704
- url: z21.string().trim().min(1).max(512),
3705
- name: z21.string().trim().max(128).optional(),
3706
- checkoutId: z21.string().trim().max(128).optional()
3707
- });
3708
- var createProjectInputSchema = z21.object({
3709
- name: z21.string().trim().regex(PROJECT_NAME_PATTERN),
3710
- github: z21.object({
3711
- owner: z21.string().trim().min(1).max(64),
3712
- template: z21.string().trim().max(512).optional()
3709
+ var checkoutProjectInputSchema = z22.object({
3710
+ url: z22.string().trim().min(1).max(512),
3711
+ name: z22.string().trim().max(128).optional(),
3712
+ checkoutId: z22.string().trim().max(128).optional()
3713
+ });
3714
+ var createProjectInputSchema = z22.object({
3715
+ name: z22.string().trim().regex(PROJECT_NAME_PATTERN),
3716
+ github: z22.object({
3717
+ owner: z22.string().trim().min(1).max(64),
3718
+ template: z22.string().trim().max(512).optional()
3713
3719
  }).optional(),
3714
- checkoutId: z21.string().trim().max(128).optional()
3720
+ checkoutId: z22.string().trim().max(128).optional()
3715
3721
  });
3716
3722
  var createProjectResponseSchema = registerProjectResponseSchema.extend({
3717
- warning: z21.string().optional()
3723
+ warning: z22.string().optional()
3718
3724
  });
3719
- var githubOwnerSchema = z21.object({
3720
- login: z21.string(),
3721
- personal: z21.boolean(),
3722
- avatarUrl: z21.string().optional(),
3723
- description: z21.string().optional()
3725
+ var githubOwnerSchema = z22.object({
3726
+ login: z22.string(),
3727
+ personal: z22.boolean(),
3728
+ avatarUrl: z22.string().optional(),
3729
+ description: z22.string().optional()
3724
3730
  });
3725
- var githubOwnersResponseSchema = z21.discriminatedUnion("available", [
3726
- z21.object({ available: z21.literal(true), owners: z21.array(githubOwnerSchema) }),
3727
- z21.object({ available: z21.literal(false), reason: z21.string() })
3731
+ var githubOwnersResponseSchema = z22.discriminatedUnion("available", [
3732
+ z22.object({ available: z22.literal(true), owners: z22.array(githubOwnerSchema) }),
3733
+ z22.object({ available: z22.literal(false), reason: z22.string() })
3728
3734
  ]);
3729
- var fsBrowseDirSchema = z21.object({
3730
- name: z21.string(),
3731
- path: z21.string(),
3735
+ var fsBrowseDirSchema = z22.object({
3736
+ name: z22.string(),
3737
+ path: z22.string(),
3732
3738
  /** Has a `.git` entry — drives the "git" badge. A non-repo folder is still selectable. */
3733
- isRepo: z21.boolean()
3739
+ isRepo: z22.boolean()
3734
3740
  });
3735
- var fsBrowseResponseSchema = z21.object({
3741
+ var fsBrowseResponseSchema = z22.object({
3736
3742
  /** The realpath'd directory actually listed — never the spelling asked for, so the breadcrumb
3737
3743
  * shows where the picker really is. */
3738
- path: z21.string(),
3744
+ path: z22.string(),
3739
3745
  /** `null` AT the browse root: there is no "up" out of it, and the dialog must render no parent
3740
3746
  * row rather than one that 400s. */
3741
- parent: z21.string().nullable(),
3742
- dirs: z21.array(fsBrowseDirSchema),
3747
+ parent: z22.string().nullable(),
3748
+ dirs: z22.array(fsBrowseDirSchema),
3743
3749
  /** True when the listing was capped server-side — surfaced honestly instead of showing a
3744
3750
  * silently short list. */
3745
- truncated: z21.boolean()
3751
+ truncated: z22.boolean()
3746
3752
  });
3747
- var checkoutProgressParamsSchema = z21.object({ checkoutId: z21.string().min(1).max(128) });
3748
- var checkoutProgressResponseSchema = z21.object({ progress: checkoutProgressEventSchema.nullable() });
3749
- var registerProjectInputSchema = z21.object({
3750
- root: z21.string().trim().min(1).max(4096)
3753
+ var checkoutProgressParamsSchema = z22.object({ checkoutId: z22.string().min(1).max(128) });
3754
+ var checkoutProgressResponseSchema = z22.object({ progress: checkoutProgressEventSchema.nullable() });
3755
+ var registerProjectInputSchema = z22.object({
3756
+ root: z22.string().trim().min(1).max(4096)
3751
3757
  });
3752
3758
 
3753
3759
  // ../contract/src/skills.ts
3754
- import { z as z22 } from "zod";
3755
- var skillSchema = z22.object({
3756
- name: z22.string(),
3757
- description: z22.string().optional(),
3758
- body: z22.string(),
3759
- path: z22.string(),
3760
+ import { z as z23 } from "zod";
3761
+ var skillSchema = z23.object({
3762
+ name: z23.string(),
3763
+ description: z23.string().optional(),
3764
+ body: z23.string(),
3765
+ path: z23.string(),
3760
3766
  /** `builtin`: shipped by Squawk itself and listed last (#774), so a repo skill of the same name wins. */
3761
- source: z22.enum(["ai", "cezar", "agents", "global", "team", "builtin"]),
3767
+ source: z23.enum(["ai", "cezar", "agents", "global", "team", "builtin"]),
3762
3768
  /** Team skills only: where the definition lives in its skills repo. */
3763
- team: z22.object({
3764
- repo: z22.string(),
3765
- ref: z22.string(),
3766
- path: z22.string(),
3769
+ team: z23.object({
3770
+ repo: z23.string(),
3771
+ ref: z23.string(),
3772
+ path: z23.string(),
3767
3773
  /** True for the `SKILL.md` convention — a whole directory (references/…). */
3768
- dir: z22.boolean(),
3774
+ dir: z23.boolean(),
3769
3775
  /**
3770
3776
  * The exact commit `ref` resolved to when the skill was read (#428).
3771
3777
  *
3772
3778
  * The hand-written DTO omitted this field entirely — it was NARROWER than the route,
3773
3779
  * which has served it since #428.
3774
3780
  */
3775
- commit: z22.string().optional()
3781
+ commit: z23.string().optional()
3776
3782
  }).optional()
3777
3783
  });
3778
3784
 
3779
3785
  // ../contract/src/agent-config.ts
3780
- import { z as z23 } from "zod";
3781
- var agentConfigFormatSchema = z23.enum(["json", "jsonc", "toml", "yaml", "markdown"]);
3782
- var agentConfigScopeSchema = z23.enum(["user", "project", "local"]);
3783
- var agentConfigKindSchema = z23.enum(["settings", "memory", "mcp"]);
3784
- var agentConfigTrackedSchema = z23.enum(["tracked", "gitignored", "outside-repo"]);
3785
- var agentConfigFileSchema = z23.object({
3786
+ import { z as z24 } from "zod";
3787
+ var agentConfigFormatSchema = z24.enum(["json", "jsonc", "toml", "yaml", "markdown"]);
3788
+ var agentConfigScopeSchema = z24.enum(["user", "project", "local"]);
3789
+ var agentConfigKindSchema = z24.enum(["settings", "memory", "mcp"]);
3790
+ var agentConfigTrackedSchema = z24.enum(["tracked", "gitignored", "outside-repo"]);
3791
+ var agentConfigFileSchema = z24.object({
3786
3792
  /** Stable, opaque, URL-safe — the ONLY thing a client may name (traversal-proof). */
3787
- id: z23.string(),
3793
+ id: z24.string(),
3788
3794
  /** Every runner that reads this file: `<repo>/AGENTS.md` is one file, two readers. */
3789
- runners: z23.array(runnerSchema),
3795
+ runners: z24.array(runnerSchema),
3790
3796
  kind: agentConfigKindSchema,
3791
3797
  scope: agentConfigScopeSchema,
3792
- label: z23.string(),
3793
- path: z23.string(),
3798
+ label: z24.string(),
3799
+ path: z24.string(),
3794
3800
  format: agentConfigFormatSchema,
3795
3801
  tracked: agentConfigTrackedSchema,
3796
- seeded: z23.boolean(),
3797
- holdsMcp: z23.boolean(),
3802
+ seeded: z24.boolean(),
3803
+ holdsMcp: z24.boolean(),
3798
3804
  /** VERBATIM from the vendor docs. Never computed, never generic. */
3799
- precedence: z23.string(),
3805
+ precedence: z24.string(),
3800
3806
  /** Documented mid-run reload behaviour, or absent when the vendor is silent. */
3801
- hotReload: z23.string().optional(),
3802
- docsUrl: z23.string(),
3803
- exists: z23.boolean(),
3804
- size: z23.number(),
3807
+ hotReload: z24.string().optional(),
3808
+ docsUrl: z24.string(),
3809
+ exists: z24.boolean(),
3810
+ size: z24.number(),
3805
3811
  /** sha256 of the bytes, or null when absent. */
3806
- version: z23.string().nullable(),
3812
+ version: z24.string().nullable(),
3807
3813
  /** False in hosted mode (whole feature) — the client renders read-only up front. */
3808
- writable: z23.boolean(),
3809
- readOnlyReason: z23.string().optional()
3814
+ writable: z24.boolean(),
3815
+ readOnlyReason: z24.string().optional()
3810
3816
  });
3811
- var userMcpListingSchema = z23.object({
3812
- path: z23.string(),
3813
- servers: z23.array(z23.string()),
3814
- readable: z23.boolean()
3817
+ var userMcpListingSchema = z24.object({
3818
+ path: z24.string(),
3819
+ servers: z24.array(z24.string()),
3820
+ readable: z24.boolean()
3815
3821
  });
3816
- var agentConfigListingSchema = z23.object({
3817
- editable: z23.boolean(),
3818
- files: z23.array(agentConfigFileSchema),
3822
+ var agentConfigListingSchema = z24.object({
3823
+ editable: z24.boolean(),
3824
+ files: z24.array(agentConfigFileSchema),
3819
3825
  /** null in hosted mode (host-state disclosure guard). */
3820
3826
  userMcp: userMcpListingSchema.nullable()
3821
3827
  });
3822
- var agentConfigFileContentSchema = z23.object({
3823
- id: z23.string(),
3824
- path: z23.string(),
3825
- exists: z23.boolean(),
3826
- content: z23.string(),
3828
+ var agentConfigFileContentSchema = z24.object({
3829
+ id: z24.string(),
3830
+ path: z24.string(),
3831
+ exists: z24.boolean(),
3832
+ content: z24.string(),
3827
3833
  /** sha256 of the bytes, or null when the file does not exist yet. */
3828
- version: z23.string().nullable()
3834
+ version: z24.string().nullable()
3829
3835
  });
3830
- var setAgentConfigInputSchema = z23.object({
3831
- content: z23.string().max(2e6),
3832
- version: z23.string().nullable()
3836
+ var setAgentConfigInputSchema = z24.object({
3837
+ content: z24.string().max(2e6),
3838
+ version: z24.string().nullable()
3833
3839
  });
3834
3840
 
3835
3841
  // ../contract/src/agent-profiles.ts
3836
- import { z as z24 } from "zod";
3842
+ import { z as z25 } from "zod";
3837
3843
  var DEFAULT_AGENT_ACCOUNT_ID = "default";
3838
- var agentProfileSchema = z24.object({
3844
+ var agentProfileSchema = z25.object({
3839
3845
  /** `default` for the discovered profile, else the stored slug. */
3840
- id: z24.string(),
3846
+ id: z25.string(),
3841
3847
  provider: providerIdSchema,
3842
- label: z24.string(),
3848
+ label: z25.string(),
3843
3849
  /** As the user wrote it — a literal `~` is preserved, matching `browseRoot`/`projectsDir`. */
3844
- configDir: z24.string(),
3850
+ configDir: z25.string(),
3845
3851
  /** Expanded absolute path. Same-origin route, like `ProjectListEntry.root`. */
3846
- path: z24.string(),
3852
+ path: z25.string(),
3847
3853
  /** False for a dir the CLI has not created yet — legitimate, and NOT a reason to fall back
3848
3854
  * to another account at run time (that would silently bill the wrong subscription). */
3849
- exists: z24.boolean(),
3855
+ exists: z25.boolean(),
3850
3856
  /** Whether the dir carries this agent's own marker files. ADVISORY: an unrecognised dir is
3851
3857
  * still accepted, because "add profile → Connect → the CLI creates it" is the real flow. */
3852
- looksValid: z24.boolean(),
3858
+ looksValid: z25.boolean(),
3853
3859
  /** True for the profile Squawk discovers from the environment. Never stored, never deletable. */
3854
- isDefault: z24.boolean(),
3860
+ isDefault: z25.boolean(),
3855
3861
  /** This account's own authentication state — two Claude logins answer independently.
3856
3862
  *
3857
3863
  * **Absent until the probe has warmed.** Every probe shells out to an agent CLI, and this
@@ -3865,45 +3871,45 @@ function agentAccountRouteId(profile) {
3865
3871
  return profile.isDefault ? `default:${profile.provider}` : profile.id;
3866
3872
  }
3867
3873
  var agentAccountSelectionSchema = perRunnerOptionalStrings();
3868
- var agentProfilesResponseSchema = z24.object({
3869
- editable: z24.boolean(),
3870
- profiles: z24.array(agentProfileSchema),
3874
+ var agentProfilesResponseSchema = z25.object({
3875
+ editable: z25.boolean(),
3876
+ profiles: z25.array(agentProfileSchema),
3871
3877
  /** Providers that can carry more than one account at all — what "Add account" is offered for.
3872
3878
  * OpenCode and omp are absent: no folder variable moves their credentials, so a config-dir
3873
3879
  * profile would swap settings while still billing the other account. */
3874
- profileCapableProviders: z24.array(providerIdSchema),
3880
+ profileCapableProviders: z25.array(providerIdSchema),
3875
3881
  /** Which account each project uses, keyed by the project's realpath'd ROOT.
3876
3882
  *
3877
3883
  * Served here rather than on `GET /api/v1/projects` because it is stored beside the accounts it
3878
3884
  * names (`~/.cezar/agent-accounts.json`) — one file, so deleting an account and scrubbing every
3879
3885
  * reference to it is one atomic write, and neither can be dropped by a Squawk version that never
3880
3886
  * heard of accounts. Empty in hosted mode, where the whole family is withheld. */
3881
- selections: z24.record(z24.string(), agentAccountSelectionSchema)
3887
+ selections: z25.record(z25.string(), agentAccountSelectionSchema)
3882
3888
  });
3883
- var selectAgentProfileInputSchema = z24.object({
3889
+ var selectAgentProfileInputSchema = z25.object({
3884
3890
  /** Registry slug, or the reserved `default` boot alias. Resolved to a root server-side. */
3885
- projectId: z24.string().min(1).max(64),
3891
+ projectId: z25.string().min(1).max(64),
3886
3892
  provider: providerIdSchema,
3887
- profileId: z24.string().max(64).nullable()
3893
+ profileId: z25.string().max(64).nullable()
3888
3894
  });
3889
- var agentProfileSelectionsResponseSchema = z24.object({
3890
- selections: z24.record(z24.string(), agentAccountSelectionSchema)
3895
+ var agentProfileSelectionsResponseSchema = z25.object({
3896
+ selections: z25.record(z25.string(), agentAccountSelectionSchema)
3891
3897
  });
3892
- var agentAccountStatusResponseSchema = z24.object({ status: providerStatusSchema });
3893
- var createAgentProfileInputSchema = z24.object({
3898
+ var agentAccountStatusResponseSchema = z25.object({ status: providerStatusSchema });
3899
+ var createAgentProfileInputSchema = z25.object({
3894
3900
  provider: providerIdSchema,
3895
- label: z24.string().trim().max(200).optional(),
3901
+ label: z25.string().trim().max(200).optional(),
3896
3902
  /** Stored as written; validated absolute after `~` expansion, server-side. */
3897
- configDir: z24.string().trim().min(1).max(4096)
3903
+ configDir: z25.string().trim().min(1).max(4096)
3898
3904
  });
3899
- var agentProfileResponseSchema = z24.object({ profile: agentProfileSchema });
3900
- var updateAgentProfileInputSchema = z24.object({
3901
- label: z24.string().trim().max(200).optional(),
3902
- configDir: z24.string().trim().min(1).max(4096).optional()
3905
+ var agentProfileResponseSchema = z25.object({ profile: agentProfileSchema });
3906
+ var updateAgentProfileInputSchema = z25.object({
3907
+ label: z25.string().trim().max(200).optional(),
3908
+ configDir: z25.string().trim().min(1).max(4096).optional()
3903
3909
  });
3904
- var removeAgentProfileResponseSchema = z24.object({
3905
- removed: z24.literal(true),
3906
- id: z24.string()
3910
+ var removeAgentProfileResponseSchema = z25.object({
3911
+ removed: z25.literal(true),
3912
+ id: z25.string()
3907
3913
  });
3908
3914
 
3909
3915
  // ../contract/src/zoned-time.ts
@@ -3986,7 +3992,7 @@ function localTimeZone() {
3986
3992
  }
3987
3993
 
3988
3994
  // ../contract/src/automation-schedule.ts
3989
- import { z as z25 } from "zod";
3995
+ import { z as z26 } from "zod";
3990
3996
  var SCHEDULE_TYPES = ["daily", "weekdays", "weekly", "hours", "once"];
3991
3997
  var SCHEDULE_HOURS_OPTIONS = [1, 2, 3, 4, 6, 8, 12];
3992
3998
  var WEEKDAY_NAMES = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
@@ -3997,34 +4003,34 @@ var ONCE_AT_PATTERN = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})$/;
3997
4003
  var REPEATING_KEYS = ["hour", "minute", "day", "every"];
3998
4004
  var ONCE_KEYS = ["at", "timeZone", "latestStartMinutes"];
3999
4005
  var ONCE_PAST_DUE_MESSAGE = "the due time has passed; choose a later time or use Run now";
4000
- var onceStatusSchema = z25.enum(["paused", "waiting", "failed", "missed", "archived"]);
4006
+ var onceStatusSchema = z26.enum(["paused", "waiting", "failed", "missed", "archived"]);
4001
4007
  function unknownTimeZoneMessage(zone) {
4002
4008
  return `unknown time zone "${zone}"; use an IANA name such as Europe/Warsaw`;
4003
4009
  }
4004
- var automationScheduleSchema = z25.object({
4005
- type: z25.enum(SCHEDULE_TYPES),
4010
+ var automationScheduleSchema = z26.object({
4011
+ type: z26.enum(SCHEDULE_TYPES),
4006
4012
  /** 0–23; `daily`, `weekdays`, `weekly`. Default 4. */
4007
- hour: z25.number().int().min(0).max(23).optional(),
4013
+ hour: z26.number().int().min(0).max(23).optional(),
4008
4014
  /** 0–59; `daily`, `weekdays`, `weekly`. Default 0. */
4009
- minute: z25.number().int().min(0).max(59).optional(),
4015
+ minute: z26.number().int().min(0).max(59).optional(),
4010
4016
  /** ISO weekday, Monday = 1 … Sunday = 7; `weekly`. Default 1. */
4011
- day: z25.number().int().min(1).max(7).optional(),
4017
+ day: z26.number().int().min(1).max(7).optional(),
4012
4018
  /** Hours between runs, from 00:00; `hours`. Default 6. */
4013
- every: z25.union([
4014
- z25.literal(1),
4015
- z25.literal(2),
4016
- z25.literal(3),
4017
- z25.literal(4),
4018
- z25.literal(6),
4019
- z25.literal(8),
4020
- z25.literal(12)
4019
+ every: z26.union([
4020
+ z26.literal(1),
4021
+ z26.literal(2),
4022
+ z26.literal(3),
4023
+ z26.literal(4),
4024
+ z26.literal(6),
4025
+ z26.literal(8),
4026
+ z26.literal(12)
4021
4027
  ]).optional(),
4022
4028
  /** `once`: the local wall time `YYYY-MM-DDTHH:MM` in `timeZone`. */
4023
- at: z25.string().regex(ONCE_AT_PATTERN, "at must be YYYY-MM-DDTHH:MM").optional(),
4029
+ at: z26.string().regex(ONCE_AT_PATTERN, "at must be YYYY-MM-DDTHH:MM").optional(),
4024
4030
  /** `once`: the IANA zone `at` is read in. Required there, refused on the repeating shapes. */
4025
- timeZone: z25.string().optional(),
4031
+ timeZone: z26.string().optional(),
4026
4032
  /** `once`: how late after `at` a start may still launch. Absent = no limit. */
4027
- latestStartMinutes: z25.number().int().min(ONCE_MIN_LATEST_START_MINUTES).max(ONCE_MAX_LATEST_START_MINUTES).optional()
4033
+ latestStartMinutes: z26.number().int().min(ONCE_MIN_LATEST_START_MINUTES).max(ONCE_MAX_LATEST_START_MINUTES).optional()
4028
4034
  }).superRefine((schedule, ctx) => {
4029
4035
  const present = (key) => schedule[key] !== void 0;
4030
4036
  const refuse = (key, message2) => ctx.addIssue({ code: "custom", path: [key], message: message2 });
@@ -4189,112 +4195,112 @@ function nextOccurrence(schedule, afterMs, timeZone) {
4189
4195
  }
4190
4196
 
4191
4197
  // ../contract/src/automations.ts
4192
- import { z as z26 } from "zod";
4193
- var automationEventSchema = z26.enum([
4198
+ import { z as z27 } from "zod";
4199
+ var automationEventSchema = z27.enum([
4194
4200
  "pull_request.opened",
4195
4201
  "issue.opened",
4196
4202
  "issue.labeled",
4197
4203
  "issue.unlabeled"
4198
4204
  ]);
4199
- var automationFiltersSchema = z26.object({
4205
+ var automationFiltersSchema = z27.object({
4200
4206
  /** Opt in to matching events before enablement, bounded by lookbackDays. Absent means false. */
4201
- includeExisting: z26.boolean().optional(),
4202
- authors: z26.array(z26.string()).optional(),
4203
- assignees: z26.array(z26.string()).optional(),
4207
+ includeExisting: z27.boolean().optional(),
4208
+ authors: z27.array(z27.string()).optional(),
4209
+ assignees: z27.array(z27.string()).optional(),
4204
4210
  /** Opt-in: require an open item and matching live labels before reservation and launch. */
4205
- requireCurrentLabels: z26.boolean().optional(),
4206
- allLabels: z26.array(z26.string()).optional(),
4207
- anyLabels: z26.array(z26.string()).optional(),
4208
- excludeLabels: z26.array(z26.string()).optional(),
4211
+ requireCurrentLabels: z27.boolean().optional(),
4212
+ allLabels: z27.array(z27.string()).optional(),
4213
+ anyLabels: z27.array(z27.string()).optional(),
4214
+ excludeLabels: z27.array(z27.string()).optional(),
4209
4215
  /** Required for the two label events — the server rejects a definition without it. */
4210
- changedLabels: z26.array(z26.string()).optional(),
4211
- lookbackDays: z26.number(),
4212
- maxRecords: z26.number()
4216
+ changedLabels: z27.array(z27.string()).optional(),
4217
+ lookbackDays: z27.number(),
4218
+ maxRecords: z27.number()
4213
4219
  });
4214
- var automationKindSchema = z26.enum(["github", "schedule"]);
4220
+ var automationKindSchema = z27.enum(["github", "schedule"]);
4215
4221
  var automationTaskSchema = createRunInputBaseSchema.omit({ task: true, images: true, systemPrompt: true }).extend({
4216
4222
  /** The prompt template. `{{github.number}}`, `{{github.title}}`, `{{github.url}}` and
4217
4223
  * `{{github.labels}}` are substituted per match; GitHub content is appended as untrusted
4218
4224
  * context, never interpolated into instructions. */
4219
- prompt: z26.string(),
4220
- variants: z26.union([z26.literal(1), z26.literal(2), z26.literal(3)]).optional(),
4221
- systemPrompt: z26.string().optional()
4225
+ prompt: z27.string(),
4226
+ variants: z27.union([z27.literal(1), z27.literal(2), z27.literal(3)]).optional(),
4227
+ systemPrompt: z27.string().optional()
4222
4228
  });
4223
4229
  function writableAutomationTask(task) {
4224
4230
  const { variants: _variants, ...writable } = task;
4225
4231
  return writable;
4226
4232
  }
4227
- var automationArchiveSchema = z26.object({
4228
- at: z26.string(),
4229
- outcome: z26.enum(["launched", "cancelled"]),
4230
- runId: z26.string().optional(),
4231
- receiptId: z26.string().optional(),
4232
- trigger: z26.enum(["schedule", "late", "manual", "retry"]).optional()
4233
+ var automationArchiveSchema = z27.object({
4234
+ at: z27.string(),
4235
+ outcome: z27.enum(["launched", "cancelled"]),
4236
+ runId: z27.string().optional(),
4237
+ receiptId: z27.string().optional(),
4238
+ trigger: z27.enum(["schedule", "late", "manual", "retry"]).optional()
4233
4239
  });
4234
- var automationDefinitionSchema = z26.object({
4235
- id: z26.string(),
4240
+ var automationDefinitionSchema = z27.object({
4241
+ id: z27.string(),
4236
4242
  /** Bumped on every edit; a PUT must echo the revision it read (optimistic concurrency). */
4237
- revision: z26.number(),
4238
- name: z26.string(),
4239
- description: z26.string().optional(),
4243
+ revision: z27.number(),
4244
+ name: z27.string(),
4245
+ description: z27.string().optional(),
4240
4246
  /** Always present: the storage schema defaults it to `false`, so a definition is created
4241
4247
  * PAUSED and enabling it is a separate, baseline-establishing act. */
4242
- enabled: z26.boolean(),
4248
+ enabled: z27.boolean(),
4243
4249
  kind: automationKindSchema,
4244
4250
  /** `github` kind: always present. `schedule` kind: absent. */
4245
- events: z26.array(automationEventSchema).optional(),
4246
- intervalSeconds: z26.number().optional(),
4251
+ events: z27.array(automationEventSchema).optional(),
4252
+ intervalSeconds: z27.number().optional(),
4247
4253
  filters: automationFiltersSchema.optional(),
4248
4254
  /** `schedule` kind: always present. `github` kind: absent. */
4249
4255
  schedule: automationScheduleSchema.optional(),
4250
4256
  task: automationTaskSchema,
4251
4257
  /** `once` schedules only: present once its task exists or it was cancelled. */
4252
4258
  archived: automationArchiveSchema.optional(),
4253
- createdAt: z26.string(),
4254
- updatedAt: z26.string()
4255
- });
4256
- var automationCursorSchema = z26.object({
4257
- timestamp: z26.string(),
4258
- tieBreaker: z26.string().optional()
4259
- });
4260
- var automationHistoryScanSchema = z26.object({
4261
- since: z26.string().datetime(),
4262
- until: z26.string().datetime(),
4263
- source: z26.number().int().min(0).max(2),
4264
- page: z26.number().int().min(1).max(10),
4265
- item: z26.number().int().min(0).max(100),
4259
+ createdAt: z27.string(),
4260
+ updatedAt: z27.string()
4261
+ });
4262
+ var automationCursorSchema = z27.object({
4263
+ timestamp: z27.string(),
4264
+ tieBreaker: z27.string().optional()
4265
+ });
4266
+ var automationHistoryScanSchema = z27.object({
4267
+ since: z27.string().datetime(),
4268
+ until: z27.string().datetime(),
4269
+ source: z27.number().int().min(0).max(2),
4270
+ page: z27.number().int().min(1).max(10),
4271
+ item: z27.number().int().min(0).max(100),
4266
4272
  // One item can contain ten pages of 100 timeline entries, independent of the new-work cap.
4267
- event: z26.number().int().min(0).max(1e3),
4273
+ event: z27.number().int().min(0).max(1e3),
4268
4274
  cursor: automationCursorSchema.optional()
4269
4275
  });
4270
4276
  var AUTOMATION_LAST_ERROR_MAX = 1e3;
4271
4277
  var automationLastErrorShape = {
4272
- lastError: z26.string().max(AUTOMATION_LAST_ERROR_MAX).optional(),
4273
- lastErrorAt: z26.string().datetime().optional()
4278
+ lastError: z27.string().max(AUTOMATION_LAST_ERROR_MAX).optional(),
4279
+ lastErrorAt: z27.string().datetime().optional()
4274
4280
  };
4275
- var automationRuntimeStateSchema = z26.object({
4281
+ var automationRuntimeStateSchema = z27.object({
4276
4282
  /** The definition revision this state belongs to; activation or history-policy changes re-arm. */
4277
- revision: z26.number().optional(),
4283
+ revision: z27.number().optional(),
4278
4284
  /** Earliest eligible event: enablement time, or the lookback start when includeExisting is on. */
4279
- baselineAt: z26.string().optional(),
4285
+ baselineAt: z27.string().optional(),
4280
4286
  /** When discovery was armed, independent of the historical baseline. */
4281
- armedAt: z26.string().optional(),
4287
+ armedAt: z27.string().optional(),
4282
4288
  historyScan: automationHistoryScanSchema.optional(),
4283
4289
  cursor: automationCursorSchema.optional(),
4284
- frozenHighWatermark: automationCursorSchema.extend({ tieBreaker: z26.string() }).optional(),
4285
- backlogAfter: automationCursorSchema.extend({ tieBreaker: z26.string() }).optional(),
4286
- nextCheckAt: z26.string().optional(),
4287
- lastSuccessAt: z26.string().optional(),
4290
+ frozenHighWatermark: automationCursorSchema.extend({ tieBreaker: z27.string() }).optional(),
4291
+ backlogAfter: automationCursorSchema.extend({ tieBreaker: z27.string() }).optional(),
4292
+ nextCheckAt: z27.string().optional(),
4293
+ lastSuccessAt: z27.string().optional(),
4288
4294
  /** `schedule` kind: the next occurrence's instant and the last fired one's. */
4289
- nextRunAt: z26.string().optional(),
4290
- lastRunAt: z26.string().optional(),
4295
+ nextRunAt: z27.string().optional(),
4296
+ lastRunAt: z27.string().optional(),
4291
4297
  /** Per-query GitHub ETags, so an unchanged page costs no rate-limit budget. */
4292
- etags: z26.record(z26.string(), z26.string()).optional(),
4293
- backoffUntil: z26.string().optional(),
4294
- consecutiveFailures: z26.number().optional(),
4298
+ etags: z27.record(z27.string(), z27.string()).optional(),
4299
+ backoffUntil: z27.string().optional(),
4300
+ consecutiveFailures: z27.number().optional(),
4295
4301
  ...automationLastErrorShape,
4296
4302
  /** `once` schedules: why it stopped without a task — its launch failed, or it started past its cutoff. */
4297
- onceOutcome: z26.enum(["failed", "missed"]).optional()
4303
+ onceOutcome: z27.enum(["failed", "missed"]).optional()
4298
4304
  });
4299
4305
  var AUTOMATION_FAILURE_NOTICE_AFTER = 3;
4300
4306
  function automationFailureNotice(state) {
@@ -4307,7 +4313,7 @@ function automationFailureNotice(state) {
4307
4313
  ...state.backoffUntil ? { retryAt: state.backoffUntil } : {}
4308
4314
  };
4309
4315
  }
4310
- var automationLogResultSchema = z26.enum([
4316
+ var automationLogResultSchema = z27.enum([
4311
4317
  "launched",
4312
4318
  "no-match",
4313
4319
  "duplicate",
@@ -4323,36 +4329,36 @@ var automationLogResultSchema = z26.enum([
4323
4329
  // once schedule: Squawk started after its latest start, so nothing launched.
4324
4330
  "missed"
4325
4331
  ]);
4326
- var automationLogRecordSchema = z26.object({
4327
- seq: z26.number(),
4328
- ts: z26.string(),
4329
- automationId: z26.string(),
4330
- revision: z26.number(),
4332
+ var automationLogRecordSchema = z27.object({
4333
+ seq: z27.number(),
4334
+ ts: z27.string(),
4335
+ automationId: z27.string(),
4336
+ revision: z27.number(),
4331
4337
  event: automationEventSchema.optional(),
4332
4338
  result: automationLogResultSchema,
4333
- reason: z26.string().optional(),
4334
- durationMs: z26.number().optional(),
4335
- receiptId: z26.string().optional(),
4336
- runId: z26.string().optional(),
4337
- githubNumber: z26.number().optional(),
4338
- githubTitle: z26.string().optional(),
4339
- githubUrl: z26.string().optional(),
4340
- rateLimit: z26.object({
4341
- bucket: z26.enum(["core", "search"]),
4342
- remaining: z26.number().optional(),
4343
- resetAt: z26.string().optional()
4339
+ reason: z27.string().optional(),
4340
+ durationMs: z27.number().optional(),
4341
+ receiptId: z27.string().optional(),
4342
+ runId: z27.string().optional(),
4343
+ githubNumber: z27.number().optional(),
4344
+ githubTitle: z27.string().optional(),
4345
+ githubUrl: z27.string().optional(),
4346
+ rateLimit: z27.object({
4347
+ bucket: z27.enum(["core", "search"]),
4348
+ remaining: z27.number().optional(),
4349
+ resetAt: z27.string().optional()
4344
4350
  }).optional()
4345
4351
  });
4346
- var automationCountsSchema = z26.object({
4352
+ var automationCountsSchema = z27.object({
4347
4353
  /** GitHub candidates that matched a filter: `launched` + `duplicate` rows. */
4348
- matches: z26.number(),
4354
+ matches: z27.number(),
4349
4355
  /** Stored tasks with this automation's provenance, including each variant, finished and archived
4350
4356
  * tasks, across all revisions. Independent of log/receipt retention; deleting a task removes it. */
4351
- launched: z26.number(),
4357
+ launched: z27.number(),
4352
4358
  /** `duplicate` rows: a match whose receipt already existed, so nothing launched. */
4353
- duplicates: z26.number(),
4359
+ duplicates: z27.number(),
4354
4360
  /** `error` and `rate-limited` rows, plus a schedule's `failed` launches. */
4355
- errors: z26.number()
4361
+ errors: z27.number()
4356
4362
  });
4357
4363
  var automationListEntrySchema = automationDefinitionSchema.extend({
4358
4364
  state: automationRuntimeStateSchema.optional(),
@@ -4360,74 +4366,74 @@ var automationListEntrySchema = automationDefinitionSchema.extend({
4360
4366
  counts: automationCountsSchema,
4361
4367
  /** Enabled only: a schedule's armed `state.nextRunAt`, a poll's `state.nextCheckAt`. Absent
4362
4368
  * while paused, and for a schedule the timer has not armed yet. */
4363
- nextRunAt: z26.string().optional(),
4369
+ nextRunAt: z27.string().optional(),
4364
4370
  /** `once` schedules only. */
4365
4371
  onceStatus: onceStatusSchema.optional()
4366
4372
  });
4367
- var automationsResponseSchema = z26.object({
4368
- available: z26.boolean(),
4369
- reason: z26.string().optional(),
4370
- timeZone: z26.string(),
4371
- scheduler: z26.object({
4372
- state: z26.enum(["scheduled", "idle"]),
4373
- nextDue: z26.string().optional()
4373
+ var automationsResponseSchema = z27.object({
4374
+ available: z27.boolean(),
4375
+ reason: z27.string().optional(),
4376
+ timeZone: z27.string(),
4377
+ scheduler: z27.object({
4378
+ state: z27.enum(["scheduled", "idle"]),
4379
+ nextDue: z27.string().optional()
4374
4380
  }),
4375
- automations: z26.array(automationListEntrySchema)
4381
+ automations: z27.array(automationListEntrySchema)
4376
4382
  });
4377
- var automationResponseSchema = z26.object({ automation: automationDefinitionSchema });
4383
+ var automationResponseSchema = z27.object({ automation: automationDefinitionSchema });
4378
4384
  var automationCreateResponseSchema = automationResponseSchema.extend({
4379
- once: z26.object({ dueAt: z26.string(), timeZone: z26.string(), resolvedInstant: z26.string(), note: z26.string() }).optional()
4385
+ once: z27.object({ dueAt: z27.string(), timeZone: z27.string(), resolvedInstant: z27.string(), note: z27.string() }).optional()
4380
4386
  });
4381
- var automationDetailResponseSchema = z26.object({
4387
+ var automationDetailResponseSchema = z27.object({
4382
4388
  automation: automationDefinitionSchema,
4383
4389
  state: automationRuntimeStateSchema.optional(),
4384
4390
  latestLog: automationLogRecordSchema.optional(),
4385
4391
  /** `once` schedules only. */
4386
4392
  onceStatus: onceStatusSchema.optional()
4387
4393
  });
4388
- var automationCheckSchema = z26.object({
4389
- id: z26.string(),
4390
- automationId: z26.string(),
4391
- mode: z26.enum(["preview", "execute"]),
4392
- status: z26.enum(["queued", "running", "complete", "error"]),
4393
- createdAt: z26.string(),
4394
- completedAt: z26.string().optional(),
4395
- matches: z26.number().optional(),
4396
- truncated: z26.boolean().optional(),
4397
- error: z26.string().optional()
4398
- });
4399
- var automationCheckQueuedResponseSchema = z26.object({ checkId: z26.string() });
4400
- var automationLogResponseSchema = z26.object({
4401
- records: z26.array(automationLogRecordSchema)
4402
- });
4403
- var automationRetryResponseSchema = z26.object({
4404
- receiptId: z26.string(),
4405
- runId: z26.string()
4406
- });
4407
- var automationRunResponseSchema = z26.object({ runId: z26.string() });
4394
+ var automationCheckSchema = z27.object({
4395
+ id: z27.string(),
4396
+ automationId: z27.string(),
4397
+ mode: z27.enum(["preview", "execute"]),
4398
+ status: z27.enum(["queued", "running", "complete", "error"]),
4399
+ createdAt: z27.string(),
4400
+ completedAt: z27.string().optional(),
4401
+ matches: z27.number().optional(),
4402
+ truncated: z27.boolean().optional(),
4403
+ error: z27.string().optional()
4404
+ });
4405
+ var automationCheckQueuedResponseSchema = z27.object({ checkId: z27.string() });
4406
+ var automationLogResponseSchema = z27.object({
4407
+ records: z27.array(automationLogRecordSchema)
4408
+ });
4409
+ var automationRetryResponseSchema = z27.object({
4410
+ receiptId: z27.string(),
4411
+ runId: z27.string()
4412
+ });
4413
+ var automationRunResponseSchema = z27.object({ runId: z27.string() });
4408
4414
  var createAutomationInputSchema = automationDefinitionSchema.omit({ id: true, revision: true, createdAt: true, updatedAt: true, enabled: true, kind: true, archived: true }).extend({
4409
4415
  /** Omitted = `github` on create, the shape every pre-schedule client sends; omitted on
4410
4416
  * update = the stored kind. */
4411
4417
  kind: automationKindSchema.optional(),
4412
4418
  task: automationTaskSchema.omit({ variants: true }).strict(),
4413
- enable: z26.boolean().optional()
4419
+ enable: z27.boolean().optional()
4414
4420
  });
4415
4421
  var updateAutomationInputSchema = createAutomationInputSchema.omit({ enable: true }).extend({
4416
- enabled: z26.boolean().optional(),
4417
- expectedRevision: z26.number()
4422
+ enabled: z27.boolean().optional(),
4423
+ expectedRevision: z27.number()
4418
4424
  });
4419
- var automationListQuerySchema = z26.object({
4420
- archived: z26.enum(["include", "only"]).optional()
4425
+ var automationListQuerySchema = z27.object({
4426
+ archived: z27.enum(["include", "only"]).optional()
4421
4427
  });
4422
- var automationCheckInputSchema = z26.object({
4423
- mode: z26.enum(["preview", "execute"])
4428
+ var automationCheckInputSchema = z27.object({
4429
+ mode: z27.enum(["preview", "execute"])
4424
4430
  });
4425
4431
 
4426
4432
  // ../contract/src/scheduled-tasks.ts
4427
- import { z as z27 } from "zod";
4433
+ import { z as z28 } from "zod";
4428
4434
  var SCHEDULED_TASK_LIMITS = { prompt: 1e5, list: 50, wireBytes: 1048576 };
4429
4435
  var DURATION = /^(\d+)\s*([mhd])$/;
4430
- var durationField = z27.string().regex(DURATION, "a duration such as 30m, 6h or 7d");
4436
+ var durationField = z28.string().regex(DURATION, "a duration such as 30m, 6h or 7d");
4431
4437
  function parseDurationMinutes(value) {
4432
4438
  const match = DURATION.exec(value.trim());
4433
4439
  if (!match) throw new Error(`"${value}" is not a duration; use 30m, 6h or 7d`);
@@ -4451,58 +4457,58 @@ function wallTimeAtOrAfter(targetMs, timeZone) {
4451
4457
  var UTC_MINUTE_PATTERN = /^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2})Z$/;
4452
4458
  var utcMinute = (instantMs) => `${new Date(instantMs).toISOString().slice(0, 16)}Z`;
4453
4459
  var scheduleFields = {
4454
- at: z27.string().regex(UTC_MINUTE_PATTERN, "a UTC time YYYY-MM-DDTHH:MMZ").refine((value) => isRealOnceAt(value.slice(0, -1)), "not a real date and time").optional(),
4460
+ at: z28.string().regex(UTC_MINUTE_PATTERN, "a UTC time YYYY-MM-DDTHH:MMZ").refine((value) => isRealOnceAt(value.slice(0, -1)), "not a real date and time").optional(),
4455
4461
  delay: durationField.optional(),
4456
4462
  latest_start: durationField.optional(),
4457
- workflow: z27.string().trim().min(1).max(200).optional(),
4458
- runner: z27.string().trim().min(1).max(32).optional(),
4459
- model: z27.string().trim().min(1).max(200).optional(),
4460
- effort: z27.string().trim().min(1).max(32).optional()
4463
+ workflow: z28.string().trim().min(1).max(200).optional(),
4464
+ runner: z28.string().trim().min(1).max(32).optional(),
4465
+ model: z28.string().trim().min(1).max(200).optional(),
4466
+ effort: z28.string().trim().min(1).max(32).optional()
4461
4467
  };
4462
4468
  var notBoth = (value) => !(value.at && value.delay);
4463
- var scheduleTaskRequestSchema = z27.object({
4464
- name: z27.string().trim().min(1).max(200),
4465
- prompt: z27.string().min(1).max(SCHEDULED_TASK_LIMITS.prompt),
4469
+ var scheduleTaskRequestSchema = z28.object({
4470
+ name: z28.string().trim().min(1).max(200),
4471
+ prompt: z28.string().min(1).max(SCHEDULED_TASK_LIMITS.prompt),
4466
4472
  ...scheduleFields,
4467
- enable: z27.boolean().optional()
4473
+ enable: z28.boolean().optional()
4468
4474
  }).strict().refine(notBoth, { message: "give at or delay, not both", path: ["delay"] }).refine((value) => Boolean(value.at || value.delay), { message: "give at or delay", path: ["at"] });
4469
- var idField = z27.string().min(1).max(100);
4470
- var scheduledTasksRequestSchema = z27.discriminatedUnion("action", [
4471
- z27.object({ action: z27.literal("list"), archived: z27.enum(["include", "only"]).optional() }).strict(),
4472
- z27.object({ action: z27.literal("show"), id: idField }).strict(),
4473
- z27.object({
4474
- action: z27.literal("update"),
4475
+ var idField = z28.string().min(1).max(100);
4476
+ var scheduledTasksRequestSchema = z28.discriminatedUnion("action", [
4477
+ z28.object({ action: z28.literal("list"), archived: z28.enum(["include", "only"]).optional() }).strict(),
4478
+ z28.object({ action: z28.literal("show"), id: idField }).strict(),
4479
+ z28.object({
4480
+ action: z28.literal("update"),
4475
4481
  id: idField,
4476
- name: z27.string().trim().min(1).max(200).optional(),
4477
- prompt: z27.string().min(1).max(SCHEDULED_TASK_LIMITS.prompt).optional(),
4482
+ name: z28.string().trim().min(1).max(200).optional(),
4483
+ prompt: z28.string().min(1).max(SCHEDULED_TASK_LIMITS.prompt).optional(),
4478
4484
  ...scheduleFields
4479
4485
  }).strict().refine(notBoth, { message: "give at or delay, not both", path: ["delay"] }),
4480
- z27.object({ action: z27.literal("pause"), id: idField }).strict(),
4481
- z27.object({ action: z27.literal("enable"), id: idField }).strict(),
4482
- z27.object({ action: z27.literal("cancel"), id: idField }).strict()
4486
+ z28.object({ action: z28.literal("pause"), id: idField }).strict(),
4487
+ z28.object({ action: z28.literal("enable"), id: idField }).strict(),
4488
+ z28.object({ action: z28.literal("cancel"), id: idField }).strict()
4483
4489
  ]);
4484
- var scheduledTaskSchema = z27.object({
4485
- id: z27.string(),
4486
- name: z27.string(),
4490
+ var scheduledTaskSchema = z28.object({
4491
+ id: z28.string(),
4492
+ name: z28.string(),
4487
4493
  status: onceStatusSchema,
4488
4494
  /** When it is due, in UTC: `YYYY-MM-DDTHH:MMZ`, the form `at` takes. */
4489
- due_at: z27.string(),
4490
- latest_start_minutes: z27.number().optional(),
4495
+ due_at: z28.string(),
4496
+ latest_start_minutes: z28.number().optional(),
4491
4497
  /** The task it launched, once archived with one. */
4492
- run_id: z27.string().optional(),
4498
+ run_id: z28.string().optional(),
4493
4499
  /** The cockpit page of the schedule, when the cockpit's address is known. */
4494
- url: z27.string().optional()
4500
+ url: z28.string().optional()
4495
4501
  });
4496
- var scheduledTaskRefusalCodeSchema = z27.enum(["invalid_request", "unavailable", "not_found", "conflict", "automations_off"]);
4497
- var refusal = z27.object({ ok: z27.literal(false), code: scheduledTaskRefusalCodeSchema, message: z27.string() });
4502
+ var scheduledTaskRefusalCodeSchema = z28.enum(["invalid_request", "unavailable", "not_found", "conflict", "automations_off"]);
4503
+ var refusal = z28.object({ ok: z28.literal(false), code: scheduledTaskRefusalCodeSchema, message: z28.string() });
4498
4504
  var SCHEDULED_TASK_NOTE = "The cockpit must be running at the due time, or start again before the latest start, for this task to launch.";
4499
- var scheduleTaskAnswerSchema = z27.union([
4500
- z27.object({ ok: z27.literal(true), task: scheduledTaskSchema, note: z27.string() }),
4505
+ var scheduleTaskAnswerSchema = z28.union([
4506
+ z28.object({ ok: z28.literal(true), task: scheduledTaskSchema, note: z28.string() }),
4501
4507
  refusal
4502
4508
  ]);
4503
- var scheduledTasksAnswerSchema = z27.union([
4504
- z27.object({ ok: z27.literal(true), tasks: z27.array(scheduledTaskSchema).max(SCHEDULED_TASK_LIMITS.list) }),
4505
- z27.object({ ok: z27.literal(true), task: scheduledTaskSchema }),
4509
+ var scheduledTasksAnswerSchema = z28.union([
4510
+ z28.object({ ok: z28.literal(true), tasks: z28.array(scheduledTaskSchema).max(SCHEDULED_TASK_LIMITS.list) }),
4511
+ z28.object({ ok: z28.literal(true), task: scheduledTaskSchema }),
4506
4512
  refusal
4507
4513
  ]);
4508
4514
 
@@ -4685,73 +4691,73 @@ function sqlPrefilterTokens(query, options = {}) {
4685
4691
  }
4686
4692
 
4687
4693
  // ../contract/src/artifacts.ts
4688
- import { z as z28 } from "zod";
4689
- var pathSchema = z28.string().min(1).max(8192).refine((value) => !value.includes("\0"), "Path contains NUL");
4690
- var publishedArtifactSchema = z28.object({
4691
- id: z28.uuid(),
4692
- runId: z28.uuid(),
4693
- name: z28.string().min(1).max(255),
4694
- title: z28.string().max(200).optional(),
4694
+ import { z as z29 } from "zod";
4695
+ var pathSchema = z29.string().min(1).max(8192).refine((value) => !value.includes("\0"), "Path contains NUL");
4696
+ var publishedArtifactSchema = z29.object({
4697
+ id: z29.uuid(),
4698
+ runId: z29.uuid(),
4699
+ name: z29.string().min(1).max(255),
4700
+ title: z29.string().max(200).optional(),
4695
4701
  sourcePath: pathSchema.refine((value) => /^(?:\/|[A-Za-z]:[\\/]|\\\\)/.test(value), "Expected an absolute source path"),
4696
- createdAt: z28.iso.datetime(),
4697
- size: z28.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
4698
- sha256: z28.string().regex(/^[a-f0-9]{64}$/)
4702
+ createdAt: z29.iso.datetime(),
4703
+ size: z29.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
4704
+ sha256: z29.string().regex(/^[a-f0-9]{64}$/)
4699
4705
  }).strict();
4700
- var filePreviewDataSchema = z28.object({
4701
- type: z28.literal("file"),
4706
+ var filePreviewDataSchema = z29.object({
4707
+ type: z29.literal("file"),
4702
4708
  path: pathSchema,
4703
- size: z28.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
4704
- binary: z28.boolean(),
4705
- tooLarge: z28.boolean(),
4706
- content: z28.string().optional(),
4707
- source: z28.enum(["worktree", "project", "artifact"]),
4709
+ size: z29.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
4710
+ binary: z29.boolean(),
4711
+ tooLarge: z29.boolean(),
4712
+ content: z29.string().optional(),
4713
+ source: z29.enum(["worktree", "project", "artifact"]),
4708
4714
  artifact: publishedArtifactSchema.optional()
4709
4715
  }).strict();
4710
- var fileLinkResultSchema = z28.union([
4716
+ var fileLinkResultSchema = z29.union([
4711
4717
  filePreviewDataSchema,
4712
- z28.object({
4713
- type: z28.enum(["unavailable", "unpublished"]),
4718
+ z29.object({
4719
+ type: z29.enum(["unavailable", "unpublished"]),
4714
4720
  path: pathSchema,
4715
- reason: z28.string().min(1).max(4096)
4721
+ reason: z29.string().min(1).max(4096)
4716
4722
  }).strict()
4717
4723
  ]);
4718
- var artifactMetadataResponseSchema = z28.object({ artifact: publishedArtifactSchema }).strict();
4719
- var artifactListSchema = z28.object({ artifacts: z28.array(publishedArtifactSchema).max(64) }).strict();
4720
- var fileLinkQuerySchema = z28.object({ path: pathSchema, raw: z28.literal("1").optional() }).strict();
4721
- var artifactParamsSchema = z28.object({ id: z28.uuid(), artifactId: z28.uuid() });
4724
+ var artifactMetadataResponseSchema = z29.object({ artifact: publishedArtifactSchema }).strict();
4725
+ var artifactListSchema = z29.object({ artifacts: z29.array(publishedArtifactSchema).max(64) }).strict();
4726
+ var fileLinkQuerySchema = z29.object({ path: pathSchema, raw: z29.literal("1").optional() }).strict();
4727
+ var artifactParamsSchema = z29.object({ id: z29.uuid(), artifactId: z29.uuid() });
4722
4728
 
4723
4729
  // ../contract/src/discovery.ts
4724
- import { z as z29 } from "zod";
4725
- var hostDiscoveryRequestSchema = z29.discriminatedUnion("kind", [
4726
- z29.object({ kind: z29.literal("runners") }).strict(),
4727
- z29.object({ kind: z29.literal("models"), runner: modelDiscoveryRunnerSchema }).strict()
4730
+ import { z as z30 } from "zod";
4731
+ var hostDiscoveryRequestSchema = z30.discriminatedUnion("kind", [
4732
+ z30.object({ kind: z30.literal("runners") }).strict(),
4733
+ z30.object({ kind: z30.literal("models"), runner: modelDiscoveryRunnerSchema }).strict()
4728
4734
  ]);
4729
- var discoveryRequestSchema = z29.discriminatedUnion("kind", [
4735
+ var discoveryRequestSchema = z30.discriminatedUnion("kind", [
4730
4736
  ...hostDiscoveryRequestSchema.options,
4731
- z29.object({ kind: z29.literal("tasks"), all: z29.boolean().optional(), offset: z29.number().int().min(0).max(Number.MAX_SAFE_INTEGER).optional() }).strict()
4737
+ z30.object({ kind: z30.literal("tasks"), all: z30.boolean().optional(), offset: z30.number().int().min(0).max(Number.MAX_SAFE_INTEGER).optional() }).strict()
4732
4738
  ]);
4733
4739
  var discoveredRunnerSchema = providerStatusSchema.omit({ provider: true, profileId: true }).extend({ runner: modelDiscoveryRunnerSchema });
4734
- var discoveredRunnersSchema = z29.object({
4735
- scope: z29.literal("host-default-account"),
4736
- runners: z29.array(discoveredRunnerSchema)
4737
- });
4738
- var discoveredTasksSchema = z29.object({
4739
- tasks: z29.array(z29.object({
4740
- id: z29.string(),
4741
- title: z29.string(),
4740
+ var discoveredRunnersSchema = z30.object({
4741
+ scope: z30.literal("host-default-account"),
4742
+ runners: z30.array(discoveredRunnerSchema)
4743
+ });
4744
+ var discoveredTasksSchema = z30.object({
4745
+ tasks: z30.array(z30.object({
4746
+ id: z30.string(),
4747
+ title: z30.string(),
4742
4748
  runner: runnerSchema.optional(),
4743
4749
  status: runStatusSchema,
4744
- attention: z29.enum(["permission", "error", "waiting", "running", "unseen", "none"]),
4745
- attentionLabel: z29.string(),
4746
- accepts: z29.boolean(),
4747
- reason: z29.string().optional()
4750
+ attention: z30.enum(["permission", "error", "waiting", "running", "unseen", "none"]),
4751
+ attentionLabel: z30.string(),
4752
+ accepts: z30.boolean(),
4753
+ reason: z30.string().optional()
4748
4754
  })).max(32),
4749
- nextOffset: z29.number().int().nonnegative().optional()
4755
+ nextOffset: z30.number().int().nonnegative().optional()
4750
4756
  });
4751
- var discoveryResponseSchema = z29.union([discoveredRunnersSchema, runnerModelCatalogResponseSchema, discoveredTasksSchema]);
4757
+ var discoveryResponseSchema = z30.union([discoveredRunnersSchema, runnerModelCatalogResponseSchema, discoveredTasksSchema]);
4752
4758
 
4753
4759
  // ../contract/src/live.ts
4754
- import { z as z30 } from "zod";
4760
+ import { z as z31 } from "zod";
4755
4761
 
4756
4762
  // ../contract/src/live-limits.ts
4757
4763
  var LIVE_RUN_LIMIT = 32;
@@ -4759,44 +4765,44 @@ var LIVE_EVENT_LIMIT = 256;
4759
4765
  var LIVE_BYTE_LIMIT = 1024 * 1024;
4760
4766
 
4761
4767
  // ../contract/src/live.ts
4762
- var liveRunDemandSchema = z30.object({
4763
- projectId: z30.string().min(1).max(128).regex(/^[a-zA-Z0-9_-]+$/),
4768
+ var liveRunDemandSchema = z31.object({
4769
+ projectId: z31.string().min(1).max(128).regex(/^[a-zA-Z0-9_-]+$/),
4764
4770
  runId: runIdParamSchema.shape.id,
4765
4771
  cursor: runHistoryCursorSchema.optional(),
4766
- afterSeq: z30.number().int().nonnegative().safe()
4772
+ afterSeq: z31.number().int().nonnegative().safe()
4767
4773
  });
4768
- var liveRunsRequestSchema = z30.object({
4769
- runs: z30.array(liveRunDemandSchema).min(1).max(LIVE_RUN_LIMIT)
4774
+ var liveRunsRequestSchema = z31.object({
4775
+ runs: z31.array(liveRunDemandSchema).min(1).max(LIVE_RUN_LIMIT)
4770
4776
  }).refine(({ runs }) => new Set(runs.map((r) => `${r.projectId}/${r.runId}`)).size === runs.length, {
4771
4777
  message: "duplicate run demand"
4772
4778
  });
4773
4779
  var identity = liveRunDemandSchema.pick({ projectId: true, runId: true });
4774
4780
  var liveRunErrorSchema = identity.extend({
4775
- type: z30.enum(["error", "reset"]),
4776
- status: z30.union([z30.literal(400), z30.literal(404), z30.literal(409), z30.literal(413), z30.literal(503)]),
4777
- error: z30.string()
4781
+ type: z31.enum(["error", "reset"]),
4782
+ status: z31.union([z31.literal(400), z31.literal(404), z31.literal(409), z31.literal(413), z31.literal(503)]),
4783
+ error: z31.string()
4778
4784
  });
4779
4785
  var liveRunBatchSchema = identity.extend({
4780
- type: z30.literal("batch"),
4781
- events: z30.array(runHistoryEventSchema).max(LIVE_EVENT_LIMIT),
4786
+ type: z31.literal("batch"),
4787
+ events: z31.array(runHistoryEventSchema).max(LIVE_EVENT_LIMIT),
4782
4788
  cursor: runHistoryCursorSchema,
4783
- afterSeq: z30.number().int().nonnegative(),
4784
- hasMore: z30.boolean()
4785
- });
4786
- var liveRunBatchResultSchema = z30.union([liveRunBatchSchema, liveRunErrorSchema]);
4787
- var liveRunBatchResponseSchema = z30.object({
4788
- generation: z30.string(),
4789
- results: z30.array(liveRunBatchResultSchema)
4790
- });
4791
- var liveRunFrameSchema = z30.union([
4792
- z30.object({ type: z30.literal("ready"), generation: z30.string() }),
4793
- z30.object({ type: z30.literal("ping") }),
4794
- identity.extend({ type: z30.literal("event"), name: z30.enum(["run-event", "ui-event"]), event: runHistoryEventSchema }),
4789
+ afterSeq: z31.number().int().nonnegative(),
4790
+ hasMore: z31.boolean()
4791
+ });
4792
+ var liveRunBatchResultSchema = z31.union([liveRunBatchSchema, liveRunErrorSchema]);
4793
+ var liveRunBatchResponseSchema = z31.object({
4794
+ generation: z31.string(),
4795
+ results: z31.array(liveRunBatchResultSchema)
4796
+ });
4797
+ var liveRunFrameSchema = z31.union([
4798
+ z31.object({ type: z31.literal("ready"), generation: z31.string() }),
4799
+ z31.object({ type: z31.literal("ping") }),
4800
+ identity.extend({ type: z31.literal("event"), name: z31.enum(["run-event", "ui-event"]), event: runHistoryEventSchema }),
4795
4801
  liveRunErrorSchema
4796
4802
  ]);
4797
4803
 
4798
4804
  // ../contract/src/activity.ts
4799
- import { z as z31 } from "zod";
4805
+ import { z as z32 } from "zod";
4800
4806
  var ACTIVITY_RATE_SECONDS = 30;
4801
4807
  var ACTIVITY_TEXT_MAX = 500;
4802
4808
  var ACTIVITY_ERROR_MAX = 200;
@@ -4804,144 +4810,144 @@ var ACTIVITY_TOOL_TITLE_MAX = 160;
4804
4810
  var ACTIVITY_CHECKS_MAX = 100;
4805
4811
  var ACTIVITY_CHECK_NAME_MAX = 100;
4806
4812
  var ACTIVITY_CLOSED_WINDOW_MS = 3e4;
4807
- var iso = z31.iso.datetime();
4808
- var count = z31.number().int().nonnegative();
4809
- var runId = z31.string().min(1);
4813
+ var iso = z32.iso.datetime();
4814
+ var count = z32.number().int().nonnegative();
4815
+ var runId = z32.string().min(1);
4810
4816
  var ACTIVITY_TOOL_KINDS = ["read", "edit", "delete", "move", "search", "execute", "think", "fetch", "task", "plan", "other"];
4811
- var activityToolSchema = z31.object({
4812
- title: z31.string().max(ACTIVITY_TOOL_TITLE_MAX),
4813
- toolKind: z31.enum(ACTIVITY_TOOL_KINDS),
4814
- status: z31.enum(["pending", "running", "completed", "failed", "declined"]),
4817
+ var activityToolSchema = z32.object({
4818
+ title: z32.string().max(ACTIVITY_TOOL_TITLE_MAX),
4819
+ toolKind: z32.enum(ACTIVITY_TOOL_KINDS),
4820
+ status: z32.enum(["pending", "running", "completed", "failed", "declined"]),
4815
4821
  startedAt: iso,
4816
4822
  endedAt: iso.optional()
4817
4823
  }).strict();
4818
- var activityCheckBucketSchema = z31.enum(["pass", "fail", "pending", "skipping", "cancel"]);
4819
- var activityPrProgressSchema = z31.object({
4820
- checks: z31.array(z31.object({ name: z31.string().max(ACTIVITY_CHECK_NAME_MAX), bucket: activityCheckBucketSchema }).strict()).max(ACTIVITY_CHECKS_MAX),
4821
- counts: z31.object({ pass: count, fail: count, pending: count, skipping: count, cancel: count }).strict(),
4822
- truncated: z31.literal(true).optional()
4824
+ var activityCheckBucketSchema = z32.enum(["pass", "fail", "pending", "skipping", "cancel"]);
4825
+ var activityPrProgressSchema = z32.object({
4826
+ checks: z32.array(z32.object({ name: z32.string().max(ACTIVITY_CHECK_NAME_MAX), bucket: activityCheckBucketSchema }).strict()).max(ACTIVITY_CHECKS_MAX),
4827
+ counts: z32.object({ pass: count, fail: count, pending: count, skipping: count, cancel: count }).strict(),
4828
+ truncated: z32.literal(true).optional()
4823
4829
  }).strict();
4824
- var activityWaitSchema = z31.discriminatedUnion("kind", [
4825
- z31.object({
4826
- kind: z31.literal("human"),
4830
+ var activityWaitSchema = z32.discriminatedUnion("kind", [
4831
+ z32.object({
4832
+ kind: z32.literal("human"),
4827
4833
  since: iso,
4828
- detail: z31.object({
4834
+ detail: z32.object({
4829
4835
  /** The ask card's first question. */
4830
- question: z31.string().max(ACTIVITY_TEXT_MAX).optional(),
4836
+ question: z32.string().max(ACTIVITY_TEXT_MAX).optional(),
4831
4837
  /** `question`: an open question; `turn-end`: Squawk's `no-wait` wait; `budget`: the
4832
4838
  * automatic-wake budget is spent; `completion`: Squawk's completion gate. */
4833
- reason: z31.enum(["question", "turn-end", "budget", "completion"]),
4839
+ reason: z32.enum(["question", "turn-end", "budget", "completion"]),
4834
4840
  /** Inputs not delivered yet, when there are any. */
4835
- queuedMessages: z31.number().int().positive().optional()
4841
+ queuedMessages: z32.number().int().positive().optional()
4836
4842
  }).strict()
4837
4843
  }).strict(),
4838
- z31.object({ kind: z31.literal("usage-limit"), detail: z31.object({ resumeAt: z31.string() }).strict() }).strict(),
4839
- z31.object({
4840
- kind: z31.literal("workers"),
4844
+ z32.object({ kind: z32.literal("usage-limit"), detail: z32.object({ resumeAt: z32.string() }).strict() }).strict(),
4845
+ z32.object({
4846
+ kind: z32.literal("workers"),
4841
4847
  since: iso,
4842
4848
  deadline: iso.optional(),
4843
- detail: z31.object({
4849
+ detail: z32.object({
4844
4850
  /** `computeWaitingOn`'s count: the unanswered targets, summed over the entries. */
4845
4851
  owed: count,
4846
4852
  /** Targets named and targets settled, summed over the entries. */
4847
4853
  total: count,
4848
4854
  settled: count,
4849
4855
  /** Every open entry waits on request replies. */
4850
- replies: z31.literal(true).optional(),
4856
+ replies: z32.literal(true).optional(),
4851
4857
  /** Only when one entry is open. */
4852
4858
  mode: workerWaitModeSchema.optional(),
4853
4859
  /** Who owes the awaited replies, each once. */
4854
- recipientRunIds: z31.array(runId)
4860
+ recipientRunIds: z32.array(runId)
4855
4861
  }).strict()
4856
4862
  }).strict(),
4857
- z31.object({ kind: z31.literal("peers"), since: iso, deadline: iso, detail: z31.object({ peerRunIds: z31.array(runId) }).strict() }).strict(),
4858
- z31.object({ kind: z31.literal("subagents"), since: iso, deadline: iso, detail: z31.object({ running: count }).strict() }).strict(),
4859
- z31.object({
4860
- kind: z31.literal("pr"),
4863
+ z32.object({ kind: z32.literal("peers"), since: iso, deadline: iso, detail: z32.object({ peerRunIds: z32.array(runId) }).strict() }).strict(),
4864
+ z32.object({ kind: z32.literal("subagents"), since: iso, deadline: iso, detail: z32.object({ running: count }).strict() }).strict(),
4865
+ z32.object({
4866
+ kind: z32.literal("pr"),
4861
4867
  since: iso,
4862
4868
  deadline: iso,
4863
- detail: z31.object({
4864
- number: z31.number().int().positive(),
4869
+ detail: z32.object({
4870
+ number: z32.number().int().positive(),
4865
4871
  target: prWaitUntilSchema,
4866
4872
  /** Check progress, while the CI progress registry holds some for this wait. */
4867
4873
  checks: activityPrProgressSchema.shape.checks.optional(),
4868
4874
  counts: activityPrProgressSchema.shape.counts.optional(),
4869
- truncated: z31.literal(true).optional()
4875
+ truncated: z32.literal(true).optional()
4870
4876
  }).strict()
4871
4877
  }).strict(),
4872
- z31.object({ kind: z31.literal("process"), since: iso, deadline: iso, detail: z31.object({ pid: z31.number().int(), note: z31.string().optional() }).strict() }).strict(),
4873
- z31.object({ kind: z31.literal("timer"), since: iso, deadline: iso, detail: z31.object({ wakeAt: iso, note: z31.string().optional() }).strict() }).strict()
4878
+ z32.object({ kind: z32.literal("process"), since: iso, deadline: iso, detail: z32.object({ pid: z32.number().int(), note: z32.string().optional() }).strict() }).strict(),
4879
+ z32.object({ kind: z32.literal("timer"), since: iso, deadline: iso, detail: z32.object({ wakeAt: iso, note: z32.string().optional() }).strict() }).strict()
4874
4880
  ]);
4875
4881
  var activityRunShape = {
4876
4882
  runId,
4877
4883
  /** The display title: `titleSummary ?? title`. */
4878
- title: z31.string(),
4884
+ title: z32.string(),
4879
4885
  status: runStatusSchema,
4880
4886
  /** The `deriveAttention` rung id, never a label. */
4881
- rung: z31.enum(ATTENTION_RUNGS),
4887
+ rung: z32.enum(ATTENTION_RUNGS),
4882
4888
  runner: runnerSchema.optional(),
4883
- model: z31.string().optional(),
4884
- currentStepId: z31.string().optional(),
4885
- startedAt: z31.string().optional(),
4889
+ model: z32.string().optional(),
4890
+ currentStepId: z32.string().optional(),
4891
+ startedAt: z32.string().optional(),
4886
4892
  wait: activityWaitSchema.optional(),
4887
4893
  tool: activityToolSchema.optional(),
4888
4894
  /** Tool calls started per second, oldest first. */
4889
- rate: z31.array(count).length(ACTIVITY_RATE_SECONDS),
4895
+ rate: z32.array(count).length(ACTIVITY_RATE_SECONDS),
4890
4896
  /** One line of `RunRecord.error`. */
4891
- error: z31.string().max(ACTIVITY_ERROR_MAX).optional()
4897
+ error: z32.string().max(ACTIVITY_ERROR_MAX).optional()
4892
4898
  };
4893
- var activityWorkerSchema = z31.object({
4899
+ var activityWorkerSchema = z32.object({
4894
4900
  ...activityRunShape,
4895
4901
  /** The worker's current execution revision. */
4896
4902
  revision: count,
4897
4903
  /** The parent holds a collected result for this revision. */
4898
- collected: z31.boolean()
4904
+ collected: z32.boolean()
4899
4905
  }).strict();
4900
- var activityRunSchema = z31.object({ ...activityRunShape, workers: z31.array(activityWorkerSchema) }).strict();
4901
- var activityRequestSchema = z31.object({
4902
- requestId: z31.uuid(),
4903
- relationship: z31.enum(["family", "peer"]),
4906
+ var activityRunSchema = z32.object({ ...activityRunShape, workers: z32.array(activityWorkerSchema) }).strict();
4907
+ var activityRequestSchema = z32.object({
4908
+ requestId: z32.uuid(),
4909
+ relationship: z32.enum(["family", "peer"]),
4904
4910
  senderRunId: runId,
4905
4911
  recipientRunId: runId,
4906
- text: z31.string().max(ACTIVITY_TEXT_MAX),
4907
- senderTitle: z31.string().optional(),
4908
- recipientTitle: z31.string().optional(),
4912
+ text: z32.string().max(ACTIVITY_TEXT_MAX),
4913
+ senderTitle: z32.string().optional(),
4914
+ recipientTitle: z32.string().optional(),
4909
4915
  createdAt: iso,
4910
4916
  deadline: iso.optional()
4911
4917
  }).strict();
4912
- var activityClosedRequestSchema = z31.object({
4913
- requestId: z31.uuid(),
4918
+ var activityClosedRequestSchema = z32.object({
4919
+ requestId: z32.uuid(),
4914
4920
  senderRunId: runId,
4915
4921
  recipientRunId: runId,
4916
4922
  status: requestOutcomeSchema.shape.status,
4917
4923
  observedAt: iso
4918
4924
  }).strict();
4919
- var activityProjectSchema = z31.object({
4920
- projectId: z31.string(),
4921
- name: z31.string(),
4925
+ var activityProjectSchema = z32.object({
4926
+ projectId: z32.string(),
4927
+ name: z32.string(),
4922
4928
  /** False for a project this process has not loaded: its lists are empty because nothing was read. */
4923
- loaded: z31.boolean(),
4929
+ loaded: z32.boolean(),
4924
4930
  /** The project is loaded but its run store cannot open: the failure its project routes answer.
4925
4931
  * The lists are empty because nothing could be read, not because nothing runs. */
4926
- unavailable: z31.object({ status: z31.union([z31.literal(404), z31.literal(409), z31.literal(503)]), error: z31.string() }).strict().optional(),
4932
+ unavailable: z32.object({ status: z32.union([z32.literal(404), z32.literal(409), z32.literal(503)]), error: z32.string() }).strict().optional(),
4927
4933
  /** Root tasks in review: the summary chip (D8). */
4928
4934
  inReview: count,
4929
- tasks: z31.array(activityRunSchema),
4930
- requests: z31.array(activityRequestSchema),
4931
- closed: z31.array(activityClosedRequestSchema)
4935
+ tasks: z32.array(activityRunSchema),
4936
+ requests: z32.array(activityRequestSchema),
4937
+ closed: z32.array(activityClosedRequestSchema)
4932
4938
  }).strict();
4933
- var activitySnapshotSchema = z31.object({
4939
+ var activitySnapshotSchema = z32.object({
4934
4940
  /** The server clock; the client ticks ages from it. */
4935
4941
  generatedAt: iso,
4936
4942
  /** One entry, or every visible project for the global read. */
4937
- projects: z31.array(activityProjectSchema)
4943
+ projects: z32.array(activityProjectSchema)
4938
4944
  }).strict();
4939
- var activityQuerySchema = z31.object({
4940
- project: z31.union([z31.literal("default"), z31.string().regex(PROJECT_ID_PATTERN)]).optional()
4945
+ var activityQuerySchema = z32.object({
4946
+ project: z32.union([z32.literal("default"), z32.string().regex(PROJECT_ID_PATTERN)]).optional()
4941
4947
  });
4942
4948
 
4943
4949
  // ../contract/src/live-coordination.ts
4944
- import { z as z32 } from "zod";
4950
+ import { z as z33 } from "zod";
4945
4951
  var LIVE_PROTOCOL = 3;
4946
4952
  var LIVE_WORKER_NAME = "cezar-live-v3";
4947
4953
  var LEASE_MS = 15e3;
@@ -4950,111 +4956,111 @@ function allowedLiveRead(path) {
4950
4956
  if (!path.startsWith("/api/v1/") || path.includes("#") || /[\\\r\n]/.test(path)) return false;
4951
4957
  return /^\/api\/v1\/(?:workspace\/(?:runs-index|activity)|p\/[a-zA-Z0-9_-]+\/(?:reports\/state|runs\/[a-zA-Z0-9._-]+\/(?:changes|commits)|github(?:\/(?:checks|ref-status))?))(?:\?[^#]*)?$/.test(path);
4952
4958
  }
4953
- var liveDemandSchema = z32.discriminatedUnion("kind", [
4954
- z32.object({ kind: z32.literal("workspace") }),
4955
- liveRunDemandSchema.extend({ kind: z32.literal("run") }),
4956
- z32.object({ kind: z32.literal("topic"), topic: z32.string().min(1).max(128) }),
4959
+ var liveDemandSchema = z33.discriminatedUnion("kind", [
4960
+ z33.object({ kind: z33.literal("workspace") }),
4961
+ liveRunDemandSchema.extend({ kind: z33.literal("run") }),
4962
+ z33.object({ kind: z33.literal("topic"), topic: z33.string().min(1).max(128) }),
4957
4963
  // Preserve server-directed cadence (settled references use ten minutes). Only
4958
4964
  // bound the timer itself: larger delays overflow setTimeout into a tight loop.
4959
- z32.object({ kind: z32.literal("read"), path: z32.string().max(4096).refine(allowedLiveRead), intervalMs: z32.number().int().min(1e3).max(2147483647) })
4965
+ z33.object({ kind: z33.literal("read"), path: z33.string().max(4096).refine(allowedLiveRead), intervalMs: z33.number().int().min(1e3).max(2147483647) })
4960
4966
  ]);
4961
- var liveEntrySchema = z32.object({ id: z32.string().min(1).max(128), demand: liveDemandSchema });
4962
- var envelope = z32.object({ version: z32.literal(LIVE_PROTOCOL), documentId: z32.string().min(1).max(128), epoch: z32.number().int().nonnegative() });
4963
- var ownerInputSchema = z32.discriminatedUnion("type", [
4967
+ var liveEntrySchema = z33.object({ id: z33.string().min(1).max(128), demand: liveDemandSchema });
4968
+ var envelope = z33.object({ version: z33.literal(LIVE_PROTOCOL), documentId: z33.string().min(1).max(128), epoch: z33.number().int().nonnegative() });
4969
+ var ownerInputSchema = z33.discriminatedUnion("type", [
4964
4970
  envelope.extend({
4965
- type: z32.literal("sync"),
4966
- entries: z32.array(liveEntrySchema).max(64),
4971
+ type: z33.literal("sync"),
4972
+ entries: z33.array(liveEntrySchema).max(64),
4967
4973
  /** The document knows no workspace stream generation (its `ready` was lost, for example to
4968
4974
  * an epoch change): send it the stream's `ready` again (hearsay-tools/cezarion#2729). */
4969
- workspaceReady: z32.literal(true).optional()
4975
+ workspaceReady: z33.literal(true).optional()
4970
4976
  }).refine((value) => new Set(value.entries.map((e) => e.id)).size === value.entries.length),
4971
- envelope.extend({ type: z32.literal("ack"), id: z32.string(), seq: z32.number().int().nonnegative() }),
4972
- envelope.extend({ type: z32.literal("refresh"), id: z32.string() })
4977
+ envelope.extend({ type: z33.literal("ack"), id: z33.string(), seq: z33.number().int().nonnegative() }),
4978
+ envelope.extend({ type: z33.literal("refresh"), id: z33.string() })
4973
4979
  ]);
4974
- var wireFrameSchema = z32.object({ event: z32.string(), data: z32.string(), id: z32.string() });
4975
- var ownerOutputSchema = z32.discriminatedUnion("type", [
4976
- z32.object({ type: z32.literal("unavailable"), version: z32.literal(LIVE_PROTOCOL), epoch: z32.number(), reason: z32.string() }),
4977
- z32.object({ type: z32.literal("hello"), version: z32.literal(LIVE_PROTOCOL) }),
4978
- z32.object({ type: z32.literal("alive"), version: z32.literal(LIVE_PROTOCOL), epoch: z32.number() }),
4979
- z32.object({ type: z32.literal("frame"), version: z32.literal(LIVE_PROTOCOL), epoch: z32.number(), id: z32.string(), frame: z32.union([wireFrameSchema, liveRunFrameSchema]) }),
4980
- z32.object({ type: z32.literal("value"), version: z32.literal(LIVE_PROTOCOL), epoch: z32.number(), id: z32.string(), value: z32.unknown(), error: z32.string().optional() }),
4981
- z32.object({ type: z32.literal("reset"), version: z32.literal(LIVE_PROTOCOL), epoch: z32.number(), id: z32.string(), reason: z32.string() })
4980
+ var wireFrameSchema = z33.object({ event: z33.string(), data: z33.string(), id: z33.string() });
4981
+ var ownerOutputSchema = z33.discriminatedUnion("type", [
4982
+ z33.object({ type: z33.literal("unavailable"), version: z33.literal(LIVE_PROTOCOL), epoch: z33.number(), reason: z33.string() }),
4983
+ z33.object({ type: z33.literal("hello"), version: z33.literal(LIVE_PROTOCOL) }),
4984
+ z33.object({ type: z33.literal("alive"), version: z33.literal(LIVE_PROTOCOL), epoch: z33.number() }),
4985
+ z33.object({ type: z33.literal("frame"), version: z33.literal(LIVE_PROTOCOL), epoch: z33.number(), id: z33.string(), frame: z33.union([wireFrameSchema, liveRunFrameSchema]) }),
4986
+ z33.object({ type: z33.literal("value"), version: z33.literal(LIVE_PROTOCOL), epoch: z33.number(), id: z33.string(), value: z33.unknown(), error: z33.string().optional() }),
4987
+ z33.object({ type: z33.literal("reset"), version: z33.literal(LIVE_PROTOCOL), epoch: z33.number(), id: z33.string(), reason: z33.string() })
4982
4988
  ]);
4983
4989
  var runKey = (run) => `${run.projectId}/${run.runId}`;
4984
4990
 
4985
4991
  // ../contract/src/workspace-events.ts
4986
- import { z as z33 } from "zod";
4987
- var workspaceEventsQuerySchema = z33.object({
4988
- runs: z33.literal("summary").optional()
4992
+ import { z as z34 } from "zod";
4993
+ var workspaceEventsQuerySchema = z34.object({
4994
+ runs: z34.literal("summary").optional()
4989
4995
  });
4990
- var projectStamp = z33.string().min(1);
4991
- var frameSeq = z33.number().int().positive();
4992
- var workspaceRunSummaryEventSchema = z33.object({
4996
+ var projectStamp = z34.string().min(1);
4997
+ var frameSeq = z34.number().int().positive();
4998
+ var workspaceRunSummaryEventSchema = z34.object({
4993
4999
  project: projectStamp,
4994
5000
  seq: frameSeq,
4995
5001
  run: runSummarySchema,
4996
- relationships: z33.string().min(1)
5002
+ relationships: z34.string().min(1)
4997
5003
  });
4998
- var workspaceRunDeletedEventSchema = z33.object({
5004
+ var workspaceRunDeletedEventSchema = z34.object({
4999
5005
  project: projectStamp,
5000
5006
  seq: frameSeq,
5001
- id: z33.string().min(1)
5007
+ id: z34.string().min(1)
5002
5008
  });
5003
- var workspaceReadyEventSchema = z33.object({
5004
- generation: z33.string().min(1),
5005
- seq: z33.number().int().nonnegative()
5009
+ var workspaceReadyEventSchema = z34.object({
5010
+ generation: z34.string().min(1),
5011
+ seq: z34.number().int().nonnegative()
5006
5012
  });
5007
- var workspaceUsageEventSchema = z33.object({
5013
+ var workspaceUsageEventSchema = z34.object({
5008
5014
  project: projectStamp,
5009
- usage: z33.record(z33.string(), processUsageSchema)
5015
+ usage: z34.record(z34.string(), processUsageSchema)
5010
5016
  });
5011
- var runsIndexResponseSchema = z33.object({
5017
+ var runsIndexResponseSchema = z34.object({
5012
5018
  /** Newest first, across every registered project: each project's window
5013
5019
  * (hearsay-tools/cezarion#864) — every unarchived root run, plus its newest `perProjectLimit`
5014
5020
  * archived root runs. Owned workers are never included. Older archived runs are reached
5015
5021
  * through `GET /workspace/runs-search`. */
5016
- runs: z33.array(runIndexEntrySchema),
5022
+ runs: z34.array(runIndexEntrySchema),
5017
5023
  /** Additive: absent statuses mean "nothing warm", never "nothing to show". */
5018
5024
  referenceStatuses: referenceStatusesByProjectSchema,
5019
5025
  /** How many archived root runs each project contributes at most. Unarchived roots are never cut. */
5020
- perProjectLimit: z33.number(),
5026
+ perProjectLimit: z34.number(),
5021
5027
  /** Ids of the projects that had more archived root runs than `perProjectLimit`. */
5022
- truncated: z33.array(z33.string()),
5028
+ truncated: z34.array(z34.string()),
5023
5029
  /** The server process that answered: the workspace stream's `ready.generation`. An `eventSeq`
5024
5030
  * compares only within one generation. */
5025
- generation: z33.string().min(1),
5031
+ generation: z34.string().min(1),
5026
5032
  /** The last workspace stream `seq` this answer includes: every `run-summary` and `run-deleted`
5027
5033
  * frame at or below it is already in `runs`; a frame above it is newer than the snapshot. */
5028
- eventSeq: z33.number().int().nonnegative()
5034
+ eventSeq: z34.number().int().nonnegative()
5029
5035
  });
5030
5036
 
5031
5037
  // ../contract/src/permissions.ts
5032
- import { z as z34 } from "zod";
5033
- var permissionOptionKindSchema = z34.enum(["allow_once", "allow_always", "reject_once", "reject_always"]);
5034
- var permissionOptionSchema = z34.object({
5035
- id: z34.string().min(1).max(128),
5036
- label: z34.string().min(1),
5038
+ import { z as z35 } from "zod";
5039
+ var permissionOptionKindSchema = z35.enum(["allow_once", "allow_always", "reject_once", "reject_always"]);
5040
+ var permissionOptionSchema = z35.object({
5041
+ id: z35.string().min(1).max(128),
5042
+ label: z35.string().min(1),
5037
5043
  kind: permissionOptionKindSchema
5038
5044
  }).strict();
5039
- var permissionRequestedSchema = z34.object({
5040
- type: z34.literal("permission.requested"),
5041
- requestId: z34.string().min(1).max(128),
5042
- itemId: z34.string().optional(),
5043
- title: z34.string().min(1),
5044
- details: z34.string().optional(),
5045
- options: z34.array(permissionOptionSchema).min(1).refine((options) => new Set(options.map((option) => option.id)).size === options.length)
5045
+ var permissionRequestedSchema = z35.object({
5046
+ type: z35.literal("permission.requested"),
5047
+ requestId: z35.string().min(1).max(128),
5048
+ itemId: z35.string().optional(),
5049
+ title: z35.string().min(1),
5050
+ details: z35.string().optional(),
5051
+ options: z35.array(permissionOptionSchema).min(1).refine((options) => new Set(options.map((option) => option.id)).size === options.length)
5046
5052
  }).strict();
5047
- var permissionResolvedSchema = z34.object({
5048
- type: z34.literal("permission.resolved"),
5049
- requestId: z34.string().min(1).max(128),
5050
- optionId: z34.string().optional(),
5051
- reason: z34.string().optional()
5053
+ var permissionResolvedSchema = z35.object({
5054
+ type: z35.literal("permission.resolved"),
5055
+ requestId: z35.string().min(1).max(128),
5056
+ optionId: z35.string().optional(),
5057
+ reason: z35.string().optional()
5052
5058
  }).strict();
5053
- var permissionDecisionSchema = z34.object({
5054
- requestId: z34.string().min(1).max(128),
5055
- optionId: z34.string().min(1).max(128)
5059
+ var permissionDecisionSchema = z35.object({
5060
+ requestId: z35.string().min(1).max(128),
5061
+ optionId: z35.string().min(1).max(128)
5056
5062
  }).strict();
5057
- var permissionDecisionResponseSchema = z34.object({ delivered: z34.literal(true) });
5063
+ var permissionDecisionResponseSchema = z35.object({ delivered: z35.literal(true) });
5058
5064
 
5059
5065
  // ../contract/src/defined.ts
5060
5066
  function defined(value) {
@@ -5324,80 +5330,80 @@ function isImagePath(path) {
5324
5330
  }
5325
5331
 
5326
5332
  // ../contract/src/provider-requests.ts
5327
- import { z as z35 } from "zod";
5333
+ import { z as z36 } from "zod";
5328
5334
  var PROVIDER_IDS = runnerSchema.options;
5329
- var providerConnectSchema = z35.object({
5330
- provider: z35.enum(PROVIDER_IDS),
5335
+ var providerConnectSchema = z36.object({
5336
+ provider: z36.enum(PROVIDER_IDS),
5331
5337
  /** Which agent account to sign in (spec 2026-07-29-agent-profiles). Absent = the discovered
5332
5338
  * default, which is what every pre-profiles client sends. Without this, "Connect" on a second
5333
5339
  * Claude account would open a login for the FIRST one and report success. */
5334
- profileId: z35.string().max(64).optional()
5340
+ profileId: z36.string().max(64).optional()
5335
5341
  }).strict();
5336
- var createAgentProfileSchema = z35.object({
5337
- provider: z35.enum(PROVIDER_IDS),
5338
- label: z35.string().trim().max(200).optional(),
5339
- configDir: z35.string().trim().min(1).max(4096)
5342
+ var createAgentProfileSchema = z36.object({
5343
+ provider: z36.enum(PROVIDER_IDS),
5344
+ label: z36.string().trim().max(200).optional(),
5345
+ configDir: z36.string().trim().min(1).max(4096)
5340
5346
  }).strict();
5341
- var updateAgentProfileSchema = z35.object({
5342
- label: z35.string().trim().max(200).optional(),
5343
- configDir: z35.string().trim().min(1).max(4096).optional()
5347
+ var updateAgentProfileSchema = z36.object({
5348
+ label: z36.string().trim().max(200).optional(),
5349
+ configDir: z36.string().trim().min(1).max(4096).optional()
5344
5350
  }).strict().refine(
5345
5351
  (value) => value.label !== void 0 || value.configDir !== void 0,
5346
5352
  "send label or configDir"
5347
5353
  );
5348
- var selectAgentProfileSchema = z35.object({
5349
- projectId: z35.string().min(1).max(64),
5350
- provider: z35.enum(PROVIDER_IDS),
5351
- profileId: z35.string().max(64).nullable()
5354
+ var selectAgentProfileSchema = z36.object({
5355
+ projectId: z36.string().min(1).max(64),
5356
+ provider: z36.enum(PROVIDER_IDS),
5357
+ profileId: z36.string().max(64).nullable()
5352
5358
  }).strict();
5353
- var providerParamSchema = z35.enum(PROVIDER_IDS);
5354
- var providerEnabledSchema = z35.object({ enabled: z35.boolean() }).strict();
5355
- var providerRetrySchema = z35.object({
5356
- authFailureId: z35.string().min(1).max(128)
5359
+ var providerParamSchema = z36.enum(PROVIDER_IDS);
5360
+ var providerEnabledSchema = z36.object({ enabled: z36.boolean() }).strict();
5361
+ var providerRetrySchema = z36.object({
5362
+ authFailureId: z36.string().min(1).max(128)
5357
5363
  }).strict();
5358
- var providerRouteParamsSchema = z35.object({ provider: providerParamSchema });
5359
- var agentProfileRouteParamsSchema = z35.object({ id: z35.string() });
5364
+ var providerRouteParamsSchema = z36.object({ provider: providerParamSchema });
5365
+ var agentProfileRouteParamsSchema = z36.object({ id: z36.string() });
5360
5366
 
5361
5367
  // ../contract/src/automation-requests.ts
5362
- import { z as z37 } from "zod";
5368
+ import { z as z38 } from "zod";
5363
5369
 
5364
5370
  // ../contract/src/automation-storage.ts
5365
- import { z as z36 } from "zod";
5371
+ import { z as z37 } from "zod";
5366
5372
  var RUNNER_IDS = runnerSchema.options;
5367
- var storedAutomationEventSchema = z36.enum([
5373
+ var storedAutomationEventSchema = z37.enum([
5368
5374
  "pull_request.opened",
5369
5375
  "issue.opened",
5370
5376
  "issue.labeled",
5371
5377
  "issue.unlabeled"
5372
5378
  ]);
5373
- var boundedString = z36.string().trim().min(1).max(200);
5374
- var stringList = z36.array(boundedString).max(100).optional();
5375
- var storedAutomationFiltersSchema = z36.object({
5376
- includeExisting: z36.boolean().optional(),
5379
+ var boundedString = z37.string().trim().min(1).max(200);
5380
+ var stringList = z37.array(boundedString).max(100).optional();
5381
+ var storedAutomationFiltersSchema = z37.object({
5382
+ includeExisting: z37.boolean().optional(),
5377
5383
  /** Require an open item and matching live labels before reservation and launch. */
5378
- requireCurrentLabels: z36.boolean().optional(),
5384
+ requireCurrentLabels: z37.boolean().optional(),
5379
5385
  authors: stringList,
5380
5386
  assignees: stringList,
5381
5387
  allLabels: stringList,
5382
5388
  anyLabels: stringList,
5383
5389
  excludeLabels: stringList,
5384
5390
  changedLabels: stringList,
5385
- lookbackDays: z36.number().int().min(1).max(90).default(7),
5386
- maxRecords: z36.number().int().min(1).max(100).default(25)
5391
+ lookbackDays: z37.number().int().min(1).max(90).default(7),
5392
+ maxRecords: z37.number().int().min(1).max(100).default(25)
5387
5393
  }).passthrough();
5388
- var storedAutomationTaskSchema = z36.object({
5389
- prompt: z36.string().min(1).max(1e5),
5390
- workflow: z36.string().trim().min(1).max(200).optional(),
5391
- steps: z36.array(workflowStepDefSchema).min(1).max(100).optional(),
5392
- runner: z36.enum(RUNNER_IDS).optional(),
5393
- model: z36.string().trim().min(1).max(200).optional(),
5394
- effort: z36.string().trim().min(1).max(32).optional(),
5395
- variants: z36.union([z36.literal(1), z36.literal(2), z36.literal(3)]).optional(),
5396
- worktree: z36.boolean().optional(),
5397
- autonomous: z36.boolean().optional(),
5394
+ var storedAutomationTaskSchema = z37.object({
5395
+ prompt: z37.string().min(1).max(1e5),
5396
+ workflow: z37.string().trim().min(1).max(200).optional(),
5397
+ steps: z37.array(workflowStepDefSchema).min(1).max(100).optional(),
5398
+ runner: z37.enum(RUNNER_IDS).optional(),
5399
+ model: z37.string().trim().min(1).max(200).optional(),
5400
+ effort: z37.string().trim().min(1).max(32).optional(),
5401
+ variants: z37.union([z37.literal(1), z37.literal(2), z37.literal(3)]).optional(),
5402
+ worktree: z37.boolean().optional(),
5403
+ autonomous: z37.boolean().optional(),
5398
5404
  ...completionControlsShape,
5399
5405
  ...taskAccessShape,
5400
- systemPrompt: z36.string().max(1e5).optional()
5406
+ systemPrompt: z37.string().max(1e5).optional()
5401
5407
  }).passthrough().refine((task) => !(task.workflow && task.steps), {
5402
5408
  message: "task selects either a named workflow or inline steps, not both"
5403
5409
  });
@@ -5411,122 +5417,122 @@ var fillGithubDefaults = (raw) => {
5411
5417
  filters: record.filters ?? {}
5412
5418
  };
5413
5419
  };
5414
- var storedAutomationDefinitionObjectSchema = z36.object({
5415
- id: z36.string().min(1).max(100),
5416
- revision: z36.number().int().positive(),
5417
- name: z36.string().trim().min(1).max(200),
5418
- description: z36.string().max(2e3).optional(),
5419
- enabled: z36.boolean().default(false),
5420
+ var storedAutomationDefinitionObjectSchema = z37.object({
5421
+ id: z37.string().min(1).max(100),
5422
+ revision: z37.number().int().positive(),
5423
+ name: z37.string().trim().min(1).max(200),
5424
+ description: z37.string().max(2e3).optional(),
5425
+ enabled: z37.boolean().default(false),
5420
5426
  /** A definition written before schedules has no `kind`: it is a poll. */
5421
5427
  kind: automationKindSchema.default("github"),
5422
- events: z36.array(storedAutomationEventSchema).min(1).max(4).optional(),
5423
- intervalSeconds: z36.number().int().min(60).max(86400).optional(),
5428
+ events: z37.array(storedAutomationEventSchema).min(1).max(4).optional(),
5429
+ intervalSeconds: z37.number().int().min(60).max(86400).optional(),
5424
5430
  filters: storedAutomationFiltersSchema.optional(),
5425
5431
  // Passthrough like every other persisted layer: a schedule key a later build adds survives a save here.
5426
5432
  schedule: automationScheduleSchema.passthrough().optional(),
5427
5433
  task: storedAutomationTaskSchema,
5428
5434
  /** `once` schedules only (hearsay-tools/cezarion#1465): the archive record. */
5429
- archived: z36.object({
5430
- at: z36.string().datetime(),
5431
- outcome: z36.enum(["launched", "cancelled"]),
5432
- runId: z36.string().optional(),
5433
- receiptId: z36.string().optional(),
5434
- trigger: z36.enum(["schedule", "late", "manual", "retry"]).optional()
5435
+ archived: z37.object({
5436
+ at: z37.string().datetime(),
5437
+ outcome: z37.enum(["launched", "cancelled"]),
5438
+ runId: z37.string().optional(),
5439
+ receiptId: z37.string().optional(),
5440
+ trigger: z37.enum(["schedule", "late", "manual", "retry"]).optional()
5435
5441
  }).passthrough().optional(),
5436
- createdAt: z36.string().datetime(),
5437
- updatedAt: z36.string().datetime()
5442
+ createdAt: z37.string().datetime(),
5443
+ updatedAt: z37.string().datetime()
5438
5444
  }).passthrough().superRefine((definition, ctx) => {
5439
5445
  if (definition.kind === "schedule") {
5440
5446
  if (!definition.schedule) {
5441
- ctx.addIssue({ code: z36.ZodIssueCode.custom, path: ["schedule"], message: "a scheduled automation needs a schedule" });
5447
+ ctx.addIssue({ code: z37.ZodIssueCode.custom, path: ["schedule"], message: "a scheduled automation needs a schedule" });
5442
5448
  }
5443
5449
  return;
5444
5450
  }
5445
5451
  if (!definition.events?.length) {
5446
- ctx.addIssue({ code: z36.ZodIssueCode.custom, path: ["events"], message: "a GitHub automation needs at least one event" });
5452
+ ctx.addIssue({ code: z37.ZodIssueCode.custom, path: ["events"], message: "a GitHub automation needs at least one event" });
5447
5453
  }
5448
5454
  if (definition.intervalSeconds === void 0) {
5449
- ctx.addIssue({ code: z36.ZodIssueCode.custom, path: ["intervalSeconds"], message: "a GitHub automation needs a poll interval" });
5455
+ ctx.addIssue({ code: z37.ZodIssueCode.custom, path: ["intervalSeconds"], message: "a GitHub automation needs a poll interval" });
5450
5456
  }
5451
5457
  if (!definition.filters) {
5452
- ctx.addIssue({ code: z36.ZodIssueCode.custom, path: ["filters"], message: "a GitHub automation needs its bounded filter" });
5458
+ ctx.addIssue({ code: z37.ZodIssueCode.custom, path: ["filters"], message: "a GitHub automation needs its bounded filter" });
5453
5459
  }
5454
5460
  if (definition.events?.some((event) => event === "issue.labeled" || event === "issue.unlabeled") && !definition.filters?.changedLabels?.length) {
5455
5461
  ctx.addIssue({
5456
- code: z36.ZodIssueCode.custom,
5462
+ code: z37.ZodIssueCode.custom,
5457
5463
  path: ["filters", "changedLabels"],
5458
5464
  message: "changedLabels is required for issue label events"
5459
5465
  });
5460
5466
  }
5461
5467
  });
5462
- var storedAutomationDefinitionSchema = z36.preprocess(fillGithubDefaults, storedAutomationDefinitionObjectSchema);
5463
- var storedAutomationDefinitionsFileSchema = z36.object({
5464
- version: z36.literal(1).default(1),
5465
- automations: z36.array(z36.unknown()).default([]),
5466
- tombstones: z36.record(z36.string(), z36.string().datetime()).optional()
5468
+ var storedAutomationDefinitionSchema = z37.preprocess(fillGithubDefaults, storedAutomationDefinitionObjectSchema);
5469
+ var storedAutomationDefinitionsFileSchema = z37.object({
5470
+ version: z37.literal(1).default(1),
5471
+ automations: z37.array(z37.unknown()).default([]),
5472
+ tombstones: z37.record(z37.string(), z37.string().datetime()).optional()
5467
5473
  }).passthrough();
5468
- var storedAutomationCursorSchema = z36.object({
5469
- timestamp: z36.string().datetime(),
5470
- tieBreaker: z36.string().optional()
5474
+ var storedAutomationCursorSchema = z37.object({
5475
+ timestamp: z37.string().datetime(),
5476
+ tieBreaker: z37.string().optional()
5471
5477
  }).passthrough();
5472
5478
  var storedAutomationHistoryScanSchema = automationHistoryScanSchema.extend({
5473
5479
  cursor: storedAutomationCursorSchema.optional()
5474
5480
  });
5475
- var storedAutomationRuntimeStateSchema = z36.object({
5476
- revision: z36.number().int().positive().optional(),
5477
- baselineAt: z36.string().datetime().optional(),
5481
+ var storedAutomationRuntimeStateSchema = z37.object({
5482
+ revision: z37.number().int().positive().optional(),
5483
+ baselineAt: z37.string().datetime().optional(),
5478
5484
  /** Arming time, independent of a history window's older lower bound. */
5479
- armedAt: z36.string().datetime().optional(),
5485
+ armedAt: z37.string().datetime().optional(),
5480
5486
  historyScan: storedAutomationHistoryScanSchema.optional(),
5481
5487
  cursor: storedAutomationCursorSchema.optional(),
5482
- frozenHighWatermark: storedAutomationCursorSchema.extend({ tieBreaker: z36.string() }).optional(),
5483
- backlogAfter: storedAutomationCursorSchema.extend({ tieBreaker: z36.string() }).optional(),
5484
- nextCheckAt: z36.string().datetime().optional(),
5485
- lastSuccessAt: z36.string().datetime().optional(),
5488
+ frozenHighWatermark: storedAutomationCursorSchema.extend({ tieBreaker: z37.string() }).optional(),
5489
+ backlogAfter: storedAutomationCursorSchema.extend({ tieBreaker: z37.string() }).optional(),
5490
+ nextCheckAt: z37.string().datetime().optional(),
5491
+ lastSuccessAt: z37.string().datetime().optional(),
5486
5492
  /** schedule kind: the next occurrence's instant and the last fired one's. */
5487
- nextRunAt: z36.string().datetime().optional(),
5488
- lastRunAt: z36.string().datetime().optional(),
5489
- etags: z36.record(z36.string(), z36.string()).optional(),
5490
- backoffUntil: z36.string().datetime().optional(),
5491
- consecutiveFailures: z36.number().int().nonnegative().optional(),
5493
+ nextRunAt: z37.string().datetime().optional(),
5494
+ lastRunAt: z37.string().datetime().optional(),
5495
+ etags: z37.record(z37.string(), z37.string()).optional(),
5496
+ backoffUntil: z37.string().datetime().optional(),
5497
+ consecutiveFailures: z37.number().int().nonnegative().optional(),
5492
5498
  ...automationLastErrorShape,
5493
5499
  /** once schedule: it stopped without a task — the launch failed, or it started past its cutoff. */
5494
- onceOutcome: z36.enum(["failed", "missed"]).optional()
5500
+ onceOutcome: z37.enum(["failed", "missed"]).optional()
5495
5501
  }).passthrough();
5496
- var storedAutomationStateFileSchema = z36.object({
5497
- version: z36.literal(1).default(1),
5498
- states: z36.record(z36.string(), storedAutomationRuntimeStateSchema).default({})
5502
+ var storedAutomationStateFileSchema = z37.object({
5503
+ version: z37.literal(1).default(1),
5504
+ states: z37.record(z37.string(), storedAutomationRuntimeStateSchema).default({})
5499
5505
  }).passthrough();
5500
- var storedAutomationReceiptSchema = z36.object({
5501
- receiptId: z36.string().min(1),
5502
- receiptKey: z36.string().min(1),
5503
- eventId: z36.string().min(1),
5504
- automationId: z36.string().min(1),
5505
- revision: z36.number().int().positive(),
5506
- status: z36.enum(["reserved", "launched", "launch-error", "released"]),
5507
- runId: z36.string().optional(),
5508
- observedAt: z36.string().datetime(),
5509
- updatedAt: z36.string().datetime(),
5510
- error: z36.string().max(2e3).optional(),
5506
+ var storedAutomationReceiptSchema = z37.object({
5507
+ receiptId: z37.string().min(1),
5508
+ receiptKey: z37.string().min(1),
5509
+ eventId: z37.string().min(1),
5510
+ automationId: z37.string().min(1),
5511
+ revision: z37.number().int().positive(),
5512
+ status: z37.enum(["reserved", "launched", "launch-error", "released"]),
5513
+ runId: z37.string().optional(),
5514
+ observedAt: z37.string().datetime(),
5515
+ updatedAt: z37.string().datetime(),
5516
+ error: z37.string().max(2e3).optional(),
5511
5517
  /** schedule kind: the occurrence this receipt reserved, so a retry can fire it again. */
5512
- occurrenceAt: z36.string().datetime().optional(),
5513
- candidate: z36.object({
5514
- eventId: z36.string(),
5518
+ occurrenceAt: z37.string().datetime().optional(),
5519
+ candidate: z37.object({
5520
+ eventId: z37.string(),
5515
5521
  event: storedAutomationEventSchema,
5516
- timestamp: z36.string().datetime(),
5517
- tieBreaker: z36.string(),
5518
- repo: z36.string(),
5519
- nodeId: z36.string(),
5520
- number: z36.number().int().positive(),
5521
- title: z36.string().max(500),
5522
- url: z36.string().url(),
5523
- author: z36.string().max(200),
5524
- assignees: z36.array(z36.string().max(200)).max(100),
5525
- labels: z36.array(z36.string().max(200)).max(100),
5526
- changedLabel: z36.string().max(200).optional()
5522
+ timestamp: z37.string().datetime(),
5523
+ tieBreaker: z37.string(),
5524
+ repo: z37.string(),
5525
+ nodeId: z37.string(),
5526
+ number: z37.number().int().positive(),
5527
+ title: z37.string().max(500),
5528
+ url: z37.string().url(),
5529
+ author: z37.string().max(200),
5530
+ assignees: z37.array(z37.string().max(200)).max(100),
5531
+ labels: z37.array(z37.string().max(200)).max(100),
5532
+ changedLabel: z37.string().max(200).optional()
5527
5533
  }).passthrough().optional()
5528
5534
  }).passthrough();
5529
- var storedAutomationLogResultSchema = z36.enum([
5535
+ var storedAutomationLogResultSchema = z37.enum([
5530
5536
  "launched",
5531
5537
  "no-match",
5532
5538
  "duplicate",
@@ -5542,24 +5548,24 @@ var storedAutomationLogResultSchema = z36.enum([
5542
5548
  // once schedule
5543
5549
  "missed"
5544
5550
  ]);
5545
- var storedAutomationLogRecordSchema = z36.object({
5546
- seq: z36.number().int().positive(),
5547
- ts: z36.string().datetime(),
5548
- automationId: z36.string().min(1),
5549
- revision: z36.number().int().positive(),
5551
+ var storedAutomationLogRecordSchema = z37.object({
5552
+ seq: z37.number().int().positive(),
5553
+ ts: z37.string().datetime(),
5554
+ automationId: z37.string().min(1),
5555
+ revision: z37.number().int().positive(),
5550
5556
  event: storedAutomationEventSchema.optional(),
5551
5557
  result: storedAutomationLogResultSchema,
5552
- reason: z36.string().max(2e3).optional(),
5553
- durationMs: z36.number().int().nonnegative().optional(),
5554
- receiptId: z36.string().optional(),
5555
- runId: z36.string().optional(),
5556
- githubNumber: z36.number().int().positive().optional(),
5557
- githubTitle: z36.string().max(500).optional(),
5558
- githubUrl: z36.string().url().optional(),
5559
- rateLimit: z36.object({
5560
- bucket: z36.enum(["core", "search"]),
5561
- remaining: z36.number().int().nonnegative().optional(),
5562
- resetAt: z36.string().datetime().optional()
5558
+ reason: z37.string().max(2e3).optional(),
5559
+ durationMs: z37.number().int().nonnegative().optional(),
5560
+ receiptId: z37.string().optional(),
5561
+ runId: z37.string().optional(),
5562
+ githubNumber: z37.number().int().positive().optional(),
5563
+ githubTitle: z37.string().max(500).optional(),
5564
+ githubUrl: z37.string().url().optional(),
5565
+ rateLimit: z37.object({
5566
+ bucket: z37.enum(["core", "search"]),
5567
+ remaining: z37.number().int().nonnegative().optional(),
5568
+ resetAt: z37.string().datetime().optional()
5563
5569
  }).passthrough().optional()
5564
5570
  }).passthrough();
5565
5571
  function storedIsOnceSchedule(definition) {
@@ -5573,207 +5579,207 @@ function storedIsScheduleAutomation(definition) {
5573
5579
  }
5574
5580
 
5575
5581
  // ../contract/src/automation-requests.ts
5576
- var automationEditableSchema = z37.object({
5577
- name: z37.string().trim().min(1).max(200),
5578
- description: z37.string().max(2e3).optional(),
5579
- enabled: z37.boolean().optional(),
5582
+ var automationEditableSchema = z38.object({
5583
+ name: z38.string().trim().min(1).max(200),
5584
+ description: z38.string().max(2e3).optional(),
5585
+ enabled: z38.boolean().optional(),
5580
5586
  kind: automationKindSchema.optional(),
5581
- events: z37.array(automationEventSchema).min(1).max(4).optional(),
5582
- intervalSeconds: z37.number().int().min(60).max(86400).optional(),
5587
+ events: z38.array(automationEventSchema).min(1).max(4).optional(),
5588
+ intervalSeconds: z38.number().int().min(60).max(86400).optional(),
5583
5589
  filters: storedAutomationFiltersSchema.optional(),
5584
5590
  schedule: automationScheduleSchema.optional(),
5585
- task: z37.strictObject(storedAutomationTaskSchema.shape).omit({ variants: true }).refine((task) => !(task.workflow && task.steps), {
5591
+ task: z38.strictObject(storedAutomationTaskSchema.shape).omit({ variants: true }).refine((task) => !(task.workflow && task.steps), {
5586
5592
  message: "task selects either a named workflow or inline steps, not both"
5587
5593
  })
5588
5594
  }).strict();
5589
- var automationCreateSchema = automationEditableSchema.extend({ enable: z37.boolean().optional() });
5590
- var automationUpdateSchema = automationEditableSchema.extend({ expectedRevision: z37.number().int().positive() });
5591
- var automationCheckRequestSchema = z37.object({ mode: z37.enum(["preview", "execute"]) }).strict();
5592
- var automationLogQuerySchema = z37.object({
5593
- automationId: z37.string().optional(),
5595
+ var automationCreateSchema = automationEditableSchema.extend({ enable: z38.boolean().optional() });
5596
+ var automationUpdateSchema = automationEditableSchema.extend({ expectedRevision: z38.number().int().positive() });
5597
+ var automationCheckRequestSchema = z38.object({ mode: z38.enum(["preview", "execute"]) }).strict();
5598
+ var automationLogQuerySchema = z38.object({
5599
+ automationId: z38.string().optional(),
5594
5600
  result: automationLogResultSchema.optional(),
5595
5601
  event: automationEventSchema.optional(),
5596
- since: z37.string().datetime().optional(),
5597
- cursor: z37.coerce.number().int().positive().optional(),
5602
+ since: z38.string().datetime().optional(),
5603
+ cursor: z38.coerce.number().int().positive().optional(),
5598
5604
  // Optional, not `.default(100)`: `AutomationStore.logs` already clamps `limit ?? 100` into
5599
5605
  // 1..100, so the default here was a second copy of it — and a defaulted key is REQUIRED in the
5600
5606
  // request type `queryZodValidator` publishes (see validators.ts on why the request side falls
5601
5607
  // back to the schema's output), which would have made every caller send a `?limit=` this route
5602
5608
  // never needed.
5603
- limit: z37.coerce.number().int().min(1).max(100).optional()
5609
+ limit: z38.coerce.number().int().min(1).max(100).optional()
5604
5610
  });
5605
5611
 
5606
5612
  // ../contract/src/workflow-requests.ts
5607
- import { z as z38 } from "zod";
5608
- var planSchema = z38.object({
5613
+ import { z as z39 } from "zod";
5614
+ var planSchema = z39.object({
5609
5615
  // Same bound as `createRunInputSchema.task` — this flows into `planChain` (legacy reference 429).
5610
- task: z38.string().trim().min(1).max(1e5, "must be at most 100000 characters")
5616
+ task: z39.string().trim().min(1).max(1e5, "must be at most 100000 characters")
5611
5617
  });
5612
- var parseWorkflowSchema = z38.object({
5613
- yaml: z38.string().min(1).max(1e5)
5618
+ var parseWorkflowSchema = z39.object({
5619
+ yaml: z39.string().min(1).max(1e5)
5614
5620
  });
5615
5621
 
5616
5622
  // ../contract/src/ui-state-requests.ts
5617
- import { z as z39 } from "zod";
5623
+ import { z as z40 } from "zod";
5618
5624
  var SKILL_USAGE_MAX_ENTRIES = 200;
5619
5625
  var UI_STATE_MAX_KEYS = 200;
5620
5626
  var uiStateSchema2 = uiStateSchema.extend({
5621
5627
  // null records a quick task with no selected skill or workflow.
5622
- lastTask: z39.object({
5623
- source: z39.enum(["workflow", "skill"]),
5624
- ref: z39.string().min(1).max(200)
5628
+ lastTask: z40.object({
5629
+ source: z40.enum(["workflow", "skill"]),
5630
+ ref: z40.string().min(1).max(200)
5625
5631
  }).nullable().optional(),
5626
5632
  // Most recent source choices, newest first.
5627
- recentSources: z39.array(
5628
- z39.object({
5629
- source: z39.enum(["workflow", "skill"]),
5630
- ref: z39.string().min(1).max(200)
5633
+ recentSources: z40.array(
5634
+ z40.object({
5635
+ source: z40.enum(["workflow", "skill"]),
5636
+ ref: z40.string().min(1).max(200)
5631
5637
  })
5632
5638
  ).max(50).optional(),
5633
- skillUsage: z39.record(z39.string().min(1).max(200), z39.number().int().min(0).max(1e6)).refine((usage) => Object.keys(usage).length <= SKILL_USAGE_MAX_ENTRIES, {
5639
+ skillUsage: z40.record(z40.string().min(1).max(200), z40.number().int().min(0).max(1e6)).refine((usage) => Object.keys(usage).length <= SKILL_USAGE_MAX_ENTRIES, {
5634
5640
  message: `skillUsage must have at most ${SKILL_USAGE_MAX_ENTRIES} entries`
5635
5641
  }).optional(),
5636
- promptTemplates: z39.array(
5637
- z39.object({
5638
- id: z39.string().min(1).max(64),
5639
- label: z39.string().trim().min(1).max(80),
5640
- text: z39.string().trim().min(1).max(2e3),
5642
+ promptTemplates: z40.array(
5643
+ z40.object({
5644
+ id: z40.string().min(1).max(64),
5645
+ label: z40.string().trim().min(1).max(80),
5646
+ text: z40.string().trim().min(1).max(2e3),
5641
5647
  // Skill names this template auto-applies for. Optional and additive: templates
5642
5648
  // written before this key existed keep validating, and stay manual-only.
5643
- skills: z39.array(z39.string().trim().min(1).max(200)).max(50).optional()
5649
+ skills: z40.array(z40.string().trim().min(1).max(200)).max(50).optional()
5644
5650
  })
5645
5651
  ).max(50).optional()
5646
5652
  }).passthrough();
5647
5653
  function capUiStateKeys(data, ctx) {
5648
5654
  if (Object.keys(data).length > UI_STATE_MAX_KEYS) {
5649
- ctx.addIssue({ code: z39.ZodIssueCode.custom, message: `ui-state has too many keys (max ${UI_STATE_MAX_KEYS})` });
5655
+ ctx.addIssue({ code: z40.ZodIssueCode.custom, message: `ui-state has too many keys (max ${UI_STATE_MAX_KEYS})` });
5650
5656
  }
5651
5657
  }
5652
5658
  var uiStateBody = uiStateSchema2.superRefine(capUiStateKeys);
5653
5659
 
5654
5660
  // ../contract/src/run-requests.ts
5655
- import { z as z40 } from "zod";
5661
+ import { z as z41 } from "zod";
5656
5662
  var RUNNER_IDS2 = runnerSchema.options;
5657
- var queuedMessagePatchSchema = z40.object({
5658
- text: z40.string().max(1e5).optional(),
5659
- images: z40.array(attachmentInputSchema).max(4).optional()
5663
+ var queuedMessagePatchSchema = z41.object({
5664
+ text: z41.string().max(1e5).optional(),
5665
+ images: z41.array(attachmentInputSchema).max(4).optional()
5660
5666
  }).refine((m) => m.text !== void 0 || m.images !== void 0, {
5661
5667
  message: "message edit needs text or attachments"
5662
5668
  });
5663
- var continueSchema = z40.object({
5664
- text: z40.string().max(1e5, "must be at most 100000 characters").optional(),
5665
- images: z40.array(attachmentInputSchema).max(4).optional(),
5666
- runner: z40.enum(RUNNER_IDS2).optional(),
5667
- model: z40.string().max(200).optional(),
5669
+ var continueSchema = z41.object({
5670
+ text: z41.string().max(1e5, "must be at most 100000 characters").optional(),
5671
+ images: z41.array(attachmentInputSchema).max(4).optional(),
5672
+ runner: z41.enum(RUNNER_IDS2).optional(),
5673
+ model: z41.string().max(200).optional(),
5668
5674
  /** Reasoning-effort pin (legacy reference 45). Omitted keeps the run's pin; empty string clears it. */
5669
- effort: z40.string().max(32).optional()
5675
+ effort: z41.string().max(32).optional()
5670
5676
  });
5671
- var archiveSchema = z40.object({
5672
- archived: z40.boolean().optional()
5677
+ var archiveSchema = z41.object({
5678
+ archived: z41.boolean().optional()
5673
5679
  });
5674
- var openInSchema = z40.object({
5680
+ var openInSchema = z41.object({
5675
5681
  // A short bound (legacy reference 429): matched against a downstream allowlist, so an editor id is never long.
5676
- target: z40.string().trim().min(1, "target required").max(200),
5677
- path: z40.string().max(1e3).optional()
5682
+ target: z41.string().trim().min(1, "target required").max(200),
5683
+ path: z41.string().max(1e3).optional()
5678
5684
  });
5679
5685
 
5680
5686
  // ../contract/src/query-requests.ts
5681
- import { z as z41 } from "zod";
5682
- var queryValue = z41.union([z41.string(), z41.array(z41.string()).transform((v) => v[0])]).optional();
5683
- var refreshQuery = z41.object({ refresh: queryValue });
5684
- var waitQuery = z41.object({ wait: queryValue });
5685
- var modelDiscoveryQuerySchema = z41.object({ runner: z41.union([z41.string(), z41.array(z41.string()).transform((v) => v[0])]).pipe(modelDiscoveryRunnerSchema) });
5686
- var strictRefreshQuerySchema = z41.object({ refresh: queryValue.refine((v) => v === void 0 || v === "1") });
5687
- var browseQuerySchema = z41.object({ path: queryValue, showHidden: queryValue });
5688
- var worktreeFilesQuerySchema = z41.object({ path: queryValue, raw: queryValue });
5689
- var commitQuerySchema = z41.object({ structured: queryValue });
5687
+ import { z as z42 } from "zod";
5688
+ var queryValue = z42.union([z42.string(), z42.array(z42.string()).transform((v) => v[0])]).optional();
5689
+ var refreshQuery = z42.object({ refresh: queryValue });
5690
+ var waitQuery = z42.object({ wait: queryValue });
5691
+ var modelDiscoveryQuerySchema = z42.object({ runner: z42.union([z42.string(), z42.array(z42.string()).transform((v) => v[0])]).pipe(modelDiscoveryRunnerSchema) });
5692
+ var strictRefreshQuerySchema = z42.object({ refresh: queryValue.refine((v) => v === void 0 || v === "1") });
5693
+ var browseQuerySchema = z42.object({ path: queryValue, showHidden: queryValue });
5694
+ var worktreeFilesQuerySchema = z42.object({ path: queryValue, raw: queryValue });
5695
+ var commitQuerySchema = z42.object({ structured: queryValue });
5690
5696
 
5691
5697
  // ../contract/src/github-requests.ts
5692
- import { z as z42 } from "zod";
5693
- var mergeNumberParams = z42.object({ number: z42.coerce.number().int().positive() });
5694
- var prChangesParams = z42.object({ number: z42.coerce.number().int().positive().safe() });
5695
- var prChangesQuery = z42.object({ refresh: queryValue.refine((v) => v === void 0 || v === "1") });
5696
- var mergeBodySchema = z42.object({
5697
- method: z42.enum(["merge", "squash", "rebase"]),
5698
- expectedHeadSha: z42.string().regex(/^[0-9a-f]{40}$/),
5699
- overrideRules: z42.boolean().optional().default(false)
5698
+ import { z as z43 } from "zod";
5699
+ var mergeNumberParams = z43.object({ number: z43.coerce.number().int().positive() });
5700
+ var prChangesParams = z43.object({ number: z43.coerce.number().int().positive().safe() });
5701
+ var prChangesQuery = z43.object({ refresh: queryValue.refine((v) => v === void 0 || v === "1") });
5702
+ var mergeBodySchema = z43.object({
5703
+ method: z43.enum(["merge", "squash", "rebase"]),
5704
+ expectedHeadSha: z43.string().regex(/^[0-9a-f]{40}$/),
5705
+ overrideRules: z43.boolean().optional().default(false)
5700
5706
  }).strict();
5701
- var githubChecksQuerySchema = z42.object({ prs: z42.string().min(1) });
5702
- var githubRefsQuerySchema = z42.object({ prs: z42.string().optional(), issues: z42.string().optional() });
5707
+ var githubChecksQuerySchema = z43.object({ prs: z43.string().min(1) });
5708
+ var githubRefsQuerySchema = z43.object({ prs: z43.string().optional(), issues: z43.string().optional() });
5703
5709
 
5704
5710
  // ../contract/src/repo-requests.ts
5705
- import { z as z43 } from "zod";
5706
- var gitCommitSchema = z43.object({
5707
- message: z43.string().trim().min(1, "must not be empty").max(5e3)
5711
+ import { z as z44 } from "zod";
5712
+ var gitCommitSchema = z44.object({
5713
+ message: z44.string().trim().min(1, "must not be empty").max(5e3)
5708
5714
  });
5709
- var reclaimBodySchema = z43.object({}).passthrough();
5710
- var repoBranchSchema = z43.object({
5711
- name: z43.string().trim().min(1).max(200),
5712
- from: z43.string().trim().min(1).max(200).optional()
5715
+ var reclaimBodySchema = z44.object({}).passthrough();
5716
+ var repoBranchSchema = z44.object({
5717
+ name: z44.string().trim().min(1).max(200),
5718
+ from: z44.string().trim().min(1).max(200).optional()
5713
5719
  });
5714
- var reclaimRunParamsSchema = z43.object({ runId: z43.string().min(1) });
5720
+ var reclaimRunParamsSchema = z44.object({ runId: z44.string().min(1) });
5715
5721
 
5716
5722
  // ../contract/src/config-requests.ts
5717
- import { z as z44 } from "zod";
5723
+ import { z as z45 } from "zod";
5718
5724
  var setConfigSchema = setConfigInputSchema.extend({
5719
- systemPrompt: z44.string().trim().max(2e4, "must be at most 20000 characters").nullable().optional()
5725
+ systemPrompt: z45.string().trim().max(2e4, "must be at most 20000 characters").nullable().optional()
5720
5726
  });
5721
- var setAgentConfigSchema = z44.object({
5722
- content: z44.string().max(2e6),
5723
- version: z44.string().nullable()
5727
+ var setAgentConfigSchema = z45.object({
5728
+ content: z45.string().max(2e6),
5729
+ version: z45.string().nullable()
5724
5730
  });
5725
5731
 
5726
5732
  // ../contract/src/workflow-file.ts
5727
- import { z as z45 } from "zod";
5728
- var workflowFileSchema = z45.object({
5729
- name: z45.string().min(1),
5730
- description: z45.string().optional(),
5731
- steps: z45.array(workflowStepDefSchema).min(1).optional(),
5732
- skills: z45.array(z45.string().trim().min(1)).min(1).optional()
5733
+ import { z as z46 } from "zod";
5734
+ var workflowFileSchema = z46.object({
5735
+ name: z46.string().min(1),
5736
+ description: z46.string().optional(),
5737
+ steps: z46.array(workflowStepDefSchema).min(1).optional(),
5738
+ skills: z46.array(z46.string().trim().min(1)).min(1).optional()
5733
5739
  }).refine((d) => Boolean(d.steps) !== Boolean(d.skills), {
5734
5740
  message: 'a workflow lists either "steps" or "skills", not both'
5735
5741
  });
5736
5742
 
5737
5743
  // ../contract/src/reports.ts
5738
- import { z as z46 } from "zod";
5744
+ import { z as z47 } from "zod";
5739
5745
  var REPORTS_QUERY_MAX = 1e3;
5740
- var cursorSchema = z46.string().min(1).max(1024);
5741
- var reportsQuerySchema = z46.object({
5742
- q: z46.string().max(REPORTS_QUERY_MAX).optional(),
5746
+ var cursorSchema = z47.string().min(1).max(1024);
5747
+ var reportsQuerySchema = z47.object({
5748
+ q: z47.string().max(REPORTS_QUERY_MAX).optional(),
5743
5749
  before: cursorSchema.optional(),
5744
- limit: z46.string().regex(/^(?:[1-9]|[1-9][0-9]|100)$/).transform(Number).optional()
5750
+ limit: z47.string().regex(/^(?:[1-9]|[1-9][0-9]|100)$/).transform(Number).optional()
5745
5751
  }).strict();
5746
- var reportSchema = z46.object({
5747
- id: z46.uuid(),
5748
- runId: z46.uuid(),
5749
- name: z46.string(),
5750
- title: z46.string(),
5751
- createdAt: z46.iso.datetime(),
5752
- size: z46.number().int().nonnegative(),
5753
- taskTitle: z46.string(),
5752
+ var reportSchema = z47.object({
5753
+ id: z47.uuid(),
5754
+ runId: z47.uuid(),
5755
+ name: z47.string(),
5756
+ title: z47.string(),
5757
+ createdAt: z47.iso.datetime(),
5758
+ size: z47.number().int().nonnegative(),
5759
+ taskTitle: z47.string(),
5754
5760
  taskStatus: runStatusSchema
5755
5761
  }).strict();
5756
- var reportsResponseSchema = z46.object({
5757
- reports: z46.array(reportSchema),
5762
+ var reportsResponseSchema = z47.object({
5763
+ reports: z47.array(reportSchema),
5758
5764
  nextCursor: cursorSchema.nullable(),
5759
5765
  // Counts all matching cached rows with readable source summaries before page content checks.
5760
5766
  // A missing-content row dropped while filling this page can lower total on the next request.
5761
- total: z46.number().int().nonnegative()
5767
+ total: z47.number().int().nonnegative()
5762
5768
  }).strict();
5763
- var reportsStateSchema = z46.object({
5764
- epoch: z46.uuid(),
5765
- generation: z46.number().int().nonnegative(),
5766
- metadataGeneration: z46.number().int().nonnegative()
5769
+ var reportsStateSchema = z47.object({
5770
+ epoch: z47.uuid(),
5771
+ generation: z47.number().int().nonnegative(),
5772
+ metadataGeneration: z47.number().int().nonnegative()
5767
5773
  }).strict();
5768
- var reportsMetadataSchema = z46.object({
5769
- runId: z46.uuid(),
5770
- taskTitle: z46.string(),
5774
+ var reportsMetadataSchema = z47.object({
5775
+ runId: z47.uuid(),
5776
+ taskTitle: z47.string(),
5771
5777
  taskStatus: runStatusSchema
5772
5778
  }).strict();
5773
- var reportsFrameSchema = z46.discriminatedUnion("type", [
5774
- reportsStateSchema.extend({ type: z46.literal("snapshot") }),
5775
- reportsStateSchema.extend({ type: z46.literal("content") }),
5776
- reportsStateSchema.extend({ type: z46.literal("metadata"), runs: z46.array(reportsMetadataSchema) })
5779
+ var reportsFrameSchema = z47.discriminatedUnion("type", [
5780
+ reportsStateSchema.extend({ type: z47.literal("snapshot") }),
5781
+ reportsStateSchema.extend({ type: z47.literal("content") }),
5782
+ reportsStateSchema.extend({ type: z47.literal("metadata"), runs: z47.array(reportsMetadataSchema) })
5777
5783
  ]);
5778
5784
 
5779
5785
  // ../contract/src/report-title.ts
@@ -5795,75 +5801,75 @@ function controlLocation(control, separator = " \u2192 ") {
5795
5801
  }
5796
5802
 
5797
5803
  // ../contract/src/home-recovery.ts
5798
- import { z as z47 } from "zod";
5804
+ import { z as z48 } from "zod";
5799
5805
  var HOME_FILE_PATTERN = /^(?:(?:config\.json(?:\.bak)?|agent-accounts\.json|ui-state\.json|server\.json|server\.install\.lock)|(?:remote-settings|server-instances)\/[a-zA-Z0-9-]+\.(?:json|install\.lock))$/;
5800
- var homeFileSchema = z47.string().regex(HOME_FILE_PATTERN);
5801
- var recoveryFile = z47.object({
5806
+ var homeFileSchema = z48.string().regex(HOME_FILE_PATTERN);
5807
+ var recoveryFile = z48.object({
5802
5808
  file: homeFileSchema,
5803
- detectedAt: z47.iso.datetime(),
5804
- canRestore: z47.boolean()
5809
+ detectedAt: z48.iso.datetime(),
5810
+ canRestore: z48.boolean()
5805
5811
  });
5806
5812
  var HOME_RECOVERY_REASONS = ["reset", "outside-write", "legacy-change"];
5807
- var homeRecoveryFileSchema = z47.discriminatedUnion("reason", [
5808
- recoveryFile.extend({ reason: z47.literal("reset") }),
5809
- recoveryFile.extend({ reason: z47.literal("outside-write") }),
5810
- recoveryFile.extend({ reason: z47.literal("legacy-change"), canImport: z47.boolean() })
5813
+ var homeRecoveryFileSchema = z48.discriminatedUnion("reason", [
5814
+ recoveryFile.extend({ reason: z48.literal("reset") }),
5815
+ recoveryFile.extend({ reason: z48.literal("outside-write") }),
5816
+ recoveryFile.extend({ reason: z48.literal("legacy-change"), canImport: z48.boolean() })
5811
5817
  ]);
5812
- var homeRecoverySchema = z47.object({ files: z47.array(homeRecoveryFileSchema) });
5818
+ var homeRecoverySchema = z48.object({ files: z48.array(homeRecoveryFileSchema) });
5813
5819
  function filterHomeRecoveryReasons(value, reasons) {
5814
5820
  if (!value || typeof value !== "object" || !("files" in value) || !Array.isArray(value.files)) return value;
5815
5821
  return { ...value, files: value.files.filter((row) => !(row && typeof row === "object" && "reason" in row && typeof row.reason === "string" && !reasons.includes(row.reason))) };
5816
5822
  }
5817
- var homeRecoveryReaderSchema = z47.preprocess(
5823
+ var homeRecoveryReaderSchema = z48.preprocess(
5818
5824
  (value) => filterHomeRecoveryReasons(value, HOME_RECOVERY_REASONS),
5819
5825
  homeRecoverySchema
5820
5826
  );
5821
- var homeRecoveryActionSchema = z47.object({ file: homeFileSchema, detectedAt: z47.iso.datetime() }).strict();
5827
+ var homeRecoveryActionSchema = z48.object({ file: homeFileSchema, detectedAt: z48.iso.datetime() }).strict();
5822
5828
 
5823
5829
  // ../contract/src/runner-skills.ts
5824
- import { z as z48 } from "zod";
5825
- var runnerSkillScopeSchema = z48.enum(["repo", "user", "system", "other"]);
5826
- var runnerSkillsQuerySchema = z48.object({
5830
+ import { z as z49 } from "zod";
5831
+ var runnerSkillScopeSchema = z49.enum(["repo", "user", "system", "other"]);
5832
+ var runnerSkillsQuerySchema = z49.object({
5827
5833
  runner: runnerSchema,
5828
- account: z48.string().min(1).max(64).optional(),
5829
- refresh: z48.literal("1").optional()
5834
+ account: z49.string().min(1).max(64).optional(),
5835
+ refresh: z49.literal("1").optional()
5830
5836
  });
5831
- var runnerSkillSchema = z48.object({
5832
- id: z48.string(),
5833
- name: z48.string(),
5834
- description: z48.string().optional(),
5837
+ var runnerSkillSchema = z49.object({
5838
+ id: z49.string(),
5839
+ name: z49.string(),
5840
+ description: z49.string().optional(),
5835
5841
  scope: runnerSkillScopeSchema.optional(),
5836
- plugin: z48.string().optional(),
5837
- path: z48.string().optional()
5842
+ plugin: z49.string().optional(),
5843
+ path: z49.string().optional()
5838
5844
  });
5839
- var runnerSkillProblemSchema = z48.object({ message: z48.string(), path: z48.string().optional() });
5840
- var runnerSkillListSchema = z48.object({
5845
+ var runnerSkillProblemSchema = z49.object({ message: z49.string(), path: z49.string().optional() });
5846
+ var runnerSkillListSchema = z49.object({
5841
5847
  runner: runnerSchema,
5842
- skills: z48.array(runnerSkillSchema),
5843
- problems: z48.array(runnerSkillProblemSchema),
5844
- source: z48.enum(["live", "cache", "unavailable"]),
5845
- reason: z48.string().optional()
5848
+ skills: z49.array(runnerSkillSchema),
5849
+ problems: z49.array(runnerSkillProblemSchema),
5850
+ source: z49.enum(["live", "cache", "unavailable"]),
5851
+ reason: z49.string().optional()
5846
5852
  });
5847
5853
 
5848
5854
  // ../contract/src/automation-tool.ts
5849
- import { z as z49 } from "zod";
5855
+ import { z as z50 } from "zod";
5850
5856
  var repeatingAutomationInputSchema = automationCreateSchema.omit({ enabled: true, enable: true }).refine((value) => value.schedule?.type !== "once", "Use cezar_schedule_task for a one-time schedule.");
5851
- var id = z49.string().min(1).max(100);
5852
- var automationToolRequestSchema = z49.discriminatedUnion("action", [
5853
- z49.object({ action: z49.literal("create"), definition: repeatingAutomationInputSchema }).strict(),
5854
- z49.object({ action: z49.literal("show"), id }).strict(),
5855
- z49.object({ action: z49.literal("preview"), id }).strict(),
5856
- z49.object({ action: z49.literal("enable"), id, explicit: z49.boolean().optional() }).strict()
5857
+ var id = z50.string().min(1).max(100);
5858
+ var automationToolRequestSchema = z50.discriminatedUnion("action", [
5859
+ z50.object({ action: z50.literal("create"), definition: repeatingAutomationInputSchema }).strict(),
5860
+ z50.object({ action: z50.literal("show"), id }).strict(),
5861
+ z50.object({ action: z50.literal("preview"), id }).strict(),
5862
+ z50.object({ action: z50.literal("enable"), id, explicit: z50.boolean().optional() }).strict()
5857
5863
  ]);
5858
- var automationToolAnswerSchema = z49.union([
5859
- z49.object({
5860
- ok: z49.literal(true),
5864
+ var automationToolAnswerSchema = z50.union([
5865
+ z50.object({
5866
+ ok: z50.literal(true),
5861
5867
  automation: storedAutomationDefinitionSchema,
5862
- url: z49.string().optional(),
5863
- next_run_at: z49.string().optional(),
5864
- preview: z49.object({ matches: z49.number().int().nonnegative(), truncated: z49.boolean() }).optional()
5868
+ url: z50.string().optional(),
5869
+ next_run_at: z50.string().optional(),
5870
+ preview: z50.object({ matches: z50.number().int().nonnegative(), truncated: z50.boolean() }).optional()
5865
5871
  }),
5866
- z49.object({ ok: z49.literal(false), code: z49.enum([...scheduledTaskRefusalCodeSchema.options, "explicit_required", "preview_required"]), message: z49.string() })
5872
+ z50.object({ ok: z50.literal(false), code: z50.enum([...scheduledTaskRefusalCodeSchema.options, "explicit_required", "preview_required"]), message: z50.string() })
5867
5873
  ]);
5868
5874
  export {
5869
5875
  ACTIVITY_CHECKS_MAX,