@hearsay-tools/squawk 0.19.0-pr4668.9270 → 0.19.0-pr4669.9271

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