@hearsay-tools/squawk 0.18.0-pr3505.6261 → 0.18.0-pr3506.6281

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 (54) hide show
  1. package/dist/contract/index.js +492 -492
  2. package/dist/delegation/transport.d.ts +11 -11
  3. package/dist/runs/run-exits.d.ts +290 -290
  4. package/dist/workflows/input-acknowledgement.d.ts +24 -24
  5. package/package.json +4 -4
  6. package/web/dist/assets/activity-motion-DjMpx0QL.js +2 -0
  7. package/web/dist/assets/{activity-route-CcjiDVlr.js → activity-route-CE2cYbQO.js} +1 -1
  8. package/web/dist/assets/agent-accounts-BNlpWTOY.js +18 -0
  9. package/web/dist/assets/attention-VmnPpwJx.js +1 -0
  10. package/web/dist/assets/{cez-idle-xv7f96fc.js → cez-idle-NomdGTfa.js} +1 -1
  11. package/web/dist/assets/{commit-diff-panel-C071yAQE.js → commit-diff-panel-DBrsQdXO.js} +1 -1
  12. package/web/dist/assets/{diff-BnKrNzO6.js → diff-D81T6FlH.js} +2 -2
  13. package/web/dist/assets/{diff-view-D6ljveL0.js → diff-view-Sqk3iny_.js} +1 -1
  14. package/web/dist/assets/{file-preview-7ATj_IJp.js → file-preview-CFvc38AT.js} +1 -1
  15. package/web/dist/assets/{git-toolbar-BSTMJPo4.js → git-toolbar-CZAj0VNk.js} +1 -1
  16. package/web/dist/assets/{github-Crr8_taH.js → github-Cdg3-sQK.js} +1 -1
  17. package/web/dist/assets/{global-activity-route-Dlg4nNjK.js → global-activity-route-9DUVLRv0.js} +1 -1
  18. package/web/dist/assets/{index-DXc4Wqxm.js → index-s7PhnzDS.js} +9 -9
  19. package/web/dist/assets/{live-protocol-DjH6ZQwI.js → live-protocol-DBPXI6ks.js} +1 -1
  20. package/web/dist/assets/{popover-C930d2dH.js → popover-G6KGT-qq.js} +1 -1
  21. package/web/dist/assets/{preview-pane-connected-B2qXE2AQ.js → preview-pane-connected-DVlhmoyi.js} +2 -2
  22. package/web/dist/assets/{project-router-BRZW1N_s.js → project-router-BFKfAFvq.js} +1 -1
  23. package/web/dist/assets/project-scope-context-DSkcNKO7.js +4 -0
  24. package/web/dist/assets/{prompt-template-menu-BksxTKqX.js → prompt-template-menu-D4-inlE4.js} +1 -1
  25. package/web/dist/assets/queries-D2MPDhtr.js +1 -0
  26. package/web/dist/assets/{reference-chip-BHpiE7O2.js → reference-chip-Drpbf-MP.js} +1 -1
  27. package/web/dist/assets/{repo-git-2fklKmdO.js → repo-git-CwibBYwB.js} +1 -1
  28. package/web/dist/assets/{report-reader-Dj9NU2fc.js → report-reader-BdYHFEdw.js} +1 -1
  29. package/web/dist/assets/reports-CWlWhffn.js +1 -0
  30. package/web/dist/assets/{run-header-B_aK7sJV.js → run-header-Dc5892Cu.js} +2 -2
  31. package/web/dist/assets/skills-B2Cc1jJi.js +1 -0
  32. package/web/dist/assets/{tab-link-C87YL9QC.js → tab-link-DDpdYMnv.js} +1 -1
  33. package/web/dist/assets/{task-changes-e6zjxrwH.js → task-changes-CN0VE5bZ.js} +1 -1
  34. package/web/dist/assets/{task-commits-CJHXztnJ.js → task-commits-ycrhlORw.js} +1 -1
  35. package/web/dist/assets/{task-files-BK8Fhm1l.js → task-files-CjqaWaul.js} +1 -1
  36. package/web/dist/assets/{task-github-item-CJMKAWxL.js → task-github-item-CezPgdB9.js} +1 -1
  37. package/web/dist/assets/{task-thread-Cv_fZqYj.js → task-thread-BfsMGE4k.js} +6 -6
  38. package/web/dist/assets/{thread-state-CPb3qK6B.js → thread-state-B6Ar3fj6.js} +1 -1
  39. package/web/dist/assets/{use-hand-to-agent-state-DladAj2W.js → use-hand-to-agent-state-BOTjwkGM.js} +1 -1
  40. package/web/dist/assets/{useInfiniteQuery-Cn8aJj7F.js → useInfiniteQuery-BmfExLUr.js} +1 -1
  41. package/web/dist/assets/useQuery-8pHkglP4.js +1 -0
  42. package/web/dist/assets/{workflows-BT_I7xcp.js → workflows-B32GiY9u.js} +1 -1
  43. package/web/dist/assets/ws-CEQH0TUT.js +1 -0
  44. package/web/dist/index.html +14 -14
  45. package/web/dist/live-worker.js +1 -1
  46. package/web/dist/assets/activity-motion-yRfsq26m.js +0 -2
  47. package/web/dist/assets/agent-accounts-C14ohMG_.js +0 -18
  48. package/web/dist/assets/attention-D0CyU08o.js +0 -1
  49. package/web/dist/assets/project-scope-context-WRT8Dvpw.js +0 -4
  50. package/web/dist/assets/queries-DdqJy71d.js +0 -1
  51. package/web/dist/assets/reports-BE6wtSWw.js +0 -1
  52. package/web/dist/assets/skills-BFA2tySa.js +0 -1
  53. package/web/dist/assets/useQuery-CnaQ7qgN.js +0 -1
  54. package/web/dist/assets/ws-netTapLq.js +0 -1
@@ -1,5 +1,5 @@
1
1
  // ../contract/src/events.ts
2
- import { z as z10 } from "zod";
2
+ import { z as z9 } from "zod";
3
3
 
4
4
  // ../contract/src/conversations.ts
5
5
  import { z as z2 } from "zod";
@@ -116,7 +116,7 @@ var requestWaitRequestSchema = z2.object({
116
116
  }).strict().refine((value) => value.mode !== "one" || value.requestIds.length === 1, { message: "one requires exactly one request" });
117
117
 
118
118
  // ../contract/src/delegation.ts
119
- import { z as z9 } from "zod";
119
+ import { z as z8 } from "zod";
120
120
 
121
121
  // ../contract/src/effort.ts
122
122
  import { z as z3 } from "zod";
@@ -130,77 +130,54 @@ function parseEffort(value) {
130
130
  return parsed.success ? parsed.data : void 0;
131
131
  }
132
132
 
133
- // ../contract/src/run-status.ts
134
- import { z as z4 } from "zod";
135
- var runStatusSchema = z4.enum([
136
- "queued",
137
- "running",
138
- "waiting",
139
- "review",
140
- "done",
141
- "failed",
142
- "cancelled"
143
- ]);
144
- var stepStatusSchema = z4.enum([
145
- "pending",
146
- "running",
147
- "waiting",
148
- "review",
149
- "done",
150
- "failed",
151
- "cancelled",
152
- "skipped"
153
- ]);
154
- var stepKindSchema = z4.enum(["agent", "check"]);
155
-
156
133
  // ../contract/src/runner.ts
157
- import { z as z5 } from "zod";
158
- var runnerSchema = z5.enum(["claude", "codex", "opencode", "pi", "cursor", "omp"]);
134
+ import { z as z4 } from "zod";
135
+ var runnerSchema = z4.enum(["claude", "codex", "opencode", "pi", "cursor", "omp"]);
159
136
 
160
137
  // ../contract/src/workspace.ts
161
- import { z as z8 } from "zod";
138
+ import { z as z7 } from "zod";
162
139
 
163
140
  // ../contract/src/per-runner-optional-strings.ts
