@hearsay-tools/squawk 0.19.0-dev.9291 → 0.19.0-dev.9298

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 (135) hide show
  1. package/dist/ci-wait/controller.d.ts +7 -7
  2. package/dist/contract/hosts.d.ts +76 -1
  3. package/dist/contract/index.d.ts +1 -0
  4. package/dist/contract/index.js +1354 -1288
  5. package/dist/contract/project-signal.d.ts +31 -0
  6. package/dist/delegation/routes.d.ts +4 -4
  7. package/dist/delegation/transport.d.ts +10 -10
  8. package/dist/features/hosts/index.js +2 -0
  9. package/dist/features/hosts/index.js.map +1 -1
  10. package/dist/features/hosts/routes.d.ts +45 -1
  11. package/dist/features/hosts/routes.js +109 -1
  12. package/dist/features/hosts/routes.js.map +1 -1
  13. package/dist/features/hosts/runs-index-patch.d.ts +5 -0
  14. package/dist/features/hosts/runs-index-patch.js +36 -0
  15. package/dist/features/hosts/runs-index-patch.js.map +1 -1
  16. package/dist/features/hosts/runs-index.d.ts +9 -1
  17. package/dist/features/hosts/runs-index.js +27 -0
  18. package/dist/features/hosts/runs-index.js.map +1 -1
  19. package/dist/features/reports/routes.d.ts +2 -2
  20. package/dist/runs/run-exits.d.ts +352 -352
  21. package/dist/runs/run-index.d.ts +2 -0
  22. package/dist/runs/run-index.js +9 -1
  23. package/dist/runs/run-index.js.map +1 -1
  24. package/dist/server/activity-routes.d.ts +23 -23
  25. package/dist/server/live-routes.d.ts +6 -6
  26. package/dist/server/live-trace.d.ts +30 -0
  27. package/dist/server/live-trace.js +114 -0
  28. package/dist/server/live-trace.js.map +1 -0
  29. package/dist/server/projects-routes.d.ts +41 -41
  30. package/dist/server/runs-routes.d.ts +1008 -1008
  31. package/dist/server/server.d.ts +126 -126
  32. package/dist/server/start-server.js +2 -1
  33. package/dist/server/start-server.js.map +1 -1
  34. package/dist/server/ws.d.ts +3 -0
  35. package/dist/server/ws.js +22 -3
  36. package/dist/server/ws.js.map +1 -1
  37. package/dist/workflows/continuation-admission.d.ts +72 -72
  38. package/dist/workflows/input-acknowledgement.d.ts +24 -24
  39. package/package.json +4 -4
  40. package/web/dist/assets/accounts-section-BHP8K_nY.js +1 -0
  41. package/web/dist/assets/activity-motion-DEEIuaki.js +1 -0
  42. package/web/dist/assets/{activity-route-CruXBXE5.js → activity-route-vtZmQsDB.js} +1 -1
  43. package/web/dist/assets/agent-accounts-BC78GKYv.js +1 -0
  44. package/web/dist/assets/{agent-config-section-BUxTgHrB.js → agent-config-section-CbnVaIx7.js} +1 -1
  45. package/web/dist/assets/{agent-defaults-section-BXUzcpEv.js → agent-defaults-section-Blxd9IpY.js} +1 -1
  46. package/web/dist/assets/{appearance-DnPsNI40.js → appearance-B_y9StVj.js} +1 -1
  47. package/web/dist/assets/{archive-on-merge-field-DR-KA2nj.js → archive-on-merge-field-DlChylWt.js} +1 -1
  48. package/web/dist/assets/{ask-card-DqWVy7zb.js → ask-card-DzWKRJ1x.js} +3 -3
  49. package/web/dist/assets/attention-C33sN0aA.js +1 -0
  50. package/web/dist/assets/automations-route-DxE9u9p0.js +2 -0
  51. package/web/dist/assets/{commit-list-zMKEapLK.js → commit-list-SxBDO_q5.js} +1 -1
  52. package/web/dist/assets/diff-B6Ye5Xg9.js +3 -0
  53. package/web/dist/assets/{diff-controls-DbkfJxfp.js → diff-controls-BFQOIJ97.js} +1 -1
  54. package/web/dist/assets/{diff-view-Cl7rXVa_.js → diff-view-BkF3xtYW.js} +1 -1
  55. package/web/dist/assets/{discard-changes-dialog-BYLEBMpG.js → discard-changes-dialog-CaS0koto.js} +1 -1
  56. package/web/dist/assets/{file-preview-CBjQS3sX.js → file-preview-ByWn2eDz.js} +1 -1
  57. package/web/dist/assets/{folder-browser-_2PCbZWK.js → folder-browser-CHTNDBIU.js} +1 -1
  58. package/web/dist/assets/{git-toolbar-CAAZ5T8F.js → git-toolbar-COI-N232.js} +1 -1
  59. package/web/dist/assets/github-CAQJIg-J.js +1 -0
  60. package/web/dist/assets/{global-activity-route-BQz9m_XA.js → global-activity-route-99-UqSlC.js} +1 -1
  61. package/web/dist/assets/hosts-BDfuQnus.js +1 -0
  62. package/web/dist/assets/index-BAXboPqe.js +21 -0
  63. package/web/dist/assets/label-Qj4HjGeN.js +1 -0
  64. package/web/dist/assets/{markdown-CcQNTOHx.js → markdown-D7p7x8Pe.js} +1 -1
  65. package/web/dist/assets/{open-in-menu-WJ8dhdTo.js → open-in-menu-D07DgRwh.js} +1 -1
  66. package/web/dist/assets/{option-select-DGRezng8.js → option-select-BvsSDWBz.js} +1 -1
  67. package/web/dist/assets/{preferences-section-DfiqoVZx.js → preferences-section-DkdcKxmS.js} +1 -1
  68. package/web/dist/assets/{preview-DXX3jdRy.js → preview-7NPVVq1D.js} +1 -1
  69. package/web/dist/assets/{preview-pane-connected-Bf6SWOsM.js → preview-pane-connected-B3f0fR6q.js} +2 -2
  70. package/web/dist/assets/{project-location-8EYHMbCE.js → project-location-CvZY7aOx.js} +1 -1
  71. package/web/dist/assets/{project-router-TP6DSj1S.js → project-router-l_pJCK5X.js} +1 -1
  72. package/web/dist/assets/project-scope-context-_6sNMsAf.js +4 -0
  73. package/web/dist/assets/{projects-section-CaKm84OL.js → projects-section-DGzDfKN_.js} +1 -1
  74. package/web/dist/assets/{prompt-templates-section-Bh6YEqh0.js → prompt-templates-section-DbHe-j9Z.js} +1 -1
  75. package/web/dist/assets/queries-CPNrCEon.js +1 -0
  76. package/web/dist/assets/read-state-BXLUf0Xi.js +1 -0
  77. package/web/dist/assets/reference-chip-B32qTHb5.js +1 -0
  78. package/web/dist/assets/{remote-settings-notice-cNffux8C.js → remote-settings-notice-ByPYNQyB.js} +1 -1
  79. package/web/dist/assets/{repo-git-nFi9DHBQ.js → repo-git-4rKalM-L.js} +1 -1
  80. package/web/dist/assets/{report-reader-BbA7ERJe.js → report-reader-IAYhP0KQ.js} +1 -1
  81. package/web/dist/assets/{report-selection-DOq2dcjz.js → report-selection-DCC-F7i6.js} +1 -1
  82. package/web/dist/assets/{reports-iMUK2IiW.js → reports-BP_hajNp.js} +1 -1
  83. package/web/dist/assets/{resources-section-BsPU-yD9.js → resources-section-QNbLbu3j.js} +1 -1
  84. package/web/dist/assets/{review-notes-drafts-BncrXliY.js → review-notes-drafts-CB8u-M0E.js} +1 -1
  85. package/web/dist/assets/{review-panel-CTc1ypIJ.js → review-panel-Bw8yG2xg.js} +1 -1
  86. package/web/dist/assets/{review-strip-D1gmgNIH.js → review-strip-BojRnCkg.js} +1 -1
  87. package/web/dist/assets/{run-detail-refresh-B4t_zvMa.js → run-detail-refresh-CZ7VyCgP.js} +1 -1
  88. package/web/dist/assets/{run-diff-CbyXSgBK.js → run-diff-CMZgQG9B.js} +1 -1
  89. package/web/dist/assets/run-header-D7LZBbaL.js +2 -0
  90. package/web/dist/assets/{select--NKdUD0C.js → select-D9BIA_Kn.js} +1 -1
  91. package/web/dist/assets/{session-context-section-D02yRmGY.js → session-context-section-CxFRidmv.js} +1 -1
  92. package/web/dist/assets/{settings-agent-picker-GPhOc6Lz.js → settings-agent-picker-Cy_ZpuNd.js} +1 -1
  93. package/web/dist/assets/{settings-save-bar-CroXxZIi.js → settings-save-bar-DzbndGGQ.js} +1 -1
  94. package/web/dist/assets/settings-shell-DS8k_xP6.js +1 -0
  95. package/web/dist/assets/{sidebar-section-BOtjR98E.js → sidebar-section-CY978tNF.js} +1 -1
  96. package/web/dist/assets/{skills-C7MuiePR.js → skills-WZ5YRCbF.js} +1 -1
  97. package/web/dist/assets/{status-dot-Bn3O77El.js → status-dot-Dvy-rnDJ.js} +1 -1
  98. package/web/dist/assets/{tab-link-BeONvGY1.js → tab-link-BPkGPOYd.js} +1 -1
  99. package/web/dist/assets/task-changes-Dd2KHRQ6.js +5 -0
  100. package/web/dist/assets/task-commits-De0FVgKP.js +1 -0
  101. package/web/dist/assets/{task-file-scope-BfJ7TDbf.js → task-file-scope-C_cr_ix-.js} +1 -1
  102. package/web/dist/assets/{task-files-CNz4PSKs.js → task-files-resMdu9u.js} +1 -1
  103. package/web/dist/assets/{task-github-item-B0mRxbLm.js → task-github-item-Hz1RbO88.js} +1 -1
  104. package/web/dist/assets/task-groups-Bc_WNTMe.js +1 -0
  105. package/web/dist/assets/task-thread-D7vUf0g7.js +2 -0
  106. package/web/dist/assets/{thread-state-B_uTIWzc.js → thread-state-Bjh3rImx.js} +1 -1
  107. package/web/dist/assets/{unified-diff-JD9Q6oCe.js → unified-diff-weWjKedZ.js} +1 -1
  108. package/web/dist/assets/use-finish-run-BuyJkeEN.js +1 -0
  109. package/web/dist/assets/{use-hand-to-agent-state-zwUimLza.js → use-hand-to-agent-state-CSDPzpM7.js} +1 -1
  110. package/web/dist/assets/use-path-bases-DgEkRWYi.js +1 -0
  111. package/web/dist/assets/use-workspace-config-save-M2ethek2.js +1 -0
  112. package/web/dist/assets/{workflows-BXDmsEl-.js → workflows-DtnnAq4w.js} +1 -1
  113. package/web/dist/assets/{workspace-tools-Ehk2KrtT.js → workspace-tools-CSLTEwLa.js} +1 -1
  114. package/web/dist/assets/{worktrees-section-DWZwtc3-.js → worktrees-section-Crp31i8F.js} +1 -1
  115. package/web/dist/index.html +17 -14
  116. package/web/dist/assets/accounts-section-uuhrLHok.js +0 -1
  117. package/web/dist/assets/activity-motion-CHyZRjxl.js +0 -1
  118. package/web/dist/assets/agent-accounts-CSU96w_T.js +0 -1
  119. package/web/dist/assets/automations-route-BmCWqncy.js +0 -2
  120. package/web/dist/assets/diff-BPw0S-BU.js +0 -3
  121. package/web/dist/assets/github-DehUrgzW.js +0 -1
  122. package/web/dist/assets/hosts-BEeMKHcf.js +0 -1
  123. package/web/dist/assets/index-D0RESQCN.js +0 -21
  124. package/web/dist/assets/label-VKt-7Z5C.js +0 -1
  125. package/web/dist/assets/project-scope-context-BWHk0niI.js +0 -4
  126. package/web/dist/assets/queries-Byfl3YoC.js +0 -1
  127. package/web/dist/assets/reference-chip-rDOAte2y.js +0 -1
  128. package/web/dist/assets/run-header-BREol2Ej.js +0 -2
  129. package/web/dist/assets/settings-shell-CEDsPkJW.js +0 -1
  130. package/web/dist/assets/task-changes-CPDdG-BK.js +0 -5
  131. package/web/dist/assets/task-commits-BFWXi7xF.js +0 -1
  132. package/web/dist/assets/task-thread-DH9xiw7O.js +0 -2
  133. package/web/dist/assets/use-finish-run-D7Ll1bwP.js +0 -1
  134. package/web/dist/assets/use-path-bases-BmFE7O79.js +0 -1
  135. package/web/dist/assets/use-workspace-config-save-71tIi9IP.js +0 -1
@@ -4061,41 +4061,182 @@ var registerProjectInputSchema = z27.object({
4061
4061
  root: z27.string().trim().min(1).max(4096)
4062
4062
  });
4063
4063
 
4064
+ // ../contract/src/project-signal.ts
4065
+ import { z as z28 } from "zod";
4066
+
4067
+ // ../contract/src/run-predicates.ts
4068
+ function latestSessionStep(steps, except) {
4069
+ let latest;
4070
+ for (const step of steps) {
4071
+ if (!step.sessionId || step.id === except) continue;
4072
+ if (!latest || !step.startedAt || !latest.startedAt || step.startedAt >= latest.startedAt) latest = step;
4073
+ }
4074
+ return latest;
4075
+ }
4076
+ function sessionRunner(step, run) {
4077
+ return step?.backend ?? run?.runner ?? "claude";
4078
+ }
4079
+ function removedRunnerStepAfter(steps, sessionId) {
4080
+ let latest;
4081
+ for (const step of steps) {
4082
+ if (step.removedBackend === void 0 && (sessionId === void 0 || step.sessionId !== sessionId)) continue;
4083
+ if (!latest || !step.startedAt || !latest.startedAt || step.startedAt >= latest.startedAt) latest = step;
4084
+ }
4085
+ return latest?.removedBackend !== void 0 ? latest : void 0;
4086
+ }
4087
+ function latestSession(run) {
4088
+ const latest = latestSessionStep(run.steps);
4089
+ const step = removedRunnerStepAfter(run.steps, latest?.sessionId) ? void 0 : latest;
4090
+ return { sessionId: step?.sessionId, backend: sessionRunner(step, run), profileId: step?.profileId };
4091
+ }
4092
+ function isAgentWorkflowStep(step) {
4093
+ return step.command === void 0 && step.kind !== "plugin";
4094
+ }
4095
+ function workerContinuationStepId(run) {
4096
+ const cursorId = run.workflowCursor?.mode === "resume" ? run.workflowCursor.stepId : void 0;
4097
+ if (cursorId && run.steps.find((step) => step.id === cursorId)?.status === "failed") return cursorId;
4098
+ const session = latestSessionStep(run.steps);
4099
+ if (!session) return void 0;
4100
+ if (session.synthetic === "continuation" && session.continuesStepId !== void 0) return session.continuesStepId;
4101
+ return run.steps.find((step) => step.sessionId === session.sessionId)?.id ?? session.id;
4102
+ }
4103
+ function workerContinuationStep(run, untouched = false) {
4104
+ if (run.delegation?.role !== "worker") return void 0;
4105
+ const steps = run.workflowDef?.steps;
4106
+ if (!steps?.length) return void 0;
4107
+ if (untouched) return steps.find(isAgentWorkflowStep);
4108
+ const targetId = workerContinuationStepId(run);
4109
+ const targeted = targetId ? steps.find((step) => step.id === targetId && isAgentWorkflowStep(step)) : void 0;
4110
+ return targeted ?? [...steps].reverse().find(isAgentWorkflowStep);
4111
+ }
4112
+ var LIVE_STATUSES = /* @__PURE__ */ new Set(["queued", "running", "waiting"]);
4113
+ function isLiveStatus(status) {
4114
+ return LIVE_STATUSES.has(status);
4115
+ }
4116
+ function engineOwnsRun(run) {
4117
+ if (isUsageLimitHold(run)) return false;
4118
+ return run.status === "queued" || run.status === "running" || run.status === "waiting";
4119
+ }
4120
+ function isSessionOpen(run) {
4121
+ return engineOwnsRun(run) && run.status !== "queued";
4122
+ }
4123
+ function isSweepable(run, scope, automation) {
4124
+ if (run.archived || !(run.status === "done" || run.status === "failed" || run.status === "cancelled")) return false;
4125
+ if (run.delegation?.role === "worker") return false;
4126
+ if (automation !== void 0 && isAutomationTask(run) !== automation) return false;
4127
+ if (scope === "unpinned") return !run.pinned;
4128
+ if (scope === "pinned") return run.pinned === true;
4129
+ return true;
4130
+ }
4131
+ var UNREAD_ELIGIBLE = ["done", "failed"];
4132
+ function canBeUnread(run) {
4133
+ if (run.archived) return false;
4134
+ if (isUsageLimitHold(run)) return false;
4135
+ if (!UNREAD_ELIGIBLE.includes(run.status)) return false;
4136
+ return run.finishedAt !== void 0;
4137
+ }
4138
+ function isUnread(run) {
4139
+ const finishedAt = run.finishedAt;
4140
+ if (finishedAt === void 0) return false;
4141
+ if (!canBeUnread(run)) return false;
4142
+ return run.seenAt === void 0 || run.seenAt < finishedAt;
4143
+ }
4144
+ function isRetentionCandidate(run) {
4145
+ const settled = run.status === "done" || run.status === "failed" || run.status === "cancelled";
4146
+ return settled && (!run.delegation || run.delegation.role === "root") && !run.pinned;
4147
+ }
4148
+ function hasReferencedRun(run) {
4149
+ return run.referencedPullRequestUrl !== void 0 || run.referencedIssueUrl !== void 0;
4150
+ }
4151
+ var UNREAD_RUN_RULE = {
4152
+ sql: "archived = 0 AND status IN ('done', 'failed') AND finished_at IS NOT NULL AND (json_extract(summary, '$.seenAt') IS NULL OR json_extract(summary, '$.seenAt') < finished_at)",
4153
+ matches: isUnread
4154
+ };
4155
+ var SWEEPABLE_RUN_RULE = {
4156
+ sql: "archived = 0 AND status IN ('done', 'failed', 'cancelled') AND parent_run_id IS NULL",
4157
+ matches: isSweepable
4158
+ };
4159
+ var RETENTION_RUN_RULE = {
4160
+ sql: "id IN (SELECT value FROM json_each(?)) AND status IN ('done', 'failed', 'cancelled') AND parent_run_id IS NULL AND json_extract(summary, '$.delegation.role') IS NOT 'worker' AND json_extract(summary, '$.delegation.role') IS NOT 'invalid' AND json_extract(summary, '$.pinned') IS NOT 1",
4161
+ matches: isRetentionCandidate
4162
+ };
4163
+ var REFERENCED_RUN_RULE = {
4164
+ sql: "json_extract(summary, '$.referencedPullRequestUrl') IS NOT NULL OR json_extract(summary, '$.referencedIssueUrl') IS NOT NULL",
4165
+ matches: hasReferencedRun
4166
+ };
4167
+
4168
+ // ../contract/src/project-signal.ts
4169
+ var projectSignalSchema = z28.object({
4170
+ needsYou: z28.number().int().nonnegative(),
4171
+ failedUnread: z28.number().int().nonnegative(),
4172
+ inMotion: z28.number().int().nonnegative(),
4173
+ finishedUnread: z28.number().int().nonnegative()
4174
+ });
4175
+ function emptyProjectSignal() {
4176
+ return { needsYou: 0, failedUnread: 0, inMotion: 0, finishedUnread: 0 };
4177
+ }
4178
+ function isZeroProjectSignal(signal) {
4179
+ return signal.needsYou === 0 && signal.failedUnread === 0 && signal.inMotion === 0 && signal.finishedUnread === 0;
4180
+ }
4181
+ function projectSignalsEqual(a, b) {
4182
+ if (a === b) return true;
4183
+ if (!a || !b) return false;
4184
+ return a.needsYou === b.needsYou && a.failedUnread === b.failedUnread && a.inMotion === b.inMotion && a.finishedUnread === b.finishedUnread;
4185
+ }
4186
+ function runSignalCategory(run) {
4187
+ if (run.archived || run.delegation?.role === "worker") return null;
4188
+ if (needsYou(run)) return "needsYou";
4189
+ if (deriveAttention(run).tone === "running") return "inMotion";
4190
+ if (isUnread(run)) {
4191
+ if (run.status === "failed") return "failedUnread";
4192
+ if (run.status === "done") return "finishedUnread";
4193
+ }
4194
+ return null;
4195
+ }
4196
+ function projectSignal(runs) {
4197
+ const signal = emptyProjectSignal();
4198
+ for (const run of runs) {
4199
+ const category = runSignalCategory(run);
4200
+ if (category) signal[category] += 1;
4201
+ }
4202
+ return signal;
4203
+ }
4204
+
4064
4205
  // ../contract/src/workspace.ts
4065
- import { z as z29 } from "zod";
4206
+ import { z as z30 } from "zod";
4066
4207
 
4067
4208
  // ../contract/src/per-runner-optional-strings.ts
4068
- import { z as z28 } from "zod";
4209
+ import { z as z29 } from "zod";
4069
4210
  function perRunnerOptionalStrings() {
4070
- return z28.record(z28.string(), z28.string().optional());
4211
+ return z29.record(z29.string(), z29.string().optional());
4071
4212
  }
4072
4213
 
4073
4214
  // ../contract/src/workspace.ts
