@hearsay-tools/squawk 0.18.0-dev.8021 → 0.18.0-dev.8024

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 (90) hide show
  1. package/dist/ci-wait/client.js.map +1 -1
  2. package/dist/ci-wait/controller.d.ts +6 -5
  3. package/dist/ci-wait/controller.js.map +1 -1
  4. package/dist/ci-wait/tool-catalog.js.map +1 -1
  5. package/dist/contract/index.d.ts +1 -0
  6. package/dist/contract/index.js +622 -615
  7. package/dist/contract/wait-limits.d.ts +3 -0
  8. package/dist/contract/wait-tools.d.ts +440 -0
  9. package/dist/contract/waits.d.ts +2 -441
  10. package/dist/delegation/routes.d.ts +4 -4
  11. package/dist/delegation/transport.d.ts +15 -15
  12. package/dist/runs/run-archive.d.ts +72 -72
  13. package/dist/runs/run-decode.d.ts +72 -72
  14. package/dist/runs/run-exits.d.ts +352 -352
  15. package/dist/workflows/continuation-admission.d.ts +72 -72
  16. package/dist/workflows/run/compose.d.ts +2 -1
  17. package/dist/workflows/run/compose.js.map +1 -1
  18. package/dist/workflows/run/run-finish.js.map +1 -1
  19. package/dist/workflows/run/squawk-tools.d.ts +2 -1
  20. package/dist/workflows/run/squawk-tools.js.map +1 -1
  21. package/dist/workflows/run/wait-registration-tool.js +2 -1
  22. package/dist/workflows/run/wait-registration-tool.js.map +1 -1
  23. package/dist/workflows/run/wait-registration.d.ts +2 -1
  24. package/dist/workflows/run/wait-registration.js.map +1 -1
  25. package/dist/workflows/run/wait-registry.d.ts +2 -1
  26. package/dist/workflows/run/wait-registry.js.map +1 -1
  27. package/dist/workflows/run.d.ts +2 -1
  28. package/dist/workflows/run.js.map +1 -1
  29. package/package.json +4 -4
  30. package/web/dist/assets/{accounts-section-CJ1xR0FN.js → accounts-section-Lxa13E8O.js} +1 -1
  31. package/web/dist/assets/{activity-motion-C01GEN0y.js → activity-motion-D-8GF_WP.js} +1 -1
  32. package/web/dist/assets/{activity-route-BZ1NIKSY.js → activity-route-Bo-Cyzsz.js} +1 -1
  33. package/web/dist/assets/{agent-config-section-DvFcRRLD.js → agent-config-section-BE239EYo.js} +1 -1
  34. package/web/dist/assets/{agent-defaults-section-BE88c2RN.js → agent-defaults-section-Bj5dO6F3.js} +1 -1
  35. package/web/dist/assets/{appearance-B9Z6lNEm.js → appearance-C2v7z5MF.js} +1 -1
  36. package/web/dist/assets/{archive-on-merge-field-DtR7twJI.js → archive-on-merge-field-Ta3WlY1p.js} +1 -1
  37. package/web/dist/assets/attention-B1Ei1IW6.js +1 -0
  38. package/web/dist/assets/{automations-route-Dpa01C3j.js → automations-route-DPpaFR0Q.js} +1 -1
  39. package/web/dist/assets/{commit-diff-panel-CGjhxIPJ.js → commit-diff-panel-CzY8bO3p.js} +1 -1
  40. package/web/dist/assets/{diff-DQ18_bA-.js → diff-3jSM3IH7.js} +2 -2
  41. package/web/dist/assets/{diff-view-CMwe_Rx7.js → diff-view-C3cwyYRv.js} +1 -1
  42. package/web/dist/assets/{file-preview-_lAUlt5u.js → file-preview-B71T62DU.js} +1 -1
  43. package/web/dist/assets/{folder-browser-Cy26Y6YK.js → folder-browser-BTYMFLBY.js} +1 -1
  44. package/web/dist/assets/{git-toolbar-BJM3pWHY.js → git-toolbar-Dng31AhK.js} +1 -1
  45. package/web/dist/assets/{github-aO7y0526.js → github-Cft2RNHM.js} +1 -1
  46. package/web/dist/assets/{global-activity-route-BWOfw2C5.js → global-activity-route-CngRjBlD.js} +1 -1
  47. package/web/dist/assets/{index-D-Y1olb1.js → index-MG3T7zFQ.js} +5 -5
  48. package/web/dist/assets/{label-CbEJ99h4.js → label-C9IGG0mW.js} +1 -1
  49. package/web/dist/assets/{markdown-BDWII3gy.js → markdown-BDWm6oGX.js} +1 -1
  50. package/web/dist/assets/{notifications-section-Z_4IW83J.js → notifications-section-BxIKJ1NF.js} +1 -1
  51. package/web/dist/assets/{open-in-menu-21vcjK3t.js → open-in-menu-LbTu2sP4.js} +1 -1
  52. package/web/dist/assets/{preview-pane-connected-CxwvH4pt.js → preview-pane-connected-CGQngtTw.js} +1 -1
  53. package/web/dist/assets/{project-location-CvJMe_Vp.js → project-location-B-18C392.js} +1 -1
  54. package/web/dist/assets/{project-router-hhGBPlav.js → project-router-DImKA81z.js} +1 -1
  55. package/web/dist/assets/project-scope-context-D3_4Nfjk.js +4 -0
  56. package/web/dist/assets/{projects-section-CQ34YFnT.js → projects-section-DQ1LxJ3A.js} +1 -1
  57. package/web/dist/assets/{prompt-templates-section-UIxQCLJq.js → prompt-templates-section-C5AYB6Ig.js} +1 -1
  58. package/web/dist/assets/{queries-D6ioEk6c.js → queries-BaHOUYn4.js} +1 -1
  59. package/web/dist/assets/{reference-chip-B5br2cfV.js → reference-chip-CdOqXRll.js} +1 -1
  60. package/web/dist/assets/{remote-settings-notice-BWDpTH5W.js → remote-settings-notice-BTdflMqO.js} +1 -1
  61. package/web/dist/assets/{repo-git-U12bPaG-.js → repo-git-DChiMWrS.js} +1 -1
  62. package/web/dist/assets/{report-reader-B5vipU-m.js → report-reader-nV2G6iRk.js} +1 -1
  63. package/web/dist/assets/{reports-Cdk8Dc-w.js → reports-CoQqVEy4.js} +1 -1
  64. package/web/dist/assets/{resources-section-BCLu3v1Z.js → resources-section-CVaIlicS.js} +1 -1
  65. package/web/dist/assets/{run-header-gOqc0BKa.js → run-header-xPtXOBkm.js} +1 -1
  66. package/web/dist/assets/{runners-5cgs0qUY.js → runners-DccsyraI.js} +1 -1
  67. package/web/dist/assets/{settings-agent-picker-CB7l8AW-.js → settings-agent-picker-ixlEQ-MP.js} +1 -1
  68. package/web/dist/assets/{settings-shell-BUHHoCDs.js → settings-shell-BwknM_fs.js} +1 -1
  69. package/web/dist/assets/{sidebar-section-8dTKLdQw.js → sidebar-section-BNy-fRPU.js} +1 -1
  70. package/web/dist/assets/{skills-thuBrq2s.js → skills-CKceHo5J.js} +1 -1
  71. package/web/dist/assets/{tab-link-DaFUyEhe.js → tab-link-VCVNqxFc.js} +1 -1
  72. package/web/dist/assets/{task-changes-DSpeg6sX.js → task-changes-D4H5YbMo.js} +1 -1
  73. package/web/dist/assets/{task-commits-DRDRswBh.js → task-commits-BNu0VTTf.js} +1 -1
  74. package/web/dist/assets/{task-files-Cevz9Mex.js → task-files-C8q8GHYK.js} +1 -1
  75. package/web/dist/assets/{task-github-item-DpLkKSKy.js → task-github-item-D5kHfnwY.js} +1 -1
  76. package/web/dist/assets/{task-groups-CafTiSSz.js → task-groups-C7yO8nMy.js} +1 -1
  77. package/web/dist/assets/{task-thread-BvM4rEQe.js → task-thread-Dhts8Nbu.js} +1 -1
  78. package/web/dist/assets/{tasks-table-DYjfmofR.js → tasks-table-I_z4e7uI.js} +1 -1
  79. package/web/dist/assets/{thread-state-A3TSuI5v.js → thread-state-DV19z3BD.js} +1 -1
  80. package/web/dist/assets/{use-hand-to-agent-state-IepoiFbj.js → use-hand-to-agent-state-C6e6Mgi1.js} +1 -1
  81. package/web/dist/assets/{useInfiniteQuery-B20OnjTe.js → useInfiniteQuery-DR5UfhCS.js} +1 -1
  82. package/web/dist/assets/useQuery-BMyCehPp.js +1 -0
  83. package/web/dist/assets/{workflows-B0TaHAzz.js → workflows-BNHmFZRc.js} +1 -1
  84. package/web/dist/assets/{workspace-tools-B8sP_p5c.js → workspace-tools-UHJAnHEN.js} +1 -1
  85. package/web/dist/assets/{worktrees-section-BDfwadB6.js → worktrees-section-B4XPx6R5.js} +1 -1
  86. package/web/dist/assets/{ws-ExzR2_Yn.js → ws-CH3zNFKR.js} +1 -1
  87. package/web/dist/index.html +15 -15
  88. package/web/dist/assets/attention-B6NEiTGm.js +0 -1
  89. package/web/dist/assets/project-scope-context-BiijuuWU.js +0 -4
  90. package/web/dist/assets/useQuery-BTg3x78A.js +0 -1
@@ -1558,6 +1558,8 @@ var SUBAGENT_WAIT_DEADLINE_SECONDS = 1800;
1558
1558
  var SUBAGENT_WAIT_GRACE_SECONDS = 15;
1559
1559
  var SUBAGENT_WAIT_CHILD_LIMIT = 32;
1560
1560
  var WAIT_MESSAGE_MAX = 4096;
1561
+ var NOTE_MAX = 512;
1562
+ var PID_MIN = 2;
1561
1563
 
1562
1564
  // ../contract/src/waiting-on.ts
