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