4074
- var workspaceConfigResponseSchema = z29.object({
4215
+ var workspaceConfigResponseSchema = z30.object({
4075
4216
  /** The server user's home folder, so the cockpit can show paths under it as `~/…`. */
4076
- homeDir: z29.string(),
4217
+ homeDir: z30.string(),
4077
4218
  /** Root exposed by the Add-project directory browser — stored as written (`~` kept). */
4078
- browseRoot: z29.string(),
4219
+ browseRoot: z30.string(),
4079
4220
  /** Checkout root for GUI-cloned projects — stored as written (`~` kept). */
4080
- projectsDir: z29.string(),
4081
- archiveOnMerge: z29.boolean().nullable(),
4082
- effectiveArchiveOnMerge: z29.boolean(),
4083
- archiveOnMergeSource: z29.enum(["global", "environment", "default"]),
4084
- composerDefaults: z29.object({
4085
- autonomous: z29.boolean().nullable(),
4086
- worktree: z29.boolean().nullable(),
4221
+ projectsDir: z30.string(),
4222
+ archiveOnMerge: z30.boolean().nullable(),
4223
+ effectiveArchiveOnMerge: z30.boolean(),
4224
+ archiveOnMergeSource: z30.enum(["global", "environment", "default"]),
4225
+ composerDefaults: z30.object({
4226
+ autonomous: z30.boolean().nullable(),
4227
+ worktree: z30.boolean().nullable(),
4087
4228
  /** `'source-dependent'` when no `CEZ_AUTONOMOUS_DEFAULT` pins it either way. */
4088
- inheritedAutonomous: z29.union([z29.boolean(), z29.literal("source-dependent")]),
4089
- inheritedWorktree: z29.boolean()
4229
+ inheritedAutonomous: z30.union([z30.boolean(), z30.literal("source-dependent")]),
4230
+ inheritedWorktree: z30.boolean()
4090
4231
  }),
4091
- resources: z29.object({
4092
- maxParallel: z29.number(),
4093
- maxMonitoringSessions: z29.number(),
4094
- monitoringWakeIntervalMinutes: z29.number().nullable(),
4232
+ resources: z30.object({
4233
+ maxParallel: z30.number(),
4234
+ maxMonitoringSessions: z30.number(),
4235
+ monitoringWakeIntervalMinutes: z30.number().nullable(),
4095
4236
  /** Resume a run a provider usage limit stopped, once the limit resets. Default `true`. */
4096
- autoResumeOnUsageLimit: z29.boolean(),
4097
- memoryLimitMb: z29.number().nullable(),
4098
- worktreeRetentionDefault: z29.number()
4237
+ autoResumeOnUsageLimit: z30.boolean(),
4238
+ memoryLimitMb: z30.number().nullable(),
4239
+ worktreeRetentionDefault: z30.number()
4099
4240
  }),
4100
4241
  /**
4101
4242
  * What a repo that has set none of its own runs (spec 2026-07-29-agent-profiles).
@@ -4105,49 +4246,49 @@ var workspaceConfigResponseSchema = z29.object({
4105
4246
  * from a value someone chose or the fallback collapses into "always claude". Consulted only where
4106
4247
  * the repo's own `.ai/cezar/config.json` is silent — a repo that chose is never overruled.
4107
4248
  */
4108
- agentDefaults: z29.object({
4249
+ agentDefaults: z30.object({
4109
4250
  runner: runnerSchema.optional(),
4110
4251
  models: perRunnerOptionalStrings().optional()
4111
4252
  })
4112
4253
  });
4113
- var setWorkspaceConfigInputSchema = z29.object({
4114
- browseRoot: z29.string().trim().min(1).max(4096).optional(),
4115
- projectsDir: z29.string().trim().min(1).max(4096).optional(),
4116
- archiveOnMerge: z29.boolean().nullable().optional(),
4117
- composerDefaults: z29.object({
4118
- autonomous: z29.boolean().nullable().optional(),
4119
- worktree: z29.boolean().nullable().optional()
4254
+ var setWorkspaceConfigInputSchema = z30.object({
4255
+ browseRoot: z30.string().trim().min(1).max(4096).optional(),
4256
+ projectsDir: z30.string().trim().min(1).max(4096).optional(),
4257
+ archiveOnMerge: z30.boolean().nullable().optional(),
4258
+ composerDefaults: z30.object({
4259
+ autonomous: z30.boolean().nullable().optional(),
4260
+ worktree: z30.boolean().nullable().optional()
4120
4261
  }).optional(),
4121
4262
  /** Machine-wide agent defaults. `null` on a key CLEARS it back to "no opinion", which a bare
4122
4263
  * absent key cannot say in a partial patch. */
4123
- agentDefaults: z29.object({
4264
+ agentDefaults: z30.object({
4124
4265
  runner: runnerSchema.nullable().optional(),
4125
4266
  /** Keyed by runner id; the server keeps only the keys of registered runners. */
4126
- models: z29.record(z29.string(), z29.string().trim().min(1).max(200).nullable().optional()).optional()
4267
+ models: z30.record(z30.string(), z30.string().trim().min(1).max(200).nullable().optional()).optional()
4127
4268
  }).optional(),
4128
- resources: z29.object({
4129
- maxParallel: z29.number().int().min(1).max(16).optional(),
4130
- maxMonitoringSessions: z29.number().int().min(0).max(16).optional(),
4131
- monitoringWakeIntervalMinutes: z29.number().int().min(1).max(60).nullable().optional(),
4132
- autoResumeOnUsageLimit: z29.boolean().optional(),
4133
- memoryLimitMb: z29.number().int().min(0).max(1048576).nullable().optional(),
4134
- worktreeRetentionDefault: z29.number().int().min(0).max(1e3).optional()
4269
+ resources: z30.object({
4270
+ maxParallel: z30.number().int().min(1).max(16).optional(),
4271
+ maxMonitoringSessions: z30.number().int().min(0).max(16).optional(),
4272
+ monitoringWakeIntervalMinutes: z30.number().int().min(1).max(60).nullable().optional(),
4273
+ autoResumeOnUsageLimit: z30.boolean().optional(),
4274
+ memoryLimitMb: z30.number().int().min(0).max(1048576).nullable().optional(),
4275
+ worktreeRetentionDefault: z30.number().int().min(0).max(1e3).optional()
4135
4276
  }).optional()
4136
4277
  });
4137
- var appearanceSchema = z29.object({
4138
- accent: z29.enum(["cezarion", "lime", "violet"]).optional(),
4139
- density: z29.enum(["comfortable", "compact", "ultra"]).optional(),
4140
- width: z29.enum(["narrow", "wide"]).optional()
4278
+ var appearanceSchema = z30.object({
4279
+ accent: z30.enum(["cezarion", "lime", "violet"]).optional(),
4280
+ density: z30.enum(["comfortable", "compact", "ultra"]).optional(),
4281
+ width: z30.enum(["narrow", "wide"]).optional()
4141
4282
  });
4142
- var taskTableUiStateSchema = z29.looseObject({
4283
+ var taskTableUiStateSchema = z30.looseObject({
4143
4284
  /** Explicit user choices only. Missing ids keep the registry-owned default. */
4144
- expandedColumns: z29.record(z29.string(), z29.boolean()).optional()
4285
+ expandedColumns: z30.record(z30.string(), z30.boolean()).optional()
4145
4286
  });
4146
- var sidebarLimitsSchema = z29.object({
4147
- overall: z29.number().int().positive().nullable().optional(),
4148
- needsYou: z29.number().int().positive().nullable().optional(),
4149
- finished: z29.number().int().positive().nullable().optional(),
4150
- working: z29.number().int().positive().nullable().optional()
4287
+ var sidebarLimitsSchema = z30.object({
4288
+ overall: z30.number().int().positive().nullable().optional(),
4289
+ needsYou: z30.number().int().positive().nullable().optional(),
4290
+ finished: z30.number().int().positive().nullable().optional(),
4291
+ working: z30.number().int().positive().nullable().optional()
4151
4292
  });
4152
4293
  function normalizeSidebarLimits(value) {
4153
4294
  const defaults = { overall: 10, needsYou: null, finished: null, working: null };
@@ -4158,54 +4299,54 @@ function normalizeSidebarLimits(value) {
4158
4299
  }
4159
4300
  return defaults;
4160
4301
  }
4161
- var uiStateSchema = z29.looseObject({
4302
+ var uiStateSchema = z30.looseObject({
4162
4303
  sidebarLimits: sidebarLimitsSchema.optional(),
4163
4304
  /** What the last started run used. `null` is a VALUE, not an absence: it records a run that
4164
4305
  * chose neither a skill nor a workflow (the plain built-in `quick-task`), which the composer
4165
4306
  * can now express since the source picker grew an empty state. Absent still means "no
4166
4307
  * run has been recorded here" — a cockpit reading either one selects nothing. */
4167
- lastTask: z29.object({ source: z29.enum(["workflow", "skill"]), ref: z29.string() }).nullable().optional(),
4308
+ lastTask: z30.object({ source: z30.enum(["workflow", "skill"]), ref: z30.string() }).nullable().optional(),
4168
4309
  /** Most-recently-run sources, newest first (deduped, capped). Feeds the composer picker's
4169
4310
  * recency sort. */
4170
- recentSources: z29.array(z29.object({ source: z29.enum(["workflow", "skill"]), ref: z29.string() })).optional(),
4311
+ recentSources: z30.array(z30.object({ source: z30.enum(["workflow", "skill"]), ref: z30.string() })).optional(),
4171
4312
  /** The last worktree choice for a single-skill run. Absent → the default (isolated worktree). */
4172
- lastWorktree: z29.boolean().optional(),
4313
+ lastWorktree: z30.boolean().optional(),
4173
4314
  /** The last autonomous choice — remembered like `lastWorktree`. Absent → off. */
4174
- lastAutonomous: z29.boolean().optional(),
4315
+ lastAutonomous: z30.boolean().optional(),
4175
4316
  /** Skill selection frequency (#408): name → times chosen, across BOTH composers. */
4176
- skillUsage: z29.record(z29.string(), z29.number()).optional(),
4177
- runsView: z29.enum(["list", "table"]).optional(),
4317
+ skillUsage: z30.record(z30.string(), z30.number()).optional(),
4318
+ runsView: z30.enum(["list", "table"]).optional(),
4178
4319
  /** The GitHub tab's last-selected sub-tab (#417). Absent → issues. */
4179
- githubView: z29.enum(["issues", "prs"]).optional(),
4320
+ githubView: z30.enum(["issues", "prs"]).optional(),
4180
4321
  /** Settings → Appearance. The theme itself stays in localStorage (`cez-theme`) — it must
4181
4322
  * pre-paint, and it is per-browser by design. */
4182
4323
  appearance: appearanceSchema.optional(),
4183
4324
  /** Follow-up prompt templates (#413). Absent → the built-in defaults; present (even `[]`) is
4184
4325
  * the user's own edited list. `skills` are the skill names the template auto-applies for. */
4185
- promptTemplates: z29.array(
4186
- z29.object({
4187
- id: z29.string(),
4188
- label: z29.string(),
4189
- text: z29.string(),
4190
- skills: z29.array(z29.string()).optional()
4326
+ promptTemplates: z30.array(
4327
+ z30.object({
4328
+ id: z30.string(),
4329
+ label: z30.string(),
4330
+ text: z30.string(),
4331
+ skills: z30.array(z30.string()).optional()
4191
4332
  })
4192
4333
  ).optional()
4193
4334
  });
4194
- var workspaceLastLocationSchema = z29.strictObject({
4195
- projectId: z29.string().min(1).max(64),
4196
- pathname: z29.string().min(1).max(2048).startsWith("/p/"),
4197
- search: z29.string().max(4096).startsWith("?").optional(),
4198
- hash: z29.string().max(2048).startsWith("#").optional()
4335
+ var workspaceLastLocationSchema = z30.strictObject({
4336
+ projectId: z30.string().min(1).max(64),
4337
+ pathname: z30.string().min(1).max(2048).startsWith("/p/"),
4338
+ search: z30.string().max(4096).startsWith("?").optional(),
4339
+ hash: z30.string().max(2048).startsWith("#").optional()
4199
4340
  });
4200
- var workspaceUiStateSchema = z29.looseObject({
4201
- sidebar: z29.looseObject({
4341
+ var workspaceUiStateSchema = z30.looseObject({
4342
+ sidebar: z30.looseObject({
4202
4343
  /** LEGACY — the sidebar's per-project collapse map (step 3.3). Still accepted and still
4203
4344
  * round-tripped so an older cockpit sharing this home keeps working, but the current
4204
4345
  * cockpit neither reads nor writes it: which groups are shut describes the WINDOW, not the
4205
4346
  * workspace, so it lives in that browser's localStorage
4206
4347
  * (`packages/web/src/lib/sidebar-collapse.ts`). One shared answer meant a phone collapsing
4207
4348
  * a group collapsed it on the desktop too. */
4208
- collapsed: z29.record(z29.string(), z29.boolean()).optional(),
4349
+ collapsed: z30.record(z30.string(), z30.boolean()).optional(),
4209
4350
  /** The user's hand-picked project order (hearsay-tools/cezarion#438, port of
4210
4351
  * open-mercato/cezar#952), most-wanted first — WORKSPACE state on purpose, unlike
4211
4352
  * `collapsed` above. Which order your repos sit in is a considered choice made once, so
@@ -4216,7 +4357,7 @@ var workspaceUiStateSchema = z29.looseObject({
4216
4357
  * Ids that are no longer registered are ignored on read; registered projects missing from
4217
4358
  * the list are not dropped — they keep registry order ahead of the picked ones
4218
4359
  * (`packages/web/src/lib/project-order.ts`). */
4219
- projectOrder: z29.array(z29.string()).optional()
4360
+ projectOrder: z30.array(z30.string()).optional()
4220
4361
  }).optional(),
4221
4362
  /** Dismissed runtime-auth incident IDs, keyed by provider. An ID is only dismissed until the
4222
4363
  * provider reports a different incident, so this stays workspace-global with the browser
@@ -4227,7 +4368,7 @@ var workspaceUiStateSchema = z29.looseObject({
4227
4368
  appearance: appearanceSchema.optional(),
4228
4369
  /** Settings → Notifications, GLOBAL since step 3.5 — one answer for the whole workspace, since
4229
4370
  * the delivering browser is one browser whichever project you are looking at. */
4230
- notifications: z29.looseObject({ enabled: z29.boolean().optional() }).optional(),
4371
+ notifications: z30.looseObject({ enabled: z30.boolean().optional() }).optional(),
4231
4372
  /** Desktop Tasks-table density, shared across every project in this workspace. */
4232
4373
  taskTable: taskTableUiStateSchema.optional(),
4233
4374
  /** LEGACY, exactly like `sidebar` above — the last settled project-scoped page, restored when
@@ -4238,21 +4379,21 @@ var workspaceUiStateSchema = z29.looseObject({
4238
4379
  });
4239
4380
  var WORKSPACE_UI_STATE_MAX_KEYS = 200;
4240
4381
  var TASK_TABLE_MAX_COLUMNS = 50;
4241
- var setWorkspaceUiStateInputSchema = z29.looseObject({
4382
+ var setWorkspaceUiStateInputSchema = z30.looseObject({
4242
4383
  ...workspaceUiStateSchema.shape,
4243
- sidebar: z29.looseObject({
4244
- collapsed: z29.record(z29.string().min(1).max(64), z29.boolean()).refine((map) => Object.keys(map).length <= WORKSPACE_UI_STATE_MAX_KEYS, {
4384
+ sidebar: z30.looseObject({
4385
+ collapsed: z30.record(z30.string().min(1).max(64), z30.boolean()).refine((map) => Object.keys(map).length <= WORKSPACE_UI_STATE_MAX_KEYS, {
4245
4386
  message: `sidebar.collapsed must have at most ${WORKSPACE_UI_STATE_MAX_KEYS} entries`
4246
4387
  }).optional(),
4247
4388
  // Project ids, so the same 64-char bound the registry's slug rule and `collapsed`'s keys
4248
4389
  // already use. Duplicates are not rejected — the cockpit dedupes on read, and a 400 on a
4249
4390
  // sidebar drag would be a worse answer than a self-healing one.
4250
- projectOrder: z29.array(z29.string().min(1).max(64)).max(WORKSPACE_UI_STATE_MAX_KEYS).optional()
4391
+ projectOrder: z30.array(z30.string().min(1).max(64)).max(WORKSPACE_UI_STATE_MAX_KEYS).optional()
4251
4392
  }).optional(),
4252
4393
  /** Keyed by runner id; the server refuses a key that names no registered or removed runner. */
4253
- dismissedProviderAuthFailures: z29.record(z29.string(), z29.string().min(1).max(128).optional()).optional(),
4394
+ dismissedProviderAuthFailures: z30.record(z30.string(), z30.string().min(1).max(128).optional()).optional(),
4254
4395
  taskTable: taskTableUiStateSchema.extend({
4255
- expandedColumns: z29.record(z29.string().min(1).max(64), z29.boolean()).refine((map) => Object.keys(map).length <= TASK_TABLE_MAX_COLUMNS, {
4396
+ expandedColumns: z30.record(z30.string().min(1).max(64), z30.boolean()).refine((map) => Object.keys(map).length <= TASK_TABLE_MAX_COLUMNS, {
4256
4397
  message: `taskTable.expandedColumns must have at most ${TASK_TABLE_MAX_COLUMNS} entries`
4257
4398
  }).optional()
4258
4399
  }).optional()
@@ -4269,62 +4410,62 @@ var WORKTREE_SETUP_MAX_COMMANDS = 20;
4269
4410
  var WORKTREE_SETUP_MAX_COMMAND_LENGTH = 4e3;
4270
4411
  var WORKTREE_SETUP_DEFAULT_TIMEOUT_SECONDS = 900;
4271
4412
  var WORKTREE_SETUP_MAX_TIMEOUT_SECONDS = 7200;
4272
- var worktreeSetupConfigSchema = z29.object({
4273
- commands: z29.array(z29.string().trim().min(1).max(WORKTREE_SETUP_MAX_COMMAND_LENGTH)).max(WORKTREE_SETUP_MAX_COMMANDS),
4413
+ var worktreeSetupConfigSchema = z30.object({
4414
+ commands: z30.array(z30.string().trim().min(1).max(WORKTREE_SETUP_MAX_COMMAND_LENGTH)).max(WORKTREE_SETUP_MAX_COMMANDS),
4274
4415
  /** Per command. Absent = `WORKTREE_SETUP_DEFAULT_TIMEOUT_SECONDS`. */
4275
- timeoutSeconds: z29.number().int().min(1).max(WORKTREE_SETUP_MAX_TIMEOUT_SECONDS).optional()
4416
+ timeoutSeconds: z30.number().int().min(1).max(WORKTREE_SETUP_MAX_TIMEOUT_SECONDS).optional()
4276
4417
  }).strict();
4277
- var configResponseSchema = z29.object({
4278
- archiveOnMerge: z29.boolean().nullable(),
4279
- effectiveArchiveOnMerge: z29.boolean(),
4280
- archiveOnMergeSource: z29.enum(["project", "global", "environment", "default"]),
4281
- baseBranch: z29.string().nullable(),
4418
+ var configResponseSchema = z30.object({
4419
+ archiveOnMerge: z30.boolean().nullable(),
4420
+ effectiveArchiveOnMerge: z30.boolean(),
4421
+ archiveOnMergeSource: z30.enum(["project", "global", "environment", "default"]),
4422
+ baseBranch: z30.string().nullable(),
4282
4423
  defaultRunner: runnerSchema,
4283
- systemPrompt: z29.string().nullable(),
4424
+ systemPrompt: z30.string().nullable(),
4284
4425
  defaultModels: runnerModelsSchema,
4285
4426
  /** True when native coding-agent settings are authoritative and model picks are read-only. */
4286
- modelsLocked: z29.boolean(),
4427
+ modelsLocked: z30.boolean(),
4287
4428
  /** How many tasks run at once (1–16). */
4288
- maxParallel: z29.number(),
4429
+ maxParallel: z30.number(),
4289
4430
  /** Per-task memory ceiling in MiB (whole process tree); null = no limit. */
4290
- memoryLimitMb: z29.number().nullable(),
4431
+ memoryLimitMb: z30.number().nullable(),
4291
4432
  /** Keep the last N finished worktrees on disk (#483); 0 = unlimited. Older ones are reclaimed
4292
4433
  * (directory only — branch kept, so work is recoverable). */
4293
- worktreeRetention: z29.number(),
4434
+ worktreeRetention: z30.number(),
4294
4435
  /** Live title updates: null = no config key, the `CEZ_TITLE_UPDATES` env default (ON) decides. */
4295
- liveTitleUpdates: z29.boolean().nullable(),
4436
+ liveTitleUpdates: z30.boolean().nullable(),
4296
4437
  /** Optional review gate (#489): null = no config key, the `CEZ_REVIEW_GATE` env default (OFF)
4297
4438
  * decides. */
4298
- reviewGate: z29.boolean().nullable(),
4439
+ reviewGate: z30.boolean().nullable(),
4299
4440
  /** Worktree setup (#917): the commands that prepare a new task or worker worktree, with the
4300
4441
  * timeout filled in. null = no setup, or an invalid value (then `worktreeSetupIssue` says why). */
4301
- worktreeSetup: z29.object({ commands: z29.array(z29.string()), timeoutSeconds: z29.number() }).nullable(),
4442
+ worktreeSetup: z30.object({ commands: z30.array(z30.string()), timeoutSeconds: z30.number() }).nullable(),
4302
4443
  /** Why `config.json`'s `worktreeSetup` is invalid; null when it is valid or absent. */
4303
- worktreeSetupIssue: z29.string().nullable(),
4444
+ worktreeSetupIssue: z30.string().nullable(),
4304
4445
  /** Worktree teardown (hearsay-tools/squawk#914): the commands worker destroy runs in the worker's
4305
4446
  * worktree before it looks for holders, with the timeout filled in. null = no teardown, or an
4306
4447
  * invalid value (then `worktreeTeardownIssue` says why). */
4307
- worktreeTeardown: z29.object({ commands: z29.array(z29.string()), timeoutSeconds: z29.number() }).nullable(),
4448
+ worktreeTeardown: z30.object({ commands: z30.array(z30.string()), timeoutSeconds: z30.number() }).nullable(),
4308
4449
  /** Why `config.json`'s `worktreeTeardown` is invalid; null when it is valid or absent. */
4309
- worktreeTeardownIssue: z29.string().nullable()
4450
+ worktreeTeardownIssue: z30.string().nullable()
4310
4451
  });
4311
4452
  var setConfigResponseSchema = configResponseSchema;
4312
- var setConfigInputSchema = z29.object({
4313
- archiveOnMerge: z29.boolean().nullable().optional(),
4314
- baseBranch: z29.string().trim().min(1).max(200).nullable().optional(),
4453
+ var setConfigInputSchema = z30.object({
4454
+ archiveOnMerge: z30.boolean().nullable().optional(),
4455
+ baseBranch: z30.string().trim().min(1).max(200).nullable().optional(),
4315
4456
  defaultRunner: runnerSchema.optional(),
4316
- systemPrompt: z29.string().trim().max(2e4).nullable().optional(),
4457
+ systemPrompt: z30.string().trim().max(2e4).nullable().optional(),
4317
4458
  /** Keyed by runner id; the server keeps only the keys of registered runners. */
4318
- defaultModels: z29.record(z29.string(), z29.string().trim().max(200).nullable().optional()).optional(),
4319
- maxParallel: z29.number().int().min(1).max(16).optional(),
4459
+ defaultModels: z30.record(z30.string(), z30.string().trim().max(200).nullable().optional()).optional(),
4460
+ maxParallel: z30.number().int().min(1).max(16).optional(),
4320
4461
  /** null or 0 clears the ceiling back to "no limit". */
4321
- memoryLimitMb: z29.number().int().min(0).max(1048576).nullable().optional(),
4462
+ memoryLimitMb: z30.number().int().min(0).max(1048576).nullable().optional(),
4322
4463
  /** Keep last N finished worktrees (#483); 0 = unlimited, null clears back to the default (10). */
4323
- worktreeRetention: z29.number().int().min(0).max(1e3).nullable().optional(),
4464
+ worktreeRetention: z30.number().int().min(0).max(1e3).nullable().optional(),
4324
4465
  /** null clears the key back to the env-default behavior. */
4325
- liveTitleUpdates: z29.boolean().nullable().optional(),
4466
+ liveTitleUpdates: z30.boolean().nullable().optional(),
4326
4467
  /** null clears the key back to the env-default behavior (OFF). */
4327
- reviewGate: z29.boolean().nullable().optional(),
4468
+ reviewGate: z30.boolean().nullable().optional(),
4328
4469
  /** Worktree setup (#917). null or an empty command list deletes the key. Refused with 409 by a
4329
4470
  * hosted cockpit: these are commands the host runs. */
4330
4471
  worktreeSetup: worktreeSetupConfigSchema.nullable().optional(),
@@ -4333,238 +4474,238 @@ var setConfigInputSchema = z29.object({
4333
4474
  worktreeTeardown: worktreeSetupConfigSchema.nullable().optional()
4334
4475
  });
4335
4476
  var providerIdSchema = runnerSchema;
4336
- var providerConnectionStateSchema = z29.enum([
4477
+ var providerConnectionStateSchema = z30.enum([
4337
4478
  "connected",
4338
4479
  "disconnected",
4339
4480
  "not-installed",
4340
4481
  "unknown"
4341
4482
  ]);
4342
- var providerStatusSchema = z29.object({
4343
- requiresAccountHome: z29.boolean().optional(),
4483
+ var providerStatusSchema = z30.object({
4484
+ requiresAccountHome: z30.boolean().optional(),
4344
4485
  provider: providerIdSchema,
4345
4486
  status: providerConnectionStateSchema,
4346
- enabled: z29.boolean().optional(),
4347
- hint: z29.string().optional(),
4348
- authFailureId: z29.string().optional(),
4487
+ enabled: z30.boolean().optional(),
4488
+ hint: z30.string().optional(),
4489
+ authFailureId: z30.string().optional(),
4349
4490
  /** Which agent account this row describes (spec 2026-07-29-agent-profiles). ABSENT on
4350
4491
  * `GET /api/v1/providers/status`, which deliberately keeps answering exactly one row per
4351
4492
  * provider — the discovered default — so an older client sees no change at all. Per-account
4352
4493
  * rows are carried by `GET /api/v1/workspace/agent-profiles` instead. */
4353
- profileId: z29.string().optional()
4494
+ profileId: z30.string().optional()
4354
4495
  });
4355
- var providerStatusResponseSchema = z29.object({
4356
- providers: z29.array(providerStatusSchema)
4496
+ var providerStatusResponseSchema = z30.object({
4497
+ providers: z30.array(providerStatusSchema)
4357
4498
  });
4358
- var providerConnectResponseSchema = z29.discriminatedUnion("opened", [
4359
- z29.object({ opened: z29.literal(true), command: z29.string() }),
4360
- z29.object({ opened: z29.literal(false), connected: z29.literal(true), command: z29.string() })
4499
+ var providerConnectResponseSchema = z30.discriminatedUnion("opened", [
4500
+ z30.object({ opened: z30.literal(true), command: z30.string() }),
4501
+ z30.object({ opened: z30.literal(false), connected: z30.literal(true), command: z30.string() })
4361
4502
  ]);
4362
- var providerSignInSchema = z29.discriminatedUnion("state", [
4363
- z29.object({ id: z29.uuid(), state: z29.literal("waiting"), url: z29.string().url() }),
4364
- z29.object({ id: z29.uuid(), state: z29.enum(["connected", "cancelled"]) }),
4365
- z29.object({ id: z29.uuid(), state: z29.literal("failed"), error: z29.string() })
4503
+ var providerSignInSchema = z30.discriminatedUnion("state", [
4504
+ z30.object({ id: z30.uuid(), state: z30.literal("waiting"), url: z30.string().url() }),
4505
+ z30.object({ id: z30.uuid(), state: z30.enum(["connected", "cancelled"]) }),
4506
+ z30.object({ id: z30.uuid(), state: z30.literal("failed"), error: z30.string() })
4366
4507
  ]);
4367
- var runnerModelCatalogResponseSchema = z29.object({
4508
+ var runnerModelCatalogResponseSchema = z30.object({
4368
4509
  runner: runnerSchema,
4369
- models: z29.array(runnerModelOptionSchema),
4370
- source: z29.enum(["live", "cache", "unavailable"]),
4371
- stale: z29.boolean(),
4372
- reason: z29.string().optional()
4373
- });
4374
- var openTargetSchema = z29.object({
4375
- id: z29.string(),
4376
- label: z29.string(),
4510
+ models: z30.array(runnerModelOptionSchema),
4511
+ source: z30.enum(["live", "cache", "unavailable"]),
4512
+ stale: z30.boolean(),
4513
+ reason: z30.string().optional()
4514
+ });
4515
+ var openTargetSchema = z30.object({
4516
+ id: z30.string(),
4517
+ label: z30.string(),
4377
4518
  /** A stable icon key (#361) the UI maps to a concrete icon. Optional: an older server omitting
4378
4519
  * it just renders the generic fallback icon. */
4379
- icon: z29.string().optional()
4520
+ icon: z30.string().optional()
4380
4521
  });
4381
- var openTargetsResponseSchema = z29.object({
4382
- targets: z29.array(openTargetSchema)
4522
+ var openTargetsResponseSchema = z30.object({
4523
+ targets: z30.array(openTargetSchema)
4383
4524
  });
4384
- var openProjectInSchema = z29.object({
4525
+ var openProjectInSchema = z30.object({
4385
4526
  // A short bound (#429): matched against a downstream allowlist, so an app id is never long.
4386
- target: z29.string().trim().min(1, "target required").max(200)
4527
+ target: z30.string().trim().min(1, "target required").max(200)
4387
4528
  });
4388
- var openProjectInResponseSchema = z29.object({
4389
- opened: z29.literal(true),
4390
- path: z29.string()
4529
+ var openProjectInResponseSchema = z30.object({
4530
+ opened: z30.literal(true),
4531
+ path: z30.string()
4391
4532
  });
4392
- var workspaceIdentityResponseSchema = z29.object({
4393
- installId: z29.uuid(),
4394
- version: z29.string()
4533
+ var workspaceIdentityResponseSchema = z30.object({
4534
+ installId: z30.uuid(),
4535
+ version: z30.string()
4395
4536
  });
4396
4537
 
4397
4538
  // ../contract/src/skills.ts
4398
- import { z as z30 } from "zod";
4399
- var skillSchema = z30.object({
4400
- name: z30.string(),
4401
- description: z30.string().optional(),
4402
- body: z30.string(),
4403
- path: z30.string(),
4539
+ import { z as z31 } from "zod";
4540
+ var skillSchema = z31.object({
4541
+ name: z31.string(),
4542
+ description: z31.string().optional(),
4543
+ body: z31.string(),
4544
+ path: z31.string(),
4404
4545
  /** `builtin`: shipped by Squawk itself and listed last (#774), so a repo skill of the same name wins. */
4405
- source: z30.enum(["ai", "cezar", "agents", "global", "team", "builtin"]),
4546
+ source: z31.enum(["ai", "cezar", "agents", "global", "team", "builtin"]),
4406
4547
  /** Team skills only: where the definition lives in its skills repo. */
4407
- team: z30.object({
4408
- repo: z30.string(),
4409
- ref: z30.string(),
4410
- path: z30.string(),
4548
+ team: z31.object({
4549
+ repo: z31.string(),
4550
+ ref: z31.string(),
4551
+ path: z31.string(),
4411
4552
  /** True for the `SKILL.md` convention — a whole directory (references/…). */
4412
- dir: z30.boolean(),
4553
+ dir: z31.boolean(),
4413
4554
  /**
4414
4555
  * The exact commit `ref` resolved to when the skill was read (#428).
4415
4556
  *
4416
4557
  * The hand-written DTO omitted this field entirely — it was NARROWER than the route,
4417
4558
  * which has served it since #428.
4418
4559
  */
4419
- commit: z30.string().optional()
4560
+ commit: z31.string().optional()
4420
4561
  }).optional()
4421
4562
  });
4422
4563
 
4423
4564
  // ../contract/src/agent-config.ts
4424
- import { z as z31 } from "zod";
4425
- var agentConfigFormatSchema = z31.enum(["json", "jsonc", "toml", "yaml", "markdown"]);
4426
- var agentConfigScopeSchema = z31.enum(["user", "project", "local"]);
4427
- var agentConfigKindSchema = z31.enum(["settings", "memory", "mcp"]);
4428
- var agentConfigTrackedSchema = z31.enum(["tracked", "gitignored", "outside-repo"]);
4429
- var agentConfigFileSchema = z31.object({
4565
+ import { z as z32 } from "zod";
4566
+ var agentConfigFormatSchema = z32.enum(["json", "jsonc", "toml", "yaml", "markdown"]);
4567
+ var agentConfigScopeSchema = z32.enum(["user", "project", "local"]);
4568
+ var agentConfigKindSchema = z32.enum(["settings", "memory", "mcp"]);
4569
+ var agentConfigTrackedSchema = z32.enum(["tracked", "gitignored", "outside-repo"]);
4570
+ var agentConfigFileSchema = z32.object({
4430
4571
  /** Stable, opaque, URL-safe — the ONLY thing a client may name (traversal-proof). */
4431
- id: z31.string(),
4572
+ id: z32.string(),
4432
4573
  /** Every runner that reads this file: `<repo>/AGENTS.md` is one file, two readers. */
4433
- runners: z31.array(runnerSchema),
4574
+ runners: z32.array(runnerSchema),
4434
4575
  kind: agentConfigKindSchema,
4435
4576
  scope: agentConfigScopeSchema,
4436
- label: z31.string(),
4437
- path: z31.string(),
4577
+ label: z32.string(),
4578
+ path: z32.string(),
4438
4579
  format: agentConfigFormatSchema,
4439
4580
  tracked: agentConfigTrackedSchema,
4440
- seeded: z31.boolean(),
4441
- holdsMcp: z31.boolean(),
4581
+ seeded: z32.boolean(),
4582
+ holdsMcp: z32.boolean(),
4442
4583
  /** VERBATIM from the vendor docs. Never computed, never generic. */
4443
- precedence: z31.string(),
4584
+ precedence: z32.string(),
4444
4585
  /** Documented mid-run reload behaviour, or absent when the vendor is silent. */
4445
- hotReload: z31.string().optional(),
4446
- docsUrl: z31.string(),
4447
- exists: z31.boolean(),
4448
- size: z31.number(),
4586
+ hotReload: z32.string().optional(),
4587
+ docsUrl: z32.string(),
4588
+ exists: z32.boolean(),
4589
+ size: z32.number(),
4449
4590
  /** sha256 of the bytes, or null when absent. */
4450
- version: z31.string().nullable(),
4591
+ version: z32.string().nullable(),
4451
4592
  /** False in hosted mode (whole feature) — the client renders read-only up front. */
4452
- writable: z31.boolean(),
4453
- readOnlyReason: z31.string().optional()
4593
+ writable: z32.boolean(),
4594
+ readOnlyReason: z32.string().optional()
4454
4595
  });
4455
- var userMcpListingSchema = z31.object({
4456
- path: z31.string(),
4457
- servers: z31.array(z31.string()),
4458
- readable: z31.boolean()
4596
+ var userMcpListingSchema = z32.object({
4597
+ path: z32.string(),
4598
+ servers: z32.array(z32.string()),
4599
+ readable: z32.boolean()
4459
4600
  });
4460
- var agentConfigListingSchema = z31.object({
4461
- editable: z31.boolean(),
4462
- files: z31.array(agentConfigFileSchema),
4601
+ var agentConfigListingSchema = z32.object({
4602
+ editable: z32.boolean(),
4603
+ files: z32.array(agentConfigFileSchema),
4463
4604
  /** null in hosted mode (host-state disclosure guard). */
4464
4605
  userMcp: userMcpListingSchema.nullable()
4465
4606
  });
4466
- var agentConfigFileContentSchema = z31.object({
4467
- id: z31.string(),
4468
- path: z31.string(),
4469
- exists: z31.boolean(),
4470
- content: z31.string(),
4607
+ var agentConfigFileContentSchema = z32.object({
4608
+ id: z32.string(),
4609
+ path: z32.string(),
4610
+ exists: z32.boolean(),
4611
+ content: z32.string(),
4471
4612
  /** sha256 of the bytes, or null when the file does not exist yet. */
4472
- version: z31.string().nullable()
4613
+ version: z32.string().nullable()
4473
4614
  });
4474
- var setAgentConfigInputSchema = z31.object({
4475
- content: z31.string().max(2e6),
4476
- version: z31.string().nullable()
4615
+ var setAgentConfigInputSchema = z32.object({
4616
+ content: z32.string().max(2e6),
4617
+ version: z32.string().nullable()
4477
4618
  });
4478
4619
 
4479
4620
  // ../contract/src/session-context.ts
4480
- import { z as z32 } from "zod";
4621
+ import { z as z33 } from "zod";
4481
4622
  var SESSION_CONTEXT_FILE_MAX_BYTES = 256 * 1024;
4482
- var fileContentSchema = z32.string().refine((text) => utf8Bytes(text) <= SESSION_CONTEXT_FILE_MAX_BYTES, {
4623
+ var fileContentSchema = z33.string().refine((text) => utf8Bytes(text) <= SESSION_CONTEXT_FILE_MAX_BYTES, {
4483
4624
  error: `context.local.yaml must be at most ${SESSION_CONTEXT_FILE_MAX_BYTES} bytes`
4484
4625
  });
4485
- var sessionContextSourceSchema = z32.enum(["built-in", "shared", "local"]);
4486
- var sessionContextFileSchema = z32.object({
4626
+ var sessionContextSourceSchema = z33.enum(["built-in", "shared", "local"]);
4627
+ var sessionContextFileSchema = z33.object({
4487
4628
  /** Relative to the project root: `.ai/squawk/context.local.yaml` or `.ai/cezar/context.local.yaml`. */
4488
- path: z32.string(),
4489
- exists: z32.boolean(),
4490
- content: z32.string(),
4629
+ path: z33.string(),
4630
+ exists: z33.boolean(),
4631
+ content: z33.string(),
4491
4632
  /** sha256 of the bytes, or null when the file does not exist. */
4492
- version: z32.string().nullable(),
4633
+ version: z33.string().nullable(),
4493
4634
  /** False when the file cannot be read as text, or lives in read-only fallback project data. */
4494
- writable: z32.boolean(),
4495
- readOnlyReason: z32.string().nullable()
4635
+ writable: z33.boolean(),
4636
+ readOnlyReason: z33.string().nullable()
4496
4637
  });
4497
- var sessionContextSharedFileSchema = z32.object({
4638
+ var sessionContextSharedFileSchema = z33.object({
4498
4639
  /** Relative to the project root: `.ai/squawk/context.yaml` or `.ai/cezar/context.yaml`. */
4499
- path: z32.string(),
4500
- exists: z32.boolean(),
4501
- content: z32.string(),
4640
+ path: z33.string(),
4641
+ exists: z33.boolean(),
4642
+ content: z33.string(),
4502
4643
  /** True when Git tracks this file in the repository index. */
4503
- tracked: z32.boolean(),
4644
+ tracked: z33.boolean(),
4504
4645
  /** Non-null when the file cannot be read as UTF-8 text (e.g. symlink, binary, oversized). */
4505
- unreadableReason: z32.string().nullable()
4646
+ unreadableReason: z33.string().nullable()
4506
4647
  });
4507
- var sessionContextStateSchema = z32.object({
4648
+ var sessionContextStateSchema = z33.object({
4508
4649
  local: sessionContextFileSchema,
4509
4650
  shared: sessionContextSharedFileSchema
4510
4651
  });
4511
- var setSessionContextSchema = z32.object({
4652
+ var setSessionContextSchema = z33.object({
4512
4653
  content: fileContentSchema,
4513
- version: z32.string().nullable()
4654
+ version: z33.string().nullable()
4514
4655
  });
4515
- var sessionContextRoleSchema = z32.enum(["parent", "worker"]);
4516
- var sessionContextPreviewRequestSchema = z32.object({
4656
+ var sessionContextRoleSchema = z33.enum(["parent", "worker"]);
4657
+ var sessionContextPreviewRequestSchema = z33.object({
4517
4658
  content: fileContentSchema,
4518
4659
  role: sessionContextRoleSchema
4519
4660
  });
4520
- var sessionContextProblemSchema = z32.object({
4521
- line: z32.number().nullable(),
4522
- rule: z32.number().nullable(),
4523
- message: z32.string()
4661
+ var sessionContextProblemSchema = z33.object({
4662
+ line: z33.number().nullable(),
4663
+ rule: z33.number().nullable(),
4664
+ message: z33.string()
4524
4665
  });
4525
- var sessionContextPreviewBlockSchema = z32.object({
4526
- id: z32.string(),
4666
+ var sessionContextPreviewBlockSchema = z33.object({
4667
+ id: z33.string(),
4527
4668
  source: sessionContextSourceSchema,
4528
4669
  /** `built-in` for the handoff block; null when the file names no target for the entry. */
4529
- target: z32.enum(["built-in", "parent", "worker", "both"]).nullable(),
4530
- status: z32.enum(["applied", "skipped", "not-for-role"]),
4670
+ target: z33.enum(["built-in", "parent", "worker", "both"]).nullable(),
4671
+ status: z33.enum(["applied", "skipped", "not-for-role"]),
4531
4672
  /** True when a local rule replaced or muted a shared rule with the same id. */
4532
- overridesShared: z32.boolean(),
4533
- bytes: z32.number().nullable(),
4534
- reason: z32.string().nullable(),
4535
- sources: z32.array(z32.string()),
4673
+ overridesShared: z33.boolean(),
4674
+ bytes: z33.number().nullable(),
4675
+ reason: z33.string().nullable(),
4676
+ sources: z33.array(z33.string()),
4536
4677
  /** The rendered text, cut short for the preview; null when nothing rendered. */
4537
- text: z32.string().nullable(),
4538
- truncated: z32.boolean()
4678
+ text: z33.string().nullable(),
4679
+ truncated: z33.boolean()
4539
4680
  });
4540
- var sessionContextPreviewSchema = z32.object({
4541
- problems: z32.array(sessionContextProblemSchema),
4542
- blocks: z32.array(sessionContextPreviewBlockSchema),
4543
- usedBytes: z32.number(),
4544
- limitBytes: z32.number()
4681
+ var sessionContextPreviewSchema = z33.object({
4682
+ problems: z33.array(sessionContextProblemSchema),
4683
+ blocks: z33.array(sessionContextPreviewBlockSchema),
4684
+ usedBytes: z33.number(),
4685
+ limitBytes: z33.number()
4545
4686
  });
4546
4687
 
4547
4688
  // ../contract/src/agent-profiles.ts
4548
- import { z as z33 } from "zod";
4689
+ import { z as z34 } from "zod";
4549
4690
  var DEFAULT_AGENT_ACCOUNT_ID = "default";
4550
- var agentProfileSchema = z33.object({
4691
+ var agentProfileSchema = z34.object({
4551
4692
  /** `default` for the discovered profile, else the stored slug. */
4552
- id: z33.string(),
4693
+ id: z34.string(),
4553
4694
  provider: providerIdSchema,
4554
- label: z33.string(),
4695
+ label: z34.string(),
4555
4696
  /** As the user wrote it — a literal `~` is preserved, matching `browseRoot`/`projectsDir`.
4556
4697
  * Omitted on a remote cockpit without `settingsAdmin` so host paths are not disclosed. */
4557
- configDir: z33.string().optional(),
4698
+ configDir: z34.string().optional(),
4558
4699
  /** Expanded absolute path. Omitted on a remote cockpit without `settingsAdmin`. */
4559
- path: z33.string().optional(),
4700
+ path: z34.string().optional(),
4560
4701
  /** False for a dir the CLI has not created yet — legitimate, and NOT a reason to fall back
4561
4702
  * to another account at run time (that would silently bill the wrong subscription). */
4562
- exists: z33.boolean(),
4703
+ exists: z34.boolean(),
4563
4704
  /** Whether the dir carries this agent's own marker files. ADVISORY: an unrecognised dir is
4564
4705
  * still accepted, because "add profile → Connect → the CLI creates it" is the real flow. */
4565
- looksValid: z33.boolean(),
4706
+ looksValid: z34.boolean(),
4566
4707
  /** True for the profile Squawk discovers from the environment. Never stored, never deletable. */
4567
- isDefault: z33.boolean(),
4708
+ isDefault: z34.boolean(),
4568
4709
  /** This account's own authentication state — two Claude logins answer independently.
4569
4710
  *
4570
4711
  * **Absent until the probe has warmed.** Every probe shells out to an agent CLI, and this
@@ -4578,49 +4719,49 @@ function agentAccountRouteId(profile) {
4578
4719
  return profile.isDefault ? `default:${profile.provider}` : profile.id;
4579
4720
  }
4580
4721
  var agentAccountSelectionSchema = perRunnerOptionalStrings();
4581
- var agentProfilesResponseSchema = z33.object({
4582
- editable: z33.boolean(),
4583
- profiles: z33.array(agentProfileSchema),
4722
+ var agentProfilesResponseSchema = z34.object({
4723
+ editable: z34.boolean(),
4724
+ profiles: z34.array(agentProfileSchema),
4584
4725
  /** Providers that can carry more than one account at all — what "Add account" is offered for.
4585
4726
  * OpenCode and omp are absent: no folder variable moves their credentials, so a config-dir
4586
4727
  * profile would swap settings while still billing the other account. */
4587
- profileCapableProviders: z33.array(providerIdSchema),
4728
+ profileCapableProviders: z34.array(providerIdSchema),
4588
4729
  /** Which account each project uses, keyed by the project's realpath'd ROOT.
4589
4730
  *
4590
4731
  * Served here rather than on `GET /api/v1/projects` because it is stored beside the accounts it
4591
4732
  * names (`~/.cezar/agent-accounts.json`) — one file, so deleting an account and scrubbing every
4592
4733
  * reference to it is one atomic write, and neither can be dropped by a Squawk version that never
4593
4734
  * heard of accounts. Empty without `settingsAdmin` so host paths are not disclosed. */
4594
- selections: z33.record(z33.string(), agentAccountSelectionSchema),
4735
+ selections: z34.record(z34.string(), agentAccountSelectionSchema),
4595
4736
  /** Which account each project uses, keyed by canonical project id (plus `'default'` for the boot
4596
4737
  * project). Always populated without disclosing host filesystem paths. */
4597
- projectSelections: z33.record(z33.string(), agentAccountSelectionSchema)
4738
+ projectSelections: z34.record(z34.string(), agentAccountSelectionSchema)
4598
4739
  });
4599
- var selectAgentProfileInputSchema = z33.object({
4740
+ var selectAgentProfileInputSchema = z34.object({
4600
4741
  /** Registry slug, or the reserved `default` boot alias. Resolved to a root server-side. */
4601
- projectId: z33.string().min(1).max(64),
4742
+ projectId: z34.string().min(1).max(64),
4602
4743
  provider: providerIdSchema,
4603
- profileId: z33.string().max(64).nullable()
4744
+ profileId: z34.string().max(64).nullable()
4604
4745
  });
4605
- var agentProfileSelectionsResponseSchema = z33.object({
4606
- selections: z33.record(z33.string(), agentAccountSelectionSchema),
4607
- projectSelections: z33.record(z33.string(), agentAccountSelectionSchema)
4746
+ var agentProfileSelectionsResponseSchema = z34.object({
4747
+ selections: z34.record(z34.string(), agentAccountSelectionSchema),
4748
+ projectSelections: z34.record(z34.string(), agentAccountSelectionSchema)
4608
4749
  });
4609
- var agentAccountStatusResponseSchema = z33.object({ status: providerStatusSchema });
4610
- var createAgentProfileInputSchema = z33.object({
4750
+ var agentAccountStatusResponseSchema = z34.object({ status: providerStatusSchema });
4751
+ var createAgentProfileInputSchema = z34.object({
4611
4752
  provider: providerIdSchema,
4612
- label: z33.string().trim().max(200).optional(),
4753
+ label: z34.string().trim().max(200).optional(),
4613
4754
  /** Stored as written; validated absolute after `~` expansion, server-side. */
4614
- configDir: z33.string().trim().min(1).max(4096)
4755
+ configDir: z34.string().trim().min(1).max(4096)
4615
4756
  });
4616
- var agentProfileResponseSchema = z33.object({ profile: agentProfileSchema });
4617
- var updateAgentProfileInputSchema = z33.object({
4618
- label: z33.string().trim().max(200).optional(),
4619
- configDir: z33.string().trim().min(1).max(4096).optional()
4757
+ var agentProfileResponseSchema = z34.object({ profile: agentProfileSchema });
4758
+ var updateAgentProfileInputSchema = z34.object({
4759
+ label: z34.string().trim().max(200).optional(),
4760
+ configDir: z34.string().trim().min(1).max(4096).optional()
4620
4761
  });
4621
- var removeAgentProfileResponseSchema = z33.object({
4622
- removed: z33.literal(true),
4623
- id: z33.string()
4762
+ var removeAgentProfileResponseSchema = z34.object({
4763
+ removed: z34.literal(true),
4764
+ id: z34.string()
4624
4765
  });
4625
4766
 
4626
4767
  // ../contract/src/zoned-time.ts
@@ -4703,7 +4844,7 @@ function localTimeZone() {
4703
4844
  }
4704
4845
 
4705
4846
  // ../contract/src/automation-schedule.ts
4706
- import { z as z34 } from "zod";
4847
+ import { z as z35 } from "zod";
4707
4848
  var SCHEDULE_TYPES = ["daily", "weekdays", "weekly", "hours", "once"];
4708
4849
  var SCHEDULE_HOURS_OPTIONS = [1, 2, 3, 4, 6, 8, 12];
4709
4850
  var WEEKDAY_NAMES = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
@@ -4714,34 +4855,34 @@ var ONCE_AT_PATTERN = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})$/;
4714
4855
  var REPEATING_KEYS = ["hour", "minute", "day", "every"];
4715
4856
  var ONCE_KEYS = ["at", "timeZone", "latestStartMinutes"];
4716
4857
  var ONCE_PAST_DUE_MESSAGE = "the due time has passed; choose a later time or use Run now";
4717
- var onceStatusSchema = z34.enum(["paused", "waiting", "failed", "missed", "archived"]);
4858
+ var onceStatusSchema = z35.enum(["paused", "waiting", "failed", "missed", "archived"]);
4718
4859
  function unknownTimeZoneMessage(zone) {
4719
4860
  return `unknown time zone "${zone}"; use an IANA name such as Europe/Warsaw`;
4720
4861
  }
4721
- var automationScheduleSchema = z34.object({
4722
- type: z34.enum(SCHEDULE_TYPES),
4862
+ var automationScheduleSchema = z35.object({
4863
+ type: z35.enum(SCHEDULE_TYPES),
4723
4864
  /** 0–23; `daily`, `weekdays`, `weekly`. Default 4. */
4724
- hour: z34.number().int().min(0).max(23).optional(),
4865
+ hour: z35.number().int().min(0).max(23).optional(),
4725
4866
  /** 0–59; `daily`, `weekdays`, `weekly`. Default 0. */
4726
- minute: z34.number().int().min(0).max(59).optional(),
4867
+ minute: z35.number().int().min(0).max(59).optional(),
4727
4868
  /** ISO weekday, Monday = 1 … Sunday = 7; `weekly`. Default 1. */
4728
- day: z34.number().int().min(1).max(7).optional(),
4869
+ day: z35.number().int().min(1).max(7).optional(),
4729
4870
  /** Hours between runs, from 00:00; `hours`. Default 6. */
4730
- every: z34.union([
4731
- z34.literal(1),
4732
- z34.literal(2),
4733
- z34.literal(3),
4734
- z34.literal(4),
4735
- z34.literal(6),
4736
- z34.literal(8),
4737
- z34.literal(12)
4871
+ every: z35.union([
4872
+ z35.literal(1),
4873
+ z35.literal(2),
4874
+ z35.literal(3),
4875
+ z35.literal(4),
4876
+ z35.literal(6),
4877
+ z35.literal(8),
4878
+ z35.literal(12)
4738
4879
  ]).optional(),
4739
4880
  /** `once`: the local wall time `YYYY-MM-DDTHH:MM` in `timeZone`. */
4740
- at: z34.string().regex(ONCE_AT_PATTERN, "at must be YYYY-MM-DDTHH:MM").optional(),
4881
+ at: z35.string().regex(ONCE_AT_PATTERN, "at must be YYYY-MM-DDTHH:MM").optional(),
4741
4882
  /** `once`: the IANA zone `at` is read in. Required there, refused on the repeating shapes. */
4742
- timeZone: z34.string().optional(),
4883
+ timeZone: z35.string().optional(),
4743
4884
  /** `once`: how late after `at` a start may still launch. Absent = no limit. */
4744
- latestStartMinutes: z34.number().int().min(ONCE_MIN_LATEST_START_MINUTES).max(ONCE_MAX_LATEST_START_MINUTES).optional()
4885
+ latestStartMinutes: z35.number().int().min(ONCE_MIN_LATEST_START_MINUTES).max(ONCE_MAX_LATEST_START_MINUTES).optional()
4745
4886
  }).superRefine((schedule, ctx) => {
4746
4887
  const present = (key) => schedule[key] !== void 0;
4747
4888
  const refuse = (key, message2) => ctx.addIssue({ code: "custom", path: [key], message: message2 });
@@ -4906,108 +5047,108 @@ function nextOccurrence(schedule, afterMs, timeZone) {
4906
5047
  }
4907
5048
 
4908
5049
  // ../contract/src/automations.ts
4909
- import { z as z35 } from "zod";
4910
- var automationEventSchema = z35.enum([
5050
+ import { z as z36 } from "zod";
5051
+ var automationEventSchema = z36.enum([
4911
5052
  "pull_request.opened",
4912
5053
  "issue.opened",
4913
5054
  "issue.labeled",
4914
5055
  "issue.unlabeled"
4915
5056
  ]);
4916
- var automationFiltersSchema = z35.object({
5057
+ var automationFiltersSchema = z36.object({
4917
5058
  /** Opt in to matching events before enablement, bounded by lookbackDays. Absent means false. */
4918
- includeExisting: z35.boolean().optional(),
4919
- authors: z35.array(z35.string()).optional(),
4920
- assignees: z35.array(z35.string()).optional(),
5059
+ includeExisting: z36.boolean().optional(),
5060
+ authors: z36.array(z36.string()).optional(),
5061
+ assignees: z36.array(z36.string()).optional(),
4921
5062
  /** Opt-in: require an open item and matching live labels before reservation and launch. */
4922
- requireCurrentLabels: z35.boolean().optional(),
4923
- allLabels: z35.array(z35.string()).optional(),
4924
- anyLabels: z35.array(z35.string()).optional(),
4925
- excludeLabels: z35.array(z35.string()).optional(),
5063
+ requireCurrentLabels: z36.boolean().optional(),
5064
+ allLabels: z36.array(z36.string()).optional(),
5065
+ anyLabels: z36.array(z36.string()).optional(),
5066
+ excludeLabels: z36.array(z36.string()).optional(),
4926
5067
  /** Required for the two label events — the server rejects a definition without it. */
4927
- changedLabels: z35.array(z35.string()).optional(),
4928
- lookbackDays: z35.number(),
4929
- maxRecords: z35.number()
5068
+ changedLabels: z36.array(z36.string()).optional(),
5069
+ lookbackDays: z36.number(),
5070
+ maxRecords: z36.number()
4930
5071
  });
4931
- var automationKindSchema = z35.enum(["github", "schedule"]);
5072
+ var automationKindSchema = z36.enum(["github", "schedule"]);
4932
5073
  var automationTaskSchema = createRunInputBaseSchema.omit({ task: true, images: true, systemPrompt: true }).extend({
4933
5074
  /** The prompt template. `{{github.number}}`, `{{github.title}}`, `{{github.url}}` and
4934
5075
  * `{{github.labels}}` are substituted per match; GitHub content is appended as untrusted
4935
5076
  * context, never interpolated into instructions. */
4936
- prompt: z35.string(),
4937
- variants: z35.union([z35.literal(1), z35.literal(2), z35.literal(3)]).optional(),
4938
- systemPrompt: z35.string().optional()
4939
- });
4940
- var automationArchiveSchema = z35.object({
4941
- at: z35.string(),
4942
- outcome: z35.enum(["launched", "cancelled"]),
4943
- runId: z35.string().optional(),
4944
- receiptId: z35.string().optional(),
4945
- trigger: z35.enum(["schedule", "late", "manual", "retry"]).optional()
4946
- });
4947
- var automationDefinitionSchema = z35.object({
4948
- id: z35.string(),
5077
+ prompt: z36.string(),
5078
+ variants: z36.union([z36.literal(1), z36.literal(2), z36.literal(3)]).optional(),
5079
+ systemPrompt: z36.string().optional()
5080
+ });
5081
+ var automationArchiveSchema = z36.object({
5082
+ at: z36.string(),
5083
+ outcome: z36.enum(["launched", "cancelled"]),
5084
+ runId: z36.string().optional(),
5085
+ receiptId: z36.string().optional(),
5086
+ trigger: z36.enum(["schedule", "late", "manual", "retry"]).optional()
5087
+ });
5088
+ var automationDefinitionSchema = z36.object({
5089
+ id: z36.string(),
4949
5090
  /** Bumped on every edit; a PUT must echo the revision it read (optimistic concurrency). */
4950
- revision: z35.number(),
4951
- name: z35.string(),
4952
- description: z35.string().optional(),
5091
+ revision: z36.number(),
5092
+ name: z36.string(),
5093
+ description: z36.string().optional(),
4953
5094
  /** Always present: the storage schema defaults it to `false`, so a definition is created
4954
5095
  * PAUSED and enabling it is a separate, baseline-establishing act. */
4955
- enabled: z35.boolean(),
5096
+ enabled: z36.boolean(),
4956
5097
  kind: automationKindSchema,
4957
5098
  /** `github` kind: always present. `schedule` kind: absent. */
4958
- events: z35.array(automationEventSchema).optional(),
4959
- intervalSeconds: z35.number().optional(),
5099
+ events: z36.array(automationEventSchema).optional(),
5100
+ intervalSeconds: z36.number().optional(),
4960
5101
  filters: automationFiltersSchema.optional(),
4961
5102
  /** `schedule` kind: always present. `github` kind: absent. */
4962
5103
  schedule: automationScheduleSchema.optional(),
4963
5104
  task: automationTaskSchema,
4964
5105
  /** `once` schedules only: present once its task exists or it was cancelled. */
4965
5106
  archived: automationArchiveSchema.optional(),
4966
- createdAt: z35.string(),
4967
- updatedAt: z35.string()
4968
- });
4969
- var automationCursorSchema = z35.object({
4970
- timestamp: z35.string(),
4971
- tieBreaker: z35.string().optional()
4972
- });
4973
- var automationHistoryScanSchema = z35.object({
4974
- since: z35.string().datetime(),
4975
- until: z35.string().datetime(),
4976
- source: z35.number().int().min(0).max(2),
4977
- page: z35.number().int().min(1).max(10),
4978
- item: z35.number().int().min(0).max(100),
5107
+ createdAt: z36.string(),
5108
+ updatedAt: z36.string()
5109
+ });
5110
+ var automationCursorSchema = z36.object({
5111
+ timestamp: z36.string(),
5112
+ tieBreaker: z36.string().optional()
5113
+ });
5114
+ var automationHistoryScanSchema = z36.object({
5115
+ since: z36.string().datetime(),
5116
+ until: z36.string().datetime(),
5117
+ source: z36.number().int().min(0).max(2),
5118
+ page: z36.number().int().min(1).max(10),
5119
+ item: z36.number().int().min(0).max(100),
4979
5120
  // One item can contain ten pages of 100 timeline entries, independent of the new-work cap.
4980
- event: z35.number().int().min(0).max(1e3),
5121
+ event: z36.number().int().min(0).max(1e3),
4981
5122
  cursor: automationCursorSchema.optional()
4982
5123
  });
4983
5124
  var AUTOMATION_LAST_ERROR_MAX = 1e3;
4984
5125
  var automationLastErrorShape = {
4985
- lastError: z35.string().max(AUTOMATION_LAST_ERROR_MAX).optional(),
4986
- lastErrorAt: z35.string().datetime().optional()
5126
+ lastError: z36.string().max(AUTOMATION_LAST_ERROR_MAX).optional(),
5127
+ lastErrorAt: z36.string().datetime().optional()
4987
5128
  };
4988
- var automationRuntimeStateSchema = z35.object({
5129
+ var automationRuntimeStateSchema = z36.object({
4989
5130
  /** The definition revision this state belongs to; activation or history-policy changes re-arm. */
4990
- revision: z35.number().optional(),
5131
+ revision: z36.number().optional(),
4991
5132
  /** Earliest eligible event: enablement time, or the lookback start when includeExisting is on. */
4992
- baselineAt: z35.string().optional(),
5133
+ baselineAt: z36.string().optional(),
4993
5134
  /** When discovery was armed, independent of the historical baseline. */
4994
- armedAt: z35.string().optional(),
5135
+ armedAt: z36.string().optional(),
4995
5136
  historyScan: automationHistoryScanSchema.optional(),
4996
5137
  cursor: automationCursorSchema.optional(),
4997
- frozenHighWatermark: automationCursorSchema.extend({ tieBreaker: z35.string() }).optional(),
4998
- backlogAfter: automationCursorSchema.extend({ tieBreaker: z35.string() }).optional(),
4999
- nextCheckAt: z35.string().optional(),
5000
- lastSuccessAt: z35.string().optional(),
5138
+ frozenHighWatermark: automationCursorSchema.extend({ tieBreaker: z36.string() }).optional(),
5139
+ backlogAfter: automationCursorSchema.extend({ tieBreaker: z36.string() }).optional(),
5140
+ nextCheckAt: z36.string().optional(),
5141
+ lastSuccessAt: z36.string().optional(),
5001
5142
  /** `schedule` kind: the next occurrence's instant and the last fired one's. */
5002
- nextRunAt: z35.string().optional(),
5003
- lastRunAt: z35.string().optional(),
5143
+ nextRunAt: z36.string().optional(),
5144
+ lastRunAt: z36.string().optional(),
5004
5145
  /** Per-query GitHub ETags, so an unchanged page costs no rate-limit budget. */
5005
- etags: z35.record(z35.string(), z35.string()).optional(),
5006
- backoffUntil: z35.string().optional(),
5007
- consecutiveFailures: z35.number().optional(),
5146
+ etags: z36.record(z36.string(), z36.string()).optional(),
5147
+ backoffUntil: z36.string().optional(),
5148
+ consecutiveFailures: z36.number().optional(),
5008
5149
  ...automationLastErrorShape,
5009
5150
  /** `once` schedules: why it stopped without a task — its launch failed, or it started past its cutoff. */
5010
- onceOutcome: z35.enum(["failed", "missed"]).optional()
5151
+ onceOutcome: z36.enum(["failed", "missed"]).optional()
5011
5152
  });
5012
5153
  var AUTOMATION_FAILURE_NOTICE_AFTER = 3;
5013
5154
  function automationFailureNotice(state) {
@@ -5020,7 +5161,7 @@ function automationFailureNotice(state) {
5020
5161
  ...state.backoffUntil ? { retryAt: state.backoffUntil } : {}
5021
5162
  };
5022
5163
  }
5023
- var automationLogResultSchema = z35.enum([
5164
+ var automationLogResultSchema = z36.enum([
5024
5165
  "launched",
5025
5166
  "no-match",
5026
5167
  "duplicate",
@@ -5036,36 +5177,36 @@ var automationLogResultSchema = z35.enum([
5036
5177
  // once schedule: Squawk started after its latest start, so nothing launched.
5037
5178
  "missed"
5038
5179
  ]);
5039
- var automationLogRecordSchema = z35.object({
5040
- seq: z35.number(),
5041
- ts: z35.string(),
5042
- automationId: z35.string(),
5043
- revision: z35.number(),
5180
+ var automationLogRecordSchema = z36.object({
5181
+ seq: z36.number(),
5182
+ ts: z36.string(),
5183
+ automationId: z36.string(),
5184
+ revision: z36.number(),
5044
5185
  event: automationEventSchema.optional(),
5045
5186
  result: automationLogResultSchema,
5046
- reason: z35.string().optional(),
5047
- durationMs: z35.number().optional(),
5048
- receiptId: z35.string().optional(),
5049
- runId: z35.string().optional(),
5050
- githubNumber: z35.number().optional(),
5051
- githubTitle: z35.string().optional(),
5052
- githubUrl: z35.string().optional(),
5053
- rateLimit: z35.object({
5054
- bucket: z35.enum(["core", "search"]),
5055
- remaining: z35.number().optional(),
5056
- resetAt: z35.string().optional()
5187
+ reason: z36.string().optional(),
5188
+ durationMs: z36.number().optional(),
5189
+ receiptId: z36.string().optional(),
5190
+ runId: z36.string().optional(),
5191
+ githubNumber: z36.number().optional(),
5192
+ githubTitle: z36.string().optional(),
5193
+ githubUrl: z36.string().optional(),
5194
+ rateLimit: z36.object({
5195
+ bucket: z36.enum(["core", "search"]),
5196
+ remaining: z36.number().optional(),
5197
+ resetAt: z36.string().optional()
5057
5198
  }).optional()
5058
5199
  });
5059
- var automationCountsSchema = z35.object({
5200
+ var automationCountsSchema = z36.object({
5060
5201
  /** GitHub candidates that matched a filter: `launched` + `duplicate` rows. */
5061
- matches: z35.number(),
5202
+ matches: z36.number(),
5062
5203
  /** Stored tasks with this automation's provenance, including each variant, finished and archived
5063
5204
  * tasks, across all revisions. Independent of log/receipt retention; deleting a task removes it. */
5064
- launched: z35.number(),
5205
+ launched: z36.number(),
5065
5206
  /** `duplicate` rows: a match whose receipt already existed, so nothing launched. */
5066
- duplicates: z35.number(),
5207
+ duplicates: z36.number(),
5067
5208
  /** `error` and `rate-limited` rows, plus a schedule's `failed` launches. */
5068
- errors: z35.number()
5209
+ errors: z36.number()
5069
5210
  });
5070
5211
  var automationListEntrySchema = automationDefinitionSchema.extend({
5071
5212
  state: automationRuntimeStateSchema.optional(),
@@ -5073,74 +5214,74 @@ var automationListEntrySchema = automationDefinitionSchema.extend({
5073
5214
  counts: automationCountsSchema,
5074
5215
  /** Enabled only: a schedule's armed `state.nextRunAt`, a poll's `state.nextCheckAt`. Absent
5075
5216
  * while paused, and for a schedule the timer has not armed yet. */
5076
- nextRunAt: z35.string().optional(),
5217
+ nextRunAt: z36.string().optional(),
5077
5218
  /** `once` schedules only. */
5078
5219
  onceStatus: onceStatusSchema.optional()
5079
5220
  });
5080
- var automationsResponseSchema = z35.object({
5081
- available: z35.boolean(),
5082
- reason: z35.string().optional(),
5083
- timeZone: z35.string(),
5084
- scheduler: z35.object({
5085
- state: z35.enum(["scheduled", "idle"]),
5086
- nextDue: z35.string().optional()
5221
+ var automationsResponseSchema = z36.object({
5222
+ available: z36.boolean(),
5223
+ reason: z36.string().optional(),
5224
+ timeZone: z36.string(),
5225
+ scheduler: z36.object({
5226
+ state: z36.enum(["scheduled", "idle"]),
5227
+ nextDue: z36.string().optional()
5087
5228
  }),
5088
- automations: z35.array(automationListEntrySchema)
5229
+ automations: z36.array(automationListEntrySchema)
5089
5230
  });
5090
- var automationResponseSchema = z35.object({ automation: automationDefinitionSchema });
5231
+ var automationResponseSchema = z36.object({ automation: automationDefinitionSchema });
5091
5232
  var automationCreateResponseSchema = automationResponseSchema.extend({
5092
- once: z35.object({ dueAt: z35.string(), timeZone: z35.string(), resolvedInstant: z35.string(), note: z35.string() }).optional()
5233
+ once: z36.object({ dueAt: z36.string(), timeZone: z36.string(), resolvedInstant: z36.string(), note: z36.string() }).optional()
5093
5234
  });
5094
- var automationDetailResponseSchema = z35.object({
5235
+ var automationDetailResponseSchema = z36.object({
5095
5236
  automation: automationDefinitionSchema,
5096
5237
  state: automationRuntimeStateSchema.optional(),
5097
5238
  latestLog: automationLogRecordSchema.optional(),
5098
5239
  /** `once` schedules only. */
5099
5240
  onceStatus: onceStatusSchema.optional()
5100
5241
  });
5101
- var automationCheckSchema = z35.object({
5102
- id: z35.string(),
5103
- automationId: z35.string(),
5104
- mode: z35.enum(["preview", "execute"]),
5105
- status: z35.enum(["queued", "running", "complete", "error"]),
5106
- createdAt: z35.string(),
5107
- completedAt: z35.string().optional(),
5108
- matches: z35.number().optional(),
5109
- truncated: z35.boolean().optional(),
5110
- error: z35.string().optional()
5111
- });
5112
- var automationCheckQueuedResponseSchema = z35.object({ checkId: z35.string() });
5113
- var automationLogResponseSchema = z35.object({
5114
- records: z35.array(automationLogRecordSchema)
5115
- });
5116
- var automationRetryResponseSchema = z35.object({
5117
- receiptId: z35.string(),
5118
- runId: z35.string()
5119
- });
5120
- var automationRunResponseSchema = z35.object({ runId: z35.string() });
5242
+ var automationCheckSchema = z36.object({
5243
+ id: z36.string(),
5244
+ automationId: z36.string(),
5245
+ mode: z36.enum(["preview", "execute"]),
5246
+ status: z36.enum(["queued", "running", "complete", "error"]),
5247
+ createdAt: z36.string(),
5248
+ completedAt: z36.string().optional(),
5249
+ matches: z36.number().optional(),
5250
+ truncated: z36.boolean().optional(),
5251
+ error: z36.string().optional()
5252
+ });
5253
+ var automationCheckQueuedResponseSchema = z36.object({ checkId: z36.string() });
5254
+ var automationLogResponseSchema = z36.object({
5255
+ records: z36.array(automationLogRecordSchema)
5256
+ });
5257
+ var automationRetryResponseSchema = z36.object({
5258
+ receiptId: z36.string(),
5259
+ runId: z36.string()
5260
+ });
5261
+ var automationRunResponseSchema = z36.object({ runId: z36.string() });
5121
5262
  var createAutomationInputSchema = automationDefinitionSchema.omit({ id: true, revision: true, createdAt: true, updatedAt: true, enabled: true, kind: true, archived: true }).extend({
5122
5263
  /** Omitted = `github` on create, the shape every pre-schedule client sends; omitted on
5123
5264
  * update = the stored kind. */
5124
5265
  kind: automationKindSchema.optional(),
5125
5266
  task: automationTaskSchema.omit({ variants: true }).strict(),
5126
- enable: z35.boolean().optional()
5267
+ enable: z36.boolean().optional()
5127
5268
  });
5128
5269
  var updateAutomationInputSchema = createAutomationInputSchema.omit({ enable: true }).extend({
5129
- enabled: z35.boolean().optional(),
5130
- expectedRevision: z35.number()
5270
+ enabled: z36.boolean().optional(),
5271
+ expectedRevision: z36.number()
5131
5272
  });
5132
- var automationListQuerySchema = z35.object({
5133
- archived: z35.enum(["include", "only"]).optional()
5273
+ var automationListQuerySchema = z36.object({
5274
+ archived: z36.enum(["include", "only"]).optional()
5134
5275
  });
5135
- var automationCheckInputSchema = z35.object({
5136
- mode: z35.enum(["preview", "execute"])
5276
+ var automationCheckInputSchema = z36.object({
5277
+ mode: z36.enum(["preview", "execute"])
5137
5278
  });
5138
5279
 
5139
5280
  // ../contract/src/scheduled-tasks.ts
5140
- import { z as z36 } from "zod";
5281
+ import { z as z37 } from "zod";
5141
5282
  var SCHEDULED_TASK_LIMITS = { prompt: 1e5, list: 50, wireBytes: 1048576 };
5142
5283
  var DURATION = /^(\d+)\s*([mhd])$/;
5143
- var durationField = z36.string().regex(DURATION, "a duration such as 30m, 6h or 7d");
5284
+ var durationField = z37.string().regex(DURATION, "a duration such as 30m, 6h or 7d");
5144
5285
  function parseDurationMinutes(value) {
5145
5286
  const match = DURATION.exec(value.trim());
5146
5287
  if (!match) throw new Error(`"${value}" is not a duration; use 30m, 6h or 7d`);
@@ -5164,309 +5305,208 @@ function wallTimeAtOrAfter(targetMs, timeZone) {
5164
5305
  var UTC_MINUTE_PATTERN = /^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2})Z$/;
5165
5306
  var utcMinute = (instantMs) => `${new Date(instantMs).toISOString().slice(0, 16)}Z`;
5166
5307
  var scheduleFields = {
5167
- at: z36.string().regex(UTC_MINUTE_PATTERN, "a UTC time YYYY-MM-DDTHH:MMZ").refine((value) => isRealOnceAt(value.slice(0, -1)), "not a real date and time").optional(),
5308
+ at: z37.string().regex(UTC_MINUTE_PATTERN, "a UTC time YYYY-MM-DDTHH:MMZ").refine((value) => isRealOnceAt(value.slice(0, -1)), "not a real date and time").optional(),
5168
5309
  delay: durationField.optional(),
5169
5310
  latest_start: durationField.optional(),
5170
- workflow: z36.string().trim().min(1).max(200).optional(),
5171
- runner: z36.string().trim().min(1).max(32).optional(),
5172
- model: z36.string().trim().min(1).max(200).optional(),
5173
- effort: z36.string().trim().min(1).max(32).optional(),
5311
+ workflow: z37.string().trim().min(1).max(200).optional(),
5312
+ runner: z37.string().trim().min(1).max(32).optional(),
5313
+ model: z37.string().trim().min(1).max(200).optional(),
5314
+ effort: z37.string().trim().min(1).max(32).optional(),
5174
5315
  /** `false` lets the task ask the user (`cezar_ask`) and wait for the answer. A create defaults to `true`. */
5175
- autonomous: z36.boolean().optional()
5316
+ autonomous: z37.boolean().optional()
5176
5317
  };
5177
5318
  var notBoth = (value) => !(value.at && value.delay);
5178
- var scheduleTaskRequestSchema = z36.object({
5179
- name: z36.string().trim().min(1).max(200),
5180
- prompt: z36.string().min(1).max(SCHEDULED_TASK_LIMITS.prompt),
5319
+ var scheduleTaskRequestSchema = z37.object({
5320
+ name: z37.string().trim().min(1).max(200),
5321
+ prompt: z37.string().min(1).max(SCHEDULED_TASK_LIMITS.prompt),
5181
5322
  ...scheduleFields,
5182
- enable: z36.boolean().optional()
5323
+ enable: z37.boolean().optional()
5183
5324
  }).strict().refine(notBoth, { message: "give at or delay, not both", path: ["delay"] }).refine((value) => Boolean(value.at || value.delay), { message: "give at or delay", path: ["at"] });
5184
- var idField = z36.string().min(1).max(100);
5185
- var scheduledTasksRequestSchema = z36.discriminatedUnion("action", [
5186
- z36.object({ action: z36.literal("list"), archived: z36.enum(["include", "only"]).optional() }).strict(),
5187
- z36.object({ action: z36.literal("show"), id: idField }).strict(),
5188
- z36.object({
5189
- action: z36.literal("update"),
5325
+ var idField = z37.string().min(1).max(100);
5326
+ var scheduledTasksRequestSchema = z37.discriminatedUnion("action", [
5327
+ z37.object({ action: z37.literal("list"), archived: z37.enum(["include", "only"]).optional() }).strict(),
5328
+ z37.object({ action: z37.literal("show"), id: idField }).strict(),
5329
+ z37.object({
5330
+ action: z37.literal("update"),
5190
5331
  id: idField,
5191
- name: z36.string().trim().min(1).max(200).optional(),
5192
- prompt: z36.string().min(1).max(SCHEDULED_TASK_LIMITS.prompt).optional(),
5332
+ name: z37.string().trim().min(1).max(200).optional(),
5333
+ prompt: z37.string().min(1).max(SCHEDULED_TASK_LIMITS.prompt).optional(),
5193
5334
  ...scheduleFields
5194
5335
  }).strict().refine(notBoth, { message: "give at or delay, not both", path: ["delay"] }),
5195
- z36.object({ action: z36.literal("pause"), id: idField }).strict(),
5196
- z36.object({ action: z36.literal("enable"), id: idField }).strict(),
5197
- z36.object({ action: z36.literal("cancel"), id: idField }).strict()
5336
+ z37.object({ action: z37.literal("pause"), id: idField }).strict(),
5337
+ z37.object({ action: z37.literal("enable"), id: idField }).strict(),
5338
+ z37.object({ action: z37.literal("cancel"), id: idField }).strict()
5198
5339
  ]);
5199
- var scheduledTaskSchema = z36.object({
5200
- id: z36.string(),
5201
- name: z36.string(),
5340
+ var scheduledTaskSchema = z37.object({
5341
+ id: z37.string(),
5342
+ name: z37.string(),
5202
5343
  status: onceStatusSchema,
5203
5344
  /** When it is due, in UTC: `YYYY-MM-DDTHH:MMZ`, the form `at` takes. */
5204
- due_at: z36.string(),
5205
- latest_start_minutes: z36.number().optional(),
5345
+ due_at: z37.string(),
5346
+ latest_start_minutes: z37.number().optional(),
5206
5347
  /** Whether the launched task runs autonomous: it never waits for the user's answer. */
5207
- autonomous: z36.boolean(),
5348
+ autonomous: z37.boolean(),
5208
5349
  /** The task it launched, once archived with one. */
5209
- run_id: z36.string().optional(),
5350
+ run_id: z37.string().optional(),
5210
5351
  /** The cockpit page of the schedule, when the cockpit's address is known. */
5211
- url: z36.string().optional()
5352
+ url: z37.string().optional()
5212
5353
  });
5213
- var scheduledTaskRefusalCodeSchema = z36.enum(["invalid_request", "unavailable", "not_found", "conflict", "automations_off"]);
5214
- var refusal = z36.object({ ok: z36.literal(false), code: scheduledTaskRefusalCodeSchema, message: z36.string() });
5354
+ var scheduledTaskRefusalCodeSchema = z37.enum(["invalid_request", "unavailable", "not_found", "conflict", "automations_off"]);
5355
+ var refusal = z37.object({ ok: z37.literal(false), code: scheduledTaskRefusalCodeSchema, message: z37.string() });
5215
5356
  var SCHEDULED_TASK_NOTE = "The cockpit must be running at the due time, or start again before the latest start, for this task to launch.";
5216
- var scheduleTaskAnswerSchema = z36.union([
5217
- z36.object({ ok: z36.literal(true), task: scheduledTaskSchema, note: z36.string() }),
5357
+ var scheduleTaskAnswerSchema = z37.union([
5358
+ z37.object({ ok: z37.literal(true), task: scheduledTaskSchema, note: z37.string() }),
5218
5359
  refusal
5219
5360
  ]);
5220
- var scheduledTasksAnswerSchema = z36.union([
5221
- z36.object({ ok: z36.literal(true), tasks: z36.array(scheduledTaskSchema).max(SCHEDULED_TASK_LIMITS.list) }),
5222
- z36.object({ ok: z36.literal(true), task: scheduledTaskSchema }),
5361
+ var scheduledTasksAnswerSchema = z37.union([
5362
+ z37.object({ ok: z37.literal(true), tasks: z37.array(scheduledTaskSchema).max(SCHEDULED_TASK_LIMITS.list) }),
5363
+ z37.object({ ok: z37.literal(true), task: scheduledTaskSchema }),
5223
5364
  refusal
5224
5365
  ]);
5225
5366
 
5226
5367
  // ../contract/src/wait-tools.ts
5227
- import { z as z37 } from "zod";
5228
- var pidSchema2 = z37.number().int().min(PID_MIN);
5368
+ import { z as z38 } from "zod";
5369
+ var pidSchema2 = z38.number().int().min(PID_MIN);
5229
5370
  var oneModeTakesOneId = (ids, mode, ctx) => {
5230
5371
  if (mode === "one" && ids.length !== 1) ctx.addIssue({ code: "custom", message: "one mode requires exactly one id", path: ["mode"] });
5231
5372
  };
5232
- var waitTimeoutSeconds = z37.number().int().min(1).max(PEER_WAIT_MAX_SECONDS).default(PEER_WAIT_DEFAULT_SECONDS);
5233
- var registrationFields = { operation_id: z37.uuid().optional() };
5234
- var builtInSquawkWaitRequestSchema = z37.discriminatedUnion("kind", [
5235
- ciWaitRequestSchema.extend({ kind: z37.literal("pr"), ...registrationFields }).strict(),
5236
- z37.object({
5237
- kind: z37.literal("worker"),
5373
+ var waitTimeoutSeconds = z38.number().int().min(1).max(PEER_WAIT_MAX_SECONDS).default(PEER_WAIT_DEFAULT_SECONDS);
5374
+ var registrationFields = { operation_id: z38.uuid().optional() };
5375
+ var builtInSquawkWaitRequestSchema = z38.discriminatedUnion("kind", [
5376
+ ciWaitRequestSchema.extend({ kind: z38.literal("pr"), ...registrationFields }).strict(),
5377
+ z38.object({
5378
+ kind: z38.literal("worker"),
5238
5379
  ...registrationFields,
5239
5380
  worker_ids: workerIdsSchema,
5240
5381
  mode: workerWaitModeSchema.optional(),
5241
5382
  timeout_seconds: waitTimeoutSeconds
5242
5383
  }).strict().superRefine((request, ctx) => oneModeTakesOneId(request.worker_ids, request.mode, ctx)),
5243
- z37.object({
5244
- kind: z37.literal("request"),
5384
+ z38.object({
5385
+ kind: z38.literal("request"),
5245
5386
  ...registrationFields,
5246
5387
  request_ids: workerIdsSchema,
5247
5388
  mode: workerWaitModeSchema.optional(),
5248
5389
  timeout_seconds: waitTimeoutSeconds
5249
5390
  }).strict().superRefine((request, ctx) => oneModeTakesOneId(request.request_ids, request.mode, ctx)),
5250
- z37.object({
5251
- kind: z37.literal("peer"),
5391
+ z38.object({
5392
+ kind: z38.literal("peer"),
5252
5393
  ...registrationFields,
5253
5394
  peer_ids: workerIdsSchema,
5254
5395
  timeout_seconds: waitTimeoutSeconds
5255
5396
  }).strict(),
5256
- z37.object({
5257
- kind: z37.literal("timer"),
5397
+ z38.object({
5398
+ kind: z38.literal("timer"),
5258
5399
  ...registrationFields,
5259
- seconds: z37.number().int().min(TIMER_MIN_SECONDS).max(TIMER_MAX_SECONDS),
5260
- note: z37.string().max(NOTE_MAX).optional()
5400
+ seconds: z38.number().int().min(TIMER_MIN_SECONDS).max(TIMER_MAX_SECONDS),
5401
+ note: z38.string().max(NOTE_MAX).optional()
5261
5402
  }).strict(),
5262
- z37.object({
5263
- kind: z37.literal("process"),
5403
+ z38.object({
5404
+ kind: z38.literal("process"),
5264
5405
  ...registrationFields,
5265
5406
  pid: pidSchema2,
5266
- exit_file: z37.string().min(1).max(PROCESS_EXIT_FILE_MAX).optional(),
5267
- timeout_seconds: z37.number().int().min(1).max(PROCESS_TIMEOUT_MAX_SECONDS).default(PROCESS_TIMEOUT_DEFAULT_SECONDS),
5268
- note: z37.string().max(NOTE_MAX).optional()
5407
+ exit_file: z38.string().min(1).max(PROCESS_EXIT_FILE_MAX).optional(),
5408
+ timeout_seconds: z38.number().int().min(1).max(PROCESS_TIMEOUT_MAX_SECONDS).default(PROCESS_TIMEOUT_DEFAULT_SECONDS),
5409
+ note: z38.string().max(NOTE_MAX).optional()
5269
5410
  }).strict()
5270
5411
  ]);
5271
5412
  var builtInRequestKinds = /* @__PURE__ */ new Set(["pr", "worker", "request", "peer", "timer", "process"]);
5272
- var pluginWaitRequestSchema = z37.object({
5273
- kind: z37.string().min(1).max(64),
5413
+ var pluginWaitRequestSchema = z38.object({
5414
+ kind: z38.string().min(1).max(64),
5274
5415
  ...registrationFields
5275
- }).catchall(z37.unknown()).refine((request) => !builtInRequestKinds.has(request.kind), { path: ["kind"], message: "built-in wait kinds require their built-in request shape" });
5276
- var waitRequestInputSchema = z37.union([builtInSquawkWaitRequestSchema, pluginWaitRequestSchema]);
5277
- var squawkWaitRequestSchema = z37.custom().transform((request, ctx) => {
5416
+ }).catchall(z38.unknown()).refine((request) => !builtInRequestKinds.has(request.kind), { path: ["kind"], message: "built-in wait kinds require their built-in request shape" });
5417
+ var waitRequestInputSchema = z38.union([builtInSquawkWaitRequestSchema, pluginWaitRequestSchema]);
5418
+ var squawkWaitRequestSchema = z38.custom().transform((request, ctx) => {
5278
5419
  const kind = request && typeof request === "object" && "kind" in request ? request.kind : void 0;
5279
5420
  const schema = typeof kind === "string" && builtInRequestKinds.has(kind) ? builtInSquawkWaitRequestSchema : pluginWaitRequestSchema;
5280
5421
  const parsed = schema.safeParse(request);
5281
5422
  if (!parsed.success) {
5282
5423
  for (const issue of parsed.error.issues) ctx.addIssue({ ...issue });
5283
- return z37.NEVER;
5424
+ return z38.NEVER;
5284
5425
  }
5285
5426
  return parsed.data;
5286
5427
  });
5287
- var squawkCancelWaitRequestSchema = z37.object({ wait_id: z37.uuid() }).strict();
5288
- var message = z37.string().max(WAIT_MESSAGE_MAX);
5428
+ var squawkCancelWaitRequestSchema = z38.object({ wait_id: z38.uuid() }).strict();
5429
+ var message = z38.string().max(WAIT_MESSAGE_MAX);
5289
5430
  var registrationAnswerFields = {
5290
- operation_id: z37.uuid().optional()
5431
+ operation_id: z38.uuid().optional()
5291
5432
  };
5292
- var squawkWaitAnswerSchema = z37.discriminatedUnion("ok", [
5293
- z37.object({
5294
- ok: z37.literal(true),
5433
+ var squawkWaitAnswerSchema = z38.discriminatedUnion("ok", [
5434
+ z38.object({
5435
+ ok: z38.literal(true),
5295
5436
  ...registrationAnswerFields,
5296
- effect: z37.enum(["applied", "unchanged"]).optional(),
5297
- deduplicated: z37.boolean().optional(),
5298
- replayed: z37.boolean().optional(),
5299
- wait_phase: z37.enum([...waitPhaseSchema.options, "unavailable"]).optional(),
5300
- wait_id: z37.uuid(),
5437
+ effect: z38.enum(["applied", "unchanged"]).optional(),
5438
+ deduplicated: z38.boolean().optional(),
5439
+ replayed: z38.boolean().optional(),
5440
+ wait_phase: z38.enum([...waitPhaseSchema.options, "unavailable"]).optional(),
5441
+ wait_id: z38.uuid(),
5301
5442
  /** The kind the call asked for: a `request` wait is stored as a `worker` entry. */
5302
- kind: z37.string().min(1).max(64),
5303
- deadline: z37.iso.datetime().optional(),
5304
- open_waits: z37.array(openWaitSchema).max(WAIT_LIMIT)
5443
+ kind: z38.string().min(1).max(64),
5444
+ deadline: z38.iso.datetime().optional(),
5445
+ open_waits: z38.array(openWaitSchema).max(WAIT_LIMIT)
5305
5446
  }).strict().superRefine((answer, ctx) => {
5306
5447
  if (builtInRequestKinds.has(answer.kind) && answer.deadline === void 0) {
5307
5448
  ctx.addIssue({ code: "invalid_type", expected: "string", path: ["deadline"], message: "Invalid input: expected string, received undefined" });
5308
5449
  }
5309
5450
  }),
5310
- z37.object({
5311
- ok: z37.literal(false),
5451
+ z38.object({
5452
+ ok: z38.literal(false),
5312
5453
  ...registrationAnswerFields,
5313
- effect: z37.enum(["refused", "unknown"]).optional(),
5454
+ effect: z38.enum(["refused", "unknown"]).optional(),
5314
5455
  retained_wait: openWaitSchema.optional(),
5315
5456
  code: waitErrorCodeSchema,
5316
5457
  message,
5317
- open_waits: z37.array(openWaitSchema).max(WAIT_LIMIT).optional()
5458
+ open_waits: z38.array(openWaitSchema).max(WAIT_LIMIT).optional()
5318
5459
  }).strict()
5319
5460
  ]);
5320
5461
  var squawkAskRequestSchema = askRequestSchema.extend({ context: askContextSchema });
5321
- var squawkAskAnswerSchema = z37.discriminatedUnion("ok", [
5322
- z37.object({ ok: z37.literal(true), wait_id: z37.uuid(), open_waits: z37.array(openWaitSchema).max(WAIT_LIMIT) }).strict(),
5323
- z37.object({
5324
- ok: z37.literal(false),
5462
+ var squawkAskAnswerSchema = z38.discriminatedUnion("ok", [
5463
+ z38.object({ ok: z38.literal(true), wait_id: z38.uuid(), open_waits: z38.array(openWaitSchema).max(WAIT_LIMIT) }).strict(),
5464
+ z38.object({
5465
+ ok: z38.literal(false),
5325
5466
  code: askErrorCodeSchema,
5326
5467
  message,
5327
- open_waits: z37.array(openWaitSchema).max(WAIT_LIMIT).optional()
5468
+ open_waits: z38.array(openWaitSchema).max(WAIT_LIMIT).optional()
5328
5469
  }).strict()
5329
5470
  ]);
5330
- var squawkCancelWaitAnswerSchema = z37.discriminatedUnion("cancelled", [
5331
- z37.object({
5332
- cancelled: z37.literal(true),
5333
- wait_id: z37.uuid(),
5334
- open_waits: z37.array(openWaitSchema).max(WAIT_LIMIT)
5471
+ var squawkCancelWaitAnswerSchema = z38.discriminatedUnion("cancelled", [
5472
+ z38.object({
5473
+ cancelled: z38.literal(true),
5474
+ wait_id: z38.uuid(),
5475
+ open_waits: z38.array(openWaitSchema).max(WAIT_LIMIT)
5335
5476
  }).strict(),
5336
- z37.object({
5337
- cancelled: z37.literal(false),
5338
- code: z37.enum(["not_found", "already_resolved", "human_question", "invalid_request", "unavailable"]),
5477
+ z38.object({
5478
+ cancelled: z38.literal(false),
5479
+ code: z38.enum(["not_found", "already_resolved", "human_question", "invalid_request", "unavailable"]),
5339
5480
  message,
5340
- open_waits: z37.array(openWaitSchema).max(WAIT_LIMIT).optional()
5481
+ open_waits: z38.array(openWaitSchema).max(WAIT_LIMIT).optional()
5341
5482
  }).strict()
5342
5483
  ]);
5343
- var squawkDoneRequestSchema = z37.object({ summary: z37.string().max(2e3).optional() }).strict();
5484
+ var squawkDoneRequestSchema = z38.object({ summary: z38.string().max(2e3).optional() }).strict();
5344
5485
  var doneAccepted = {
5345
- ok: z37.literal(true),
5346
- finishes: z37.literal("at_turn_end"),
5347
- open_waits: z37.array(openWaitSchema).max(WAIT_LIMIT)
5486
+ ok: z38.literal(true),
5487
+ finishes: z38.literal("at_turn_end"),
5488
+ open_waits: z38.array(openWaitSchema).max(WAIT_LIMIT)
5348
5489
  };
5349
- var squawkDoneAnswerSchema = z37.discriminatedUnion("ok", [
5350
- z37.discriminatedUnion("completes", [
5351
- z37.object({ ...doneAccepted, completes: z37.literal("task") }).strict(),
5352
- z37.object({ ...doneAccepted, completes: z37.literal("step"), next_step: z37.string().min(1) }).strict()
5490
+ var squawkDoneAnswerSchema = z38.discriminatedUnion("ok", [
5491
+ z38.discriminatedUnion("completes", [
5492
+ z38.object({ ...doneAccepted, completes: z38.literal("task") }).strict(),
5493
+ z38.object({ ...doneAccepted, completes: z38.literal("step"), next_step: z38.string().min(1) }).strict()
5353
5494
  ]),
5354
- z37.object({
5355
- ok: z37.literal(false),
5495
+ z38.object({
5496
+ ok: z38.literal(false),
5356
5497
  code: doneErrorCodeSchema,
5357
5498
  message,
5358
5499
  /** The workers that block the finish, and why each one does. */
5359
- workers: z37.array(z37.object({
5360
- worker_id: z37.string(),
5361
- reason: z37.enum(["outstanding", "uncollected", "question"])
5500
+ workers: z38.array(z38.object({
5501
+ worker_id: z38.string(),
5502
+ reason: z38.enum(["outstanding", "uncollected", "question"])
5362
5503
  }).strict()).max(64).optional(),
5363
- open_waits: z37.array(openWaitSchema).max(WAIT_LIMIT).optional(),
5504
+ open_waits: z38.array(openWaitSchema).max(WAIT_LIMIT).optional(),
5364
5505
  /** `input_pending` (hearsay-tools/squawk#2587): what the run still owes the agent. */
5365
- owed: z37.array(doneOwedInputSchema).max(64).optional()
5506
+ owed: z38.array(doneOwedInputSchema).max(64).optional()
5366
5507
  }).strict()
5367
5508
  ]);
5368
5509
 
5369
- // ../contract/src/run-predicates.ts
5370
- function latestSessionStep(steps, except) {
5371
- let latest;
5372
- for (const step of steps) {
5373
- if (!step.sessionId || step.id === except) continue;
5374
- if (!latest || !step.startedAt || !latest.startedAt || step.startedAt >= latest.startedAt) latest = step;
5375
- }
5376
- return latest;
5377
- }
5378
- function sessionRunner(step, run) {
5379
- return step?.backend ?? run?.runner ?? "claude";
5380
- }
5381
- function removedRunnerStepAfter(steps, sessionId) {
5382
- let latest;
5383
- for (const step of steps) {
5384
- if (step.removedBackend === void 0 && (sessionId === void 0 || step.sessionId !== sessionId)) continue;
5385
- if (!latest || !step.startedAt || !latest.startedAt || step.startedAt >= latest.startedAt) latest = step;
5386
- }
5387
- return latest?.removedBackend !== void 0 ? latest : void 0;
5388
- }
5389
- function latestSession(run) {
5390
- const latest = latestSessionStep(run.steps);
5391
- const step = removedRunnerStepAfter(run.steps, latest?.sessionId) ? void 0 : latest;
5392
- return { sessionId: step?.sessionId, backend: sessionRunner(step, run), profileId: step?.profileId };
5393
- }
5394
- function isAgentWorkflowStep(step) {
5395
- return step.command === void 0 && step.kind !== "plugin";
5396
- }
5397
- function workerContinuationStepId(run) {
5398
- const cursorId = run.workflowCursor?.mode === "resume" ? run.workflowCursor.stepId : void 0;
5399
- if (cursorId && run.steps.find((step) => step.id === cursorId)?.status === "failed") return cursorId;
5400
- const session = latestSessionStep(run.steps);
5401
- if (!session) return void 0;
5402
- if (session.synthetic === "continuation" && session.continuesStepId !== void 0) return session.continuesStepId;
5403
- return run.steps.find((step) => step.sessionId === session.sessionId)?.id ?? session.id;
5404
- }
5405
- function workerContinuationStep(run, untouched = false) {
5406
- if (run.delegation?.role !== "worker") return void 0;
5407
- const steps = run.workflowDef?.steps;
5408
- if (!steps?.length) return void 0;
5409
- if (untouched) return steps.find(isAgentWorkflowStep);
5410
- const targetId = workerContinuationStepId(run);
5411
- const targeted = targetId ? steps.find((step) => step.id === targetId && isAgentWorkflowStep(step)) : void 0;
5412
- return targeted ?? [...steps].reverse().find(isAgentWorkflowStep);
5413
- }
5414
- var LIVE_STATUSES = /* @__PURE__ */ new Set(["queued", "running", "waiting"]);
5415
- function isLiveStatus(status) {
5416
- return LIVE_STATUSES.has(status);
5417
- }
5418
- function engineOwnsRun(run) {
5419
- if (isUsageLimitHold(run)) return false;
5420
- return run.status === "queued" || run.status === "running" || run.status === "waiting";
5421
- }
5422
- function isSessionOpen(run) {
5423
- return engineOwnsRun(run) && run.status !== "queued";
5424
- }
5425
- function isSweepable(run, scope, automation) {
5426
- if (run.archived || !(run.status === "done" || run.status === "failed" || run.status === "cancelled")) return false;
5427
- if (run.delegation?.role === "worker") return false;
5428
- if (automation !== void 0 && isAutomationTask(run) !== automation) return false;
5429
- if (scope === "unpinned") return !run.pinned;
5430
- if (scope === "pinned") return run.pinned === true;
5431
- return true;
5432
- }
5433
- var UNREAD_ELIGIBLE = ["done", "failed"];
5434
- function canBeUnread(run) {
5435
- if (run.archived) return false;
5436
- if (isUsageLimitHold(run)) return false;
5437
- if (!UNREAD_ELIGIBLE.includes(run.status)) return false;
5438
- return run.finishedAt !== void 0;
5439
- }
5440
- function isUnread(run) {
5441
- const finishedAt = run.finishedAt;
5442
- if (finishedAt === void 0) return false;
5443
- if (!canBeUnread(run)) return false;
5444
- return run.seenAt === void 0 || run.seenAt < finishedAt;
5445
- }
5446
- function isRetentionCandidate(run) {
5447
- const settled = run.status === "done" || run.status === "failed" || run.status === "cancelled";
5448
- return settled && (!run.delegation || run.delegation.role === "root") && !run.pinned;
5449
- }
5450
- function hasReferencedRun(run) {
5451
- return run.referencedPullRequestUrl !== void 0 || run.referencedIssueUrl !== void 0;
5452
- }
5453
- var UNREAD_RUN_RULE = {
5454
- sql: "archived = 0 AND status IN ('done', 'failed') AND finished_at IS NOT NULL AND (json_extract(summary, '$.seenAt') IS NULL OR json_extract(summary, '$.seenAt') < finished_at)",
5455
- matches: isUnread
5456
- };
5457
- var SWEEPABLE_RUN_RULE = {
5458
- sql: "archived = 0 AND status IN ('done', 'failed', 'cancelled') AND parent_run_id IS NULL",
5459
- matches: isSweepable
5460
- };
5461
- var RETENTION_RUN_RULE = {
5462
- sql: "id IN (SELECT value FROM json_each(?)) AND status IN ('done', 'failed', 'cancelled') AND parent_run_id IS NULL AND json_extract(summary, '$.delegation.role') IS NOT 'worker' AND json_extract(summary, '$.delegation.role') IS NOT 'invalid' AND json_extract(summary, '$.pinned') IS NOT 1",
5463
- matches: isRetentionCandidate
5464
- };
5465
- var REFERENCED_RUN_RULE = {
5466
- sql: "json_extract(summary, '$.referencedPullRequestUrl') IS NOT NULL OR json_extract(summary, '$.referencedIssueUrl') IS NOT NULL",
5467
- matches: hasReferencedRun
5468
- };
5469
-
5470
5510
  // ../contract/src/run-search.ts
5471
5511
  function refNumberFromUrl(url) {
5472
5512
  const last = /\/(\d+)\/?$/.exec(url.trim());
@@ -5565,75 +5605,75 @@ function sqlPrefilterTokens(query, options = {}) {
5565
5605
  }
5566
5606
 
5567
5607
  // ../contract/src/artifacts.ts
5568
- import { z as z38 } from "zod";
5569
- var pathSchema = z38.string().min(1).max(8192).refine((value) => !value.includes("\0"), "Path contains NUL");
5570
- var publishedArtifactSchema = z38.object({
5571
- id: z38.uuid(),
5572
- runId: z38.uuid(),
5573
- name: z38.string().min(1).max(255),
5574
- title: z38.string().max(200).optional(),
5608
+ import { z as z39 } from "zod";
5609
+ var pathSchema = z39.string().min(1).max(8192).refine((value) => !value.includes("\0"), "Path contains NUL");
5610
+ var publishedArtifactSchema = z39.object({
5611
+ id: z39.uuid(),
5612
+ runId: z39.uuid(),
5613
+ name: z39.string().min(1).max(255),
5614
+ title: z39.string().max(200).optional(),
5575
5615
  sourcePath: pathSchema.refine((value) => /^(?:\/|[A-Za-z]:[\\/]|\\\\)/.test(value), "Expected an absolute source path"),
5576
- createdAt: z38.iso.datetime(),
5577
- size: z38.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
5578
- sha256: z38.string().regex(/^[a-f0-9]{64}$/)
5616
+ createdAt: z39.iso.datetime(),
5617
+ size: z39.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
5618
+ sha256: z39.string().regex(/^[a-f0-9]{64}$/)
5579
5619
  }).strict();
5580
- var filePreviewDataSchema = z38.object({
5581
- type: z38.literal("file"),
5620
+ var filePreviewDataSchema = z39.object({
5621
+ type: z39.literal("file"),
5582
5622
  path: pathSchema,
5583
- size: z38.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
5584
- binary: z38.boolean(),
5585
- tooLarge: z38.boolean(),
5586
- content: z38.string().optional(),
5587
- source: z38.enum(["worktree", "project", "artifact"]),
5623
+ size: z39.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
5624
+ binary: z39.boolean(),
5625
+ tooLarge: z39.boolean(),
5626
+ content: z39.string().optional(),
5627
+ source: z39.enum(["worktree", "project", "artifact"]),
5588
5628
  artifact: publishedArtifactSchema.optional()
5589
5629
  }).strict();
5590
- var fileLinkResultSchema = z38.union([
5630
+ var fileLinkResultSchema = z39.union([
5591
5631
  filePreviewDataSchema,
5592
- z38.object({
5593
- type: z38.enum(["unavailable", "unpublished"]),
5632
+ z39.object({
5633
+ type: z39.enum(["unavailable", "unpublished"]),
5594
5634
  path: pathSchema,
5595
- reason: z38.string().min(1).max(4096)
5635
+ reason: z39.string().min(1).max(4096)
5596
5636
  }).strict()
5597
5637
  ]);
5598
- var artifactMetadataResponseSchema = z38.object({ artifact: publishedArtifactSchema }).strict();
5599
- var artifactListSchema = z38.object({ artifacts: z38.array(publishedArtifactSchema).max(64) }).strict();
5600
- var fileLinkQuerySchema = z38.object({ path: pathSchema, raw: z38.literal("1").optional() }).strict();
5601
- var artifactParamsSchema = z38.object({ id: z38.uuid(), artifactId: z38.uuid() });
5638
+ var artifactMetadataResponseSchema = z39.object({ artifact: publishedArtifactSchema }).strict();
5639
+ var artifactListSchema = z39.object({ artifacts: z39.array(publishedArtifactSchema).max(64) }).strict();
5640
+ var fileLinkQuerySchema = z39.object({ path: pathSchema, raw: z39.literal("1").optional() }).strict();
5641
+ var artifactParamsSchema = z39.object({ id: z39.uuid(), artifactId: z39.uuid() });
5602
5642
 
5603
5643
  // ../contract/src/discovery.ts
5604
- import { z as z39 } from "zod";
5605
- var hostDiscoveryRequestSchema = z39.discriminatedUnion("kind", [
5606
- z39.object({ kind: z39.literal("runners") }).strict(),
5607
- z39.object({ kind: z39.literal("models"), runner: modelDiscoveryRunnerSchema }).strict()
5644
+ import { z as z40 } from "zod";
5645
+ var hostDiscoveryRequestSchema = z40.discriminatedUnion("kind", [
5646
+ z40.object({ kind: z40.literal("runners") }).strict(),
5647
+ z40.object({ kind: z40.literal("models"), runner: modelDiscoveryRunnerSchema }).strict()
5608
5648
  ]);
5609
- var discoveryRequestSchema = z39.discriminatedUnion("kind", [
5649
+ var discoveryRequestSchema = z40.discriminatedUnion("kind", [
5610
5650
  ...hostDiscoveryRequestSchema.options,
5611
- z39.object({ kind: z39.literal("tasks"), all: z39.boolean().optional(), offset: z39.number().int().min(0).max(Number.MAX_SAFE_INTEGER).optional() }).strict()
5651
+ z40.object({ kind: z40.literal("tasks"), all: z40.boolean().optional(), offset: z40.number().int().min(0).max(Number.MAX_SAFE_INTEGER).optional() }).strict()
5612
5652
  ]);
5613
5653
  var discoveredRunnerSchema = providerStatusSchema.omit({ provider: true, profileId: true }).extend({ runner: modelDiscoveryRunnerSchema });
5614
- var discoveredRunnersSchema = z39.object({
5615
- scope: z39.literal("host-default-account"),
5616
- runners: z39.array(discoveredRunnerSchema)
5617
- });
5618
- var discoveredTasksSchema = z39.object({
5619
- tasks: z39.array(z39.object({
5620
- id: z39.string(),
5621
- title: z39.string(),
5654
+ var discoveredRunnersSchema = z40.object({
5655
+ scope: z40.literal("host-default-account"),
5656
+ runners: z40.array(discoveredRunnerSchema)
5657
+ });
5658
+ var discoveredTasksSchema = z40.object({
5659
+ tasks: z40.array(z40.object({
5660
+ id: z40.string(),
5661
+ title: z40.string(),
5622
5662
  runner: runnerSchema.optional(),
5623
5663
  status: runStatusSchema,
5624
- attention: z39.enum(["permission", "error", "waiting", "running", "unseen", "none"]),
5625
- attentionLabel: z39.string(),
5626
- accepts: z39.boolean(),
5627
- reason: z39.string().optional()
5664
+ attention: z40.enum(["permission", "error", "waiting", "running", "unseen", "none"]),
5665
+ attentionLabel: z40.string(),
5666
+ accepts: z40.boolean(),
5667
+ reason: z40.string().optional()
5628
5668
  })).max(32),
5629
- nextOffset: z39.number().int().nonnegative().optional(),
5669
+ nextOffset: z40.number().int().nonnegative().optional(),
5630
5670
  /** The caller's own family ledger load; no recipient inbox. */
5631
5671
  capacity: conversationCapacitySchema.optional()
5632
5672
  });
5633
- var discoveryResponseSchema = z39.union([discoveredRunnersSchema, runnerModelCatalogResponseSchema, discoveredTasksSchema]);
5673
+ var discoveryResponseSchema = z40.union([discoveredRunnersSchema, runnerModelCatalogResponseSchema, discoveredTasksSchema]);
5634
5674
 
5635
5675
  // ../contract/src/live.ts
5636
- import { z as z40 } from "zod";
5676
+ import { z as z41 } from "zod";
5637
5677
 
5638
5678
  // ../contract/src/live-limits.ts
5639
5679
  var LIVE_RUN_LIMIT = 32;
@@ -5641,46 +5681,46 @@ var LIVE_EVENT_LIMIT = 256;
5641
5681
  var LIVE_BYTE_LIMIT = 1024 * 1024;
5642
5682
 
5643
5683
  // ../contract/src/live.ts
5644
- var liveRunDemandSchema = z40.object({
5645
- projectId: z40.string().min(1).max(128).regex(/^[a-zA-Z0-9_-]+$/),
5684
+ var liveRunDemandSchema = z41.object({
5685
+ projectId: z41.string().min(1).max(128).regex(/^[a-zA-Z0-9_-]+$/),
5646
5686
  runId: runIdParamSchema.shape.id,
5647
5687
  cursor: runHistoryCursorSchema.optional(),
5648
- afterSeq: z40.number().int().nonnegative().safe()
5688
+ afterSeq: z41.number().int().nonnegative().safe()
5649
5689
  });
5650
- var liveRunsRequestSchema = z40.object({
5651
- runs: z40.array(liveRunDemandSchema).min(1).max(LIVE_RUN_LIMIT)
5690
+ var liveRunsRequestSchema = z41.object({
5691
+ runs: z41.array(liveRunDemandSchema).min(1).max(LIVE_RUN_LIMIT)
5652
5692
  }).refine(({ runs }) => new Set(runs.map((r) => `${r.projectId}/${r.runId}`)).size === runs.length, {
5653
5693
  message: "duplicate run demand"
5654
5694
  });
5655
5695
  var identity = liveRunDemandSchema.pick({ projectId: true, runId: true });
5656
5696
  var liveRunErrorSchema = identity.extend({
5657
- type: z40.enum(["error", "reset"]),
5658
- status: z40.union([z40.literal(400), z40.literal(404), z40.literal(409), z40.literal(413), z40.literal(503)]),
5659
- error: z40.string()
5697
+ type: z41.enum(["error", "reset"]),
5698
+ status: z41.union([z41.literal(400), z41.literal(404), z41.literal(409), z41.literal(413), z41.literal(503)]),
5699
+ error: z41.string()
5660
5700
  });
5661
5701
  var liveRunBatchSchema = identity.extend({
5662
- type: z40.literal("batch"),
5663
- events: z40.array(runHistoryEventSchema).max(LIVE_EVENT_LIMIT),
5664
- snapshots: z40.array(runHistoryEventSchema).max(LIVE_EVENT_LIMIT).optional(),
5702
+ type: z41.literal("batch"),
5703
+ events: z41.array(runHistoryEventSchema).max(LIVE_EVENT_LIMIT),
5704
+ snapshots: z41.array(runHistoryEventSchema).max(LIVE_EVENT_LIMIT).optional(),
5665
5705
  cursor: runHistoryCursorSchema,
5666
- afterSeq: z40.number().int().nonnegative(),
5667
- hasMore: z40.boolean()
5668
- });
5669
- var liveRunBatchResultSchema = z40.union([liveRunBatchSchema, liveRunErrorSchema]);
5670
- var liveRunBatchResponseSchema = z40.object({
5671
- generation: z40.string(),
5672
- results: z40.array(liveRunBatchResultSchema)
5673
- });
5674
- var liveRunFrameSchema = z40.union([
5675
- z40.object({ type: z40.literal("ready"), generation: z40.string() }),
5676
- z40.object({ type: z40.literal("ping") }),
5677
- identity.extend({ type: z40.literal("event"), name: z40.enum(["run-event", "ui-event"]), event: runHistoryEventSchema }),
5678
- identity.extend({ type: z40.literal("snapshot"), name: z40.literal("ui-event"), event: runHistoryEventSchema }),
5706
+ afterSeq: z41.number().int().nonnegative(),
5707
+ hasMore: z41.boolean()
5708
+ });
5709
+ var liveRunBatchResultSchema = z41.union([liveRunBatchSchema, liveRunErrorSchema]);
5710
+ var liveRunBatchResponseSchema = z41.object({
5711
+ generation: z41.string(),
5712
+ results: z41.array(liveRunBatchResultSchema)
5713
+ });
5714
+ var liveRunFrameSchema = z41.union([
5715
+ z41.object({ type: z41.literal("ready"), generation: z41.string() }),
5716
+ z41.object({ type: z41.literal("ping") }),
5717
+ identity.extend({ type: z41.literal("event"), name: z41.enum(["run-event", "ui-event"]), event: runHistoryEventSchema }),
5718
+ identity.extend({ type: z41.literal("snapshot"), name: z41.literal("ui-event"), event: runHistoryEventSchema }),
5679
5719
  liveRunErrorSchema
5680
5720
  ]);
5681
5721
 
5682
5722
  // ../contract/src/activity.ts
5683
- import { z as z41 } from "zod";
5723
+ import { z as z42 } from "zod";
5684
5724
  var ACTIVITY_RATE_SECONDS = 30;
5685
5725
  var ACTIVITY_TEXT_MAX = 500;
5686
5726
  var ACTIVITY_ERROR_MAX = 200;
@@ -5688,147 +5728,147 @@ var ACTIVITY_TOOL_TITLE_MAX = 160;
5688
5728
  var ACTIVITY_CHECKS_MAX = 100;
5689
5729
  var ACTIVITY_CHECK_NAME_MAX = 100;
5690
5730
  var ACTIVITY_CLOSED_WINDOW_MS = 3e4;
5691
- var iso = z41.iso.datetime();
5692
- var count = z41.number().int().nonnegative();
5693
- var runId = z41.string().min(1);
5731
+ var iso = z42.iso.datetime();
5732
+ var count = z42.number().int().nonnegative();
5733
+ var runId = z42.string().min(1);
5694
5734
  var ACTIVITY_TOOL_KINDS = ["read", "edit", "delete", "move", "search", "execute", "think", "fetch", "task", "plan", "other"];
5695
- var activityToolSchema = z41.object({
5696
- title: z41.string().max(ACTIVITY_TOOL_TITLE_MAX),
5697
- toolKind: z41.enum(ACTIVITY_TOOL_KINDS),
5698
- status: z41.enum(["pending", "running", "completed", "failed", "declined"]),
5735
+ var activityToolSchema = z42.object({
5736
+ title: z42.string().max(ACTIVITY_TOOL_TITLE_MAX),
5737
+ toolKind: z42.enum(ACTIVITY_TOOL_KINDS),
5738
+ status: z42.enum(["pending", "running", "completed", "failed", "declined"]),
5699
5739
  startedAt: iso,
5700
5740
  endedAt: iso.optional()
5701
5741
  }).strict();
5702
- var activityCheckBucketSchema = z41.enum(["pass", "fail", "pending", "skipping", "cancel"]);
5703
- var activityPrProgressSchema = z41.object({
5704
- checks: z41.array(z41.object({ name: z41.string().max(ACTIVITY_CHECK_NAME_MAX), bucket: activityCheckBucketSchema }).strict()).max(ACTIVITY_CHECKS_MAX),
5705
- counts: z41.object({ pass: count, fail: count, pending: count, skipping: count, cancel: count }).strict(),
5706
- truncated: z41.literal(true).optional()
5742
+ var activityCheckBucketSchema = z42.enum(["pass", "fail", "pending", "skipping", "cancel"]);
5743
+ var activityPrProgressSchema = z42.object({
5744
+ checks: z42.array(z42.object({ name: z42.string().max(ACTIVITY_CHECK_NAME_MAX), bucket: activityCheckBucketSchema }).strict()).max(ACTIVITY_CHECKS_MAX),
5745
+ counts: z42.object({ pass: count, fail: count, pending: count, skipping: count, cancel: count }).strict(),
5746
+ truncated: z42.literal(true).optional()
5707
5747
  }).strict();
5708
- var activityWaitSchema = z41.discriminatedUnion("kind", [
5709
- z41.object({
5710
- kind: z41.literal("human"),
5748
+ var activityWaitSchema = z42.discriminatedUnion("kind", [
5749
+ z42.object({
5750
+ kind: z42.literal("human"),
5711
5751
  since: iso,
5712
- detail: z41.object({
5752
+ detail: z42.object({
5713
5753
  /** The ask card's first question. */
5714
- question: z41.string().max(ACTIVITY_TEXT_MAX).optional(),
5754
+ question: z42.string().max(ACTIVITY_TEXT_MAX).optional(),
5715
5755
  /** `question`: an open question; `turn-end`: Squawk's `no-wait` wait; `budget`: the
5716
5756
  * automatic-wake budget is spent; `completion`: Squawk's completion gate. */
5717
- reason: z41.enum(["question", "turn-end", "budget", "completion"]),
5757
+ reason: z42.enum(["question", "turn-end", "budget", "completion"]),
5718
5758
  /** Inputs not delivered yet, when there are any. */
5719
- queuedMessages: z41.number().int().positive().optional()
5759
+ queuedMessages: z42.number().int().positive().optional()
5720
5760
  }).strict()
5721
5761
  }).strict(),
5722
- z41.object({ kind: z41.literal("usage-limit"), detail: z41.object({ resumeAt: z41.string() }).strict() }).strict(),
5723
- z41.object({
5724
- kind: z41.literal("workers"),
5762
+ z42.object({ kind: z42.literal("usage-limit"), detail: z42.object({ resumeAt: z42.string() }).strict() }).strict(),
5763
+ z42.object({
5764
+ kind: z42.literal("workers"),
5725
5765
  since: iso,
5726
5766
  deadline: iso.optional(),
5727
- detail: z41.object({
5767
+ detail: z42.object({
5728
5768
  /** `computeWaitingOn`'s count: the unanswered targets, summed over the entries. */
5729
5769
  owed: count,
5730
5770
  /** Targets named and targets settled, summed over the entries. */
5731
5771
  total: count,
5732
5772
  settled: count,
5733
5773
  /** Every open entry waits on request replies. */
5734
- replies: z41.literal(true).optional(),
5774
+ replies: z42.literal(true).optional(),
5735
5775
  /** Only when one entry is open. */
5736
5776
  mode: workerWaitModeSchema.optional(),
5737
5777
  /** Who owes the awaited replies, each once. */
5738
- recipientRunIds: z41.array(runId)
5778
+ recipientRunIds: z42.array(runId)
5739
5779
  }).strict()
5740
5780
  }).strict(),
5741
- z41.object({ kind: z41.literal("peers"), since: iso, deadline: iso, detail: z41.object({ peerRunIds: z41.array(runId) }).strict() }).strict(),
5742
- z41.object({ kind: z41.literal("subagents"), since: iso, deadline: iso, detail: z41.object({ running: count }).strict() }).strict(),
5743
- z41.object({
5744
- kind: z41.literal("pr"),
5781
+ z42.object({ kind: z42.literal("peers"), since: iso, deadline: iso, detail: z42.object({ peerRunIds: z42.array(runId) }).strict() }).strict(),
5782
+ z42.object({ kind: z42.literal("subagents"), since: iso, deadline: iso, detail: z42.object({ running: count }).strict() }).strict(),
5783
+ z42.object({
5784
+ kind: z42.literal("pr"),
5745
5785
  since: iso,
5746
5786
  deadline: iso,
5747
- detail: z41.object({
5748
- number: z41.number().int().positive(),
5787
+ detail: z42.object({
5788
+ number: z42.number().int().positive(),
5749
5789
  target: prWaitUntilSchema,
5750
5790
  /** Check progress, while the CI progress registry holds some for this wait. */
5751
5791
  checks: activityPrProgressSchema.shape.checks.optional(),
5752
5792
  counts: activityPrProgressSchema.shape.counts.optional(),
5753
- truncated: z41.literal(true).optional()
5793
+ truncated: z42.literal(true).optional()
5754
5794
  }).strict()
5755
5795
  }).strict(),
5756
- z41.object({ kind: z41.literal("process"), since: iso, deadline: iso, detail: z41.object({ pid: z41.number().int(), note: z41.string().optional() }).strict() }).strict(),
5757
- z41.object({ kind: z41.literal("plugin"), since: iso, deadline: iso.optional(), detail: z41.object({ pluginKind: z41.string().min(1).max(64), summary: z41.string().max(256) }).strict() }).strict(),
5758
- z41.object({ kind: z41.literal("timer"), since: iso, deadline: iso, detail: z41.object({ wakeAt: iso, note: z41.string().optional() }).strict() }).strict()
5796
+ z42.object({ kind: z42.literal("process"), since: iso, deadline: iso, detail: z42.object({ pid: z42.number().int(), note: z42.string().optional() }).strict() }).strict(),
5797
+ z42.object({ kind: z42.literal("plugin"), since: iso, deadline: iso.optional(), detail: z42.object({ pluginKind: z42.string().min(1).max(64), summary: z42.string().max(256) }).strict() }).strict(),
5798
+ z42.object({ kind: z42.literal("timer"), since: iso, deadline: iso, detail: z42.object({ wakeAt: iso, note: z42.string().optional() }).strict() }).strict()
5759
5799
  ]);
5760
5800
  var activityRunShape = {
5761
5801
  runId,
5762
5802
  /** The display title: `titleSummary ?? title`. */
5763
- title: z41.string(),
5803
+ title: z42.string(),
5764
5804
  status: runStatusSchema,
5765
5805
  /** The `deriveAttention` rung id, never a label. */
5766
- rung: z41.enum(ATTENTION_RUNGS),
5806
+ rung: z42.enum(ATTENTION_RUNGS),
5767
5807
  runner: runnerSchema.optional(),
5768
- model: z41.string().optional(),
5769
- currentStepId: z41.string().optional(),
5770
- createdAt: z41.string().optional(),
5771
- startedAt: z41.string().optional(),
5772
- finishedAt: z41.string().optional(),
5808
+ model: z42.string().optional(),
5809
+ currentStepId: z42.string().optional(),
5810
+ createdAt: z42.string().optional(),
5811
+ startedAt: z42.string().optional(),
5812
+ finishedAt: z42.string().optional(),
5773
5813
  wait: activityWaitSchema.optional(),
5774
5814
  tool: activityToolSchema.optional(),
5775
5815
  /** Tool calls started per second, oldest first. */
5776
- rate: z41.array(count).length(ACTIVITY_RATE_SECONDS),
5816
+ rate: z42.array(count).length(ACTIVITY_RATE_SECONDS),
5777
5817
  /** One line of `RunRecord.error`. */
5778
- error: z41.string().max(ACTIVITY_ERROR_MAX).optional()
5818
+ error: z42.string().max(ACTIVITY_ERROR_MAX).optional()
5779
5819
  };
5780
- var activityWorkerSchema = z41.object({
5820
+ var activityWorkerSchema = z42.object({
5781
5821
  ...activityRunShape,
5782
5822
  /** The worker's current execution revision. */
5783
5823
  revision: count,
5784
5824
  /** The parent holds a collected result for this revision. */
5785
- collected: z41.boolean()
5825
+ collected: z42.boolean()
5786
5826
  }).strict();
5787
- var activityRunSchema = z41.object({ ...activityRunShape, workers: z41.array(activityWorkerSchema) }).strict();
5788
- var activityRequestSchema = z41.object({
5789
- requestId: z41.uuid(),
5790
- relationship: z41.enum(["family", "peer"]),
5827
+ var activityRunSchema = z42.object({ ...activityRunShape, workers: z42.array(activityWorkerSchema) }).strict();
5828
+ var activityRequestSchema = z42.object({
5829
+ requestId: z42.uuid(),
5830
+ relationship: z42.enum(["family", "peer"]),
5791
5831
  senderRunId: runId,
5792
5832
  recipientRunId: runId,
5793
- text: z41.string().max(ACTIVITY_TEXT_MAX),
5794
- senderTitle: z41.string().optional(),
5795
- recipientTitle: z41.string().optional(),
5833
+ text: z42.string().max(ACTIVITY_TEXT_MAX),
5834
+ senderTitle: z42.string().optional(),
5835
+ recipientTitle: z42.string().optional(),
5796
5836
  createdAt: iso,
5797
5837
  deadline: iso.optional()
5798
5838
  }).strict();
5799
- var activityClosedRequestSchema = z41.object({
5800
- requestId: z41.uuid(),
5839
+ var activityClosedRequestSchema = z42.object({
5840
+ requestId: z42.uuid(),
5801
5841
  senderRunId: runId,
5802
5842
  recipientRunId: runId,
5803
5843
  status: requestOutcomeSchema.shape.status,
5804
5844
  observedAt: iso
5805
5845
  }).strict();
5806
- var activityProjectSchema = z41.object({
5807
- projectId: z41.string(),
5808
- name: z41.string(),
5846
+ var activityProjectSchema = z42.object({
5847
+ projectId: z42.string(),
5848
+ name: z42.string(),
5809
5849
  /** False for a project this process has not loaded: its lists are empty because nothing was read. */
5810
- loaded: z41.boolean(),
5850
+ loaded: z42.boolean(),
5811
5851
  /** The project is loaded but its run store cannot open: the failure its project routes answer.
5812
5852
  * The lists are empty because nothing could be read, not because nothing runs. */
5813
- unavailable: z41.object({ status: z41.union([z41.literal(404), z41.literal(409), z41.literal(503)]), error: z41.string() }).strict().optional(),
5853
+ unavailable: z42.object({ status: z42.union([z42.literal(404), z42.literal(409), z42.literal(503)]), error: z42.string() }).strict().optional(),
5814
5854
  /** Root tasks in review: the summary chip (D8). */
5815
5855
  inReview: count,
5816
- tasks: z41.array(activityRunSchema),
5817
- requests: z41.array(activityRequestSchema),
5818
- closed: z41.array(activityClosedRequestSchema)
5856
+ tasks: z42.array(activityRunSchema),
5857
+ requests: z42.array(activityRequestSchema),
5858
+ closed: z42.array(activityClosedRequestSchema)
5819
5859
  }).strict();
5820
- var activitySnapshotSchema = z41.object({
5860
+ var activitySnapshotSchema = z42.object({
5821
5861
  /** The server clock; the client ticks ages from it. */
5822
5862
  generatedAt: iso,
5823
5863
  /** One entry, or every visible project for the global read. */
5824
- projects: z41.array(activityProjectSchema)
5864
+ projects: z42.array(activityProjectSchema)
5825
5865
  }).strict();
5826
- var activityQuerySchema = z41.object({
5827
- project: z41.union([z41.literal("default"), z41.string().regex(PROJECT_ID_PATTERN)]).optional()
5866
+ var activityQuerySchema = z42.object({
5867
+ project: z42.union([z42.literal("default"), z42.string().regex(PROJECT_ID_PATTERN)]).optional()
5828
5868
  });
5829
5869
 
5830
5870
  // ../contract/src/live-coordination.ts
5831
- import { z as z42 } from "zod";
5871
+ import { z as z43 } from "zod";
5832
5872
  var LIVE_PROTOCOL = 4;
5833
5873
  var LIVE_WORKER_NAME = "cezar-live-v4";
5834
5874
  var LEASE_MS = 15e3;
@@ -5837,112 +5877,112 @@ function allowedLiveRead(path) {
5837
5877
  if (!path.startsWith("/api/v1/") || path.includes("#") || /[\\\r\n]/.test(path)) return false;
5838
5878
  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);
5839
5879
  }
5840
- var liveDemandSchema = z42.discriminatedUnion("kind", [
5841
- z42.object({ kind: z42.literal("workspace") }),
5842
- liveRunDemandSchema.extend({ kind: z42.literal("run") }),
5843
- z42.object({ kind: z42.literal("topic"), topic: z42.string().min(1).max(128) }),
5880
+ var liveDemandSchema = z43.discriminatedUnion("kind", [
5881
+ z43.object({ kind: z43.literal("workspace") }),
5882
+ liveRunDemandSchema.extend({ kind: z43.literal("run") }),
5883
+ z43.object({ kind: z43.literal("topic"), topic: z43.string().min(1).max(128) }),
5844
5884
  // Preserve server-directed cadence (settled references use ten minutes). Only
5845
5885
  // bound the timer itself: larger delays overflow setTimeout into a tight loop.
5846
- z42.object({ kind: z42.literal("read"), path: z42.string().max(4096).refine(allowedLiveRead), intervalMs: z42.number().int().min(1e3).max(2147483647) })
5886
+ z43.object({ kind: z43.literal("read"), path: z43.string().max(4096).refine(allowedLiveRead), intervalMs: z43.number().int().min(1e3).max(2147483647) })
5847
5887
  ]);
5848
- var liveEntrySchema = z42.object({ id: z42.string().min(1).max(128), demand: liveDemandSchema });
5849
- var envelope = z42.object({ version: z42.literal(LIVE_PROTOCOL), documentId: z42.string().min(1).max(128), epoch: z42.number().int().nonnegative() });
5850
- var ownerInputSchema = z42.discriminatedUnion("type", [
5888
+ var liveEntrySchema = z43.object({ id: z43.string().min(1).max(128), demand: liveDemandSchema });
5889
+ var envelope = z43.object({ version: z43.literal(LIVE_PROTOCOL), documentId: z43.string().min(1).max(128), epoch: z43.number().int().nonnegative() });
5890
+ var ownerInputSchema = z43.discriminatedUnion("type", [
5851
5891
  envelope.extend({
5852
- type: z42.literal("sync"),
5853
- entries: z42.array(liveEntrySchema).max(64),
5892
+ type: z43.literal("sync"),
5893
+ entries: z43.array(liveEntrySchema).max(64),
5854
5894
  /** The document knows no workspace stream generation (its `ready` was lost, for example to
5855
5895
  * an epoch change): send it the stream's `ready` again (hearsay-tools/cezarion#2729). */
5856
- workspaceReady: z42.literal(true).optional()
5896
+ workspaceReady: z43.literal(true).optional()
5857
5897
  }).refine((value) => new Set(value.entries.map((e) => e.id)).size === value.entries.length),
5858
- envelope.extend({ type: z42.literal("ack"), id: z42.string(), seq: z42.number().int().nonnegative() }),
5859
- envelope.extend({ type: z42.literal("ack-snapshot"), id: z42.string() }),
5860
- envelope.extend({ type: z42.literal("refresh"), id: z42.string() })
5898
+ envelope.extend({ type: z43.literal("ack"), id: z43.string(), seq: z43.number().int().nonnegative() }),
5899
+ envelope.extend({ type: z43.literal("ack-snapshot"), id: z43.string() }),
5900
+ envelope.extend({ type: z43.literal("refresh"), id: z43.string() })
5861
5901
  ]);
5862
- var wireFrameSchema = z42.object({ event: z42.string(), data: z42.string(), id: z42.string() });
5863
- var ownerOutputSchema = z42.discriminatedUnion("type", [
5864
- z42.object({ type: z42.literal("unavailable"), version: z42.literal(LIVE_PROTOCOL), epoch: z42.number(), reason: z42.string() }),
5865
- z42.object({ type: z42.literal("hello"), version: z42.literal(LIVE_PROTOCOL) }),
5866
- z42.object({ type: z42.literal("alive"), version: z42.literal(LIVE_PROTOCOL), epoch: z42.number() }),
5867
- z42.object({ type: z42.literal("frame"), version: z42.literal(LIVE_PROTOCOL), epoch: z42.number(), id: z42.string(), frame: z42.union([wireFrameSchema, liveRunFrameSchema]) }),
5868
- z42.object({ type: z42.literal("value"), version: z42.literal(LIVE_PROTOCOL), epoch: z42.number(), id: z42.string(), value: z42.unknown(), error: z42.string().optional() }),
5869
- z42.object({ type: z42.literal("reset"), version: z42.literal(LIVE_PROTOCOL), epoch: z42.number(), id: z42.string(), reason: z42.string() })
5902
+ var wireFrameSchema = z43.object({ event: z43.string(), data: z43.string(), id: z43.string() });
5903
+ var ownerOutputSchema = z43.discriminatedUnion("type", [
5904
+ z43.object({ type: z43.literal("unavailable"), version: z43.literal(LIVE_PROTOCOL), epoch: z43.number(), reason: z43.string() }),
5905
+ z43.object({ type: z43.literal("hello"), version: z43.literal(LIVE_PROTOCOL) }),
5906
+ z43.object({ type: z43.literal("alive"), version: z43.literal(LIVE_PROTOCOL), epoch: z43.number() }),
5907
+ z43.object({ type: z43.literal("frame"), version: z43.literal(LIVE_PROTOCOL), epoch: z43.number(), id: z43.string(), frame: z43.union([wireFrameSchema, liveRunFrameSchema]) }),
5908
+ z43.object({ type: z43.literal("value"), version: z43.literal(LIVE_PROTOCOL), epoch: z43.number(), id: z43.string(), value: z43.unknown(), error: z43.string().optional() }),
5909
+ z43.object({ type: z43.literal("reset"), version: z43.literal(LIVE_PROTOCOL), epoch: z43.number(), id: z43.string(), reason: z43.string() })
5870
5910
  ]);
5871
5911
  var runKey = (run) => `${run.projectId}/${run.runId}`;
5872
5912
 
5873
5913
  // ../contract/src/workspace-events.ts
5874
- import { z as z43 } from "zod";
5875
- var workspaceEventsQuerySchema = z43.object({
5876
- runs: z43.literal("summary").optional()
5914
+ import { z as z44 } from "zod";
5915
+ var workspaceEventsQuerySchema = z44.object({
5916
+ runs: z44.literal("summary").optional()
5877
5917
  });
5878
- var projectStamp = z43.string().min(1);
5879
- var frameSeq = z43.number().int().positive();
5880
- var workspaceRunSummaryEventSchema = z43.object({
5918
+ var projectStamp = z44.string().min(1);
5919
+ var frameSeq = z44.number().int().positive();
5920
+ var workspaceRunSummaryEventSchema = z44.object({
5881
5921
  project: projectStamp,
5882
5922
  seq: frameSeq,
5883
5923
  run: runSummarySchema,
5884
- relationships: z43.string().min(1)
5924
+ relationships: z44.string().min(1)
5885
5925
  });
5886
- var workspaceRunDeletedEventSchema = z43.object({
5926
+ var workspaceRunDeletedEventSchema = z44.object({
5887
5927
  project: projectStamp,
5888
5928
  seq: frameSeq,
5889
- id: z43.string().min(1)
5929
+ id: z44.string().min(1)
5890
5930
  });
5891
- var workspaceReadyEventSchema = z43.object({
5892
- generation: z43.string().min(1),
5893
- seq: z43.number().int().nonnegative()
5931
+ var workspaceReadyEventSchema = z44.object({
5932
+ generation: z44.string().min(1),
5933
+ seq: z44.number().int().nonnegative()
5894
5934
  });
5895
- var workspaceUsageEventSchema = z43.object({
5935
+ var workspaceUsageEventSchema = z44.object({
5896
5936
  project: projectStamp,
5897
- usage: z43.record(z43.string(), processUsageSchema)
5937
+ usage: z44.record(z44.string(), processUsageSchema)
5898
5938
  });
5899
- var runsIndexResponseSchema = z43.object({
5939
+ var runsIndexResponseSchema = z44.object({
5900
5940
  /** Newest first, across every registered project: each project's window
5901
5941
  * (hearsay-tools/cezarion#864) — every unarchived root run, plus its newest `perProjectLimit`
5902
5942
  * archived root runs. Owned workers are never included. Older archived runs are reached
5903
5943
  * through `GET /workspace/runs-search`. */
5904
- runs: z43.array(runIndexEntrySchema),
5944
+ runs: z44.array(runIndexEntrySchema),
5905
5945
  /** Additive: absent statuses mean "nothing warm", never "nothing to show". */
5906
5946
  referenceStatuses: referenceStatusesByProjectSchema,
5907
5947
  /** How many archived root runs each project contributes at most. Unarchived roots are never cut. */
5908
- perProjectLimit: z43.number(),
5948
+ perProjectLimit: z44.number(),
5909
5949
  /** Ids of the projects that had more archived root runs than `perProjectLimit`. */
5910
- truncated: z43.array(z43.string()),
5950
+ truncated: z44.array(z44.string()),
5911
5951
  /** The server process that answered: the workspace stream's `ready.generation`. An `eventSeq`
5912
5952
  * compares only within one generation. */
5913
- generation: z43.string().min(1),
5953
+ generation: z44.string().min(1),
5914
5954
  /** The last workspace stream `seq` this answer includes: every `run-summary` and `run-deleted`
5915
5955
  * frame at or below it is already in `runs`; a frame above it is newer than the snapshot. */
5916
- eventSeq: z43.number().int().nonnegative()
5956
+ eventSeq: z44.number().int().nonnegative()
5917
5957
  });
5918
5958
 
5919
5959
  // ../contract/src/permissions.ts
5920
- import { z as z44 } from "zod";
5921
- var permissionOptionKindSchema = z44.enum(["allow_once", "allow_always", "reject_once", "reject_always"]);
5922
- var permissionOptionSchema = z44.object({
5923
- id: z44.string().min(1).max(128),
5924
- label: z44.string().min(1),
5960
+ import { z as z45 } from "zod";
5961
+ var permissionOptionKindSchema = z45.enum(["allow_once", "allow_always", "reject_once", "reject_always"]);
5962
+ var permissionOptionSchema = z45.object({
5963
+ id: z45.string().min(1).max(128),
5964
+ label: z45.string().min(1),
5925
5965
  kind: permissionOptionKindSchema
5926
5966
  }).strict();
5927
- var permissionRequestedSchema = z44.object({
5928
- type: z44.literal("permission.requested"),
5929
- requestId: z44.string().min(1).max(128),
5930
- itemId: z44.string().optional(),
5931
- title: z44.string().min(1),
5932
- details: z44.string().optional(),
5933
- options: z44.array(permissionOptionSchema).min(1).refine((options) => new Set(options.map((option) => option.id)).size === options.length)
5967
+ var permissionRequestedSchema = z45.object({
5968
+ type: z45.literal("permission.requested"),
5969
+ requestId: z45.string().min(1).max(128),
5970
+ itemId: z45.string().optional(),
5971
+ title: z45.string().min(1),
5972
+ details: z45.string().optional(),
5973
+ options: z45.array(permissionOptionSchema).min(1).refine((options) => new Set(options.map((option) => option.id)).size === options.length)
5934
5974
  }).strict();
5935
- var permissionResolvedSchema = z44.object({
5936
- type: z44.literal("permission.resolved"),
5937
- requestId: z44.string().min(1).max(128),
5938
- optionId: z44.string().optional(),
5939
- reason: z44.string().optional()
5975
+ var permissionResolvedSchema = z45.object({
5976
+ type: z45.literal("permission.resolved"),
5977
+ requestId: z45.string().min(1).max(128),
5978
+ optionId: z45.string().optional(),
5979
+ reason: z45.string().optional()
5940
5980
  }).strict();
5941
- var permissionDecisionSchema = z44.object({
5942
- requestId: z44.string().min(1).max(128),
5943
- optionId: z44.string().min(1).max(128)
5981
+ var permissionDecisionSchema = z45.object({
5982
+ requestId: z45.string().min(1).max(128),
5983
+ optionId: z45.string().min(1).max(128)
5944
5984
  }).strict();
5945
- var permissionDecisionResponseSchema = z44.object({ delivered: z44.literal(true) });
5985
+ var permissionDecisionResponseSchema = z45.object({ delivered: z45.literal(true) });
5946
5986
 
5947
5987
  // ../contract/src/defined.ts
5948
5988
  function defined(value) {
@@ -6212,83 +6252,83 @@ function isImagePath(path) {
6212
6252
  }
6213
6253
 
6214
6254
  // ../contract/src/provider-requests.ts
6215
- import { z as z45 } from "zod";
6216
- var providerConnectSchema = z45.object({
6255
+ import { z as z46 } from "zod";
6256
+ var providerConnectSchema = z46.object({
6217
6257
  provider: runnerSchema,
6218
6258
  /** Which agent account to sign in (spec 2026-07-29-agent-profiles). Absent = the discovered
6219
6259
  * default, which is what every pre-profiles client sends. Without this, "Connect" on a second
6220
6260
  * Claude account would open a login for the FIRST one and report success. */
6221
- profileId: z45.string().max(64).optional()
6261
+ profileId: z46.string().max(64).optional()
6222
6262
  }).strict();
6223
- var createAgentProfileSchema = z45.object({
6263
+ var createAgentProfileSchema = z46.object({
6224
6264
  provider: runnerSchema,
6225
- label: z45.string().trim().max(200).optional(),
6226
- configDir: z45.string().trim().min(1).max(4096)
6265
+ label: z46.string().trim().max(200).optional(),
6266
+ configDir: z46.string().trim().min(1).max(4096)
6227
6267
  }).strict();
6228
- var updateAgentProfileSchema = z45.object({
6229
- label: z45.string().trim().max(200).optional(),
6230
- configDir: z45.string().trim().min(1).max(4096).optional()
6268
+ var updateAgentProfileSchema = z46.object({
6269
+ label: z46.string().trim().max(200).optional(),
6270
+ configDir: z46.string().trim().min(1).max(4096).optional()
6231
6271
  }).strict().refine(
6232
6272
  (value) => value.label !== void 0 || value.configDir !== void 0,
6233
6273
  "send label or configDir"
6234
6274
  );
6235
- var selectAgentProfileSchema = z45.object({
6236
- projectId: z45.string().min(1).max(64),
6275
+ var selectAgentProfileSchema = z46.object({
6276
+ projectId: z46.string().min(1).max(64),
6237
6277
  provider: runnerSchema,
6238
- profileId: z45.string().max(64).nullable()
6278
+ profileId: z46.string().max(64).nullable()
6239
6279
  }).strict();
6240
6280
  var providerParamSchema = runnerSchema;
6241
- var providerEnabledSchema = z45.object({ enabled: z45.boolean() }).strict();
6242
- var providerRetrySchema = z45.object({
6243
- authFailureId: z45.string().min(1).max(128)
6281
+ var providerEnabledSchema = z46.object({ enabled: z46.boolean() }).strict();
6282
+ var providerRetrySchema = z46.object({
6283
+ authFailureId: z46.string().min(1).max(128)
6244
6284
  }).strict();
6245
- var providerRouteParamsSchema = z45.object({ provider: providerParamSchema });
6246
- var agentProfileRouteParamsSchema = z45.object({ id: z45.string() });
6247
- var providerSignInParamsSchema = z45.object({ id: z45.uuid() });
6248
- var providerSignInRedirectSchema = z45.object({
6285
+ var providerRouteParamsSchema = z46.object({ provider: providerParamSchema });
6286
+ var agentProfileRouteParamsSchema = z46.object({ id: z46.string() });
6287
+ var providerSignInParamsSchema = z46.object({ id: z46.uuid() });
6288
+ var providerSignInRedirectSchema = z46.object({
6249
6289
  /** The address the browser landed on after consent, or the code that page shows. */
6250
- redirectUrl: z45.string().trim().min(1).max(8192)
6290
+ redirectUrl: z46.string().trim().min(1).max(8192)
6251
6291
  }).strict();
6252
6292
 
6253
6293
  // ../contract/src/automation-requests.ts
6254
- import { z as z47 } from "zod";
6294
+ import { z as z48 } from "zod";
6255
6295
 
6256
6296
  // ../contract/src/automation-storage.ts
6257
- import { z as z46 } from "zod";
6258
- var storedAutomationEventSchema = z46.enum([
6297
+ import { z as z47 } from "zod";
6298
+ var storedAutomationEventSchema = z47.enum([
6259
6299
  "pull_request.opened",
6260
6300
  "issue.opened",
6261
6301
  "issue.labeled",
6262
6302
  "issue.unlabeled"
6263
6303
  ]);
6264
- var boundedString = z46.string().trim().min(1).max(200);
6265
- var stringList = z46.array(boundedString).max(100).optional();
6266
- var storedAutomationFiltersSchema = z46.object({
6267
- includeExisting: z46.boolean().optional(),
6304
+ var boundedString = z47.string().trim().min(1).max(200);
6305
+ var stringList = z47.array(boundedString).max(100).optional();
6306
+ var storedAutomationFiltersSchema = z47.object({
6307
+ includeExisting: z47.boolean().optional(),
6268
6308
  /** Require an open item and matching live labels before reservation and launch. */
6269
- requireCurrentLabels: z46.boolean().optional(),
6309
+ requireCurrentLabels: z47.boolean().optional(),
6270
6310
  authors: stringList,
6271
6311
  assignees: stringList,
6272
6312
  allLabels: stringList,
6273
6313
  anyLabels: stringList,
6274
6314
  excludeLabels: stringList,
6275
6315
  changedLabels: stringList,
6276
- lookbackDays: z46.number().int().min(1).max(90).default(7),
6277
- maxRecords: z46.number().int().min(1).max(100).default(25)
6316
+ lookbackDays: z47.number().int().min(1).max(90).default(7),
6317
+ maxRecords: z47.number().int().min(1).max(100).default(25)
6278
6318
  }).passthrough();
6279
- var storedAutomationTaskSchema = z46.object({
6280
- prompt: z46.string().min(1).max(1e5),
6281
- workflow: z46.string().trim().min(1).max(200).optional(),
6282
- steps: z46.array(workflowStepDefSchema).min(1).max(100).optional(),
6319
+ var storedAutomationTaskSchema = z47.object({
6320
+ prompt: z47.string().min(1).max(1e5),
6321
+ workflow: z47.string().trim().min(1).max(200).optional(),
6322
+ steps: z47.array(workflowStepDefSchema).min(1).max(100).optional(),
6283
6323
  runner: runnerSchema.optional(),
6284
- model: z46.string().trim().min(1).max(200).optional(),
6285
- effort: z46.string().trim().min(1).max(32).optional(),
6286
- variants: z46.union([z46.literal(1), z46.literal(2), z46.literal(3)]).optional(),
6287
- worktree: z46.boolean().optional(),
6288
- autonomous: z46.boolean().optional(),
6324
+ model: z47.string().trim().min(1).max(200).optional(),
6325
+ effort: z47.string().trim().min(1).max(32).optional(),
6326
+ variants: z47.union([z47.literal(1), z47.literal(2), z47.literal(3)]).optional(),
6327
+ worktree: z47.boolean().optional(),
6328
+ autonomous: z47.boolean().optional(),
6289
6329
  ...completionControlsShape,
6290
6330
  ...taskAccessShape,
6291
- systemPrompt: z46.string().max(1e5).optional()
6331
+ systemPrompt: z47.string().max(1e5).optional()
6292
6332
  }).passthrough().refine((task) => !(task.workflow && task.steps), {
6293
6333
  message: "task selects either a named workflow or inline steps, not both"
6294
6334
  });
@@ -6306,122 +6346,122 @@ var fillGithubDefaults = (raw) => {
6306
6346
  filters: record.filters ?? {}
6307
6347
  };
6308
6348
  };
6309
- var storedAutomationDefinitionObjectSchema = z46.object({
6310
- id: z46.string().min(1).max(100),
6311
- revision: z46.number().int().positive(),
6312
- name: z46.string().trim().min(1).max(200),
6313
- description: z46.string().max(2e3).optional(),
6314
- enabled: z46.boolean().default(false),
6349
+ var storedAutomationDefinitionObjectSchema = z47.object({
6350
+ id: z47.string().min(1).max(100),
6351
+ revision: z47.number().int().positive(),
6352
+ name: z47.string().trim().min(1).max(200),
6353
+ description: z47.string().max(2e3).optional(),
6354
+ enabled: z47.boolean().default(false),
6315
6355
  /** A definition written before schedules has no `kind`: it is a poll. */
6316
6356
  kind: automationKindSchema.default("github"),
6317
- events: z46.array(storedAutomationEventSchema).min(1).max(4).optional(),
6318
- intervalSeconds: z46.number().int().min(60).max(86400).optional(),
6357
+ events: z47.array(storedAutomationEventSchema).min(1).max(4).optional(),
6358
+ intervalSeconds: z47.number().int().min(60).max(86400).optional(),
6319
6359
  filters: storedAutomationFiltersSchema.optional(),
6320
6360
  // Passthrough like every other persisted layer: a schedule key a later build adds survives a save here.
6321
6361
  schedule: automationScheduleSchema.passthrough().optional(),
6322
6362
  task: storedAutomationTaskSchema,
6323
6363
  /** `once` schedules only (hearsay-tools/cezarion#1465): the archive record. */
6324
- archived: z46.object({
6325
- at: z46.string().datetime(),
6326
- outcome: z46.enum(["launched", "cancelled"]),
6327
- runId: z46.string().optional(),
6328
- receiptId: z46.string().optional(),
6329
- trigger: z46.enum(["schedule", "late", "manual", "retry"]).optional()
6364
+ archived: z47.object({
6365
+ at: z47.string().datetime(),
6366
+ outcome: z47.enum(["launched", "cancelled"]),
6367
+ runId: z47.string().optional(),
6368
+ receiptId: z47.string().optional(),
6369
+ trigger: z47.enum(["schedule", "late", "manual", "retry"]).optional()
6330
6370
  }).passthrough().optional(),
6331
- createdAt: z46.string().datetime(),
6332
- updatedAt: z46.string().datetime()
6371
+ createdAt: z47.string().datetime(),
6372
+ updatedAt: z47.string().datetime()
6333
6373
  }).passthrough().superRefine((definition, ctx) => {
6334
6374
  if (definition.kind === "schedule") {
6335
6375
  if (!definition.schedule) {
6336
- ctx.addIssue({ code: z46.ZodIssueCode.custom, path: ["schedule"], message: "a scheduled automation needs a schedule" });
6376
+ ctx.addIssue({ code: z47.ZodIssueCode.custom, path: ["schedule"], message: "a scheduled automation needs a schedule" });
6337
6377
  }
6338
6378
  return;
6339
6379
  }
6340
6380
  if (!definition.events?.length) {
6341
- ctx.addIssue({ code: z46.ZodIssueCode.custom, path: ["events"], message: "a GitHub automation needs at least one event" });
6381
+ ctx.addIssue({ code: z47.ZodIssueCode.custom, path: ["events"], message: "a GitHub automation needs at least one event" });
6342
6382
  }
6343
6383
  if (definition.intervalSeconds === void 0) {
6344
- ctx.addIssue({ code: z46.ZodIssueCode.custom, path: ["intervalSeconds"], message: "a GitHub automation needs a poll interval" });
6384
+ ctx.addIssue({ code: z47.ZodIssueCode.custom, path: ["intervalSeconds"], message: "a GitHub automation needs a poll interval" });
6345
6385
  }
6346
6386
  if (!definition.filters) {
6347
- ctx.addIssue({ code: z46.ZodIssueCode.custom, path: ["filters"], message: "a GitHub automation needs its bounded filter" });
6387
+ ctx.addIssue({ code: z47.ZodIssueCode.custom, path: ["filters"], message: "a GitHub automation needs its bounded filter" });
6348
6388
  }
6349
6389
  if (definition.events?.some((event) => event === "issue.labeled" || event === "issue.unlabeled") && !definition.filters?.changedLabels?.length) {
6350
6390
  ctx.addIssue({
6351
- code: z46.ZodIssueCode.custom,
6391
+ code: z47.ZodIssueCode.custom,
6352
6392
  path: ["filters", "changedLabels"],
6353
6393
  message: "changedLabels is required for issue label events"
6354
6394
  });
6355
6395
  }
6356
6396
  });
6357
- var storedAutomationDefinitionSchema = z46.preprocess(fillGithubDefaults, storedAutomationDefinitionObjectSchema);
6358
- var storedAutomationDefinitionsFileSchema = z46.object({
6359
- version: z46.literal(1).default(1),
6360
- automations: z46.array(z46.unknown()).default([]),
6361
- tombstones: z46.record(z46.string(), z46.string().datetime()).optional()
6397
+ var storedAutomationDefinitionSchema = z47.preprocess(fillGithubDefaults, storedAutomationDefinitionObjectSchema);
6398
+ var storedAutomationDefinitionsFileSchema = z47.object({
6399
+ version: z47.literal(1).default(1),
6400
+ automations: z47.array(z47.unknown()).default([]),
6401
+ tombstones: z47.record(z47.string(), z47.string().datetime()).optional()
6362
6402
  }).passthrough();
6363
- var storedAutomationCursorSchema = z46.object({
6364
- timestamp: z46.string().datetime(),
6365
- tieBreaker: z46.string().optional()
6403
+ var storedAutomationCursorSchema = z47.object({
6404
+ timestamp: z47.string().datetime(),
6405
+ tieBreaker: z47.string().optional()
6366
6406
  }).passthrough();
6367
6407
  var storedAutomationHistoryScanSchema = automationHistoryScanSchema.extend({
6368
6408
  cursor: storedAutomationCursorSchema.optional()
6369
6409
  });
6370
- var storedAutomationRuntimeStateSchema = z46.object({
6371
- revision: z46.number().int().positive().optional(),
6372
- baselineAt: z46.string().datetime().optional(),
6410
+ var storedAutomationRuntimeStateSchema = z47.object({
6411
+ revision: z47.number().int().positive().optional(),
6412
+ baselineAt: z47.string().datetime().optional(),
6373
6413
  /** Arming time, independent of a history window's older lower bound. */
6374
- armedAt: z46.string().datetime().optional(),
6414
+ armedAt: z47.string().datetime().optional(),
6375
6415
  historyScan: storedAutomationHistoryScanSchema.optional(),
6376
6416
  cursor: storedAutomationCursorSchema.optional(),
6377
- frozenHighWatermark: storedAutomationCursorSchema.extend({ tieBreaker: z46.string() }).optional(),
6378
- backlogAfter: storedAutomationCursorSchema.extend({ tieBreaker: z46.string() }).optional(),
6379
- nextCheckAt: z46.string().datetime().optional(),
6380
- lastSuccessAt: z46.string().datetime().optional(),
6417
+ frozenHighWatermark: storedAutomationCursorSchema.extend({ tieBreaker: z47.string() }).optional(),
6418
+ backlogAfter: storedAutomationCursorSchema.extend({ tieBreaker: z47.string() }).optional(),
6419
+ nextCheckAt: z47.string().datetime().optional(),
6420
+ lastSuccessAt: z47.string().datetime().optional(),
6381
6421
  /** schedule kind: the next occurrence's instant and the last fired one's. */
6382
- nextRunAt: z46.string().datetime().optional(),
6383
- lastRunAt: z46.string().datetime().optional(),
6384
- etags: z46.record(z46.string(), z46.string()).optional(),
6385
- backoffUntil: z46.string().datetime().optional(),
6386
- consecutiveFailures: z46.number().int().nonnegative().optional(),
6422
+ nextRunAt: z47.string().datetime().optional(),
6423
+ lastRunAt: z47.string().datetime().optional(),
6424
+ etags: z47.record(z47.string(), z47.string()).optional(),
6425
+ backoffUntil: z47.string().datetime().optional(),
6426
+ consecutiveFailures: z47.number().int().nonnegative().optional(),
6387
6427
  ...automationLastErrorShape,
6388
6428
  /** once schedule: it stopped without a task — the launch failed, or it started past its cutoff. */
6389
- onceOutcome: z46.enum(["failed", "missed"]).optional()
6429
+ onceOutcome: z47.enum(["failed", "missed"]).optional()
6390
6430
  }).passthrough();
6391
- var storedAutomationStateFileSchema = z46.object({
6392
- version: z46.literal(1).default(1),
6393
- states: z46.record(z46.string(), storedAutomationRuntimeStateSchema).default({})
6431
+ var storedAutomationStateFileSchema = z47.object({
6432
+ version: z47.literal(1).default(1),
6433
+ states: z47.record(z47.string(), storedAutomationRuntimeStateSchema).default({})
6394
6434
  }).passthrough();
6395
- var storedAutomationReceiptSchema = z46.object({
6396
- receiptId: z46.string().min(1),
6397
- receiptKey: z46.string().min(1),
6398
- eventId: z46.string().min(1),
6399
- automationId: z46.string().min(1),
6400
- revision: z46.number().int().positive(),
6401
- status: z46.enum(["reserved", "launched", "launch-error", "released"]),
6402
- runId: z46.string().optional(),
6403
- observedAt: z46.string().datetime(),
6404
- updatedAt: z46.string().datetime(),
6405
- error: z46.string().max(2e3).optional(),
6435
+ var storedAutomationReceiptSchema = z47.object({
6436
+ receiptId: z47.string().min(1),
6437
+ receiptKey: z47.string().min(1),
6438
+ eventId: z47.string().min(1),
6439
+ automationId: z47.string().min(1),
6440
+ revision: z47.number().int().positive(),
6441
+ status: z47.enum(["reserved", "launched", "launch-error", "released"]),
6442
+ runId: z47.string().optional(),
6443
+ observedAt: z47.string().datetime(),
6444
+ updatedAt: z47.string().datetime(),
6445
+ error: z47.string().max(2e3).optional(),
6406
6446
  /** schedule kind: the occurrence this receipt reserved, so a retry can fire it again. */
6407
- occurrenceAt: z46.string().datetime().optional(),
6408
- candidate: z46.object({
6409
- eventId: z46.string(),
6447
+ occurrenceAt: z47.string().datetime().optional(),
6448
+ candidate: z47.object({
6449
+ eventId: z47.string(),
6410
6450
  event: storedAutomationEventSchema,
6411
- timestamp: z46.string().datetime(),
6412
- tieBreaker: z46.string(),
6413
- repo: z46.string(),
6414
- nodeId: z46.string(),
6415
- number: z46.number().int().positive(),
6416
- title: z46.string().max(500),
6417
- url: z46.string().url(),
6418
- author: z46.string().max(200),
6419
- assignees: z46.array(z46.string().max(200)).max(100),
6420
- labels: z46.array(z46.string().max(200)).max(100),
6421
- changedLabel: z46.string().max(200).optional()
6451
+ timestamp: z47.string().datetime(),
6452
+ tieBreaker: z47.string(),
6453
+ repo: z47.string(),
6454
+ nodeId: z47.string(),
6455
+ number: z47.number().int().positive(),
6456
+ title: z47.string().max(500),
6457
+ url: z47.string().url(),
6458
+ author: z47.string().max(200),
6459
+ assignees: z47.array(z47.string().max(200)).max(100),
6460
+ labels: z47.array(z47.string().max(200)).max(100),
6461
+ changedLabel: z47.string().max(200).optional()
6422
6462
  }).passthrough().optional()
6423
6463
  }).passthrough();
6424
- var storedAutomationLogResultSchema = z46.enum([
6464
+ var storedAutomationLogResultSchema = z47.enum([
6425
6465
  "launched",
6426
6466
  "no-match",
6427
6467
  "duplicate",
@@ -6437,24 +6477,24 @@ var storedAutomationLogResultSchema = z46.enum([
6437
6477
  // once schedule
6438
6478
  "missed"
6439
6479
  ]);
6440
- var storedAutomationLogRecordSchema = z46.object({
6441
- seq: z46.number().int().positive(),
6442
- ts: z46.string().datetime(),
6443
- automationId: z46.string().min(1),
6444
- revision: z46.number().int().positive(),
6480
+ var storedAutomationLogRecordSchema = z47.object({
6481
+ seq: z47.number().int().positive(),
6482
+ ts: z47.string().datetime(),
6483
+ automationId: z47.string().min(1),
6484
+ revision: z47.number().int().positive(),
6445
6485
  event: storedAutomationEventSchema.optional(),
6446
6486
  result: storedAutomationLogResultSchema,
6447
- reason: z46.string().max(2e3).optional(),
6448
- durationMs: z46.number().int().nonnegative().optional(),
6449
- receiptId: z46.string().optional(),
6450
- runId: z46.string().optional(),
6451
- githubNumber: z46.number().int().positive().optional(),
6452
- githubTitle: z46.string().max(500).optional(),
6453
- githubUrl: z46.string().url().optional(),
6454
- rateLimit: z46.object({
6455
- bucket: z46.enum(["core", "search"]),
6456
- remaining: z46.number().int().nonnegative().optional(),
6457
- resetAt: z46.string().datetime().optional()
6487
+ reason: z47.string().max(2e3).optional(),
6488
+ durationMs: z47.number().int().nonnegative().optional(),
6489
+ receiptId: z47.string().optional(),
6490
+ runId: z47.string().optional(),
6491
+ githubNumber: z47.number().int().positive().optional(),
6492
+ githubTitle: z47.string().max(500).optional(),
6493
+ githubUrl: z47.string().url().optional(),
6494
+ rateLimit: z47.object({
6495
+ bucket: z47.enum(["core", "search"]),
6496
+ remaining: z47.number().int().nonnegative().optional(),
6497
+ resetAt: z47.string().datetime().optional()
6458
6498
  }).passthrough().optional()
6459
6499
  }).passthrough();
6460
6500
  function storedIsOnceSchedule(definition) {
@@ -6468,224 +6508,224 @@ function storedIsScheduleAutomation(definition) {
6468
6508
  }
6469
6509
 
6470
6510
  // ../contract/src/automation-requests.ts
6471
- var automationEditableSchema = z47.object({
6472
- name: z47.string().trim().min(1).max(200),
6473
- description: z47.string().max(2e3).optional(),
6474
- enabled: z47.boolean().optional(),
6511
+ var automationEditableSchema = z48.object({
6512
+ name: z48.string().trim().min(1).max(200),
6513
+ description: z48.string().max(2e3).optional(),
6514
+ enabled: z48.boolean().optional(),
6475
6515
  kind: automationKindSchema.optional(),
6476
- events: z47.array(automationEventSchema).min(1).max(4).optional(),
6477
- intervalSeconds: z47.number().int().min(60).max(86400).optional(),
6516
+ events: z48.array(automationEventSchema).min(1).max(4).optional(),
6517
+ intervalSeconds: z48.number().int().min(60).max(86400).optional(),
6478
6518
  filters: storedAutomationFiltersSchema.optional(),
6479
6519
  schedule: automationScheduleSchema.optional(),
6480
- task: z47.strictObject(storedAutomationTaskSchema.shape).omit({ variants: true }).refine((task) => !(task.workflow && task.steps), {
6520
+ task: z48.strictObject(storedAutomationTaskSchema.shape).omit({ variants: true }).refine((task) => !(task.workflow && task.steps), {
6481
6521
  message: "task selects either a named workflow or inline steps, not both"
6482
6522
  })
6483
6523
  }).strict();
6484
- var automationCreateSchema = automationEditableSchema.extend({ enable: z47.boolean().optional() });
6485
- var automationUpdateSchema = automationEditableSchema.extend({ expectedRevision: z47.number().int().positive() });
6486
- var automationCheckRequestSchema = z47.object({ mode: z47.enum(["preview", "execute"]) }).strict();
6487
- var automationLogQuerySchema = z47.object({
6488
- automationId: z47.string().optional(),
6524
+ var automationCreateSchema = automationEditableSchema.extend({ enable: z48.boolean().optional() });
6525
+ var automationUpdateSchema = automationEditableSchema.extend({ expectedRevision: z48.number().int().positive() });
6526
+ var automationCheckRequestSchema = z48.object({ mode: z48.enum(["preview", "execute"]) }).strict();
6527
+ var automationLogQuerySchema = z48.object({
6528
+ automationId: z48.string().optional(),
6489
6529
  result: automationLogResultSchema.optional(),
6490
6530
  event: automationEventSchema.optional(),
6491
- since: z47.string().datetime().optional(),
6492
- cursor: z47.coerce.number().int().positive().optional(),
6531
+ since: z48.string().datetime().optional(),
6532
+ cursor: z48.coerce.number().int().positive().optional(),
6493
6533
  // Optional, not `.default(100)`: `AutomationStore.logs` already clamps `limit ?? 100` into
6494
6534
  // 1..100, so the default here was a second copy of it — and a defaulted key is REQUIRED in the
6495
6535
  // request type `queryZodValidator` publishes (see validators.ts on why the request side falls
6496
6536
  // back to the schema's output), which would have made every caller send a `?limit=` this route
6497
6537
  // never needed.
6498
- limit: z47.coerce.number().int().min(1).max(100).optional()
6538
+ limit: z48.coerce.number().int().min(1).max(100).optional()
6499
6539
  });
6500
6540
 
6501
6541
  // ../contract/src/workflow-requests.ts
6502
- import { z as z48 } from "zod";
6503
- var planSchema = z48.object({
6542
+ import { z as z49 } from "zod";
6543
+ var planSchema = z49.object({
6504
6544
  // Same bound as `createRunInputSchema.task` — this flows into `planChain` (legacy reference 429).
6505
- task: z48.string().trim().min(1).max(1e5, "must be at most 100000 characters"),
6545
+ task: z49.string().trim().min(1).max(1e5, "must be at most 100000 characters"),
6506
6546
  /** The account the planner runs on, as `POST /runs` takes it: absent follows the project's
6507
6547
  * selection (hearsay-tools/squawk#4116). */
6508
- agentProfile: z48.string().max(64).optional()
6548
+ agentProfile: z49.string().max(64).optional()
6509
6549
  });
6510
- var parseWorkflowSchema = z48.object({
6511
- yaml: z48.string().min(1).max(1e5)
6550
+ var parseWorkflowSchema = z49.object({
6551
+ yaml: z49.string().min(1).max(1e5)
6512
6552
  });
6513
6553
 
6514
6554
  // ../contract/src/ui-state-requests.ts
6515
- import { z as z49 } from "zod";
6555
+ import { z as z50 } from "zod";
6516
6556
  var SKILL_USAGE_MAX_ENTRIES = 200;
6517
6557
  var UI_STATE_MAX_KEYS = 200;
6518
6558
  var uiStateSchema2 = uiStateSchema.extend({
6519
6559
  // null records a quick task with no selected skill or workflow.
6520
- lastTask: z49.object({
6521
- source: z49.enum(["workflow", "skill"]),
6522
- ref: z49.string().min(1).max(200)
6560
+ lastTask: z50.object({
6561
+ source: z50.enum(["workflow", "skill"]),
6562
+ ref: z50.string().min(1).max(200)
6523
6563
  }).nullable().optional(),
6524
6564
  // Most recent source choices, newest first.
6525
- recentSources: z49.array(
6526
- z49.object({
6527
- source: z49.enum(["workflow", "skill"]),
6528
- ref: z49.string().min(1).max(200)
6565
+ recentSources: z50.array(
6566
+ z50.object({
6567
+ source: z50.enum(["workflow", "skill"]),
6568
+ ref: z50.string().min(1).max(200)
6529
6569
  })
6530
6570
  ).max(50).optional(),
6531
- skillUsage: z49.record(z49.string().min(1).max(200), z49.number().int().min(0).max(1e6)).refine((usage) => Object.keys(usage).length <= SKILL_USAGE_MAX_ENTRIES, {
6571
+ skillUsage: z50.record(z50.string().min(1).max(200), z50.number().int().min(0).max(1e6)).refine((usage) => Object.keys(usage).length <= SKILL_USAGE_MAX_ENTRIES, {
6532
6572
  message: `skillUsage must have at most ${SKILL_USAGE_MAX_ENTRIES} entries`
6533
6573
  }).optional(),
6534
- promptTemplates: z49.array(
6535
- z49.object({
6536
- id: z49.string().min(1).max(64),
6537
- label: z49.string().trim().min(1).max(80),
6538
- text: z49.string().trim().min(1).max(2e3),
6574
+ promptTemplates: z50.array(
6575
+ z50.object({
6576
+ id: z50.string().min(1).max(64),
6577
+ label: z50.string().trim().min(1).max(80),
6578
+ text: z50.string().trim().min(1).max(2e3),
6539
6579
  // Skill names this template auto-applies for. Optional and additive: templates
6540
6580
  // written before this key existed keep validating, and stay manual-only.
6541
- skills: z49.array(z49.string().trim().min(1).max(200)).max(50).optional()
6581
+ skills: z50.array(z50.string().trim().min(1).max(200)).max(50).optional()
6542
6582
  })
6543
6583
  ).max(50).optional()
6544
6584
  }).passthrough();
6545
6585
  function capUiStateKeys(data, ctx) {
6546
6586
  if (Object.keys(data).length > UI_STATE_MAX_KEYS) {
6547
- ctx.addIssue({ code: z49.ZodIssueCode.custom, message: `ui-state has too many keys (max ${UI_STATE_MAX_KEYS})` });
6587
+ ctx.addIssue({ code: z50.ZodIssueCode.custom, message: `ui-state has too many keys (max ${UI_STATE_MAX_KEYS})` });
6548
6588
  }
6549
6589
  }
6550
6590
  var uiStateBody = uiStateSchema2.superRefine(capUiStateKeys);
6551
6591
 
6552
6592
  // ../contract/src/run-requests.ts
6553
- import { z as z50 } from "zod";
6554
- var queuedMessagePatchSchema = z50.object({
6555
- text: z50.string().max(1e5).optional(),
6556
- images: z50.array(attachmentInputSchema).max(4).optional()
6593
+ import { z as z51 } from "zod";
6594
+ var queuedMessagePatchSchema = z51.object({
6595
+ text: z51.string().max(1e5).optional(),
6596
+ images: z51.array(attachmentInputSchema).max(4).optional()
6557
6597
  }).refine((m) => m.text !== void 0 || m.images !== void 0, {
6558
6598
  message: "message edit needs text or attachments"
6559
6599
  });
6560
- var continueSchema = z50.object({
6561
- text: z50.string().max(1e5, "must be at most 100000 characters").optional(),
6562
- images: z50.array(attachmentInputSchema).max(4).optional(),
6600
+ var continueSchema = z51.object({
6601
+ text: z51.string().max(1e5, "must be at most 100000 characters").optional(),
6602
+ images: z51.array(attachmentInputSchema).max(4).optional(),
6563
6603
  runner: runnerSchema.optional(),
6564
- model: z50.string().max(200).optional(),
6604
+ model: z51.string().max(200).optional(),
6565
6605
  /** Reasoning-effort pin (legacy reference 45). Omitted keeps the run's pin; empty string clears it. */
6566
- effort: z50.string().max(32).optional()
6606
+ effort: z51.string().max(32).optional()
6567
6607
  });
6568
- var archiveSchema = z50.object({
6569
- archived: z50.boolean().optional()
6608
+ var archiveSchema = z51.object({
6609
+ archived: z51.boolean().optional()
6570
6610
  });
6571
- var openInSchema = z50.object({
6611
+ var openInSchema = z51.object({
6572
6612
  // A short bound (legacy reference 429): matched against a downstream allowlist, so an editor id is never long.
6573
- target: z50.string().trim().min(1, "target required").max(200),
6574
- path: z50.string().max(1e3).optional()
6613
+ target: z51.string().trim().min(1, "target required").max(200),
6614
+ path: z51.string().max(1e3).optional()
6575
6615
  });
6576
6616
 
6577
6617
  // ../contract/src/query-requests.ts
6578
- import { z as z51 } from "zod";
6579
- var queryValue = z51.union([z51.string(), z51.array(z51.string()).transform((v) => v[0])]).optional();
6580
- var refreshQuery = z51.object({ refresh: queryValue });
6581
- var waitQuery = z51.object({ wait: queryValue });
6582
- var queryRunnerSchema = z51.union([z51.string(), z51.array(z51.string()).transform((v) => v[0])]).pipe(modelDiscoveryRunnerSchema);
6583
- var modelDiscoveryQuerySchema = z51.object({ runner: queryRunnerSchema, profileId: z51.string().max(64).optional() });
6584
- var strictRefreshQuerySchema = z51.object({ refresh: queryValue.refine((v) => v === void 0 || v === "1") });
6585
- var browseQuerySchema = z51.object({ path: queryValue, showHidden: queryValue });
6586
- var worktreeFilesQuerySchema = z51.object({ path: queryValue, raw: queryValue });
6587
- var commitQuerySchema = z51.object({ structured: queryValue });
6588
- var fileTextQuerySchema = z51.object({
6589
- path: z51.union([z51.string(), z51.array(z51.string()).transform((v) => v[0])]).pipe(z51.string().refine(isRepoRelativePath, "a path inside the repository"))
6618
+ import { z as z52 } from "zod";
6619
+ var queryValue = z52.union([z52.string(), z52.array(z52.string()).transform((v) => v[0])]).optional();
6620
+ var refreshQuery = z52.object({ refresh: queryValue });
6621
+ var waitQuery = z52.object({ wait: queryValue });
6622
+ var queryRunnerSchema = z52.union([z52.string(), z52.array(z52.string()).transform((v) => v[0])]).pipe(modelDiscoveryRunnerSchema);
6623
+ var modelDiscoveryQuerySchema = z52.object({ runner: queryRunnerSchema, profileId: z52.string().max(64).optional() });
6624
+ var strictRefreshQuerySchema = z52.object({ refresh: queryValue.refine((v) => v === void 0 || v === "1") });
6625
+ var browseQuerySchema = z52.object({ path: queryValue, showHidden: queryValue });
6626
+ var worktreeFilesQuerySchema = z52.object({ path: queryValue, raw: queryValue });
6627
+ var commitQuerySchema = z52.object({ structured: queryValue });
6628
+ var fileTextQuerySchema = z52.object({
6629
+ path: z52.union([z52.string(), z52.array(z52.string()).transform((v) => v[0])]).pipe(z52.string().refine(isRepoRelativePath, "a path inside the repository"))
6590
6630
  });
6591
6631
 
6592
6632
  // ../contract/src/github-requests.ts
6593
- import { z as z52 } from "zod";
6594
- var mergeNumberParams = z52.object({ number: z52.coerce.number().int().positive() });
6595
- var prChangesParams = z52.object({ number: z52.coerce.number().int().positive().safe() });
6596
- var prChangesQuery = z52.object({ refresh: queryValue.refine((v) => v === void 0 || v === "1") });
6597
- var mergeBodySchema = z52.object({
6598
- method: z52.enum(["merge", "squash", "rebase"]),
6599
- expectedHeadSha: z52.string().regex(/^[0-9a-f]{40}$/),
6600
- overrideRules: z52.boolean().optional().default(false)
6633
+ import { z as z53 } from "zod";
6634
+ var mergeNumberParams = z53.object({ number: z53.coerce.number().int().positive() });
6635
+ var prChangesParams = z53.object({ number: z53.coerce.number().int().positive().safe() });
6636
+ var prChangesQuery = z53.object({ refresh: queryValue.refine((v) => v === void 0 || v === "1") });
6637
+ var mergeBodySchema = z53.object({
6638
+ method: z53.enum(["merge", "squash", "rebase"]),
6639
+ expectedHeadSha: z53.string().regex(/^[0-9a-f]{40}$/),
6640
+ overrideRules: z53.boolean().optional().default(false)
6601
6641
  }).strict();
6602
- var githubChecksQuerySchema = z52.object({ prs: z52.string().min(1) });
6603
- var githubRefsQuerySchema = z52.object({ prs: z52.string().optional(), issues: z52.string().optional() });
6642
+ var githubChecksQuerySchema = z53.object({ prs: z53.string().min(1) });
6643
+ var githubRefsQuerySchema = z53.object({ prs: z53.string().optional(), issues: z53.string().optional() });
6604
6644
 
6605
6645
  // ../contract/src/repo-requests.ts
6606
- import { z as z53 } from "zod";
6607
- var gitCommitSchema = z53.object({
6608
- message: z53.string().trim().min(1, "must not be empty").max(5e3)
6646
+ import { z as z54 } from "zod";
6647
+ var gitCommitSchema = z54.object({
6648
+ message: z54.string().trim().min(1, "must not be empty").max(5e3)
6609
6649
  });
6610
- var reclaimWorktreeBodySchema = z53.object({
6611
- discardWork: z53.boolean().optional()
6650
+ var reclaimWorktreeBodySchema = z54.object({
6651
+ discardWork: z54.boolean().optional()
6612
6652
  });
6613
- var reclaimBodySchema = z53.union([
6614
- z53.object({
6615
- discardWork: z53.literal(true),
6616
- runIds: z53.array(z53.string().min(1)).min(1)
6653
+ var reclaimBodySchema = z54.union([
6654
+ z54.object({
6655
+ discardWork: z54.literal(true),
6656
+ runIds: z54.array(z54.string().min(1)).min(1)
6617
6657
  }),
6618
- z53.object({
6619
- discardWork: z53.literal(false).optional()
6658
+ z54.object({
6659
+ discardWork: z54.literal(false).optional()
6620
6660
  })
6621
6661
  ]);
6622
- var repoBranchSchema = z53.object({
6623
- name: z53.string().trim().min(1).max(200),
6624
- from: z53.string().trim().min(1).max(200).optional()
6662
+ var repoBranchSchema = z54.object({
6663
+ name: z54.string().trim().min(1).max(200),
6664
+ from: z54.string().trim().min(1).max(200).optional()
6625
6665
  });
6626
- var reclaimRunParamsSchema = z53.object({ runId: z53.string().min(1) });
6666
+ var reclaimRunParamsSchema = z54.object({ runId: z54.string().min(1) });
6627
6667
 
6628
6668
  // ../contract/src/config-requests.ts
6629
- import { z as z54 } from "zod";
6669
+ import { z as z55 } from "zod";
6630
6670
  var setConfigSchema = setConfigInputSchema.extend({
6631
- systemPrompt: z54.string().trim().max(2e4, "must be at most 20000 characters").nullable().optional()
6671
+ systemPrompt: z55.string().trim().max(2e4, "must be at most 20000 characters").nullable().optional()
6632
6672
  });
6633
- var setAgentConfigSchema = z54.object({
6634
- content: z54.string().max(2e6),
6635
- version: z54.string().nullable()
6673
+ var setAgentConfigSchema = z55.object({
6674
+ content: z55.string().max(2e6),
6675
+ version: z55.string().nullable()
6636
6676
  });
6637
6677
 
6638
6678
  // ../contract/src/workflow-file.ts
6639
- import { z as z55 } from "zod";
6640
- var workflowFileSchema = z55.object({
6641
- name: z55.string().min(1),
6642
- description: z55.string().optional(),
6643
- steps: z55.array(workflowStepDefSchema).min(1).optional(),
6644
- skills: z55.array(z55.string().trim().min(1)).min(1).optional()
6679
+ import { z as z56 } from "zod";
6680
+ var workflowFileSchema = z56.object({
6681
+ name: z56.string().min(1),
6682
+ description: z56.string().optional(),
6683
+ steps: z56.array(workflowStepDefSchema).min(1).optional(),
6684
+ skills: z56.array(z56.string().trim().min(1)).min(1).optional()
6645
6685
  }).refine((d) => Boolean(d.steps) !== Boolean(d.skills), {
6646
6686
  message: 'a workflow lists either "steps" or "skills", not both'
6647
6687
  });
6648
6688
 
6649
6689
  // ../contract/src/reports.ts
6650
- import { z as z56 } from "zod";
6690
+ import { z as z57 } from "zod";
6651
6691
  var REPORTS_QUERY_MAX = 1e3;
6652
- var cursorSchema = z56.string().min(1).max(1024);
6653
- var reportsQuerySchema = z56.object({
6654
- q: z56.string().max(REPORTS_QUERY_MAX).optional(),
6692
+ var cursorSchema = z57.string().min(1).max(1024);
6693
+ var reportsQuerySchema = z57.object({
6694
+ q: z57.string().max(REPORTS_QUERY_MAX).optional(),
6655
6695
  before: cursorSchema.optional(),
6656
- limit: z56.string().regex(/^(?:[1-9]|[1-9][0-9]|100)$/).transform(Number).optional()
6696
+ limit: z57.string().regex(/^(?:[1-9]|[1-9][0-9]|100)$/).transform(Number).optional()
6657
6697
  }).strict();
6658
- var reportSchema = z56.object({
6659
- id: z56.uuid(),
6660
- runId: z56.uuid(),
6661
- name: z56.string(),
6662
- title: z56.string(),
6663
- createdAt: z56.iso.datetime(),
6664
- size: z56.number().int().nonnegative(),
6665
- taskTitle: z56.string(),
6698
+ var reportSchema = z57.object({
6699
+ id: z57.uuid(),
6700
+ runId: z57.uuid(),
6701
+ name: z57.string(),
6702
+ title: z57.string(),
6703
+ createdAt: z57.iso.datetime(),
6704
+ size: z57.number().int().nonnegative(),
6705
+ taskTitle: z57.string(),
6666
6706
  taskStatus: runStatusSchema
6667
6707
  }).strict();
6668
- var reportsResponseSchema = z56.object({
6669
- reports: z56.array(reportSchema),
6708
+ var reportsResponseSchema = z57.object({
6709
+ reports: z57.array(reportSchema),
6670
6710
  nextCursor: cursorSchema.nullable(),
6671
6711
  // Counts all matching cached rows with readable source summaries before page content checks.
6672
6712
  // A missing-content row dropped while filling this page can lower total on the next request.
6673
- total: z56.number().int().nonnegative()
6713
+ total: z57.number().int().nonnegative()
6674
6714
  }).strict();
6675
- var reportsStateSchema = z56.object({
6676
- epoch: z56.uuid(),
6677
- generation: z56.number().int().nonnegative(),
6678
- metadataGeneration: z56.number().int().nonnegative()
6715
+ var reportsStateSchema = z57.object({
6716
+ epoch: z57.uuid(),
6717
+ generation: z57.number().int().nonnegative(),
6718
+ metadataGeneration: z57.number().int().nonnegative()
6679
6719
  }).strict();
6680
- var reportsMetadataSchema = z56.object({
6681
- runId: z56.uuid(),
6682
- taskTitle: z56.string(),
6720
+ var reportsMetadataSchema = z57.object({
6721
+ runId: z57.uuid(),
6722
+ taskTitle: z57.string(),
6683
6723
  taskStatus: runStatusSchema
6684
6724
  }).strict();
6685
- var reportsFrameSchema = z56.discriminatedUnion("type", [
6686
- reportsStateSchema.extend({ type: z56.literal("snapshot") }),
6687
- reportsStateSchema.extend({ type: z56.literal("content") }),
6688
- reportsStateSchema.extend({ type: z56.literal("metadata"), runs: z56.array(reportsMetadataSchema) })
6725
+ var reportsFrameSchema = z57.discriminatedUnion("type", [
6726
+ reportsStateSchema.extend({ type: z57.literal("snapshot") }),
6727
+ reportsStateSchema.extend({ type: z57.literal("content") }),
6728
+ reportsStateSchema.extend({ type: z57.literal("metadata"), runs: z57.array(reportsMetadataSchema) })
6689
6729
  ]);
6690
6730
 
6691
6731
  // ../contract/src/report-title.ts
@@ -6707,118 +6747,118 @@ function controlLocation(control, separator = " \u2192 ") {
6707
6747
  }
6708
6748
 
6709
6749
  // ../contract/src/home-recovery.ts
6710
- import { z as z57 } from "zod";
6750
+ import { z as z58 } from "zod";
6711
6751
  var HOME_FILE_PATTERN = /^(?:(?:config\.json(?:\.bak)?|agent-accounts\.json|hosts\.json|ui-state\.json|server\.json|server\.install\.lock)|(?:remote-settings|server-instances)\/[a-zA-Z0-9-]+\.(?:json|install\.lock)|mcp-tokens\/[a-zA-Z0-9-]+\.json)$/;
6712
- var homeFileSchema = z57.string().regex(HOME_FILE_PATTERN);
6713
- var recoveryFile = z57.object({
6752
+ var homeFileSchema = z58.string().regex(HOME_FILE_PATTERN);
6753
+ var recoveryFile = z58.object({
6714
6754
  file: homeFileSchema,
6715
- detectedAt: z57.iso.datetime(),
6716
- canRestore: z57.boolean()
6755
+ detectedAt: z58.iso.datetime(),
6756
+ canRestore: z58.boolean()
6717
6757
  });
6718
6758
  var HOME_RECOVERY_REASONS = ["reset", "outside-write", "legacy-change"];
6719
- var homeRecoveryFileSchema = z57.discriminatedUnion("reason", [
6720
- recoveryFile.extend({ reason: z57.literal("reset") }),
6721
- recoveryFile.extend({ reason: z57.literal("outside-write") }),
6722
- recoveryFile.extend({ reason: z57.literal("legacy-change"), canImport: z57.boolean() })
6759
+ var homeRecoveryFileSchema = z58.discriminatedUnion("reason", [
6760
+ recoveryFile.extend({ reason: z58.literal("reset") }),
6761
+ recoveryFile.extend({ reason: z58.literal("outside-write") }),
6762
+ recoveryFile.extend({ reason: z58.literal("legacy-change"), canImport: z58.boolean() })
6723
6763
  ]);
6724
- var homeRecoverySchema = z57.object({ files: z57.array(homeRecoveryFileSchema) });
6764
+ var homeRecoverySchema = z58.object({ files: z58.array(homeRecoveryFileSchema) });
6725
6765
  function filterHomeRecoveryReasons(value, reasons) {
6726
6766
  if (!value || typeof value !== "object" || !("files" in value) || !Array.isArray(value.files)) return value;
6727
6767
  return { ...value, files: value.files.filter((row) => !(row && typeof row === "object" && "reason" in row && typeof row.reason === "string" && !reasons.includes(row.reason))) };
6728
6768
  }
6729
- var homeRecoveryReaderSchema = z57.preprocess(
6769
+ var homeRecoveryReaderSchema = z58.preprocess(
6730
6770
  (value) => filterHomeRecoveryReasons(value, HOME_RECOVERY_REASONS),
6731
6771
  homeRecoverySchema
6732
6772
  );
6733
- var homeRecoveryActionSchema = z57.object({ file: homeFileSchema, detectedAt: z57.iso.datetime() }).strict();
6773
+ var homeRecoveryActionSchema = z58.object({ file: homeFileSchema, detectedAt: z58.iso.datetime() }).strict();
6734
6774
 
6735
6775
  // ../contract/src/runner-skills.ts
6736
- import { z as z58 } from "zod";
6737
- var runnerSkillScopeSchema = z58.enum(["repo", "user", "system", "other"]);
6738
- var runnerSkillsQuerySchema = z58.object({
6776
+ import { z as z59 } from "zod";
6777
+ var runnerSkillScopeSchema = z59.enum(["repo", "user", "system", "other"]);
6778
+ var runnerSkillsQuerySchema = z59.object({
6739
6779
  runner: queryRunnerSchema,
6740
- account: z58.string().min(1).max(64).optional(),
6741
- refresh: z58.literal("1").optional()
6780
+ account: z59.string().min(1).max(64).optional(),
6781
+ refresh: z59.literal("1").optional()
6742
6782
  });
6743
- var runnerSkillSchema = z58.object({
6744
- id: z58.string(),
6745
- name: z58.string(),
6746
- description: z58.string().optional(),
6783
+ var runnerSkillSchema = z59.object({
6784
+ id: z59.string(),
6785
+ name: z59.string(),
6786
+ description: z59.string().optional(),
6747
6787
  scope: runnerSkillScopeSchema.optional(),
6748
- plugin: z58.string().optional(),
6749
- path: z58.string().optional()
6788
+ plugin: z59.string().optional(),
6789
+ path: z59.string().optional()
6750
6790
  });
6751
- var runnerSkillProblemSchema = z58.object({ message: z58.string(), path: z58.string().optional() });
6752
- var runnerSkillListSchema = z58.object({
6791
+ var runnerSkillProblemSchema = z59.object({ message: z59.string(), path: z59.string().optional() });
6792
+ var runnerSkillListSchema = z59.object({
6753
6793
  runner: runnerSchema,
6754
- skills: z58.array(runnerSkillSchema),
6755
- problems: z58.array(runnerSkillProblemSchema),
6756
- source: z58.enum(["live", "cache", "unavailable"]),
6757
- reason: z58.string().optional()
6794
+ skills: z59.array(runnerSkillSchema),
6795
+ problems: z59.array(runnerSkillProblemSchema),
6796
+ source: z59.enum(["live", "cache", "unavailable"]),
6797
+ reason: z59.string().optional()
6758
6798
  });
6759
6799
 
6760
6800
  // ../contract/src/runner-install.ts
6761
- import { z as z59 } from "zod";
6762
- var runnerInstallParamsSchema = z59.object({ runner: runnerSchema });
6763
- var runnerInstallActionSchema = z59.object({ action: z59.enum(["check", "install", "update", "remove"]) });
6764
- var runnerInstallPhaseSchema = z59.enum(["idle", "checking", "downloading", "verifying", "extracting", "activating", "removing", "failed"]);
6765
- var runnerInstallStatusSchema = z59.object({
6766
- supported: z59.boolean(),
6767
- installedVersion: z59.string().nullable(),
6768
- latestVersion: z59.string().nullable(),
6769
- updateAvailable: z59.boolean(),
6801
+ import { z as z60 } from "zod";
6802
+ var runnerInstallParamsSchema = z60.object({ runner: runnerSchema });
6803
+ var runnerInstallActionSchema = z60.object({ action: z60.enum(["check", "install", "update", "remove"]) });
6804
+ var runnerInstallPhaseSchema = z60.enum(["idle", "checking", "downloading", "verifying", "extracting", "activating", "removing", "failed"]);
6805
+ var runnerInstallStatusSchema = z60.object({
6806
+ supported: z60.boolean(),
6807
+ installedVersion: z60.string().nullable(),
6808
+ latestVersion: z60.string().nullable(),
6809
+ updateAvailable: z60.boolean(),
6770
6810
  phase: runnerInstallPhaseSchema,
6771
- error: z59.string().nullable()
6811
+ error: z60.string().nullable()
6772
6812
  });
6773
6813
 
6774
6814
  // ../contract/src/automation-tool.ts
6775
- import { z as z60 } from "zod";
6815
+ import { z as z61 } from "zod";
6776
6816
  var repeatingAutomationInputSchema = automationCreateSchema.omit({ enabled: true, enable: true }).refine((value) => value.schedule?.type !== "once", "Use cezar_schedule_task for a one-time schedule.");
6777
- var id = z60.string().min(1).max(100);
6778
- var automationToolRequestSchema = z60.discriminatedUnion("action", [
6779
- z60.object({ action: z60.literal("create"), definition: repeatingAutomationInputSchema }).strict(),
6780
- z60.object({ action: z60.literal("show"), id }).strict(),
6781
- z60.object({ action: z60.literal("preview"), id }).strict(),
6782
- z60.object({ action: z60.literal("enable"), id, explicit: z60.boolean().optional() }).strict()
6817
+ var id = z61.string().min(1).max(100);
6818
+ var automationToolRequestSchema = z61.discriminatedUnion("action", [
6819
+ z61.object({ action: z61.literal("create"), definition: repeatingAutomationInputSchema }).strict(),
6820
+ z61.object({ action: z61.literal("show"), id }).strict(),
6821
+ z61.object({ action: z61.literal("preview"), id }).strict(),
6822
+ z61.object({ action: z61.literal("enable"), id, explicit: z61.boolean().optional() }).strict()
6783
6823
  ]);
6784
- var automationToolAnswerSchema = z60.union([
6785
- z60.object({
6786
- ok: z60.literal(true),
6824
+ var automationToolAnswerSchema = z61.union([
6825
+ z61.object({
6826
+ ok: z61.literal(true),
6787
6827
  automation: storedAutomationDefinitionSchema,
6788
- url: z60.string().optional(),
6789
- next_run_at: z60.string().optional(),
6790
- preview: z60.object({ matches: z60.number().int().nonnegative(), truncated: z60.boolean() }).optional()
6828
+ url: z61.string().optional(),
6829
+ next_run_at: z61.string().optional(),
6830
+ preview: z61.object({ matches: z61.number().int().nonnegative(), truncated: z61.boolean() }).optional()
6791
6831
  }),
6792
- z60.object({ ok: z60.literal(false), code: z60.enum([...scheduledTaskRefusalCodeSchema.options, "explicit_required", "preview_required"]), message: z60.string() })
6832
+ z61.object({ ok: z61.literal(false), code: z61.enum([...scheduledTaskRefusalCodeSchema.options, "explicit_required", "preview_required"]), message: z61.string() })
6793
6833
  ]);
6794
6834
 
6795
6835
  // ../contract/src/agent-tools.ts
6796
- import { z as z61 } from "zod";
6797
- var agentToolResultSchema = z61.object({
6798
- content: z61.array(z61.object({ type: z61.literal("text"), text: z61.string() })),
6799
- isError: z61.boolean().optional(),
6800
- details: z61.unknown()
6836
+ import { z as z62 } from "zod";
6837
+ var agentToolResultSchema = z62.object({
6838
+ content: z62.array(z62.object({ type: z62.literal("text"), text: z62.string() })),
6839
+ isError: z62.boolean().optional(),
6840
+ details: z62.unknown()
6801
6841
  });
6802
- var agentToolMetadataSchema = z61.object({
6803
- timeoutMs: z61.number().positive(),
6842
+ var agentToolMetadataSchema = z62.object({
6843
+ timeoutMs: z62.number().positive(),
6804
6844
  unavailable: agentToolResultSchema,
6805
- name: z61.string(),
6806
- description: z61.string(),
6807
- trigger: z61.string(),
6808
- label: z61.string(),
6809
- inputSchema: z61.object({ type: z61.literal("object"), properties: z61.record(z61.string(), z61.unknown()).optional() }).catchall(z61.unknown())
6845
+ name: z62.string(),
6846
+ description: z62.string(),
6847
+ trigger: z62.string(),
6848
+ label: z62.string(),
6849
+ inputSchema: z62.object({ type: z62.literal("object"), properties: z62.record(z62.string(), z62.unknown()).optional() }).catchall(z62.unknown())
6810
6850
  });
6811
- var agentToolCatalogSchema = z61.object({ tools: z61.array(agentToolMetadataSchema), instructions: z61.string() });
6851
+ var agentToolCatalogSchema = z62.object({ tools: z62.array(agentToolMetadataSchema), instructions: z62.string() });
6812
6852
 
6813
6853
  // ../contract/src/hosts.ts
6814
- import { z as z62 } from "zod";
6854
+ import { z as z63 } from "zod";
6815
6855
  var HOST_ID_PATTERN = /^[a-z0-9][a-z0-9-]{0,31}$/;
6816
6856
  var LOCAL_HOST_ID = "local";
6817
- var RESERVED_HOST_ROUTE_IDS = ["projects", "runs-index", "runs-search"];
6857
+ var RESERVED_HOST_ROUTE_IDS = ["projects", "runs-index", "runs-search", "signals"];
6818
6858
  var RESERVED_HOST_ROUTE_ID_SET = new Set(RESERVED_HOST_ROUTE_IDS);
6819
6859
  var CONTROL_CHARS_PATTERN = /[\u0000-\u001f\u007f]/;
6820
6860
  var INVALID_SSH_ALIAS_CHARS = /[\s*?![\]\\'"`]/;
6821
- var hostIdSchema = z62.string().regex(HOST_ID_PATTERN, "host id must match ^[a-z0-9][a-z0-9-]{0,31}$").refine((value) => value !== LOCAL_HOST_ID, {
6861
+ var hostIdSchema = z63.string().regex(HOST_ID_PATTERN, "host id must match ^[a-z0-9][a-z0-9-]{0,31}$").refine((value) => value !== LOCAL_HOST_ID, {
6822
6862
  message: `host id "${LOCAL_HOST_ID}" is reserved`
6823
6863
  });
6824
6864
  var createHostIdSchema = hostIdSchema.superRefine((value, ctx) => {
@@ -6829,17 +6869,17 @@ var createHostIdSchema = hostIdSchema.superRefine((value, ctx) => {
6829
6869
  });
6830
6870
  }
6831
6871
  });
6832
- var hostLabelSchema = z62.string().trim().min(1, "label must not be empty").max(255, "label must be at most 255 characters").refine((value) => !CONTROL_CHARS_PATTERN.test(value), {
6872
+ var hostLabelSchema = z63.string().trim().min(1, "label must not be empty").max(255, "label must be at most 255 characters").refine((value) => !CONTROL_CHARS_PATTERN.test(value), {
6833
6873
  message: "label must not contain control characters"
6834
6874
  });
6835
- var hostSshAliasSchema = z62.string().min(1, "sshAlias must not be empty").max(255, "sshAlias must be at most 255 characters").refine((value) => !CONTROL_CHARS_PATTERN.test(value), {
6875
+ var hostSshAliasSchema = z63.string().min(1, "sshAlias must not be empty").max(255, "sshAlias must be at most 255 characters").refine((value) => !CONTROL_CHARS_PATTERN.test(value), {
6836
6876
  message: "sshAlias must not contain control characters"
6837
6877
  }).refine((value) => !INVALID_SSH_ALIAS_CHARS.test(value), {
6838
6878
  message: "sshAlias must not contain whitespace, quotes, or wildcard characters"
6839
6879
  }).refine((value) => !value.startsWith("-"), {
6840
6880
  message: 'sshAlias must not start with "-"'
6841
6881
  });
6842
- var hostPortSchema = z62.number().int("port must be an integer").min(1, "port must be between 1 and 65535").max(65535, "port must be between 1 and 65535");
6882
+ var hostPortSchema = z63.number().int("port must be an integer").min(1, "port must be between 1 and 65535").max(65535, "port must be between 1 and 65535");
6843
6883
  function slugHostId(sshAlias) {
6844
6884
  return sshAlias.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 32).replace(/-+$/g, "");
6845
6885
  }
@@ -6855,19 +6895,19 @@ var HOST_STATES = [
6855
6895
  "paused",
6856
6896
  "cannot-persist"
6857
6897
  ];
6858
- var hostStateSchema = z62.enum(HOST_STATES);
6898
+ var hostStateSchema = z63.enum(HOST_STATES);
6859
6899
  var HOST_NOT_CONNECTED_REASON = "not connected yet";
6860
- var hostEntrySchema = z62.object({
6900
+ var hostEntrySchema = z63.object({
6861
6901
  id: hostIdSchema,
6862
6902
  label: hostLabelSchema,
6863
- kind: z62.literal("ssh"),
6903
+ kind: z63.literal("ssh"),
6864
6904
  sshAlias: hostSshAliasSchema,
6865
- installId: z62.string().min(1).max(128).optional(),
6905
+ installId: z63.string().min(1).max(128).optional(),
6866
6906
  port: hostPortSchema.optional(),
6867
- addedAt: z62.iso.datetime()
6907
+ addedAt: z63.iso.datetime()
6868
6908
  });
6869
- var hostsRegistryFileSchema = z62.object({
6870
- hosts: z62.array(hostEntrySchema)
6909
+ var hostsRegistryFileSchema = z63.object({
6910
+ hosts: z63.array(hostEntrySchema)
6871
6911
  }).superRefine((data, ctx) => {
6872
6912
  const seen = /* @__PURE__ */ new Set();
6873
6913
  for (const [index, entry] of data.hosts.entries()) {
@@ -6881,26 +6921,26 @@ var hostsRegistryFileSchema = z62.object({
6881
6921
  seen.add(entry.id);
6882
6922
  }
6883
6923
  });
6884
- var hostSummarySchema = z62.object({
6924
+ var hostSummarySchema = z63.object({
6885
6925
  id: hostIdSchema,
6886
6926
  label: hostLabelSchema,
6887
6927
  state: hostStateSchema,
6888
- reason: z62.string().optional(),
6889
- kind: z62.literal("ssh").optional(),
6928
+ reason: z63.string().optional(),
6929
+ kind: z63.literal("ssh").optional(),
6890
6930
  sshAlias: hostSshAliasSchema.optional(),
6891
- installId: z62.string().min(1).max(128).optional(),
6931
+ installId: z63.string().min(1).max(128).optional(),
6892
6932
  port: hostPortSchema.optional(),
6893
- addedAt: z62.iso.datetime().optional()
6933
+ addedAt: z63.iso.datetime().optional()
6894
6934
  });
6895
- var hostsListResponseSchema = z62.object({
6896
- hosts: z62.array(hostSummarySchema),
6897
- warning: z62.string().optional(),
6898
- sshSuggestions: z62.array(hostSshAliasSchema).optional()
6935
+ var hostsListResponseSchema = z63.object({
6936
+ hosts: z63.array(hostSummarySchema),
6937
+ warning: z63.string().optional(),
6938
+ sshSuggestions: z63.array(hostSshAliasSchema).optional()
6899
6939
  });
6900
- var hostRouteParamsSchema = z62.object({
6940
+ var hostRouteParamsSchema = z63.object({
6901
6941
  id: hostIdSchema
6902
6942
  });
6903
- var createHostInputSchema = z62.object({
6943
+ var createHostInputSchema = z63.object({
6904
6944
  sshAlias: hostSshAliasSchema,
6905
6945
  id: createHostIdSchema.optional(),
6906
6946
  label: hostLabelSchema.optional(),
@@ -6917,7 +6957,7 @@ var createHostInputSchema = z62.object({
6917
6957
  });
6918
6958
  }
6919
6959
  });
6920
- var updateHostInputSchema = z62.object({
6960
+ var updateHostInputSchema = z63.object({
6921
6961
  label: hostLabelSchema.optional(),
6922
6962
  sshAlias: hostSshAliasSchema.optional(),
6923
6963
  port: hostPortSchema.nullable().optional()
@@ -6925,96 +6965,96 @@ var updateHostInputSchema = z62.object({
6925
6965
  (data) => data.label !== void 0 || data.sshAlias !== void 0 || data.port !== void 0,
6926
6966
  { message: "at least one of label, sshAlias, or port must be provided" }
6927
6967
  );
6928
- var hostResponseSchema = z62.object({
6968
+ var hostResponseSchema = z63.object({
6929
6969
  host: hostSummarySchema
6930
6970
  });
6931
- var removeHostResponseSchema = z62.object({
6932
- removed: z62.literal(true),
6971
+ var removeHostResponseSchema = z63.object({
6972
+ removed: z63.literal(true),
6933
6973
  id: hostIdSchema
6934
6974
  });
6935
- var hostStarterInstallIdSchema = z62.string().regex(
6975
+ var hostStarterInstallIdSchema = z63.string().regex(
6936
6976
  /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/,
6937
6977
  "starterInstallId must be 1\u2013128 alphanumeric, dot, underscore, or hyphen characters"
6938
6978
  );
6939
- var hostServerStartMethodSchema = z62.enum(["systemd-user", "detached"]);
6940
- var hostServerClaimPhaseSchema = z62.enum(["starting", "running"]);
6941
- var hostServerClaimSummarySchema = z62.object({
6942
- pid: z62.number().int().positive(),
6979
+ var hostServerStartMethodSchema = z63.enum(["systemd-user", "detached"]);
6980
+ var hostServerClaimPhaseSchema = z63.enum(["starting", "running"]);
6981
+ var hostServerClaimSummarySchema = z63.object({
6982
+ pid: z63.number().int().positive(),
6943
6983
  phase: hostServerClaimPhaseSchema,
6944
6984
  port: hostPortSchema.nullable(),
6945
- version: z62.string().min(1),
6985
+ version: z63.string().min(1),
6946
6986
  starterInstallId: hostStarterInstallIdSchema,
6947
- managedByStarter: z62.boolean().optional()
6987
+ managedByStarter: z63.boolean().optional()
6948
6988
  });
6949
- var hostServerLeaseSummarySchema = z62.object({
6950
- pid: z62.number().int().positive(),
6989
+ var hostServerLeaseSummarySchema = z63.object({
6990
+ pid: z63.number().int().positive(),
6951
6991
  port: hostPortSchema,
6952
- instance: z62.string(),
6953
- installId: z62.string().min(1).max(128)
6954
- });
6955
- var installIdFieldSchema = z62.string().min(1).max(128);
6956
- var hostServerEnsureResultSchema = z62.discriminatedUnion("status", [
6957
- z62.object({
6958
- status: z62.literal("ready"),
6959
- ownership: z62.enum(["managed", "unmanaged"]),
6992
+ instance: z63.string(),
6993
+ installId: z63.string().min(1).max(128)
6994
+ });
6995
+ var installIdFieldSchema = z63.string().min(1).max(128);
6996
+ var hostServerEnsureResultSchema = z63.discriminatedUnion("status", [
6997
+ z63.object({
6998
+ status: z63.literal("ready"),
6999
+ ownership: z63.enum(["managed", "unmanaged"]),
6960
7000
  port: hostPortSchema,
6961
- pid: z62.number().int().positive().optional(),
6962
- version: z62.string().min(1).optional(),
7001
+ pid: z63.number().int().positive().optional(),
7002
+ version: z63.string().min(1).optional(),
6963
7003
  starterInstallId: hostStarterInstallIdSchema.optional(),
6964
- managedByStarter: z62.boolean().optional(),
7004
+ managedByStarter: z63.boolean().optional(),
6965
7005
  startMethod: hostServerStartMethodSchema.optional(),
6966
7006
  installId: installIdFieldSchema.optional()
6967
7007
  }),
6968
- z62.object({
6969
- status: z62.literal("paused"),
7008
+ z63.object({
7009
+ status: z63.literal("paused"),
6970
7010
  starterInstallId: hostStarterInstallIdSchema,
6971
7011
  installId: installIdFieldSchema.optional()
6972
7012
  }),
6973
- z62.object({
6974
- status: z62.literal("unreachable"),
7013
+ z63.object({
7014
+ status: z63.literal("unreachable"),
6975
7015
  port: hostPortSchema,
6976
- reason: z62.string().min(1),
7016
+ reason: z63.string().min(1),
6977
7017
  installId: installIdFieldSchema.optional()
6978
7018
  }),
6979
- z62.object({
6980
- status: z62.literal("several-servers"),
6981
- ports: z62.array(hostPortSchema).min(2),
6982
- reason: z62.string().min(1),
7019
+ z63.object({
7020
+ status: z63.literal("several-servers"),
7021
+ ports: z63.array(hostPortSchema).min(2),
7022
+ reason: z63.string().min(1),
6983
7023
  installId: installIdFieldSchema.optional()
6984
7024
  }),
6985
- z62.object({
6986
- status: z62.literal("cannot-persist"),
6987
- operatorCommand: z62.string().min(1),
6988
- reason: z62.string().min(1),
7025
+ z63.object({
7026
+ status: z63.literal("cannot-persist"),
7027
+ operatorCommand: z63.string().min(1),
7028
+ reason: z63.string().min(1),
6989
7029
  installId: installIdFieldSchema.optional()
6990
7030
  }),
6991
- z62.object({
6992
- status: z62.literal("error"),
6993
- code: z62.enum(["unreadable-store", "unreadable-leases", "timeout", "start-failed", "invalid-input"]),
6994
- error: z62.string().min(1),
6995
- dbPath: z62.string().min(1).optional()
7031
+ z63.object({
7032
+ status: z63.literal("error"),
7033
+ code: z63.enum(["unreadable-store", "unreadable-leases", "timeout", "start-failed", "invalid-input"]),
7034
+ error: z63.string().min(1),
7035
+ dbPath: z63.string().min(1).optional()
6996
7036
  })
6997
7037
  ]);
6998
- var hostServerStatusResultSchema = z62.object({
6999
- ok: z62.literal(true),
7000
- version: z62.string().min(1),
7001
- installId: z62.string().min(1).max(128).nullable(),
7002
- dbPath: z62.string().min(1),
7003
- paused: z62.boolean(),
7038
+ var hostServerStatusResultSchema = z63.object({
7039
+ ok: z63.literal(true),
7040
+ version: z63.string().min(1),
7041
+ installId: z63.string().min(1).max(128).nullable(),
7042
+ dbPath: z63.string().min(1),
7043
+ paused: z63.boolean(),
7004
7044
  claim: hostServerClaimSummarySchema.nullable(),
7005
- leases: z62.array(hostServerLeaseSummarySchema),
7006
- state: z62.enum(["ready", "starting", "paused", "stopped", "several-servers", "unreachable"])
7045
+ leases: z63.array(hostServerLeaseSummarySchema),
7046
+ state: z63.enum(["ready", "starting", "paused", "stopped", "several-servers", "unreachable"])
7007
7047
  });
7008
- var hostServerStopResultSchema = z62.object({
7009
- ok: z62.literal(true),
7010
- action: z62.literal("stop"),
7048
+ var hostServerStopResultSchema = z63.object({
7049
+ ok: z63.literal(true),
7050
+ action: z63.literal("stop"),
7011
7051
  starterInstallId: hostStarterInstallIdSchema,
7012
- paused: z62.literal(true),
7013
- stopped: z62.boolean(),
7014
- pid: z62.number().int().positive().optional(),
7052
+ paused: z63.literal(true),
7053
+ stopped: z63.boolean(),
7054
+ pid: z63.number().int().positive().optional(),
7015
7055
  phase: hostServerClaimPhaseSchema.optional(),
7016
7056
  port: hostPortSchema.nullable().optional(),
7017
- reason: z62.enum([
7057
+ reason: z63.enum([
7018
7058
  "stopped",
7019
7059
  "already-exited",
7020
7060
  "signal-failed",
@@ -7023,26 +7063,26 @@ var hostServerStopResultSchema = z62.object({
7023
7063
  "unverifiable-process"
7024
7064
  ]).optional()
7025
7065
  });
7026
- var hostServerResumeResultSchema = z62.object({
7027
- ok: z62.literal(true),
7028
- action: z62.literal("resume"),
7066
+ var hostServerResumeResultSchema = z63.object({
7067
+ ok: z63.literal(true),
7068
+ action: z63.literal("resume"),
7029
7069
  starterInstallId: hostStarterInstallIdSchema,
7030
- paused: z62.literal(false),
7031
- wasPaused: z62.boolean()
7032
- });
7033
- var hostServerInstallRuntimeResultSchema = z62.object({
7034
- ok: z62.literal(true),
7035
- action: z62.literal("install-runtime"),
7036
- version: z62.string().min(1),
7037
- runtimeDir: z62.string().min(1),
7038
- alreadyInstalled: z62.boolean(),
7039
- prunedVersions: z62.array(z62.string())
7040
- });
7041
- var hostServerActiveTasksResultSchema = z62.object({
7042
- ok: z62.literal(true),
7043
- action: z62.literal("active-tasks"),
7070
+ paused: z63.literal(false),
7071
+ wasPaused: z63.boolean()
7072
+ });
7073
+ var hostServerInstallRuntimeResultSchema = z63.object({
7074
+ ok: z63.literal(true),
7075
+ action: z63.literal("install-runtime"),
7076
+ version: z63.string().min(1),
7077
+ runtimeDir: z63.string().min(1),
7078
+ alreadyInstalled: z63.boolean(),
7079
+ prunedVersions: z63.array(z63.string())
7080
+ });
7081
+ var hostServerActiveTasksResultSchema = z63.object({
7082
+ ok: z63.literal(true),
7083
+ action: z63.literal("active-tasks"),
7044
7084
  port: hostPortSchema,
7045
- activeCount: z62.number().int().min(0)
7085
+ activeCount: z63.number().int().min(0)
7046
7086
  });
7047
7087
  var HOST_GATEWAY_ERROR_CODES = [
7048
7088
  "host-unreachable",
@@ -7055,97 +7095,114 @@ var HOST_GATEWAY_ERROR_CODES = [
7055
7095
  "host-unexpected-redirect",
7056
7096
  "host-nested-gateway-unsupported"
7057
7097
  ];
7058
- var hostGatewayErrorCodeSchema = z62.enum(HOST_GATEWAY_ERROR_CODES);
7059
- var hostGatewayErrorResponseSchema = z62.object({
7098
+ var hostGatewayErrorCodeSchema = z63.enum(HOST_GATEWAY_ERROR_CODES);
7099
+ var hostGatewayErrorResponseSchema = z63.object({
7060
7100
  code: hostGatewayErrorCodeSchema,
7061
- error: z62.string().min(1)
7101
+ error: z63.string().min(1)
7062
7102
  });
7063
- var hostProjectsEntrySchema = z62.object({
7103
+ var hostProjectsEntrySchema = z63.object({
7064
7104
  id: hostIdSchema,
7065
7105
  label: hostLabelSchema,
7066
7106
  state: hostStateSchema,
7067
- projects: z62.array(projectListEntrySchema).nullable()
7107
+ projects: z63.array(projectListEntrySchema).nullable()
7108
+ });
7109
+ var hostsProjectsResponseSchema = z63.object({
7110
+ local: z63.object({
7111
+ projects: z63.array(projectListEntrySchema),
7112
+ bootProject: z63.string().nullable()
7113
+ }),
7114
+ hosts: z63.array(hostProjectsEntrySchema),
7115
+ warning: z63.string().optional()
7068
7116
  });
7069
- var hostsProjectsResponseSchema = z62.object({
7070
- local: z62.object({
7071
- projects: z62.array(projectListEntrySchema),
7072
- bootProject: z62.string().nullable()
7117
+ var projectSignalsRecordSchema = z63.record(z63.string(), projectSignalSchema);
7118
+ var hostSignalsEntrySchema = z63.object({
7119
+ id: hostIdSchema,
7120
+ state: hostStateSchema,
7121
+ /** True when the host is connected, loaded, and not stale so omitted projects are idle. */
7122
+ known: z63.boolean(),
7123
+ /** Non-zero per-project counts when `known` is true; empty when `known` is false. */
7124
+ signals: projectSignalsRecordSchema
7125
+ });
7126
+ var hostsSignalsResponseSchema = z63.object({
7127
+ local: z63.object({
7128
+ known: z63.boolean(),
7129
+ signals: projectSignalsRecordSchema
7073
7130
  }),
7074
- hosts: z62.array(hostProjectsEntrySchema),
7075
- warning: z62.string().optional()
7131
+ hosts: z63.array(hostSignalsEntrySchema),
7132
+ warning: z63.string().optional()
7076
7133
  });
7077
7134
  var hostRunIndexEntrySchema = runIndexEntrySchema.extend({
7078
7135
  hostId: hostIdSchema
7079
7136
  });
7080
- var hostRunsIndexStateSchema = z62.object({
7137
+ var hostRunsIndexStateSchema = z63.object({
7081
7138
  id: hostIdSchema,
7082
7139
  label: hostLabelSchema,
7083
7140
  state: hostStateSchema,
7084
7141
  /** True while the host is not connected and live-synced; cached rows may be behind the host. */
7085
- stale: z62.boolean(),
7142
+ stale: z63.boolean(),
7086
7143
  /** True once the main server has read the host's task index at least once since starting. */
7087
- loaded: z62.boolean(),
7144
+ loaded: z63.boolean(),
7088
7145
  /** Project ids on this host that hit `perProjectLimit` for archived root runs. */
7089
- truncated: z62.array(z62.string()),
7146
+ truncated: z63.array(z63.string()),
7090
7147
  /** Cached PR/issue reference statuses per project id from the host's latest snapshot. */
7091
7148
  referenceStatuses: referenceStatusesByProjectSchema,
7092
7149
  /** Per-project archived window reported by the host's latest snapshot, when loaded. */
7093
- perProjectLimit: z62.number().int().nonnegative().optional()
7150
+ perProjectLimit: z63.number().int().nonnegative().optional()
7094
7151
  });
7095
- var hostsRunsIndexQuerySchema = z62.object({
7152
+ var hostsRunsIndexQuerySchema = z63.object({
7096
7153
  /** When set, returns rows and state for that single saved host only. */
7097
7154
  hostId: hostIdSchema.optional()
7098
7155
  });
7099
- var hostsRunsIndexResponseSchema = z62.object({
7100
- runs: z62.array(hostRunIndexEntrySchema),
7101
- hosts: z62.array(hostRunsIndexStateSchema),
7102
- generation: z62.string().min(1),
7103
- eventSeq: z62.number().int().nonnegative(),
7104
- warning: z62.string().optional()
7156
+ var hostsRunsIndexResponseSchema = z63.object({
7157
+ runs: z63.array(hostRunIndexEntrySchema),
7158
+ hosts: z63.array(hostRunsIndexStateSchema),
7159
+ generation: z63.string().min(1),
7160
+ eventSeq: z63.number().int().nonnegative(),
7161
+ warning: z63.string().optional()
7105
7162
  });
7106
7163
  var HOST_SEARCH_UNANSWERED_REASONS = ["not-connected", "deadline", "error"];
7107
- var hostSearchUnansweredReasonSchema = z62.enum(HOST_SEARCH_UNANSWERED_REASONS);
7108
- var hostSearchUnansweredSchema = z62.object({
7164
+ var hostSearchUnansweredReasonSchema = z63.enum(HOST_SEARCH_UNANSWERED_REASONS);
7165
+ var hostSearchUnansweredSchema = z63.object({
7109
7166
  hostId: hostIdSchema,
7110
7167
  label: hostLabelSchema,
7111
7168
  state: hostStateSchema,
7112
7169
  reason: hostSearchUnansweredReasonSchema
7113
7170
  });
7114
- var hostTruncatedProjectSchema = z62.object({
7171
+ var hostTruncatedProjectSchema = z63.object({
7115
7172
  hostId: hostIdSchema,
7116
- projectId: z62.string()
7173
+ projectId: z63.string()
7117
7174
  });
7118
- var hostsRunsSearchResponseSchema = z62.object({
7119
- runs: z62.array(hostRunIndexEntrySchema),
7120
- truncated: z62.array(hostTruncatedProjectSchema),
7121
- unanswered: z62.array(hostSearchUnansweredSchema),
7122
- warning: z62.string().optional()
7175
+ var hostsRunsSearchResponseSchema = z63.object({
7176
+ runs: z63.array(hostRunIndexEntrySchema),
7177
+ truncated: z63.array(hostTruncatedProjectSchema),
7178
+ unanswered: z63.array(hostSearchUnansweredSchema),
7179
+ warning: z63.string().optional()
7123
7180
  });
7124
7181
  var HOSTS_CHANGED_EVENT = "hosts-changed";
7125
- var hostsChangedEventSchema = z62.object({
7126
- hostIds: z62.array(hostIdSchema).min(1),
7127
- stateChanged: z62.boolean(),
7128
- indexChanged: z62.boolean()
7182
+ var hostsChangedEventSchema = z63.object({
7183
+ hostIds: z63.array(hostIdSchema).min(1),
7184
+ stateChanged: z63.boolean(),
7185
+ indexChanged: z63.boolean()
7129
7186
  });
7130
7187
  var HOST_RUN_SUMMARY_EVENT = "host-run-summary";
7131
- var hostRunSummaryEventSchema = z62.object({
7188
+ var hostRunSummaryEventSchema = z63.object({
7132
7189
  hostId: hostIdSchema,
7133
- project: z62.string().min(1),
7134
- seq: z62.number().int().positive(),
7190
+ project: z63.string().min(1),
7191
+ seq: z63.number().int().positive(),
7135
7192
  run: runSummarySchema
7136
7193
  });
7137
7194
  var HOST_RUN_DELETED_EVENT = "host-run-deleted";
7138
- var hostRunDeletedEventSchema = z62.object({
7195
+ var hostRunDeletedEventSchema = z63.object({
7139
7196
  hostId: hostIdSchema,
7140
- project: z62.string().min(1),
7141
- seq: z62.number().int().positive(),
7142
- id: z62.string().min(1)
7197
+ project: z63.string().min(1),
7198
+ seq: z63.number().int().positive(),
7199
+ id: z63.string().min(1)
7143
7200
  });
7144
7201
  var HOST_USAGE_EVENT = "host-usage";
7145
- var hostUsageEventSchema = z62.object({
7202
+ var hostUsageEventSchema = z63.object({
7146
7203
  hostId: hostIdSchema,
7147
- project: z62.string().min(1),
7148
- usage: z62.record(z62.string(), processUsageSchema)
7204
+ project: z63.string().min(1),
7205
+ usage: z63.record(z63.string(), processUsageSchema)
7149
7206
  });
7150
7207
  export {
7151
7208
  ACTIVITY_CHECKS_MAX,
@@ -7455,6 +7512,7 @@ export {
7455
7512
  editQueuedMessageResponseSchema,
7456
7513
  effortFieldSchema,
7457
7514
  effortLevelSchema,
7515
+ emptyProjectSignal,
7458
7516
  encodeConversationCursor,
7459
7517
  engineOwnsRun,
7460
7518
  exactLineIndex,
@@ -7538,6 +7596,7 @@ export {
7538
7596
  hostServerStartMethodSchema,
7539
7597
  hostServerStatusResultSchema,
7540
7598
  hostServerStopResultSchema,
7599
+ hostSignalsEntrySchema,
7541
7600
  hostSshAliasSchema,
7542
7601
  hostStarterInstallIdSchema,
7543
7602
  hostStateSchema,
@@ -7551,6 +7610,7 @@ export {
7551
7610
  hostsRunsIndexQuerySchema,
7552
7611
  hostsRunsIndexResponseSchema,
7553
7612
  hostsRunsSearchResponseSchema,
7613
+ hostsSignalsResponseSchema,
7554
7614
  humanAskClosedEventSchema,
7555
7615
  humanInputDeliveredEventSchema,
7556
7616
  humanWaitEntrySchema,
@@ -7576,6 +7636,7 @@ export {
7576
7636
  isUnread,
7577
7637
  isUsageLimitHold,
7578
7638
  isValidTimeZone,
7639
+ isZeroProjectSignal,
7579
7640
  isoWeekday,
7580
7641
  latestSession,
7581
7642
  latestSessionStep,
@@ -7682,6 +7743,10 @@ export {
7682
7743
  processWaitResultSchema,
7683
7744
  projectDelegationSummary,
7684
7745
  projectListEntrySchema,
7746
+ projectSignal,
7747
+ projectSignalSchema,
7748
+ projectSignalsEqual,
7749
+ projectSignalsRecordSchema,
7685
7750
  projectWebhookInputSchema,
7686
7751
  projectWebhookNameSchema,
7687
7752
  projectWebhookParamsSchema,
@@ -7776,6 +7841,7 @@ export {
7776
7841
  runPullRequestSchema,
7777
7842
  runRecordSchema,
7778
7843
  runRelationshipsSchema,
7844
+ runSignalCategory,
7779
7845
  runStatePreviewSchema,
7780
7846
  runStatusSchema,
7781
7847
  runSummariesQuerySchema,