1563
1565
  function peerRequestIds(delegation) {
@@ -1637,8 +1639,7 @@ function resolveWaitingOn(run) {
1637
1639
  }
1638
1640
 
1639
1641
  // ../contract/src/waits.ts
1640
- var NOTE_MAX = 512;
1641
- var pidSchema = z21.number().int().min(2);
1642
+ var pidSchema = z21.number().int().min(PID_MIN);
1642
1643
  var waitPhaseSchema = z21.enum(["open", "resolved", "delivered", "cancelled"]);
1643
1644
  var waitViaSchema = z21.enum([
1644
1645
  // `cezar_wait_for_ci` is kept for stored rows only: the tool was removed (hearsay-tools/cezarion#1236).
@@ -1784,49 +1785,6 @@ function runningSubagents(wait) {
1784
1785
  return wait.children.filter((child) => child.status === "running").length;
1785
1786
  }
1786
1787
  var waitSchema = z21.discriminatedUnion("kind", [prWaitEntrySchema, timerWaitEntrySchema, humanWaitEntrySchema, workerWaitEntrySchema, processWaitEntrySchema, peerWaitEntrySchema, subagentWaitEntrySchema]);
1787
- var oneModeTakesOneId = (ids, mode, ctx) => {
1788
- if (mode === "one" && ids.length !== 1) ctx.addIssue({ code: "custom", message: "one mode requires exactly one id", path: ["mode"] });
1789
- };
1790
- var waitTimeoutSeconds = z21.number().int().min(1).max(PEER_WAIT_MAX_SECONDS).default(PEER_WAIT_DEFAULT_SECONDS);
1791
- var registrationFields = { operation_id: z21.uuid().optional() };
1792
- var squawkWaitRequestSchema = z21.discriminatedUnion("kind", [
1793
- ciWaitRequestSchema.extend({ kind: z21.literal("pr"), ...registrationFields }).strict(),
1794
- z21.object({
1795
- kind: z21.literal("worker"),
1796
- ...registrationFields,
1797
- worker_ids: workerIdsSchema,
1798
- mode: workerWaitModeSchema.optional(),
1799
- timeout_seconds: waitTimeoutSeconds
1800
- }).strict().superRefine((request, ctx) => oneModeTakesOneId(request.worker_ids, request.mode, ctx)),
1801
- z21.object({
1802
- kind: z21.literal("request"),
1803
- ...registrationFields,
1804
- request_ids: workerIdsSchema,
1805
- mode: workerWaitModeSchema.optional(),
1806
- timeout_seconds: waitTimeoutSeconds
1807
- }).strict().superRefine((request, ctx) => oneModeTakesOneId(request.request_ids, request.mode, ctx)),
1808
- z21.object({
1809
- kind: z21.literal("peer"),
1810
- ...registrationFields,
1811
- peer_ids: workerIdsSchema,
1812
- timeout_seconds: waitTimeoutSeconds
1813
- }).strict(),
1814
- z21.object({
1815
- kind: z21.literal("timer"),
1816
- ...registrationFields,
1817
- seconds: z21.number().int().min(TIMER_MIN_SECONDS).max(TIMER_MAX_SECONDS),
1818
- note: z21.string().max(NOTE_MAX).optional()
1819
- }).strict(),
1820
- z21.object({
1821
- kind: z21.literal("process"),
1822
- ...registrationFields,
1823
- pid: pidSchema,
1824
- exit_file: z21.string().min(1).max(PROCESS_EXIT_FILE_MAX).optional(),
1825
- timeout_seconds: z21.number().int().min(1).max(PROCESS_TIMEOUT_MAX_SECONDS).default(PROCESS_TIMEOUT_DEFAULT_SECONDS),
1826
- note: z21.string().max(NOTE_MAX).optional()
1827
- }).strict()
1828
- ]);
1829
- var squawkCancelWaitRequestSchema = z21.object({ wait_id: z21.uuid() }).strict();
1830
1788
  var openWaitFields = { wait_id: z21.uuid(), summary: z21.string().max(256) };
1831
1789
  var openWaitSchema = z21.discriminatedUnion("kind", [
1832
1790
  z21.object({ ...openWaitFields, kind: z21.enum(["pr", "timer", "worker", "process", "peer", "subagent"]), deadline: z21.iso.datetime() }).strict(),
@@ -1846,41 +1804,12 @@ var waitErrorCodeSchema = z21.enum([
1846
1804
  // hearsay-tools/cezarion#2784: a peer wait on a task whose messaging switch is off.
1847
1805
  "messaging_off"
1848
1806
  ]);
1849
- var message = z21.string().max(WAIT_MESSAGE_MAX);
1850
1807
  var waitRegistrationReceiptSchema = z21.object({
1851
1808
  operationId: z21.uuid(),
1852
1809
  requestHash: z21.string().regex(/^[0-9a-f]{64}$/),
1853
1810
  wait: waitSchema,
1854
1811
  deduplicated: z21.boolean()
1855
1812
  }).strict();
1856
- var registrationAnswerFields = {
1857
- operation_id: z21.uuid().optional()
1858
- };
1859
- var squawkWaitAnswerSchema = z21.discriminatedUnion("ok", [
1860
- z21.object({
1861
- ok: z21.literal(true),
1862
- ...registrationAnswerFields,
1863
- effect: z21.enum(["applied", "unchanged"]).optional(),
1864
- deduplicated: z21.boolean().optional(),
1865
- replayed: z21.boolean().optional(),
1866
- wait_phase: z21.enum([...waitPhaseSchema.options, "unavailable"]).optional(),
1867
- wait_id: z21.uuid(),
1868
- /** The kind the call asked for: a `request` wait is stored as a `worker` entry. */
1869
- kind: z21.enum(["pr", "timer", "worker", "request", "process", "peer"]),
1870
- deadline: z21.iso.datetime(),
1871
- open_waits: z21.array(openWaitSchema).max(WAIT_LIMIT)
1872
- }).strict(),
1873
- z21.object({
1874
- ok: z21.literal(false),
1875
- ...registrationAnswerFields,
1876
- effect: z21.enum(["refused", "unknown"]).optional(),
1877
- retained_wait: openWaitSchema.optional(),
1878
- code: waitErrorCodeSchema,
1879
- message,
1880
- open_waits: z21.array(openWaitSchema).max(WAIT_LIMIT).optional()
1881
- }).strict()
1882
- ]);
1883
- var squawkAskRequestSchema = askRequestSchema.extend({ context: askContextSchema });
1884
1813
  var askErrorCodeSchema = z21.enum([
1885
1814
  "invalid_request",
1886
1815
  "capacity",
@@ -1903,29 +1832,6 @@ var askErrorCodeSchema = z21.enum([
1903
1832
  "root_finish_pending",
1904
1833
  "supervisor_is_worker"
1905
1834
  ]);
1906
- var squawkAskAnswerSchema = z21.discriminatedUnion("ok", [
1907
- z21.object({ ok: z21.literal(true), wait_id: z21.uuid(), open_waits: z21.array(openWaitSchema).max(WAIT_LIMIT) }).strict(),
1908
- z21.object({
1909
- ok: z21.literal(false),
1910
- code: askErrorCodeSchema,
1911
- message,
1912
- open_waits: z21.array(openWaitSchema).max(WAIT_LIMIT).optional()
1913
- }).strict()
1914
- ]);
1915
- var squawkCancelWaitAnswerSchema = z21.discriminatedUnion("cancelled", [
1916
- z21.object({
1917
- cancelled: z21.literal(true),
1918
- wait_id: z21.uuid(),
1919
- open_waits: z21.array(openWaitSchema).max(WAIT_LIMIT)
1920
- }).strict(),
1921
- z21.object({
1922
- cancelled: z21.literal(false),
1923
- code: z21.enum(["not_found", "already_resolved", "human_question", "invalid_request", "unavailable"]),
1924
- message,
1925
- open_waits: z21.array(openWaitSchema).max(WAIT_LIMIT).optional()
1926
- }).strict()
1927
- ]);
1928
- var squawkDoneRequestSchema = z21.object({ summary: z21.string().max(2e3).optional() }).strict();
1929
1835
  var doneErrorCodeSchema = z21.enum([
1930
1836
  "workers_outstanding",
1931
1837
  "workers_uncollected",
@@ -1956,30 +1862,6 @@ var doneOwedInputSchema = z21.discriminatedUnion("kind", [
1956
1862
  z21.object({ kind: z21.literal("in_flight"), input_id: z21.string() }).strict(),
1957
1863
  z21.object({ kind: z21.literal("unread"), input_id: z21.string() }).strict()
1958
1864
  ]);
1959
- var doneAccepted = {
1960
- ok: z21.literal(true),
1961
- finishes: z21.literal("at_turn_end"),
1962
- open_waits: z21.array(openWaitSchema).max(WAIT_LIMIT)
1963
- };
1964
- var squawkDoneAnswerSchema = z21.discriminatedUnion("ok", [
1965
- z21.discriminatedUnion("completes", [
1966
- z21.object({ ...doneAccepted, completes: z21.literal("task") }).strict(),
1967
- z21.object({ ...doneAccepted, completes: z21.literal("step"), next_step: z21.string().min(1) }).strict()
1968
- ]),
1969
- z21.object({
1970
- ok: z21.literal(false),
1971
- code: doneErrorCodeSchema,
1972
- message,
1973
- /** The workers that block the finish, and why each one does. */
1974
- workers: z21.array(z21.object({
1975
- worker_id: z21.string(),
1976
- reason: z21.enum(["outstanding", "uncollected", "question"])
1977
- }).strict()).max(64).optional(),
1978
- open_waits: z21.array(openWaitSchema).max(WAIT_LIMIT).optional(),
1979
- /** `input_pending` (hearsay-tools/squawk#2587): what the run still owes the agent. */
1980
- owed: z21.array(doneOwedInputSchema).max(64).optional()
1981
- }).strict()
1982
- ]);
1983
1865
  var waitingOnUnionSchema = z21.discriminatedUnion("kind", [
1984
1866
  /** `shown` once the user sees the question (its `askSeq`): attention reads that as Needs you at
1985
1867
  * any status, a wake turn's included (phase 4b, hearsay-tools/cezarion#1236). */
@@ -4701,6 +4583,129 @@ var scheduledTasksAnswerSchema = z34.union([
4701
4583
  refusal
4702
4584
  ]);
4703
4585
 
4586
+ // ../contract/src/wait-tools.ts
4587
+ import { z as z35 } from "zod";
4588
+ var pidSchema2 = z35.number().int().min(PID_MIN);
4589
+ var oneModeTakesOneId = (ids, mode, ctx) => {
4590
+ if (mode === "one" && ids.length !== 1) ctx.addIssue({ code: "custom", message: "one mode requires exactly one id", path: ["mode"] });
4591
+ };
4592
+ var waitTimeoutSeconds = z35.number().int().min(1).max(PEER_WAIT_MAX_SECONDS).default(PEER_WAIT_DEFAULT_SECONDS);
4593
+ var registrationFields = { operation_id: z35.uuid().optional() };
4594
+ var squawkWaitRequestSchema = z35.discriminatedUnion("kind", [
4595
+ ciWaitRequestSchema.extend({ kind: z35.literal("pr"), ...registrationFields }).strict(),
4596
+ z35.object({
4597
+ kind: z35.literal("worker"),
4598
+ ...registrationFields,
4599
+ worker_ids: workerIdsSchema,
4600
+ mode: workerWaitModeSchema.optional(),
4601
+ timeout_seconds: waitTimeoutSeconds
4602
+ }).strict().superRefine((request, ctx) => oneModeTakesOneId(request.worker_ids, request.mode, ctx)),
4603
+ z35.object({
4604
+ kind: z35.literal("request"),
4605
+ ...registrationFields,
4606
+ request_ids: workerIdsSchema,
4607
+ mode: workerWaitModeSchema.optional(),
4608
+ timeout_seconds: waitTimeoutSeconds
4609
+ }).strict().superRefine((request, ctx) => oneModeTakesOneId(request.request_ids, request.mode, ctx)),
4610
+ z35.object({
4611
+ kind: z35.literal("peer"),
4612
+ ...registrationFields,
4613
+ peer_ids: workerIdsSchema,
4614
+ timeout_seconds: waitTimeoutSeconds
4615
+ }).strict(),
4616
+ z35.object({
4617
+ kind: z35.literal("timer"),
4618
+ ...registrationFields,
4619
+ seconds: z35.number().int().min(TIMER_MIN_SECONDS).max(TIMER_MAX_SECONDS),
4620
+ note: z35.string().max(NOTE_MAX).optional()
4621
+ }).strict(),
4622
+ z35.object({
4623
+ kind: z35.literal("process"),
4624
+ ...registrationFields,
4625
+ pid: pidSchema2,
4626
+ exit_file: z35.string().min(1).max(PROCESS_EXIT_FILE_MAX).optional(),
4627
+ timeout_seconds: z35.number().int().min(1).max(PROCESS_TIMEOUT_MAX_SECONDS).default(PROCESS_TIMEOUT_DEFAULT_SECONDS),
4628
+ note: z35.string().max(NOTE_MAX).optional()
4629
+ }).strict()
4630
+ ]);
4631
+ var squawkCancelWaitRequestSchema = z35.object({ wait_id: z35.uuid() }).strict();
4632
+ var message = z35.string().max(WAIT_MESSAGE_MAX);
4633
+ var registrationAnswerFields = {
4634
+ operation_id: z35.uuid().optional()
4635
+ };
4636
+ var squawkWaitAnswerSchema = z35.discriminatedUnion("ok", [
4637
+ z35.object({
4638
+ ok: z35.literal(true),
4639
+ ...registrationAnswerFields,
4640
+ effect: z35.enum(["applied", "unchanged"]).optional(),
4641
+ deduplicated: z35.boolean().optional(),
4642
+ replayed: z35.boolean().optional(),
4643
+ wait_phase: z35.enum([...waitPhaseSchema.options, "unavailable"]).optional(),
4644
+ wait_id: z35.uuid(),
4645
+ /** The kind the call asked for: a `request` wait is stored as a `worker` entry. */
4646
+ kind: z35.enum(["pr", "timer", "worker", "request", "process", "peer"]),
4647
+ deadline: z35.iso.datetime(),
4648
+ open_waits: z35.array(openWaitSchema).max(WAIT_LIMIT)
4649
+ }).strict(),
4650
+ z35.object({
4651
+ ok: z35.literal(false),
4652
+ ...registrationAnswerFields,
4653
+ effect: z35.enum(["refused", "unknown"]).optional(),
4654
+ retained_wait: openWaitSchema.optional(),
4655
+ code: waitErrorCodeSchema,
4656
+ message,
4657
+ open_waits: z35.array(openWaitSchema).max(WAIT_LIMIT).optional()
4658
+ }).strict()
4659
+ ]);
4660
+ var squawkAskRequestSchema = askRequestSchema.extend({ context: askContextSchema });
4661
+ var squawkAskAnswerSchema = z35.discriminatedUnion("ok", [
4662
+ z35.object({ ok: z35.literal(true), wait_id: z35.uuid(), open_waits: z35.array(openWaitSchema).max(WAIT_LIMIT) }).strict(),
4663
+ z35.object({
4664
+ ok: z35.literal(false),
4665
+ code: askErrorCodeSchema,
4666
+ message,
4667
+ open_waits: z35.array(openWaitSchema).max(WAIT_LIMIT).optional()
4668
+ }).strict()
4669
+ ]);
4670
+ var squawkCancelWaitAnswerSchema = z35.discriminatedUnion("cancelled", [
4671
+ z35.object({
4672
+ cancelled: z35.literal(true),
4673
+ wait_id: z35.uuid(),
4674
+ open_waits: z35.array(openWaitSchema).max(WAIT_LIMIT)
4675
+ }).strict(),
4676
+ z35.object({
4677
+ cancelled: z35.literal(false),
4678
+ code: z35.enum(["not_found", "already_resolved", "human_question", "invalid_request", "unavailable"]),
4679
+ message,
4680
+ open_waits: z35.array(openWaitSchema).max(WAIT_LIMIT).optional()
4681
+ }).strict()
4682
+ ]);
4683
+ var squawkDoneRequestSchema = z35.object({ summary: z35.string().max(2e3).optional() }).strict();
4684
+ var doneAccepted = {
4685
+ ok: z35.literal(true),
4686
+ finishes: z35.literal("at_turn_end"),
4687
+ open_waits: z35.array(openWaitSchema).max(WAIT_LIMIT)
4688
+ };
4689
+ var squawkDoneAnswerSchema = z35.discriminatedUnion("ok", [
4690
+ z35.discriminatedUnion("completes", [
4691
+ z35.object({ ...doneAccepted, completes: z35.literal("task") }).strict(),
4692
+ z35.object({ ...doneAccepted, completes: z35.literal("step"), next_step: z35.string().min(1) }).strict()
4693
+ ]),
4694
+ z35.object({
4695
+ ok: z35.literal(false),
4696
+ code: doneErrorCodeSchema,
4697
+ message,
4698
+ /** The workers that block the finish, and why each one does. */
4699
+ workers: z35.array(z35.object({
4700
+ worker_id: z35.string(),
4701
+ reason: z35.enum(["outstanding", "uncollected", "question"])
4702
+ }).strict()).max(64).optional(),
4703
+ open_waits: z35.array(openWaitSchema).max(WAIT_LIMIT).optional(),
4704
+ /** `input_pending` (hearsay-tools/squawk#2587): what the run still owes the agent. */
4705
+ owed: z35.array(doneOwedInputSchema).max(64).optional()
4706
+ }).strict()
4707
+ ]);
4708
+
4704
4709
  // ../contract/src/run-predicates.ts
4705
4710
  function latestSessionStep(steps, except) {
4706
4711
  let latest;
@@ -4880,73 +4885,73 @@ function sqlPrefilterTokens(query, options = {}) {
4880
4885
  }
4881
4886
 
4882
4887
  // ../contract/src/artifacts.ts
4883
- import { z as z35 } from "zod";
4884
- var pathSchema = z35.string().min(1).max(8192).refine((value) => !value.includes("\0"), "Path contains NUL");
4885
- var publishedArtifactSchema = z35.object({
4886
- id: z35.uuid(),
4887
- runId: z35.uuid(),
4888
- name: z35.string().min(1).max(255),
4889
- title: z35.string().max(200).optional(),
4888
+ import { z as z36 } from "zod";
4889
+ var pathSchema = z36.string().min(1).max(8192).refine((value) => !value.includes("\0"), "Path contains NUL");
4890
+ var publishedArtifactSchema = z36.object({
4891
+ id: z36.uuid(),
4892
+ runId: z36.uuid(),
4893
+ name: z36.string().min(1).max(255),
4894
+ title: z36.string().max(200).optional(),
4890
4895
  sourcePath: pathSchema.refine((value) => /^(?:\/|[A-Za-z]:[\\/]|\\\\)/.test(value), "Expected an absolute source path"),
4891
- createdAt: z35.iso.datetime(),
4892
- size: z35.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
4893
- sha256: z35.string().regex(/^[a-f0-9]{64}$/)
4896
+ createdAt: z36.iso.datetime(),
4897
+ size: z36.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
4898
+ sha256: z36.string().regex(/^[a-f0-9]{64}$/)
4894
4899
  }).strict();
4895
- var filePreviewDataSchema = z35.object({
4896
- type: z35.literal("file"),
4900
+ var filePreviewDataSchema = z36.object({
4901
+ type: z36.literal("file"),
4897
4902
  path: pathSchema,
4898
- size: z35.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
4899
- binary: z35.boolean(),
4900
- tooLarge: z35.boolean(),
4901
- content: z35.string().optional(),
4902
- source: z35.enum(["worktree", "project", "artifact"]),
4903
+ size: z36.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
4904
+ binary: z36.boolean(),
4905
+ tooLarge: z36.boolean(),
4906
+ content: z36.string().optional(),
4907
+ source: z36.enum(["worktree", "project", "artifact"]),
4903
4908
  artifact: publishedArtifactSchema.optional()
4904
4909
  }).strict();
4905
- var fileLinkResultSchema = z35.union([
4910
+ var fileLinkResultSchema = z36.union([
4906
4911
  filePreviewDataSchema,
4907
- z35.object({
4908
- type: z35.enum(["unavailable", "unpublished"]),
4912
+ z36.object({
4913
+ type: z36.enum(["unavailable", "unpublished"]),
4909
4914
  path: pathSchema,
4910
- reason: z35.string().min(1).max(4096)
4915
+ reason: z36.string().min(1).max(4096)
4911
4916
  }).strict()
4912
4917
  ]);
4913
- var artifactMetadataResponseSchema = z35.object({ artifact: publishedArtifactSchema }).strict();
4914
- var artifactListSchema = z35.object({ artifacts: z35.array(publishedArtifactSchema).max(64) }).strict();
4915
- var fileLinkQuerySchema = z35.object({ path: pathSchema, raw: z35.literal("1").optional() }).strict();
4916
- var artifactParamsSchema = z35.object({ id: z35.uuid(), artifactId: z35.uuid() });
4918
+ var artifactMetadataResponseSchema = z36.object({ artifact: publishedArtifactSchema }).strict();
4919
+ var artifactListSchema = z36.object({ artifacts: z36.array(publishedArtifactSchema).max(64) }).strict();
4920
+ var fileLinkQuerySchema = z36.object({ path: pathSchema, raw: z36.literal("1").optional() }).strict();
4921
+ var artifactParamsSchema = z36.object({ id: z36.uuid(), artifactId: z36.uuid() });
4917
4922
 
4918
4923
  // ../contract/src/discovery.ts
4919
- import { z as z36 } from "zod";
4920
- var hostDiscoveryRequestSchema = z36.discriminatedUnion("kind", [
4921
- z36.object({ kind: z36.literal("runners") }).strict(),
4922
- z36.object({ kind: z36.literal("models"), runner: modelDiscoveryRunnerSchema }).strict()
4924
+ import { z as z37 } from "zod";
4925
+ var hostDiscoveryRequestSchema = z37.discriminatedUnion("kind", [
4926
+ z37.object({ kind: z37.literal("runners") }).strict(),
4927
+ z37.object({ kind: z37.literal("models"), runner: modelDiscoveryRunnerSchema }).strict()
4923
4928
  ]);
4924
- var discoveryRequestSchema = z36.discriminatedUnion("kind", [
4929
+ var discoveryRequestSchema = z37.discriminatedUnion("kind", [
4925
4930
  ...hostDiscoveryRequestSchema.options,
4926
- z36.object({ kind: z36.literal("tasks"), all: z36.boolean().optional(), offset: z36.number().int().min(0).max(Number.MAX_SAFE_INTEGER).optional() }).strict()
4931
+ z37.object({ kind: z37.literal("tasks"), all: z37.boolean().optional(), offset: z37.number().int().min(0).max(Number.MAX_SAFE_INTEGER).optional() }).strict()
4927
4932
  ]);
4928
4933
  var discoveredRunnerSchema = providerStatusSchema.omit({ provider: true, profileId: true }).extend({ runner: modelDiscoveryRunnerSchema });
4929
- var discoveredRunnersSchema = z36.object({
4930
- scope: z36.literal("host-default-account"),
4931
- runners: z36.array(discoveredRunnerSchema)
4932
- });
4933
- var discoveredTasksSchema = z36.object({
4934
- tasks: z36.array(z36.object({
4935
- id: z36.string(),
4936
- title: z36.string(),
4934
+ var discoveredRunnersSchema = z37.object({
4935
+ scope: z37.literal("host-default-account"),
4936
+ runners: z37.array(discoveredRunnerSchema)
4937
+ });
4938
+ var discoveredTasksSchema = z37.object({
4939
+ tasks: z37.array(z37.object({
4940
+ id: z37.string(),
4941
+ title: z37.string(),
4937
4942
  runner: runnerSchema.optional(),
4938
4943
  status: runStatusSchema,
4939
- attention: z36.enum(["permission", "error", "waiting", "running", "unseen", "none"]),
4940
- attentionLabel: z36.string(),
4941
- accepts: z36.boolean(),
4942
- reason: z36.string().optional()
4944
+ attention: z37.enum(["permission", "error", "waiting", "running", "unseen", "none"]),
4945
+ attentionLabel: z37.string(),
4946
+ accepts: z37.boolean(),
4947
+ reason: z37.string().optional()
4943
4948
  })).max(32),
4944
- nextOffset: z36.number().int().nonnegative().optional()
4949
+ nextOffset: z37.number().int().nonnegative().optional()
4945
4950
  });
4946
- var discoveryResponseSchema = z36.union([discoveredRunnersSchema, runnerModelCatalogResponseSchema, discoveredTasksSchema]);
4951
+ var discoveryResponseSchema = z37.union([discoveredRunnersSchema, runnerModelCatalogResponseSchema, discoveredTasksSchema]);
4947
4952
 
4948
4953
  // ../contract/src/live.ts
4949
- import { z as z37 } from "zod";
4954
+ import { z as z38 } from "zod";
4950
4955
 
4951
4956
  // ../contract/src/live-limits.ts
4952
4957
  var LIVE_RUN_LIMIT = 32;
@@ -4954,44 +4959,44 @@ var LIVE_EVENT_LIMIT = 256;
4954
4959
  var LIVE_BYTE_LIMIT = 1024 * 1024;
4955
4960
 
4956
4961
  // ../contract/src/live.ts
4957
- var liveRunDemandSchema = z37.object({
4958
- projectId: z37.string().min(1).max(128).regex(/^[a-zA-Z0-9_-]+$/),
4962
+ var liveRunDemandSchema = z38.object({
4963
+ projectId: z38.string().min(1).max(128).regex(/^[a-zA-Z0-9_-]+$/),
4959
4964
  runId: runIdParamSchema.shape.id,
4960
4965
  cursor: runHistoryCursorSchema.optional(),
4961
- afterSeq: z37.number().int().nonnegative().safe()
4966
+ afterSeq: z38.number().int().nonnegative().safe()
4962
4967
  });
4963
- var liveRunsRequestSchema = z37.object({
4964
- runs: z37.array(liveRunDemandSchema).min(1).max(LIVE_RUN_LIMIT)
4968
+ var liveRunsRequestSchema = z38.object({
4969
+ runs: z38.array(liveRunDemandSchema).min(1).max(LIVE_RUN_LIMIT)
4965
4970
  }).refine(({ runs }) => new Set(runs.map((r) => `${r.projectId}/${r.runId}`)).size === runs.length, {
4966
4971
  message: "duplicate run demand"
4967
4972
  });
4968
4973
  var identity = liveRunDemandSchema.pick({ projectId: true, runId: true });
4969
4974
  var liveRunErrorSchema = identity.extend({
4970
- type: z37.enum(["error", "reset"]),
4971
- status: z37.union([z37.literal(400), z37.literal(404), z37.literal(409), z37.literal(413), z37.literal(503)]),
4972
- error: z37.string()
4975
+ type: z38.enum(["error", "reset"]),
4976
+ status: z38.union([z38.literal(400), z38.literal(404), z38.literal(409), z38.literal(413), z38.literal(503)]),
4977
+ error: z38.string()
4973
4978
  });
4974
4979
  var liveRunBatchSchema = identity.extend({
4975
- type: z37.literal("batch"),
4976
- events: z37.array(runHistoryEventSchema).max(LIVE_EVENT_LIMIT),
4980
+ type: z38.literal("batch"),
4981
+ events: z38.array(runHistoryEventSchema).max(LIVE_EVENT_LIMIT),
4977
4982
  cursor: runHistoryCursorSchema,
4978
- afterSeq: z37.number().int().nonnegative(),
4979
- hasMore: z37.boolean()
4980
- });
4981
- var liveRunBatchResultSchema = z37.union([liveRunBatchSchema, liveRunErrorSchema]);
4982
- var liveRunBatchResponseSchema = z37.object({
4983
- generation: z37.string(),
4984
- results: z37.array(liveRunBatchResultSchema)
4985
- });
4986
- var liveRunFrameSchema = z37.union([
4987
- z37.object({ type: z37.literal("ready"), generation: z37.string() }),
4988
- z37.object({ type: z37.literal("ping") }),
4989
- identity.extend({ type: z37.literal("event"), name: z37.enum(["run-event", "ui-event"]), event: runHistoryEventSchema }),
4983
+ afterSeq: z38.number().int().nonnegative(),
4984
+ hasMore: z38.boolean()
4985
+ });
4986
+ var liveRunBatchResultSchema = z38.union([liveRunBatchSchema, liveRunErrorSchema]);
4987
+ var liveRunBatchResponseSchema = z38.object({
4988
+ generation: z38.string(),
4989
+ results: z38.array(liveRunBatchResultSchema)
4990
+ });
4991
+ var liveRunFrameSchema = z38.union([
4992
+ z38.object({ type: z38.literal("ready"), generation: z38.string() }),
4993
+ z38.object({ type: z38.literal("ping") }),
4994
+ identity.extend({ type: z38.literal("event"), name: z38.enum(["run-event", "ui-event"]), event: runHistoryEventSchema }),
4990
4995
  liveRunErrorSchema
4991
4996
  ]);
4992
4997
 
4993
4998
  // ../contract/src/activity.ts
4994
- import { z as z38 } from "zod";
4999
+ import { z as z39 } from "zod";
4995
5000
  var ACTIVITY_RATE_SECONDS = 30;
4996
5001
  var ACTIVITY_TEXT_MAX = 500;
4997
5002
  var ACTIVITY_ERROR_MAX = 200;
@@ -4999,144 +5004,144 @@ var ACTIVITY_TOOL_TITLE_MAX = 160;
4999
5004
  var ACTIVITY_CHECKS_MAX = 100;
5000
5005
  var ACTIVITY_CHECK_NAME_MAX = 100;
5001
5006
  var ACTIVITY_CLOSED_WINDOW_MS = 3e4;
5002
- var iso = z38.iso.datetime();
5003
- var count = z38.number().int().nonnegative();
5004
- var runId = z38.string().min(1);
5007
+ var iso = z39.iso.datetime();
5008
+ var count = z39.number().int().nonnegative();
5009
+ var runId = z39.string().min(1);
5005
5010
  var ACTIVITY_TOOL_KINDS = ["read", "edit", "delete", "move", "search", "execute", "think", "fetch", "task", "plan", "other"];
5006
- var activityToolSchema = z38.object({
5007
- title: z38.string().max(ACTIVITY_TOOL_TITLE_MAX),
5008
- toolKind: z38.enum(ACTIVITY_TOOL_KINDS),
5009
- status: z38.enum(["pending", "running", "completed", "failed", "declined"]),
5011
+ var activityToolSchema = z39.object({
5012
+ title: z39.string().max(ACTIVITY_TOOL_TITLE_MAX),
5013
+ toolKind: z39.enum(ACTIVITY_TOOL_KINDS),
5014
+ status: z39.enum(["pending", "running", "completed", "failed", "declined"]),
5010
5015
  startedAt: iso,
5011
5016
  endedAt: iso.optional()
5012
5017
  }).strict();
5013
- var activityCheckBucketSchema = z38.enum(["pass", "fail", "pending", "skipping", "cancel"]);
5014
- var activityPrProgressSchema = z38.object({
5015
- checks: z38.array(z38.object({ name: z38.string().max(ACTIVITY_CHECK_NAME_MAX), bucket: activityCheckBucketSchema }).strict()).max(ACTIVITY_CHECKS_MAX),
5016
- counts: z38.object({ pass: count, fail: count, pending: count, skipping: count, cancel: count }).strict(),
5017
- truncated: z38.literal(true).optional()
5018
+ var activityCheckBucketSchema = z39.enum(["pass", "fail", "pending", "skipping", "cancel"]);
5019
+ var activityPrProgressSchema = z39.object({
5020
+ checks: z39.array(z39.object({ name: z39.string().max(ACTIVITY_CHECK_NAME_MAX), bucket: activityCheckBucketSchema }).strict()).max(ACTIVITY_CHECKS_MAX),
5021
+ counts: z39.object({ pass: count, fail: count, pending: count, skipping: count, cancel: count }).strict(),
5022
+ truncated: z39.literal(true).optional()
5018
5023
  }).strict();
5019
- var activityWaitSchema = z38.discriminatedUnion("kind", [
5020
- z38.object({
5021
- kind: z38.literal("human"),
5024
+ var activityWaitSchema = z39.discriminatedUnion("kind", [
5025
+ z39.object({
5026
+ kind: z39.literal("human"),
5022
5027
  since: iso,
5023
- detail: z38.object({
5028
+ detail: z39.object({
5024
5029
  /** The ask card's first question. */
5025
- question: z38.string().max(ACTIVITY_TEXT_MAX).optional(),
5030
+ question: z39.string().max(ACTIVITY_TEXT_MAX).optional(),
5026
5031
  /** `question`: an open question; `turn-end`: Squawk's `no-wait` wait; `budget`: the
5027
5032
  * automatic-wake budget is spent; `completion`: Squawk's completion gate. */
5028
- reason: z38.enum(["question", "turn-end", "budget", "completion"]),
5033
+ reason: z39.enum(["question", "turn-end", "budget", "completion"]),
5029
5034
  /** Inputs not delivered yet, when there are any. */
5030
- queuedMessages: z38.number().int().positive().optional()
5035
+ queuedMessages: z39.number().int().positive().optional()
5031
5036
  }).strict()
5032
5037
  }).strict(),
5033
- z38.object({ kind: z38.literal("usage-limit"), detail: z38.object({ resumeAt: z38.string() }).strict() }).strict(),
5034
- z38.object({
5035
- kind: z38.literal("workers"),
5038
+ z39.object({ kind: z39.literal("usage-limit"), detail: z39.object({ resumeAt: z39.string() }).strict() }).strict(),
5039
+ z39.object({
5040
+ kind: z39.literal("workers"),
5036
5041
  since: iso,
5037
5042
  deadline: iso.optional(),
5038
- detail: z38.object({
5043
+ detail: z39.object({
5039
5044
  /** `computeWaitingOn`'s count: the unanswered targets, summed over the entries. */
5040
5045
  owed: count,
5041
5046
  /** Targets named and targets settled, summed over the entries. */
5042
5047
  total: count,
5043
5048
  settled: count,
5044
5049
  /** Every open entry waits on request replies. */
5045
- replies: z38.literal(true).optional(),
5050
+ replies: z39.literal(true).optional(),
5046
5051
  /** Only when one entry is open. */
5047
5052
  mode: workerWaitModeSchema.optional(),
5048
5053
  /** Who owes the awaited replies, each once. */
5049
- recipientRunIds: z38.array(runId)
5054
+ recipientRunIds: z39.array(runId)
5050
5055
  }).strict()
5051
5056
  }).strict(),
5052
- z38.object({ kind: z38.literal("peers"), since: iso, deadline: iso, detail: z38.object({ peerRunIds: z38.array(runId) }).strict() }).strict(),
5053
- z38.object({ kind: z38.literal("subagents"), since: iso, deadline: iso, detail: z38.object({ running: count }).strict() }).strict(),
5054
- z38.object({
5055
- kind: z38.literal("pr"),
5057
+ z39.object({ kind: z39.literal("peers"), since: iso, deadline: iso, detail: z39.object({ peerRunIds: z39.array(runId) }).strict() }).strict(),
5058
+ z39.object({ kind: z39.literal("subagents"), since: iso, deadline: iso, detail: z39.object({ running: count }).strict() }).strict(),
5059
+ z39.object({
5060
+ kind: z39.literal("pr"),
5056
5061
  since: iso,
5057
5062
  deadline: iso,
5058
- detail: z38.object({
5059
- number: z38.number().int().positive(),
5063
+ detail: z39.object({
5064
+ number: z39.number().int().positive(),
5060
5065
  target: prWaitUntilSchema,
5061
5066
  /** Check progress, while the CI progress registry holds some for this wait. */
5062
5067
  checks: activityPrProgressSchema.shape.checks.optional(),
5063
5068
  counts: activityPrProgressSchema.shape.counts.optional(),
5064
- truncated: z38.literal(true).optional()
5069
+ truncated: z39.literal(true).optional()
5065
5070
  }).strict()
5066
5071
  }).strict(),
5067
- z38.object({ kind: z38.literal("process"), since: iso, deadline: iso, detail: z38.object({ pid: z38.number().int(), note: z38.string().optional() }).strict() }).strict(),
5068
- z38.object({ kind: z38.literal("timer"), since: iso, deadline: iso, detail: z38.object({ wakeAt: iso, note: z38.string().optional() }).strict() }).strict()
5072
+ z39.object({ kind: z39.literal("process"), since: iso, deadline: iso, detail: z39.object({ pid: z39.number().int(), note: z39.string().optional() }).strict() }).strict(),
5073
+ z39.object({ kind: z39.literal("timer"), since: iso, deadline: iso, detail: z39.object({ wakeAt: iso, note: z39.string().optional() }).strict() }).strict()
5069
5074
  ]);
5070
5075
  var activityRunShape = {
5071
5076
  runId,
5072
5077
  /** The display title: `titleSummary ?? title`. */
5073
- title: z38.string(),
5078
+ title: z39.string(),
5074
5079
  status: runStatusSchema,
5075
5080
  /** The `deriveAttention` rung id, never a label. */
5076
- rung: z38.enum(ATTENTION_RUNGS),
5081
+ rung: z39.enum(ATTENTION_RUNGS),
5077
5082
  runner: runnerSchema.optional(),
5078
- model: z38.string().optional(),
5079
- currentStepId: z38.string().optional(),
5080
- startedAt: z38.string().optional(),
5083
+ model: z39.string().optional(),
5084
+ currentStepId: z39.string().optional(),
5085
+ startedAt: z39.string().optional(),
5081
5086
  wait: activityWaitSchema.optional(),
5082
5087
  tool: activityToolSchema.optional(),
5083
5088
  /** Tool calls started per second, oldest first. */
5084
- rate: z38.array(count).length(ACTIVITY_RATE_SECONDS),
5089
+ rate: z39.array(count).length(ACTIVITY_RATE_SECONDS),
5085
5090
  /** One line of `RunRecord.error`. */
5086
- error: z38.string().max(ACTIVITY_ERROR_MAX).optional()
5091
+ error: z39.string().max(ACTIVITY_ERROR_MAX).optional()
5087
5092
  };
5088
- var activityWorkerSchema = z38.object({
5093
+ var activityWorkerSchema = z39.object({
5089
5094
  ...activityRunShape,
5090
5095
  /** The worker's current execution revision. */
5091
5096
  revision: count,
5092
5097
  /** The parent holds a collected result for this revision. */
5093
- collected: z38.boolean()
5098
+ collected: z39.boolean()
5094
5099
  }).strict();
5095
- var activityRunSchema = z38.object({ ...activityRunShape, workers: z38.array(activityWorkerSchema) }).strict();
5096
- var activityRequestSchema = z38.object({
5097
- requestId: z38.uuid(),
5098
- relationship: z38.enum(["family", "peer"]),
5100
+ var activityRunSchema = z39.object({ ...activityRunShape, workers: z39.array(activityWorkerSchema) }).strict();
5101
+ var activityRequestSchema = z39.object({
5102
+ requestId: z39.uuid(),
5103
+ relationship: z39.enum(["family", "peer"]),
5099
5104
  senderRunId: runId,
5100
5105
  recipientRunId: runId,
5101
- text: z38.string().max(ACTIVITY_TEXT_MAX),
5102
- senderTitle: z38.string().optional(),
5103
- recipientTitle: z38.string().optional(),
5106
+ text: z39.string().max(ACTIVITY_TEXT_MAX),
5107
+ senderTitle: z39.string().optional(),
5108
+ recipientTitle: z39.string().optional(),
5104
5109
  createdAt: iso,
5105
5110
  deadline: iso.optional()
5106
5111
  }).strict();
5107
- var activityClosedRequestSchema = z38.object({
5108
- requestId: z38.uuid(),
5112
+ var activityClosedRequestSchema = z39.object({
5113
+ requestId: z39.uuid(),
5109
5114
  senderRunId: runId,
5110
5115
  recipientRunId: runId,
5111
5116
  status: requestOutcomeSchema.shape.status,
5112
5117
  observedAt: iso
5113
5118
  }).strict();
5114
- var activityProjectSchema = z38.object({
5115
- projectId: z38.string(),
5116
- name: z38.string(),
5119
+ var activityProjectSchema = z39.object({
5120
+ projectId: z39.string(),
5121
+ name: z39.string(),
5117
5122
  /** False for a project this process has not loaded: its lists are empty because nothing was read. */
5118
- loaded: z38.boolean(),
5123
+ loaded: z39.boolean(),
5119
5124
  /** The project is loaded but its run store cannot open: the failure its project routes answer.
5120
5125
  * The lists are empty because nothing could be read, not because nothing runs. */
5121
- unavailable: z38.object({ status: z38.union([z38.literal(404), z38.literal(409), z38.literal(503)]), error: z38.string() }).strict().optional(),
5126
+ unavailable: z39.object({ status: z39.union([z39.literal(404), z39.literal(409), z39.literal(503)]), error: z39.string() }).strict().optional(),
5122
5127
  /** Root tasks in review: the summary chip (D8). */
5123
5128
  inReview: count,
5124
- tasks: z38.array(activityRunSchema),
5125
- requests: z38.array(activityRequestSchema),
5126
- closed: z38.array(activityClosedRequestSchema)
5129
+ tasks: z39.array(activityRunSchema),
5130
+ requests: z39.array(activityRequestSchema),
5131
+ closed: z39.array(activityClosedRequestSchema)
5127
5132
  }).strict();
5128
- var activitySnapshotSchema = z38.object({
5133
+ var activitySnapshotSchema = z39.object({
5129
5134
  /** The server clock; the client ticks ages from it. */
5130
5135
  generatedAt: iso,
5131
5136
  /** One entry, or every visible project for the global read. */
5132
- projects: z38.array(activityProjectSchema)
5137
+ projects: z39.array(activityProjectSchema)
5133
5138
  }).strict();
5134
- var activityQuerySchema = z38.object({
5135
- project: z38.union([z38.literal("default"), z38.string().regex(PROJECT_ID_PATTERN)]).optional()
5139
+ var activityQuerySchema = z39.object({
5140
+ project: z39.union([z39.literal("default"), z39.string().regex(PROJECT_ID_PATTERN)]).optional()
5136
5141
  });
5137
5142
 
5138
5143
  // ../contract/src/live-coordination.ts
5139
- import { z as z39 } from "zod";
5144
+ import { z as z40 } from "zod";
5140
5145
  var LIVE_PROTOCOL = 3;
5141
5146
  var LIVE_WORKER_NAME = "cezar-live-v3";
5142
5147
  var LEASE_MS = 15e3;
@@ -5145,111 +5150,111 @@ function allowedLiveRead(path) {
5145
5150
  if (!path.startsWith("/api/v1/") || path.includes("#") || /[\\\r\n]/.test(path)) return false;
5146
5151
  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);
5147
5152
  }
5148
- var liveDemandSchema = z39.discriminatedUnion("kind", [
5149
- z39.object({ kind: z39.literal("workspace") }),
5150
- liveRunDemandSchema.extend({ kind: z39.literal("run") }),
5151
- z39.object({ kind: z39.literal("topic"), topic: z39.string().min(1).max(128) }),
5153
+ var liveDemandSchema = z40.discriminatedUnion("kind", [
5154
+ z40.object({ kind: z40.literal("workspace") }),
5155
+ liveRunDemandSchema.extend({ kind: z40.literal("run") }),
5156
+ z40.object({ kind: z40.literal("topic"), topic: z40.string().min(1).max(128) }),
5152
5157
  // Preserve server-directed cadence (settled references use ten minutes). Only
5153
5158
  // bound the timer itself: larger delays overflow setTimeout into a tight loop.
5154
- z39.object({ kind: z39.literal("read"), path: z39.string().max(4096).refine(allowedLiveRead), intervalMs: z39.number().int().min(1e3).max(2147483647) })
5159
+ z40.object({ kind: z40.literal("read"), path: z40.string().max(4096).refine(allowedLiveRead), intervalMs: z40.number().int().min(1e3).max(2147483647) })
5155
5160
  ]);
5156
- var liveEntrySchema = z39.object({ id: z39.string().min(1).max(128), demand: liveDemandSchema });
5157
- var envelope = z39.object({ version: z39.literal(LIVE_PROTOCOL), documentId: z39.string().min(1).max(128), epoch: z39.number().int().nonnegative() });
5158
- var ownerInputSchema = z39.discriminatedUnion("type", [
5161
+ var liveEntrySchema = z40.object({ id: z40.string().min(1).max(128), demand: liveDemandSchema });
5162
+ var envelope = z40.object({ version: z40.literal(LIVE_PROTOCOL), documentId: z40.string().min(1).max(128), epoch: z40.number().int().nonnegative() });
5163
+ var ownerInputSchema = z40.discriminatedUnion("type", [
5159
5164
  envelope.extend({
5160
- type: z39.literal("sync"),
5161
- entries: z39.array(liveEntrySchema).max(64),
5165
+ type: z40.literal("sync"),
5166
+ entries: z40.array(liveEntrySchema).max(64),
5162
5167
  /** The document knows no workspace stream generation (its `ready` was lost, for example to
5163
5168
  * an epoch change): send it the stream's `ready` again (hearsay-tools/cezarion#2729). */
5164
- workspaceReady: z39.literal(true).optional()
5169
+ workspaceReady: z40.literal(true).optional()
5165
5170
  }).refine((value) => new Set(value.entries.map((e) => e.id)).size === value.entries.length),
5166
- envelope.extend({ type: z39.literal("ack"), id: z39.string(), seq: z39.number().int().nonnegative() }),
5167
- envelope.extend({ type: z39.literal("refresh"), id: z39.string() })
5171
+ envelope.extend({ type: z40.literal("ack"), id: z40.string(), seq: z40.number().int().nonnegative() }),
5172
+ envelope.extend({ type: z40.literal("refresh"), id: z40.string() })
5168
5173
  ]);
5169
- var wireFrameSchema = z39.object({ event: z39.string(), data: z39.string(), id: z39.string() });
5170
- var ownerOutputSchema = z39.discriminatedUnion("type", [
5171
- z39.object({ type: z39.literal("unavailable"), version: z39.literal(LIVE_PROTOCOL), epoch: z39.number(), reason: z39.string() }),
5172
- z39.object({ type: z39.literal("hello"), version: z39.literal(LIVE_PROTOCOL) }),
5173
- z39.object({ type: z39.literal("alive"), version: z39.literal(LIVE_PROTOCOL), epoch: z39.number() }),
5174
- z39.object({ type: z39.literal("frame"), version: z39.literal(LIVE_PROTOCOL), epoch: z39.number(), id: z39.string(), frame: z39.union([wireFrameSchema, liveRunFrameSchema]) }),
5175
- z39.object({ type: z39.literal("value"), version: z39.literal(LIVE_PROTOCOL), epoch: z39.number(), id: z39.string(), value: z39.unknown(), error: z39.string().optional() }),
5176
- z39.object({ type: z39.literal("reset"), version: z39.literal(LIVE_PROTOCOL), epoch: z39.number(), id: z39.string(), reason: z39.string() })
5174
+ var wireFrameSchema = z40.object({ event: z40.string(), data: z40.string(), id: z40.string() });
5175
+ var ownerOutputSchema = z40.discriminatedUnion("type", [
5176
+ z40.object({ type: z40.literal("unavailable"), version: z40.literal(LIVE_PROTOCOL), epoch: z40.number(), reason: z40.string() }),
5177
+ z40.object({ type: z40.literal("hello"), version: z40.literal(LIVE_PROTOCOL) }),
5178
+ z40.object({ type: z40.literal("alive"), version: z40.literal(LIVE_PROTOCOL), epoch: z40.number() }),
5179
+ z40.object({ type: z40.literal("frame"), version: z40.literal(LIVE_PROTOCOL), epoch: z40.number(), id: z40.string(), frame: z40.union([wireFrameSchema, liveRunFrameSchema]) }),
5180
+ z40.object({ type: z40.literal("value"), version: z40.literal(LIVE_PROTOCOL), epoch: z40.number(), id: z40.string(), value: z40.unknown(), error: z40.string().optional() }),
5181
+ z40.object({ type: z40.literal("reset"), version: z40.literal(LIVE_PROTOCOL), epoch: z40.number(), id: z40.string(), reason: z40.string() })
5177
5182
  ]);
5178
5183
  var runKey = (run) => `${run.projectId}/${run.runId}`;
5179
5184
 
5180
5185
  // ../contract/src/workspace-events.ts
5181
- import { z as z40 } from "zod";
5182
- var workspaceEventsQuerySchema = z40.object({
5183
- runs: z40.literal("summary").optional()
5186
+ import { z as z41 } from "zod";
5187
+ var workspaceEventsQuerySchema = z41.object({
5188
+ runs: z41.literal("summary").optional()
5184
5189
  });
5185
- var projectStamp = z40.string().min(1);
5186
- var frameSeq = z40.number().int().positive();
5187
- var workspaceRunSummaryEventSchema = z40.object({
5190
+ var projectStamp = z41.string().min(1);
5191
+ var frameSeq = z41.number().int().positive();
5192
+ var workspaceRunSummaryEventSchema = z41.object({
5188
5193
  project: projectStamp,
5189
5194
  seq: frameSeq,
5190
5195
  run: runSummarySchema,
5191
- relationships: z40.string().min(1)
5196
+ relationships: z41.string().min(1)
5192
5197
  });
5193
- var workspaceRunDeletedEventSchema = z40.object({
5198
+ var workspaceRunDeletedEventSchema = z41.object({
5194
5199
  project: projectStamp,
5195
5200
  seq: frameSeq,
5196
- id: z40.string().min(1)
5201
+ id: z41.string().min(1)
5197
5202
  });
5198
- var workspaceReadyEventSchema = z40.object({
5199
- generation: z40.string().min(1),
5200
- seq: z40.number().int().nonnegative()
5203
+ var workspaceReadyEventSchema = z41.object({
5204
+ generation: z41.string().min(1),
5205
+ seq: z41.number().int().nonnegative()
5201
5206
  });
5202
- var workspaceUsageEventSchema = z40.object({
5207
+ var workspaceUsageEventSchema = z41.object({
5203
5208
  project: projectStamp,
5204
- usage: z40.record(z40.string(), processUsageSchema)
5209
+ usage: z41.record(z41.string(), processUsageSchema)
5205
5210
  });
5206
- var runsIndexResponseSchema = z40.object({
5211
+ var runsIndexResponseSchema = z41.object({
5207
5212
  /** Newest first, across every registered project: each project's window
5208
5213
  * (hearsay-tools/cezarion#864) — every unarchived root run, plus its newest `perProjectLimit`
5209
5214
  * archived root runs. Owned workers are never included. Older archived runs are reached
5210
5215
  * through `GET /workspace/runs-search`. */
5211
- runs: z40.array(runIndexEntrySchema),
5216
+ runs: z41.array(runIndexEntrySchema),
5212
5217
  /** Additive: absent statuses mean "nothing warm", never "nothing to show". */
5213
5218
  referenceStatuses: referenceStatusesByProjectSchema,
5214
5219
  /** How many archived root runs each project contributes at most. Unarchived roots are never cut. */
5215
- perProjectLimit: z40.number(),
5220
+ perProjectLimit: z41.number(),
5216
5221
  /** Ids of the projects that had more archived root runs than `perProjectLimit`. */
5217
- truncated: z40.array(z40.string()),
5222
+ truncated: z41.array(z41.string()),
5218
5223
  /** The server process that answered: the workspace stream's `ready.generation`. An `eventSeq`
5219
5224
  * compares only within one generation. */
5220
- generation: z40.string().min(1),
5225
+ generation: z41.string().min(1),
5221
5226
  /** The last workspace stream `seq` this answer includes: every `run-summary` and `run-deleted`
5222
5227
  * frame at or below it is already in `runs`; a frame above it is newer than the snapshot. */
5223
- eventSeq: z40.number().int().nonnegative()
5228
+ eventSeq: z41.number().int().nonnegative()
5224
5229
  });
5225
5230
 
5226
5231
  // ../contract/src/permissions.ts
5227
- import { z as z41 } from "zod";
5228
- var permissionOptionKindSchema = z41.enum(["allow_once", "allow_always", "reject_once", "reject_always"]);
5229
- var permissionOptionSchema = z41.object({
5230
- id: z41.string().min(1).max(128),
5231
- label: z41.string().min(1),
5232
+ import { z as z42 } from "zod";
5233
+ var permissionOptionKindSchema = z42.enum(["allow_once", "allow_always", "reject_once", "reject_always"]);
5234
+ var permissionOptionSchema = z42.object({
5235
+ id: z42.string().min(1).max(128),
5236
+ label: z42.string().min(1),
5232
5237
  kind: permissionOptionKindSchema
5233
5238
  }).strict();
5234
- var permissionRequestedSchema = z41.object({
5235
- type: z41.literal("permission.requested"),
5236
- requestId: z41.string().min(1).max(128),
5237
- itemId: z41.string().optional(),
5238
- title: z41.string().min(1),
5239
- details: z41.string().optional(),
5240
- options: z41.array(permissionOptionSchema).min(1).refine((options) => new Set(options.map((option) => option.id)).size === options.length)
5239
+ var permissionRequestedSchema = z42.object({
5240
+ type: z42.literal("permission.requested"),
5241
+ requestId: z42.string().min(1).max(128),
5242
+ itemId: z42.string().optional(),
5243
+ title: z42.string().min(1),
5244
+ details: z42.string().optional(),
5245
+ options: z42.array(permissionOptionSchema).min(1).refine((options) => new Set(options.map((option) => option.id)).size === options.length)
5241
5246
  }).strict();
5242
- var permissionResolvedSchema = z41.object({
5243
- type: z41.literal("permission.resolved"),
5244
- requestId: z41.string().min(1).max(128),
5245
- optionId: z41.string().optional(),
5246
- reason: z41.string().optional()
5247
+ var permissionResolvedSchema = z42.object({
5248
+ type: z42.literal("permission.resolved"),
5249
+ requestId: z42.string().min(1).max(128),
5250
+ optionId: z42.string().optional(),
5251
+ reason: z42.string().optional()
5247
5252
  }).strict();
5248
- var permissionDecisionSchema = z41.object({
5249
- requestId: z41.string().min(1).max(128),
5250
- optionId: z41.string().min(1).max(128)
5253
+ var permissionDecisionSchema = z42.object({
5254
+ requestId: z42.string().min(1).max(128),
5255
+ optionId: z42.string().min(1).max(128)
5251
5256
  }).strict();
5252
- var permissionDecisionResponseSchema = z41.object({ delivered: z41.literal(true) });
5257
+ var permissionDecisionResponseSchema = z42.object({ delivered: z42.literal(true) });
5253
5258
 
5254
5259
  // ../contract/src/defined.ts
5255
5260
  function defined(value) {
@@ -5519,83 +5524,83 @@ function isImagePath(path) {
5519
5524
  }
5520
5525
 
5521
5526
  // ../contract/src/provider-requests.ts
5522
- import { z as z42 } from "zod";
5523
- var providerConnectSchema = z42.object({
5527
+ import { z as z43 } from "zod";
5528
+ var providerConnectSchema = z43.object({
5524
5529
  provider: runnerSchema,
5525
5530
  /** Which agent account to sign in (spec 2026-07-29-agent-profiles). Absent = the discovered
5526
5531
  * default, which is what every pre-profiles client sends. Without this, "Connect" on a second
5527
5532
  * Claude account would open a login for the FIRST one and report success. */
5528
- profileId: z42.string().max(64).optional()
5533
+ profileId: z43.string().max(64).optional()
5529
5534
  }).strict();
5530
- var createAgentProfileSchema = z42.object({
5535
+ var createAgentProfileSchema = z43.object({
5531
5536
  provider: runnerSchema,
5532
- label: z42.string().trim().max(200).optional(),
5533
- configDir: z42.string().trim().min(1).max(4096)
5537
+ label: z43.string().trim().max(200).optional(),
5538
+ configDir: z43.string().trim().min(1).max(4096)
5534
5539
  }).strict();
5535
- var updateAgentProfileSchema = z42.object({
5536
- label: z42.string().trim().max(200).optional(),
5537
- configDir: z42.string().trim().min(1).max(4096).optional()
5540
+ var updateAgentProfileSchema = z43.object({
5541
+ label: z43.string().trim().max(200).optional(),
5542
+ configDir: z43.string().trim().min(1).max(4096).optional()
5538
5543
  }).strict().refine(
5539
5544
  (value) => value.label !== void 0 || value.configDir !== void 0,
5540
5545
  "send label or configDir"
5541
5546
  );
5542
- var selectAgentProfileSchema = z42.object({
5543
- projectId: z42.string().min(1).max(64),
5547
+ var selectAgentProfileSchema = z43.object({
5548
+ projectId: z43.string().min(1).max(64),
5544
5549
  provider: runnerSchema,
5545
- profileId: z42.string().max(64).nullable()
5550
+ profileId: z43.string().max(64).nullable()
5546
5551
  }).strict();
5547
5552
  var providerParamSchema = runnerSchema;
5548
- var providerEnabledSchema = z42.object({ enabled: z42.boolean() }).strict();
5549
- var providerRetrySchema = z42.object({
5550
- authFailureId: z42.string().min(1).max(128)
5553
+ var providerEnabledSchema = z43.object({ enabled: z43.boolean() }).strict();
5554
+ var providerRetrySchema = z43.object({
5555
+ authFailureId: z43.string().min(1).max(128)
5551
5556
  }).strict();
5552
- var providerRouteParamsSchema = z42.object({ provider: providerParamSchema });
5553
- var agentProfileRouteParamsSchema = z42.object({ id: z42.string() });
5554
- var providerSignInParamsSchema = z42.object({ id: z42.uuid() });
5555
- var providerSignInRedirectSchema = z42.object({
5557
+ var providerRouteParamsSchema = z43.object({ provider: providerParamSchema });
5558
+ var agentProfileRouteParamsSchema = z43.object({ id: z43.string() });
5559
+ var providerSignInParamsSchema = z43.object({ id: z43.uuid() });
5560
+ var providerSignInRedirectSchema = z43.object({
5556
5561
  /** The address the browser landed on after consent, or the code that page shows. */
5557
- redirectUrl: z42.string().trim().min(1).max(8192)
5562
+ redirectUrl: z43.string().trim().min(1).max(8192)
5558
5563
  }).strict();
5559
5564
 
5560
5565
  // ../contract/src/automation-requests.ts
5561
- import { z as z44 } from "zod";
5566
+ import { z as z45 } from "zod";
5562
5567
 
5563
5568
  // ../contract/src/automation-storage.ts
5564
- import { z as z43 } from "zod";
5565
- var storedAutomationEventSchema = z43.enum([
5569
+ import { z as z44 } from "zod";
5570
+ var storedAutomationEventSchema = z44.enum([
5566
5571
  "pull_request.opened",
5567
5572
  "issue.opened",
5568
5573
  "issue.labeled",
5569
5574
  "issue.unlabeled"
5570
5575
  ]);
5571
- var boundedString = z43.string().trim().min(1).max(200);
5572
- var stringList = z43.array(boundedString).max(100).optional();
5573
- var storedAutomationFiltersSchema = z43.object({
5574
- includeExisting: z43.boolean().optional(),
5576
+ var boundedString = z44.string().trim().min(1).max(200);
5577
+ var stringList = z44.array(boundedString).max(100).optional();
5578
+ var storedAutomationFiltersSchema = z44.object({
5579
+ includeExisting: z44.boolean().optional(),
5575
5580
  /** Require an open item and matching live labels before reservation and launch. */
5576
- requireCurrentLabels: z43.boolean().optional(),
5581
+ requireCurrentLabels: z44.boolean().optional(),
5577
5582
  authors: stringList,
5578
5583
  assignees: stringList,
5579
5584
  allLabels: stringList,
5580
5585
  anyLabels: stringList,
5581
5586
  excludeLabels: stringList,
5582
5587
  changedLabels: stringList,
5583
- lookbackDays: z43.number().int().min(1).max(90).default(7),
5584
- maxRecords: z43.number().int().min(1).max(100).default(25)
5588
+ lookbackDays: z44.number().int().min(1).max(90).default(7),
5589
+ maxRecords: z44.number().int().min(1).max(100).default(25)
5585
5590
  }).passthrough();
5586
- var storedAutomationTaskSchema = z43.object({
5587
- prompt: z43.string().min(1).max(1e5),
5588
- workflow: z43.string().trim().min(1).max(200).optional(),
5589
- steps: z43.array(workflowStepDefSchema).min(1).max(100).optional(),
5591
+ var storedAutomationTaskSchema = z44.object({
5592
+ prompt: z44.string().min(1).max(1e5),
5593
+ workflow: z44.string().trim().min(1).max(200).optional(),
5594
+ steps: z44.array(workflowStepDefSchema).min(1).max(100).optional(),
5590
5595
  runner: runnerSchema.optional(),
5591
- model: z43.string().trim().min(1).max(200).optional(),
5592
- effort: z43.string().trim().min(1).max(32).optional(),
5593
- variants: z43.union([z43.literal(1), z43.literal(2), z43.literal(3)]).optional(),
5594
- worktree: z43.boolean().optional(),
5595
- autonomous: z43.boolean().optional(),
5596
+ model: z44.string().trim().min(1).max(200).optional(),
5597
+ effort: z44.string().trim().min(1).max(32).optional(),
5598
+ variants: z44.union([z44.literal(1), z44.literal(2), z44.literal(3)]).optional(),
5599
+ worktree: z44.boolean().optional(),
5600
+ autonomous: z44.boolean().optional(),
5596
5601
  ...completionControlsShape,
5597
5602
  ...taskAccessShape,
5598
- systemPrompt: z43.string().max(1e5).optional()
5603
+ systemPrompt: z44.string().max(1e5).optional()
5599
5604
  }).passthrough().refine((task) => !(task.workflow && task.steps), {
5600
5605
  message: "task selects either a named workflow or inline steps, not both"
5601
5606
  });
@@ -5613,122 +5618,122 @@ var fillGithubDefaults = (raw) => {
5613
5618
  filters: record.filters ?? {}
5614
5619
  };
5615
5620
  };
5616
- var storedAutomationDefinitionObjectSchema = z43.object({
5617
- id: z43.string().min(1).max(100),
5618
- revision: z43.number().int().positive(),
5619
- name: z43.string().trim().min(1).max(200),
5620
- description: z43.string().max(2e3).optional(),
5621
- enabled: z43.boolean().default(false),
5621
+ var storedAutomationDefinitionObjectSchema = z44.object({
5622
+ id: z44.string().min(1).max(100),
5623
+ revision: z44.number().int().positive(),
5624
+ name: z44.string().trim().min(1).max(200),
5625
+ description: z44.string().max(2e3).optional(),
5626
+ enabled: z44.boolean().default(false),
5622
5627
  /** A definition written before schedules has no `kind`: it is a poll. */
5623
5628
  kind: automationKindSchema.default("github"),
5624
- events: z43.array(storedAutomationEventSchema).min(1).max(4).optional(),
5625
- intervalSeconds: z43.number().int().min(60).max(86400).optional(),
5629
+ events: z44.array(storedAutomationEventSchema).min(1).max(4).optional(),
5630
+ intervalSeconds: z44.number().int().min(60).max(86400).optional(),
5626
5631
  filters: storedAutomationFiltersSchema.optional(),
5627
5632
  // Passthrough like every other persisted layer: a schedule key a later build adds survives a save here.
5628
5633
  schedule: automationScheduleSchema.passthrough().optional(),
5629
5634
  task: storedAutomationTaskSchema,
5630
5635
  /** `once` schedules only (hearsay-tools/cezarion#1465): the archive record. */
5631
- archived: z43.object({
5632
- at: z43.string().datetime(),
5633
- outcome: z43.enum(["launched", "cancelled"]),
5634
- runId: z43.string().optional(),
5635
- receiptId: z43.string().optional(),
5636
- trigger: z43.enum(["schedule", "late", "manual", "retry"]).optional()
5636
+ archived: z44.object({
5637
+ at: z44.string().datetime(),
5638
+ outcome: z44.enum(["launched", "cancelled"]),
5639
+ runId: z44.string().optional(),
5640
+ receiptId: z44.string().optional(),
5641
+ trigger: z44.enum(["schedule", "late", "manual", "retry"]).optional()
5637
5642
  }).passthrough().optional(),
5638
- createdAt: z43.string().datetime(),
5639
- updatedAt: z43.string().datetime()
5643
+ createdAt: z44.string().datetime(),
5644
+ updatedAt: z44.string().datetime()
5640
5645
  }).passthrough().superRefine((definition, ctx) => {
5641
5646
  if (definition.kind === "schedule") {
5642
5647
  if (!definition.schedule) {
5643
- ctx.addIssue({ code: z43.ZodIssueCode.custom, path: ["schedule"], message: "a scheduled automation needs a schedule" });
5648
+ ctx.addIssue({ code: z44.ZodIssueCode.custom, path: ["schedule"], message: "a scheduled automation needs a schedule" });
5644
5649
  }
5645
5650
  return;
5646
5651
  }
5647
5652
  if (!definition.events?.length) {
5648
- ctx.addIssue({ code: z43.ZodIssueCode.custom, path: ["events"], message: "a GitHub automation needs at least one event" });
5653
+ ctx.addIssue({ code: z44.ZodIssueCode.custom, path: ["events"], message: "a GitHub automation needs at least one event" });
5649
5654
  }
5650
5655
  if (definition.intervalSeconds === void 0) {
5651
- ctx.addIssue({ code: z43.ZodIssueCode.custom, path: ["intervalSeconds"], message: "a GitHub automation needs a poll interval" });
5656
+ ctx.addIssue({ code: z44.ZodIssueCode.custom, path: ["intervalSeconds"], message: "a GitHub automation needs a poll interval" });
5652
5657
  }
5653
5658
  if (!definition.filters) {
5654
- ctx.addIssue({ code: z43.ZodIssueCode.custom, path: ["filters"], message: "a GitHub automation needs its bounded filter" });
5659
+ ctx.addIssue({ code: z44.ZodIssueCode.custom, path: ["filters"], message: "a GitHub automation needs its bounded filter" });
5655
5660
  }
5656
5661
  if (definition.events?.some((event) => event === "issue.labeled" || event === "issue.unlabeled") && !definition.filters?.changedLabels?.length) {
5657
5662
  ctx.addIssue({
5658
- code: z43.ZodIssueCode.custom,
5663
+ code: z44.ZodIssueCode.custom,
5659
5664
  path: ["filters", "changedLabels"],
5660
5665
  message: "changedLabels is required for issue label events"
5661
5666
  });
5662
5667
  }
5663
5668
  });
5664
- var storedAutomationDefinitionSchema = z43.preprocess(fillGithubDefaults, storedAutomationDefinitionObjectSchema);
5665
- var storedAutomationDefinitionsFileSchema = z43.object({
5666
- version: z43.literal(1).default(1),
5667
- automations: z43.array(z43.unknown()).default([]),
5668
- tombstones: z43.record(z43.string(), z43.string().datetime()).optional()
5669
+ var storedAutomationDefinitionSchema = z44.preprocess(fillGithubDefaults, storedAutomationDefinitionObjectSchema);
5670
+ var storedAutomationDefinitionsFileSchema = z44.object({
5671
+ version: z44.literal(1).default(1),
5672
+ automations: z44.array(z44.unknown()).default([]),
5673
+ tombstones: z44.record(z44.string(), z44.string().datetime()).optional()
5669
5674
  }).passthrough();
5670
- var storedAutomationCursorSchema = z43.object({
5671
- timestamp: z43.string().datetime(),
5672
- tieBreaker: z43.string().optional()
5675
+ var storedAutomationCursorSchema = z44.object({
5676
+ timestamp: z44.string().datetime(),
5677
+ tieBreaker: z44.string().optional()
5673
5678
  }).passthrough();
5674
5679
  var storedAutomationHistoryScanSchema = automationHistoryScanSchema.extend({
5675
5680
  cursor: storedAutomationCursorSchema.optional()
5676
5681
  });
5677
- var storedAutomationRuntimeStateSchema = z43.object({
5678
- revision: z43.number().int().positive().optional(),
5679
- baselineAt: z43.string().datetime().optional(),
5682
+ var storedAutomationRuntimeStateSchema = z44.object({
5683
+ revision: z44.number().int().positive().optional(),
5684
+ baselineAt: z44.string().datetime().optional(),
5680
5685
  /** Arming time, independent of a history window's older lower bound. */
5681
- armedAt: z43.string().datetime().optional(),
5686
+ armedAt: z44.string().datetime().optional(),
5682
5687
  historyScan: storedAutomationHistoryScanSchema.optional(),
5683
5688
  cursor: storedAutomationCursorSchema.optional(),
5684
- frozenHighWatermark: storedAutomationCursorSchema.extend({ tieBreaker: z43.string() }).optional(),
5685
- backlogAfter: storedAutomationCursorSchema.extend({ tieBreaker: z43.string() }).optional(),
5686
- nextCheckAt: z43.string().datetime().optional(),
5687
- lastSuccessAt: z43.string().datetime().optional(),
5689
+ frozenHighWatermark: storedAutomationCursorSchema.extend({ tieBreaker: z44.string() }).optional(),
5690
+ backlogAfter: storedAutomationCursorSchema.extend({ tieBreaker: z44.string() }).optional(),
5691
+ nextCheckAt: z44.string().datetime().optional(),
5692
+ lastSuccessAt: z44.string().datetime().optional(),
5688
5693
  /** schedule kind: the next occurrence's instant and the last fired one's. */
5689
- nextRunAt: z43.string().datetime().optional(),
5690
- lastRunAt: z43.string().datetime().optional(),
5691
- etags: z43.record(z43.string(), z43.string()).optional(),
5692
- backoffUntil: z43.string().datetime().optional(),
5693
- consecutiveFailures: z43.number().int().nonnegative().optional(),
5694
+ nextRunAt: z44.string().datetime().optional(),
5695
+ lastRunAt: z44.string().datetime().optional(),
5696
+ etags: z44.record(z44.string(), z44.string()).optional(),
5697
+ backoffUntil: z44.string().datetime().optional(),
5698
+ consecutiveFailures: z44.number().int().nonnegative().optional(),
5694
5699
  ...automationLastErrorShape,
5695
5700
  /** once schedule: it stopped without a task — the launch failed, or it started past its cutoff. */
5696
- onceOutcome: z43.enum(["failed", "missed"]).optional()
5701
+ onceOutcome: z44.enum(["failed", "missed"]).optional()
5697
5702
  }).passthrough();
5698
- var storedAutomationStateFileSchema = z43.object({
5699
- version: z43.literal(1).default(1),
5700
- states: z43.record(z43.string(), storedAutomationRuntimeStateSchema).default({})
5703
+ var storedAutomationStateFileSchema = z44.object({
5704
+ version: z44.literal(1).default(1),
5705
+ states: z44.record(z44.string(), storedAutomationRuntimeStateSchema).default({})
5701
5706
  }).passthrough();
5702
- var storedAutomationReceiptSchema = z43.object({
5703
- receiptId: z43.string().min(1),
5704
- receiptKey: z43.string().min(1),
5705
- eventId: z43.string().min(1),
5706
- automationId: z43.string().min(1),
5707
- revision: z43.number().int().positive(),
5708
- status: z43.enum(["reserved", "launched", "launch-error", "released"]),
5709
- runId: z43.string().optional(),
5710
- observedAt: z43.string().datetime(),
5711
- updatedAt: z43.string().datetime(),
5712
- error: z43.string().max(2e3).optional(),
5707
+ var storedAutomationReceiptSchema = z44.object({
5708
+ receiptId: z44.string().min(1),
5709
+ receiptKey: z44.string().min(1),
5710
+ eventId: z44.string().min(1),
5711
+ automationId: z44.string().min(1),
5712
+ revision: z44.number().int().positive(),
5713
+ status: z44.enum(["reserved", "launched", "launch-error", "released"]),
5714
+ runId: z44.string().optional(),
5715
+ observedAt: z44.string().datetime(),
5716
+ updatedAt: z44.string().datetime(),
5717
+ error: z44.string().max(2e3).optional(),
5713
5718
  /** schedule kind: the occurrence this receipt reserved, so a retry can fire it again. */
5714
- occurrenceAt: z43.string().datetime().optional(),
5715
- candidate: z43.object({
5716
- eventId: z43.string(),
5719
+ occurrenceAt: z44.string().datetime().optional(),
5720
+ candidate: z44.object({
5721
+ eventId: z44.string(),
5717
5722
  event: storedAutomationEventSchema,
5718
- timestamp: z43.string().datetime(),
5719
- tieBreaker: z43.string(),
5720
- repo: z43.string(),
5721
- nodeId: z43.string(),
5722
- number: z43.number().int().positive(),
5723
- title: z43.string().max(500),
5724
- url: z43.string().url(),
5725
- author: z43.string().max(200),
5726
- assignees: z43.array(z43.string().max(200)).max(100),
5727
- labels: z43.array(z43.string().max(200)).max(100),
5728
- changedLabel: z43.string().max(200).optional()
5723
+ timestamp: z44.string().datetime(),
5724
+ tieBreaker: z44.string(),
5725
+ repo: z44.string(),
5726
+ nodeId: z44.string(),
5727
+ number: z44.number().int().positive(),
5728
+ title: z44.string().max(500),
5729
+ url: z44.string().url(),
5730
+ author: z44.string().max(200),
5731
+ assignees: z44.array(z44.string().max(200)).max(100),
5732
+ labels: z44.array(z44.string().max(200)).max(100),
5733
+ changedLabel: z44.string().max(200).optional()
5729
5734
  }).passthrough().optional()
5730
5735
  }).passthrough();
5731
- var storedAutomationLogResultSchema = z43.enum([
5736
+ var storedAutomationLogResultSchema = z44.enum([
5732
5737
  "launched",
5733
5738
  "no-match",
5734
5739
  "duplicate",
@@ -5744,24 +5749,24 @@ var storedAutomationLogResultSchema = z43.enum([
5744
5749
  // once schedule
5745
5750
  "missed"
5746
5751
  ]);
5747
- var storedAutomationLogRecordSchema = z43.object({
5748
- seq: z43.number().int().positive(),
5749
- ts: z43.string().datetime(),
5750
- automationId: z43.string().min(1),
5751
- revision: z43.number().int().positive(),
5752
+ var storedAutomationLogRecordSchema = z44.object({
5753
+ seq: z44.number().int().positive(),
5754
+ ts: z44.string().datetime(),
5755
+ automationId: z44.string().min(1),
5756
+ revision: z44.number().int().positive(),
5752
5757
  event: storedAutomationEventSchema.optional(),
5753
5758
  result: storedAutomationLogResultSchema,
5754
- reason: z43.string().max(2e3).optional(),
5755
- durationMs: z43.number().int().nonnegative().optional(),
5756
- receiptId: z43.string().optional(),
5757
- runId: z43.string().optional(),
5758
- githubNumber: z43.number().int().positive().optional(),
5759
- githubTitle: z43.string().max(500).optional(),
5760
- githubUrl: z43.string().url().optional(),
5761
- rateLimit: z43.object({
5762
- bucket: z43.enum(["core", "search"]),
5763
- remaining: z43.number().int().nonnegative().optional(),
5764
- resetAt: z43.string().datetime().optional()
5759
+ reason: z44.string().max(2e3).optional(),
5760
+ durationMs: z44.number().int().nonnegative().optional(),
5761
+ receiptId: z44.string().optional(),
5762
+ runId: z44.string().optional(),
5763
+ githubNumber: z44.number().int().positive().optional(),
5764
+ githubTitle: z44.string().max(500).optional(),
5765
+ githubUrl: z44.string().url().optional(),
5766
+ rateLimit: z44.object({
5767
+ bucket: z44.enum(["core", "search"]),
5768
+ remaining: z44.number().int().nonnegative().optional(),
5769
+ resetAt: z44.string().datetime().optional()
5765
5770
  }).passthrough().optional()
5766
5771
  }).passthrough();
5767
5772
  function storedIsOnceSchedule(definition) {
@@ -5775,210 +5780,210 @@ function storedIsScheduleAutomation(definition) {
5775
5780
  }
5776
5781
 
5777
5782
  // ../contract/src/automation-requests.ts
5778
- var automationEditableSchema = z44.object({
5779
- name: z44.string().trim().min(1).max(200),
5780
- description: z44.string().max(2e3).optional(),
5781
- enabled: z44.boolean().optional(),
5783
+ var automationEditableSchema = z45.object({
5784
+ name: z45.string().trim().min(1).max(200),
5785
+ description: z45.string().max(2e3).optional(),
5786
+ enabled: z45.boolean().optional(),
5782
5787
  kind: automationKindSchema.optional(),
5783
- events: z44.array(automationEventSchema).min(1).max(4).optional(),
5784
- intervalSeconds: z44.number().int().min(60).max(86400).optional(),
5788
+ events: z45.array(automationEventSchema).min(1).max(4).optional(),
5789
+ intervalSeconds: z45.number().int().min(60).max(86400).optional(),
5785
5790
  filters: storedAutomationFiltersSchema.optional(),
5786
5791
  schedule: automationScheduleSchema.optional(),
5787
- task: z44.strictObject(storedAutomationTaskSchema.shape).omit({ variants: true }).refine((task) => !(task.workflow && task.steps), {
5792
+ task: z45.strictObject(storedAutomationTaskSchema.shape).omit({ variants: true }).refine((task) => !(task.workflow && task.steps), {
5788
5793
  message: "task selects either a named workflow or inline steps, not both"
5789
5794
  })
5790
5795
  }).strict();
5791
- var automationCreateSchema = automationEditableSchema.extend({ enable: z44.boolean().optional() });
5792
- var automationUpdateSchema = automationEditableSchema.extend({ expectedRevision: z44.number().int().positive() });
5793
- var automationCheckRequestSchema = z44.object({ mode: z44.enum(["preview", "execute"]) }).strict();
5794
- var automationLogQuerySchema = z44.object({
5795
- automationId: z44.string().optional(),
5796
+ var automationCreateSchema = automationEditableSchema.extend({ enable: z45.boolean().optional() });
5797
+ var automationUpdateSchema = automationEditableSchema.extend({ expectedRevision: z45.number().int().positive() });
5798
+ var automationCheckRequestSchema = z45.object({ mode: z45.enum(["preview", "execute"]) }).strict();
5799
+ var automationLogQuerySchema = z45.object({
5800
+ automationId: z45.string().optional(),
5796
5801
  result: automationLogResultSchema.optional(),
5797
5802
  event: automationEventSchema.optional(),
5798
- since: z44.string().datetime().optional(),
5799
- cursor: z44.coerce.number().int().positive().optional(),
5803
+ since: z45.string().datetime().optional(),
5804
+ cursor: z45.coerce.number().int().positive().optional(),
5800
5805
  // Optional, not `.default(100)`: `AutomationStore.logs` already clamps `limit ?? 100` into
5801
5806
  // 1..100, so the default here was a second copy of it — and a defaulted key is REQUIRED in the
5802
5807
  // request type `queryZodValidator` publishes (see validators.ts on why the request side falls
5803
5808
  // back to the schema's output), which would have made every caller send a `?limit=` this route
5804
5809
  // never needed.
5805
- limit: z44.coerce.number().int().min(1).max(100).optional()
5810
+ limit: z45.coerce.number().int().min(1).max(100).optional()
5806
5811
  });
5807
5812
 
5808
5813
  // ../contract/src/workflow-requests.ts
5809
- import { z as z45 } from "zod";
5810
- var planSchema = z45.object({
5814
+ import { z as z46 } from "zod";
5815
+ var planSchema = z46.object({
5811
5816
  // Same bound as `createRunInputSchema.task` — this flows into `planChain` (legacy reference 429).
5812
- task: z45.string().trim().min(1).max(1e5, "must be at most 100000 characters"),
5817
+ task: z46.string().trim().min(1).max(1e5, "must be at most 100000 characters"),
5813
5818
  /** The account the planner runs on, as `POST /runs` takes it: absent follows the project's
5814
5819
  * selection (hearsay-tools/squawk#4116). */
5815
- agentProfile: z45.string().max(64).optional()
5820
+ agentProfile: z46.string().max(64).optional()
5816
5821
  });
5817
- var parseWorkflowSchema = z45.object({
5818
- yaml: z45.string().min(1).max(1e5)
5822
+ var parseWorkflowSchema = z46.object({
5823
+ yaml: z46.string().min(1).max(1e5)
5819
5824
  });
5820
5825
 
5821
5826
  // ../contract/src/ui-state-requests.ts
5822
- import { z as z46 } from "zod";
5827
+ import { z as z47 } from "zod";
5823
5828
  var SKILL_USAGE_MAX_ENTRIES = 200;
5824
5829
  var UI_STATE_MAX_KEYS = 200;
5825
5830
  var uiStateSchema2 = uiStateSchema.extend({
5826
5831
  // null records a quick task with no selected skill or workflow.
5827
- lastTask: z46.object({
5828
- source: z46.enum(["workflow", "skill"]),
5829
- ref: z46.string().min(1).max(200)
5832
+ lastTask: z47.object({
5833
+ source: z47.enum(["workflow", "skill"]),
5834
+ ref: z47.string().min(1).max(200)
5830
5835
  }).nullable().optional(),
5831
5836
  // Most recent source choices, newest first.
5832
- recentSources: z46.array(
5833
- z46.object({
5834
- source: z46.enum(["workflow", "skill"]),
5835
- ref: z46.string().min(1).max(200)
5837
+ recentSources: z47.array(
5838
+ z47.object({
5839
+ source: z47.enum(["workflow", "skill"]),
5840
+ ref: z47.string().min(1).max(200)
5836
5841
  })
5837
5842
  ).max(50).optional(),
5838
- skillUsage: z46.record(z46.string().min(1).max(200), z46.number().int().min(0).max(1e6)).refine((usage) => Object.keys(usage).length <= SKILL_USAGE_MAX_ENTRIES, {
5843
+ skillUsage: z47.record(z47.string().min(1).max(200), z47.number().int().min(0).max(1e6)).refine((usage) => Object.keys(usage).length <= SKILL_USAGE_MAX_ENTRIES, {
5839
5844
  message: `skillUsage must have at most ${SKILL_USAGE_MAX_ENTRIES} entries`
5840
5845
  }).optional(),
5841
- promptTemplates: z46.array(
5842
- z46.object({
5843
- id: z46.string().min(1).max(64),
5844
- label: z46.string().trim().min(1).max(80),
5845
- text: z46.string().trim().min(1).max(2e3),
5846
+ promptTemplates: z47.array(
5847
+ z47.object({
5848
+ id: z47.string().min(1).max(64),
5849
+ label: z47.string().trim().min(1).max(80),
5850
+ text: z47.string().trim().min(1).max(2e3),
5846
5851
  // Skill names this template auto-applies for. Optional and additive: templates
5847
5852
  // written before this key existed keep validating, and stay manual-only.
5848
- skills: z46.array(z46.string().trim().min(1).max(200)).max(50).optional()
5853
+ skills: z47.array(z47.string().trim().min(1).max(200)).max(50).optional()
5849
5854
  })
5850
5855
  ).max(50).optional()
5851
5856
  }).passthrough();
5852
5857
  function capUiStateKeys(data, ctx) {
5853
5858
  if (Object.keys(data).length > UI_STATE_MAX_KEYS) {
5854
- ctx.addIssue({ code: z46.ZodIssueCode.custom, message: `ui-state has too many keys (max ${UI_STATE_MAX_KEYS})` });
5859
+ ctx.addIssue({ code: z47.ZodIssueCode.custom, message: `ui-state has too many keys (max ${UI_STATE_MAX_KEYS})` });
5855
5860
  }
5856
5861
  }
5857
5862
  var uiStateBody = uiStateSchema2.superRefine(capUiStateKeys);
5858
5863
 
5859
5864
  // ../contract/src/run-requests.ts
5860
- import { z as z47 } from "zod";
5861
- var queuedMessagePatchSchema = z47.object({
5862
- text: z47.string().max(1e5).optional(),
5863
- images: z47.array(attachmentInputSchema).max(4).optional()
5865
+ import { z as z48 } from "zod";
5866
+ var queuedMessagePatchSchema = z48.object({
5867
+ text: z48.string().max(1e5).optional(),
5868
+ images: z48.array(attachmentInputSchema).max(4).optional()
5864
5869
  }).refine((m) => m.text !== void 0 || m.images !== void 0, {
5865
5870
  message: "message edit needs text or attachments"
5866
5871
  });
5867
- var continueSchema = z47.object({
5868
- text: z47.string().max(1e5, "must be at most 100000 characters").optional(),
5869
- images: z47.array(attachmentInputSchema).max(4).optional(),
5872
+ var continueSchema = z48.object({
5873
+ text: z48.string().max(1e5, "must be at most 100000 characters").optional(),
5874
+ images: z48.array(attachmentInputSchema).max(4).optional(),
5870
5875
  runner: runnerSchema.optional(),
5871
- model: z47.string().max(200).optional(),
5876
+ model: z48.string().max(200).optional(),
5872
5877
  /** Reasoning-effort pin (legacy reference 45). Omitted keeps the run's pin; empty string clears it. */
5873
- effort: z47.string().max(32).optional()
5878
+ effort: z48.string().max(32).optional()
5874
5879
  });
5875
- var archiveSchema = z47.object({
5876
- archived: z47.boolean().optional()
5880
+ var archiveSchema = z48.object({
5881
+ archived: z48.boolean().optional()
5877
5882
  });
5878
- var openInSchema = z47.object({
5883
+ var openInSchema = z48.object({
5879
5884
  // A short bound (legacy reference 429): matched against a downstream allowlist, so an editor id is never long.
5880
- target: z47.string().trim().min(1, "target required").max(200),
5881
- path: z47.string().max(1e3).optional()
5885
+ target: z48.string().trim().min(1, "target required").max(200),
5886
+ path: z48.string().max(1e3).optional()
5882
5887
  });
5883
5888
 
5884
5889
  // ../contract/src/query-requests.ts
5885
- import { z as z48 } from "zod";
5886
- var queryValue = z48.union([z48.string(), z48.array(z48.string()).transform((v) => v[0])]).optional();
5887
- var refreshQuery = z48.object({ refresh: queryValue });
5888
- var waitQuery = z48.object({ wait: queryValue });
5889
- var queryRunnerSchema = z48.union([z48.string(), z48.array(z48.string()).transform((v) => v[0])]).pipe(modelDiscoveryRunnerSchema);
5890
- var modelDiscoveryQuerySchema = z48.object({ runner: queryRunnerSchema, profileId: z48.string().max(64).optional() });
5891
- var strictRefreshQuerySchema = z48.object({ refresh: queryValue.refine((v) => v === void 0 || v === "1") });
5892
- var browseQuerySchema = z48.object({ path: queryValue, showHidden: queryValue });
5893
- var worktreeFilesQuerySchema = z48.object({ path: queryValue, raw: queryValue });
5894
- var commitQuerySchema = z48.object({ structured: queryValue });
5890
+ import { z as z49 } from "zod";
5891
+ var queryValue = z49.union([z49.string(), z49.array(z49.string()).transform((v) => v[0])]).optional();
5892
+ var refreshQuery = z49.object({ refresh: queryValue });
5893
+ var waitQuery = z49.object({ wait: queryValue });
5894
+ var queryRunnerSchema = z49.union([z49.string(), z49.array(z49.string()).transform((v) => v[0])]).pipe(modelDiscoveryRunnerSchema);
5895
+ var modelDiscoveryQuerySchema = z49.object({ runner: queryRunnerSchema, profileId: z49.string().max(64).optional() });
5896
+ var strictRefreshQuerySchema = z49.object({ refresh: queryValue.refine((v) => v === void 0 || v === "1") });
5897
+ var browseQuerySchema = z49.object({ path: queryValue, showHidden: queryValue });
5898
+ var worktreeFilesQuerySchema = z49.object({ path: queryValue, raw: queryValue });
5899
+ var commitQuerySchema = z49.object({ structured: queryValue });
5895
5900
 
5896
5901
  // ../contract/src/github-requests.ts
5897
- import { z as z49 } from "zod";
5898
- var mergeNumberParams = z49.object({ number: z49.coerce.number().int().positive() });
5899
- var prChangesParams = z49.object({ number: z49.coerce.number().int().positive().safe() });
5900
- var prChangesQuery = z49.object({ refresh: queryValue.refine((v) => v === void 0 || v === "1") });
5901
- var mergeBodySchema = z49.object({
5902
- method: z49.enum(["merge", "squash", "rebase"]),
5903
- expectedHeadSha: z49.string().regex(/^[0-9a-f]{40}$/),
5904
- overrideRules: z49.boolean().optional().default(false)
5902
+ import { z as z50 } from "zod";
5903
+ var mergeNumberParams = z50.object({ number: z50.coerce.number().int().positive() });
5904
+ var prChangesParams = z50.object({ number: z50.coerce.number().int().positive().safe() });
5905
+ var prChangesQuery = z50.object({ refresh: queryValue.refine((v) => v === void 0 || v === "1") });
5906
+ var mergeBodySchema = z50.object({
5907
+ method: z50.enum(["merge", "squash", "rebase"]),
5908
+ expectedHeadSha: z50.string().regex(/^[0-9a-f]{40}$/),
5909
+ overrideRules: z50.boolean().optional().default(false)
5905
5910
  }).strict();
5906
- var githubChecksQuerySchema = z49.object({ prs: z49.string().min(1) });
5907
- var githubRefsQuerySchema = z49.object({ prs: z49.string().optional(), issues: z49.string().optional() });
5911
+ var githubChecksQuerySchema = z50.object({ prs: z50.string().min(1) });
5912
+ var githubRefsQuerySchema = z50.object({ prs: z50.string().optional(), issues: z50.string().optional() });
5908
5913
 
5909
5914
  // ../contract/src/repo-requests.ts
5910
- import { z as z50 } from "zod";
5911
- var gitCommitSchema = z50.object({
5912
- message: z50.string().trim().min(1, "must not be empty").max(5e3)
5915
+ import { z as z51 } from "zod";
5916
+ var gitCommitSchema = z51.object({
5917
+ message: z51.string().trim().min(1, "must not be empty").max(5e3)
5913
5918
  });
5914
- var reclaimBodySchema = z50.object({}).passthrough();
5915
- var repoBranchSchema = z50.object({
5916
- name: z50.string().trim().min(1).max(200),
5917
- from: z50.string().trim().min(1).max(200).optional()
5919
+ var reclaimBodySchema = z51.object({}).passthrough();
5920
+ var repoBranchSchema = z51.object({
5921
+ name: z51.string().trim().min(1).max(200),
5922
+ from: z51.string().trim().min(1).max(200).optional()
5918
5923
  });
5919
- var reclaimRunParamsSchema = z50.object({ runId: z50.string().min(1) });
5924
+ var reclaimRunParamsSchema = z51.object({ runId: z51.string().min(1) });
5920
5925
 
5921
5926
  // ../contract/src/config-requests.ts
5922
- import { z as z51 } from "zod";
5927
+ import { z as z52 } from "zod";
5923
5928
  var setConfigSchema = setConfigInputSchema.extend({
5924
- systemPrompt: z51.string().trim().max(2e4, "must be at most 20000 characters").nullable().optional()
5929
+ systemPrompt: z52.string().trim().max(2e4, "must be at most 20000 characters").nullable().optional()
5925
5930
  });
5926
- var setAgentConfigSchema = z51.object({
5927
- content: z51.string().max(2e6),
5928
- version: z51.string().nullable()
5931
+ var setAgentConfigSchema = z52.object({
5932
+ content: z52.string().max(2e6),
5933
+ version: z52.string().nullable()
5929
5934
  });
5930
5935
 
5931
5936
  // ../contract/src/workflow-file.ts
5932
- import { z as z52 } from "zod";
5933
- var workflowFileSchema = z52.object({
5934
- name: z52.string().min(1),
5935
- description: z52.string().optional(),
5936
- steps: z52.array(workflowStepDefSchema).min(1).optional(),
5937
- skills: z52.array(z52.string().trim().min(1)).min(1).optional()
5937
+ import { z as z53 } from "zod";
5938
+ var workflowFileSchema = z53.object({
5939
+ name: z53.string().min(1),
5940
+ description: z53.string().optional(),
5941
+ steps: z53.array(workflowStepDefSchema).min(1).optional(),
5942
+ skills: z53.array(z53.string().trim().min(1)).min(1).optional()
5938
5943
  }).refine((d) => Boolean(d.steps) !== Boolean(d.skills), {
5939
5944
  message: 'a workflow lists either "steps" or "skills", not both'
5940
5945
  });
5941
5946
 
5942
5947
  // ../contract/src/reports.ts
5943
- import { z as z53 } from "zod";
5948
+ import { z as z54 } from "zod";
5944
5949
  var REPORTS_QUERY_MAX = 1e3;
5945
- var cursorSchema = z53.string().min(1).max(1024);
5946
- var reportsQuerySchema = z53.object({
5947
- q: z53.string().max(REPORTS_QUERY_MAX).optional(),
5950
+ var cursorSchema = z54.string().min(1).max(1024);
5951
+ var reportsQuerySchema = z54.object({
5952
+ q: z54.string().max(REPORTS_QUERY_MAX).optional(),
5948
5953
  before: cursorSchema.optional(),
5949
- limit: z53.string().regex(/^(?:[1-9]|[1-9][0-9]|100)$/).transform(Number).optional()
5954
+ limit: z54.string().regex(/^(?:[1-9]|[1-9][0-9]|100)$/).transform(Number).optional()
5950
5955
  }).strict();
5951
- var reportSchema = z53.object({
5952
- id: z53.uuid(),
5953
- runId: z53.uuid(),
5954
- name: z53.string(),
5955
- title: z53.string(),
5956
- createdAt: z53.iso.datetime(),
5957
- size: z53.number().int().nonnegative(),
5958
- taskTitle: z53.string(),
5956
+ var reportSchema = z54.object({
5957
+ id: z54.uuid(),
5958
+ runId: z54.uuid(),
5959
+ name: z54.string(),
5960
+ title: z54.string(),
5961
+ createdAt: z54.iso.datetime(),
5962
+ size: z54.number().int().nonnegative(),
5963
+ taskTitle: z54.string(),
5959
5964
  taskStatus: runStatusSchema
5960
5965
  }).strict();
5961
- var reportsResponseSchema = z53.object({
5962
- reports: z53.array(reportSchema),
5966
+ var reportsResponseSchema = z54.object({
5967
+ reports: z54.array(reportSchema),
5963
5968
  nextCursor: cursorSchema.nullable(),
5964
5969
  // Counts all matching cached rows with readable source summaries before page content checks.
5965
5970
  // A missing-content row dropped while filling this page can lower total on the next request.
5966
- total: z53.number().int().nonnegative()
5971
+ total: z54.number().int().nonnegative()
5967
5972
  }).strict();
5968
- var reportsStateSchema = z53.object({
5969
- epoch: z53.uuid(),
5970
- generation: z53.number().int().nonnegative(),
5971
- metadataGeneration: z53.number().int().nonnegative()
5973
+ var reportsStateSchema = z54.object({
5974
+ epoch: z54.uuid(),
5975
+ generation: z54.number().int().nonnegative(),
5976
+ metadataGeneration: z54.number().int().nonnegative()
5972
5977
  }).strict();
5973
- var reportsMetadataSchema = z53.object({
5974
- runId: z53.uuid(),
5975
- taskTitle: z53.string(),
5978
+ var reportsMetadataSchema = z54.object({
5979
+ runId: z54.uuid(),
5980
+ taskTitle: z54.string(),
5976
5981
  taskStatus: runStatusSchema
5977
5982
  }).strict();
5978
- var reportsFrameSchema = z53.discriminatedUnion("type", [
5979
- reportsStateSchema.extend({ type: z53.literal("snapshot") }),
5980
- reportsStateSchema.extend({ type: z53.literal("content") }),
5981
- reportsStateSchema.extend({ type: z53.literal("metadata"), runs: z53.array(reportsMetadataSchema) })
5983
+ var reportsFrameSchema = z54.discriminatedUnion("type", [
5984
+ reportsStateSchema.extend({ type: z54.literal("snapshot") }),
5985
+ reportsStateSchema.extend({ type: z54.literal("content") }),
5986
+ reportsStateSchema.extend({ type: z54.literal("metadata"), runs: z54.array(reportsMetadataSchema) })
5982
5987
  ]);
5983
5988
 
5984
5989
  // ../contract/src/report-title.ts
@@ -6000,89 +6005,89 @@ function controlLocation(control, separator = " \u2192 ") {
6000
6005
  }
6001
6006
 
6002
6007
  // ../contract/src/home-recovery.ts
6003
- import { z as z54 } from "zod";
6008
+ import { z as z55 } from "zod";
6004
6009
  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))$/;
6005
- var homeFileSchema = z54.string().regex(HOME_FILE_PATTERN);
6006
- var recoveryFile = z54.object({
6010
+ var homeFileSchema = z55.string().regex(HOME_FILE_PATTERN);
6011
+ var recoveryFile = z55.object({
6007
6012
  file: homeFileSchema,
6008
- detectedAt: z54.iso.datetime(),
6009
- canRestore: z54.boolean()
6013
+ detectedAt: z55.iso.datetime(),
6014
+ canRestore: z55.boolean()
6010
6015
  });
6011
6016
  var HOME_RECOVERY_REASONS = ["reset", "outside-write", "legacy-change"];
6012
- var homeRecoveryFileSchema = z54.discriminatedUnion("reason", [
6013
- recoveryFile.extend({ reason: z54.literal("reset") }),
6014
- recoveryFile.extend({ reason: z54.literal("outside-write") }),
6015
- recoveryFile.extend({ reason: z54.literal("legacy-change"), canImport: z54.boolean() })
6017
+ var homeRecoveryFileSchema = z55.discriminatedUnion("reason", [
6018
+ recoveryFile.extend({ reason: z55.literal("reset") }),
6019
+ recoveryFile.extend({ reason: z55.literal("outside-write") }),
6020
+ recoveryFile.extend({ reason: z55.literal("legacy-change"), canImport: z55.boolean() })
6016
6021
  ]);
6017
- var homeRecoverySchema = z54.object({ files: z54.array(homeRecoveryFileSchema) });
6022
+ var homeRecoverySchema = z55.object({ files: z55.array(homeRecoveryFileSchema) });
6018
6023
  function filterHomeRecoveryReasons(value, reasons) {
6019
6024
  if (!value || typeof value !== "object" || !("files" in value) || !Array.isArray(value.files)) return value;
6020
6025
  return { ...value, files: value.files.filter((row) => !(row && typeof row === "object" && "reason" in row && typeof row.reason === "string" && !reasons.includes(row.reason))) };
6021
6026
  }
6022
- var homeRecoveryReaderSchema = z54.preprocess(
6027
+ var homeRecoveryReaderSchema = z55.preprocess(
6023
6028
  (value) => filterHomeRecoveryReasons(value, HOME_RECOVERY_REASONS),
6024
6029
  homeRecoverySchema
6025
6030
  );
6026
- var homeRecoveryActionSchema = z54.object({ file: homeFileSchema, detectedAt: z54.iso.datetime() }).strict();
6031
+ var homeRecoveryActionSchema = z55.object({ file: homeFileSchema, detectedAt: z55.iso.datetime() }).strict();
6027
6032
 
6028
6033
  // ../contract/src/runner-skills.ts
6029
- import { z as z55 } from "zod";
6030
- var runnerSkillScopeSchema = z55.enum(["repo", "user", "system", "other"]);
6031
- var runnerSkillsQuerySchema = z55.object({
6034
+ import { z as z56 } from "zod";
6035
+ var runnerSkillScopeSchema = z56.enum(["repo", "user", "system", "other"]);
6036
+ var runnerSkillsQuerySchema = z56.object({
6032
6037
  runner: queryRunnerSchema,
6033
- account: z55.string().min(1).max(64).optional(),
6034
- refresh: z55.literal("1").optional()
6038
+ account: z56.string().min(1).max(64).optional(),
6039
+ refresh: z56.literal("1").optional()
6035
6040
  });
6036
- var runnerSkillSchema = z55.object({
6037
- id: z55.string(),
6038
- name: z55.string(),
6039
- description: z55.string().optional(),
6041
+ var runnerSkillSchema = z56.object({
6042
+ id: z56.string(),
6043
+ name: z56.string(),
6044
+ description: z56.string().optional(),
6040
6045
  scope: runnerSkillScopeSchema.optional(),
6041
- plugin: z55.string().optional(),
6042
- path: z55.string().optional()
6046
+ plugin: z56.string().optional(),
6047
+ path: z56.string().optional()
6043
6048
  });
6044
- var runnerSkillProblemSchema = z55.object({ message: z55.string(), path: z55.string().optional() });
6045
- var runnerSkillListSchema = z55.object({
6049
+ var runnerSkillProblemSchema = z56.object({ message: z56.string(), path: z56.string().optional() });
6050
+ var runnerSkillListSchema = z56.object({
6046
6051
  runner: runnerSchema,
6047
- skills: z55.array(runnerSkillSchema),
6048
- problems: z55.array(runnerSkillProblemSchema),
6049
- source: z55.enum(["live", "cache", "unavailable"]),
6050
- reason: z55.string().optional()
6052
+ skills: z56.array(runnerSkillSchema),
6053
+ problems: z56.array(runnerSkillProblemSchema),
6054
+ source: z56.enum(["live", "cache", "unavailable"]),
6055
+ reason: z56.string().optional()
6051
6056
  });
6052
6057
 
6053
6058
  // ../contract/src/runner-install.ts
6054
- import { z as z56 } from "zod";
6055
- var runnerInstallParamsSchema = z56.object({ runner: runnerSchema });
6056
- var runnerInstallActionSchema = z56.object({ action: z56.enum(["check", "install", "update", "remove"]) });
6057
- var runnerInstallPhaseSchema = z56.enum(["idle", "checking", "downloading", "verifying", "extracting", "activating", "removing", "failed"]);
6058
- var runnerInstallStatusSchema = z56.object({
6059
- supported: z56.boolean(),
6060
- installedVersion: z56.string().nullable(),
6061
- latestVersion: z56.string().nullable(),
6062
- updateAvailable: z56.boolean(),
6059
+ import { z as z57 } from "zod";
6060
+ var runnerInstallParamsSchema = z57.object({ runner: runnerSchema });
6061
+ var runnerInstallActionSchema = z57.object({ action: z57.enum(["check", "install", "update", "remove"]) });
6062
+ var runnerInstallPhaseSchema = z57.enum(["idle", "checking", "downloading", "verifying", "extracting", "activating", "removing", "failed"]);
6063
+ var runnerInstallStatusSchema = z57.object({
6064
+ supported: z57.boolean(),
6065
+ installedVersion: z57.string().nullable(),
6066
+ latestVersion: z57.string().nullable(),
6067
+ updateAvailable: z57.boolean(),
6063
6068
  phase: runnerInstallPhaseSchema,
6064
- error: z56.string().nullable()
6069
+ error: z57.string().nullable()
6065
6070
  });
6066
6071
 
6067
6072
  // ../contract/src/automation-tool.ts
6068
- import { z as z57 } from "zod";
6073
+ import { z as z58 } from "zod";
6069
6074
  var repeatingAutomationInputSchema = automationCreateSchema.omit({ enabled: true, enable: true }).refine((value) => value.schedule?.type !== "once", "Use cezar_schedule_task for a one-time schedule.");
6070
- var id = z57.string().min(1).max(100);
6071
- var automationToolRequestSchema = z57.discriminatedUnion("action", [
6072
- z57.object({ action: z57.literal("create"), definition: repeatingAutomationInputSchema }).strict(),
6073
- z57.object({ action: z57.literal("show"), id }).strict(),
6074
- z57.object({ action: z57.literal("preview"), id }).strict(),
6075
- z57.object({ action: z57.literal("enable"), id, explicit: z57.boolean().optional() }).strict()
6075
+ var id = z58.string().min(1).max(100);
6076
+ var automationToolRequestSchema = z58.discriminatedUnion("action", [
6077
+ z58.object({ action: z58.literal("create"), definition: repeatingAutomationInputSchema }).strict(),
6078
+ z58.object({ action: z58.literal("show"), id }).strict(),
6079
+ z58.object({ action: z58.literal("preview"), id }).strict(),
6080
+ z58.object({ action: z58.literal("enable"), id, explicit: z58.boolean().optional() }).strict()
6076
6081
  ]);
6077
- var automationToolAnswerSchema = z57.union([
6078
- z57.object({
6079
- ok: z57.literal(true),
6082
+ var automationToolAnswerSchema = z58.union([
6083
+ z58.object({
6084
+ ok: z58.literal(true),
6080
6085
  automation: storedAutomationDefinitionSchema,
6081
- url: z57.string().optional(),
6082
- next_run_at: z57.string().optional(),
6083
- preview: z57.object({ matches: z57.number().int().nonnegative(), truncated: z57.boolean() }).optional()
6086
+ url: z58.string().optional(),
6087
+ next_run_at: z58.string().optional(),
6088
+ preview: z58.object({ matches: z58.number().int().nonnegative(), truncated: z58.boolean() }).optional()
6084
6089
  }),
6085
- z57.object({ ok: z57.literal(false), code: z57.enum([...scheduledTaskRefusalCodeSchema.options, "explicit_required", "preview_required"]), message: z57.string() })
6090
+ z58.object({ ok: z58.literal(false), code: z58.enum([...scheduledTaskRefusalCodeSchema.options, "explicit_required", "preview_required"]), message: z58.string() })
6086
6091
  ]);
6087
6092
  export {
6088
6093
  ACTIVITY_CHECKS_MAX,
@@ -6128,11 +6133,13 @@ export {
6128
6133
  LIVE_WORKER_NAME,
6129
6134
  MAX_CONVERSATION_REQUEST_SECONDS,
6130
6135
  MAX_RESUME_REQUEST_SECONDS,
6136
+ NOTE_MAX,
6131
6137
  ONCE_MAX_LATEST_START_MINUTES,
6132
6138
  ONCE_MIN_LATEST_START_MINUTES,
6133
6139
  ONCE_PAST_DUE_MESSAGE,
6134
6140
  PEER_WAIT_DEFAULT_SECONDS,
6135
6141
  PEER_WAIT_MAX_SECONDS,
6142
+ PID_MIN,
6136
6143
  PREVIEW_MAX_PIXEL_RATIO,
6137
6144
  PROCESS_EXIT_FILE_MAX,
6138
6145
  PROCESS_TIMEOUT_DEFAULT_SECONDS,