@hearsay-tools/squawk 0.18.0-pr3505.6261 → 0.18.0-pr3510.6265
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.
- package/dist/contract/index.js +492 -492
- package/dist/delegation/policy.d.ts +5 -0
- package/dist/delegation/policy.js +6 -1
- package/dist/delegation/policy.js.map +1 -1
- package/dist/delegation/service.js +2 -2
- package/dist/delegation/service.js.map +1 -1
- package/dist/delegation/transport.d.ts +11 -11
- package/dist/runs/run-exits.d.ts +290 -290
- package/dist/skills.js +1 -4
- package/dist/skills.js.map +1 -1
- package/dist/workflows/input-acknowledgement.d.ts +24 -24
- package/dist/workflows/run/usage-accounting.d.ts +3 -2
- package/dist/workflows/run/usage-accounting.js +8 -7
- package/dist/workflows/run/usage-accounting.js.map +1 -1
- package/dist/workflows/wait-scope.js +2 -2
- package/dist/workflows/wait-scope.js.map +1 -1
- package/package.json +4 -4
- package/web/dist/assets/activity-motion-DjMpx0QL.js +2 -0
- package/web/dist/assets/{activity-route-CcjiDVlr.js → activity-route-CE2cYbQO.js} +1 -1
- package/web/dist/assets/agent-accounts-BNlpWTOY.js +18 -0
- package/web/dist/assets/attention-VmnPpwJx.js +1 -0
- package/web/dist/assets/{cez-idle-xv7f96fc.js → cez-idle-NomdGTfa.js} +1 -1
- package/web/dist/assets/{commit-diff-panel-C071yAQE.js → commit-diff-panel-DBrsQdXO.js} +1 -1
- package/web/dist/assets/{diff-BnKrNzO6.js → diff-D81T6FlH.js} +2 -2
- package/web/dist/assets/{diff-view-D6ljveL0.js → diff-view-Sqk3iny_.js} +1 -1
- package/web/dist/assets/{file-preview-7ATj_IJp.js → file-preview-CFvc38AT.js} +1 -1
- package/web/dist/assets/{git-toolbar-BSTMJPo4.js → git-toolbar-CZAj0VNk.js} +1 -1
- package/web/dist/assets/{github-Crr8_taH.js → github-Cdg3-sQK.js} +1 -1
- package/web/dist/assets/{global-activity-route-Dlg4nNjK.js → global-activity-route-9DUVLRv0.js} +1 -1
- package/web/dist/assets/{index-DXc4Wqxm.js → index-s7PhnzDS.js} +9 -9
- package/web/dist/assets/{live-protocol-DjH6ZQwI.js → live-protocol-DBPXI6ks.js} +1 -1
- package/web/dist/assets/{popover-C930d2dH.js → popover-G6KGT-qq.js} +1 -1
- package/web/dist/assets/{preview-pane-connected-B2qXE2AQ.js → preview-pane-connected-DVlhmoyi.js} +2 -2
- package/web/dist/assets/{project-router-BRZW1N_s.js → project-router-BFKfAFvq.js} +1 -1
- package/web/dist/assets/project-scope-context-DSkcNKO7.js +4 -0
- package/web/dist/assets/{prompt-template-menu-BksxTKqX.js → prompt-template-menu-D4-inlE4.js} +1 -1
- package/web/dist/assets/queries-D2MPDhtr.js +1 -0
- package/web/dist/assets/{reference-chip-BHpiE7O2.js → reference-chip-Drpbf-MP.js} +1 -1
- package/web/dist/assets/{repo-git-2fklKmdO.js → repo-git-CwibBYwB.js} +1 -1
- package/web/dist/assets/{report-reader-Dj9NU2fc.js → report-reader-BdYHFEdw.js} +1 -1
- package/web/dist/assets/reports-CWlWhffn.js +1 -0
- package/web/dist/assets/{run-header-B_aK7sJV.js → run-header-Dc5892Cu.js} +2 -2
- package/web/dist/assets/skills-B2Cc1jJi.js +1 -0
- package/web/dist/assets/{tab-link-C87YL9QC.js → tab-link-DDpdYMnv.js} +1 -1
- package/web/dist/assets/{task-changes-e6zjxrwH.js → task-changes-CN0VE5bZ.js} +1 -1
- package/web/dist/assets/{task-commits-CJHXztnJ.js → task-commits-ycrhlORw.js} +1 -1
- package/web/dist/assets/{task-files-BK8Fhm1l.js → task-files-CjqaWaul.js} +1 -1
- package/web/dist/assets/{task-github-item-CJMKAWxL.js → task-github-item-CezPgdB9.js} +1 -1
- package/web/dist/assets/{task-thread-Cv_fZqYj.js → task-thread-BfsMGE4k.js} +6 -6
- package/web/dist/assets/{thread-state-CPb3qK6B.js → thread-state-B6Ar3fj6.js} +1 -1
- package/web/dist/assets/{use-hand-to-agent-state-DladAj2W.js → use-hand-to-agent-state-BOTjwkGM.js} +1 -1
- package/web/dist/assets/{useInfiniteQuery-Cn8aJj7F.js → useInfiniteQuery-BmfExLUr.js} +1 -1
- package/web/dist/assets/useQuery-8pHkglP4.js +1 -0
- package/web/dist/assets/{workflows-BT_I7xcp.js → workflows-B32GiY9u.js} +1 -1
- package/web/dist/assets/ws-CEQH0TUT.js +1 -0
- package/web/dist/index.html +14 -14
- package/web/dist/live-worker.js +1 -1
- package/web/dist/assets/activity-motion-yRfsq26m.js +0 -2
- package/web/dist/assets/agent-accounts-C14ohMG_.js +0 -18
- package/web/dist/assets/attention-D0CyU08o.js +0 -1
- package/web/dist/assets/project-scope-context-WRT8Dvpw.js +0 -4
- package/web/dist/assets/queries-DdqJy71d.js +0 -1
- package/web/dist/assets/reports-BE6wtSWw.js +0 -1
- package/web/dist/assets/skills-BFA2tySa.js +0 -1
- package/web/dist/assets/useQuery-CnaQ7qgN.js +0 -1
- package/web/dist/assets/ws-netTapLq.js +0 -1
package/dist/contract/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ../contract/src/events.ts
|
|
2
|
-
import { z as
|
|
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
|
|
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
|
|
158
|
-
var runnerSchema =
|
|
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
|
|
138
|
+
import { z as z7 } from "zod";
|
|
162
139
|
|
|
163
140
|
// ../contract/src/per-runner-optional-strings.ts
|
|
164
|
-
import { z as
|
|
141
|
+
import { z as z5 } from "zod";
|
|
165
142
|
function perRunnerOptionalStrings() {
|
|
166
|
-
return
|
|
167
|
-
claude:
|
|
168
|
-
codex:
|
|
169
|
-
opencode:
|
|
170
|
-
pi:
|
|
171
|
-
cursor:
|
|
172
|
-
omp:
|
|
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
|
|
178
|
-
var teamSkillRefSchema =
|
|
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 =
|
|
158
|
+
var workspaceConfigResponseSchema = z7.object({
|
|
182
159
|
/** Root exposed by the Add-project directory browser — stored as written (`~` kept). */
|
|
183
|
-
browseRoot:
|
|
160
|
+
browseRoot: z7.string(),
|
|
184
161
|
/** Checkout root for GUI-cloned projects — stored as written (`~` kept). */
|
|
185
|
-
projectsDir:
|
|
186
|
-
archiveOnMerge:
|
|
187
|
-
effectiveArchiveOnMerge:
|
|
188
|
-
archiveOnMergeSource:
|
|
189
|
-
composerDefaults:
|
|
190
|
-
autonomous:
|
|
191
|
-
worktree:
|
|
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:
|
|
194
|
-
inheritedWorktree:
|
|
170
|
+
inheritedAutonomous: z7.union([z7.boolean(), z7.literal("source-dependent")]),
|
|
171
|
+
inheritedWorktree: z7.boolean()
|
|
195
172
|
}),
|
|
196
|
-
resources:
|
|
197
|
-
maxParallel:
|
|
198
|
-
maxMonitoringSessions:
|
|
199
|
-
monitoringWakeIntervalMinutes:
|
|
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:
|
|
202
|
-
memoryLimitMb:
|
|
203
|
-
worktreeRetentionDefault:
|
|
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:
|
|
190
|
+
agentDefaults: z7.object({
|
|
214
191
|
runner: runnerSchema.optional(),
|
|
215
192
|
models: perRunnerOptionalStrings().optional()
|
|
216
193
|
})
|
|
217
194
|
});
|
|
218
|
-
var setWorkspaceConfigInputSchema =
|
|
219
|
-
browseRoot:
|
|
220
|
-
projectsDir:
|
|
221
|
-
archiveOnMerge:
|
|
222
|
-
composerDefaults:
|
|
223
|
-
autonomous:
|
|
224
|
-
worktree:
|
|
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:
|
|
205
|
+
agentDefaults: z7.object({
|
|
229
206
|
runner: runnerSchema.nullable().optional(),
|
|
230
|
-
models:
|
|
231
|
-
claude:
|
|
232
|
-
codex:
|
|
233
|
-
opencode:
|
|
234
|
-
pi:
|
|
235
|
-
cursor:
|
|
236
|
-
omp:
|
|
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:
|
|
240
|
-
maxParallel:
|
|
241
|
-
maxMonitoringSessions:
|
|
242
|
-
monitoringWakeIntervalMinutes:
|
|
243
|
-
autoResumeOnUsageLimit:
|
|
244
|
-
memoryLimitMb:
|
|
245
|
-
worktreeRetentionDefault:
|
|
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 =
|
|
249
|
-
accent:
|
|
250
|
-
density:
|
|
251
|
-
width:
|
|
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 =
|
|
230
|
+
var taskTableUiStateSchema = z7.looseObject({
|
|
254
231
|
/** Explicit user choices only. Missing ids keep the registry-owned default. */
|
|
255
|
-
expandedColumns:
|
|
232
|
+
expandedColumns: z7.record(z7.string(), z7.boolean()).optional()
|
|
256
233
|
});
|
|
257
|
-
var sidebarLimitsSchema =
|
|
258
|
-
overall:
|
|
259
|
-
needsYou:
|
|
260
|
-
finished:
|
|
261
|
-
working:
|
|
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 =
|
|
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:
|
|
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:
|
|
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:
|
|
260
|
+
lastWorktree: z7.boolean().optional(),
|
|
284
261
|
/** The last autonomous choice — remembered like `lastWorktree`. Absent → off. */
|
|
285
|
-
lastAutonomous:
|
|
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:
|
|
266
|
+
disabledTeamSkills: z7.array(teamSkillRefSchema).max(200).optional(),
|
|
290
267
|
/** Skill selection frequency (#408): name → times chosen, across BOTH composers. */
|
|
291
|
-
skillUsage:
|
|
292
|
-
runsView:
|
|
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:
|
|
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:
|
|
301
|
-
|
|
302
|
-
id:
|
|
303
|
-
label:
|
|
304
|
-
text:
|
|
305
|
-
skills:
|
|
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 =
|
|
310
|
-
projectId:
|
|
311
|
-
pathname:
|
|
312
|
-
search:
|
|
313
|
-
hash:
|
|
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 =
|
|
316
|
-
sidebar:
|
|
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:
|
|
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:
|
|
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:
|
|
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 =
|
|
333
|
+
var setWorkspaceUiStateInputSchema = z7.looseObject({
|
|
357
334
|
...workspaceUiStateSchema.shape,
|
|
358
|
-
sidebar:
|
|
359
|
-
collapsed:
|
|
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:
|
|
342
|
+
projectOrder: z7.array(z7.string().min(1).max(64)).max(WORKSPACE_UI_STATE_MAX_KEYS).optional()
|
|
366
343
|
}).optional(),
|
|
367
|
-
dismissedProviderAuthFailures:
|
|
368
|
-
claude:
|
|
369
|
-
codex:
|
|
370
|
-
opencode:
|
|
371
|
-
pi:
|
|
372
|
-
cursor:
|
|
373
|
-
omp:
|
|
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:
|
|
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 =
|
|
394
|
-
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:
|
|
373
|
+
timeoutSeconds: z7.number().int().min(1).max(WORKTREE_SETUP_MAX_TIMEOUT_SECONDS).optional()
|
|
397
374
|
}).strict();
|
|
398
|
-
var configResponseSchema =
|
|
399
|
-
archiveOnMerge:
|
|
400
|
-
effectiveArchiveOnMerge:
|
|
401
|
-
archiveOnMergeSource:
|
|
402
|
-
baseBranch:
|
|
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:
|
|
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:
|
|
384
|
+
modelsLocked: z7.boolean(),
|
|
408
385
|
/** How many tasks run at once (1–16). */
|
|
409
|
-
maxParallel:
|
|
386
|
+
maxParallel: z7.number(),
|
|
410
387
|
/** Per-task memory ceiling in MiB (whole process tree); null = no limit. */
|
|
411
|
-
memoryLimitMb:
|
|
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:
|
|
391
|
+
worktreeRetention: z7.number(),
|
|
415
392
|
/** Live title updates: null = no config key, the `CEZ_TITLE_UPDATES` env default (ON) decides. */
|
|
416
|
-
liveTitleUpdates:
|
|
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:
|
|
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:
|
|
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:
|
|
401
|
+
worktreeSetupIssue: z7.string().nullable()
|
|
425
402
|
});
|
|
426
403
|
var setConfigResponseSchema = configResponseSchema;
|
|
427
|
-
var setConfigInputSchema =
|
|
428
|
-
archiveOnMerge:
|
|
429
|
-
baseBranch:
|
|
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:
|
|
432
|
-
defaultModels:
|
|
433
|
-
claude:
|
|
434
|
-
codex:
|
|
435
|
-
opencode:
|
|
436
|
-
pi:
|
|
437
|
-
cursor:
|
|
438
|
-
omp:
|
|
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:
|
|
417
|
+
maxParallel: z7.number().int().min(1).max(16).optional(),
|
|
441
418
|
/** null or 0 clears the ceiling back to "no limit". */
|
|
442
|
-
memoryLimitMb:
|
|
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:
|
|
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:
|
|
423
|
+
liveTitleUpdates: z7.boolean().nullable().optional(),
|
|
447
424
|
/** null clears the key back to the env-default behavior (OFF). */
|
|
448
|
-
reviewGate:
|
|
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 =
|
|
431
|
+
var providerConnectionStateSchema = z7.enum([
|
|
455
432
|
"connected",
|
|
456
433
|
"disconnected",
|
|
457
434
|
"not-installed",
|
|
458
435
|
"unknown"
|
|
459
436
|
]);
|
|
460
|
-
var providerStatusSchema =
|
|
437
|
+
var providerStatusSchema = z7.object({
|
|
461
438
|
provider: providerIdSchema,
|
|
462
439
|
status: providerConnectionStateSchema,
|
|
463
|
-
enabled:
|
|
464
|
-
hint:
|
|
465
|
-
authFailureId:
|
|
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:
|
|
447
|
+
profileId: z7.string().optional()
|
|
471
448
|
});
|
|
472
|
-
var providerStatusResponseSchema =
|
|
473
|
-
providers:
|
|
449
|
+
var providerStatusResponseSchema = z7.object({
|
|
450
|
+
providers: z7.array(providerStatusSchema)
|
|
474
451
|
});
|
|
475
|
-
var providerConnectResponseSchema =
|
|
476
|
-
|
|
477
|
-
|
|
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 =
|
|
485
|
-
id:
|
|
486
|
-
label:
|
|
487
|
-
description:
|
|
488
|
-
effortLevels:
|
|
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 =
|
|
467
|
+
var runnerModelCatalogResponseSchema = z7.object({
|
|
491
468
|
runner: runnerSchema,
|
|
492
|
-
models:
|
|
493
|
-
source:
|
|
494
|
-
stale:
|
|
495
|
-
reason:
|
|
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 =
|
|
474
|
+
var modelChoicesSchema = z7.object({
|
|
498
475
|
runner: modelDiscoveryRunnerSchema,
|
|
499
|
-
requestedModel:
|
|
500
|
-
availableModels:
|
|
501
|
-
otherRunners:
|
|
476
|
+
requestedModel: z7.string(),
|
|
477
|
+
availableModels: z7.array(runnerModelOptionSchema),
|
|
478
|
+
otherRunners: z7.array(modelDiscoveryRunnerSchema)
|
|
502
479
|
});
|
|
503
|
-
var openTargetSchema =
|
|
504
|
-
id:
|
|
505
|
-
label:
|
|
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:
|
|
485
|
+
icon: z7.string().optional()
|
|
509
486
|
});
|
|
510
|
-
var openTargetsResponseSchema =
|
|
511
|
-
targets:
|
|
487
|
+
var openTargetsResponseSchema = z7.object({
|
|
488
|
+
targets: z7.array(openTargetSchema)
|
|
512
489
|
});
|
|
513
|
-
var openProjectInSchema =
|
|
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:
|
|
492
|
+
target: z7.string().trim().min(1, "target required").max(200)
|
|
516
493
|
});
|
|
517
|
-
var openProjectInResponseSchema =
|
|
518
|
-
opened:
|
|
519
|
-
path:
|
|
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 =
|
|
524
|
-
var commitShaSchema =
|
|
525
|
-
var requestHashSchema =
|
|
526
|
-
var workerIdsSchema =
|
|
527
|
-
var permissionsSchema =
|
|
528
|
-
var remainingSchema =
|
|
529
|
-
var errorSchema =
|
|
530
|
-
var workerWorkspaceSchema =
|
|
531
|
-
ownerRunId:
|
|
532
|
-
resourceId:
|
|
533
|
-
kind:
|
|
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:
|
|
536
|
-
branch:
|
|
512
|
+
path: z8.string().min(1),
|
|
513
|
+
branch: z8.string().min(1),
|
|
537
514
|
baselineSha: commitShaSchema
|
|
538
515
|
}).strict();
|
|
539
|
-
var workerOutcomeSchema =
|
|
540
|
-
workerId:
|
|
541
|
-
status:
|
|
542
|
-
observedAt:
|
|
543
|
-
summary:
|
|
544
|
-
revision:
|
|
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 =
|
|
547
|
-
var workerWaitSchema =
|
|
548
|
-
id:
|
|
549
|
-
workerIds:
|
|
550
|
-
requestIds:
|
|
551
|
-
requestOutcomes:
|
|
552
|
-
deadline:
|
|
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:
|
|
555
|
-
reason:
|
|
556
|
-
phase:
|
|
557
|
-
outcomes:
|
|
558
|
-
wakeId:
|
|
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:
|
|
561
|
-
var workerDestroyRetrySchema =
|
|
562
|
-
attempts:
|
|
563
|
-
nextAt:
|
|
564
|
-
needsAttention:
|
|
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 =
|
|
567
|
-
requestedAt:
|
|
568
|
-
phase:
|
|
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 =
|
|
574
|
-
requestId:
|
|
575
|
-
workerId:
|
|
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:
|
|
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 =
|
|
581
|
-
var relativeInputPath =
|
|
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 =
|
|
586
|
-
|
|
587
|
-
|
|
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
|
-
|
|
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 =
|
|
595
|
-
text:
|
|
596
|
-
artifacts:
|
|
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:
|
|
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 =
|
|
582
|
+
var workerInputSchema = z8.object({
|
|
606
583
|
source: workerContextReferenceSchema,
|
|
607
|
-
path:
|
|
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:
|
|
588
|
+
bytes: z8.number().int().min(0).max(Number.MAX_SAFE_INTEGER)
|
|
612
589
|
}).strict();
|
|
613
|
-
var workerInputRecipeSchema =
|
|
614
|
-
text:
|
|
615
|
-
inputs:
|
|
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 =
|
|
618
|
-
var deletedEvidenceSchema =
|
|
619
|
-
var executionOutcomeSchema =
|
|
620
|
-
var workerArtifactSchema =
|
|
621
|
-
|
|
622
|
-
unavailableEvidenceSchema.extend({ id:
|
|
623
|
-
deletedEvidenceSchema.extend({ id:
|
|
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 =
|
|
626
|
-
workerId:
|
|
627
|
-
parentRunId:
|
|
628
|
-
revision:
|
|
629
|
-
observedAt:
|
|
630
|
-
status:
|
|
631
|
-
outcome:
|
|
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:
|
|
634
|
-
settled:
|
|
610
|
+
partial: z8.boolean(),
|
|
611
|
+
settled: z8.boolean(),
|
|
635
612
|
error: errorSchema.optional(),
|
|
636
613
|
backend: workerBackendSchema.optional(),
|
|
637
|
-
model:
|
|
614
|
+
model: z8.string().max(512).optional(),
|
|
638
615
|
baselineSha: commitShaSchema,
|
|
639
|
-
workspace: workerWorkspaceSchema.extend({ state:
|
|
640
|
-
cleanup:
|
|
641
|
-
summary:
|
|
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
|
-
|
|
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:
|
|
648
|
-
|
|
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:
|
|
629
|
+
diff: z8.discriminatedUnion("state", [
|
|
653
630
|
// path addresses a workerResultFileSchema JSON document; its diffSnapshot field contains the patch.
|
|
654
|
-
|
|
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:
|
|
659
|
-
|
|
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 =
|
|
665
|
-
var workerResultReferenceSchema =
|
|
666
|
-
workerId:
|
|
667
|
-
revision:
|
|
668
|
-
snapshotId:
|
|
669
|
-
observedAt:
|
|
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:
|
|
648
|
+
previous: z8.object({ revision: z8.number().int().nonnegative(), observedAt: z8.iso.datetime(), lastExecutionOutcome: executionOutcomeSchema }).strict().optional()
|
|
672
649
|
}).strict();
|
|
673
|
-
var delegationStateSchema =
|
|
674
|
-
|
|
675
|
-
role:
|
|
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:
|
|
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:
|
|
686
|
-
finishRequestedAt:
|
|
687
|
-
historyDeletion:
|
|
688
|
-
completion:
|
|
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
|
-
|
|
691
|
-
role:
|
|
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:
|
|
673
|
+
parentRunId: z8.uuid(),
|
|
697
674
|
workspace: workerWorkspaceSchema,
|
|
698
675
|
destroy: workerDestroySchema.optional(),
|
|
699
676
|
context: workerInputRecipeSchema.optional(),
|
|
700
|
-
executionRevision:
|
|
701
|
-
executionStartSeq:
|
|
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
|
-
|
|
681
|
+
z8.object({ role: z8.literal("invalid") }).strict()
|
|
705
682
|
]);
|
|
706
|
-
var runDelegationSummarySchema =
|
|
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:
|
|
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 =
|
|
722
|
-
task:
|
|
723
|
-
baseline:
|
|
724
|
-
requestId:
|
|
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:
|
|
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:
|
|
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:
|
|
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 =
|
|
735
|
-
text:
|
|
711
|
+
var workerSteerRequestSchema = z8.object({
|
|
712
|
+
text: z8.string().max(1e5).refine((text) => text.trim().length > 0)
|
|
736
713
|
}).strict();
|
|
737
|
-
var workerWaitRequestSchema =
|
|
714
|
+
var workerWaitRequestSchema = z8.object({
|
|
738
715
|
workerIds: workerIdsSchema,
|
|
739
|
-
timeoutSeconds:
|
|
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 =
|
|
743
|
-
receiptId:
|
|
744
|
-
generation:
|
|
745
|
-
expiresAt:
|
|
746
|
-
acknowledgedAt:
|
|
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:
|
|
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 =
|
|
727
|
+
var agentInputSchema = z8.object({
|
|
751
728
|
conversation: conversationAttributionSchema.optional(),
|
|
752
|
-
id:
|
|
753
|
-
source:
|
|
754
|
-
parentRunId:
|
|
755
|
-
text:
|
|
756
|
-
createdAt:
|
|
757
|
-
deliveredAt:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
774
|
-
deadline:
|
|
750
|
+
requestHash: z8.string().regex(/^[0-9a-f]{64}$/).optional(),
|
|
751
|
+
deadline: z8.iso.datetime().optional()
|
|
775
752
|
}).strict();
|
|
776
|
-
var workerInspectionSchema =
|
|
777
|
-
workerId:
|
|
778
|
-
parentRunId:
|
|
779
|
-
status:
|
|
780
|
-
currentStepId:
|
|
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:
|
|
784
|
-
inputs:
|
|
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:
|
|
799
|
-
settled:
|
|
800
|
-
destroyed:
|
|
775
|
+
revision: z8.number().int().nonnegative(),
|
|
776
|
+
settled: z8.boolean(),
|
|
777
|
+
destroyed: z8.boolean()
|
|
801
778
|
}).strict();
|
|
802
|
-
var workerListResultSchema =
|
|
803
|
-
var workerListQuerySchema =
|
|
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:
|
|
806
|
-
nextOffset:
|
|
782
|
+
workers: z8.array(workerListEntrySchema).max(32),
|
|
783
|
+
nextOffset: z8.number().int().min(1).max(1024).optional()
|
|
807
784
|
}).strict();
|
|
808
|
-
var workerDiffSchema =
|
|
809
|
-
workerId:
|
|
785
|
+
var workerDiffSchema = z8.object({
|
|
786
|
+
workerId: z8.uuid(),
|
|
810
787
|
baselineSha: commitShaSchema,
|
|
811
|
-
diff:
|
|
812
|
-
truncated:
|
|
813
|
-
});
|
|
814
|
-
var workerStopResultSchema =
|
|
815
|
-
workerId:
|
|
816
|
-
state:
|
|
817
|
-
});
|
|
818
|
-
var workerDestroyResultSchema =
|
|
819
|
-
workerId:
|
|
820
|
-
state:
|
|
821
|
-
deleted:
|
|
822
|
-
|
|
823
|
-
|
|
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 =
|
|
829
|
-
outstanding:
|
|
830
|
-
limit:
|
|
831
|
-
created:
|
|
832
|
-
creationLimit:
|
|
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 =
|
|
835
|
-
id:
|
|
836
|
-
title:
|
|
837
|
-
titleSummary:
|
|
838
|
-
titleOrigin:
|
|
839
|
-
});
|
|
840
|
-
var runRelationshipsSchema =
|
|
841
|
-
parentRunId:
|
|
842
|
-
workers:
|
|
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:
|
|
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 =
|
|
849
|
-
code:
|
|
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 =
|
|
864
|
-
var workerSpawnResultSchema =
|
|
865
|
-
var workerSteerResultSchema =
|
|
866
|
-
var workerWaitResultSchema =
|
|
867
|
-
var workerEmptyRequestSchema =
|
|
868
|
-
var workerCancelWaitRequestSchema =
|
|
869
|
-
var workerCancelWaitResultSchema =
|
|
870
|
-
var peerWaitRequestSchema =
|
|
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:
|
|
849
|
+
timeoutSeconds: z8.number().int().min(1).max(7200).default(600)
|
|
873
850
|
}).strict();
|
|
874
|
-
var peerWaitResultSchema =
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
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 =
|
|
884
|
-
id:
|
|
860
|
+
var peerWaitViewSchema = z8.object({
|
|
861
|
+
id: z8.uuid(),
|
|
885
862
|
peerIds: workerIdsSchema,
|
|
886
|
-
deadline:
|
|
887
|
-
phase:
|
|
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 =
|
|
891
|
-
var peerCancelWaitResultSchema =
|
|
892
|
-
var delegationWaitResultSchema =
|
|
893
|
-
var delegationCancelWaitResultSchema =
|
|
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 =
|
|
897
|
-
seq:
|
|
898
|
-
ts:
|
|
899
|
-
stepId:
|
|
900
|
-
type:
|
|
901
|
-
});
|
|
902
|
-
var conversationMessageEventSchema = runEventSchema.extend({ type:
|
|
903
|
-
var requestOutcomeEventSchema = runEventSchema.extend({ type:
|
|
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:
|
|
882
|
+
type: z9.literal("agent-input"),
|
|
906
883
|
input: agentInputSchema
|
|
907
884
|
});
|
|
908
885
|
var humanInputDeliveredEventSchema = runEventSchema.extend({
|
|
909
|
-
type:
|
|
910
|
-
askSeq:
|
|
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:
|
|
891
|
+
source: z9.enum(["human", "parent", "cezar"]).optional()
|
|
915
892
|
});
|
|
916
893
|
var humanAskClosedEventSchema = runEventSchema.extend({
|
|
917
|
-
type:
|
|
918
|
-
askSeq:
|
|
919
|
-
reason:
|
|
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:
|
|
923
|
-
askSeq:
|
|
924
|
-
messageId:
|
|
925
|
-
parentRunId:
|
|
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:
|
|
929
|
-
askSeq:
|
|
930
|
-
reason:
|
|
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:
|
|
934
|
-
askSeq:
|
|
935
|
-
reason:
|
|
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:
|
|
915
|
+
type: z9.literal("worker-outcome"),
|
|
939
916
|
outcome: workerOutcomeSchema
|
|
940
917
|
});
|
|
941
918
|
var RUN_HISTORY_PAGE_ITEMS = 100;
|
|
942
|
-
var runIdParamSchema =
|
|
943
|
-
id:
|
|
919
|
+
var runIdParamSchema = z9.object({
|
|
920
|
+
id: z9.string().min(1).max(128).regex(/^[A-Za-z0-9._-]+$/)
|
|
944
921
|
});
|
|
945
|
-
var runHistoryCursorSchema =
|
|
946
|
-
var runHistoryQuerySchema =
|
|
922
|
+
var runHistoryCursorSchema = z9.string().min(1).max(2048);
|
|
923
|
+
var runHistoryQuerySchema = z9.object({
|
|
947
924
|
cursor: runHistoryCursorSchema.optional()
|
|
948
925
|
});
|
|
949
|
-
var runEventsQuerySchema =
|
|
926
|
+
var runEventsQuerySchema = z9.object({
|
|
950
927
|
cursor: runHistoryCursorSchema.optional(),
|
|
951
|
-
afterSeq:
|
|
952
|
-
});
|
|
953
|
-
var runHistoryEventSchema =
|
|
954
|
-
seq:
|
|
955
|
-
ts:
|
|
956
|
-
stepId:
|
|
957
|
-
type:
|
|
958
|
-
}).catchall(
|
|
959
|
-
var runHistoryPageSchema =
|
|
960
|
-
events:
|
|
961
|
-
itemCount:
|
|
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:
|
|
966
|
-
hasOlder:
|
|
967
|
-
});
|
|
968
|
-
var runHistoryContextSchema =
|
|
969
|
-
contextEvents:
|
|
970
|
-
asOfSeq:
|
|
971
|
-
});
|
|
972
|
-
var checkoutProgressEventSchema =
|
|
973
|
-
checkoutId:
|
|
974
|
-
name:
|
|
975
|
-
phase:
|
|
976
|
-
line:
|
|
977
|
-
error:
|
|
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:
|
|
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
|
|
1005
|
+
import { z as z11 } from "zod";
|
|
1029
1006
|
|
|
1030
1007
|
// ../contract/src/repo-info.ts
|
|
1031
|
-
import { z as
|
|
1032
|
-
var repoInfoSchema =
|
|
1033
|
-
root:
|
|
1034
|
-
branch:
|
|
1035
|
-
remote:
|
|
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 =
|
|
1040
|
-
name:
|
|
1041
|
-
available:
|
|
1042
|
-
version:
|
|
1043
|
-
hint:
|
|
1044
|
-
});
|
|
1045
|
-
var forgeInfoSchema =
|
|
1046
|
-
kind:
|
|
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:
|
|
1055
|
-
reason:
|
|
1031
|
+
available: z11.boolean().optional(),
|
|
1032
|
+
reason: z11.string().optional()
|
|
1056
1033
|
});
|
|
1057
|
-
var capabilitiesSchema =
|
|
1058
|
-
localHandoff:
|
|
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:
|
|
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:
|
|
1067
|
-
singleProject:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
1084
|
+
tokenUsageMetrics: z11.boolean(),
|
|
1108
1085
|
/** Current backend-reported-cost presentation policy. */
|
|
1109
|
-
costMetrics:
|
|
1086
|
+
costMetrics: z11.boolean()
|
|
1110
1087
|
});
|
|
1111
|
-
var healthResponseSchema =
|
|
1112
|
-
version:
|
|
1113
|
-
latestVersion:
|
|
1114
|
-
repoRoot:
|
|
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:
|
|
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:
|
|
1124
|
-
bootProject:
|
|
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:
|
|
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(),
|