164
- import { z as z6 } from "zod";
141
+ import { z as z5 } from "zod";
165
142
  function perRunnerOptionalStrings() {
166
- return z6.object({
167
- claude: z6.string().optional(),
168
- codex: z6.string().optional(),
169
- opencode: z6.string().optional(),
170
- pi: z6.string().optional(),
171
- cursor: z6.string().optional(),
172
- omp: z6.string().optional()
143
+ return z5.object({
144
+ claude: z5.string().optional(),
145
+ codex: z5.string().optional(),
146
+ opencode: z5.string().optional(),
147
+ pi: z5.string().optional(),
148
+ cursor: z5.string().optional(),
149
+ omp: z5.string().optional()
173
150
  });
174
151
  }
175
152
 
176
153
  // ../contract/src/team-skill-ref.ts
177
- import { z as z7 } from "zod";
178
- var teamSkillRefSchema = z7.object({ repo: z7.string().min(1).max(500), name: z7.string().min(1).max(200) }).strict();
154
+ import { z as z6 } from "zod";
155
+ var teamSkillRefSchema = z6.object({ repo: z6.string().min(1).max(500), name: z6.string().min(1).max(200) }).strict();
179
156
 
180
157
  // ../contract/src/workspace.ts
181
- var workspaceConfigResponseSchema = z8.object({
158
+ var workspaceConfigResponseSchema = z7.object({
182
159
  /** Root exposed by the Add-project directory browser — stored as written (`~` kept). */
183
- browseRoot: z8.string(),
160
+ browseRoot: z7.string(),
184
161
  /** Checkout root for GUI-cloned projects — stored as written (`~` kept). */
185
- projectsDir: z8.string(),
186
- archiveOnMerge: z8.boolean().nullable(),
187
- effectiveArchiveOnMerge: z8.boolean(),
188
- archiveOnMergeSource: z8.enum(["global", "environment", "default"]),
189
- composerDefaults: z8.object({
190
- autonomous: z8.boolean().nullable(),
191
- worktree: z8.boolean().nullable(),
162
+ projectsDir: z7.string(),
163
+ archiveOnMerge: z7.boolean().nullable(),
164
+ effectiveArchiveOnMerge: z7.boolean(),
165
+ archiveOnMergeSource: z7.enum(["global", "environment", "default"]),
166
+ composerDefaults: z7.object({
167
+ autonomous: z7.boolean().nullable(),
168
+ worktree: z7.boolean().nullable(),
192
169
  /** `'source-dependent'` when no `CEZ_AUTONOMOUS_DEFAULT` pins it either way. */
193
- inheritedAutonomous: z8.union([z8.boolean(), z8.literal("source-dependent")]),
194
- inheritedWorktree: z8.boolean()
170
+ inheritedAutonomous: z7.union([z7.boolean(), z7.literal("source-dependent")]),
171
+ inheritedWorktree: z7.boolean()
195
172
  }),
196
- resources: z8.object({
197
- maxParallel: z8.number(),
198
- maxMonitoringSessions: z8.number(),
199
- monitoringWakeIntervalMinutes: z8.number().nullable(),
173
+ resources: z7.object({
174
+ maxParallel: z7.number(),
175
+ maxMonitoringSessions: z7.number(),
176
+ monitoringWakeIntervalMinutes: z7.number().nullable(),
200
177
  /** Resume a run a provider usage limit stopped, once the limit resets. Default `true`. */
201
- autoResumeOnUsageLimit: z8.boolean(),
202
- memoryLimitMb: z8.number().nullable(),
203
- worktreeRetentionDefault: z8.number()
178
+ autoResumeOnUsageLimit: z7.boolean(),
179
+ memoryLimitMb: z7.number().nullable(),
180
+ worktreeRetentionDefault: z7.number()
204
181
  }),
205
182
  /**
206
183
  * What a repo that has set none of its own runs (spec 2026-07-29-agent-profiles).
@@ -210,55 +187,55 @@ var workspaceConfigResponseSchema = z8.object({
210
187
  * from a value someone chose or the fallback collapses into "always claude". Consulted only where
211
188
  * the repo's own `.ai/cezar/config.json` is silent — a repo that chose is never overruled.
212
189
  */
213
- agentDefaults: z8.object({
190
+ agentDefaults: z7.object({
214
191
  runner: runnerSchema.optional(),
215
192
  models: perRunnerOptionalStrings().optional()
216
193
  })
217
194
  });
218
- var setWorkspaceConfigInputSchema = z8.object({
219
- browseRoot: z8.string().trim().min(1).max(4096).optional(),
220
- projectsDir: z8.string().trim().min(1).max(4096).optional(),
221
- archiveOnMerge: z8.boolean().nullable().optional(),
222
- composerDefaults: z8.object({
223
- autonomous: z8.boolean().nullable().optional(),
224
- worktree: z8.boolean().nullable().optional()
195
+ var setWorkspaceConfigInputSchema = z7.object({
196
+ browseRoot: z7.string().trim().min(1).max(4096).optional(),
197
+ projectsDir: z7.string().trim().min(1).max(4096).optional(),
198
+ archiveOnMerge: z7.boolean().nullable().optional(),
199
+ composerDefaults: z7.object({
200
+ autonomous: z7.boolean().nullable().optional(),
201
+ worktree: z7.boolean().nullable().optional()
225
202
  }).optional(),
226
203
  /** Machine-wide agent defaults. `null` on a key CLEARS it back to "no opinion", which a bare
227
204
  * absent key cannot say in a partial patch. */
228
- agentDefaults: z8.object({
205
+ agentDefaults: z7.object({
229
206
  runner: runnerSchema.nullable().optional(),
230
- models: z8.object({
231
- claude: z8.string().trim().min(1).max(200).nullable().optional(),
232
- codex: z8.string().trim().min(1).max(200).nullable().optional(),
233
- opencode: z8.string().trim().min(1).max(200).nullable().optional(),
234
- pi: z8.string().trim().min(1).max(200).nullable().optional(),
235
- cursor: z8.string().trim().min(1).max(200).nullable().optional(),
236
- omp: z8.string().trim().min(1).max(200).nullable().optional()
207
+ models: z7.object({
208
+ claude: z7.string().trim().min(1).max(200).nullable().optional(),
209
+ codex: z7.string().trim().min(1).max(200).nullable().optional(),
210
+ opencode: z7.string().trim().min(1).max(200).nullable().optional(),
211
+ pi: z7.string().trim().min(1).max(200).nullable().optional(),
212
+ cursor: z7.string().trim().min(1).max(200).nullable().optional(),
213
+ omp: z7.string().trim().min(1).max(200).nullable().optional()
237
214
  }).optional()
238
215
  }).optional(),
239
- resources: z8.object({
240
- maxParallel: z8.number().int().min(1).max(16).optional(),
241
- maxMonitoringSessions: z8.number().int().min(0).max(16).optional(),
242
- monitoringWakeIntervalMinutes: z8.number().int().min(1).max(60).nullable().optional(),
243
- autoResumeOnUsageLimit: z8.boolean().optional(),
244
- memoryLimitMb: z8.number().int().min(0).max(1048576).nullable().optional(),
245
- worktreeRetentionDefault: z8.number().int().min(0).max(1e3).optional()
216
+ resources: z7.object({
217
+ maxParallel: z7.number().int().min(1).max(16).optional(),
218
+ maxMonitoringSessions: z7.number().int().min(0).max(16).optional(),
219
+ monitoringWakeIntervalMinutes: z7.number().int().min(1).max(60).nullable().optional(),
220
+ autoResumeOnUsageLimit: z7.boolean().optional(),
221
+ memoryLimitMb: z7.number().int().min(0).max(1048576).nullable().optional(),
222
+ worktreeRetentionDefault: z7.number().int().min(0).max(1e3).optional()
246
223
  }).optional()
247
224
  });
248
- var appearanceSchema = z8.object({
249
- accent: z8.enum(["cezarion", "lime", "violet"]).optional(),
250
- density: z8.enum(["comfortable", "compact", "ultra"]).optional(),
251
- width: z8.enum(["narrow", "wide"]).optional()
225
+ var appearanceSchema = z7.object({
226
+ accent: z7.enum(["cezarion", "lime", "violet"]).optional(),
227
+ density: z7.enum(["comfortable", "compact", "ultra"]).optional(),
228
+ width: z7.enum(["narrow", "wide"]).optional()
252
229
  });
253
- var taskTableUiStateSchema = z8.looseObject({
230
+ var taskTableUiStateSchema = z7.looseObject({
254
231
  /** Explicit user choices only. Missing ids keep the registry-owned default. */
255
- expandedColumns: z8.record(z8.string(), z8.boolean()).optional()
232
+ expandedColumns: z7.record(z7.string(), z7.boolean()).optional()
256
233
  });
257
- var sidebarLimitsSchema = z8.object({
258
- overall: z8.number().int().positive().nullable().optional(),
259
- needsYou: z8.number().int().positive().nullable().optional(),
260
- finished: z8.number().int().positive().nullable().optional(),
261
- working: z8.number().int().positive().nullable().optional()
234
+ var sidebarLimitsSchema = z7.object({
235
+ overall: z7.number().int().positive().nullable().optional(),
236
+ needsYou: z7.number().int().positive().nullable().optional(),
237
+ finished: z7.number().int().positive().nullable().optional(),
238
+ working: z7.number().int().positive().nullable().optional()
262
239
  });
263
240
  function normalizeSidebarLimits(value) {
264
241
  const defaults = { overall: 10, needsYou: null, finished: null, working: null };
@@ -269,58 +246,58 @@ function normalizeSidebarLimits(value) {
269
246
  }
270
247
  return defaults;
271
248
  }
272
- var uiStateSchema = z8.looseObject({
249
+ var uiStateSchema = z7.looseObject({
273
250
  sidebarLimits: sidebarLimitsSchema.optional(),
274
251
  /** What the last started run used. `null` is a VALUE, not an absence: it records a run that
275
252
  * chose neither a skill nor a workflow (the plain built-in `quick-task`), which the composer
276
253
  * can now express since the source picker grew an empty state. Absent still means "no
277
254
  * run has been recorded here" — a cockpit reading either one selects nothing. */
278
- lastTask: z8.object({ source: z8.enum(["workflow", "skill"]), ref: z8.string() }).nullable().optional(),
255
+ lastTask: z7.object({ source: z7.enum(["workflow", "skill"]), ref: z7.string() }).nullable().optional(),
279
256
  /** Most-recently-run sources, newest first (deduped, capped). Feeds the composer picker's
280
257
  * recency sort. */
281
- recentSources: z8.array(z8.object({ source: z8.enum(["workflow", "skill"]), ref: z8.string() })).optional(),
258
+ recentSources: z7.array(z7.object({ source: z7.enum(["workflow", "skill"]), ref: z7.string() })).optional(),
282
259
  /** The last worktree choice for a single-skill run. Absent → the default (isolated worktree). */
283
- lastWorktree: z8.boolean().optional(),
260
+ lastWorktree: z7.boolean().optional(),
284
261
  /** The last autonomous choice — remembered like `lastWorktree`. Absent → off. */
285
- lastAutonomous: z8.boolean().optional(),
262
+ lastAutonomous: z7.boolean().optional(),
286
263
  /** Team skills this project switched off, by source repo and name. Absent or `[]`: every team
287
264
  * skill shows. Legacy `importedSkills` keys still round-trip through
288
265
  * the loose object but nothing reads them. */
289
- disabledTeamSkills: z8.array(teamSkillRefSchema).max(200).optional(),
266
+ disabledTeamSkills: z7.array(teamSkillRefSchema).max(200).optional(),
290
267
  /** Skill selection frequency (#408): name → times chosen, across BOTH composers. */
291
- skillUsage: z8.record(z8.string(), z8.number()).optional(),
292
- runsView: z8.enum(["list", "table"]).optional(),
268
+ skillUsage: z7.record(z7.string(), z7.number()).optional(),
269
+ runsView: z7.enum(["list", "table"]).optional(),
293
270
  /** The GitHub tab's last-selected sub-tab (#417). Absent → issues. */
294
- githubView: z8.enum(["issues", "prs"]).optional(),
271
+ githubView: z7.enum(["issues", "prs"]).optional(),
295
272
  /** Settings → Appearance. The theme itself stays in localStorage (`cez-theme`) — it must
296
273
  * pre-paint, and it is per-browser by design. */
297
274
  appearance: appearanceSchema.optional(),
298
275
  /** Follow-up prompt templates (#413). Absent → the built-in defaults; present (even `[]`) is
299
276
  * the user's own edited list. `skills` are the skill names the template auto-applies for. */
300
- promptTemplates: z8.array(
301
- z8.object({
302
- id: z8.string(),
303
- label: z8.string(),
304
- text: z8.string(),
305
- skills: z8.array(z8.string()).optional()
277
+ promptTemplates: z7.array(
278
+ z7.object({
279
+ id: z7.string(),
280
+ label: z7.string(),
281
+ text: z7.string(),
282
+ skills: z7.array(z7.string()).optional()
306
283
  })
307
284
  ).optional()
308
285
  });
309
- var workspaceLastLocationSchema = z8.strictObject({
310
- projectId: z8.string().min(1).max(64),
311
- pathname: z8.string().min(1).max(2048).startsWith("/p/"),
312
- search: z8.string().max(4096).startsWith("?").optional(),
313
- hash: z8.string().max(2048).startsWith("#").optional()
286
+ var workspaceLastLocationSchema = z7.strictObject({
287
+ projectId: z7.string().min(1).max(64),
288
+ pathname: z7.string().min(1).max(2048).startsWith("/p/"),
289
+ search: z7.string().max(4096).startsWith("?").optional(),
290
+ hash: z7.string().max(2048).startsWith("#").optional()
314
291
  });
315
- var workspaceUiStateSchema = z8.looseObject({
316
- sidebar: z8.looseObject({
292
+ var workspaceUiStateSchema = z7.looseObject({
293
+ sidebar: z7.looseObject({
317
294
  /** LEGACY — the sidebar's per-project collapse map (step 3.3). Still accepted and still
318
295
  * round-tripped so an older cockpit sharing this home keeps working, but the current
319
296
  * cockpit neither reads nor writes it: which groups are shut describes the WINDOW, not the
320
297
  * workspace, so it lives in that browser's localStorage
321
298
  * (`packages/web/src/lib/sidebar-collapse.ts`). One shared answer meant a phone collapsing
322
299
  * a group collapsed it on the desktop too. */
323
- collapsed: z8.record(z8.string(), z8.boolean()).optional(),
300
+ collapsed: z7.record(z7.string(), z7.boolean()).optional(),
324
301
  /** The user's hand-picked project order (hearsay-tools/cezarion#438, port of
325
302
  * open-mercato/cezar#952), most-wanted first — WORKSPACE state on purpose, unlike
326
303
  * `collapsed` above. Which order your repos sit in is a considered choice made once, so
@@ -331,7 +308,7 @@ var workspaceUiStateSchema = z8.looseObject({
331
308
  * Ids that are no longer registered are ignored on read; registered projects missing from
332
309
  * the list are not dropped — they keep registry order ahead of the picked ones
333
310
  * (`packages/web/src/lib/project-order.ts`). */
334
- projectOrder: z8.array(z8.string()).optional()
311
+ projectOrder: z7.array(z7.string()).optional()
335
312
  }).optional(),
336
313
  /** Dismissed runtime-auth incident IDs, keyed by provider. An ID is only dismissed until the
337
314
  * provider reports a different incident, so this stays workspace-global with the browser
@@ -342,7 +319,7 @@ var workspaceUiStateSchema = z8.looseObject({
342
319
  appearance: appearanceSchema.optional(),
343
320
  /** Settings → Notifications, GLOBAL since step 3.5 — one answer for the whole workspace, since
344
321
  * the delivering browser is one browser whichever project you are looking at. */
345
- notifications: z8.looseObject({ enabled: z8.boolean().optional() }).optional(),
322
+ notifications: z7.looseObject({ enabled: z7.boolean().optional() }).optional(),
346
323
  /** Desktop Tasks-table density, shared across every project in this workspace. */
347
324
  taskTable: taskTableUiStateSchema.optional(),
348
325
  /** LEGACY, exactly like `sidebar` above — the last settled project-scoped page, restored when
@@ -353,27 +330,27 @@ var workspaceUiStateSchema = z8.looseObject({
353
330
  });
354
331
  var WORKSPACE_UI_STATE_MAX_KEYS = 200;
355
332
  var TASK_TABLE_MAX_COLUMNS = 50;
356
- var setWorkspaceUiStateInputSchema = z8.looseObject({
333
+ var setWorkspaceUiStateInputSchema = z7.looseObject({
357
334
  ...workspaceUiStateSchema.shape,
358
- sidebar: z8.looseObject({
359
- collapsed: z8.record(z8.string().min(1).max(64), z8.boolean()).refine((map) => Object.keys(map).length <= WORKSPACE_UI_STATE_MAX_KEYS, {
335
+ sidebar: z7.looseObject({
336
+ collapsed: z7.record(z7.string().min(1).max(64), z7.boolean()).refine((map) => Object.keys(map).length <= WORKSPACE_UI_STATE_MAX_KEYS, {
360
337
  message: `sidebar.collapsed must have at most ${WORKSPACE_UI_STATE_MAX_KEYS} entries`
361
338
  }).optional(),
362
339
  // Project ids, so the same 64-char bound the registry's slug rule and `collapsed`'s keys
363
340
  // already use. Duplicates are not rejected — the cockpit dedupes on read, and a 400 on a
364
341
  // sidebar drag would be a worse answer than a self-healing one.
365
- projectOrder: z8.array(z8.string().min(1).max(64)).max(WORKSPACE_UI_STATE_MAX_KEYS).optional()
342
+ projectOrder: z7.array(z7.string().min(1).max(64)).max(WORKSPACE_UI_STATE_MAX_KEYS).optional()
366
343
  }).optional(),
367
- dismissedProviderAuthFailures: z8.strictObject({
368
- claude: z8.string().min(1).max(128).optional(),
369
- codex: z8.string().min(1).max(128).optional(),
370
- opencode: z8.string().min(1).max(128).optional(),
371
- pi: z8.string().min(1).max(128).optional(),
372
- cursor: z8.string().min(1).max(128).optional(),
373
- omp: z8.string().min(1).max(128).optional()
344
+ dismissedProviderAuthFailures: z7.strictObject({
345
+ claude: z7.string().min(1).max(128).optional(),
346
+ codex: z7.string().min(1).max(128).optional(),
347
+ opencode: z7.string().min(1).max(128).optional(),
348
+ pi: z7.string().min(1).max(128).optional(),
349
+ cursor: z7.string().min(1).max(128).optional(),
350
+ omp: z7.string().min(1).max(128).optional()
374
351
  }).optional(),
375
352
  taskTable: taskTableUiStateSchema.extend({
376
- expandedColumns: z8.record(z8.string().min(1).max(64), z8.boolean()).refine((map) => Object.keys(map).length <= TASK_TABLE_MAX_COLUMNS, {
353
+ expandedColumns: z7.record(z7.string().min(1).max(64), z7.boolean()).refine((map) => Object.keys(map).length <= TASK_TABLE_MAX_COLUMNS, {
377
354
  message: `taskTable.expandedColumns must have at most ${TASK_TABLE_MAX_COLUMNS} entries`
378
355
  }).optional()
379
356
  }).optional()
@@ -390,325 +367,325 @@ var WORKTREE_SETUP_MAX_COMMANDS = 20;
390
367
  var WORKTREE_SETUP_MAX_COMMAND_LENGTH = 4e3;
391
368
  var WORKTREE_SETUP_DEFAULT_TIMEOUT_SECONDS = 900;
392
369
  var WORKTREE_SETUP_MAX_TIMEOUT_SECONDS = 7200;
393
- var worktreeSetupConfigSchema = z8.object({
394
- commands: z8.array(z8.string().trim().min(1).max(WORKTREE_SETUP_MAX_COMMAND_LENGTH)).max(WORKTREE_SETUP_MAX_COMMANDS),
370
+ var worktreeSetupConfigSchema = z7.object({
371
+ commands: z7.array(z7.string().trim().min(1).max(WORKTREE_SETUP_MAX_COMMAND_LENGTH)).max(WORKTREE_SETUP_MAX_COMMANDS),
395
372
  /** Per command. Absent = `WORKTREE_SETUP_DEFAULT_TIMEOUT_SECONDS`. */
396
- timeoutSeconds: z8.number().int().min(1).max(WORKTREE_SETUP_MAX_TIMEOUT_SECONDS).optional()
373
+ timeoutSeconds: z7.number().int().min(1).max(WORKTREE_SETUP_MAX_TIMEOUT_SECONDS).optional()
397
374
  }).strict();
398
- var configResponseSchema = z8.object({
399
- archiveOnMerge: z8.boolean().nullable(),
400
- effectiveArchiveOnMerge: z8.boolean(),
401
- archiveOnMergeSource: z8.enum(["project", "global", "environment", "default"]),
402
- baseBranch: z8.string().nullable(),
375
+ var configResponseSchema = z7.object({
376
+ archiveOnMerge: z7.boolean().nullable(),
377
+ effectiveArchiveOnMerge: z7.boolean(),
378
+ archiveOnMergeSource: z7.enum(["project", "global", "environment", "default"]),
379
+ baseBranch: z7.string().nullable(),
403
380
  defaultRunner: runnerSchema,
404
- systemPrompt: z8.string().nullable(),
381
+ systemPrompt: z7.string().nullable(),
405
382
  defaultModels: runnerModelsSchema,
406
383
  /** True when native coding-agent settings are authoritative and model picks are read-only. */
407
- modelsLocked: z8.boolean(),
384
+ modelsLocked: z7.boolean(),
408
385
  /** How many tasks run at once (1–16). */
409
- maxParallel: z8.number(),
386
+ maxParallel: z7.number(),
410
387
  /** Per-task memory ceiling in MiB (whole process tree); null = no limit. */
411
- memoryLimitMb: z8.number().nullable(),
388
+ memoryLimitMb: z7.number().nullable(),
412
389
  /** Keep the last N finished worktrees on disk (#483); 0 = unlimited. Older ones are reclaimed
413
390
  * (directory only — branch kept, so work is recoverable). */
414
- worktreeRetention: z8.number(),
391
+ worktreeRetention: z7.number(),
415
392
  /** Live title updates: null = no config key, the `CEZ_TITLE_UPDATES` env default (ON) decides. */
416
- liveTitleUpdates: z8.boolean().nullable(),
393
+ liveTitleUpdates: z7.boolean().nullable(),
417
394
  /** Optional review gate (#489): null = no config key, the `CEZ_REVIEW_GATE` env default (OFF)
418
395
  * decides. */
419
- reviewGate: z8.boolean().nullable(),
396
+ reviewGate: z7.boolean().nullable(),
420
397
  /** Worktree setup (#917): the commands that prepare a new task or worker worktree, with the
421
398
  * timeout filled in. null = no setup, or an invalid value (then `worktreeSetupIssue` says why). */
422
- worktreeSetup: z8.object({ commands: z8.array(z8.string()), timeoutSeconds: z8.number() }).nullable(),
399
+ worktreeSetup: z7.object({ commands: z7.array(z7.string()), timeoutSeconds: z7.number() }).nullable(),
423
400
  /** Why `config.json`'s `worktreeSetup` is invalid; null when it is valid or absent. */
424
- worktreeSetupIssue: z8.string().nullable()
401
+ worktreeSetupIssue: z7.string().nullable()
425
402
  });
426
403
  var setConfigResponseSchema = configResponseSchema;
427
- var setConfigInputSchema = z8.object({
428
- archiveOnMerge: z8.boolean().nullable().optional(),
429
- baseBranch: z8.string().trim().min(1).max(200).nullable().optional(),
404
+ var setConfigInputSchema = z7.object({
405
+ archiveOnMerge: z7.boolean().nullable().optional(),
406
+ baseBranch: z7.string().trim().min(1).max(200).nullable().optional(),
430
407
  defaultRunner: runnerSchema.optional(),
431
- systemPrompt: z8.string().trim().max(2e4).nullable().optional(),
432
- defaultModels: z8.object({
433
- claude: z8.string().trim().max(200).nullable().optional(),
434
- codex: z8.string().trim().max(200).nullable().optional(),
435
- opencode: z8.string().trim().max(200).nullable().optional(),
436
- pi: z8.string().trim().max(200).nullable().optional(),
437
- cursor: z8.string().trim().max(200).nullable().optional(),
438
- omp: z8.string().trim().max(200).nullable().optional()
408
+ systemPrompt: z7.string().trim().max(2e4).nullable().optional(),
409
+ defaultModels: z7.object({
410
+ claude: z7.string().trim().max(200).nullable().optional(),
411
+ codex: z7.string().trim().max(200).nullable().optional(),
412
+ opencode: z7.string().trim().max(200).nullable().optional(),
413
+ pi: z7.string().trim().max(200).nullable().optional(),
414
+ cursor: z7.string().trim().max(200).nullable().optional(),
415
+ omp: z7.string().trim().max(200).nullable().optional()
439
416
  }).optional(),
440
- maxParallel: z8.number().int().min(1).max(16).optional(),
417
+ maxParallel: z7.number().int().min(1).max(16).optional(),
441
418
  /** null or 0 clears the ceiling back to "no limit". */
442
- memoryLimitMb: z8.number().int().min(0).max(1048576).nullable().optional(),
419
+ memoryLimitMb: z7.number().int().min(0).max(1048576).nullable().optional(),
443
420
  /** Keep last N finished worktrees (#483); 0 = unlimited, null clears back to the default (10). */
444
- worktreeRetention: z8.number().int().min(0).max(1e3).nullable().optional(),
421
+ worktreeRetention: z7.number().int().min(0).max(1e3).nullable().optional(),
445
422
  /** null clears the key back to the env-default behavior. */
446
- liveTitleUpdates: z8.boolean().nullable().optional(),
423
+ liveTitleUpdates: z7.boolean().nullable().optional(),
447
424
  /** null clears the key back to the env-default behavior (OFF). */
448
- reviewGate: z8.boolean().nullable().optional(),
425
+ reviewGate: z7.boolean().nullable().optional(),
449
426
  /** Worktree setup (#917). null or an empty command list deletes the key. Refused with 409 by a
450
427
  * hosted cockpit: these are commands the host runs. */
451
428
  worktreeSetup: worktreeSetupConfigSchema.nullable().optional()
452
429
  });
453
430
  var providerIdSchema = runnerSchema;
454
- var providerConnectionStateSchema = z8.enum([
431
+ var providerConnectionStateSchema = z7.enum([
455
432
  "connected",
456
433
  "disconnected",
457
434
  "not-installed",
458
435
  "unknown"
459
436
  ]);
460
- var providerStatusSchema = z8.object({
437
+ var providerStatusSchema = z7.object({
461
438
  provider: providerIdSchema,
462
439
  status: providerConnectionStateSchema,
463
- enabled: z8.boolean().optional(),
464
- hint: z8.string().optional(),
465
- authFailureId: z8.string().optional(),
440
+ enabled: z7.boolean().optional(),
441
+ hint: z7.string().optional(),
442
+ authFailureId: z7.string().optional(),
466
443
  /** Which agent account this row describes (spec 2026-07-29-agent-profiles). ABSENT on
467
444
  * `GET /api/v1/providers/status`, which deliberately keeps answering exactly one row per
468
445
  * provider — the discovered default — so an older client sees no change at all. Per-account
469
446
  * rows are carried by `GET /api/v1/workspace/agent-profiles` instead. */
470
- profileId: z8.string().optional()
447
+ profileId: z7.string().optional()
471
448
  });
472
- var providerStatusResponseSchema = z8.object({
473
- providers: z8.array(providerStatusSchema)
449
+ var providerStatusResponseSchema = z7.object({
450
+ providers: z7.array(providerStatusSchema)
474
451
  });
475
- var providerConnectResponseSchema = z8.discriminatedUnion("opened", [
476
- z8.object({ opened: z8.literal(true), command: z8.string() }),
477
- z8.object({ opened: z8.literal(false), connected: z8.literal(true), command: z8.string() })
452
+ var providerConnectResponseSchema = z7.discriminatedUnion("opened", [
453
+ z7.object({ opened: z7.literal(true), command: z7.string() }),
454
+ z7.object({ opened: z7.literal(false), connected: z7.literal(true), command: z7.string() })
478
455
  ]);
479
456
  var modelDiscoveryRunnerSchema = runnerSchema;
480
457
  var MODEL_DISCOVERY_RUNNERS = modelDiscoveryRunnerSchema.options;
481
458
  function runnerDiscoversModels(runner) {
482
459
  return MODEL_DISCOVERY_RUNNERS.includes(runner);
483
460
  }
484
- var runnerModelOptionSchema = z8.object({
485
- id: z8.string(),
486
- label: z8.string(),
487
- description: z8.string(),
488
- effortLevels: z8.array(effortLevelSchema).optional()
461
+ var runnerModelOptionSchema = z7.object({
462
+ id: z7.string(),
463
+ label: z7.string(),
464
+ description: z7.string(),
465
+ effortLevels: z7.array(effortLevelSchema).optional()
489
466
  });
490
- var runnerModelCatalogResponseSchema = z8.object({
467
+ var runnerModelCatalogResponseSchema = z7.object({
491
468
  runner: runnerSchema,
492
- models: z8.array(runnerModelOptionSchema),
493
- source: z8.enum(["live", "cache", "unavailable"]),
494
- stale: z8.boolean(),
495
- reason: z8.string().optional()
469
+ models: z7.array(runnerModelOptionSchema),
470
+ source: z7.enum(["live", "cache", "unavailable"]),
471
+ stale: z7.boolean(),
472
+ reason: z7.string().optional()
496
473
  });
497
- var modelChoicesSchema = z8.object({
474
+ var modelChoicesSchema = z7.object({
498
475
  runner: modelDiscoveryRunnerSchema,
499
- requestedModel: z8.string(),
500
- availableModels: z8.array(runnerModelOptionSchema),
501
- otherRunners: z8.array(modelDiscoveryRunnerSchema)
476
+ requestedModel: z7.string(),
477
+ availableModels: z7.array(runnerModelOptionSchema),
478
+ otherRunners: z7.array(modelDiscoveryRunnerSchema)
502
479
  });
503
- var openTargetSchema = z8.object({
504
- id: z8.string(),
505
- label: z8.string(),
480
+ var openTargetSchema = z7.object({
481
+ id: z7.string(),
482
+ label: z7.string(),
506
483
  /** A stable icon key (#361) the UI maps to a concrete icon. Optional: an older server omitting
507
484
  * it just renders the generic fallback icon. */
508
- icon: z8.string().optional()
485
+ icon: z7.string().optional()
509
486
  });
510
- var openTargetsResponseSchema = z8.object({
511
- targets: z8.array(openTargetSchema)
487
+ var openTargetsResponseSchema = z7.object({
488
+ targets: z7.array(openTargetSchema)
512
489
  });
513
- var openProjectInSchema = z8.object({
490
+ var openProjectInSchema = z7.object({
514
491
  // A short bound (#429): matched against a downstream allowlist, so an app id is never long.
515
- target: z8.string().trim().min(1, "target required").max(200)
492
+ target: z7.string().trim().min(1, "target required").max(200)
516
493
  });
517
- var openProjectInResponseSchema = z8.object({
518
- opened: z8.literal(true),
519
- path: z8.string()
494
+ var openProjectInResponseSchema = z7.object({
495
+ opened: z7.literal(true),
496
+ path: z7.string()
520
497
  });
521
498
 
522
499
  // ../contract/src/delegation.ts
523
- var workerOperationSchema = z9.enum(["spawn", "inspect", "steer", "stop", "destroy", "diff", "wait"]);
524
- var commitShaSchema = z9.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/);
525
- var requestHashSchema = z9.string().regex(/^[0-9a-f]{64}$/);
526
- var workerIdsSchema = z9.array(z9.uuid()).min(1).max(32).refine((ids) => new Set(ids).size === ids.length);
527
- var permissionsSchema = z9.array(workerOperationSchema).max(7).refine((operations) => new Set(operations).size === operations.length);
528
- var remainingSchema = z9.array(z9.enum(["process", "worktree", "branch"])).max(3).refine((resources) => new Set(resources).size === resources.length);
529
- var errorSchema = z9.string().max(2e3);
530
- var workerWorkspaceSchema = z9.object({
531
- ownerRunId: z9.uuid(),
532
- resourceId: z9.uuid(),
533
- kind: z9.literal("owned-isolated"),
500
+ var workerOperationSchema = z8.enum(["spawn", "inspect", "steer", "stop", "destroy", "diff", "wait"]);
501
+ var commitShaSchema = z8.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/);
502
+ var requestHashSchema = z8.string().regex(/^[0-9a-f]{64}$/);
503
+ var workerIdsSchema = z8.array(z8.uuid()).min(1).max(32).refine((ids) => new Set(ids).size === ids.length);
504
+ var permissionsSchema = z8.array(workerOperationSchema).max(7).refine((operations) => new Set(operations).size === operations.length);
505
+ var remainingSchema = z8.array(z8.enum(["process", "worktree", "branch"])).max(3).refine((resources) => new Set(resources).size === resources.length);
506
+ var errorSchema = z8.string().max(2e3);
507
+ var workerWorkspaceSchema = z8.object({
508
+ ownerRunId: z8.uuid(),
509
+ resourceId: z8.uuid(),
510
+ kind: z8.literal("owned-isolated"),
534
511
  /** Canonical creation path and original branch, never inferred from execution cwd. */
535
- path: z9.string().min(1),
536
- branch: z9.string().min(1),
512
+ path: z8.string().min(1),
513
+ branch: z8.string().min(1),
537
514
  baselineSha: commitShaSchema
538
515
  }).strict();
539
- var workerOutcomeSchema = z9.object({
540
- workerId: z9.uuid(),
541
- status: z9.enum(["review", "done", "failed", "cancelled"]),
542
- observedAt: z9.iso.datetime(),
543
- summary: z9.string().max(4e3).optional(),
544
- revision: z9.number().int().nonnegative().optional()
516
+ var workerOutcomeSchema = z8.object({
517
+ workerId: z8.uuid(),
518
+ status: z8.enum(["review", "done", "failed", "cancelled"]),
519
+ observedAt: z8.iso.datetime(),
520
+ summary: z8.string().max(4e3).optional(),
521
+ revision: z8.number().int().nonnegative().optional()
545
522
  }).strict();
546
- var workerWaitModeSchema = z9.enum(["one", "any", "all"]);
547
- var workerWaitSchema = z9.object({
548
- id: z9.uuid(),
549
- workerIds: z9.array(z9.uuid()).max(32).refine((ids) => new Set(ids).size === ids.length),
550
- requestIds: z9.array(z9.uuid()).min(1).max(32).optional(),
551
- requestOutcomes: z9.array(requestOutcomeSchema).max(32).optional(),
552
- deadline: z9.iso.datetime(),
523
+ var workerWaitModeSchema = z8.enum(["one", "any", "all"]);
524
+ var workerWaitSchema = z8.object({
525
+ id: z8.uuid(),
526
+ workerIds: z8.array(z8.uuid()).max(32).refine((ids) => new Set(ids).size === ids.length),
527
+ requestIds: z8.array(z8.uuid()).min(1).max(32).optional(),
528
+ requestOutcomes: z8.array(requestOutcomeSchema).max(32).optional(),
529
+ deadline: z8.iso.datetime(),
553
530
  mode: workerWaitModeSchema.optional(),
554
- revisions: z9.array(z9.object({ workerId: z9.uuid(), revision: z9.number().int().nonnegative() }).strict()).max(32).optional(),
555
- reason: z9.enum(["outcome", "timeout", "cancelled", "message"]).optional(),
556
- phase: z9.enum(["registered", "parked", "wake-pending"]),
557
- outcomes: z9.array(workerOutcomeSchema).max(32),
558
- wakeId: z9.uuid().optional()
531
+ revisions: z8.array(z8.object({ workerId: z8.uuid(), revision: z8.number().int().nonnegative() }).strict()).max(32).optional(),
532
+ reason: z8.enum(["outcome", "timeout", "cancelled", "message"]).optional(),
533
+ phase: z8.enum(["registered", "parked", "wake-pending"]),
534
+ outcomes: z8.array(workerOutcomeSchema).max(32),
535
+ wakeId: z8.uuid().optional()
559
536
  }).strict();
560
- var workerCompletionWaitSchema = workerWaitSchema.omit({ deadline: true, requestIds: true, requestOutcomes: true }).extend({ via: z9.literal("completion") }).strict();
561
- var workerDestroyRetrySchema = z9.object({
562
- attempts: z9.number().int().positive(),
563
- nextAt: z9.iso.datetime(),
564
- needsAttention: z9.literal(true).optional()
537
+ var workerCompletionWaitSchema = workerWaitSchema.omit({ deadline: true, requestIds: true, requestOutcomes: true }).extend({ via: z8.literal("completion") }).strict();
538
+ var workerDestroyRetrySchema = z8.object({
539
+ attempts: z8.number().int().positive(),
540
+ nextAt: z8.iso.datetime(),
541
+ needsAttention: z8.literal(true).optional()
565
542
  }).strict();
566
- var workerDestroySchema = z9.object({
567
- requestedAt: z9.iso.datetime(),
568
- phase: z9.enum(["requested", "terminating", "cleaning", "complete", "incomplete"]),
543
+ var workerDestroySchema = z8.object({
544
+ requestedAt: z8.iso.datetime(),
545
+ phase: z8.enum(["requested", "terminating", "cleaning", "complete", "incomplete"]),
569
546
  remaining: remainingSchema,
570
547
  error: errorSchema.optional()
571
548
  }).strict();
572
549
  var workerDestroyViewSchema = workerDestroySchema.extend({ retry: workerDestroyRetrySchema.optional() }).strict();
573
- var workerCreationReceiptSchema = z9.object({
574
- requestId: z9.uuid(),
575
- workerId: z9.uuid(),
550
+ var workerCreationReceiptSchema = z8.object({
551
+ requestId: z8.uuid(),
552
+ workerId: z8.uuid(),
576
553
  /** Hash of the original normalized spawn request, NOT the resolved commit or inherited settings. */
577
554
  requestHash: requestHashSchema,
578
- deletion: z9.object({ phase: z9.enum(["pending", "complete"]), revision: z9.number().int().nonnegative(), resourceId: z9.uuid(), generation: z9.uuid() }).strict().optional()
555
+ deletion: z8.object({ phase: z8.enum(["pending", "complete"]), revision: z8.number().int().nonnegative(), resourceId: z8.uuid(), generation: z8.uuid() }).strict().optional()
579
556
  }).strict();
580
- var workerBackendSchema = z9.enum(runnerSchema.options);
581
- var relativeInputPath = z9.string().min(1).max(4096).refine((path) => !/[\\\u0000-\u001f\u007f:]/.test(path) && !path.startsWith("/") && path.split("/").every((part) => part !== "" && part !== "." && part !== ".." && part.toLowerCase() !== ".git"));
557
+ var workerBackendSchema = z8.enum(runnerSchema.options);
558
+ var relativeInputPath = z8.string().min(1).max(4096).refine((path) => !/[\\\u0000-\u001f\u007f:]/.test(path) && !path.startsWith("/") && path.split("/").every((part) => part !== "" && part !== "." && part !== ".." && part.toLowerCase() !== ".git"));
582
559
  function parentFileRefusal(path) {
583
560
  return path.split("/").at(-1)?.toLowerCase() === ".gitignore" ? `--attach cannot attach a .gitignore: ${path}; ignore rules must come from the baseline` : void 0;
584
561
  }
585
- var workerContextReferenceSchema = z9.discriminatedUnion("kind", [
586
- z9.object({ kind: z9.literal("baseline-file"), path: relativeInputPath }).strict(),
587
- z9.object({ kind: z9.literal("parent-attachment"), id: z9.string().min(1).max(255).regex(/^[A-Za-z0-9_-][A-Za-z0-9._-]*$/).refine((id) => !id.includes("..")) }).strict(),
562
+ var workerContextReferenceSchema = z8.discriminatedUnion("kind", [
563
+ z8.object({ kind: z8.literal("baseline-file"), path: relativeInputPath }).strict(),
564
+ z8.object({ kind: z8.literal("parent-attachment"), id: z8.string().min(1).max(255).regex(/^[A-Za-z0-9_-][A-Za-z0-9._-]*$/).refine((id) => !id.includes("..")) }).strict(),
588
565
  /** A git-ignored file in the parent's own worktree, relative to its root (`cez worker spawn --attach`, hearsay-tools/cezarion#1149). */
589
- z9.object({ kind: z9.literal("parent-file"), path: relativeInputPath }).strict().superRefine(({ path }, ctx) => {
566
+ z8.object({ kind: z8.literal("parent-file"), path: relativeInputPath }).strict().superRefine(({ path }, ctx) => {
590
567
  const message2 = parentFileRefusal(path);
591
568
  if (message2) ctx.addIssue({ code: "custom", path: ["path"], message: message2 });
592
569
  })
593
570
  ]);
594
- var workerContextSchema = z9.object({
595
- text: z9.string().max(1e5).optional(),
596
- artifacts: z9.array(workerContextReferenceSchema).max(32).optional()
571
+ var workerContextSchema = z8.object({
572
+ text: z8.string().max(1e5).optional(),
573
+ artifacts: z8.array(workerContextReferenceSchema).max(32).optional()
597
574
  }).strict().superRefine(({ artifacts = [] }, ctx) => {
598
575
  const seen = /* @__PURE__ */ new Set();
599
576
  for (const [index, artifact] of artifacts.entries()) {
600
577
  if (artifact.kind !== "parent-file") continue;
601
- if (seen.has(artifact.path)) ctx.addIssue({ code: z9.ZodIssueCode.custom, path: ["artifacts", index, "path"], message: `duplicate --attach path: ${artifact.path}` });
578
+ if (seen.has(artifact.path)) ctx.addIssue({ code: z8.ZodIssueCode.custom, path: ["artifacts", index, "path"], message: `duplicate --attach path: ${artifact.path}` });
602
579
  seen.add(artifact.path);
603
580
  }
604
581
  });
605
- var workerInputSchema = z9.object({
582
+ var workerInputSchema = z8.object({
606
583
  source: workerContextReferenceSchema,
607
- path: z9.string().min(1).max(8192),
584
+ path: z8.string().min(1).max(8192),
608
585
  /** Parent attachment and parent file: SHA-256 of copied bytes. Baseline file: SHA-256 of the pinned Git blob ID
609
586
  * (the lowercase hexadecimal ID as UTF-8 text), not of file contents. Interpret by source.kind. */
610
587
  sha256: requestHashSchema,
611
- bytes: z9.number().int().min(0).max(Number.MAX_SAFE_INTEGER)
588
+ bytes: z8.number().int().min(0).max(Number.MAX_SAFE_INTEGER)
612
589
  }).strict();
613
- var workerInputRecipeSchema = z9.object({
614
- text: z9.string().max(1e5).optional(),
615
- inputs: z9.array(workerInputSchema).max(32)
590
+ var workerInputRecipeSchema = z8.object({
591
+ text: z8.string().max(1e5).optional(),
592
+ inputs: z8.array(workerInputSchema).max(32)
616
593
  }).strict();
617
- var unavailableEvidenceSchema = z9.object({ state: z9.literal("unavailable"), reason: z9.enum(["no-assistant-output", "missing", "unreadable", "unverified"]), detail: errorSchema.optional() }).strict();
618
- var deletedEvidenceSchema = z9.object({ state: z9.literal("deleted"), reason: z9.literal("missing") }).strict();
619
- var executionOutcomeSchema = z9.enum(["running", "review-ready", "completed", "failed", "cancelled"]);
620
- var workerArtifactSchema = z9.discriminatedUnion("state", [
621
- z9.object({ state: z9.literal("available"), id: z9.string().max(255), path: z9.string().max(8192) }).strict(),
622
- unavailableEvidenceSchema.extend({ id: z9.string().max(255), path: z9.string().max(8192) }),
623
- deletedEvidenceSchema.extend({ id: z9.string().max(255), path: z9.string().max(8192) })
594
+ var unavailableEvidenceSchema = z8.object({ state: z8.literal("unavailable"), reason: z8.enum(["no-assistant-output", "missing", "unreadable", "unverified"]), detail: errorSchema.optional() }).strict();
595
+ var deletedEvidenceSchema = z8.object({ state: z8.literal("deleted"), reason: z8.literal("missing") }).strict();
596
+ var executionOutcomeSchema = z8.enum(["running", "review-ready", "completed", "failed", "cancelled"]);
597
+ var workerArtifactSchema = z8.discriminatedUnion("state", [
598
+ z8.object({ state: z8.literal("available"), id: z8.string().max(255), path: z8.string().max(8192) }).strict(),
599
+ unavailableEvidenceSchema.extend({ id: z8.string().max(255), path: z8.string().max(8192) }),
600
+ deletedEvidenceSchema.extend({ id: z8.string().max(255), path: z8.string().max(8192) })
624
601
  ]);
625
- var workerCollectedResultSchema = z9.object({
626
- workerId: z9.uuid(),
627
- parentRunId: z9.uuid(),
628
- revision: z9.number().int().nonnegative(),
629
- observedAt: z9.iso.datetime(),
630
- status: runStatusSchema,
631
- outcome: z9.enum(["running", "review-ready", "completed", "failed", "cancelled", "destroyed"]),
602
+ var workerCollectedResultSchema = z8.object({
603
+ workerId: z8.uuid(),
604
+ parentRunId: z8.uuid(),
605
+ revision: z8.number().int().nonnegative(),
606
+ observedAt: z8.iso.datetime(),
607
+ status: z8.enum(["queued", "running", "waiting", "review", "done", "failed", "cancelled"]),
608
+ outcome: z8.enum(["running", "review-ready", "completed", "failed", "cancelled", "destroyed"]),
632
609
  lastExecutionOutcome: executionOutcomeSchema,
633
- partial: z9.boolean(),
634
- settled: z9.boolean(),
610
+ partial: z8.boolean(),
611
+ settled: z8.boolean(),
635
612
  error: errorSchema.optional(),
636
613
  backend: workerBackendSchema.optional(),
637
- model: z9.string().max(512).optional(),
614
+ model: z8.string().max(512).optional(),
638
615
  baselineSha: commitShaSchema,
639
- workspace: workerWorkspaceSchema.extend({ state: z9.enum(["available", "unavailable", "deleted"]).optional() }),
640
- cleanup: z9.enum(["retained", "requested", "terminating", "cleaning", "complete", "incomplete"]),
641
- summary: z9.discriminatedUnion("state", [
616
+ workspace: workerWorkspaceSchema.extend({ state: z8.enum(["available", "unavailable", "deleted"]).optional() }),
617
+ cleanup: z8.enum(["retained", "requested", "terminating", "cleaning", "complete", "incomplete"]),
618
+ summary: z8.discriminatedUnion("state", [
642
619
  // `failure`: the worker failed, and the text names the runner's failure reason (hearsay-tools/squawk#3337).
643
- z9.object({ state: z9.literal("available"), text: z9.string().min(1).max(4e3), source: z9.enum(["assistant", "failure"]), seq: z9.number().int().nonnegative(), truncated: z9.boolean() }).strict(),
620
+ z8.object({ state: z8.literal("available"), text: z8.string().min(1).max(4e3), source: z8.enum(["assistant", "failure"]), seq: z8.number().int().nonnegative(), truncated: z8.boolean() }).strict(),
644
621
  unavailableEvidenceSchema,
645
622
  deletedEvidenceSchema
646
623
  ]),
647
- head: z9.discriminatedUnion("state", [
648
- z9.object({ state: z9.literal("available"), sha: commitShaSchema }).strict(),
624
+ head: z8.discriminatedUnion("state", [
625
+ z8.object({ state: z8.literal("available"), sha: commitShaSchema }).strict(),
649
626
  unavailableEvidenceSchema.extend({ sha: commitShaSchema.optional() }),
650
627
  deletedEvidenceSchema.extend({ sha: commitShaSchema.optional() })
651
628
  ]),
652
- diff: z9.discriminatedUnion("state", [
629
+ diff: z8.discriminatedUnion("state", [
653
630
  // path addresses a workerResultFileSchema JSON document; its diffSnapshot field contains the patch.
654
- z9.object({ state: z9.literal("available"), snapshotId: z9.uuid(), path: z9.string().min(1).max(8192), truncated: z9.boolean() }).strict(),
631
+ z8.object({ state: z8.literal("available"), snapshotId: z8.uuid(), path: z8.string().min(1).max(8192), truncated: z8.boolean() }).strict(),
655
632
  unavailableEvidenceSchema,
656
633
  deletedEvidenceSchema
657
634
  ]),
658
- artifacts: z9.discriminatedUnion("state", [
659
- z9.object({ state: z9.literal("available"), items: z9.array(workerArtifactSchema).max(32), truncated: z9.boolean() }).strict(),
635
+ artifacts: z8.discriminatedUnion("state", [
636
+ z8.object({ state: z8.literal("available"), items: z8.array(workerArtifactSchema).max(32), truncated: z8.boolean() }).strict(),
660
637
  unavailableEvidenceSchema,
661
638
  deletedEvidenceSchema
662
639
  ])
663
640
  }).strict();
664
- var workerResultFileSchema = z9.object({ result: workerCollectedResultSchema, diffSnapshot: z9.string().max(4e5).optional() }).strict();
665
- var workerResultReferenceSchema = z9.object({
666
- workerId: z9.uuid(),
667
- revision: z9.number().int().nonnegative(),
668
- snapshotId: z9.uuid(),
669
- observedAt: z9.iso.datetime(),
641
+ var workerResultFileSchema = z8.object({ result: workerCollectedResultSchema, diffSnapshot: z8.string().max(4e5).optional() }).strict();
642
+ var workerResultReferenceSchema = z8.object({
643
+ workerId: z8.uuid(),
644
+ revision: z8.number().int().nonnegative(),
645
+ snapshotId: z8.uuid(),
646
+ observedAt: z8.iso.datetime(),
670
647
  lastExecutionOutcome: executionOutcomeSchema,
671
- previous: z9.object({ revision: z9.number().int().nonnegative(), observedAt: z9.iso.datetime(), lastExecutionOutcome: executionOutcomeSchema }).strict().optional()
648
+ previous: z8.object({ revision: z8.number().int().nonnegative(), observedAt: z8.iso.datetime(), lastExecutionOutcome: executionOutcomeSchema }).strict().optional()
672
649
  }).strict();
673
- var delegationStateSchema = z9.discriminatedUnion("role", [
674
- z9.object({
675
- role: z9.literal("root"),
650
+ var delegationStateSchema = z8.discriminatedUnion("role", [
651
+ z8.object({
652
+ role: z8.literal("root"),
676
653
  conversation: conversationStateSchema.optional(),
677
654
  permissions: permissionsSchema,
678
655
  // #816: bounded by the creation ceiling (WORKER_CREATION_LIMIT), not by capacity.
679
- receipts: z9.array(workerCreationReceiptSchema).max(1024).refine((receipts) => new Set(receipts.map((receipt) => receipt.requestId)).size === receipts.length && new Set(receipts.map((receipt) => receipt.workerId)).size === receipts.length),
656
+ receipts: z8.array(workerCreationReceiptSchema).max(1024).refine((receipts) => new Set(receipts.map((receipt) => receipt.requestId)).size === receipts.length && new Set(receipts.map((receipt) => receipt.workerId)).size === receipts.length),
680
657
  // `wait`, `lastWait` and `completion` are the old worker-wait engine's, never written since
681
658
  // hearsay-tools/cezarion#1301: every worker wait is a list entry. Kept optional so old rows
682
659
  // parse; the store reads them into the list on open (store schemas 6 and 7).
683
660
  wait: workerWaitSchema.optional(),
684
661
  lastWait: workerWaitSchema.optional(),
685
- results: z9.array(workerResultReferenceSchema).max(1024).refine((results) => new Set(results.map((result) => result.workerId)).size === results.length).optional(),
686
- finishRequestedAt: z9.iso.datetime().optional(),
687
- historyDeletion: z9.literal("pending").optional(),
688
- completion: z9.object({ phase: z9.enum(["waiting", "attention"]), waitId: z9.uuid().optional() }).strict().optional()
662
+ results: z8.array(workerResultReferenceSchema).max(1024).refine((results) => new Set(results.map((result) => result.workerId)).size === results.length).optional(),
663
+ finishRequestedAt: z8.iso.datetime().optional(),
664
+ historyDeletion: z8.literal("pending").optional(),
665
+ completion: z8.object({ phase: z8.enum(["waiting", "attention"]), waitId: z8.uuid().optional() }).strict().optional()
689
666
  }).strict(),
690
- z9.object({
691
- role: z9.literal("worker"),
667
+ z8.object({
668
+ role: z8.literal("worker"),
692
669
  // Never written since hearsay-tools/cezarion#1301, as for a root; kept so old rows parse.
693
670
  wait: workerWaitSchema.optional(),
694
671
  lastWait: workerWaitSchema.optional(),
695
672
  permissions: permissionsSchema,
696
- parentRunId: z9.uuid(),
673
+ parentRunId: z8.uuid(),
697
674
  workspace: workerWorkspaceSchema,
698
675
  destroy: workerDestroySchema.optional(),
699
676
  context: workerInputRecipeSchema.optional(),
700
- executionRevision: z9.number().int().nonnegative().optional(),
701
- executionStartSeq: z9.number().int().nonnegative().optional()
677
+ executionRevision: z8.number().int().nonnegative().optional(),
678
+ executionStartSeq: z8.number().int().nonnegative().optional()
702
679
  }).strict(),
703
680
  // A persisted quarantine is distinct from absent legacy metadata and grants no authority.
704
- z9.object({ role: z9.literal("invalid") }).strict()
681
+ z8.object({ role: z8.literal("invalid") }).strict()
705
682
  ]);
706
- var runDelegationSummarySchema = z9.discriminatedUnion("role", [
683
+ var runDelegationSummarySchema = z8.discriminatedUnion("role", [
707
684
  delegationStateSchema.options[0].pick({ role: true }).strip().extend({
708
685
  // The awaited worker ids and which of them reported (ids only) keep a list's counted label,
709
686
  // "waiting on 2 workers" (#617), now that lists read summaries instead of records (#817).
710
687
  wait: workerWaitSchema.pick({ phase: true, requestIds: true, workerIds: true }).partial({ workerIds: true }).strip().extend({
711
- outcomes: z9.array(workerOutcomeSchema.pick({ workerId: true }).strip()).max(32).optional()
688
+ outcomes: z8.array(workerOutcomeSchema.pick({ workerId: true }).strip()).max(32).optional()
712
689
  }).optional()
713
690
  }),
714
691
  // `parentRunId` is the one worker field a list needs: the sidebar lights the parent's row for
@@ -718,70 +695,70 @@ var runDelegationSummarySchema = z9.discriminatedUnion("role", [
718
695
  }),
719
696
  delegationStateSchema.options[2].strip()
720
697
  ]);
721
- var workerSpawnRequestSchema = z9.object({
722
- task: z9.string().min(1).max(1e5),
723
- baseline: z9.string().min(1).max(1024),
724
- requestId: z9.uuid(),
698
+ var workerSpawnRequestSchema = z8.object({
699
+ task: z8.string().min(1).max(1e5),
700
+ baseline: z8.string().min(1).max(1024),
701
+ requestId: z8.uuid(),
725
702
  context: workerContextSchema.optional(),
726
703
  backend: workerBackendSchema.optional(),
727
- model: z9.string().trim().min(1).max(512).optional(),
704
+ model: z8.string().trim().min(1).max(512).optional(),
728
705
  effort: effortFieldSchema,
729
706
  /** Catalog workflow name (built-in quick-task or `.ai/cezar/workflows/*.yaml`, #451). Absent with no skill means quick-task. */
730
- workflow: z9.string().trim().min(1).max(200).optional(),
707
+ workflow: z8.string().trim().min(1).max(200).optional(),
731
708
  /** Discovered skill to run as a one-step task, mutually exclusive with workflow (#778). */
732
- skill: z9.string().trim().min(1).max(200).optional()
709
+ skill: z8.string().trim().min(1).max(200).optional()
733
710
  }).strict().refine((request) => request.skill === void 0 || request.workflow === void 0, { message: "--skill and --workflow cannot be used together" }).refine((request) => request.task.length + (request.context?.text?.length ?? 0) <= 1e5, { message: "Combined task and context exceed 100000 characters" });
734
- var workerSteerRequestSchema = z9.object({
735
- text: z9.string().max(1e5).refine((text) => text.trim().length > 0)
711
+ var workerSteerRequestSchema = z8.object({
712
+ text: z8.string().max(1e5).refine((text) => text.trim().length > 0)
736
713
  }).strict();
737
- var workerWaitRequestSchema = z9.object({
714
+ var workerWaitRequestSchema = z8.object({
738
715
  workerIds: workerIdsSchema,
739
- timeoutSeconds: z9.number().int().min(1).max(7200).default(600),
716
+ timeoutSeconds: z8.number().int().min(1).max(7200).default(600),
740
717
  mode: workerWaitModeSchema.optional()
741
718
  }).strict().refine((request) => request.mode !== "one" || request.workerIds.length === 1, { message: "one mode requires exactly one worker" });
742
- var inboxClaimSchema = z9.object({
743
- receiptId: z9.uuid(),
744
- generation: z9.uuid(),
745
- expiresAt: z9.iso.datetime(),
746
- acknowledgedAt: z9.iso.datetime().optional(),
719
+ var inboxClaimSchema = z8.object({
720
+ receiptId: z8.uuid(),
721
+ generation: z8.uuid(),
722
+ expiresAt: z8.iso.datetime(),
723
+ acknowledgedAt: z8.iso.datetime().optional(),
747
724
  /** Optional on read for receipts persisted before member manifests existed. */
748
- memberIds: z9.array(z9.uuid()).min(1).max(32).refine((ids) => new Set(ids).size === ids.length).optional()
725
+ memberIds: z8.array(z8.uuid()).min(1).max(32).refine((ids) => new Set(ids).size === ids.length).optional()
749
726
  }).strict();
750
- var agentInputSchema = z9.object({
727
+ var agentInputSchema = z8.object({
751
728
  conversation: conversationAttributionSchema.optional(),
752
- id: z9.uuid(),
753
- source: z9.enum(["agent", "lifecycle"]),
754
- parentRunId: z9.uuid(),
755
- text: z9.string().min(1).max(1e5),
756
- createdAt: z9.iso.datetime(),
757
- deliveredAt: z9.iso.datetime().optional(),
729
+ id: z8.uuid(),
730
+ source: z8.enum(["agent", "lifecycle"]),
731
+ parentRunId: z8.uuid(),
732
+ text: z8.string().min(1).max(1e5),
733
+ createdAt: z8.iso.datetime(),
734
+ deliveredAt: z8.iso.datetime().optional(),
758
735
  /** The model received it, when the harness can show that (#505). Absent on
759
736
  * unobservable backends and on records written before #505. */
760
- consumedAt: z9.iso.datetime().optional(),
737
+ consumedAt: z8.iso.datetime().optional(),
761
738
  /** Accepted by a harness that reports reading, and not read yet. A restart replays
762
739
  * such input; records written before #505 never carry it, so nothing historical replays. */
763
- awaitingRead: z9.literal(true).optional(),
740
+ awaitingRead: z8.literal(true).optional(),
764
741
  inboxClaim: inboxClaimSchema.optional(),
765
742
  /** A completion refusal Squawk queued for a closed session (hearsay-tools/cezarion#1301): its
766
743
  * delivery is the nudge's turn, bounded by the nudge's reply bound, and a session that closes
767
744
  * before it is a failed delivery. `undelivered-question` is Squawk's answer to a worker question
768
745
  * that could not reach its live parent (hearsay-tools/cezarion#2410). Absent on every other input
769
746
  * and on records written before. */
770
- purpose: z9.enum(["completion-refusal", "undelivered-question"]).optional(),
747
+ purpose: z8.enum(["completion-refusal", "undelivered-question"]).optional(),
771
748
  /** A peer message's own hash and request deadline (hearsay-tools/cezarion#1990): the sender's
772
749
  * ledger can be deleted before the recipient reads it. Absent on family and lifecycle inputs. */
773
- requestHash: z9.string().regex(/^[0-9a-f]{64}$/).optional(),
774
- deadline: z9.iso.datetime().optional()
750
+ requestHash: z8.string().regex(/^[0-9a-f]{64}$/).optional(),
751
+ deadline: z8.iso.datetime().optional()
775
752
  }).strict();
776
- var workerInspectionSchema = z9.object({
777
- workerId: z9.uuid(),
778
- parentRunId: z9.uuid(),
779
- status: z9.enum(["queued", "running", "waiting", ...workerOutcomeSchema.shape.status.options]),
780
- currentStepId: z9.string().optional(),
753
+ var workerInspectionSchema = z8.object({
754
+ workerId: z8.uuid(),
755
+ parentRunId: z8.uuid(),
756
+ status: z8.enum(["queued", "running", "waiting", ...workerOutcomeSchema.shape.status.options]),
757
+ currentStepId: z8.string().optional(),
781
758
  workspace: workerWorkspaceSchema,
782
759
  backend: workerBackendSchema.optional(),
783
- model: z9.string().max(512).optional(),
784
- inputs: z9.array(workerInputSchema).max(32).optional(),
760
+ model: z8.string().max(512).optional(),
761
+ inputs: z8.array(workerInputSchema).max(32).optional(),
785
762
  wait: workerWaitSchema.optional(),
786
763
  /** The parent's deadline-less completion wait on this worker (hearsay-tools/cezarion#1301). */
787
764
  completionWait: workerCompletionWaitSchema.optional(),
@@ -795,58 +772,58 @@ var workerListEntrySchema = workerInspectionSchema.pick({
795
772
  workspace: true,
796
773
  destroy: true
797
774
  }).extend({
798
- revision: z9.number().int().nonnegative(),
799
- settled: z9.boolean(),
800
- destroyed: z9.boolean()
775
+ revision: z8.number().int().nonnegative(),
776
+ settled: z8.boolean(),
777
+ destroyed: z8.boolean()
801
778
  }).strict();
802
- var workerListResultSchema = z9.object({ workers: z9.array(workerListEntrySchema).max(1024) }).strict();
803
- var workerListQuerySchema = z9.object({ offset: z9.string().regex(/^\d{1,4}$/).refine((value) => Number(value) <= 1024).optional() }).strict();
779
+ var workerListResultSchema = z8.object({ workers: z8.array(workerListEntrySchema).max(1024) }).strict();
780
+ var workerListQuerySchema = z8.object({ offset: z8.string().regex(/^\d{1,4}$/).refine((value) => Number(value) <= 1024).optional() }).strict();
804
781
  var workerListPageSchema = workerListResultSchema.extend({
805
- workers: z9.array(workerListEntrySchema).max(32),
806
- nextOffset: z9.number().int().min(1).max(1024).optional()
782
+ workers: z8.array(workerListEntrySchema).max(32),
783
+ nextOffset: z8.number().int().min(1).max(1024).optional()
807
784
  }).strict();
808
- var workerDiffSchema = z9.object({
809
- workerId: z9.uuid(),
785
+ var workerDiffSchema = z8.object({
786
+ workerId: z8.uuid(),
810
787
  baselineSha: commitShaSchema,
811
- diff: z9.string().max(4e5),
812
- truncated: z9.boolean()
813
- });
814
- var workerStopResultSchema = z9.object({
815
- workerId: z9.uuid(),
816
- state: z9.enum(["stopping", "terminated"])
817
- });
818
- var workerDestroyResultSchema = z9.object({
819
- workerId: z9.uuid(),
820
- state: z9.enum(["complete", "incomplete"]),
821
- deleted: z9.array(z9.discriminatedUnion("kind", [
822
- z9.object({ kind: z9.literal("worktree"), path: z9.string().max(8192) }).strict(),
823
- z9.object({ kind: z9.literal("branch"), ref: z9.string().max(1024) }).strict()
788
+ diff: z8.string().max(4e5),
789
+ truncated: z8.boolean()
790
+ });
791
+ var workerStopResultSchema = z8.object({
792
+ workerId: z8.uuid(),
793
+ state: z8.enum(["stopping", "terminated"])
794
+ });
795
+ var workerDestroyResultSchema = z8.object({
796
+ workerId: z8.uuid(),
797
+ state: z8.enum(["complete", "incomplete"]),
798
+ deleted: z8.array(z8.discriminatedUnion("kind", [
799
+ z8.object({ kind: z8.literal("worktree"), path: z8.string().max(8192) }).strict(),
800
+ z8.object({ kind: z8.literal("branch"), ref: z8.string().max(1024) }).strict()
824
801
  ])).max(2).optional(),
825
802
  remaining: remainingSchema,
826
803
  error: errorSchema.optional()
827
804
  });
828
- var workerCapacitySchema = z9.object({
829
- outstanding: z9.number().int().nonnegative(),
830
- limit: z9.number().int().nonnegative(),
831
- created: z9.number().int().nonnegative(),
832
- creationLimit: z9.number().int().nonnegative()
805
+ var workerCapacitySchema = z8.object({
806
+ outstanding: z8.number().int().nonnegative(),
807
+ limit: z8.number().int().nonnegative(),
808
+ created: z8.number().int().nonnegative(),
809
+ creationLimit: z8.number().int().nonnegative()
833
810
  }).strict();
834
- var relatedRunTitleSchema = z9.object({
835
- id: z9.string(),
836
- title: z9.string(),
837
- titleSummary: z9.string().optional(),
838
- titleOrigin: z9.enum(["user", "auto", "marker"]).optional()
839
- });
840
- var runRelationshipsSchema = z9.object({
841
- parentRunId: z9.uuid().optional(),
842
- workers: z9.array(workerInspectionSchema).max(1024),
811
+ var relatedRunTitleSchema = z8.object({
812
+ id: z8.string(),
813
+ title: z8.string(),
814
+ titleSummary: z8.string().optional(),
815
+ titleOrigin: z8.enum(["user", "auto", "marker"]).optional()
816
+ });
817
+ var runRelationshipsSchema = z8.object({
818
+ parentRunId: z8.uuid().optional(),
819
+ workers: z8.array(workerInspectionSchema).max(1024),
843
820
  /** The parent's title for a worker, each worker's for a parent; absent when there is none. */
844
- titles: z9.array(relatedRunTitleSchema).max(1025).optional(),
821
+ titles: z8.array(relatedRunTitleSchema).max(1025).optional(),
845
822
  /** Present for a delegation root only. */
846
823
  capacity: workerCapacitySchema.optional()
847
824
  });
848
- var delegationErrorResponseSchema = z9.object({
849
- code: z9.enum([
825
+ var delegationErrorResponseSchema = z8.object({
826
+ code: z8.enum([
850
827
  "unavailable_transport",
851
828
  "unauthenticated",
852
829
  "denied_scope",
@@ -860,124 +837,124 @@ var delegationErrorResponseSchema = z9.object({
860
837
  error: errorSchema,
861
838
  modelChoices: modelChoicesSchema.optional()
862
839
  });
863
- var workerParamsSchema = z9.object({ workerId: z9.uuid() }).strict();
864
- var workerSpawnResultSchema = z9.object({ workerId: z9.uuid(), baselineSha: commitShaSchema }).strict();
865
- var workerSteerResultSchema = z9.object({ workerId: z9.uuid(), state: z9.enum(["queued", "delivered"]) }).strict();
866
- var workerWaitResultSchema = z9.object({ wait: workerWaitSchema, instruction: z9.string().min(1).max(1e3) }).strict();
867
- var workerEmptyRequestSchema = z9.object({}).strict();
868
- var workerCancelWaitRequestSchema = z9.object({ waitId: z9.uuid() }).strict();
869
- var workerCancelWaitResultSchema = z9.object({ wait: workerWaitSchema }).strict();
870
- var peerWaitRequestSchema = z9.object({
840
+ var workerParamsSchema = z8.object({ workerId: z8.uuid() }).strict();
841
+ var workerSpawnResultSchema = z8.object({ workerId: z8.uuid(), baselineSha: commitShaSchema }).strict();
842
+ var workerSteerResultSchema = z8.object({ workerId: z8.uuid(), state: z8.enum(["queued", "delivered"]) }).strict();
843
+ var workerWaitResultSchema = z8.object({ wait: workerWaitSchema, instruction: z8.string().min(1).max(1e3) }).strict();
844
+ var workerEmptyRequestSchema = z8.object({}).strict();
845
+ var workerCancelWaitRequestSchema = z8.object({ waitId: z8.uuid() }).strict();
846
+ var workerCancelWaitResultSchema = z8.object({ wait: workerWaitSchema }).strict();
847
+ var peerWaitRequestSchema = z8.object({
871
848
  peerIds: workerIdsSchema,
872
- timeoutSeconds: z9.number().int().min(1).max(7200).default(600)
849
+ timeoutSeconds: z8.number().int().min(1).max(7200).default(600)
873
850
  }).strict();
874
- var peerWaitResultSchema = z9.discriminatedUnion("reason", [
875
- z9.object({ reason: z9.literal("message"), peerRunId: z9.uuid(), messageId: z9.uuid() }).strict(),
876
- z9.object({ reason: z9.literal("settled"), peerRunId: z9.uuid() }).strict(),
877
- z9.object({ reason: z9.literal("timeout") }).strict()
851
+ var peerWaitResultSchema = z8.discriminatedUnion("reason", [
852
+ z8.object({ reason: z8.literal("message"), peerRunId: z8.uuid(), messageId: z8.uuid() }).strict(),
853
+ z8.object({ reason: z8.literal("settled"), peerRunId: z8.uuid() }).strict(),
854
+ z8.object({ reason: z8.literal("timeout") }).strict()
878
855
  ]);
879
856
  function refinePeerWaitResult(wait, ctx) {
880
857
  if ((wait.phase === "resolved" || wait.phase === "delivered") && !wait.result) ctx.addIssue({ code: "custom", message: `a ${wait.phase} peer wait has a result`, path: ["result"] });
881
858
  if (wait.phase === "open" && wait.result) ctx.addIssue({ code: "custom", message: "an open peer wait has no result", path: ["result"] });
882
859
  }
883
- var peerWaitViewSchema = z9.object({
884
- id: z9.uuid(),
860
+ var peerWaitViewSchema = z8.object({
861
+ id: z8.uuid(),
885
862
  peerIds: workerIdsSchema,
886
- deadline: z9.iso.datetime(),
887
- phase: z9.enum(["open", "resolved", "delivered", "cancelled"]),
863
+ deadline: z8.iso.datetime(),
864
+ phase: z8.enum(["open", "resolved", "delivered", "cancelled"]),
888
865
  result: peerWaitResultSchema.optional()
889
866
  }).strict().superRefine(refinePeerWaitResult);
890
- var peerWaitRegisteredSchema = z9.object({ wait: peerWaitViewSchema, instruction: z9.string().min(1).max(1e3) }).strict();
891
- var peerCancelWaitResultSchema = z9.object({ wait: peerWaitViewSchema }).strict();
892
- var delegationWaitResultSchema = z9.union([workerWaitResultSchema, peerWaitRegisteredSchema]);
893
- var delegationCancelWaitResultSchema = z9.union([workerCancelWaitResultSchema, peerCancelWaitResultSchema]);
867
+ var peerWaitRegisteredSchema = z8.object({ wait: peerWaitViewSchema, instruction: z8.string().min(1).max(1e3) }).strict();
868
+ var peerCancelWaitResultSchema = z8.object({ wait: peerWaitViewSchema }).strict();
869
+ var delegationWaitResultSchema = z8.union([workerWaitResultSchema, peerWaitRegisteredSchema]);
870
+ var delegationCancelWaitResultSchema = z8.union([workerCancelWaitResultSchema, peerCancelWaitResultSchema]);
894
871
 
895
872
  // ../contract/src/events.ts
896
- var runEventSchema = z10.looseObject({
897
- seq: z10.number(),
898
- ts: z10.string(),
899
- stepId: z10.string().optional(),
900
- type: z10.string()
901
- });
902
- var conversationMessageEventSchema = runEventSchema.extend({ type: z10.literal("conversation-message"), message: conversationMessageSchema, delivery: z10.enum(["queued", "delivered", "consumed", "not-delivered"]), deliveredAt: z10.iso.datetime().optional(), consumedAt: z10.iso.datetime().optional() });
903
- var requestOutcomeEventSchema = runEventSchema.extend({ type: z10.literal("request-outcome"), outcome: requestOutcomeSchema });
873
+ var runEventSchema = z9.looseObject({
874
+ seq: z9.number(),
875
+ ts: z9.string(),
876
+ stepId: z9.string().optional(),
877
+ type: z9.string()
878
+ });
879
+ var conversationMessageEventSchema = runEventSchema.extend({ type: z9.literal("conversation-message"), message: conversationMessageSchema, delivery: z9.enum(["queued", "delivered", "consumed", "not-delivered"]), deliveredAt: z9.iso.datetime().optional(), consumedAt: z9.iso.datetime().optional() });
880
+ var requestOutcomeEventSchema = runEventSchema.extend({ type: z9.literal("request-outcome"), outcome: requestOutcomeSchema });
904
881
  var agentInputEventSchema = runEventSchema.extend({
905
- type: z10.literal("agent-input"),
882
+ type: z9.literal("agent-input"),
906
883
  input: agentInputSchema
907
884
  });
908
885
  var humanInputDeliveredEventSchema = runEventSchema.extend({
909
- type: z10.literal("human-input-delivered"),
910
- askSeq: z10.number().int().nonnegative(),
886
+ type: z9.literal("human-input-delivered"),
887
+ askSeq: z9.number().int().nonnegative(),
911
888
  /** Who answered: absent (records before #505) or `human` is a person; `parent` is the
912
889
  * owning parent's reply to a routed worker question; `cezar` is Squawk's notice that the question
913
890
  * could not reach a live parent (hearsay-tools/cezarion#2410). */
914
- source: z10.enum(["human", "parent", "cezar"]).optional()
891
+ source: z9.enum(["human", "parent", "cezar"]).optional()
915
892
  });
916
893
  var humanAskClosedEventSchema = runEventSchema.extend({
917
- type: z10.literal("human-ask-closed"),
918
- askSeq: z10.number().int().nonnegative(),
919
- reason: z10.enum(["finish", "superseded", "parent-stopped", "worker-stopped", "undeliverable"])
894
+ type: z9.literal("human-ask-closed"),
895
+ askSeq: z9.number().int().nonnegative(),
896
+ reason: z9.enum(["finish", "superseded", "parent-stopped", "worker-stopped", "undeliverable"])
920
897
  });
921
898
  var workerQuestionRoutedEventSchema = runEventSchema.extend({
922
- type: z10.literal("worker-question-routed"),
923
- askSeq: z10.number().int().nonnegative(),
924
- messageId: z10.uuid(),
925
- parentRunId: z10.uuid()
899
+ type: z9.literal("worker-question-routed"),
900
+ askSeq: z9.number().int().nonnegative(),
901
+ messageId: z9.uuid(),
902
+ parentRunId: z9.uuid()
926
903
  });
927
904
  var workerQuestionFallbackEventSchema = runEventSchema.extend({
928
- type: z10.literal("worker-question-fallback"),
929
- askSeq: z10.number().int().nonnegative(),
930
- reason: z10.string().min(1).max(200)
905
+ type: z9.literal("worker-question-fallback"),
906
+ askSeq: z9.number().int().nonnegative(),
907
+ reason: z9.string().min(1).max(200)
931
908
  });
932
909
  var workerQuestionUndeliveredEventSchema = runEventSchema.extend({
933
- type: z10.literal("worker-question-undelivered"),
934
- askSeq: z10.number().int().nonnegative(),
935
- reason: z10.string().min(1).max(200)
910
+ type: z9.literal("worker-question-undelivered"),
911
+ askSeq: z9.number().int().nonnegative(),
912
+ reason: z9.string().min(1).max(200)
936
913
  });
937
914
  var workerOutcomeEventSchema = runEventSchema.extend({
938
- type: z10.literal("worker-outcome"),
915
+ type: z9.literal("worker-outcome"),
939
916
  outcome: workerOutcomeSchema
940
917
  });
941
918
  var RUN_HISTORY_PAGE_ITEMS = 100;
942
- var runIdParamSchema = z10.object({
943
- id: z10.string().min(1).max(128).regex(/^[A-Za-z0-9._-]+$/)
919
+ var runIdParamSchema = z9.object({
920
+ id: z9.string().min(1).max(128).regex(/^[A-Za-z0-9._-]+$/)
944
921
  });
945
- var runHistoryCursorSchema = z10.string().min(1).max(2048);
946
- var runHistoryQuerySchema = z10.object({
922
+ var runHistoryCursorSchema = z9.string().min(1).max(2048);
923
+ var runHistoryQuerySchema = z9.object({
947
924
  cursor: runHistoryCursorSchema.optional()
948
925
  });
949
- var runEventsQuerySchema = z10.object({
926
+ var runEventsQuerySchema = z9.object({
950
927
  cursor: runHistoryCursorSchema.optional(),
951
- afterSeq: z10.coerce.number().int().nonnegative().optional()
952
- });
953
- var runHistoryEventSchema = z10.object({
954
- seq: z10.number(),
955
- ts: z10.string(),
956
- stepId: z10.string().optional(),
957
- type: z10.string()
958
- }).catchall(z10.any());
959
- var runHistoryPageSchema = z10.object({
960
- events: z10.array(runHistoryEventSchema),
961
- itemCount: z10.number().int().min(0).max(RUN_HISTORY_PAGE_ITEMS),
928
+ afterSeq: z9.coerce.number().int().nonnegative().optional()
929
+ });
930
+ var runHistoryEventSchema = z9.object({
931
+ seq: z9.number(),
932
+ ts: z9.string(),
933
+ stepId: z9.string().optional(),
934
+ type: z9.string()
935
+ }).catchall(z9.any());
936
+ var runHistoryPageSchema = z9.object({
937
+ events: z9.array(runHistoryEventSchema),
938
+ itemCount: z9.number().int().min(0).max(RUN_HISTORY_PAGE_ITEMS),
962
939
  olderCursor: runHistoryCursorSchema.optional(),
963
940
  newerCursor: runHistoryCursorSchema.optional(),
964
941
  liveCursor: runHistoryCursorSchema,
965
- asOfSeq: z10.number().int().nonnegative(),
966
- hasOlder: z10.boolean()
967
- });
968
- var runHistoryContextSchema = z10.object({
969
- contextEvents: z10.array(runHistoryEventSchema),
970
- asOfSeq: z10.number().int().nonnegative()
971
- });
972
- var checkoutProgressEventSchema = z10.object({
973
- checkoutId: z10.string().optional(),
974
- name: z10.string(),
975
- phase: z10.enum(["cloning", "done", "error"]),
976
- line: z10.string().optional(),
977
- error: z10.string().optional(),
942
+ asOfSeq: z9.number().int().nonnegative(),
943
+ hasOlder: z9.boolean()
944
+ });
945
+ var runHistoryContextSchema = z9.object({
946
+ contextEvents: z9.array(runHistoryEventSchema),
947
+ asOfSeq: z9.number().int().nonnegative()
948
+ });
949
+ var checkoutProgressEventSchema = z9.object({
950
+ checkoutId: z9.string().optional(),
951
+ name: z9.string(),
952
+ phase: z9.enum(["cloning", "done", "error"]),
953
+ line: z9.string().optional(),
954
+ error: z9.string().optional(),
978
955
  /** On `done` only: the project was created and registered, but a later step did not finish
979
956
  * (new-project flow, spec 2026-10-15-create-new-project). Names what exists and how to finish. */
980
- warning: z10.string().optional()
957
+ warning: z9.string().optional()
981
958
  });
982
959
 
983
960
  // ../contract/src/ask.ts
@@ -1025,25 +1002,25 @@ function askCardOf(ask) {
1025
1002
  }
1026
1003
 
1027
1004
  // ../contract/src/health.ts
1028
- import { z as z12 } from "zod";
1005
+ import { z as z11 } from "zod";
1029
1006
 
1030
1007
  // ../contract/src/repo-info.ts
1031
- import { z as z11 } from "zod";
1032
- var repoInfoSchema = z11.object({
1033
- root: z11.string(),
1034
- branch: z11.string(),
1035
- remote: z11.string().optional()
1008
+ import { z as z10 } from "zod";
1009
+ var repoInfoSchema = z10.object({
1010
+ root: z10.string(),
1011
+ branch: z10.string(),
1012
+ remote: z10.string().optional()
1036
1013
  });
1037
1014
 
1038
1015
  // ../contract/src/health.ts
1039
- var backendCheckSchema = z12.object({
1040
- name: z12.enum([...runnerSchema.options, "gh", "git"]),
1041
- available: z12.boolean(),
1042
- version: z12.string().optional(),
1043
- hint: z12.string().optional()
1044
- });
1045
- var forgeInfoSchema = z12.object({
1046
- kind: z12.literal("github"),
1016
+ var backendCheckSchema = z11.object({
1017
+ name: z11.enum([...runnerSchema.options, "gh", "git"]),
1018
+ available: z11.boolean(),
1019
+ version: z11.string().optional(),
1020
+ hint: z11.string().optional()
1021
+ });
1022
+ var forgeInfoSchema = z11.object({
1023
+ kind: z11.literal("github"),
1047
1024
  /**
1048
1025
  * Whether the forge is reachable — **absent until the availability probe has warmed**.
1049
1026
  *
@@ -1051,20 +1028,20 @@ var forgeInfoSchema = z12.object({
1051
1028
  * "not determined yet", which is not the same as `false`, and the cockpit renders the two
1052
1029
  * differently. Declaring it required is what made an earlier hand-written mirror wrong.
1053
1030
  */
1054
- available: z12.boolean().optional(),
1055
- reason: z12.string().optional()
1031
+ available: z11.boolean().optional(),
1032
+ reason: z11.string().optional()
1056
1033
  });
1057
- var capabilitiesSchema = z12.object({
1058
- localHandoff: z12.boolean(),
1034
+ var capabilitiesSchema = z11.object({
1035
+ localHandoff: z11.boolean(),
1059
1036
  /**
1060
1037
  * `true` means this cockpit may edit Agent config and worktree setup: it is local, or the host
1061
1038
  * operator ran `cez remote-settings enable` for this cockpit's listen port and it binds loopback
1062
1039
  * (hearsay-tools/cezarion#2428). Both persist commands the host runs.
1063
1040
  */
1064
- settingsAdmin: z12.boolean(),
1041
+ settingsAdmin: z11.boolean(),
1065
1042
  /** `true` when `settingsAdmin` comes from the host switch on a remote cockpit, not from a local one. */
1066
- remoteSettingsAdmin: z12.boolean(),
1067
- singleProject: z12.boolean(),
1043
+ remoteSettingsAdmin: z11.boolean(),
1044
+ singleProject: z11.boolean(),
1068
1045
  /**
1069
1046
  * `true` by default; only `CEZ_AUTOMATIONS=0` disables automations. When disabled,
1070
1047
  * the whole feature is absent: no `Automations` nav item anywhere it is rendered, the
@@ -1072,7 +1049,7 @@ var capabilitiesSchema = z12.object({
1072
1049
  *
1073
1050
  * REQUIRED for the same reason as `tokenMetrics` below: this server always sends it.
1074
1051
  */
1075
- automations: z12.boolean(),
1052
+ automations: z11.boolean(),
1076
1053
  /**
1077
1054
  * `true` means `CEZ_PREVIEW=1` opted this server into live preview (#781): the `cezar_preview_serve`
1078
1055
  * tool is listed, its route answers, the preview WebSocket upgrades and the cockpit offers the
@@ -1080,7 +1057,7 @@ var capabilitiesSchema = z12.object({
1080
1057
  *
1081
1058
  * REQUIRED for the same reason as `tokenMetrics` below: this server always sends it.
1082
1059
  */
1083
- preview: z12.boolean(),
1060
+ preview: z11.boolean(),
1084
1061
  /**
1085
1062
  * `true` means `CEZ_VOICE=1` opted this server into voice mode and a way to decide exists:
1086
1063
  * `TYPESAFE_API_KEY` is set, or `CEZ_DRY_RUN=1` supplies the fake engine. Off — the default —
@@ -1088,7 +1065,7 @@ var capabilitiesSchema = z12.object({
1088
1065
  *
1089
1066
  * REQUIRED for the same reason as `tokenMetrics` below: this server always sends it.
1090
1067
  */
1091
- voice: z12.boolean(),
1068
+ voice: z11.boolean(),
1092
1069
  /**
1093
1070
  * `false` means `CEZ_HIDE_TOKEN_METRICS=1` asks the browser to omit token counts and monetary
1094
1071
  * cost (#481). The telemetry itself still rides in run/event payloads — this is presentation
@@ -1101,32 +1078,55 @@ var capabilitiesSchema = z12.object({
1101
1078
  * `web/src/lib/token-metrics.ts`, whose `!== false` read still treats an absent field as
1102
1079
  * visible.
1103
1080
  */
1104
- tokenMetrics: z12.boolean(),
1081
+ tokenMetrics: z11.boolean(),
1105
1082
  /** Current token-count presentation policy. Required on current servers;
1106
1083
  * older payload tolerance belongs in the browser resolver. */
1107
- tokenUsageMetrics: z12.boolean(),
1084
+ tokenUsageMetrics: z11.boolean(),
1108
1085
  /** Current backend-reported-cost presentation policy. */
1109
- costMetrics: z12.boolean()
1086
+ costMetrics: z11.boolean()
1110
1087
  });
1111
- var healthResponseSchema = z12.object({
1112
- version: z12.string(),
1113
- latestVersion: z12.string().optional(),
1114
- repoRoot: z12.string(),
1088
+ var healthResponseSchema = z11.object({
1089
+ version: z11.string(),
1090
+ latestVersion: z11.string().optional(),
1091
+ repoRoot: z11.string(),
1115
1092
  repo: repoInfoSchema.nullable(),
1116
- checks: z12.array(backendCheckSchema),
1093
+ checks: z11.array(backendCheckSchema),
1117
1094
  defaultRunner: runnerSchema,
1118
1095
  forge: forgeInfoSchema.nullable(),
1119
1096
  capabilities: capabilitiesSchema,
1120
1097
  // Always sent: `workspaceSummary()` returns both unconditionally, and an unreadable workspace
1121
1098
  // degrades to `projects: []` rather than to an absent key. The hand-written DTO declared them
1122
1099
  // optional, which was wider than the server has ever been.
1123
- projects: z12.array(z12.object({ id: z12.string(), name: z12.string() })),
1124
- bootProject: z12.string()
1100
+ projects: z11.array(z11.object({ id: z11.string(), name: z11.string() })),
1101
+ bootProject: z11.string()
1125
1102
  });
1126
1103
 
1127
1104
  // ../contract/src/runs.ts
1128
1105
  import { z as z20 } from "zod";
1129
1106
 
1107
+ // ../contract/src/run-status.ts
1108
+ import { z as z12 } from "zod";
1109
+ var runStatusSchema = z12.enum([
1110
+ "queued",
1111
+ "running",
1112
+ "waiting",
1113
+ "review",
1114
+ "done",
1115
+ "failed",
1116
+ "cancelled"
1117
+ ]);
1118
+ var stepStatusSchema = z12.enum([
1119
+ "pending",
1120
+ "running",
1121
+ "waiting",
1122
+ "review",
1123
+ "done",
1124
+ "failed",
1125
+ "cancelled",
1126
+ "skipped"
1127
+ ]);
1128
+ var stepKindSchema = z12.enum(["agent", "check"]);
1129
+
1130
1130
  // ../contract/src/github.ts
1131
1131
  import { z as z13 } from "zod";
1132
1132
  var checksGlyphSchema = z13.enum(["passing", "failing", "pending"]).nullable();
@@ -4835,7 +4835,7 @@ var discoveredTasksSchema = z32.object({
4835
4835
  id: z32.string(),
4836
4836
  title: z32.string(),
4837
4837
  runner: runnerSchema.optional(),
4838
- status: runStatusSchema,
4838
+ status: z32.enum(["queued", "running", "waiting", "review", "done", "failed", "cancelled"]),
4839
4839
  attention: z32.enum(["permission", "error", "waiting", "running", "unseen", "none"]),
4840
4840
  attentionLabel: z32.string(),
4841
4841
  accepts: z32.boolean(),