@hearsay-tools/squawk 0.18.0-pr3885.7316 → 0.18.0-pr3886.7318

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